neuromorphicsystems / astrometry

Astrometry turns a list of star positions into a pixel-to-sky transformation (WCS)
GNU General Public License v3.0
27 stars 3 forks source link

Where does one find rotation? #7

Open alexw-im opened 11 months ago

alexw-im commented 11 months ago

It looks like the Match object includes center RA and Dec but not rotation to north about the frame center. I guess that's probably provided in the attached WCS? If so, I can't find it. Any pointers where to go looking?

aMarcireau commented 11 months ago

Hi @alexw-im,

The rotation is, in a sense, part of the WCS object. However, there is no simple way to extract it (to my knowledge) because Astrometry.net generates a CD matrix (details at https://docs.astropy.org/en/stable/wcs/index.html and https://arxiv.org/abs/astro-ph/0207407). In a nutshell, the CD matrix is a general linear transformation (not just scale + rotation but also shear), which makes the notion of field rotation ill-defined.

I can think of two workarounds:

juanep97 commented 11 months ago

Hi, Once you have solved the WCS, you should be able to extract it using the wcs matrix. From https://danmoser.github.io/notes/gai_fits-imgs.html:

CD1_1 = CDELT1 cos (CROTA2) CD1_2 = -CDELT2 sin (CROTA2) CD2_1 = CDELT1 sin (CROTA2) CD2_2 = CDELT2 cos (CROTA2)

The 1996 proposed FITS WCS standard used PC001001, PC001002, PC002001, and PC002002 to represent the rotation matrix but retained CDELT1 and CDELT2 for the scale. It is also read by this software, but should not be used for new WCS's.

I can confirm that the WCS produced has the PC_* keywords and you can obtain the angle with the arctan of the ratio of the values.

juanep97 commented 11 months ago

Our you can use local_partial_pixel_derivatives to get the angle in any part of the image (probably better).