[bugfix] full_range called for each station when drawing picks, largely decreasing plot performance

This commit is contained in:
Marcel Paffrath 2018-07-10 11:13:41 +02:00
parent 689192b25d
commit c46513a626

View File

@ -2631,17 +2631,20 @@ class MainWindow(QMainWindow):
elif type == 'auto': elif type == 'auto':
event.addAutopicks(picksdict['auto']) event.addAutopicks(picksdict['auto'])
def drawPicks(self, station=None, picktype=None): def drawPicks(self, station=None, picktype=None, stime=None):
# if picktype not specified, draw both # if picktype not specified, draw both
if not stime:
stime = self.getStime()
if not picktype: if not picktype:
self.drawPicks(station, 'manual') self.drawPicks(station, 'manual', stime)
self.drawPicks(station, 'auto') self.drawPicks(station, 'auto', stime)
return return
# if picks to draw not specified, draw all picks available # if picks to draw not specified, draw all picks available
if not station: if not station:
for station in self.getPicks(type=picktype): for station in self.getPicks(type=picktype):
self.drawPicks(station, picktype=picktype) self.drawPicks(station, picktype=picktype, stime=stime)
return return
# check for station key in dictionary, else return # check for station key in dictionary, else return
@ -2659,7 +2662,6 @@ class MainWindow(QMainWindow):
ylims = np.array([-.5, +.5]) + plotID ylims = np.array([-.5, +.5]) + plotID
stat_picks = self.getPicks(type=picktype)[station] stat_picks = self.getPicks(type=picktype)[station]
stime = self.getStime()
for phase in stat_picks: for phase in stat_picks:
if phase == 'SPt': continue # wadati SP time if phase == 'SPt': continue # wadati SP time