Index: /trunk/psastro/src/psastro.c
===================================================================
--- /trunk/psastro/src/psastro.c	(revision 5504)
+++ /trunk/psastro/src/psastro.c	(revision 5505)
@@ -10,11 +10,9 @@
     psMetadata *config = psastroArguments (&argc, argv);
 
-    // define optional parameters (keep in psMetadata?)
-    pmAstromOpt *options = psastroDefineOptions (config);
-
     // load the input data (cmp file)
     psArray *rawstars = pmSourcesReadCMP (&header, argv[1]);
 
-    psFPA *fpa = pmBuildFPA (header, config);
+    // simple layout interpretation, basic WCS conversion
+    psFPA *fpa = psastroBuildFPA (header, config);
 
     // limit fit to bright stars only 
@@ -31,5 +29,5 @@
 
     // find initial offset / rotation
-    stat = pmAstromGridMatch (subset, refstars, options);
+    stat = pmAstromGridMatch (subset, refstars, config);
 
     pmAstromModifyFPA (fpa, stat);
Index: /trunk/psastro/src/psastroArguments.c
===================================================================
--- /trunk/psastro/src/psastroArguments.c	(revision 5504)
+++ /trunk/psastro/src/psastroArguments.c	(revision 5505)
@@ -14,62 +14,9 @@
   psTraceArguments (argc, argv);
 
-  // optional mask image - add to config
-  char *mask = NULL;
-  if ((N = psArgumentGet (*argc, argv, "-mask"))) {
-    psArgumentRemove (N, argc, argv);
-    mask = psStringCopy (argv[N]);
-    psArgumentRemove (N, argc, argv);
-  }
-
-  // optional weight image - add to config
-  char *weight = NULL;
-  if ((N = psArgumentGet (*argc, argv, "-weight"))) {
-    psArgumentRemove (N, argc, argv);
-    weight = psStringCopy (argv[N]);
-    psArgumentRemove (N, argc, argv);
-  }
-
-  // optional output residual image - add to config
-  char *resid = NULL;
-  if ((N = psArgumentGet (*argc, argv, "-resid"))) {
-    psArgumentRemove (N, argc, argv);
-    resid = psStringCopy (argv[N]);
-    psArgumentRemove (N, argc, argv);
-  }
-
-  // optional output residual image - add to config
-  char *photcode = NULL;
-  if ((N = psArgumentGet (*argc, argv, "-photcode"))) {
-    psArgumentRemove (N, argc, argv);
-    photcode = psStringCopy (argv[N]);
-    psArgumentRemove (N, argc, argv);
-  }
-
-  if (*argc != 4) usage ();
+  if (*argc != 2) usage ();
 
   // load config information
   psMetadata *config = psMetadataAlloc ();
-  psMetadataAdd (config, PS_LIST_HEAD, "PSF_MODEL", PS_DATA_METADATA_MULTI, "folder for psf model entries", NULL);
   config = psMetadataConfigParse (config, &Nfail, argv[3], FALSE);
-
-  // identify input image & optional weight & mask images
-  // command-line entries override config-file entries
-  psMetadataAdd (config, PS_LIST_HEAD, "IMAGE",       mode, "", argv[1]);
-  psMetadataAdd (config, PS_LIST_HEAD, "OUTPUT_FILE", mode, "", argv[2]);
-
-  if (mask != NULL) {
-    psMetadataAdd (config, PS_LIST_HEAD, "MASK_IMAGE", mode, "", mask);
-  }
-  if (weight != NULL) {
-    psMetadataAdd (config, PS_LIST_HEAD, "WEIGHT_IMAGE", mode, "", weight);
-  }
-  if (resid != NULL) {
-    psMetadataAdd (config, PS_LIST_HEAD, "RESID_IMAGE", mode, "", resid);
-  }
-  if (photcode != NULL) {
-    psMetadataAdd (config, PS_LIST_HEAD, "PHOTCODE", mode, "", photcode);
-  } else {
-    psMetadataAdd (config, PS_LIST_HEAD, "PHOTCODE", mode, "", "NONE");
-  }    
   return (config);
 }
@@ -77,10 +24,5 @@
 static void usage (void) {
 
-    fprintf (stderr, "USAGE: psphot (image) (output) (config)\n");
-    fprintf (stderr, "options: \n");
-    fprintf (stderr, "  -mask  (filename)\n");
-    fprintf (stderr, "  -weight (filename)\n");
-    fprintf (stderr, "  -resid (filename)\n");
-    fprintf (stderr, "  -photcode (photcode)\n");
+    fprintf (stderr, "USAGE: psastro (cmpfile)\n");
     exit (2);
 }
Index: /trunk/psastro/src/psastroBuildFPA.c
===================================================================
--- /trunk/psastro/src/psastroBuildFPA.c	(revision 5505)
+++ /trunk/psastro/src/psastroBuildFPA.c	(revision 5505)
@@ -0,0 +1,2 @@
+# include "psastro.h"
+
Index: /trunk/psastro/src/psastroUtils.c
===================================================================
--- /trunk/psastro/src/psastroUtils.c	(revision 5504)
+++ /trunk/psastro/src/psastroUtils.c	(revision 5505)
@@ -14,5 +14,5 @@
     // how many lines in the header?
     // XXX EAM : is this calculation robust?
-    nLines = header->list->n;
+    nLines = myHeader->list->n;
     nBytes = nLines * 80;
     if (nBytes % 2880) {
@@ -39,5 +39,9 @@
 	sscanf (line, "%lf %lf %lf %lf", &X, &Y, &Mag, &dMag);
 	
-	pmAstromObj *obj = pmAstromObjAlloc (X, Y, Mag, dMag);
+	pmAstromObj *obj = pmAstromObjAlloc ();
+	obj->pix.X    = X;
+	obj->pix.Y    = Y;
+	obj->pix.Mag  = Mag;
+	obj->pix.dMag = dMag;
 	psArrayAdd (stars, obj, 100);
     }
