From 9d857db069729fd1c12d4b44d6b1f018b3351a94 Mon Sep 17 00:00:00 2001 From: "Brett M. Morris" Date: Wed, 21 Aug 2024 14:06:21 -0400 Subject: [PATCH] Review comments from Kyle --- docs/cubeviz/index.rst | 2 +- docs/rampviz/index.rst | 2 +- jdaviz/app.py | 4 ++-- jdaviz/configs/cubeviz/plugins/mixins.py | 5 ++--- jdaviz/configs/default/plugins/tools.py | 2 +- jdaviz/core/helpers.py | 9 +++------ 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/cubeviz/index.rst b/docs/cubeviz/index.rst index 6282b9c0ba..0500ff8975 100644 --- a/docs/cubeviz/index.rst +++ b/docs/cubeviz/index.rst @@ -11,7 +11,7 @@ :alt: Introductory video tour of the Cubeviz configuration and its features Cubeviz is a visualization and analysis toolbox for data cubes from -integral field units (IFUs). It is built as part of the +integral field units (IFUs). It is built on top of the `glue visualization `_ tool. Cubeviz is designed to work with data cubes from the NIRSpec and MIRI instruments on JWST, and will work with IFU data cubes. It uses diff --git a/docs/rampviz/index.rst b/docs/rampviz/index.rst index be84753229..672ec971e3 100644 --- a/docs/rampviz/index.rst +++ b/docs/rampviz/index.rst @@ -9,7 +9,7 @@ Rampviz is a visualization and analysis toolbox for ramp cubes from -infrared detectors. It is built as part of the +infrared detectors. It is built on top of the `glue visualization `_ tool. Rampviz is designed to work with ramp files from the Roman Space Telescope and JWST. diff --git a/jdaviz/app.py b/jdaviz/app.py index 826bee770a..3a3c7ad0e7 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -1778,7 +1778,7 @@ def _get_first_viewer_reference_name( table_viewers = (MosvizTableViewer, ) image_viewers = (ImvizImageView, CubevizImageView, RampvizImageView) flux_viewers = (CubevizImageView, RampvizImageView) - profile_viewers = (RampvizProfileView, ) + ramp_viewers = (RampvizProfileView, ) for vid in self._viewer_store: viewer_item = self._viewer_item_by_id(vid) @@ -1802,7 +1802,7 @@ def _get_first_viewer_reference_name( if isinstance(self._viewer_store[vid], flux_viewers) and is_returnable: return viewer_item['reference'] elif require_profile_viewer: - if isinstance(self._viewer_store[vid], profile_viewers) and is_returnable: + if isinstance(self._viewer_store[vid], ramp_viewers) and is_returnable: return viewer_item['reference'] else: if is_returnable: diff --git a/jdaviz/configs/cubeviz/plugins/mixins.py b/jdaviz/configs/cubeviz/plugins/mixins.py index 729710d02b..0ff1a3950e 100644 --- a/jdaviz/configs/cubeviz/plugins/mixins.py +++ b/jdaviz/configs/cubeviz/plugins/mixins.py @@ -1,6 +1,5 @@ import numpy as np import astropy.units as u -from astropy.nddata import NDDataArray from functools import cached_property from jdaviz.core.marks import SliceIndicatorMarks @@ -15,7 +14,7 @@ def slice_component_label(self): @property def slice_display_unit_name(self): - return 'spectral' if self.default_class != NDDataArray else 'temporal' + return 'spectral' if self.config == 'cubeviz' else 'temporal' @cached_property def slice_indicator(self): @@ -78,7 +77,7 @@ def slice_component_label(self): @property def slice_display_unit_name(self): - return 'spectral' if self.default_class != NDDataArray else 'temporal' + return 'spectral' if self.config == 'cubeviz' else 'temporal' @property def slice_values(self): diff --git a/jdaviz/configs/default/plugins/tools.py b/jdaviz/configs/default/plugins/tools.py index d7a158365f..342dbbc298 100644 --- a/jdaviz/configs/default/plugins/tools.py +++ b/jdaviz/configs/default/plugins/tools.py @@ -44,4 +44,4 @@ def deactivate(self): super().deactivate() def on_mouse_move(self, data): - raise NotImplementedError("must be implemented by sublcasses") + raise NotImplementedError("must be implemented by subclasses") diff --git a/jdaviz/core/helpers.py b/jdaviz/core/helpers.py index ffce3cf8ac..4ee627acb0 100644 --- a/jdaviz/core/helpers.py +++ b/jdaviz/core/helpers.py @@ -24,7 +24,6 @@ from astropy.nddata import NDDataArray, CCDData, StdDevUncertainty from regions.core.core import Region from specutils import Spectrum1D, SpectralRegion -from specutils.io.registers import _astropy_has_priorities from jdaviz.app import Application from jdaviz.core.events import SnackbarMessage, ExitBatchLoadMessage, SliceSelectSliceMessage @@ -1071,9 +1070,7 @@ def jdaviz_cube_fitswriter(spectrum, file_name, **kwargs): hdulist.writeto(file_name, **kwargs) -if _astropy_has_priorities(): - kwargs = {"priority": 0} -else: # pragma: no cover - kwargs = {} io_registry.register_writer( - "jdaviz-cube", Spectrum1D, jdaviz_cube_fitswriter, force=False, **kwargs) + "jdaviz-cube", Spectrum1D, jdaviz_cube_fitswriter, + force=False, priority=0 +)