Profex BGMN Part 2 Application EN
Profex BGMN Part 2 Application EN
This document is licensed under the Creative Commons Attribution-NonCommercial 4.0 (CC BY-NC 4.0) license. In
summary, you are free to share (copy and redistribute the material in any medium or format) and adapt (remix, trans-
form, and build upon the material) this work under the following terms:
Attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You
may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial – You may not use the material for commercial purposes.
No additional restrictions – You may not apply legal terms or technological measures that legally restrict others from
doing anything the license permits.
Introduction 7
1 Search-Match 8
1.1 Figure of Merit (FoM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Elimination of duplicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 Performance optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.5 Step-by-step: Identifying phases in a new dataset . . . . . . . . . . . . . . . . . . . . 12
1.6 Step-by-step: Identifying phases in an existing project . . . . . . . . . . . . . . . . . . 13
2 Refinement Projects 14
3 Standard Refinement 15
3.1 Opening and Closing Scan Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2 Adding and Removing Structure Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Exporting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.1 Refinement results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.2 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.3 Scan Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5 Refinement Report 34
5.1 Customizing the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.1.1 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.1.2 Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.1.3 Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
7 Managing Repositories 41
7.1 Automatically configured locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7.2 Indexing structure files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7.3 User repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
7.4 Network-shared repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3
9 Creating Structure Files (*.str) 48
9.1 CIF, ICDD XML, RRUFF import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
9.2 Obtaining CIF files from the COD database . . . . . . . . . . . . . . . . . . . . . . . . 49
9.2.1 Installing the COD database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
9.2.2 Using the COD database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
9.3 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
9.4 Common errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
9.4.1 ,,No Wyckoff symbol found” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
9.4.2 ,,Coordinates do not match first Wyckoff symmetry” . . . . . . . . . . . . . . . 54
10 Peak Detection 56
10.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.2 Peak search in refinement projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
11 Batch Refinement 59
11.1 Individually Configured Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
11.2 Batch Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
12 Amorphous phases 61
12.1 Background peak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
12.2 Internal standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
12.2.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
12.2.2 Internal standard in Profex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
13 Chemical Composition 64
15 Text Blocks 71
16 Refinement Preset 72
16.1 Creating and Using Presets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
16.2 Presets for Quality Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
19 Favorites 77
20 Baselines 79
20.1 SNIP algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
20.2 Golotvin and Williams algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4
21 Scan Math 82
21.1 Anchor Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
21.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
21.2.1 Rescaling and offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
21.2.2 Sum and difference of two scans . . . . . . . . . . . . . . . . . . . . . . . . . . 84
22 Peak Integrals 85
22.1 Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
24 Find in Files 90
24.1 Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
26 Absorption coefficient 98
5
Index 115
6
Introduction
Profex is a graphical user interface for Rietveld refinement of powder X-ray diffraction data with
the program BGMN [1]. It provides a large number of convenient features and facilitates the use
of the BGMN Rietveld backend in many ways. Some of the program’s key features include:
• Support for a variety of raw data formats, including all major instrument manufacturers
(Bruker / Siemens, PANalytical / Philips, Rigaku, Seifert / GE, and generic text formats)
• Export of diffraction patterns to various text formats (ASCII, Gnuplot scripts, Fityk scripts),
pixel graphics (PNG), and vector graphics (SVG)
• Batch conversion of raw data scans
• Automatic control file creation and output file name management
• Conversion of CIF and ICDD PDF-4+ XML structure files to BGMN structure files
• Internal database for crystal structure files, instrument configuration files, and predefined
refinement presets.
• Computation of chemical composition from refined crystal structures
• Batch refinement
• Export of refinement results to spread sheet files (CSV format)
• Context help for BGMN variables
• Syntax highlighting
• Enhanced text editors for structure and control file management and editing
• Generic support for FullProf.2k [2] as an alternative Rietveld backend to BGMN.
• And many more. . .
Profex runs on Windows, Linux, and Mac OS X operating systems and is available as free software
licensed under the GNU General Public License (GPL) version 2 or any later version. The latest
version of the program can be downloaded from [3]. This website provides the Profex source
code, bundles of Profex and BGMN for easy installation on Windows and Mac OS X (requiring
zero configuration), and a default set of crystal structure and instrument configuration files.
7
1 Search-Match
Before XRD datasets can be processed with Rietveld refinement, the crystalline phases (at least
the main phases) must be identified. This is usually done by extracting the 2θ positions of the
measured peaks and comparing them to peak positions of all known phases stored in a database.
Phases with peak positions matching the observed ones are added to the refinement project. This
is called a search-match process.
Profex implements a different approach to phase identification. Thanks to fast personal computers
and optimized refinement algorithms, it is now feasible to use Rietveld refinement to identify
phases. The algorithm implemented in Profex is similar to the full-profile search-match method
described by Lutterotti et al. [4]. Each phase from a predefined set of phases is individually refined
to the measured dataset with a strongly restricted refinement strategy. A figure of merit (FoM) is
then computed and used to score the phases. After the first cycle, the user can pin matching phases
and repeat the phase matching until no more matching phases are found. A refinement project can
be created from the pinned phases by clicking the Add-Remove-Phase dialog. All pinned phases
will be pre-selected (Fig. 1).
Unlike other search-match software, Profex only searches phases in the internal structure
database. It is not possible to search 3rd party databases such as the COD or ICDD PDF databases.
If no matching phases are found in the internal database, a different program able to access larger
databases can be used.
The FoM used to score the phases is in principle similar to the equation proposed in [4]. It differs
in the following points:
Density Instead of comparing the initial density with the refined one, Profex compares initial unit
cell parameters with refined ones.
Weight fraction Instead of the refined weight fraction, Profex uses the raw value of GEWICHT.
Crystallite size and micro-strain Instead of crystallite sizes and micro-strain, Profex uses the raw
parameters B1 and k2.
−1
1 c
FoM = + b · GEW ICHT · 1+ + d · k2
Rwp + a · ∆U B1
| Ar − A0 | | Br − B0 | |Cr − C0 |
∆U = 100 · + +
A0 B0 C0
8
A0 , B0 , and C0 are the intial unit cell parameters, and Ar , Br , and Cr are the refined ones. If B0
and Br or C0 and Cr are not given in the structure files, for example in high-symmetry structures,
they are set to their equivalents of A. Parameters a, b, c, d are weighing coefficients to control the
influence of the penalty functions for aberrations in cell parameters, small crystallites, and high
micro-strain.
a, b, c, d, as well as thresholds for c and d can be set in ,,Edit → Preferences → BGMN → Search-
Match”. Thresholds for c and d are defined as follows:
B1r and k2r are refined values, and B1th and k2th are threshold values also set in the preferences.
1.2 Restrictions
Xy Optional: Phases containing the element and phases not containing it are searched. I. e. no
restrictions are applied for optional elements.
Xy Mandatory: Only phases containing the element are searched. All other phases are skipped.
Xy At least one: If several elements are set to ,,at least one”, only phases containing at least one
of them are searched. Phases containing none of them are skipped. For example, if Mg and
Ca are set to ,,at least one”, phases containing Mg only, Ca only, and Mg and Ca are searched,
whereas phases containing neither Mg nor Ca are skipped.
Xy Discarded: Only phases not containing the element are searched. Phases containing it are
skipped.
The numbered buttons at the top and left of the periodic table toggle entire groups or periods at
once.
Quick access buttons in the ,,Change all” box below the periodic table allow quick status change
of all elements. In addition, the button ,,Discard optional” ( • ) toggles all ,,optional” elements to
,,discarded” without changing the state of ,,mandatory” or ,,at least one” elements.
9
Figure 1: The pages ,,Database”, ,,Restrictions”, ,,Controls”, and ,,Results” of the Search-Match
dock widget.
10
1.3 Elimination of duplicates
Once one or more phases have been pinned, the search-match algorithm tries to identify dupli-
cates of the pinned phases and skip them in the next search-match run. This strongly improves
matching of weak phases, because duplicates of strong pinned phases would always be found
at the top of the score list. By skipping duplicates the chances for unidentified weak phases to
appear at the top of the score list improve drastically.
Phase B is considered a duplicate of phase A if all of the following criteria are fulfilled:
The thresholds for unit cell parameters and angles can be customized in the preferences (see part
3 of the user manual). Parameters given by the symmetry are not used for duplicate identification.
For example in a cubic structure only the cell parameter a is used, because b, c, α, β, and γ are given
by the symmetry. In a triclinic structure all six parameters are compared to identify duplicates.
Matching large numbers of phases by refining each of them to the measured dataset is very com-
putation intensive. The first and most important measure to speed up the search-match process is
to define a list of favorite phases and only search in the favorites subset of the database. Setting
favorites is described in section 19.
The process can further be accelerated by limiting the maximum number of iterations and an-
gular range. These and more parameters can be set in the ,,Controls” tab of the ,,Search-Match”
widget:
ITMAX Sets the maximum number of refinement iterations for each cycle. A value of 20 is recom-
mended. Lower values may abort the refinement before it converges, which may impair the
phase scoring. Higher values lead to excessively long processing time.
Set WMIN Clips measured data below a 2θ angle of WMIN. Set the value just below the first
visible peak to speed up the refinement.
Set WMAX Clips measured data beyond a 2θ angle of WMAX. Setting it to a value below the
upper end of the measured range speeds up the refinement. However, do not exclude im-
portant peaks.
11
Allow anisotropic parameters Normally the BGMN parameter ONLYISO is set to Y to only allow
isotropic refinement. This not only speeds up the search-match process, but it also improves
the score. Anisotropic refinement may lead to a lot of false positive matches. However, for
the final cycles, when only trace phases are left to identify, allowing anisotropic refinement
may improve the score of matching phases.
Refine sample height displacement This parameter has no influence on the performance. How-
ever, it affects the score of matching phases. If no sample height displacement is present,
now refining EPS2 improves the score of matching phases and reduces false positives, be-
cause the penalty function of aberrations in unit cell parameters has a stronger influence.
First cycle:
1. Load the raw data file.
2. Go to the ,,Search-Match” dialog (if closed: Window → Search-Match).
3. In the tab ,,Database” select in which database to search.
4. In the tab ,,Instrument” select the instrument configuration and radiation used to measure
the sample.
5. In the tab ,,Refinement” set ITMAX to 20, WMIN to below the first visible peak, uncheck
,,Set WMAX”.
6. Leave ,,Allow anisotropic parameters” and ,,refine sample height displacement” unchecked.
7. Leave the settings in the ,,Scoring” tab unchanged.
8. Start the search-match process by clicking ,,Run → Search-Match”.
After the first cycle, check the score list for matching phases:
1. Click on the best matching phase (highest FoM) to display the hkl lines.
2. If the hkl lines fit, check the phase by clicking the checkbox in front of the file name.
3. Click the button to pin the checked phase.
4. Repeat the search-match process as described above.
Repeat the second part until all peaks are assigned to a phase. Then open the ,,Add-Remove
Phase” dialog (section 3.2) to create a refinement project. The pinned phases will be pre-selected.
Proceed with the Rietveld refinement.
12
1.6 Step-by-step: Identifying phases in an existing project
If a refinement project has already been created but additional peaks are observed, proceed as
follows:
1. Go to the ,,Search-Match” dialog (if closed: Window → Search-Match).
2. In the tab ,,Database” select in which database to search.
3. Check the settings in all other tabs as described in the previous section.
4. Start the search-match process by clicking ,,Run → Search-Match”.
The phases already found in the refinement project are immediately added as pinned phases to
only search the residual signal. The fit during search-matching may look worse than during the
Rietveld refinement before. This is due to the control file being bypassed during the phase match-
ing. Once the normal Rietveld refinement continues, the control file will be effective again.
13
2 Refinement Projects
The BGMN refinement backend requires several text or binary input files to start a refinement,
and it generates more text output files after completing the refinement. In Profex’ terminology,
all files belonging to a refinement constitute a ,,refinement project”, or just ,,project”. Projects
typically include a raw data scan file, a refinement control file (*.sav), instrument configuration
files, and crystal structure files (*.str). After the refinement, BGMN will have generated several
results files, of which the refined profile (*.dia) and list file (*.lst) are the most important ones.
It is strongly recommended to use the same base name for the raw scan file, refinement control
file, refined profile file, and list file. When following the workflow in section 3, correct file names
will be generated automatically. More information about project file structure, specifically about
projects sharing the same structure and device files, is given in section 4.1.
Important: BGMN requires an instrument configuration file (device file) precisely describing the
instrument setup used to acquire the raw dataset. If the device file of a different instrument is
used for the refinement, or if it does not precisely describe the configuration used, the following
problems will occur during the refinement:
• BGMN will not be able to fit the peak shapes correctly. The fit will converge with a high χ2
value and major differences between the observed and calculated scans will remain.
• Some refined parameters will be wrong. Typically the refined crystallite size (parameter B1),
micro-strain (parameter k2), and atomic parameters (x, y, z, TDS) will be biased. Unit cell
parameters and phase quantities will be affected to a lesser degree, but will also be biased if
major discrepancies between the used instrument configuration and the device file exist.
Section 8 describes how to create device files. Note that any change to the instrument setup will
require a new device file (e. g. changing the divergence slit setting or swapping soller slits).
14
3 Standard Refinement
When Profex and BGMN have been installed and configured correctly as described in part 1 of
the user manual, and at least one device configuration and structure file has been stored in the
databases, the program is ready for a first refinement. Remember that a device file precisely de-
scribing the instrument configuration used to measure the dataset is required. If no such device
file is available, it is recommended to start with one of the tutorials available on the Profex website
[3] to become familiar with Profex and BGMN, as they include the correct device files.
The following listing shows a step-by-step workflow for a standard refinement. The individual
steps will be discussed in more detail in the next sections.
1. Click ,,File → Open Graph. . . ”, or alternatively press Ctrl+G or the corresponding button in
the main tool bar.
2. In the opening file dialog set the file format at the bottom to the format of your raw scan file,
and open the file. See Tab. 1 for supported file formats.
3. The scan will be loaded as a new project.1
4. Double click on the strongest peak or select a reference structure from the reference structure
dropdown menu to identify your main phase.
5. Click ,,Edit → Add / Remove Phase. . . ”, or press F8 or the corresponding button in the
project tool bar create a control file. The dialog shown in Fig. 2 will be shown.
6. Select your instrument configuration from the dropdown menu, your phase from the struc-
tures list (it may be pre-selected), and verify that the option ,,Generate default control file”
is active. Then click ,,OK”.
7. Click ,,Run → Run Refinement. . . ”, press F9, or click the corresponding button in the refine-
ment tool bar to start the refinement.
8. Wait for the refinement to complete.
9. If more phases are present, repeat steps 4–7, but make sure the option ,,Generate default
control file” is not active anymore.
10. If the refinement is complete, click ,,File → Export Global Parameters and GOALs”, or press
Ctrl+E or the corresponding button in the project tool bar to export the results to a CSV file.
11. Optionally, also click ,,File → Export Local Parameters and GOALs”, or press Shift+Ctrl+E
or the corresponding button in the project tool bar to export the local results to a CSV file.
This file can be opened in a spreadsheet program such as Microsoft Excel, LibreOffice Calc,
or Softmaker PlanMaker for further evaluation of the results.
1 Atthe first start of the program, all reference structures in the structure database directory will be indexed. Depend-
ing on the number of files and the speed of the computer, this may take up to several minutes. A progress dialog is
shown while indexing is in progress. Wait for the process to complete.
15
The steps of opening a scan file, creating a refinement project by adding structure files, and ex-
porting results are described in more detail in the following sections.
A refinement usually starts by opening a raw data file. In Profex’ terminology these files are
either called ,,Graph files” or ,,Scan files”, whereas one file contains one or several ,,Scans”. Profex
supports a large number of file formats (Tab. 1), however, the level of support depends on the
availability of documentation for the file format specification. If a format is not supported, or
support is broken, other software such as PowDLL [11] is required to convert the scan to a format
supported by Profex.
Scan files can be opened in various ways:
,,File → Open Raw Scan File. . . ” menu or toolbar (Ctrl+G): This will open a file dialog to select
one or more graph files. The correct file format must be selected. Important: Several instru-
ment suppliers use the same file extension (*.raw) for different proprietary file formats. It is
important to select the correct format, else Profex will show an error message. For example,
a raw file measured on a Bruker instrument cannot be opened with the file format set to
Rigaku or Stoe raw file.
If more than one file is selected, each file will be opened as a separate refinement project.
,,File → Insert Scans. . . ” menu or toolbar (Ctrl+I): Similar to the ,,Open Raw Scan File. . . ” func-
tion above, but instead of creating a new refinement project for each file, all scans will be
inserted into one project. If a project is already open, new scans will be inserted into the
existing project.
Drag and Drop: Dragging one or several graph files from a file browser and dropping them on
the Profex main window will open them in new refinement projects.
Ctrl + Drag and Drop: Holding the Ctrl key while dropping one or more scan files will insert them
into the open project. If no project is open, a new one will be created from the first dropped
scan file, and all consecutive scans will be inserted in the new project.
Once the graph file is loaded, Profex will detect whether or not the file is part of a refinement
project. If yes, the control and list files will be loaded automatically. If not, a refinement control
file has to be created for the project in order to run the refinement (section 3.2).
Text files can be opened in text editors using ,,File → Open Text File. . . ”. Profex will check if a
project with the same base name is already open. If yes, the text file will be opened in a new
tab of the project. This is convenient to open various output files (*.lst, *.par), as they are part of
the project. If no matching project was found, the text file will be opened in a new project. One
exception to this rule are structure files (*.str). They belong to a refinement project with a different
base name. Therefore, structure files are always opened as new tabs in the current project. Only if
no project is loaded, opening a structure file will create a new empty project.
16
Table 1: Data file formats supported for import by Profex. Level of support (LoS): A = full sup-
port based on the file format specification, including multi-range files; B = good support, reverse-
engineered; C = basic support, reverse engineered.
Manufacturer Extension File format Version LoS
Bruker *.raw Binary V1, V2, V3, V4 A
Bruker *.brml XML Compressed archive A
Bruker *.brml XML Single XML file with XML data A
container
Bruker *.brml XML Single XML file with binary A
data container
PANalytical *.xrdml XML 1.0 - 2.0 A
Philips *.rd Binary - C
Philips *.udf ASCII - C
Seifert/FPM *.val ASCII - B
Rigaku *.bin Binary - C
Rigaku *.dat, *.rig, *.dif ASCII - C
Rigaku *.raw Binary - C
MDI Jade *.xml XML - C
MDI Jade *.dif ASCII - C
STOE *.pro ASCII - C
STOE *.raw Binary - C
Thermo Fisher *.raw Binary - C
Generic *.xy ASCII Field separators: ; : , space tab A
Comment signs: ! % & #
BGMN *.dia ASCII - A
Fullprof.2k *.prf ASCII Only PRF=3 A
Fullprof.2k *.dat ASCII Only INS=10 A
GSAS *.fxy, *.fxye ASCII GSAS Standard Powder File A
pdCIF *.cif ASCII Supported tags: A
pd meas 2theta scan
pd proc 2theta corrected
pd meas counts *
pd proc counts *
pd calc intensity *
pd meas intensity *
pd proc intensity *
17
Individual files can be closed by clicking on the ,,Close Tab” symbol on the tab bar. Structure files
can also be closed by clicking ,,Project → Close all Project STR files”.
The current project can be closed by ,,File → Close Project” (Ctrl+W). If more than one project is
selected in the Projects dock window, all selected projects will be closed. To close all open projects
at once, click ,,File → Close all projects”.
One of Profex’ central components is the ,,Add / Remove Phase” dialog (Fig. 2). It is accessed
by clicking ,,Project → Add / Remove Phase. . . ”, or pressing F8 or the corresponding button on
the project tool bar. This dialog is used to easily create or modify the refinement control file.
It will automatically add a STRUC[n] reference and related GOALs for phase quantification to
the control file, and copy the selected STR files from the structure file database to the working
directory (Fig. 4). The individual elements of this dialog are described in detail below.
Generate default control file: If this option is checked, Profex will generate a default control file
for the selected instrument configuration. If a template file is found, it will be used to cre-
ate the control file. Else Profex will present a dialog asking for basic information about the
instrument configuration (Fig. 3). If the option is active, an existing control file will be over-
written. The default state of this option depends on the presence of a previous control file:
• If a control file was found, this function will be unchecked. Manually activating the
option will overwrite the existing control file with a newly created default file.
• If no control file was found, this function will be active.
Instrument configurations: This dropdown menu lists all instrument configurations found in the
device database directory.
Add phases: This list shows all structure files found in the structure file database directories. Files
stored in a sub-directory will be shown in a tree structure that can be collapsed or expanded.
Clicking on the header of the table (,,File Name”, ,,Phase”, or ,,Comment”) will sort the
table in ascending or descending order of the clicked column. Structures selected in the first
column will be added to the control file. If a reference structure is shown on the main graph,
it will be pre-selected in this dialog.
The structure file list can be filtered by entering a search string in the filter line. The filter is
applied instantly. Clear the line to display all structure files. The filter options menu allows
to configure whether or not filtering will be case-sensitive, whether or not the search string
will be interpreted as a regular expression pattern, and in which columns the filter string
will be searched for.
If using regular expressions is not selected, only the wildcard characters ,,*” and ,,?” are
evaluated. Activating regular expressions allows to make use of powerful regular expression
patterns for filtering. Tutorials and documentation on regular expressions can be found on
the internet.
18
Expand/Collapse: If structure files are organized in sub-directories in the structure database di-
rectory, they will be organized in a tree structure in this dialog. Clicking ,,Expand/Collapse”
will expand or collapse all items in the tree structure for easy navigation.
Overwrite existing files: If a selected structure file is already present in the project directory, it
will normally not be overwritten. This preserves customized files. Checking this option will
force overwriting of existing files. Use this option with care, as other projects accessing the
same structure files will be affected, too.
Favorites: If checked, only the phases flagged as favorites in the 4th column are displayed.
Remove Phases: The phases listed here are currently referenced in the control file. Check the
ones that shall be removed from the refinement.
Delete Files: If this option is checked, the removed file will also be deleted from the hard disk
in the project directory. This may cause problems with other projects residing in the same
directory and referencing the same structure file. It is recommended to use this option with
care.
If the control file contains multiple references to the same structure file, only the first occur-
rence will be removed. In that case, the option ,,Delete STR Files” will be ignored until the
last reference to this file was removed from the control file.
Note that only copies of structure files in the local project directory will be deleted. The
structure file database directory will remain unchanged.
The ,,Add / Remove Phase” dialog will not allow to add the same phase more than once to a
control file. If a selected file is already referenced in the control file, it will be skipped by the dialog.
If multiple entries of the same structure file are requested, the control file has to be modified by
hand.
After clicking ,,OK” to apply the configuration, Profex will copy the structure and device files to
the project directory, and create or modify the refinement control file as shwon in Fig. 4.
19
Figure 2: The ,,Add / Remove Phase” dialog is used to create a new project. If a project already
exists, it is used to append more phases, or remove phases from the project.
20
Devices database
Instrument1.tpl
Instrument1.sav
Instrument1.ger
Instrument1.geq
Instrument2.tpl
Instrument2.sav Project directory
Instrument2.ger "Add Phase" Dialog
myscan.xrdml
Instrument2.geq
Instrument3.tpl
myscan.sav
Copies files from
database directories Instrument1.sav
Structures database to project directory Instrument1.ger
Instrument1.geq
Albite.str Modifies *.str files
Barite.str if requested Calcite.str
Calcite.str
Dolomite.str
Dolomite.str Converts instrument Magnesite.str
Ettringite.str template (*.tpl) file to
Fluorite.str control file (*.sav)
Gypsum.str
Hematite.str
Illite.str
Jade.str
Kaolinite.str
Lime.str
Magnesite.str
Nahpoite.str
Figure 4: The ,,Add / Remove Phase” dialog will copy structure files and device files from the
database directories to the project directory. Files already existing in the project directory will not
be overwritten, unless the option is checked manually in the ,,Add / Remove Phase” dialog.
21
3.3 Exporting data
CSV tables At the end of a refinement, Profex shows a summary of global parameters and
GOALs, refined local parameters, and the refined chemical composition in the summary dockable
windows. These values are read from the LST output file. Local parameters can be customized in
the preferences as described in part 3 of the user manual. Profex allows to easily export the global
and local refined parameters of all open projects to spreadsheet files:
,,Results → Export Global Paramters and GOALs” will write the global parameters and goals of
all open projects to a CSV file.
,,Results → Export Local Paramters” will write the local parameters of all open projects to a CSV
file.
,,Results → Export refined chemical composition” will export the chemical composition (see
section 13) to a CSV file.
The exported files are text files containing semicolon-separated fields. Open the file in a spread-
sheet program and specify the semicolon character as a field separator. Since the exported files
also contain the source file name, using the spreadsheet program’s sorting function allows easy
sorting and statistical evaluation of the results. The following listing shows what the exported
CSV file with global parameters and goals looks like when opened in a text editor. Table 2 shows
how the same data looks after importing and sorting in a spreadsheet program.
File;Sample;Parameter / Goal;Value;ESD
<path>/scan1.lst;scan1;alphaTCP/sum;0.0311;0.0023
<path>/scan1.lst;scan1;hap/sum;0.9689;0.0023
<path>/scan2.lst;scan2;alphaTCP/sum;0.0161;0.0022
<path>/scan2.lst;scan2;hap/sum;0.9839;0.0022
<path>/scan3.lst;scan3;alphaTCP/sum;0.0147;0.0024
<path>/scan3.lst;scan3;hap/sum;0.9853;0.0024
3.3.2 Graphs
Scans shown in the plot area can be exported to various formats. Depending on the export format,
some information may get lost if it is not supported by the output format. Scans can be exported
as follows:
1. Make sure the graph to be exported is shown by selecting the project and showing the
,,Graph” tab.
2. Select ,,File → Save File As. . . ”.
22
Table 2: Global parameters and GOALS exported from Profex and sorted by the ,,Paramter / Goal”
column. Sorted like this, mean values and standard deviations can easily be calculated.
File Sample Parameter / Goal Value ESD
<path>/scan1.lst scan1 alphaTCP/sum 0.0311 0.0023
<path>/scan2.lst scan2 alphaTCP/sum 0.0161 0.0022
<path>/scan3.lst scan3 alphaTCP/sum 0.0147 0.0024
<path>/scan1.lst scan1 hap/sum 0.9689 0.0023
<path>/scan2.lst scan2 hap/sum 0.9839 0.0022
<path>/scan3.lst scan3 hap/sum 0.9853 0.0024
3. Select the format for the export in the file format dropdown menu.
4. Specify the file name and save the file.
Profex exports some generic file formats, and some formats specific for other applications. The
generic formats are useful for most users interested in further data processing or creation of fig-
ures. They will be discussed in further detail in the following paragraphs.
Pixel image (PNG) Pixel image export will write the file to a Portable Network Graphics (PNG)
image. A dialog will open to ask for the output size in pixels. PNG uses lossless compression,
therefore relatively small files free of compression artifacts will be created.
If the line width or font size is too small, it will have to be changed prior to the export in the graph
preferences (see part 3 of the user manual). Use ,,display line width” to change the export line
width.
All elements visible on screen will be exported, including hkl lines and the legend. Visibility of
the scans will be considered, invisible scans will also be invisible on the exported file. The export
will create a high-resolution image of the on-screen graph.
Pixel images can be edited in any photo editing software, such as Adobe Photoshop, GIMP,
Paintshop Pro, Corel PhotoPaint, and others.
Gnuplot (GPL) Gnuplot [12] is a powerful cross-platform graphing utility able to create quality
graphs in various formats. Scans exported as Gnuplot files are saved as Gnuplot scripts with
inline data. The graphs are a fairly accurate but not perfectly identical representation of the plot
as displayed in Profex. It includes hkl indices, a legend, all selected scans, and it preserves scan
colors and symbol styles. The output file may be edited to optimize the appearance of the Gnuplot
graph or to change the output terminal. Gnuplot code created by Profex version 4.3.x was tested
with Gnuplot versions 4.6 and 5.0.
On a system with a working Gnuplot installation, the following command entered in a terminal
emulator will output the graph ,,scan.gpl” to the default terminal:
23
gnuplot −p scan . gpl
Grace plots (AGR) The displayed graph is exported to a file for the Grace plotting program [13].
All colors and hkl tick marks are preserved. Grace is described on wikipedia as follows:
Grace is a free WYSIWYG 2D graph plotting tool, for Unix-like operating systems.
The package name stands for ,,GRaphing, Advanced Computation and Exploration
of data.” Grace uses the X Window System and Motif for its GUI. It has been ported
to VMS, OS/2, and Windows 9*/NT/2000/XP (on Cygwin). In 1996, Linux Journal
described Xmgr (an early name for Grace) as one of the two most prominent graphing
packages for Linux.
Scalable vector graphics (SVG) Scalable vector graphics (SVG) is a resolution-independent vec-
tor graphics format ideal for post-processing of graphs. All elements (scans, axes, hkl lines, text)
are exported as editable paths or text elements, allowing to change fonts, sizes, places, colors, line
widths, or add annotations easily in the exported file. It is the most powerful and flexible of all
export formats to create high-quality figures. However, it may be necessary to use vector drawing
software and convert the format before importing into a word processor, as some programs do
not import SVG files directly.
All modern webbrowsers are capable of viewing SVG files natively. SVG files can therefore be
viewed and printed easily on all operating systems without requiring any additional software.
In order to edit the files, a vector drawing program such as Adobe Illustrator, Inkscape, Corel
DRAW, or others is necessary. Note that not all vector drawing programs interpret SVG files
correctly. Wrong SVG drawing may need manual optimization.
The recommended workflow to add a scan to a manuscript in high quality is the following:
24
Printing to PDF A PDF printer is available on most operating systems. It allows direct export of
the graph to a PDF file. Prepare the graph as described at the beginning of this section, but use
,,File → Print. . . ” instead of the ,,Save As. . . ” function. Use the printer dialog to write the output
to a PDF file. The layout and functions are platform specific.
If line widths in the printed document are too fine or too wide, change the printing line width in
the preferences as described in part 3 of the user manual. PDF files can be used directly in LATEX.
Other word processors may need the same conversion as described for SVG files in section 3.3.2.
All open graphs can be printed to a printer or to a single PDF file using the function ,,File → Print
all graphs. . . ”. Similarly all graphs can be exported to SVG format using ,,File → Export all graphs
to SVG”. In this case, however, a separate SVG file will be created for each graph.
ASCII free format (XY) A generic text format writing the data in columns, starting with the an-
gle, followed by columns with intensities for each scan. These files can be imported in spread-
sheet or plotting software for further processing. Spreadsheet software includes Microsoft Excel,
LibreOffice Calc, SoftMaker PlanMaker, and others. Plotting software includes OriginLab Origin,
GNUplot, and others.
hkl lines will not be exported. Scan colors, line styles, and the legend will also get lost during the
export. Visibilities of scans will be ignored, all scans will be exported. A white space character is
used for field separation.
The following example shows an exported ASCII free format file with all scans written into one
file. The first column contains the x-values (2θ angle), the following columns contain y-values Iobs ,
Icalc , Idi f f , Ibackground , and two phase patterns. Note that the phase patterns include the background
intensity:
ASCII HKL List (HKL) If the graph contains hkl tick lines, the data will be written to a text file.
The output file starts with a header line, followed by hkl tick mark information of all phases. Note
that the lines are sorted by phase number, not by 2θ angle. An example of an ASCII HKL list file
is shown below:
25
"Phase Name" "Angle" "Phase No." "HKL" "Texture"
"Adularia" 22.501230 0 "0 2 1" 1.263500
"Adularia" 24.476712 0 "2 0 -1" 0.915900
"Adularia" 26.213459 0 "1 1 1" 1.328900
...
"Calcite" 26.835628 1 "1 -1 2" 0.968500
"Calcite" 34.275930 1 "1 -1 -4" 1.053900
"Calcite" 36.669943 1 "0 0 6" 1.049000
...
"Plagioclase_Albite" 22.106786 2 "0 2 -1" 1.174800
"Plagioclase_Albite" 23.578835 2 "0 2 1" 1.363700
"Plagioclase_Albite" 25.646178 2 "2 0 -1" 0.723100
...
"Quartz" 24.264737 3 "1 -1 0" 1.029900
"Quartz" 31.030320 3 "1 -1 1" 1.037600
"Quartz" 31.030320 3 "1 -1 -1" 0.970300
...
"Zincite" 37.055257 4 "1 -1 0" 1.000000
"Zincite" 40.184602 4 "0 0 2" 1.000000
"Zincite" 40.184602 4 "0 0 -2" 1.000000
...
Powder CIF file (CIF) The crystallographic information file format (CIF) is not only used to share
crystal structure information, but also raw or refined powder diffraction patterns. Saving a refined
graph file (*.dia) in powder CIF format will create a file that is compliant with the guidelines for
Rietveld papers by the International Union for Crystallography (IUCr) [15]. The project base name
will be used for the data and pd block id tags, which is consistent with structure CIF files
exported from the ,,Results” menu (section 3.3.3).
A truncated example of an exported powder CIF file is shown below.
######################################################################
# Rietveld refinement results for sample 160629-03
# Created with Profex 3.12.0
# Export date: July 28, 2016 - 11:27
######################################################################
data_160629-03
_pd_block_id 160629-03
loop_
_pd_proc_point_id
_pd_proc_2theta_corrected
_pd_proc_intensity_total
_pd_calc_intensity_total
_pd_proc_intensity_bkg_calc
26
Figure 5: Export options for CIF
structure files.
# The following lines are used to test the character set of files sent by
# network email or other means. They are not part of the CIF data set.
# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# !@#$%ˆ&*()_+{}:"˜<>?|\-=[];’‘,./
CIF files Crystallography information file (CIF file, *.cif) is a standardized file format for the ex-
change of crystal structure information. It essentially contains the same information as BGMN list
files (*.lst) do, however in a very different format. Profex can extract crystal structure information
from *.lst files and write to *.cif files once a refinement has completed and a *.lst file has been
created. In order to export CIF files of several refined projects, proceed as follows:
27
A truncated example of a single-phase CIF file is shown in Fig. 6. Note that some lines contain
trailing comments of type ,,# <phaseName>”, such as the following lines:
_chemical_formula_structural ? # MgO
_chemical_formula_sum ? # MgO
_chemical_formula_weight ? # MgO
The question mark ,,?” is a placeholder for missing information. It should be filled with informa-
tion by the user. The comment with the phase name (MgO) allows the user to use search-replace
features in text editors to add the missing information efficiently. Some text editors can search
and replace text in multiple files at once. Adding the molecular weight for MgO can thus easily
be achieved, without interfering with other phases, by replacing
_chemical_formula_weight ? # MgO
with
_chemical_formula_weight 40.3044
Fig. 6 also shows placeholder question marks for isotropic B values for both atoms. The reason is
that, unlike fractional coordinates, isotropic displacement parameters are not listed in the BGMN
list file (*.lst) unless they are refined. A simple modification to the BGMN structure file (*.str, in
this case ,,periclase.str”) solves the problem. In order to print fixed TDS values to the *.lst file, add
the instruction GOAL=TDS to the end of the atomic position lines. An example is shown below, in
which the GOAL statement was added to the end of the last two lines:
PHASE=MgO // 04-010-4039
MineralName=Periclase //
Formula=Mg_O //
SpacegroupNo=225 HermannMauguin=F4/m-32/m //
PARAM=A=0.4214_0.400ˆ0.425 //
RP=4 k1=0 k2=0 PARAM=B1=0_0ˆ0.01 GEWICHT=SPHAR4 //
MAC=10000*my/density
GOAL=MAC
GOAL=GrainSize(1,1,1) //
GOAL:MgO=GEWICHT*ifthenelse(ifdef(d),exp(my*d*3/4),1)
E=MG+2 Wyckoff=a x=0.0000 y=0.0000 z=0.0000 TDS=0.0031583 GOAL=TDS
E=O-2 Wyckoff=b x=0.5000 y=0.5000 z=0.5000 TDS=0.0033951 GOAL=TDS
After repeating the refinement and re-exporting the CIF files, the atomic positions section now
includes correct values for atom site B iso or equiv:
28
########################################################### _diffrn_ambient_temperature 295
# Crystal structure data for phase MgO _diffrn_measurement_device_type ’Bruker D8 Advance’
# Created with Profex 3.12.0 _diffrn_radiation_probe ’x-ray’
# Export date: July 28, 2016 - 15:08
# loop_
# Source file: .../HA/160629-03.sav _diffrn_radiation_wavelength
########################################################### 1.541004
29
_space_group_IT_number 225 # new notation _atom_site_B_iso_or_equiv
_symmetry_Int_Tables_number 225 # depricated notation, MG1 MG 1.00000 0.00000 0.00000 0.00000 ?
# maintained for O2 O 1.00000 0.50000 0.50000 0.50000 ?
# compatibility with VESTA
# The following lines are used to test the character set of
loop_ # files sent by network email or other means. They are not
_symmetry_equiv_pos_site_id # part of the CIF data set.
_symmetry_equiv_pos_as_xyz # abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
1 x,y,z # !@#$%ˆ&*()_+{}:"˜<>?|\-=[];’‘,./
2 -x,-y,z
...
47 z,-y,-x
48 z,y,x
_cell_length_a 4.21223(98)
_cell_length_b 4.21223(98)
_cell_length_c 4.21223(98)
_cell_angle_alpha 90.00000
_cell_angle_beta 90.00000
_cell_angle_gamma 90.00000
Export options
One single-phase CIF file per phase If several projects are to be processed and each project con-
tains several phases, one CIF file will be created for each phase. The file name will automat-
ically be set to <projectName>-<phaseName>.cif. Existing files will be overwritten
without warning. The created file names will be shown in the refinement output console.
One multi-phase CIF file per project One CIF file per project will be generated. The CIF file
contains all phases found in the project. The output name will be set automatically to
<projectName>.cif. Existing files will be overwritten without warning. The created
file names will be shown in the refinement output console.
One global multi-phase CIF file All phases found in all projects will be exported to one single CIF
file. The user will be prompted to enter the file name.
Temperature Select the temperature at which the diffraction data was collected in Kelvin (K). To
reset the value to room temperature, click the ,,RT” button. The value will be used for the
CIF tag diffrn ambient temperature.
Instrument Select the name of the instrument used for the diffraction experiment.
If the
instrument is not available from the dropdown menu, create a new one by clicking
the ,,+” button. The name can be chosen freely. It will be used for the CIF tag
diffrn measurement device type.
Radiation Source Select the type of radiation used for the diffraction experiment. The value will
be used for the CIF tag diffrn radiation probe
GSAS Standard Powder Data File GSAS standard powder data files are exported in constant
stepwidth (BINTYP=CONS) with one record per line consisting of the position in centidegrees and
the intensity (TYPE=FXY). Graphs containing multiple scans are exported to a single file contain-
ing multiple banks.
30
CELL Files This function reads RES files of all open projects and writes crystal structure infor-
mation to CELL files for the software Castep [8]. One CELL file will be created for each crystal
structure found. The file will be stored in the project directory. Information on saved files is
shown in the refinement protocol console. If no RES file is available for a specific phase, a tag
RESOUT[n]=filename.res must be added to the control file (*.sav) and the refinement must be
repeated. The CELL files contain cartesian atomic coordinates.
31
4 Opening Refinement Projects
Once a refinement has been completed, the Rietveld refinement backend BGMN will write vari-
ous output files. One of them, the diagram file (*.dia), contains the refined profile, typically the
measured and calculated intensities, the background curve, phase contributions, and hkl indices.
Refinement projects can be opened in Profex by selecting ,,File → Open Refinement Project. . . ” (or
pressing ,,Ctrl+R”) and selecting the refined profile file (*.dia).
When working with several datasets (= projects) at a time, it is important to understand how Pro-
fex’ ,,Add / Remove Phase” function handles structure and instrument files in the background.
By default the ,,Add / Remove Phase” dialog will copy selected structure and instrument files to
the location of the currently loaded scan file as shown in Fig. 2. It will check whether a file with
the same name is already present. If yes, the present file will not be overwritten, unless the option
,,overwrite existing files” was activated for structure files, and ,,generate default control file” was
activated manually for instrument files.
Since several raw scan files can be located in the same directory, a structure file will only be present
once, even if it was added multiple times for each project. Modifying, removing, or overwriting
this structure file will affect all projects within this directory (Fig. 7).
If common structure files are not desired, there are several options to avoid shared access by
multiple projects:
• Distribute the raw scans on several sub-directories, as shown in Fig. 7. The ,,Add / Remove
Phase” dialog will have to be called for each project separately, but each project will receive
it’s own copy of the instrument and structure files.
• Manually manage the structure files. E. g. create a copy of structure 1.str and name
it structure 1a.str. Then change the STRUC[1]=structure 1.str line in the corre-
sponding control file to STRUC[1]=structure 1a.str.
• Manually manage structure files by creating sub-directories for structure files only.
E. g. create a copy of structure 1.str in strFiles 1/structure 1.str. Then
change the STRUC[1]=structure 1.str line in the corresponding control file to
STRUC[1]=strFiles 1/structure 1.str. The project directory remains unchanged,
but it will access the structure files in a specific sub-directory, which can be managed
manually for each project.
32
Projects sharing structure files
working directory scan 1.sav:
scan 1.sav STRUC[1]=structure 1.str
scan 2.sav STRUC[2]=structure 2.str
structure 1.str
structure 2.str scan 2.sav:
STRUC[1]=structure 1.str
STRUC[2]=structure 2.str
Projects in sub-directories
working directory scan 1.sav:
project 1 STRUC[1]=structure 1.str
scan 1.sav STRUC[2]=structure 2.str
structure 1.str
structure 2.str scan 2.sav:
project 2 STRUC[1]=structure 1.str
scan 2.sav STRUC[2]=structure 2.str
structure 1.str
structure 2.str
Figure 7: Projects and structure files can be organized in different ways, depending on whether
structure and instrument files shall be shared or not.
33
5 Refinement Report
Results of a refinement can be exported to a report in HTML format. After the refinement has
completed, select ,,Results → Generate report. . . ”. A HTML file will automatically be created in
the project directory and opened in a web browser. The location of the report file is shown in the
refinement output console. An example of a report in the default layout is shown in Fig. 8. The
report can be printed to paper or PDF format from the web browser.
The information added to the report can be customized to a certain degree in the preferences
(,,Edit → Preferences → BGMN → Refinement Report”).
5.1.1 Structure
The information exported in the report, and the structure of the document, can be customized to
a certain degree in the tree view of the ,,Structure” page (Fig. 9a). The sections added by default
cannot be removed. However, they can be deactivated by unchecking the section item, and the
text used for the section heading can be changed by double-clicking on the ,,Text/Value” column.
Using the arrow buttons, the sections can be moved up or down in the tree to rearrange the doc-
ument structure. Changing the heading text allows to change for example the heading ,,Global
GOALs” to ,,Phase quantities” if the global GOALs table only contains phase quantities. The re-
port thus becomes more easily understandable for readers who are not familiar with the BGMN
nomenclature.
The content of the selectable sections is described below.
Sample information contains the sample ID, file names, date of refinement, instrument configu-
ration, wavelength file, and working directory of the project.
Operator name contains the operator name to be added to the sample information table. The
operator name can be omitted by unchecking this line. By default, the user name of the user
generating the report is used.
Refinement statistics adds a line with Rwp , Rexp , χ2 , and goodness of fit to the sample information
table.
Gloabl GOALs creates a table with global GOALs, as customized on the ,,Summary tables” page
of the preferences dialog.
Diffraction pattern adds the currently displayed pattern (can be a raw dataset or a refined *.dia
file) as a figure to the report.
34
35
Figure 8: A refinement report in the default layout is opened in a web browser.
(a) Document structure
36
Aspect Ratio change the aspect ratio of the diffraction pattern. The width is always 100 % of the
page width, and the height will be set to the width divided by ,,Aspect ratio”. This is helpful
if the diffraction pattern is too high to fit on a page and causes a page break between the
heading and the figure.
Local GOALs adds a table with phase-specific local goals, as customized on the ,,Summary ta-
bles” page of the preferences dialog.
Chemical composition add a table with the refined chemical composition. It is important to as-
sign all quantification goals correctly in the ,,Chemical composition” table, else the table in
the report will be incomplete.
Peak list adds a list of hkl peaks generated for the refinement and read from the *.par file.
In addition to the predefined sections, one can add page breaks at specific positions to avoid page
breaks between headings and the following tables or figures.
Custom sections allow to insert plain HTML code in the report. Select the section item preceding
the custom section, then click ,,Add custom section”. In the following dialog, enter a name for the
section (it will not be used as a heading) and enter plain HTML code in the editor. For example,
the code shown in Fig. 10 adds a horizontal ruler (horizontal line) at the position of the custom
section.
5.1.2 Header
By default, the report uses a ,,Profex” banner at the top of the first page. This banner can be
replaced with a custom one to match the corporate design. Banners must be saved as scalable
vector graphics (*.svg) and can be created with Inkscape, Adobe Illustrator, or any software able
to write SVG files.
37
Select a custom banner by clicking the button on the ,,Header” page. A preview of the selected
banner is shown below the file name (Fig. 9). When the ,,Logo” line is empty, Profex defaults to
the internally stored Profex logo.
5.1.3 Style
The colors, font, and layout of the tables and headings can be customized as well. Profex uses
CSS styls sheets for the HTML layout. A custom style sheet can be specified on the ,,Style” page.
Alternatively, disable the CSS style sheet and specify a font and colors for tables directly. The
width of the diffraction pattern can also be specified in % of the page width to avoid unfavorable
page breaks when printing the report. Fig. 11 shows an example of a report adapted to a corporate
design.
38
Figure 11: A report using a custom header logo and color scheme, shown in the print-preview of
a web browser.
39
6 Sharing Refinement Projects with other Users
Opening a refinement project created on one platform (either Windows or OS X / Linux) on an-
other platform (OS X / Linux or Windows) will cause an error message as soon as the refinement is
started. This is due to the fact that both types of platforms use different characters for line endings
in text files, and BGMN only accepts the format native to the platform it is used on.
To avoid these error messages, use the backup feature to share projects as described below. It
automatically converts the files to the target platform.
On the source computer:
1. In Profex click ,,Project → Save project backup” to create a *.zip file with all required scan,
control, structure, and instrument files.
2. The name of the created file will be shown in the ,,Refinement Protocol” console.
3. Share the *.zip file with the recipient.
On the recipient’s computer:
1. Save the received *.zip file at the location where you want to process it.
2. In Profex click ,,File → Open Project Archive. . . ” to open the *.zip file.
3. Run the refinement.
The *.zip file will be extracted and the file formats will be converted to the target platform’s text
file format.
40
7 Managing Repositories
Profex scans certain directories for structure files, device configuration files, and refinement pre-
sets. These directories are called ,,repositories”, and while the Profex bundles and installers come
with a large selection of structure files and device configurations, it is often necessary for the user
to add more files for their specific requirements. This section provides some background informa-
tion on how Profex handles repositories, how custom files can be added, as well as how to avoid
some pitfalls.
When Profex is started for the first time, it tries to locate the BGMN executable files and the struc-
ture, device, and preset repositories. This step is called auto-configuration. More technical infor-
mation is provided in Part I of the user manual. If all files and directories have successfully been
located, Profex will index all structure files. This step can take up to a few minutes to complete.
Afterwards, Profex is fully operational. The automatically detected repositories can be displayed
in the ,,Help → About Profex → System Information” dialog or in the ,,Edit → Preferences” dialog
as shown in Fig. 12.
When Profex detects a corrupted configuration, for example after updating the software and re-
moving the old installation, auto-configuration will be run again. This time, invalid repository
locations are removed from the previous configuration, valid ones are kept, and auto-detected
ones are added. This way all customizations are preserved and a working state is maintained.
Before structures can be used in Profex, they need to be indexed. In this step, Profex calculates
the peak positions of each structure file found in the repositories and stores the information in an
internal database. Only indexed structure files are displayed in various places in Profex:
When using the import dialog (,,Files → Import structure files”) to create new structure files,
indexing is called automatically upon closing the dialog. However, when structure files are copied
to the repositories outside of Profex, indexing must be called manually by clicking ,,Tools → Index
structure files”. Indexing performs the following steps:
41
Figure 12: Automatically configured repository locations on Windows.
When indexing is complete, the internal database is synchronized with the files in the repositories.
For changes to show in open projects, it may be necessary to reload the project.
Profex can be configured to run indexing automatically at program start, as shown in Fig. 13.
Since normally the content of the structure file repositories does not change, this is a relatively
quick way of keeping the internal database synchronized with the repositories. Program start is
delayed by approximately 1–2 seconds, depending on the computer hardware.
As explained in Part I of the user manual, automatic configuration of the repositories on a fresh
installation will set up two repository locations for structure, device, and preset files. One of each
is located inside the Profex application directory on Windows and OS X platforms, and in /opt on
Linux. The second one is located in the user’s personal directory at a location recommended by the
operating system to store persistent application data. File browsers can be opened very efficiently
from the ,,Locations” menu (Fig. 14) to give access to the file content of all repositories.
42
Figure 13: Configure Profex to index new structure files at each program start.
The repositories inside the Profex application directories may easily get deleted when upgrading
to a new version and removing the entire Profex folder of the old version. Any structure, device,
and preset files added by the user after installation and not backed up prior to deleting the old
version will be deleted. It is therefore strongly suggested to save all user-created files in the repos-
itories outside of the Profex application directory. These folders will never be deleted by upgrades
and are therefore a safe location for custom files.
43
8 Creating Instrument Configuration Files
The Rietveld refinement software must be able to precisely describe the measured peak shape
with a mathematical model to obtain accurate fits of measured diffraction peaks. BGMN uses the
fundamental parameters approach (FPA), and thus raytraces the peak shape from the diffractome-
ter’s hardware configuration rather than fitting it to a measured reference pattern. Very detailed
hardware information must be specified by the user in order to obtain a correct peak shape model.
But in return, FPA peak shapes often describe strongly asymmetric peaks at very low diffraction
angles more realistically and accurately than generic peak profile functions. FPA peak shapes can
also be computed at any 2θ angle, whereas measured peaks of a reference material can only be
fitted from the 2θ position of the first peak upwards. Extrapolation to lower angles introduces
increasingly severe errors.
Profex includes a set of hardware configuration files. But very often these configurations differ
to a certain degree from configurations used by other users. Applying even a slightly wrong
configuration file will result in poor quality of fits and most likely in wrong results. Using an
instrument configuration file not specifically created for the instrument in use is thus strongly
discouraged. This tutorial describes how to customize an instrument configuration file for one’s
own use.
It is much easier to adapt one of the existing configuration files than to create a new file from
scratch. Profex includes default files for instruments manufactured by Bruker, PANalytical,
Rigaku, and Siemens, with various old and modern detectors and beam path configurations. Nor-
mally the type of instrument and some basic hardware information is given in the file name. For
example ,,D8-. . . ” and ,,D2-. . . ” refers to Bruker D8 or D2 instruments, and ,,xpert-. . . ” and
,,cubix-. . . ” to PANalytical X’Pert or CubiX instruments. Often the file name also contains infor-
mation about the divergence slit mode (fds = fixed divergence slit, ads = automatic divergence slit)
and detector (xcel = PANalytical X’Celerator, pixcel = PANalytical PIXcel, LynxEyeXE = Bruker
LynxEye XE etc.).
A graphical editor representing the instrument configuration (Fig. 15) can be opened by selecting
,,Instrument → Edit Configuration. . . ” from the menu. A file dialog will open in the Device file
database. Try to find a configuration file that matches your own configuration as closely as possi-
ble. Open a file that seems to reasonably describe your own hardware. If none seems reasonable,
open any arbitrary file.
Installed optical modules can be checked in a tree structure representing the primary and sec-
ondary beam path. Check all installed modules, and uncheck the ones that are not in use. The
graphical representation will be updated accordingly. Installed modules can also be selected by
clicking on the graphical representation. Modules without a check box must be present for the
instrument to work and thus cannot be unselected.
44
Figure 15: ,,Instrument → Edit Configuration. . . ” opens a dialog to edit an existing instrument
configuration.
Select a module either in the tree structure or in the graphical display to show the module param-
eter configuration page. Adjust all parameters to the current hardware configuration. A detailed
description of parameters is available in the ,,Description” tab.
Once each installed module has been configured correctly, save the file under a new name using
the ,,Save as. . . ” button and start the profile calculation by clicking the ,,Run calculation” button
(Fig. 15). The output of the raytracing process is shown in the calculation output console. It
usually takes several minutes to complete (Fig. 16).
The configuration page for detectors contains a list of predefined sensor data for common 1D and
2D detectors. The predefined dimensions refer to the absolute sensor dimensions. For conven-
tional powder diffraction, the active area of very large sensors is often restricted, either by using
45
Figure 16: After starting the profile calculation, the calculation progress is shown in the output
console.
a physical mask in front of the detector window, or by defining a ,,region of interest” (ROI) or
reducing the ,,active length” in the control software. Detectors can also be installed in vertical or
horizontal orientation, which inverts the which and height orientation of the sensor dimensions.
It is important to know that the values entered in the detector configuration page must be the ef-
fectively used dimensions of the active area / region of interest, in the effectively used orientation.
These may be different from the values stored in the detector preset list.
After applying a preset of a specific detector model, the detector will be referred to as ,,1D / 2D
Detector” rather than by its correct model name because the name is not stored in the configura-
tion file. This is the intended behavior.
Clicking on the button ,,Show text editor” in the top-right corner of the dialog shows the auto-
matically created configuration file in text format (Fig. 17). This file can be edited directly. When
switching back to the graphical editor, the graphical representation will be updated accordingly.
However, a fixed file format is expected and some customizations may not be interpreted correctly.
Therefore a warning is shown when switching editors. To preserve customizations, do not switch
to the graphical editor after changing the text file. Instead, run the profile calculations directly
from the text editor.
The original configuration file read from the hard disk can be displayed by clicking the corre-
sponding button in the top-right corner. To reset the automatically created configuration text file
to the original one, click the corresponding button in the top-right corner. This allows discarding
all changes and starting all over with creating a custom configuration either in the graphical editor
or in the text editor.
46
Figure 17: The automatically created configuration file can be edited before starting the profile
calculation.
47
9 Creating Structure Files (*.str)
Crystal structure files retrieved from online or commercial databases are usually supplied in the
CIF format [9] or in an XML file format if exported from the ICDD PDF-4+ database. Another file
format is used for DIF files of the structure database of the RRUFF project [10]. Before any of the
three formats can be used with BGMN, the structure information needs to be converted the the
BGMN STR file format. Profex provides support to facilitate the conversion process for CIF, XML,
and DIF formats. PDF-4+ XML files are usually complete and require very little user input. CIF
and DIF files, on the other hand, often lack important information and require manual revision.
The import and conversion process in Profex is the same for all three formats.
The following workflow is recommended for CIF, XML, and DIF import:
1. Retrieve a CIF, XML, or DIF file from an external resource (online or local database).
2. Start Profex and choose ,,File → Import Structure file. . . ” to open the import dialog.
3. Click the + button in the dialog to load the source file.
4. If asked for the space group number, select the number according to the International Tables
for Crystallography. If unknown, the number has to be determined from an external source.
5. If asked for a space group setting, select it from the list of proposed settings. If unknown,
the correct setting has to be determined from an external source.
6. The STR file is created and shown in an editor (Fig. 18). At the same time, the file is verified
by running BGMN in the background. If successful, a hkl stick pattern is shown. Else an
error message appears in the ,,Messages” console. The file name in the ,,Files” list is preceded
by an asterisk (*) if verification failed.
7. If verification failed, add the missing information manually. Then run verification again by
pressing the ,,.” button.
8. Once verification is successful, save the file to the structures repository.
Thermal displacement parameters read from CIF files are converted automatically to isotropic Biso
in nm2 as described in part 3 of the user manual.
The button to save all STR files will ignore files that failed verification (marked by *). It will save
all successfully verified files to the structure file repository, using the file base name of the source
CIF files.
48
9.2 Obtaining CIF files from the COD database
An export of the COD database (excluding CIF and HKL files) in an SQLITE3 file format suitable
for Profex is provided on the Profex website and updated periodically. To install it locally, the
downloaded ZIP file must be extracted on the local harddisk. The location can be choosen freely,
but recommended locations are the following directories, which also host the hkl buffer database
and user-specific repositories:
Windows: C:\Users\<user name>\AppData\Roaming\doebelin.org\Profex4
MacOS: $HOME/Library/Application Support/doebelin.org/Profex4
Linux: $HOME/.local/share/doebelin.org/Profex4
Once the file cod-<date>.db3 has been extracted, proceed as follows:
On the ,,Search” page of the same dialog (Fig. ??), the status of the database has now changed to
,,Database connected”.
The COD can be searched by structural properties and by reference. Fill in the search terms and
click the ,,Search” button to query the database. It may take a few seconds to complete. After-
wards, the matches are listed in the match list (Fig. 20). To obtain the CIF files of the matches
phases, proceed as follows:
1. Select the matches you want to download by checking the checkbox in the first column.
2. Close the dialog by clicking ,,OK”
The selected files will be downloaded to a temporary location and imported into the structure
import dialog. The first entry will automatically be verified.
The search terms are described in Table 3.
Restricting the temperature at the time of data collection limits the matches to the following tem-
perature ranges:
Room temperature: 273–300 K or no temperature reported
High temperature Higher than 300 K
Low temperature Lower than 273 K
49
Table 3: Description of the COD search terms. ,,Field name” is the name of the field in the COD
data table. Descriptions were adapted from the published COD database description.
Search Term Description Field name
Mineral name Mineral name accepted by the International Mineralog- mineral
ical Association.
Number of elements The minimum and maximum number of distinct chem- nel
ical elements in the crystal.
Elements (include) A space-separated list of elements required to occur in formula
the fomula.
Elements (exclude) A space-separated list of elements excluded from the formula
formula.
Space group Space group symbol, Hermann-Mauguin or superspace sg
group symbol.
Temperature The mean temperature in Kelvins at which the diffrac- diffrtemp
tion intensities were measured.
Title The title of the scientific paper where the crystal struc- title
ture was published.
Authors The authors that published the paper describing the authors
crystal structure deposited in the COD database, or the
authors of the personal communication to COD.
Journal The name of the journal in which the scientific paper de- journal
scribing the crystal structure was published.
Volume The volume of the journal where the scientific paper de- volume
scribing the crystal structure was published.
Year The earliest and latest year of publication of this crystal year
structure.
9.3 Verification
STR files created from CIF, XML, or DIF files should be verified before saving to the structure file
repository, because the import often results in incomplete STR files. Verification is run automati-
cally immediately after opening the source file. If it fails, errors will be reported in the ,,Messages”
console and the faulty lines will be marked (Fig. 18). After fixing the errors, verification should be
run again by clicking the ,,.” button. If verification was successful, a hkl stick pattern is shown.
Select the correct wavelength at the bottom of the dialog to display the hkl indices at the correct
2θ position for a specific instrument. The hkl graph can be exported to a semi-colon separated text
file (*.csv), a PDF file, or a pixel image.
If verification failed, error messages are again shown in the ,,messages” console, the hkl graph is
cleared, and the file name is preceded by an asterisk (*). Study the error messages, try to fix the
issue in the STR file, and run verification again. STR files that haven’t passed verification will later
issue the same error message when used in a refinement.
50
Figure 18: After conversion from CIF to STR format, BGMN will be called in the background to
run the STR file. If successful, a hkl stick pattern will be shown, else an error message appears in
the ,,Messages” page (bottom).
51
(a) Database configuration
52
Figure 20: A search for the mineral name ,,corundum” with restrictions of the temperature and
year of publication.
53
9.4 Common errors
Many CIF files do not contain Wyckoff symbols for atomic positions. In that case the symbols must
be added manually. If the symbols are unknown, open the tool ,,Tools → Browse BGMN Space
Groups. . . ”, select the correct spacegroup number and Hermann Mauguin symbol, and browse
all Wyckoff positions (Fig. 21). Try to find a position that describes special coordinates (,,round
numbers”) for each atom in the structure.
Example
A CIF file for anhydrite did not contain any Wyckoff symbols:
PHASE=Anhydrite //
SpacegroupNo=63 HermannMauguin=A2_1/m2/m2/a Setting=3 //
...
E=S Wyckoff= x=0.250000 y=0.000000 z=0.155560 TDS=0.005503
E=CA Wyckoff= x=0.750000 y=0.000000 z=0.347600 TDS=0.006538
E=O Wyckoff= x=0.250000 y=0.169900 z=0.016200 TDS=0.009849
E=O Wyckoff= x=0.081900 y=0.000000 z=0.297500 TDS=0.009388
The first atom S is located on a special position with ,,round numbers” for x and y. The position
can be described as ,,1/4 0 z”. To find the Wyckoff letter belonging to this special position,
open ,,Tools → Browse BGMN Space Groups. . . ”, select space group number 63, Hermann Mau-
guin symbol A2_1/m2/m2/a (setting 3) and browse all Wyckoff symbols (Fig. 21). The symbol
describing the special position of the S atom is ,,c”. Repeat the process for all other atoms until all
Wyckoff letters are known. The solution is shown in Table 4.
When browsing the BGMN space group definitions in ,,Tools → Browse BGMN Space Groups. . . ”,
it is important to note that the special position descriptions appear in a specific order. BGMN
expects atomic coordinates to be given in the first symmetry description. Coordinates given in a
symmetry other than the first one in the list must be converted manually.
Example
In the previous example using the Anhydrite CIF file, the Wyckoff symbols were determined as
follows:
54
Table 4: Atomic positions in the Anhydrite CIF file and matching Wyckoff symbols describing
special positions. The symmetry actually matching the coordinates is shown in bold typeface.
Atom Coordinates Wyckoff Symmetries
S x=0.250000 y=0.000000 z=0.155560 c 1/4 0 z
3/4 0 -z
CA x=0.750000 y=0.000000 z=0.347600 c 1/4 0 z
3/4 0 -z
O x=0.250000 y=0.169900 z=0.016200 g 1/4 y z
3/4 -y -z
1/4 -y z
3/4 y -z
O x=0.081900 y=0.000000 z=0.297500 f x 0 z
x+1/2 0 -z
-x+1/2 0 z
-x 0 -z
However, when running the verification, an error message will be shown for the CA atom:
Indeed the coordinates for the CA atom correspond to the second symmetry description for Wyck-
off position c (3/4 0 -z). The coordinates must thus be converted manually to the first symme-
try 1/4 0 z, which is done as follows:
or with z shifted back into the unit cell (the two z coordinates are equivalent):
55
10 Peak Detection
Since the search-match feature only searches Profex’ internal database, which, although constantly
growing, is far from complete, it is often necessary to use a third party software to search a more
complete structure database, for example the Crystallography Open Database (COD) [5]. One of
the most critical steps for accurate phase identification is the extraction of peak positions. Third
party search-match programs use their proprietary peak detection algorithms, sometimes with
a large number of parameters to tweak, but with complex or nano-crystallite samples it is often
necessary to improve the peak list manually by deleting duplicate peaks and adding peaks not
detected by the algorithm.
Profex has a very powerful peak detection module that exceeds the detection accuracy of most
other algorithms. The module is based on two compoments of the BGMN software suite called
TEIL and EFLECH. The first program TEIL splits the scan file in several parts, and the second
program EFLECH fits peaks and a background curve to these parts. EFLECH uses instrument
parameters read from an instrument configuration file and the wavelength spectrum read from
a *.lam file (both have to be specified by the user). It also fits peak broadening due to crystallite
size and micro-strain and thus recognizes broad peaks as single peaks instead of fitting them with
multiple narrow peaks. The peak recognition is outstanding, but the process can be extremely
time consuming.
10.1 Example
Open a scan file and start ,,Run → Run peak Search”. A dialog asking for the instrument con-
figuration and wavelength file opens (Fig. 22). Adjust both to your scan file and click OK. Peak
detection will start and take a few seconds up to several minutes.
When the detection is complete, all peaks are shown as hkl lines in the graph and in tabular form
in the peak list widget (to open click ,,Windows → Peak List”). A new hkl scan is added to the
56
Figure 23: Peak search completed.
plot options (Fig.23). To save the peak list to disk, click the ,,Save as CSV file” button ( ) above
the peak list. In the file dialog three different file formats can be selected:
CSV file This format stores all information (d value, 2θ position, and intensity) in a text file which
can then be opened with a spreadsheet program.
d values This format only stores d values and intensities. The file can directly be imported in
other programs for phase matching.
2theta values This format only stores 2θ positions and intensities. The file can directly be im-
ported other programs for phase matching.
By chosing one of the file formats only exporting d values or 2θ position, the peak list can be used
with third party search-match programs such as QualX [6] or Match! [7], which allows to use Pro-
fex’ superior peak detection with search-match programs accessing large structure databases.
At this point Profex cannot use the peak list for phase matching. The peak list can only be used
with other software, for graphical representation, or for publication purpose.
If a refinement project has already been created, running peak detection works a little bit differ-
ently:
57
• It is not necessary to specify the instrument configuration and wavelength files. Both pa-
rameters are read from the control file.
• The peak search will run on the active scan, i.e. a scan clicked in the ,,Plot options” list and
drawn in a bold line. If no scan is active, it will run on the first scan in the ,,Plot options” list
(usually I observed).
This offers some powerful possibilities in terms of isolating unassigned peaks of weak phases.
Using the ScanMath dialog (section 21) a residual scan can be computed than only contains the
unassigned files. If I difference is scan #3 and Background is scan #4, use the following
ScanMath equation to create a residual scan: I = #3 + #4. After generating the new scan and
closing ScanMath, click on the new scan in the ,,Plot Options” list to activate it, then run ,,Run →
Run peak detection”.
58
11 Batch Refinement
The number of refinements running in parallel in a batch refinement can be configured in ,,Edit →
Preferences → General → Number of parallel batch refinements”. The default value is 1, refining
only one project at a time with the number of threads configured with the NTHREADS variable in
the control file. If the number of parallel batch refinements is greater than 1, the number of threads
will be divided by the number of parallel refinements. For example, if a list of projects prepared
to run with 8 parallel threads (NTHREADS=8) is batch-refined with two parallel refinements, each
project will effectively be refined with 4 threads (NTHREADS=4). This makes optimum use of all
available logical CPU cores.
If several projects are loaded, and all projects are configured correctly using the ,,Add/Remove
Phase” dialog, they can be refined sequentially using the batch refinement feature. Simply click
,,Run → Run batch refinement. . . ” and select the projects to be refined. If more than one project
was pre-selected in the projects dock window, the same projects will be pre-selected in the project
selection dialog for the batch refinement. All selected projects will be scheduled for the batch
refinement.
Once a batch refinement is running, the functions in the ,,Run” menu work as follows:
Run Refinement will immediately start the refinement of the selected project, regardless of
whether its status is IDLE, COMPLETE, or SCHEDULED. The refinement will run paral-
lel to the running batch.
Run Batch Refinement will schedule the selected project for the running batch.
Abort Current Refinement depends on the status of the current project. RUNNING: The refine-
ment will be aborted, the batch refinement jumps to the next scheduled project and starts the
refinement. SCHEDULED: The project will be un-scheduled, i. e. set to IDLE and skipped
by the batch refinement.
Abort All Refinements will stop all running refinements and un-schedule all projects from the
batch. Note that also individually started refinements running parallel to the batch will be
aborted.
It is a common use case to refine a large number of files with nearly identical composition. For
example time-resolved series of a single specimen, or multiple measurements of the same sample
for statistical analysis. In that case, having to create a refinement project for each measurement as
described in section 3.2 would be tedious. Profex offers a much more efficient way to configure
and run a list of equivalent refinements:
59
Figure 24: A batch refinement in progress.
1. Open all raw data files as individual projects (section 3.1). Note: Make sure to use the ,,Open
Graph Files. . . ”, not ,,Insert Scans. . . ” function.
2. Configure and refine the first project as described in section 3.
3. Once satisfied with the refinement quality, click ,,Edit → Copy Control File” to apply the
configuration of the first project to other projects.
4. Run a batch refinement (,,Run → Run batch refinement. . . ”). You can skip the first project,
as it has been refined already.
Fig. 24 shows an example of a batch refinement in progress. Note that sequential batch refine-
ment, i. e. using the refinement results of one project as input for the next project, is currently not
supported.
60
12 Amorphous phases
X-ray amorphous phases, i. e. materials lacking a long-range structural order, do not produce a
distinct diffraction signal and are therefore considered to be invisibel in XRD data sets. However,
short-range ordering may still cause a broad bump in the background signal, typically (but not
exclusively) around d = 3.0 Å. If this bump is prominent, the background polynome may have
difficulties following it and may instead diverge from the measured background underneath the
bump. A polynome of higher degree, on the other hand, may have undesired side effects such
as an increased processing time due to additional refined parameters, or unstable background
refinement at the start and/or end of the scan.
Refinement of dataset with a strong amorphous bump can be drastically improved if the bump is
fit with a single broad diffraction peak. To add such a peak, select ,,Project → Add amorphous
peak” and specify the approximate center position in the following dialog. A new structure file
,,amorphous.str” is added, which contains just a signle peak. The structure cannot be used for
quantification of the amorphous content. But it may improve the quantification of all crystalline
phases because of a drastically better fit of the background.
To remove the amorphous phase, use the ,,Add/Remove phase” dialog and remove the file ,,amor-
phous.str” from the project.
The broadening parameters B1 and k2 of the amorphous peak must be carefully monitored. If
the amorphous peak gets wider than the measured amorphous signal and starts to extend beyond
the bump, the width parameters must be limited. If the amorphous bump is weak and the refined
peak starts to interfere with the background polynome, it may be better to remove the amorphous
phase and increase the order of the background polynome instead.
Adding an internal standard is a common method for quantification of amorphous fractions from
XRD data. The idea is to add one crystalline phase in a precisely known quantity. This internal
standard phase is measured and quantified along with the sample, and its mixed and refined
quantities can be used to scale all refined phase quantities to absolute values.
12.2.1 Example
Suppose a sample contains an amorphous phase (e. g. glass) and quartz in unknown quantities.
Since the amorphous phase is invisible in XRD data set, a quantification would result in 100 rel. wt-
% quartz.
In order to determine the absolute quantity of quartz and glass, we add 0.5 g of corundum (α-
Al2 O3 ) to 1.0 g of the sample mixture. Now we know that the absolute quantity of corundum
61
is 33.33 wt-% (0.5 g out of 1.5 g material). However, after refining the quantities of quartz and
corundum, we obtain the following relative phase fractions:
Quartz 58.33 %
Corundum 41.66 %
The relative fraction of corundum is 41.66 wt-%, but we know that the absolute fraction is 33.33 %.
With this information we can rescale all relative fractions to absolute fractions by multiplication
with factor 33.33/41.66. The absolute refined quantities are thus:
Quartz 58.33 · 33.33/41.66 = 46.66 %
Corundum 41.66 · 33.33/41.66 = 33.33 %
By adding 0.5 g of corundum, we increased the total amount of material from 1.0 to 1.5 g. Quartz
makes up 46.66 % of 1.5 g, but we are interested in the fraction in the original sample prior to
adding the corundum standard. Therefore we must rescale the quartz quantity by factor 1.5/1.0.
The amount of amorphous material is then 100− quartz:
Quartz 46.66 · 1.5/1.0 = 70.00 %
Amorphous 100.00 − 70.00 = 30.00 %
The calculations demonstrated above to rescale refined phase quantities with an internal standard
to absolute quantities without the internal standard can be performed in a spreadsheet program
after the Rietveld refinement. However, Profex also provides a function to change the computa-
tion of quantity GOALs accordingly, so the refined quantities represent absolute phase quantities
including the amorphous content.
When refining a sample with internal standard, create a refinement project including all identified
crystalline phases, including the internal standard phase. Then select ,,Project → Set internal stan-
dard”. In the following dialog, specify the internal standard phase you added to the sample, and
specifiy its known absolute amount in wt-%. After closing the dialog, the GOALs section in the
control file is modified. For example, the following section computing relative phase fractions:
sum=Calcite+Aragonite+Corundum
QCalcite=Calcite/sum
QAragonite=Aragonite/sum
QCorundum=Corundum/sum
GOAL[1]=QCalcite
GOAL[2]=QAragonite
GOAL[3]=QCorundum
. . . is changed to the following code when setting corundum as the internal standard in a quantity
of 30.00 abs. wt-%:
62
ISTD=Corundum
ISTDQ=0.3000
sum=ISTD*(1-ISTDQ)/ISTDQ
QCalcite=Calcite/sum
QAragonite=Aragonite/sum
QAmorph=1-(Calcite+Aragonite)/sum
GOAL[1]=QCalcite
GOAL[2]=QAragonite
GOAL[3]=QAmorph
Important: The quantity entered for the internal standard must be the true standard quantity of
the final mixture. For example, when adding 0.3 g standard to 1.0 g sample, the true standard
quantity is 0.3/1.3 = 0.2308. The correct value to enter for the internal standard quantity in this
example would thus be 23.08 %. It is also possible to change the calculation of ISTDQ after closing
the dialog as follows:
ISTDQ=0.3/1.3
The modified GOAL code takes care of all rescalings described in the previous example and re-
ports absolute phase fractions, including amorphous fractions. The internal standard quantity is
eliminated so the reported quantities represent the phase fractions in the sample prior to adding
the standard.
To revert to relative phase quantities, simply select ,,Project → Unset internal standard”.
63
13 Chemical Composition
After the refinement, Profex will calculate the bulk chemical composition of the sample from the
structural information and refined site occupancies reported in the list file (*.lst). The elemental
composition, expressed in wt-% of the oxide, is shown in the ,,Chemical composition” dockable
widget (Fig. 25). In a first step, Profex will calculate the chemical composition of each phase,
and normalize it to 100 % (Fig. 25a). In order to calculate the bulk composition of the entire sam-
ple, Profex needs to know the relative quantity of each phase, which is normally calculated as a
global goal. Profex will attempt to identify the correct ,,Quantity Goal” by comparing global goal
names with the phase name. If a goal name of format phase name/some string is found, with
phase name matching the phases PHASE variable (case insensitive), the goal will be automatically
selected. Else no ,,Quantity Goal” will be selected and the user will have to select it manually.
As an example, the following ,,Quantity Goal” will be recognized and assigned automatically,
because the phase name and goal name match (matching is case insensitive):
But the following ,,Quantity Goal” will not be recognized automatically, because the phase name
and goal name do not match. The user will have to select it manually:
Once a valid ,,Quantity Goal” has been selected for a phase, the element composition will be
normalized to the phase’s quantity. The total chemical composition will be calculated only when
all phases were assigned a valid ,,Quantity Goal” (Fig. 25b).
The oxides and their molecular weights used to calculate the composition can be accessed and cus-
tomized in the preferences by calling ,,Edit → Preferences. . . → Chemical composition” (Fig. 26a).
Elements without molecular weight value, or with a value of 0.0, will be ignored for the calcula-
tion. It is recommended to leave the molecular weight of oxygen (element No. 8) empty or at 0.0
to avoid listing oxygen as a separate element in the chemical composition output table. See part 3
of the user manual for more information on customizing the oxide parameters.
Select ,,Results → Export refined chemical composition. . . ” to export the data to a csv file.
Clicking with the right mouse button on the table allows to copy the table to the clipboard. The
content can be pasted to a spread sheet program. The semicolon character ,,;” is used as field
separator. The entire table will be copied, cell selections will be ignored.
64
(a) (b)
Figure 25: Chemical composition of the sample. Quantity goals must be selected by the user. If no
quantity goals were selected (a), each phase will be normalized to 100 %. If the goals describing the
phases’ quantities were assigned (b), the total bulk composition of the sample will be calculated,
too.
(b)
(a)
Figure 26: Oxides and molecular weights can be customized in the preferences dialog (a). Double
click on a ,,Element” cell in the oxide table to open a dialog for calculation of oxide molecular
weights (b).
65
14 Limits of Quantification and Detection
The counting noise inherently superimposing the diffraction peaks in a powder XRD pattern lim-
its the accuracy of phase quantifications. Even if a single specimen is measured multiple times
and variations introduced by sample preparation or sample inhomogeneities are guaranteed to be
absent, the random noise pattern will lead to a certain variation of the refined phase quantities.
The results are Gauss-distributed around the true value. The standard deviation is largely inde-
pendent of the phase quantity, it rather depends on the counting noise amplitude, which itself
strongly depends on the background intensity. As a result, phase quantities close to 0.0 still show
a standard deviation similar to greater quantities. An example is given in Table 5, which shows
mean quantities and ESDs of reference mixtures measured 10 times. Once the contamination
phases fall below 5 wt-%, their ESDs are surprisingly constant, even if the phases are entirely ab-
sent. As the phase quantities approach 0.0, but the ESDs remain constant, the variation coefficient
(VC) gets larger. The variation coefficient is defined as
ESD
VC = [%]
Quantity
Assume we prepare reference mixtures with 5, 2, 1, 0.5, 0.2, and 0.0 wt-% of a contamination phase,
and the ESD of the refined quantities is constant at 0.2 wt-%. As a result, we observe the following
VCs:
For small quantities the scattering of the values becomes excessively large compared to the mean
value, which is expressed by huge VCs. In other words, the refined quantity becomes unreliable.
Many textbooks, guidelines and standards define the limits of quantification and detection (LOQ
and LOD) as a specific variation coeficient. For example, they specify that for quantification the
mean value must be at least 4 times greater than its standard deviation, or the standard deviation
must be less than one quarter of the value (VC ≤ 25%). And for detection, the mean value must
be at least 2 times greater than its standard deviation, or the standard deviation must be less than
half the value (VC ≤ 50%). The actual limits might depend on the source of the information.
The example in Table 5 also shows that, with the exception of phase C, none of the contamination
phases reach 0.0 wt-% in the sample absolutely free of contaminations (bottom line). Once the
peak intensities drown in the counting noise, the refinement algorithm will be able to fit positive
intensities into the noise pattern. This has some undesired side effects: These residual intensities,
even when reported as ,,not detected”, reduce the quantity of the main phase, as long as they are
66
taken into the normalization of phase quantities to 100 %. In Table 5 the quantity of phase A is
reduced to 99.10 wt-% due to accumulated residual intensities, even though no contaminations
were present. In order to avoid this problem, which can become even more pronounced if more
non-existent phases are added to the refinement, it is recommended to remove phases below the
detection limit from the project and repeat the refinement. This process should be repeated until
none of the refined phases is below the detection limit. Profex facilitates this strategy by high-
lighting phases below the detection and quantification limits and by showing a warning in the
summary table. The feature has to be enabled in the preferences dialog (Edit → Preferences. . . →
BGMN → Summary Tables → ,,Show warnings for values below detection and quantification
limit”). In the same dialog the variation coefficients (VCs) used as limits of quantification and
detection can be defined. In the example shown in Figure 27 the limit of quantification is reached
when the refined quantity falls below 8 times its ESD (VC ≥ 12.5 %), and the limit of detection is
reached when it falls below 4 times its ESD (VC ≥ 25 %).
Some phases actually converge towards 0.0 wt-% despite a considerable noise pattern. In that
case the ESD may reach 0.0 wt-%, too. However, this is an artifact of the refinement algorithm
and its error propagation, as there cannot be an absolute certainty of absence of a particular phase
as long as there is noise superimposing the diffraction signal. After all, there always might be a
signal hidden in the noise. If the ESD reaches 0.0, the refined quantity might never fall below the
quantification and detection limit, as the ESD shrinks along with the value rather than remaining
constant, and the VC may or may not exceed the LOQ or LOD at a certain point. In order to avoid
this undesired result, Profex allows to define a minimum ESD. Any refined ESD below this value
will be considered to be an artifact, i. e. an unrealistically low ESD, and instead the minimum ESD
specified in the preferences dialog will be used. That way, a hard-coded minimum LOQ and LOD
is introduced. For example, the limit of detection in Figure 27 is defined as
ESD
LOD = = 0.250
value
If we refine a phase quantity to 0.06 wt-% with an ESD of 0.01, its VC is:
0.01
VC = = 0.167
0.06
The VC does not exceed the LOD, therefore the phase quantity of 0.06 wt-% should be considered
detectable, Profex will not show the warning ,,< LOD”. However, it is quite obvious that a quan-
tity of 0.06 wt-% cannot be detected in most real datasets collected on conventional instruments
with standard settings. Also an ESD of 0.01 wt-% is impossible to achieve if there is counting
noise in the pattern. The low ESD must therefore be an artifact. Applying Profex’ minimum ESD
at 0.05 wt-% (which is a realistic choice), the equation changes as follows
minESD 0.05
VC = = = 0.833
0.06 0.06
The VC exceeds the LOD of 0.250 by far, and the quantity of 0.06 wt-% is flagged as ,,< LOD”. In
fact, any quantity below
minESD 0.05
= = 0.20
LOD 0.250
will be flagged as ,,< LOD”, regardless of its refined ESD.
67
Figure 27: Warnings for quantities below LOQ and LOD can be activated in the preferences dialog.
Variation coefficients (VC = ESD/value) used as LOQ and LOD are also specified on the same
page.
If the minimum ESD is set to 0.0, the feature is deactivated and all refined ESDs will be used as
read from the results file. This is not recommended. The minimum ESD should be set to a positive
value. The non-existent phases B and D in Table 5 that converged to a positive residual intensity
(bottom line) had residual ESDs of 0.06 and 0.14 wt-%. It is a reasonable guess to use a value just
below the residual ESDs of non-existent phases as a minimum ESD. In this example, 0.05 wt-%
seems to be a good choice.
68
69
Figure 28: Profex showing warnings for phases below the detection limit (< LOD).
Table 5: Reference mixtures of 3 contamination phases (B, C, D) in a matrix (A). All values are given in wt-%.
Composition (A + B + C + D) Quantity A ESD A Quantity B ESD B Quantity C ESD C Quantity D ESD D
0.0 + 33.3 + 33.3 + 33.3 0.02 0.01 33.79 0.29 32.54 0.19 33.65 0.37
1.0 + 33.0 + 33.0 + 33.0 0.66 0.11 33.57 0.29 32.33 0.20 33.44 0.38
10.0 + 30.0 + 30.0 + 30.0 9.58 0.24 30.63 0.29 29.44 0.20 30.36 0.40
25.0 + 25.0 + 25.0 + 25.0 24.98 0.29 25.48 0.28 24.20 0.19 25.34 0.40
40.0 + 20.0 + 20.0 + 20.0 40.37 0.30 20.35 0.26 19.02 0.18 20.27 0.41
70
55.0 + 15.0 + 15.0 + 15.0 55.94 0.25 14.95 0.19 14.00 0.15 15.11 0.26
70.0 + 10.0 + 10.0 + 10.0 70.71 0.25 9.82 0.17 9.14 0.13 10.32 0.25
77.5 + 7.5 + 7.5 + 7.5 78.07 0.22 7.44 0.14 6.72 0.12 7.77 0.17
85.0 + 5.0 + 5.0 + 5.0 85.55 0.21 4.91 0.13 4.27 0.12 5.27 0.17
94.0 + 2.0 + 2.0 + 2.0 93.79 0.19 2.02 0.10 1.65 0.08 2.53 0.15
97.0 + 1.0 + 1.0 + 1.0 96.64 0.17 1.05 0.09 0.74 0.05 1.57 0.14
98.5 + 0.5 + 0.5 + 0.5 98.09 0.16 0.54 0.08 0.30 0.04 1.08 0.13
99.4 + 0.2 + 0.2 + 0.2 98.79 0.14 0.28 0.07 0.09 0.03 0.84 0.12
100.0 + 0.0 + 0.0 + 0.0 99.10 0.15 0.14 0.06 0.00 0.00 0.75 0.14
15 Text Blocks
Text blocks are pre-defined sections of text that needs to be inserted in control or structure files
regularly. Instead of entering the text manually each time, a text block can be selected from the
menu and inserted conveniently at the text cursor position in the currently shown text editor. Part
3 of the user manual describes how to manage text blocks.
A common scenario for text blocks is the structure file code to activate sub-phase refinement. The
same code is needed occasionally in structure files. It can thus be pre-defined in the preferences
and applied from the menu ,,Edit → Insert Text Blocks”. The block will be inserted at the position
of the text cursor. An example block is shown below.
RefMult=2
PARAM=pG=0.5_0ˆ1
GEWICHT[1]=pG*GEWICHT
GEWICHT[2]=(1-pG)*GEWICHT
PARAM=pB1=1_0.1ˆ10
B1[1]=B1
B1[2]=pB1*B1
71
16 Refinement Preset
The preset is now ready for use2 . It can be applied to a new raw data scan as follows:
An MD5 checksum is saved for each file referenced in the preset (MD5hash=...). When applying
the preset, Profex will verify the integrity of the files and issue a warning if files were modified.
The preset can still be applied, but the user was informed about (accidental or intentional) modi-
fications of the files.
Presets allow using Profex for routine quality control in an accredited environment. In such a
scenario it is recommended to store the presets directory on a network shared drive, and giving
write access only to the lab manager. This, in combination with MD5 checksums, provides a high
level of data integrity and reduces user input to applying the correct preset.
2 Projects loaded before saving the preset need to be closed and re-opened in order to scan for new presets.
72
17 Show Peak Profiles
The shape of measured diffraction peaks originates from a convolution of the wavelength emis-
sion spectrum, geometrical features of the instrument, and peak broadening by certain sample
properties. Profex allows to display the individual contributions to the peak shape using ,,Instru-
ment → Show Peak Profile . . . ”. The dialog features four tabs. The first three tabs are used to
display wavelength, instrumental, and sample profile shape contributions. The fourth tab shows
the convoluted profile, and only is enabled once the first three tabs show data. Fig. 29 shows
examples for all four pages.
All graphs can be zoomed horizontally using the mouse scroll wheel, unzoomed using the right
mouse button, and dragged using the left mouse button. Also the graphs can be exported to CSV
table files, PDF graphs, and pixel images. Clicking the second button from the left will reload the
current file from disk. This allows to quickly update the graph when editing the source file in a
text editor.
The filled curve always represents the total contribution function, which are usually composed of
several sub-curves. The sub-curves can be toggled on and off using the third button from the left
in the bottom-left corner of the dialog.
It is generally recommended to start with the left-most tab and load some data. Then proceed to
the next tab. Once the third tab contains data, the fourth tab is enabled and the convoluted profile
can be calculated.
The first tab allows to display the characteristic spectrum of an X-ray tube, as it is described in a
*.lam file bundled with BGMN and Profex. Use the first button on the left to load a file. The file
dialog automatically opens in the BGMN directory and offers all *.lam files to be opened. Once
opened, the dialog will show the wavelength spectrum on an Ångstrom scale.
The sub-curves on this graph represent the lorentzian curves described in the *.lam file in order to
approximate the characteristic spectrum.
The instrumental function originating from the goniometer layout is read from a *.geq file, which
is obtained as a result of the raytracing and interpolation of the peak shape as described in section
8. When loading a file, the file dialog will automatically open in the device repository.
Instrument contributions are displayed on a ∆2θ axis. The position 0.0 represents the peak center,
values to the left and right represent deviations from the center. The actual 2θ value is shown in
the legend. Since the instrument contribution depends on the 2θ position, a slider at the bottom
of the dialog can be used to scroll through the 2θ range the profile was calulated in (defined in the
instrument *.sav file).
73
Sub-curves represent lorentzian curves computed by BGMN to approximate the raytraced pro-
file.
Peak broadening by small crystallite size and micro-strain can be computed on the third tab. There
is no file to load. Instead, enter values for the BGMN variables B1, k1, and k2 in the spin boxes,
then press the ,,Reload” button (second button from the left) to compute the profile contribution.
The peak broadening is shown on a 1/d axis. It also depends on the 2θ position of the peak, which
can be scrolled through using the slider.
Sub-curves represent individual contributions of crystallite size and micro-strain.
In order to convolute the peak profile contributions shown in the first three tabs, raise the fourth
tab and click the ,,Reload” button (second button from the left). Computation will be complete
after a few seconds. The graph will show the observed peak shape on a ∆2θ scale with the value
0.0 representing the peak center. The peak’s position in the diffraction pattern is shown in the
legend. Use the slider to scroll through the entire 2θ range.
Sub-curves represent contributions from wavelength distribution, instrument geometry, and sam-
ple properties. Note that here all contributions are converted to a 2θ scale.
74
(a) Wavelength distribution (b) Instrument geometry
Figure 29: The dialog ,,Instrument → Show peak profile. . . ” allows to display the individual
contributions leading to the convoluted observed peak shape.
75
18 Scan batch conversion
Several scan files can be converted to other data formats at a time using the ,,File → Scan batch
conversion. . . ” feature. However, due to limitations given by the formats, SVG and pixel images
(PNG) are not available for batch conversion.
When opening the batch conversion dialog by clicking ,,File → Scan batch conversion. . . ”, the file
queue will contain all currently opened scan files by default. More files can be added by clicking
the ,,Add File” button and selecting one or more files, and selected files can be removed from the
queue by clicking the ,,Remove File” button.
Some output format support multiple scans stored in a single file. The option ,,Write scans to one
file” will instruct Profex to store all scans found in a source file into one single file. In that case, all
scans Iobs , Icalc , Idi f f , Ibackground , and all sub phase patterns found in a DIA file will be stored in a
single output file. Use ,,Write scans to individual files” to write these patterns into single output
files instead. Note that storing multiple scans in one file must be supported by the output format
as well as by Profex’ output filter, which is currently only the case for ASCII and Gnuplot files.
Click ,,Convert” to start the conversion process, or ,,Close” to close the dialog without conver-
sion. Output files will be stored at the location of their source files using the same base file name.
Existing output files will be overwritten without warning.
76
19 Favorites
Reference structure files can be flagged as favorites in the preferences dialog (Fig. 30). Favorite
phases can then be filtered in the ,,Add / Remove Phase” dialog and in the reference phase drop-
down menu by clicking the ,,Show favorites” button (Fig. 31). Filtering favorites greatly sim-
plifies handling reference structures in large repositories by limiting the number of displayed
structure to a hand full of relevant ones.
Important: When double-clicking a peak in the diffraction pattern to identify the nearest reference
structure while filtering of favorites is active for the reference structure list (Fig. 31 top-left), only
the favorites will be searched. In order to search all reference structures, temporarily deactivate
favorites filtering (Fig. 31 top-right) prior to double-clicking.
Figure 30: Favorite reference structure files are configured in the preferences dialog by checking
the box in the 4th column ,,Favorites”.
77
Figure 31: Filtering favorite reference structures (left) allows to quickly change between relevant
(left) and all (right) structure files in the repository.
78
20 Baselines
Note: Subtracting baselines from raw data later used for Rietveld refinement is not recommended. All
Rietveld refinement programs rely on unmodified intensities for error estimation.
Profex allows to compute a baseline (background curve) for scans in a project. Use ,,Project →
Add Baseline. . . ” to open the dialog shown in Fig. 32. Two different algorithms [16, 17] are imple-
mented with various parameters to adjust. The dialog provides the following options:
Append Appends the baseline to the project without closing the dialog. Another one can be cre-
ated, either for a different scan, or for the same one but using different parameters.
OK Appends the baseline to the project and closes the dialog.
Depending on the selected algorithm, various different parameters can be adjusted in order to
optimize the baseline. There is no recommended setup. One set of parameters might work well
for a certain diffraction dataset whereas it might be a poor choice for another dataset. It is rec-
ommended to adjust the parameters until a satisfying baseline is created. The parameters are
described in the sections below.
Baselines appended to the project are not yet saved to disk. If the project or the program is closed,
they are discarded. To preserve the baselines, open the ,,Plot Options” window, right-click on the
baseline scan, and select ,,Export Scan. . . ”. Select ,,Ascii Free format (*.xy *.XY)” file type, or any
other format of your preference.
Baselines can be subtracted from measured data using the ,,Scan Math” feature (section 21). How-
ever, as mentioned above, raw data used for Rietveld refinement must not be modified by baseline
subtraction. However, in situations when the refined background curve is not able to accurately
describe amorphous signals or low-angle steps in the background, it may still be desired to use a
fitted baseline on top of the refined background. This is done as follows:
1. Create a baseline for the raw data scan, and export it to disk in ,,Ascii Free format (*.xy *.XY)”
as described above, for example as ,,myBaseline.xy”.
2. Create a refinement project and open the control file (*.sav).
3. Add the following line to the control file
UNT=myBaseline.xy
4. Now run the refinement
The resulting background curve is a combination of the manually created baseline and a refined
background polynom. This approach has no negative effect on error estimation.
79
Figure 32: The baseline dialog allows to add a smoothed baseline (green) to the project.
The algorithm published by Golotvin and Williams [17] is based on interpolated anchor points.
The first 6 parameters control the selection of anchor points, whereas the last option defines the
interpolation function. Anchor points are shown in the table on the right, and can be fine adjusted
manually.
Data smoothing M: Raw data can be smoothed prior to selecting anchor points. The smoothing
algorithm is described in [17]. Select 0 for no smoothing. Greater values result in stronger
smoothing. Usually a low number (0–5) works best.
Window size N: The number of data points used for the anchor point selection window. Data
point i is compared with its neighbors in the window from data points i − N/2 to i + N/2
in order to determine whether or not it qualifies as an anchor point. Lower values result in
80
more flexible baselines, greater values in smoother ones. Values between 5–20 usually work
well.
Noise multiplier n: Multiplier factor for the noise σnoise . See equation 1 in the original paper [17]
for more information. Greater values result in more data points being used as anchor points.
Lower values are more restrictive, resulting in lower number of anchor points. A value of
1.0 is recommended.
Sampling steps: Only every i th data point will be used to determine anchor points. For a value of
1, every data point will be evaluated. For a value of 5, every 5th data point will be evaluated.
Values between 1 and 20 are recommended.
Sensitivity: For values greater than 1, a certain number of consecutive data points must qualify
as anchor points in order for the middle point to be accepted as anchor points. For example,
if sensitivity is set to 5, and the following data points all fulfill the requirements for anchor
points:
30.02, 30.04, 30.06, 30.08, 30.10
then only the middle point at 30.06 will be used as an anchor point. Greater values for
sensitivity result in smoother baselines. Values between 1 and 5 usually work best.
Last point: An anchor point will always be added at the position of the last data point in order to
avoid extrapolation of the baseline. However, sometimes the scan stops in the middle of a
peak rather than on the baseline. In that case, using the last data point as an anchor would
bend the baseline upwards. To avoid this, a different intensity value can be used for the last
anchor point. Options are either the second last anchor point, resulting in a horizontal end
of the baseline, or the lowest anchor point determined anywhere in the diffraction pattern.
There is no recommended setting. Avoid abrupt changes of the baseline at the end of the
diffraction pattern.
Interpolation: Select one from several interpolation functions to connect the anchor points. In
most cases, the Akima or monotone spline curves are the best choices.
81
21 Scan Math
The tool ,,Scan Math” allows to perform mathematical operations on all scans loaded in a project.
Expressions must be entered in Java Script syntax [?, ?]. After clicking ,,Generate Scan” the calcu-
lation is performed and a new scan is appended to the project. The new scan can be saved to disk
by right-clicking on the scan in the ,,Plot options” window and selecting ,,Export scan. . . ”.
Scans are addressed by their position in the project preceded by ,,#”. The first scan in a project is
addressed as ,,#1”, the second one as ,,#2”. Double-clicking on a scan in the ,,Scan Math” dialog
will append its reference to the ,,Expression” line.
If a reference exceeds the number of available scans, the calculation will not be performed.
Scans in a project can have different angular ranges and different step sizes. When performing
mathematical operations on scans of different ranges or sampling intervals, the user must declare
one of the scans as anchor scan. The selected anchor scan determines in which angular range and
at what sampling intervals the mathematical operation is performed. Scans of different angular
ranges or with different sampling intervals are handled as follows:
• If the anchor scan range exceeds the angular range of one or more scans used in the mathe-
matical operations, the exceeded scans are padded with intensity 0.0.
• If one or more scans use different sampling intervals than the anchor scan, their intensities
are quantized to the anchor scan’s sampling interval using linear interpolation.
An example for the role of the anchor scan is illustrated in Fig. 33. Two scans with different angular
ranges and step sizes are summed using the expression ,,#1 + #2” (Fig. 33a).
• If the longer scan #1 is selected as anchor scan, the resulting scan has the same angular
range and step size (Fig. 33b), the shorter scan #2 is padded with intensity 0.0 on both ends.
Intensities of scan #2 are quantized to the smaller step size of the anchor scan using linear
interpolation.
• If scan #2 is selected as anchor scan, the longer scan #1 is clipped to the length of the shorter
anchor scan (Fig. 33c), and the intensities of scan #1 are quantized to the larger step size of
anchor scan #2 using linear interpolation.
21.2 Examples
Some example expressions are shown below. A comprehensive reference of functions and opera-
tors supported by Java Script is available at [?, ?].
82
(a) Two scans #1 (black) and #2 (red).
83
21.2.1 Rescaling and offset
Select ,,File → Open raw scan file. . . ” and open a scan file. Then select ,,Tools → Scan Math. . . ”.
To rescale the intensity by factor 2.0, enter the expression:
2 ∗ #1
#1 + 100
Math.sqrt(#1)
Math.pow(#1, 2)
Select ,,File → Open raw scan file. . . ” and open a scan file. Insert another scan to the same project
by selecting ,,File → Insert Scan. . . ”. Then select ,,Tools → Scan Math. . . ”.
To calculate the sum of the two scans, enter the expression:
#1 + #2
#1 − #2
Alternatively the same examples can be performed on a refined project (*.dia) file, for example to
subtract the background curve (#4) from ,,I observed” (#1):
#1 − #4
84
22 Peak Integrals
The integrated intensity of individual peaks can be determined with the tool ,,Peak integration”
found in ,,Window → Peak integrals”. This opens a new window with an empty table. The table
will list integrated intensities once at least one range is defined in the graph.
To define an integration range, place the mouse cursor on the graph at the beginning of the range,
then press and hold the shift key and left mouse button, and drag the cursor to the end of the
range. The range will be highlighted in gray, and once the mouse button is released, the integrals
will be computed and shown in the peak integral table (Fig. 34). The range’s start and end position
can be adjusted in the respective boxes in the table.
The results of the peak integration can be exported to a CSV file by selecting ,,Results → Export
peak integrals. . . ”.
On the right-hand side of the table some buttons for more actions are located:
Remove selected range: By clicking this button the currently selected range is removed from the
table.
Remove all ranges: This action clears the entire table.
Apply ranges to all open projects: This action will copy all ranges of the table to all other open
projects. This allows to define ranges in one project, but to obtain the same integrals from
a large number of projects. A dialog allowing to select projects to apply the ranges to will
be shown prior to applying the ranges. Note that existing ranges will be cleared from the
receiving projects.
Subtract linear background: This action toggles subtraction of a linear background on or off. See
the next section for more information.
22.1 Calculations
Integrals A in the angular range from data points start to end are determined as follows:
end−1
A= ∑ Sn · In · F
n=start
with S being the step size between data points n and n + 1, In being the intensity of data point n,
and F being the scale factor applied by the user in the plot options. Vertical offsets are ignored.
No interpolation or curve fit is performed.
If the option ,,subtract linear background” is checked, a linear background will be interpolated
between start and end, and intensities will be determined relative to this background curve
(Fig. 35):
85
end−1
A= ∑ Sn · ( In − Bn ) · F
n=start
n − start
Bn = Istart + · ( Iend − Istart )
end − start
Note that data points below the background will also be considered for integration, hence poor
choice of the integration range can result in negative integrals.
When processing refined projects, it is recommended to de-activate the background subtraction,
and instead subtract the integral of the refined background from the integral of the raw data.
Figure 34: Peak integrals of a raw data file (top) and a refined project (bottom).
86
Figure 35: When the option ,,subtract linear background” is checked, a linear background will be
interpolated between the first and the last point of the range (top). Integrals will be determined
relative to this baseline (yellow area). If the option is unchecked, integrals will be determined
from the zero line (bottom).
87
23 Edit All Structure Files
Changing the refinement state of a large number of parameters (e. g. all atomic coordinates) can
be tedious. Profex offers a dialog allowing to change the refinement state of many parameters at
a time, not only in one structure file, but in all (or a selection of) structure files of a refinement
project. Selecting ,,Project → Edit all Project STR files. . . ” opens the dialog shown in Fig. 36.
The dialog lists all project STR files on the left side, allowing to select all or a subset of files. Specific
files can be selected using the buttons marked as group 1 in Fig. 36. From left to right, the buttons
select the following files:
Open files Selects only the STR files that are currently opened in the current project. If no STR
files are opened, this button is disabled.
Current file Selects only the currently shown STR file. If no STR file is opened, or a different type
of file is currently shown, this button is disabled.
None Unselects all files. Note that the ,,Apply” button has no effect if no file is selected. It is,
however, sometimes useful to unselect all files before selecting certain files manually. This
is what this button is used for.
The right part of the dialog list structural parameters, grouped as ,,Unit Cell”, ,,Profile”, and ,,
Atomic Sites”. Each parameter can be checked or unchecked. Only checked parameters will be
modified. Selections can be quickly made using the buttons in group 2 in Fig. 36, which from left
to right have the following function:
Check Group If a parameter or a group is selected with the mouse, this button will check all
parameters of this group. If no parameter or group is selected, all parameters of all groups
will be checked.
Uncheck Groups If a parameter or a group is selected with the mouse, this button will uncheck all
parameters of this group. If no parameter or group is selected, all parameters of all groups
will be unchecked.
Increase refinement state by one step This button will increase the refinement state of the cur-
rently selected group of parameters.
The refinement state of checked parameters can be set individually, or using the button ,,Increase
refinement state by one step” to modify the group of the currently selected parameter. This but-
ton increases the state of all parameters that are not yet at their maximum refinement state. For
isotropic parameters the sequence is:
f ix → re f ined
For anisotropic parameters the sequence is:
f ix → isotropic → AN ISO(4)
88
Figure 36: The dialog allows to modify the refinement state of all project structure files at a time.
SPH AR0 → SPH AR2 → SPH AR4 → SPH AR6 → SPH AR8 → SPH AR10
Once all parameters of the current group have reached their maximum refinement state, clicking
the button again resets them to fix.
Clicking ,,Apply” will apply the modifications to all selected STR files. The changes are saved to
disk immediately. Closing the dialog without clicking ,,Apply” will have no effect.
89
24 Find in Files
The dialog ,,Edit → Find in files” is used to search specific text patterns in all open text files or a
specific type of open text files. Note that the files need to be opened to be searched. Profex will
not search text files on disk or open any files automatically.
A search expression needs to be entered in the ,,Regular Expression” box (or selected from the
box’s history). Then select the project and the type of files to be searched. Press the ,,Search”
button to execute the search. Results can be exported to a CSV file.
The search pattern is interpreted as a regular expression. If a capture is defined using parentheses,
the match will only show the first capture. If no capture is defined, the entire matching line is
displayed (Fig. 37).
Example
The following expression searches for the term ,,XrayDensity” followed by ,,=” and one or more
non-whitespace characters:
XrayDensity=(\S+)
The non-whitespace characters, i. e. the numerical value following the ,,=” sign, are defined as a
capture group. If the expression is matched in the text files, only the captured part is shown in the
match list:
Project
File
Line x: 3.102
Line y: 3.058
Line z: 3.355
XrayDensity=\S+
Project
File
Line x: XrayDensity=3.102
Line y: XrayDensity=3.058
Line z: XrayDensity=3.355
90
Figure 37: Defining a regular expression pattern with a capture will display only the capture (left).
Else the entire matching line is displayed (right).
91
25 Electron Density Maps
The measured intensity of a diffraction peak hkl is proportional to the square of the structure factor
2 , which represent diffracted waves and are calculated as the sum of waves scattered at each
Fhkl
atom in the unit cell:
n
Fhkl = ∑ fi · e2πi[hx+ky+lz]
j =1
where f i is the scattering factor of atom i, h, k, l are the Miller indices of the reflection, and x, y, z
are the fractional coordinates of atom i. Theoretically, F is the Fourier transform of the scattering
density, ρ( x, y, z) taken over the entire unit cell:
Z cZ bZ a
Fhkl = ρ( x, y, z) · e2πi(hx+ky+lz) dx dy dz
0 0 0
If we determined F by Rietveld refinement and want to restore ρ( x, y, z), we can use the reverse
Fourier:
1
ρ( x, y, z) =
V ∑ Fhkl · e−2πi(hx+ky+lz)
hkl
where ρ is the electron density at discrete fractional coordinates x, y, z. V is the unit cell volume.
The summation is over all hkl peaks within the measured range.
25.1 Preparations
Profex can compute maps showing the electron density ρ in the unit cell from refined structure
factors F. In order to do so, two specific output files must be generated for each phase the map
should be generated for:
*.res : This is a file format used by ShelX. It contains all refined fraction atomic coordinates, as
well as all symmetry operators.
*.fcf : Another file format used by ShelX, which contains calculated and observed structure fac-
tors.
Both output files must be generated before the electron density map can be cacluated. Add the
following lines to the refinement control file:
RESOUT[n]=structure.res
FCFOUT[n]=structure.fcf
92
Figure 38: Use the contxt menu (right mouse button) to add *.fcf and *.res files for electron density
map calculation.
This can simply be done by placing the cursor on a structure file entry and clicking the right mouse
button. In the context menu, both files can be added. For example, in a project containing the two
phases ,,hydroxylapatite” and ,,whitlockite”, the following section shows the structure files used
in this project:
% Phases
STRUC[1]=Hydroxylapatite-monoclinic.str
STRUC[2]=Whitlockite.str
If an electron density map for hydroxylaptite should be calculated, add the FCFOUT and
RESOUT lines using the right mouse button:
% Phases
STRUC[1]=Hydroxylapatite-monoclinic.str
FCFOUT[1]=Hydroxylapatite-monoclinic-ex1-file01.fcf
RESOUT[1]=Hydroxylapatite-monoclinic-ex1-file01.res
STRUC[2]=Whitlockite.str
The file names are created automatically. See Fig. 38 for an example. Then repeat the refinement.
93
25.2 Map calculation
Open the dialog ,,Tools → Electron density map”. An empty dialog as shown in Fig. 39 will
appear. We need to load the *.fcf file created in the previous section. The electron density map will
automatically be computed and images will be rendered. Once the Fourier synthesis and image
rendering are complete, the electron density distribution is shown along the projection selected in
the ,,Projection” box (Fig. 40). By default the image is projected along the c axis, showing a cross
section of the a-b plane. The vertical slider on the right side of the image can be used to select the
cross section level along the c axis. The cursor position in fractional coordinates is displayed on
the bottom left.
The projection, color appearance, and the amount of interpolation (,,smoothing”) can be adjusted.
To apply the changes, press the ,,Compute map” button again. Fig. 41 shows the same map ren-
dered with a false color map and contour lines, and with labels and circles representing the size
of the atoms. All user interface elements are described below.
Load *.fcf file Loads an *.fcf file and immediately computes the electron density map and renders
images. The *.res file is read in the background at the same time.
Re-calculate electron density map When the synthesis, resolution, projection, or the content of
the *.fcf file changed, the electron density map can be re-calcluated by pressing this button.
Render images When the color map, interpolation, or intensity range changed, the images can be
updated by pressing this button.
94
Figure 40: Rendered electron density map.
Figure 41: Electron map rendered with a different color map and with labels.
95
Save current layer Saves the current layer to a pixel image.
Save all layers Saves all layers to pixel images. The images will be numbered automatically.
Pre-render images When checked, all images from level 0 to 1 will be rendered automatically. If
unchecked, only the displayed level will be rendered. All other levels will be rendered on
the fly when displayed. For most users, pre-rendering is the preferred settings. If it takes
too long, disable pre-rendering.
Projection Select the projection plane of the unit cell to be displayed.
Interpolation Select the amount of pixel interpolation. Color maps with contour lines require high
interpolation. Lower levels of interpolation look pixelated.
• ,,None” shows the voxels filled with the sampled value.
• ,,Medium” uses bi-linear interpolation to interpolate screen pixels between samples
values.
• ,,High” uses bi-cubic interpolation to interpolate screen pixels between sampled values.
Range Sets the electron density range for the color map. Normally the range is set automatically
to fit the maximum and minimum calculated density in the range.
Image size Set the size of the map images in pixels (longest dimension).
Draw axes Check to draw the vertical and horizontal unit cell axis.
Draw atoms Check to draw circles for ionic radii. The radii are taken from [?].
Mouse actions The mouse can be used to interact with the map image display as follows:
96
(a) Fobs map (b) Fcalc map (c) Fobs-Fcalc map
Figure 42: The Fobs-Fcalc map shows the difference between electron densities calculated from
observed (Fobs) and calculated (Fcalc) structure factors. Note that Fobs-Fcalc uses a different
range value to enhance the visibility of the differences.
Two types of structure factors are available from the Rietveld refinement: The ones extracted from
the measured data (Fobs), and the ones obtained from the pattern calculated from the crystal struc-
ture models (Fcalc). The electron density map can be calculated from either of them by selecting
the corresponding ,,Synthesis”. However, the most useful application of electron density maps is
the ,,Difference Fourier map” showing the differences between Fobs and Fcalc in terms of elec-
tron density mismatches. This allows to locate misfits in the structure models, for example due
to substitutions or vacancies. It is also a useful tool for structure solution. To display a difference
Fourier map, simply select ,,Fobs-Fcalc” from the synthesis box and re-calculate the map. Fig. 42
shows a comparison of observed and calculated electron densities, as well as the difference be-
tween the two with an apparent residual density due to a mismatched substitution of Ca for Mg
in the apatite structure.
97
26 Absorption coefficient
The dialog ,,Tools → Calcualte absorption coefficient. . . ” allows to calculate the absorption of
X-radiation from refinement results. When opening the dialog from a refinement project, it will
automatically read the *.lst file and enter the information to the dialog. An example is shown in
Fig. 43.
For each phase, the chemical composition, its density, and its quantitiy in wt-% in the sample
is required. This information must be enterd in the ,,Phase parameters” section of the dialog, if
it is not automatically entered. In the block ,,Sample parameters”, the following information is
required:
Wavelength: The absorption changes with wavelength. Select the characteristic wavelength to
calculate the absorption for.
Attenuation: The ,,Path length” and ,,Layer thickness” results describe, after which distance in
the sample the initial intensity is attenuated by the fraction given here. For example, an
attenuation of 99 % means that after the calculated ,,Path length” the intensity is reduced to
1 %.
Packing density: The absorption of the sample also depends on the packing density, because the
air in the space between the grains absorbs less than the solid material. Estimate the packing
density to obtain a more realistic penetration depth.
Incident angle: The result for ,,Path length” describes how far the radiation penetrates into the
sample along the direction of the beam. ,,Layer thickness” gives only the penetration depth
vertical from the sample surface and thus depends on the incident angle of the beam.
98
Figure 43: The absorption coefficient dialog computing the absorption for a mixture of the two
phases β-TCP and hydroxyapatite.
99
27 Peak list and BGMN PAR files
A list showing refined peak parameters can be opened by clicking ,,Window → Peak list”. It
parses the *.par file created by BGMN and presents the peak data in a table (Fig. 44). The list can
be sorted by clicking on the header of a specific column.
Setting ,,hkl list” to ,,All” shows the peaks of all refined phases. Selecting a specific phase filters
the list and only shows peaks of the selected phase.
If a cell in the table is selected with the mouse, the selected peak is highlighted in the graph with
arrow symbols and bold lines. To clear the selection, click the × button in the peak list widget.
Selected peaks can be deleted by clicking the − button in the peak list widget. Note that deleting
peaks does not modify the *.par file or the Rietveld refinement project. It only removes the hkl line
temporarily from the list and the graph. Re-loading the project restores all deleted lines.
The peak list can be exported to a CSV file for further processing in a different software using the
button ,,Save list to CSV file” in the peak list widget.
Figure 44: The peak list widget found in ,,Window → Peak List”.
100
Figure 45: The peak data dialog found in ,,Tools → Browse BGMN PAR file”.
An older implementation of the peak list with functionality very similar to the peak list widget
described above can be found in ,,Tools → Browse BGMN PAR files” (Fig. 45). This dialog allows
to open a BGMN *.par file without having to open the entire refinement project. It only reads
the *.par file, other files such as the scan, control, or list files are not required. The peak data is
presented in a form similar to the peak list described above. The dialog is non-modal, i. e. it can
remain open while the main is being used. When the *.par file has changed, for example when a
refinement has terminated, the list must be updated manually by clicking the button ,,Reload PAR
file” at the bottom left of the dialog. Also make sure that the correct wavelength is selected, oth-
erwise the conversion from d values in nm to diffraction angles in ◦ 2θ results in wrong values.
Note that this dialog only displays one specific *.par file. When selecting a different project in the
Profex main window, this dialog does not load the *.par file of the new project.
101
28 Peak fitting
The peak fitting or non-linear curve fitting module is one of Profex’ generic data processing tools.
It is not required for Rietveld refinements, but it can be used to implement other phase quantifi-
cation methods, remove phantom peaks, or measure peak width, center positions, and intensities.
Other than Rietveld refinement, peak fitting is not a full-pattern method, but rather applied to
small sections of the diffraction pattern containing single or small groups of peaks.
The peak fit widget can be opened by clicking ,,Window → Peak fitting” (Fig. 46). It is imple-
mented as a dock widget, which means that each project has its own implementation of the wid-
get, and they can be rearranged, stacked, or detached from the main window.
The user interface of the peak fitting widget is shown in Fig. 46. It closely interacts with the central
graph view, as will be demonstrated in the step-by-step instructions in the next section. A brief
description of the user interface elements is given below.
Scan Select the scan the peak function shall be fitted to (usually the measured data).
Data range Enter the 2θ range the functions shall be fitted to. The range can be entered numer-
ically in the two spin boxes, or graphically by activating the ,,Select range” button. The
,,Select range” button sets the central graph display to range select mode, as indicated by
a blue margin color. Double-clicking on the graph sets the start of the range, the second
double-click sets the end of the range.
Step size A custom step size can be selected for the fitted curves. If this option is not activated,
the curves will use the step size of the selected scan.
Add Peak Pressing the ,,Add peak” button sets the central graph display to ,,add peak” mode, as
indicated by a blue margin color. When activated, double-clicking on the graph adds a peak
function of the type selected in the ,,Add peak” dropdown menu.
Information label When the ,,Select range” or ,,Add peak” modes are activated, this label shows
what action the next double-click on the graph display will execute.
Functions All added functions are listed here with a description and names of the function vari-
ables.
Variables Every function variable / parameter has a name, an initial value, and upper and lower
limits. These values are listed here.
Controls Some fit parameters (maximum iterations, convergence criteria etc.) can be adjusted
here.
Remove selected function Removes the selected function.
Clear all functions Removes all functions. A confirmation dialog will be shown before clearing
all functions.
102
Figure 46: The peak fit dockwidget is opened from the ,,Window” menu.
Apply function list to all projects Copies all parameters (range, step size, function list) to other
projects. A project select dialog will be shown, allowing to select the target projects.
Pin fitted functions After adding peak functions and running the curve fit, the resulting scans are
flagged as temporary. When clearing all functions, the temporary scans will be cleared, too,
and when re-running the fit, the temporary scans will be updated. Once the functions are
pinned, they are no longer linked to the function list. Clearing the list will not affect the
fitted scans, and re-running the fit will add a new set of temporary scans.
This section describes how to fit the corundum (3-2-4), (3-30), and (3-25) CuKα1 /CuKα2 duplets
in the range from 65.3 to 71.6◦ 2θ.
103
Defining the range
Pressing the ,,Select range” button sets the graph display to range selection mode. Double-click
at 65.3◦ to set the left side of the range, then double-click at 71.6◦ to set the right side. While
dragging, the range is highlighted in grey. After the second double click, the range selection mode
will exit automatically.
Next we need to define a function to fit the background. In the short range from 65.3 to 71.6◦ 2θ
a linear function is sufficient. Activate ,,Add Peak”, select ,,Linear” from the functions menu,
and double click on the background near the left side of the range. Then double click on the
background on the right side of the range. The linear function will be indicated by a line. After
the second double-click, leave the ,,Add Peak” mode active for the next step.
Now select ,,Pseudo-Voigt” from the functions list and double-click on the tip of the first peak to
set the center position and peak intensity. Then pull the mouse cursor down towards the foot of
V
the peak. A shape indicates the initial shape of the peak function. Try to approximate the true
shape of the peak and double-click to set the base point of the peak (Fig. 47). Continue adding
peaks until 6 pseudo-Voigt functions are declared for all three Kα1 and Kα2 peaks. The functions
and their parameters are listed in the ,,Functions” list (Fig. 48). Each parameter is assigned a
variable, and all variables are listed in the ,,Variables” tab with an initial value, lower and upper
boundaries, and a check box to select whether the variable is fix or released for fitting.
Click ,,Run curve fitting” to start the fit. When the process terminates, check the refinement output
for the exit status. If the status is ,,5 - MaxIts steps reached”, run peak fit again. If the status is ,,2 -
converged”, the fit is complete. Check the ,,Variables” values for the final results of the fit.
It often makes sense to restrict the number of fitted parameters in order to stabilize the result. For
example, adjacent pseudo-Voigt functions often have identical shape parameters, and Kα1 and Kα2
of the same lattice plane have the same FWHM. Fitting these parameters independently results in
unnecessarily complex (and unstable) fits. Instead, we want to use the same variable for multiple
curve parameters.
In the previous example we defined one linear function for the background, and 6 pseudo-Voigt
functions for the three corundum Kα1 / Kα2 duplets. To stabilize the fit, we want to use the same
value for ,,Shape” of all 6 peak functions. To do so, we assign variable $2-4 to all shape parameters.
Double-click all ,,Shape” parameters and select variable $2-4 from the opening dialog (Fig. 49).
Then repeat the fit. Note that variables $3-4 to $7-4 (the former shape parameters) remain in the
list of variables, but they are no longer used by any function. Their value is thus meaningless.
104
Figure 47: Adding peak functions.
Figure 48: Initial list of functions and variables prior to running the curve fit.
105
Figure 49: Double-click parameters in the ,,Func-
tions” list to assign a different variable.
If the ,,Step Size” check box is unchecked, the fitted curves will use the step size of the selected
scan. It is, however, possible to use a higher resolution step size for the calculated curves to
interpolate between the sampled data points. Check ,,Step Size” and enter a value smaller than
the measured step size. Then repeat the curve fit. As shown in Fig. 50, the fitted curves are smooth
and interpolate the measured data points accurately.
28.5 Controls
The ,,Controls” page (Fig. 51) allows to set some parameters for convergence. ,,Automatic” selects
automatic convergence criteria and maximum number of iterations. It is usually the preferred
mode, but when using high-order polynomials for background fitting, it may take a long time to
converge. In such cases, setting the maximum number of iterations to 200 and the convergence
criterion to 0.000001 may be a better solution. If the fit does not reach convergence, click ,,Run
curve fit” repeatedly until it converges.
,,Show live update” updates the curves, the variables, and the output protocol after each cycle.
However, it is currently a lot slower and it may not converge. Run an automatic non-life fit af-
terwards if it does not reach convergence. This feature may be improved in future versions of
Profex.
106
(a) Default step size . (b) Custom step size of 0.0010◦ .
Figure 50: A custom step size can be specified if the fitted curves should be smoother than the
measured data points.
107
29 Trouble shooting
29.1 Installation
Program settings are stored outside of the Profex directories. Deleting and re-installing Profex will
not reset the preferences. Here is what you need to do in order to clear all preferences:
Windows
1. Close Profex
2. Open the windows menu and enter the command ,,regedit.exe”
3. Navigate to HKEY_CURRENT_USER/Software/doebelin.org
4. Delete the entire folder ,,Profex2”
OS X
1. Close Profex
2. Delete the file /Library/Preferences/org.doebelin.Profex2.plist
3. Restart your computer
Note: If you don’t restart your computer, it will continue using a buffered version of the plist file
and the settings will not be reset to default. Instead of restarting your computer, you can enter the
following command in a terminal in order to force updating the buffered file:
Linux
1. Close Profex
2. Delete the file ˜/.config/doebelin.org/Profex2.conf
29.2.1 I closed all dock windows. How can I open them again?
All dock windows (tool windows arranged around the plot area) can be opened from the ,,Win-
dows” menu.
108
29.2.2 How can I share refinement projects with other users?
The easiest way to share projects with other users is to share project backups:
On the source computer
1. In Profex click ,,Project → Save project backup” to create a *.zip file with all required scan,
control, structure, and instrument files.
2. The name of the created file will be shown in the ,,Refinement Protocol” console.
3. Share the *.zip file with the recipient.
On the recipient’s computer
1. Save the received *.zip file at the location where you want to process it.
2. In Profex click ,,File → Open Project Archive. . . ” to open the *.zip file.
3. Run the refinement.
The *.zip file will be extracted and the file formats will be converted to the target platform’s text
file format.
29.2.3 How can I share refinement projects between Windows and OS X / Linux platforms?
Opening a refinement project created on one platform (either Windows or OS X / Linux) on an-
other platform (OS X / Linux or Windows) will cause an error message as soon as the refinement is
started. This is due to the fact that both types of platforms use different characters for line endings
in text files, and BGMN only accepts the format native to the platform it is used on.
To avoid these error messages, use the backup feature to share projects as described in sec-
tion 29.2.2. It automatically converts the files to the target platform.
Favorites
• Make sure the ,,Favorites” button is unchecked ( button next to the reference structures
list).
• Select ,,Tools → Index Reference Structures” to update the structures database (or click the
button).
109
Clear the hkl buffer file and re-index the structure files
1. Select ,,Edit → Preferences → BGMN → Reference Structures” and clicking ,,Clear Buffer”.
2. Close the preferences dialog.
3. Select ,,Tools → Index Reference Structures” to update the structures database (or click the
button).
• Select ,,Edit → Preferences → BGMN → Repositories” and verify that the structure file
repository points to a valid location containing *.str files.
Favorites
• Make sure the ,,Favorites” button is unchecked ( button in the bottom-right corner).
• Select ,,Tools → Index Reference Structures” to update the structures database (or click the
button).
Clear the hkl buffer file and re-index the structure files
1. Select ,,Edit → Preferences → BGMN → Reference Structures” and clicking ,,Clear Buffer”.
2. Close the preferences dialog.
3. Select ,,Tools → Index Reference Structures” to update the structures database (or click the
button).
• Select ,,Edit → Preferences → BGMN → Repositories” and verify that the structure file
repository points to a valid location containing *.str files.
29.2.6 The ,,Add/Remove Phases” dialog only shows checkboxes, but no text
All columns showing the file and phase names are minimized to the left side of the dialog. Resize
the columns to show the names and selection checkboxes.
110
29.2.7 What does the error message ,,No import filter found for file . . . .raw” mean?
Several different file formats use the same extension *.raw (Rigaku, Bruker, Stoe). Attempting to
open a raw file with an import filter for a different type of raw file will issue this error message.
When opening raw data files, make sure that the file format in the file dialog is set to the correct
type of raw file (,,Bruker raw scan”, ,,Rigaku raw scan”, or ,,Stoe raw scan”).
29.3 Refinements
29.3.1 What does the error message ,,insufficient angular range” mean?
Short answer
The measured scan exceeds the angular range, in which the peak profile was calculated from
the instrument configuration file. Clip your measured data using the keywords WMIN (minimum
angle) and WMAX (maximum angle) in the refinement control file (*.sav) to limit the angular range
of your scan to the range specified in your instrument configuration.
Example Suppose the peak profile was calculated from 4 to 150◦ 2θ, but your scan was measured
from 3 to 80◦ 2θ. This will trigger the error message, because the peak profile was not computed
for the range from 3 to 4◦ 2θ. Add the following line to your refinement control file (*.sav):
WMIN=4
Then repeat the refinement. Now the measured range from 3 o 4◦ 2θ will be ignored and the error
message should no longer occur.
Long answer
111
%--------------------------------------------------------------------
% Parameters for the simulation of the profile function
%--------------------------------------------------------------------
This shows the 2θ positions at which the profile is simulated (zweiTheta[n]), and the range in
which the profile is interpolated (WMIN and WMAX). In this example, the peak profile was modeled
in the range from 4 to 150◦ 2θ. Outside of this range, the profile is unknown. Hence, if a mea-
sured scan starting below 4◦ 2θ, or ending beyond 150◦ 2θ, is attempted to be refined, the error
message ,,insufficient angular range” will be shown. There are two different ways to avoid the
error message:
• Clip your measured data in order to ignore the measured ranges not covered by the instru-
ment configuration file using the keywords WMIN and WMAX in the refinement control file
(example 2).
• Extend your instrument configuration file to cover at least the range you measured (example
3).
For a demonstration of the two solutions, we assume that the instrument was configured in the
range from 4 to 150◦ 2θ, and we are attempting to refine a dataset measured from 3 to 80◦ 2θ.
Clipping the measured scan We need to clip the measured data below 4◦ 2θ, because it is outside
of the valid range. In your refinement control file (*.sav), add the following lines:
WMIN=4
WMAX=150
112
Then repeat the refinement.
Extending the instrument configuration We need to extend the range in the instrument configu-
ration file from 4 to 3◦ 2θ.
Open your instrument configuration file using the function ,,Edit → Edit
current FPA configuration. . . ” (or ,,Edit → Edit FPA Configuration. . . ” in Profex versions prior to
3.14) and extend the angular range as follows:
%--------------------------------------------------------------------
% Parameters for the simulation of the profile function
%--------------------------------------------------------------------
Then click ,,Run calculations” to start the profile computation. Once it is complete, repeat the
refinement. If it runs without error messages, and you want to keep the extended instrument con-
figuration, copy all files <instrument>.* from your project directory to the devices repository.
Note: In Profex prior to version 3.14, the ,,Edit FPA Configuration. . . ” dialog will open in the
devices repository. It is important to navigate to the current refinement project first, and open the
instrument configuration file found there. Once this version of the instrument configuration file
works as expected, copy all <instrument>.* files from there to the devices repository to make it
available to all future refinement projects.
29.4 My fit looks good, but χ2 is still high. What should I do?
Absolute χ2 values are not always a good indicator for the quality of a fit. They are strongly
influenced by the signal-to-noise ratio. In high intensity datasets it is generally more difficult to
reach a χ2 value close to 1.0, whereas it is easily reached in noisy datasets.
The evolution of χ2 during a refinement is a good indicator when comparing different refinement
strategies, for example to determine which refinement strategy fits better with a given dataset. But
absolute values can be misleading. Sometimes it is better to trust your eyes and assess the quality
of fit based on the difference curve.
113
References
[1] http://www.bgmn.de/
[2] https://www.ill.eu/sites/fullprof/
[3] http://profex.doebelin.org/
[4] Lutterotti, L. et al. ,,Full-profile search-match by the Rietveld method”. J. Appl. Cryst. 52 (2019).
[5] https://www.crystallography.net/cod/
[6] http://www.ba.ic.cnr.it/softwareic/qualxweb/
[7] https://www.crystalimpact.com/match/Default.htm
[8] http://www.castep.org/
[9] http://www.iucr.org/resources/cif/spec/version1.1/cifsyntax/
[10] https://rruff.info/
[11] http://users.uoi.gr/nkourkou/powdll/
[12] http://www.gnuplot.info/
[13] http://plasma-gate.weizmann.ac.il/Grace/
[14] https://sourceforge.net/projects/qtgrace/
[15] http://journals.iucr.org/services/cif/powder.html/
[16] Morháč, M. ,,An algorithm for determination of peak regions and baseline elimination in spectroscoipc
data.” Nucl. Instr. and Methods in Phys. Res. A 600, 478–487 (2009)
[17] Golotvin, S., Williams, Q. ,,Improved baseline recognition and modeling of FT NMR spectra.” J.
Magn. Res. 146, 122–125 (2000).
114
Index
115
Create preset, 69
Refinement project, 29
share, 37
Remove Phase, 12, 15
Remove phases, 16
Report, 31
Repositories, 38
Network-shared, 40
User Repositories, 39
Sample function
Peak broadening, 71
SAV File, 12, 15, 57
Scalable vector graphics SVG, 21, 73
Scan File, 13
Scan Math, 79
STR File, 45
STR file
Verification, 47
Structure File, 29
Edit All, 85
Structure files, 45
SVG File, 21, 73
Text blocks, 68
Wavelength distribution
Radiation spectrum, 70
XML File
Import, 45
116