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
DM-36717: Diffim bug fixes #235
Conversation
isullivan
commented
Oct 26, 2022
- Uses a more accurate PSF FWHM for constructing the kernel basis list
- Applies the template PhotoCalib before constructing the PSF matching kernel
- Rejects flagged sources and sky sources from source list before selecting kernel candidates.
fa455de
to
03a7a11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments, especially the one about setting the photometric calib scale to the science image.
python/lsst/ip/diffim/utils.py
Outdated
|
||
Parameters | ||
---------- | ||
psf : `lsst.afw.detection.Psf` | ||
Point spread function (PSF) to evaluate. | ||
average : `bool`, optional | ||
Set to return the average width. | ||
|
||
Returns | ||
------- | ||
psfSize : `float` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the returns description need to be changed since you could also be returning what appears to be a tuple when average = False?
# put the template on the same photometric scale as the science image | ||
photoCalib = template.getPhotoCalib() | ||
self.log.info("Applying photometric calibration to template: %f", photoCalib.getCalibrationMean()) | ||
template.maskedImage = photoCalib.calibrateImage(template.maskedImage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the science image involved here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not, the template is read in with units of counts, so this applies the template's calibration to put it in nJy. That should make it comparable to the science image, which should make work slightly easier for calculating the matching kernel.
candidateList=sources, | ||
preconvolved=False) | ||
selectSources = self._sourceSelector(sources) | ||
self.log.info("%i sources used out of %i from the input catalog", len(selectSources), len(sources)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to do some alerting/error raising if zero sources are selected? Might save time later...
03a7a11
to
82e78da
Compare