Skip to content

TimeSeries.fetch_open_data reports wrong information if no 3rd party GWF library is installed

Created by: tpdownes

If you install only gwpy via pip and then execute

python3 -c "from gwpy.timeseries import TimeSeries; print(TimeSeries.fetch_open_data('H1', 1126259446, 1126259478))"

it informs the user that it was unable to find a LOSC dataset for the period in question.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/gwpy/timeseries/core.py", line 486, in fetch_open_data
    host=host, cls=cls, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/gwpy/timeseries/io/losc.py", line 322, in fetch_losc_data
    format=formats)
  File "/usr/local/lib/python3.6/site-packages/gwpy/timeseries/io/losc.py", line 248, in find_losc_urls
    % (detector, start, end))
ValueError: Cannot find a LOSC dataset for H1 covering [1126259446, 1126259478)

The underlying issue is that get_default_gwf_api() fails and the default file format searched for by find_losc_urls() is txt.gz. Of course, it doesn't find anything.

I'm not sure what the appropriate way to "solve" this is, but a more graceful error message may be in order. This seems like exactly the kind of thing a non-LIGO "open science" user might do and that LIGO people might have 1 or more copies of lalsuite/framecpp laying around that get detected.