1.4 ERA5 Temperature daily ingestion, preprocessing, and quality control (QC)¶
This lesson covers the ingestion and QC for ERA5 temperature data (Mean, Min, Max), following the same robust pipeline as the CHIRPS rainfall data.
Objective: Ingest raw ERA5 temperature data, run quality assurance, standardize metadata, and prepare the data for the Ethiopia target grid and VECTRI ingestion.
Companion notebook: 08_era5_temp_ingestion_qc.ipynb (run order: after ERA5 download).
Prerequisites¶
| Requirement | Notes |
|---|---|
| Input | Path to ERA5 Temperature .nc (e.g. data/raw/era5/era5_temp_daily_1993_2024.nc) |
| Mask | Ethiopia target grid mask (from Notebook 04) |
| Working directory | Repository root |
Step 1 — Standardize naming and embed metadata¶
ERA5 provided via CDS involves several renaming steps to match VECTRI expectations: - t2m (2m temperature) -> t2m - mn2t (Min temperature) -> tmin (or keep as mn2t depending on VECTRI requirement) - mx2t (Max temperature) -> tmax
Metadata goals: - units = degC or K (VECTRI usually expects K or handles conversion) - long_name for each variable. - Coordinate naming: latitude, longitude.
Step 2 — Temporal QA¶
- Check for missing days or duplicates.
- ERA5 is generally complete, but yearly merges can introduce glitches at boundaries.
- Verify monotonicity of the time index.
Step 3 — Spatial Alignment (The "CHIRPS constraint")¶
VECTRI requires all climate inputs (Rain, Temp) to be on the exact same grid. - Use the CHIRPS Ethiopia mask defined in Lesson 4 to regrid the ERA5 data. - ERA5 (0.25°) typically aligns with CHIRPS (0.25°), but subtle offset shifts must be corrected using xarray.interp.
Step 4 — Historical Split & VECTRI Prep¶
To keep results consistent with CHIRPS: - Apply the same Calibration (1993-2016) and Validation (2017+) splits. - Format variables for VECTRI: - t2m -> tas or t2m - Apply fill values (-32767.0) - Standardize time units (hours since 1900-01-01).
Step 5 — Diagnostics¶
Diagnostic plots for temperature: - Annual mean Tmax/Tmin map. - Diurnal range (Tmax - Tmin) annual cycle. - Boxplots per month to detect outliers.
Next Steps¶
Once temperature is standardized, all ingredients are ready for: 1. VECTRI Baseline Simulation