Skip to content

Commit

Permalink
Update tasks to use fakes datatypes for fakes pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sr525 committed May 3, 2021
1 parent b560965 commit e6c9285
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
10 changes: 4 additions & 6 deletions python/lsst/pipe/tasks/assembleCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class AssembleCoaddConnections(pipeBase.PipelineTaskConnections,
defaultTemplates={"inputCoaddName": "deep",
"outputCoaddName": "deep",
"warpType": "direct",
"warpTypeSuffix": "",
"fakesType": ""}):
"warpTypeSuffix": ""}):

inputWarps = pipeBase.connectionTypes.Input(
doc=("Input list of warps to be assemebled i.e. stacked."
"WarpType (e.g. direct, psfMatched) is controlled by the warpType config parameter"),
Expand Down Expand Up @@ -90,7 +90,7 @@ class AssembleCoaddConnections(pipeBase.PipelineTaskConnections,
)
coaddExposure = pipeBase.connectionTypes.Output(
doc="Output coadded exposure, produced by stacking input warps",
name="{fakesType}{outputCoaddName}Coadd{warpTypeSuffix}",
name="{outputCoaddName}Coadd{warpTypeSuffix}",
storageClass="ExposureF",
dimensions=("tract", "patch", "skymap", "band"),
)
Expand All @@ -116,8 +116,6 @@ def __init__(self, *, config=None):
templateValues = {name: getattr(config.connections, name) for name in self.defaultTemplates}
templateValues['warpType'] = config.warpType
templateValues['warpTypeSuffix'] = makeCoaddSuffix(config.warpType)
if config.hasFakes:
templateValues['fakesType'] = "_fakes"
self._nameOverrides = {name: getattr(config.connections, name).format(**templateValues)
for name in self.allConnections}
self._typeNameToVarName = {v: k for k, v in self._nameOverrides.items()}
Expand Down Expand Up @@ -1806,7 +1804,7 @@ class CompareWarpAssembleCoaddConnections(AssembleCoaddConnections):
templateCoadd = pipeBase.connectionTypes.Output(
doc=("Model of the static sky, used to find temporal artifacts. Typically a PSF-Matched, "
"sigma-clipped coadd. Written if and only if assembleStaticSkyModel.doWrite=True"),
name="{fakesType}{outputCoaddName}CoaddPsfMatched",
name="{outputCoaddName}CoaddPsfMatched",
storageClass="ExposureF",
dimensions=("tract", "patch", "skymap", "band"),
)
Expand Down
11 changes: 6 additions & 5 deletions python/lsst/pipe/tasks/makeCoaddTempExp.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,11 @@ class MakeWarpConnections(pipeBase.PipelineTaskConnections,
dimensions=("tract", "patch", "skymap", "instrument", "visit"),
defaultTemplates={"coaddName": "deep",
"skyWcsName": "jointcal",
"photoCalibName": "fgcm"}):
"photoCalibName": "fgcm",
"calexpType": ""}):
calExpList = connectionTypes.Input(
doc="Input exposures to be resampled and optionally PSF-matched onto a SkyMap projection/patch",
name="calexp",
name="{calexpType}calexp",
storageClass="ExposureF",
dimensions=("instrument", "visit", "detector"),
multiple=True,
Expand Down Expand Up @@ -653,14 +654,14 @@ class MakeWarpConnections(pipeBase.PipelineTaskConnections,
# TODO DM-28769, have selectImages subtask indicate which connections they need:
wcsList = connectionTypes.Input(
doc="WCSs of calexps used by SelectImages subtask to determine if the calexp overlaps the patch",
name="calexp.wcs",
name="{calexpType}calexp.wcs",
storageClass="Wcs",
dimensions=("instrument", "visit", "detector"),
multiple=True,
)
bboxList = connectionTypes.Input(
doc="BBoxes of calexps used by SelectImages subtask to determine if the calexp overlaps the patch",
name="calexp.bbox",
name="{calexpType}calexp.bbox",
storageClass="Box2I",
dimensions=("instrument", "visit", "detector"),
multiple=True,
Expand All @@ -674,7 +675,7 @@ class MakeWarpConnections(pipeBase.PipelineTaskConnections,
)
psfList = connectionTypes.Input(
doc="PSF models used by BestSeeingWcsSelectImages subtask to futher select on seeing",
name="calexp.psf",
name="{calexpType}calexp.psf",
storageClass="Psf",
dimensions=("instrument", "visit", "detector"),
multiple=True,
Expand Down
21 changes: 12 additions & 9 deletions python/lsst/pipe/tasks/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,18 @@ def writeMetadata(self, dataRefList):


class WriteSourceTableConnections(pipeBase.PipelineTaskConnections,
defaultTemplates={"catalogType": ""},
dimensions=("instrument", "visit", "detector")):

catalog = connectionTypes.Input(
doc="Input full-depth catalog of sources produced by CalibrateTask",
name="src",
name="{catalogType}src",
storageClass="SourceCatalog",
dimensions=("instrument", "visit", "detector")
)
outputCatalog = connectionTypes.Output(
doc="Catalog of sources, `src` in Parquet format",
name="source",
name="{catalogType}source",
storageClass="DataFrame",
dimensions=("instrument", "visit", "detector")
)
Expand Down Expand Up @@ -941,19 +942,20 @@ def writeMetadata(self, dataRef):


class TransformSourceTableConnections(pipeBase.PipelineTaskConnections,
defaultTemplates={"catalogType": ""},
dimensions=("instrument", "visit", "detector")):

inputCatalog = connectionTypes.Input(
doc="Wide input catalog of sources produced by WriteSourceTableTask",
name="source",
name="{catalogType}source",
storageClass="DataFrame",
dimensions=("instrument", "visit", "detector"),
deferLoad=True
)
outputCatalog = connectionTypes.Output(
doc="Narrower, per-detector Source Table transformed and converted per a "
"specified set of functors",
name="sourceTable",
name="{catalogType}sourceTable",
storageClass="DataFrame",
dimensions=("instrument", "visit", "detector")
)
Expand Down Expand Up @@ -993,10 +995,10 @@ def runDataRef(self, dataRef):

class ConsolidateVisitSummaryConnections(pipeBase.PipelineTaskConnections,
dimensions=("instrument", "visit",),
defaultTemplates={}):
defaultTemplates={"calexpType": ""}):
calexp = connectionTypes.Input(
doc="Processed exposures used for metadata",
name="calexp",
name="{calexpType}calexp",
storageClass="ExposureF",
dimensions=("instrument", "visit", "detector"),
deferLoad=True,
Expand All @@ -1006,7 +1008,7 @@ class ConsolidateVisitSummaryConnections(pipeBase.PipelineTaskConnections,
doc=("Per-visit consolidated exposure metadata. These catalogs use "
"detector id for the id and are sorted for fast lookups of a "
"detector."),
name="visitSummary",
name="{calexpType}visitSummary",
storageClass="ExposureCatalog",
dimensions=("instrument", "visit"),
)
Expand Down Expand Up @@ -1236,17 +1238,18 @@ def makeDataRefList(self, namespace):


class ConsolidateSourceTableConnections(pipeBase.PipelineTaskConnections,
defaultTemplates={"catalogType": ""},
dimensions=("instrument", "visit")):
inputCatalogs = connectionTypes.Input(
doc="Input per-detector Source Tables",
name="sourceTable",
name="{catalogType}sourceTable",
storageClass="DataFrame",
dimensions=("instrument", "visit", "detector"),
multiple=True
)
outputCatalog = connectionTypes.Output(
doc="Per-visit concatenation of Source Table",
name="sourceTable_visit",
name="{catalogType}sourceTable_visit",
storageClass="DataFrame",
dimensions=("instrument", "visit")
)
Expand Down

0 comments on commit e6c9285

Please sign in to comment.