populations#

anri.index.populations(f, cand, U_list, ops, radius_deg, p=4, m=16, eps=0.02, vb=16384)[source]#

Group each voxel’s occupied candidate orientations into up to p populations.

A voxel’s m most occupied candidates above eps x its total are grouped greedily: the most occupied free candidate seeds a population, and every free candidate within radius_deg of it (over the Laue group) joins. Each population gets its share of the voxel’s occupancy, the occupancy-weighted mean of its members (aligned to the seed over the symmetry, then projected back to a rotation) and their weighted rms misorientation from that mean. Populations closer than the radius come out as one, with a larger spread: what the data cannot separate is reported as a mean and a spread. The spread includes the orientation grid’s own spacing (one orientation between grid points shares itself among the nearby points), so it is an upper bound.

Parameters:
Returns:

  • fraction (np.ndarray) – [Nv, p] share of each voxel’s occupancy (0 where absent), largest first

  • U (np.ndarray) – [Nv, p, 3, 3] mean orientations

  • spread (np.ndarray) – [Nv, p] rms misorientation from the mean, degrees

  • n (np.ndarray) – [Nv, p] candidates in each population