Natural Source Electromagnetics¶
SimPEG (Simulation and Parameter Estimation in Geophysics) is a python package for simulation and gradient based parameter estimation in the context of geoscience applications.
Uses SimPEG as the framework for the forward and inverse magnetotellurics geophysical problems.
This package within SimPEG currently includes
- Magnetotellurics
Impedance
Tipper
With support to other methods such
ZTEM
under development
API¶
NSEM Simulation¶
-
class
SimPEG.electromagnetics.natural_source.simulation.
BaseNSEMSimulation
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.frequency_domain.simulation.BaseFDEMSimulation
Base class for all Natural source problems.
Required Properties:
counter (
Counter
): A SimPEG.utils.Counter object, an instance of Countermesh (
BaseMesh
): a discretize mesh instance, an instance of BaseMeshsensitivity_path (
String
): path to store the sensitivty, a unicode string, Default: ./sensitivity/None
solver_opts (
Dictionary
): solver options as a kwarg dict, a dictionarysurvey (
Survey
): a survey object, an instance of Survey
Optional Properties:
model (
Model
): Inversion model., a numpy array of <class ‘float’>, <class ‘int’> with shape (*, *) or (*)mu (
PhysicalProperty
): Magnetic Permeability (H/m), a physical property, Default: 1.25663706212e-06muMap (
Mapping
): Mapping of Magnetic Permeability (H/m) to the inversion model., a SimPEG Mapmui (
PhysicalProperty
): Inverse Magnetic Permeability (m/H), a physical propertymuiMap (
Mapping
): Mapping of Inverse Magnetic Permeability (m/H) to the inversion model., a SimPEG Maprho (
PhysicalProperty
): Electrical resistivity (Ohm m), a physical propertyrhoMap (
Mapping
): Mapping of Electrical resistivity (Ohm m) to the inversion model., a SimPEG Mapsigma (
PhysicalProperty
): Electrical conductivity (S/m), a physical propertysigmaMap (
Mapping
): Mapping of Electrical conductivity (S/m) to the inversion model., a SimPEG Map
Other Properties:
muDeriv (
Derivative
): Derivative of Magnetic Permeability (H/m) wrt the model.muiDeriv (
Derivative
): Derivative of Inverse Magnetic Permeability (m/H) wrt the model.rhoDeriv (
Derivative
): Derivative of Electrical resistivity (Ohm m) wrt the model.sigmaDeriv (
Derivative
): Derivative of Electrical conductivity (S/m) wrt the model.
-
Jvec
(m, v, f=None)[source]¶ Function to calculate the data sensitivities dD/dm times a vector.
- Parameters
m (numpy.ndarray) – conductivity model (nP,)
v (numpy.ndarray) – vector which we take sensitivity product with (nP,)
(optional) u (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – NSEM fields object, if not given it is calculated
- Return type
- Returns
Jv (nData,) Data sensitivities wrt m
-
Jtvec
(m, v, f=None)[source]¶ Function to calculate the transpose of the data sensitivities (dD/dm)^T times a vector.
- Parameters
m (numpy.ndarray) – inversion model (nP,)
v (numpy.ndarray) – vector which we take adjoint product with (nP,)
f (optional) (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – NSEM fields object, if not given it is calculated
- Return type
- Returns
Jtv (nP,) Data sensitivities wrt m
-
class
SimPEG.electromagnetics.natural_source.simulation.
Simulation1DPrimarySecondary
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.simulation.BaseNSEMSimulation
A NSEM problem soving a e formulation and primary/secondary fields decomposion.
By eliminating the magnetic flux density using
\[\mathbf{b} = \frac{1}{i \omega}\left(-\mathbf{C} \mathbf{e} \right)\]we can write Maxwell’s equations as a second order system in \(\mathbf{e}\) only:
\[\left[ \mathbf{C}^{\top} \mathbf{M_{\mu^{-1}}^e } \mathbf{C} + i \omega \mathbf{M_{\sigma}^f} \right] \mathbf{e}_{s} = i \omega \mathbf{M_{\sigma_{s}}^f } \mathbf{e}_{p}\]which we solve for \(\mathbf{e_s}\). The total field \(\mathbf{e} = \mathbf{e_p} + \mathbf{e_s}\).
The primary field is estimated from a background model (commonly half space ).
Required Properties:
counter (
Counter
): A SimPEG.utils.Counter object, an instance of Countermesh (
BaseMesh
): a discretize mesh instance, an instance of BaseMeshsensitivity_path (
String
): path to store the sensitivty, a unicode string, Default: ./sensitivity/None
solver_opts (
Dictionary
): solver options as a kwarg dict, a dictionarysurvey (
Survey
): a survey object, an instance of Survey
Optional Properties:
model (
Model
): Inversion model., a numpy array of <class ‘float’>, <class ‘int’> with shape (*, *) or (*)mu (
PhysicalProperty
): Magnetic Permeability (H/m), a physical property, Default: 1.25663706212e-06muMap (
Mapping
): Mapping of Magnetic Permeability (H/m) to the inversion model., a SimPEG Mapmui (
PhysicalProperty
): Inverse Magnetic Permeability (m/H), a physical propertymuiMap (
Mapping
): Mapping of Inverse Magnetic Permeability (m/H) to the inversion model., a SimPEG Maprho (
PhysicalProperty
): Electrical resistivity (Ohm m), a physical propertyrhoMap (
Mapping
): Mapping of Electrical resistivity (Ohm m) to the inversion model., a SimPEG Mapsigma (
PhysicalProperty
): Electrical conductivity (S/m), a physical propertysigmaMap (
Mapping
): Mapping of Electrical conductivity (S/m) to the inversion model., a SimPEG Map
Other Properties:
muDeriv (
Derivative
): Derivative of Magnetic Permeability (H/m) wrt the model.muiDeriv (
Derivative
): Derivative of Inverse Magnetic Permeability (m/H) wrt the model.rhoDeriv (
Derivative
): Derivative of Electrical resistivity (Ohm m) wrt the model.sigmaDeriv (
Derivative
): Derivative of Electrical conductivity (S/m) wrt the model.
-
fieldsPair
[source]¶ alias of
SimPEG.electromagnetics.natural_source.fields.Fields1DPrimarySecondary
-
property
MeMui
¶ Edge inner product matrix
-
property
MfSigma
¶ Edge inner product matrix
-
property
sigmaPrimary
¶ A background model, use for the calculation of the primary fields.
-
getA
(freq)[source]¶ Function to get the A matrix.
- Parameters
freq (float) – Frequency
- Return type
- Returns
A
-
getRHS
(freq)[source]¶ Function to return the right hand side for the system.
- Parameters
freq (float) – Frequency
- Return type
- Returns
RHS for 1 polarizations, primary fields (nF, 1)
-
fields
(m=None)[source]¶ Function to calculate all the fields for the model m.
- Parameters
m (numpy.ndarray) – Conductivity model (nC,)
- Return type
SimPEG.electromagnetics.natural_source.fields.Fields1DPrimarySecondary
- Returns
NSEM fields object containing the solution
-
class
SimPEG.electromagnetics.natural_source.simulation.
Simulation3DPrimarySecondary
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.simulation.BaseNSEMSimulation
A NSEM problem solving a e formulation and a primary/secondary fields decompostion.
By eliminating the magnetic flux density using
\[\mathbf{b} = \frac{1}{i \omega}\left(-\mathbf{C} \mathbf{e} \right)\]we can write Maxwell’s equations as a second order system in \(\mathbf{e}\) only:
\[\left[\mathbf{C}^{\top} \mathbf{M_{\mu^{-1}}^f} \mathbf{C} + i \omega \mathbf{M_{\sigma}^e} \right] \mathbf{e}_{s} = i \omega \mathbf{M_{\sigma_{p}}^e} \mathbf{e}_{p}\]which we solve for \(\mathbf{e_s}\). The total field \(\mathbf{e} = \mathbf{e_p} + \mathbf{e_s}\).
The primary field is estimated from a background model (commonly as a 1D model).
Required Properties:
counter (
Counter
): A SimPEG.utils.Counter object, an instance of Countermesh (
BaseMesh
): a discretize mesh instance, an instance of BaseMeshsensitivity_path (
String
): path to store the sensitivty, a unicode string, Default: ./sensitivity/None
solver_opts (
Dictionary
): solver options as a kwarg dict, a dictionarysurvey (
Survey
): a survey object, an instance of Survey
Optional Properties:
model (
Model
): Inversion model., a numpy array of <class ‘float’>, <class ‘int’> with shape (*, *) or (*)mu (
PhysicalProperty
): Magnetic Permeability (H/m), a physical property, Default: 1.25663706212e-06muMap (
Mapping
): Mapping of Magnetic Permeability (H/m) to the inversion model., a SimPEG Mapmui (
PhysicalProperty
): Inverse Magnetic Permeability (m/H), a physical propertymuiMap (
Mapping
): Mapping of Inverse Magnetic Permeability (m/H) to the inversion model., a SimPEG Maprho (
PhysicalProperty
): Electrical resistivity (Ohm m), a physical propertyrhoMap (
Mapping
): Mapping of Electrical resistivity (Ohm m) to the inversion model., a SimPEG Mapsigma (
PhysicalProperty
): Electrical conductivity (S/m), a physical propertysigmaMap (
Mapping
): Mapping of Electrical conductivity (S/m) to the inversion model., a SimPEG Map
Other Properties:
muDeriv (
Derivative
): Derivative of Magnetic Permeability (H/m) wrt the model.muiDeriv (
Derivative
): Derivative of Inverse Magnetic Permeability (m/H) wrt the model.rhoDeriv (
Derivative
): Derivative of Electrical resistivity (Ohm m) wrt the model.sigmaDeriv (
Derivative
): Derivative of Electrical conductivity (S/m) wrt the model.
-
fieldsPair
[source]¶ alias of
SimPEG.electromagnetics.natural_source.fields.Fields3DPrimarySecondary
-
property
sigmaPrimary
¶ A background model, use for the calculation of the primary fields.
-
getA
(freq)[source]¶ Function to get the A system.
- Parameters
freq (float) – Frequency
- Return type
- Returns
A
-
getADeriv
(freq, u, v, adjoint=False)[source]¶ Calculate the derivative of A wrt m.
- Parameters
freq (float) – Frequency
u (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – NSEM Fields object
v (numpy.ndarray) – vector of size (nU,) (adjoint=False) and size (nP,) (adjoint=True)
- Return type
- Returns
Calculated derivative (nP,) (adjoint=False) and (nU,)[NOTE return as a (nU/2,2) columnwise polarizations] (adjoint=True) for both polarizations
-
getRHS
(freq)[source]¶ Function to return the right hand side for the system.
- Parameters
freq (float) – Frequency
- Return type
- Returns
RHS for both polarizations, primary fields (nE, 2)
-
getRHSDeriv
(freq, v, adjoint=False)[source]¶ The derivative of the RHS with respect to the model and the source
- Parameters
freq (float) – Frequency
v (numpy.ndarray) – vector of size (nU,) (adjoint=False) and size (nP,) (adjoint=True)
- Return type
- Returns
Calculated derivative (nP,) (adjoint=False) and (nU,2) (adjoint=True) for both polarizations
-
fields
(m=None)[source]¶ Function to calculate all the fields for the model m.
- Parameters
(nC,) m (numpy.ndarray) – Conductivity model
- Return type
- Returns
Fields object with of the solution
-
class
SimPEG.electromagnetics.natural_source.simulation.
Problem3D_ePrimSec
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.simulation.Simulation3DPrimarySecondary
This class has been deprecated, see Simulation3DPrimarySecondary for documentation
-
class
SimPEG.electromagnetics.natural_source.simulation.
Problem1D_ePrimSec
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.simulation.Simulation1DPrimarySecondary
This class has been deprecated, see Simulation1DPrimarySecondary for documentation
NSEM Survey¶
-
class
SimPEG.electromagnetics.natural_source.survey.
Data
(*args, **kwargs)[source]¶ Bases:
SimPEG.data.Data
,SimPEG.electromagnetics.natural_source.utils.plot_utils.DataNSEMPlotMethods
Data class for NSEMdata. Stores the data vector indexed by the survey.
Required Properties:
- dobs (
Array
): Vector of the observed data. The data can be set using the survey parameters:
data = Data(survey) for src in survey.source_list: for rx in src.receiver_list: data[src, rx] = datum
, a list or numpy array of <class ‘float’>, <class ‘int’> with shape (*)
- dobs (
- noise_floor (
UncertaintyArray
): Noise floor of the data. This can be set using an array of the same size as the data (e.g. if you want to assign a different noise floor to each datum) or as a scalar if you would like to assign a the same noise floor to all data.
The standard_deviation is constructed as follows:
relative_error * np.abs(dobs) + noise_floor
For example, if you set
data = Data(survey, dobs=dobs) data.noise_floor = 1e-10
then the contribution to the standard_deviation is equal to
data.noise_floor
, An array that can be set by a scalar value or numpy array of <class ‘float’>, <class ‘int’> with shape (*)
- noise_floor (
- relative_error (
UncertaintyArray
): Relative error of the data. This can be set using an array of the same size as the data (e.g. if you want to assign a different relative error to each datum) or as a scalar if you would like to assign a the same relative error to all data.
The standard_deviation is constructed as follows:
relative_error * np.abs(dobs) + noise_floor
For example, if you set
data = Data(survey, dobs=dobs) data.relative_error = 0.05
then the contribution to the standard_deviation is equal to
data.relative_error * np.abs(data.dobs)
, An array that can be set by a scalar value or numpy array of <class ‘float’>, <class ‘int’> with shape (*)
- relative_error (
survey (
BaseSurvey
): a SimPEG survey object, an instance of BaseSurvey
-
toRecArray
(returnType='RealImag')[source]¶ Returns a numpy.recarray for a SimpegNSEM impedance data object.
- Parameters
returnType (str, optional) – Switches between returning a rec array where the impedance is split to real and imaginary (‘RealImag’) or is a complex (‘Complex’)
- Return type
- Returns
Record array with data, with indexed columns
-
classmethod
fromRecArray
(recArray, srcType='primary')[source]¶ Class method that reads in a numpy record array to NSEMdata object.
- Parameters
recArray (numpy.recarray) – Record array with the data. Has to have (‘freq’,’x’,’y’,’z’) columns and some (‘zxx’,’zxy’,’zyx’,’zyy’,’tzx’,’tzy’)
srcType (str, optional) – The type of SimPEG.EM.NSEM.SrcNSEM to be used
-
class
SimPEG.electromagnetics.natural_source.sources.
Planewave_xy_1DhomotD
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc
NSEM source for both polarizations (x and y) for the total Domain.
It calculates fields calculated based on conditions on the boundary of the domain.
Required Properties:
frequency (
Float
): frequency of the source, a float in range [0, inf]integrate (
Boolean
): integrate the source term?, a boolean, Default: Falsereceiver_list (a list of
BaseRx
): receiver list, a list (each item is an instance of BaseRx)
Optional Properties:
location (
SourceLocationArray
): Location of the source [x, y, z] in 3D, a 1D array denoting the source location of <class ‘float’>, <class ‘int’> with shape (*)
-
class
SimPEG.electromagnetics.natural_source.sources.
Planewave_xy_1Dprimary
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc
NSEM planewave source for both polarizations (x and y) estimated from a single 1D primary models.
Required Properties:
frequency (
Float
): frequency of the source, a float in range [0, inf]integrate (
Boolean
): integrate the source term?, a boolean, Default: Falsereceiver_list (a list of
BaseRx
): receiver list, a list (each item is an instance of BaseRx)
Optional Properties:
location (
SourceLocationArray
): Location of the source [x, y, z] in 3D, a 1D array denoting the source location of <class ‘float’>, <class ‘int’> with shape (*)
-
ePrimary
(simulation)[source]¶ Primary electric field
- Parameters
simulation (BaseFDEMSimulation) – FDEM simulation
- Return type
- Returns
primary electric field
-
bPrimary
(simulation)[source]¶ Primary magnetic flux density
- Parameters
simulation (BaseFDEMSimulation) – FDEM simulation
- Return type
- Returns
primary magnetic flux density
-
class
SimPEG.electromagnetics.natural_source.sources.
Planewave_xy_3Dprimary
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc
NSEM source for both polarizations (x and y) given a 3D primary model. It assigns fields calculated from the 1D model as fields in the full space of the simulation.
Required Properties:
frequency (
Float
): frequency of the source, a float in range [0, inf]integrate (
Boolean
): integrate the source term?, a boolean, Default: Falsereceiver_list (a list of
BaseRx
): receiver list, a list (each item is an instance of BaseRx)
Optional Properties:
location (
SourceLocationArray
): Location of the source [x, y, z] in 3D, a 1D array denoting the source location of <class ‘float’>, <class ‘int’> with shape (*)
-
ePrimary
(simulation)[source]¶ Primary electric field
- Parameters
simulation (BaseFDEMSimulation) – FDEM simulation
- Return type
- Returns
primary electric field
-
bPrimary
(simulation)[source]¶ Primary magnetic flux density
- Parameters
simulation (BaseFDEMSimulation) – FDEM simulation
- Return type
- Returns
primary magnetic flux density
Module RxNSEM.py
Receivers for the NSEM problem
-
class
SimPEG.electromagnetics.natural_source.receivers.
BaseRxNSEM_Point
(*args, **kwargs)[source]¶ Bases:
SimPEG.survey.BaseRx
Natural source receiver base class.
Assumes that the data locations are xyz coordinates.
- param numpy.ndarray locs
receiver locations (ie.
np.r_[x,y,z]
)- param string orientation
receiver orientation ‘x’, ‘y’ or ‘z’
- param string component
real or imaginary component ‘real’ or ‘imag’
Required Properties:
component (
StringChoice
): component of the field (real or imag), either “real” or “imag”locations (
RxLocationArray
): Locations of the receivers (nRx x nDim), an array of receiver locations of <class ‘float’>, <class ‘int’> with shape (*, *)projGLoc (
StringChoice
): Projection grid location, default is CC, any of “CC”, “Fx”, “Fy”, “Fz”, “Ex”, “Ey”, “Ez”, “N”, Default: CCstoreProjections (
Boolean
): Store calls to getP (organized by mesh), a boolean, Default: True
-
property
component
¶ component (
StringChoice
): component of the field (real or imag), either “real” or “imag”
-
property
mesh
¶
-
property
src
¶
-
property
f
¶
-
property
Pex
¶
-
property
Pey
¶
-
property
Pbx
¶
-
property
Pby
¶
-
property
Pbz
¶
-
class
SimPEG.electromagnetics.natural_source.receivers.
Point1DImpedance
(*args, **kwargs)[source]¶ Bases:
SimPEG.survey.BaseRx
Natural source 1D impedance receiver class
- param string component
real or imaginary component ‘real’ or ‘imag’
Required Properties:
component (
StringChoice
): component of the field (real or imag), either “real” or “imag”locations (
RxLocationArray
): Locations of the receivers (nRx x nDim), an array of receiver locations of <class ‘float’>, <class ‘int’> with shape (*, *)projGLoc (
StringChoice
): Projection grid location, default is CC, any of “CC”, “Fx”, “Fy”, “Fz”, “Ex”, “Ey”, “Ez”, “N”, Default: CCstoreProjections (
Boolean
): Store calls to getP (organized by mesh), a boolean, Default: True
-
orientation
= 'yx'¶
-
property
component
¶ component (
StringChoice
): component of the field (real or imag), either “real” or “imag”
-
property
mesh
¶
-
property
src
¶
-
property
f
¶
-
property
Pex
¶
-
property
Pbx
¶
-
eval
(src, mesh, f, return_complex=False)[source]¶ Project the fields to natural source data.
- Parameters
src (SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc) – NSEM source
mesh (discretize.TensorMesh) – Mesh defining the topology of the problem
f (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – NSEM fields object of the source
(optional) return_complex (bool) – Flag for return the complex evaluation
- Return type
- Returns
Evaluated data for the receiver
-
evalDeriv
(src, mesh, f, v, adjoint=False)[source]¶ method evalDeriv
The derivative of the projection wrt u
- Parameters
src (SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc) – NSEM source
mesh (discretize.TensorMesh) – Mesh defining the topology of the problem
f (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – NSEM fields object of the source
v (numpy.ndarray) – vector of size (nU,) (adjoint=False) and size (nD,) (adjoint=True)
- Return type
- Returns
Calculated derivative (nD,) (adjoint=False) and (nP,2) (adjoint=True) for both polarizations
-
class
SimPEG.electromagnetics.natural_source.receivers.
Point3DImpedance
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.receivers.BaseRxNSEM_Point
Natural source 3D impedance receiver class
- param numpy.ndarray locs
receiver locations (ie.
np.r_[x,y,z]
)- param string orientation
receiver orientation ‘xx’, ‘xy’, ‘yx’ or ‘yy’
- param string component
real or imaginary component ‘real’ or ‘imag’
Required Properties:
component (
StringChoice
): component of the field (real or imag), either “real” or “imag”locations (
RxLocationArray
): Locations of the receivers (nRx x nDim), an array of receiver locations of <class ‘float’>, <class ‘int’> with shape (*, *)orientation (
StringChoice
): orientation of the receiver. Must currently be ‘xx’, ‘xy’, ‘yx’, ‘yy’, any of “xx”, “xy”, “yx”, “yy”projGLoc (
StringChoice
): Projection grid location, default is CC, any of “CC”, “Fx”, “Fy”, “Fz”, “Ex”, “Ey”, “Ez”, “N”, Default: CCstoreProjections (
Boolean
): Store calls to getP (organized by mesh), a boolean, Default: True
-
property
orientation
¶ orientation (
StringChoice
): orientation of the receiver. Must currently be ‘xx’, ‘xy’, ‘yx’, ‘yy’, any of “xx”, “xy”, “yx”, “yy”
-
eval
(src, mesh, f, return_complex=False)[source]¶ Project the fields to natural source data.
- Parameters
src (SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc) – The source of the fields to project
mesh (discretize.TensorMesh) – topological mesh corresponding to the fields
f (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – Natural source fields object to project
- Return type
- Returns
component of the impedance evaluation
-
evalDeriv
(src, mesh, f, v, adjoint=False)[source]¶ The derivative of the projection wrt u
- Parameters
src (SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc) – NSEM source
mesh (discretize.TensorMesh) – Mesh defining the topology of the problem
f (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – NSEM fields object of the source
v (numpy.ndarray) – vector of size (nU,) (adjoint=False) and size (nD,) (adjoint=True)
- Return type
- Returns
Calculated derivative (nD,) (adjoint=False) and (nP,2) (adjoint=True) for both polarizations
-
class
SimPEG.electromagnetics.natural_source.receivers.
Point3DTipper
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.receivers.BaseRxNSEM_Point
Natural source 3D tipper receiver base class
- param numpy.ndarray locs
receiver locations (ie.
np.r_[x,y,z]
)- param string orientation
receiver orientation ‘x’, ‘y’ or ‘z’
- param string component
real or imaginary component ‘real’ or ‘imag’
Required Properties:
component (
StringChoice
): component of the field (real or imag), either “real” or “imag”locations (
RxLocationArray
): Locations of the receivers (nRx x nDim), an array of receiver locations of <class ‘float’>, <class ‘int’> with shape (*, *)orientation (
StringChoice
): orientation of the receiver. Must currently be ‘zx’, ‘zy’, either “zx” or “zy”projGLoc (
StringChoice
): Projection grid location, default is CC, any of “CC”, “Fx”, “Fy”, “Fz”, “Ex”, “Ey”, “Ez”, “N”, Default: CCstoreProjections (
Boolean
): Store calls to getP (organized by mesh), a boolean, Default: True
-
property
orientation
¶ orientation (
StringChoice
): orientation of the receiver. Must currently be ‘zx’, ‘zy’, either “zx” or “zy”
-
eval
(src, mesh, f, return_complex=False)[source]¶ Project the fields to natural source data.
- Parameters
src (SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc) – The source of the fields to project
mesh (discretize.TensorMesh) – Mesh defining the topology of the problem
f (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – Natural source fields object to project
- Return type
- Returns
Evaluated component of the impedance data
-
evalDeriv
(src, mesh, f, v, adjoint=False)[source]¶ The derivative of the projection wrt u
- Parameters
src (SimPEG.electromagnetics.frequency_domain.sources.BaseFDEMSrc) – NSEM source
mesh (discretize.TensorMesh) – Mesh defining the topology of the problem
f (SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM) – NSEM fields object of the source
v (numpy.ndarray) – Random vector of size
- Return type
- Returns
Calculated derivative (nD,) (adjoint=False) and (nP,2) (adjoint=True) for both polarizations
-
class
SimPEG.electromagnetics.natural_source.receivers.
Point_impedance1D
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.receivers.Point1DImpedance
This class has been deprecated, see Point1DImpedance for documentation
-
class
SimPEG.electromagnetics.natural_source.receivers.
Point_impedance3D
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.receivers.Point3DImpedance
This class has been deprecated, see Point3DImpedance for documentation
-
class
SimPEG.electromagnetics.natural_source.receivers.
Point_tipper3D
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.receivers.Point3DTipper
This class has been deprecated, see Point3DTipper for documentation
-
class
SimPEG.electromagnetics.natural_source.
Data
(*args, **kwargs)[source]¶ Data class for NSEMdata. Stores the data vector indexed by the survey.
Required Properties:
- dobs (
Array
): Vector of the observed data. The data can be set using the survey parameters:
data = Data(survey) for src in survey.source_list: for rx in src.receiver_list: data[src, rx] = datum
, a list or numpy array of <class ‘float’>, <class ‘int’> with shape (*)
- dobs (
- noise_floor (
UncertaintyArray
): Noise floor of the data. This can be set using an array of the same size as the data (e.g. if you want to assign a different noise floor to each datum) or as a scalar if you would like to assign a the same noise floor to all data.
The standard_deviation is constructed as follows:
relative_error * np.abs(dobs) + noise_floor
For example, if you set
data = Data(survey, dobs=dobs) data.noise_floor = 1e-10
then the contribution to the standard_deviation is equal to
data.noise_floor
, An array that can be set by a scalar value or numpy array of <class ‘float’>, <class ‘int’> with shape (*)
- noise_floor (
- relative_error (
UncertaintyArray
): Relative error of the data. This can be set using an array of the same size as the data (e.g. if you want to assign a different relative error to each datum) or as a scalar if you would like to assign a the same relative error to all data.
The standard_deviation is constructed as follows:
relative_error * np.abs(dobs) + noise_floor
For example, if you set
data = Data(survey, dobs=dobs) data.relative_error = 0.05
then the contribution to the standard_deviation is equal to
data.relative_error * np.abs(data.dobs)
, An array that can be set by a scalar value or numpy array of <class ‘float’>, <class ‘int’> with shape (*)
- relative_error (
survey (
BaseSurvey
): a SimPEG survey object, an instance of BaseSurvey
-
toRecArray
(returnType='RealImag')[source]¶ Returns a numpy.recarray for a SimpegNSEM impedance data object.
- Parameters
returnType (str, optional) – Switches between returning a rec array where the impedance is split to real and imaginary (‘RealImag’) or is a complex (‘Complex’)
- Return type
- Returns
Record array with data, with indexed columns
-
classmethod
fromRecArray
(recArray, srcType='primary')[source]¶ Class method that reads in a numpy record array to NSEMdata object.
- Parameters
recArray (numpy.recarray) – Record array with the data. Has to have (‘freq’,’x’,’y’,’z’) columns and some (‘zxx’,’zxy’,’zyx’,’zyy’,’tzx’,’tzy’)
srcType (str, optional) – The type of SimPEG.EM.NSEM.SrcNSEM to be used
NSEM Fields¶
-
class
SimPEG.electromagnetics.natural_source.fields.
Fields1DPrimarySecondary
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.frequency_domain.fields.FieldsFDEM
Fields storage for the 1D NSEM solution.
Solving for e fields, using primary/secondary formulation
Required Properties:
simulation (
BaseSimulation
): a SimPEG simulation, an instance of BaseSimulation
-
knownFields
= {'e_1dSolution': 'F'}¶
-
aliasFields
= {'b_1d': ['e_1dSolution', 'E', '_b'], 'b_1dPrimary': ['e_1dSolution', 'E', '_bPrimary'], 'b_1dSecondary': ['e_1dSolution', 'E', '_bSecondary'], 'e_1d': ['e_1dSolution', 'F', '_e'], 'e_1dPrimary': ['e_1dSolution', 'F', '_ePrimary'], 'e_1dSecondary': ['e_1dSolution', 'F', '_eSecondary']}¶
-
class
SimPEG.electromagnetics.natural_source.fields.
Fields3DPrimarySecondary
(*args, **kwargs)[source]¶ Bases:
SimPEG.fields.Fields
Fields storage for the 3D NSEM solution. Labels polarizations by px and py.
- param SimPEG object mesh
The solution mesh
- param SimPEG object survey
A survey object
Required Properties:
simulation (
BaseSimulation
): a SimPEG simulation, an instance of BaseSimulation
-
dtype
¶ alias of
builtins.complex
-
knownFields
= {'e_pxSolution': 'E', 'e_pySolution': 'E'}¶
-
aliasFields
= {'b_px': ['e_pxSolution', 'F', '_b_px'], 'b_pxPrimary': ['e_pxSolution', 'F', '_b_pxPrimary'], 'b_pxSecondary': ['e_pxSolution', 'F', '_b_pxSecondary'], 'b_py': ['e_pySolution', 'F', '_b_py'], 'b_pyPrimary': ['e_pySolution', 'F', '_b_pyPrimary'], 'b_pySecondary': ['e_pySolution', 'F', '_b_pySecondary'], 'e_px': ['e_pxSolution', 'E', '_e_px'], 'e_pxPrimary': ['e_pxSolution', 'E', '_e_pxPrimary'], 'e_pxSecondary': ['e_pxSolution', 'E', '_e_pxSecondary'], 'e_py': ['e_pySolution', 'E', '_e_py'], 'e_pyPrimary': ['e_pySolution', 'E', '_e_pyPrimary'], 'e_pySecondary': ['e_pySolution', 'E', '_e_pySecondary']}¶
-
class
SimPEG.electromagnetics.natural_source.fields.
Fields1D_ePrimSec
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.fields.Fields1DPrimarySecondary
This class has been deprecated, see Fields1DPrimarySecondary for documentation
-
class
SimPEG.electromagnetics.natural_source.fields.
Fields3D_ePrimSec
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.fields.Fields3DPrimarySecondary
This class has been deprecated, see Fields3DPrimarySecondary for documentation
NSEM Utilities¶
-
SimPEG.electromagnetics.natural_source.utils.analytic_1d.
getEHfields
(m1d, sigma, freq, zd, scaleUD=True, scaleValue=1)[source]¶ Analytic solution for MT 1D layered earth. Returns E and H fields.
- Parameters
object m1d (discretize.base.BaseMesh,) – Mesh object with the 1D spatial information.
vector sigma (numpy.ndarray,) – Physical property of conductivity corresponding with the mesh.
freq (float,) – Frequency to calculate data at.
vector zd (numpy.ndarray,) – location to calculate EH fields at
scaleUD (bool,) – scales the output to be scaleValue at the top, increases numerical stability.
Assumes a halfspace with the same conductive as the deepest cell.
-
SimPEG.electromagnetics.natural_source.utils.analytic_1d.
getImpedance
(m1d, sigma, freq)[source]¶ Analytic solution for MT 1D layered earth. Returns the impedance at the surface.
- Parameters
object m1d (discretize.base.BaseMesh,) – Mesh object with the 1D spatial information.
vector sigma (numpy.ndarray,) – Physical property corresponding with the mesh.
vector freq (numpy.ndarray,) – Frequencies to calculate data at.
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
rotate_data
(NSEMdata, rot_angle)[source]¶ - Function that rotates clockwise by rotation angle
(- negative for a counter-clockwise rotation)
- Parameters
NSEMdata (SimPEG.electromagnetics.natural_source.Data) – NSEM data object to process
rot_angle (float) – Rotation angel in degrees, positive for clockwise rotation
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
extract_data_info
(NSEMdata)[source]¶ Simple function that extracts data, frequency and receiver type lists.
Useful when assigning uncertainties to data based on frequencies and receiver types.
- Parameters
NSEMdata (SimPEG.electromagnetics.natural_source.Data) – NSEM data object to process
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
resample_data
(NSEMdata, locs='All', freqs='All', rxs='All', verbose=False)[source]¶ Function that selects locations from all the receivers in the survey (uses the numerator location as a reference). Also gives the option of selecting frequencies and receiver.
- Parameters
NSEMdata (SimPEG.electromagnetics.natural_source.Data) – NSEM data object to process
locs (numpy.ndarray, optional) – receiver locations to use (default is ‘All’ locations)
freqs (numpy.ndarray, optional) – frequencies to use (default is ‘All’ frequencies))
rxs (str, optional) – list of receiver sting types to use (default is ‘All’ types). Can be any componation of [‘zxx’,’zxy’,’zyx’,’zyy’,’tzx’,’tzy’]
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
convert3Dto1Dobject
(NSEMdata, rxType3D='yx')[source]¶ Function that converts a 3D NSEMdata of a list of 1D NSEMdata objects for running 1D inversions for.
- Parameters
NSEMdata (SimPEG.electromagnetics.natural_source.Data) – NSEM data object to process
rxType3D (str, optional) – component of the NSEMdata to use. Can be ‘xy’, ‘yx’ or ‘det’
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
skindepth
(rho, freq)[source]¶ Function to calculate the skindepth of EM waves
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
rec_to_ndarr
(rec_arr, data_type=<class 'float'>)[source]¶ Function to transform a numpy record array to a nd array.
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
makeAnalyticSolution
(mesh, model, elev, freqs)[source]¶
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
plotMT1DModelData
(problem, models, symList=None)[source]¶
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
plotImpAppRes
(dataArrays, plotLoc, textStr=[])[source]¶ Plots amplitude impedance and phase
-
SimPEG.electromagnetics.natural_source.utils.data_utils.
printTime
()[source]¶ Small function to print the current time
-
class
SimPEG.electromagnetics.natural_source.utils.data_viewer.
NSEM_data_viewer
(*args, **kwargs)[source]¶ Bases:
properties.base.base.HasProperties
An interactive SimPEG NSEM Data viewer.
Generates a clickble location map of the data, plotting data curves in a separate window.
- Parameters
data (SimPEG.electromagnetics.natural_source.Data) – Data object, needs to have assigned relative_error and noise_floor
data_dict (dict, optional) – A dictionary of other NSEM Data objects
backend (str, optional) – Flag to control the backend used in matplotlib
-
property
dict_comp
¶
-
class
SimPEG.electromagnetics.natural_source.utils.edi_files_utils.
EDIimporter
(EDIfilesList, compList=None, outEPSG=None)[source]¶ Bases:
object
A class to import EDIfiles.
-
filesList
= None¶
-
comps
= None¶
-
-
SimPEG.electromagnetics.natural_source.utils.plot_data_types.
plotIsoFreqNSimpedance
(ax, freq, array, flag, par='abs', colorbar=True, colorNorm='SymLog', cLevel=True, contour=True)[source]¶
-
SimPEG.electromagnetics.natural_source.utils.plot_data_types.
plotIsoFreqNSDiff
(ax, freq, arrayList, flag, par='abs', colorbar=True, cLevel=True, mask=None, contourLine=True, useLog=False)[source]¶
-
SimPEG.electromagnetics.natural_source.utils.plot_data_types.
plotIsoFreqNStipper
(ax, freq, array, flag, par='abs', colorbar=True, colorNorm='SymLog', cLevel=True, contour=True)[source]¶
-
SimPEG.electromagnetics.natural_source.utils.plot_data_types.
plotIsoStaImpedance
(ax, loc, array, flag, par='abs', pSym='s', pColor=None, addLabel='', zorder=1)[source]¶
-
SimPEG.electromagnetics.natural_source.utils.plot_data_types.
plotPsudoSectNSimpedance
(ax, sectDict, array, flag, par='abs', colorbar=True, colorNorm='None', cLevel=None, contour=True)[source]¶
-
SimPEG.electromagnetics.natural_source.utils.plot_data_types.
plotPsudoSectNSDiff
(ax, sectDict, arrayList, flag, par='abs', colorbar=True, colorNorm='SymLog', cLevel=None, contour=True, mask=None, useLog=False)[source]¶
-
class
SimPEG.electromagnetics.natural_source.utils.plot_utils.
BaseDataNSEMPlots
(*args, **kwargs)[source]¶ Bases:
properties.base.base.HasProperties
A class container of matplotlib panels for plotting NSEM data.
Optional Properties:
axes (a list of
Axes
): List of plot axes, a list (each item is an instance of Axes)fig (
Figure
): Figure plotting, an instance of Figure
-
property
axes
¶ axes (a list of
Axes
): List of plot axes, a list (each item is an instance of Axes)
-
class
SimPEG.electromagnetics.natural_source.utils.plot_utils.
TipperAmplitudeStationPlot
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.utils.plot_utils.BaseDataNSEMPlots
- Class for setting up 2 axes figure with:
tipper amplitudes | tipper phase setup.
Optional Properties:
axes (a list of
Axes
): List of plot axes, a list (each item is an instance of Axes)fig (
Figure
): Figure plotting, an instance of Figure
-
draw
(data_list, location)[source]¶ Function to draw on the axes
- Parameters
data_list – List of NSEM data objects to plot. Has to be of length >= 1. First item is treat as a observed data (Hast to have relative_error and noise_floor) assigned) and the others are plotted on top.
location – Location of the station to plot
-
class
SimPEG.electromagnetics.natural_source.utils.plot_utils.
ApparentResPhsStationPlot
(*args, **kwargs)[source]¶ Bases:
SimPEG.electromagnetics.natural_source.utils.plot_utils.BaseDataNSEMPlots
Class for setting up 4 axes figure with:
apparent resistivity
phase
impedance amplitudes
impedance phase
setup.
Optional Properties:
axes (a list of
Axes
): List of plot axes, a list (each item is an instance of Axes)fig (
Figure
): Figure plotting, an instance of Figure
-
draw
(data_list, location)[source]¶ Function to draw on the axes
- Parameters
data_list – List of NSEM data objects to plot. Has to be of length >= 1. First item is treat as a observed data (Hast to have relative_error and noise_floor) assigned) and the others are plotted on top.
location – Location of the station to plot
-
class
SimPEG.electromagnetics.natural_source.utils.plot_utils.
DataNSEMPlotMethods
[source]¶ Bases:
object
Class container for properties and methods for plotting of NSEM data.
-
plot_app_res
(location, components=['xy', 'yx'], ax=None, errorbars=False, comp_plot_dict={'xx': {'color': 'green', 'label': 'Imp_xx', 'ls': 'None', 'marker': '_'}, 'xy': {'color': 'blue', 'label': 'Imp_xy', 'ls': 'None', 'marker': '_'}, 'yx': {'color': 'red', 'label': 'Imp_yx', 'ls': 'None', 'marker': '_'}, 'yy': {'color': 'yellow', 'label': 'Imp_yy', 'ls': 'None', 'marker': '_'}, 'zx': {'color': 'brown', 'label': 'Tip_zx', 'ls': 'None', 'marker': '_'}, 'zy': {'color': 'purple', 'label': 'Tip_zy', 'ls': 'None', 'marker': '_'}})[source]¶ Plot apperent resistivity curves at a given location
- Parameters
location (
axes
) – Location of the data pointcomponents (list) – List of the components to plot. Default = [‘xy’,’yx’]
ax (
axes
) – The ax object to add the, , Default: Noneerrorbars (bool) – Controls if errorbars are plotted Default = True
comp_plot_dict (dict) – Dictionary with additional kwargs for matplotlib.plot
-
plot_app_phs
(location, components=['xy', 'yx'], ax=None, errorbars=False, comp_plot_dict={'xx': {'color': 'green', 'label': 'Imp_xx', 'ls': 'None', 'marker': '_'}, 'xy': {'color': 'blue', 'label': 'Imp_xy', 'ls': 'None', 'marker': '_'}, 'yx': {'color': 'red', 'label': 'Imp_yx', 'ls': 'None', 'marker': '_'}, 'yy': {'color': 'yellow', 'label': 'Imp_yy', 'ls': 'None', 'marker': '_'}, 'zx': {'color': 'brown', 'label': 'Tip_zx', 'ls': 'None', 'marker': '_'}, 'zy': {'color': 'purple', 'label': 'Tip_zy', 'ls': 'None', 'marker': '_'}})[source]¶ Plot apperent resistivity curves at a given location
- Parameters
location (
axes
) – Location of the data pointcomponents (list) – List of the components to plot. Default = [‘xy’,’yx’]
ax (
axes
) – The ax object to add the, , Default: Noneerrorbars (bool) – Controls if errorbars are plotted Default = True
comp_plot_dict (dict) – Dictionary with additional kwargs for matplotlib.plot settings
-
plot_imp_amp
(location, components=['xy', 'yx'], ax=None, errorbars=False, comp_plot_dict={'xx': {'color': 'green', 'label': 'Imp_xx', 'ls': 'None', 'marker': '_'}, 'xy': {'color': 'blue', 'label': 'Imp_xy', 'ls': 'None', 'marker': '_'}, 'yx': {'color': 'red', 'label': 'Imp_yx', 'ls': 'None', 'marker': '_'}, 'yy': {'color': 'yellow', 'label': 'Imp_yy', 'ls': 'None', 'marker': '_'}, 'zx': {'color': 'brown', 'label': 'Tip_zx', 'ls': 'None', 'marker': '_'}, 'zy': {'color': 'purple', 'label': 'Tip_zy', 'ls': 'None', 'marker': '_'}})[source]¶ Plot impedance amplitude curves at a given location
- Parameters
location (
axes
) – Location of the data pointcomponents (list) – List of the components to plot. Default = [‘xy’,’yx’]
ax (
axes
) – The ax object to add the, , Default: Noneerrorbars (bool) – Controls if errorbars are plotted Default = True
comp_plot_dict (dict) – Dictionary with additional kwargs for matplotlib.plot
-
plot_tip_amp
(location, components=['zx', 'zy'], ax=None, errorbars=False, comp_plot_dict={'xx': {'color': 'green', 'label': 'Imp_xx', 'ls': 'None', 'marker': '_'}, 'xy': {'color': 'blue', 'label': 'Imp_xy', 'ls': 'None', 'marker': '_'}, 'yx': {'color': 'red', 'label': 'Imp_yx', 'ls': 'None', 'marker': '_'}, 'yy': {'color': 'yellow', 'label': 'Imp_yy', 'ls': 'None', 'marker': '_'}, 'zx': {'color': 'brown', 'label': 'Tip_zx', 'ls': 'None', 'marker': '_'}, 'zy': {'color': 'purple', 'label': 'Tip_zy', 'ls': 'None', 'marker': '_'}})[source]¶ Plot tipper amplitude curves at a given location
- Parameters
location (
axes
) – Location of the data pointcomponents (list) – List of the components to plot. Default = [‘xy’,’yx’]
ax (
axes
) – The ax object to add the, , Default: Noneerrorbars (bool) – Controls if errorbars are plotted Default = True
comp_plot_dict (dict) – Dictionary with additional kwargs for matplotlib.plot
-
map_data_locations
(ax=None, **plot_kwargs)[source]¶ - Function that plots all receiver locations of the data
(all discreate data locations).
- Parameters
ax (
axes
) – The ax object for mapping to. Default: None
-
station_component
(location, orientation, component, ax=None, **plot_kwargs)[source]¶ - Parameters
location (numpy.ndarray) – Coordnaties of the station to plot
orientation (str) – The orientation of the data
component (str) – The data component to plot
ax (matplotlib.axes.Axes) – Axes (optional):
keyword_arguments plot_kwargs (matplotlib.lines.Line2D) –
-
station_errorbars
(location, orientation, component, ax=None, **plot_kwargs)[source]¶ - Parameters
location (numpy.ndarray) – Coordnaties of the station to plot
orientation (str) – The orientation of the data
component (str) – The data component to plot
ax (matplotlib.axes.Axes) – Axes (optional)
keyword_arguments plot_kwargs (matplotlib.lines.Line2D) –
-
frequency_map
(frequency, orientation, component, ax=None, plot_error=True, **plot_kwargs)[source]¶ Function to generate a iso-frequency map
- Parameters
frequency (numpy.ndarray) – Frequency to be mapped
orientation (str) – The orientation of the data
component (str) – The data component to plot
ax (matplotlib.axes.Axes) – Axes (optional)
keyword_arguments plot_kwargs (matplotlib.lines.Line2D) –
-
-
SimPEG.electromagnetics.natural_source.utils.solutions_1d.
get1DEfields
(m1d, sigma, freq, sourceAmp=1.0)[source]¶ Function to get 1D electrical fields
-
SimPEG.electromagnetics.natural_source.utils.source_utils.
homo1DModelSource
(mesh, freq, sigma_1d)[source]¶ Function that calculates and return background fields
- Parameters
mesh (discretize.base.BaseMesh) – Holds information on the discretization
freq (float) – The frequency to solve at
sigma_1d (numpy.ndarray) – Background model of conductivity to base the calculations on, 1d model.
- Return type
- Returns
eBG_bp, E fields for the background model at both polarizations with shape (mesh.nE, 2).
-
SimPEG.electromagnetics.natural_source.utils.source_utils.
analytic1DModelSource
(mesh, freq, sigma_1d)[source]¶ Function that calculates and return background fields
- Parameters
mesh (discretize.base.BaseMesh) – Holds information on the discretization
freq (float) – The frequency to solve at
sigma_1d (numpy.ndarray) – Background model of conductivity to base the calculations on, 1d model.
- Return type
- Returns
eBG_bp, E fields for the background model at both polarizations with shape (mesh.nE, 2).