cdflib.getVarSparseRecords

Information about how variable handles sparse records

Syntax

stype = cdflib.getVarSparseRecords(cdfId,varNum)

Description

stype = cdflib.getVarSparseRecords(cdfId,varNum) returns information about how a variable in the Common Data Format (CDF) file handles sparse records.

Input Arguments

cdfId

Identifier of a CDF file, returned by a call to cdflib.create or cdflib.open.

varNum

Numeric value that identifies the variable. Variable numbers are zero-based.

Output Arguments

stype

One of the following text strings, or its numeric equivalent, that specifies how the variable handles sparse records.

Text String Description
'NO_SPARSERECORDS'No sparse records.
'PAD_SPARSERECORDS'For sparse records, the library uses the variable's pad value when reading values from a missing record.
'PREV_SPARSERECORDS'For sparse records, the library uses values from the previous existing record when reading values from a missing record. If there is no previous existing record, the library uses the variable's pad value.

To get the numeric equivalent of these text strings, use cdflib.getConstantValue.

Examples

Open the example CDF, and then get the sparse record type of a variable in the file:

cdfid = cdflib.open('example.cdf');

stype = cdflib.getVarSparseRecords(cdfid,0)

stype =

NO_SPARSERECORDS

%Clean up
cdflib.close(cdfid);

clear cdfid

References

This function corresponds to the CDF library C API routine CDFgetzVarSparseRecords.

To use this function, you must be familiar with the CDF C interface. Read the CDF documentation at the CDF Web site.

For copyright information, see the cdfcopyright.txt file.

Was this topic helpful?