Setting strain data from frame file is broken
There must have been a change in gwpy
at some point, because running this line gives the following error:
ifo.set_strain_data_from_frame_file(
'/home/pe.o4/sampler-review/data/fiducial/Pv2-BNS/{}-O4MDC-1364341266.0-1184.gwf'.format(ifo.name),
sampling_frequency, duration, start_time=injection_parameters['geocent_time']+2-duration,
channel='{}:O4MDC'.format(ifo.name), buffer_time=0
)
11:43 bilby INFO : Reading data from frame file /home/pe.o4/sampler-review/data/fiducial/Pv2-BNS/H1-O4MDC-1364341266.0-1184.gwf
Traceback (most recent call last):
File "/home/sylvia.biscoveanu/bilby_fork/examples/gw_examples/injection_examples/test_relative_binning.py", line 58, in <module>
ifo.set_strain_data_from_frame_file(
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/bilby/gw/detector/interferometer.py", line 195, in set_strain_data_from_frame_file
self.strain_data.set_from_frame_file(
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/bilby/gw/detector/strain_data.py", line 691, in set_from_frame_file
strain = gwutils.read_frame_file(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/bilby/gw/utils.py", line 398, in read_frame_file
strain = TimeSeries.read(source=file_name, channel=channel, start=start_time, end=end_time, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/timeseries/core.py", line 310, in read
return timeseries_reader(cls, source, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/timeseries/io/core.py", line 50, in read
return io_read_multi(joiner, cls, source, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/io/mp.py", line 90, in read_multi [44/259]
output = mp_utils.multiprocess_with_queues(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/utils/mp.py", line 123, in multiprocess_with_queues
return list(map(_inner, inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/utils/mp.py", line 118, in _inner
return func(x)
^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/io/mp.py", line 119, in _read_single_file
return fobj, io_read(cls, fobj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/astropy/io/registry/compat.py", line 52, in wrapper
return getattr(registry, method_name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [30/259]
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/astropy/io/registry/core.py", line 219, in read
data = reader(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/timeseries/io/gwf/__init__.py", line 378, in read_
return reader(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/timeseries/io/gwf/__init__.py", line 266, in read_timeseries
return read_timeseriesdict(source, [channel], *args, **kwargs)[channel]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sylvia.biscoveanu/.conda/envs/bilby_fork/lib/python3.11/site-packages/gwpy/timeseries/io/gwf/__init__.py", line 257, in read_timeseriesdict
out.append(libread_(src, channels, start=start, end=end,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: read() got an unexpected keyword argument 'resample'
The way this is avoided in bilby_pipe is by breaking the resampling out into a separate step. This requires adding an analogous line in this function.
Edited by Sylvia Biscoveanu