Index: branches/eam_branches/relastro.20100326/src/ImageOps.c
===================================================================
--- branches/eam_branches/relastro.20100326/src/ImageOps.c	(revision 27496)
+++ branches/eam_branches/relastro.20100326/src/ImageOps.c	(revision 27497)
@@ -333,7 +333,9 @@
   if (badCoords(im)) return;
 
+  // WRP images need to have an associated mosaic
   moscoords = NULL;
-  mosaic = getMosaicForImage (im);
-  if (mosaic != NULL) {
+  if (!strcmp(&image[im].coords.ctype[4], "-WRP")) {
+    mosaic = getMosaicForImage (im);
+    if (mosaic == NULL) return;  // if we cannot find the associated image, skip it
     moscoords = &mosaic[0].coords;
   }
@@ -383,10 +385,10 @@
     // complain if the new location is far from the old location
     if (fabs(catalog[c].measure[m].dR - dR) > 2.0) {
-      fprintf (stderr, "!");
+      fprintf (stderr, "@");
       setBadCoords (im); // report a failure for this image
       return;
     }
     if (fabs(catalog[c].measure[m].dD - dD) > 2.0) {
-      fprintf (stderr, "*");
+      fprintf (stderr, "#");
       setBadCoords (im); // report a failure for this image
       return;
@@ -436,7 +438,9 @@
   memcpy (&image[im].coords, oldcoords, sizeof(Coords));
 
+  // WRP images need to have an associated mosaic
   moscoords = NULL;
-  mosaic = getMosaicForImage (im);
-  if (mosaic != NULL) {
+  if (!strcmp(&image[im].coords.ctype[4], "-WRP")) {
+    mosaic = getMosaicForImage (im);
+    if (mosaic == NULL) return;  // if we cannot find the associated image, skip it
     moscoords = &mosaic[0].coords;
   }
@@ -492,6 +496,4 @@
   StarData *raw;
 
-  ALLOCATE (raw, StarData, Nlist[im]);
-
   mosaic = NULL;
   moscoords = NULL;
@@ -500,8 +502,10 @@
     if (mosaic == NULL) {
       fprintf (stderr, "mosaic not found for image %s\n", image[im].name);
-      abort();
+      return NULL;
     }
     moscoords = &mosaic[0].coords;
   }
+
+  ALLOCATE (raw, StarData, Nlist[im]);
 
   for (i = 0; i < Nlist[im]; i++) {
@@ -567,6 +571,4 @@
   StarData *ref;
 
-  ALLOCATE (ref, StarData, Nlist[im]);
-
   mosaic = NULL;
   moscoords = NULL;
@@ -575,8 +577,10 @@
     if (mosaic == NULL) {
       fprintf (stderr, "mosaic not found for image %s\n", image[im].name);
-      abort ();
+      return NULL;
     }
     moscoords = &mosaic[0].coords;
   }
+
+  ALLOCATE (ref, StarData, Nlist[im]);
 
   for (i = 0; i < Nlist[im]; i++) {
