diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-02-21 23:32:01 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-21 23:32:01 +0800 |
commit | 04683a56e493133086193bba2f85ac0f7b5d4a81 (patch) | |
tree | 460b55dc361e812e5331b58fc5ec29e55702df35 | |
parent | a25e7664ae76d699533a5cbd92f38b45c2fba72a (diff) | |
download | chandra-acis-analysis-04683a56e493133086193bba2f85ac0f7b5d4a81.tar.bz2 |
fit_{mass,sbp}.sh: Update to use 'calc_coolfunc_{table,profile}.py'
-rwxr-xr-x | bin/fit_mass.sh | 13 | ||||
-rwxr-xr-x | bin/fit_sbp.sh | 10 |
2 files changed, 17 insertions, 6 deletions
diff --git a/bin/fit_mass.sh b/bin/fit_mass.sh index 8df5966..e4e0614 100755 --- a/bin/fit_mass.sh +++ b/bin/fit_mass.sh @@ -74,6 +74,8 @@ z=`grep '^z' ${sbp_cfg} | awk '{ print $2 }'` cm_per_pixel=`cosmo_calc.py -b --cm-per-pixel ${z}` sed -i'' "s/^cm_per_pixel.*$/cm_per_pixel ${cm_per_pixel}/" ${sbp_cfg} +cfunc_table="coolfunc_table_photon.txt" + if grep -q '^beta2' $sbp_cfg; then MODEL="dbeta" MODEL_NAME="double-beta" @@ -94,8 +96,12 @@ cp -fv ${tprofile_dump} ${tprofile} mv -fv ${tprofile_dump} ${tprofile_center} mv -fv fit_result.qdp ${tprofile_fit_center} -${base_path}/calc_coolfunc.sh ${tprofile_center} \ - ${abund} ${nh} ${z} ${cfunc_profile} +if [ ! -f ${cfunc_table} ]; then + ${base_path}/calc_coolfunc_table.py -Z ${abund} -n ${nh} -z ${z} \ + -u photon -o ${cfunc_table} +fi +${base_path}/calc_coolfunc_profile.py -C -t ${cfunc_table} \ + -T ${tprofile_center} -o ${cfunc_profile} cfunc_profile_center="coolfunc_profile_center.txt" cp -f ${cfunc_profile} ${cfunc_profile_center} @@ -163,7 +169,8 @@ for i in `seq 1 ${MC_TIMES}`; do printf "## ${i} / ${MC_TIMES} ##\n" printf "## `pwd -P` ##\n" - ${base_path}/calc_coolfunc.sh ${tprofile} ${abund} ${nh} ${z} ${cfunc_profile} + ${base_path}/calc_coolfunc_profile.py -C -t ${cfunc_table} \ + -T ${tprofile} -o ${cfunc_profile} ${base_path}/${PROG_SBPFIT} ${TMP_SBP_CFG} 2> /dev/null cat ${RES_SBPFIT} ${base_path}/fit_nfw_mass mass_int.dat ${z} ${nfw_rmin_kpc} 2> /dev/null diff --git a/bin/fit_sbp.sh b/bin/fit_sbp.sh index 9e98bc4..679caf6 100755 --- a/bin/fit_sbp.sh +++ b/bin/fit_sbp.sh @@ -41,6 +41,8 @@ sed -i'' "s/^cm_per_pixel.*$/cm_per_pixel ${cm_per_pixel}/" ${sbp_cfg} cfunc_profile=`grep '^cfunc_profile' ${sbp_cfg} | awk '{ print $2 }'` tprofile=`grep '^tprofile' ${sbp_cfg} | awk '{ print $2 }'` +cfunc_table="coolfunc_table_photon.txt" + if grep -q '^beta2' ${sbp_cfg}; then MODEL="double-beta" PROG=fit_dbeta_sbp @@ -52,10 +54,12 @@ fi ${base_path}/fit_wang2012_model ${tprofile_data} ${tprofile_cfg} \ ${cm_per_pixel} 2> /dev/null cp wang2012_dump.qdp ${tprofile} -if [ ! -f ${cfunc_profile} ]; then - ${base_path}/calc_coolfunc.sh ${tprofile} ${abund} ${nh} ${z} \ - ${cfunc_profile} +if [ ! -f ${cfunc_table} ]; then + ${base_path}/calc_coolfunc_table.py -Z ${abund} -n ${nh} -z ${z} \ + -u photon -o ${cfunc_table} fi +${base_path}/calc_coolfunc_profile.py -C -t ${cfunc_table} -T ${tprofile} \ + -o ${cfunc_profile} ${base_path}/${PROG} ${sbp_cfg} echo "## MODEL: ${MODEL}" echo "## z: ${z}" |