FLO Functions

Background

The Ocean Observatories Initiative deploys the WET Labs ECO fluorometer family across its moored, profiling, and mobile platforms to measure fluorescence and optical backscatter. Two instrument classes are covered by this module.

Class Hardware Channels Designator meaning
FLORT WET Labs ECO Triplet 3 Fluorometer, Three Wavelength
FLORD WET Labs ECO Dual 2 Fluorometer, Two Wavelength

Fixed-platform instruments include a wiper to actively limit biofouling. Mobile-platform instruments (profilers, gliders, AUVs) use only passive mitigation (copper faceplates).

flo_functions.py converts raw L0 count data from these instruments into three L1 data products — fluorometric chlorophyll-a concentration (CHLAFLO_L1), fluorometric CDOM concentration (CDOMFLO_L1), and the volume scattering function (FLUBSCT_L1) — and one L2 product, the total optical backscatter coefficient (FLUBSCT_L2). All calibration coefficients are from factory calibration sheets.


CHLAFLO and CDOMFLO — Fluorescence Concentrations

Raw output from the FLORD/FLORT instrument is in counts, ranging from 0 to approximately 4096. The L1 fluorescence concentrations are computed from a linear scale-and-offset equation using factory-supplied calibration coefficients:

\[XX = (C_\text{output} - C_\text{dc}) \times \text{SF}\]

where \(C_\text{output}\) is the raw count output, \(C_\text{dc}\) is the dark count from the factory calibration sheet, and SF is the scale factor from the factory calibration sheet. The same equation applies to both CHLAFLO and CDOMFLO; only the calibration coefficients and units differ.

For CHLAFLO (chlorophyll-a), SF has units of \(\mu g\ L^{-1}\ \text{count}^{-1}\) and the output is in \(\mu g\ L^{-1}\). The instrument measures at excitation/emission wavelengths of 470/695 nm.

For CDOMFLO, SF has units of \(\text{ppb}\ \text{count}^{-1}\) and the output is in parts per billion (ppb). The instrument measures at excitation/emission wavelengths of 370/460 nm.

The dark count is the instrument's signal output in clean water with black tape over the detector, measured at the factory. The scale factor is calculated at the factory by obtaining a consistent output in a solution of known concentration and subtracting the dark count.

FLORT/FLORD gliders and AUVs: Raw data from fluorometers on gliders and AUVs are processed onboard the vehicle using vendor software and transmitted already in decimal engineering units; ion-functions is not invoked for those deployments.


FLUBSCT_L1: Total Volume Scattering Function

The L1 optical backscatter product is the total volume scattering function \(\beta(\theta, \lambda)\) (\(\text{m}^{-1}\ \text{sr}^{-1}\)) at the instrument's effective (centroid) backscatter angle \(\theta\) and measurement wavelength \(\lambda\). It is computed from raw counts using the same scale-and-offset equation as the fluorescence products:

\[\beta(\theta, \lambda) = (C_\text{output} - C_\text{dc}) \times \text{SF}\]

where SF has units of \((\text{m}^{-1}\ \text{sr}^{-1})\ \text{count}^{-1}\). Raw counts range from 0 to approximately 4210. The dark count and scale factor are from the factory calibration sheet.

The centroid angle \(\theta\) and chi factor \(\chi\) (used below) are instrument-dependent:

Instrument type OOI classes \(\theta\) \(\chi\)
ECO 3-channel (FLORT D/J/K/M/N/O, FLORD D) FLORT, FLORD 124 deg 1.076
ECO 2-channel (FLORD G/L/M, FLNTU A) FLORD, FLNTU 140 deg 1.096

All FLORD and FLORT backscatter channels use a nominal measurement wavelength of 700 nm. The ECO-BB3 (FLORT series O) is an exception with three backscatter channels at different visible wavelengths.

FLUBSCT_L2: Total Optical Backscatter Coefficient

The L2 product is the total optical backscatter coefficient \(b_b\) (\(\text{m}^{-1}\)), computed in four steps:

Step 1 — Compute the seawater volume scattering function \(\beta_\text{sw}\) and total seawater scattering coefficient \(b_\text{sw}\) using the Zhang et al. (2009) model with co-located CTD temperature and salinity:

\[[\beta_\text{sw}, b_\text{sw}] = \text{flo_zhang_scatter_coeffs}(\text{degC}, \text{psu}, \theta, \lambda)\]

Step 2 — Subtract the seawater contribution to obtain the particulate volume scattering function:

\[\beta_p(\theta, \lambda) = \beta(\theta, \lambda) - \beta_\text{sw}(\theta, \lambda)\]

Step 3 — Convert to the particulate backscattering coefficient using the chi factor \(\chi\):

\[b_{bp} = \chi \times 2\pi \times \beta_p(\theta, \lambda)\]

The factor of \(2\pi\) arises from integration over the polar angle. The chi factor relates the particulate volume scattering at angle \(\theta\) to the total particulate backscattering coefficient integrated over all backward angles.

Step 4 — Add the seawater backscattering contribution. Because seawater scattering is symmetric in forward and backward directions, the backward component is half the total:

\[b_b = b_{bp} + \frac{b_\text{sw}}{2}\]

Zhang et al. (2009) Seawater Scattering Model

The seawater scattering model (flo_zhang_scatter_coeffs) computes the volume scattering function of pure seawater at a specified angle and the total seawater scattering coefficient. The model sums contributions from density fluctuations and concentration fluctuations:

\[\beta_{90,\text{sw}} = \beta_\text{df} + \beta_\text{cf}\]

The density fluctuation term \(\beta_\text{df}\) depends on the isothermal compressibility (Lepple and Millero, 1971), absolute temperature, and the density derivative of the refractive index (PMH model). The concentration fluctuation term \(\beta_\text{cf}\) depends on the partial derivative of the refractive index with respect to salinity (Quan and Fry, 1994) and the water activity (Millero and Leung, 1976). The total scattering coefficient is obtained by integrating \(\beta_{90,\text{sw}}\) over all angles. The volume scattering function at angle \(\theta\) is then:

\[\beta_\text{sw}(\theta) = \beta_{90,\text{sw}} \left(1 + \frac{1 - \delta}{1 + \delta} \cos^2\theta \right)\]

where \(\delta = 0.039\) is the default depolarization ratio (Farinato and Roswell, 1976). Seawater density uses the UNESCO (1981) formulation. The refractive index of air uses the Ciddor (1996) formula.


Core functions

flo_scale_and_offset(counts_output, counts_dark, scale_factor)

Apply scale-and-offset calibration to raw fluorometer counts.

Converts raw L0 digital counts from WET Labs ECO fluorometers to calibrated L1 concentration or volume scattering function values. This is the core algorithm shared by flo_chla (CHLAFLO_L1), flo_cdom (CDOMFLO_L1), and flo_beta (FLUBSCT_L1).

Parameters:
  • counts_output (array_like) –

    Measured sample output [counts].

  • counts_dark (array_like) –

    Dark counts: signal output of the fluorometer in clean water with black tape over the detector [counts]. From factory calibration sheet.

  • scale_factor (array_like) –

    Scale factor from factory calibration sheet [units counts^-1].

Returns:
  • value( ndarray ) –

    Calibrated output in units determined by scale_factor.

Source code in ion_functions/data/flo_functions.py
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
def flo_scale_and_offset(counts_output, counts_dark, scale_factor):
    """
    Apply scale-and-offset calibration to raw fluorometer counts.

    Converts raw L0 digital counts from WET Labs ECO fluorometers to
    calibrated L1 concentration or volume scattering function values.
    This is the core algorithm shared by flo_chla (CHLAFLO_L1),
    flo_cdom (CDOMFLO_L1), and flo_beta (FLUBSCT_L1).

    Parameters
    ----------
    counts_output : array_like
        Measured sample output [counts].
    counts_dark : array_like
        Dark counts: signal output of the fluorometer in clean water
        with black tape over the detector [counts]. From factory
        calibration sheet.
    scale_factor : array_like
        Scale factor from factory calibration sheet [units counts^-1].

    Returns
    -------
    value : ndarray
        Calibrated output in units determined by scale_factor.
    """
    value = (counts_output - counts_dark) * scale_factor
    return value

Additional Notes

This is the shared core algorithm for all three L1 FLORT/FLORD data products. The named OOI wrappers flo_chla, flo_cdom, and flo_beta each call this function with product-specific calibration coefficients. External users should call this function directly rather than the wrappers when a single computation is needed for multiple products.

History

Date Author Change
2014-01-30 Craig Risien Initial code
2023-08-15 Samuel Dahlberg Removed use of numexpr
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

flo_bback_total(beta, degC, psu, theta, wlngth, xfactor)

Compute total optical backscatter coefficient (FLUBSCT_L2).

Derives the total (seawater + particulate) optical backscatter coefficient from the L1 volume scattering function (FLUBSCT_L1) and co-located CTD data. The seawater volume scattering function and total scattering coefficient are computed using the Zhang et al. (2009) model via flo_zhang_scatter_coeffs.

Parameters:
  • beta (array_like) –

    Volume scattering function (seawater + particulate) at angle theta and wavelength wlngth (FLUBSCT_L1) [m^-1 sr^-1].

  • degC (array_like) –

    In situ water temperature from co-located CTD [degC].

  • psu (array_like) –

    In situ salinity from co-located CTD [psu].

  • theta (float) –

    Effective (centroid) backscatter scattering angle [degrees]. For FLORT D/J/K/M/N/O and FLORD D (ECO 3-channel): 124 deg. For FLORD G/L/M and FLNTU A (ECO 2-channel): 140 deg.

  • wlngth (float) –

    Optical backscatter measurement wavelength [nm].

  • xfactor (float) –

    Chi factor scaling particulate scattering at angle theta to the total particulate backscattering coefficient [unitless]. For FLORT D/J/K/M/N/O and FLORD D (ECO 3-channel): 1.076. For FLORD G/L/M and FLNTU A (ECO 2-channel): 1.096.

Returns:
  • bback( ndarray ) –

    Total optical backscatter coefficient (FLUBSCT_L2) [m^-1].

Notes

The chi factor is a function of angle and sensor geometry. It scales particulate scattering at the measurement angle to the particulate total backscatter coefficient (the integral over all backward angles of the volume scattering function due to particles). Values for theta and xfactor are instrument-dependent; see the DPS for FLUBSCT (OOI, 2014, DCN 1341-00540) for details.

Source code in ion_functions/data/flo_functions.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
def flo_bback_total(beta, degC, psu, theta, wlngth, xfactor):
    """
    Compute total optical backscatter coefficient (FLUBSCT_L2).

    Derives the total (seawater + particulate) optical backscatter
    coefficient from the L1 volume scattering function (FLUBSCT_L1)
    and co-located CTD data. The seawater volume scattering function
    and total scattering coefficient are computed using the Zhang et al.
    (2009) model via flo_zhang_scatter_coeffs.

    Parameters
    ----------
    beta : array_like
        Volume scattering function (seawater + particulate) at angle
        theta and wavelength wlngth (FLUBSCT_L1) [m^-1 sr^-1].
    degC : array_like
        In situ water temperature from co-located CTD [degC].
    psu : array_like
        In situ salinity from co-located CTD [psu].
    theta : float
        Effective (centroid) backscatter scattering angle [degrees].
        For FLORT D/J/K/M/N/O and FLORD D (ECO 3-channel): 124 deg.
        For FLORD G/L/M and FLNTU A (ECO 2-channel): 140 deg.
    wlngth : float
        Optical backscatter measurement wavelength [nm].
    xfactor : float
        Chi factor scaling particulate scattering at angle theta to the
        total particulate backscattering coefficient [unitless].
        For FLORT D/J/K/M/N/O and FLORD D (ECO 3-channel): 1.076.
        For FLORD G/L/M and FLNTU A (ECO 2-channel): 1.096.

    Returns
    -------
    bback : ndarray
        Total optical backscatter coefficient (FLUBSCT_L2) [m^-1].

    Notes
    -----
    The chi factor is a function of angle and sensor geometry. It scales
    particulate scattering at the measurement angle to the particulate
    total backscatter coefficient (the integral over all backward angles
    of the volume scattering function due to particles). Values for theta
    and xfactor are instrument-dependent; see the DPS for FLUBSCT (OOI,
    2014, DCN 1341-00540) for details.
    """
    # calculate:
    #    betasw, the theoretical value of the volume scattering function for
    #        seawater only at the measurement angle theta and wavelength
    #        wlngth [m-1 sr-1], and,
    #    bsw, the theoretical value for the total (forward + backward)
    #        scattering coefficient for seawater at wavelength wlngth [m-1].
    # Values are computed using the Zhang et al. (2009) model.
    betasw, bsw = flo_zhang_scatter_coeffs(degC, psu, theta, wlngth)

    # calculate the volume scattering at angle theta of particles only.
    #     beta = scattering measured at angle theta for seawater + particulates
    #     betasw = theoretical seawater only value at angle theta
    betap = beta - betasw

    # calculate the particulate backscatter coefficient bbackp [m-1], the
    # particulate scattering function integrated over all backwards angles.
    # The factor of 2*pi arises from integration over the polar angle.
    pi = np.pi
    bbackp = xfactor * 2.0 * pi * betap

    # calculate the backscatter coefficient due to seawater from the total
    # (forward + backward) scattering coefficient bsw. The scattering by
    # water molecules is symmetric, so the backward portion is bsw / 2.
    bbsw = bsw / 2

    # calculate the total (particulates + seawater) backscatter coefficient.
    bback = bbackp + bbsw

    return bback

History

Date Author Change
2013-07-16 Christopher Wingard Initial code
2014-04-23 Christopher Wingard Revised to address integration issues and meet DPS intent
2015-10-26 Russell Desiderio Removed default argument values; revised documentation
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

Helper Functions

flo_zhang_scatter_coeffs(degC, psu, theta, wlngth, delta=0.039)

Compute seawater scattering coefficients using the Zhang et al. (2009) model.

Calculates the volume scattering function of pure seawater at a given angle (betasw) and the total seawater scattering coefficient (bsw) at a given wavelength. The computation follows the model described in Zhang et al. (2009) and implemented in the DPS for FLUBSCT (OOI, 2014, DCN 1341-00540). This code is derived from MATLAB code provided by Dr. Xiaodong Zhang, University of North Dakota.

Parameters:
  • degC (array_like) –

    In situ water temperature from co-located CTD [degC].

  • psu (array_like) –

    In situ salinity from co-located CTD [psu].

  • theta (float) –

    Optical backscatter scattering angle [degrees].

  • wlngth (float) –

    Optical backscatter measurement wavelength [nm].

  • delta (float, default: 0.039 ) –

    Depolarization ratio [unitless]. Default is 0.039.

Returns:
  • betasw( ndarray ) –

    Volume scattering function of pure seawater at angle theta and wavelength wlngth [m^-1 sr^-1].

  • bsw( ndarray ) –

    Total scattering coefficient of pure seawater [m^-1].

Notes

The model combines scattering contributions from density fluctuations and concentration fluctuations. Isothermal compressibility is from Lepple and Millero (1971). Seawater density is from UNESCO Technical Papers in Marine Science No. 38 (1981). Water activity is from Millero and Leung (1976). The refractive index of seawater is from Quan and Fry (1994) and the refractive index of air is from Ciddor (1996). The PMH model is used for the density derivative of the refractive index.

Source code in ion_functions/data/flo_functions.py
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
def flo_zhang_scatter_coeffs(degC, psu, theta, wlngth, delta=0.039):
    """
    Compute seawater scattering coefficients using the Zhang et al. (2009)
    model.

    Calculates the volume scattering function of pure seawater at a given
    angle (betasw) and the total seawater scattering coefficient (bsw) at
    a given wavelength. The computation follows the model described in
    Zhang et al. (2009) and implemented in the DPS for FLUBSCT (OOI,
    2014, DCN 1341-00540). This code is derived from MATLAB code provided
    by Dr. Xiaodong Zhang, University of North Dakota.

    Parameters
    ----------
    degC : array_like
        In situ water temperature from co-located CTD [degC].
    psu : array_like
        In situ salinity from co-located CTD [psu].
    theta : float
        Optical backscatter scattering angle [degrees].
    wlngth : float
        Optical backscatter measurement wavelength [nm].
    delta : float, optional
        Depolarization ratio [unitless]. Default is 0.039.

    Returns
    -------
    betasw : ndarray
        Volume scattering function of pure seawater at angle theta and
        wavelength wlngth [m^-1 sr^-1].
    bsw : ndarray
        Total scattering coefficient of pure seawater [m^-1].

    Notes
    -----
    The model combines scattering contributions from density fluctuations
    and concentration fluctuations. Isothermal compressibility is from
    Lepple and Millero (1971). Seawater density is from UNESCO Technical
    Papers in Marine Science No. 38 (1981). Water activity is from
    Millero and Leung (1976). The refractive index of seawater is from
    Quan and Fry (1994) and the refractive index of air is from Ciddor
    (1996). The PMH model is used for the density derivative of the
    refractive index.
    """
    # values of the constants
    Na = 6.0221417930e23    # Avogadro's constant
    Kbz = 1.3806503e-23     # Boltzmann constant
    degK = degC + 273.15    # Absolute temperature
    M0 = 0.018              # Molecular weight of water in kg/mol
    pi = np.pi

    # convert the scattering angle from degrees to radians
    rad = np.radians(theta)

    # calculate the absolute refractive index of seawater and the partial
    # derivative of seawater refractive index with regards to salinity.
    nsw, dnds = flo_refractive_index(wlngth, degC, psu)

    # isothermal compressibility is from Lepple & Millero (1971,Deep
    # Sea-Research), pages 10-11 The error ~ +/-0.004e-6 bar^-1
    icomp = flo_isotherm_compress(degC, psu)

    # density of seawater from UNESCO 38 (1981).
    rho = flo_density_seawater(degC, psu)

    # water activity data of seawater is from Millero and Leung (1976,
    # American Journal of Science, 276, 1035-1077). Table 19 was reproduced
    # using Eq.(14,22,23,88,107) that were fitted to polynominal equation.
    # dlnawds is a partial derivative of the natural logarithm of water
    # activity with regards to salinity.
    dlnawds = (-5.58651e-4 + 2.40452e-7 * degC - 3.12165e-9 * degC**2 + 2.40808e-11 * degC**3) + \
            1.5 * (1.79613e-5 - 9.9422e-8 * degC + 2.08919e-9 * degC**2 - 1.39872e-11 * degC**3) * \
            psu**0.5 + 2 * (-2.31065e-6 - 1.37674e-9 * degC - 1.93316e-11 * degC**2) * psu

    # density derivative of refractive index from PMH model
    dfri = (nsw**2 - 1.0) * (1.0 + 2.0/3.0 * (nsw**2 + 2.0) * (nsw/3.0 - 1.0/3.0 / nsw)**2)

    # volume scattering at 90 degrees due to the density fluctuation
    beta_df = pi**2 / 2.0 * (wlngth*1e-9)**-4 * Kbz * degK * icomp * dfri**2 * (6.0 + 6.0 * delta) / (6.0 - 7.0 * delta)

    # volume scattering at 90 degree due to the concentration fluctuation
    flu_con = psu * M0 * dnds**2 / rho / -dlnawds / Na
    beta_cf = 2.0 * pi**2 * (wlngth * 1e-9)**-4 * nsw**2 * flu_con * (6.0 + 6.0 * delta) / (6.0 - 7.0 * delta)

    # total volume scattering at 90 degree
    beta90sw = beta_df + beta_cf

    # total scattering coefficient of seawater (m-1)
    bsw = 8.0 * pi / 3.0 * beta90sw * ((2.0 + delta) / (1.0 + delta))

    # total volume scattering coefficient of seawater (m-1 sr-1)
    betasw = beta90sw * (1.0 + ((1.0 - delta) / (1.0 + delta)) * np.cos(rad)**2)

    return betasw, bsw

History

Date Author Change
2013-07-15 Christopher Wingard Initial code
2023-08-15 Samuel Dahlberg Removed use of numexpr
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

flo_refractive_index(wlngth, degC, psu)

Compute the absolute refractive index of seawater.

Helper function for flo_zhang_scatter_coeffs. Computes the absolute refractive index of seawater (nsw) and its partial derivative with respect to salinity (dnds). The refractive index of air uses the Ciddor (1996) formula; the refractive index of seawater uses the Quan and Fry (1994) formula.

Parameters:
  • wlngth (float) –

    Backscatter measurement wavelength [nm].

  • degC (array_like) –

    In situ water temperature [degC].

  • psu (array_like) –

    In situ practical salinity [psu].

Returns:
  • nsw( ndarray ) –

    Absolute refractive index of seawater [unitless].

  • dnds( ndarray ) –

    Partial derivative of seawater refractive index with respect to salinity [unitless psu^-1].

Source code in ion_functions/data/flo_functions.py
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
def flo_refractive_index(wlngth, degC, psu):
    """
    Compute the absolute refractive index of seawater.

    Helper function for flo_zhang_scatter_coeffs. Computes the absolute
    refractive index of seawater (nsw) and its partial derivative with
    respect to salinity (dnds). The refractive index of air uses the
    Ciddor (1996) formula; the refractive index of seawater uses the
    Quan and Fry (1994) formula.

    Parameters
    ----------
    wlngth : float
        Backscatter measurement wavelength [nm].
    degC : array_like
        In situ water temperature [degC].
    psu : array_like
        In situ practical salinity [psu].

    Returns
    -------
    nsw : ndarray
        Absolute refractive index of seawater [unitless].
    dnds : ndarray
        Partial derivative of seawater refractive index with respect to
        salinity [unitless psu^-1].
    """
    # refractive index of air is from Ciddor (1996, Applied Optics).
    n_air = 1.0 + (5792105.0 / (238.0185 - 1 / (wlngth/1e3)**2) + 167917.0 / (57.362 - 1 / (wlngth/1e3)**2)) / 1e8

    # refractive index of seawater is from Quan and Fry (1994, Applied Optics)
    n0 = 1.31405
    n1 = 1.779e-4
    n2 = -1.05e-6
    n3 = 1.6e-8
    n4 = -2.02e-6
    n5 = 15.868
    n6 = 0.01155
    n7 = -0.00423
    n8 = -4382.0
    n9 = 1.1455e6
    nsw = n0 + (n1 + n2 * degC + n3 * degC**2) * psu + n4 * degC**2 + (n5 + n6 * psu + n7 * degC) / \
          wlngth + n8 / wlngth**2 + n9 / wlngth**3

    # pure seawater
    nsw = nsw * n_air
    dnds = (n1 + n2 * degC + n3 * degC**2 + n6 / wlngth) * n_air

    return nsw, dnds

History

Date Author Change
2014-02-21 Christopher Wingard Initial code
2023-08-15 Samuel Dahlberg Removed use of numexpr
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

flo_isotherm_compress(degC, psu)

Compute seawater isothermal compressibility.

Helper function for flo_zhang_scatter_coeffs. Computes seawater isothermal compressibility from the secant bulk modulus using Millero (1980) for pure water and the seawater correction following Lepple and Millero (1971).

Parameters:
  • degC (array_like) –

    In situ water temperature [degC].

  • psu (array_like) –

    In situ practical salinity [psu].

Returns:
  • iso_comp( ndarray ) –

    Seawater isothermal compressibility [Pa^-1].

Source code in ion_functions/data/flo_functions.py
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
def flo_isotherm_compress(degC, psu):
    """
    Compute seawater isothermal compressibility.

    Helper function for flo_zhang_scatter_coeffs. Computes seawater
    isothermal compressibility from the secant bulk modulus using
    Millero (1980) for pure water and the seawater correction following
    Lepple and Millero (1971).

    Parameters
    ----------
    degC : array_like
        In situ water temperature [degC].
    psu : array_like
        In situ practical salinity [psu].

    Returns
    -------
    iso_comp : ndarray
        Seawater isothermal compressibility [Pa^-1].
    """
    # pure water secant bulk Millero (1980, Deep-sea Research)
    kw = 19652.21 + 148.4206 * degC - 2.327105 * degC**2 + 1.360477e-2 * degC**3 - 5.155288e-5 * degC**4

    # seawater secant bulk
    a0 = 54.6746 - 0.603459 * degC + 1.09987e-2 * degC**2 - 6.167e-5 * degC**3
    b0 = 7.944e-2 + 1.6483e-2 * degC - 5.3009e-4 * degC**2
    ks = kw + a0 * psu + b0 * psu**1.5

    # calculate seawater isothermal compressibility from the secant bulk
    iso_comp = 1 / ks * 1e-5  # unit is Pa

    return iso_comp

History

Date Author Change
2014-02-21 Christopher Wingard Initial code
2023-08-15 Samuel Dahlberg Removed use of numexpr
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

flo_density_seawater(degC, psu)

Compute the density of seawater.

Helper function for flo_zhang_scatter_coeffs. Computes seawater density from the UNESCO Technical Papers in Marine Science No. 38 (1981) formulation.

Parameters:
  • degC (array_like) –

    In situ water temperature [degC].

  • psu (array_like) –

    In situ practical salinity [psu].

Returns:
  • rho_sw( ndarray ) –

    Density of seawater [kg m^-3].

Source code in ion_functions/data/flo_functions.py
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
def flo_density_seawater(degC, psu):
    """
    Compute the density of seawater.

    Helper function for flo_zhang_scatter_coeffs. Computes seawater
    density from the UNESCO Technical Papers in Marine Science No. 38
    (1981) formulation.

    Parameters
    ----------
    degC : array_like
        In situ water temperature [degC].
    psu : array_like
        In situ practical salinity [psu].

    Returns
    -------
    rho_sw : ndarray
        Density of seawater [kg m^-3].
    """
    # density of water and seawater, unit is Kg/m^3, from UNESCO,38,1981
    a0 = 8.24493e-1
    a1 = -4.0899e-3
    a2 = 7.6438e-5
    a3 = -8.2467e-7
    a4 = 5.3875e-9
    a5 = -5.72466e-3
    a6 = 1.0227e-4
    a7 = -1.6546e-6
    a8 = 4.8314e-4
    b0 = 999.842594
    b1 = 6.793952e-2
    b2 = -9.09529e-3
    b3 = 1.001685e-4
    b4 = -1.120083e-6
    b5 = 6.536332e-9

    # density for pure water
    rho_w = b0 + b1 * degC + b2 * degC**2 + b3 * degC**3 + b4 * degC**4 + b5 * degC**5

    # density for pure seawater
    rho_sw = rho_w + ((a0 + a1 * degC + a2 * degC**2 + a3 * degC**3 + a4 * degC**4) *
                      psu + (a5 + a6 * degC + a7 * degC**2) * psu**1.5 + a8 * psu**2)

    return rho_sw

History

Date Author Change
2014-02-21 Christopher Wingard Initial code
2023-08-15 Samuel Dahlberg Removed use of numexpr
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

Wrapper Functions

flo_scat_seawater(degC, psu, theta, wlngth, delta=0.039)

Compute the total scattering coefficient of pure seawater.

Thin wrapper around flo_zhang_scatter_coeffs that returns only the total scattering coefficient bsw. Used where only bsw is required without the volume scattering function betasw.

Parameters:
  • degC (array_like) –

    In situ water temperature from co-located CTD [degC].

  • psu (array_like) –

    In situ salinity from co-located CTD [psu].

  • theta (float) –

    Optical backscatter scattering angle [degrees].

  • wlngth (float) –

    Optical backscatter measurement wavelength [nm].

  • delta (float, default: 0.039 ) –

    Depolarization ratio [unitless]. Default is 0.039.

Returns:
  • bsw( ndarray ) –

    Total scattering coefficient of pure seawater [m^-1].

Source code in ion_functions/data/flo_functions.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
def flo_scat_seawater(degC, psu, theta, wlngth, delta=0.039):
    """
    Compute the total scattering coefficient of pure seawater.

    Thin wrapper around flo_zhang_scatter_coeffs that returns only the
    total scattering coefficient bsw. Used where only bsw is required
    without the volume scattering function betasw.

    Parameters
    ----------
    degC : array_like
        In situ water temperature from co-located CTD [degC].
    psu : array_like
        In situ salinity from co-located CTD [psu].
    theta : float
        Optical backscatter scattering angle [degrees].
    wlngth : float
        Optical backscatter measurement wavelength [nm].
    delta : float, optional
        Depolarization ratio [unitless]. Default is 0.039.

    Returns
    -------
    bsw : ndarray
        Total scattering coefficient of pure seawater [m^-1].
    """
    _, bsw = flo_zhang_scatter_coeffs(degC, psu, theta, wlngth, delta)
    return bsw

History

Date Author Change
2014-04-24 Christopher Wingard Initial code
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

The three functions below are named-product wrappers that apply flo_scale_and_offset under instrument- and product-specific names to satisfy the OOI single-output data product requirement. External users should call flo_scale_and_offset directly.

flo_chla(counts_output, counts_dark, scale_factor)

OOI single-output wrapper for CHLAFLO_L1. Returns fluorometric chlorophyll-a concentration [ug L^-1].

See Also

flo_scale_and_offset : Core algorithm; use directly where the same scale-and-offset calculation is needed for other data products.

Source code in ion_functions/data/flo_functions.py
376
377
378
379
380
381
382
383
384
385
386
387
def flo_chla(counts_output, counts_dark, scale_factor):
    """
    OOI single-output wrapper for CHLAFLO_L1. Returns fluorometric
    chlorophyll-a concentration [ug L^-1].

    See Also
    --------
    flo_scale_and_offset : Core algorithm; use directly where the same
        scale-and-offset calculation is needed for other data products.
    """
    chla_conc = flo_scale_and_offset(counts_output, counts_dark, scale_factor)
    return chla_conc

History

Date Author Change
2014-01-30 Craig Risien Initial code
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

flo_cdom(counts_output, counts_dark, scale_factor)

OOI single-output wrapper for CDOMFLO_L1. Returns fluorometric CDOM concentration [ppb].

See Also

flo_scale_and_offset : Core algorithm; use directly where the same scale-and-offset calculation is needed for other data products.

Source code in ion_functions/data/flo_functions.py
390
391
392
393
394
395
396
397
398
399
400
401
def flo_cdom(counts_output, counts_dark, scale_factor):
    """
    OOI single-output wrapper for CDOMFLO_L1. Returns fluorometric
    CDOM concentration [ppb].

    See Also
    --------
    flo_scale_and_offset : Core algorithm; use directly where the same
        scale-and-offset calculation is needed for other data products.
    """
    cdom_conc = flo_scale_and_offset(counts_output, counts_dark, scale_factor)
    return cdom_conc

History

Date Author Change
2014-01-30 Craig Risien Initial code
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

flo_beta(counts_output, counts_dark, scale_factor)

OOI single-output wrapper for FLUBSCT_L1. Returns the volume scattering function at the instrument centroid angle [m^-1 sr^-1].

See Also

flo_scale_and_offset : Core algorithm; use directly where the same scale-and-offset calculation is needed for other data products. flo_bback_total : Computes FLUBSCT_L2 from the L1 beta value.

Source code in ion_functions/data/flo_functions.py
404
405
406
407
408
409
410
411
412
413
414
415
416
def flo_beta(counts_output, counts_dark, scale_factor):
    """
    OOI single-output wrapper for FLUBSCT_L1. Returns the volume
    scattering function at the instrument centroid angle [m^-1 sr^-1].

    See Also
    --------
    flo_scale_and_offset : Core algorithm; use directly where the same
        scale-and-offset calculation is needed for other data products.
    flo_bback_total : Computes FLUBSCT_L2 from the L1 beta value.
    """
    beta = flo_scale_and_offset(counts_output, counts_dark, scale_factor)
    return beta

History

Date Author Change
2014-01-30 Craig Risien Initial code
2015-10-23 Russell Desiderio Revised documentation
2025-04-17 Christopher Wingard Converted to NumPy docstring format; updated documentation

References

Ciddor, P. E. (1996). Refractive index of air: New equations for the visible and near infrared. Applied Optics, 35(9), 1566-1573.

Farinato, R. S. and Roswell, R. L. (1976). New values of the light scattering depolarization and anisotropy of water. Journal of Chemical Physics, 65(2), 593-595.

Lepple, F. K. and Millero, F. J. (1971). The isothermal compressibility of seawater near one atmosphere. Deep-Sea Research, 18(12), 1233-1254.

Millero, F. J. and Leung, W. H. (1976). The thermodynamics of seawater at one atmosphere. American Journal of Science, 276, 1035-1077.

Millero, F. J. (1980). The equation of state of seawater. Deep-Sea Research, 27(3-4), 255-274.

Quan, X. and Fry, E. S. (1994). Empirical equation for the index of refraction of seawater. Applied Optics, 33(15), 3241-3243.

Sullivan, J. M., Twardowski, M. S., Zaneveld, J. R. V., and Moore, C. C. (2013). Measuring optical backscattering in water. In A. A. Kokhanovsky (Ed.), Light Scattering Reviews 7 (pp. 189-224). Springer.

UNESCO (1981). Tenth report of the joint panel on oceanographic tables and standards. UNESCO Technical Papers in Marine Science No. 38. UNESCO, Paris.

Zhang, X., Hu, L., and He, M. (2009). Scattering by pure seawater: Effect of salinity. Optics Express, 17(7), 5698-5710.

OOI (2012). Data Product Specification for Fluorometric Chlorophyll-a Concentration. Document Control Number 1341-00530.

OOI (2012). Data Product Specification for Fluorometric CDOM Concentration. Document Control Number 1341-00550.

OOI (2014). Data Product Specification for Optical Backscatter (Red Wavelengths). Document Control Number 1341-00540.