|
| DataMgr (size_t mem_size) |
|
virtual | ~DataMgr () |
|
virtual void | GetDim (size_t dim[3], int reflevel=0) const |
|
int | GetNumTransforms () const |
|
virtual vector< size_t > | GetCRatios () const |
|
virtual string | GetCoordSystemType () const |
|
virtual string | GetGridType () const |
|
virtual vector< double > | GetExtents (size_t ts=0) |
|
virtual long | GetNumTimeSteps () const |
|
virtual string | GetMapProjection () const |
|
virtual vector< string > | GetVariableNames () const |
|
virtual vector< string > | GetVariables3D () const |
|
virtual vector< string > | GetVariables2DXY () const |
|
virtual vector< string > | GetVariables2DXZ () const |
|
virtual vector< string > | GetVariables2DYZ () const |
|
virtual vector< string > | GetCoordinateVariables () const |
|
virtual vector< long > | GetPeriodicBoundary () const |
|
virtual vector< long > | GetGridPermutation () const |
|
virtual double | GetTSUserTime (size_t ts) const |
|
virtual void | GetTSUserTimeStamp (size_t ts, string &s) const |
|
virtual RegularGrid * | GetGrid (size_t ts, string varname, int reflevel, int lod, const size_t min[3], const size_t max[3], bool lock=false) |
|
void | UnlockGrid (const RegularGrid *rg) |
|
int | UnlockRegion (const float *) |
|
void | Clear () |
|
int | GetDataRange (size_t ts, const char *varname, float range[2], int reflevel=0, int lod=0) |
|
int | GetValidRegion (size_t ts, const char *varname, int reflevel, size_t min[3], size_t max[3]) |
|
virtual int | VariableExists (size_t ts, const char *varname, int reflevel=0, int lod=0) |
|
bool | BestMatch (size_t ts, const char *varname, int req_reflevel, int req_lod, int &reflevel, int &lod) |
|
int | NewPipeline (PipeLine *pipeline) |
|
void | RemovePipeline (string name) |
|
bool | IsVariableDerived (string varname) const |
|
bool | IsVariableNative (string varname) const |
|
virtual VarType_T | GetVarType (const string &varname) const |
|
bool | GetMissingValue (string varname, float &value) const |
|
void | PurgeVariable (string varname) |
|
virtual void | MapUserToVox (size_t timestep, const double vcoord0[3], size_t vcoord1[3], int reflevel=0, int lod=0) |
|
virtual void | MapVoxToUser (size_t timestep, const size_t vcoord0[3], double vcoord1[3], int ref_level=0, int lod=0) |
|
virtual void | GetEnclosingRegion (size_t ts, const double minu[3], const double maxu[3], size_t min[3], size_t max[3], int reflevel=0, int lod=0) |
|
virtual bool | IsCoordinateVariable (string varname) const |
|
void | PrintCache (std::ostream &o) |
|
void | SetInterpolationOrder (int order) |
|
int | GetInterpolationOrder () const |
|
| MyBase () |
|
const string & | getClassName () const |
|
|
virtual void | _GetDim (size_t dim[3], int reflevel=0) const =0 |
|
virtual void | _GetBlockSize (size_t bs[3], int reflevel) const =0 |
|
virtual int | _GetNumTransforms () const =0 |
|
virtual vector< size_t > | _GetCRatios () const |
|
virtual string | _GetCoordSystemType () const |
|
virtual string | _GetGridType () const |
|
virtual vector< double > | _GetExtents (size_t ts=0) const =0 |
|
virtual vector< double > | _GetTSXCoords (size_t ts) const |
|
virtual vector< double > | _GetTSYCoords (size_t ts) const |
|
virtual vector< double > | _GetTSZCoords (size_t ts) const |
|
virtual long | _GetNumTimeSteps () const =0 |
|
virtual string | _GetMapProjection () const |
|
virtual vector< string > | _GetVariables3D () const =0 |
|
virtual vector< string > | _GetVariables2DXY () const =0 |
|
virtual vector< string > | _GetVariables2DXZ () const =0 |
|
virtual vector< string > | _GetVariables2DYZ () const =0 |
|
virtual vector< string > | _GetCoordinateVariables () const |
|
virtual vector< long > | _GetPeriodicBoundary () const =0 |
|
virtual vector< long > | _GetGridPermutation () const |
|
virtual double | _GetTSUserTime (size_t ts) const =0 |
|
virtual void | _GetTSUserTimeStamp (size_t ts, string &s) const =0 |
|
virtual int | _VariableExists (size_t ts, const char *varname, int reflevel=0, int lod=0) const =0 |
|
virtual int | _OpenVariableRead (size_t timestep, const char *varname, int reflevel=0, int lod=0)=0 |
|
virtual void | _GetValidRegion (size_t min[3], size_t max[3], int reflevel) const =0 |
|
virtual const float * | _GetDataRange () const |
|
virtual bool | _GetMissingValue (string varname, float &value) const |
|
virtual int | _BlockReadRegion (const size_t bmin[3], const size_t bmax[3], float *region)=0 |
|
virtual int | _CloseVariable ()=0 |
|
void | SetClassName (const string &name) |
|
A cache based data reader.
The DataMgr class is an abstract class that defines public methods for accessing (reading) 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 protected pure virtual methods that must be implemented by specializations of this class.
- Author
- John Clyne
- Version
- $Revision$
- Date
- $Date$
Definition at line 39 of file DataMgr.h.
virtual void VAPoR::DataMgr::_GetBlockSize |
( |
size_t |
bs[3], |
|
|
int |
reflevel |
|
) |
| const |
|
protectedpure virtual |
Return the internal blocking factor at a given refinement level
For multi-resolution data this method returns the dimensions of a data block at refinement level reflevel
, where reflevel is in the range 0 to GetNumTransforms(). A value of -1 may be specified to indicate the maximum refinement level. In fact, any value outside the valid refinement level range will be treated as the maximum refinement level.
- Parameters
-
[in] | reflevel | Refinement level |
| | |
Implemented in VAPoR::DataMgrWB, VAPoR::DataMgrWC, VAPoR::DataMgrAMR, VAPoR::DataMgrMPAS, VAPoR::DataMgrGRIB, VAPoR::DataMgrICON, VAPoR::DataMgrMOM, VAPoR::DataMgrROMS, VAPoR::DataMgrWRF, and VAPoR::DataMgrRAMSES.
virtual vector<string> VAPoR::DataMgr::_GetCoordinateVariables |
( |
| ) |
const |
|
inlineprotectedvirtual |
Return the names of the coordinate variables.
This method returns a three-element vector naming the X, Y, and Z coordinate variables, respectively. The special name "NONE" indicates that a coordinate variable name does not exist for a particular dimension.
- Note
- The existence of a coordinate variable name does not imply the existence of the coordinate variable itself.
- Return values
-
vector | is three-element vector of coordinate variable names. |
Reimplemented in VAPoR::DataMgrWC, and VAPoR::DataMgrWB.
Definition at line 694 of file DataMgr.h.
virtual vector<size_t> VAPoR::DataMgr::_GetCRatios |
( |
| ) |
const |
|
inlineprotectedvirtual |
Return the compression ratios available.
For data sets offering level-of-detail, the method returns a vector of integers, each specifying an available compression factor. For example, a factor of 10 indicates a compression ratio of 10:1. The vector returned is sorted from highest compression ratio to lowest. I.e. the most compressed data maps to index 0 in the returned vector.
- Return values
-
cr | A vector of one or more compression factors |
Reimplemented in VAPoR::DataMgrWC.
Definition at line 563 of file DataMgr.h.
virtual const float* VAPoR::DataMgr::_GetDataRange |
( |
| ) |
const |
|
inlineprotectedvirtual |
Return the data range for the currently open variable
The method returns the minimum and maximum data values, respectively, for the variable currently opened. If the variable is not opened, or if it is opened for writing, the results are undefined.
- Returns
- range A pointer to a two-element array containing the Min and Max data values, respectively. If the derived class' implementation of this method returns NULL, the DataMgr class will compute the min and max itself.
Reimplemented in VAPoR::DataMgrWC, VAPoR::DataMgrWB, VAPoR::DataMgrAMR, VAPoR::DataMgrMOM, VAPoR::DataMgrGRIB, VAPoR::DataMgrROMS, VAPoR::DataMgrWRF, VAPoR::DataMgrRAMSES, VAPoR::DataMgrMPAS, and VAPoR::DataMgrICON.
Definition at line 853 of file DataMgr.h.
virtual void VAPoR::DataMgr::_GetDim |
( |
size_t |
dim[3], |
|
|
int |
reflevel = 0 |
|
) |
| const |
|
protectedpure virtual |
Get the dimension of a volume
Returns the X,Y,Z coordinate dimensions of all data variables in grid (voxel) coordinates at the resolution level indicated by reflevel
. Hence, all variables of a given type (3D or 2D) must have the same dimension. If reflevel
is -1 (or the value returned by GetNumTransforms()) the native grid resolution is returned. In fact, any value outside the valid range is treated as the maximum refinement level
- Parameters
-
[in] | reflevel | Refinement level of the variable |
[out] | dim | A three element vector (ordered X, Y, Z) containing the voxel dimensions of the data at the specified resolution. |
- See also
- GetNumTransforms()
Implemented in VAPoR::DataMgrRAMSES, VAPoR::DataMgrMPAS, VAPoR::DataMgrICON, VAPoR::DataMgrWB, VAPoR::DataMgrWC, VAPoR::DataMgrAMR, VAPoR::DataMgrGRIB, VAPoR::DataMgrMOM, VAPoR::DataMgrROMS, and VAPoR::DataMgrWRF.
virtual vector<double> VAPoR::DataMgr::_GetExtents |
( |
size_t |
ts = 0 | ) |
const |
|
protectedpure virtual |
Return the domain extents specified in user coordinates
Return the domain extents specified in user coordinates for the indicated time step. Variables in the data have spatial positions defined in a user coordinate system. These positions may vary with time. This method returns min and max bounds, in user coordinates, of all variables at a given time step.
- Parameters
-
[in] | ts | A valid data set time step in the range from zero to GetNumTimeSteps() - 1. If ts is out of range, GetExtents() will return a reasonable default value. |
- Return values
-
extents | A six-element array containing the min and max bounds of the data domain in user-defined coordinates. The first three elements specify the minimum X, Y, and Z bounds, respectively, the second three elements specify the maximum bounds. |
Implemented in VAPoR::DataMgrWC, VAPoR::DataMgrWB, VAPoR::DataMgrRAMSES, VAPoR::DataMgrAMR, VAPoR::DataMgrGRIB, VAPoR::DataMgrMOM, VAPoR::DataMgrROMS, VAPoR::DataMgrWRF, VAPoR::DataMgrMPAS, and VAPoR::DataMgrICON.
virtual bool VAPoR::DataMgr::_GetMissingValue |
( |
string |
varname, |
|
|
float & |
value |
|
) |
| const |
|
inlineprotectedvirtual |
virtual int VAPoR::DataMgr::_GetNumTransforms |
( |
| ) |
const |
|
protectedpure virtual |
virtual double VAPoR::DataMgr::_GetTSUserTime |
( |
size_t |
ts | ) |
const |
|
protectedpure virtual |
Return the time for a time step
This method returns the time, in user-defined coordinates, associated with the time step, ts
. Variables such as velocity field components that are expressed in distance per units of time are expected to use the same time coordinates as the values returned by this mehtod.
- Parameters
-
- Return values
-
value | The user time at time step ts . If ts is outside the valid range zero is returned. |
Implemented in VAPoR::DataMgrWC, VAPoR::DataMgrWB, VAPoR::DataMgrMOM, VAPoR::DataMgrGRIB, VAPoR::DataMgrROMS, VAPoR::DataMgrWRF, VAPoR::DataMgrAMR, VAPoR::DataMgrRAMSES, VAPoR::DataMgrMPAS, and VAPoR::DataMgrICON.
virtual void VAPoR::DataMgr::_GetTSUserTimeStamp |
( |
size_t |
ts, |
|
|
string & |
s |
|
) |
| const |
|
protectedpure virtual |
Return the time for a time step
This method returns the user time, associated with the time step, ts
, as a formatted string. The returned time stamp is intended to be used for annotation purposes
- Parameters
-
[in] | ts | A valid data set time step in the range from zero to GetNumTimeSteps() - 1. |
[out] | s | A formated time string. If ts is outside the valid range zero the empty string is returned. |
Implemented in VAPoR::DataMgrWC, VAPoR::DataMgrWB, VAPoR::DataMgrMOM, VAPoR::DataMgrGRIB, VAPoR::DataMgrROMS, VAPoR::DataMgrWRF, VAPoR::DataMgrAMR, VAPoR::DataMgrRAMSES, VAPoR::DataMgrMPAS, and VAPoR::DataMgrICON.
virtual vector<double> VAPoR::DataMgr::_GetTSXCoords |
( |
size_t |
ts | ) |
const |
|
inlineprotectedvirtual |
Return the X dimension coordinate array, if it exists
For stretched grids, _GetGridType() == "stretched", this method returns the X component of the grid user coordinates. This method is only called for stretched grids.
- Return values
-
value | An array of monotonically changing values specifying the X dimension user coordinates, in a user-defined coordinate system, of each YZ sample plane. An empty vector is returned if the coordinate dimension array is not defined for the specified time step. |
- See also
- _GetGridType(), GetTSXCoords()
Reimplemented in VAPoR::DataMgrWC, and VAPoR::DataMgrWB.
Definition at line 617 of file DataMgr.h.
virtual void VAPoR::DataMgr::_GetValidRegion |
( |
size_t |
min[3], |
|
|
size_t |
max[3], |
|
|
int |
reflevel |
|
) |
| const |
|
protectedpure virtual |
Return the valid bounds of the currently opened region
The data model permits the storage of volume subregions. This method may be used to query the valid domain of the currently opened volume. Results are returned in voxel coordinates, relative to the refinement level indicated by reflevel
.
- Parameters
-
[out] | min | A pointer to the minimum bounds of the subvolume |
[out] | max | A pointer to the maximum bounds of the subvolume |
[in] | reflevel | Refinement level of the variable. A value of -1 indicates the maximum refinment level defined for the VDC |
- Return values
-
status | Returns a negative value if the volume is not opened for reading. |
- See also
- _OpenVariableRead()
Implemented in VAPoR::DataMgrWC, VAPoR::DataMgrWB, VAPoR::DataMgrMOM, VAPoR::DataMgrGRIB, VAPoR::DataMgrROMS, VAPoR::DataMgrWRF, VAPoR::DataMgrAMR, VAPoR::DataMgrRAMSES, VAPoR::DataMgrMPAS, and VAPoR::DataMgrICON.
virtual int VAPoR::DataMgr::_OpenVariableRead |
( |
size_t |
timestep, |
|
|
const char * |
varname, |
|
|
int |
reflevel = 0 , |
|
|
int |
lod = 0 |
|
) |
| |
|
protectedpure virtual |
Open the named variable for reading
This method prepares the multi-resolution, multi-lod data volume, indicated by a variable name and time step pair, for subsequent read operations by methods of this class. Furthermore, the number of the refinement level parameter, reflevel
indicates the resolution of the volume in the multiresolution hierarchy, and the lod
parameter indicates the level of detail.
The valid range of values for reflevel
is [0..max_refinement], where max_refinement
is the maximum finement level of the data set: GetNumTransforms(). A value of zero indicates the coarsest resolution data, a value of max_refinement
indicates the finest resolution data.
The valid range of values for lod
is [0..max_lod], where max_lod
is the maximum lod of the data set: GetCRatios().size() - 1. A value of zero indicates the highest compression ratio, a value of max_lod
indicates the lowest compression ratio.
An error occurs, indicated by a negative return value, if the volume identified by the {varname, timestep, reflevel, lod} tupple is not present on disk. Note the presence of a volume can be tested for with the VariableExists() method.
- Parameters
-
[in] | timestep | Time step of the variable to read |
[in] | varname | Name of the variable to read |
[in] | reflevel | Refinement level of the variable. A value of -1 indicates the maximum refinment level defined for the VDC |
[in] | lod | Level of detail requested. A value of -1 indicates the lowest compression level available for the VDC |
- See also
- GetVariables3D(), GetVariables2DXY(), GetNumTransforms()
Implemented in VAPoR::DataMgrWC, VAPoR::DataMgrWB, VAPoR::DataMgrMOM, VAPoR::DataMgrGRIB, VAPoR::DataMgrROMS, VAPoR::DataMgrWRF, VAPoR::DataMgrAMR, VAPoR::DataMgrRAMSES, VAPoR::DataMgrMPAS, and VAPoR::DataMgrICON.
virtual int VAPoR::DataMgr::_VariableExists |
( |
size_t |
ts, |
|
|
const char * |
varname, |
|
|
int |
reflevel = 0 , |
|
|
int |
lod = 0 |
|
) |
| const |
|
protectedpure 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 0 if the variable is not present.
- Parameters
-
[in] | ts | A valid time step between 0 and GetNumTimesteps()-1 |
[in] | varname | A valid variable name |
[in] | reflevel | Refinement level requested. The coarsest refinement level is 0 (zero). A value of -1 indicates the finest refinement level contained in the VDC. |
[in] | lod | Compression level of detail requested. The coarsest approximation level is 0 (zero). A value of -1 indicates the finest refinement level contained in the VDC. |
Implemented in VAPoR::DataMgrWC, VAPoR::DataMgrWB, VAPoR::DataMgrMOM, VAPoR::DataMgrAMR, VAPoR::DataMgrGRIB, VAPoR::DataMgrROMS, VAPoR::DataMgrWRF, VAPoR::DataMgrRAMSES, VAPoR::DataMgrMPAS, and VAPoR::DataMgrICON.
virtual vector<string> VAPoR::DataMgr::GetCoordinateVariables |
( |
| ) |
const |
|
inlinevirtual |
Return the names of the coordinate variables.
This method returns a three-element vector naming the X, Y, and Z coordinate variables, respectively. The special name "NONE" indicates that a coordinate variable name does not exist for a particular dimension.
- Note
- The existence of a coordinate variable name does not imply the existence of the coordinate variable itself.
- Return values
-
vector | is three-element vector of coordinate variable names. |
Definition at line 129 of file DataMgr.h.
virtual void VAPoR::DataMgr::GetDim |
( |
size_t |
dim[3], |
|
|
int |
reflevel = 0 |
|
) |
| const |
|
inlinevirtual |
Get the dimension of a volume
Returns the X,Y,Z coordinate dimensions of all data variables in grid (voxel) coordinates at the resolution level indicated by reflevel
. Hence, all variables of a given type (3D or 2D) must have the same dimension. If reflevel
is -1 (or the value returned by GetNumTransforms()) the native grid resolution is returned. In fact, any value outside the valid range is treated as the maximum refinement level
- Parameters
-
[in] | reflevel | Refinement level of the variable |
[out] | dim | A three element vector (ordered X, Y, Z) containing the voxel dimensions of the data at the specified resolution. |
- See also
- GetNumTransforms()
Definition at line 72 of file DataMgr.h.
virtual RegularGrid* VAPoR::DataMgr::GetGrid |
( |
size_t |
ts, |
|
|
string |
varname, |
|
|
int |
reflevel, |
|
|
int |
lod, |
|
|
const size_t |
min[3], |
|
|
const size_t |
max[3], |
|
|
bool |
lock = false |
|
) |
| |
|
virtual |
Read in and return a subregion from the dataset.
GetGrid() will first check to see if the requested region resides in cache. If so, no reads are performed. If the named variable is not in cache, GetGrid() will next check to see if the variable can be calculated by recursively executing PipeLine stages (
- See also
- NewPipeline()). Finally, if the varible is not the result of PipeLine execution GetGrid() will attempt to access the varible through methods implemented by derived classes of the DataMgr class.
The ts
, varname
, lod
, and level
pararmeter tuple identifies the time step, variable name, level-of-detail, and refinement level, respectively, of the requested volume. The min
and max
vectors identify the minium and maximum extents, in voxel coordinates, of the subregion of interest. The minimum valid value of min
is (0,0,0), the maximum valid value of max
is (nx-1,ny-1,nz-1), where nx, ny, and nz are the voxel dimensions of the volume at the resolution indicated by level
. I.e. the coordinates are specified relative to the desired volume resolution. If the requested region is available, GetGrid() returns a pointer to a RegularGrid class containg the requested subregion. It is the callers responsbility to delete the returned pointer when it is no longer needed. Subsequent calls to GetGrid() may invalidate the memory space returned by previous calls unless the lock
parameter is set, in which case the grid returned by GetGrid() is locked into memory until freed by a call the UnlockGrid() method (or the class is destroyed).
GetGrid() will fail if the requested data are not present. The VariableExists() method may be used to determine if the data identified by a (resolution,timestep,variable) tupple are available on disk.
- Note
- The
lock
parameter increments a counter associated with the requested region of memory. The counter is decremented when UnlockGrid() is invoked.
If varname
is the empty string, a pointer to dataless RegularGrid is returned.
- Parameters
-
[in] | ts | A valid time step between 0 and GetNumTimesteps()-1 |
[in] | varname | A valid variable name or the empty string |
[in] | reflevel | Refinement level requested |
[in] | lod | Level of detail requested |
[in] | min | Minimum region bounds in voxels |
[in] | max | Maximum region bounds in voxels |
[in] | lock | If true, the memory region will be locked into the cache (i.e. valid after subsequent GetRegion() calls). |
- Return values
-
ptr | A pointer to a region containing the desired data, or NULL if the region can not be extracted. |
- See also
- NewPipeline(), GetErrMsg()
virtual double VAPoR::DataMgr::GetTSUserTime |
( |
size_t |
ts | ) |
const |
|
inlinevirtual |
Return the time for a time step
This method returns the time, in user-defined coordinates, associated with the time step, ts
. Variables such as velocity field components that are expressed in distance per units of time are expected to use the same time coordinates as the values returned by this mehtod.
- Parameters
-
- Return values
-
value | The user time at time step ts . If ts is outside the valid range zero is returned. |
Definition at line 147 of file DataMgr.h.
virtual void VAPoR::DataMgr::GetTSUserTimeStamp |
( |
size_t |
ts, |
|
|
string & |
s |
|
) |
| const |
|
inlinevirtual |
Return the time for a time step
This method returns the user time, associated with the time step, ts
, as a formatted string. The returned time stamp is intended to be used for annotation purposes
- Parameters
-
[in] | ts | A valid data set time step in the range from zero to GetNumTimeSteps() - 1. |
[out] | s | A formated time string. If ts is outside the valid range zero the empty string is returned. |
Definition at line 153 of file DataMgr.h.
virtual void VAPoR::DataMgr::MapUserToVox |
( |
size_t |
timestep, |
|
|
const double |
vcoord0[3], |
|
|
size_t |
vcoord1[3], |
|
|
int |
reflevel = 0 , |
|
|
int |
lod = 0 |
|
) |
| |
|
virtual |
Map floating point coordinates to integer voxel offsets.
Map floating point coordinates, specified relative to a user-defined coordinate system, to the closest integer voxel coordinates for a voxel at a given refinement level. The integer voxel coordinates, vcoord1
, returned are specified relative to the refinement level indicated by reflevel
for time step, timestep
. The mapping is performed by using linear interpolation Results are undefined if vcoord0
is outside of the volume boundary.
If a user coordinate system is not defined for the specified time step, timestep
, the global extents for the VDC will be used.
- Parameters
-
[in] | timestep | Time step of the variable If an invalid timestep is supplied the global domain extents are used. |
[in] | vcoord0 | Coordinate of input point in floating point coordinates |
[out] | vcoord1 | Integer coordinates of closest voxel, at the indicated refinement level, to the specified point. integer coordinates |
[in] | reflevel | Refinement level of the variable. A value of -1 indicates the maximum refinment level defined for the VDC. In fact, any invalid value is treated as the maximum refinement level |
- See also
- GetGridType(), GetExtents()