next up previous 264
Next: Example the PermMap
Up: Inter-Relating Coordinate Systems (Mappings)
Previous: Handling Missing (Bad) Coordinate Values


Example--the UnitMap

The UnitMap is the simplest of Mappings. It is a null Mapping. Its purpose is simply to copy coordinate values, unaltered, from its input to its output and vice versa.

A UnitMap has no additional attributes beyond those of a basic Mapping. Its Nin and Nout attributes are always equal and are specified by the first argument supplied to its constructor. For example:

AstUnitMap *unitmap;

...

unitmap = astUnitMap( 2, "" );

will create a UnitMap that copies 2-dimensional coordinates. Inverting a UnitMap has no effect beyond changing the value of its Invert attribute.

The main use of a UnitMap is to allow a Mapping to be supplied when one is required (as an argument to a function, for example) but you wish it to leave coordinate values unchanged.


next up previous 264
Next: Example the PermMap
Up: Inter-Relating Coordinate Systems (Mappings)
Previous: Handling Missing (Bad) Coordinate Values

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
25th February 2013
E-mail:starlink@jiscmail.ac.uk

Copyright (C) 2014 Science \& Technology Facilities Council