aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-01-19 15:11:02 +0100
committerThomas White <taw@physics.org>2024-02-06 16:59:35 +0100
commit66f11f47e070c265a00b36b9517229d7e40f040a (patch)
tree78b4fbd89097865950a8d200791ce0342f7912b4
parentab4388d91a76841b4210840e17b94de826149b84 (diff)
Tweak alignment-test.jl
-rw-r--r--julia/alignment-test.jl12
1 files changed, 9 insertions, 3 deletions
diff --git a/julia/alignment-test.jl b/julia/alignment-test.jl
index 4316755f..f5abe334 100644
--- a/julia/alignment-test.jl
+++ b/julia/alignment-test.jl
@@ -3,7 +3,7 @@ using Random
using Plots
using MillepedeII
-# "Simulate" a diffraction pattern from the reflections
+# "Simulate" a diffraction pattern
function sketch_pattern(image, cr)
reflist = predictreflections(cr, image)
peaklist = PeakList()
@@ -24,11 +24,17 @@ function simulate_and_index(cell, image_true, dtempl_moved, mille, n)
for i in 1:n
+ # Create a diffraction pattern for a random orientation
cr = Crystal(rotatecell(cell))
peaklist = sketch_pattern(image_true, cr)
- image_moved = Image(dtempl_moved)
+ # Make an image with the correct spot positions,
+ # but with an incorrect geometry
+ image_moved = Image(dtempl_moved)
image_moved.peaklist = peaklist
+
+ # Index the pattern (and store Mille data),
+ # based on the incorrect geometry
index(image_moved, indexer, mille=mille)
if i % 100 == 0
@@ -47,7 +53,7 @@ dtempl_true = loaddatatemplate("julia/alignment-test.geom")
image_true = Image(dtempl_true)
cell = UnitCell(MonoclinicLattice, PrimitiveCell, 123, 45, 80, 90, 97, 90)
dtempl_moved = loaddatatemplate("julia/alignment-test.geom")
-translategroup(dtempl_moved, "q0", 200e-6, 0, 0)
+translategroup(dtempl_moved, "q1", 200e-6, 0, 0)
let mille = Mille("mille.dat")
simulate_and_index(cell, image_true, dtempl_moved, mille, 100)
close(mille)