Returns fraction of total flux in first argument, assuming all are magnitudes.

def fluxfrac(*mags):
    """Returns fraction of total flux in first argument, assuming all are magnitudes.
    """
    Ftot = 0
    for mag in mags:
        Ftot += 10**(-0.4*mag)
    F1 = 10**(-0.4*mags[0])
    return F1/Ftot