eebit.helpers ============= .. py:module:: eebit.helpers .. autoapi-nested-parse:: Helper functions. Attributes ---------- .. autoapisummary:: eebit.helpers.BANNED_BAND_CHAR Functions --------- .. autoapisummary:: eebit.helpers.format_bandname eebit.helpers.format_bit_key eebit.helpers.format_bit_value eebit.helpers.format_bits_info eebit.helpers.is_int eebit.helpers.is_str Module Contents --------------- .. py:function:: format_bandname(name, replacement = '_') Format a band name to be allowed in GEE. .. py:function:: format_bit_key(bit) Format a bit key. .. py:function:: format_bit_value(value) Format a bit value. .. py:function:: format_bits_info(bits_info) Format the bits information to match the expected. Expected bit class format: { "1-1-catname": "category", # option 1, one category "2-2-catname": { "0": "cat1", "1": "cat2" }, # option 2, 2 or more bits. "3-4-catname": { "0": "cat1", "1": "cat2", "2": "cat3", "3": "cat4" } # option 2, 2 or more bits. } :param bits_info: the bits information. .. rubric:: Example .. code-block:: python from geetools.utils import format_bitmask bitmask = { '0-shadows condition': 'shadows', '1-2-cloud conditions': { '0': 'no clouds', '1': 'high clouds', '2': 'mid clouds', '3': 'low clouds' } } bitmask = format_bitmask(bitmask) .. py:function:: is_int(value) Check if a string can be converted to an integer. .. py:function:: is_str(value) Check if a value is a string. .. py:data:: BANNED_BAND_CHAR :value: ['.', '*', '?', '[', ']', '{', '}', '+', '$', '^', '+', '(', ')', '|']