Index: /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/dvo.h
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/dvo.h	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/dvo.h	(revision 37664)
@@ -306,4 +306,6 @@
   Image *image;
   off_t *imseq;
+
+  AstromOffsetTable *astromTable;
 
   int *neighbors;	      // list of neighbor index values
Index: /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/libdvo_astro.h
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/libdvo_astro.h	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/libdvo_astro.h	(revision 37664)
@@ -173,4 +173,5 @@
 AstromOffsetTable *AstromOffsetTableInit();
 void AstromOffsetTableFree(AstromOffsetTable *table);
+int AstromOffsetTableAddMapFromImage (AstromOffsetTable *table, Image *image);
 
 # endif
Index: /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/AstromOffsetMapUtils.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/AstromOffsetMapUtils.c	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/AstromOffsetMapUtils.c	(revision 37664)
@@ -122,4 +122,28 @@
 }
 
+int AstromOffsetTableAddMapFromImage (AstromOffsetTable *table, Image *image) {
+
+  int Nmap = table->Nmap;
+
+  table->Nmap++;
+  REALLOCATE (table->map, AstromOffsetMap *, table->Nmap);
+
+  // find the imageID and update the IDtoSeq allocation if needed
+  off_t i;
+  if (image->imageID > table->MaxImageID) {
+    int oldMaxID = table->MaxImageID;
+    table->MaxImageID = image->imageID;
+    REALLOCATE (table->IDtoSeq, int, table->MaxImageID + 1);
+    for (i = oldMaxID + 1; i < table->MaxImageID + 1; i++) {
+      table->IDtoSeq[i] = -1;
+    }
+  }
+  myAssert (table->IDtoSeq[image->imageID] == -1, "table IDtoSeq not initiazed or image collision");
+  table->IDtoSeq[image->imageID] = Nmap;
+  
+  table->map[Nmap] = image[0].coords.offsetMap;
+  return TRUE;    
+}
+
 AstromOffsetTable *AstromOffsetTableInit() {
 
Index: /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/RegionHostTable.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/RegionHostTable.c	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/RegionHostTable.c	(revision 37664)
@@ -31,4 +31,6 @@
     hosts[i].Nneighbors = 0;
     hosts[i].isNeighbor = FALSE;
+
+    hosts[i].astromTable = NULL;
   }
   return;
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h	(revision 37664)
@@ -583,4 +583,5 @@
 int save_astrom_table ();
 AstromOffsetTable *get_astrom_table ();
+void put_astrom_table (AstromOffsetTable *myTable);
 
 int fit_map (AstromOffsetMap *map, StarData *raw, StarData *ref, int Npts);
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/assign_images.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/assign_images.c	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/assign_images.c	(revision 37664)
@@ -23,4 +23,16 @@
   BuildChipMatch (image, Nimage);
   MARKTIME("build chip match for %d images: %f sec\n", (int) Nimage, dtime);
+
+  char mapfile[DVO_MAX_PATH];
+  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
+  AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, VERBOSE);
+
+  // assign images.coords.offsetMap -> table->map[i]
+  if (table) {
+    AstromOffsetTableMatchChips (image, Nimage, table);
+  } else {
+    table = AstromOffsetTableInit ();
+  }
+  put_astrom_table (table);
 
   initMosaics (image, Nimage);
@@ -160,5 +172,5 @@
 	host->astromTable = AstromOffsetTableInit();
       }
-      AstromOffsetTableAddMapFromImage(host->astromTable, image[j]);
+      AstromOffsetTableAddMapFromImage(host->astromTable, &image[j]);
     }
   }
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/launch_region_hosts.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/launch_region_hosts.c	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/launch_region_hosts.c	(revision 37664)
@@ -66,5 +66,5 @@
 
       // write the image subset for this host
-      AstromOffsetMapTableSave (host->astromTable, mapname);
+      AstromOffsetMapSave (host->astromTable, mapname);
     }
 
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/share_images_pos.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/share_images_pos.c	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/share_images_pos.c	(revision 37664)
@@ -41,5 +41,5 @@
     
     // write the image subset for this host
-    AstromOffsetMapTableSave (table, mapname);
+    AstromOffsetMapSave (table, mapname);
   }
 
@@ -53,5 +53,5 @@
 int slurp_image_pos (RegionHostTable *regionHosts, int nloop) {
 
-  off_t Nimage, i;
+  off_t Nimage, i, j;
   Image *images = getimages (&Nimage, NULL);
 
@@ -95,4 +95,7 @@
   // load the astrometry offset maps, if they exist, and apply 
   for (i = 0; i < regionHosts->Nhosts; i++) {
+    if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
+    if (REGION_HOST_ID && !regionHosts->hosts[i].isNeighbor) continue;
+
     char mapname[1024];
     snprintf (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, regionHosts->hosts[i].hostID);
@@ -103,4 +106,7 @@
     for (j = 0; j < table->Nmap; j++) {
       off_t seq = getImageByID (table->map[j][0].imageID);
+      // I do not necessarily own all images listed in the table.  skip if not found
+      if (seq < 0) continue;
+
       images[seq].coords.offsetMap = table->map[j];
       // is this sufficient?
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/ImageTable.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/ImageTable.c	(revision 37663)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/ImageTable.c	(revision 37664)
@@ -32,5 +32,5 @@
   }
 
-  // XXX do not make the chip match -- we have not loaded the PHU entries
+  // XXX do not make the chip match -- we have not loaded the PHU entries (and do not need them here)
   // BuildChipMatch (image, Nimage);
 
