Skip to content

Commit

Permalink
Read the fcr photoCalib directly
Browse files Browse the repository at this point in the history
The fcr object is an empty Exposure, which now contains a PhotoCalib object,
persisted directly (instead of having Calib headers FLUXMAG0/FLUXMAG0ERR), so we
get the fcr_photoCalib, instead of reading the metadata. This should also maintain
backwards compatibility with old files.

Update the dataRef mock in test_fluxFitBoundedField to be able to return an
fcr_photoCalib (which is a valid composite object for a real butler).
  • Loading branch information
parejkoj committed Apr 12, 2019
1 parent e2cdb14 commit cb5be57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/lsst/meas/mosaic/updateExposure.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def getFluxFitParams(dataRef):
ffpHeader = dataRef.get("fcr_hsc_md", immediate=True)
else:
ffpHeader = dataRef.get("fcr_md", immediate=True)
photoCalib = afwImage.makePhotoCalibFromMetadata(ffpHeader)
photoCalib = dataRef.get("fcr_photoCalib")
ffp = FluxFitParams(ffpHeader)

wcs = getWcs(dataRef)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_fluxFitBoundedField.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def setUp(self):
"%d/fcr-%07d-%03d.fits" % (self.tract, self.visit, ccd)
)
fcrMetadata = readMetadata(fcrFilename)
fcrPhotoCalib = lsst.afw.image.ExposureF(fcrFilename).getPhotoCalib()
self.ffp[ccd] = lsst.meas.mosaic.FluxFitParams(fcrMetadata)
wcsFilename = os.path.join(
DATA_DIR,
Expand All @@ -157,6 +158,7 @@ def setUp(self):
camera[ccd] = MockDetector(MockOrientation(nQuarter))
self.dataRefs[ccd] = MockDataRef(visit=self.visit, tract=self.tract, ccd=ccd)
self.dataRefs[ccd].put(fcrMetadata, "fcr_md", )
self.dataRefs[ccd].put(fcrPhotoCalib, "fcr_photoCalib")
self.dataRefs[ccd].put(self.wcs[ccd], "jointcal_wcs")
self.dataRefs[ccd].put(calexpMetadata, "calexp_md")
self.dataRefs[ccd].put(camera, "camera")
Expand Down

0 comments on commit cb5be57

Please sign in to comment.