From 06d35be1fd80df7484efcc466b053b6e3f70a123 Mon Sep 17 00:00:00 2001 From: Ricky O'Steen Date: Tue, 1 Oct 2024 10:59:08 -0400 Subject: [PATCH 1/2] Also listen to SubsetCreateMessage here --- jdaviz/core/template_mixin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jdaviz/core/template_mixin.py b/jdaviz/core/template_mixin.py index 0eb455691c..84b33cd179 100644 --- a/jdaviz/core/template_mixin.py +++ b/jdaviz/core/template_mixin.py @@ -1875,6 +1875,8 @@ def __init__(self, plugin, items, selected, multiselect=None, selected_has_subre self.hub.subscribe(self, SubsetUpdateMessage, handler=lambda msg: self._update_subset(msg.subset, msg.attribute)) + self.hub.subscribe(self, SubsetCreateMessage, + handler=lambda msg: self._update_subset(msg.subset)) self.hub.subscribe(self, SubsetDeleteMessage, handler=lambda msg: self._delete_subset(msg.subset)) From 73c04424847a39cd51e184ffc5c8b43d41060359 Mon Sep 17 00:00:00 2001 From: Ricky O'Steen Date: Tue, 1 Oct 2024 12:57:45 -0400 Subject: [PATCH 2/2] Debugging --- .../spectral_extraction/spectral_extraction.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py index a01101dfdb..07a890eae5 100644 --- a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py +++ b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py @@ -262,6 +262,7 @@ def _aperture_items_changed(self, msg): self._extract_in_new_instance(subset_lbl=subset_lbl, auto_update=True, add_data=True) except Exception: + raise msg = SnackbarMessage( f"Automatic {self.resulting_product_name} extraction for {subset_lbl} failed", # noqa color='error', sender=self, timeout=10000) @@ -438,9 +439,14 @@ def _extract_from_aperture(self, cube, uncert_cube, aperture, subset_id=aperture.selected, cls=NDDataArray ) if uncert_cube: - uncertainties = uncert_cube.get_subset_object( - subset_id=aperture.selected, cls=StdDevUncertainty - ) + try: + # Subset may not be linked to the uncertainty cube at this point?? + uncertainties = uncert_cube.get_subset_object( + subset_id=aperture.selected, cls=StdDevUncertainty + ) + except ValueError: + raise + uncertainties = None else: uncertainties = None