Skip to content

Commit

Permalink
fix formating
Browse files Browse the repository at this point in the history
  • Loading branch information
cadenmyers13 committed Aug 8, 2024
1 parent 25ea60d commit 354be1c
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions doc/TUTORIAL.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
===============================================================================
= Welcome to the PDFgui tutorial =
Welcome to the PDFgui tutorial
===============================================================================

The latest version of this document is available online at

`http://danse.us/trac/diffraction/browser/diffraction/diffpy/diffpy/pdfgui/doc`_
`http://danse.us/trac/diffraction/browser/diffraction/diffpy/diffpy/pdfgui/doc`

Please, have your co-workers or students try it out and let us know if you
have any comments. We want to make it really easy for the new users to get
Expand All @@ -25,26 +25,26 @@ Procedure:
1. Open a terminal and type ``pdfgui`` to start the program.

2. Create a new Fit:
(a) Select "FITTING" in the left-most vertical tab.
(b) Click right mouse button in the left panel and choose "New Fit" in the pop-up menu.
- Select "FITTING" in the left-most vertical tab.
- Click right mouse button in the left panel and choose "New Fit" in the pop-up menu.

3. Load structure model:
(a) Place the cursor of the mouse onto the title of the Fit, click the right button and choose "Insert Phase" in the pop-up menu.
(b) Click the "Open" button and load the `Ni.stru` file.
- Place the cursor of the mouse onto the title of the Fit, click the right button and choose "Insert Phase" in the pop-up menu.
- Click the "Open" button and load the `Ni.stru` file.

The right panel has 3 tabs for the initial configuration, constraints panel for expressing structure properties as functions of tunable parameters, and Results panel for refined structure.

4. Load experimental PDF data:
(a) Select the title of "Fit 1", click the right button and choose "Insert Data Set" in the pop-up menu.
(b) Load the `Ni-xray.gr` file.
- Select the title of "Fit 1", click the right button and choose "Insert Data Set" in the pop-up menu.
- Load the `Ni-xray.gr` file.

Again, the right panel shows 3 tabs for properties of this dataset.

5. Define what is refined:
(a) Click on the `Ni-xray.gr` data and select the "Constraints" tab.
(b) Type ``@1`` into "Scale Factor" edit box.
(c) Select the `Ni.stru` phase and its "Constraints" tab.
(d) Fill "a", "b", "c" boxes with ``@5``.
- Click on the `Ni-xray.gr` data and select the "Constraints" tab.
- Type ``@1`` into "Scale Factor" edit box.
- Select the `Ni.stru` phase and its "Constraints" tab.
- Fill "a", "b", "c" boxes with ``@5``.

A refined variable can be expressed as a math expression:
``f(@n1, @n2, @n3, ...)`` where
Expand All @@ -54,15 +54,15 @@ Procedure:
cell lengths a, b, c are all expressed as ``@5``, the refined structure will remain cubic.

6. Start the refinement:
(a) Select "Fit 1" in the left panel. The parameters panel shows a list of used parameters and their initial values.
(b) Click the "gear" icon on the toolbar and watch the fit progress in the terminal window.
- Select "Fit 1" in the left panel. The parameters panel shows a list of used parameters and their initial values.
- Click the "gear" icon on the toolbar and watch the fit progress in the terminal window.

7. Plot the results:
(a) Select "PLOTTING" in the left-most vertical tab.
(b) Select the `Ni-xray.gr` dataset.
(c) Select "r" as the X plotting variable.
(d) Hold down shift and select "Gcalc" and "Gtrunc" as the Y plotting variables.
(e) Click "Plot" button.
- Select "PLOTTING" in the left-most vertical tab.
- Select the `Ni-xray.gr` dataset.
- Select "r" as the X plotting variable.
- Hold down shift and select "Gcalc" and "Gtrunc" as the Y plotting variables.
- Click "Plot" button.

A new window pops up with plots. You can try out the buttons in the toolbar below.

Expand All @@ -76,26 +76,26 @@ Lesson 2: Build structure model using crystal symmetry
In the previous example the initial structure was defined by an existing file. However, PDFgui makes it very easy to build a structure model from scratch and constrain it with arbitrary crystal symmetry.

1. Create a blank structure:
(a) Click the FITTING tab.
(b) Repeat steps 1-3a from Lesson 1, but choose the "New" button. Rename "New Phase" to "Ni fcc".
- Click the FITTING tab.
- Repeat steps 1-3a from Lesson 1, but choose the "New" button. Rename "New Phase" to "Ni fcc".

2. Define asymmetric unit:
(a) Right click the header of the empty atoms grid in the "Configure" page.
(b) Insert 1 atom using the popup menu.
(c) Change the elem cell to "Ni".
(d) Select the u11-u33 cells and type "0.004" and press Enter.
- Right click the header of the empty atoms grid in the "Configure" page.
- Insert 1 atom using the popup menu.
- Change the elem cell to "Ni".
- Select the u11-u33 cells and type "0.004" and press Enter.

3. Expand to all equivalent positions:
(a) Right click the first Ni atom and select "Expand space group". A "Space Group Expansion" dialog should open.
(b) In the dialog, select Fm-3m or just type 225 in the "Space Group" box and hit "OK".
- Right click the first Ni atom and select "Expand space group". A "Space Group Expansion" dialog should open.
- In the dialog, select Fm-3m or just type 225 in the "Space Group" box and hit "OK".

You should now have four atoms in the atoms grid.

4. Generate symmetry constraints:
(a) Select the "Constraints" tab.
(b) Select all atoms. This can be done by dragging the mouse over the atom names or by clicking on the "elem" header.
(c) Right click in a selected cell and select "Symmetry constraints." A "Space Group Constraints" dialog should open.
(d) "Fm-3m" should already appear in the "Space Group" box. If it does not, select it as you did in step 3 and hit "OK".
- Select the "Constraints" tab.
- Select all atoms. This can be done by dragging the mouse over the atom names or by clicking on the "elem" header.
- Right click in a selected cell and select "Symmetry constraints." A "Space Group Constraints" dialog should open.
- "Fm-3m" should already appear in the "Space Group" box. If it does not, select it as you did in step 3 and hit "OK".

The u11-u33 cells should all read the same value. The "x", "y" and "z" cells should be all empty because Ni atoms are at special positions in Fm-3m. You may try to select lower-symmetry space and check what happens with the constraints. The space group constraints may be mixed by selecting different groups of atoms, for example, when only certain species show lowered symmetry.

Expand All @@ -111,38 +111,38 @@ Learn how to string together fits.
1. Create a fit as in Lesson 1.

2. Copy the fit:
(a) Right click on the fit name "Fit 1" in the right panel (the fit tree).
(b) Select "Copy" from the pop-up menu.
- Right click on the fit name "Fit 1" in the right panel (the fit tree).
- Select "Copy" from the pop-up menu.

3. Paste the fit:
(a) Right click in the empty space between the first fit in the fit tree.
(b) Select "Paste Fit." This will create "Fit 1_copy", a copy of "Fit 1" in the fit tree.
- Right click in the empty space between the first fit in the fit tree.
- Select "Paste Fit." This will create "Fit 1_copy", a copy of "Fit 1" in the fit tree.

4. Link the fits:
(a) Click on "Fit 1_copy" in the fit tree.
(b) In the "Parameters" panel, select the entire "Initial" column.
(c) Type ``=Fit 1`` and then press Enter. The "Initial" values of the parameters should now read ``=Fit1:n``, where "n" is the index of the parameter.
- Click on "Fit 1_copy" in the fit tree.
- In the "Parameters" panel, select the entire "Initial" column.
- Type ``=Fit 1`` and then press Enter. The "Initial" values of the parameters should now read ``=Fit1:n``, where "n" is the index of the parameter.

This is the linking syntax: ``=name:index``.
"name" is the name of another fit.
"index" is the index of a parameter in that fit.
If you omit "index", it will default to the index of the parameter you are linking from. A linked parameter uses the refined value of the link as its initial value. This is useful when you are running several related fits.

5. Add more fit parameters:
(a) Select the "Constraints" tab of the `Ni.stru` phase below "Fit 1_copy".
(b) Write ``@9`` in the "delta2" box.
- Select the "Constraints" tab of the `Ni.stru` phase below "Fit 1_copy".
- Write ``@9`` in the "delta2" box.

6. Run the fit and plot the results:
(a) Run the fit as in Lesson 1.
(b) Plot the fit as in Lesson 1, but this time hold down Control and select the data sets from "Fit 1" and "Fit 1_copy". You can change the "offset" in the plotting window to 0 to place the plots on top of each other.
- Run the fit as in Lesson 1.
- Plot the fit as in Lesson 1, but this time hold down Control and select the data sets from "Fit 1" and "Fit 1_copy". You can change the "offset" in the plotting window to 0 to place the plots on top of each other.

-------------------------------------------------------------------------------

References:
-----------

1. `Proffen-jac-1999.pdf`_
1. `Proffen-jac-1999.pdf`
Th. Proffen and S. J. L. Billinge, PDFFIT a program for full profile structural refinement of the atomic pair distribution function, J. Appl. Crystallogr. 32, 572-575 (1999)

2. `Farrow-jpcm-2007.pdf`_
2. `Farrow-jpcm-2007.pdf`
C. L. Farrow, P. Juhas, J. W. Liu, D. Bryndin, J. Bloch, Th. Proffen and S. J. L. Billinge, PDFfit2 and PDFgui: Computer programs for studying nanostructure in crystals, J. Phys.: Condens. Matter 19, 335219 (2007)

0 comments on commit 354be1c

Please sign in to comment.