ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/workflow/scripts/update_hmi.Vector_ObsOnly.csh
Revision: 1.5
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.4: +7 -6 lines
Log Message:
Many changes

File Contents

# Content
1 #! /bin/csh -f
2 # Script to make HMI lev1.5 X_720s observables from HMI S_720s 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 IQUVprogram = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/HMI_IQUV_averaging
28 set HMIprogram = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/HMI_observables
29 set HMI_segment = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/hmi_segment_module
30 set HMI_patch = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/hmi_patch_module
31
32 # set IQUV_args = "wavelength=3 camid=0 cadence=135.0 npol=6 size=36 lev1=hmi.lev1 quicklook=0 dpath=/home/couvidat/cvs/JSOC/proj/lev1.5_hmi/apps"
33 #set OBS_args = "levin=lev1p levout=lev15 wavelength=3 quicklook=0 camid=0 cadence=720.0 lev1=hmi.lev1 dpath=/home/couvidat/cvs/JSOC/proj/lev1.5_hmi/apps"
34 set OBS_args = "levin=lev1p levout=lev15 wavelength=3 quicklook=0 camid=0 cadence=720.0 lev1=hmi.lev1"
35 set SEG_args = "beta=0.7 alpha=[0,-4] T=[1,1,0.9,0] y=hmi.Marmask_720s"
36 set PATCH_args = "bb=hmi.Mpatch_720s"
37
38 # round times to a slot
39 set indexlow = `index_convert ds=$product $key=$WANTLOW`
40 set indexhigh = `index_convert ds=$product $key=$WANTHIGH`
41 @ indexhigh = $indexhigh - 1
42 set wantlow = `index_convert ds=$product $key"_index"=$indexlow`
43 set wanthigh = `index_convert ds=$product $key"_index"=$indexhigh`
44 # set timestr = `echo $wantlow | sed -e 's/[._:]//g' -e 's/^.......//' -e 's/TAI//'`
45 set timestr = `echo $wantlow | sed -e 's/[.:]//g' -e 's/^......//' -e 's/.._TAI//'`
46 set timename = VEC
47 set qsubname = $timename$timestr
48
49 if ($indexhigh < $indexlow) then
50 echo No data to process, $WANTLOW to $WANTHIGH > $HERE/runlog
51 exit 0
52 endif
53
54 set TEMPLOG = $HERE/runlog
55 set babble = $HERE/babble
56 set TEMPCMD = $HERE/$qsubname
57 echo 6 > $HERE/retstatus
58
59 # make qsub script
60 echo "#! /bin/csh -f " >$TEMPCMD
61 echo "setenv OMP_NUM_THREADS 8" >>$TEMPCMD
62 echo "cd $HERE" >>$TEMPCMD
63 echo "hostname >>&$TEMPLOG" >>$TEMPCMD
64 echo 'set IQUVstatus=0' >>&$TEMPCMD
65 echo 'set OBSstatus=0' >>&$TEMPCMD
66 echo 'set SEGstatus=0' >>&$TEMPCMD
67 echo 'set PATstatus=0' >>&$TEMPCMD
68
69 # echo "$IQUVprogram begin="$wantlow" end="$wanthigh $IQUV_args ">>&$TEMPLOG" >>$TEMPCMD
70 # echo 'set IQUVstatus = $?' >>$TEMPCMD
71 echo 'if ($IQUVstatus) goto DONE' >>&$TEMPCMD
72 echo "$HMIprogram begin="$wantlow" end="$wanthigh $OBS_args ">>&$TEMPLOG" >>$TEMPCMD
73 echo 'set OBSstatus = $?' >>$TEMPCMD
74 echo 'if ($OBSstatus) goto DONE' >>&$TEMPCMD
75 #echo "$HMI_segment xm=hmi.M_720s["$wantlow"-"$wanthigh"]" "xp=hmi.Ic_720s["$wantlow"-"$wanthigh"]" $SEG_args ">>&$TEMPLOG" >>$TEMPCMD
76 echo 'set SEGstatus = $?' >>$TEMPCMD
77 echo 'if ($SEGstatus) goto DONE' >>&$TEMPCMD
78 # echo "$HMI_patch x=hmi.Marmask_720s["$wantlow"-"$wanthigh"]" $PATCH_args ">>&$TEMPLOG" >>$TEMPCMD
79 # echo 'set PATstatus = $?' >>$TEMPCMD
80 # echo 'if ($PATstatus) goto DONE' >>&$TEMPCMD
81 echo 'DONE:' >>$TEMPCMD
82 echo 'echo $IQUVstatus >IQUVstatus' >>&$TEMPCMD
83 echo 'echo $OBSstatus >OBSstatus' >>&$TEMPCMD
84 echo 'echo $SEGstatus >SEGstatus' >>&$TEMPCMD
85 echo 'echo $PATstatus >PATstatus' >>&$TEMPCMD
86 echo '@ retstatus = $IQUVstatus + $OBSstatus + $SEGstatus + $PATstatus' >>$TEMPCMD
87 echo 'echo $retstatus >retstatus' >>$TEMPCMD
88 echo "rm -f $HERE/qsub_running" >>$TEMPCMD
89
90 # execute qsub script
91 touch $HERE/qsub_running
92 qsub -sync yes -e $TEMPLOG -o $TEMPLOG -q j8.q $TEMPCMD >> runlog
93
94 if (-e retstatus) set retstatus = `cat $HERE/retstatus`
95 exit $retstatus