Page MenuHomec4science

example_mkmap2dn.py
No OneTemporary

File Metadata

Created
Tue, Nov 12, 03:21

example_mkmap2dn.py

from pNbody import *
from pNbody import io
import mapping
nb = Nbody('../../examples/snap.dat',ftype='gadget')
mx = max(nb.rxyz())
kx = 256
ky = 256
kz = 256
pos = ( nb.pos + [mx,mx,mx] )/(2*mx) # between 0,1
#pos = pos*[kx,ky,kz]
pos = pos.astype(float32)
mat = mapping.mkmap2dn(pos,nb.mass,nb.mass,(kx,ky))
#io.WriteFits(mat,'qq.fits')
mplot(mat)

Event Timeline