image_angle_from_cd

mpdaf.obj.image_angle_from_cd(cd, unit=Unit('deg'))[source]

Return the rotation angle of the image.

Defined such that a rotation angle of zero aligns north along the positive Y axis, and a positive rotation angle rotates north away from the Y axis, in the sense of a rotation from north to east.

Note that the rotation angle is defined in a flat map-projection of the sky. It is what would be seen if the pixels of the image were drawn with their pixel widths scaled by the angular pixel increments returned by the axis_increments_from_cd() method.

If the CD matrix was derived from the archaic CROTA and CDELT FITS keywords, then the angle returned by this function is equal to CROTA.

Parameters:
cdnumpy.ndarray

The 2x2 coordinate conversion matrix, with its elements ordered for multiplying a column vector in FITS (x,y) axis order.

unitastropy.units.Unit

The unit to give the returned angle (degrees by default).

Returns:
outfloat

The angle between celestial north and the Y axis of the image, in the sense of an eastward rotation of celestial north from the Y-axis. The angle is returned in the range -180 to 180 degrees (or the equivalent for the specified unit).