Index: /branches/eam_branches/ipp-20150112/Ohana/src/relphot/include/relphot.h
===================================================================
--- /branches/eam_branches/ipp-20150112/Ohana/src/relphot/include/relphot.h	(revision 37956)
+++ /branches/eam_branches/ipp-20150112/Ohana/src/relphot/include/relphot.h	(revision 37957)
@@ -50,4 +50,5 @@
   Coords coords;
   int Nx;
+  int Ny;
 } SynthZeroPoints;
 
Index: /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/args.c
===================================================================
--- /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/args.c	(revision 37956)
+++ /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/args.c	(revision 37957)
@@ -367,7 +367,8 @@
   }
   SYNTH_ZERO_POINTS = NULL;
-  if ((N = get_argument (argc, argv, "-synphot"))) {
+  if ((N = get_argument (argc, argv, "-synthphot_means"))) {
     mode = SYNTH_PHOT;
     remove_argument (N, &argc, argv);
+    myAssert (N < argc, "missing argument to -synthphot_means");
     SYNTH_ZERO_POINTS = strcreate (argv[N]);
     remove_argument (N, &argc, argv);
@@ -399,4 +400,5 @@
 
   switch (mode) {
+    case SYNTH_PHOT:
     case UPDATE_AVERAGES:
       if (argc != 1) relphot_usage();
@@ -475,5 +477,5 @@
   }
   SYNTH_ZERO_POINTS = NULL;
-  if ((N = get_argument (argc, argv, "-synphot"))) {
+  if ((N = get_argument (argc, argv, "-synthphot_means"))) {
     MODE = MODE_SYNTH_PHOT;
     remove_argument (N, &argc, argv);
@@ -646,4 +648,5 @@
   }
 
+  if ((MODE == MODE_SYNTH_PHOT)  && (argc == 1)) return TRUE;
   if ((MODE == MODE_UPDATE_OBJECTS)  && (argc == 1)) return TRUE;
   if (argc != 2) relphot_client_usage ();
Index: /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/help.c
===================================================================
--- /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/help.c	(revision 37956)
+++ /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/help.c	(revision 37957)
@@ -5,4 +5,5 @@
   fprintf (stderr, "       or:    relphot -averages\n");
   fprintf (stderr, "       or:    relphot -apply-offsets\n");
+  fprintf (stderr, "       or:    relphot -synthphot_means\n");
   fprintf (stderr, "       or:    relphot (photcodes) -parallel-regions -region-hosts (RegionFile)\n");
   fprintf (stderr, "       or:    relphot (photcodes) -parallel-images (ImageTable) -region-hosts (RegionFile)\n\n");
Index: /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/initialize.c
===================================================================
--- /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/initialize.c	(revision 37956)
+++ /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/initialize.c	(revision 37957)
@@ -97,4 +97,6 @@
   args_client (argc, argv);
 
+  if (MODE == MODE_SYNTH_PHOT) return;
+
   if (MODE == MODE_UPDATE_OBJECTS) {
     char tmpline1[256];
Index: /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/relphot_synthphot.c
===================================================================
--- /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/relphot_synthphot.c	(revision 37956)
+++ /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/relphot_synthphot.c	(revision 37957)
@@ -91,4 +91,11 @@
   }    
 
+  // ensure that the path for the zero point is absolute
+  { 
+    char *tmppath = abspath (SYNTH_ZERO_POINTS, DVO_MAX_PATH);
+    free (SYNTH_ZERO_POINTS);
+    SYNTH_ZERO_POINTS = tmppath;
+  }
+
   int i;
   for (i = 0; i < table->Nhosts; i++) {
@@ -99,9 +106,9 @@
     table->hosts[i].pathname = tmppath;
 
-    // options / arguments that can affect relphot_client -synthphot:
+    // options / arguments that can affect relphot_client -synthphot_means:
     // VERBOSE, VERBOSE2
 
     char command[1024];
-    snprintf (command, 1024, "relphot_client -synthphot %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 
+    snprintf (command, 1024, "relphot_client -synthphot_means %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 
 	      SYNTH_ZERO_POINTS, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
Index: /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/relphot_synthphot_catalog.c
===================================================================
--- /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/relphot_synthphot_catalog.c	(revision 37956)
+++ /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/relphot_synthphot_catalog.c	(revision 37957)
@@ -50,5 +50,10 @@
   // need to look up the (X,Y) coords from this (R,D) location
   double X, Y;
-  RD_to_XY (&X, &Y, average->R, average->D, &zpts->coords);
+  double R = ohana_normalize_angle_to_midpoint (average->R, 0.0);
+  RD_to_XY (&X, &Y, R, average->D, &zpts->coords);
+  if (X < 0) return FALSE;
+  if (Y < 0) return FALSE;
+  if (X >= zpts->Nx) return FALSE;
+  if (Y >= zpts->Ny) return FALSE;
 
   int Xpix = X;
Index: /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/synthetic_zpts.c
===================================================================
--- /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/synthetic_zpts.c	(revision 37956)
+++ /branches/eam_branches/ipp-20150112/Ohana/src/relphot/src/synthetic_zpts.c	(revision 37957)
@@ -47,4 +47,5 @@
   GetCoords (&zpts->coords, &zpts->PHU);
   zpts->Nx = zpts->matrix[0].Naxis[0];
+  zpts->Ny = zpts->matrix[0].Naxis[1];
 
   return zpts;
