comet.pyhed.loop package

Submodules

comet.pyhed.loop.loop_bib module

Part of comet/pyhed/loop

This script contains the main class for the sources as well as several scripts for the initialization of loop classes (build… ).

class comet.pyhed.loop.loop_bib.Geometry[source]

Bases: object

class comet.pyhed.loop.loop_bib.Loop(Input, config=None, verbose=False)[source]

Bases: object

Class for the computation of arbitrary shaped polygon loops. Some functions automatically return this loopclass as result. It is recommended to use these (you may take a look at the example)

Parameters:
  • Input (string or raw loop class) – Filename of a prior saved loopfile (recommended). Alternatively the output of the function computeLoopPositions (not recommended). For the latter case plenty of convenience functions are found in the the loop submodule of pyhed starting with “build”….
  • config (string or pyhed.config) – Defines the configuration file for the loop.

Example

>>> # example: import
>>> loopclass = Loop('path/to/loopfile')
>>> # example: create circular loop
>>> loopclass = buildCircle(10, 12)  # 10 m radius, 12 dipoles
calcAndExportFieldsForFenics(export_vtk=False, num_cpu=32, **kwargs)[source]

Calculates and export primary fields for fenics secondary field calculation.

Parameters:kwargs (dict) – Keyword parameters are redirected to calculate.
calculate(num_cpu=12, loop_mesh=None, dipole_mesh=None, interpolate=False, savename=None, cell_center=False, verbose=False, mode='auto', matrix=False, field_matrix=None, max_node_count=None, **kwargs)[source]

Computation of the loop field with respect to the config.

Parameters:
  • num_cpu (integer [ 12 ]) – Maximum number of processes allowed for this task.

  • loop_mesh (string or mesh instance [ None ]) – Optional. Possibility to give a user defined mesh for the calculation.

  • dipole_mesh (string or mesh instance [ None ]) – Optional. Possibility to give a user defined mesh for the calculation (interpolate=True or matrix=True only).

  • interpolate (boolean [ True ]) – The loop dipoles can either be calculated directly (False) or once on a seperated mesh (dipolemesh) and then interpolated to the loopmesh (True). If a dipoleFieldName is given, this field will be used for the interpolation.

  • savename (string [ None ]) – Optional. If savename is not None, the loop will be saved under the name defined in savename.

  • cell_center (boolean [ True ]) – A default the field of the loop will be calculated at the cell center of the mesh cells. This flag allows for calculation at the mesh nodes. Affects only the definition of the final loopmesh, the dipolemesh will always be calculated at the nodes for interpolation reasons.

  • verbose (boolean [ False ]) – Turn on verbose mode.

  • mode (string [ ‘auto’ ]) – Five posibilities: ‘auto’, ‘config’, ‘te’, ‘tm’, ‘tetm’

    ‘auto’: Automatic detection wether the loop is grounded or not. Grounded wires are calculated with te and tm mode (see HED). Non grounded wires are calculated with te mode only (sufficient).

    ‘config’: the default config decides the mode the field is calculated in.

    ‘te’, ‘tm’, ‘tetm’: Calculates the field in the choosen mode.

  • matrix (boolean [ False ]) – Alternatively calculation approach. At first the field on a highly dense dipole mesh will be triggered. After that the field will be interpolated to the single dipole positions by the means of a matrix vector multiplication with a matrix containing appropriate weighting factors. This Approach takes longer than direct calculation in the first run, but the calculated matrix can be used for further calculations with different frequencies or resistivity models (as long as the loopmesh and dipolemesh remain the same).

  • field_matrix (list or string [ None ]) – Interpolation matrices or file path if calculation with matrix=True. Will be calculated automatically if None.

  • max_node_count (integer [ None ]) – As all points will be calculated at once, the computational effort scales lineary with the reciever count, the transmitter count and the used hankel factors. If the limits of the available memory is reached max_node_count can be used to define the maximum chunk of nodes to be computated at once. Other nodes will be computed afterwards.

Keyword Arguments:
 
  • arguments are redirected to loop.save and to define (Keyword) –
  • drop_tol (float [ 1e-2 ]) in the cylindrical coordinate (the) –
  • to avoid instabilities around the source. (transformation) –
calculateDipoleField(verbose=False, drop_tol=0.01, num_cpu=12, max_node_count=None)[source]

Calculates field on dipole mesh.

Parameters:
  • verbose (boolean [ False ]) – Turn on verbose mode.
  • drop_tol (float [ 1e-2 ]) – Singularity fix. All horizontal distances between drop_tol and the transmitter dipole are placed between the first reciever outside the tolerance and the tolerance, maintaining the correct order and angle.
  • num_cpu (integer [ 12 ]) – Maximum number of processes allowed for this task.
  • max_node_count (integer [ None ]) – As all points will be calculated at once, the computational effort scales lineary with the reciever count, the transmitter count and the used hankel factors. If the limits of the available memory is reached max_node_count can be used to define the maximum chunk of nodes to be computated at once. Other nodes will be computed afterwards.
calculateFieldFromMatrix()[source]

Calculates the primary field on basis of the interpolation matrix and the dipole field.

calculateFieldMatrix(num_cpu=8, verbose=False)[source]

If wished the calcualtion of the total loop field can be done by interpolation and superposition of one highly accurate dipole field to the different transmitter positions of the loop. This is done either done directly or via a vector matrix multiplication.

This function is called to initialize and append the weights to the interpolation matrix from the dipolemesh to the loopmesh for all tx positions with respect to pos, phi, and ds.

This function will be called if calculate is called with matrix=True.

Parameters:
  • num_cpu (integer [ 8 ]) – Define the maximum number of cores allowed for this operation.
  • verbose (boolean [ False ]) – Turn on verbose mode.
calculateInterpolationMatrix(Pos)[source]

Calculates the interpolation matrix.

If one wished the field can be interpolated to another mesh. The interpolation matrix from the loopmesh to an arbitrary set of coordinates is calculated with this function. This function is called to initialize and append the weights to the interpolation matrix.

Note: The loop class does not hold a reference of the resulting matrix, instead gives it back to the caller.

Parameters:Pos (np.ndarray or pg.core.PosVector) – Transmitter positions of shape (n, 3) with n positions. Values are expected to be floats (the conversion to a pg.PosVector will not check again).
Returns:mat – Sparse interpolation matrix with number of columns equal to the number of nodes in the loopmesh and number of rows equal to the number of input positions.
Return type:pg.core.SparseMapMatrix
calculateSecField(num_cpu=8, **kwargs)[source]

Calculates the secondary field using custEM.

Calculates primary field as well if not found.

Needs a FEM suited mesh as well as a parameter distribution provided by other functions of this class (See createFEMMesh and prepareSecondaryFieldCalculation).

Parameters:
  • num_cpu (integer [ 8 ]) – Maximum number of processes allowed for this task. The actual calculation will be done in an mpirun environment with the selected number of cores.
  • kwargs (dict) – Keyword arguments are redirected to local_apps.
createDefaultSecondaryConfig(base=None, prefix='', suffix='', m_dir='.', r_dir='.')[source]

Short cut to generate a secondary config with some default params.

Parameters:
  • prefix (string) – String to be added to the getDefaultLoopMeshBaseName string to define the automatic generated names for the default secondary config.
  • suffix (string) – String to be added to the getDefaultLoopMeshBaseName string to define the automatic generated names for the default secondary config.
createDipoleMesh(quadratic=True, savename='_default_dipole_mesh.bms', save=False, verbose=False)[source]

Creates a suitable dipole mesh for calculation via a single dipole.

Parameters:
  • quadratic (boolean [ True ]) – If chosen, uses a quadratic (2nd order) mesh for dipole calculation.
  • savename (string [ ‘_default_dipole_mesh.bms’ ]) – Define output name.
  • save (boolean [ True ]) – Additional save of dipole mesh under savename.
  • verbose (boolean [ False ]) – Turn on verbose mode.
createFEMMesh(para_mesh_2d=None, savename=None, exportVTK=False, exportH5=True, box_x=[None, None], box_y=[None, None], box_z=None, box_cell_size=None, source_poly=None, source_setup='edges', source_loops=None, inner_area_cell_size=0.3, outer_area_cell_size=10, subsurface_cell_size=None, poly_2d=None, number_of_loops=None, **kwargs)[source]

Builds the FEM mesh for the secondary field computation.

Needs at least on of the two possible parameter meshes in order to continue.

para_mesh_2d: string or pg.Mesh [ None ]
Used to get the outer dimensions of the FEMMesh.
savename: string [ None ]
Define output save name of FEM mesh. Default name will be generated if None. If no savename is given, the dafaultname will be ‘_default_LoopMesh’ + looptype + number of dipoles.
exportVTK: boolean [ False ]
Turn on optional vtk export.
source_setup: string [ ‘edges’ ]
Defines the way the sources are incorporated into the mesh. “nodes” simply insert the dipole positions (fallback), “edges” defines strait edges between the nodes (usually the best approach). “etra” can be used for a special setup where multiple loops are build in an elongated transmitter with inline receiver array. Raises an exception if source_setup differs from the three options.
source_loops: list [ None ]
If a list of loop classes is given, their tx representation after custEM is implemented in the mesh for custEM magnetic field calculations using automatic source detection.
inner_area_cell_size: float [ 0.3 ]
Maximum allowed area (m²) for all cell in the source plane within the source polygons (if closed loop). Very important for kernel calculation! See tutorial for custEM for further explanations.
outer_area_cell_size: float [ 10 ]
Maximum allowed area (m²) for all cells in the source plane outside the source polygons (or anywhere for not closed loop). See tutorial for custEM for further explanations.
subsurface_cell_size: float [ None ]
Maximum allowed volume (m³) for all cells within inner mesh box (not the tetrahedron boundary to 10 km). Optional.
limits: list of len 2 [ None ]
Minimum and maximum y value, the anomalies should be set in the fem mesh. Uses the x limits of the 2D parameter mesh as default if None.
custEM:
Install via conda on Linux only. See install instructions of comet.
createLoopMesh(savename=None, exportVTK=False, airspace=False, verbose=False, xmax=None, xmin=None, ymax=None, ymin=None, zmin=None)[source]

Builds the mesh where the loop will be calculated in.

savename: string [ None ]
Saves the created mesh under savename, as long as savenmae is not none. If no basename is given, the dafaultname will be ‘_default_LoopMesh’ + looptype + number of dipoles + ‘.bms’.
exportVTK: boolean [ False ]
Switch to export the resulting mesh to a vtk with the given savename.
airspace: boolean [ False ]
Enables airspace.
verbose: boolean [ False ]
Turn on berbose mode.
createSecondaryConfig(mod_name, mesh_name, m_dir='.', r_dir='.', pf_name=None, p2=False, approach='E_s', pf_EH_flag='E')[source]

Initializes an instance of a secondary config for use of custEM.

Parameters:
  • mod_name (string) – Name of the mod instance (for saving and import in mpi environment)
  • mesh_name (string) – Basename of mesh imported by the fenics functions (.h5). Mind the subfolder ‘/_h5’ that will be added to the string.
  • m_dir (string) – Path to mesh directory of custEM.
  • r_dir (string) – Path to result directory of custEM.
  • pf_name (string) – File name under which the primary field will be saved in the appropriate directory of custEM.
effectiveArea()[source]

Returns self.area * self.turns (0 for not closed loops).

exportFenicsHDF5Mesh(save_h5, dipole_mesh=False, **kwargs)[source]

Exports the mesh in a h5 file. Can save the loopmesh or the dipole mesh seperately.

Need pygimli to work.

Parameters:
  • save_h5 (string) – Filename of the resulting h5 mesh (hdf5 data container in fenics syntax).
  • dipole_mesh (boolean [ False ]) – Save dipole mesh instead of loop mesh (Call this function twice if you want to save both meshes).
  • kwargs (dict) – Keyword arguments are redirected to pygimli.meshtools.exportFenicsHDF5Mesh
exportVTK(save_vtk, secondary=False, **kwargs)[source]

Exports the field in a vtk file.

Uses the loopmesh to save field with default configurations in a vtk file.

Parameters:
  • save_vtk (string) – Filename of the resulting vtk file.
  • kwargs (dict) – Keyword arguments are redirected to the function pyhed.IO.savefieldvtk.
getCustEMLoopTx(max_length)[source]
getDefaultLoopMeshBaseName()[source]

Returns string with default base name of the loop mesh.

getParaMesh2D()[source]
initCustEM(secondary_config=None, init_primary_field_class=True, procs_per_proc=2)[source]

Initalizes instance of custEM mod class for FEM calculation.

Parameters:
  • secondary_config (string or pyhed.SecondaryConfig [ None ]) – Initialized secondary config class to be used for the mod instance or path to corresponding file containing the secondary config. Uses secondary_config over loop.secondary_config. Throws Exception if both values are None.
  • init_primary_field_class (boolean [ True ]) – Additionally initializing the primary field class of the mod class instance (used for primary field export).
load(savename=None, config=None, config2=None, verbose=True, load_meshes=True, overwrite_dir=False)[source]

Load Loop from files.

Parameters:
  • savename (string [ None ]) – Basename of the lop class files. Other names are autogenerated using this basename.
  • config (string [ None ]) – Tell the load function to explicitely load config from given path. Else the saved filepath in the main archive is used.
  • config2 (string [ None ]) – See config, but for secondary configuration.
  • verbose (boolean [ True ]) – Turn on verbose mode.
  • load_meshes (boolean [ True ]) – If originally saved, the meshes are loaded by default. However, this takes more time then the rest of the load function and can be ommitted if only the other parts are of interest.
loadFieldMatrix(name, verbose=True)[source]

Loads the three matrices needed for recalculation of the primary field from numpy archive. See saevFieldmatrix for detailed description.

Parameters:
  • name (string) – Path to file to be loaded.
  • verbose (boolean [ True ]) – Turn on verbose mode.
loadSecondaryConfig(savename=None)[source]

Imports previously saved secondary config.

Parameters:savename (string [ None ]) – Used savename over loop.sec_savename. Throws Exception if both values are None. Replaces loop.sec_savename.
model
para_mesh_2d
prepareSecondaryFieldCalculation(savename=None, secondary_config=None, fem_mesh=None, para_mesh_2d=None, set_marker=False, anomaly_vector=None, valid_marker=None, verbose=False, num_cpu=32, force_primary=False, export_vtk=False, mod_name=None, **kwargs)[source]

Based on the given secondary config a MOD instance using the third party module custEM will be initialized. This includes the optional generation of a FEM suited mesh containing resistivity information from a 2D parameter mesh.

Parameters:
  • savename (string [ None ]) – Name under which loopclass and secondary config (+= ‘_sec.cfg’) are to be saved. Needed for secondary approach.
  • secondary_config (pyhed.SecondaryConfig or string [ None ]) – Filename of configuration file or initialized class instance of a secondary configuration. Optional if already given manually.
  • fem_mesh (pg.Mesh or string [None]) – FEM suited mesh or filename, respectively. Optional. If not given a suited mesh will be generated if a valid para_mesh_2d is provided.
  • para_mesh_2d (pg.Mesh or string [ None ]) – 2D parameter mesh providing cell indices for the appending of resitivity information. Needed for automatic FEM mesh generation. Can be set manually beforehand.
  • set_marker (boolean [ True ]) – Flag to decide if the fem mesh has got the needed marker for the resitivity distribution. Can be omitted if already done and saved (e.g. if same mesh is used again).
  • anomaly_vector (np.ndarray [ None ]) – Conductivity values [S/m] of the parameter mesh to be used in the seocondary field approach. Uses given value over array found in secondary config. Raises Exception if neither found nor given.
  • ground_marker (np.ndarray [ None ]) – Corresponding marker for each entry in the anomaly vector. Each marker corresponds to a layer number of the 1d primary field beginning at 1 for the first layer, counting upward (0 belongs to the air layer). None results in np.ones_like(anomaly_vector, dtype=int).
  • verbose (boolean [ False ]) – Turn on verbose mode.
  • num_cpu (integer [ 32 ]) – Maximum number of processes allowed for this task.
  • force_primary (boolean [ False ]) – Force a recalculation of the primary field.
  • mod_name (string or None [ None ]) – Overrides mod name. Useful if looping over many loops, as default name could be similar.
  • magnetic (boolean [ True ]) – Prepares magnetic primary fields. If False only dummies are created to avoid error messages from custEM during import. Set to False if secondary electric approach is used for secondary field calculation.
  • electric (boolean [ True ]) – Prepares electric primary fields. If False only dummies are created to avoid error messages from custEM during import. Set to False if secondary magnetic approach is used for secondary field calculation.
  • Returns
  • ——–
  • tuple ((savename, sec_savename)) – Absolute file paths for the secondary approach.
  • Usage
  • ——
  • In order to prepare a secondary field calculation you need
  • - a secondary config (default is provided)
  • - a conductivity vector (*)
  • - a 2d parameter mesh matching the anomalies (*)
  • - a marker_vector (*)
  • *if not in secondary config or proviedd beforehand
  • and optionally either
  • - fem_mesh (without marker -> set_marker=True (default))
  • or
  • - fem_mesh (with marker -> set_marker=False)
  • or
  • - no fem_mesh (auto creation)
save(savename=None, config_savename=None, config2_savename=None, save_mesh=True, save_field=True)[source]

Saves the loop class in files.

Saves npz archive with loop itself.

Saves config.

Saves secondary config if initialized.

Saves mesh if save_mesh=True.

Saves field if save_field=True.

Parameters:
  • savename (string [ None ]) – File basename for saving loop class and its components.
  • config_savename (string [ None ]) – Explicit savename for config. Automatically generated if None.
  • config2_savename (string [ None ]) – Explicit savename for secondary config. Automatically generated if None.
  • save_mesh (boolean [ True ]) – Saves mesh.
  • save_field (boolean [ True ]) – Saves fields.
saveFieldMatrix(name, verbose=True)[source]

Saves the three matrices needed for recalculation of the primary field.

A compressed numpy archive is loaded and the matrices are build afterwards, therefore import time is ~20% higher compared to the pure pygimli way ( .field_matrix.save(’…’) ). However, because the single arrays (indices and values) are saved in one compressed file archive they need only one third space on the hard disk compared to saving three separate matrices using pygimli syntax.

Parameters:
  • name (string) – Path for file to be saved.
  • verbose (boolean [ True ]) – Turn on verbose mode.
saveLoopMesh(savename=None)[source]

Saves loopmesh using the given savename or an autogenerated name.

Updates self.loop_mesh_name in case of changes.

Parameters:savename – Export path name. Used over default name if given.
saveSecondaryConfig(savename=None)[source]

Saves secondary config in ASCII file.

Parameters:savename (string [ None ]) – Used savename over loop.sec_savename. Throws Exception if both values are None. Replaces loop.sec_savename.
setAnomalies(anomaly, sort=True)[source]

Handle anomaly vector and marker of the 2d parameter mesh.

Parameters:
  • anomaly (array_like [ None ]) – Vector with conductivities in S/m. Expect one entry for each cell in parameter mesh.
  • sort (boolean [ False ]) – If True, set the same marker for double values in anomaly vector. This is for blocky 2d structures, where only a few different regions are required. Use default False if dealing with smooth inversion results, for example in a structural coupling.
setDipoleMesh(mesh, savename='_default_dipole_mesh', verbose=True)[source]

Sets the dipolemesh and saves it under savename.

Parameters:
  • mesh (string or mesh instance) – Pygimli mesh instance or file path to pygimli mesh.
  • savename (string [ None ]) – Used savename for mesh, if mesh is already a mesh instance.
  • verbose (boolean [ False ]) – Turn on verbose mode.
setFEMMarker_old(valid_marker=None)[source]

Sets and checks the domain marker of the 3D FEM mesh.

Parameters:valid_marker (array_like [ None ]) – If None, checks which domains of the 2D mesh are actually transferred to the 3D FEM mesh. The markers are saved in the valid_marker attribute. If given, sets vector directly after some checks.
setFEMMesh(mesh, valid_marker=None, savename=None)[source]

Sets the FEM mesh as loopmesh and handles the domain markers.

Parameters:
  • mesh (string or mesh instance) – Pygimli mesh instance or file path to pygimli mesh.
  • valid_marker (array_like [ None ]) – If None, checks which domains of the 2D mesh are actually transferred to the 3D FEM mesh. The markers are saved in the valid_marker attribute. If given, sets vector directly after some checks.
  • savename (string [ None ]) – Useful if multiple loops are using the same mesh (saves diskspace). Ignored if mesh is a string already.
  • Calls *_setFEMMarker* is paramesh has been set.
  • Furthermore calls *updateFEMAnomaly* if anomaly has been set through
  • either *setParamesh2D* or *setAnomaly*
  • Produces error message if valid_marker array is given, but no paramesh
  • is found
setFEMMesh_old(mesh, valid_marker=None, savename=None)[source]

Sets the FEM mesh as loopmesh and handles the domain markers.

Parameters:
  • mesh (string or mesh instance) – Pygimli mesh instance or file path to pygimli mesh.
  • valid_marker (array_like [ None ]) – If None, checks which domains of the 2D mesh are actually transferred to the 3D FEM mesh. The markers are saved in the valid_marker attribute. If given, sets vector directly after some checks.
  • savename (string [ None ]) – Useful if multiple loops are using the same mesh (saves diskspace). Ignored if mesh is a string already.
setFType(ftype)[source]
setFrequency(frequency)[source]

Sets the frequency, not angular frequency for the field calculation.

setLoopMesh(mesh, savename=None)[source]

Sets the loopmesh.

Parameters:
  • mesh (string or mesh instance) – Pygimli mesh instance or file path to pygimli mesh.
  • savename (string [ None ]) – Used savename for mesh, if mesh is already a mesh instance. Alternatively a default name is generated with getDefaultLoopMeshBaseName.
setLoopMeshName(savename=None)[source]

Sets loop mesh name or figures it out from sec config.

setMeshParameters(refinement_para=1.0, max_area_factor=1.0, tetgen_quality=1.2)[source]

Alters the Parameter responsible for the quality and size used during automatic mesh generation.

Parameters:
  • refinement_para (float [1]) – An increase of refinement_para decreases the size of the smallest cell at the dipoles and therefore incrreases the total number of refinement cells around the dipole. Omitts refinement if value is negative.
  • max_area_factor (positive float [1]) – The max_area_para lineary affects the maximum volume of a cell. An increase of the parameter allows for greater cells and therefore decreases the total number of cells outside of the refined section of the mesh. Set to 0.5 for a fine mesh and anywhere near 2 for a coarse mesh. Highly affects the total number of nodes/cells in the mesh.
  • tetgen_quality (float [1.2]) – The tetgen_quality parameter is directly piped to the corresponding tetgen call in the meshgeneration process. Decrease this parameter (e.g. to 1.12) to increase the homogeneity of the triangles. Be careful with this one, tetgen very easy starts to split cells in smaller and smaller pieces and therefore increase the total cellcount to very high values (millions and more).
setModel(rho, d=None, thickness=True, resistivity=True)[source]

Sets the synthetic 1D layered earth model for dipole calculation.

Parameters:
  • rho (float or array_like) – Resistivity/conductivity distribution for a layered earth.
  • d (float or array_like or None [None]) – Thickness or layer depth. Empty (None, 0, or []) for halfspace.
  • thickness (boolean [True]) – The parameter d is used as thickness (True, len(rho) - 1) or depth (False, len(rho)), respectively.
  • resistivity (boolean [True]) – The parameter rho is used as Resistivity (True) or conductivity (False), respectively.
setParaMesh2D(para_mesh_2d, limits=None, append_boundary=False, preserve_edges=False, anomaly=None, sort=True, **kwargs)[source]

Sets 2D parameter mesh for secondary field calculation.

Parameters:
  • para_mesh_2d (string or pg.Mesh) – 2D parameter mesh or path to mesh.
  • limits ([float, float] or None) – Minimum and maximum values for y of the area where 2D parameters are to be transferred to the 3D FEM mesh. Default are the x extension of the 2D parameter mesh.
  • append_boundary (boolean [ False ]) – Fills in an additional boundary with prolongated resistivity values around the transferred 2D values. This is useful as it reduces artifacts at the edge of the 2D domain oin the FEM mesh.
  • anomaly (None or np.ndarray [ None ]) – Optionally. Alternatively use setAnomalies. Anomaly vector (conductivity vector) with values for each cell in the 2D parameter domain. Attention: conductivity is used, not resistivity!
  • sort (boolean [ False ]) – Optionally. Alternatively use setAnomalies. If True, set the same marker for double values in anomaly vector. This is for blocky 2d structures, where only a few different regions are required. Use default False if dealing with smooth inversion results, for example in a structural coupling.
  • kwargs to *appendTriangleBoundary*
  • Calls *setAnomalies* of anomaly is given.
  • Furthermore calls *updateFEMAnomaly* if FEMMesh has been set already.
setParaMeshMarkerAndVals(anomaly=None, sort=True)[source]

Handle anomaly vector and marker of the 2d parameter mesh.

Parameters:
  • anomaly (array_like [ None ]) – Vector with conductivities in S/m. Expect one entry for each cell in parameter mesh. If not given, and sort is True an error is raised.
  • sort (boolean [ False ]) – If True, set the same marker for double values in anomaly vector. This is for blocky 2d structures, where only a few different regions are required. Use default False if dealing with smooth inversion results, for example in a structural coupling.
setPrimaryConfig(config)[source]

Sets the primary config which handles the resistivity distribution as well as the frequency of the primary field. For setting the 1D model directly see setModel.

Parameters:config (path or comet.pyhed.config.Config instance) – Configuration class instance or file path.
setSecondaryConfig(secondary_config)[source]

Sets class attribute with secondary config or loads file.

Parameters:secondary_config (string or pyhed.SecondaryConfig) – Seondary config class instance or file path.
show(**kwargs)[source]

Plots the Loopdiscretisation and the dipole directions and Length. For inspection of the loop-class and debugging purpose. Or for your curiosity.

Parameters:kwargs (dict) – Keyword arguments are redirected to pyhed.plot.plot_bib.showLoop.
updateFEMAnomaly(anomaly=None, set_marker=True, set_attributes=False, vtk_name=None, ground_marker=None, export_H5=False, sort=True)[source]

Transfers resistivity anomalies from 2D para mesh in FEM mesh.

Parameters:
  • anomaly_vector (array_like [ None ]) – Array containing the resistivity anomalies of the 2D parameter mesh. If None, the secondary config is asked for a anomaly vector. (For setting the marker for exmaple).
  • set_marker (boolean [ True ]) – Transfers the marker from the parameter mesh to the FEM mesh. This only has to be done once and can then switched off for performance.
  • set_attribute (boolean [ False ]) – Sets the attribute in the FEM mesh for debugging purposes. The anomaly vector for calculation is stored in secondary_config.
  • vtk_name (string [ None ]) – Optional vtk export with name = vtk_name if vtk_name is not None.
  • ground_marker (array_like [None]) – Corresponding marker for each entry in the anomaly vector. Each marker corresponds to a layer number of the 1d primary field beginning at 1 for the first layer, counting upward (0 belongs to the air layer). None results in np.ones_like(anomaly_vector, dtype=int).
updateFEMAnomaly_old(anomaly=None, set_marker=True, set_attributes=False, vtk_name=None, ground_marker=None, export_H5=False)[source]

Transfers resistivity anomalies from 2D para mesh in FEM mesh.

Parameters:
  • anomaly_vector (array_like [ None ]) – Array containing the resistivity anomalies of the 2D parameter mesh. If None, the secondary config is asked for a anomaly vector. (For setting the marker for exmaple).
  • set_marker (boolean [ True ]) – Transfers the marker from the parameter mesh to the FEM mesh. This only has to be done once and can then switched off for performance.
  • set_attribute (boolean [ False ]) – Sets the attribute in the FEM mesh for debugging purposes. The anomaly vector for calculation is stored in secondary_config.
  • vtk_name (string [ None ]) – Optional vtk export with name = vtk_name if vtk_name is not None.
  • ground_marker (array_like [None]) – Corresponding marker for each entry in the anomaly vector. Each marker corresponds to a layer number of the 1d primary field beginning at 1 for the first layer, counting upward (0 belongs to the air layer). None results in np.ones_like(anomaly_vector, dtype=int).
comet.pyhed.loop.loop_bib.buildCircle(r, num_segs=None, max_length=None, P=(0, 0, 0), dipole_clockwise=True, savename=None, turns=1, **kwargs)[source]

this function builds a n-segmented coil in the x-y-plane around the point P = (X, Y, Z), with Radius r. The first point is at the hightest y value with x = X and therefore the point where the dipole is x-directed. Its the point were the field can calculated directly without rotation, but with translation. The rest of the coil is build clockwise.

Parameters:
  • r (float) – Radius of the loop.
  • num_segs (integer [ None ]) – Total number of segments to be used to discretize the Loop. Used internally to define the max_length of a dipole. Inferior usage compared to max_length.
  • max_length (float [ None ]) – Defines the minimum length of a dipole used for the discretization of the loop. Superior usage compared to num_segs.
  • P (list or np.ndarray) – 2D or 3D coordinate of the mid point of the loop.
  • dipole_clockwise ([ True ]) – Define the dipole to be ordered in a clockwise direction.
  • savename (string [ None ]) – Basename for the loop.
  • turns (integer [ 1 ]) – Number of turns of a closed loop.
Returns:

Pyhed loop class instance.

Return type:

pyhed.loop

Example

>>> import pyhed as ph  # this works if pyhed is in your path.
>>> l = ph.loop.buildCircle(10, 11)
>>> print(l)
>>> print(l.config)
>>> l.show()
comet.pyhed.loop.loop_bib.buildDipole(Pos, length=1, angle=0, **kwargs)[source]
Parameters:
  • Pos (list) – 2D or 3D coordinate of the dipole.
  • length (float [ 1 ]) – Dipole legth.
  • angle ([ 0 ]) – Dipole direction positive clockwise from the x-aixs.
  • kwargs (dict) – Keyword arguments are redirected to the loop class.
Returns:

Pyhed loop class instance.

Return type:

pyhed.loop

Example

>>> import pyhed as ph  # this works if pyhed is in your path.
>>> l = ph.loop.buildDipole([-3, -3], length=1.3, angle=45)
>>> print(l)
>>> print(l.config)
>>> l.show()
comet.pyhed.loop.loop_bib.buildDummy(**kwargs)[source]

Creates an empty dummy loop class to gain access to certain functionalities.

comet.pyhed.loop.loop_bib.buildEdgeSourceDiscretization(surface, pos, phi, ds, closed=True)[source]

Internal function. Used to implement every dipole in the FEM mesh using an appropriate edge that represents it.

comet.pyhed.loop.loop_bib.buildEtraPoly(x_min, x_max, small, marker=0)[source]
comet.pyhed.loop.loop_bib.buildEtraSourceDiscretization(poly, edgelength, max_length=0.251, x_left=None, n_segs=None, number_of_loops=8)[source]

Internal function.

Implements an etra shaped source in the FEM mesh. Cannot use buildEdgeSourceDiscretization due to overlapping edges.

comet.pyhed.loop.loop_bib.buildEtraSurvey(edgelength, return_measurements=False, origin=[0, 0], num_loops=8, max_length=None, savenames=None, **kwargs)[source]

Special etra survey for NMR applications.

comet.pyhed.loop.loop_bib.buildFig8(points, num_segs=3, max_length=None, mid=0, dipole_clockwise=True, turns=1, **kwargs)[source]

Builds a figure-of-eight Loop with respect to the given corner Points. This function is part of the pyhed.loops library and returns a ‘loop’-class object suitable to calculate electric and magnetic fields based on horizontal electric dipoles. Please always check the loop consistency with the buildin .show() command (see Example) before calculating with experimetal loop layouts.

Parameters:
  • num_segs (integer [ 12 ]) – Total number of segments to be used to discretize the Loop. Used internally to define the max_length of a dipole. Inferior usage compared to max_length.

  • max_length (float [ None ]) – Defines the minimum length of a dipole used for the discretization of the loop. Superior usage compared to num_segs.

  • points (array_like) – Points can be of shape (2, 3), two points with three coordinates (x, y, z) and the algorithm will build a loop with edges parallel to the coordiante axes.

    Although the point coordiantes are given with z values, the current implementation of COMET is not able to allow for any z-values other than zero, i appologize for the inconvenience. This flaw will be adressed as soon as COMET moves towards 2D resistivity structures.

  • max_length (float or None (None)) – The discretisation between the cornerpoints of the loop can be sampled by any rate (m) you choose. Since the total number of points between the corner points of the loop has to be an integer, the real distance between the points will always be smaller or equal to max_length.

    Its highly recommended to use at least 10 dipoles between the different points, and therefore a total number of dipoles of >= 50 - 60. This leads to a natural max_length of 1/10 the smaller edge of the figure-of-eight loop.

  • num_segs (integer (3)) – The number of segments between the corner points of the loop can also be given directly, but mention that the max_length value (not None) will have priority. Usually max_length will lead to more homogeneous distributions of dipoles between the corner and midpoints of a figure-of-eight loop.

  • mid (integer (0)) – The middle connection depends on the value “mid”. The default value (0) sets the middle lines parrallel to the y-axis. Other values are setting the line parrallel to the x axis, respectively.

  • dipole_clockwise (boolean (True)) – The dipoles are orientated clockwise with respect to the first half of the loop or counterclockwise if this switch is set the False. The first half is considered to be the half connected to the upper left point of the loop boundary, so either the left or the upper loop depending on mid.

  • Possible kwargs are (savename. Please see “buildLoop” for more)

  • details.

Returns:

Pyhed loop class instance.

Return type:

pyhed.loop

Example

>>> import pyhed as ph  # this works if pyhed is in your path.
>>> l = ph.loop.buildSquare(k=3.25, max_length=0.14)

Example

>>> import pyhed as ph
>>> p1 = (-1, 1, 0)
>>> p2 = (1, -1, 0)
>>> fig8 = ph.loop.buildfig8((p1, p2), max_length=0.1)
>>> print(fig8)
>>> print(fig8.config)
>>> fig8.show()
comet.pyhed.loop.loop_bib.buildFig8Circle(r, num_segs=None, max_length=None, P=(0, 0, 0), savename=None, turns=1, **kwargs)[source]

Build a figure-of-eight loop with circular loops around point P = (X, Y, Z), with Radius r.

Parameters:
  • r (float) – Radius of the loop.
  • num_segs (integer [ None ]) – Total number of segments to be used to discretize the Loop. Used internally to define the max_length of a dipole. Inferior usage compared to max_length. In this case divided between the two circular loops.
  • max_length (float [ None ]) – Defines the minimum length of a dipole used for the discretization of the loop. Superior usage compared to num_segs.
  • P (array_like [ (0., 0., 0.) ]) – 2D or coordinate of the mid point of the loop.
  • savename (string [ None ]) – Basename for the loop.
  • turns (integer [ 1 ]) – Number of turns of a closed loop.
Returns:

Pyhed loop class instance.

Return type:

pyhed.loop.Loop

comet.pyhed.loop.loop_bib.buildLine(Start, End, num_segs=0, max_length=None, savename=None, grounded=True, **kwargs)[source]
Parameters:
  • Start (list) – 2D or 3D coordinate of start of the line (z value will be ignored for now).
  • Start (list) – 2D or 3D coordinate of end of the line (z value will be ignored for now).
  • num_segs (integer [ 0 ]) – Total number of segments to be used to discretize the Loop. Used internally to define the max_length of a dipole. Inferior usage compared to max_length.
  • max_length (float [ None ]) – Defines the minimum length of a dipole used for the discretization of the loop. Superior usage compared to num_segs.
  • savename (string [ None ]) – Basename for the loop.
  • dipole_clockwise ([ True ]) – Define the dipole to be ordered in a clockwise direction.
  • turns (integer [ 1 ]) – Number of turns of a closed loop.
  • kwargs (dict) – Keyword arguments are redirected to the loop class.
Returns:

Pyhed loop class instance.

Return type:

pyhed.loop

Example

>>> import pyhed as ph  # this works if pyhed is in your path.
>>> l = ph.loop.buildLine([-3, -3], [4, 2], max_length=0.14)
>>> print(l)
>>> print(l.config)
>>> l.show()
comet.pyhed.loop.loop_bib.buildLoop(Points, num_segs=1, max_length=None, savename=None, grounded=False, ltype=None, dipole_clockwise=None, turns=1, **kwargs)[source]

Creates an arbitrary shaped loop out of given coordinates.

The returnes object is an initialized loop class. Most general function to build a loop and called by most of the other specialized functions after input preparation.

Parameters:
  • Points (list) – List or Array containing 2D or 3D coordinates of shape (n, 2 or 3) for n corner point of an arbitrary shaped polygon (z_vlaues will be set to 0 or now).
  • num_segs (integer [ 1 ]) – Total number of segments to be used to discretize the Loop. Used internally to define the max_length of a dipole. Inferior usage compared to max_length.
  • max_length (float [ None ]) – Defines the minimum length of a dipole used for the discretization of the loop. Superior usage compared to num_segs.
  • savename (string [ None ]) – Basename for the loop. Trigger to save the loop.
  • grounded (boolean [ False ]) – Defines wether the loop is closed or not. Also defines which default field mode will be calculated, as ‘tm’ field of a closed loop is zero.
  • dipole_clockwise ([ True ]) – Define the dipole to be ordered in a clockwise direction.
  • turns (integer [ 1 ]) – Number of turns of a closed loop.
  • kwargs (dict) – Keyword arguments are redirected to the loop class.
Returns:

Pyhed loop class instance.

Return type:

pyhed.loop

Example

>>> import pyhed as ph  # this works if pyhed is in your path.
>>> points = [[-5, -5], [-10, 5], [2.3, 3.14], [7, -7]]
>>> l = ph.loop.buildLoop(points, max_length=0.64)
>>> print(l)
>>> print(l.config)
>>> l.show()
comet.pyhed.loop.loop_bib.buildPointSourceDiscretization(surface, pos)[source]

Internal function. Used to implement each source dipole as simple node in the FEM mesh.

comet.pyhed.loop.loop_bib.buildRectangle(points, num_segs=1, max_length=None, savename=None, dipole_clockwise=None, turns=1, **kwargs)[source]

Creates a rectangular shaped loop and manages dipole discretization.

Creates a rectangular loop out of four given corner points, with a given discretisation between the points. Per default the function returns the position of the dipoles, the angle between its orientation and the x-direction and the dipole Length it represents.

Parameters:
  • points (list) – List or Array containing 2D or 3D coordinates (however z-values ignored for now). In case of a rectangle two or four coords are needed. In case of two coordinates, the rectangle will have edges parallel to the coordinate axes.
  • num_segs (integer [ 1 ]) – Total number of segments to be used to discretize the Loop. Used internally to define the max_length of a dipole. Inferior usage compared to max_length.
  • max_length (float [ None ]) – Defines the minimum length of a dipole used for the discretization of the loop. Superior usage compared to num_segs.
  • savename (string [ None ]) – Basename for the loop. Trigger to save the loop.
  • dipole_clockwise ([ True ]) – Define the dipole to be ordered in a clockwise direction.
  • turns (integer [ 1 ]) – Number of turns of a closed loop.
  • kwargs (dict) – Keyword arguments are redirected to the loop class.
Returns:

Pyhed loop class instance.

Return type:

pyhed.loop

Example

>>> from comet import pyhed as ph
>>> l = ph.loop.buildRectangle([[-5, -5], [5, 5]], max_length=0.64)
>>> print(l)
>>> print(l.config)
>>> l.show()
comet.pyhed.loop.loop_bib.buildSpiral(r1, r2, sp_turns=2, sp_segs=36, max_length=None, P=(0, 0, 0), dipole_clockwise=True, savename=None, theta=90.0, **kwargs)[source]

this function builds a spiral coil with sp_turns number of turns in the x-y-plane around the point P = (X, Y, Z), with inner radius r1 and outer radius r2. The angle theta defines the start of the spiral (theta = 0 -> East, theta = 90 -> North, etc.). The spiral is build clockwise from r1 to r2.

Parameters:
  • r1 (float) – Inner radius of the spiral.
  • r2 (float) – Outer radius of the spiral.
  • sp_turns (integer [ None ]) – Total number of spiral turns.
  • sp_segs (integer [ None ]) – Total number of segments to be used to discretize the spiral.
  • max_length (float [ None ]) – Defines the minimum length of a dipole used for the discretization of the loop.
  • P (list or np.ndarray) – 2D or 3D coordinate of the mid point of the loop.
  • dipole_clockwise ([ True ]) – Define the dipole to be ordered in a clockwise direction.
  • savename (string [ None ]) – Basename for the loop.
  • theta (float, deg [ 90.0 ]) – Orientation of start-end-connection of the spiral in degrees.
Returns:

Pyhed loop class instance.

Return type:

pyhed.loop

Example

>>> import pyhed as ph  # this works if pyhed is in your path.
>>> l = ph.loop.buildSpiral(1, 2, sp_turns=5)
>>> print(l)
>>> print(l.config)
>>> l.show()
comet.pyhed.loop.loop_bib.buildSquare(k=1, num_segs=12, P=(0, 0, 0), max_length=None, savename=None, dipole_clockwise=True, turns=1, **kwargs)[source]

Square loop around P with edge length k.

Parameters:
  • k (float [ 1 ]) – Length of one edge.
  • num_segs (integer [ 12 ]) – Total number of segments to be used to discretize the Loop. Used internally to define the max_length of a dipole. Inferior usage compared max_length.
  • max_length (float [ None ]) – Defines the minimum length of a dipole used for the discretization of the loop. Superior usage compared to num_segs.
  • savename (string [ None ]) – Basename for the loop. Trigger to save the loop.
  • dipole_clockwise ([ True ]) – Define the dipole to be ordered in a clockwise direction.
  • turns (integer [ 1 ]) – Number of turns of a closed loop.
  • kwargs (dict) – Keyword arguments are redirected to the loop class
Returns:

Pyhed loop class instance.

Return type:

pyhed.loop

Example

>>> from comet import pyhed as ph
>>> l = ph.loop.buildSquare(k=3.25, max_length=0.24)
>>> print(l)
>>> print(l.config)
>>> l.show()
comet.pyhed.loop.loop_bib.calcWithEmpymod(loop, use_bipole=False)[source]
comet.pyhed.loop.loop_bib.computeLoopPositions(Coordinates, ltype='arbitrary', middle=None, grounded=True)[source]

This function calculates the position of the dipoles in order to represent an arbitrary shaped loop with the given coordinates, the angle between its orientation and the x-direction and the dipole Length it represents.

Parameters:
  • Coordinates (np.ndarray) – Input list/array of points of shape: (n, 3) for n dipoles.

  • ltype (string) – Defines the general type of the loop and therefore some internal attributes. Choices are:

    • ‘rectangle’ (also for square loops)
    • ‘circle’
    • ‘arbitrary’ (for all other loops)
  • middle (np.ndarray [ None ]) – Midpoint of the circular loop to calculate radius correct (and therefore the correct source coordinates).

  • grounded (boolean [ True ]) – For non grounded wires there are dipole placed bewtween the last coordinate point and the first. This is ommitted for grounded wires.

comet.pyhed.loop.loop_bib.copyPrimaryFields(rdir1, rdir2)[source]

For recalculation purpose it sometimes is uneccessary to calc the primary fields again. This function copies the primery fields from on custEM result dir (rdir1) to another (rdir2). names of the fields are not changed. Only the .h5 files are copied.

comet.pyhed.loop.loop_bib.createEtraMesh(loops, mesh2d, anomaly, savename=None, extend_x=0.0, extend_y=-0.3, extend_z=-0.5, max_volume=25.0, append_boundary=True, sort=True, return_loop=False)[source]

Creates a finite element mesh suited for ETRA surveys.

comet.pyhed.loop.loop_bib.createMultipleLoopMesh(loops, savename=None, source_setup='etra', triangle_quality=33.8, source_max_area=None, inner_area_volume=None, mid_area_volume=None, outer_area_volume=None, minx=None, maxx=None, miny=None, maxy=None, minz=None, air_refinement=False, source_poly=None)[source]

Build a suited mesh for magnetic field calculation for NMR purpose. Sources are included in a way defined by source_setup.

Parameters:
  • loops (ph.loop.loop or array_like) – Input loops for which the mesh shall be created.
  • savename (string [ None ]) – Savename for mesh (.bms will be added).
  • source_setup (string [ ‘etra’ ]) – In case of multiple loops, the source_setup is important to define how the loops are included in the mesh. Default is ‘etra’ for NMR Etra setups. Alternatively ‘edges’ can be used to implement each dipole as edge with the dipole as midpoint, length as well as direction is defined by the dipole. This is not working for overlaping loops (e.g. Etras). For those a source_poly can be provided or ‘nodes’ is chosen to simply implement each dipole as node in the mesh.
  • triangle_quality (float [ 34.0 ]) – The surface where the sources are implemented is meshed in 2D an then later inserted in the 3D mesh. This controls the triangle quality for this surface mesh.
  • source_max_area – maximum area allowed in the 2D surface mesh (sources and 5 meter around the sources). Automatically defined if None (based on size of the area to ensure a minimum amount of trinagle cells). 2D surface mesh is exported if logger is set to debug level (10).
  • inner_area_volume (float [ None ]) – The inner refinement volume is defined 5 meter around and below the sources. The maximum cell volume can be defined here. Automatically defined if None (based on size of the volume to ensure a minimum amount of cells).
  • mid_area_volume (float [ None ]) – The median refinement volume is defined through minx, maxx, miny, maxy, and minz meter around and below the sources. The maximum cell volume can be defined here. Automatically defined if None (based on size of the volume to ensure a minimum amount of cells).
  • outer_area_volume (float [ None ]) – The outer sides of the mesh (3 times miny, maxx, miny, maxy, minz) is to ensure interpolation of the field values are secured without the need for extrapolation. Usually the max cell volume is not contraint to minimize the computational effort.
  • minx (float [ None ]) – Minimum x extention (in addition to the extend of the inner refinement area) of median refinement volume. If None this value is defined as maximum distance of two dipoles of the input loops.
  • maxx (float [ None ]) – Maximum x extention (in addition to the extend of the inner refinement area) of median refinement volume. If None this value is defined as maximum distance of two dipoles of the input loops.
  • miny (float [ None ]) – Minimum y extention (in addition to the extend of the inner refinement area) of median refinement volume. If None this value is defined as maximum distance of two dipoles of the input loops.
  • maxy (float [ None ]) – Maximum y extention (in addition to the extend of the inner refinement area) of median refinement volume. If None this value is defined as maximum distance of two dipoles of the input loops.
  • minz (float [ None ]) – Maximum z extention (in addition to the extend of the inner refinement area) of median refinement volume. If None this value is defined as maximum distance of two dipoles of the input loops. 1/3 of the value is used for maxz if air refinement is enabled.
  • air_refinement (boolean [ False ]) – If true the airspace is meshed as well.
  • source_poly (pg.Mesh or plc [None]) – For unusual or overlapping, non etra, sources a piecewise linear complex (plc) can be created using the pygimli mesh- and polytools. This is then used as source definition for the 2D source layer mesh. Any region markers with area constraints will be considered, no additional markers will be set.
comet.pyhed.loop.loop_bib.createSeparatedFEMMesh(*loops, para_mesh_2d=None, **kwargs)[source]

Build a mesh suited for EM secondary field calculation if more than one loop is used.

comet.pyhed.loop.loop_bib.createSeparatedLoopMesh(*loops, dipole_mesh=False, **kwargs)[source]

Build a mesh suited for EM primary field calculation if using more than one loop.

comet.pyhed.loop.loop_bib.dipolePosFromSimpleLoop(r, n, P=(0, 0, 0), drop_tol=1e-14)[source]

Convienience function to have fast access to circular loop coordinates.

comet.pyhed.loop.loop_bib.loadLoop(name, **kwargs)[source]

Imports loop from file archive. See ph.loop.Loop.load for details.

comet.pyhed.loop.loop_bib.loadLoops(name, num=8, load_meshes=False, cfg_name=None, cfg2_name=None, overwrite_dir=False)[source]

Loads n loops with name = …{n}…

comet.pyhed.loop.loop_bib.mergeLoops(*loops, true_merge=False, config=None)[source]

Merges given loops to one and optionally merges equal dipoles.

Parameters:
  • loops (loops-classes) – Loops to be merged.
  • true_merge (boolean [True]) – Switch for a complete merge of all dipoles to with respect to their phi and dipole length. Attention this can be problematic when merging edge-to-edge loops (for mesh creation for example). If False only the dipole positions are merged not phi/ds (there replaced with dummy values).
  • config (ph.config-instance or string [None]) – Sets config of merged loop either per index (cofig is taken from the corresponding loop) or give a new config. If None the config of the first loop is used instead.
comet.pyhed.loop.loop_bib.totalFieldCalculation(custem_config, num_cpu=16)[source]

comet.pyhed.loop.loop_para module

Part of comet/pyhed/loop

comet.pyhed.loop.loop_para.CalculationWorker(num, index_start, pos_alpha_len, out_queue, end_queue, rho, d, f, current, mode, ftype, outPos, verbose, drop_tol, src_z, switch_hankel, log_level)[source]
comet.pyhed.loop.loop_para.CalculationWorker_perDipole(num, in_queue, out_queue, rho, d, f, current, mode, ftype, outPos, drop_tol)[source]
comet.pyhed.loop.loop_para.calcFieldMatrix_para(dipoleMeshName, dipoleNodeCount, loop_mesh, PosPhiDs, verbose=False, num_cpu=12)[source]
comet.pyhed.loop.loop_para.loopCalculation(OutMesh, PosPhiDs, rho, d, f, current, mode, ftype, verbose=False, cell_center=False, num_cpu=12, max_node_count=None, **kwargs)[source]
comet.pyhed.loop.loop_para.loopCalculation_perDipole(OutMesh, PosPhiDs, rho, d, f, current, mode, ftype, cell_center=False, num_cpu=12, **kwargs)[source]
comet.pyhed.loop.loop_para.loopInterpolation(dipoledata, SrcMeshName, OutMesh, PosPhiDs, verbose=False, cell_center=False, num_cpu=12)[source]

Module contents

Module comet/pyhed/loop