pynbody.snapshot.new

Contents

pynbody.snapshot.new#

pynbody.snapshot.new(n_particles=0, order=None, class_=<class 'pynbody.snapshot.simsnap.SimSnap'>, **families) SimSnap[source]#

Create a blank SimSnap, with the specified number of particles.

Position, velocity and mass arrays are created and filled with zeros.

By default all particles are taken to be dark matter.

To specify otherwise, pass in keyword arguments specifying the number of particles for each family, e.g.

>>> f = new(dm=50, star=25, gas=25)

The order in which the different families appear in the snapshot is unspecified unless you add an ‘order’ argument:

>>> f = new(dm=50, star=25, gas=25, order='star,gas,dm')

guarantees the stars, then gas, then dark matter particles appear in sequence.