Index: /trunk/Ohana/src/mosastro/src/LoadStars.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/LoadStars.c	(revision 3296)
+++ /trunk/Ohana/src/mosastro/src/LoadStars.c	(revision 3297)
@@ -71,4 +71,5 @@
     /** need to save all input lines so we can write on output? (gastro does not) **/
     for (j = 0; j < chip[Nchip].Nstars; j++) {
+      bzero (&chip[Nchip].stars[j], sizeof(StarData));
       dparse (&chip[Nchip].stars[j].X,   1, &buffer[j*BYTES_STAR]);
       dparse (&chip[Nchip].stars[j].Y,   2, &buffer[j*BYTES_STAR]);
Index: /trunk/Ohana/src/mosastro/src/fakefield.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/fakefield.c	(revision 3296)
+++ /trunk/Ohana/src/mosastro/src/fakefield.c	(revision 3297)
@@ -52,6 +52,15 @@
   }
 
+  /* megacam distortion : 50 arcsec @ 1800 arcsec */
+  field.distort.polyterms[0][3] = 1e-8;
+  field.distort.polyterms[1][6] = 1e-8;
+
+  /* tiny distortion    : 0.5 arcsec @ 1800 arcsec */
   field.distort.polyterms[0][3] = 1e-10;
   field.distort.polyterms[1][6] = 1e-10;
+
+  /* minor distortion    : 5 arcsec @ 1800 arcsec */
+  field.distort.polyterms[0][3] = 1e-9;
+  field.distort.polyterms[1][6] = 1e-9;
 
   return (1);
Index: /trunk/Ohana/src/mosastro/src/gcatalog.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/gcatalog.c	(revision 3296)
+++ /trunk/Ohana/src/mosastro/src/gcatalog.c	(revision 3297)
@@ -25,4 +25,5 @@
   while ((nbytes = fread (buffer, 1, Nbytes, f)) > 0) {
     for (i = 0; i < nbytes / BYTES_STAR; i++) {
+      bzero (&stars[nstar], sizeof(StarData));
       dparse (&stars[nstar].R,   1, &buffer[i*BYTES_STAR]);
       dparse (&stars[nstar].D,   2, &buffer[i*BYTES_STAR]);
Index: /trunk/Ohana/src/mosastro/src/getusno.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/getusno.c	(revision 3296)
+++ /trunk/Ohana/src/mosastro/src/getusno.c	(revision 3297)
@@ -113,4 +113,5 @@
 	if ((buf[0] > iRA0) && (buf[0] < iRA1) &&
 	    (buf[1] > iDEC0) && (buf[1] < iDEC1)) {
+	  bzero (&stars[Nusno], sizeof(StarData));
 	  stars[Nusno].R = buf[0]/360000.0;
 	  stars[Nusno].D = buf[1]/360000.0 - 90.0;
Index: /trunk/Ohana/src/mosastro/src/mkobs.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/mkobs.c	(revision 3296)
+++ /trunk/Ohana/src/mosastro/src/mkobs.c	(revision 3297)
@@ -105,4 +105,7 @@
 
       header = mkheader (2*dX, 2*dY, Nstars, &coords);
+      fits_modify (header, "C_L0", "%lf", 1, Lo);
+      fits_modify (header, "C_M0", "%lf", 1, Mo);
+
       sprintf (filename, "%s.%02d.fits", argv[3], Nchip);
       wstars (filename, stars, Nstars, header);
Index: /trunk/Ohana/src/mosastro/src/mkstandards.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/mkstandards.c	(revision 3296)
+++ /trunk/Ohana/src/mosastro/src/mkstandards.c	(revision 3297)
@@ -1,5 +1,5 @@
 # include "mosastro.h"
-# define DX 30.0
-# define DY 30.0
+# define DX 100.0
+# define DY 100.0
 
 /* build a grid of reference stars */
Index: /trunk/Ohana/src/mosastro/src/mosastro.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/mosastro.c	(revision 3296)
+++ /trunk/Ohana/src/mosastro/src/mosastro.c	(revision 3297)
@@ -22,8 +22,12 @@
   LoadStars (pglob.gl_pathc, pglob.gl_pathv);
 
+  /* use per-chip astrometry to find ra,dec range */ 
   deproject_stars ();
-  field_stats ();
-  init_field ();
-  init_chips ();
+  field_stats (); /** needs coords from deproject_stars **/
+  init_field ();  /** needs results from field stats **/
+  init_chips ();  /** needs results from init_field **/
+
+  /* use field model to get TP & FP coords */
+  project_stars ();
 
   refcat = greference (&Nrefcat);
Index: /trunk/Ohana/src/mosastro/src/project.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/project.c	(revision 3296)
+++ /trunk/Ohana/src/mosastro/src/project.c	(revision 3297)
@@ -17,5 +17,15 @@
   for (i = 0; i < Nchip; i++) {
     ChipToSky (chip[i].stars, chip[i].Nstars, &chip[i].coords);
-    SkyToTP   (chip[i].stars, chip[i].Nstars, &field.project);
+  }
+  return (1);
+}
+
+int project_stars () {
+
+  int i, j;
+
+  for (i = 0; i < Nchip; i++) {
+    SkyToTP (chip[i].stars, chip[i].Nstars, &field.project);
+    TPtoFP  (chip[i].stars, chip[i].Nstars, &field.distort);
   }
   return (1);
