Given a new filename, DFSDstartslab will create a new HDF file with the specified name. Given an existing filename, it will open the named file and append the new data set to the end of the file. Its only parameter is
filename
. DFSDendslab has no parameters and need only be called once per file. DFSDendslab will write any attributes defined immediately before the data set is created.For more information on assigning attributes, see Section 12.7.3 on page 377.
TABLE 12I - DFSDstartslab Parameter List
|
|
|
| |
|
| |||
|
|
|
Name of the file containing the data set.
|
More specifically, the DFSD programming model for writing slabs to an SDS is as follows:
Although not specifically defined as a slab routine, in practice, the DFSDsetfillvalue routine is used to initialize array elements between non-contiguous slab write operations. Setting a fill value places the same value in every array location before the first slab is written. Any hole created by non-contiguous writes can then be recognized by identifying the known fill value. The fill value must have the same number type as the values in the data set. For more information on fill values refer to Section 12.7.1.2 on page 374.
To write a slab to a new data set, the calling program must include the following routine calls:
C: status = DFSDsetdims(rank, dimsizes);
status = DFSDsetNT(num_type);
status = DFSDstartslab(filename);
status = DFSDwriteslab(start, stride, count, data);
status = DFSDendslab( );
FORTRAN: status = dssnt(num_type)
status = dssdims(rank, dim_sizes)
status = dssslab(filename)
status = dswslab(start, stride, edge, data)
status = dseslab( )
When writing slabs to an existing data set, it is impossible to change the number type, array boundaries, fill value, or calibration information. Consequently DFSDsetNT, DFSDsetdims, DFSDsetcal, and DFSDsetfillvalue will generate errors if called for an existing data set. C: status = DFSDwriteref(filename, ref);
status = DFSDstartslab(filename);
status = DFSDwriteslab(start, stride, count, data);
status = DFSDendslab( );
FORTRAN: status = dswref(filename, ref)
status = dssslab(filename)
status = dswslab(start, stride, edge, data)
status = dseslab( )
Because DFSDwriteslab offers no overwrite protection, the calling program is responsible for eliminating overlap when arranging slabs within the newly defined data set. start
, stride
, edge
, and data
.
The arguments start
, stride
, and edge
are defined as they are in the corresponding SD routines.start
array as the stride
parameter as a place holder. Whatever is passed as the stride
parameter will be ignored by the DFSD interface.TABLE 12J - DFSDwriteslab Parameter List
To read a slab, the calling program must include the following routine calls:
C: status = DFSDreadref(filename, ref);
status = DFSDstartslab(filename);
status = DFSDreadslab(start, stride, edge, data);
status = DFSDendslab( );
FORTRAN: status = dsrref(filename, ref)
status = dssslab(filename)
status = dsrslab(start, stride, edge, data)
status = dseslab( )
In addition to DFSDreadref, DFSDgetdims may also be used to position the read pointer to the appropriate data set. When DFSDreadslab is used to read slabs, the coordinates of the start
array must begin at 0 for each dimension (start={0,0, ... 0}
) and the size of each dimension must equal the size of the array itself (edge={dim_size_1, dim_size_2, dim_size_n}
). As with DFSDwriteslab, whatever is passed in as the stride
parameter is ignored. Finally, the data
buffer must allocate enough space to hold the data: excess data is truncated.dim 1 = 1, dim 2 = 1, . . . dim n-1 = 1, dim n = 1
). The first element of the slab will be the coordinates specified by the contents of the start
array. DFSDreadslab will extract elements in increasing order until the until the dimensional offset specified by the contents of the edge
array are encountered.TABLE 12K - DFSDreadslab Parameter List