NRAO Home > CASA > CASA Toolkit Reference Manual
image.topixel - Function

1.1.1 Convert from world to pixel coordinate


Description

This function converts from absolute world to pixel coordinate (0-rel). The world coordinate can be provided in many formats (numeric, string, quantum etc.) via the argument value. These match the output formats of function toworld.

This function is just a wrapper for the Coordsys tool function topixel so see the documentation there for a description and more examples.

Arguments





Inputs

value

Absolute world coordinate, Numeric vector, vector of strings representing quantities, or record of format analogous to that produced by ia.toworld(). Default is reference value.

allowed:

any

Default:

variant

Returns
record

Example

 
 
"""  
#  
print "\t----\t topixel Ex 1 \t----"  
ia.maketestimage();  
w = ia.toworld([10,10], ’n’)        # Numeric vector  
ia.topixel(w)  
#{’ar_type’: ’absolute’,  
# ’numeric’: array([10., 10.]), ’pw_type’: ’pixel’}  
w = ia.toworld([10,10], ’m’)        # Record of measures  
ia.topixel(w)  
#{’ar_type’: ’absolute’,  
# ’numeric’: array([10., 10.]), ’pw_type’: ’pixel’}  
ia.close()  
#  
"""  
 
Convert a pixel coordinate to world as floats and then  
back to pixel.  Do the same with the world coordinate  
formatted as measures instead.  

__________________________________________________________________


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