VAPOR3 3.9.4
VDC_c.h
Go to the documentation of this file.
1#ifndef _VDC_C_H_
2#define _VDC_C_H_
3
4#define VDC_AccessMode_R 1
5#define VDC_AccessMode_W 2
6#define VDC_AccessMode_A 3
7
8#define VDC_XType int
9#define VDC_XType_INVALID -1
10#define VDC_XType_FLOAT 1
11#define VDC_XType_DOUBLE 2
12#define VDC_XType_INT32 3
13#define VDC_XType_INT64 4
14#define VDC_XType_TEXT 5
15
16#define VDCDimension_Axis_X 0
17#define VDCDimension_Axis_Y 1
18#define VDCDimension_Axis_Z 2
19#define VDCDimension_Axis_T 3
20
21#ifdef __cplusplus
22
23 #include "vapor/VDC.h"
24typedef VAPoR::VDCNetCDF VDC;
25typedef VAPoR::VDC::Dimension VDCDimension;
26typedef VAPoR::VDC::BaseVar VDCBaseVar;
27typedef VAPoR::VDC::AuxVar VDCAuxVar;
28typedef VAPoR::VDC::DataVar VDCDataVar;
29typedef VAPoR::VDC::CoordVar VDCCoordVar;
30extern "C" {
31
32#else
33
34typedef struct VDCNetCDF VDC;
36typedef struct VDCBaseVar VDCBaseVar;
37typedef struct VDCAuxVar VDCAuxVar;
38typedef struct VDCDataVar VDCDataVar;
39typedef struct VDCCoordVar VDCCoordVar;
40
41#endif
42
45void VDCDimension_GetName(const VDCDimension *p, char **name);
48
51void VDCBaseVar_GetName(const VDCBaseVar *p, char **name);
52void VDCBaseVar_GetUnits(const VDCBaseVar *p, char **units);
54void VDCBaseVar_GetWName(const VDCBaseVar *p, char **name);
55void VDCBaseVar_GetCRatios(const VDCBaseVar *p, size_t **ratios, int *count);
56void VDCBaseVar_GetBS(const VDCBaseVar *p, size_t **bs, int *count);
57void VDCBaseVar_GetPeriodic(const VDCBaseVar *p, long **periodic, int *count);
58void VDCBaseVar_GetAttributeNames(const VDCBaseVar *p, char ***names, int *count); // Return names instead of objects
60
63void VDCAuxVar_GetDimNames(const VDCAuxVar *p, char ***names, int *count);
64
67void VDCDataVar_GetMeshName(const VDCDataVar *p, char **name);
68void VDCDataVar_GetTimeCoordVar(const VDCDataVar *p, char **name);
69// GetSamplingLocation
70void VDCDataVar_GetMaskvar(const VDCDataVar *p, char **name);
73
76void VDCCoordVar_GetDimNames(const VDCCoordVar *p, char ***names, int *count);
77void VDCCoordVar_GetTimeDimName(const VDCCoordVar *p, char **name);
80
82void VDC_delete(VDC *p);
83int VDC_InitializeDefaultBS(VDC *p, const char *path, int mode);
84int VDC_Initialize(VDC *p, const char *path, int mode, size_t *bs, int bsCount);
85
86int VDC_GetDimension(const VDC *p, const char *dimname, VDCDimension *dimension);
87void VDC_GetDimensionNames(const VDC *p, char ***names, int *count);
88int VDC_GetCoordVarInfo(const VDC *p, const char *varname, VDCCoordVar *var);
89int VDC_GetDataVarInfo(const VDC *p, const char *varname, VDCDataVar *var);
90int VDC_GetBaseVarInfo(const VDC *p, const char *varname, VDCBaseVar *var);
91void VDC_GetDataVarNames(const VDC *p, char ***names, int *count);
92void VDC_GetCoordVarNames(const VDC *p, char ***names, int *count);
93int VDC_GetNumRefLevels(const VDC *p, const char *varname);
94int VDC_GetAtt_long(const VDC *p, const char *varname, const char *attname, long **values, int *count);
95int VDC_GetAtt_double(const VDC *p, const char *varname, const char *attname, double **values, int *count);
96int VDC_GetAtt_text(const VDC *p, const char *varname, const char *attname, char **text);
97int VDC_GetAtt_Count(const VDC *p, const char *varname, const char *attname, int *count);
98void VDC_GetAttNames(const VDC *p, const char *varname, char ***names, int *count);
99int VDC_GetAttType(const VDC *p, const char *varname, const char *attname);
100int VDC_VariableExists(const VDC *p, size_t ts, const char *varname, int reflevel, int lod);
101int VDC_IsTimeVarying(const VDC *p, const char *varname);
102int VDC_CoordVarExists(const VDC *p, const char *varname);
103
104int VDC_GetCRatios(const VDC *p, const char *varname, size_t **ratios, int *count);
105int VDC_GetCRatiosCount(const VDC *p, const char *varname);
106
107int VDC_GetVarDimLens(const VDC *p, const char *varname, int spatial, size_t **lens, int *count);
108int VDC_GetVarDimNames(const VDC *p, const char *varname, int spatial, char ***names, int *count);
109int VDC_GetVarCoordVars(const VDC *p, const char *varname, int spatial, char ***names, int *count);
110int VDC_GetVarDimLensAtLevel(const VDC *p, const char *varname, int level, size_t **lens, int *count);
111
112int VDC_OpenVariableRead(VDC *p, size_t ts, const char *varname, int level, int lod);
113int VDC_CloseVariable(VDC *p, int fd);
114int VDC_Read(VDC *p, int fd, float *region);
115int VDC_ReadSlice(VDC *p, int fd, float *slice);
116int VDC_ReadRegion(VDC *p, int fd, const size_t *min, const size_t *max, const int dims, float *region);
117int VDC_GetVar(VDC *p, const char *varname, int level, int lod, float *data);
118int VDC_GetVarAtTimeStep(VDC *p, size_t ts, const char *varname, int level, int lod, float *data);
119
120// Write
121
122int VDC_SetCompressionBlock(VDC *p, const char *wname, const size_t *cratios, int cratiosCount);
123int VDC_DefineDimension(VDC *p, const char *dimname, size_t length);
124int VDC_DefineDimensionWithAxis(VDC *p, const char *dimname, size_t length, int axis);
125int VDC_DefineDataVar(VDC *p, const char *varname, const char **dimnames, size_t dimnamesCount, const char **coordvars, size_t coordvarCount, const char *units, VDC_XType xtype, int compressed);
126int VDC_DefineCoordVar(VDC *p, const char *varname, const char **dimnames, size_t dimnamesCount, const char *time_dim_name, const char *units, int axis, VDC_XType xtype, int compressed);
127int VDC_DefineCoordVarUniform(VDC *p, const char *varname, const char **dimnames, size_t dimnamesCount, const char *time_dim_name, const char *units, int axis, VDC_XType xtype, int compressed);
128int VDC_PutAtt(VDC *p, const char *varname, const char *attname, VDC_XType xtype, const void *values, size_t count);
129int VDC_PutAtt_double(VDC *p, const char *varname, const char *attname, VDC_XType xtype, const double *values, size_t count);
130int VDC_PutAtt_long(VDC *p, const char *varname, const char *attname, VDC_XType xtype, const long *values, size_t count);
131int VDC_PutAtt_text(VDC *p, const char *varname, const char *attname, VDC_XType xtype, const char *values);
133int VDC_PutVar(VDC *p, const char *varname, int lod, const float *data);
134int VDC_PutVarAtTimeStep(VDC *p, size_t ts, const char *varname, int lod, const float *data);
135
136// Utility
137const char *VDC_GetErrMsg();
138void VDC_FreeStringArray(char ***str, int *count);
139void VDC_FreeString(char **str);
140void VDC_FreeLongArray(long **data);
141void VDC_FreeDoubleArray(double **data);
142void VDC_FreeSize_tArray(size_t **data);
143void VDC_ReverseSize_tArray(size_t *data, int count);
144
145#ifdef __cplusplus
146} // extern "C" }
147#endif
148
149#endif
int VDC_GetVarDimLens(const VDC *p, const char *varname, int spatial, size_t **lens, int *count)
int VDCCoordVar_GetUniform(const VDCCoordVar *p)
void VDCDataVar_GetTimeCoordVar(const VDCDataVar *p, char **name)
int VDC_GetCRatios(const VDC *p, const char *varname, size_t **ratios, int *count)
void VDCDataVar_GetMaskvar(const VDCDataVar *p, char **name)
void VDCBaseVar_GetName(const VDCBaseVar *p, char **name)
int VDC_GetCRatiosCount(const VDC *p, const char *varname)
int VDC_ReadSlice(VDC *p, int fd, float *slice)
int VDC_Initialize(VDC *p, const char *path, int mode, size_t *bs, int bsCount)
int VDC_GetAtt_double(const VDC *p, const char *varname, const char *attname, double **values, int *count)
int VDC_SetCompressionBlock(VDC *p, const char *wname, const size_t *cratios, int cratiosCount)
int VDC_GetBaseVarInfo(const VDC *p, const char *varname, VDCBaseVar *var)
void VDC_FreeSize_tArray(size_t **data)
struct VDCNetCDF VDC
Definition: VDC_c.h:34
void VDC_FreeStringArray(char ***str, int *count)
void VDC_FreeLongArray(long **data)
int VDC_IsTimeVarying(const VDC *p, const char *varname)
size_t VDCDimension_GetLength(const VDCDimension *p)
const char * VDC_GetErrMsg()
void VDC_FreeString(char **str)
int VDC_DefineDimensionWithAxis(VDC *p, const char *dimname, size_t length, int axis)
VDCBaseVar * VDCBaseVar_new()
int VDC_DefineDimension(VDC *p, const char *dimname, size_t length)
void VDCCoordVar_delete(VDCCoordVar *p)
int VDC_ReadRegion(VDC *p, int fd, const size_t *min, const size_t *max, const int dims, float *region)
int VDCBaseVar_GetXType(const VDCBaseVar *p)
int VDC_PutAtt(VDC *p, const char *varname, const char *attname, VDC_XType xtype, const void *values, size_t count)
void VDCCoordVar_GetTimeDimName(const VDCCoordVar *p, char **name)
void VDC_GetDimensionNames(const VDC *p, char ***names, int *count)
int VDC_DefineCoordVar(VDC *p, const char *varname, const char **dimnames, size_t dimnamesCount, const char *time_dim_name, const char *units, int axis, VDC_XType xtype, int compressed)
int VDC_CloseVariable(VDC *p, int fd)
int VDC_VariableExists(const VDC *p, size_t ts, const char *varname, int reflevel, int lod)
int VDC_GetAttType(const VDC *p, const char *varname, const char *attname)
int VDC_GetDimension(const VDC *p, const char *dimname, VDCDimension *dimension)
int VDC_GetVarDimLensAtLevel(const VDC *p, const char *varname, int level, size_t **lens, int *count)
void VDCBaseVar_GetCRatios(const VDCBaseVar *p, size_t **ratios, int *count)
int VDC_GetVarAtTimeStep(VDC *p, size_t ts, const char *varname, int level, int lod, float *data)
int VDC_PutAtt_long(VDC *p, const char *varname, const char *attname, VDC_XType xtype, const long *values, size_t count)
int VDC_OpenVariableRead(VDC *p, size_t ts, const char *varname, int level, int lod)
void VDCDataVar_GetMeshName(const VDCDataVar *p, char **name)
int VDC_GetAtt_Count(const VDC *p, const char *varname, const char *attname, int *count)
int VDC_Read(VDC *p, int fd, float *region)
void VDCBaseVar_GetPeriodic(const VDCBaseVar *p, long **periodic, int *count)
struct VDCDimension VDCDimension
Definition: VDC_c.h:35
void VDCBaseVar_GetUnits(const VDCBaseVar *p, char **units)
void VDCBaseVar_GetWName(const VDCBaseVar *p, char **name)
int VDC_DefineDataVar(VDC *p, const char *varname, const char **dimnames, size_t dimnamesCount, const char **coordvars, size_t coordvarCount, const char *units, VDC_XType xtype, int compressed)
void VDCCoordVar_GetDimNames(const VDCCoordVar *p, char ***names, int *count)
int VDC_PutVarAtTimeStep(VDC *p, size_t ts, const char *varname, int lod, const float *data)
int VDCBaseVar_IsCompressed(const VDCBaseVar *p)
int VDC_GetDataVarInfo(const VDC *p, const char *varname, VDCDataVar *var)
int VDC_GetNumRefLevels(const VDC *p, const char *varname)
int VDC_GetAtt_long(const VDC *p, const char *varname, const char *attname, long **values, int *count)
void VDCBaseVar_delete(VDCBaseVar *p)
int VDC_DefineCoordVarUniform(VDC *p, const char *varname, const char **dimnames, size_t dimnamesCount, const char *time_dim_name, const char *units, int axis, VDC_XType xtype, int compressed)
struct VDCDataVar VDCDataVar
Definition: VDC_c.h:38
void VDC_GetCoordVarNames(const VDC *p, char ***names, int *count)
void VDCAuxVar_GetDimNames(const VDCAuxVar *p, char ***names, int *count)
int VDC_CoordVarExists(const VDC *p, const char *varname)
int VDC_PutAtt_double(VDC *p, const char *varname, const char *attname, VDC_XType xtype, const double *values, size_t count)
int VDC_EndDefine(VDC *p)
VDCCoordVar * VDCCoordVar_new()
int VDC_PutAtt_text(VDC *p, const char *varname, const char *attname, VDC_XType xtype, const char *values)
VDCDimension * VDCDimension_new()
#define VDC_XType
Definition: VDC_c.h:8
void VDC_delete(VDC *p)
void VDCAuxVar_delete(VDCAuxVar *p)
int VDCCoordVar_GetAxis(const VDCCoordVar *p)
int VDC_GetVarCoordVars(const VDC *p, const char *varname, int spatial, char ***names, int *count)
void VDCDataVar_delete(VDCDataVar *p)
int VDC_InitializeDefaultBS(VDC *p, const char *path, int mode)
void VDCDimension_GetName(const VDCDimension *p, char **name)
void VDCBaseVar_GetBS(const VDCBaseVar *p, size_t **bs, int *count)
int VDC_GetAtt_text(const VDC *p, const char *varname, const char *attname, char **text)
struct VDCBaseVar VDCBaseVar
Definition: VDC_c.h:36
VDC * VDC_new()
int VDCDataVar_GetHasMissing(const VDCDataVar *p)
void VDC_FreeDoubleArray(double **data)
int VDC_GetVarDimNames(const VDC *p, const char *varname, int spatial, char ***names, int *count)
void VDC_ReverseSize_tArray(size_t *data, int count)
double VDCDataVar_GetMissingValue(const VDCDataVar *p)
VDCAuxVar * VDCAuxVar_new()
void VDC_GetAttNames(const VDC *p, const char *varname, char ***names, int *count)
int VDCDimension_IsTimeVarying(const VDCDimension *p)
int VDC_PutVar(VDC *p, const char *varname, int lod, const float *data)
int VDC_GetVar(VDC *p, const char *varname, int level, int lod, float *data)
int VDC_GetCoordVarInfo(const VDC *p, const char *varname, VDCCoordVar *var)
struct VDCAuxVar VDCAuxVar
Definition: VDC_c.h:37
VDCDataVar * VDCDataVar_new()
struct VDCCoordVar VDCCoordVar
Definition: VDC_c.h:39
void VDCDimension_delete(VDCDimension *p)
void VDCBaseVar_GetAttributeNames(const VDCBaseVar *p, char ***names, int *count)
void VDC_GetDataVarNames(const VDC *p, char ***names, int *count)
Implements the VDC abstract class, providing storage of VDC data in NetCDF files.
Definition: VDCNetCDF.h:27