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 = 'auto', 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, each network asked only for the ones it serves (FMI has no SWE); a variable named explicitly is passed on as it is, and a network that lacks it raises. 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: "auto" (default) gives each station its own hemisphere’s, from its latitude; "northern" (1 October) or "southern" (1 April) applies one to every station. See easysnowdata.stations.archive.load() for the mixed case.

  • 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, hemisphere, …) as non-dimension coordinates on station; water_year and dowy on time (on (station, time) when the stations span both hemispheres).

Examples

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

Examples using easysnowdata.stations.load#

Every station network in one call

Every station network in one call

SNOTEL and snow courses (USDA NRCS AWDB)

SNOTEL and snow courses (USDA NRCS AWDB)

California snow pillows and courses (CDEC)

California snow pillows and courses (CDEC)

British Columbia snow stations (DataBC)

British Columbia snow stations (DataBC)

Norwegian snow stations (NVE HydAPI)

Norwegian snow stations (NVE HydAPI)

Yukon snow stations (AquaCache)

Yukon snow stations (AquaCache)