Gridded & Climate Data

A raster with a time axis, a calendar and forty years in one file.

Weather forecasts, reanalyses and climate projections arrive as NetCDF, GRIB or Zarr: multidimensional arrays whose coordinates, units and calendars live in metadata that is easy to ignore and expensive to get wrong. These guides cover what those files contain, opening and subsetting them with xarray, the longitude and calendar conventions that shift or break a result without an error, area-weighted averages and anomalies, per-polygon time series and regridding, and the failures that appear once there are hundreds of files.

20 Steps in this path

The full path, in order

20 guides: the concepts underneath the work, then each task, then the errors that task produces. Work down, or jump to the step you need.

  1. CF Conventions Explained: How a NetCDF File Says What Its Numbers Mean cf conventions netcdf 🧭 Concept
  2. How to Open a NetCDF File in Python with xarray open netcdf python xarray ⚙️ How-To
  3. How to Select a Time Range and Location from an xarray Dataset xarray select time location ⚙️ How-To
  4. 0–360 or −180–180: Longitude Conventions in Gridded Data Explained longitude 0 360 convert 🧭 Concept
  5. How to Clip a NetCDF Grid to a Polygon in Python clip netcdf shapefile python ⚙️ How-To
  6. How to Convert NetCDF to GeoTIFF in Python netcdf to geotiff python ⚙️ How-To
  7. How to Resample a Gridded Time Series to Monthly or Annual Values xarray resample monthly ⚙️ How-To
  8. How to Calculate a Climatology and Anomalies with xarray climate anomaly xarray ⚙️ How-To
  9. How to Take an Area-Weighted Mean over a Latitude–Longitude Grid area weighted mean xarray latitude ⚙️ How-To
  10. How to Extract a Time Series per Polygon from a NetCDF Grid netcdf zonal statistics polygons time series ⚙️ How-To
  11. Regridding Explained: Bilinear, Conservative and Nearest for Gridded Data regridding explained conservative bilinear 🧭 Concept
  12. GRIB, NetCDF or Zarr: Choosing a Format for Gridded Data grib netcdf zarr difference 🧭 Concept
  13. How to Read GRIB Weather Forecast Data in Python read grib python cfgrib ⚙️ How-To
  14. How to Open Hundreds of NetCDF Files as One Dataset xarray open_mfdataset ⚙️ How-To
  15. Fixing xarray's "Did Not Find a Match in Any of xarray's Installed Backends" xarray did not find a match installed backends 🔧 Fix
  16. Fixing NetCDF Values That Look Wrong: scale_factor, _FillValue and Units netcdf scale_factor fill value wrong 🔧 Fix
  17. Fixing a NetCDF Map That Is Shifted, Flipped or Split at 180° netcdf map flipped shifted 🔧 Fix
  18. Fixing open_mfdataset That Is Slow, Hangs or Will Not Combine open_mfdataset slow 🔧 Fix
  19. Fixing cftime and Out-of-Bounds Datetime Errors in xarray cftime datetime error xarray 🔧 Fix

Topics this path covers

A path is a route; a topic is everything the site has on a subject. Open a topic to see the guides this path skips.

Other ways in