RSKcorrecthold.m

Arguments

Input

 -Required-

  • RSK

-Optional-

  • channel : 'all' (all channels default).
  • profile : [ ] (all profiles default).
  • direction : up, down or both (default).
  • action : nan (default) or interp.
  • visualize: show plot with original, processed and flagged data on specified profile(s)

Output

  • RSK
  • holdpts : hold point indices

The analog-to-digital (A2D) converter on RBR instruments must recalibrate periodically. In the time it takes for the calibration to finish, one or more samples are missed. The onboard firmware fills the missed sample with the same data measured during the previous sample, a simple technique called a zero-order hold.

The function identifies zero-hold points by looking for where consecutive differences for each channel are equal to zero, and replaces them with an interpolated value or a NaN.

An example of where zero-order holds are important is when computing the vertical profiling rate from pressure. Zero-order hold points produce spikes in the profiling rate at regular intervals, which can cause the points to be flagged by RSKremoveloops.

Example:

[rsk, holdpts] = RSKcorrecthold(rsk)


The green squares indicate the original data.
The red crossings are the interpolated data after correcting zero-order holds.