Things you can do with a file containing database entries
Peter Shawhan
Revised February 11, 2003
The standard file format for data retrieved from the LDAS database is
LIGO_LW format. Although LIGO_LW format
can be used to represent several kinds of data, this article will only
consider its use to store a table of entries from the LDAS database.
Other FAQ articles describe how to query the database and get the results into
a LIGO_LW file, read a LIGO_LW file into
Matlab or into a C program, select certain entries from a table,
etc. Here are a few other things you can do with a LIGO_LW file.
Display it in guild
In the main guild window, go to the File menu and select
"Open File". (Or if someone has put a LIGO_LW file on a web server,
you can use "Open URL".) Note, however, that it is impractical to
use guild to display a file larger than a megabyte or so,
since rendering the table in a window takes a lot of CPU and memory.
Scan it
The lwtscan command-line utility quickly scans a LIGO_LW
file, printing out the list of columns and the total number of rows in
the table.
Dump it as ASCII
The lwtprint command-line utility reads a LIGO_LW file and
displays the contents as ASCII, normally as comma-separated list for
each row (though you can specify a different delimiter). You also can
restrict the output to selected columns and/or rows. Type
lwtprint without any arguments for usage details.
Compare two LIGO_LW files
The lwtdiff utility compares the contents of two LIGO_LW
files. This is more sophisticated than an ordinary diff
because it ignores formatting differences that do not affect the data
content, e.g. for a floating-point column the values "2.0" and "2.000"
will be considered to be the same. Also, you can restrict the
comparison to selected columns, ignoring any differences in other
columns. Type lwtdiff without any arguments for usage
details.
Select a single table out of a LIGO_LW file containing multiple
tables
A LIGO_LW file is permitted to contain any number of Table objects, as
well as various other kinds of objects. The "metaio" parsing library
would choke on a file containing non-Table objects, since it is not a
general-purpose XML parser. Originally, it would also choke on any
file containing more than one Table object, but beginning with version
4.10 of the dataflow package, you can specify a particular
Table (by name) to read from a multi-Table file. If for some reason
you need to physically extract a single Table from a LIGO_LW file, the
lwtselect utility will do that for you. Note that
lwtselect writes the resulting LIGO_LW document to standard
output, so you generally will want to redirect it to a file.
Concatenate the tables in two or more LIGO_LW files
The concatMeta utility takes two or more input LIGO_LW files,
each containing a single Table object with the same column
definitions, and concatenates them into a single output LIGO_LW file
with a single Table object. Type concatMeta without any
arguments for usage details.