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

DM-36717: Diffim bug fixes #235

Merged
merged 3 commits into from Nov 4, 2022
Merged

DM-36717: Diffim bug fixes #235

merged 3 commits into from Nov 4, 2022

Conversation

isullivan
Copy link
Contributor

  • 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.

@isullivan isullivan force-pushed the tickets/DM-36717 branch 2 times, most recently from fa455de to 03a7a11 Compare October 26, 2022 00:26
Copy link
Contributor

@kherner kherner left a 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.


Parameters
----------
psf : `lsst.afw.detection.Psf`
Point spread function (PSF) to evaluate.
average : `bool`, optional
Set to return the average width.

Returns
-------
psfSize : `float`
Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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))
Copy link
Contributor

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...

@isullivan isullivan merged commit fd94035 into main Nov 4, 2022
@isullivan isullivan deleted the tickets/DM-36717 branch November 4, 2022 00:05
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

2 participants