aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-06-08 21:43:13 +0800
committerAaron LI <aaronly.me@outlook.com>2016-06-08 21:43:13 +0800
commit72d081047196660fc3c657b475b77466ab9f35c0 (patch)
tree7eb477c75925e9216fb729eb3f68cebc70fa97ce
parent2b0f09e67850089441ce4e3cb9f3aaa28beee067 (diff)
parentc955606936374ac4be7d52aff99cbea7ae844ccd (diff)
downloadchandra-acis-analysis-72d081047196660fc3c657b475b77466ab9f35c0.tar.bz2
Merge branch 'cosmo_calc'
-rwxr-xr-xmass_profile/cooling_time2.sh52
-rwxr-xr-xmass_profile/csb_calc_lwt.sh18
2 files changed, 26 insertions, 44 deletions
diff --git a/mass_profile/cooling_time2.sh b/mass_profile/cooling_time2.sh
index cb0a55e..775e175 100755
--- a/mass_profile/cooling_time2.sh
+++ b/mass_profile/cooling_time2.sh
@@ -2,38 +2,26 @@
#
unalias -a
export LC_COLLATE=C
-###########################################################
-## based on `ciao_r500avgt' ##
-## for calculating the `cooling time ' ##
-## within (0.-0.048 r500) region ##
-## ##
-## Junhua Gu ##
-## August 22, 2012 ##
-## ##
-## LIweitiaNux ##
-## 2013/04/28 ##
-###########################################################
-
-###########################################################
-## ChangeLogs
-###########################################################
-
-## comology calculator {{{
-## XXX: MODIFY THIS TO YOUR OWN CASE
-## and make sure this `calc' is executable
-## NOTES: use `$HOME' instead of `~' in path
-BASE_PATH=`dirname $0`
-# COSCALC="`which cosmo_calc calc_distance | head -n 1`"
-COSCALC="${BASE_PATH}/calc_distance"
-if [ -z "${COSCALC}" ] || [ ! -x ${COSCALC} ]; then
- printf "ERROR: \`COSCALC: ${COSCALC}' neither specified nor executable\n"
- exit 255
-fi
-## }}}
+##
+## based on `ciao_r500avgt'
+## for calculating the `cooling time'
+## within (0.-0.048 r500) region
+##
+## Junhua Gu
+## August 22, 2012
+##
+## Weitian LI
+## 2013-04-28
+##
+##
+## Change logs:
+## 2016-05-28:
+## * Remove 'COSCALC', just use 'cosmo_calc'
+##
## about, used in `usage' {{{
-VERSION="v1.1"
-UPDATE="2012-08-26"
+VERSION="v2.0"
+UPDATE="2016-05-28"
## about }}}
## error code {{{
@@ -242,7 +230,7 @@ case "${R500_UNI}" in
;;
*)
printf "## units in \`kpc', convert to \`Chandra pixel'\n" | ${TOLOG}
- KPC_PER_PIX=`${COSCALC} ${REDSHIFT} | grep 'kpc.*pix' | tr -d 'a-zA-Z_#=(),:/ '`
+ KPC_PER_PIX=`cosmo_calc ${REDSHIFT} | grep 'kpc.*pix' | tr -d 'a-zA-Z_#=(),:/ '`
# convert scientific notation for `bc'
KPC_PER_PIX_B=`echo ${KPC_PER_PIX} | sed 's/[eE]/\*10\^/' | sed 's/+//'`
printf "## calculated \`kpc/pixel': ${KPC_PER_PIX_B}\n"
@@ -407,7 +395,7 @@ printf "## use grppha cmd: \`${GRP_CMD}'\n" | ${TOLOG}
##################################################
#### main
## D_A
-D_A_CM=`${COSCALC} ${REDSHIFT} | grep '^d_a_cm' | awk '{ print $2 }'`
+D_A_CM=`cosmo_calc ${REDSHIFT} | grep 'Angular_diameter_distance' | awk -F'[=,]' '{ print $2 }' | tr -d '[cm] '
printf "D_A_CM(${REDSHIFT})= ${D_A_CM}\n"
## region related {{{
diff --git a/mass_profile/csb_calc_lwt.sh b/mass_profile/csb_calc_lwt.sh
index 381c545..fa6e654 100755
--- a/mass_profile/csb_calc_lwt.sh
+++ b/mass_profile/csb_calc_lwt.sh
@@ -1,6 +1,10 @@
#!/bin/sh
#
-# for 'z>0.3' or 'counts_in_0.048R500<500'
+# Calculate the surface brightness concentration (C_SB) for objects
+# meet the conditions: 'z>0.3' or 'counts_in_0.048R500<500'.
+#
+# Aaron LI
+# Updated: 2016-05-28
#
ERR_CALC=1
@@ -9,16 +13,6 @@ ERR_JSON=3
ERR_Z=4
ERR_CNT=5
-## cosmology claculator {{{
-## write the path of cosmo claculator here
-BASE_PATH=`dirname $0`
-COSMO_CALC="${BASE_PATH}/cosmo_calc"
-if [ -z "${COSMO_CALC}" ] || [ ! -x ${COSMO_CALC} ] ; then
- printf "ERROR: ${COSMO_CALC} neither executable nor specified\n"
- exit ${ERR_CALC}
-fi
-## }}}
-
# default basedir relative to 'spc/profile'
DFT_BASEDIR="../.."
# default imgdir relative to 'basedir'
@@ -115,7 +109,7 @@ if [ `echo "${Z} < 0.3" | bc -l` -eq 1 ]; then
# exit ${ERR_Z}
fi
-KPC_PER_PIXEL=`${COSMO_CALC} ${Z} | grep 'kpc/pixel' | awk '{ print $3 }'`
+KPC_PER_PIXEL=`cosmo_calc ${Z} | grep 'kpc/pixel' | awk '{ print $3 }'`
RC_PIX=`echo "scale=2; 0.048 * ${R500} / ${KPC_PER_PIXEL}" | bc -l`
# test counts_in_0.048R500<500?
RC_REG="pie(${X},${Y},0,${RC_PIX},0,360)"