Skip to content

Commit 499819d

Browse files
clevinsonclaude
andauthored
feat: add ContinuousCO2Variable schema (#17)
* feat: add ContinuousCO2Variable schema + fix filenames slot Add continuous xCO2/pCO2/fCO2 variable support with equilibrator, environmental sensors, marine air measurement, and calibration hierarchy. Refactor CO2Calibration into Discrete/Continuous variants. Fix filenames slot_usage error in dataset.yaml by promoting to proper slot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix instrument_type equals_string, remove EquilibratorType enum, add ContinuousCO2Variable variable_type constraint - Fix CO2GasDetector slot_usage: analyzing_instrument_type → instrument_type with range: string + equals_string produces const in JSON Schema - Change equilibrator_type from enum to string (unknown controlled vocab) - Add variable_type equals_string: "co2" to ContinuousCO2Variable Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: typed numeric sensor fields + units in titles - Add TemperatureSensor and PressureSensor subclasses of GenericSensor with slot_usage specializing accuracy/precision titles to include units (°C and hPa respectively) and descriptions - Change GenericSensor.accuracy and precision from string to float - Add (L/min) to CO2Equilibrator water_flow_rate and headspace_gas_flow_rate titles; promote them and volume from string to float - Change DiscreteCO2Variable seawater_volume, headspace_volume, and measurement_temperature from integer to float (these are real measurements with decimal values) and add units to titles - Update ContinuousCO2Variable to reference TemperatureSensor for equilibrator temp sensor and PressureSensor for equilibrator/atmospheric pressure sensors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * relax StandardGas: all fields optional, remove duplicate uncertainty override - Make manufacturer and concentration optional on StandardGas - Remove redundant uncertainty override from ContinuousStandardGas (inherits from base StandardGas) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * cleanup: remove redundant range override in sensor slot_usage range: float is already set on GenericSensor.accuracy/precision and is inherited by subclasses, no need to re-declare in slot_usage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 44ba6c1 commit 499819d

7 files changed

Lines changed: 1608 additions & 166 deletions

File tree

project/jsonschema/oae_data_protocol.schema.json

Lines changed: 684 additions & 48 deletions
Large diffs are not rendered by default.

project/typescript/oae_data_protocol.ts

Lines changed: 137 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,13 +1046,29 @@ export interface PHCalibration extends Calibration {
10461046

10471047

10481048
/**
1049-
* CO2 gas detector calibration with standard gas information.
1049+
* Base CO2 gas detector calibration with standard gas information.
10501050
*/
10511051
export interface CO2Calibration extends Calibration {
1052+
/** Standard gases used for calibration. */
1053+
standard_gas_info?: StandardGas,
1054+
}
1055+
1056+
1057+
/**
1058+
* CO2 calibration for discrete measurements, with calibration temperature.
1059+
*/
1060+
export interface DiscreteCO2Calibration extends CO2Calibration {
10521061
/** Temperature at which calibration was performed. */
10531062
calibration_temperature?: string,
1063+
}
1064+
1065+
1066+
/**
1067+
* CO2 calibration for continuous measurements, with extended standard gas details.
1068+
*/
1069+
export interface ContinuousCO2Calibration extends CO2Calibration {
10541070
/** Standard gases used for calibration. */
1055-
standard_gas_info?: StandardGas,
1071+
standard_gas_info?: ContinuousStandardGas,
10561072
}
10571073

10581074

@@ -1061,14 +1077,25 @@ export interface CO2Calibration extends Calibration {
10611077
*/
10621078
export interface StandardGas {
10631079
/** Manufacturer of the standard gas. */
1064-
manufacturer: string,
1080+
manufacturer?: string,
10651081
/** Concentrations of the CO2 standard gases that are used to calibrate the CO2 sensor, e.g., 260, 350, 510ppm. */
1066-
concentration: string,
1082+
concentration?: string,
10671083
/** Uncertainties of the CO2 standard gas, e.g., 0.5%. */
10681084
uncertainty?: string,
10691085
}
10701086

10711087

1088+
/**
1089+
* Standard gas used for continuous CO2 calibration, with additional traceability and count information.
1090+
*/
1091+
export interface ContinuousStandardGas extends StandardGas {
1092+
/** How many non-zero gas standards were used for the calibration. */
1093+
number_of_nonzero_standards?: number,
1094+
/** Information about traceability of standard gases to WMO standards. */
1095+
traceability_to_wmo_standards?: string,
1096+
}
1097+
1098+
10721099
/**
10731100
* Base class for scientific instruments used in analyzing samples for measurement.
10741101
*/
@@ -1116,14 +1143,94 @@ export interface CO2GasDetector extends AnalyzingInstrument {
11161143
/** Type of the CO2 gas detector (E.g., Infrared) */
11171144
detector_type: string,
11181145
/** CO2 calibration information for this instrument. */
1119-
calibration: CO2Calibration,
1146+
calibration: DiscreteCO2Calibration,
11201147
/** Resolution of the CO2 sensor. */
11211148
resolution?: string,
11221149
/** Uncertainty of the CO2 sensor. */
11231150
uncertainty?: string,
11241151
}
11251152

11261153

1154+
/**
1155+
* CO2 gas detector for continuous measurements, with measurement frequency.
1156+
*/
1157+
export interface ContinuousCO2GasDetector extends CO2GasDetector {
1158+
/** How often measurements are taken, e.g., every 140 seconds except during calibration. */
1159+
measurement_frequency?: string,
1160+
/** CO2 calibration information for this continuous instrument. */
1161+
calibration: ContinuousCO2Calibration,
1162+
}
1163+
1164+
1165+
/**
1166+
* Equilibrator used for continuous CO2 measurement.
1167+
*/
1168+
export interface CO2Equilibrator {
1169+
/** Type of the equilibrator for the CO2 measurement. */
1170+
equilibrator_type?: string,
1171+
/** The total volume (in liters) of the CO2 equilibrator. */
1172+
volume?: number,
1173+
/** Is the equilibrator vented or not? */
1174+
vented?: boolean,
1175+
/** Flow rate (in L/min) of the flow through seawater. */
1176+
water_flow_rate?: number,
1177+
/** Flow rate (in L/min) of the gas from the equilibrator to the CO2 analyzer. */
1178+
headspace_gas_flow_rate?: number,
1179+
}
1180+
1181+
1182+
/**
1183+
* Generic sensor base class used in continuous CO2 measurements. Subclasses (e.g., TemperatureSensor, PressureSensor) specialize accuracy and precision units via slot_usage.
1184+
*/
1185+
export interface GenericSensor {
1186+
/** Location of the sensor. */
1187+
location?: string,
1188+
/** Manufacturer of the sensor. */
1189+
manufacturer?: string,
1190+
/** Model number of the sensor. */
1191+
model?: string,
1192+
/** Serial number of the sensor. */
1193+
serial_number?: string,
1194+
/** Accuracy of the sensor. */
1195+
accuracy?: number,
1196+
/** Precision of the sensor. */
1197+
precision?: number,
1198+
/** Calibration information for the sensor. */
1199+
calibration?: string,
1200+
/** Additional comments about the sensor. */
1201+
comments?: string,
1202+
}
1203+
1204+
1205+
/**
1206+
* Temperature sensor used in continuous CO2 measurements. Accuracy and precision are reported in degrees Celsius.
1207+
*/
1208+
export interface TemperatureSensor extends GenericSensor {
1209+
}
1210+
1211+
1212+
/**
1213+
* Pressure sensor used in continuous CO2 measurements. Accuracy and precision are reported in hectopascals (hPa).
1214+
*/
1215+
export interface PressureSensor extends GenericSensor {
1216+
}
1217+
1218+
1219+
/**
1220+
* Information about CO2 measurements in marine air.
1221+
*/
1222+
export interface MarineAirMeasurement {
1223+
/** Whether CO2 in marine air was measured. */
1224+
measured: boolean,
1225+
/** How often marine air CO2 is measured, e.g., 5 readings in a group every 5 hours. */
1226+
measurement_interval?: string,
1227+
/** Location and height of the marine air intake. */
1228+
location_and_height?: string,
1229+
/** Method used to dry the gas stream for marine air measurements. */
1230+
drying_method?: string,
1231+
}
1232+
1233+
11271234
/**
11281235
* Abstract root for all variable types (including non-measured)
11291236
*/
@@ -1304,6 +1411,29 @@ export interface DiscreteCO2Variable extends DiscreteMeasuredVariable, MeasuredC
13041411
}
13051412

13061413

1414+
/**
1415+
* CO2 continuous (sensor) measured variable (xCO2/pCO2/fCO2). Reference: OAPMetadata XSD variables.xsd - co2_continuous
1416+
*/
1417+
export interface ContinuousCO2Variable extends ContinuousMeasuredVariable, MeasuredCO2Fields {
1418+
/** Equilibrator used for CO2 measurement. */
1419+
equilibrator?: CO2Equilibrator,
1420+
/** Temperature sensor for the equilibrator. */
1421+
equilibrator_temperature_sensor?: TemperatureSensor,
1422+
/** Pressure sensor for the equilibrator. */
1423+
equilibrator_pressure_sensor?: PressureSensor,
1424+
/** Atmospheric pressure sensor. */
1425+
atmospheric_pressure_sensor?: PressureSensor,
1426+
/** Whereabouts of the seawater intake. */
1427+
seawater_intake_location: string,
1428+
/** Water depth of the seawater intake. */
1429+
seawater_intake_depth: string,
1430+
/** The method used to dry the gas coming out of CO2 equilibrator, before it is pumped into the CO2 sensor. */
1431+
drying_method?: string,
1432+
/** Information about CO2 measurements in marine air. */
1433+
marine_air_measurement?: MarineAirMeasurement,
1434+
}
1435+
1436+
13071437
/**
13081438
* HPLC (High-Performance Liquid Chromatography) measured variable for pigment analysis. Always measured, not calculated.
13091439
*/
@@ -1394,7 +1524,7 @@ export interface MeasuredCO2Fields {
13941524
For more details, refer to Newton J.A., Feely R. A., Jewett E. B., Williamson P. & Mathis J., 2015. Global Ocean Acidification Observing Network: Requirements and Governance Plan. Second Edition, GOA-ON, http://www.goa-on.org/docs/GOA-ON_plan_print.pdf. */
13951525
appropriate_use_quality?: string,
13961526
/** In Celsius. The input could be a constant temperature value, or something like, in-situ temperature, temperature of analysis, etc. */
1397-
co2_reported_temperature: string,
1527+
pco2_reported_temperature: string,
13981528
/** How the water vapor pressure inside the equilibrator was determined. */
13991529
water_vapor_correction_method?: string,
14001530
/** How the temperature effect was corrected. */
@@ -1439,6 +1569,7 @@ Any method that creates a unique ID that will link all project data is acceptabl
14391569
/** The experiment to which the data belong. Any naming convention that produces a unique ID is usable. The recommended naming convention is:
14401570
Project ID + Experiment type + Optional numerical indicator to differentiate between various experiments of the same type for a project. A two digit consecutive number beginning with 01 */
14411571
experiment_id: string,
1572+
filenames: string[],
14421573
/** Selected controlled vocabularies for data types relevant to mCDR have been referenced from NASA's SeaBASS metadata system and are provided below, for additional data types of optical characteristics see the [SeaBASS controlled definitions list](https://seabass.gsfc.nasa.gov/wiki/metadataheaders#data_type). Additional data types have been included to meet the needs of mCDR field projects. */
14431574
dataset_type: string,
14441575
/** Custom "data type" when an appropriate value is not found in the controlled vocabulary list for mCDR Data Type and the corresponding `data_type` field is set to "other". */
@@ -1450,7 +1581,6 @@ Project ID + Experiment type + Optional numerical indicator to differentiate bet
14501581
license?: string,
14511582
/** A statement from the data producer regarding how this dataset should be used. */
14521583
fair_use_data_request?: string,
1453-
filenames: string[],
14541584
}
14551585

14561586

0 commit comments

Comments
 (0)