PaulHancock / Aegean

The Aegean source finding program and associated tools
http://aegeantools.rtfd.io/
Other
47 stars 14 forks source link

Catch failed PSF lookup #146

Closed tjgalvin closed 3 years ago

tjgalvin commented 3 years ago

Excuse the formatting of the code -- my black formatter got to it!

I found an issue where in one of my larger images the PSF look up was failing:

Tim Galvin  12:49 PM
A fun new error I just found. Putting ehre for reference...
90228:source_finder:DEBUG  component 2
90228:fitting:DEBUG Pix errs: [0.07782124650932302, 0.07026407464815712, 0.07687062672527917, 0.05937180803307748, 0.13724775489426266]
90228:source_finder:DEBUG (10316,02)  0.000654  0.023474 11:49:27.48  -41:06:32.79 177.3644822  0.0004053 -41.1091086  0.0008032  0.381834  0.022785  0.425911  0.026388 157.76  1.78 112.53  1.38  -27.8   0.1   0000000
Fitting Islands::  35%|██████████████████████████████████████████████████▋                                                                                             | 10316/29293 [11:18<20:48, 15.20it/s]
Traceback (most recent call last):
  File "/usr/local/bin/aegean", line 326, in <module>
    found = sf.find_sources_in_image(filename, outfile=options.outfile, hdu_index=options.hdu_index,
  File "/usr/local/lib/python3.8/dist-packages/AegeanTools/source_finder.py", line 1917, in find_sources_in_image
    srcs = self._fit_island(i)
  File "/usr/local/lib/python3.8/dist-packages/AegeanTools/source_finder.py", line 1668, in _fit_island
    beam = global_data.psfhelper.get_psf_sky2pix(midra, middec)
  File "/usr/local/lib/python3.8/dist-packages/AegeanTools/wcs_helpers.py", line 462, in get_psf_sky2pix
    psf_sky = self.get_psf_sky2sky(ra, dec)
  File "/usr/local/lib/python3.8/dist-packages/AegeanTools/wcs_helpers.py", line 435, in get_psf_sky2sky
    x = int(np.clip(x, 0, self.psf_map.shape[1] - 1))
ValueError: cannot convert float NaN to integer

I fixed it with a simpler try except case in the source_finder.py task on line 1668 in your main branch in the pre-black formatted version.

PaulHancock commented 3 years ago

Travis CI isn't doing the builds for this PR for some reason. I'm hesitant to accept this until I can figure out what Travis' problem is.

tjgalvin commented 3 years ago

No problem at all. I can run with my own until you give it the ok.

On Fri, 27 Aug 2021, 4:53 pm Paul Hancock, @.***> wrote:

Travis CI isn't doing the builds for this PR for some reason. I'm hesitant to accept this until I can figure out what Travis' problem is.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PaulHancock/Aegean/pull/146#issuecomment-907041347, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQOAJRDU2N6TDMI4UKA6DLT65HBZANCNFSM5C5AYBDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

PaulHancock commented 3 years ago

I think I have figured out the travis problem, though it hasn't automatically restarted the build. Can you push some new commit to this branch so that the build will trigger? An empty commit would suffice.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.08%) to 82.463% when pulling 5db1f2fe54fc4cfeb564bda9482c3e73b277cc9f on tjgalvin:master into 1d7ef091e4c2ec5f1224b8700fbc585cacdf06d0 on PaulHancock:main.