Commit 789005cb authored by Gregory Ashton's avatar Gregory Ashton

Merge branch 'add-data-format-to-get' into 'master'

Parse data_format through to `TimeSeries.get()`

See merge request !163
parents 3647b9de 1beaaed1
Pipeline #75847 passed with stages
in 4 minutes and 25 seconds
......@@ -619,9 +619,14 @@ class DataGenerationInput(Input):
channel, start_time, end_time, dtype
)
)
if self.data_format:
kwargs = dict(format=self.data_format)
logger.info("Extra kwargs passed to get(): {}".format(kwargs))
else:
kwargs = dict()
try:
data = gwpy.timeseries.TimeSeries.get(
channel, start_time, end_time, verbose=False, dtype=dtype
channel, start_time, end_time, verbose=False, dtype=dtype, **kwargs
)
return data
except RuntimeError as e:
......@@ -629,6 +634,12 @@ class DataGenerationInput(Input):
logger.debug("Error message {}".format(e))
except ImportError:
logger.info("Unable to read data as NDS2 is not installed")
except TypeError:
logger.debug("Problem reading data try again without kwargs")
data = gwpy.timeseries.TimeSeries.get(
channel, start_time, end_time, verbose=False, dtype=dtype
)
return data
def _gwpy_fetch_open_data(self, det, start_time, end_time):
""" Wrapper function to gwpy.timeseries.TimeSeries.fetch_open_data()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment