Include all the stupid tools required for BORG analysis and plotting
This commit is contained in:
parent
81f4b642e4
commit
a56eb021c4
8 changed files with 401 additions and 2 deletions
14
python_sample/ramsesToArray.py
Normal file
14
python_sample/ramsesToArray.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
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.array(q)
|
||||
|
||||
with h5.File("particles.h5", mode="w") as f:
|
||||
f.create_dataset("particles", data=q.transpose())
|
Loading…
Add table
Add a link
Reference in a new issue