Skip to content

Commit 062732e

Browse files
committed
Add photometry metrics and thresholds for ref cat analysis
1 parent 9c456cb commit 062732e

3 files changed

Lines changed: 142 additions & 12 deletions

File tree

pipelines/coaddQualityCore.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ tasks:
154154
class: lsst.analysis.tools.tasks.MakeBinnedCoaddTask
155155
config:
156156
binFactor: 16
157-
doBinInnerBBox: True
157+
doBinInnerBBox: true
158158
makeWholeTractImage:
159159
class: lsst.analysis.tools.tasks.WholeTractImageAnalysisTask
160160
config:
161161
connections.outputName: deep
162-
atools.coaddImage: WholeTractImageTool # wholeTractImageTool.py
163-
atools.clippedMask: WholeTractClippedMaskTool # wholeTractImageTool.py
164-
atools.coaddImagePostageStamp: WholeTractPostageStampTool # wholeTractImageTool.py
162+
atools.coaddImage: WholeTractImageTool # wholeTractImageTool.py
163+
atools.clippedMask: WholeTractClippedMaskTool # wholeTractImageTool.py
164+
atools.coaddImagePostageStamp: WholeTractPostageStampTool # wholeTractImageTool.py
165165
python: |
166166
from lsst.analysis.tools.atools import *
167167
makeBinnedTemplateNImage:
@@ -178,7 +178,7 @@ tasks:
178178
connections.data: "goodSeeingCoadd_nImage_bin"
179179
connections.outputName: "goodSeeing"
180180
dataStorageClass: "ImageU"
181-
atools.nImage: "WholeTractNImageTool" # wholeTractImageTool.py
181+
atools.nImage: "WholeTractNImageTool" # wholeTractImageTool.py
182182
python: |
183183
from lsst.analysis.tools.atools import *
184184
makeBinnedDeepNImage:
@@ -195,6 +195,6 @@ tasks:
195195
connections.data: "deepCoadd_nImage_bin"
196196
connections.outputName: "deep"
197197
dataStorageClass: "ImageU"
198-
atools.nImage: "WholeTractNImageTool" # wholeTractImageTool.py
198+
atools.nImage: "WholeTractNImageTool" # wholeTractImageTool.py
199199
python: |
200200
from lsst.analysis.tools.atools import *

python/lsst/analysis/tools/atools/refCatMatchPlots.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
FracThreshold,
5656
MeanAction,
5757
MedianAction,
58+
MedianGradientAction,
5859
RmsAction,
5960
SigmaMadAction,
6061
StdevAction,
@@ -795,6 +796,9 @@ def coaddContext(self) -> None:
795796
# Calculate magnitude difference
796797
self.process.buildActions.srcRefMagdiffStars.col1 = "{band}_psfFlux_target"
797798
self.process.buildActions.srcRefMagdiffStars.col2 = "{band}_mag_ref"
799+
self.process.buildActions.psfMag = ConvertFluxToMag(
800+
vectorKey="{band}_psfFlux_target", returnMillimags=True
801+
)
798802

799803
self.applyContext(RefMatchContext)
800804

@@ -807,6 +811,7 @@ def coaddContext(self) -> None:
807811
"ref_photom_offset_sigmaMad": "{band}_ref_photom_offset_sigmaMad_coadd",
808812
"ref_photom_offset_rms": "{band}_ref_photom_offset_rms_coadd",
809813
"ref_photom_offset_nstars": "{band}_ref_photom_offset_nstars_coadd",
814+
"ref_photom_offset_gradient": "{band}_ref_photom_offset_gradient_coadd",
810815
}
811816

812817
def visitContext(self) -> None:
@@ -835,6 +840,8 @@ def setDefaults(self):
835840
self.process.buildActions.srcRefMagdiffStars.col2 = "mag_ref"
836841
self.process.buildActions.srcRefMagdiffStars.fluxUnits2 = "mag(AB)"
837842

843+
self.process.buildActions.psfMag = ConvertFluxToMag(vectorKey="psfFlux_target", returnMillimags=True)
844+
838845
# Calculate median, std, sigmaMad, RMS, and number counts:
839846
self.process.calculateActions.ref_photom_offset = MedianAction(vectorKey="srcRefMagdiffStars")
840847
self.process.calculateActions.ref_photom_offset_mean = MeanAction(vectorKey="srcRefMagdiffStars")
@@ -844,6 +851,9 @@ def setDefaults(self):
844851
)
845852
self.process.calculateActions.ref_photom_offset_rms = RmsAction(vectorKey="srcRefMagdiffStars")
846853
self.process.calculateActions.ref_photom_offset_nstars = CountAction(vectorKey="srcRefMagdiffStars")
854+
self.process.calculateActions.ref_photom_offset_gradient = MedianGradientAction(
855+
xsVectorKey="psfMag", ysVectorKey="srcRefMagdiffStars"
856+
)
847857

848858
self.produce.metric.units = {
849859
"ref_photom_offset": "mmag",
@@ -852,4 +862,5 @@ def setDefaults(self):
852862
"ref_photom_offset_sigmaMad": "mmag",
853863
"ref_photom_offset_rms": "mmag",
854864
"ref_photom_offset_nstars": "ct",
865+
"ref_photom_offset_gradient": "",
855866
}

python/lsst/analysis/tools/metricInformation.yaml

Lines changed: 125 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ xPerpPSF_xPerp_psfFlux_sigmaMAD:
230230
psfCModelDiff_u:
231231
lowThreshold: -5
232232
highThreshold: 5
233-
divergent: True
233+
divergent: true
234234
plot: object_psfCModelScatter_ScatterPlotWithTwoHists
235235
debugGroup: photom
236236
atoolsFile: photometry.py
@@ -239,7 +239,7 @@ psfCModelDiff_u:
239239
psfCModelDiff_g:
240240
lowThreshold: -5
241241
highThreshold: 5
242-
divergent: True
242+
divergent: true
243243
plot: object_psfCModelScatter_ScatterPlotWithTwoHists
244244
debugGroup: photom
245245
atoolsFile: photometry.py
@@ -248,7 +248,7 @@ psfCModelDiff_g:
248248
psfCModelDiff_r:
249249
lowThreshold: -5
250250
highThreshold: 5
251-
divergent: True
251+
divergent: true
252252
plot: object_psfCModelScatter_ScatterPlotWithTwoHists
253253
debugGroup: photom
254254
atoolsFile: photometry.py
@@ -257,7 +257,7 @@ psfCModelDiff_r:
257257
psfCModelDiff_i:
258258
lowThreshold: -5
259259
highThreshold: 5
260-
divergent: True
260+
divergent: true
261261
plot: object_psfCModelScatter_ScatterPlotWithTwoHists
262262
debugGroup: photom
263263
atoolsFile: photometry.py
@@ -266,7 +266,7 @@ psfCModelDiff_i:
266266
psfCModelDiff_z:
267267
lowThreshold: -5
268268
highThreshold: 5
269-
divergent: True
269+
divergent: true
270270
plot: object_psfCModelScatter_ScatterPlotWithTwoHists
271271
debugGroup: photom
272272
atoolsFile: photometry.py
@@ -275,7 +275,7 @@ psfCModelDiff_z:
275275
psfCModelDiff_y:
276276
lowThreshold: -5
277277
highThreshold: 5
278-
divergent: True
278+
divergent: true
279279
plot: object_psfCModelScatter_ScatterPlotWithTwoHists
280280
debugGroup: photom
281281
atoolsFile: photometry.py
@@ -411,3 +411,122 @@ diaSourcesGoodVsBadRatio:
411411
description: |
412412
The ratio of the number of diaSources with high reliability (>0.9)
413413
over the number of diaSources with low reliability (<0.1)
414+
415+
# Ref Cat Match Metrics
416+
# ---------------------
417+
418+
u_ref_photom_offset_coadd:
419+
lowThreshold: -20
420+
highThreshold: 20
421+
divergent: true
422+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
423+
debugGroup: refCat
424+
atoolsFile: refCatMatchPlots.py
425+
description: |
426+
The difference between the measured magnitude and the reference magnitude
427+
g_ref_photom_offset_coadd:
428+
lowThreshold: -20
429+
highThreshold: 20
430+
divergent: true
431+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
432+
debugGroup: refCat
433+
atoolsFile: refCatMatchPlots.py
434+
description: |
435+
The difference between the measured magnitude and the reference magnitude
436+
r_ref_photom_offset_coadd:
437+
lowThreshold: -20
438+
highThreshold: 20
439+
divergent: true
440+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
441+
debugGroup: refCat
442+
atoolsFile: refCatMatchPlots.py
443+
description: |
444+
The difference between the measured magnitude and the reference magnitude
445+
i_ref_photom_offset_coadd:
446+
lowThreshold: -20
447+
highThreshold: 20
448+
divergent: true
449+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
450+
debugGroup: refCat
451+
atoolsFile: refCatMatchPlots.py
452+
description: |
453+
The difference between the measured magnitude and the reference magnitude
454+
z_ref_photom_offset_coadd:
455+
lowThreshold: -20
456+
highThreshold: 20
457+
divergent: true
458+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
459+
debugGroup: refCat
460+
atoolsFile: refCatMatchPlots.py
461+
description: |
462+
The difference between the measured magnitude and the reference magnitude
463+
y_ref_photom_offset_coadd:
464+
lowThreshold: -20
465+
highThreshold: 20
466+
divergent: true
467+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
468+
debugGroup: refCat
469+
atoolsFile: refCatMatchPlots.py
470+
description: |
471+
The difference between the measured magnitude and the reference magnitude
472+
473+
u_ref_photom_offset_gradient:
474+
lowThreshold: -0.001
475+
highThreshold: 0.001
476+
divergent: true
477+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
478+
debugGroup: refCat
479+
atoolsFile: refCatMatchPlots.py
480+
description: |
481+
The gradient of the medians of the difference between the measured magnitude and
482+
the reference magnitude.
483+
g_ref_photom_offset_gradient:
484+
lowThreshold: -0.001
485+
highThreshold: 0.001
486+
divergent: true
487+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
488+
debugGroup: refCat
489+
atoolsFile: refCatMatchPlots.py
490+
description: |
491+
The gradient of the medians of the difference between the measured magnitude and
492+
the reference magnitude.
493+
r_ref_photom_offset_gradient:
494+
lowThreshold: -0.001
495+
highThreshold: 0.001
496+
divergent: true
497+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
498+
debugGroup: refCat
499+
atoolsFile: refCatMatchPlots.py
500+
description: |
501+
The gradient of the medians of the difference between the measured magnitude and
502+
the reference magnitude.
503+
i_ref_photom_offset_gradient:
504+
lowThreshold: -0.001
505+
highThreshold: 0.001
506+
divergent: true
507+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
508+
debugGroup: refCat
509+
atoolsFile: refCatMatchPlots.py
510+
description: |
511+
The gradient of the medians of the difference between the measured magnitude and
512+
the reference magnitude.
513+
z_ref_photom_offset_gradient:
514+
lowThreshold: -0.001
515+
highThreshold: 0.001
516+
divergent: true
517+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
518+
debugGroup: refCat
519+
atoolsFile: refCatMatchPlots.py
520+
description: |
521+
The gradient of the medians of the difference between the measured magnitude and
522+
the reference magnitude.
523+
y_ref_photom_offset_gradient:
524+
lowThreshold: -0.001
525+
highThreshold: 0.001
526+
divergent: true
527+
plot: object_ref_match_photom_targetRefCatDeltaCModelScatterPlot_ScatterPlotWithTwoHists
528+
debugGroup: refCat
529+
atoolsFile: refCatMatchPlots.py
530+
description: |
531+
The gradient of the medians of the difference between the measured magnitude and
532+
the reference magnitude.

0 commit comments

Comments
 (0)