This package is mostly compatible with the /rdb system described in the book Unix Relational Database Management by Manis, Schaffer and Jorgensen. In addition major extensions are included to support scientific and astronomical datasets.
This document gives a quick overview of the features that are extensions of those provided by the comercial /rdb package. These features were implimented at the Smithsonian Astrophysical Observatory in original source or by modifying sources available under the terms of the GNU software license agreement (Copyleft). This package also includes sources from the Star Link Project .
Header values are header lines containing a keyword followed by a series of tab separated values. Header values are accessed by name in user expressions and statments (row/select/compute/validate/table). The first index of a header value array is 1 and the number of values in the header value is accessed as N_value.
------------------------cut here---------------------------------------- Table1 This table is named Table1 This is a text comment in the header of a table. This portion may ramble on and on but should not contain any line with ONLY dash (-) and tab characters. The dash line is the indication that the data table is about to begin. Key 1 Keys 1 2 3 There are two header values above. Key is a scalar value, Keys is an array. RA Dec -- --- 0:0:0 0:0:0 ^L Table2 This is another table it is in the same file as Table1 and is delimited from the first by a ^L (form feed) character. A tables name is given by the first line in the table. This table is named Table2. RA Dec Comment -- --- ------- 1:0:0 2:0:0 This as an RA DEC pair in sexadecimal format. ------------------------cut here----------------------------------------The header values Key and Keys may be used in a row expression.
row 'RA < 1 + Key'
row 'RA < 1 + Keys[1] + Keys[2]'
Several formats are recognized and maintained.
ddd:mm:ss.sss hh:mm:ss.sss DDDdMMmSS.SSS HHhMMmSS.SSS hh:mm.mmm MMmSS.SSS
The units of the value are not changed, the ascii format value is simply read in to an internal representation.
The sorting order for numeric formats (-n and -h) has been modified from the normal unix sort. When a field is empty or contains leading text that field sorts as greater than any number. Unix will usually sort blank fields as zero and text as last.
The environment variable TABLEFUNCTIONS names a path which is searched for undefined functions. If a function is mentioned in a row/select/compute/validate program but not defined, a file found in the TABLEFUNCTIONS path with the name of the undefined function will be included in the program. This feature allows a library of usefull functions to be built and accessed easily.
There is a set of functions included in the distribution in the tablefun directory.
function squares(x, y) { return [ x * x, y * y ] }
The bracket notation in the return statement allows a list of expressions to be returned from the function. When the function is called it should be called from an assignment list statment.
[ xsq, ysq ] = squares(x, y)
Here the bracket notation to the left of an assignment allows the multiple values returning from the function to be assigned to variables.
Several example programs have been written using the sla library and show multiple values being returned (fk45, fk54, preces, radecbox , radeccirc).
Several programs have been written using the search program, the best example of which is radecbox.
Tblx is the "table exchanger" program it can extract, insert and process tables in multi-table files.