User Tools

Site Tools


processing:complex-multi-phase

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
processing:complex-multi-phase [2019/08/01 09:59]
matthias [Trick 2: Work with large grain first]
processing:complex-multi-phase [2023/12/10 11:11] (current)
smerkel
Line 1: Line 1:
 +
 ====== ​ In the works: indexing a complex dataset with many phases ====== ====== ​ In the works: indexing a complex dataset with many phases ======
  
-If your dataset is complexhere is a list of tricks to get it indexed. This page is being improved over time.+When you have sample with multiple phasesyour list of extracted experimental g-gvectors (the bottom section of your [[fileformat:​gveexample|GVE file]], see example at the link) includes vectors that could originate from all phases in your sample.
  
-===== Trick 1Plot intensity vs2theta from peak histogram in ImageD11 =====+Here is how we proceed: 
 +  * First work on our list of g-vectors to identify our phases and peaks, 
 +  * Generate custom GVE files for each phase we will work on, 
 +  * Run series of indexings, one phase after another, and multiple times.
  
-   from ImageD11 import columnfile  +===== Identify phases and peaks =====
-   ​c ​columnfile.columnfile('​peaks_t100.flt'​) % if '​expection:​ problem interpreting your colfile'​ check the extention of your file. Should be .flt  +
-   ​c.titles % to see what variables you have in your columnfile +
-   ​c.parameters.loadparameters("​CeO2_parameters.prm"​) +
-   ​c.titles +
-   ​c.updateGeometry() +
-    import pylab +
-    pylab.figure() +
-    pylab.show() +
-    import matplotlib +
-    matplotlib.use("​GTK3Agg"​) +
-   from pylab import * +
-   ​show() +
-   from ImageD11.columnfile import * +
-    c columnfile("​peaks_t100.flt"​) +
-    c.parameters.loadparameters("​CeO2_parameters.prm"​) +
-    c.updateGeometry() +
-    tth=arange(0,​15,​.01) +
-   ​plot(np.histogram(c.tth,​bins=tth)[0],"​-"​) +
-    show() +
-    plot(tth[1:​],​np.histogram(c.tth,​bins=tth)[0],"​-"​) ​ % give a better ​peaks separation +
-    show() +
-   ​plot(tth[1:​],​np.histogram(c.tth,​bins=tth,weights=c.sum_intensity)[0],"​-"​) ​ % take in account the intensity of the peaks+
  
-Open a python console 
-   ​python 
  
-   ​import matplotlib +{{ :processing:​indexing:​gay2023_bridgmanite_2dplot.png?​direct&​200|}}
-   ​matplotlib.use("​GTK3Agg"​) +
-   from pylab import * +
-   from ImageD11.columnfile import * +
-   c = columnfile('​peaks_t100.flt'​) +
-   ​c.parameters.loadparameters("​CeO2_parameters.prm"​) +
-   ​c.updateGeometry() +
-   tth = arange(0,​15,​.01) +
-   ​plot(tth[1:],​np.histogram(c.tth,​bins=tth)[0],"​-"​) +
-   ​show()+
  
-===== Trick 2: Work with large grain first =====+One of the most critical tasks of this work is to know what you are looking for. In our case, we typically have 
 +  * or more sample phases, often with complex structures and many peaks, 
 +  * a pressure medium, often a simple cubic phase, with one peak.
  
-Example: You have a phase assemblage consisting of a pressure medium (KCl)majoritic garnet (Maj) and stishovite (St). The phase you are mainly interested in is St. But St is also the least abundant phase. In your 2D diffraction pattern you have difficulties ​to assign ​the peaks to certain phases. Especially your phase of interest has only a few peaks of low intensity.+To do soit is much better ​to work on an [[processing:​phase_identification| 2θ-histogram of the experimental g-vectors]].
  
-The idea behind ​the following procedure is thisRemove all peaks that belong to KCl and Maj so the only peaks left must be the St peaks.+The figure on the right shows an example from Gay //et al//, published in //Earth and Planetary Science Letters// in 2023 [doi[[https://​doi.org/​10.1016/​j.epsl.2023.118015| 10.1016/​j.epsl.2023.118015]]]. The sample holds 4 sample phases and a pressure medium (KCl). Top image is an ω-stack for all experimental g-vectors, potted as a function of ds and η. The bottom image is what you get if you try to index an average diffraction image directly. The middle panel is what is extracted from a 2θ-histogram of the experimental g-vectors.
  
-Let's startFirstyou have to [[processing:​start|perform ​the "​normal"​ data analysis]] up to the point where you search for peaks. We call this PeakSearch result ​the "​Start-peaks"​+The histogram is less affected by very large grains (the pressure medium in our case)In additionexperimental peak broadening, due to the instrument or the sample properties such as grain size or microstrains,​ have been removed since we only consider ​the center of mass of eack peak.
  
-Now comes the trickiest partYou have to do a good (!) Rietveld refinement. This is not easy since we already mentioned the issues of low intensity ​phases and multiple peaks in the paragraph above. But just do the best you can. The information you need for the following steps is the cell parameters ​of every phase (KCl, Maj and St).+You can then use your favorite powder diffraction software, such as [[https://​github.com/​seto77/​PDIndexer|PDIndexer]] or [[https://​luttero.github.io/​maud/​ | MAUD]] ​to identify sample ​phases and their unit cell parameters. Just keep in mind that peak intensities ​in the histograms are not true intensities,​ but a number ​of experimental g-vectors.
  
-Now, calculate the G-vectors with ImageD11 ​for every phase and save them. Save also the parameters of each phase.+===== Custom GVE files for each phase =====
  
-After that, you can create .ini files for every phase and run GrainSpotter ​(or a GrainSpotter loop), also for every phase. The amount of grains should ​be very high for each phase.+We will need a custom GVE file for each phase we want to index. In those files (see [[fileformat:​gveexample|detailed file format here]]): 
 +  * the first line needs to be altered with the unit cell parameters ​and lattice centering ​(one of P,A,B,C,I,F), 
 +  * the section on computed theoretical g-vectors ​for the unit cell needs to be updated, 
 +  * The actual scattering vectors (g-vectors) extracted from the experimental data below is identical ​for all phases, since we do not know how they are assigned.
  
-Now it's time to get rid of some peaks. Since KCl is the most abundant phase (e.g. the one with the most intense peaks)we remove ​the KCl peaks first. Run ringselect and ringselect_reverse ​to separate the KCl peaks from the other peaks. Check the peaks carefully in ImageD11 to avoid removing more peaks than necessary ​and adjust your theta tolerance respectively. We call file which contains only KCl peaks "​KCl-only" ​and the other file "KCl-removed"​.+Use a tool like [[processing:​list-peaks-from-cif|timelessPeaksFromCIF]]for each of the phases you wish to consider, ​and create a custom GVE file with the proper unit cell parameters, lattice centering, ​and computed theoretical g-vectors.
  
-Nowtake the "​KCl-removed"​ file (without ​the KCl peaks) and load it to ImageD11Again, you can calculate ​the G-vectors (this time only for Maj and St). Save them, as well as the respective parameters.+In our casewe do not index peaks from the pressure medium, but simply ignore ​the corresponding 2θ in the indexingThis can be easily done by specifying custom 2θ ranges in the GrainSpotter input file.
  
-You can also load the "​KCl-only"​ peaks, calculate their G-vectors and run GrainSpotter for them. Later, you can then compare the results.+===== Indexing loop =====
  
-Nowcreate .ini files for Maj and St again and run GrainSpotter (or GrainSpotter loop) againThe amount ​of peaks should be lower than in the first run.+Let's say your sample consist of 3 phasesphaseA, phaseB, phaseC, with the 3 corresponding experimental GVE files, phaseA.gve, phaseB.gve, phaseC.gve. The indexing process will go as follows 
 +  * index grains ​for phaseA, with a strict set of tolerances,​ 
 +  * remove the assigned experimental g-vectors from all 3 phaseA.gve, phaseB.gve, ​and phaseC.gve,​ 
 +  * index grains for phaseB, with strict set of tolerances,​ 
 +  * remove the assigned experimental g-vectors from all 3 phaseA.gve, phaseB.gve, and phaseC.gve,​ 
 +  * index grains for phaseC, with a strict set of tolerances,​ 
 +  * remove the assigned experimental g-vectors from all 3 phaseA.gve, phaseB.gve, and phaseC.gve,​ 
 +  * and repeat the process as many times as necessary, with the same tolerances, and then increasing tolerances to catch most sample grains, merging all the indexed grains into one master file.
  
-Run ringselect and ringselect_reverse again to separate Maj and St peaks. We call the created file "​KCl-removed_Maj-only" ​and "​KCl-removed_Maj-removed"​.+You can either run this by hand, your use a fancy loop with a bash script. We actually spent some time working on such a loop, and you can find an [[examples:​gs_loop_multiphase|example of a multiphase indexing loop here]].
  
-For a last time, create .ini files and run GrainSpotter for the "​Maj-only"​ peak list and the "​Maj-removed"​ list (which is in fact the St peak list).+===== Preparing figures =====
  
-At the end, you should have +This will be written later. We are still waiting ​for some publications to be accepted.
-  * two log-files ​for KCl (one from "​Start-peaks"​ and one from "​KCl-only"​) +
-  * three log-files for Maj (one from "​Start-peaks",​ one from "​KCl-removed"​ and one from "​KCl-removed_Maj-only"​) +
-  * three log-files for St ((one from "​Start-peaks",​ one from "​KCl-removed"​ and one from "​KCl-removed_Maj-removed"​)+
  
-You can now run timelessGrainComparison to see which of those results is meaningful and if the whole procedure was worth it. 
processing/complex-multi-phase.1564653580.txt.gz · Last modified: 2019/08/01 09:59 by matthias