easysnowdata.processing.decode_udm2#

easysnowdata.processing.decode_udm2(udm2: DataArray | Dataset, *, band_dim: str = 'band') Dataset[source]#

Decode a PlanetScope UDM2 mask into named variables.

Parameters:
  • udm2 – The 8-band UDM2 raster as a DataArray with a band dimension (values 1–8 or 0-based), or a Dataset whose variables are already named band_1band_8.

  • band_dim – Name of the band dimension on a DataArray input.

Returns:

xarray.Datasetclear, snow, shadow, light_haze, heavy_haze and cloud as uint8 0/1 masks with CF flag attributes, confidence as a percentage, and unusable as the raw UDM1 bit field. The snow band is the one that is directly useful here.

Notes

Band order follows Planet’s UDM2 specification; the file itself carries no band names, so a raster with fewer than eight bands raises.