Software Docs


Browse CVS, Git, or SVN
Software Repositories
OS Security Updates
LIGO software virtual machine
VMware SL6 Install


SCCB - Software Change Control Board
Edit these pages
Mailing List


LDAS Tools
LDG Client/Server
LVAlert Administration
NDS Client

Legacy Projects



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. The metiao library can read XML files compressed with the gzip compression algorithm. Metaio is available via the lscsoft repository, from source of via LIGOtools.

The metaio package includes:

  1. A library (libmetaio) 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' ligotools package.
  2. 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
  3. The Matlab MEX-file readMeta, which reads the contents of a LIGO_LW metadata file into Matlab arrays.

Note that the LIGOtools binary packages only contain only static libraries and executables, whereas the lscsoft distribution and version built from souce contain static and shared libraries and dynamic executables.

Project Librarian

Contact the DASWG mailing list <> if you have questions about metaio.


Typing lwtscan, lwtcut, lwtprint, lwtdiff, lwtselect, or concatMeta without any arguments will print out usage information - in most cases, rather detailed.

The utility programs concatMeta and lwtselect in this package use the tclshexe program from the LIGOtools package 'tclexe', so that package must be installed and active if these utilities are used. The other utility programs are standalone C programs, so do not require any other packages to be installed.

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 -o find_coinc -lmetaio

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 metaio.c, and look at the utility programs 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").

For more documentation about the metaio package, see the LIGOTools frequently asked questions page. In particular, the questions


Current release

The current version of metaio is version 8.3.0. This is availabe via the lscsoft software repository or download here as source package.

Previous releases

Note: Previous releases of metaio prior to 7.0 are available only as LIGOtools binary and source package, and releases after 7.2 are only available as source tarballs.

Git Repository

The metaio source is located in the metaio Git repository. See the following instructions on how to get started, but note that those instructions are for a different package named lalsuite. Simply replace "lalsuite" with "metaio" in the instructions for cloning the repository and that'll get you a copy. You may also browse the metaio Git repository using the cgit web interface.

Build Instructions

Metaio from can be build from the source tar ball or from CVS. To download from CVS, check out the code from the lscsoft repository and run the script 00boot to build the configure program:

cvs -d co metaio
cd metaio

To build from the source tarball, download the current source code and uncompress the tar file:

tar -zxvf metaio-8.2.tar.gz
cd metaio-8.2
The configure program is contained in the source tarball, so there is no need to run the 00boot program.

The instructions for both CVS and source tarball are identical, once the configure program is built. The configure script automatically checks for a working version of Matlab and the Matlab mex compiler. If these are installed and functional, then the Matlab readMeta program is compiled. If not, only the library and the utility programs are built.

To build metaio, run the configure script. The default install location is /usr/local. To install in another location, specify --prefix when running configure. The example below assumes that you want to install metaio in your home directory, given by the environment variable ${HOME}. To build metaio run the commands:

CPPFLAGS=-std=gnu99 ./configure --prefix=${HOME}
Setting the environment variable CPPFLAGS=-std=gnu99 has no effect on the Mac OS X build, but is required to build a version of metaio that supports gzip compression on Linux.

To install metaio in the location specified by --prefix type

make install

To build a LIGOtools binary packge, type

make ligotools
which will build a LIGOtools binary package in the ligotools subdirectory. This binary package can be installed with the ligotools_install program.

Mailing Lists

Discussion of metaio should be directed to the DASWG mailing list.