GudrunX
- 1 Introduction
- 2 Obtaining and preparing your PDF data files
- 3 Starting and configuring GudrunX
- 3.1 Instrument tab
- 3.2 Beam tab
- 3.3 Normalisation tab
- 3.4 Sample Background tab
- 3.5 Sample tab
- 4 Running Gudrun
- 5 Plotting results
- 6 Improving the PDF
- 7 Example input file
- 8 GundrunX glossary of terms
- 9 Accurate sample background factors
- 10 Fluorescence corrections
Introduction
Gudrun is a software package used to reduce total scattering data into the differential scattering cross-section, and then convert this into the pair distribution function (PDF). While this package can be used to convert both neutron (GudrunN) and X-ray (GudrunX) data, this guide will concentrate on the reduction of synchrotron X-ray data only.
Before the data is converted into a PDF, GudrunX can remove instrument and sample backgrounds; it can also perform corrections for X-ray polarisation, attenuation, multiple scattering, single-atom scattering (including Compton scatter), and sample fluorescence. Finally, through an iterative loop, it can normalise the data to an absolute scale (Krogh-Moe and Norman method).
The purpose of this guide is to provide background on the processes used by GudrunX and step-by-step instructions on how to convert the data taken on I15-1 into a PDF. Additional information or help on using GudrunX can be obtained from your local contact. Furthermore, the Gudrun manual and other relevant information can be found here:
https://www.isis.stfc.ac.uk/Pages/Gudrun.aspx
Information on downloading GudrunX can be found here:
Obtaining and preparing your PDF data files
Take total scattering measurement of empty sample container(s).
Take total scattering measurement of container + sample.
Dawn will automatically calibrate data and reduce it into a .xy or .xye column format.
In order to process the .xye files in GudrunX, you will need to copy them to a folder where you (the user) has write access. To copy these files on a Windows PC:
Navigate to \\i15-1-storage\i15-1\data\20XX\YYYYYYY-Y . (You can map this as a network drive.)
Where 20XX specifies the year, and YYYYYYY-Y is your experiment number and session
There will be one subfolder called “processed” and one called "processing" in this location.
Inside the "processed" folder will be a subfolder called "tth_pe2", the .xye files are saved to this location.
Copy the .xywe files to the "processing" folder, you may also want to create sub-folders for organisation.
N.B. While you can copy and analyse the .xy file during a scan, remember to also copy it after the scan has finished.
Starting and configuring GudrunX
To open GudrunX interface, click on the GudrunX.bat file, or its shortcut. This will open a command-line window and its GUI. The purpose of the GUI is to update the text file shown on its right-hand side. When you run GudrunX, this text file is run in the command line window.
The GUI should have (initially) 5 tabs on the left of the window; Instrument, Beam, Normalisation, Sample Background, and Sample. If there are any missing tabs, you can populate them by accessing the edit menu (top left) and then click "insert sample background" and/or "insert sample".
The next step is to save your input file. Go to the File menu (top left of Gudrun GUI) and click save as. Save the .txt file into the same directory as the .xy files that you wish to process. After this is complete, the bar at the top should update itself:
Instrument tab
The “Instrument” tab on the left hand side is as follows (figure 2).
The instructions corresponding to each red circled input box are as follows:
This should be automatically updated once you have saved the input file (see step two in "Starting and configuring Gudrun" above). Otherwise, enter the path to the folder where the gudrun .txt file is saved. Also, this will be the location where the Gudrun output files are saved.
This is the folder where the processed experimental data is saved. This can be the same directory as where the input file is saved (point #1). You can copy and paste the directory from box 1 into this box. Ensure that the data file type box (to the right) is set to xy or xye.
This provides three boxes to fill, Qmin, Qmax and Qstep. Most experiments are run at 76.69 keV with the Q values as shown in Figure 2. Alternative lower/upper limits are given in table 1; however, you may need to reduce the Qmax value (see section "Improving PDF").
The maximum and step in r values for the output PDF.
Do not change any of the additional fields.
Photon energy (keV) | Wavelength (Å) | Qmin * (Å-1) | Qmax ** (Å-1) | Qstep |
|---|---|---|---|---|
40.05 | 0.309574 | 0.3 | 20 | 0.02 |
65.40 | 0.189578 | 0.4 | 33 | 0.02 |
76.69 | 0.161669 | 0.5 | 38 | 0.02 |
Table 1: Calculated limits for Qmin, Qmax, and Qstep.
*QMin were calculated with a 2 angle of 0.369°.
**Qmax was calculated with a maximum 2 angle of 60°. For QStep start with 0.02, it can be changed if needed (speak to local contact).
Beam tab
The “Beam” tab (figure 3) describes the configuration of the X-ray beam.
This field defines the wavelength of the X-rays (see 2nd column in Table 1).
Unless advised by your local contact, do not change any other values; use the ones shown in Figure 3.
Normalisation tab
The purpose of this tab is to specify what type of normalisation is to be performed, and how the data are to be calibrated to put the scattering cross-section on an absolute scale.
The Breit-Dirac factor should be a number between 2 and 3. It has a limited impact on the resultant S(Q), so leave as 2 unless you have a good
reason for altering it.The method of normalisation can be changed, but the Krogh-Moe/Norman method is recommended.
Unless advised by your local contact, do not change any other valves on this tab.
Sample Background tab
The “Sample background” tab (figure 5) is used to describe the scattering from the empty sample container. This data can be then subtracted from the standard experimental data.
N.B. If no sample background tab is visible, one (or more) can be added by accessing the edit menu (top left) and selecting insert sample background. Do not confuse this with the container tab.
Use the add button to include the .xy file of the empty sample container.
The sample background factor multiplies the sample background file, the default value is 1. The purpose of this factor is to account for background data and sample data being taken with different beam attenuations. For example, if the data for an empty vial was taken with no attenuation, but the data from the sample was measured with 50% attenuation, one would correct for this by entering a sample background factor of ~0.5.
It should be noted that if one is processing several samples, multiple (and corresponding) sample background data files can be added. This is done with the “Add” button.
Sample tab
The "Sample" tab (figure 6) is used to include information on the sample, its background and the Fourier transform to the PDF.
N.B. If no sample tab is visible, one (or more) can be added by accessing the edit menu (top left) and selecting insert sample, or with the short cut: Ctrl+A
Use the add button to include the .xy file of experimental data. Again like the sample background, it is possible to add multiple files here.
Since multiple samples can be analysed from the same input parameters, this tick box shows which sample data sets are being analysed. Therefore highlight the file(s) you wish to analyse and ensure this checkbox is ticked.
Enter the atomic/elemental composition of your material here. The abundance corresponds to the ratio between the different elements. For example, if measuring water, the abundance would be H=2, O=1. The last two columns should be left as zero.
Enter the size of the sample here. Note that Gudrun uses units of cm and that this is a radius, not diameter. FYI, capillary dimensions can be found here.
Enter the density of the sample here. Note you can select grams cm-3 or atoms Å-3.
The tweak factor is the inverse of the packing fraction. This corresponds to the packing fraction of a powder sample. For example, a packing fraction of 50% equals a tweak factor of 2. For context, a liquid will exhibit perfect packing (tweak = 1); optimum spherical packing has a packing
fraction of 74% (tweak = 1.35); random spherical packing packs to 64% (tweak = 1.56); and experience shows that most samples pack with packing closer to, or worse than, 50% (tweak = 2). It is possible to measure the packing fraction if you know the density, but often this is only
necessary if your sample is very absorbing.This button opens a window, where one can make additional corrections to the background due to X-ray fluorescence. When measurements are taken away from the fluorescence edges, it is not necessary to use this window. However, if it’s needed, more information can be found here.
Polarisation of X-rays; this usually varies between -1 and +1, where -1 corresponds to 100% vertically, 0 to unpolarised and +1 to 100% horizontally polarised X-rays. Values can go outside of this range, but this usually only happens when considering fluorescence.
Compton scattering factor, see section "Plotting results" for more details.
Top hat width (QT) for cleaning the FT. If this value is set to 0, no background is subtracted and no Fourier transform is performed. A good rule of thumb is for QT>3/rmin.
Minimum radius for FT (rmin), below this value the scattering should be from one individual atom (“self scattering"), as opposed to scattering between pairs of atoms (“distant scattering”). For PDF the distant scattering is of interest, therefore the self-scattering is suppressed. For example, if the smallest bond length is 1.4 Å, make sure that this value is ~1.2 Å or less.
Width of broadening for PDF pattern, useful for reducing noise.
Additional sample tabs can be added by opening the edit menu (top left) and selecting insert sample, or with "Ctrl+A". It is possible to include up to three additional sample containers. This is to allow for the possibility of multiple containments, such as heating elements, radiation shields, and vacuum windows. In order to add these extra tabs, select the edit menu in the top right corner, and then highlight “insert CONTAINER”. This will highlight a menu where one can choose some standard capillaries or define a new container (“other”). The new container tab is populated in the same way as the middle section of the sample tab. N.B. if you are using a single capillary, do not use the container tab, instead use the sample background tab.
N.B. If you are analysing multiple sets of experimental data that were taken with different attenuation levels, several sample background tabs can be added. The sample tabs will use the closest preceding sample background tab.
Running Gudrun
Once the fields in the GUI have been populated, you can save the configuration with ctrl+S. A check to ensure that the relevant files exist can be
made with Ctrl+E.Gudrun can then be run with ctrl+G. NB. Ctrl+D can delete the sample tab, if this happens you will need to reload the Gudrun file.
The progress of the program can be viewed in the command line window. The programme will have finished when “ExitValue: 0” is printed in the
window.
Plotting results
After running Gudrun, the next step is to plot several different output files from the program. The purpose of this is to ensure the following:
The background arising from single-atom scattering (both coherent and incoherent) is correctly modeled and can, therefore, be subtracted from the experimental data to produce an accurate S(Q).
The accuracy of this background correction can be checked further by plotting the S(Q), with and without the top-hat correction.
Finally, the PDF can be plotted and interrogated.
To plot the results from GudrunX, open the GNUplot window (figure 7) by selecting "Generate GNUplot plotting file" from the "plot" drop-down menu in the main Gudrun GUI.
Checking the single atom scattering background
The first step is to plot the differential scattering cross-section and its corresponding single atom scattering (both coherent and incoherent ). The purpose of this is to ensure that the single-atom scattering is correctly scaled to the differential scattering cross-section, so it can be removed from
the data to produce a well-corrected S(Q).
In the GNUplot data window; using the “Add file” button, select your processed scan’s *.subcan file. NB. Make sure you have the “det2” file selected.
Add an additional trace to the plot by clicking the “Add file” button again.
Under the “Group No.” heading, change the value of the second line from 1 to 3. The first line will plot the experimental data, while the second line will plot the calculated single atom scattering (both the coherent form-factor and the incoherent Compton scattering).
Select the legend tick box.
The figure is then plotted with the “plot” button
Note that the axis labels are set in this window, so the labels in the figures are only correct if you correctly edit the labels here.
An example of the plot is shown in figure 8. In this figure, the red trace shows the estimated differential scattering cross-section, as converted from the experimental data. The blue trace is the calculated single atom scattering function (both coherent and incoherent).
In order to extract the correct S(Q), we must correctly account for and remove the signal from the scattering that does not come from the sample's structure (distinct scattering). This can be coherent single-atom (self) scattering or incoherent Compton scattering. Fluorescence might also add to this background, see here for more information.
For multiple scattering, the value is set in the “Sample” tab (usually as 1) and is not changed.
To account for Compton scattering, the single-atom scattering function can be modified. In order to do this, one can change some of the input parameters in the sample tab(s). Specifically, the Compton scattering factor will change the single atom scattering function in the high 2-theta
region, i.e., increasing the Compton scattering factor will increase the single atom scattering background at high 2-theta.For the low 2-theta region, adjustments to the estimated differential scattering cross-section can be made by changing the polarisation factor (figure 6, #8). i.e. reducing the polarisation factor will increase the experimental data’s signal.
The calculations can be saved and revised by re-running GudrunX with the ctrl+S and then ctrl+G commands. The plot can then be updated using the refresh button on the Gnuplot window (#1).
The purpose of the single-atom scattering function is to calculate the scattering from your material as if it was completely disordered. The experimental data will diverge from this function, showing features (peaks) that result from the order in the material (this does not have to be long range order). Therefore well-corrected data will be evenly distributed about the single atom scattering function. i.e. it should oscillate about the single atom scattering function and match at high 2
A general method to correct the data is to start with a polarisation of -0.7 and a Compton factor of 1. Then change the polarisation factor, but keep the Compton at 1. You cannot find a good solution by only changing the polarisation, get find the closest solution, then change the Compton
factor. Normally, the polarisation should be between ±1, and the Compton between 1 and 2.If the measurements are taken with photon energies close to an absorption edge of your sample, you may need to make additional corrections due to a strong fluorescence signal. More information on these procedures can be found here.
Checking the background corrections by comparing the S(Q) with/without top hat convolution
corrections.
The next step is to convert the experimental data into the S(Q), this is done by removing the single atom scattering from the estimated differential scattering cross-section (*.subcan group 1), and dividing by the atomic form factor.
Even with the removal of the single-atom scattering function, a slowly varying Q-dependent background may still contaminate the S(Q). In order
to remove this, the data is convoluted with a top-hat function (figure 6, #10).While this top hat convolution method is a powerful tool, it's no substitute for properly corrected data. To ensure this, an additional step can be
used to check the S(Q) before and after the top-hat post-processing.In order to do this:
Select and plot the *.soq and *.int01 files using the GNUplot (for example see figure 9). *.soq is the S(Q) before the top hat convolution, while *.int01 is the S(Q) after the top hat convolution.
A well-corrected diffraction pattern should have the two plots overlap, especially at high Q. If this is not the case, then adjust Compton and polarisation factors and replot.
If you cannot get the two plots to overlap at high Q, you may need to cut this data from the S(Q). This can be done by reducing the QMax parameter (figure 2, #3).
A further check is that the *.soq oscillates around zero.
Plotting the PDF.
The pdf can then be plotted by running GudrunX and selecting either *.gofr and/or *.dofr. More specifically:
*.gofr is the G(r) pdf formalism, it starts at -1 and ends at 0. Furthermore, it emphasises the low-R region and suppresses the high-R region. Good for determining the effects of truncation.
*.dofr is the D(r) pdf formalisation, it starts at 0, ends at 0 and has a sloping background. Furthermore, it suppresses the low-R region and emphasises the high-R region. Good for determining the total quality of the scattering.
More information on the different PDF formalisations can he found in Keen et al. J. Appl. Cryst. (2001) 34, 172-177.
Notice the nose in the pdf data at low R (red box), this occurs below the minimum radius of the F.T. (in this case 1.2Å) and is therefore not real data.
Improving the PDF
Negative values in your total scattering data. The signal from the sample background is too strong and needs to be reduced; if you used different attenuations in the sample and background data collections, check that you have accounted for this with the sample background factor (figure 5,
#2).If there is a high-frequency oscillation in your PDF, this probably caused by noise in S(Q) at high Q. To correct for this:
Reduce the QMax value, #3 from figure 2. Note this will reduce the resolution in r-space.
And/or increase the broadening to increase the broadening in r-space, #12 figure 6. Note this will reduce the resolution in r-space.
Unexpected PDF peak at ~1.6Å when using quartz capillary. This peak is the Si-O bond from the capillary, try to reduce the sample background factor in the “Sample Background tab”.
A discontinuity at RMin, try to change the density of the sample, #5 in figure 6.
Peaks missing from PDF at low R, this is because RMin is too large. Reduce the value of RMin, it should be less than the smallest bond distance.
Extra peak and dip at RMin value in PDF, top hat width x RMin needs to be greater than 3.
Oscillations in the PDF data below the RMin value (for example see figure 10). This is likely due to high-frequency noise in the data that has not been removed.
The gradient at low-R in D(r) does not match at RMin…
Example input file
You can find example data and a Gudrun .txt file here.
GundrunX glossary of terms
Breit-Dirac factor
A relativistic correction factor applied to the Compton scattering calculations.
Krogh-Moe/Norman method normalisation method.
An approximation used to convert the (unknown) distinct scattering term of the scattering cross-section to a calculable value.
This allows GudrunX to convert the raw X-ray counts onto an absolute scale need for the scattering cross-section. For more information see here.
Single-atom scattering.
Sometimes referred to as self scattering. This is the scattering of X-ray photons from a single isolated atom, rather than diffraction from planes of atoms. It includes both coherent terms, such as elastic scattering from a single atom, and incoherent terms, such as Compton scattering.
It results in a Q dependent background that needs to be removed from the experimental diffraction data, prior to the conversation to S(Q) and the Fourier transform.
The coherent single-atom scattering cross-sections of specific elements are listed in tables, (see http://www.esrf.fr/computing/scientific/dabax). GudrunX extracts the correct values for a particular element and X-ray energy by interpolation.
The Compton scattering cross sections are calculated by GudrunX from a table of Compton coefficients.
Top hat convolution
Because the data analysis to remove the single atom scattering and fluorescence is not perfect, the S(Q) might still contain a slowly varying Q-dependent background. This background needs to be removed prior to the Fourier transform, otherwise, it will cause truncation oscillations in the PDF.
To remove the background, it is modelled by convoluting the data with the top hat function. Afterwards, the Fourier transform of the difference between the data and the top hat convoluted data is made. For more information, here or see section 3.10.3 of the Gudrun user manual.
Accurate sample background factors
For example, if the f2 filter was set to a nominal 10% transmission, enter 10.27993... into Gudrun.
NB. these valves are only accurate for 76.69 keV X-rays.
Measurements were taken in Jan 2020 with 76.69 keV X-rays.
|
|
|
100 | 100 | 100 |
50 | 50 | 49.4870299977736 |
10 | 10 | 10.279934407504 |
1 | 1 | 0.978546051420511 |
0.1 | 0.1 | 0.074122004870406 |
0.01 | 0.01 | 0.015861457175069 |
0.001 | 0.001 | 0.003021994510913 |
Fluorescence corrections
The purpose of these corrections is to adjust the calculated background so that it follows the same procedures described in the section "Plotting results".
Below are several methods of how to make the corrections due to a strong fluorescence signal. Before trying these corrections, speak to your local contact regarding the best way to proceed.
Calculate or measure the fluorescence independently and use it to modify your data.
Subtract a constant value from your data before it is processed by GudrunX.
Specify the fluorescence levels in GudrunX (see section “Adding fluorescence levels" below). It is best to enter only one fluorescence edge.
Use the polarisation and Compton factors to correct for the background as described here. For the case of a strong fluorescence background, one can try values for these factors that are outside of the usual range. I.e. the polarisation factor can be less than -1. In addition, one may also try changing the density of the material.
Adding fluorescence levels
The “specify fluorescence levels” button in the "Sample" tab (figure 6) opens this window below:
Enter the chemical symbol of the fluorescing element here.
Enter the fluorescence edge energy here. The tables of the different edges can be found here.
Enter the relative fluorescence level here. If there is only one edge in the calculations, this is always one.
The overall fluorescence level should be between 0.1 and 10. Again one can alter this value to give better results.
When using this window, always have this box ticked.
To determine whether you have entered suitable values, use the same analysis method as described here.