-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathamoy-powerlaw.sh
More file actions
58 lines (48 loc) · 1.3 KB
/
Copy pathamoy-powerlaw.sh
File metadata and controls
58 lines (48 loc) · 1.3 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#-----------------------------------------------
#-----------------------------------------------
### Define user-paths for convenience
export DATAFOLDER=/home/amoy/xnav/nicer-data/B1937+21
export CODESFOLDER=/home/amoy/xnav/codes
#-----------------------------------------------
#-----------------------------------------------
### Loop over the ObsIds in the data set,
### and merge the various files required for
### making the pulse profile
mapfile -t < $CODESFOLDER/obsids.txt # get list of ObsIDs as array
for i in "${MAPFILE[@]}"
do
cd $DATAFOLDER
export CWD=$DATAFOLDER/$i # Current Working Directory
export CURAUX=$CWD/auxil # Current auxil Directory
export CURXTI=$CWD/xti # Current xti Directory
echo
echo "--------------------------------------------------------"
echo "*******Looping ... Currently processing ObsID $i*******"
echo "--------------------------------------------------------"
echo
# Find the _load.xcm file
LOAD_XCM=$(find "$CURXTI/event_cl" -type f -name "*_load.xcm")
if [[ -f "$LOAD_XCM" ]]; then
xspec <<EOF
@$LOAD_XCM
cd $i
model phabs(powerlaw)
/*
renorm
ignore bad
cpd powerlaw-$i.ps/cps
plot ldata chi
fit
y
y
y
n
plot data resid
cpd none
exit
EOF
else
echo "File *_load.xcm not found for ObsID $i"
fi
done