aboutsummaryrefslogtreecommitdiffstats
path: root/mass_profile
diff options
context:
space:
mode:
Diffstat (limited to 'mass_profile')
-rwxr-xr-xmass_profile/calc_coolfunc.sh14
-rwxr-xr-xmass_profile/calc_coolfunc_bands.sh15
-rwxr-xr-xmass_profile/calc_lxfx.sh8
3 files changed, 22 insertions, 15 deletions
diff --git a/mass_profile/calc_coolfunc.sh b/mass_profile/calc_coolfunc.sh
index f67f8c2..d1d0b35 100755
--- a/mass_profile/calc_coolfunc.sh
+++ b/mass_profile/calc_coolfunc.sh
@@ -4,6 +4,13 @@
## given 'temperature profile' and the average abundance, redshift,
## and column density nH, using the XSPEC model 'wabs*apec'.
##
+## NOTE:
+## The output cooling function values should be the 'flux' values
+## with unit 'photon/s/cm^2' (different to 'calc_coolfunc_bands.sh').
+## These results will be used by 'fit_{beta,dbeta}_sbp' to derive the
+## (3D) gas density profile from (2D) surface brightness profile,
+## whose values have unit 'photon/cm^2/pixel/s'.
+##
## Weitian LI
## Created: 2012-08-17
##
@@ -35,13 +42,11 @@ fi
[ -e "${COOLFUNC_DAT}" ] && rm -f ${COOLFUNC_DAT}
## arguments }}}
-## specify variable name outside while loop
-## otherwise the inside vars invisible
XSPEC_CF_XCM="_calc_coolfunc.xcm"
[ -e "${XSPEC_CF_XCM}" ] && rm -f ${XSPEC_CF_XCM}
## generate xspec script {{{
-cat >> ${XSPEC_CF_XCM} << _EOF_
+cat > ${XSPEC_CF_XCM} << _EOF_
## XSPEC Tcl script
## Calculate the cooling function profile w.r.t the temperature profile.
##
@@ -80,9 +85,6 @@ if { [ file exists \${cf_fn} ] } {
set tpro_fd [ open \${tpro_fn} r ]
set cf_fd [ open \${cf_fn} w ]
-_EOF_
-
-cat >> ${XSPEC_CF_XCM} << _EOF_
## read data from tprofile line by line
while { [ gets \${tpro_fd} tpro_line ] != -1 } {
scan \${tpro_line} "%f %f" radius temperature
diff --git a/mass_profile/calc_coolfunc_bands.sh b/mass_profile/calc_coolfunc_bands.sh
index 9fa0196..bebdce2 100755
--- a/mass_profile/calc_coolfunc_bands.sh
+++ b/mass_profile/calc_coolfunc_bands.sh
@@ -5,8 +5,14 @@
## and the average abundance, redshift, and column density nH, using the
## XSPEC model 'wabs*apec'.
##
+## NOTE:
+## To calculate the luminosity and flux from the source using the
+## 'calc_lx_{beta,dbeta}', set 'nH=0'.
+## Also the output cooling function values should be the 'flux' values
+## with unit 'erg/s/cm^2'.
+##
## Weitian LI
-## Updated: 2016-06-08
+## Updated: 2017-02-17
##
## cmdline arguments {{{
@@ -29,13 +35,11 @@ if [ ! -r "${TPROFILE}" ]; then
fi
## arguments }}}
-## specify variable name outside while loop
-## otherwise the inside vars invisible
XSPEC_CF_XCM="_calc_coolfunc_bands.xcm"
[ -e "${XSPEC_CF_XCM}" ] && rm -f ${XSPEC_CF_XCM}
## generate xspec script {{{
-cat >> ${XSPEC_CF_XCM} << _EOF_
+cat > ${XSPEC_CF_XCM} << _EOF_
## XSPEC Tcl script
## Calculate the cooling function profile w.r.t the temperature profile,
## for each specified energy band.
@@ -61,8 +65,7 @@ query yes
abund grsa
dummyrsp 0.01 100.0 4096 linear
# load model 'wabs*apec' to calc cooling function
-# (nh=0.0: do not consider aborption ???)
-model wabs*apec & 0.0 & 1.0 & \${abundance} & \${redshift} & \${norm} &
+model wabs*apec & \${nh} & 1.0 & \${abundance} & \${redshift} & \${norm} &
## xspec }}}
## set input and output filename
diff --git a/mass_profile/calc_lxfx.sh b/mass_profile/calc_lxfx.sh
index a8cb053..f1954db 100755
--- a/mass_profile/calc_lxfx.sh
+++ b/mass_profile/calc_lxfx.sh
@@ -47,7 +47,6 @@ esac
base_path=$(dirname $(realpath $0))
## Extract settings/values from the config file
-nh=`grep '^nh' ${mass_cfg} | awk '{ print $2 }'`
abund=`grep '^abund' ${mass_cfg} | awk '{ print $2 }'`
tprofile_data=`grep '^tprofile_data' ${mass_cfg} | awk '{ print $2 }'`
tprofile_cfg=`grep '^tprofile_cfg' ${mass_cfg} | awk '{ print $2 }'`
@@ -79,8 +78,11 @@ bolo
0.1 2.4
_EOF_
+# NOTE:
+# Set 'nh=0' when calculating the cooling function values, and use the
+# value given by 'flux' with unit 'erg/s/cm^2'.
${base_path}/calc_coolfunc_bands.sh ${tprofile} ${abund} \
- ${nh} ${z} "cfunc_" ${BLIST}
+ 0 ${z} "cfunc_" ${BLIST}
PROG="calc_lx_${MODEL}"
LXF_RES="lx_${MODEL}_param.txt"
@@ -139,7 +141,7 @@ for i in `seq 1 ${MC_TIMES}`; do
echo "### `pwd -P`"
echo "### ${i} / ${MC_TIMES} ###"
${base_path}/calc_coolfunc_bands.sh ${tprofile} ${abund} \
- ${nh} ${z} "cfunc_" ${BLIST}
+ 0 ${z} "cfunc_" ${BLIST}
${base_path}/${PROG} ${TMP_SBP_CFG} ${rout} \
cfunc_bolo.dat \
cfunc_0.7-7.dat \