VAPoR  0.1
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
VAPoR::WaveCodecIO Class Reference

A sub-region reader for VDF files. More...

#include <WaveCodecIO.h>

Inheritance diagram for VAPoR::WaveCodecIO:
VAPoR::VDFIOBase VetsUtil::EasyThreads VAPoR::MetadataVDC VetsUtil::MyBase VAPoR::Metadata VetsUtil::MyBase VAPoR::ParsedXml VAPoR::DataMgrWC

Public Member Functions

 WaveCodecIO (const MetadataVDC &metadata, int nthreads=0)
 
 WaveCodecIO (const string &metafile, int nthreads=0)
 
virtual ~WaveCodecIO ()
 
virtual int OpenVariableRead (size_t timestep, const char *varname, int reflevel=0, int lod=0)
 
virtual int OpenVariableWrite (size_t timestep, const char *varname, int reflevel=-1, int lod=-1)
 
virtual int CloseVariable ()
 
virtual int BlockReadRegion (const size_t bmin[3], const size_t bmax[3], float *region, bool unblock=true)
 
virtual int ReadRegion (const size_t min[3], const size_t max[3], float *region)
 
virtual int ReadRegion (float *region)
 
virtual int ReadSlice (float *slice)
 
virtual int BlockWriteRegion (const float *region, const size_t bmin[3], const size_t bmax[3], bool block=true)
 
virtual int WriteRegion (const float *region, const size_t min[3], const size_t max[3])
 
virtual int WriteRegion (const float *region)
 
virtual int WriteSlice (const float *slice)
 
virtual void SetBoundaryPadOnOff (bool pad)
 
const float * GetDataRange () const
 
void GetValidRegion (size_t min[3], size_t max[3], int reflevel) const
 
virtual int VariableExists (size_t ts, const char *varname, int reflevel=0, int lod=0) const
 
virtual int GetNumTransforms () const
 
virtual void GetBlockSize (size_t bs[3], int reflevel) const
 
void SetCollectiveIO (bool newCollectiveIO)
 
int getNumThread ()
 
void EnableBuffering (size_t count[3], size_t divisor, int rank)
 
- Public Member Functions inherited from VAPoR::VDFIOBase
 VDFIOBase (const MetadataVDC &metadata)
 
 VDFIOBase (const string &metafile)
 
virtual ~VDFIOBase ()
 
double GetReadTimer () const
 
double GetSeekTimer () const
 
void SeekTimerReset ()
 
void SeekTimerStart ()
 
void SeekTimerStop ()
 
double GetWriteTimer () const
 
double GetXFormTimer () const
 
- Public Member Functions inherited from VAPoR::MetadataVDC
 MetadataVDC (const size_t dim[3], size_t numTransforms, const size_t bs[3], int nFilterCoef=1, int nLiftingCoef=1, int msbFirst=1, int vdfVersion=VDF_VERSION)
 
 MetadataVDC (const size_t dim[3], const size_t bs[3], const vector< size_t > &cratios, string wname, string wmode)
 
 MetadataVDC (const string &metafile)
 
 MetadataVDC (const MetadataVDC &node)
 
virtual ~MetadataVDC ()
 
int Merge (const MetadataVDC &metadata, size_t ts=0)
 
int Merge (const string &path, size_t ts=0)
 
int MakeCurrent () const
 
const string & GetParentDir () const
 
const string & GetMetafileName () const
 
const string & GetDataDirName () const
 
int ConstructFullVBase (size_t ts, const string &var, string *path) const
 
int ConstructFullAuxBase (size_t ts, string *path) const
 
int Write (const string &path, int relative_path=1)
 
virtual const size_t * GetBlockSize () const
 
virtual void GetGridDim (size_t dim[3]) const
 
const size_t * GetDimension () const
 
int GetFilterCoef () const
 
int GetLiftingCoef () const
 
int GetMSBFirst () const
 
int GetVDFVersion () const
 
string GetWaveName () const
 
string GetBoundaryMode () const
 
virtual vector< size_t > GetCRatios () const
 
int GetVDCType () const
 
int SetGridType (const string &value)
 
string GetGridType () const
 
int IsValidGridType (const string &value) const
 
int SetCoordSystemType (const string &value)
 
string GetCoordSystemType () const
 
int IsValidCoordSystemType (const string &value) const
 
int SetExtents (const vector< double > &value)
 
vector< double > GetExtents (size_t ts=0) const
 
int IsValidExtents (const vector< double > &value) const
 
int SetNumTimeSteps (long value)
 
long GetNumTimeSteps () const
 
int IsValidTimeStep (long value) const
 
int SetVariableNames (const vector< string > &value)
 
int SetVariables3D (const vector< string > &value)
 
vector< string > GetVariables3D () const
 
vector< string > GetCoordinateVariables () const
 
int SetCoordinateVariables (const vector< string > &value)
 
int SetVariables2DXY (const vector< string > &value)
 
int SetVariables2DXZ (const vector< string > &value)
 
int SetVariables2DYZ (const vector< string > &value)
 
vector< string > GetVariables2DXY () const
 
vector< string > GetVariables2DXZ () const
 
vector< string > GetVariables2DYZ () const
 
int SetComment (const string &value)
 
string GetComment () const
 
int SetPeriodicBoundary (const vector< long > &value)
 
vector< long > GetPeriodicBoundary () const
 
int SetGridPermutation (const vector< long > &value)
 
int SetMissingValue (double value)
 
int SetMissingValue ()
 
vector< double > GetMissingValue () const
 
vector< long > GetGridPermutation () const
 
int SetMapProjection (const string &value)
 
virtual string GetMapProjection () const
 
int SetTSUserTime (size_t ts, const vector< double > &value)
 
double GetTSUserTime (size_t ts) const
 
int SetTSUserTimeStamp (size_t ts, const string &s)
 
void GetTSUserTimeStamp (size_t ts, string &s) const
 
string GetTSAuxBasePath (size_t ts) const
 
int HasTSUserTime (size_t ts) const
 
int IsValidUserTime (const vector< double > &value) const
 
int SetTSXCoords (size_t ts, const vector< double > &value)
 
vector< double > GetTSXCoords (size_t ts) const
 
int SetTSYCoords (size_t ts, const vector< double > &value)
 
vector< double > GetTSYCoords (size_t ts) const
 
int SetTSZCoords (size_t ts, const vector< double > &value)
 
vector< double > GetTSZCoords (size_t ts) const
 
int SetTSComment (size_t ts, const string &value)
 Set a comment for the time step indicated by ts. More...
 
string GetTSComment (size_t ts) const
 Return the comment for the indicated time step, ts, if it exists. More...
 
int SetTSExtents (size_t ts, const vector< double > &value)
 
vector< double > GetTSExtents (size_t ts) const
 
int SetTSMissingValue (size_t ts, double v)
 
vector< double > GetTSMissingValue (size_t ts) const
 Returns the time-varying missing value, if any. More...
 
int SetVComment (size_t ts, const string &var, const string &value)
 
string GetVComment (size_t ts, const string &var) const
 
string GetVBasePath (size_t ts, const string &var) const
 
int SetVBasePath (size_t ts, const string &var, const string &value)
 
int SetVDataRange (size_t ts, const string &var, const vector< double > &value)
 
vector< double > GetVDataRange (size_t ts, const string &var) const
 
int IsValidVDataRange (const vector< double > &value) const
 
int SetVMissingValue (size_t ts, const string &var, double v)
 
vector< double > GetVMissingValue (size_t ts, const string &var) const
 
vector< string > GetUserDataLongTags () const
 
int SetUserDataLong (const string &tag, const vector< long > &value)
 
vector< long > GetUserDataLong (const string &tag) const
 
vector< string > GetUserDataDoubleTags () const
 
int SetUserDataDouble (const string &tag, const vector< double > &value)
 
vector< double > GetUserDataDouble (const string &tag) const
 
vector< string > GetUserDataStringTags () const
 
int SetUserDataString (const string &tag, const string &value)
 
string GetUserDataString (const string &tag) const
 
int SetUserDataStringVec (const string &tag, const vector< string > &value)
 
vector< string > GetUserDataStringVec (const string &tag) const
 
vector< string > GetTSUserDataLongTags () const
 
int SetTSUserDataLong (size_t ts, const string &tag, const vector< long > &value)
 
vector< long > GetTSUserDataLong (size_t ts, const string &tag) const
 
int SetTSUserDataDouble (size_t ts, const string &tag, const vector< double > &value)
 
vector< double > GetTSUserDataDouble (size_t ts, const string &tag) const
 
vector< string > GetTSUserDataDoubleTags () const
 
int SetTSUserDataString (size_t ts, const string &tag, const string &value)
 
string GetTSUserDataString (size_t ts, const string &tag) const
 
vector< string > GetTSUserDataStringTags () const
 
vector< string > GetVUserDataLongTags () const
 
int SetVUserDataLong (size_t ts, const string &var, const string &tag, const vector< long > &value)
 
vector< long > GetVUserDataLong (size_t ts, const string &var, const string &tag) const
 
vector< string > GetVUserDataDoubleTags () const
 
int SetVUserDataDouble (size_t ts, const string &var, const string &tag, const vector< double > &value)
 
vector< double > GetVUserDataDouble (size_t ts, const string &var, const string &tag) const
 
int SetVUserDataString (size_t ts, const string &var, const string &tag, const string &value)
 
string GetVUserDataString (size_t ts, const string &var, const string &tag) const
 
vector< string > GetVUserDataStringTags () const
 
- Public Member Functions inherited from VetsUtil::MyBase
 MyBase ()
 
const string & getClassName () const
 
- Public Member Functions inherited from VAPoR::ParsedXml
virtual ~ParsedXml ()
 
virtual bool charHandler (ExpatParseMgr *, const XML_Char *, int)
 

Static Public Member Functions

static size_t GetMaxCRatio (const size_t bs[3], string wavename, string wmode)
 
- 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)
 

Public Attributes

int _nthreads
 
- Public Attributes inherited from VAPoR::ParsedXml
ParsedXmlpreviousClass
 

Friends

void * RunBlockReadRegionThread (void *object)
 
void * RunBlockWriteRegionThread (void *object)
 

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 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 VAPoR::VDFIOBase
void _ReadTimerReset ()
 
void _ReadTimerStart ()
 
void _ReadTimerStop ()
 
void _WriteTimerReset ()
 
void _WriteTimerStart ()
 
void _WriteTimerStop ()
 
void _XFormTimerReset ()
 
void _XFormTimerStart ()
 
void _XFormTimerStop ()
 
int _MaskOpenWrite (size_t timestep, string varname, int reflevel)
 
int _MaskOpenRead (size_t timestep, string varname, int reflevel)
 
int _MaskClose ()
 
int _MaskWrite (const float *srcblk, const size_t bmin_p[3], const size_t bmax_p[3], bool block)
 
int _MaskRead (const size_t bmin_p[3], const size_t bmax_p[3])
 
void _MaskRemove (float *blk, bool &valid_data) const
 
void _MaskReplace (size_t bx, size_t by, size_t bz, float *blk) const
 
- Protected Member Functions inherited from VetsUtil::MyBase
void SetClassName (const string &name)
 
- Protected Member Functions inherited from VetsUtil::EasyThreads
 EasyThreads (int nthreads)
 
 ~EasyThreads ()
 
int ParRun (void *(*start)(void *), std::vector< void * > arg)
 
int ParRun (void *(*start)(void *), void **arg)
 
int Barrier ()
 
int MutexLock ()
 
int MutexUnlock ()
 
int GetNumThreads () const
 
- Static Protected Member Functions inherited from VAPoR::VDFIOBase
static void _UnpackCoord (VarType_T vtype, const size_t src[3], size_t dst[3], size_t fill)
 
static void _PackCoord (VarType_T vtype, const size_t src[3], size_t dst[3], size_t fill)
 
static void _FillPackedCoord (VarType_T vtype, const size_t src[3], size_t dst[3], size_t fill)
 
- Static Protected Member Functions inherited from VetsUtil::EasyThreads
static void Decompose (int n, int size, int rank, int *offset, int *length)
 
static int NProc ()
 
- Static Protected Attributes inherited from VAPoR::ParsedXml
static const string _stringType
 
static const string _longType
 
static const string _doubleType
 
static const string _typeAttr
 

Detailed Description

A sub-region reader for VDF files.

Author
John Clyne
Version
$Revision$
Date
$Date$

This class provides an API for reading and writing VDC2 data. VDC2 data may be accessed with two forms of wavelet based progressive refinement, : hierarchical or level-of-detail. The former supports coarsening and refinement of the sampling grid resolution (the dimensions of the sampling grid) at varying powers-of-two, and is controled by the reflevel parameter. The latter allows for arbitrary approximations by restricting the number of wavelet basis coefficients used when reconstructing the data from their wavelet representation. The level-of-detail is controled with the lod parameter.

Definition at line 38 of file WaveCodecIO.h.

Constructor & Destructor Documentation

VAPoR::WaveCodecIO::WaveCodecIO ( const MetadataVDC metadata,
int  nthreads = 0 
)

Parameters
[in]nthreadsNumber of execution threads that may be used by the class for parallel execution. If zero, the system hardware will be queried via sysconf to determine the number of processors available and this value will be used.
VAPoR::WaveCodecIO::WaveCodecIO ( const string &  metafile,
int  nthreads = 0 
)

Constructor for the VDFIOBase class.

Parameters
[in]metafilePath to a metadata file for which all future class operations will apply
Note
The success or failure of this constructor can be checked with the GetErrCode() method.
See also
Metadata, GetErrCode(),
Parameters
[in]nthreadsNumber of execution threads that may be used by the class for parallel execution. If zero, the system hardware will be queried via sysconf to determine the number of processors available and this value will be used.
virtual VAPoR::WaveCodecIO::~WaveCodecIO ( )
virtual

Member Function Documentation

virtual int VAPoR::WaveCodecIO::BlockReadRegion ( const size_t  bmin[3],
const size_t  bmax[3],
float *  region,
bool  unblock = true 
)
virtual

Read in and return a subregion from the currently opened data volume.

The bmin and bmax vectors identify the minimum and maximum extents, in block coordinates, of the subregion of interest. The minimum valid value of 'bmin' is (0,0,0), the maximum valid value of bmax is (nbx-1,nby-1,nbz-1), where nx, ny, and nz are the block dimensions of the volume at the currently opened refinement level as retuned by GetDimBlk(). The volume returned is stored in the memory region pointed to by region. It is the caller's responsbility to ensure adequate space is available.

Parameters
[in]bminMinimum region extents in block coordinates
[in]bmaxMaximum region extents in block coordinates
[out]regionThe requested volume subregion
[in]unblockIf true, unblock the data before copying to region
Return values
statusReturns a non-negative value on success
See also
OpenVariableRead(), GetBlockSize(), MapVoxToBlk()

Implements VAPoR::VDFIOBase.

Referenced by VAPoR::DataMgrWC::_BlockReadRegion().

virtual int VAPoR::WaveCodecIO::BlockWriteRegion ( const float *  region,
const size_t  bmin[3],
const size_t  bmax[3],
bool  block = true 
)
virtual

Write a volume subregion to the currently opened progressive access data volume.

This method is identical to the WriteRegion() method with the exception that the region boundaries are defined in block, not voxel, coordinates. Secondly, unless the 'block' parameter is set, the internal blocking of the data will be preserved. I.e. the data are assumed to already be blocked.

The number of voxels contained in region must be the product over i :

(bmax[i] - bmin[i] + 1) * bs[i]

where bs[i] is the ith dimension of the block size.

Parameters
[in]bminMinimum region extents in block coordinates
[in]bmaxMaximum region extents in block coordinates
[in]regionThe volume subregion to write
[in]blockIf true, block the data before writing/transforming
Return values
statusReturns a non-negative value on success
See also
OpenVariableWrite() SetBoundarPadOnOff()

Implements VAPoR::VDFIOBase.

virtual int VAPoR::WaveCodecIO::CloseVariable ( )
virtual

Close the currently opened variable.

See also
OpenVariableWrite(), OpenVariableRead()

Reimplemented from VAPoR::VDFIOBase.

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

void VAPoR::WaveCodecIO::EnableBuffering ( size_t  count[3],
size_t  divisor,
int  rank 
)
virtual void VAPoR::WaveCodecIO::GetBlockSize ( size_t  bs[3],
int  reflevel 
) const
virtual

Reimplemented from VAPoR::MetadataVDC.

const float* VAPoR::WaveCodecIO::GetDataRange ( ) const
inlinevirtual

Return the data range of the currently opened volume as a two-element array

This method returns the minimum and maximum data values of the currently opened variable within the valid domain bounds. See GetValidRegion().

Note
The range values returned are valid for the native data only. Data approximations produced by level-of-detail or through multi-resolution may have values outside of this range.
Return values

Implements VAPoR::VDFIOBase.

Definition at line 332 of file WaveCodecIO.h.

Referenced by VAPoR::DataMgrWC::_GetDataRange().

static size_t VAPoR::WaveCodecIO::GetMaxCRatio ( const size_t  bs[3],
string  wavename,
string  wmode 
)
static

Return the maximimum compression ratio possible

This static methods returns the maximum possible compression ratio possible for a given combination of blocksize, ps, wavele name, wname, and wavelet boundary handling mode, wmode.

Parameters
[in]bsA three-element vector providing the dimensions of a block
[in]wavenameThe name of the wavelet
[in]wmodeThe wavelet boundary handling mode
Return values
ratioA value of zero is returned if the wavename or wmode are invalid, otherwise the maximum possible data compression ratio is returned.
See also
Metadata::GetCRatios()
int VAPoR::WaveCodecIO::getNumThread ( )
inline

Definition at line 462 of file WaveCodecIO.h.

virtual int VAPoR::WaveCodecIO::GetNumTransforms ( ) const
virtual

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 from VAPoR::MetadataVDC.

Referenced by VAPoR::DataMgrWC::_GetNumTransforms().

void VAPoR::WaveCodecIO::GetValidRegion ( size_t  min[3],
size_t  max[3],
int  reflevel 
) const

Return the valid region bounds for the currently opened variable

This method returns the minimum and maximum valid coordinate bounds (in voxels) of the currently opened variable. In general, the minimum bounds are (0,0,0) and the maximum bounds are (nx-1, ny-1, nz-1), where nx, ny, and nz are the volume dimensions returned by GetDim(). However, partial regions (sub-volumes) may be written to the VDC as well.

Parameters
[in]reflevelRefinement level of the variable
[out]minMinimum coordinate bounds (in voxels) of volume
[out]maxMaximum coordinate bounds (in voxels) of volume
Return values
statusA non-negative int is returned on success

Referenced by VAPoR::DataMgrWC::_GetValidRegion().

virtual int VAPoR::WaveCodecIO::OpenVariableRead ( size_t  timestep,
const char *  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()

Reimplemented from VAPoR::VDFIOBase.

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

virtual int VAPoR::WaveCodecIO::OpenVariableWrite ( size_t  timestep,
const char *  varname,
int  reflevel = -1,
int  lod = -1 
)
virtual

Open the named variable for writing

Prepare a VDC for writing a data volume (slice). The data volume is identified by the specfied time step and variable name. The number of resulting approximations for the data volume is determined by the Metadata object used to initialize the class. Moreover, the number of levels-of-detail actually saved to the data collection are determined by lod. If lod is maximum level of detail (or the special value -1, the default) all of the wavelet coefficients are saved, and it is possible to fully reconstruct the volume later without loss of information (beyond floating point round off).

Parameters
[in]timestepTime step of the variable to read
[in]varnameName of the variable to read
[in]lodLevel of detail saved. A value of -1 indicates the maximum level of detail.
Return values
statusReturns a non-negative value on success
See also
Metadata::GetVariableNames(), Metadata::GetNumTransforms()

Reimplemented from VAPoR::VDFIOBase.

virtual int VAPoR::WaveCodecIO::ReadRegion ( const size_t  min[3],
const size_t  max[3],
float *  region 
)
virtual

Read in and return a subregion from the currently opened data volume.

This method is similar to BlockReadRegion() with the exception that the region bounds are specified in voxel coordinates. The min and max vectors identify the minimum and maximum extents, in voxel coordinates, of the subregion of interest. The minimum valid value of 'min' is (0,0,0), the maximum valid value of max is (nx-1,ny-1,nz-1), where nx, ny, and nz are the voxel dimensions of the volume at the currently opened refinement level as returned by GetDim().

The volume returned is stored in the memory region pointed to by region. It is the caller's responsbility to ensure adequate space is available.

Parameters
[in]minMinimum region extents in voxel coordinates
[in]maxMaximum region extents in voxel coordinates
[out]regionThe requested volume subregion
Return values
statusReturns a non-negative value on success
See also
OpenVariableRead(), GetDim(), MapVoxToBlk()

Implements VAPoR::VDFIOBase.

virtual int VAPoR::WaveCodecIO::ReadRegion ( float *  region)
virtual

Implements VAPoR::VDFIOBase.

virtual int VAPoR::WaveCodecIO::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::VDFIOBase.

virtual void VAPoR::WaveCodecIO::SetBoundaryPadOnOff ( bool  pad)
inlinevirtual

Toggle padding of data on writes

If true, incomplete data blocks will be padded prior to transformation and storage to disk. A block is incomplete iff it is a boundary block (a block that contains a volume region boundary) and the extents of the region do not coincide with block boundaries

Parameters
[in]padBoolean indicating whether padding should (true) or should not (false) take place
See also
GetBoundaryMode()

Definition at line 314 of file WaveCodecIO.h.

void VAPoR::WaveCodecIO::SetCollectiveIO ( bool  newCollectiveIO)
inline

Definition at line 404 of file WaveCodecIO.h.

virtual int VAPoR::WaveCodecIO::VariableExists ( size_t  ts,
const char *  varname,
int  reflevel = 0,
int  lod = 0 
) const
virtual

Returns true if the indicated data volume exists on disk

Returns true if the variable identified by the timestep, variable name, refinement level, and level-of-detail is present on disk. Returns 0 if the variable is not present.

Parameters
[in]tsA valid time step from the Metadata object used to initialize the class
[in]varnameA valid variable name
[in]reflevelIgnored
[in]lodCompression level of detail requested. The coarsest approximation level is 0 (zero). A value of -1 indicates the finest refinement level contained in the VDC.

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

virtual int VAPoR::WaveCodecIO::WriteRegion ( const float *  region,
const size_t  min[3],
const size_t  max[3] 
)
virtual

Write a volume subregion to the currently opened progressive access data volume.

This method is identical to the WriteRegion() method with the exception that the region boundaries are defined in block, not voxel, coordinates. Secondly, unless the 'block' parameter is set, the internal blocking of the data will be preserved. I.e. the data are assumed to already be blocked.

The number of voxels contained in region must be the product over i :

(max[i] - min[i] + 1)

Parameters
[in]minMinimum region extents in voxel coordinates
[in]maxMaximum region extents in voxel coordinates
[in]regionThe volume subregion to write
Return values
statusReturns a non-negative value on success
See also
OpenVariableWrite(), GetBlockSize(), MapVoxToBlk()
SetBoundarPadOnOff()
Note
Unexpected results may be obtained if this method is invoked multiple times for adjacent regions if the region boundaries do not coincide with block boundaries.

Implements VAPoR::VDFIOBase.

virtual int VAPoR::WaveCodecIO::WriteRegion ( const float *  region)
virtual

Implements VAPoR::VDFIOBase.

virtual int VAPoR::WaveCodecIO::WriteSlice ( const float *  slice)
virtual

Write a single slice of voxels to the currently opened variable

Transform and write a single slice (2D array) of voxels to the variable indicated by the most recent call to OpenVariableWrite(). The dimensions of a slices is NX by NY, where NX is the dimesion of the volume along the X axis, specified in voxels, and NY is the Y axis dimension.

This method should be called exactly NZ times for each opened variable, where NZ is the dimension of the volume in voxels along the Z axis. Each invocation should pass a successive slice of volume data.

Parameters
[in]sliceA slices of volume data
Return values
statusReturns a non-negative value on success
See also
OpenVariableRead()

Implements VAPoR::VDFIOBase.

Friends And Related Function Documentation

void* RunBlockReadRegionThread ( void *  object)
friend
void* RunBlockWriteRegionThread ( void *  object)
friend

Member Data Documentation

int VAPoR::WaveCodecIO::_nthreads

Definition at line 461 of file WaveCodecIO.h.


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