-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathEMsoft.tex
More file actions
544 lines (467 loc) · 34.9 KB
/
Copy pathEMsoft.tex
File metadata and controls
544 lines (467 loc) · 34.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
\documentclass[DIV=calc, paper=letter, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size
\usepackage[body={6.5in,9.0in},
top=1.0in, left=1.0in]{geometry}
\usepackage[english]{babel} % English language/hyphenation
\usepackage[protrusion=true,expansion=true]{microtype} % Better typography
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage[svgnames]{xcolor} % Enabling colors by their 'svgnames'
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{fix-cm} % Custom font sizes - used for the initial letter in the document
\usepackage{soul}
\usepackage{sectsty} % Enables custom section titles
\allsectionsfont{\usefont{OT1}{phv}{b}{n}} % Change the font of all section commands
\usepackage{fancyhdr} % Needed to define custom headers/footers
\pagestyle{fancy} % Enables the custom headers/footers
\usepackage{lastpage} % Used to determine the number of pages in the document (for "Page X of Total")
\usepackage{fancyvrb}% used to include files verbatim
%\usepackage{chemsym}
\usepackage{hyperref}
\usepackage[backend=bibtex,style=numeric,sorting=ydnt,maxnames=15]{biblatex}
\renewbibmacro{in:}{}
% Count total number of entries in each refsection
\AtDataInput{%
\csnumgdef{entrycount:\therefsection}{%
\csuse{entrycount:\therefsection}+1}}
% Print the labelnumber as the total number of entries in the
% current refsection, minus the actual labelnumber, plus one
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\newrobustcmd*{\mkbibdesc}[1]{%
\number\numexpr\csuse{entrycount:\therefsection}+1-#1\relax}
%\addbibresource[label=papers]{mypubs.bib}
%\addbibresource[label=books]{mypubs.bib}
%\addbibresource[label=edited]{mypubs.bib}
%\addbibresource[label=chapters]{mypubs.bib}
% Headers - all currently empty
\lhead{}
\chead{}
\rhead{}
% Footers
%\lfoot{\textsf{EMsoft--2015} manual, Release 3.0, \today}
\lfoot{\textsf{EMsoft--2017} manual, Release 3.2, \today}
\cfoot{}
\rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}} % "Page 1 of 2"
\renewcommand{\headrulewidth}{0.0pt} % No header rule
\renewcommand{\footrulewidth}{0.4pt} % Thin footer rule
\usepackage{lettrine} % Package to accentuate the first letter of the text
\newcommand{\initial}[1]{ % Defines the command and style for the first letter
\lettrine[lines=3,lhang=0.3,nindent=0em]{
\color{DarkGoldenrod}
{\textsf{#1}}}{}}
\usepackage{titling} % Allows custom title configuration
\newcommand{\HorRule}{\color{DarkGoldenrod} \rule{\linewidth}{1pt}} % Defines the gold horizontal rule around the title
\pretitle{\vspace{-1.5in} \begin{center} \HorRule \fontsize{25}{25} \usefont{OT1}{phv}{b}{n} \color{DarkRed} \selectfont} % Horizontal rule before the title
\title{EMsoft:\\ General User and\\ Development Manual} % Your article title
\posttitle{\par\end{center}\vskip 0.5em} % Whitespace under the title
\preauthor{\begin{center}\large \lineskip 0.5em \usefont{OT1}{phv}{b}{sl} \color{DarkRed}} % Author font configuration
\author{\vspace*{-0.7in}} % Your name
\postauthor{\footnotesize \usefont{OT1}{phv}{m}{sl} \color{Black} % Configuration for the institution name
\par\end{center}\HorRule} % Horizontal rule after the title
%\date{Program Manual, Release 3.0, \today}
\date{Program Manual, Release 3.2, \today}
\newcommand{\ctp}{\textsf{EMsoft}}
\newcommand{\ctpb}{\textbf{\textsf{EMsoft}}}
%
\begin{document}
\maketitle
\renewcommand{\contentsname}{Table of Contents}
{\small\tableofcontents}
\newpage
\section{What is \ctpb?}
\ctp\ is an open source package for the simulation of electron microscopy imaging and diffraction modalities. It consists of a library with
core routines for crystallography, symmetry, dynamical scattering, Monte Carlo simulations, and so on, plus a series of programs for different imaging and diffraction modalities.
The package is based on the older, and now discontinued, \textsf{CTEMsoft} package, for which the version 2.0 source code is still
available at \textit{http://www.github.com/marcdegraef/CTEMsoft}. This code base is no longer supported and was replaced
by the version 3.1 source code base in March of 2017; the latest version, 3.2, is now available from \textit{http://www.github.com/marcdegraef/EMsoftPublic}.
In the current release, we provide a series of additional support programs as well as several new programs and improvements to the library modules.
This manual describes a few aspects of the \ctp\ package:
\begin{itemize}
\item how to install the software developer toolkit;
\item the different ways of communicating with the programs (input files);
\item and a list of programs available in this release (3.2).
\end{itemize}
If you wish to compile \ctp\ yourself, then please proceed with the next section; if you only plan on using the
executables, please jump ahead to section~\ref{sec:todo}.
\section{System Requirements\label{sec:sysreq}}
For detailed system requirements and for instructions on how to install the Software Developer Kit (SDK), see the \textsf{EMsoftSDK\_Installation.md} file in the top \ctp\ folder.
Certain \ctp\ programs require a GPU (Graphical Processing Unit), which, in turn, requires proper installation of OpenCL (automatic on Mac OS X with XCode 7; needs driver
installation on all other platforms). A standard graphics card in a laptop is likely insufficient to run the GPU-based programs.
\section{The \ctpb\ Software Developer Kit\label{sec:SDK}}
If you wish to compile the package code yourself, then you will first need to pull the code base from github; you can
clone the repository from \textit{http://www.github.com/marcdegraef/EMsoft}. Select a location on your hard drive to
host the source code tree; we recommend that the foldername be \ctp, but you are obviously free to change this.
Before you can start to compile the code, you must install the software developer kit (SDK). This is made very easy thanks to our
friends at BlueQuartz.net; open a terminal window, navigate inside the \ctp\ tree to the folder \textsf{Support/SDK\_Build\_Scripts} and
then select the folder for your OS. In that folder you will find a file called \textsf{SDK\_Configuration.conf}. Use a text editor to
edit this file. The SDK must be built in its own folder which you can place anywhere on your system; here are a few logical
locations for the SDK:
\begin{itemize}
\item if you are the only user on that computer, and you do not have root access, then it makes sense to place the SDK at the top level in your home folder.
\item if you have root access, then perhaps an installation in the /opt folder (Linux and Mac) or in the /Users/Shared folder (Mac) would be appropriate.
\end{itemize}
Once you decide where to place the SDK, edit the \textsf{SDK\_PARENT} field in the configuration file to set the appropriate top folder; we
suggest that you do not change the \textsf{SDK\_FOLDER\_NAME}. The \textsf{SDK\_INSTALL} variable should then combine the previous two
variables. The remaining parameters in the first block of generic setup parameters should be left unchanged, with the exception of the \textsf{PARALLEL\_BUILD}
parameter which sets the number of cores to use for the SDK compilation.
The second block of parameters define the fortran-90 compiler that will be used to generate the SDK. Only gnu (gfortran) and intel (ifort)
are allowed, and you should set the corresponding install parameter. You should also set the \textsf{JSONFORTRAN\_FC\_VENDOR}
parameter further down in the file to the same gnu or intel value. All other parameters should be left unchanged. Save the modified
configuration file. Make sure your shell init script (e.g., .cshrc for the C-shell on UNIX systems) has an entry to define the fortran compiler
location, as in
\begin{verbatim}
setenv FC /opt/local/bin/gfortran
\end{verbatim}
for the C-shell and a similar entry for other shells.
The build script should be executed with
\begin{verbatim}
(sudo) ./Build_SDK.sh
\end{verbatim}
on unix-based systems and
\begin{verbatim}
???? ./Build_SDK.sh
\end{verbatim}
on Windows.
This shell script will download the \textsf{EMsoft\_SDK} archive files from one of the BlueQuartz web servers and compile
them. The script will install the following program and libraries:
\begin{itemize}
\item \textsf{CMake}: CMake is a package that manages the entire compilation process. To make sure that the correct version is used, it is installed first.
\item \textsf{fftw3}: the FFTW3 library for Fourier transforms [included as of Release 3.1]
\item \textsf{jsonfortran}: a small library to parse and create json-formatted files (JavaScript Object Notation);
\item \textsf{clfortran}: another small library with wrapper routines to call OpenCL from within f90 programs. Note that a previous version of EMsoft used
the fortrancl library, which is now no longer needed.
\item \textsf{HDF5}: a large library for Hierarchical Data Format support; note that this library will be compiled twice, once in debug mode and once in release mode.
It is normal for there to be a large number of warnings during the compilation; just ignore them.
\end{itemize}
All five of these packages should compile and install without any issues, assuming that you have the correct compilers on your system. Note that the
installation is sandboxed, i.e., it will not interfere with or overwrite any existing implementations of these libraries; you should only use the libraries
inside the sandbox, though. The compilation process should only take about five minutes. Once the SDK has been compiled, you will be ready to compile \ctp,
as described in the next section.
\section{Compiling \ctpb\label{sec:compile}}
Add the location of the cmake bin folder inside the SDK to your path variable; this will depend on your operating system and the type
of shell you are using. For Mac OS X, the command is as follows (assuming the default SDK location):
\begin{verbatim}
export PATH=$PATH:/SDKfolder/cmake-#-#-#-Darwin-x86_64/CMake.app/Contents/bin/
\end{verbatim}
For Linux, use
\begin{verbatim}
export PATH=$PATH:/SDKfolder/cmake-#-#-#-Linux-x86_64/bin/
\end{verbatim}
Typically, you would add this line, or a similar one for other shells, to your \textsf{.bashrc} or \textsf{.cshrc} file. At the time of release 3.1, the cmake version
number is 3.6.2.
In a terminal window, cd to the folder that contains your \textsf{EMsoft} top folder, create a \textsf{EMsoftBuild} folder, cd inside it and enter the following command:
\begin{verbatim}
cmake -DEMsoft_SDK=/SDKfolder -DCMAKE_BUILD_TYPE=Debug ../EMsoft
\end{verbatim}
where /SDKfolder is the location of the SDK folder that you installed in the previous section.
[note that you can also set the build type to Release; this will produce faster executing code, but error messages in case a program fails
will not be as informative as for the Debug build type]
This will spit out a number of variables and path names.\footnote{If you get any error messages or notice things that do not look right, please contact us with a
screen dump as well as a description of your system, including the OS version.} This is the first cmake run, which will set up all necessary variables
for future runs. The next time you call the cmake program, you can omit the arguments (except for ../EMsoft); you can also use the interactive ccmake version.
To compile the \ctp\ package, simply type
\begin{verbatim}
make -j#
\end{verbatim}
where \# stands for the number of cores you want to use for the compilation
and the entire library and all the executables will be compiled. From here on, you can start editing the source code and recompile things as needed.
All executables will be located in the \textsf{EMsoft/Bin} folder (or \textsf{EMsoftBuild/Bin} if you have just set up the SDK), so you may want to add this folder to your path variable.
Next, you will need to set up your configuration file; that process is described in the next section.
\section{Installation Instructions\label{sec:todo}}
If you chose not to compile the code, and you only wish to execute the programs, or you did perform the steps in the last two sections, you will
now need to set up your environment so that the executables will be found. The package file with executables can be downloaded from the following
location:
\begin{verbatim}
http://muri.materials.cmu.edu/
\end{verbatim}
In the older version of CTEMsoft, the programs required several environment variables to be set, so
that all the resource files and such could be located. In the present release, this has been changed
to a more flexible system that should work on all platforms (OS X, Linux and Windows). There are
only a few variables that need to be set in order for the programs to function properly. They are defined
via the \textsf{EMsoftConfig.json} file, located inside the hidden \textsf{.config/EMsoft} folder in the user's
home directory.
\begin{enumerate}
\item If you are installing the executables, place the \textsf{EMsoft.zip} archive somewhere inside your home folder; for instance, if your username is ``me,'' you could create
a folder named \textsf{packages} inside the \textsf{/Users/me} folder, and download the archive inside \textsf{/Users/me/packages}.
Then unpack the archive, which will create an \textsf{EMsoft} folder containing several other folders. If you installed the SDK and source code,
you may skip this step.
\item If you are using a standard installation as described in this document, you should be able
to cd into the \textsf{EMsoft/bin} folder (\textsf{EMsoftBuild/Bin} if you installed the SDK) and execute the program \textsf{EMsoftInit} from the command line.
This program makes some assumptions about where several folders are located and creates the configuration file
for you with a number of default entries. If this program fails, it maybe because you are attempting a non-standard
installation, so you can proceed manually and create the configuration file as described in the next paragraph;
note that every EMsoft program will read this configuration file at the start of the execution. In addition to creating
the configuration file, this program also creates an \textsf{EMdata} folder at the same level as your top EMsoft folder,
as well as an \textsf{XtalFolder} inside it; this latter folder will be used to store crystal structure files and must be present.
For a manual creation of the configuration file, first check whether or not the \textsf{.config} folder exists in your home folder; if it doesn't exist, create it (don't forget the
period in front of the folder name). Then go into this folder and create the \textsf{EMsoft} folder; go into
that folder and create a \textsf{tmp} folder. Then, at the same level as the tmp folder, use a text editor to
create a file with the name \textsf{EMsoftConfig.json} and enter the following ten lines, including the curly braces:
\begin{verbatim}
{
"EMsoftpathname" : "/full/path/to/the/top/EMsoft/installation/folder/",
"EMdatapathname" : "/full/path/to/the/EMsoft/data/folder/",
"EMtmppathname" : "/full/path/to/.config/EMsoft/tmp/",
"EMsoftLibraryLocation" : "/full/path/to/the/library/folder/",
"Release" : "No",
"UserName" : "Your full name",
"UserLocation" : "Your location or affiliation",
"UserEmail" : "Your email address"
}
\end{verbatim}
If you installed the SDK, then you should also add the line \textrm{"Develop" : "Yes",} to the configuration file.
Note that the white space at the start of lines 2 through 8 is a tab. Obviously, you will need to change the paths above.
Typically, the installation folder would be somewhere below your home folder, so on Mac OS X for instance, this
could be \textsf{/Users/me/packages/EMsoft/}; note that the path must be terminated with a \textsf{/}.
The second variable indicates where you will keep your data files, i.e., all the files generated by the \ctp\ programs.
This folder must be outside of the main \ctp-tree, so that no data will be overwritten when future updates or releases
become available. Create a top data folder, for instance \textsf{/Users/me/Data/EMplay/}. Then, inside this folder,
create an additional folder with the name \textsf{XtalFolder}; this is where all the crystal structure descriptor files
will be kept. Whenever the user specifies the location of a data file, this location is always a relative pathname
with respect to the \textsf{EMdatapathname} location; so, if we have \textsf{EMdatapathname} set to \textsf{/Users/me/Data/EMplay/},
and we wish to create a data file with absolute pathname \textsf{/Users/me/Data/EMplay/Silicon/EBSDmaster.h5}, then
the relative pathname will be \textsf{Silicon/EBSDmaster.h5}. This makes it possible to exchange data files
between users or transfer files from one system to another. The variable \textsf{Release} must be set to \textsf{Yes} if you are
using the Release version of this package (in other words, if you installed the executables). If instead you have installed the
Software Developer Kit, and you are editing source code and compiling things yourself, then you should set this variable to \textsf{No}. Note that this variable,
along with the \textsf{EMsoftLibraryLocation} variable, are only used by the IDL visualization interface.
Finally, set the variables that start with \textsf{User} to the correct values; these
variables will appear in all of the HDF5 files created by the \textsf{EMsoft} programs (added in Release 3.0.1).
\item Adjust the PATH variable so that your shell will find the executables in the \textsf{EMsoft/bin} (or \textsf{EMsoftBuild/Bin}) folder.
You can either do this via your shell setup files (e.g., \textsf{.cshrc}
or \textsf{.bashrc}), or via the system wide \textsf{/etc/paths} file (which will require \textsf{sudo} access).
The syntax will depend a little on which shell you are using (for UNIX-based systems). Note that the UNIX flavor on Mac OS X
is not case-sensitive for file and folder names; on all other UNIX-flavored platforms, filenames and folders \textit{are}
case-sensitive.
\item To view the HDF5 formatted data files, you may wish to install the free HDF5 viewer. First you need to have Java installed (if it isn't already):
for Mac OS X, go to
\begin{verbatim}
https://java.com/en/download/faq/java_mac.xml
\end{verbatim}
to install Java. Then download the HDF5 viewer app from
\begin{verbatim}
http://www.hdfgroup.org/products/java/release/download.html;
\end{verbatim}
scroll down to Max OS X.
The HDF5 files can also be read by any other program that supports this format, e.g., IDL, Matlab, etc...
\end{enumerate}
\newpage
\section{The general structure of EMsoft programs\label{sec:structure}}
Each \ctp\ program has the same high level source code structure, and is called in the same way. If \textsf{EMprogram} represents
a program name (for instance \textsf{EMECP} or \textsf{EMlacbed}, then the following command line options can be used (all of them optional):
\begin{verbatim}
EMprogram [-h] [-t] [file.nml]
\end{verbatim}
The arguments between square brackets are optional, and are defined as follows:
\begin{itemize}
\item \textsf{-h}: (h=help) this argument causes the program to display a list of all command line arguments and their meaning. The program will quit after printing
the help message.
\item \textsf{-t}: (t=template) this argument causes the program to create template files for all the input files used by the program. For each
name-value entry in the template file (see section~\ref{sec:f90input} for more details), 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 namelist (.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 parameter.
If this option produces an error, then this is likely due to an incorrect setting of the shell variables in the previous section.
\item \textsf{file.nml}: the main namelist file to be used by the program. If no name is present, then the default filename \textsf{EMprogram.nml} will be used. If the
provided namelist file does not exist, the program will report an error and abort.
\end{itemize}
Note that the programs will also accept .json files instead of .nml files.
The programs in the top half of the table on the last page of this manual function in the way described above; all other programs
have a simple command line interface, with user prompts for all relevant variables. Eventually, in a future release, all programs
will make use of namelist or json input files and will likely be callable from a single user interface (i.e., DREAM.3D).
\newpage
\section{Program input files\label{sec:f90input}}
All user input for the \ctp\ programs is performed either via namelist files or via json files; the namelist is a special f90 IO format that allows one to list
\textit{name-value} pairs in an ordinary text file, and then this file will be read and interpreted by the
program. The basic format of a namelist file is as follows:
\begin{verbatim}
&nmlname
var1 = val1
var2 = val2
...
/
\end{verbatim}
The first line must begin with the ampersand character ``\&'' and is followed (without spaces) by the internal name used by the program
to identify the set of variables (this is similar to a \textit{common block} in the older f77 standard). After the mandatory first line, which should not be altered, a
list of name-value pairs follows. These can appear in any order, and variables may be omitted from the file, in which case the program
will use a default value (this value can be found in the template file; see section~\ref{sec:structure}). The final line of the file must contain a single forward slash
character, ``/'', to end the namelist.
The json format (JavaScript Object Notation) is an xml-like version of the name-value pairs, and is very similar to the namelist format, with the exception
of the presence of curly braces. For the example namelist file shown above, the equivalent json file would look as follows:
\begin{verbatim}
{
"nmlname": {
"var1": val1,
"var2": val2,
...
}
}
\end{verbatim}
The \ctp\ programs automatically detect which format of input file is used, so either one is fine (provided yo use the extension ``nml'' for namelist files,
and ``json'' for JSON files). You can tell most \ctp\ programs to
generate a template input file for you by calling the program with the -t option to generate an nml file, and the -j option (since release 3.2)
to generate the corresponding json input file. Note that a correctly formatted json file does not allow for comment lines; the template input files
that are produced by the -j option \textit{do} have comment lines, however (using the standard f90 ! mark to begin the comment line). This
deviation from the json standard is necessary to explain to the user what each of the variables stands for and it also make the namelist and json
files consistent with each other. The fortran programs will first remove all the comment lines from the user-created json input file and generate
a temporary json file which will then be parsed. \\
As a concrete example, consider the namelist file used to define a dislocation:\footnote{Note that this example will be superceded
by a general json defect description file starting in release 3.2; The example is still useful for other nml files, though.}
\begin{Verbatim}%
[formatcom=\color{blue},frame=lines]
&dislocationdata
id = 0.501
jd = 0.501
u = 1.0,0.0,1.0
bv = 0.5,0.0,0.5
/
\end{Verbatim}
Internally, the program identifies this set of variables with the namelist identifier ``dislocationdata,'' as shown on the first line of the file.
Then there are four name-value pairs: \textsf{id} and \textsf{jd} are real numbers in the range $[-1,1]$ and define the position
of the defect; \textsf{u} represents the line direction, which is declared as a triplet of
floating point numbers; and the burgers vector is represented by another triplet of floating point numbers and the variable name \textsf{bv}.
The forward slash closes the file. Note that these entries can appear in any order. Comment lines are allowed in the namelist
file; simply start the line with the f90 comment character (the exclamation mark ``!'') and then type your comment. For variables that
have components, such as the two vectors above, one may also define each component separately, in which case the file would look
as follows:
\begin{verbatim}
&dislocationdata
id = 0.501
jd = 0.501
! these vectors are defined one component at a time
u(1) = 1.0
u(2) = 0.0
u(3) = 1.0
bv(1) = 0.5
bv(2) = 0.0
bv(3) = 0.5
/
\end{verbatim}
It is not necessary to leave spaces before and after the ``='' symbol, but it does improve the readability of the namelist file to do so. Since
one can always recover the template file(s) by using the [-t] option when calling the program, there is no need to list all the name-value pairs
in the namelist file; pairs which are not listed will take on their default value(s), which are the ones listed in the template file.
One important thing to note: when entering file names and other strings in name list files, one must use single quotes both at the start and at
the end of the string. Some word processing programs have so-called ``smart quotes'' settings, which will introduce a different kind of quote,
and the fortran programs will not recognize smart quotes as being the same as single quotes. Therefore, turn off the ``smart quotes'' option
in your editor before you start editing namelist or json files.
\newpage
\section{Generating a crystal structure file\label{sec:f90input5}}
With very few exceptions, all programs in the \ctp\ suite of programs require a crystallographic input file that defines the
crystal system, crystal lattice parameters, space group number, and all unique positions in the
asymmetric unit along with site occupations and Debye-Waller parameters. To keep things simple and
portable across platforms, structure description files (*.xtal) are small HDF5-formatted files that contain the minimum
amount of information needed to unambiguously define the complete unit cell.
To create a crystal structure description file, one uses the \textsf{EMmkxtal} program, which will prompt
the user for the crystal system number, the lattice parameters (in nm and degrees), the space group number,
and the atom positions in the asymmetric unit. Each atom entry is defined by five numbers: the fractional
coordinates (which can be entered as real numbers or as fraction, e.g., $0.5$ or $1/2$), the site
occupation parameter (a real number between $0$ and $1$), and the isotropic Debye-Waller factor in nm$^{2}$.
Once all atoms in the asymmetric unit have been entered, the program will ask for a structure file name; we
recommend that all such files have the extension \textsf{.xtal}, to make them easily recognizable. All .xtal files
will be automatically placed in the \textsf{XtalFolder} inside the main \ctp\ data folder.
Starting with release 3.1, the \textsf{EMmkxtal} program can be called with the \textsf{-w} option, which changes
the entering of atom coordinates to the use of the Wyckoff position symbols. After the space group number
has been entered, the program will list the periodic table as well as the list of available Wyckoff symbols. The user then
enters the atomic number, site occupation parameters and Debye-Waller factor first, followed by the Wyckoff position
symbol. If this position requires any variables to be set, then the user will be asked to enter those values as well.
Saving the file then proceeds as above.
%
%For space groups with two origin settings, special care is needed when defining the space group number.
%
%Finally, for trigonal space groups, one can define the lattice parameters in terms of the rhombohedral unit cell or a hexagonal unit
%cell. The \ctp\ programs will check the value of the $\gamma$ unit cell angle; if $\gamma=120^{\circ}$, then the hexagonal setting
%will be taken, otherwise the rhombohedral unit cell will be assumed.
%
\section{List of programs\label{sec:executables}}
The list below shows all the available programs in the current Release (3.1) of the \ctp\ suite, along with whether or not there is a
manual for that program. Programs for which no manual is available are generally relatively easy to figure out.
Programs indicated in {\color{blue}blue} are new in release 3.1. The abbreviation ``DI'' stands for Dictionary Indexing, a
new approach to the indexing of electron diffraction patterns.
In the current release, many programs still have a command-line interaction with the user; this will be modified
in a future release so that all programs will eventually make use of namelist files; at a much later point in the future,
all programs will become accessible via a GUI, either the \textsf{EMsoftToolbox} or \textsf{DREAM.3D}. The top half of the table
lists those programs for which extensive manual pages are available; in some cases there are IDL visualization routines as well. The \textsf{EMmkxtal}
program is explained in the present document. The other programs in the bottom half of the list do not yet have manual pages, but are generally
simple to figure out. Many of the programs in the bottom half of the table are simple illustrations of how
to perform certain computations but they may have some general usefulness as well.
Note that several programs may be described in a single manual. Currently (release 3.1) the following manuals are available (in addition to this one):
\textsf{EMEBSD.pdf}, \textsf{EMIndexing.pdf}, and \textsf{HDFsupport.pdf} (this last one is meant to explain our HDF5 support library for those who wish
to write their own codes and make use of the HDF5 output format). Additional manuals will be added when we find the time to write them...
\begin{table*}[h]
\centering\leavevmode
{\footnotesize
\begin{tabular}{|l|l|c|}
\hline
Program & Short description & Manual? \\
\hline\hline
% \textsf{EMlacbed} & large angle CBED pattern computation (TEM)& $\checkmark$ \\
% \textsf{EMmbcbed} & regular CBED pattern (TEM)& $\checkmark$\\
% \textsf{EMSRdefect} & (S)TEM systematic row defect images (TEM) & $\checkmark$\\
% \textsf{EMZAdefect} & (S)TEM zone axis defect images (TEM) & $\checkmark$\\
\textsf{EMMCOpenCL} & Monte Carlo simulation with OpenCL (SEM) & $\checkmark$\\
{\color{blue}\textsf{EMOpenCLinfo}} & Lists information about the available compute hardware & \\
{\color{blue}\textsf{EMMC}} & Original Monte Carlo simulation, multithreaded (SEM) & \\
\textsf{EMEBSDmaster} & EBSD master pattern simulation (SEM) & $\checkmark$\\
\textsf{EMEBSD} & Full EBSD pattern simulation (SEM) & $\checkmark$\\
{\color{blue}\textsf{EMEBSDFull}} & Monte Carlo simulation, no master pattern (SEM) & $\checkmark$\\
\textsf{EMECPmaster} & Electron channeling master pattern (SEM) & $\checkmark$\\
\textsf{EMECP} & Electron channeling pattern (SEM) & $\checkmark$\\
{\color{blue}\textsf{EMECPSingle}} & Single electron channeling pattern (SEM) & $\checkmark$\\
{\color{blue}\textsf{EMPEDZA}} & Zone axis precession electron diffraction pattern (TEM) & \\
{\color{blue}\textsf{EMmergefiles}} & Merges version 3.0 Monte Carlo and master pattern files into a single file & \\
{\color{blue}\textsf{EMkinematical}} & Kinematical EBSD master pattern (SEM) & \\
{\color{blue}\textsf{EMECCI}} & ECCI defect images (SEM) & $\checkmark$\\
\textsf{EMKosselMaster} & Electron Kossel master patterns (SEM) & $\checkmark$ \\
{\color{blue}\textsf{EMDPFit}} & Fit a diffraction pattern to determine detector parameters (SEM) & $\checkmark$\\
{\color{blue}\textsf{EMEBSDDI}} & Dictionary indexing of EBSD patterns, ``on-the-fly'' (SEM) & $\checkmark$\\
{\color{blue}\textsf{EMEBSDstatic}} & Dictionary indexing of EBSD patterns, precomputed dictionary (SEM) &$\checkmark$ \\
{\color{blue}\textsf{EMECPDI}} & Dictionary indexing of ECP patterns, ``on-the-fly'' (SEM) &$\checkmark$ \\
{\color{blue}\textsf{EMAverageOrient}} & Compute averaged orientations from DI (SEM) & \\
{\color{blue}\textsf{EMOrientationSimilarity}} & Compute an orientation similarity map from DI (SEM) & \\
{\color{blue}\textsf{EMKAM}} & Compute kernel average misorientation map from DI (SEM) & \\
{\color{blue}\textsf{EMsampleRFZ}} & Uniformly samples a Rodrigues Fundamental Zone for DI& \\
\hline
\textsf{EMmkxtal} & Make a crystal structure input file& $\checkmark$\\
{\color{blue}\textsf{EMsoftinit}} & Initialize the \textsf{EMsoft} json information file & \\
\textsf{EMlistSG} & List the equivalent positions of any space group & \\
\textsf{EMqg} & List Fourier coefficient information & \\
\textsf{EMfamily} & Draw a family of planes (stereographic) & \\
\textsf{EMstar} & List the star of any reciprocal lattice point & \\
\textsf{EMorbit} & List the orbit of a point & \\
{\color{blue}\textsf{EMeqvrot}} & Convert an orientation into all equivalent orientations & \\
{\color{blue}\textsf{EMConvertOrientations}} & Convert a file of orientations into other orientation representations & \\
{\color{blue}\textsf{EMDisorientations}} & Compute disorientations between two lists of Euler angle triplets & \\
\textsf{EMZAgeom} & Print zone axis geometry and symmetry information & \\
\textsf{EMlatgeom} & Perform some simple lattice geometry calculations & \\
\textsf{EMstereo} & Basic stereographic projection tool & \\
{\color{blue}\textsf{EMHOLZ}} & Basic kinematical HOLZ pattern zone axis simulation & \\
{\color{blue}\textsf{EMKikuchiMap}} & Basic kinematical Kikuchi band zone axis simulation & \\
\textsf{EMorient} & Stereographic projection for orientation relation & \\
\textsf{EMxtalinfo} & Makes postscript file with lots of useful information & \\
\textsf{EMzap} & Create postscript file with zone axis patterns & \\
\textsf{EMdrawcell} & Draw a unit cell (very primitive) & \\
\hline
\end{tabular}}
\end{table*}
\clearpage
\section{Release Updates}
\begin{itemize}
% \item[3.0.1] (11/20/15) added ability to set UserName, UserLocation, and UserEmail in \textsf{EMsoftConfig.json} file.
% \item[3.0.2] (12/11/15) \begin{itemize}
% \item added EMsoftLibraryLocation to \textsf{EMsoftConfig.json} file;
% \item corrected several of the example .nml files;
% \item added EMZAgeom program to bin folder; was missing in 3.0 and 3.0.1;
% \item moved VMapps folder into IDL folder and added symbolic link so that the virtual apps can find the EMsoft libraries.
\item [3.1] (03/XX/17) \begin{itemize}
\item Windows 10 and limited Linux CMake support
\item dictionary indexing programs for EBSD, ECP, and PED diffraction modalities
\item Monte Carlo and master pattern computations now employ a single output HDF5 file
\item large number of additional utility programs
\item substantial number of code tweaks and corrections
\end{itemize}
\end{itemize}
\section{Future releases}
The following future releases are currently planned:
\begin{itemize}
\item 3.2, Summer 2017: addition of updated TEM codes (currently still available in release 2.0); more complete integration with DREAM.3D.
Support for the use of the Materials Data Facility; new EMsoftToolbox program.
\end{itemize}
\end{document}