-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added PSF/AP ratio plot/metric + flux metric
- Loading branch information
1 parent
fdcc93c
commit ed9abce
Showing
3 changed files
with
62 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from lsst.analysis.tools.actions.scalar import MeanAction, MedianAction | ||
from lsst.analysis.tools.interfaces import AnalysisMetric | ||
|
||
|
||
class CentralTendency(AnalysisMetric): | ||
"""Metric for measuring mean and median of psf, ap, | ||
and total flux. | ||
""" | ||
|
||
def setDefaults(self): | ||
super().setDefaults() | ||
|
||
self.process.calculateActions.psFluxMedianMetric = MedianAction(vectorKey="psFlux") | ||
self.process.calculateActions.apFluxMedianMetric = MedianAction(vectorKey="apFlux") | ||
self.process.calculateActions.totFluxMedianMetric = MedianAction(vectorKey="totFlux") | ||
|
||
self.process.calculateActions.psFluxMeanMetric = MeanAction(vectorKey="psFlux") | ||
self.process.calculateActions.apFluxMeanMetric = MeanAction(vectorKey="apFlux") | ||
self.process.calculateActions.totFluxMeanMetric = MeanAction(vectorKey="totFlux") | ||
|
||
self.produce.units = { | ||
"psFluxMeanMetric": "flx", | ||
"apFluxMeanMetric": "flx", | ||
"totFluxMeanMetric": "flx", | ||
"psFluxMedianMetric": "flx", | ||
"apFluxMedianMetric": "flx", | ||
"totFluxMedianMetric": "flx", | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from lsst.analysis.tools.actions.vector import DivideVector, LoadVector | ||
from lsst.analysis.tools.interfaces import AnalysisTool | ||
|
||
|
||
class BasePsfApRatio(AnalysisTool): | ||
"""Base class for plots or metrics which use PSF/Aperture Ratios.""" | ||
|
||
def setDefaults(self): | ||
super().setDefaults() | ||
self.process.buildActions.loadVectorPsf = LoadVector() | ||
self.process.buildActions.loadVectorAp = LoadVector() | ||
|
||
# assign keys for PSF and AP Flux | ||
self.process.buildActions.loadVectorPsf.vectorKey = "psFlux" | ||
self.process.buildActions.loadVectorAp.vectorKey = "apFlux" | ||
|
||
self.process.calculateActions.fluxRatio = DivideVector( | ||
actionA=self.process.buildActions.loadVectorPsf, actionB=self.process.buildActions.loadVectorAp | ||
) |
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