VAPoR  0.1
DataMgrICON.h
Go to the documentation of this file.
1 #ifndef ICONDataMg_h
2 #define ICONDataMg_h
3 
4 #include <cstdlib>
5 #include <cstdio>
6 #include <list>
7 #include <map>
8 #include <string>
9 #include <vector>
10 #include <iostream>
11 
12 #ifdef _OPENMP
13 #include <omp.h>
14 #endif
15 
16 #include <limits>
17 
18 #include <vapor/MyBase.h>
19 #include <vapor/DataMgr.h>
20 #include <vapor/common.h>
21 
22 using namespace std;
23 
24 struct kdtree;
25 
26 namespace VAPoR {
27 
28 
29 class VDF_API DataMgrICON : public DataMgr {
30 
31 public:
32 
33  DataMgrICON( const vector <string> &files, size_t mem_size );
34  virtual ~DataMgrICON();
35 
36 protected:
37 
38  virtual int Initialize(const char *files);
39  virtual string _GetGridType() const { return("regular"); }
40  virtual int _GetNumTransforms() const { return(0); };
41  virtual long _GetNumTimeSteps() const { return(this->NumberOfTimeSteps); };
42  virtual string _GetMapProjection() const {string empty; return (empty); };
43  virtual void _GetBlockSize(size_t bs[3], int reflevel) const;
44  virtual vector <string> _GetVariables3D() const;
45  virtual vector <string> _GetVariables2DXY() const;
46  virtual vector <string> _GetVariables2DXZ() const {vector <string> empty; return (empty); };
47  virtual vector <string> _GetVariables2DYZ() const {vector <string> empty; return (empty); };
48  virtual int _OpenVariableRead( size_t timestep, const char *varname, int, int);
49  virtual bool _GetMissingValue(string varname, float &value) const { value=this->missing_value; return(true);};
50  virtual int _CloseVariable() {return (1);};
51  virtual vector<double> _GetExtents(size_t ts) const;
52  virtual vector<long> _GetPeriodicBoundary() const { return(bool_false); };
53  virtual vector<long> _GetGridPermutation() const { return(bool_false); };
54  virtual const float *_GetDataRange() const;
55  virtual void _GetDim(size_t dim[3], int ) const;
56  virtual void _GetValidRegion( size_t min[3], size_t max[3], int) const;
57  virtual int _BlockReadRegion( const size_t *, const size_t *, float *region);
58 
59  virtual double _GetTSUserTime(size_t ts) const { return(0); };
60  virtual void _GetTSUserTimeStamp(size_t ts, string &s) const { }
61  virtual int _VariableExists( size_t ts, const char *varname, int reflevel = 0, int lod = 0 ) const { return (1); };
62 
63 private:
64 
65  int GetDims();
66  int GetVars();
67  void Remove_Duplicates(double * PointLon, double * PointLat, int temp_nbr_vertices, int * vertexID, int * nbr_cells);
68  void ResampleDataCell(const int width, const int height, float *data);
69  void ResampleDataPoint(const int width, const int height, float *data);
70  void findBoundingBox(double *bb_lon, double *bb_lat, double points[6]);
71  int CreateLandSeaMask();
72  int ConstructGridGeometry();
73  int CreateKdTree();
74  int XYSize();
75 
76  double* CellVar;
77  int *LandSeaMaskCell, *LandSeaMaskPoint;
78  double diff_cv;
79  int reg_res_x, reg_res_y;
80  double oversampling;
81  double missing_value;
82  bool activeVar3D;
83  bool point_var;
84  double clon_range[2], clat_range[2], vlon_range[2], vlat_range[2];
85  int NumberOfTimeSteps;
86 
87  int NumberOfCellVars;
88  int NumberOfPointVars;
89  int NumberOfVertLevels;
90  int NumberOfCells;
91  int NumberOfPoints;
92  int PointsPerCell;
93  bool interpolation;
94  std::vector<long> bool_false;
95 
96  int* vertexID;
97  double* PointX;
98  double* PointY;
99  double* CellX;
100  double* CellY;
101  int *CellIndex, *PointIndex;
102  kdtree *CellTree, *PointTree;
103 
104  int streamID;
105  int vlistID;
106  int gridID;
107  int zaxisID;
108  int surfID;
109 
110  class Internal;
111  Internal *Internals;
112 
113  float range[2];
114 };
115 
116 };
117 #endif
virtual string _GetGridType() const
Definition: DataMgrICON.h:39
#define VDF_API
Definition: common.h:61
virtual string _GetMapProjection() const
Definition: DataMgrICON.h:42
virtual int _CloseVariable()
Definition: DataMgrICON.h:50
A cache based data reader.
Definition: DataMgr.h:39
virtual int _VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
Definition: DataMgrICON.h:61
virtual void _GetTSUserTimeStamp(size_t ts, string &s) const
Definition: DataMgrICON.h:60
virtual vector< string > _GetVariables2DXZ() const
Definition: DataMgrICON.h:46
virtual vector< long > _GetPeriodicBoundary() const
Definition: DataMgrICON.h:52
virtual double _GetTSUserTime(size_t ts) const
Definition: DataMgrICON.h:59
virtual bool _GetMissingValue(string varname, float &value) const
Definition: DataMgrICON.h:49
virtual vector< long > _GetGridPermutation() const
Definition: DataMgrICON.h:53
virtual long _GetNumTimeSteps() const
Definition: DataMgrICON.h:41
virtual vector< string > _GetVariables2DYZ() const
Definition: DataMgrICON.h:47
virtual int _GetNumTransforms() const
Definition: DataMgrICON.h:40