Fix masking parts of mosaics where only a single exposure contributes #271
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.
The function in
grizli.prep.find_single_image_CRsenables masking of individual exposures in parts of the final mosaic where only a single exposure contributes. With the previous behavior, small clumps of pixels where N-1 exposures in an association of N exposures were flagged as CRs were then excluded from the final mosaic. For N=2, this results in many holes across the mosaic but where pixels should probably be acceptable, the primary intention of the mask function is to mask large parts of the mosaic only sampled by single exposures, e.g., around the edges of a dither pattern.This update adds a parameter
grizli.prep.find_single_image_CRs(erode_ctx_single=3)that performs a binary erosion / dilation on the single image mask derived from the context image to fill these holes.An additional minor change treats the HST/ACS DQ=128 bit as valid, which further helps to fill gaps, especially in N=2 visits.