Index: /branches/eam_branches/ipp-20140717/ippToPsps/test/mksasdata.dvo
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/test/mksasdata.dvo	(revision 37221)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/test/mksasdata.dvo	(revision 37222)
@@ -33,4 +33,5 @@
 
   # are these used to find the exposures in any way?
+  # center of the test skycell
   $RA = 333.5
   $DEC = -5.0
@@ -45,5 +46,5 @@
   # system-wide info
   dbinsert ippToPspsFake (my_id) values (2)
-  dbinsert skycell (radeg, decdeg, skycell_id) values ($RA, $DEC, "skycell.0000.000")
+  dbinsert skycell (radeg, decdeg, skycell_id) values ($RA, $DEC, "skycell.1225.070")
 end
 
@@ -69,7 +70,39 @@
   end
   exec addstar -D CATDIR $catdir -region 330 340 -10 0 -resort
+end
 
+# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
+macro mkcatdir.stk
+  if ($0 != 1)
+    echo "mkcatdir"
+    break
+  end
+
+  mkdir $OUTDIR
+
+  local catdir
+  $catdirbase = catdir.sas.stk
+  $catdir = $OUTDIR/$catdirbase
+  exec rm -rf $catdir
+
+  # a single stack
+  $stkfile = sasdata/RINGS.V3.skycell.1225.070.stk.3366216.skycal.1589960
+  exec addstar -D CAMERA gpc1 -D CATFORMAT PS1_V5 -D CATDIR $catdir $stkfile.cmf
+end
+
+macro mkcal
+
+  local catdir
+  $catdir = $OUTDIR/catdir.sas.cam
+
+  # merge the cam and stk databases together:
+  exec dvomerge $OUTDIR/catdir.sas.stk into $catdir
+
+  # run relphot
   echo relphot -D CATDIR $catdir -region 330 340 -10 0 -images g,r,i,z,y -update -boundary-tree tess.3pi.fits
   exec relphot -D CATDIR $catdir -region 330 340 -10 0 -images g,r,i,z,y -update -boundary-tree tess.3pi.fits
+
+  echo relastro -v -D CATDIR $catdir -images -update-chips -region 330 340 -10 0 -update
+  exec relastro -v -D CATDIR $catdir -images -update-chips -region 330 340 -10 0 -update
 end
 
@@ -101,5 +134,5 @@
     dbinsert fakeRun (fake_id, cam_id) values ($expID, $expID)
     dbinsert warpRun (warp_id, fake_id) values ($expID, $expID)
-    dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($expID, "skycell.0000.000", "XY00")
+    dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($expID, "skycell.1225.070", "XY00")
     dbinsert addRun (add_id, stage, state, stage_id, minidvodb_name) values ($expID, "cam", "full", $expID, "$catdirbase")
     dbinsert addProcessedExp (add_id, fault) values ($expID, 0)
@@ -115,30 +148,4 @@
 
 # create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
-macro mkcatdir.stk
-  if ($0 != 1)
-    echo "mkcatdir"
-    break
-  end
-
-  mkdir $OUTDIR
-
-  local catdir
-  $catdirbase = catdir.sas.stk
-  $catdir = $OUTDIR/$catdirbase
-  exec rm -rf $catdir
-
-  # are these used to find the exposures in any way?
-  $RA = 333.5
-  $DEC = -5.0
-
-  # a single stack
-  $stkfile = sasdata/RINGS.V3.skycell.1225.070.stk.3366216.skycal.1589960
-  exec addstar -D CAMERA gpc1 -D CATFORMAT PS1_V5 -D CATDIR $catdir $stkfile.cmf
-
-  # echo relphot -D CATDIR $catdir -region {$RA-5} {$RA+5} {$DEC-5} {$DEC+5} -images g,r,i,z,y -update
-  # exec relphot -D CATDIR $catdir -region {$RA-5} {$RA+5} {$DEC-5} {$DEC+5} -images g,r,i,z,y -update
-end
-
-# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
 macro mkgpc1.stk
   if ($0 != 1)
@@ -149,8 +156,4 @@
   local catdirbase
   $catdirbase = catdir.sas.cam
-
-  # are these used to find the exposures in any way?
-  $RA = 333.5
-  $DEC = -5.0
 
   $TIMEFORMAT = mjd
@@ -168,5 +171,5 @@
 
   $expID = 1
-  dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "skycell.0000.000", "g.00000", "37500M")
+  dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "skycell.1225.070", "i.00000", "37500M")
   dbinsert stackInputSkyfile (stack_id, warp_id) values ($stkID, $expID)
   dbinsert stackSumSkyfile (stack_id, mjd_obs) values ($stkID, $mjd)
