VAPOR3 3.9.4
DataMgrUtils.h
Go to the documentation of this file.
1//************************************************************************
2// *
3// Copyright (C) 2017 *
4// University Corporation for Atmospheric Research *
5// All Rights Reserved *
6// *
7//************************************************************************/
8//
9// File: DataMgrUtils.h
10//
11// Author: John Clyne
12// National Center for Atmospheric Research
13// PO 3000, Boulder, Colorado
14//
15// Date: February 2017
16//
17// Description: Defines the DataMgrUtils free functions.
18//
19// These functions operate on instances of the DataMgr class.
20//
21#ifndef DATAMGRUTILS_H
22#define DATAMGRUTILS_H
23
24#include <vector>
25#include <string>
26#include <map>
27#include <vapor/DataMgr.h>
28
29namespace VAPoR {
30namespace DataMgrUtils {
31
45//
46VDF_API bool MaxXFormPresent(const DataMgr *dataMgr, size_t timestep, string varname, size_t &maxXForm);
47
61//
62VDF_API bool MaxLODPresent(const DataMgr *dataMgr, size_t timestep, string varname, size_t &maxLOD);
63
76VDF_API int ConvertPCSToLonLat(const DataMgr *dataMgr, double coords[], int npoints = 1);
77
78VDF_API int ConvertPCSToLonLat(string projString, double coords[], int npoints = 1);
79
94VDF_API int ConvertLonLatToPCS(const DataMgr *dataMgr, double coords[], int npoints = 1);
95
96VDF_API int ConvertLonLatToPCS(string projString, double coords[], int npoints = 1);
97
121//
122template<typename T>
123VDF_API int GetGrids(DataMgr *dataMgr, size_t ts, const vector<string> &varnames, const T &minExtsReq, const T &maxExtsReq, bool useLowerAccuracy, int *refLevel, int *lod, std::vector<Grid *> &grids,
124 bool lock = false);
125
126VDF_API int GetGrids(DataMgr *dataMgr, size_t ts, string varname, const CoordType &minExtsReq, const CoordType &maxExtsReq, bool useLowerAccuracy, int *refLevel, int *lod, Grid **gridptr,
127 bool lock = false);
128
129VDF_API int GetGrids(DataMgr *dataMgr, size_t ts, string varname, const DimsType &minExtsReq, const DimsType &maxExtsReq, bool useLowerAccuracy, int *refLevel, int *lod, Grid **gridptr,
130 bool lock = false);
131
132VDF_API int GetGrids(DataMgr *dataMgr, size_t ts, const vector<string> &varnames, bool useLowerAccuracy, int *refLevel, int *lod, std::vector<Grid *> &grids, bool lock = false);
133
134VDF_API int GetGrids(DataMgr *dataMgr, size_t ts, string varname, bool useLowerAccuracy, int *refLevel, int *lod, Grid **gridptr, bool lock = false);
135
136VDF_API void UnlockGrids(DataMgr *dataMgr, const std::vector<Grid *> &grids);
137
148bool GetAxes(const DataMgr *dataMgr, string varname, vector<int> &axes);
149
173//
174VDF_API bool GetExtents(DataMgr *dataMgr, size_t timestep, string varname, int refLevel, int lod, CoordType &minExts, CoordType &maxExts);
175
198//
199VDF_API bool GetExtents(DataMgr *dataMgr, size_t timestep, const vector<string> &varnames, int refLevel, int lod, CoordType &minExts, CoordType &maxExts, vector<int> &axes);
200
202VDF_API int GetDefaultMetaInfoStride(DataMgr *dataMgr, std::string varname, int refinementLevel);
203
208VDF_API double Get2DRendererDefaultZ(DataMgr *dataMgr, size_t ts, int refLevel, int lod);
209
225//
226VDF_API bool GetFirstExistingVariable(DataMgr *dataMgr, int level, int lod, int ndim, string &varname, size_t &ts);
227
243//
244VDF_API bool GetFirstExistingVariable(DataMgr *dataMgr, size_t ts, int level, int lod, int ndim, string &varname);
245
246#ifdef VAPOR3_0_0_ALPHA
247
254double getVoxelSize(size_t timestep, string varname, int refLevel, int dir);
255
258int getNumActiveVariables3D() { return _dataMgr->GetDataVarNames(3).size(); }
261int getNumActiveVariables2D() { return _dataMgr->GetDataVarNames(2).size(); }
264int getNumActiveVariables() { return getNumActiveVariables3D() + getNumActiveVariables2D(); }
265
274void mapBoxToVox(Box *box, string varname, int refLevel, int lod, int timestep, size_t voxExts[6]);
275
276#endif
277
278}; // namespace DataMgrUtils
279}; // namespace VAPoR
280#endif // DATAMGRUTILS_H
A cache based data reader.
Definition: DataMgr.h:110
Abstract base class for a 2D or 3D structured or unstructured grid.
Definition: Grid.h:56
#define VDF_API
Definition: common.h:73
VDF_API void UnlockGrids(DataMgr *dataMgr, const std::vector< Grid * > &grids)
VDF_API int ConvertPCSToLonLat(const DataMgr *dataMgr, double coords[], int npoints=1)
VDF_API int ConvertLonLatToPCS(const DataMgr *dataMgr, double coords[], int npoints=1)
VDF_API bool MaxLODPresent(const DataMgr *dataMgr, size_t timestep, string varname, size_t &maxLOD)
VDF_API int GetGrids(DataMgr *dataMgr, size_t ts, const vector< string > &varnames, const T &minExtsReq, const T &maxExtsReq, bool useLowerAccuracy, int *refLevel, int *lod, std::vector< Grid * > &grids, bool lock=false)
bool GetAxes(const DataMgr *dataMgr, string varname, vector< int > &axes)
VDF_API bool MaxXFormPresent(const DataMgr *dataMgr, size_t timestep, string varname, size_t &maxXForm)
VDF_API double Get2DRendererDefaultZ(DataMgr *dataMgr, size_t ts, int refLevel, int lod)
VDF_API bool GetExtents(DataMgr *dataMgr, size_t timestep, string varname, int refLevel, int lod, CoordType &minExts, CoordType &maxExts)
VDF_API bool GetFirstExistingVariable(DataMgr *dataMgr, int level, int lod, int ndim, string &varname, size_t &ts)
VDF_API int GetDefaultMetaInfoStride(DataMgr *dataMgr, std::string varname, int refinementLevel)
Used by the histo for calculating some meta data.
std::array< double, 3 > CoordType
Type for specifying floating point coordinates.
Definition: Grid.h:23
std::array< size_t, 3 > DimsType
Type for specifying integer indices.
Definition: Grid.h:26