![]() |
NetCDF 4.9.3
|
Example program for write then read of a variable using bzip2 compression. More...
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <hdf5.h>
#include "netcdf.h"
#include "netcdf_filter.h"
Go to the source code of this file.
Macros | |
#define | BZIP2_ID 307 |
#define | BZIP2_LEVEL 9 |
#define | CHECK(x) |
#define | CHUNKSIZE 4 /* Note: not the total size of the chunk, but size wrt a dim*/ |
#define | DIMSIZE 4 |
#define | ERRR |
#define | MAXERRS 8 |
#define | NDIMS 4 |
#define | TESTFILE "bzip2.nc" |
Functions | |
static int | check (int err, int line) |
static int | compare (void) |
static void | init (int argc, char **argv) |
int | main (int argc, char **argv) |
static int | test_bzip2 (void) |
static int | verifychunks (void) |
Variables | |
static size_t | actualdims = NDIMS |
static size_t | actualproduct = 1 |
static float * | array = NULL |
static size_t | chunkproduct = 1 |
static size_t | chunks [NDIMS] |
static size_t | chunksize = CHUNKSIZE |
static int | dimids [NDIMS] |
static size_t | dims [NDIMS] |
static size_t | dimsize = DIMSIZE |
static float * | expected = NULL |
static unsigned int | filterid = 0 |
static int | ncid |
static int | nerrs = 0 |
static unsigned int * | params = NULL |
static int | varid |
Example program for write then read of a variable using bzip2 compression.
This is an example which creates a file with a variable that is compressed using bzip2. Then it reads that file and verifies that it returned the correct uncompressed data.
The meta-data (.cdl) for the created file is as follows:
Definition in file filter_example.c.
#define BZIP2_ID 307 |
Definition at line 54 of file filter_example.c.
#define BZIP2_LEVEL 9 |
Definition at line 56 of file filter_example.c.
#define CHECK | ( | x | ) |
Definition at line 109 of file filter_example.c.
#define CHUNKSIZE 4 /* Note: not the total size of the chunk, but size wrt a dim*/ |
Definition at line 65 of file filter_example.c.
#define DIMSIZE 4 |
Definition at line 64 of file filter_example.c.
#define ERRR |
Definition at line 91 of file filter_example.c.
#define MAXERRS 8 |
Definition at line 61 of file filter_example.c.
#define NDIMS 4 |
Definition at line 63 of file filter_example.c.
#define TESTFILE "bzip2.nc" |
Definition at line 58 of file filter_example.c.
|
static |
Definition at line 99 of file filter_example.c.
|
static |
Definition at line 144 of file filter_example.c.
|
static |
Definition at line 282 of file filter_example.c.
int main | ( | int | argc, |
char ** | argv ) |
Definition at line 303 of file filter_example.c.
|
static |
Definition at line 169 of file filter_example.c.
|
static |
Definition at line 117 of file filter_example.c.
|
static |
Definition at line 69 of file filter_example.c.
|
static |
Definition at line 71 of file filter_example.c.
|
static |
Definition at line 81 of file filter_example.c.
|
static |
Definition at line 72 of file filter_example.c.
|
static |
Definition at line 75 of file filter_example.c.
|
static |
Definition at line 68 of file filter_example.c.
|
static |
Definition at line 80 of file filter_example.c.
|
static |
Definition at line 74 of file filter_example.c.
|
static |
Definition at line 67 of file filter_example.c.
|
static |
Definition at line 82 of file filter_example.c.
|
static |
Definition at line 83 of file filter_example.c.
|
static |
Definition at line 79 of file filter_example.c.
|
static |
Definition at line 77 of file filter_example.c.
|
static |
Definition at line 84 of file filter_example.c.
|
static |
Definition at line 79 of file filter_example.c.