wfDataPlot stations now sorted by network and then by name
This commit is contained in:
parent
cb91911313
commit
a2ca96ae57
12
QtPyLoT.py
12
QtPyLoT.py
@ -2015,6 +2015,7 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
def setDirty(self, value):
|
def setDirty(self, value):
|
||||||
self.saveProjectAction.setEnabled(value)
|
self.saveProjectAction.setEnabled(value)
|
||||||
|
self.project.setDirty(value)
|
||||||
self.dirty = value
|
self.dirty = value
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
@ -2057,9 +2058,9 @@ class Project(object):
|
|||||||
event = Event(item)
|
event = Event(item)
|
||||||
if not event.path in self.getPaths():
|
if not event.path in self.getPaths():
|
||||||
self.eventlist.append(event)
|
self.eventlist.append(event)
|
||||||
|
self.setDirty()
|
||||||
else:
|
else:
|
||||||
print('Skipping event with path {}. Already part of project.'.format(event.path))
|
print('Skipping event with path {}. Already part of project.'.format(event.path))
|
||||||
self.setDirty()
|
|
||||||
|
|
||||||
def getPaths(self):
|
def getPaths(self):
|
||||||
'''
|
'''
|
||||||
@ -2070,11 +2071,8 @@ class Project(object):
|
|||||||
paths.append(event.path)
|
paths.append(event.path)
|
||||||
return paths
|
return paths
|
||||||
|
|
||||||
def setDirty(self):
|
def setDirty(self, value=True):
|
||||||
self.dirty = True
|
self.dirty = value
|
||||||
|
|
||||||
def setClean(self):
|
|
||||||
self.dirty = False
|
|
||||||
|
|
||||||
def getEventFromPath(self, path):
|
def getEventFromPath(self, path):
|
||||||
'''
|
'''
|
||||||
@ -2102,7 +2100,7 @@ class Project(object):
|
|||||||
try:
|
try:
|
||||||
outfile = open(filename, 'wb')
|
outfile = open(filename, 'wb')
|
||||||
cPickle.dump(self, outfile, -1)
|
cPickle.dump(self, outfile, -1)
|
||||||
self.setClean()
|
self.setDirty(False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('Could not pickle PyLoT project. Reason: {}'.format(e))
|
print('Could not pickle PyLoT project. Reason: {}'.format(e))
|
||||||
self.setDirty()
|
self.setDirty()
|
||||||
|
@ -1 +1 @@
|
|||||||
3ad8-dirty
|
cb91-dirty
|
||||||
|
@ -438,10 +438,17 @@ class WaveformWidget(FigureCanvas):
|
|||||||
wfstart, wfend = full_range(wfdata)
|
wfstart, wfend = full_range(wfdata)
|
||||||
nmax = 0
|
nmax = 0
|
||||||
compclass = SetChannelComponents()
|
compclass = SetChannelComponents()
|
||||||
for n, trace in enumerate(wfdata):
|
|
||||||
channel = trace.stats.channel
|
# list containing tuples of network, station, channel (for sorting)
|
||||||
network = trace.stats.network
|
nsc = []
|
||||||
station = trace.stats.station
|
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:
|
if mapping:
|
||||||
comp = channel[-1]
|
comp = channel[-1]
|
||||||
n = compclass.getCompPosition(str(comp))
|
n = compclass.getCompPosition(str(comp))
|
||||||
|
Loading…
Reference in New Issue
Block a user