Main Content

netcdf.inqVarDeflate

Return compression parameters for netCDF variable

    Description

    [shuffle,deflate,deflateLevel] = netcdf.inqVarDeflate(ncid,varid) returns the compression parameters for the netCDF variable specified by varid in the file or group specified by ncid.

    example

    Examples

    collapse all

    Open the sample netCDF file, and get compression parameters for a variable. In this case, the shuffle filter and the deflate filter are not enabled for the specified variable.

    ncid = netcdf.open("example.nc","NOWRITE");
    gid = netcdf.inqNcid(ncid,"grid1");
    varid = netcdf.inqVarID(gid,"temp");
    [shuffle,deflate,deflateLevel] = netcdf.inqVarDeflate(gid,varid)
    
    shuffle =
    
      logical
    
       0
    
    
    deflate =
    
      logical
    
       0
    
    
    deflateLevel =
    
         0
    

    Close the netCDF file.

    netcdf.close(ncid)
    

    Input Arguments

    collapse all

    NetCDF file or group identifier, specified as a nonnegative integer scalar. You can use the netcdf.create or netcdf.open function to return a file identifier. You can use the netcdf.defGrp function to return a group identifier.

    Data Types: double

    NetCDF variable identifier, specified as a nonnegative integer scalar. You can use the netcdf.defVar function to return a variable identifier.

    Data Types: double

    Output Arguments

    collapse all

    Status of the shuffle filter, returned as a 1 or 0 of data type logical. A value of 1 indicates that the shuffle filter is enabled for the specified variable.

    Status of the deflate filter, returned as a 1 or 0 of data type logical. A value of 1 indicates that the deflate filter is enabled for the specified variable.

    Level of compression, returned as an integer scalar value between 0 and 9. A value of 0 indicates no compression, and a value of 9 indicates maximum compression.

    Tips

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

    Version History

    Introduced in R2010b