Design Document for NDFIN

NDFIN

AUTHOR: Tim Beckmann

Functional Summary:

Reads images from NLAPS Data Format (NDF) tapes, CD's, and disk and converts them to a LAS image.

Comments:

none

Background:

This application replaces the old NDFIN and NDF2LAS applications. Those applications only support NDF version 1. This new version of NDFIN adds support for NDF version 2, multi-volume CD's, and multi-resolution products.

Requirements:


Scope/Limitations:

- Multi-volume CD's and tapes must be mounted in the correct order. - Only lower case file names are supported.

Overall design:

Flow diagram:

    NDFIN
      |
      |--- FIND_HEADER_FILES
      |      |
      |      |--- getpar
      |      |--- unmount_media
      |      |      |
      |      |      |--- c_tpreop
      |      |      |--- c_tpclos
      |      |
      |      |--- mount_media
      |      |      |
      |      |      |--- c_tpopen
      |      |      |--- c_tpclos
      |      |
      |      |--- get_header_from_tape
      |      |--- get_header_from_disk
      |
      |--- ADD_TO_LIST
      |--- READ_NDF_HEADER
      |      |
      |      |--- read_ndf_parameters
      |      |      |
      |      |      |--- get_file_size
      |      |
      |      |--- c_dtmnum
      |      |--- get_spheroid
      |      |--- c_putddr
      |      |--- c_putbdr
      |      |--- c_wndconv
      |      |--- c_wndchk
      |
      |--- TPIN-EOV
      |--- RELDRIVE
      |--- CMDEL-FILE
      |--- CMRENAME
      |--- TRANSLAS-IN
      |--- COPY
      |--- REMOVE_FROM_LIST

Algorithm:



Module Design(s):

NDFIN:

The NDFIN PDF module is the main routine for the NDF ingest implementation.

PARAMETERS:

- COMMENT
        - This is the mount message to issue for the tapes or CD's to be 
          mounted.  This should only be entered when the source data is  
          tape or CD.  For multi-volume tapes or CD's, a message should be
          specified for each volume to be mounted.
- INFILE
        - Pathname of input file for CD's and disk.  When on CD's, the path
          returned by the mount request must be added to this path.
- BANDS
        - BANDS is the list of bands to process.  The band numbers are the 
          band numbers assigned to the image files by PDS when it creates the 
          products.  BANDS defaults to all bands present if it is not 
          specified.
- NBANDS
        - NBANDS specifies how the bands in the BANDS parameter should be 
          grouped together when creating the output files.  For example, if
          BANDS=(1,3,2,4) and NBANDS=(2,1,1), three output files will be 
          created with the first output file containing bands 1 and 3, the 
          second containing band 2, and the third containing band 4.  If 
          NBANDS is specified, BANDS must be specified and the number of bands
          in BANDS must equal the sum of the bands in NBANDS.
- OUT
        - List of output file names.  If NBANDS is specified, the number of 
          entries in OUT must equal the number of entries in NBANDS.  If NBANDS
          is not specified and a single OUT file name is provided, all the 
          output bands with the same resolution will be placed in the same 
          file (with the _r# appended to the name if the source is NDF 
          version 2).
- DEMOUT
        - Pathname to use for the DEM output file.  If this parameter is set,
          the source media will be searched for the NDF DEM header and 
          associated image file.
- WINDOW and UNITS
        - Allows sub-windowing of the image files.  The WINDOW is an array with
          four members.  The UNITS parameter may be set to LS (line/sample), 
          DEG(degrees), DMS(degrees-minutes-seconds), or PRO(projection).  When
          UNITS is LS, the WINDOW parameter is interpretted as (SL,SS,NL,NS).  
          For all other values of UNITS, WINDOW is interpretted as 
          (ULY, ULX, LRY, LRX).  If only a portion of the window intersects
          with the image, truncate the window to the image.  If the window
          does not intersect the image, it is a fatal error.  If only the first
          two window parameters are entered, default the last two to include 
          the rest of the image.
- ODTYPE
        - Data type to use for the output image.  Legal values are SAME, BYTE,
          I*2, I*4, and R*4.  The default is SAME.
- WRTDSK
        - The WRTDSK (write disk) parameter allows auxiliary files on the
          media to be copied to the working directory.  The options supported 
          are HST (history file), WOR (work order processing file), and
          NHDR (NDF header file).  The NDF header files will have the volume
          number appended to the file name.  The default is none of the files.

ALGORITHM:

Refer to the Algorithm above.

Testing criteria:

The NDFIN module should be tested with the following types of data sets:
NDF Revision 1 Data
Media
disk, tape, CD, multi-volume tape, multi-volume CD
Data Types
BSQ, BIL, BYTE, I*2, I*4, R*4
Windowing
DEG, DMG, LS, PRO
NDF Revision 2 Data
Media
disk, tape, CD, multi-volume tape, multi-volume CD
Data Types
BSQ, BIL, BYTE, I*2, I*4, R*4, multiple resolution data sets
Windowing
DEG, DMG, LS, PRO