-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefcl.sh
More file actions
executable file
·68 lines (56 loc) · 2.35 KB
/
makefcl.sh
File metadata and controls
executable file
·68 lines (56 loc) · 2.35 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
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# do *not* source env.sh in this script
if [ $# -ne 4 ]; then
echo Syntax: $(basename $0) analysis_type timestamp gwtimestamp skymap
echo "Where analysis_type is the XXX in ligojob_XXX.fcl"
echo " timestamp is the RFC time to center the analysis on"
echo " gwtimestamp is the RFC time of the GW event"
echo " (Those are the same time for the signal sample)"
echo " skymap is the FITS file"
exit 1
fi
type=$1
rfctime=$2
realgweventtime=$3
skymap=$4
fcl=$(printf ligojob_$type.$rfctime.$realgweventtime.$(basename $skymap).fcl | sed s/:/-/g)
if ! [ -e $SRT_PRIVATE_CONTEXT/job/ligojob_$type.fcl ]; then
echo Analysis type $type not supported
exit 1
fi
fclout=$SRT_PRIVATE_CONTEXT/job/$fcl
#if [ $GWBLIND ]; then
# cat $SRT_PRIVATE_CONTEXT/job/ligojob_$type.fcl | \
# sed "/this_here_ligoanalysis: @local/a this_here_ligoanalysis.GWEventTime: \"$rfctime\"\
# \nthis_here_ligoanalysis.NeedBGEventTime: \"$realgweventtime\"\
# \nthis_here_ligofilter.GWEventTime: \"$rfctime\"" > $fclout
#else
cat $SRT_PRIVATE_CONTEXT/job/ligojob_$type.fcl | \
sed "/this_here_ligoanalysis: @local/a this_here_ligoanalysis.GWEventTime: \"$rfctime\"\
\nthis_here_ligoanalysis.NeedBGEventTime: \"$realgweventtime\"\
\nthis_here_ligofilter.GWEventTime: \"$rfctime\"\
\nthis_here_ligoanalysis.SkyMap: \"$skymap\"" > $fclout
#fi
if grep -q "eliminatebeam.spillfile: " $fclout; then
spilldir=/pnfs/nova/users/mstrait/spills
spillbase=spills-*-${rfctime}.txt
if ! ls $spilldir/$spillbase &> /dev/null; then
echo Could not find a spill list file like
echo $spilldir/$spillbase
echo You cannot pass, flame of Udun, unless you run a job to
echo make the spill file first.
exit 1
fi
spillfile=$(ls $spilldir/$spillbase | head -n 1)
if [ $(ls $spilldir/$spillbase | wc -l) -gt 1 ]; then
echo Found more than one spill file with the same timestamp
echo I do not know what is up with that. Using the first one.
fi
echo Using $spillfile
# Use the base name only here since the grid will ship to to the PWD
sed -i '/eliminatebeam.spillfile/s/".*"/"'$(basename $spillfile)'"/' $fclout
fi
echo $fclout created. Here it is:
echo ========================== BEGIN FCL FILE ==========================
cat $fclout
echo =========================== END FCL FILE ===========================