mt_metadata.processing.aurora.station

Classes

Station

Base class for all metadata objects with Pydantic validation.

Module Contents

class mt_metadata.processing.aurora.station.Station(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

id: Annotated[str, Field(default='', description='Station ID', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['mt001']})]
mth5_path: Annotated[str | pathlib.Path, Field(default='', description='full path to MTH5 file where the station data is contained', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['/home/mt/experiment_01.h5']})]
remote: Annotated[bool, Field(default=False, description='remote station (True) or local station (False)', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['False']})]
runs: Annotated[list[mt_metadata.processing.aurora.run.Run], Field(default_factory=list, description='List of runs to process', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['001']})]
classmethod validate_mth5_path(value, info)
classmethod validate_runs(values, info)
get_run(run_id)

Get a run by ID

Parameters:

run_id (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

Run | None

property run_list: list[str]

list of run names

property run_dict: dict[str, mt_metadata.processing.aurora.run.Run]

need to have a dictionary, but it can’t be an attribute cause that gets confusing when reading in a json file

Returns:

DESCRIPTION

Return type:

dict[str, Run]

to_dataset_dataframe()

Create a dataset definition dataframe that can be used in the processing

[

“station”, “run”, “start”, “end”, “mth5_path”, “sample_rate”, “input_channels”, “output_channels”, “remote”,

]

from_dataset_dataframe(df)

set a data frame

[

“station”, “run”, “start”, “end”, “mth5_path”, “sample_rate”, “input_channels”, “output_channels”, “remote”,

]

Parameters:

df (pd.DataFrame) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE