20 boost::program_options::options_description opt;
22 source.c_str(), boost::program_options::value<std::string>()->default_value(
""),
"");
25 netCDF::NcFile ncFile(fileName, netCDF::NcFile::read);
28 netCDF::NcGroup metadataGroup(ncFile.getGroup(
"metadata"));
29 if (metadataGroup.isNull()) {
30 return std::stringstream();
32 netCDF::NcGroup configurationGroup(metadataGroup.getGroup(
"configuration"));
34 std::stringstream config;
36 std::multimap<std::string, netCDF::NcVar> configs = configurationGroup.getVars();
37 for (
auto entry : configs) {
38 config << entry.first <<
" = ";
39 if (entry.second.getType() == netCDF::ncDouble) {
41 entry.second.getVar(&value);
43 }
else if (entry.second.getType() == netCDF::ncInt) {
45 entry.second.getVar(&value);
47 }
else if (entry.second.getType() == netCDF::ncUint) {
49 entry.second.getVar(&value);
51 }
else if (entry.second.getType() == netCDF::ncString) {
53 entry.second.getVar(&cValue);