Skip to content

Commit

Permalink
Merge pull request #7 from lsst/tickets/DM-16703
Browse files Browse the repository at this point in the history
DM-16703: Change calibration outputs to fgcm_photoCalib dataset type.
  • Loading branch information
erykoff committed Jan 8, 2019
2 parents 5926a1f + bb89d6e commit 75f7201
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
15 changes: 7 additions & 8 deletions python/lsst/fgcmcal/fgcmOutputProducts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
This task takes the final output from fgcmFitCycle and produces the following
outputs for use in the DM stack: the FGCM standard stars in a reference
catalog format; the model atmospheres in "transmission_atmosphere_fgcm"
format; and the zeropoints in "jointcal_photoCalib" format. Optionally, the
format; and the zeropoints in "fgcm_photoCalib" format. Optionally, the
task can transfer the 'absolute' calibration from a reference catalog
to put the fgcm standard stars in units of Jansky. This is accomplished
by matching stars in a sample of healpix pixels, and applying the median
Expand Down Expand Up @@ -86,7 +86,7 @@ class FgcmOutputProductsConfig(pexConfig.Config):
default=True,
)
doZeropointOutput = pexConfig.Field(
doc="Output zeropoints in jointcal_photoCalib format",
doc="Output zeropoints in fgcm_photoCalib format",
dtype=bool,
default=True,
)
Expand Down Expand Up @@ -639,7 +639,7 @@ def _formatCatalog(self, fgcmStarCat, offsets):

def _outputZeropoints(self, butler, offsets):
"""
Output the zeropoints in jointcal_photoCalib format.
Output the zeropoints in fgcm_photoCalib format.
Parameters
----------
Expand All @@ -648,7 +648,7 @@ def _outputZeropoints(self, butler, offsets):
Float array of absolute calibration offsets, one for each filter
"""

self.log.info("Outputting jointcal_photoCalib objects")
self.log.info("Outputting fgcm_photoCalib objects")

zptCat = butler.get('fgcmZeropoints', fgcmcycle=self.useCycle)
visitCat = butler.get('fgcmVisitCatalog')
Expand Down Expand Up @@ -706,13 +706,12 @@ def _outputZeropoints(self, butler, offsets):
offsetMapping[rec['filtername']],
scaling)

butler.put(photoCalib, 'jointcal_photoCalib',
butler.put(photoCalib, 'fgcm_photoCalib',
dataId={self.visitDataRefName: int(rec['visit']),
self.ccdDataRefName: int(rec['ccd']),
'filter': filterMapping[rec['filtername']],
'tract': 0})
'filter': filterMapping[rec['filtername']]})

self.log.info("Done outputting jointcal_photoCalib objects")
self.log.info("Done outputting fgcm_photoCalib objects")

def _getChebyshevPhotoCalib(self, coefficients, err, xyMax, offset, scaling):
"""
Expand Down
10 changes: 4 additions & 6 deletions tests/fgcmcalTestBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,17 @@ def _testFgcmOutputProducts(self, visitDataRefName, ccdDataRefName, filterMappin
# Read in all the calibrations, these should all be there
# This test is simply to ensure that all the photoCalib files exist
for rec in zptCat[selected]:
testCal = butler.get('jointcal_photoCalib',
testCal = butler.get('fgcm_photoCalib',
dataId={visitDataRefName: int(rec['visit']),
ccdDataRefName: int(rec['ccd']),
'filter': filterMapping[rec['filtername']],
'tract': 0})
'filter': filterMapping[rec['filtername']]})
self.assertIsNotNone(testCal)

# We do round-trip value checking on just the final one (chosen arbitrarily)
testCal = butler.get('jointcal_photoCalib',
testCal = butler.get('fgcm_photoCalib',
dataId={visitDataRefName: int(testVisit),
ccdDataRefName: int(testCcd),
'filter': filterMapping[testFilter],
'tract': 0})
'filter': filterMapping[testFilter]})
self.assertIsNotNone(testCal)

src = butler.get('src', dataId={visitDataRefName: int(testVisit),
Expand Down

0 comments on commit 75f7201

Please sign in to comment.