Coordinate word manipulation
The names of GDS routines which manipulate
coordinate words all start with
These routines relate grid coordinates to coordinate words and
vice versa. There is an example at the end of this
- fills the undefined
coordinates in a coordinate word with grids from an input array.
It is primarily used to create
coordinate words which denote the lower and upper file positions of the
data an application needs to access.
- extracts a grid coordinate from a coordinate word.
It is primarily used to get the grids of the lower and
upper bounds of a subset.
- returns the
coordinate word of a subset which is the intersection of two other
- returns the name of an axis
- returns the number of undefined coordinates in a coordinate word.
In other words it returns the dimensionality of a subset.
- returns the location of the reference pixel of an axis
- returns two
coordinate words denoting the lower left grid position and the upper
right grid position in a subset
- returns the size of an axis
- returns the
subset coordinate word from two coordinate words containing grid
positions in the subset
- inserts a grid coordinate in a coordinate word
This example demonstrates how to obtain the grid positions of the
first and last file position in a GDS set. Note that the subset
coordinate word which denotes the whole set has no defined coordinates,
so it is zero.
C GDSC_RANGE returns in CWLO and CWUP coordinate words which
C contain the position of the first pixel and the last pixel in
C the subset.
CALL GDSC_RANGE( SET, 0, CWLO, CWUP, GERROR )
C GDSC_NDIMS returns the dimensionality of the subset, so the number
C of undefined dimensions.
SETDIM = GDSC_NDIMS( SET, 0 )
C GDSC_GRID extracts a grid coordinate from a coordinate word.
FOR NAXIS = 1, SETDIM
LOWERGRID(N) = GDSC_GRID( SET, NAXIS, CWLO, GERROR )
UPPERGRID(N) = GDSC_GRID( SET, NAXIS, CWUP, GERROR )