Index: trunk/ippToPsps/jython/loader.py
===================================================================
--- trunk/ippToPsps/jython/loader.py	(revision 35177)
+++ trunk/ippToPsps/jython/loader.py	(revision 35179)
@@ -8,4 +8,5 @@
 import sys
 import os
+import math
 import traceback
 import logging.config
@@ -158,7 +159,8 @@
                     self.logger.infoPair("Box dimensions", "%.1f / %.1f / %.1f" % (boxDim['RA'], boxDim['DEC'], boxDim['SIDE']))
                     self.logger.infoPair(batchType + " items found in this box", "%d" % len(ids))
-                    boxSizeWithBorder = boxDim['SIDE'] + (self.skychunk.BORDER * 2)
+                    boxSizeWithBorder = boxDim['SIDE'] + (self.skychunk.BORDER * 2 / math.cos(math.radians(boxDim['DEC'])))
                     boxSizeSansBorder = boxDim['SIDE']
-                    self.logger.infoPair("got here", "ok")
+                    boxSize = boxSizeWithBorder
+                    self.logger.infoPair("using box of size", str(boxSize))
                     useFullTables = 0
                     if batchType != "OB":
@@ -167,5 +169,5 @@
                             # look in DVO for this box (with extra border)
                             self.logger.infoPair("Querying DVO for this sky area", "")
-                            self.dvoDetections.setSkyAreaAsBox(boxDim['RA'], boxDim['DEC'], boxSizeWithBorder)
+                            self.dvoDetections.setSkyAreaAsBox(boxDim['RA'], boxDim['DEC'], boxSize)
                             #self.dvoDetections.setSkyArea()
                             sizeToBeIngested = self.dvoDetections.getDiskSizeOfRegionsToBeIngested()
@@ -194,5 +196,5 @@
                             # impact of mysql insertion
                             if not self.ippToPspsDb.isBoxIngested(boxId):
-                                self.dvoDetections.nativeIngestDetections(boxId, boxDim['RA'], boxDim['DEC'], boxSizeWithBorder)
+                                self.dvoDetections.nativeIngestDetections(boxId, boxDim['RA'], boxDim['DEC'], boxSize)
 
                             useFullTables = 1
