bitsMaskAll#

geetools.ee_image.ImageAccessor.bitsMaskAll(bits_info, classes=None, band=0)#

Create a mask using the bits information.

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

  • classes (Optional[list]) – name of the classes to use for the mask. If None it will use all classes in bits_info.

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

Returns:

an image with one band named ‘all_mask’, with 1s where ALL classes are present and 0s where not.

Return type:

ee.Image

Example

import ee, geetools

ee.Initialize()

ls = ee.Image("LANDSAT/LC09/C02/T1_L2/LC09_232090_20220508")
bits = {
    '5': 'Snow',
    '8-9': {
        '1': 'Low',
        '2': 'Medium',
        '3': 'High'
    }
}
# Detect confusion between snow and medium probability clouds
mask = ls.geetools.bitsMaskAll(bits, ['Snow', 'Medium'], 'QA_PIXEL')