IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18998


Ignore:
Timestamp:
Aug 8, 2008, 5:23:19 PM (18 years ago)
Author:
eugene
Message:

adding cleanup feature to detrend pipeline

Location:
branches/eam_branch_20080806/ippTasks
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080806/ippTasks/detrend.norm.pro

    r18607 r18998  
    99book init detPendingNormImfile
    1010book init detPendingNormExp
     11
     12book init detCleanupNormStatImfile
     13book init detCleanupNormImfile
     14book init detCleanupNormExp
    1115
    1216macro detnorm.reset
     
    1418  book init detPendingNormImfile
    1519  book init detPendingNormExp
     20
     21  book init detCleanupNormStatImfile
     22  book init detCleanupNormImfile
     23  book init detCleanupNormExp
    1624end
    1725
     
    2028  book listbook detPendingNormImfile
    2129  book listbook detPendingNormExp
     30
     31  book listbook detCleanupNormStatImfile
     32  book listbook detCleanupNormImfile
     33  book listbook detCleanupNormExp
    2234end
    2335
     
    4153    active true
    4254  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
    4374end
    4475
     
    6091  end
    6192  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
    62111    active false
    63112  end
     
    68117$detPendingNormImfile_DB = 0
    69118$detPendingNormExp_DB = 0
     119
     120$detCleanupNormStatImfile_DB = 0
     121$detCleanupNormImfile_DB = 0
     122$detCleanupNormExp_DB = 0
    70123
    71124# select images ready for copy
     
    81134
    82135  stdout NULL
    83   stderr $LOGDIR/detrend.normstat.load.log
     136  stderr $LOGDIR/detrend.normstat.log
    84137
    85138  task.exec
     
    191244
    192245  stdout NULL
    193   stderr $LOGDIR/detrend.norm.load.log
     246  stderr $LOGDIR/detrend.norm.log
    194247
    195248  task.exec
     
    264317    sprintf outroot "%s/%s.%s.%s/%s.%s.norm.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION
    265318
    266     stdout $LOGDIR/detrend.norm.run.log
    267     stderr $LOGDIR/detrend.norm.run.log
     319    stdout $LOGDIR/detrend.norm.log
     320    stderr $LOGDIR/detrend.norm.log
    268321
    269322    $run = detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE --outroot $outroot --redirect-output --verbose
     
    304357
    305358  stdout NULL
    306   stderr $LOGDIR/detrend.normexp.load.log
     359  stderr $LOGDIR/detrend.normexp.log
    307360
    308361  task.exec
     
    374427    sprintf outroot "%s/%s.%s.%s/%s.%s.normexp.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION
    375428
    376     stdout $LOGDIR/detrend.norm.run.log
    377     stderr $LOGDIR/detrend.norm.run.log
     429    stdout $LOGDIR/detrend.normexp.log
     430    stderr $LOGDIR/detrend.normexp.log
    378431
    379432    $run = detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE  --outroot $outroot
     
    401454  end
    402455end
     456
     457########## cleanup normstat ###########
     458task           detrend.cleanup.normstat.load
     459  host         local
     460
     461  periods      -poll $LOADPOLL
     462  periods      -exec $LOADEXEC
     463  periods      -timeout 30
     464  npending     1
     465  active       true
     466
     467  stdout NULL
     468  stderr $LOGDIR/detrend.cleanup.normstat.log
     469
     470  task.exec
     471    if ($DB:n == 0)
     472      option DEFAULT
     473      command dettool -pendingcleanup_normalizedstat -limit 20
     474    else
     475      # save the DB name for the exit tasks
     476      option $DB:$detCleanupNormStatImfile_DB
     477      command dettool -pendingcleanup_normalizedstat -limit 20 -dbname $DB:$detCleanupNormStatImfile_DB
     478      $detCleanupNormStatImfile_DB ++
     479      if ($detCleanupNormStatImfile_DB >= $DB:n) set detCleanupNormStatImfile_DB = 0
     480    end
     481  end
     482
     483  # success
     484  task.exit    0
     485    # convert 'stdout' to book format
     486    ipptool2book stdout detCleanupNormStatImfile -key det_id:iteration -uniq -setword dbname $options:0 -setword pantaskState INIT
     487    if ($VERBOSE > 2)
     488      book listbook detCleanupNormStatImfile
     489    end
     490
     491    # delete existing entries in the appropriate pantaskStates
     492    process_cleanup detCleanupNormStatImfile
     493  end
     494
     495  # locked list
     496  task.exit    default
     497    showcommand failure
     498  end
     499
     500  # operation times out?
     501  task.exit    timeout
     502    showcommand timeout
     503  end
     504end
     505
     506# run the ipp_cleanup.pl script on pending images
     507task           detrend.cleanup.normstat.run
     508  periods      -poll $RUNPOLL
     509  periods      -exec $RUNEXEC
     510  periods      -timeout 60
     511  active       true
     512
     513  task.exec
     514    book npages detCleanupNormStatImfile -var N
     515    if ($N == 0) break
     516    if ($NETWORK == 0) break
     517   
     518    # look for new images in detCleanupNormStatImfile (pantaskState == INIT)
     519    book getpage detCleanupNormStatImfile 0 -var pageName -key pantaskState INIT
     520    if ("$pageName" == "NULL") break
     521
     522    book setword detCleanupNormStatImfile $pageName pantaskState RUN
     523    book getword detCleanupNormStatImfile $pageName det_id   -var DET_ID   
     524    book getword detCleanupNormStatImfile $pageName iteration -var ITERATION
     525    book getword detCleanupNormStatImfile $pageName camera -var CAMERA
     526    book getword detCleanupNormStatImfile $pageName state -var CLEANUP_MODE
     527    book getword detCleanupNormStatImfile $pageName dbname -var DBNAME
     528
     529    # specify choice of local or remote host based on camera and chip (class_id)
     530    set.host.for.camera $CAMERA FPA
     531
     532    stdout $LOGDIR/detrend.cleanup.normstat.log
     533    stderr $LOGDIR/detrend.cleanup.normstat.log
     534
     535    # XXX is everything listed here needed?
     536    $run = ipp_cleanup.pl --stage detrend.normstat.imfile --stage_id $DET_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
     537    add_standard_args run
     538
     539    # save the pageName for future reference below
     540    options $pageName
     541
     542    # create the command line
     543    if ($VERBOSE > 1)
     544      echo command $run
     545    end
     546    command $run
     547  end
     548
     549  # default exit status
     550  task.exit    default
     551    process_exit detCleanupNormStatImfile $options:0 $JOB_STATUS
     552  end
     553
     554  # operation timed out?
     555  task.exit    timeout
     556    showcommand timeout
     557    book setword detCleanupNormStatImfile $options:0 pantaskState TIMEOUT
     558  end
     559end
     560 
     561########## cleanup norm (normalized.imfile) ###########
     562task           detrend.cleanup.norm.load
     563  host         local
     564
     565  periods      -poll $LOADPOLL
     566  periods      -exec $LOADEXEC
     567  periods      -timeout 30
     568  npending     1
     569  active       true
     570
     571  stdout NULL
     572  stderr $LOGDIR/detrend.cleanup.norm.log
     573
     574  task.exec
     575    if ($DB:n == 0)
     576      option DEFAULT
     577      command dettool -pendingcleanup_normalizedimfile -limit 20
     578    else
     579      # save the DB name for the exit tasks
     580      option $DB:$detCleanupNormImfile_DB
     581      command dettool -pendingcleanup_normalizedimfile -limit 20 -dbname $DB:$detCleanupNormImfile_DB
     582      $detCleanupNormImfile_DB ++
     583      if ($detCleanupNormImfile_DB >= $DB:n) set detCleanupNormImfile_DB = 0
     584    end
     585  end
     586
     587  # success
     588  task.exit    0
     589    # convert 'stdout' to book format
     590    ipptool2book stdout detCleanupNormImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     591    if ($VERBOSE > 2)
     592      book listbook detCleanupNormImfile
     593    end
     594
     595    # delete existing entries in the appropriate pantaskStates
     596    process_cleanup detCleanupNormImfile
     597  end
     598
     599  # locked list
     600  task.exit    default
     601    showcommand failure
     602  end
     603
     604  # operation times out?
     605  task.exit    timeout
     606    showcommand timeout
     607  end
     608end
     609
     610# run the ipp_cleanup.pl script on pending images
     611task           detrend.cleanup.norm.run
     612  periods      -poll $RUNPOLL
     613  periods      -exec $RUNEXEC
     614  periods      -timeout 60
     615  active       true
     616
     617  task.exec
     618    book npages detCleanupNormImfile -var N
     619    if ($N == 0) break
     620    if ($NETWORK == 0) break
     621   
     622    # look for new images in detCleanupNormImfile (pantaskState == INIT)
     623    book getpage detCleanupNormImfile 0 -var pageName -key pantaskState INIT
     624    if ("$pageName" == "NULL") break
     625
     626    book setword detCleanupNormImfile $pageName pantaskState RUN
     627    book getword detCleanupNormImfile $pageName det_id   -var DET_ID   
     628    book getword detCleanupNormImfile $pageName iteration -var ITERATION
     629    book getword detCleanupNormImfile $pageName class_id -var CLASS_ID
     630    book getword detCleanupNormImfile $pageName camera -var CAMERA
     631    book getword detCleanupNormImfile $pageName state -var CLEANUP_MODE
     632    book getword detCleanupNormImfile $pageName dbname -var DBNAME
     633
     634    # specify choice of local or remote host based on camera and chip (class_id)
     635    set.host.for.camera $CAMERA FPA
     636
     637    stdout $LOGDIR/detrend.cleanup.norm.log
     638    stderr $LOGDIR/detrend.cleanup.norm.log
     639
     640    # XXX is everything listed here needed?
     641    $run = ipp_cleanup.pl --stage detrend.norm.imfile --stage_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
     642    add_standard_args run
     643
     644    # save the pageName for future reference below
     645    options $pageName
     646
     647    # create the command line
     648    if ($VERBOSE > 1)
     649      echo command $run
     650    end
     651    command $run
     652  end
     653
     654  # default exit status
     655  task.exit    default
     656    process_exit detCleanupNormImfile $options:0 $JOB_STATUS
     657  end
     658
     659  # operation timed out?
     660  task.exit    timeout
     661    showcommand timeout
     662    book setword detCleanupNormImfile $options:0 pantaskState TIMEOUT
     663  end
     664end
     665 
     666########## cleanup normexp ###########
     667task           detrend.cleanup.normexp.load
     668  host         local
     669
     670  periods      -poll $LOADPOLL
     671  periods      -exec $LOADEXEC
     672  periods      -timeout 30
     673  npending     1
     674  active       true
     675
     676  stdout NULL
     677  stderr $LOGDIR/detrend.normexp.cleanup.log
     678
     679  task.exec
     680    if ($DB:n == 0)
     681      option DEFAULT
     682      command dettool -pendingcleanup_normalizedexp -limit 20
     683    else
     684      # save the DB name for the exit tasks
     685      option $DB:$detCleanupNormExp_DB
     686      command dettool -pendingcleanup_normalizedexp -limit 20 -dbname $DB:$detCleanupNormExp_DB
     687      $detCleanupNormExp_DB ++
     688      if ($detCleanupNormExp_DB >= $DB:n) set detCleanupNormExp_DB = 0
     689    end
     690  end
     691
     692  # success
     693  task.exit    0
     694    # convert 'stdout' to book format
     695    ipptool2book stdout detCleanupNormExp -key det_id:iteration -uniq -setword dbname $options:0 -setword pantaskState INIT
     696    if ($VERBOSE > 2)
     697      book listbook detCleanupNormExp
     698    end
     699
     700    # delete existing entries in the appropriate pantaskStates
     701    process_cleanup detCleanupNormExp
     702  end
     703
     704  # locked list
     705  task.exit    default
     706    showcommand failure
     707  end
     708
     709  # operation times out?
     710  task.exit    timeout
     711    showcommand timeout
     712  end
     713end
     714
     715# run the ipp_cleanup.pl script on pending images
     716task           detrend.cleanup.normexp.run
     717  periods      -poll $RUNPOLL
     718  periods      -exec $RUNEXEC
     719  periods      -timeout 60
     720  active       true
     721
     722  task.exec
     723    book npages detCleanupNormExp -var N
     724    if ($N == 0) break
     725    if ($NETWORK == 0) break
     726   
     727    # look for new images in detCleanupNormExp (pantaskState == INIT)
     728    book getpage detCleanupNormExp 0 -var pageName -key pantaskState INIT
     729    if ("$pageName" == "NULL") break
     730
     731    book setword detCleanupNormExp $pageName pantaskState RUN
     732    book getword detCleanupNormExp $pageName det_id   -var DET_ID   
     733    book getword detCleanupNormExp $pageName iteration -var ITERATION
     734    book getword detCleanupNormExp $pageName camera -var CAMERA
     735    book getword detCleanupNormExp $pageName state -var CLEANUP_MODE
     736    book getword detCleanupNormExp $pageName dbname -var DBNAME
     737
     738    # specify choice of local or remote host based on camera and chip (class_id)
     739    set.host.for.camera $CAMERA FPA
     740
     741    stdout $LOGDIR/detrend.cleanup.normexp.log
     742    stderr $LOGDIR/detrend.cleanup.normexp.log
     743
     744    # XXX is everything listed here needed?
     745    $run = ipp_cleanup.pl --stage detrend.norm.exp --stage_id $DET_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
     746    add_standard_args run
     747
     748    # save the pageName for future reference below
     749    options $pageName
     750
     751    # create the command line
     752    if ($VERBOSE > 1)
     753      echo command $run
     754    end
     755    command $run
     756  end
     757
     758  # default exit status
     759  task.exit    default
     760    process_exit detCleanupNormExp $options:0 $JOB_STATUS
     761  end
     762
     763  # operation timed out?
     764  task.exit    timeout
     765    showcommand timeout
     766    book setword detCleanupNormExp $options:0 pantaskState TIMEOUT
     767  end
     768end
     769 
  • branches/eam_branch_20080806/ippTasks/detrend.process.pro

    r18935 r18998  
    88book init detPendingProcessedImfile
    99book init detPendingProcessedExp
     10book init detCleanupProcessedImfile
     11book init detCleanupProcessedExp
    1012
    1113macro detproc.reset
    1214  book init detPendingProcessedImfile
    1315  book init detPendingProcessedExp
     16  book init detCleanupProcessedImfile
     17  book init detCleanupProcessedExp
    1418end
    1519
     
    1923  echo detPendingProcessedExp
    2024  book listbook detPendingProcessedExp
     25  echo detCleanupProcessedImfile
     26  book listbook detCleanupProcessedImfile
     27  echo detCleanupProcessedExp
     28  book listbook detCleanupProcessedExp
    2129end
    2230
     
    3442    active true
    3543  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
    3656end
    3757
     
    4767  end
    4868  task detrend.processexp.run
     69    active false
     70  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
    4981    active false
    5082  end
     
    5587$detPendingProcessedImfile_DB = 0
    5688$detPendingProcessedExp_DB = 0
     89$detCleanupProcessedImfile_DB = 0
     90$detCleanupProcessedExp_DB = 0
    5791
    5892# select images ready for copy
     
    68102
    69103  stdout NULL
    70   stderr $LOGDIR/detproc.imfile.load.log
     104  stderr $LOGDIR/detrend.process.imfile.log
    71105
    72106  task.exec
     
    142176    sprintf outroot "%s/%s.%s.%s/%s/%s.detproc.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID
    143177
    144     stdout $LOGDIR/detproc.imfile.run.log
    145     stderr $LOGDIR/detproc.imfile.run.log
     178    stdout $LOGDIR/detrend.process.imfile.log
     179    stderr $LOGDIR/detrend.process.imfile.log
    146180
    147181    $run = detrend_process_imfile.pl --det_id $DET_ID --exp_id $EXP_ID --det_type $DET_TYPE --class_id $CLASS_ID --exp_tag $EXP_TAG --input_uri $URI --camera $CAMERA --outroot $outroot --redirect-output
     
    185219
    186220  stdout NULL
    187   stderr $LOGDIR/detproc.exp.load.log
     221  stderr $LOGDIR/detrend.process.exp.log
    188222
    189223  task.exec
     
    257291    sprintf outroot "%s/%s.%s.%s/%s/%s.detproc.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID
    258292
    259     stdout $LOGDIR/detproc.exp.run.log
    260     stderr $LOGDIR/detproc.exp.run.log
     293    stdout $LOGDIR/detrend.process.exp.log
     294    stderr $LOGDIR/detrend.process.exp.log
    261295
    262296    $run = detrend_process_exp.pl --det_id $DET_ID --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output --verbose
     
    287321  end
    288322end
     323
     324######## cleanup process imfile ########
     325task           detrend.cleanup.process.load
     326  host         local
     327
     328  periods      -poll $LOADPOLL
     329  periods      -exec $LOADEXEC
     330  periods      -timeout 30
     331  npending     1
     332  active       true
     333
     334  stdout NULL
     335  stderr $LOGDIR/detrend.cleanup.process.imfile.log
     336
     337  task.exec
     338    if ($DB:n == 0)
     339      option DEFAULT
     340      command dettool -pendingcleanup_processedimfile -limit 20
     341    else
     342      # save the DB name for the exit tasks
     343      option $DB:$detCleanupProcessedImfile_DB
     344      command dettool -pendingcleanup_processedimfile -limit 20 -dbname $DB:$detCleanupProcessedImfile_DB
     345      $detCleanupProcessedImfile_DB ++
     346      if ($detCleanupProcessedImfile_DB >= $DB:n) set detCleanupProcessedImfile_DB = 0
     347    end
     348  end
     349
     350  # success
     351  task.exit    0
     352    # convert 'stdout' to book format
     353    ipptool2book stdout detCleanupProcessedImfile -key det_id:exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     354    if ($VERBOSE > 2)
     355      book listbook detCleanupProcessedImfile
     356    end
     357
     358    # delete existing entries in the appropriate pantaskStates
     359    process_cleanup detCleanupProcessedImfile
     360  end
     361
     362  # locked list
     363  task.exit    default
     364    showcommand failure
     365  end
     366
     367  # operation times out?
     368  task.exit    timeout
     369    showcommand timeout
     370  end
     371end
     372
     373# run the ipp_cleanup.pl script on pending images
     374task           detrend.cleanup.process.run
     375  periods      -poll $RUNPOLL
     376  periods      -exec $RUNEXEC
     377  periods      -timeout 60
     378  active       true
     379
     380  task.exec
     381    book npages detCleanupProcessedImfile -var N
     382    if ($N == 0) break
     383    if ($NETWORK == 0) break
     384   
     385    # look for new images in detCleanupProcessedImfile (pantaskState == INIT)
     386    book getpage detCleanupProcessedImfile 0 -var pageName -key pantaskState INIT
     387    if ("$pageName" == "NULL") break
     388
     389    book setword detCleanupProcessedImfile $pageName pantaskState RUN
     390    book getword detCleanupProcessedImfile $pageName det_id   -var DET_ID   
     391    book getword detCleanupProcessedImfile $pageName exp_id   -var EXP_ID   
     392    book getword detCleanupProcessedImfile $pageName class_id -var CLASS_ID
     393    book getword detCleanupProcessedImfile $pageName camera   -var CAMERA
     394    book getword detCleanupProcessedImfile $pageName state    -var CLEANUP_MODE
     395    book getword detCleanupProcessedImfile $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.process.imfile.log
     401    stderr $LOGDIR/detrend.cleanup.process.imfile.log
     402
     403    # XXX is everything listed here needed?
     404    $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
     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 detCleanupProcessedImfile $options:0 $JOB_STATUS
     420  end
     421
     422  # operation timed out?
     423  task.exit    timeout
     424    showcommand timeout
     425    book setword detCleanupProcessedImfile $options:0 pantaskState TIMEOUT
     426  end
     427end
     428 
     429
     430######## cleanup process exp ########
     431task           detrend.cleanup.processexp.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.process.exp.log
     442
     443  task.exec
     444    if ($DB:n == 0)
     445      option DEFAULT
     446      command dettool -pendingcleanup_processedexp -limit 20
     447    else
     448      # save the DB name for the exit tasks
     449      option $DB:$detCleanupProcessedExp_DB
     450      command dettool -pendingcleanup_processedexp -limit 20 -dbname $DB:$detCleanupProcessedExp_DB
     451      $detCleanupProcessedExp_DB ++
     452      if ($detCleanupProcessedExp_DB >= $DB:n) set detCleanupProcessedExp_DB = 0
     453    end
     454  end
     455
     456  # success
     457  task.exit    0
     458    # convert 'stdout' to book format
     459    ipptool2book stdout detCleanupProcessedExp -key det_id:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     460    if ($VERBOSE > 2)
     461      book listbook detCleanupProcessedExp
     462    end
     463
     464    # delete existing entries in the appropriate pantaskStates
     465    process_cleanup detCleanupProcessedExp
     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
     477end
     478
     479# run the ipp_cleanup.pl script on pending images
     480task           detrend.cleanup.processexp.run
     481  periods      -poll $RUNPOLL
     482  periods      -exec $RUNEXEC
     483  periods      -timeout 60
     484  active       true
     485
     486  task.exec
     487    book npages detCleanupProcessedExp -var N
     488    if ($N == 0) break
     489    if ($NETWORK == 0) break
     490   
     491    # look for new images in detCleanupProcessedExp (pantaskState == INIT)
     492    book getpage detCleanupProcessedExp 0 -var pageName -key pantaskState INIT
     493    if ("$pageName" == "NULL") break
     494
     495    book setword detCleanupProcessedExp $pageName pantaskState RUN
     496    book getword detCleanupProcessedExp $pageName det_id   -var DET_ID   
     497    book getword detCleanupProcessedExp $pageName exp_id   -var EXP_ID   
     498    book getword detCleanupProcessedExp $pageName camera -var CAMERA
     499    book getword detCleanupProcessedExp $pageName state -var CLEANUP_MODE
     500    book getword detCleanupProcessedExp $pageName dbname -var DBNAME
     501
     502    # specify choice of local or remote host based on camera and chip (class_id)
     503    set.host.for.camera $CAMERA FPA
     504
     505    stdout $LOGDIR/detrend.cleanup.process.exp.log
     506    stderr $LOGDIR/detrend.cleanup.process.exp.log
     507
     508    # XXX is everything listed here needed?
     509    $run = ipp_cleanup.pl --stage detrend.process.exp --stage_id $DET_ID --exp_id $EXP_ID --camera $CAMERA --mode $CLEANUP_MODE
     510    add_standard_args run
     511
     512    # save the pageName for future reference below
     513    options $pageName
     514
     515    # create the command line
     516    if ($VERBOSE > 1)
     517      echo command $run
     518    end
     519    command $run
     520  end
     521
     522  # default exit status
     523  task.exit    default
     524    process_exit detCleanupProcessedExp $options:0 $JOB_STATUS
     525  end
     526
     527  # operation timed out?
     528  task.exit    timeout
     529    showcommand timeout
     530    book setword detCleanupProcessedExp $options:0 pantaskState TIMEOUT
     531  end
     532end
  • branches/eam_branch_20080806/ippTasks/detrend.resid.pro

    r18606 r18998  
    88book init detPendingResidImfile
    99book init detPendingResidExp
     10book init detCleanupResidImfile
     11book init detCleanupResidExp
    1012
    1113macro detresid.reset
    1214  book init detPendingResidImfile
    1315  book init detPendingResidExp
     16  book init detCleanupResidImfile
     17  book init detCleanupResidExp
    1418end
    1519
     
    1721  book listbook detPendingResidImfile
    1822  book listbook detPendingResidExp
     23  book listbook detCleanupResidImfile
     24  book listbook detCleanupResidExp
    1925end
    2026
     
    3238    active true
    3339  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
    3452end
    3553
     
    4563  end
    4664  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
    4777    active false
    4878  end
     
    5282$detPendingResidImfile_DB = 0
    5383$detPendingResidExp_DB = 0
     84$detCleanupResidImfile_DB = 0
     85$detCleanupResidExp_DB = 0
    5486
    5587# select images ready for copy
     
    6597
    6698  stdout NULL
    67   stderr $LOGDIR/detresid.load.log
     99  stderr $LOGDIR/detrend.resid.imfile.log
    68100
    69101  task.exec
     
    142174    sprintf outroot "%s/%s.%s.%s/%s/%s.detresid.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION
    143175
    144     stdout $LOGDIR/detresid.run.log
    145     stderr $LOGDIR/detresid.run.log
     176    stdout $LOGDIR/detrend.resid.imfile.log
     177    stderr $LOGDIR/detrend.resid.imfile.log
    146178
    147179    $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
     
    186218
    187219  stdout NULL
    188   stderr $LOGDIR/detresid.exp.load.log
     220  stderr $LOGDIR/detrend.resid.exp.log
    189221
    190222  task.exec
     
    260292    sprintf outroot "%s/%s.%s.%s/%s/%s.detresid.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION
    261293
    262     stdout $LOGDIR/detresid.exp.run.log
    263     stderr $LOGDIR/detresid.exp.run.log
     294    stdout $LOGDIR/detrend.resid.exp.log
     295    stderr $LOGDIR/detrend.resid.exp.log
    264296
    265297    $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
     
    288320  end
    289321end
     322
     323######## cleanup resid imfile ########
     324task           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
     370end
     371
     372# run the ipp_cleanup.pl script on pending images
     373task           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
     427end
     428 
     429
     430######## cleanup resid exp ########
     431task           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
     477end
     478
     479# run the ipp_cleanup.pl script on pending images
     480task           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
     533end
  • branches/eam_branch_20080806/ippTasks/detrend.stack.pro

    r18129 r18998  
    77
    88book init detPendingStackedImfile
     9book init detCleanupStackedImfile
    910
    1011macro detstack.reset
    1112  book init detPendingStackedImfile
     13  book init detCleanupStackedImfile
    1214end
    1315
     
    1517  echo detPendingStackedImfile
    1618  book listbook detPendingStackedImfile
     19  echo detCleanupStackedImfile
     20  book listbook detCleanupStackedImfile
    1721end
    1822
     
    2428    active true
    2529  end
     30  task detrend.cleanup.stack.load
     31    active true
     32  end
     33  task detrend.cleanup.stack.run
     34    active true
     35  end
    2636end
    2737
     
    3343    active false
    3444  end
     45  task detrend.cleanup.stack.load
     46    active false
     47  end
     48  task detrend.cleanup.stack.run
     49    active false
     50  end
    3551end
    3652
    3753# this variable will cycle through the known database names
    3854$detPendingStackedImfile_DB = 0
     55$detCleanupStackedImfile_DB = 0
    3956
    4057# select images ready for detrend_stack.pl
     
    5067
    5168  stdout NULL
    52   stderr $LOGDIR/detrend.stack.load.log
     69  stderr $LOGDIR/detrend.stack.log
    5370
    5471  task.exec
     
    122139    sprintf outroot "%s/%s.%s.%s/%s.%s.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION
    123140
    124     stdout $LOGDIR/detrend.stack.run.log
    125     stderr $LOGDIR/detrend.stack.run.log
     141    stdout $LOGDIR/detrend.stack.log
     142    stderr $LOGDIR/detrend.stack.log
    126143
    127144    $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output --verbose
     
    152169  end
    153170end
     171
     172########## cleanup stack ###########
     173task           detrend.cleanup.stack.load
     174  host         local
     175
     176  periods      -poll $LOADPOLL
     177  periods      -exec $LOADEXEC
     178  periods      -timeout 30
     179  npending     1
     180  active       true
     181
     182  stdout NULL
     183  stderr $LOGDIR/detrend.cleanup.stack.log
     184
     185  task.exec
     186    if ($DB:n == 0)
     187      option DEFAULT
     188      command dettool -pendingcleanup_stacked -limit 20
     189    else
     190      # save the DB name for the exit tasks
     191      option $DB:$detCleanupStackedImfile_DB
     192      command dettool -pendingcleanup_stacked -limit 20 -dbname $DB:$detCleanupStackedImfile_DB
     193      $detCleanupStackedImfile_DB ++
     194      if ($detCleanupStackedImfile_DB >= $DB:n) set detCleanupStackedImfile_DB = 0
     195    end
     196  end
     197
     198  # success
     199  task.exit    0
     200    # convert 'stdout' to book format
     201    ipptool2book stdout detCleanupStackedImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     202    if ($VERBOSE > 2)
     203      book listbook detCleanupStackedImfile
     204    end
     205
     206    # delete existing entries in the appropriate pantaskStates
     207    process_cleanup detCleanupStackedImfile
     208  end
     209
     210  # locked list
     211  task.exit    default
     212    showcommand failure
     213  end
     214
     215  # operation times out?
     216  task.exit    timeout
     217    showcommand timeout
     218  end
     219end
     220
     221# run the ipp_cleanup.pl script on pending images
     222task           detrend.cleanup.stack.run
     223  periods      -poll $RUNPOLL
     224  periods      -exec $RUNEXEC
     225  periods      -timeout 60
     226  active       true
     227
     228  task.exec
     229    book npages detCleanupStackedImfile -var N
     230    if ($N == 0) break
     231    if ($NETWORK == 0) break
     232   
     233    # look for new images in detCleanupStackedImfile (pantaskState == INIT)
     234    book getpage detCleanupStackedImfile 0 -var pageName -key pantaskState INIT
     235    if ("$pageName" == "NULL") break
     236
     237    book setword detCleanupStackedImfile $pageName pantaskState RUN
     238    book getword detCleanupStackedImfile $pageName det_id   -var DET_ID   
     239    book getword detCleanupStackedImfile $pageName iteration -var ITERATION
     240    book getword detCleanupStackedImfile $pageName class_id -var CLASS_ID
     241    book getword detCleanupStackedImfile $pageName camera -var CAMERA
     242    book getword detCleanupStackedImfile $pageName state -var CLEANUP_MODE
     243    book getword detCleanupStackedImfile $pageName dbname -var DBNAME
     244
     245    # specify choice of local or remote host based on camera and chip (class_id)
     246    set.host.for.camera $CAMERA FPA
     247
     248    stdout $LOGDIR/detrend.cleanup.stack.log
     249    stderr $LOGDIR/detrend.cleanup.stack.log
     250
     251    # XXX is everything listed here needed?
     252    $run = ipp_cleanup.pl --stage detrend.stack.imfile --stage_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
     253    add_standard_args run
     254
     255    # save the pageName for future reference below
     256    options $pageName
     257
     258    # create the command line
     259    if ($VERBOSE > 1)
     260      echo command $run
     261    end
     262    command $run
     263  end
     264
     265  # default exit status
     266  task.exit    default
     267    process_exit detCleanupStackedImfile $options:0 $JOB_STATUS
     268  end
     269
     270  # operation timed out?
     271  task.exit    timeout
     272    showcommand timeout
     273    book setword detCleanupStackedImfile $options:0 pantaskState TIMEOUT
     274  end
     275end
     276 
Note: See TracChangeset for help on using the changeset viewer.