I created a couple utility functions for interpreting DQ masks and their flags.
interpret_dq_value(dq_value) will parse out a value from the DQ array into various bits and show their human-readable mnemonic as a set. This just wraps the interpret_dq_value from the pipeline.
res = interpret_dq_value(16387)
# res = {'DO_NOT_USE', 'RC', 'SATURATED'}
get_dqmask(dq_arr, bitvalues) will create a binary boolean mask from a DQ array. For instance, if someone wanted to find all pixels that were flagged as RC pixel as well as saturated within a DQ array, you would say:
I created a couple utility functions for interpreting DQ masks and their flags.
interpret_dq_value(dq_value)
will parse out a value from the DQ array into various bits and show their human-readable mnemonic as a set. This just wraps theinterpret_dq_value
from the pipeline.get_dqmask(dq_arr, bitvalues)
will create a binary boolean mask from a DQ array. For instance, if someone wanted to find all pixels that were flagged as RC pixel as well as saturated within a DQ array, you would say: