Skip to content

Commit

Permalink
fixed bug where operators would break if flagged spectra were present
Browse files Browse the repository at this point in the history
  • Loading branch information
westphallm1 committed Apr 23, 2019
1 parent 9088901 commit ef88bf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions specdal/gui/pyqt/collection_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ def update_artists(self,collection,new_lim=False):
unselected_style = self.unselected_style
flags = [s.name in collection.flags for s in collection.spectra]
collection.plot(ax=self.ax,
color='k',
style=list(np.where(flags, flag_style, unselected_style)),
style=list(np.where(flags, flag_style, 'k')),
picker=1)
#self.ax.set_title(collection.name)

Expand Down
5 changes: 5 additions & 0 deletions specdal/gui/pyqt/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def setSelectMode(self):

def _compute_prefix(self):
self.loadLabel.show()
self.spectraList.clearSelection()
self.canvas.suspendMouseNavigation()

def _compute_suffix(self):
Expand Down Expand Up @@ -324,9 +325,13 @@ def _export_dataset(self):
def _restore_dataset(self):
""" Undo any operators applied to the current dataset """
# keep track of flags
flags = self._collection.flags
# restore the original spectra
if self._directory is not None:
self._open_dataset(self._directory)
# restore flags
self.canvas.add_flagged(flags)
# restore groups

def _open_dataset(self,directory = None):
directory = directory or \
Expand Down

0 comments on commit ef88bf7

Please sign in to comment.