This function detects profiles using the pressure channel in the RSK and produces a
profiles field containing profile metadata.
The algorithm runs through the pressure data of the RSK and finds instances of a pressure reversal that is greater than
pressureThreshold or 5% of the pressure differential of the last profile (whichever is greater). If it detects a pressure reversal it goes back to find the minimum or maximum pressure since the last event and records it as the beginning of the upcast or downcast, depending on the direction of the reversal.
When a conductivity channel is available, the algorithm records the samples where the conductivity is less than
conductivityThreshold as out of the water and excludes them from the cast.
pressureThreshold of 3dbar may be too large for short profiles. Consider using one-quarter of the pressure range as a guideline,
The following example illustrates how to use RSKfindprofiles in combination with RSKreadprofiles to parse a time series of data into individual upcasts and downcasts.
If there is already a
profiles field in the RSK structure, the function will replace it with new calculated