Changeset 10692 for trunk/ippTasks/detrend.norm.pro
- Timestamp:
- Dec 12, 2006, 11:58:21 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/detrend.norm.pro (modified) (26 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/detrend.norm.pro
r9506 r10692 2 2 ## this file contains the tasks for running the detrend normalization stage 3 3 4 ## these tasks use the queue DetrendNorm alize5 ## the DetrendNorm alizequeue contains:4 ## these tasks use the queue DetrendNorm 5 ## the DetrendNorm queue contains: 6 6 ## STATE DET_ID ITER 7 7 8 queueinit DetrendNorm alize8 queueinit DetrendNorm 9 9 queueinit DetrendNormStat 10 queueinit DetrendNorm alizeExposures10 queueinit DetrendNormExp 11 11 if ($?network == 0) 12 12 $network = 1 … … 14 14 if ($?parallel == 0) 15 15 $parallel = 0 16 end 17 18 $DetrendNormFail = 0 19 $DetrendNormStatFail = 0 20 $DetrendNormExpFail = 0 21 22 if ($?VERBOSE == 0) 23 echo "VERBOSE not defined: load pantasks.pro first" 24 break 25 end 26 if ($?LOGDIR == 0) 27 echo "LOGDIR not defined: load pantasks.pro first" 28 break 29 end 30 $LOGSUBDIR = $LOGDIR/detrend 31 exec mkdir -p $LOGSUBDIR 32 33 macro detnorm.status 34 queueprint DetrendNorm 35 queueprint DetrendNormStat 36 queueprint DetrendNormExp 37 echo "DetrendNormFail: $DetrendNormFail" 38 echo "DetrendNormStatFail: $DetrendNormStatFail" 39 echo "DetrendNormExpFail: $DetrendNormExpFail" 16 40 end 17 41 … … 20 44 # compare the new list with the ones already selected 21 45 task dettool.normstat.load 22 command dettool -tonormalizedstat -simple23 46 host local 24 47 … … 27 50 periods -timeout 30 28 51 29 stdout dettool.normstat.log 30 stderr dettool.normstat.log 52 stdout $LOGSUBDIR/dettool.normstat.log 53 stderr $LOGSUBDIR/dettool.normstat.log 54 55 task.exec 56 command dettool -tonormalizedstat -simple -limit {$DetrendNormStatFail + 20} 57 end 31 58 32 59 # success … … 41 68 for i 0 $Nqueue 42 69 queuepop stdout -var line 70 if ($VERBOSE > 2) 71 echo $line 72 end 43 73 list word -split $line 44 74 $DET_ID = $word:0 … … 56 86 # default exit status 57 87 task.exit default 58 echo "detrend.norm: failure" 59 end 60 61 # operation times out? 62 task.exit timeout 63 echo "detrend.norm: timeout" 88 if ($VERBOSE) 89 echo "detrend.norm: failure" 90 end 91 end 92 93 # operation times out? 94 task.exit timeout 95 if ($VERBOSE) 96 echo "detrend.norm: timeout" 97 end 64 98 end 65 99 end … … 73 107 task.exec 74 108 queuesize DetrendNormStat -var N 75 76 109 if ($N == 0) break 77 110 if ($network == 0) break … … 95 128 96 129 # XXX add $WORKDIR/$LOG_DIR 97 stdout $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log98 stderr $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log130 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 131 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 99 132 100 133 # specify choice of remote host: … … 107 140 # create example job options as a demonstration 108 141 options "$line" 109 echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE 142 if ($VERBOSE > 1) 143 echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE 144 end 110 145 command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE 111 146 end … … 118 153 # default exit status 119 154 task.exit default 155 if ($VERBOSE) 156 echo "failure detrend_norm_calc.pl $options:0" 157 end 120 158 queuepush DetrendNormStat -replace -key 1:3 "FAIL $options:0" 121 end 122 123 # operation times out? 124 task.exit timeout 159 $DetrendNormStatFail ++ 160 end 161 162 # operation times out? 163 task.exit timeout 164 if ($VERBOSE) 165 echo "failure detrend_norm_calc.pl $options:0" 166 end 125 167 queuepush DetrendNormStat -replace -key 1:3 "TIMEOUT $options:0" 168 $DetrendNormStatFail ++ 126 169 end 127 170 end 128 171 129 172 # select images ready for copy 130 # new entries are added to queue DetrendNorm alize173 # new entries are added to queue DetrendNorm 131 174 # compare the new list with the ones already selected 132 175 task dettool.norm.load 133 command dettool -tonormalize -simple134 176 host local 135 177 … … 138 180 periods -timeout 30 139 181 140 stdout dettool.norm.log 141 stderr dettool.norm.log 182 stdout $LOGSUBDIR/dettool.norm.log 183 stderr $LOGSUBDIR/dettool.norm.log 184 185 task.exec 186 command dettool -tonormalize -simple -limit {$DetrendNormFail + 20} 187 end 142 188 143 189 # success … … 152 198 for i 0 $Nqueue 153 199 queuepop stdout -var line 200 if ($VERBOSE > 2) 201 echo $line 202 end 154 203 list word -split $line 155 204 $DET_TYPE = $word:0 … … 160 209 $CLASS_ID = $word:5 161 210 $NORM = $word:6 162 queuepush DetrendNorm alize-uniq -key 4:5 "NEW $DET_TYPE $CAMERA $URI $DET_ID $ITER $CLASS_ID $NORM"211 queuepush DetrendNorm -uniq -key 4:5 "NEW $DET_TYPE $CAMERA $URI $DET_ID $ITER $CLASS_ID $NORM" 163 212 end 164 213 165 214 # delete existing entries which are DONE 166 queuedrop DetrendNorm alize-key 0 DONE215 queuedrop DetrendNorm -key 0 DONE 167 216 end 168 217 … … 170 219 # default exit status 171 220 task.exit default 172 echo "detrend.norm: failure" 173 end 174 175 # operation times out? 176 task.exit timeout 177 echo "detrend.norm: timeout" 221 if ($VERBOSE) 222 echo "detrend.norm: failure" 223 end 224 end 225 226 # operation times out? 227 task.exit timeout 228 if ($VERBOSE) 229 echo "detrend.norm: timeout" 230 end 178 231 end 179 232 end … … 186 239 187 240 task.exec 188 queuesize DetrendNormalize -var N 189 241 queuesize DetrendNorm -var N 190 242 if ($N == 0) break 191 243 if ($network == 0) break 192 244 193 # look for new images on the internal DetrendNorm alizequeue245 # look for new images on the internal DetrendNorm queue 194 246 # caution with these 'if' statements: syntax errors 195 247 # will make the task fail without given a good status 196 queuepop DetrendNorm alize-var line -key 0 NEW248 queuepop DetrendNorm -var line -key 0 NEW 197 249 if ("$line" == "NULL") break 198 250 199 251 strpop line state 200 queuepush DetrendNorm alize-replace -key 4:5 "RUN $line"201 202 # the DetrendNorm alizequeue contains:252 queuepush DetrendNorm -replace -key 4:5 "RUN $line" 253 254 # the DetrendNorm queue contains: 203 255 # STATE DET_ID ITER 204 256 list word -split $line … … 211 263 $NORM = $word:6 212 264 213 $LOG_DIR = `dirname $URI` 214 215 stdout $WORKDIR/$LOG_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 216 stderr $WORKDIR/$LOG_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 265 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 266 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 217 267 218 268 # specify choice of remote host: … … 225 275 # create example job options as a demonstration 226 276 options "$line" 227 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 277 if ($VERBOSE > 1) 278 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 279 end 228 280 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 229 281 end … … 231 283 # success 232 284 task.exit 0 233 queuepush DetrendNormalize -replace -key 4:5 "DONE $options:0" 234 end 235 236 # default exit status 237 task.exit default 238 queuepush DetrendNormalize -replace -key 4:5 "FAIL $options:0" 239 end 240 241 # operation times out? 242 task.exit timeout 243 queuepush DetrendNormalize -replace -key 4:5 "TIMEOUT $options:0" 285 queuepush DetrendNorm -replace -key 4:5 "DONE $options:0" 286 end 287 288 # default exit status 289 task.exit default 290 if ($VERBOSE) 291 echo "failure detrend_norm_apply.pl $options:0" 292 end 293 queuepush DetrendNorm -replace -key 4:5 "FAIL $options:0" 294 $DetrendNormFail ++ 295 end 296 297 # operation times out? 298 task.exit timeout 299 if ($VERBOSE) 300 echo "failure detrend_norm_apply.pl $options:0" 301 end 302 queuepush DetrendNorm -replace -key 4:5 "TIMEOUT $options:0" 303 $DetrendNormFail ++ 244 304 end 245 305 end 246 306 247 307 # select images ready for copy 248 # new entries are added to queue DetrendNorm alizeExposures308 # new entries are added to queue DetrendNormExp 249 309 # compare the new list with the ones already selected 250 310 task dettool.normexp.load 251 command dettool -tonormalizedexp -simple252 311 host local 253 312 … … 256 315 periods -timeout 30 257 316 258 stdout dettool.normexp.log 259 stderr dettool.normexp.log 317 stdout $LOGSUBDIR/dettool.normexp.log 318 stderr $LOGSUBDIR/dettool.normexp.log 319 320 task.exec 321 command dettool -tonormalizedexp -simple -limit {$DetrendNormExpFail + 20} 322 end 260 323 261 324 # success … … 270 333 for i 0 $Nqueue 271 334 queuepop stdout -var line 335 if ($VERBOSE > 2) 336 echo $line 337 end 272 338 list word -split $line 273 339 $DET_ID = $word:0 … … 278 344 #$EXP_TYPE = $word:5 279 345 #$IMFILES = $word:6 280 queuepush DetrendNormalizeExp osures-uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $CAMERA"346 queuepush DetrendNormalizeExp -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $CAMERA" 281 347 end 282 348 283 349 # delete existing entries which are DONE 284 queuedrop DetrendNorm alizeExposures-key 0 DONE350 queuedrop DetrendNormExp -key 0 DONE 285 351 end 286 352 … … 288 354 # default exit status 289 355 task.exit default 290 echo "detrend.norm: failure" 291 end 292 293 # operation times out? 294 task.exit timeout 295 echo "detrend.norm: timeout" 356 if ($VERBOSE) 357 echo "detrend.norm: failure" 358 end 359 end 360 361 # operation times out? 362 task.exit timeout 363 if ($VERBOSE) 364 echo "detrend.norm: timeout" 365 end 296 366 end 297 367 end … … 304 374 305 375 task.exec 306 queuesize DetrendNorm alizeExposures-var N376 queuesize DetrendNormExp -var N 307 377 308 378 if ($N == 0) break 309 379 if ($network == 0) break 310 380 311 # look for new images on the internal DetrendNorm alizeExposuresqueue381 # look for new images on the internal DetrendNormExp queue 312 382 # caution with these 'if' statements: syntax errors 313 383 # will make the task fail without given a good status 314 queuepop DetrendNorm alizeExposures-var line -key 0 NEW384 queuepop DetrendNormExp -var line -key 0 NEW 315 385 if ("$line" == "NULL") break 316 386 317 387 strpop line state 318 queuepush DetrendNorm alizeExposures-replace -key 1:2 "RUN $line"319 320 # the DetrendNorm alizeExposuresqueue contains:388 queuepush DetrendNormExp -replace -key 1:2 "RUN $line" 389 390 # the DetrendNormExp queue contains: 321 391 # STATE DET_ID ITER 322 392 list word -split $line … … 330 400 331 401 # XXX add $WORKDIR/$LOG_DIR 332 stdout $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log333 stderr $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log402 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 403 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 334 404 335 405 # specify choice of remote host: … … 342 412 # create example job options as a demonstration 343 413 options "$line" 344 echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITER --camera $CAMERA --det_type $DET_TYPE 414 if ($VERBOSE > 1) 415 echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITER --camera $CAMERA --det_type $DET_TYPE 416 end 345 417 command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITER --camera $CAMERA --det_type $DET_TYPE 346 418 end … … 348 420 # success 349 421 task.exit 0 350 queuepush DetrendNormalizeExposures -replace -key 1:2 "DONE $options:0" 351 end 352 353 # default exit status 354 task.exit default 355 queuepush DetrendNormalizeExposures -replace -key 1:2 "FAIL $options:0" 356 end 357 358 # operation times out? 359 task.exit timeout 360 queuepush DetrendNormalizeExposures -replace -key 1:2 "TIMEOUT $options:0" 361 end 362 end 422 queuepush DetrendNormExp -replace -key 1:2 "DONE $options:0" 423 end 424 425 # default exit status 426 task.exit default 427 if ($VERBOSE) 428 echo "failure detrend_norm_exp.pl $options:0" 429 end 430 queuepush DetrendNormExp -replace -key 1:2 "FAIL $options:0" 431 $DetrendNormExpFail ++ 432 end 433 434 # operation times out? 435 task.exit timeout 436 if ($VERBOSE) 437 echo "failure detrend_norm_exp.pl $options:0" 438 end 439 queuepush DetrendNormExp -replace -key 1:2 "TIMEOUT $options:0" 440 $DetrendNormExpFail ++ 441 end 442 end
Note:
See TracChangeset
for help on using the changeset viewer.
