Pixel likelihood calculation

ctapipe.image.pixel_likelihood Module

Class for calculation of likelihood of a pixel expectation, given the pixel amplitude, the level of noise in the pixel and the photoelectron resolution. This calculation is taken from [denaurois2009].

The likelihood is essentially a poissonian convolved with a gaussian, at low signal a full possonian approach must be adopted, which requires the sum of contibutions over a number of potential contributing photoelectrons (which is slow). At high signal this simplifies to a gaussian approximation.

The full and gaussian approximations are implemented, in addition to a general purpose implementation, which tries to intellegently switch between the two. Speed tests are below:

neg_log_likelihood_approx(image, prediction, spe, ped) 29.8 µs per loop

neg_log_likelihood_numeric(image, prediction, spe, ped) 93.4 µs per loop

neg_log_likelihood(image, prediction, spe, ped) 59.9 µs per loop

TODO:

  • Need to implement more tests, particularly checking for error states

  • Additional terms may be useful to add to the likelihood

Functions

neg_log_likelihood_approx(image, prediction, …)

Calculate negative log likelihood for telescope.

neg_log_likelihood_numeric(image, …[, …])

Calculate likelihood of prediction given the measured signal, full numerical integration from [denaurois2009].

neg_log_likelihood(image, prediction, …[, …])

Safe implementation of the poissonian likelihood implementation, adaptively switches between the full solution and the gaussian approx depending on the prediction.

mean_poisson_likelihood_gaussian(prediction, …)

Calculation of the mean likelihood for a give expectation value of pixel intensity in the gaussian approximation.

mean_poisson_likelihood_full(prediction, …)

Calculation of the mean likelihood for a give expectation value of pixel intensity using the full numerical integration.

chi_squared(image, prediction, pedestal[, …])

Simple chi-squared statistic from Le Bohec et al 2008

Class Inheritance Diagram

Inheritance diagram of ctapipe.image.pixel_likelihood.PixelLikelihoodError