Changeset 11011 for branches/eam_branch_00/ippTasks/detrend.reject.pro
- Timestamp:
- Jan 10, 2007, 12:12:35 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_00/ippTasks/detrend.reject.pro
r10745 r11011 1 2 1 ## this file contains the tasks for running the detrend processing stage 3 2 4 # dettool -residdetrun -simple5 # 1 0 bias6 # DET_ID ITER TYPE7 8 # detrend_reject_exp.pl 1 0 bias9 # detrend_reject_exp.pl DET_ID ITER TYPE10 11 ## these tasks use the queue DetrendResidExp12 ## the DetrendRejectExp queue contains:13 ## STATE DET_ID ITER TYPE14 15 queueinit DetrendRejectExp16 3 if ($?network == 0) 17 4 $network = 1 … … 20 7 $parallel = 0 21 8 end 22 23 $DetrendRejectExpFail = 024 25 9 if ($?VERBOSE == 0) 26 10 echo "VERBOSE not defined: load pantasks.pro first" … … 31 15 break 32 16 end 17 33 18 $LOGSUBDIR = $LOGDIR/detrend 34 19 exec mkdir -p $LOGSUBDIR 35 20 21 book init DetrendRejectExp 22 36 23 macro detreject.status 37 queueprint DetrendRejectExp 38 echo "DetrendRejectExpFail: $DetrendRejectExpFail" 24 book listbook DetrendRejectExp 39 25 end 40 26 … … 53 39 54 40 task.exec 55 command dettool -residdetrun - simple -limit {$DetrendRejectExpFail + 20}41 command dettool -residdetrun -limit 20 56 42 end 57 43 58 44 # success 59 45 task.exit 0 60 local i Nqueue 61 62 # compare output with newImage queue 63 # only add entries which don't exist in queue 64 queuesize stdout -var Nqueue 65 for i 0 $Nqueue 66 queuepop stdout -var line 67 if ($VERBOSE > 2) 68 echo $line 69 end 70 list word -split $line 71 $DET_ID = $word:0 72 $ITER = $word:1 73 $DET_TYPE = $word:2 74 $MODE = $word:3 75 $CAMERA = $word:4 76 queuepush DetrendRejectExp -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $MODE $CAMERA" 46 # convert 'stdout' to book format 47 ipptool2book stdout DetrendRejectExp -key det_id:iter -uniq 48 if ($VERBOSE > 2) 49 book listbook DetrendRejectExp 77 50 end 78 51 79 52 # delete existing entries which are DONE 80 queuedrop DetrendRejectExp -key 0DONE53 book delpage DetrendRejectExp -key state DONE 81 54 end 82 55 … … 99 72 100 73 task.exec 101 queuesizeDetrendRejectExp -var N74 book npages DetrendRejectExp -var N 102 75 if ($N == 0) break 103 76 if ($network == 0) break 104 77 105 # look for new images on the internal DetrendRejectExp queue 106 # caution with these 'if' statements: syntax errors 107 # will make the task fail without given a good status 108 queuepop DetrendRejectExp -var line -key 0 NEW 109 if ("$line" == "NULL") break 78 # look for new images in DetrendRejectExp 79 book getpage DetrendRejectExp 0 -var pageName -key state NULL 80 if ($pageName == NULL) break 110 81 111 strpop line state 112 queuepush DetrendRejectExp -replace -key 1:2 "RUN $line" 113 114 ## the DetrendRejectExp queue contains: 115 ## STATE DET_ID ITER TYPE 116 ## NOTE: the queue has the STATE prepended 117 list word -split $line 118 $DET_ID = $word:0 119 $ITER = $word:1 120 $DET_TYPE = $word:2 121 $MODE = $word:3 122 $CAMERA = $word:4 123 124 # I'd like to add CAMERA to the log file... 125 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 126 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 82 book setword DetrendRejectExp $pageName state RUN 83 book getword DetrendRejectExp $pageName DET_ID -var DET_ID 84 book getword DetrendRejectExp $pageName ITER -var ITER 85 book getword DetrendRejectExp $pageName DET_TYPE -var DET_TYPE 86 book getword DetrendRejectExp $pageName MODE -var MODE 87 book getword DetrendRejectExp $pageName CAMERA -var CAMERA 127 88 128 89 # specify choice of remote host: … … 133 94 end 134 95 96 # I'd like to add CAMERA to the log file... 97 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 98 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 99 100 # save the pageName for future reference below 101 options $pageName 102 135 103 # create example job options as a demonstration 136 options "$line"137 104 if ($VERBOSE > 1) 138 105 echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA … … 143 110 # success 144 111 task.exit 0 145 queuepush DetrendRejectExp -replace -key 1:2 "DONE $options:0"112 book setword DetrendRejectExp $options:0 state DONE 146 113 end 147 114 … … 149 116 task.exit default 150 117 showcommand failure 151 queuepush DetrendRejectExp -replace -key 1:2 "FAIL $options:0" 152 $DetrendRejectExpFail ++ 118 book setword DetrendRejectExp $options:0 state FAIL 153 119 end 154 120 … … 156 122 task.exit timeout 157 123 showcommand failure 158 queuepush DetrendRejectExp -replace -key 1:2 "TIMEOUT $options:0" 159 $DetrendRejectExpFail ++ 124 book setword DetrendRejectExp $options:0 state TIMEOUT 160 125 end 161 126 end
Note:
See TracChangeset
for help on using the changeset viewer.
