From 3da99b5716ecad5fb97c6f979e267ba10a6f6276 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 16 Feb 2017 23:36:41 +0800 Subject: Remove 'calc_lx.cpp' (superseded by calc_lx_{beta,dbeta}.cpp) --- mass_profile/Makefile | 5 +- mass_profile/calc_lx.cpp | 218 ----------------------------------------------- 2 files changed, 1 insertion(+), 222 deletions(-) delete mode 100644 mass_profile/calc_lx.cpp (limited to 'mass_profile') diff --git a/mass_profile/Makefile b/mass_profile/Makefile index 3bf9aa0..4f037e6 100644 --- a/mass_profile/Makefile +++ b/mass_profile/Makefile @@ -25,7 +25,7 @@ OPT_UTIL_INC ?= -I../opt_utilities TARGETS= fit_nfw_sbp fit_dbeta_sbp fit_beta_sbp \ fit_direct_beta calc_distance fit_wang2012_model \ - fit_nfw_mass calc_lx fit_mt_pl fit_lt_pl fit_mt_bpl \ + fit_nfw_mass fit_mt_pl fit_lt_pl fit_mt_bpl \ fit_lt_bpl cooling_time calc_lx_dbeta calc_lx_beta HEADERS= projector.hpp spline.hpp vchisq.hpp @@ -51,9 +51,6 @@ fit_nfw_mass: fit_nfw_mass.o fit_direct_beta: fit_direct_beta.o $(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC) -calc_lx: calc_lx.o calc_distance.o - $(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC) - calc_lx_dbeta: calc_lx_dbeta.o beta_cfg.o report_error.o $(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC) diff --git a/mass_profile/calc_lx.cpp b/mass_profile/calc_lx.cpp deleted file mode 100644 index 21a508c..0000000 --- a/mass_profile/calc_lx.cpp +++ /dev/null @@ -1,218 +0,0 @@ -#include "calc_distance.h" -#include "spline.hpp" -#include -#include -#include -#include -#include -#include -#include -#include "methods/aga/aga.hpp" -#include -#include -using namespace std; -using namespace opt_utilities; - - -static const double cm=1; -static const double s=1; -static const double km=1000*100; -static const double Mpc=3.08568e+24*cm; -static const double kpc=3.08568e+21*cm; -static const double yr=365.*24.*3600.; -static const double Gyr=1e9*yr; -static const double H=71.*km/s/Mpc; -static const double c=299792458.*100.*cm; -//const double c=3e8*100*cm; -static const double pi=4*atan(1); -static const double omega_m=0.27; -static const double omega_l=0.73; -static const double arcsec2arc_ratio=1./60/60/180*pi; - -double std_norm_rand() -{ - double u=0; - double v=0; - while(u<=0||v<=0) - { - u=rand()/(double)RAND_MAX; - rand(); - v=rand()/(double)RAND_MAX; - } - double x=std::sqrt(-log(u))*cos(2*pi*v); - return x; -} - - -int main(int argc,char* argv[]) -{ - srand(time(0)); - if(argc<5) - { - cerr<<"Usage:"< [Tprofile.dat]"<0); - double d_a_cm=c/H*calc_angular_distance(z); - double d_l_cm=(1+z)*(1+z)*d_a_cm; - double cm_per_pixel=d_a_cm*.492*arcsec2arc_ratio; - ////////////////////////////// - //perform a 1-beta fitting//// - ////////////////////////////// - fitter,double,string> f; - - f.set_statistic(chisq,double,string>()); - f.set_opt_method(powell_method >()); - f.set_model(beta1d()); - dl_x_xe_y_ye dl; - ifstream ifs(argv[1]); - ifs>>dl; - f.load_data(dl.get_data_set()); - f.fit(); - double rmin=f.get_data_set().get_data(0).get_x(); - double rmax=f.get_data_set().get_data(f.get_data_set().size()-1).get_x(); - ofstream lx_fit_result("lx_fit_result.qdp"); - lx_fit_result<<"read terr 1 2\nskip single\n"; - for(size_t i=0;i ds(dl.get_data_set()); - opt_utilities::default_data_set ds1; - for(size_t i=0;i(xc,newy,ye,ye,xe,xe)); - } - f.load_data(ds1); - chisq,double,string> c; - //c.verbose(true); - f.set_statistic(c); - f.fit(); - vector p=f.get_all_params(); - //cout<>r>>re>>t>>te; - if(!ifs_tfile.good()) - { - break; - } - cnt+=1; - mean_T+=t; - mean_Te+=te*te; - } - mean_T/=cnt; - mean_Te/=cnt; - mean_Te=std::sqrt(mean_Te); - if(mean_Te>mean_T) - { - mean_Te=mean_T; - } - std_l2=mean_Te/mean_T*lx; - //cout<