ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/workflow/scripts/update_hmi.LOSnrt.OLD
Revision: 1.1
Committed: Sun Jan 2 22:13:25 2011 UTC (12 years, 8 months ago) by phil
Branch: MAIN
CVS Tags: Ver_6-0, Ver_6-1, Ver_6-2, Ver_6-3, Ver_6-4, Ver_5-14, Ver_5-13, Ver_8-0, Ver_7-1, Ver_7-0
Log Message:
Initial commit, copied from ~phil/workflow/scripts

File Contents

# Content
1 #
2 # Script to make HMI lev1.5 observables from HMI lev1 data
3 #
4 # this is run in the task instance directory where there is a 'ticket' file that specifies
5 # the request.
6
7 # XXXXXXXXXX test
8 # set echo
9 # XXXXXXXXXX test
10
11 set HERE = $cwd
12
13 if ($?WORKFLOW_ROOT) then
14 set WFDIR = $WORKFLOW_ROOT
15 else
16 echo Need WORKFLOW_ROOT variable to be set.
17 exit 1
18 endif
19
20 foreach ATTR (WANTLOW WANTHIGH GATE)
21 set ATTRTXT = `grep $ATTR ticket`
22 set $ATTRTXT
23 end
24
25 set product = `cat $WFDIR/gates/$GATE/product`
26 set key = `cat $WFDIR/gates/$GATE/key`
27
28 set HMIprogram = /home/couvidat/cvs/JSOC/bin/linux_x86_64/HMI_observables2
29 set MAKEIMAGES = "$WFDIR/scripts/makeimageslowhigh"
30
31 # note in Sebastien's code camera=1 is front camera, where CAMERA=2.
32 set camera = 1
33 set nrt = 1
34 set cadence = 45
35 set otherargs = "levin="lev1" levout="lev15" wavelength=3"
36
37 # align times in format for HMIprogram
38
39 # round times to a slot
40 set indexlow = `index_convert ds=$product $key=$WANTLOW`
41 set indexhigh = `index_convert ds=$product $key=$WANTHIGH`
42 @ indexhigh = $indexhigh - 1
43 set wantlowZone = `index_convert ds=$product $key"_index"=$indexlow`
44 set wanthighZone = `index_convert ds=$product $key"_index"=$indexhigh`
45 # strip _TAI for Sebastien's program
46 set wantlow = `printf "%.19s" $wantlowZone`
47 set wanthigh = `printf "%.19s" $wanthighZone`
48 # make qsub name from index from door opening
49 set indexbase = `index_convert ds=$product $key=2010.03.24_TAI`
50 @ qsubname = $indexhigh - $indexbase
51
52 if ($indexhigh < $indexlow) then
53 echo No data to process, $WANTLOW to $WANTHIGH > $HERE/runlog
54 exit 0
55 endif
56
57 set TEMPLOG = $HERE/runlog
58 set babble = $HERE/babble
59 set TEMPCMD = $HERE/LOS.$qsubname
60 echo 6 > $HERE/retstatus
61
62 # make qsub script
63 echo "#! /bin/csh -f " >$TEMPCMD
64 echo "cd $HERE" >>$TEMPCMD
65 echo "hostname >>&$TEMPLOG" >>$TEMPCMD
66 echo "$HMIprogram quicklook=$nrt camid=$camera cadence=$cadence $otherargs times="'"['$wantlow-$wanthigh']"'" >>&$TEMPLOG" >>$TEMPCMD
67 echo 'set retstatus = $?' >>$TEMPCMD
68 echo 'echo $retstatus >' "$HERE/retstatus" >>$TEMPCMD
69 # echo 'if ($retstatus == 0) then' >>$TEMPCMD
70 # echo " echo XXXX Start image processing" >>$TEMPCMD
71 # echo " $MAKEIMAGES $wantlow $wanthigh" >>$TEMPCMD
72 # echo "endif" >> $TEMPCMD
73 echo "rm -f $HERE/qsub_running" >>$TEMPCMD
74
75 # execute qsub script
76 touch $HERE/qsub_running
77 qsub -e $TEMPLOG -o $TEMPLOG -q j8.q $TEMPCMD
78 endif
79
80 set waitcount=0
81 while (-e $HERE/qsub_running)
82 sleep 10
83 @ waticount = $waitcount + 1
84 if ($waitcount > 720) then
85 echo "timed out after 2 hours" >$HERE/FailMessage
86 set retstatus = 5
87 exit $retstatus
88 endif
89 echo -n '+' >>$babble
90 end
91
92 set retstatus = `cat $HERE/retstatus`
93 exit $retstatus