Skip to content

Commit

Permalink
Add option to use the deepCoadd_calexp with fakes inserted in processing
Browse files Browse the repository at this point in the history
  • Loading branch information
sr525 committed Apr 8, 2019
1 parent b3f5c0c commit 9fb19c9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion python/lsst/meas/base/forcedPhotCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class ForcedPhotCoaddConfig(ForcedPhotImageConfig):
optional=True
)

hasFakes = lsst.pex.config.Field(
dtype=bool,
default=False,
doc="Should be set to True if fake sources have been inserted into the input data."
)

def setDefaults(self):
ForcedPhotImageTask.ConfigClass.setDefaults(self)
# Copy 'id' and 'parent' columns without renaming them; since these are
Expand Down Expand Up @@ -88,7 +94,12 @@ class ForcedPhotCoaddTask(ForcedPhotImageTask):
dataPrefix = "deepCoadd_"

def getExposure(self, dataRef):
name = self.config.coaddName + "Coadd_calexp"

if self.config.hasFakes:
name = "fakes_" + self.config.coaddName + "Coadd_calexp"
else:
name = self.config.coaddName + "Coadd_calexp"

return dataRef.get(name) if dataRef.datasetExists(name) else None

def makeIdFactory(self, dataRef):
Expand Down

0 comments on commit 9fb19c9

Please sign in to comment.