Skip to content

Commit

Permalink
refactor to deal with redshift=0 (skyportal#180)
Browse files Browse the repository at this point in the history
This short PR refactors the CLU redshift xmatch function.
  • Loading branch information
virajkaram authored Nov 21, 2022
1 parent 3cdfec0 commit 12e63e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kowalski/alert_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,13 +857,16 @@ def alert_filter__xmatch_clu(
alpha1, delta01 = galaxy["ra"], galaxy["dec"]

redshift = galaxy["z"]
# By default, set the cross-match radius to 30 kpc at the redshift of the host galaxy
cm_radius = 30.0 * (0.05 / redshift) / 3600

if redshift < 0.01:
# for nearby galaxies and galaxies with negative redshifts, do a 5 arc-minute cross-match
# (cross-match radius would otherwise get un-physically large for nearby galaxies)
cm_radius = 300.0 / 3600

else:
# For distant galaxies, set the cross-match radius to 30 kpc at the redshift of the host galaxy
cm_radius = 30.0 * (0.05 / redshift) / 3600

in_galaxy = in_ellipse(ra, dec, alpha1, delta01, cm_radius, 1, 0)

if in_galaxy:
Expand Down

0 comments on commit 12e63e6

Please sign in to comment.