Skip to content

Commit

Permalink
Make coadd template warp type configurable
Browse files Browse the repository at this point in the history
Use `--config getTemplate.warpType=psfMatched` to get
PSF-matched coadds as templates.
  • Loading branch information
yalsayyad committed Sep 22, 2017
1 parent 01682fb commit 2800e60
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion python/lsst/ip/diffim/getTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class GetCoaddAsTemplateConfig(pexConfig.Config):
dtype=str,
default="deep",
)
warpType = pexConfig.Field(
doc="Warp type of the coadd template: one of 'direct' or 'psfMatched'",
dtype=str,
default="direct",
)


class GetCoaddAsTemplateTask(pipeBase.Task):
Expand Down Expand Up @@ -100,7 +105,7 @@ def run(self, exposure, sensorRef, templateIdList=None):
patchSubBBox = patchInfo.getOuterBBox()
patchSubBBox.clip(coaddBBox)
patchArgDict = dict(
datasetType=self.config.coaddName + "Coadd_sub",
datasetType=self.getCoaddDatasetName() + "_sub",
bbox=patchSubBBox,
tract=tractInfo.getId(),
patch="%s,%s" % (patchInfo.getIndex()[0], patchInfo.getIndex()[1]),
Expand Down Expand Up @@ -135,6 +140,19 @@ def run(self, exposure, sensorRef, templateIdList=None):
return pipeBase.Struct(exposure=coaddExposure,
sources=None)

def getCoaddDatasetName(self):
"""Return coadd name for given task config
Returns
-------
CoaddDatasetName : `string`
TODO: This nearly duplicates a method in CoaddBaseTask (DM-11985)
"""
warpType = self.config.warpType
suffix = "" if warpType == "direct" else warpType[0].upper() + warpType[1:]
return self.config.coaddName + "Coadd" + suffix


class GetCalexpAsTemplateConfig(pexConfig.Config):
doAddCalexpBackground = pexConfig.Field(
Expand Down

0 comments on commit 2800e60

Please sign in to comment.