Index: /branches/eam_branches/ipp-20101205/Ohana/src/relastro/src/FitChip.c
===================================================================
--- /branches/eam_branches/ipp-20101205/Ohana/src/relastro/src/FitChip.c	(revision 30511)
+++ /branches/eam_branches/ipp-20101205/Ohana/src/relastro/src/FitChip.c	(revision 30512)
@@ -121,4 +121,14 @@
   GetScatterRawRef(&dLsigFull, &dMsigFull, &dRsigFull, &NstatFull, raw, ref, Nmatch, SIGMA_LIM);
   GetScatterRawRef(&dLsig, &dMsig, &dRsig, &Nstat, raw, ref, Nmatch, IMFIT_SYS_SIGMA_LIM);
+
+  int Nm = 0;
+  int Ns = 0;
+  for (i = 0; i < Nmatch; i++) {
+    if (raw[i].mask) continue;
+    Nm += raw[i].Nmeas;
+    Ns++;
+  }
+  image[0].nLinkAstrom = (Nm / Ns);
+
   if (VERBOSE) fprintf (stderr, "fit sigma: %f (%f, %f) : full: %f (%f, %f), scatter limit: %f (%d full, %d bright, %d fit, %d all) (%d %d %d %d %d)\n", dRsig, dLsig, dMsig, dRsigFull, dLsigFull, dMsigFull, dRmax, NstatFull, Nstat, fit[0].Npts, Nmatch, nMask1, nMask2, nMask3, nMask4, nMask5);
 
