IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

move detrend cleanup tasks to new detrend.cleanup.pro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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  
Note: See TracChangeset for help on using the changeset viewer.