Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-36390: calibrations should track sequencer crc #169

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment, not really for here, but why so few items? Don't we need this for biases, darks, flats etc? I see they're all being compared in isrTask.run() but are they being set correctly somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are merged in merge_headers for the bias, dark, and flat. For the IsrCalib based products, this call adds the header information from the exposure to the per-exposure defect set, which are then combined in the Merge task. I wanted to have a central method (this is part of the base class) to handle these keywords.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, great, thanks.

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 @@ -295,6 +295,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