Index: trunk/psModules/src/astrom/pmAstrometryDistortion.c
===================================================================
--- trunk/psModules/src/astrom/pmAstrometryDistortion.c	(revision 9724)
+++ trunk/psModules/src/astrom/pmAstrometryDistortion.c	(revision 9730)
@@ -7,6 +7,6 @@
 *  @author EAM, IfA
 *
-*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-09-15 09:49:01 $
+*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-24 22:55:04 $
 *
 *  Copyright 2006 Institute for Astronomy, University of Hawaii
@@ -54,5 +54,5 @@
 
     if (grads == NULL) {
-        grads = psArrayAlloc (100);
+        grads = psArrayAllocEmpty (100);
     }
 
@@ -76,8 +76,8 @@
             int Ymax = Ymin + DY;
 
-            psVector *L  = psVectorAlloc (100, PS_TYPE_F32);
-            psVector *M  = psVectorAlloc (100, PS_TYPE_F32);
-            psVector *dP = psVectorAlloc (100, PS_TYPE_F32);
-            psVector *dQ = psVectorAlloc (100, PS_TYPE_F32);
+            psVector *L  = psVectorAllocEmpty (100, PS_TYPE_F32);
+            psVector *M  = psVectorAllocEmpty (100, PS_TYPE_F32);
+            psVector *dP = psVectorAllocEmpty (100, PS_TYPE_F32);
+            psVector *dQ = psVectorAllocEmpty (100, PS_TYPE_F32);
             int Npts = 0;
 
@@ -121,5 +121,4 @@
             psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
             psVector *mask = psVectorAlloc (Npts, PS_TYPE_MASK);
-            mask->n = Npts;
             psVectorInit (mask, 0);
 
@@ -175,10 +174,7 @@
         M->data.F32[i] = grad->FP.y;
     }
-    dPdL->n = dQdL->n = dPdM->n = dQdM->n = grads->n;
-    L->n = M->n = grads->n;
 
     psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
     psVector *mask = psVectorAlloc (grads->n, PS_TYPE_MASK);
-    mask->n = grads->n;
     psVectorInit (mask, 0);
 
Index: trunk/psModules/src/astrom/pmAstrometryObjects.c
===================================================================
--- trunk/psModules/src/astrom/pmAstrometryObjects.c	(revision 9724)
+++ trunk/psModules/src/astrom/pmAstrometryObjects.c	(revision 9730)
@@ -8,6 +8,6 @@
 *  @author EAM, IfA
 *
-*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-10-19 02:56:40 $
+*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-24 22:55:04 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -76,6 +76,5 @@
                             const double RADIUS) // matching radius
 {
-    psArray *matches = psArrayAlloc(x1->n);
-    matches->n = 0;
+    psArray *matches = psArrayAllocEmpty(x1->n);
 
     const double RADIUS_SQR = PS_SQR(RADIUS);
@@ -144,6 +143,4 @@
     /* sort both lists by X coord; st1 first */ \
     psVector *x1 = psVectorAlloc(st1->n, PS_TYPE_F64); \
-    \
-    x1->n = x1->nalloc; \
     for (int i = 0; i < st1->n; i++) { \
         x1->data.F64[i] = ((pmAstromObj *)st1->data[i])->MEMBER->x; \
@@ -153,5 +150,4 @@
     \
     psVector *y1 = psVectorAlloc(st1->n, PS_TYPE_F64); \
-    y1->n = y1->nalloc; \
     for (int i = 0; i < st1->n; i++) { \
         x1->data.F64[i] = ((pmAstromObj *)st1->data[sorted1->data.S32[i]])->MEMBER->x; \
@@ -161,5 +157,4 @@
     /* now st2 */ \
     psVector *x2 = psVectorAlloc(st2->n, PS_TYPE_F64); \
-    x2->n = x2->nalloc; \
     for (int i = 0; i < st2->n; i++) { \
         x2->data.F64[i] = ((pmAstromObj *)st2->data[i])->MEMBER->x; \
@@ -168,5 +163,4 @@
     \
     psVector *y2 = psVectorAlloc(st2->n, PS_TYPE_F64); \
-    y2->n = y2->nalloc; \
     for (int i = 0; i < st2->n; i++) { \
         x2->data.F64[i] = ((pmAstromObj *)st2->data[sorted2->data.S32[i]])->MEMBER->x; \
@@ -236,9 +230,4 @@
     psVector *y = psVectorAlloc (match->n, PS_TYPE_F32);
     psVector *wt = psVectorAlloc (match->n, PS_TYPE_F32);
-    X->n = X->nalloc;
-    Y->n = Y->nalloc;
-    x->n = x->nalloc;
-    y->n = y->nalloc;
-    wt->n = wt->nalloc;
     // take the matched stars, first fit
     for (int i = 0; i < match->n; i++) {
@@ -259,5 +248,4 @@
     // constant errors
     psVector *mask = psVectorAlloc (match->n, PS_TYPE_U8);
-    mask->n = match->n;
     psVectorInit (mask, 0);
 
@@ -352,5 +340,4 @@
 
     psArray *new = psArrayAlloc (old->n);
-    new->n = new->nalloc;
     double cs = cos(angle);
     double sn = sin(angle);
@@ -659,5 +646,4 @@
     // sort the NP values and choose
     psVector *listNP = psVectorAlloc (nPix*nPix, PS_TYPE_U32);
-    listNP->n = nPix*nPix;
     int n = 0;
     for (int i = 0; i < nPix; i++) {
@@ -780,5 +766,4 @@
     psVector *xHist = psVectorAlloc (nBin, PS_TYPE_F32);
     psVector *yHist = psVectorAlloc (nBin, PS_TYPE_F32);
-    xHist->n = yHist->n = nBin;
     psVectorInit (xHist, 0);
     psVectorInit (yHist, 0);
Index: trunk/psModules/src/camera/pmFPAConstruct.c
===================================================================
--- trunk/psModules/src/camera/pmFPAConstruct.c	(revision 9724)
+++ trunk/psModules/src/camera/pmFPAConstruct.c	(revision 9730)
@@ -61,5 +61,4 @@
     *second = psArrayAlloc(values->n);
     *third = psArrayAlloc(values->n);
-    (*first)->n = (*second)->n = (*third)->n = values->n;
     int num = 0;
     psListIterator *valuesIter = psListIteratorAlloc(values, PS_LIST_HEAD, false); // Iterator for values
Index: trunk/psModules/src/camera/pmFPAMaskWeight.c
===================================================================
--- trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 9724)
+++ trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 9730)
@@ -29,5 +29,4 @@
     if (!masks) {
         masks = psArrayAlloc(images->n);
-        masks->n = images->n;
         hdu->masks = masks;
     }
@@ -56,5 +55,4 @@
     if (!weights) {
         weights = psArrayAlloc(images->n);
-        weights->n = images->n;
         hdu->weights = weights;
     }
Index: trunk/psModules/src/camera/pmHDUGenerate.c
===================================================================
--- trunk/psModules/src/camera/pmHDUGenerate.c	(revision 9724)
+++ trunk/psModules/src/camera/pmHDUGenerate.c	(revision 9730)
@@ -294,5 +294,4 @@
     // Generate the HDU
     hdu->images = psArrayAlloc(numReadouts);
-    hdu->images->n = numReadouts;
     for (int i = 0; i < numReadouts; i++) {
         psImage *image = psImageAlloc(xSize, ySize, type);
Index: trunk/psModules/src/concepts/pmConceptsWrite.c
===================================================================
--- trunk/psModules/src/concepts/pmConceptsWrite.c	(revision 9724)
+++ trunk/psModules/src/concepts/pmConceptsWrite.c	(revision 9730)
@@ -51,5 +51,4 @@
         }
         psVector *match = psVectorAlloc(cList->n, PS_TYPE_U8); // Array indicating which values match
-        match->n = cList->n;
         psVectorInit(match, 0);
         psListIterator *cIter = psListIteratorAlloc(cList, PS_LIST_HEAD, false); // compare iterator
Index: trunk/psModules/src/config/pmConfig.c
===================================================================
--- trunk/psModules/src/config/pmConfig.c	(revision 9724)
+++ trunk/psModules/src/config/pmConfig.c	(revision 9730)
@@ -4,6 +4,6 @@
  *  @author EAM (IfA)
  *
- *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-17 01:25:22 $
+ *  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -883,6 +883,5 @@
 
     // we load all input files onto a psArray, to be parsed later
-    psArray *input = psArrayAlloc (16);
-    input->n = 0;
+    psArray *input = psArrayAllocEmpty(16);
 
     // load the list of filenames the supplied file
Index: trunk/psModules/src/detrend/pmFlatNormalize.c
===================================================================
--- trunk/psModules/src/detrend/pmFlatNormalize.c	(revision 9724)
+++ trunk/psModules/src/detrend/pmFlatNormalize.c	(revision 9730)
@@ -32,10 +32,8 @@
         } else {
             *expFluxesPtr = psVectorAlloc(numExps, PS_TYPE_F32);
-            (*expFluxesPtr)->n = numExps;
         }
         expFluxes = psMemIncrRefCounter(*expFluxesPtr);
     } else {
         expFluxes = psVectorAlloc(numExps, PS_TYPE_F32);
-        expFluxes->n = numExps;
     }
 
@@ -47,5 +45,4 @@
         } else {
             *chipGainsPtr = psVectorAlloc(numChips, PS_TYPE_F32);
-            (*chipGainsPtr)->n = numChips;
             psVectorInit(*chipGainsPtr, 1.0);
         }
@@ -53,5 +50,4 @@
     } else {
         chipGains = psVectorAlloc(numChips, PS_TYPE_F32);
-        chipGains->n = numChips;
         psVectorInit(chipGains, 1.0);
     }
@@ -62,8 +58,6 @@
     psImageInit(fluxMask, 0);
     psVector *gainMask = psVectorAlloc(numChips, PS_TYPE_U8); // Mask for bad gains
-    gainMask->n = numChips;
     psVectorInit(gainMask, 0);
     psVector *expMask = psVectorAlloc(numExps, PS_TYPE_U8); // Mask for bad exposures
-    expMask->n = numExps;
     psVectorInit(expMask, 0);
     for (int i = 0; i < numChips; i++) {
Index: trunk/psModules/src/detrend/pmFringeStats.c
===================================================================
--- trunk/psModules/src/detrend/pmFringeStats.c	(revision 9724)
+++ trunk/psModules/src/detrend/pmFringeStats.c	(revision 9730)
@@ -133,5 +133,4 @@
 
     psArray *table = psArrayAlloc(numRows); // The table
-    table->n = numRows;
     // Translate the vectors into the required format for psFitsWriteTable()
     for (long i = 0; i < numRows; i++) {
@@ -205,5 +204,4 @@
     psVector *y = psVectorAlloc(numRows, PS_TYPE_F32); // y position
     psVector *mask = psVectorAlloc(numRows, PS_TYPE_U8); // mask
-    x->n = y->n = mask->n = numRows;
     regions->x = x;
     regions->y = y;
@@ -253,5 +251,4 @@
     stats->f = psVectorAlloc(numRegions, PS_TYPE_F32);
     stats->df = psVectorAlloc(numRegions, PS_TYPE_F32);
-    stats->f->n = stats->df->n = numRegions;
 
     return stats;
@@ -365,5 +362,4 @@
     // Vectors: f, df
     psArray *table = psArrayAlloc(numRows); // The table
-    table->n = numRows;
     // Translate the vectors into the required format for psFitsWriteTable()
     for (long i = 0; i < numRows; i++) {
@@ -527,6 +523,4 @@
     scale->coeff = psVectorAlloc(nFringeFrames + 1, PS_TYPE_F32);
     scale->coeffErr = psVectorAlloc(nFringeFrames + 1, PS_TYPE_F32);
-    scale->coeff->n = nFringeFrames + 1;
-    scale->coeff->n = nFringeFrames + 1;
 
     return scale;
@@ -551,5 +545,4 @@
     psImage *A = psImageAlloc(numCoeffs, numCoeffs, PS_TYPE_F64); // The least-squares matrix
     psVector *B = psVectorAlloc(numCoeffs, PS_TYPE_F64); // The least-squares vector
-    B->n = numCoeffs;
 
     // Generate the least-squares matrix and vector
@@ -718,5 +711,4 @@
     if (!regions->mask) {
         regions->mask = psVectorAlloc(numRegions, PS_TYPE_U8);
-        regions->mask->n = numRegions;
         psVectorInit(regions->mask, 0);
     }
@@ -725,5 +717,4 @@
     unsigned int numClipped = 0;        // Total number clipped
     psVector *diff = psVectorAlloc(numRegions, PS_TYPE_F32); // The differences between obs. and pred.
-    diff->n = numRegions;
 
     pmFringeScale *scale = pmFringeScaleAlloc(fringes->n); // The fringe scales
Index: trunk/psModules/src/detrend/pmShutterCorrection.c
===================================================================
--- trunk/psModules/src/detrend/pmShutterCorrection.c	(revision 9724)
+++ trunk/psModules/src/detrend/pmShutterCorrection.c	(revision 9730)
@@ -104,5 +104,4 @@
     psVector *tmpX = psVectorAlloc(2, PS_TYPE_F32);
     psVector *tmpY = psVectorAlloc(2, PS_TYPE_F32);
-    tmpX->n = tmpY->n = 2;
 
     long index;
@@ -210,5 +209,4 @@
     psVector *x = psVectorAlloc(exptime->n, PS_TYPE_F32);
     psVector *y = psVectorAlloc(exptime->n, PS_TYPE_F32);
-    x->n = y->n = exptime->n;
 
     for (long i = 0; i < exptime->n; i++) {
@@ -301,5 +299,4 @@
     params->data.F32[1] = guess->offset;
     params->data.F32[2] = guess->offref;
-    params->n = 3;
 
     // XXX for the moment, don't set any constraints
@@ -317,9 +314,7 @@
     // construct the coordinate and value entries (y is counts)
     psArray *x = psArrayAlloc(exptime->n); // Coordinates
-    x->n = exptime->n;
 
     for (long i = 0; i < exptime->n; i++) {
         psVector *coord = psVectorAlloc(1, PS_TYPE_F32);
-        coord->n = 1;
         coord->data.F32[0] = exptime->data.F32[i];
         x->data[i] = coord;
@@ -371,8 +366,6 @@
     psRegion refRegion;                 // Reference region
     psVector *refs = psVectorAlloc(num, PS_TYPE_F32); // Reference measurements
-    refs->n = num;
     psVectorInit(refs, 0);
     psArray *regions = psArrayAlloc(MEASURE_SAMPLES); // Array of sample regions, made on each image
-    regions->n = MEASURE_SAMPLES;
     psImage *samplesMean = psImageAlloc(num, MEASURE_SAMPLES, PS_TYPE_F32); // Measurements for each file
     psImage *samplesStdev = psImageAlloc(num, MEASURE_SAMPLES, PS_TYPE_F32); // Errors for each file
@@ -505,5 +498,4 @@
     psImage *pattern = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Illumination pattern
     psVector *mask = psVectorAlloc(num, PS_TYPE_U8); // Mask for each image
-    mask->n = num;
     psVectorInit(mask, 0);
     psTrace("psModules.detrend", 2, "Performing linear fit on individual pixels...\n");
Index: trunk/psModules/src/detrend/pmSubtractBias.c
===================================================================
--- trunk/psModules/src/detrend/pmSubtractBias.c	(revision 9724)
+++ trunk/psModules/src/detrend/pmSubtractBias.c	(revision 9730)
@@ -129,5 +129,4 @@
     psVector *ordinate = psVectorAlloc(pixels->n, PS_TYPE_F32); // Ordinate
     psVector *mask = psVectorAlloc(pixels->n, PS_TYPE_U8); // Mask for fitting
-    reduced->n = ordinate->n = mask->n = pixels->n;
 
     for (int i = 0; i < pixels->n; i++) {
@@ -268,5 +267,4 @@
                 // The read direction is rows
                 psArray *pixels = psArrayAlloc(image->numRows); // Array of vectors containing pixels
-                pixels->n = image->numRows;
                 for (int i = 0; i < pixels->n; i++) {
                     psVector *values = psVectorAlloc(0, PS_TYPE_F32);
@@ -312,5 +310,4 @@
                 // The read direction is columns
                 psArray *pixels = psArrayAlloc(image->numCols); // Array of vectors containing pixels
-                pixels->n = image->numCols;
                 for (int i = 0; i < pixels->n; i++) {
                     psVector *values = psVectorAlloc(0, PS_TYPE_F32);
Index: trunk/psModules/src/detrend/pmSubtractSky.c
===================================================================
--- trunk/psModules/src/detrend/pmSubtractSky.c	(revision 9724)
+++ trunk/psModules/src/detrend/pmSubtractSky.c	(revision 9730)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-13 22:11:02 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -345,5 +345,4 @@
     psImage *Aout = psImageAlloc(localPolyTerms, localPolyTerms, PS_TYPE_F64);
     psVector *B = psVectorAlloc(localPolyTerms, PS_TYPE_F64);
-    B->n = B->nalloc;
     psVector *outPerm = NULL;
 
@@ -412,5 +411,4 @@
     PS_ASSERT_IMAGE_NON_EMPTY(Aout, NULL);
     psVector *C = psVectorAlloc(localPolyTerms, PS_TYPE_F64);
-    C->n = C->nalloc;
     psMatrixLUSolve(C, Aout, B, outPerm);
 
Index: trunk/psModules/src/imcombine/pmImageCombine.c
===================================================================
--- trunk/psModules/src/imcombine/pmImageCombine.c	(revision 9724)
+++ trunk/psModules/src/imcombine/pmImageCombine.c	(revision 9730)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
@@ -122,5 +122,4 @@
     if (*questionablePixels == NULL) {
         *questionablePixels = psArrayAlloc(numImages);
-        (*questionablePixels)->n = numImages;
     } else if ((*questionablePixels)->n != numImages) {
         *questionablePixels = psArrayRealloc(*questionablePixels, numImages);
@@ -137,5 +136,4 @@
     psVector *qpPtr = psVectorAlloc(numImages, PS_TYPE_S32);
     psVectorInit(qpPtr, 0);
-    qpPtr->n = numImages;
     //
     // Allocate the necessary psVectors for the call to psVectorStats().
@@ -144,10 +142,8 @@
     //
     psVector *pixelData = psVectorAlloc(numImages, PS_TYPE_F32);
-    pixelData->n = pixelData->nalloc;
     psVector *pixelMask = NULL;
     if (masks != NULL) {
         pixelMask = psVectorAlloc(numImages, PS_TYPE_U8);
         psVectorInit(pixelMask, 0);
-        pixelMask->n = numImages;
     }
 
@@ -156,5 +152,4 @@
         pixelErrors = psVectorAlloc(numImages, PS_TYPE_F32);
         psVectorInit(pixelErrors, 1.0);
-        pixelErrors->n = numImages;
     }
 
@@ -320,6 +315,4 @@
     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
@@ -538,5 +531,4 @@
     //
     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);
@@ -550,5 +542,4 @@
     psVector *rPtr = psVectorAlloc(numImages, PS_TYPE_S32);
     psVectorInit(rPtr, 0);
-    rPtr->n = numImages;
 
     psS32 numCols = ((psImage *) images->data[0])->numCols;
Index: trunk/psModules/src/imcombine/pmImageSubtract.c
===================================================================
--- trunk/psModules/src/imcombine/pmImageSubtract.c	(revision 9724)
+++ trunk/psModules/src/imcombine/pmImageSubtract.c	(revision 9730)
@@ -7,6 +7,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -122,11 +122,7 @@
     tmp->u = psVectorAlloc(nBF, PS_TYPE_F32);
     tmp->v = psVectorAlloc(nBF, PS_TYPE_F32);
-    tmp->u->n = tmp->u->nalloc;
-    tmp->v->n = tmp->v->nalloc;
     tmp->sigma = NULL;
     tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32);
-    tmp->xOrder->n = tmp->xOrder->nalloc;
     tmp->yOrder = psVectorAlloc(nBF, PS_TYPE_F32);
-    tmp->yOrder->n = tmp->yOrder->nalloc;
     tmp->subIndex = 0;
     tmp->preCalc = NULL;
@@ -223,6 +219,4 @@
     tmp->u = psVectorAlloc(nBF, PS_TYPE_F32);
     tmp->v = psVectorAlloc(nBF, PS_TYPE_F32);
-    tmp->u->n = tmp->u->nalloc;
-    tmp->v->n = tmp->v->nalloc;
     tmp->sigma = psVectorAlloc(nBF, PS_TYPE_F32);
     tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32);
@@ -232,10 +226,4 @@
     tmp->spatialOrder = spatialOrder;
     tmp->preCalc = psArrayAlloc(nBF);
-    tmp->u->n = tmp->u->nalloc;
-    tmp->v->n = tmp->v->nalloc;
-    tmp->sigma->n = tmp->sigma->nalloc;
-    tmp->xOrder->n = tmp->xOrder->nalloc;
-    tmp->yOrder->n = tmp->yOrder->nalloc;
-    tmp->preCalc->n = tmp->preCalc->nalloc;
 
     //
@@ -367,5 +355,4 @@
     } else {
         stamps = (psArray *) psArrayAlloc(xNum * yNum);
-        stamps->n = stamps->nalloc;
         for (psS32 s = 0 ; s < (xNum * yNum) ; s++) {
             stamps->data[s] = (psPtr *) p_pmStampAlloc(PM_STAMP_REJECTED);
@@ -826,5 +813,4 @@
             if (stampVector == NULL) {
                 stampVector = psVectorAlloc(numSolveParams, PS_TYPE_F64);
-                stampVector->n = stampVector->nalloc;
                 stamp->vector = stampVector;
             } else {
@@ -1045,5 +1031,4 @@
     } else {
         solution = psVectorAlloc(size, PS_TYPE_F64);
-        solution->n = solution->nalloc;
     }
 
@@ -1057,5 +1042,4 @@
     psImage *sumMatrix = psImageAlloc(size, size, PS_TYPE_F64);
     psVector *sumVector = psVectorAlloc(size, PS_TYPE_F64);
-    sumVector->n = sumVector->nalloc;
     psVectorInit(sumVector, 0.0);
     psImageInit(sumMatrix, 0.0);
@@ -1150,5 +1134,4 @@
     } else {
         deviations = psVectorAlloc(stamps->n, PS_TYPE_F32);
-        deviations->n = deviations->nalloc;
         // XXX: Probably not necessary.
         psVectorInit(deviations, 0.0);
Index: trunk/psModules/src/imcombine/pmReadoutCombine.c
===================================================================
--- trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 9724)
+++ trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 9730)
@@ -201,9 +201,7 @@
 
     psVector *pixels = psVectorAlloc(inputs->n, PS_TYPE_F32); // Stack of pixels
-    pixels->n = inputs->n;
     psF32 *pixelsData = pixels->data.F32; // Dereference pixels
 
     psVector *mask   = psVectorAlloc(inputs->n, PS_TYPE_U8); // Mask for stack
-    mask->n = inputs->n;
     psU8 *maskData = mask->data.U8;     // Dereference mask
 
@@ -212,5 +210,4 @@
     if (haveWeights) {
         weights = psVectorAlloc(inputs->n, PS_TYPE_F32); // Stack of weights
-        weights->n = inputs->n;
         weightsData = weights->data.F32;
     }
Index: trunk/psModules/src/objects/models/pmModel_GAUSS.c
===================================================================
--- trunk/psModules/src/objects/models/pmModel_GAUSS.c	(revision 9724)
+++ trunk/psModules/src/objects/models/pmModel_GAUSS.c	(revision 9730)
@@ -45,7 +45,4 @@
     *params_min = psVectorAlloc (7, PS_TYPE_F32);
     *params_max = psVectorAlloc (7, PS_TYPE_F32);
-    (*beta_lim)->n = (*beta_lim)->nalloc;
-    (*params_min)->n = (*params_min)->nalloc;
-    (*params_max)->n = (*params_max)->nalloc;
 
     beta_lim[0][0].data.F32[PM_PAR_SKY] = 1000;
Index: trunk/psModules/src/objects/models/pmModel_PGAUSS.c
===================================================================
--- trunk/psModules/src/objects/models/pmModel_PGAUSS.c	(revision 9724)
+++ trunk/psModules/src/objects/models/pmModel_PGAUSS.c	(revision 9730)
@@ -48,7 +48,4 @@
     *params_min = psVectorAlloc (7, PS_TYPE_F32);
     *params_max = psVectorAlloc (7, PS_TYPE_F32);
-    (*beta_lim)->n = (*beta_lim)->nalloc;
-    (*params_min)->n = (*params_min)->nalloc;
-    (*params_max)->n = (*params_max)->nalloc;
 
     beta_lim[0][0].data.F32[0] = 1000;
Index: trunk/psModules/src/objects/models/pmModel_QGAUSS.c
===================================================================
--- trunk/psModules/src/objects/models/pmModel_QGAUSS.c	(revision 9724)
+++ trunk/psModules/src/objects/models/pmModel_QGAUSS.c	(revision 9730)
@@ -63,7 +63,4 @@
     *params_min = psVectorAlloc (8, PS_TYPE_F32);
     *params_max = psVectorAlloc (8, PS_TYPE_F32);
-    (*beta_lim)->n = (*beta_lim)->nalloc;
-    (*params_min)->n = (*params_min)->nalloc;
-    (*params_max)->n = (*params_max)->nalloc;
 
     beta_lim[0][0].data.F32[PM_PAR_SKY] = 1000;
Index: trunk/psModules/src/objects/models/pmModel_SGAUSS.c
===================================================================
--- trunk/psModules/src/objects/models/pmModel_SGAUSS.c	(revision 9724)
+++ trunk/psModules/src/objects/models/pmModel_SGAUSS.c	(revision 9730)
@@ -67,7 +67,4 @@
     *params_min = psVectorAlloc (9, PS_TYPE_F32);
     *params_max = psVectorAlloc (9, PS_TYPE_F32);
-    (*beta_lim)->n = (*beta_lim)->nalloc;
-    (*params_min)->n = (*params_min)->nalloc;
-    (*params_max)->n = (*params_max)->nalloc;
 
     beta_lim[0][0].data.F32[0] = 1000;
Index: trunk/psModules/src/objects/pmGrowthCurve.c
===================================================================
--- trunk/psModules/src/objects/pmGrowthCurve.c	(revision 9724)
+++ trunk/psModules/src/objects/pmGrowthCurve.c	(revision 9730)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-22 21:35:34 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -40,5 +40,4 @@
     growth->radius = psVectorCreate (NULL, minRadius, maxRadius, 1.0, PS_TYPE_F32);
     growth->apMag  = psVectorAlloc (growth->radius->n, PS_TYPE_F32);
-    growth->apMag->n = growth->radius->n;
 
     // XXX may want to extend this to allow for a different refRadius;
Index: trunk/psModules/src/objects/pmModel.c
===================================================================
--- trunk/psModules/src/objects/pmModel.c	(revision 9724)
+++ trunk/psModules/src/objects/pmModel.c	(revision 9730)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-14 00:53:23 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -66,5 +66,4 @@
     tmp->params  = psVectorAlloc(Nparams, PS_TYPE_F32);
     tmp->dparams = psVectorAlloc(Nparams, PS_TYPE_F32);
-    tmp->params->n = tmp->dparams->n = Nparams;
 
     for (psS32 i = 0; i < tmp->params->n; i++) {
@@ -117,5 +116,4 @@
     x->data.F32[0] = (psF32) (col + image->col0);
     x->data.F32[1] = (psF32) (row + image->row0);
-    x->n = 2;
     psF32 tmpF;
     pmModelFunc modelFunc;
@@ -143,5 +141,4 @@
 
     psVector *x = psVectorAlloc(2, PS_TYPE_F32);
-    x->n = 2;
     psVector *params = model->params;
     pmModelFunc modelFunc = pmModelFunc_GetFunction (model->type);
Index: trunk/psModules/src/objects/pmPSF.c
===================================================================
--- trunk/psModules/src/objects/pmPSF.c	(revision 9724)
+++ trunk/psModules/src/objects/pmPSF.c	(revision 9730)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-14 00:55:43 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -121,5 +121,4 @@
 
     psf->params = psArrayAlloc(Nparams - 4);
-    psf->params->n = psf->params->nalloc;
 
     // the order of the PSF parameter (X,Y) fits is determined by the
@@ -166,8 +165,4 @@
     psVector *z  = psVectorAlloc (models->n, PS_TYPE_F64);
     psVector *dz = psVectorAlloc (models->n, PS_TYPE_F64);
-    x->n = x->nalloc;
-    y->n = y->nalloc;
-    z->n = z->nalloc;
-    dz->n = dz->nalloc;
 
     for (int i = 0; i < models->n; i++) {
@@ -258,5 +253,5 @@
 
 /***********************************************
- * this function masks the psf.ApTrend polynomial 
+ * this function masks the psf.ApTrend polynomial
  * to enable the specific subset of the coefficients
  **********************************************/
Index: trunk/psModules/src/objects/pmPSFtry.c
===================================================================
--- trunk/psModules/src/objects/pmPSFtry.c	(revision 9724)
+++ trunk/psModules/src/objects/pmPSFtry.c	(revision 9730)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-17 02:21:03 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -71,6 +71,4 @@
     test->fitMag   = psVectorAlloc (sources->n, PS_TYPE_F64);
     test->mask     = psVectorAlloc (sources->n, PS_TYPE_U8);
-    test->metric->n = test->fitMag->n = test->mask->n = sources->n;
-    test->modelEXT->n = test->modelPSF->n = sources->n;
 
     for (int i = 0; i < test->modelEXT->n; i++) {
@@ -196,5 +194,4 @@
     psVector *chisq = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);
     psVector *mask  = psVectorAlloc (psfTry->sources->n, PS_TYPE_MASK);
-    flux->n = mask->n = chisq->n = psfTry->sources->n;
 
     // write sources with models first
@@ -256,5 +253,4 @@
     // r2rflux = radius^2 * ten(0.4*fitMag);
     psVector *r2rflux = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);
-    r2rflux->n = psfTry->sources->n;
 
     for (int i = 0; i < psfTry->sources->n; i++) {
Index: trunk/psModules/src/objects/pmPeaks.c
===================================================================
--- trunk/psModules/src/objects/pmPeaks.c	(revision 9724)
+++ trunk/psModules/src/objects/pmPeaks.c	(revision 9730)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -40,6 +40,5 @@
 
     if (list == NULL) {
-        list = psArrayAlloc(100);
-        list->n = 0;
+        list = psArrayAllocEmpty(100);
     }
     psArrayAdd(list, 100, tmpPeak);
@@ -69,5 +68,4 @@
         tmpVector->data.F32[col] = image->data.F32[row][col];
     }
-    tmpVector->n = image->numCols;
     psTrace("psModules.objects", 4, "---- %s() end ----\n", __func__);
     return(tmpVector);
@@ -194,9 +192,7 @@
     if (n == 1) {
         psVector *tmpVector = NULL;
-        ;
         if (vector->data.F32[0] > threshold) {
             tmpVector = psVectorAlloc(1, PS_TYPE_U32);
             tmpVector->data.U32[0] = 0;
-            tmpVector->n = 1;
         } else {
             tmpVector = psVectorAlloc(0, PS_TYPE_U32);
@@ -238,5 +234,4 @@
     //
     psVector *tmpVector = psVectorAlloc(count, PS_TYPE_U32);
-    tmpVector->n = count;
     count = 0;
 
@@ -544,6 +539,5 @@
     PS_ASSERT_PTR_NON_NULL(peaks, NULL);
 
-    psArray *output = psArrayAlloc (200);
-    output->n = 0;
+    psArray *output = psArrayAllocEmpty (200);
 
     psTrace (".pmObjects.pmCullPeaks", 3, "list size is %ld\n", peaks->n);
Index: trunk/psModules/src/objects/pmSource.c
===================================================================
--- trunk/psModules/src/objects/pmSource.c	(revision 9724)
+++ trunk/psModules/src/objects/pmSource.c	(revision 9730)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-19 21:10:08 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -294,8 +294,6 @@
         maxSy = clump->y * SCALE + 0.2;
 
-        tmpSx = psVectorAlloc (sources->n, PS_TYPE_F32);
-        tmpSy = psVectorAlloc (sources->n, PS_TYPE_F32);
-        tmpSx->n = 0;
-        tmpSy->n = 0;
+        tmpSx = psVectorAllocEmpty (sources->n, PS_TYPE_F32);
+        tmpSy = psVectorAllocEmpty (sources->n, PS_TYPE_F32);
 
         // XXX clip sources based on flux?
@@ -375,6 +373,5 @@
 
     // report stats on S/N values for star-like objects
-    psVector *starsn = psVectorAlloc (sources->n, PS_TYPE_F32);
-    starsn->n = 0;
+    psVector *starsn = psVectorAllocEmpty (sources->n, PS_TYPE_F32);
 
     // check return status value (do these exist?)
Index: trunk/psModules/src/objects/pmSourceContour.c
===================================================================
--- trunk/psModules/src/objects/pmSourceContour.c	(revision 9724)
+++ trunk/psModules/src/objects/pmSourceContour.c	(revision 9730)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -240,6 +240,6 @@
 
     // Allocate data for x/y pairs.
-    psVector *xVec = psVectorAlloc(100, PS_TYPE_F32);
-    psVector *yVec = psVectorAlloc(100, PS_TYPE_F32);
+    psVector *xVec = psVectorAllocEmpty(100, PS_TYPE_F32);
+    psVector *yVec = psVectorAllocEmpty(100, PS_TYPE_F32);
 
     // First row: find the left and right end-points
@@ -327,5 +327,4 @@
     // fprintf (stderr, "done\n");
     psArray *tmpArray = psArrayAlloc(2);
-    tmpArray->n = 2;
 
     tmpArray->data[0] = (psPtr *) xVec;
@@ -338,5 +337,5 @@
     pmSourceContour(src, img, level, mode): For an input subImage, and model, this
     routine returns a psArray of coordinates that evaluate to the specified level.
-     
+ 
     XXX: Probably should remove the "image" argument.
     XXX: What type should the output coordinate vectors consist of?  col,row?
@@ -366,5 +365,4 @@
     psVector *xVec = psVectorAlloc(2 * source->pixels->numRows, PS_TYPE_F32);
     psVector *yVec = psVectorAlloc(2 * source->pixels->numRows, PS_TYPE_F32);
-    xVec->n = yVec->n = 2 * source->pixels->numRows;
 
     //
@@ -447,5 +445,4 @@
     //
     psArray *tmpArray = psArrayAlloc(2);
-    tmpArray->n = 2;
 
     tmpArray->data[0] = (psPtr *) yVec;
Index: trunk/psModules/src/objects/pmSourceFitModel.c
===================================================================
--- trunk/psModules/src/objects/pmSourceFitModel.c	(revision 9724)
+++ trunk/psModules/src/objects/pmSourceFitModel.c	(revision 9730)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-13 22:11:02 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -78,7 +78,7 @@
 
     // construct the coordinate and value entries
-    psArray *x = psArrayAlloc(nPix);
-    psVector *y = psVectorAlloc(nPix, PS_TYPE_F32);
-    psVector *yErr = psVectorAlloc(nPix, PS_TYPE_F32);
+    psArray *x = psArrayAllocEmpty(nPix);
+    psVector *y = psVectorAllocEmpty(nPix, PS_TYPE_F32);
+    psVector *yErr = psVectorAllocEmpty(nPix, PS_TYPE_F32);
 
     nPix = 0;
@@ -95,5 +95,4 @@
 
             psVector *coord = psVectorAlloc(2, PS_TYPE_F32);
-            coord->n = 2;
 
             // Convert i/j to image space:
@@ -128,5 +127,4 @@
     // set parameter mask based on fitting mode
     paramMask = psVectorAlloc (params->n, PS_TYPE_U8);
-    paramMask->n = params->n;
     psVectorInit (paramMask, 1);
 
@@ -208,5 +206,4 @@
     if (paramMask != NULL) {
         psVector *delta = psVectorAlloc (params->n, PS_TYPE_F64);
-        delta->n = params->n;
         psMinimizeGaussNewtonDelta(delta, params, NULL, x, y, yErr, modelFunc);
         for (int i = 0; i < dparams->n; i++) {
@@ -272,5 +269,4 @@
     onePar = psVectorAlloc (nPar, PS_DATA_F32);
     oneDeriv = psVectorAlloc (nPar, PS_DATA_F32);
-    onePar->n = oneDeriv->n = nPar;
 
     return true;
@@ -357,6 +353,4 @@
     psVector *params = psVectorAlloc (nSrc*nPar + 1, PS_TYPE_F32);
     psVector *dparams = psVectorAlloc (nSrc*nPar + 1, PS_TYPE_F32);
-    params->n = params->nalloc;
-    dparams->n = dparams->nalloc;
 
     pmModelLimits modelLimits = pmModelLimits_GetFunction (model->type);
@@ -373,8 +367,4 @@
     constrain->paramMask = psVectorAlloc (nSrc*nPar + 1, PS_TYPE_U8);
     constrain->paramDelta = psVectorAlloc (nSrc*nPar + 1, PS_TYPE_F32);
-    constrain->paramMin->n = constrain->paramMin->nalloc;
-    constrain->paramMax->n = constrain->paramMax->nalloc;
-    constrain->paramMask->n = constrain->paramMask->nalloc;
-    constrain->paramDelta->n = constrain->paramDelta->nalloc;
 
     // set the parameter guesses and constraints for the multiple models
@@ -459,7 +449,7 @@
 
     // construct the coordinate and value entries
-    psArray *x = psArrayAlloc(nPix);
-    psVector *y = psVectorAlloc(nPix, PS_TYPE_F32);
-    psVector *yErr = psVectorAlloc(nPix, PS_TYPE_F32);
+    psArray *x = psArrayAllocEmpty(nPix);
+    psVector *y = psVectorAllocEmpty(nPix, PS_TYPE_F32);
+    psVector *yErr = psVectorAllocEmpty(nPix, PS_TYPE_F32);
 
     nPix = 0;
@@ -475,5 +465,4 @@
             }
             psVector *coord = psVectorAlloc(2, PS_TYPE_F32);
-            coord->n = 2;
 
             // Convert i/j to image space:
@@ -534,5 +523,4 @@
     if (constrain->paramMask != NULL) {
         psVector *delta = psVectorAlloc (params->n, PS_TYPE_F64);
-        delta->n = params->n;
         psMinimizeGaussNewtonDelta(delta, params, NULL, x, y, yErr, pmModelFitSet);
         for (int i = 0; i < dparams->n; i++) {
Index: trunk/psModules/src/objects/pmSourceIO_CMF.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO_CMF.c	(revision 9724)
+++ trunk/psModules/src/objects/pmSourceIO_CMF.c	(revision 9730)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-19 21:16:49 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -50,6 +50,5 @@
     float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT");
 
-    table = psArrayAlloc (sources->n);
-    table->n = 0;
+    table = psArrayAllocEmpty (sources->n);
 
     for (i = 0; i < sources->n; i++) {
@@ -130,5 +129,4 @@
 
     psArray *sources = psArrayAlloc (table->n);
-    sources->n = table->n;
 
     // convert the table to the pmSource entries
Index: trunk/psModules/src/objects/pmSourcePhotometry.c
===================================================================
--- trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 9724)
+++ trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 9730)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA; GLG, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-17 02:21:03 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:55:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -241,5 +241,4 @@
     pmModelFunc modelFunc = pmModelFunc_GetFunction (model->type);
     psVector *coord = psVectorAlloc(2, PS_TYPE_F32);
-    coord->n = 2;
 
     psVector *params = model->params;
