VAPoR  0.1
DataMgrWRF.h
Go to the documentation of this file.
1 #include <vector>
2 #include <string>
3 #include <vapor/DCReaderWRF.h>
4 #include <vapor/DataMgr.h>
5 #include <vapor/common.h>
6 
7 #ifndef _DataMgrWRF
8 #define _DataMgrWRF
9 
10 namespace VAPoR {
11 
12 //
19 //
21 
22 public:
23 
24  DataMgrWRF(
25  const vector <string> &files,
26  size_t mem_size
27  );
28 
29 
30  virtual ~DataMgrWRF() { };
31 
32 protected:
33 
34 
35  //
36  // Metadata methods
37  //
38 
39  virtual void _GetDim(size_t dim[3], int ) const {
40  return(DCReaderWRF::GetGridDim(dim));
41  };
42 
43  virtual void _GetBlockSize(size_t bs[3], int reflevel) const {
44  return(DCReaderWRF::GetGridDim(bs));
45  }
46 
47  virtual int _GetNumTransforms() const {
48  return(0);
49  };
50 
51  virtual string _GetGridType() const {
52  return(DCReaderWRF::GetGridType());
53  }
54 
55  virtual vector<double> _GetExtents(size_t ts) const {
56  return(DCReaderWRF::GetExtents(ts));
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(DCReaderWRF::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 (DCReaderWRF::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(DCReaderWRF::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]; DCReaderWRF::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(DCReaderWRF::GetMissingValue(varname, value));
132  };
133 
134 
135  virtual int _BlockReadRegion(
136  const size_t *, const size_t *, float *region
137  ) {
138  return(DCReaderWRF::Read(region));
139  };
140 
141  virtual int _CloseVariable() {
142  return (DCReaderWRF::CloseVariable());
143  };
144 
145 };
146 
147 };
148 
149 #endif // _DataMgrWRF_h_
virtual vector< long > _GetGridPermutation() const
Definition: DataMgrWRF.h:87
virtual std::vector< long > GetPeriodicBoundary() const
Definition: DCReaderWRF.h:102
virtual int _CloseVariable()
Definition: DataMgrWRF.h:141
virtual long _GetNumTimeSteps() const
Definition: DataMgrWRF.h:59
virtual void GetGridDim(size_t dim[3]) const
Definition: DCReaderWRF.h:39
#define VDF_API
Definition: common.h:61
virtual std::vector< string > GetVariables2DXY() const
Definition: DCReaderWRF.h:65
A cache based data reader.
Definition: DataMgr.h:39
virtual void _GetBlockSize(size_t bs[3], int reflevel) const
Definition: DataMgrWRF.h:43
virtual string _GetMapProjection() const
Definition: DataMgrWRF.h:63
bool GetMissingValue(string varname, float &value) const
Definition: DCReaderWRF.h:116
virtual std::vector< string > GetVariables2DYZ() const
Definition: DCReaderWRF.h:74
A cache based data reader.
Definition: DataMgrWRF.h:20
virtual int _OpenVariableRead(size_t timestep, const char *varname, int, int)
Definition: DataMgrWRF.h:109
virtual bool VariableExists(size_t ts, string varname, int i0=0, int i1=0) const
Definition: DCReaderWRF.h:136
virtual ~DataMgrWRF()
Definition: DataMgrWRF.h:30
virtual int _VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
Definition: DataMgrWRF.h:99
virtual std::vector< double > GetExtents(size_t ts=0) const
virtual void _GetDim(size_t dim[3], int) const
Definition: DataMgrWRF.h:39
virtual string _GetGridType() const
Definition: DataMgrWRF.h:51
long GetNumTimeSteps() const
Definition: DCReaderWRF.h:53
virtual vector< string > _GetVariables2DXZ() const
Definition: DataMgrWRF.h:75
virtual int Read(float *data)
virtual double _GetTSUserTime(size_t ts) const
Definition: DataMgrWRF.h:91
virtual std::vector< string > GetVariables2DXZ() const
Definition: DCReaderWRF.h:70
virtual string GetMapProjection() const
Definition: DCReaderWRF.h:57
virtual vector< long > _GetPeriodicBoundary() const
Definition: DataMgrWRF.h:83
virtual int OpenVariableRead(size_t timestep, string varname, int reflevel=0, int lod=0)
virtual void _GetTSUserTimeStamp(size_t ts, string &s) const
Definition: DataMgrWRF.h:95
virtual vector< string > _GetVariables3D() const
Definition: DataMgrWRF.h:67
virtual vector< double > _GetExtents(size_t ts) const
Definition: DataMgrWRF.h:55
double GetTSUserTime(size_t ts) const
virtual vector< string > _GetVariables2DYZ() const
Definition: DataMgrWRF.h:79
virtual std::vector< long > GetGridPermutation() const
Definition: DCReaderWRF.h:108
void GetTSUserTimeStamp(size_t ts, string &s) const
virtual int CloseVariable()
virtual bool _GetMissingValue(string varname, float &value) const
Definition: DataMgrWRF.h:130
virtual int _BlockReadRegion(const size_t *, const size_t *, float *region)
Definition: DataMgrWRF.h:135
virtual string GetGridType() const
Definition: DCReaderWRF.h:47
virtual vector< string > _GetVariables2DXY() const
Definition: DataMgrWRF.h:71
virtual std::vector< string > GetVariables3D() const
Definition: DCReaderWRF.h:61
virtual int _GetNumTransforms() const
Definition: DataMgrWRF.h:47
virtual void _GetValidRegion(size_t min[3], size_t max[3], int) const
Definition: DataMgrWRF.h:122
virtual const float * _GetDataRange() const
Definition: DataMgrWRF.h:118