pynbody.filt#
Filters are used to define subsets of simulations, especially (but not exclusively) spatial sub-regions.
The basic idea is that a Filter
object stores the abstract definition of the subset, and then it can be
called with a simulation to return a boolean array indicating which particles are in the subset. The implementation
of filters is designed to be as efficient as possible, and in many cases the selection is done in C with OpenMP
parallelisation. Additionally, if a simulation has a pynbody.kdtree.KDTree
built (via
pynbody.snapshot.simsnap.SimSnap.build_tree()
), then the selection can be done using the KDTree, which is considerably
faster for very large simulations.
Filters can be combined using the logical operators &, | and ~ to create more complex selections.
For a friendly introduction, see Subviews and Filters.
Classes
|
A filter that selects particles that are in both of two other filters. |
|
A filter that selects particles in between two spheres specified by radii r1 and r2 centered on cen. |
|
Selects particles in a bandpass of a named property |
|
A filter that selects particles within a cuboid defined by two opposite corners. |
|
A filter that selects particles within a disc of specified extent and thickness. |
|
A filter that selects particles based on their family. |
|
Base class for all filters. |
|
Selects particles exceeding a specified threshold of a named property |
|
Selects particles below a specified threshold of a named property |
|
A filter that selects particles that are not in another filter. |
|
A filter that selects particles that are in either of two other filters. |
|
A filter that selects particles in a disc between 2d radii r1 and r2 and thickness height. |
|
A filter that selects particles within radius of the point cen. |
Modules