本文整理汇总了Python中SANSUtility.get_error_corrected_front_and_rear_data_sets方法的典型用法代码示例。如果您正苦于以下问题:Python SANSUtility.get_error_corrected_front_and_rear_data_sets方法的具体用法?Python SANSUtility.get_error_corrected_front_and_rear_data_sets怎么用?Python SANSUtility.get_error_corrected_front_and_rear_data_sets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SANSUtility
的用法示例。
在下文中一共展示了SANSUtility.get_error_corrected_front_and_rear_data_sets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_that_error_is_transferred
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import get_error_corrected_front_and_rear_data_sets [as 别名]
def test_that_error_is_transferred(self):
# Arrange
x1 = [1,2,3,4,5,6,7,8,9]
x2 = [1,2,3,4,5,6,7,8,9]
y1 = [2,2,2,2,2,2,2,2]
y2 = [2,2,2,2,2,2,2,2]
e1 = [1,1,1,1,1,1,1,1]
e2 = [2,2,2,2,2,2,2,2]
front, rear = self._createWorkspace(x1,y1, e1, x2, y2, e2)
x_min = 3
x_max = 7
# Act
f_return, r_return = su.get_error_corrected_front_and_rear_data_sets(front, rear,x_min, x_max)
# Assert
self.assertEqual(5, len(f_return.dataX(0)))
self.assertEqual(5, len(r_return.dataX(0)))
expected_errors_in_rear = [np.sqrt(5),np.sqrt(5),np.sqrt(5),np.sqrt(5)]
self.assertTrue(expected_errors_in_rear[0] == r_return.dataE(0)[0])
self.assertTrue(expected_errors_in_rear[1] == r_return.dataE(0)[1])
self.assertTrue(expected_errors_in_rear[2] == r_return.dataE(0)[2])
self.assertTrue(expected_errors_in_rear[3] == r_return.dataE(0)[3])
# Clean up
DeleteWorkspace(front)
DeleteWorkspace(rear)