mt_metadata.processing.fourier_coefficients =========================================== .. py:module:: mt_metadata.processing.fourier_coefficients Submodules ---------- .. toctree:: :maxdepth: 1 /source/api/mt_metadata/processing/fourier_coefficients/decimation/index /source/api/mt_metadata/processing/fourier_coefficients/fc/index /source/api/mt_metadata/processing/fourier_coefficients/fc_channel/index Classes ------- .. autoapisummary:: mt_metadata.processing.fourier_coefficients.Decimation mt_metadata.processing.fourier_coefficients.FC mt_metadata.processing.fourier_coefficients.FCChannel Package Contents ---------------- .. py:class:: Decimation(**data) Bases: :py:obj:`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. .. attribute:: _skip_equals Private attribute listing fields to skip in equality comparisons :type: list[str] .. attribute:: _fields Private attribute caching field information :type: dict[str, Any] .. rubric:: 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 .. py:attribute:: id :type: Annotated[str, Field(default='', description='Decimation level ID', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['1']})] .. py:attribute:: channels_estimated :type: Annotated[list[str], Field(default_factory=list, description='list of channels', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[ex, hy]']})] .. py:attribute:: time_period :type: 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()']})] .. py:attribute:: channels :type: 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]']})] .. py:attribute:: time_series_decimation :type: 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()']})] .. py:attribute:: short_time_fourier_transform :type: 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()']})] .. py:method:: validate_short_time_fourier_transform(value, info) :classmethod: .. py:method:: validate_channels_estimated(value, info) :classmethod: .. py:method:: validate_channels(value, info) :classmethod: .. py:method:: 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 .. py:method:: add(other) :param other: :return: .. py:property:: decimation :type: mt_metadata.processing.TimeSeriesDecimation Passthrough method to access self.time_series_decimation .. py:property:: stft .. py:method:: update(other, match=[]) Update attribute values from another like element, skipping None :param other: DESCRIPTION :type other: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: has_channel(component) Check to see if the channel already exists :param component: channel component to look for :type component: string :return: True if found, False if not :rtype: boolean .. py:method:: channel_index(component) get index of the channel in the channel list .. py:method:: get_channel(component) Get a channel :param component: channel component to look for :type component: string :return: FCChannel object based on channel type :rtype: :class:`mt_metadata.timeseries.Channel` .. py:method:: add_channel(channel_obj) Add a channel to the list, check if one exists if it does overwrite it :param channel_obj: channel object to add :type channel_obj: :class:`mt_metadata.transfer_functions.processing.fourier_coefficients.Channel` .. py:method:: remove_channel(channel_id) remove a channel from the survey :param component: channel component to look for :type component: string .. py:property:: n_channels .. py:method:: update_time_period() update time period from ch information .. py:method:: 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. .. py:property:: fft_frequencies :type: numpy.ndarray Returns the one-sided fft frequencies (without Nyquist) .. py:class:: FC(**data) Bases: :py:obj:`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. .. attribute:: _skip_equals Private attribute listing fields to skip in equality comparisons :type: list[str] .. attribute:: _fields Private attribute caching field information :type: dict[str, Any] .. rubric:: 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 .. py:attribute:: decimation_levels :type: 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]']})] .. py:attribute:: id :type: Annotated[str, Field(default='', description='ID given to the FC group', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['aurora_01']})] .. py:attribute:: channels_estimated :type: Annotated[list[str], Field(default_factory=list, description='list of channels estimated', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': [['ex', 'hy']]})] .. py:attribute:: starting_sample_rate :type: 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]})] .. py:attribute:: method :type: Annotated[MethodEnum, Field(default=MethodEnum.fft, description='Fourier transform method', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['fft']})] .. py:attribute:: time_period :type: 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')]})] .. py:attribute:: levels :type: 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']})] .. py:method:: validate_channels_estimated(value, info) :classmethod: .. py:method:: validate_levels(value, info) :classmethod: .. py:method:: 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 .. py:method:: has_decimation_level(level) Check to see if the decimation_level already exists :param level: decimation_level level to look for :type level: string :return: True if found, False if not :rtype: boolean .. py:method:: decimation_level_index(level) get index of the decimation_level in the decimation_level list .. py:method:: get_decimation_level(level) Get a decimation_level :param level: decimation_level level to look for :type level: string :return: decimation_level object based on decimation_level type :rtype: :class:`mt_metadata.timeseries.decimation_level` .. py:method:: add_decimation_level(fc_decimation) Add a decimation_level to the list, check if one exists if it does overwrite it :param fc_decimation: decimation level object to add :type fc_decimation: :class:`mt_metadata.processing.fourier_coefficients.decimation_basemodel.Decimation` .. py:method:: remove_decimation_level(decimation_level_id) remove a ch from the survey :param level: decimation_level level to look for :type level: string .. py:property:: n_decimation_levels .. py:method:: update_time_period() update time period from ch information .. py:class:: FCChannel(**data) Bases: :py:obj:`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. .. attribute:: _skip_equals Private attribute listing fields to skip in equality comparisons :type: list[str] .. attribute:: _fields Private attribute caching field information :type: dict[str, Any] .. rubric:: 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 .. py:attribute:: component :type: Annotated[str, Field(default='', description='Name of channel', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['ex']})] .. py:attribute:: frequency_max :type: 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]})] .. py:attribute:: frequency_min :type: 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]})] .. py:attribute:: sample_rate_decimation_level :type: 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]})] .. py:attribute:: sample_rate_window_step :type: 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]})] .. py:attribute:: units :type: Annotated[str, Field(default='counts', description='Units of the channel', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['millivolts']})] .. py:attribute:: time_period :type: 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')]})] .. py:method:: validate_units(value) :classmethod: