NetCDF4 C++ API
|
Classes | |
class | NcAtt |
Represents a netCDF attribute. More... | |
class | NcByte |
Represents a netCDF atomic Byte type. More... | |
class | NcChar |
Represents a netCDF atomic Char type. More... | |
class | NcCompoundType |
Represents a netCDF compound type. More... | |
class | NcDim |
Represents a netCDF dimension. More... | |
class | NcDouble |
Represents a netCDF atomic Double type. More... | |
class | NcEnumType |
Represents a netCDF enum type. More... | |
class | NcException |
Handles the C++ API exceptions. More... | |
class | NcFile |
Manages the opening, creating, and closing of netCDF files. Represents the netCDF root group. More... | |
class | NcFileReg |
Manages a registry of NcFile objects. More... | |
class | NcFloat |
Represents a netCDF atomic Float type. More... | |
class | NcGroup |
Represents a netCDF group. More... | |
class | NcGroupAtt |
Represents a netCDF group attribute. More... | |
class | NcInt |
Represents a netCDF atomic Int type. More... | |
class | NcInt64 |
Represents a netCDF atomic Int64 type. More... | |
class | NcItem |
Base class for NcAtt, NcVar, NcDim, NcGroup. More... | |
class | NcLimits |
Class containing NetCDF limiting values. More... | |
class | NcMPI |
Manages data related to the MPI implementation. More... | |
class | NcOpaqueType |
Represents a netCDF opaque type. More... | |
class | NcShort |
Represents a netCDF atomic Short type. More... | |
class | NcString |
Represents a netCDF atomic String type. More... | |
class | NcType |
Base class for all netCDF data types. More... | |
class | NcNullType |
class | NcTypeUserDef |
Defines a non-atomic, user-defined NetCDF4 type. More... | |
class | NcTypeV4 |
Class associated with netCDF version 4 data types. More... | |
class | NcUbyte |
Represents a netCDF atomic Ubyte type. More... | |
class | NcUint |
Represents a netCDF atomic Uint type. More... | |
class | NcUint64 |
Represents a netCDF atomic Uint64 type. More... | |
class | NcUshort |
Represents a netCDF atomic Ushort type. More... | |
class | NcVar |
Represents a netCDF variable. More... | |
class | NcNullVar |
class | NcVarAtt |
Represents a netCDF variable attribute. More... | |
class | NcVersion |
Class which returns the version of the NetCDF4 C++ API. More... | |
class | NcVlenType |
Represents a netCDF VLEN type. More... | |
class | MetadataCFGlobal |
Class managing global metadata that conform to netCDF CF conventions. A typical set of attributes are known. More... | |
class | MetadataCFVariable |
Class managing variable metadata that conform to netCDF CF conventions. A typical set of attributes are known. More... | |
class | NcFileMetaCF |
Class for read/write CF-convention netCDF global metadata (aka attributes). A typical set of attributes are known. More... | |
class | NcVarMetaCF |
Class for read/write CF-convention metadata for a netCDF variable. A typical set of attributes are known. More... | |
class | NcIndexedGridBase |
Class providing an interface to a NetCDF file containing a indexed (packed) latitude/longitude grid. More... | |
class | NcLatLonRecordBase |
Class providing an interface to a NetCDF file containing a record-based latitude/longitude data. More... | |
class | NcSimpleGridBase |
Class providing an interface to a NetCDF file containing a simple latitude/longitude grid. More... | |
class | NcSpatial |
Types and constants for spatial data. More... | |
class | NcTimeSeriesBase |
Class providing an interface to a NetCDF file containing time-series dimension and variables. More... | |
class | NcUtil |
Utility functions for the NetCDF4 C++ API. More... | |
Typedefs | |
typedef TEH::GL::Singleton < NcFileReg > | NcFileRegSingleton |
typedef std::vector< signed char > | TVecByte |
typedef std::vector< unsigned char > | TVecUbyte |
typedef std::vector< char > | TVecChar |
typedef std::vector< short > | TVecShort |
typedef std::vector< unsigned short > | TVecUshort |
typedef std::vector< int > | TVecInt |
typedef std::vector< unsigned int > | TVecUint |
typedef std::vector< float > | TVecFloat |
typedef std::vector< double > | TVecDouble |
typedef std::vector< long long > | TVecInt64 |
typedef std::vector< unsigned long long > | TVecUint64 |
typedef std::vector< std::string > | TVecString |
typedef std::vector< std::size_t > | TVecIndex |
typedef std::vector< ptrdiff_t > | TVecStride |
Functions | |
void | NcCheckThrowMsg (int const retCode, char const *const file, int const line) |
void | NcCheckEdgeArrays (int const groupID, int const varID, std::vector< std::size_t > const &start, std::vector< std::size_t > const &count) |
void | NcCheck (int const retCode, char const *const file, int const line) |
std::string const & | GetFileModeStr (NcFile::FileMode const fileMode) |
Get a string matching the file mode. More... | |
std::string const & | GetFileFormatStr (NcFile::FileFormat const fileFormat) |
Get a string matching the file format. More... | |
char ** | MakeCStringArray (int const numStrings, short const size) |
Allocates array and copies strings. More... | |
char ** | ToCStringArray (std::vector< std::string > const &strVec) |
void | FreeCStringArray (char **&cStrArray, std::size_t const numStrings) |
bool | IsRecordVariable (int const groupID, int const varID) |
std::size_t | GetTotalSize (NcVar const &var) |
Get total number of elements of data from the dimensions of a variable. throws error if netcdf error. returns zero if has no sizes > 0. Unlimited dimensions are counted only if > zero. More... | |
std::size_t | GetTotalSize (int const groupID, int const varID) |
std::size_t | GetTotalSize (int const groupID, int const varID, std::vector< std::size_t > const &count) |
void | GetTypeName (NcGroup const &group,NcType::ncType const typeID,std::string &name) |
Gets the netCDF name of existing type object from the type ID. More... | |
NcGroup | GetGroup (NcFile const &ncFile, int const groupID) |
Get item info from netCDF ID numbers. More... | |
std::string | GetVarName (int const groupID, int const varID) |
NcVar | GetVar (NcFile const &ncFile, int const groupID, int const varID) |
void | GetNcDims (int const groupID, int const varID, std::vector< NcDim > &ncDims) |
Get the dimensions for a variable as vector of NcDim objects. More... | |
std::size_t | GetDimSize (int const groupID,int const varID,int const dimIndex) |
Get the size of a variable's dimension. More... | |
bool | IsAtomicType (NcType::ncType const typeClass) |
true if is a netCDF atomic type More... | |
bool | IsUserDefinedType (NcType::ncType const typeClass) |
true if is a netCDF user-defined type More... | |
template<class TNCT > | |
TNCT::value_type * | MakeCArray (TNCT const &ncType, int const size, typename TNCT::value_type const initValue=0) |
Create an empty C-ptr array from the NcType object and size. More... | |
template<class TSrc , class TDest > | |
void | ToVector (TSrc const srcBegin, TSrc const srcEnd, std::vector< TDest > &dest) |
Copy a C-ptr array to a std::vector. More... | |
template<class TSrc , class TDest > | |
void | ToVector (TSrc const srcBegin, std::vector< TDest > &dest, std::size_t const count) |
Copy a C-ptr array to a std::vector. More... | |
template<class T > | |
T * | FromVector (std::vector< T > const &src) |
Create a C-array from a std::vector. More... | |
void | operator<< (NcFileMetaCF &metaFile,MetadataCFGlobal const &meta) |
Add metadata to netCDF global attributes. More... | |
void | operator>> (NcFileMetaCF &metaFile,MetadataCFGlobal &meta) |
Read metadata from netCDF global attributes. More... | |
std::ostream & | operator<< (std::ostream &os,MetadataCFGlobal const &meta) |
Write global file metadata to stream. More... | |
void | UpdateHistory (MetadataCFGlobal &meta,std::string const &newHistory,char const separator=MetadataCFGlobal::defaultSeparator) |
Append update with datestamp to history attribute. More... | |
template<typename TNumeric > | |
void | operator<< (NcVarMetaCF &metaVar, MetadataCFVariable< TNumeric > const &meta) |
Add metadata to netCDF variable attributes. More... | |
template<typename TNumeric > | |
void | operator>> (NcVarMetaCF &metaVar, MetadataCFVariable< TNumeric > &meta) |
Read metadata from netCDF variable attributes. More... | |
template<typename TNumeric > | |
std::ostream & | operator<< (std::ostream &os, MetadataCFVariable< TNumeric > const &meta) |
Write variable metadata to stream. More... | |
std::string & | SetExtension (std::string &ncFileName) |
Set the file name extension to "nc" as is the netCDF convention. More... | |
void | GetNcFiles (std::string const &path, std::vector< std::string > &fileNames) |
Get all the netCDF file names in the path. More... | |
bool | FileExists (std::string const &ncFileName,bool const isPath=false) |
Return true if file exists, else false. More... | |
bool | IsGridded (NcFile &nc) |
bool | IsGriddedIndexed (NcFile &nc) |
bool | IsTimeSeries (NcFile &nc) |
NcSpatial::GridDim | GetGridDimensions (NcFile &nc) |
Variables | |
NcByte | ncByte |
NcChar | ncChar |
NcDouble | ncDouble |
NcFloat | ncFloat |
NcInt | ncInt |
NcInt64 | ncInt64 |
NcShort | ncShort |
NcString | ncString |
NcNullType | nullType |
global null type More... | |
NcType | NullType |
NcUbyte | ncUbyte |
NcUint | ncUint |
NcUint64 | ncUint64 |
NcUshort | ncUshort |
NcNullVar | nullVar |
global null variable More... | |
typedef TEH::GL::Singleton<NcFileReg> netcdf::NcFileRegSingleton |
typedef std::vector< signed char > netcdf::TVecByte |
typedef std::vector< char > netcdf::TVecChar |
typedef std::vector< double > netcdf::TVecDouble |
typedef std::vector< float > netcdf::TVecFloat |
typedef std::vector< std::size_t > netcdf::TVecIndex |
typedef std::vector< int > netcdf::TVecInt |
typedef std::vector< long long > netcdf::TVecInt64 |
typedef std::vector< short > netcdf::TVecShort |
typedef std::vector< ptrdiff_t > netcdf::TVecStride |
typedef std::vector< std::string > netcdf::TVecString |
typedef std::vector< unsigned char > netcdf::TVecUbyte |
typedef std::vector< unsigned int > netcdf::TVecUint |
typedef std::vector< unsigned long long > netcdf::TVecUint64 |
typedef std::vector< unsigned short > netcdf::TVecUshort |
bool netcdf::FileExists | ( | std::string const & | ncFileName, |
bool const | isPath = false |
||
) |
if true, fileName is a path
ncFileName | file name or path to find |
void netcdf::FreeCStringArray | ( | char **& | cStrArray, |
std::size_t const | numStrings | ||
) |
T* netcdf::FromVector | ( | std::vector< T > const & | src | ) |
< atomic data type
src | returns ownership of C array data source |
std::size_t netcdf::GetDimSize | ( | int const | groupID, |
int const | varID, | ||
int const | dimIndex | ||
) |
which dimension to query (zero-based)
groupID | group ID |
varID | variable ID |
std::string const & netcdf::GetFileFormatStr | ( | NcFile::FileFormat const | fileFormat | ) |
std::string const & netcdf::GetFileModeStr | ( | NcFile::FileMode const | fileMode | ) |
NcSpatial::GridDim netcdf::GetGridDimensions | ( | NcFile & | nc | ) |
NcGroup netcdf::GetGroup | ( | NcFile const & | ncFile, |
int const | groupID | ||
) |
void netcdf::GetNcDims | ( | int const | groupID, |
int const | varID, | ||
std::vector< NcDim > & | ncDims | ||
) |
void netcdf::GetNcFiles | ( | std::string const & | path, |
std::vector< std::string > & | fileNames | ||
) |
netCDF file names found
path | path to search |
fileNames | netCDF file names found |
std::size_t netcdf::GetTotalSize | ( | NcVar const & | var | ) |
std::size_t netcdf::GetTotalSize | ( | int const | groupID, |
int const | varID | ||
) |
std::size_t netcdf::GetTotalSize | ( | int const | groupID, |
int const | varID, | ||
std::vector< std::size_t > const & | count | ||
) |
void netcdf::GetTypeName | ( | NcGroup const & | group, |
NcType::ncType const | typeID, | ||
std::string & | name | ||
) |
NcVar netcdf::GetVar | ( | NcFile const & | ncFile, |
int const | groupID, | ||
int const | varID | ||
) |
std::string netcdf::GetVarName | ( | int const | groupID, |
int const | varID | ||
) |
|
inline |
bool netcdf::IsGridded | ( | NcFile & | nc | ) |
bool netcdf::IsGriddedIndexed | ( | NcFile & | nc | ) |
bool netcdf::IsRecordVariable | ( | int const | groupID, |
int const | varID | ||
) |
bool netcdf::IsTimeSeries | ( | NcFile & | nc | ) |
|
inline |
TNCT::value_type* netcdf::MakeCArray | ( | TNCT const & | ncType, |
int const | size, | ||
typename TNCT::value_type const | initValue = 0 |
||
) |
char ** netcdf::MakeCStringArray | ( | int const | numStrings, |
short const | size | ||
) |
|
inline |
Function checks error code and if necessary throws an exception.
retCode | Integer value returned by netCDF C-routines. |
file | The name of the file from which this call originates. |
line | The line number in the file from which this call originates. |
void netcdf::NcCheckEdgeArrays | ( | int const | groupID, |
int const | varID, | ||
std::vector< std::size_t > const & | start, | ||
std::vector< std::size_t > const & | count | ||
) |
groupID | returns true if ok |
varID | group or file ID |
start | variable ID |
count | start indices |
void netcdf::NcCheckThrowMsg | ( | int const | retCode, |
char const *const | file, | ||
int const | line | ||
) |
void netcdf::operator<< | ( | NcFileMetaCF & | metaFile, |
MetadataCFGlobal const & | meta | ||
) |
global file metadata
metaFile | netCDF file metadata |
void netcdf::operator<< | ( | NcVarMetaCF & | metaVar, |
MetadataCFVariable< TNumeric > const & | meta | ||
) |
metaVar | netCDF variable |
meta | variable metadata |
std::ostream & netcdf::operator<< | ( | std::ostream & | os, |
MetadataCFGlobal const & | meta | ||
) |
global file metadata
os | output stream |
std::ostream& netcdf::operator<< | ( | std::ostream & | os, |
MetadataCFVariable< TNumeric > const & | meta | ||
) |
os | output stream |
meta | variable metadata |
void netcdf::operator>> | ( | NcFileMetaCF & | metaFile, |
MetadataCFGlobal & | meta | ||
) |
global file metadata
metaFile | netCDF file metadata |
void netcdf::operator>> | ( | NcVarMetaCF & | metaVar, |
MetadataCFVariable< TNumeric > & | meta | ||
) |
metaVar | netCDF variable |
meta | variable metadata |
std::string & netcdf::SetExtension | ( | std::string & | ncFileName | ) |
char ** netcdf::ToCStringArray | ( | std::vector< std::string > const & | strVec | ) |
void netcdf::ToVector | ( | TSrc const | srcBegin, |
TSrc const | srcEnd, | ||
std::vector< TDest > & | dest | ||
) |
< atomic data types
srcBegin | Copies to std::vector C array source begin ptr |
srcEnd | C array source begin ptr + length |
dest | vector to receive values |
void netcdf::ToVector | ( | TSrc const | srcBegin, |
std::vector< TDest > & | dest, | ||
std::size_t const | count | ||
) |
< atomic data types
srcBegin | Copies to std::vector C array source begin ptr |
dest | vector to receive values |
count | number of elements (ignored if zero) |
void netcdf::UpdateHistory | ( | MetadataCFGlobal & | meta, |
std::string const & | newHistory, | ||
char const | separator | ||
) |
meta | metadata with history item |
newHistory | new history to append |
separator | separator for history items |
NcByte netcdf::ncByte |
A global instance of the NcByte class within the netCDF namespace.
NcChar netcdf::ncChar |
A global instance of the NcChar class within the netCDF namespace.
NcDouble netcdf::ncDouble |
A global instance of the NcDouble class within the netCDF namespace.
NcFloat netcdf::ncFloat |
A global instance of the NcFloat class within the netCDF namespace.
NcInt netcdf::ncInt |
A global instance of the NcInt class within the netCDF namespace.
NcInt64 netcdf::ncInt64 |
A global instance of the NcInt64 class within the netCDF namespace.
NcShort netcdf::ncShort |
A global instance of the NcShort class within the netCDF namespace.
NcString netcdf::ncString |
A global instance of the NcString class within the netCDF namespace.
NcUbyte netcdf::ncUbyte |
A global instance of the NcUbyte class within the netCDF namespace.
NcUint netcdf::ncUint |
A global instance of the NcUint class within the netCDF namespace.
NcUint64 netcdf::ncUint64 |
A global instance of the NcUint64 class within the netCDF namespace.
NcUshort netcdf::ncUshort |
NcNullType netcdf::nullType |
NcType netcdf::NullType |
NcNullVar netcdf::nullVar |