THE TABLE DEFINITION BLOCK

A VIDF Table Block consists of 15 fields of information which describe the table contents, it dependencies, and how it couples with the UDF data. A table definition can define either look up tables or tables of polynomial expansions both of which can be made to operate on specific UDF measurements. The successive application of different table definitions to either UDF data values or to the result of a previous table applications is the method by which raw UDF data is converted to physical units.

NUMBER OF TABLE SCALE VALUES

An scalar field, this field provides the number of elements in the table value scale field including 0. When non-zero the value can be both positive and negative with the sign indicating how the table scaling values are to be applied when converting the table values to scaled quantities.

A positive scale field value indicates that there is a one to one correspondence between the number of defined scale values and the number of entries in the table value field. Under this definition the value given for this field must be identical to the value given for number of table values field. Each value in the table value field then has a individual scaling definition.

If the value of this field is 0 then there no scaling values present in the table definition block and all values in the table values field are assumed to be scaled as entered. This condition is customarily met when the table values consist of ASCII data.

A negative scale field value indicates that there is one scale value defined per defined UDF sensor or status byte if the table is defined to be a function of status data or not. (See table input.) All table values associated with a given sensor or status byte are scaled using the same scaling value. When a negative field value is used the absolute value must equal the value found in the number of status bytes field depending on if the table is a associated with sensor or status data respectively.

The field begins with the line format id l followed by an integer specifying the number table scale entries. An optional comment field may follow.

Sample NUMBER OF SCALING VALUES field:
l  -6                                             /* Num Scaling Values  */

NUMBER OF TABLE VALUES

A scalar field giving the total number of entries in the table value field.

The field begins with the line format id l followed by an integer specifying the number of table values. An optional comment field may follow.

Sample NUMBER OF TABLE VALUES field:
l  256                                            /* Num Table Values    */

TABLE TYPE

A scalar field indicating the type of table being defined. There are six recognized table types which are defined below.

Table Type 0
The table value field contains unscaled 4 byte integers. This is the standard and most common type of table definition from which both look up tables and/or polynomial expansions can be defined.
Table Type 1
The table value field contains ASCII strings delimited by double quotes. The character strings cannot exceed 20 characters in length. They can only be used to form look up table entries. In the binary version of the VIDF file these quantities are stored as 21 byte strings with the last byte being a NULL (string terminator). Type 1 tables must be the last defined tables in a set of table definition blocks. These tables are often used in conjunction with status bytes to provide a textual dexcription of the byte value.
Table Type 2
Identical in definition to table type 0 with the exception that there is one look up table or set of polynomial coefficients stored for each element in an array or matrix sensor. This field informs the UDF kernel that multiple look up tables or sets of polynomial coefficients must be retrieved from this table prior to application. A table type of 2 is used when individual array elements in a UDF data definition require unique expansions or corrections.
Table Type 3
Identical in definition to table type 0 with the exception that the values in table value field are time dependent sets of polynomial expansions. A time based polynomial is defined as a normal polynomial but with 5 elements of time information preceding the coefficients. These establish a time base. In order these are: the base year, the base day, the base millisecond, the base nanosecond and unit time base indicator. The unit time base indicator determines the time units into which the base time is converted prior to use. Possible base unit indicator values with their resolutions are shown in the table below.
TIME BASE DEFINITION RESOLUTION
0 Years milliseconds
1 Days milliseconds
2 Hours milliseconds
3 Minutes milliseconds
4 Seconds nanoseconds
5 Milliseconds nanoseconds
6 Microseconds nanoseconds
7 Nanoseconds nanoseconds
The input into the polynomial is the difference between the current UDF measurement time and the base time in the units indicated. The output can be used in any defined VIDF algorithm. When using the year time base all years are taken as 365 days in length. The computation of the time difference does, however, take into account leap years.
Table Type 4
A time based table identical in format to table type 3 but with the capability of the table type 2 added on top of that. In this implementation there is one polynomial expansion defined for each array element with the 5 element time base proceeding only the leading polynomial definition in the set.
Table Type 5
Valid only if the VIDF sensors have a matrix storage format. It is identical in definition to table type 0 with the exception that the values in table value field contain one set of look up tables or polynomial coefficients per matrix column.

The field begins with the line format id b followed by an integer specifying the table type. An optional comment field may follow.

Sample TABLE TYPE field:
b  0                                              /* Standard Table Type */

NUMBER OF COMMENT LINES

A scalar field specifying the number of lines of comments in the table comment field.

The field begins with the line format id s followed by an integer specifying the number of comment lines. An optional comment field may follow.

Sample NUMBER OF COMMENT LINES field:
s  4                                              /* Num Comments        */

COMMENTS

An array field of length Number Of Comment Lines which is a set of free-form lines of text that comprise any comments concerning the table. If the number of comment lines has been declared to be 0 then this field is undefined and is entered in the VIDF as a null line.

The table comment field begins with the array designation line: m followed by the input N 1. N is the total number of entries and set to the value of the Number Of Comment Lines field and 1 indicates that each element in the array will occupy its own line. Each of the following N lines begins with the line format t followed by a line of text not to exceed 79 characters. An optional comment field may be added to the end of each line.

Sample TABLE COMMENT field:
m 4  1                                                      /* Comments */
t                          TABLE 00                             /* C000 */
t                                                               /* C001 */
t This table contains a the lookup table which takes the raw    /* C002 */
t UDF sensor data to units of counts per accumulation period.   /* C003 */

TABLE INPUT

This is a scalar field which defines the data source to be used as input to the table. The input sources are given in the table below.

TABLE INPUT DEFINITIONS
VALUE DEFINITION
-N Input is the raw UDF data from Ancillary Data Set N - 1
0 Input is the raw UDF data sensor data
1 Input is processed data (current value in one of the VIDF algorithm output buffers)
2 Input is raw array index data
4 Input is raw mode index data
5 Input is processed mode index data
6 Input is raw quality data
7 Input is sensor number
8 Input is matrix column number
NOTE: All polynomial expansions and look up tables within a UDF table definition are associated only with UDF sensor or status data. When a table definition is a function of a quantity other than these, the table or polynomial expression used is the one associated with the sensor covering the data. So when processing array index data, for example, the portion of the table definition used will be that associated with the sensor which the array index belongs. When the input is ancillary data, the polynomial or look up table applied is that associated with the sensor used to read the data. (See both convert_to_units and read_drec.)

The field begins with the line format id b followed by an integer specifying the table input. An optional comment field may follow.

Sample TABLE INPUT field:
b  0                                                     /* Raw Sensor   */

TABLE EXPANSION

A scalar field whose interpretation depends both on the setting of the table input source and the table format field associated with the various sensors. Because of the latter it can have different interpretations for different sensors. When the table expansion field is set to 0 then all actions involving the table expansion field are ignored under all circumstances. When the value is non-zero then one of the following two cases is followed.

Case 0: Raw Input Data:
With raw input data the table expansion field must be set to either a value of 0 or 1. A value of 0 turns off all actions associated with this flag. The actions which occur with a an expansion field setting of 1 depends on a particular sensor's table format setting. When this is 0 (table values form a look up table) then no action occurs. When greater than 0 (table values form a set of polynomial coefficients) then the polynomial coefficients are used to build a corresponding look up table which can be used to convert the raw data. The look up table is built at the first access of the polynomial coefficients and is used in their place in all future operations involving this sensor. The look up table is created to a size of 2BitLength where BitLength is the bit length of the raw input data as obtained the appropriate VIDF field.

The creation of a lookup table from a polynomial is a hold over from the days when computer speed was a general concern, which it rarely is today. The expansion of a set of polynomial coefficients into a lookup table was done under the assumption that it was much quicker to use a pre-calculated value in an expression then to have to calculate the value each time it is used. With present computer speeds this is rarly the case and in most cases now the expand flag should be left at 0.
Case 1: Processed Input Data
With processed input data the table expansion field can have any value greater than or equal to 0. A value of 0 turns off all actions associated with this flag. A non-zero value coupled with a non-zero sensor table format value also deactivates all actions associated with the expansion flag. When the sensor table format value is 0 (table values form a look up table) then the expand flag is used to compute the size of the table llok up table to be read in.

When a look up table has raw data as its input, the table size is computed as from the sensor bit length as 2BitLength or directly from the status byte range field if the input is status data. When the input data is processed data there is no corresponding way of obtaining the size of the look up table. In this case the UDF kernel then builds the look up table using 2Table Expand Value as a table size. When indexing into a look up table with processed data, the data is converted to integer first.

This construct is mainly used when working with packed data. The process of unpacking the data makes it, by definition, processed data. If there is a need then to make modifications on the data using a look up table, then the above method is utilized.

The expand flag field begins with the line format id b followed by an integer specifying the table expand value. An optional comment field may follow.

Sample EXPAND FLAG field:
b   0                                                   /* No Expand    */

>NUMBER OF CRITICAL ACTION VALUES

This is a scalar field containing the number of values in the Table Critical Offset field. If there is no critical value information in this table then the number of critial action values is set to 0 and the following three fields will be set to a null VIDF line.

The critical action fields in a table allow a VIDF algorithm to switch between defined look up tables or polynomial coefficients in real-time based on the current value of a selected UDF status byte.

The critical action feature is not available for tables which have table input values greater than 3. Tables with these input definitions always have 0 number of critical action values.

The field begins with the line format id s followed by an integer specifying the number of critcal actoin values. An optional comment field may follow.

Sample NUMBER OF CRITICAL ACTION VALUES field:
s  12                                           /* Critical Action Size */

CRITICAL STATUS BYTES

An array field of length Number Of Sensors which is only defined if the Number of Critical Action Values field is non-zero and otherwise entered in the VIDF as a null line. The field contains the number of the UDF status byte whose value is to be used when switching between different lookup tables or different sets of polynomial coefficients. There is one value per UDF sensor. If a UDF sensor does not require the use of a critical status byte then the value of its critical status byte entry is set to -1.

The critical status byte field begins with the array designation line: m followed by the input N M. N is the total number of entries and is to the value of the Number Of Sensors field and M is the number of entries given on each line. Each of the following N lines begins with the line format b followed by M entries (except the last line which may have less). An optional comment field may be added to the end of each line.

Sample CRITICAL STATUS BYTE field:
m 5  5                                          /* Critical Byte Status */
b    0   0   -1   1   -1                        /* 00-04                */

SENSOR CRITICAL OFFSETS

An array field of length Number Of Sensors which is only defined if the Number of Critical Action Values field is non-zero and otherwise entered in the VIDF as a null line. The field contains the pointers into the Table Critical Offsets field, one one pointer per defined UDF sensor. If a sensor has a -1 for its critical status byte meaning that it does not make use of the criticlal action table feature, then it should also have a -1 for its sensor critical offset value.

A sensor critical offset value is a pointer into the Table Critical Offsets field to the beginning of the array of offsets into the Table Value Field. There will be one defined offset in this array for every possible state in the critical status byte used by the sensor. Duplicate sensor critical offset values are allowed.

The sensor critical offset field begins with the array designation line: m followed by the input N M. N is the total number of entries and is set to the value of the Number Of Sensors field and M is the number of entries given on each line. Each of the following N lines begins with the line format s followed by M entries (except the last line which may have less). An optional comment field may be added to the end of each line.

Sample SENSOR CRITICAL OFFSET field:
m 5  5                                          /* Sen Critical Offset  */
s    0   0   -1   6   -1                        /* 00-04                */

TABLE CRITICAL OFFSETS

An array field of length Number Of Critical Action Values which contains a set of offsets into the Table Values field. If the Number of Critical Action Values field is 0 then this field is undefined and is entered in the VIDF as a null line.

The values in the TABLE CRITICAL OFFSETS field actually comprise a set of arrays of offsets, each array belonging to one of the UDF sensors with the array length being equal to the number of values which the critical action byte for that sensor can achieve. The latter are obtained from the range VIDF field for the status byte used to control the switching in the table. Each individual offset in an array is a pointer into the TABLE VALUE field to the beginning of the look-up table of set of polynomials to be used in the conversion algorithms for the value of the status byte it represents. Duplicate offset values are allowable.

The table critical offset field begins with the array designation line: m followed by the input N M. N is the total number of entries and is set to the value of the Number Of Critical Action Values field and M is the number of entries given on each line. Each of the following N lines begins with the line format l followed by M entries (except the last line which may have less). An optional comment field may be added to the end of each line.

m 12  6                                      /* Sensor Critical Offsets */
l  0     0   256   256   512   512                             /* 00-05 */
l  0   256   512   768   768     0                             /* 60-11 */

Critical Action Usage Example

The following is an illustration of both when and how the critical action fields should be used within a VIDF table. To being with, the pertinent VIDF fields are shown. This includes the Status byte fields and part of the table fields.

s 5                                      /* Number of Sensors in UDF    */
b 3                                      /* Number of Status Bytes      */
m 3  1                                   /* Status Byte Names           */
t Stepping Method                        /* Status Byte 0 Description   */
t Instrument Gain                        /* Status Byte 1 Description   */
t Program Version Number                 /* Status Byte 2 Description   */
m 3  3                                   /* States per Status Byte      */
s  8   4   256                           /* Valid status ranges         */

l  4                                     /* Critical action values      */
m  4  4                                  /* Critical Status Bytes       */
b  -1   -1   1  -1                       /* Critical status byte ids    */
m  2   2                                 /* Critical Offset/Sensor      */
s  -1   -1   0  -1                       /* Sensor critical offsets     */
m  4  4                                  /* Critical Offsets            */
l  4    7   10    13                     /* Offsets into Table field    */

The algorithm for conversion of UDF sensor 2 from raw data to physical units is done through a set of polynomial expansions and the correct expansion to use in the conversion depends on the instrument gain. The instrument gain has been saved in UDF status byte 1 (as indicated in the Statys Byte Names field above) which has four states (as indicated in the second entry in the Valid status ragnes field.) Each polynomial has three coefficients which could be found from the TABLE FORMAT entry for the sensor.

To set this up in the table which provides the polynomial coefficients for the conversion requires that the appropriate critical action fields be set. For this example we will assume that only UDF sensor 2 has a critical action dependence. The first field, the number of critical action values, is set to 4 which will be the number of values in the Critial Offsets field. There is one critical offset for each of the four values which can be returned in the Instrument Gain Status Byte. In the critical status byte field the critical status byte for sensor 2 has been set to 1 and in the sensor critical offset field the offset into the critical offset field has been set to 0. The latter is the start of the 4 offsets for the status byte into the Table Values field.

Each critical offset is a pointer into the Table Values field to the start of the three polynomial coefficients which are to be used for that particular Instrument Gain. In this case the coefficients begin at the fifth entry (entries begin at 0) in the Table Values field and are laid down sequentially. The Instrument Gain associated with value 0 then uses the three coefficents beginning with the fifth value while the three coefficients associated with Instrument Gains 1, 2 and 3 begin being at offsets 7, 10, and 13 respectively.

TABLE FORMAT

This is an array field whose length depends on the table input field setting. If the table input field is set to either 4 or 5 (indicating a status byte input) then the table format field has a length of Number of Status Bytes, otherwise it is has a length of Number Of Sensors.

Entries in the Table Format field define the type of expansion which is to be invoked for a measurement. Any combination of expansion formats can be combined in a single table although any given measurement can only access one expansion type. If a measurement does not use this table, then its format is set to -1. The UDF kernel software uses this field to determine the number of data values to retrieve from the Table Value field. The different table format field definitions are given in the following table.

TABLE FORMAT DEFINITIONS
VALUE DEFINITION
-1 Measurement has no table variables defined
0 Measurement uses a Look Up Table
N Measurement uses a set of N polynomial coefficients

When retrieving a look up table, the number of elements read is 2(raw bit length) if the input to the rable is raw data or 2(table expand) if the input to the table is processed data.

Polynomial coefficients in the table values are laid down from the lowest exponenti to highest order. The expansion of a variable X is defined by:

V = a0 + a1X + a2X2 + ... + a(N-1)X(N-1)
where a0 is the first polynomial coefficient listed in the series in the table values field.

The table format field begins with the array designation line: m followed by the input N M. N is the total number of entries and depending on the table input is set either to the value of the Number Of Sensors field or to the value of the Number Of Status Byte field. M is the number of entries given on each line. Each of the following N lines begins with the line format b followed by M entries (except the last line which may have less). An optional comment field may be added to the end of each line.

Sample TABLE FORMAT field:
m  5  5                                          /* Table Formats       */
b  0   -1    5    3    0                                       /* 00-04 */

TABLE OFFSET

This is an array field whose length depends on the table input field setting. If the table input field is set to either 4 or 5 (indicating a status byte input) then the table format field has a length of Number of Status Bytes, otherwise it is has a length of Number Of Sensors.

Each entry in the Table Offset field is an offset into the Table Values field to the start of either a look up table or to a set of polynomial coefficients for a particular measurement. If there are no table values defined for a measurement then its table offset is set to -1. Duplicate offsets are allowed.

If a measurement has a defined Critical Status Byte then the table offset given here is superseded by the table offset value given in the Table Critical Offset field. The table offset given for the measurement must still be a valid table offset value and can point to any of the valid tables defined for it.

The table offset field begins with the array designation line: m followed by the input N M. N is the total number of entries and depending on the table input is set either to the value of the Number Of Sensors field or to the value of the Number Of Status Byte field. M is the number of entries given on each line. Each of the following N lines begins with the line format b followed by M entries (except the last line which may have less). An optional comment field may be added to the end of each line.

Sample TABLE OFFSET field:
m  5  5                                          /* Table Offsets       */
l  0    0  256  512    0                                       /* 00-04 */

TABLE VALUE SCALES

An array field with a length equal to the absolute value of Number of Table Scale Values field. This field holds the scaling factors applied to the entries in the Table Values field. If the number of table scale values has been declared to be 0 then the field is undefined and is entered in the VIDF as a null line.

When the Number of Table Scale Values is positive there is a one to one correspondence between the table value scales and the table values. The scaling field length is identical to the table value field length. The scaling values provide the power of 10 scaling needed to convert the integer table values to floating point values. They are applied as:

VALUE[i] = TABLE VALUE[i] * 10SCALE VALUE[i]

When the Number of Table Scale Values entry value is negative there is a single table value scale per sensor. The scaling field length is identical to the number of defined sensors in the VIDF. The scaling value associated with a given sensor is applied to all the table values associated with that sensor. The application is as shown above but without the one to one correspondence indicated in the indices.

The table value scale field begins with the array designation line: m followed by the input N M. N is the total number of entries and is set to the abolute value of the Number Of Scaling Values field. M is the the value of the number of entries given on each line. Each of the following N lines begins with the line format b followed by M entries (except the last line which may have less). An optional comment field may be added to the end of each line.

Sample TABLE VALUE SCALE field:
m  5  5                                          /* Table Scale Factors */
b  -1    0   -4   -2   -1                                      /* 00-04 */

TABLE VALUE

This is an array field with a length equal to the value given in the Number of Table Values entry. The field contains the unscaled integer table definition values.

The table value field can contain either integer or ASCII entries as determined by Table Type. A table value field which contains integer values may hold a combination of look up tables and polynomial coefficients.

The table value field begins with the array designation line: m followed by the input N M. N is the total number of entries and equals the Number Of Table Values value. M is the number of entries given on each line. Each of the following N lines begins with the line format l followed by M entries (except the last line which may have less). An optional comment field may be added to the end of each line.

Sample INGEGER TABLE VALUE field:
m 256 5                                                /*  Table Values */
l        0         0         0        10        15     /*  00000-00004  */
l       45        50        55        60        65     /*  00010-00014  */
l       70        80        80        90        90     /*  00015-00019  */
l      100       100       110       110       120     /*  00020-00024  */
l      120       130       130       140       140     /*  00025-00029  */
l      150       150       160       170       180     /*  00030-00034  */
l      190       200       210       220       230     /*  00035-00039  */
l      240       250       260       270       280     /*  00040-00044  */
l      290       300       310       330       350     /*  00045-00049  */
l      370       390       410       430       450     /*  00050-00054  */
l      470       490       510       530       550     /*  00055-00059  */
l      570       590       610       630       660     /*  00060-00064  */
l      700       740       780       820       860     /*  00065-00069  */
l      900       940       980      1020      1060     /*  00070-00074  */
l     1100      1140      1180      1220      1260     /*  00075-00079  */
l     1320      1400      1480      1560      1640     /*  00080-00084  */
l     1720      1800      1880      1960      2040     /*  00085-00089  */
l     2120      2200      2280      2360      2440     /*  00090-00094  */
l     2520      2640      2800      2960      3120     /*  00095-00099  */
l     3280      3440      3600      3760      3920     /*  00100-00104  */
l     4080      4240      4400      4560      4720     /*  00105-00109  */
l     4880      5040      5280      5600      5920     /*  00110-00114  */
l     6240      6560      6880      7200      7520     /*  00115-00119  */
l     7840      8160      8480      8800      9120     /*  00120-00124  */
l     9440      9760     10080     10560     11200     /*  00125-00129  */
l    11840     12480     13120     13760     14400     /*  00130-00134  */
l    15040     15680     16320     16960     17600     /*  00135-00139  */
l    18240     18880     19520     20160     21120     /*  00140-00144  */
l    22400     23680     24960     26240     27520     /*  00145-00149  */
l    28800     30080     31360     32640     33920     /*  00150-00154  */
l    35200     36480     37760     39040     40320     /*  00155-00159  */
l    42240     44800     47360     49920     52480     /*  00160-00164  */
l    55040     57600     60160     62720     65280     /*  00165-00169  */
l    67840     70400     72960     75520     78080     /*  00170-00174  */
l    80640     84480     89600     94720     99840     /*  00175-00179  */
l   104960    110080    115200    120320    125440     /*  00180-00184  */
l   130560    135680    140800    145920    151040     /*  00185-00189  */
l   156160    161280    168960    179200    189440     /*  00190-00194  */
l   199680    209920    220160    230400    240640     /*  00195-00199  */
l   250880    261120    271360    281600    291840     /*  00200-00204  */
l   302080    312320    322560    337920    358400     /*  00205-00209  */
l   378880    399360    419840    440320    460800     /*  00210-00214  */
l   481280    501760    522240    542720    563200     /*  00215-00219  */
l   583680    604160    624640    645120    675840     /*  00220-00224  */
l   716800    757760    798720    839680    880640     /*  00225-00229  */
l   921600    962560   1003520   1044480   1085440     /*  00230-00234  */
l  1126400   1167360   1208320   1249280   1290240     /*  00235-00239  */
l  1351680   1433600   1515520   1597440   1679360     /*  00240-00244  */
l  1761280   1843200   1925120   2007040   2088960     /*  00245-00249  */
l  2170880   2252800   2334720   2416640   2498560     /*  00250-00254  */
l  2580480                                             /*  00255        */
Sample ASCII TABLE VALUE field:
m   16  4                                              /*  Table Values */
T     "Seek Off"     "Seek On" "Tracking Off"    "Tracking On" /* 00-03 */
T    "Normal Op"     "Failure"     "Power OK" "Power Exceeded" /* 04-07 */
T "No Pwr Check" "Power Check"  "Monitors OK"  "Monitor Error" /* 08-11 */
T      "FPSV OK"    "Bad FPSV"     "BMSPI OK"      "Bad BMSPI" /* 12-15 */

&larr Previous TOC HOME Next &rarr
Ancillary Information Block Constant Definition Block