Skip to content

Commit

Permalink
Return default values if no match after cuts (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton authored Feb 9, 2025
1 parent e6ab42a commit 2c8775d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fink_filters/filter_magnetic_cvs/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def magnetic_cvs(isdiffpos, ra, dec) -> pd.Series:
# Keep only positive alerts
valid = isdiffpos.apply(lambda x: (x == "t") or (x == "1"))

if len(ra[valid]) == 0:
return pd.Series(["Unknown"] * len(ra))

# perform crossmatch
series = magnetic_cvs_(ra[valid], dec[valid])

Expand Down

0 comments on commit 2c8775d

Please sign in to comment.