xoa.filter.tidal_filter

Contents

xoa.filter.tidal_filter#

xoa.filter.tidal_filter(da, filter_name, na_thres=0, dt_tol=0.01)[source]#

Apply a tidal filter on a data array

The data array must have a valid time dimension. When the time step is less than an hour, the filter weights are interpolated since they are designed for hourly time series. An error is raised when the time step is too variable or above one hour.

Parameters:
  • da (xarray.DataArray) – Data array with a time dimension.

  • filter_name (str) – Type of tidal filter: "demerliac", "godin" or "mean".

  • dt_tol (float) – Relative tolerance for the time step variability.

  • na_thres (float) – A float between 0 and 1 that defines the allowed level of NaN contamination. See convolve().

Returns:

xarray.DataArray – Filtered data array with the tidal signal removed.

See also

demerliac, convolve