particles.ClusterParticles.write_to_gadget_file#

ClusterParticles.write_to_gadget_file(ic_filename, box_size, dtype='float32', overwrite=False, code=None)[source]#

Write the particles to a file in the HDF5 Gadget format which can be used as initial conditions for a simulation.

Parameters:
  • ic_filename (string) – The name of the file to write to.

  • box_size (float) – The width of the cubical box that the initial condition will be within in units of kpc.

  • dtype (string, optional) – The datatype of the fields to write, either ‘float32’ or ‘float64’. Default: ‘float32’

  • overwrite (boolean, optional) – Whether to overwrite an existing file. Default: False

  • code (string, optional) – If specified, additional information will be written to the file so that it can be identified by yt as belonging to a specific frontend. Default: None