diff options
author | Aaron LI <aly@aaronly.me> | 2017-10-31 16:42:33 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-10-31 16:42:33 +0800 |
commit | 4f7b3f173bf14d56272e0b56814eeb08ea0c9c6c (patch) | |
tree | 4d3e3c459a33aff388de8c8877335176fc6e9c79 /scripts | |
parent | a1d4cb4b6d637112aa97249b8150e8236002f09f (diff) | |
download | chandra-acis-analysis-4f7b3f173bf14d56272e0b56814eeb08ea0c9c6c.tar.bz2 |
scripts/ciao_calc_ct.sh: Update to use "cosmo_calc.py"
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ciao_calc_ct.sh | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/scripts/ciao_calc_ct.sh b/scripts/ciao_calc_ct.sh index 4b47c90..78b9782 100755 --- a/scripts/ciao_calc_ct.sh +++ b/scripts/ciao_calc_ct.sh @@ -427,10 +427,8 @@ export PFILES="./:${PFILES}" ### main ### -## D_A {{{ -D_A_CM=`cosmo_calc ${REDSHIFT} | \grep -i 'd_a.*cm' | awk -F'=' '{ print $2 }' | awk '{ print $1 }'` -printf "D_A_CM(${REDSHIFT})= ${D_A_CM}\n" -## D_A }}} +D_A_CM=`cosmo_calc.py -b --unit cm --angular-diameter-distance ${REDSHIFT}` +printf "DA(${REDSHIFT}): ${D_A_CM} [cm]\n" ## region related {{{ ## generate the needed region file @@ -523,8 +521,8 @@ cat > ${XSPEC_SCRIPT} << _EOF_ ## XSPEC script ## spectrum analysis to get the average temperatue with (0-0.048 R500) ## -## generated by: \``basename $0`' -## date: \``date`' +## generated by: `basename $0` +## date: `date` ## # xspec settings @@ -572,22 +570,22 @@ proc calc_cooling_time {} { tclout param 5 set norm [ lindex \$xspec_tclout 0 ] newpar 1 0 - dummyrsp .001 100 - flux .001 100 + dummyrsp 0.001 100 + flux 0.001 100 tclout flux set flux [ lindex \$xspec_tclout 0 ] - puts "flux(0.01-100kev): \$flux" - set rout_cm [ expr \$rout*.492/3600/180*3.14159*\$d_a_cm ] + puts "flux(0.01-100keV): \$flux" + set rout_cm [ expr \$rout*0.492/3600/180*3.14159*\$d_a_cm ] set V [ expr 4./3.*3.14159*\$rout_cm*\$rout_cm*\$rout_cm ] - set nenh [ expr \$norm*1E14*4*3.14159*\$d_a_cm*\$d_a_cm*(1+\$z)*(1+\$z)*(1+\$z)*(1+\$z)/\$V ] + set nenh [ expr \$norm*1e14*4*3.14159*\$d_a_cm*\$d_a_cm*(1+\$z)*(1+\$z)*(1+\$z)*(1+\$z)/\$V ] set d_l_cm [ expr \$d_a_cm*(1+\$z)*(1+\$z) ] set ne_np_ratio 1.2 set ne [ expr sqrt(\$nenh*\$ne_np_ratio) ] set lx [ expr \$flux*4*3.14159*\$d_l_cm*\$d_l_cm ] - set kb 1.602E-9 + set kb 1.602e-9 set ct [ expr 3./2.*(\$ne+\$ne/\$ne_np_ratio)*\$kb*\$T*\$V/\$lx ] - set ct_gyr [ expr \$ct/(3600*24*365.25*1E9) ] + set ct_gyr [ expr \$ct/(3600*24*365.25*1e9) ] puts "Cooling_time= \$ct_gyr Gyr" } |