def maglimits(inst, wfs, site, iq, cc, sb, verbose=False):
    """
    Magnitude correction for conditions

    Parameters
        inst:       Instrument ['GMOS', 'F2']
        wfs:        Wavefront sensor ['OIWFS', 'PWFS1', 'PWFS2']
        site:       Gemini site ['N', 'S', 'mko', 'cpo']
        iq:         Image quality constraint ['20', '70', '85', 'Any']
        cc:         Cloud cover constraint [0.0, -0.3, -1.0, -3.0]
        sb:         Sky brightness constraint ['20', '50', '80', 'Any']
        verbose     Verbose output?

    Return
        magbright
        mangmax
    """
    magbright = 9999.0
    magfaint = 9999.0
    oifaint = {'GMOS-N': 16.95, 'GMOS-S': 15.65, 'F2': 16.15}
    oibright = {'GMOS-N': 6.0, 'GMOS-S': 6.0, 'F2': 6.0}
    p1faint = {'N': 15.65, 'S': 14.15}
    p1bright = {'N': 7.0, 'S': 7.0}
    p2faint = {'N': 15.65, 'S': 15.65}
    p2bright = {'N': 7.0, 'S': 7.0}
    dmag = 0.0
    dmcc = [0.0, -0.3, -1.0, -3.0]
    try:
        ii = ['50', '70', '80', 'Any'].index(cc)
    except Exception:
        if verbose:
            print("cc must be one of '50','70','80','Any'")
        return magbright, magfaint
    dmag += dmcc[ii]
    dmiq = [0.25, 0.0, -0.25, -1.25]
    try:
        ii = ['20', '70', '85', 'Any'].index(iq)
    except Exception:
        if verbose:
            print("iq must be one of '20','70','85','Any'")
        return magbright, magfaint
    dmag += dmiq[ii]
    dmsb = [0.1, 0.0, -0.1, -0.2]
    try:
        ii = ['20', '50', '80', 'Any'].index(sb)
    except Exception:
        if verbose:
            print("sb must be one of '20','50','80','Any'")
        return magbright, magfaint
    dmag += dmsb[ii]
    if verbose:
        print('Dmag = ', dmag)
    if wfs == 'OIWFS':
        try:
            magbright = oibright[inst] + dmag
            magfaint = oifaint[inst] + dmag
        except Exception:
            if verbose:
                print('Only GMOS-N, GMOS-S, and F2 have supported OIs.')
    elif wfs == 'PWFS1':
        magbright = p1bright[site] + dmag
        magfaint = p1faint[site] + dmag
    elif wfs == 'PWFS2':
        magbright = p2bright[site] + dmag
        magfaint = p2faint[site] + dmag
    return magbright, magfaint
