RAPID heritage

oceanarray grew out of the processing for the RAPID-MOC array at 26°N, done in MATLAB and stored in the RODB text format. This page keeps that background in one place: how the instruments are downloaded, the RODB format, the MATLAB scripts the stages replace, and how RAPID joined deployments and sites. None of it is needed to run oceanarray.

Downloading MicroCATs at sea

Sea-Bird SBE37 MicroCATs are downloaded with SeaTerm (older firmware) or SeaTermV2. The older SeaTerm misses a line every 220 lines on the 6000-series instruments, so use SeaTermV2 for those.

Legacy Firmware (pre-3.0d) ~~~~~~~~~~~~~~~~~~~~~~~~^^

For most instruments with serial numbers below 6000, use SeaTerm:

  1. Connect the instrument and launch SeaTerm.

  2. Under Configure, select SBE37.

  3. Choose the correct COM port and set baud rate to 9600.

  4. On the Upload Settings tab, check Upload all data into a single file.

  5. On the Header Information tab, ensure Prompt for Header Information is checked.

  6. Open a capture file (e.g., 5768_recovery.log).

  7. Press Return or click Connect—you should see:

    SBE 37-M
    S>
    

    (Press return repeatedly if needed.)

  8. Type Stop to halt logging. Record the time (UTC).

  9. Type DS and note the clock drift from UTC.

  10. Record the “Sample Number” (number of samples taken).

  11. Stop the capture file.

  12. Click Upload.

  13. When prompted, enter ship, cruise, and mooring details.

  14. Add additional comments (e.g., instrument fouling, damage).

  15. Save the file (e.g., 5768_data.asc or 5768_cal_dip_data.asc).

  16. Confirm upload completion and check contents of .asc file.

Modern Firmware (3.0d and above) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

For instruments with serial numbers >6000 or upgraded units, use SeaTermV2:

  1. Connect instrument and launch SeaTermV2 (not regular SeaTerm).

  2. Under Configure, choose SBE37 → SBE 37 RS232.

  3. If auto-connect fails, manually configure baud rate (usually 9600 or 38400).

  4. Once connected, open a capture file (e.g., 6338_recovery.log).

  5. Send DS to check clock drift relative to UTC.

  6. Send Stop to halt logging and note the UTC timestamp.

  7. (Optional) To increase transfer speed, type baudrate=38400.

  8. Switch baud rate in software and re-send the command to confirm.

  9. Turn off the capture file once response is complete.

  10. Click Upload, enter filename (e.g., 6338_data.xml).

  11. In the upload dialog: - Check Text Upload - For mooring data, choose upload as a single file - For cal dips, select by scan number range

  12. Click Start to upload data.

  13. After upload, go to Tools → Convert .XML Data File.

  14. Select the XML file and confirm output directory.

  15. Under Output Optional Variables, check Date and Time.

  16. Select Seconds since Jan 1, 2000.

  17. Click OK. This produces a .CNV file ready for use in the Stage 1 conversion routines.

Reference: Cunningham, S.A. (2010) RRS Discovery Cruise D344, 21 Oct-18 Nov 2009. RAPID Mooring Cruise Report. Southampton, UK, National Oceanography Centre Southampton, 225pp. (National Oceanography Centre Southampton Cruise Report 51) https://nora.nerc.ac.uk/id/eprint/263915/1/nocscr051.pdf

The RODB format (stage 1)

This standardisation step evolved from the RAPID programme’s RODB format, which provided a similar function for historical mooring data. An example of the original RODB format structure:

Mooring              = wb2_16_2020
SerialNumber         = 5768
WaterDepth           = 3916
InstrDepth           = 1700
Start_Date           = 2021/01/05
Start_Time           = 20:00
End_Date             = 2023/02/25
End_Time             = 17:00
Latitude             = 26 31.000 N
Longitude            = 076 44.460 W
Columns              = YY:MM:DD:HH:T:C:P
2021   01   05   20.00056   3.9239   33.2233  1726.4
2021   01   05   21.00056   3.9389   33.2389  1725.4
2021   01   05   22.00056   3.9389   33.2405  1725.3

Stage 1 replaces the MATLAB conversion to RODB:

This script performed similar functions to the current Python implementation:

Excerpt from microcat2rodb_3.m
 1% function microcat2rodb_3('infile','outfile','infofile',fidlog,[graphics],[toffset])
 2%
 3% reads ACSII output from SBE-37 MicroCAT and converts
 4% writes it to RODB file 
 5% So far the input format contain (temp,cond,day,month,year,time)  
 6% or .cnv format (temp,cond,press,seconds,data_flag)
 7% where seconds is seconds since Jan 1st 2000.
 8%
 9% input: 
10%   outfile  : path and name of RODB outputfile
11%   infile   : path and name of MicroCAT ASCII input file
12%   infofile : path and name of mooring info.dat file  
13%   fidlog   : file identifier for log file
14%   graphics : 'y' = display some graphics (mooring)
15%              'w' = display some graphics with whole range (rosette)
16%   toffset  : offset of recorded instrument time rel to GMT (decimal days),
17%              if omitted, default toffset = 0 is set 
18%
19%  uses: microcat_month2.m, hms2h.m  (all by T.Kanzow), rodbsave.m
20%
21% kanzow   26.12.2000 Xmas edition
22%          28.03.2001 pressure option added 
23%          20.04.2005 CSIRO seawater routine for computation of salinity 
24%          24.04.2005 recorded time checked against mooring deployment time 
25%          25.04.2005 input variable 'toffset' added
26%          27/10/09 - DR added functionality for .cnv format files for
27%             microcat firmware 3.0 and above. and created microcat2rodb_3
28%             from microcat2rodb_2_002
29%          03.04.2010 - ZBS changed the method for setting 'ylim'
30%             for graphics=='y' to use prctile.
31%
32function microcat2rodb_3(infile,outfile,infofile,fidlog,graphics,toffset)
33
34if nargin < 4
35  disp('not enough input arguments')
36elseif nargin == 4
37  graphics = 'n'
38  disp('graphics will not be  displayed')
39end

Trimming (stage 2)

Stage 2 replaces the RAPID trimming script:

Excerpt from microcat_raw2use_003.m
 1clear
 2% basic preprocessing for microcat data
 3%   
 4% features
 5%      1. eliminate lauching and recovery period
 6%      2. save data to rodb file
 7%      3. create data overview sheet
 8%
 9% uses timeaxis.m, auto_filt.m, julian.m 
10
11% 11.01.01 Kanzow 
12% 13.08.02 Kanzow : debugged
13%
14%      
15  
16% --- get mooring information from infofile 
17
18
19moor          = 'ebm1_2_200736';    % Mooring name
20
21operator      = 'wallace';
22
23plot_interval = [2007 11 07 0;   % start time of time axis on plot
24		 2008 11 20 0];  % end time of time axis on plot
25
26mc_id    = [333 337] ;         % microcat id
27
28%-- path
29
30% -- set path for data input and output
31
32% inpath  = ['/data/rapid/cd170/moorings/',moor,'/microcat/'];
33% outpath = ['/data/rapid/cd170/moorings/',moor,'/microcat/'];
34% infofile =['/data/rapid/cd170/moorings/',moor,'/',moor,'info.dat'];
35
36inpath  = ['~/Data/rpdmoc/rapid/data/moor/proc/',moor,'/microcat/']; % C Wallace changed paths for cruise d334
37outpath  = ['~/Data/rpdmoc/rapid/data/moor/proc/',moor,'/microcat/'];
38infofile = ['~/Data/rpdmoc/rapid/data/moor/proc/',moor,'/',moor,'info.dat'];

Joining deployments in time

The RAPID MATLAB route gridded each deployment first and then interpolated the segments onto one time grid, filling short gaps between deployments. oceanarray joins the stacks instead and fills nothing.

This step combines multiple mooring deployments at the same site (e.g., WB1, WB2) into a single continuous time series on a regular time-pressure grid.

Purpose

  • Interpolate individual deployment periods onto a common pressure grid (e.g., every 20 dbar from 0–4820 dbar).

  • Construct a consistent time axis (e.g., half-daily jg from April 1, 2004 to October 11, 2015).

  • Interpolate all segments onto this unified time grid, filling short gaps between deployments.

  • Output gridded .mat files for later use in AMOC transport code.

Process overview

  1. Define a global pressure grid PG for all moorings.

  2. Load gridded temperature and salinity profiles from each deployment, e.g.:

    • wb1_2_200527_grid.mat

    • wb1_3_200607_grid.mat

    • …

  3. Interpolate each deployment’s TGfs (temperature) and SGfs (salinity) to the common pressure grid PG.

  4. Collect and concatenate the corresponding jd (Julian day) values for each deployment.

  5. Linearly interpolate all values onto the global time grid jg.

  6. Save the final combined profiles for each mooring site (e.g., TG_wb1, SG_wb1, etc.) along with metadata like location and pressure grid.

Notes

  • This process assumes that all individual deployment files have already been vertically interpolated (i.e., gridded in pressure).

  • The output is suitable for subsequent merging across mooring sites and dynamic height calculation.

  • Time interpolation smooths over deployment transitions and data gaps.

Original Source ^^^^^^^^^^^^^^~

Adapted from MATLAB routines by Kanzow (2005) and later modified.

The MATLAB script mooring_interp_wb2_3_5.m from the RAPID processing workflow interpolates individual deployments together in time using matlab’s interp1 function. It combines multiple mooring deployments at the same site (e.g., WB2) into a single continuous time series on a regular time-pressure grid. Note that filenaming within the RAPID project has changed several times without changing the core functionality, but the legacy code provided here may not be consistent with the current RAPID processing.

Excerpt from mooring_interp_wb2_3_5.m
 1%%  Code to interpolate the mooring data together prior to loading into the
 2%%  MOC code
 3%
 4%
 5%  Interpolates the temperature and salinity gridded data produced by Julie
 6%  Collins onto a common time and pressure grid at each of the principal
 7%  locations.   The anomaly plots at the end are to check for obvious
 8%  errors in the data processing.
 9%
10%  The output file is saved in the amoc/grdat/ directory for use by the MOC
11%  code.
12%
13%  This code WILL need to be edited for every update of the time series and
14%  the time stamp, jg, is a key variable, that will be an input to set the
15%  length of the time series.
16%
17%
18% adapted from an original code by Kanzow 2005
19
20% Code History
21% -------------------
22% v2 - removed the separate pressure grid for WB2 and standardised to the
23% normal grid PG
24%
25% just mochab, mochae, wb2
26
27clear all
28close all
29clc
30
31warning off
32
33basedir = '/noc/mpoc/';
34datadir = [basedir '/rpdmoc/rapid/data/amoc/grout/OCT_2012/annual/'];
35% basedir = '/Volumes/';
36nowrite = 1;
37
38jlim        = julian([[2004,4,1,0];[2012,11,18,0]]);
39jg          = jlim(1):.5:jlim(end);

Merging sites into a boundary profile

Not implemented in oceanarray.

This step combines data from multiple mooring sites near an ocean boundary (east or west) to generate a unified, gridded profile over time and depth, along the continental slope. It is a crucial part of the RAPID-WB assembly process, ensuring that discontinuous deployments and separate instrument records from neighboring locations (e.g., WB2, WB3, WB4) are stitched into a consistent time–depth matrix.

Rationale

In mooring arrays like RAPID, instruments are deployed and recovered at multiple sites “crawling” up a sloping sidewall. To estimate transbasin transport, instruments from different zonal locations are merged together to provide a “boundary” profile of dynamic height for the overturning calculation.

For example, in RAPID, the waterdepth at the WB2 mooring site is approximately 3800 dbar. Data from WB2 are combined with WB3 (a mooring 25km to the east) and, when available, the WBH2 mooring between them.

Input

  • Gridded mooring datasets from each site (e.g., wb1_8_201113_grid.mat, wb2_7_200907_grid.mat).

  • Pressure grid: typically PG = [0, 20, …, 4820] dbar.

  • Time axis: regular Julian day array, e.g., jg = 1-Apr-2004 to 11-Oct-2015 in 0.5-day steps.

Steps

  1. Load gridded site data: Load the filtered instrument data from each mooring location and extract variables: - jd: time vector - Tfs, Sfs, Pfs: filtered temperature, salinity, and pressure records, and rename them for each deployment as e.g. Tfs1, Tfs2, etc.

  2. Interpolate to common time grid: Multiple deployments are stacked together (e.g., Tfs = [Tfs1;Tfs2;Tfs3a;Tfs3b;Tfs4;Tfs5;Tfs6a;Tfs6b;Tfs7;Tfs8;Tfs9]) and then sorted vertically for each time.

% all the matrices for the deployments stacked together
Pfs     = [Pfs1;Pfs2;Pfs3a;Pfs3b;Pfs4;Pfs5;Pfs6a;Pfs6b;Pfs7;Pfs8;Pfs9];
Sfs     = [Sfs1;Sfs2;Sfs3a;Sfs3b;Sfs4;Sfs5;Sfs6a;Sfs6b;Sfs7;Sfs8;Sfs9];
Tfs     = [Tfs1;Tfs2;Tfs3a;Tfs3b;Tfs4;Tfs5;Tfs6a;Tfs6b;Tfs7;Tfs8;Tfs9];

% order the matrices at every time step to avoid too many NaNs creeping in
% 2004 removed....
P_sort = NaN .* ones(size(Pfs)); T_sort = NaN .* ones(size(Tfs)); S_sort = NaN .* ones(size(Sfs));
j = 1;
for ii = 1: length(JG)
   [P_variable, ix] = sort(Pfs(:, ii));
   P_sort(:,j) = Pfs(ix,ii);
   T_sort(:,j) = Tfs(ix,ii);
   S_sort(:,j) = Sfs(ix,ii);
   j = j + 1;
end
% removing unused rows of the sorted matrices
i = 1; j = 1;
for i = 1: length(P_sort(:,1))
   ix = find(isnan(P_sort(i,:)));
   if size(ix) < length(JG)
      Pfss(j,:) = P_sort(i, :);
      Tfss(j,:) = T_sort(i, :);
      Sfss(j,:) = S_sort(i, :);
      j = j + 1;
   end
end
  1. Regrid vertically: Since we now have moorings ending at different depths and from different moorings, they need to be vertically gridded over possible gaps. This re-applies the method from Grid: pressure levels to concatenate all year-specific fragments into a single time–depth matrix and re-interpolate:

    TG_wb2 = interp1([jg_y1 jg_y2 ...], [TG_y1 TG_y2 ...], jg);
    SG_wb2 = interp1([jg_y1 jg_y2 ...], [SG_y1 SG_y2 ...], jg);
    

    Note: I’m not sure this is what RAPID still does. This method has the possibility to create statically unstable profiles of temperature and salinity when merging data from two latitude/longitude positions.

  2. Save merged output: Store combined profiles in NetCDF or .mat format for use in dynamic height or MOC calculation: - TG_wb2, SG_wb2 - Associated LATITUDE, LONGITUDE, and JG

Notes

  • Different mooring lines may be merged (e.g., WB1–WB4) to form a composite boundary profile.

  • Some scripts distinguish between upstream/downstream or boundary/interior groups before merging.

  • Care should be taken when combining profiles with differing depth ranges or quality flags.