Skip to content

Commit ebe801a

Browse files
committed
Phase picker: use simmetric window for S phase picking
This should limit cases where the P phase is picked instead of the S phase
1 parent f1e352e commit ebe801a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sourcespec/ssp_wave_picking.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ def _refine_theo_pick_time(
4343
tr_envelope.normalize()
4444
# Cut the trace around the theoretical pick time
4545
tr_cut = tr_envelope.copy()
46-
cut_t0 = theo_pick_time - 0.7*s_minus_p
47-
cut_t1 = theo_pick_time + 0.3*s_minus_p
46+
if phase == 'P':
47+
cut_t0 = theo_pick_time - 0.7*s_minus_p
48+
cut_t1 = theo_pick_time + 0.3*s_minus_p
49+
else:
50+
cut_t0 = theo_pick_time - 0.5*s_minus_p
51+
cut_t1 = theo_pick_time + 0.5*s_minus_p
4852
tr_cut.trim(cut_t0, cut_t1)
4953
# Threshold the cut trace, then cut it again up to its maximum
5054
rms = np.sqrt(np.mean(tr_cut.data**2))
@@ -69,6 +73,7 @@ def _refine_theo_pick_time(
6973
# Remove a linear function defined by first/last sample of the trace
7074
tr_cut_detrend = tr_cut.copy()
7175
tr_cut_detrend.detrend('simple')
76+
# New pick time is the time of the minimum of the detrended trace
7277
refined_theo_pick_time =\
7378
tr_cut_detrend.stats.starttime +\
7479
tr_cut_detrend.times()[np.argmin(tr_cut_detrend.data)]

0 commit comments

Comments
 (0)