Skip to content

2. Ethiopia target domain, target grid definition, and land mask

Objective: Define a single spatial framework (domain, CHIRPS-aligned 0.25° grid, land mask) reused for observations, seasonal forecasts, and VECTRI so layers align without ad hoc resampling drift.

Companion notebook: 04_ethiopia_grid_land_mask.ipynb


Prerequisites

pip install xarray numpy geopandas shapely regionmask matplotlib netCDF4
Input Role
Ethiopia bounding box With buffer (~0.25–0.5°) so regridding kernels do not edge-truncate signal
Country boundary e.g. Natural Earth (notebook), GADM, or FAO GAUL — document source
Reference CHIRPS grid (optional) Snap target lat/lon to native CHIRPS nodes

Step 1 — Analysis domain (bounding box + buffer)

  1. Choose core Ethiopia limits (example): N=15°, S=3°, W=33°, E=48°.
  2. Add buffer on each side for regridding (e.g. 0.5°).
  3. Record CRS: WGS84 (EPSG:4326) for lat/lon grids.

Store in a small JSON config:

{
  "name": "ethiopia_analysis_domain_wgs84",
  "north": 15.5,
  "south": 2.5,
  "west": 32.5,
  "east": 48.5,
  "buffer_deg": 0.5,
  "crs": "EPSG:4326"
}

Step 2 — Standard target grid (CHIRPS-aligned 0.25°)

CHIRPS p25 uses a regular 0.25° grid. For strict alignment:

  • Either subset lat/lon from an existing CHIRPS file over your domain, or
  • Build lat = arange(S_snap, N_snap + res/2, res), lon = arange(W_snap, E_snap + res/2, res) snapped to CHIRPS node convention (e.g. offsets like .125 / .875 depending on product — verify against your file’s coordinates).

The notebook shows snapping using your actual CHIRPS coordinates.


Step 3 — Land mask on the target grid

  1. Load Ethiopia polygon (multipolygon safe).
  2. Use regionmask or rasterize polygon onto target lat/lon.
  3. Produce binary mask 1 = land / include, 0 = exclude (ocean, outside border — your convention).

Optional refinements for VECTRI: mask by elevation or coarse land–water if your workflow requires; document exclusions.


Step 4 — Apply consistently

All datasets (CHIRPS QC, ERA5-Land/CHIRTS, C3S seasonal, VECTRI inputs) should:

  1. Be interpolated or aggregated to this target grid (conservative remapping for precip is preferred where possible).
  2. Be multiplied by the land mask (or masked with NaN) so ocean pixels are not used in domain averages.

Step 5 — Save reusable grid + mask assets

File Content
ethiopia_target_grid.nc 1D lat, lon, optional 2D mask with metadata
ethiopia_domain_config.json bbox, buffer, resolution, CRS, data sources
ethiopia_land_mask.nc 2D mask(lat, lon) aligned to grid

Include attributes: grid_resolution_deg, boundary_source, created, author.


Step 6 — Consistency checks

  • lat strictly increasing, lon order documented (–180…180 vs 0…360).
  • All arrays share same (lat, lon) shape.
  • Mask fraction on land plausible (~not 100% ocean).
  • Plot mask and overlay boundaries for visual QA.

Step 7 — Document assumptions

In ethiopia_domain_README.md (or report section), state explicitly:

  • Coastal pixels: include or exclude partial ocean?
  • Islands / lakes: policy
  • Disputed borders: which boundary product used; not a political statement — a data provenance choice

Next

3. Observational standardization and preparation for downstream use.

In Partnership With