VAPoR
0.1
|
An abstract class for managing metadata for a collection of gridded data. The data collection may support two forms of data reduction: multi-resolution (a hierarchy of grids, each dimension a factor of two coarser than the preceeding), and level-of-detail (a sequence of one more compressions). More...
#include <Metadata.h>
Public Types | |
enum | VarType_T { VARUNKNOWN = -1, VAR3D, VAR2D_XY, VAR2D_XZ, VAR2D_YZ } |
Public Member Functions | |
Metadata () | |
virtual | ~Metadata () |
virtual void | GetGridDim (size_t dim[3]) const =0 |
virtual void | GetBlockSize (size_t bs[3], int reflevel) const =0 |
virtual int | GetNumTransforms () const |
virtual std::vector< size_t > | GetCRatios () const |
virtual std::string | GetCoordSystemType () const |
virtual std::string | GetGridType () const |
virtual std::vector< double > | GetTSXCoords (size_t ts) const |
virtual std::vector< double > | GetTSYCoords (size_t ts) const |
virtual std::vector< double > | GetTSZCoords (size_t ts) const |
virtual std::vector< double > | GetExtents (size_t ts=0) const =0 |
virtual long | GetNumTimeSteps () const =0 |
virtual std::vector< std::string > | GetVariableNames () const |
virtual std::string | GetMapProjection () const |
virtual std::vector< std::string > | GetVariables3D () const =0 |
virtual std::vector< std::string > | GetVariables2DXY () const =0 |
virtual std::vector< std::string > | GetVariables2DXZ () const =0 |
virtual std::vector< std::string > | GetVariables2DYZ () const =0 |
virtual std::vector< std::string > | GetCoordinateVariables () const |
virtual std::vector< long > | GetPeriodicBoundary () const =0 |
virtual std::vector< long > | GetGridPermutation () const =0 |
virtual double | GetTSUserTime (size_t ts) const =0 |
virtual void | GetTSUserTimeStamp (size_t ts, std::string &s) const =0 |
virtual void | GetDim (size_t dim[3], int reflevel=0) const |
virtual void | GetDimBlk (size_t bdim[3], int reflevel=0) const |
virtual bool | GetMissingValue (std::string varname, float &value) const |
virtual void | MapVoxToBlk (const size_t vcoord[3], size_t bcoord[3], int reflevel=-1) const |
virtual void | MapVoxToUser (size_t timestep, const size_t vcoord0[3], double vcoord1[3], int ref_level=0) const |
void | MapUserToVox (size_t timestep, const double vcoord0[3], size_t vcoord1[3], int reflevel) const |
virtual VarType_T | GetVarType (const std::string &varname) const |
virtual int | IsValidRegion (const size_t min[3], const size_t max[3], int reflevel=0) const |
virtual int | IsValidRegionBlk (const size_t min[3], const size_t max[3], int reflevel=0) const |
virtual bool | IsCoordinateVariable (std::string varname) const |
Protected Attributes | |
bool | _deprecated_get_dim |
An abstract class for managing metadata for a collection of gridded data. The data collection may support two forms of data reduction: multi-resolution (a hierarchy of grids, each dimension a factor of two coarser than the preceeding), and level-of-detail (a sequence of one more compressions).
Implementers must derive a concrete class from Metadata to support a particular data collection type
Definition at line 34 of file Metadata.h.
An enum of variable types. Variables defined in a data collection may be either three-dimensional (VAR3D
), or two-dimensional. In the latter case the two-dimesional data are constrained to lie in the XY, XZ, or YZ coordinate planes of a 3D volume
Enumerator | |
---|---|
VARUNKNOWN | |
VAR3D | |
VAR2D_XY | |
VAR2D_XZ | |
VAR2D_YZ |
Definition at line 43 of file Metadata.h.
|
inline |
Definition at line 48 of file Metadata.h.
|
inlinevirtual |
Definition at line 49 of file Metadata.h.
|
pure 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.
[in] | reflevel | Refinement level |
Implemented in VAPoR::WaveCodecIO, VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderWRF, VAPoR::DCReaderNCDF, VAPoR::DCReaderMOM, and VAPoR::DCReaderROMS.
|
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.
vector | is three-element vector of coordinate variable names. |
Reimplemented in VAPoR::MetadataVDC, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, and VAPoR::DCReaderNCDF.
Definition at line 236 of file Metadata.h.
|
inlinevirtual |
Return the coordinate system type. One of cartesian or spherical
type |
Reimplemented in VAPoR::MetadataVDC, and VAPoR::DCReaderNCDF.
Definition at line 111 of file Metadata.h.
|
inlinevirtual |
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.
cr | A vector of one or more compression factors |
Reimplemented in VAPoR::MetadataVDC.
Definition at line 103 of file Metadata.h.
|
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
[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. |
Reimplemented in VAPoR::WaveletBlockIOBase.
Referenced by VAPoR::DataMgrAMR::_GetDim(), and VAPoR::DataMgrWC::_GetDim().
|
virtual |
Get dimension of a volume in blocks
Performs same operation as GetDim() except returns dimensions in block coordinates instead of voxels.
[in] | reflevel | Refinement level of the variable. A value of -1 indicates the maximum refinment level defined. In fact, any value outside the valid range is treated as the maximum refinement level |
[out] | bdim | Transformed dimension in blocks. |
Reimplemented in VAPoR::WaveletBlockIOBase.
|
pure 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.
[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. |
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::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, and VAPoR::DCReaderNCDF.
|
pure virtual |
Get the native dimension of a volume
Returns the X,Y,Z coordinate dimensions of all data variables in grid (voxel) coordinates full resolution.
[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 full resolution. |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderNCDF, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, and VAPoR::DCReaderROMS.
|
pure virtual |
Return a three-element integer array indicating the coordinate ordering permutation.
integer-vector |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, VAPoR::DCReaderGRIB, and VAPoR::DCReaderNCDF.
|
inlinevirtual |
Return the grid type. One of regular, stretched, block_amr, or spherical
type |
Reimplemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderWRF, VAPoR::DCReaderNCDF, VAPoR::DCReaderMOM, and VAPoR::DCReaderROMS.
Definition at line 119 of file Metadata.h.
|
inlinevirtual |
Return the Proj4 map projection string.
value | An empty string if a Proj4 map projection is not available, otherwise a properly formatted Proj4 projection string is returned. |
Reimplemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, VAPoR::DCReaderMOM, and VAPoR::DCReaderWRF.
Definition at line 189 of file Metadata.h.
|
inlinevirtual |
Return the value of the missing data value
This method returns the value of the missing data value the specified variable. If no missing data are present the method returns false
[in] | varname | A 3D or 2D variable name |
[out] | value | The missing data value. Undefined if no missing value is present. |
returns | true if missing data are present |
Definition at line 336 of file Metadata.h.
Referenced by VAPoR::DataMgrGRIB::_GetMissingValue().
|
pure virtual |
Return the number of time steps in the data collection
value | The number of time steps |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, VAPoR::DCReaderMOM, VAPoR::DCReaderWRF, and VAPoR::DCReaderNCDF.
|
inlinevirtual |
Return number of transformations in hierarchy
For multi-resolution data this method returns the number of coarsened approximations present. If no approximations are available - if only the native data are present - the return value is 0.
n | The number of coarsened data approximations available |
Reimplemented in VAPoR::WaveCodecIO, and VAPoR::MetadataVDC.
Definition at line 90 of file Metadata.h.
|
pure virtual |
Return a three-element boolean array indicating if the X,Y,Z axes have periodic boundaries, respectively.
boolean-vector |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, VAPoR::DCReaderGRIB, and VAPoR::DCReaderNCDF.
|
pure 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.
[in] | ts | A valid data set time step in the range from zero to GetNumTimeSteps() - 1. |
value | The user time at time step ts . If ts is outside the valid range zero is returned. |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, VAPoR::DCReaderNCDF, and VAPoR::DCReaderGRIB.
|
pure 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
[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::DCReaderGRIB.
|
inlinevirtual |
Return the X dimension coordinate array, if it exists
value | An array of monotonically changing values specifying the X 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. |
Reimplemented in VAPoR::MetadataVDC.
Definition at line 130 of file Metadata.h.
|
inlinevirtual |
Reimplemented in VAPoR::MetadataVDC.
Definition at line 133 of file Metadata.h.
|
inlinevirtual |
Reimplemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, and VAPoR::DCReaderMOM.
Definition at line 136 of file Metadata.h.
|
virtual |
Return the names of the variables in the collection
This method returns a vector of all variables of all types in the data collection
value | is a space-separated list of variable names |
|
pure virtual |
Return the names of the 2D, XY variables in the collection
value | is a vector of 2D XY variable names An emptry string is returned if no variables of this type are present |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, and VAPoR::DCReaderNCDF.
|
pure virtual |
Return the names of the 2D, XZ variables in the collection
value | is a vectort of 2D ZY variable names An emptry string is returned if no variables of this type are present |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, and VAPoR::DCReaderNCDF.
|
pure virtual |
Return the names of the 2D, YZ variables in the collection
value | is a vector of 2D YZ variable names An emptry string is returned if no variables of this type are present |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, and VAPoR::DCReaderNCDF.
|
pure virtual |
Return the names of the 3D variables in the collection
value | is a vector of 3D variable names. An emptry string is returned if no variables of this type are present |
Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, and VAPoR::DCReaderNCDF.
|
virtual |
Return the variable type for the indicated variable
This method returns the variable type for the variable named by varname
.
[in] | varname | A 3D or 2D variable name |
type | The variable type. The constant VAR |
|
virtual |
Returns true if the named variable is a coordinate variable
This method is a convenience function that returns true if if the variable named by varname
is a coordinate variable. A variable is a coordinate variable if it is returned by GetCoordinateVariables();
|
virtual |
Return true if indicated region coordinates are valid
Returns true if the region defined by reflevel
, min
, max
is valid. I.e. returns true if the indicated volume subregion is contained within the volume. Coordinates are specified relative to the refinement level.
[in] | min | Minimum region extents in voxel coordinates |
[in] | max | Maximum region extents in voxel coordinates |
boolean | True if region is valid |
[in] | reflevel | Refinement level of the variable. A value of -1 indicates the maximum refinment level defined. In fact, any invalid value is treated as the maximum refinement level. |
|
virtual |
Return true if indicated region coordinates are valid
Returns true if the region defined by reflevel
, and the block coordinates min
, max
are valid. I.e. returns true if the indicated volume subregion is contained within the volume. Coordinates are specified relative to the refinement level.
[in] | min | Minimum region extents in block coordinates |
[in] | max | Maximum region extents in block coordinates |
[in] | reflevel | Refinement level of the variable. A value of -1 indicates the maximum refinment level defined. In fact, any invalid value is treated as the maximum refinement level. |
boolean | True if region is valid |
void VAPoR::Metadata::MapUserToVox | ( | size_t | timestep, |
const double | vcoord0[3], | ||
size_t | vcoord1[3], | ||
int | reflevel | ||
) | const |
|
virtual |
Map integer voxel coordinates into integer block coordinates.
Compute the integer coordinate of the block containing a specified voxel.
[in] | vcoord | Coordinate of input voxel in integer (voxel) coordinates |
[out] | bcoord | Coordinate of block in integer coordinates containing the voxel. |
[in] | reflevel | Refinement level of the variable. A value of -1 indicates the maximum refinment level defined. |
|
virtual |
|
protected |
Definition at line 428 of file Metadata.h.