flux_uncertainties
Functions
Computes different forms of turbulent flux uncertainties. |
- flux_uncertainties.flux_uncertainties(ini, w_prime, c_prime)[source]
Computes different forms of turbulent flux uncertainties.
This function implements various methods to estimate flux uncertainties and detection limits in eddy covariance measurements, including methods from Spirig et al. (2005), Finkelstein and Sims (2001), and others.
- Parameters:
ini (
dict
) –Initialization dictionary containing:
- param.SAMPLING_RATE_FINALfloat
Final sampling rate in Hz
- param.WINDOW_LENGTHfloat
Length of the averaging window in seconds
w_prime (
numpy.ndarray
) – 1D array of high-frequency fluctuations of vertical wind component (W) Units: m s⁻¹c_prime (
numpy.ndarray
) – 1D array of high-frequency fluctuations of scalar atmospheric variable (e.g., CO₂, CH₄, or VOCs) Units: Dependent on the scalar (e.g., ppb for VOCs)
- Returns:
flux_noise_mean (
float
) – Flux detection limit using mean of covariance between ±160-180s. Method from Spirig et al. (2005)flux_noise_std (
float
) – Flux detection limit using standard deviation of covariance between ±160-180s. Method from Spirig et al. (2005)flux_noise_rmse (
float
) – Flux detection limit using RMSE of covariance between ±160-180srandom_error_FS (
float
) – Random error calculated using the Finkelstein and Sims (2001) methodrandom_flux (
float
) – Flux detection limit using random shuffle method from Billesbach (2011)random_error_noise (
float
) – Random error from white noise using autocovariance methods from Lenschow (2000), Mauder (2013), and Langford (2015)
Notes
The white noise computation uses sqrt(difference) instead of difference(sqrt) as described in Langford (2015) pp. 4200-4201. This differs from the MATLAB InnFLUX implementation where interpolated variance at zero lag could be negative, leading to imaginary numbers in the MATLAB sqrt function.
References
See also
xcov
Cross-covariance calculation
cospectrum
Co-spectrum analysis
Examples
>>> import numpy as np >>> # Setup example data (30 minutes at 10 Hz) >>> ini = {'param': {'SAMPLING_RATE_FINAL': 10, 'WINDOW_LENGTH': 1800}} >>> w = np.random.randn(18000) # Vertical wind fluctuations >>> c = np.random.randn(18000) # Scalar concentration fluctuations >>> results = flux_uncertainties(ini, w, c) >>> print(f'Random error (FS method): {results[3]:.2e}')