Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-35083: Add support for new and old smatch grouping API. #690

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions python/lsst/pipe/tasks/isolatedStarAssociation.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,12 @@ def _match_primary_stars(self, primary_bands, star_source_cat):
dec = star_source_cat[dec_col][use]

with Matcher(ra, dec) as matcher:
idx = matcher.query_self(self.config.match_radius/3600., min_match=1)
try:
# New smatch API
idx = matcher.query_groups(self.config.match_radius/3600., min_match=1)
except AttributeError:
# Old smatch API
idx = matcher.query_self(self.config.match_radius/3600., min_match=1)

count = len(idx)

Expand Down Expand Up @@ -457,7 +462,12 @@ def _remove_neighbors(self, primary_star_cat):
with Matcher(primary_star_cat[ra_col], primary_star_cat[dec_col]) as matcher:
# By setting min_match=2 objects that only match to themselves
# will not be recorded.
idx = matcher.query_self(self.config.isolation_radius/3600., min_match=2)
try:
# New smatch API
idx = matcher.query_groups(self.config.isolation_radius/3600., min_match=2)
except AttributeError:
# Old smatch API
idx = matcher.query_self(self.config.isolation_radius/3600., min_match=2)

try:
neighbor_indices = np.concatenate(idx)
Expand Down