2015年2月12日木曜日

bach script to run fake in XSPEC

(2015-02-12 for ASTRO-H/SXS simulation)

#!/bin/bash
# run xspec
# fake spectra

#
this=fake1

# input
model_xcm=$1
t_exp=$2
outdir=$3

# responses
resp=${SXS_RMF}
arf=${SXS_ARF}

# grppha 2bin = 2eV
bin=2

# output
log=${outdir}/xspec.log
out=${outdir}/${this}.fak
out_bin=${out}.${bin}eVgrp
ps=${outdir}/${this}.ps

if [ -e ${out} ]; then
    rm -rf${out} ${out_bin}
fi

if [ ! -e ${outdir} ]; then
    mkdir -p ${outdir}
fi

# xspec will run here

xspec <
@${model_xcm}

fakeit none
${resp}
${arf}
y
fake
${out}
${t_exp}

## grouping ##
grppha ${out} ${out_bin}
group 0 16383 $bin
exit

## check flux

log ${log}
show all
flux 0.5 10
flux 6.61 6.71
ig 0.0-6.61 6.71-**
show data
log none
no 1-**

cpd /xs
setp com log x off
setp com r x 6.48 6.82
setp com la f ${outdir}/${out_bin}
setp com la t "exp=${t_exp} secs"
setp com fo ro
setp com cs 1.3

setp ene
plot d
cpd ${ps}/vps
plot d
cpd /xs
quit
y

EOF

ls ${outdir}














0 件のコメント:

コメントを投稿