Skip to content

Problem with Virgo filenames and ffl files

Created by: freise

I have been starting to use GWpy on Virgo machines (for commissioning). I encountered an error which looks like a bug similar to the one discussed here https://github.com/gwpy/gwpy/pull/911

When I run the file:

from gwpy.timeseries import TimeSeries
data1 = TimeSeries.get('V1:LSC_B7_DC_50Hz', 1316428074, 1316428076, verbose=False, frametype='rds')
print("ok 1")
data2 = TimeSeries.read('/virgoData/ffl/rds.ffl', 'V1:LSC_B7_DC_50Hz', start=1316428074, end=1316428076)
print("ok 2")
data3 = TimeSeries.get('V1:LSC_B7_DC_mean', 1316428074, 1316428076, verbose=False, frametype='trend')
print("ok 3")
data4 = TimeSeries.read('/virgoData/ffl/trend.ffl', 'V1:LSC_B7_DC_mean', start=1316428074, end=1316428076)
print("ok 4")

it gives the following error:

ok 1
ok 2
ok 3
Traceback (most recent call last):
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/io/cache.py", line 397, in file_segment
    return Segment(filename.segment)
AttributeError: 'str' object has no attribute 'segment'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/users/adf/data/bug.py", line 13, in <module>
    data4 = TimeSeries.read('/virgoData/ffl/trend.ffl', 'V1:LSC_B7_DC_mean', start=1316428074, end=1316428076)
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/timeseries/core.py", line 310, in read
    return timeseries_reader(cls, source, *args, **kwargs)
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/timeseries/io/core.py", line 35, in read
    source = preformat_cache(source, *args[1:],
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/timeseries/io/cache.py", line 54, in preformat_cache
    return read_cache(cache, sort=file_segment,
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/io/cache.py", line 177, in read_cache
    return read_cache(fobj, coltype=coltype, sort=sort,
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/io/cache.py", line 185, in read_cache
    cache = sieve(cache, segment=segment)
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/io/cache.py", line 471, in sieve
    return type(cache)(e for e in cache if segment.intersects(file_segment(e)))
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/io/cache.py", line 471, in <genexpr>
    return type(cache)(e for e in cache if segment.intersects(file_segment(e)))
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/io/cache.py", line 399, in file_segment
    return filename_metadata(filename)[2]
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/lib/python3.9/site-packages/gwpy/io/cache.py", line 357, in filename_metadata
    obs, desc, start, dur = name.split('-')
ValueError: Failed to parse 'V-694620000-09-Jan-2002-15h00-48F.T' as LIGO-T050017-compatible filename