aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-01-22 14:14:55 +0100
committerThomas White <taw@physics.org>2024-02-06 16:59:35 +0100
commitf2829b1abb24be08a9f7214ec2d54ad9d142d7e7 (patch)
treefd04c98d42fc11111027798a69badeb96b13766f
parent2e3591c6bb4aff4b54a69b9ca38542562f8069e2 (diff)
Julia: Finish implementing partial_sim.jl
-rw-r--r--julia/partial_sim.jl17
1 files changed, 15 insertions, 2 deletions
diff --git a/julia/partial_sim.jl b/julia/partial_sim.jl
index 11384f47..efc621f9 100644
--- a/julia/partial_sim.jl
+++ b/julia/partial_sim.jl
@@ -1,7 +1,8 @@
using CrystFEL
-dtempl = loaddatatemplate("julia/alignment-test.geom")
-cell = UnitCell(MonoclinicLattice, PrimitiveCell, 123, 45, 80, 90, 97, 90)
+dtempl = loaddatatemplate("input.geom")
+cell = UnitCell(OrthorhombicLattice, PrimitiveCell, 40.0, 50.0, 60.0)
+full = loadreflist("input.hkl")
let st = Stream("partials.stream", "w", dtempl)
for i in 1:10
println("Writing image ", i)
@@ -11,6 +12,18 @@ let st = Stream("partials.stream", "w", dtempl)
image.ev = "//"
cr = Crystal(rotatecell(cell))
reflections = predictreflections(cr, image)
+ calculatepartialities!(reflections, cr, image, model=XSphereModel)
+ for refl in reflections
+ f = full[asymmetricindices(full.symmetry, refl.indices...)...]
+ if f !== nothing
+ refl.intensity = f.intensity * refl.partiality * refl.lorentzfactor
+ else
+ # No matching "full" intensity - can't do anything
+ # Reflections with zero measurements won't be written to file
+ refl.nmeasurements = 0
+ println("Not found: ", refl.indices)
+ end
+ end
push!(image, cr, reflections)
chunkwrite(st, image)
end