DataQualityDict.populate breaks when invoked with pad=True
Created by: tjma12
Using a DataQualityDict
to read a veto definer and populate the dictionary breaks when run with pad=True
, which is the default for this method.
Example below:
In [1]: from gwpy.segments import DataQualityFlag, DataQualityDict, SegmentList, Segment
In [2]: import numpy as np
In [3]: start = 1186775580.
In [4]: end = start + 100.
In [5]: science = DataQualityFlag.query('L1:DCS-ANALYSIS_READY_C02', start, end, url='https://segments.ligo.org')
In [6]: vdf= '/home/thomas.massinger/git/veto-definitions/cbc/O2/H1L1-CBC_VETO_DEFINER_CLEANED_C02_O2_1164556817-23176801.xml'
In [7]: vetoes = DataQualityDict.from_veto_definer_file(vdf, start=start, end=end, format='ligolw', ifo='L1')
In [8]: vetoes.populate(source='https://segments.ligo.org', segments=science.active)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-8-565ca0a55839> in <module>()
----> 1 vetoes.populate(source='https://segments.ligo.org', segments=science.active)
/usr/lib/python2.7/site-packages/gwpy/segments/flag.pyc in populate(self, source, segments, pad, on_error, **kwargs)
1590 self[key].active = tmp[key].active
1591 if pad:
-> 1592 self[key] = self[key].pad(inplace=True)
1593 if segments is not None:
1594 self[key].known &= segments
/usr/lib/python2.7/site-packages/gwpy/segments/flag.pyc in pad(self, *args, **kwargs)
809 raise TypeError("unexpected keyword argument %r"
810 % list(kwargs.keys())[0])
--> 811 new.known = [(s[0]+start, s[1]+end) for s in self.known]
812 new.active = [(s[0]+start, s[1]+end) for s in self.active]
813 return new
TypeError: in method 'LIGOTimeGPS___add__', argument 2 of type 'LIGOTimeGPS *'