easysnowdata.processing.binary_snow#

easysnowdata.processing.binary_snow(da: DataArray, *, product: str = 'MOD10A1', threshold: int = 40, keep_flags_as_nan: bool = True) DataArray[source]#

Turn a MODIS/VIIRS snow-cover band into a 0/1 snow mask.

Parameters:
  • da – The raw band: an NDSI percentage byte (MOD10A1, MOD10A1F, VNP10A1, VNP10A1F) or the 8-day maximum extent (MOD10A2/MYD10A2).

  • product – Which of those it is; only the A2 products use the class table.

  • threshold – NDSI percentage at or above which a pixel counts as snow (default 40, NSIDC’s usual cut-off). Ignored for the A2 products.

  • keep_flags_as_nan – Leave cloud, night, water and fill pixels as NaN (default) rather than calling them “not snow”.

Returns:

xarray.DataArray1 where snow, 0 where not, NaN where the pixel says nothing.