orientation_mlem#

anri.index.orientation_mlem(d, U, B, rings, geom, bins, etacut=0.2, n_iter=20, qc=256, log=<built-in function print>, censor=0.0, return_model=False)[source]#

Fit one occupancy per orientation to a row-summed histogram by MLEM, and score each orientation.

The predictions of each orientation are computed afresh in every pass, so memory stays at a chunk of qc orientations whatever the number of orientations.

Parameters:
Returns:

  • occupancy (np.ndarray) – [Nq] global occupancy of each orientation (in the units of d over Lorentz x polarisation x F^2)

  • likelihood_ratio (np.ndarray) – [Nq] increase in the Poisson deviance if that orientation alone were removed, the others fixed: 2 sum_b [d_b log(mu_b / (mu_b - g a_b)) - g a_b] over observed bins (empty bins: the change in max(mu_b - censor, 0)). About chi-square with one degree of freedom for an orientation that is not there, so ~25 is 5 sigma.

  • model (np.ndarray) – [n_cells] the fitted histogram, if return_model