utils (deprecated)#

easysnowdata.utils#

Shared utility functions used across easysnowdata modules.

Credential handling lives in easysnowdata.auth and the cache directory in easysnowdata.config; the names kept here are thin delegates so the existing modules and tests keep working.

requires_earthengine

Decorator: raise CredentialError with setup instructions if EE credentials are missing.

requires_earthaccess

Decorator: raise CredentialError with setup instructions if EarthData credentials are missing.

initialize_earthengine

Initialise Google Earth Engine once, honouring EARTHENGINE_TOKEN if set.

suppress_stdout

Context manager that silences stdout for noisy third-party calls.

convert_bbox_to_geodataframe

Convert a bounding-box input of any supported type to a GeoDataFrame.

get_ee_grid_params

Build the pixel-grid kwargs required by xarray.open_dataset(engine="ee").

get_stac_cfg

Return an ODC-STAC band configuration dict for common sensors.

get_water_year_start

Return the start date of the water year containing date.

datetime_to_DOWY

Convert a date to the day-of-water-year (DOWY), 1-indexed.

datetime_to_WY

Convert a date to its water year (WY).

HLS_xml_url_to_metadata_df

Parse an HLS granule XML metadata URL into a one-row DataFrame.