Skip to content

Commit 9b34d29

Browse files
Add flat metrics for mean, noise vs mjd and FP plots
1 parent 428eb07 commit 9b34d29

2 files changed

Lines changed: 49 additions & 5 deletions

File tree

pipelines/cpCore.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,25 @@ tasks:
139139
python: |
140140
from lsst.analysis.tools.atools import *
141141
142+
analyzeFlatCore:
143+
class: lsst.analysis.tools.tasks.VerifyCalibAnalysisTaskByFilter
144+
config:
145+
connections.outputName: cpFlatCore
146+
connections.data: verifyFlatResults
147+
148+
atools.flatMeanPerAmp: CalibStatisticFocalPlanePlot
149+
atools.flatMeanPerAmp.produce.plot.addHistogram: true
150+
atools.flatMeanPerAmp.quantityKey: FLAT_MEAN
151+
atools.flatMeanPerAmp.unit: electron
152+
153+
atools.flatNoisePerAmp: CalibStatisticFocalPlanePlot
154+
atools.flatNoisePerAmp.produce.plot.addHistogram: true
155+
atools.flatNoisePerAmp.quantityKey: FLAT_NOISE
156+
atools.flatNoisePerAmp.unit: electron
157+
158+
python: |
159+
from lsst.analysis.tools.atools import *
160+
142161
analyzeFlatDetCore:
143162
class: lsst.analysis.tools.tasks.VerifyCalibAnalysisTaskByFilter
144163
config:
@@ -154,6 +173,27 @@ tasks:
154173
atools.flatTestsByDate.produce.plot.xAxisLabel: "MJD"
155174
atools.flatTestsByDate.produce.plot.yAxisLabel: "Test Pass Results"
156175

176+
atools.flatMeansByDate: CalibAmpScatterTool
177+
atools.flatMeansByDate.prep.panelKey: amplifier
178+
atools.flatMeansByDate.prep.dataKey: mjd
179+
atools.flatMeansByDate.prep.quantityKey: FLAT_MEAN
180+
atools.flatMeansByDate.produce.plot.xAxisLabel: "MJD"
181+
atools.flatMeansByDate.produce.plot.yAxisLabel: "Flat Mean (electrons)"
182+
183+
atools.flatNoiseByDate: CalibAmpScatterTool
184+
atools.flatNoiseByDate.prep.panelKey: amplifier
185+
atools.flatNoiseByDate.prep.dataKey: mjd
186+
atools.flatNoiseByDate.prep.quantityKey: FLAT_NOISE
187+
atools.flatNoiseByDate.produce.plot.xAxisLabel: "MJD"
188+
atools.flatNoiseByDate.produce.plot.yAxisLabel: "Flat Noise (electrons)"
189+
190+
atools.flatNoiseByMean: CalibAmpScatterTool
191+
atools.flatNoiseByMean.prep.panelKey: amplifier
192+
atools.flatNoiseByMean.prep.dataKey: FLAT_MEAN
193+
atools.flatNoiseByMean.prep.quantityKey: FLAT_NOISE
194+
atools.flatNoiseByMean.produce.plot.xAxisLabel: "Flat Mean (electrons)"
195+
atools.flatNoiseByMean.produce.plot.yAxisLabel: "Flat Noise (electrons)"
196+
157197
python: |
158198
from lsst.analysis.tools.atools import *
159199

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
from typing import cast
3535

36+
import numpy
3637
from lsst.pex.config import Field
3738
from lsst.pex.config.configurableActions import ConfigurableActionField
3839

@@ -90,16 +91,19 @@ class SingleValueRepacker(KeyedDataAction):
9091

9192
def __call__(self, data: KeyedData, **kwargs) -> KeyedData:
9293
repackedData = {}
93-
uniquePanelKeys = list(set(data[self.panelKey]))
94+
good = ~data[self.panelKey].mask
95+
uniquePanelKeys = numpy.unique(data[self.panelKey])
96+
uniquePanelKeys = uniquePanelKeys.data[~uniquePanelKeys.mask].data
9497

95-
# Loop over data vector to repack information as it is expected.
98+
# Loop over data vector to repack information as
99+
# it is expected.
96100
for i in range(len(uniquePanelKeys)):
97101
repackedData[f"{uniquePanelKeys[i]}_x"] = []
98102
repackedData[f"{uniquePanelKeys[i]}"] = []
99103

100-
panelVec = cast(Vector, data[self.panelKey])
101-
dataVec = cast(Vector, data[self.dataKey])
102-
quantityVec = cast(Vector, data[self.quantityKey])
104+
panelVec = cast(Vector, data[self.panelKey][good])
105+
dataVec = cast(Vector, data[self.dataKey][good])
106+
quantityVec = cast(Vector, data[self.quantityKey][good])
103107

104108
for i in range(len(panelVec)):
105109
repackedData[f"{panelVec[i]}_x"].append(dataVec[i])

0 commit comments

Comments
 (0)