ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/workflow/scripts/update_hmi.LOS_1.5
Revision: 1.5
Committed: Thu Feb 16 20:32:38 2012 UTC (11 years, 7 months ago) by phil
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.4: +2 -1 lines
Log Message:
Many changes

File Contents

# Content
1 #! /bin/csh -f
2 # Script to make HMI lev1.5 observables from HMI lev1 data
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 HMIprogram = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/HMI_observables
28
29 # note in Sebastien's code camera=1 is front camera, where CAMERA=2.
30 set camera = 1
31 set nrt = 0
32 set cadence = 45
33 set input = hmi.lev1
34 #set otherargs = "levin="lev1" levout="lev15" wavelength=3 dpath=/home/couvidat/cvs/JSOC/proj/lev1.5_hmi/apps"
35 set otherargs = "levin="lev1" levout="lev15" wavelength=3 "
36
37 # round times to a slot
38 set indexlow = `index_convert ds=$product $key=$WANTLOW`
39 set indexhigh = `index_convert ds=$product $key=$WANTHIGH`
40 @ indexhigh = $indexhigh - 1
41 set wantlow = `index_convert ds=$product $key"_index"=$indexlow`
42 set wanthigh = `index_convert ds=$product $key"_index"=$indexhigh`
43 # make qsub name from index from door opening
44 # set indexbase = `index_convert ds=$product $key=2010.03.24_TAI`
45 # @ qsubname = $indexhigh - $indexbase
46 set timestr = `echo $wantlow | sed -e 's/[.:]//g' -e 's/^......//' -e 's/.._TAI//'`
47 set timename = OBS
48 set qsubname = $timename$timestr
49
50 if ($indexhigh < $indexlow) then
51 echo No data to process, $WANTLOW to $WANTHIGH > $HERE/runlog
52 exit 0
53 endif
54
55 set TEMPLOG = $HERE/runlog
56 set babble = $HERE/babble
57 set TEMPCMD = $HERE/$qsubname
58 echo 6 > $HERE/retstatus
59
60 set retstatus=0
61 # make qsub script
62 echo "#! /bin/csh -f " >$TEMPCMD
63 echo "setenv OMP_NUM_THREADS 8" >>$TEMPCMD
64 echo "cd $HERE" >>$TEMPCMD
65 echo "hostname >>&$TEMPLOG" >>$TEMPCMD
66 echo "$HMIprogram -L lev1=$input quicklook=$nrt camid=$camera cadence=$cadence $otherargs begin="$wantlow" end="$wanthigh" >>&$TEMPLOG" >>$TEMPCMD
67 echo 'set retstatus = $?' >>$TEMPCMD
68 echo 'echo $retstatus >' "$HERE/retstatus" >>$TEMPCMD
69 echo "rm -f $HERE/qsub_running" >>$TEMPCMD
70
71 # execute qsub script
72 touch $HERE/qsub_running
73 qsub -sync yes -e $TEMPLOG -o $TEMPLOG -q j8.q $TEMPCMD >> runlog
74 # qsub -sync yes -e $TEMPLOG -o $TEMPLOG -q p8.q $TEMPCMD >> runlog
75
76 # set waitcount=0
77 # while (-e $HERE/qsub_running)
78 # sleep 10
79 # @ waitcount = $waitcount + 1
80 # if ($waitcount > 720) then
81 # echo "timed out after 2 hours" >$HERE/FailMessage
82 # set retstatus = 5
83 # exit $retstatus
84 # endif
85 # echo -n '+' >>$babble
86 # end
87
88 if (-e retstatus) set retstatus = `cat $HERE/retstatus`
89 exit $retstatus