Calculating Pixel Position From RA DEC

52 views
Skip to first unread message

bill rowe

unread,
Oct 13, 2020, 7:28:31 AM10/13/20
to astrometry
is there an automated way of calculating pixel position for a given RA/DEC once an image has been solved?  I have found a calculator that will go from pixel position to RA/DEC but I want the reverse.

I'm imaging for faint planets and asteroids that don't show up in the catalogs and i'd like to track them down in my images from their RA and DEC at the time of the photo.   

I've opened corr.fits so i can easily get RA/DEC to X/Y for a bunch of stars.   (The calculator I found is at (http://www1.phys.vt.edu/~jhs/SIP/astrometrycalc.html))

Thanks for any help

Dustin Lang

unread,
Oct 13, 2020, 7:53:16 AM10/13/20
to bill rowe, astrometry
The WCS file contains the information required to convert between sky and pixels (both directions).

The Astrometry.net code includes a "wcs-xy2rd" and "wcs-rd2xy" programs to convert between them.  Or if you use the Python language, the 'astropy' package has WCS routines.  Or the "wcstools" package has "sky2xy" / "xy2sky" programs.

cheers,
--dustin


--
You received this message because you are subscribed to the Google Groups "astrometry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astrometry+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astrometry/2ae4fbe7-68ac-48ec-8064-02bc81b642a8n%40googlegroups.com.

bill rowe

unread,
Oct 13, 2020, 4:29:32 PM10/13/20
to astrometry
That worked a treat - thanks. Below is my clumsy python to find the coordinates for uranus:

from astropy import wcs
from astropy.io.fits import getheader
import numpy as np
from astropy.io import fits
from astropy import units as u
from astropy.coordinates import SkyCoord as SC

hdulist = fits.open(r"c:\users\bill\downloads\wcsuranus.fits")
w = wcs.WCS(hdulist[0].header)

uc=SC('2h27m45.84s', '14d6m14.0s')
print("Uranus's Coordinates(J2000): ",uc)
print("Uranus's Pixel Coordinates: ",uc.to_pixel(w))


John Murrell

unread,
Oct 14, 2020, 3:55:16 AM10/14/20
to bill rowe, astrometry
Bill,

If you are looking for objects like planets / asteroids at knows positions at the time of observation you can open the calibrated FITS image in Aladin and then enter the co-ordinates for the planet in the command box and the cursor should move to the planet position.

You could also combine your (monochrome) FITS image with one from the Aladin library to see the objects that are in your image but not in the Aladin library image. You can do this by blinking but the easiest way is to combine the two images into a RGB colour image which is a single button click in Aladin. Objects that are in only one image will show as a different colour in the combined image. It is also a good way to see things like high proper motion stars. I have a page about using Aladin this way on my website at www.JohnMurrell.org.uk under the Virtual Observatory exercises pages.

John Murrell
Reply all
Reply to author
Forward
0 new messages