[update] trying to increase plot performance for large datasets, can need overhaul of drawPicks method in the future (too much recursion)
This commit is contained in:
parent
f78315dec4
commit
e8a516d16b
9
PyLoT.py
9
PyLoT.py
@ -2153,10 +2153,11 @@ class MainWindow(QMainWindow):
|
|||||||
self.wf_scroll_area.setVisible(len(plots) > 0)
|
self.wf_scroll_area.setVisible(len(plots) > 0)
|
||||||
self.no_data_label.setVisible(not len(plots) > 0)
|
self.no_data_label.setVisible(not len(plots) > 0)
|
||||||
for times, data, times_syn, data_syn in plots:
|
for times, data, times_syn, data_syn in plots:
|
||||||
self.dataPlot.plotWidget.getPlotItem().plot(times, data,
|
self.dataPlot.plotWidget.getPlotItem().plot(np.array(times), np.array(data),
|
||||||
pen=self.dataPlot.pen_linecolor)
|
pen=self.dataPlot.pen_linecolor,
|
||||||
|
skipFiniteCheck=True)
|
||||||
if len(data_syn) > 0:
|
if len(data_syn) > 0:
|
||||||
self.dataPlot.plotWidget.getPlotItem().plot(times_syn, data_syn,
|
self.dataPlot.plotWidget.getPlotItem().plot(np.array(times_syn), np.array(data_syn),
|
||||||
pen=self.dataPlot.pen_linecolor_syn)
|
pen=self.dataPlot.pen_linecolor_syn)
|
||||||
self.dataPlot.reinitMoveProxy()
|
self.dataPlot.reinitMoveProxy()
|
||||||
self.highlight_stations()
|
self.highlight_stations()
|
||||||
@ -3096,7 +3097,7 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
if self.pg:
|
if self.pg:
|
||||||
if spe:
|
if spe:
|
||||||
if picks['epp'] and picks['lpp']:
|
if not self.plot_method == 'fast' and picks['epp'] and picks['lpp']:
|
||||||
pen = make_pen(picktype, phaseID, 'epp', quality)
|
pen = make_pen(picktype, phaseID, 'epp', quality)
|
||||||
self.drawnPicks[picktype][station].append(pw.plot([epp, epp], ylims,
|
self.drawnPicks[picktype][station].append(pw.plot([epp, epp], ylims,
|
||||||
alpha=.25, pen=pen, name='EPP'))
|
alpha=.25, pen=pen, name='EPP'))
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
|
from functools import lru_cache
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pyqtgraph as pg
|
import pyqtgraph as pg
|
||||||
@ -25,14 +26,14 @@ def pick_linestyle_pg(picktype, key):
|
|||||||
:return: Qt line style parameters
|
:return: Qt line style parameters
|
||||||
:rtype:
|
:rtype:
|
||||||
"""
|
"""
|
||||||
linestyles_manu = {'mpp': (QtCore.Qt.SolidLine, 2.),
|
linestyles_manu = {'mpp': (QtCore.Qt.SolidLine, 2),
|
||||||
'epp': (QtCore.Qt.DashLine, 1.),
|
'epp': (QtCore.Qt.DashLine, 1),
|
||||||
'lpp': (QtCore.Qt.DashLine, 1.),
|
'lpp': (QtCore.Qt.DashLine, 1),
|
||||||
'spe': (QtCore.Qt.DashLine, 1.)}
|
'spe': (QtCore.Qt.DashLine, 1)}
|
||||||
linestyles_auto = {'mpp': (QtCore.Qt.DotLine, 2.),
|
linestyles_auto = {'mpp': (QtCore.Qt.DotLine, 2),
|
||||||
'epp': (QtCore.Qt.DashDotLine, 1.),
|
'epp': (QtCore.Qt.DashDotLine, 1),
|
||||||
'lpp': (QtCore.Qt.DashDotLine, 1.),
|
'lpp': (QtCore.Qt.DashDotLine, 1),
|
||||||
'spe': (QtCore.Qt.DashDotLine, 1.)}
|
'spe': (QtCore.Qt.DashDotLine, 1)}
|
||||||
linestyles = {'manual': linestyles_manu,
|
linestyles = {'manual': linestyles_manu,
|
||||||
'auto': linestyles_auto}
|
'auto': linestyles_auto}
|
||||||
return linestyles[picktype][key]
|
return linestyles[picktype][key]
|
||||||
@ -80,6 +81,7 @@ def which(program, parameter):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache(maxsize=128)
|
||||||
def make_pen(picktype, phase, key, quality):
|
def make_pen(picktype, phase, key, quality):
|
||||||
"""
|
"""
|
||||||
Make PyQtGraph.QPen
|
Make PyQtGraph.QPen
|
||||||
|
Loading…
x
Reference in New Issue
Block a user