NetCDF 4.10.1
Loading...
Searching...
No Matches
dfilter.c File Reference

Functions for working with filters. More...

#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "netcdf.h"
#include "netcdf_filter.h"
#include "ncdispatch.h"
#include "nc4internal.h"
#include "nclog.h"
Include dependency graph for dfilter.c:

Go to the source code of this file.

Functions

static void byteswap4 (unsigned char *)
static void byteswap8 (unsigned char *)
int nc_def_var_blosc (int ncid, int varid, unsigned subcompressor, unsigned level, unsigned blocksize, unsigned addshuffle)
 Turn on blosc for a variable.
int nc_def_var_bzip2 (int ncid, int varid, int level)
 Turn on bzip2 compression for a variable.
EXTERNL int nc_def_var_filter (int ncid, int varid, unsigned int id, size_t nparams, const unsigned int *params)
 Define a new variable filter Assumes HDF5 format using unsigned ints.
int nc_def_var_zstandard (int ncid, int varid, int level)
 Turn on Zstandard compression for a variable.
EXTERNL int nc_inq_filter_avail (int ncid, unsigned id)
 Test if filter is available.
int nc_inq_var_blosc (int ncid, int varid, int *hasfilterp, unsigned *subcompressorp, unsigned *levelp, unsigned *blocksizep, unsigned *addshufflep)
 Learn whether Blosc compression is on for a variable, and, if so, the settings.
int nc_inq_var_bzip2 (int ncid, int varid, int *hasfilterp, int *levelp)
 Learn whether bzip2 compression is on for a variable, and, if so, the level setting.
EXTERNL int nc_inq_var_filter (int ncid, int varid, unsigned int *idp, size_t *nparamsp, unsigned int *params)
 Find the first filter (if any) associated with a variable.
EXTERNL int nc_inq_var_filter_ids (int ncid, int varid, size_t *nfiltersp, unsigned int *ids)
 Find the set of filters (if any) associated with a variable.
EXTERNL int nc_inq_var_filter_info (int ncid, int varid, unsigned int id, size_t *nparamsp, unsigned int *params)
 Find the param info about filter (if any) associated with a variable and with specified id.
int nc_inq_var_zstandard (int ncid, int varid, int *hasfilterp, int *levelp)
 Learn whether Zstandard compression is on for a variable, and, if so, the level setting.

Detailed Description

Functions for working with filters.

Definition in file dfilter.c.

Function Documentation

◆ nc_def_var_filter()

EXTERNL int nc_def_var_filter ( int ncid,
int varid,
unsigned int id,
size_t nparams,
const unsigned int * params )

Define a new variable filter Assumes HDF5 format using unsigned ints.

Only variables with chunked storage can use filters.

Parameters
ncidFile and group ID.
varidVariable ID.
idFilter ID.
nparamsNumber of filter parameters.
paramsFilter parameters.
Returns
NC_NOERR No error.
NC_EINVAL Variable must be chunked.
NC_EBADID Bad ID.
Author
Dennis Heimbigner

Definition at line 129 of file dfilter.c.

◆ nc_inq_filter_avail()

EXTERNL int nc_inq_filter_avail ( int ncid,
unsigned id )

Test if filter is available.

Would prefer returning a list of all available filters, but HDF5 does not support that capability.

Parameters
ncidID of file for which filter list is desired
idfilter id of interest
Returns
NC_NOERR if the filter is available
NC_EBADID if ncid is invalid
NC_ENOFILTER if filter is not available.
Author
Dennis Heimbigner

Definition at line 212 of file dfilter.c.