Skip to content

Segment issue when using datafind to grab minute-trend frames

Created by: tjma12

Since the /scratch/ directory has been down at LDAS LLO, datafind is pointing to minute trend frames that aren't accessible on disk and an error is thrown during a data retrieval call.

Example code and error reporting:

In [1]: from gwpy.timeseries import TimeSeries

In [2]: from glue import datafind

In [3]:

In [4]: start_gps = 1113030016

In [5]: end_gps = 1113030316

In [6]: ifo = 'L'

In [7]: frames = 'L1_M'

In [8]: connection = datafind.GWDataFindHTTPConnection()

In [9]: cache = connection.find_frame_urls(ifo, frames, start_gps, end_gps, urltype='file')

In [10]: chan1 = 'L1:FEC-7_ACCUM_OVERFLOW.max'

In [11]: data1=TimeSeries.read(cache, chan1, start=start_gps, end=end_gps)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (13, 0))

---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)

/mnt/home2/tjmassin/<ipython console> in <module>()

/mnt/home2/detchar/opt/gwpysoft/lib64/python2.6/site-packages/astropy/io/registry.pyc in read(cls, *args, **kwargs)
    324
    325         reader = get_reader(format, cls)
--> 326         data = reader(*args, **kwargs)
    327
    328         if not isinstance(data, cls):

/mnt/home2/detchar/opt/gwpysoft/lib64/python2.6/site-packages/gwpy/timeseries/io/cache.pyc in read_cache(cache, channel, start, end, resample, gap, nproc, format, **kwargs)
    103
    104     # check for gaps

--> 105     segs = cache_segments(cache, on_missing='ignore')
    106     if len(segs) != 1:
    107         gaps = SegmentList([cspan]) - segs

/mnt/home2/detchar/opt/gwpysoft/lib64/python2.6/site-packages/gwpy/io/cache.pyc in cache_segments(*caches, **kwargs)
    286             else:
    287                 seg |= e.segment
    288     # append final segment and return

--> 289     out.append(seg)
    290     return out

UnboundLocalError: local variable 'seg' referenced before assignment