def compute_d_single(self, experiment): ''' Compute the resolution for each reflection. :param experiment: The experimental models :return: The resolution for each reflection ''' from dials.array_family import flex uc = flex.unit_cell(1) uc[0] = experiment.crystal.get_unit_cell() self['d'] = uc.d(self['miller_index'], flex.size_t(len(self), 0)) return self['d']
def compute_d(self, experiments): ''' Compute the resolution for each reflection. :param experiments: The experiment list :return: The resolution for each reflection ''' from dials.array_family import flex uc = flex.unit_cell(len(experiments)) for i, e in enumerate(experiments): uc[i] = e.crystal.get_unit_cell() assert self['id'].all_ge(0) self['d'] = uc.d(self['miller_index'], flex.size_t(list(self['id']))) return self['d']