VAPoR  0.1
Public Types | Public Member Functions | Protected Attributes | List of all members
VAPoR::Metadata Class Referenceabstract

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>

Inheritance diagram for VAPoR::Metadata:
VAPoR::DCReader VAPoR::MetadataVDC VAPoR::DCReaderGRIB VAPoR::DCReaderMOM VAPoR::DCReaderNCDF VAPoR::DCReaderROMS VAPoR::DCReaderWRF VAPoR::MetadataSpherical VAPoR::VDFIOBase VAPoR::DataMgrGRIB VAPoR::DataMgrMOM VAPoR::DataMgrROMS VAPoR::DataMgrWRF VAPoR::AMRIO VAPoR::WaveCodecIO VAPoR::WaveletBlockIOBase VAPoR::DataMgrAMR VAPoR::DataMgrWC VAPoR::WaveletBlock3DReader VAPoR::WaveletBlock3DRegionReader VAPoR::WaveletBlock3DRegionWriter VAPoR::WaveletBlock3DWriter VAPoR::WaveletBlock3DBufReader VAPoR::DataMgrWB VAPoR::WaveletBlock3DBufWriter

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
 

Detailed Description

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

Author
John Clyne
Version
$Revision$
Date
$Date$

Definition at line 34 of file Metadata.h.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

VAPoR::Metadata::Metadata ( )
inline

Definition at line 48 of file Metadata.h.

virtual VAPoR::Metadata::~Metadata ( )
inlinevirtual

Definition at line 49 of file Metadata.h.

Member Function Documentation

virtual void VAPoR::Metadata::GetBlockSize ( size_t  bs[3],
int  reflevel 
) const
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.

Parameters
[in]reflevelRefinement level

Implemented in VAPoR::WaveCodecIO, VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderWRF, VAPoR::DCReaderNCDF, VAPoR::DCReaderMOM, and VAPoR::DCReaderROMS.

virtual std::vector<std::string> VAPoR::Metadata::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
vectoris 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.

virtual std::string VAPoR::Metadata::GetCoordSystemType ( ) const
inlinevirtual

Return the coordinate system type. One of cartesian or spherical

Return values
type

Reimplemented in VAPoR::MetadataVDC, and VAPoR::DCReaderNCDF.

Definition at line 111 of file Metadata.h.

virtual std::vector<size_t> VAPoR::Metadata::GetCRatios ( ) const
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.

Return values
crA vector of one or more compression factors

Reimplemented in VAPoR::MetadataVDC.

Definition at line 103 of file Metadata.h.

virtual void VAPoR::Metadata::GetDim ( size_t  dim[3],
int  reflevel = 0 
) const
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]reflevelRefinement level of the variable
[out]dimA three element vector (ordered X, Y, Z) containing the voxel dimensions of the data at the specified resolution.
See also
GetNumTransforms()

Reimplemented in VAPoR::WaveletBlockIOBase.

Referenced by VAPoR::DataMgrAMR::_GetDim(), and VAPoR::DataMgrWC::_GetDim().

virtual void VAPoR::Metadata::GetDimBlk ( size_t  bdim[3],
int  reflevel = 0 
) const
virtual

Get dimension of a volume in blocks

Performs same operation as GetDim() except returns dimensions in block coordinates instead of voxels.

Parameters
[in]reflevelRefinement 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]bdimTransformed dimension in blocks.
See also
Metadata::GetNumTransforms()

Reimplemented in VAPoR::WaveletBlockIOBase.

virtual std::vector<double> VAPoR::Metadata::GetExtents ( size_t  ts = 0) const
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.

Parameters
[in]tsA 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
extentsA 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.

virtual void VAPoR::Metadata::GetGridDim ( size_t  dim[3]) const
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.

Parameters
[in]reflevelRefinement level of the variable
[out]dimA 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.

virtual std::vector<long> VAPoR::Metadata::GetGridPermutation ( ) const
pure virtual

Return a three-element integer array indicating the coordinate ordering permutation.

Return values
integer-vector

Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, VAPoR::DCReaderGRIB, and VAPoR::DCReaderNCDF.

virtual std::string VAPoR::Metadata::GetGridType ( ) const
inlinevirtual

Return the grid type. One of regular, stretched, block_amr, or spherical

Return values
type

Reimplemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderWRF, VAPoR::DCReaderNCDF, VAPoR::DCReaderMOM, and VAPoR::DCReaderROMS.

Definition at line 119 of file Metadata.h.

virtual std::string VAPoR::Metadata::GetMapProjection ( ) const
inlinevirtual

Return the Proj4 map projection string.

Return values
valueAn 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.

virtual bool VAPoR::Metadata::GetMissingValue ( std::string  varname,
float &  value 
) const
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

Parameters
[in]varnameA 3D or 2D variable name
[out]valueThe missing data value. Undefined if no missing value is present.
Return values
returnstrue if missing data are present

Definition at line 336 of file Metadata.h.

Referenced by VAPoR::DataMgrGRIB::_GetMissingValue().

virtual long VAPoR::Metadata::GetNumTimeSteps ( ) const
pure virtual

Return the number of time steps in the data collection

Return values
valueThe number of time steps

Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, VAPoR::DCReaderMOM, VAPoR::DCReaderWRF, and VAPoR::DCReaderNCDF.

virtual int VAPoR::Metadata::GetNumTransforms ( ) const
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.

Return values
nThe number of coarsened data approximations available

Reimplemented in VAPoR::WaveCodecIO, and VAPoR::MetadataVDC.

Definition at line 90 of file Metadata.h.

virtual std::vector<long> VAPoR::Metadata::GetPeriodicBoundary ( ) const
pure virtual

Return a three-element boolean array indicating if the X,Y,Z axes have periodic boundaries, respectively.

Return values
boolean-vector

Implemented in VAPoR::MetadataVDC, VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, VAPoR::DCReaderGRIB, and VAPoR::DCReaderNCDF.

virtual double VAPoR::Metadata::GetTSUserTime ( size_t  ts) const
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.

Parameters
[in]tsA valid data set time step in the range from zero to GetNumTimeSteps() - 1.
Return values
valueThe 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.

virtual void VAPoR::Metadata::GetTSUserTimeStamp ( size_t  ts,
std::string &  s 
) const
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

Parameters
[in]tsA valid data set time step in the range from zero to GetNumTimeSteps() - 1.
[out]sA formated time string. If ts is outside the valid range zero the empty string is returned.

Implemented in VAPoR::DCReaderGRIB.

virtual std::vector<double> VAPoR::Metadata::GetTSXCoords ( size_t  ts) const
inlinevirtual

Return the X dimension coordinate array, if it exists

Return values
valueAn 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.
See also
GetGridType()

Reimplemented in VAPoR::MetadataVDC.

Definition at line 130 of file Metadata.h.

virtual std::vector<double> VAPoR::Metadata::GetTSYCoords ( size_t  ts) const
inlinevirtual

Reimplemented in VAPoR::MetadataVDC.

Definition at line 133 of file Metadata.h.

virtual std::vector<double> VAPoR::Metadata::GetTSZCoords ( size_t  ts) const
inlinevirtual

Reimplemented in VAPoR::MetadataVDC, VAPoR::DCReaderGRIB, VAPoR::DCReaderROMS, and VAPoR::DCReaderMOM.

Definition at line 136 of file Metadata.h.

virtual std::vector<std::string> VAPoR::Metadata::GetVariableNames ( ) const
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

Return values
valueis a space-separated list of variable names
virtual std::vector<std::string> VAPoR::Metadata::GetVariables2DXY ( ) const
pure virtual

Return the names of the 2D, XY variables in the collection

Return values
valueis 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.

virtual std::vector<std::string> VAPoR::Metadata::GetVariables2DXZ ( ) const
pure virtual

Return the names of the 2D, XZ variables in the collection

Return values
valueis 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.

virtual std::vector<std::string> VAPoR::Metadata::GetVariables2DYZ ( ) const
pure virtual

Return the names of the 2D, YZ variables in the collection

Return values
valueis 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.

virtual std::vector<std::string> VAPoR::Metadata::GetVariables3D ( ) const
pure virtual

Return the names of the 3D variables in the collection

Return values
valueis 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 VarType_T VAPoR::Metadata::GetVarType ( const std::string &  varname) const
virtual

Return the variable type for the indicated variable

This method returns the variable type for the variable named by varname.

Parameters
[in]varnameA 3D or 2D variable name
Return values
typeThe variable type. The constant VAR
virtual bool VAPoR::Metadata::IsCoordinateVariable ( std::string  varname) const
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();

See also
GetCoordinateVariables()
virtual int VAPoR::Metadata::IsValidRegion ( const size_t  min[3],
const size_t  max[3],
int  reflevel = 0 
) const
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.

Parameters
[in]minMinimum region extents in voxel coordinates
[in]maxMaximum region extents in voxel coordinates
Return values
booleanTrue if region is valid
Parameters
[in]reflevelRefinement 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 int VAPoR::Metadata::IsValidRegionBlk ( const size_t  min[3],
const size_t  max[3],
int  reflevel = 0 
) const
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.

Parameters
[in]minMinimum region extents in block coordinates
[in]maxMaximum region extents in block coordinates
[in]reflevelRefinement 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.
Return values
booleanTrue if region is valid
void VAPoR::Metadata::MapUserToVox ( size_t  timestep,
const double  vcoord0[3],
size_t  vcoord1[3],
int  reflevel 
) const
virtual void VAPoR::Metadata::MapVoxToBlk ( const size_t  vcoord[3],
size_t  bcoord[3],
int  reflevel = -1 
) const
virtual

Map integer voxel coordinates into integer block coordinates.

Compute the integer coordinate of the block containing a specified voxel.

Parameters
[in]vcoordCoordinate of input voxel in integer (voxel) coordinates
[out]bcoordCoordinate of block in integer coordinates containing the voxel.
[in]reflevelRefinement level of the variable. A value of -1 indicates the maximum refinment level defined.
virtual void VAPoR::Metadata::MapVoxToUser ( size_t  timestep,
const size_t  vcoord0[3],
double  vcoord1[3],
int  ref_level = 0 
) const
virtual

Member Data Documentation

bool VAPoR::Metadata::_deprecated_get_dim
protected

Definition at line 428 of file Metadata.h.


The documentation for this class was generated from the following file: