Index: /trunk/psastro/src/psastroMosaicAstrom.c
===================================================================
--- /trunk/psastro/src/psastroMosaicAstrom.c	(revision 10814)
+++ /trunk/psastro/src/psastroMosaicAstrom.c	(revision 10815)
@@ -28,4 +28,7 @@
 
     // XXX no input distortion model yet; existing fpa distortion is identity: replace it
+    // XXX make this a test if these are NULL; the load step can NULL them if nothing is loaded
+    // XXX if we have an input distortion model, the gradient is measuring the error rel to that model
+    // XXX how does this couple to the individual chip fits?
     psFree (fpa->toTPA);
     psFree (fpa->fromTPA);
Index: /trunk/psastro/src/psastroMosaicRescaleChips.c
===================================================================
--- /trunk/psastro/src/psastroMosaicRescaleChips.c	(revision 10814)
+++ /trunk/psastro/src/psastroMosaicRescaleChips.c	(revision 10815)
@@ -1,3 +1,6 @@
 # include "psastro.h"
+
+// XXX what is this doing? 
+// shouldn't it be doing toFPA -> fromFPA
 
 bool psastroMosaicRescaleChips (pmFPA *fpa) {
@@ -7,10 +10,15 @@
 
     // this loop selects the matched stars for all chips
+
+    // psRegion region = psMetadataLookupXXX (chip->concepts, "CHIP.TRIMSEC"); 
+    // psRegion region = psRegionSet (0, 4000, 0, 4000);
+    // chip->fromFPA = psPlaneTransformInvert(NULL, toFPA, region, 50);
+
     while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) {
         psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
         if (!chip->process || !chip->file_exists) { continue; }
-	
-	psFree (chip->toFPA);
-	chip->toFPA = p_psPlaneTransformLinearInvert(chip->fromFPA);
+
+	// XXX make '50' be a fraction of the chip size?
+	chip->fromFPA = psPlaneTransformInvert(chip->fromFPA, chip->toFPA, region, 50);
     }
     psFree (view);
