def get_spotfinder_data(self, params): pointdata = [] test_pattern = False if ( test_pattern is True and self.raw_image.__class__.__name__.find("CSPadDetector") >= 0 ): key_count = -1 for key, asic in self.raw_image._tiles.items(): key_count += 1 focus = asic.focus() for slow in range(0, focus[0], 20): for fast in range(0, focus[1], 20): slowpic, fastpic = self.flex_image.tile_readout_to_picture( key_count, slow, fast ) mr1, mr2 = self.picture_fast_slow_to_map_relative( fastpic, slowpic ) pointdata.append((mr1, mr2, {"data": key})) elif self.raw_image.__class__.__name__.find("CSPadDetector") >= 0: from cxi_xdr_xes.cftbx.spotfinder.speckfinder import spotfind_readout key_count = -1 for key, asic in self.raw_image._tiles.items(): key_count += 1 indexing = spotfind_readout( readout=asic, peripheral_margin=params.spotfinder.peripheral_margin ) for spot in indexing: slow = int(round(spot[0])) fast = int(round(spot[1])) slowpic, fastpic = self.flex_image.tile_readout_to_picture( key_count, slow, fast ) mr1, mr2 = self.picture_fast_slow_to_map_relative(fastpic, slowpic) pointdata.append((mr1, mr2, {"data": key})) else: from spotfinder.command_line.signal_strength import master_params working_params = master_params.fetch( sources=[] ) # placeholder for runtime mods working_params.show(expert_level=1) distl_params = working_params.extract() spotfinder, frameno = self.raw_image.get_spotfinder(distl_params) spots = spotfinder.images[frameno]["spots_total"] for spot in spots: mr = self.picture_fast_slow_to_map_relative( spot.max_pxl_y() + 0.5, spot.max_pxl_x() + 0.5 ) # spot.ctr_mass_y() + 0.5, spot.ctr_mass_x() + 0.5) pointdata.append(mr) return pointdata
def get_spotfinder_data(self, params): pointdata = [] test_pattern = False if test_pattern is True and self.raw_image.__class__.__name__.find("CSPadDetector") >= 0: key_count = -1 for key, asic in self.raw_image._tiles.iteritems(): key_count += 1 focus = asic.focus() for slow in xrange(0,focus[0],20): for fast in xrange(0,focus[1],20): slowpic,fastpic = self.flex_image.tile_readout_to_picture(key_count,slow,fast) mr1,mr2 = self.picture_fast_slow_to_map_relative(fastpic,slowpic) pointdata.append((mr1,mr2,{"data":key})) elif (self.raw_image.__class__.__name__.find("CSPadDetector") >= 0): from cxi_xdr_xes.cftbx.spotfinder.speckfinder import spotfind_readout key_count = -1 for key, asic in self.raw_image._tiles.iteritems(): key_count += 1 indexing = spotfind_readout( readout=asic, peripheral_margin=params.spotfinder.peripheral_margin) for spot in indexing: slow = int(round(spot[0])) fast = int(round(spot[1])) slowpic,fastpic = self.flex_image.tile_readout_to_picture(key_count,slow,fast) mr1,mr2 = self.picture_fast_slow_to_map_relative(fastpic,slowpic) pointdata.append((mr1,mr2,{"data":key})) else: from spotfinder.command_line.signal_strength import master_params working_params = master_params.fetch(sources = []) #placeholder for runtime mods working_params.show(expert_level=1) distl_params = working_params.extract() spotfinder,frameno = self.raw_image.get_spotfinder(distl_params) spots = spotfinder.images[frameno]["spots_total"] for spot in spots: mr = self.picture_fast_slow_to_map_relative( spot.max_pxl_y() + 0.5, spot.max_pxl_x() + 0.5) # spot.ctr_mass_y() + 0.5, spot.ctr_mass_x() + 0.5) pointdata.append(mr) return pointdata