Skip to content

Commit

Permalink
Footprints plugin: handle subsets/markers when linking by WCS (#3276)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
kecnry authored Nov 11, 2024
1 parent 1f57249 commit 5130caf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^

Expand Down
6 changes: 5 additions & 1 deletion jdaviz/configs/imviz/plugins/footprints/footprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
17 changes: 11 additions & 6 deletions jdaviz/configs/imviz/plugins/orientation/orientation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@
</v-alert>

<v-alert
v-if="wcs_linking_available"
v-if="wcs_linking_available && !need_clear_astrowidget_markers && !need_clear_subsets"
type='warning'
class="ignore-api-hints"
style="margin-left: -12px; margin-right: -12px"
>
Switching link type will reset zoom.
Switching alignment will reset zoom.
</v-alert>

<v-alert
v-if="plugin_markers_exist && !need_clear_astrowidget_markers && !need_clear_subsets"
type='warning'
style="margin-left: -12px; margin-right: -12px"
>
Marker positions may not be pixel-perfect when changing alignment/linking options.
</v-alert>

<v-alert v-if="need_clear_astrowidget_markers" type='warning' style="margin-left: -12px; margin-right: -12px">
Expand All @@ -38,12 +46,9 @@
</v-row>
</v-alert>

<v-alert v-if="plugin_markers_exist" type='warning' style="margin-left: -12px; margin-right: -12px">
Marker positions may not be pixel-perfect when changing alignment/linking options.
</v-alert>

<v-alert v-if="need_clear_subsets" type='warning' style="margin-left: -12px; margin-right: -12px">
Existing subsets will be deleted on changing alignment/linking options.
Existing subsets must be deleted before changing alignment/linking options.
<v-row justify="end" style="margin-right: 2px; margin-top: 16px">
<v-btn @click="delete_subsets">
{{ api_hints_enabled ?
Expand Down

0 comments on commit 5130caf

Please sign in to comment.