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


next up previous contents index
Next: image.decompose - Function Up: image - Tool Previous: image.coordsys - Function


image.coordmeasures - Function



Package general
Module images
Tool image


Convert from pixel to world coordinate wrapped as Measures


Synopsis
coordmeasures(pixel, intensity, direction, frequency, velocity)


Arguments

pixel in Absolute pixel coordinate
    Allowed: Numeric vector
    Default: Reference pixel
intensity out Returned intensity quantity for pixel
    Allowed: Quantity
direction out Returned direction measure for pixel
    Allowed: Direction measure
frequency out Returned frequency measure for pixel
    Allowed: Frequency measure
velocity out Returned radial velocity measure for pixel
    Allowed: Radio definition RadialVelocity measure


Returns
Glish record or fail



Description

You can use this function to get the world coordinates for a specified absolute pixel coordinate in the image. You specify a pixel coordinate (1-rel) for each axis in the image.

If you supply fewer pixel values then there are axes in the image, your value will be padded out with the reference pixel for the missing axes. Excess values will be ignored.

The world coordinate is returned as a record of measures. This function is just a wrapper for toworld (invoked with argument format='m'. Please see its documentation for discussion about the formatting and meaning of the measures.

This Image tool function adds two additional fields to the return record.

The mask field contains the value of the image pixel mask at the specified position. It is either T (pixel is good) or F (pixel is masked as bad or the specified position was off the image).

The intensity field contains the value of the image (at the nearest pixel to that given) and its units. This is actually stored as a Quantity. This field does not exist if the specified pixel coordinate is off the image.



Example
- im := image('myimage')
- meas := im.coordmeasures(im.shape()/2)     
- field_names(meas)                           # Names of measures fields in record
intensity mask direction 
- print meas.intensity
[value=-0.1478955, unit=JY/BEAM]
- print meas.direction
[type=direction, refer=J2000, m1=[value=-0.505949617, unit=rad], 
- m0=[unit=rad, value=-1.64713591]] 
-
- dir := meas.direction                      # Get direction coordinate
-
- dm.doframe(dm.observatory('ATCA'))         # Set location on earth
T
- dm.doframe(dm.epoch('utc', '16jun1999/12:30:20'))   # Set epoch
T
- azel := dm.measure(dir, 'azel')            # Convert to azimuth/elevation
- 
- print 'az,el=', dq.angle(azel.m0), dq.angle(azel.m1)     # Format nicely
az,el= +092.54.56.777 +068.59.59.576

In this example we first find the world coordinates of the centre of the image. Then we use the default Measures tool dm to convert the direction coordinate field from J2000 to an azimuth and elevation at a particular location at a particular time.





next up previous contents index
Next: image.decompose - Function Up: image - Tool Previous: image.coordsys - 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