 |
vlmput_slice4d
NAME
vlmput_slice4d - Writes a slice of data to a
ParVox voxel data file.
SYNOPSIS
#include <vlmeta.h>
int vlmput_slice4d(char *name, vlmeta_voxel4d *vdata,
long voxel_start[], long voxel_count[]);
DESCRIPTION
Vlmget_slice4d writes a slice of data values to a
NetCDF ParVox voxel data file. Vlmget_slice4d writes the header data in
the vlmeta_voxel4d structure vdata and the data at the
vldata->voxel_data member to the file name.
The function writes the data to location starting from voxel_start
and extending voxel_count distance.
The arrays
voxel_start and voxel_count are 4 dimensional
vectors in the following order: variable ID, depth (k), height (j),
and width (i). To put it another way, voxel_start[0] would
be the variable number (0 if there is only one), voxel_start[1]
would be the value in k dimension, and so on. Note that voxel_count
is the extent to write in each direction, therefore no values in
voxel_count should be 0. Example: given a dataset
of one variable and the size 640 × 480 × 128, suppose we
want to write a slice 2 units thick in the k direction, say from
(0, 0, 4) to (639, 479, 5). To write this slice, vlmput_slice4d will
need to be called with these values in the arrays:
voxel_start[0] = 0,
voxel_start[1] = 4, voxel_start[2] = 0,
voxel_start[3] = 0
voxel_count[0] = 1,
voxel_count[1] = 2, voxel_count[2] = 480,
voxel_count[3] = 640
There are a few pitfalls to look out for: first,
the voxel_count[] array should contain the extent in each
direction, not the absolute ``corner point''. For example, to write one
variable, voxel_count[0] = 1. Second, note the order in the
array. It is in (variable, k, j, i) order.
NOTES
Currently the put functions only support the
NetCDF format.
SEE ALSO
vlmeta_voxel4d,
ParVox Tutorial: Input Data Format
DIAGNOSTICS
Upon successful completion, the value of 0 is returned.
Otherwise, a value of -1 is returned.
|
 |