diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 0cf5e91c..85733f3e 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -229,7 +229,7 @@ def autopickstation(wfstream, pickparam, verbose=False, # for global seismology: use tau-p method for estimating travel times (needs source and station coords.) # if not given: sets Lc to infinity to use full stream - if use_taup: + if use_taup == True: Lc = np.inf print('autopickstation: use_taup flag active.') if not metadata[1]: @@ -271,7 +271,7 @@ def autopickstation(wfstream, pickparam, verbose=False, pstart = max(pstart, 0) pstop = min(pstop, len(zdat[0])*zdat[0].stats.delta) - if not use_taup or origin: + if not use_taup == True or origin: Lc = pstop - pstart Lwf = zdat[0].stats.endtime - zdat[0].stats.starttime @@ -526,16 +526,31 @@ def autopickstation(wfstream, pickparam, verbose=False, else: ndat = edat - if edat is not None and ndat is not None and len(edat) > 0 and len( - ndat) > 0 and Pweight < 4: + pickSonset = (edat is not None and ndat is not None and len(edat) > 0 and len( + ndat) > 0 and Pweight < 4) + + if pickSonset: + # determine time window for calculating CF after P onset + cuttimesh = [ + round(max([mpickP + sstart, 0])), # MP MP relative time axis + round(min([ + mpickP + sstop, + edat[0].stats.endtime-edat[0].stats.starttime, + ndat[0].stats.endtime-ndat[0].stats.starttime + ])) + ] + + if not cuttimesh[1] >= cuttimesh[0]: + print('Cut window for horizontal phases too small! Will not pick S onsets.') + pickSonset = False + + if pickSonset: msg = 'Go on picking S onset ...\n' \ '##################################################\n' \ 'Working on S onset of station {0}\nFiltering horizontal ' \ 'traces ...'.format(edat[0].stats.station) if verbose: print(msg) - # determine time window for calculating CF after P onset - cuttimesh = [round(max([mpickP + sstart, 0])), - round(min([mpickP + sstop, Lwf]))] + if algoS == 'ARH': # re-create stream object including both horizontal components