13 #include "eckit/config/YAMLConfiguration.h"
14 #include "eckit/exception/Exceptions.h"
15 #include "eckit/filesystem/PathName.h"
29 void parse(std::string yamlPath)
31 std::unique_ptr<eckit::YAMLConfiguration>
32 yaml(
new eckit::YAMLConfiguration(eckit::PathName(yamlPath)));
34 if (yaml->has(
"observations"))
36 for (
const auto& obsConf : yaml->getSubConfigurations(
"observations"))
38 if (!obsConf.has(
"obs space") ||
42 "Incomplete obs found. All obs must have a obs space and ioda.");
46 auto data =
parser->parse();
48 auto encoder =
IodaEncoder(obsConf.getSubConfiguration(
"ioda"));
54 eckit::BadParameter(
"No section named \"observations\"");
60 ParserFactory::registerParser<BufrParser>(
"bufr");
65 int main(
int argc,
char **argv)
69 eckit::BadParameter(
"Missing argument. Must include YAML file path.");
int main(int argc, char **argv)
Uses IodaDescription and parsed data to create IODA data.
static std::shared_ptr< Parser > create(const eckit::Configuration &conf)
Create a Parser.
void parse(std::string yamlPath)