MSA - Multislice algorithm

 

The purpose the program MSA is to perform the multislice algorithm for a chosen input wave function and a given set of object transmission functions, which are supplied to the program in form of complex-valued phase gratings. The results produced by MSA can be complex-valued wave functions, single STEM image pixels or full STEM images.
The program is compiled for single-thread calculations and can be called from command-line shell (cmd.exe) or from other programs on 64-bit operating systems. The program is controlled via a parameter list provided in a text file.

 

Summary of program functions:

INPUT DATA : Required input data for calculating the multislice algorithm with MSA are phase gratings in form of files. Since phase gratings are usually calculated from the projected potential of reasonably thin object slices, the respective files are also called "slice files." Slice files can be created by using the program CELSLC or with the Dr. Probe graphical user interface. The files contain information about the size and sampling of object transmission functions, including the slice thickness, which are used by MSA to calculate free-space Fresnel propagation between two subsequent slices.

MULTISLICE CALCULATION : By multislice calculation we refer to the calculation of electron diffraction from a given potential distribution following the approach proposed by J.M. Cowley and A.F. Moodie [Acta Cryst. 10 (1957) p. 609-618]. In this approach the scattering of an electron wave by a thicker specimen is described by a sequence of scattering events on thin slabs or slices of the object followed each by a propagation in free space towards the next slice, where the slices are taken along the main direction of the incident electrons.
The approach of sequential scattering and propagation can be implemented in an efficient numerical form, where the scattering is described in real space by a multiplication with an object transmission function (phase grating), and where the subsequent free-space propagation is calculated by a multiplication of the scattering result with a Fresnel propagator function in Fourier-space. The calculation for a thick sample comprises thus two multiplications, one forward and one backward Fourier transform for each object slice.
Calculations for STEM and TEM differ by the form of the incident wave function and by the way how the electron wave function obtained at the object exit-plane is processed further into image intensities. For STEM image calculations, the incident electron wave is converging into a focused probe and scanned over the object. For each probe position, the wave function below the object is analyzed in diffraction space, where the absolute square is integrated for given detector areas. For TEM image calculations, the incident electron wave is approximated by a plane wave and the electron wave below the object is passed further through imaging optics towards a detector where the absolute square is taken in real space. In the TEM case, MSA can be used to calculate the electron wave below the object (exit-plane wave function). The calculation of TEM image intensities including the application of wave aberrations, partial coherence and incoherent contrast dampening effects are done by the program WAVIMG, which is also available with the Dr. Probe software package.
MSA supports the automatic extraction of results for different object thicknesses. In case of STEM calculations, images can be extracted also for many detectors with one run.
A special function of the program MSA is the consideration of frozen phonon configurations. Frozen phonon configurations can be pre-calculated by using e.g. the program CELSLC, which stores several configurations of thermally induced atomic displacements of each object slice in a number of slice variants. During the calculation of the electron wave function passing through the object, the program MSA selects and applies a random frozen phonon variant of each slice. By this way, each single multislice calculation for one STEM image pixel is effectively calculated with an individual frozen phonon configuration of the whole object (detailed description). Since high-resolution STEM images are usually convoluted a-posteriori to consider the effect of a finite geometrical source size, the applied scheme of changing the overall frozen phonon configuration from STEM pixel to STEM pixel provides an efficient way of averaging and describing thermal diffuse scattering.

PROGRAM CONTROL : The calculation setup and the physical parameters of the multislice calculation with MSA are controlled by a parameter file. The parameter file is a text file containing a list of parameters in a fix sequence. You may generate your own parameter file from the table below or by exporting an MSA parameter file from a setup done with the Dr. Probe Graphical User Interface. The table given below describes the structure of the parameter file and gives a short description of the meaning for each parameter. The parameter file is a mandatory parameter for calling the msa.exe application.

Line

Parameters

Description (Version 0.62+)

01

<string>

Parameter block name, must be '[Microscope Parameters]'

02

<float>

Incident probe convergence half angle [mrad], e.g. 30

03

<float>

Inner radius of a default angular detector in a diffraction plane [mrad], e.g. 80

04

<float>

Outer radius of a default angular detector in a diffraction plane [mrad], e.g. 250

05

<number> <string>

Multiple detector definition. Set the number switches between using the default detector defined above (0) and detector definitions as specified in an extra file. The name of the extra detector definition file must be specified in that case.
Example: 1, 'prm\detectors.prm'

06

<float>

Electron wavelength [nm], e.g. 0.001969

07

<float>

Effective source radius (HWHM) [nm] (STEM only), e.g. 0.055

08

<float>

Effective focus spread (1/e half-width) [nm] (STEM only), e.g. 1.5

09

<float>

Relative focus-spread kernel width used for the explicit focal convolution (STEM only), e.g. 2.0

10

<number>

Number of focal kernel steps (STEM only), e.g. 7

11

<number>

Number Nabr of aberration coefficients set below, e.g. 3

11+

<number> <float> <float>

Aberration definition by an index number and two coefficient values given in [nm] for all aberrations, e.g. define a 5.8 nm defocus by '2 5.8 0.0', or a star aberration of 4.7 nm along 30 degrees azimuth by '6 4070. 2350.'.
The index number (0 ... 23) identifies the aberration type and the two values are the x and y component (or the real and imaginary part) of the aberration coefficient. The aberrations are identified by index according to the following list:

Index

Aberration

0

Image shift (a11, C0,1, A0)

1

Defocus (a20, C1,0, C1)

2

Twofold astigmatism (a22, C1,2, A1)

3

Coma (a31, C2,1, 3·B2)

4

Threefold astigmatism (a33, C2,3, A2)

5

Spherical aberration (a40, C3,0, C3)

6

Star aberration (a42, C3,2, 4·S3)

7

Fourfold astigmatism (a44, C3,4, A3)

8

Coma (5th order) (a51, C4,1, 5·B4)

9

Three-lobe aberration (a53, C4,3, 5·D4)

10

Fivefold astigmatism (a55, C4,5, A4)

11

Spherical aberration (6th order) (a60, C5,0, C5)

12

Star aberration (6th order) (a62, C5,2, 6·S5)

13

Rosette aberration (a64, C5,4, 6·R5)

14

Sixfold astigmatism (a66, C5,6, A5)

...

  (further in the power-law series)  

23

Eightfold astigmatism (a88, C7,8, A7)

Nabr aberration definitions are expected following line 11. The default aberration coefficient values are all zero. For the default case, where you don't simulate an image with aberrations, you can set Nabr = 0 and leave out all aberration definitions.

Note that depending on the number of aberration definitions Nabr specified above, the content below the aberration definitions moves a respective number of lines downwards in the parameter file. This is denoted below by adding Nabr to the line numbers following.

12+Nabr

<string>

Parameter block name, must be '[Multislice Parameters]'

13+Nabr

<float>

Object tilt x component [deg], e.g. 0.5
Don't use tilts larger than 5 deg!

14+Nabr

<float>

Object tilt y component [deg], e.g. 0.0
Don't use tilts larger than 5 deg!

15+Nabr

<float>

Horizontal scan frame offset in the super-cell [nm], e.g. 0.0

16+Nabr

<float>

Vertical scan frame offset in the super-cell [nm], e.g. 0.0

17+Nabr

<float>

Horizontal scan frame size [nm], e.g. 1.24

18+Nabr

<float>

Vertical scan frame size [nm], e.g. 0.785

19+Nabr

<float>

Scan line (row) rotation with respect to the super-cell x-axis [deg], e.g. 15

20+Nabr

<number>

Number of scan columns (row length), e.g. 124

21+Nabr

<number>

Number of scan rows (column length), e.g. 79

22+Nabr

<number>

Switch the explicit focus spread convolution OFF (0) or ON (1).

23+Nabr

<number>

Switch the a-posteriori convolution by a source distribution function OFF (0), ON with a Gaussian profile (1), or ON with a Lorentzian profile (2).

24+Nabr

<number>

Internal repeat factor of the super-cell along x, e.g. 1.
Values >1 will increase the wavefunction size and the computation time.

25+Nabr

<number>

Internal repeat factor of the super-cell along y, e.g. 1.
Values >1 will increase the wavefunction size and the computation time.

26+Nabr

<number>

Internal repeat factor of the super-cell along z, e.g. 1.
Historic parameter which is not used anymore. Set it to 1!

27+Nabr

<string>

Slice file name prefix, e.g. 'slc\STO001_3x3_300kV' The program will look for files with this file name extended by '_###.sli', where ### refers to a 3 digit number and is the index according to the slicing of the super-cell. If one of the slice files is not found, the program will terminate with an error.

28+Nabr

<number>

Nsf = Number of slice files to be loaded, e.g. 4.

29+Nabr

<number>

Number of frozen lattice variants considered per slice, e.g. 50.

30+Nabr

<number>

STEM: Minimum number of frozen-phonon configurations to be averaged per scan pixel, e.g. 1.
CTEM: Minimum number of frozen-phonon configurations used to generate wave functions, e.g. 1.
Warning: If wave functions are extracted from the multislice calculation, the number of wave functions that will be generated and stored in separate files is increased accordingly, since a wave function will be exported for each applied frozen-phonon configuration.

31+Nabr

<number>

Period of readout or detection in units of slices, e.g. 2.
This parameter determines the amount of readout during the multislice propagation of the electron wave through the object. It determines the sampling of data (STEM images or wave functions) along the propagation direction and allows thus to generate data for an object thickness series. Setting this value to zero will produce only one image or one wavefunction extracted at the maximum object thickness.

32+Nabr

<number>

Nsl = Number of slices used to describe the full object structure up to its maximum thickness, e.g. 64.
The same number of lines is expected to follow this line of the parameter file. This number actually determines the maximum thickness, which can be calculated by adding all slice thicknesses of the object slice sequences defined by the Nsl parameter file lines below.

32+Nabr+

<number>

Slice index, e.g. 0.
This line and all following lines should contain only one number each. The numbers denote the slice index of from the list of loaded slice files as specified in the lines (27+Nabr) and (28+Nabr) of the parameter file. Slice indices are numbers from 0 up to Nsf - 1, where Nsf is the number of loaded slice files as specified in line (28+Nabr) of the parameter file. An example sequence with 8 object slices realized with 4 loaded slice phase-gratings could be 0, 1, 2, 3, 0, 1, 2, 3. You are however completely free in choosing any possible sequence of slices to form the object structure along the z direction.

 

In line (05) of the MSA parameter file you may link to another parameter file to load multiple detector definitions. A detector definition file is also a text file with a fix sequence of parameters. You may generate your own detector definition file from the table below or by exporting a detector setup done with the Dr. Probe Graphical User Interface. The table given below describes the structure of the parameter file and gives a short description of the meaning for each parameter.

Line

Parameters

Description (Version 0.70+)

01

<string>

Parameter block name, must be '[Detector Parameters]'

02

<number>

Version of the parameter structure, use 2016021801 with MSA version 0.70+

03

<number>

Number of detector definitions to be used, e.g. 3
An equal number of detector definitions must follow in the lines below.

04+

<float>, <float>, <float>, <float>, <float>, <float>, <string>, <string>

Single annular segmented detector definitions,
e.g. 80, 250, 0, 0, 0, 0, 'HAADF', ''
The six numbers denote (1) inner radius [mrad], (2) outer radius [mrad], (3) segment start azimuth angle [deg], (4) segment stop azimuth angle [deg], (5) annulus center x [mrad] and (6) annulus center y [mrad]. The first string is a detector name which will be appended to all image files saving data extracted with this detector. The second string can be used to link the detector definition to a relative radial sensitivity profile. A describtion of the file format defining a sensitivity profile is given below. If the last string is empty or the specified file is not found, the detector will be used with a default sensitivity of 1.

Since MSA version 0.70b relative radial sensitivity profiles can be set via the detector definition file explained above. The sensitivity profile is specified in the individual detector definitions by a string naming a disk file, which contains the data of the sensitivity profile.

A relative radial sensitivity profile is a radial function, which determines the transfer of intensity from the absolute square of the wave function in a diffraction plane to the recorded detector signal depending on the diffraction angle. In realitity, the sensitivity of typical annular dark-field detectors is not uniform and often shows a strong decay of response close to its the inner radius. The consideration of this detector transfer characteristics is critical for simulating STEM image intensities quantitatively, e.g. in A. Rosenauer, et al. [Ultramicroscopy 109 (2009) 1171-1182].

Rel. radial detector profile and file structure

[Diagram of the relative radial detector profile measured for a typical HAADF detector and a screenshot of text file defining such a profile displaying the file structure with header line and with the first samples of the profile.]

Files defining relative radial sensitivity profiles are expected to be text files with a header line consisting of two numbers, and a sequence of lines containing one sensitivity value per line. The first of two numbers in the first line denotes the total number of radial sensitivity samples in the profile (number of lines following, respectively). The second number of the header line identifies the reference sample number of the profile that corresponds to the inner detector angle. In the example shown above, this is sample number 129 of the total 960 samples. The simulation routine will assume that the first profile sample (second line of the text file) corresponds to the origin of the diffraction plane (zero beam). The assignment of the first profile sample to the origin and of the reference sample number to the inner detection angle defines the scaling of the profile in the diffraction plane.

For matching experimental and simulated images on the same absolute intensity scale, rescaling of both images is required:
(1) Determine the average detector response for the same settings controlling the probe current, the detector readout, and the scanning (dwell time) as used for the imaging.
(2) Subtract the vacuum intensity level (counts) from the detector image and from the experimental image.
(3) Calculate the average response of the detector over the whole active area, and divide the detector response image and the experimental image (both after subtraction of the vacuum count level).
(4) Finally, extract the radial average of the normalized detector image. This should give a curve such as shown above, which you can use in the simulation.

Line

Parameters

Description of radial sensitivity profiles (Version 0.70+)

01

<number>, <float>

NR = Number of radial samples, iref = Sample number corresponding to the inner radius of the detector area. At least NR lines of sensitivity data must follow this header line.

02

<float>

First sensitivity sample, This sample is assigned to the zero beam or zero diffraction angle.

03

<float>

Second sensitivity sample

...

<float>

(more data)

NR + 1

<float>

Last sensitivity sample

 

PROGRAM CALLING : The program MSA can be run from the Windows OS command console cmd.exe or from other programs by executing msa.exe. The program requires several command-line arguments with each call. The following table lists all command-line options of MSA version 0.62 and provides short descriptions of their meaning.

Option

Description (Version 0.62+)

-prm <file name>

Specifies the input parameter file. Enclose the file name string using quotation marks if the file name contains space characters.
Example: -prm 'prm\msa.prm'

-out <file name>

Specifies the output file name, which is either a STEM image or a wave function. Absolute or relative path names can be used. Enclose the file name string using quotation marks if the file name or the disk path contains space characters. Suffixes may be added automatically by MSA depending on other program parameters, such as detector names and slice indices for thickness series calculations.
Example: -out 'img\STEM.dat'

-in <file name>

(OPTIONAL, STEM ONLY) Input image file name for the a-posteriori application of partial spatial coherence to a pre-calculated raw STEM image. The program will convolute the input image with the source distribution function specified in the parameter file. The image dimensions and sampling rates are taken from the scan frame setup specified in the parameter file. The file content is expected to be binary 32-bit floating point data without file header.
Example: -in 'img\STEM_HAADF.dat'

-inw <file name> <slice index>

(OPTIONAL) Insert an input wave function at a given slice and resumes the multislice calculation further towards the object exit-plane. This option can be used for example to calculate the further elastic scattering of an inelastic partial state of the electron wave. The input wave dimensions and sampling rates are taken from the slice files specified in the parameter file. The file content is expected to be binary 64-bit complex data without file header.
Example: -inw 'wav\Ti-L_E010_sl010.wav' 11

-px <scan column index>

(OPTIONAL, STEM ONLY) Fix scan column index. Only scan pixels with this horizontal position in the STEM image are calculated. The index range starts from 0 up to Nx - 1, where Nx is the number of scan columns specified in the parameter file. If the option is not used, the calculation will be done for all Nx scan image columns.
Example: -px 3

-py <scan row index>

(OPTIONAL, STEM ONLY) Fix scan row index. Only scan pixels with this vertical position in the STEM image are calculated. The index range starts from 0 up to Ny - 1, where Ny is the number of scan rows specified in the parameter file. If the option is not used, the calculation will be done for all Ny scan image rows.
Example: -py 10

-lx <scan column index>

(OPTIONAL, STEM ONLY) Defines the last x-scan position (scan column) number starting from 0 up to # scan columns -1 to be calculated, in this case -px defines the first scan column to be calculated..
Example: -px 10 -lx 15

-ly <scan row index>

(OPTIONAL, STEM ONLY) Defines the last y-scan position (scan row) number starting from 0 up to # scan rows -1 to be calculated, in this case -py defines the first scan row to be calculated..
Example: -py 3 -ly 4

-foc <defocus [nm]>

(OPTIONAL, STEM ONLY) Overrides the defocus value given in the parameter file and uses the new defocus value instead.
Example: -foc -2.6

-tx <beam tilt x [mrad]>

(OPTIONAL) X component of an additional beam tilt applied to the incident wave function in milliradians. Using this option overrides the respective value specified in the parameter file.
Example: -tx 3.5

-ty <beam tilt y [mrad]>

(OPTIONAL) Y component of an additional beam tilt applied to the incident wave function in milliradians. Using this option overrides the respective value specified in the parameter file.
Example: -ty -2.5

-otx <object tilt x [mrad]>

(OPTIONAL) X component of an additional object tilt in milliradians. Only small values should be used here. For tilts larger than 5 degrees (90 mrad), the object structure should be tilted before slicing. Using this option overrides the respective value specified in the parameter file.
Example: -otx 0.5

-oty <object tilt y [mrad]>

(OPTIONAL) Y component of an additional object tilt in milliradians. Only small values should be used here. For tilts larger than 5 degrees (90 mrad), the object structure should be tilted before slicing. Using this option overrides the respective value specified in the parameter file.
Example: -oty -10.5

-sr <source radius [nm]>

(OPTIONAL) Effective source radius (HWHM) in nm used to calculate the partial spatial coherence in STEM. Using this option overrides the respective value specified in the parameter file.
Example: -sr 0.045

/ctem

(OPTIONAL) Switch to TEM mode. The incident electron wave will be a plane wave, no scan is performed. The output are electron wave functions calculated at a set of object thicknesses as specied in the parameter file.
Ommitting this option will switch the program to STEM mode, where the incident electron wave is converging to a fine probe and where the output is a STEM image.

/gaussap

(OPTIONAL, STEM ONLY) Use a probe-forming aperture of Gaussian shape instead of the default sharp circular aperture.

/wave

(OPTIONAL, STEM ONLY) Exports intermediate wave functions during the propagation through the object. Wave functions are extracted only at those slices, where a detection is done in STEM mode. The wave is extracted after scattering and before the subsequent propagation. BE CAREFUL with this option! A wavefunction will be saved for each STEM pixel. This option may therefore produce a massive amount of large files on your disk.

/avwave

(OPTIONAL) Activates the output of an average wavefunctions over multiple frozen lattice calculations.

/detimg

(OPTIONAL) Export detector image files using the diffraction space sampling as given with the input slice files.

/verbose

(OPTIONAL) Show additional processing output.

/debug

(OPTIONAL) Show extra debugging output.

 

OUTPUT DATA : When run in STEM mode, the output STEM images are 32-bit floating point binary data with a dimension as specified by the scan frame parameters in the parameter file. With one run, a separate STEM image file is created for each detector and for each selected output object thickness.
When run in coherent TEM mode (option /ctem), wave functions are stored as 64-bit complex valued binary data with a dimension equal to the input slice file dimension. With one run a separate wave function file is created for each selected output object thickness and for each run with a different frozen lattice configuration.
In cases where many files are saved, the output file name is extended by an additional suffix. The relation to a certain detector is indicated by a suffix equal to the detector name given in the detector parameter file. The relation to the object thickness selected for output is indicated by the suffix '_sl###', where ### is a slice index in the propagation sequence through the object. Random frozen phonon configurations are numbered according to the sequence of calculation and indicated by a suffix '_vr###', where ### is an index number.

 

Examples

Full STEM image simulation controlled via parameter file:
msa -prm prm\msa.prm -out img\STEMimage_raw.dat

STEM image convolution with a specific geometric source size of 0.06 nm (HWHM):
msa -prm prm\msa.prm -in img\STEMimage_raw.dat -out img\STEMimage_convoluted.dat -sr 0.06

Calculation of a TEM exit-plane wave function, fully controlled via parameter file:
msa -prm prm\msa-tem.prm -out wav\wavefunc.dat /ctem

Calculation of a TEM exit-plane wave function, for a specific object tilt (5.4, 1.5) mrad:
msa -prm prm\msa-tem.prm -out wav\wavefunc_tilted.dat -otx 5.4 -oty 1.5 /ctem

 


Last update: August 1, 2017

mailto:ju.barthel-at-fz-juelich.de

disclaimer(de)