Changeset 11210 for trunk/ippTasks/detrend.reject.pro
- Timestamp:
- Jan 19, 2007, 5:24:59 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/detrend.reject.pro (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/detrend.reject.pro
r10745 r11210 1 ## this file contains the tasks for running the detrend processing stage 2 ## these tasks use the book detRejectExp 1 3 2 ## this file contains the tasks for running the detrend processing stage3 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 4 if ($?network == 0) 17 5 $network = 1 … … 20 8 $parallel = 0 21 9 end 22 23 $DetrendRejectExpFail = 024 25 10 if ($?VERBOSE == 0) 26 11 echo "VERBOSE not defined: load pantasks.pro first" … … 31 16 break 32 17 end 18 33 19 $LOGSUBDIR = $LOGDIR/detrend 34 20 exec mkdir -p $LOGSUBDIR 35 21 22 book init detRejectExp 23 36 24 macro detreject.status 37 queueprint DetrendRejectExp 38 echo "DetrendRejectExpFail: $DetrendRejectExpFail" 25 book listbook detRejectExp 39 26 end 40 27 41 28 # select images ready for copy 42 # new entries are added to queue DetrendRejectExp29 # new entries are added to detRejectExp 43 30 # compare the new list with the ones already selected 44 31 task dettool.reject.load … … 49 36 periods -timeout 30 50 37 51 stdout $LOGSUBDIR/dettool.reject.log38 stdout NULL 52 39 stderr $LOGSUBDIR/dettool.reject.log 53 40 54 41 task.exec 55 command dettool -residdetrun - simple -limit {$DetrendRejectExpFail + 20}42 command dettool -residdetrun -limit 20 56 43 end 57 44 58 45 # success 59 46 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" 47 # convert 'stdout' to book format 48 ipptool2book stdout detRejectExp -key det_id:iteration -uniq 49 if ($VERBOSE > 2) 50 book listbook detRejectExp 77 51 end 78 52 79 53 # delete existing entries which are DONE 80 queuedrop DetrendRejectExp -key 0DONE54 book delpage detRejectExp -key state DONE 81 55 end 82 56 … … 99 73 100 74 task.exec 101 queuesize DetrendRejectExp -var N75 book npages detRejectExp -var N 102 76 if ($N == 0) break 103 77 if ($network == 0) break 104 78 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 79 # look for new images in detRejectExp 80 book getpage detRejectExp 0 -var pageName -key state NULL 81 if ($pageName == NULL) break 110 82 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 83 book setword detRejectExp $pageName state RUN 84 book getword detRejectExp $pageName det_id -var DET_ID 85 book getword detRejectExp $pageName iteration -var ITERATION 86 book getword detRejectExp $pageName det_type -var DET_TYPE 87 book getword detRejectExp $pageName mode -var MODE 88 book getword detRejectExp $pageName camera -var CAMERA 127 89 128 90 # specify choice of remote host: … … 133 95 end 134 96 97 # I'd like to add CAMERA to the log file... 98 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log 99 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log 100 101 # save the pageName for future reference below 102 options $pageName 103 135 104 # create example job options as a demonstration 136 options "$line"137 105 if ($VERBOSE > 1) 138 echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA106 echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA 139 107 end 140 command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA108 command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA 141 109 end 142 143 # success144 task.exit 0145 queuepush DetrendRejectExp -replace -key 1:2 "DONE $options:0"146 end147 110 148 111 # default exit status 149 112 task.exit default 150 showcommand failure 151 queuepush DetrendRejectExp -replace -key 1:2 "FAIL $options:0" 152 $DetrendRejectExpFail ++ 113 process_exit detRejectExp $options:0 state FAIL 153 114 end 154 115 … … 156 117 task.exit timeout 157 118 showcommand failure 158 queuepush DetrendRejectExp -replace -key 1:2 "TIMEOUT $options:0" 159 $DetrendRejectExpFail ++ 119 book setword detRejectExp $options:0 state TIMEOUT 160 120 end 161 121 end
Note:
See TracChangeset
for help on using the changeset viewer.
