Index: /branches/eam_branches/ipp-20140717/ippToPsps/test/fulltest.sh
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/test/fulltest.sh	(revision 37156)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/test/fulltest.sh	(revision 37157)
@@ -169,4 +169,5 @@
   mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test_scratch"
   ippjython setupScratchDb.py -test
+  if ($status) exit
 endif
 
@@ -211,4 +212,5 @@
   echo "2020-01-01 00:00:00.0  " >> initbatch.dat # trange_end
   cat initbatch.dat | ippjython queue.py -test edit
+  if ($status) exit
 
   echo ""
@@ -217,4 +219,5 @@
   rm -rf $OUTDIR/IN
   ippjython loader.py -test initbatch init
+  if ($status) exit
 endif
 
@@ -257,4 +260,5 @@
   echo "2020-01-01 00:00:00.0 " >> cambatch.dat # trange_end
   cat cambatch.dat | ippjython queue.py -test edit
+  if ($status) exit
 endif
 
@@ -265,4 +269,5 @@
   rm -rf $OUTDIR/P2
   ippjython loader.py -test $queuename once
+  if ($status) exit
 endif
 
@@ -308,4 +313,5 @@
   echo "2020-01-01 00:00:00.0 " >> stackbatch.dat # trange_end
   cat stackbatch.dat | ippjython queue.py -test edit
+  if ($status) exit
 endif
 
@@ -319,4 +325,5 @@
   rm -rf $OUTDIR/ST
   ippjython loader.py -test $stackqueuename once
+  if ($status) exit
 endif
 
@@ -362,4 +369,5 @@
   echo "2020-01-01 00:00:00.0 " >> objectbatch.dat # trange_end
   cat objectbatch.dat | ippjython queue.py -test edit once
+  if ($status) exit
 endif
 
@@ -372,5 +380,7 @@
   endif
   rm -rf $OUTDIR/OB
-   ippjython loader.py -test $objectqueuename once
-endif
-
+
+  ippjython loader.py -test $objectqueuename once
+  if ($status) exit
+endif
+
Index: /branches/eam_branches/ipp-20140717/ippToPsps/test/mkgpc1.sh
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/test/mkgpc1.sh	(revision 37156)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/test/mkgpc1.sh	(revision 37157)
@@ -89,7 +89,9 @@
   );
   CREATE TABLE stackSumSkyfile (
-   stack_id INT
+   stack_id INT,
+   mjd_obs DOUBLE
   );
   CREATE TABLE skycalRun (
+   sky_id INT,
    skycal_id INT,
    stack_id INT
Index: /branches/eam_branches/ipp-20140717/ippToPsps/test/mkgpc1data.dvo
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/test/mkgpc1data.dvo	(revision 37156)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/test/mkgpc1data.dvo	(revision 37157)
@@ -147,5 +147,5 @@
 
     mkinput $offset $rawfile
-    exec mkcmf -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -radec $RA $DEC -type $1 -imageID $ID -sourceID 0
+    exec mkcmf -photcode SIMTEST.r.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -radec $RA $DEC -type $1 -imageID $ID -sourceID 0
 
     # keywords which are read from image extension
@@ -275,5 +275,5 @@
 
     mkinput $offset $rawfile
-    exec mkcmf $rawfile $cmffile -extname SkyChip -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1 -imageID $ID -sourceID 1
+    exec mkcmf -photcode SIMTEST.r.SkyChip $rawfile $cmffile -extname SkyChip -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1 -imageID $ID -sourceID 1
 
     # add some required header keywords:
@@ -351,4 +351,10 @@
   dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "skycell.0000.000", "g.00000", "testsoft")
 
+  $TIMEFORMAT = mjd
+  $TIMEREF = 2001/01/01,00:00:00
+
+  $mjdsum = 0.0
+  $Nstk = 0
+
   for i 0 $imagedata:n
     echo $imagedata:$i
@@ -362,7 +368,14 @@
     insert.exp $expID $expfile
     dbinsert stackInputSkyfile (stack_id, warp_id) values ($stkID, $expID)
-  end
-  dbinsert stackSumSkyfile (stack_id) values ($stkID)
-  dbinsert skycalRun (skycal_id, stack_id) values ($stkID, $stkID)
+
+    echo ctimes -abs $myDATE,$myTIME -var mjd
+         ctimes -abs $myDATE,$myTIME -var mjd
+    $mjdsum += $mjd
+    $Nstk ++
+  end
+  $mjd = $mjdsum / $Nstk
+
+  dbinsert stackSumSkyfile (stack_id, mjd_obs) values ($stkID, $mjd)
+  dbinsert skycalRun (sky_id, skycal_id, stack_id) values ($stkID, $stkID, $stkID)
   dbinsert skycalResult (skycal_id, path_base) values ($stkID, "$stkfile")
   
