mt_metadata.processing.aurora.processing

Classes

BandSpecificationStyleEnum

str(object='') -> str

Processing

Base class for all metadata objects with Pydantic validation.

Module Contents

class mt_metadata.processing.aurora.processing.BandSpecificationStyleEnum

Bases: mt_metadata.common.enumerations.StrEnumerationBase

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

EMTF = 'EMTF'
band_edges = 'band_edges'
class mt_metadata.processing.aurora.processing.Processing(**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

decimations: Annotated[list[mt_metadata.processing.aurora.decimation_level.DecimationLevel], Field(default_factory=list, description='decimation levels', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['0']})]
band_specification_style: Annotated[BandSpecificationStyleEnum | None, Field(default=None, description='describes how bands were sourced', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['EMTF']})]
band_setup_file: Annotated[str | None, Field(default=None, description='the band setup file used to define bands', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['/home/user/bs_test.cfg']})]
id: Annotated[str, Field(default='', description='Configuration ID', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['0']})]
channel_nomenclature: Annotated[mt_metadata.processing.aurora.channel_nomenclature.ChannelNomenclature, Field(default_factory=ChannelNomenclature, description='Channel nomenclature', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['EMTF']})]
stations: Annotated[mt_metadata.processing.aurora.stations.Stations, Field(default_factory=Stations, description='Station information', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['Station1', 'Station2']})]
classmethod validate_decimations(value, info)
property decimations_dict: dict[int, mt_metadata.processing.aurora.decimation_level.DecimationLevel]

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

Returns:

A dictionary mapping decimation levels to their corresponding DecimationLevel objects.

Return type:

dict[int, DecimationLevel]

get_decimation_level(level)

Get a decimation level for easy access

Parameters:

level (int) – The decimation level to retrieve.

Returns:

The DecimationLevel object corresponding to the specified level.

Return type:

DecimationLevel

add_decimation_level(decimation_level)

add a decimation level

Parameters:

decimation_level (DecimationLevel | dict) – The decimation level to add, either as a DecimationLevel object or a dictionary.

Return type:

None

property band_edges_dict: dict[int, list[tuple[float, float]]]
assign_decimation_level_data_emtf(sample_rate)

Warning: This does not actually tell us how many samples we are decimating down at each level. That is assumed to be 4 but we need a way to bookkeep this in general

Parameters:

sample_rate (float) – The initial sampling rate of the data before any decimation

assign_bands(band_edges_dict, sample_rate, decimation_factors, num_samples_window=256)

Warning: This does not actually tell us how many samples we are decimating down at each level. That is assumed to be 4 but we need a way to bookkeep this in general

Parameters:
  • band_edges (dict[int, list[tuple[float, float]]]) – A dictionary mapping decimation levels to lists of frequency band edges. keys are integers, starting with 0, values are arrays of edges

  • sample_rate (float) – The initial sampling rate of the data before any decimation.

  • decimation_factors (dict[int, int]) – A dictionary mapping decimation levels to their corresponding decimation factors.

  • num_samples_window (dict[int, int] | int, optional (default=256)) – The number of samples in the STFT window for each decimation level. If an integer is provided, it will be applied to all levels. If a dictionary is provided, it should map decimation levels to their corresponding number of samples.

Return type:

None

json_fn()
property num_decimation_levels
drop_reference_channels()
set_input_channels(channels)
set_output_channels(channels)
set_reference_channels(channels)
set_default_input_output_channels()
set_default_reference_channels()
validate_processing(kernel_dataset)

Placeholder. Some of the checks and methods here maybe better placed in TFKernel, which would validate the dataset against the processing config.

Things that are validated: 1. The default estimation engine from the json file is “RME_RR”, which is fine ( we expect to in general to do more RR processing than SS) but if there is only one station (no remote)then the RME_RR should be replaced by default with “RME”.

  1. make sure local station id is defined (correctly from kernel dataset)