mt_metadata.processing.aurora.stations

Classes

Stations

Base class for all metadata objects with Pydantic validation.

Module Contents

class mt_metadata.processing.aurora.stations.Stations(**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

remote: Annotated[list[mt_metadata.processing.aurora.station.Station], Field(default_factory=list, description='list of remote sites', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['10']})]
local: Annotated[mt_metadata.processing.aurora.station.Station, Field(default_factory=Station, description='local site', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['10']})]
validate_remote(value, info)

Method for unpacking rr_station info into mt_metadata object.

Developmnent Notes: This function was raising an exception when trying to populate an aurora.Processing object from a json.loads() dict. TODO: add a description of input variable and use cases, … it seems that we may not want to support multiple rr stations yet.

Parameters:

rr_station

Return type:

list of Station objects

add_remote(rr)

add a remote station

Parameters:

rr (Station | dict) – remote station to add

property remote_dict: dict[str, mt_metadata.processing.aurora.station.Station]

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

Returns:

dictionary of remote stations

Return type:

dict[str, Station]

from_dataset_dataframe(df)

from a dataset dataframe

Parameters:

df (pd.DataFrame) – dataset dataframe to read from

Return type:

None

to_dataset_dataframe()

output a dataframe

Returns:

dataframe representation of the station

Return type:

pd.DataFrame

get_station(station_id)

get a station object from the id

Parameters:

station_id (str) – ID of the station to retrieve

Returns:

Station object corresponding to the given ID

Return type:

Station