[change] renamed picks attribute for pylot to pylot_picks, picks attribute of events will now be used exclusively for ObsPy picks
This commit is contained in:
@@ -7,6 +7,8 @@ from obspy import UTCDateTime
|
||||
from obspy.core.event import Event as ObsPyEvent
|
||||
from obspy.core.event import Origin, Magnitude, ResourceIdentifier
|
||||
|
||||
from pylot.core.io.phases import picks_from_picksdict
|
||||
|
||||
|
||||
class Event(ObsPyEvent):
|
||||
'''
|
||||
@@ -65,8 +67,13 @@ class Event(ObsPyEvent):
|
||||
if bool: self._refEvent = False
|
||||
|
||||
def addPicks(self, picks):
|
||||
'''
|
||||
add pylot picks and overwrite existing
|
||||
'''
|
||||
for station in picks:
|
||||
self.pylot_picks[station] = picks[station]
|
||||
#add ObsPy picks
|
||||
self.picks = picks_from_picksdict(self.pylot_picks)
|
||||
|
||||
def addAutopicks(self, autopicks):
|
||||
for station in autopicks:
|
||||
@@ -75,10 +82,15 @@ class Event(ObsPyEvent):
|
||||
def setPick(self, station, pick):
|
||||
if pick:
|
||||
self.pylot_picks[station] = pick
|
||||
|
||||
def setPicks(self, picks):
|
||||
self.pylot_picks = picks
|
||||
self.picks = picks_from_picksdict(self.pylot_picks)
|
||||
|
||||
def setPicks(self, picks):
|
||||
'''
|
||||
set pylot picks and delete and overwrite all existing
|
||||
'''
|
||||
self.pylot_picks = picks
|
||||
self.picks = picks_from_picksdict(self.pylot_picks)
|
||||
|
||||
def getPick(self, station):
|
||||
if station in self.pylot_picks.keys():
|
||||
return self.pylot_picks[station]
|
||||
|
||||
@@ -1646,7 +1646,7 @@ class TuneAutopicker(QWidget):
|
||||
model = self.stationBox.model()
|
||||
for network, station in stations:
|
||||
item = QtGui.QStandardItem(network+'.'+station)
|
||||
if station in self.get_current_event().picks:
|
||||
if station in self.get_current_event().pylot_picks:
|
||||
item.setBackground(self.parent._colors['ref'])
|
||||
model.appendRow(item)
|
||||
|
||||
@@ -1698,13 +1698,13 @@ class TuneAutopicker(QWidget):
|
||||
|
||||
def get_current_event_picks(self, station):
|
||||
event = self.get_current_event()
|
||||
if station in event.picks.keys():
|
||||
return event.picks[station]
|
||||
if station in event.pylot_picks.keys():
|
||||
return event.pylot_picks[station]
|
||||
|
||||
def get_current_event_autopicks(self, station):
|
||||
event = self.get_current_event()
|
||||
if event.autopicks:
|
||||
return event.autopicks[station]
|
||||
if event.pylot_autopicks:
|
||||
return event.pylot_autopicks[station]
|
||||
|
||||
def get_current_station(self):
|
||||
return str(self.stationBox.currentText()).split('.')[-1]
|
||||
@@ -1917,8 +1917,8 @@ class TuneAutopicker(QWidget):
|
||||
self._warn('Could not execute picker:\n{}'.format(
|
||||
self.ap_thread._executedError))
|
||||
return
|
||||
self.picks = self.ap_thread.data
|
||||
if not self.picks:
|
||||
self.pylot_picks = self.ap_thread.data
|
||||
if not self.pylot_picks:
|
||||
self._warn('No picks found. See terminal output.')
|
||||
return
|
||||
#renew tabs
|
||||
|
||||
Reference in New Issue
Block a user