Index: trunk/ippTasks/addstar.pro
===================================================================
--- trunk/ippTasks/addstar.pro	(revision 34203)
+++ trunk/ippTasks/addstar.pro	(revision 34265)
@@ -24,4 +24,7 @@
   end
   task addstar.exp.load.staticsky
+    active true  
+  end
+  task addstar.exp.load.skycal
     active true
   end
@@ -41,4 +44,7 @@
     active false
   end
+  task addstar.exp.load.skycal
+    active false
+  end
   task addstar.exp.run
     active false
@@ -50,11 +56,15 @@
     active false
   end
- task addstar.revert.stack
-    active false
-  end
- task addstar.revert.staticsky
-    active false
-  end
-end
+  task addstar.revert.stack
+    active false
+  end
+  task addstar.revert.staticsky
+    active false
+  end
+  task addstar.revert.skycal
+    active false
+  end
+end
+
 macro addstar.revert.on
   task addstar.revert.cam
@@ -65,4 +75,7 @@
   end
   task addstar.revert.staticsky
+    active true
+  end
+  task addstar.revert.skycal
     active true
   end
@@ -77,4 +90,5 @@
 $addstar_revert_DB_SS = 0
 $addstar_revert_DB_SSM = 0
+$addstar_revert_DB_SC = 0 
 
 $LOADEXEX_ADD = 300
@@ -244,4 +258,58 @@
 
   # operation times out?
+  task.exit    timeout
+    showcommand timeout
+  end
+end
+
+task           addstar.exp.load.skycal
+  host         local
+  periods      -poll $LOADPOLL
+  periods      -exec 300
+  periods      -timeout 300
+  npending     1
+
+  stdout NULL
+  stderr $LOGDIR/addstar.exp.log
+
+  task.exec
+   # if ($LABEL:n == 0) break                                                                                 
+    $run = addtool -pendingexp -stage skycal
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      # save the DB name for the exit tasks                                                                   
+      option $DB:$addstar_DB
+      $run = $run -dbname $DB:$addstar_DB
+      $addstar_DB ++
+      if ($addstar_DB >= $DB:n) set addstar_DB = 0
+    end
+    add_poll_args run
+    add_poll_labels run
+    command $run
+  end
+
+  # success                                                                                                   
+  task.exit    0
+    # convert 'stdout' to book format                                                                         
+    ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT
+    if ($VERBOSE > 2)
+      book listbook addPendingExp
+    end
+
+    # delete existing entries in the appropriate pantaskStates                                                
+    process_cleanup addPendingExp
+  end
+
+  # default exit status                                                                                       
+  task.exit    default
+    showcommand failure
+  end
+
+  task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?                                                                                      
   task.exit    timeout
     showcommand timeout
@@ -311,4 +379,8 @@
 	sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
     end
+    if ("$STAGE" == "skycal")
+        sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
+    end
+
   
 
@@ -326,4 +398,10 @@
       $run = $run --stage_id $STAGE_ID
     end
+   if ("$STAGE" == "skycal")
+      $run = $run --stage_id $STAGE_ID
+    end
+
+
+
     if ("$IMAGE_ONLY" == "T")
       $run = $run --image-only
@@ -508,2 +586,49 @@
   end
 end
+
+task addstar.revert.skycal
+  host         local
+
+  periods      -poll 5.0
+  periods      -exec 60.0
+  periods      -timeout 1200
+  npending     1
+  active        false
+
+  stdout NULL
+  stderr $LOGDIR/revert.log
+
+  task.exec
+    if ($LABEL:n == 0) break
+    $run = addtool -revertprocessedexp -stage skycal
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      # save the DB name for the exit tasks                                                                   
+      option $DB:$addstar_revert_DB_SC
+      $run = $run -dbname $DB:$addstar_revert_DB_SC
+      $addstar_revert_DB_SC ++
+      if ($addstar_revert_DB_SC >= $DB:n) set addstar_revert_DB_SC = 0
+    end
+     add_poll_labels run
+    command $run
+  end
+
+  # success                                                                                                   
+  task.exit    0
+  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
Index: trunk/ippTasks/survey.pro
===================================================================
--- trunk/ippTasks/survey.pro	(revision 34203)
+++ trunk/ippTasks/survey.pro	(revision 34265)
@@ -862,4 +862,8 @@
         #only queue uncensored stacks
         $run = $run -uncensored
+    end
+    if ("$stage" == "skycal")
+        #skycal doesn't have magic, however, we still need to tell addtool 
+	$run = $run -uncensored
     end
 
