Index: trunk/psastro/src/psastroUtils.c
===================================================================
--- trunk/psastro/src/psastroUtils.c	(revision 11532)
+++ trunk/psastro/src/psastroUtils.c	(revision 12492)
@@ -79,16 +79,12 @@
 bool psastroUpdateChipToFPA (pmFPA *fpa, pmChip *chip, psArray *rawstars, psArray *refstars) {
 
-    // XXX this region needs to be defined more intelligently
-    // psRegion *region = pmChipExtent (chip);
-    psRegion *region = psRegionAlloc (0, 2000, 0, 2000);
-
+    psRegion *region = pmChipExtent (chip);
+    region->x1 -= region->x0;
+    region->y1 -= region->y0;
+    region->x0 = 0;
+    region->y0 = 0;
     psFree (chip->fromFPA);
     chip->fromFPA = psPlaneTransformInvert (NULL, chip->toFPA, *region, 20);
-
-//    PS_POLY_PRINT_2D(chip->toFPA->x);
-//    PS_POLY_PRINT_2D(chip->toFPA->y);
-
-//    PS_POLY_PRINT_2D(chip->fromFPA->x);
-//    PS_POLY_PRINT_2D(chip->fromFPA->y);
+    psFree (region);
 
     for (int i = 0; i < rawstars->n; i++) {
@@ -105,5 +101,4 @@
     }
 
-    psFree (region);
     return true;
 }
