Flux Gap Filling Tool

Overview
--------
This tool provides two primary gap-filling methods for flux data (e.g., ET, H, LE):

1. MDS (Marginal Distribution Sampling):
   - Uses seasonal and environmental data windows to estimate missing flux values.

2. RF (Random Forest based Gap Filling):
   - Trains a Random Forest regressor on non-missing data to predict missing flux values.
   - Enforces physical constraints at night (fluxes forced to 0 if predicted positive).
   - Falls back on MDS for rows with insufficient predictor data.

After processing, the tool provides separate endpoints to display individual plots:
   - Time Series Plot: /plots/time_series/
   - Fingerprint Plot: /plots/fingerprint/
   - RF Feature Importance Plot: /plots/feature_importance/

All figures include x- and y-axis lines with tick marks in bold font and no grid lines.
Axis labels also include units (e.g. “ET (mm/hour)”, “H (W/m²)”, “LE (W/m²)”).

Data Format
-----------
The tool accepts an XLSX file with two sheets:
   - Sheet1: Must include columns "date", "time", and flux variables (ET, H, LE, etc.)
   - Sheet2: Must include columns "date", "hour", and environmental variables (sr, vpd, at, rh, ws, etc.)

Contact
-------
Dr. Srinivasa Rao Peddinti
Department of Land, Air, and Water Resources
University of California, Davis
Email: speddinti@ucdavis.edu