aboutsummaryrefslogtreecommitdiff
path: root/julia/make-indexed.jl
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-04-18 14:32:14 +0200
committerThomas White <taw@physics.org>2024-04-18 14:32:14 +0200
commit52bde38abbcb53d163355a71fc9e99332ffe3dee (patch)
tree54bf334103708bcbf0b821c583b06f66769edf22 /julia/make-indexed.jl
parent536d1a563e5c93cbbefb3556ea897acaf8fa70ce (diff)
parent62a2fdee1b7e69a1fe1ecb58e286866c41b6bb81 (diff)
Merge branch 'julia'
Diffstat (limited to 'julia/make-indexed.jl')
-rw-r--r--julia/make-indexed.jl26
1 files changed, 26 insertions, 0 deletions
diff --git a/julia/make-indexed.jl b/julia/make-indexed.jl
new file mode 100644
index 00000000..7a24f606
--- /dev/null
+++ b/julia/make-indexed.jl
@@ -0,0 +1,26 @@
+using CrystFEL
+using Random
+
+# "Simulate" a diffraction pattern from the reflections
+function sketch_pattern(image, cr)
+ reflist = predictreflections(cr, image)
+ peaklist = PeakList()
+ for refl in reflist
+ if randn() > 0
+ let dpos = refl.detectorposition
+ push!(peaklist, dpos.fs, dpos.ss, dpos.panelnumber, 100.0)
+ end
+ end
+ end
+ return peaklist
+end
+
+
+dtempl = loaddatatemplate("julia/alignment-test.geom")
+cell = UnitCell(MonoclinicLattice, PrimitiveCell, 123, 45, 80, 90, 97, 90)
+indexer = Indexer("asdf", dtempl, cell, retry=false, multilattice=false, refine=true)
+
+image = Image(dtempl)
+cr = Crystal(rotatecell(cell))
+image.peaklist = sketch_pattern(image, cr)
+index(image, indexer)