Index: trunk/psastro/src/psastroMosaicGradients.c
===================================================================
--- trunk/psastro/src/psastroMosaicGradients.c	(revision 12806)
+++ trunk/psastro/src/psastroMosaicGradients.c	(revision 13656)
@@ -10,4 +10,7 @@
 
     pmFPAview *view = pmFPAviewAlloc (0);
+
+    int nXcell = psMetadataLookupS32 (&status, recipe, "PSASTRO.MOSAIC.GRADIENT.NX");
+    int nYcell = psMetadataLookupS32 (&status, recipe, "PSASTRO.MOSAIC.GRADIENT.NY");
 
     // this loop selects the matched stars for all chips
@@ -41,5 +44,5 @@
 		// measure the local gradients for this set of stars
 		// XXX 2,2 are the number of test boxes on the chip.  put this in the recipe
-		gradients = pmAstromMeasureGradients (gradients, rawstars, refstars, match, region, 2, 2);
+		gradients = pmAstromMeasureGradients (gradients, rawstars, refstars, match, region, nXcell, nYcell);
 	    }
 	}
