From a79be5a20705b8d751800ede1a8870cb982d9d31 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 7 Jun 2016 15:13:10 +0800 Subject: mass_profile/fit_{d,}beta_sbp.cpp: fix wrong value of 'mu' * Fix the 'mu' value to the more accurate '1.155' (see also the email from Junhua GU on 2015-07-27) * Add reference for the 'mu': molecular weight per electron --- mass_profile/fit_beta_sbp.cpp | 44 ++++++++++++++++--------------- mass_profile/fit_dbeta_sbp.cpp | 60 ++++++++++++++++++++++-------------------- 2 files changed, 54 insertions(+), 50 deletions(-) diff --git a/mass_profile/fit_beta_sbp.cpp b/mass_profile/fit_beta_sbp.cpp index ce3b43a..41d6192 100644 --- a/mass_profile/fit_beta_sbp.cpp +++ b/mass_profile/fit_beta_sbp.cpp @@ -1,7 +1,7 @@ /* Perform a double-beta density model fitting to the surface brightness data Author: Junhua Gu - Last modified: 2011.01.01 + Last modified: 2016.06.07 This code is distributed with no warrant */ @@ -30,7 +30,7 @@ const double Mpc=kpc*1000; double beta_func(double r, double n0,double rc,double beta) { - + return abs(n0)*pow(1+r*r/rc/rc,-3./2.*abs(beta)); } @@ -42,7 +42,7 @@ static double calc_critical_density(double z, { const double G=6.673E-8;//cm^3 g^-1 s^2 const double E=std::sqrt(Omega_m*(1+z)*(1+z)*(1+z)+1-Omega_m); - const double H=H0*E; + const double H=H0*E; return 3*H*H/8/pi/G; } @@ -61,7 +61,7 @@ public: { return spl.get_value(x); } - + //we need this function, when this object is performing a clone of itself spline_func_obj* do_clone()const { @@ -74,7 +74,7 @@ public: { spl.push_point(x,y); } - + //before getting the intepolated value, the spline should be initialzied by calling this function void gen_spline() { @@ -93,9 +93,9 @@ int main(int argc,char* argv[]) ifstream cfg_file(argv[1]); assert(cfg_file.is_open()); cfg_map cfg=parse_cfg_file(cfg_file); - + //check the existence of following parameters - + const double z=cfg.z; //initialize the radius list, sbp list and sbp error list @@ -151,7 +151,7 @@ int main(int argc,char* argv[]) { rmin=cfg.rmin_kpc*kpc/cm_per_pixel; } - + cerr<<"rmin="< radii_tmp,sbps_tmp,sbpe_tmp; radii_tmp.resize(radii.size()); @@ -199,7 +199,7 @@ int main(int argc,char* argv[]) cf.add_point(x,y);//change with source } cf.gen_spline(); - + //read temperature profile data spline_func_obj Tprof; int tcnt=0; @@ -224,7 +224,7 @@ int main(int argc,char* argv[]) Tprof.gen_spline(); - + default_data_set,std::vector > ds; ds.add_data(data,std::vector >(radii,sbps,sbpe,sbpe,radii,radii)); @@ -322,7 +322,7 @@ int main(int argc,char* argv[]) ofs_sbp<<"color 3 on 3"<