pvtend.load_climatology

pvtend.load_climatology(clim_path: str | Path, engine: str = 'netcdf4', prefer_smooth: bool = False) Dataset[source]

Load climatology, auto-detecting file layout.

Supports three layouts (most → least granular):

  1. Per-var-per-month files: raw {stem}_{month}_{var}.nc (or smoothed *_smooth.nc if prefer_smooth is True)

  2. Per-variable files: {stem}_{var}.nc

  3. Single merged file

Parameters:
  • clim_path – Path to climatology file or directory stem.

  • engine – NetCDF engine.

  • prefer_smooth – If True, prefer smoothed files; if False, prefer raw.

Returns:

xr.Dataset with climatology fields.

Raises:

FileNotFoundError – If no climatology files are found.