本文整理汇总了Python中SANSUtility.get_start_q_and_end_q_values方法的典型用法代码示例。如果您正苦于以下问题:Python SANSUtility.get_start_q_and_end_q_values方法的具体用法?Python SANSUtility.get_start_q_and_end_q_values怎么用?Python SANSUtility.get_start_q_and_end_q_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SANSUtility
的用法示例。
在下文中一共展示了SANSUtility.get_start_q_and_end_q_values方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: provide_histo_workspace_with_one_spectrum
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import get_start_q_and_end_q_values [as 别名]
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)
示例2: test_that_correct_q_range_is_extracted_from_rescaleAndShift_object_which_lies_inside_the_data_range
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import get_start_q_and_end_q_values [as 别名]
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)