18 #include <vapor/MyBase.h>
19 #include <vapor/DataMgr.h>
20 #include <vapor/common.h>
21 #include <vapor/NetCDFCollection.h>
34 DataMgrMPAS(
const vector <string> &files,
size_t mem_size );
39 virtual int Initialize(vector <string> files);
44 virtual void _GetBlockSize(
size_t bs[3],
int reflevel)
const;
45 virtual vector <string> _GetVariables3D()
const;
46 virtual vector <string> _GetVariables2DXY()
const;
47 virtual vector <string>
_GetVariables2DXZ()
const {vector <string> empty;
return (empty); };
48 virtual vector <string>
_GetVariables2DYZ()
const {vector <string> empty;
return (empty); };
49 virtual int _OpenVariableRead(
size_t timestep,
const char *varname,
int,
int);
51 value=_missing_value;
return(_has_missing);
54 virtual vector<double> _GetExtents(
size_t ts)
const;
58 virtual void _GetDim(
size_t dim[3],
int )
const;
59 virtual void _GetValidRegion(
size_t min[3],
size_t max[3],
int)
const;
60 virtual int _BlockReadRegion(
const size_t *,
const size_t *,
float *region);
64 virtual int _VariableExists(
size_t ts,
const char *varname,
int reflevel = 0,
int lod = 0 )
const {
return (1); };
68 enum var_type_t {CELL, VERT, EDGE};
72 bool GetVars(
string cellDimName,
string pointDimName,
string edgeDimName);
73 void ResampleDataCell(
const int width,
const int height,
float *data);
74 void _resampleDataCell(
const int width,
const int height,
float *data);
75 void _resampleDataPoint(
76 const int width,
const int height,
77 const float *resampleWeights,
const int *resampleIds,
float *data
79 int ConstructGridGeometry();
80 void _constructCellResampleWeights(
81 const int *cellsOnVertex,
const int *vertsOnCell,
82 const int *nVertsOnCell,
83 float *cellResampleWeights,
int *cellResampleIds
85 void _constructPointResampleWeights(
86 const int *vertsOnCell,
const int *nVertsOnCell,
87 const double *pointLons,
const double *pointLats,
int nLatLons,
88 float *pointResampleWeights,
int *pointResampleIds
91 void _constructEdgeResampleWeights(
92 const int *edgesOnCell,
const int *nEdgesOnCell,
const int *verticesOnEdge,
93 const double *vertLons,
const double *vertLats,
int nLatLons,
94 float *edgeResampleWeights,
int *edgeResampleIds
97 int _constructResampleWeights();
101 bool _barycentricCoordsForCell(
102 const vector <int> &vertList,
int cellid,
const double pt[2],
103 const double *pointLons,
const double *pointLats,
int nLatLons,
104 float *lambda,
int *vertIds
107 bool _barycentricCoordsForTriangle(
108 const int *cellsOnVertex,
int pointid,
int copid,
const double pt[2],
109 float *lambda,
int cellIds[3],
int &n
112 NetCDFCollection _ncCollection;
115 float *_cellResampleWeights;
116 int *_cellResampleIds;
117 float *_pointResampleWeights;
118 int *_pointResampleIds;
119 float *_edgeResampleWeights;
120 int *_edgeResampleIds;
121 int _reg_res_x, _reg_res_y;
122 double _oversampling;
123 double _missing_value;
127 var_type_t _var_type;
128 std::vector<long> _bool_false;
130 string _vertices_name;
132 string _vertexdegree_name;
133 string _maxedges_name;
135 string _vertlevels_name;
136 string _vertlevelsP1_name;
137 double _clon_range[2], _clat_range[2], _vlon_range[2], _vlat_range[2];
138 double _elon_range[2], _elat_range[2];
139 double _lon_range[2], _lat_range[2];
140 double _lon_rangePCS[2], _lat_rangePCS[2];
141 int _numberOfTimeSteps;
143 int _numberOfVertLevels;
144 int _numberOfVertLevelsP1;
162 std::vector <string> _cellVars;
163 std::vector <string> _pointVars;
164 std::vector <string> _edgeVars;
virtual vector< long > _GetPeriodicBoundary() const
virtual vector< long > _GetGridPermutation() const
A cache based data reader.
virtual const float * _GetDataRange() const
virtual vector< string > _GetVariables2DXZ() const
virtual int _GetNumTransforms() const
virtual double _GetTSUserTime(size_t ts) const
virtual bool _GetMissingValue(string varname, float &value) const
virtual string _GetGridType() const
virtual string _GetMapProjection() const
virtual int _VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
virtual int _CloseVariable()
virtual void _GetTSUserTimeStamp(size_t ts, string &s) const
virtual vector< string > _GetVariables2DYZ() const
virtual long _GetNumTimeSteps() const