easysnowdata.stations.clients.CanSWEClient#

class easysnowdata.stations.clients.CanSWEClient(path: str | Path | None = None, record_id: str | None = None, cache_dir: str | Path | None = None, session: Any = None, timeout: int = 120, max_retries: int = 3, backoff: int = 4)[source]#

Bases: CanSWEStyleClient

Client for the CanSWE netCDF (latest Zenodo version, cached locally).

No credentials are needed.

Parameters:
  • path (str or Path, optional) – Use this local .nc instead of resolving / downloading.

  • record_id (str, optional) – Pin a Zenodo record (e.g. "19075529" for v8). Default: the latest version of concept record 4734371.

  • cache_dir (str or Path, optional) – Override easysnowdata.config.cache_dir("stations", "canswe").

  • session (requests.Session, optional) – Session used for the Zenodo API call.

  • timeout (int) – Shared retry-loop settings (see _common.request_with_retries).

  • max_retries (int) – Shared retry-loop settings (see _common.request_with_retries).

  • backoff (int) – Shared retry-loop settings (see _common.request_with_retries).

NAME: str = 'canswe'#

Network key, also the cache sub-directory name.

CONCEPT_RECID: str = '4734371'#

Zenodo concept record id (resolves to the latest version).

FILE_SUFFIX: str = '.nc'#

Suffix of the Zenodo file to fetch (".nc" or ".zip").

DATASET_URL: str = 'https://doi.org/10.5281/zenodo.4734371'#

Landing page of the dataset (used as station_url fallback).

ERROR#

alias of CanSWEError

VARIABLES: dict[str, dict] = {'den': {'description': 'Bulk snow density derived as snw / snd.', 'name': 'Bulk Snow Density', 'notes': 'Derived by the dataset authors, only where both SWE and depth exist; returned as % (kg m-3 ÷ 1000 × 100).', 'output_units': '%', 'scale': 0.1, 'source': 'ECCC CanSWE (Vionnet et al. 2021) — https://doi.org/10.5281/zenodo.4734371', 'type': 'density', 'units': 'kg m-3'}, 'snd': {'description': 'Depth of snow on the ground.', 'name': 'Snow Depth', 'notes': 'Stored in m; returned in cm (× 100).', 'output_units': 'cm', 'scale': 100.0, 'source': 'ECCC CanSWE (Vionnet et al. 2021) — https://doi.org/10.5281/zenodo.4734371', 'type': 'snwd', 'units': 'm'}, 'snw': {'description': 'Water equivalent of snow cover (SWE).', 'name': 'Snow Water Equivalent', 'notes': 'Stored as kg m-2 (= mm of water); returned in cm (× 0.1).', 'output_units': 'cm', 'scale': 0.1, 'source': 'ECCC CanSWE (Vionnet et al. 2021) — https://doi.org/10.5281/zenodo.4734371', 'type': 'swe', 'units': 'kg m-2'}}#

Native variables (copy of VARIABLES_TEMPLATE with source).

Examples using easysnowdata.stations.clients.CanSWEClient#

Canadian historical SWE (CanSWE)

Canadian historical SWE (CanSWE)