[fixes #176] event files are now opened and loaded correctly and picks are plotted in place

This commit is contained in:
Sebastian Wehling-Benatelli 2015-09-21 08:48:29 +02:00
parent 34d31a1aa8
commit d1f1fb42f3

View File

@ -693,21 +693,26 @@ class MainWindow(QMainWindow):
def updatePicks(self): def updatePicks(self):
evt = self.getData().getEvtData() evt = self.getData().getEvtData()
picks = {} picks = {}
onsets = {}
for pick in evt.picks: for pick in evt.picks:
phase = {} phase = {}
station = pick.waveform_id.station_code station = pick.waveform_id.station_code
try:
onsets = picks[station]
except KeyError as e:
print(e)
onsets = {}
mpp = pick.time mpp = pick.time
lpp = mpp + pick.time.upper_uncertainty lpp = mpp + pick.time_errors.upper_uncertainty
epp = mpp - pick.time.lower_uncertainty epp = mpp - pick.time_errors.lower_uncertainty
spe = pick.time.uncertainty spe = pick.time_errors.uncertainty
phase['mpp'] = mpp phase['mpp'] = mpp
phase['epp'] = epp phase['epp'] = epp
phase['lpp'] = lpp phase['lpp'] = lpp
phase['spe'] = spe phase['spe'] = spe
onsets[pick.phase_hint] = phase onsets[pick.phase_hint] = phase.copy()
picks[station] = onsets picks[station] = onsets.copy()
self.picks.update(picks)
def drawPicks(self, station=None): def drawPicks(self, station=None):
# if picks to draw not specified, draw all picks available # if picks to draw not specified, draw all picks available