6 #ifndef _DCReaderROMS_h_
7 #define _DCReaderROMS_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];
45 if (_vertCVs.size())
return(
"layered");
46 else return(
"regular");
50 return(_vertCoordinates);
53 virtual std::vector <double>
GetExtents(
size_t ts = 0)
const {
54 return(_cartesianExtents);
59 return((
long) _ncdfc->GetNumTimeSteps());
62 virtual string GetMapProjection()
const;
74 std::vector <string> empty;
return(empty);
78 std::vector <string> empty;
return(empty);
82 return(_vars3dExcluded);
86 return(_vars2dExcluded);
97 v.push_back(
"NONE"); v.push_back(
"NONE"); v.push_back(
"NONE");
107 p.push_back(0); p.push_back(0); p.push_back(0);
113 p.push_back(0); p.push_back(1); p.push_back(2);
117 double GetTSUserTime(
size_t ts)
const ;
119 bool GetMissingValue(
string varname,
float &value)
const;
121 void GetTSUserTimeStamp(
size_t ts,
string &s)
const;
123 virtual bool IsCoordinateVariable(
string varname)
const;
126 virtual int OpenVariableRead(
127 size_t timestep,
string varname,
int reflevel=0,
int lod=0
130 virtual int CloseVariable();
132 virtual int ReadSlice(
float *slice);
134 virtual int Read(
float *data);
136 virtual bool VariableExists(
size_t ts,
string varname,
int i0=0,
int i1=0)
const {
137 if (IsVariableDerived(varname))
return (
true);
138 return(_ncdfc->VariableExists(ts, varname));
142 return(find(_varsDerived.begin(), _varsDerived.end(), varname) != _varsDerived.end());
146 size_t ts,
double lon_exts[2],
double lat_exts[2]
148 lon_exts[0] = _lonExts[0]; lon_exts[1] = _lonExts[1];
149 lat_exts[0] = _latExts[0]; lat_exts[1] = _latExts[1];
153 std::vector <size_t> _dims;
156 std::vector <double> _vertCoordinates;
157 std::vector <double> _cartesianExtents;
158 std::vector <string> _vars3d;
159 std::vector <string> _vars2dXY;
160 std::vector <string> _vars3dExcluded;
161 std::vector <string> _vars2dExcluded;
162 std::vector <string> _varsDerived;
164 std::map <string, string> _varsLatLonMap;
170 std::vector <string> _latCVs;
171 std::vector <string> _lonCVs;
172 std::vector <string> _vertCVs;
177 size_t _dataReversed;
191 NetCDFCFCollection *ncdfc,
string latvar,
string lonvar,
192 DCReaderROMS::latLonBuf &llb
195 void _getRotationVariables(
196 WeightTable * wt,
float *_angleRADBuf,
float *_latDEGBuf
199 std::vector <size_t> _GetSpatialDims(
200 NetCDFCFCollection *ncdfc,
string varname
202 std::vector <string> _GetSpatialDimNames(
203 NetCDFCFCollection *ncdfc,
string varname
206 int _InitCoordVars(NetCDFCFCollection *ncdfc);
208 void _ParseCoordVarNames(
209 NetCDFCFCollection *ncdfc,
const vector <string> &cvars,
210 string &timecv,
string &vertcv,
string &latcv,
string &loncv
214 int _InitVerticalCoordinates(
215 NetCDFCFCollection *ncdfc,
216 const std::vector <string> &cvars, std::vector <double> &vertCoords
219 void _InitDimensions(
220 NetCDFCFCollection *ncdfc,
221 vector <size_t> &dims,
222 vector <string> &vars3d,
223 vector <string> &vars2dxy
230 int _InitCartographicExtents(
232 const double lonExts[2],
233 const double latExts[2],
234 const std::vector <double> vertCoordinates,
235 std::vector <double> &extents
238 float *_get_2d_var(NetCDFCFCollection *ncdfc,
size_t ts,
string name)
const;
239 float *_get_1d_var(NetCDFCFCollection *ncdfc,
size_t ts,
string name)
const;
246 #endif // _DCReaderROMS_h_
virtual void GetGridDim(size_t dim[3]) const
void GetBlockSize(size_t bs[3], int) const
long GetNumTimeSteps() const
virtual std::vector< string > GetVariables2DExcluded() const
virtual std::vector< double > GetTSZCoords(size_t) const
virtual std::vector< string > GetVariables2DYZ() const
Wrapper for a collection of netCDF files.
virtual string GetGridType() const
virtual std::vector< string > GetCoordinateVariables() const
virtual void GetLatLonExtents(size_t ts, double lon_exts[2], double lat_exts[2]) const
virtual std::vector< double > GetExtents(size_t ts=0) const
virtual std::vector< long > GetGridPermutation() const
virtual std::vector< string > GetVariables2DXZ() const
virtual std::vector< string > GetVariables3D() const
virtual bool VariableExists(size_t ts, string varname, int i0=0, int i1=0) const
virtual bool IsVariableDerived(string varname) const
virtual std::vector< long > GetPeriodicBoundary() const
virtual std::vector< string > GetVariables2DXY() const
virtual std::vector< string > GetVariables3DExcluded() const