wfDataPlot stations now sorted by network and then by name

This commit is contained in:
Marcel Paffrath 2017-05-29 13:49:34 +02:00
parent cb91911313
commit a2ca96ae57
3 changed files with 17 additions and 12 deletions

View File

@ -2015,6 +2015,7 @@ class MainWindow(QMainWindow):
def setDirty(self, value):
self.saveProjectAction.setEnabled(value)
self.project.setDirty(value)
self.dirty = value
def closeEvent(self, event):
@ -2057,9 +2058,9 @@ class Project(object):
event = Event(item)
if not event.path in self.getPaths():
self.eventlist.append(event)
self.setDirty()
else:
print('Skipping event with path {}. Already part of project.'.format(event.path))
self.setDirty()
def getPaths(self):
'''
@ -2070,11 +2071,8 @@ class Project(object):
paths.append(event.path)
return paths
def setDirty(self):
self.dirty = True
def setClean(self):
self.dirty = False
def setDirty(self, value=True):
self.dirty = value
def getEventFromPath(self, path):
'''
@ -2102,7 +2100,7 @@ class Project(object):
try:
outfile = open(filename, 'wb')
cPickle.dump(self, outfile, -1)
self.setClean()
self.setDirty(False)
except Exception as e:
print('Could not pickle PyLoT project. Reason: {}'.format(e))
self.setDirty()

View File

@ -1 +1 @@
3ad8-dirty
cb91-dirty

View File

@ -438,10 +438,17 @@ class WaveformWidget(FigureCanvas):
wfstart, wfend = full_range(wfdata)
nmax = 0
compclass = SetChannelComponents()
for n, trace in enumerate(wfdata):
channel = trace.stats.channel
network = trace.stats.network
station = trace.stats.station
# list containing tuples of network, station, channel (for sorting)
nsc = []
for trace in wfdata:
nsc.append((trace.stats.network, trace.stats.station, trace.stats.channel))
nsc.sort()
nsc.reverse()
for n, (network, station, channel) in enumerate(nsc):
st = wfdata.select(network=network, station=station, channel=channel)
trace = st[0]
if mapping:
comp = channel[-1]
n = compclass.getCompPosition(str(comp))