MSParams#

class pyrost.multislice.MSParams(x_min, x_max, x_step, z_step, wl, formula1, density1, formula2, density2, n_min, n_max, focus, mll_sigma, mll_depth, mll_wl, mll_mat1=None, mll_mat2=None)#

Container with the experimental parameters of one-dimensional multislice beam propagation simulation. All the experimental parameters are enlisted in Simulation parameters.

Parameters
  • multislice

    A dictionary of multislice simulation parameters. The following elements are accepted:

    • x_min, x_max : Wavefront span along the x axis [um].

    • x_step : Beam sampling interval along the x axis [um].

    • z_step : Distance between the slices [um].

    • wl : Beam’s wavelength [um].

  • mll_mat1 (Optional[Material]) –

    A dictionary of the first MLL material. The following elements are accepted:

    • formula : Chemical formula of the material.

    • density : Atomic density of the material [g / cm^3].

  • mll_mat2 (Optional[Material]) –

    A dictionary of the second MLL material. The following elements are accepted:

    • formula : Chemical formula of the material.

    • density : Atomic density of the material [g / cm^3].

  • mll

    A dictionary of multilayer Laue lens parameters. The following elements are accepted:

    • n_min, n_max : zone number of the first and the last layer.

    • focus : MLL’s focal distance [um].

    • mll_sigma : Bilayer’s interdiffusion length [um].

    • mll_depth : MLL’s thickness [um].

    • mll_wl : Wavelength of the MLL [um].

See also

Simulation parameters : Full list of experimental parameters.

contents()#

Return a list of the attributes stored in the container that are initialised.

Return type

List[str]

Returns

List of the attributes stored in the container.

get(attr, value=None)#

Retrieve a dataset, return value if the attribute is not found.

Parameters
  • attr (str) – Data attribute.

  • value (Optional[Any]) – Data which is returned if the attribute is not found.

Return type

Any

Returns

Attribute’s data stored in the container, value if attr is not found.

get_kernel(fx_arr)#

Return diffraction kernel for the multislice propagation.

Parameters

fx_arr (ndarray) – Spatial frequencies.

Return type

ndarray

Returns

Diffraction kernel.

Notes

The diffraction kernel is given by:

\[k(f_x, f_y) = \exp{-j \frac{2 \pi \Delta z}{\lambda} \sqrt{1 - \lambda^2 (f_x^2 + f_y^2)}}\]

where \(\Delta z\) — slice thickness, \(f_x, f_y\) — spatial frequencies, and \(\lambda\) — wavelength.

get_mat1_r(energy)#

Return the Fresnel transmission coefficient of the first material in MLL bilayer.

Parameters

energy (float) – Beam’s photon energy [keV].

Return type

complex

Returns

Fresnel transmission coefficient.

get_mat2_r(energy)#

Return the Fresnel transmission coefficient of the second material in MLL bilayer.

Parameters

[keV]. (Beam's photon energy) –

Return type

complex

Returns

Fresnel transmission coefficient.

get_wavefront_size()#

Return slice array size.

Return type

int

Returns

Slice size.

get_xcoords(size=None)#

Return a coordinate array of a slice.

Parameters

size (Optional[int]) – Size of the array. Equals to MSParams.get_wavefront_size() if it’s None.

Return type

ndarray

Returns

Coordinate array [um].

get_zcoords()#

Return a coordinate array along the propagation axis.

Return type

ndarray

Returns

Coordinate array [um].

classmethod import_default()#

Return the default MSParams.

Return type

MSParams

Returns

A MSParams object with the default parameters.

classmethod import_ini(ini_file)#

Initialize the container object with an INI file ini_file.

Parameters

ini_file (str) – Path to the ini file.

Return type

~I

Returns

A new container with all the attributes imported from the ini file.

items()#

Return (key, value) pairs of the datasets stored in the container.

Return type

ItemsView

Returns

(key, value) pairs of the datasets stored in the container.

keys()#

Return a list of the attributes available in the container.

Return type

List[str]

Returns

List of the attributes available in the container.

replace(**kwargs)#

Return a new container object with a set of attributes replaced.

Parameters

kwargs (Any) – A set of attributes and the values to to replace.

Return type

~D

Returns

A new container object with updated attributes.

static str_to_list(strings)#

Convert strings to a list of strings.

Parameters

strings (Union[str, List[str]]) – String or a list of strings

Return type

List[str]

Returns

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.

values()#

Return the attributes’ data stored in the container.

Return type

ValuesView

Returns

List of data stored in the container.