IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2009, 6:15:31 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ippTasks/detrend.resid.pro

    r23352 r23594  
    88book init detPendingResidImfile
    99book init detPendingResidExp
    10 book init detCleanupResidImfile
    11 book init detCleanupResidExp
    1210
    1311macro detresid.reset
    1412  book init detPendingResidImfile
    1513  book init detPendingResidExp
    16   book init detCleanupResidImfile
    17   book init detCleanupResidExp
    1814end
    1915
     
    2117  book listbook detPendingResidImfile
    2218  book listbook detPendingResidExp
    23   book listbook detCleanupResidImfile
    24   book listbook detCleanupResidExp
    2519end
    2620
     
    3832    active true
    3933  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
    5234end
    5335
     
    6547    active false
    6648  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
    77     active false
    78   end
    7949end
    8050
     
    8252$detPendingResidImfile_DB = 0
    8353$detPendingResidExp_DB = 0
    84 $detCleanupResidImfile_DB = 0
    85 $detCleanupResidExp_DB = 0
    8654
    8755# select images ready for copy
     
    348316  end
    349317end
    350 
    351 ######## cleanup resid imfile ########
    352 task           detrend.cleanup.resid.load
    353   host         local
    354 
    355   periods      -poll $LOADPOLL
    356   periods      -exec $LOADEXEC
    357   periods      -timeout 30
    358   npending     1
    359   active       true
    360 
    361   stdout NULL
    362   stderr $LOGDIR/detrend.cleanup.resid.imfile.log
    363 
    364   task.exec
    365     $run = dettool -pendingcleanup_residimfile
    366     if ($DB:n == 0)
    367       option DEFAULT
    368     else
    369       # save the DB name for the exit tasks
    370       option $DB:$detCleanupResidImfile_DB
    371       $run = $run -dbname $DB:$detCleanupResidImfile_DB
    372       $detCleanupResidImfile_DB ++
    373       if ($detCleanupResidImfile_DB >= $DB:n) set detCleanupResidImfile_DB = 0
    374     end
    375     add_poll_args run
    376     command $run
    377   end
    378 
    379   # success
    380   task.exit    0
    381     # convert 'stdout' to book format
    382     ipptool2book stdout detCleanupResidImfile -key det_id:iteration:exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    383     if ($VERBOSE > 2)
    384       book listbook detCleanupResidImfile
    385     end
    386 
    387     # delete existing entries in the appropriate pantaskStates
    388     process_cleanup detCleanupResidImfile
    389   end
    390 
    391   # locked list
    392   task.exit    default
    393     showcommand failure
    394   end
    395 
    396   task.exit    crash
    397     showcommand crash
    398   end
    399 
    400   # operation times out?
    401   task.exit    timeout
    402     showcommand timeout
    403   end
    404 end
    405 
    406 # run the ipp_cleanup.pl script on pending images
    407 task           detrend.cleanup.resid.run
    408   periods      -poll $RUNPOLL
    409   periods      -exec $RUNEXEC
    410   periods      -timeout 60
    411   active       true
    412 
    413   task.exec
    414     book npages detCleanupResidImfile -var N
    415     if ($N == 0) break
    416     if ($NETWORK == 0) break
    417    
    418     # look for new images in detCleanupResidImfile (pantaskState == INIT)
    419     book getpage detCleanupResidImfile 0 -var pageName -key pantaskState INIT
    420     if ("$pageName" == "NULL") break
    421 
    422     book setword detCleanupResidImfile $pageName pantaskState RUN
    423     book getword detCleanupResidImfile $pageName det_id   -var DET_ID   
    424     book getword detCleanupResidImfile $pageName exp_id   -var EXP_ID   
    425     book getword detCleanupResidImfile $pageName class_id -var CLASS_ID
    426     book getword detCleanupResidImfile $pageName iteration -var ITERATION     
    427     book getword detCleanupResidImfile $pageName camera -var CAMERA
    428     book getword detCleanupResidImfile $pageName state -var CLEANUP_MODE
    429     book getword detCleanupResidImfile $pageName dbname -var DBNAME
    430 
    431     # specify choice of local or remote host based on camera and chip (class_id)
    432     set.host.for.camera $CAMERA FPA
    433 
    434     stdout $LOGDIR/detrend.cleanup.resid.imfile.log
    435     stderr $LOGDIR/detrend.cleanup.resid.imfile.log
    436 
    437     # XXX is everything listed here needed?
    438     $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
    439     add_standard_args run
    440 
    441     # save the pageName for future reference below
    442     options $pageName
    443 
    444     # create the command line
    445     if ($VERBOSE > 1)
    446       echo command $run
    447     end
    448     command $run
    449   end
    450 
    451   # default exit status
    452   task.exit    default
    453     process_exit detCleanupResidImfile $options:0 $JOB_STATUS
    454   end
    455 
    456   # locked list
    457   task.exit    crash
    458     showcommand crash
    459     echo "hostname: $JOB_HOSTNAME"
    460     book setword detCleanupResidImfile $options:0 pantaskState CRASH
    461   end
    462 
    463   # operation timed out?
    464   task.exit    timeout
    465     showcommand timeout
    466     book setword detCleanupResidImfile $options:0 pantaskState TIMEOUT
    467   end
    468 end
    469  
    470 
    471 ######## cleanup resid exp ########
    472 task           detrend.cleanup.residexp.load
    473   host         local
    474 
    475   periods      -poll $LOADPOLL
    476   periods      -exec $LOADEXEC
    477   periods      -timeout 30
    478   npending     1
    479   active       true
    480 
    481   stdout NULL
    482   stderr $LOGDIR/detrend.cleanup.resid.exp.log
    483 
    484   task.exec
    485     $run = dettool -pendingcleanup_residexp
    486     if ($DB:n == 0)
    487       option DEFAULT
    488     else
    489       # save the DB name for the exit tasks
    490       option $DB:$detCleanupResidExp_DB
    491       $run = $run -dbname $DB:$detCleanupResidExp_DB
    492       $detCleanupResidExp_DB ++
    493       if ($detCleanupResidExp_DB >= $DB:n) set detCleanupResidExp_DB = 0
    494     end
    495     add_poll_args run
    496     command $run
    497   end
    498 
    499   # success
    500   task.exit    0
    501     # convert 'stdout' to book format
    502     ipptool2book stdout detCleanupResidExp -key det_id:iteration:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    503     if ($VERBOSE > 2)
    504       book listbook detCleanupResidExp
    505     end
    506 
    507     # delete existing entries in the appropriate pantaskStates
    508     process_cleanup detCleanupResidExp
    509   end
    510 
    511   # locked list
    512   task.exit    default
    513     showcommand failure
    514   end
    515 
    516   task.exit    crash
    517     showcommand crash
    518   end
    519 
    520   # operation times out?
    521   task.exit    timeout
    522     showcommand timeout
    523   end
    524 end
    525 
    526 # run the ipp_cleanup.pl script on pending images
    527 task           detrend.cleanup.residexp.run
    528   periods      -poll $RUNPOLL
    529   periods      -exec $RUNEXEC
    530   periods      -timeout 60
    531   active       true
    532 
    533   task.exec
    534     book npages detCleanupResidExp -var N
    535     if ($N == 0) break
    536     if ($NETWORK == 0) break
    537    
    538     # look for new images in detCleanupResidExp (pantaskState == INIT)
    539     book getpage detCleanupResidExp 0 -var pageName -key pantaskState INIT
    540     if ("$pageName" == "NULL") break
    541 
    542     book setword detCleanupResidExp $pageName pantaskState RUN
    543     book getword detCleanupResidExp $pageName det_id    -var DET_ID   
    544     book getword detCleanupResidExp $pageName exp_id    -var EXP_ID   
    545     book getword detCleanupResidExp $pageName iteration -var ITERATION
    546     book getword detCleanupResidExp $pageName camera    -var CAMERA
    547     book getword detCleanupResidExp $pageName state     -var CLEANUP_MODE
    548     book getword detCleanupResidExp $pageName dbname    -var DBNAME
    549 
    550     # specify choice of local or remote host based on camera and chip (class_id)
    551     set.host.for.camera $CAMERA FPA
    552 
    553     stdout $LOGDIR/detrend.cleanup.resid.exp.log
    554     stderr $LOGDIR/detrend.cleanup.resid.exp.log
    555 
    556     # XXX is everything listed here needed?
    557     $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
    558     add_standard_args run
    559 
    560     # save the pageName for future reference below
    561     options $pageName
    562 
    563     # create the command line
    564     if ($VERBOSE > 1)
    565       echo command $run
    566     end
    567     command $run
    568   end
    569 
    570   # default exit status
    571   task.exit    default
    572     process_exit detCleanupResidExp $options:0 $JOB_STATUS
    573   end
    574 
    575   # locked list
    576   task.exit    crash
    577     showcommand crash
    578     echo "hostname: $JOB_HOSTNAME"
    579     book setword detCleanupResidExp $options:0 pantaskState CRASH
    580   end
    581 
    582   # operation timed out?
    583   task.exit    timeout
    584     showcommand timeout
    585     book setword detCleanupResidExp $options:0 pantaskState TIMEOUT
    586   end
    587 end
Note: See TracChangeset for help on using the changeset viewer.