[add] paramter taup_phases
This commit is contained in:
parent
9fd982b1ef
commit
a90ef26344
@ -510,9 +510,14 @@ defaults = {'rootpath': {'type': str,
|
||||
'namestring': 'Use TauPy'},
|
||||
|
||||
'taup_model': {'type': str,
|
||||
'tooltip': 'define TauPy model for traveltime estimation. Possible values: 1066a, 1066b, ak135, ak135f, herrin, iasp91, jb, prem, pwdk, sp6',
|
||||
'tooltip': 'Define TauPy model for traveltime estimation. Possible values: 1066a, 1066b, ak135, ak135f, herrin, iasp91, jb, prem, pwdk, sp6',
|
||||
'value': 'iasp91',
|
||||
'namestring': 'TauPy model'}
|
||||
'namestring': 'TauPy model'},
|
||||
|
||||
'taup_phases': {'type': str,
|
||||
'tooltip': 'Specify possible phases for TauPy (comma separated). See Obspy TauPy documentation for possible values.',
|
||||
'value': 'ttall',
|
||||
'namestring': 'TauPy phases'},
|
||||
}
|
||||
|
||||
settings_main = {
|
||||
@ -551,6 +556,7 @@ settings_main = {
|
||||
'sstop',
|
||||
'use_taup',
|
||||
'taup_model',
|
||||
'taup_phases',
|
||||
'bpz1',
|
||||
'bpz2',
|
||||
'bph1',
|
||||
|
@ -196,6 +196,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
||||
sstop = pickparam.get('sstop')
|
||||
use_taup = real_Bool(pickparam.get('use_taup'))
|
||||
taup_model = pickparam.get('taup_model')
|
||||
taup_phases = pickparam.get('taup_phases')
|
||||
bph1 = pickparam.get('bph1')
|
||||
bph2 = pickparam.get('bph2')
|
||||
tsnrh = pickparam.get('tsnrh')
|
||||
@ -302,12 +303,15 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
||||
if station_coords and origin:
|
||||
source_origin = origin[0]
|
||||
model = TauPyModel(taup_model)
|
||||
# for backward compatibility of older input files
|
||||
taup_phases = 'ttall' if not taup_phases or taup_phases=='None' else taup_phases
|
||||
arrivals = model.get_travel_times_geo(
|
||||
source_origin.depth,
|
||||
source_origin.latitude,
|
||||
source_origin.longitude,
|
||||
station_coords['latitude'],
|
||||
station_coords['longitude']
|
||||
station_coords['longitude'],
|
||||
phase_list=[item.strip() for item in taup_phases.split(',')],
|
||||
)
|
||||
phases = {'P': [],
|
||||
'S': []}
|
||||
@ -315,8 +319,12 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
||||
phases[identifyPhaseID(arr.phase.name)].append(arr)
|
||||
|
||||
# get first P and S onsets from arrivals list
|
||||
arrP, estFirstP = min([(arr, arr.time) for arr in phases['P']], key=lambda t: t[1])
|
||||
arrS, estFirstS = min([(arr, arr.time) for arr in phases['S']], key=lambda t: t[1])
|
||||
estFirstP = 0
|
||||
estFirstS = 0
|
||||
if len(phases['P']) > 0:
|
||||
arrP, estFirstP = min([(arr, arr.time) for arr in phases['P']], key=lambda t: t[1])
|
||||
if len(phases['S']) > 0:
|
||||
arrS, estFirstS = min([(arr, arr.time) for arr in phases['S']], key=lambda t: t[1])
|
||||
print('autopick: estimated first arrivals for P: {} s, S:{} s after event'
|
||||
' origin time using TauPy'.format(estFirstP, estFirstS))
|
||||
|
||||
|
@ -4636,6 +4636,7 @@ class PhasesTab(PropTab):
|
||||
self.pickDefaultsButton = QtGui.QPushButton('Choose default phases...')
|
||||
PphasesLabel = QLabel("P Phases to pick")
|
||||
SphasesLabel = QLabel("S Phases to pick")
|
||||
notes_label = QLabel('Note: Selected phases only apply on manual picking. ')
|
||||
|
||||
settings = QSettings()
|
||||
Pphases = settings.value('p_phases')
|
||||
@ -4651,8 +4652,10 @@ class PhasesTab(PropTab):
|
||||
|
||||
layout.addWidget(self.PphasesEdit, 0, 1)
|
||||
layout.addWidget(self.SphasesEdit, 1, 1)
|
||||
|
||||
layout.addWidget(self.pickDefaultsButton, 2, 0)
|
||||
layout.addWidget(notes_label, 2, 1)
|
||||
self.main_layout.addLayout(layout)
|
||||
self.main_layout.addWidget(self.pickDefaultsButton)
|
||||
self.setLayout(self.main_layout)
|
||||
|
||||
self.connectSignals()
|
||||
|
Loading…
Reference in New Issue
Block a user