Skip to content

Notebooks & scripts

Hands-on notebooks, download scripts, and pointers to sample data.
For structured workshop Markdown lessons (Day 1–6), use the Lessons tab in the site header and open each day in the sidebar — or jump straight to Day 6 overview for the observational pipeline.


Day 6 — Observational pipeline (workshop lessons)

Step Page
Overview Day 6 overview
Module 1 Observational climate pipeline & VECTRI baseline
Download CHIRPS rainfall (Ethiopia)
QC CHIRPS ingestion, preprocessing & QC
Grid / mask Ethiopia target grid & land mask
Standardize Standardization & VECTRI prep
Docs Documentation & reproducibility

Day 6 companion notebooks (in docs/day6/notebooks/)

Notebook Description
download_chirps_ethiopia.ipynb CHIRPS URL, download, clip, merge (Ethiopia)
chirps_ingestion_qc.ipynb QC, diagnostics, QC report
ethiopia_grid_land_mask.ipynb Target grid & land mask
observational_standardization_vectri.ipynb Regrid, mask, splits, export
documentation_reproducibility.ipynb Logging, manifest, report stub
chirps_open_dataset.ipynb Minimal xr.open_dataset pattern

Run these from the repository root in Jupyter or VS Code (see each Day 6 lesson for dependencies).


📓 Jupyter Notebooks

Interactive notebooks for hands-on learning. Launch them in Binder or run locally.

Binder

Python Fundamentals

Notebook Description Launch
Python Setup Environment setup and configuration Open
Python Basics Variables, data types, control flow Open
NumPy Array operations and numerical computing Open
Pandas DataFrames and tabular data Open
Matplotlib Data visualization and plotting Open

Geospatial & Climate Data

Notebook Description Launch
Xarray NetCDF and multidimensional arrays Open
GeoPandas Vector data and spatial operations Open
Cartopy Map projections and geospatial plotting Open
CHIRPS Download & Preprocessing Climate data acquisition workflow Open

VECTRI Modeling

Notebook Description Launch
VECTRI Single Location Demo Time series demonstration Open
VECTRI Explicit Equations Core equations implementation Open
VECTRI Physical Plots Equations with visualizations Open

📜 Download Scripts

Python scripts for automated data downloading. All scripts are in the docs/scripts/ folder.

Rainfall Data

Script Dataset Description
download_chirps.py CHIRPS Daily rainfall (0.05°, 1981-present)
download_arc2.py ARC2 Africa rainfall (0.1°, 1983-present)
download_tamsat.py TAMSAT Africa rainfall (0.0375°, 1983-present)
download_gfs_precip_forecast.py NCEP GFS Precipitation forecast (0.25°, 0-16 days)
download_ecmwf-hres_precip.py ECMWF HRES Precipitation forecast (0.25°, 0-10 days)
download_ecmwf-s2s-precip.py ECMWF S2S Sub-seasonal precipitation (1.5°, 0-46 days)
download_ecmwf_s2s_precip_daily_ensemble.py ECMWF S2S Ensemble Ensemble precipitation forecasts
download_c3s_seasonal_precip_ensmean_daily.py C3S SEAS5 Seasonal precipitation (0-7 months)
download_chc_cmip6_precip_daily.py CHC-CMIP6 Climate projections (2015-2100)

Temperature Data

Script Dataset Description
download_chirts.py CHIRTS Daily temperature (0.05°, 1983-2016)
download_era5-land-temp.py ERA5-Land Reanalysis temperature (0.1°, 1950-present)
download_era5-temp.py ERA5 Reanalysis temperature (0.25°, 1940-present)
download_gfs_temp_forecast.py NCEP GFS Temperature forecast (0.25°, 0-16 days)
download_ecmwf-hres_temp.py ECMWF HRES Temperature forecast (0.25°, 0-10 days)
download_ecmwf-s2s-temp.py ECMWF S2S Sub-seasonal temperature (1.5°, 0-46 days)
download_ecmwf_s2s_temp_daily_ensemble.py ECMWF S2S Ensemble Ensemble temperature forecasts
download_c3s_seasonal_temp_ensmean_daily.py C3S SEAS5 Seasonal temperature (0-7 months)
download_chc_cmip6_temp_daily.py CHC-CMIP6 Temperature projections (2015-2100)

Population & Soil Data

Script Dataset Description
download_afripop_worldpop.py AfriPop/WorldPop Population density (100m-1km)
download_worldpop_projections.py WorldPop Projections Population projections (2015-2030)
download_harmonized_world_soil_database.py HWSD Soil texture fractions (~1km)

📊 Sample Data

Pre-processed sample datasets for testing and learning (available in /data/samples/):

File Description Size
sample_chirps.nc CHIRPS rainfall for Ethiopia ~10 MB
sample_era5.nc ERA5 temperature for Ethiopia ~15 MB
ethiopia_admin.shp Administrative boundaries ~2 MB
example_sys5.nc VECTRI system configuration ~1 MB
example_data.nc VECTRI input data ~5 MB

🚀 Quick Start

Run Notebooks Locally

# Clone the repository
git clone https://github.com/YonSci/vectri-mkdocs.git
cd vectri-mkdocs

# Create environment
conda create -n vectri python=3.11 -y
conda activate vectri

# Install dependencies
pip install -r requirements.txt

# Launch Jupyter
jupyter lab

Run Download Scripts

# Example: Download CHIRPS data for Ethiopia
python docs/scripts/download_chirps.py \
    --start-date 2020-01-01 \
    --end-date 2020-12-31 \
    --lat-min 3 --lat-max 15 \
    --lon-min 33 --lon-max 48 \
    --output data/chirps_ethiopia_2020.nc

Need Help?

  • Check the Resources page for documentation
  • Review the Setup guide for installation issues
  • Ask instructors during workshop sessions
  • Collaborate with teammates!

In Partnership With