Querying Public Information
Function Syntax
- Query file information.
nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp)
- Query file format information.
- Query extended file format information.
- Query the number of variables.
- Query the number of dimensions.
nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
- Query type IDs.
- Query the number of groups.
- Query the group name.
- Query all ncids of a group.
nc_inq_grp_full_ncid(int ncid, const char* full_name, int *grp_ncid)
- Query the number and IDs of dimensions.
nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents)
- Query the attribute type.
nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep)
- Query the variable type.
- Query the variable name.
- Query global attributes.
- Query variable attributes.
- Query variable information.
nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
- Find the parameter information about a filter with a specified ID associated with a variable.
nc_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t *nparamsp, unsigned int *params)
- Find the set of filters associated with a variable.
nc_inq_var_filter_ids(int ncid, int varid, size_t * nfiltersp, unsigned int * ids)
nc_inq_var_filterids(int ncid, int varid, size_t *nfilters, unsigned int *filterids)
- Get the storage and chunk sizes of a variable.
nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
ncid |
File ID |
Non-negative integer |
Input |
varid |
Variable ID |
Non-negative integer |
Input |
id |
Filter ID |
Non-negative integer |
Input |
*ndimsp |
Pointer to the number of dimensions |
Non-empty |
Output |
*nvarsp |
Pointer to the number of variables |
Non-empty |
Output |
*nattsp |
Pointer to the number of attributes |
Non-empty |
Output |
*unlimdimidp |
Pointer to the ID of the first unlimited dimension |
Non-empty |
Output |
*formatp |
Pointer to the file format |
Non-empty |
Output |
*modep |
Pointer to the file mode |
Non-empty |
Output |
*nunlimdimsp |
Pointer to the number of unlimited dimensions |
Non-empty |
Output |
*ntypes |
Pointer to the number of types |
Non-empty |
Output |
*typeids |
Pointer to the ID of the first type |
Non-empty |
Output |
*numgrps |
Pointer to the number of groups |
Non-empty |
Output |
*nfilters |
Pointer to the number of filters |
Non-empty |
Output |
*filterids |
Pointer to the IDs of filters |
Non-empty |
Output |
*storagep |
Pointer to the storage size |
Non-empty |
Output |
*chunksizesp |
Pointer to the chunk size |
Non-empty |
Output |
Return Value
- Success: NC_NOERR
- Failure: An error code is returned.
Error Code
Error Code |
Description |
|---|---|
NC_EBADID |
Invalid ncid |
Notes
- nc_inq_format defaults to NC_FORMAT_CLASSIC. Format query is supported when cmode in nc_create_par is NC_64BIT_OFFSET, NC_64BIT_DATA, or NC_NETCDF4.
- nc_inq_format_extended defaults to NC_FORMATX_PNETCDF. Format query is supported when cmode in nc_create_par is NC_64BIT_OFFSET, NC_64BIT_DATA, or NC_NETCDF4.
- *ndimsp, *nvarsp, *nattsp, *unlimdimidp, *formatp, *modep, *nunlimdimsp, *ntypes, *typeids, *numgrps, *nfilters, *filterids, *storagep, and *chunksizesp can be null pointers only if no data needs to be obtained.