Skip to content

Commit

Permalink
Merge branch 'tickets/DM-42161'
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Feb 5, 2024
2 parents 6917e70 + 8c981e4 commit 0aeca6a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pipelines/_ingredients/VerifyCombinedDefect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ tasks:
config:
connections.inputStats: 'verifyCombinedDefectExpStats'
connections.outputStats: 'verifyCombinedDefectStats'
repackDefect:
class: lsst.cp.verify.CpVerifyRepackFlatTask
config:
connections.detectorStats: 'verifyCombinedDefectDetStats'
connections.exposureStats: 'verifyCombinedDefectExpStats'
connections.runStats: 'verifyCombinedDefectStats'
connections.outputCatalog: 'verifyCombinedDefectResults'
9 changes: 9 additions & 0 deletions pipelines/_ingredients/VerifyDefect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ tasks:
doDefect: true
doSaturationInterpolation: false
growSaturationFootprintSize: 0
doCalculateStatistics: true
isrStats.doCopyCalibDistributionStatistics: true
verifyMeasureStats:
class: lsst.cp.verify.CpVerifyDefectsTask
config:
connections.inputExp: 'verifyDefectProc'
connections.outputStats: 'verifyDefectDetStats'
doVignette: false
useReadNoise: false
useIsrStatistics: true
verifyExposureStats:
class: lsst.cp.verify.CpVerifyExpMergeTask
config:
Expand All @@ -39,3 +42,9 @@ tasks:
config:
connections.inputStats: 'verifyDefectExpStats'
connections.outputStats: 'verifyDefectStats'
repackResults:
class: lsst.cp.verify.CpVerifyRepackDefectsTask
config:
connections.detectorStats: 'verifyDefectDetStats'
connections.exposureStats: 'verifyDefectExpStats'
connections.runStats: 'verifyDefectStats'
38 changes: 37 additions & 1 deletion python/lsst/cp/verify/repackStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,43 @@ def repackDetStats(self, detectorStats, detectorDims):

class CpVerifyRepackDefectTask(CpVerifyRepackTask):
stageName = "defects"
pass

def repackDetStats(self, detectorStats, detectorDims):
rowList = []
for detStats, detDims in zip(detectorStats, detectorDims):
row = {}
instrument = detDims["instrument"]
detector = detDims["detector"]

# Get amp stats
for ampName, stats in detStats["AMP"].items():
row[ampName] = {
"instrument": instrument,
"detector": detector,
"amplifier": ampName,
}
# Get catalog stats CATALOG
# Get metadata stats METADATA
# Get verify stats VERIFY
# Get isr stats ISR
nBadColumns = np.nan
for ampName, stats in detStats["ISR"]["CALIBDIST"].items():
if ampName == "detector":
nBadColumns = stats[ampName]["LSST CALIB DEFECTS N_BAD_COLUMNS"]
else:
key = f"LSST CALIB DEFECTS {ampName} N_HOT"
row[ampName]["hotPixels"] = stats[ampName][key]
key = f"LSST CALIB DEFECTS {ampName} N_COLD"
row[ampName]["coldPixels"] = stats[ampName][key]
# Get detector stats DET
row["detector"] = {"instrument": instrument,
"detector": detector,
"nBadColumns": nBadColumns,
}
for ampName, stats in row.items():
rowList.append(stats)

return rowList


class CpVerifyRepackCtiTask(CpVerifyRepackTask):
Expand Down

0 comments on commit 0aeca6a

Please sign in to comment.