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


next up previous contents index
Next: is_region - Function Up: regionmanager - Tool Previous: regionmanager.wmask - Function


regionmanager.wrange - Function



Package general
Module images
Tool regionmanager


Create a world region for a pixel range on one axis


Synopsis
wrange(range, pixelaxis, csys, absrel, comment)


Arguments

range in World range
    Allowed: Numeric or quantum vector
pixelaxis in The pixel axis of interest
    Allowed: Integer
csys in Coordinate System
    Allowed: coordinates tool
    Default: Private Coordinate System
absrel in Absolute or relative coordinates
    Allowed: Vector of strings from 'abs', 'relref' and 'relcen'
    Default: 'abs' or last
comment in A comment stored with the region
    Allowed: String


Returns
Region tool or fail


Description

This function creates a region which selects all pixels except for the axis specified. For that axis it selects just the pixels specified by the range. The region created is just a world box.



Example
- im := image('hcn')
- cs := im.coordsys();
- drm.setcoordinates(cs);
-
- im.toworld([1,1,10]) 
[4.63647352 -0.506376202 1.41352721e+09]  
- im.toworld([1,1,20])
[4.63647352 -0.506376202 1.41372408e+09]  
-
- r := drm.wrange(range="1.41352721MHz 1.4137240MHz", pixelaxis=3, csys=cs)
- im.boundingbox(r)
[blc=[1 1 10] , trc=[155 178 20] , inc=[1 1 1] , bbShape=[155 178 11] , 
 regionShape=[155 178 11] , imageShape=[155 178 64] ]

To show that it works, we converted from pixel to world coordinate for pixel 10 and 20 on the third axis. These values, with a unit change to MHz from GHz were then input into the wrange function and the bounding box shows that we recover 10 and 20 pixels.






Example
- im := image('hcn')
- cs := im.coordsys();
- drm.setcoordinates(cs);
- r := drm.wrange(range="10pix 20pix", pixelaxis=3, csys=cs)
- im.boundingbox(r)
[blc=[1 1 10] , trc=[155 178 20] , inc=[1 1 1] , bbShape=[155 178 11] , 
 regionShape=[155 178 11] , imageShape=[155 178 64] ] 
-
- r := drm.wrange(range=[10, 20], pixelaxis=3, csys=cs)
- im.boundingbox(r)
[blc=[1 1 10] , trc=[155 178 20] , inc=[1 1 1] , bbShape=[155 178 11] , 
 regionShape=[155 178 11] , imageShape=[155 178 64] ] 
-

This shows how you can easily select a few planes of an image using pixel units. If you give a numeric vector for the range (second example) it assumes pixel units.








next up previous contents index
Next: is_region - Function Up: regionmanager - Tool Previous: regionmanager.wmask - 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