General Item Routines

These routines read and write ``small'' items (items consisting of a single value), or perform some operation on an entire item.

In many processing systems these routines would be called ``header handling'' routines. This has led to the rather misleading use of the letters ``hd'' as a component of each of the following routine names.

      subroutine rdhda(tno,itemname,value,default)
      subroutine rdhri(tno,itemname,value,default)
      subroutine rdhdr(tno,itemname,value,default)
      subroutine rdhdd(tno,itemname,value,default)
      subroutine rdhdc(tno,itemname,value,default)
      subroutine wrhda(tno,itemname,value)
      subroutine wrhdi(tno,itemname,value)
      subroutine wrhdr(tno,itemname,value)
      subroutine wrhdd(tno,itemname,value)
      subroutine wrhdc(tno,itemname,value)
      logical function hdprsnt(tno,itemname)
      subroutine hdcopy(tin,tout,itemname)
      subroutine hdprobe(tno,itemname,descr,type,n)
Before these can be accessed, the data set must be opened with either xyopen, uvopen or hopen. Tno is the handle returned by these open routines. The name of the item to access is given by itemname (a string). These names should be up to 8 lowercase alphanumeric characters, and (where possible) they should conform to the FITS standard. The rdhd routines read an item, returning its value in value. The routines rdhda, rdhdi, rdhdr, rdhdd and rdhdc return a string, integer, real, double precision or complex value, respectively. If the item is not found, the rdhd routines return the default value given by default (note value and default should be a string, integer, real, double precision or complex values, depending on the routine called). Similarly the wrhd routines save the value of an item.

The logical function hdprsnt can be called to determine if a particular item exists.

The routine hdcopy copies an item from one data set to another. The item can be arbitrarily large. Hdcopy copies from the data set, whose handle is given by tin, to the data set whose handle is tout.

The routine hdprobe is used to probe the characteristics of an item. The string descr returns a brief description of the item (intended for people, not programs, to read). If the item consists of a single value (or string), the description gives the value. Otherwise the description gives the type and size of the item (in human readable form). The string type is one of 'nonexistent', 'integer*2', 'integer', 'real', 'double', 'complex', 'character', 'text' or 'binary' (unknown type). The integer n gives the number of elements in the item. If the item does not exist, type returns 'nonexistent' and n returns zero.

Miriad manager
2011-08-19