next up previous contents
Next: Example 4. Referring to Up: Auxiliary Information Previous: Example 2. Referring to   Contents


Example 3. Referring to a Single Dimension, Applied to Multiple Dimensions and Subsections of the Data

Reconsider the previous examples, where now there are different measured uncertainties in the pressure at each pressure level. The uncertainties are different for each day in the first 20 days and then are the same each day for the last 11 days. There are also measured uncertainties in the vertical component of the wind vector that vary over latitude, longitudes, and pressure levels, but are the same for each day.

The uncertainties in the pressures for the first 20 days are specified in an array, U1, with the dimensions of $6 \times 20$ (i.e., pressure, day of month). The uncertainties in the pressures for the last 11 days are specified in an array, U2, containing 6 values (uncertainties over pressure). The uncertainties in the vertical wind field are specified in an array, U3, with the dimensions of $6 \times 91 \times 72$ (i.e., pressure, latitude, longitude). If the indices start numbering from 0, then we have the following auxiliary record fields:

OBJDESC.
NAUX = 3
AUXSPEC.
RECSORT = 0
NUMREF = 1
NUMAPP = 2
START = (0, 0, 0, 0, 0)
END = (-1, -1, -1, -1, 19)
AUXFMT = single precision floating-point
AUXTYPE = measured uncertainty
UNITS = mb
NUMSUP = 0
AUXRANGE.
RECSORT = 0
REFLEV = 1
REFNDEX = 2
APPLEV = (1, 2)
APPNDEX = (2, 0)
AUXVAL.
RECSORT = 0
AVALS = U1(6, 20)
AUXSPEC.
RECSORT = 10
NUMREF = 1
NUMAPP = 1
START = (0, 0, 0, 0, 20)
END = (-1, -1, -1, -1, -1)
AUXFMT = single precision floating-point
AUXTYPE = measured uncertainty
UNITS = mb
NUMSUP = 0
AUXRANGE.
RECSORT = 10
REFLEV = 1
REFNDEX = 2
APPLEV = 1
APPNDEX = 2
AUXVAL.
RECSORT = 10
AVALS = U2(6)
AUXSPEC.
RECSORT = 20
NUMREF = 1
NUMAPP = 3
START = (2, 0, 0, 0, 0)
END = (2, -1, -1, -1, -1)
AUXFMT = single precision floating-point
AUXTYPE = measured uncertainty
UNITS = cm/s
NUMSUP = 0
AUXRANGE.
RECSORT = 20
REFLEV = 0
REFNDEX = 2
APPLEV = (1, 1, 1)
APPNDEX = (2, 1, 0)
AUXVAL.
RECSORT = 20
AVALS = U3(6, 91, 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(3)
    .
    .
    .
    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: pressure uncertainties for the first 20 days
    RECTYPE = long(80)
    ; first of three record groups
    RECSORT = long(0)
    ; there is only one dimension with uncertainties: 
    ; pressure
    NUMREF = long(1)
    ; the uncertainties vary with pressure and time, 
    ; therefore, AUXVAL.AVALS has two dimensions
    NUMAPP = long(2)
    ; this covers the entire spatial range of the data and all
    ; of the data components for the first 20 days
    START = long( [0, 0, 0, 0, 0] )        
    ENDIT = long( [-1, -1, -1, -1, 19] )
    ; the uncertainties are floating-point numbers
    AUXFMT = long(67108864)
    ; the quantities are measured uncertainties
    AUXTYPE = long(262144)
    ; the units are in millibars
    UNITS = long(1081593921)    
    ; 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 three record groups
    RECSORT = long(0)
    ; the uncertainties refer to pressure (the third index
    ; in the Level 1 dimensions
    REFLEV = long(1)
    REFNDEX = long(2)
    ; the uncertainties vary over pressure (the third index
    ; in the Level 1 dimensions) and time (the first index
    ; in the Level 2 dimensions)
    APPLEV = long( [1, 2] )
    APPNDEX = long( [2, 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 three record groups
    RECSORT = long(0)
    AVALS = U1

    write,log_file_unit, RECTYPE, RECSORT, AVALS

    ; set up the relevant elements for the second AUXSPEC
    ; record: pressure uncertainties for the last 11 days
    RECTYPE = long(80)
    ; second of three record groups
    RECSORT = long(10)
    ; there is only one dimension with uncertainties: 
    ; pressure
    NUMREF = long(1)
    ; the uncertainties vary only with pressure, therefore, 
    ; AUXVAL.AVALS has one dimension
    NUMAPP = long(1)
    ; this covers the entire spatial range of the data and all
    ; of the data components for the last 11 days
    START = long( [0, 0, 0, 0, 20] )        
    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 millibars
    UNITS = long(1081593921)  
    ; 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 three record groups
    RECSORT = long(10)
    ; the uncertainties refer to pressure (the third
    ; the third index in the Level 1 dimensions
    REFLEV = long(1)
    REFNDEX = long(2)
    ; the uncertainties vary over pressure (the third index
    ; in the Level 1 dimensions)
    APPLEV = long(1)
    APPNDEX = long(2)

    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 three record groups
    RECSORT = long(10)
    AVALS = U2

    write,log_file_unit, RECTYPE, RECSORT, AVALS

    ; set up the relevant elements for the third AUXSPEC
    ; record: vertical wind uncertainties
    RECTYPE = long(80)
    ; third of three record groups
    RECSORT = long(20)
    ; there is only one dimension with uncertainties: 
    ; vertical wind component
    NUMREF = long(1)
    ; the uncertainties vary with pressure, latitude, and 
    ; longitude, therefore, AUXVAL.AVALS has three dimensions
    NUMAPP = long(3)
    ; this covers the entire spatial range of the data and all
    ; days for the vertical wind component
    START = long( [2, 0, 0, 0, 0] )        
    ENDIT = long( [2, -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 cm/s
    UNITS = long(1616347137)   
    ; 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)
    ; third of three record groups
    RECSORT = long(20)
    ; the uncertainties refer to vertical wind, which is
    ; the third index in the Level 0 dimensions
    REFLEV = long(0)
    REFNDEX = long(2)
    ; the uncertainties vary over pressure (the third index
    ; in the Level 1 dimensions), latitude (the second index
    ; in the Level 1 dimensions), and longitude (the first
    ; index in the Level 1 dimensions)
    APPLEV = long( [1, 1, 1] )
    APPNDEX = long( [2, 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)
    ; third of three record groups
    RECSORT = long(20)
    AVALS = U3

    write,log_file_unit, RECTYPE, RECSORT, AVALS


next up previous contents
Next: Example 4. Referring to Up: Auxiliary Information Previous: Example 2. Referring to   Contents
Eric Nash 2003-09-25