xscale.signal.fitting.sinfit¶
-
xscale.signal.fitting.sinfit(array, periods, dim=None, coord=None, unit='s')¶ Least squares sinusoidal fit. Fit sinusoidal functions
y = A[p] * sin(2 * pi * ax * f[1] + phi[1])Parameters: - array : xarray.DataArray
Data to be fitted
- periods: float or list of float
The periods of the sinusoidal functions to be fitted
- dim : str, optional
The dimension along which the data will be fitted. If not precised, the first dimension will be used
- unit : {‘D’, ‘h’, ‘m’, ‘s’, ‘ms’, ‘us’, ‘ns’}, optional
If the fit uses a datetime dimension, the unit of the period may be specified here.
Returns: - modes : Dataset
A Dataset with the amplitude and the phase for each periods