pelagos_py.steps.processing.chla#
- class pelagos_py.steps.processing.chla.chla_deep_correction(name, parameters=None, diagnostics=False, context=None)[source]#
Bases:
pelagos_py.steps.base_step.BaseStep,pelagos_py.utils.qc_handling.QCHandlingMixinBase class for pipeline steps with config-mirroring support. Every concrete subclass (registered via @register_step) inherits this.
- run()[source]#
Example
- name: "Chla Deep Correction" parameters: apply_to: "CHLA" dark_value: null depth_threshold: 200 diagnostics: true
- compute_dark_value()[source]#
Compute dark value for chlorophyll-a correction.
The dark value represents the sensor’s baseline reading in the absence of chlorophyll fluorescence. Computed as the median of minimum CHLA values from deep profiles (>= depth_threshold).
- Parameters:
ds (xarray.Dataset) – Glider dataset with variables: CHLA, DEPTH (or PRES), PROFILE_NUMBER
depth_threshold (float, optional) – Minimum depth [m] for dark value calculation (default: 200)
n_profiles (int, optional) – Number of deep profiles to use (default: 5)
config_path (str or Path, optional) – Path to config file to check for existing dark value
- Returns:
dark_value (float) – Computed dark value
profile_data (dict) – Dictionary containing profile information used in calculation Keys are profile numbers, values are dicts with ‘depth’, ‘chla’, ‘min_value’, ‘min_depth’
- class pelagos_py.steps.processing.chla.chla_quenching_correction(name, parameters=None, diagnostics=False, context=None)[source]#
Bases:
pelagos_py.steps.base_step.BaseStep,pelagos_py.utils.qc_handling.QCHandlingMixinBase class for pipeline steps with config-mirroring support. Every concrete subclass (registered via @register_step) inherits this.
- run()[source]#
Example
- name: "Chla Quenching Correction" parameters: method: "Argo" apply_to: "CHLA" mld_settings: { "threshold_on": "TEMP", "reference_depth": 10, "threshold": 0.2 } plot_profiles: [] diagnostics: true
- apply_xing2012_quenching_correction(profile)[source]#
Apply non-photochemical quenching (NPQ) correction following Xing et al. (2012, JGR–Oceans, 117:C01019).
The maximum fluorescence within the mixed-layer depth (MLD) is taken as the non-quenched reference. All shallower (PRES < z_qd) values are adjusted upward to that maximum. Correction is only applied when solar elevation > 0°.
- Parameters:
chlf (array-like of shape (N,)) – Uncorrected chlorophyll fluorescence profile F_Chl(PRES).
pres (array-like of shape (N,)) – Pressure (dbar), increasing with depth.
mld (float) – Mixed-layer depth (m or dbar).
sun_angle (float) – Solar elevation angle (degrees). NPQ correction is applied only if sun_angle > 0.
- Returns:
chl_corr (ndarray of shape (N,)) – NPQ-corrected fluorescence profile.
npq (ndarray of shape (N,)) – NPQ index = (chl_corr − chlf) / chlf.
z_qd (float) – Quenching depth (dbar): pressure of maximum fluorescence within the MLD. NaN if not computable or if night-time.
Notes
No correction is applied if solar elevation ≤ 0° (nighttime).
Shallower than z_qd → fluorescence set to Fmax (non-quenched reference).
Below MLD → unchanged.