velociraptor.particles.particles module

Objects for the particles files. This includes:

  • catalog_groups
  • catalog_particles
  • catalog_parttypes

and their unbound variants.

The objects defined here are as follows:

VelociraptorGroups: This depends on the Catalogue object
and allows for users to find information about where in each file each group belongs.
VelociraptorParticles: This depends on VelociraptorGroups and itself allows
for the particles in a _single group_ to be loaded. Along with this, we also load the catalog_parttypes file for those selected particles.
class velociraptor.particles.particles.VelociraptorGroups(filename, catalogue: Optional[velociraptor.catalogue.catalogue.Catalogue])[source]

Bases: object

Groups object for velociraptor. Contains the information about where the groups start and stop in the catalog_particles file.

extract_halo(halo_index: int, filenames: Optional[Dict[str, str]] = None)[source]

Get a halo particles object for a given index into the catalogue (NOT the halo unique id). Filenames is either a dictionary with the following structure:

{
“particles_filename”: “…”, “parttypes_filename”: “…”, “unbound_particles_filename”: “…”, “unbound_parttypes_filename”: “…”,

}

or None, in which case we guess what the filename should be from the filename of the groups that has already been passed.

class velociraptor.particles.particles.VelociraptorParticles(particles_filename, parttypes_filename, offset: int, group_size: int, groups_instance: velociraptor.particles.particles.VelociraptorGroups)[source]

Bases: object

Velociraptor particles object, holds information on a single halo’s particles, including which IDs and particle types are in that halo. This provides extra post-processing options, such as splitting the IDs by particle type.

register_halo_attributes(catalogue: velociraptor.catalogue.catalogue.Catalogue, halo_index: int)[source]

Registers useful halo attributes to this object (such as the mass and radii of the halo).