[bugfix] pick times are absolute times, thus for plotting the start time has to be subtracted

This commit is contained in:
Sebastian Wehling-Benatelli 2015-07-13 06:39:25 +02:00
parent 641cb498f0
commit d79165a9f2
2 changed files with 16 additions and 7 deletions

View File

@ -45,7 +45,7 @@ from pylot.core.util.defaults import FILTERDEFAULTS
from pylot.core.util.errors import FormatError, DatastructureError from pylot.core.util.errors import FormatError, DatastructureError
from pylot.core.util.connection import checkurl from pylot.core.util.connection import checkurl
from pylot.core.util.utils import fnConstructor, createEvent, getLogin,\ from pylot.core.util.utils import fnConstructor, createEvent, getLogin,\
createCreationInfo createCreationInfo, getGlobalTimes
from pylot.core.util.widgets import FilterOptionsDialog, NewEventDlg,\ from pylot.core.util.widgets import FilterOptionsDialog, NewEventDlg,\
MPLWidget, PropertiesDlg, HelpForm, createAction, PickDlg MPLWidget, PropertiesDlg, HelpForm, createAction, PickDlg
from pylot.core.util.structure import DATASTRUCTURE from pylot.core.util.structure import DATASTRUCTURE
@ -659,9 +659,11 @@ class MainWindow(QMainWindow):
picks = stat_picks[phase] picks = stat_picks[phase]
colors = phase_col[phase[0].upper()] colors = phase_col[phase[0].upper()]
mpp = picks['mpp'] stime = getGlobalTimes(self.getData().getWFData())[0]
epp = picks['epp']
lpp = picks['lpp'] mpp = picks['mpp'] - stime
epp = picks['epp'] - stime
lpp = picks['lpp'] - stime
spe = picks['spe'] spe = picks['spe']
ax.fill_between([epp, lpp], ylims[0], ylims[1], ax.fill_between([epp, lpp], ylims[0], ylims[1],

View File

@ -455,8 +455,9 @@ class PickDlg(QDialog):
x_res = getResolutionWindow(snr) x_res = getResolutionWindow(snr)
# remove mean noise level from waveforms # remove mean noise level from waveforms
wfdata = self.getWFData().copy()
for trace in wfdata: for trace in wfdata:
t = prepTimeAxis(self.getStartTime(), trace) t = prepTimeAxis(trace.stats.starttime - self.getStartTime(), trace)
inoise = getnoisewin(t, ini_pick, noise_win, gap_win) inoise = getnoisewin(t, ini_pick, noise_win, gap_win)
trace = demeanTrace(trace=trace, window=inoise) trace = demeanTrace(trace=trace, window=inoise)
@ -494,7 +495,7 @@ class PickDlg(QDialog):
data.filter(**filteroptions) data.filter(**filteroptions)
for trace in data: for trace in data:
t = prepTimeAxis(self.getStartTime(), trace) t = prepTimeAxis(trace.stats.starttime - self.getStartTime(), trace)
inoise = getnoisewin(t, ini_pick, noise_win, gap_win) inoise = getnoisewin(t, ini_pick, noise_win, gap_win)
trace = demeanTrace(trace, inoise) trace = demeanTrace(trace, inoise)
@ -530,14 +531,20 @@ class PickDlg(QDialog):
channel = self.getChannelID(round(gui_event.ydata)) channel = self.getChannelID(round(gui_event.ydata))
wfdata = self.getWFData().copy().select(channel=channel) wfdata = self.getWFData().copy().select(channel=channel)
stime = self.getStartTime()
# get earliest and latest possible pick and symmetric pick error # get earliest and latest possible pick and symmetric pick error
[epp, lpp, spe] = earllatepicker(wfdata, 1.5, (5., .5, 2.), pick) [epp, lpp, spe] = earllatepicker(wfdata, 1.5, (5., .5, 2.), pick)
# get name of phase actually picked # get name of phase actually picked
phase = self.selectPhase.currentText() phase = self.selectPhase.currentText()
# return absolute time values for phases
epp = stime + epp
mpp = stime + pick
lpp = stime + lpp
# save pick times for actual phase # save pick times for actual phase
phasepicks = {'epp': epp, 'lpp': lpp, 'mpp': pick, 'spe': spe} phasepicks = {'epp': epp, 'lpp': lpp, 'mpp': mpp, 'spe': spe}
try: try:
oldphasepick = self.picks[phase] oldphasepick = self.picks[phase]