Index: /branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/Sections.c
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/Sections.c	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/Sections.c	(revision 32663)
@@ -240,4 +240,5 @@
 int SectionMinBoundary (Graphic *graphic) {
 
+    int i;
     int Xs = graphic->dx;
     int Ys = graphic->dy;
@@ -248,8 +249,8 @@
     // image status (should not include the imtool portion)
     for (i = 0; i < Nsections; i++) {
-	Xs = PS_MIN (Xs, sections[i][0].x);
-	Ys = PS_MIN (Ys, sections[i][0].y);
-	Xe = PS_MAX (Xe, sections[i][0].x + sections[i][0].dx);
-	Ye = PS_MAX (Ye, sections[i][0].y + sections[i][0].dy);
+	Xs = MIN (Xs, sections[i][0].x);
+	Ys = MIN (Ys, sections[i][0].y);
+	Xe = MAX (Xe, sections[i][0].x + sections[i][0].dx);
+	Ye = MAX (Ye, sections[i][0].y + sections[i][0].dy);
     }
 
Index: /branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/bDrawIt.c
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/bDrawIt.c	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/bDrawIt.c	(revision 32663)
@@ -13,5 +13,5 @@
   black = KapaColorByName ("black");
 
-  SectionMinBoundary (graphic);
+  // SectionMinBoundary (graphic);
 
   // if we want to trim, we'll need to carry about the start in graphic coords and
Index: /branches/eam_branches/ipp-20111110/Ohana/src/libdvo/src/dbExtractMeasures.c
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/libdvo/src/dbExtractMeasures.c	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/libdvo/src/dbExtractMeasures.c	(revision 32663)
@@ -245,8 +245,8 @@
       break;
     case MEAS_PAR: /* OK */
-      value.Flt = average[0].R;
+      value.Flt = average[0].P;
       break;
     case MEAS_PAR_ERR: /* OK */
-      value.Flt = average[0].D;
+      value.Flt = average[0].dP;
       break;
     case MEAS_CHISQ_POS: /* OK */
Index: /branches/eam_branches/ipp-20111110/Ohana/src/libkapa/src/PSRotFont.c
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/libkapa/src/PSRotFont.c	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/libkapa/src/PSRotFont.c	(revision 32663)
@@ -32,4 +32,24 @@
   dY = currentfont[65].ascent;
   
+  /***
+
+      update this to use the following PS code:
+
+      /ceshow { % (string) fontsize fontname x y 
+      gsave 
+      moveto findfont exch scalefont setfont % s 
+      gsave 
+      dup false charpath flattenpath pathbbox % s x0 y0 x1 y1 
+      grestore 
+      3 -1 roll sub % s x0 x1 dy 
+      3 1 roll sub % s dy -dx 
+      2 div exch % s -dx/2 dy 
+      -2 div % s -dx/2 -dy/2 
+      rmoveto show 
+      grestore 
+      } bind def 
+
+   ***/
+
   /* apply appropriate offset */
   Xoff = Yoff = 0;
Index: /branches/eam_branches/ipp-20111110/Ohana/src/relastro/include/relastro.h
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/relastro/include/relastro.h	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/relastro/include/relastro.h	(revision 32663)
@@ -317,7 +317,7 @@
 int sun_ecliptic (double jd, double *lambda, double *beta, double *epsilon);
 int ParFactor (double *pR, double *pD, double R, double D, double T, double Tmean);
-int FitPM (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, int Npts);
+int FitPM (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, int Npts, int XVERB);
 int FitPar (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *pR, double *pD, int Npts);
-int FitPMandPar (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, double *pR, double *pD, int Npts);
+int FitPMandPar (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, double *pR, double *pD, int Npts, int XVERB);
 
 Mosaic *getMosaicForImage (off_t N);
Index: /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/FitPM.c
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/FitPM.c	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/FitPM.c	(revision 32663)
@@ -2,5 +2,5 @@
 
 /* do we want an init function which does the alloc and a clear function to free? */
-int FitPM (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, int Npts) {
+int FitPM (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, int Npts, int XVERB) {
 
   int i;
@@ -77,4 +77,5 @@
     chisq += SQ(X[i] - Xf) / SQ(dX[i]);
     chisq += SQ(Y[i] - Yf) / SQ(dY[i]);
+    if (XVERB) fprintf (stderr, "chisq contrib : %f %f : %f %f : %f %f : %f %f : %f\n", Xf, Yf, X[i] - Xf, Y[i] - Yf, dX[i], dY[i], (X[i] - Xf) / dX[i], (Y[i] - Yf) / dY[i], chisq);
   }
   fit[0].Nfit = Npts;
Index: /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/FitPMandPar.c
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/FitPMandPar.c	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/FitPMandPar.c	(revision 32663)
@@ -2,5 +2,5 @@
 
 /* do we want an init function which does the alloc and a clear function to free? */
-int FitPMandPar (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, double *pR, double *pD, int Npts) {
+int FitPMandPar (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, double *pR, double *pD, int Npts, int XVERB) {
 
   int i;
@@ -103,4 +103,6 @@
     chisq += SQ(X[i] - Xf) / SQ(dX[i]);
     chisq += SQ(Y[i] - Yf) / SQ(dY[i]);
+    if (XVERB) fprintf (stderr, "chisq contrib : %f %f : %f %f : %f %f : %f %f : %f\n", Xf, Yf, X[i] - Xf, Y[i] - Yf, dX[i], dY[i], (X[i] - Xf) / dX[i], (Y[i] - Yf) / dY[i], chisq);
+
   }
   fit[0].Nfit = Npts;
Index: /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/UpdateObjects.c
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/UpdateObjects.c	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/UpdateObjects.c	(revision 32663)
@@ -84,4 +84,6 @@
       /* calculate the average value of R,D for a single star */
 
+      XVERB = FALSE;
+
       // skip objects which are known to be problematic
       // XXX include this code or not?
@@ -196,5 +198,8 @@
       }
       
-      XVERB = (catalog[i].measure[m].dM < 0.01) && (N == 6) && (mode == FIT_PM_ONLY);
+      // XVERB |= (catalog[i].averge[j].objID == 0xc90) && (catalog[i].average[j].catID == 0x2a1e);
+      XVERB |= (catalog[i].average[j].objID == OBJ_ID_SRC) && (catalog[i].average[j].catID == CAT_ID_SRC);
+      XVERB |= (catalog[i].average[j].objID == OBJ_ID_DST) && (catalog[i].average[j].catID == CAT_ID_DST);
+      // XVERB = (catalog[i].measure[m].dM < 0.01) && (N == 6) && (mode == FIT_PM_ONLY);
 
       // to judge the quality of the PM and PAR fits, we need to fit all three models and compare Chisq
@@ -211,7 +216,7 @@
 	}	  
 
-	FitPM (&fitPM, X, dX, Y, dY, T, N);
-
-	if (XVERB) fprintf (stderr, "fitted:  %f - %f : %f %f : %f %f : %f vs %f\n", Tmin, Tmax, fitPM.Ro, fitPM.Do, fitPM.uR, fitPM.uD, fitPM.chisq, fitAve.chisq);
+	FitPM (&fitPM, X, dX, Y, dY, T, N, XVERB);
+
+	if (XVERB) fprintf (stderr, "fitted PM:  %f - %f : %f %f : %f %f : %f vs %f\n", Tmin, Tmax, fitPM.Ro, fitPM.Do, fitPM.uR, fitPM.uD, fitPM.chisq, fitAve.chisq);
 
 	// project Ro, Do back to RA,DEC
@@ -230,5 +235,5 @@
 	  ParFactor (&pX[k], &pY[k], R[k], D[k], T[k], Tmean);
 	}
-	FitPMandPar (&fitPAR, X, dX, Y, dY, T, pX, pY, N);
+	FitPMandPar (&fitPAR, X, dX, Y, dY, T, pX, pY, N, XVERB);
 	XY_to_RD (&fitPAR.Ro, &fitPAR.Do, fitPAR.Ro, fitPAR.Do, &coords);
 	catalog[i].average[j].flags |= ID_STAR_FIT_PAR;
@@ -275,5 +280,5 @@
 	break;
       }
-      if (XVERB) fprintf (stderr, "A%f %f -> %f %f (%f,%f) pm=(%f %f)\n",
+      if (XVERB) fprintf (stderr, "%f %f -> %f %f (%f,%f) pm=(%f %f)\n",
 			  catalog[i].average[j].R, 
 			  catalog[i].average[j].D, 
Index: /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/args.c
===================================================================
--- /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/args.c	(revision 32662)
+++ /branches/eam_branches/ipp-20111110/Ohana/src/relastro/src/args.c	(revision 32663)
@@ -14,4 +14,7 @@
   FIT_MODE = FIT_AVERAGE;
 
+  OBJ_ID_SRC = OBJ_ID_DST = 0;
+  CAT_ID_SRC = CAT_ID_DST = 0;
+
   if ((N = get_argument (argc, argv, "-merge-source"))) {
     if (N > argc - 6) usage_merge_source();
@@ -40,4 +43,26 @@
     remove_argument (N, &argc, argv);
     FIT_TARGET = TARGET_OBJECTS;
+  }
+
+  if ((N = get_argument (argc, argv, "-testobj1"))) {
+    if (N > argc - 3) usage ();
+    remove_argument (N, &argc, argv);
+    OBJ_ID_SRC = strtol(argv[N], &endptr, 0);
+    if (*endptr) usage ();
+    remove_argument (N, &argc, argv);
+    CAT_ID_SRC = strtol(argv[N], &endptr, 0);
+    if (*endptr) usage (); 
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-testobj2"))) {
+    if (N > argc - 3) usage ();
+    remove_argument (N, &argc, argv);
+    OBJ_ID_DST = strtol(argv[N], &endptr, 0);
+    if (*endptr) usage ();
+    remove_argument (N, &argc, argv);
+    CAT_ID_DST = strtol(argv[N], &endptr, 0);
+    if (*endptr) usage (); 
+    remove_argument (N, &argc, argv);
   }
 
