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_1…band_8.band_dim – Name of the band dimension on a DataArray input.
- Returns:
xarray.Dataset–clear,snow,shadow,light_haze,heavy_hazeandcloudasuint80/1 masks with CF flag attributes,confidenceas a percentage, andunusableas 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.