ecpet.ecpost module¶
EC-PeT Postprocessing Module¶
Advanced quality control and flux calculation routines for eddy-covariance data. Implements comprehensive postprocessing following established methodologies for surface-atmosphere exchange measurements, including flux quality assessment, meteorological variable derivation, and standardized output generation.
- The module performs:
Derived meteorological variable calculations (potential temperature, Obukhov length, mixing ratios, density corrections)
Mean-value quality control tests following established protocols
Integral turbulence characteristic analysis (Foken & Wichura methods)
Stationarity assessment using multiple approaches
Wind sector exclusion and footprint analysis
Error threshold validation for flux measurements
Quality flag application with configurable rules
Flux interdependency assessment
- ecpet.ecpost.derived_variables(intervals)¶
Calculate derived meteorological and flux variables.
- Parameters:
intervals (pandas.DataFrame) – DataFrame with basic flux and meteorological measurements
- Returns:
Updated DataFrame with derived variables
- Return type:
- Note:
Calculates potential temperature, virtual potential temperature, Obukhov length, CO2 mixing ratios, and density corrections. Temperature selection based on ‘whichtemp’ indicator.
- ecpet.ecpost.qc_mean_run(conf, intervals)¶
Execute quality control tests on mean flux and meteorological values.
- Parameters:
conf (object) – Configuration object with QC test parameters
intervals (pandas.DataFrame) – DataFrame with calculated mean values and fluxes
- Returns:
Updated DataFrame with QC flags and quality measures
- Return type:
- Note:
Implements tests including mean vertical wind check, integral turbulence characteristics, excluded sectors, footprint analysis, and excessive error detection.
- ecpet.ecpost.apply_flags(conf, intervals)¶
Apply quality control flag rules to flux measurements.
- Parameters:
conf (object) – Configuration object with flagging rules and thresholds
intervals (pandas.DataFrame) – DataFrame with QC test results and flags
- Returns:
Updated DataFrame with final flux flags and deleted bad values
- Return type:
- Note:
Uses configurable rules to combine individual test flags into final flux quality flags. Supports soft/hard flagging and flux interdependency rules.
- ecpet.ecpost.flags2_to_file(conf, intervals)¶
Write second-level quality flags to output file.
- Parameters:
conf (object) – Configuration object with output directory settings
intervals (pandas.DataFrame) – DataFrame containing second-level QC flags
- Note:
Creates flags2.dat file with mean-value QC test results and quality measures for postprocessing analysis.
- ecpet.ecpost.output_to_file(conf, intervals)¶
Write final quality-controlled flux data to output file.
- Parameters:
conf (object) – Configuration object with output settings
intervals (pandas.DataFrame) – DataFrame with final QC results and flux values
- Note:
Generates main output file with quality-controlled fluxes, flags, and supporting meteorological variables in standardized format.
- ecpet.ecpost.itc_u(zeta, ust, f)¶
Calculate integral turbulence characteristic for horizontal wind component.
- Parameters:
- Returns:
Integral turbulence characteristic for u-component
- Return type:
- Note:
Combined Thomas (2001) & Foken (1997) formulation. Uses different expressions for unstable, neutral, and stable conditions.
- ecpet.ecpost.itc_w(zeta, ust, f)¶
Calculate integral turbulence characteristic for vertical wind component.
- Parameters:
- Returns:
Integral turbulence characteristic for w-component
- Return type:
- Note:
Combined Thomas (2001) & Foken (1997) formulation. Accounts for atmospheric stability effects on vertical wind variance.
- ecpet.ecpost.itc_t(zeta)¶
Calculate integral turbulence characteristic for scalar quantities.
- ecpet.ecpost.postprocessor(conf, intervals)¶
Main postprocessing routine for eddy-covariance flux data.
- Parameters:
conf (object) – Configuration object with all processing parameters
intervals (pandas.DataFrame) – DataFrame with preprocessed flux measurements
- Returns:
DataFrame with final quality-controlled flux results
- Return type:
- Note:
Orchestrates complete postprocessing workflow: - Calculate derived meteorological variables - Execute mean-value quality control tests - Apply flux quality flagging rules - Generate output files