How to inpterpete the transformation matrix from wcs.fits?

856 views
Skip to first unread message

Ronon Dex

unread,
Oct 27, 2017, 9:07:31 AM10/27/17
to astro...@googlegroups.com
I am trying to get the correct plate-solved data from the image by looking at the wcs.fits file.
It seems it has a CD matrix which is a 2x2 matrix and has the pixel scale for both axes, but my question how are those matrices used (also looking at the other matrices in that file).

Can someone explain to me here, how that I can transform a given RA/DEC coordinate into the pixel coordinates of the plate solved image using that matrix? I guess I have to do some multiplications of those matrices with the RA/DEC positional vector?

Is there some place where I can look that up?

Dustin Lang

unread,
Oct 27, 2017, 9:39:30 AM10/27/17
to astrometry
Hi,

You might want to check for a WCS library in whatever programming language you are using.

The real documentation is here,
  https://fits.gsfc.nasa.gov/fits_wcs.html
in particular, "paper II" is what you want, but is pretty opaque.

In the Astrometry.net code, the conversion functions are here,
  https://github.com/dstndstn/astrometry.net/blob/master/util/sip.c
in particular, tan (or sip) tan_radec2pixelxy.  If you see "iwc" there, that's short for 'intermediate world coordinates', which are like relative delta-RA, delta-Dec coordinates.

By the way, "SIP" is the name of the convention for how we represent distortion corrections -- you can turn this off in the web API if you don't want it -- while TAN is the "vanilla" version without any distortion corrections.

cheers,
--dustin

Ronon Dex

unread,
Oct 27, 2017, 9:58:35 AM10/27/17
to astrometry
Thanks, I am trying to figure out what that code actually does ( I am not used to C++ code).
Is there any chance you could provide me with some pseudo code or something that describes how that works?
Inside the wcs.fits There are different variables, how do those form up the matrix used for transformation?

Thanks a lot

Ronon Dex

unread,
Oct 27, 2017, 11:01:42 AM10/27/17
to astrometry
I think I found a way to do it:
Astropy supports WCS transformations with the wcs.fit file.
So I can just create a small script that will take a CSV input of RA/DEC coordiantes and convert that to pixels on my image with the wcs.fit file provided from astrometry.net
Reply all
Reply to author
Forward
0 new messages