IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23480


Ignore:
Timestamp:
Mar 20, 2009, 6:08:06 PM (17 years ago)
Author:
eugene
Message:

move detrend cleanup tasks to new detrend.cleanup.pro

Location:
trunk/ippTasks
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/Makefile.am

    r23248 r23480  
    11task_files = \
    2         detrend.mkruns.pro \
    32        detrend.norm.pro \
    43        detrend.process.pro \
     
    76        detrend.stack.pro \
    87        detrend.correct.pro \
     8        detrend.cleanup.pro \
    99        flatcorr.pro \
    1010        automate.pro \
     
    3636        simtest.flatcorr.config \
    3737        simtest.flatcorr.auto \
     38        simtest.ctemask.config \
     39        simtest.ctemask.auto \
    3840        simtest.stack.config \
    3941        simtest.stack.auto
  • trunk/ippTasks/detrend.norm.pro

    r23230 r23480  
    99book init detPendingNormImfile
    1010book init detPendingNormExp
    11 
    12 book init detCleanupNormStatImfile
    13 book init detCleanupNormImfile
    14 book init detCleanupNormExp
    1511
    1612macro detnorm.reset
     
    1814  book init detPendingNormImfile
    1915  book init detPendingNormExp
    20 
    21   book init detCleanupNormStatImfile
    22   book init detCleanupNormImfile
    23   book init detCleanupNormExp
    2416end
    2517
     
    2820  book listbook detPendingNormImfile
    2921  book listbook detPendingNormExp
    30 
    31   book listbook detCleanupNormStatImfile
    32   book listbook detCleanupNormImfile
    33   book listbook detCleanupNormExp
    3422end
    3523
     
    5341    active true
    5442  end
    55 
    56   task detrend.cleanup.norm.load
    57     active true
    58   end
    59   task detrend.cleanup.norm.run
    60     active true
    61   end
    62   task detrend.cleanup.normexp.load
    63     active true
    64   end
    65   task detrend.cleanup.normexp.run
    66     active true
    67   end
    68   task detrend.cleanup.normstat.load
    69     active true
    70   end
    71   task detrend.cleanup.normstat.run
    72     active true
    73   end
    7443end
    7544
     
    9160  end
    9261  task detrend.normstat.run
    93     active false
    94   end
    95   task detrend.cleanup.norm.load
    96     active false
    97   end
    98   task detrend.cleanup.norm.run
    99     active false
    100   end
    101   task detrend.cleanup.normexp.load
    102     active false
    103   end
    104   task detrend.cleanup.normexp.run
    105     active false
    106   end
    107   task detrend.cleanup.normstat.load
    108     active false
    109   end
    110   task detrend.cleanup.normstat.run
    11162    active false
    11263  end
     
    11768$detPendingNormImfile_DB = 0
    11869$detPendingNormExp_DB = 0
    119 
    120 $detCleanupNormStatImfile_DB = 0
    121 $detCleanupNormImfile_DB = 0
    122 $detCleanupNormExp_DB = 0
    12370
    12471# select images ready for copy
     
    493440  end
    494441end
    495 
    496 ########## cleanup normstat ###########
    497 task           detrend.cleanup.normstat.load
    498   host         local
    499 
    500   periods      -poll $LOADPOLL
    501   periods      -exec $LOADEXEC
    502   periods      -timeout 30
    503   npending     1
    504   active       true
    505 
    506   stdout NULL
    507   stderr $LOGDIR/detrend.cleanup.normstat.log
    508 
    509   task.exec
    510     $run = dettool -pendingcleanup_normalizedstat
    511     if ($DB:n == 0)
    512       option DEFAULT
    513     else
    514       # save the DB name for the exit tasks
    515       option $DB:$detCleanupNormStatImfile_DB
    516       $run = $run -dbname $DB:$detCleanupNormStatImfile_DB
    517       $detCleanupNormStatImfile_DB ++
    518       if ($detCleanupNormStatImfile_DB >= $DB:n) set detCleanupNormStatImfile_DB = 0
    519     end
    520     add_poll_args run
    521     command $run
    522   end
    523 
    524   # success
    525   task.exit    0
    526     # convert 'stdout' to book format
    527     ipptool2book stdout detCleanupNormStatImfile -key det_id:iteration -uniq -setword dbname $options:0 -setword pantaskState INIT
    528     if ($VERBOSE > 2)
    529       book listbook detCleanupNormStatImfile
    530     end
    531 
    532     # delete existing entries in the appropriate pantaskStates
    533     process_cleanup detCleanupNormStatImfile
    534   end
    535 
    536   # locked list
    537   task.exit    default
    538     showcommand failure
    539   end
    540 
    541   task.exit    crash
    542     showcommand crash
    543   end
    544 
    545   # operation times out?
    546   task.exit    timeout
    547     showcommand timeout
    548   end
    549 end
    550 
    551 # run the ipp_cleanup.pl script on pending images
    552 task           detrend.cleanup.normstat.run
    553   periods      -poll $RUNPOLL
    554   periods      -exec $RUNEXEC
    555   periods      -timeout 60
    556   active       true
    557 
    558   task.exec
    559     book npages detCleanupNormStatImfile -var N
    560     if ($N == 0) break
    561     if ($NETWORK == 0) break
    562    
    563     # look for new images in detCleanupNormStatImfile (pantaskState == INIT)
    564     book getpage detCleanupNormStatImfile 0 -var pageName -key pantaskState INIT
    565     if ("$pageName" == "NULL") break
    566 
    567     book setword detCleanupNormStatImfile $pageName pantaskState RUN
    568     book getword detCleanupNormStatImfile $pageName det_id   -var DET_ID   
    569     book getword detCleanupNormStatImfile $pageName iteration -var ITERATION
    570     book getword detCleanupNormStatImfile $pageName camera -var CAMERA
    571     book getword detCleanupNormStatImfile $pageName state -var CLEANUP_MODE
    572     book getword detCleanupNormStatImfile $pageName dbname -var DBNAME
    573 
    574     # specify choice of local or remote host based on camera and chip (class_id)
    575     set.host.for.camera $CAMERA FPA
    576 
    577     stdout $LOGDIR/detrend.cleanup.normstat.log
    578     stderr $LOGDIR/detrend.cleanup.normstat.log
    579 
    580     # XXX is everything listed here needed?
    581     $run = ipp_cleanup.pl --stage detrend.normstat.imfile --stage_id $DET_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
    582     add_standard_args run
    583 
    584     # save the pageName for future reference below
    585     options $pageName
    586 
    587     # create the command line
    588     if ($VERBOSE > 1)
    589       echo command $run
    590     end
    591     command $run
    592   end
    593 
    594   # default exit status
    595   task.exit    default
    596     process_exit detCleanupNormStatImfile $options:0 $JOB_STATUS
    597   end
    598 
    599   task.exit    crash
    600     showcommand crash
    601     book setword detCleanupNormStatImfile $options:0 pantaskState CRASH
    602   end
    603 
    604   # operation timed out?
    605   task.exit    timeout
    606     showcommand timeout
    607     book setword detCleanupNormStatImfile $options:0 pantaskState TIMEOUT
    608   end
    609 end
    610  
    611 ########## cleanup norm (normalized.imfile) ###########
    612 task           detrend.cleanup.norm.load
    613   host         local
    614 
    615   periods      -poll $LOADPOLL
    616   periods      -exec $LOADEXEC
    617   periods      -timeout 30
    618   npending     1
    619   active       true
    620 
    621   stdout NULL
    622   stderr $LOGDIR/detrend.cleanup.norm.log
    623 
    624   task.exec
    625     $run = dettool -pendingcleanup_normalizedimfile
    626     if ($DB:n == 0)
    627       option DEFAULT
    628     else
    629       # save the DB name for the exit tasks
    630       option $DB:$detCleanupNormImfile_DB
    631       $run = $run -dbname $DB:$detCleanupNormImfile_DB
    632       $detCleanupNormImfile_DB ++
    633       if ($detCleanupNormImfile_DB >= $DB:n) set detCleanupNormImfile_DB = 0
    634     end
    635     add_poll_args run
    636     command $run
    637   end
    638 
    639   # success
    640   task.exit    0
    641     # convert 'stdout' to book format
    642     ipptool2book stdout detCleanupNormImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    643     if ($VERBOSE > 2)
    644       book listbook detCleanupNormImfile
    645     end
    646 
    647     # delete existing entries in the appropriate pantaskStates
    648     process_cleanup detCleanupNormImfile
    649   end
    650 
    651   # locked list
    652   task.exit    default
    653     showcommand failure
    654   end
    655 
    656   task.exit    crash
    657     showcommand crash
    658   end
    659 
    660   # operation times out?
    661   task.exit    timeout
    662     showcommand timeout
    663   end
    664 end
    665 
    666 # run the ipp_cleanup.pl script on pending images
    667 task           detrend.cleanup.norm.run
    668   periods      -poll $RUNPOLL
    669   periods      -exec $RUNEXEC
    670   periods      -timeout 60
    671   active       true
    672 
    673   task.exec
    674     book npages detCleanupNormImfile -var N
    675     if ($N == 0) break
    676     if ($NETWORK == 0) break
    677    
    678     # look for new images in detCleanupNormImfile (pantaskState == INIT)
    679     book getpage detCleanupNormImfile 0 -var pageName -key pantaskState INIT
    680     if ("$pageName" == "NULL") break
    681 
    682     book setword detCleanupNormImfile $pageName pantaskState RUN
    683     book getword detCleanupNormImfile $pageName det_id   -var DET_ID   
    684     book getword detCleanupNormImfile $pageName iteration -var ITERATION
    685     book getword detCleanupNormImfile $pageName class_id -var CLASS_ID
    686     book getword detCleanupNormImfile $pageName camera -var CAMERA
    687     book getword detCleanupNormImfile $pageName state -var CLEANUP_MODE
    688     book getword detCleanupNormImfile $pageName dbname -var DBNAME
    689 
    690     # specify choice of local or remote host based on camera and chip (class_id)
    691     set.host.for.camera $CAMERA FPA
    692 
    693     stdout $LOGDIR/detrend.cleanup.norm.log
    694     stderr $LOGDIR/detrend.cleanup.norm.log
    695 
    696     # XXX is everything listed here needed?
    697     $run = ipp_cleanup.pl --stage detrend.norm.imfile --stage_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
    698     add_standard_args run
    699 
    700     # save the pageName for future reference below
    701     options $pageName
    702 
    703     # create the command line
    704     if ($VERBOSE > 1)
    705       echo command $run
    706     end
    707     command $run
    708   end
    709 
    710   # default exit status
    711   task.exit    default
    712     process_exit detCleanupNormImfile $options:0 $JOB_STATUS
    713   end
    714 
    715   task.exit    crash
    716     showcommand crash
    717     book setword detCleanupNormImfile $options:0 pantaskState CRASH
    718   end
    719 
    720   # operation timed out?
    721   task.exit    timeout
    722     showcommand timeout
    723     book setword detCleanupNormImfile $options:0 pantaskState TIMEOUT
    724   end
    725 end
    726  
    727 ########## cleanup normexp ###########
    728 task           detrend.cleanup.normexp.load
    729   host         local
    730 
    731   periods      -poll $LOADPOLL
    732   periods      -exec $LOADEXEC
    733   periods      -timeout 30
    734   npending     1
    735   active       true
    736 
    737   stdout NULL
    738   stderr $LOGDIR/detrend.normexp.cleanup.log
    739 
    740   task.exec
    741     $run = dettool -pendingcleanup_normalizedexp
    742     if ($DB:n == 0)
    743       option DEFAULT
    744     else
    745       # save the DB name for the exit tasks
    746       option $DB:$detCleanupNormExp_DB
    747       $run = $run -dbname $DB:$detCleanupNormExp_DB
    748       $detCleanupNormExp_DB ++
    749       if ($detCleanupNormExp_DB >= $DB:n) set detCleanupNormExp_DB = 0
    750     end
    751     add_poll_args run
    752     command $run
    753   end
    754 
    755   # success
    756   task.exit    0
    757     # convert 'stdout' to book format
    758     ipptool2book stdout detCleanupNormExp -key det_id:iteration -uniq -setword dbname $options:0 -setword pantaskState INIT
    759     if ($VERBOSE > 2)
    760       book listbook detCleanupNormExp
    761     end
    762 
    763     # delete existing entries in the appropriate pantaskStates
    764     process_cleanup detCleanupNormExp
    765   end
    766 
    767   # locked list
    768   task.exit    default
    769     showcommand failure
    770   end
    771 
    772   task.exit    crash
    773     showcommand crash
    774   end
    775 
    776   # operation times out?
    777   task.exit    timeout
    778     showcommand timeout
    779   end
    780 end
    781 
    782 # run the ipp_cleanup.pl script on pending images
    783 task           detrend.cleanup.normexp.run
    784   periods      -poll $RUNPOLL
    785   periods      -exec $RUNEXEC
    786   periods      -timeout 60
    787   active       true
    788 
    789   task.exec
    790     book npages detCleanupNormExp -var N
    791     if ($N == 0) break
    792     if ($NETWORK == 0) break
    793    
    794     # look for new images in detCleanupNormExp (pantaskState == INIT)
    795     book getpage detCleanupNormExp 0 -var pageName -key pantaskState INIT
    796     if ("$pageName" == "NULL") break
    797 
    798     book setword detCleanupNormExp $pageName pantaskState RUN
    799     book getword detCleanupNormExp $pageName det_id   -var DET_ID   
    800     book getword detCleanupNormExp $pageName iteration -var ITERATION
    801     book getword detCleanupNormExp $pageName camera -var CAMERA
    802     book getword detCleanupNormExp $pageName state -var CLEANUP_MODE
    803     book getword detCleanupNormExp $pageName dbname -var DBNAME
    804 
    805     # specify choice of local or remote host based on camera and chip (class_id)
    806     set.host.for.camera $CAMERA FPA
    807 
    808     stdout $LOGDIR/detrend.cleanup.normexp.log
    809     stderr $LOGDIR/detrend.cleanup.normexp.log
    810 
    811     # XXX is everything listed here needed?
    812     $run = ipp_cleanup.pl --stage detrend.norm.exp --stage_id $DET_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
    813     add_standard_args run
    814 
    815     # save the pageName for future reference below
    816     options $pageName
    817 
    818     # create the command line
    819     if ($VERBOSE > 1)
    820       echo command $run
    821     end
    822     command $run
    823   end
    824 
    825   # default exit status
    826   task.exit    default
    827     process_exit detCleanupNormExp $options:0 $JOB_STATUS
    828   end
    829 
    830   task.exit    crash
    831     showcommand crash
    832     book setword detCleanupNormExp $options:0 pantaskState CRASH
    833   end
    834 
    835   # operation timed out?
    836   task.exit    timeout
    837     showcommand timeout
    838     book setword detCleanupNormExp $options:0 pantaskState TIMEOUT
    839   end
    840 end
    841  
  • trunk/ippTasks/detrend.process.pro

    r23230 r23480  
    88book init detPendingProcessedImfile
    99book init detPendingProcessedExp
    10 book init detCleanupProcessedImfile
    11 book init detCleanupProcessedExp
    1210
    1311macro detproc.reset
    1412  book init detPendingProcessedImfile
    1513  book init detPendingProcessedExp
    16   book init detCleanupProcessedImfile
    17   book init detCleanupProcessedExp
    1814end
    1915
     
    2319  echo detPendingProcessedExp
    2420  book listbook detPendingProcessedExp
    25   echo detCleanupProcessedImfile
    26   book listbook detCleanupProcessedImfile
    27   echo detCleanupProcessedExp
    28   book listbook detCleanupProcessedExp
    2921end
    3022
     
    4234    active true
    4335  end
    44   task detrend.cleanup.process.load
    45     active true
    46   end
    47   task detrend.cleanup.process.run
    48     active true
    49   end
    50   task detrend.cleanup.processexp.load
    51     active true
    52   end
    53   task detrend.cleanup.processexp.run
    54     active true
    55   end
    5636end
    5737
     
    6949    active false
    7050  end
    71   task detrend.cleanup.process.load
    72     active false
    73   end
    74   task detrend.cleanup.process.run
    75     active false
    76   end
    77   task detrend.cleanup.processexp.load
    78     active false
    79   end
    80   task detrend.cleanup.processexp.run
    81     active false
    82   end
    8351end
    8452
     
    8755$detPendingProcessedImfile_DB = 0
    8856$detPendingProcessedExp_DB = 0
    89 $detCleanupProcessedImfile_DB = 0
    90 $detCleanupProcessedExp_DB = 0
    9157
    9258# select images ready for copy
     
    347313  end
    348314end
    349 
    350 ######## cleanup process imfile ########
    351 task           detrend.cleanup.process.load
    352   host         local
    353 
    354   periods      -poll $LOADPOLL
    355   periods      -exec $LOADEXEC
    356   periods      -timeout 30
    357   npending     1
    358   active       true
    359 
    360   stdout NULL
    361   stderr $LOGDIR/detrend.cleanup.process.imfile.log
    362 
    363   task.exec
    364     $run = dettool -pendingcleanup_processedimfile
    365     if ($DB:n == 0)
    366       option DEFAULT
    367     else
    368       # save the DB name for the exit tasks
    369       option $DB:$detCleanupProcessedImfile_DB
    370       $run = $run -dbname $DB:$detCleanupProcessedImfile_DB
    371       $detCleanupProcessedImfile_DB ++
    372       if ($detCleanupProcessedImfile_DB >= $DB:n) set detCleanupProcessedImfile_DB = 0
    373     end
    374     add_poll_args run
    375     command $run
    376   end
    377 
    378   # success
    379   task.exit    0
    380     # convert 'stdout' to book format
    381     ipptool2book stdout detCleanupProcessedImfile -key det_id:exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    382     if ($VERBOSE > 2)
    383       book listbook detCleanupProcessedImfile
    384     end
    385 
    386     # delete existing entries in the appropriate pantaskStates
    387     process_cleanup detCleanupProcessedImfile
    388   end
    389 
    390   # locked list
    391   task.exit    default
    392     showcommand failure
    393   end
    394 
    395   task.exit    crash
    396     showcommand crash
    397   end
    398 
    399   # operation times out?
    400   task.exit    timeout
    401     showcommand timeout
    402   end
    403 end
    404 
    405 # run the ipp_cleanup.pl script on pending images
    406 task           detrend.cleanup.process.run
    407   periods      -poll $RUNPOLL
    408   periods      -exec $RUNEXEC
    409   periods      -timeout 60
    410   active       true
    411 
    412   task.exec
    413     book npages detCleanupProcessedImfile -var N
    414     if ($N == 0) break
    415     if ($NETWORK == 0) break
    416    
    417     # look for new images in detCleanupProcessedImfile (pantaskState == INIT)
    418     book getpage detCleanupProcessedImfile 0 -var pageName -key pantaskState INIT
    419     if ("$pageName" == "NULL") break
    420 
    421     book setword detCleanupProcessedImfile $pageName pantaskState RUN
    422     book getword detCleanupProcessedImfile $pageName det_id   -var DET_ID   
    423     book getword detCleanupProcessedImfile $pageName exp_id   -var EXP_ID   
    424     book getword detCleanupProcessedImfile $pageName class_id -var CLASS_ID
    425     book getword detCleanupProcessedImfile $pageName camera   -var CAMERA
    426     book getword detCleanupProcessedImfile $pageName state    -var CLEANUP_MODE
    427     book getword detCleanupProcessedImfile $pageName dbname   -var DBNAME
    428 
    429     # specify choice of local or remote host based on camera and chip (class_id)
    430     set.host.for.camera $CAMERA FPA
    431 
    432     stdout $LOGDIR/detrend.cleanup.process.imfile.log
    433     stderr $LOGDIR/detrend.cleanup.process.imfile.log
    434 
    435     # XXX is everything listed here needed?
    436     $run = ipp_cleanup.pl --stage detrend.process.imfile --stage_id $DET_ID --exp_id $EXP_ID --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
    437     add_standard_args run
    438 
    439     # save the pageName for future reference below
    440     options $pageName
    441 
    442     # create the command line
    443     if ($VERBOSE > 1)
    444       echo command $run
    445     end
    446     command $run
    447   end
    448 
    449   # default exit status
    450   task.exit    default
    451     process_exit detCleanupProcessedImfile $options:0 $JOB_STATUS
    452   end
    453 
    454   # locked list
    455   task.exit    crash
    456     showcommand crash
    457     echo "hostname: $JOB_HOSTNAME"
    458     book setword detCleanupProcessedImfile $options:0 pantaskState CRASH
    459   end
    460 
    461   # operation timed out?
    462   task.exit    timeout
    463     showcommand timeout
    464     book setword detCleanupProcessedImfile $options:0 pantaskState TIMEOUT
    465   end
    466 end
    467  
    468 
    469 ######## cleanup process exp ########
    470 task           detrend.cleanup.processexp.load
    471   host         local
    472 
    473   periods      -poll $LOADPOLL
    474   periods      -exec $LOADEXEC
    475   periods      -timeout 30
    476   npending     1
    477   active       true
    478 
    479   stdout NULL
    480   stderr $LOGDIR/detrend.cleanup.process.exp.log
    481 
    482   task.exec
    483     $run = dettool -pendingcleanup_processedexp
    484     if ($DB:n == 0)
    485       option DEFAULT
    486     else
    487       # save the DB name for the exit tasks
    488       option $DB:$detCleanupProcessedExp_DB
    489       $run = $run -dbname $DB:$detCleanupProcessedExp_DB
    490       $detCleanupProcessedExp_DB ++
    491       if ($detCleanupProcessedExp_DB >= $DB:n) set detCleanupProcessedExp_DB = 0
    492     end
    493     add_poll_args run
    494     command $run
    495   end
    496 
    497   # success
    498   task.exit    0
    499     # convert 'stdout' to book format
    500     ipptool2book stdout detCleanupProcessedExp -key det_id:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    501     if ($VERBOSE > 2)
    502       book listbook detCleanupProcessedExp
    503     end
    504 
    505     # delete existing entries in the appropriate pantaskStates
    506     process_cleanup detCleanupProcessedExp
    507   end
    508 
    509   # locked list
    510   task.exit    default
    511     showcommand failure
    512   end
    513 
    514   task.exit    crash
    515     showcommand crash
    516   end
    517 
    518   # operation times out?
    519   task.exit    timeout
    520     showcommand timeout
    521   end
    522 end
    523 
    524 # run the ipp_cleanup.pl script on pending images
    525 task           detrend.cleanup.processexp.run
    526   periods      -poll $RUNPOLL
    527   periods      -exec $RUNEXEC
    528   periods      -timeout 60
    529   active       true
    530 
    531   task.exec
    532     book npages detCleanupProcessedExp -var N
    533     if ($N == 0) break
    534     if ($NETWORK == 0) break
    535    
    536     # look for new images in detCleanupProcessedExp (pantaskState == INIT)
    537     book getpage detCleanupProcessedExp 0 -var pageName -key pantaskState INIT
    538     if ("$pageName" == "NULL") break
    539 
    540     book setword detCleanupProcessedExp $pageName pantaskState RUN
    541     book getword detCleanupProcessedExp $pageName det_id   -var DET_ID   
    542     book getword detCleanupProcessedExp $pageName exp_id   -var EXP_ID   
    543     book getword detCleanupProcessedExp $pageName camera -var CAMERA
    544     book getword detCleanupProcessedExp $pageName state -var CLEANUP_MODE
    545     book getword detCleanupProcessedExp $pageName dbname -var DBNAME
    546 
    547     # specify choice of local or remote host based on camera and chip (class_id)
    548     set.host.for.camera $CAMERA FPA
    549 
    550     stdout $LOGDIR/detrend.cleanup.process.exp.log
    551     stderr $LOGDIR/detrend.cleanup.process.exp.log
    552 
    553     # XXX is everything listed here needed?
    554     $run = ipp_cleanup.pl --stage detrend.process.exp --stage_id $DET_ID --exp_id $EXP_ID --camera $CAMERA --mode $CLEANUP_MODE
    555     add_standard_args run
    556 
    557     # save the pageName for future reference below
    558     options $pageName
    559 
    560     # create the command line
    561     if ($VERBOSE > 1)
    562       echo command $run
    563     end
    564     command $run
    565   end
    566 
    567   # default exit status
    568   task.exit    default
    569     process_exit detCleanupProcessedExp $options:0 $JOB_STATUS
    570   end
    571 
    572   # locked list
    573   task.exit    crash
    574     showcommand crash
    575     echo "hostname: $JOB_HOSTNAME"
    576     book setword detCleanupProcessedExp $options:0 pantaskState CRASH
    577   end
    578 
    579   # operation timed out?
    580   task.exit    timeout
    581     showcommand timeout
    582     book setword detCleanupProcessedExp $options:0 pantaskState TIMEOUT
    583   end
    584 end
  • trunk/ippTasks/detrend.resid.pro

    r23342 r23480  
    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
  • trunk/ippTasks/detrend.stack.pro

    r23230 r23480  
    77
    88book init detPendingStackedImfile
    9 book init detCleanupStackedImfile
    109
    1110macro detstack.reset
    1211  book init detPendingStackedImfile
    13   book init detCleanupStackedImfile
    1412end
    1513
     
    1715  echo detPendingStackedImfile
    1816  book listbook detPendingStackedImfile
    19   echo detCleanupStackedImfile
    20   book listbook detCleanupStackedImfile
    2117end
    2218
     
    2622  end
    2723  task detrend.stack.run
    28     active true
    29   end
    30   task detrend.cleanup.stack.load
    31     active true
    32   end
    33   task detrend.cleanup.stack.run
    3424    active true
    3525  end
     
    4333    active false
    4434  end
    45   task detrend.cleanup.stack.load
    46     active false
    47   end
    48   task detrend.cleanup.stack.run
    49     active false
    50   end
    5135end
    5236
    5337# this variable will cycle through the known database names
    5438$detPendingStackedImfile_DB = 0
    55 $detCleanupStackedImfile_DB = 0
    5639
    5740# select images ready for detrend_stack.pl
     
    182165  end
    183166end
    184 
    185 ########## cleanup stack ###########
    186 task           detrend.cleanup.stack.load
    187   host         local
    188 
    189   periods      -poll $LOADPOLL
    190   periods      -exec $LOADEXEC
    191   periods      -timeout 30
    192   npending     1
    193   active       true
    194 
    195   stdout NULL
    196   stderr $LOGDIR/detrend.cleanup.stack.log
    197 
    198   task.exec
    199     $run = dettool -pendingcleanup_stacked
    200     if ($DB:n == 0)
    201       option DEFAULT
    202     else
    203       # save the DB name for the exit tasks
    204       option $DB:$detCleanupStackedImfile_DB
    205       $run = $run -dbname $DB:$detCleanupStackedImfile_DB
    206       $detCleanupStackedImfile_DB ++
    207       if ($detCleanupStackedImfile_DB >= $DB:n) set detCleanupStackedImfile_DB = 0
    208     end
    209     add_poll_args run
    210     command $run
    211   end
    212 
    213   # success
    214   task.exit    0
    215     # convert 'stdout' to book format
    216     ipptool2book stdout detCleanupStackedImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    217     if ($VERBOSE > 2)
    218       book listbook detCleanupStackedImfile
    219     end
    220 
    221     # delete existing entries in the appropriate pantaskStates
    222     process_cleanup detCleanupStackedImfile
    223   end
    224 
    225   # locked list
    226   task.exit    default
    227     showcommand failure
    228   end
    229 
    230   task.exit    crash
    231     showcommand crash
    232   end
    233 
    234   # operation times out?
    235   task.exit    timeout
    236     showcommand timeout
    237   end
    238 end
    239 
    240 # run the ipp_cleanup.pl script on pending images
    241 task           detrend.cleanup.stack.run
    242   periods      -poll $RUNPOLL
    243   periods      -exec $RUNEXEC
    244   periods      -timeout 60
    245   active       true
    246 
    247   task.exec
    248     book npages detCleanupStackedImfile -var N
    249     if ($N == 0) break
    250     if ($NETWORK == 0) break
    251    
    252     # look for new images in detCleanupStackedImfile (pantaskState == INIT)
    253     book getpage detCleanupStackedImfile 0 -var pageName -key pantaskState INIT
    254     if ("$pageName" == "NULL") break
    255 
    256     book setword detCleanupStackedImfile $pageName pantaskState RUN
    257     book getword detCleanupStackedImfile $pageName det_id   -var DET_ID   
    258     book getword detCleanupStackedImfile $pageName iteration -var ITERATION
    259     book getword detCleanupStackedImfile $pageName class_id -var CLASS_ID
    260     book getword detCleanupStackedImfile $pageName camera -var CAMERA
    261     book getword detCleanupStackedImfile $pageName state -var CLEANUP_MODE
    262     book getword detCleanupStackedImfile $pageName dbname -var DBNAME
    263 
    264     # specify choice of local or remote host based on camera and chip (class_id)
    265     set.host.for.camera $CAMERA FPA
    266 
    267     stdout $LOGDIR/detrend.cleanup.stack.log
    268     stderr $LOGDIR/detrend.cleanup.stack.log
    269 
    270     # XXX is everything listed here needed?
    271     $run = ipp_cleanup.pl --stage detrend.stack.imfile --stage_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
    272     add_standard_args run
    273 
    274     # save the pageName for future reference below
    275     options $pageName
    276 
    277     # create the command line
    278     if ($VERBOSE > 1)
    279       echo command $run
    280     end
    281     command $run
    282   end
    283 
    284   # default exit status
    285   task.exit    default
    286     process_exit detCleanupStackedImfile $options:0 $JOB_STATUS
    287   end
    288 
    289   # locked list
    290   task.exit    crash
    291     showcommand crash
    292     echo "hostname: $JOB_HOSTNAME"
    293     book setword detCleanupStackedImfile $options:0 pantaskState CRASH
    294   end
    295 
    296   # operation timed out?
    297   task.exit    timeout
    298     showcommand timeout
    299     book setword detCleanupStackedImfile $options:0 pantaskState TIMEOUT
    300   end
    301 end
    302  
Note: See TracChangeset for help on using the changeset viewer.