Gitlab is now running v13.9.0 - More info -> here <-

Commit acff223b authored by Plaszczynski Stephane's avatar Plaszczynski Stephane

use basename for mcmc output files

parent f98d9514
......@@ -19,6 +19,8 @@
#include "Chi2Factory.hh"
#include "cxxsupport/paramfile.h"
#include "cxxsupport/cxxutils.h"
#include "Chi2Combiner.hh"
#include "Parser.hh"
......@@ -48,9 +50,12 @@ int main(int argc, char *argv[])
std::cout << "output file " + fileName + " already exists: removing it"<<endl;
remove_file(fileName);
}
string ar_file=string("ar_vs_length_")+fileName;
string scale_file=string("scale_")+fileName;
string cor_file=string("last_step_")+fileName;
string base=BaseName(fileName);
string ar_file=string("ar_vs_length_")+base;
string scale_file=string("scale_")+base;
string cor_file=string("last_step_")+base;
cout << "output files:" <<endl;
cout << ar_file << " " << scale_file << " " << cor_file << " " << endl;
......
......@@ -294,3 +294,15 @@ string DirName(string source)
source.erase(std::find(source.rbegin(), source.rend(), '/').base(), source.end());
return source;
}
string BaseName(string source)
{
if (source.size() <= 1) //Make sure it's possible to check the last character.
{
return source;
}
planck_assert(*(source.rbegin() + 1) != '/',source +" had no BaseName");
source.erase(source.begin(),std::find(source.rbegin(), source.rend(), '/').base());
return source;
}
......@@ -264,6 +264,8 @@ inline unsigned int healpix_repcount (int npix)
//acess directory name without trailing slash
std::string DirName (std::string x);
std::string BaseName (std::string x);
......
......@@ -83,3 +83,7 @@ set_tol=0.00001
remove_cosmo_limits=false
doHesse=true
###############################################################
#MCMC
algo=ada
length = 50000
proposal_cov = hlpTT_PS_H0_min_ref/covmat8.dat
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