User's Guide

TAREX

Extract tar'd scenes from 8HI tapes

Function:

Extract tar'd scenes from 8HI tapes by emulating unix tar. Files containing checksum errors are skipped and processing will continue -- unix tar will simply quit once an error is encountered.

Parameters:

Subcommand -RANGE:
Extract a sequential set of tar'd AVHRR images from tape to disk. The images copied to tape are defined by a starting and stopping image number.

TAPEID
Tape ID. The library identification code of the tape(s) containing the desired images.

DRIVE
Drive name that the tape is mounted on.

CEOSID
CEOS ID. A Committee on Earth Observing Satellites (CEOS) three character alphanumeric identification code identifying the receiving station that acquired the AVHRR data.

START(1)
Starting image number. The first image to be read from tape.

STOP(--)
Stopping image number. The last image to be read from tape. If left as the default value (--), all images from the starting image to End of Tape will be extracted.

DSTDIR(ADAPSACQ VALID=(ADAPSACQ,ADAPSPROD)
Destination directory. The directory in which the acquired images will be placed. The directory specification must be an environment variable.

  = ADAPSACQ:  The ADAPS 'acquire' directory
  = ADAPSPROD: The ADAPS 'products' directory

Subcommand -SELECT:
Extract a selected set of tar'd AVHRR images from tape to disk. Up to 20 non-sequential images may be copied from tape.

TAPEID
Tape ID. The library identification code of the tape(s) containing the desired images.

DRIVE
Drive name that the tape is mounted on.

CEOSID
CEOS ID. A Committee on Earth Observing Satellites (CEOS) three character alphanumeric identification code identifying the receiving station that acquired the AVHRR data.

IMAGENUM
Image number(s). Numbers of the images to be read from tape.

DSTDIR(ADAPSACQ VALID=(ADAPSACQ,ADAPSPROD)
Destination directory. The directory in which the acquired images will be placed. The directory specification must be an environment variable.

  = ADAPSACQ:  The ADAPS 'acquire' directory
  = ADAPSPROD: The ADAPS 'products' directory

Examples:

  1. LAS> tarex-range tapeid=km7151 drive=7 ceosid=ykt

    All files on tape km7151, mounted on drive 7 will be extracted. The files will be created in the default ADAPSACQ directory with file names of the form akm7151_YY_XXX.ykt where YY is the year the file was created and XXX is the sequence number of the file on tape.

  2. LAS> tarex-select tapeid=nasa28 drive=4 ceosid=ubm imagenum="5 10" dstdir=adapsprod

    The fifth and tenth image on tape nasa28 mounted on drive 4 will be extracted and placed in the ADAPSPROD directory. The file names will be anasa_YY_005.ubm and anasa28_YY_010.ubm.

  3. LAS> tarex-range tapeid=nasa28 drive=4 ceosid=ubm start=4 stop=10

    The fourth through the tenth images in tape nasa28 mounted on drive 4 will be extracted and placed in the default directory ADAPSACQ.

Description/Algorithm

This function will normally be called from TPACQUIRE when CEOSID's of YKT or UBM are specified. The tape must already be mounted on the drive -- this will be accomplished by TPACQUIRE. The tape record size is determined by reading the first record on tape then rewinding the tape. A block of data, the size of a default tar block (10240) is read from tape and this block is searched for a valid tar header record. Blocks will be read from tape until a valid header is found or TAPE_EOT is reached.

Once a valid header record is found, the file size and year are obtained from the header. The file is read from tape and written to disk if the file number is in the file selection range. When the file has been completely read another search for a valid header is started.

Processing continues until TAPE_EOT is reached or all files in the selection range have been extracted. Since there is no way of determining how many files may follow an invalid header record, no attempt is made to update file sequence number to indicate missed files (see User Note 1).

Nonfatal Error Messages:

  1. [tarex-header] Error: searching for TAR header

    TAR checksum errors occurred in more than 5 TAR blocks. The tape file will be skipped. TAR blocks will continue to be searched for valid checksums until one is found or End of Tape is reached.

  2. [tarex-incmplt] Error: file extraction not complete

    An End of File/Volume/Tape was reached before the entire file was extracted. The partial file is moved to ADAPSERR and processing continues unless End of Tape was reached.

  3. [tarex-renam] Error renaming XXX

    A system error occurred while renaming the output file. Attempt to rename the file on completion of the process. If problem persists contact the system administrator.

Fatal Error Messages:

  1. [tarex-env] Unable to retrieve value of XXX

    The unix environment variable XXX could not be found. Set the variable and rerun the program.

  2. [tarex-open] Unable to open XXX

    An error occurred attempting to open either the tape drive or the output disk file. Ensure that the tape was mounted. For disk problems, ensure that there is sufficient disk space and write permissions. If problem persists, contact the system administrator.

  3. [tarex-alloc] Error allocating memory for XXX

    The system was unable to allocate memory for the buffer XXX. Check with the system administrator if problem persists.

  4. [tarex-close] Error closing XXX

    An error occurred while closing the tape or a disk output file. Check with the system administrator if problem persists.

User Notes:

  1. This program depends on detecting valid tar headers to determine file sizes. If invalid headers follow an image it is impossible to decide how many, if any, files have been tar'd in the same tape file. For this reason, when an invalid header cannot be found within five tar blocks, an error message is generated and the tape file sequence is incremented by one. When invalid headers are found tape sequence numbers may not match the file numbers requested.