easysnowdata.stations.load#

easysnowdata.stations.load(stations: Any = None, *, aoi: Any = None, variables: Any = ('swe', 'snwd'), time: Any = None, interval: str = 'daily', networks: Any = None, include_flags: bool = False, hemisphere: str = 'northern', daily_only: bool = True) Dataset[source]#

Station observations as a (station, time) Dataset.

Parameters:
  • stations – Station codes ("679_WA_SNTL"), native station ids ("679:WA:SNTL"), or the frame inventory() returned — which is the cheapest form, because it already says which network each station belongs to. None reads every station in aoi.

  • aoi – Any form easysnowdata.aoi.parse_aoi() accepts. Picks the stations when stations is None; ignored otherwise.

  • variables – Standardized types ("swe", "snwd", "temp", … — the vocabulary in easysnowdata.stations.networks.TYPES) or a network’s own native names. Default: SWE and snow depth. The returned data variables are always named for the type, whichever spelling went in; the native names that fed each one are in its native_variables attribute.

  • time – Any form easysnowdata.temporal.parse_time() accepts: "2023-10", ("2023-10-01", "2024-06-30"), "2023-10/2024-06". None asks each network for its whole record.

  • interval"daily" (default), "hourly", "monthly", … — the shared interval vocabulary. A network that cannot serve it raises its own {Client}Error rather than quietly resampling.

  • networks – Pin every station to this network (or these networks) instead of working out which one each code belongs to.

  • include_flags – Ask the clients for per-value quality flags. The Dataset keeps the values; use the clients directly when you need the flags themselves.

  • hemisphere – Which water year to attach: "northern" (1 October, default) or "southern" (1 April).

  • daily_only – When the stations come from aoi rather than being named, keep only the daily-or-better ones. Reading every periodic snow course in a large AOI is rarely what anyone wants.

Returns:

xarray.Dataset – Dims (station, time); one data variable per standardized type, each carrying units, long_name, native_variables and interval; station metadata (name, latitude, longitude, elevation_m, network, …) as non-dimension coordinates on station; water_year and dowy on time.

Examples

>>> import easysnowdata as esd
>>> obs = esd.stations.load(["679_WA_SNTL", "642_WA_SNTL"],
...                         variables=["swe", "snwd"],
...                         time="2023-10/2024-06")