WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
NetCdfFile.h
1#ifndef _WINC_NETCDFFILE
2#define _WINC_NETCDFFILE
3
4#include "netcdf.h"
5
6#include <WXP/FloatArray.h>
7#include <WXP/IntArray.h>
8#include <WXP/String.h>
9
10namespace WXP {
11 class NetCdfFile {
12 int fd;
13 int shape[10];
14 size_t start[10];
15 size_t count[10];
16 char str[1000];
17 int ndim;
18 bool opened;
19
20 public:
21 int init();
22 NetCdfFile();
23 NetCdfFile( const char *filename, int access );
24 NetCdfFile( const char *filename );
25 int setFD( int val );
26 int printErrors( int val );
27 int open( const char *filename, int access );
28 int open( const char *filename );
29 int defDim( const char *name, int size );
30 int defUnlimitDim( const char *name );
31 int endDef();
32 int close();
33 int getNumDim();
34 int getNumVar();
35 int getNumAttr();
36 int getUnlimitDim();
37 int getDim( const char *name );
38 const char *getDimName( int dim );
39 int getDimSize( int dim );
40 int setShape( int num, ... );
41 int defVar( const char *name, int type, int ndims, ... );
42 int defVar( const char *name, int type, IntArray & dims );
43 int defFloatVar( const char *name );
44 int defIntVar( const char *name );
45 int defShortVar( const char *name );
46 int defByteVar( const char *name );
47 int defCharVar( const char *name );
48 int getVar( const char *name );
49 const char *getVarName( int var );
50
51 int putGlobAttr( const char *name, const char *value );
52 bool hasGlobAttr( const char *name );
53 const char *getGlobAttr( const char *name );
54 int getGlobAttr( const char *name, String &string );
55 int getIntGlobAttr( const char *name );
56 float getFloatGlobAttr( const char *name );
57 const char *getGlobAttrName( int ind );
58
59 int putBaseAttr( int id, const char *long_name, const char *units );
60 int putRangeAttr( int id, float min, float max );
61 int putRangeAttr( int id, int min, int max );
62 int putFillAttr( int id );
63 int putFillAttr( int id, int val );
64 int getNumVarAttr( int var );
65 bool hasAttr( int var, const char *name );
66 const char *getAttr( int var, const char *name );
67 int getAttr( int var, const char *name, String &string );
68 int getIntAttr( int var, const char *name );
69 float getFloatAttr( int var, const char *name );
70 const char *getAttrName( int var, int ind );
71 int getNumVarDims( int var );
72 int getVarDims( int var, IntArray &dims );
73 int getVarType( int var );
74 const char *getVarTypeStr( int var );
75
76 int setPos( int num, ... );
77 int setPos( IntArray &st );
78 int setRange( int num, ... );
79 int setRange( IntArray &st, IntArray &cnt );
80 int put( int var, IntArray &st, const char *str );
81 int putStr( int var, const char *str );
82 int put( int var, float value );
83 int put( int var, float *array );
84 int put( int var, int value );
85 int put( int var, short value );
86 int put( int var, char value );
87 int put( int var, const char *array );
88 const char *get( int var, IntArray &st );
89 int getRow( int var, IntArray &st, FloatArray &array );
90 int getStr( int var, int len, char *str );
91 float getFloat( int var );
92 int getFloatArray( int var, float *array );
93 int getFloatArray( int var, FloatArray &array );
94 double getDouble( int var );
95 int getDoubleArray( int var, double *array );
96 char getChar( int var );
97 int getInt( int var );
98 char getByte( int var );
99 int getByteArray( int var, char *array );
100 int getIntArray( int var, int *array );
101 short getShort( int var );
102 int getShortArray( int var, short *array );
103
104 enum Type {
105 BYTE,
106 CHAR,
107 SHORT,
108 INT,
109 FLOAT,
110 DOUBLE,
111 UBYTE,
112 USHORT,
113 UINT,
114 INT64
115 };
116
117 };
118}
119#endif
This class creates an integer array.
Definition FloatArray.h:7
This class creates an integer array.
Definition IntArray.h:7
This class is an access layer to netCDF files.
Definition NetCdfFile.h:11
int getIntGlobAttr(const char *name)
Definition NetCdfFile.cc:396
int getNumVar()
Definition NetCdfFile.cc:140
int getNumDim()
Definition NetCdfFile.cc:130
const char * getDimName(int dim)
Definition NetCdfFile.cc:182
int getNumAttr()
Definition NetCdfFile.cc:150
int getDim(const char *name)
Definition NetCdfFile.cc:171
int close()
Definition NetCdfFile.cc:119
int setShape(int num,...)
Definition NetCdfFile.cc:206
int getUnlimitDim()
Definition NetCdfFile.cc:160
int open(const char *filename, int access)
Definition NetCdfFile.cc:66
int getDimSize(int dim)
Definition NetCdfFile.cc:192
This is a variable length string class.
Definition String.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4