geoaquacrop_simulate
Gridded AquaCrop-OSPy simulation engine for the GeoAquaCrop toolchain.
Overview
geoaquacrop_simulate runs AquaCrop-OSPy over large regions in gridded format. It takes the harmonised input datasets produced by geoaquacrop_preprocess, runs an independent AquaCrop simulation for every grid cell in parallel, and writes per-cell seasonal and daily results. These outputs can then be visualized by geoaquacrop_visualize.
It is the middle stage of the GeoAquaCrop toolchain:
geoaquacrop_preprocess -> geoaquacrop_simulate -> geoaquacrop_visualize
(download & harmonise) (simulate & correct) (explore results)
| Stage | Description |
|---|---|
| Input validation | Checks that climate, soil, crop calendar and crop area files exist, share a grid, and cover the requested period; derives the simulated cells from the crop area mask |
| Per-cell simulation | Builds an AquaCrop Soil, Crop and weather series per cell, adjusts crop phenology to the local growing season, runs to termination |
| Parallel execution | Distributes cells over worker processes with a progress bar; per-cell failures are logged without stopping the run |
| Derived outputs | Adds seasonal water-balance metrics via a pluggable enricher registry |
| Yield correction | Optionally bias-corrects or calibrates yields against an observational reference, per year, at the reference's native support |
Supported crop types
Barley, Cassava, Cotton, Dry Bean, Maize, Paddy Rice (seasons 1 & 2), Potato, Sorghum, Soybean, Sugar Beet, Sugar Cane, Sunflower, Wheat (summer & winter)
Prerequisites
- Miniconda or Anaconda
- Python 3.11+
- Input datasets produced by geoaquacrop_preprocess
Installation
git clone https://github.com/aquacropos/geoaquacrop_simulate
cd geoaquacrop_simulate
conda create -n geoaquacrop python=3.11
conda activate geoaquacrop
python -m pip install -e .
Optional extras: .[dev] (pytest), .[correction] (geopandas, matplotlib), .[plots] (dash, plotly).
Quick start
Option A — edit and run the main script
Open src/geoaquacrop_simulate/run_aquacrop.py, set the configuration dictionary at the top of main(), and run:
conda activate geoaquacrop
python -m geoaquacrop_simulate.run_aquacrop
Key input arguments:
config_dict = {
'weather_path': '/path/to/geoaquacrop_preprocess/processed',
'soil_path': '/path/to/geoaquacrop_preprocess/processed',
'pheno_path': '/path/to/geoaquacrop_preprocess/processed',
'spam_path': '/path/to/geoaquacrop_preprocess/processed',
'start_date': '2008/01/01',
'end_date': '2010/12/31',
'crop': 'Maize',
'irrigation': 'rainfed', # 'rainfed' | 'irrigated'
'output_dir': 'outputs',
}
Option B — Python API
from geoaquacrop_simulate.run_aquacrop import main
summary_file, daily_file = main()
This is also how to run from an IDE console (Spyder, Jupyter). Do not execute module files directly — a module run as a script has no package context and its relative imports fail.
Output files
Written to <output_dir>/:
| File | Contents |
|---|---|
summary_results_<timestamp>.pkl |
One seasonal summary row per cell per season: yields, irrigation, harvest date, plus derived metrics |
daily_results_<timestamp>.pkl |
Daily water-balance and crop-growth series per cell |
logs/aquacrop_simulation_<timestamp>.log |
Run log, including per-cell failures |
yield_scaled.nc / yield_calibrated.nc |
Corrected yield grids, if a correction was configured |
Yield correction
Optional. Brings modelled yields into line with an observational reference, per year, aggregating the model up to the reference's native support (e.g. counties) rather than rasterising the observations.
'correction': {
'method': 'scale', # None | 'scale' | 'calibrate'
'reference_path': 'reference/high_plains_maize_reference.geojson',
'scale_mode': 'local', # 'global' | 'local'
'lever': 'canopy', # calibrate: 'canopy' (CCx) | 'biomass' (WP)
'reuse_results': 'latest', # scale an existing run with no simulation
}
See the yield correction guide for what each mode does and how to interpret the results.
Documentation
Full documentation: https://geoaquacrop-simulate.readthedocs.io
Tests
python -m pytest -q
License
Apache 2.0 — see LICENSE.
Metadata
Release files for geoaquacrop-simulate 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geoaquacrop_simulate-0.1.0.tar.gz | 53.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geoaquacrop_simulate-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 97.0 kB
Release files / geoaquacrop_simulate-0.1.0.tar.gz
| Download URL | geoaquacrop_simulate-0.1.0.tar.gz |
|---|---|
| Size | 53.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
03eaabf595b6883f6e851dffb9d16eea97931407c2859b099b2b422f8ff445c6
|
|
BLAKE2b-256 checksum How to use checksums |
9697ba5c15ba35ec410c90fb76db1e021c4613d85f3c5052f40655d2a4f4f743
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logRelease files / geoaquacrop_simulate-0.1.0-py3-none-any.whl
| Download URL | geoaquacrop_simulate-0.1.0-py3-none-any.whl |
|---|---|
| Size | 43.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d18a84c5319179a4f63b305a5a894a3b5a589ef9a25c85eb9a336c61c90cb5bd
|
|
BLAKE2b-256 checksum How to use checksums |
cfd1e9dcd3e6cbba2f48e4819349e0893383c59f3c168c48d7f127203fe3d733
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency log