def _filter_reflections(self, params, experiments, reflections): ''' Filter the reflections to integrate. ''' from dials.util.command_line import Command from dials.algorithms import filtering from dials.array_family import flex # Set all reflections which overlap bad pixels to zero Command.start('Filtering reflections by detector mask') if experiments[0].scan == None: array_range = 1 else: array_range = experiments[0].scan.get_array_range() mask = filtering.by_detector_mask( reflections['bbox'], experiments[0].imageset.get_raw_data(0)[0] >= 0, array_range) reflections.del_selected(not mask) Command.end('Filtered %d reflections by detector mask' % len(reflections)) # Filter the reflections by zeta min_zeta = params.integration.filter.by_zeta if min_zeta > 0: Command.start('Filtering reflections by zeta >= %f' % min_zeta) zeta = reflections.compute_zeta(experiments[0]) reflections.del_selected(flex.abs(zeta) < min_zeta) n = len(reflections) Command.end('Filtered %d reflections by zeta >= %f' % (n, min_zeta)) return reflections
def _filter_reflections(self, params, experiments, reflections): ''' Filter the reflections to integrate. ''' from dials.util.command_line import Command from dials.algorithms import filtering from dials.array_family import flex # Set all reflections which overlap bad pixels to zero Command.start('Filtering reflections by detector mask') if experiments[0].scan == None: array_range = 1 else: array_range = experiments[0].scan.get_array_range() mask = filtering.by_detector_mask( reflections['bbox'], experiments[0].imageset.get_raw_data(0)[0] >= 0, array_range) reflections.del_selected(not mask) Command.end('Filtered %d reflections by detector mask' % len(reflections)) # Filter the reflections by zeta min_zeta = params.integration.filter.by_zeta if min_zeta > 0: Command.start('Filtering reflections by zeta >= %f' % min_zeta) zeta = reflections.compute_zeta(experiments[0]) reflections.del_selected(flex.abs(zeta) < min_zeta) n = len(reflections) Command.end('Filtered %d reflections by zeta >= %f' % (n, min_zeta)) return reflections