Skip to content

Commit

Permalink
Require goodMatches to have median S/N > 3.
Browse files Browse the repository at this point in the history
Note: The 'brightSnr' cut for calculating SRD metrics remains
a much more strigent additional cut on the S/N suitable for
restricting to bright sources for the purposes of calculating SRD metrics.
  • Loading branch information
wmwv committed Mar 22, 2016
1 parent 0d53f37 commit 009f080
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python/lsst/validate/drp/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ def analyzeData(allMatches, safeSnr=50.0, verbose=False):
- snr: median PSF flux SNR for good matches
- dist: RMS RA/Dec separation, in milliarcsecond
- goodMatches: all good matches, as an afw.table.GroupView;
good matches contain sources that have a finite (non-nan) PSF magnitude
and do not have flags set for bad, cosmic ray, edge or saturated
good matches contain only objects whose detections all have
* a PSF Flux measurement with S/N > 1
* a finite (non-nan) PSF magnitude
- This separate check is largely to reject failed zeropoints.
* and do not have flags set for bad, cosmic ray, edge or saturated
- safeMatches: safe matches, as an afw.table.GroupView;
safe matches are good matches that are sufficiently bright and sufficiently compact
"""
Expand All @@ -180,6 +183,7 @@ def analyzeData(allMatches, safeSnr=50.0, verbose=False):
psfMagErrKey = allMatches.schema.find("base_PsfFlux_magerr").key
extendedKey = allMatches.schema.find("base_ClassificationExtendedness_value").key

goodSnr = 1
def goodFilter(cat):
if len(cat) < nMatchesRequired:
return False
Expand All @@ -188,7 +192,9 @@ def goodFilter(cat):
return False
if not np.isfinite(cat.get(psfMagKey)).all():
return False
return True
psfSnr = np.median(cat.get(psfSnrKey))
# Note that this also implicitly checks for psfSnr being non-nan.
return psfSnr >= goodSnr

goodMatches = allMatches.where(goodFilter)

Expand Down

0 comments on commit 009f080

Please sign in to comment.