Index: /branches/eam_branches/ohana.20150429/src/relphot/include/relphot.h
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/include/relphot.h	(revision 38378)
+++ /branches/eam_branches/ohana.20150429/src/relphot/include/relphot.h	(revision 38379)
@@ -213,5 +213,5 @@
 char        *BOUNDARY_TREE;
 
-int SET_MREL_VERSION;
+// XXX deprecate int SET_MREL_VERSION;
 int IS_DIFF_DB;
 
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/StarOps.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/StarOps.c	(revision 38378)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/StarOps.c	(revision 38379)
@@ -128,16 +128,5 @@
 
   for (i = 0; i < Ncatalog; i++) {
-    // pass == -1 for anything other than the final pass
-    switch (SET_MREL_VERSION) {
-      case 0:
-	setMrel_catalog (catalog, i, -1, flatcorr, &results, Nsecfilt);
-	break;
-      case 1:
-	setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt);
-	break;
-      default:
-	fprintf (stderr, "invalid setMrel version %d (use 0 or 1)\n", SET_MREL_VERSION);
-	exit (2);
-    }
+    setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt);
     SetMrelInfoAccum (&summary, &results);
   }
@@ -175,15 +164,5 @@
 
   for (i = 0; i < Ncatalog; i++) {
-    switch (SET_MREL_VERSION) {
-      // case 0:
-      // setMrel_catalog (catalog, i, pass, flatcorr, &results, Nsecfilt);
-      // break;
-      case 1:
-	setMrel_catalog_alt (catalog, i, pass, flatcorr, &results, Nsecfilt);
-	break;
-      default:
-	fprintf (stderr, "invalid setMrel version %d (use 1)\n", SET_MREL_VERSION);
-	exit (2);
-    }
+    setMrel_catalog_alt (catalog, i, pass, flatcorr, &results, Nsecfilt);
     SetMrelInfoAccum (&summary, &results);
   }
@@ -293,15 +272,5 @@
 
     // pass == -1 for anything other than the final pass
-    switch (SET_MREL_VERSION) {
-      case 0:
-	setMrel_catalog (catalog, i, -1, flatcorr, &results, Nsecfilt);
-	break;
-      case 1:
-	setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt);
-	break;
-      default:
-	fprintf (stderr, "invalid setMrel version %d (use 0 or 1)\n", SET_MREL_VERSION);
-	exit (2);
-    }
+    setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt);
     SetMrelInfoAccum (&threadinfo->summary, &results);
   }
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/args.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/args.c	(revision 38378)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/args.c	(revision 38379)
@@ -76,11 +76,4 @@
   }
 
-  SET_MREL_VERSION = 1;
-  if ((N = get_argument (argc, argv, "-set-mrel-version"))) {
-    remove_argument (N, &argc, argv);
-    SET_MREL_VERSION = atof(argv[N]);
-    remove_argument (N, &argc, argv);
-  }
-
   VERBOSE = VERBOSE2 = FALSE;
   if ((N = get_argument (argc, argv, "-v"))) {
@@ -529,11 +522,4 @@
   }
 
-  SET_MREL_VERSION = 1;
-  if ((N = get_argument (argc, argv, "-set-mrel-version"))) {
-    remove_argument (N, &argc, argv);
-    SET_MREL_VERSION = atof(argv[N]);
-    remove_argument (N, &argc, argv);
-  }
-
   VERBOSE = VERBOSE2 = FALSE;
   if ((N = get_argument (argc, argv, "-v"))) {
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/launch_region_hosts.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/launch_region_hosts.c	(revision 38378)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/launch_region_hosts.c	(revision 38379)
@@ -41,37 +41,37 @@
     ImageTableSave (filename, host->image, host->Nimage);
 
-    char command[1024];
-    snprintf (command, 1024, "relphot %s", PhotcodeList);
-    strextend (command, "-parallel-images %s", filename);
-    strextend (command, "-region-hosts %s", REGION_FILE);
-    strextend (command, "-region-hostID %d", host->hostID);
-    strextend (command, "-D CATDIR %s", CATDIR);
-    strextend (command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat);
-    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);
-    strextend (command, "-cloud-limit %f", CLOUD_TOLERANCE);
+    char *command = NULL;
+    strextend (&command, "relphot %s", PhotcodeList);
+    strextend (&command, "-parallel-images %s", filename);
+    strextend (&command, "-region-hosts %s", REGION_FILE);
+    strextend (&command, "-region-hostID %d", host->hostID);
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat);
+    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);
+    strextend (&command, "-cloud-limit %f", CLOUD_TOLERANCE);
 
-    if (VERBOSE)       	     strextend (command, "-v");
-    if (VERBOSE2)      	     strextend (command, "-vv");
-    if (RESET)         	     strextend (command, "-reset");
-    if (RESET_ZEROPTS) 	     strextend (command, "-reset-zpts");
-    if (!KEEP_UBERCAL) 	     strextend (command, "-reset-ubercal");
-    if (DophotSelect)  	     strextend (command, "-dophot %d", DophotValue);
-    if (ImagSelect)    	     strextend (command, "-instmag %f %f", ImagMin, ImagMax);
-    if (MaxDensityUse) 	     strextend (command, "-max-density %f", MaxDensityValue);
-    if (SyntheticPhotometry) strextend (command, "-synthphot");
+    if (VERBOSE)       	     strextend (&command, "-v");
+    if (VERBOSE2)      	     strextend (&command, "-vv");
+    if (RESET)         	     strextend (&command, "-reset");
+    if (RESET_ZEROPTS) 	     strextend (&command, "-reset-zpts");
+    if (!KEEP_UBERCAL) 	     strextend (&command, "-reset-ubercal");
+    if (DophotSelect)  	     strextend (&command, "-dophot %d", DophotValue);
+    if (ImagSelect)    	     strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
+    if (MaxDensityUse) 	     strextend (&command, "-max-density %f", MaxDensityValue);
+    if (SyntheticPhotometry) strextend (&command, "-synthphot");
 
-    if (UPDATE)        	     strextend (command, "-update");
-    if (MOSAIC_ZEROPT) 	     strextend (command, "-mosaic");
-    if (FREEZE_IMAGES) 	     strextend (command, "-imfreeze");
-    if (FREEZE_MOSAICS)	     strextend (command, "-mosfreeze");
-    if (PARALLEL)      	     strextend (command, "-parallel");
-    if (PARALLEL_MANUAL)     strextend (command, "-parallel-manual");
-    if (PARALLEL_SERIAL)     strextend (command, "-parallel-serial");
+    if (UPDATE)        	     strextend (&command, "-update");
+    if (MOSAIC_ZEROPT) 	     strextend (&command, "-mosaic");
+    if (FREEZE_IMAGES) 	     strextend (&command, "-imfreeze");
+    if (FREEZE_MOSAICS)	     strextend (&command, "-mosfreeze");
+    if (PARALLEL)      	     strextend (&command, "-parallel");
+    if (PARALLEL_MANUAL)     strextend (&command, "-parallel-manual");
+    if (PARALLEL_SERIAL)     strextend (&command, "-parallel-serial");
 
     // XXX deprecate this if we are happy with the new version
-    if (SET_MREL_VERSION != 1) strextend (command, "-set-mrel-version %d", SET_MREL_VERSION);
+    // if (SET_MREL_VERSION != 1) strextend (command, "-set-mrel-version %d", SET_MREL_VERSION);
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/load_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/load_catalogs.c	(revision 38378)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/load_catalogs.c	(revision 38379)
@@ -34,4 +34,5 @@
     // XXX keep in mind that not all catalogs are loaded
     dvo_catalog_init (&catalog[i], TRUE);
+    dvo_catalog_init (&tcatalog, TRUE);
 
     // does this host ID match the desired location for the table?
@@ -42,9 +43,10 @@
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
     tcatalog.filename    = hostID ? hostfile : skylist[0].filename[i];
-    tcatalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    tcatalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    tcatalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     tcatalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;    // don't need to load all data at this point
     tcatalog.Nsecfilt    = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
+
+    // tcatalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
+    // tcatalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
+    // tcatalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
 
     if (!dvo_catalog_open (&tcatalog, skylist[0].regions[i], VERBOSE2, "r")) {
@@ -153,26 +155,24 @@
     // MaxDensityUse, MaxDensityValue
 
-    char command[1024];
-    snprintf (command, 1024, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D CAMERA %s -D MAG_LIM %f -D SIGMA_LIM %f", 
+    char *command = NULL;
+    strextend (&command, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D CAMERA %s -D MAG_LIM %f -D SIGMA_LIM %f", 
 	      PhotcodeList, table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA, MAG_LIM, SIGMA_LIM);
 
-    char tmpline[1024];
-    if (VERBOSE)       	     { snprintf (tmpline, 1024, "%s -v",              command);                   strcpy (command, tmpline); }
-    if (VERBOSE2)      	     { snprintf (tmpline, 1024, "%s -vv",             command); 		  strcpy (command, tmpline); }
-    if (RESET)         	     { snprintf (tmpline, 1024, "%s -reset",          command); 		  strcpy (command, tmpline); }
-    if (RESET_ZEROPTS) 	     { snprintf (tmpline, 1024, "%s -reset-zpts",     command); 		  strcpy (command, tmpline); }
-    if (!KEEP_UBERCAL) 	     { snprintf (tmpline, 1024, "%s -reset-ubercal",  command); 		  strcpy (command, tmpline); }
-    if (DophotSelect)  	     { snprintf (tmpline, 1024, "%s -dophot %d",      command, DophotValue);      strcpy (command, tmpline); }
-    if (ImagSelect)    	     { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax); strcpy (command, tmpline); }
-    if (MaxDensityUse) 	     { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);  strcpy (command, tmpline); }
-    if (SyntheticPhotometry) { snprintf (tmpline, 1024, "%s -synthphot",      command);                   strcpy (command, tmpline); }
+    if (VERBOSE)       	     { strextend (&command, "-v"); }
+    if (VERBOSE2)      	     { strextend (&command, "-vv"); }
+    if (RESET)         	     { strextend (&command, "-reset"); }
+    if (RESET_ZEROPTS) 	     { strextend (&command, "-reset-zpts"); }
+    if (!KEEP_UBERCAL) 	     { strextend (&command, "-reset-ubercal"); }
+    if (DophotSelect)  	     { strextend (&command, "-dophot %d", DophotValue); }
+    if (ImagSelect)    	     { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); }
+    if (MaxDensityUse) 	     { strextend (&command, "-max-density %f", MaxDensityValue); }
+    if (SyntheticPhotometry) { strextend (&command, "-synthphot"); }
 
     if (TimeSelect) { 
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      snprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
-      strcpy (command, tmpline); 
     }
 
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c	(revision 38378)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c	(revision 38379)
@@ -56,7 +56,7 @@
     TIMESTAMP(time1);
 
-    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
+    // catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
+    // catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
+    // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt    = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
@@ -207,7 +207,11 @@
     group->hosts[i][0].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "relphot_client %s -update-catalogs %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f", 
-	      PhotcodeList, imageFile, group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
+    char *command = NULL;
+    strextend (&command, "relphot_client %s -update-catalogs %s", PhotcodeList, imageFile);
+    strextend (&command, "-hostID %d -D CATDIR %s -hostdir %s", group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].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 -minerror %f", STAR_TOOFEW, MIN_ERROR);
 
     // options & configs which affect relphot_client -update-catalogs
@@ -221,23 +225,24 @@
     // MIN_ERROR
     
-    char tmpline[1024];
-    if (VERBOSE)          { snprintf (tmpline, 1024, "%s -v",           	command);                    			  strcpy (command, tmpline); }
-    if (VERBOSE2)         { snprintf (tmpline, 1024, "%s -vv",          	command); 		     			  strcpy (command, tmpline); }
-    if (RESET)            { snprintf (tmpline, 1024, "%s -reset",       	command); 		     			  strcpy (command, tmpline); }
-    if (RESET_ZEROPTS)    { snprintf (tmpline, 1024, "%s -reset-zpts",       	command); 		     			  strcpy (command, tmpline); }
-    if (UPDATE)           { snprintf (tmpline, 1024, "%s -update",       	command); 		     			  strcpy (command, tmpline); }
-    if (IS_DIFF_DB)       { snprintf (tmpline, 1024, "%s -is-diff-db",       	command); 		     			  strcpy (command, tmpline); }
-    if (!KEEP_UBERCAL)    { snprintf (tmpline, 1024, "%s -reset-ubercal",	command); 		                          strcpy (command, tmpline); }
-    if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT); 		          strcpy (command, tmpline); }
-    if (BOUNDARY_TREE)    { snprintf (tmpline, 1024, "%s -boundary-tree %s",    command, BOUNDARY_TREE); 		          strcpy (command, tmpline); }
-    if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", command, SET_MREL_VERSION);                  strcpy (command, tmpline); }
-    if (AreaSelect)       { snprintf (tmpline, 1024, "%s -area %f %f %f %f",    command, AreaXmin, AreaXmax, AreaYmin, AreaYmax); strcpy (command, tmpline); }
+    if (VERBOSE)          { strextend (&command, "-v"); }
+    if (VERBOSE2)         { strextend (&command, "-vv"); }
+    if (RESET)            { strextend (&command, "-reset"); }
+    if (RESET_ZEROPTS)    { strextend (&command, "-reset-zpts"); }
+    if (UPDATE)           { strextend (&command, "-update"); }
+    if (IS_DIFF_DB)       { strextend (&command, "-is-diff-db"); }
+    if (!KEEP_UBERCAL)    { strextend (&command, "-reset-ubercal"); }
+    if (UPDATE_CATFORMAT) { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
+    if (BOUNDARY_TREE)    { strextend (&command, "-boundary-tree %s", BOUNDARY_TREE); }
+
+    // deprecate
+    // if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", SET_MREL_VERSION); } // XXXX deprecate this...
+
+    if (AreaSelect)       { strextend (&command, "-area %f %f %f %f", AreaXmin, AreaXmax, AreaYmin, AreaYmax); }
     if (TimeSelect) { 
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      snprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
-      strcpy (command, tmpline); 
     }
 
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_objects.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_objects.c	(revision 38378)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_objects.c	(revision 38379)
@@ -40,7 +40,7 @@
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
     catalog.filename    = hostID ? hostfile : skylist[0].filename[i];
-    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
+    // catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
+    // catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
+    // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
@@ -154,16 +154,16 @@
     // MaxDensityUse, MaxDensityValue
 
-    char command[1024];
-    snprintf (command, 1024, "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", 
+    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);
 
-    char tmpline[1024];
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
-    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command); 		     strcpy (command, tmpline); }
-    if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command); 		     strcpy (command, tmpline); }
-    if (RESET_ZEROPTS) { snprintf (tmpline, 1024, "%s -reset-zpts",     command); 		     strcpy (command, tmpline); }
-    if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command); 		     strcpy (command, tmpline); }
-    if (!KEEP_UBERCAL) { snprintf (tmpline, 1024, "%s -reset-ubercal",  command); 		     strcpy (command, tmpline); }
-    if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", command, SET_MREL_VERSION); strcpy (command, tmpline); }
+    if (VERBOSE)       { strextend (&command, "-v"); }
+    if (VERBOSE2)      { strextend (&command, "-vv"); }
+    if (RESET)         { strextend (&command, "-reset"); }
+    if (RESET_ZEROPTS) { strextend (&command, "-reset-zpts"); }
+    if (UPDATE)        { strextend (&command, "-update"); }
+    if (!KEEP_UBERCAL) { strextend (&command, "-reset-ubercal"); }
+
+    // if (SET_MREL_VERSION != 1) { strextend (&command, "-set-mrel-version %d", SET_MREL_VERSION); } 
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_synthphot.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_synthphot.c	(revision 38378)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_synthphot.c	(revision 38379)
@@ -41,7 +41,7 @@
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
     catalog.filename    = hostID ? hostfile : skylist[0].filename[i];
-    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
+    // catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
+    // catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
+    // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
     catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
@@ -110,12 +110,12 @@
     // VERBOSE, VERBOSE2
 
-    char command[1024];
-    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);
+    char *command = NULL;
+    strextend (&command, "relphot_client -synthphot_means %s", SYNTH_ZERO_POINTS);
+    strextend (&command, "-hostID %d -D CATDIR %s -hostdir %s", table->hosts[i].hostID, CATDIR, table->hosts[i].pathname);
+    strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
-    char tmpline[1024];
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
-    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command); 		     strcpy (command, tmpline); }
-    if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command); 		     strcpy (command, tmpline); }
+    if (VERBOSE)       { strextend (&command, "-v");      }
+    if (VERBOSE2)      { strextend (&command, "-vv");     }
+    if (UPDATE)        { strextend (&command, "-update"); }
 
     fprintf (stderr, "command: %s\n", command);
