STParams¶
-
class
pyrost.simulation.STParams(**kwargs)¶ Container with the experimental parameters of one-dimensional Speckle Tracking scan. All the experimental parameters are enlisted in attr_dict.
- Parameters
**kwargs (dict) – Values for the exerimental parameters specified in attr_dict.
- Variables
See also
st_sim_paramFull list of experimental parameters.
-
bar_positions(dist)¶ Generate a coordinate array of barcode’s bar positions at distance dist from focal plane.
- Parameters
dist (float) – Distance from the focal plane [um].
- Returns
b_steps – Array of barcode’s bar coordinates.
- Return type
See also
bin.bar_positionsFull details of randomized barcode steps generation algorithm.
-
barcode_profile(b_steps, dx, n_x)¶ Generate a barcode’s transmission profile.
- Parameters
b_steps (numpy.ndarray) – Array of barcode’s bar positions [um].
dx (float) – Sampling distance [um].
n_x (int) – Wavefront size.
- Returns
b_tr – Barcode’s transmission profile.
- Return type
See also
bin.barcode_profileFull 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.
- Parameters
dist (float) – Distance from the focal plane [um].
- Returns
th_lb (float) – Beam’s lower bound [um].
th_ub (float) – Beam’s upper bound [um].
-
export_dict()¶ Export experimental parameters to
dict.- Returns
param_dict – Experimental parameters.
- Return type
-
classmethod
export_ini(**kwargs)¶ Return a
configparser.ConfigParserobject with all the attributes exported the class.- Parameters
**kwargs (dict) – Extra parameters to export to the
configparser.ConfigParserobject.- Returns
A parser object with all the attributes contained in attr_dict.
- Return type
-
fs_roi()¶ Return detector’s region of interest along the fast axis.
- Returns
fs_lb (int) – Beam’s lower bound along the detector’s fast axis.
fs_ub (int) – Beam’s upper bound along the detector’s fast axis.
-
classmethod
get_format(section, option)¶ Return the attribute’s format specified by fmt_dict.
-
classmethod
get_value(ini_parser, section, option)¶ Return an attribute from an INI file’s parser object ini_parser.
- Parameters
ini_parser (configparser.ConfigParser) – A parser object of an INI file.
section (str) – Attribute’s section.
option (str) – Attribute’s option.
- Returns
- Return type
Attribute’s value imported from the INI file.
-
classmethod
import_dict(**kwargs)¶ Initialize experimental parameters from a dictionary kwargs.
-
classmethod
import_ini(protocol_file)¶ Initialize an
INIParserobject class with an ini file.- Parameters
protocol_file (str) – Path to the file.
- Returns
An
INIParserobject with all the attributes imported from the INI file.- Return type
INIParser
-
lens_wavefronts(n_x=None, n_y=None, return_dxdy=False)¶ Return wavefields at the lens plane along x and y axes.
- Parameters
n_x (int, optional) – Array size along the x axis. Equals to
STParams.x_wavefront_size()if it’s None.n_y (int, optional) – Array size along the y axis. Equals to
STParams.y_wavefront_size()if it’s None.return_dxdy (bool, optional) – Return step sizes along x and y axes if it’s True.
- Returns
u0_x (numpy.ndarray) – Wavefront along the x axis.
u0_y (numpy.ndarray) – Wavefront along the y axis.
dx (float) – Step size along the x axis [um]. Only if return_dxdy is True.
dy (float) – Step size along the y axis [um]. Only if return_dxdy 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]\]\[U_0(y) = \Pi(a_y y)\]
-
classmethod
lookup_dict()¶ Look-up table between the sections and the parameters.
- Returns
Look-up dictionary.
- Return type
-
classmethod
read_ini(protocol_file)¶ Read the protocol_file and return an instance of
configparser.ConfigParserclass.- Parameters
protocol_file (str) – Path to the file.
- Returns
Parser object with all the data contained in the INI file.
- Return type
- Raises
ValueError – If the file doesn’t exist.
-
source_curve(dist, dx)¶ Return source’s rocking curve profile at dist distance from the lens.
- Parameters
- Returns
Source’s rocking curve profile.
- Return type
-
x_wavefront_size()¶ Return wavefront array size along the x axis, that satisfies the sampling condition.
- Returns
n_x – Array size.
- Return type
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_{fs} \Delta_{pix} df}{f \lambda d_{det}}\]
-
y_wavefront_size()¶ Return wavefront array size along the y axis, that satisfies the sampling condition.
- Returns
n_y – Array size.
- Return type
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_{ss} \Delta_{pix}}{\lambda d_{det}}\]