You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was originally implemented by @bmorris3 via #2039 . In the code above, mask only takes account of the selected aperture (if any). However, our parser reads in a whole cube array that has the bitmask plane:
While there is code to stuff the mask into Spectrum1D object, not all parser logic routes seem to trigger it (how Spectrum1D handle a bitplane is another story):
As a result, aperture seems to solely define the mask, while the actual mask cube is ignored. How is a user supposed to mask out certain bad pixels from extraction (in addition to the aperture)?
ADDITIONAL REQUIREMENT: When MASK cube does not exist, the extraction should not crash and treat all pixels as "good".
The subset choice of the selected aperture was implemented in #2664. I think the simplest solution for now is to translate to NDDataArray with
nddata=spectral_cube.get_object(cls=NDDataArray)
without specifying the subset, to get the original mask cube for the full dataset. Then we can call to_mask on the aperture's glue subset, and take the logical-and with the full mask, something like:
nddata.mask &= ~aperture_subset.to_mask() # the ~ may be needed b/c glue subset masks are "backwards"
The current documentation (at the time of original posting this issue) at https://jdaviz.readthedocs.io/en/latest/cubeviz/plugins.html#spectral-extraction does not mention at all how uncertainty and mask arrays are used in the extraction process. The uncertainty is yet another issue (#2713); here I am only focusing on mask:
jdaviz/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py
Lines 214 to 216 in b563ed3
jdaviz/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py
Line 231 in b563ed3
This was originally implemented by @bmorris3 via #2039 . In the code above, mask only takes account of the selected aperture (if any). However, our parser reads in a whole cube array that has the bitmask plane:
jdaviz/jdaviz/configs/cubeviz/plugins/parsers.py
Line 21 in b563ed3
While there is code to stuff the mask into Spectrum1D object, not all parser logic routes seem to trigger it (how Spectrum1D handle a bitplane is another story):
jdaviz/jdaviz/configs/cubeviz/plugins/parsers.py
Line 184 in b563ed3
As a result, aperture seems to solely define the mask, while the actual mask cube is ignored. How is a user supposed to mask out certain bad pixels from extraction (in addition to the aperture)?
ADDITIONAL REQUIREMENT: When MASK cube does not exist, the extraction should not crash and treat all pixels as "good".
🐱
The text was updated successfully, but these errors were encountered: