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:
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:
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 §15.6), 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:
would ensure that no array values are retained and that no time is unnecessarily wasted as a result.
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:
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:
then its shape would change to become:
Note that the behaviour of NDF_SHIFT and NDF_SBND is quite different. With NDF_SBND (§21.1) 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).