Index: /trunk/Ohana/src/relphot/src/GridOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/GridOps.c	(revision 39631)
+++ /trunk/Ohana/src/relphot/src/GridOps.c	(revision 39632)
@@ -531,5 +531,5 @@
 
   StatType stats;
-  liststats_setmode (&stats, STATMODE);
+  liststats_setmode (&stats, "INNER_WTMEAN");
   
   if (!USE_GRID) return;
Index: /trunk/Ohana/src/relphot/src/ImageOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/ImageOps.c	(revision 39631)
+++ /trunk/Ohana/src/relphot/src/ImageOps.c	(revision 39632)
@@ -620,5 +620,4 @@
   StatType stats;
   liststats_setmode (&stats, "INNER_WTMEAN");
-  // liststats_setmode (&stats, STATMODE);
 
   // FREEZE_IMAGES only applies to mosaic data (eg, gpc1)
Index: /trunk/Ohana/src/relphot/src/MosaicOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/MosaicOps.c	(revision 39631)
+++ /trunk/Ohana/src/relphot/src/MosaicOps.c	(revision 39632)
@@ -1055,5 +1055,4 @@
 
   StatType stats;
-  // liststats_setmode (&stats, STATMODE);
   liststats_setmode (&stats, "INNER_WTMEAN");
 
Index: /trunk/Ohana/src/relphot/src/relphot_objects.c
===================================================================
--- /trunk/Ohana/src/relphot/src/relphot_objects.c	(revision 39631)
+++ /trunk/Ohana/src/relphot/src/relphot_objects.c	(revision 39632)
@@ -228,6 +228,13 @@
 
     char *command = NULL;
-    strextend (&command, "relphot_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f", 
-	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
+    strextend (&command, "relphot_client -update-objects");
+    strextend (&command, "-hostID %d", table->hosts[i].hostID);
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-hostdir %s", table->hosts[i].pathname);
+    strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
+    strextend (&command, "-statmode %s", STATMODE);
+    strextend (&command, "-D CAMERA %s", CAMERA);
+    strextend (&command, "-D STAR_TOOFEW %d", STAR_TOOFEW);
+    strextend (&command, "-minerror %f", MIN_ERROR);
 
     if (VERBOSE)       	   { strextend (&command, "-v"); }
Index: /trunk/Ohana/src/relphot/src/setMrelCatalog.c
===================================================================
--- /trunk/Ohana/src/relphot/src/setMrelCatalog.c	(revision 39631)
+++ /trunk/Ohana/src/relphot/src/setMrelCatalog.c	(revision 39632)
@@ -56,4 +56,5 @@
   off_t j;
 
+  // the same STATMODE is used for chip and warp averages
   liststats_setmode (&results->psfstats,  STATMODE);
   liststats_setmode (&results->apstats,   STATMODE);
@@ -966,4 +967,27 @@
 }
 
+# if (0)
+int magStatsByRankingIRLS (StatDataSet *dataset, StatType *stats) {
+
+  liststats_init (stats);
+
+  if (dataset->Nlist == 0) return 0;
+
+  // we have a list of measurements for this Nsec value, along with errors, weights, and their rank
+  // first, sort by the rank (increasing)
+  sort_StatDataSet (dataset);
+
+  // find the values with the same minimum rank:
+  int Nranking = 0;
+  int minRank = dataset->ranking[0]; // MIN (5, result->psfData[Nsec].ranking[0]);  -- only allow rank 5 or <
+
+  int i;
+  for (i = 0; (i < dataset->Nlist) && (dataset->ranking[i] == minRank); i++, Nranking++);
+
+  liststats (dataset->flxlist, dataset->errlist, dataset->wgtlist, Nranking, stats);
+  return (Nranking);
+}
+# endif
+
 // outlier warp measurements are driving bad mean values.  
 int magStatsByRankingClipped (StatDataSet *dataset, StatType *stats) {
Index: /trunk/Ohana/src/relphot/src/setMrelFinal.c
===================================================================
--- /trunk/Ohana/src/relphot/src/setMrelFinal.c	(revision 39631)
+++ /trunk/Ohana/src/relphot/src/setMrelFinal.c	(revision 39632)
@@ -100,5 +100,6 @@
 
   // XXX make this optional? (do not clean for -averages?)
-  if (!simpleAverage) clean_measures (catalog, 1, TRUE, flatcorr);    /* mark outliers ID_MEAS_POOR_PHOTOM */
+  // XXX : for the moment, disable clean_measures
+  if (!simpleAverage && FALSE) clean_measures (catalog, 1, TRUE, flatcorr);    /* mark outliers ID_MEAS_POOR_PHOTOM */
 
   ALLOCATE (catalog[0].measureRank, char, catalog[0].Nmeasure);
