Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.dvo
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.dvo	(revision 38300)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.dvo	(revision 38301)
@@ -1,3 +1,4 @@
 # -*-sh-*-
+if (not($?VERBOSE)) set VERBOSE = 0
 
 input tap.dvo
@@ -41,6 +42,11 @@
   end
 
-  echo relphot -D CATDIR catdir.test r -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -update -nloop 10.0
-  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
+  $output = >& /dev/null
+  if ($VERBOSE > 2) 
+    $output = 
+  end
+  $command = relphot -D CATDIR catdir.test -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -update -nloop 10.0 -images r
+  echo $command
+  exec $command $output
 
   catdir catdir.test
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.flatcorr.dvo
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.flatcorr.dvo	(revision 38300)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.flatcorr.dvo	(revision 38301)
@@ -34,5 +34,5 @@
 
   # images are loaded into dvo with GPC1 photcodes, so we need to get the nominal zps for those filters
-  $zpt_nominal:g = 24.58
+  $zpt_nominal:g = 24.00
   $zpt_nominal:r = 24.80
   $zpt_nominal:i = 24.74
@@ -41,5 +41,5 @@
 
   # klam is negative, so klam*(airmass - 1) increase the zero point
-  $klam_nominal:g = -0.15
+  $klam_nominal:g =  0.00
   $klam_nominal:r = -0.10
   $klam_nominal:i = -0.04
@@ -50,7 +50,7 @@
 
   # sequence to count images (only used in this function)
-  create tmpseq 0 9
-
-  $filt_uc:n = 9
+  create tmpseq 0 1
+
+  $filt_uc:n = 1
   $filt_uc:0 = g
   $filt_uc:1 = g
@@ -75,19 +75,19 @@
   # ubercal zero points are defined as ZP_nominal + 2.5log(exptime) + K*(airmass - 1.0)
   # note that K is defined as a negative value (is this sensible?)
-  set zpt_uc = 25.0 + 2.5*log(exptime_uc) + klam_uc*(airmass_uc - 1.0) + tmpseq*0.0050 - 0.0025
+  set zpt_uc = 24.0 + 2.5*log(exptime_uc) + klam_uc*(airmass_uc - 1.0) + tmpseq*0.0050 - 0.0025
 
   set mjd_uc = zero(zpt_uc)
   mjd_uc[0] = 55000.01
-  mjd_uc[1] = 55000.02
-  mjd_uc[2] = 55000.03
-  mjd_uc[3] = 55015.01
-  mjd_uc[4] = 55015.02
-  mjd_uc[5] = 55015.03
-  mjd_uc[6] = 55025.01
-  mjd_uc[7] = 55025.02
-  mjd_uc[8] = 55025.03
+  # mjd_uc[1] = 55000.02
+  # mjd_uc[2] = 55000.03
+  # mjd_uc[3] = 55015.01
+  # mjd_uc[4] = 55015.02
+  # mjd_uc[5] = 55015.03
+  # mjd_uc[6] = 55025.01
+  # mjd_uc[7] = 55025.02
+  # mjd_uc[8] = 55025.03
 
   # mjd and zpt values for not-ubercal'ed images
-  $filt_nc:n = 9
+  $filt_nc:n = 1
   $filt_nc:0 = g
   $filt_nc:1 = g
@@ -115,12 +115,12 @@
   set mjd_nc = zero(zpt_nc)
   mjd_nc[0] = 55000.11
-  mjd_nc[1] = 55000.12
-  mjd_nc[2] = 55000.13
-  mjd_nc[3] = 55015.11
-  mjd_nc[4] = 55015.12
-  mjd_nc[5] = 55015.13
-  mjd_nc[6] = 55025.11
-  mjd_nc[7] = 55025.12
-  mjd_nc[8] = 55025.13
+  # mjd_nc[1] = 55000.12
+  # mjd_nc[2] = 55000.13
+  # mjd_nc[3] = 55015.11
+  # mjd_nc[4] = 55015.12
+  # mjd_nc[5] = 55015.13
+  # mjd_nc[6] = 55025.11
+  # mjd_nc[7] = 55025.12
+  # mjd_nc[8] = 55025.13
 end
 
@@ -150,8 +150,10 @@
   mksequence $fileroot $catdir
   for i 0 mjd_uc[] 3
-    ckexposure catdir.test mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i raw
+    echo ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i raw
+    ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i raw
+    break
   end
   for i 0 mjd_nc[] 3
-    ckexposure catdir.test mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i raw
+    ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i raw
   end
 
@@ -159,17 +161,17 @@
   exec setphot -update -ubercal testzpt.fits -D CATDIR $catdir
   for i 0 mjd_uc[] 3
-    ckexposure catdir.test mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i setphot_uc
+    ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i setphot_uc
   end
   for i 0 mjd_nc[] 3
-    ckexposure catdir.test mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i setphot_nc
+    ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i setphot_nc
   end
 
   # run relphot on the db and check that the images now match the expected values
-  exec relphot g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR catdir.test -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& tmp.log
+  exec relphot g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& tmp.log
   for i 0 mjd_uc[] 3
-    ckexposure catdir.test mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot
+    ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot
   end
   for i 0 mjd_nc[] 3
-    ckexposure catdir.test mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot
+    ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot
   end
 
@@ -280,5 +282,7 @@
   
         set dm_adjust = dm$ix\$iy - $ZPT_NOMINAL + $ZPT_REAL_NORM + cell_off[$ix][$iy]
-        vstat -q dm_adjust
+        echo set dm_adjust = dm$ix\$iy - $ZPT_NOMINAL + $ZPT_REAL_NORM + cell_off[$ix][$iy]
+
+        vstat dm_adjust
         tapOK {abs($MEAN) < 0.005} "addstar raw ZP $MJD_IMAGE $FILTER"
       end
@@ -317,11 +321,12 @@
   # we have defined a set of mjd and zero point values for ubercal'ed images
   # for i 0 mjd_uc[]
-  for i 0 mjd_uc[] 3
+  for i 0 mjd_uc[] 1
     mkexposure $1.uc.$i $RA_CENTER $DEC_CENTER zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] mjd_uc[$i] $filt_uc:$i $2
   end
+  return
 
   # we have a second set of mjd and zero point values for non-ubercal'ed images
   # for i 0 mjd_nc[]
-  for i 0 mjd_nc[] 3
+  for i 0 mjd_nc[] 1
     mkexposure $1.nc.$i $RA_CENTER $DEC_CENTER zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] mjd_nc[$i] $filt_nc:$i $2
   end
@@ -379,6 +384,7 @@
     # the fake images have inconsistent ra,dec and airmass,sidtime values
     echo addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass
-    exec addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass >& tmp.log
-  end
+    exec addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass
+  end
+  return
  end
 end
@@ -456,10 +462,10 @@
 
   # define the season boundaries
-  keyword phu TS0_0000 -wf 55000.0
-  keyword phu TS1_0000 -wf 55010.0
-  keyword phu TS0_0001 -wf 55010.0
-  keyword phu TS1_0001 -wf 55020.0
-  keyword phu TS0_0002 -wf 55020.0
-  keyword phu TS1_0002 -wf 55030.0
+  keyword phu S0_MJD0 -wf 55000.0
+  keyword phu S1_MJD0 -wf 55010.0
+  keyword phu S0_MJD1 -wf 55010.0
+  keyword phu S1_MJD1 -wf 55020.0
+  keyword phu S0_MJD2 -wf 55020.0
+  keyword phu S1_MJD2 -wf 55030.0
 
   # create a single flat-field correction map for a single chip
