def normalize_band(band):
    """Turns a band name into a numeric 0 or 1"""
    if band in ['0', 'A']:
        return 0
    elif band in ['1', 'B']:
        return 1
    else:
        raise ValueError('invalid band number: {}'.format(band))
