Index: /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c
===================================================================
--- /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c	(revision 35782)
+++ /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c	(revision 35783)
@@ -209,8 +209,21 @@
   // XXX should deal with pole, but not yet...
   for (i = 0; i < catalog[0].Naverage; i++) {
+    // keep all objects which are near the boundary
     if (catalog[0].average[i].R < Rgapmin) goto save_measures;
     if (catalog[0].average[i].R > Rgapmax) goto save_measures;
     if (catalog[0].average[i].D < Dgapmin) goto save_measures;
     if (catalog[0].average[i].D > Dgapmax) goto save_measures;
+
+    // keep all objects for which the ra or dec range is too large (> 2 arcsec)
+    float maxOff = 0.0;
+    m = catalog[0].average[i].measureOffset;
+    for (j = 0; j < catalog[0].average[i].Nmeasure; j++) {
+      float dRoff = catalog[0].measure[m+j].dR * cos(RAD_DEG * 0.5 * (Dmin + Dmax));
+      float dDoff = catalog[0].measure[m+j].dD;
+      float dOff = hypot (dRoff, dDoff);
+      maxOff = MAX (maxOff, dOff);
+    }
+    if (maxOff > 3.0) goto save_measures;
+
     continue;
     
