Added a skymapper

This commit is contained in:
Guilhem Lavaux 2014-06-06 09:42:44 +02:00
parent c1931db2a8
commit fb54034762
2 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,19 @@
import cosmotool as ct
import h5py as h5
L=600.
Nside=128
with h5.File("fields.h5", mode="r") as f:
density = f["density"][:]
N = density.shape[0]
ix = (np.arange(N)-0.5)*L/N - 0.5 * L
dist2 = (ix[:,None,None]**2 + ix[None,:,None]**2 + ix[None,None,:]**2)
flux = density / dist2
projsky1 = ct.spherical_projection(Nside, flux, 0, 52, integrator_id=1)
projsky0 = ct.spherical_projection(Nside, flux, 0, 52, integrator_id=0)

View File

@ -14,7 +14,7 @@ zz = ii[None,None,:].repeat(256,axis=0).repeat(256,axis=1).reshape(256**3)
d_high = ct.interp3d(xx, yy, zz, d, 64, periodic=True) d_high = ct.interp3d(xx, yy, zz, d, 64, periodic=True)
d_high = d_high.reshape((256,256,256)) d_high = d_high.reshape((256,256,256))
#proj0 = ct.spherical_projection(64, d, 0, 20, integrator_id=0, shifter=np.array([0.5,0.5,0.5])) proj0 = ct.spherical_projection(64, d, 0, 20, integrator_id=0, shifter=np.array([0.5,0.5,0.5]))
#proj1 = ct.spherical_projection(64, d, 0, 20, integrator_id=1) proj1 = ct.spherical_projection(64, d, 0, 20, integrator_id=1)
proj0_high = ct.spherical_projection(256, d_high, 0, 30, integrator_id=0, shifter=np.array([0.5,0.5,0.5])) proj0_high = ct.spherical_projection(256, d_high, 0, 30, integrator_id=0, shifter=np.array([0.5,0.5,0.5]))