Skip to content

Commit

Permalink
Add snackbar warning and note in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Dec 5, 2024
1 parent cee52af commit 001603b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/cubeviz/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The slice plugin provides the ability to select the slice
of the cube currently visible in the image viewers, with the
corresponding wavelength highlighted in the spectrum viewer.

To choose a specific slice, enter an approximate wavelength (in which case the nearest slice will
To choose a specific slice, enter an approximate wavelength (in which case the nearest slice will
be selected and the wavelength entry will "span" to the exact value of that slice). The snapping
behavior can be disabled in the plugin settings to allow for smooth scrubbing, in which case the
closest slice will still be displayed in the cube viewer.
Expand Down Expand Up @@ -301,6 +301,9 @@ optionally choose a :guilabel:`Spatial region`, if you have one.
Click :guilabel:`EXTRACT` to produce a new 1D spectrum dataset
from the spectral cube, which has uncertainties propagated by
`astropy.nddata <https://docs.astropy.org/en/stable/nddata/nddata.html>`_.
By default, if a mask was loaded with the cube, it will be applied to the
cube when extracting in addition to any subsets chosen as an aperture. This
is not currently done for Data Quality arrays, e.g. the DQ extension in JWST files.

If using a simple subset (currently only works for a circular subset applied to data
with spatial axis units in wavelength) for the spatial aperture, an option to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ def _extract_from_aperture(self, cube, uncert_cube, mask_cube, aperture,

# Also apply the cube's original mask array
if mask_cube:
snackbar_message = SnackbarMessage(
f"Note: Applied loaded mask cube during extraction",
color="warning",
sender=self)
self.hub.broadcast(snackbar_message)
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
Expand Down

0 comments on commit 001603b

Please sign in to comment.