STSim#
- class pyrost.simulation.STSim(params, backend='numpy', bars=None, det_ix=None, det_iy=None, det_wfx=None, det_wfy=None, lens_wfx=None, lens_wfy=None, roi=None, smp_pos=None, smp_profile=None, smp_wfx=None, smp_wfy=None)#
One-dimensional Speckle Tracking scan simulation class. Generates barcode’s transmission profile and lens’ abberated wavefront, whereupon propagates the wavefront to the detector’s plane.
- Parameters
Notes
Necessary attributes:
backend : the backend library for the FFT implementation.
params : Experimental parameters.
Optional attributes:
bars : Barcode’s bar positions [um].
det_wfx : Wavefront at the detector plane along the x axis.
det_wfy : Wavefront at the detector plane along the y axis.
det_iy : Intensity profile at the detector plane along the x axis.
det_iy : Intensity profile at the detector plane along the y axis.
lens_wfx : Wavefront at the lens plane along the x axis.
lens_wfy : Wavefront at the lens plane along the y axis.
num_threads : Number of threads used in the calculations.
n_x : Wavefront size along the x axis.
n_y : Wavefront size along the y axis.
roi : Region of interest in detector plane.
smp_pos : Sample translations along the x axis.
smp_profile : Barcode’s transmission profile.
smp_wfx : Wavefront at the sample plane along the x axis.
smp_wfy : Wavefront at the sample plane along the y axis.
- Raises
ValueError – If the ‘backend’ keyword is invalid.
- find_beam_roi()#
Calculate the beam’s field of view at the detector grid as a list of four pixel coordinates.
- frames(wfieldx=None, wfieldy=None, apply_noise=True)#
Return intensity frames at the detector plane. Applies Poisson noise if apply_noise is True.
- ptychograph(wfieldx=None, wfieldy=None, apply_noise=True)#
Return a ptychograph of intensity frames. Applies Poisson noise if apply_noise is True.