def get_bitmask(spectrum):
    """
    Return a bitmask array, given the spectrum. 
    The reason for this is because the BHM pipeline produces AND/OR bitmasks and
    the MWM pipeline produces a single bitmask.
    """
    try:
        # BHM/BOSS bitmask
        return spectrum.meta["bitmask"]["or_mask"]

    except:
        # MWM
        return spectrum.meta["bitmask"]