Contenuto principale

cdflib.getCompression

Compression settings

Syntax

[ctype,cparam,cpercentage] = cdflib.getCompression(cdfid)

Description

[ctype,cparam,cpercentage] = cdflib.getCompression(cdfid) returns information about the compression settings of a Common Data Format (CDF) file.

Input Arguments

cdfid

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

Output Arguments

ctype

Character vector specifying compression type, such as 'HUFF_COMPRESSION'. If the file does not use compression, the function returns 'NO_COMPRESSION'. For a list of supported compression types, see cdflib.setCompression.

cparam

The value of the parameter associated with the type of compression. For example, for the 'RLE_COMPRESSION' compression type, the parameter specifies the style of run-length encoding.

cpercentage

The rate of compression, expressed as a percentage.

Examples

collapse all

Open a sample CDF file and get its compression settings.

cdfid = cdflib.open("example_364.cdf");
[ctype,cparam,cpercentage] = cdflib.getCompression(cdfid)
ctype = 
'GZIP_COMPRESSION'
cparam = 
7
cpercentage = 
7

Close the CDF file and remove the cdfid variable.

cdflib.close(cdfid)
clear cdfid

Tips

  • This function corresponds to the CDF library C API routine CDFgetCompression.

  • To use this function, you must be familiar with the CDF C interface. You can access the CDF documentation at the CDF website.