Purpose: This file contains routines to access data in a FITS header. Category: FITS File: ftsd_access.c Author: Sjag Steensma (K.G. Begeman) Description: The FITS (Flexible Image Transport System) format (see Wells) is designed for the interchange of astronomical images and other digital arrays on magnetic tape. A FITS tape contains one or more files, each file containing the data for one image. A file begins with one or more logical (tape) records containing "header" data in the form of 36 80-character (8-bits per character) records. The last header record contains only the string END. The data array starts at the first 2880 byte boundary after the END record. The header records describe the structure and coordinate systems of the data array and convey any auxiliary parameters and accompanying text. The basis grammar of a FITS header record is: descriptor = value / comment A descriptor is an 8-character ASCII string and unique in the header. The descriptors HISTORY and COMMENT are used for comment and may occur more than once in a header. The = sign occurs in column 9 and column 10 is blank. The parameter value is written in columns 11 - 80 in a format depending on the type of the parameter. The value field is optionally followed by a '/' and comment. The value field contains the value of the descriptor and can be of type character, logical, integer, real or double. For every type separate read and write routines are used. FITS files reside on tape or are copied to disk for faster access. The header can be decoded using the routines described below. To read a FITS file from tape or disk first get the complete header (one or more logical records) by calling FTSD_GETH(see fts_io.c). With the information given in the header the real or integer data can be obtained using the routines FTSI_GETR or FTSI_GETI. To write a FITS file to tape or disk first create a header. With the routines FTSD_PUTH, FTSI_PUTR and FTSI_PUTI, the header and the real or integer data can be written to integer data blocks on disk. The routines in this file read or write records from or to a header. The header argument in the calling routine should be a variable of type fchar and a multiple of 80 characters in length. The FTSD_Rxxx routines search a FITS header for a descriptor and return the value if the descriptor is found in the header. The header should conform the FITS standard, if not an error results. The FTSD_Wxxx routines fill a FITS header. The header should be initialised with spaces. With these routines descriptors (and their record) can be inserted, descriptor values altered or records removed. These routines return the offset of the record in the header, the first record having offset 0, the second 1 etc. Related Docs: D.C. Wells et al. : 1981, 'FITS, A Flexible Image Transport System', Astronomy & Astrophysics Suppl. Ser. 44, 363-370. See for the GET and PUT routines file: fts_io.c. Routines in this file: FTSD_FIND Finds a FITS descriptor in a set of FITS records. FTSD_INSERT Inserts a record in a FITS header. FTSD_DELETE Deletes a record from a FITS header. FTSD_RCHAR Reads a FITS character descriptor from a FITS header. FTSD_RINT Reads a FITS integer descriptor from a FITS header. FTSD_RREAL Reads a FITS real descriptor from a FITS header. FTSD_RDBLE Reads a FITS double descriptor from a FITS header. FTSD_RLOG Reads a FITS logical descriptor from a FITS header. FTSD_WCHAR Writes a FITS character descriptor from a FITS header. FTSD_WINT Writes a FITS integer descriptor in a FITS header. FTSD_WREAL Writes a FITS real descriptor in a FITS header. FTSD_WDBLE Writes a FITS double descriptor in a FITS header. FTSD_WLOG Writes a FITS logical descriptor in a FITS header. Updates: Aug 14, 1990: Sjag; document created.