next up previous
Next: Using Axis Coordinates to Specify Sections
Up: USING SUBSCRIPTS TO ACCESS NDF SECTIONS
Previous: Specifying Lower and Upper Bounds

Specifying Centre and Extent  

An alternative form for the subscript expression involves specifying the centre and extent of the region required along each dimension, as follows:

name( p$\sim$q, r$\sim$s, ... )

where `p$\sim$q', `r$\sim$s', (etc.) specify the centre and extent. Thus,

name(100$\sim$11,200$\sim$5)

would refer to an 11 x 5 pixel region of an image centred on pixel (100, 200).

If the value before the delimiting `$\sim$' is omitted, it will default to the index of the central pixel in that dimension (rounded downwards if there are an even number of pixels). If the value following the `$\sim$' is omitted, it will default to the number of pixels in that dimension. Thus,

image( $\sim$100, $\sim$100)

could be used to refer to a 100 x 100 pixel region located centrally within an image, while

image( 10$\sim$, 20$\sim$ )

would specify a section which is the same size as the original image, but displaced so that it is centred on pixel (10, 20).



next up previous
Next: Using Axis Coordinates to Specify Sections
Up: USING SUBSCRIPTS TO ACCESS NDF SECTIONS
Previous: Specifying Lower and Upper Bounds


Starlink User Note 33
R.F. Warren-Smith
11th January 2000
E-mail:rfws@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils