def convert_to_abmag(value, name):
    """
    Convert magnitude to AB magnitude

    Parameters
    ----------
    value : float
        Value of the band
    name : str
        Name of the band as stated in the GSC column name.
        Options are: 2MASS: tmassJMag, tmassHMag, tmassKsMag
        SDSS: SDSSgMag, SDSSiMag, SDSSzMag
        GSC: JpgMag, FpgMag, IpgMag

    """

    mag_constants = {
        'tmassJMag': 0.90,
        'tmassHMag': 1.37,
        'tmassKsMag': 1.85,
        'SDSSuMag': 0.0,
        'SDSSgMag': 0.0,
        'SDSSrMag': 0.0,
        'SDSSiMag': 0.0,
        'SDSSzMag': 0.0,
        'JpgMag': -0.055,
        'FpgMag': 0.24,
        'NpgMag': 0.48,
    }

    abmag = value + mag_constants[name]

    return abmag