3. Calibration (Instrument-level Corrections)
This document describes the calibration step in the oceanarray processing workflow. Calibration refers to applying post-deployment corrections to sensor data based on pre- and post-cruise sensor checks (e.g., comparison with CTD dips), as well as manufacturer or lab calibrations.
This step typically follows trimming and inspection, and corresponds to post-stage 2 functionality in the RAPID framework. The RAPID .microcat.txt files serve as logs of the calibration process.
1. Overview
Sensor readings (temperature, conductivity, pressure) can drift during deployment. Calibration corrects for this using lab comparisons or in-situ cross-checks. Adjustments may be constant offsets (e.g., linear bias) or more complex corrections. In RAPID, calibration decisions are documented alongside each instrument in human-readable logs (e.g., *.microcat.txt).
2. Purpose
Apply sensor-specific calibration corrections
Document whether adjustments were applied (or not)
Preserve audit trail of calibration process
3. Input
Trimmed, standardised instrument dataset (e.g., .use)
Calibration metadata: - Human-readable .microcat.txt log - Optional structured version (e.g., YAML or JSON)
4. Output
Calibrated xarray.Dataset - Adjusted values in TEMPERATURE, CONDUCTIVITY, PRESSURE - Updated attributes:
calibrated = True
Offsets applied
Calibration log saved or appended to provenance
5. Example .microcat.txt Content
Microcat_apply_cal.m:
Date : 18-Jul-2017
Operator: JC
Input file : wb1_12_2015_6123.use
Output file: wb1_12_2015_005.microcat
Variable | pre-cruise | post-cruise
Conductivity [mS/cm]: 0.0181 0.0244
Temperature [degC] : 0.0000 0.0000
Pressure [dbar] : -0.9000 -3.1000
Average conductivity applied? y
Average temperature applied? y
Average pressure applied? y
Pressure drift removal? n
6. Application
from oceanarray.methods.calibration import apply_calibration
ds_cal = apply_calibration(ds_trimmed, offsets={"PRESSURE": -2.0, "CONDUCTIVITY": 0.02})
This step should not overwrite raw data. Keep original files and record all calibration operations.
7. Provenance and Metadata
The following attributes should be added to the calibrated dataset:
calibrated = True
calibration_notes = “Applied pressure offset -2 dbar, conductivity offset +0.02 mS/cm”
calibration_source = “wb1_12_2015_005.microcat.txt”
calibration_operator = “JC”
8. FAIR Considerations
Calibration logs must be preserved and ideally made machine-readable
Provide both pre- and post-correction values
Ensure reproducibility by archiving code and calibration metadata
See also: 2. Trimming to Deployed period, filtering, 1. Standardisation (Internally-consistent format)
Legacy Calibration Script (RAPID)
Download the legacy RAPID calibration script here:
This script:
Applies pre- and post-cruise calibration offsets
Supports pressure and conductivity-pressure drift corrections
Includes interactive and automatic despiking
Produces diagnostic plots
Outputs summary .txt files for provenance
1% 1) dedrift microcats using post- and pre-cruise ctd calibration
2% 2) set suspicious data to dummy
3%
4% prior to this programme, microcat_insitu_cal.m has to be run for pre- and post-cruise calibration
5% calibration offset then have to be entered in 'microcat_cond.xls' /
6% 'microcat_temp.xls' / microcat_presX.xls (with X being the number of
7% deployment
8%
9%
10
11% kanzow, 23.08.05
12
13clear
14warning off
15operator = 'JC';
16%%mooring = 'mochae_1_362'; % M1; M2; M3
17mooring = 'eb1_2_200516'; % M1; M2; M3
18sensortyp = 'microcat'; % arg / microcat
19
20delim = ',';
21
22% input directories & files
23rodbpath('/noc/ooc/rpdmoc/users/tok/rapid/data/');
24mooring_dir = '/noc/ooc/rpdmoc/rapid/data/moor/proc/';
25mooring_outdir = '/noc/ooc/rpdmoc/users/jcol/';
26coef_dir = '/noc/ooc/rpdmoc/users/jcol/cal_coef/';
27
28external_ctd = '/noc/ooc/rpdmoc/users/tok/rapid/data/cruise/d279/ctd/';
29external_ctd_file = 'd279_pos.mat';
30
31% extract calibration cruise indices from database (.xls spreadsheet)
32
33%[cruiseI,moors,raw] = xlsread([coef_dir,'microcat_calib_cruise.xls']);
34fid_cruise = fopen([coef_dir,'microcat_calib_cruise.csv']);
35cruise = textscan(fid_cruise,'%s%d%d','delimiter',delim,'HeaderLines',2);
36fclose(fid_cruise)
37
38moorI = find((strcmp(cruise{1},mooring))>0);
39cruise = [cruise{2} cruise{3}];
40cruiseI = cruise(moorI,:);