diff --git a/mtuq/process_data.py b/mtuq/process_data.py index d5d194f9..125b1a48 100644 --- a/mtuq/process_data.py +++ b/mtuq/process_data.py @@ -317,6 +317,11 @@ def __init__(self, self.window_length = window_length _window_warnings(window_type, window_length) + elif self.window_type == 'synthetic': + # window type for synthetic examples + assert window_length > 0. + self.window_length = window_length + else: raise ValueError('Bad parameter: window_type') @@ -704,6 +709,14 @@ def __call__(self, traces, station=None, origin=None, overwrite=False): starttime += float(origin.time) endtime += float(origin.time) + elif self.window_type == 'synthetic': + # window type for synthetic examples + # waveform starts at 0.0 + starttime = 0.0 + endtime = starttime + self.window_length + starttime += float(origin.time) + endtime += float(origin.time) + else: starttime = trace.stats.starttime endtime = trace.stats.endtime