ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/workflow/scripts/update_hmi.LOSnrt
Revision: 1.6
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.5: +1 -0 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 # 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_DATA
15 set WFCODE = $WORKFLOW_ROOT
16 else
17 echo Need WORKFLOW_ROOT variable to be set.
18 exit 1
19 endif
20
21 foreach ATTR (WANTLOW WANTHIGH GATE)
22 set ATTRTXT = `grep $ATTR ticket`
23 set $ATTRTXT
24 end
25
26 set product = `cat $WFDIR/gates/$GATE/product`
27 set key = `cat $WFDIR/gates/$GATE/key`
28
29 set HMIprogram = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/HMI_observables
30 set MAKEIMAGES = "$WFCODE/scripts/makeimageslowhigh"
31
32 # note in Sebastien's code camera=1 is front camera, where CAMERA=2.
33 set camera = 1
34 set nrt = 1
35 set cadence = 45
36 set input = hmi.lev1_nrt
37 #set otherargs = "levin="lev1" levout="lev15" wavelength=3 dpath=/home/couvidat/cvs/JSOC/proj/lev1.5_hmi/apps"
38 set otherargs = "levin="lev1" levout="lev15" wavelength=3"
39
40 # align times in format for HMIprogram
41
42 # round times to a slot
43 set indexlow = `index_convert ds=$product $key=$WANTLOW`
44 set indexhigh = `index_convert ds=$product $key=$WANTHIGH`
45 @ indexhigh = $indexhigh - 1
46 set wantlow = `index_convert ds=$product $key"_index"=$indexlow`
47 set wanthigh = `index_convert ds=$product $key"_index"=$indexhigh`
48 set timestr = `echo $wantlow | sed -e 's/[.:]//g' -e 's/^......//' -e 's/.._TAI//'`
49
50 set timename = NRT
51 set qsubname = $timename$timestr
52
53 if ($indexhigh < $indexlow) then
54 echo No data to process, $WANTLOW to $WANTHIGH > $HERE/runlog
55 exit 0
56 endif
57
58 set TEMPLOG = $HERE/runlog
59 set babble = $HERE/babble
60 set TEMPCMD = $HERE/$qsubname
61 echo 6 > $HERE/retstatus
62
63 echo "BEFORE qsub OMP_NUM_THREADS="$OMP_NUM_THREADS >>$TEMPLOG
64 # make qsub script
65 echo "#! /bin/csh -f " >$TEMPCMD
66 echo "setenv OMP_NUM_THREADS 8" >>$TEMPCMD
67 echo "cd $HERE" >>$TEMPCMD
68 echo "hostname >>&$TEMPLOG" >>$TEMPCMD
69 echo "$HMIprogram lev1=$input quicklook=$nrt camid=$camera cadence=$cadence $otherargs begin="$wantlow" end="$wanthigh" >>&$TEMPLOG" >>$TEMPCMD
70 echo 'set retstatus = $?' >>$TEMPCMD
71 echo 'echo $retstatus >' "$HERE/retstatus" >>$TEMPCMD
72
73 # execute qsub script
74 touch $HERE/qsub_running
75 qsub -e $TEMPLOG -o $TEMPLOG -sync yes -q p8.q,j8.q $TEMPCMD
76
77 set retstatus = `cat $HERE/retstatus`
78 exit $retstatus