VAPOR3 3.9.4
Functions
VAPoR::DataMgrUtils Namespace Reference

Functions

VDF_API bool MaxXFormPresent (const DataMgr *dataMgr, size_t timestep, string varname, size_t &maxXForm)
 
VDF_API bool MaxLODPresent (const DataMgr *dataMgr, size_t timestep, string varname, size_t &maxLOD)
 
VDF_API int ConvertPCSToLonLat (const DataMgr *dataMgr, double coords[], int npoints=1)
 
VDF_API int ConvertPCSToLonLat (string projString, double coords[], int npoints=1)
 
VDF_API int ConvertLonLatToPCS (const DataMgr *dataMgr, double coords[], int npoints=1)
 
VDF_API int ConvertLonLatToPCS (string projString, double coords[], int npoints=1)
 
template<typename T >
VDF_API int GetGrids (DataMgr *dataMgr, size_t ts, const vector< string > &varnames, const T &minExtsReq, const T &maxExtsReq, bool useLowerAccuracy, int *refLevel, int *lod, std::vector< Grid * > &grids, bool lock=false)
 
VDF_API int GetGrids (DataMgr *dataMgr, size_t ts, string varname, const CoordType &minExtsReq, const CoordType &maxExtsReq, bool useLowerAccuracy, int *refLevel, int *lod, Grid **gridptr, bool lock=false)
 
VDF_API int GetGrids (DataMgr *dataMgr, size_t ts, string varname, const DimsType &minExtsReq, const DimsType &maxExtsReq, bool useLowerAccuracy, int *refLevel, int *lod, Grid **gridptr, bool lock=false)
 
VDF_API int GetGrids (DataMgr *dataMgr, size_t ts, const vector< string > &varnames, bool useLowerAccuracy, int *refLevel, int *lod, std::vector< Grid * > &grids, bool lock=false)
 
VDF_API int GetGrids (DataMgr *dataMgr, size_t ts, string varname, bool useLowerAccuracy, int *refLevel, int *lod, Grid **gridptr, bool lock=false)
 
VDF_API void UnlockGrids (DataMgr *dataMgr, const std::vector< Grid * > &grids)
 
bool GetAxes (const DataMgr *dataMgr, string varname, vector< int > &axes)
 
VDF_API bool GetExtents (DataMgr *dataMgr, size_t timestep, string varname, int refLevel, int lod, CoordType &minExts, CoordType &maxExts)
 
VDF_API bool GetExtents (DataMgr *dataMgr, size_t timestep, const vector< string > &varnames, int refLevel, int lod, CoordType &minExts, CoordType &maxExts, vector< int > &axes)
 
VDF_API int GetDefaultMetaInfoStride (DataMgr *dataMgr, std::string varname, int refinementLevel)
 Used by the histo for calculating some meta data.
 
VDF_API double Get2DRendererDefaultZ (DataMgr *dataMgr, size_t ts, int refLevel, int lod)
 
VDF_API bool GetFirstExistingVariable (DataMgr *dataMgr, int level, int lod, int ndim, string &varname, size_t &ts)
 
VDF_API bool GetFirstExistingVariable (DataMgr *dataMgr, size_t ts, int level, int lod, int ndim, string &varname)
 

Function Documentation

◆ ConvertLonLatToPCS() [1/2]

VDF_API int VAPoR::DataMgrUtils::ConvertLonLatToPCS ( const DataMgr dataMgr,
double  coords[],
int  npoints = 1 
)

Convert lon/lat coordinates to Projected Coordinate System coordinates, in-place.

Perform in-place conversion of an array of interleaved pairs of coordinates from lon-lat to PCS coordinates. The input pairs are ordered longitude, then latitude. The output pairs are ordered X, then Y Return false if can't do it.

Parameters
[in/out]coords coordinates to be converted
[in]npointsNumber of points to convert.
Returns
true if successful

◆ ConvertLonLatToPCS() [2/2]

VDF_API int VAPoR::DataMgrUtils::ConvertLonLatToPCS ( string  projString,
double  coords[],
int  npoints = 1 
)

◆ ConvertPCSToLonLat() [1/2]

VDF_API int VAPoR::DataMgrUtils::ConvertPCSToLonLat ( const DataMgr dataMgr,
double  coords[],
int  npoints = 1 
)

Convert Projected Coordinate System coordinates to lon/lat in-place.

Perform in-place conversion of an array of interleaved pairs of coordinates from PCS to lon-lat coordinates. The input pairs are ordered X, then Y. The output pairs are ordered Longitude, then Latitude Return false if can't do it.

Parameters
[in/out]coords coordinates to be converted
[in]npointsNumber of points to convert.
Returns
true if successful

◆ ConvertPCSToLonLat() [2/2]

VDF_API int VAPoR::DataMgrUtils::ConvertPCSToLonLat ( string  projString,
double  coords[],
int  npoints = 1 
)

◆ Get2DRendererDefaultZ()

VDF_API double VAPoR::DataMgrUtils::Get2DRendererDefaultZ ( DataMgr dataMgr,
size_t  ts,
int  refLevel,
int  lod 
)

Get default z value at the base of the domain. Useful for applying a height value to 2D renderers.

Parameters
[in]dataMgrCurrent (valid) dataMgr
Return values
defaultheight value for current dataset

◆ GetAxes()

bool VAPoR::DataMgrUtils::GetAxes ( const DataMgr dataMgr,
string  varname,
vector< int > &  axes 
)

Get the spatial coordinate axes for a variable

Returns the ordered (fastest to slowest varying) coordinate axis for a named variable.

Parameters
[in]varnameName of variable
[out]axesOrdered list of axis indecies. The range of possible axes values is [0..2], with 0 corresponding to the X coordinate axis, 1 corresponding to Y, and 2 to Z.

◆ GetDefaultMetaInfoStride()

VDF_API int VAPoR::DataMgrUtils::GetDefaultMetaInfoStride ( DataMgr dataMgr,
std::string  varname,
int  refinementLevel 
)

Used by the histo for calculating some meta data.

◆ GetExtents() [1/2]

VDF_API bool VAPoR::DataMgrUtils::GetExtents ( DataMgr dataMgr,
size_t  timestep,
const vector< string > &  varnames,
int  refLevel,
int  lod,
CoordType minExts,
CoordType maxExts,
vector< int > &  axes 
)

Get coordinate extents for one or more variables.

Get the minimum and maximum coordinate extents of a list of variables at a given time step. This function handles variables with mixed dimensionality, and 2D variables that are defined on different planes. The extents are returned in minExts and maxExts.

Parameters
[in]timestepTime step of variable. Ignored for variables that are not time-varying.
[in]Nameof variable
[out]minExtsA vector whose size matches the dimensionality of the variable, and containing the minimum ordered coordinate extents of varname at time step timestep.
[out]maxExtsA vector whose size matches the dimensionality of the variable, and containing the maximum ordered coordinate extents of varname at time step timestep.
[out]axesA vector indicating the axis of each coordinate returned in minExts and maxExts. See GetAxes()
See also
GetAxes()

◆ GetExtents() [2/2]

VDF_API bool VAPoR::DataMgrUtils::GetExtents ( DataMgr dataMgr,
size_t  timestep,
string  varname,
int  refLevel,
int  lod,
CoordType minExts,
CoordType maxExts 
)

Get a variables coordinate extents

Get the minimum and maximum coordinate extents of a name variable at a given time step. The extents are returned in minExts and maxExts. The size of these vectors will match the dimensionality of the variable. The GetAxes() method can be used to determine which coordinate axes the returned extents correspond to.

If varname is an empty string the function scans the list of available data variables looking for the highest dimension variable available.

Parameters
[in]timestepTime step of variable. Ignored for variables that are not time-varying.
[in]Nameof variable
[out]minExtsA vector whose size matches the dimensionality of the variable, and containing the minimum ordered coordinate extents of varname at time step timestep.
[out]maxExtsA vector whose size matches the dimensionality of the variable, and containing the maximum ordered coordinate extents of varname at time step timestep.
See also
GetAxes()

◆ GetFirstExistingVariable() [1/2]

VDF_API bool VAPoR::DataMgrUtils::GetFirstExistingVariable ( DataMgr dataMgr,
int  level,
int  lod,
int  ndim,
string &  varname,
size_t &  ts 
)

Find the first variable that exists

This function searches a data collection looking over all time steps and variable names for the first available variable it can find with a given dimension ndim, refinement level level, and level of detail lod. A variable is "available" if DataMgr::VariableExists() returns true

Parameters
[in]ndimNumber of spatial dimensions
[out]varnameReturns the name of the first variable found
[out]tsReturns the time step of the first variable found
Return values
statusReturns true if a variable is found, false otherwise
See also
DataMgr::VariableExists()

◆ GetFirstExistingVariable() [2/2]

VDF_API bool VAPoR::DataMgrUtils::GetFirstExistingVariable ( DataMgr dataMgr,
size_t  ts,
int  level,
int  lod,
int  ndim,
string &  varname 
)

Find the first variable that exists at a given time step

This function searches a data collection looking over all variable names for the first available variable it can find with a given dimension ndim, time step ts, refinement level level, and level of detail lod. A variable is "available" if DataMgr::VariableExists() returns true

Parameters
[in]ndimNumber of spatial dimensions
[out]varnameReturns the name of the first variable found
Return values
statusReturns true if a variable is found, false otherwise
See also
DataMgr::VariableExists()

◆ GetGrids() [1/5]

VDF_API int VAPoR::DataMgrUtils::GetGrids ( DataMgr dataMgr,
size_t  ts,
const vector< string > &  varnames,
bool  useLowerAccuracy,
int *  refLevel,
int *  lod,
std::vector< Grid * > &  grids,
bool  lock = false 
)

◆ GetGrids() [2/5]

template<typename T >
VDF_API int VAPoR::DataMgrUtils::GetGrids ( DataMgr dataMgr,
size_t  ts,
const vector< string > &  varnames,
const T &  minExtsReq,
const T &  maxExtsReq,
bool  useLowerAccuracy,
int *  refLevel,
int *  lod,
std::vector< Grid * > &  grids,
bool  lock = false 
)

Method that obtains one or more regular grids at specified timestep, extents, refinement, and lod. If the data is available, but not at the requested extents, refinement or lod, then the extents may be reduced, and the data accuracy may be reduced.

All variables must have same spatial dimensionality

Parameters
[in]tstimestep being requested
[in]variablename(s) being requested
[in]minExtsReqMinimum requested extents
[in]maxExtsReqMaximum requested extents
[in/out]*refLevel : requested refinement may be reduced if only a lower level is available
[in]useLowerAccuracyIf true use lower accuracy data then requested if the requested accuracy is not available
[in/out]*lod : requested lod may be reduced if only a lower lod is available.
[out]gridis a vector of Grid* pointers, one for each variable
[in]lock: if false, the default, UnlockGrids() will be called on each of the grids after they are all successfully allocated. Otherwise, the the grids will be locked in memory until released by an explicit call to UnlockGrids()

◆ GetGrids() [3/5]

VDF_API int VAPoR::DataMgrUtils::GetGrids ( DataMgr dataMgr,
size_t  ts,
string  varname,
bool  useLowerAccuracy,
int *  refLevel,
int *  lod,
Grid **  gridptr,
bool  lock = false 
)

◆ GetGrids() [4/5]

VDF_API int VAPoR::DataMgrUtils::GetGrids ( DataMgr dataMgr,
size_t  ts,
string  varname,
const CoordType minExtsReq,
const CoordType maxExtsReq,
bool  useLowerAccuracy,
int *  refLevel,
int *  lod,
Grid **  gridptr,
bool  lock = false 
)

◆ GetGrids() [5/5]

VDF_API int VAPoR::DataMgrUtils::GetGrids ( DataMgr dataMgr,
size_t  ts,
string  varname,
const DimsType minExtsReq,
const DimsType maxExtsReq,
bool  useLowerAccuracy,
int *  refLevel,
int *  lod,
Grid **  gridptr,
bool  lock = false 
)

◆ MaxLODPresent()

VDF_API bool VAPoR::DataMgrUtils::MaxLODPresent ( const DataMgr dataMgr,
size_t  timestep,
string  varname,
size_t &  maxLOD 
)

Return the maximum available LOD level for a variable.

This method checks for the existence of a variable at all available levels of detail (see DataMgr::GetCRatios()), and returns the highest available level. The minimum level is zero and the max is DataMgr::GetCRatios().size() - 1.

Parameters
[in]timestepTime Step
[in]varnamevariable name
[out]maxLODMaximum available level
Returns
status Return true on success. Return false if the no LOD levels exist e.g. the variable does not exist.

◆ MaxXFormPresent()

VDF_API bool VAPoR::DataMgrUtils::MaxXFormPresent ( const DataMgr dataMgr,
size_t  timestep,
string  varname,
size_t &  maxXForm 
)

Return the maximum available transform level for a variable.

This method checks for the existence of a variable at all available transform levels (see DataMgr::GetNumRefLevels()), and returns the highest available level. The minimum level is zero and the max is DataMgr::GetNumRefLevels() - 1.

Parameters
[in]timestepTime Step
[in]varnamevariable name
[out]maxXFormMaximum available level
Returns
status Return true on success. Return false if the no transform levels exist e.g. the variable does not exist.

◆ UnlockGrids()

VDF_API void VAPoR::DataMgrUtils::UnlockGrids ( DataMgr dataMgr,
const std::vector< Grid * > &  grids 
)