Changeset 9104 for trunk/ippTasks/detrend.process.pro
- Timestamp:
- Oct 2, 2006, 12:36:59 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/detrend.process.pro (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/detrend.process.pro
r9081 r9104 9 9 # detrend_process.pl 1 850131b mc bias 850131b.fits 850131b 10 10 11 ## these tasks use the queue Detrend ImfilesToProcess12 ## the Detrend ImfilesToProcess queue contains:11 ## these tasks use the queue DetrendProcessImfiles 12 ## the DetrendProcessImfiles queue contains: 13 13 ## STATE DET_ID TYPE EXP_KEY CLASS CLASS_ID URI 14 14 15 queueinit DetrendImfilesToProcess 15 queueinit DetrendProcessImfiles 16 queueinit DetrendProcessExposures 16 17 if ($?network == 0) 17 18 $network = 1 … … 22 23 23 24 # select images ready for copy 24 # new entries are added to queue Detrend ImfilesToProcess25 # new entries are added to queue DetrendProcessImfiles 25 26 # compare the new list with the ones already selected 26 task dettool. raw.load27 task dettool.process.load 27 28 command dettool -raw -simple 28 29 host local … … 53 54 $CLASS_ID = $word:4 54 55 $URI = $word:5 55 queuepush Detrend ImfilesToProcess -uniq -key 1:3:5 "NEW $DET_ID $TYPE $EXP_KEY $CLASS $CLASS_ID $URI"56 queuepush DetrendProcessImfiles -uniq -key 1:3:5 "NEW $DET_ID $TYPE $EXP_KEY $CLASS $CLASS_ID $URI" 56 57 end 57 58 58 59 # delete existing entries which are DONE 59 queuedrop DetrendImfilesToProcess -key 0 DONE 60 end 61 62 # locked list 63 task.exit 1 64 echo "new.images: exec failure" 65 end 66 67 # default exit status 68 task.exit default 69 echo "new.images: unknown exit status: $EXIT" 70 end 71 72 # operation times out? 73 task.exit timeout 74 echo "new.images: timeout" 60 queuedrop DetrendProcessImfiles -key 0 DONE 61 end 62 63 # error 64 task.exit default 65 echo "detrend.process: failure" 66 end 67 68 # operation times out? 69 task.exit timeout 70 echo "detrend.process: timeout" 75 71 end 76 72 end 77 73 78 74 # copy new images, sending job to desired host 79 task dettool. raw.process75 task dettool.process.run 80 76 periods -poll 0.5 81 77 periods -exec 2.0 … … 83 79 84 80 task.exec 85 queuesize Detrend ImfilesToProcess -var N81 queuesize DetrendProcessImfiles -var N 86 82 if ($N == 0) break 87 83 if ($network == 0) break 88 84 89 # look for new images on the internal Detrend ImfilesToProcess queue85 # look for new images on the internal DetrendProcessImfiles queue 90 86 # caution with these 'if' statements: syntax errors 91 87 # will make the task fail without given a good status 92 queuepop Detrend ImfilesToProcess -var line -key 0 NEW88 queuepop DetrendProcessImfiles -var line -key 0 NEW 93 89 if ("$line" == "NULL") break 94 90 95 91 strpop line state 96 queuepush Detrend ImfilesToProcess -replace -key 1:3:5 "RUN $line"97 98 ## the Detrend ImfilesToProcess queue contains:92 queuepush DetrendProcessImfiles -replace -key 1:3:5 "RUN $line" 93 94 ## the DetrendProcessImfiles queue contains: 99 95 # STATE DET_ID TYPE EXP_KEY CLASS CLASS_ID URI 100 96 ## NOTE: the queue has the STATE prepended … … 119 115 # create example job options as a demonstration 120 116 options "$line" 121 echo command detrend_process .pl --det_id $DET_ID --exp_id $EXP_KEY --class $CLASS --class_id $CLASS_ID --det_type bias --input_uri $URI122 command detrend_process .pl --det_id $DET_ID --exp_id $EXP_KEY --class $CLASS --class_id $CLASS_ID --det_type bias --input_uri $URI117 echo command detrend_process_imfile.pl --det_id $DET_ID --exp_id $EXP_KEY --class $CLASS --class_id $CLASS_ID --det_type bias --input_uri $URI 118 command detrend_process_imfile.pl --det_id $DET_ID --exp_id $EXP_KEY --class $CLASS --class_id $CLASS_ID --det_type bias --input_uri $URI 123 119 end 124 120 125 121 # success 126 122 task.exit 0 127 queuepush Detrend ImfilesToProcess -replace -key 1:3:5 "DONE $options:0"123 queuepush DetrendProcessImfiles -replace -key 1:3:5 "DONE $options:0" 128 124 end 129 125 130 126 # default exit status 131 127 task.exit default 132 queuepush DetrendImfilesToProcess -replace -key 1:3:5 "FAIL $options:0" 133 end 134 135 # operation times out? 136 task.exit timeout 137 queuepush DetrendImfilesToProcess -replace -key 1:3:5 "TIMEOUT $options:0" 138 end 139 end 128 queuepush DetrendProcessImfiles -replace -key 1:3:5 "FAIL $options:0" 129 end 130 131 # operation times out? 132 task.exit timeout 133 queuepush DetrendProcessImfiles -replace -key 1:3:5 "TIMEOUT $options:0" 134 end 135 end 136 137 # select images ready for copy 138 # new entries are added to queue DetrendProcessExposures 139 # compare the new list with the ones already selected 140 task dettool.processexp.load 141 command dettool -toprocessdexp -simple 142 host local 143 144 periods -poll 1 145 periods -exec 5 146 periods -timeout 30 147 148 stdout dettool.processexp.log 149 stderr dettool.processexp.log 150 151 # success 152 task.exit 0 153 # XXX is it necessary for these to be local? 154 # drop after this task macro is done? 155 local i Nqueue 156 157 # compare output with newImage queue 158 # only add entries which don't exist in queue 159 queuesize stdout -var Nqueue 160 for i 0 $Nqueue 161 queuepop stdout -var line 162 list word -split $line 163 $DET_ID = $word:0 164 $TYPE = $word:1 165 $EXP_KEY = $word:2 166 queuepush DetrendProcessExposures -uniq -key 1:3 "NEW $DET_ID $TYPE $EXP_KEY" 167 end 168 169 # delete existing entries which are DONE 170 queuedrop DetrendProcessExposures -key 0 DONE 171 end 172 173 # error 174 task.exit default 175 echo "detrend.process: failure" 176 end 177 178 # operation times out? 179 task.exit timeout 180 echo "detrend.process: timeout" 181 end 182 end 183 184 # copy new images, sending job to desired host 185 task dettool.processexp.run 186 periods -poll 0.5 187 periods -exec 2.0 188 periods -timeout 60 189 190 task.exec 191 queuesize DetrendProcessExposures -var N 192 if ($N == 0) break 193 if ($network == 0) break 194 195 # look for new images on the internal DetrendProcessExposures queue 196 # caution with these 'if' statements: syntax errors 197 # will make the task fail without given a good status 198 queuepop DetrendProcessExposures -var line -key 0 NEW 199 if ("$line" == "NULL") break 200 201 strpop line state 202 queuepush DetrendProcessExposures -replace -key 1:3:5 "RUN $line" 203 204 ## the DetrendProcessExposures queue contains: 205 # STATE DET_ID TYPE EXP_KEY CLASS CLASS_ID URI 206 ## NOTE: the queue has the STATE prepended 207 list word -split $line 208 $DET_ID = $word:0 209 $TYPE = $word:1 210 $EXP_KEY = $word:2 211 212 stdout $EXP_KEY.detproc.$CLASS_ID.log 213 stderr $EXP_KEY.detproc.$CLASS_ID.log 214 215 # specify choice of remote host: 216 if ($parallel) 217 host anyhost 218 else 219 host local 220 end 221 222 # create example job options as a demonstration 223 options "$line" 224 echo command detrend_process_exp.pl --det_id $DET_ID --exp_id $EXP_KEY --det_type bias 225 command detrend_process_exp.pl --det_id $DET_ID --exp_id $EXP_KEY --det_type bias 226 end 227 228 # success 229 task.exit 0 230 queuepush DetrendProcessExposures -replace -key 1:3:5 "DONE $options:0" 231 end 232 233 # default exit status 234 task.exit default 235 queuepush DetrendProcessExposures -replace -key 1:3:5 "FAIL $options:0" 236 end 237 238 # operation times out? 239 task.exit timeout 240 queuepush DetrendProcessExposures -replace -key 1:3:5 "TIMEOUT $options:0" 241 end 242 end
Note:
See TracChangeset
for help on using the changeset viewer.
