STParams#
- class pyrost.simulation.STParams(defocus, det_dist, n_frames, step_size, step_rnd, detx_size, dety_size, pix_size, p0, th_s, wl, alpha, ap_x, ap_y, focus, ab_cnt, bar_atn, bar_rnd, bar_sigma, bar_size, bulk_atn, offset, num_threads=0, seed=0)#
Container with the simulation parameters for the wavefront propagation.
- Parameters
barcode –
A dictionary of barcode sample parameters. The following elements are accepted:
bar_size : Average bar’s size [um].
bar_sigma : Bar bluriness width [um].
bar_atn : Bar’s attenuation coefficient [0.0 - 1.0].
bulk_atn : Barcode’s bulk attenuation coefficient [0.0 - 1.0].
bar_rnd : Bar’s coordinates random deviation [0.0 - 1.0].
- offsetBarcode’s offset at the beginning and at the end
of the scan from the detector’s bounds [um].
detector –
A dictionary of detector parameters. The following elements are accepted:
detx_size : Detector’s size along the horizontal axis in pixels.
dety_size : Detector’s size along the vertical axis in pixels.
pix_size : Detector’s pixel size [um].
exp_geom –
A dictionary of experimental geometry parameters. The following elements are accepted:
defocus : Lens’ defocus distance [um].
det_dist : Distance between the barcode and the detector [um].
step_size : Scan step size [um].
n_frames : Number of frames.
lens –
A dictionary of lens parameters. The following elements are accepted:
ap_x : Lens’ aperture size along the x axis [um].
ap_y : Lens’ aperture size along the y axis [um].
focus : Focal distance [um].
alpha : Third order aberrations coefficient [rad / mrad^3].
ab_cnt : Lens’ aberrations center point [0.0 - 1.0].
source –
A dictionary of X-ray source parameters. The following elements are accepted:
p0 : Source beam flux [cnt / s].
wl : Source beam’s wavelength [um].
th_s : Source rocking curve width [rad].
system –
A dictionary of calculation parameters. The following elements are accepted:
seed : Seed used in all the pseudo-random number generations.
num_threads : Number of threads used in the calculations.
See also
Simulation parameters : Full list of experimental parameters.
- bar_positions(dist, rnd_dev=True)#
Generate a coordinate array of barcode’s bar positions at distance dist from focal plane.
- Parameters
- Return type
- Returns
Array of barcode’s bar coordinates.
See also
pyrost.bin.bar_positions()
: Full details of randomized barcode steps generation algorithm.
- barcode_profile(x_arr, dx, bars)#
Generate a barcode’s transmission profile at x_arr coordinates.
- Parameters
- Return type
- Returns
Barcode’s transmission profile.
See also
pyrost.bin.barcode_profile()
: Full details of barcode’s transmission profile generation algorithm.
- beam_span(dist)#
Return beam span along the x axis at distance dist from the focal plane.
- contents()#
Return a list of the attributes stored in the container that are initialised.
- get(attr, value=None)#
Retrieve a dataset, return
value
if the attribute is not found.
- classmethod import_default()#
Return the default
STParams
. Extra arguments override the default values if provided.
- classmethod import_ini(ini_file)#
Initialize the container object with an INI file
ini_file
.
- items()#
Return (key, value) pairs of the datasets stored in the container.
- Return type
- Returns
(key, value) pairs of the datasets stored in the container.
- keys()#
Return a list of the attributes available in the container.
- lens_x_wavefront(n_x=None, return_step=False)#
Return wavefields at the lens plane along x axis.
- Parameters
n_x (
Optional
[int
]) – Array size along the x axis. Equals toSTParams.x_wavefront_size()
if it’s None.return_step (
bool
) – Return the step size along x axis if it’s True.
- Return type
- Returns
A tuple of two elements (‘u0_x’, ‘dx’). The elements are the following:
u0_x : Wavefront along the x axis.
dx : Step size along the x axis [um]. Only if return_step is True.
Notes
The exit-surface at the lens plane:
\[U_0(x) = \Pi(a_x x) \exp \left[ -\frac{j \pi x^2}{\lambda f} + j \alpha \left( \frac{x - x_{ab_cnt}}{f} \right)^3 \right]\]
- lens_y_wavefront(n_y=None, return_step=False)#
Return wavefields at the lens plane along y axis.
- Parameters
n_y (
Optional
[int
]) – Array size along the y axis. Equals toSTParams.y_wavefront_size()
if it’s None.return_step (
bool
) – Return the step size along y axis if it’s True.
- Return type
- Returns
A tuple of two elements (‘u0_y’, ‘dy’). The elements are the following:
u0_y : Wavefront along the y axis.
dy : Step size along the y axis [um]. Only if return_step is True.
Notes
The exit-surface at the lens plane:
\[U_0(y) = \Pi(a_y y)\]
- replace(**kwargs)#
Return a new container object with a set of attributes replaced.
- sample_positions()#
Generate an array of sample’s translations with random deviation.
- Return type
- Returns
Array of sample translations [um].
- source_curve(dist, step)#
Return source’s rocking curve profile at dist distance from the lens.
- static str_to_list(strings)#
Convert strings to a list of strings.
- to_ini(ini_file)#
Save all the attributes stored in the container to an INI file
ini_file
.- Parameters
ini_file (
str
) – Path to the ini file.
- update_seed(seed=None)#
Update seed used in pseudo-random number generation.
- update_threads(num_threads=None)#
Update number of threads used in calculcations.
- values()#
Return the attributes’ data stored in the container.
- Return type
- Returns
List of data stored in the container.
- x_wavefront_size()#
Return wavefront array size along the x axis, that satisfies the sampling condition.
- Return type
- Returns
Array size.
Notes
The sampling condition when we propagate the wavefield from the lens plane to the sample plane is as follows:
\[N_x >= \frac{\mathrm{max} \left( \Delta x_{lens}, \Delta x_{sample} \right) (\Delta x_{lens} + \Delta x_{sample})}{\lambda d} = \frac{4 a_x^2 \mathrm{max} \left( f, df \right)}{f^2 \lambda}\]Whereupon, the sampling condition when we propagate the wavefield to the detector plane is:
\[N_x >= \frac{\Delta x_{sample} \Delta x_{det}}{\lambda d} = \frac{2 a_x n_{x} \Delta_{pix} df}{f \lambda d_{det}}\]
- y_wavefront_size()#
Return wavefront array size along the y axis, that satisfies the sampling condition.
- Return type
- Returns
Array size.
Notes
The sampling condition when we propagate the wavefield from the lens plane to the sample plane is as follows:
\[N_y >= \frac{\mathrm{max} \left( \Delta y_{lens}, \Delta y_{sample} \right) (\Delta y_{lens} + \Delta y_{sample})}{\lambda d} = \frac{8 a_y^2}{(f + df) \lambda}\]Whereupon, the sampling condition when we propagate the wavefield to the detector plane is:
\[N_y >= \frac{\Delta y_{sample} \Delta y_{det}}{\lambda d} = \frac{2 a_y n_{y} \Delta_{pix}}{\lambda d_{det}}\]