RSKfindprofiles.m
Arguments
Input
- Required-
RSK
-Optional-
pressureThreshold
: 3dbar (default)conductivityThreshold
: 0.05 mS/cm (default)
Output
RSK
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.
The default pressureThreshold
of 3dbar may be too large for short profiles. Consider using one-quarter of the pressure range as a guideline, (max(Pressure)-min(Pressure))*1/4
.
The following example illustrates how to use RSKfindprofiles in combination with RSKreadprofiles to parse a time series of data into individual upcasts and downcasts.
>> rsk = RSKopen('test.rsk');
>> rsk = RSKreaddata(rsk)
rsk =
dbInfo: [1x1 struct]
instrumentChannels: [5x1 struct]
channels: [5x1 struct]
epochs: [1x1 struct]
schedules: [1x1 struct]
deployments: [1x1 struct]
instruments: [1x1 struct]
appSettings: [1x1 struct]
ranging: [6x1 struct]
parameters: [1x1 struct]
data: [1x1 struct] % New field added
>> rsk = RSKfindprofiles(rsk)
rsk =
dbInfo: [1x1 struct]
instrumentChannels: [3x1 struct]
channels: [3x1 struct]
epochs: [1x1 struct]
schedules: [1x1 struct]
deployments: [1x1 struct]
instruments: [1x1 struct]
appSettings: [1x1 struct]
ranging: [3x1 struct]
parameters: [1x1 struct]
data: [1x1 struct]
profiles: [1x1 struct] % Profile metadata found
>> rsk = RSKreadprofiles(rsk)
rsk =
dbInfo: [1x1 struct]
instrumentChannels: [3x1 struct]
channels: [3x1 struct]
epochs: [1x1 struct]
schedules: [1x1 struct]
deployments: [1x1 struct]
instruments: [1x1 struct]
appSettings: [1x1 struct]
ranging: [3x1 struct]
parameters: [1x1 struct]
data: [1x41 struct] % Each element in the data field is a cast.
profiles: [1x1 struct]
If there is already a profiles
field in the RSK structure, the function will replace it with new calculated profiles
field.