c_arcwrite - Write the next line of an AVHRR archive image

SYNTAX

FUNCTION c_arcwrite (arcdesc, mnr, samples)

    long  *arcdesc;
    short mnr[];
    short samples[];

PARAMETERS

arcdesc (long *, input)

The archive file descriptor returned by c_arcopnwrt().

mnr (short [], input)

Buffer containing the HRPT Minor Frame data for the line being written to the image. This buffer must contain MNR_WORDS of INTEGER*2 values.

samples (short [], input)

Buffer containing the pixel values for all five AVHRR bands in BIP order. This buffer must contain either GAC_WORDS or LAC_WORDS of INTEGER*2 values depending upon the data type that was supplied to c_arcopnwrt().

DESCRIPTION

Write the next line of an AVHRR archive image. Each line of the image will be packed before it is written to the disk file. It is assumed that when the first line of an archive image is written, we do not know if it is an ascending or descending pass and how many lines it will contain. Therefore, the lines are written in the order that they are passed to this function and no pixel flipping is performed.

The AVHRR archive I/O routines use an internal buffer to read and write a specified number of lines at a time. This reduces the number of disk accesses that are required to process an image. The buffer is filled by calls to this function and it is only written to the disk file when the buffer is full. c_arclose() must be called to ensure the last buffer is written to the disk file.

RETURN VALUE

c_arcwrite() returns

    E_SUCC (0)  --> Successful completion.
    E_FAIL (-1) --> Operation failed.