From ffd178e0bd72562a3c2cff9747b6e656edc881dc Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 27 May 2016 22:47:24 +0800 Subject: 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. --- mass_profile/try_beta.sh | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100755 mass_profile/try_beta.sh (limited to 'mass_profile/try_beta.sh') 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</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</dev/null + +mv dbeta_param.txt sbp_param.txt -- cgit v1.2.2