A portable Codex skill for comparing two thermal-dissipation sapflow sensors, inspecting raw dT/mV signals, recalculating sap velocity, and comparing dTmax methods from TOA5-style logger data.
- Reads TOA5-style
.datfiles with explicit timestamp and numeric coercion. - Compares two configurable raw dT/mV channels over an absolute analysis window.
- Calculates Granier-type sap velocity from raw dT.
- Supports daily-max interpolation, predawn-window maximum, and optional logger-saved dTmax.
- Produces auditable CSV files, PNG plots, and report-ready summaries.
- Keeps data paths, channel names, sensor labels, and saved dTmax fields configurable.
.
├── SKILL.md
├── agents/
│ └── openai.yaml
├── references/
│ └── workflow.md
├── scripts/
│ ├── plot_tdp_delta_analysis_window.py
│ └── compute_tdp_sap_velocity.py
└── tests/
└── test_scripts.py
- Python 3.10 or newer
- Matplotlib
Install the runtime dependency with:
python -m pip install matplotlibClone this repository into your Codex skills directory so that SKILL.md is at the top level of the installed skill:
git clone <repository-url> <codex-skills-directory>/tdp-sapflow-analysisBefore analysis, the skill asks only for missing items:
- Data file or dataset.
- Sensor A and Sensor B column mapping.
- Absolute analysis start and end timestamps.
- Raw dT comparison, sap-velocity calculation, or both.
- dTmax method selection.
- Whether available logger-saved dTmax columns should be included.
The bundled scripts use portable defaults:
| Purpose | Default field | Override option |
|---|---|---|
| Sensor A raw dT | sensor_a_dt |
--sensor-a-col |
| Sensor B raw dT | sensor_b_dt |
--sensor-b-col |
| Sensor A saved dTmax | sensor_a_saved_dtmax |
--sensor-a-saved-dtmax-col |
| Sensor B saved dTmax | sensor_b_saved_dtmax |
--sensor-b-saved-dtmax-col |
Pass the actual dataset fields at runtime when they differ from these defaults.
From the repository root:
python scripts/plot_tdp_delta_analysis_window.py --data path/to/data.dat --analysis-start "YYYY-MM-DD HH:MM:SS" --analysis-end "YYYY-MM-DD HH:MM:SS" --sensor-a-col sensor_a_dt --sensor-b-col sensor_b_dtDefault outputs:
tdp_delta_analysis_window.pngtdp_delta_analysis_window_summary.csv
python scripts/compute_tdp_sap_velocity.py --data path/to/data.dat --analysis-start "YYYY-MM-DD HH:MM:SS" --analysis-end "YYYY-MM-DD HH:MM:SS" --methods method1_daily_max_interpolated method2_predawn_window_maxAvailable dTmax methods:
method1_daily_max_interpolatedmethod2_predawn_window_maxlogger_saved_dtmax
Default outputs:
tdp_sap_velocity_results.csvtdp_dtmax_summary.csvtdp_sap_velocity_summary.csvtdp_methods_by_sensor.pngtdp_sensors_by_method.png
Run the bundled tests from the repository root:
python -m unittest discover -s tests -v