pycsamt.metadata.instrument#

pycsamt.metadata.instrument#

Structured acquisition-system descriptor for MT / AMT / CSAMT / TEM surveys.

InstrumentMeta captures the recording system and sensor configuration in a form that can be round-tripped to/from EDI >HEAD fields and JSON/YAML. Pre-built presets for common field systems (Phoenix, Metronix, LEMI, Zonge) are available via known_system().

Quick start#

from pycsamt.metadata.instrument import InstrumentMeta, SensorSpec

# Manually construct
inst = InstrumentMeta(
    system="Phoenix V8",
    serial="V8-20473",
    magnetic_sensor=SensorSpec(
        sensor_type="induction_coil",
        model="MTC-150H",
        frequency_range=(0.00001, 10000.0),
    ),
    electric_sensor=SensorSpec(sensor_type="electrode", model="Pb-PbCl2"),
)
print(inst.summary())

# Build from a preset
inst2 = InstrumentMeta.from_preset("metronix_adu07")

# Round-trip JSON
import json
s = inst.to_json()
inst3 = InstrumentMeta.from_json(s)

# Push fields to an EDI Head dict
head_dict = inst.to_head_fields()   # {"acqby": "Phoenix V8 / V8-20473", ...}

API Reference#

SensorSpec([sensor_type, model, ...])

Specification for a single sensor (magnetic or electric).

InstrumentMeta([system, serial, ...])

Structured descriptor for an EM acquisition system.

known_system(name)

Shortcut for InstrumentMeta.from_preset().

list_presets()

Return sorted list of available preset keys.

Module Attributes

KNOWN_SYSTEMS

Registry of known acquisition systems.

Functions

known_system(name)

Shortcut for InstrumentMeta.from_preset().

list_presets()

Return sorted list of available preset keys.

Classes

InstrumentMeta([system, serial, ...])

Structured descriptor for an EM acquisition system.

SensorSpec([sensor_type, model, ...])

Specification for a single sensor (magnetic or electric).

class pycsamt.metadata.instrument.SensorSpec(sensor_type='induction_coil', model='', frequency_range=None, notes='')[source]#

Bases: object

Specification for a single sensor (magnetic or electric).

Parameters:
  • sensor_type ({"induction_coil", "fluxgate", "electrode", "other"}) – Physical transducer principle.

  • model (str) – Manufacturer model string, e.g. "MTC-150H".

  • frequency_range (tuple[float, float] or None) – (f_min, f_max) in Hz that the sensor is rated for.

  • notes (str) – Free-text annotation (calibration file name, mounting details, etc.).

Examples

>>> s = SensorSpec("induction_coil", "MTC-150H", (1e-5, 1e4))
>>> s.covers(0.1)
True
>>> s.covers(1e6)
False
sensor_type: Literal['induction_coil', 'fluxgate', 'electrode', 'other'] = 'induction_coil'#
model: str = ''#
frequency_range: tuple[float, float] | None = None#
notes: str = ''#
covers(frequency_hz)[source]#

Return True if frequency_hz lies within the rated band.

Parameters:

frequency_hz (float)

Return type:

bool

class pycsamt.metadata.instrument.InstrumentMeta(system='', serial=None, magnetic_sensor=None, electric_sensor=None, software_version='', notes='')[source]#

Bases: object

Structured 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 >HEAD block or in a compact YAML survey manifest are stored here. Calibration tables belong in separate files referenced by notes.

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'}
system: str = ''#
serial: str | None = None#
magnetic_sensor: SensorSpec | None = None#
electric_sensor: SensorSpec | None = None#
software_version: str = ''#
notes: str = ''#
property label: str[source]#

"<system> / <serial>" or just system.

Type:

Short identifier

summary()[source]#

Return a multi-line human-readable summary.

Return type:

str

to_head_fields()[source]#

Return a dict of EDI >HEAD key-value pairs.

The mapping is:

acqby    ← system / serial  (or just system)
progvers ← software_version (or the package default)
Returns:

Ready to pass to update().

Return type:

dict

classmethod from_head(head)[source]#

Construct from a Head object.

Only acqby and progvers are extracted; sensor details cannot be inferred from the EDI header alone.

Parameters:

head (Any) – A pycsamt.seg.heads.Head instance (or any object with acqby and progvers string attributes).

Return type:

InstrumentMeta

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:

InstrumentMeta

Raises:

KeyError – If name is not in KNOWN_SYSTEMS.

Examples

>>> inst = InstrumentMeta.from_preset("lemi_424")
>>> inst.system
'LEMI-424'
to_dict()[source]#

Serialise to a plain dict (JSON-safe).

Return type:

dict[str, Any]

to_json(indent=2)[source]#

Serialise to a JSON string.

Parameters:

indent (int)

Return type:

str

classmethod from_json(s)[source]#

Deserialise from a JSON string.

Parameters:

s (str)

Return type:

InstrumentMeta

to_yaml()[source]#

Serialise to a YAML string (requires PyYAML).

Return type:

str

classmethod from_yaml(s)[source]#

Deserialise from a YAML string (requires PyYAML).

Parameters:

s (str)

Return type:

InstrumentMeta

save(path, fmt='json')[source]#

Write to path as JSON or YAML.

Parameters:
  • path (str) – Destination file path.

  • fmt ({"json", "yaml"})

Return type:

None

classmethod load(path)[source]#

Load from a JSON or YAML file (format detected by extension).

Parameters:

path (str)

Return type:

InstrumentMeta

pycsamt.metadata.instrument.KNOWN_SYSTEMS: dict[str, dict[str, Any]] = {'generic_fluxgate': {'electric_sensor': None, 'magnetic_sensor': {'frequency_range': [0.0, 10.0], 'model': '', 'notes': 'Low-frequency or DC fluxgate; used in TEM & airborne', 'sensor_type': 'fluxgate'}, 'notes': 'Generic fluxgate configuration', 'serial': None, 'software_version': '', 'system': 'Generic fluxgate magnetometer'}, 'geometrics_stratagem': {'electric_sensor': {'frequency_range': None, 'model': 'Pb-PbCl2', 'notes': '', 'sensor_type': 'electrode'}, 'magnetic_sensor': {'frequency_range': [10.0, 100000.0], 'model': 'EH4 coil', 'notes': 'AMT band; controlled source / natural field', 'sensor_type': 'induction_coil'}, 'notes': 'EH4 tensor AMT system (10 Hz 100 kHz)', 'serial': None, 'software_version': '', 'system': 'Geometrics Stratagem EH4'}, 'lemi_424': {'electric_sensor': {'frequency_range': None, 'model': 'Pb-PbCl2', 'notes': '', 'sensor_type': 'electrode'}, 'magnetic_sensor': {'frequency_range': [0.0003, 1000.0], 'model': 'LEMI-120', 'notes': 'Low-frequency induction coil for long-period MT', 'sensor_type': 'induction_coil'}, 'notes': 'LEMI-424 low-frequency broadband system', 'serial': None, 'software_version': '', 'system': 'LEMI-424'}, 'metronix_adu07': {'electric_sensor': {'frequency_range': None, 'model': 'Pb-PbCl2 porous pot', 'notes': '', 'sensor_type': 'electrode'}, 'magnetic_sensor': {'frequency_range': [0.0001, 4096.0], 'model': 'MFS-06e', 'notes': 'Metronix broadband coil; pairs with ADU-07e', 'sensor_type': 'induction_coil'}, 'notes': 'Metronix ADU-07e broadband MT system', 'serial': None, 'software_version': 'ADU-07e firmware', 'system': 'Metronix ADU-07e'}, 'metronix_adu08': {'electric_sensor': {'frequency_range': None, 'model': 'Pb-PbCl2 porous pot', 'notes': '', 'sensor_type': 'electrode'}, 'magnetic_sensor': {'frequency_range': [1e-05, 4096.0], 'model': 'MFS-07e', 'notes': 'High-resolution Metronix coil for quiet sites', 'sensor_type': 'induction_coil'}, 'notes': 'Metronix ADU-08e high-resolution system', 'serial': None, 'software_version': 'ADU-08e firmware', 'system': 'Metronix ADU-08e'}, 'phoenix_mtx': {'electric_sensor': {'frequency_range': None, 'model': 'Pb-PbCl2 porous pot', 'notes': '', 'sensor_type': 'electrode'}, 'magnetic_sensor': {'frequency_range': [1e-05, 10000.0], 'model': 'MTC-155', 'notes': 'Ultra-broadband Phoenix coil', 'sensor_type': 'induction_coil'}, 'notes': 'Phoenix MTX broadband system', 'serial': None, 'software_version': 'SSMT2000', 'system': 'Phoenix MTX'}, 'phoenix_v8': {'electric_sensor': {'frequency_range': None, 'model': 'Pb-PbCl2 porous pot', 'notes': 'Non-polarising; standard 50–100 m dipole', 'sensor_type': 'electrode'}, 'magnetic_sensor': {'frequency_range': [0.0001, 2000.0], 'model': 'MTC-150H', 'notes': 'Broadband MT coil; low-noise below 1 Hz', 'sensor_type': 'induction_coil'}, 'notes': 'Standard Phoenix V8 MT/AMT system', 'serial': None, 'software_version': 'SSMT2000', 'system': 'Phoenix V8'}, 'zonge_gdp32': {'electric_sensor': {'frequency_range': None, 'model': 'Pb-PbCl2', 'notes': '', 'sensor_type': 'electrode'}, 'magnetic_sensor': {'frequency_range': [0.001, 10000.0], 'model': 'ANT/6', 'notes': 'Zonge broadband coil, common in CSAMT surveys', 'sensor_type': 'induction_coil'}, 'notes': 'Zonge GDP-32 CSAMT/MT system', 'serial': None, 'software_version': '', 'system': 'Zonge GDP-32'}}#

Registry of known acquisition systems. Each value is a dict compatible with InstrumentMeta._from_dict().

pycsamt.metadata.instrument.known_system(name)[source]#

Shortcut for InstrumentMeta.from_preset().

Parameters:

name (str) – Preset key (case-insensitive, spaces/hyphens treated as underscores).

Return type:

InstrumentMeta

Examples

>>> from pycsamt.metadata.instrument import known_system
>>> inst = known_system("phoenix_v8")
>>> inst.system
'Phoenix V8'
pycsamt.metadata.instrument.list_presets()[source]#

Return sorted list of available preset keys.

Examples

>>> from pycsamt.metadata.instrument import list_presets
>>> list_presets()
['geometrics_stratagem', 'generic_fluxgate', 'lemi_424', ...]
Return type:

list