def Mag2Counts(mag, mzero):
    """
    Convert magnitude to counts.
    
    Parameters
    ----------
    mag : magnitude [mag]
    
    mzero : magnitude zero point [counts]
    
    Returns
    -------
    counts : counts [counts]
    """
    exp = (mzero - mag) / 2.5
    counts = 10 ** exp
    return counts
