bitsToBands#

geetools.ee_image.ImageAccessor.bitsToBands(bits_info, band=0)#

Convert a band encoded in bits into binary bands.

Parameters:
  • bits_info (dict) – bits encodings information (client-side only).

  • band (str | int) – name of the bit band. Defaults to first band.

Returns:

an image with one band per encoded bit.

Return type:

ee.Image

Example

import ee, geetools

ee.Initialize()

ls = ee.Image("LANDSAT/LC09/C02/T1_L2/LC09_232090_20220508")
bits = {
    '7': 'Water',
    '8-9': {
        '1': 'Low',
        '2': 'Medium',
        '3': 'High'
    }
}
decoded = ls.geetools.bitsToBands(bits, 'QA_PIXEL')