-
Notifications
You must be signed in to change notification settings - Fork 0
/
optbinnocounts.sh
34 lines (29 loc) · 897 Bytes
/
optbinnocounts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Define the paths and parameters
indir="/home/sathvik/nicer/PSR_B0531+21/1013010115/xti/event_cl"
infile="$indir/myspectrum.pha"
outfile="$indir/myspectrum_grpopt.pha"
respfile="$indir/ni1013010115mpu7.rmf"
grouptype="opt"
# Run the ftgrouppha command
ftgrouppha "$infile" "$outfile" grouptype="$grouptype" respfile="$respfile"
# Check the status of the ftgrouppha command
if [ $? -eq 0 ]; then
echo "ftgrouppha executed successfully. Output file: $outfile"
else
echo "ftgrouppha failed. Please check the input parameters."
exit 1
fi
# Run XSPEC to load and plot the grouped spectrum
xspec <<EOF
data $outfile
cpd /xs
plot ldata
quit
EOF
# Check the status of the XSPEC plot
if [ $? -eq 0 ]; then
echo "XSPEC plot generated successfully for grouped spectrum file $outfile."
else
echo "XSPEC plot generation failed. Please check the grouped spectrum file."
fi