Index: /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectExtra.txt
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectExtra.txt	(revision 37177)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectExtra.txt	(revision 37177)
@@ -0,0 +1,49 @@
+		  
+objID             | from StackObjectThin
+gcObjID	  	  | ** DROP
+ippObjID          | from StackObjectThin
+surveyID          | from StackObjectThin
+skyCellID         | from StackObjectThin
+randomStackObjID  | from StackObjectThin
+stackDetectRowID  | from StackObjectThin
+primaryDetection  | 
+bestDetection     | 
+                  | 
+dvoRegionID       | from StackObjectThin
+dataRelease       | from StackObjectThin
+------------------| 
+--                | 
+--                | 
+------------------| 
+gippDetectID      | from StackObjectThin
+gstackDetectID    | from StackObjectThin
+gstackMetaID      | from StackObjectThin
+------------------| 
+gxPos             | cmf X_PSF
+gyPos             | cmf Y_PSF
+gxPosErr          | cmf X_PSF_SIG
+gyPosErr          | cmf Y_PSF_SIG
+gpsfMajorFWHM     | cmf 
+gpsfMinorFWHM     | cmf 
+gpsfTheta         | cmf 
+gpsfCore          | cmf 
+gpsfLikelihood    | cmf 
+gpsfQf            | cmf 
+gpsfQfPerfect     | cmf 
+gpsfChiSq         | cmf 
+gmomentXX         | cmf 
+gmomentXY         | cmf 
+gmomentYY         | cmf 
+gmomentR1         | cmf 
+gmomentRH         | cmf 
+gPSFFlux     	  | cmf 
+gPSFFluxErr  	  | cmf 
+gApFlux           | cmf 
+gApFluxErr        | cmf 
+gApFillFac        | cmf 
+gKronFlux         | cmf 
+gKronFluxErr      | cmf 
+gKronRad          | cmf 
+gexpTime          | dvopsps
+gzp               | dvopsps
+
Index: /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt	(revision 37176)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt	(revision 37177)
@@ -1,15 +1,15 @@
 		  
 objID              = dvo = average.extID   [calculated in addstar]
-gcObjID            = dvo = average.extIDgc [not done]
-ippObjID           = dvo = average.objID + (average.catID << 32)
-surveyID           = ipptopsps
-skyCellID          = ipptopsps / smf header
+gcObjID            = dvo = average.extIDgc *** NOT SET [DROP?]
+ippObjID           = dvo = average.objID + (average.catID << 32) [NOTE: this is a change in definition]
+surveyID           = ipptopsps : internal, from survey name
+skyCellID          = *** we need to decide how we should store this
 randomStackObjID   = ipptopsps (RANDOM on sql into mysql)
 stackDetectRowID   = PSPS ?
-primaryDetection   = dvo 
-bestDetection      = dvo ?
+primaryDetection   = dvo *** NOT YET DONE CORRECTLY
+bestDetection      = dvo *** THIS CANNOT BE SET UNTIL LATER
                    = 
-dvoRegionID        = dvo = average.catID
-dataRelease        = ippToPsps
+dvoRegionID        = dvo = average.catID *** NOT YET CARRIED IN FROM dvopsps
+dataRelease        = ippToPsps : user input (skychunk.dataRelease)
 --
 --
@@ -18,23 +18,19 @@
 gippDetectID       = dvopsps.ippDetectID = dvo:measure.detID = smf / IPP_IDET
 gstackDetectID     = dvopsps.detectID = dvo:measure.extID [calculated in addstar: psps stack detect ID]
-gstackMetaID       = smf header 
+gstackMetaID       = ipptopsps : gpc1 db, matches cmf IMAGEID
 --
-gra                = dvo = average.Rstk [relastro]
-gdec               = dvo = average.Dstk [relastro]
-graErr             = dvo = average.dRstk [relastro]
-gdecErr            = dvo = average.dDstk [relastro]
-gzp                = dvo [relphot] -- XXX define this more exactly
-gPSFMag      	   = dvo
-gPSFMagErr   	   = dvo
-gApMag       	   = dvo
-gApMagErr    	   = dvo
-gKronMag     	   = dvo
-gKronMagErr  	   = dvo
-gsky               = smf
-gskyErr            = smf
-ginfoFlag          = smf
-ginfoFlag2         = smf
-gnFrames           = smf
-
-[NOTE: for stacks, dvo only needs to determine the 
-       primary measurement (and modified zero point?).
+gra                = dvo = measure.ra
+gdec               = dvo = average.dec
+graErr             = dvo = measure.dX * pltscale
+gdecErr            = dvo = measure.dY * pltscale (circularly sym)
+gPSFMag      	   = dvo = measure.Mpsf
+gPSFMagErr   	   = dvo = measure.dMpsf
+gApMag       	   = dvo = measure.Map
+gApMagErr    	   = dvo = measure.dMap
+gKronMag     	   = dvo = measure.Mkron
+gKronMagErr  	   = dvo = measure.dMkron
+gsky               = smf : SKY / exptime
+gskyErr            = smf : SKY_SIGMA / exptime
+ginfoFlag          = smf : FLAGS
+ginfoFlag2         = smf + dvo : FLAGS2 | secfilt.flags << 13 *** CHECK THIS
+gnFrames           = smf : N_FRAMES
Index: /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/MetaData_Tables/StackMeta
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/MetaData_Tables/StackMeta	(revision 37176)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/MetaData_Tables/StackMeta	(revision 37177)
@@ -7,5 +7,5 @@
 photoCalID  dimensionless   INT 4 NA photometry code
 magSat      dimensionless   REAL 4 -999 saturation magnitude level
-analVer     dimensionless   SMALLINT 2 -999 analysis version index
+analysisVer dimensionless   SMALLINT 2 -999 analysis version index x
 expTime     seconds         REAL 4 -999 exposure time
 nP2Images   dimensionless   SMALLINT 2 -999 number of P2 images contributing to this cell 
@@ -14,5 +14,5 @@
 photoScat   dimensionless   REAL 4 -999 photometric scatter for chip
 nAstroRef   dimensionless   INT 4 -999 number of astrometric reference sources
-nPhoRef     dimensionless   INT 4 -999 number of photometric reference sources
+nPhotomRef  dimensionless   INT 4 -999 number of photometric reference sources
 psfModelID  dimensionless   VARCHAR(MAX) 8000 PSF model identifier
 psfFwhm_mean arcsec         FLOAT 8 -999 mean PSF FWHM in the stack
Index: /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/MetaData_Tables/StackMeta.txt
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/MetaData_Tables/StackMeta.txt	(revision 37176)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/pspsschema/SchemaNew18.0/PSPS_TABLES/MetaData_Tables/StackMeta.txt	(revision 37177)
@@ -1,35 +1,35 @@
-stackMetaID   | 
-batchID       | 
-surveyID      | 
-filterID      | 
-stackTypeID   | 
-skyCellID     | 
-photoCalID    | 
-magSat        | *
-analVer       | *
-expTime       | 
-nP2Images     | [populateStackToImage]
-completMag    | *
-astroScat     | *
-photoScat     | *
-nAstroRef     | *
-nPhoRef       | *
-psfModelID    | 
-psfFwhm_mean  | 
-psfFwhm_max   | 
-photoZero     | 
-photoColor    | *
-ctype1        | 
-ctype2        | 
-crval1        | 
-crval2        | 
-crpix1        | 
-crpix2        | 
-cdelt1        | 
-cdelt2        | 
-pc001001      | 
-pc001002      | 
-pc002001      | 
-pc002002      | 
-calibModNum   | *
-dataRelease   | 
+stackMetaID   | ipptopsps : gpc1 db, matches cmf IMAGEID
+batchID       | ipptopsps : internal
+surveyID      | ipptopsps : internal, from survey name
+filterID      | ipptopsps : internal, lookup from filter (griz)
+stackTypeID   | ipptopsps : internal, *** hard-wired name ***
+skyCellID     | *** we need to decide how we should store this.  
+photoCalID    | dvo.images : photcode
+magSat        | * NOT SET
+analysisVer   | gpc1.stackRun.software_ver [EAM: changed this name]
+expTime       | cmf header EXPTIME
+nP2Images     | [populateStackToImage] : counts inputs NOTE is this set reasonable?
+completMag    | * NOT SET
+astroScat     | * NOT SET
+photoScat     | * NOT SET
+nAstroRef     | * NOT SET
+nPhotomRef    | * NOT SET
+psfModelID    | cmf header PSFMODEL
+psfFwhm_mean  | cmf header FWHM_MAJ *** probably wrong value
+psfFwhm_max   | cmf header FW_MJ_UW *** name and definition are inconsistent
+photoZero     | cmf header FPA.ZP *** this is not dvo corrected)
+photoColor    | * NOT SET
+ctype1        | cmf header 
+ctype2        | cmf header 
+crval1        | cmf header 
+crval2        | cmf header 
+crpix1        | cmf header 
+crpix2        | cmf header 
+cdelt1        | cmf header 
+cdelt2        | cmf header 
+pc001001      | cmf header 
+pc001002      | cmf header 
+pc002001      | cmf header 
+pc002002      | cmf header 
+calibModNum   | * NOT SET
+dataRelease   | ipptopsps : user input (skychunk.dataRelease)
