Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering an empty MSID object gives an exception #123

Open
taldcroft opened this issue Apr 25, 2016 · 0 comments
Open

Filtering an empty MSID object gives an exception #123

taldcroft opened this issue Apr 25, 2016 · 0 comments

Comments

@taldcroft
Copy link
Member

taldcroft commented Apr 25, 2016

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

See also discussion in sot/kadi#76.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant