Beispiel #1
0
def poten_clus(clus,zsrc,x,y):
    z = zeros((len(y),len(x)))
    kaps = float(clus[0][1])
    rsc = float(clus[0][2])
    zlens = float(clus[1][3])
    fudge = dratio(zlens,zsrc)
    print 'kaps,rsc',kaps,rsc
    for i in range(len(x)):
        for j in range(len(y)):
            z[j,i] = fudge * poten_NFW(x[i],y[j],kaps,rsc)
    for g in range(1,len(clus)):
        gal = clus[g]
        gx,gy = float(gal[1]), float(gal[2])
        zlens = float(gal[3])
        fudge = dratio(zlens,zsrc)
        sig = float(gal[4])
        print 'sigma', sig
        ell,pa = float(gal[5]),float(gal[6])
        reinst = 4*pi*(sig/3e5)**2 * 206265/.186 * fudge
        print 'pos',gx,gy
        print 'reinst,ell,pa',reinst,ell,pa
        for i in range(len(x)):
            for j in range(len(y)):
                z[j,i] += poten_SIE(x[i]-gx,y[j]-gy,reinst,ell,pa)
    return z
Beispiel #2
0
def poten_gal(gal,x,y):
    z = zeros((len(y),len(x)))
    re,ell,ell_pa = float(gal[1]), float(gal[2]), float(gal[3])
    print 'Einstein radius',re
    print 'ellipticity',ell
    print 'pos ang',ell_pa
    for i in range(len(x)):
        for j in range(len(y)):
            z[j,i] = poten_SIE(x[i],y[j],re,ell,ell_pa)
    return z