VAPoR  0.1
Classes | Public Member Functions | List of all members
VAPoR::DCReaderWRF Class Reference

??? More...

#include <DCReaderWRF.h>

Inheritance diagram for VAPoR::DCReaderWRF:
VAPoR::DCReader VAPoR::Metadata VetsUtil::MyBase VAPoR::DataMgrWRF

Public Member Functions

 DCReaderWRF (const std::vector< string > &files)
 
virtual ~DCReaderWRF ()
 
virtual void GetGridDim (size_t dim[3]) const
 
void GetBlockSize (size_t bs[3], int) const
 
virtual string GetGridType () const
 
virtual std::vector< double > GetExtents (size_t ts=0) const
 
long GetNumTimeSteps () const
 
virtual string GetMapProjection () const
 
virtual std::vector< string > GetVariables3D () const
 
virtual std::vector< string > GetVariables2DXY () const
 
virtual std::vector< string > GetVariables2DXZ () const
 
virtual std::vector< string > GetVariables2DYZ () const
 
virtual std::vector< string > GetVariables3DExcluded () const
 
virtual std::vector< string > GetVariables2DExcluded () const
 
virtual std::vector< string > GetCoordinateVariables () const
 
virtual std::vector< long > GetPeriodicBoundary () const
 
virtual std::vector< long > GetGridPermutation () const
 
double GetTSUserTime (size_t ts) const
 
bool GetMissingValue (string varname, float &value) const
 
void GetTSUserTimeStamp (size_t ts, string &s) const
 
virtual bool IsCoordinateVariable (string varname) const
 
virtual int OpenVariableRead (size_t timestep, string varname, int reflevel=0, int lod=0)
 
virtual int CloseVariable ()
 
virtual int ReadSlice (float *slice)
 
virtual int Read (float *data)
 
virtual bool VariableExists (size_t ts, string varname, int i0=0, int i1=0) const
 
void EnableLegacyTimeConversion ()
 
virtual void GetLatLonExtents (size_t ts, double lon_exts[2], double lat_exts[2]) const
 
- Public Member Functions inherited from VAPoR::DCReader
virtual ~DCReader ()
 
- Public Member Functions inherited from VetsUtil::MyBase
 MyBase ()
 
const string & getClassName () const
 

Additional Inherited Members

- Public Types inherited from VetsUtil::MyBase
typedef void(* ErrMsgCB_T )(const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T )(const char *msg)
 
- Static Public Member Functions inherited from VetsUtil::MyBase
static void SetErrMsg (const char *format,...)
 Record a formatted error message. More...
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code. More...
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code. More...
 
static int GetErrCode ()
 Retrieve the current error code. More...
 
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. More...
 
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 Public Attributes inherited from VetsUtil::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
 
- Protected Member Functions inherited from VetsUtil::MyBase
void SetClassName (const string &name)
 

Detailed Description

???

Author
John Clyne
Version
$Revision$
Date
$Date$

Definition at line 31 of file DCReaderWRF.h.

Constructor & Destructor Documentation

VAPoR::DCReaderWRF::DCReaderWRF ( const std::vector< string > &  files)
virtual VAPoR::DCReaderWRF::~DCReaderWRF ( )
virtual

Member Function Documentation

virtual int VAPoR::DCReaderWRF::CloseVariable ( )
virtual

Close the currently opened variable.

See also
OpenVariableRead()

Implements VAPoR::DCReader.

Referenced by VAPoR::DataMgrWRF::_CloseVariable().

void VAPoR::DCReaderWRF::EnableLegacyTimeConversion ( )
inline

Definition at line 142 of file DCReaderWRF.h.

void VAPoR::DCReaderWRF::GetBlockSize ( size_t  bs[3],
int  reflevel 
) const
inlinevirtual

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
bs]dim Transformed dimension.
Return values
bsA three element vector containing the voxel dimension of a data block

Implements VAPoR::Metadata.

Definition at line 43 of file DCReaderWRF.h.

References GetGridDim().

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

Definition at line 92 of file DCReaderWRF.h.

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

Implements VAPoR::Metadata.

Referenced by VAPoR::DataMgrWRF::_GetExtents().

virtual void VAPoR::DCReaderWRF::GetGridDim ( size_t  dim[3]) const
inlinevirtual

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.

Implements VAPoR::Metadata.

Definition at line 39 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetBlockSize(), VAPoR::DataMgrWRF::_GetDim(), VAPoR::DataMgrWRF::_GetValidRegion(), and GetBlockSize().

virtual std::vector<long> VAPoR::DCReaderWRF::GetGridPermutation ( ) const
inlinevirtual

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

Return values
integer-vector

Implements VAPoR::Metadata.

Definition at line 108 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetGridPermutation().

virtual string VAPoR::DCReaderWRF::GetGridType ( ) const
inlinevirtual

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

Return values
type

Reimplemented from VAPoR::Metadata.

Definition at line 47 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetGridType().

virtual void VAPoR::DCReaderWRF::GetLatLonExtents ( size_t  ts,
double  lon_exts[2],
double  lat_exts[2] 
) const
inlinevirtual

Return the Longitude and Latitude extents of the grid

This method returns the longitude extents (west-most and east-most) points, and the latitude extents (south-most and north-most) in degrees.

If the time step ts is invalid, or if for any reason the extents can't be calculated, both lat and lon extents will be set to zero.

Parameters
[in]timestepTime step of the grid
[out]lon_extsA two-element array containing the west-most, and east-most points, in that order. Moreover, lon[0] <= lon[1]
[out]lat_extsA two-element array containing the south-most, and north-most points, in that order. Moreover, lat[0] <= lat[1]

Implements VAPoR::DCReader.

Definition at line 146 of file DCReaderWRF.h.

virtual string VAPoR::DCReaderWRF::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 from VAPoR::Metadata.

Definition at line 57 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetMapProjection().

bool VAPoR::DCReaderWRF::GetMissingValue ( string  varname,
float &  value 
) const
inline

Definition at line 116 of file DCReaderWRF.h.

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

long VAPoR::DCReaderWRF::GetNumTimeSteps ( ) const
inlinevirtual

Return the number of time steps in the data collection

Return values
valueThe number of time steps

Implements VAPoR::Metadata.

Definition at line 53 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetNumTimeSteps().

virtual std::vector<long> VAPoR::DCReaderWRF::GetPeriodicBoundary ( ) const
inlinevirtual

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

Return values
boolean-vector

Implements VAPoR::Metadata.

Definition at line 102 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetPeriodicBoundary().

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

Implements VAPoR::Metadata.

Referenced by VAPoR::DataMgrWRF::_GetTSUserTime().

void VAPoR::DCReaderWRF::GetTSUserTimeStamp ( size_t  ts,
string &  s 
) const
virtual std::vector<string> VAPoR::DCReaderWRF::GetVariables2DExcluded ( ) const
inlinevirtual

Implements VAPoR::DCReader.

Definition at line 82 of file DCReaderWRF.h.

virtual std::vector<string> VAPoR::DCReaderWRF::GetVariables2DXY ( ) const
inlinevirtual

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

Implements VAPoR::Metadata.

Definition at line 65 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetVariables2DXY().

virtual std::vector<string> VAPoR::DCReaderWRF::GetVariables2DXZ ( ) const
inlinevirtual

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

Implements VAPoR::Metadata.

Definition at line 70 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetVariables2DXZ().

virtual std::vector<string> VAPoR::DCReaderWRF::GetVariables2DYZ ( ) const
inlinevirtual

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

Implements VAPoR::Metadata.

Definition at line 74 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetVariables2DYZ().

virtual std::vector<string> VAPoR::DCReaderWRF::GetVariables3D ( ) const
inlinevirtual

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

Implements VAPoR::Metadata.

Definition at line 61 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_GetVariables3D().

virtual std::vector<string> VAPoR::DCReaderWRF::GetVariables3DExcluded ( ) const
inlinevirtual

Implements VAPoR::DCReader.

Definition at line 78 of file DCReaderWRF.h.

virtual bool VAPoR::DCReaderWRF::IsCoordinateVariable ( string  varname) const
virtual
virtual int VAPoR::DCReaderWRF::OpenVariableRead ( size_t  timestep,
string  varname,
int  reflevel = 0,
int  lod = 0 
)
virtual

Open the named variable for reading

This method prepares a data volume (slice), indicated by a variable name and time step pair, for subsequent read operations by methods of this class. The number of the refinement levels parameter, reflevel, indicates the resolution of the volume in the multiresolution hierarchy. The valid range of values for reflevel is [0..max_refinement], where max_refinement is the maximum refinement level of the data set: Metadata::GetNumTransforms(). A value of zero indicates the coarsest resolution data, a value of max_refinement (or -1) indicates the finest resolution data. The level-of-detail parameter, lod, selects the approximation level. Valid values for lod are integers in the range 0..GetCRatios().size()-1, or the value -1 may be used to select the best approximation available: GetCRatios().size()-1.

An error occurs, indicated by a negative return value, if the volume identified by the {varname, timestep, reflevel, lod} tupple is not available. Note the availability of a volume can be tested with the VariableExists() method.

Parameters
[in]timestepTime step of the variable to read
[in]varnameName of the variable to read
[in]reflevelRefinement level of the variable. A value of -1 indicates the maximum refinment level defined for the VDC
[in]lodApproximation level of the variable. A value of -1 indicates the maximum approximation level defined for the VDC
Return values
statusReturns a non-negative value on success
See also
Metadata::GetVariableNames(), Metadata::GetNumTransforms(), GetNumTimeSteps(), GetCRatios()

Implements VAPoR::DCReader.

Referenced by VAPoR::DataMgrWRF::_OpenVariableRead().

virtual int VAPoR::DCReaderWRF::Read ( float *  data)
virtual
virtual int VAPoR::DCReaderWRF::ReadSlice ( float *  slice)
virtual

Read the next volume slice from the currently opened file Read in and return a slice (2D array) of voxels from the currently opened data volume at the current refinement level. Subsequent calls will read successive slices until the entire volume has been read. It is the caller's responsibility to ensure that the array pointed to by slice contains enough space to accomodate an NX by NY dimensioned slice, where NX is the dimesion of the volume along the X axis, specified in voxels, and NY is the Y axis dimension, as returned by GetDim().

Note
ReadSlice returns 0 if the entire volume has been read.
Parameters
[out]sliceThe requested volume slice
Return values
statusReturns a non-negative value on success
See also
OpenVariableRead(), Metadata::GetDim()

Implements VAPoR::DCReader.

virtual bool VAPoR::DCReaderWRF::VariableExists ( size_t  ts,
string  varname,
int  reflevel = 0,
int  lod = 0 
) const
inlinevirtual

Return true if the named variable is available

This method returns true if the variable named by varname is available in the data collection at the time step given by ts, and the specified level-of-detail and resolution.. A variable may be contained in a data set, but not exist for all time steps, levels-of-detail, etc..

Parameters
[in]timestepTime step of the variable to read
[in]varnameName of the variable to read
[in]reflevelRefinement level of the variable. A value of -1 indicates the maximum refinment level defined for the VDC
[in]lodApproximation level of the variable. A value of -1 indicates the maximum approximation level defined for the VDC
Return values
statusTrue if variable is present in the data collection
See also
GetNumTimeSteps(), GetVariableNames()

Reimplemented from VAPoR::DCReader.

Definition at line 136 of file DCReaderWRF.h.

Referenced by VAPoR::DataMgrWRF::_VariableExists().


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