histogram_pixels#
- anri.index.histogram_pixels(chunks, geom, ring_tth, tth_tol, om0, histograms, chunk)[source]#
Stream pixels into one or more histograms in a single pass over the data.
Each chunk’s pixel angles are computed once and added to every histogram, so the data are read once however many histograms (e.g. a fine row-summed lit map and a coarse per-row one) are wanted.
- Parameters:
chunks (
Iterable) – Iterable of (slow, fast, omega, row, value) NumPy arrays of at mostchunkpixels each, e.g.anri.io.stream_sparse()geom (
dict) – Geometry dict, seepixel_angles()ring_tth (
Array|ndarray|bool|number|bool|int|float|complex) – Seehistogram()tth_tol (
Array|ndarray|bool|number|bool|int|float|complex) – Seehistogram()om0 (
float) – First omega bin edgehistograms (
list) – One((b_e, b_o, n_e, n_o), n_rows)per histogram: eta and omega bin widths (degrees) and counts, and the number of rows (1 sums them all)chunk (
int) – Pixels per call (chunks are padded to it, so one compile)
- Returns:
list– One flat histogram [n_rings * n_e * n_o * n_rows] per entry ofhistograms