2.3.1.1. The Salome-table format
This is the main format used throughout the history of the Uranie-platform. The different header information are set thanks to keywords. A header line begins with the character ‘#’ followed by a keyword characterising the type of information and by the ‘:’ character. Then, the information are separated by the ‘|’ character. The list of keywords is:
Keywords |
Description |
|---|---|
NAME |
The name of the database |
TITLE |
The title of the database |
DATE |
The date of saving (only towards writing or export) |
COLUMN_NAMES |
The names of attributes |
COLUMN_TYPES |
The natures of attributes |
COLUMN_TITLES |
The titles of attributes |
COLUMN_UNITS |
The units of attributes |
An example is the file "geyser.dat" in the data directory of installation of Uranie
( $URANIESYS/share/uranie/macros/geyser.dat)
> more $URANIESYS/share/uranie/macros/geyser.dat
#NAME: geyser
#TITLE: geyser data
#COLUMN_NAMES: x1| x2
#COLUMN_TITLES: x_{1}| "#delta P_{#sigma}"
#COLUMN_UNITS: Sec^{-1}| bar
3.600 79.000
1.800 54.000
3.333 74.000
2.283 62.000
4.533 85.000
2.883 55.000
4.700 88.000
3.600 85.000
1.950 51.000
4.350 85.000
1.833 54.000
3.917 84.000
4.200 78.000
1.750 47.000
4.700 83.000
2.167 52.000
...
Uranie accepts several forms of file endings: it is possible the file ends with a white line or with a line with empty spaces, but also to end just after the last data.
Uranie does not accept data with “holes” (empty lines) like as follows in this modified version
of the "geyser.dat" file:
#NAME: geyser
#TITLE: geyser data
#COLUMN_NAMES: x1| x2
#COLUMN_TITLES: x_{1}| "#delta P_{#sigma}"
#COLUMN_UNITS: Sec^{-1}| bar
3.600 79.000
1.800 54.000
3.333 74.000
2.283 62.000
4.533 85.000
2.883 55.000
4.700 88.000
3.600 85.000
1.950 51.000
4.350 85.000
1.833 54.000
3.917 84.000
4.200 78.000
1.750 47.000
4.700 83.000
2.167 52.000
...
In this case, Uranie considers that data processing ends with the white line located in the middle of the data lines. This would be equivalent to use the following data:
#NAME: geyser
#TITLE: geyser data
#COLUMN_NAMES: x1| x2
#COLUMN_TITLES: x_{1}| "#delta P_{#sigma}"
#COLUMN_UNITS: Sec^{-1}| bar
3.600 79.000
1.800 54.000
3.333 74.000
2.283 62.000
4.533 85.000
Tip
Only the line associated to the keyword COLUMN_NAMES is mandatory except if COLUMN_TITLES is
specified. Moreover, the keyword itself is also optional; the next line is correct # x1| x2 to
specify both variables of the geyser data.
Warning
An empty line MUST be kept between the header and data matrix.
Particular case of strings and vector
The following example shows how to precise the content of vectors and strings if such information have
to be read. In this case, the field #COLUMN_TYPES: is mandatory and the way it works is equivalent
to the column name one (the delimiter is the “|” sign) but it needs only one letter to define the type.
Apart from that, the string can be written as it comes as long as it does not contains blanks (!!),
while the vectors values are dump with the same format as the double-precision one, using a comma as
separator. The following file is a correct input file for a TDataServer
#COLUMN_NAMES: day|place|hour|guest_list|food
#COLUMN_TYPES: D|S|D|V|S
5 restaurant 4 2,3,4,5 chocolate
21 home 3 6,1,8,4,3 almond
The example shown above is working properly as there is no problematic behaviour in the data. Handling
strings and vectors can however be tricky as they respectively can be an empty string and an empty
vector. This would result in a missing number of field in a specific line which will make the
fileDataRead crashed. To avoid this, all the files used in the Launcher and Relauncher (and the
Salome-table discussed here as well) contains properties specific to both vectors and strings:
String properties: a character can be specified as begin and end for dumping and reading purpose. The ones chosen by default for the Salome-table format shown here being the double-quote sign “.
Vector properties: a character can be specified as begin, end and delimiter for dumping and reading purpose. The ones chosen by default for the Salome-table format shown here being respectively [, ] and the commas.
This results in the fact, that the following file gives the exact same dataserver as the one shown
previously. It is actually the style chosen when calling the exportData method of a TDataServer to allow
the user to handle empty strings and vectors if wanted.
#COLUMN_NAMES: day|place|hour|guest_list|food
#COLUMN_TYPES: D|S|D|V|S
5 "restaurant" 4 [2,3,4,5] "chocolate"
21 "home" 3 [6,1,8,4,3] "almond"