-
Notifications
You must be signed in to change notification settings - Fork 19
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-40668: Update computation of psfStarScaledDeltaSizeScatter #843
Conversation
f49c5e7
to
023cbec
Compare
@@ -320,6 +320,7 @@ def setDefaults(self): | |||
|
|||
# All sources should be good for PSF summary statistics. | |||
self.compute_summary_stats.starSelection = "calib_photometry_used" | |||
self.compute_summary_stats.starSelector.flags.good = ["calib_photometry_used"] |
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.
This feels redundant...and why photometry
instead of psf
here? The docstring explicitly reads:
starSelection = pexConfig.Field(
doc="Field to select full list of sources used for PSF modeling.",
now (i.e with the change you made in this ticket).
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.
This is actually a bug in calibrateImage that I discussed with John P. yesterday that it doesn't propagate the psf used flag. This will be fixed when that is fixed. I'll add a to-do
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.
Ah, I see, thanks!
@@ -263,12 +298,15 @@ def update_psf_stats(self, summary, psf, bbox, sources=None, image_mask=None, so | |||
psfYY = psf_cat[self.config.psfShape + '_yy'] | |||
psfXY = psf_cat[self.config.psfShape + '_xy'] | |||
|
|||
starSize = (starXX*starYY - starXY**2.)**0.25 | |||
# Use the trace radius for the star size. | |||
starSize = np.sqrt(starXX/2. + starYY/2.) |
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.
Given the ambiguity of Size
, it may be worth it to explicitly name the variable with TraceRadius
(those reading code below might miss your comment here and assume their favorite meaning of starSize
)?
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.
I can change the internal variables to make the code cleaner. But I don't want to rename all the fields unless I really have to.
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.
Oh, yeah...agreed!
@@ -243,10 +274,14 @@ def update_psf_stats(self, summary, psf, bbox, sources=None, image_mask=None, so | |||
# good sources). | |||
return | |||
|
|||
psf_mask = sources[self.config.starSelection] & (~sources[self.config.starShape + '_flag']) | |||
nPsfStar = psf_mask.sum() | |||
# Count the number of raw psf stars |
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.
The meaning of "raw" is not clear to me here.
|
||
if nPsfStar == 0: | ||
if nPsfStarCut == 0: |
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.
Should this be set a bit higher? (i.e. do you feel that having only 1 or 2 stars is really "enough" for anything meaningful?)
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.
And maybe something more explicit, e.g. nPsfStarsUsedInStats
?
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.
Interesting question; I am inclined to use it, the values can be computed ...
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.
Ok...I guess I'm also a bit uncomfortable that we don't record how many stars were used to compute the metrics (and the danger of thinking nPsfStars
is implying that, which it's not). But this isn't your issue to deal with here!
This default cut of 0.019 has been determined from the reprocessing of HSC PDR2.
023cbec
to
9214a04
Compare
This PR updates a few things for
psfStarScaledDeltaSizeScatter
:a) Object sizes are now computed with the trace radius rather than the determinant radius (less noisy)
b) An explicit selector can be used to control the signal to noise of the size statistics.
c) The scaling factor is changed from size squared to size.
d) The default cut applied for coadds has been updated to 0.019 appropriate for this new definition, as determined from the reprocessing of HSC PDR2.