LIGOtools Package: metaio
This package contains a library for parsing LIGO_LW Table files, plus
several C programs based on the library, plus a few Tcl scripts which
do related things.
It includes:
- A library (libmetaio.a)
which allows a C program to parse a file containing a metadata table
in LIGO_LW XML format. Note that, prior to version 6.0, these
functions were contained in the library libdataflow.a in the
'dataflow' package.
- Utilities to manipulate metadata tables in LIGO_LW files:
- lwtscan to print the
table's columns and the number of rows
- lwtcut to select certain
rows from a table based on a numeric comparison and/or row number,
report the number of matching rows, and optionally write the matching
rows to a new LIGO_LW file
- lwtprint to print
selected columns/rows as plain text
- lwtdiff to compare the
data in two files (allowing for formatting variations which do not
affect the content)
- lwtselect to extract a
single Table object from a LIGO_LW file containing multiple
Table objects
- concatMeta to
concatenate LIGO_LW files containing database table data
- The Matlab MEX-file readMeta, which reads the contents of a
LIGO_LW metadata file into Matlab arrays.
Authors:
Version 7.2
Release date (as a LIGOtools package): January 3, 2008
History of changes
Notes
- This package is distributed via 'ligotools_update' as
a SOURCE distribution and also in a version precompiled for Solaris.
The C code components are compiled with
gcc and made into a library automatically when the package is
installed. If for some reason you aren't able to compile them, you
can get the precompiled binary distribution files below.
- A few utilities in this package use the tclshexe
program from the LIGOtools package
'tclexe', so that package must be installed and active.
- The master copy of the metaio library code and utilities is
the lscsoft CVS repository. This LIGOtools package is derived directly from
the code that is in the CVS repository, here.
Documentation
- Typing
lwtscan,
lwtcut,
lwtprint,
lwtdiff,
lwtselect, or
concatMeta
without any arguments
will print out usage information - in most cases, rather detailed.
- By default, lwtprint
uses a comma to separate the values it prints out. To use a space as
a separator, use the -d option,
e.g.:
lwtprint myfile.xml -d " "
- Example C program to perform a simple coincidence test on two
input LIGO_LW files with events, e.g. from the gds_trigger table: find_coinc.c.
To compile this, do:
gcc find_coinc.c
$LIGOTOOLS/lib/libmetaio.a -I$LIGOTOOLS/include -o find_coinc
- There is no formal documentation about how to use the "Metaio" C
library. However, you can see the comments in the source code for the
library in $LIGOTOOLS/packages/metaio/7.2/src/metaio.c, and look at
the utility programs $LIGOTOOLS/packages/metaio/7.2/src/lwt*.c as
examples. Also see this code for an example of how to write out
selected rows of an input LIGO_LW file: ivana_16jul02.c (search for
"outEnv").
Distribution files
Normally, you should use the ligotools_update utility to
download and install new packages or new versions of existing
packages, since it automatically figures out what packages need to be
updated. However, if you wish to do so manually, then click on the
name of the appropriate distribution file (below) with the
right mouse button and choose "Save Link As..." from
the popup menu. Note that you must save it on your disk with exactly
the same name as it has on this web site. After the file has been
downloaded, do:
ligotools_install <file>
where <file> is the file which was downloaded. This
procedure will be quicker if the environment variable
LIGOTOOLS is set to the main LIGOtools directory.
- Source distribution:
metaio_7.2_SOURCE.tar.gz (684 kb)
This is known to build properly on Solaris and Linux using
gcc; other operating systems or compilers may require
some modifications. If you figure out how to do this, please
let me know.
- Generic Solaris distribution (built on canopus.ligo.caltech.edu):
metaio_7.2_SunOS.tar.gz (97 kb)
- Precompiled binary versions for various platforms and
versions of Matlab can be downloaded
from the
DASWG metaio project page and installed using ligotools_install.