Index: trunk/Ohana/src/libdvo/include/dvo.h
===================================================================
--- trunk/Ohana/src/libdvo/include/dvo.h	(revision 38441)
+++ trunk/Ohana/src/libdvo/include/dvo.h	(revision 38462)
@@ -72,4 +72,12 @@
 } DVO_INT_NAN;
 
+// init all data, or just catalog data
+typedef enum {
+  SECFILT_RESET_CHIP  = 0x01,
+  SECFILT_RESET_WARP  = 0x02,
+  SECFILT_RESET_STACK = 0x04,
+  SECFILT_RESET_ALL   = 0x07,
+} SecFiltInitMode;
+  
 // max path length
 # define DVO_MAX_PATH 1024
@@ -126,4 +134,7 @@
   ID_MEAS_ICRF_QSO       = 0x00040000,  // this measurement is an ICRF reference position
   ID_MEAS_IMAGE_EPOCH    = 0x00080000,  // this measurement is registered to the image epoch (not tied to ref catalog epoch)
+  ID_MEAS_PHOTOM_PSF     = 0x00100000,  // this measurement is used for the mean psf mag
+  ID_MEAS_PHOTOM_APER    = 0x00200000,  // this measurement is used for the mean ap mag
+  ID_MEAS_PHOTOM_KRON    = 0x00400000,  // this measurement is used for the mean kron mag
 } DVOMeasureFlags;
 
@@ -188,12 +199,17 @@
   ID_SECF_HAS_PS1     	= 0x00000010, // PS1 photometry used in average measurement
   ID_SECF_HAS_STACK   	= 0x00000020, // PS1 stack photometry exists
-  ID_PHOTOM_PASS_0    	= 0x00000100, // average magnitude calculated in 0th pass
-  ID_PHOTOM_PASS_1    	= 0x00000200, // average magnitude calculated in 1th pass
-  ID_PHOTOM_PASS_2    	= 0x00000400, // average magnitude calculated in 2th pass
-  ID_PHOTOM_PASS_3    	= 0x00000800, // average magnitude calculated in 3th pass
-  ID_PHOTOM_PASS_4    	= 0x00001000, // average magnitude calculated in 4th pass
-  ID_PSPS_OBJ_EXT     	= 0x00002000, // In PSPS ID_SECF_OBJ_EXT is moved here so it fits within 16 bits
+  ID_SECF_HAS_TYCHO   	= 0x00000040, // Tycho photometry used for synth mags
+  ID_SECF_FIX_SYNTH   	= 0x00000080, // synth mags repaired with zpt map
+  ID_SECF_RANK_0    	= 0x00000100, // average magnitude uses rank 0 values
+  ID_SECF_RANK_1    	= 0x00000200, // average magnitude uses rank 1 values
+  ID_SECF_RANK_2    	= 0x00000400, // average magnitude uses rank 2 values
+  ID_SECF_RANK_3    	= 0x00000800, // average magnitude uses rank 3 values
+  ID_SECF_RANK_4    	= 0x00001000, // average magnitude uses rank 4 values
+  ID_SECF_OBJ_EXT_PSPS  = 0x00002000, // In PSPS ID_SECF_OBJ_EXT is moved here so it fits within 16 bits
   ID_SECF_STACK_PRIMARY = 0x00004000, // PS1 stack photometry comes from primary skycell
   ID_SECF_OBJ_EXT       = 0x01000000, // extended in this band
+
+  ID_SECF_CHIP_FLAGS    = 0x01003f1f, // all chip-related bits (used to reset the correct bits only)
+  ID_SECF_STACK_FLAGS   = 0x00004020, // all stack-related bits (
 } DVOSecfiltFlags;
 
@@ -800,4 +816,6 @@
   off_t *found_t;
   off_t *foundWarp_t;
+
+  char *measureRank;
 //  off_t *image_t;
 //  off_t *mosaic_t;
@@ -1123,5 +1141,5 @@
 void dvo_average_init (Average *average);
 void dvo_averageT_init (AverageTiny *average);
-void dvo_secfilt_init (SecFilt *secfilt);
+void dvo_secfilt_init (SecFilt *secfilt, SecFiltInitMode mode);
 void dvo_measure_init (Measure *measure);
 void dvo_measureT_init (MeasureTiny *measure);
