ptypy.engines.posref.GridSearchRefine#

class ptypy.engines.posref.GridSearchRefine(position_refinement_parameters, Cobj, metric='fourier')#

Bases: PositionRefine

__init__(position_refinement_parameters, Cobj, metric='fourier')#

Grid Search Position Refinement.

Cobjptypy.core.classes.Container

The current pbject container object

metricstr

“fourier” or “photon”

Methods

__init__(position_refinement_parameters, Cobj)

Grid Search Position Refinement.

cleanup()

Cleans up every iteration

estimate_fourier_metric(di_view, obj)

Calculates error based on DM fourier error estimate.

estimate_photon_metric(di_view, obj)

Calculates error based on reduced likelihood estimate.

update_constraints(iteration)

update_view_position(di_view)

Refines the positions by the following algorithm:

Attributes

citation_dictionary

cleanup()#

Cleans up every iteration

estimate_fourier_metric(di_view, obj)#

Calculates error based on DM fourier error estimate.

Parameters:
  • di_view (ptypy.core.classes.View) – A diffraction view for which we wish to calculate the error.

  • obj (numpy.ndarray) – The current calculated object for which we wish to evaluate the error against.

Returns:

The calculated fourier error

Return type:

np.float

estimate_photon_metric(di_view, obj)#

Calculates error based on reduced likelihood estimate.

Parameters:
  • di_view (ptypy.core.classes.View) – A diffraction view for which we wish to calculate the error.

  • obj (numpy.ndarray) – The current calculated object for which we wish to evaluate the error against.

Returns:

The calculated fourier error

Return type:

np.float

update_constraints(iteration)#
Parameters:

iteration (int) – The current iteration of the engine.

update_view_position(di_view)#

Refines the positions by the following algorithm:

Calculates all shifts in a given radius around the original position and calculates the fourier error. If the fourier error decreased the calculated postion will be used as new position.

Parameters:

di_view (ptypy.core.classes.View) – A diffraction view that we wish to refine.

Returns:

A length 2 numpy array with the position increments for x and y co-ordinates respectively

Return type:

numpy.ndarray