What is Dictionary Indexing?
General Implementation Notes
Dictionary Indexing Algorithm
Obtaining the Code/Executables
Running the Code
EMprogram [-h] [-t] [file.nml]
- -h: (h=help) This argument causes the program to display a list of all available command line arguments and their meaning. The program will quit after printing the help message.
- -t: (t=template) This argument causes the program to create template files for all the name list input files used by the program. For each name-value entry in the template file, a comment line is inserted with a brief explanation of the variable and its units, if appropriate. The user can then copy the template file to a new file with the name list (.nml) extension and edit the file with a regular text editor. The program will quit after generating the template files. Each template file contains the default values for each available parameter.
- file.nml: The main name list file to be used by the program. If no name is present, then the default file name EMprogram.nml will be used. If the provided name list file does not exist, the program will report an error and abort.
EMsoft EBSD Coordinate Systems
Experimental Considerations and Tutorial Data Sets
Experimental Suggestions
Pattern Storage Formats
- EMEBSD HDF5 format;
- EDAX/TSL up1 and up2 formats;
- EDAX/TSL HDF5 format;
- Bruker HDF5 format;
- Oxford single-pattern file format;
- MatLab-generated Binary format for Oxford patterns.
Tutorial Data Sets
fcc-Nickel
Voltage | 20 kV | Sample tilt | 75.7° |
Detector size \(\left ({N^{p}_{x}} \times {N^{p}_{y}}\right )\) | 480 × 480 | Detector tilt | 10° |
Binning | 8 × 8 | Pattern center | (0.50726, 0.73792, 0.55849) |
Scan size \(\left (N^{ROI}_{h}\times N^{ROI}_{v}\right )\) | 186 × 151 | Scan step size | 1.5 μm |
Exposure level | 90% | Camera gain | 512, 832, 896 |
Camera exposure (msec) | 0.94, 0.23, 0.17 | Hough indexing rate | 99.1, 60.2, 19.4 |
Orthorhombic Forsterite
Voltage | 20 kV | Sample tilt | 70.0° |
Detector size \(\left ({N^{p}_{x}} \times {N^{p}_{y}}\right )\) | 488 × 488 | Detector tilt | 10° |
Binning | 8 × 8 | Pattern center | (0.4782, 0.7982, 0.6895) |
Scan size \(\left (N^{ROI}_{h}\times N^{ROI}_{v}\right )\) | 400 × 401 | Scan step size | 1.0 μm |
Nickel-Based Superalloy
Voltage | 20 kV | Sample tilt | 70.0° |
Detector size \(\left ({N^{p}_{x}} \times {N^{p}_{y}}\right )\) | 60 × 80 | Detector tilt | − 1.3° |
Binning | 1 × 1 | Pattern center | (0.4991, 0.4729, 0.6698) |
Scan size \(\left (N^{ROI}_{h}\times N^{ROI}_{v}\right )\) | 600 × 600 | Scan step size | 1.0 μm |
Preparatory Steps
Crystal Structure File
- Chemical formula or compound/mineral name: This may be useful to generate the filename; e.g., one could use the filename Ni3Al.xtal for the L12γ′ structure in superalloys, cpx.xtal for the monoclinic clinopyroxene structure, and Nd-garnet.xtal for a neodymium-containing garnet structure.
- Crystal system: Cubic, tetragonal, hexagonal, orthorhombic, rhombohedral, monoclinic or anorthic (triclinic). For the trigonal system, the user is offered both the rhombohedral and hexagonal settings.
- Lattice parameters: Depending on the crystal system, anywhere from one to six parameters may be needed. In all, EMsoft quantities are expressed, whenever possible, in SI-based or derived units with their unit prefixes, e.g., lattice parameters are given in nanometers throughout. Exceptions to this are the electron energies assumed to be in kiloelectron volts and tilt angles given in degrees. All input parameters have their units explicitly stated in the comment lines in the program input files.
- Space group number: A number between 1 and 230; EMsoft uses the International Tables for Crystallography, Volume A, for all crystallographic conventions. Only standard settings are available for the space groups, but some space groups may have two origin settings.
- Atom coordinates: For each atom in the asymmetric unit, a triplet of fractional coordinates is needed; optionally, coordinates can be entered as Wyckoff positions.
- Site occupation parameters: In the range [0 … 1], these parameters describe the occupation of each lattice site. Generally, those numbers are set to 1.0.
- Debye-Waller factors: for each atom in the asymmetric unit, the isotropic Debye-Waller factor is needed in units of squared nanometers. If this factor is not known for the user’s material, then one can assign a reasonable default value; experience has shown that a value in the range [0.004 … 0.006] is almost always a reasonable choice.
$ EMmkxtal < myinputfile
), or via the EMsoftWorkbench GUI. With very few exceptions, all EMsoft programs make use of these crystal structure files.- fcc Nickel (Ni): This structure file is easily generated with just a few key strokes. Taking data from Pearson’s Handbook [25], and the room temperature Debye-Waller factor from [14]:Note that the Source parameter is a string and should be surrounded by single quotes when entered by the user. If a single quote is needed inside the string, it should be preceded by an escaping quote.
- Crystal system: 1 (cubic)
- Lattice parameter: a = 0.35236 nm
- Space group: 225
- Atomic number: 28
- Atom position, site occupation parameter, Debye-Waller factor: 0, 0, 0, 1.0, 0.0035 (nm2)
- Output file name: Ni.xtal
- Source: ‘Pearson”s Handbook; Peng et al. 1996’
- orthorhombic forsterite (Fo): The structure data can be found in [22] in the non-standard Pbnm space group setting; since EMsoft only uses the standard setting for orthorhombic and monoclinic space groups, the lattice parameters and fractional coordinates need to be permuted x → z → y → x to obtain the standard Pnma setting.
- Crystal system: 3 (orthorhombic)
- Lattice parameters: a = 1.0207 nm, b = 0.5980 nm, c = 0.4756 nm
- Space group: 62
- Atom position, site occupation parameter, Debye-Waller factor: see Table 4; the table also contains the Wyckoff positions since the EMmkxtal program can be called with the -w option.
- Output file name: Fo.xtal
- Source: ‘Smyth & Hazen, Amer. Mineral. (1973) 58:588-593’
- orthorhombic enstatite (En): Structure information can be found in [7] in the Pbca space group setting; there is a small amount of enstatite (Mg2Si2O6) present in the sample used for this tutorial.
- Crystal system: 3 (orthorhombic)
- Lattice parameters: a = 1.8235 nm, b = 0.8818 nm, c = 0.5179 nm
- Space group: 61
- Output file name: En.xtal
- Source: ‘Ghose et al., Z. Kristall. (1986) 176:159-175’
Atom | Z | (x,y,z) | f | B [nm2] | Wyckoff |
---|---|---|---|---|---|
Mg | 12 | (0.0000, 0.0000, 0.0000) | 1.0 | 0.0026 | 4a |
Mg | 12 | (0.2774, 0.2500, 0.9915) | 1.0 | 0.0022 | 4c |
Si | 14 | (0.0940, 0.2500, 0.4262) | 1.0 | 0.0008 | 4c |
O | 8 | (0.0913, 0.2500, 0.7657) | 1.0 | 0.0027 | 4c |
O | 8 | (0.4474, 0.2500, 0.2215) | 1.0 | 0.0024 | 4c |
O | 8 | (0.1628, 0.0331, 0.2777) | 1.0 | 0.0027 | 8d |
Atom | Z | (x,y,z) | f | B (nm2) | Wyckoff |
---|---|---|---|---|---|
Mg | 12 | (0.3758, 0.6539, 0.8658) | 1.0 | 0.00478 | 8c |
Mg | 12 | (0.3768, 0.4869, 0.3588) | 1.0 | 0.00669 | 8c |
Si | 14 | (0.2717, 0.3417, 0.0503) | 1.0 | 0.00340 | 8c |
Si | 14 | (0.4736, 0.3373, 0.7983) | 1.0 | 0.00335 | 8c |
O | 8 | (0.1835, 0.3401, 0.0347) | 1.0 | 0.00472 | 8c |
O | 8 | (0.5623, 0.3403, 0.8002) | 1.0 | 0.00479 | 8c |
O | 8 | (0.3109, 0.5025, 0.0432) | 1.0 | 0.00578 | 8c |
O | 8 | (0.4328, 0.4829, 0.6891) | 1.0 | 0.00580 | 8c |
O | 8 | (0.3032, 0.2226, 0.8320) | 1.0 | 0.00575 | 8c |
O | 8 | (0.4476, 0.1951, 0.6036) | 1.0 | 0.00544 | 8c |
Monte Carlo BSE Simulation
&MCCLdata
mode = 'full', ! 'bse1' for ECP; 'full' for EBSD/TKD
xtalname = 'Ni.xtal', ! or 'Fo.xtal' for the forsterite example
sig = 75.7, ! sample tilt angle or 70.0 for Fo/En
numsx = 501, ! # pixels along x-direction [odd number!]
platid = 2, ! GPU platform ID selector (from EMOpenCLinfo)
devid = 1, ! GPU device ID selector
totnum_el = 2000000000, ! total number of incident electrons (< 2^(31)-1)
multiplier = 1, ! use if more than 2^(31)-1 electrons needed
EkeV = 20.D0, ! incident beam energy [keV]
Ehistmin = 10.D0, ! minimum energy to consider [keV]
Ebinsize = 1.0D0, ! energy bin size [keV]
depthmax = 100.D0, ! maximum depth [nm]
depthstep = 1.0D0, ! depth step size [nm]
dataname = 'datapathname/Ni-master-20kV.h5' ! or 'Fo-master-20kV.h5'
! or 'En-master-20kV.h5'
$ mv EMMCOpenCL.template myEMMCOpenCL.nml
or using rename on Windows) the EMMCOpenCL program can be called and pointed to the .nml input file:
EMMCOpenCL path_to_nml_file/myEMMCOpenCL.nml
EBSD Master Pattern Simulation
&Bethelist
! strong beam cutoff
c1 = 4.0,
! weak beam cutoff
c2 = 8.0,
! complete cutoff
c3 = 50.0,
/
&EBSDmastervars
! smallest d-spacing to take into account [nm]
dmin = 0.05, ! reasonable compromise between speed & accuracy
! # pixels along x-direction of the square master pattern (2*npx+1)^2
npx = 500, ! this value produces good master patterns
! name of the energy statistics file produced by EMMCOpenCL program;
! this file will also contain the output data of the master program
energyfile = 'datapathname/Ni-master-20kV.h5', ! or Fo-master-20kV.h5
! or En-master-20kV.h5
! number of OpenMP threads
nthreads = 1, ! # of threads to be used for computation
/
Dictionary Indexing
Setting the Detector Geometry
Data | (x∗,y∗,z∗) | δ (μm) | (xpc,yPC) | L (μm) |
---|---|---|---|---|
Ni | (0.50726, 0.73792, 0.55849) | 59.2 | (3.4848, 114.2016) | 15,767.7 |
Fo/En | (0.47821, 0.79819, 0.68948) | 59.2 | (− 10.6320, 145.5187) | 19,918.9 |
Ni-Super | (0.4991, 0.4729, 0.6698) | 50.0 | (− 0.55, 13.00) | 16075.2 |
- Using the vendor software;
- Interactively, using the IDL GUI efit;
- Manually, using the EMsoftWorkbench;
- Automatically, using the EMDPFit program
Determination of Pattern Pre-Processing Parameters
&EBSDDIpreviewdata
numsx = 80, ! number of pattern pixels along x (Nx)
numsy = 60, ! and along y (Ny)
ipf_wd = 600, ! number of patterns along horizontal axis (Nh)
ipf_ht = 600, ! and along vertical axis (Nv)
hipasswmax = 0.5, ! hipass width parameter maximum (starts near zero)
hipasswnsteps = 10,! and number of steps
nregionsmin = 1, ! minimum # regions for adaptive histogram equalization
nregionsmax = 10, ! maximum number
nregionsstepsize = 1, ! step size
! preprocessed pattern tiff file
tifffile = 'DItutorial/NiSuper/NiSuper-matrix.tiff',
! raw original pattern tiff file
patternfile = 'DItutorial/NiSuper/NiSuper-reference.tiff',
exptfile = 'DItutorial/NiSuper/Bruker-NiSuper.h5', ! data file
inputtype = 'BrukerHDF', ! input file type
HDFstrings = 'LEROY_0089_Section_434' 'EBSD' 'Data' 'RawPatterns' , ! HDF path
patx = 243, ! pattern coordinate x to be used for the preview
paty = 286, ! y coordinate
/
Setting Up the Indexing Run
&EBSDIndexingdata
!###################################################################
! INDEXING MODE
!###################################################################
!
! 'dynamic' for on the fly indexing or 'static' for
! pre-calculated dictionary
indexingmode = 'dynamic',
! ...
!###################################################################
! DICTIONARY PARAMETERS: COMMON TO 'STATIC' AND 'DYNAMIC'
!###################################################################
! do you want Email or Slack notification when the run has completed?
Notify = 'Off',
ipf_wd = 100, ! width of data set in pattern input file or Nh
ipf_ht = 100, ! height of data set in pattern input file or Nv
! define the region of interest as ROI = x0 y0 w h;
! Leave all at 0 for full field of view.
! Region of interest has the point (x0,y0) as
! its lower left corner and is w x h patterns
ROI = 0 0 0 0,
stepX = 1.0,
stepY = 1.0, ! X and Y sampling step sizes
nnk = 50, ! # top matches to keep
nnav = 20, ! # top matches used for orientation averaging (<nnk)
nosm = 20, ! # top matches used for OSM computation
maskpattern = 'n', ! mask 'y' or 'n'
maskradius = 240, ! mask radius (pixels, AFTER binning)
hipassw = 0.05, ! high pass filter width parameter; 0.05 is reasonable
nregions = 10, ! # regions for adaptive histogram equalization
! ...
!###################################################################
! ONLY SPECIFY WHEN INDEXINGMODE IS 'DYNAMIC'
!###################################################################
ncubochoric = 100, ! # cubochoric points to generate orientation list
L = 15000.0, ! distance scintillator - illumination point [microns]
thetac = 10.0, ! camera tilt [degrees]
delta = 50.0, ! CCD pixel size on scintillator [microns]
numsx = 640, ! # CCD pixels along x
numsy = 480, ! and y
xpc = 0.0, ! pattern center x [pixels]
ypc = 0.0, ! pattern center y
omega = 0.0, ! angle between normal of sample and detector [RD, degrees]
energymin = 10.0, ! minimum energy to use for interpolation [keV]
energymax = 20.0, ! maximum energy
beamcurrent = 150.0, ! incident beam current [nA] (irrelevant, but not zero)
dwelltime = 100.0, ! beam dwell time [micro s] (irrelevant, but not zero)
binning = 1, ! binning mode (1, 2, 4, or 8)
scalingmode = 'not', ! intensity scaling mode 'not' = no scaling,
! 'lin' = linear, 'gam' = gamma correction
gammavalue = 1.0, ! gamma correction factor
!...
!###################################################################
! INPUT FILE PARAMETERS: COMMON TO 'STATIC' AND 'DYNAMIC'
!###################################################################
exptfile = 'undefined', ! data file location [w.r.t. EMdatapathname]
inputtype = 'Binary', ! input file type parameter: Binary, EMEBSD,
! TSLHDF, TSLup1, TSLup2, OxfordHDF,
! OxfordBinary, BrukerHDF
HDFstrings = '' '' '' '' '' '' '' '' '' '', ! data set full path & name
! ...
!###################################################################
! OTHER FILE PARAMETERS: COMMON TO 'STATIC' AND 'DYNAMIC'
!###################################################################
tmpfile = 'EMEBSDDict_tmp.data', ! temporary data storage file name;
! stored in HOME/.config/EMsoft/tmp
keeptmpfile = 'n', ! keep or delete tmp file ?
datafile = 'undefined', ! output file; path relative to EMdatapathname
ctffile = 'undefined', ! ctf output file; path relative to EMdatapathname
! angfile = 'undefined', ! ang output file; path relative to EMdatapathname
eulerfile = 'undefined' ! euler angle input file
! ...
!###################################################################
! ONLY IF INDEXINGMODE IS STATIC
!###################################################################
dictfile = 'undefined', ! filename of dictionary file,
! path relative to EMdatapathname
!
!###################################################################
! ONLY IF INDEXINGMODE IS DYNAMIC
!###################################################################
masterfile = 'undefined', ! master pattern input file;
! path relative to EMdatapathname
! ...
!###################################################################
! SYSTEM PARAMETERS: COMMON TO 'STATIC' AND 'DYNAMIC'
!###################################################################
numdictsingle = 1024, ! # dictionary patterns in column for dot product
! on GPU (multiples of 16 perform better)
numexptsingle = 1024, ! # experimental patterns in column for dot product
! on GPU (multiples of 16 perform better)
nthreads = 1, ! # threads for parallel execution
platid = 1, ! platform ID for OpenCL portion of program
! if you are running EMEBSDDI, EMECPDI, EMTKDDI, then define the
! device you wish to use
devid = 1, ! device ID
multidevid = 0 0 0 0 0 0 0 0, ! leave unchanged
usenumd = 0, ! # GPU devices do you want to use?
/
Running the Dictionary Indexing Program
$ nohup EMEBSDDI EMEBSDDI-Ni.nml > EMEBSDDI-Ni.out 2> EMEBSDDI-Ni.err &
Orientation Refinement
&RefineOrientations
! number of parallel threads to use for refinement run
nthreads = 1,
! name of input dot product HDF5 file
dotproductfile = 'undefined',
! name of ctf output file for refined orientations
ctffile = 'undefined',
! name of temporary file for pre-processed patterns
! (will override the temporary file name defined in the dot product file)
tmpfile = 'undefined',
! modality ('EBSD' or 'ECP')
modality = 'EBSD',
! keep the pre-processed patterns all in memory?
inRAM = .FALSE.,
! how many items from the top matches list need to be refined?
matchdepth = 1,
! refinement method:
! 'SUB' : refinement by hierarchical sub-sampling of cubochoric grid
! 'FIT' : fit by "bound optimization by quadratic approximation" (BOBYQA) in
! homochoric space (generally faster than SUB)
method = 'FIT',
! ===================================
! if method == 'SUB'
! number of hierarchical iterations
niter = 1,
! number of points sampled around given point [(2*nmis+1)^3]
nmis = 1,
! ===================================
! if method == 'FIT'
! max step size to take in homochoric space during the refinement
step = 0.03,
! In FIT mode, this program can also include pseudo-symmetric variants
! in the list of starting orientations to refine. Pseudo-symmetric variant
! Euler triplets or axis-angle pair(s) are stored in the PSvariantfile.
! format: first line 'ax', second line number of axis-angle pairs,
! then one pair per line (unit vector, angle last in degrees)
! or format: first line 'eu', second line number of Euler triplets,
! then one triplet per line (in degrees)
PSvariantfile = 'undefined',
! ===================================
/