Index: /branches/eam_branches/ipp-20120405/Ohana/src/relphot/include/relphot.h
===================================================================
--- /branches/eam_branches/ipp-20120405/Ohana/src/relphot/include/relphot.h	(revision 33886)
+++ /branches/eam_branches/ipp-20120405/Ohana/src/relphot/include/relphot.h	(revision 33887)
@@ -336,2 +336,6 @@
 int ImageSubsetSave(char *filename, ImageSubset *image, off_t Nimage);
 ImageSubset *ImageSubsetLoad(char *filename, off_t *nimage);
+
+int client_logger_init ();
+int client_logger_message (char *format,...);
+
Index: /branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/StarOps.c
===================================================================
--- /branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/StarOps.c	(revision 33886)
+++ /branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/StarOps.c	(revision 33887)
@@ -354,4 +354,8 @@
       int Next = 0;
       int haveSynth = FALSE;
+
+      int forceSynth = FALSE;
+      int forceSynthEntry = -1;
+
       int haveUbercal = FALSE;
 
@@ -425,11 +429,38 @@
 	    }
 	  }
-	  // ignore SYNTH photocdes until PASS == 4 (where we also accept saturated stars)
+
+	  // Blindly accepth the SYNTH mags if we are above saturation, otherwise, 
+	  // ignore SYNTH photcodes until PASS == 4 (where we also accept saturated stars)
 	  if ((catalog[Nc].measure[m].photcode >= 3001) && (catalog[Nc].measure[m].photcode <= 3005)) {
-	    if (pass < 4) {
-	      SKIP_THIS_MEAS(Nbad);
-	      continue;
+	    // something of a hack: force object to use synth values if synth mags >>
+	    // saturation (3pi instrumental mags < -15)
+	    float MaxMagForceSynth = NAN;
+	    switch (catalog[Nc].measure[m].photcode) {
+	      case 3001:
+		MaxMagForceSynth = 13.64;
+		break;
+	      case 3002:
+		MaxMagForceSynth = 13.76;
+		break;
+	      case 3003:
+		MaxMagForceSynth = 13.74;
+		break;
+	      case 3004:
+		MaxMagForceSynth = 12.94;
+		break;
+	      case 3005:
+		MaxMagForceSynth = 12.01;
+		break;
 	    }
-	    haveSynth = TRUE;
+	    if (catalog[Nc].measureT[m].M < MaxMagForceSynth) {
+	      forceSynth = TRUE;
+	      forceSynthEntry = N;
+	    } else {
+	      if (pass < 4) {
+		SKIP_THIS_MEAS(Nbad);
+		continue;
+	      }
+	      haveSynth = TRUE;
+	    }
 	  }
 	}
@@ -476,4 +507,12 @@
       }	
 
+      if (forceSynth) {
+	// use the single SYNTH value instead of the other mags here
+	myAssert ((forceSynthEntry < N) && (forceSynthEntry >= 0), "programming error");
+	list[0]  = list[forceSynthEntry];
+	dlist[0] = dlist[forceSynthEntry];
+	wlist[0] = wlist[forceSynthEntry];
+	N = 1;
+      }
       liststats (list, dlist, wlist, N, &stats);
 
Index: /branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/relphot_client.c
===================================================================
--- /branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/relphot_client.c	(revision 33886)
+++ /branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/relphot_client.c	(revision 33887)
@@ -19,4 +19,5 @@
   // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, etc) 
   initialize_client (argc, argv);
+  client_logger_init ();
 
   // load the current sky table (layout of all SkyRegions) 
@@ -33,4 +34,5 @@
       exit (2);
   }
+  client_logger_message ("loaded sky table and defined patch\n");
   
   switch (MODE) {
@@ -42,9 +44,14 @@
 	  exit (2);
       }
+      client_logger_message ("loaded catalogs\n");
+
       BrightCatalog *bcatalog = BrightCatalogMerge (catalog, Ncatalog);
+      client_logger_message ("generated subset data\n");
+
       if (!BrightCatalogSave (BCATALOG, bcatalog)) {
 	  fprintf (stderr, "ERROR saving bright catalog from %s\n", CATDIR);
 	  exit (2);
       }
+      client_logger_message ("generated subset table\n");
       break;
     }
@@ -58,4 +65,5 @@
 	  exit (2);
       }
+      client_logger_message ("loaded image subset data\n");
       
       // save the available image information in the static array in ImageOps.c
@@ -66,6 +74,8 @@
       snprintf (flatcorrFile, 1024, "%s/flatcorr.fits", CATDIR);
       FlatCorrectionTable *flatcorr = FlatCorrectionLoad (flatcorrFile, VERBOSE);
+      client_logger_message ("loaded flat-field correction data\n");
 
       reload_catalogs (skylist, flatcorr, HOST_ID, HOSTDIR);
+      client_logger_message ("updated catalogs\n");
       break;
     }
@@ -73,4 +83,5 @@
     case MODE_UPDATE_OBJECTS: {
       relphot_objects (HOST_ID, HOSTDIR);
+      client_logger_message ("updated objects\n");
       break;
     }
@@ -80,5 +91,40 @@
       abort();
   }
+  client_logger_message ("done with relphot_client\n");
 
   exit (0);
 }
+
+// I'm getting unlogged errors and failures.  I need a log ouput that the clients can
+// write independent of the master
+
+static FILE *logfile = NULL;
+int client_logger_init () {
+
+  char filename[DVO_MAX_PATH];
+
+  snprintf (filename, DVO_MAX_PATH, "%s/relphot.client.XXXXXX.log", HOSTDIR);
+    
+  int fd = mkstemp (filename);
+  if (fd == -1) {
+    fprintf (stderr, "failed to open client logger, exiting\n");
+    exit (50);
+  }
+
+  logfile = fdopen (fd, "w");
+  if (!logfile)  {
+    fprintf (stderr, "failed to fdopen client logger, exiting\n");
+    exit (51);
+  }
+  return TRUE;
+}
+
+int client_logger_message (char *format,...) {
+
+  va_list argp;
+
+  va_start (argp, format);
+  vfprintf (logfile, format, argp);
+  va_end (argp);
+  return TRUE;
+}
