Exemplo n.º 1
0
def hfunc_Abel(n) :
    """
       Provides the parameters for an Abel integration of a Sersic function
       It returns a set of factors which depends on the input Sersic n
    """
    X = get_package_data("Abel_param.dat", asfile=False)
    ndata = X[:,0]
    nudata = X[:,1]
    kdata = X[:,2]
    a0data = X[:,3]
    a1data = X[:,4]
    a2data = X[:,5]
    a3data = X[:,6]
    a0 = interpolate.interp1d(ndata, a0data)
    a1 = interpolate.interp1d(ndata, a1data)
    a2 = interpolate.interp1d(ndata, a2data)
    a3 = interpolate.interp1d(ndata, a3data)
    k = interpolate.interp1d(ndata, kdata)
    nu = interpolate.interp1d(ndata, nudata)

    if (n > 10) | (n < 0.5) :
        print "Error: n is too high or too low here \n"
        return 0.,0.,0.,0.,0., 0.

    return nu(n), k(n), a0(n), a1(n), a2(n), a3(n)
Exemplo n.º 2
0
def hfunc_Trujillo(n) :
    from . import __path__ as path
    X = get_package_data("Trujillo.dat", asfile=False)
    ndata = X[:,0]
    nudata = X[:,1]
    pdata = X[:,2]
    h1data = X[:,3]
    h2data = X[:,4]
    h3data = X[:,5]
    h1 = interpolate.interp1d(ndata, h1data)
    h2 = interpolate.interp1d(ndata, h2data)
    h3 = interpolate.interp1d(ndata, h3data)
    p = interpolate.interp1d(ndata, pdata)
    nu = interpolate.interp1d(ndata, nudata)

    if (n > 10) | (n < 0.5) :
        print "Error: n is too high or too low here \n"
        return 0.,0.,0.,0.,0.

    return nu(n), p(n), h1(n), h2(n), h3(n)