Skip to main content

tutorial vscode_riet_pawley

Rietveld and Pawley Refinements using VS Code

Files needed: d5_05005.rawrutile.cif

Learning Outcomes: This example goes through the mechanics of Rietveld or Pawley refinements in VS Code using the TiO2 example. The process is similar to using jEdit but the menu layout is slightly different.

Rietveld Refinement from Scratch

1. Save the raw datafile and cif file in your working directory.

2. Work through the menus in the “Rietveld or Pawley INP file” section of the VS Code “TOPAS_Durham menus”. You can see these by clicking on the “triangle in circle” icon on the left panel of VS Code. Go to the setup instructions for more details.

3. Click on “Select Data File” and navigate to find the file d5_05005.raw then select it.

4. In Instrument/Corrections select “BB_CuKa2_grapite_scint Durham d5000” – the diffractometer used to collect the data.

5. In the “Corrections” folder click on “Refine zero point” to flag that zero should be refined.

6. In the “Rietveld or Pawley” folder click on the icon to “Structure from CIF” and select rutile.cif.

7. Click the green “Send INP to TOPAS” icon to send the input file across to topas (see examples tutorial). The INP file file will be saved with a default filename of d5_05005_fit_01.inp and a .backup file made.

8. Click the green rocket icon to launch TOPAS Academic if it’s not already running.

9. Switch to TOPAS and click on the “run” icon.

10. The refinement should converge rapidly to Rwp ~ 14.6%.

11. If you return to VS Code, the converged model will be reloaded in the INP file. If you click on “run TC on INP” the same refinement can be run in the VS Code terminal window using tc.exe.

12. Try refining temperature factors (e.g. type “beq @ 1” at the end of each “site” line containing atomic information. Try refining cell parameters by introducing parameter names. i.e. change the cell parameter lines to read:

a lpa 4.594
b lpa 4.594
c lpc 2.959

13. There’s one free fractional coordinate in this structure – the x parameter of O. Try refining this by changing the oxygen line to read:

site O1 x xo1 0.30600 y xo1 0.30600 z 0.00000 occ O 1.00000 beq @ -0.0896`

Here both x and y coordinates are given the same parameter name which forces them to be identical. Alternatively you could change the O line to read as below. Here the y coordinate is determined by a simple topas equation. The “:0” after the equation is optional – it gets topas to write the outcome of the equation in the input file for you to check. You should get a Rwp of ~ 14 %. RBragg will be around 3.8 %

site O1 x xo1 0.30600 y =Get(x);:0.0 z 0.00000 occ O 1.00000 beq @ -0.0896`

14. You might like to try the influence of different peak shapes, different numbers of background terms, refining a sample height correction instead of a zero point, etc. Try changing the parameter axial to values of 0 then 20 and fixing it (change parameter name to !axial) to see the influence of axial divergence on peak shape.

15. Are you in a true minimum? Try adding the lines below to the “General Information about refinement” section of the file to randomise the structure according to esd’s on parameters:

randomize_on_errors
continue_after_convergence
Pawley Refinement from Scratch

1. Performing a structure-free Pawley refinement is very similar to a Rietveld refinement. Follow steps 1 to 5 above. If you have already done the Rietveld tutorial you will be asked if you want to overwrite the existing INP file or create a new name. Choose to save your file as d5_05005_pawley_01.inp.

2. In the “Rietveld or Pawley” folder select “Pawley phase”. A VS Code box will prompt you to enter the space group and cell parameters. Enter “P42/mnm 4.59 4.59 2.96 90 90 90”. Be careful not to leave the VS Code window until you have entered these values. If you fail to do this, click the menu again, but then remove any duplicate lines from your INP file.

3. Click “Send INP to TOPAS”. If it’s not already open then click “Launch TOPAS Academic”. Switch to TOPAS and press the red “fun” button. You should get an Rwp of 22.8%.

4. Set the cell parameters to refine (see section 12 above). As TOPAS knows which INP file you’re using you can just save (ctrl-s) and switch to TOPAS. You should then get Rwp = 14.7 % or lower. Try refining all the peak shape parameters except pkz (which correlates with other peak shape arameters). You should get Rwp 13.4 %.

Rietveld or Pawley Refinements from a Template

1. Download the datafiles to your directory if you haven’t done the tutorials above.

2. Navigate to the “TOPAS_Durham/Prewritten templates” folder and click on “Select template file”. This will show you the templates available in the templates folder of your main TOPAS directory. If no files appear you can download templates from the “Download templates from web” menu. Select the “xray_rietveld_template.inp” option. Save the file in your working folder with a suitable filename (e.g. d5_05005_template.inp).

3. Work your way through the INP file and replace any text highlighted in pink after an arrow “->” with appropriate information for the TiO2 example. To save typing you can use the “Structure from CIF for Template” option to create the structural information.

4. Click on “Send INP to TOPAS”, then run the refinement in TOPAS.