def f_nu_from_magAB(mag):
    """
    Calculate the flux f_nu from AB magnitudes.
    
    INPUT:
        AB magnitude. Be careful in what band. See iObserve too.
        
    RETURNS:
        f_nu in units of ergs/cm^2/s/Hz
    
    EXAMPLE:
        f_nu_from_magAB(0.)/1e-23
            3630.780547701003
    NOTES:
        1 Jansky = 1e-23 ergs/cm^2/s/Hz
        AB mag of 0 should be 3631 Jansky
        f_nu * nu = f_lambda * lambda
        See f_nu2f_lambda to change from f_nu to f_lambda
        https://www.astro.umd.edu/~ssm/ASTR620/mags.html
        http://roban.github.io/CosmoloPy/docAPI/cosmolopy.magnitudes-module.html#f_nu_lambda
    """
    f_nu = 10.**((mag+48.6)/(-2.5))
    return f_nu