Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Marcel Paffrath 2017-05-02 12:19:16 +02:00
commit fce0c98a89
7 changed files with 4800 additions and 289 deletions

View File

@ -15,7 +15,7 @@ Some icons are out of a free of charge icon set, which can be found here:
https://www.iconfinder.com/iconsets/flavour https://www.iconfinder.com/iconsets/flavour
:authors: :authors:
Sebastian Wehling-Benatelli / Ludger Küperkoch Sebastian Wehling-Benatelli / Ludger Küperkoch / Marcel Paffrath
:copyright: :copyright:
The PyLoT Development Team (https://ariadne.geophysik.rub.de/trac/PyLoT) The PyLoT Development Team (https://ariadne.geophysik.rub.de/trac/PyLoT)
:license: :license:
@ -215,13 +215,11 @@ class MainWindow(QMainWindow):
autopicksicon = QIcon() autopicksicon = QIcon()
autopicksicon.addPixmap(QPixmap(':/icons/autopicsicon.png')) autopicksicon.addPixmap(QPixmap(':/icons/autopicsicon.png'))
self.autopicksicon_small = QIcon() self.autopicksicon_small = QIcon()
self.autopicksicon_small.addPixmap(QPixmap(':/icons/autopicsicon.png')) self.autopicksicon_small.addPixmap(QPixmap(':/icons/autopicksicon_small.png'))
self.manupicksicon_small = QIcon() self.manupicksicon_small = QIcon()
self.manupicksicon_small.addPixmap(QPixmap(':/icons/manupicsicon.png')) self.manupicksicon_small.addPixmap(QPixmap(':/icons/manupicksicon_small.png'))
# self.autopicksicon_small = QIcon() saveProjectIcon = QIcon()
# self.autopicksicon_small.addPixmap(QPixmap(':/icons/autopicksicon_small.png')) saveProjectIcon.addPixmap(QPixmap(':/icons/Library-icon.png'))
# self.manupicksicon_small = QIcon()
# self.manupicksicon_small.addPixmap(QPixmap(':/icons/manupicksicon_small.png'))
loadpiloticon = QIcon() loadpiloticon = QIcon()
loadpiloticon.addPixmap(QPixmap(':/icons/Matlab_PILOT_icon.png')) loadpiloticon.addPixmap(QPixmap(':/icons/Matlab_PILOT_icon.png'))
p_icon = QIcon() p_icon = QIcon()
@ -256,8 +254,9 @@ class MainWindow(QMainWindow):
self.saveProjectAction = self.createAction(self, "Save project ...", self.saveProjectAction = self.createAction(self, "Save project ...",
self.saveProject, self.saveProject,
QKeySequence.Save, QKeySequence.Save,
saveIcon, saveProjectIcon,
"Save project file") "Save project file")
self.saveProjectAction.setEnabled(False)
# newEventAction = self.createAction(self, "&New event ...", # newEventAction = self.createAction(self, "&New event ...",
# self.createNewEvent, # self.createNewEvent,
# QKeySequence.New, newIcon, # QKeySequence.New, newIcon,
@ -281,11 +280,12 @@ class MainWindow(QMainWindow):
self.openautopicksaction.setEnabled(False) self.openautopicksaction.setEnabled(False)
self.openautopicksaction.setData(None) self.openautopicksaction.setData(None)
loadlocationaction = self.createAction(self, "Load &location ...", self.loadlocationaction = self.createAction(self, "Load &location ...",
self.load_loc, "Ctrl+L", self.load_loc, "Ctrl+L",
locactionicon, locactionicon,
"Load location information on " "Load location information on "
"the displayed event.") "the displayed event.")
self.loadlocationaction.setEnabled(False)
self.loadpilotevent = self.createAction(self, "Load PILOT &event ...", self.loadpilotevent = self.createAction(self, "Load PILOT &event ...",
self.load_pilotevent, "Ctrl+E", self.load_pilotevent, "Ctrl+E",
loadpiloticon, loadpiloticon,
@ -369,7 +369,7 @@ class MainWindow(QMainWindow):
fileToolActions = (self.newProjectAction, self.addEventDataAction, fileToolActions = (self.newProjectAction, self.addEventDataAction,
self.openProjectAction, self.saveProjectAction, self.openProjectAction, self.saveProjectAction,
self.openmanualpicksaction, self.openmanualpicksaction,
self.openautopicksaction, loadlocationaction, self.openautopicksaction, self.loadlocationaction,
self.loadpilotevent, self.saveEventAction) self.loadpilotevent, self.saveEventAction)
fileToolBar.setObjectName("FileTools") fileToolBar.setObjectName("FileTools")
self.addActions(fileToolBar, fileToolActions) self.addActions(fileToolBar, fileToolActions)
@ -941,6 +941,8 @@ class MainWindow(QMainWindow):
def finishWaveformDataPlot(self): def finishWaveformDataPlot(self):
self.connectWFplotEvents() self.connectWFplotEvents()
self.loadlocationaction.setEnabled(True)
self.saveProjectAction.setEnabled(True)
self.auto_pick.setEnabled(True) self.auto_pick.setEnabled(True)
self.z_action.setEnabled(True) self.z_action.setEnabled(True)
self.e_action.setEnabled(True) self.e_action.setEnabled(True)
@ -961,6 +963,8 @@ class MainWindow(QMainWindow):
def clearWaveformDataPlot(self): def clearWaveformDataPlot(self):
self.disconnectWFplotEvents() self.disconnectWFplotEvents()
self.dataPlot.getAxes().cla() self.dataPlot.getAxes().cla()
self.loadlocationaction.setEnabled(False)
self.saveProjectAction.setEnabled(False)
self.auto_pick.setEnabled(False) self.auto_pick.setEnabled(False)
self.z_action.setEnabled(False) self.z_action.setEnabled(False)
self.e_action.setEnabled(False) self.e_action.setEnabled(False)

View File

@ -1,5 +1,6 @@
<RCC> <RCC>
<qresource> <qresource>
<file>icons/Library-icon.png</file>
<file>icons/pylot.ico</file> <file>icons/pylot.ico</file>
<file>icons/pylot.png</file> <file>icons/pylot.png</file>
<file>icons/manupicsicon.png</file> <file>icons/manupicsicon.png</file>

File diff suppressed because it is too large Load Diff

View File

@ -294,7 +294,6 @@ class Data(object):
:raise OverwriteError: raises an OverwriteError if the picks list is :raise OverwriteError: raises an OverwriteError if the picks list is
not empty. The GUI will then ask for a decision. not empty. The GUI will then ask for a decision.
""" """
#firstonset = find_firstonset(picks) #firstonset = find_firstonset(picks)
# check for automatic picks # check for automatic picks
print("Writing phases to ObsPy-quakeml file") print("Writing phases to ObsPy-quakeml file")

View File

@ -194,6 +194,7 @@ def picksdict_from_picks(evt):
for pick in evt.picks: for pick in evt.picks:
phase = {} phase = {}
station = pick.waveform_id.station_code station = pick.waveform_id.station_code
channel = pick.waveform_id.channel_code
try: try:
onsets = picks[station] onsets = picks[station]
except KeyError as e: except KeyError as e:
@ -213,6 +214,7 @@ def picksdict_from_picks(evt):
phase['epp'] = epp phase['epp'] = epp
phase['lpp'] = lpp phase['lpp'] = lpp
phase['spe'] = spe phase['spe'] = spe
phase['channel'] = channel
try: try:
picker = str(pick.method_id) picker = str(pick.method_id)
if picker.startswith('smi:local/'): if picker.startswith('smi:local/'):
@ -232,8 +234,11 @@ def picks_from_picksdict(picks, creation_info=None):
if not isinstance(phase, dict): if not isinstance(phase, dict):
continue continue
onset = phase['mpp'] onset = phase['mpp']
ccode = phase['channel'] try:
ncode = phase['network'] ccode = phase['channel']
ncode = phase['network']
except:
continue
pick = ope.Pick() pick = ope.Pick()
if creation_info: if creation_info:
pick.creation_info = creation_info pick.creation_info = creation_info
@ -830,8 +835,9 @@ def merge_picks(event, picks):
err = pick.time_errors err = pick.time_errors
phase = pick.phase_hint phase = pick.phase_hint
station = pick.waveform_id.station_code station = pick.waveform_id.station_code
method = pick.method_id
for p in event.picks: for p in event.picks:
if p.waveform_id.station_code == station and p.phase_hint == phase: if p.waveform_id.station_code == station and p.phase_hint == phase:
p.time, p.time_errors = time, err p.time, p.time_errors, p.method_id = time, err, method
del time, err, phase, station del time, err, phase, station, method
return event return event

View File

@ -446,6 +446,7 @@ class WaveformWidget(FigureCanvas):
stime = trace.stats.starttime - wfstart stime = trace.stats.starttime - wfstart
time_ax = prepTimeAxis(stime, trace) time_ax = prepTimeAxis(stime, trace)
if not scaleddata: if not scaleddata:
trace.detrend('constant')
trace.normalize(np.max(np.abs(trace.data)) * 2) trace.normalize(np.max(np.abs(trace.data)) * 2)
self.getAxes().plot(time_ax, trace.data + n, 'k') self.getAxes().plot(time_ax, trace.data + n, 'k')
if noiselevel is not None: if noiselevel is not None: