NRAO Home > CASA > CASA Toolkit Reference Manual
coordsys.referencecode - Function

1.1.3 Return specified reference code


Description

This function 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 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.

Arguments





Inputs

type

Coordinate type: ”direction”, ”stokes”, ”spectral”, ”linear”, ”tabular”. Leave empty for all.

allowed:

string

Default:

list

List all possibilities?

allowed:

bool

Default:

false

Returns
stringArray

Example

 
 
"""  
#  
print "\t----\t referencecode Ex 1 \t----"  
csys = cs.newcoordsys(direction=T)  
clist = csys.referencecode(’dir’, T)  
print clist  
#[’J2000’, ’JMEAN’, ’JTRUE’, ’APP’, ’B1950’, ’BMEAN’, ’BTRUE’,  
# ’GALACTIC’, ’HADEC’, ’AZEL’, ’AZELSW’, ’AZELNE’, ’AZELGEO’,  
# ’AZELSWGEO’, ’AZELNEGEO’, ’JNAT’, ’ECLIPTIC’, ’MECLIPTIC’,  
# ’TECLIPTIC’, ’SUPERGAL’, ’ITRF’, ’TOPO’, ’ICRS’,  
# ’MERCURY’, ’VENUS’, ’MARS’, ’JUPITER’, ’SATURN’, ’URANUS’,  
# ’NEPTUNE’, ’PLUTO’, ’SUN’, ’MOON’, ’COMET’]  
print csys.referencecode(’dir’)  
#J2000  
#  
"""  
 
 
In this example we first get the list of all possible reference codes  
ofor a direction coordinate. Then we  
get the actual reference code for the direction coordinate in our  
Coordinate System.  
 

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright 2016 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search