我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

cdflib.getVarReservePercent

Compression reserve percentage for variable

Syntax

percent = cdflib.getVarReservePercent(cdfId,varNum)

Description

percent = cdflib.getVarReservePercent(cdfId,varNum) returns the compression reserve percentage for a variable in a Common Data Format (CDF) file. This operation only applies to compressed variables.

cdfId identifies the CDF file. varNum is a numeric value that identifies the variable. Variable numbers are zero-based.

Examples

Open the example CDF file, get the number of a compressed variable, and then determine the reserve percent for the variable.

cdfid = cdflib.open('example.cdf');
varnum = cdflib.getVarNum(cdfid,'Temperature');
percent = cdflib.getVarReservePercent(cdfid,varnum);
cdflib.close(cdfid);

More About

expand all

reserve percentage

Specifies how much extra space to allocate for a compressed variable. This extra space allows the variable to expand when you write additional records to the variable. If you do not specify this room for growth, the library has to move the variable to the end of the file when the size expands and the space at the original location of the variable becomes wasted space.

By default, the reserve percent is 0 (no extra space is reserved). You can specify any percentage between 1 and 100 and values greater than 100. The value specifies the percentage of the uncompressed size of the variable.

References

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

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?