pyextal.LucyRichardson

Functions

sgnoise(img, m, g, A, delta, varB)

Calculates the signal-dependent noise.

DQE(img, varB, delta, A)

Calculates the Detective Quantum Efficiency (DQE).

chisq2d(exp, convolved, bval, m, g, A, delta, varB)

Calculates the 2D chi-squared value.

convolved2d(img, mtf)

Performs a 2D convolution using FFT.

lucy_Richardson(dp, mtf, background, niter[, varB, ...])

Performs Lucy-Richardson deconvolution.

Module Contents

pyextal.LucyRichardson.sgnoise(img, m, g, A, delta, varB)

Calculates the signal-dependent noise.

Parameters:
  • img (np.ndarray) – The input image.

  • m (float) – Mixing factor.

  • g (float) – Gain.

  • A (float) – A parameter related to Fano noise and conversion gain.

  • delta (float) – Squared percentage error in the gain image.

  • varB (float) – Variance of the background.

Returns:

The calculated signal-dependent noise.

Return type:

np.ndarray

pyextal.LucyRichardson.DQE(img, varB, delta, A)

Calculates the Detective Quantum Efficiency (DQE).

Parameters:
  • img (np.ndarray) – The input image.

  • varB (float) – Variance of the background.

  • delta (float) – Squared percentage error in the gain image.

  • A (float) – A parameter related to Fano noise and conversion gain.

Returns:

The calculated DQE.

Return type:

np.ndarray

pyextal.LucyRichardson.chisq2d(exp, convolved, bval, m, g, A, delta, varB)

Calculates the 2D chi-squared value.

Parameters:
  • exp (np.ndarray) – The experimental data.

  • convolved (np.ndarray) – The convolved model.

  • bval (np.ndarray) – The background values.

  • m (float) – Mixing factor.

  • g (float) – Gain.

  • A (float) – A parameter related to Fano noise and conversion gain.

  • delta (float) – Squared percentage error in the gain image.

  • varB (float) – Variance of the background.

Returns:

The calculated chi-squared value.

Return type:

float

pyextal.LucyRichardson.convolved2d(img, mtf)

Performs a 2D convolution using FFT.

Parameters:
  • img (np.ndarray) – The input image.

  • mtf (np.ndarray) – The modulation transfer function.

Returns:

The convolved image.

Return type:

np.ndarray

pyextal.LucyRichardson.lucy_Richardson(dp, mtf, background, niter, varB=0, delta=0, A=1, g=1, m=1)

Performs Lucy-Richardson deconvolution.

Parameters:
  • dp (np.ndarray) – The diffraction pattern.

  • mtf (np.ndarray) – The modulation transfer function.

  • background (np.ndarray) – The background of the diffraction pattern.

  • niter (int) – The number of iterations.

  • varB (float, optional) – Variance of the background. Defaults to 0.

  • delta (float, optional) – The squared percentage error in the gain image. Defaults to 0.

  • A (float, optional) – A parameter related to Fano noise and conversion gain, given by \(1 + F + \frac{1}{mG}\). Defaults to 1.

  • g (float, optional) – The gain. Defaults to 1.

  • m (float, optional) – The mixing factor. Defaults to 1.

Returns:

The deconvolved image.

Return type:

np.ndarray