Skip to content

DM-55879: Correct the template variance for warping correlations - #477

Merged
isullivan merged 4 commits into
mainfrom
tickets/DM-55879
Oct 30, 2026
Merged

isullivan merged 4 commits into
mainfrom
tickets/DM-55879

Conversation

@isullivan

Copy link
Copy Markdown
Contributor

This also turns doScaleVariance off by default for the template, since that sets the variance to an incorrect value.
The unit tests are slightly refactored, allowing them to run in 12s instead of 90s on my laptop.

Comment thread python/lsst/ip/diffim/getTemplate.py Outdated
Comment thread python/lsst/ip/diffim/getTemplate.py Outdated
Comment thread python/lsst/ip/diffim/getTemplate.py Outdated
template variance if the plate scale of the coadd's constituent images
is different than the science image the template is being constructed
for. This should only be necessary if the coadd images were from a
different instrument than the science image. If the plate scale of the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "different instrument" sentence isn't technically correct or necessary; coadding to an instrument's native pixel scale has a lot of advantages, but there are valid reasons why one might not do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the "different instrument" statement is important. The correction factor it describes is due to the change in area of the pixels from the original coadded images to the science image, and does not depend on the pixelization of the coadd at all. This is separate from the warping correlation being added on this ticket, but I felt I should explain how the two correction factors interact.

Comment thread python/lsst/ip/diffim/getTemplate.py
Comment thread tests/test_getTemplate.py Outdated
Warping with a kernel normalized to unit sum moves noise power off the
variance plane's diagonal and into covariance between neighboring pixels,
which a variance plane cannot represent, leaving the variance too small
for anything measured over more than one pixel.
The correction factors should now result in a better calculation of the variance, and
doScaleVariance will actually make the result worse.
Warping all 16 patches took a couple seconds per test, and
testRunCalibratesToNanojansky warped them twice more; it now relabels
the patches' calibration instead. The getTemplate tests are about
6x faster with these changes.
@isullivan
isullivan merged commit c221691 into main Oct 30, 2026
3 checks passed
@isullivan
isullivan deleted the tickets/DM-55879 branch October 30, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants