astropy / photutils

Astropy package for source detection and photometry. Maintainer: @larrybradley
https://photutils.readthedocs.io
BSD 3-Clause "New" or "Revised" License
231 stars 131 forks source link

Fix IterativePSFPhotometry no overlap error #1778

Closed larrybradley closed 2 weeks ago

larrybradley commented 2 weeks ago

This PR fixes an issue where IterativePSFPhotometry could sometimes raise an error about non-overlapping data. This was caused by the fitter failing and returning positions well outside of the input image during the iterations. When those invalid positions then were used an inputs in a subsequent iteration, a ValueError was raised. With this PR, those invalid positions are automatically removed during the iterations.

Fixes #1769.