Index: trunk/ippToPsps/doc/notes.txt
===================================================================
--- trunk/ippToPsps/doc/notes.txt	(revision 35452)
+++ trunk/ippToPsps/doc/notes.txt	(revision 35456)
@@ -1,2 +1,41 @@
+
+2013.04.27
+
+ need to move the conversion between mags and flux into dvopsps.
+
+ * detection table
+   * psfFlux : uses PSF_INST_MAG instead of PSF_INST_FLUX
+   * psfFluxErr : uses PSF_INST_MAG_SIG and PSF_INST_MAG instead of PSF_INST_FLUX_SIG
+   * apFlux : uses AP_MAG instead of AP_FLUX
+   * kronFlux : correctly uses KRON_FLUX
+   * kronFluxErr : correctly uses KRON_FLUX_ERR
+   
+   ** psfFlux is forced to 0.0000001 instead of 0.0 -- why?
+   
+ * stack detection table (same issues as detection table)
+   * psfFlux : uses PSF_INST_MAG instead of PSF_INST_FLUX
+   * psfFluxErr : uses PSF_INST_MAG_SIG and PSF_INST_MAG instead of PSF_INST_FLUX_SIG
+   * apFlux : uses AP_MAG instead of AP_FLUX
+   * kronFlux : correctly uses KRON_FLUX
+   * kronFluxErr : correctly uses KRON_FLUX_ERR
+   
+   * psfFlux is set to 2 sigma if psfFlux is NULL
+
+ * object 
+   * Mean PSF Mag : direct from DVO MAG
+   * Mean PSF Mag Err : direct from DVO MAG_ERR
+   * Mean Kron Mag : direct from DVO KRON MAG
+   * Mean Kron Mag Err : direct from DVO KRON MAG_ERR
+   
+   * Stack PSF Mag : from DVO stack psf flux
+   * Stack PSF Mag Err : from DVO stack psf flux err
+   * Stack Kron Mag : from DVO stack kron flux
+   * Stack Kron Mag Err : from DVO stack kron flux err
+      
+ 
+
+   
+
+old notes:
 
 example of joining ipptopsps and gpc1 tables:
Index: trunk/ippToPsps/jython/detectionbatch.py
===================================================================
--- trunk/ippToPsps/jython/detectionbatch.py	(revision 35452)
+++ trunk/ippToPsps/jython/detectionbatch.py	(revision 35456)
@@ -483,11 +483,11 @@
         # something like (f < 0.0) ? -999 : -2.5*log10(f)
         # as a result, the negative fluxes here result in floating point errors
-        sql = "UPDATE " + pspsTableName " SET psfFlux = 1e20 WHERE psfFlux <= 0.0"
-        self.scratchDb.execute(sql)
-        
-        sql = "UPDATE " + pspsTableName " SET apFlux = 1e20 WHERE apFlux <= 0.0"
-        self.scratchDb.execute(sql)
-
-        sql = "UPDATE " + pspsTableName " SET kronFlux = 1e20 WHERE kronFlux <= 0.0"
+        sql = "UPDATE " + pspsTableName + " SET psfFlux = 1e20 WHERE psfFlux <= 0.0"
+        self.scratchDb.execute(sql)
+        
+        sql = "UPDATE " + pspsTableName + " SET apFlux = 1e20 WHERE apFlux <= 0.0"
+        self.scratchDb.execute(sql)
+
+        sql = "UPDATE " + pspsTableName + " SET kronFlux = 1e20 WHERE kronFlux <= 0.0"
         self.scratchDb.execute(sql)
 
@@ -1035,5 +1035,5 @@
   
        # XXX EAM NOTE : this is fragile : requires PS1_V4
-       columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG KRON_FLUX KRON_FLUX_ERR FLAGS FLAGS2 SKY SKY_SIGMA EXT_NSIGMA PSF_QF_PERFECT PSF_CHISQ"
+       columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PSF_INST_FLUX PSF_INST_FLUX_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG AP_FLUX KRON_FLUX KRON_FLUX_ERR FLAGS FLAGS2 SKY SKY_SIGMA EXT_NSIGMA PSF_QF_PERFECT PSF_CHISQ"
 
        return super(DetectionBatch, self).importIppTables(columns, regex)
Index: trunk/ippToPsps/test/fulltest.sh
===================================================================
--- trunk/ippToPsps/test/fulltest.sh	(revision 35452)
+++ trunk/ippToPsps/test/fulltest.sh	(revision 35456)
@@ -1,3 +1,5 @@
 #!/bin/csh -f
+
+chmod +x *.dvo *.sh
 
 # a bit crude : get the datadir path by interpollation of the PATH element for psconfig
@@ -23,8 +25,28 @@
 set objectbatch  = 1
 
-set args    = ""
-
-while ("$1" != "") 
- switch ("$1")
+set targ = ($argv)
+set args = ""
+
+while ($#targ)
+ switch ("$targ[1]")
+  case -h
+  case -help
+    echo "USAGE: fulltest.sh [-XX] [+XX]"
+    echo " -XX : turn off features"
+    echo " +XX : turn on features"
+    echo "  features: all, mkgpc1, initdb, initscratch, initbatch, camera, stack, object"
+    exit 2
+  case -all
+    set mkgpc1       = 0
+    set initdb       = 0
+    set initscratch  = 0
+    set initbatch    = 0
+    set camqueue     = 0
+    set cambatch     = 0
+    set stackqueue   = 0
+    set stackbatch   = 0
+    set objectqueue  = 0
+    set objectbatch  = 0
+    breaksw;
   case -mkgpc1
     set mkgpc1 = 0
@@ -52,9 +74,65 @@
     breaksw;
   default:
-    set args=($args $1);
+    set args=($args $targ[1]);
     breaksw;
   endsw
-  shift
+  shift targ
 end
+
+set targ = ($args)
+set args = ""
+
+while ($#targ)
+ switch ("$targ[1]")
+  case +all
+    set mkgpc1       = 1
+    set initdb       = 1
+    set initscratch  = 1
+    set initbatch    = 1
+    set camqueue     = 1
+    set cambatch     = 1
+    set stackqueue   = 1
+    set stackbatch   = 1
+    set objectqueue  = 1
+    set objectbatch  = 1
+    breaksw;
+  case +mkgpc1
+    set mkgpc1 = 1
+    breaksw;
+  case +initdb
+    set initdb = 1
+    breaksw;
+  case +initscratch
+    set initscratch = 1
+    breaksw;
+  case +initbatch
+    set initbatch = 1
+    breaksw;
+  case "+camera"
+    set camqueue = 1
+    set cambatch = 1
+    breaksw;
+  case +stack
+    set stackqueue = 1
+    set stackbatch = 1
+    breaksw;
+  case +object
+    set objectqueue = 1
+    set objectbatch = 1
+    breaksw;
+  default:
+    set args=($args $targ[1]);
+    breaksw;
+  endsw
+  shift targ
+end
+
+if ($args[1] != "") then
+    echo "USAGE: fulltest.sh [-XX] [+XX]"
+    echo " -XX : turn off features"
+    echo " +XX : turn on features"
+    echo "  features: all, mkgpc1, initdb, initscratch, initbatch, camera, stack, object"
+    exit 2
+endif
 
 set stackqueuename = 0
Index: trunk/ippToPsps/test/mkgpc1data.dvo
===================================================================
--- trunk/ippToPsps/test/mkgpc1data.dvo	(revision 35452)
+++ trunk/ippToPsps/test/mkgpc1data.dvo	(revision 35456)
@@ -37,6 +37,8 @@
 macro mkfull
   init.db
-  mkcatdir.cam PS1_V3 PS1_V4
-  mkcatdir.stk PS1_V3 PS1_V4
+  # mkcatdir.cam PS1_V3 PS1_V4
+  # mkcatdir.stk PS1_V3 PS1_V4
+  mkcatdir.cam PS1_V4 PS1_V4
+  mkcatdir.stk PS1_V4 PS1_V4
   insert.stack.set
 end
