Gridded & climate data
NetCDF, GRIB and Zarr grids with a time axis: opening, subsetting, averaging and regridding them with xarray.
Everything on Spatial Workflow about gridded & climate data, in the order that usually works: understand the idea, then run the task, then fix it when it goes wrong. 20 guides in total.
One learning path runs through this topic — follow it if you would rather work through a route than pick a single guide.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
- NetCDF and Gridded Data Explained: Dimensions, Variables and Attributes netcdf explained
- CF Conventions Explained: How a NetCDF File Says What Its Numbers Mean cf conventions netcdf
- 0–360 or −180–180: Longitude Conventions in Gridded Data Explained longitude 0 360 convert
- Regridding Explained: Bilinear, Conservative and Nearest for Gridded Data regridding explained conservative bilinear
- GRIB, NetCDF or Zarr: Choosing a Format for Gridded Data grib netcdf zarr difference
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Open a NetCDF File in Python with xarray open netcdf python xarray
- How to Select a Time Range and Location from an xarray Dataset xarray select time location
- How to Clip a NetCDF Grid to a Polygon in Python clip netcdf shapefile python
- How to Convert NetCDF to GeoTIFF in Python netcdf to geotiff python
- How to Resample a Gridded Time Series to Monthly or Annual Values xarray resample monthly
- How to Calculate a Climatology and Anomalies with xarray climate anomaly xarray
- How to Take an Area-Weighted Mean over a Latitude–Longitude Grid area weighted mean xarray latitude
- How to Extract a Time Series per Polygon from a NetCDF Grid netcdf zonal statistics polygons time series
- How to Read GRIB Weather Forecast Data in Python read grib python cfgrib
- How to Open Hundreds of NetCDF Files as One Dataset xarray open_mfdataset
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
- Fixing xarray's "Did Not Find a Match in Any of xarray's Installed Backends" xarray did not find a match installed backends
- Fixing NetCDF Values That Look Wrong: scale_factor, _FillValue and Units netcdf scale_factor fill value wrong
- Fixing a NetCDF Map That Is Shifted, Flipped or Split at 180° netcdf map flipped shifted
- Fixing open_mfdataset That Is Slow, Hangs or Will Not Combine open_mfdataset slow
- Fixing cftime and Out-of-Bounds Datetime Errors in xarray cftime datetime error xarray
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
Related topics
Subjects that keep coming up alongside this one, most overlap first.