API Reference
unpack_to_array(qa, product, flags='all')
Make a mask array with the same shape as qa with an additional axis
for all flag masks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qa |
np.array or int |
An array of any shape with an int-like dtype. If a single integer it will be coverted to a numpy array with length 1. |
required |
product |
str or dict |
A unique product identifer string. See A custom bit flag specification may also be used via a dictionary.
For example, below is an 8 bit qa flag where the 1st and 2nd flags are bits 0 and 1,
and the 3rd flag is spread across bits 4 and 5. Note bit 3 is not specified
so is ignored.
|
required |
flags |
list of strings or 'all' |
List of flags to return. If 'all', the default, then all available
flags are returned in the array. See available flags for each
product with |
'all' |
Returns:
Type | Description |
---|---|
np.array |
If only a single flag is set then the array shape will be the same
as qa.shape. If > 1 flag is set then an axis will be added in
position -1, with the shape as qa.shape + (n_flags,)
Ordering of the flag axis will be the same order of the |
unpack_to_dict(qa, product, flags='all')
Get mask arrays for the specified flags in a dictionary format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qa |
np.array or int |
An array of any shape with an int-like dtype. If a single integer it will be coverted to a numpy array with length 1. |
required |
product |
str or dict |
A unique product identifer string. See A custom bit flag specification may also be used via a dictionary.
For example, below is an 8 bit qa flag where the 1st and 2nd flags are bits 0 and 1,
and the 3rd flag is spread across bits 4 and 5. Note bit 3 is not specified
so is assumed unused.
|
required |
flags |
list of strings or 'all' |
List of flags to return. If 'all', the default, then all available
flags are returned in the array. See available flags for each
product with |
'all' |
Returns:
Type | Description |
---|---|
dict |
A dictionary where the flag names are keys and values are np.arrays of the flag mask with shape qa.shape. All entries will have the same shape. |
list_products(sensor='all')
Return a list of available products for QA unpacking.
'all', the default, returns the identifers for all products for all sensors
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sensor |
int |
Sensor ID. The default is 'all'. |
'all' |
Returns:
Type | Description |
---|---|
list |
List of product identifers |
list_qa_flags(product)
Return a list of QA flags configured for a specific product.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
product |
str |
A unique product identifer. See |
required |
Returns:
Type | Description |
---|---|
list |
List of QA flags. The descripters are used in the flag argument
of |
list_sensors()
Return a list of available sensors configured in the package.
Returns:
Type | Description |
---|---|
list |
List of sensor names |
InvalidProductSpec
Error class for when an invalid custom specification is passed to the product
argument.