Inconsistent behaviour between frread.read_timeseries() and frread.ts_from_cache()
According to the documentation here https://lscsoft.docs.ligo.org/lalsuite/lalframe/namespacelalframe_1_1frread.html, both frread.read_timeseries()
and frread.ts_from_cache()
take parameter channel
, which is "string name of channel, e.g. 'L1:LDAS-STRAIN', or a list of channel names".
However, when frread.ts_from_cache()
is presented with the string name of a channel, it attempts to iterate over the string, while frread.read_timeseries()
takes the string as-is.
geoffrey.mo@ldas-pcdev1:~$ python
Python 2.7.5 (default, Aug 2 2017, 11:05:32)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lal
>>> from lalframe import frread
>>> directory = '/archive/frames/O2/hoft/H1/H-H1_HOFT_C00-11880'
>>> globstring = 'H-H1_HOFT_C00-118807*'
>>> cache = lal.CacheGlob(directory, globstring)
>>> readtimeseries = frread.read_timeseries(cache, 'H1:DMT-DQ_VECTOR')
>>> readtsfromcache = frread.ts_from_cache(cache, 'H1:DMT-DQ_VECTOR')
XLAL Error - XLALFrameUFrChanRead_FrameL_ (LALFrameL.c:880): Channel H not found
XLAL Error - XLALFrameUFrChanRead_FrameL_ (LALFrameL.c:880): Wrong name
XLAL Error - XLALFrFileQueryChanType (LALFrameIO.c:155): Wrong name
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/geoffrey.mo/.local/lib/python2.7/site-packages/lalsuite-6.48.1.dev20180612-py2.7-linux-x86_64.egg/lalframe/frread.py", line 180, in ts_from_cache
datatype=datatype, verbose=verbose)
File "/home/geoffrey.mo/.local/lib/python2.7/site-packages/lalsuite-6.48.1.dev20180612-py2.7-linux-x86_64.egg/lalframe/frread.py", line 247, in ts_from_stream
datatype=datatype))
File "/home/geoffrey.mo/.local/lib/python2.7/site-packages/lalsuite-6.48.1.dev20180612-py2.7-linux-x86_64.egg/lalframe/frread.py", line 256, in read_channel_from_stream
frdatatype = lalframe.FrStreamGetTimeSeriesType(channel, stream)
RuntimeError: Wrong name
>>> readtsfromcacheList = frread.ts_from_cache(cache, ['H1:DMT-DQ_VECTOR'])