Ensure masks round-trip from Spectrum1D (or other nddata-derived objects) #23
Labels
bug
Something isn't working
enhancement
New feature or request
question
Further information is requested
This issue is an evolution of #19 (see in particular #19 (review)), and #22 is basically the test that any PR solving this issue should start from (test-driven development FTW!)
However, there's a complexity here. As @nmearl pointed out to me in a Slack conversation:
Hence this issue!
My stance is that it's absolutely critical for some science workflows that glue be aware of the masks that are provided in both
Spectrum1D
and other image-orientedNDData
objects. Masks are used in many parts of astronomy to indicate critical information like "this pixel is hot, so it's only useful if the flux in it is above a certain threshold" in addition to the more prosaic "this pixel is bad". That's why theNDData
masks are meant to be "false/0 is good, and everything else is some kind of bad".This has an impedance mismatch with the glue's concept of subsets, though, which are really strictly boolean-style masks. I don't know that this is a serious conflict in that we can probably get away with having glue think of
nddata
-style masks as boolean in the intended sense of "0 is not-masked, everything else is masked", and just leave it at that for now. But if the user passes in a mask and then wants to get that object back out again using the translators, it's critical that the get back the mask they put in.It seemed to me like the solution should be to have the glue data object at import to add a
mask
attribute, which is then just used to populate themask
on output like foruncertainty
(a la #19). But then the question is what to do with existing subsets. There could be some straightforward mapping like "if a subset exists, it overwrites the mask" or possibly "the new mask is the union of the subset mask and the existing mask"?cc @astrofrog @rosteen
The text was updated successfully, but these errors were encountered: