MeteoIODoc 2.11.0
libncpp.cc File Reference
#include <meteoio/plugins/libncpp.h>
#include <meteoio/MathOptim.h>
#include <meteoio/meteoStats/libresampling2D.h>
#include <meteoio/dataClasses/Coords.h>
#include <meteoio/dataClasses/CoordsAlgorithms.h>
#include <meteoio/IOUtils.h>
#include <meteoio/FileUtils.h>
#include <meteoio/dataClasses/Date.h>
#include <meteoio/dataClasses/MeteoData.h>
#include <meteoio/IOExceptions.h>
#include <algorithm>
#include <netcdf.h>
#include <fstream>
#include <cstring>
#include <cerrno>

Namespaces

namespace  ncpp
 

Functions

std::vector< std::string > ncpp::initDimensionNames ()
 Set the names of the dimensions. More...
 
const std::vector< std::string > ncpp::dimnames (initDimensionNames())
 
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::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 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 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::overload_attributes (ncpp::nc_variable &var)
 Add attributes to non-standard variables. 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::file_redef (const std::string &filename, const int &ncid)
 Re-open the file in "definition" mode. 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::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::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::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::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, ncpp::nc_dimension &dimension, const size_t &length)
 Create a new dimension. 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...
 
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...
 
std::string ncpp::generateHistoryAttribute ()
 Build a CF-1 history string (date of creation, creator, software version) More...