Configures the fitsLoader from the config file and/or command arguments.
960 if (conf.
Get<
bool>(
"list"))
963 if (conf.
Get<
bool>(
"filecontent"))
966 if (conf.
Get<
bool>(
"header"))
970 if (conf.
Get<
bool>(
"header") || conf.
Get<
bool>(
"list") || conf.
Get<
bool>(
"filecontent"))
975 if (conf.
Get<
bool>(
"minmax") && conf.
Get<
bool>(
"stat"))
977 cerr <<
"Invalid combination of options: cannot do stats and minmax." << endl;
980 if (conf.
Get<
bool>(
"stat") && conf.
Get<
bool>(
"nozero"))
982 cerr <<
"Invalid combination of options: nozero only works with minmax." << endl;
986 if (conf.
Get<
bool>(
"scientific") && conf.
Get<
bool>(
"fixed"))
988 cerr <<
"Switched --scientific and --fixed are mutually exclusive." << endl;
992 if (conf.
Has(
"%") && conf.
Has(
"%%"))
994 cerr <<
"Switched --% and --%% are mutually exclusive." << endl;
1000 const string filename = conf.
Get<
string>(
"outfile");
1002 ostream fout(cout.rdbuf());
1007 sout.open(filename);
1010 cerr <<
"Cannot open output stream " << filename <<
": " << strerror(errno) << endl;
1013 fout.rdbuf(sout.rdbuf());
1016 fout.precision(conf.
Get<
int>(
"precision"));
1017 if (conf.
Get<
bool>(
"fixed"))
1019 if (conf.
Get<
bool>(
"scientific"))
1022 const string filter = conf.
Has(
"filter") ? conf.
Get<
string>(
"filter") :
"";
1023 const size_t first = conf.
Get<
size_t>(
"first");
1024 const size_t limit = conf.
Get<
size_t>(
"limit");
1027 if (conf.
Get<
bool>(
"root"))
1029 DumpRoot(fout, conf.
Vec<
string>(
"col"), filter, first, limit, filename);
1034 const vector<string> format = conf.
Vec<
string>(
"%");
1035 for (
auto it=format.begin(); it<format.end(); it++)
1037 static const boost::regex expr(
"-?[0-9]*[.]?[0-9]*[diouxXeEfFgGaAh]");
1040 if (!boost::regex_match(*it, what, expr, boost::match_extra))
1042 cerr <<
"Format '" << *it <<
"' not supported." << endl;
1047 const vector<MyColumn> cols =
InitColumns(conf.
Vec<
string>(
"col"));
1051 if (conf.
Get<
bool>(
"minmax"))
1053 DumpMinMax(fout, cols, first, limit, conf.
Get<
bool>(
"nozero"));
1057 if (conf.
Get<
bool>(
"stat"))
1059 DumpStats(fout, cols, filter, first, limit);
1063 Dump(fout, format, cols, filter, first, limit, filename);
void DumpStats(ostream &, const vector< MyColumn > &, const string &, size_t, size_t)
void List()
Lists all columns of an open file.
T Get(const std::string &var)
std::vector< T > Vec(const std::string &var)
int64_t first
Size of this column in the tile.
void ListFileContent() const
void DumpRoot(ostream &, const vector< string > &, const string &, size_t, size_t, const string &)
void ListHeader(const string &filename)
vector< MyColumn > InitColumns(vector< string > list)
bool Has(const std::string &var)
void DumpMinMax(ostream &, const vector< MyColumn > &, size_t, size_t, bool)
void Dump(ostream &, const vector< string > &, const vector< MyColumn > &, const string &, size_t, size_t, const string &)
Display the selected columns values VS time.