aboutsummaryrefslogtreecommitdiffstats
path: root/mass_profile/csb_calc_lwt.sh
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-06-08 21:53:00 +0800
committerAaron LI <aaronly.me@gmail.com>2016-06-08 21:53:00 +0800
commitf3dad5a208cace4864ee7c4da94da0f279260a4a (patch)
tree108aaee2b647ad22e959050f34d8f5eb81371fef /mass_profile/csb_calc_lwt.sh
parent72d081047196660fc3c657b475b77466ab9f35c0 (diff)
downloadchandra-acis-analysis-f3dad5a208cace4864ee7c4da94da0f279260a4a.tar.bz2
Merge branch 'cosmo_calc'
Diffstat (limited to 'mass_profile/csb_calc_lwt.sh')
-rwxr-xr-xmass_profile/csb_calc_lwt.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/mass_profile/csb_calc_lwt.sh b/mass_profile/csb_calc_lwt.sh
index fa6e654..381c545 100755
--- a/mass_profile/csb_calc_lwt.sh
+++ b/mass_profile/csb_calc_lwt.sh
@@ -1,10 +1,6 @@
#!/bin/sh
#
-# 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
+# for 'z>0.3' or 'counts_in_0.048R500<500'
#
ERR_CALC=1
@@ -13,6 +9,16 @@ 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'
@@ -109,7 +115,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)"