FTS1_RGRDA

Reads the data of a FITS file in group format from disk or tape

Description:

This routine reads a data block from the FITS tape or disk file that has byte stream of data in the groups format, and writes the data into an array. The values of the parameters associated with the data array are also obtained. The bytes may be reversed for VAX/VMS.

Invocation

CALL FTS1_RGRDA ( MEDIUM, MD, SIZE, BPV, REVERS, PCOUNT, BLKSIZ, : ACTSIZ, BUFFER, OFFSET, RECORD, RDISP, PARAM, : DARRAY, STATUS )

Arguments

MEDIUM = CHARACTER ( ) (Given)
The medium containing the FITS file. Currently supported is DISK for a disk file.
MD = INTEGER (Given)
The tape or file descriptor depending on the value of %MEDIUM.
SIZE = INTEGER (Given)
Number of elements in the data array. Note this is not the same as the number of bytes.
BPV = INTEGER (Given)
The number of bytes per data value.
REVERS = LOGICAL (Given)
If true the FITS data bytes are to be reversed within each word (when BPV is 2) or each integer (when BPV is 4) etc. If BPV=1 this flags makes no difference. Normally, only 2 s complement integer data need be reversed. Floating-point data require adjacent bytes to be swapped. Note that the group parameters are by definition in 2 s complement integers, so are reversed regardless of the sense of this flag.
PCOUNT = INTEGER (Given)
The number of parameters associated with the data array.
BLKSIZ = INTEGER (Given)
The maximum blocksize and dimension of the tape/disk buffer.
ACTSIZ = INTEGER (Given and Returned)
The actual block size (a multiple of the FITS record length of 2880 bytes). It is only an input argument for %MEDIUM = DISK .
BUFFER( BLKSIZ ) = BYTE (Given and Returned)
The buffer containing the block of data. This is only read when %OFFSET does not equal %ACTSIZ, i.e. there are some non-header data within it.
OFFSET = INTEGER (Given and Returned)
The number of bytes in the current block already interpreted.
RECORD( 2880 ) = BYTE (Given and Returned)
The buffer to hold the current FITS record.
RDISP = INTEGER (Given and Returned)
The number of bytes in the current record already interpreted. If this displacement is equal to the record length then a new FITS record will be obtained. The displacement will be updated during processing of the group parameters and data, and therefore can have an arbitrary value between 0 and 2880. Do not modify this argument outside this routine once initialised.
PARAM( PCOUNT BPV ) = BYTE (Returned)
The parameters associated with the data array.
DARRAY( SIZE BPV ) = BYTE (Returned)
The data array.
STATUS = INTEGER (Given and Returned)
Global status value.