Design Document for MKLEVEL1B

MKLEVEL1B

AUTHOR: D. Lloyd

Functional Summary:

MKLEVEL1B creates Level 1b files from Level 0 archive images. Multiple Level 1b files may be written. Output may be written to disk of tape. Three windowing options are available: LINE, LAT/LONG and LAT/RANGE. The MKLEVEL1B executable may be called from the unix command line with the LINE windowing option.

Comments:

This design document was created during a complete rewrite of the original MKLEVEL1B module.

BACKGROUND:

This module was rewritten for two main reasons: 1) to utilize the Level 1b support routines that have recently been written; and 2) to make the executable unix callable. Level 1b support routines were written to eliminate differences in output from the three main Level 1b modules: MKLEVEL1B, INGEST1B, and WINDOW1B. Enhancements such as multiple input files and standardized input parameters were also needed among the three modules. The need to be unix callable stems from the confusing and roundabout procedures that ANSISTACK must utilize to call MKLEVEL1B.

REQUIREMENTS:

    1.  Current production requirements must be met.
    2.  Output must match the current production MKLEVEL1B
        output.
    3.  Callable from unix command line.
    4.  Multiple input files.
    5.  Utilize Level 1b support routines.

Scope/Limitations:

    1.  Input limited to disk.
    2.  Unix call only supports the LINE windowing option.
    3.  Output scenes will not be split across tapes.

Overall Design

MKLEVEL1B creates Level 1b images from Level 0 archive images. Output may be to disk or tape (input limited to disk). Three windowing options are available: LINE, LATLONG and LATRANGE. The input image is opened and a windowed model is created. Two data headers, the terabit memory (TBM) and data set header (DSH), are created. The output file is opened, the headers are written. Each line in the window is read from input and converted to Level 1b format and written to the output. Product summary listings may be printed. For tape output, a tape label and shipping memo are created. Input and output files are closed. If multiple input files are specified, processing continues until all input are exhausted.

Flow diagram:

  • Figure 1 MKLEVEL1B Overall Flow Diagram postscript version
  • Figure 2 MKLEVEL1B PDF Flow Diagram postscript version
  • Figure 3 MKLEVEL1B executable Flow Diagram postscript version

    MKLEVEL1B.PDF Module design:

    All parameters are checked for completeness and correctness. If more than one input is specified and window and/or channel parameters are defaulted, they are expanded for all input files. If output is to tape, the tape is mounted and checked for ANSI labeling and a logical tape end is determined. For each input file the MKLEVEL1B executable is called. The returned product summary file name is saved. If logical tape end was reached and multiple tapes are allowed, a new tape is mounted and the current file is written to the new tape. When all files are written, a tape label and shipping memo are created (tape output only). Product summary files are printed if desired. If tape was used the tape drive is released.

    PARAMETERS:

    INPUT:

    Common parameters:
            INFILE          List of Level 0 files
            COMMENT         Tape mount comment
            OUTFILE         List of Level 1b files
            CHANS           Channel specification for each input file
            NCHANS          Number of channels for each input file
            PACKFLG         Flag to pack 5 channel output
            ACCTNUM         Account number
            ORDERNUM        Order number
            UNITNUM         Unit number
            MVOLFLG         Multi-volume flag
            SUMFLG          Summary flag
            TAPEDENS        Tape density
            TTYPE           Tape type
            PRODESC         Product description
    	MAXBYTES	Maximum number of Mbytes to write to tape
    	ADDRESS		Shipping address
    
        -LINE parameters
            SL              List of starting line numbers
            NL              List of number lines
    
        -LATLONG
            SLAT            List of starting latitudes
            SLONG           List of starting longitudes
            ELAT            List of ending latitudes
            ELONG           List of ending longitudes
    
        -LATRANGE
            SLAT            List of starting latitudes
            ELAT            List of ending latitudes
            QUADNUM         List of quadrant numbers
            AREAOPT         List of area options
    
    OUTPUT:
        Level 1b files either to disk or tape
        Tape label and shipping memo if output is tape
        Product summaries if specified
    

    ALGORITHM:


    Module Design(s):

    MKLEVEL1B executable design:

    A check is made to determine if MKLEVEL1B was called from unix or TAE and parameters are retrieved. The input file is opened and header information is used to fill the model. A windowed model is created from which the TBM and DSH records are made. The output file is opened and the header records are written. Each line in the output window is read and converted to Level 1b format and written to the output file. Finally a product summary file is created and files are closed.

    PARAMETERS:

    COMMENT
    INPUT: Tape mount comment

    DRIVE
    INPUT/OUTPUT: Drive that tape is mounted on

    INFILE
    INPUT: Level 0 input file name

    OUTFILE
    INPUT: Level 1b output file name

    SL
    INPUT: Starting line number

    NL
    INPUT: Number of lines

    CHANS
    INPUT: Channel specification

    NCHANS
    INPUT: Number of channels in CHANS

    PACKFLG
    INPUT: Flag to pack 5-channel output

    ACCTNUM
    INPUT: Account number

    UNITNUM
    INPUT: Unit number

    ORDERNUM
    INPUT: Order number

    PRODESC
    INPUT: Product description

    MVOLFLG
    INPUT: Multi-volume flag

    TAPEDENS
    INPUT: Tape density

    TTYPE
    INPUT: Tape type

    NVOLS
    OUTPUT: Number of volumes in tape set

    MAXBYTES
    INPUT: Maximum number of Mbytes to write to tape

    NBYTES
    INPUT/OUTPUT: Number of Mbytes written to tape

    SUMFILE
    INPUT: Product summary report file name

    OUTNAME
    OUTPUT: Actual output file name created

    SLAT
    INPUT: Starting latitude

    SLONG
    INPUT: Starting longitude

    ELAT
    INPUT: Ending latitude

    ELONG
    INPUT: Ending longitude

    QUADNUM
    INPUT: Quadrant number

    AREAOPT
    INPUT: Area option

    ALGORITHM:

    RETURN VALUE(S):


    Testing criteria:

    Testing for the MKLEVEL1B rewrite will mainly consist of creating a Level 1b output file with current production code and rewritten code and using unix diff to compare the two output files. For tape testing, files will be written to tape then retrieved from tape using unix dd and again unix diff will be used to compare files. For windowed cases, both an ascending and descending scene will be used

    The following test cases will be run: