Skip to content

Commit

Permalink
remove global display unit change handler, syntax error in helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsongreen committed Oct 24, 2024
1 parent 43b2123 commit 42d05dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 1 addition & 10 deletions jdaviz/configs/default/plugins/markers/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from jdaviz.core.events import (ViewerAddedMessage, ChangeRefDataMessage,
AddDataMessage, RemoveDataMessage,
MarkersPluginUpdate, GlobalDisplayUnitChanged)
MarkersPluginUpdate)
from jdaviz.core.marks import MarkersMark
from jdaviz.core.registries import tray_registry
from jdaviz.core.template_mixin import PluginTemplateMixin, ViewerSelectMixin, TableMixin
Expand Down Expand Up @@ -97,9 +97,6 @@ def __init__(self, *args, **kwargs):
self.hub.subscribe(self, RemoveDataMessage,
handler=lambda msg: self._recompute_mark_positions(msg.viewer))

self.hub.subscribe(self, GlobalDisplayUnitChanged,
handler=self._on_global_display_unit_changed)

def _create_viewer_callbacks(self, viewer):
if not self.is_active:
return
Expand All @@ -110,12 +107,6 @@ def _create_viewer_callbacks(self, viewer):
def _on_viewer_added(self, msg):
self._create_viewer_callbacks(self.app.get_viewer_by_id(msg.viewer_id))

def _on_global_display_unit_changed(self, msg, viewer=None):
# all cubes are converted to surface brightness so we just need to
# listen to SB for cubeviz unit changes
if msg.axis == "flux":
self.image_unit = u.Unit(msg.unit)

def _recompute_mark_positions(self, viewer):
if self.table is None or self.table._qtable is None:
return
Expand Down
4 changes: 2 additions & 2 deletions jdaviz/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ def _handle_display_units(self, data, use_display_units=True):

else:
new_uncert = None
new_y = flux_conversion(data.flux.value, data.flux.unit,
y_unit, spec=data) * u.Unit(y_unit)
new_y = flux_conversion(data.flux.value, data.flux.unit,
y_unit, spec=data) * u.Unit(y_unit)
new_spec = (spectral_axis_conversion(data.spectral_axis.value,
data.spectral_axis.unit,
spectral_unit)
Expand Down

0 comments on commit 42d05dc

Please sign in to comment.