MeteoIODoc 20241221.207bde49
libcodes.cc File Reference
#include "meteoio/IOUtils.h"
#include <meteoio/FStream.h>
#include <meteoio/FileUtils.h>
#include <meteoio/plugins/libcodes.h>
#include <cstring>
#include <string>

Namespaces

namespace  mio
 
namespace  codes
 This namespace handles all the low level manipulation of GRIB and BUFR files with ecCodes.
 
namespace  mio::codes
 

Functions

static long mio::codes::getDescriptor (const std::string &key)
 
static std::vector< long > mio::codes::getDescriptors (std::vector< std::string > keys)
 
CodesHandlePtr mio::codes::makeUnique (codes_handle *h)
 
CodesIndexPtr mio::codes::makeUnique (codes_index *i)
 
CodesIndexPtr mio::codes::indexFile (const std::string &filename, const std::vector< std::string > &index_keys, bool verbose)
 
bool mio::codes::getParameter (CodesHandlePtr &h, const std::string &parameterName, double &parameterValue, const IOUtils::ThrowOptions &throwError)
 
bool mio::codes::getParameter (CodesHandlePtr &h, const std::string &parameterName, long &parameterValue, const IOUtils::ThrowOptions &throwError)
 
bool mio::codes::getParameter (CodesHandlePtr &h, const std::string &parameterName, int &parameterValue, const IOUtils::ThrowOptions &throwError)
 
bool mio::codes::getParameter (CodesHandlePtr &h, const std::string &parameterName, std::string &parameterValue, const IOUtils::ThrowOptions &throwError)
 
std::vector< CodesHandlePtr > mio::codes::getMessages (const std::string &filename, ProductKind product)
 
std::vector< CodesHandlePtr > mio::codes::getMessages (FILE *in_file, ProductKind product)
 
Date mio::codes::getMessageDateGrib (CodesHandlePtr &h, const double &tz_in)
 
std::map< std::string, double > mio::codes::getGridParameters (CodesHandlePtr &h_unique)
 
std::map< std::string, double > mio::codes::getGriddedValues (CodesHandlePtr &h, std::vector< double > &values)
 
void mio::codes::getGriddedValues (CodesHandlePtr &h, std::vector< double > &values, std::map< std::string, double > &gridParams)
 
void mio::codes::getNearestValues_grib (CodesHandlePtr &h, const std::vector< double > &in_lats, const std::vector< double > &in_lons, std::vector< double > &out_lats, std::vector< double > &out_lons, std::vector< double > &distances, std::vector< double > &values, std::vector< int > &indexes)
 
void mio::codes::unpackMessage (CodesHandlePtr &m)
 
std::string mio::codes::getSubsetPrefix (const size_t &subsetNumber)
 
Date mio::codes::getMessageDateBUFR (CodesHandlePtr &h, const size_t &subsetNumber, const double &tz_in)
 
void mio::codes::setMissingValue (CodesHandlePtr &message, double missingValue)
 
bool mio::codes::selectParameter (codes_index *raw, const std::string &param_key, const std::string &paramId)
 
bool mio::codes::selectParameter (codes_index *raw, const std::string &param_key, const double &paramId)
 
bool mio::codes::selectParameter (codes_index *raw, const std::string &param_key, const long &paramId)
 
void mio::codes::writeToFile (CodesHandlePtr &h, const std::string &filename)
 
static void mio::codes::setHeader (codes_handle *ibufr, long num_subsets)
 
static void mio::codes::addDescriptors (std::vector< long > &descriptors, const std::vector< long > &to_add)
 
static void mio::codes::addRepeatedDescriptors (std::vector< long > &descriptors, std::vector< long > &replication_factors_in_subset, const std::vector< long > &repeated_descriptors, long num)
 
static void mio::codes::addStandardDescriptors (std::vector< long > &descriptors, long num, const std::set< std::string > &available_params, const std::string &param, long descriptor)
 
static void mio::codes::setCryosDescriptors (std::vector< long > &descriptors, std::vector< long > &replication_factors_in_subset, long num_heights)
 
static void mio::codes::setMeteoIODesrciptors (std::vector< long > &descriptors, std::vector< long > &replication_factors_in_subset, const std::map< MeteoParam, size_t > &multi_param_occurences, const std::set< std::string > &available_params, const std::vector< MeteoParam > &POSSIBLE_MULTIPLE_PARAMETERS)
 
static void mio::codes::setReplicationFactors (codes_handle *ibufr, const std::vector< long > &replication_factors_in_subset, long num_subsets)
 
CodesHandlePtr mio::codes::createBUFRMessageFromSample (long num_subsets, const std::map< MeteoParam, size_t > &multi_param_occurences, const std::set< std::string > &available_params, const std::vector< MeteoParam > &POSSIBLE_MULTIPLE_PARAMETERS, const bool &write_cryos_station, const long &num_cryo_heights)
 
void mio::codes::setTime (CodesHandlePtr &ibufr, const Date &date, const std::string &subset_prefix)
 
void mio::codes::setTypicalTime (CodesHandlePtr &ibufr, const Date &date)
 
bool mio::codes::setParameter (CodesHandlePtr &ibufr, const std::string &parameterName, const double &parameterValue)
 
bool mio::codes::setParameter (CodesHandlePtr &ibufr, const std::string &parameterName, const long &parameterValue)
 
bool mio::codes::setParameter (CodesHandlePtr &ibufr, const std::string &parameterName, const std::vector< long > &parameterValues)
 
bool mio::codes::setParameter (CodesHandlePtr &ibufr, const std::string &parameterName, const std::string &parameterValue)
 
void mio::codes::packMessage (CodesHandlePtr &m)
 

Variables

const int mio::codes::WMO_BUFR_TABLE_NO = 41
 
const std::string mio::codes::BUFR_HEIGHT_KEY = "height"
 
const std::map< std::string, std::string > mio::codes::BUFR_PARAMETER
 
const std::map< std::string, std::string > mio::codes::BUFR_PARAMETER_ALT {{"TA", "airTemperatureAt2m"}}
 
const std::vector< int > mio::codes::FLAG_TO_EPSG = {4326, 4258, 4269, 4314}
 
const long mio::codes::SNOW_SURFACE_QUALIFIER = 6
 
static const std::map< std::string, long > mio::codes::BUFR_DESCRIPTORS
 
const long mio::codes::NOPARAMID = -1
 
const std::map< std::string, long > mio::codes::GRIB_DEFAULT_PARAM_TABLE
 
const std::map< std::string, std::string > mio::codes::GRIB_DEFAULT_LEVELTYPE_TABLE
 
const std::map< std::string, long > mio::codes::GRIB_DEFAULT_LEVELNO_TABLE