Getting Started

In the following sections we will introduce several practical use cases of FullProfAPP, from the simple task of loading and visualizing your data, to performing sequential refinements on operando data.

The first step is to download the example files from the GitLab repository

Select Project Folder

To select a working directory for your project follow these steps

  1. Click on File

  2. Click on Select Project Folder

  3. Select the working directory, to follow the next examples select the examples/EgyptMakeup folder in the example files.

See how the File System and Terminal tabs are updated.

Load Experimental Data

Follow the steps

  1. Click on Pattern

  2. Click on Import Pattern.

  3. Open the file explorer by clicking Browse on the Pattern File section and select the EgyptMakeUp.xys file

  4. Select the file format by expanding the File Format list. Select the xys/xye/xy option

  5. Open the file explorer by clicking Browse on the IRF File section and select the LURE.irf file

  6. Select the X-Rays option on Radiation and the Debye-Scherrer / Bragg-Brentano on the Geometry section

  7. Click on Add Files.

Click OK to load the patterns into the app. You should see the pattern plotted in the Graphics Area as well as some additional options enabled, such as the Graphics Toolbar and the Automatic Background (Peak Detection) options. Additionally, the Pattern List and the Load .pcr(s) buttons from the Automatic Refinement Protocol and the Manual Refinement windows are also enabled. Meaning that at this points you can already start loading existing PCR files to perform Rietveld refinements. However, let’s continue with our example.

Detecting and Editing Background and Peaks

Once the experimental data is loaded into the app, you can try to extract information about the background, and the peak positions and intensities.

To fit the background follow the steps

  1. Click on Pattern

  2. Click on Automatic Background

You should see the current fit for the background plotted along with the experimental patterns. On top of this, a small widget containing two sliders (log_lambda and log_p) pops up. Changing the values of any of the sliders changes the fit of the background.

framework

Fig. 10 Background fit example

After fitting the background to the experimental pattern, you can additionally extract peak positions and intensities with the following steps

  1. Click on Pattern

  2. Click on Peak Detection

Again, you should see the peak positions and intensities plotted with the experimental patterns and background. You can use the alpha and width sliders to chose the best parameter combination. Notice that the peak positions are also shown below.

framework

Fig. 11 Peak detection example

Note

The fitting of the background or the detection of peak positions and intensities happens for all patterns that appear as checked in the Pattern Checks menu of the Graphics Toolbar (see this Note)

The background points (peaks) can be edited by toggling the Edit Background (Edit Peaks) modes in the Pattern menu. See the Interacting With Graphs sections for more details.

Downloading CIF Files from Online Databases

FullProfAPP allows you to download crystallographic models as CIF files. It uses OPTIMADE, an API with a common specification for several materials databases.

Note

The current implementation of FullProfAPP only uses OPTIMADE to obtain the phase identifiers for the corresponding databases. Then, these identifiers are downloaded using database specific API’s. The current version of the program is only compatible with the Crystallographic Open Database (COD). We realize that this workaround is not optimal, and we plan to improve the situation using the recently developed client of the optimade-python-tools, to allow users to export CIF files from a variety of databases.

To search for materials in databases, follow these steps

  1. Click on Materials

  2. Click on Search in Remote Database

You should see a dialog window pop up. Inside, a periodic table of elements is shown. Each button corresponds to an element and can be toggled to three different states

  • Grey: The queried compounds do NOT contain this element

  • Yellow: The queried compounds OPTIONALLY contain this element

  • Green: The queried compounds MUST contain this element

Lets try the following query. {Pb} indicating that all the downloaded phases must contain lead. And {C, O, S, Cl}, indicating that the phases may optionally contain any of those phases. The window should look like this

framework

Fig. 12 Database querying window example

Click OK to initiate the download process.

Note

  • Be patient when starting the download. The querying process with OPTIMADE is not implemented to be concurrent with FullProfAPP’s event loop and the GUI will be blocked for some time while the phase identifiers are retrieved. After that, you will see a progress bar appear in the bottom-right side of the app’s main window showing you the downloading progress

  • It may happen that OPTIMADE fails to return the queried identifiers. Normally, this is due to the target database being down or not reachable from your network. It may also happens that the materials identifiers are correctly extracted but the specific requests to the database API fail. In this case you will see that the Queried Materials tab is empty.

Once all CIF files are downloaded, you will see around 120 entries in the Queried Materials tab. You can inspect the items to see that, indeed, all downloaded phases contain {Pb}. You may have also received a warning telling you that some CIF files failed to be parsed and that they would not be loaded into the program. Notice also that a new folder has been created in the working directory called Downloaded_CIFs, where all the CIF files are stored.

Simulate Powder Patterns

Here we describe how to use FullProfAPP to simulate diffraction patterns of materials. The Queried Materials tab has two buttons Submit Selection and Simulate Selection. To run a simulation, select the one or more rows in the materials table and click Simulate Selection. You will see that the focus is changed to the Terminal where the information about the execution of fp2k is printed. When the simulations is finished, a pop up window appears showing the results of the simulations together with the experimental pattern that is currently selected in the Graphics Toolbar.

This popup window contains a few extra features for you to visually adjust some parameters if needed.

  • Scale Factor sliders: Each crystallographic phase included in the simulations has an associated slider that allows to change the intensities of the profiles for that phase.

  • Zero Correction slider: This slider alters the value of the constant \(2\theta\) shift on the simulated patterns.

  • HKL Gen: Each crystallographic phase has an associated button that allows to recalculate the positions of the hkl reflections for varying cell paramters.

framework

Fig. 13 Simulation window of two phases ‘cod-1539418’ and ‘cod-9005510’. The sliders associated to scale factor, zero correction, and the HKL Gen pop up window of ‘cod-1539418’ appear on screen.

Additionally, you can see two extra buttons in the figure above.

  • Rerun Simulation: Run another simulation considering the newly selected scale factors, zero correction, and cell parameters. Notice that when playing with the sliders of the HKL Gen pop up window, only the hkl reflections change, not the profile. On the other hand, rerunning the simulation will also update the profile.

  • Generate CIF file: Duplicate the CIF file(s) that were used in the simulation. The new CIF files will contain the values of the cell parameters that were manually selected with the HKL Gen functionality.

The results of the simulations are saved in folders named SIMULATE###.

At this point you can start playing with the sliders. Do you see any way of adjusting the available parameters by hand? Are you able to find some of the phases that are present in the samples out of the 120 phases that you downloaded from the COD?

You may have already noticed that this is not a smart way of going around this problem. Indeed, many packages (most of them commercial) exist that perform accurate search match identification based on sample peak positions and intensities. However, did you know that this is also possible to do using only Rietveld refinements? See the next section for more information.

Run Full-Profile Phase Searches

FullProfAPP offers the possibility of performing phase searches in order to discriminate the crystallographic phases that are potentially present in your samples from the ones that are not. To test this functionality, we will keep using the Egyptian Makeup example. Follow the steps

  1. Copy the CIF files from examples/EgyptMakeup/ICSD to examples/EgyptMakeup/Downloaded_CIFs.

  2. Click on Materials.

  3. Click on Search in Local Database and select the examples/EgyptMakeup/Downloaded_CIFs folder. You should now have five additional entries in the Queried Materials table.

  4. Check for bad entries and clean them. For example, empty fields, low symmetry entries (P1, P -1, …), <NA> entries, strange spacegroup symbols, etc..

  5. Select the whole table and click Submit Selection. You will see the Selected Materials tab become visible with a table that contains all the selected phases.

  6. Go to the Full-Profile Phase Search Protocol window and select the following parameters

    framework

    Fig. 14 Example parameters of the Full-Profile Phase Search Protocol window

    Note

    Notice that we excluded the 40 - 90 \(2\theta\) region. This is because the reflections at high angles are less relevant when performing phase searches.

    Warning

    Before going to the next step, we warn you that the results of the phase search are quite sensitive to the selection of the background points, specially for the minority phases. In principle, for this example the default parameters of the Automatic Background should work just fine, but it is always a good idea to double check your results.

  7. Click Run: FP Search to start the search. You will see a pop up window that shows the progress of the phase search protocol. It looks like this.

    framework

    Fig. 15 Progress window for the Full-Profile Phase Search Protocol

    The progress window has the following sections

    • Scanned Phases (S1): Table with all the phases that are being considered during the scanning cycle.

    • Detected Phases (S2): Table with the phases that have achieved the highest Figure of Merit (FoM) at the end of the scanning cycle.

    • FoM Graph: It plots the value of the FoM with respect to the phase index.

    • \(R_{wp}\) Graph: It plots the weighted profile factor (\(R_{wp}\)) each time a phase is added to the list of detected phases.

    Note

    The \(R_{wp}\) should have a decreasing tendency with the subsequent detection of new phases. If you see that adding new phases does not contribute to decreasing \(R_{wp}\) (or that it even increases its value), it means that the phase search process is failing to identify all the phases correctly (even if it is possible that some of the detected phases are correct).

    The progress window has a color code that tells you which is the status of the scan and quantification cycles:

    • White: The highlighted phases are not analyzed yet

    • Yellow: The highlighted phases have been already analyzed

    • Green: The highlighted phase has achieved the maximum FoM of the scanning cycle. If this color appears in the S2 table, the phase search process has been successful.

    • Red: The highlighted phases have resulted in a refinement error or their weight fractions are below a threshold (f_S1). In any of those cases, the phases are eliminated and not considered for subsequent scanning cycles.

If the full-profile phase search finishes correctly, you should see the Results and the Prf Data tabs appear with a summary of the phases and the resulting refined profiles. Do you get something similar to this?

framework

Fig. 16 Refined profiles of the EgyptMakeUp example

If the answer is yes, you’ve solved a 4000 year old Egyptian mystery! 𓍛 𓏇 𓈖𓄿, 𓀊!

Note

  • While it is possible to perform phase searches in large sets of candidate phases, Rietveld refinements are more computationally demanding than traditional search-match runs. FullProfAPP implements a multiprocessing job scheduler that allows to speed up the phase search process by a factor of 4 with respect to older versions.

  • Still, brute forcing a full-profile phase search might not be the most sensible option, especially when dealing with synthetic samples. Instead, a pre-screening of potential phases with traditional search match methods is probably desirable, to then perform full-profile searches on a reduced set of candidate phases.

Sequential Refinement of Phase Separating LiFePO4 - FePO4

In this section we will learn how to interact with the Automatic Refinement Protocol window. This example features a synchrotron operando study of a Li-ion battery performing subsequent charge/discharge cycles. This battery contains LiFePO4 as the positive electrode active material. Under normal operation conditions, LiFePO4 is known to be a phase separating material. Thus, we expect that the pattern series will contain both LiFePO4 and FePO4 phases with varying weight fractions, manifested as the appearing and dissapearing of their corresponding diffraction peaks. The first thing to start with this examples is to load the experimental patterns. Follow the steps

  1. Click on File/Select Project Folder and select the examples/LiFePO4 directory

  2. Click on Pattern/Import Pattern

  3. In the dialog window click on Browse on the Pattern File section and select all the files in the examples/LiFePO4/LiFePO4_14LFPKa folder

  4. Select the xys/xye/xy option in the File Format (.*) section

  5. Click on Browse on the IRF File section and select the IRF_NOTOS_July2022_MR.irf file

  6. Select the X-Rays option on Radiation and the Debye-Scherrer / Bragg-Brentano on the Geometry section

  7. Click on Add Files.

Press the OK button to load the pattern series onto the app. Look at the patterns plotted in the Graphics Area, explore them using the Graphics Toolbar, you can see how new peaks appear while others dissapear with varying intensities. You can have a global view of the whole pattern series by clicking on the Contour Plot button

framework

Fig. 17 Contour plot of the loaded patterns

Looking at the data you can see some strange noisy signals for the first two patterns 14LFPka_f00001 and 14LFPka_f00002, which will be ignored in this example.

Note

Since the objective of the example is to perform a sequential refinement, recall the three points from the information given about the Sequential Mode check box of the Automatic Refinement Protocol window.

Taking the previous note into consideration, we will set the pattern 14LFPka_f00003 as checked, while the rest will remain unchecked. Notice the changes in the Automatic Refinement Protocol window. The Pattern List now shows a single item referring to the checked item. By further checking the Sequential Mode box, you are telling FullProfAPP to perform a sequential refinement of the whole pattern series starting in 14LFPka_f00003 and finishing in 14LFPka_f000030.

But first, we should define a better background for our checked pattern. Follow the steps

  1. Click on Pattern

  2. Click on Automatic Background

You may have to spend some time manually editing the background points, especially in the 10 to 20 \(2\theta\) region, where the automatic background is not able to find a good fit for the pattern. To edit the background points remember to activate the Edit Background mode and use the editing commands. You should obtain something like this

framework

Fig. 18 Background fit of the pattern

Once you are happy with the fit of the background signal, it is time to download the candidate crystallographic phases from the COD. Follow the steps

  1. Click on Materials

  2. Click on Search in Remote Database

  3. On the pop up window do the following selection {Fe, P, O} and {Li} and click OK. The selection should look like this

framework

Fig. 19 Database query example

Once the download is completed, we invite you to simulate some patterns for the LiFePO4 and FePO4 structural models to visually inspect how well they fit as initial guesses. At the moment of writting this example, we found the CIF files with identifiers cod-1101111 (LiFePO4) and cod-1525576 (FePO4) to have initial values that are close enough for this example. Alternatively, you can try to use the Full-Profile Phase Search Protocol window first.

Additionally, we download the CIF files corresponding to aluminum (cod-4313206), as our pattern additionally contains signals that come from the current collector of the battery. You can quickly see by simulating the aluminum pattern that the positions of the reflections are close enough, but the peak intensities are not, even when varying the scale factors. This is because the aluminum is highly textured and the powder diffraction condition is not met (some crystallographic planes are over-represented in the data collection). This example will also show you how to treat these specific peaks.

After downloading the crystallographic model phases, we must assign them to our checked patterns. Follow the steps

  1. Select the cod-4313206, cod-1101111, and cod-1525576 entries on the Queried Materials table

  2. Click on the Submit Selection window. See the updates on the Selected Materials tab.

  3. Go to the Automatic Refinement Protocol window and click the button. The Pattern Phases tree below is updated. Expand the tree item to verify that the three model phases have been linked to the 14LFPka_f00003 pattern.

Now that FullProfAPP knows which patterns to treat and which crystallographic models to use, we are ready to define our refinement workflow. Remeber that the refinement workflow is defined by checking the items in the Refinement Parameters tree and adding the workflow steps by clicking on the button. Follow the steps to define the workflow

  1. Check Scale Factors for cod-1101111 and cod-1525576. Mouse Right Click on cod-4313206 and select the Profile Matching (Constant Scale Factor) option. Click .

  2. Check Zero. Click .

  3. Check Background. Click .

  4. Check Cell Parameters for cod-1101111, cod-1525576, and cod-4313206. Click .

  5. Check Ustrain for cod-1101111, cod-1525576, and cod-4313206. Click .

  6. Check Ysize for cod-1101111, cod-1525576, and cod-4313206. Click .

Notice the 5 step workflow that we defined in the Workflow tree panel. Expand the tree items and verify that indeed that workflow that you set up is the one we show above.

Note

Have you noticed what we did with the aluminum (cod-4313206)? Remember that the aluminum in this sample is highly textured and is not well suited to be refined using the Rietveld method. Instead, we set it to be refined using the LeBail method by selecting the Profile Matching (Constant Scale Factor) option.

Warning

Remember that when using the Profile Matching mode you should never refine site parameters (atomic positions, temperature factors, occupations). Additionally, if you use the Constant Scale Factor mode, you should not refine the scale factors either.

Lastly, we will exclude the 0.0 - 11.5 \(2\theta\) region from the refinement process. In short, the Automatic Refinement Protocol window should look like this.

framework

Fig. 20 Automatic Refinement Protocol window setup

Once all the parameters are set, FullProfAPP is completely setup to perform the sequential refinement.

Click on the Run FP: Workflow button to start the refinement. You will see the focus change to the Terminal tab.

When the first pattern has been refined, two additional tabs (Prf Data and Summary) will become visible. Move around with the Graphics Toolbar to trigger the signals for plotting the refined profiles in the Prf Data tab. The Summary tab will update at the end of each pattern’s refinement. Notice the additional parameter tree to the right of the plot area. Check any item in the parameter tree to plot the value of the corresponding parameters against the pattern number. For example, check the weight fractions items for cod-1101111 and cod-1525576 to inspect the evolution of the weight fractions of LiFePO4 and FePO4 along the pattern series.

framework

Fig. 21 Results of the refinement process

Nice! We have just easily refined a pattern series comming from an operando synchrotron measurement of a Li-ion battery! 🔋 Which has saved us a lot of time in comparison to the prospect of doing the same thing pattern by pattern.

Warning

The refinement workflow and the set-up of the sequential refinement is case specific, and this example does not show a universal approach to treat all kinds of sequential data. Additionally, double checking and taking care that all the generated PCR files have paramers that make sense is the responsability of the user. FullProfAPP does its best to prevent the refinement process from diverging, but does not automatically handle non-sensical refinement values. That is why the user has complete access to the files generated by fp2k in the working directory (folders named FPSEQ### in this specific example).

For example, a quick look into the files generated in this example shows that some of the microstrain and crystallite size parameters take negative values. This is not correct, and the user is responsible for fixing this issue to improve upon the current state of the refinement.

Sequential Refinement of a LiMn0.333 Ni0.333 Co0.333 O2 Solid Solution

This example features a synchrotron operando study of a Li-ion battery performing subsequent charge/discharge cycles. In this case, the operando cell contains LiMn0.333 Ni0.333 Co0.333 O2 (NMC111) as the positive electrode active material. This material has a solid solution mechanism under normal operating conditions, where all intermediate Li compositions are thermodinamically stable with respect to the fully lithiated and delithiated phases. Thus, we expect that the pattern series will only contain a single NMC111 phase, where diffraction peaks will evolve according to the changes in the crystal structure of the material. This is in contrast to the previous LiFePO4 example, where the diffraction peaks of each phases where relatively unchanged but their relative intensities varied according to the constituent phase fractions.

Following the same steps as in previous examples, the first thing is to load the experimental patterns into the app.

  1. Click on File/Select Project Folder and select the examples/NMC111 directory

  2. Click on Pattern/Import Pattern

  3. In the dialog window click on Browse on the Pattern File section and select all the files in the examples/NMC111/IS22NMCapd folder

  4. Select the xys/xye/xy option in the File Format (.*) section

  5. Click on Browse on the IRF File section and select the IRF_NOTOS_July2022_MR.irf file

  6. Select the X-Rays option on Radiation and the Debye-Scherrer / Bragg-Brentano on the Geometry section

  7. Click on Add Files.

  8. Press the OK button to load the pattern series onto the app.

Look at the patterns plotted in the Graphics Area, explore them using the Graphics Toolbar. Do you see the behaviour that we where describing earlier? You can have a global view of the whole pattern series by clicking on the Contour Plot button-

framework

Fig. 22 Contour plot of the loaded patterns

Given that the objective of the exercise is to perform a sequential refinement of the pattern series, we will set the pattern IS22NMCa_f00039.xye as checked, while the rest will remain unchecked. Notice again the changes in the Automatic Refinement Protocol window. The Pattern List now shows a single item referring to the checked item. By further checking the Sequential Mode box, you are telling FullProfAPP to perform a sequential refinement of the whole pattern series starting in IS22NMCa_f00039.xye and finishing in IS22NMCa_f00060.xye.

The next step is to define a background for our checked pattern. Follow the steps

  1. Click on Pattern

  2. Click on Automatic Background

In this case the default parameters give a good enough fit for the background, but you are free to change them to your liking.

framework

Fig. 23 Background fit of the pattern

Once the background is fitted, we must download the CIF files of the material models from the crystallographic databases. Follow the steps

  1. Click on Materials

  2. Click on Search in Remote Database

  3. On the pop up window do the following selection {Li, Mn, Ni, Co} and click OK. The selection should look like this:

framework

Fig. 24 Database query example

When the download has been completed we must check whether the CIF files have starting parameters that are good enough for the refinement. For this we will simulate some patterns using the downloaded CIF files. The file with identifier cod-4002443 is an appropriate material model for NMC111. Additionally, the diffraction patterns contain two extra signals. The peaks around 27.9º, 32.35º, and 46.4º \(2\theta\) correspond to the aluminum foil, which is highly textured and is not well suited to be refined using the Rietveld method. Instead, just as what we did in the previous LiFePO4 example, we will treat those peaks using the Profile Matching (Constant Scale Factor) option. Then, we must download the CIF file for Al as well and look for the cod-4313206 identifier. Similarly, the peaks around 33.1º, 38.0º, and 50.2º \(2\theta\) correspond to two berillium windows that are placed at both ends of the operando cell. In this case, the berillium peaks do not overlap with the NMC111 peaks, and we will just exclude them from the refinement process.

Then, we must assign the downloaded phases to our checked patterns. Follow the steps

  1. Select the cod-4313206 and cod-4002443 entries on the Queried Materials table

  2. Click on the Submit Selection window. See the updates on the Selected Materials tab.

  3. Go to the Automatic Refinement Protocol window and click the button. The Pattern Phases tree below is updated. Expand the tree item to verify that the model phases have been linked to the IS22NMCa_f00039.xye pattern.

At this point we are ready to select the refinement workflow for our pattern series. Follow the steps

  1. Check Scale Factors for cod-4002443. Mouse Right Click on cod-4313206 and select the Profile Matching (Constant Scale Factor) option. Click .

  2. Check Zero. Click .

  3. Check Background. Click .

  4. Check Cell Parameters for cod-4002443 and cod-4313206. Click .

  5. Check Ustrain for cod-4002443 and cod-4313206. Click .

  6. Check Ysize for cod-4002443 and cod-4313206. Click .

Last we will need to exclude the regions were the berillium signals appear. Using the Excluded Regions widget exclude the following regions:

  • 0.0º - 10.0º

  • 32.0º - 33.8º

  • 36.0º - 40.0º

  • 49.8º - 60.0º

Click on the Run FP: Workflow button to start the refinement. You will see the focus change to the Terminal tab, as well as two additional tabs (Prf Data and Summary) that will allow you to inspect the results of the refinement process.

Inspect the refinement results. Is the refinement satisfactory? The evolution of the c axis in the Summary tab looks good and follows the behaviour that we would expect from a charge/discharge cycle of NMC111. However, looking at the fitting of the experimental patterns we can see that the results are not so good.

  1. The diffraction peaks become strongly anisotropic along the pattern series. This can be explained by the fact the volume change of NMC111 happens preferentially along the c axis, thus accumulating strains along particular directions.

  2. The 003 reflection is not completely well refined.

framework

Fig. 25 IS22NMCa_f00050.xye pattern showing the strong anisotropy on the broadening of the diffraction peaks.

To improve upon the previous refinement follow the steps we will need to use a new refinement workflow, this time accounting for the anysotropic strains. Follow the steps

  1. Check Scale Factors for cod-4002443. Mouse Right Click on cod-4313206 and select the Profile Matching (Constant Scale Factor) option. Click .

  2. Check Zero. Click .

  3. Check Background. Click .

  4. Check Cell Parameters for cod-4002443 and cod-4313206. Click .

  5. Check Ustrain for cod-4002443 and cod-4313206. Click .

  6. Check Ysize for cod-4002443 and cod-4313206. Click .

  7. Check Strain Anisotropy/cod-4002443/S_112. Click .

  8. Check Strain Anisotropy/cod-4002443/S_004. Click .

  9. Check Strain Anisotropy/cod-4002443/S_400. Click .

We will leave the excluded regions unchanged from the previous refinement.

Click on the Run FP: Workflow to start the more complex 9 step refinement. Check the new results in the Prf Data and Summary tabs.

framework

Fig. 26 Evolution of the c axis parameter and the fitting of the anisotropic peaks of the IS22NMCa_f00050.xye pattern.

As you can see, while the evolution of the c axis parameter is similar in both cases (with and without anisotropic strains), the quality of the fit has increased significantly.

Once again, congratulations! Most battery chemistries operate with either of the mechanisms (or a combination of both) that we have introduced here for the cases of LiFePO4 (phase separating) and NMC111 (solid solution). You are now equiped to do SCIENCE 🧪 with all kinds of materials for energy storage 🔋!

Note

Extra Exercises
  • Try to include both berillium windows in the refinement (Hint: Each window has its own zero-shifts)

  • Improve the refinement of the NMC111 sample. You can see that the 003 still is not well refined. This happens at the end of the charge (delithiation). Is there some additional signals coming from another phase (H2, H3, O1, rock-salt, spinel…)?.