Example #1
0
 def recompute(O):
   w, h = O.GetSizeTuple()
   p = min(w, h)
   if (p == 0):
     O.reset_state()
     return False
   O.work_params.detector.pixels = (p, p)
   O.GetParent().wx_detector_pixels.SetLabel("%d x %d" % (p, p))
   O.update_active_wavelengths()
   work_phil_str = O.work_params.phil_master.format(O.work_params).as_str()
   if (   O.prev_work_phil_str is None
       or O.prev_work_phil_str != work_phil_str):
     O.prev_work_phil_str = work_phil_str
     from rstbx.simage.create import compute_image
     wp = O.work_params
     O.pixels = compute_image(wp)
     saturation = int(wp.signal_max * wp.saturation_level + 0.5)
     O.image = O.pixels.as_rgb_scale_string(
       rgb_scales_low=(1,1,1),
       rgb_scales_high=(1,0,0),
       saturation=saturation)
     O.pixels_2 = compute_image(wp, use_wavelength_2=True)
     O.image_2 = O.pixels_2.as_rgb_scale_string(
       rgb_scales_low=(1,1,1),
       rgb_scales_high=(0,0,1),
       saturation=saturation)
   return True
Example #2
0
 def recompute(O):
     w, h = O.GetSizeTuple()
     p = min(w, h)
     if (p == 0):
         O.reset_state()
         return False
     O.work_params.detector.pixels = (p, p)
     O.GetParent().wx_detector_pixels.SetLabel("%d x %d" % (p, p))
     O.update_active_wavelengths()
     work_phil_str = O.work_params.phil_master.format(
         O.work_params).as_str()
     if (O.prev_work_phil_str is None
             or O.prev_work_phil_str != work_phil_str):
         O.prev_work_phil_str = work_phil_str
         from rstbx.simage.create import compute_image
         wp = O.work_params
         O.pixels = compute_image(wp)
         saturation = int(wp.signal_max * wp.saturation_level + 0.5)
         O.image = O.pixels.as_rgb_scale_string(rgb_scales_low=(1, 1, 1),
                                                rgb_scales_high=(1, 0, 0),
                                                saturation=saturation)
         O.pixels_2 = compute_image(wp, use_wavelength_2=True)
         O.image_2 = O.pixels_2.as_rgb_scale_string(rgb_scales_low=(1, 1,
                                                                    1),
                                                    rgb_scales_high=(0, 0,
                                                                     1),
                                                    saturation=saturation)
     return True
Example #3
0
File: tst.py Project: dials/cctbx
 def check(args, expected_block):
     sio = StringIO()
     work_params = create.process_args(args=args, out=sio)
     assert not block_show_diff(sio.getvalue(), expected_block)
     pixels = create.compute_image(work_params)
     assert pixels.all() == tuple(work_params.detector.pixels)
Example #4
0
 def check(args, expected_block):
   sio = StringIO()
   work_params = create.process_args(args=args, out=sio)
   assert not block_show_diff(sio.getvalue(), expected_block)
   pixels = create.compute_image(work_params)
   assert pixels.all() == tuple(work_params.detector.pixels)