Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Story Points:1
-
Epic Link:
-
Sprint:DRP S19-6b
-
Team:Data Release Production
Description
In smoothArray multiplying the convolved image by numerator/denominator, was supposed to correct the roll-off produced by padding the input image with zeros.
See the last comment on https://jira.lsstcorp.org/browse/DM-17426?focusedCommentId=196713&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-196713
And conversation on #subaru_hsc:
Sogo Mineo [8:42 PM] These lines https://github.com/lsst/pipe_drivers/blob/master/python/lsst/pipe/drivers/background.py#L869
should be fixed (naively) as:
convolved = gaussian_filter(numpy.where(bad, 0.0, array), sigma, mode="constant", cval=0.0)
|
-numerator = gaussian_filter(numpy.ones_like(array), sigma, mode="constant", cval=0.0)
|
+numerator = gaussian_filter(numpy.ones_like(array), sigma, mode="constant", cval=1.0)
|
denominator = gaussian_filter(numpy.where(bad, 0.0, 1.0), sigma, mode="constant", cval=0.0)
|
return convolved*numerator/denominator
|
Let me explain: we set bad pixels to 0 in computing convolved. Doing it wrongly lowers the pixels around the bad pixels in convolved . We compensate this effect with *numerator/denominator. In computing convolved , pixels outside the input image are also set to 0 ( cval=0.0 ). It is that these pixels are regarded as a kind of bad pixels, and their effect should have been compensated together with the effect of the bad pixels inside the input image. This is why the numerator needs the fix above.
But if we compute numerator according to this fix, all elements of numerator are 1. Therefore, we can drop it altogether, hence Koike-san's proposal:
convolved = gaussian_filter(numpy.where(bad, 0.0, array), sigma, mode="constant", cval=0.0)
|
-numerator = gaussian_filter(numpy.ones_like(array), sigma, mode="constant", cval=0.0)
|
denominator = gaussian_filter(numpy.where(bad, 0.0, 1.0), sigma, mode="constant", cval=0.0)
|
-return convolved*numerator/denominator
|
+return convolved/denominator
|
Attachments
Issue Links
- is child task of
-
DM-17426 Improve full-visit sky subtraction
- Done