diive

Data Integration and Interactive Visualization Engine

diive is a Python library for time series processing and analysis with focus on ecosystem flux data. It provides:

  • Feature engineering — 8-stage composable pipeline for ML preparation

  • Gap-filling — Multiple ML methods (Random Forest, XGBoost) and meteorological matching

  • Quality control — Nine outlier detection methods and data validation

  • Flux post-processing — Multi-level workflow (Levels 2-4.2) for eddy covariance data

  • Visualization — 18 plot types for time series analysis

  • Analysis — Correlation, decomposition, seasonal trends, and more

Features

🔧 Feature Engineering

Automated pipeline: lags, rolling stats, differencing, EMA, polynomial terms, STL, timestamps, record number.

🤖 Gap-Filling
  • Random Forest

  • XGBoost

  • Meteorological matching

  • Linear interpolation

🎯 Quality Control
  • Absolute limits

  • Hampel filter (spike detection)

  • Local standard deviation

  • Z-score (global and rolling)

  • Local Outlier Factor

  • Manual removal and trim-low

📊 Visualization
  • Time series plots

  • Heatmaps (datetime and regular)

  • Hexbin density plots

  • Diel cycles and cumulative curves

  • Histograms and distribution-shift plots

  • Custom scatter and ridge plots

📈 Analysis
  • Correlation and autocorrelation

  • Trend decomposition

  • Seasonal and diurnal analysis

  • Harmonic analysis

  • Quantile analysis

Installation

Install the library from PyPI:

python -m pip install diive

For the desktop app, install "diive[gui]". On Windows, the app is also available as a download that runs without Python. Installation covers all options, including conda, the optional components and the development setup.

Quick Example

import diive as dv

TARGET = 'NEE_CUT_REF_orig'

# Load the bundled example data (CH-DAV, 30-minute records)
df = dv.load_exampledata_parquet()
df = df.loc['2020', [TARGET, 'Tair_f', 'VPD_f', 'Rg_f']].copy()

# Create engineered features
engineer = dv.gapfilling.FeatureEngineer(
    target_col=TARGET,
    features_lag=[-2, -1],
    features_rolling=[12, 24],
    vectorize_timestamps=True,
)
df_engineered = engineer.fit_transform(df)

# Gap-fill with Random Forest
model = dv.gapfilling.RandomForestTS(
    input_df=df_engineered,
    target_col=TARGET,
    n_estimators=100,
    random_state=42,
)
model.run(showplot_scores=False, showplot_importance=False)
gapfilled = model.results.gapfilled
print(f"R2 on the held-out test set: {model.results.scores_traintest['r2']:.3f}")

Next Steps

Support