6 #ifndef _DCReaderMOM_h_
7 #define _DCReaderMOM_h_
11 #include <vapor/NetCDFCFCollection.h>
12 #include <vapor/DCReaderNCDF.h>
13 #include <vapor/WeightTable.h>
15 #pragma warning(disable : 4251)
37 for (
int i=0; i<3; i++) dim[i] = _dims[i];
47 return(_vertCoordinates);
50 virtual std::vector <double>
GetExtents(
size_t ts = 0)
const {
51 return(_cartesianExtents);
55 return(_ncdfc->GetNumTimeSteps());
58 virtual string GetMapProjection()
const;
70 std::vector <string> empty;
return(empty);
74 std::vector <string> empty;
return(empty);
78 return(_vars3dExcluded);
82 return(_vars2dExcluded);
93 v.push_back(
"NONE"); v.push_back(
"NONE"); v.push_back(
"NONE");
103 p.push_back(0); p.push_back(0); p.push_back(0);
109 p.push_back(0); p.push_back(1); p.push_back(2);
113 double GetTSUserTime(
size_t ts)
const ;
115 bool GetMissingValue(
string varname,
float &value)
const;
117 void GetTSUserTimeStamp(
size_t ts,
string &s)
const;
119 virtual bool IsCoordinateVariable(
string varname)
const;
122 virtual int OpenVariableRead(
123 size_t timestep,
string varname,
int reflevel=0,
int lod=0
126 virtual int CloseVariable();
128 virtual int ReadSlice(
float *slice);
130 virtual int Read(
float *data);
132 virtual bool VariableExists(
size_t ts,
string varname,
int i0=0,
int i1=0)
const {
133 if (IsVariableDerived(varname))
return (
true);
134 return(_ncdfc->VariableExists(ts, varname));
138 return(find(_varsDerived.begin(), _varsDerived.end(), varname) != _varsDerived.end());
142 size_t ts,
double lon_exts[2],
double lat_exts[2]
144 lon_exts[0] = _lonExts[0]; lon_exts[1] = _lonExts[1];
145 lat_exts[0] = _latExts[0]; lat_exts[1] = _latExts[1];
149 std::vector <size_t> _dims;
152 std::vector <double> _vertCoordinates;
153 std::vector <double> _cartesianExtents;
154 std::vector <string> _vars3d;
155 std::vector <string> _vars2dXY;
156 std::vector <string> _vars3dExcluded;
157 std::vector <string> _vars2dExcluded;
158 std::vector <string> _varsDerived;
159 std::map <string, WeightTable *> _weightTableMap;
160 std::map <string, string> _varsLatLonMap;
167 std::vector <string> _latCVs;
168 std::vector <string> _lonCVs;
188 void _encodeLatLon(
string latcv,
string loncv,
string &key)
const;
189 void _decodeLatLon(
string key,
string &latcv,
string &loncv)
const;
192 NetCDFCFCollection *ncdfc,
string latvar,
string lonvar,
193 DCReaderMOM::latLonBuf &llb
196 void _getRotationVariables(
197 const std::map <string, WeightTable *> _weightTableMap,
198 float *_angleRADBuf,
float *_latDEGBuf
201 std::vector <size_t> _GetSpatialDims(
202 NetCDFCFCollection *ncdfc,
string varname
205 int _InitCoordVars(NetCDFCFCollection *ncdfc);
207 void _ParseCoordVarNames(
208 NetCDFCFCollection *ncdfc,
const vector <string> &cvars,
209 string &timecv,
string &vertcv,
string &latcv,
string &loncv
213 int _InitVerticalCoordinates(
214 NetCDFCFCollection *ncdfc,
216 vector <double> &vertCoords
219 void _InitDimensions(
220 NetCDFCFCollection *ncdfc,
221 vector <size_t> &dims,
222 vector <string> &vars3d,
223 vector <string> &vars2dxy
231 int _InitCartographicExtents(
233 const double lonExts[2],
234 const double latExts[2],
235 const std::vector <double> vertCoordinates,
236 std::vector <double> &extents
239 float *_get_2d_var(NetCDFCFCollection *ncdfc,
size_t ts,
string name)
const;
240 float *_get_1d_var(NetCDFCFCollection *ncdfc,
size_t ts,
string name)
const;
247 #endif // _DCReaderMOM_h_
virtual std::vector< long > GetGridPermutation() const
virtual std::vector< double > GetTSZCoords(size_t) const
virtual std::vector< double > GetExtents(size_t ts=0) const
virtual bool VariableExists(size_t ts, string varname, int i0=0, int i1=0) const
long GetNumTimeSteps() const
Wrapper for a collection of netCDF files.
virtual void GetLatLonExtents(size_t ts, double lon_exts[2], double lat_exts[2]) const
virtual std::vector< string > GetVariables2DXY() const
void GetBlockSize(size_t bs[3], int) const
virtual std::vector< string > GetVariables2DExcluded() const
virtual std::vector< string > GetCoordinateVariables() const
virtual bool IsVariableDerived(string varname) const
virtual string GetGridType() const
virtual std::vector< string > GetVariables3D() const
virtual std::vector< string > GetVariables3DExcluded() const
virtual void GetGridDim(size_t dim[3]) const
virtual std::vector< long > GetPeriodicBoundary() const
virtual std::vector< string > GetVariables2DYZ() const
virtual std::vector< string > GetVariables2DXZ() const