Commit 4458f7d7 authored by Johann Cohen-Tanugi's avatar Johann Cohen-Tanugi
Browse files

defining oneFilt.nbLines!=0 when the lamb_trans vector is not initialized...

defining oneFilt.nbLines!=0 when the lamb_trans vector is not initialized seems like a bad idea, so this actually resizes and initializes it with dummy oneElLambda elements.
parent fe810399
......@@ -90,7 +90,7 @@ void write_output_filter (ofstream & stfiltfile, ofstream & stfiltdoc, vector<f
stfiltdoc << setw(10) << right << setprecision(4) << fcorr ;
stfiltdoc << setw(8) << right << (it->transtyp) ;
stfiltdoc << setw(8) << right << (it->calibtyp) ;
stfiltdoc << setw(8) << right << (it->nbLines) << endl;
stfiltdoc << setw(8) << right << (it->lamb_trans.size()) << endl;
//OUTPUT FILTER
stfiltfile << "# " << (it->lamb_trans).size() << " " << it->name << " " << it->calibtyp << " " << ((it->id)+1) << endl;
......@@ -148,9 +148,11 @@ vector<flt> read_doc_filters(const string filtFile, bool & Fexiste)
flt oneFilt (0,"bidon",0,0);
// read informations on this filter and fill the object flt
line_stream >> (oneFilt.name) >> (oneFilt.id) >> (oneFilt.lmean) >> (oneFilt.leff) >> (oneFilt.dwidth) >> (oneFilt.ab) >> (oneFilt.veg) >> (oneFilt.fcorr) >> (oneFilt.transtyp) >> (oneFilt.calibtyp) >> (oneFilt.nbLines) ;
int nbLines;
line_stream >> (oneFilt.name) >> (oneFilt.id) >> (oneFilt.lmean) >> (oneFilt.leff) >> (oneFilt.dwidth) >> (oneFilt.ab) >> (oneFilt.veg) >> (oneFilt.fcorr) >> (oneFilt.transtyp) >> (oneFilt.calibtyp) >> nbLines ;
//store all filters in one vector
oneFilt.lamb_trans.resize(nbLines, oneElLambda(-999, -999, -999));
allFilt.push_back(oneFilt);
}
......
Supports Markdown
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