ptypy.engines.utils.projection_update_generalized#

ptypy.engines.utils.projection_update_generalized(diff_view, a, b, c, pbound=None)#

Generalized projection update of a single view using its associated pods. Updates on all pods’ exit waves. We assume here that the current state is held in pod.exit, while the product of pod.probe & pod.object hold the state after overlap constraint has been applied. With O() denoting the overlap constraint and F() denoting the Data/Fourier constraint, the general projection update can be expressed with four coefficients

\[\psi^{j+1} = [x 1 + a O + b F (c O + y 1)](\psi^{j})\]

However, the coefficients aren’t all independent as the sum of x+a+b and d+y must be 1, thus we choose

\[x = 1 - a - b\]

and

\[y = 1 - c\]

The choice of a,b,c should enable a wide range of projection based algorithms.

For memory efficiency, this projection update includes the Fourier update which is why the power bound mechanism is included but deactivated by default.

Parameters:
  • diff_view (View) – View to diffraction data

  • a (float) – Coefficients for Overlap, Fourier and Fourier * Overlap constraints, respectively

  • b (float) – Coefficients for Overlap, Fourier and Fourier * Overlap constraints, respectively

  • c (float) – Coefficients for Overlap, Fourier and Fourier * Overlap constraints, respectively

  • pbound (float, optional) – Power bound. Fourier update is bypassed if the quadratic deviation between diffraction data and diff_view is below this value. If None, fourier update always happens.

Returns:

err_fmag, err_exit

  • err_fmag, Fourier magnitude error; quadratic deviation from root of experimental data

  • err_exit, quadratic deviation between exit waves before and after projection

Return type:

float