next up previous
Next: A Note on Modes of Access
Up: CONNECTING WITH THE DATA SYSTEM
Previous: NDF Names

Finding and Importing NDFs   

Using the example above, suppose that LOC is an active HDS locator associated with the data structure:

      /users/bill/datafiles/today.RUN(66)

The routine NDF_FIND could then be used to find an NDF data structure relative to this object, and to import it into (i.e. make it known to) the NDF_ library, as follows:

      CALL NDF_FIND( LOC, 'BAND_B(1:66,1.04)', INDF, STATUS )

(note that here we have specified a relative name for the second argument). This would find the NDF section whose absolute name is:

      /users/bill/datafiles/today.RUN(66).BAND_B(1:66,1.04)

An identifier for this NDF would be returned via the INDF argument and the data structure could then be manipulated using other NDF_ routines. The locator passed to NDF_FIND may be annulled afterwards without affecting the subsequent behaviour of the NDF_ system.

Note that the relative name supplied could be any trailing fragment of the full (absolute) name, and might consist simply of a subscript - so long as a suitable locator was also available. In fact, the relative name could be entirely blank, in which case the locator supplied would be taken to identify the NDF directly. Thus, in:

      CALL NDF_FIND( LOC, ' ', INDF, STATUS )

the locator LOC should be associated with the NDF data structure itself.

To specify an NDF in a call to NDF_FIND using an absolute name instead, we utilise the special locator value DAT__ROOT, which is provided by HDS and defined in the include file DAT_PAR. This locator represents the notional HDS object which is the parent of all other HDS objects,[*] and specifying it as a locator value allows the associated NDF name to be an absolute name. Thus:

      INCLUDE 'DAT_PAR'

      ...

      CALL NDF_FIND( DAT__ROOT,
     :               '/users/bill/datafiles/today.RUN(66).BAND_B(1:66,1.04)',
     :               INDF, STATUS )

would access the same NDF section as in the examples above, this time using its absolute name.



next up previous
Next: A Note on Modes of Access
Up: CONNECTING WITH THE DATA SYSTEM
Previous: NDF Names


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