pypam.utils.spectra_ds_to_bands¶
-
pypam.utils.
spectra_ds_to_bands
(psd, bands_limits, bands_c, fft_bin_width, db=True)[source]¶ Group the psd according to the limits band_limits given. If a limit is not aligned with the limits in the psd frequency axis then that psd frequency bin is divided in proportion to each of the adjacent bands. For more details see publication Ocean Sound Analysis Software for Making Ambient Noise Trends Accessible (MANTA) (https://doi.org/10.3389/fmars.2021.703650)
Parameters: - psd: xarray DataArray
Output of pypam spectrum function. It should not be directly the dataset
- bands_limits: list or array
Limits of the desired bands
- bands_c: list or array
Centre of the bands (used only of the output frequency axis naming)
- fft_bin_width: float
fft bin width in seconds
- db: bool
Set to True to return db instead of linear units
Returns: - xarray DataArray with frequency_bins instead of frequency as a dimension.