[Top] [Prev] [Next] [Bottom]

DFSDsetfillvalue/dssfill

intn DFSDsetfillvalue(VOIDP fill_value)
fill_value

IN:

Fill value

Purpose

Set the value used to fill in any unwritten location in a scientific dataset.

Return value

Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.

Description

It is assumed that the fill value has the same data type as the dataset. Once the fill value is set for a particular SDS, it cannot be changed.

If DFSDsetfillvalue is called before the first call to DFSDstartslab, DFSDstartslab will set the fill value tag attribute to the value specified in the DFSDsetfillvalue call, but will not actually write out the fill value when DFSDwriteslab is called. However, if DFSDsetfillvalue is called after the first call the DFSDstartslab, the fill value tag attribute will be set by DFSDsetfillvalue and the fill value will be written to the slab during the DFSDwriteslab call. This is shown in the following C example.

Example

In this example a 200 x 300 data array is written to a file called 'myfile.hdf', together with label, unit, and format information about each dimension.

     int16 data[5] = {0, 1, 2, 3, 4};
			int dims[1] = {5};
			int32 start[1] = {1};
			int 32 count[1] = {2};
			int16 fillv = -9999;

			main( ) {
				int stat;

				/* Set the fill value only; don't write. */
				stat = DFSDsetdims(1, dims);
				stat = DFSDsetNT(DFNT_INT16);
				stat = DFSDwriteslab("File.hdf");
				stat = DFSDsetfillvalue((VOIDP)&fillv);
				stat = DFSDwriteslab(start, start, count, (VOIDP)data);
				stat = DFSDendslab( );

				/* Set the fill value and write it. */
				stat = DFSDsetdims(1, dims);
				stat = DFSDsetNT(DFNT_INT16);
				stat = DFSDsetfillvalue((VOIDP)&fillv);
				stat = DFSDstartslab("File.hdf");
				stat = DFSDwriteslab(start, start, count, (VOIDP)data);
				stat = DFSDendslab( );

 } 
FORTRAN

integer function dssfill(fill_value)

character* (*) fill_value



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Reference Manual, Draft 06/09/97, NCSA HDF Development Group.