From 1f6210cf8fb6110e9e9a8246667017a450edca82 Mon Sep 17 00:00:00 2001 From: "[Liang Ding]" Date: Thu, 13 Jun 2024 15:28:17 -0400 Subject: [PATCH] define a window_type, synthetic, for synthetic test. --- mtuq/process_data.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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