Changeset 19089 for trunk/ippTasks/detrend.resid.pro
- Timestamp:
- Aug 16, 2008, 1:06:59 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/detrend.resid.pro (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/detrend.resid.pro
r18606 r19089 8 8 book init detPendingResidImfile 9 9 book init detPendingResidExp 10 book init detCleanupResidImfile 11 book init detCleanupResidExp 10 12 11 13 macro detresid.reset 12 14 book init detPendingResidImfile 13 15 book init detPendingResidExp 16 book init detCleanupResidImfile 17 book init detCleanupResidExp 14 18 end 15 19 … … 17 21 book listbook detPendingResidImfile 18 22 book listbook detPendingResidExp 23 book listbook detCleanupResidImfile 24 book listbook detCleanupResidExp 19 25 end 20 26 … … 32 38 active true 33 39 end 40 task detrend.cleanup.resid.load 41 active true 42 end 43 task detrend.cleanup.resid.run 44 active true 45 end 46 task detrend.cleanup.residexp.load 47 active true 48 end 49 task detrend.cleanup.residexp.run 50 active true 51 end 34 52 end 35 53 … … 45 63 end 46 64 task detrend.residexp.run 65 active false 66 end 67 task detrend.cleanup.resid.load 68 active false 69 end 70 task detrend.cleanup.resid.run 71 active false 72 end 73 task detrend.cleanup.residexp.load 74 active false 75 end 76 task detrend.cleanup.residexp.run 47 77 active false 48 78 end … … 52 82 $detPendingResidImfile_DB = 0 53 83 $detPendingResidExp_DB = 0 84 $detCleanupResidImfile_DB = 0 85 $detCleanupResidExp_DB = 0 54 86 55 87 # select images ready for copy … … 65 97 66 98 stdout NULL 67 stderr $LOGDIR/detre sid.load.log99 stderr $LOGDIR/detrend.resid.imfile.log 68 100 69 101 task.exec … … 142 174 sprintf outroot "%s/%s.%s.%s/%s/%s.detresid.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION 143 175 144 stdout $LOGDIR/detre sid.run.log145 stderr $LOGDIR/detre sid.run.log176 stdout $LOGDIR/detrend.resid.imfile.log 177 stderr $LOGDIR/detrend.resid.imfile.log 146 178 147 179 $run = detrend_resid_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_id $EXP_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE --outroot $outroot --redirect-output --verbose … … 186 218 187 219 stdout NULL 188 stderr $LOGDIR/detre sid.exp.load.log220 stderr $LOGDIR/detrend.resid.exp.log 189 221 190 222 task.exec … … 260 292 sprintf outroot "%s/%s.%s.%s/%s/%s.detresid.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION 261 293 262 stdout $LOGDIR/detre sid.exp.run.log263 stderr $LOGDIR/detre sid.exp.run.log294 stdout $LOGDIR/detrend.resid.exp.log 295 stderr $LOGDIR/detrend.resid.exp.log 264 296 265 297 $run = detrend_resid_exp.pl --det_id $DET_ID --iteration $ITERATION --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output --verbose … … 288 320 end 289 321 end 322 323 ######## cleanup resid imfile ######## 324 task detrend.cleanup.resid.load 325 host local 326 327 periods -poll $LOADPOLL 328 periods -exec $LOADEXEC 329 periods -timeout 30 330 npending 1 331 active true 332 333 stdout NULL 334 stderr $LOGDIR/detrend.cleanup.resid.imfile.log 335 336 task.exec 337 if ($DB:n == 0) 338 option DEFAULT 339 command dettool -pendingcleanup_residimfile -limit 20 340 else 341 # save the DB name for the exit tasks 342 option $DB:$detCleanupResidImfile_DB 343 command dettool -pendingcleanup_residimfile -limit 20 -dbname $DB:$detCleanupResidImfile_DB 344 $detCleanupResidImfile_DB ++ 345 if ($detCleanupResidImfile_DB >= $DB:n) set detCleanupResidImfile_DB = 0 346 end 347 end 348 349 # success 350 task.exit 0 351 # convert 'stdout' to book format 352 ipptool2book stdout detCleanupResidImfile -key det_id:iteration:exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT 353 if ($VERBOSE > 2) 354 book listbook detCleanupResidImfile 355 end 356 357 # delete existing entries in the appropriate pantaskStates 358 process_cleanup detCleanupResidImfile 359 end 360 361 # locked list 362 task.exit default 363 showcommand failure 364 end 365 366 # operation times out? 367 task.exit timeout 368 showcommand timeout 369 end 370 end 371 372 # run the ipp_cleanup.pl script on pending images 373 task detrend.cleanup.resid.run 374 periods -poll $RUNPOLL 375 periods -exec $RUNEXEC 376 periods -timeout 60 377 active true 378 379 task.exec 380 book npages detCleanupResidImfile -var N 381 if ($N == 0) break 382 if ($NETWORK == 0) break 383 384 # look for new images in detCleanupResidImfile (pantaskState == INIT) 385 book getpage detCleanupResidImfile 0 -var pageName -key pantaskState INIT 386 if ("$pageName" == "NULL") break 387 388 book setword detCleanupResidImfile $pageName pantaskState RUN 389 book getword detCleanupResidImfile $pageName det_id -var DET_ID 390 book getword detCleanupResidImfile $pageName exp_id -var EXP_ID 391 book getword detCleanupResidImfile $pageName class_id -var CLASS_ID 392 book getword detCleanupResidImfile $pageName iteration -var ITERATION 393 book getword detCleanupResidImfile $pageName camera -var CAMERA 394 book getword detCleanupResidImfile $pageName state -var CLEANUP_MODE 395 book getword detCleanupResidImfile $pageName dbname -var DBNAME 396 397 # specify choice of local or remote host based on camera and chip (class_id) 398 set.host.for.camera $CAMERA FPA 399 400 stdout $LOGDIR/detrend.cleanup.resid.imfile.log 401 stderr $LOGDIR/detrend.cleanup.resid.imfile.log 402 403 # XXX is everything listed here needed? 404 $run = ipp_cleanup.pl --stage detrend.resid.imfile --stage_id $DET_ID --exp_id $EXP_ID --class_id $CLASS_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE 405 add_standard_args run 406 407 # save the pageName for future reference below 408 options $pageName 409 410 # create the command line 411 if ($VERBOSE > 1) 412 echo command $run 413 end 414 command $run 415 end 416 417 # default exit status 418 task.exit default 419 process_exit detCleanupResidImfile $options:0 $JOB_STATUS 420 end 421 422 # operation timed out? 423 task.exit timeout 424 showcommand timeout 425 book setword detCleanupResidImfile $options:0 pantaskState TIMEOUT 426 end 427 end 428 429 430 ######## cleanup resid exp ######## 431 task detrend.cleanup.residexp.load 432 host local 433 434 periods -poll $LOADPOLL 435 periods -exec $LOADEXEC 436 periods -timeout 30 437 npending 1 438 active true 439 440 stdout NULL 441 stderr $LOGDIR/detrend.cleanup.resid.exp.log 442 443 task.exec 444 if ($DB:n == 0) 445 option DEFAULT 446 command dettool -pendingcleanup_residexp -limit 20 447 else 448 # save the DB name for the exit tasks 449 option $DB:$detCleanupResidExp_DB 450 command dettool -pendingcleanup_residexp -limit 20 -dbname $DB:$detCleanupResidExp_DB 451 $detCleanupResidExp_DB ++ 452 if ($detCleanupResidExp_DB >= $DB:n) set detCleanupResidExp_DB = 0 453 end 454 end 455 456 # success 457 task.exit 0 458 # convert 'stdout' to book format 459 ipptool2book stdout detCleanupResidExp -key det_id:iteration:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT 460 if ($VERBOSE > 2) 461 book listbook detCleanupResidExp 462 end 463 464 # delete existing entries in the appropriate pantaskStates 465 process_cleanup detCleanupResidExp 466 end 467 468 # locked list 469 task.exit default 470 showcommand failure 471 end 472 473 # operation times out? 474 task.exit timeout 475 showcommand timeout 476 end 477 end 478 479 # run the ipp_cleanup.pl script on pending images 480 task detrend.cleanup.residexp.run 481 periods -poll $RUNPOLL 482 periods -exec $RUNEXEC 483 periods -timeout 60 484 active true 485 486 task.exec 487 book npages detCleanupResidExp -var N 488 if ($N == 0) break 489 if ($NETWORK == 0) break 490 491 # look for new images in detCleanupResidExp (pantaskState == INIT) 492 book getpage detCleanupResidExp 0 -var pageName -key pantaskState INIT 493 if ("$pageName" == "NULL") break 494 495 book setword detCleanupResidExp $pageName pantaskState RUN 496 book getword detCleanupResidExp $pageName det_id -var DET_ID 497 book getword detCleanupResidExp $pageName exp_id -var EXP_ID 498 book getword detCleanupResidExp $pageName iteration -var ITERATION 499 book getword detCleanupResidExp $pageName camera -var CAMERA 500 book getword detCleanupResidExp $pageName state -var CLEANUP_MODE 501 book getword detCleanupResidExp $pageName dbname -var DBNAME 502 503 # specify choice of local or remote host based on camera and chip (class_id) 504 set.host.for.camera $CAMERA FPA 505 506 stdout $LOGDIR/detrend.cleanup.resid.exp.log 507 stderr $LOGDIR/detrend.cleanup.resid.exp.log 508 509 # XXX is everything listed here needed? 510 $run = ipp_cleanup.pl --stage detrend.resid.exp --stage_id $DET_ID --exp_id $EXP_ID --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE 511 add_standard_args run 512 513 # save the pageName for future reference below 514 options $pageName 515 516 # create the command line 517 if ($VERBOSE > 1) 518 echo command $run 519 end 520 command $run 521 end 522 523 # default exit status 524 task.exit default 525 process_exit detCleanupResidExp $options:0 $JOB_STATUS 526 end 527 528 # operation timed out? 529 task.exit timeout 530 showcommand timeout 531 book setword detCleanupResidExp $options:0 pantaskState TIMEOUT 532 end 533 end
Note:
See TracChangeset
for help on using the changeset viewer.
