def testCalculateSlicesBeginningAndEnd(self):
     "one interval at the beginning and one at the end"
     secs = np.arange(10)
     inter = interval([0,3]) | interval([8,9])
     slices = ObsFile.calculateSlices(inter, secs)
     new = ObsFile.repackArray(secs, slices)
     self.assertTrue(npEquals(new, np.array([4,5,6,7])))
 def testCalculateSlicesMiddle(self):
     "one interval in the middle of the set of timestamps"
     secs = np.arange(10)
     inter = interval([2,6])
     slices = ObsFile.calculateSlices(inter, secs)
     self.assertEquals(slices, ["0:2","7:10"])
     new = ObsFile.repackArray(secs, slices)
     self.assertTrue(npEquals(new,np.array([0,1,7,8,9])))