#include <fstream>
#include <cstring>
#include <algorithm>
#include <apfel/timer.h>
int main(int argc, char* argv[])
{
if (argc < 4 || strcmp(argv[1], "--help") == 0)
{
std::cout << "\nInvalid Parameters:" << std::endl;
std::cout << "Syntax: ./CreateTables <configuration file> <path to data folder> <output folder> [optional selected datasets]\n" << std::endl;
exit(-10);
}
std::vector<std::string> selsets;
for (int i = 4; i < argc; i++)
selsets.push_back(std::string(argv[i]));
std::cout << "\nGenerating interpolation tables for:" << std::endl;
const YAML::Node datasets = YAML::LoadFile(std::string(argv[2]) + "/datasets.yaml");
std::vector<NangaParbat::DataHandler> DHVect;
for (auto const& exp : datasets)
for (auto const& ds : exp.second)
if(std::find(selsets.begin(), selsets.end(), ds["name"].as<std::string>()) != selsets.end() || selsets.empty())
{
std::cout << "- " << ds["name"].as<std::string>() << std::endl;
const std::string datafile = std::string(argv[2]) + "/" + exp.first.as<std::string>() + "/" + ds["file"].as<std::string>();
}
const std::vector<std::string> Tabs = FIObj.ComputeTables(DHVect);
for (auto const& tab : Tabs)
{
std::ofstream fout(std::string(argv[3]) + "/" + YAML::Load(tab)["name"].as<std::string>() + ".yaml");
fout << tab << std::endl;
fout.close();
}
return 0;
}
The "DataHandler" class provides a common interface to all datasets. It provides methods to get kinem...
Definition: datahandler.h:23
Class that implements the methods of the computation of the interpolation tables.
Definition: fastinterface.h:21