2.6.3.1. pycsamt.emtf.converters.edi#
Explicit conversion between SEG EDI and the format-neutral EMTF model.
This module is deliberately an adapter. It does not make EDIFile
the scientific core and it does not move rotation mathematics into parsing.
The bridge preserves the historical pyCSAMT Z.z_err convention while
representing EDI *.VAR blocks explicitly as EMTF complex variances.
Functions
|
Convert a historical SEG EDI object/path into |
|
Convert |
|
Write an |
Exceptions
Warning emitted when an EDI conversion cannot preserve information. |
|
Raised when an EDI conversion would be scientifically invalid. |
- exception pycsamt.emtf.converters.edi.DataLossWarning[source]
Bases:
UserWarningWarning emitted when an EDI conversion cannot preserve information.
- exception pycsamt.emtf.converters.edi.EMTFEDIConversionError[source]
Bases:
ValueErrorRaised when an EDI conversion would be scientifically invalid.
- pycsamt.emtf.converters.edi.edi_to_emtf(source, *, prefer_spectra=True, spectra_nfreq_policy='raise', spectra_missing_policy='raise', spectra_avgt_policy='raise')[source]
Convert a historical SEG EDI object/path into
EMTF.EDI SPECTRA are preferred when present because they retain enough cross-power information to recover the full inverse-signal and residual covariance matrices. Set
prefer_spectra=Falseto force the historical impedance/tipper blocks.Notes
pyCSAMT historically stores
Z.z_err = sqrt(EDI complex variance). The non-SPECTRA path therefore reconstructs EMTFVARasz_err**2exactly, preserving the EDI file’s complex-variance convention without redefining the publicZ.z_errAPI. The standard error of a real or imaginary component, when needed statistically, issqrt(VAR / 2).
- pycsamt.emtf.converters.edi.emtf_to_edi(document, *, on_loss='warn')[source]
Convert
EMTFinto an in-memory historicalEDIFile.The standard EDI representation used here stores impedance/tipper and component variances. Rich covariance matrices, arbitrary TF types, and several EMTF metadata blocks have no lossless destination;
on_losscontrols whether those reductions warn, raise, or are explicitly ignored.
- pycsamt.emtf.converters.edi.write_edi(obj, target, *, on_loss='warn', preserve_zero=True, stamp_headers=False, force_tipper=None, **kwargs)[source]
Write an
EMTForEDIFileto an exact filesystem target.Existing
EDIFile.write()behavior remains unchanged by default. This neutral adapter opts intopreserve_zero=Trueso finite physical zeros are not turned into the EDI missing-value sentinel during format conversion; NaN/Inf values are still serialized as the sentinel.