Converting from cd matrix to crota/cdelt?
Heather Berrier wrote on Sep 23, 2008
Hi,
I'm trying to use a galaxy photometry routine created by my advisor that requires the wcs header keywords "crota" and "cdelt". Unfortunately, the wcs in my headers uses the cd rotation matrix. Is there a quick way to convert from the cd matrix to the crota/cdelt (I know it's fairly simple to go the other way)? Thank you!
Heather
I'm trying to use a galaxy photometry routine created by my advisor that requires the wcs header keywords "crota" and "cdelt". Unfortunately, the wcs in my headers uses the cd rotation matrix. Is there a quick way to convert from the cd matrix to the crota/cdelt (I know it's fairly simple to go the other way)? Thank you!
Heather
Mike Fitzpatrick wrote on Sep 23, 2008
Unless I'm not remembering things correctly:
Near the poles or when the x-axis is the Dec/Lat these equations change and there are special conditions, but in most cases i think these work.
For reference, the CROT/CDELT to CD-matrix transform is:
Hope this helps, hope others can offer needed corrections/elaboration.
Cheers,
-Mike
cdelt1 = cd1_1
cdelt2 = cd2_2
crota1 = atan2 ( cd2_1, cd1_1)
crota2 = atan2 (-cd1_2, cd2_2)
Near the poles or when the x-axis is the Dec/Lat these equations change and there are special conditions, but in most cases i think these work.
For reference, the CROT/CDELT to CD-matrix transform is:
CD1_1 = CDELT1 * cos (CROTA2)
CD1_2 = -CDELT2 * sin (CROTA2)
CD2_1 = CDELT1 * sin (CROTA2)
CD2_2 = CDELT2 * cos (CROTA2)
Hope this helps, hope others can offer needed corrections/elaboration.
Cheers,
-Mike
Heather Berrier wrote on Sep 23, 2008
That helps a lot. Thank you!
Heather
Heather
Last post on Sep 23, 2008