Skip to content

Commit

Permalink
Add updateMetadataFromExposures calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Feb 9, 2023
1 parent 7537fc3 commit 36af39c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions python/lsst/cp/pipe/defects.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def run(self, inputExp, camera):
msg = "Found %s defects containing %s pixels in %s"
self.log.info(msg, len(defects), self._nPixFromDefects(defects), datasetType)

defects.updateMetadataFromExposures([inputExp])
defects.updateMetadata(camera=camera, detector=detector, filterName=filterName,
setCalibId=True, setDate=True,
cpDefectGenImageType=datasetType)
Expand Down Expand Up @@ -708,6 +709,7 @@ def run(self, inputDefects, camera):
SourceDetectionTask.setEdgeBits(subImage, box, BADBIT)

merged = Defects.fromMask(finalImage, 'BAD')
merged.updateMetadataFromExposures(inputDefects)
merged.updateMetadata(camera=camera, detector=detector, filterName=None,
setCalibId=True, setDate=True)

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/cp/pipe/linearity.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def run(self, inputPtc, dummy, camera, inputDims, inputPhotodiodeData=None,

# Initialize the linearizer.
linearizer = Linearizer(detector=detector, table=table, log=self.log)

linearizer.updateMetadataFromExposures([inputPtc])
if self.config.usePhotodiode:
# Compute the photodiode integrals once, outside the loop
# over amps.
Expand Down
1 change: 1 addition & 0 deletions python/lsst/cp/pipe/makeBrighterFatterKernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def run(self, inputPtc, dummy, camera, inputDims):
bfk.noise = inputPtc.noise
bfk.meanXcorrs = dict()
bfk.valid = dict()
bfk.updateMetadataFromExposures([inputPtc])

for amp in detector:
ampName = amp.getName()
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/cp/pipe/pdCorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def run(self, inputPtc, inputLinearizer, camera, inputDims):
photodiodeCorrection.abscissaCorrections = abscissaCorrections

photodiodeCorrection.validate()
photodiodeCorrection.updateMetadataFromExposures(inputPtc)
photodiodeCorrection.updateMetadataFromExposures(inputLinearizer)
photodiodeCorrection.updateMetadata(camera=camera, filterName='NONE')
photodiodeCorrection.updateMetadata(setDate=True, setCalibId=True)
provenance = IsrProvenance(calibType='photodiodeCorrection')
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/cp/pipe/ptc/cpExtractPtcTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,14 @@ def run(self, inputExp, inputDims, taskMetadata):
# and assemble the measurements in the datasets
# in an addecuate manner for fitting a PTC
# model.
partialPtcDataset.updateMetadataFromExposures([exp1, exp2])
partialPtcDataset.updateMetadata(setDate=True, detector=detector)
partialPtcDatasetList[datasetIndex] = partialPtcDataset

if nAmpsNan == len(ampNames):
msg = f"NaN mean in all amps of exposure pair {expId1}, {expId2} of detector {detNum}."
self.log.warning(msg)

return pipeBase.Struct(
outputCovariances=partialPtcDatasetList,
)
Expand Down
1 change: 1 addition & 0 deletions python/lsst/cp/pipe/ptc/cpSolvePtcTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def run(self, inputCovariances, camera=None, detId=0):
detector = camera[detId]
else:
detector = None
datasetPtc.updateMetadataFromExposures(inputCovariances)
datasetPtc.updateMetadata(setDate=True, camera=camera, detector=detector)

return pipeBase.Struct(
Expand Down

0 comments on commit 36af39c

Please sign in to comment.