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

1.1.3 Convert many numeric absolute coordinates to relative


Description

This function converts many absolute coordinates to relative. It exists so you can efficiently make many conversions (which would be rather slow if you did them all with torel). Because speed is the object, the interface is purely in terms of numeric matrices, rather than being able to accept strings and quanta etc. like torel can.

When dealing with world coordinates, the units of the numeric values must be the native units, given by function units.

Arguments





Inputs

value

Absolute coordinates

allowed:

any

Default:

variant

isworld

Is coordinate world or pixel? Default is unset.

allowed:

int

Default:

-1

Returns
record

Example

 
 
"""  
#  
print "\t----\t torelmany Ex 1 \t----"  
csys = cs.newcoordsys(direction=True, spectral=True)    # 3 axes  
w = csys.referencevalue();                  # reference value  
inc = csys.increment();                     # increment  
off = []  
for idx in range(100):  
  off.append(inc[’numeric’][2] * idx)       # offset for third axis  
wabs = ia.makearray(0, [3,100])             # 100 conversions each of length 3  
for i in range(3):  
  for j in range(100):  
    wabs[i][j] = w[’numeric’][i]  
for j in range(100):  
  wabs[2][j] += off[j]                      # Make spectral axis values change  
wrel  = cs.torelmany (wabs, T)[’numeric’]   # Convert  
print wrel[0][0], wrel[1][0], wrel[2][0]    # First relative coordinate  
#0.0 0.0 0.0  
print wrel[0][99], wrel[1][99], wrel[2][99] # 100th relative coordinate  
#0.0 0.0 99000.0  
#  
"""  
 
This example uses world coordinates.  

__________________________________________________________________


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