VAPoR  0.1
DataMgrGRIB.h
Go to the documentation of this file.
1 #include <vector>
2 #include <string>
3 #include <vapor/DCReaderGRIB.h>
4 #include <vapor/DataMgr.h>
5 #include <vapor/common.h>
6 
7 #ifndef _DataMgrGRIB_h_
8 #define _DataMgrGRIB_h_
9 
10 namespace VAPoR {
11 
12 //
19 //
21 
22 public:
23 
25  const vector <string> &files,
26  size_t mem_size
27  );
28 
29 
30  virtual ~DataMgrGRIB() { };
31 
32 protected:
33 
34 
35  //
36  // Metadata methods
37  //
38 
39  virtual void _GetDim(size_t dim[3], int ) const {
40  return(DCReaderGRIB::GetGridDim(dim));
41  };
42 
43  virtual void _GetBlockSize(size_t bs[3], int reflevel) const {
44  return(DCReaderGRIB::GetGridDim(bs));
45  }
46 
47  virtual int _GetNumTransforms() const {
48  return(0);
49  };
50 
51  virtual string _GetGridType() const {
52  return(DCReaderGRIB::GetGridType());
53  }
54 
55  virtual vector<double> _GetExtents(size_t ) const {
56  return(DCReaderGRIB::GetExtents());
57  };
58 
59  virtual long _GetNumTimeSteps() const {
61  };
62 
63  virtual string _GetMapProjection() const {
65  };
66 
67  virtual vector <string> _GetVariables3D() const {
69  };
70 
71  virtual vector <string> _GetVariables2DXY() const {
73  };
74 
75  virtual vector <string> _GetVariables2DXZ() const {
77  };
78 
79  virtual vector <string> _GetVariables2DYZ() const {
81  };
82 
83  virtual vector<long> _GetPeriodicBoundary() const {
85  };
86 
87  virtual vector<long> _GetGridPermutation() const {
89  };
90 
91  virtual double _GetTSUserTime(size_t ts) const {
92  return(DCReaderGRIB::GetTSUserTime(ts));
93  };
94 
95  virtual void _GetTSUserTimeStamp(size_t ts, string &s) const {
97  }
98 
99  virtual int _VariableExists(
100  size_t ts,
101  const char *varname,
102  int reflevel = 0,
103  int lod = 0
104  ) const {
105  return (DCReaderGRIB::VariableExists(ts,varname));
106  };
107 
108 
109  virtual int _OpenVariableRead(
110  size_t timestep,
111  const char *varname,
112  int,
113  int
114  ) {
115  return(DCReaderGRIB::OpenVariableRead(timestep, varname));
116  };
117 
118  virtual const float *_GetDataRange() const {
119  return(NULL); // Not implemented. Let DataMgr figure it out
120  }
121 
122  virtual void _GetValidRegion(
123  size_t min[3], size_t max[3], int
124  ) const {
125  size_t dim[3]; DCReaderGRIB::GetGridDim(dim);
126  min[0] = min[1] = min[2] = 0;
127  max[0] = dim[0]-1; max[1] = dim[1]-1; max[2] = dim[2]-1;
128  };
129 
130  virtual bool _GetMissingValue(string varname, float &value) const {
131  return(DCReaderGRIB::GetMissingValue(varname, value));
132  };
133 
134 
135  virtual int _BlockReadRegion(
136  const size_t *, const size_t *, float *region
137  ) {
138  return(DCReaderGRIB::Read(region));
139  };
140 
141  virtual int _CloseVariable() {
142  return (DCReaderGRIB::CloseVariable());
143  };
144 
145 };
146 
147 };
148 
149 #endif // _DataMgrGRIB_h_
virtual double _GetTSUserTime(size_t ts) const
Definition: DataMgrGRIB.h:91
virtual std::string GetMapProjection() const
virtual vector< double > _GetExtents(size_t) const
Definition: DataMgrGRIB.h:55
virtual vector< string > _GetVariables2DYZ() const
Definition: DataMgrGRIB.h:79
#define VDF_API
Definition: common.h:61
virtual bool GetMissingValue(std::string varname, float &value) const
Definition: Metadata.h:336
A cache based data reader.
Definition: DataMgr.h:39
virtual bool VariableExists(size_t ts, string varname, int reflevel=0, int lod=0) const
virtual double GetTSUserTime(size_t ts) const
Definition: DCReaderGRIB.h:75
virtual int _VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
Definition: DataMgrGRIB.h:99
virtual void _GetTSUserTimeStamp(size_t ts, string &s) const
Definition: DataMgrGRIB.h:95
virtual int _GetNumTransforms() const
Definition: DataMgrGRIB.h:47
virtual long _GetNumTimeSteps() const
Definition: DataMgrGRIB.h:59
virtual void _GetBlockSize(size_t bs[3], int reflevel) const
Definition: DataMgrGRIB.h:43
virtual vector< long > _GetPeriodicBoundary() const
Definition: DataMgrGRIB.h:83
virtual void _GetDim(size_t dim[3], int) const
Definition: DataMgrGRIB.h:39
virtual int CloseVariable()
Definition: DCReaderGRIB.h:60
virtual std::vector< double > GetExtents(size_t ts=0) const
Definition: DCReaderGRIB.h:87
virtual std::vector< string > GetVariables2DXY() const
virtual int _OpenVariableRead(size_t timestep, const char *varname, int, int)
Definition: DataMgrGRIB.h:109
virtual void GetTSUserTimeStamp(size_t ts, std::string &s) const
virtual void GetGridDim(size_t dim[3]) const
virtual vector< string > _GetVariables3D() const
Definition: DataMgrGRIB.h:67
virtual string _GetGridType() const
Definition: DataMgrGRIB.h:51
virtual vector< string > _GetVariables2DXZ() const
Definition: DataMgrGRIB.h:75
virtual string _GetMapProjection() const
Definition: DataMgrGRIB.h:63
virtual int OpenVariableRead(size_t timestep, string varname, int reflevel=0, int lod=0)
virtual const float * _GetDataRange() const
Definition: DataMgrGRIB.h:118
virtual ~DataMgrGRIB()
Definition: DataMgrGRIB.h:30
virtual std::vector< long > GetPeriodicBoundary() const
virtual void _GetValidRegion(size_t min[3], size_t max[3], int) const
Definition: DataMgrGRIB.h:122
virtual std::vector< string > GetVariables2DYZ() const
Definition: DCReaderGRIB.h:78
virtual vector< string > _GetVariables2DXY() const
Definition: DataMgrGRIB.h:71
virtual bool _GetMissingValue(string varname, float &value) const
Definition: DataMgrGRIB.h:130
virtual vector< long > _GetGridPermutation() const
Definition: DataMgrGRIB.h:87
string GetGridType() const
virtual int Read(float *values)
virtual long GetNumTimeSteps() const
virtual std::vector< string > GetVariables2DXZ() const
Definition: DCReaderGRIB.h:76
A cache based data reader.
Definition: DataMgrGRIB.h:20
virtual int _BlockReadRegion(const size_t *, const size_t *, float *region)
Definition: DataMgrGRIB.h:135
virtual std::vector< long > GetGridPermutation() const
virtual std::vector< string > GetVariables3D() const
virtual int _CloseVariable()
Definition: DataMgrGRIB.h:141