Implemented first-motion picker within manual picking.
This commit is contained in:
parent
8f1ab87045
commit
6f70b2c0e2
@ -290,6 +290,15 @@ def picksdict_from_picks(evt):
|
|||||||
phase['channel'] = channel
|
phase['channel'] = channel
|
||||||
phase['network'] = network
|
phase['network'] = network
|
||||||
phase['picker'] = picker
|
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['fm'] = 'N'
|
||||||
phase['filter_id'] = filter_id if filter_id is not None else ''
|
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)
|
warnings.warn(str(e), RuntimeWarning)
|
||||||
filter_id = ''
|
filter_id = ''
|
||||||
pick.filter_id = filter_id
|
pick.filter_id = filter_id
|
||||||
|
|
||||||
try:
|
try:
|
||||||
polarity = phase['fm']
|
polarity = picks[station][label]['fm']
|
||||||
if polarity == 'U' or '+':
|
if polarity == 'U' or '+':
|
||||||
pick.polarity = 'positive'
|
pick.polarity = 'positive'
|
||||||
elif polarity == 'D' or '-':
|
elif polarity == 'D' or '-':
|
||||||
pick.polarity = 'negative'
|
pick.polarity = 'negative'
|
||||||
else:
|
else:
|
||||||
pick.polarity = 'undecidable'
|
pick.polarity = 'undecidable'
|
||||||
except KeyError as e:
|
except:
|
||||||
if 'fm' in str(e): # no polarity information found for this phase
|
pick.polarity = 'undecidable'
|
||||||
pass
|
print("No polarity information available!")
|
||||||
else:
|
#except KeyError as e:
|
||||||
raise 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)
|
picks_list.append(pick)
|
||||||
return picks_list
|
return picks_list
|
||||||
|
|
||||||
|
@ -2566,22 +2566,31 @@ class PickDlg(QDialog):
|
|||||||
|
|
||||||
mpp = stime + pick
|
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:
|
if epp:
|
||||||
epp = stime + epp + stime_diff
|
epp = stime + epp + stime_diff
|
||||||
if lpp:
|
if lpp:
|
||||||
lpp = stime + lpp + stime_diff
|
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
|
# 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,
|
picker='manual', channel=channel,
|
||||||
network=wfdata[0].stats.network,
|
network=wfdata[0].stats.network,
|
||||||
filteroptions=transformFilteroptions2String(filteroptions))
|
filteroptions=transformFilteroptions2String(filteroptions))
|
||||||
@ -2595,11 +2604,7 @@ class PickDlg(QDialog):
|
|||||||
self.zoomAction.setEnabled(True)
|
self.zoomAction.setEnabled(True)
|
||||||
# self.pick_block = self.togglPickBlocker()
|
# self.pick_block = self.togglPickBlocker()
|
||||||
# self.resetZoom()
|
# 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()
|
self.leave_picking_mode()
|
||||||
|
|
||||||
def savePick(self, phase, phasepicks):
|
def savePick(self, phase, phasepicks):
|
||||||
|
Loading…
Reference in New Issue
Block a user