Index: /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/get_image_patch.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/get_image_patch.c	(revision 37667)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/get_image_patch.c	(revision 37668)
@@ -125,6 +125,12 @@
   ALLOCATE (output, SkyRegion, 1);
 
-  output->Dmin = region->Dmin - boundary;
-  output->Dmax = region->Dmax + boundary;
+  output->Dmin = MAX (-90.0, region->Dmin - boundary);
+  output->Dmax = MIN (+90.0, region->Dmax + boundary);
+
+  if ((region->Rmax == 360.0) && (region->Rmin == 0.0)) {
+    output->Rmin = region->Rmin;
+    output->Rmax = region->Rmax;
+    return output;
+  }
 
   float dRmin = boundary / cos (RAD_DEG*region->Dmin);
Index: /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c	(revision 37667)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c	(revision 37668)
@@ -53,12 +53,9 @@
       }
     }
-    if (!childImage) {
-      fprintf (stderr, "!");
-      // skip this one?
-      continue;
-    }
+    if (!childImage) continue;
+
     // XXX hard=wire the photcode range for now (just i-band)
-    // if (childImage->photcode < 10200) continue;
-    // if (childImage->photcode < 10277) continue;
+    if (childImage->photcode < 10200) continue;
+    if (childImage->photcode > 10277) continue;
 
     refimage[Nrefimage].secz     = childImage->secz;
