next up previous 264
Next: Frame Axis Attributes
Up: Representing Coordinate Systems (Frames)
Previous: Creating a Frame


Using a Frame as a Mapping

We should briefly point out that the Frame we created above ([*]) is also a Mapping ([*]) and therefore inherits the properties and behaviour common to other Mappings.

One way to see this is to set the Frame's Report attribute (inherited from the Mapping class) to a non-zero value and pass the Frame pointer to a coordinate transformation routine, such as AST_TRAN2.

      DOUBLE PRECISION XIN( 5 ), YIN( 5 ), XOUT( 5 ), YOUT( 5 )
      DATA XIN / 0D0, 1D0, 2D0, 3D0, 4D0, 5D0 /
      DATA YIN / 0D0, 2D0, 4D0, 6D0, 8D0, 10D0 /

      CALL AST_SET( FRAME, 'Report=1', STATUS )
      CALL AST_TRAN2( FRAME, 5, XIN, YIN, .TRUE., XOUT, YOUT, STATUS )

The resulting output might then look like this:

(1, 2) --> (1, 2)
(2, 4) --> (2, 4)
(3, 6) --> (3, 6)
(4, 8) --> (4, 8)
(5, 10) --> (5, 10)

This is not very exciting because a Frame implements an identity transformation just like a UnitMap ([*]). However, it illustrates that a Frame can be used as a Mapping and that its Nin and Nout attributes are both equal to the number of Frame axes.

When we consider more specialised Frames (e.g. [*]), we will see that using them as Mappings can be very useful indeed.


next up previous 264
Next: Frame Axis Attributes
Up: Representing Coordinate Systems (Frames)
Previous: Creating a Frame

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 210
R.F. Warren-Smith & D.S. Berry
24th May 2011
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2009 Science \& Technology Facilities Council