prepare_recon

Contents

prepare_recon#

ptyrad.reconstruction.prepare_recon(model, init, params)[source]#

Prepares the indices, batches, and output path for ptychographic reconstruction.

This function parses the necessary parameters and generates the indices for scanning, creates batches based on the probe positions, and sets up the output directory for saving results. It also plots and saves a figure illustrating the grouping of probe positions.

Parameters:
  • model (PtychoAD) – The ptychographic model containing the object, probe, probe positions, and other relevant parameters.

  • init (Initializer) – The initializer object containing the initialized variables needed for reconstruction.

  • params (dict) – A dictionary containing various parameters needed for the reconstruction process, including experimental parameters, loss parameters, constraint parameters, and reconstruction settings.

Returns:

A tuple containing the following:
  • indices (numpy.ndarray): Array of indices for scanning positions.

  • batches (list of numpy.ndarray): List of batches where each batch contains indices grouped according to the selected grouping mode.

  • output_path (str): The path to the directory where reconstruction results and figures will be saved.

Return type:

tuple