pynbody.halo.details.particle_indices.HaloParticleIndices#
- class pynbody.halo.details.particle_indices.HaloParticleIndices(particle_ids: ndarray[Any, dtype[int]] = None, boundaries: ndarray[Any, 2, int] = None)[source]#
Bases:
objectMethods
get_halo_number_per_particle(sim_length, ...)Return an array of halo numbers, one per particle.
get_particle_index_list_for_halo(halo_index)Get the index list for the specified halo index
- __init__(particle_ids: ndarray[Any, dtype[int]] = None, boundaries: ndarray[Any, 2, int] = None)[source]#
An IndexList represents abstract information about halo membership
particle_ids: array of particle IDs (mutually exclusive with halo_number_per_particle), length Npart_in_halos
boundaries: a Nhalo x 2 array of start and stop indices for each halo in the particle_ids array
NB throughout this class halo indices (zero-based, continuous integer numbers) are used, NOT halo numbers. For accessing halos by halo number, one must additionally use the HaloNumberMapper class to get the index before passing it in here.