velociraptor.swift.swift module

SWIFTsimIO integration.

This allows users to load the contents of various haloes as swiftsimio datasets in a computationally efficient way.

velociraptor.swift.swift.generate_spatial_mask(particles: velociraptor.particles.particles.VelociraptorParticles, snapshot_filename) → swiftsimio.mask[source]

Determines the mask defining the spatial region containing the particles of interest.

This uses r_max to define the extent of the region, so you will need to instantiate the VelociraptorParticles instance with an associated catalogue to use this feature, as it requires the knowledge of r_max.

Takes two arguments:

  • particles, the VelociraptorParticles instance,
  • snapshot_filename, the path to the associated SWIFT snapshot.

It returns:

  • mask, an object containing masks for all available datasets in the
    swift dataset.
velociraptor.swift.swift.generate_bound_mask(data: swiftsimio.reader.SWIFTDataset, particles: velociraptor.particles.particles.VelociraptorParticles) → collections.namedtuple[source]

Determines the mask defining the particles bound to the object of interest.

Takes two arguments:

  • data, a SWIFTDataset, which may be spatially masked,
  • particles, the VelociraptorParticles instance.

It returns:

  • mask, an object containing masks for all available datasets in the
    swift dataset.
velociraptor.swift.swift.to_swiftsimio_dataset(particles: velociraptor.particles.particles.VelociraptorParticles, snapshot_filename, generate_extra_mask: bool = False) → Union[swiftsimio.reader.SWIFTDataset, Tuple[swiftsimio.reader.SWIFTDataset, collections.namedtuple]][source]

Loads a VelociraptorParticles instance for one halo into a swiftsimio masked dataset.

Initially, this uses r_max to perform a spatial mask, and then returns the swiftsimio dataset and a secondary mask that may be used to extract only the particles that are part of the FoF group.

You will need to instantiate the VelociraptorParticles instance with an associated catalogue to use this feature, as it requires the knowledge of r_max.

Takes three arguments:

  • particles, the VelociraptorParticles instance,
  • snapshot_filename, the path to the associated SWIFT snapshot.
  • generate_extra_mask, whether or not to generate the secondary
    mask object that allows for the extraction of particles that are present only in the FoF group.

It returns:

  • data, the swiftsimio dataset
  • mask, an object containing masks for all available datasets in the
    swift dataset. The initial masking is performed on a spatial only basis, and this is required to only extract the particles in the FoF group as identified by velociraptor. This is only provided if generate_extra_mask has a truthy value.