Index: /branches/eam_branches/ipp-20120905/Ohana/src/libautocode/def/secfilt-ps1-v4.d
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libautocode/def/secfilt-ps1-v4.d	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libautocode/def/secfilt-ps1-v4.d	(revision 34616)
@@ -6,21 +6,20 @@
 
 # elements of data structure / FITS table
-FIELD  M,     	    MAG,      	   float,      average mag in this band,              mags
-FIELD  Map,    	    MAG_AP,    	   float,      ave aperture mag in this band,         mags
-FIELD  Mkron,  	    MAG_KRON,  	   float,      ave kron mag in this band,             mags
-FIELD  dMkron, 	    MAG_KRON_ERR,  float,      formal error on average kron mag,      mags
-FIELD  dM,    	    MAG_ERR,  	   float,      formal error on average mag,           mags
-FIELD  Xm,    	    MAG_CHI,  	   float,      chisq on average mag,                  [100*log(value)]
-FIELD  FluxPSF,     FLUX_PSF,      float,      mean flux psf fit (PS1: stack)
-FIELD  dFluxPSF,    FLUX_PSF_ERR,  float,      mean flux psf error
-FIELD  FluxKron,    FLUX_KRON,     float,      mean flux kron ap (PS1: stack)
-FIELD  dFluxKron,   FLUX_KRON_ERR, float,      mean flux kron err
-FIELD  flags, 	    FLAGS,    	   uint32_t,   photometry flags
-FIELD  Ncode, 	    NCODE,    	   short,      number of detections in band
-FIELD  Nused, 	    NUSED,    	   short,      number of detections used in average
-FIELD  M_20,  	    MAG_20,   	   short,      lower 20percent mag,                   millimags
-FIELD  M_80,  	    MAG_80,   	   short,      upper 20percent mag,                   millimags
-FIELD  ubercalDist, UBERCAL_DIST,  short,      number of images from an ubercal-image
-FIELD  Mstdev,      MAG_STDEV,     short,      standard deviation of measurements,    millimags
-FIELD  stackID,     STACK_ID,      uint32_t,   image ID of stack used for fluxes (if any)
-FIELD  dummy,       DUMMY,         uint32_t,   padding
+FIELD  M,             MAG,             float,      average mag in this band,              mags
+FIELD  Map,           MAG_AP,          float,      ave aperture mag in this band,         mags
+FIELD  Mkron,         MAG_KRON,        float,      ave kron mag in this band,             mags
+FIELD  dMkron,        MAG_KRON_ERR,    float,      formal error on average kron mag,      mags
+FIELD  dM,            MAG_ERR,         float,      formal error on average mag,           mags
+FIELD  Xm,            MAG_CHI,         float,      chisq on average mag,                  [100*log(value)]
+FIELD  FluxPSF,       FLUX_PSF,        float,      mean flux psf fit (PS1: stack)
+FIELD  dFluxPSF,      FLUX_PSF_ERR,    float,      mean flux psf error
+FIELD  FluxKron,      FLUX_KRON,       float,      mean flux kron ap (PS1: stack)
+FIELD  dFluxKron,     FLUX_KRON_ERR,   float,      mean flux kron err
+FIELD  flags,         FLAGS,           uint32_t,   photometry flags
+FIELD  Ncode,         NCODE,           short,      number of detections in band
+FIELD  Nused,         NUSED,           short,      number of detections used in average
+FIELD  M_20,          MAG_20,          short,      lower 20percent mag,                   millimags
+FIELD  M_80,          MAG_80,          short,      upper 20percent mag,                   millimags
+FIELD  ubercalDist,   UBERCAL_DIST,    short,      number of images from an ubercal-image
+FIELD  Mstdev,        MAG_STDEV,       short,      standard deviation of measurements,    millimags
+FIELD  stackDetectID, STACK_DETECT_ID, uint64_t,   detection ID on stack used for fluxes (if any)
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libautocode/def/secfilt.d
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libautocode/def/secfilt.d	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libautocode/def/secfilt.d	(revision 34616)
@@ -6,23 +6,22 @@
 
 # elements of data structure / FITS table
-FIELD  M,     	    MAG,      	   float,      average mag in this band,              mags
-FIELD  Map,    	    MAG,      	   float,      average mag in this band,              mags
-FIELD  Mkron,  	    MAG_KRON,  	   float,      ave kron mag in this band,             mags
-FIELD  dMkron, 	    MAG_KRON_ERR,  float,      formal error on average kron mag,      mags
-FIELD  dM,    	    MAG_ERR,  	   float,      formal error on average mag,           mags
-FIELD  Xm,    	    MAG_CHI,  	   float,      chisq on average mag,                  [100*log(value)]
-FIELD  FluxPSF,     FLUX_PSF,      float,      mean flux psf fit (PS1: stack)
-FIELD  dFluxPSF,    FLUX_PSF_ERR,  float,      mean flux psf error
-FIELD  FluxKron,    FLUX_KRON,     float,      mean flux kron ap (PS1: stack)
-FIELD  dFluxKron,   FLUX_KRON_ERR, float,      mean flux kron err
-FIELD  flags, 	    FLAGS,    	   uint32_t,   photometry flags
-FIELD  Ncode, 	    NCODE,    	   short,      number of detections in band
-FIELD  Nused, 	    NUSED,    	   short,      number of detections used in average
-FIELD  M_20,  	    MAG_20,   	   short,      lower 20percent mag,                   millimags
-FIELD  M_80,  	    MAG_80,   	   short,      upper 20percent mag,                   millimags
-FIELD  ubercalDist, UBERCAL_DIST,  short,      number of images from an ubercal-image
-FIELD  Mstdev,      MAG_STDEV,     short,      standard deviation of measurements,    millimags
-FIELD  stackID,     STACK_ID,      uint32_t,   image ID of stack used for fluxes (if any)
-FIELD  dummy,       DUMMY,         uint32_t,   padding
+FIELD  M,             MAG,             float,      average mag in this band,              mags
+FIELD  Map,           MAG,             float,      average mag in this band,              mags
+FIELD  Mkron,         MAG_KRON,        float,      ave kron mag in this band,             mags
+FIELD  dMkron,        MAG_KRON_ERR,    float,      formal error on average kron mag,      mags
+FIELD  dM,            MAG_ERR,         float,      formal error on average mag,           mags
+FIELD  Xm,            MAG_CHI,         float,      chisq on average mag,                  [100*log(value)]
+FIELD  FluxPSF,       FLUX_PSF,        float,      mean flux psf fit (PS1: stack)
+FIELD  dFluxPSF,      FLUX_PSF_ERR,    float,      mean flux psf error
+FIELD  FluxKron,      FLUX_KRON,       float,      mean flux kron ap (PS1: stack)
+FIELD  dFluxKron,     FLUX_KRON_ERR,   float,      mean flux kron err
+FIELD  flags,         FLAGS,           uint32_t,   photometry flags
+FIELD  Ncode,         NCODE,           short,      number of detections in band
+FIELD  Nused,         NUSED,           short,      number of detections used in average
+FIELD  M_20,          MAG_20,          short,      lower 20percent mag,                   millimags
+FIELD  M_80,          MAG_80,          short,      upper 20percent mag,                   millimags
+FIELD  ubercalDist,   UBERCAL_DIST,    short,      number of images from an ubercal-image
+FIELD  Mstdev,        MAG_STDEV,       short,      standard deviation of measurements,    millimags
+FIELD  stackDetectID, STACK_DETECT_ID, uint64_t,   detection ID on stack used for fluxes (if any)
 
 # *** 20090206 : new fields : M_20, M_80; dropped dummy
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/include/dvodb.h
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/include/dvodb.h	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/include/dvodb.h	(revision 34616)
@@ -45,5 +45,5 @@
       MAG_80, 
       MAG_UC_DIST, 
-      MAG_STACK_ID, 
+      MAG_STACK_DET_ID, 
       MAG_FLUX_PSF,
       MAG_FLUX_PSF_ERR,
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/LoadPhotcodesFITS.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/LoadPhotcodesFITS.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/LoadPhotcodesFITS.c	(revision 34616)
@@ -16,5 +16,5 @@
   /* XXX choose more sensible lock timeouts! */
   db.lockstate = LCK_SOFT;
-  db.timeout   = 10.0;
+  db.timeout   = 60.0;
   gfits_db_init (&db);
 
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dbExtractAverages.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dbExtractAverages.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dbExtractAverages.c	(revision 34616)
@@ -242,5 +242,5 @@
 	  value.Flt = PhotUCdist (field->photcode, average, secfilt);
 	  break;
-	case MAG_STACK_ID:
+	case MAG_STACK_DET_ID:
 	  value.Int = PhotStackID (field->photcode, average, secfilt);
 	  break;
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dbFields.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dbFields.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dbFields.c	(revision 34616)
@@ -56,5 +56,5 @@
   if (!strcasecmp (string, "80"))          return (MAG_80);
   if (!strcasecmp (string, "ucdist"))      return (MAG_UC_DIST);
-  if (!strcasecmp (string, "stackID"))     return (MAG_STACK_ID);
+  if (!strcasecmp (string, "stackDetectID")) return (MAG_STACK_DET_ID);
   if (!strcasecmp (string, "fluxpsf"))     return (MAG_FLUX_PSF);
   if (!strcasecmp (string, "fluxpsferr"))  return (MAG_FLUX_PSF_ERR);
@@ -260,5 +260,5 @@
   field->magMode = mode;
   switch (mode) {
-    case MAG_STACK_ID:
+    case MAG_STACK_DET_ID:
     case MAG_NCODE:
     case MAG_NPHOT:
@@ -351,5 +351,5 @@
   field->magMode = mode;
   switch (mode) {
-    case MAG_STACK_ID:
+    case MAG_STACK_DET_ID:
     case MAG_NCODE:
     case MAG_NPHOT:
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_catalog.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_catalog.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_catalog.c	(revision 34616)
@@ -134,7 +134,5 @@
   secfilt->ubercalDist = 1000;
   secfilt->Mstdev      = NAN_S_SHORT;
-  secfilt->stackID     = 0;
-
-  secfilt->dummy       = 0;
+  secfilt->stackDetectID     = 0;
 }
 
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c	(revision 34616)
@@ -235,5 +235,5 @@
     out[i].FluxKron    = NAN;
     out[i].dFluxKron   = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
  }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c	(revision 34616)
@@ -229,5 +229,5 @@
     out[i].FluxKron    = NAN;
     out[i].dFluxKron   = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
  }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c	(revision 34616)
@@ -190,5 +190,5 @@
     out[i].FluxKron    = NAN;
     out[i].dFluxKron   = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
  }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c	(revision 34616)
@@ -233,5 +233,5 @@
     out[i].FluxKron    = NAN;
     out[i].dFluxKron   = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
  }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c	(revision 34616)
@@ -236,5 +236,5 @@
     out[i].FluxKron    = NAN;
     out[i].dFluxKron   = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
  }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c	(revision 34616)
@@ -234,5 +234,5 @@
     out[i].FluxKron    = NAN;
     out[i].dFluxKron   = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
  }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c	(revision 34616)
@@ -221,22 +221,22 @@
 
   for (i = 0; i < Nvalues; i++) {
-    out[i].M           = in[i].M;      
-    out[i].Map         = in[i].Map;      
-    out[i].Mkron       = in[i].Mkron;      
-    out[i].dMkron      = in[i].dMkron;      
-    out[i].dM          = in[i].dM;      
-    out[i].Xm          = in[i].Xm;     
-    out[i].FluxPSF     = in[i].FluxPSF;
-    out[i].dFluxPSF    = in[i].dFluxPSF;
-    out[i].FluxKron    = in[i].FluxKron;
-    out[i].dFluxKron   = in[i].dFluxKron;
-    out[i].flags       = in[i].flags;     
-    out[i].Ncode       = in[i].Ncode;
-    out[i].Nused       = in[i].Nused;
-    out[i].M_20        = in[i].M_20;      
-    out[i].M_80        = in[i].M_80;      
-    out[i].Mstdev      = in[i].Mstdev;      
-    out[i].ubercalDist = in[i].ubercalDist;      
-    out[i].stackID     = in[i].stackID;      
+    out[i].M             = in[i].M;      
+    out[i].Map           = in[i].Map;      
+    out[i].Mkron         = in[i].Mkron;      
+    out[i].dMkron        = in[i].dMkron;      
+    out[i].dM            = in[i].dM;      
+    out[i].Xm            = in[i].Xm;     
+    out[i].FluxPSF       = in[i].FluxPSF;
+    out[i].dFluxPSF      = in[i].dFluxPSF;
+    out[i].FluxKron      = in[i].FluxKron;
+    out[i].dFluxKron     = in[i].dFluxKron;
+    out[i].flags         = in[i].flags;     
+    out[i].Ncode         = in[i].Ncode;
+    out[i].Nused         = in[i].Nused;
+    out[i].M_20          = in[i].M_20;      
+    out[i].M_80          = in[i].M_80;      
+    out[i].Mstdev        = in[i].Mstdev;      
+    out[i].ubercalDist   = in[i].ubercalDist;      
+    out[i].stackDetectID = in[i].stackDetectID;      
  }
   return (out);
@@ -251,22 +251,22 @@
 
   for (i = 0; i < Nvalues; i++) {
-    out[i].M           = in[i].M;      
-    out[i].Map         = in[i].Map;      
-    out[i].Mkron       = in[i].Mkron;      
-    out[i].dMkron      = in[i].dMkron;      
-    out[i].dM          = in[i].dM;      
-    out[i].Xm          = in[i].Xm;     
-    out[i].FluxPSF     = in[i].FluxPSF;
-    out[i].dFluxPSF    = in[i].dFluxPSF;
-    out[i].FluxKron    = in[i].FluxKron;
-    out[i].dFluxKron   = in[i].dFluxKron;
-    out[i].flags       = in[i].flags;     
-    out[i].Ncode       = in[i].Ncode;
-    out[i].Nused       = in[i].Nused;
-    out[i].M_20        = in[i].M_20;      
-    out[i].M_80        = in[i].M_80;      
-    out[i].Mstdev      = in[i].Mstdev;      
-    out[i].ubercalDist = in[i].ubercalDist;      
-    out[i].stackID     = in[i].stackID;      
+    out[i].M           	 = in[i].M;      
+    out[i].Map         	 = in[i].Map;      
+    out[i].Mkron       	 = in[i].Mkron;      
+    out[i].dMkron      	 = in[i].dMkron;      
+    out[i].dM          	 = in[i].dM;      
+    out[i].Xm          	 = in[i].Xm;     
+    out[i].FluxPSF     	 = in[i].FluxPSF;
+    out[i].dFluxPSF    	 = in[i].dFluxPSF;
+    out[i].FluxKron    	 = in[i].FluxKron;
+    out[i].dFluxKron   	 = in[i].dFluxKron;
+    out[i].flags       	 = in[i].flags;     
+    out[i].Ncode       	 = in[i].Ncode;
+    out[i].Nused       	 = in[i].Nused;
+    out[i].M_20        	 = in[i].M_20;      
+    out[i].M_80        	 = in[i].M_80;      
+    out[i].Mstdev      	 = in[i].Mstdev;      
+    out[i].ubercalDist 	 = in[i].ubercalDist;      
+    out[i].stackDetectID = in[i].stackDetectID;
   }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_elixir.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_elixir.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_elixir.c	(revision 34616)
@@ -244,5 +244,5 @@
     out[i].FluxKron   = NAN;
     out[i].dFluxKron  = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
   }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_loneos.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_loneos.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_loneos.c	(revision 34616)
@@ -237,5 +237,5 @@
     out[i].FluxKron   = NAN;
     out[i].dFluxKron  = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
   }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c	(revision 34616)
@@ -244,5 +244,5 @@
     out[i].FluxKron    = NAN;
     out[i].dFluxKron   = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
  }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c	(revision 34616)
@@ -244,5 +244,5 @@
     out[i].FluxKron    = NAN;
     out[i].dFluxKron   = NAN;
-    out[i].stackID     = 0;
+    out[i].stackDetectID     = 0;
  }
   return (out);
Index: /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_photcode_ops.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_photcode_ops.c	(revision 34615)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/libdvo/src/dvo_photcode_ops.c	(revision 34616)
@@ -664,5 +664,5 @@
 
   Ns = photcodes[0].hashNsec[code[0].code];
-  ID = (Ns == -1) ? 0 : secfilt[Ns].stackID;
+  ID = (Ns == -1) ? 0 : secfilt[Ns].stackDetectID;
   return (ID);
 }
