mt_metadata.features.fc_coherence ================================= .. py:module:: mt_metadata.features.fc_coherence Classes ------- .. autoapisummary:: mt_metadata.features.fc_coherence.BandDefinitionTypeEnum mt_metadata.features.fc_coherence.QRadiusEnum mt_metadata.features.fc_coherence.FCCoherence Module Contents --------------- .. py:class:: BandDefinitionTypeEnum Bases: :py:obj:`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'. .. py:attribute:: Q :value: 'Q' .. py:attribute:: fractional_bandwidth :value: 'fractional bandwidth' .. py:attribute:: user_defined :value: 'user defined' .. py:class:: QRadiusEnum Bases: :py:obj:`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'. .. py:attribute:: constant_Q :value: 'constant Q' .. py:attribute:: user_defined :value: 'user defined' .. py:class:: FCCoherence(**data) Bases: :py:obj:`mt_metadata.features.coherence.Coherence`, :py:obj:`mt_metadata.features.feature.Feature` 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:: minimum_fcs :type: Annotated[int, Field(default=2, description='The minimum number of Fourier coefficients needed to compute the feature.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['2']})] .. py:attribute:: band_definition_type :type: Annotated[BandDefinitionTypeEnum, Field(default='Q', description='How the feature frequency bands are defined.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['user defined']})] .. py:attribute:: q_radius :type: Annotated[QRadiusEnum, Field(default='constant Q', description='How the feature frequency bands are defined.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['user defined']})] .. py:method:: set_defaults(data) :classmethod: .. py:property:: channel_pair_str :type: str .. py:method:: compute(fc1, fc2) Compute magnitude-squared coherence from FCs. :param fc1: Fourier coefficients for channel 1, shape (n_windows, n_freqs) :type fc1: np.ndarray :param fc2: Fourier coefficients for channel 2, shape (n_windows, n_freqs) :type fc2: np.ndarray :returns: * **freqs** (*np.ndarray*) -- Frequency axis (if available, else None) * **coherence** (*np.ndarray*) -- Magnitude-squared coherence, shape (n_freqs,)