libdas2
das2 core C utilities
|
Das2 Streams are a self-describing, streamable format that allows for the transmission of large and complex data sets between different systems and programming environments. A precise description of the Das Stream specification 2.2 is found elsewhere in the Das2 Interface Reference at http://www-pw.physics.uiowa.edu/das2.
This library of C functions provides utilities for more easily producing Das2 Streams that are correctly formatted and will be compatible with future versions of the Das2 Stream specification.
A Das2 Stream is created by first opening the stream and getting a handle to it, then calling functions of this library that create and send out the various entities that live in Das2 Streams. There are functions for creating a packetDescriptor and then specifying what data will be in each packet, functions for populating the fields of the packet and sending out the packet onto the stream. Also there are functions for indicating progress and sending out messages on the stream for human consumption. The top level stream writing functions are defined in output.h.
Here is an illustration of a typical use of the library:
A Das2 Stream is consumed by defining a set of callback functions that are invoked as the stream is read. Once the functions are set, program control is handed over to the library, and the callbacks are invoked until the entire stream is read. The top level stream reading functions are defined in input.h.
Here is an illustration of a typical use of the library to read a stream:
The program:
@b das2_bin_avg.c
is a small filter for averaging Das2 Stream data into fixed size bins. Since it has to handle both input and output and does some minimal data processing, this short program provides a good example of using this library to read and write Das2 streams.
There are about a half-dozen or so library headers, but you don't need to worry about finding the right ones if you don't want to. A roll-up header is included with the library that will grab all definitions. So including the header:
in your application source files will define everything you need.
Linking is handled by command line options similar to:
The exact details depend on your C tool-chain and installation locations.