FAST Spectrograph TDC home page

FAST Spectrograph
RDB Database
By John Roll

FAST Spectrum
The main data product is the Fast.db RA DEC sorted file of fast spectra header data.

To use this database you will need the program directory in your path:

	/data/mmti/bin
This directory contains SunOs 4.1.3 sparc executables.

Basic command overview:

  • To project columns out of the data table to the stdout:
    	column < Fast.db col1 col2 col2
    
  • To select rows from the table to the stdout:
    	row < Fast.db 'expression'
    
    Where the expression may contain numbers and column names combined with arithmetic and logical operators:
    	+ - * /		# arithmetic
    	< > <= >= ==	# logical comparisons
    	~ /pattern/	# string pattern match
    	! && ||		# logical expression
    
    For example to select all of Geller's observations:
    	row < Fast.db 'PI ~ /Gell/'
    
    The pattern match is fairly flexible and will match PI fields that are "M. Geller" and just "Geller".

The are currently ~3000 rows in Fast.db and it will grow. To make searching quicker the database has been sorted with RA as the primary key. This allows a special fast access program called search to extract a range of RA values much more quickly than can be selected by row.

	search 'RA > 19' 'RA < 20' Fast.db
This will select a slice of the sky in RA one hour wide. The Dec may then be selected with row. This will be much faster because the bulk of the database will be eliminated:
	search 'RA > 19' 'RA < 20' Fast.db | row 'DEC > 0 && DEC < 1'
Selects a one hour by one degree box. Care should be taken for RA searching that crosses the meridian. Two searches will have to be made.

Many times grep will also work just fine for quick looks. Grepping for a row can be faster than using row but you have less control about rows that are matched. Grep looks for matching strings is every field in a row.

A secondary key index for the PI column was created with the index command to allow fast access to PI specific observations.

	index -mi Fast.db PI
This index can be used:
	echo "Geller" | search -x -mi Fast.db PI
The database was created with the commands:
	bigscan `cat datadirs`
	sorttbl -h RA DEC < fast.db > Fast.db
New data directories can be added to Fast.db with:
	bigscan newdir
	( cat Fast.db; headoff < fast.db ) > temp.db
	sorttbl -h RA DEC < temp.db > Fast.db
Row, search, sorttbl and jointbl will accept sexadecimal format numbers in expressions and input files. This makes using astronomical data less painfull.