aboutsummaryrefslogtreecommitdiffstats
path: root/mass_profile/try_beta.sh
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-05-27 22:47:24 +0800
committerAaron LI <aaronly.me@gmail.com>2016-05-27 22:47:24 +0800
commitffd178e0bd72562a3c2cff9747b6e656edc881dc (patch)
tree8800b7b5b2e8bc3df1a6760df5cd54eaaa686702 /mass_profile/try_beta.sh
parent5c35fad9240fb42c1371c721e0b2af7379bd9ea0 (diff)
downloadchandra-acis-analysis-ffd178e0bd72562a3c2cff9747b6e656edc881dc.tar.bz2
Add mass_profile tools
* These tools are mainly use to calculate the total gravitational mass profile, as well as the intermediate products (e.g., surface brightness profile fitting, gas density profile, NFW fitting, etc.) * There are additional tools for calculating the luminosity and flux. * These tools mainly developed by Junhua GU, and contributed by Weitian (Aaron) LI, and Zhenghao ZHU.
Diffstat (limited to 'mass_profile/try_beta.sh')
-rwxr-xr-xmass_profile/try_beta.sh86
1 files changed, 86 insertions, 0 deletions
diff --git a/mass_profile/try_beta.sh b/mass_profile/try_beta.sh
new file mode 100755
index 0000000..8848c26
--- /dev/null
+++ b/mass_profile/try_beta.sh
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+tmp_beta_cfg="_tmp_beta.cfg"
+tmp_dbeta_cfg="_tmp_dbeta.cfg"
+base_path=`dirname $0`
+rm -f $tmp_beta_cfg
+rm -f $tmp_dbeta_cfg
+
+
+
+if [ $# -lt 1 ]
+then
+ for i in radius_file sbp_file cfunc_file T_file
+ do
+ file=`zenity --file-selection --title="$i"`
+ echo $i $file >>$tmp_beta_cfg
+ done
+
+ for i in n0 rc beta bkg cm_per_pixel z
+ do
+ value=`zenity --entry --text="entry initial value for $i"`
+ echo $i $value >>$tmp_beta_cfg
+ done
+else
+ cp $1 $tmp_beta_cfg
+fi
+
+rfile=`grep radius_file $tmp_beta_cfg|awk '{print $2}'`
+sfile=`grep sbp_file $tmp_beta_cfg|awk '{print $2}'`
+cfile=`grep cfunc_file $tmp_beta_cfg|awk '{print $2}'`
+tfile=`grep T_file $tmp_beta_cfg|awk '{print $2}'`
+
+$base_path/fit_beta_sbp $tmp_beta_cfg
+rm -f pgplot.gif
+qdp sbp_fit.qdp<<EOF
+/null
+log
+plot
+cpd pgplot.gif/gif
+plot
+quit
+EOF
+
+eog pgplot.gif&
+sleep 3
+kill $! >/dev/null
+
+if zenity --question --text="single beta ok?"
+then
+ mv beta_param.txt sbp_param.txt
+ exit
+fi
+
+if [ $# -lt 2 ]
+then
+ echo radius_file $rfile >>$tmp_dbeta_cfg
+ echo sbp_file $sfile >>$tmp_dbeta_cfg
+ echo cfunc_file $cfile >>$tmp_dbeta_cfg
+ echo T_file $tfile >>$tmp_dbeta_cfg
+
+
+ for i in cm_per_pixel z n01 rc1 beta1 n02 rc2 beta2 bkg
+ do
+ value=`zenity --entry --text="entry initial value for $i"`
+ echo $i $value >>$tmp_dbeta_cfg
+ done
+else
+ cp $2 $tmp_dbeta_cfg
+fi
+
+
+$base_path/fit_dbeta_sbp5 $tmp_dbeta_cfg
+rm -f pgplot.gif
+qdp sbp_fit.qdp<<EOF
+/null
+log
+plot
+cpd pgplot.gif/gif
+plot
+quit
+EOF
+eog pgplot.gif&
+sleep 3
+kill $! >/dev/null
+
+mv dbeta_param.txt sbp_param.txt