Index: /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/load.sas12.ipp004.cmd
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/load.sas12.ipp004.cmd	(revision 34922)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/load.sas12.ipp004.cmd	(revision 34922)
@@ -0,0 +1,1 @@
+dvopsps -dbhost localhost -dbuser dvo -dbpass dvo -dbname dvotest2 -D CATDIR /data/ipp004.0/gpc1/catdirs/SAS2.12 -region 330 330.1 0 0.1
Index: /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/mkcatdir.dvo
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/mkcatdir.dvo	(revision 34922)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/mkcatdir.dvo	(revision 34922)
@@ -0,0 +1,77 @@
+# -*-sh-*-
+
+input tap.dvo
+
+macro test.all
+  test.relphot PS1_DEV_0 PS1_V1
+  test.relphot PS1_DEV_1 PS1_V1
+  test.relphot PS1_V1 	PS1_V1
+  test.relphot PS1_V2 	PS1_V1
+  test.relphot PS1_DEV_0 PS1_V2
+  test.relphot PS1_DEV_1 PS1_V2
+  test.relphot PS1_V1 	PS1_V2
+  test.relphot PS1_V2 	PS1_V2
+end  
+
+list offset
+  0.000
+ -0.025
+  0.025
+  0.010
+end
+
+# create a populated catdir with a couple of cmf files
+macro test.relphot
+  if ($0 != 3)
+    echo "test.relphot (cmftype) (dvotype)"
+    break
+  end
+
+  tapPLAN 4
+
+  exec rm -rf catdir.test
+
+  $RA = 10.0
+  $DEC = 20.0
+
+  for i 0 $offset:n
+    mkinput $offset:$i
+    exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1
+    exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2
+  end
+
+  exec relphot -D CATDIR catdir.test r -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -update -nloop 10.0 >& /dev/null
+
+  catdir catdir.test
+  skyregion {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} 
+
+  imextract time Mcal
+
+  for i 0 $offset:n
+    tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i"
+  end
+
+  exec rm test.cmf test.in.txt
+  exec rm -r catdir.test
+
+  tapDONE
+end
+
+# make a simple input file for mkcmf
+macro mkinput
+  if ($0 != 2)
+    echo "mkinput (offset)"
+    break
+  end
+
+  exec rm -f test.in.txt
+
+  local i j
+  output test.in.txt
+  for i 10 1024 100
+    for j 10 1024 100
+      fprintf " %6.1f %6.1f  %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
+    end
+  end
+  output stdout
+end
