Closed maxtrevor closed 2 years ago
@maxtrevor Can you post how to reproduce this error?
I've been working on modifying the pycbc_live example to create a unit test for the implementation of idq into pycbc live. I'm trying to modify the fake strain frames to add simulated idq data to them. At @titodalcanton 's suggestion I modified one of the pycbc-live-utils here: https://github.com/maxtrevor/pycbc-live-utils/blob/add_idq/add_state_dq_vectors.py (Edit: updated link to point to correct branch) To reproduce this error, first run the pycbc live example loally. Run my modified add_state_dq_vectors.py with the following command:
python add_state_dq_vectors.py \
--input-file ./strain/H1/H1-SIMULATED_STRAIN-1272790000-512.gwf \
--strain-channel H1:SIMULATED_STRAIN \
--output-file ./H1-strain \
--idq-channel H1:SIMULATED_IDQ \
--random-seed 123 \
--idq-bad-times 1272790200 \
--idq-bad-pad 1
The full error produced is
XLALGPSSetREAL8(): overflow 137438937087.99997XLAL Error - XLALGPSSetREAL8 (/home/conda/feedstock_root/build_artifacts/lal-split_1647358259539/work/lib/date/XLALTime.c:83): Input domain error
XLALINT8NSToGPS(): overflow: 2456743920000021905XLAL Error - XLALINT8NSToGPS (/home/conda/feedstock_root/build_artifacts/lal-split_1647358259539/work/lib/date/XLALTime.c:53): Input domain error
Traceback (most recent call last):
File "/home/max.trevor/pycbc_live_dev/pycbc-live-utils/add_state_dq_vectors.py", line 127, in <module>
write_frame(args.output_file, out_channel_names, out_timeseries)
File "/home/max.trevor/.conda/envs/pycbc-live-mpich/lib/python3.9/site-packages/pycbc/frame/frame.py", line 395, in write_frame
gps_end_times = {series.end_time for series in timeseries}
File "/home/max.trevor/.conda/envs/pycbc-live-mpich/lib/python3.9/site-packages/pycbc/frame/frame.py", line 395, in <setcomp>
gps_end_times = {series.end_time for series in timeseries}
File "/home/max.trevor/.conda/envs/pycbc-live-mpich/lib/python3.9/site-packages/pycbc/types/timeseries.py", line 216, in get_end_time
return self._epoch + self.get_duration()
TypeError: unsupported operand type(s) for +: 'lal.LIGOTimeGPS' and 'float'
@maxtrevor In python adding from the left and the right are separate operators since they would be defined by different classes. (i.e. a + b -> a.add(b) vs b + a -> b.add(a)). What happens is that the ligo type is supposed to define how to add floats to itself, float doesn't know about LIGOTImeGPS at all, but doesn't have to since it will use the add definition that LIGOTimeGPS provides. The first error is that operation failing. As a fallback, python goes to the other class and uses the 'radd' method. In this case, float doesn't know what LIGOTimeGPS is and that method fails (hence the second error).
So I think the question here is why your GPS values are so large and causing LIGOTimeGPS to fail. They both do seem to be orders of magnitude larger than any reasonable value so something must be wrong there.
Currently, when I use am working with a time series, using
ts.get_end_time()
results in an error:'TypeError: unsupported operand type(s) for +: 'lal.LIGOTimeGPS' and 'float'