CDF_VARPUT procedure writes a value to a
variable in a Common Data Format file. This function provides equivalent functionality to the C routines
Id, Variable, Value
The CDF ID, returned from a previous call to CDF_OPEN or CDF_CREATE.
A string containing the name of the variable
the variable number being written.
The value to write. If the value has 1 more dimension than the CDF, multiple records will be written.
An optional vector containing the counts to be used in writing
. Note that counts do not have to match the dimensions of
. The default count is to use the dimensions of
A vector specifying the interval between values in each dimension. The default value is 1 in each dimension.
A vector specifying the array indices within the specified record(s) at which to begin writing. OFFSET is a 1-dimensional array containing one element per CDF dimension. The default value is zero in each dimension.
The interval between records being written when writing multiple records. The default value is 1.
The record number at which to start writing. The default is 0.
is a variable ID (as opposed to a variable name) and the variable is a zVariable, set this flag to indicate that the variable ID is a zVariable ID. The default is to assume that
is an rVariable ID.
id= CDF_CREATE('mycdf', [5,10], /NETWORK_ENCODING, /ROW_MAJOR)
varid= CDF_VARCREATE(id, 'V1', [1,1], /CDF_FLOAT, /REC_VARY)
To write the value 42.0 into record 12, third row, fourth column:
CDF_VARPUT, id, varid, 42, REC_START=12, OFFSET=[2,3]
To write 3 records, skipping every other record, starting at record 2, writing every other entry of each record. Note that in this example we write 25 values into each record written:
CDF_VARPUT, id, varid, FINDGEN(5,5,3), INTERVAL=[2,1], $