Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the PSF-matched coadd's PSF to the model PSF used #110

Merged
merged 1 commit into from Apr 1, 2017

Conversation

yalsayyad
Copy link
Contributor

MakeCoaddTempExp does not require users to know the dimensions of
the model PSF and automatically adjusts the dimensions to match those of
the Warped PSFs. AssembleCoadd now applies the
dimension-adjusted PSF rather than the user-supplied.

@@ -619,7 +619,11 @@ def assembleMetadata(self, coaddExposure, tempExpRefList, weightList):
self.inputRecorder.addVisitToCoadd(coaddInputs, tempExp, weight)
coaddInputs.visits.sort()
if self.config.doPsfMatch:
psf = self.config.modelPsf.apply()
# set PSF to modelPsf with maximum dimensions
Copy link
Contributor

Choose a reason for hiding this comment

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

In addition to stating what the code is doing here, could you add a brief comment as to the "why"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How much do you need here? Would it be sufficient to add explanation on why maximum dimensions in the commit message or would an inline message like the following help?

        # modelPsf's BBox was dynamically defined by ModelPsfMatchTask
        # to be the square bounding the largest Warped Psf BBox

Copy link
Contributor

Choose a reason for hiding this comment

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

Both would be great! If the commit message is descriptive enough, the inline can be kept as brief as possible to provide the basic reasoning.

@@ -179,16 +179,17 @@ def createTempExp(self, calexpRefList, skyInfo, visitId=0):
if numGoodPix > 0 and not didSetMetadata:
coaddTempExp.setCalib(exposure.getCalib())
coaddTempExp.setFilter(exposure.getFilter())
# PSF replaced after loop with CoaddPsf if and only if creating direct warp
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid confusion (which I was subject to at first!), perhaps rephrase as "PSF replaced with CoaddPsf after loop..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

# set PSF to modelPsf with maximum dimensions
modelPsfList = [tempExp.getPsf() for tempExp in tempExpList]
modelPsfDimList = [modelPsf.computeBBox().getDimensions() for modelPsf in modelPsfList]
maxDim = max(modelPsfDimList)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised max(dimList) works. I can't figure out why it does, but I'm not familiar with pybind and maybe I missed something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to be clearer and more explicit

MakeCoaddTempExp does not require users to know the correct
dimensions of the model PSF and automatically adjusts the
dimensions to match those of the pre-matched Warped PSFs.
AssembleCoadd now applies the dimension-adjusted PSF model which was
actually used rather than the user-supplied PSF model.
@yalsayyad yalsayyad merged commit cb0fdd4 into master Apr 1, 2017
@ktlim ktlim deleted the tickets/DM-9564 branch August 25, 2018 06:46
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.

None yet

3 participants