VAPOR3 3.9.4
|
A cache based data reader. More...
#include <DataMgr.h>
Classes | |
class | BlkExts |
struct | region_t |
class | VarInfoCache |
Public Types | |
enum class | VarType { Any , Scalar , Particle } |
Public Types inherited from Wasp::MyBase | |
typedef void(* | ErrMsgCB_T) (const char *msg, int err_code) |
typedef void(* | DiagMsgCB_T) (const char *msg) |
Public Member Functions | |
DataMgr (string format, size_t mem_size, int nthreads=0) | |
virtual | ~DataMgr () |
virtual int | Initialize (const vector< string > &paths, const std::vector< string > &options) |
std::vector< string > | GetDimensionNames () const |
bool | GetAtt (string varname, string attname, vector< double > &values) const |
bool | GetAtt (string varname, string attname, vector< long > &values) const |
bool | GetAtt (string varname, string attname, string &values) const |
std::vector< string > | GetAttNames (string varname) const |
DC::XType | GetAttType (string varname, string attname) const |
bool | GetDimension (string dimname, DC::Dimension &dimension, long ts) const |
long | GetDimensionLength (string name, long ts) const |
std::vector< string > | GetMeshNames () const |
bool | GetMesh (string meshname, DC::Mesh &mesh) const |
DC::Mesh | GetMesh (string meshname) const |
virtual std::vector< string > | GetDataVarNames () const |
virtual std::vector< string > | GetDataVarNames (int ndim, VarType type=VarType::Any) const |
virtual std::vector< string > | GetCoordVarNames () const |
void | GetTimeCoordinates (std::vector< double > &timecoords) const |
const std::vector< double > & | GetTimeCoordinates () const |
string | GetTimeCoordVarName () const |
bool | HasTimeVaryingCoordinates () const |
bool | HasMovingDomain () const |
virtual bool | GetVarCoordVars (string varname, bool spatial, std::vector< string > &coord_vars) const |
vector< string > | GetVarCoordVars (string varname, bool spatial) const |
bool | GetDataVarInfo (string varname, VAPoR::DC::DataVar &datavar) const |
bool | GetBaseVarInfo (string varname, VAPoR::DC::BaseVar &var) const |
bool | GetCoordVarInfo (string varname, VAPoR::DC::CoordVar &cvar) const |
bool | IsTimeVarying (string varname) const |
bool | IsCompressed (string varname) const |
int | GetNumTimeSteps (string varname) const |
int | GetNumTimeSteps () const |
size_t | GetNumRefLevels (string varname) const |
std::vector< size_t > | GetCRatios (string varname) const |
VAPoR::Grid * | GetVariable (size_t ts, string varname, int level, int lod, bool lock=false) |
VAPoR::Grid * | GetVariable (size_t ts, string varname, int level, int lod, CoordType min, CoordType max, bool lock=false) |
VAPoR::Grid * | GetVariable (size_t ts, string varname, int level, int lod, DimsType min, DimsType max, bool lock=false) |
int | GetVariableExtents (size_t ts, string varname, int level, int lod, CoordType &min, CoordType &max) |
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) |
virtual int | GetDimLensAtLevel (string varname, int level, std::vector< size_t > &dims_at_level, long ts) const |
virtual int | GetDimLens (string varname, std::vector< size_t > &dims, long ts) |
std::vector< size_t > | GetDimLens (string varname) |
void | UnlockGrid (const VAPoR::Grid *rg) |
size_t | GetNumDimensions (string varname) const |
; | |
size_t | GetVarTopologyDim (string varname) const |
size_t | GetVarGeometryDim (string varname) const |
void | Clear () |
virtual bool | VariableExists (size_t ts, string varname, int level=0, int lod=0) const |
virtual string | GetMapProjection () const |
; | |
virtual string | GetMapProjectionDefault () const |
; | |
bool | IsVariableDerived (string varname) const |
bool | IsVariableNative (string varname) const |
int | AddDerivedVar (DerivedDataVar *derivedVar) |
void | RemoveDerivedVar (string varname) |
void | PurgeVariable (string varname) |
Public Member Functions inherited from Wasp::MyBase | |
MyBase () | |
const string & | getClassName () const |
Protected Member Functions | |
std::vector< string > | _get_var_dependencies_1 (string varname) const |
std::vector< string > | _get_var_dependencies_all (std::vector< string > varnames, std::vector< string > dependencies) const |
bool | _hasHorizontalXForm () const |
bool | _hasHorizontalXForm (string meshname) const |
bool | _get_coord_vars (string varname, std::vector< string > &scvars, string &tcvar) const |
bool | _get_coord_vars (string varname, vector< DC::CoordVar > &scvarsinfo, DC::CoordVar &tcvarinfo) const |
int | _initTimeCoord () |
int | _get_default_projection (string &projection) |
VAPoR::RegularGrid * | _make_grid_regular (const DimsType &dims, const std::vector< float * > &blkvec, DimsType &bs, DimsType &bmin, const DimsType &bmax) const |
VAPoR::StretchedGrid * | _make_grid_stretched (const DimsType &dims, const std::vector< float * > &blkvec, const DimsType &bs, const DimsType &bmin, const DimsType &bmax) const |
VAPoR::LayeredGrid * | _make_grid_layered (const DimsType &dims, const std::vector< float * > &blkvec, const DimsType &bs, const DimsType &bmin, const DimsType &bmax) 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) |
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 |
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) |
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) |
string | _get_grid_type (string varname) const |
int | _find_bounding_grid (size_t ts, string varname, int level, int lod, CoordType min, CoordType max, DimsType &min_ui, DimsType &max_ui) |
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 | _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 |
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 |
VAPoR::Grid * | _getVariable (size_t ts, string varname, int level, int lod, bool lock, bool dataless) |
VAPoR::Grid * | _getVariable (size_t ts, string varname, int level, int lod, DimsType min, DimsType max, bool lock, bool dataless) |
int | _parseOptions (vector< string > &options) |
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) |
template<typename T > | |
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) |
template<typename T > | |
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) |
template<typename T > | |
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) |
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) |
template<typename T > | |
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) |
void | _unlock_blocks (const void *blks) |
std::vector< string > | _get_native_variables () 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) |
void | _free_region (size_t ts, string varname, int level, int lod, DimsType bmin, DimsType bmax, bool forceFlag=false) |
bool | _free_lru () |
void | _free_var (string varname) |
int | _level_correction (string varname, int &level) const |
int | _lod_correction (string varname, int &lod) const |
vector< string > | _getDataVarNamesDerived (int ndim) const |
bool | _hasCoordForAxis (vector< string > coord_vars, int axis) const |
string | _defaultCoordVar (const DC::Mesh &m, int axis) const |
void | _assignHorizontalCoords (vector< string > &coord_vars) const |
bool | _getVarDimensions (string varname, vector< DC::Dimension > &dimensions, long ts) const |
bool | _getDataVarDimensions (string varname, vector< DC::Dimension > &dimensions, long ts) const |
bool | _getCoordVarDimensions (string varname, vector< DC::Dimension > &dimensions, long ts) const |
bool | _getVarDimNames (string varname, vector< string > &dimnames) const |
bool | _isDataVar (string varname) const |
bool | _isCoordVar (string varname) const |
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 |
DerivedVar * | _getDerivedVar (string varname) const |
DerivedDataVar * | _getDerivedDataVar (string varname) const |
DerivedCoordVar * | _getDerivedCoordVar (string varname) const |
int | _openVariableRead (size_t ts, string varname, int level, int lod) |
template<class T > | |
int | _readRegion (int fd, const DimsType &min, const DimsType &max, size_t ndims, T *region) |
int | _closeVariable (int fd) |
template<class T > | |
int | _getVar (string varname, int level, int lod, T *data) |
template<class T > | |
int | _getVar (size_t ts, string varname, int level, int lod, T *data) |
void | _getLonExtents (std::vector< float > &lons, DimsType dims, float &min, float &max) const |
void | _getLatExtents (std::vector< float > &lons, DimsType dims, float &min, float &max) const |
int | _getCoordPairExtents (string lon, string lat, float &lonmin, float &lonmax, float &latmin, float &latmax, long ts) |
int | _initProj4StringDefault () |
int | _initHorizontalCoordVars () |
int | _initVerticalCoordVars () |
bool | _hasVerticalXForm () const |
bool | _hasVerticalXForm (string meshname, string &standard_name, string &formula_terms) const |
bool | _hasVerticalXForm (string meshname) const |
bool | _isCoordVarInUse (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 |
Protected Member Functions inherited from Wasp::MyBase | |
void | SetClassName (const string &name) |
Protected Attributes | |
std::map< std::pair< VarType, size_t >, std::vector< string > > | _dataVarNamesCache |
string | _format |
int | _nthreads |
size_t | _mem_size |
DC * | _dc |
VAPoR::UDUnits | _udunits |
VAPoR::GridHelper | _gridHelper |
DerivedVarMgr | _dvm |
bool | _doTransformHorizontal |
bool | _doTransformVertical |
string | _openVarName |
std::vector< double > | _timeCoordinates |
string | _proj4String |
string | _proj4StringDefault |
DimsType | _bs |
std::list< region_t > | _regionsList |
VAPoR::BlkMemMgr * | _blk_mem_mgr |
std::vector< PipeLine * > | _PipeLines |
VarInfoCache< size_t > | _varInfoCacheSize_T |
VarInfoCache< double > | _varInfoCacheDouble |
VarInfoCache< void * > | _varInfoCacheVoidPtr |
std::map< string, BlkExts > | _blkExtsCache |
std::map< const Grid *, vector< float * > > | _lockedFloatBlks |
std::map< const Grid *, vector< int * > > | _lockedIntBlks |
Additional Inherited Members | |
Static Public Member Functions inherited from Wasp::MyBase | |
static void | SetErrMsg (const char *format,...) |
Record a formatted error message. | |
static void | SetErrMsg (int errcode, const char *format,...) |
Record a formatted error message and an error code. | |
static const char * | GetErrMsg () |
static void | SetErrCode (int err_code) |
Record an error code. | |
static int | GetErrCode () |
Retrieve the current error code. | |
static void | SetErrMsgCB (ErrMsgCB_T cb) |
static ErrMsgCB_T | GetErrMsgCB () |
static void | SetErrMsgFilePtr (FILE *fp) |
static const FILE * | SetErrMsgFilePtr () |
static void | SetDiagMsg (const char *format,...) |
Record a formatted diagnostic message. | |
static const char * | GetDiagMsg () |
static void | SetDiagMsgCB (DiagMsgCB_T cb) |
static DiagMsgCB_T | GetDiagMsgCB () |
static void | SetDiagMsgFilePtr (FILE *fp) |
static bool | EnableErrMsg (bool enable) |
static bool | GetEnableErrMsg () |
Static Public Attributes inherited from Wasp::MyBase | |
static char * | ErrMsg |
static int | ErrCode |
static int | ErrMsgSize |
static FILE * | ErrMsgFilePtr |
static ErrMsgCB_T | ErrMsgCB |
static char * | DiagMsg |
static int | DiagMsgSize |
static FILE * | DiagMsgFilePtr |
static DiagMsgCB_T | DiagMsgCB |
static bool | Enabled |
A cache based data reader.
The DataMgr class is an abstract class that defines public methods for accessing (reading) 1D, 2D and 3D field variables. The class implements a memory cache to speed data access – once a variable is read it is stored in cache for subsequent access. The DataMgr class is abstract: it declares a number of public and protected pure virtual methods that must be implemented by specializations of this class to allow access to particular file formats.
This class inherits from Wasp::MyBase. Unless otherwise documented any method that returns an integer value is returning status. A negative value indicates failure. Error messages are logged via Wasp::MyBase::SetErrMsg().
Methods that return a boolean do not, unless otherwise documented, log an error message upon failure (return of false).
level | Grid refinement level for multiresolution variables. Compressed variables in the VDC have a multi-resolution representation: the sampling grid for multi-resolution variables is hierarchical, and the dimension lengths of adjacent levels in the hierarchy differ by a factor of two. The To provide maximum flexibility as well as compatibility with previous versions of the VDC the interpretation of For positive values of For negative values of |
lod | The level-of-detail parameter, For positive values of For negative values of |
|
strong |
Return a list of data variables with a given spatial dimension rank
This method returns a list of all data variables defined in the data set with the specified dimension rank (number of dimensions). Data variables may have 0 to 3 spatial dimensions
[in] | ndim | Variable rank (number of dimensions) |
list | A vector containing a list of all the data variable names with the specified number of dimensions (rank). |
Enumerator | |
---|---|
Any | |
Scalar | |
Particle |
VAPoR::DataMgr::DataMgr | ( | string | format, |
size_t | mem_size, | ||
int | nthreads = 0 |
||
) |
Constructor for the DataMgr class.
The DataMgr will attempt to cache previously read data and coordinate variables in memory. The mem_size
specifies the requested cache size in MEGABYTES!!!
[in] | format | A string indicating the format of data collection. |
[in] | mem_size | Size of memory cache to be created, specified in MEGABYTES!! If 0, not restriction is placed on the cache size; the DataMgr will attempt to allocate as much memory is needed. |
[in] | numthreads | Number of parallel execution threads to be run during encoding and decoding of compressed data. A value of 0, the default, indicates that the thread count should be determined by the environment in a platform-specific manner, for example using sysconf(_SC_NPROCESSORS_ONLN) under *nix OSes. |
|
virtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineprotected |
|
protected |
|
inlineprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
int VAPoR::DataMgr::AddDerivedVar | ( | DerivedDataVar * | derivedVar | ) |
void VAPoR::DataMgr::Clear | ( | ) |
Clear the memory cache
This method clears the internal memory cache of all entries
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool VAPoR::DataMgr::GetBaseVarInfo | ( | string | varname, |
VAPoR::DC::BaseVar & | var | ||
) | const |
Return metadata about a data or coordinate variable
If the variable varname
is defined as either a data or coordinate variable its metadata will be returned in var
.
bool | If true the method was successful. If false the named variable is invalid (unknown) |
bool VAPoR::DataMgr::GetCoordVarInfo | ( | string | varname, |
VAPoR::DC::CoordVar & | cvar | ||
) | const |
Return a coordinate variable's definition
Return a reference to a DC::CoordVar object describing the coordinate variable named by varname
[in] | varname | A string specifying the name of the coordinate variable. |
[out] | coordvar | A CoordVar object containing the definition of the named variable. |
bool | If true the method was successful. If false the named variable is invalid (unknown) |
|
virtual |
Return a list of names for all of the defined coordinate variables.
This method returns a list of all coordinate variables defined in the data set.
list | A vector containing a list of all the coordinate variable names |
std::vector< size_t > VAPoR::DataMgr::GetCRatios | ( | string | varname | ) | const |
Return the compression ratio vector for the indicated variable
Return the compression ratio vector for the indicated variable. The vector returned contains an ordered list of available compression ratios for the variable named by variable
. If the variable is not compressed, or the variable named varname
does not exist, the cratios
parameter will contain a single element, one.
cratios | Ordered vector of compression ratios |
int VAPoR::DataMgr::GetDataRange | ( | size_t | ts, |
string | varname, | ||
int | level, | ||
int | lod, | ||
CoordType | min, | ||
CoordType | max, | ||
std::vector< double > & | range | ||
) |
Compute min and max value of a variable within a specified ROI
This method finds the minimum and maximum value of a variable within the region of interest (ROI) specified by min
and max
. Note, the results returned by this method are equivalent to calling the Grid::GetRange() method on a grid returned by DataMgr::GetVariable using the same arguments provided here.
int VAPoR::DataMgr::GetDataRange | ( | size_t | ts, |
string | varname, | ||
int | level, | ||
int | lod, | ||
std::vector< double > & | range | ||
) |
Compute the min and max value of a variable
This method finds the minimum and maximum value of a variable
[out] | range | A two element vector containing the minimum and maximum value, respectively, for the variable varname at the specified time step, lod, etc. |
bool VAPoR::DataMgr::GetDataVarInfo | ( | string | varname, |
VAPoR::DC::DataVar & | datavar | ||
) | const |
Return a data variable's definition
Return a reference to a DC::DataVar object describing the data variable named by varname
[in] | varname | A string specifying the name of the variable. |
[out] | datavar | A DataVar object containing the definition of the named Data variable. |
bool | If true the method was successful. If false the named variable is invalid (unknown) |
|
virtual |
Return a list of names for all of the defined data variables.
This method returns a list of all data variables defined in the data set.
list | A vector containing a list of all the data variable names |
|
virtual |
|
inline |
Return a dimensions's definition
This method returns the definition of the dimension named by dimname
as a reference to a DC::Dimension object. If dimname
is not defined as a dimension then the name of dimension
will be the empty string()
[in] | dimname | A string specifying the name of the dimension. |
[out] | dimension | The returned Dimension object reference |
bool | If the named dimension can not be found false is returned. |
Definition at line 198 of file DataMgr.h.
References VAssert.
|
inline |
Returns the length of a dimension at a given timestep
length | A negative int is returned on failure |
Definition at line 208 of file DataMgr.h.
References VAPoR::DC::Dimension::GetLength(), and VAssert.
|
inline |
|
inline |
|
inlinevirtual |
Return a variable's array dimension lengths
This method is equivalent to calling GetDimLensAtLevel() with level
equal to -1
|
inlinevirtual |
Return a variable's array dimension lengths at a specified refinement level
Compressed variables may have a multi-resolution grid representation. This method returns the variable's ordered array dimension lengths, and block dimensions at the multiresolution refinement level specified by level
.
If the variable named by varname
is not compressed the variable's native dimensions are returned.
dims_at_level
will match that of bs_at_level
. If the data are not blocked the value of each element of bs_at_level
will be 1.[in] | varname | Data or coordinate variable name. |
[in] | level | Specifies a member of a multi-resolution variable's grid hierarchy as described above. |
[out] | dims_at_level | An ordered vector containing the variable's dimensions at the specified refinement level |
[out] | bs_at_level | An ordered vector containing the variable's block dimensions at the specified refinement level |
status | Zero is returned upon success, otherwise -1. |
|
protectedvirtual |
|
inlinevirtual |
;
Return default Proj4 map projection string.
For georeference data sets that have map projections this method returns the default properly formatted Proj4 projection string for mapping from geographic to cartographic coordinates. If no projection exists, an empty string is returned.
projstring | An empty string if a Proj4 map projection is not available for the named variable, otherwise a properly formatted Proj4 projection string is returned. ; |
|
inlinevirtual |
|
inline |
bool VAPoR::DataMgr::GetMesh | ( | string | meshname, |
DC::Mesh & | mesh | ||
) | const |
Return a Mesh's definition
This method returns the definition of the mesh named by mesh_name
as a reference to a DC::Mesh object.
[in] | mesh_name | A string specifying the name of the Mesh. |
[out] | mesh | The returned Mesh object reference |
bool | If the named mesh can not be found false is returned. |
|
inline |
size_t VAPoR::DataMgr::GetNumDimensions | ( | string | varname | ) | const |
;
Get the rank of a variable
This method returns the number of rank of the array describing a variable. For structured data variables the rank is equal to the topological dimension (See GetTopologyDim()).
[in] | varname | Name of variable to query |
Array | rank. A value between 0 and 3, inclusive. If varname is unknown 0 is returned. ; |
size_t VAPoR::DataMgr::GetNumRefLevels | ( | string | varname | ) | const |
Return the number of refinement levels for the indicated variable
Compressed variables may have a multi-resolution grid representation. This method returns the number of levels in the hiearchy. A value of one indicates that only the native resolution is available. A value of two indicates that two levels, the native plus the next coarsest are available, and so on.
[in] | varname | Data or coordinate variable name. |
num | If varname is unknown one is returned. if varname is not compressed (has no multi-resolution representation) one is returned. Otherwise the total number of levels in the multi-resolution hierarchy are returned. |
int VAPoR::DataMgr::GetNumTimeSteps | ( | ) | const |
Return the maximum time dimension length for this data set
Returns the number of time steps (length of the time dimension) for any variable is defined.
int VAPoR::DataMgr::GetNumTimeSteps | ( | string | varname | ) | const |
Return the time dimension length for a variable
Returns the number of time steps (length of the time dimension) for which a variable is defined. If varname
does not have a time coordinate 1 is returned. If varname
is not defined as a variable a negative int is returned.
[in] | varname | A string specifying the name of the variable. |
count | The length of the time dimension, or a negative int if varname is undefined. |
|
inline |
|
inline |
Get time coordinates
Get a sorted list of all time coordinates defined for the data set. Multiple time coordinate variables may be defined. This method collects the time coordinates from all time coordinate variables and sorts them into a single, global time coordinate variable.
ts
expect "local" or "global" time steps string VAPoR::DataMgr::GetTimeCoordVarName | ( | ) | const |
Get time coordinate var name
Return the name of the time coordinate variable. If no time coordinate variable is defined the empty string is returned.
vector< string > VAPoR::DataMgr::GetVarCoordVars | ( | string | varname, |
bool | spatial | ||
) | const |
|
virtual |
Return an ordered list of a data variable's coordinate names
Returns a list of a coordinate variable names for the variable varname
, ordered from fastest to slowest. If spatial
is true and the variable is time varying the time coordinate variable name will be included. The time coordinate variable is always the slowest varying coordinate axis
[in] | varname | A valid variable name |
[in] | spatial | If true only return spatial dimensions |
[out] | coordvars | Ordered list of coordinate variable names. |
Returns | true upon success, false if the variable is not defined. |
size_t VAPoR::DataMgr::GetVarGeometryDim | ( | string | varname | ) | const |
VAPoR::Grid * VAPoR::DataMgr::GetVariable | ( | size_t | ts, |
string | varname, | ||
int | level, | ||
int | lod, | ||
bool | lock = false |
||
) |
Read and return variable data
Reads all data for the data or coordinate variable named by varname
for the time step, refinement level, and leve-of-detail indicated by ts
, level
, and lod
, respectively.
[in] | ts | An integer offset into the time coordinate variable returned by GetTimeCoordinates() indicting the time step of the variable to access. |
[in] | varname | The name of the data or coordinate variable to access |
[in] | level | Grid refinement level. See DataMgr |
[in] | lod | The level-of-detail parameter, lod , selects the approximation level. See DataMgr. |
VAPoR::Grid * VAPoR::DataMgr::GetVariable | ( | size_t | ts, |
string | varname, | ||
int | level, | ||
int | lod, | ||
CoordType | min, | ||
CoordType | max, | ||
bool | lock = false |
||
) |
Read and return a variable hyperslab
This method is identical to the GetVariable() method, however, a subregion is specified in the user coordinate system. min
and max
specify the minimum and maximum extents of an axis-aligned bounding box containing the region of interest. The VAPoR::Grid object returned contains the intersection between the specified hyperslab and the variable's spatial domain (which is not necessarily rectangular or axis-aligned). If the requested hyperslab lies entirely outside of the domain of the requested variable NULL is returned
[in] | min | A one, two, or three element array specifying the minimum extents, in user coordinates, of an axis-aligned box defining the region-of-interest. The spatial dimensionality of the variable determines the number of elements in min . |
[in] | max | A one, two, or three element array specifying the maximum extents, in user coordinates, of an axis-aligned box defining the region-of-interest. The spatial dimensionality of the variable determines the number of elements in max . |
VAPoR::Grid * VAPoR::DataMgr::GetVariable | ( | size_t | ts, |
string | varname, | ||
int | level, | ||
int | lod, | ||
DimsType | min, | ||
DimsType | max, | ||
bool | lock = false |
||
) |
int VAPoR::DataMgr::GetVariableExtents | ( | size_t | ts, |
string | varname, | ||
int | level, | ||
int | lod, | ||
CoordType & | min, | ||
CoordType & | max | ||
) |
Compute the coordinate extents of a variable
This method finds the spatial domain extents of a variable
This method returns the min and max extents specified in user coordinates, of the smallest axis-aligned bounding box that is guaranteed to contain the variable(s) indicated by varname
, and the given refinement level, level
size_t VAPoR::DataMgr::GetVarTopologyDim | ( | string | varname | ) | const |
bool VAPoR::DataMgr::HasMovingDomain | ( | ) | const |
bool VAPoR::DataMgr::HasTimeVaryingCoordinates | ( | ) | const |
|
virtual |
Initialize the class
This method must be called to initialize the DataMgr class with a list of input data files.
[in] | files | A list of file paths |
status | A negative int is returned on failure and an error message will be logged with MyBase::SetErrMsg() |
bool VAPoR::DataMgr::IsCompressed | ( | string | varname | ) | const |
Return a boolean indicating whether a variable is compressed
This method returns true if the variable named by varname
is defined and it has a compressed representation. If either of these conditions is not true the method returns false.
[in] | varname | A string specifying the name of the variable. |
bool | Returns true if variable varname exists and is compressed |
bool VAPoR::DataMgr::IsTimeVarying | ( | string | varname | ) | const |
Return a boolean indicating whether a variable is time varying
This method returns true if the variable named by varname
is defined and it has a time axis dimension. If either of these conditions is not true the method returns false.
[in] | varname | A string specifying the name of the variable. |
bool | Returns true if variable varname exists and is time varying. |
bool VAPoR::DataMgr::IsVariableDerived | ( | string | varname | ) | const |
Return true if the named variable is the output of a pipeline
This method returns true if varname
matches a variable name in the output list (PipeLine::GetOutputs()) of any pipeline added with NewPipeline()
bool VAPoR::DataMgr::IsVariableNative | ( | string | varname | ) | const |
Return true if the named variable is availble from the derived classes data access methods.
A return value of true does not imply that the variable can be read (
void VAPoR::DataMgr::PurgeVariable | ( | string | varname | ) |
Purge the cache of a variable
[in] | varname | is the variable name |
void VAPoR::DataMgr::RemoveDerivedVar | ( | string | varname | ) |
void VAPoR::DataMgr::UnlockGrid | ( | const VAPoR::Grid * | rg | ) |
Unlock a floating-point region of memory
Decrement the lock counter associatd with a region of memory, and if zero, unlock region of memory previously locked with GetVariable(). When the lock counter reaches zero the region is simply marked available for internal garbage collection during subsequent GetVariable() calls
[in] | rg | A pointer to a Grid previosly returned by GetVariable() |
status | Returns a non-negative value on success |
|
virtual |
Returns true if indicated data volume is available
Returns true if the variable identified by the timestep, variable name, refinement level, and level-of-detail is present in the data set. Returns false if the variable is not available.
[in] | ts | A valid time step between 0 and GetNumTimesteps()-1 |
[in] | varname | A valid variable name |
[in] | level | Refinement level requested. |
[in] | lod | Compression level of detail requested. refinement level contained in the DC. |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |