particles.ClusterParticles.from_gadget_file#
- classmethod ClusterParticles.from_gadget_file(filename, ptypes=None)[source]#
Read in particle data from a Gadget (or Arepo, GIZMO, etc.) snapshot
- Parameters:
filename (
string
) – The name of the file to read from.ptypes (
string
orlist
ofstrings
, optional) – The particle types to read from the file, either a single string or a list of strings. If None, all particle types will be read from the file.
Examples
>>> from cluster_generator import ClusterParticles >>> ptypes = ["gas", "dm"] >>> particles = ClusterParticles.from_gadget_file("snapshot_060.h5", ptypes=ptypes)