6 #ifndef MDAL_NETCDF_HPP
7 #define MDAL_NETCDF_HPP
23 void openFile(
const std::string &fileName );
25 std::vector<int> readIntArr(
const std::string &name,
size_t dim )
const;
27 std::vector<int> readIntArr(
int arr_id,
35 std::vector<int> readIntArr(
int arr_id,
40 std::vector<double> readDoubleArr(
const std::string &name,
size_t dim )
const;
43 std::vector<double> readDoubleArr(
int arr_id,
51 std::vector<double> readDoubleArr(
int arr_id,
56 bool hasArr(
const std::string &name )
const;
57 int arrId(
const std::string &name )
const;
59 std::vector<std::string> readArrNames()
const;
61 bool hasAttrInt(
const std::string &name,
const std::string &attr_name )
const;
62 int getAttrInt(
const std::string &name,
const std::string &attr_name )
const;
63 bool hasAttrDouble(
int varid,
const std::string &attr_name )
const;
64 double getAttrDouble(
int varid,
const std::string &attr_name )
const;
71 std::string
getAttrStr(
const std::string &name,
const std::string &attr_name )
const;
72 std::string
getAttrStr(
const std::string &attr_name,
int varid )
const;
74 double getFillValue(
int varid )
const;
75 int getVarId(
const std::string &name );
76 void getDimension(
const std::string &name,
size_t *val,
int *ncid_val )
const;
77 void getDimensions(
const std::string &variableName, std::vector<size_t> &dimensionsId, std::vector<int> &dimensionIds );
78 bool hasDimension(
const std::string &name )
const;
80 void createFile(
const std::string &fileName );
81 int defineDimension(
const std::string &name,
size_t size );
82 int defineVar(
const std::string &varName,
int ncType,
int dimensionCount,
const int *dimensions );
83 void putAttrStr(
int varId,
const std::string &attrName,
const std::string &value );
84 void putAttrInt(
int varId,
const std::string &attrName,
int value );
85 void putAttrDouble(
int varId,
const std::string &attrName,
double value );
86 void putDataDouble(
int varId,
const size_t index,
const double value );
87 void putDataArrayInt(
int varId,
size_t line,
size_t faceVerticesMax,
int *values );
89 std::string getFileName()
const;
93 std::string mFileName;
C++ Wrapper around netcdf C library.
Definition: mdal_netcdf.hpp:15
~NetCDFFile()
Closes the file.
Definition: mdal_netcdf.cpp:19
NetCDFFile()
Create file with invalid handle.
Definition: mdal_netcdf.cpp:17
std::string getAttrStr(const std::string &name, const std::string &attr_name) const
Get string attribute.
Definition: mdal_netcdf.cpp:272