sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Filtering an empty MSID object gives an exception #77

Closed taldcroft closed 8 years ago

taldcroft commented 8 years ago
In [24]: d = events.dwells.filter(obsid=51641)[0]
In [25]: dat = fetch.Msid('AOATTER1', d.tstart + 40, d.tstart + 50)
In [26]: dat.remove_intervals(events.dwells)
In [27]: dat.vals
Out[27]: array([], dtype=float32)

In [28]: dat.remove_intervals(events.dwells)
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-27-1cb5d09ad03d> in <module>()
----> 1 dat.remove_intervals(events.dwells)

/proj/sot/ska/arch/x86_64-linux_CentOS-5/lib/python2.7/site-packages/Ska.engarchive-0.36.5-py2.7.egg/Ska/engarchive/fetch.pyc in remove_intervals(self, intervals, copy)
    789         """
    790         obj = self.copy() if copy else self
--> 791         obj._filter_times(intervals, exclude=True)
    792         if copy:
    793             return obj

/proj/sot/ska/arch/x86_64-linux_CentOS-5/lib/python2.7/site-packages/Ska.engarchive-0.36.5-py2.7.egg/Ska/engarchive/fetch.pyc in _filter_times(self, intervals, exclude)
    864                                  % (tstart, tstop))
    865 
--> 866             if tstop < self.times[0] or tstart > self.times[-1]:
    867                 continue
    868 

IndexError: index 0 is out of bounds for axis 0 with size 0
taldcroft commented 8 years ago

Oops, this is an eng archive issue.