columncommand, I get a "No such file or directory" error.
Starbase comes with HTML documentation. A good place to start is the main
Starbase page (the starbase man page or starbase). This lists and briefly describes the
programs that make up Starbase. The extensions that have been added
at SAO are covered in the tawk extensions page.
Q.6. What is the format of a table file?
A Starbase table is a plain ASCII file with the following components:
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. RA Dec -- --- 0:0:0 0:0:0 12:00 -30.0 15 60:00:30.4If you use an editor to create a table, it's a good idea to look it over to make sure that there is only one TAB character between each column in a row. To see where the TABS are, run
cat -tv table | more, where table is the name of the file containing the table (see also Q.12).
See the format man page for more
examples of tables.
Q.7. What are the minimum commands I need to know to get started?
Refer to the starbase man page for a
short summary of all the starbase commands. For starters, though,
here's a quick explanation of the three commands you might use the
justify < in.tbl | morewhere
in.tblis the input table. Or,
justify -i in.tbl | moreTables are usually read into a starbase command either with the -i option or with the UNIX input redirection operator, <. The output is usually either redirected to a file (using >) or piped into another command like
moreor another starbase command.
in.tbl, one can extract all rows where the RA is greater or equal to 12 hours with:
row 'RA>=12' < in.tbl > out.tblOr,
row 'RA>11:59' < in.tbl | justify | moreSee Q.8 for a summary of all the operators one can use to select rows of data. Check also the file format man page to see how one can define special table variables that can be used by the row command.
in.tbl, one can extract just the RA and Dec columns with:
row 'RA>11:59' < in.tbl | column RA Dec > out.tblOr,
column RA Dec < in.tbl | row 'RA>11:59' > out.tblRefer to question Q.14 if you get an error like column: RA: No such file or directory.
For a complete list, see the starbase man
Q.8. What are operators that can be used with the
The row and compute commands makes use of the operators
supported by the UNIX awk command. Here's a list of those used for
comparing two values:
|Equal||x == 40, s == "string"|
|Greater than or equal||
|Less than|| |
|Less than or equal||
|string does not contain||
|Logical NOT|| |
||(x > 5 && x < 11) || (x == 0 && y == 1)|
Q.9. What is a regular expression? How do I use it?
A regular expression is a way of representing a pattern of characters.
Such patterns are used to search for substrings in a string of
characters or to see if a string matches a particular pattern. In
Starbase, one would use a regular expression with the row command to
search for records in which the text in a column matches a certain
pattern. For example, in
row 'type ~ /gala/' < in.tbl > out.tbl"gala" is the regular expression. This command returns all records in which the string in the "type" column contains the substring "gala". This includes galaxy, galaxies, and extragalactic.
The advantage of regular expressions is their ability to describe patterns symbolically via metacharacters. Here's some of the of the metacharacters you might use:
|.||matches any single character|
|*||matches zero or more of the previous character|
|+||matches one or more of the previous character|
|?||matches zero or one of the previous character|
|^||when at the beginning of a regular expression, matches the beginning of a value|
|$||when at the end of a regular expression, matches the end of a value|
|[...]||matches any one of the characters between the brackets|
|[^...]||matches any one character not among those between the brackets|
|\||escapes the special meaning of the next character, e.g. \. means a real period.|
| ||matches when type contains a substring beginning with "proto" and ending with "env", including "protostellar environment" and "protogalactic environment".|
| ||matches "gala" or "Gala" appearing anywhere in type|
| ||matches when title begins with the "Study"|
| ||type is restricted to being equal to either "galaxy" or "Galaxy"|
Q.10. Are there any tutorials on Starbase and databases available?
Because of Starbase's similarity to the commercial /rdb package, the
book UNIX Relational Database Management by Manis, Schaffer, and
Jorgensen (Prentice Hall, ~$70) is often recommended. Chapters 1, 2,
3, 4, and 6 will bring an astronomer new to relational databases up to
Q.11. How do I find out about reported bugs in starbase programs?
The most up-to-date list of bugs can be accessed from
http://cfa-www.harvard.edu/~john/starbase/BUGS. The Starbase
distribution also comes with a list of bugs in a file called
Q.12. How can I tell the difference between spaces and TAB
characters in my tables?
The most important thing to keep in mind when manipulating Starbase
tables is to make sure that one and only one TAB character appears
between each column. Normally, one only needs to worry about this
when editing tables by hand. It's often easy to accidently insert
spaces where a TAB should, or to insert multiple TABs where only one
should go. (The Emacs editor by default will often replace spaces
with TABs without your knowing it--see Q.13 for
Thus, if you've been editing a Starbase table by hand, you may wish to
check it over to ensure that the TABs are where they belong. To do
this you can use the UNIX
cat command by specifying the
cat -vt in.tbl | moreTAB characters in the table will appear as "^I". You might find the output a bit of a jumble. If so, you might try sending the table through the justify command first:
justify -i in.tbl | cat -vt | more
To make your Emacs compatible with Starbase, you need tell Emacs to only insert a single TAB when you hit the TAB key. This can be accomplished by placing the following into your .emacs file (normally in your home directory):
(defun my-text-mode-hook () (define-key text-mode-map "\t" 'self-insert-command)) (add-hook 'text-mode-hook 'my-text-mode-hook)
columncommand, I get a "No such file or directory" error.
column RA < in.tbl > out.tblyou get the error message column: RA: No such file or directory, you may need to adjust your command search path. Some UNIX systems come with a another command called "column" (e.g. Linux has /usr/bin/column) not related to Starbase. To make sure the Starbase version gets called, place the directory containing the Starbase commands closer to the beginning of your search path. For example, if the starbase commands are located in /usr/local/starbase/bin, you can (if you are using the C-shell) type:
set path = (/usr/local/starbase/bin $path)