Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mtuq/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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
Expand Down