Skip to content

Commit 97efa55

Browse files
authored
Merge pull request #2752 from mwcraig/update-astrometry-net-tests-and-omg-bug
Update astrometry.net tests and address bug
2 parents 9a0c26d + c47e391 commit 97efa55

8 files changed

+117
-25
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ astrometry_net
8989

9090
- Added ``return_submission_id`` keyword argument to ``monitor_submission()``. [#2685]
9191

92+
- Fixed off-by-one error in the reference pixel of the WCS solution when the
93+
solution is found using sources detected by photutils. After this fix the
94+
solution from astrometry.net will be the same when the input is an image
95+
regardless of whether the image is uploaded or sources are detected
96+
locally. [#2752]
97+
9298
cadc
9399
^^^^
94100

astroquery/astrometry_net/core.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
_HAVE_CCDDATA = True
1616

1717
try:
18-
from photutils import DAOStarFinder
18+
from photutils.detection import DAOStarFinder
1919
except ImportError:
2020
_HAVE_SOURCE_DETECTION = False
2121
else:
@@ -441,6 +441,10 @@ def solve_from_image(self, image_file_path, *, force_image_upload=False,
441441
sources.reverse()
442442
if verbose:
443443
print(sources)
444+
445+
# It turns out astrometry.net is 1-indexed, so add 1 to the source positions.
446+
sources['xcentroid'] += 1
447+
sources['ycentroid'] += 1
444448
return self.solve_from_source_list(sources['xcentroid'],
445449
sources['ycentroid'],
446450
ccd.header['naxis1'],
Binary file not shown.

astroquery/astrometry_net/tests/data/thumbnail-wcs-sol-from-photutils.fit

Lines changed: 0 additions & 1 deletion
This file was deleted.

astroquery/astrometry_net/tests/data/thumbnail-wcs-sol.fit

Lines changed: 0 additions & 1 deletion
This file was deleted.

astroquery/astrometry_net/tests/data/wcs-sol-from-source-list-index-5200.fit

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

astroquery/astrometry_net/tests/data/wcs-sol-from-thumbnail-image-index-5200.fit

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)