Tutorial Multitopas
Sequential Rietveld Refinement of Multiple Data Sets – Either v6 or Command File Methods
Files needed: single zip file with data and input files
Learning Outcomes: How to quickly run through multiple refinements using either the #list format of topas v6 or command line .bat files with v4 or v5.
This tutorial shows how one input file can be used to fit multiple data sets using either the #list language of v6 or the older command file approach used in v4 and v5. You’ll see how easy things are in v6. The example is a 2 phase mixture of Al2O3 and Si recorded at different temperatures on the I11 beamline at Diamond. The mixture is used to calibrate the temperature of the hot air blower. If you want to compare the cells you extract with values from the literature you can use the parameterisations for Al2O3 and Si in Stinton/Evans J. Appl. Cryst. (2007).
Note the difference between this “sequential” approach and the “parametric” approach of other tutorials.
Data were recorded at 30 different temperatures and saved as .xye files. A list of the dataset names and temperatures is included in the linp file.
Sequential Refinements – v6 #list format
0. Mistake! Make sure line 52 on the .inp file says “macro filename { File_Name(Run_Number) }”
1. Save zip file into your directory.
2. Open the file al2o3_si_vt_01.inp and make sure the line “#define topas_old_version” is commented out so you default to v6 commands..
3. Have a look at the lines within the “#ifdef !topas_old_version” which are used if you haven’t explicitly told topas you’re using v4 or v5 (the ! means the flag is not defined). You’ll see that Topas is set up to run through 30 files and each has a temperature defined. More information on the format is on the wiki.
4. Look at the end of the file where it says “#ifdef write_out”. You’ll see that a few key parameters are written to “results.txt” for plotting.
5. Save the file and send to Topas. When you click “run” in Topas all patterns will be refined. You ought to get ~14.6% for the first data set.
6. Use the 3D viewing options to inspect the fits. Note that in planview the thermal expansion “looks strange”. This is because the data were not recorded with uniform temperature steps.
7. See the instructions below on how to view the results.
Sequential Refinements – v4 and v5 command file format
Sequential refinements are slightly more involved with the older versions of topas (v5 and earlier). The easiest method is to create a command file (.bat file) to run tc.exe from the command line and feed topas information about the filenames to be analysed and any other experimental information. There’s more background to this on the topas wiki.
1. Open the file al2o3_si_vt_01.inp. Save it as seed.inp.
2. Make sure the line “#define topas_old_version” line is included in the file.
3. Look at the section of seed.inp where it says “#ifdef topas_old_version”. When running topas in gui mode you’ll see that the filename and temperature are defined from the input file. When running in batch mode this information will come from the .bat file. This language is really useful as you can use the same input file to check the refinement in gui mode then run tc.exe in batch mode.
4. Save the file and send to Topas. You should get Rwp=14.62%.
5. Open the file called “run_multitopas.bat”. You’ll see a series of commands that run tc.exe using each experimental data set and then copies the output of one refinement to the input of the next. Edit this file so that the directory name is the one you’re working in. Save run_multitopas.bat to your main topas directory (c:\topas4.2 or similar).
6. Go to the main topas directory and click on “run_multitopas.bat”. You should get a command window pop up and see the Rwp values of each refinement scroll past on the screen.
7. If this doesn’t happen you probably have the directory name incorrect in your .bat file. Open a command window in the topas directory and copy/paste each of the lines in the command file sequentially. This should show you where the problem is.
8. There are various ways of creating a file like run_multitopas.bat. If you double click on the program “multitopas_files.exe” provided with this example you’ll get asked a series of questions which will produce the file. For the “list of filenames” edit “files.list” and change the directory to your working directory. When asked if there is any other information to tell topas say yes and specify the file “information.val”. This contains the temperature of each data set. Alternatively it’s easy to produce command sequences like this in excel (by dragging down columns) or python.
Plotting Data
It’s so quick to perform multiple data analyses using Topas that it often takes longer to visualise/plot results than to do the Rietveld refinements. I tend to use wgnuplot as a very quick way of automatically looking at the resutls. It’s far quicker than excel to produce “rough” plots. With a little formating work it will also produce publication quality plots.
1. After performing either #list or command file sequential refinements save the file “results.txt” as “results_good.txt”.
2. You could add the following column headings as the first line:
Filename T Rwp a_al2o3 esd c_al2o3 esd vol_al2o3 esd a_si esd vol_si esd scale_al2o3 esd scale_si esd bval_al2o3 esd bval_si esd T
3. Depending on your gnuplot set up either click on the file “plot_results.gnu” or open gnuplot and type “load plot_results.gnu” at the command prompt. You should see plots of important parameters appear one by one. They will also be saved as .gif files in your directory.
4. If you’re interested, open “plot_results.gnu” to see how it works.
Temperature Calibration
If you look at the cell parameters vs T you’ll see that their slopes flatten off at high temperature. This is because the hot air blower fails is failing to heat the sample to the set temperature. You can calibrate the temperature from the known thermal expansion of Al2O3 and Si. Some ways of doing this are in the paper by Stinton and Evans cited above. You can also use the slightly simpler approach outlined in the excel spreadsheet.