VAPOR3 3.9.4
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
VAPoR::VDC Class Referenceabstract

Defines API for reading, writing, and appending data to a VAPOR Data Collection (Version 3) More...

#include <VDC.h>

Inheritance diagram for VAPoR::VDC:
VAPoR::DC Wasp::MyBase VAPoR::VDCNetCDF

Public Types

enum  AccessMode { R , W , A }
 
- Public Types inherited from VAPoR::DC
enum  XType {
  INVALID = -1 , FLOAT , DOUBLE , UINT8 ,
  INT8 , INT32 , INT64 , TEXT
}
 External storage types for primitive data. More...
 
- Public Types inherited from Wasp::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 

Public Member Functions

 VDC ()
 
virtual ~VDC ()
 
int SetCompressionBlock (string wname, std::vector< size_t > cratios)
 
void GetCompressionBlock (std::vector< size_t > &bs, string &wname, std::vector< size_t > &cratios) const
 
void SetPeriodicBoundary (std::vector< bool > periodic)
 
std::vector< bool > GetPeriodicBoundary () const
 
int DefineDimension (string dimname, size_t length)
 
int DefineDimension (string dimname, size_t length, int axis)
 
int DefineCoordVar (string varname, std::vector< string > dimnames, string time_dim_name, string units, int axis, XType type, bool compressed)
 
int DefineCoordVarUniform (string varname, std::vector< string > dimname, string time_dim_name, string units, int axis, XType type, bool compressed)
 
int DefineDataVar (string varname, std::vector< string > dimnames, std::vector< string > coordvars, string units, XType type, bool compressed)
 
int DefineDataVar (string varname, std::vector< string > dimnames, std::vector< string > coordvars, string units, XType type, double missing_value, string maskvar)
 
int PutAtt (string varname, string attname, XType type, const vector< double > &values)
 
int PutAtt (string varname, string attname, XType type, const vector< long > &values)
 
int PutAtt (string varname, string attname, XType type, const string &values)
 
int CopyAtt (const DC &src, string varname, string attname)
 
int CopyAtt (const DC &src, string varname)
 
virtual int SetMapProjection (string varname, string projstring)
 
virtual int SetMapProjection (string projstring)
 
int EndDefine ()
 
virtual int GetPath (string varname, size_t ts, string &path, size_t &file_ts, size_t &max_ts) const =0
 
virtual int OpenVariableWrite (size_t ts, string varname, int lod=-1)=0
 
virtual int CloseVariableWrite (int fd)=0
 
virtual int Write (int fd, const float *data)=0
 
virtual int Write (int fd, const int *data)=0
 
virtual int WriteSlice (int fd, const float *slice)=0
 
virtual int WriteSlice (int fd, const int *slice)=0
 
virtual int WriteSlice (int fd, const unsigned char *slice)=0
 
virtual int PutVar (string varname, int lod, const float *data)=0
 
virtual int PutVar (string varname, int lod, const int *data)=0
 
virtual int PutVar (size_t ts, string varname, int lod, const float *data)=0
 
virtual int PutVar (size_t ts, string varname, int lod, const int *data)=0
 
virtual int CopyVar (DC &dc, string varname, int srclod, int dstlod)=0
 
virtual int CopyVar (DC &dc, size_t ts, string varname, int srclod, int dstlod)=0
 
virtual bool CompressionInfo (vector< size_t > bs, string wname, size_t &nlevels, size_t &maxcratio) const =0
 
virtual bool variableExists (size_t ts, string varname, int reflevel=0, int lod=0) const =0
 
- Public Member Functions inherited from VAPoR::DC
 DC ()
 
virtual ~DC ()
 
virtual int Initialize (const std::vector< string > &paths, const std::vector< string > &options=std::vector< string >())
 
virtual bool GetDimension (string dimname, DC::Dimension &dimension, long ts) const
 
virtual std::vector< string > GetDimensionNames () const
 
virtual std::vector< string > GetMeshNames () const
 
virtual bool GetMesh (string mesh_name, DC::Mesh &mesh) const
 
virtual bool GetMeshDimLens (const string &mesh_name, std::vector< size_t > &dims, long ts=-1) const
 
virtual bool GetMeshDimNames (const string &mesh_name, std::vector< string > &dimnames) const
 
virtual bool GetCoordVarInfo (string varname, DC::CoordVar &cvar) const
 
virtual bool GetDataVarInfo (string varname, DC::DataVar &datavar) const
 
virtual bool GetAuxVarInfo (string varname, DC::AuxVar &var) const
 
virtual bool GetBaseVarInfo (string varname, DC::BaseVar &var) const
 
virtual std::vector< string > GetDataVarNames () const
 
virtual std::vector< string > GetCoordVarNames () const
 
virtual std::vector< string > GetAuxVarNames () const
 
virtual size_t GetNumRefLevels (string varname) const
 
virtual bool GetAtt (string varname, string attname, vector< double > &values) const
 
virtual bool GetAtt (string varname, string attname, vector< long > &values) const
 
virtual bool GetAtt (string varname, string attname, string &values) const
 
virtual std::vector< string > GetAttNames (string varname) const
 
virtual XType GetAttType (string varname, string attname) const
 
virtual int GetDimLensAtLevel (string varname, int level, std::vector< size_t > &dims_at_level, std::vector< size_t > &bs_at_level, long ts=-1) const
 
virtual int GetDimLens (string varname, std::vector< size_t > &dims, long ts=-1)
 
virtual string GetMapProjection () const
 
virtual int OpenVariableRead (size_t ts, string varname, int level=0, int lod=0)
 
virtual int CloseVariable (int fd)
 
virtual int Read (int fd, float *data)
 
virtual int Read (int fd, double *data)
 
virtual int Read (int fd, int *data)
 
virtual int ReadSlice (int fd, float *slice)
 
virtual int ReadSlice (int fd, double *slice)
 
virtual int ReadSlice (int fd, int *slice)
 
virtual int ReadRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, float *region)
 
virtual int ReadRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, double *region)
 
virtual int ReadRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, int *region)
 
virtual int GetVar (string varname, int level, int lod, float *data)
 
virtual int GetVar (string varname, int level, int lod, double *data)
 
virtual int GetVar (string varname, int level, int lod, int *data)
 
virtual int GetVar (size_t ts, string varname, int level, int lod, float *data)
 
virtual int GetVar (size_t ts, string varname, int level, int lod, double *data)
 
virtual int GetVar (size_t ts, string varname, int level, int lod, int *data)
 
virtual bool VariableExists (size_t ts, string varname, int reflevel=0, int lod=0) const
 
virtual int GetHyperSliceInfo (string varname, int level, std::vector< size_t > &dims, size_t &nslice, long ts=-1)
 
virtual std::vector< string > GetDataVarNames (int ndim) const
 
virtual bool GetVarDimensions (string varname, bool spatial, vector< DC::Dimension > &dimensions, long ts) const
 
virtual bool GetVarDimLens (string varname, bool spatial, vector< size_t > &dimlens, long ts=-1) const
 
virtual bool GetVarDimLens (string varname, vector< size_t > &sdimlens, size_t &time_dimlen, long ts=-1) const
 
virtual bool GetVarDimNames (string varname, bool spatial, vector< string > &dimnames) const
 
virtual bool GetVarDimNames (string varname, vector< string > &sdimnames, string &time_dimname) const
 
virtual size_t GetVarTopologyDim (string varname) const
 
virtual size_t GetVarGeometryDim (string varname) const
 
virtual bool IsTimeVarying (string varname) const
 
virtual bool IsCompressed (string varname) const
 
virtual int GetNumTimeSteps (string varname) const
 
virtual std::vector< size_t > GetCRatios (string varname) const
 
virtual bool IsDataVar (string varname) const
 
virtual bool IsCoordVar (string varname) const
 
virtual bool IsAuxVar (string varname) const
 
virtual bool GetVarCoordVars (string varname, bool spatial, std::vector< string > &coord_vars) const
 
bool GetVarConnVars (string varname, string &face_node_var, string &node_face_var, string &face_edge_var, string &face_face_var, string &edge_node_var, string &edge_face_var) const
 
virtual size_t GetNumDimensions (string varname) const
 
std::vector< string > GetTimeCoordVarNames () const
 
- Public Member Functions inherited from Wasp::MyBase
 MyBase ()
 
const string & getClassName () const
 

Protected Member Functions

virtual int initialize (const std::vector< string > &paths, const std::vector< string > &options, AccessMode mode, vector< size_t > bs)
 
virtual int initialize (const std::vector< string > &paths, const std::vector< string > &options)
 
bool getDimension (string dimname, DC::Dimension &dimension) const
 
std::vector< string > getDimensionNames () const
 
std::vector< string > getMeshNames () const
 
virtual bool getMesh (string mesh_name, DC::Mesh &mesh) const
 
bool getCoordVarInfo (string varname, DC::CoordVar &cvar) const
 
bool getDataVarInfo (string varname, DC::DataVar &datavar) const
 
bool getAuxVarInfo (string varname, DC::AuxVar &var) const
 
bool getBaseVarInfo (string varname, DC::BaseVar &var) const
 
virtual std::vector< string > getDataVarNames () const
 
virtual std::vector< string > getAuxVarNames () const
 
virtual std::vector< string > getCoordVarNames () const
 
size_t getNumRefLevels (string varname) const
 
bool getAtt (string varname, string attname, vector< double > &values) const
 
bool getAtt (string varname, string attname, vector< long > &values) const
 
bool getAtt (string varname, string attname, string &values) const
 
std::vector< string > getAttNames (string varname) const
 
XType getAttType (string varname, string attname) const
 
virtual vector< size_t > getBlockSize () const
 
virtual int getDimLensAtLevel (string varname, int level, std::vector< size_t > &dims_at_level, std::vector< size_t > &bs_at_level) const =0
 
virtual string getMapProjection (string varname) const
 
virtual string getMapProjection () const
 
virtual string getMapProjectionDefault () const
 
virtual int openVariableRead (size_t ts, string varname, int level=0, int lod=0)=0
 
virtual int closeVariable (int fd)=0
 
virtual int readRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, float *region)=0
 
virtual int readRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, double *region)=0
 
- Protected Member Functions inherited from VAPoR::DC
virtual int initialize (const std::vector< string > &paths, const std::vector< string > &options=std::vector< string >())=0
 
virtual bool getDimension (string dimname, DC::Dimension &dimension) const =0
 
virtual bool getDimension (string dimname, DC::Dimension &dimension, long ts) const
 
virtual std::vector< string > getDimensionNames () const =0
 
virtual std::vector< string > getMeshNames () const =0
 
virtual bool getMesh (string mesh_name, DC::Mesh &mesh) const =0
 
virtual bool getCoordVarInfo (string varname, DC::CoordVar &cvar) const =0
 
virtual bool getDataVarInfo (string varname, DC::DataVar &datavar) const =0
 
virtual bool getAuxVarInfo (string varname, DC::AuxVar &var) const =0
 
virtual bool getBaseVarInfo (string varname, DC::BaseVar &var) const =0
 
virtual std::vector< string > getDataVarNames () const =0
 
virtual std::vector< string > getCoordVarNames () const =0
 
virtual std::vector< string > getAuxVarNames () const =0
 
virtual size_t getNumRefLevels (string varname) const =0
 
virtual bool getAtt (string varname, string attname, vector< double > &values) const =0
 
virtual bool getAtt (string varname, string attname, vector< long > &values) const =0
 
virtual bool getAtt (string varname, string attname, string &values) const =0
 
virtual std::vector< string > getAttNames (string varname) const =0
 
virtual XType getAttType (string varname, string attname) const =0
 
virtual vector< size_t > getBlockSize () const
 
virtual int getDimLensAtLevel (string varname, int level, std::vector< size_t > &dims_at_level, std::vector< size_t > &bs_at_level) const =0
 
virtual int getDimLensAtLevel (string varname, int level, std::vector< size_t > &dims_at_level, std::vector< size_t > &bs_at_level, long ts) const
 
virtual string getMapProjection () const =0
 
virtual int openVariableRead (size_t ts, string varname, int level=0, int lod=0)=0
 
virtual int closeVariable (int fd)=0
 
virtual int readRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, float *region)=0
 
virtual int readRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, double *region)=0
 
virtual int readRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, int *region)=0
 
virtual bool variableExists (size_t ts, string varname, int reflevel=0, int lod=0) const =0
 
- Protected Member Functions inherited from Wasp::MyBase
void SetClassName (const string &name)
 

Protected Attributes

string _master_path
 
AccessMode _mode
 
bool _defineMode
 
std::vector< size_t > _bs
 
string _wname
 
std::vector< size_t > _cratios
 
vector< bool > _periodic
 
VAPoR::UDUnits _udunits
 
std::map< string, Dimension_dimsMap
 
std::map< string, Attribute_atts
 
std::map< string, CoordVar_coordVars
 
std::map< string, DataVar_dataVars
 
std::map< string, Mesh_meshes
 
- Protected Attributes inherited from VAPoR::DC
DC::FileTable _fileTable
 

Friends

std::ostream & operator<< (std::ostream &o, const VDC &vdc)
 

Additional Inherited Members

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

Detailed Description

Defines API for reading, writing, and appending data to a VAPOR Data Collection (Version 3)

Author
John Clyne
Date
July, 2014

This abstract class efines API for reading, writing, and appending data to a VAPOR Data Collection (Version 3). The VDC class is an abstract virtual class, providing a public API, but performing no actual storage operations. Derived implementations of the VDC base class are required to support the API.

In version 3 of the VDC the metadata (.vdf) file found in VDC version 1 and 2 is replaced with a "master" file that describes the contents of the entire VDC. The master file imposes structure on the organization of the files containing data, determining, for example, which data files contain which variables and time steps.

Unlike the .vdf file, it is intended that the master file will be stored in the same scientific data file format as the data themselves (though this depends on the implementation of the derived class). Another important change in version 3 is that both the master file and the accompanying data files are intended to be accessible using the native file format API. I.e. users may operate on files in the VDC using, for example, the NetCDF API, or they may use the API provided by the VDC class object. The latter is only required when reading or writing compressed variables (not all variables in a VDC version 3 must be compressed). Thus if NetCDF is chosen as the underlying format the NetCDF API may be used directly to read and write NetCDF "attributes" and variables (provided the variables are not compressed).

Variables in a VDC may have 1, 2, or 3 spatial dimensions, and 0 or 1 temporal dimensions.

The VDC is structured in the spirit of the "NetCDF Climate and Forecast (CF) Metadata Conventions", version 1.6, 5, December 2011. It supports only a subset of the CF functionality (e.g. there is no support for "Discrete Sampling Geometries"). Moreover, it is more restrictive than the CF in a number of areas. Particular items of note include:

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(). Methods that return a boolean do not, unless otherwise documented, log an error message upon failure (return of false).

Parameters
level

Grid refinement level for multiresolution variables. Compressed variables in the VDC have a multi-resolution representation: the sampling grid for multi-resolution variables is hierarchical, and the dimension lengths of adjacent levels in the hierarchy differ by a factor of two. The level parameter is used to select a particular depth of the hierarchy.

To provide maximum flexibility as well as compatibility with previous versions of the VDC the interpretation of level is somewhat complex. Both positive and negative values may be used to specify the refinement level and have different interpretations.

For positive values of level, a value of 0 indicates the coarsest member of the grid hierarchy. A value of 1 indicates the next grid refinement after the coarsest, and so on. Using postive values the finest level in the hierarchy is given by GetNumRefLevels() - 1. Values of level that are greater than GetNumRefLevels() - 1 are treated as if they were equal to GetNumRefLevels() - 1.

For negative values of level a value of -1 indicates the variable's native grid resolution (the finest resolution available). A value of -2 indicates the next coarsest member in the hierarchy after the finest, and so on. Using negative values the coarsest available level in the hierarchy is given by negating the value returned by GetNumRefLevels(). Values of level that are less than the negation of GetNumRefLevels() are treated as if they were equal to the negation of the GetNumRefLevels() return value.

lod

The level-of-detail parameter, lod, selects the approximation level for a compressed variable. The lod parameter is similar to the level parameter in that it provides control over accuracy of a compressed variable. However, instead of selecting the grid resolution the lod parameter controls the compression factor by indexing into the cratios vector (see below). As with the level parameter, both positive and negative values may be used to index into cratios and different interpretations.

For positive values of lod, a value of 0 indicates the the first element of cratios, a value of 1 indicates the second element, and so on up to the size of the cratios vector (See DC::GetCRatios()).

For negative values of lod a value of -1 indexes the last element of cratios, a value of -2 indexes the second to last element, and so on. Using negative values the first element of cratios - the greatest compression rate - is indexed by negating the size of the cratios vector.

cratiosA monotonically decreasing vector of compression ratios. Compressed variables in the VDC are stored with a fixed, finite number of compression factors. The cratios vector is used to specify the available compression factors (ratios). A compression factor of 1 indicates no compression (1:1). A value of 2 indciates two to one compression (2:1), and so on. The minimum valid value of cratios is 1. The maximum value is determined by a number of factors and can be obtained using the CompressionInfo() method.
wnameName of wavelet used for transforming compressed variables between wavelet and physical space. Valid values are "bior1.1", "bior1.3", "bior1.5", "bior2.2", "bior2.4", "bior2.6", "bior2.8", "bior3.1", "bior3.3", "bior3.5", "bior3.7", "bior3.9", "bior4.4"

Definition at line 165 of file VDC.h.

Member Enumeration Documentation

◆ AccessMode

enum VAPoR::VDC::AccessMode

Read, Write, Append access mode

Enumerator

Definition at line 169 of file VDC.h.

Constructor & Destructor Documentation

◆ VDC()

VAPoR::VDC::VDC ( )

Class constuctor

◆ ~VDC()

virtual VAPoR::VDC::~VDC ( )
inlinevirtual

Definition at line 175 of file VDC.h.

Member Function Documentation

◆ closeVariable()

virtual int VAPoR::VDC::closeVariable ( int  fd)
protectedpure virtual

Close the currently opened variable

Close the handle for variable opened with OpenVariableRead()

Parameters
[in]fdA valid file descriptor returned by OpenVariableRead()
See also
OpenVariableRead()

Implements VAPoR::DC.

Implemented in VAPoR::VDCNetCDF.

◆ CloseVariableWrite()

virtual int VAPoR::VDC::CloseVariableWrite ( int  fd)
pure virtual

Implemented in VAPoR::VDCNetCDF.

◆ CompressionInfo()

virtual bool VAPoR::VDC::CompressionInfo ( vector< size_t >  bs,
string  wname,
size_t &  nlevels,
size_t &  maxcratio 
) const
pure virtual

This 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]bsDimensions of native decomposition block. The rank of bs may be less than or equal to the rank of dims.
[in]wnamewavelet name. Empty string if no compression is to be performed.
[out]nlevelsNumber of levels in hierarchy
[out]maxcratioMaximum compression ratio
Return values
boolIf 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.

◆ CopyAtt() [1/2]

int VAPoR::VDC::CopyAtt ( const DC src,
string  varname 
)

Copy attributes

This method copies attributes from the src DC. The attributes can either be "global", if varname is the empty string, or bound to a variable if varname indentifies a variable in the src DC. All attributes associated with varname are copied.

Parameters
[in]srcThe source DC from which to copy.
[in]varnameThe name of the variable the attribute is bound to, or the empty string if the attribute is global
Return values
statusA negative int is returned on failure. 0 returned on success.
See also
PutAtt()

◆ CopyAtt() [2/2]

int VAPoR::VDC::CopyAtt ( const DC src,
string  varname,
string  attname 
)

Copy an attribute

This method copies an attribute from the src DC. The attribute can either be "global", if varname is the empty string, or bound to a variable if varname indentifies a variable in the src DC.

Parameters
[in]srcThe source DC from which to copy.
[in]varnameThe name of the variable the attribute is bound to, or the empty string if the attribute is global
[in]attnameThe attributes name
Return values
statusA negative int is returned on failure. 0 returned on success.
See also
PutAtt()

◆ CopyVar() [1/2]

virtual int VAPoR::VDC::CopyVar ( DC dc,
size_t  ts,
string  varname,
int  srclod,
int  dstlod 
)
pure virtual

Copy a variable from another data collection to this data collection at a single time step

Implemented in VAPoR::VDCNetCDF.

◆ CopyVar() [2/2]

virtual int VAPoR::VDC::CopyVar ( DC dc,
string  varname,
int  srclod,
int  dstlod 
)
pure virtual

Copy a variable from another data collection to this data collection

This method copies the variable named varname from the data collection specified by dc to this data collection. The variable must have previously been defined in this data collection.

Parameters
[in]dcA reference to a source data collection
[in]varnameName of variable to copy
[in]srclodThe level-of-detail used to open varname in dc.
[in]dstlodThe level-of-detail used to open varname in this data collection.

Implemented in VAPoR::VDCNetCDF.

◆ DefineCoordVar()

int VAPoR::VDC::DefineCoordVar ( string  varname,
std::vector< string >  dimnames,
string  time_dim_name,
string  units,
int  axis,
XType  type,
bool  compressed 
)

Define a coordinate variable

This method provides the definition for a coordinate variable: a variable providing spatial or temporal coordinates for a subsequently defined data variable.

If the variable's name, varname, matches a dimension defined with DefineDimension(), only the units and external data type may differ from the 1D coordinate variable impliclity defined by DefineDimension()

Parameters
[in]varnameThe name of the coordinate variable.
[in]dimnamesAn ordered vector specifying the variable's spatial dimension names. The dimension names must have previously been defined with the DefineDimension() method.
[in]time_dim_nameThe name of the time varying dimension, if any.
[in]unitsThis parameter specifies a string describing the units of measure for the variable. The string is compatible with the Unidata udunits2 conversion package. If the quantity is unitless an empty string may be specified.
[in]axisAn integer indicating the spatial or temporal coordinate axis. Acceptable values are 0 (for X or longitude), 1 (for Y or latitude), 2 (for Z or vertical), and 3 (for time).
[in]typeThe primitive data type storage format. Currently supported values are FLOAT. This is the type that will be used to store the variable on disk
[in]compressedA boolean indicating whether the coordinate variable is to be wavelet transformed.

It is an error to call this method if the VDC master is not currently in define mode.

Note
Temporal coordinate variables (axis=3) must have exactly one dimension.
When in append (A) mode it is an error to redefine an existing variable.
Return values
statusA negative int is returned on error
See also
DefineDimension(), DefineCoordVar(), SetCompressionBlock()

◆ DefineCoordVarUniform()

int VAPoR::VDC::DefineCoordVarUniform ( string  varname,
std::vector< string >  dimname,
string  time_dim_name,
string  units,
int  axis,
XType  type,
bool  compressed 
)

Define a coordinate variable with uniform sampling

This method provides the definition for a uniform coordinate variable. A uniformly sampled coordinate variable is a variable for which the coordinates along the fastest varying axis may be given by i * dx , where i is an index starting from zero, and dx is a real number representing the spacing between points.

One-dimensional coordinate variables that have uniform sampling should be declared as such using this method rather than the more general DefineCoordVar().

Parameters
[in]varnameThe name of the coordinate variable.
[in]dimnamesAn ordered vector specifying the variable's spatial dimension names. The dimension names must have previously been defined with the DefineDimension() method.
[in]time_dim_nameThe name of the time varying dimension, if any.
[in]unitsThis parameter specifies a string describing the units of measure for the variable. The string is compatible with the udunits2 conversion package. If the quantity is unitless an empty string may be specified.
[in]axisAn integer indicating the spatial or temporal coordinate axis. Acceptable values are 0 (for X or longitude), 1 (for Y or latitude), 2 (for Z or vertical), and 3 (for time).
[in]typeThe primitive data type storage format. Currently supported values are FLOAT
[in]compressedA boolean indicating whether the coordinate variable is to be wavelet transformed.

It is an error to call this method if the VDC master is not currently in define mode.

Note
When in append (A) mode it is an error to redefine an existing variable.
Return values
statusA negative int is returned on error
See also
DefineDimension(), DefineCoordVar(), SetCompressionBlock()

◆ DefineDataVar() [1/2]

int VAPoR::VDC::DefineDataVar ( string  varname,
std::vector< string >  dimnames,
std::vector< string >  coordvars,
string  units,
XType  type,
bool  compressed 
)

Define a data variable

This method defines a data variable in the VDC master file

Parameters
[in]varnameThe name of the data variable.
[in]dimnamesAn ordered vector specifying the variables dimension names. The dimension names must have previously be defined with the DefineDimension() method.
[in]coordvarsAn ordered vector specifying the coordinate variable names providing the coordinates for this variable. The coordinate variables must have previously been defined with the DefineCoordVar() method. Moreover, the dimension names of each coordinate variable must be a subset of those in dimnames.
[in]unitsThis parameter specifies a string describing the units of measure for the variable. The string is compatible with the udunits2 conversion package. If the quantity is unitless an empty string may be specified.
[in]typeThe primitive data type storage format. Currently supported values are FLOAT
[in]compressedA boolean indicating whether the coordinate variable is to be wavelet transformed.

It is an error to call this method if the VDC master is not currently in define mode.

Note
When in append (A) mode it is an error to redefine an existing variable.
See also
DefineDimension(), DefineCoordVar(), SetCompressionBlock()

◆ DefineDataVar() [2/2]

int VAPoR::VDC::DefineDataVar ( string  varname,
std::vector< string >  dimnames,
std::vector< string >  coordvars,
string  units,
XType  type,
double  missing_value,
string  maskvar 
)

Define a compressed or non-compressed data variable with missing data

Parameters
[in]missing_valueSpecifies a value that should be used for masked grid locations after a variable is reconstructed.
[in]maskvarSpecifies the name of a variable whose contents indicate the presense or absense of invalid entries in the data variable. The contents of the mask array are treated as booleans, true values indicating valid data. The rank of of the variable may be less than or equal to that of varname. The dimensions of maskvar must match the fastest varying dimensions of varname. The maskvar variable must have been previously defined with DefineDataVar(). If maskvar is empty, the variable will not be compressed.
See also
DefineDimension(), DefineCoordVar(), SetCompressionBlock()

◆ DefineDimension() [1/2]

int VAPoR::VDC::DefineDimension ( string  dimname,
size_t  length 
)

Define a dimension in the VDC

This method specifies the name, and length of a dimension. A variable in the VDC may have one to four dimensions (one to three spatial, and zero or one temporal). Dimensions may be of any length greater than or equal to one.

This method must be called prior to defining any variables requring the defined dimensions.

There are no default dimensions defined.

It is an error to call this method if the VDC master is not currently in define mode.

Parameters
[in]dimnameA string specifying the name of the dimension.
[in]lengthThe dimension length, which must be greater than zero.
Note
When the VDC master file is initialized in append (mode = A) mode it is an error to redefine an existing dimension. New dimensions may, however, be defined.
Return values
statusA negative int is returned on error
See also
DefineCoordVar(), DefineDataVar(), GetDimension()

◆ DefineDimension() [2/2]

int VAPoR::VDC::DefineDimension ( string  dimname,
size_t  length,
int  axis 
)

Define a dimension in the VDC and an associated coordinate variable

This method defines a dimension and a 1D, unitless coordinate variable with the same name.

It is an error to call this method if the VDC master is not currently in define mode.

Parameters
[in]nameA string specifying the name of the dimension, and the coordinate variable.
[in]lengthThe dimension length, which must be greater than zero.
[in]axisAn integer indicating the spatial or temporal coordinate axis. Acceptable values are 0 (for X or longitude), 1 (for Y or latitude), 2 (for Z or vertical), and 3 (for time).
Return values
statusA negative int is returned on error
See also
DefineCoordVar(), DefineDataVar(), GetDimension()

◆ EndDefine()

int VAPoR::VDC::EndDefine ( )

When the open mode mode is A or W this method signals the class object that metadata defintions have been completed and it commits them to the master VDC file. This method also prepares the VDC for the reading or writing of variable or coordinate data.

Ignored if mode is R.

Return values
statusA negative it is returned if the master file is not successfully written for any reason
Note
The master file should not be accessed with the native file format API (e.g. NetCDF) if the VDC is in define mode (e.g. until after EndDefine() is called).
See also
VDC()

◆ getAtt() [1/3]

bool VAPoR::VDC::getAtt ( string  varname,
string  attname,
string &  values 
) const
protectedvirtual

Implements VAPoR::DC.

◆ getAtt() [2/3]

bool VAPoR::VDC::getAtt ( string  varname,
string  attname,
vector< double > &  values 
) const
protectedvirtual

Implements VAPoR::DC.

◆ getAtt() [3/3]

bool VAPoR::VDC::getAtt ( string  varname,
string  attname,
vector< long > &  values 
) const
protectedvirtual

Implements VAPoR::DC.

◆ getAttNames()

std::vector< string > VAPoR::VDC::getAttNames ( string  varname) const
protectedvirtual

Return a list of available attribute's names

Returns a vector of all attribute names for the variable, varname. If varname is the empty string the names of all of the global attributes are returned. If varname is not defined an empty vector is returned.

Parameters
[in]varnameThe name of the variable to query, or the empty string if the names of global attributes are desired.
Return values
attnamesA vector of returned attribute names
See also
GetAtt()

Implements VAPoR::DC.

◆ getAttType()

XType VAPoR::VDC::getAttType ( string  varname,
string  attname 
) const
protectedvirtual

Return the external data type for an attribute

Returns the external storage type of the named variable attribute.

Parameters
[in]varnameThe name of the variable to query, or the empty string if the names of global attributes are desired.
[in]nameName of the attribute.
Return values
Ifan attribute named by name does not exist, a negative value is returned.

Implements VAPoR::DC.

◆ getAuxVarInfo()

bool VAPoR::VDC::getAuxVarInfo ( string  varname,
DC::AuxVar var 
) const
inlineprotectedvirtual

Return metadata about an auxiliary variable

If the variable varname is defined as an auxiliary variable its metadata will be returned in var.

Return values
boolIf the named variable cannot be found false is returned and the values of var are undefined.
See also
GetDataVarInfo(), GetCoordVarInfo()

Implements VAPoR::DC.

Definition at line 388 of file VDC.h.

◆ getAuxVarNames()

virtual std::vector< string > VAPoR::VDC::getAuxVarNames ( ) const
inlineprotectedvirtual

Return a list of names for all of the defined Auxiliary variables.

Returns a list of names for all Auxiliary variables defined

See also
DC::AuxVar

Implements VAPoR::DC.

Definition at line 396 of file VDC.h.

◆ getBaseVarInfo()

bool VAPoR::VDC::getBaseVarInfo ( string  varname,
DC::BaseVar var 
) const
protectedvirtual

Return metadata about a data or coordinate variable

If the variable varname is defined as either a data or coordinate variable its metadata will be returned in var.

Return values
boolIf the named variable cannot be found false is returned and the values of var are undefined.
See also
GetDataVarInfo(), GetCoordVarInfo()

Implements VAPoR::DC.

◆ getBlockSize()

virtual vector< size_t > VAPoR::VDC::getBlockSize ( ) const
inlineprotectedvirtual

Reimplemented from VAPoR::DC.

Definition at line 412 of file VDC.h.

◆ GetCompressionBlock()

void VAPoR::VDC::GetCompressionBlock ( std::vector< size_t > &  bs,
string &  wname,
std::vector< size_t > &  cratios 
) const

Retrieve current compression block settings.

Parameters
[out]bsAn ordered vector containing the current compression block dimensions.
[out]wnameThe wavelet family name.
[out]cratiosA vector of compression of integer compression factors.
See also
SetCompressionBlock()

◆ getCoordVarInfo()

bool VAPoR::VDC::getCoordVarInfo ( string  varname,
DC::CoordVar cvar 
) const
protectedvirtual

Return a coordinate variable's definition

Return a reference to a DC::CoordVar object describing the coordinate variable named by varname

Parameters
[in]varnameA string specifying the name of the coordinate variable.
[out]coordvarA CoordVar object containing the definition of the named variable.
Return values
boolFalse is returned if the named coordinate variable does not exist, and the contents of cvar will be undefined.

Implements VAPoR::DC.

◆ getCoordVarNames()

virtual std::vector< string > VAPoR::VDC::getCoordVarNames ( ) const
protectedvirtual

Return a list of names for all of the defined coordinate variables.

Returns a list of names for all coordinate variables defined

See also
DC::CoordVar

Implements VAPoR::DC.

◆ getDataVarInfo()

bool VAPoR::VDC::getDataVarInfo ( string  varname,
DC::DataVar datavar 
) const
protectedvirtual

Return a data variable's definition

Return a reference to a DC::DataVar object describing the data variable named by varname

Parameters
[in]varnameA string specifying the name of the variable.
[out]datavarA DataVar object containing the definition of the named Data variable.
Return values
boolIf the named data variable cannot be found false is returned and the values of datavar are undefined.

Implements VAPoR::DC.

◆ getDataVarNames()

virtual std::vector< string > VAPoR::VDC::getDataVarNames ( ) const
protectedvirtual

Return a list of names for all of the defined data variables.

Returns a list of names for all data variables defined

See also
DC::DataVar

Implements VAPoR::DC.

◆ getDimension()

bool VAPoR::VDC::getDimension ( string  dimname,
DC::Dimension dimension 
) const
protectedvirtual

Implements VAPoR::DC.

◆ getDimensionNames()

std::vector< string > VAPoR::VDC::getDimensionNames ( ) const
protectedvirtual

Implements VAPoR::DC.

◆ getDimLensAtLevel()

virtual int VAPoR::VDC::getDimLensAtLevel ( string  varname,
int  level,
std::vector< size_t > &  dims_at_level,
std::vector< size_t > &  bs_at_level 
) const
protectedpure virtual

Return a variable's array dimension lengths at a specified refinement level

Compressed variables may have a multi-resolution grid representation. This method returns the variable's ordered array dimension lengths, and block dimensions at the multiresolution refinement level specified by level.

If the variable named by varname is not compressed the variable's native dimensions are returned.

Note
The number of elements in dims_at_level will match that of bs_at_level. If the data are not blocked the value of each element of bs_at_level will be 1.
Parameters
[in]varnameData or coordinate variable name.
[in]levelSpecifies a member of a multi-resolution variable's grid hierarchy as described above.
[out]dims_at_levelAn ordered vector containing the variable's dimensions at the specified refinement level
[out]bs_at_levelAn ordered vector containing the variable's block dimensions at the specified refinement level
Return values
statusZero is returned upon success, otherwise -1.
Note
For unstructured grids the number of dimensions may be less than the topological dimension returned by DC::Mesh::GetTopologyDim().
See also
VAPoR::DC, DC::DataVar::GetBS(), DC::GetVarDimLens()

Implements VAPoR::DC.

◆ getMapProjection() [1/2]

virtual string VAPoR::VDC::getMapProjection ( ) const
protectedvirtual

Return default Proj4 map projection string.

For georeference data sets that have map projections this method returns the default properly formatted Proj4 projection string for mapping from geographic to cartographic coordinates. If no projection exists, an empty string is returned.

Return values
projstringAn empty string if a Proj4 map projection is not available for the named variable, otherwise a properly formatted Proj4 projection string is returned.

Implements VAPoR::DC.

◆ getMapProjection() [2/2]

virtual string VAPoR::VDC::getMapProjection ( string  varname) const
protectedvirtual

◆ getMapProjectionDefault()

virtual string VAPoR::VDC::getMapProjectionDefault ( ) const
inlineprotectedvirtual

Definition at line 420 of file VDC.h.

◆ getMesh()

virtual bool VAPoR::VDC::getMesh ( string  mesh_name,
DC::Mesh mesh 
) const
protectedvirtual

Return a Mesh's definition

This method returns the definition of the mesh named by mesh_name as a reference to a DC::Mesh object.

Parameters
[in]mesh_nameA string specifying the name of the Mesh.
[out]meshThe returned Mesh object reference
Return values
boolIf the named mesh can not be found false is returned.

Implements VAPoR::DC.

◆ getMeshNames()

std::vector< string > VAPoR::VDC::getMeshNames ( ) const
protectedvirtual

Implements VAPoR::DC.

◆ getNumRefLevels()

size_t VAPoR::VDC::getNumRefLevels ( string  varname) const
protectedvirtual

Implements VAPoR::DC.

◆ GetPath()

virtual int VAPoR::VDC::GetPath ( string  varname,
size_t  ts,
string &  path,
size_t &  file_ts,
size_t &  max_ts 
) const
pure virtual

Return the path name and temporal offset for a variable

Data and coordinate variables in a VDC are in general distributed into multiple files. For example, for large variables only a single time step may be stored per file. This method returns the file path name, path, of the file containing varname at time step ts. Also returned is the integer time offset of the variable within path.

Parameters
[in]varnameData or coordinate variable name.
[in]tsInteger offset relative to a variable's temporal dimension
[out]pathPath to file containing variable varname at time step ts.
[out]file_tsTemporal offset of variable varname in file path.
[out]max_tsMaximum number of time steps stored in path
Return values
statusA negative int is returned if varname or ts are invalid, or if the class object is in define mode.

Implemented in VAPoR::VDCNetCDF.

◆ GetPeriodicBoundary()

std::vector< bool > VAPoR::VDC::GetPeriodicBoundary ( ) const
inline

Retrieve current boundary periodic settings

See also
SetPeriodicBoundary()

Definition at line 310 of file VDC.h.

◆ initialize() [1/2]

virtual int VAPoR::VDC::initialize ( const std::vector< string > &  paths,
const std::vector< string > &  options 
)
inlineprotectedvirtual

Initialize the DC class

Prepare a DC for reading. This method prepares the master DC file indicated by path for reading. The method should be called immediately after the constructor, before any other class methods. This method exists only because C++ constructors can not return error codes.

Parameters
[in]pathPath name of file that contains, or will contain, the DC master file for this data collection
[in]optionsA vector of option pairs (name, value) that may be accepted by the derived class.
Return values
statusA negative int is returned on failure

Implements VAPoR::DC.

Definition at line 230 of file VDC.h.

References initialize().

Referenced by initialize().

◆ initialize() [2/2]

virtual int VAPoR::VDC::initialize ( const std::vector< string > &  paths,
const std::vector< string > &  options,
AccessMode  mode,
vector< size_t >  bs 
)
protectedvirtual

Initialize the VDC class

Prepare a VDC for reading or writing/appending. This method prepares the master VDC file indicated by path for reading or writing. The method should be called immediately after the constructor, before any other class methods. This method exists only because C++ constructors can not return error codes.

Parameters
[in]pathA single element vector that specifies the name of file that contains, or will contain, the VDC master file for this data collection
[in]modeOne of R, W, or A, indicating whether path will be opened for reading, writing, or appending, respectively. When mode is A underlying NetCDF files will be opened opened with nc_open(path, NC_WRITE)). When mode is W NetCDF files will be created (opened with nc_create(path)). When mode is A additional time steps may be added to an existing file.

bs is a three-element array, with the first element specifying the length of the fastest varying spatial dimension (e.g. X) of the storage block, the second element specifies the length of the next fastest varying dimension, etc. If a variable definition defines a variable with n spatial , where n is less than three, only the first n elements of bs will be used. For example, if the rank of bs is greater than two a 2D variable will be stored in blocks having dimensions bs[0] x bs[1]. Time dimensions are never blocked. This parameter is ignored unless mode is W.

Note
The parameter mode controls the access to the master file indicated by path and the variable data files in a somewhat unintuitive manner. If mode is R or A the master file path must already exist. If mode is A or W the contents of the VDC master may be changed (written) and the VDC is put into define mode until EndDefine() is called. While in define mode metadata that will be contained in the VDC master file may be changed, but coordinate and data variables may not be accessed (read or written). Similarly, when not in define mode coordinate and data variables may be accessed (read or written), but metadata in the VDC master may not be changed. See OpenVariableRead() and OpenVariableWrite() for discussion on how mode effects reading and writing of coordinate and data variables.
Return values
statusA negative int is returned on failure
See also
EndDefine();

◆ openVariableRead()

virtual int VAPoR::VDC::openVariableRead ( size_t  ts,
string  varname,
int  level = 0,
int  lod = 0 
)
protectedpure virtual

Open the named variable for reading

This method prepares a data or coordinate variable, indicated by a variable name and time step pair, for subsequent read operations by methods of this class. The value of the refinement levels parameter, level, indicates the resolution of the volume in the multiresolution hierarchy as described by GetDimLensAtLevel().

The level-of-detail parameter, lod, selects the approximation level. Valid values for lod are integers in the range 0..n-1, where n is returned by DC::BaseVar::GetCRatios().size(), or the value -1 may be used to select the best approximation available.

An error occurs, indicated by a negative return value, if the volume identified by the {varname, timestep, level, lod} tupple is not available. Note the availability of a volume can be tested with the VariableExists() method.

Parameters
[in]tsTime step of the variable to read. This is the integer offset into the variable's temporal dimension. If the variable does not have a temporal dimension ts is ignored.
[in]varnameName of the variable to read
[in]levelRefinement level of the variable. Ignored if the variable is not compressed.
[in]lodApproximation level of the variable. A value of -1 indicates the maximum approximation level defined for the DC. Ignored if the variable is not compressed.
Return values
statusReturns a non-negative file descriptor on success
See also
GetNumRefLevels(), DC::BaseVar::GetCRatios(), OpenVariableRead()

Implements VAPoR::DC.

Implemented in VAPoR::VDCNetCDF.

◆ OpenVariableWrite()

virtual int VAPoR::VDC::OpenVariableWrite ( size_t  ts,
string  varname,
int  lod = -1 
)
pure virtual

Open the named variable for writing

This method prepares a data or coordinate variable, indicated by a variable name and time step pair, for subsequent write operations by methods of this class.

The behavior of this method is impacted somewhat by the setting of the Initialize() mode parameter. Coordinate or data variable files may be written regardless of the mode setting. However, if mode is W the first time a coordinate or data file is written it will be created (opened with nc_create(path), for example) regareless of whether the file previously existed. If mode is A or R existing coordinate or data files will be opened for appending (e.g. opened with nc_open(path, NC_WRITE)). New files will be created (opened with nc_create(path)).

An error occurs, indicated by a negative return value, if the varible identified by the {varname, timestep, lod} tupple is not defined.

Parameters
[in]tsTime step of the variable to read. This is the integer offset into the variable's temporal dimension. If the variable does not have a temporal dimension ts is ignored.
[in]varnameName of the variable to read
[in]lodApproximation level of the variable. A value of -1 indicates the maximum approximation level defined for the VDC. Ignored if the variable is not compressed.
Return values
statusReturns a non-negative value on success
See also
GetNumRefLevels(), DC::BaseVar::GetCRatios(), OpenVariableRead()

Implemented in VAPoR::VDCNetCDF.

◆ PutAtt() [1/3]

int VAPoR::VDC::PutAtt ( string  varname,
string  attname,
XType  type,
const string &  values 
)

◆ PutAtt() [2/3]

int VAPoR::VDC::PutAtt ( string  varname,
string  attname,
XType  type,
const vector< double > &  values 
)

Write an attribute

This method write an attribute to the VDC. The attribute can either be "global", if varname is the empty string, or bound to a variable if varname indentifies a variable in the VDC.

Parameters
[in]varnameThe name of a variable already defined in the VDC, or the empty string if the attribute is to be global
[in]attnameThe attributes name
[in]typeThe primitive data type storage format. This is the type that will be used to store the attribute on disk
[in]valuesA vector of floating point attribute values
Return values
statusA negative int is returned on failure
See also
GetAtt()

◆ PutAtt() [3/3]

int VAPoR::VDC::PutAtt ( string  varname,
string  attname,
XType  type,
const vector< long > &  values 
)

◆ PutVar() [1/4]

virtual int VAPoR::VDC::PutVar ( size_t  ts,
string  varname,
int  lod,
const float *  data 
)
pure virtual

Write a variable at single time step

This method writes a variable hyperslab consisting of the variable's entire spatial dimensions at the time step indicated by ts. Any variables currently opened with OpenVariableWrite() are first closed. Thus variables need not be opened with OpenVariableWrite() prior to calling PutVar();

It is an error to call this method in define mode

Parameters
[in]tsTime step of the variable to write. This is the integer offset into the variable's temporal dimension. If the variable does not have a temporal dimension ts is ignored.
[in]varnameName of the variable to write
[in]lodApproximation level of the variable. A value of -1 indicates the maximum approximation level defined for the VDC. Ignored if the variable is not compressed.
[in]dataPointer from where the data will be copied
Return values
statusA negative int is returned on failure
See also
GetVar()

Implemented in VAPoR::VDCNetCDF.

◆ PutVar() [2/4]

virtual int VAPoR::VDC::PutVar ( size_t  ts,
string  varname,
int  lod,
const int *  data 
)
pure virtual

Implemented in VAPoR::VDCNetCDF.

◆ PutVar() [3/4]

virtual int VAPoR::VDC::PutVar ( string  varname,
int  lod,
const float *  data 
)
pure virtual

Write an entire variable in one call

This method writes and entire variable (all time steps, all grid points) into a VDC. This is the simplest interface for writing data into a VDC. If the variable is split across multiple files PutVar() ensures that the data are correctly distributed. Any variables currently opened with OpenVariableWrite() are first closed. Thus variables need not be opened with OpenVariableWrite() prior to calling PutVar();

It is an error to call this method in define mode

Parameters
[in]varnameName of the variable to write
[in]lodApproximation level of the variable. A value of -1 indicates the maximum approximation level defined for the VDC. Ignored if the variable is not compressed.
[in]dataPointer from where the data will be copied
Return values
statusA negative int is returned on failure
See also
GetVar()

Implemented in VAPoR::VDCNetCDF.

◆ PutVar() [4/4]

virtual int VAPoR::VDC::PutVar ( string  varname,
int  lod,
const int *  data 
)
pure virtual

Implemented in VAPoR::VDCNetCDF.

◆ readRegion() [1/2]

virtual int VAPoR::VDC::readRegion ( int  fd,
const vector< size_t > &  min,
const vector< size_t > &  max,
double *  region 
)
protectedpure virtual

Implements VAPoR::DC.

◆ readRegion() [2/2]

virtual int VAPoR::VDC::readRegion ( int  fd,
const vector< size_t > &  min,
const vector< size_t > &  max,
float *  region 
)
protectedpure virtual

Read in and return a subregion from the currently opened variable

This method reads and returns a subset of variable data. The min and max vectors, whose dimensions must match the spatial rank of the currently opened variable, identify the minimum and maximum extents, in grid coordinates, of the subregion of interest. The minimum and maximum valid values of an element of min or max are 0 and n-1, respectively, where n is the length of the associated dimension at the opened refinement level.

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

Parameters
[in]fdA valid file descriptor returned by OpenVariableRead()
[in]minMinimum region extents in grid coordinates
[in]maxMaximum region extents in grid coordinates
[out]regionThe requested volume subregion
Return values
statusReturns a non-negative value on success
See also
OpenVariableRead(), GetDimLensAtLevel(), GetDimensionNames()

Implements VAPoR::DC.

◆ SetCompressionBlock()

int VAPoR::VDC::SetCompressionBlock ( string  wname,
std::vector< size_t >  cratios 
)

Sets various parameters for storage blocks for subsequent variable definitions

This method sets the storage parameters for subsequent variable definitions for compressed variables.

Variables whose spatial dimension lengths are less than the coresponding dimension of bs will be padded to block boundaries.

wname set the wavelet family name and boundary handling mode for subsequent compressed variable definitions. Wider wavelets (those requiring more filter coefficients) will typically yield higher compression rates, but are more computationally expensive and will limit the depth of of the grid resolution refinement hierarchy.

Recommended values for wname are bior1.1, bior1.3, bior1.5 bior3.3, bior3.5, bior3.7, bior3.9, bior2.2, bior2.6, bior2.6, and bior2.8. For odd length filters (e.g. bior1.3)

Finally, cratios specifies a vector of compression factors for subsequent compressed variable definitions.

Note
For compressed variables compression is applied to individual blocks. Larger blocks permit deeper grid refinement hierarchies, but may result in poor cache performance and slowed disk storage access
The wavelet and compression ratio parameters are ignored by variable definitions for variables that are not compressed.
Parameters
[in]wnameA wavelet family name. The default value is "bior4.4".
[in]cratiosA vector of compression of integer compression factors. The default compression ratio vector is: (1, 10, 100, 500)
Return values
statusA negative int is returned if an invalid parameter or parameter combination is specified.
See also
DefineDataVar(), DefineCoordVar(), VDC()

◆ SetMapProjection() [1/2]

virtual int VAPoR::VDC::SetMapProjection ( string  projstring)
virtual

Set the default Proj4 map projection for georeferenced variables

This method sets the default Proj4 map projection string to be used for georeferenced variables. The string set by projstring is returned by VDC::GetMapProjection()

◆ SetMapProjection() [2/2]

virtual int VAPoR::VDC::SetMapProjection ( string  varname,
string  projstring 
)
virtual

Set a map projection string for a data variable

This method sets a properly formatted Proj4 map projection string for the data variable indicated by varname

See also
GetMapProjection()

◆ SetPeriodicBoundary()

void VAPoR::VDC::SetPeriodicBoundary ( std::vector< bool >  periodic)
inline

Set the boundary periodic for subsequent variable definitions

This method specifies an ordered, three-element boolean vector indicating the boundary periodicty for a variable's spatial dimensions. The ordering is from fastest to slowest varying dimension.

Parameters
[in]periodicA three-element array of booleans. The default value of periodic is (false, false, false).
Return values
statusA negative int is returned on error

Definition at line 300 of file VDC.h.

◆ variableExists()

virtual bool VAPoR::VDC::variableExists ( size_t  ts,
string  varname,
int  reflevel = 0,
int  lod = 0 
) const
pure virtual

Returns true if indicated data volume is available

Returns true if the variable identified by the timestep, variable name, refinement level, and level-of-detail is present in the data set. Returns false if the variable is not available.

Parameters
[in]tsA valid time step between 0 and GetNumTimesteps()-1
[in]varnameA valid variable name
[in]reflevelRefinement level requested.
[in]lodCompression level of detail requested. refinement level contained in the VDC.

Implements VAPoR::DC.

Implemented in VAPoR::VDCNetCDF.

◆ Write() [1/2]

virtual int VAPoR::VDC::Write ( int  fd,
const float *  data 
)
pure virtual

Write all spatial values to the currently opened variable

This method writes, and compresses as necessary, the contents of the array contained in data to the currently opened variable. The number of values written from data is given by the product of the spatial dimensions of the open variable.

Parameters
[in]dataAn array of data to be written
Return values
statusReturns a non-negative value on success
See also
OpenVariableWrite()

Implemented in VAPoR::VDCNetCDF.

◆ Write() [2/2]

virtual int VAPoR::VDC::Write ( int  fd,
const int *  data 
)
pure virtual

Implemented in VAPoR::VDCNetCDF.

◆ WriteSlice() [1/3]

virtual int VAPoR::VDC::WriteSlice ( int  fd,
const float *  slice 
)
pure virtual

Write a single slice of data to the currently opened variable

Compress, and necessary, and write a single slice (2D array) of data to the variable indicated by the most recent call to OpenVariableWrite(). The dimensions of a slices are NX by NY, where NX is the dimension of the array along the fastest varying spatial dimension, specified in grid points, and NY is the length of the second fastest varying dimension at the currently opened refinement level. See OpenVariableWrite().

This method should be called exactly NZ times for each opened variable, where NZ is the dimension of third, and slowest varying dimension. In the case of a 2D variable, NZ is 1.

Parameters
[in]sliceA 2D slice of data
Return values
statusReturns a non-negative value on success
See also
OpenVariableWrite()

Implemented in VAPoR::VDCNetCDF.

◆ WriteSlice() [2/3]

virtual int VAPoR::VDC::WriteSlice ( int  fd,
const int *  slice 
)
pure virtual

Implemented in VAPoR::VDCNetCDF.

◆ WriteSlice() [3/3]

virtual int VAPoR::VDC::WriteSlice ( int  fd,
const unsigned char *  slice 
)
pure virtual

Implemented in VAPoR::VDCNetCDF.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  o,
const VDC vdc 
)
friend

Member Data Documentation

◆ _atts

std::map<string, Attribute> VAPoR::VDC::_atts
protected

Definition at line 901 of file VDC.h.

◆ _bs

std::vector<size_t> VAPoR::VDC::_bs
protected

Definition at line 894 of file VDC.h.

◆ _coordVars

std::map<string, CoordVar> VAPoR::VDC::_coordVars
protected

Definition at line 902 of file VDC.h.

◆ _cratios

std::vector<size_t> VAPoR::VDC::_cratios
protected

Definition at line 896 of file VDC.h.

◆ _dataVars

std::map<string, DataVar> VAPoR::VDC::_dataVars
protected

Definition at line 903 of file VDC.h.

◆ _defineMode

bool VAPoR::VDC::_defineMode
protected

Definition at line 893 of file VDC.h.

◆ _dimsMap

std::map<string, Dimension> VAPoR::VDC::_dimsMap
protected

Definition at line 900 of file VDC.h.

◆ _master_path

string VAPoR::VDC::_master_path
protected

Definition at line 891 of file VDC.h.

◆ _meshes

std::map<string, Mesh> VAPoR::VDC::_meshes
protected

Definition at line 904 of file VDC.h.

◆ _mode

AccessMode VAPoR::VDC::_mode
protected

Definition at line 892 of file VDC.h.

◆ _periodic

vector<bool> VAPoR::VDC::_periodic
protected

Definition at line 897 of file VDC.h.

◆ _udunits

VAPoR::UDUnits VAPoR::VDC::_udunits
protected

Definition at line 898 of file VDC.h.

◆ _wname

string VAPoR::VDC::_wname
protected

Definition at line 895 of file VDC.h.


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