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

Class for reading a UGRID data set stored as a series of NetCDF files: https://ugrid-conventions.github.io/ugrid-conventions/. More...

#include <DCUGRID.h>

Inheritance diagram for VAPoR::DCUGRID:
VAPoR::DCCF VAPoR::DC Wasp::MyBase

Public Member Functions

int OpenVariableRead (size_t ts, string varname, int level=0, int lod=0) override
 
int Read (int fd, int *data) override
 
int ReadRegion (int fd, const vector< size_t > &min, const vector< size_t > &max, int *data) override
 
int CloseVariable (int fd) override
 
- Public Member Functions inherited from VAPoR::DCCF
 DCCF ()
 
virtual ~DCCF ()
 
int BuildCache ()
 
int Reinitialize ()
 
- 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

int initialize (const vector< string > &paths, const std::vector< string > &options) override
 
int initAuxilliaryVars (NetCDFCFCollection *ncdfc, std::map< string, DC::AuxVar > &auxVarsMap) override
 
int initDataVars (NetCDFCFCollection *ncdfc, std::map< string, DC::DataVar > &dataVarsMap) override
 
int initMesh (NetCDFCFCollection *ncdfc, std::map< string, DC::Mesh > &meshMap) override
 
string getMapProjection () const override
 
- Protected Member Functions inherited from VAPoR::DCCF
virtual int initialize (const vector< string > &paths, const std::vector< string > &options)
 
virtual int initialize_impl (const vector< string > &paths, const std::vector< string > &options, std::unique_ptr< NetCDFCFCollection > ncdfc)
 
virtual bool getDimension (string dimname, DC::Dimension &dimension) const
 
virtual std::vector< string > getDimensionNames () const
 
std::vector< string > getMeshNames () const
 
virtual bool getMesh (string mesh_name, DC::Mesh &mesh) 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 > getAuxVarNames () const
 
virtual std::vector< string > getCoordVarNames () const
 
virtual size_t getNumRefLevels (string varname) const
 
virtual string getMapProjection () 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) const
 
virtual int openVariableRead (size_t ts, string varname, int, int)
 
virtual int openVariableRead (size_t ts, string varname)
 
virtual int closeVariable (int fd)
 
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 bool variableExists (size_t ts, string varname, int reflevel=0, int lod=0) const
 
virtual int initDimensions (NetCDFCFCollection *ncdfc, std::map< string, DC::Dimension > &dimsMap)
 
virtual int initCoordinates (NetCDFCFCollection *ncdfc, std::map< string, DC::CoordVar > &coordVarsMap)
 
virtual int addCoordvars (NetCDFCFCollection *ncdfc, const vector< string > &cvars, std::map< string, DC::CoordVar > &coordVarsMap)
 
virtual int initDataVars (NetCDFCFCollection *ncdfc, std::map< string, DC::DataVar > &dataVarsMap)
 
virtual int initAuxilliaryVars (NetCDFCFCollection *ncdfc, std::map< string, DC::AuxVar > &auxVarsMap)
 
virtual int initMesh (NetCDFCFCollection *ncdfc, std::map< string, DC::Mesh > &_meshMap)
 
virtual int getVarCoordinates (NetCDFCFCollection *ncdfc, string varname, vector< string > &sdimnames, vector< string > &scoordvars, string &time_dim_name, string &time_coordvar) const
 
- 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::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 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
 
- Protected Attributes inherited from VAPoR::DCCF
NetCDFCFCollection_ncdfc = nullptr
 
vector< string > _paths
 
- Protected Attributes inherited from VAPoR::DC
DC::FileTable _fileTable
 

Detailed Description

Class for reading a UGRID data set stored as a series of NetCDF files: https://ugrid-conventions.github.io/ugrid-conventions/.

Author
John Clyne
Date
July, 2021

Definition at line 28 of file DCUGRID.h.

Member Function Documentation

◆ CloseVariable()

int VAPoR::DCUGRID::CloseVariable ( int  fd)
overridevirtual

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

Reimplemented from VAPoR::DC.

◆ getMapProjection()

string VAPoR::DCUGRID::getMapProjection ( ) const
inlineoverrideprotectedvirtual

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.

Reimplemented from VAPoR::DCCF.

Definition at line 46 of file DCUGRID.h.

◆ initAuxilliaryVars()

int VAPoR::DCUGRID::initAuxilliaryVars ( NetCDFCFCollection ncdfc,
std::map< string, DC::AuxVar > &  auxVarsMap 
)
overrideprotectedvirtual

Reimplemented from VAPoR::DCCF.

◆ initDataVars()

int VAPoR::DCUGRID::initDataVars ( NetCDFCFCollection ncdfc,
std::map< string, DC::DataVar > &  dataVarsMap 
)
overrideprotectedvirtual

Reimplemented from VAPoR::DCCF.

◆ initialize()

int VAPoR::DCUGRID::initialize ( const vector< string > &  paths,
const std::vector< string > &  options 
)
overrideprotectedvirtual

Initialize the DCCF class

Prepare a CF data set for reading. This method prepares the DCCF class for reading the files indicated by paths. 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 list of CF NetCDF files comprising the output of a single CF model run.
Return values
statusA negative int is returned on failure
See also
EndDefine();

Reimplemented from VAPoR::DCCF.

◆ initMesh()

int VAPoR::DCUGRID::initMesh ( NetCDFCFCollection ncdfc,
std::map< string, DC::Mesh > &  meshMap 
)
overrideprotectedvirtual

Reimplemented from VAPoR::DCCF.

◆ OpenVariableRead()

int VAPoR::DCUGRID::OpenVariableRead ( size_t  ts,
string  varname,
int  level = 0,
int  lod = 0 
)
overridevirtual

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

Reimplemented from VAPoR::DC.

◆ Read()

int VAPoR::DCUGRID::Read ( int  fd,
int *  data 
)
overridevirtual

Reimplemented from VAPoR::DC.

◆ ReadRegion()

int VAPoR::DCUGRID::ReadRegion ( int  fd,
const vector< size_t > &  min,
const vector< size_t > &  max,
int *  data 
)
overridevirtual

Reimplemented from VAPoR::DC.


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