mth5.io.phoenix.readers.receiver_metadata

Phoenix Geophysics receiver metadata parser for recmeta.json files.

Created on Tue Jun 20 15:06:08 2023

@author: jpeacock

Classes

PhoenixReceiverMetadata

Container for Phoenix Geophysics recmeta.json metadata files.

Module Contents

class mth5.io.phoenix.readers.receiver_metadata.PhoenixReceiverMetadata(fn: str | pathlib.Path | None = None, **kwargs: Any)[source]

Container for Phoenix Geophysics recmeta.json metadata files.

This class reads and parses receiver metadata from JSON configuration files used to control Phoenix Geophysics MTU-5C data recording systems. It provides methods to extract channel configurations, instrument settings, and convert them to standardized metadata objects.

Parameters:
  • fn (str, Path, or None, optional) – Path to the recmeta.json file. If provided, the file will be read automatically during initialization.

  • **kwargs – Additional keyword arguments (currently unused).

fn[source]

Path to the metadata file.

Type:

Path or None

obj[source]

Parsed JSON content as a SimpleNamespace object.

Type:

SimpleNamespace or None

logger[source]

Logger instance for error reporting.

Type:

loguru.Logger

Raises:

IOError – If the specified file does not exist.

Examples

>>> metadata = PhoenixReceiverMetadata("recmeta.json")
>>> channel_map = metadata.channel_map
>>> e1_config = metadata.e1_metadata

Notes

The class supports both electric and magnetic channel configurations with automatic mapping from Phoenix-specific parameter names to standardized metadata attributes.

property fn: pathlib.Path | None[source]

Path to the metadata file.

Returns:

Path to the recmeta.json file, or None if not set.

Return type:

Path or None

obj: types.SimpleNamespace | None = None[source]
logger[source]
property instrument_id: str | None[source]

Instrument identifier from metadata.

Returns:

Instrument ID if available, None otherwise.

Return type:

str or None

read(fn: str | pathlib.Path | None = None) None[source]

Read a recmeta.json file in Phoenix format.

Parameters:

fn (str, Path, or None, optional) – Path to the JSON file. If None, uses the current fn property.

Raises:
  • IOError – If no file path is specified or file doesn’t exist.

  • ValueError – If the file cannot be parsed as JSON.

has_obj() bool[source]

Check if metadata object is loaded.

Returns:

True if metadata object exists, False otherwise.

Return type:

bool

property channel_map: dict[int, str][source]

Channel mapping from index to component tag.

Returns:

Dictionary mapping channel indices to component tags (lowercase).

Return type:

dict[int, str]

Raises:

AttributeError – If metadata object is not loaded or missing channel_map.

property lp_filter_base_name: str | None[source]

Base name for low-pass filter identifiers.

Returns:

Filter base name combining receiver info, or None if not available.

Return type:

str or None

get_ch_index(tag: str) int[source]

Get channel index from component tag.

Parameters:

tag (str) – Component tag (e.g., ‘e1’, ‘h1’, etc.).

Returns:

Channel index corresponding to the tag.

Return type:

int

Raises:
  • ValueError – If the tag is not found in the channel map.

  • AttributeError – If metadata object is not loaded.

get_ch_tag(index: int) str[source]

Get component tag from channel index.

Parameters:

index (int) – Channel index.

Returns:

Component tag corresponding to the index.

Return type:

str

Raises:
  • ValueError – If the index is not found in the channel map.

  • AttributeError – If metadata object is not loaded.

property e1_metadata: mt_metadata.timeseries.Electric[source]

Electric channel 1 metadata.

property e2_metadata: mt_metadata.timeseries.Electric[source]

Electric channel 2 metadata.

property h1_metadata: mt_metadata.timeseries.Magnetic[source]

Magnetic channel 1 metadata.

property h2_metadata: mt_metadata.timeseries.Magnetic[source]

Magnetic channel 2 metadata.

property h3_metadata: mt_metadata.timeseries.Magnetic[source]

Magnetic channel 3 metadata.

property h4_metadata: mt_metadata.timeseries.Magnetic[source]

Magnetic channel 4 metadata.

property h5_metadata: mt_metadata.timeseries.Magnetic[source]

Magnetic channel 5 metadata.

property h6_metadata: mt_metadata.timeseries.Magnetic[source]

Magnetic channel 6 metadata.

get_ch_metadata(index: int) mt_metadata.timeseries.Electric | mt_metadata.timeseries.Magnetic[source]

Get channel metadata from index.

Parameters:

index (int) – Channel index.

Returns:

Channel metadata object corresponding to the index.

Return type:

Electric or Magnetic

Raises:
  • ValueError – If index is not found in channel map.

  • AttributeError – If the corresponding metadata property doesn’t exist.

property run_metadata: mt_metadata.timeseries.Run[source]

Run metadata from receiver configuration.

Returns:

Run metadata object with data logger and timing information.

Return type:

Run

property station_metadata: mt_metadata.timeseries.Station[source]

Station metadata from receiver configuration.

Returns:

Station metadata object with location and acquisition information.

Return type:

Station

property survey_metadata: mt_metadata.timeseries.Survey[source]

Survey metadata from receiver configuration.

Returns:

Survey metadata object with survey information.

Return type:

Survey