VAPoR  3.0.0
Public Member Functions | Static Public Member Functions | List of all members
VAPoR::WASP Class Reference

Implements WASP compression conventions for NetCDF. More...

#include <WASP.h>

Inheritance diagram for VAPoR::WASP:
VAPoR::NetCDFCpp VetsUtil::MyBase

Public Member Functions

 WASP (int nthreads=0)
 
virtual ~WASP ()
 
virtual int Create (string path, int cmode, size_t initialsz, size_t &bufrsizehintp, int numfiles)
 
virtual int Open (string path, int mode)
 
virtual int SetFill (int fillmode, int &old_modep)
 Set the fill value. More...
 
virtual int EndDef () const
 End the metadata definition section. More...
 
virtual int Close ()
 
virtual int InqVarDimlens (string name, int level, vector< size_t > &dims, vector< size_t > &bs) const
 
virtual int InqVarDims (string name, vector< string > &dimnames, vector< size_t > &dims) const
 
virtual int InqVarCompressionParams (string name, string &wname, vector< size_t > &bs, vector< size_t > &cratios) const
 
virtual int InqVarNumRefLevels (string name) const
 
virtual int DefVar (string name, int xtype, vector< string > dimnames, string wname, vector< size_t > bs, vector< size_t > cratios)
 
virtual int DefVar (string name, int xtype, vector< string > dimnames, string wname, vector< size_t > bs, vector< size_t > cratios, double missing_value)
 
virtual int DefVar (string name, int xtype, vector< string > dimnames)
 Define a variable. More...
 
int DefDim (string name, size_t len) const
 Define a dimension. More...
 
virtual int InqVarCompressed (string varname, bool &compressed) const
 
int InqVarWASP (string varname, bool &wasp) const
 
virtual int OpenVarWrite (string name, int lod)
 
virtual int OpenVarRead (string name, int level, int lod)
 
virtual int CloseVar ()
 
virtual int PutVara (vector< size_t > start, vector< size_t > count, const float *data)
 
virtual int PutVar (const float *data)
 
virtual int PutVara (vector< size_t > start, vector< size_t > count, const double *data)
 
virtual int PutVar (const double *data)
 
virtual int PutVara (vector< size_t > start, vector< size_t > count, const int *data)
 
virtual int PutVar (const int *data)
 
virtual int PutVara (vector< size_t > start, vector< size_t > count, const unsigned char *data)
 
virtual int PutVar (const unsigned char *data)
 
virtual int PutVara (vector< size_t > start, vector< size_t > count, const float *data, const unsigned char *mask)
 
virtual int PutVar (const float *data, const unsigned char *mask)
 
virtual int PutVara (vector< size_t > start, vector< size_t > count, const double *data, const unsigned char *mask)
 
virtual int PutVar (const double *data, const unsigned char *mask)
 
virtual int PutVara (vector< size_t > start, vector< size_t > count, const int *data, const unsigned char *mask)
 
virtual int PutVar (const int *data, const unsigned char *mask)
 
virtual int PutVara (vector< size_t > start, vector< size_t > count, const unsigned char *data, const unsigned char *mask)
 
virtual int PutVar (const unsigned char *data, const unsigned char *mask)
 
virtual int GetVara (vector< size_t > start, vector< size_t > count, float *data)
 
virtual int GetVara (vector< size_t > start, vector< size_t > count, double *data)
 
virtual int GetVara (vector< size_t > start, vector< size_t > count, int *data)
 
virtual int GetVara (vector< size_t > start, vector< size_t > count, unsigned char *data)
 
virtual int GetVaraBlock (vector< size_t > start, vector< size_t > count, float *data)
 
virtual int GetVaraBlock (vector< size_t > start, vector< size_t > count, double *data)
 
virtual int GetVaraBlock (vector< size_t > start, vector< size_t > count, int *data)
 
virtual int GetVaraBlock (vector< size_t > start, vector< size_t > count, unsigned char *data)
 
virtual int GetVar (float *data)
 
virtual int GetVar (double *data)
 
virtual int GetVar (int *data)
 
virtual int GetVar (unsigned char *data)
 
- Public Member Functions inherited from VAPoR::NetCDFCpp
 NetCDFCpp ()
 
virtual ~NetCDFCpp ()
 
virtual int Create (string path, int cmode, size_t initialsz, size_t &bufrsizehintp)
 
virtual int InqDimlen (string name, size_t &len) const
 Learn the length of a named dimension. More...
 
virtual int PutAtt (string varname, string attname, int value) const
 Write an integer attribute. More...
 
virtual int PutAtt (string varname, string attname, vector< int > values) const
 
virtual int PutAtt (string varname, string attname, const int values[], size_t n) const
 
virtual int GetAtt (string varname, string attname, int &value) const
 Read an integer attribute. More...
 
virtual int GetAtt (string varname, string attname, vector< int > &values) const
 
virtual int GetAtt (string varname, string attname, int values[], size_t n) const
 
virtual int PutAtt (string varname, string attname, size_t value) const
 
virtual int PutAtt (string varname, string attname, vector< size_t > values) const
 
virtual int PutAtt (string varname, string attname, const size_t values[], size_t n) const
 
virtual int GetAtt (string varname, string attname, size_t &value) const
 
virtual int GetAtt (string varname, string attname, vector< size_t > &values) const
 
virtual int GetAtt (string varname, string attname, size_t values[], size_t n) const
 
virtual int PutAtt (string varname, string attname, float value) const
 
virtual int PutAtt (string varname, string attname, vector< float > values) const
 
virtual int PutAtt (string varname, string attname, const float values[], size_t n) const
 
virtual int GetAtt (string varname, string attname, float &value) const
 
virtual int GetAtt (string varname, string attname, vector< float > &values) const
 
virtual int GetAtt (string varname, string attname, float values[], size_t n) const
 
virtual int PutAtt (string varname, string attname, double value) const
 
virtual int PutAtt (string varname, string attname, vector< double > values) const
 
virtual int PutAtt (string varname, string attname, const double values[], size_t n) const
 
virtual int GetAtt (string varname, string attname, double &value) const
 
virtual int GetAtt (string varname, string attname, vector< double > &values) const
 
virtual int GetAtt (string varname, string attname, double values[], size_t n) const
 
virtual int PutAtt (string varname, string attname, string value) const
 
virtual int PutAtt (string varname, string attname, vector< string > values) const
 
virtual int PutAtt (string varname, string attname, const char values[], size_t n) const
 
virtual int GetAtt (string varname, string attname, string &value) const
 
virtual int GetAtt (string varname, string attname, char values[], size_t n) const
 
virtual int GetAtt (string varname, string attname, vector< string > &values) const
 
virtual int InqVarid (string varname, int &varid) const
 Find the NetCDF ID of a variable. More...
 
virtual int InqAtt (string varname, string attname, nc_type &xtype, size_t &len) const
 Return information about a NetCDF attribute. More...
 
virtual int InqVartype (string varname, nc_type &xtype) const
 Find a variable's external representation type. More...
 
virtual int PutVara (string varname, vector< size_t > start, vector< size_t > count, const void *data)
 Write an array of values to a variable. More...
 
virtual int PutVara (string varname, vector< size_t > start, vector< size_t > count, const float *data)
 
virtual int PutVara (string varname, vector< size_t > start, vector< size_t > count, const double *data)
 
virtual int PutVara (string varname, vector< size_t > start, vector< size_t > count, const int *data)
 
virtual int PutVara (string varname, vector< size_t > start, vector< size_t > count, const long *data)
 
virtual int PutVara (string varname, vector< size_t > start, vector< size_t > count, const unsigned char *data)
 
virtual int PutVar (string varname, const void *data)
 Write an entire variable with one function call. More...
 
virtual int PutVar (string varname, const float *data)
 
virtual int PutVar (string varname, const double *data)
 
virtual int PutVar (string varname, const int *data)
 
virtual int PutVar (string varname, const long *data)
 
virtual int PutVar (string varname, const unsigned char *data)
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, void *data)
 Read an array of values from a variable. More...
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, float *data)
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, double *data)
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, int *data)
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, long *data)
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, unsigned char *data)
 
virtual int GetVar (string varname, void *data)
 Read an entire variable with one function call. More...
 
virtual int GetVar (string varname, float *data)
 
virtual int GetVar (string varname, double *data)
 
virtual int GetVar (string varname, int *data)
 
virtual int GetVar (string varname, long *data)
 
virtual int GetVar (string varname, unsigned char *data)
 
virtual bool ValidFile (string path)
 
virtual bool InqDimDefined (string dimname)
 
virtual bool InqAttDefined (string varname, string attname)
 
virtual int InqVarnames (vector< string > &varnames) const
 
- Public Member Functions inherited from VetsUtil::MyBase
 MyBase ()
 
const string & getClassName () const
 

Static Public Member Functions

static int InqDimsAtLevel (string wname, int level, vector< size_t > dims, vector< size_t > bs, vector< size_t > &dims_at_level, vector< size_t > &bs_at_level)
 
static bool InqCompressionInfo (vector< size_t > bs, string wname, size_t &nlevels, size_t &maxcratio)
 
static std::vector< string > GetPaths (string path, int numfiles)
 
static string AttNameWavelet ()
 NetCDF attribute name specifying Wavelet name. More...
 
static string AttNameBlockSize ()
 NetCDF attribute name specifying compression block dimensions. More...
 
static string AttNameNumFiles ()
 NetCDF attribute name specifying number of compression files. More...
 
static string AttNameCRatios ()
 NetCDF attribute name specifying compression ratios. More...
 
static string AttNameWASP ()
 
static string AttNameDimNames ()
 NetCDF attribute name specifying names of uncompressed dimensions. More...
 
static string AttNameMissingValue ()
 NetCDF attribute name specifying if missing data values are present. More...
 
static string AttNameVersion ()
 NetCDF attribute name specifying WASP version number. More...
 
- Static Public Member Functions inherited from VAPoR::NetCDFCpp
static size_t SizeOf (int nctype)
 
- 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)
 

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 VetsUtil::MyBase
void SetClassName (const string &name)
 

Detailed Description

Implements WASP compression conventions for NetCDF.

Author
John Clyne
Date
July, 2014

Implements WASP compression conventions for NetCDF by extending the NetCDFCPP class.

The WASP conventions establish a policy for compressing, storing, and accessing arrays of data in NetCDF. This API provides an interface for NetCDF data adhering to the WASP conventions.

Fundamental concepts of the WASP compression conventions include the following:

This class inherits from VetsUtil::MyBase. Unless otherwise documented any method that returns an integer value is returning status. A negative value indicates failure. Error messages are logged via VetsUtil::MyBase::SetErrMsg(). In general, methods that return boolean values will not record an error message on failure.

Parameters
wnameName of biorthogonal wavelet to use for data transformation. If not specified (if wname is the empty string) no transformation or compression are performed. However, arrays are still decomposed into blocks as per the bs parameter. See VAPoR::WaveFiltBior.
bsAn ordered list of block dimensions that specifies the block decomposition of the variable. The rank of bs may be less than that of a variable's array dimensions, in which case only the n fastest varying variable dimensions will be blocked, where n is the rank of bs.
cratiosA monotonically decreasing vector of compression ratios. Each element of cratios is in the range 1 (indicating no compression) to max, where max is the maximum compression supported by the specified combination of block size, bs, and wavelet (See InqCompressionInfo()). If the underlying NetCDF file was created with the numfiles parameter greater than one then the length of cratios must exactly match that of numfiles.
lodAn index into the cratios vector. A value of -1 may be used to index the last element of cratios
levelArray dimensions refinement level for compressed variables. A value of 0 indicates the coarsest refinement level available, a value of one indicates next coarsest, and so on. The finest resolution available is given by InqVarNumRefLevels() - 1. If level is less than 0 it is interpreted do indicate the finest grid resolution.

Definition at line 98 of file WASP.h.

Constructor & Destructor Documentation

VAPoR::WASP::WASP ( int  nthreads = 0)

default constructor

Construct a WASP object

Parameters
[in]nthreadsNumber of parallel execution threads to be run during encoding and decoding of compressed data. A value of 0, the default, indicates that the thread count should be determined by the environment in a platform-specific manner, for example using sysconf(_SC_NPROCESSORS_ONLN) under *nix OSes.
virtual VAPoR::WASP::~WASP ( )
virtual

Member Function Documentation

static string VAPoR::WASP::AttNameBlockSize ( )
inlinestatic

NetCDF attribute name specifying compression block dimensions.

Definition at line 638 of file WASP.h.

static string VAPoR::WASP::AttNameCRatios ( )
inlinestatic

NetCDF attribute name specifying compression ratios.

Definition at line 644 of file WASP.h.

static string VAPoR::WASP::AttNameDimNames ( )
inlinestatic

NetCDF attribute name specifying names of uncompressed dimensions.

Definition at line 651 of file WASP.h.

static string VAPoR::WASP::AttNameMissingValue ( )
inlinestatic

NetCDF attribute name specifying if missing data values are present.

Definition at line 654 of file WASP.h.

static string VAPoR::WASP::AttNameNumFiles ( )
inlinestatic

NetCDF attribute name specifying number of compression files.

Definition at line 641 of file WASP.h.

static string VAPoR::WASP::AttNameVersion ( )
inlinestatic

NetCDF attribute name specifying WASP version number.

Definition at line 657 of file WASP.h.

static string VAPoR::WASP::AttNameWASP ( )
inlinestatic

NetCDF attribute name specifying if this is a WASP file or variable

Definition at line 648 of file WASP.h.

static string VAPoR::WASP::AttNameWavelet ( )
inlinestatic

NetCDF attribute name specifying Wavelet name.

Definition at line 635 of file WASP.h.

virtual int VAPoR::WASP::Close ( )
virtual

Close an open NetCDF file

This method closes any currently opened NetCDF files that were opened with Create() or Open().

Reimplemented from VAPoR::NetCDFCpp.

virtual int VAPoR::WASP::CloseVar ( )
virtual

Close the currently opened variable

If a variable is opened for writing this method will flush all buffers to disk and perform cleanup. If opened for reading only cleanup is performed. If no variables are open this method is a no-op.

virtual int VAPoR::WASP::Create ( string  path,
int  cmode,
size_t  initialsz,
size_t &  bufrsizehintp,
int  numfiles 
)
virtual

Create a new NetCDF data set with support for WASP conventions

Parameters
[in]pathThe file base name of the new NetCDF data set
[in]cmodeSame as in NetCDFCpp::Create()
[in]initialszSame as in NetCDFCpp::Create()
[in]bufrsizehintpSame as in NetCDFCpp::Create()
[in]numfilesAn integer greater than or equal to one indicating whether compressed variables should be stored in separate files, one compression level (level of detail) per file. A value of one indicates that all compression levels for compressed variables should be stored in the single file specified by path. A value greater than one results in the creation of numfile NetCDF files, each of which will contain a separate compression level for any compressed variables. Variables that are not compressed will be stored in their entirety in the file named by path.
See also
NetCDFCpp::Create(), NetCDFCpp::GetPaths()
int VAPoR::WASP::DefDim ( string  name,
size_t  len 
) const
virtual

Define a dimension.

Reimplemented from VAPoR::NetCDFCpp.

virtual int VAPoR::WASP::DefVar ( string  name,
int  xtype,
vector< string >  dimnames,
string  wname,
vector< size_t >  bs,
vector< size_t >  cratios 
)
virtual

Define a new compressed variable

Parameters
[in]nameSame as NetCDFCpp::DefVar()
[in]xtypeSame as NetCDFCpp::DefVar()
[in]dimnamesSame as NetCDFCpp::DefVar()
[in]wnameName of biorthogonal wavelet to use for data transformation. See VAPoR::WaveFiltBior. If empty, the variable will be blocked according to bs, but will not be compressed.
[in]bsAn ordered list of block dimensions that specifies the block decomposition of the variable. array's associated dimension. The rank of bs may be equal to or less than that of dimnames. In the latter case only the rank(bs) fastest varying dimensions of the variable will be blocked. The dimension(s) of bs[i] need not align with (be integral factors of) the dimension lengths associated with dimnames in which case boundary blocks will be padded. If bs is empty, or the product of its elements is one, the variable will not be blocked or compressed. Hence, the wname and cratio parameters will be ignored. The variable will not be defined as a WASP variable. See InqVarWASP().
[in]cratiosA monotonically decreasing vector of compression ratios. Each element of cratios is in the range 1 (indicating no compression) to max, where max is the maximum compression supported by the specified combination of block size, bs, and wavelet (See InqCompressionInfo()). If the underlying NetCDF file was created with numfiles parameter greater than one then the length of cratios must exactly match that of numfiles.
See also
NetCDFCpp::DefVar(), Create(), InqCompressionInfo()
virtual int VAPoR::WASP::DefVar ( string  name,
int  xtype,
vector< string >  dimnames,
string  wname,
vector< size_t >  bs,
vector< size_t >  cratios,
double  missing_value 
)
virtual

Define a compressed variable with missing data values

The defined variable may contain missing data values. These values will not be transformed and compressed

Define a new compressed variable

Parameters
[in]nameSame as NetCDFCpp::DefVar()
[in]xtypeSame as NetCDFCpp::DefVar()
[in]dimnamesSame as NetCDFCpp::DefVar()
[in]wnameName of biorthogonal wavelet to use for data transformation. See VAPoR::WaveFiltBior. If empty, the variable will be blocked according to bs, but will not be compressed.
[in]bsAn ordered list of block dimensions that specifies the block decomposition of the variable. array's associated dimension. The rank of bs may be equal to or less than that of dimnames. In the latter case only the rank(bs) fastest varying dimensions of the variable will be blocked. The dimension(s) of bs[i] need not align with (be integral factors of) the dimension lengths associated with dimnames in which case boundary blocks will be padded. If bs is empty, or the product of its elements is one, the variable will not be blocked or compressed. Hence, the wname and cratio parameters will be ignored. The variable will not be defined as a WASP variable. See InqVarWASP().
[in]cratiosA monotonically decreasing vector of compression ratios. Each element of cratios is in the range 1 (indicating no compression) to max, where max is the maximum compression supported by the specified combination of block size, bs, and wavelet (See InqCompressionInfo()). If the underlying NetCDF file was created with numfiles parameter greater than one then the length of cratios must exactly match that of numfiles.
See also
NetCDFCpp::DefVar(), Create(), InqCompressionInfo()
Parameters
[in]missing_valueValue of missing value indicator.
See also
NetCDFCpp::DefVar()
virtual int VAPoR::WASP::DefVar ( string  name,
int  xtype,
vector< string >  dimnames 
)
inlinevirtual

Define a variable.

Reimplemented from VAPoR::NetCDFCpp.

Definition at line 348 of file WASP.h.

References VAPoR::NetCDFCpp::DefVar().

virtual int VAPoR::WASP::EndDef ( ) const
virtual

End the metadata definition section.

Reimplemented from VAPoR::NetCDFCpp.

static std::vector<string> VAPoR::WASP::GetPaths ( string  path,
int  numfiles 
)
inlinestatic

Return the NetCDF file paths that would be created from a base path.

Parameters
[in]pathThe file base name of the new NetCDF data set
[in]numfilesAn integer greater than or equal to one indicating the number of files to split a variable into
Return values
vectorThe path names generated from path
See also
Create()

Definition at line 625 of file WASP.h.

virtual int VAPoR::WASP::GetVar ( float *  data)
virtual

Read an array of values from the currently opened variable

The currently opened variable may or may not be a WASP variable (See InqVarWASP()).

The entire variable is read and copied into the array pointed to by data. The caller is responsible for ensuring that adequate space is availble in data.

If a compressed variable is being read and the transform supports multi-resolution the method InqVarDimlens() should be be used to determine the dimensions of the variable at the opened refinement level

Parameters
[in]dataSame as NetCDFCpp::PutVara()
See also
InqVarDimlens(), OpenVarRead()
virtual int VAPoR::WASP::GetVar ( double *  data)
virtual
virtual int VAPoR::WASP::GetVar ( int *  data)
virtual
virtual int VAPoR::WASP::GetVar ( unsigned char *  data)
virtual
virtual int VAPoR::WASP::GetVara ( vector< size_t >  start,
vector< size_t >  count,
float *  data 
)
virtual

Read a hyper-slab of values from the currently opened variable

The currently opened variable may or may not be a WASP variable (See InqVarWASP()).

If a compressed variable is being read and the transform supports multi-resolution the method InqVarDimlens() should be be used to determine the dimensions of the variable at the opened refinement level.

Parameters
[in]startA vector of size_t integers specifying the index in the variable where the first of the data values will be read. The coordinates are specified relative to the dimensions of the array at the currently opened refinement level. See NetCDFCpp::InqVarDimlens()
[in]countA vector of size_t integers specifying the edge lengths along each dimension of the hyperslab of data values to be read. The coordinates are specified relative to the dimensions of the array at the currently opened refinement level. See NetCDFCpp::PutVara()
[out]dataSame as NetCDFCpp::PutVara()
See also
InqVarDimlens(), OpenVarRead()
virtual int VAPoR::WASP::GetVara ( vector< size_t >  start,
vector< size_t >  count,
double *  data 
)
virtual
virtual int VAPoR::WASP::GetVara ( vector< size_t >  start,
vector< size_t >  count,
int *  data 
)
virtual
virtual int VAPoR::WASP::GetVara ( vector< size_t >  start,
vector< size_t >  count,
unsigned char *  data 
)
virtual
virtual int VAPoR::WASP::GetVaraBlock ( vector< size_t >  start,
vector< size_t >  count,
float *  data 
)
virtual

Read a hyper-slab of blocked values from currently opened variable

This method is identical to GetVara() with the exceptions that:

  • The vectors start and count must be aligned with the underlying storage block of the variable. See WASP::DefVar()
  • The hyperslab copied to data will preserve its underlying storage blocking (the data will not be contiguous)
Parameters
[in]startA block-aligned vector of size_t integers specifying the index in the variable where the first of the data values will be read.
[in]countA block-aligned vector of size_t integers specifying the edge lengths along each dimension of the hyperslab of data values to be read.
See also
WASP::DefVar()
virtual int VAPoR::WASP::GetVaraBlock ( vector< size_t >  start,
vector< size_t >  count,
double *  data 
)
virtual
virtual int VAPoR::WASP::GetVaraBlock ( vector< size_t >  start,
vector< size_t >  count,
int *  data 
)
virtual
virtual int VAPoR::WASP::GetVaraBlock ( vector< size_t >  start,
vector< size_t >  count,
unsigned char *  data 
)
virtual
static bool VAPoR::WASP::InqCompressionInfo ( vector< size_t >  bs,
string  wname,
size_t &  nlevels,
size_t &  maxcratio 
)
static

Compute the number of levels in a multi-resolution hierarchy

This static method computes and returns the depth (number of levels) in a a multi-resolution hierarch for a given wavelet, wname, and decomposition block, bs. It also computes the maximum compression ratio, cratio, possible for the the specified combination of block size, bs, and wavelet, wname. The maximum compression ratio is cratio:1.

Parameters
[in]wnamewavelet name
[in]bsDimensions of native decomposition block. The rank of bs may be less than or equal to the rank of dims.
[out]nlevelsNumber of levels in hierarchy
[out]maxcratioMaximum compression ratio

bool status If bs, wname, or the combination there of is invalid false is returned and the values of nlevels and maxcratio are undefined. Upon success true is returned.

static int VAPoR::WASP::InqDimsAtLevel ( string  wname,
int  level,
vector< size_t >  dims,
vector< size_t >  bs,
vector< size_t > &  dims_at_level,
vector< size_t > &  bs_at_level 
)
static

Return the dimensions of a multi-resolution grid at a specified level in the hierarchy

This static method calculates the coarsened dimensions of a grid at a specified level in a multiresolution wavelet hierarchy. The dimensions of an array are determined by the combination of the multi-resolution wavelet used, specified by wname, the refinement level, level, in the multi-resolution hierarchy, the rank and dimension of the decomposition block, specified by bs, and the dimensions of the native (original) grid, dims.

Parameters
[in]wnamewavelet name
[in]levelGrid (dimension) refinement level. A value of 0 indicates the coarsest refinement level available, a value of one indicates next coarsest, and so on. The finest resolution available is given by InqVarNumRefLevels() - 1. If level is less than 0 it is interpreted do indicate the finest grid resolution.
[in]dimsDimensions of native grid
[in]bsDimensions of native decomposition block. The rank of bs may be less than or equal to the rank of dims.
[out]dims_at_levelComputed grid dimensions at the specified level
[out]bs_at_levelComputed block dimensions at the specified level
See also
VarOpenRead()
virtual int VAPoR::WASP::InqVarCompressed ( string  varname,
bool &  compressed 
) const
virtual

Inquire whether a named variable is compressed

Parameters
[in]nameThe name of the variable
[out]compressedA boolean return value indicating whether variable name is compressed
virtual int VAPoR::WASP::InqVarCompressionParams ( string  name,
string &  wname,
vector< size_t > &  bs,
vector< size_t > &  cratios 
) const
virtual

Returns compression paramaters associated with the named variable

This method returns various compression parameters associated with a compressed variabled named by name. If the variable name is not compressed wname will be empty. If the variable is not blocked bs will be either empty or all elements set to one.

Parameters
[in]nameThe variable name.
[out]wnameThe name of the wavelet used to transform the variable.
[out]bsAn ordered list of block dimensions that specifies the block decomposition of the variable.
[out]cratiosThe compression ratios available.
virtual int VAPoR::WASP::InqVarDimlens ( string  name,
int  level,
vector< size_t > &  dims,
vector< size_t > &  bs 
) const
virtual

Return the dimension lengths associated with a variable.

Returns the dimensions of the named variable at the multi-resolution level indicated by level. If the variable does not support multi-resolution (is not compressed with a multi-resolution transform) the level parameter is ignored, the variable's native dimensions will be returned, and the value of bs will not be undefined.

Parameters
[in]nameName of NetCDF variable
[in]levelGrid (dimension) refinement level. A value of 0 indicates the coarsest refinement level available, a value of one indicates next coarsest, and so on. The finest resolution available is given by InqVarNumRefLevels() - 1. If level is less than 0 it is interpreted do indicate the finest grid resolution.
[out]dimsOrdered list of variable's name dimension lengths at the grid hierarchy level indicated by level
[out]bsOrdered list of block dimension lengths at the grid hierarchy level indicated by level
See also
NetCDFCpp::InqVarDims(), InqVarNumRefLevels(), InqDimsAtLevel()
virtual int VAPoR::WASP::InqVarDims ( string  name,
vector< string > &  dimnames,
vector< size_t > &  dims 
) const
virtual

Reimplemented from VAPoR::NetCDFCpp.

virtual int VAPoR::WASP::InqVarNumRefLevels ( string  name) const
virtual

Return the number of levels available in a variable's multiresolution hierarchy.

Returns the depth of the multi-resolution hierarchy for the variable specified by name. If the variable does not support multi-resolution (is not compressed with a multi-resolution transform) value of 1 is returned.

Parameters
[in]nameThe name of the variable
Return values
depthUpon success the number of levels in hierarchy are returned. If varname does not specify a known variable a -1 is returned.
int VAPoR::WASP::InqVarWASP ( string  varname,
bool &  wasp 
) const

Inquire whether a variable is a WASP variable

This method returns true if the variable named by varname was defined by the WASP API and is either compressed, blocked, or both.

virtual int VAPoR::WASP::Open ( string  path,
int  mode 
)
virtual

Open an existing NetCDF file

Parameters
[in]pathThe file base name of the new NetCDF data set
[in]modeSame as in NetCDFCpp::Open()
See also
NetCDFCpp::Open()

Reimplemented from VAPoR::NetCDFCpp.

virtual int VAPoR::WASP::OpenVarRead ( string  name,
int  level,
int  lod 
)
virtual

Prepare a variable for reading

Compressed or blocked variables must be opened prior to reading. This method initializes the variable named by name for reading using the GetVara() or GetVar() methods. If the variable is defined as compressed the lod parameter indicates which compression levels will used during reconstruction of the variable. Valid values for lod are in the range 0..max, where max the size of cratios - 1. If the transform used to compress this variable supports multiresolution then the level parameter indicates the grid hierarchy refinement level for which to reconstruct the data.

Any currently opened variable is first closed with Close()

Parameters
[in]nameName of variable
[in]lodLevel-of-detail to read.
[in]levelGrid refinement level
See also
GetVara()
virtual int VAPoR::WASP::OpenVarWrite ( string  name,
int  lod 
)
virtual

Prepare a variable for writing

Compressed or blocked variables must be opened prior to writing. This method initializes the variable named by name for writing using the PutVara() method. If the variable is defined as compressed the lod parameter indicates which compression levels will be stored. Valid values for lod are in the range 0..max, where max the size of cratios - 1.

Any currently opened variable is first closed with Close()

Parameters
[in]nameName of variable
[in]lodLevel-of-detail to save. If not -1, all LOD's from 0 to lod will subsequently be written.
Note
Is lod needed? Since cratios can be specified on a per variable basis perhaps this is not needed? For single file representations it would be better to limit the lod using cratios, which will result in a smaller file.
See also
PutVara(),
virtual int VAPoR::WASP::PutVar ( const float *  data)
virtual
virtual int VAPoR::WASP::PutVar ( const double *  data)
virtual
virtual int VAPoR::WASP::PutVar ( const int *  data)
virtual
virtual int VAPoR::WASP::PutVar ( const unsigned char *  data)
virtual
virtual int VAPoR::WASP::PutVar ( const float *  data,
const unsigned char *  mask 
)
virtual
virtual int VAPoR::WASP::PutVar ( const double *  data,
const unsigned char *  mask 
)
virtual
virtual int VAPoR::WASP::PutVar ( const int *  data,
const unsigned char *  mask 
)
virtual
virtual int VAPoR::WASP::PutVar ( const unsigned char *  data,
const unsigned char *  mask 
)
virtual
virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const float *  data 
)
virtual

Write an array of values to the currently opened variable

The currently opened variable may or may not be a WASP variable (See InqVarWASP()).

The combination of start and count specify the coordinates of a hyperslab to write as described by NetCDFCpp::PutVara(). However, for blocked data dimensions the values of start and count must be block aligned unless the hyperslab includes the array boundary, in which case the hyperslab must be aligned to the boundary.

Parameters
[in]startA vector of block-aligned integers specifying the index in the variable where the first of the data values will be read. See NetCDFCpp::PutVara()
[in]countA vector of size_t, block-aligned integers specifying the edge lengths along each dimension of the block of data values to be read. See NetCDFCpp::PutVara()
[in]dataSame as NetCDFCpp::PutVara()
See also
OpenVarWrite();
virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const double *  data 
)
virtual
virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const int *  data 
)
virtual
virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const unsigned char *  data 
)
virtual
virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const float *  data,
const unsigned char *  mask 
)
virtual

Write an array of masked values to the currently opened variable

This version of PutVar() handles missing data values whose presence is indicated by a boolean mask, mask. Missing values are replaced with values that perform better when compressed (e.g. the average of the field)

Parameters
[in]maska boolean array with the same shape as data indicting valid and invalid values in data. Elements of data corresponding to false values in mask are not preserved when written to storage.
virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const double *  data,
const unsigned char *  mask 
)
virtual
virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const int *  data,
const unsigned char *  mask 
)
virtual
virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const unsigned char *  data,
const unsigned char *  mask 
)
virtual
virtual int VAPoR::WASP::SetFill ( int  fillmode,
int &  old_modep 
)
virtual

Set the fill value.

Reimplemented from VAPoR::NetCDFCpp.


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