Imported the projection library for python

This commit is contained in:
Guilhem Lavaux 2014-06-04 14:00:54 +02:00
parent ae040d15ee
commit 1693c222e1
4 changed files with 676 additions and 3 deletions

View file

@ -1,4 +1,5 @@
from _cosmotool import *
from _project import *
from grafic import writeGrafic, writeWhitePhase, readGrafic
from borg import read_borg_vol
from cic import cicParticles

View file

@ -42,8 +42,9 @@ def writeGrafic(filename, field, BoxSize, scalefac, **cosmo):
bad, bad, bad,
scalefac,
cosmo['omega_M_0'], cosmo['omega_lambda_0'], 100*cosmo['h'], checkPoint))
checkPoint = 4*Ny*Nz
for i in xrange(Nx):
checkPoint = 4*Ny*Nx
field = field.reshape(field.shape, order='F')
for i in xrange(Nz):
f.write(struct.pack("I", checkPoint))
f.write(field[i].astype(np.float32).tostring())
f.write(struct.pack("I", checkPoint))