Back to prompt library
Build a Drought Crop Parametric Trigger Validator — implementation
Linked challenge: Build a Drought Crop Parametric Trigger Validator
Prompt source
implementation69 lines11 sectionsNo variables1 code block
## Build
Validate agricultural drought parametric contracts by processing ERA5 reanalysis precipitation datasets. Verify threshold breaches against regional historical disaster declaration logs.
## User
Agricultural Microinsurance Designer
## Workflow
1. Formulate precipitation deficit parametric rules for regional crop growing periods.
2. Retrieve ERA5 accumulated precipitation time series via the Copernicus CDS API.
3. Correlate dry spells with OpenFEMA drought disaster declarations in target zones.
4. Generate a parametric trigger validation report with confidence metrics.
## Interface
Interactive parameter simulator notebook with exportable PDF evaluation manifests.
## Data
Download sample precipitation data via `cdsapi` client or use local mock ERA5 monthly averages.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Copernicus Climate Data Store client](https://raw.githubusercontent.com/ecmwf/cdsapi/master/README.rst)
Employs CDS API retrieve methods to fetch ERA5 reanalysis single levels for total precipitation.
## Tools
optuna, cdsapi, pandas, scipy.
Optuna optimizes parametric threshold levels to balance basis risk and trigger sensitivity across historical dry seasons.
Local statistical Python runtime; optional LLM for narrative summary generation.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Correctly ingests daily precipitation records from ERA5 schemas.
- Identifies rolling drought windows falling below critical millimeter thresholds.
- Produces basis risk comparison scores against historical loss benchmarks.
## Starter Examples
```json
[
{
"input": {
"zone": "Midwest-Zone-A",
"monthly_precip_mm": [
12,
8.5,
14.2
],
"trigger_threshold_mm": 20
},
"expected_output": {
"zone": "Midwest-Zone-A",
"trigger_met": true,
"cumulative_deficit_mm": 25.3,
"audit_status": "TRIGGER_CONFIRMED"
}
},
{
"input": {
"zone": "Midwest-Zone-B",
"monthly_precip_mm": [
35,
42.1,
28
],
"trigger_threshold_mm": 20
},
"expected_output": {
"zone": "Midwest-Zone-B",
"trigger_met": false,
"cumulative_deficit_mm": 0,
"audit_status": "NO_TRIGGER"
}
}
]
```
## Safety
Simulates parametric triggers for policy structuring; issues no live payouts or binding coverage commitments.
Use mock external writes. Require human review before any real deployment.