Index: trunk/Ohana/src/addstar/test/simple.dvo
===================================================================
--- trunk/Ohana/src/addstar/test/simple.dvo	(revision 35263)
+++ trunk/Ohana/src/addstar/test/simple.dvo	(revision 37036)
@@ -7,30 +7,34 @@
   test.fields PS1_DEV_0 PS1_V1
   test.fields PS1_DEV_1 PS1_V1
-  test.fields PS1_V1 	PS1_V1
-  test.fields PS1_V2 	PS1_V1
-  test.fields PS1_V3 	PS1_V1
-  test.fields PS1_V4 	PS1_V1
+  test.fields PS1_V1    PS1_V1
+  test.fields PS1_V2    PS1_V1
+  test.fields PS1_V3    PS1_V1
+  test.fields PS1_V4    PS1_V1
 
   test.fields PS1_DEV_0 PS1_V2
   test.fields PS1_DEV_1 PS1_V2
-  test.fields PS1_V1 	PS1_V2
-  test.fields PS1_V2 	PS1_V2
-  test.fields PS1_V3 	PS1_V2
-  test.fields PS1_V4 	PS1_V4
+  test.fields PS1_V1    PS1_V2
+  test.fields PS1_V2    PS1_V2
+  test.fields PS1_V3    PS1_V2
+  test.fields PS1_V4    PS1_V4
 
   test.fields PS1_DEV_0 PS1_V3
   test.fields PS1_DEV_1 PS1_V3
-  test.fields PS1_V1 	PS1_V3
-  test.fields PS1_V2 	PS1_V3
-  test.fields PS1_V3 	PS1_V3
-  test.fields PS1_V4 	PS1_V4
+  test.fields PS1_V1    PS1_V3
+  test.fields PS1_V2    PS1_V3
+  test.fields PS1_V3    PS1_V3
+  test.fields PS1_V4    PS1_V4
 
   test.fields PS1_DEV_0 PS1_V4
   test.fields PS1_DEV_1 PS1_V4
-  test.fields PS1_V1 	PS1_V4
-  test.fields PS1_V2 	PS1_V4
-  test.fields PS1_V3 	PS1_V4
-  test.fields PS1_V4 	PS1_V4
+  test.fields PS1_V1    PS1_V4
+  test.fields PS1_V2    PS1_V4
+  test.fields PS1_V3    PS1_V4
+  test.fields PS1_V4    PS1_V4
 end  
+
+if (not($?NO_NOISE)) 
+  $NO_NOISE = ""
+end
 
 # create a populated catdir with a single cmf -- test each field
@@ -50,9 +54,11 @@
 
   mkinput
-  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1
+  echo mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 $NO_NOISE
+  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 $NO_NOISE
   if ($TAP_VERBOSE)
     echo exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
     exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
   else
+    echo addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
     exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass >& tmp.log
   end
@@ -112,9 +118,17 @@
 
     # some fields require arithmetic manipulations
-    if ("$name:0" == "KRON_FLUX") 
-     set v1 = -2.5*log(v1)
-    end
-    if ("$name:0" == "KRON_FLUX_ERR") 
-     set v1 = KRON_FLUX_ERR / KRON_FLUX
+    ## if ("$name:0" == "KRON_FLUX") 
+    ##  set v1 = -2.5*log(v1)
+    ## end
+    ## if ("$name:0" == "KRON_FLUX_ERR") 
+    ##  set v1 = KRON_FLUX_ERR / KRON_FLUX
+    ## end
+    if (("$name:0" == "X_PSF_SIG") || ("$name:0" == "Y_PSF_SIG"))
+     set v1 = int(100*(v1))
+     set v2 = int(100*(v2 + 0.0001))
+    end
+    if ("$name:0" == "POSANGLE")
+     set v1 = int((0xffff/360.0)*(v1))
+     set v2 = int((0xffff/360.0)*(v2 + 0.0028))
     end
 
@@ -206,7 +220,7 @@
 # this list is good for PS1_V1
 list testfields_PS1_V1
-  IPP_IDET          : detid	
-  X_PSF             : xccd	
-  Y_PSF             : yccd	
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
   X_PSF_SIG         : xccd:err #  FAIL
   Y_PSF_SIG         : yccd:err # FAIL
@@ -215,6 +229,6 @@
   POSANGLE          : SKIP # astrometry is not calibrated in the cmf
   PLTSCALE          : SKIP # astrometry is not calibrated in the cmf
-  PSF_INST_MAG      : mag:inst	
-  PSF_INST_MAG_SIG  : mag:err	
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
   AP_MAG_STANDARD   : mag:ap # FAIL
   AP_MAG_RADIUS     : SKIP # no accessor
@@ -222,13 +236,13 @@
   CAL_PSF_MAG       : SKIP # photometry is not calibrated in the cmf
   CAL_PSF_MAG_SIG   : SKIP # photometry is not calibrated in the cmf
-  SKY               : sky	
-  SKY_SIG           : sky_err	
-  PSF_CHISQ         : psf_chisq	
-  CR_NSIGMA         : cr_nsigma	
+  SKY               : sky       
+  SKY_SIG           : sky_err   
+  PSF_CHISQ         : psf_chisq 
+  CR_NSIGMA         : cr_nsigma 
   EXT_NSIGMA        : ext_nsigma
-  PSF_MAJOR         : FWHM_MAJ	
-  PSF_MINOR         : FWHM_MIN	
+  PSF_MAJOR         : FWHM_MAJ  
+  PSF_MINOR         : FWHM_MIN  
   PSF_THETA         : THETA # FAIL
-  PSF_QF            : PSF_QF	
+  PSF_QF            : PSF_QF    
   PSF_NDOF          : SKIP # no accessor
   PSF_NPIX          : SKIP # no accessor
@@ -237,12 +251,12 @@
   MOMENTS_YY        : SKIP # no accessor
   FLAGS             : phot_flags
-  N_FRAMES          : SKIP # no accessor	
+  N_FRAMES          : SKIP # no accessor        
 end
 
 # this list is good for PS1_V2
 list testfields_PS1_V2
-  IPP_IDET          : detid	
-  X_PSF             : xccd	
-  Y_PSF             : yccd	
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
   X_PSF_SIG         : xccd:err # FAIL
   Y_PSF_SIG         : yccd:err # FAIL
@@ -251,6 +265,6 @@
   POSANGLE          : SKIP # astrometry is not calibrated in the cmf
   PLTSCALE          : SKIP # astrometry is not calibrated in the cmf
-  PSF_INST_MAG      : mag:inst	
-  PSF_INST_MAG_SIG  : mag:err	
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
   AP_MAG_STANDARD   : mag:ap # FAIL
   AP_MAG_RADIUS     : SKIP # no accessor
@@ -258,13 +272,13 @@
   CAL_PSF_MAG       : SKIP # photometry is not calibrated in the cmf
   CAL_PSF_MAG_SIG   : SKIP # photometry is not calibrated in the cmf
-  SKY               : sky	
-  SKY_SIG           : sky_err	
-  PSF_CHISQ         : psf_chisq	
-  CR_NSIGMA         : cr_nsigma	
+  SKY               : sky       
+  SKY_SIG           : sky_err   
+  PSF_CHISQ         : psf_chisq 
+  CR_NSIGMA         : cr_nsigma 
   EXT_NSIGMA        : ext_nsigma
-  PSF_MAJOR         : FWHM_MAJ	
-  PSF_MINOR         : FWHM_MIN	
+  PSF_MAJOR         : FWHM_MAJ  
+  PSF_MINOR         : FWHM_MIN  
   PSF_THETA         : THETA # FAIL
-  PSF_QF            : PSF_QF	
+  PSF_QF            : PSF_QF    
   PSF_NDOF          : SKIP # no accessor
   PSF_NPIX          : SKIP # no accessor
@@ -273,18 +287,18 @@
   MOMENTS_YY        : SKIP # no accessor
   FLAGS             : phot_flags
-  N_FRAMES          : SKIP # no accessor	
+  N_FRAMES          : SKIP # no accessor        
 end
 
 # this list is good for PS1_V3
 list testfields_PS1_V3
-  IPP_IDET          : detid	
-  X_PSF             : xccd	
-  Y_PSF             : yccd	
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
   X_PSF_SIG         : xccd:err # FAIL
   Y_PSF_SIG         : yccd:err # FAIL
   POSANGLE          : SKIP # astrometry is not calibrated in the cmf
   PLTSCALE          : SKIP # astrometry is not calibrated in the cmf
-  PSF_INST_MAG      : mag:inst	
-  PSF_INST_MAG_SIG  : mag:err	
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
   PSF_INST_FLUX     : SKIP # not ingested into DVO
   PSF_INST_FLUX_SIG : SKIP # not ingested into DVO
@@ -297,13 +311,13 @@
   DEC_PSF           : SKIP # astrometry is not calibrated in the cmf
   PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO
-  SKY               : sky	
-  SKY_SIG           : sky_err	
-  PSF_CHISQ         : psf_chisq	
-  CR_NSIGMA         : cr_nsigma	
+  SKY               : sky       
+  SKY_SIG           : sky_err   
+  PSF_CHISQ         : psf_chisq 
+  CR_NSIGMA         : cr_nsigma 
   EXT_NSIGMA        : ext_nsigma
-  PSF_MAJOR         : FWHM_MAJ	
-  PSF_MINOR         : FWHM_MIN	
+  PSF_MAJOR         : FWHM_MAJ  
+  PSF_MINOR         : FWHM_MIN  
   PSF_THETA         : THETA # FAIL
-  PSF_QF            : PSF_QF	
+  PSF_QF            : PSF_QF    
   PSF_QF_PERFECT    : SKIP # not ingested into DVO
   PSF_NDOF          : PSF_NDOF
@@ -326,51 +340,118 @@
 end
 
-# this list is good for PS1_V4
-list testfields_PS1_V4
-  IPP_IDET          : detid	
-  X_PSF             : xccd	
-  Y_PSF             : yccd	
-  X_PSF_SIG         : xccd:err # FAIL
-  Y_PSF_SIG         : yccd:err # FAIL
-  POSANGLE          : SKIP # astrometry is not calibrated in the cmf
-  PLTSCALE          : SKIP # astrometry is not calibrated in the cmf
-  PSF_INST_MAG      : mag:inst	
-  PSF_INST_MAG_SIG  : mag:err	
-  PSF_INST_FLUX     : SKIP # not ingested into DVO
-  PSF_INST_FLUX_SIG : SKIP # not ingested into DVO
-  AP_MAG            : mag:aperinst # FAIL
+# this list is good for PS1_V5
+list testfields_PS1_V5
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
+  X_PSF_SIG         : xccd:err
+  Y_PSF_SIG         : yccd:err
+  POSANGLE          : posangle
+  PLTSCALE          : platescale
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
+  PSF_INST_FLUX     : flux:inst
+  PSF_INST_FLUX_SIG : flux:inst:err
+  AP_MAG            : mag:aper:inst
   AP_MAG_RAW        : SKIP # not ingested into DVO
   AP_MAG_RADIUS     : SKIP # not ingested into DVO
-  CAL_PSF_MAG       : SKIP # photometry is not calibrated in the cmf
-  CAL_PSF_MAG_SIG   : SKIP # photometry is not calibrated in the cmf
-  RA_PSF            : SKIP # astrometry is not calibrated in the cmf
-  DEC_PSF           : SKIP # astrometry is not calibrated in the cmf
-  PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO
-  SKY               : sky	
-  SKY_SIGMA         : sky_err	
-  PSF_CHISQ         : psf_chisq	
-  CR_NSIGMA         : cr_nsigma	
-  EXT_NSIGMA        : ext_nsigma
-  PSF_MAJOR         : FWHM_MAJ	
-  PSF_MINOR         : FWHM_MIN	
-  PSF_THETA         : THETA # FAIL
-  PSF_QF            : PSF_QF	
-  PSF_QF_PERFECT    : SKIP # not ingested into DVO
-  PSF_NDOF          : PSF_NDOF
-  PSF_NPIX          : PSF_NPIX
-  MOMENTS_XX        : MXX
-  MOMENTS_XY        : MXY
-  MOMENTS_YY        : MYY
-  MOMENTS_M3C       : SKIP # not ingested into DVO
-  MOMENTS_M3S       : SKIP # not ingested into DVO
-  MOMENTS_M4C       : SKIP # not ingested into DVO
-  MOMENTS_M4S       : SKIP # not ingested into DVO
-  MOMENTS_R1        : SKIP # not ingested into DVO
-  MOMENTS_RH        : SKIP # not ingested into DVO
-  KRON_FLUX         : mag:kroninst
-  KRON_FLUX_ERR     : mag:kronerr
-  KRON_FLUX_INNER   : SKIP # not ingested into DVO
-  KRON_FLUX_OUTER   : SKIP # not ingested into DVO
-  FLAGS             : phot_flags
-  N_FRAMES          : SKIP # not ingested into DVO
-end
+  AP_FLUX           : flux:aper:inst  
+  AP_FLUX_SIG       : flux:aper:inst:err
+  CAL_PSF_MAG       : mag:cal
+  CAL_PSF_MAG_SIG   : mag:cal:err
+  RA_PSF            : ra
+  DEC_PSF           : dec
+  AP_NPIX           : SKIP # not ingested into DVO		      
+  PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO		      
+  SKY               : sky       				      
+  SKY_SIGMA         : sky_err   				      
+  PSF_CHISQ         : psf_chisq 				      
+  CR_NSIGMA         : cr_nsigma 				      
+  EXT_NSIGMA        : ext_nsigma				      
+  PSF_MAJOR         : fwhm_maj # XXX technically, this is not FWHM but Sigma
+  PSF_MINOR         : fwhm_min # XXX technically, this is not FWHM but Sigma
+  PSF_THETA         : theta # FAIL				      
+  PSF_CORE          : SKIP # not ingested into DVO 
+  PSF_FWHM_MAJ      : SKIP # not ingested into DVO 
+  PSF_FWHM_MIN      : SKIP # not ingested into DVO 
+  PSF_QF            : psf_qf    				      
+  PSF_QF_PERFECT    : SKIP # not ingested into DVO		      
+  PSF_NDOF          : psf_ndof				      
+  PSF_NPIX          : psf_npix				      
+  MOMENTS_XX        : Mxx					      
+  MOMENTS_XY        : Mxy					      
+  MOMENTS_YY        : Myy					      
+  MOMENTS_M3C       : SKIP # not ingested into DVO		      
+  MOMENTS_M3S       : SKIP # not ingested into DVO		      
+  MOMENTS_M4C       : SKIP # not ingested into DVO		      
+  MOMENTS_M4S       : SKIP # not ingested into DVO		      
+  MOMENTS_R1        : SKIP # not ingested into DVO		      
+  MOMENTS_RH        : SKIP # not ingested into DVO		      
+  KRON_FLUX         : flux:kron:inst				      
+  KRON_FLUX_ERR     : flux:kron:inst:err				      
+  KRON_FLUX_INNER   : SKIP # not ingested into DVO		          
+  KRON_FLUX_OUTER   : SKIP # not ingested into DVO		      
+  SKY_LIMIT_RAD     : SKIP # not ingested into DVO		          
+  SKY_LIMIT_FLUX    : SKIP # not ingested into DVO		          
+  SKY_LIMIT_SLOPE   : SKIP # not ingested into DVO		          
+  FLAGS             : phot_flags				      
+  FLAGS2            : SKIP # not ingested into DVO		          
+  N_FRAMES          : SKIP # not ingested into DVO		      
+end								      
+
+# this list is good for PS1_SV3
+list testfields_PS1_SV3
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
+  X_PSF_SIG         : xccd:err
+  Y_PSF_SIG         : yccd:err
+  POSANGLE          : posangle
+  PLTSCALE          : platescale
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
+  PSF_INST_FLUX     : flux:inst
+  PSF_INST_FLUX_SIG : flux:inst:err
+  AP_MAG            : mag:aper:inst
+  AP_MAG_RAW        : SKIP # not ingested into DVO
+  AP_MAG_RADIUS     : SKIP # not ingested into DVO
+  AP_FLUX           : flux:aper:inst  
+  AP_FLUX_SIG       : flux:aper:inst:err
+  CAL_PSF_MAG       : mag:cal
+  CAL_PSF_MAG_SIG   : mag:cal:err
+  RA_PSF            : ra
+  DEC_PSF           : dec
+  AP_NPIX           : SKIP # not ingested into DVO		      
+  PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO		      
+  SKY               : sky       				      
+  SKY_SIGMA         : sky_err   				      
+  PSF_CHISQ         : psf_chisq 				      
+  CR_NSIGMA         : cr_nsigma 				      
+  EXT_NSIGMA        : ext_nsigma				      
+  PSF_MAJOR         : fwhm_maj # XXX technically, this is not FWHM but Sigma
+  PSF_MINOR         : fwhm_min # XXX technically, this is not FWHM but Sigma
+  PSF_THETA         : theta # FAIL				      
+  PSF_CORE          : SKIP # not ingested into DVO 
+  PSF_FWHM_MAJ      : SKIP # not ingested into DVO 
+  PSF_FWHM_MIN      : SKIP # not ingested into DVO 
+  PSF_QF            : psf_qf    				      
+  PSF_QF_PERFECT    : SKIP # not ingested into DVO		      
+  PSF_NDOF          : psf_ndof				      
+  PSF_NPIX          : psf_npix				      
+  MOMENTS_XX        : Mxx					      
+  MOMENTS_XY        : Mxy					      
+  MOMENTS_YY        : Myy					      
+  MOMENTS_M3C       : SKIP # not ingested into DVO		      
+  MOMENTS_M3S       : SKIP # not ingested into DVO		      
+  MOMENTS_M4C       : SKIP # not ingested into DVO		      
+  MOMENTS_M4S       : SKIP # not ingested into DVO		      
+  MOMENTS_R1        : SKIP # not ingested into DVO		      
+  MOMENTS_RH        : SKIP # not ingested into DVO		      
+  KRON_FLUX         : flux:kron:inst				      
+  KRON_FLUX_ERR     : flux:kron:inst:err				      
+  KRON_FLUX_INNER   : SKIP # not ingested into DVO		          
+  KRON_FLUX_OUTER   : SKIP # not ingested into DVO		      
+  FLAGS             : phot_flags				      
+  FLAGS2            : SKIP # not ingested into DVO		          
+  N_FRAMES          : SKIP # not ingested into DVO		      
+end								      
