skbeam.core.cdi.cdi_recon

skbeam.core.cdi.cdi_recon(diffracted_pattern, sample_obj, sup, beta=1.15, start_avg=0.8, pi_modulus_flag='Complex', sw_flag=True, sw_sigma=0.5, sw_threshold=0.1, sw_start=0.2, sw_end=0.8, sw_step=10, n_iterations=1000, cb_function=None, cb_step=10)

Run reconstruction with difference map algorithm.

Parameters
diffracted_patternarray

diffraction pattern from experiments

sample_objarray

initial sample with phase, complex number

suparray

initial support

betafloat, optional

feedback parameter for difference map algorithm. default is 1.15.

start_avgfloat, optional

define the point to start doing average. default is 0.8.

pi_modulus_flag{‘complex’, ‘real’}, optional

‘complex’ or ‘real’, defining the way to perform pi_modulus calculation. default is ‘Complex’.

sw_flagBool, optional

flag to use shrinkwrap algorithm or not. default is True.

sw_sigmafloat, optional

gaussian width used in sw algorithm. default is 0.5.

sw_thresholdfloat, optional

shreshold cut in sw algorithm. default is 0.1.

sw_startfloat, optional

at which point to start to do shrinkwrap. defualt is 0.2

sw_endfloat, optional

at which point to stop shrinkwrap. defualt is 0.8

sw_stepfloat, optional

the frequency to perform sw algorithm. defualt is 10

n_iterationsint, optional

number of iterations to run. default is 1000.

cb_functionfunction, optional

This is a callback function that expects to receive these four objects: sample_obj, obj_error, diff_error, sup_error. Sample_obj is a 2D array. And obj_error, diff_error, and sup_error are 1D array.

cb_stepint, optional

define plotting frequency, i.e., if plot_step = 10, plot results after every 10 iterations.

Returns
obj_avgarray

reconstructed sample object

error_dictdict

Error information for all iterations. The dict keys include obj_error, diff_error and sup_error. Obj_error is a list of the relative error of sample object. Diff_error is calculated as the difference between new diffraction pattern and the original diffraction pattern. And sup_error stores the size of the sample support.

References

1

V. Elser, “Phase retrieval by iterated projections”, J. Opt. Soc. Am. A, vol. 20, No. 1, 2003