processing:indexing_with_imaged11
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| processing:indexing_with_imaged11 [2019/05/17 11:58] – estelle | processing:indexing_with_imaged11 [2019/07/08 17:19] (current) – [Using only the best rings] matthias | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| [[software: | [[software: | ||
| The idea is based on the following: | The idea is based on the following: | ||
| - | * Select 2 diffraction rings from your sample | + | * Select 2 diffraction rings from your sample, |
| - | * For each pair of peaks (one on each ring) | + | * For each pair of peaks (one on each ring): |
| - | * Test whether | + | * Test whether those 2 peaks could belong to the same grain, |
| - | * If so, calculate the corresponding grain orientation. | + | * If so, calculate the corresponding grain orientation, and generate a //test orientation// |
| - | * For each test orientation, generated above, look for for more peaks that could be assigned to this grain. If a given threshold is reached, accept the grain as a true grain. | + | * For each //test orientation// generated above, look for more peaks that could be assigned to this grain. If a given threshold is reached, accept the grain as a true grain. |
| - | ======Grain | + | The indexing |
| - | First, get a gve file from ImageD11 as seen before. | + | ===== First evaluation ===== |
| - | Then go in **ImageD11 | + | To start an indexing with ImageD11: |
| - | Use **Assign peaks to powder rings**. This command | + | |
| + | * Use '' | ||
| + | * Select a pair of 2 peaks in this list: Good peaks for indexing have a low multiplicity and lots of assigned g-vectors. Use the menu item '' | ||
| + | * Click '' | ||
| + | * From here you need to save the //.ubi// file (a file with a list of UBi matrices for indexed grains) with '' | ||
| - | Choose 2 peaks in the list : better peaks have low multiplicity and a lots of peaks expected. Use the **indexing > edit parameters** menu and enter the index of these rings in ring_1 and ring_2. | + | In a second stage, |
| - | In hit **indexing > generate trial orientation** then **indexing > score trial orientation**. At the end it qive you the number of grains indexed. | + | <code> |
| - | + | ||
| - | <WRAP center box 90%> | + | |
| makemap.py -p parameters.prm -f peaks_to.flt -u to.ubi -U t0.map --omega_slop=.25 -t .03 | makemap.py -p parameters.prm -f peaks_to.flt -u to.ubi -U t0.map --omega_slop=.25 -t .03 | ||
| - | </WRAP> | + | </code> |
| + | |||
| + | where \\ | ||
| + | '' | ||
| + | '' | ||
| + | '' | ||
| + | '' | ||
| + | '' | ||
| + | '' | ||
| + | '' | ||
| | | ||
| + | ===== Automatization of this indexing process ===== | ||
| - | <WRAP center box 90%> | + | You can copy the commands in a bash file like the idx_0.py |
| - | python | + | In that script, you need to load your //.gve// file (from ImageD11), your parameters file (from ImageD11) and your peaks file (from peaksearch). Don't forget to specify the name of the output |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | 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. | 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. | 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. | ||
| + | ==== Evaluate the results ==== | ||
| - | To have a look at what you indexed, you can plot different things : (command for plot were written in a Xterm terminal) | + | 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 : | + | === Plot the number of peaks in grains vs the error === |
| - | -the number of peaks in a grain vs the intensity : | + | Click '' |
| - | from ImageD11.columnfile import * | + | |
| - | c = columnfile(" | + | |
| - | c.parameters.loadparameters(" | + | |
| - | c.updateGeometry() | + | |
| - | clf() | + | |
| - | c.filter(c.tth< | + | |
| - | plot(c.tth[~(c.labels> | + | |
| - | or : plot(c.labels, | + | |
| - | to save it : c.writefile(" | + | |
| - | -plot tth vs intensity : | + | === Plot the number of peaks in a grain vs the intensity === |
| - | plot(d.tth, d.sum_intensity," | + | |
| - | -?? | + | from ImageD11.columnfile import * |
| + | c = columnfile(" | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | or: | ||
| + | | ||
| + | to save it | ||
| + | | ||
| - | plotgrainhist.py peaks_t0.flt parameters.prm t0.map .05 10 .25 | + | === Plot tth vs intensity === |
| + | | ||
| + | |||
| + | with d the variable containing the peaks | ||
| + | === More plotting options ... === | ||
| + | ?? | ||
| - | ===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 | + | |
| + | ==== 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 | ||
| To resolve this issue, we want to consider only peaks with large intensity. So, to select the rings we want to | To resolve this issue, we want to consider only peaks with large intensity. So, to select the rings we want to | ||
| use : | use : | ||
| - | python pickrings.py ../ | + | python pickrings.py ../ |
| - | After that, run again the indexation (idx_0.py) with your new flt file. | + | The inputs are : |
| + | *the name of the peak file you use | ||
| + | *the name of the parameters file from ImageD11 | ||
| + | *the name of the output file (with the //.flt// extension) | ||
| + | |||
| + | After that, run again the indexation ('' | ||
| For now, we still miss grains... | For now, we still miss grains... | ||
| + | |||
| + | === Using only the peaks of the selected phase === | ||
| + | This script is able to select the 2theta angles corresponding to a certain phase and save only the peaks on these angles in a peaks file (//.flt//). | ||
| + | |||
| + | First, get the script from github: | ||
| + | git clone http:// | ||
| + | cp ImageD11/ | ||
| + | |||
| + | Then open ImageD11 and load the peaks file with ('' | ||
| + | |||
| + | Now you can run the script: | ||
| + | |||
| + | | ||
| + | |||
| + | The input parameters are: | ||
| + | * the peaks file you used in ImageD11 | ||
| + | * the parameters you used in ImageD11 | ||
| + | * the tth tolerance | ||
| + | * the tth max | ||
| + | * a name for the output file (with the extension //.flt// at the end); | ||
| + | * the minimum number of peaks intensity (in pixels) you want for the cut (zero if you want to use all peaks) | ||
| + | * the number of peaks per ring (put a really large number to be sure to have them all) | ||
| + | |||
| + | It should show a plot of the whole data set vs the peaks it will keep. If you have problem with the plot output, you must set up your matplot configuration: | ||
| + | |||
| + | | ||
| + | |||
| + | vi ~/ | ||
| + | |||
| + | and then activate the TKAgg backend. | ||
| + | |||
| + | When you import the new peaks file in ImageD11 tth/eta plot, you will have only the selected peaks. | ||
| + | |||
| + | The idea of this script is to index one phase after another and be able to remove the peaks of the grains indexed. This will avoid reusing already indexed peaks and make the indexing of the weaker phases easier. | ||
| + | |||
| + | {{: | ||
| + | {{: | ||
processing/indexing_with_imaged11.1558087132.txt.gz · Last modified: by estelle
