New values may be written to an axis array by mapping it using NDF_AMAP and specifying a mapping mode of `UPDATE' or `WRITE'. Any new values assigned to the mapped array (or modifications made in the case of `UPDATE' access) will then be written back to the NDF when the array is unmapped, as described in detail in §. The following example shows how an axis width array might be mapped for write access, passed to a routine SETVAL which assigns values to it, and then unmapped:
INTEGER PNTR( 1 ), EL ... CALL NDF_AMAP( INDF, 'Width', IAXIS, '_REAL', 'WRITE', PNTR, EL, STATUS ) CALL SETVAL( 3.5, EL, %VAL( PNTR( 1 ) ), STATUS ) CALL NDF_AUNMP( INDF, 'Width', IAXIS, STATUS ) ... * Routine to assign axis width values. SUBROUTINE SETVAL( VALUE, EL, WIDTH, STATUS ) INCLUDE 'SAE_PAR' INTEGER EL, STATUS REAL VALUE, WIDTH( EL ) IF ( STATUS .NE. SAI__OK ) RETURN DO 1 I = 1, EL WIDTH( I ) = VALUE 1 CONTINUE END
When using update access, NDF_AMAP will ensure that the mapped array is filled with the appropriate default values if the axis array is initially in an undefined state.
After successfully unmapping an axis array mapped for update or
write access, the array's state will become defined.
This process of assigning values to an axis array will also cause
the NDF's axis coordinate system to become defined (see
§), so default values will be assigned to all the NDF's
axis centre arrays if these have not already been defined.
This process takes place whenever NDF_AMAP is called with a mapping mode of
`UPDATE' or `WRITE', and is exactly equivalent to calling the routine
NDF_ACRE (§) immediately beforehand.