From 46a94de1485fc17a911d52106580579579f1463c Mon Sep 17 00:00:00 2001 From: Yusra AlSayyad Date: Mon, 10 Nov 2025 19:49:48 -0800 Subject: [PATCH] Remove forcedSourceId from ForcedSource and likewise forcedSourceOnDiaObjectId from ForceSourceFromDiaObject --- python/lsst/pipe/tasks/postprocess.py | 12 +++++++----- schemas/ForcedSource.yaml | 4 ---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/python/lsst/pipe/tasks/postprocess.py b/python/lsst/pipe/tasks/postprocess.py index 102731fa5..df583f460 100644 --- a/python/lsst/pipe/tasks/postprocess.py +++ b/python/lsst/pipe/tasks/postprocess.py @@ -1773,11 +1773,13 @@ def run(self, inputCatalogs, referenceCatalog, funcs=None, dataId=None, band=Non outputCatalog.index.rename(self.config.keyRef, inplace=True) # Add config.keyRef to the column list outputCatalog.reset_index(inplace=True) - # Set the forcedSourceId to the index. This is specified in the - # ForcedSource.yaml - outputCatalog.set_index("forcedSourceId", inplace=True, verify_integrity=True) - # Rename it to the config.key - outputCatalog.index.rename(self.config.key, inplace=True) + + if "forcedSourceId" in outputCatalog.columns: + # Set the forcedSourceId to the index. This is specified in the + # ForcedSource.yaml + outputCatalog.set_index("forcedSourceId", inplace=True, verify_integrity=True) + # Rename it to the config.key + outputCatalog.index.rename(self.config.key, inplace=True) self.log.info("Made a table of %d columns and %d rows", len(outputCatalog.columns), len(outputCatalog)) diff --git a/schemas/ForcedSource.yaml b/schemas/ForcedSource.yaml index 1967a68a3..7e5d9bc72 100644 --- a/schemas/ForcedSource.yaml +++ b/schemas/ForcedSource.yaml @@ -3,10 +3,6 @@ # `lsst.pipe.tasks.postprocess.TransformForcedSourceTableTask`. # See the DPDD for more information about the output: https://lse-163.lsst.io funcs: - forcedSourceId: - functor: Column - args: id - dataset: calexp parentObjectId: functor: Column args: parent