Exemple #1
0
 def test_that_correct_q_range_is_extracted_when_no_rescaleAndShift_is_applied_and_front_detector_data_lies_within_rear_detector_data(self):
     # Arrange
     front_q_min = 10
     front_q_max = 20
     front_name = "front_ws"
     rear_q_min = 1
     rear_q_max =30
     rear_name = "rear_ws"
     bin_width = 1 
     provide_histo_workspace_with_one_spectrum(rear_name, rear_q_min, rear_q_max, bin_width)
     provide_histo_workspace_with_one_spectrum(front_name, front_q_min, front_q_max, bin_width)
     rescale_shift = HelperRescaleShift(False, 1, 2)
     # Act
     result_q_min, result_q_max = su.get_start_q_and_end_q_values(rear_data_name = rear_name,
                                                                  front_data_name = front_name,
                                                                  rescale_shift = rescale_shift)
     # Assert
     self.assertEqual(10, result_q_min)
     self.assertEqual(20, result_q_max)
     # Clean up
     self._delete_workspace(front_name)
     self._delete_workspace(rear_name)
Exemple #2
0
 def test_that_correct_q_range_is_extracted_from_rescaleAndShift_object_which_lies_inside_the_data_range(self):
     # Arrange
     front_q_min = 10
     front_q_max = 20
     front_name = "front_ws"
     rear_q_min = 1
     rear_q_max =30
     rear_name = "rear_ws"
     bin_width = 1 
     provide_histo_workspace_with_one_spectrum(rear_name, rear_q_min, rear_q_max, bin_width)
     provide_histo_workspace_with_one_spectrum(front_name, front_q_min, front_q_max, bin_width)
     rescale_shift = HelperRescaleShift(True, 15, 17)
     # Act
     result_q_min, result_q_max = su.get_start_q_and_end_q_values(rear_data_name = rear_name,
                                                                  front_data_name = front_name,
                                                                  rescale_shift = rescale_shift)
     # Assert
     self.assertEqual(15, result_q_min)
     self.assertEqual(17, result_q_max)
     # Clean up
     self._delete_workspace(front_name)
     self._delete_workspace(rear_name)