large_poisson

hcipy.util.large_poisson(lam, thresh=1000000.0)

Draw samples from a Poisson distribution, taking care of large values of lam.

At large values of lam the distribution automatically switches to the corresponding normal distribution. This switch is independently decided for each expectation value in the lam array.

Parameters
lamarray_like

Expectation value for the Poisson distribution. Must be >= 0.

threshfloat

The threshold at which the distribution switched from a Poisson to a normal distribution.

Returns
array_like

The drawn samples from the Poisson or normal distribution, depending on the expectation value.