Index: trunk/psastro/src/psastroOneChip.c
===================================================================
--- trunk/psastro/src/psastroOneChip.c	(revision 10855)
+++ trunk/psastro/src/psastroOneChip.c	(revision 10864)
@@ -90,8 +90,6 @@
     }
     
-    // toTPA converts from FPA units (microns) to TPA units (linear degrees)
-    float plateScale1 = hypot (fpa->toTPA->x->coeff[1][0], fpa->toTPA->x->coeff[0][1]);
-    float plateScale2 = hypot (fpa->toTPA->y->coeff[1][0], fpa->toTPA->y->coeff[0][1]);
-    float plateScale = 0.5*(plateScale1 + plateScale2)*3600.0;
+    // toSky converts from FPA & TPA units (microns) to sky units (radians)
+    float plateScale = 0.5*(fpa->toSky->Xs + fpa->toSky->Ys)*3600.0*PM_DEG_RAD;
 
     // pixError is the average 1D scatter in pixels ('results' are in FPA units = microns)
@@ -105,5 +103,5 @@
 
     // XXX should these result in errors or be handled another way?
-    psLogMsg ("psastro", PS_LOG_INFO, "astrometry solution: error: %f, Nstars: %d", astError, astNstar);
+    psLogMsg ("psastro", PS_LOG_INFO, "astrometry solution: error: %f arcsec, Nstars: %d", astError, astNstar);
     if (astError > maxError) {
         psLogMsg("psastro", PS_LOG_INFO, "residual error is too large, failed to find a solution: %f > %f", astError, maxError);
@@ -127,6 +125,10 @@
     psMetadataAddF32 (updates, PS_LIST_TAIL, "EQUINOX",  PS_META_REPLACE, "equinox of ref catalog", 2000.0); // XXX this is bogus: should be defined based on equinox of refstars
 
-// write results
+    // write results
     psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
+    
+    if (psTraceGetLevel("psastro.plot") > 0) {
+	psastroPlotOneChipFit (rawstars, refstars, match, results);
+    }
 
     psFree (match);
