From 42d05dca596649a83dc1e87f47697f7fed8d7515 Mon Sep 17 00:00:00 2001 From: gibsongreen Date: Thu, 24 Oct 2024 16:53:38 -0400 Subject: [PATCH] remove global display unit change handler, syntax error in helpers --- jdaviz/configs/default/plugins/markers/markers.py | 11 +---------- jdaviz/core/helpers.py | 4 ++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/jdaviz/configs/default/plugins/markers/markers.py b/jdaviz/configs/default/plugins/markers/markers.py index 2793b455c9..c6112cb283 100644 --- a/jdaviz/configs/default/plugins/markers/markers.py +++ b/jdaviz/configs/default/plugins/markers/markers.py @@ -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 @@ -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 @@ -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 diff --git a/jdaviz/core/helpers.py b/jdaviz/core/helpers.py index 4f6564ca2e..567074b043 100644 --- a/jdaviz/core/helpers.py +++ b/jdaviz/core/helpers.py @@ -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)