29#include <unordered_set>
37 enum class PARAM_TYPE {
44 GRIBTable(
const std::string &in_filename);
53 void getParamId(
const std::string ¶m_name, std::string ¶mId,
double ¶mId_num,
long ¶mId_long)
const;
54 std::string
getLevelType(
const std::string ¶m_name)
const;
55 long getLevelNo(
const std::string ¶m_name)
const;
58 void printTable()
const;
64 std::string param_indexing;
65 std::string level_indexing;
67 std::map<std::string, std::string> param_table;
68 std::map<std::string, double> param_table_double;
69 std::map<std::string, long> param_table_long;
70 std::map<std::string, std::string> level_type_table;
71 std::map<std::string, long> level_no_table;
73 PARAM_TYPE parameter_id_type;
75 std::unordered_set<std::string> known_params;
78 void init_known_params();
81 bool parseIndexing(
const std::vector<std::string> &line_vals);
82 bool parseParamType(
const std::vector<std::string> &line_vals);
83 void fillParameterTables(
const std::vector<std::string> &line_vals);
91 GRIBFile(
const std::string &in_filename,
const std::vector<std::string> &indexes);
94 std::vector<CodesHandlePtr>
listParameterMessages(
const std::string& param_key,
const T& paramID,
const std::string& level_key,
const std::string &levelType) {
95 return getMessages(file, param_key, paramID, level_key, levelType);
103 return timepoints.find(date) != timepoints.end();
115 return *timepoints.begin();
119 std::string filename;
122 std::map<std::string, double> grid_params;
123 std::set<Date> timepoints;
125 void checkValidity();
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
Definition: GRIBFile.h:89
std::string getFilename() const
Definition: GRIBFile.h:106
std::vector< CodesHandlePtr > listParameterMessages(const std::string ¶m_key, const T ¶mID, const std::string &level_key, const std::string &levelType)
Definition: GRIBFile.h:94
GRIBFile(const std::string &in_filename, const std::vector< std::string > &indexes)
Definition: GRIBFile.cc:250
Date getStartDate() const
Definition: GRIBFile.h:114
std::set< Date > getDates() const
Definition: GRIBFile.h:110
std::map< std::string, double > getGridParams() const
Definition: GRIBFile.h:98
bool isValidDate(const Date &date) const
Definition: GRIBFile.h:102
Definition: GRIBFile.h:35
std::string getLevelType(const std::string ¶m_name) const
Definition: GRIBFile.cc:218
GRIBTable()
Definition: GRIBFile.cc:31
std::string getParamKey() const
Definition: GRIBFile.h:49
std::vector< std::string > getIndexes() const
Definition: GRIBFile.cc:196
long getLevelNo(const std::string ¶m_name) const
Definition: GRIBFile.cc:220
void getParamId(const std::string ¶m_name, std::string ¶mId, double ¶mId_num, long ¶mId_long) const
Definition: GRIBFile.cc:200
std::string getLevelKey() const
Definition: GRIBFile.h:50
This namespace handles all the low level manipulation of GRIB and BUFR files with ecCodes.
std::unique_ptr< codes_index, IndexDeleter > CodesIndexPtr
Definition: libcodes.h:53
std::vector< CodesHandlePtr > getMessages(const std::string &filename, ProductKind product)
Definition: libcodes.cc:315