geopulse.earth.base

Abstract base class for Earth conductivity models.

The design contract: every EarthModel produces an Impedance object. The Impedance handles the actual E-field computation via polymorphism. 1-D models produce ScalarImpedance, 2-D produce TensorImpedance, 3-D produce KernelImpedance. The efield layer calls impedance.apply(...) and never knows which type it got.

Classes

ConductivityLayer(thickness_m, conductivity_Sm)

A single layer in a 1-D conductivity model.

EarthModel()

Abstract base class for Earth conductivity models.

class geopulse.earth.base.ConductivityLayer(thickness_m, conductivity_Sm)[source]

Bases: object

A single layer in a 1-D conductivity model.

thickness_m

Layer thickness in meters. Use numpy.inf for the terminating half-space (bottom layer).

Type:

float

conductivity_Sm

Electrical conductivity in S/m.

Type:

float

Notes

Resistivity ρ = 1/σ is NOT stored — compute it when needed to avoid redundancy and potential inconsistency.

Raises:

ValueError – If conductivity_Sm is non-positive, or thickness_m is non-positive and not infinite.

Parameters:
thickness_m: float
conductivity_Sm: float
class geopulse.earth.base.EarthModel[source]

Bases: ABC

Abstract base class for Earth conductivity models.

Subclasses represent different spatial complexity:

  • Layered1D — horizontally layered half-space (Wait recursion).

  • Structured2D — 2-D cross-section (finite-difference).

  • Unstructured3D — full volumetric (ModEM / SimPEG wrapper).

All produce an Impedance object via compute_impedance().

abstractmethod compute_impedance(freqs_Hz)[source]

Compute the surface impedance at the given frequencies.

Parameters:

freqs_Hz (ndarray) – Frequency array in Hz. Shape: (n_freqs,). Must be non-negative. DC (0 Hz) is allowed but may return NaN because the plane-wave impedance is undefined at ω = 0.

Return type:

Impedance

Returns:

Impedance – An Impedance subclass matching this model’s dimensionality.

abstract property tier: int

1 for 1-D, 2 for 2-D, 3 for 3-D.

Type:

Dimensionality tier

classmethod from_library(name)[source]

Load a named model from the built-in library.

Parameters:

name (str) – Model name. See geopulse.earth.library.list_models() for the registry.

Return type:

EarthModel

Returns:

EarthModel – The requested model.

Raises:

KeyError – If name is not registered.