# for k in range(shoebox.all()[0]): # print diff.as_numpy_array()[k].astype(numpy.int32) # pylab.imshow(diff.as_numpy_array()[k], vmin = flex.min(diff), vmax = flex.max(diff)) # pylab.show() from dials.algorithms.integration import Summation3d, ProfileFittingReciprocalSpace # integrate = Summation3d() # integrate(sweep, crystal, ref_list) from dials.algorithms.reflection_basis import transform as rbt from dials.algorithms.integration import ProfileFittingReciprocalSpaceAlgorithm spec = rbt.TransformSpec(sweep, crystal, 3, 4) rbt.forward_batch(spec, ref_list) prof = ref_list[0].transformed_shoebox bprof = ref_list[0].transformed_shoebox_background for k in range(9): # pylab.imshow(bprof.as_numpy_array()[k], vmin=flex.min(bprof), vmax=flex.max(bprof)) # pylab.show() print(bprof.as_numpy_array()[k].astype(numpy.int32)) print(flex.sum(prof), flex.sum(shoebox)) print(flex.sum(bprof), flex.sum(background)) r = ref_list[0] coord = r.image_coord_px + (r.frame_number,)
Command.start("Init transform") trans = transform.Forward(sweep, crystal, 3, 4) Command.end("Init transform") Command.start("Transform") for i in range(1): trans(refl) Command.end("Transform") Command.start("Init Transform") spec = transform.TransformSpec(sweep, crystal, 3, 4) Command.end("Init Transform") Command.start("Transform") for i in range(1): transform.forward_batch(spec, refl2) Command.end("Transform") assert len(refl) == len(refl2) for r1, r2 in zip(refl, refl2): assert r1.is_valid() == r2.is_valid() if r1.is_valid(): prof1 = r1.transformed_shoebox prof2 = r2.transformed_shoebox assert len(prof1) == len(prof2) diff = abs(prof1 - prof2) assert diff.all_lt(1e-7)
import numpy #for k in range(shoebox.all()[0]): # print diff.as_numpy_array()[k].astype(numpy.int32) # pylab.imshow(diff.as_numpy_array()[k], vmin = flex.min(diff), vmax = flex.max(diff)) # pylab.show() from dials.algorithms.integration import Summation3d, ProfileFittingReciprocalSpace #integrate = Summation3d() #integrate(sweep, crystal, ref_list) from dials.algorithms.reflection_basis import transform as rbt from dials.algorithms.integration import ProfileFittingReciprocalSpaceAlgorithm spec = rbt.TransformSpec(sweep, crystal, 3, 4) rbt.forward_batch(spec, ref_list) prof = ref_list[0].transformed_shoebox bprof = ref_list[0].transformed_shoebox_background for k in range(9): # pylab.imshow(bprof.as_numpy_array()[k], vmin=flex.min(bprof), vmax=flex.max(bprof)) # pylab.show() print bprof.as_numpy_array()[k].astype(numpy.int32) print flex.sum(prof), flex.sum(shoebox) print flex.sum(bprof), flex.sum(background) r = ref_list[0] coord = r.image_coord_px + (r.frame_number,)
Command.start('Init transform') trans = transform.Forward(sweep, crystal, 3, 4) Command.end('Init transform') Command.start('Transform') for i in range(1): trans(refl) Command.end('Transform') Command.start('Init Transform') spec = transform.TransformSpec(sweep, crystal, 3, 4) Command.end('Init Transform') Command.start('Transform') for i in range(1): transform.forward_batch(spec, refl2) Command.end('Transform') assert(len(refl) == len(refl2)) for r1, r2 in zip(refl, refl2): assert(r1.is_valid() == r2.is_valid()) if r1.is_valid(): prof1 = r1.transformed_shoebox prof2 = r2.transformed_shoebox assert(len(prof1) == len(prof2)) diff = abs(prof1 - prof2) assert(diff.all_lt(1e-7))