Index: trunk/psModules/src/imcombine/pmImageCombine.c
===================================================================
--- trunk/psModules/src/imcombine/pmImageCombine.c	(revision 6325)
+++ trunk/psModules/src/imcombine/pmImageCombine.c	(revision 6511)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-12-08 00:29:53 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-03-04 01:01:33 $
  *
  *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
@@ -113,4 +113,5 @@
     if (*questionablePixels == NULL) {
         *questionablePixels = psArrayAlloc(numImages);
+        (*questionablePixels)->n = numImages;
     } else if ((*questionablePixels)->n != numImages) {
         *questionablePixels = psArrayRealloc(*questionablePixels, numImages);
@@ -118,5 +119,6 @@
     for (psS32 im = 0 ; im < numImages ; im++) {
         psFree((*questionablePixels)->data[im]);
-        ((*questionablePixels)->data[im]) = (psPtr *) psPixelsAlloc(PS_COMBINE_IMAGE_INITIAL_PIXEL_LIST_LENGTH);
+        ((*questionablePixels)->data[im]) =
+            (psPtr *) psPixelsAlloc(PS_COMBINE_IMAGE_INITIAL_PIXEL_LIST_LENGTH);
         ((psPixels *) ((*questionablePixels)->data[im]))->n = 0;
     }
@@ -126,5 +128,5 @@
     psVector *qpPtr = psVectorAlloc(numImages, PS_TYPE_S32);
     PS_VECTOR_SET_S32(qpPtr, 0);
-
+    qpPtr->n = numImages;
     //
     // Allocate the necessary psVectors for the call to psVectorStats().
@@ -133,9 +135,10 @@
     //
     psVector *pixelData = psVectorAlloc(numImages, PS_TYPE_F32);
-
+    pixelData->n = pixelData->nalloc;
     psVector *pixelMask = NULL;
     if (masks != NULL) {
         pixelMask = psVectorAlloc(numImages, PS_TYPE_U8);
         PS_VECTOR_SET_U8(pixelMask, 0);
+        pixelMask->n = numImages;
     }
 
@@ -144,4 +147,5 @@
         pixelErrors = psVectorAlloc(numImages, PS_TYPE_F32);
         PS_VECTOR_SET_F32(pixelErrors, 1.0);
+        pixelErrors->n = numImages;
     }
 
@@ -320,4 +324,6 @@
     psVector *pixels = psVectorAlloc(8, PS_TYPE_F32); // Array of pixels
     psVector *mask = psVectorAlloc(8, PS_TYPE_U8); // Corresponding mask
+    pixels->n = 8;
+    mask->n = 8;
 
     // Get limits
@@ -536,6 +542,8 @@
     //
     psArray *rejects = psArrayAlloc(numImages);
+    rejects->n = numImages;
     for (psS32 im = 0 ; im < numImages ; im++) {
         rejects->data[im] = (psPtr *) psPixelsAlloc(PS_REJECT_PIXEL_INITIAL_PIXEL_LIST_LENGTH);
+        ((psPixels *)(rejects->data[im]))->n = ((psPixels *)(rejects->data[im]))->nalloc;
         psPixels *pixels = (psPixels *) rejects->data[im];
         pixels->n = 0;
@@ -546,4 +554,5 @@
     psVector *rPtr = psVectorAlloc(numImages, PS_TYPE_S32);
     PS_VECTOR_SET_S32(rPtr, 0);
+    rPtr->n = numImages;
 
     psS32 numCols = ((psImage *) images->data[0])->numCols;
Index: trunk/psModules/src/imcombine/pmReadoutCombine.c
===================================================================
--- trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 6325)
+++ trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 6511)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-06 21:03:25 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-03-04 01:01:33 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -176,11 +176,19 @@
 
     psVector *tmpPixels = psVectorAlloc(numInputs, PS_TYPE_F32);
+    tmpPixels->n = tmpPixels->nalloc;
     psVector *tmpPixelErrors = psVectorAlloc(numInputs, PS_TYPE_F32);
+    tmpPixelErrors->n = tmpPixelErrors->nalloc;
     psVector *tmpPixelMask = psVectorAlloc(numInputs, PS_TYPE_U8);
+    tmpPixelMask->n = tmpPixelMask->nalloc;
     psVector *tmpPixelMaskNKeep = psVectorAlloc(numInputs, PS_TYPE_U8);
+    tmpPixelMaskNKeep->n = tmpPixelMaskNKeep->nalloc;
     psVector *outRowLower = psVectorAlloc(numInputs, PS_TYPE_U32);
+    outRowLower->n = outRowLower->nalloc;
     psVector *outRowUpper = psVectorAlloc(numInputs, PS_TYPE_U32);
+    outRowUpper->n = outRowUpper->nalloc;
     psVector *outColLower = psVectorAlloc(numInputs, PS_TYPE_U32);
+    outColLower->n = outColLower->nalloc;
     psVector *outColUpper = psVectorAlloc(numInputs, PS_TYPE_U32);
+    outColUpper->n = outColUpper->nalloc;
     pmReadout **tmpReadouts = (pmReadout **) psAlloc(numInputs * sizeof(pmReadout *));
 
@@ -414,4 +422,5 @@
     psStats *diffStats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN);
     psVector *diffs = psVectorAlloc(fringePoints->n, PS_TYPE_F32);
+    diffs->n = diffs->nalloc;
 
     //
@@ -517,6 +526,8 @@
     psVector *localChipGains = chipGains;
     if (numChips != chipGains->n) {
-        psLogMsg(__func__, PS_LOG_WARN, "WARNING: the chipGains vector length does not match the number of chips.\n");
+        psLogMsg(__func__, PS_LOG_WARN,
+                 "WARNING: the chipGains vector length does not match the number of chips.\n");
         localChipGains = psVectorAlloc(numChips, PS_TYPE_F64);
+        localChipGains->n = localChipGains->nalloc;
         psBool rc = psVectorInit(localChipGains, 1.0);
         if (rc == false) {
@@ -531,4 +542,5 @@
     psBool meanFlag = false;
     psVector *chipGainsMask = psVectorAlloc(chipGains->n, PS_TYPE_U8);
+    chipGainsMask->n = chipGainsMask->nalloc;
     for (psS32 i = 0 ; i < chipGains->n ; i++) {
         if ((fabs(chipGains->data.F64[i]) < FLT_EPSILON) ||
