pisces.particles.base.ParticleDataset.cut_particles_to_bbox#

ParticleDataset.cut_particles_to_bbox(bbox: unyt_array, groups: list[str] = None, center: unyt_array = None)[source]#

Cut out particles outside the specified bounding box.

This method takes a cartesian bounding box defined by bbox and checks the positions of all particles in all groups. Particles that lie outside of the bounding box are removed from the dataset.

Parameters:
  • bbox (unyt_array) – A 2D unyt array of shape (2, D) defining the bounding box in D dimensions. The first row specifies the minimum corner, and the second row specifies the maximum corner. Units must be compatible with particle positions.

  • groups (list of str, optional) – List of particle group names to apply the cut to. If None, all groups are used.

  • center (unyt_array, optional) – An optional center point to offset the bounding box. If provided, the bounding box is shifted by this center before applying the cut. Units must be compatible with particle positions.