InversionMesh is the common mesh metadata object carried by
pycsamt.inversion.results.InversionResult. Numerical engines may
keep their real discretization object in native while exposing common
profile/depth centers through x_centers and z_centers.
Parameters:
dimension ({"1d", "2d", "3d"}, default "1d") – Mesh dimensionality represented by this descriptor.
x_centers (array-like of float, optional) – Horizontal/profile cell centers in metres. For 1-D meshes this is
usually [0.0].
z_centers (array-like of float, optional) – Depth cell centers in metres, positive downward.
native (object, optional) – Backend-native mesh/grid object, for example a SimPEG TensorMesh or
built-in forward Grid2D.
metadata (dict, optional) – Free-form mesh provenance such as builder name, backend engine, padding,
or core-cell shape.
Build a 1-D TensorMesh-like object and positive-downward centres.
This helper centralizes the depth discretization used by optional engines
such as SimPEG. The caller supplies the actual TensorMesh class so this
module stays free of optional dependencies.
Parameters:
start (object) – Starting model exposing n_layers, resistivities, and
thicknesses.
options (dict, optional) – Mesh controls. Recognized keys include n_cells, depth_max,
origin, min_cell_size, and growth_factor.
Build a 3-D TensorMesh-like object around station coordinates.
The helper constructs uniform horizontal cells around the station footprint
and geometrically growing depth cells. It is used by optional 3-D physics
paths while keeping the native mesh class injectable.
Parameters:
station_x (array-like of float) – Station coordinates in metres.
station_y (array-like of float) – Station coordinates in metres.
options (dict, optional) – Mesh controls. Recognized keys include x_pad, y_pad,
depth_max, nx, ny, nz, min_cell_size, and
growth_factor.
centers (dict of ndarray) – Cell-center arrays with keys "x", "y", "z", and
"z_depth". z follows the native mesh coordinate with depth
negative; z_depth is positive downward.
Build the finite-difference 2-D grid used by built-in inversion.
This builder creates the starting Grid2D-like object for the built-in
finite-difference MT/AMT/CSAMT profile inversion. It shifts station
coordinates into the grid coordinate system, adds optional lateral/depth
padding, and expands the layered starting model into a 2-D resistivity
array.
Parameters:
start (object) – Starting model exposing resistivities and thicknesses.
station_x (array-like of float) – Station positions along profile in metres. At least two distinct
stations are required.
options (dict, optional) – Grid controls. Recognized keys include nx/fd2d_nx,
n_pad/fd2d_n_pad, pad_factor, x_margin, x_max, and
halfspace_thickness.
options (dict, optional) – Mesh options. Recognized keys are min_cell_size and
growth_factor. Defaults are chosen conservatively from
depth_max and n_cells.
Returns:
Positive cell widths in metres.
Return type:
ndarray
Raises:
ValueError – If depth_max, n_cells, min_cell_size, or growth_factor
are not positive.