Incoherent Ptychography¶
PyPty supports three types of incoherent scattering:
- Probe modes: multiple coherent probes
- Object modes: multiple transmission functions
- Static background: uniform parasitic scattering
Let (O) be a coherent object and (P) a coherent probe. Define the forward model
[ FM(O, P) ],
which maps object and probe to an intensity pattern. The total measured intensity is then
[ S + \sum_{i,j} FM(O_i, P_j), ]
where:
- (S) is a static offset common to all patterns,
- (O_i) are object modes,
- (P_j) are probe modes.
Probe Modes¶
By default, PyPty generates a single coherent probe mode using a calibrated pypty_params dictionary. To use multiple modes, you have three options:
-
User-defined modes
Provide an array of shape[Ny, Nx, Nmodes]or[Ny, Nx, Nmodes, Nroi]via theprobe_modeskey. -
Defocus spread modes
Setdefocus_spread_modesinpypty_paramsto a 1D array of defocus values (in Å). PyPty applies different defocus values to generate multiple modes. This can be useful for monolayers or for samples with drift or wobble along the beam propgation direction. -
Hermite modes
Specifyn_hermite_probe_modes: (order_x, order_y)to generate Hermite polynomials up to the given orders in the x and y directions.
Static Background¶
PyPty models a static incoherent offset in two ways:
-
User-defined background
Providestatic_backgroundas a 2D array matching your diffraction pattern size (including padding). -
Automatic initialization
Setstatic_backgroundto a float > 1E-7. PyPty will create a randomized background normalized to the total number counts specified by the provided float.
Object Modes¶
Reconstructing incoherent object modes requires a well-calibrated probe and accurate positions. Initialization options include:
-
User-defined modes
Provideobjas a 4D array of shape(y, x, z, Nmodes)inpypty_params(after attached experimental parameters to the presetpypty_params). -
Automatic initialization
Inexperimental_params(before appending them topypty_params), set: num_obj_modes: integer number of object modesobj_phase_sigma: standard deviation of Gaussian noise for initial phase
Ensure each mode starts from a different random seed to avoid identical updates.