Skip to content

Commit

Permalink
support _orig_spec in _get_continuum
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Dec 7, 2023
1 parent acd7ffe commit 9b6350f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion jdaviz/configs/cubeviz/plugins/moment_maps/moment_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def calculate_moment(self, add_data=True):
else:
cube = self.dataset.selected_obj
else:
# TODO: need to account for _orig_spec here?
_, _, cube = self._get_continuum(self.dataset,
'per-pixel',
self.spectral_subset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ def _is_active_changed(self, msg):
if self.disabled_msg:
return

# TODO: move to mixin?
for pos, mark in self.continuum_marks.items():
mark.visible = self.is_active
self._calculate_statistics(msg)
Expand Down
5 changes: 4 additions & 1 deletion jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,10 @@ def _get_continuum(self, dataset, spatial_subset, spectral_subset, update_marks=
if spatial_subset == 'per-pixel':
if self.app.config != 'cubeviz':
raise ValueError("per-pixel only supported for cubeviz")

Check warning on line 2055 in jdaviz/core/template_mixin.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/core/template_mixin.py#L2055

Added line #L2055 was not covered by tests
full_spectrum = dataset.selected_obj
if "_orig_spec" in self.dataset.selected_obj.meta:
full_spectrum = self.dataset.selected_obj.meta["_orig_spec"]

Check warning on line 2057 in jdaviz/core/template_mixin.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/core/template_mixin.py#L2057

Added line #L2057 was not covered by tests
else:
full_spectrum = self.dataset.selected_obj
else:
full_spectrum = dataset.selected_spectrum_for_spatial_subset(spatial_subset.selected if spatial_subset is not None else None, # noqa
use_display_units=True)
Expand Down

0 comments on commit 9b6350f

Please sign in to comment.