def calc_from_real(self, positions_dict): phys_pos = dict(positions_dict) phys_pos['ai'] = deg2rad(phys_pos['ai']) phys_pos['dtz'] = deg2rad(phys_pos['dtz']) phys_pos['lmchi'] = deg2rad(phys_pos['lmchi']) result = Diffract.calc_virt(phys_pos, self) result['mu'] = rad2deg(result['mu']) result['gamma'] = rad2deg(result['gamma']) result['delta'] = rad2deg(result['delta']) for mot, par in self.ParamMotors.items(): if self.has_extra[mot]: result[mot] = self[par] return result
def calc_from_real(self, positions_dict): phys_pos = dict(positions_dict) phys_pos['ai'] = deg2rad(phys_pos['ai']) phys_pos['dtz'] = deg2rad(phys_pos['dtz']) phys_pos['lmchi'] = deg2rad(phys_pos['lmchi']) result = Diffract.calc_virt(phys_pos, self) result['mu'] = rad2deg(result['mu']) result['gamma'] = rad2deg(result['gamma']) result['delta'] = rad2deg(result['delta']) for mot, par in self.ParamMotors.items(): if self.has_extra[mot]: result[mot] = self[par] return result
def calc_from_real(self, positions_dict): phys_pos = dict(positions_dict) phys_pos['ai'] = deg2rad(phys_pos['ai']) phys_pos['dtz'] = deg2rad(phys_pos['dtz']) phys_pos['lmchi'] = deg2rad(phys_pos['lmchi']) result = ID31_diffractometer.calc_virt(phys_pos, self) result['mu'] = rad2deg(result['mu']) result['gamma'] = rad2deg(result['gamma']) result['delta'] = rad2deg(result['delta']) if self.has_extra['ben']: result['ben'] = self['beam_energy'] if self.has_extra['bos']: result['bos'] = self['beam_offset'] return result
def calc_to_real(self, axis_tag, positions_dict): virt_pos = dict(positions_dict) bos = self['beam_offset'] if virt_pos.setdefault('bos', bos) != bos: self['beam_offset'] = virt_pos['bos'] ben = self['beam_energy'] if virt_pos.setdefault('ben', ben) != ben: self['beam_energy'] = virt_pos['ben'] virt_pos['mu'] = deg2rad(virt_pos['mu']) virt_pos['gamma'] = deg2rad(virt_pos['gamma']) virt_pos['delta'] = deg2rad(virt_pos['delta']) result = ID31_diffractometer.calc_phys(virt_pos, self) result['ai'] = rad2deg(result['ai']) result['dtz'] = rad2deg(result['dtz']) result['lmchi'] = rad2deg(result['lmchi']) return result
def calc_to_real(self, positions_dict): virt_pos = dict(positions_dict) for mot, par in self.ParamMotors.items(): curr = self[par] if virt_pos.setdefault(mot, curr) != curr: self[par] = virt_pos[mot] virt_pos['mu'] = deg2rad(virt_pos['mu']) virt_pos['gamma'] = deg2rad(virt_pos['gamma']) virt_pos['delta'] = deg2rad(virt_pos['delta']) result = Diffract.calc_phys(virt_pos, self) result['ai'] = rad2deg(result['ai']) result['dtz'] = rad2deg(result['dtz']) result['lmchi'] = rad2deg(result['lmchi']) if not self['detector_active']: for mot in self.DetMotors: result.pop(mot) return result
def calc_to_real(self, positions_dict): virt_pos = dict(positions_dict) for mot, par in self.ParamMotors.items(): curr = self[par] if virt_pos.setdefault(mot, curr) != curr: self[par] = virt_pos[mot] virt_pos['mu'] = deg2rad(virt_pos['mu']) virt_pos['gamma'] = deg2rad(virt_pos['gamma']) virt_pos['delta'] = deg2rad(virt_pos['delta']) result = Diffract.calc_phys(virt_pos, self) result['ai'] = rad2deg(result['ai']) result['dtz'] = rad2deg(result['dtz']) result['lmchi'] = rad2deg(result['lmchi']) if not self['detector_active']: for mot in self.DetMotors: result.pop(mot) return result
def get_q(self, axis, th): return Diffract.calc_q(self['beam_energy'], deg2rad(th))
def get_lm_2th(self, axis): lm_2th = Diffract.calc_lm_2th(self['liquid_mode'], self['beam_energy']) return rad2deg(lm_2th)
def get_lm_2th(self, axis): lm_2th = ID31_diffractometer.calc_lm_2th(self['liquid_mode'], self['beam_energy']) return rad2deg(lm_2th)
def get_q(self, axis, th): return Diffract.calc_q(self['beam_energy'], deg2rad(th))