Software Architecture
FREQCOR follows a modular architecture designed to compute spectral/cospectral correction factors from binned (co)spectra (e.g., EddyPro exports). The codebase is organized around a small set of orchestration modules that drive the processing chain, and a collection of scientific/processing modules that implement selection, LUT construction, correction-factor computation, and plotting.
Processing flow
FREQCOR_Start
|
v
FREQCOR_Main
|
|-> Configuration validation
| |- FREQCOR_validate
|
|-> Input reading (EddyPro / GEddySoft)
| |- FREQCOR_Read_EP
| |- FREQCOR_Read_GEddySoft
| |- FREQCOR_Read_TOF
|
|-> Computation pipeline
|
|-> Select (co)spectra used to build LUTs
| |- FREQCOR_Sel_general
| |- FREQCOR_Sel_stunst
|
|-> Cut-off frequency estimation and LUT construction
| |- FREQCOR_Sel_cof
| |- FREQCOR_cof
| |- FREQCOR_LUT_cof
|
|-> Correction factor estimation and LUT construction
| |- FREQCOR_Sel_CF
| |- FREQCOR_LUT_CF
|
|-> Apply correction factors to flux time series
| |- FREQCOR_Flux
|
|-> Output generation
|- FREQCOR_write_outputs
|- write_ini
|- FREQCOR_plot
Module categories
Core orchestration
FREQCOR_StartScript-like entry point (manual mode and batch patterns).
FREQCOR_MainHigh-level dispatcher that selects the read routine and orchestrates the run.
FREQCOR_ComputeMain computation chain once inputs are loaded.
Input and validation
FREQCOR_validateConfiguration checks and defaults.
FREQCOR_Read_EPReader for EddyPro exports (binned (co)spectra and associated files).
FREQCOR_Read_GEddySoft,FREQCOR_Read_TOFAlternative readers for GEddySoft/TOF-like datasets.
Processing and scientific core
Selection
FREQCOR_Sel_general: baseline filtering and preparation.FREQCOR_Sel_stunst: stability split (stable/unstable classes).FREQCOR_Sel_cof: selection for cut-off frequency estimation.FREQCOR_Sel_CF: selection for correction-factor estimation.
Cut-off frequencies and transfer functions
FREQCOR_cof: cut-off frequency estimation.FREQCOR_LUT_cof: cut-off frequency LUT construction.
Correction factors
FREQCOR_LUT_CF: correction factor LUT construction.FREQCOR_Ref_cospectrum_for_plotting: reference (co)spectra used for plotting.FREQCOR_Sensor_Separation: sensor-separation correction (spectral workflow).
Quality screening
FREQCOR_VM_flag: Vickers & Mahrt-type flagging utilities.
Output and diagnostics
FREQCOR_write_outputs,write_iniWriting LUTs, flux outputs, and configuration snapshots.
FREQCOR_plotDiagnostic plots for selection, transfer functions, LUTs, and correction factors.
Data flow
Inputs
A configuration (
.ini) file selects the reader and points to the binned (co)spectra and associated EddyPro (or GEddySoft) outputs.
Selection and quality screening
(Co)spectra are filtered using quality flags and threshold criteria.
LUT construction
Cut-off frequencies and correction factors are estimated and aggregated into LUTs (typically split into stable/unstable regimes).
Application to fluxes
The correction factor LUTs are applied to half-hourly flux time series.
Outputs
LUTs, corrected fluxes, and diagnostic plots are written to the output folder.