diff --git a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py index 256c25a1fe..f04bc7b620 100644 --- a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py +++ b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py @@ -391,7 +391,7 @@ def inverted_mask_non_science(self): # set to NaN, which corresponds to a pixel on the "non-science" portions # of the detector. For JWST spectral cubes, these pixels are also marked in # the DQ array with flag `513`. Also respect the loaded mask, if it exists - nan_mask = np.isnan(self.dataset.selected_obj.flux.value) + nan_mask = np.isnan(self.dataset.selected_obj.flux.value) return np.logical_not(np.logical_or(self.mask_cube.get_component('flux').data, nan_mask)).astype(float) diff --git a/jdaviz/configs/cubeviz/plugins/tests/test_parsers.py b/jdaviz/configs/cubeviz/plugins/tests/test_parsers.py index 19fe1e7b17..e3dc62c29f 100644 --- a/jdaviz/configs/cubeviz/plugins/tests/test_parsers.py +++ b/jdaviz/configs/cubeviz/plugins/tests/test_parsers.py @@ -211,9 +211,9 @@ def test_numpy_cube(cubeviz_helper): def test_loading_with_mask(cubeviz_helper): # This also tests that spaxel is converted to pix**2 - custom_spec = Spectrum1D(flux=[[[20, 1],[9, 1]],[[3, 1],[6, 5]]] * u.Unit("erg / Angstrom s cm**2 spaxel"), # noqa - spectral_axis = [1, 2]*u.AA, - mask=[[[1, 0],[0, 0]],[[0, 0],[0, 0]]]) + custom_spec = Spectrum1D(flux=[[[20, 1], [9, 1]], [[3, 1], [6, 5]]] * u.Unit("erg / Angstrom s cm**2 spaxel"), # noqa + spectral_axis=[1, 2]*u.AA, + mask=[[[1, 0], [0, 0]], [[0, 0], [0, 0]]]) with warnings.catch_warnings(): warnings.filterwarnings("ignore") cubeviz_helper.load_data(custom_spec) @@ -232,24 +232,6 @@ def test_loading_with_mask(cubeviz_helper): @pytest.mark.remote_data def test_manga_with_mask(cubeviz_helper): - # Remote data test of loading and extracting an up-to-date (as of 11/19/2024) MaNGA cube - with warnings.catch_warnings(): - warnings.filterwarnings("ignore") - cubeviz_helper.load_data("https://stsci.box.com/shared/static/gts87zqt5265msuwi4w5u003b6typ6h0.gz", cache=True) # noqa - - uc = cubeviz_helper.plugins['Unit Conversion'] - uc.spectral_y_type = "Surface Brightness" - - se = cubeviz_helper.plugins['Spectral Extraction'] - se.function = "Mean" - se.extract() - extracted_max = cubeviz_helper.get_data("Spectrum (mean)").max() - assert_allclose(extracted_max.value, 5.566169e-18) - assert extracted_max.unit == u.Unit("erg / Angstrom s cm**2 pix**2") - - -@pytest.mark.remote_data -def test_manga_cube(cubeviz_helper): # Remote data test of loading and extracting an up-to-date (as of 11/19/2024) MaNGA cube # This also tests that spaxel is converted to pix**2 with warnings.catch_warnings(): @@ -263,7 +245,7 @@ def test_manga_cube(cubeviz_helper): se.function = "Mean" se.extract() extracted_max = cubeviz_helper.get_data("Spectrum (mean)").max() - assert_allclose(extracted_max.value, 2.836957E-18) + assert_allclose(extracted_max.value, 5.566169e-18) assert extracted_max.unit == u.Unit("erg / Angstrom s cm**2 pix**2")