Lightweight registry and helpers used by EDI readers.
The mixin stores parsed section objects (e.g. >HEAD,
>=MTSECT, >=SPECTRASECT) in a simple dictionary,
and provides tiny utilities to manage and query them.
It does not perform I/O. Host classes remain free
to decide when and how sections are discovered and
populated. This keeps the orchestration logic small and
testable.
Variables:
sections (dict[str, object]) – Case–insensitive mapping from a logical section key
(e.g. "head", "mtsect", "spectra") to the
parsed object that represents that section.
Translate a raw >=... header tag to a canonical
registry key (e.g. ">=MTSECT"→"mtsect").
Notes
The registry is intentionally untyped so that different
parser implementations can coexist. For instance, a
project may store a header object (SpectraSECT)
and also the decoded payload object (Spectra) under
separate keys.
The reader accepts both complex tensor blocks and the
scalar families (RHO* and PHS*). When complex
blocks are missing, the impedance tensor is reconstructed
from resistivity and phase if possible.
Return a mapping key→list[float] by streaming
lines until the next section or EOF. Unknown keys are
ignored. Values equal to empty_val are converted
to zeros.
High–level EDI dispatcher for SEG/EMAP/CSAMT archives.
The class discovers top–level headers (e.g. >=MTSECT,
>=SPECTRASECT, >=TSERIESSECT), loads the matching
data blocks, and exposes convenient Python containers for
impedance tensors, tippers, spectra, and time series.
It also writes EDI files by reusing the in–memory sections,
preserving headers when possible, and regenerating block
payloads from the current objects.
Parameters:
path (str or Path, optional) – File to open. If given, read() is executed on
construction.
verbose (int, optional) – Verbosity level propagated to subcomponents.