Skip to content

Commit

Permalink
fix: flux = 0 was not handled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
zonca committed Dec 23, 2024
1 parent 8d160f4 commit 21dc598
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pysm3/models/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def flux2amp(flux, fwhm):
sigma = fwhm2sigma(fwhm)
amp = flux / (2 * np.pi * sigma**2)
# sim_objects fails if amp is zero
c = 1e-9 # minimum amplitude
amp[np.logical_and(amp < c, amp > 0)] = c
c = 1e-9 # clip
amp[np.logical_and(amp < c, amp >= 0)] = c
amp[np.logical_and(amp > -c, amp < 0)] = -c
return amp

Expand Down

0 comments on commit 21dc598

Please sign in to comment.