Update cosmotool 2nd part

This commit is contained in:
Guilhem Lavaux 2018-07-19 15:11:23 +03:00
parent 64e05fc180
commit 003bc39d4a
70 changed files with 8708 additions and 0 deletions

View file

@ -0,0 +1,15 @@
import numpy as np
import sys
import h5py as h5
import cosmotool as ct
s = ct.loadRamsesAll(sys.argv[1], int(sys.argv[2]), doublePrecision=True, loadVelocity=True)
q = [p for p in s.getPositions()]
q += [p for p in s.getVelocities()]
q += [np.ones(q[0].size,dtype=q[0].dtype)]
q = np.array(q)
with h5.File("particles.h5", mode="w") as f:
f.create_dataset("particles", data=q.transpose())