VAPOR3 3.9.4
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
VAPoR::VDCNetCDF Class Reference

Implements the VDC abstract class, providing storage of VDC data in NetCDF files. More...

#include <VDCNetCDF.h>

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

Public Member Functions

 VDCNetCDF (int numthreads=0, size_t master_theshold=10 *1024 *1024, size_t variable_threshold=100 *1024 *1024)
 
virtual ~VDCNetCDF ()
 
virtual int GetHyperSliceInfo (string varname, int level, std::vector< size_t > &dims, size_t &nslice)
 
virtual int GetPath (string varname, size_t ts, string &path, size_t &file_ts, size_t &max_ts) const
 
virtual int getDimLensAtLevel (string varname, int level, std::vector< size_t > &dims_at_level, vector< size_t > &bs_at_level) const
 
virtual int Initialize (const vector< string > &paths, const vector< string > &options={}, AccessMode mode=VDC::R, vector< size_t > bs={64, 64, 64}, size_t chunksizehint=0)
 
virtual int Initialize (string path, const vector< string > &options, AccessMode mode, vector< size_t > bs={64, 64, 64}, size_t chunksizehint=0)
 
size_t GetMasterThreshold () const
 
size_t GetVariableThreshold () const
 
int OpenVariableWrite (size_t ts, string varname, int lod=-1)
 
int CloseVariableWrite (int fd)
 
int Write (int fd, const float *region)
 
int Write (int fd, const int *region)
 
int WriteSlice (int fd, const float *slice)
 
int WriteSlice (int fd, const int *slice)
 
int WriteSlice (int fd, const unsigned char *slice)
 
int PutVar (string varname, int lod, const float *data)
 
int PutVar (string varname, int lod, const int *data)
 
int PutVar (size_t ts, string varname, int lod, const float *data)
 
int PutVar (size_t ts, string varname, int lod, const int *data)
 
int CopyVar (DC &dc, string varname, int srclod, int dstlod)
 
int CopyVar (DC &dc, size_t ts, string varname, int srclod, int dstlod)
 
bool CompressionInfo (std::vector< size_t > bs, string wname, size_t &nlevels, size_t &maxcratio) const
 
int SetFill (int fillmode)
 
- Public Member Functions inherited from VAPoR::VDC
 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
 

Static Public Member Functions

static string GetDataDir (string path)
 
static bool DataDirExists (string path)
 
- 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 ()
 

Protected Member Functions

int openVariableRead (size_t ts, string varname, int level=0, int lod=-1)
 
int closeVariable (int fd)
 
int readRegion (int fd, const std::vector< size_t > &min, const std::vector< size_t > &max, float *region)
 
int readRegion (int fd, const std::vector< size_t > &min, const std::vector< size_t > &max, double *region)
 
int readRegion (int fd, const std::vector< size_t > &min, const std::vector< size_t > &max, int *region)
 
virtual bool variableExists (size_t ts, string varname, int reflevel=0, int lod=0) const
 
- Protected Member Functions inherited from VAPoR::VDC
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)
 

Additional Inherited Members

- Public Types inherited from VAPoR::VDC
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)
 
- 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 Attributes inherited from VAPoR::VDC
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
 

Detailed Description

Implements the VDC abstract class, providing storage of VDC data in NetCDF files.

Author
John Clyne
Date
July, 2014

Implements the VDC abstract class, providing storage of VDC data in NetCDF files. Data (variables) are stored in multiple NetCDF files. The distribution of variables to files is described by GetPath().

Definition at line 27 of file VDCNetCDF.h.

Constructor & Destructor Documentation

◆ VDCNetCDF()

VAPoR::VDCNetCDF::VDCNetCDF ( int  numthreads = 0,
size_t  master_theshold = 10 *1024 *1024,
size_t  variable_threshold = 100 *1024 *1024 
)

Class constructor

Parameters
[in]numthreadsNumber 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.
[in]master_thesholdVariables that are either compressed, or whose total number of elements are larger than master_theshold, will not be stored in the master file. Ignored if the file is open for appending or reading.
[in]variable_thresholdVariables not stored in the master file and whose total number of elements are larger than variable_threshold will be stored with one time step per file. Ignored if the file is open for appending or reading.

◆ ~VDCNetCDF()

virtual VAPoR::VDCNetCDF::~VDCNetCDF ( )
virtual

Member Function Documentation

◆ closeVariable()

int VAPoR::VDCNetCDF::closeVariable ( int  fd)
protectedvirtual

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::VDC.

◆ CloseVariableWrite()

int VAPoR::VDCNetCDF::CloseVariableWrite ( int  fd)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 134 of file VDCNetCDF.h.

◆ CompressionInfo()

bool VAPoR::VDCNetCDF::CompressionInfo ( std::vector< size_t >  bs,
string  wname,
size_t &  nlevels,
size_t &  maxcratio 
) const

◆ CopyVar() [1/2]

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

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

Implements VAPoR::VDC.

◆ CopyVar() [2/2]

int VAPoR::VDCNetCDF::CopyVar ( DC dc,
string  varname,
int  srclod,
int  dstlod 
)
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.

Implements VAPoR::VDC.

◆ DataDirExists()

static bool VAPoR::VDCNetCDF::DataDirExists ( string  path)
static

Return true if a data directory exists for the master file named by path

Parameters
[in]pathPath to VDC master file
See also
Initialize(), GetPath(), GetDataDir();

◆ GetDataDir()

static string VAPoR::VDCNetCDF::GetDataDir ( string  path)
static

Return path to the data directory

Return the file path to the data directory associated with the master file named by path. Data files, those NetCDF files containing coordinate and data variables, are stored in separate files from the VDC master file (See VDC::Initialize()). The data files reside under the directory returned by this command.

Parameters
[in]pathPath to VDC master file
Return values
dir: Path to the data directory
See also
Initialize(), GetPath(), DataDirExists()

◆ getDimLensAtLevel()

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

◆ GetHyperSliceInfo()

virtual int VAPoR::VDCNetCDF::GetHyperSliceInfo ( string  varname,
int  level,
std::vector< size_t > &  dims,
size_t &  nslice 
)
virtual

Override base class to ensure hyperslices are block aligned

◆ GetMasterThreshold()

size_t VAPoR::VDCNetCDF::GetMasterThreshold ( ) const
inline

Return the master file size threshold

See also
VDCNetCDF::VDCNetCDF(), GetVariableThreshold()

Definition at line 122 of file VDCNetCDF.h.

◆ GetPath()

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

Algorithm
If the size of a variable (total number of elements) is less than GetMasterThreshold() and the variable is not compressed it will be stored in the file master file. Otherwise, the variable will be stored in either the coordinate variable or data variable directory, as appropriate. Variables stored in coordinate or data directories are stored one variable per file. If the size of the variable is less than GetVariableThreshold() and the variable is time varying multiple time steps may be saved in a single file. If the variable is compressed each compression level is stored in a separate file.
See also
VDCNetCDF::VDCNetCDF(), GetMasterThreshold(), GetVariableThreshold()

Implements VAPoR::VDC.

◆ GetVariableThreshold()

size_t VAPoR::VDCNetCDF::GetVariableThreshold ( ) const
inline

Return the variable size threshold

See also
VDCNetCDF::VDCNetCDF(), GetMasterThreshold()

Definition at line 128 of file VDCNetCDF.h.

◆ Initialize() [1/2]

virtual int VAPoR::VDCNetCDF::Initialize ( const vector< string > &  paths,
const vector< string > &  options = {},
AccessMode  mode = VDC::R,
vector< size_t >  bs = {64, 64, 64},
size_t  chunksizehint = 0 
)
virtual

Initialize the VDCNetCDF class

Parameters
[in]chunksizehint: NetCDF chunk size hint. A value of zero results in NC_SIZEHINT_DEFAULT being used.

◆ Initialize() [2/2]

virtual int VAPoR::VDCNetCDF::Initialize ( string  path,
const vector< string > &  options,
AccessMode  mode,
vector< size_t >  bs = {64, 64, 64},
size_t  chunksizehint = 0 
)
inlinevirtual

Definition at line 111 of file VDCNetCDF.h.

◆ openVariableRead()

int VAPoR::VDCNetCDF::openVariableRead ( size_t  ts,
string  varname,
int  level = 0,
int  lod = -1 
)
protectedvirtual

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::VDC.

◆ OpenVariableWrite()

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

Implements VAPoR::VDC.

◆ PutVar() [1/4]

int VAPoR::VDCNetCDF::PutVar ( size_t  ts,
string  varname,
int  lod,
const float *  data 
)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 152 of file VDCNetCDF.h.

◆ PutVar() [2/4]

int VAPoR::VDCNetCDF::PutVar ( size_t  ts,
string  varname,
int  lod,
const int *  data 
)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 153 of file VDCNetCDF.h.

◆ PutVar() [3/4]

int VAPoR::VDCNetCDF::PutVar ( string  varname,
int  lod,
const float *  data 
)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 147 of file VDCNetCDF.h.

◆ PutVar() [4/4]

int VAPoR::VDCNetCDF::PutVar ( string  varname,
int  lod,
const int *  data 
)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 148 of file VDCNetCDF.h.

◆ readRegion() [1/3]

int VAPoR::VDCNetCDF::readRegion ( int  fd,
const std::vector< size_t > &  min,
const std::vector< size_t > &  max,
double *  region 
)
protected

◆ readRegion() [2/3]

int VAPoR::VDCNetCDF::readRegion ( int  fd,
const std::vector< size_t > &  min,
const std::vector< size_t > &  max,
float *  region 
)
protected

◆ readRegion() [3/3]

int VAPoR::VDCNetCDF::readRegion ( int  fd,
const std::vector< size_t > &  min,
const std::vector< size_t > &  max,
int *  region 
)
protected

◆ SetFill()

int VAPoR::VDCNetCDF::SetFill ( int  fillmode)

Enable or disable the NetCDF fill-value mode

Enable or disable the NetCDF fill-value mode

Parameters
[in]fillmodeNC_FILL as 0x0 or NC_NOFILL as 0x100
Return values
errNC_NOERR on success

◆ variableExists()

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

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::VDC.

◆ Write() [1/2]

int VAPoR::VDCNetCDF::Write ( int  fd,
const float *  region 
)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 138 of file VDCNetCDF.h.

◆ Write() [2/2]

int VAPoR::VDCNetCDF::Write ( int  fd,
const int *  region 
)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 139 of file VDCNetCDF.h.

◆ WriteSlice() [1/3]

int VAPoR::VDCNetCDF::WriteSlice ( int  fd,
const float *  slice 
)
inlinevirtual

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

Implements VAPoR::VDC.

Definition at line 141 of file VDCNetCDF.h.

◆ WriteSlice() [2/3]

int VAPoR::VDCNetCDF::WriteSlice ( int  fd,
const int *  slice 
)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 142 of file VDCNetCDF.h.

◆ WriteSlice() [3/3]

int VAPoR::VDCNetCDF::WriteSlice ( int  fd,
const unsigned char *  slice 
)
inlinevirtual

Implements VAPoR::VDC.

Definition at line 143 of file VDCNetCDF.h.


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