VN field file format:

Conventions:

VN regular field file format:

#VisNow regular field (This is the necessary first line)

Field description section

Data components description section

File description section

Field description section:



[field name,] dimensions d1 [d2 [d3]] [,coordinates] [,mask]

[<affine field description | extents description>]

[tiling description]


Affine section – optional, alternative to the coord item

origin x0 x1 x2 #float coordinates of the node with zero indices

v0 x0 x1 x2 #float components of the first cell vector

[v1 x0 x1 x2 #float components of the second cell vector

[v2 x0 x1 x2]] #float components of the third cell vector



Example:

#VisNow regular field

field test,dim 65 101 255, mask

orig -32 -25 -127

v0 1 0 0

v1 0 0.5 0

v2 0 0 0.5

Extents section - optional, alternative to coord and affine field description

x x_min x_max #data box x range

[y y_min y_max #data box y range

[z z_min z_max]] #data box z range

Example:

#VisNow regular field

field test,dim 65 101 255, mask

x -32 32

y -50 50

z -127 127

Tiling description - optional

tile_x from:to [from:to ...] #integers indicating tile boundaries along axes (ranges are inclusive and may overlap)

[tile_y from:to [from:to ...]]

[tile_z from:to [from:to ...]]


Example:

#VisNow regular field

field test,dim 65 101 257

tile_x 0:32 32:64

tile_y 0:50 50:100

tile_z 0:64 64:128 128:192 192:256

indicates a regular field with a 2x2x4 grid of tiles of dimensions 33x51x65 overlapping along common boundaries.

The tiles can then be read from different files and file sections.

Note: Tiles can extend outside of the field area – this feature can be used to read only portions of the data contained in data files. For example,

#VisNow regular field

field test,dim 30 50

tile_x -8:37

tile_y -8:57

will read only a central rectangle leaving aside margins of the width 8.



Data components description section

component name boolean|byte|short|integer|float|real|double|string, [vector|veclen|vlen veclen,]|[, array d0 [d1 ...][, symmetric]][, unit unit][, min min, max max][,user user data]

...(for each component)

Examples:

component velocity float, vector 3, unit m/sec

component pressure float, unit PSI

comp Hessian double, arr 3, symmetric, user “symmetric matrix of the second derivative of pressure”

File description section

VisNow can read both ASCII/UTF-8 and binary files.

The first line of a file description contains overall description of the file.

The following lines contain the information about subsequent file sections (parsing rules and the list of data contained in the file section).

Binary file description:

file name binary [little|big] #file description

[timestep t[ dt]]

[skip skip,][stride stride,][tile x [y [z]] | tile x0:x1 [y0:y1 [z0:z1]],] component[.coordinate] offset[,... for each component read from this file section] #section content (can be repeated)

[end|repeat n]

Example:

file ../data/test.bin binary l,

skip 1024, stride 13, mask 0, velocity.0 1, velocity.1 5, velocity.2 9

skip 0, stride 4, temperature 0

will describe a file written e.g. on an Intel computer with two data sections:

the first section starts with 1024 irrelevant bytes and contains dim0*dim1*dim2 13-byte groups with mask[i] at the first byte followed by three float coordinates of the v[i] component;

the second section contains dim0*dim1*dim2 4-byte groups containing temperature data (one float per node)

Simplifications:

file ../data/test.bin binary l

skip 1024, mask, velocity

temperature

Tile example:

file ../data/test.bin binary

skip 1024, tile 0 1 2, temperature



alternative tile description:

file ../data/test.bin bin

skip 1024, tile 0:32 50:100 128:192, temperature



Timestep/tile example:

file 2011Dec02_00/16222_2011120200+00250000C3sl000000000000000 binary

timestep 25

tile -8:439 -8:606, pressure_at_mean_sea_level

end

ASCII file types

Three types of files are available.

Boolean values can be written as true/false or 1/0 in ASCII/UTF-8 files

Strings containing any separator character must be enclosed in “ “ to be read properly

ASCII column file:



file name column [,decimal decimal separator]

[timestep t[ dt]]

[skip skip,][separator "separator_string",][ tile x [y [z]] | x0:x1 [y0:y1 [z0:z1]],] component[.coordinate] column[,... for each component read from this section]#section content (can be repeated)

[end|repeat n]



Example:

file ../data/test.txt column,

skip 10, separator ",", mask 0, v.0 1, v.1 2, v.2 3

skip 0, temperature 0

will describe a file with 10 irrelevant lines, a section of text organized in 4 or more columns separated by commas or blanks with mask[i] at the first columns followed by three float coordinates of the v component. The next section contains the temperature data at the first column.





Simplifications:



ASCII character column file:



file name fixed column[,skip skip][,decimal decimal separator]

[timestep t[ dt]]

[skip skip,][ tile x [y [z]] | x0-x1 [y0-y1 [z0-z1]],]component[.coordinate] char-char[,... # for each component read from this file]

[end|repeat n]



Example:

file ../data/test.txt fix

skip 10, mask 0-1, v.0 2-10, v.1 11-19, v.2 20-28

will describe a file with 10 irrelevant lines followed by a sequence of dim0*dim1*dim2 lines with mask[i] written at first 2 chars of the line and followed by three float coordinates of the velocity components at the node written at the subsequent 9-char chunks.



ASCII continuous file:



file name ASCII[,separator separator_string][,length length][,decimal decimal separator]

[timestep t[ dt]]

[skip skip],[stride stride,] [ tile x [y [z]] | x0-x1 [y0-y1 [z0-z1]], component[.coordinate] offset[,... # for each component read from this file]

[end|repeat n]



No line structure is assumed – data are read continuously from the file. If no separator string is given, data items are separated by any combination of white characters (spaces, tabs and newlines)

Example:

1:

file ../data/test.txt ascii

skip 1, stride 5, pressure 0, v.0 1, v.1 2, v.2 3

skip 1, stride 1, temperature 0

will describe a file with one header line followed by 5-element groups with pressure[i] at the first item followed by three float coordinates of the velocity components and one unread item at the i-th node for i = 0,...,dim0*dim1*dim2-1. The next section of the file starts with one header line and contains only temperature data.

2.

file ../data/test.txt ascii, len 1

skip 1, stride 1, mask

will describe a file with one header line followed by mask data, one character per node e.g.

Mask

00011111100111111

00111111111111110

00011111111111101

...



Simplifications: