Fixes for gadget IO
This commit is contained in:
parent
689cc70daa
commit
46831ba9ab
4 changed files with 6 additions and 5 deletions
|
@ -98,12 +98,12 @@ def simpleWriteGadget(filename, positions, boxsize=1.0, Hubble=100, Omega_M=0.30
|
|||
|
||||
s.positions = positions
|
||||
|
||||
if velocities:
|
||||
if velocities is not None:
|
||||
s.velocities = velocities
|
||||
else:
|
||||
s.velocities = [np.zeros(positions[0].size,dtype=np.float32)]*3
|
||||
|
||||
if identifiers:
|
||||
if identifiers is not None:
|
||||
s.identifiers = identifiers
|
||||
else:
|
||||
s.identifiers = np.arange(positions[0].size, dtype=np.int64)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue