File Reference Routines

The FRI library is concerned with the creation and deletion of file references in datasets. Such references are usually used to link together collections of related files, eg. a spectrum, its background and its response. This linkage permits a program accessing the linked file to load all files at once, minimising unnecessary user interaction.

See the documentation on the RMF

The redistribution matrix component of the spectral response
ARF
The normalisation component of the spectral response
VIGN
The vignetting factor dataset
PRIMARY
A link written to subsidary files to indicate the principal dataset, ie. the one you usually write the links to. This link is only intended to maintain such links in the OGIP FITS standard. Links are created using the FRI_PUTI routine which takes the ADI identifier of the object to be linked. The former routine is less robust as it is quite possible to write references to non-existent files.

A link can be destroyed using the FRI_GET. Secondly, the associated file can be opened directly using ADI_FOPEN, except that the file name is extracted from the named link rather being supplied directly.

Representation of file links in HDS

File links are stored in HDS in one of two ways. If the supplied object to be linked is itself an HDS file then the Starlink REF facility is used to write the reference to a structure called linknameREF in the structure MORE.ASTERIX. If the supplied object is not an HDS file, or if the user supplied the text name of the linked file then FRI writes a component of the same name which is simply a character string.

Representation of file links in FITS

File links are represented using FITS keywords whose name is generally the logical name of the link with FILE appended. The exception is the PRIMARY link whose name is dependent on the exact format being written. For OGIP spectra the keyword name is PHAFILE.

Examples

Creating a file link

      program crelink

      character*132	ifile
      character*5	ltype
      character*80      link

      integer           id
      integer           status

      call getarg(1,ifile)
      call getarg(2,ltype)
      call getarg(3,link)

      status = 0
      call adi_fopen( ifile, 'update', '*', id, status )

      call fri_putc( id, ltype, link, status )

      call adi_fclose( id, status )

      end

Further Reading

David J. Allan (dja@star.sr.bham.ac.uk)