next up previous
Next: THE HISTORY COMPONENT
Up: ALTERING BOUNDS AND PIXEL INDICES
Previous: Setting New Pixel-Index Bounds and Dimensionality

Applying Pixel-Index Shifts   

An alternative way of changing the pixel-index bounds of an NDF is to apply shifts to its pixel indices using the routine NDF_SHIFT. For instance:

      INTEGER NSHIFT, SHIFT( NSHIFT )

      ...

      CALL NDF_SHIFT( NSHIFT, SHIFT, INDF, STATUS )

would apply a set of NSHIFT shifts to an NDF (one to each dimension) as specified in the integer array SHIFT. As a result, the pixel-index bounds and the indices of each pixel in the NDF would be changed by the amount of shift applied to the corresponding dimension. The shifts applied may be positive or negative. Thus, if the set of shifts (10,1,-3) were applied to an NDF with shape:

(10:20, 7, 0:5)

then its shape would change to become:

(20:30, 2:8, -3:2)

Note that the behaviour of NDF_SHIFT and NDF_SBND is quite different. With NDF_SBND (§[*]) the pixel indices remain fixed while the NDF bounds move, so that pixels can be lost from the edges of the NDF and new ones can be introduced. With NDF_SHIFT, however, the pixel indices move with the bounds, so that no pixels can ever be lost and no new ones are introduced. NDF_SHIFT also preserves the dimension sizes of the NDF.

The application of pixel-index shifts with NDF_SHIFT is a relatively inexpensive operation. When applied to an NDF section, the change in pixel indices applies only to that section (and any identifiers subsequently derived from it) and causes no permanent change to the base NDF or to other sections. When applied to a base NDF, however, the actual data structure is altered and this will be apparent through any other base NDF identifiers which refer to it. Note, however, that sections previously derived from a base NDF are not affected if NDF_SHIFT is applied to the base NDF (i.e. such sections will retain their original pixel indices and values).



next up previous
Next: THE HISTORY COMPONENT
Up: ALTERING BOUNDS AND PIXEL INDICES
Previous: Setting New Pixel-Index Bounds and Dimensionality


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