Index: trunk/ppTranslate/src/ppMopsWrite.c
===================================================================
--- trunk/ppTranslate/src/ppMopsWrite.c	(revision 34474)
+++ trunk/ppTranslate/src/ppMopsWrite.c	(revision 34486)
@@ -41,5 +41,4 @@
   // seeings
   ppMopsDetections *det = NULL;
-  int validSeeingCount = 0;
   for (int d = 0; d < detections->n; d++) {
     if (detections->data[d] != NULL) {
@@ -47,21 +46,17 @@
         det = detections->data[d];
       }
-      if (isfinite(((ppMopsDetections*) detections->data[d])->seeing)) {
-        validSeeingCount += 1;
-      }
-    }
-  }
+    }
+  }
+  //Get the SEEING weighted mean
+  float seeing = 0.;
+  int totalGood = 0;
+  for (int d = 0; d < detections->n; d++) {
+    if ( (detections->data[d] != NULL) && (isfinite(((ppMopsDetections*) detections->data[d])->seeing)) ) {
+      seeing += (((ppMopsDetections*) detections->data[d])->seeing)*((float) (((ppMopsDetections*) detections->data[d])->numGood));
+      totalGood += (((ppMopsDetections*) detections->data[d])->numGood);
+    }
+  }
+  seeing /= (float) totalGood;
   if (det != NULL) {
-    //Get the SEEING median
-    psVector* seeingValues = psVectorAlloc(validSeeingCount, PS_TYPE_F32);
-    psVectorInit(seeingValues, NAN);
-    validSeeingCount = 0;
-    for (int d = 0; d < detections->n; d++) {
-      if ( (detections->data[d] != NULL) && (isfinite(((ppMopsDetections*) detections->data[d])->seeing)) ){
-        seeingValues->data.F32[validSeeingCount++] = ((ppMopsDetections*) detections->data[d])->seeing;
-      }
-    }
-    psStats *seeingStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN);
-    psVectorStats(seeingStats, seeingValues, NULL, NULL, 0);
     psMetadataAddF64(header, PS_LIST_TAIL, "MJD-OBS", 0, "MJD of exposure midpoint", det->mjd);
     psMetadataAddStr(header, PS_LIST_TAIL, "RA", 0, "Right Ascension of boresight", det->raBoresight);
@@ -73,7 +68,7 @@
     psMetadataAddStr(header, PS_LIST_TAIL, "FILTER", 0, "Filter name", det->filter);
     psMetadataAddF32(header, PS_LIST_TAIL, "AIRMASS", 0, "Airmass of exposure", det->airmass);
-    psMetadataAddF32(header, PS_LIST_TAIL, "SEEING", 0, "Mean seeing", seeingStats->sampleMedian);
+    psMetadataAddF32(header, PS_LIST_TAIL, "SEEING", 0, "Mean seeing", seeing);
     //MOPS want the name FWHM for SEEING
-    psMetadataAddF32(header, PS_LIST_TAIL, "FWHM", 0, "Mean seeing", det->seeing);
+    psMetadataAddF32(header, PS_LIST_TAIL, "FWHM", 0, "Mean seeing", seeing);
   } else {
     psWarning("no inputs with surviving detections. output header will be incomplete");
