Reconstruction Engines

Reconstruction Engines#

Learning more about the different engines and their parameters.

PtyPy offers a range of different reconstruction engines that can be grouped into the 3 main categories of

GPU-accelerated engines using CuPy / PyCUDA#

For running the GPU-accelerated equivalent of the engines described above, simple add this line at the top of the script

ptypy.load_gpu_engines("cuda")

and add “_cupy” or “_pycuda” to the engine name, for example

# Difference Map (DM) engine
p.engines.engine00 = u.Param()
p.engines.engine00.name = "DM_cupy"

Note

ptypy.load_gpu_engines(“cuda”) is loading both CuPy and PyCUDA engines and therefore requires all dependencies from both. For loading only the CuPy or PyCUDA engines, respectively, use ptypy.load_gpu_engines(“cupy”) or ptypy.load_gpu_engines(“pycuda”) instead.


import ptypy
import ptypy.utils as u

ptypy.load_gpu_engines("cuda")

# Copy the parameter tree here
# ...