Skip to content

Commit

Permalink
Convert measureCoaddSources to ArrowAstropy.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Dec 13, 2024
1 parent e06769f commit b0b3e71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions python/lsst/pipe/tasks/multiBand.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class MeasureMergedCoaddSourcesConnections(
"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,
Expand All @@ -289,7 +289,7 @@ class MeasureMergedCoaddSourcesConnections(
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,
Expand Down
12 changes: 6 additions & 6 deletions python/lsst/pipe/tasks/propagateSourceFlags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit b0b3e71

Please sign in to comment.