Added a skymapper
This commit is contained in:
parent
c1931db2a8
commit
fb54034762
2 changed files with 21 additions and 2 deletions
19
python_sample/build_nbody_skymap.py
Normal file
19
python_sample/build_nbody_skymap.py
Normal 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)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue