Skip to content

Commit

Permalink
Merge pull request #107 from LSSTDESC/u/jchiang/sso_zero_division_err…
Browse files Browse the repository at this point in the history
…or_patch

treat SSOs with zero length streaks as point sources
  • Loading branch information
jchiang87 authored Jun 13, 2024
2 parents 25e6c66 + 9919b75 commit 4e1d1f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions skycatalogs/objects/sso_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def get_gsobject_components(self, gsparams=None, rng=None,
init_v = UnitVector3d(LonLat.fromDegrees(ra, dec))
final_v = UnitVector3d(LonLat.fromDegrees(ra_final, dec_final))
length = np.degrees(np.arccos(init_v.dot(final_v))) * 3600.0
if length * trail_width == 0:
# Treat as a point source.
return {'this_object': galsim.DeltaFunction(gsparams=gsparams)}

gobj = galsim.Box(length, trail_width, gsparams=gsparams)

# now rotate to direction of (ra_rate, dec_rate)
Expand Down

0 comments on commit 4e1d1f0

Please sign in to comment.