RSKreadprofiles.m

Arguments

Input

-Required- 

  • RSK 

-Optional-

  • profile : [ ] (all profiles, default).
  • direction : down, up or both.

Output

  • RSK

This function retrieves data from the rsk file and segmented into casts and stores it in the data field. This function requires an RSK structure that contains a profiles field with profiling metadata.

The data field elements are segmented based on the metadata in the profiles field; this field is organized by upcast and downcast. Each cast direction contains vectors, tstart and tend, which are the start time and end time of each profile.

From v2.2.0, the segmented data field also adds rsk.data.direction and rsk.data.profilenumber field to indicate cast direction and profile sequence.

If the direction argument is up or down, the data field contains an element with all the samples between each set of tstart to tend in the upcast or downcast field.

When direction = both, the data field elements are populated in chronological order from tstart to tend from both upcast and downcast, with the data elements alternating between downcasts and upcasts.

This function also adds an order field which describes the cast direction order and originalindex field which links between the metadata index in the profiles field and data field element.

Profiles structure Copy Copy

If you select the first five profiles ( profile = 1:5) of upcasts, it will use the first five sets of tstart and tend from the RSK.profiles.upcast entries, as shown below.

>> rsk = RSKopen('file.rsk');
>> datestr(rsk.profiles.upcast.tstart(1:5))
ans =
02-Jan-2000 18:27:12
02-Jan-2000 18:35:05
02-Jan-2000 18:42:31
02-Jan-2000 18:49:00
02-Jan-2000 18:54:33
>> datestr(rsk.profiles.upcast.tend(1:5))
ans =
02-Jan-2000 18:33:18
02-Jan-2000 18:41:17
02-Jan-2000 18:42:57
02-Jan-2000 18:53:16
02-Jan-2000 18:59:16
>> rsk = RSKreadprofiles(rsk, 'profile', [1:5], 'direction', 'up')
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]
            regionCast: [28x1 struct]
                region: [42x1 struct]
              profiles: [1x1 struct]
                  data: [1x5 struct]

If users prefer to split time series data in existing Matlab rsk structure into profiles, instead of directly reading profiles from the disk. RSKtimeseries2profiles is recommended.