From 16189955b12b8ff2732f80cbbff915d2ab6c5b47 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Tue, 3 Dec 2024 11:39:28 -0500 Subject: [PATCH] Convert measureCoaddSources to ArrowAstropy. --- python/lsst/pipe/tasks/multiBand.py | 4 ++-- python/lsst/pipe/tasks/propagateSourceFlags.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/lsst/pipe/tasks/multiBand.py b/python/lsst/pipe/tasks/multiBand.py index acdf73557..83deafe71 100644 --- a/python/lsst/pipe/tasks/multiBand.py +++ b/python/lsst/pipe/tasks/multiBand.py @@ -270,7 +270,7 @@ class MeasureMergedCoaddSourcesConnections(PipelineTaskConnections, "These tables contain astrometry and photometry flags, and optionally " "PSF flags."), name="sourceTable_visit", - storageClass="DataFrame", + storageClass="ArrowAstropy", dimensions=("instrument", "visit"), multiple=True, deferLoad=True, @@ -279,7 +279,7 @@ class MeasureMergedCoaddSourcesConnections(PipelineTaskConnections, doc=("Finalized source tables from ``FinalizeCalibrationTask``. These " "tables contain PSF flags from the finalized PSF estimation."), name="finalized_src_table", - storageClass="DataFrame", + storageClass="ArrowAstropy", dimensions=("instrument", "visit"), multiple=True, deferLoad=True, diff --git a/python/lsst/pipe/tasks/propagateSourceFlags.py b/python/lsst/pipe/tasks/propagateSourceFlags.py index 76b5bcd44..4c0c6e302 100644 --- a/python/lsst/pipe/tasks/propagateSourceFlags.py +++ b/python/lsst/pipe/tasks/propagateSourceFlags.py @@ -184,7 +184,7 @@ def run(self, coadd_object_cat, ccd_inputs, self.log.info("Visit %d not in input handle dict for %s", visit, name) continue handle = handle_dict[visit] - df = handle.get(parameters={"columns": columns}) + tbl = handle.get(parameters={"columns": columns}) # Loop over all ccd_inputs rows for this visit. for row in ccd_inputs[ccd_inputs["visit"] == visit]: @@ -195,13 +195,13 @@ def run(self, coadd_object_cat, ccd_inputs, "propagate flags. Skipping...", visit, detector) continue - df_det = df[df["detector"] == detector] + tbl_det = tbl[tbl["detector"] == detector] - if len(df_det) == 0: + if len(tbl_det) == 0: continue - ra, dec = wcs.pixelToSkyArray(df_det[x_col].values, - df_det[y_col].values, + ra, dec = wcs.pixelToSkyArray(np.asarray(tbl_det[x_col]), + np.asarray(tbl_det[y_col]), degrees=True) try: @@ -225,7 +225,7 @@ def run(self, coadd_object_cat, ccd_inputs, continue for flag in flag_counts: - flag_values = df_det[flag].values + flag_values = np.asarray(tbl_det[flag]) flag_counts[flag][i1] += flag_values[i2].astype(np.int32) for flag in source_flag_counts: