The values that need to be defined are the Fitting Parameters, the Fitting Settings, and the Diffractometer Settings..
Four buttons above the fit parameters enable the user to toggle the fitting of multiple parameters at once:
The Fitting Parameters are the values to be refined. They include a scale term, terms for a polynomial background fit, and the physical parameters for the carbon system. The "Enable" boxes indicate whether the parameter is to be refined or left fixed. A table of fitting parameters is listed below. Note that parameter 15 is overloaded and represents either the fraction of low-strain carbon in the 1-layer model or the probability of 3R stacking in the 2-layer model.
Parameter Number | Parameter Name | Units | Description |
---|---|---|---|
0 | Scale Factor | a.u. | Multiplicative scale factor for diffraction pattern. |
1 | Z | a.u. | Background function - constant term. |
2 | A*S | a.u. | Background function - linear term. |
3 | B*S2 | a.u. | Background function - quadratic term. |
4 | C*S3 | a.u. | Background function - cubic term. |
5 | D*S4 | a.u. | Background function - quartic term. |
6 | E*S-1 | a.u. | Background function - inverse term. |
7 | A | angstrom | Lateral lattice constant. |
8 | d002 | angstrom | Interlayer spacing. |
9 | La | angstrom | Coherence length in lateral direction. |
10 | M | layers | Number of coherent layers in vertical direction. |
11 | SM | layers | Width of the distribution for number of layers. |
12 | DAB | a.u. | In-plane strain. |
13 | del | a.u. | Inter-plane strain. |
14 | Pr | 0-1 | Probability of random stacking between layers. |
15 | Pt OR g | 0-1 | g - Fraction of low-strain carbon (1-layer model). Pt - Probability of 3R stacking (2-layer model). |
16 | Debye Waller Temperature Factor | angstrom2 | Attenuation factor due to termal motion of atoms. |
17 | PO | a.u. | Preferential Orientation Factor. |
The Fitting Settings control the fit process.
The Diffractometer Settings define the geometry of the instrument and sample.
The original CarbonXS program coupled the above three types of settings into one CARBON.INP file. In this program, we are able to export sets of Diffractometer Settings, Fitting Settings, and Fitting Parameters. The file format is JSON and is human and machine readable. This is useful if you want to have a set of settings for your own diffractometer and need to mix and match fitting parameters with another setting. You are able to both import from and export to JSON files and from existing CARBON.INP configuration files.
Click the folder icon to open an XRD pattern or access this option from the File-Open XRD Pattern menu option.
The XRD pattern may be a text file in a two column format separated by spaces, tabs, or commas. An arbitrary number of header lines is supported. The first column is the 2θ values in degrees and the second column is intensity. The user is prompted to select the number of header lines in their file and select the separator for their data. If the incorrect settings are applied, the following message will be emitted at the console:The following data formats from x-ray diffractometers are also supported:
After loading a pattern, the graph will be cleared, and the newly loaded data will be plotted. For how to use the graph toolbar, this is covered in Matplotlib's Toolbar Documentation.
Because of limitations hard coded into the CarbonXS program, fitting cannot be performed on datasets larger than 3000 points. If a dataset has greater than this limit, the program gives the user the option to cull the number of data points by taking the smallest n-th interval. If the user elects not to cull the data, the fit will be performed on the first 3000 data points.
All of these options are available under the fitting menu. Only one fitting and calculation process may run at a time. To perform a fit, a pattern must have been loaded. If a user attempts to begin a fit without a loaded pattern, they will be prompted to load a pattern. Pattern calculation without fitting may be performed without a loaded pattern. When a fit is started, sanity checks on the values and settings are performed and the fit will only proceed when all are satisfied. Fix any erors that appear in the console if sanity checks fail.
After the fit or calculation has been successfully completed, a plot of the calculated pattern, the background curve, and the original data is displayed. Pressing the Last Fit Difference button under the graph causes the most recent fit's difference trace to be plotted. Pressing the Pattern + Last Fit button causes the currently loaded pattern and the most recently fit or calculated pattern to be displayed. The options Lock Pattern/Fit Y-Axis and Lock Pattern/Fit X-Axis are used to lock the Y and X axes respectively. The Show Previous Fit button will show the previous fit or calculation as a dashed line on the fit plot.
After a fit is completed, the user may also export the results. The carbon.out (Information about fitting process including covariance matrix), the carbon.dat (angle, original data, and fit pattern) are copied to a user-selected destination. The user may also export a Jade .mdi file to performed a combined fit using Jade and CarbonXS together.
A Singular Matrix error is encountered when parameters result in a singular matrix that the program cannot solve. It may be possible to identify the parameter that is responsible and adjust its value or disable it. An SM, Width of the M Distribution parameter that is zero is known to cause this. If the user does not abort the calculation, CarbonXS freezes and the process will have to be killed manually by the abort option.
A Crash in CarbonXS error is encountered when an internal error in CarbonXS causes it to quit prematurely. Scenarios include floating point over and underflow errors. This is detected by the GUI program by CarbonXS emitting exit code 1.
Command | Windows | OSX | Linux |
---|---|---|---|
Open Documentation | F1 | ⌘ + ? | F1 |
Open Diffraction Pattern File | Ctrl + O | ⌘ + O | Ctrl + O |
Calculate Pattern | Ctrl + R | ⌘ + R | Ctrl + R |
Perform Fit | Ctrl + Shift + R | ⌘ + Shift + R | Ctrl + Shift + R |
Abort Running Fit | Ctrl + D | ⌘ + D | Ctrl + D |
Previous Fit/Calculation | Alt + 🡄 | ⌘ + [ | Alt + 🡄 |
Next Fit/Calculation | Alt + 🡆 | ⌘ + ] | Alt + 🡆 |