Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuasatakayuki/7b622096bcb8443c413b to your computer and use it in GitHub Desktop.
Save yuasatakayuki/7b622096bcb8443c413b to your computer and use it in GitHub Desktop.
Suzaku/XIS powerspectrum calculation example (using interval-sliced event files)
# Calculates powerspectra of each interval
binTime=32
nbint=128
nintfm=20
function doProcess(){
if [ `hsStringIndex $outputFile 45` = -1 ]; then
xLabel="lab nx off"
else
xLabel=""
fi
rm -f `dirname $outputFile`/`basename $outputFile`.qdp
rm -f `dirname $outputFile`/`basename $outputFile`.pco
powspec cfile1="$eventFile" window="-" dtnb=${binTime} nbint=${nbint} nintfm=${nintfm} rebin=0 plot=yes plotdev="/xw" outfile="$outputFile" << EOF
la t
la f
lw 3 on 1..10
lw 3
view 0.1 0.1 0.9 0.4
lab 2 "
lab 1 "
$xLabel
hard `dirname $outputFile`/`basename $outputFile .fps`.ps/cps
we `dirname $outputFile`/`basename $outputFile .fps`
EOF
}
eventFile=../data/fi_evt_src_interval_0.evt
outputFile=powerspectra/interval_0_bin${binTime}_${nbint}.fps
doProcess
eventFile=../data/fi_evt_src_interval_1.evt
outputFile=powerspectra/interval_1_bin${binTime}_${nbint}.fps
doProcess
eventFile=../data/fi_evt_src_interval_23.evt
outputFile=powerspectra/interval_23_bin${binTime}_${nbint}.fps
doProcess
eventFile=../data/fi_evt_src_interval_45.evt
outputFile=powerspectra/interval_45_bin${binTime}_${nbint}.fps
doProcess
cd powerspectra
hsPS2PDFAll
for file in `ls interval*pdf`; do
pdfcrop $file $file
done
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment