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.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.