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-16703: Change calibration outputs to fgcm_photoCalib dataset type. #7

Merged
merged 1 commit into from
Jan 8, 2019
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
15 changes: 7 additions & 8 deletions python/lsst/fgcmcal/fgcmOutputProducts.py
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
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