Implemented first-motion picker within manual picking.

This commit is contained in:
Ludger Küperkoch 2020-09-29 16:48:38 +02:00
parent 8f1ab87045
commit 6f70b2c0e2
2 changed files with 42 additions and 22 deletions

View File

@ -290,6 +290,15 @@ def picksdict_from_picks(evt):
phase['channel'] = channel
phase['network'] = network
phase['picker'] = picker
try:
if pick.polarity == 'positive':
phase['fm'] = 'U'
elif pick.polarity == 'negative':
phase['fm'] = 'D'
else:
phase['fm'] = 'N'
except:
print("No FM info available!")
phase['fm'] = 'N'
phase['filter_id'] = filter_id if filter_id is not None else ''
@ -350,19 +359,25 @@ def picks_from_picksdict(picks, creation_info=None):
warnings.warn(str(e), RuntimeWarning)
filter_id = ''
pick.filter_id = filter_id
try:
polarity = phase['fm']
polarity = picks[station][label]['fm']
if polarity == 'U' or '+':
pick.polarity = 'positive'
elif polarity == 'D' or '-':
pick.polarity = 'negative'
else:
pick.polarity = 'undecidable'
except KeyError as e:
if 'fm' in str(e): # no polarity information found for this phase
pass
else:
raise e
except:
pick.polarity = 'undecidable'
print("No polarity information available!")
#except KeyError as e:
# if 'fm' in str(e): # no polarity information found for this phase
#if 'polarity' in str(e): # no polarity information found for this phase
# print("No polarity information available!")
# pass
# else:
# raise e
picks_list.append(pick)
return picks_list

View File

@ -2566,22 +2566,31 @@ class PickDlg(QDialog):
mpp = stime + pick
# get first motion and quality classes
if self.getPhaseID(phase) == 'P':
# get first motion quality of P onset is sufficeint
minFMweight = parameter.get('minfmweight')
minFMSNR = parameter.get('minFMSNR')
quality = get_quality_class(spe, parameter.get('timeerrorsP'))
if quality <= minFMweight:
FM = fmpicker(self.getWFData().select(channel=channel), wfdata, parameter.get('fmpickwin'), mpp)
if epp:
epp = stime + epp + stime_diff
if lpp:
lpp = stime + lpp + stime_diff
noise_win, gap_win, signal_win = self.getNoiseWin(phase)
snr, snrDB, noiselevel = getSNR(wfdata, (noise_win, gap_win, signal_win), pick - stime_diff)
print('SNR of final pick: {}'.format(snr))
if snr < 1.5:
QMessageBox.warning(self, 'SNR too low', 'WARNING! SNR of final pick below 1.5! SNR = {}'.format(snr))
# get first motion and quality classes
FM = ''
if self.getPhaseID(phase) == 'P':
# get first motion quality of P onset is sufficeint
minFMweight = parameter.get('minfmweight')
minFMSNR = parameter.get('minFMSNR')
quality = get_quality_class(spe, parameter.get('timeerrorsP'))
if quality <= minFMweight and snr >= minFMSNR:
FM = fmpicker(self.getWFData().select(channel=channel), wfdata, parameter.get('fmpickwin'),
pick -stime_diff)
# save pick times for actual phase
phasepicks = dict(epp=epp, lpp=lpp, mpp=mpp, spe=spe,
phasepicks = dict(epp=epp, lpp=lpp, mpp=mpp, spe=spe, fm=FM,
picker='manual', channel=channel,
network=wfdata[0].stats.network,
filteroptions=transformFilteroptions2String(filteroptions))
@ -2595,11 +2604,7 @@ class PickDlg(QDialog):
self.zoomAction.setEnabled(True)
# self.pick_block = self.togglPickBlocker()
# self.resetZoom()
noise_win, gap_win, signal_win = self.getNoiseWin(phase)
snr, snrDB, noiselevel = getSNR(wfdata, (noise_win, gap_win, signal_win), pick - stime_diff)
print('SNR of final pick: {}'.format(snr))
if snr < 1.5:
QMessageBox.warning(self, 'SNR too low', 'WARNING! SNR of final pick below 1.5! SNR = {}'.format(snr))
self.leave_picking_mode()
def savePick(self, phase, phasepicks):