Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: coordsys.topixelmany - Function Up: coordsys - Tool Previous: coordsys.toabsmany - Function


coordsys.topixel - Function



Package general
Module images
Tool coordsys


Convert from absolute world to pixel coordinate


Synopsis
topixel(value)


Arguments

value in Absolute world coordinate
    Allowed: Numeric vector, vector of quantities, vector of strings or record
    Default: Reference value


Returns
Vector of double or fail



Description

This function converts between world (physical) coordinate and absolute pixel coordinate (1-rel).

The world coordinate can be provided in one of four formats via the argument world. These match the output formats of function toworld.

If you supply fewer world values than there are axes in the Coordinate System, your coordinate vector will be padded out with the reference value for the missing axes. Excess values will be silently ignored.

You may supply the world coordinate in all of the formats described in the formatting discussion.



Example
- cs := coordsys(direction=T, spectral=T, stokes="I V", linear=2)
-
- w := cs.toworld([-2,2,1,2,23,24], 'n')
- cs.topixel(w)
[-2 2 1 2 23 24]  
-
- w := cs.toworld([-2,2,1,2,23,24], 'q')
- cs.topixel(w)
[-2 2 1 2 23 24]  
-
- w := cs.toworld([-2,2,1,2,23,24], 'm')
- cs.topixel(w)
[-2 2 1 2 23 24]  
-
- w := cs.toworld([-2,2,1,2,23,24], 's')
- cs.topixel(w)
[-2 2 1 2 23 24]  
-
- w := cs.toworld([-2,2,1,2,23,24], 'mnq')
- cs.topixel(w)                            
[-2 2 1 2 23 24]



Example
- cs := coordsys (stokes="I V", linear=2)
- cs.toworld([1,2,3], 's')
I 1.000000e+00 2.000000e+00 
-
- cs.toworld([1,2,3], 'm')
[stokes=I, linear=[*1=[value=1, unit=km], *2=[value=2, unit=km]]] 
-
- cs.toworld([1,2,3], 'q')
[*1=[value=1, unit=], *2=[value=1, unit=km], *3=[value=2, unit=km]]



Example
- cs := coordsys (spectral=T, linear=1)
- cs.toworld([1,2,3], 'q')
[*1=[value=1.415e+09, unit=Hz], *2=[value=1, unit=km]]





next up previous contents index
Next: coordsys.topixelmany - Function Up: coordsys - Tool Previous: coordsys.toabsmany - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01