NRAO Home > CASA > CASA Toolkit Reference Manual
##### coordsys.topixelmany - Function

1.1.3 Convert many absolute numeric world coordinates to pixel

Description

This function converts many absolute world coordinates to pixel coordinates. It exists so you can efficiently make many conversions (which would be rather slow if you did them all with topixel). 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 topixel can.

The units of the numeric values must be the native units, given by function units.

Arguments

 Inputs value Absolute world coordinates allowed: any Default: variant
Returns
record

Example

"""
#
print "\t----\t topixelmany Ex 1 \t----"
csys = cs.newcoordsys(direction=T, spectral=T)    # 3 axes
rv = 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]=rv[’numeric’][i]
for j in range(100):
wabs[2][j] += off[j]                      # Make spectral axis values change
pabs  = csys.topixelmany (wabs)[’numeric’]; # Convert
print pabs[0][0], pabs[1][0], pabs[1][2]    # First absolute pixel coordinate
#0.0 0.0 0.0
print pabs[0][99], pabs[1][99], pabs[2][99] # 100th absolute pixel coordinate
#0.0 0.0 99.0
#
"""

__________________________________________________________________