131 DataMgr(
string format,
size_t mem_size,
int nthreads = 0);
146 virtual int Initialize(
const vector<string> &paths,
const std::vector<string> &options);
153 return (_dc->GetDimensionNames());
158 bool GetAtt (
string varname,
string attname, vector< double > &values)
const
161 return (_dc->GetAtt(varname, attname, values));
166 bool GetAtt (
string varname,
string attname, vector<long> &values)
const
169 return (_dc->GetAtt(varname, attname, values));
174 bool GetAtt (
string varname,
string attname,
string &values)
const
177 return (_dc->GetAtt(varname, attname, values));
185 return (_dc->GetAttNames(varname));
193 return (_dc->GetAttType(varname, attname));
201 return (_dc->GetDimension(dimname, dimension, ts));
212 bool ok = GetDimension(name, dimension, ts);
223 return (_dc->GetMeshNames());
232 GetMesh(meshname, mesh);
318 virtual bool GetVarCoordVars(
string varname,
bool spatial, std::vector<string> &coord_vars)
const;
496 int GetDataRange(
size_t ts,
string varname,
int level,
int lod, std::vector<double> &range);
510 virtual int GetDimLensAtLevel(
string varname,
int level, std::vector<size_t> &dims_at_level,
long ts)
const
512 std::vector<size_t> dummy;
513 return (GetDimLensAtLevel(varname, level, dims_at_level, dummy, ts));
521 virtual int GetDimLens(
string varname, std::vector<size_t> &dims,
long ts) {
return (GetDimLensAtLevel(varname, -1, dims, ts)); }
524 std::vector<size_t> dims;
525 GetDimLens(varname, dims, 0);
580 virtual bool VariableExists(
size_t ts,
string varname,
int level = 0,
int lod = 0)
const;
590 #ifdef VAPOR3_0_0_ALPHA
611 int NewPipeline(PipeLine *pipeline);
620 void RemovePipeline(
string name);
668 std::vector<CoordType> _mins;
669 std::vector<CoordType> _maxs;
680 void Set(
size_t ts, std::vector<string> varnames,
int level,
int lod,
string key,
const std::vector<C> &values);
682 void Set(
size_t ts,
string varname,
int level,
int lod,
string key,
const std::vector<C> &values)
684 std::vector<string> varnames;
685 varnames.push_back(varname);
686 Set(ts, varnames, level, lod, key, values);
689 bool Get(
size_t ts, std::vector<string> varnames,
int level,
int lod,
string key, std::vector<C> &values)
const;
691 bool Get(
size_t ts,
string varname,
int level,
int lod,
string key, std::vector<C> &values)
const
693 std::vector<string> varnames;
694 varnames.push_back(varname);
695 return Get(ts, varnames, level, lod, key, values);
698 void Purge(
size_t ts, std::vector<string> varnames,
int level,
int lod,
string key);
699 void Purge(
size_t ts,
string varname,
int level,
int lod,
string key)
701 std::vector<string> varnames;
702 varnames.push_back(varname);
703 Purge(ts, varnames, level, lod, key);
705 void Purge(std::vector<string> varnames);
709 static string _make_hash(
string key,
size_t ts, std::vector<string> cvars,
int level,
int lod);
711 void _decode_hash(
const string &hash,
string &key,
size_t &ts, vector<string> &varnames,
int &level,
int &lod);
714 std::map<string, std::vector<C>> _cache;
781 bool _get_coord_vars(
string varname, std::vector<string> &scvars,
string &tcvar)
const;
800 size_t &maxVertexPerFace,
size_t &maxFacePerVertex,
long &vertexOffset,
long &faceOffset,
long ts)
const;
807 const std::vector<DimsType> &bsvec,
const std::vector<DimsType> &bminvec,
const std::vector<DimsType> &bmaxvec,
const vector<int *> &conn_blkvec,
808 const vector<DimsType> &conn_bsvec,
const vector<DimsType> &conn_bminvec,
const vector<DimsType> &conn_bmaxvec);
815 DimsType &coord_bmin,
DimsType &coord_bmax,
bool structured,
long ts)
const;
818 vector<DimsType> &bsvec, vector<DimsType> &bminvec, vector<DimsType> &bmaxvec,
bool structured)
const;
820 int _setupConnVecs(
size_t ts,
string varname,
int level,
int lod, vector<string> &varnames, vector<DimsType> &dimsvec, vector<DimsType> &bsvec, vector<DimsType> &bminvec,
821 vector<DimsType> &bmaxvec)
const;
844 int _get_regions(
size_t ts,
const std::vector<string> &varnames,
int level,
int lod,
bool lock,
const std::vector<DimsType> &dimsvec,
const std::vector<DimsType> &bsvec,
845 const std::vector<DimsType> &bminvec,
const std::vector<DimsType> &bmaxvec, std::vector<T *> &blkvec);
879 vector<string> names = GetDataVarNames();
880 return (find(names.begin(), names.end(), varname) != names.end());
885 vector<string> names = GetCoordVarNames();
886 return (find(names.begin(), names.end(), varname) != names.end());
889 bool _getVarConnVars(
string varname,
string &face_node_var,
string &node_face_var,
string &face_edge_var,
string &face_face_var,
string &edge_node_var,
string &edge_face_var)
const;
900 template<
class T>
int _getVar(
string varname,
int level,
int lod, T *data);
902 template<
class T>
int _getVar(
size_t ts,
string varname,
int level,
int lod, T *data);
908 int _getCoordPairExtents(
string lon,
string lat,
float &lonmin,
float &lonmax,
float &latmin,
float &latmax,
long ts);
922 string standard_name, formula_terms;
923 return (_hasVerticalXForm(meshname, standard_name, formula_terms));
930 virtual int GetDimLensAtLevel(
string varname,
int level, std::vector<size_t> &dims_at_level, std::vector<size_t> &bs_at_level,
long ts)
const;
The Wasp BlkMemMgr class.
This class implements a 2D or 3D curvilinear grid.
Base class for storing variable metadata.
Coordinate variable metadata.
Metadata describing a named dimension length.
Metadata describing a computational mesh.
A Template Method design pattern for reading a collection of data.
XType
External storage types for primitive data.
BlkExts(const DimsType &bmin, const DimsType &bmax)
void Insert(const DimsType &bcoord, const CoordType &min, const CoordType &max)
bool Intersect(const CoordType &min, const CoordType &max, DimsType &bmin, DimsType &bmax, int nCoords=3) const
friend std::ostream & operator<<(std::ostream &o, const BlkExts &b)
void Set(size_t ts, std::vector< string > varnames, int level, int lod, string key, const std::vector< C > &values)
void _decode_hash(const string &hash, string &key, size_t &ts, vector< string > &varnames, int &level, int &lod)
void Purge(size_t ts, std::vector< string > varnames, int level, int lod, string key)
void Purge(size_t ts, string varname, int level, int lod, string key)
static string _make_hash(string key, size_t ts, std::vector< string > cvars, int level, int lod)
bool Get(size_t ts, std::vector< string > varnames, int level, int lod, string key, std::vector< C > &values) const
void Set(size_t ts, string varname, int level, int lod, string key, const std::vector< C > &values)
void Purge(std::vector< string > varnames)
bool Get(size_t ts, string varname, int level, int lod, string key, std::vector< C > &values) const
A cache based data reader.
void GetTimeCoordinates(std::vector< double > &timecoords) const
void PurgeVariable(string varname)
void _setupCoordVecsHelper(string data_varname, const DimsType &data_dimlens, const DimsType &data_bmin, const DimsType &data_bmax, string coord_varname, int order, DimsType &coord_dimlens, DimsType &coord_bmin, DimsType &coord_bmax, bool structured, long ts) const
int AddDerivedVar(DerivedDataVar *derivedVar)
void _free_region(size_t ts, string varname, int level, int lod, DimsType bmin, DimsType bmax, bool forceFlag=false)
bool IsCompressed(string varname) const
virtual std::vector< string > GetCoordVarNames() const
VAPoR::StretchedGrid * _make_grid_stretched(const DimsType &dims, const std::vector< float * > &blkvec, const DimsType &bs, const DimsType &bmin, const DimsType &bmax) const
void * _alloc_region(size_t ts, string varname, int level, int lod, DimsType bmin, DimsType bmax, DimsType bs, int element_sz, bool lock, bool fill)
vector< string > _getDataVarNamesDerived(int ndim) const
string _defaultCoordVar(const DC::Mesh &m, int axis) const
DerivedDataVar * _getDerivedDataVar(string varname) const
void _ugrid_setup(const DC::DataVar &var, DimsType &vertexDims, DimsType &faceDims, DimsType &edgeDims, UnstructuredGrid::Location &location, size_t &maxVertexPerFace, size_t &maxFacePerVertex, long &vertexOffset, long &faceOffset, long ts) const
bool HasTimeVaryingCoordinates() const
VAPoR::Grid * _getVariable(size_t ts, string varname, int level, int lod, bool lock, bool dataless)
bool GetBaseVarInfo(string varname, VAPoR::DC::BaseVar &var) const
VAPoR::Grid * _make_grid(size_t ts, int level, int lod, const VAPoR::DC::DataVar &var, const DimsType &roi_dims, const DimsType &dims, const std::vector< float * > &blkvec, const std::vector< DimsType > &bsvec, const std::vector< DimsType > &bminvec, const std::vector< DimsType > &bmaxvec, const vector< int * > &conn_blkvec, const vector< DimsType > &conn_bsvec, const vector< DimsType > &conn_bminvec, const vector< DimsType > &conn_bmaxvec)
vector< string > GetVarCoordVars(string varname, bool spatial) const
int _level_correction(string varname, int &level) const
int _initProj4StringDefault()
std::vector< string > GetMeshNames() const
int _get_regions(size_t ts, const std::vector< string > &varnames, int level, int lod, bool lock, const std::vector< DimsType > &dimsvec, const std::vector< DimsType > &bsvec, const std::vector< DimsType > &bminvec, const std::vector< DimsType > &bmaxvec, std::vector< T * > &blkvec)
std::vector< string > _get_var_dependencies_1(string varname) const
std::vector< size_t > GetDimLens(string varname)
VarInfoCache< void * > _varInfoCacheVoidPtr
bool _getVarConnVars(string varname, string &face_node_var, string &node_face_var, string &face_edge_var, string &face_face_var, string &edge_node_var, string &edge_face_var) const
virtual bool VariableExists(size_t ts, string varname, int level=0, int lod=0) const
bool _get_coord_vars(string varname, vector< DC::CoordVar > &scvarsinfo, DC::CoordVar &tcvarinfo) const
int GetNumTimeSteps(string varname) const
bool _hasVerticalXForm(string meshname) const
int GetNumTimeSteps() const
std::map< std::pair< VarType, size_t >, std::vector< string > > _dataVarNamesCache
VAPoR::Grid * GetVariable(size_t ts, string varname, int level, int lod, CoordType min, CoordType max, bool lock=false)
int _initVerticalCoordVars()
void _getLonExtents(std::vector< float > &lons, DimsType dims, float &min, float &max) const
virtual string GetMapProjectionDefault() const
;
void _unlock_blocks(const void *blks)
size_t GetVarTopologyDim(string varname) const
virtual int Initialize(const vector< string > &paths, const std::vector< string > &options)
bool IsVariableNative(string varname) const
std::list< region_t > _regionsList
int _get_default_projection(string &projection)
bool HasMovingDomain() const
int GetVariableExtents(size_t ts, string varname, int level, int lod, CoordType &min, CoordType &max)
bool _get_coord_vars(string varname, std::vector< string > &scvars, string &tcvar) const
long GetDimensionLength(string name, long ts) const
bool _isDataVar(string varname) const
VAPoR::Grid * _getVariable(size_t ts, string varname, int level, int lod, DimsType min, DimsType max, bool lock, bool dataless)
bool _hasVerticalXForm(string meshname, string &standard_name, string &formula_terms) const
DerivedVar * _getDerivedVar(string varname) const
string _get_grid_type(string varname) const
virtual string GetMapProjection() const
;
void _getLatExtents(std::vector< float > &lons, DimsType dims, float &min, float &max) const
int _get_unblocked_region_from_fs(size_t ts, string varname, int level, int lod, const DimsType &grid_dims, const DimsType &grid_bs, const DimsType &grid_min, const DimsType &grid_max, T *blks)
int _initHorizontalCoordVars()
DC::Mesh GetMesh(string meshname) const
bool GetDimension(string dimname, DC::Dimension &dimension, long ts) const
int _setupConnVecs(size_t ts, string varname, int level, int lod, vector< string > &varnames, vector< DimsType > &dimsvec, vector< DimsType > &bsvec, vector< DimsType > &bminvec, vector< DimsType > &bmaxvec) const
VarInfoCache< size_t > _varInfoCacheSize_T
virtual std::vector< string > GetDataVarNames() const
bool _doTransformHorizontal
DataMgr(string format, size_t mem_size, int nthreads=0)
int _readRegion(int fd, const DimsType &min, const DimsType &max, size_t ndims, T *region)
bool _getVarDimNames(string varname, vector< string > &dimnames) const
std::map< string, BlkExts > _blkExtsCache
bool _hasHorizontalXForm() const
VarInfoCache< double > _varInfoCacheDouble
VAPoR::BlkMemMgr * _blk_mem_mgr
int _getVar(string varname, int level, int lod, T *data)
std::vector< double > _timeCoordinates
bool GetAtt(string varname, string attname, string &values) const
void _free_var(string varname)
virtual int GetDimLens(string varname, std::vector< size_t > &dims, long ts)
VAPoR::LayeredGrid * _make_grid_layered(const DimsType &dims, const std::vector< float * > &blkvec, const DimsType &bs, const DimsType &bmin, const DimsType &bmax) const
bool GetAtt(string varname, string attname, vector< long > &values) const
std::vector< string > _get_native_variables() const
bool _getDataVarDimensions(string varname, vector< DC::Dimension > &dimensions, long ts) const
VAPoR::RegularGrid * _make_grid_regular(const DimsType &dims, const std::vector< float * > &blkvec, DimsType &bs, DimsType &bmin, const DimsType &bmax) const
std::vector< size_t > GetCRatios(string varname) const
virtual int GetDimLensAtLevel(string varname, int level, std::vector< size_t > &dims_at_level, std::vector< size_t > &bs_at_level, long ts) const
size_t GetVarGeometryDim(string varname) const
DC::XType GetAttType(string varname, string attname) const
int _get_blocked_region_from_fs(size_t ts, string varname, int level, int lod, const DimsType &file_bs, const DimsType &file_dims, const DimsType &grid_dims, const DimsType &grid_bs, const DimsType &grid_min, const DimsType &grid_max, T *blks)
bool _isCoordVar(string varname) const
std::vector< string > _get_var_dependencies_all(std::vector< string > varnames, std::vector< string > dependencies) const
void UnlockGrid(const VAPoR::Grid *rg)
std::vector< string > GetAttNames(string varname) const
bool _isCoordVarInUse(string varName) const
bool _hasCoordForAxis(vector< string > coord_vars, int axis) const
bool _hasHorizontalXForm(string meshname) const
bool IsVariableDerived(string varname) const
std::map< const Grid *, vector< int * > > _lockedIntBlks
size_t GetNumRefLevels(string varname) const
int _lod_correction(string varname, int &lod) const
virtual int GetDimLensAtLevel(string varname, int level, std::vector< size_t > &dims_at_level, long ts) const
size_t GetNumDimensions(string varname) const
;
virtual bool GetVarCoordVars(string varname, bool spatial, std::vector< string > &coord_vars) const
DerivedCoordVar * _getDerivedCoordVar(string varname) const
int _openVariableRead(size_t ts, string varname, int level, int lod)
VAPoR::Grid * GetVariable(size_t ts, string varname, int level, int lod, bool lock=false)
void RemoveDerivedVar(string varname)
int _setupCoordVecs(size_t ts, string varname, int level, int lod, const DimsType &min, const DimsType &max, vector< string > &varnames, DimsType &roi_dims, vector< DimsType > &dimsvec, vector< DimsType > &bsvec, vector< DimsType > &bminvec, vector< DimsType > &bmaxvec, bool structured) const
T * _get_region_from_fs(size_t ts, string varname, int level, int lod, const DimsType &grid_dims, const DimsType &grid_bs, const DimsType &grid_bmin, const DimsType &grid_bmax, bool lock)
bool _getVarDimensions(string varname, vector< DC::Dimension > &dimensions, long ts) const
string _proj4StringDefault
UnstructuredGrid2D * _make_grid_unstructured2d(size_t ts, int level, int lod, const DC::DataVar &dvarinfo, const vector< DC::CoordVar > &cvarsinfo, const DimsType, const vector< float * > &blkvec, const DimsType &bs, const DimsType &bmin, const DimsType &bmax, const vector< int * > &conn_blkvec, const DimsType &conn_bs, const DimsType &conn_bmin, const DimsType &conn_bmax)
bool GetMesh(string meshname, DC::Mesh &mesh) const
virtual std::vector< string > GetDataVarNames(int ndim, VarType type=VarType::Any) const
void _assignHorizontalCoords(vector< string > &coord_vars) const
int _parseOptions(vector< string > &options)
bool IsTimeVarying(string varname) const
VAPoR::GridHelper _gridHelper
const std::vector< double > & GetTimeCoordinates() const
int _getCoordPairExtents(string lon, string lat, float &lonmin, float &lonmax, float &latmin, float &latmax, long ts)
int GetDataRange(size_t ts, string varname, int level, int lod, std::vector< double > &range)
int GetDataRange(size_t ts, string varname, int level, int lod, CoordType min, CoordType max, std::vector< double > &range)
int _closeVariable(int fd)
bool _hasVerticalXForm() const
bool _doTransformVertical
int _getVar(size_t ts, string varname, int level, int lod, T *data)
VAPoR::Grid * GetVariable(size_t ts, string varname, int level, int lod, DimsType min, DimsType max, bool lock=false)
T * _get_region_from_cache(size_t ts, string varname, int level, int lod, const DimsType &bmin, const DimsType &bmax, bool lock)
bool GetDataVarInfo(string varname, VAPoR::DC::DataVar &datavar) const
string GetTimeCoordVarName() const
VAPoR::CurvilinearGrid * _make_grid_curvilinear(size_t ts, int level, int lod, const vector< DC::CoordVar > &cvarsinfo, const DimsType &dims, const std::vector< float * > &blkvec, const DimsType &bs, const DimsType &bmin, const DimsType &bmax)
std::map< const Grid *, vector< float * > > _lockedFloatBlks
bool GetAtt(string varname, string attname, vector< double > &values) const
bool _getCoordVarDimensions(string varname, vector< DC::Dimension > &dimensions, long ts) const
std::vector< string > GetDimensionNames() const
bool GetCoordVarInfo(string varname, VAPoR::DC::CoordVar &cvar) const
std::vector< PipeLine * > _PipeLines
T * _get_region(size_t ts, string varname, int level, int lod, int nlods, const DimsType &dims, const DimsType &bs, const DimsType &bmin, const DimsType &bmax, bool lock)
int _find_bounding_grid(size_t ts, string varname, int level, int lod, CoordType min, CoordType max, DimsType &min_ui, DimsType &max_ui)
Derived coordinate variable abstract class.
Derived data variable abstract class.
Derived variables constructed from other variables.
Derived variable abstract class.
Abstract base class for a 2D or 3D structured or unstructured grid.
This class implements a 2D or 3D layered grid.
This class implements a 2D or 3D regular grid.
This class implements a 2D or 3D stretched grid.
class for a 2D unstructured grid.
std::array< double, 3 > CoordType
Type for specifying floating point coordinates.
std::array< size_t, 3 > DimsType
Type for specifying integer indices.