1 |
#! /bin/csh -f |
2 |
# Script to make HMI lev1.5 720s nrt observables from HMI lev1_nrt data |
3 |
# |
4 |
|
5 |
# XXXXXXXXXX test |
6 |
# set echo |
7 |
# XXXXXXXXXX test |
8 |
set noglob |
9 |
|
10 |
set HERE = $cwd |
11 |
|
12 |
if ($?WORKFLOW_ROOT) then |
13 |
set WFDIR = $WORKFLOW_DATA |
14 |
set WFCODE = $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 IQUVprogram = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/HMI_IQUV_averaging |
29 |
|
30 |
set HMIprogram = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/HMI_observables |
31 |
|
32 |
set HMI_limbdark = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/hmi_limbdark |
33 |
|
34 |
set HMI_segment = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/hmi_segment_module |
35 |
|
36 |
#set HMI_patch = /home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/hmi_patch_module |
37 |
|
38 |
set IQUV_args = "wavelength=3 camid=0 cadence=135.0 npol=6 size=36 lev1=hmi.lev1_nrt quicklook=1" |
39 |
set OBS_args = "levin=lev1p levout=lev15 wavelength=3 quicklook=1 camid=0 cadence=720.0 lev1=hmi.lev1_nrt" |
40 |
set LD_args = "-cnxf NONE" |
41 |
#set PATCH_args = "bb=hmi.Mpatch_720s_nrt" |
42 |
|
43 |
# round times to a slot |
44 |
set indexlow = `index_convert ds=$product $key=$WANTLOW` |
45 |
set indexhigh = `index_convert ds=$product $key=$WANTHIGH` |
46 |
@ indexhigh = $indexhigh - 1 |
47 |
set wantlow = `index_convert ds=$product $key"_index"=$indexlow` |
48 |
set wanthigh = `index_convert ds=$product $key"_index"=$indexhigh` |
49 |
set timestr = `echo $wantlow | sed -e 's/[.:]//g' -e 's/^......//' -e 's/.._TAI//'` |
50 |
set timename = VEC |
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 |
# make qsub script |
64 |
echo "#! /bin/csh -f " >$TEMPCMD |
65 |
echo "setenv OMP_NUM_THREADS 8" >>$TEMPCMD |
66 |
echo "cd $HERE" >>$TEMPCMD |
67 |
echo "hostname >>&$TEMPLOG" >>$TEMPCMD |
68 |
echo "set echo >>&$TEMPLOG" >>$TEMPCMD |
69 |
echo 'set IQUVstatus=0' >>&$TEMPCMD |
70 |
echo 'set OBSstatus=0' >>&$TEMPCMD |
71 |
#echo 'set PATstatus=0' >>&$TEMPCMD |
72 |
echo 'set LDstatus=0' >>&$TEMPCMD |
73 |
|
74 |
echo "$IQUVprogram begin="$wantlow" end="$wanthigh $IQUV_args ">>&$TEMPLOG" >>$TEMPCMD |
75 |
echo 'set IQUVstatus = $?' >>$TEMPCMD |
76 |
echo 'if ($IQUVstatus) goto DONE' >>&$TEMPCMD |
77 |
echo "$HMIprogram begin="$wantlow" end="$wanthigh $OBS_args ">>&$TEMPLOG" >>$TEMPCMD |
78 |
echo 'set OBSstatus = $?' >>$TEMPCMD |
79 |
echo 'if ($OBSstatus) goto DONE' >>&$TEMPCMD |
80 |
echo "$HMI_limbdark in=hmi.Ic_720s_nrt\["$wantlow"] out=hmi.Ic_noLimbDark_720s_nrt "$LD_args" >>&$TEMPLOG" >>$TEMPCMD |
81 |
echo 'set LDstatus = $?' >>$TEMPCMD |
82 |
echo 'if ($LDstatus) goto DONE' >>&$TEMPCMD |
83 |
|
84 |
|
85 |
## Remap/Resize mags for synoptic charts |
86 |
|
87 |
echo "/home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/fdlos2radial in=hmi.M_720s_nrt\["$wantlow"-"$wanthigh"] out=hmi.Mr_720s_nrt >>&$TEMPLOG" >>$TEMPCMD |
88 |
echo "/home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/mag2helio MAPMMAX=5402 SINBDIVS=2160 LGSHIFT=3 CARRSTRETCH=1 RMAXFLAG=1 MCORLEV=1 in=hmi.M_720s_nrt\["$wantlow"-"$wanthigh"] out=hmi.Ml_hiresmap_720s_nrt >>&$TEMPLOG" >> $TEMPCMD |
89 |
echo "/home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/mag2helio MAPMMAX=5402 SINBDIVS=2160 LGSHIFT=3 CARRSTRETCH=1 RMAXFLAG=1 in=hmi.Mr_720s_nrt\["$wantlow"-"$wanthigh"] out=hmi.Mr_hiresmap_720s_nrt >>&$TEMPLOG" >>$TEMPCMD |
90 |
echo "/home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/resizemappingmag in=hmi.Ml_hiresmap_720s_nrt\["$wantlow"-"$wanthigh"] out=hmi.Ml_remap_720s_nrt nbin=3 >>&$TEMPLOG" >>$TEMPCMD |
91 |
echo "/home/jsoc/cvs/Development/JSOC/bin/linux_x86_64/resizemappingmag in=hmi.Mr_hiresmap_720s_nrt\["$wantlow"-"$wanthigh"] out=hmi.Mr_remap_720s_nrt nbin=3 >>&$TEMPLOG" >>$TEMPCMD |
92 |
|
93 |
|
94 |
# echo "$HMI_patch x=hmi.Marmask_720s_nrt["$wantlow"-"$wanthigh"]" "$PATCH_args" ">>&$TEMPLOG" >>$TEMPCMD |
95 |
# echo 'set PATstatus = $?' >>$TEMPCMD |
96 |
# echo 'if ($PATstatus) goto DONE' >>&$TEMPCMD |
97 |
|
98 |
echo 'DONE:' >>$TEMPCMD |
99 |
echo 'echo $IQUVstatus >IQUVstatus' >>&$TEMPCMD |
100 |
echo 'echo $OBSstatus >OBSstatus' >>&$TEMPCMD |
101 |
#echo 'echo $PATstatus >PATstatus' >>&$TEMPCMD |
102 |
echo 'echo $LDstatus >LDstatus' >> &$TEMPCMD |
103 |
echo '@ retstatus = $IQUVstatus + $OBSstatus + $LDstatus' >>$TEMPCMD |
104 |
|
105 |
echo 'echo $retstatus >retstatus' >>$TEMPCMD |
106 |
echo "rm -f $HERE/qsub_running" >>$TEMPCMD |
107 |
|
108 |
# execute qsub script |
109 |
touch $HERE/qsub_running |
110 |
qsub -sync yes -e $TEMPLOG -o $TEMPLOG -q p8.q,j8.q $TEMPCMD >> runlog |
111 |
|
112 |
set MSK_TICKET = `$WFCODE/maketicket.csh gate=hmi.Marmask_nrt wantlow=$wantlow wanthigh=$wanthigh action=5` |
113 |
|
114 |
if (-e retstatus) set retstatus = `cat $HERE/retstatus` |
115 |
exit $retstatus |