Index: trunk/Ohana/src/relphot/src/setMrelCatalog.c
===================================================================
--- trunk/Ohana/src/relphot/src/setMrelCatalog.c	(revision 37729)
+++ trunk/Ohana/src/relphot/src/setMrelCatalog.c	(revision 37740)
@@ -518,11 +518,4 @@
       haveStackObject = TRUE;
       
-      // match measurement to its image (this is just a check, right?)
-      if (getImageEntry (meas, cat) < 0) {
-	fprintf (stderr, "*** warning : this should be impossible\n");
-	abort();
-	continue;
-      }
-
       // find the PRIMARY measurement
 
@@ -543,10 +536,19 @@
       // overlaps).  we only want measurements associated with stack images in this loop
 
-      Mcal  = getMcal_alt  (meas, cat, flatcorr, measure[k].Xccd, measure[k].Yccd);
-      if (isnan(Mcal))  SKIP_THIS_MEAS_STACK(Ncal);
-      Mmos  = getMmos  (meas, cat);
-      if (isnan(Mmos))  SKIP_THIS_MEAS_STACK(Nmos);
-      Mgrid = getMgrid (meas, cat);
-      if (isnan(Mgrid)) SKIP_THIS_MEAS_STACK(Ngrid);
+      // match measurement to its image (this is just a check, right?)
+      if (getImageEntry (meas, cat) < 0) {
+	// measurements without an image are either external reference photometry or
+	// data for which the associated image has not been loaded (probably because of
+	// overlaps).  Msys + measure.Mcal is our best guess of the true magnitude
+	Mmos = Mgrid = 0;
+	Mcal = measure[k].Mcal; // check that this is zero for loaded REF value
+      } else {
+	Mcal  = getMcal_alt  (meas, cat, flatcorr, measure[k].Xccd, measure[k].Yccd);
+	if (isnan(Mcal))  SKIP_THIS_MEAS_STACK(Ncal);
+	Mmos  = getMmos  (meas, cat);
+	if (isnan(Mmos))  SKIP_THIS_MEAS_STACK(Nmos);
+	Mgrid = getMgrid (meas, cat);
+	if (isnan(Mgrid)) SKIP_THIS_MEAS_STACK(Ngrid);
+      }
 
       // NOTE: negative and insignificant vlues values are allowed, but not NAN flux values
