Index: /branches/eam_branches/ipp-20101205/Ohana/src/relastro/src/select_images.c
===================================================================
--- /branches/eam_branches/ipp-20101205/Ohana/src/relastro/src/select_images.c	(revision 30510)
+++ /branches/eam_branches/ipp-20101205/Ohana/src/relastro/src/select_images.c	(revision 30511)
@@ -170,16 +170,16 @@
     double DminImage = +90.0;
     double DmaxImage = -90.0;
-    int leftside = FALSE;
+    // int leftside = FALSE;
     for (j = 0; j < 5; j++) {
       XY_to_RD (&Ri[j], &Di[j], Xi[j], Yi[j], &timage[i].coords);
-      Ri[j] = ohana_normalize_angle (Ri[j]);
-      while (Ri[j] < RminSkyRegion) { Ri[j] += 360.0; }
-      while (Ri[j] > RmaxSkyRegion) { Ri[j] -= 360.0; }
-      if (j == 0) {
-	leftside = (Ri[j] < RmidSkyRegion);
-      } else {
-	if (  leftside && (Ri[j] > RmidSkyRegion + 90)) { Ri[j] -= 360.0; }
-	if (! leftside && (Ri[j] < RmidSkyRegion - 90)) { Ri[j] += 360.0; }
-      }
+      Ri[j] = ohana_normalize_angle_to_midpoint (Ri[j], RmidSkyRegion);
+//      while (Ri[j] < RminSkyRegion) { Ri[j] += 360.0; }
+//      while (Ri[j] > RmaxSkyRegion) { Ri[j] -= 360.0; }
+//      if (j == 0) {
+//	leftside = (Ri[j] < RmidSkyRegion);
+//      } else {
+//	if (  leftside && (Ri[j] > RmidSkyRegion + 90)) { Ri[j] -= 360.0; }
+//	if (! leftside && (Ri[j] < RmidSkyRegion - 90)) { Ri[j] += 360.0; }
+//      }
 
       RminImage = MIN(RminImage, Ri[j]);
