examples:gs_loop_olivine
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| restricted:gs_loop_olivine [2019/12/05 11:18] – created smerkel | examples:gs_loop_olivine [2023/12/09 23:21] (current) – ↷ Page moved from restricted:gs_loop_olivine to examples:gs_loop_olivine smerkel | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| The loop can run //nLoops// indexings (typically 3). For each, the loop runs | The loop can run //nLoops// indexings (typically 3). For each, the loop runs | ||
| - | * 6 iterations of 100000 GrainSpotter orientation searches with the following | + | * 6 iterations of 100000 GrainSpotter orientation searches with the following |
| + | <WRAP center indent 60%> | ||
| + | * min< | ||
| + | * min< | ||
| + | * Δ<sub>2θ</ | ||
| + | * Δ<sub>η</ | ||
| + | * Δ<sub>ω</ | ||
| + | * maximum deviation n< | ||
| + | </ | ||
| + | * 5 iterations of 100000 GrainSpotter orientation searches with | ||
| + | <WRAP center indent 60%> | ||
| + | * min< | ||
| + | * min< | ||
| + | * Δ< | ||
| + | * Δ< | ||
| + | * Δ< | ||
| + | * maximum deviation n< | ||
| + | </ | ||
| + | * 5 iterations of 100000 GrainSpotter orientation searches with | ||
| + | <WRAP center indent 60%> | ||
| + | * min< | ||
| + | * min< | ||
| + | * Δ< | ||
| + | * Δ< | ||
| + | * Δ< | ||
| + | * maximum deviation n< | ||
| + | </ | ||
| + | * 5 iterations of 100000 GrainSpotter orientation searches with | ||
| + | <WRAP center indent 60%> | ||
| + | * min< | ||
| + | * min< | ||
| + | * Δ< | ||
| + | * Δ< | ||
| + | * Δ< | ||
| + | * maximum deviation n< | ||
| + | </ | ||
| + | * 5 iterations of 100000 GrainSpotter orientation searches with | ||
| + | <WRAP center indent 60%> | ||
| + | * min< | ||
| + | * min< | ||
| + | * Δ< | ||
| + | * Δ< | ||
| + | * Δ< | ||
| + | * maximum deviation n< | ||
| + | </ | ||
| + | |||
| + | At the end of the loop, all results for the corresponding loop number are saved in a folder called '' | ||
| + | |||
| + | ===== Getting some idea on indexing capabilities ===== | ||
| + | |||
| + | There is now a dedicated TIMEleSS tool to [[evaluation: | ||
| + | |||
| + | ===== The loop ===== | ||
| + | |||
| + | You wanted it?! Here is the source code for the loop above | ||
| + | |||
| + | <code bash gsLoop.sh> | ||
| + | # | ||
| + | |||
| + | # Starting GVE file | ||
| + | startGVE=../ | ||
| + | # Starting GVE file | ||
| + | crystalSymmetryCode=3 | ||
| + | # Number of indexings | ||
| + | nLoops=3 | ||
| + | |||
| + | # Update parameters above as well as in | ||
| + | # - create_GS_init | ||
| + | # - fine details in indexing_loop | ||
| + | |||
| + | # Location of executables | ||
| + | GrainSpotter=/ | ||
| + | clearGVE=/ | ||
| + | mergeGrains=/ | ||
| + | extractEuler=timelessExtractEulerAngles | ||
| + | |||
| + | # Global parameter. Used to pass list of files between functions | ||
| + | grainlist="" | ||
| + | |||
| + | # | ||
| + | # | ||
| + | # Call to create GrainSpotter input | ||
| + | # 3 parameters | ||
| + | # - first: name of GrainSpotter output file | ||
| + | # - second: name gve file | ||
| + | # - third: name of grain output file | ||
| + | # - forth : min_measurments | ||
| + | # - fifth : min_completeness | ||
| + | # - sixth : sigma_tth | ||
| + | # - seventh : sigma_eta | ||
| + | # - eighth : sigma_omega | ||
| + | # | ||
| + | # | ||
| + | create_GS_init () { | ||
| + | cat > $1 <<- EOM | ||
| + | spacegroup 62 ! spacegroup [space group nr] | ||
| + | ! dsrange 0 0.34 ! dsrange [min max], d-spacing range, multiple ranges can be specified | ||
| + | tthrange 2 10.2 ! tthrange [min max], multiple ranges can be specified | ||
| + | ! tthrange 2 8.8 ! tthrange [min max], multiple ranges can be specified | ||
| + | ! tthrange 9 10.2 ! tthrange [min max], multiple ranges can be specified | ||
| + | tthrange 10.5 14.4 ! tthrange [min max], multiple ranges can be specified | ||
| + | ! tthrange 14.6 17 ! tthrange [min max], multiple ranges can be specifie | ||
| + | etarange 0 360 ! etarange [min max], multiple ranges can be specified | ||
| + | domega 0.5 ! domega [stepsize] in omega, degrees | ||
| + | omegarange -21 13 ! omegarange [min max] degrees, multiple ranges can be specified | ||
| + | filespecs $2 $3 ! filespecs [gvecsfile grainsfile] | ||
| + | cuts $4 $5 0.5 ! cuts [min_measuments min_completeness min_uniqueness] | ||
| + | eulerstep 5 ! eulerstep [stepsize] : angle step size in Euler space | ||
| + | uncertainties $6 $7 $8 ! 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 | ||
| + | EOM | ||
| + | } | ||
| + | |||
| + | |||
| + | # | ||
| + | # | ||
| + | # Actual indexing loop | ||
| + | # Runs tens of GrainSpotter iterations with decreasing tolerances | ||
| + | # Runs in the current folder | ||
| + | # | ||
| + | # | ||
| + | |||
| + | indexing_loop () { | ||
| + | |||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Running first GS iteration. Starting from $startGVE, GS parameters in index-0.ini, | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | create_GS_init index-0.ini $startGVE grains-0.log 20 0.5 0.06 1 1 | ||
| + | $GrainSpotter index-0.ini | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Done with iteration 0. New list of GVE will be peaks_after_step-0.gve" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | $clearGVE grains-0.log $startGVE peaks_after_step-0.gve | ||
| + | grainlist=" | ||
| + | |||
| + | for i in {1..5} | ||
| + | do | ||
| + | j=" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Running GS iteration $i. Starting from peaks_after_step-$j.gve, | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | # Use from previous step and create grains$i.log | ||
| + | create_GS_init index-$i.ini peaks_after_step-$j.gve grains-$i.log 20 0.5 0.06 1 1 | ||
| + | $GrainSpotter index-$i.ini | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Done with iteration $i. New list of GVE will be peaks_after_step-$i.gve" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | $clearGVE grains-$i.log peaks_after_step-$j.gve peaks_after_step-$i.gve | ||
| + | grainlist=" | ||
| + | done | ||
| + | |||
| + | for i in {6..10} | ||
| + | do | ||
| + | j=" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Running GS iteration $i. Starting from peaks_after_step-$j.gve, | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | create_GS_init index-$i.ini peaks_after_step-$j.gve grains-$i.log 20 0.5 0.06 2 2 | ||
| + | $GrainSpotter index-$i.ini | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Done with iteration $i. New list of GVE will be peaks_after_step-$i.gve" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | # Remove peaks that have been indexed | ||
| + | $clearGVE grains-$i.log peaks_after_step-$j.gve peaks_after_step-$i.gve | ||
| + | grainlist=" | ||
| + | done | ||
| + | |||
| + | for i in {11..15} | ||
| + | do | ||
| + | j=" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Running GS iteration $i. Starting from peaks_after_step-$j.gve, | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | create_GS_init index-$i.ini peaks_after_step-$j.gve grains-$i.log 20 0.3 0.06 2 2 | ||
| + | $GrainSpotter index-$i.ini | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Done with iteration $i. New list of GVE will be peaks_after_step-$i.gve" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | # Remove peaks that have been indexed | ||
| + | $clearGVE grains-$i.log peaks_after_step-$j.gve peaks_after_step-$i.gve | ||
| + | grainlist=" | ||
| + | done | ||
| + | |||
| + | |||
| + | for i in {16..20} | ||
| + | do | ||
| + | j=" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Running GS iteration $i. Starting from peaks_after_step-$j.gve, | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | # Use from previous step and create grains$i.log | ||
| + | create_GS_init index-$i.ini peaks_after_step-$j.gve grains-$i.log 20 0.3 0.06 3 3 | ||
| + | $GrainSpotter index-$i.ini | ||
| + | # Remove peaks that have been indexed | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Done with iteration $i. New list of GVE will be peaks_after_step-$i.gve" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | $clearGVE grains-$i.log peaks_after_step-$j.gve peaks_after_step-$i.gve | ||
| + | grainlist=" | ||
| + | done | ||
| + | |||
| + | for i in {21..25} | ||
| + | do | ||
| + | j=" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Running GS iteration $i. Starting from peaks_after_step-$j.gve, | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | # Use from previous step and create grains$i.log | ||
| + | create_GS_init index-$i.ini peaks_after_step-$j.gve grains-$i.log 20 0.3 0.1 3 3 | ||
| + | $GrainSpotter index-$i.ini | ||
| + | # Remove peaks that have been indexed | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | echo "# Done with iteration $i. New list of GVE will be peaks_after_step-$i.gve" | ||
| + | echo "#" | ||
| + | echo "#" | ||
| + | $clearGVE grains-$i.log peaks_after_step-$j.gve peaks_after_step-$i.gve | ||
| + | grainlist=" | ||
| + | done | ||
| + | |||
| + | } | ||
| + | |||
| + | # | ||
| + | # | ||
| + | # Indexing loop, runs tens of GrainSpotter iterations with decreasing tolerances | ||
| + | # Runs in the current folder | ||
| + | # | ||
| + | # | ||
| + | |||
| + | for (( loop=1; loop< | ||
| + | do | ||
| + | echo "# | ||
| + | echo "#" | ||
| + | echo "# Full indexing loop number $loop" | ||
| + | echo "# Data saved in folder: Indexing-$loop" | ||
| + | echo "#" | ||
| + | echo "# | ||
| + | echo "" | ||
| + | folder=" | ||
| + | \rm -rf $folder | ||
| + | mkdir $folder | ||
| + | |||
| + | grainlist="" | ||
| + | indexing_loop | ||
| + | $mergeGrains -c $crystalSymmetryCode -o merge $grainlist | ||
| + | $extractEuler -o merge-grains-euler.txt merge-grains.log | ||
| + | mv grains-* $folder | ||
| + | mv peaks_after_step* $folder | ||
| + | mv merge-* | ||
| + | mv index-*.ini | ||
| + | |||
| + | echo "" | ||
| + | echo "" | ||
| + | echo "# | ||
| + | echo "#" | ||
| + | echo "# Done with indexing loop number $loop" | ||
| + | echo "# Data saved in folder: Indexing-$loop" | ||
| + | echo "#" | ||
| + | echo "# | ||
| + | echo "" | ||
| + | echo "" | ||
| + | done | ||
| + | |||
| + | exit | ||
| + | </ | ||
examples/gs_loop_olivine.1575541112.txt.gz · Last modified: by smerkel
