interpret_bit_flags
- stdatamodels.dqflags.interpret_bit_flags(bit_flags, flip_bits=None, mnemonic_map=None)
Convert input bit flags to a single integer value (bit mask) or None.
Deprecated since version 3.0: Use astropy.nddata.bitmask.interpret_bit_flags instead. Note that the
mnemonic_mapparameter is namedflag_name_mapin the astropy version. Note also that the astropy version does not support whitespace between flags, e.g., “DO_NOT_USE+WARM” will work as expected, but “DO_NOT_USE + WARM” will not.Wraps astropy.nddata.bitmask.interpret_bit_flags, allowing the bit mnemonics to be used in place of integers.
- Parameters:
- bit_flagsint, str, list, None
See astropy.nddata.bitmask.interpret_bit_flags. Also allows strings using Roman mnemonics
- flip_bitsbool, None
See astropy.nddata.bitmask.interpret_bit_flags.
- mnemonic_mapdict
Dictionary associating the mnemonic string to an integer value representing the set bit for that mnemonic.
- Returns:
- bitmaskint or None
Returns an integer bit mask formed from the input bit value or None if input
bit_flagsparameter is None or an empty string. If input string value was prepended with ‘~’ (orflip_bitswas set to True), then returned value will have its bits flipped (inverse mask).