From b00c5dc63278063c6cf07273533453193ed5ca1e Mon Sep 17 00:00:00 2001 From: Yusra AlSayyad Date: Mon, 15 Feb 2021 22:55:19 -0600 Subject: [PATCH 1/2] Propagate schema alias to new catalog --- python/lsst/pipe/tasks/postprocess.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/lsst/pipe/tasks/postprocess.py b/python/lsst/pipe/tasks/postprocess.py index 299445d89..43467e9f6 100644 --- a/python/lsst/pipe/tasks/postprocess.py +++ b/python/lsst/pipe/tasks/postprocess.py @@ -266,7 +266,6 @@ def addCalibColumns(self, catalog, dataRef): newCat: `afwTable.SourceCatalog` Source Catalog with requested local calib columns """ - mapper = afwTable.SchemaMapper(catalog.schema) measureConfig = SingleFrameMeasurementTask.ConfigClass() measureConfig.doReplaceWithNoise = False @@ -274,6 +273,7 @@ def addCalibColumns(self, catalog, dataRef): exposure = dataRef.get('calexp_sub', bbox=lsst.geom.Box2I(lsst.geom.Point2I(0, 0), lsst.geom.Point2I(0, 0))) + aliasMap = catalog.schema.getAliasMap() mapper = afwTable.SchemaMapper(catalog.schema) mapper.addMinimalSchema(catalog.schema, True) schema = mapper.getOutputSchema() @@ -295,6 +295,7 @@ def addCalibColumns(self, catalog, dataRef): measureConfig.plugins.names.add(plugin) measurement = SingleFrameMeasurementTask(config=measureConfig, schema=schema) + schema.setAliasMap(aliasMap) newCat = afwTable.SourceCatalog(schema) newCat.extend(catalog, mapper=mapper) measurement.run(measCat=newCat, exposure=exposure, exposureId=exposureIdInfo.expId) From a8b452f5f9712645019dab2fae0ebdbf7524847d Mon Sep 17 00:00:00 2001 From: Yusra AlSayyad Date: Tue, 23 Feb 2021 17:49:33 -0600 Subject: [PATCH 2/2] WriteSourceTable: Return result from runDataRef --- python/lsst/pipe/tasks/postprocess.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/lsst/pipe/tasks/postprocess.py b/python/lsst/pipe/tasks/postprocess.py index 43467e9f6..4796bb4c6 100644 --- a/python/lsst/pipe/tasks/postprocess.py +++ b/python/lsst/pipe/tasks/postprocess.py @@ -225,6 +225,7 @@ def runDataRef(self, dataRef): ccdVisitId = dataRef.get('ccdExposureId') result = self.run(src, ccdVisitId=ccdVisitId) dataRef.put(result.table, 'source') + return result def run(self, catalog, ccdVisitId=None): """Convert `src` catalog to parquet