next up previous contents
Next: Pros and Cons Up: Auxiliary Information Previous: Example 3. Referring to   Contents


Example 4. Referring to Multiple Dimensions, Applied to Multiple Dimensions and Subsections of the Data

Again, consider the previous examples, where now there are different measured uncertainties associated with the longitudes and latitudes, where the uncertainties vary over each longitude band in the southern hemisphere (including the equator). In the northern hemisphere, the measured uncertainties vary with each longitude-latitude grid point.

The uncertainties in the southern hemisphere are specified in an array, U1, containing 72 values (uncertainties over longitude). The uncertainties in the northern hemisphere are specified in an array, U2, with the dimensions of $45 \times 72$ (i.e., latitude, longitude). If the indices start numbering from 0, then we have the following auxiliary record fields:

OBJDESC.
NAUX = 2
AUXSPEC.
RECSORT = 0
NUMREF = 2
NUMAPP = 1
START = (0, 0, 0, 0, 0)
END = (-1, -1, 45, -1, 0)
AUXFMT = single precision floating-point
AUXTYPE = measured uncertainty
UNITS = deg
NUMSUP = 0
AUXRANGE.
RECSORT = 0
REFLEV = (1, 1)
REFNDEX = (0, 1)
APPLEV = 1
APPNDEX = 0
AUXVAL.
RECSORT = 0
AVALS = U1(72)
AUXSPEC.
RECSORT = 10
NUMREF = 2
NUMAPP = 2
START = (0, 0, 46, 0, 0)
END = (-1, -1, -1, -1, -1)
AUXFMT = single precision floating-point
AUXTYPE = uncertainty
UNITS = deg
NUMSUP = 0
AUXRANGE.
RECSORT = 10
REFLEV = (1, 1)
REFNDEX = (0, 1)
APPLEV = (1, 1)
APPNDEX = (1, 0)
AUXVAL.
RECSORT = 10
AVALS = U2(45,72)

In IDL, then, code to define the auxiliary information for this data object would look like this (using the basic structure as already given in Section 3.2.2):

    ; set up the relevant elements in the OBJDESC record
    RECTYPE = long(1)
    NDIM0 = long(1)
    NDIM1 = long(2)
    NDIM2 = long(2)
    NDIM3 = long(0)
    NAUX = long(2)
    .
    .
    .
    writeu,log_file_unit,   RECTYPE, vartype, reserved    $
    , NDIM0, NDIM1, NDIM2, NDIM3, reserved, isource       $
    , reserved, reserved, naudit, ninfo, ncomms, comcod   $
    , reserved, nbads, reserved, nprocs, reserved, npacks $
    , reserved, NAUX, cmpnum, reserved, reserved, reserved

    ; set up the dimensional information, bad data values,
    ; packing information, and processing information

    .
    .
    .

    ; set up the relevant elements for the first AUXSPEC 
    ; record: longitude and latitude uncertainties in the 
    ; southern hemisphere
    RECTYPE = long(80)
    ; first of two record groups
    RECSORT = long(0)
    ; there are two dimensions with uncertainties
    NUMREF = long(2)
    ; the uncertainties vary with longitude, therefore, 
    ; AUXVAL.AVALS has one dimension
    NUMAPP = long(1)
    ; this covers the entire southern hemisphere
    START = long( [0, 0, 0, 0, 0] )        
    ENDIT = long( [-1, -1, 45, -1, -1] )
    ; the uncertainties are floating-point numbers
    AUXFMT = long(67108864)
    ; the quantities are measured uncertainties
    AUXTYPE = long(262144)
    ; the units are in degrees
    UNITS = long(1745879298)   
    ; there are no supplemental values
    NUMSUP = long(0)

    write,log_file_unit, RECTYPE, RECSORT, NUMREF, NUMAPP $
    , START, ENDIT, AUXFMT, AUXTYPE, UNITS, NUMSUP $
    , reserved, reserved

    ; set up the indices in the AUXRANGE record
    RECTYPE = long(81)
    ; first of two record groups
    RECSORT = long(0)
    ; the uncertainties refer to longitude (the first index
    ; in the Level 1 dimensions) and latitude (the second
    ; index in the Level 1 dimensions)
    REFLEV = long( [1, 1] )
    REFNDEX = long( [0, 1] )
    ; the uncertainties vary over longitude (the first index
    ; in the Level 1 dimensions)
    APPLEV = long(1)
    APPNDEX = long(0)

    write,log_file_unit, RECTYPE, RECSORT, REFLEV, REFNDEX $
    , APPLEV, APPNDEX, reserved, reserved

    ; set up the auxiliary information in the AUXVAL record
    RECTYPE = long(82)
    ; first of two record groups
    RECSORT = long(0)
    AVALS = U1

    write,log_file_unit, RECTYPE, RECSORT, AVALS

    ; set up the relevant elements for the second AUXSPEC
    ; record: longitude and latitude uncertainties in the 
    ; northern hemisphere
    RECTYPE = long(80)
    ; second of two record groups
    RECSORT = long(10)
    ; there are two dimensions with uncertainties
    NUMREF = long(2)
    ; the uncertainties vary with longitude and latitude,
    ; therefore, AUXVAL.AVALS has two dimensions
    NUMAPP = long(2)
    ; this covers the entire northern hemisphere
    START = long( [0, 0, 46, 0, 0] )        
    ENDIT = long( [-1, -1, -1, -1, -1] )
    ; the uncertainties are floating-point numbers
    AUXFMT = long(67108864)
    ; the quantities are measured uncertainties
    AUXTYPE = long(262144)
    ; the units are in degrees
    UNITS = long(1745879298)
    ; there are no supplemental values
    NUMSUP = long(0)

    write,log_file_unit, RECTYPE, RECSORT, NUMREF, NUMAPP $
    , START, ENDIT, AUXFMT, AUXTYPE, UNITS, NUMSUP $
    , reserved, reserved

    ; set up the indices in the AUXRANGE record
    RECTYPE = long(81)
    ; second of two record groups
    RECSORT = long(10)
    ; the uncertainties refer to longitude (the first index
    ; in the Level 1 dimensions) and latitude (the second
    ; index in the Level 1 dimensions)
    REFLEV = long(1, 1)
    REFNDEX = long(0, 1)
    ; the uncertainties vary over latitude (the second index
    ; in the Level 1 dimensions) and longitude (the first
    ; index in the Level 1 dimensions)
    APPLEV = long( [1, 1] )
    APPNDEX = long( [1, 0] )

    write,log_file_unit, RECTYPE, RECSORT, REFLEV, REFNDEX $
    , APPLEV, APPNDEX, reserved, reserved

    ; set up the auxiliary information in the AUXVAL record
    RECTYPE = long(82)
    ; second of two record groups
    RECSORT = long(10)
    AVALS = U2

    write,log_file_unit, RECTYPE, RECSORT, AVALS

next up previous contents
Next: Pros and Cons Up: Auxiliary Information Previous: Example 3. Referring to   Contents
Eric Nash 2003-09-25