We can illustrate an important point if we swap the axis order of
either SkyFrame in the example above ()
before identifying the conversion. Let's assume we use AST_PERMAXES
(
) to do this to the second SkyFrame, before
applying AST_CONVERT, as follows:
INTEGER PERM( 2 ) DATA PERM / 2, 1 / ... CALL AST_PERMAXES( SKYFRAME2, PERM, STATUS ) CVT = AST_CONVERT( SKYFRAME1, SKYFRAME2, ' ', STATUS )
Now, the destination SkyFrame system no longer represents the coordinate system:
(ecliptic longitude, ecliptic latitude)
but instead represents the transposed system:
(ecliptic latitude, ecliptic longitude)
As a consequence, when we use the FrameSet returned by AST_CONVERT to apply a coordinate transformation, we obtain something like the following:
(2:06:03.0, 34:22:39) --> (20.2717, 42.1087) (2:08:20.6, 35:31:24) --> (21.1705, 43.0197) (2:10:38.1, 36:40:09) --> (22.0716, 43.9295) (2:12:55.6, 37:48:55) --> (22.9753, 44.8382) (2:15:13.1, 38:57:40) --> (23.8814, 45.7459) (2:17:30.6, 40:06:25) --> (24.7901, 46.6528) (2:19:48.1, 41:15:11) --> (25.7013, 47.5589) (2:22:05.6, 42:23:56) --> (26.6149, 48.4644) (2:24:23.1, 43:32:41) --> (27.5311, 49.3695) (2:26:40.6, 44:41:27) --> (28.4499, 50.2742)
When compared to the original (), the
output coordinate order has been swapped to compensate for the
different destination SkyFrame axis order.
In all, there are four possible axis combinations, corresponding to two possible axis orders for each of the source and destination SkyFrames, and AST_CONVERT will convert correctly between any of these. The point to note is that a SkyFrame contains knowledge about how to convert to and from other SkyFrames. Since its two axes (longitude and latitude) are distinguishable, the conversion is able to take account of the axis order.
If you need to identify the axes of a SkyFrame explicitly, taking into
account any axis permutations, the LatAxis and LonAxis attributes can be
used. These are read-only attributes which give the indices of the
latitude and longitude axes respectively.
AST A Library for Handling World Coordinate Systems in Astronomy