ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/workflow/scripts/update_hmi.Marmask.csh
Revision: 1.2
Committed: Thu Feb 16 20:32:38 2012 UTC (11 years, 7 months ago) by phil
Content type: application/x-csh
Branch: MAIN
CVS Tags: Ver_6-2, Ver_6-3, Ver_6-4, Ver_8-0, Ver_7-1, Ver_7-0
Changes since 1.1: +26 -22 lines
Log Message:
Many changes

File Contents

# Content
1 #! /bin/csh -f
2 # Script to make HMI Marmask - Mag Acrive Region Mask 720s
3 #
4
5 # XXXXXXXXXX test
6 set echo
7 # XXXXXXXXXX test
8
9 set HERE = $cwd
10
11 if ($?WORKFLOW_ROOT) then
12 set WFDIR = $WORKFLOW_DATA
13 set WFCODE = $WORKFLOW_ROOT
14 else
15 echo Need WORKFLOW_ROOT variable to be set.
16 exit 1
17 endif
18
19 foreach ATTR (WANTLOW WANTHIGH GATE)
20 set ATTRTXT = `grep $ATTR ticket`
21 set $ATTRTXT
22 end
23
24 set product = `cat $WFDIR/gates/$GATE/product`
25 set key = `cat $WFDIR/gates/$GATE/key`
26
27 set HMI_segment = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/hmi_segment_module
28 #set HMI_patch = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/hmi_patch_module
29
30 #set PATCH_args = "-L bb=hmi.Mpatch_720s"
31
32 set wantlow = `cat wantlow`
33 set wanthigh = `cat wanthigh`
34
35 # round times to a slot
36 #set indexlow = `index_convert ds=$product $key=$WANTLOW`
37 #set indexhigh = `index_convert ds=$product $key=$WANTHIGH`
38 #@ indexhigh = $indexhigh - 1
39 #set wantlow = `index_convert ds=$product $key"_index"=$indexlow`
40 #set wanthigh = `index_convert ds=$product $key"_index"=$indexhigh`
41 #set timestr = `echo $wantlow | sed -e 's/[._:]//g' -e 's/^.......//' -e 's/TAI//'`
42 set timestr = `echo $wantlow | sed -e 's/[.:]//g' -e 's/^......//' -e 's/.._TAI//'`
43 set timename = MSK
44 set qsubname = $timename$timestr
45
46 #if ($indexhigh < $indexlow) then
47 # echo No data to process, $WANTLOW to $WANTHIGH > $HERE/runlog
48 # exit 0
49 #endif
50
51 set TEMPLOG = $HERE/runlog
52 set babble = $HERE/babble
53 set TEMPCMD = $HERE/$qsubname
54 echo 6 > $HERE/retstatus
55
56 # make qsub script
57 echo "#! /bin/csh -f " >$TEMPCMD
58 echo "cd $HERE" >>$TEMPCMD
59 echo "hostname >>&$TEMPLOG" >>$TEMPCMD
60 echo "set echo >>&$TEMPLOG" >>$TEMPCMD
61 echo 'set SEGstatus=0' >>&$TEMPCMD
62 # echo 'set PATstatus=0' >>&$TEMPCMD
63
64 echo "$HMI_segment xm=hmi.M_720s\["$wantlow"-"$wanthigh"]" "xp=hmi.Ic_noLimbDark_720s\["$wantlow"-"$wanthigh"] model=/builtin/hmi.M_Ic_noLimbDark_720s.production y=hmi.Marmask_720s >>&$TEMPLOG" >>$TEMPCMD
65 echo 'set SEGstatus = $?' >>$TEMPCMD
66 echo 'if ($SEGstatus) goto DONE' >>&$TEMPCMD
67 # echo "$HMI_patch x=hmi.Marmask_720s["$wantlow"-"$wanthigh"]" $PATCH_args ">>&$TEMPLOG" >>$TEMPCMD
68 # echo 'set PATstatus = $?' >>$TEMPCMD
69 # echo 'if ($PATstatus) goto DONE' >>&$TEMPCMD
70 echo 'DONE:' >>$TEMPCMD
71 echo 'echo $SEGstatus >retstatus' >>&$TEMPCMD
72 # echo 'echo $SEGstatus >SEGstatus' >>&$TEMPCMD
73 # echo 'echo $PATstatus >PATstatus' >>&$TEMPCMD
74 # echo '@ retstatus = $SEGstatus + $PATstatus' >>$TEMPCMD
75 # echo 'echo $retstatus >retstatus' >>$TEMPCMD
76
77 # execute qsub script
78 qsub -sync yes -e $TEMPLOG -o $TEMPLOG -q j.q $TEMPCMD >> runlog
79
80 if (-e retstatus) set retstatus = `cat $HERE/retstatus`
81 exit $retstatus