next up previous
Next: Applying Pixel-Index Shifts
Up: ALTERING BOUNDS AND PIXEL INDICES
Previous: ALTERING BOUNDS AND PIXEL INDICES

Setting New Pixel-Index Bounds and Dimensionality   

The pixel-index bounds of an NDF may be altered when required by explicitly setting them to new values using the routine NDF_SBND. The dimensionality of the NDF may also be changed at the same time. For instance:

      INTEGER NDIM, LBND( NDIM ), UBND( NDIM )

      ...

      CALL NDF_SBND( NDIM, LBND, UBND, INDF, STATUS )

will change an NDF's dimensionality to the value specified by the NDIM argument, and set its lower and upper pixel-index bounds to the values specified in the LBND and UBND arrays. When an NDF's shape is changed in this way, the pixel values of any array component which is in a defined state may be affected, as follows:

Retained Pixels
- These are pixels with indices which lie within both the initial and final NDF pixel-index bounds. The values of these pixels are retained.
New Pixels
- These are pixels with indices which lie within the new pixel-index bounds, but did not exist within the initial bounds. These pixels will be assigned the appropriate bad-pixel value (see §[*]). If such pixels are introduced, then the bad-pixel flag of affected NDF components will be updated to reflect this fact.

Lost Pixels
- These are pixels with indices which lie within the initial NDF pixel-index bounds, but outside the new bounds. The values of such pixels are lost and cannot be recovered, even by changing the NDF's bounds back to their original values.

In cases where the dimensionality of the NDF also changes, the association between pixel indices before and after the change is established in the same way as when creating NDF sections (see §[*]), i.e. by padding the bounds with 1's to match the dimensionalities.

Note that altering the shape of an NDF section using NDF_SBND is a relatively inexpensive operation which merely involves changing the shape of the ``window'' into the NDF which the section describes. In contrast, altering the shape of a base NDF causes changes to be made to the actual data structure and can take considerably longer, especially if one or more of the NDF's array components are in a defined state and contain values which may need to be shuffled to accommodate the change. Consequently, if the values of any array components need not be retained, they should be reset to an undefined state before changing the shape of a base NDF. For instance:

      CALL NDF_RESET( INDF, 'Data,Variance,Quality', STATUS )
      CALL NDF_SBND( NDIM, LBND, UBND, INDF, STATUS )

would ensure that no array values are retained and that no time is unnecessarily wasted as a result.



next up previous
Next: Applying Pixel-Index Shifts
Up: ALTERING BOUNDS AND PIXEL INDICES
Previous: ALTERING BOUNDS AND PIXEL INDICES


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