Skip to content

Commit c1ea98b

Browse files
committed
Fix selection of ref/target sources if column is None
1 parent 3ef1b77 commit c1ea98b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

python/lsst/pipe/tasks/diff_matched_tract_catalog.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,17 @@ def run(
363363
DatasetProvenance.strip_provenance_from_flat_dict(catalog_match_ref.meta)
364364
DatasetProvenance.strip_provenance_from_flat_dict(catalog_match_target.meta)
365365

366-
select_ref = catalog_match_ref['match_candidate']
367-
# Add additional selection criteria for target sources beyond those for matching
368-
# (not recommended, but can be done anyway)
369366
# It would be nice to make this a Selector but those are
370367
# only available in analysis_tools for now
371-
select_target = (
372-
catalog_match_target['match_candidate']
373-
if 'match_candidate' in catalog_match_target.columns
374-
else np.ones(len(catalog_match_target), dtype=bool)
368+
select_ref, select_target = (
369+
(catalog[column] if column else np.ones(len(catalog), dtype=bool))
370+
for catalog, column in (
371+
(catalog_match_ref, self.config.column_match_candidate_ref),
372+
(catalog_match_target, self.config.column_match_candidate_target),
373+
)
375374
)
375+
# Add additional selection criteria for target sources beyond those for matching
376+
# (not recommended, but can be done anyway)
376377
for column in config.columns_target_select_true:
377378
select_target &= catalog_target[column]
378379
for column in config.columns_target_select_false:

0 commit comments

Comments
 (0)