Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch failed PSF lookup #146

Merged
merged 4 commits into from Aug 31, 2021
Merged

Catch failed PSF lookup #146

merged 4 commits into from Aug 31, 2021

Conversation

tjgalvin
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Contributor Author

tjgalvin commented Aug 27, 2021 via email

@PaulHancock
Copy link
Owner

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.

@PaulHancock PaulHancock merged commit 57f34cf into PaulHancock:main Aug 31, 2021
@coveralls
Copy link

Coverage Status

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants