processing:indexing_with_grainspotter
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| processing:indexing_with_grainspotter [2019/05/16 20:11] – estelle | processing:indexing_with_grainspotter [2023/03/16 13:10] (current) – smerkel | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Grain indexing with GrainSpotter ====== | ====== Grain indexing with GrainSpotter ====== | ||
| - | At this point, you should have a [[processing: | + | At this point, you should have a [[processing: |
| - | GrainSpotter first generates a number of random grain orientations and, for each, calculates the corresponding theoretical G-vectors. For each grain orientation, | + | GrainSpotter first generates a number of random grain orientations and, for each, calculates the corresponding theoretical G-vectors. For each grain orientation, |
| - | 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 ('' | In Fabian, load your peaks from the peaksearch and overlap them with the diffraction data ('' | ||
| - | 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, | + | 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θ. |
| - | [{{: | + | [{{: |
| - | [{{ : | + | [{{ : |
| Line 32: | Line 31: | ||
| Changing the 2θ range allow you to exclude some domains where the peaks are not well defined. | 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 indexation. Increasing the minimum of measurements allow to decrease | + | You should play on the //cut// and //uncertainties// to optimize |
| - | Increasing random number increase the number of grains indexed but slow a bit the calculation. | + | When your input file is ready, type either |
| + | | ||
| + | or | ||
| + | | ||
| + | or | ||
| + | | ||
| - | When your input file is ready, type : | ||
| - | <WRAP center box 30%> | ||
| - | **GrainSpotter.0.90 index.ini** | ||
| - | </ | ||
| - | //nb : the commande **GrainSpotter** instead of GrainSpotter.0.90 work too, I do not know what is the difference.// | ||
| - | ======Grain indexing with ImageD11====== | + | ======Sample GrainSpotter input file====== |
| - | First, get a gve file from ImageD11 | + | Below is a sample GrainSpotter input file that we actually used: |
| + | * lines started with '' | ||
| + | * 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 '' | ||
| + | * results will be saved in '' | ||
| + | * 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, etc. If the completeness restriction is too high, you will not find enough grains, | ||
| + | * 50% uniqueness: has no effect in the experiments we performed, | ||
| + | * uncertainties: | ||
| + | * tries for 10000 random orientations and stops, | ||
| - | Then go in ImageD11 | + | <code> |
| - | Use Assign | + | 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 | ||
| + | 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 | ||
| + | ! positionfit | ||
| + | ! genhkl | ||
| + | </code> | ||
| - | Hit generate trial orientation then score trial orientation. | + | ======Loops with GrainSpotter====== |
| - | ===indexing | + | 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, | ||
| + | * 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 | ||
| + | * 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. | ||
| - | use : | + | There are several TIMEleSS tools to help you with this process |
| - | + | * [[processing:remove-used-gve-updated|timelessClearGVEGrains]] | |
| - | + | | |
| - | python idx_0.py | + | * [[processing:extracteulerangles|ExtractEulerAngles.py]] |
| - | + | ||
| - | + | ||
| - | in that script, you need to load your gve file (from ImageD11), your parameters file (from ImageD11) and your flt file (from peaksearch). Don't forget to specify the name of the ouput file. In the line myindexer.parameterobject.set_parameters, | + | |
| - | This script will pair every ring with all the other to index the peaks in grains. | + | |
| - | At the end, it will give you the number of grains it found. Once it is finish, the indexed grains are stored in a ubi file and you can get back the not indexed grains to run idx.py again with more generous parameters and try to found more grains with the left peaks. | + | |
| - | To end the indexing, we use : | + | |
| - | + | ||
| - | + | ||
| - | makemap.py | + | |
| - | + | ||
| - | + | ||
| - | To have a look at what you indexed, you can plot different things : (command for plot were written in a Xterm terminal) | + | |
| - | + | ||
| - | -the number of peaks in grains vs the error : | + | |
| - | + | ||
| - | -the number of peaks in a grain vs the intensity : | + | |
| - | from ImageD11.columnfile import | + | |
| - | c = columnfile(" | + | |
| - | c.parameters.loadparameters(" | + | |
| - | c.updateGeometry() | + | |
| - | clf() | + | |
| - | c.filter(c.tth< | + | |
| - | plot(c.tth[~(c.labels> | + | |
| - | or : | + | |
| - | to save it : c.writefile(" | + | |
| - | + | ||
| - | -plot tth vs intensity : | + | |
| - | plot(d.tth, d.sum_intensity," | + | |
| - | + | ||
| - | -?? | + | |
| - | + | ||
| - | plotgrainhist.py peaks_t0.flt parameters.prm t0.map .05 10 .25 | + | |
| - | + | ||
| - | + | ||
| - | ===Using only the best rings=== | + | |
| - | + | ||
| - | We run into the problem that in simulated datasets, a large number of peaks have an intensity below 1 and when saving the images, these intensities are rounded at 0. Consequently, | + | |
| - | + | ||
| - | To resolve this issue, we want to consider only peaks with large intensity. So, to select the rings we want to | + | |
| - | use : | + | |
| - | + | ||
| - | | + | |
| - | + | ||
| - | After that, run again the indexation (idx_0.py) with your new flt file. | + | |
| - | + | ||
| - | For now, we still miss grains... | + | |
| + | An example of a GrainSpotter loop is provided in a [[processing: | ||
processing/indexing_with_grainspotter.1558030310.txt.gz · Last modified: by estelle
