Commit 5835de2b authored by Gregory Ashton's avatar Gregory Ashton

Add basic set from gwpy method

parent b9636986
Pipeline #23827 passed with stages
in 11 minutes and 15 seconds
......@@ -5,6 +5,7 @@ import os
import matplotlib.pyplot as plt
import numpy as np
import gwpy
from gwpy.signal import filter_design
from scipy import signal
from scipy.interpolate import interp1d
......@@ -258,6 +259,15 @@ class InterferometerStrainData(object):
raise ValueError(
"Insufficient information given to set time_array")
def set_from_gwpy_timeseries(self, timeseries):
logging.debug('Setting data using provided gwpy TimeSeries object')
if type(timeseries) != gwpy.timeseries.timeseries.TimeSeries:
raise ValueError("Input timeseries is not a gwpy TimeSeries")
self.start_time = timeseries.epoch.value
self.sampling_frequency = timeseries.sample_rate.value
self.duration = timeseries.value
self.time_domain_strain = timeseries.value
def set_from_time_domain_strain(
self, time_domain_strain, sampling_frequency=None, duration=None,
start_time=0, time_array=None):
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