本文整理汇总了Python中SANSUtility.correct_q_resolution_for_can方法的典型用法代码示例。如果您正苦于以下问题:Python SANSUtility.correct_q_resolution_for_can方法的具体用法?Python SANSUtility.correct_q_resolution_for_can怎么用?Python SANSUtility.correct_q_resolution_for_can使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SANSUtility
的用法示例。
在下文中一共展示了SANSUtility.correct_q_resolution_for_can方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_error_is_ignored_for_more_than_one_spectrum
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import correct_q_resolution_for_can [as 别名]
def test_error_is_ignored_for_more_than_one_spectrum(self):
# Arrange
orig_name = "orig"
can_name = "can"
result_name = "result"
provide_workspace_with_x_errors(orig_name, True, 2)
provide_workspace_with_x_errors(can_name, True, 2)
provide_workspace_with_x_errors(result_name, False, 2)
orig = mtd[orig_name]
can = mtd[can_name]
result = mtd[result_name]
# Act
su.correct_q_resolution_for_can(orig, can, result)
# Assert
self.assertFalse(result.hasDx(0))
# Clean up
DeleteWorkspace(orig)
DeleteWorkspace(can)
DeleteWorkspace(result)
示例2: test_error_is_not_passed_on_when_did_not_exist_beforehand
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import correct_q_resolution_for_can [as 别名]
def test_error_is_not_passed_on_when_did_not_exist_beforehand(self):
# Arrange
orig_name = "orig"
can_name = "can"
result_name = "result"
provide_workspace_with_x_errors(orig_name, False, 1)
provide_workspace_with_x_errors(can_name, False, 1)
provide_workspace_with_x_errors(result_name, False, 1)
orig = mtd[orig_name]
can = mtd[can_name]
result = mtd[result_name]
# Act
su.correct_q_resolution_for_can(orig, can, result)
# Assert
self.assertFalse(result.hasDx(0))
# Clean up
DeleteWorkspace(orig)
DeleteWorkspace(can)
DeleteWorkspace(result)
示例3: test_error_is_passed_from_original_to_subtracted_workspace
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import correct_q_resolution_for_can [as 别名]
def test_error_is_passed_from_original_to_subtracted_workspace(self):
# Arrange
orig_name = "orig"
can_name = "can"
result_name = "result"
provide_workspace_with_x_errors(orig_name, True)
provide_workspace_with_x_errors(can_name, True)
provide_workspace_with_x_errors(result_name, False)
orig = mtd[orig_name]
can = mtd[can_name]
result = mtd[result_name]
# Act
su.correct_q_resolution_for_can(orig, can, result)
# Assert
dx_orig = orig.dataDx(0)
dx_result = result.dataDx(0)
self.assertTrue(result.hasDx(0))
for index in range(0, len(dx_orig)):
self.assertEqual(dx_orig[index], dx_result[index])
# Clean up
DeleteWorkspace(orig)
DeleteWorkspace(can)
DeleteWorkspace(result)