Skip to Main Content Skip to Search
Product Documentation

netcdf.inqVarDeflate - Determine compression settings for NetCDF variable

Syntax

[shuffle,deflate,deflateLevel] = netcdf.inqVarDeflate(ncid,varid)

Description

[shuffle,deflate,deflateLevel] = netcdf.inqVarDeflate(ncid,varid) returns the compression parameters for the NetCDF variable specified by varid in the location specified by ncid.

Input Arguments

ncid

Identifier of a NetCDF file, returned by netcdf.create or netcdf.open, or of a NetCDF group, returned by netcdf.defGrp.

varid

Identifier of NetCDF variable, returned by netcdf.defVar.

Output Arguments

shuffle

Boolean value. true indicates that the shuffle filter is enabled for the specified variable. The shuffle filter can assist with the compression of integer data by changing the byte order in the data stream.

deflate

Boolean value. true indicates that compression is enabled for this variable. The deflateLevel argument specifies the level of compression.

deflateLevel

Scalar value between 0 and 9 specifying the amount of compression, where 0 is no compression and 9 is the most compression

Examples

This example opens the NetCDF sample file and gets information about variable compression.

ncid = netcdf.open('example.nc','NOWRITE');
groupid = netcdf.inqNcid(ncid,'grid1');
varid = netcdf.inqVarID(groupid,'temp');
[shuffle,deflate,deflateLevel] = netcdf.inqVarDeflate(groupid,varid);
netcdf.close(ncid);

References

This function corresponds to the nc_inq_var_deflate function in the netCDF library C API.

For copyright information, read the netcdfcopyright.txt and mexnccopyright.txt files.

See Also

netcdf | netcdf.defVarDeflate

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS