Exemple #1
0
 def test_that_general_isis_default_values_are_set_up(self):
     state = StateMove()
     state.detectors = {
         DetectorType.to_string(DetectorType.LAB): StateMoveDetector(),
         DetectorType.to_string(DetectorType.HAB): StateMoveDetector()
     }
     self.assertTrue(state.sample_offset == 0.0)
     self.assertTrue(
         state.sample_offset_direction is CanonicalCoordinates.Z)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].x_translation_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].y_translation_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].z_translation_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].rotation_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].side_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].radius_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].x_tilt_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].y_tilt_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].z_tilt_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].sample_centre_pos1 == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(
         DetectorType.HAB)].sample_centre_pos2 == 0.0)
Exemple #2
0
 def test_that_raises_if_the_short_detector_name_is_not_set_up(self):
     state = StateMove()
     state.detectors = {DetectorType.to_string(DetectorType.LAB): StateMoveDetector(),
                        DetectorType.to_string(DetectorType.HAB): StateMoveDetector()}
     state.detectors[DetectorType.to_string(DetectorType.HAB)].detector_name = "test"
     state.detectors[DetectorType.to_string(DetectorType.LAB)].detector_name = "test"
     state.detectors[DetectorType.to_string(DetectorType.HAB)].detector_name_short = "test"
     assert_validate_error(self, ValueError, state)
     state.detectors[DetectorType.to_string(DetectorType.LAB)].detector_name_short = "test"
     assert_raises_nothing(self, state)
Exemple #3
0
 def test_that_raises_if_the_short_detector_name_is_not_set_up(self):
     state = StateMove()
     state.detectors = {DetectorType.to_string(DetectorType.LAB): StateMoveDetector(),
                        DetectorType.to_string(DetectorType.HAB): StateMoveDetector()}
     state.detectors[DetectorType.to_string(DetectorType.HAB)].detector_name = "test"
     state.detectors[DetectorType.to_string(DetectorType.LAB)].detector_name = "test"
     state.detectors[DetectorType.to_string(DetectorType.HAB)].detector_name_short = "test"
     assert_validate_error(self, ValueError, state)
     state.detectors[DetectorType.to_string(DetectorType.LAB)].detector_name_short = "test"
     assert_raises_nothing(self, state)
Exemple #4
0
 def test_that_general_isis_default_values_are_set_up(self):
     state = StateMove()
     state.detectors = {DetectorType.to_string(DetectorType.LAB): StateMoveDetector(),
                        DetectorType.to_string(DetectorType.HAB): StateMoveDetector()}
     self.assertTrue(state.sample_offset == 0.0)
     self.assertTrue(state.sample_offset_direction is CanonicalCoordinates.Z)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].x_translation_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].y_translation_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].z_translation_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].rotation_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].side_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].radius_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].x_tilt_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].y_tilt_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].z_tilt_correction == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].sample_centre_pos1 == 0.0)
     self.assertTrue(state.detectors[DetectorType.to_string(DetectorType.HAB)].sample_centre_pos2 == 0.0)