From f2829b1abb24be08a9f7214ec2d54ad9d142d7e7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 22 Jan 2024 14:14:55 +0100 Subject: Julia: Finish implementing partial_sim.jl --- julia/partial_sim.jl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'julia') 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 -- cgit v1.2.3