pynbody.filt.Cuboid#
- class pynbody.filt.Cuboid(x1: float | str | UnitBase, y1: float | str | UnitBase = None, z1: float | str | UnitBase = None, x2: float | str | UnitBase = None, y2: float | str | UnitBase = None, z2: float | str | UnitBase = None)[source]#
Bases:
Filter
A filter that selects particles within a cuboid defined by two opposite corners.
Methods
__call__
(sim)Return a boolean mask indicating which particles are in the filter.
cubic_cell_intersection
(centroids)Compute the intersection with cubic cells with the specified centroids.
where
(sim)Return the indices of particles that are in the filter.
- __init__(x1: float | str | UnitBase, y1: float | str | UnitBase = None, z1: float | str | UnitBase = None, x2: float | str | UnitBase = None, y2: float | str | UnitBase = None, z2: float | str | UnitBase = None)[source]#
Create a cuboid filter.
If any of the cube coordinates
x1
,y1
,z1
,x2
,y2
,z2
are not specified they are determined asy1=x1
;z1=x1
;x2=-x1
;y2=-y1
;z2=-z1
.