pynbody.filt.Or#
- class pynbody.filt.Or(f1, f2)[source]#
Bases:
Filter
A filter that selects particles that are in either of two other filters.
You can construct this filter conveniently using the
|
operator, i.e.>>> f = f1 | f2
returns a filter that selects particles that are in either
f1
orf2
.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.
- cubic_cell_intersection(centroids)[source]#
Compute the intersection with cubic cells with the specified centroids.
This is currently used by the swift loader to figure out which cells to load
- where(sim: snapshot.SimSnap)#
Return the indices of particles that are in the filter.
This is a convenience method that is equivalent to np.where(f(sim)) but may be more efficient for some filters.