pycsamt.metadata.instrument.InstrumentMeta#
- class pycsamt.metadata.instrument.InstrumentMeta(system='', serial=None, magnetic_sensor=None, electric_sensor=None, software_version='', notes='')[source]#
Bases:
objectStructured descriptor for an EM acquisition system.
- Parameters:
system (str) – Human-readable system name, e.g.
"Phoenix V8"or"Metronix ADU-07e".serial (str or None) – Logger serial number or site-specific tag.
magnetic_sensor (SensorSpec or None) – Magnetic-field transducer (H field) specification.
electric_sensor (SensorSpec or None) – Electric-field transducer (E field) specification.
software_version (str) – Processing / acquisition software version string.
notes (str) – Free-text annotation (calibration date, operator remarks, …).
Notes
The class deliberately stays thin — only fields that appear (or could appear) in a standard EDI
>HEADblock or in a compact YAML survey manifest are stored here. Calibration tables belong in separate files referenced bynotes.Examples
>>> from pycsamt.metadata.instrument import InstrumentMeta >>> inst = InstrumentMeta(system="Phoenix V8", serial="V8-00123") >>> inst.to_head_fields() {'acqby': 'Phoenix V8 / V8-00123', 'progvers': 'pyCSAMT'}
- __init__(system='', serial=None, magnetic_sensor=None, electric_sensor=None, software_version='', notes='')#
- Parameters:
system (str)
serial (str | None)
magnetic_sensor (SensorSpec | None)
electric_sensor (SensorSpec | None)
software_version (str)
notes (str)
- Return type:
None
Methods
__init__([system, serial, magnetic_sensor, ...])from_head(head)Construct from a
Headobject.from_json(s)Deserialise from a JSON string.
from_preset(name)Build from a named preset in
KNOWN_SYSTEMS.from_yaml(s)Deserialise from a YAML string (requires PyYAML).
load(path)Load from a JSON or YAML file (format detected by extension).
save(path[, fmt])Write to path as JSON or YAML.
summary()Return a multi-line human-readable summary.
to_dict()Serialise to a plain dict (JSON-safe).
Return a dict of EDI
>HEADkey-value pairs.to_json([indent])Serialise to a JSON string.
to_yaml()Serialise to a YAML string (requires PyYAML).
Attributes
"<system> / <serial>"or just system.- magnetic_sensor: SensorSpec | None = None#
- electric_sensor: SensorSpec | None = None#
- to_head_fields()[source]#
Return a dict of EDI
>HEADkey-value pairs.The mapping is:
acqby ← system / serial (or just system) progvers ← software_version (or the package default)
- classmethod from_head(head)[source]#
Construct from a
Headobject.Only
acqbyandprogversare extracted; sensor details cannot be inferred from the EDI header alone.- Parameters:
head (Any) – A
pycsamt.seg.heads.Headinstance (or any object withacqbyandprogversstring attributes).- Return type:
- classmethod from_preset(name)[source]#
Build from a named preset in
KNOWN_SYSTEMS.- Parameters:
name (str) – Case-insensitive preset key, e.g.
"phoenix_v8".- Return type:
- Raises:
KeyError – If name is not in
KNOWN_SYSTEMS.
Examples
>>> inst = InstrumentMeta.from_preset("lemi_424") >>> inst.system 'LEMI-424'
- classmethod from_yaml(s)[source]#
Deserialise from a YAML string (requires PyYAML).
- Parameters:
s (str)
- Return type:
- save(path, fmt='json')[source]#
Write to path as JSON or YAML.
- Parameters:
path (str) – Destination file path.
fmt ({"json", "yaml"})
- Return type:
None