2.6.1.1. pycsamt.emtf.document#
Document-level electromagnetic transfer-function scientific container.
Classes
|
Format-neutral electromagnetic transfer-function document. |
- class pycsamt.emtf.document.EMTF(product_id=None, description=None, subtype=None, tags=<factory>, periods=None, transfer_functions=<factory>, provenance=None, copyright=None, site=None, site_layout=None, orientation=None, processing=None, quality=None, field_notes=<factory>, station=None, station_id=None, lat=None, lon=None, elev=None, azimuth=None, metadata=<factory>, attrs=<factory>)[source]
Bases:
MTBaseFormat-neutral electromagnetic transfer-function document.
EMTFis the scientific object that EDI and EMTF XML adapters will eventually populate. Phase 2 adds reusable metadata objects while keeping the model independent of XML parsing andpycsamt.seg.- Parameters:
product_id (str | None)
description (str | None)
subtype (str | None)
periods (Any | None)
transfer_functions (dict[str, TransferFunction])
provenance (ProvenanceMeta | None)
copyright (CopyrightInfo | None)
site (SiteMeta | None)
site_layout (SiteLayout | None)
orientation (OrientationMeta | None)
processing (ProcessingMeta | None)
quality (TransferFunctionQuality | None)
station (str | None)
lat (float | None)
lon (float | None)
elev (float | None)
azimuth (float | None)
- transfer_functions: dict[str, TransferFunction]
- provenance: ProvenanceMeta | None = None
- copyright: CopyrightInfo | None = None
- site_layout: SiteLayout | None = None
- orientation: OrientationMeta | None = None
- processing: ProcessingMeta | None = None
- quality: TransferFunctionQuality | None = None
- validate()[source]
Normalize document state and validate attached TF period grids.
- Return type:
None
- property frequency: ndarray | None[source]
Return the document frequency vector in Hz when available.
- add_transfer_function(tf, *, key=None, replace=False)[source]
Attach one scientific transfer function to the document.
- Parameters:
tf (TransferFunction)
key (str | None)
replace (bool)
- Return type:
- get_transfer_function(key)[source]
Return a TF by semantic key or registered short code.
- Parameters:
key (str)
- Return type:
TransferFunction | None
- property impedance: TransferFunction | None[source]
Return the matrix-oriented impedance TF.
- property tipper_tf: TransferFunction | None[source]
Return the matrix-oriented tipper TF.
- property Z[source]
Build the existing
pycsamt.z.Zcompatibility object.
- property Tip[source]
Build the existing
pycsamt.z.tipper.Tipperobject.
- classmethod from_xml(source, *, strict=True)[source]
Read an EMTF XML document through the XML adapter.
The import is intentionally local so constructing the scientific core never requires XML serialization support unless this method is called.
- classmethod from_edi(source, **kwargs)[source]
Convert a historical SEG EDI object or path into
EMTF.EDI SPECTRA are preferred by default when present because they retain the full information needed to recover transfer-function covariance. Pass
prefer_spectra=Falseto force the traditional impedance/tipper blocks instead. The adapter import remains local so the scientific core is independent ofpycsamt.seguntil requested.- Return type:
- classmethod from_edi_spectra(source, **kwargs)[source]
Recover EMTFs and full covariance directly from EDI SPECTRA.
This is the explicit Phase-8 entry point for single-station and remote-reference cross-power spectra. Any requested rotation is delegated to the format-neutral Phase-7 rotation engine.
- Return type:
- to_edi(*, on_loss='warn')[source]
Return an in-memory
pycsamt.seg.EDIFilerepresentation.- Parameters:
on_loss ({"warn", "raise", "ignore"}) – Policy for EMTF content that standard EDI cannot preserve.
- to_xml(*, strict=True, precision=17, pretty=True, xml_declaration=True)[source]
Serialize this scientific document to an EMTF XML string.
- write_xml(target, *, strict=True, precision=17, pretty=True, xml_declaration=True, encoding='utf-8')[source]
Write this document in EMTF XML format.
- write(target, *, format='emtf_xml', **kwargs)[source]
Write this document using a supported serialization format.
Phase 6 supports EMTF XML and historical SEG EDI. EDI conversion is explicit and may emit
DataLossWarningfor content that the historical format cannot represent.- Parameters:
format (str)
- rotate(angle=0.0, *, target='orthogonal', inplace=False, source_angles=None, use_legacy_edi_rotation=False, variance_policy='drop', unsupported_estimates='drop', derived_policy='drop')[source]
Rotate transfer functions with the format-neutral EMTF engine.
The original
SiteLayoutremains physical acquisition metadata and is never rotated. Full covariance factors are transformed consistently when present.