diff --git a/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py b/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py index 59c2103c97..3d8f02d986 100644 --- a/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py +++ b/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py @@ -673,10 +673,9 @@ def _import_spectral_regions(self, spec_region, mode=NewMode): OrMode will create a composite subset with each subregion corresponding to a subregion of a single subset. """ + viewer_name = self.app._jdaviz_helper._default_spectrum_viewer_reference_name + spectrum_viewer = self.app.get_viewer(viewer_name) for sub_region in spec_region: - viewer_name = self.app._jdaviz_helper._default_spectrum_viewer_reference_name - spectrum_viewer = self.app.get_viewer(viewer_name) - spectrum_viewer.toolbar.active_tool = spectrum_viewer.toolbar.tools['bqplot:xrange'] self.app.session.edit_subset_mode.mode = mode spectrum_viewer.apply_roi(XRangeROI(sub_region.lower.value, sub_region.upper.value)) diff --git a/jdaviz/configs/default/plugins/subset_plugin/tests/test_subset_plugin.py b/jdaviz/configs/default/plugins/subset_plugin/tests/test_subset_plugin.py index 1b5c8cda3e..62eeb8c6fe 100644 --- a/jdaviz/configs/default/plugins/subset_plugin/tests/test_subset_plugin.py +++ b/jdaviz/configs/default/plugins/subset_plugin/tests/test_subset_plugin.py @@ -1,6 +1,5 @@ import warnings import pytest -import json import numpy as np from astropy.nddata import NDData