Utility Classes and Functions (SimPEG.utils
)#
The utils
package contains utilities for helping with common operations involving
SimPEG.
Many of the utilities are imported from discretize.utils. See that package’s documentation for many details on items.
Coordinates Utility Functions#
|
Generate a 3x3 rotation matrix defining the rotation from vector v0 to v1. |
|
Rotate a set of xyz locations about a specified point. |
Counter Utility Functions#
|
Class for recording iterations and operation times. |
|
Count function (DOCSTRING INCOMPLETE) |
|
Timing function (DOCSTRING INCOMPLETE) |
Curvilinear Utility Functions#
|
Creates and returns the gridded node locations for a curvilinear mesh. |
|
Returns normal surface vector and area for a given set of faces. |
|
Returns the index of nodes on a tensor (or curvilinear) mesh. |
|
Returns the tetrahedron volumes for a specified set of verticies. |
IO Utility Functions#
|
Download all files stored in a cloud directory. |
|
Read UBC-GIF DCIP2D formatted survey or data files. |
|
Read UBC-GIF DCIP3D formatted survey or data files. |
|
Read UBC-GIF DCIP OcTree formatted survey or data files. |
|
Read 2D or 3D DC/IP data from XYZ-formatted file. |
|
Read UBC-GIF GG3D formatted survey or data files. |
|
Read UBC-GIF GRAV3D formatted survey or data files. |
|
Read UBC-GIF MAG3D formatted survey or data files. |
|
Write UBC-GIF DCIP2D formatted survey or data files. |
|
Write UBC-GIF DCIP3D formatted survey or data files. |
|
Write UBC-GIF DCIP OcTree formatted survey or data files. |
|
Write 2D or 3D DC/IP data to XYZ-formatted file. |
|
Write UBC-GIF GRAV3D formatted survey or data files. |
|
Write UBC-GIF GG3D formatted survey or data files. |
|
Write UBC-GIF MAG3D formatted survey or data files. |
Matrix Utility Functions#
|
Create 1D averaging operator from nodes to cell-centers. |
|
Create 1D averaging operator from cell-centers to nodes. |
Converts a set of 3D vectors from Cartesian to spherical coordinates. |
|
|
Compute coterminal angle |
|
Create 1D difference (derivative) operator from nodes to centers. |
|
Compute constants defining a plane from a set of points. |
|
diagEst has been deprecated. |
|
Estimate highest eigenvalue of one or a combo of objective functions using power iterations and the Rayleigh quotient. |
|
Estimate the diagonal of a matrix. |
|
Extract a subarray |
|
Compute kronecker products between 3 sparse matricies. |
|
Return subscripts of tensor grid elements from indices. |
|
Invert a set of 2x2 matricies from vectors containing their elements. |
|
Invert a set of 3x3 matricies from vectors containing their elements. |
|
Construct the inverse of the physical property tensor. |
|
Construct the physical property tensor. |
|
Creates a vector with specified dimensionality. |
|
Generate gridded locations for 1D, 2D, or 3D tensors. |
|
Generate sparse diagonal matrix from a vector. |
|
Return inverse of a sparse diagonal matrix |
|
Generate sparse identity matrix. |
Converts a set of 3D vectors from spherical to Catesian coordinates. |
|
|
Generate sparse matrix of zeros of shape=(n1, n2). |
|
Return indices of tensor grid elements from subscripts. |
|
Return unique rows, row indices and inverse indices. |
Mesh Utility Functions#
|
Find the indicies for the nearest grid location for a set of points. |
|
Extracts the core mesh from a global mesh. |
|
Unpack a condensed representation of cell widths or time steps. |
|
Takes a triangulated surface and determine which mesh cells it intersects. |
Model Utility Functions#
|
Add a homogeneous block to an existing cell centered model |
|
Create a basic two layered model |
Construct cell-centered model comprised of a block in a wholespace. |
|
Construct cell-centered model comprised of an ellipsoid in a wholespace. |
|
Define physical property model from scalar analytic function. |
|
Create physical property model consisting of a set of infinite horizontal layers. |
|
|
Create random model by convolving a kernel with a uniformly distributed random model. |
|
Get indices for cells whose centers lie inside specified block |
|
Get indices for cells whose centers lie within the convex hull of a set of points. |
|
Get indices for cells whose centers lie inside a sphere |
Plotting Utility Functions#
|
Interpolate and plot unstructured 2D data. |
|
Plot the vertical profile for a 1D layered Earth model. |
PGI Utility Classes and Functions#
|
Weighted Gaussian mixture class |
|
This class built upon the WeightedGaussianMixture, which itself built upon from the mixture.gaussian_mixture.GaussianMixture class from Scikit-Learn. |
Gaussian mixture class for non-linear relationships. |
|
Gaussian mixture class for non-linear relationships with priors. |
Code Utility Functions#
Many of the functions here are used internally to SimPEG and have minimal documentation.
|
Ensures the given array will have dim columns. |
|
Wrap a function to an instance of a class. |
|
Check stopping rules. |
|
Create wrapper class with memory profiler. |
|
Dependent property. |
|
Utility function to deprecate a class |
|
Deprecate function |
|
Deprecate method |
|
Deprecate module |
|
Deprecate property |
|
Dynamically bind a class's method to an instance of a different class. |
|
Print completion of an operation. |
|
printDone has been deprecated. |
|
Print line. |
|
Print stoppers. |
|
Print titles. |
|
Wrap a function to require a specfic attribute. |
|
Set key word arguments for an object or throw an error if any do not exist. |
|
Validate float property |
|
Validate integer property |
|
Validate list of instances of a certain class |
|
Validate a location |
|
Validate numerical array property |
|
Validate a string property |
|
Validate if an object is callable |
|
Validate if an object represents a direction. |
|
Validates an array intended to indicate a list of active indices. |