Changeset 11011 for branches/eam_branch_00/ippTasks/detrend.norm.pro
- Timestamp:
- Jan 10, 2007, 12:12:35 PM (20 years ago)
- File:
-
- 1 edited
-
branches/eam_branch_00/ippTasks/detrend.norm.pro (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_00/ippTasks/detrend.norm.pro
r10745 r11011 1 2 ## this file contains the tasks for running the detrend normalization stage 3 4 ## these tasks use the queue DetrendNorm 5 ## the DetrendNorm queue contains: 6 ## STATE DET_ID ITER 7 8 queueinit DetrendNorm 9 queueinit DetrendNormStat 10 queueinit DetrendNormExp 1 ## this file contains the tasks for running the detrend normalization stages 2 11 3 if ($?network == 0) 12 4 $network = 1 … … 15 7 $parallel = 0 16 8 end 17 18 $DetrendNormFail = 019 $DetrendNormStatFail = 020 $DetrendNormExpFail = 021 22 9 if ($?VERBOSE == 0) 23 10 echo "VERBOSE not defined: load pantasks.pro first" … … 28 15 break 29 16 end 17 30 18 $LOGSUBDIR = $LOGDIR/detrend 31 19 exec mkdir -p $LOGSUBDIR 32 20 21 book init DetrendNormStat 22 book init DetrendNorm 23 book init DetrendNormExp 24 33 25 macro detnorm.status 34 queueprint DetrendNorm 35 queueprint DetrendNormStat 36 queueprint DetrendNormExp 37 echo "DetrendNormFail: $DetrendNormFail" 38 echo "DetrendNormStatFail: $DetrendNormStatFail" 39 echo "DetrendNormExpFail: $DetrendNormExpFail" 26 book listbook DetrendNormStat 27 book listbook DetrendNorm 28 book listbook DetrendNormExp 40 29 end 41 30 … … 54 43 55 44 task.exec 56 command dettool -tonormalizedstat -simple -limit {$DetrendNormStatFail + 20}45 command dettool -tonormalizedstat -limit 20 57 46 end 58 47 59 48 # success 60 49 task.exit 0 61 # XXX is it necessary for these to be local? 62 # drop after this task macro is done? 63 local i Nqueue 64 65 # compare output with newImage queue 66 # only add entries which don't exist in queue 67 queuesize stdout -var Nqueue 68 for i 0 $Nqueue 69 queuepop stdout -var line 70 if ($VERBOSE > 2) 71 echo $line 72 end 73 list word -split $line 74 $DET_ID = $word:0 75 $DET_TYPE = $word:1 76 $ITER = $word:2 77 $CAMERA = $word:3 78 queuepush DetrendNormStat -uniq -key 1:3 "NEW $DET_ID $DET_TYPE $ITER $CAMERA" 50 # convert 'stdout' to book format 51 ipptool2book stdout DetrendNormStat -key det_id:iter -uniq 52 if ($VERBOSE > 2) 53 book listbook DetrendNormStat 79 54 end 80 55 81 56 # delete existing entries which are DONE 82 queuedrop DetrendNormStat -key 0 DONE 83 end 84 85 # locked list 57 book delpage DetrendNormStat -key state DONE 58 end 59 86 60 # default exit status 87 61 task.exit default … … 102 76 103 77 task.exec 104 queuesizeDetrendNormStat -var N78 book npages DetrendNormStat -var N 105 79 if ($N == 0) break 106 80 if ($network == 0) break 107 81 108 # look for new images on the internal DetrendNormStat queue 109 # caution with these 'if' statements: syntax errors 110 # will make the task fail without given a good status 111 queuepop DetrendNormStat -var line -key 0 NEW 112 if ("$line" == "NULL") break 113 114 strpop line state 115 queuepush DetrendNormStat -replace -key 1:3 "RUN $line" 116 117 # the DetrendNormStat queue contains: 118 # STATE DET_ID ITER 119 list word -split $line 120 $DET_ID = $word:0 121 $DET_TYPE = $word:1 122 $ITER = $word:2 123 $CAMERA = $word:3 124 125 # XXX add $WORKDIR/$LOG_DIR 126 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 127 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 82 # look for new images in DetrendNormStat 83 book getpage DetrendNormStat 0 -var pageName -key state NULL 84 if ($pageName == NULL) break 85 86 book setword DetrendNormStat $pageName state RUN 87 book getword DetrendNormStat $pageName DET_ID -var DET_ID 88 book getword DetrendNormStat $pageName DET_TYPE -var DET_TYPE 89 book getword DetrendNormStat $pageName ITER -var ITER 90 book getword DetrendNormStat $pageName CAMERA -var CAMERA 128 91 129 92 # specify choice of remote host: … … 134 97 end 135 98 99 # XXX add $WORKDIR/$LOG_DIR 100 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 101 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 102 103 # save the pageName for future reference below 104 options $pageName 105 136 106 # create example job options as a demonstration 137 options "$line"138 107 if ($VERBOSE > 1) 139 108 echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE … … 144 113 # success 145 114 task.exit 0 146 queuepush DetrendNormStat -replace -key 1:3 "DONE $options:0" 147 end 148 149 # default exit status 150 task.exit default 151 showcommand failure 152 queuepush DetrendNormStat -replace -key 1:3 "FAIL $options:0" 153 $DetrendNormStatFail ++ 154 end 155 156 # operation times out? 157 task.exit timeout 158 showcommand timeout 159 queuepush DetrendNormStat -replace -key 1:3 "TIMEOUT $options:0" 160 $DetrendNormStatFail ++ 115 book setword DetrendNormStat $options:0 state DONE 116 end 117 118 # default exit status 119 task.exit default 120 showcommand failure 121 book setword DetrendNormStat $options:0 state FAIL 122 end 123 124 # operation times out? 125 task.exit timeout 126 showcommand timeout 127 book setword DetrendNormStat $options:0 state TIMEOUT 161 128 end 162 129 end 163 130 164 131 # select images ready for copy 165 # new entries are added to queueDetrendNorm132 # new entries are added to DetrendNorm 166 133 # compare the new list with the ones already selected 167 134 task dettool.norm.load … … 176 143 177 144 task.exec 178 command dettool -tonormalize -simple -limit {$DetrendNormFail + 20}145 command dettool -tonormalize -limit 20 179 146 end 180 147 181 148 # success 182 149 task.exit 0 183 # XXX is it necessary for these to be local? 184 # drop after this task macro is done? 185 local i Nqueue 186 187 # compare output with newImage queue 188 # only add entries which don't exist in queue 189 queuesize stdout -var Nqueue 190 for i 0 $Nqueue 191 queuepop stdout -var line 192 if ($VERBOSE > 2) 193 echo $line 194 end 195 list word -split $line 196 $DET_TYPE = $word:0 197 $CAMERA = $word:1 198 $URI = $word:2 199 $DET_ID = $word:3 200 $ITER = $word:4 201 $CLASS_ID = $word:5 202 $NORM = $word:6 203 queuepush DetrendNorm -uniq -key 4:5 "NEW $DET_TYPE $CAMERA $URI $DET_ID $ITER $CLASS_ID $NORM" 150 # convert 'stdout' to book format 151 ipptool2book stdout DetrendNorm -key det_id:iter -uniq 152 if ($VERBOSE > 2) 153 book listbook DetrendNorm 204 154 end 205 155 206 156 # delete existing entries which are DONE 207 queuedrop DetrendNorm -key 0 DONE 208 end 209 210 # locked list 157 book delpage DetrendNorm -key state DONE 158 end 159 211 160 # default exit status 212 161 task.exit default … … 227 176 228 177 task.exec 229 queuesizeDetrendNorm -var N178 book npages DetrendNorm -var N 230 179 if ($N == 0) break 231 180 if ($network == 0) break 232 181 233 # look for new images on the internal DetrendNorm queue 234 # caution with these 'if' statements: syntax errors 235 # will make the task fail without given a good status 236 queuepop DetrendNorm -var line -key 0 NEW 237 if ("$line" == "NULL") break 238 239 strpop line state 240 queuepush DetrendNorm -replace -key 4:5 "RUN $line" 241 242 # the DetrendNorm queue contains: 243 # STATE DET_ID ITER 244 list word -split $line 245 $DET_TYPE = $word:0 246 $CAMERA = $word:1 247 $URI = $word:2 248 $DET_ID = $word:3 249 $ITER = $word:4 250 $CLASS_ID = $word:5 251 $NORM = $word:6 252 253 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 254 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 182 # look for new images in DetrendNorm 183 book getpage DetrendNorm 0 -var pageName -key state NULL 184 if ($pageName == NULL) break 185 186 book setword DetrendNorm $pageName state RUN 187 book getword DetrendNorm $pageName det_type -var DET_TYPE 188 book getword DetrendNorm $pageName camera -var CAMERA 189 book getword DetrendNorm $pageName uri -var URI 190 book getword DetrendNorm $pageName det_id -var DET_ID 191 book getword DetrendNorm $pageName iter -var ITER 192 book getword DetrendNorm $pageName class_id -var CLASS_ID 193 book getword DetrendNorm $pageName norm -var NORM 255 194 256 195 # specify choice of remote host: … … 261 200 end 262 201 202 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 203 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 204 205 # save the pageName for future reference below 206 options $pageName 207 263 208 # create example job options as a demonstration 264 options "$line"265 209 if ($VERBOSE > 1) 266 210 echo command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE … … 271 215 # success 272 216 task.exit 0 273 queuepush DetrendNorm -replace -key 4:5 "DONE $options:0" 274 end 275 276 # default exit status 277 task.exit default 278 showcommand failure 279 queuepush DetrendNorm -replace -key 4:5 "FAIL $options:0" 280 $DetrendNormFail ++ 281 end 282 283 # operation times out? 284 task.exit timeout 285 showcommand timeout 286 queuepush DetrendNorm -replace -key 4:5 "TIMEOUT $options:0" 287 $DetrendNormFail ++ 217 book setword DetrendNorm $options:0 state DONE 218 end 219 220 # default exit status 221 task.exit default 222 showcommand failure 223 book setword DetrendNorm $options:0 state FAIL 224 end 225 226 # operation times out? 227 task.exit timeout 228 showcommand timeout 229 book setword DetrendNorm $options:0 state TIMEOUT 288 230 end 289 231 end … … 303 245 304 246 task.exec 305 command dettool -tonormalizedexp -simple -limit {$DetrendNormExpFail + 20}247 command dettool -tonormalizedexp -limit 20 306 248 end 307 249 308 250 # success 309 251 task.exit 0 310 # XXX is it necessary for these to be local? 311 # drop after this task macro is done? 312 local i Nqueue 313 314 # compare output with newImage queue 315 # only add entries which don't exist in queue 316 queuesize stdout -var Nqueue 317 for i 0 $Nqueue 318 queuepop stdout -var line 319 if ($VERBOSE > 2) 320 echo $line 321 end 322 list word -split $line 323 $DET_ID = $word:0 324 $ITER = $word:1 325 $DET_TYPE = $word:2 326 $CAMERA = $word:3 327 #$TELESCOPE= $word:4 328 #$EXP_TYPE = $word:5 329 #$IMFILES = $word:6 330 queuepush DetrendNormExp -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $CAMERA" 252 # convert 'stdout' to book format 253 ipptool2book stdout DetrendNormExp -key det_id:iter -uniq 254 if ($VERBOSE > 2) 255 book listbook DetrendNormExp 331 256 end 332 257 333 258 # delete existing entries which are DONE 334 queuedrop DetrendNormExp -key 0 DONE 335 end 336 337 # locked list 259 book delpage DetrendNormExp -key state DONE 260 end 261 338 262 # default exit status 339 263 task.exit default … … 354 278 355 279 task.exec 356 queuesize DetrendNormExp -var N 357 280 book npages DetrendNormExp -var N 358 281 if ($N == 0) break 359 282 if ($network == 0) break 360 283 361 # look for new images on the internal DetrendNormExp queue 362 # caution with these 'if' statements: syntax errors 363 # will make the task fail without given a good status 364 queuepop DetrendNormExp -var line -key 0 NEW 365 if ("$line" == "NULL") break 366 367 strpop line state 368 queuepush DetrendNormExp -replace -key 1:2 "RUN $line" 369 370 # the DetrendNormExp queue contains: 371 # STATE DET_ID ITER 372 list word -split $line 373 $DET_ID = $word:0 374 $ITER = $word:1 375 $DET_TYPE = $word:2 376 $CAMERA = $word:3 377 #$TELESCOPE= $word:4 378 #$EXP_TYPE = $word:5 379 #$IMFILES = $word:6 380 381 # XXX add $WORKDIR/$LOG_DIR 382 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 383 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 284 # look for new images in DetrendNormExp 285 book getpage DetrendNormExp 0 -var pageName -key state NULL 286 if ($pageName == NULL) break 287 288 book setword DetrendNormExp $pageName state RUN 289 book getword DetrendNormExp $pageName det_id -var DET_ID 290 book getword DetrendNormExp $pageName iter -var ITER 291 book getword DetrendNormExp $pageName det_type -var DET_TYPE 292 book getword DetrendNormExp $pageName camera -var CAMERA 384 293 385 294 # specify choice of remote host: … … 390 299 end 391 300 301 # XXX add $WORKDIR/$LOG_DIR 302 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 303 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 304 305 # save the pageName for future reference below 306 options $pageName 307 392 308 # create example job options as a demonstration 393 options "$line"394 309 if ($VERBOSE > 1) 395 310 echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITER --camera $CAMERA --det_type $DET_TYPE … … 400 315 # success 401 316 task.exit 0 402 queuepush DetrendNormExp -replace -key 1:2 "DONE $options:0" 403 end 404 405 # default exit status 406 task.exit default 407 showcommand failure 408 queuepush DetrendNormExp -replace -key 1:2 "FAIL $options:0" 409 $DetrendNormExpFail ++ 410 end 411 412 # operation times out? 413 task.exit timeout 414 showcommand timeout 415 queuepush DetrendNormExp -replace -key 1:2 "TIMEOUT $options:0" 416 $DetrendNormExpFail ++ 417 end 418 end 317 book setword DetrendNormExp $options:0 state DONE 318 end 319 320 # default exit status 321 task.exit default 322 showcommand failure 323 book setword DetrendNormExp $options:0 state FAIL 324 end 325 326 # operation times out? 327 task.exit timeout 328 showcommand timeout 329 book setword DetrendNormExp $options:0 state TIMEOUT 330 end 331 end
Note:
See TracChangeset
for help on using the changeset viewer.
