Define compression parameters for NetCDF variable
netcdf.defVarDeflate(ncid,varid,shuffle,deflate,deflateLevel)
netcdf.defVarDeflate(ncid,varid,shuffle,deflate,deflateLevel)
sets
the compression parameters for the NetCDF variable specified by varid
in
the location specified by ncid
.
|
Identifier of NetCDF file, returned by |
|
Identifier of a NetCDF variable, returned by |
|
Boolean value. To turn on the shuffle filter, set this argument
to |
|
Boolean value. To turn on compression, set this argument to |
|
Numeric value between |
This example create a variable with dimensions [1800 3600] and a compression level of 5. This
results in a chunked layout that is a 10-by-10 grid. Use
netcdf.defVarChunking
to define your own chunking, otherwise
netcdf.defVarDeflate
uses the library default values.
ncid = netcdf.create('myfile.nc','NETCDF4'); latdimid = netcdf.defDim(ncid,'lat',1800); londimid = netcdf.defDim(ncid,'col',3600); varid = netcdf.defVar(ncid,'earthgrid','double',[latdimid londimid]); netcdf.defVarChunking(ncid,varid,'CHUNKED',[180 360]); netcdf.defVarDeflate(ncid,varid,true,true,5); netcdf.close(ncid);
This function corresponds to the nc_def_var_deflate
function
in the netCDF library C API.
For copyright information, read the netcdfcopyright.txt
and mexnccopyright.txt
files.