pelagos_py.steps.processing.oxygen#

pelagos_py.steps.processing.oxygen.check_config(self, expected_params)[source]#

Runtime checks beyond the parameter schema.

Parameter presence and defaults are handled by parameter_schema; this additionally (a) catches method-dependent parameters left unset (None) and (b) verifies that any *_name parameter points at a variable that actually exists in the dataset.

class pelagos_py.steps.processing.oxygen.DeriveUncalibratedPhase(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Derives the optode’s uncalibrated phase, UNCAL_PHASE_DOXY, from the blue phase, minus the red phase when given.

See Oxygen Processing: Aanderaa Optodes.

Examples

- name: "Derive Uncalibrated Phase"
  parameters:
    #  <MANDATORY>
    blue_phase_name: "BPHASE_DOXY"
    # <OPTIONAL>
    red_phase_name: "RPHASE_DOXY"
  diagnostics: false
class pelagos_py.steps.processing.oxygen.DeriveOptodeTemperature(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Derives optode temperature, TEMP_DOXY, from its temperature voltage with a calibration polynomial.

See Oxygen Processing: Aanderaa Optodes.

Examples

- name: "Derive Optode Temperature"
  parameters:
    temp_voltage_name: "TEMP_VOLTAGE_DOXY"
    calib_coefficients: [0, 1, 0, 0, 0, 0]
  diagnostics: false
class pelagos_py.steps.processing.oxygen.PhasePressureCorrection(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Corrects the uncalibrated phase for pressure, writing UNCAL_PHASE_DOXY_PCORR.

See Oxygen Processing: Aanderaa Optodes.

Examples

- name: "Phase Pressure Correction"
  parameters:
    optode_pressure_name: "PRES"
    correction_coefficient: 0.1
  diagnostics: false
class pelagos_py.steps.processing.oxygen.ShiftOxygenToCTD(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Geometrically time-shifts optode measurements (e.g. phase, optode temperature) to line them up with the CTD, correcting for the water travel time between the two sensors’ positions on the glider (Woo & Gourcuff, 2023). The shifted value at an optode row at time t is the optode series read at t + lag, interpolated between the optode’s own readings (at most 5 minutes apart). It is written as <variable>_SHIFTED on the optode’s rows only, keeping the reading’s own flag.

If lag_seconds is not set, the lag is instead derived per profile from mean pitch and dive rate. If pitch_name cannot be found (or is empty), a warning is logged and the step fails, since no lag is then available; set lag_seconds for a constant lag instead. Samples whose flags fall in calculation_flag_filter (by default 3, 4 and 9) are not interpolated from, but are still shifted.

See Oxygen Processing: Aanderaa Optodes.

Examples

- name: "Shift Oxygen To CTD"
  parameters:
    # <MANDATORY>
    shift_vars: ["UNCAL_PHASE_DOXY", "TEMP_DOXY"]
    # <OPTIONAL>
    lag_seconds: null
    pitch_name: "GLIDER_PITCH"
    distance_cm: 90
    cast_id_var: "PROFILE_DIRECTION"
  diagnostics: false
classmethod output_variables(parameters)[source]#

Variables this step writes for the given config parameters (read by the config validator).

class pelagos_py.steps.processing.oxygen.DeriveCalibratedPhase(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Derives the calibrated phase, CAL_PHASE_DOXY, from the uncalibrated phase with a calibration polynomial.

See Oxygen Processing: Aanderaa Optodes.

Examples

- name: "Derive Calibrated Phase"
  parameters:
    uncalibrated_phase_name: "UNCAL_PHASE_DOXY"
    calib_coefficients: [0, 1, 0, 0]
  diagnostics: false
class pelagos_py.steps.processing.oxygen.DeriveOxygenConcentration(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Converts the calibrated phase to molar oxygen concentration, MOLAR_DOXY_ADJUSTED.

method: "poly" instead expects calib_coefficient_matrix (shape (5, 4)); method: "SVU" expects svu_coefficients, the 7 manufacturer SVUFoilCoef values (Stern-Volmer-Uchida equation). Writes MOLAR_DOXY_ADJUSTED, so a MOLAR_DOXY shipped in the file is kept unchanged.

See Oxygen Processing: Aanderaa Optodes.

Examples

- name: "Derive Oxygen Concentration"
  parameters:
    # <MANDATORY>
    method: "SVU"
    # <METHOD DEPENDENT>
    # The following params are for "SVU" method
    temperature_name: "TEMP_DOXY"
    svu_coefficients: [c0, c1, c2, c3, c4, c5, c6]  # manufacturer SVUFoilCoef0-6
  diagnostics: false
class pelagos_py.steps.processing.oxygen.MolarDOXYSalinityCorrection(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Corrects molar oxygen for salinity relative to reference_salinity, writing MOLAR_DOXY_PSAL.

See Oxygen Processing: Aanderaa Optodes.

Examples

- name: "Molar DOXY Salinity Correction"
  parameters:
    # <MANDATORY>
    salinity_name: "PSAL"
    temperature_name: "TEMP"
    # <OPTIONAL>
    reference_salinity: 0
  diagnostics: false
class pelagos_py.steps.processing.oxygen.MolarDOXYPressureCorrection(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Corrects molar oxygen for pressure, writing MOLAR_DOXY_PSAL_PRES.

See Oxygen Processing: Aanderaa Optodes.

Examples

- name: "Molar DOXY Pressure Correction"
  parameters:
    # <MANDATORY>
    pressure_name: "PRES"
    temperature_name: "TEMP"
    molar_doxy_name: "MOLAR_DOXY_PSAL"
    uncalibrated_phase_correction_applied: true
  diagnostics: false
class pelagos_py.steps.processing.oxygen.DeriveDOXY(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Convert molar oxygen (umol/L) to DOXY_ADJUSTED (umol/kg), the OG1/Argo DOXY unit.

Follows the Argo DAC oxygen processing (Thierry et al., Processing Argo oxygen data at the DAC level, doi:10.13155/39795): DOXY = MOLAR_DOXY * 1000 / rho0, with rho0 (kg/m3) the potential density at zero pressure, here TEOS-10 gsw.rho(SA, CT, 0) from salinity, temperature, pressure and position. DOXY_ADJUSTED_QC combines the QC of apply_to, salinity and temperature.

Example

- name: "Derive DOXY"
  parameters:
    apply_to: "MOLAR_DOXY_PSAL_PRES"  # or MOLAR_DOXY for a shipped value
    salinity_name: "PSAL"
    temperature_name: "TEMP"
    pressure_name: "PRES"
  diagnostics: false