Index: branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/ImageOps.c
===================================================================
--- branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/ImageOps.c	(revision 31547)
+++ branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/ImageOps.c	(revision 31552)
@@ -353,4 +353,6 @@
     
     liststats (list, dlist, N, &stats);
+
+    float CLOUD_TOLERANCE = 0.01;
     image[i].Mcal  = stats.mean;
     image[i].dMcal = stats.error;
@@ -358,4 +360,8 @@
     image[i].nFitPhotom = N;
     image[i].Xm    = 100.0*log10(stats.chisq);
+
+    if (image[i].Mcal < -CLOUD_TOLERANCE) {
+      image[i].Mcal = 0.0;
+    }
   }
   free (list);
Index: branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/MosaicOps.c
===================================================================
--- branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/MosaicOps.c	(revision 31547)
+++ branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/MosaicOps.c	(revision 31552)
@@ -197,8 +197,10 @@
   image = getimages (&Nimage, NULL);
 
+  // copy the mosaic results to the images.  set the mosaic Mcal to 0.0 since we have moved its
+  // impact to the images
   for (i = 0; i < Nmosaic; i++) {
     for (j = 0; j < Nimlist[i]; j++) {
       im = imlist[i][j];
-      image[im].Mcal = mosaic[i].Mcal;
+      image[im].Mcal += mosaic[i].Mcal;
       image[im].dMcal = mosaic[i].dMcal;
       image[im].Xm = mosaic[i].Xm;
@@ -208,4 +210,5 @@
       image[im].flags |= (mosaic[i].flags & ID_IMAGE_PHOTOM_POOR);
     }
+    mosaic[i].Mcal = 0.0;
   }      
 }
@@ -448,4 +451,6 @@
     liststats (list, dlist, N, &stats);
     if (PoorImages) fprintf (stderr, "Mmos: %f %f %d "OFF_T_FMT"\n", stats.mean, stats.sigma, stats.Nmeas,  N);
+
+    float CLOUD_TOLERANCE = 0.01;
     mosaic[i].Mcal  = stats.mean;
     mosaic[i].dMcal = stats.error;
@@ -453,4 +458,8 @@
     mosaic[i].nFitPhotom = N;
     mosaic[i].Xm    = 100.0*log10(stats.chisq);
+
+    if (mosaic[i].Mcal < -CLOUD_TOLERANCE) {
+      mosaic[i].Mcal = 0.0;
+    }
   }
   free (list);
Index: branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/relphot.c
===================================================================
--- branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/relphot.c	(revision 31547)
+++ branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/relphot.c	(revision 31552)
@@ -123,5 +123,5 @@
       plot_chisq (catalog, Ncatalog);
     }
-    if (i % 6 == 1) rationalize_mosaics (catalog, Ncatalog);
+    // if (i < NLOOP - 1) rationalize_mosaics (catalog, Ncatalog);
     // if (i % 6 == 1) rationalize_images ();
     if (i % 6 == 2) clean_measures (catalog, Ncatalog, FALSE); 
