VAPoR  0.1
Public Member Functions | List of all members
VAPoR::DCReader Class Referenceabstract

??? More...

#include <DCReader.h>

Inheritance diagram for VAPoR::DCReader:
VAPoR::Metadata VetsUtil::MyBase VAPoR::DCReaderGRIB VAPoR::DCReaderMOM VAPoR::DCReaderNCDF VAPoR::DCReaderROMS VAPoR::DCReaderWRF VAPoR::DataMgrGRIB VAPoR::DataMgrMOM VAPoR::DataMgrROMS VAPoR::DataMgrWRF

Public Member Functions

virtual ~DCReader ()
 
virtual int OpenVariableRead (size_t timestep, string varname, int reflevel=0, int lod=0)=0
 
virtual int CloseVariable ()=0
 
virtual int ReadSlice (float *slice)=0
 
virtual bool VariableExists (size_t ts, string varname, int reflevel=0, int lod=0) const
 
virtual void GetLatLonExtents (size_t ts, double lon_exts[2], double lat_exts[2]) const =0
 
virtual std::vector< string > GetVariables2DExcluded () const =0
 
virtual std::vector< string > GetVariables3DExcluded () const =0
 
- 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

???

Implementers must derive a concrete class from DCReader to support a particular data collection type

Author
John Clyne
Version
$Revision$
Date
$Date$

Definition at line 29 of file DCReader.h.

Constructor & Destructor Documentation

virtual VAPoR::DCReader::~DCReader ( )
inlinevirtual

Definition at line 32 of file DCReader.h.

Member Function Documentation

virtual int VAPoR::DCReader::CloseVariable ( )
pure virtual

Close the currently opened variable.

See also
OpenVariableRead()

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

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

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]

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

virtual std::vector<string> VAPoR::DCReader::GetVariables2DExcluded ( ) const
pure virtual
virtual std::vector<string> VAPoR::DCReader::GetVariables3DExcluded ( ) const
pure virtual
virtual int VAPoR::DCReader::OpenVariableRead ( size_t  timestep,
string  varname,
int  reflevel = 0,
int  lod = 0 
)
pure 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()

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

virtual int VAPoR::DCReader::ReadSlice ( float *  slice)
pure 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()

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

virtual bool VAPoR::DCReader::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 in VAPoR::DCReaderROMS, VAPoR::DCReaderWRF, VAPoR::DCReaderMOM, VAPoR::DCReaderNCDF, and VAPoR::DCReaderGRIB.

Definition at line 121 of file DCReader.h.


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