MeteoIODoc 20241221.207bde49
libncpp.h File Reference
#include <meteoio/plugins/libacdd.h>
#include <meteoio/dataClasses/Grid2DObject.h>
#include <meteoio/IOUtils.h>
#include <meteoio/Config.h>
#include <meteoio/dataClasses/MeteoData.h>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  var_attr
 
struct  nc_variable
 
struct  nc_dimension
 
class  NC_SCHEMA
 This class contains and handles NetCDF schemas. More...
 

Namespaces

namespace  ncpp
 

Enumerations

enum  ncpp::Dimensions {
  ncpp::firstdimension =mio::MeteoGrids::lastparam+10 , ncpp::NONE =firstdimension , ncpp::TIME , ncpp::LATITUDE ,
  ncpp::LONGITUDE , ncpp::NORTHING , ncpp::EASTING , ncpp::STATION ,
  ncpp::STATSTRLEN , ncpp::DATESTRLEN , ncpp::ZREF , ncpp::UREF ,
  ncpp::lastdimension =UREF
}
 This enum expands the parameters given in mio::MeteoGrids::Parameters and adds parameters used as dimensions in NetCDF files. More...
 

Functions

std::string ncpp::getParameterName (const size_t &param)
 Given a parameter index, return its associated name. More...
 
std::string ncpp::getParameterDescription (const size_t &param)
 
std::string ncpp::getParameterUnits (const size_t &param)
 
size_t ncpp::getParameterIndex (const std::string &param)
 Given a parameter name, return its associated index. More...
 
void ncpp::open_file (const std::string &filename, const int &omode, int &ncid)
 
void ncpp::create_file (const std::string &filename, const int &cmode, int &ncid)
 
void ncpp::file_redef (const std::string &filename, const int &ncid)
 Re-open the file in "definition" mode. More...
 
void ncpp::create_variable (const int &ncid, ncpp::nc_variable &var)
 Write a pre-defined set of attributes for the given variable. More...
 
void ncpp::end_definitions (const std::string &filename, const int &ncid)
 
void ncpp::close_file (const std::string &filename, const int &ncid)
 
void ncpp::add_attribute (const int &ncid, const int &varid, const std::string &attr_name, const double &attr_value)
 Add an attribute to the file pointed to by ncid. More...
 
void ncpp::add_attribute (const int &ncid, const int &varid, const std::string &attr_name, const float &attr_value)
 
void ncpp::add_attribute (const int &ncid, const int &varid, const std::string &attr_name, const int &attr_value)
 
void ncpp::add_attribute (const int &ncid, const int &varid, const std::string &attr_name, const double &attr_value, const int &data_type)
 Add an attribute to the file pointed to by ncid. More...
 
void ncpp::add_attribute (const int &ncid, const int &varid, const std::string &attr_name, const std::string &attr_value)
 
void ncpp::writeACDDAttributes (const int &ncid, const mio::ACDD &acdd)
 Add all the ACDD attributes contained in the acdd object to the file pointed to by ncid. More...
 
bool ncpp::check_attribute (const int &ncid, const int &varid, const std::string &attr_name)
 Check if a variable has a given attribute. More...
 
void ncpp::getGlobalAttribute (const int &ncid, const std::string &attr_name, std::string &attr_value)
 Read a given global attribute (if not found, an empty string is returned) More...
 
void ncpp::getGlobalAttribute (const int &ncid, const std::string &attr_name, int &attr_value)
 
void ncpp::getAttribute (const int &ncid, const nc_variable &var, const std::string &attr_name, std::string &attr_value)
 Read a given attribute from a variable (if not found, an empty string is returned) More...
 
void ncpp::getAttribute (const int &ncid, const nc_variable &var, const std::string &attr_name, double &attr_value)
 Read a given attribute from a variable (if not found, attr_value is left unchanged) More...
 
void ncpp::read_data (const int &ncid, const nc_variable &var, const size_t &pos, const size_t &nrows, const size_t &ncols, const size_t &pos_i, const size_t &row_i, const size_t &col_i, double *data)
 Read 2D gridded data at the provided time position for a specific variable. More...
 
void ncpp::read_data_point (const int &ncid, const nc_variable &var, const size_t &row, const size_t &col, const size_t &row_i, const size_t &col_i, double *data)
 Read grid point in 2D gridded data for non time dependent data. More...
 
void ncpp::read_data_point (const int &ncid, const nc_variable &var, const size_t &pos, const size_t &row, const size_t &col, const size_t &pos_i, const size_t &row_i, const size_t &col_i, double *data)
 Read grid point in 2D gridded data at the provided time position for a specific variable. More...
 
void ncpp::read_data (const int &ncid, const nc_variable &var, double *data)
 Read all the data for a specific variable. More...
 
void ncpp::read_data (const int &ncid, const nc_variable &var, int *data)
 Read all the data for a specific variable. More...
 
void ncpp::readVariableMetadata (const int &ncid, ncpp::nc_variable &var, const bool &readTimeTransform, const double &TZ)
 Read a pre-defined set of attributes for the given variable, from the provided file. More...
 
void ncpp::write_data (const int &ncid, const nc_variable &var, const size_t &pos, const size_t &nrows, const size_t &ncols, const double *const data)
 Write 2D gridded data at the provided time position for a specific variable. More...
 
void ncpp::write_1Ddata (const int &ncid, const nc_variable &var, const std::vector< double > &data, const bool &isUnlimited)
 Write a vector of data for a given 1D variable. More...
 
void ncpp::write_1Ddata (const int &ncid, const nc_variable &var, const std::vector< std::string > &data, const int &strMaxLen)
 Write a vector of strings for a given 1D variable. More...
 
void ncpp::fill2DGrid (mio::Grid2DObject &grid, const double data[], const double &nodata, const bool &normal_Xorder, const bool &normal_Yorder)
 Fill a Grid2DObject with 2D gridded data as read from a NetCDF file. More...
 
void ncpp::getTimeTransform (const std::string &time_units, const double &i_TZ, double &o_time_offset, double &o_time_divisor)
 Parse a time unit specification. More...
 
void ncpp::createDimension (const int &ncid, nc_dimension &dimension, const size_t &length)
 
std::string ncpp::generateHistoryAttribute ()
 Build a CF-1 history string (date of creation, creator, software version) More...