diff --git a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py index 81ca2a6e9f..10ea85fa2f 100644 --- a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py +++ b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py @@ -499,7 +499,7 @@ def _extract_from_aperture(self, cube, uncert_cube, mask_cube, aperture, # Also apply the cube's original mask array if mask_cube: - mask_from_cube = mask_cube.get_component('flux').data + mask_from_cube = mask_cube.get_component('flux').data.copy() # Some mask cubes have NaNs where they are not masked instead of 0 mask_from_cube[np.where(np.isnan(mask_from_cube))] = 0 mask = np.logical_or(mask, mask_from_cube.astype('bool'))