Index: trunk/ippTasks/detrend.norm.pro
===================================================================
--- trunk/ippTasks/detrend.norm.pro	(revision 23230)
+++ trunk/ippTasks/detrend.norm.pro	(revision 23480)
@@ -9,8 +9,4 @@
 book init detPendingNormImfile
 book init detPendingNormExp
-
-book init detCleanupNormStatImfile
-book init detCleanupNormImfile
-book init detCleanupNormExp
 
 macro detnorm.reset
@@ -18,8 +14,4 @@
   book init detPendingNormImfile
   book init detPendingNormExp
-
-  book init detCleanupNormStatImfile
-  book init detCleanupNormImfile
-  book init detCleanupNormExp
 end
 
@@ -28,8 +20,4 @@
   book listbook detPendingNormImfile
   book listbook detPendingNormExp
-
-  book listbook detCleanupNormStatImfile
-  book listbook detCleanupNormImfile
-  book listbook detCleanupNormExp
 end
 
@@ -53,23 +41,4 @@
     active true
   end
-
-  task detrend.cleanup.norm.load
-    active true
-  end
-  task detrend.cleanup.norm.run
-    active true
-  end
-  task detrend.cleanup.normexp.load
-    active true
-  end
-  task detrend.cleanup.normexp.run
-    active true
-  end
-  task detrend.cleanup.normstat.load
-    active true
-  end
-  task detrend.cleanup.normstat.run
-    active true
-  end
 end
 
@@ -91,22 +60,4 @@
   end
   task detrend.normstat.run
-    active false
-  end
-  task detrend.cleanup.norm.load
-    active false
-  end
-  task detrend.cleanup.norm.run
-    active false
-  end
-  task detrend.cleanup.normexp.load
-    active false
-  end
-  task detrend.cleanup.normexp.run
-    active false
-  end
-  task detrend.cleanup.normstat.load
-    active false
-  end
-  task detrend.cleanup.normstat.run
     active false
   end
@@ -117,8 +68,4 @@
 $detPendingNormImfile_DB = 0
 $detPendingNormExp_DB = 0
-
-$detCleanupNormStatImfile_DB = 0
-$detCleanupNormImfile_DB = 0
-$detCleanupNormExp_DB = 0
 
 # select images ready for copy 
@@ -493,349 +440,2 @@
   end
 end
-
-########## cleanup normstat ###########
-task	       detrend.cleanup.normstat.load
-  host         local
-
-  periods      -poll $LOADPOLL
-  periods      -exec $LOADEXEC
-  periods      -timeout 30
-  npending     1
-  active       true
-
-  stdout NULL
-  stderr $LOGDIR/detrend.cleanup.normstat.log
-
-  task.exec
-    $run = dettool -pendingcleanup_normalizedstat
-    if ($DB:n == 0)
-      option DEFAULT
-    else
-      # save the DB name for the exit tasks
-      option $DB:$detCleanupNormStatImfile_DB
-      $run = $run -dbname $DB:$detCleanupNormStatImfile_DB
-      $detCleanupNormStatImfile_DB ++
-      if ($detCleanupNormStatImfile_DB >= $DB:n) set detCleanupNormStatImfile_DB = 0
-    end
-    add_poll_args run
-    command $run
-  end
-
-  # success
-  task.exit    0
-    # convert 'stdout' to book format
-    ipptool2book stdout detCleanupNormStatImfile -key det_id:iteration -uniq -setword dbname $options:0 -setword pantaskState INIT
-    if ($VERBOSE > 2)
-      book listbook detCleanupNormStatImfile
-    end
-
-    # delete existing entries in the appropriate pantaskStates
-    process_cleanup detCleanupNormStatImfile
-  end
-
-  # locked list
-  task.exit    default
-    showcommand failure
-  end
-
-  task.exit    crash
-    showcommand crash
-  end
-
-  # operation times out?
-  task.exit    timeout
-    showcommand timeout
-  end
-end
-
-# run the ipp_cleanup.pl script on pending images
-task	       detrend.cleanup.normstat.run
-  periods      -poll $RUNPOLL
-  periods      -exec $RUNEXEC
-  periods      -timeout 60
-  active       true
-
-  task.exec
-    book npages detCleanupNormStatImfile -var N
-    if ($N == 0) break
-    if ($NETWORK == 0) break
-    
-    # look for new images in detCleanupNormStatImfile (pantaskState == INIT)
-    book getpage detCleanupNormStatImfile 0 -var pageName -key pantaskState INIT
-    if ("$pageName" == "NULL") break
-
-    book setword detCleanupNormStatImfile $pageName pantaskState RUN
-    book getword detCleanupNormStatImfile $pageName det_id   -var DET_ID   
-    book getword detCleanupNormStatImfile $pageName iteration -var ITERATION
-    book getword detCleanupNormStatImfile $pageName camera -var CAMERA
-    book getword detCleanupNormStatImfile $pageName state -var CLEANUP_MODE
-    book getword detCleanupNormStatImfile $pageName dbname -var DBNAME
-
-    # specify choice of local or remote host based on camera and chip (class_id)
-    set.host.for.camera $CAMERA FPA
-
-    stdout $LOGDIR/detrend.cleanup.normstat.log
-    stderr $LOGDIR/detrend.cleanup.normstat.log
-
-    # XXX is everything listed here needed?
-    $run = ipp_cleanup.pl --stage detrend.normstat.imfile --stage_id $DET_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
-    add_standard_args run
-
-    # save the pageName for future reference below
-    options $pageName
-
-    # create the command line
-    if ($VERBOSE > 1)
-      echo command $run
-    end
-    command $run
-  end
-
-  # default exit status
-  task.exit    default
-    process_exit detCleanupNormStatImfile $options:0 $JOB_STATUS
-  end
-
-  task.exit    crash
-    showcommand crash
-    book setword detCleanupNormStatImfile $options:0 pantaskState CRASH
-  end
-
-  # operation timed out?
-  task.exit    timeout
-    showcommand timeout
-    book setword detCleanupNormStatImfile $options:0 pantaskState TIMEOUT
-  end
-end
- 
-########## cleanup norm (normalized.imfile) ###########
-task	       detrend.cleanup.norm.load
-  host         local
-
-  periods      -poll $LOADPOLL
-  periods      -exec $LOADEXEC
-  periods      -timeout 30
-  npending     1
-  active       true
-
-  stdout NULL
-  stderr $LOGDIR/detrend.cleanup.norm.log
-
-  task.exec
-    $run = dettool -pendingcleanup_normalizedimfile
-    if ($DB:n == 0)
-      option DEFAULT
-    else
-      # save the DB name for the exit tasks
-      option $DB:$detCleanupNormImfile_DB
-      $run = $run -dbname $DB:$detCleanupNormImfile_DB
-      $detCleanupNormImfile_DB ++
-      if ($detCleanupNormImfile_DB >= $DB:n) set detCleanupNormImfile_DB = 0
-    end
-    add_poll_args run
-    command $run
-  end
-
-  # success
-  task.exit    0
-    # convert 'stdout' to book format
-    ipptool2book stdout detCleanupNormImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
-    if ($VERBOSE > 2)
-      book listbook detCleanupNormImfile
-    end
-
-    # delete existing entries in the appropriate pantaskStates
-    process_cleanup detCleanupNormImfile
-  end
-
-  # locked list
-  task.exit    default
-    showcommand failure
-  end
-
-  task.exit    crash
-    showcommand crash
-  end
-
-  # operation times out?
-  task.exit    timeout
-    showcommand timeout
-  end
-end
-
-# run the ipp_cleanup.pl script on pending images
-task	       detrend.cleanup.norm.run
-  periods      -poll $RUNPOLL
-  periods      -exec $RUNEXEC
-  periods      -timeout 60
-  active       true
-
-  task.exec
-    book npages detCleanupNormImfile -var N
-    if ($N == 0) break
-    if ($NETWORK == 0) break
-    
-    # look for new images in detCleanupNormImfile (pantaskState == INIT)
-    book getpage detCleanupNormImfile 0 -var pageName -key pantaskState INIT
-    if ("$pageName" == "NULL") break
-
-    book setword detCleanupNormImfile $pageName pantaskState RUN
-    book getword detCleanupNormImfile $pageName det_id   -var DET_ID   
-    book getword detCleanupNormImfile $pageName iteration -var ITERATION
-    book getword detCleanupNormImfile $pageName class_id -var CLASS_ID 
-    book getword detCleanupNormImfile $pageName camera -var CAMERA
-    book getword detCleanupNormImfile $pageName state -var CLEANUP_MODE
-    book getword detCleanupNormImfile $pageName dbname -var DBNAME
-
-    # specify choice of local or remote host based on camera and chip (class_id)
-    set.host.for.camera $CAMERA FPA
-
-    stdout $LOGDIR/detrend.cleanup.norm.log
-    stderr $LOGDIR/detrend.cleanup.norm.log
-
-    # XXX is everything listed here needed?
-    $run = ipp_cleanup.pl --stage detrend.norm.imfile --stage_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
-    add_standard_args run
-
-    # save the pageName for future reference below
-    options $pageName
-
-    # create the command line
-    if ($VERBOSE > 1)
-      echo command $run
-    end
-    command $run
-  end
-
-  # default exit status
-  task.exit    default
-    process_exit detCleanupNormImfile $options:0 $JOB_STATUS
-  end
-
-  task.exit    crash
-    showcommand crash
-    book setword detCleanupNormImfile $options:0 pantaskState CRASH
-  end
-
-  # operation timed out?
-  task.exit    timeout
-    showcommand timeout
-    book setword detCleanupNormImfile $options:0 pantaskState TIMEOUT
-  end
-end
- 
-########## cleanup normexp ###########
-task	       detrend.cleanup.normexp.load
-  host         local
-
-  periods      -poll $LOADPOLL
-  periods      -exec $LOADEXEC
-  periods      -timeout 30
-  npending     1
-  active       true
-
-  stdout NULL
-  stderr $LOGDIR/detrend.normexp.cleanup.log
-
-  task.exec
-    $run = dettool -pendingcleanup_normalizedexp
-    if ($DB:n == 0)
-      option DEFAULT
-    else
-      # save the DB name for the exit tasks
-      option $DB:$detCleanupNormExp_DB
-      $run = $run -dbname $DB:$detCleanupNormExp_DB
-      $detCleanupNormExp_DB ++
-      if ($detCleanupNormExp_DB >= $DB:n) set detCleanupNormExp_DB = 0
-    end
-    add_poll_args run
-    command $run
-  end
-
-  # success
-  task.exit    0
-    # convert 'stdout' to book format
-    ipptool2book stdout detCleanupNormExp -key det_id:iteration -uniq -setword dbname $options:0 -setword pantaskState INIT
-    if ($VERBOSE > 2)
-      book listbook detCleanupNormExp
-    end
-
-    # delete existing entries in the appropriate pantaskStates
-    process_cleanup detCleanupNormExp
-  end
-
-  # locked list
-  task.exit    default
-    showcommand failure
-  end
-
-  task.exit    crash
-    showcommand crash
-  end
-
-  # operation times out?
-  task.exit    timeout
-    showcommand timeout
-  end
-end
-
-# run the ipp_cleanup.pl script on pending images
-task	       detrend.cleanup.normexp.run
-  periods      -poll $RUNPOLL
-  periods      -exec $RUNEXEC
-  periods      -timeout 60
-  active       true
-
-  task.exec
-    book npages detCleanupNormExp -var N
-    if ($N == 0) break
-    if ($NETWORK == 0) break
-    
-    # look for new images in detCleanupNormExp (pantaskState == INIT)
-    book getpage detCleanupNormExp 0 -var pageName -key pantaskState INIT
-    if ("$pageName" == "NULL") break
-
-    book setword detCleanupNormExp $pageName pantaskState RUN
-    book getword detCleanupNormExp $pageName det_id   -var DET_ID   
-    book getword detCleanupNormExp $pageName iteration -var ITERATION
-    book getword detCleanupNormExp $pageName camera -var CAMERA
-    book getword detCleanupNormExp $pageName state -var CLEANUP_MODE
-    book getword detCleanupNormExp $pageName dbname -var DBNAME
-
-    # specify choice of local or remote host based on camera and chip (class_id)
-    set.host.for.camera $CAMERA FPA
-
-    stdout $LOGDIR/detrend.cleanup.normexp.log
-    stderr $LOGDIR/detrend.cleanup.normexp.log
-
-    # XXX is everything listed here needed?
-    $run = ipp_cleanup.pl --stage detrend.norm.exp --stage_id $DET_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
-    add_standard_args run
-
-    # save the pageName for future reference below
-    options $pageName
-
-    # create the command line
-    if ($VERBOSE > 1)
-      echo command $run
-    end
-    command $run
-  end
-
-  # default exit status
-  task.exit    default
-    process_exit detCleanupNormExp $options:0 $JOB_STATUS
-  end
-
-  task.exit    crash
-    showcommand crash
-    book setword detCleanupNormExp $options:0 pantaskState CRASH
-  end
-
-  # operation timed out?
-  task.exit    timeout
-    showcommand timeout
-    book setword detCleanupNormExp $options:0 pantaskState TIMEOUT
-  end
-end
- 
