fit_occupancy#
- anri.index.fit_occupancy(H, pred, ring_j, pos, scan, dims, k=64, n_iter=10, coarse=1, block_bytes=1000000000.0, qc=16, log=<built-in function print>, return_model=False, censor=0.0, accel=False)[source]#
Fit sparse occupancies: candidates per voxel, then MLEM.
With
coarse = G > 1the full candidate pass runs on voxels G times larger (the histogram’s rows summed in groups of G), and each voxel then scores only the 2k orientations its 3 x 3 coarse neighbourhood occupied most: about G^2 times cheaper for large maps, at the risk of missing a grain the coarse fit missed.- Parameters:
H (
Array|ndarray|bool|number|bool|int|float|complex) – [n_cells] histogram, rows lastpred (
tuple) – (eta, om, use, w), each [Nq, Nj] with Nq a multiple of qcring_j (
Array|ndarray|bool|number|bool|int|float|complex) – [Nj] ring of each predictionpos (
Array|ndarray|bool|number|bool|int|float|complex) – [Nv, 3] voxel positionsscan (
dict) – Rows and (b_e, b_o, n_e, n_o) of the histogram, plus n_beam for a beam profile (system(),beam_rows())dims (
tuple) – Rows and (b_e, b_o, n_e, n_o) of the histogram, plus n_beam for a beam profile (system(),beam_rows())k (
int, default:64) – Candidates per voxeln_iter (
int, default:10) – MLEM iterationscoarse (
int, default:1) – Coarse-to-fine factor (1: off)block_bytes (
float, default:1000000000.0) – Memory for one block of voxels’ system entriesqc (
int, default:16) – Orientations per chunk in passes over every orientationreturn_model (
bool, default:False) – Also return the fitted histogramA f, e.g. to compare with the data row by rowcensor (
float, default:0.0) – Empty bins censored above this many counts per bin in the MLEM (censored_ratio()); 0: plain MLEMaccel (
bool, default:False) – SQUAREM-accelerated MLEM (mlem())log (
Callable, default:<built-in function print>) – Progress messages
- Returns:
f, cand (
np.ndarray) – [Nv, k] occupancies and orientation indicesmodel (
np.ndarray) – [n_cells] the fitted histogram, if return_model