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

1.1.3 Recover the reference value


Description

Each axis associated with the Coordinate System has a reference value, reference pixel and an increment (per pixel). These are used in the mapping from pixel to world coordinate.

This function returns the reference value (in world axis order). You can recover the reference value either for all coordinates (leave type unset) or for a specific coordinate type (mimumum match of the allowed types will do). If you ask for a non-existent coordinate an exception is generated.

See the discussion regarding the formatting possibilities available via argument format.

You can set the reference value with function setreferencevalue.

Arguments





Inputs

format

Format string. Combination of ”n”, ”q”, ”s”, ”m”

allowed:

string

Default:

n

type

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

allowed:

string

Default:

Returns
record

Example

 
 
"""  
#  
print "\t----\t referencevalue Ex 1 \t----"  
csys = cs.newcoordsys(direction=True, spectral=True)  
print csys.referencevalue(format=’q’)  
#{’ar_type’: ’absolute’,  
# ’pw_type’: ’world’,  
# ’quantity’: {’*1’: {’unit’: "’", ’value’: 0.0},  
#              ’*2’: {’unit’: "’", ’value’: 0.0},  
#              ’*3’: {’unit’: ’Hz’, ’value’: 1415000000.0}}}  
print csys.referencevalue(format=’n’)  
#{’ar_type’: ’absolute’,  
# ’numeric’: array([  0.00000000e+00,   0.00000000e+00,   1.41500000e+09]),  
# ’pw_type’: ’world’}  
print csys.referencevalue(format=’n’, type=’spec’)  
#{’ar_type’: ’absolute’,  
# ’numeric’: array([  1.41500000e+09]),  
# ’pw_type’: ’world’}  
#  
"""  
 

__________________________________________________________________


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