Skip to main content

Crate igwn_ligolw

Crate igwn_ligolw 

Source
Expand description

Rust-native reader and writer for the LIGO_LW XML format.

LIGO_LW is the XML container used across the International Gravitational-Wave Observatory Network for tabular event data (single-detector triggers, coincidences, sky-map metadata) as well as the diagnostic-test (DTT) document family. This crate parses LIGO_LW documents into typed Rust structures, writes them back out in a round-trippable form, and transparently decompresses gzip input (and, behind feature flags, bzip2 and xz).

The parser is intentionally tolerant of the LIGO_LW format quirks observed in real files emitted by the LVK low-latency pipelines (gstlal, mbta, pycbc, spiir, aframe, cwb, mly): mixed whitespace, trailing delimiters, quoted strings with embedded commas, modern int_8s identifiers alongside legacy ilwd:char strings, and cross-table column-name prefixes.

Structs§

Array
An Array element.
CoincInspiralEvent
A single coincident inspiral event distilled from a coinc.xml document. This is the shape the alert-manager clustering layer consumes.
Column
Dim
A Dim element inside an <Array>.
Document
A parsed LIGO_LW document.
GenericElement
A generic LIGO_LW element preserved verbatim for elements the parser does not have a dedicated representation for.
LigoLwElement
A <LIGO_LW> element. The document’s root is one of these; DTT-style documents nest them.
Param
A Param element. Carries metadata about a single typed value and the raw text payload. Decode the payload by inspecting Param::ty.
SnglInspiral
A single-detector inspiral trigger.
Table
A Table element.
Time
A Time element. The value is preserved as text because the upstream type system distinguishes GPS, ISO-8601, and other formats that we leave to the caller to interpret.

Enums§

ArrayEncoding
How the <Stream> body of an <Array> was encoded on the wire.
Child
One element that can sit inside a <LIGO_LW> (or other) container.
Error
LigoType
LIGO_LW column / param data types.
Value
A typed cell value parsed from a LIGO_LW Stream row.

Functions§

parse_bytes
Parse a complete LIGO_LW document from a byte slice.
parse_path
Parse a LIGO_LW document from a filesystem path, dispatching on the file extension to a decompressor: .gz (always available), .bz2 (Cargo feature bzip2), .xz (Cargo feature xz). Plain .xml and anything else are read verbatim.
parse_reader
Parse a LIGO_LW document from any Read source. The implementation reads the input into a buffer; this is fine for the kilobyte-to-low- megabyte files the library targets.
write_to_bytes
Serialize a document to a byte buffer. The output begins with an XML 1.0 declaration and the standard LIGO_LW DOCTYPE.
write_to_path
Serialize a document to a filesystem path. The file extension controls compression: .gz writes through flate2; .bz2 is behind the bzip2 feature; .xz is behind the xz feature. Anything else is written uncompressed.
write_to_writer
Serialize a document to any Write sink.

Type Aliases§

Result