Exemplo n.º 1
0
 def _check_angles_to_hkl(self, testname, zrot, yrot, hkl_expected, pos,
                          wavelength, virtual_expected={}):
     print ('_check_angles_to_hkl(%s, %.1f, %.1f, %s, %s, %.2f, %s)' %
            (testname, zrot, yrot, hkl_expected, pos, wavelength,
             virtual_expected))
     self.zrot, self.yrot = zrot, yrot
     self._configure_ub()
     hkl, virtual = self.calc.anglesToHkl(pos, wavelength)
     assert_array_almost_equal(hkl, hkl_expected, self.places, note="***Test (not diffcalc!) incorrect*** : the desired settings do not map to the target hkl")
     assert_second_dict_almost_in_first(virtual, virtual_expected)
Exemplo n.º 2
0
 def _check_angles_to_hkl(self, testname, zrot, yrot, hkl_expected, pos,
                          wavelength, virtual_expected={}):
     print ('_check_angles_to_hkl(%s, %.1f, %.1f, %s, %s, %.2f, %s)' %
            (testname, zrot, yrot, hkl_expected, pos, wavelength,
             virtual_expected))
     self.zrot, self.yrot = zrot, yrot
     self._configure_ub()
     hkl, virtual = self.calc.anglesToHkl(pos, wavelength)
     assert_array_almost_equal(hkl, hkl_expected, self.places)
     assert_second_dict_almost_in_first(virtual, virtual_expected)
Exemplo n.º 3
0
 def _check_hkl_to_angles(self, testname, zrot, yrot, hkl, pos_expected,
                          wavelength, virtual_expected={}):
     print ('_check_hkl_to_angles(%s, %.1f, %.1f, %s, %s, %.2f, %s)' %
            (testname, zrot, yrot, hkl, pos_expected, wavelength,
             virtual_expected))
     self.zrot, self.yrot = zrot, yrot
     self._configure_ub()
     pos, virtual = self.calc.hklToAngles(hkl[0], hkl[1], hkl[2],
                                          wavelength)
     assert_array_almost_equal(pos.totuple(), pos_expected.totuple(),
                               self.places)
     assert_second_dict_almost_in_first(virtual, virtual_expected)
Exemplo n.º 4
0
 def _check_angles_to_hkl(self,
                          testname,
                          zrot,
                          yrot,
                          hkl_expected,
                          pos,
                          wavelength,
                          virtual_expected={}):
     print('_check_angles_to_hkl(%s, %.1f, %.1f, %s, %s, %.2f, %s)' %
           (testname, zrot, yrot, hkl_expected, pos, wavelength,
            virtual_expected))
     self.zrot, self.yrot = zrot, yrot
     self._configure_ub()
     hkl, virtual = self.calc.anglesToHkl(pos, wavelength)
     assert_array_almost_equal(hkl, hkl_expected, self.places)
     assert_second_dict_almost_in_first(virtual, virtual_expected)
Exemplo n.º 5
0
 def _check_hkl_to_angles(self,
                          testname,
                          zrot,
                          yrot,
                          hkl,
                          pos_expected,
                          wavelength,
                          virtual_expected={}):
     print('_check_hkl_to_angles(%s, %.1f, %.1f, %s, %s, %.2f, %s)' %
           (testname, zrot, yrot, hkl, pos_expected, wavelength,
            virtual_expected))
     self.zrot, self.yrot = zrot, yrot
     self._configure_ub()
     pos, virtual = self.calc.hklToAngles(hkl[0], hkl[1], hkl[2],
                                          wavelength)
     assert_array_almost_equal(pos.totuple(), pos_expected.totuple(),
                               self.places)
     assert_second_dict_almost_in_first(virtual, virtual_expected)
Exemplo n.º 6
0
 def _check_angles_to_hkl(self,
                          testname,
                          zrot,
                          yrot,
                          hkl_expected,
                          pos,
                          wavelength,
                          virtual_expected={}):
     print('_check_angles_to_hkl(%s, %.1f, %.1f, %s, %s, %.2f, %s)' %
           (testname, zrot, yrot, hkl_expected, pos, wavelength,
            virtual_expected))
     self.zrot, self.yrot = zrot, yrot
     self._configure_ub()
     hkl, virtual = self.calc.anglesToHkl(pos, wavelength)
     assert_array_almost_equal(
         hkl,
         hkl_expected,
         self.places,
         note=
         "***Test (not diffcalc!) incorrect*** : the desired settings do not map to the target hkl"
     )
     assert_second_dict_almost_in_first(virtual, virtual_expected)