From 5130cafd8f8790a3e09b2d82c5ee721a1b909d9f Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Mon, 11 Nov 2024 15:32:02 -0500 Subject: [PATCH] Footprints plugin: handle subsets/markers when linking by WCS (#3276) * update alert language in orientation plugin * footprints: if changing link type fails, redirect to orientation plugin - not ideal if the plugin is either inline or a popout... in the future we could detect whether there are subsets or markers and edit the text to say they will be removed (either in one button or additional buttons as-per the orientation plugin) --- CHANGES.rst | 5 +++++ .../imviz/plugins/footprints/footprints.py | 6 +++++- .../imviz/plugins/orientation/orientation.vue | 17 +++++++++++------ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index a1c278dc7a..631f974490 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -89,6 +89,11 @@ Imviz - Remove "From File.." option when running on an external server. [#3239] +- Button in the footprints plugin to change the link-type now redirects to the orientation plugin + when the change fails due to the presence of subsets or markers. [#3276] + +- Updates UI language in the orientation plugin to better match API. [#3276] + Mosviz ^^^^^^ diff --git a/jdaviz/configs/imviz/plugins/footprints/footprints.py b/jdaviz/configs/imviz/plugins/footprints/footprints.py index d27f46f8c2..4340494998 100644 --- a/jdaviz/configs/imviz/plugins/footprints/footprints.py +++ b/jdaviz/configs/imviz/plugins/footprints/footprints.py @@ -197,7 +197,11 @@ def vue_link_by_wcs(self, *args): # call other plugin so that other options (wcs_fast_approximation, wcs_use_fallback) # are retained. Remove this method if support for plotting footprints # when pixel-linked is reintroduced. - self.app._jdaviz_helper.plugins['Orientation'].align_by = 'WCS' + op = self.app._jdaviz_helper.plugins['Orientation'] + if op._obj.need_clear_astrowidget_markers or op._obj.need_clear_subsets: + op.open_in_tray() + else: + op.align_by = 'WCS' def _ensure_first_overlay(self): if not len(self._overlays): diff --git a/jdaviz/configs/imviz/plugins/orientation/orientation.vue b/jdaviz/configs/imviz/plugins/orientation/orientation.vue index 451739dde3..fc1345590a 100644 --- a/jdaviz/configs/imviz/plugins/orientation/orientation.vue +++ b/jdaviz/configs/imviz/plugins/orientation/orientation.vue @@ -23,12 +23,20 @@ - Switching link type will reset zoom. + Switching alignment will reset zoom. + + + + Marker positions may not be pixel-perfect when changing alignment/linking options. @@ -38,12 +46,9 @@ - - Marker positions may not be pixel-perfect when changing alignment/linking options. - - Existing subsets will be deleted on changing alignment/linking options. + Existing subsets must be deleted before changing alignment/linking options. {{ api_hints_enabled ?