VAPOR3 3.9.4
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 Wasp::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.
 
virtual int EndDef () const
 End the metadata definition section.
 
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.
 
int DefDim (string name, size_t len) const
 Define a dimension.
 
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 int16_t *data)
 
virtual int PutVar (const int16_t *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 int16_t *data, const unsigned char *mask)
 
virtual int PutVar (const int16_t *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, int16_t *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, int16_t *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 (int16_t *data)
 
virtual int GetVar (unsigned char *data)
 
virtual int CopyVar (string varname, WASP &wasp)
 
virtual int CopyVarFrom (string varname, NetCDFCpp &ncdf)
 
virtual int CopyVarTo (string varname, NetCDFCpp &ncdf)
 
- 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 Open (string path, int mode)
 
virtual int DefDim (string name, size_t len) const
 Define a dimension.
 
virtual int DefVar (string name, int xtype, vector< string > dimnames)
 Define a variable.
 
virtual int InqVarDims (string name, vector< string > &dimnames, vector< size_t > &dims) const
 Learn the dimension names associated with a variable.
 
virtual int InqDims (vector< string > &dimnames, vector< size_t > &dims) const
 Learn the dimension names and lengths defined in a file.
 
virtual int InqDimlen (string name, size_t &len) const
 Learn the length of a named dimension.
 
int InqAttnames (string varname, std::vector< string > &attnames) const
 Learn the names of all the global or variable attributes.
 
int CopyAtt (string varname_in, string attname, NetCDFCpp &ncdf_out, string varname_out) const
 
virtual int PutAtt (string varname, string attname, int value) const
 Write an integer attribute.
 
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.
 
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.
 
virtual int InqAtt (string varname, string attname, nc_type &xtype, size_t &len) const
 Return information about a NetCDF attribute.
 
virtual int InqVartype (string varname, nc_type &xtype) const
 Find a variable's external representation type.
 
virtual int SetFill (int fillmode, int &old_modep)
 Set the fill value.
 
virtual int EndDef () const
 End the metadata definition section.
 
virtual int ReDef () const
 Put open netcdf dataset into define mode.
 
virtual int Close ()
 Close the currently opened file.
 
virtual int PutVara (string varname, vector< size_t > start, vector< size_t > count, const void *data)
 Write an array of values to a variable.
 
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.
 
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) const
 Read an array of values from a variable.
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, float *data) const
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, double *data) const
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, int *data) const
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, long *data) const
 
virtual int GetVara (string varname, vector< size_t > start, vector< size_t > count, unsigned char *data) const
 
virtual int GetVar (string varname, void *data) const
 Read an entire variable with one function call.
 
virtual int GetVar (string varname, float *data) const
 
virtual int GetVar (string varname, double *data) const
 
virtual int GetVar (string varname, int *data) const
 
virtual int GetVar (string varname, long *data) const
 
virtual int GetVar (string varname, unsigned char *data) const
 
virtual int CopyVar (string varname, NetCDFCpp &ncdf_out) const
 Copy a variable from one file to another.
 
virtual bool ValidFile (string path)
 
virtual bool InqDimDefined (string dimname)
 
virtual bool InqAttDefined (string varname, string attname)
 
virtual int InqVarnames (vector< string > &varnames) const
 
int GetNCID () const
 
- Public Member Functions inherited from Wasp::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.
 
static string AttNameBlockSize ()
 NetCDF attribute name specifying compression block dimensions.
 
static string AttNameNumFiles ()
 NetCDF attribute name specifying number of compression files.
 
static string AttNameCRatios ()
 NetCDF attribute name specifying compression ratios.
 
static string AttNameWASP ()
 
static string AttNameDimNames ()
 NetCDF attribute name specifying names of uncompressed dimensions.
 
static string AttNameMissingValue ()
 NetCDF attribute name specifying if missing data values are present.
 
static string AttNameVersion ()
 NetCDF attribute name specifying WASP version number.
 
- Static Public Member Functions inherited from VAPoR::NetCDFCpp
static size_t SizeOf (int nctype)
 
- Static Public Member Functions inherited from Wasp::MyBase
static void SetErrMsg (const char *format,...)
 Record a formatted error message.
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code.
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code.
 
static int GetErrCode ()
 Retrieve the current error code.
 
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.
 
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 bool GetEnableErrMsg ()
 

Additional Inherited Members

- Public Types inherited from Wasp::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 
- Static Public Attributes inherited from Wasp::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 Wasp::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 Wasp::MyBase. Unless otherwise documented any method that returns an integer value is returning status. A negative value indicates failure. Error messages are logged via Wasp::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 99 of file WASP.h.

Constructor & Destructor Documentation

◆ WASP()

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.

◆ ~WASP()

virtual VAPoR::WASP::~WASP ( )
virtual

Member Function Documentation

◆ AttNameBlockSize()

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

NetCDF attribute name specifying compression block dimensions.

Definition at line 610 of file WASP.h.

◆ AttNameCRatios()

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

NetCDF attribute name specifying compression ratios.

Definition at line 616 of file WASP.h.

◆ AttNameDimNames()

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

NetCDF attribute name specifying names of uncompressed dimensions.

Definition at line 623 of file WASP.h.

◆ AttNameMissingValue()

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

NetCDF attribute name specifying if missing data values are present.

Definition at line 626 of file WASP.h.

◆ AttNameNumFiles()

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

NetCDF attribute name specifying number of compression files.

Definition at line 613 of file WASP.h.

◆ AttNameVersion()

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

NetCDF attribute name specifying WASP version number.

Definition at line 629 of file WASP.h.

◆ AttNameWASP()

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

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

Definition at line 620 of file WASP.h.

◆ AttNameWavelet()

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

NetCDF attribute name specifying Wavelet name.

Definition at line 607 of file WASP.h.

◆ Close()

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.

◆ CloseVar()

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.

◆ CopyVar()

virtual int VAPoR::WASP::CopyVar ( string  varname,
WASP wasp 
)
virtual

Copy a variable from one WASP file to another WASP file

Copy a variable from the WASP file associated with this object instance to the WASP file associated with wasp The variable varname must be defined in both the source and destination files, and must have matching dimensions.

If the source and destination variables are compressed this method attempts to copy data verbatim, avoiding decoding and encoding.

◆ CopyVarFrom()

virtual int VAPoR::WASP::CopyVarFrom ( string  varname,
NetCDFCpp ncdf 
)
virtual

Copy a variable from a NetCDF file to a WASP file

Copy a variable from the NetCDF file associated with ncdf to the WASP file associated with this object instance. The variable varname must be defined in both the source and destination files, and must have matching dimensions.

◆ CopyVarTo()

virtual int VAPoR::WASP::CopyVarTo ( string  varname,
NetCDFCpp ncdf 
)
virtual

Copy a variable from a WASP file to a NetCDF file

Copy a variable from the WASP file associated this object instance to the WASP file associated with ncdf. The variable varname must be defined in both the source and destination files, and must have matching dimensions.

◆ Create()

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()

◆ DefDim()

int VAPoR::WASP::DefDim ( string  name,
size_t  len 
) const
virtual

Define a dimension.

Reimplemented from VAPoR::NetCDFCpp.

◆ DefVar() [1/3]

virtual int VAPoR::WASP::DefVar ( string  name,
int  xtype,
vector< string >  dimnames 
)
inlinevirtual

Define a variable.

Reimplemented from VAPoR::NetCDFCpp.

Definition at line 325 of file WASP.h.

◆ DefVar() [2/3]

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()

◆ DefVar() [3/3]

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()

◆ EndDef()

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

End the metadata definition section.

Reimplemented from VAPoR::NetCDFCpp.

◆ GetPaths()

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 596 of file WASP.h.

◆ GetVar() [1/5]

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

◆ GetVar() [2/5]

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()

◆ GetVar() [3/5]

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

◆ GetVar() [4/5]

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

◆ GetVar() [5/5]

virtual int VAPoR::WASP::GetVar ( unsigned char *  data)
virtual

◆ GetVara() [1/5]

virtual int VAPoR::WASP::GetVara ( vector< size_t >  start,
vector< size_t >  count,
double *  data 
)
virtual

◆ GetVara() [2/5]

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()

◆ GetVara() [3/5]

virtual int VAPoR::WASP::GetVara ( vector< size_t >  start,
vector< size_t >  count,
int *  data 
)
virtual

◆ GetVara() [4/5]

virtual int VAPoR::WASP::GetVara ( vector< size_t >  start,
vector< size_t >  count,
int16_t *  data 
)
virtual

◆ GetVara() [5/5]

virtual int VAPoR::WASP::GetVara ( vector< size_t >  start,
vector< size_t >  count,
unsigned char *  data 
)
virtual

◆ GetVaraBlock() [1/5]

virtual int VAPoR::WASP::GetVaraBlock ( vector< size_t >  start,
vector< size_t >  count,
double *  data 
)
virtual

◆ GetVaraBlock() [2/5]

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()

◆ GetVaraBlock() [3/5]

virtual int VAPoR::WASP::GetVaraBlock ( vector< size_t >  start,
vector< size_t >  count,
int *  data 
)
virtual

◆ GetVaraBlock() [4/5]

virtual int VAPoR::WASP::GetVaraBlock ( vector< size_t >  start,
vector< size_t >  count,
int16_t *  data 
)
virtual

◆ GetVaraBlock() [5/5]

virtual int VAPoR::WASP::GetVaraBlock ( vector< size_t >  start,
vector< size_t >  count,
unsigned char *  data 
)
virtual

◆ InqCompressionInfo()

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.

◆ InqDimsAtLevel()

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()

◆ InqVarCompressed()

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

◆ InqVarCompressionParams()

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.

◆ InqVarDimlens()

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()

◆ InqVarDims()

virtual int VAPoR::WASP::InqVarDims ( string  name,
vector< string > &  dimnames,
vector< size_t > &  dims 
) const
virtual

Reimplemented from VAPoR::NetCDFCpp.

◆ InqVarNumRefLevels()

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.

◆ InqVarWASP()

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.

◆ Open()

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.

◆ OpenVarRead()

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()

◆ OpenVarWrite()

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(),

◆ PutVar() [1/10]

virtual int VAPoR::WASP::PutVar ( const double *  data)
virtual

◆ PutVar() [2/10]

virtual int VAPoR::WASP::PutVar ( const double *  data,
const unsigned char *  mask 
)
virtual

◆ PutVar() [3/10]

virtual int VAPoR::WASP::PutVar ( const float *  data)
virtual

◆ PutVar() [4/10]

virtual int VAPoR::WASP::PutVar ( const float *  data,
const unsigned char *  mask 
)
virtual

◆ PutVar() [5/10]

virtual int VAPoR::WASP::PutVar ( const int *  data)
virtual

◆ PutVar() [6/10]

virtual int VAPoR::WASP::PutVar ( const int *  data,
const unsigned char *  mask 
)
virtual

◆ PutVar() [7/10]

virtual int VAPoR::WASP::PutVar ( const int16_t *  data)
virtual

◆ PutVar() [8/10]

virtual int VAPoR::WASP::PutVar ( const int16_t *  data,
const unsigned char *  mask 
)
virtual

◆ PutVar() [9/10]

virtual int VAPoR::WASP::PutVar ( const unsigned char *  data)
virtual

◆ PutVar() [10/10]

virtual int VAPoR::WASP::PutVar ( const unsigned char *  data,
const unsigned char *  mask 
)
virtual

◆ PutVara() [1/10]

virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const double *  data 
)
virtual

◆ PutVara() [2/10]

virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const double *  data,
const unsigned char *  mask 
)
virtual

◆ PutVara() [3/10]

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();

◆ PutVara() [4/10]

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.

◆ PutVara() [5/10]

virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const int *  data 
)
virtual

◆ PutVara() [6/10]

virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const int *  data,
const unsigned char *  mask 
)
virtual

◆ PutVara() [7/10]

virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const int16_t *  data 
)
virtual

◆ PutVara() [8/10]

virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const int16_t *  data,
const unsigned char *  mask 
)
virtual

◆ PutVara() [9/10]

virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const unsigned char *  data 
)
virtual

◆ PutVara() [10/10]

virtual int VAPoR::WASP::PutVara ( vector< size_t >  start,
vector< size_t >  count,
const unsigned char *  data,
const unsigned char *  mask 
)
virtual

◆ SetFill()

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: