pytesmo icon indicating copy to clipboard operation
pytesmo copied to clipboard

Add active-bit(s) operator to masking adapter

Open wpreimes opened this issue 2 years ago • 1 comments

Data flags often operate on a bit basis. Currently pytesmo includes pre-defined operators to filter decimal numbers

_op_lookup = {
    "<": operator.lt,
    "<=": operator.le,
    "==": operator.eq,
    "!=": operator.ne,
    ">=": operator.ge,
    ">": operator.gt,
}

Task: add bit operators (e.g. active_bits, inactive_bits) to filter / mask observations where in a (flag) column, a selection of bit(s) in the binary representation of the column value is/are (in)active - e.g. a wrapper for https://numpy.org/doc/stable/reference/generated/numpy.unpackbits.html

wpreimes avatar May 13 '22 13:05 wpreimes