VAPOR3 3.9.4
DataMgr.h
Go to the documentation of this file.
1#include <vector>
2#include <iostream>
3#include <list>
4#include "vapor/VAssert.h"
5#include <vapor/BlkMemMgr.h>
6#include <vapor/DC.h>
7#include <vapor/MyBase.h>
8#include <vapor/RegularGrid.h>
10#include <vapor/LayeredGrid.h>
13#include <vapor/UDUnitsClass.h>
14#include <vapor/GridHelper.h>
15#include <vapor/DerivedVarMgr.h>
16
17#ifndef DataMgvV3_0_h
18 #define DataMgvV3_0_h
19
20using namespace std;
21
22namespace VAPoR {
23class PipeLine;
24class DerivedVar;
25class DerivedDataVar;
26class DerivedCoordVar;
27
109//
111public:
130 //
131 DataMgr(string format, size_t mem_size, int nthreads = 0);
132
133 virtual ~DataMgr();
134
145 //
146 virtual int Initialize(const vector<string> &paths, const std::vector<string> &options);
147
149 //
150 std::vector<string> GetDimensionNames() const
151 {
152 VAssert(_dc);
153 return (_dc->GetDimensionNames());
154 }
155
157 //
158 bool GetAtt (string varname, string attname, vector< double > &values) const
159 {
160 VAssert(_dc);
161 return (_dc->GetAtt(varname, attname, values));
162 }
163
165 //
166 bool GetAtt (string varname, string attname, vector<long> &values) const
167 {
168 VAssert(_dc);
169 return (_dc->GetAtt(varname, attname, values));
170 }
171
173 //
174 bool GetAtt (string varname, string attname, string &values) const
175 {
176 VAssert(_dc);
177 return (_dc->GetAtt(varname, attname, values));
178 }
179
181 //
182 std::vector<string> GetAttNames(string varname) const
183 {
184 VAssert(_dc);
185 return (_dc->GetAttNames(varname));
186 }
187
189 //
190 DC::XType GetAttType(string varname, string attname) const
191 {
192 VAssert(_dc);
193 return (_dc->GetAttType(varname, attname));
194 }
195
197 //
198 bool GetDimension(string dimname, DC::Dimension &dimension, long ts) const
199 {
200 VAssert(_dc);
201 return (_dc->GetDimension(dimname, dimension, ts));
202 }
203
208 long GetDimensionLength(string name, long ts) const
209 {
210 VAssert(_dc);
211 DC::Dimension dimension;
212 bool ok = GetDimension(name, dimension, ts);
213 if (ok)
214 return dimension.GetLength();
215 return -1;
216 }
217
219 //
220 std::vector<string> GetMeshNames() const
221 {
222 VAssert(_dc);
223 return (_dc->GetMeshNames());
224 }
225
227 //
228 bool GetMesh(string meshname, DC::Mesh &mesh) const;
229
230 DC::Mesh GetMesh(string meshname) const {
231 DC::Mesh mesh;
232 GetMesh(meshname, mesh);
233 return mesh;
234 }
235
246 virtual std::vector<string> GetDataVarNames() const;
247
260 enum class VarType { Any, Scalar, Particle };
261 virtual std::vector<string> GetDataVarNames(int ndim, VarType type = VarType::Any) const;
262
273 virtual std::vector<string> GetCoordVarNames() const;
274
286 void GetTimeCoordinates(std::vector<double> &timecoords) const { timecoords = _timeCoordinates; };
287
288 const std::vector<double> &GetTimeCoordinates() const { return (_timeCoordinates); };
289
294 //
295 string GetTimeCoordVarName() const;
296
298 bool HasMovingDomain() const;
299
317 //
318 virtual bool GetVarCoordVars(string varname, bool spatial, std::vector<string> &coord_vars) const;
319 vector<string> GetVarCoordVars(string varname, bool spatial) const;
320
335 bool GetDataVarInfo(string varname, VAPoR::DC::DataVar &datavar) const;
336
347 //
348 bool GetBaseVarInfo(string varname, VAPoR::DC::BaseVar &var) const;
349
365 bool GetCoordVarInfo(string varname, VAPoR::DC::CoordVar &cvar) const;
366
377 bool IsTimeVarying(string varname) const;
378
390 //
391 bool IsCompressed(string varname) const;
392
405 //
406 int GetNumTimeSteps(string varname) const;
407
412 //
413 int GetNumTimeSteps() const;
414
416 //
417 size_t GetNumRefLevels(string varname) const;
418
420 //
421 std::vector<size_t> GetCRatios(string varname) const;
422
440 //
441 VAPoR::Grid *GetVariable(size_t ts, string varname, int level, int lod, bool lock = false);
442
471 VAPoR::Grid *GetVariable(size_t ts, string varname, int level, int lod, CoordType min, CoordType max, bool lock = false);
472
473 VAPoR::Grid *GetVariable(size_t ts, string varname, int level, int lod, DimsType min, DimsType max, bool lock = false);
474
486 int GetVariableExtents(size_t ts, string varname, int level, int lod, CoordType &min, CoordType &max);
487
495 //
496 int GetDataRange(size_t ts, string varname, int level, int lod, std::vector<double> &range);
497
505 //
506 int GetDataRange(size_t ts, string varname, int level, int lod, CoordType min, CoordType max, std::vector<double> &range);
507
510 virtual int GetDimLensAtLevel(string varname, int level, std::vector<size_t> &dims_at_level, long ts) const
511 {
512 std::vector<size_t> dummy;
513 return (GetDimLensAtLevel(varname, level, dims_at_level, dummy, ts));
514 }
515
521 virtual int GetDimLens(string varname, std::vector<size_t> &dims, long ts) { return (GetDimLensAtLevel(varname, -1, dims, ts)); }
522
523 std::vector<size_t> GetDimLens(string varname) {
524 std::vector<size_t> dims;
525 GetDimLens(varname, dims, 0);
526 return dims;
527 }
528
544 //
545 void UnlockGrid(const VAPoR::Grid *rg);
546
550 //
551 size_t GetNumDimensions(string varname) const;
552
555 size_t GetVarTopologyDim(string varname) const;
556
559 size_t GetVarGeometryDim(string varname) const;
560
564 //
565 void Clear();
566
579 //
580 virtual bool VariableExists(size_t ts, string varname, int level = 0, int lod = 0) const;
581
583 //
584 virtual string GetMapProjection() const { return (_proj4String); }
585
587 //
588 virtual string GetMapProjectionDefault() const { return (_proj4StringDefault); }
589
590 #ifdef VAPOR3_0_0_ALPHA
591
611 int NewPipeline(PipeLine *pipeline);
612
620 void RemovePipeline(string name);
621 #endif
622
630 //
631 bool IsVariableDerived(string varname) const;
632
641 //
642 bool IsVariableNative(string varname) const;
643
645
646 void RemoveDerivedVar(string varname);
647
652 void PurgeVariable(string varname);
653
654 class BlkExts {
655 public:
657 BlkExts(const DimsType &bmin, const DimsType &bmax);
658
659 void Insert(const DimsType &bcoord, const CoordType &min, const CoordType &max);
660
661 bool Intersect(const CoordType &min, const CoordType &max, DimsType &bmin, DimsType &bmax, int nCoords = 3) const;
662
663 friend std::ostream &operator<<(std::ostream &o, const BlkExts &b);
664
665 private:
666 DimsType _bmin = {{0, 0, 0}};
667 DimsType _bmax = {{0, 0, 0}};
668 std::vector<CoordType> _mins;
669 std::vector<CoordType> _maxs;
670 };
671
672protected:
673 //
674 // Cache for various metadata attributes
675 //
676 template<typename C> class VarInfoCache {
677 public:
678 //
679 //
680 void Set(size_t ts, std::vector<string> varnames, int level, int lod, string key, const std::vector<C> &values);
681
682 void Set(size_t ts, string varname, int level, int lod, string key, const std::vector<C> &values)
683 {
684 std::vector<string> varnames;
685 varnames.push_back(varname);
686 Set(ts, varnames, level, lod, key, values);
687 }
688
689 bool Get(size_t ts, std::vector<string> varnames, int level, int lod, string key, std::vector<C> &values) const;
690
691 bool Get(size_t ts, string varname, int level, int lod, string key, std::vector<C> &values) const
692 {
693 std::vector<string> varnames;
694 varnames.push_back(varname);
695 return Get(ts, varnames, level, lod, key, values);
696 }
697
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)
700 {
701 std::vector<string> varnames;
702 varnames.push_back(varname);
703 Purge(ts, varnames, level, lod, key);
704 }
705 void Purge(std::vector<string> varnames);
706
707 void Clear() { _cache.clear(); }
708
709 static string _make_hash(string key, size_t ts, std::vector<string> cvars, int level, int lod);
710
711 void _decode_hash(const string &hash, string &key, size_t &ts, vector<string> &varnames, int &level, int &lod);
712
713 private:
714 std::map<string, std::vector<C>> _cache;
715 };
716
717 mutable std::map<std::pair<VarType, size_t>, std::vector<string>> _dataVarNamesCache;
718
719 string _format;
721 size_t _mem_size;
722
726
731
732 std::vector<double> _timeCoordinates;
736
737 typedef struct {
738 size_t ts;
739 string varname;
740 int level;
741 int lod;
745 void * blks;
746 } region_t;
747
748 // a list of all allocated regions
749 std::list<region_t> _regionsList;
750
752
753 std::vector<PipeLine *> _PipeLines;
754
758
759 std::map<string, BlkExts> _blkExtsCache;
760
761 std::map<const Grid *, vector<float *>> _lockedFloatBlks;
762 std::map<const Grid *, vector<int *>> _lockedIntBlks;
763
764 // Get the immediate variable dependencies of a variable
765 //
766 std::vector<string> _get_var_dependencies_1(string varname) const;
767
768 // Recursively get all of the dependencies of a list of variables.
769 // Handles cycles in the dependency graph
770 //
771 std::vector<string> _get_var_dependencies_all(std::vector<string> varnames, std::vector<string> dependencies) const;
772
773 // Return true if native data has a transformable horizontal coordinate
774 //
776
777 // Return true if native mesh has a transformable horizontal coordinate
778 //
779 bool _hasHorizontalXForm(string meshname) const;
780
781 bool _get_coord_vars(string varname, std::vector<string> &scvars, string &tcvar) const;
782
783 bool _get_coord_vars(string varname, vector<DC::CoordVar> &scvarsinfo, DC::CoordVar &tcvarinfo) const;
784
786
787 int _get_default_projection(string &projection);
788
789 VAPoR::RegularGrid *_make_grid_regular(const DimsType &dims, const std::vector<float *> &blkvec, DimsType &bs, DimsType &bmin, const DimsType &bmax) const;
790
791 VAPoR::StretchedGrid *_make_grid_stretched(const DimsType &dims, const std::vector<float *> &blkvec, const DimsType &bs, const DimsType &bmin, const DimsType &bmax) const;
792
793 VAPoR::LayeredGrid *_make_grid_layered(const DimsType &dims, const std::vector<float *> &blkvec, const DimsType &bs, const DimsType &bmin, const DimsType &bmax) const;
794
795 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,
796 const DimsType &bmin, const DimsType &bmax);
797
798 void _ugrid_setup(const DC::DataVar &var, DimsType &vertexDims, DimsType &faceDims, DimsType &edgeDims,
799 UnstructuredGrid::Location &location, // node,face, edge
800 size_t &maxVertexPerFace, size_t &maxFacePerVertex, long &vertexOffset, long &faceOffset, long ts) const;
801
802 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,
803 const DimsType &bs, const DimsType &bmin, const DimsType &bmax, const vector<int *> &conn_blkvec, const DimsType &conn_bs, const DimsType &conn_bmin,
804 const DimsType &conn_bmax);
805
806 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,
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);
809
810 string _get_grid_type(string varname) const;
811
812 int _find_bounding_grid(size_t ts, string varname, int level, int lod, CoordType min, CoordType max, DimsType &min_ui, DimsType &max_ui);
813
814 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,
815 DimsType &coord_bmin, DimsType &coord_bmax, bool structured, long ts) const;
816
817 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,
818 vector<DimsType> &bsvec, vector<DimsType> &bminvec, vector<DimsType> &bmaxvec, bool structured) const;
819
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;
822
823 VAPoR::Grid *_getVariable(size_t ts, string varname, int level, int lod, bool lock, bool dataless);
824
825 VAPoR::Grid *_getVariable(size_t ts, string varname, int level, int lod, DimsType min, DimsType max, bool lock, bool dataless);
826
827 int _parseOptions(vector<string> &options);
828
829 template<typename T> T *_get_region_from_cache(size_t ts, string varname, int level, int lod, const DimsType &bmin, const DimsType &bmax, bool lock);
830
831 template<typename T>
832 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);
833
834 template<typename T>
835 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,
836 const DimsType &grid_min, const DimsType &grid_max, T *blks);
837
838 template<typename T>
839 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);
840
841 template<typename T> 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);
842
843 template<typename T>
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);
846
847 void _unlock_blocks(const void *blks);
848
849 std::vector<string> _get_native_variables() const;
850
851 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);
852
853 void _free_region(size_t ts, string varname, int level, int lod, DimsType bmin, DimsType bmax, bool forceFlag = false);
854
855 bool _free_lru();
856 void _free_var(string varname);
857
858 int _level_correction(string varname, int &level) const;
859 int _lod_correction(string varname, int &lod) const;
860
861 vector<string> _getDataVarNamesDerived(int ndim) const;
862
863 bool _hasCoordForAxis(vector<string> coord_vars, int axis) const;
864
865 string _defaultCoordVar(const DC::Mesh &m, int axis) const;
866
867 void _assignHorizontalCoords(vector<string> &coord_vars) const;
868
869 bool _getVarDimensions(string varname, vector<DC::Dimension> &dimensions, long ts) const;
870
871 bool _getDataVarDimensions(string varname, vector<DC::Dimension> &dimensions, long ts) const;
872
873 bool _getCoordVarDimensions(string varname, vector<DC::Dimension> &dimensions, long ts) const;
874
875 bool _getVarDimNames(string varname, vector<string> &dimnames) const;
876
877 bool _isDataVar(string varname) const
878 {
879 vector<string> names = GetDataVarNames();
880 return (find(names.begin(), names.end(), varname) != names.end());
881 }
882
883 bool _isCoordVar(string varname) const
884 {
885 vector<string> names = GetCoordVarNames();
886 return (find(names.begin(), names.end(), varname) != names.end());
887 }
888
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;
890
891 DerivedVar * _getDerivedVar(string varname) const;
892 DerivedDataVar * _getDerivedDataVar(string varname) const;
893 DerivedCoordVar *_getDerivedCoordVar(string varname) const;
894
895 int _openVariableRead(size_t ts, string varname, int level, int lod);
896
897 template<class T> int _readRegion(int fd, const DimsType &min, const DimsType &max, size_t ndims, T *region);
898 int _closeVariable(int fd);
899
900 template<class T> int _getVar(string varname, int level, int lod, T *data);
901
902 template<class T> int _getVar(size_t ts, string varname, int level, int lod, T *data);
903
904 void _getLonExtents(std::vector<float> &lons, DimsType dims, float &min, float &max) const;
905
906 void _getLatExtents(std::vector<float> &lons, DimsType dims, float &min, float &max) const;
907
908 int _getCoordPairExtents(string lon, string lat, float &lonmin, float &lonmax, float &latmin, float &latmax, long ts);
909
911
913
915
916 bool _hasVerticalXForm() const;
917
918 bool _hasVerticalXForm(string meshname, string &standard_name, string &formula_terms) const;
919
920 bool _hasVerticalXForm(string meshname) const
921 {
922 string standard_name, formula_terms;
923 return (_hasVerticalXForm(meshname, standard_name, formula_terms));
924 }
925
926 bool _isCoordVarInUse(string varName) const;
927
928 // Hide public DC::GetDimLensAtLevel by making it private
929 //
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;
931};
932
933}; // namespace VAPoR
934#endif
#define VAssert(expr)
Definition: VAssert.h:9
The Wasp BlkMemMgr class.
Definition: BlkMemMgr.h:26
This class implements a 2D or 3D curvilinear grid.
Base class for storing variable metadata.
Definition: DC.h:754
Coordinate variable metadata.
Definition: DC.h:881
Data variable metadata.
Definition: DC.h:987
Metadata describing a named dimension length.
Definition: DC.h:163
size_t GetLength() const
Definition: DC.h:204
Metadata describing a computational mesh.
Definition: DC.h:310
A Template Method design pattern for reading a collection of data.
Definition: DC.h:150
XType
External storage types for primitive data.
Definition: DC.h:154
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)
Definition: DataMgr.h:699
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)
Definition: DataMgr.h:682
void Purge(std::vector< string > varnames)
bool Get(size_t ts, string varname, int level, int lod, string key, std::vector< C > &values) const
Definition: DataMgr.h:691
A cache based data reader.
Definition: DataMgr.h:110
void GetTimeCoordinates(std::vector< double > &timecoords) const
Definition: DataMgr.h:286
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
Definition: DataMgr.h:220
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)
Definition: DataMgr.h:523
VarInfoCache< void * > _varInfoCacheVoidPtr
Definition: DataMgr.h:757
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
Definition: DataMgr.h:920
int GetNumTimeSteps() const
std::map< std::pair< VarType, size_t >, std::vector< string > > _dataVarNamesCache
Definition: DataMgr.h:717
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
;
Definition: DataMgr.h:588
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
Definition: DataMgr.h:749
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
Definition: DataMgr.h:208
bool _isDataVar(string varname) const
Definition: DataMgr.h:877
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
;
Definition: DataMgr.h:584
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
Definition: DataMgr.h:230
bool GetDimension(string dimname, DC::Dimension &dimension, long ts) const
Definition: DataMgr.h:198
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
Definition: DataMgr.h:755
virtual std::vector< string > GetDataVarNames() const
bool _doTransformHorizontal
Definition: DataMgr.h:728
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
Definition: DataMgr.h:759
bool _hasHorizontalXForm() const
VarInfoCache< double > _varInfoCacheDouble
Definition: DataMgr.h:756
VAPoR::BlkMemMgr * _blk_mem_mgr
Definition: DataMgr.h:751
int _getVar(string varname, int level, int lod, T *data)
DimsType _bs
Definition: DataMgr.h:735
std::vector< double > _timeCoordinates
Definition: DataMgr.h:732
bool GetAtt(string varname, string attname, string &values) const
Definition: DataMgr.h:174
string _format
Definition: DataMgr.h:719
void _free_var(string varname)
virtual int GetDimLens(string varname, std::vector< size_t > &dims, long ts)
Definition: DataMgr.h:521
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
Definition: DataMgr.h:166
VAPoR::UDUnits _udunits
Definition: DataMgr.h:724
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
Definition: DataMgr.h:190
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
Definition: DataMgr.h:883
std::vector< string > _get_var_dependencies_all(std::vector< string > varnames, std::vector< string > dependencies) const
DerivedVarMgr _dvm
Definition: DataMgr.h:727
virtual ~DataMgr()
void UnlockGrid(const VAPoR::Grid *rg)
std::vector< string > GetAttNames(string varname) const
Definition: DataMgr.h:182
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
Definition: DataMgr.h:762
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
Definition: DataMgr.h:510
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
Definition: DataMgr.h:734
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)
size_t _mem_size
Definition: DataMgr.h:721
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
string _proj4String
Definition: DataMgr.h:733
int _parseOptions(vector< string > &options)
bool IsTimeVarying(string varname) const
VAPoR::GridHelper _gridHelper
Definition: DataMgr.h:725
const std::vector< double > & GetTimeCoordinates() const
Definition: DataMgr.h:288
int _getCoordPairExtents(string lon, string lat, float &lonmin, float &lonmax, float &latmin, float &latmax, long ts)
string _openVarName
Definition: DataMgr.h:730
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
Definition: DataMgr.h:729
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
Definition: DataMgr.h:761
bool GetAtt(string varname, string attname, vector< double > &values) const
Definition: DataMgr.h:158
bool _getCoordVarDimensions(string varname, vector< DC::Dimension > &dimensions, long ts) const
int _initTimeCoord()
std::vector< string > GetDimensionNames() const
Definition: DataMgr.h:150
bool GetCoordVarInfo(string varname, VAPoR::DC::CoordVar &cvar) const
std::vector< PipeLine * > _PipeLines
Definition: DataMgr.h:753
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.
Definition: DerivedVar.h:106
Derived data variable abstract class.
Definition: DerivedVar.h:234
Derived variables constructed from other variables.
Definition: DerivedVarMgr.h:20
Derived variable abstract class.
Definition: DerivedVar.h:34
Abstract base class for a 2D or 3D structured or unstructured grid.
Definition: Grid.h:56
This class implements a 2D or 3D layered grid.
Definition: LayeredGrid.h:27
This class implements a 2D or 3D regular grid.
Definition: RegularGrid.h:25
This class implements a 2D or 3D stretched grid.
Definition: StretchedGrid.h:26
class for a 2D unstructured grid.
Wasp base class.
Definition: MyBase.h:67
#define VDF_API
Definition: common.h:73
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