Partitioning

class partitioning.Partitioning.Partitioning(hi, zi, freq, length, df, PreProcessing, argsQC)[source]

Bases: object

Initializes the Partitioning class.

Parameters:
  • hi (float) – Canopy height (m).

  • zi (float) – Eddy covariance measurement height (m).

  • freq (int) – Sampling frequency (Hz).

  • length (int) – Length of the time series (in minutes).

  • df (pandas.DataFrame) –

    DataFrame with data (e.g., 30min intervals, but any length works), each variable in a column. If raw data is used, pre-processing is first implemented following these steps:

    • Quality control (removing outliers, despiking, flags of instruments, etc)

    • Rotation of coordinates (double rotation) for velocity components u, v, w measured by CSAT

    • Density corrections for instantaneous fluctuations of CO2 (c_p) and H2O (q_p) measured by open-gas analyser (“instantaneous” WPL correction) based on the paper: Detto, M. and Katul, G. G., 2007. “Simplified expressions for adjusting higher-order

      turbulent statistics obtained from open path gas analyzers”. Boundary-Layer Meteorology, 10.1007/s10546-006-9105-1

    • Turbulent fluctuations, here denoted as primed quantities (“_p”), are computed

    • Air temperature (T) and virtual temperature (Tv) computed from the sonic temperature (Ts)

    Raw data requires the following variables and units:
    • index : datetime

    • w : velocity in the z direction (m/s)

    • u : velocity in the x direction (m/s)

    • v : velocity in the y direction (m/s)

    • Ts : sonic temperature (Celsius)

    • P : pressure (kPa)

    • CO2 : carbon dioxide density (mg/m3)

    • H2O : water vapor density (g/m3)

    After pre-processing, the following additional variables are created:
    • w_p : fluctuations of velocity in the z direction (m/s)

    • u_p : fluctuations of velocity in the x direction (m/s)

    • v_p : fluctuations of velocity in the y direction (m/s)

    • T : thermodynamic air temperature (Celsius)

    • Tv : virtual temperature (Celsius)

    • co2_p : fluctuations of carbon dioxide density (mg/m3) - (corrected for external densities (WPL) if needed)

    • h2o_p : fluctuations of water vapor density (g/m3) - (corrected for external densities (WPL) if needed)

    • Ts_p : fluctuations of sonic air temperature (Celsius)

    • Tv_p : fluctuations of virtual temperature (Celsius)

  • PreProcessing (bool, optional) – Indicates if pre-processing is necessary. If True, all pre-processing steps are implemented to raw data. If False, pre-processing is ignored and partitioning is immediately applied. In this case, the input files must contain all pre-processed variables listed above.

  • argsQC (dict, optional) –

    Contains options to be used during pre-processing regarding fluctuation extraction and if density corrections are necessary. All options have default values, but can be modified if needed.

    density_correction - bool

    True if density corrections are necessary (open gas analyzer); False (closed or enclosed gas analyzer).

    fluctuations - str

    Describes the type of operation used to extract fluctuations: ‘BA’: block average ‘LD’: Linear detrending ‘FL’: Filter low frequencies. Requires filtercut to indicate the cutoff time in minutes.

    filtercut - int

    Cutoff time in minutes for the low-pass filter. Only used if method is ‘FL’.

    maxGapsInterpolate - int

    Number of consecutive gaps that will be interpolated.

    RemainingData - int

    Percentage (0-100) of the time series that should remain after pre-processing. If less than this quantity, partitioning is not implemented.

    steadyness - bool

    If True, Foken’s stationarity test is implemented to check if the data is stationary. If False, the test is not implemented. The test is only informative and does not remove data, which is left to the user’s discretion.

    saveprocessed - bool

    If True, the processed data is saved to a CSV file.

    time_lag_correction - bool

    If True, a time lag correction is applied to the CO2 and H2O time series relative to the W time series.

    max_lag_seconds - int

    Maximum time lag in seconds to consider for correlation. Defaults to 5 seconds.

    type_lag - str

    Specifies the type of lag to consider. Options are ‘positive’, ‘negative’, or ‘both’. Defaults to ‘positive’. ‘Positive’ means that CO2 and H2O lag behind W as expected in closed-path systems when the tube delays the signal.

Notes: Available Partitioning Methods
  • Conditional Eddy Covariance (CEC)

  • Modified Relaxed Eddy Accumulation (MREA)

  • Flux Variance Similarity (FVS)

  • Conditional Eddy Accumulation (CEA)

  • Conditional Eddy Covariance + WUE (CECw)

CEC, CEA, and MREA only need time series of w_p, co2_p, h2o_p. The remaining quantities (e.g., P, T, Tv, etc.) are only needed if the water use efficiency (WUE) is computed for the FVS and CECw method. Alternatively, an external WUE can be used; in this case, FVS and CECw will only need time series of w_p, h2o_p, co2_p.

TurbulentStats()[source]

# Calculate turbulent statistics (scales, standard deviations, and correlations).

Returns:

‘ustar’: float

friction velocity [m/s]

’cstar’: float

scale for CO2 [mg/m3]

’qstar’: float

scale for H2O [g/m3]

’tstar’: float

scale for temperature [K]

’zeta’: float

Monin-Obukhov stability parameter

’std_t’: float

standard deviation of temperature [K]

’std_q’: float

standard deviation of H2O [g/m3]

’std_c’: float

standard deviation of CO2 [mg/m3]

’std_w’: float

standard deviation of w [m/s]

’std_u’: float

standard deviation of u [m/s]

’std_v’: float

floatstandard deviation of v [m/s]

’rqc’: float

correlation between H2O and CO2

’rqt’: float

correlation between H2O and temperature

’rct’: float

correlation between CO2 and temperature

’Fc’: float

covariance between w and CO2 [mg/m2/s]

’LE’: float

latent heat flux [W/m2]

’H’: float

sensible heat flux [W/m2]

Return type:

dict

WaterUseEfficiency(ppath='C3')[source]

Calculates water use efficiency in kg_co2/kg_h2o.

Main references: - Scanlon and Sahu 2008, Water Resources Research

“On the correlation structure of water vapor and carbon dioxide in the atmospheric surface layer: A basis for flux partitioning”

  • Parts of the code were adapted from Skaggs et al. 2018, Agr For Met “Fluxpart: Open source software for partitioning carbon dioxide and water vapor fluxes” https://github.com/usda-ars-ussl/fluxpart

  • Optimization model for W from Scanlon et al., 2019, Agr. For. Met. “Correlation-based flux partitioning of water vapor and carbon dioxide fluxes: Method simplification and estimation of canopy water use efficiency”

Parameters:
  • ppath (str) – Type of photosynthesis (‘C3’ or ‘C4’).

  • Models

    Computes the water use efficiency (eq A1 in Scanlon and Sahu, 2008):
    • wue = 0.65 * (c_c - c_s) / (q_c - q_s)

    • c_c (kg/m3) and q_c (kg/m3) are near canopy concentrations of CO2 and H2O
      • Estimated from log profiles (eq A2a in Scanlon and Sahu, 2008).

    • c_s (kg/m3) and q_s (kg/m3) are stomata concentrations of CO2 and H2O
      • q_s is assumed to be at saturation.

      • c_s is parameterized from different models (Skaggs et al., 2018; Scanlon et al., 2019).

    The following models for c_s are implemented

    const_ppm:
    • Concentrations in kg/m3 are computed from a constant value in ppm.

    • Values from Campbell and Norman, 1998, p. 150. Campbell, G. S. and Norman, J. M. (1998). An Introduction to Environmental Biophysics. Springer, New York, NY.

    • c_s = 280 ppm (C3 plants).

    • c_s = 130 ppm (C4 plants).

    const_ratio:
    • The ratio of near canopy and stomata CO2 concentrations is assumed constant (c_s/c_c = constant).

    • Constants from Sinclair, T. R., Tanner, C. B., and Bennett, J. M. (1984). Water-use efficiency in crop production. BioScience, 34(1):36–40.

    • c_s/c_c = 0.70 for C3 plants.

    • c_s/c_c = 0.44 for C4 plants.

    linear:
    • The ratio of near canopy and stomata CO2 concentrations is a linear function of VPD.

    • Based on the results of Morison, J. I. L. and Gifford, R. M. (1983). Stomatal sensitivity to carbon dioxide and humidity. Plant Physiology, 71(4):789–796. Estimated constants from Skaggs et al (2018).

    • c_s/c_c = a - b * D

    • a, b = 1, 1.6*10-4 Pa-1 for C3 plants.

    • a, b = 1, 2.7*10-4 Pa-1 for C4 plants.

    • D (Pa) is vapor pressure deficit based on leaf-temperature.

    sqrt:
    • The ratio of near canopy and stomata CO2 concentrations is proportional to the 1/2 power of VPD.

    • Model by Katul, G. G., Palmroth, S., and Oren, R. (2009). Leaf stomatal responses to vapour pressure deficit under current and CO2-enriched atmosphere explained by the economics of gas exchange. Plant, Cell & Environment, 32(8):968–979.

    • c_s/c_c = 1 - sqrt(1.6 * lambda * D / c_c)

    • lambda = 22e-9 kg-CO2 / m^3 / Pa for C3 plants (from Skaggs et al., 2018).

    • Not available for C4 plants.

    opt:
    • Optimization model proposed by Scanlon et al (2019).

    • Does not need extra parameters.

    • Only available for C3 plants.

Returns:

self.wue – Dictionary containing the water use efficiency from different methods: - ‘const_ppm’: float

WUE from constant ppm [kg_co2/kg_h2o].

  • ’const_ratio’: float

    WUE from constant ratio [kg_co2/kg_h2o].

  • ’linear’: float

    WUE from linear model [kg_co2/kg_h2o].

  • ’sqrt’: float

    WUE from sqrt model [kg_co2/kg_h2o].

  • ’opt’: float

    WUE from optimization model [kg_co2/kg_h2o].

Return type:

dict

partCEA(H=0.0)[source]

Implements the Conditional Eddy Accumulation method proposed by Zahn et al. 2024.

Numerical Investigation of Observational Flux Partitioning Methods for Water Vapor and Carbon Dioxide

Parameters:

H (float, optional) – Hyperbolic threshold, by default 0.0.

Attributes

Contains all the flux components and status of the calculation.

  • ET - float

    Total evapotranspiration (W/m2).

  • Tcea - float

    Plant transpiration (W/m2).

  • Ecea - float

    Soil/surface evaporation (W/m2).

  • Fc - float

    Carbon dioxide flux (mg/m2/s).

  • Rcea - float

    Soil/surface respiration (mg/m2/s).

  • Pcea - float

    Plant net photosynthesis* (mg/m2/s).

  • statuscea - str

    Status of the calculation.

Type:

self.fluxesCEA

Notes

This component represents carboxylation minus photorespiration and leaf respiration; therefore, it is different from gross primary productivity.

partCEC(H=0.0)[source]

Implements the Conditional Eddy Covariance method proposed by Zahn et al. 2021.

Direct Partitioning of Eddy-Covariance Water and Carbon Dioxide Fluxes into Ground and Plant Components.

Parameters:

H (float, optional) – Hyperbolic threshold, by default 0.0.

Attributes

Contains all the flux components and status of the calculation.

  • ET - float

    Total evapotranspiration (W/m2).

  • T - float

    Plant transpiration (W/m2).

  • Ecec - float

    Soil/surface evaporation (W/m2).

  • Fc - float

    Carbon dioxide flux (mg/m2/s).

  • Rcec - float

    Soil/surface respiration (mg/m2/s).

  • Pcec - float

    Plant net photosynthesis* (mg/m2/s).

  • statuscec - str

    Status of the calculation.

Type:

self.fluxesCEC

Notes

This component represents carboxylation minus photorespiration and leaf respiration; therefore, it is different from gross primary productivity.

partCECw(W, H=0.0)[source]

Implements Conditional Eddy Covariance + water use efficiency proposed by Zahn et al. 2024.

Numerical Investigation of Observational Flux Partitioning Methods for Water Vapor and Carbon Dioxide

Parameters:

W (float, optional) – Water use efficiency, by default 0.

Attributes

Contains all the flux components and status of the calculation.

Dictionary with the following flux components: - ET - float

Total evapotranspiration (W/m2).

  • Tcecw - float

    Plant transpiration (W/m2).

  • Ececw - float

    Soil/surface evaporation (W/m2).

  • Fc - float

    Net carbon dioxide flux (mg/m2/s).

  • Rcecw - float

    Soil/surface respiration (mg/m2/s).

  • Pcecw - float

    Plant net photosynthesis* (mg/m2/s).

  • statuscecw - str

    Status of the calculation.

Type:

self.fluxesCECw

Notes

This component represents carboxylation minus photorespiration and leaf respiration; therefore, it is different from gross primary productivity.

partFVS(W)[source]

Implements the Flux Variance Similarity Theory proposed by Scanlon et al., 2019.

Direct Partitioning of GPP and Re in a Subalpine Forest Ecosystem.

Parameters:

W (float, optional [kg_co2/kg_h2o]) – Water use efficiency, by default 0.

Attributes

Contains all the flux components and status of the calculation.

  • ET - float

    Total evapotranspiration (W/m2).

  • Tfvs - float

    Plant transpiration (W/m2).

  • Efvs - float

    Soil/surface evaporation (W/m2).

  • Fc - float

    Net carbon dioxide flux (mg/m2/s).

  • Rfvs - float

    Soil/surface respiration (mg/m2/s).

  • Pfvs - float

    Plant net photosynthesis* (mg/m2/s).

  • status - str

    Status of the calculation.

Type:

self.fluxesFVS

Notes

This component represents carboxylation minus photorespiration and leaf respiration; therefore, it is different from gross primary productivity.

partREA(H=0)[source]

Implements the Modified Relaxed Eddy Accumulation proposed by Thomas et al., 2008 (Agr For Met).

Estimating daytime subcanopy respiration from conditional sampling methods applied to multi-scalar high frequency turbulence time series https://www.sciencedirect.com/science/article/pii/S0168192308000737 New contraints defined in Zahn et al (2021).

Parameters:

H (float, optional) – Hyperbolic threshold, by default 0.0.

Attributes

Dictionary with the following flux components:

  • ET - float

    Total evapotranspiration (W/m2).

  • Tmrea - float

    Plant transpiration (W/m2).

  • Emrea - float

    Soil/surface evaporation (W/m2).

  • Fc - float

    Net carbon dioxide flux (mg/m2/s).

  • Rmrea - float

    Soil/surface respiration (mg/m2/s).

  • Pmrea - float

    Plant net photosynthesis* (mg/m2/s).

  • statusmrea - str

    Status of the calculation.

Type:

self.fluxesREA

Notes

This component represents carboxylation minus photorespiration and leaf respiration; therefore, it is different from gross primary productivity.