easyclimate.filter.spectrum#
Spatio-temporal Spectrum Analysis
Functions#
|
Calculate the time spectrum of a multi-dimensional |
|
Calculate mean Fourier amplitude between specified period bounds. |
Module Contents#
- easyclimate.filter.spectrum.calc_time_spectrum(data: xarray.DataArray, time_dim: str = 'time', inv: bool = False) tuple[xarray.DataArray, xarray.DataArray] #
Calculate the time spectrum of a multi-dimensional
xarray.DataArray
along the time dimension.Parameters#
- data
xarray.DataArray
Input data with at least a time dimension.
- time_dim
str
, optional Name of the time dimension in the DataArray, by default
'time'
- inv
bool
, optional If True, use forward FFT instead of inverse, by default
False
Returns#
easyclimate.DataNode
, containing:Amplitude spectrum (same dimensions as input but with
freq
andperiod
dimension)Frequency or period values
Tip
The function automatically handles even/odd length time series and removes the zero-frequency component. The amplitude is calculated as the power spectrum (\(|\mathrm{fft}|^2\)).
- data
- easyclimate.filter.spectrum.calc_mean_fourier_amplitude(data: xarray.DataArray, time_dim: str = 'time', lower: float = None, upper: float = None) xarray.DataArray #
Calculate mean Fourier amplitude between specified period bounds.
Parameters#
- data
xarray.DataArray
Input data with at least a time dimension. Can have additional dimensions.
- time_dim
str
, optional Name of the time coordinate in the DataArray, by default
'time'
- lower
float
Lower bound of period range
- upper
float
Upper bound of period range
Returns#
xarray.DataArray
Mean amplitude within specified period range, with same dimensions as input but without time dimension.
Tip
The bounds should be in the same units as returned by
easyclimate.filter.spectrum.calc_time_spectrum
Uses
easyclimate.filter.spectrum.calc_time_spectrum
internallyThe amplitude is scaled by the variance of the input data
- data