6 #ifndef _DCReaderWRF_h_
7 #define _DCReaderWRF_h_
11 #include <vapor/DCReader.h>
12 #include <vapor/NetCDFCollection.h>
13 #include <vapor/common.h>
14 #include <vapor/Proj4API.h>
17 #pragma warning(disable : 4251)
40 for (
int i=0; i<3; i++) dim[i] = _dims[i];
51 virtual std::vector <double> GetExtents(
size_t ts = 0)
const;
54 return(_ncdfc->GetNumTimeSteps());
71 std::vector <string> empty;
return(empty);
75 std::vector <string> empty;
return(empty);
79 return(_vars3dExcluded);
83 return(_vars2dExcluded);
94 v.push_back(
"NONE"); v.push_back(
"NONE"); v.push_back(
"ELEVATION");
104 p.push_back(0); p.push_back(0); p.push_back(0);
110 p.push_back(0); p.push_back(1); p.push_back(2);
114 double GetTSUserTime(
size_t ts)
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 ts = _timeLookup[ts];
138 return(_ncdfc->VariableExists(ts, varname));
143 _timeBias = 978307200.0;
147 size_t ts,
double lon_exts[2],
double lat_exts[2]
150 ts = _timeLookup[ts];
151 (void) _GetLatLonExtentsCorners(
152 _ncdfc, ts, lon_exts, lat_exts, dummy, dummy
164 virtual ~DerivedVarElevation();
166 virtual int Open(
size_t ts);
167 virtual int ReadSlice(
float *slice,
int );
168 virtual int Read(
float *buf,
int );
169 virtual int SeekSlice(
int offset,
int whence,
int );
170 virtual int Close(
int fd);
171 virtual bool TimeVarying()
const {
return(
true); };
172 virtual std::vector <size_t> GetSpatialDims()
const {
return(_dims); }
173 virtual std::vector <string> GetSpatialDimNames()
const {
return(_dimnames); }
174 virtual size_t GetTimeDim()
const {
return(_num_ts); }
175 virtual string GetTimeDimName()
const {
return(
"Time"); };
176 virtual bool GetMissingValue(
double &mv)
const {mv=0.0;
return(
false); }
179 std::vector <size_t> _dims;
180 std::vector <string> _dimnames;
194 std::vector <size_t> _dims;
195 std::vector <string> _vars3d;
196 std::vector <string> _vars2dXY;
197 std::vector <string> _vars3dExcluded;
198 std::vector <string> _vars2dExcluded;
199 std::vector <string> _timeStamps;
200 std::vector <double> _times;
201 std::vector <size_t> _timeLookup;
202 NetCDFCollection *_ncdfc;
215 float _days_per_year;
218 DerivedVarElevation *_elev;
222 std::vector <size_t> _GetSpatialDims(
223 NetCDFCollection *ncdfc,
string varname
225 std::vector <string> _GetSpatialDimNames(
226 NetCDFCollection *ncdfc,
string varname
230 int _InitAtts(NetCDFCollection *ncdfc);
231 int _InitProjection(NetCDFCollection *ncdfc,
float radius);
232 int _InitDimensions(NetCDFCollection *ncdfc);
233 int _InitVerticalCoordinates(NetCDFCollection *ncdfc);
234 int _InitTime(NetCDFCollection *ncdfc);
235 int _InitVars(NetCDFCollection *ncdfc);
237 int _GetVerticalExtents(
238 NetCDFCollection *ncdfc,
size_t ts,
double height[2]
241 int _GetLatLonExtentsCorners(
242 NetCDFCollection *ncdfc,
243 size_t ts,
double lon_exts[2],
double lat_exts[2],
244 double lon_corners[4],
double lat_corners[4]
251 #endif // _DCReaderWRF_h_
virtual std::vector< long > GetPeriodicBoundary() const
virtual void GetGridDim(size_t dim[3]) const
virtual std::vector< string > GetVariables2DXY() const
bool GetMissingValue(string varname, float &value) const
virtual std::vector< string > GetVariables2DYZ() const
void GetBlockSize(size_t bs[3], int) const
void EnableLegacyTimeConversion()
virtual bool VariableExists(size_t ts, string varname, int i0=0, int i1=0) const
long GetNumTimeSteps() const
virtual std::vector< string > GetVariables2DXZ() const
virtual string GetMapProjection() const
virtual void GetLatLonExtents(size_t ts, double lon_exts[2], double lat_exts[2]) const
virtual std::vector< long > GetGridPermutation() const
virtual std::vector< string > GetVariables2DExcluded() const
virtual string GetGridType() const
virtual std::vector< string > GetVariables3D() const
virtual std::vector< string > GetVariables3DExcluded() const
Wrapper for a collection of netCDF files.
virtual std::vector< string > GetCoordinateVariables() const