-
Notifications
You must be signed in to change notification settings - Fork 6
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
tickets/DM-12431: re-Verify performance of matchPessimisticB with new distortions. #79
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
af07887
Added sigma clipping to final matches.
morriscb b85af8d
Separated softening of pattern and max dist softening loops.
morriscb 9db913f
Responded to reviewer comments.
morriscb 9301154
Add clarity to simg clipping comment.
morriscb bddc773
Fix bug in match softening loop.
morriscb File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
import numpy as np | ||
from scipy.spatial import cKDTree | ||
from scipy.stats import sigmaclip | ||
|
||
import lsst.pex.config as pexConfig | ||
import lsst.pipe.base as pipeBase | ||
|
@@ -490,15 +491,16 @@ def _doMatch(self, refCat, sourceCat, wcs, refFluxField, numUsableSources, | |
# we need to remove as many false positives as possible before sending | ||
# the matches off to the solver. | ||
distances_arcsec = np.degrees(matcher_struct.distances_rad) * 3600 | ||
clip_max_dist = np.max( | ||
(sigmaclip(distances_arcsec, low=100, high=2)[-1], | ||
self.config.minMatchDistPixels * wcs.pixelScale().asArcseconds()) | ||
) | ||
# We pick the largest of the the unsoftened maxMatchDistArcSec or | ||
# a user specified distance in pixels. This prevents the | ||
# AstrometryTask._matchAndFitWCS from over-fitting to a small number of | ||
# objects and also allows the WCS fitter to bring in more matches as | ||
# the WCS fit improves. | ||
dist_cut_arcsec = np.max( | ||
(self.config.minMatchDistPixels * wcs.pixelScale().asArcseconds(), | ||
maxMatchDistArcSec) | ||
) | ||
dist_cut_arcsec = np.min((clip_max_dist, maxMatchDistArcSec)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this makes the comment above untrue, right? You are no longer picking the largest of anything, but the smallest of the sigma clipped cut and |
||
|
||
# A match has been found, return our list of matches and | ||
# return. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's the justification for these values of
low
andhigh
? They just seem like magic numbers 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.
The are the number of sigma for the clip. Low is 100 because the lower bound is always a value of 0 and high is a 2 sigma cut. I will add a comment explaining this. I could also make the high value a configurable if that is useful.