[bugfix] taupy picks not initiated in array_map

This commit is contained in:
Marcel Paffrath 2019-02-28 17:04:59 +01:00
parent 4dfcdb41ec
commit 9ae8e36061
2 changed files with 13 additions and 3 deletions

View File

@ -113,6 +113,7 @@ class Array_map(QtGui.QWidget):
data = self._parent.get_data().getWFData()
for index in ind:
network, station = self._station_onpick_ids[index].split('.')[:2]
pyl_mw = self._parent
try:
data = data.select(station=station)
if not data:
@ -122,14 +123,14 @@ class Array_map(QtGui.QWidget):
data=data, network=network, station=station,
picks=self._parent.get_current_event().getPick(station),
autopicks=self._parent.get_current_event().getAutopick(station),
filteroptions=self._parent.filteroptions)
filteroptions=self._parent.filteroptions, metadata=self.metadata,
event=pyl_mw.get_current_event())
except Exception as e:
message = 'Could not generate Plot for station {st}.\n {er}'.format(st=station, er=e)
self._warn(message)
print(message, e)
print(traceback.format_exc())
return
pyl_mw = self._parent
try:
if pickDlg.exec_():
pyl_mw.setDirty(True)

View File

@ -15,6 +15,7 @@ import os
import subprocess
import sys
import time
import traceback
matplotlib.use('QT4Agg')
@ -1617,6 +1618,7 @@ class PickDlg(QDialog):
self.activateArrivalsButton(False)
except Exception as e:
print('Warning: Could not init expected picks from taup: {}'.format(e))
print(traceback.format_exc())
self.activateArrivalsButton(False)
# init pick delete (with middle mouse click)
@ -1870,7 +1872,14 @@ class PickDlg(QDialog):
settings = QtCore.QSettings()
p_phases = settings.value('p_phases')
s_phases = settings.value('s_phases')
if not p_phases and not s_phases:
print('No phases for TauPy selected in Preferences.')
if p_phases and s_phases:
phases = p_phases + ',' + s_phases
elif p_phases and not s_phases:
phases = p_phases
elif s_phases and not p_phases:
phases = s_phases
phases = phases.split(',')
phases = [phase.strip() for phase in phases]
return phases