Skip to content

Commit

Permalink
Review comments from Kyle
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Aug 21, 2024
1 parent b7ad85b commit 9d857db
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/cubeviz/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://glueviz.org>`_ 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
Expand Down
2 changes: 1 addition & 1 deletion docs/rampviz/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://glueviz.org>`_ tool. Rampviz is designed to work
with ramp files from the Roman Space Telescope and JWST.

Expand Down
4 changes: 2 additions & 2 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions jdaviz/configs/cubeviz/plugins/mixins.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/configs/default/plugins/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
9 changes: 3 additions & 6 deletions jdaviz/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)

0 comments on commit 9d857db

Please sign in to comment.