mt_metadata.processing.fourier_coefficients
Submodules
Classes
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
Package Contents
- class mt_metadata.processing.fourier_coefficients.Decimation(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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='Decimation level ID', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['1']})]
- channels_estimated: Annotated[list[str], Field(default_factory=list, description='list of channels', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[ex, hy]']})]
- time_period: Annotated[mt_metadata.common.TimePeriod, Field(default_factory=TimePeriod, description='Time period over which these FCs were estimated', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['TimePeriod()']})]
- channels: Annotated[mt_metadata.common.ListDict, Field(default_factory=ListDict, description='List of channels', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[ex, hy]']})]
- time_series_decimation: Annotated[mt_metadata.processing.TimeSeriesDecimation, Field(default_factory=TimeSeriesDecimation, description='Time series decimation settings', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['TimeSeriesDecimation()']})]
- short_time_fourier_transform: Annotated[mt_metadata.processing.ShortTimeFourierTransform, Field(default_factory=ShortTimeFourierTransform, description='Short time Fourier transform settings', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['ShortTimeFourierTransform()']})]
- classmethod validate_short_time_fourier_transform(value, info)
- classmethod validate_channels_estimated(value, info)
- classmethod validate_channels(value, info)
- validate_channels_consistency()
Ensure that channels_estimated and channels are synchronized.
If a channel name exists in channels_estimated but not in channels, create a new FCChannel with that component name
Ensure all channels in channels ListDict have their component names in channels_estimated
- add(other)
- Parameters:
other
- Returns:
- property decimation: mt_metadata.processing.TimeSeriesDecimation
Passthrough method to access self.time_series_decimation
- property stft
- update(other, match=[])
Update attribute values from another like element, skipping None
- Parameters:
other (TYPE) – DESCRIPTION
- Returns:
DESCRIPTION
- Return type:
TYPE
- has_channel(component)
Check to see if the channel already exists
- Parameters:
component (string) – channel component to look for
- Returns:
True if found, False if not
- Return type:
boolean
- channel_index(component)
get index of the channel in the channel list
- get_channel(component)
Get a channel
- Parameters:
component (string) – channel component to look for
- Returns:
FCChannel object based on channel type
- Return type:
- add_channel(channel_obj)
Add a channel to the list, check if one exists if it does overwrite it
- Parameters:
channel_obj (
mt_metadata.transfer_functions.processing.fourier_coefficients.Channel) – channel object to add
- remove_channel(channel_id)
remove a channel from the survey
- Parameters:
component (string) – channel component to look for
- property n_channels
- update_time_period()
update time period from ch information
- is_valid_for_time_series_length(n_samples_ts)
Given a time series of len n_samples_ts, checks if there are sufficient samples to STFT.
- property fft_frequencies: numpy.ndarray
Returns the one-sided fft frequencies (without Nyquist)
- class mt_metadata.processing.fourier_coefficients.FC(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- decimation_levels: Annotated[list[str], Field(default_factory=list, description='List of decimation levels', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[1, 2, 3]']})]
- id: Annotated[str, Field(default='', description='ID given to the FC group', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['aurora_01']})]
- channels_estimated: Annotated[list[str], Field(default_factory=list, description='list of channels estimated', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': [['ex', 'hy']]})]
- starting_sample_rate: Annotated[float, Field(default=1.0, description='Starting sample rate of the time series used to estimate FCs.', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': [60]})]
- method: Annotated[MethodEnum, Field(default=MethodEnum.fft, description='Fourier transform method', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['fft']})]
- time_period: Annotated[mt_metadata.common.TimePeriod, Field(default_factory=TimePeriod, description='Time period of the FCs', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': [TimePeriod(start='2020-01-01', end='2020-01-02')]})]
- levels: Annotated[mt_metadata.common.ListDict, Field(default_factory=ListDict, description='ListDict of decimation levels and their parameters', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['ListDict containing Decimation objects']})]
- classmethod validate_channels_estimated(value, info)
- classmethod validate_levels(value, info)
- synchronize_levels()
Ensure that decimation_levels and levels are synchronized. - Creates Decimation objects for any levels in decimation_levels that don’t exist in levels - Adds level names to decimation_levels for any existing levels not in the list
- has_decimation_level(level)
Check to see if the decimation_level already exists
- Parameters:
level (string) – decimation_level level to look for
- Returns:
True if found, False if not
- Return type:
boolean
- decimation_level_index(level)
get index of the decimation_level in the decimation_level list
- get_decimation_level(level)
Get a decimation_level
- Parameters:
level (string) – decimation_level level to look for
- Returns:
decimation_level object based on decimation_level type
- Return type:
mt_metadata.timeseries.decimation_level
- add_decimation_level(fc_decimation)
Add a decimation_level to the list, check if one exists if it does overwrite it
- Parameters:
fc_decimation (
mt_metadata.processing.fourier_coefficients.decimation_basemodel.Decimation) – decimation level object to add
- remove_decimation_level(decimation_level_id)
remove a ch from the survey
- Parameters:
level (string) – decimation_level level to look for
- property n_decimation_levels
- update_time_period()
update time period from ch information
- class mt_metadata.processing.fourier_coefficients.FCChannel(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- component: Annotated[str, Field(default='', description='Name of channel', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['ex']})]
- frequency_max: Annotated[float, Field(default=0.0, description='Highest frequency present in the sprectrogam data.', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': [77.0]})]
- frequency_min: Annotated[float, Field(default=0.0, description='Lowest frequency present in the sprectrogam data.', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': [99.0]})]
- sample_rate_decimation_level: Annotated[float, Field(default=1.0, description='Sample rate of the time series that was Fourier transformed to generate the FC decimation level.', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': [60]})]
- sample_rate_window_step: Annotated[float, Field(default=1.0, description='Sample rate of the windows.', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': [4]})]
- units: Annotated[str, Field(default='counts', description='Units of the channel', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['millivolts']})]
- time_period: Annotated[mt_metadata.common.TimePeriod, Field(default_factory=TimePeriod, description='Time period of the channel', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': [TimePeriod(start='2020-01-01', end='2020-01-02')]})]
- classmethod validate_units(value)