flux_unit_conversion
Module for converting eddy covariance flux units.
This module provides functionality to convert kinematic flux units (w’c’) to final physical units (e.g., μg m⁻² s⁻¹ or μmol m⁻² s⁻¹) in eddy covariance measurements. The conversions account for air density and, when needed, molecular mass of the measured scalar.
The module assumes standard units for input variables: - Vertical wind (w): m s⁻¹ - IRGA concentrations: ppm (μmol mol⁻¹) - TRACER concentrations: ppb (nmol mol⁻¹)
Functions
Convert eddy covariance flux and uncertainty estimates to physical units. |
- flux_unit_conversion.flux_unit_conversion(flux_individual, flux_noise_mean, flux_noise_std, flux_noise_rmse, random_error_FS, random_flux, random_error_noise, conv_type, air_mol_conc, MM=nan)[source]
Convert eddy covariance flux and uncertainty estimates to physical units.
This function converts kinematic fluxes (w’c’) and their associated uncertainty metrics from raw covariance units to physical flux units. The conversion requires air molar concentration and, for mass-based units, the molecular mass of the measured scalar.
- Parameters:
flux_individual (
float
orarray_like
) – Individual flux values [raw kinematic units]flux_noise_mean (
float
orarray_like
) – Mean of covariance noise [raw kinematic units]flux_noise_std (
float
orarray_like
) – Standard deviation of covariance noise [raw kinematic units]flux_noise_rmse (
float
orarray_like
) – RMSE of covariance noise [raw kinematic units]random_error_FS (
float
orarray_like
) – Random error from Finkelstein & Sims method [raw kinematic units]random_flux (
float
orarray_like
) – Random error from flux randomization [raw kinematic units]random_error_noise (
float
orarray_like
) – Random error from white noise [raw kinematic units]conv_type (
{'to ug m-2 s-1', 'to umol m-2 s-1'}
) – Type of unit conversion to perform: - ‘to ug m-2 s-1’: Convert to micrograms per square meter per second - ‘to umol m-2 s-1’: Convert to micromoles per square meter per secondair_mol_conc (
float
) – Air molar concentration [mol m⁻³]MM (
float
, optional) – Molar mass of measured scalar [g mol⁻¹] Required only for mass-based conversions (μg m⁻² s⁻¹)
- Returns:
7-element tuple containing the converted values in the same order as the input parameters, now in physical units [μg m⁻² s⁻¹ or μmol m⁻² s⁻¹]
- Return type:
Notes
The conversion factors are: 1. For molar fluxes (μmol m⁻² s⁻¹):
flux * air_mol_conc
For mass fluxes (μg m⁻² s⁻¹): flux * air_mol_conc * MM / 1000
The division by 1000 in the mass flux conversion accounts for the conversion from ng to μg.
Examples
>>> # Convert CO₂ flux to μmol m⁻² s⁻¹ >>> flux_conv = flux_unit_conversion( ... 0.1, 0.01, 0.02, 0.015, 0.03, 0.025, 0.02, ... 'to umol m-2 s-1', 41.6 ... ) >>> print(f'Converted flux: {flux_conv[0]:.2f} μmol m⁻² s⁻¹')
>>> # Convert CH₄ flux to μg m⁻² s⁻¹ >>> flux_conv = flux_unit_conversion( ... 0.1, 0.01, 0.02, 0.015, 0.03, 0.025, 0.02, ... 'to ug m-2 s-1', 41.6, MM=16.04 ... ) >>> print(f'Converted flux: {flux_conv[0]:.2f} μg m⁻² s⁻¹')