User's Guide

TAPEIN

Copy an image file(s) from tape into a LAS image

Function:

Copy an image file(s) from tape into a LAS image on disk. Each image file is processed with a unique set of parameters. The image(s) on tape may be windowed, subbanded, and/or subsampled when copied.

The parameters for this function can be divided into four groups. The first group includes the first four parameters specifying the tape(s) that contain the desired images, the images to be copied, and the name and data type of the output image(s). If the image files to be copied have a data descriptor record (DDR) stored on tape and the images are to be copied as they exist, then all of the remaining parameters can be allowed to default.

The second set are the parameters from DDRFLG to SAMPINC, these are used to window, subband, and/or subsample the images as they are copied. If allowed to default, the images will be copied as they exist on the tape(s).

The third set, from IDTYPE to TOTBANDS, are used to describe each image that is to be copied as they exist on the tape(s). If all of these images have a DDR stored on the tape these parameters do not need to be specified (see User Note 2 for a special case).

The final set are the parameters from INSYS to NHEADREC. These describe the physical characteristics of each image file being copied and default to the most commonly used values.

Parameters:

COMMENT
Description of tape(s). A text string sent to the operator's terminal describing each tape to be mounted. COMMENT should contain the tape library identification number and a short description of the tape. This will allow the operator to ensure that the correct tape is mounted.

FILENUM
File number(s). A list of the image file numbers to be read from tape. These numbers must be positive and in ascending order. See User Note 5.

OUT
Output image. OUT must specify either one output image or an output image for each of the tape files specified in FILENUM. In the first case, all of the tape files are written to the same LAS image and in the second case, each of the tape files is written as a separate LAS image.

ODTYPE(--)
Output data type. The data type of each output image. If allowed to default, each output image will have the same data type as the image file copied from tape.

  = SAME: Same as input
  = BYTE: BYTE      ( 8-bit unsigned integer) 
  = I*2:  INTEGER*2 (16-bit signed integer) 
  = I*4:  INTEGER*4 (32-bit signed integer) 
  = R*4:  REAL*4    (32-bit signed real) 

DDRFLG(--)
DDR flag. Option to copy the DDR file for each image file on tape into the DDR of the output image. If multiple image files are being copied to one LAS image, the value of DDRFLG must be NO for all input images. If allowed to default, DDRFLG will be set to YES for each image file.

  = YES:  Copy the DDR
  = NO:   Do not copy the DDR

SL(--)
Starting line. The starting line for each image to be processed. If allowed to default, SL will be set to one for each image file.

SS(--)
Starting sample. The starting sample for each image to be processed. If allowed to default, SS will be set to one for each image file.

NL(--)
Number of lines. The number of lines that are to be copied from each image file on tape. In a list of values, a zero may be entered to specify that all of the lines are to be copied from an image. If NL is allowed to default, all lines from each image file will be copied.

NS(--)
Number of samples. The number of samples that are to be copied from each image file on tape. In a list of values, a zero may be entered to specify that all of the samples are to be copied from an image. If NS is allowed to default, all samples from each image file will be copied.

BANDS(--)
Band number(s). The list of bands that are to be copied from each image file. If allowed to default, all bands from each image will be copied. See User Notes 1, 2, and 3.

NBANDS(--)
Number of bands. The number of bands that are to be copied from each image file on tape. If NBANDS is allowed to default, all of the bands from each image file will be copied. If BANDS is not specified then this parameter is ignored. See User Notes 1, 2, and 3.

LINEINC(--)
Line increment. Specifies that every LINEINCth line, beginning with SL, becomes part of the output image. Increasing the line increment reduces the number of lines in the output image. A value of 1 results in all lines of the image file being included in the output image. If allowed to default, LINEINC will be set to one for each image file.

SAMPINC(--)
Sample increment. Specifies that every SAMPINCth sample, beginning with SS, becomes part of the output image. Increasing the sample increment reduces the number of samples in the output image. A value of 1 results in all samples of the image file being included in the output image. If allowed to default, SAMPINC will be set to one for each image file.

IDTYPE(--)
Input data type. The data type of each image file on tape. If a DDR is stored on the tape along with an image file, the user supplied value is ignored for that image file and the value of IDTYPE is retrieved from the DDR. If SAME is supplied for a file, that file must have a DDR stored on the tape. If allowed to default, all image files being copied must have a DDR stored on tape and the value of IDTYPE will be taken from the DDRs.

  = SAME: Use the DDR's data type
  = BYTE: BYTE      ( 8-bit unsigned integer)
  = I*2:  INTEGER*2 (16-bit signed integer)
  = I*4:  INTEGER*4 (32-bit signed integer)
  = R*4:  REAL*4    (32-bit signed real) 

TOTLINES(--)
Total number of lines. The total number of lines in each image file on tape. If a DDR is stored on the tape along with an image file, the user-supplied value is ignored for that image file and the value of TOTLINES is retrieved from the DDR. If allowed to default, all of the image files being copied must have a DDR stored on tape.

TOTSAMPS(--)
Total number of samples. The total number of samples in each image file on tape. If a DDR is stored on the tape along with an image file, the user-supplied value is ignored for that image file and the value of TOTSAMPS is retrieved from the DDR. If allowed to default, all of the image files being copied must have a DDR stored on tape.

TOTBANDS(--)
Total number of bands. The total number of bands in each image file on tape. If a DDR is stored on the tape along with an image file, the user supplied value is ignored for that image file and the value of TOTBANDS is retrieved from the DDR. If allowed to default, all of the image files being copied must have a DDR stored on tape.

INSYS(--)
Input computer system. The computer system on which the input data was generated. If the DDR file is stored on the tape along with the image data, this parameter is ignored and INSYS is retrieved from the DDR. If a DDR is not stored on the tape and INSYS is allowed to default, it is assumed that the image files were created on the current computer system.

  = IEEE:  IEEE standard
  = VAX:   VAX system
  = SUN:   SUN work-station
  = IBMR2: IBM RS6000 POWERstation
  = PN:    Power Node
  = HP:    Hewlett Packard
NOTE: Hewlett Packard (HP) systems require an even number of bytes in each record. When the image being read contains BYTE data with an odd number of samples in HP format, the last sample of each input line is stripped off. The user may specify TOTSAMPS as either the original odd number of samples or the even number of samples that are actually on the tape. If the even number is specified, the output image will contain the zero value sample at the end of each image line.

BFORM(--)
Band format. The format of each image file on tape. If there is more than one band in the image, the data may be stored in band sequential (BSQ) or band interleaved by line (BIL) format. When allowed to default, it is assumed that all images are stored in BSQ format.

If multiple tape files are to be copied to one LAS image, then BFORM must be BSQ for all input images.

  = BSQ:  Band sequential 
  = BIL:  Band interleaved by line

BLKSIZ(--)
Block size. Number of image lines per physical tape record. If allowed to default, the block size will be set to one for all image files.

NHEADREC(--)
Number of header records. The number of header records associated with each image. These specify the number of records at the beginning of each tape file that are to be skipped. If allowed to default, a value of zero will be used for all image files.

ERRFLG(YES)
Error flag. Allows the user to specify how error conditions should be handled.

  = YES:  Stop processing on errors.  If an error is
	  encountered, the tape is dismounted and
	  TAPEIN is aborted.
  = NO:   Continue processing on errors.  If an error
	  is encountered, the tape is forward spaced to
	  the next EOF, an error message is issued,
	  and subsequent image files are copied.

NRETRIES(0)
Number of retries to perform. The number of times the user wants to start again if an error is encountered.

Examples:

  1. LAS> tapein comment="please mount bb1200. new york 1/1" filenum=(1 3) out=("image1", "image2")

    The tape bb1200 is mounted on a drive. The user has specified that the first and third image files on this tape are to be read into LAS images named IMAGE1 and IMAGE2, respectively. The images that are created will have the same data type as the images stored on tape. Both images will have their DDRs copied from tape. Because the parameters from ODTYPE to SAMPINC were allowed to default, the images will be copied exactly as they exist on the tape. The parameters from IDTYPE to TOTBANDS were allowed to default, indicating that both images must have a DDR stored on the tape along with the image data. Both images are assumed to be in BSQ format and have a block size of one. Neither image will have any leading records skipped prior to copying, and if an error occurs while copying the first image, processing will stop and the second image will not be copied.

  2. LAS> tapein comment=("please mount ex0001 1/2" "please mount ex0002 2/2") filenum=(1 3) out=three bands=(1 1 2) nbands=(1 2)

    In this example multiple image files are being read from several tapes and are being placed in the same LAS image. The tapes are treated as though they are one continuous tape and the image files are numbered in sequence starting with the first image on the first tape. This example assumes that tape ex0001 contains two one band images and tape ex0002 contains a two band image. The first image on tape ex0001 will be combined with the image on ex0002 to form a single three band image. The images are numbered as in the diagram below.

                     Tape ex0001               Tape ex0002
              -------------------------      ---------------
               |                     |        |           |
               |  Image 1   Image 2  |        |  Image 3  |
               |                     |        |           |
              -------------------------      ---------------
    

    The first band of output image THREE will be from the first image on tape ex0001 and bands two and three will be from the image stored on tape ex0002. Note that the special case outlined in User Note 2 is in effect and that both images must have DDR's stored on the tapes because the parameters from IDTYPE to TOTBANDS have not been specified.

  3. LAS> tapein comment=("please mount hh4523. seattle 1/2" "please mount hh4540. seattle 2/2") filenum=(1 3 7) out=img nl=(1024 1024 1024) ns=(1024 1024 1024) bands=(1 2 3 1 2 1 3) nbands=(3 2 2) lineinc=(2 2 2) sampinc=(2 2 2)

    The tape hh4523 is mounted on a drive. The user has specified to copy the first, third, and seventh image files into a single LAS image named IMG. The output image will have the same data type as the first image file. All three image files will be processed starting at line one, sample one and will have 1024 lines and samples read from tape. Image file 1 will have three bands copied to the output image and both image file 3 and 7 will have two bands copied to the output image. Image file 1 will have bands 1, 2, and 3 copied, image file 3 will have bands 1 and 2 copied, and image file 7 will have bands 1 and 3 copied. All image files will have every other line and sample taken from its 1024 by 1024 window resulting in an output image with 512 lines and 512 samples. Because the parameters from IDTYPE to TOTBANDS were allowed to default, all three image files must have a DDR stored on the tape. Each image file is assumed to be stored in BSQ format, have a block size of 1, and none of the image files will have any leading records skipped prior to the copy operation.

  4. LAS> tapein comment=("please mount xx1362. chicago 1/1") filenum=(1 2 3) out=img idtype=(byte byte byte) totlines=(600 600 600) totsamps=(400 400 400) totbands=(1 1 1)

    The tape xx1362 is mounted on a drive. The user has specified to copy image files 1, 2, and 3 into a single LAS image file named IMG. The data type of the output image will be the same as the first image that is copied. Since the parameters from DDRFLG to SAMPINC have been allowed to default, each image file will be copied exactly as it is stored on tape. The user has specified that all three image files are BYTE images, each has 600 lines and 400 samples, and each contains only one band. If any of the images have a DDR stored on the tape, the user supplied values of IDTYPE, TOTLINES, TOTSAMPS, and TOTBANDS will be overridden with the values from the DDR. If the images do not have a DDR stored on the tape, then the value of INSYS will be set to the type of computer system that TAPEIN is being run on. All images are assumed to have a block size of one and none of the images will have leading records skipped prior to the copying operation. If an error occurs while copying an image file, the subsequent images are not copied.

Description/Algorithm:

After the first tape has been mounted the following steps are taken for each image file that is to be read from tape.

   1. The appropriate number of image files are skipped to
      position the tape at the beginning of the image file.

   2. The tape is checked to see if a DDR has been stored along
      with the image data.  This DDR may be either a binary or
      an ASCII DDR (SEE USER NOTE 6).  If a DDR is found on the 
      tape the values of INSYS, TOTLINES, TOTSAMPS, TOTBANDS, 
      and IDTYPE are retrieved from the DDR and override the 
      values supplied by the user.  If DDRFLG for this image 
      is YES, the DDR is copied to disk.

   3. The image data is copied from tape to disk.

If at any time an end of tape (EOT) or an end of volume (EOV) mark is found, the current tape is dismounted and a request is sent to the operator's terminal to mount the next tape.

If the user aborts the processing of an image, the tape is rewound and dismounted.

Nonfatal Error Messages:

  1. [tapein-bands] Both BANDS and NBANDS must be specified

    Either BANDS or NBANDS was supplied and the other was allowed to default. When manually supplying the band numbers that are to be read from each image file, both BANDS and NBANDS must be specified. The parameter that was supplied is ignored and all bands will be read from every image file being copied.

  2. [tapein-cont] Error encountered copying image file from tape

    An error was encountered while copying the current image file from tape. This error will only occur if ERRFLG=NO. Processing continues with the next image file.

  3. [tapein-ddrflg] Invalid DDRFLG specification

    When multiple image files are being placed in one output image DDRFLG must be set to NO for all image files. DDRFLG is reset to NO and processing continues.

  4. [tapein-nband] Band <x> does not exist in image file

    The user supplied band number, <x>, does not exist in the current image file. All of the available bands that were specified are copied to the output image. This warning will only occur if copying each image file to its own output image.

  5. [tapein-noeof] EOF was not detected at completion

    This error informs the user that an EOF mark was not detected at the completion of the copy. The error occurs if the user did not correctly specify the input image size. The image data is saved, and the tape is forward spaced to the next file so that subsequent images may be copied.

  6. [tapein-reset] Resetting <xxxxxx> from <y> to <z>

    A DDR was found on the tape and parameter <xxxxxx> was reset from <y> to <z>. Processing continues.

    If TOTLINES, TOTSAMPS, or TOTBANDS is reset while copying multiple image files to a single LAS image the output image may be corrupted. If this message is issued in such a case, the image files should be copied separately.

  7. [tapein-tpeof] Unexpected EOF encountered

    This error occurs if an unexpected EOF was encountered. It implies that the input image specifications (total number of lines and/or total number of bands) were not correct. The image data is saved even though some of the image may be invalid.

  8. [tapein-window] <xx> is too large

    NL/NS is too large for the image file. The NL/NS is reset to the value indicated in the DDR or TOTLINES/TOTSAMPS, and processing continues.

Fatal Error Messages:

  1. [tapein-alloc] Error allocating dynamic memory

    An error occurred while allocating dynamic memory. If the error persists, contact the LAS system manager.

  2. [tapein-badbnd] Discrepancy between BANDS and NBANDS

    The number of bands supplied in BANDS does not agree with the total number of bands indicated in NBANDS. Respecify BANDS and NBANDS. See the User Notes for a more detailed explanation.

  3. [tapein-bform] Invalid band format specification

    When multiple image files are written to the same output image the band format for all input files must be BSQ.

  4. [tapein-fatal] Fatal error encountered

    A fatal error was encountered during processing. The error message displayed before this message is the error that was encountered.

  5. [tapein-large] User specified band <x>, image contains <y>

    Band <x> was specified in BANDS and is too large. The DDR on tape indicates that the image only contains <y> bands. Respecify the band numbers for this image file.

  6. [tapein-lessthan] <xxxxxx> has fewer values than <yyyyyy>

    The parameter <xxxxxx> must be allowed to default or it must have at least as many values as <yyyyyy>. If too many values are supplied, only the required number are used. Respecify the parameter <xxxxxx>.

  7. [tapein-multi] BANDS and TOTBANDS cannot both be NULL

    When placing multiple image files in one output image either BANDS or TOTBANDS must be specified. See User Note 2. Rerun specifying BANDS and NBANDS or TOTBANDS.

  8. [tapein-nheadrec] Invalid number of header records

    EOF or EOV was encountered while skipping the specified number of header records. Check the number of header records specified.

  9. [tapein-order] FILENUM must be in ascending order

    The image numbers supplied in FILENUM must be in ascending order. Respecify FILENUM in ascending order.

  10. [tapein-required] DDR does not exist. TOTLINES, TOTSAMPS, TOTBANDS, and IDTYPE must be specified

    The current image file on tape does not have a DDR. TOTLINES, TOTSAMPS, TOTBANDS, and IDTYPE must be supplied by the user. Specify the values omitted and rerun.

  11. [tapein-size] <xx> for image file <y> not equal to previous images

    NL/NS for image file <y> is not equal to the previous image files stored in the output image. Respecify the window size for this image file. This error will only occur if multiple image files are being placed in one output image.

  12. [tapein-totbands] TOTBANDS = <x>, DDR indicates <y>

    TOTBANDS indicates that <x> bands exist in the image file on tape while the DDR for that file indicates that there are <y> bands. When placing multiple image files in one output image the number of bands specified in TOTBANDS must agree with the DDR on tape. Respecify TOTBANDS for this image file.

  13. [tapein-tpread] Error reading from tape

    An error occurred while reading an image file from tape. The tape is moved forward to the next EOF mark and control is passed to the calling routine.

  14. [tapein-unequal] Number of values for OUT and FILENUM must be equal

    The number of images supplied for OUT must be either one or equal to the number of values supplied for FILENUM. If one output image name is supplied then all of the image files from tape are placed in the same output image, otherwise each image file from tape is placed in its own output image.

User Notes:

  1. FILENUM, BANDS and NBANDS have the following correlation. FILENUM is a list of the image files that the user would like to read from the specified tape(s). BANDS is a list of the bands that are to be read from each of these image files.

    For example, if 5 images are stored on one tape and images 2, 3, and 5 are to be copied then FILENUM should be set to (2 3 5). If bands 1 and 2 are to be read from image file 2, band 4 is to be read from image file 3, and bands 1, 2, 3, and 4 are to be read from image file 5, then BANDS should be set to (1 2 4 1 2 3 4).

    NBANDS is used to indicate which bands specified in BANDS belong with which image. Since we are requesting 2 bands from the first image, 1 band from the second, and 4 bands from the third image supplied in FILENUM, NBANDS should be set to (2 1 4).

  2. When copying multiple images from tape to a single LAS image, the user must supply either BANDS and NBANDS or TOTBANDS, or all three. This is because TAPEIN must know the total number of bands that are to be placed in the output image before the first image is copied.

  3. To read all of the bands from every image on tape both BANDS and NBANDS can be allowed to default. When doing so, each image must have a DDR stored on the tape (this DDR can be either binary or ASCII) or the user must supply the total number of bands in each image with TOTBANDS.
  4. Unexpected results may occur if the input data type is converted to a lower-order data type. If the sample value is larger than what the new type supports, the least significant bits are used.

  5. The following is a description of the number of files used to store LAS images. If an image does not have a DDR stored on tape it will be contained in a single, physical tape file. Images that have a DDR stored on tape will consist of two physical tape files, the DDR file followed by the image data file. See the illustration below.

                   Image                   Physical
                   Files                   Files
                          --------------
                     1 -->| Image Data |<--- 1
                          |     EOF    |
                     2 -->|  DDR File  |<--- 2
                          |     EOF    |
                          | Image Data |<--- 3
                          |     EOF    |
                     3 -->| Image Data |<--- 4
                          |     EOF    |
                          |     EOF    |
                          --------------
    
    
    FILENUM specifies the number of the image file(s) to be read rather than the number of the physical file(s). For example, if the user specified FILENUM=3, then the first physical tape file is examined and found not to be a DDR so it is skipped and counted as a single image file, the second physical file is examined and found to be a DDR so the next two physical files are skipped leaving the tape positioned to read the third image file or fourth physical file.

  6. For an ASCII DDR to be read, the DDR must be before the image data.

  7. The IEEE standard is taken from "IEEE Standard for Binary Floating-Point Arithmetic" (Std 754-1985). This publication establishes a standard format for the output of REAL and DOUBLE data types.

  8. A related LAS function is TAPEOUT.