WCS angle
christian wrote on May 19, 2010
Hi,
I am currently trying to co-add a few images taken with different angles of the wcs north axis in regard to the x/y image axes. So I looked around for a simple IRAF task, which would give me in some way the angle between the image coordinate system and the wcs.
Is there some task like this or an easy workaround ?
Regards
christian
I am currently trying to co-add a few images taken with different angles of the wcs north axis in regard to the x/y image axes. So I looked around for a simple IRAF task, which would give me in some way the angle between the image coordinate system and the wcs.
Is there some task like this or an easy workaround ?
Regards
christian
Mike Fitzpatrick wrote on May 19, 2010
An excerpt of CL script code that would compute the rotation angle looks something like:
where 'rot' is the rotation angle.
Otherwise, have a look at the SREGISTER, WREGISTER or XREGISTER tasks for ways to register the images to a common WCS for easier stacking.
# Get the CD matrix from the image. We initialize the values above
# so if they don't exist in the header we won't change the value here
# (but we need to read them one at a time).
hselect (img, "cd1_1", yes) | scan (cd11)
hselect (img, "cd1_2", yes) | scan (cd12)
hselect (img, "cd2_1", yes) | scan (cd21)
hselect (img, "cd2_2", yes) | scan (cd22)
# Compute the plate scale (arcsec/pixel) for the image.
scale = 3600. * sqrt ((cd11**2+cd21**2+cd12**2+cd22**2)/2.)
xrot = abs (datan ( cd21, cd11))
yrot = abs (datan (-cd12, cd22))
rot = (xrot + yrot) / 2.0
where 'rot' is the rotation angle.
Otherwise, have a look at the SREGISTER, WREGISTER or XREGISTER tasks for ways to register the images to a common WCS for easier stacking.
AnTaR3s wrote on May 19, 2010
There is also a tool within the images package:
images.imcoords.ccmap
take this as an example
input = coo.dat The input coordinate files
database= coo.out The output database file
(solutio= ) The database plate solution names
(images = foo.fits) The input images
(results= ) The optional results summary files
(xcolumn= 1) Column containing the x coordinate
(ycolumn= 2) Column containing the y coordinate
...
The file coo.dat has to include the x, y, Rec, Dec positions of stars in the image (one per line, the more the better).
Then everything is computed and written into coo.out, including the angle you are looking for.
images.imcoords.ccmap
take this as an example
input = coo.dat The input coordinate files
database= coo.out The output database file
(solutio= ) The database plate solution names
(images = foo.fits) The input images
(results= ) The optional results summary files
(xcolumn= 1) Column containing the x coordinate
(ycolumn= 2) Column containing the y coordinate
...
The file coo.dat has to include the x, y, Rec, Dec positions of stars in the image (one per line, the more the better).
Then everything is computed and written into coo.out, including the angle you are looking for.
Last post on May 19, 2010