Commit 8facf9b8 authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

better decoding of kval_file in writeSpectraPk

parent 998cd8d7
...@@ -201,9 +201,17 @@ int main(int argc,char** argv){ ...@@ -201,9 +201,17 @@ int main(int argc,char** argv){
string kvfile=parser.params.find<string>("kval_file",""); string kvfile=parser.params.find<string>("kval_file","");
if (kvfile.size()!=0) { if (kvfile.size()!=0) {
cout <<"using k values from file=" <<kvfile <<endl;
//decode 1st column
ifstream f(kvfile.c_str()); ifstream f(kvfile.c_str());
string line;
double kk; double kk;
while (f>>kk) kval.push_back(kk); while (getline(f,line)) {
//skip comments
if (line.find("#",0) !=std:: string::npos) continue;
std::istringstream str(line);
if (str>>kk) kval.push_back(kk);
} }
else{ else{
const int npks = parser.params.find<int>("n_pks",1000); const int npks = parser.params.find<int>("n_pks",1000);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment