Error in plot time domain data with filtfilt=True
I am trying to plot the observational data by plot_time_domain_data.
However, an IndexError is obtained when I set filtfilt=True.
For example, I run the example, plot_time_domain_data.py
[https://git.ligo.org/lscsoft/bilby/blob/master/examples/gw_examples/injection_examples/plot_time_domain_data.py](https://git.ligo.org/lscsoft/bilby/blob/master/examples/gw_examples/injection_examples/plot_time_domain_data.py),
then the following error appears.
> File "plot_time_domain_data.py", line 38, in <module>
t0=t0)
File "/usr/local/lib/python3.7/site-packages/bilby-0.5.9-py3.7.egg/bilby/gw/detector/interferometer.py", line 673, in plot_time_domain_data
strain = timeseries.filter(zpk, filtfilt=True)
File "/usr/local/lib/python3.7/site-packages/gwpy/timeseries/timeseries.py", line 1118, in filter
out = signal.sosfiltfilt(sos, self, **kwargs)
File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 3402, in sosfiltfilt
ntaps=ntaps)
File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 3204, in _validate_pad
ext = odd_ext(x, edge, axis=axis)
File "/usr/local/lib/python3.7/site-packages/scipy/signal/_arraytools.py", line 98, in odd_ext
left_end = axis_slice(x, start=0, stop=1, axis=axis)
File "/usr/local/lib/python3.7/site-packages/scipy/signal/_arraytools.py", line 45, in axis_slice
b = a[tuple(a_slice)]
File "/usr/local/lib/python3.7/site-packages/gwpy/types/series.py", line 596, in __getitem__
sliceutils.slice_axis_attributes(self, 'x', new, 'x', slice_)
File "/usr/local/lib/python3.7/site-packages/gwpy/types/sliceutils.py", line 75, in slice_axis_attributes
setattr(new, index(newaxis), getattr(old, index(oldaxis))[slice_])
File "/usr/local/lib/python3.7/site-packages/gwpy/types/series.py", line 319, in xindex
self._set_index("xindex", index)
File "/usr/local/lib/python3.7/site-packages/gwpy/types/series.py", line 225, in _set_index
setattr(self, delta, index[1] - index[0])
File "/usr/local/lib/python3.7/site-packages/gwpy/types/index.py", line 89, in __getitem__
item = super(Index, self).__getitem__(key)
File "/usr/local/lib/python3.7/site-packages/astropy/units/quantity.py", line 1038, in __getitem__
out = super().__getitem__(key)
IndexError: index 1 is out of bounds for axis 0 with size 1
If I set filtfilt=False, the error does not appear and I can obtain the time domain plot.
Thus, I think it may be a kind of bugs regarding filter settings.
I am using bilby 0.5.9 and python 3.7.
issue