eebit.helpers#
Helper functions.
Attributes#
Functions#
|
Format a band name to be allowed in GEE. |
|
Format a bit key. |
|
Format a bit value. |
|
Format the bits information to match the expected. |
|
Check if a string can be converted to an integer. |
|
Check if a value is a string. |
Module Contents#
- eebit.helpers.format_bandname(name, replacement='_')[source]#
Format a band name to be allowed in GEE.
- Parameters:
name (str)
replacement (str)
- Return type:
str
- eebit.helpers.format_bit_value(value)[source]#
Format a bit value.
- Parameters:
value (str | dict)
- Return type:
dict
- eebit.helpers.format_bits_info(bits_info)[source]#
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.
}
- Parameters:
bits_info (dict) – the bits information.
- Return type:
dict
Example
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)
- eebit.helpers.is_int(value)[source]#
Check if a string can be converted to an integer.
- Parameters:
value (str | int)
- Return type:
bool