How calibration comments are read

Each sensor’s serial number and calibration date come from a basestation calibration comment: a sg_cal_calibcomm* variable, set in sg_calib_constants.m. The comments are typed by the glider operator, not written by the basestation, so their format varies from mission to mission. This page states the rules the converter uses to read them, and lists every comment it is tested against, so you can check how yours will be read.

Where the comments come from

Each sensor key in the basestation instrument global is matched to a comment variable:

  • sg_cal_calibcomm_<key> (for example sg_cal_calibcomm_coda);

  • sg_cal_calibcomm for the CTD;

  • sg_cal_calibcomm_oxygen or sg_cal_calibcomm_optode for an oxygen sensor;

  • sg_cal_calibcomm_wetlabs for a WET Labs sensor.

The first dive with a comment is used. When that comment gives no serial number or no date and a later dive’s comment does, without contradicting it (a different serial number, or a different date), the value is taken from the later dive, and the sensor’s comment says which file and comment it came from. Comments that give different values on different dives are reported in the log. In the OG1 file, the SENSOR_* variable carries:

sensor_serial_number

The serial number, or UNK when it was not read.

sensor_calibration_date

ISO YYYY-MM-DD, or UNK. For a comment with one date per channel, the latest.

sensor_calibration_dates

Every channel date, "<channel>: <YYYY-MM-DD>" joined by "; " (RBR comments only).

original_calibcomm

The comment exactly as written in the basestation file.

The conversion_sensor_calibration global records, per SENSOR_* variable, the basestation variable the comment came from, the serial and date rules that read it, and any note. The conversion page shows these in its Calibration comments table.

Serial number

The rules are tried in this order; the first that matches is used. The serial is kept as an identifier: letters and dashes are not removed (25281-1, F0012). A model number before the label is not the serial (SBE 43F s/n 005 reads 005).

Rule

What it reads

label

the token after s/n, S/N, sn, SN:, SN (glued), serial, serial #, serialnum:

SBE#-tc

SBE#<serial>t<n>/c<n>: the CT serial; the T/C sensor pair is not part of it

tc-only

SBE t<n>/c<n>: a T/C sensor pair and no CT serial (UNK)

SBE-token

the token after SBE when there is no label

bare-token

the whole comment is one token (it may be a model number)

none

no serial in the comment (UNK)

Calibration date

The date must come directly after cal, CAL:, calibration or calibrated; only a serial label with its number (SN 1234), punctuation and the words on or date may stand between them. A date later in the comment (recal due 2013-08-12) is not read, and calibration was done 12 Aug 2011 gives UNK.

Dates with the year first (2012-05-12, 2012/05/12, 2012.05.12) have one reading. Dates with the month as a word have one reading too, with the day or the month first (May 12, 2012): 04FEB08, 15sep08, 12 Aug 01, 27 Feb 2025, 26 sept 07, 10 june 08, 24-May-17, 31-May-2017. RBR comments give one ISO date per channel (temp15:2025-02-26T13:58:29Z doxy24:2025-03-20T11:45:16Z).

All-numeric dates can have more than one reading. The converter lists the readings the shape allows and keeps those that are calendar dates on or before the mission’s first sample and at most 30 years before it:

Shape

Readings

When more than one fits

n/n/yy (slashes)

month first, day first

month first (9/10/08 is 10 September 2008)

n.n.yy, n-n-yy (dots, dashes)

day first, month first

day first (12.05.2012 is 12 May 2012)

8 digits

yyyymmdd, ddmmyyyy

UNK

6 digits

ddmmyy, yymmdd

UNK

When only one reading fits, it is used, and the note says why the other was rejected. For example 251114 on a mission whose first sample is 15 August 2015 reads 25 November 2014, because the other reading (14 November 2025) is after the first sample. When the preferred reading is not a calendar date, the other is used (28/4/08 is 28 April; 05.25.2012 is 25 May). Check original_calibcomm when a date matters: the preference is a convention, not something the comment says. A two-digit year takes the latest century that does not put it after the first sample.

The first sample is the earliest start_time global across the dive files.

A comment that matches none of these gives UNK with a note. The numbers after a serial label (s/n, SN) are never read as a date.

Checks

The converter keeps what the comment says, and flags:

  • a calibration date after the mission’s first sample (a calibration cannot postdate the data it calibrated), or more than 30 years before it — in the log, in the sensor’s comment and on the conversion page;

  • two sensors with the same serial number (usually a comment copied from another instrument) — in the log and on the conversion page;

  • a serial number read from a comment that is a single token with no label (it may be a model number) — on the conversion page;

  • an all-numeric date with two readings, chosen by the convention above — in the log and on the conversion page;

  • two sensors that would get the same SENSOR_* name (for example two fluorometers with no serial) — in the log; the second is written with its sensor key appended (SENSOR_FLUOROMETER_UNK_wlbb2fl) rather than overwriting the first.

The conversion_sensor_calibration record also stores the window (window_years) and the first sample used, so the date choice can be reconstructed from the file.

A value corrected with sensors: (below) clears the flag on the conversion page.

If yours is not read correctly

Correct the serial number or calibration date with sensors: in mission.yaml (see mission.yaml reference). For example, on the sg271 sample the RBR tridente comment carries the RBR coda’s serial number:

sensors:
  tridentebb700chla470fdom365:
    serial_number: "237998"

The correction replaces the serial number; original_calibcomm still holds the comment as written. To have a new comment format read, open an issue with the comment text and what it means; it becomes a row in the table below.

Every comment the parser is tested against

The rows below are tests/data/calibcomm_answers.csv: each comment, what it means, and the first-sample date the test uses. The expected values were read from the string, or decided by the maintainers where the string is ambiguous.

As written

Serial

Serial rule

Calibration date

Date rule

First sample

Note

SBE 43F s/n 25281-1 calibration 12 Aug 01

25281-1

label

2001-08-12

dd Mon yy

2003-10-02

—

SBE#29613t1/c1 calibration 7 Sep 02

29613

SBE#-tc

2002-09-07

dd Mon yy

2003-10-02

serial is the CT number; t1/c1 (T and C sensor pair) not part of it

SBE 43F s/n 005 calibration 09FEB08

005

label

2008-02-09

ddMonyy

2008-06-06

—

SBE 24520-1 calibration 04FEB08

24520-1

SBE-token

2008-02-04

ddMonyy

2008-06-06

—

SBE 43F s/n 042 calibration 05APR08

042

label

2008-04-05

ddMonyy

2008-11-06

—

SBE 0021 calibration 15sep08

0021

SBE-token

2008-09-15

ddMonyy

2008-11-06

lower-case month

SBE 43F s/n 042 calibration 05APR08

042

label

2008-04-05

ddMonyy

2009-08-29

—

SBE 0015 calibration 4/28/08

0015

SBE-token

2008-04-28

mm/dd/yy

2009-08-29

unambiguous month-first numeric date (28 > 12), hand-typed by the operator

SBE 43 s/n F0012 calibration 27 Aug 02

F0012

label

2002-08-27

dd Mon yy

2003-10-02

letter in serial

SBE#24520t4/c4 calibration 05 Apr 01

24520

SBE#-tc

2001-04-05

dd Mon yy

2003-10-02

as sg004: t4/c4 not part of the serial

SBE 43 s/n 0036 calibration 13MAY06

0036

label

2006-05-13

ddMonyy

2007-08-31

—

SBE s/n 0013 calibration 01JUN07

0013

label

2007-06-01

ddMonyy

2007-08-31

—

SBE 43F s/n 033 calibration 15JAN04

033

label

2004-01-15

ddMonyy

2004-09-24

—

SBE t10/c10 calibration 12DEC03

UNK

tc-only

2003-12-12

ddMonyy

2004-09-24

only a T/C sensor pair; no CT serial

0043

0043

bare-token

UNK

none

2008-02-14

bare token taken as the serial (may be a model number); no date

SBE s/n 0019, calibration 26 sept 07

0019

label

2007-09-26

dd Mon yy

2008-02-14

4-letter month ‘sept’

0088

0088

bare-token

UNK

none

2008-08-29

bare token taken as the serial (may be a model number); no date

SBE s/n 0025, calibration 10 june 08

0025

label

2008-06-10

dd Mon yy

2008-08-29

full month name

SBE 43F s/n 041 calibration 22JAN04

041

label

2004-01-22

ddMonyy

2004-09-24

—

SBE t12/c12 calibration 30DEC03

UNK

tc-only

2003-12-30

ddMonyy

2004-09-24

only a T/C sensor pair; no CT serial

SBE 43F s/n 042 calibration 25SEP04

042

label

2004-09-25

ddMonyy

2005-04-06

—

SBE t15/c15 calibration 18OCT04

UNK

tc-only

2004-10-18

ddMonyy

2005-04-06

only a T/C sensor pair; no CT serial

SBE 43F s/n 042 calibration 17FEB06

042

label

2006-02-17

ddMonyy

2006-11-12

—

SBE 0015 calibration 25JAN06

0015

SBE-token

2006-01-25

ddMonyy

2006-11-12

—

SBE 43F s/n 029 calibration 10APR07

029

label

2007-04-10

ddMonyy

2007-11-13

—

SBE 0013 calibration 21Feb07

0013

SBE-token

2007-02-21

ddMonyy

2007-11-13

—

SBE 43F s/n 103 calibration 02Apr08

103

label

2008-04-02

ddMonyy

2008-06-07

—

SBE 0088 calibration 23Mar08

0088

SBE-token

2008-03-23

ddMonyy

2008-06-07

—

SBE 43F s/n 103 calibration 02Apr08

103

label

2008-04-02

ddMonyy

2009-06-05

—

SBE 0093 calibration 30Jun08

0093

SBE-token

2008-06-30

ddMonyy

2009-06-05

—

Optode 4330F S/N 182 foil batch 2808F calibrated 09may09

182

label

2009-05-09

ddMonyy

2010-05-18

‘calibrated’ keyword; model 4330F is not the serial

SBE s/n 0112 calibration 20apr09

0112

label

2009-04-20

ddMonyy

2010-05-18

—

Optode 4330F S/N 182 foil batch 2808F calibrated 09may09

182

label

2009-05-09

ddMonyy

2010-09-03

—

SBE s/n 0112 calibration 20apr09

0112

label

2009-04-20

ddMonyy

2010-09-03

—

wlbbfl2 SN4746 cal 24-May-17

4746

label

2017-05-24

dd-Mon-yy

2022-07-18

‘SN’ glued to digits; ‘cal’ keyword

Optode 4831F SN: 453 Foil ID: 1207FM calibrated 31-May-2017

453

label

2017-05-31

dd-Mon-yyyy

2022-07-18

‘SN:’ with colon

SBE s/n 0292, calibration 17-Mar-17

0292

label

2017-03-17

dd-Mon-yy

2022-07-18

—

SBE 43F s/n 029 calibration 16Jun04

029

label

2004-06-16

ddMonyy

2006-11-12

—

SBE s/n 0021 calibration 07Jun04

0021

label

2004-06-07

ddMonyy

2006-11-12

—

SBE 43F s/n 029 calibration 07May07

029

label

2007-05-07

ddMonyy

2007-06-09

—

SBE s/n 0021 calibration 15Apr07

0021

label

2007-04-15

ddMonyy

2007-06-09

—

0061

0061

bare-token

UNK

none

2008-11-08

bare token taken as the serial (may be a model number); no date

SBE s/n 19, calibration 9/10/08

19

label

2008-09-10

mm/dd/yy

2008-11-08

month-first rule: 10 Sep (day-first 9 Oct); both precede the 8 Nov dive, so the guard cannot decide

SBE 43F s/n 043 calibration 16Jun04

043

label

2004-06-16

ddMonyy

2006-11-12

—

SBE s/n 0022 calibration 07Jun04

0022

label

2004-06-07

ddMonyy

2006-11-12

—

SN: 251  CAL: 29082012

251

label

2012-08-29

ddmmyyyy

2015-08-15

8 digits, day-first; last four a year

SN: 0135  CAL: 251114

0135

label

2014-11-25

ddmmyy

2015-08-15

ddmmyy; yymmdd would give 2025-11-14, after the first dive (2015-08-15T14:08:40Z), so ruled out by the dive-date guard

Legato s/n 238007, calibration 27 Feb 2025

238007

label

2025-02-27

dd Mon yyyy

2026-03-02

—

RBRtridente serialnum:237790 backscatter_00:2025-02-26T13:58:29Z chlorophyll_00:2025-03-11T12:50:27Z fdom_00:2025-03-11T12:54:10Z

237790

label

2025-03-11

rbr-iso

2026-03-02

backscatter_00: 2025-02-26; chlorophyll_00: 2025-03-11; fdom_00: 2025-03-11; tridente serial is the coda’s; the sg271 mission.yaml corrects it to 237998

RBRcoda serialnum:237790 temp15:2025-02-26T13:58:29Z doxy24:2025-03-20T11:45:16Z

237790

label

2025-03-20

rbr-iso

2026-03-02

temp15: 2025-02-26; doxy24: 2025-03-20