User Tools

Site Tools


processing:indexing_with_grainspotter

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:indexing_with_grainspotter [2019/02/21 06:35]
smerkel
processing:indexing_with_grainspotter [2023/03/16 12:10]
smerkel
Line 1: Line 1:
 ====== Grain indexing with GrainSpotter ====== ====== Grain indexing with GrainSpotter ======
  
-At this point, you should have a [[processing:​compute_gvectors|computed all experimental G-vectors]]. You are now ready for indexing grains with [[software:​grainspotter|GrainSpotter]].+At this point, you should have a [[processing:​compute_gvectors|computed all experimental G-vectors]]. You are now ready for indexing grains. This page shows you the indexing procedure ​with [[software:​grainspotter|GrainSpotter]]. For an alternative way of indexing, check out [[processing:​indexing_with_imaged11|Indexing with ImageD11]].
  
-GrainSpotter first generates a number of random grain orientations and, for each, calculates the corresponding theoretical G-vectors. For each grain orientation,​ GrainSpotter looks for a possible match between the theoretical G-vectors and those found in the experiment. If the convergence criteria are met (see details +GrainSpotter first generates a number of random grain orientations and, for each, calculates the corresponding theoretical G-vectors. For each grain orientation,​ GrainSpotter looks for a possible match between the theoretical G-vectors and those found in the experiment. If the convergence criteria are met (see details below), the grain is assigned.
-below), the grain is assigned.+
  
 ==== Estimation of the uncertainties ==== ==== Estimation of the uncertainties ====
Line 12: Line 11:
 In Fabian, load your peaks from the peaksearch and overlap them with the diffraction data (''​CrystTools''​ > ''​Peaks''​ > ''​read''​). In ImageD11, display your peaks as 2θ/η plot. You can then evaluate the maximum δ2θ, δη, and δω ranges you can use to avoid mixing up peaks. In Fabian, load your peaks from the peaksearch and overlap them with the diffraction data (''​CrystTools''​ > ''​Peaks''​ > ''​read''​). In ImageD11, display your peaks as 2θ/η plot. You can then evaluate the maximum δ2θ, δη, and δω ranges you can use to avoid mixing up peaks.
  
-ImageD11 is not a good tool for evaluating δη and δω as all peaks extracted for all ω are stacked on the same plot. It is the only tool, however, ​that will allow you to evaluate δ2θ.+ImageD11 is not a good tool for evaluating δη and δω as all peaks extracted for all ω are stacked on the same plot. It is appropriate, however, to evaluate δ2θ.
  
-[{{:​fabian.png?​nolink&​300 | Result of a peak search displayed in Fabian. Red circles are peaks. Using Fabian you can estimate the maximum δη interval (azimuthal coordinate on the detector plane) that can be used without confusing peaks. By moving from one image to the next, you can also estimate the maximum value of δω interval that can be used while avoiding confusion between peaks.}}] +[{{:​fabian.png?​nolink&​250 | Result of a peak search displayed in Fabian. Red circles are peaks. Using Fabian you can estimate the maximum δη interval (azimuthal coordinate on the detector plane) that can be used without confusing peaks. By moving from one image to the next, you can also estimate the maximum value of δω interval that can be used while avoiding confusion between peaks.}}] 
-[{{ :​imaged11_plotttheta_500.png?​nolink&​250| 2θ/η plot in ImageD11. This can be used to assign a maximum δ2θ interval that will avoid confusion between the diffraction lines. Pay attention to this step. If your 2θ uncertainty is too large, ​this indexing will be completely wrong.}}] ​+[{{ :​imaged11_plotttheta_500.png?​nolink&​250| 2θ/η plot in ImageD11. This can be used to assign a maximum δ2θ interval that will avoid confusion between the diffraction lines. Pay attention to this step. If your 2θ uncertainty is too large, ​the indexing will be completely wrong.}}] ​
  
  
 +==== Indexing grains ====
 + 
 +You are now ready to start indexing your g-vectors with [[software:​grainspotter|GrainSpotter]].
  
-==== From diffraction peaks to G_vectors ====+GrainSpotter works with an input file, typically ending with a [[fileformat:​ini|.ini]] extension in which you should define 
 +  * the crystal structure of the grains you are looking for, 
 +  * the 2θ, η and ω ranges in which to look for g-vectors, the 2θ can also be expressed in d-spacing range, 
 +  * the cuts, above which a grain is considered a grain, 
 +  * the uncertainties in 2θ, η and ω, 
 +  * a nσ factor that will be applied to the uncertainties above, 
 +  * the number of random tries.
  
-[[software:​imaged11|ImageD11]] will allow you to obtain a .gve file with the G-vectors of the peaks you find with [[:​peaksearching|peaksearch]]+Changing the 2θ range allow you to exclude some domains where the peaks are not well defined.
  
-  * open the software with the command ​ :  +You should play on the //cut// and //​uncertainties//​ to optimize ​the parameters that will lead to the best results.
-      <WRAP center box 18%> +
-**ImageD11_gui.py** +
-</​WRAP>​+
  
-  * in the menu **'​transformation'​** click on **'​load filtered peaks'​** and choose the file you obtained with peacksearch;​ +When your input file is ready, type either ​ 
-  * in the menu **'​transformation'​** use **'​plot y/​z'​**;​ +   GrainSpotter.0.90 index.ini 
-           {{ :​imaged11_plotyz.png?​nolink&​400 |}} <WRAP center round textbox 50%> //Plot x/y in ImageD11 for 500 simulated fosterite grains with a peaksearch treshold of 2Tip : if you obtain ellipses instead of circles, try to resize the ImageD11 window.// +or 
-</​WRAP>​+   ​GrainSpotter index.ini 
 +or  
 +   ​grainspotter index.ini
  
-  * [[software:​imaged11|enter the parameters of the experiment]] (**'​transformation'​ > 'edit parameters'​**) 
-  * you can save the parameters : **'​transformation'​ > 'save parameters'​** (end the name of the file by .prm); 
-  * clear the plot and use **'​transformation'​ > 'plot tth/​eta'​**;​ 
-                {{ :​imaged11_plotttheta_500.png?​nolink&​400 |}} <WRAP center round textbox 50%> 
- //​tth/​eta plot for the same set of grains.// 
-</​WRAP>​ 
  
-  * [[software:​imaged11|check if the lines are straight]];  +======Sample GrainSpotter input file======
-  * in **'​transformation'​** click on **'add unit cell peaks'​** +
-             {{ :​imaged11_plotttheta_straight.png?​nolink&​400 |}}  <WRAP center textbox 50%> +
-//Zoom on peaks positions between 2θ=5 and 2θ=11(again, same set of data). Unit cell peaks positions in red.//  +
-</​WRAP>​ +
- +
-  * here you can estimate the uncertainty on 2θ : determine the maximal width of the peak line for which the spots of each line do not mix. +
-  * compute and save G-vectors : **'​transformation'​ > '​compute g-vectors'​** then **'​transformation'​ > 'save g-vectors'​** (do not forget to end the name of the file with .gve)                                                                    +
-  * in the menu **'​Indexing'​** use **'​load g-vectors'​** and choose your gve file. +
-  * then use **'​Indexing'​ > '​Assign peaks to powder rings'​** to see in the command windows the hkl plan associated to each Debye Ring of your diffraction data and the number of mesurements found for each of them.  +
- +
-With that G-vectors file, you will be able to use GrainSpotter to find your original grains. +
- +
-==== From G-vectors to grains ​==== +
-  +
-You can now index your diffraction peaks with [[software:​grainspotter|GrainSpotter]]. +
- +
-But before entering the commande line in the Konsole, you must complete the input file : index.ini. +
-In that file you must write the same parameters you used in your experiment/​simulation and in ImageD11, but you can vary :  +
-  * the 2θ range; +
-  * the cut +
-  * the uncertainties +
-  * the random number  +
- +
-Changing the 2θ range allow you to exclude some domains where the peaks are not well defined.+
  
-You should play on the cut and the uncertainties to found the settings ​with the best indexationIncreasing ​the minimum of measurements allow to decrease the number of erroneous indexed grains but it limite the number of indexed ​grains found. ​The uniqueness and the completness do not have a great importance on the indexation (I set both to zero in my best indexation scenario)For defining ​the incertaintiesuse the plot from fabian and ImageD11.+Below is a sample GrainSpotter input file that we actually used: 
 +  * lines started with ''​!''​ are commented out and will not be used, 
 +  * we define several 2theta ranges in which we actually look for peaks (other changes were polluted by an additional phase, 
 +  * images were acquired ​with ω in the [-28°;+28] range in steps of 0.5°, 
 +  * the GVE file to start from is ''​peaks-I-Want-To-Index.gve'',​ 
 +  * results will be saved in ''​grains-I-found.log''​ 
 +  * cuts are as follow 
 +       * 15 peaks, minimum per grain, 
 +       * 30% completeness minimum, which is quite low but diamond anvil cells have shadows, peaks may be hidden by the pressure medium, etcIf the completeness restriction is too highyou will not find enough grains, 
 +       * 50% uniqueness: has no effect in the experiments we performed,​ 
 +   * uncertainties:​ 0.02° in 2θ, 1° in η and 2° in ω, which are all multiplied by a nσ of 2 (line below) 
 +   * tries for 10000 random orientations and stops,
  
-Increasing ​random ​number increase ​the number ​of grains indexed but slow a bit the calculation.+<​code>​ 
 +spacegroup 62                ! spacegroup [space group nr] 
 +! dsrange 0 0.34                         ! dsrange [min max], d-spacing range, multiple ranges can be specified 
 +tthrange 3.0 7.15                          ! tthrange [min max], multiple ranges can be specified 
 +tthrange 7.35 10.2                          ! tthrange [min max], multiple ranges can be specified 
 +tthrange 10.3 12.5                          ! tthrange [min max], multiple ranges can be specified 
 +tthrange 12.65 14.5                          ! tthrange [min max], multiple ranges can be specified 
 +etarange 0 360                ! etarange [min max], multiple ranges can be specified 
 +domega 0.5                        ! domega [stepsize] in omega, degrees 
 +omegarange -28 28 ! omegarange [min max] degrees, multiple ranges can be specified 
 +filespecs peaks-I-Want-To-Index.gve grains-I-found.log ! filespecs [gvecsfile grainsfile] 
 +cuts 15 0.3 0.5                ! cuts [min_measuments min_completeness min_uniqueness] 
 +eulerstep 5                ! eulerstep [stepsize] : angle step size in Euler space 
 +uncertainties 0.02 1 2    ! uncertainties [sigma_tth sigma_eta sigma_omega] in degrees 
 +nsigmas 2                    ! nsigmas [Nsig] : maximal deviation in sigmas 
 +! minfracg 1                            ! stop search when minfracg (0..1) of the gvectors have been assigned to grains 
 +! Nhkls_in_indexing 15 ! Nhkls_in_indexing [Nfamilies] : use first Nfamilies in indexing 
 +random ​100000 ​                          ! use randomly chosen orientation seeds #trials 
 +! positionfit ​                           ! fit the position ​of the grain 
 +! genhkl ​                                 ! generate list of hkl's based on space group and cell parameters in gve file 
 +</​code>​
  
-When your input file is ready, type :  +======Loops with GrainSpotter======
-<WRAP center box 30%> +
-**GrainSpotter.0.90 index.ini** +
-</​WRAP>​ +
-//nb : the commande **GrainSpotter** instead of GrainSpotter.0.90 work too, I do not know what is the difference.//​+
  
 +It can be efficients to run multiple loops of grainspotter indexings. The underlying concept is as follow
 +  * Step 1:
 +    * run grainspotter with a given set of specifications,​ remove all indexed peaks from the GVE file,
 +    * repeat the above operation X times,
 +    * this will provide a first set of grains, which should be the most reliable
 +  * Step 2:
 +    * Lower the tolerance, and repeat X loops of indexings, remove indexed peaks at each step
 +    * this will provide a second set of grains, which may have to be checked
 +  * Repeat steps above, lowering tolerances progressively in order to optimize the number of indexed grains, while making sure that all indexed grains make sense
 +  * Combined the results of all indexings into one main log file, with all indexed files from the loop.
  
 +There are several TIMEleSS tools to help you with this process
 +  * [[processing:​remove-used-gve-updated|timelessClearGVEGrains]]
 +  * [[processing:​grainspotter-merge|Merge GrainSpotter output files]]
 +  * [[processing:​extracteulerangles|ExtractEulerAngles.py]]
  
 +An example of a GrainSpotter loop is provided in a [[processing:​advanced_indexing_with_grainspotter|dedicated page]].
processing/indexing_with_grainspotter.txt · Last modified: 2023/03/16 12:10 by smerkel