pynbody.filt.geometry_selection.selection#
- pynbody.filt.geometry_selection.selection(pos_ar, region, parameters, wrap)#
OpenMP selection algorithm for spheres and cubes, optionally wrapped around the box.
- Parameters:
pos_ar (array_like) – The positions of the particles, with shape (N,3). Must be C-contiguous. The datatype can either be float32 or float64, represented by fused_float.
region (str) – The region to select particles from. Can be ‘sphere’ or ‘cube’.
parameters (array_like) – The parameters of the region. For a sphere, it is (x0, y0, z0, r_max), and for a cube, it is (x0, y0, z0, x1, y1, z1). Each parameter must be a float (will be cast to fused_float).
wrap (fused_float) – The size of the box to wrap around. If <0, no wrapping is done.