Skip to content

Commit

Permalink
CoaddDataIdContainer: use given dataset instead of deepCoadd
Browse files Browse the repository at this point in the history
The use of deepCoadd (well, the "deep" part was configurable) was
hard-coded, but we now write background-subtracted coadds as
deepCoadd_calexp since HSC-1311.  Changed
CoaddDataIdContainer.makeDataRefList to respect the provided dataset
type instead of always grabbing deepCoadd.  However, the skymap
doesn't have the same flexibility, and is always deepCoadd_skyMap,
so simplified the parameter list.
  • Loading branch information
PaulPrice committed Nov 11, 2015
1 parent 6f9f22e commit ea5e1ec
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions python/lsst/pipe/tasks/coaddBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,16 @@ class CoaddDataIdContainer(pipeBase.DataIdContainer):
Required because butler.subset does not support patch and tract
"""
def getSkymap(self, namespace, datasetType):
def getSkymap(self, namespace):
"""Only retrieve skymap if required"""
if not hasattr(self, "_skymap"):
self._skymap = namespace.butler.get(datasetType + "_skyMap")
self._skymap = namespace.butler.get(namespace.config.coaddName + "Coadd_skyMap")
return self._skymap

def makeDataRefList(self, namespace):
"""Make self.refList from self.idList
"""
datasetType = namespace.config.coaddName + "Coadd"
validKeys = namespace.butler.getKeys(datasetType=datasetType, level=self.level)
validKeys = namespace.butler.getKeys(datasetType=self.datasetType, level=self.level)

for dataId in self.idList:
for key in validKeys:
Expand All @@ -260,14 +259,14 @@ def makeDataRefList(self, namespace):
if "patch" in dataId:
raise RuntimeError("'patch' cannot be specified without 'tract'")
addList = [dict(tract=tract.getId(), patch="%d,%d" % patch.getIndex(), **dataId)
for tract in self.getSkymap(namespace, datasetType) for patch in tract]
for tract in self.getSkymap(namespace) for patch in tract]
elif not "patch" in dataId:
tract = self.getSkymap(namespace, datasetType)[dataId["tract"]]
tract = self.getSkymap(namespace)[dataId["tract"]]
addList = [dict(patch="%d,%d" % patch.getIndex(), **dataId) for patch in tract]
else:
addList = [dataId]

self.refList += [namespace.butler.dataRef(datasetType=datasetType, dataId=addId)
self.refList += [namespace.butler.dataRef(datasetType=self.datasetType, dataId=addId)
for addId in addList]


Expand Down

0 comments on commit ea5e1ec

Please sign in to comment.