ctdproc.proc.despike

ctdproc.proc.despike(da, spike_threshold)[source]

Set spikes to NaN where the absolute first difference exceeds a threshold.

Parameters:
  • da (xarray.DataArray) – Input data. Modified in place.

  • spike_threshold (float) – Maximum absolute difference between consecutive samples; samples whose preceding difference exceeds this value are set to NaN.

Returns:

da – The input data with spikes replaced by NaN.

Return type:

xarray.DataArray