Index: anches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/update_setphot.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/update_setphot.c	(revision 33230)
+++ 	(revision )
@@ -1,78 +1,0 @@
-# include "uniphot.h"
-# include <glob.h>
-
-// for parallel operation, we need to have a threaded client / server model here:
-// save the zero point information to a temporary file
-// launch remote jobs on each of the remote hosts
-// monitor the results
-// harvest the children
-
-int update_setphot_parallel () {
-
-  strcpy (connect, "ssh");
-
-  // load the list of hosts
-  HostTable *table = HostTableLoad (catdir, "HostTable.dat");
-
-  for (i = 0; i < table->Nhosts; i++) {
-
-    char command[1024];
-    snprintf (command, 1024, "setphot_update_catalogs");
-
-    // launch the job on the remote machine (no handshake)
-    int pid = rconnect (connect, table->hosts[i].hostname, command, table->hosts[i].stdio, &errorInfo, FALSE);
-    if (!pid) {
-      if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo);
-      exit (1);
-    }
-    table->hosts[i].pid; // save for future reference
-
-    // check that all hosts started OK?
-  }
-
-  // watch for stdout / stderr from those jobs...
-  // wait for all of them to complete...
-
-  return (TRUE);
-}      
-
-void update_catalog_setphot (Catalog *catalog, Image *image, off_t *index, off_t Nimage, FlatCorrectionTable *flatcorr) {
-
-  off_t i, j, found;
-
-  found = 0;    
-  for (i = 0; i < catalog[0].Naverage; i++) {
-
-    off_t m = catalog[0].average[i].measureOffset;
-    for (j = 0; j < catalog[0].average[i].Nmeasure; j++, m++) {
-      off_t idx = catalog[0].measure[m].imageID;
-      if (idx <= 0) continue; // detections with imageID == 0 do not have a valid image (eg, ref photcode)
-
-      off_t id = index[idx];
-      float Mcal = image[id].Mcal;
-      float dMcal = image[id].dMcal;
-      float Mcal_offset = 0.0;
-
-      // if we know about a flat-field correction, then we need to apply the sub-chip correction
-      int flat_id = image[id].photom_map_id;
-      if (flat_id > 0) {
-	  Mcal_offset = FlatCorrectionOffset (flatcorr, flat_id, catalog[0].measure[m].Xccd, catalog[0].measure[m].Yccd);
-      }
-
-      catalog[0].measure[m].Mcal = Mcal - Mcal_offset;
-      catalog[0].measure[m].dMcal = dMcal;
-
-      // if we are setting the zero points from an UBERCAL database, and this detection is from one of those images,
-      // then tag the measurement as well
-      if (UBERCAL && (image[id].flags & ID_IMAGE_PHOTOM_UBERCAL)) {
-	catalog[0].measure[m].dbFlags |=  ID_MEAS_PHOTOM_UBERCAL;
-      }
-
-      found ++;
-    }
-  }
-
-  if (found) {
-    fprintf (stderr, "found "OFF_T_FMT" matches\n", found);
-  }
-}
Index: /branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/update_setphot_parallel.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/update_setphot_parallel.c	(revision 33231)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/update_setphot_parallel.c	(revision 33231)
@@ -0,0 +1,78 @@
+# include "uniphot.h"
+# include <glob.h>
+
+// for parallel operation, we need to have a threaded client / server model here:
+// save the zero point information to a temporary file
+// launch remote jobs on each of the remote hosts
+// monitor the results
+// harvest the children
+
+int update_setphot_parallel () {
+
+  strcpy (connect, "ssh");
+
+  // load the list of hosts
+  HostTable *table = HostTableLoad (catdir, "HostTable.dat");
+
+  for (i = 0; i < table->Nhosts; i++) {
+
+    char command[1024];
+    snprintf (command, 1024, "setphot_update_catalogs");
+
+    // launch the job on the remote machine (no handshake)
+    int pid = rconnect (connect, table->hosts[i].hostname, command, table->hosts[i].stdio, &errorInfo, FALSE);
+    if (!pid) {
+      if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo);
+      exit (1);
+    }
+    table->hosts[i].pid; // save for future reference
+
+    // check that all hosts started OK?
+  }
+
+  // watch for stdout / stderr from those jobs...
+  // wait for all of them to complete...
+
+  return (TRUE);
+}      
+
+void update_catalog_setphot (Catalog *catalog, Image *image, off_t *index, off_t Nimage, FlatCorrectionTable *flatcorr) {
+
+  off_t i, j, found;
+
+  found = 0;    
+  for (i = 0; i < catalog[0].Naverage; i++) {
+
+    off_t m = catalog[0].average[i].measureOffset;
+    for (j = 0; j < catalog[0].average[i].Nmeasure; j++, m++) {
+      off_t idx = catalog[0].measure[m].imageID;
+      if (idx <= 0) continue; // detections with imageID == 0 do not have a valid image (eg, ref photcode)
+
+      off_t id = index[idx];
+      float Mcal = image[id].Mcal;
+      float dMcal = image[id].dMcal;
+      float Mcal_offset = 0.0;
+
+      // if we know about a flat-field correction, then we need to apply the sub-chip correction
+      int flat_id = image[id].photom_map_id;
+      if (flat_id > 0) {
+	  Mcal_offset = FlatCorrectionOffset (flatcorr, flat_id, catalog[0].measure[m].Xccd, catalog[0].measure[m].Yccd);
+      }
+
+      catalog[0].measure[m].Mcal = Mcal - Mcal_offset;
+      catalog[0].measure[m].dMcal = dMcal;
+
+      // if we are setting the zero points from an UBERCAL database, and this detection is from one of those images,
+      // then tag the measurement as well
+      if (UBERCAL && (image[id].flags & ID_IMAGE_PHOTOM_UBERCAL)) {
+	catalog[0].measure[m].dbFlags |=  ID_MEAS_PHOTOM_UBERCAL;
+      }
+
+      found ++;
+    }
+  }
+
+  if (found) {
+    fprintf (stderr, "found "OFF_T_FMT" matches\n", found);
+  }
+}
