Skip to content

Commit

Permalink
Pass isrStatistics to output dictionary.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Jan 12, 2024
1 parent 3cbd9af commit 7882c60
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pipelines/_ingredients/VerifyDark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ tasks:
doFlat: false
doApplyGains: false
doFringe: false
doCalculateStatistics: true
isrStats.doCalibDistributionStatistics: true
verifyDarkChip:
class: lsst.cp.verify.CpVerifyDarkTask
config:
connections.inputExp: 'verifyDarkProc'
connections.taskMetadata: 'verifyDarkApply_metadata'
connections.outputStats: 'verifyDarkDetStats'
useIsrStatistics: true
verifyDarkExp:
class: lsst.cp.verify.CpVerifyExpMergeTask
config:
Expand Down
19 changes: 19 additions & 0 deletions python/lsst/cp/verify/verifyStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ class CpVerifyStatsConnections(
dimensions=["instrument", ],
isCalibration=True,
)
isrStatistics = cT.Input(
name="isrStatistics",
storageClass="StructuredDataDict",
doc="Pre-calculated statistics from IsrTask.",
dimensions=["instrument", "exposure", "detector"],
)

outputStats = cT.Output(
name="detectorStats",
doc="Output statistics from cp_verify.",
Expand All @@ -98,6 +105,9 @@ def __init__(self, *, config=None):
if len(config.uncorrectedImageStatKeywords) < 1:
self.inputs.discard("uncorrectedExp")

if config.useIsrStatistics is not True:
self.inputs.discard("isrStatistics")


class CpVerifyStatsConfig(
pipeBase.PipelineTaskConfig, pipelineConnections=CpVerifyStatsConnections
Expand Down Expand Up @@ -212,6 +222,11 @@ class CpVerifyStatsConfig(
doc="Statistics to create for the full detector from the per-amplifier measurements.",
default={},
)
useIsrStatistics = pexConfig.Field(
dtype=bool,
doc="Use statistics calculated by IsrTask?",
default=False,
)


class CpVerifyStatsTask(pipeBase.PipelineTask):
Expand All @@ -233,6 +248,7 @@ def run(
self,
inputExp,
camera,
isrStatistics=None,
uncorrectedExp=None,
taskMetadata=None,
inputCatalog=None,
Expand Down Expand Up @@ -330,6 +346,9 @@ def run(
else:
outputStats["DET"] = {}

if self.config.useIsrStatistics:
outputStats["EXTRA"] = isrStatistics

outputStats["VERIFY"], outputStats["SUCCESS"] = self.verify(
inputExp, outputStats
)
Expand Down

0 comments on commit 7882c60

Please sign in to comment.