-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathamoy-powerspectrum.sh
More file actions
55 lines (47 loc) · 1.38 KB
/
Copy pathamoy-powerspectrum.sh
File metadata and controls
55 lines (47 loc) · 1.38 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
#!/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
nicerl3-lc $i pirange=300-1500 timebin=60.0 bkgmodeltype=scorpeon clobber=YES
LOAD_LC=$(find "$CURXTI/event_cl" -type f -name "*_sr.lc")
LC_FILE=$(find "$CURXTI/event_cl" -type f -name "*_sr.lc" -exec basename {} \; | tr '\n' ' ')
if [[ -f "$LOAD_LC" ]]; then
cd $CURXTI/event_cl
powspec <<EOF
$LC_FILE
-
INDEF
INDEF
INDEF
0
default
yes
/XW
color 2 on 2
cpd $i.gif/gif
p
quit
EOF
else
echo "File *_sr.lc not found for ObsID $i"
fi
done