Run datporod and return the estimated Porod volume.

    Returns:
         Radius of gyration found in the input file
         I0 found in the input file
         Vporod: the estimated Porod volume
5664
def datporod(gnomoutfile):
    
    results = subprocess.check_output(['datporod', gnomoutfile]).decode('utf-8').strip().split()
    return float(results[0]), float(results[1]), float(results[2])
74199
def sigma(self):
        
        return int(round(self.oriented_unit_cell.volume / self.init_cell.volume))
1129318
def std(self) -> Optional[float]:  #, ddof=0):
        
        # TODO: Add DOF
        if self._stats:
            return np.sqrt(self.variance())
        else:
            return None
985996
def getEmpTraitCovar(self):
        
        if self.P==1:
            out=self.Y[self.Iok].var()
        else:
            out=SP.cov(self.Y[self.Iok].T)
        return out
804780
def find_inouts_mp(voxel_grid, datapts, **kwargs):
    
    tol = kwargs.get('tol', 10e-8)
    num_procs = kwargs.get('num_procs', 4)
    with pool_context(processes=num_procs) as pool:
        filled = pool.map(partial(is_point_inside_voxel, ptsarr=datapts, tol=tol), voxel_grid)
    return filled
1181544
def extract_surfaces(pvol):
    
    if pvol.pdimension != 3:
        raise GeomdlException("The input should be a spline volume")
    if len(pvol) != 1:
        raise GeomdlException("Can only operate on single spline volumes")

    # Get data from the volume object
    vol_data = pvol.data
    rational = vol_data['rational']
    degree_u = vol_data['degree'][0]
    degree_v = vol_data['degree'][1]
    degree_w = vol_data['degree'][2]
    kv_u = vol_data['knotvector'][0]
    kv_v = vol_data['knotvector'][1]
    kv_w = vol_data['knotvector'][2]
    size_u = vol_data['size'][0]
    size_v = vol_data['size'][1]
    size_w = vol_data['size'][2]
    cpts = vol_data['control_points']

    # Determine object type
    obj = shortcuts.generate_surface(rational)

    # u-v plane
    surflist_uv = []
    for w in range(size_w):
        surf = obj.__class__()
        surf.degree_u = degree_u
        surf.degree_v = degree_v
        surf.ctrlpts_size_u = size_u
        surf.ctrlpts_size_v = size_v
        surf.ctrlpts2d = [[cpts[v + (size_v * (u + (size_u * w)))] for v in range(size_v)] for u in range(size_u)]
        surf.knotvector_u = kv_u
        surf.knotvector_v = kv_v
        surflist_uv.append(surf)

    # u-w plane
    surflist_uw = []
    for v in range(size_v):
        surf = obj.__class__()
        surf.degree_u = degree_u
        surf.degree_v = degree_w
        surf.ctrlpts_size_u = size_u
        surf.ctrlpts_size_v = size_w
        surf.ctrlpts2d = [[cpts[v + (size_v * (u + (size_u * w)))] for w in range(size_w)] for u in range(size_u)]
        surf.knotvector_u = kv_u
        surf.knotvector_v = kv_w
        surflist_uw.append(surf)

    # v-w plane
    surflist_vw = []
    for u in range(size_u):
        surf = obj.__class__()
        surf.degree_u = degree_v
        surf.degree_v = degree_w
        surf.ctrlpts_size_u = size_v
        surf.ctrlpts_size_v = size_w
        surf.ctrlpts2d = [[cpts[v + (size_v * (u + (size_u * w)))] for w in range(size_w)] for v in range(size_v)]
        surf.knotvector_u = kv_v
        surf.knotvector_v = kv_w
        surflist_vw.append(surf)

    # Return shapes as a dict object
    return dict(uv=surflist_uv, uw=surflist_uw, vw=surflist_vw)
1026146
def diam_pipeminor(FlowRate, HeadLossExpans, KMinor):
    
    #Checking input validity
    ut.check_range([FlowRate, ">0", "Flow rate"], [KMinor, ">=0", "K minor"],
                   [HeadLossExpans, ">0", "Headloss due to expansion"])
    return (np.sqrt(4 * FlowRate / np.pi)
            * (KMinor / (2 * gravity.magnitude * HeadLossExpans)) ** (1/4)
            )
1167402
def mount_point(self):
        
        if self._mount_point is None:
            cmd_create = ["podman", "create", self.target_name, "some-cmd"]
            self._mounted_container_id = subprocess.check_output(cmd_create).decode().rstrip()
            cmd_mount = ["podman", "mount", self._mounted_container_id]
            self._mount_point = subprocess.check_output(cmd_mount).decode().rstrip()
        return self._mount_point
47709
def optimise_xy(xy, *args):
    """"""
    z, elements, coordinates = args
    window_com = np.array([xy[0], xy[1], z])
    return -pore_diameter(elements, coordinates, com=window_com)[0]
182629
def logical_volume(cls, file_path, sudo=False):
		
		mp = WMountPoint.mount_point(file_path)
		if mp is not None:
			name_file = '/sys/block/%s/dm/name' % mp.device_name()
			if os.path.exists(name_file):
				lv_path = '/dev/mapper/%s' % open(name_file).read().strip()
				return WLogicalVolume(lv_path, sudo=sudo)
1314568
def volume(self):
        
        sizes = self.compute_cell_sizes(length=False, area=False, volume=True)
        return np.sum(sizes.cell_arrays['Volume'])
1301175
def R(self):
        ''
        self._check_estimated()
        if not self._estimation_finished:
            self._finish_estimation()
        return self._R
459865
def opt_pore_diameter(elements, coordinates, bounds=None, com=None, **kwargs):
    """"""
    args = elements, coordinates
    if com is not None:
        pass
    else:
        com = center_of_mass(elements, coordinates)
    if bounds is None:
        pore_r = pore_diameter(elements, coordinates, com=com)[0] / 2
        bounds = (
            (com[0]-pore_r, com[0]+pore_r),
            (com[1]-pore_r, com[1]+pore_r),
            (com[2]-pore_r, com[2]+pore_r)
        )
    minimisation = minimize(
        correct_pore_diameter, x0=com, args=args, bounds=bounds)
    pored = pore_diameter(elements, coordinates, com=minimisation.x)
    return (pored[0], pored[1], minimisation.x)
456171
def dilate_obs(self, dilation_radius):
        
        for s in self.size_thresholds:
            self.dilated_obs[s] = np.zeros(self.window_obs[self.mrms_variable].shape)
            for t in range(self.dilated_obs[s].shape[0]):
                self.dilated_obs[s][t][binary_dilation(self.window_obs[self.mrms_variable][t] >= s, iterations=dilation_radius)] = 1
887364
def correct_pore_diameter(com, *params):
    """"""
    elements, coordinates = params
    return (-pore_diameter(elements, coordinates, com)[0])
37713
def volume(self):
        

        response = self.renderingControl.GetVolume([
            ('InstanceID', 0),
            ('Channel', 'Master'),
        ])
        volume = response['CurrentVolume']
        return int(volume)
215500
def head_orifice(Diam, RatioVCOrifice, FlowRate):
    """"""
    #Checking input validity
    ut.check_range([Diam, ">0", "Diameter"], [FlowRate, ">0", "Flow rate"],
                   [RatioVCOrifice, "0-1", "VC orifice ratio"])
    return ((FlowRate
             / (RatioVCOrifice * area_circle(Diam).magnitude)
             )**2
            / (2*gravity.magnitude)
            )