ptypy.engines.base.BaseEngine#

class ptypy.engines.base.BaseEngine(ptycho, pars=None)#

Bases: object

Base reconstruction engine. In child classes, overwrite the following methods for custom behavior : engine_initialize engine_prepare engine_iterate engine_finalize

Defaults:

[numiter] default = 20 type = int lowlim = 1 help = Total number of iterations doc = For on-the-fly (live) processing, the reconstruction engine will iterate at least this many times after all data has been loaded.

[numiter_contiguous] default = 1 type = int lowlim = 1 help = Number of iterations without interruption doc = The engine will not return control to the caller until this number of iterations is completed (not processing server requests, I/O operations, …).

[probe_support] default = 0.7 type = float, None lowlim = 0.0 help = Valid probe area as fraction of the probe frame doc = Defines a circular area centered on the probe frame, in which the probe is allowed to be nonzero.

[probe_fourier_support] default = None type = float, None lowlim = 0.0 help = Valid probe area in frequency domain as fraction of the probe frame doc = Defines a circular area centered on the probe frame (in frequency domain), in which the probe is allowed to be nonzero.

[record_local_error] default = False type = bool help = If True, save the local map of errors into the runtime dictionary. userlevel = 2

__init__(ptycho, pars=None)#

Base reconstruction engine. :param ptycho: The parent Ptycho object. :type ptycho: Ptycho :param pars: Initialization parameters :type pars: Param or dict

Methods

__init__(ptycho[, pars])

Base reconstruction engine.

engine_finalize()

Engine-specific finalization.

engine_initialize()

Engine-specific initialization.

engine_iterate(num)

Engine single-step iteration.

engine_prepare()

Engine-specific preparation.

finalize()

Clean up after iterations are done.

initialize()

Prepare for reconstruction.

iterate([num])

Compute one or several iterations.

prepare()

Last-minute preparation before iterating.

support_constraint([storage])

Enforces 2D support contraint on probe.

Attributes

COMPATIBLE_MODELS

engine_finalize()#

Engine-specific finalization. Used to wrap-up engine-specific stuff. Called at the end of self.finalize()

engine_initialize()#

Engine-specific initialization. Called at the end of self.initialize().

engine_iterate(num)#

Engine single-step iteration. All book-keeping is done in self.iterate(), so this routine only needs to implement the “core” actions.

engine_prepare()#

Engine-specific preparation. Last-minute initialization providing up-to-date information for reconstruction. Called at the end of self.prepare()

finalize()#

Clean up after iterations are done.

initialize()#

Prepare for reconstruction.

iterate(num=None)#

Compute one or several iterations.

numNone, int number of iterations.

If None or num<1, a single iteration is performed.

prepare()#

Last-minute preparation before iterating.

support_constraint(storage=None)#

Enforces 2D support contraint on probe.