eebit.bithandler ================ .. py:module:: eebit.bithandler .. autoapi-nested-parse:: bit handler. Classes ------- .. autoapisummary:: eebit.bithandler.BitHandler Module Contents --------------- .. py:class:: BitHandler(bits, bit_length = None) Bit handler. Read / decode / write bits information encoded in Google Earth Engine images. :param bits: a dictionary containing the bits information in the following format: :type bits: dict :param {: "1-catname": "category", # option 1, one category "2-3-catname": { "1": "cat1", "2": "cat2", "3": "cat3", "4": "cat4" } # option 2, 2 or more bits. :param where "catname" is the name of the whole category represented by the group of bits: :param Example (Landsat 9 QA_PIXEL band: https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC09_C02_T1_L2#bands) :param bits = {: "3-Cloud": "Cloud", "4-Cloud Shadow": "Cloud Shadow", "5": "Snow", "7": "Water", "8-9": { "1": "Clouds Low Prob", "2": "Clouds Medium Prob", "3": "Clouds High Prob" }, "10-11": { "1": "Shadow Low Prob", "2": "Shadow Medium Prob", "3": "Shadow High Prob" } :param }: :param bit_length: the length of the .. py:method:: decode_image(image, band = 0) Decode a bit band of an ee.Image. The band of the image must correspond to the bits of the BitHandler object. :param image: the image that contains the band to decode. :param band: the bit band. If None it uses the first band of the image. :type band: optional :returns: A new image with one band per class. The image properties ara NOT passed to the new image. .. py:method:: from_asset(asset_id, band, bit_length = None) :classmethod: Create an instance of BitHandler using the bits information fetched with geestac. .. py:attribute:: _all_bits :value: None .. py:property:: all_bits :type: list List of all bits. .. py:attribute:: bit_length .. py:attribute:: bits