prune#
- anri.index.prune(U, delta, B, rings, geom, lit, min_comp=None, keep=100000)[source]#
Keep the grid orientations whose completeness passes a threshold.
The default threshold is halfway between chance (the grid’s median completeness) and the grid’s maximum.
- Parameters:
U (
Array|ndarray|bool|number|bool|int|float|complex) – The grid and its worst-case spacing, fromanri.crystal.orientation_grid()delta (
float) – The grid and its worst-case spacing, fromanri.crystal.orientation_grid()B (
Array|ndarray|bool|number|bool|int|float|complex) – Seecompleteness_of()rings (
dict) – Seecompleteness_of()geom (
dict) – Seecompleteness_of()lit (
dict) – Seecompleteness_of()min_comp (
float|None, default:None) – Threshold; default halfway between chance and the maximumkeep (
int, default:100000) – At most this many are kept, the most complete first
- Returns:
kept (
np.ndarray) – [Nk] indices into U, most complete firstcomp (
np.ndarray) – [N] completeness of every grid orientationinfo (
dict) – “chance”, “min_comp”, “n_above” (orientations above the threshold) and “capped” (whether keep bit)