User's Guide

PLENTER

Reads Landsat MSS scenes from CCTX formatted tapes

Function:

Reads Landsat MSS scenes from CCTX formatted tapes. A Landsat scene is divided into four strips placed on one, two, or four input tapes. If a tape contains more than one Landsat scene, files can be skipped, but the first strip must always be processed initially. The strips from the input tape(s) contain data from the four bands of the scene arranged in band interleaved by pixel pair (BIP2).

The Landsat scene can be corrected for earth rotation and any synthetic pixels can be removed. A line and/or sample increment value allows every Lth line of the scene and/or every Nth sample of a line to be written to the output file(s). Each sample of a line can also have a offset added to it, and/or each sample of band 7 may be multiplied by a value of 1 or 2. These two options help to distinguish any registration data (that is set to zero) from the actual image and to increase the sample range of the band 7 samples.

The ID information and ANNOTATION record for each strip can be printed to the terminal, the line printer, or file. If a user is interested in retaining any related information about the output images, the ID, ANNOTATION and SIAT files can also be written to disk files that can be accessed at a later time. Whenever the user chooses to remove synthetic pixels, a file containing the raw line lengths (RLL) for each line is created and written to disk. For further information about the use of a RLL file see User Note #9.

Parameters:

COMMENT
Description of tape(s). The tape ID numbers on which the strips of an image are located. The four strips of an image may be contained on one, two, or four tapes. If the image is contained on more then one tape, the first tape must always be mounted initially so that the ID information can be read to verify the input data and set the image size. Also, when processing of a tape is complete, the user and the operator are signaled to mount the next tape.

OUT
Output image. The size of the output BYTE image is determined by the size of the image on tape and the values specified in LINEINC and SAMPINC.

INWIND(--)
Input window. The input image window from tape to be processed. By default, the complete image is processed from tape.

BANDS(--)
Band number(s). The image bands to be processed. By default, all four bands in the image are processed.

SKIPNUM(0)
Number of files to skip. Number of files to be skipped starting from the current tape position.

WRTDSK(IAS)
Write to disk. Write the ID, ANNOTATION, and/or SIAT files to an output file. The associated files are copied directly from tape. See User Notes for information on the associated file formats and the naming conventions.


  = ID:   ID record.  Write only the ID record to an
          output file
  = ANN:  Annotation record.  Write only the annotation 
          record to an output file.
  = SIAT: SIAT records.  Write only the SIAT records
          to an output file.
  = IAS:  ID, annotation, and SIAT record(s).  Write
          the ID, annotation, and SIAT records to an
          output file.
  = NONE: No record(s) written.

PRINT(TERM)
Output destination. The destination of the output.

  = --:        No Report
  = TERM:      Terminal.  Output is sent to the
               user's terminal.
  = LP:        Line printer.  Output is sent to the 
               printer defined by $PRINTER.
  = Filename:  User-supplied filename.  Output is sent 
               to the user-supplied file with the
               extension ".prt".

SKEWFLG(NO)
Earth rotational skew flag. While an area of a scene is being scanned, the earth is rotating causing the scene to be skewed. This can be corrected by offsetting each line of the output image by the maximum amount of skew minus the amount of earth rotational skew already in the line.


  = YES:  Correct for skew.  The image is corrected
          for earth rotational skew.
  = NO:   Do not correct for skew.  The image will not 
          be corrected for earth rotational skew.

SYNTHFLG(YES)
Synthetic pixel flag. Synthetic pixels are added to the scene to make all lines the same length, multiples of 24. These pixels represent a discontinuous error in the scene and can be removed. A RLL file will be create when this parameter is set to YES.


  =YES:  Remove synthetic pixels.  Remove synthetic 
         pixels from the image before it is written 
         to the output image.
  =NO:   Do not remove synthetic pixels.  Do not 
         remove synthetic pixels from the image before 
         it is written to the output image.

LINEINC(1)
Line increment. Specifies that every LINEINCth line, starting at line 1, is to be processed.

SAMPINC(1)
Sample increment. Specifies that every SAMPINCth sample, starting at sample 1, is to be processed.

OFFSET(0)
Offset value. An upwards scaling factor that is be added to each sample before it is written to the output image. The scaling can help distinguish the registration data from the actual image data.

SCALFACT(2)
Scale factor. Multiplicative scaling factor that can be applied to each sample of a line from band 7 of the image. The samples from band 7, ranging from 0 through 63, are multiplied by this factor before it is written to the output image. A factor of "1" has no effect on the output samples.

Examples:

  1. LAS> plenter comment="please mount tape v403" out=image bands=(1,2,3,4) skipnum=0 wrtdsk=ias skewflg=yes synthflg=no lineinc=1 sampinc=1 offset=10 scalfact=1

    The four bands of the Landsat scene that are on the tape with the tape ID of v403 are written to a fourband LAS image named IMAGE.img. The output LAS image files contain every sample (scaled up by ten) of every line from the four bands of the Landsat scene. Earth rotational skew is corrected and synthetic pixels are not removed.

    The ID information and the ANNOTATION information from each strip of the Landsat scene is written to the user's terminal and the printer specified by the global $PRINTER. The ID and ANNOTATION records are also written to disk files named IMAGE.cctx_id and IMAGE.cctx_annot. The SIAT information at the end of strip 4 is also written to the disk file named IMAGE.cctx_siat.

  2. LAS> plenter comment=(gg801,gg905,gg221,hh812) out=b2img bands=2 skipnum=0 wrtdsk=none print=term skewflg=yes synthflg=yes lineinc=5 sampinc=5 offset=0 scalfact=2

    The second band of the Landsat scene located on four tapes with tape IDs of gg801,gg905,gg221,hh812 is corrected for earth rotational skew and has synthetic pixels removed; every fifth sample from every fifth line is written to the LAS output file named B2IMG.img. When the data from the first strip has been written to the output file, the user and the operator are signaled to mount the next tape so that the next strip of the image can be processed. This strip is then joined with the output from the previous strip. Processing continues in this manner until the complete image has been read from the four tapes and written to the output file. There is no offset added to each pixel, and the value for SCALFACT has no effect on the data from the second band from tape.

    The ID and ANNOTATION information from each strip is printed to the screen, and there is no disk files created for this information or the SIAT data. However, since synthetic pixels are being removed, the raw line lengths (RLL) are written to a disk file named b2img.cctx_rll.

Description/Algorithm:

PLENTER begins the process by getting the input parameter values, opening the tape drive unit, and verifying that the first tape is being processed. The ID and ANNOTATION records are then read and written to the terminal and/or the line printer and/or disk files.

A LAS image for each band that is wanted is created and opened for output. The length of the output buffer is the adjusted line length read from the ID record plus the maximum skew needed to correct for earth rotation. Earth rotation is corrected by offsetting each image line by E(l) samples;


  where:

  E(l)= [skew * [(line - 1) / 6]] 
  skew= 0.587 * SQRT(COS(LAT)**2 - 0.02495) 
  LAT = Center latitude value from the ID record;  

  brackets, [ ], indicates the integer part of the calculation.

The maximum skew is the largest value of E(l). The first image sample of a line is located at E(l)+1, and the preceding samples in the output buffer are zero. Any registration data before or after each band is also set to zero.

A record must be read for each line that is to be skipped. The lines that are wanted are read from tape and processed eight samples at a time. The eight samples contain two pixel pairs from each band of the scene. If the band and the sample for that band are selected, multiply the sample by a specified factor if it is from the fourth band and/or add any upward scaling factor to the sample. Place the sample in the output buffer for that band at the next available location (the next location is offset by E(l)). If synthetic pixels are not wanted, a calculation must be made to locate the samples that should not be added to the output buffer. Each synthetic pixel is spaced delta pixels apart;


where: 
   Delta= RLL / (CLL- (RLL+ 6)) + 1, 
   RLL  = Raw line length read from each record, 
   CLL  = Corrected line length read from the ID record. 
          Each (I * delta) pixel is then ignored.  

When all the records from a strip have been read, temporary holding variables are set to the current pointer values; the tape is then positioned to the next strip. If there is more than one tape, the user and the operator are signaled to mount the next tape volume. The output images are then closed and reopened for update, and processing continues as above until all strips have been read. If the SIAT data at the end of the last strip is wanted, read each record and write them to a disk file.

Nonfatal Error Messages:

  1. [plenter-siat] Error reading SIAT file

    An error occurred while reading the SIAT file from tape. The image data is probably valid.

  2. [plenter-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing. The image data is probably valid and therefore saved. The error message that is displayed immediately preceding this message is the specific error that was encountered. Processing continues.

  3. [plenter-corner] Error calculating corner coordinates

    An error was encountered attempting to calculate the corner coordinates for an image that was windowed from tape.

Fatal Error Messages:

  1. [plenter-fatal] Fatal error encountered

    A fatal error was encountered during processing. The output image file is not deleted, and processing is terminated. The message that is displayed immediately preceding this error message is the specific error that was encountered.

  2. [plenter-invwnd] Invalid window specified

    An invalid window was specified to be read from tape. Respecify the window.

  3. [plenter-alloc] Error allocating dynamic memory

    Memory could not be allocated for the output image buffer; therefore, the image cannot be created.

  4. [plenter-tape] Mount tape one first

    The tape mounted was not the first tape. Processing of the image must begin with the first tape.

  5. [plenter-tpread] Error reading tape

    The tape could not be read; therefore, an image cannot be created. Check to ensure that the correct tape was mounted.

  6. [plenter-open] Error opening XXX file

    The ID, ANNOTATION, SIAT, RLL, or output print file could not be opened. Check file protections or disk space. If there was an error opening the SIAT file, the image data is probably valid.

User Notes:

  1. The first tape must always be mounted initially so that the ID information can be read to set the image size and be used to calculate the maximum earth rotational skew.

  2. Any registration data from the input image is set to zero before it is written to the output file.

  3. The samples from the fourth band on tape are multiplied by the SCALFACT value before the OFFSET value is added.

  4. If the strips of an image are contained on more than one tape, the user and the operator are signaled to mount the next tape after processing of each tape has been completed.

  5. A Landsat scene is contained on four files plus one file that contains the SIAT data.

  6. The associated ID, ANNOTATION, RLL, and SIAT files are exact copies of the records on tape and will be named:

             image_name;cctx.id
             image_name;cctx.annot
             image_name;cctx.rll
             image_name;cctx.siat
    

    See the technical memorandum "GENERATION AND PHYSICAL CHARACTERISTICS OF LANDSAT MSS COMPUTER COMPATIBLE TAPES" for the ID, ANNOTATION, and SIAT file formats. The format for the RLL file consists of a text file with the image line numbers followed by their respective raw line lengths with the synthetic pixels removed.

  7. See the Description/Algorithm section for a description of the correction for earth rotational skew and removal of synthetic pixels.

  8. The corner information that is stored in the DDR file is only an approximation. The accuracy of the corner coordinates is unknown. Even though the accuracy is unknown, the corner information is placed in the DDR file because it can be used to provide a rough idea of the location of the image. The projection information of the image on tape is unknown. The projection information is provided in the DDR to approximate geographic information of other pixels.

  9. If systematic corrections to the image using XCORRECT then a full MSS scene is requireed. A windowed or subsampled image will result in an error using XCORRECT.

  10. A complete Landsat scene is contained on a total of five files--four files (strips) on tape plus one file containing the SIAT data.

  11. The sample is multiplied by SCALFACT before OFFSET is added.