Next: , Previous: nc_inq_var_deflate, Up: Variables


6.14 Learn About Szip Parameters for a Variable: nc_inq_var_szip

The function nc_inq_var_szip returns the szip settings for a variable in a netCDF-4 file.

Usage

     int nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
ncid
NetCDF ID, from a previous call to nc_open or nc_create.
varid
Variable ID.
*options_maskp
If this pointer is non-NULL, the nc_inq_var_szip function will put the options_mask here.
*pixels_per_blockp
If this pointer is non-NULL, the nc_inq_var_szip function will write the bits per pixel here.

Errors

nc_inq_var_szip returns the value NC_NOERR if no errors occurred. Otherwise, the returned status indicates an error.

Possible return codes include:

NC_NOERR
No error.
NC_BADID
Bad ncid.
NC_ENOTNC4
Not a netCDF-4 file.
NC_ENOTVAR
Can't find this variable.

Example

This example is from libsrc4/tst_vars3.c.

           /* Make sure we have the szip settings we expect. */
           if (nc_inq_var_szip(ncid, small_varid, &options_mask_in, &pixels_per_block_in)) ERR;
           if (options_mask_in != 0 || pixels_per_block_in !=0) ERR;
           if (nc_inq_var_szip(ncid, medium_varid, &options_mask_in, &pixels_per_block_in)) ERR;
           if (!(options_mask_in & NC_SZIP_EC_OPTION_MASK) || pixels_per_block_in != 32) ERR;
           if (nc_inq_var_szip(ncid, large_varid, &options_mask_in, &pixels_per_block_in)) ERR;
           if (!(options_mask_in & NC_SZIP_NN_OPTION_MASK) || pixels_per_block_in != 16) ERR;