VAPoR
3.0.0
|
Implements WASP compression conventions for NetCDF. More...
#include <WASP.h>
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) |
Implements WASP compression conventions for NetCDF.
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.
wname | Name 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. |
bs | An 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 . |
cratios | A 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. |
lod | An index into the cratios vector. A value of -1 may be used to index the last element of cratios |
level | Array 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. |
VAPoR::WASP::WASP | ( | int | nthreads = 0 | ) |
default constructor
Construct a WASP object
[in] | nthreads | Number 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 |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
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 |
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 |
Create a new NetCDF data set with support for WASP conventions
[in] | path | The file base name of the new NetCDF data set |
[in] | cmode | Same as in NetCDFCpp::Create() |
[in] | initialsz | Same as in NetCDFCpp::Create() |
[in] | bufrsizehintp | Same as in NetCDFCpp::Create() |
[in] | numfiles | An 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 . |
|
virtual |
Define a dimension.
Reimplemented from VAPoR::NetCDFCpp.
|
virtual |
Define a new compressed variable
[in] | name | Same as NetCDFCpp::DefVar() |
[in] | xtype | Same as NetCDFCpp::DefVar() |
[in] | dimnames | Same as NetCDFCpp::DefVar() |
[in] | wname | Name 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] | bs | An 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] | cratios | A 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. |
|
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
[in] | name | Same as NetCDFCpp::DefVar() |
[in] | xtype | Same as NetCDFCpp::DefVar() |
[in] | dimnames | Same as NetCDFCpp::DefVar() |
[in] | wname | Name 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] | bs | An 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] | cratios | A 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. |
[in] | missing_value | Value of missing value indicator. |
|
inlinevirtual |
Define a variable.
Reimplemented from VAPoR::NetCDFCpp.
Definition at line 348 of file WASP.h.
References VAPoR::NetCDFCpp::DefVar().
|
virtual |
End the metadata definition section.
Reimplemented from VAPoR::NetCDFCpp.
|
inlinestatic |
Return the NetCDF file paths that would be created from a base path.
[in] | path | The file base name of the new NetCDF data set |
[in] | numfiles | An integer greater than or equal to one indicating the number of files to split a variable into |
vector | The path names generated from path |
|
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
[in] | data | Same as NetCDFCpp::PutVara() |
|
virtual |
|
virtual |
|
virtual |
|
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.
[in] | start | A 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] | count | A 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] | data | Same as NetCDFCpp::PutVara() |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Read a hyper-slab of blocked values from currently opened variable
This method is identical to GetVara() with the exceptions that:
start
and count
must be aligned with the underlying storage block of the variable. See WASP::DefVar()data
will preserve its underlying storage blocking (the data will not be contiguous)[in] | start | A block-aligned vector of size_t integers specifying the index in the variable where the first of the data values will be read. |
[in] | count | A block-aligned vector of size_t integers specifying the edge lengths along each dimension of the hyperslab of data values to be read. |
|
virtual |
|
virtual |
|
virtual |
|
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
.
[in] | wname | wavelet name |
[in] | bs | Dimensions of native decomposition block. The rank of bs may be less than or equal to the rank of dims . |
[out] | nlevels | Number of levels in hierarchy |
[out] | maxcratio | Maximum 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 |
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
.
[in] | wname | wavelet name |
[in] | level | Grid (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] | dims | Dimensions of native grid |
[in] | bs | Dimensions of native decomposition block. The rank of bs may be less than or equal to the rank of dims . |
[out] | dims_at_level | Computed grid dimensions at the specified level |
[out] | bs_at_level | Computed block dimensions at the specified level |
|
virtual |
Inquire whether a named variable is compressed
[in] | name | The name of the variable |
[out] | compressed | A boolean return value indicating whether variable name is compressed |
|
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.
[in] | name | The variable name. |
[out] | wname | The name of the wavelet used to transform the variable. |
[out] | bs | An ordered list of block dimensions that specifies the block decomposition of the variable. |
[out] | cratios | The compression ratios available. |
|
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.
[in] | name | Name of NetCDF variable |
[in] | level | Grid (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] | dims | Ordered list of variable's name dimension lengths at the grid hierarchy level indicated by level |
[out] | bs | Ordered list of block dimension lengths at the grid hierarchy level indicated by level |
|
virtual |
Reimplemented from VAPoR::NetCDFCpp.
|
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.
[in] | name | The name of the variable |
depth | Upon 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 |
|
virtual |
Open an existing NetCDF file
[in] | path | The file base name of the new NetCDF data set |
[in] | mode | Same as in NetCDFCpp::Open() |
Reimplemented from VAPoR::NetCDFCpp.
|
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()
[in] | name | Name of variable |
[in] | lod | Level-of-detail to read. |
[in] | level | Grid refinement level |
|
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()
[in] | name | Name of variable |
[in] | lod | Level-of-detail to save. If not -1, all LOD's from 0 to lod will subsequently be written. |
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.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
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.
[in] | start | A 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] | count | A 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] | data | Same as NetCDFCpp::PutVara() |
|
virtual |
|
virtual |
|
virtual |
|
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)
[in] | mask | a 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 |
|
virtual |
|
virtual |
|
virtual |
Set the fill value.
Reimplemented from VAPoR::NetCDFCpp.