mt_metadata.processing.aurora.frequency_bands ============================================= .. py:module:: mt_metadata.processing.aurora.frequency_bands .. autoapi-nested-parse:: Module containing FrequencyBands class representing a collection of Frequency Band objects. Classes ------- .. autoapisummary:: mt_metadata.processing.aurora.frequency_bands.FrequencyBands Module Contents --------------- .. py:class:: FrequencyBands(band_edges = None) Collection of Band objects, typically used at a single decimation level. .. attribute:: _band_edges DataFrame with columns ['lower_bound', 'upper_bound'] containing frequency band boundaries :type: pd.DataFrame .. py:property:: band_edges :type: pandas.DataFrame Get band edges as a DataFrame .. py:property:: number_of_bands :type: int Number of frequency bands .. py:property:: array :type: numpy.ndarray Get band edges as numpy array .. py:method:: sort(by = 'center_frequency', ascending = True) Sort bands by specified criterion. :param by: Criterion to sort by: - "lower_bound": Sort by lower frequency bound - "upper_bound": Sort by upper frequency bound - "center_frequency": Sort by geometric center frequency (default) :type by: str :param ascending: If True, sort in ascending order, else descending :type ascending: bool .. py:method:: bands(direction = 'increasing_frequency', sortby = None, rtype = 'list') Generate Band objects in specified order. :param direction: Order of iteration: "increasing_frequency" or "increasing_period" :type direction: str :param sortby: Sort bands before iteration: - "lower_bound": Sort by lower frequency bound - "upper_bound": Sort by upper frequency bound - "center_frequency": Sort by geometric center frequency If None, uses existing order :type sortby: str, optional :param rtype: Return type: "list" or "generator". Default is "list" for easier reuse. Use "generator" for memory efficiency when bands are only iterated once. :type rtype: str :returns: Band objects for each frequency band, either as a list or generator depending on rtype parameter. :rtype: Union[List[Band], Generator[Band, None, None]] .. py:method:: band(i_band) Get specific frequency band. :param i_band: Index of band to return (zero-based) :type i_band: int :returns: Frequency band object :rtype: Band .. py:method:: band_centers(frequency_or_period = 'frequency') Calculate center frequencies/periods for all bands. :param frequency_or_period: Return values in "frequency" (Hz) or "period" (s) :type frequency_or_period: str :returns: Center frequencies/periods for each band :rtype: np.ndarray .. py:method:: validate() Validate and potentially reorder bands based on center frequencies.