Index: trunk/psastro/src/psastroMosaicGetGrads.c
===================================================================
--- trunk/psastro/src/psastroMosaicGetGrads.c	(revision 9574)
+++ trunk/psastro/src/psastroMosaicGetGrads.c	(revision 12492)
@@ -15,4 +15,6 @@
         if (!chip->process || !chip->file_exists) { continue; }
 	
+	psRegion *region = pmChipExtent (chip);
+
 	while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
             psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
@@ -36,8 +38,9 @@
 
 		// measure the local gradients for this set of stars
-		// XXX update the function prototype to accept an incoming gradient structure to which the new elements are added
-		grads = pmAstromMeasureGradients (grads, rawstars, refstars, match, recipe);
+		// the new elements are added to the incoming gradient structure 
+		grads = pmAstromMeasureGradients (grads, rawstars, refstars, match, region, 2, 2);
 	    }
 	}
+	psFree (region);
     }
     return (grads);
