Skip to content

Rethink IMAP Lo coincidence type bitwise flagging #2621

@greglucas

Description

@greglucas

Currently it is a string for the coincidence_type variable in Lo L1B. With each bit of the string being a bit flag. The order of it is in (tof0, tof1, tof2, tof3, cksum, mode).

It would be better to have bitflags class that can be bitwise combined and evaluated to know exactly which bits mean what.

CoincidenceType(IntFlag):
    TOF0 = auto()
    TOF1 = auto()
    TOF2 = auto()
    TOF3 = auto()
    CKSUM = auto()
    MODE = auto()

# check TOF0
x & CoincidenceType.TOF0
# golden triple
GOLDEN_TRIPLE = CoincidenceType.TOF0 & CoincidenceType.TOF1 & CoincidenceType.TOF2 & CoincidenceType.TOF3 & CoincidenceType.CKSUM & CoincidenceType.MODE

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ins: LoRelated to the IMAP-Lo instrumentLevel: L1Level 1 processing

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions