Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the masking code to clean up the interfaces, but does not change end-to-end behavior. A major part of this change is that most masking operations will now work on the
LayeredImage
's mask layer. For example,grow_mask
will now expand the masked pixels in the mask layer instead of the science layer.LayeredImage
'sapply_mask()
function will then apply the masks to the science and variance layers.The motivations for these changes are:
WorkUnit
s. These will be cases where all the masking logic is applied when theWorkUnit
is constructed.LayeredImage
instead of acrossRawImage
,LayeredImage
, andImageStack
.RawImage
for possible eventual removal of that class.More detail on the changes:
LayeredImage
: Move the majority of the masking logic intoLayeredImage
and perform most changes on the mask layer (instead of directly onto science and variance).RawImage
: Removegrow_mask
function. All mask changes should be done throughLayeredImage
and then applied toRawImage
withapply_mask()
.ImageStack
:LayeredImage
s, such asapply_mask_flags()
.ImageStack
. Replace it with a function to create a new global mask on-demand. This allows the code to skip allocating a global mask in cases where no global masking is done.masking.py
:LayeredImage
andImageStack
. The new flow is much simpler.run_search.py
:masking.py
.Closes #415 and #352.