%%{init: {"theme": "neutral"}}%%
flowchart TB
A["AgERA5 daily weather<br/>Copernicus CDS"] -->|Ch 1| P["GRASS project and region<br/>matched to the AgERA5 grid"]
P -->|Ch 2| L["tmax_2015, tmin_2015<br/>one year, to learn the tools"]
P -->|Ch 3| R["six daily time series, 1979-2025<br/>tmax, tmin, tdew, ws10, srad, et0"]
A --> R
D["Elevation<br/>Copernicus GLO-90"] -->|Ch 4| E["elev<br/>elevation per AgERA5 cell"]
R -->|Ch 4| ET["etos, etrs<br/>reference ET per day,<br/>etos checked against et0"]
E --> ET
ET -->|Ch 5| EDDI["eddi_01m ... eddi_12m<br/>EDDI at four timescales"]
B["Districts<br/>geoBoundaries"] -->|Ch 6| DI["districts_r<br/>NTT districts"]
N["El Nino episodes<br/>NOAA RONI"] --> OUT
EDDI -->|Ch 6| OUT["EDDI by district, El Nino events<br/>animated map, exports"]
DI --> OUT
A -->|Ch 7| PR["precip, precip_das<br/>daily and dasarian rain"]
PR -->|Ch 7| ON["onset_cum<br/>start of the rainy season"]
DI --> ON
N --> ON
Climate analysis with PyGRASS
Climate analysis with PyGRASS
A tutorial series in seven chapters on climate analysis with GRASS 8.5, driven from Python and mostly through its pygrass library. The study case is daily AgERA5 weather for Nusa Tenggara Timur (NTT). The series computes reference evapotranspiration in GRASS and checks it against AgERA5’s own, builds the Evaporative Demand Drought Index (EDDI) from it, summarises EDDI by district, and dates the start of the rainy season.
It is written for readers who are at home with Python and with climate or GIS data, but new to GRASS.
The workflow
Each box is a source or a set of GRASS maps; each arrow is a step, labelled with the chapter that takes it.
Chapters
| Chapter | What you build | |
|---|---|---|
| 1 | Setup and data planning | A GRASS session started from Python, a project, a region that lines up with the AgERA5 grid, and one day of data imported and checked against its source |
| 2 | GRASS for climate data | One year of daily maximum and minimum temperature as GRASS time series; the region, raster algebra, masks, the temporal framework and parallel imports |
| 3 | Importing the record and checking it | Six AgERA5 variables for 1979-2025 as GRASS time series, with quality checks |
| 4 | Reference evapotranspiration in GRASS | Daily ASCE reference evapotranspiration for every day of the record, checked against AgERA5’s |
| 5 | The Evaporative Demand Drought Index | Monthly EDDI at four timescales, drought categories, and one event followed through them |
| 6 | Analysis and communication | EDDI by district, every El Nino of the record compared, an animated map, exports and a manifest |
| 7 | When the rains start | The start of the rainy season by BMKG’s rule and by a cumulative rule, and a test of whether it comes later in El Nino seasons |
Each chapter opens with “At a glance”: what it builds, what it needs from the chapters before it, and how long it took to run when it was tested.
Before you start
- Software: one conda environment,
environment.yml, with GRASS 8.5 from conda-forge. Chapter 1 explains the install on Windows, where the series was written and tested, and on Linux and macOS. - Data: AgERA5 from the Copernicus Climate Data Store, which needs a free account (Chapter 1), or a local AgERA5 archive if you have one. Downloads, the GRASS database and outputs go to folders you choose in
config.yml, outside any cloud-synced folder. - The notebooks: every chapter on this site is a Jupyter notebook shown with the outputs of the author’s run. The “View source” link at the foot of each page opens it on GitHub, where you can download it and run it yourself.
Where the numbers come from
Every number in the chapters comes from a cell output in the same chapter or from a row of the sources page, which says how it was measured or where it was read.
Bahasa Indonesia
The whole series is also available in Bahasa Indonesia.
Repository
Source, issues and history: github.com/osgeoid/pygrass-climate-analysis. Maintainer: Benny Istanto. Part of the tutorials of OSGeo Indonesia.