Author: Antony Searle
ILWDREAD Load an ILWD (Internal LightWeight Data) formatted XML file.
ILWDREAD(FILENAME) returns a MATLAB struct representation of the ILWD file
given by FILENAME. Each element of the ILWD is a MATLAB struct with field
"tag" storing the element type, and additional fields storing the values of
the attributes of the element. If the element is an array (such as real_8)
a field named after the element ("real_8") stores the array data in MATLAB
format. If the element is a container (such as ilwd) the member elements
are stored as fields m1, m2, ...
ILWDREAD(FILENAME, VERBOSE) turns on verbose output if VERBOSE is true
(nonzero). This consists of a formatted representation of the structure
but not the content of the ILWD (i.e. the tags and fields but not the
data).
The structure of ILWD files is often complex and this is reflected in the
complicated structs produced by ILWDREAD. The struct can be navigated by
typing the element names on the command line to see the available fields.
>>>> ilwd = ilwdread('results.ilwd')
ilwd =
tag: 'ilwd'
comment: 'ilwdread example'
name: 'ligo:ldas:file'
m1: [1x1 struct]
>>>> ilwd.m1
ans =
tag: 'int_4s'
dims: 2
name: 'one two'
int_4s: [2x1 double]
>>>> ilwd.m1.int_4s
ans =
1
2
It may be convenient to copy the data to a concisely named variable.
>>>> a = ilwd.m1.int_4s;
The member structs fields of a struct must be name-mangled (m1, m2, ...)
rather than subscripted (m(1), m(2), ...) to allow them to represent
different structures. The EVAL command can be used to simulate
subscripting, replacing "data.m(i)" with "eval(['data.m' i])".
The array fields are MATLAB vectors containing numerical data. The
values are preserved but the format is not (for example, int types are
converted to double). Complex types are also unpacked to construct
complex vectors.
ILWDREAD accepts only uncompressed ASCII ILWD files. Any non-standard
attributes should be correctly parsed to a string (but will issue a
warning). Any non-standard tags will cause an error. Bugs and comments
to Antony.Searle@anu.edu.au