Skip to content

Commit

Permalink
Merge pull request #1322 from kecnry/fix-clear-identify
Browse files Browse the repository at this point in the history
Fixing clearing identified spectral line when removed
  • Loading branch information
pllim authored May 16, 2022
2 parents 1c35523 + c576b4d commit cac9374
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ Mosviz
Specviz
^^^^^^^

- Fixed clearing an identified spectral line when its removed. [#1322]

Specviz2d
^^^^^^^^^

Expand Down
7 changes: 6 additions & 1 deletion jdaviz/configs/specviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from astropy import units as u


from jdaviz.core.events import SpectralMarksChangedMessage
from jdaviz.core.events import SpectralMarksChangedMessage, LineIdentifyMessage
from jdaviz.core.registries import viewer_registry
from jdaviz.core.marks import SpectralLine, LineUncertainties, ScatterMask
from jdaviz.core.linelists import load_preset_linelist, get_available_linelists
Expand Down Expand Up @@ -206,6 +206,11 @@ def _broadcast_plotted_lines(self, marks=None):
msg = SpectralMarksChangedMessage(marks, sender=self)
self.session.hub.broadcast(msg)

if not np.any([mark.identify for mark in marks]):
# then clear the identified entry
msg = LineIdentifyMessage(name_rest='', sender=self)
self.session.hub.broadcast(msg)

def erase_spectral_lines(self, name=None, name_rest=None, show_none=True):
"""
Erase either all spectral lines, all spectral lines sharing the same
Expand Down

0 comments on commit cac9374

Please sign in to comment.