Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | coordsys |
type | in | Which coordinate type ? | |
Allowed: | String from "direction", "stokes", "spectral", "linear", "tabular" or unset | ||
Default: | All | ||
list | in | List all possibilities ? | |
Allowed: | Bool | ||
Default: | F |
This function (short-hand name rp) returns the reference code for all, or the specified coordinate type. Examples of the reference code are B1950 and J2000 for direction coordinates, or LSRK and BARY for spectral coordinates.
If type is left unset, then a vector of strings is returned, one code for each coordinate type in the Coordinate System.
If you specify type then select from 'direction', 'spectral', 'stokes', and 'linear' (the first two letters will do). However, only the first two coordinate types will return a non-empty string. If the Coordinate System does not contain a coordinate of the type you specify, an exception is generated.
The argument list is ignored unless you specify a specific type. If list=T, then this function returns the list of all possible reference codes for the specified coordinate type. Otherwise, it just returns the actual code current set in the Coordinate System.
The list of all possible types is returned as a Glish record (it is actually generated by the listcodes function in the measures system). This record has two fields. These are called 'normal' (containing all normal codes) and 'extra' (maybe empty, with all extra codes like planets).
You can set the reference code with setreferencecode.
- cs := coordsys(direction=T) - list := cs.referencecode('dir', T) - list.normal[1:10] J2000 JMEAN JTRUE APP B1950 BMEAN BTRUE GALACTIC HADEC AZEL - - cs.referencecode('dir') J2000
In this example we first get the list of all possible reference codes for a direction coordinate (and print some of the normal ones). Then we get the actual reference code for the direction coordinate in our Coordinate System.