示例#1
0
 def test_span_roi(self):
     s = self.s
     srx = roi.SpanROI(left=1.5, right=10)
     sry = roi.SpanROI(left=-1000, right=2)
     assert_array_equal(s.inav[srx, :].data, s.inav[1.5:10., ].data)
     assert_array_equal(s.inav[srx, sry].data, s.inav[1.5:10.,
                                                      -1000.:2.].data)
示例#2
0
def test_signal_range_from_roi():
    sr = roi.SpanROI(20, 50)
    left, right = signal_range_from_roi(sr)
    assert left == 20
    assert right == 50
    left, right = signal_range_from_roi((20, 50))
    assert left == 20
    assert right == 50