Index: trunk/psastro/src/psastro.c
===================================================================
--- trunk/psastro/src/psastro.c	(revision 5505)
+++ trunk/psastro/src/psastro.c	(revision 5509)
@@ -14,11 +14,11 @@
 
     // simple layout interpretation, basic WCS conversion
-    psFPA *fpa = psastroBuildFPA (header, config);
+    psFPA *fpa = psastroBuildFPA (header, rawstars);
 
     // limit fit to bright stars only 
-    psArray *subset = pspsastroSelectBrightStars (config, rawstars);
+    psFPA *subset = psastroSelectBrightStars (fpa, config);
 
     // use the header & config info to project rawstars on the focal plane
-    psastroProjectRawstars (subset, header, config);
+    psastroProjectRawstars (subset);
 
     // load the corresponding reference data (DVO command)
@@ -26,23 +26,11 @@
 
     // use the header & config info to project refstars on the focal plane
-    psastroProjectRefstars (refstars, header, config);
+    psastroProjectRefstars (refstars, subset);
 
-    // find initial offset / rotation
-    stat = pmAstromGridMatch (subset, refstars, config);
-
-    pmAstromModifyFPA (fpa, stat);
-
-    // use fit result to re-project rawstars
-    psastroProjectRawstars (fpa, subset);
-    psastroProjectRefstars (fpa, refstars);
-    
-    // use small radius to match stars
-    match = pmAstromRadiusMatch (rawstars, refstars, options);
-
-    // fit astrometric terms
-    output = pmAstromMatchedListFit (fpa, subset, refstars, match, options);
+    // fpa and subset point to the same astrometry terms
+    psastroChipAstrom (refstars, subset);
 
     // write out data (cmp file)
-    psastroWriteCMP (fpa, header, rawstars, argv[2]);
+    psastroWriteCMP (fpa, argv[2]);
 
     exit (0);
