Index: trunk/psastro/src/psastro.c
===================================================================
--- trunk/psastro/src/psastro.c	(revision 12492)
+++ trunk/psastro/src/psastro.c	(revision 12806)
@@ -1,3 +1,3 @@
-# include "psastro.h"
+# include "psastroStandAlone.h"
 
 static void usage (void) {
@@ -9,5 +9,4 @@
 
     pmConfig *config = NULL;
-    psArray *refs = NULL;
 
     psTimerStart ("complete");
@@ -36,49 +35,9 @@
     }
 
-    // interpret the available initial astrometric information
-    // apply the initial guess
-    if (!psastroAstromGuess (config)) {
-	psErrorStackPrint(stderr, "failed to determine initial astrometry guess\n");
+    if (!psastroAnalysis (config)) {
+	psErrorStackPrint(stderr, "failure in psastro analysis\n");
 	exit (1);
     }
-
-    // load the reference stars overlapping the data stars
-    refs = psastroLoadRefstars (config);
-    if (!refs) {
-	psErrorStackPrint(stderr, "failed to load reference data\n");
-	exit (1);
-    }
-
-    // choose reference stars corresponding to the selected chips
-    if (!psastroChooseRefstars (config, refs)) {
-	psErrorStackPrint(stderr, "failed to select reference data for chips\n");
-	exit (1);
-    }
-
-    // XXX does this check the recipe??
-    bool chipastro = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.CHIP.MODE");
-    bool mosastro  = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.MOSAIC.MODE");
-    if (!chipastro && !mosastro) {
-	psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip mode\n");
-	chipastro= true;
-    }
-
-    if (chipastro) {
-	if (!psastroChipAstrom (config, refs)) {
-	    psErrorStackPrint(stderr, "failed to perform single chip astrometry\n");
-	    exit (1);
-	}
-    }
-
-    if (mosastro) {
-	if (!psastroMosaicAstrom (config, refs)) {
-	    psErrorStackPrint(stderr, "failed to perform mosaic camera astrometry\n");
-	    exit (1);
-	}
-    }
-
-    // XXX how do we specify stack astrometry?
-    // psastroStackAstrom (config, refs);
-
+    
     // write out the results
     if (!psastroDataSave (config)) {
@@ -89,5 +48,5 @@
     psLogMsg ("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete"));
 
-    psastroCleanup (config, refs);
+    psastroCleanup (config);
     exit (EXIT_SUCCESS);
 }
