Index: /trunk/psModules/src/pmAstrometry.c
===================================================================
--- /trunk/psModules/src/pmAstrometry.c	(revision 4769)
+++ /trunk/psModules/src/pmAstrometry.c	(revision 4770)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-11 00:03:51 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -23,12 +23,11 @@
 #include "pmAstrometry.h"
 
-psDB wow;
-
 /*****************************************************************************
-checkValidImageCoords(): this is a private function which simply
-determines if the supplied x,y coordinates are in the range for the supplied
-psImage.
+checkValidImageCoords(): this is a private function which simply determines if
+the supplied x,y coordinates are in the range for the supplied psImage.
+ 
+XXX: What about col0 and row0
+XXX: This should return a psBool.
  *****************************************************************************/
-/*
 static psS32 checkValidImageCoords(double x,
                                    double y,
@@ -36,501 +35,333 @@
 {
     PS_ASSERT_IMAGE_NON_NULL(tmpImage, 0);
- 
+
     if ((x < 0.0) || (x > (double)tmpImage->numCols) ||
             (y < 0.0) || (y > (double)tmpImage->numRows)) {
         return (0);
     }
- 
+
     return (1);
 }
-*/
-/*
-static void FPAFree(psFPA* fpa)
+
+/******************************************************************************
+XXX: Is this the correct way to free metadata?
+XXX: Is this the correct way to free database structs?
+ *****************************************************************************/
+
+static void FPAFree(pmFPA *fpa)
 {
     if (fpa != NULL) {
-        psFree(fpa->chips);
-        psFree(fpa->grommit);
-        psFree(fpa->exposure);
-        psFree(fpa->metadata);
         psFree(fpa->fromTangentPlane);
         psFree(fpa->toTangentPlane);
-        psFree(fpa->pattern);
-        psFree(fpa->colorPlus);
-        psFree(fpa->colorMinus);
         psFree(fpa->projection);
-    }
-}
-*/
-
-/*
-static void chipFree(psChip* chip)
+        psFree(fpa->concepts);
+        psFree(fpa->analysis);
+        psFree(fpa->camera);
+        psFree(fpa->chips);
+        psFree(fpa->header);
+        psFree(fpa->db);
+    }
+}
+
+static void chipFree(pmChip* chip)
 {
     if (chip != NULL) {
-        psFree(chip->cells);
-        psFree(chip->metadata);
         psFree(chip->toFPA);
         psFree(chip->fromFPA);
-    }
-}
-*/
-
-/*
-static void cellFree(psCell* cell)
+        psFree(chip->concepts);
+        psFree(chip->analysis);
+        psFree(chip->cells);
+        psFree(chip->parent);
+        psFree(chip->extname);
+        psFree(chip->pixels);
+        psFree(chip->header);
+    }
+}
+
+static void cellFree(pmCell *cell)
 {
     if (cell != NULL) {
+        psFree(cell->toChip);
+        psFree(cell->toFPA);
+        psFree(cell->toSky);
+        psFree(cell->concepts);
+        psFree(cell->analysis);
         psFree(cell->readouts);
-        psFree(cell->metadata);
-        psFree(cell->toChip);
-        psFree(cell->fromChip);
-        psFree(cell->toFPA);
-        psFree(cell->toTP);
-        psFree(cell->toSky);
-    }
-}
-*/
-
-static void readoutFree(psReadout* readout)
+        psFree(cell->parent);
+        psFree(cell->extname);
+        psFree(cell->pixels);
+        psFree(cell->header);
+    }
+}
+
+static void readoutFree(pmReadout *readout)
 {
     if (readout != NULL) {
         psFree(readout->image);
         psFree(readout->mask);
-        psFree(readout->objects);
-        psFree(readout->metadata);
-    }
-}
-
-/*
-static void observatoryFree(psObservatory* obs)
-{
-    if (obs != NULL) {
-        psFree(obs->name);
-    }
-}
-*/
-/*
-static void exposureFree(psExposure* exp)
-{
-    if (exp != NULL) {
-        psFree(exp->time);
-        psFree(exp->observatory);
-        psFree(exp->cameraName);
-        psFree(exp->telescopeName);
-    }
-}
-*/
-/*
-static void fixedPatternFree(psFixedPattern* fp)
-{
-    if (fp != NULL) {
-        for (psS32 i = 0; i < fp->p_ps_xRows; i++) {
-            psFree(fp->x[i]);
-        }
- 
-        for (psS32 j = 0; j < fp->p_ps_yRows; j++) {
-            psFree(fp->y[j]);
-        }
- 
-        psFree(fp->x);
-        psFree(fp->y);
-    }
-}
-*/
+        psFree(readout->analysis);
+        psFree(readout->concepts);
+        psFree(readout->parent);
+    }
+}
+
+
+pmReadout *pmReadoutAlloc(pmCell *cell)
+{
+    pmReadout *tmpReadout = (pmReadout *) psAlloc(sizeof(pmReadout));
+
+    tmpReadout->col0 = -1;
+    tmpReadout->row0 = -1;
+    tmpReadout->colBins = -1;
+    tmpReadout->rowBins = -1;
+    tmpReadout->image = NULL;
+    tmpReadout->mask = NULL;
+    tmpReadout->analysis = psMetadataAlloc();
+    tmpReadout->concepts = psMetadataAlloc();
+    tmpReadout->parent = cell;
+
+    if (cell != NULL) {
+        cell->readouts = psArrayAdd(cell->readouts, 1, (psPtr) tmpReadout);
+    }
+    psMemSetDeallocator(tmpReadout, (psFreeFunc) readoutFree);
+    return(tmpReadout);
+}
+
+pmCell *pmCellAlloc(pmChip *chip)
+{
+    pmCell *tmpCell = (pmCell *) psAlloc(sizeof(pmCell));
+
+    tmpCell->col0 = -1;
+    tmpCell->row0 = -1;
+    tmpCell->toChip = NULL;
+    tmpCell->toFPA = NULL;
+    tmpCell->toSky = NULL;
+    tmpCell->analysis = psMetadataAlloc();
+    tmpCell->concepts = psMetadataAlloc();
+    tmpCell->readouts = psArrayAlloc(0);
+    tmpCell->parent = chip;
+    if (chip != NULL) {
+        chip->cells = psArrayAdd(chip->cells, 1, (psPtr) tmpCell);
+    }
+    tmpCell->valid = false;
+    tmpCell->extname = NULL;
+    tmpCell->pixels = NULL;
+    tmpCell->header = NULL;
+
+    psMemSetDeallocator(tmpCell, (psFreeFunc) cellFree);
+    return(tmpCell);
+}
+
+pmChip *pmChipAlloc(pmFPA *fpa)
+{
+    pmChip *tmpChip = (pmChip *) psAlloc(sizeof(pmChip));
+
+    tmpChip->col0 = -1;
+    tmpChip->row0 = -1;
+    tmpChip->toFPA = NULL;
+    tmpChip->fromFPA = NULL;
+    tmpChip->concepts = psMetadataAlloc();
+    tmpChip->analysis = psMetadataAlloc();
+    tmpChip->cells = psArrayAlloc(0);
+    tmpChip->parent = fpa;
+    if (fpa != NULL) {
+        fpa->chips = psArrayAdd(fpa->chips, 1, (psPtr) tmpChip);
+    }
+    tmpChip->valid = false;
+    tmpChip->extname = NULL;
+    tmpChip->pixels = NULL;
+    tmpChip->header = NULL;
+
+    psMemSetDeallocator(tmpChip, (psFreeFunc) chipFree);
+    return(tmpChip);
+}
+
+pmFPA *pmFPAAlloc(
+    const psMetadata *camera,
+    psDB *db)
+{
+    pmFPA *tmpFPA = (pmFPA *) psAlloc(sizeof(pmFPA));
+
+    tmpFPA->fromTangentPlane = NULL;
+    tmpFPA->toTangentPlane = NULL;
+    tmpFPA->projection = NULL;
+    tmpFPA->concepts = psMetadataAlloc();
+    tmpFPA->analysis = psMetadataAlloc();
+    tmpFPA->camera = camera;
+    tmpFPA->chips = psArrayAlloc(0);
+    tmpFPA->header = NULL;
+    tmpFPA->db = db;
+
+    psMemSetDeallocator(tmpFPA, (psFreeFunc) FPAFree);
+    return(tmpFPA);
+}
+
+bool cellCheckParents(pmCell *cell)
+{
+    if (cell == NULL) {
+        return(true);
+    }
+    psBool flag = true;
+
+    for (psS32 i = 0 ; i < cell->readouts->n ; i++) {
+        pmReadout *tmpReadout = (pmReadout *) cell->readouts->data[i];
+        PS_ASSERT_PTR_NON_NULL(tmpReadout, false);
+        if (tmpReadout->parent != cell) {
+            tmpReadout->parent = cell;
+            flag = false;
+        }
+    }
+    return(flag);
+}
+
+bool chipCheckParents(pmChip *chip)
+{
+    if (chip == NULL) {
+        return(true);
+    }
+    psBool flag = true;
+
+    for (psS32 i = 0 ; i < chip->cells->n ; i++) {
+        pmCell *tmpCell = (pmCell *) chip->cells->data[i];
+        PS_ASSERT_PTR_NON_NULL(tmpCell, false);
+        if (tmpCell->parent != chip) {
+            tmpCell->parent = chip;
+            flag = false;
+        }
+
+        flag &= cellCheckParents(tmpCell);
+    }
+    return(flag);
+}
+
+bool pmFPACheckParents(pmFPA *fpa)
+{
+    if (fpa == NULL) {
+        return(true);
+    }
+    psBool flag = true;
+
+    for (psS32 i = 0 ; i < fpa->chips->n ; i++) {
+        pmChip *tmpChip = (pmChip *) fpa->chips->data[i];
+        PS_ASSERT_PTR_NON_NULL(tmpChip, false);
+        if (tmpChip->parent != fpa) {
+            tmpChip->parent = fpa;
+            flag = false;
+        }
+
+        flag &= chipCheckParents(tmpChip);
+    }
+    return(flag);
+}
+
+
+
+// HEY
 /*****************************************************************************/
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
 /*****************************************************************************/
 
-/*
- * XXX: Verify that you interpreted the SDR correctly.
- *
- * XXX: This assumes that x,y must be of type F64
- */
-/*
-psFixedPattern* psFixedPatternAlloc(double x0,
-                                   double y0,
-                                   double xScale,
-                                   double yScale,
-                                   const psImage *x,
-                                   const psImage *y)
-{
-   psFixedPattern *tmp;
-   psS32 i;
-   psS32 j;
- 
-   PS_ASSERT_IMAGE_NON_NULL(x, NULL);
-   PS_ASSERT_IMAGE_NON_NULL(y, NULL);
-   PS_ASSERT_IMAGE_TYPE(x, PS_TYPE_F64, NULL);
-   PS_ASSERT_IMAGE_TYPE(y, PS_TYPE_F64, NULL);
- 
-   tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
-   // XXX: Is this correct?
-   tmp->nX = (x->numCols * x->numRows);
-   tmp->nY = (y->numCols * y->numRows);
-   tmp->x0 = x0;
-   tmp->y0 = y0;
-   tmp->xScale = xScale;
-   tmp->yScale = yScale;
-   tmp->p_ps_xRows = x->numRows;
-   tmp->p_ps_xCols = x->numCols;
-   tmp->p_ps_yRows = y->numRows;
-   tmp->p_ps_yCols = y->numCols;
-   tmp->x = (double **) psAlloc(x->numRows * sizeof(double *));
-   for (i=0;i<x->numRows;i++) {
-       (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double));
-   }
-   for (i=0;i<x->numRows;i++) {
-       for (j=0;j<x->numCols;j++) {
-           (tmp->x)[i][j] = x->data.F64[i][j];
-       }
-   }
- 
-   tmp->y = (double **) psAlloc(y->numRows * sizeof(double *));
-   for (i=0;i<y->numRows;i++) {
-       (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double));
-   }
-   for (i=0;i<y->numRows;i++) {
-       for (j=0;j<y->numCols;j++) {
-           (tmp->y)[i][j] = y->data.F64[i][j];
-       }
-   }
- 
-   psMemSetDeallocator(tmp,(psFreeFunc)fixedPatternFree);
- 
-   return(tmp);
-}
-*/
-/*
-psExposure* psExposureAlloc(double ra,
-                            double dec,
-                            double hourAngle,
-                            double zenithDistance,
-                            double azimuth,
-                            const psTime* time,
-                            float rotAngle,
-                            float temperature,
-                            float pressure,
-                            float humidity,
-                            float exposureTime,
-                            float wavelength,
-                            const psObservatory* observatory)
-{
-    PS_ASSERT_PTR_NON_NULL(observatory, NULL);
- 
-    psExposure* exp = psAlloc(sizeof(psExposure));
-    *(double *)&exp->ra = ra;
-    *(double *)&exp->dec = dec;
-    *(double *)&exp->hourAngle = hourAngle;
-    *(double *)&exp->zenithDistance = zenithDistance;
-    *(double *)&exp->azimuth = azimuth;
-    *(float *)&exp->rotAngle = rotAngle;
-    *(float *)&exp->temperature = temperature;
-    *(float *)&exp->pressure = pressure;
-    *(float *)&exp->humidity = humidity;
-    *(float *)&exp->exposureTime = exposureTime;
-    *(float *)&exp->wavelength = wavelength;
- 
-    exp->time = psMemIncrRefCounter((psPtr)time);
-    exp->observatory = psMemIncrRefCounter((psPtr)observatory);
- 
-    // XXX: how is this value derived?
-    *(double *)&exp->lst = psTimeToLMST((psTime*)time,observatory->longitude);
-    *(float *)&exp->positionAngle = 0.0f; // XXX: need input, see Bug #207
-    *(float *)&exp->parallacticAngle = 0.0f; // XXX: need input, see Bug #207
-    *(float *)&exp->airmass = 0.0f; // XXX: needs calculation!  = slaAirmas(zenithDistance);
-    *(float *)&exp->parallacticFactor = 0.0f;
-    exp->cameraName = NULL;
-    exp->telescopeName = NULL;
- 
-    psMemSetDeallocator(exp,(psFreeFunc)exposureFree);
- 
-    return exp;
-}
-*/
-/*
-psObservatory* psObservatoryAlloc(const char* name,
-                                  double latitude,
-                                  double longitude,
-                                  double height,
-                                  double tlr)
-{
-    psObservatory* obs = psAlloc(sizeof(psObservatory));
- 
-    if (name == NULL) {
-        obs->name = NULL;
-    } else {
-        obs->name = psAlloc(strlen(name)+1);
-        strcpy((char*)obs->name, name);
-    }
- 
-    *(double *)&obs->latitude = latitude;
-    *(double *)&obs->longitude = longitude;
-    *(double *)&obs->height = height;
-    *(double *)&obs->tlr = tlr;
- 
-    psMemSetDeallocator(obs,(psFreeFunc)observatoryFree);
- 
-    return obs;
-}
-*/
-/*
-psFPA* psFPAAlloc(psS32 nChips,
-                  const psExposure* exp)
-{
-    PS_ASSERT_INT_NONNEGATIVE(nChips, NULL);
- 
-    psFPA* newFPA = psAlloc(sizeof(psFPA));
- 
-    // create array of NULL chips of the size nChips
-    newFPA->chips = psArrayAlloc(nChips);
-    psPtr* chips = newFPA->chips->data;
-    for (psS32 i=0;i<nChips;i++) {
-        chips[i] = NULL;
-    }
-    newFPA->chips->n = 0; // per requirement
- 
-    newFPA->metadata = NULL;
-    newFPA->fromTangentPlane = NULL;
-    newFPA->toTangentPlane = NULL;
-    newFPA->pattern = NULL;
- 
-    if (exp != NULL) {
-        newFPA->exposure = psMemIncrRefCounter((psExposure*)exp);
-        newFPA->grommit = psGrommitAlloc(exp);
-    } else {
-        newFPA->exposure = NULL;
-        newFPA->grommit = NULL;
-    }
- 
-    newFPA->colorPlus = NULL;
-    newFPA->colorMinus = NULL;
-    newFPA->projection = NULL;
- 
-    newFPA->rmsX = 0.0f;
-    newFPA->rmsY = 0.0f;
-    newFPA->chi2 = 0.0f;
- 
-    psMemSetDeallocator(newFPA,(psFreeFunc)FPAFree);
- 
-    return newFPA;
-}
-*/
-/*
- * psChip constructor
- */
-/*
-psChip* psChipAlloc(psS32 nCells,
-                    psFPA *parentFPA)
-{
-    PS_ASSERT_INT_NONNEGATIVE(nCells, NULL);
- 
-    psChip* chip = psAlloc(sizeof(psChip));
- 
-    // create array of NULL psCells
-    int n = (nCells > 0) ? nCells : 1;
-    chip->cells = psArrayAlloc(n);
-    psPtr* cells = chip->cells->data;
-    for (psS32 i=0;i<n;i++) {
-        cells[i] = NULL;
-    }
-    chip->cells->n = 0; // per requirement
- 
-    *(int*)&chip->row0 = 0;
-    *(int*)&chip->col0 = 0;
- 
-    chip->metadata = NULL;
- 
-    chip->toFPA = NULL;
-    chip->fromFPA = NULL;
- 
-    chip->parent = parentFPA;
- 
-    psMemSetDeallocator(chip,(psFreeFunc)chipFree);
- 
-    return chip;
- 
-}
-*/
-/*
- * psCell constructor
- */
-/*
-psCell* psCellAlloc(psS32 nReadouts,
-                    psChip* parentChip)
-{
-    PS_ASSERT_INT_NONNEGATIVE(nReadouts, NULL);
- 
-    psCell* cell = psAlloc(sizeof(psCell));
- 
-    // create array of NULL psReadouts
-    int n = (nReadouts > 0) ? nReadouts : 1;
-    cell->readouts = psArrayAlloc(n);
-    psPtr* readouts = cell->readouts->data;
-    for (psS32 i=0;i<n;i++) {
-        readouts[i] = NULL;
-    }
-    cell->readouts->n = 0; // per requirement
- 
-    *(int*)&cell->row0 = 0;
-    *(int*)&cell->col0 = 0;
- 
-    cell->metadata = NULL;
- 
-    cell->toChip = NULL;
-    cell->fromChip = NULL;
-    cell->toFPA = NULL;
-    cell->toTP = NULL;
-    cell->toSky = NULL;
- 
-    cell->parent = parentChip;
- 
-    psMemSetDeallocator(cell,(psFreeFunc)cellFree);
- 
-    return cell;
- 
- 
-}
-*/
-
-psReadout *pmReadoutAlloc(pmCell *cell)
-{
-    psReadout* readout = psAlloc(sizeof(psReadout));
-
-    *(psU32*)&readout->colBins = 1;
-    *(psU32*)&readout->rowBins = 1;
-    *(psU32*)&readout->rowParity = 0;
-    *(psU32*)&readout->colParity = 0;
-    *(psS32*)&readout->col0 = 0;
-    *(psS32*)&readout->row0 = 0;
-
-    readout->image = NULL;
-    readout->mask = NULL;
-    readout->objects = NULL;
-    readout->metadata = NULL;
-
-    psMemSetDeallocator(readout,(psFreeFunc)readoutFree);
-
-    return readout;
-}
-
-/*
-psGrommit* psGrommitAlloc(const psExposure* exp)
-{
-    PS_ASSERT_PTR_NON_NULL(exp, NULL);
- 
-    psSphere* polarMotion = p_psTimeGetPoleCoords(exp->time);
- 
-    psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit));
- 
-    *(double*)&grommit->latitude = exp->observatory->latitude;
-    *(double*)&grommit->longitude = exp->observatory->longitude;
-    *(double*)&grommit->height = exp->observatory->height;
-    *(double*)&grommit->abberationMag = 0.0; // XXX: need to figure out what to set here.
-    *(double*)&grommit->temperature = exp->temperature;
-    *(double*)&grommit->pressure = exp->pressure;
-    *(double*)&grommit->humidity = exp->humidity;
-    *(double*)&grommit->wavelength = exp->wavelength;
-    *(double*)&grommit->lapseRate = exp->observatory->tlr;
-    *(double*)&grommit->refractA = polarMotion->r; // XXX: need to figure out what to set here too.
-    *(double*)&grommit->refractB = polarMotion->d; // XXX: need to figure out what to set here too.
-    *(double*)&grommit->siderealTime = psTimeToMJD(exp->time); // XXX: this is probably not correct
- 
-    psFree(polarMotion);
- 
-    return (grommit);
-}
-*/
-/*
-psCell* psCellInFPA(const psPlane* fpaCoord,
-                    const psFPA* FPA)
+pmCell* pmCellInFPA(const psPlane* fpaCoord,
+                    const pmFPA* FPA)
 {
     PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(FPA, NULL);
- 
-    psChip* tmpChip = NULL;
+
+    pmChip* tmpChip = NULL;
     psPlane chipCoord;
-    psCell* outCell = NULL;
- 
+    pmCell* outCell = NULL;
+
     // Determine which chip contains the fpaCoords.
-    tmpChip = psChipInFPA(fpaCoord, FPA);
+    tmpChip = pmChipInFPA(fpaCoord, FPA);
     if (tmpChip == NULL) {
         return(NULL);
     }
- 
+
     // Convert to those chip coordinates.
     psCoordFPAToChip(&chipCoord, fpaCoord, tmpChip);
- 
+
     // Determine which cell contains those chip coordinates.
-    outCell = psCellInChip(&chipCoord, tmpChip);
- 
+    outCell = pmCellInChip(&chipCoord, tmpChip);
+
     return (outCell);
 }
-*/
-/*
-psChip* psChipInFPA(const psPlane* fpaCoord,
-                    const psFPA* FPA)
+
+pmChip* pmChipInFPA(const psPlane* fpaCoord,
+                    const pmFPA* FPA)
 {
     PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(FPA, NULL);
     PS_ASSERT_PTR_NON_NULL(FPA->chips, NULL);
- 
+
     psArray* chips = FPA->chips;
     psS32 nChips = chips->n;
     psPlane chipCoord;
-    psCell *tmpCell = NULL;
- 
+    pmCell *tmpCell = NULL;
+
     // Loop through every chip in this FPA.  Convert the original FPA
     // coordinates to chip coordinates for that chip.  Then, determine if any
     // cells in that chip contain those chip coordinates.
- 
+
     for (psS32 i = 0; i < nChips; i++) {
-        psChip* tmpChip = chips->data[i];
+        pmChip* tmpChip = chips->data[i];
         PS_ASSERT_PTR_NON_NULL(tmpChip, NULL);
         PS_ASSERT_PTR_NON_NULL(tmpChip->fromFPA, NULL);
- 
+
         psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord);
- 
-        tmpCell = psCellInChip(&chipCoord, tmpChip);
+
+        tmpCell = pmCellInChip(&chipCoord, tmpChip);
         if (tmpCell != NULL) {
             return(tmpChip);
         }
     }
- 
+
     // XXX: Print warning here?
     return (NULL);
 }
-*/
-/*
-psCell* psCellInChip(const psPlane* chipCoord,
-                     const psChip* chip)
+
+
+pmCell* pmCellInChip(const psPlane* chipCoord,
+                     const pmChip* chip)
 {
     PS_ASSERT_PTR_NON_NULL(chipCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(chip, NULL);
- 
+
     psPlane cellCoord;
     psArray* cells;
- 
+
     cells = chip->cells;
     if (cells == NULL) {
         return NULL;
     }
- 
+
     // We loop over each cell in the chip.  We transform the chipCoord into
     // a cellCoord for that cell and determine if that cellCoord is valid.
     // If so, then we return that cell.
- 
+
     for (psS32 i = 0; i < cells->n; i++) {
-        psCell* tmpCell = (psCell* ) cells->data[i];
+        pmCell* tmpCell = (pmCell* ) cells->data[i];
         PS_ASSERT_PTR_NON_NULL(tmpCell, NULL);
-        PS_ASSERT_PTR_NON_NULL(tmpCell->fromChip, NULL);
+
+        psPlaneTransform *chipToCell = NULL;
+        if (1 != p_psIsProjectionLinear(tmpCell->toChip)) {
+            // XXX: Generate warning message.
+            // XXX: Can we use the following function to derive a transform?
+            // chipToCell = psPlaneTransformInvert(NULL, tmpCell->toChip, NULL, -1);
+        } else {
+            chipToCell = p_psPlaneTransformLinearInvert(tmpCell->toChip);
+        }
+
+        PS_ASSERT_PTR_NON_NULL(chipToCell, NULL);
         psArray* readouts = tmpCell->readouts;
- 
+
         if (readouts != NULL) {
             for (psS32 j = 0; j < readouts->n; j++) {
-                psReadout* tmpReadout = readouts->data[j];
+                pmReadout* tmpReadout = readouts->data[j];
                 PS_ASSERT_READOUT_NON_NULL(tmpReadout, NULL);
- 
+
                 psPlaneTransformApply(&cellCoord,
-                                      tmpCell->fromChip,
+                                      chipToCell,
                                       chipCoord);
- 
+
                 if (checkValidImageCoords(cellCoord.x,
                                           cellCoord.y,
@@ -540,85 +371,88 @@
             }
         }
-    }
- 
+        psFree(chipToCell);
+    }
+
     return (NULL);
 }
-*/
-/*
+
+
 psPlane* psCoordCellToChip(psPlane* outCoord,
                            const psPlane* inCoord,
-                           const psCell* cell)
+                           const pmCell* cell)
 {
     PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(cell, NULL);
- 
+
     return (psPlaneTransformApply(outCoord, cell->toChip, inCoord));
 }
-*/
-/*
+
+
 psPlane* psCoordChipToFPA(psPlane* outCoord,
                           const psPlane* inCoord,
-                          const psChip* chip)
+                          const pmChip* chip)
 {
     PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(chip, NULL);
- 
+
     return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord));
 }
-*/
-/*
+
+
+
 psPlane* psCoordFPAToTP(psPlane* outCoord,
                         const psPlane* inCoord,
                         double color,
                         double magnitude,
-                        const psFPA* fpa)
+                        const pmFPA* fpa)
 {
     PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(fpa, NULL);
- 
+
     return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord,
                                color, magnitude));
 }
-*/
+
 /*****************************************************************************
 XXX: What about units for the (x,y) coords?
  *****************************************************************************/
-/*
 psSphere* psCoordTPToSky(psSphere* outSphere,
                          const psPlane* tpCoord,
-                         const psGrommit* grommit)
+                         const psProjection *projection
+                        )
 {
     PS_ASSERT_PTR_NON_NULL(tpCoord, NULL);
-    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
- 
+
     if (outSphere == NULL) {
         outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
     }
- 
+
     // XXX: this was done by a SLALIB call -- needs to be reimplemented
     psWarning("Warning!  psCoordTPToSky functionality is no longer implemented");
     // slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit,
     //         &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d);
- 
+
     return (outSphere);
 }
-*/
-/*
+
+
+
 psPlane* psCoordCellToFPA(psPlane* fpaCoord,
                           const psPlane* cellCoord,
-                          const psCell* cell)
+                          const pmCell* cell)
 {
     PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(cell, NULL);
- 
+
     return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord));
 }
-*/
-/*
+
+
+
 psSphere* psCoordCellToSky(psSphere* skyCoord,
                            const psPlane* cellCoord,
                            double color,
                            double magnitude,
-                           const psCell* cell)
+                           const pmCell* cell)
 {
     PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
@@ -628,36 +462,35 @@
     PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
     PS_ASSERT_PTR_NON_NULL(cell->parent->parent->toTangentPlane, NULL);
-    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL);
- 
+    //    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL);
+
     psPlane* fpaCoord = NULL;
     psPlane* tpCoord = NULL;
-    psFPA* parFPA = (cell->parent)->parent;
-    psGrommit* tmpGrommit = NULL;
- 
+    pmFPA* parFPA = (cell->parent)->parent;
+    //    psGrommit* tmpGrommit = NULL;
+
     // Convert the input cell coordinates to FPA coordinates.
     fpaCoord = psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord);
- 
+
     // Convert the FPA coordinates to tangent plane Coordinates.
     tpCoord = psPlaneDistortApply(tpCoord, parFPA->toTangentPlane,
                                   fpaCoord, color, magnitude);
- 
+
     // Generate a grommit for this FPA.
-    tmpGrommit = psGrommitAlloc(parFPA->exposure);
- 
+    //    tmpGrommit = psGrommitAlloc(parFPA->exposure);
+
     // Convert the tangent plane Coordinates to sky coordinates.
-    skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit);
- 
+    //    skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit);
+
     psFree(fpaCoord);
     psFree(tpCoord);
-    psFree(tmpGrommit);
- 
+    //    psFree(tmpGrommit);
+
     return(skyCoord);
 }
- 
-*/
-/*
+
+
 psSphere* psCoordCellToSkyQuick(psSphere* outSphere,
                                 const psPlane* cellCoord,
-                                const psCell* cell)
+                                const pmCell* cell)
 {
     PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
@@ -667,108 +500,119 @@
     PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
     PS_ASSERT_PTR_NON_NULL(cell->parent->parent->projection, NULL);
-    if (cell->toSky) {
-        // XXX: Should we use toTP or toSky?
-        psLogMsg(__func__, PS_LOG_WARN,
-                 "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
-    }
- 
-    psPlane *tpCoord = NULL;
-    psChip *chip = cell->parent;
-    psFPA *FPA = chip->parent;
-    psProjectionType oldProjectionType;
- 
-    if (outSphere == NULL) {
-        outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
-    }
- 
-    // Determine the tangent plane coordinates.
-    tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord);
- 
-    // Save the old projection type and set the new projection type to TAN.
-    oldProjectionType = FPA->projection->type;
-    FPA->projection->type = PS_PROJ_TAN;
- 
-    // Deproject the tangent plane coordinates a sphere.
-    outSphere = psDeproject(tpCoord, FPA->projection);
- 
-    // Restore old projection type.  Free memory.
-    FPA->projection->type = oldProjectionType;
-    psFree(tpCoord);
- 
-    return (outSphere);
-}
-*/
+
+    psLogMsg(__func__, PS_LOG_WARN,
+             "WARNING: psCoordCellToSkyQuick(): This function is not fully specified in the SDRS.  Returning NULL.\n");
+    return(NULL);
+
+    /*
+        if (cell->toSky) {
+            // XXX: Should we use toTP or toSky?
+            psLogMsg(__func__, PS_LOG_WARN,
+                     "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
+        }
+     
+        psPlane *tpCoord = NULL;
+        pmChip *chip = cell->parent;
+        pmFPA *FPA = chip->parent;
+        psProjectionType oldProjectionType;
+     
+        if (outSphere == NULL) {
+            outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
+        }
+     
+        // Determine the tangent plane coordinates.
+        tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord);
+     
+        // Save the old projection type and set the new projection type to TAN.
+        oldProjectionType = FPA->projection->type;
+        FPA->projection->type = PS_PROJ_TAN;
+     
+        // Deproject the tangent plane coordinates a sphere.
+        outSphere = psDeproject(tpCoord, FPA->projection);
+     
+        // Restore old projection type.  Free memory.
+        FPA->projection->type = oldProjectionType;
+        psFree(tpCoord);
+     
+        return (outSphere);
+    */
+}
+
 
 /*****************************************************************************
 XXX: What about units for the (x,y) coords?
  *****************************************************************************/
-/*
 psPlane* psCoordSkyToTP(psPlane* tpCoord,
                         const psSphere* in,
-                        const psGrommit* grommit)
+                        const psProjection *projection)
 {
     PS_ASSERT_PTR_NON_NULL(in, NULL);
-    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
- 
+    //    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
+
     // char* type = "RA";
- 
+
     if (tpCoord == NULL) {
         tpCoord = (psPlane* ) psAlloc(sizeof(psPlane));
     }
- 
+
     // XXX: this was done by a SLALIB call -- needs to be reimplemented
     psWarning("Warning!  psCoordSkyToTP functionality is no longer implemented");
     // slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y);
- 
+
     return(tpCoord);
 }
-*/
-/*
+
+
 psPlane* psCoordTPToFPA(psPlane* fpaCoord,
                         const psPlane* tpCoord,
                         double color,
                         double magnitude,
-                        const psFPA* fpa)
+                        const pmFPA* fpa)
 {
     PS_ASSERT_PTR_NON_NULL(tpCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(fpa, NULL);
     PS_ASSERT_PTR_NON_NULL(fpa->fromTangentPlane, NULL);
- 
+
     return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane,
                                 tpCoord, color, magnitude));
 }
-*/
-/*
+
+
 psPlane* psCoordFPAToChip(psPlane* chipCoord,
                           const psPlane* fpaCoord,
-                          const psChip* chip)
+                          const pmChip* chip)
 {
     PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(chip, NULL);
     PS_ASSERT_PTR_NON_NULL(chip->fromFPA, NULL);
- 
+
     chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord);
     return(chipCoord);
 }
-*/
-/*
+
+
 psPlane* psCoordChipToCell(psPlane* cellCoord,
                            const psPlane* chipCoord,
-                           const psCell* cell)
+                           const pmCell* cell)
 {
     PS_ASSERT_PTR_NON_NULL(chipCoord, NULL);
     PS_ASSERT_PTR_NON_NULL(cell, NULL);
-    PS_ASSERT_PTR_NON_NULL(cell->fromChip, NULL);
- 
-    cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord);
+    PS_ASSERT_PTR_NON_NULL(cell->parent, NULL);
+
+    pmCell *tmpCell = pmCellInChip(chipCoord, cell->parent);
+    PS_ASSERT_PTR_NON_NULL(tmpCell->toChip, NULL);
+    psPlaneTransform *tmpChipToCell = p_psPlaneTransformLinearInvert(tmpCell->toChip);
+    PS_ASSERT_PTR_NON_NULL(tmpChipToCell, NULL);
+    cellCoord = psPlaneTransformApply(cellCoord, tmpChipToCell, chipCoord);
+    psFree(tmpChipToCell);
     return(cellCoord);
 }
-*/
-/*
+
+
 psPlane* psCoordSkyToCell(psPlane* cellCoord,
                           const psSphere* skyCoord,
-                          double color,
-                          double magnitude,
-                          const psCell* cell)
+                          float color,
+                          float magnitude,
+                          const pmCell* cell)
 {
     PS_ASSERT_PTR_NON_NULL(skyCoord, NULL);
@@ -776,34 +620,32 @@
     PS_ASSERT_PTR_NON_NULL(cell->parent, NULL);
     PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
-    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL);
- 
-    psChip *parChip = cell->parent;
-    psFPA *parFPA = parChip->parent;
-    psGrommit* grommit = parFPA->grommit;
- 
+    //    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL);
+
+    pmChip *parChip = cell->parent;
+    pmFPA *parFPA = parChip->parent;
+
     // Convert the skyCoords to tangent plane coords.
-    psPlane *tpCoord = psCoordSkyToTP(tpCoord, skyCoord, grommit);
- 
+    psPlane *tpCoord = psCoordSkyToTP(NULL, skyCoord, parFPA->projection);
+
     // Convert the tangent plane coords to FPA coords.
-    psPlane *fpaCoord = psCoordTPToFPA(fpaCoord, tpCoord, color,
-                                       magnitude, parFPA);
- 
+    psPlane *fpaCoord = psCoordTPToFPA(NULL, tpCoord, color, magnitude, parFPA);
+
     // Convert the FPA coords to chip coords.
-    psPlane *chipCoord = psCoordFPAToChip(chipCoord, fpaCoord, parChip);
- 
+    psPlane *chipCoord = psCoordFPAToChip(NULL, fpaCoord, parChip);
+
     // Convert the chip coords to cell coords.
     cellCoord = psCoordChipToCell(cellCoord, chipCoord, cell);
- 
+
     psFree(tpCoord);
     psFree(fpaCoord);
     psFree(chipCoord);
- 
+
     return (cellCoord);
 }
-*/
-/*
+
+
 psPlane* psCoordSkyToCellQuick(psPlane* cellCoord,
                                const psSphere* skyCoord,
-                               const psCell* cell)
+                               const pmCell* cell)
 {
     PS_ASSERT_PTR_NON_NULL(skyCoord, NULL);
@@ -812,43 +654,50 @@
     PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
     PS_ASSERT_PTR_NON_NULL(cell->parent->parent->projection, NULL);
-    PS_ASSERT_PTR_NON_NULL(cell->toTP, NULL);
-    if (cell->toSky) {
-        // XXX: Should we use toTP or toSky?
-        psLogMsg(__func__, PS_LOG_WARN,
-                 "WARNING: psCoordSkyToCellQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
-    }
- 
-    psPlane *tpCoord = NULL;
-    psChip *whichChip = cell->parent;
-    psFPA *whichFPA = whichChip->parent;
-    psProjectionType oldProjectionType;
-    psPlaneTransform *TPtoCell = NULL;
- 
-    // Save the old projection type and set the new projection type to TAN.
-    oldProjectionType = whichFPA->projection->type;
-    whichFPA->projection->type = PS_PROJ_TAN;
- 
-    if (cellCoord == NULL) {
-        cellCoord = (psPlane* ) psAlloc(sizeof(psPlane));
-    }
- 
-    tpCoord = psProject(skyCoord, whichFPA->projection);
- 
-    // generate an error if cell->toTP is not linear.
-    if (0 == p_psIsProjectionLinear(cell->toTP)) {
-        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
-                PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM,
-                "cell to tangent plane");
-    }
- 
-    TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP);
-    cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord);
- 
-    // Restore old projection type.  Free memory.
-    whichFPA->projection->type = oldProjectionType;
-    psFree(tpCoord);
-    return (cellCoord);
-}
-*/
-
-
+
+
+    psLogMsg(__func__, PS_LOG_WARN,
+             "WARNING: psCoordSkyToCellQuick(): This function is not fully specified in the SDRS.  Returning NULL.\n");
+    return(NULL);
+    /*
+     
+        if (cell->toSky) {
+            // XXX: Should we use toTP or toSky?
+            psLogMsg(__func__, PS_LOG_WARN,
+                     "WARNING: psCoordSkyToCellQuick: The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
+        }
+     
+        psPlane *tpCoord = NULL;
+        pmChip *whichChip = cell->parent;
+        pmFPA  *whichFPA = whichChip->parent;
+        psProjectionType oldProjectionType;
+        psPlaneTransform *TPtoCell = NULL;
+     
+        // Save the old projection type and set the new projection type to TAN.
+        oldProjectionType = whichFPA->projection->type;
+        whichFPA->projection->type = PS_PROJ_TAN;
+     
+        if (cellCoord == NULL) {
+            cellCoord = (psPlane* ) psAlloc(sizeof(psPlane));
+        }
+     
+        tpCoord = psProject(skyCoord, whichFPA->projection);
+     
+        // generate an error if cell->toTP is not linear.
+        if (0 == p_psIsProjectionLinear(cell->toTP)) {
+            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
+                    PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM,
+                    "cell to tangent plane");
+        }
+     
+        TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP);
+        cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord);
+     
+        // Restore old projection type.  Free memory.
+        whichFPA->projection->type = oldProjectionType;
+        psFree(tpCoord);
+        return (cellCoord);
+    */
+}
+
+
+
Index: /trunk/psModules/src/pmAstrometry.h
===================================================================
--- /trunk/psModules/src/pmAstrometry.h	(revision 4769)
+++ /trunk/psModules/src/pmAstrometry.h	(revision 4770)
@@ -8,6 +8,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-08-11 00:03:51 $
+*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-08-16 01:10:34 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -143,11 +143,16 @@
     // Information
     psImage *image;                     ///< Imaging area of readout
+    // XXX: The following mask was removed from the pmReadout struct in recent SDRS
+    // versions.  However, I'm keeping it here since al ot of modules still require
+    // it.
+    psImage *mask;                      ///< Mask of input image
     psMetadata *analysis;               ///< Readout-level analysis metadata
     psMetadata *concepts;               ///< Cache for PS Concepts
     pmCell *parent;                     ///< Parent cell
 }
-psReadout;
-
-/** Allocates a psReadout
+pmReadout;
+
+
+/** Allocates a pmReadout
  *
  *  The constructor shall make an empty pmReadout. If the parent cell is not
@@ -156,20 +161,19 @@
  *  other pointers in the structure shall be initialized to NULL.
  *
- *  @return psReadout*    newly allocated psReadout with all internal pointers set to NULL
- */
-psReadout *pmReadoutAlloc(
+ *  @return pmReadout*    newly allocated pmReadout with all internal pointers set to NULL
+ */
+pmReadout *pmReadoutAlloc(
     pmCell *cell                        ///< Parent cell
 );
 
-/** Allocates a psCell
+/** Allocates a pmCell
  *
  *  The constructor shall make an empty pmCell. If the parent chip is not NULL,
- *  the parent link is made and the cell shall be placed in the parentThe
- *  constructor shall make an empty psCell.s array of cells. The readouts
- *  array shall be allocated with a zero size, and the metadata containers
- *  constructed. All other pointers in the structure shall be initialized to
- *  NULL.
- *
- *  @return psCell*    newly allocated psCell
+ *  the parent link is made and the cell shall be placed in the parents array of
+ *  cells. The readouts array shall be allocated with a zero size, and the
+ *  metadata containers constructed. All other pointers in the structure shall be
+ *  initialized to NULL.
+ *
+ *  @return pmCell*    newly allocated pmCell
  */
 pmCell *pmCellAlloc(
@@ -198,8 +202,29 @@
  */
 pmFPA *pmFPAAlloc(
-    const psMetadata *camera           ///< Camera configuration
-    //    psDB *db                            ///< Database handle
-);
-
+    const psMetadata *camera,           ///< Camera configuration
+    psDB *db                            ///< Database handle
+);
+
+
+/** Verify parent links.
+ * 
+ *  This function checks the validity of the parent links in the FPA hierarchy.
+ *  If a parent link is not set (or not set correctly), it is corrected, and the
+ *  function shall return false. If all the parent pointers were correct, the
+ *  function shall return true.
+ * 
+ */
+bool pmFPACheckParents(
+    pmFPA *fpa
+);
+
+
+
+/** FUNC DESC
+ * 
+ * 
+ * 
+ * 
+ */
 
 
@@ -211,217 +236,33 @@
 
 
-
-
-
-
-
-/** Wallace's Grommit
- *
- *  SLALib requires several elements to perform the transformations between
- *  the tangent plane and the sky.  Pre-computing these quantities for each
- *  exposure means that subsequent transformations are faster.  For historical
- *  reasons, this structure is known colloquially as "Wallace's Grommit".
- *
- */
-
-/*
-typedef struct
-{
-   const double latitude;           ///< geodetic latitude (radians)
-   const double longitude;          ///< longitude + ... (radians)
-   const double height;             ///< height (HM)
-   const double abberationMag;      ///< magnitude of diurnal aberration vector
-   const double temperature;        ///< ambient temperature (TDK)
-   const double pressure;           ///< pressure (PMB)
-   const double humidity;           ///< relative humidity (RH)
-   const double wavelength;         ///< wavelength (WL)
-   const double lapseRate;          ///< lapse rate (TLR)
-   const double refractA, refractB; ///< refraction constants A and B (radians)
-   const double siderealTime;       ///< local apparent sidereal time (radians)
-}
-psGrommit;
-*/
-
-
-/** Fixed Pattern Corrections
- *
- *  The fixed pattern is a correction to the general astrometric solution
- *  formed by summing the residuals from many observations. The intent is to
- *  correct for higher-order distortions in the camera system on a coarse
- *  grid (larger than individual pixels, but smaller than a single cell).
- *  Hence, in addition to the offsets, we need to specify the size and scale
- *  of the grid in x and y as well as the origin of the grid.
- */
-/*
-typedef struct
-{
-    psS32 nX;                            ///< Number of elements in x direction
-    psS32 nY;                            ///< Number of elements in y direction
-    double x0;                         ///< X Position of 0,0 corner on focal plane
-    double y0;                         ///< Y Position of 0,0 corner on focal plane
-    double xScale;                     ///< Scale of the grid in x direction
-    double yScale;                     ///< Scale of the grid in x direction
-    /// XXX: I added the following memvers to facilitate the psFreeing of the x,y data structures.
-    psS32 p_ps_xRows;                    ///< Number of rows in the x member
-    psS32 p_ps_xCols;                    ///< Number of cols in the x member
-    psS32 p_ps_yRows;                    ///< Number of rows in the y member
-    psS32 p_ps_yCols;                    ///< Number of cols in the y member
-    double **x;                        ///< The grid of offsets in x
-    double **y;                        ///< The grid of offsets in y
-}
-psFixedPattern;
-*/
-
-
-/** Observatory Information
- *
- *  A container for the observatory data that doesn't change per exposure.
- *
- */
-/*typedef struct
-{
-    const char* name;                  ///< Name of observatory
-    const double latitude;             ///< Latitude of observatory, east positive (degrees?)
-    const double longitude;            ///< Longitude of observatory (degrees?)
-    const double height;               ///< Height of observatory in meters
-    const double tlr;                  ///< Tropospheric Lapse Rate
-}
-psObservatory;
-*/
-
-/** Exposure Information
- *
- *  Several quantities from the telescope in order to make a first guess at
- *  the astrometric solution.  From these quantities, further quantities can
- *  be derivedand stored for later use.
- *
- */
-/*typedef struct psExposure
-{
-    const double ra;                   ///< Telescope boresight, right ascention
-    const double dec;                  ///< Telescope boresight, declination
-    const double hourAngle;            ///< Hour angle
-    const double zenithDistance;       ///< Zenith distance
-    const double azimuth;              ///< Azimuth
-    const psTime* time;                ///< Time of observation
-    const float rotAngle;              ///< Rotator position angle in degrees? XXX: see bug#209
-    const float temperature;           ///< Air temperature in Kelvin
-    const float pressure;              ///< Air pressure in mB
-    const float humidity;              ///< Relative humidity, for refraction
-    const float exposureTime;          ///< Exposure time
-    const float wavelength;            ///< Wavelength in microns
-    const psObservatory* observatory;  ///< Observatory data
- 
-    // Derived quantities
-    const double lst;                  ///< Local Sidereal Time
-    const float positionAngle;         ///< Position angle
-    const float parallacticAngle;      ///< Parallactic angle
-    const float airmass;               ///< Airmass, calculated from zenith distance
-    const float parallacticFactor;     ///< Parallactic factor
-    const char* cameraName;            ///< name of camera which provided exposure
-    const char* telescopeName;         ///< name of telescope which provided exposure
-}
-psExposure;
-*/
-
-/** Allocator for psFixedPattern struct
- *
- *  Allocates a new psFixedPattern struct with the attributes coorsponding
- *  to the parameters set to the said input values.
- *
- *  @return psFixedPattern*     New psFixedPattern struct.
- */
-/*psFixedPattern* psFixedPatternAlloc(
-    double x0,           ///< X Position of 0,0 corner on focal plane
-    double y0,           ///< Y Position of 0,0 corner on focal plane
-    double xScale,       ///< Scale of the grid in x direction
-    double yScale,       ///< Scale of the grid in x direction
-    const psImage *x,    ///< The grid of offsets in x
-    const psImage *y     ///< The grid of offsets in y
-);
-*/
-
-/** Allocator for psExposure
- *
- *  We need several quantities from the telescope in order to make a first
- *  guess at the astrometric solution. From these quantities, further
- *  quantities can be derived and stored for later use.
- *
- *  @return     psExposure*    New psExposure struct
- */
-/*psExposure* psExposureAlloc(
-    double ra,                         ///< Telescope boresight, right ascention
-    double dec,                        ///< Telescope boresight, declination
-    double hourAngle,                  ///< Hour angle
-    double zenithDistance,             ///< Zenith distance
-    double azimuth,                    ///< Azimuth
-    const psTime* time,                ///< time of observation
-    float rotAngle,                    ///< Rotator position angle
-    float temperature,                 ///< Temperature
-    float pressure,                    ///< Pressure
-    float humidity,                    ///< Relative humidity
-    float exposureTime,                ///< Exposure time
-    float wavelength,                  ///< wavelength
-    const psObservatory* observatory   ///< Observatory data
-);
-*/
-
-/** Allocator for psObservatory
- *
- *  This function shall construct a new psObservatory with attributes
- *  cooresponding to the function parameters.
- *
- *  @return psObservatory*    new psObservatory struct
- */
-/*psObservatory* psObservatoryAlloc(
-    const char* name,                  ///< Name of observatory
-    double latitude,                   ///< Latitude of observatory, east positive
-    double longitude,                  ///< Longitude of observatory
-    double height,                     ///< Height of observatory
-    double tlr                         ///< Tropospheric Lapse Rate
-);
-*/
-
-/** Allocates a Wallace's Grommit structure.
- *
- *  The psGrommit is calculated from telescope information for the particular
- *  exposure.
- *
- *  @return psGrommit* New grommit structure.
- */
-/*psGrommit* psGrommitAlloc(
-    const psExposure* exp              ///< the cooresponding exposure structure.
-);
-*/
-
 /** Find cooresponding cell for given FPA coordinate
  *
- *  @return psCell*    the cell cooresponding to the coord in FPA
- */
-/*psCell* psCellInFPA(
+ *  @return pmCell*    the cell cooresponding to the coord in FPA
+ */
+pmCell* pmCellInFPA(
     const psPlane* coord,              ///< the coordinate in FPA plane
-    const psFPA* FPA                   ///< the FPA to search for the cell
-);
-*/
+    const pmFPA* FPA                   ///< the FPA to search for the cell
+);
+
 
 /** Find cooresponding chip for given FPA coordinate
  *
- *  @return psChip*    the chip cooresponding to coord
- */
-/*psChip* psChipInFPA(
+ *  @return pmChip*    the chip cooresponding to coord
+ */
+pmChip* pmChipInFPA(
     const psPlane* coord,              ///< the coordinate in FPA plane
-    const psFPA* FPA                   ///< the FPA to search for the cell
-);
-*/
+    const pmFPA* FPA                   ///< the FPA to search for the cell
+);
+
 
 /** Find cooresponding cell for given Chip coordinate
  *
- *  @return psCell*    the cell cooresponding to coord
- */
-/*psCell* psCellInChip(
+ *  @return pmCell*    the cell cooresponding to coord
+ */
+pmCell* pmCellInChip(
     const psPlane* coord,              ///< the coordinate in Chip plane
-    const psChip* chip                 ///< the chip to search for the cell
-);
-*/
+    const pmChip* chip                 ///< the chip to search for the cell
+);
+
 
 /** Translate a cell coordinate into a chip coordinate
@@ -429,10 +270,10 @@
  *  @return psPlane*    the resulting chip coordinate
  */
-/*psPlane* psCoordCellToChip(
+psPlane* psCoordCellToChip(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the coordinate within Cell
-    const psCell* cell                 ///< the Cell in interest
-);
-*/
+    const pmCell* cell                 ///< the Cell in interest
+);
+
 
 /** Translate a chip coordinate into a FPA coordinate
@@ -440,10 +281,10 @@
  *  @return psPlane*    the resulting FPA coordinate
  */
-/*psPlane* psCoordChipToFPA(
+psPlane* psCoordChipToFPA(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the coordinate within Chip
-    const psChip* chip                 ///< the chip in interest
-);
-*/
+    const pmChip* chip                 ///< the chip in interest
+);
+
 
 /** Translate a FPA coordinate into a Tangent Plane coordinate
@@ -451,12 +292,12 @@
  *  @return psPlane*    the resulting Tangent Plane coordinate
  */
-/*psPlane* psCoordFPAToTP(
+psPlane* psCoordFPAToTP(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the coordinate within FPA
     double color,                      ///< Color of source
     double magnitude,                  ///< Magnitude of source
-    const psFPA* fpa                   ///< the FPA in interest
-);
-*/
+    const pmFPA* fpa                   ///< the FPA in interest
+);
+
 
 /** Translate a Tangent Plane coordinate into a Sky coordinate
@@ -464,10 +305,9 @@
  *  @return psSphere*    the resulting Sky coordinate
  */
-/*psSphere* psCoordTPToSky(
+psSphere* psCoordTPToSky(
     psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
-    const psPlane* in,                 ///< the coordinate within Tangent Plane
-    const psGrommit* grommit           ///< the grommit of the tangent plane
-);
-*/
+    const psPlane* in,                ///< the coordinate within Tangent Plane
+    const psProjection *projection
+);
 
 /** Translate a cell coordinate into a FPA coordinate
@@ -475,10 +315,10 @@
  *  @return psPlane*    the resulting FPA coordinate
  */
-/*psPlane* psCoordCellToFPA(
+psPlane* psCoordCellToFPA(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the coordinate within cell
-    const psCell* cell                 ///< the cell in interest
-);
-*/
+    const pmCell* cell                 ///< the cell in interest
+);
+
 
 /** Translate a cell coordinate into a Sky coordinate
@@ -486,12 +326,12 @@
  *  @return psSphere*    the resulting Sky coordinate
  */
-/*psSphere* psCoordCellToSky(
+psSphere* psCoordCellToSky(
     psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the coordinate within cell
     double color,                      ///< Color of source
     double magnitude,                  ///< Magnitude of source
-    const psCell* cell                 ///< the cell in interest
-);
-*/
+    const pmCell* cell                 ///< the cell in interest
+);
+
 
 /** Translate a cell coordinate into a Sky coordinate using a 'quick and
@@ -500,10 +340,10 @@
  *  @return psSphere*    the resulting Sky coordinate
  */
-/*psSphere* psCoordCellToSkyQuick(
+psSphere* psCoordCellToSkyQuick(
     psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the coordinate within cell
-    const psCell* cell                 ///< the cell in interest
-);
-*/
+    const pmCell* cell                 ///< the cell in interest
+);
+
 
 /** Translate a Sky coordinate into a Tangent Plane coordinate
@@ -511,10 +351,9 @@
  *  @return psPlane*    the resulting Tangent Plane coordinate
  */
-/*psPlane* psCoordSkyToTP(
+psPlane* psCoordSkyToTP(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psSphere* in,                ///< the sky coordinate
-    const psGrommit* grommit           ///< the grommit
-);
-*/
+    const psProjection *projection
+);
 
 /** Translate a Tangent Plane coordinate into a FPA coordinate
@@ -522,12 +361,12 @@
  *  @return psPlane*    the resulting FPA coordinate
  */
-/*psPlane* psCoordTPToFPA(
+psPlane* psCoordTPToFPA(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the coordinate within tangent plane
     double color,                      ///< Color of source
     double magnitude,                  ///< Magnitude of source
-    const psFPA* fpa                   ///< the FPA of interest
-);
-*/
+    const pmFPA* fpa                   ///< the FPA of interest
+);
+
 
 /** Translate a FPA coordinate into a chip coordinate
@@ -535,10 +374,10 @@
  *  @return psPlane*    the resulting chip coordinate
  */
-/*psPlane* psCoordFPAToChip(
+psPlane* psCoordFPAToChip(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the FPA coordinate
-    const psChip* chip                 ///< the chip of interest
-);
-*/
+    const pmChip* chip                 ///< the chip of interest
+);
+
 
 /** Translate a chip coordinate into a cell coordinate
@@ -546,10 +385,10 @@
  *  @return psPlane*    the resulting cell coordinate
  */
-/*psPlane* psCoordChipToCell(
+psPlane* psCoordChipToCell(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psPlane* in,                 ///< the Chip coordinate
-    const psCell* cell                 ///< the cell of interest
-);
-*/
+    const pmCell* cell                 ///< the cell of interest
+);
+
 
 /** Translate a sky coordinate into a cell coordinate
@@ -557,12 +396,12 @@
  *  @return psPlane*    the resulting cell coordinate
  */
-/*psPlane* psCoordSkyToCell(
+psPlane* psCoordSkyToCell(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psSphere* in,                ///< the Sky coordinate
-    double color,                      ///< Color of source
-    double magnitude,                  ///< Magnitude of source
-    const psCell* cell                 ///< the cell of interest
-);
-*/
+    float color,                       ///< Color of source
+    float magnitude,                   ///< Magnitude of source
+    const pmCell* cell                 ///< the cell of interest
+);
+
 
 /** Translate a sky coordinate into a cell coordinate using a 'quick and
@@ -571,10 +410,10 @@
  *  @return psPlane*    the resulting cell coordinate
  */
-/*psPlane* psCoordSkyToCellQuick(
+psPlane* psCoordSkyToCellQuick(
     psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
     const psSphere* in,                ///< the Sky coordinate
-    const psCell* cell                 ///< the cell of interest
-);
-*/
+    const pmCell* cell                 ///< the cell of interest
+);
+
 
 #endif // #ifndef PS_ASTROMETRY_H
Index: /trunk/psModules/src/pmFlatField.c
===================================================================
--- /trunk/psModules/src/pmFlatField.c	(revision 4769)
+++ /trunk/psModules/src/pmFlatField.c	(revision 4770)
@@ -18,6 +18,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-06 02:42:03 $
+ *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -38,6 +38,8 @@
 
 
-bool pmFlatField(psReadout *in, const psReadout *flat)
+bool pmFlatField(pmReadout *in, pmReadout *mask, const pmReadout *flat)
 {
+    // XXX: Not sure if this is correct.  Must consult with IfA.
+    PS_ASSERT_PTR_NON_NULL(mask, false);
     int i = 0;
     int j = 0;
@@ -71,11 +73,9 @@
                  PS_ERRORTEXT_pmFlatField_NULL_FLAT_IMAGE);
         return false;
-    } else if(in->mask == NULL) {
-        in->mask = psImageAlloc(inImage->numCols, inImage->numRows, PS_TYPE_MASK);
-        memset(in->mask->data.V[0], 0, inImage->numCols*inImage->numRows*PSELEMTYPE_SIZEOF(PS_TYPE_MASK));
     }
-    inMask = in->mask;
+    inMask = mask->image;
 
     // Check input image and its mask are not larger than flat image
+
     if(inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) {
         psError( PS_ERR_BAD_PARAMETER_SIZE, true,
Index: /trunk/psModules/src/pmFlatField.h
===================================================================
--- /trunk/psModules/src/pmFlatField.h	(revision 4769)
+++ /trunk/psModules/src/pmFlatField.h	(revision 4770)
@@ -18,6 +18,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-11 00:03:51 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -36,6 +36,7 @@
  */
 bool pmFlatField(
-    psReadout *in,          ///< Redout with input image and mask
-    const psReadout *flat   ///< Readout with flat image
+    pmReadout *in,          ///< Readout with input image
+    pmReadout *mask,        ///< Input image mask
+    const pmReadout *flat   ///< Readout with flat image
 );
 
Index: /trunk/psModules/src/pmMaskBadPixels.c
===================================================================
--- /trunk/psModules/src/pmMaskBadPixels.c	(revision 4769)
+++ /trunk/psModules/src/pmMaskBadPixels.c	(revision 4770)
@@ -19,6 +19,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-04 02:02:10 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -36,5 +36,5 @@
 #include "pmMaskBadPixelsErrors.h"
 
-bool pmMaskBadPixels(psReadout *in, const psImage *mask, unsigned int maskVal, float sat,
+bool pmMaskBadPixels(pmReadout *in, const psImage *mask, unsigned int maskVal, float sat,
                      unsigned int growVal, int grow)
 {
Index: /trunk/psModules/src/pmMaskBadPixels.h
===================================================================
--- /trunk/psModules/src/pmMaskBadPixels.h	(revision 4769)
+++ /trunk/psModules/src/pmMaskBadPixels.h	(revision 4770)
@@ -19,6 +19,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-11 00:03:51 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -52,5 +52,5 @@
  */
 bool pmMaskBadPixels(
-    psReadout *in,          ///< Readout containing input image data.
+    pmReadout *in,          ///< Readout containing input image data.
     const psImage *mask,    ///< Mask data to be added to readout mask data.
     unsigned int maskVal,   ///< Mask value to determine what to add to input mask.
Index: /trunk/psModules/src/pmNonLinear.c
===================================================================
--- /trunk/psModules/src/pmNonLinear.c	(revision 4769)
+++ /trunk/psModules/src/pmNonLinear.c	(revision 4770)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-25 20:28:32 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -24,5 +24,5 @@
 
 /******************************************************************************
-pmNonLinearityLookup(): This routine will take an psReadout image as input
+pmNonLinearityLookup(): This routine will take an pmReadout image as input
 and a 1-D polynomial.  For each pixel in the input image, the polynomial will
 be evaluated at that pixels value, and the image pixel will then be set to
@@ -30,5 +30,5 @@
  *****************************************************************************/
 
-psReadout *pmNonLinearityPolynomial(psReadout *inputReadout,
+pmReadout *pmNonLinearityPolynomial(pmReadout *inputReadout,
                                     const psPolynomial1D *input1DPoly)
 {
@@ -51,5 +51,5 @@
 
 /******************************************************************************
-pmNonLinearityLookup(): This routine will take an psReadout image as input
+pmNonLinearityLookup(): This routine will take an pmReadout image as input
 and two input vectors, which constitute a lookup table.  For each pixel in
 the input image, that pixels value will be determined in the input vector
@@ -57,5 +57,5 @@
 be set to the value from outFlux.
  *****************************************************************************/
-psReadout *pmNonLinearityLookup(psReadout *inputReadout,
+pmReadout *pmNonLinearityLookup(pmReadout *inputReadout,
                                 const psVector *inFlux,
                                 const psVector *outFlux)
Index: /trunk/psModules/src/pmNonLinear.h
===================================================================
--- /trunk/psModules/src/pmNonLinear.h	(revision 4769)
+++ /trunk/psModules/src/pmNonLinear.h	(revision 4770)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-11 00:03:51 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,8 +18,8 @@
 #include "pmAstrometry.h"
 
-psReadout *pmNonLinearityPolynomial(psReadout *in,
+pmReadout *pmNonLinearityPolynomial(pmReadout *in,
                                     const psPolynomial1D *coeff);
 
-psReadout *pmNonLinearityLookup(psReadout *in,
+pmReadout *pmNonLinearityLookup(pmReadout *in,
                                 const psVector *inFlux,
                                 const psVector *outFlux);
Index: /trunk/psModules/src/pmObjects.c
===================================================================
--- /trunk/psModules/src/pmObjects.c	(revision 4769)
+++ /trunk/psModules/src/pmObjects.c	(revision 4770)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-19 01:44:48 $
+ *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,12 +20,12 @@
 
 /******************************************************************************
-pmPeakAlloc(): Allocate the psPeak data structure and set appropriate members.
-*****************************************************************************/
-psPeak *pmPeakAlloc(psS32 x,
+pmPeakAlloc(): Allocate the pmPeak data structure and set appropriate members.
+*****************************************************************************/
+pmPeak *pmPeakAlloc(psS32 x,
                     psS32 y,
                     psF32 counts,
-                    psPeakType class)
-{
-    psPeak *tmp = (psPeak *) psAlloc(sizeof(psPeak));
+                    pmPeakType class)
+{
+    pmPeak *tmp = (pmPeak *) psAlloc(sizeof(pmPeak));
     tmp->x = x;
     tmp->y = y;
@@ -37,10 +37,10 @@
 
 /******************************************************************************
-pmMomentsAlloc(): Allocate the psMoments structure and initialize the members
+pmMomentsAlloc(): Allocate the pmMoments structure and initialize the members
 to zero.
 *****************************************************************************/
-psMoments *pmMomentsAlloc()
-{
-    psMoments *tmp = (psMoments *) psAlloc(sizeof(psMoments));
+pmMoments *pmMomentsAlloc()
+{
+    pmMoments *tmp = (pmMoments *) psAlloc(sizeof(pmMoments));
     tmp->x = 0.0;
     tmp->y = 0.0;
@@ -56,5 +56,5 @@
 }
 
-static void modelFree(psModel *tmp)
+static void modelFree(pmModel *tmp)
 {
     psFree(tmp->params);
@@ -63,11 +63,11 @@
 
 /******************************************************************************
-pmModelAlloc(): Allocate the psModel structure, along with its parameters,
+pmModelAlloc(): Allocate the pmModel structure, along with its parameters,
 and initialize the type member.  Initialize the params to 0.0.
 XXX EAM: changing params and dparams to psVector
 *****************************************************************************/
-psModel *pmModelAlloc(psModelType type)
-{
-    psModel *tmp = (psModel *) psAlloc(sizeof(psModel));
+pmModel *pmModelAlloc(pmModelType type)
+{
+    pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel));
 
     tmp->type = type;
@@ -99,5 +99,5 @@
         break;
     default:
-        psError(PS_ERR_UNKNOWN, true, "Undefined psModelType");
+        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
         return(NULL);
     }
@@ -116,5 +116,5 @@
 We might need to increase the reference counter and decrease it here.
 *****************************************************************************/
-static void sourceFree(psSource *tmp)
+static void sourceFree(pmSource *tmp)
 {
     psFree(tmp->peak);
@@ -122,19 +122,21 @@
     //    psFree(tmp->mask);
     psFree(tmp->moments);
-    psFree(tmp->models);
-}
-
-/******************************************************************************
-pmSourceAlloc(): Allocate the psSource structure and initialize its members
+    psFree(tmp->modelPSF);
+    psFree(tmp->modelFLT);
+}
+
+/******************************************************************************
+pmSourceAlloc(): Allocate the pmSource structure and initialize its members
 to NULL.
 *****************************************************************************/
-psSource *pmSourceAlloc()
-{
-    psSource *tmp = (psSource *) psAlloc(sizeof(psSource));
+pmSource *pmSourceAlloc()
+{
+    pmSource *tmp = (pmSource *) psAlloc(sizeof(pmSource));
     tmp->peak = NULL;
     tmp->pixels = NULL;
     tmp->mask = NULL;
     tmp->moments = NULL;
-    tmp->models = NULL;
+    tmp->modelPSF = NULL;
+    tmp->modelFLT = NULL;
     tmp->type = 0;
     psMemSetDeallocator(tmp, (psFreeFunc) sourceFree);
@@ -272,7 +274,7 @@
                               psS32 col,
                               psF32 counts,
-                              psPeakType type)
-{
-    psPeak *tmpPeak = pmPeakAlloc(col, row, counts, type);
+                              pmPeakType type)
+{
+    pmPeak *tmpPeak = pmPeakAlloc(col, row, counts, type);
 
     if (list == NULL) {
@@ -379,5 +381,5 @@
         // Step through all local peaks in this row.
         for (psU32 i = 0 ; i < row1->n ; i++ ) {
-            psPeakType myType = PM_PEAK_UNDEF;
+            pmPeakType myType = PM_PEAK_UNDEF;
             col = row1->data.U32[i];
 
@@ -527,5 +529,5 @@
     //    printf("pmCullPeaks(): list size is %d\n", peaks->size);
     while (tmpListElem != NULL) {
-        psPeak *tmpPeak = (psPeak *) tmpListElem->data;
+        pmPeak *tmpPeak = (pmPeak *) tmpListElem->data;
         if ((tmpPeak->counts > maxValue) ||
                 ((valid != NULL) &&
@@ -553,5 +555,5 @@
 
     for (int i = 0; i < peaks->n; i++) {
-        psPeak *tmpPeak = (psPeak *) peaks->data[i];
+        pmPeak *tmpPeak = (pmPeak *) peaks->data[i];
         if (tmpPeak->counts > maxValue)
             continue;
@@ -566,8 +568,8 @@
 
 /******************************************************************************
-psSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): this
-routine creates a new psSource data structure and sets the following members:
-    ->psPeak
-    ->psMoments->sky
+pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): this
+routine creates a new pmSource data structure and sets the following members:
+    ->pmPeak
+    ->pmMoments->sky
  
 The sky value is set from the pixels in the square annulus surrounding the
@@ -590,5 +592,5 @@
      or they use the image row/column offsets.
  
-XXX: Should we simply set psSource->peak = peak?  If so, should we increase
+XXX: Should we simply set pmSource->peak = peak?  If so, should we increase
 the reference counter?  Or, should we copy the data structure?
  
@@ -602,6 +604,6 @@
      members.
 *****************************************************************************/
-psSource *pmSourceLocalSky(const psImage *image,
-                           const psPeak *peak,
+pmSource *pmSourceLocalSky(const psImage *image,
+                           const pmPeak *peak,
                            psStatsOptions statsOptions,
                            psF32 innerRadius,
@@ -723,6 +725,6 @@
     // Create the output mySource, and set appropriate members.
     //
-    psSource *mySource = pmSourceAlloc();
-    mySource->peak = (psPeak *) peak;
+    pmSource *mySource = pmSourceAlloc();
+    mySource->peak = (pmPeak *) peak;
     mySource->moments = pmMomentsAlloc();
     psF64 tmpF64;
@@ -746,5 +748,5 @@
 XXX: macro this for performance.
 *****************************************************************************/
-static bool checkRadius(psPeak *peak,
+static bool checkRadius(pmPeak *peak,
                         psF32 radius,
                         psS32 x,
@@ -781,11 +783,11 @@
 /******************************************************************************
 pmSourceMoments(source, radius): this function takes a subImage defined in the
-psSource data structure, along with the peak location, and determines the
+pmSource data structure, along with the peak location, and determines the
 various moments associated with that peak.
  
 Requires the following to have been created:
-    psSource
-    psSource->peak
-    psSource->pixels
+    pmSource
+    pmSource->peak
+    pmSource->pixels
  
 XXX: The peak calculations are done in image coords, not subImage coords.
@@ -793,5 +795,5 @@
 XXX: mask values?
 *****************************************************************************/
-psSource *pmSourceMoments(psSource *source,
+pmSource *pmSourceMoments(pmSource *source,
                           psF32 radius)
 {
@@ -925,6 +927,6 @@
 int pmComparePeakAscend (const void **a, const void **b)
 {
-    psPeak *A = *(psPeak **)a;
-    psPeak *B = *(psPeak **)b;
+    pmPeak *A = *(pmPeak **)a;
+    pmPeak *B = *(pmPeak **)b;
 
     psF32 diff;
@@ -940,6 +942,6 @@
 int pmComparePeakDescend (const void **a, const void **b)
 {
-    psPeak *A = *(psPeak **)a;
-    psPeak *B = *(psPeak **)b;
+    pmPeak *A = *(pmPeak **)a;
+    pmPeak *B = *(pmPeak **)b;
 
     psF32 diff;
@@ -992,5 +994,5 @@
         for (psS32 i = 0 ; i < sources->n ; i++)
         {
-            psSource *tmpSrc = (psSource *) sources->data[i];
+            pmSource *tmpSrc = (pmSource *) sources->data[i];
             PS_ASSERT_PTR_NON_NULL(tmpSrc, false); // just skip this one?
             PS_ASSERT_PTR_NON_NULL(tmpSrc->moments, false); // just skip this one?
@@ -1027,5 +1029,5 @@
     // measure statistics on Sx, Sy if Sx, Sy within range of clump
     {
-        psPeak *clump;
+        pmPeak *clump;
         psF32 minSx, maxSx;
         psF32 minSy, maxSy;
@@ -1054,5 +1056,5 @@
         for (psS32 i = 0 ; i < sources->n ; i++)
         {
-            psSource *tmpSrc = (psSource *) sources->data[i];
+            pmSource *tmpSrc = (pmSource *) sources->data[i];
 
             if (tmpSrc->moments->Sx < minSx)
@@ -1103,5 +1105,5 @@
     for (psS32 i = 0 ; i < sources->n ; i++) {
 
-        psSource *tmpSrc = (psSource *) sources->data[i];
+        pmSource *tmpSrc = (pmSource *) sources->data[i];
 
         tmpSrc->peak->class = 0;
@@ -1197,5 +1199,5 @@
      the pmSourceSetLocal() function.
 *****************************************************************************/
-bool pmSourceSetPixelsCircle(psSource *source,
+bool pmSourceSetPixelsCircle(pmSource *source,
                              const psImage *image,
                              psF32 radius)
@@ -1293,7 +1295,7 @@
 /******************************************************************************
 pmSourceModelGuess(source, image, model): This function allocates a new
-psModel structure and stores it in the psSource data structure specified in
+pmModel structure and stores it in the pmSource data structure specified in
 the argument list.  The model type is specified in the argument list.  The
-params array in that psModel structure are allocated, and then set to the
+params array in that pmModel structure are allocated, and then set to the
 appropriate values.  This function returns true if everything was successful.
  
@@ -1306,8 +1308,11 @@
 image, not subImage coords.  Therefore, the calls to the model evaluation
 functions will be in image, not subImage coords.  Remember this.
-*****************************************************************************/
-bool pmSourceModelGuess(psSource *source,
+ 
+XXX: The source->models member used to be allocated here.  Now I assume
+->modelPSF should be allocated
+*****************************************************************************/
+bool pmSourceModelGuess(pmSource *source,
                         const psImage *image,
-                        psModelType model)
+                        pmModelType model)
 {
     PS_ASSERT_PTR_NON_NULL(source, false);
@@ -1316,7 +1321,7 @@
     PS_ASSERT_IMAGE_NON_NULL(image, false);
     PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false);
-    if (source->models != NULL) {
-        psLogMsg(__func__, PS_LOG_WARN, "WARNING: source->models was non-NULL; calling psFree(source->models).\n");
-        psFree(source->models);
+    if (source->modelPSF != NULL) {
+        psLogMsg(__func__, PS_LOG_WARN, "WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).\n");
+        psFree(source->modelPSF);
     }
     if (!((model == PS_MODEL_GAUSS) ||
@@ -1330,7 +1335,7 @@
     }
 
-    source->models = pmModelAlloc(model);
-
-    psVector *params = source->models->params;
+    source->modelPSF = pmModelAlloc(model);
+
+    psVector *params = source->modelPSF->params;
 
     switch (model) {
@@ -1364,6 +1369,6 @@
         params->data.F32[6] = source->moments->Sxy;
         // XXX: What are these?
-        // source->models->params[7] = B2;
-        // source->models->params[8] = B3;
+        // source->modelPSF->params[7] = B2;
+        // source->modelPSF->params[8] = B3;
         return(true);
 
@@ -1420,5 +1425,5 @@
 /******************************************************************************
 evalModel(source, level, row): a private function which evaluates the
-source->model function at the specified coords.  The coords are subImage, not
+source->modelPSF function at the specified coords.  The coords are subImage, not
 image coords.
  
@@ -1430,5 +1435,5 @@
 the coords is in subImage or image space.
  
-XXX: This should probably be a public psModules function.
+XXX: This should probably be a public pmModules function.
  
 XXX: Use static vectors for x.
@@ -1439,17 +1444,17 @@
 testing.  Try to reproduce that and debug.
 *****************************************************************************/
-static psF32 evalModel(psSource *src,
+static psF32 evalModel(pmSource *src,
                        psU32 row,
                        psU32 col)
 {
     PS_ASSERT_PTR_NON_NULL(src, false);
-    PS_ASSERT_PTR_NON_NULL(src->models, false);
-    PS_ASSERT_PTR_NON_NULL(src->models->params, false);
-
-    // XXX: The following step will not be necessary if the models->params
+    PS_ASSERT_PTR_NON_NULL(src->modelPSF, false);
+    PS_ASSERT_PTR_NON_NULL(src->modelPSF->params, false);
+
+    // XXX: The following step will not be necessary if the modelPSF->params
     // member is a psVector.  Suggest to IfA.
 
-    // XXX EAM: done: models->params is now a vector
-    psVector *params = src->models->params;
+    // XXX EAM: done: modelPSF->params is now a vector
+    psVector *params = src->modelPSF->params;
 
     //
@@ -1461,5 +1466,5 @@
     psF32 tmpF;
 
-    switch (src->models->type) {
+    switch (src->modelPSF->type) {
     case PS_MODEL_GAUSS:
         tmpF = pmMinLM_Gauss2D(NULL, params, x);
@@ -1481,5 +1486,5 @@
         break;
     default:
-        psError(PS_ERR_UNKNOWN, true, "Undefined psModelType");
+        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
         return(NAN);
     }
@@ -1500,5 +1505,5 @@
 XXX: The result is returned in image coords.
 *****************************************************************************/
-static psF32 findValue(psSource *source,
+static psF32 findValue(pmSource *source,
                        psF32 level,
                        psU32 row,
@@ -1575,5 +1580,5 @@
 XXX: The top, bottom of the contour is not correctly determined.
 *****************************************************************************/
-psArray *pmSourceContour(psSource *source,
+psArray *pmSourceContour(pmSource *source,
                          const psImage *image,
                          psF32 level,
@@ -1585,5 +1590,5 @@
     PS_ASSERT_PTR_NON_NULL(source->peak, false);
     PS_ASSERT_PTR_NON_NULL(source->pixels, false);
-    PS_ASSERT_PTR_NON_NULL(source->models, false);
+    PS_ASSERT_PTR_NON_NULL(source->modelPSF, false);
 
     //
@@ -1692,5 +1697,5 @@
 XXX: Probably should remove the "image" argument.
 *****************************************************************************/
-bool pmSourceFitModel(psSource *source,
+bool pmSourceFitModel(pmSource *source,
                       const psImage *image)
 {
@@ -1699,5 +1704,5 @@
     PS_ASSERT_PTR_NON_NULL(source->peak, false);
     PS_ASSERT_PTR_NON_NULL(source->pixels, false);
-    PS_ASSERT_PTR_NON_NULL(source->models, false);
+    PS_ASSERT_PTR_NON_NULL(source->modelPSF, false);
     PS_ASSERT_IMAGE_NON_NULL(image, false);
     PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false);
@@ -1742,7 +1747,7 @@
                             PM_SOURCE_FIT_MODEL_TOLERANCE);
 
-    psVector *params = source->models->params;
-
-    switch (source->models->type) {
+    psVector *params = source->modelPSF->params;
+
+    switch (source->modelPSF->type) {
     case PS_MODEL_GAUSS:
         rc = psMinimizeLMChi2(myMin, NULL, params, NULL, x, y, yErr, pmMinLM_Gauss2D);
@@ -1764,12 +1769,12 @@
         break;
     default:
-        psError(PS_ERR_UNKNOWN, true, "Undefined psModelType");
+        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
         rc = false;
     }
     // XXX EAM: we need to do something (give an error?) if rc is false
     // XXX EAM: save the resulting chisq, nDOF, nIter
-    source->models->chisq = myMin->value;
-    source->models->nDOF  = y->n - params->n;
-    source->models->nIter = myMin->iter;
+    source->modelPSF->chisq = myMin->value;
+    source->modelPSF->nDOF  = y->n - params->n;
+    source->modelPSF->nIter = myMin->iter;
 
     psFree(x);
@@ -1780,5 +1785,5 @@
 
 static bool sourceAddOrSubModel(psImage *image,
-                                psSource *src,
+                                pmSource *src,
                                 bool center,
                                 psS32 flag)
@@ -1788,10 +1793,10 @@
     PS_ASSERT_PTR_NON_NULL(src->peak, false);
     PS_ASSERT_PTR_NON_NULL(src->pixels, false);
-    PS_ASSERT_PTR_NON_NULL(src->models, false);
+    PS_ASSERT_PTR_NON_NULL(src->modelPSF, false);
     PS_ASSERT_IMAGE_NON_NULL(image, false);
     PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false);
 
     psVector *x = psVectorAlloc(2, PS_TYPE_F32);
-    psVector *params = src->models->params;
+    psVector *params = src->modelPSF->params;
 
     for (psS32 i = 0; i < src->pixels->numRows; i++) {
@@ -1808,5 +1813,5 @@
             x->data.F32[0] = (float) imageCol;
             x->data.F32[1] = (float) imageRow;
-            switch (src->models->type) {
+            switch (src->modelPSF->type) {
             case PS_MODEL_GAUSS:
                 pixelValue = pmMinLM_Gauss2D(NULL, params, x);
@@ -1828,5 +1833,5 @@
                 break;
             default:
-                psError(PS_ERR_UNKNOWN, true, "Undefined psModelType");
+                psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
                 psFree(x);
                 return(false);
@@ -1851,5 +1856,5 @@
  *****************************************************************************/
 bool pmSourceAddModel(psImage *image,
-                      psSource *src,
+                      pmSource *src,
                       bool center)
 {
@@ -1860,5 +1865,5 @@
  *****************************************************************************/
 bool pmSourceSubModel(psImage *image,
-                      psSource *src,
+                      pmSource *src,
                       bool center)
 {
Index: /trunk/psModules/src/pmObjects.h
===================================================================
--- /trunk/psModules/src/pmObjects.h	(revision 4769)
+++ /trunk/psModules/src/pmObjects.h	(revision 4770)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-19 01:44:48 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -23,56 +23,91 @@
 #include "pslib.h"
 
+/** pmPeakType
+ * 
+ *  A peak pixel may have several features which may be determined when the
+ *  peak is found or measured. These are specified by the pmPeakType enum.
+ *  PM_PEAK_LONE represents a single pixel which is higher than its 8 immediate
+ *  neighbors.  The PM_PEAK_EDGE represents a peak pixel which touching the image
+ *  edge. The PM_PEAK_FLAT represents a peak pixel which has more than a specific
+ *  number of neighbors at the same value, within some tolarence:
+ * 
+ */
 typedef enum {
-    PM_PEAK_LONE,           ///< Isolated peak.
-    PM_PEAK_EDGE,           ///< Peak on edge.
-    PM_PEAK_FLAT,           ///< Peak has equal-value neighbors.
-    PM_PEAK_UNDEF           ///< Undefined.
-} psPeakType;
-
+    PM_PEAK_LONE,                       ///< Isolated peak.
+    PM_PEAK_EDGE,                       ///< Peak on edge.
+    PM_PEAK_FLAT,                       ///< Peak has equal-value neighbors.
+    PM_PEAK_UNDEF                       ///< Undefined.
+} pmPeakType;
+
+/** pmPeak data structure
+ *  
+ *  
+ *  
+ */
 typedef struct
 {
-    psS32 x;                ///< X-coordinate of peak pixel.
-    psS32 y;                ///< Y-coordinate of peak pixel.
-    psF32 counts;           ///< Value of peak pixel (above sky?).
-    psPeakType class;       ///< Description of peak.
+    int x;                              ///< X-coordinate of peak pixel.
+    int y;                              ///< Y-coordinate of peak pixel.
+    float counts;                       ///< Value of peak pixel (above sky?).
+    pmPeakType class;                   ///< Description of peak.
 }
-psPeak;
-
+pmPeak;
+
+/** pmMoments data structure
+ *  
+ *  
+ *  
+ */
 typedef struct
 {
-    psF32 x;                ///< X-coord of centroid.
-    psF32 y;                ///< Y-coord of centroid.
-    psF32 Sx;               ///< x-second moment.
-    psF32 Sy;               ///< y-second moment.
-    psF32 Sxy;              ///< xy cross moment.
-    psF32 Sum;              ///< Pixel sum above sky (background).
-    psF32 Peak;             ///< Peak counts above sky.
-    psF32 Sky;              ///< Sky level (background).
-    psS32 nPixels;          ///< Number of pixels used.
+    float x;                            ///< X-coord of centroid.
+    float y;                            ///< Y-coord of centroid.
+    float Sx;                           ///< x-second moment.
+    float Sy;                           ///< y-second moment.
+    float Sxy;                          ///< xy cross moment.
+    float Sum;                          ///< Pixel sum above sky (background).
+    float Peak;                         ///< Peak counts above sky.
+    float Sky;                          ///< Sky level (background).
+    int nPixels;                        ///< Number of pixels used.
 }
-psMoments;
-
+pmMoments;
+
+/** pmModelType enumeration
+ *  
+ *  
+ *  
+ */
 typedef enum {
-    PS_MODEL_GAUSS,   ///< Regular 2-D Gaussian
-    PS_MODEL_PGAUSS,  ///< Psuedo 2-D Gaussian
-    PS_MODEL_TWIST_GAUSS, ///< 2-D Twisted Gaussian
-    PS_MODEL_WAUSS,  ///< 2-D Waussian
-    PS_MODEL_SERSIC,  ///< Sersic
-    PS_MODEL_SERSIC_CORE, ///< Sersic Core
-    PS_MODEL_UNDEFINED  ///< Undefined
-} psModelType;
-
-// XXX: It will be better if params, and dparams, were psVectors.
+    PS_MODEL_GAUSS,                     ///< Regular 2-D Gaussian
+    PS_MODEL_PGAUSS,                    ///< Psuedo 2-D Gaussian
+    PS_MODEL_TWIST_GAUSS,               ///< 2-D Twisted Gaussian
+    PS_MODEL_WAUSS,                     ///< 2-D Waussian
+    PS_MODEL_SERSIC,                    ///< Sersic
+    PS_MODEL_SERSIC_CORE,               ///< Sersic Core
+    PS_MODEL_UNDEFINED                  ///< Undefined
+} pmModelType;
+
+/** pmModel data structure
+ *  
+ *  
+ *  
+ */
+// XXX: The SDRS has the "type" member of type psS32.
 typedef struct
 {
-    psModelType type;       ///< Model to be used.
-    psVector *params;       ///< Paramater values.
-    psVector *dparams;      ///< Parameter errors.
-    psF32 chisq;            ///< Fit chi-squared.
-    psS32 nDOF;             ///< number of degrees of freedom
-    psS32 nIter;            ///< number of iterations to reach min
+    pmModelType type;                   ///< Model to be used.
+    psVector *params;                   ///< Paramater values.
+    psVector *dparams;                  ///< Parameter errors.
+    float chisq;                        ///< Fit chi-squared.
+    int nDOF;                           ///< number of degrees of freedom
+    int nIter;                          ///< number of iterations to reach min
 }
-psModel;
-
+pmModel;
+
+/** pmSourceType enumeration
+ *  
+ *  
+ *  
+ */
 typedef enum {
     PS_SOURCE_PSFSTAR,
@@ -84,26 +119,51 @@
     PS_SOURCE_BRIGHTSTAR,
     PS_SOURCE_OTHER
-} psSourceType;
-
+} pmSourceType;
+
+/** pmSource data structure
+ *  
+ *  This source has the capacity for several types of measurements. The
+ *  simplest measurement of a source is the location and flux of the peak pixel
+ *  associated with the source:
+ *  
+ */
 typedef struct
 {
-    psPeak *peak;           ///< Description of peak pixel.
-    psImage *pixels;        ///< Rectangular region including object pixels.
-    psImage *mask;          ///< Mask which marks pixels associated with objects.
-    psMoments *moments;     ///< Basic moments measure for the object.
-    psModel *models;        ///< Model parameters and type.
-    psSourceType type;      ///< Best identification of object.
+    pmPeak *peak;                       ///< Description of peak pixel.
+    psImage *pixels;                    ///< Rectangular region including object pixels.
+    psImage *mask;                      ///< Mask which marks pixels associated with objects.
+    pmMoments *moments;                 ///< Basic moments measure for the object.
+    pmModel *modelPSF;                  ///< PSF model parameters and type
+    pmModel *modelFLT;                  ///< FLT model parameters and type
+    pmSourceType type;                  ///< Best identification of object.
 }
-psSource;
-
-psPeak *pmPeakAlloc(psS32 x,  ///< Row-coordinate in image space
-                    psS32 y,  ///< Col-coordinate in image space
-                    psF32 counts, ///< The value of the peak pixel
-                    psPeakType class ///< The type of peak pixel
-                   );
-
-psMoments *pmMomentsAlloc();
-psModel *pmModelAlloc(psModelType type);
-psSource *pmSourceAlloc();
+pmSource;
+
+/** pmPeak data structure
+ *  
+ *  
+ *  
+ */
+typedef struct
+{
+    psS32 type;                         ///< PSF Model in use
+    psArray *params;                    ///< Model parameters (psPolynomial2D)
+    psF32 chisq;                        ///< PSF goodness statistic
+    psS32 nPSFstars;                    ///< number of stars used to measure PSF
+}
+pmPSF;
+
+
+
+pmPeak *pmPeakAlloc(
+    int x,                              ///< Row-coordinate in image space
+    int y,                              ///< Col-coordinate in image space
+    float counts,                       ///< The value of the peak pixel
+    pmPeakType class                    ///< The type of peak pixel
+);
+
+pmMoments *pmMomentsAlloc();
+pmModel *pmModelAlloc(pmModelType type);
+pmSource *pmSourceAlloc();
 
 /******************************************************************************
@@ -112,7 +172,8 @@
 the location (x value) of all peaks.
  *****************************************************************************/
-psVector *pmFindVectorPeaks(const psVector *vector, ///< The input vector (psF32)
-                            psF32 threshold  ///< Threshold above which to find a peak
-                           );
+psVector *pmFindVectorPeaks(
+    const psVector *vector,             ///< The input vector (float)
+    float threshold                     ///< Threshold above which to find a peak
+);
 
 /******************************************************************************
@@ -121,7 +182,8 @@
 value) of all peaks.
  *****************************************************************************/
-psArray *pmFindImagePeaks(const psImage *image, ///< The input image where peaks will be found (psF32)
-                          psF32 threshold ///< Threshold above which to find a peak
-                         );
+psArray *pmFindImagePeaks(
+    const psImage *image,               ///< The input image where peaks will be found (float)
+    float threshold                     ///< Threshold above which to find a peak
+);
 
 /******************************************************************************
@@ -129,25 +191,28 @@
 a peak value above the given maximum, or fall outside the valid region.
  *****************************************************************************/
-psList *pmCullPeaks(psList *peaks,  ///< The psList of peaks to be culled
-                    psF32 maxValue,  ///< Cull peaks above this value
-                    const psRegion *valid ///< Cull peaks otside this psRegion
-                   );
-
-/******************************************************************************
-psSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius):
+psList *pmCullPeaks(
+    psList *peaks,                      ///< The psList of peaks to be culled
+    float maxValue,                     ///< Cull peaks above this value
+    const psRegion *valid               ///< Cull peaks otside this psRegion
+);
+
+/******************************************************************************
+pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius):
  
  *****************************************************************************/
-psSource *pmSourceLocalSky(const psImage *image, ///< The input image (psF32)
-                           const psPeak *peak,  ///< The peak for which the psSource struct is created.
-                           psStatsOptions statsOptions, ///< The statistic used in calculating the background sky
-                           psF32 innerRadius,  ///< The inner radius of the suqare annulus for calculating sky
-                           psF32 outerRadius  ///< The outer radius of the suqare annulus for calculating sky
-                          );
-
-/******************************************************************************
- *****************************************************************************/
-psSource *pmSourceMoments(psSource *source, ///< The input psSource for which moments will be computed
-                          psF32 radius  ///< Use a circle of pixels around the peak
-                         );
+pmSource *pmSourceLocalSky(
+    const psImage *image,               ///< The input image (float)
+    const pmPeak *peak,                 ///< The peak for which the psSource struct is created.
+    psStatsOptions statsOptions,        ///< The statistic used in calculating the background sky
+    float innerRadius,                  ///< The inner radius of the suqare annulus for calculating sky
+    float outerRadius                   ///< The outer radius of the suqare annulus for calculating sky
+);
+
+/******************************************************************************
+ *****************************************************************************/
+pmSource *pmSourceMoments(
+    pmSource *source,                   ///< The input pmSource for which moments will be computed
+    float radius                        ///< Use a circle of pixels around the peak
+);
 
 /******************************************************************************
@@ -155,21 +220,24 @@
 source classification.
  *****************************************************************************/
-bool pmSourceRoughClass(psArray *source, ///< The input psSource
-                        psMetadata *metadata ///< Contains classification parameters
-                       );
+bool pmSourceRoughClass(
+    psArray *source,                    ///< The input pmSource
+    psMetadata *metadata                ///< Contains classification parameters
+);
 /******************************************************************************
 pmSourceSetPixelCircle(source, image, radius)
  *****************************************************************************/
-bool pmSourceSetPixelsCircle(psSource *source,  ///< The input psSource
-                             const psImage *image, ///< The input image (psF32)
-                             psF32 radius  ///< The radius of the circle
-                            );
-
-/******************************************************************************
- *****************************************************************************/
-bool pmSourceModelGuess(psSource *source, ///< The input psSource
-                        const psImage *image, ///< The input image (psF32)
-                        psModelType model ///< The type of model to be created.
-                       );
+bool pmSourceSetPixelsCircle(
+    pmSource *source,                   ///< The input pmSource
+    const psImage *image,               ///< The input image (float)
+    float radius                        ///< The radius of the circle
+);
+
+/******************************************************************************
+ *****************************************************************************/
+bool pmSourceModelGuess(
+    pmSource *source,                   ///< The input pmSource
+    const psImage *image,               ///< The input image (float)
+    pmModelType model                   ///< The type of model to be created.
+);
 
 /******************************************************************************
@@ -179,38 +247,42 @@
 } pmContourType;
 
-psArray *pmSourceContour(psSource *source, ///< The input psSource
-                         const psImage *image, ///< The input image (psF32) (this arg should be removed)
-                         psF32 level,  ///< The level of the contour
-                         pmContourType mode ///< Currently this must be PS_CONTOUR_CRUDE
-                        );
-
-/******************************************************************************
- *****************************************************************************/
-bool pmSourceFitModel(psSource *source,  ///< The input psSource
-                      const psImage *image ///< The input image (psF32)
-                     );
-
-/******************************************************************************
- *****************************************************************************/
-bool pmSourceAddModel(psImage *image,  ///< The opuut image (psF32)
-                      psSource *source,  ///< The input psSource
-                      bool center  ///< A boolean flag that determines whether pixels are centered
-                     );
-
-/******************************************************************************
- *****************************************************************************/
-bool pmSourceSubModel(psImage *image,  ///< The output image (psF32)
-                      psSource *source,  ///< The input psSource
-                      bool center  ///< A boolean flag that determines whether pixels are centered
-                     );
+psArray *pmSourceContour(
+    pmSource *source,                   ///< The input pmSource
+    const psImage *image,               ///< The input image (float) (this arg should be removed)
+    float level,                        ///< The level of the contour
+    pmContourType mode                  ///< Currently this must be PS_CONTOUR_CRUDE
+);
+
+/******************************************************************************
+ *****************************************************************************/
+bool pmSourceFitModel(
+    pmSource *source,                   ///< The input pmSource
+    const psImage *image                ///< The input image (float)
+);
+
+/******************************************************************************
+ *****************************************************************************/
+bool pmSourceAddModel(
+    psImage *image,                     ///< The opuut image (float)
+    pmSource *source,                   ///< The input pmSource
+    bool center                         ///< A boolean flag that determines whether pixels are centered
+);
+
+/******************************************************************************
+ *****************************************************************************/
+bool pmSourceSubModel(
+    psImage *image,                     ///< The output image (float)
+    pmSource *source,                   ///< The input pmSource
+    bool center                         ///< A boolean flag that determines whether pixels are centered
+);
 
 /******************************************************************************
 XXX: Why only *x argument?
-XXX EAM: psMinimizeLMChi2Func returns psF64, not psF32
+XXX EAM: psMinimizeLMChi2Func returns psF64, not float
  *****************************************************************************/
 float pmMinLM_Gauss2D(
-    psVector *deriv,                   ///< A possibly-NULL structure for the output derivatives
-    const psVector *params,            ///< A psVector which holds the parameters of this function
-    const psVector *x                  ///< A psVector which holds the row/col coordinate
+    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
+    const psVector *params,             ///< A psVector which holds the parameters of this function
+    const psVector *x                   ///< A psVector which holds the row/col coordinate
 );
 
@@ -218,7 +290,7 @@
  *****************************************************************************/
 float pmMinLM_PsuedoGauss2D(
-    psVector *deriv, ///< A possibly-NULL structure for the output derivatives
-    const psVector *params, ///< A psVector which holds the parameters of this function
-    const psVector *x  ///< A psVector which holds the row/col coordinate
+    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
+    const psVector *params,             ///< A psVector which holds the parameters of this function
+    const psVector *x                   ///< A psVector which holds the row/col coordinate
 );
 
@@ -226,7 +298,7 @@
  *****************************************************************************/
 float pmMinLM_Wauss2D(
-    psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
-    const psVector *params,  ///< A psVector which holds the parameters of this function
-    const psVector *x  ///< A psVector which holds the row/col coordinate
+    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
+    const psVector *params,             ///< A psVector which holds the parameters of this function
+    const psVector *x                   ///< A psVector which holds the row/col coordinate
 );
 
@@ -234,7 +306,7 @@
  *****************************************************************************/
 float pmMinLM_TwistGauss2D(
-    psVector *deriv, ///< A possibly-NULL structure for the output derivatives
-    const psVector *params, ///< A psVector which holds the parameters of this function
-    const psVector *x  ///< A psVector which holds the row/col coordinate
+    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
+    const psVector *params,             ///< A psVector which holds the parameters of this function
+    const psVector *x                   ///< A psVector which holds the row/col coordinate
 );
 
@@ -242,7 +314,7 @@
  *****************************************************************************/
 float pmMinLM_Sersic(
-    psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
-    const psVector *params,  ///< A psVector which holds the parameters of this function
-    const psVector *x  ///< A psVector which holds the row/col coordinate
+    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
+    const psVector *params,             ///< A psVector which holds the parameters of this function
+    const psVector *x                   ///< A psVector which holds the row/col coordinate
 );
 
@@ -250,7 +322,7 @@
  *****************************************************************************/
 float pmMinLM_SersicCore(
-    psVector *deriv, ///< A possibly-NULL structure for the output derivatives
-    const psVector *params, ///< A psVector which holds the parameters of this function
-    const psVector *x  ///< A psVector which holds the row/col coordinate
+    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
+    const psVector *params,             ///< A psVector which holds the parameters of this function
+    const psVector *x                   ///< A psVector which holds the row/col coordinate
 );
 
@@ -258,9 +330,73 @@
  *****************************************************************************/
 float pmMinLM_PsuedoSersic(
-    psVector *deriv, ///< A possibly-NULL structure for the output derivatives
-    const psVector *params, ///< A psVector which holds the parameters of this function
-    const psVector *x  ///< A psVector which holds the row/col coordinate
-);
-
+    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
+    const psVector *params,             ///< A psVector which holds the parameters of this function
+    const psVector *x                   ///< A psVector which holds the row/col coordinate
+);
+
+
+/**
+ * 
+ *  The object model functions are defined to allow for the flexible addition
+ *  of new object models. Every object model, with parameters represented by
+ *  pmModel, has an associated set of functions which provide necessary support
+ *  operations. A set of abstract functions allow the programmer to select the
+ *  approriate function or property for a specific named object model.
+ * 
+ */
+
+/**
+ * 
+ *  This function is the model chi-square minimization function for this model.
+ * 
+ */
+typedef psMinimizeLMChi2Func pmModelFunc;
+
+
+/**
+ * 
+ * This function returns the integrated flux for the given model parameters.
+ */
+typedef psF64 (*pmModelFlux)(const psVector *params);
+
+
+/**
+ * 
+ *  This function provides the model guess parameters based on the details of
+ *   the given source.
+ * 
+ */
+typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source);
+
+
+/**
+ * 
+ *  This function constructs the PSF model for the given source based on the
+ *  supplied psf and the FLT model for the object.
+ * 
+ */
+typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelFLT, pmPSF *psf);
+
+
+/**
+ * 
+ *  This function returns the radius at which the given model and parameters
+ *  achieves the given flux.
+ * 
+ */
+typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
+
+
+/**
+ * 
+ *  Each of the function types above has a corresponding function which returns
+ *  the function given the model type:
+ * 
+ */
+pmModelFunc pmModelFunc_GetFunction (pmModelType type);
+pmModelFlux pmModelFlux_GetFunction (pmModelType type);
+pmModelGuessFunc pmModelGuessFunc_GetFunction (pmModelType type);
+pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type);
+pmModelRadius pmModelRadius_GetFunction (pmModelType type);
 
 #endif
Index: /trunk/psModules/src/pmReadoutCombine.c
===================================================================
--- /trunk/psModules/src/pmReadoutCombine.c	(revision 4769)
+++ /trunk/psModules/src/pmReadoutCombine.c	(revision 4770)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-29 01:39:10 $
+ *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -72,5 +72,5 @@
     psS32 minInputRows = PS_MAX_S32;
     psListElem *tmpInput = NULL;
-    psReadout *tmpReadout = NULL;
+    pmReadout *tmpReadout = NULL;
     psS32 numInputs = 0;
     psS32 tmpI;
@@ -98,5 +98,5 @@
     tmpInput = (psListElem *) inputs->head;
     while (NULL != tmpInput) {
-        tmpReadout = (psReadout *) tmpInput->data;
+        tmpReadout = (pmReadout *) tmpInput->data;
         PS_ASSERT_READOUT_NON_NULL(tmpReadout, output);
         PS_ASSERT_READOUT_NON_EMPTY(tmpReadout, output);
@@ -182,5 +182,5 @@
     psVector *outColLower = psVectorAlloc(numInputs, PS_TYPE_U32);
     psVector *outColUpper = psVectorAlloc(numInputs, PS_TYPE_U32);
-    psReadout **tmpReadouts = (psReadout **) psAlloc(numInputs * sizeof(psReadout *));
+    pmReadout **tmpReadouts = (pmReadout **) psAlloc(numInputs * sizeof(pmReadout *));
 
     // For each input readout, we create a pointer to that readout in
@@ -191,5 +191,5 @@
     tmpInput = (psListElem *) inputs->head;
     while (NULL != tmpInput) {
-        tmpReadouts[i] = (psReadout *) tmpInput->data;
+        tmpReadouts[i] = (pmReadout *) tmpInput->data;
         outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadouts[i]->image->row0;
         outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadouts[i]->image->col0;
Index: /trunk/psModules/src/pmSubtractBias.c
===================================================================
--- /trunk/psModules/src/pmSubtractBias.c	(revision 4769)
+++ /trunk/psModules/src/pmSubtractBias.c	(revision 4770)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-19 01:44:48 $
+ *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -27,6 +27,6 @@
 place from the input image.
  *****************************************************************************/
-static psReadout *SubtractFrame(psReadout *in,
-                                const psReadout *bias)
+static pmReadout *SubtractFrame(pmReadout *in,
+                                const pmReadout *bias)
 {
     psS32 i;
@@ -245,5 +245,5 @@
 XXX: The SDRS does not specify type support.  F32 is implemented here.
  *****************************************************************************/
-psReadout *pmSubtractBias(psReadout *in,
+pmReadout *pmSubtractBias(pmReadout *in,
                           void *fitSpec,
                           const psList *overscans,
@@ -252,5 +252,5 @@
                           psS32 nBinOrig,
                           pmFit fit,
-                          const psReadout *bias)
+                          const pmReadout *bias)
 {
     psTrace(".psModule.pmSubtracBias.pmSubtractBias", 4,
Index: /trunk/psModules/src/pmSubtractBias.h
===================================================================
--- /trunk/psModules/src/pmSubtractBias.h	(revision 4769)
+++ /trunk/psModules/src/pmSubtractBias.h	(revision 4770)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-11 00:03:51 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -38,5 +38,5 @@
 } pmFit;
 
-psReadout *pmSubtractBias(psReadout *in,                ///< The input psReadout image
+pmReadout *pmSubtractBias(pmReadout *in,                ///< The input pmReadout image
                           void *fitSpec,                ///< A polynomial or spline, defining the fit type.
                           const psList *overscans,      ///< A psList of overscan images
@@ -45,5 +45,5 @@
                           int nBin,                     ///< The amount of binning to be done image pixels.
                           pmFit fit,                    ///< PM_FIT_SPLINE, PM_FIT_POLYNOMIAL, or PM_FIT_NONE
-                          const psReadout *bias);       ///< A possibly NULL bias psReadout which is to be subtracted
+                          const pmReadout *bias);       ///< A possibly NULL bias pmReadout which is to be subtracted
 
 #endif
Index: /trunk/psModules/src/pmSubtractSky.c
===================================================================
--- /trunk/psModules/src/pmSubtractSky.c	(revision 4769)
+++ /trunk/psModules/src/pmSubtractSky.c	(revision 4770)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-29 01:39:10 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -453,5 +453,5 @@
 
 /******************************************************************************
-psReadout pmSubtractSky():
+pmReadout pmSubtractSky():
  
 XXX: use static vectors for myStats, and the binned image
@@ -461,5 +461,5 @@
 XXX: Sync the psTrace message facilities.
  *****************************************************************************/
-psReadout *pmSubtractSky(psReadout *in,
+pmReadout *pmSubtractSky(pmReadout *in,
                          void *fitSpec,
                          psFit fit,
Index: /trunk/psModules/src/pmSubtractSky.h
===================================================================
--- /trunk/psModules/src/pmSubtractSky.h	(revision 4769)
+++ /trunk/psModules/src/pmSubtractSky.h	(revision 4770)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-11 00:03:51 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,5 +32,5 @@
 } psFit;
 
-psReadout *pmSubtractSky(psReadout *in,
+pmReadout *pmSubtractSky(pmReadout *in,
                          void *fitSpec,
                          psFit fit,
Index: /trunk/psModules/test/tst_pmFlatField.c
===================================================================
--- /trunk/psModules/test/tst_pmFlatField.c	(revision 4769)
+++ /trunk/psModules/test/tst_pmFlatField.c	(revision 4770)
@@ -16,8 +16,11 @@
  *    Test M - Attempt to use non-mask type mask image
  *
+ * XXX: Added a mask argument to pmFlatField().  Must add tests.  For now, all
+ * masks are NULL.
+ *
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-11 01:17:28 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -68,4 +71,5 @@
 int main(int argc, char* argv[])
 {
+    psLogSetFormat("HLNM");
     return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
 }
@@ -77,12 +81,12 @@
     printPositiveTestHeader(stdout, "pmFlatField", "Test A - Divide input image by flat image");
     CREATE_AND_SET_IMAGE(inImage,F64,6.0,3,3)
-    psReadout *inReadout = psReadoutAlloc();
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
     inReadout->image = inImage;
     PRINT_MATRIX(inImage,F64,"Input image:");
     CREATE_AND_SET_IMAGE(flatImage1,F64,2.0,3,3)
-    psReadout *flatReadout = psReadoutAlloc();
+    pmReadout *flatReadout = pmReadoutAlloc(NULL);
     flatReadout->image = flatImage1;
     PRINT_MATRIX(flatImage1,F64,"Flat image:");
-    if ( !pmFlatField(inReadout, flatReadout) ) {
+    if ( !pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test A - Returned false should be true");
         return 1;
@@ -99,5 +103,5 @@
     PRINT_MATRIX(flatImage2, F64, "Flat image:");
     flatReadout->image = flatImage2;
-    if ( !pmFlatField(inReadout, flatReadout) ) {
+    if ( !pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test B - Returned false should be true");
         return 2;
@@ -118,5 +122,5 @@
     psFree(inReadout->mask);
     inReadout->mask = mask1;
-    if ( !pmFlatField(inReadout, flatReadout) ) {
+    if ( !pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test C - Returned false should be true");
         return 3;
@@ -132,5 +136,5 @@
     printNegativeTestHeader(stdout,"pmFlatField", "Test D - Attempt to use null flat readout",
                             "Null not allowed for flat readout", 0);
-    if( pmFlatField(inReadout, NULL) ) {
+    if( pmFlatField(inReadout, NULL, NULL) ) {
         psError(PS_ERR_UNKNOWN,true,"Test D - Returned true should be false");
         return 4;
@@ -145,5 +149,5 @@
     psImage *temp = inReadout->image;
     inReadout->image = NULL;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test E - Returned true should be false" );
         return 5;
@@ -159,5 +163,5 @@
     temp = flatReadout->image;
     flatReadout->image = NULL;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test F - Returned true should be false" );
         return 6;
@@ -174,5 +178,5 @@
     temp = flatReadout->image;
     flatReadout->image = smallFlat;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test G - Returned true should be false");
         return 7;
@@ -189,5 +193,5 @@
     temp = inReadout->mask;
     inReadout->mask = largeMask;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test H - Returned true should be false");
         return 8;
@@ -203,5 +207,5 @@
     *(int*)&inReadout->col0 = 50;
     *(int*)&inReadout->row0 = 50;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test I - Returned true should be false");
         return 9;
@@ -217,5 +221,5 @@
                             "Complex types not allowed for input image", 0);
     *(psElemType* ) & inReadout->image->type.type = PS_TYPE_C64;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test J - Returned true should be false");
         return 10;
@@ -230,5 +234,5 @@
                             "Complex types not allowed for flat image", 0);
     *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_C64;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test K - Returned ture should be false");
         return 11;
@@ -243,5 +247,5 @@
                             "Input and flat image types differ", 0);
     *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_F32;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test L - Returned true should be false");
         return 12;
@@ -256,5 +260,5 @@
                             "Mask must be PS_TYPE_MASK type", 0);
     *(psElemType* ) & inReadout->mask->type.type = PS_TYPE_F32;
-    if ( pmFlatField(inReadout, flatReadout) ) {
+    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
         psError(PS_ERR_UNKNOWN,true,"Test M - Returned true should be false");
         return 13;
Index: /trunk/psModules/test/tst_pmImageCombine.c
===================================================================
--- /trunk/psModules/test/tst_pmImageCombine.c	(revision 4769)
+++ /trunk/psModules/test/tst_pmImageCombine.c	(revision 4770)
@@ -9,6 +9,6 @@
  *  XXX: Must verify the results internally.  Don't use stdout file.
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-19 01:44:48 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,4 +25,5 @@
 int main(int argc, char* argv[])
 {
+    psLogSetFormat("HLNM");
     return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
 }
Index: /trunk/psModules/test/tst_pmMaskBadPixels.c
===================================================================
--- /trunk/psModules/test/tst_pmMaskBadPixels.c	(revision 4769)
+++ /trunk/psModules/test/tst_pmMaskBadPixels.c	(revision 4770)
@@ -17,6 +17,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-11 01:30:16 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -87,4 +87,5 @@
 int main(int argc, char* argv[])
 {
+    psLogSetFormat("HLNM");
     return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
 }
@@ -96,6 +97,6 @@
     CREATE_AND_SET_IMAGE(inImage1,F64,0,50,50);
     CREATE_AND_SET_IMAGE(mask1,U8,0,50,50)
-    //    psReadout *inReadout = psReadoutAlloc(0, 0, inImage1);
-    psReadout *inReadout = psReadoutAlloc();
+    //    pmReadout *inReadout = pmReadoutAlloc(0, 0, inImage1);
+    pmReadout *inReadout = pmReadoutAlloc(NULL);
     inReadout->image = inImage1;
     mask1->data.PS_TYPE_MASK_DATA[24][24]=1;
@@ -114,6 +115,6 @@
     CREATE_AND_SET_IMAGE(inImage2,F64,150.0,50,50);
     CREATE_AND_SET_IMAGE(mask2,U8,0,50,50)
-    //    psReadout *inReadout2 = psReadoutAlloc(0, 0, inImage2);
-    psReadout *inReadout2 = psReadoutAlloc();
+    //    pmReadout *inReadout2 = pmReadoutAlloc(0, 0, inImage2);
+    pmReadout *inReadout2 = pmReadoutAlloc(NULL);
     inReadout2->image = inImage2;
     PRINT_MATRIX(mask2, U8, "Data mask:");
@@ -131,6 +132,6 @@
     CREATE_AND_SET_IMAGE(inImage3,F64,50.0,50,50);
     CREATE_AND_SET_IMAGE(mask3,U8,0,50,50)
-    //    psReadout *inReadout3 = psReadoutAlloc(0, 0, inImage3);
-    psReadout *inReadout3 = psReadoutAlloc();
+    //    pmReadout *inReadout3 = pmReadoutAlloc(0, 0, inImage3);
+    pmReadout *inReadout3 = pmReadoutAlloc(NULL);
     inReadout3->image = inImage3;
     mask3->data.PS_TYPE_MASK_DATA[24][24]=1;
@@ -152,6 +153,6 @@
     CREATE_AND_SET_IMAGE(mask4,U8,0,50,50)
     CREATE_AND_SET_IMAGE(mask4i,U8,0,50,50)
-    //    psReadout *inReadout4 = psReadoutAlloc(0, 0, inImage4);
-    psReadout *inReadout4 = psReadoutAlloc();
+    //    pmReadout *inReadout4 = pmReadoutAlloc(0, 0, inImage4);
+    pmReadout *inReadout4 = pmReadoutAlloc(NULL);
     inReadout4->image = inImage4;
     inReadout4->mask = mask4i;
@@ -170,6 +171,6 @@
     // Test E - Attempt to use null mask
     CREATE_AND_SET_IMAGE(inImage5,F64,50.0,50,50);
-    //    psReadout *inReadout5 = psReadoutAlloc(0, 0, inImage5);
-    psReadout *inReadout5 = psReadoutAlloc();
+    //    pmReadout *inReadout5 = pmReadoutAlloc(0, 0, inImage5);
+    pmReadout *inReadout5 = pmReadoutAlloc(NULL);
     inReadout5->image = inImage5;
     pmMaskBadPixels(inReadout5, NULL, 0, 100.0, 1, 10);
@@ -183,6 +184,6 @@
     // Test F - Attempt tp use null input image
     CREATE_AND_SET_IMAGE(mask6,U8,0,50,50)
-    //    psReadout *inReadout6 = psReadoutAlloc(0, 0, NULL);
-    psReadout *inReadout6 = psReadoutAlloc();
+    //    pmReadout *inReadout6 = pmReadoutAlloc(0, 0, NULL);
+    pmReadout *inReadout6 = pmReadoutAlloc(NULL);
     inReadout6->mask = mask6;
     pmMaskBadPixels(inReadout6, mask6, 0, 100.0, 1, 10);
@@ -198,6 +199,6 @@
     CREATE_AND_SET_IMAGE(mask7,U8,0,50,50)
     CREATE_AND_SET_IMAGE(mask7i,U8,0,50,50)
-    //    psReadout *inReadout7 = psReadoutAlloc(0, 0, inImage7);
-    psReadout *inReadout7 = psReadoutAlloc();
+    //    pmReadout *inReadout7 = pmReadoutAlloc(0, 0, inImage7);
+    pmReadout *inReadout7 = pmReadoutAlloc(NULL);
     inReadout7->image = inImage7;
     inReadout7->mask = mask7i;
@@ -215,6 +216,6 @@
     CREATE_AND_SET_IMAGE(mask8,U8,0,50,50)
     CREATE_AND_SET_IMAGE(mask8i,U8,0,60,60)
-    //    psReadout *inReadout8 = psReadoutAlloc(0, 0, inImage8);
-    psReadout *inReadout8 = psReadoutAlloc();
+    //    pmReadout *inReadout8 = pmReadoutAlloc(0, 0, inImage8);
+    pmReadout *inReadout8 = pmReadoutAlloc(NULL);
     inReadout8->image = inImage8;
     inReadout8->mask = mask8i;
@@ -232,6 +233,6 @@
     CREATE_AND_SET_IMAGE(mask9,U8,0,50,50)
     CREATE_AND_SET_IMAGE(mask9i,U8,0,50,50)
-    //    psReadout *inReadout9 = psReadoutAlloc(0, 0, inImage9);
-    psReadout *inReadout9 = psReadoutAlloc();
+    //    pmReadout *inReadout9 = pmReadoutAlloc(0, 0, inImage9);
+    pmReadout *inReadout9 = pmReadoutAlloc(NULL);
     inReadout9->image = inImage9;
     inReadout9->mask = mask9i;
@@ -251,6 +252,6 @@
     CREATE_AND_SET_IMAGE(mask10,U8,0,50,50)
     CREATE_AND_SET_IMAGE(mask10i,U8,0,50,50)
-    //    psReadout *inReadout10 = psReadoutAlloc(0, 0, inImage10);
-    psReadout *inReadout10 = psReadoutAlloc();
+    //    pmReadout *inReadout10 = pmReadoutAlloc(0, 0, inImage10);
+    pmReadout *inReadout10 = pmReadoutAlloc(NULL);
     inReadout10->image = inImage10;
     inReadout10->mask = mask10i;
@@ -268,6 +269,6 @@
     CREATE_AND_SET_IMAGE(mask11,F64,0,50,50)
     CREATE_AND_SET_IMAGE(mask11i,U8,0,50,50)
-    //    psReadout *inReadout11 = psReadoutAlloc(0, 0, inImage11);
-    psReadout *inReadout11 = psReadoutAlloc();
+    //    pmReadout *inReadout11 = pmReadoutAlloc(0, 0, inImage11);
+    pmReadout *inReadout11 = pmReadoutAlloc(NULL);
     inReadout11->image = inImage11;
     inReadout11->mask = mask11i;
Index: /trunk/psModules/test/tst_pmNonLinear.c
===================================================================
--- /trunk/psModules/test/tst_pmNonLinear.c	(revision 4769)
+++ /trunk/psModules/test/tst_pmNonLinear.c	(revision 4770)
@@ -16,6 +16,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-11 23:39:41 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -40,4 +40,5 @@
 int main(int argc, char* argv[])
 {
+    psLogSetFormat("HLNM");
     return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
 }
@@ -53,5 +54,5 @@
     int testStatus = true;
     psImage *myImage = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = myImage;
     psPolynomial1D *myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD);
@@ -106,5 +107,5 @@
     int tableSize = PS_MAX(numCols, numRows)*2;
     psImage *myImage = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = myImage;
     psVector *in = psVectorAlloc(tableSize, PS_TYPE_F32);
@@ -161,6 +162,6 @@
     int testStatus = true;
     psImage *myImage = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
-    psReadout *rc = NULL;
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    pmReadout *rc = NULL;
     myReadout->image = myImage;
     psPolynomial1D *myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD);
@@ -178,5 +179,5 @@
     rc = pmNonLinearityPolynomial(NULL, myPoly);
     if (rc != NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
         testStatus = false;
     }
@@ -188,5 +189,5 @@
     rc = pmNonLinearityPolynomial(myReadout, myPoly);
     if (rc != NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
         testStatus = false;
     }
@@ -197,5 +198,5 @@
     rc = pmNonLinearityPolynomial(myReadout, NULL);
     if (rc != NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
         testStatus = false;
     }
@@ -207,5 +208,5 @@
 
 
-int test03Init(psReadout *myReadout)
+int test03Init(pmReadout *myReadout)
 {
     for (psS32 i=0;i<NUM_ROWS;i++) {
@@ -224,6 +225,6 @@
     int tableSize = PS_MAX(NUM_COLS, NUM_ROWS)*3;
     psImage *myImage = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
-    psReadout *rc = NULL;
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    pmReadout *rc = NULL;
     myReadout->image = myImage;
     psVector *in = psVectorAlloc(tableSize, PS_TYPE_F32);
@@ -253,18 +254,18 @@
 
     printf("------------------------------------------------------------\n");
-    printf("Calling pmNonLinearityLookup() with NULL input psReadout.  Should generate error, return NULL.\n");
+    printf("Calling pmNonLinearityLookup() with NULL input pmReadout.  Should generate error, return NULL.\n");
     rc = pmNonLinearityLookup(NULL, in, out);
     if (rc != NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL psReadout\n");
-        testStatus = false;
-    }
-
-    printf("------------------------------------------------------------\n");
-    printf("Calling pmNonLinearityLookup() with NULL input psReadout->image.  Should generate error, return NULL.\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with NULL input pmReadout->image.  Should generate error, return NULL.\n");
     psImage *tmpImage = myReadout->image;
     myReadout->image = NULL;
     rc = pmNonLinearityLookup(myReadout, in, out);
     if (rc != NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
         testStatus = false;
     }
@@ -275,5 +276,5 @@
     rc = pmNonLinearityLookup(myReadout, NULL, out);
     if (rc != NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
         testStatus = false;
     }
@@ -283,5 +284,5 @@
     rc = pmNonLinearityLookup(myReadout, in, NULL);
     if (rc != NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n");
         testStatus = false;
     }
@@ -292,5 +293,5 @@
     rc = pmNonLinearityLookup(myReadout, in, outBig);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
         testStatus = false;
     }
@@ -312,5 +313,5 @@
     rc = pmNonLinearityLookup(myReadout, in, outSmall);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
         testStatus = false;
     }
@@ -331,5 +332,5 @@
     rc = pmNonLinearityLookup(myReadout, inSmall, out);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
         testStatus = false;
     }
@@ -350,5 +351,5 @@
     rc = pmNonLinearityLookup(myReadout, inBig, out);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
         testStatus = false;
     }
@@ -369,5 +370,5 @@
     rc = pmNonLinearityLookup(myReadout, inSmall, outBig);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
         testStatus = false;
     }
@@ -388,24 +389,24 @@
     rc = pmNonLinearityLookup(myReadout, inBig, outSmall);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
-        testStatus = false;
-    }
-    for (i=0;i<NUM_ROWS;i++) {
-        for (j=0;j<NUM_COLS;j++) {
-            psF32 expect = (float) (2 * (i + j));
-            psF32 actual = rc->image->data.F32[i][j];
-            if (FLT_EPSILON < fabs(expect - actual)) {
-                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
-                testStatus = false;
-            }
-        }
-    }
-
-    test03Init(myReadout);
-    printf("------------------------------------------------------------\n");
-    printf("Calling pmNonLinearityLookup() with inFlux psVector size 1.  Should generate error, return original psReadout.\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
+        testStatus = false;
+    }
+    for (i=0;i<NUM_ROWS;i++) {
+        for (j=0;j<NUM_COLS;j++) {
+            psF32 expect = (float) (2 * (i + j));
+            psF32 actual = rc->image->data.F32[i][j];
+            if (FLT_EPSILON < fabs(expect - actual)) {
+                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
+                testStatus = false;
+            }
+        }
+    }
+
+    test03Init(myReadout);
+    printf("------------------------------------------------------------\n");
+    printf("Calling pmNonLinearityLookup() with inFlux psVector size 1.  Should generate error, return original pmReadout.\n");
     rc = pmNonLinearityLookup(myReadout, inOne, out);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() did not return the original psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() did not return the original pmReadout\n");
         testStatus = false;
     }
@@ -427,5 +428,5 @@
     rc = pmNonLinearityLookup(myReadout, in, out);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
         testStatus = false;
     }
@@ -453,5 +454,5 @@
     rc = pmNonLinearityLookup(myReadout, in, out);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
         testStatus = false;
     }
@@ -479,5 +480,5 @@
     rc = pmNonLinearityLookup(myReadout, in, out);
     if (rc == NULL) {
-        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
+        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n");
         testStatus = false;
     }
Index: /trunk/psModules/test/tst_pmObjects01.c
===================================================================
--- /trunk/psModules/test/tst_pmObjects01.c	(revision 4769)
+++ /trunk/psModules/test/tst_pmObjects01.c	(revision 4770)
@@ -19,6 +19,6 @@
  * abd never deallocate, no error is generated.
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-19 01:44:48 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -63,6 +63,6 @@
 int main(int argc, char* argv[])
 {
+    psLogSetFormat("HLNM");
     return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
-    //    test02();
 }
 
@@ -76,23 +76,23 @@
 
     printf("Testing pmPeakAlloc()...\n");
-    psPeak *tmpPeak = pmPeakAlloc(1, 2, 3.0, PM_PEAK_LONE);
+    pmPeak *tmpPeak = pmPeakAlloc(1, 2, 3.0, PM_PEAK_LONE);
     if (tmpPeak == NULL) {
-        printf("TEST ERROR: pmPeakAlloc() returned a NULL psPeak\n");
+        printf("TEST ERROR: pmPeakAlloc() returned a NULL pmPeak\n");
         testStatus = false;
     } else {
         if (tmpPeak->x != 1) {
-            printf("TEST ERROR: pmPeakAlloc() improperly set psPeak->x\n");
+            printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->x\n");
             testStatus = false;
         }
         if (tmpPeak->y != 2) {
-            printf("TEST ERROR: pmPeakAlloc() improperly set psPeak->y\n");
+            printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->y\n");
             testStatus = false;
         }
         if (tmpPeak->counts != 3.0) {
-            printf("TEST ERROR: pmPeakAlloc() improperly set psPeak->counts\n");
+            printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->counts\n");
             testStatus = false;
         }
         if (tmpPeak->class != PM_PEAK_LONE) {
-            printf("TEST ERROR: pmPeakAlloc() improperly set psPeak->class\n");
+            printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->class\n");
             testStatus = false;
         }
@@ -101,7 +101,7 @@
 
     printf("Testing pmMomentsAlloc()...\n");
-    psMoments *tmpMoments = pmMomentsAlloc();
+    pmMoments *tmpMoments = pmMomentsAlloc();
     if (tmpMoments == NULL) {
-        printf("TEST ERROR: pmMomentsAlloc() returned a NULL psMoments\n");
+        printf("TEST ERROR: pmMomentsAlloc() returned a NULL pmMoments\n");
         testStatus = false;
     } else {
@@ -115,5 +115,5 @@
                 (fabs(tmpMoments->Sky-0.0) > ERROR_TOL) ||
                 (tmpMoments->nPixels != 0)) {
-            printf("TEST ERROR: pmMomentsAlloc() did not properly initialize the psMoments structure.\n");
+            printf("TEST ERROR: pmMomentsAlloc() did not properly initialize the pmMoments structure.\n");
             testStatus = false;
         }
@@ -122,7 +122,7 @@
 
     printf("Testing pmModelAlloc(PS_MODEL_GAUSS)...\n");
-    psModel *tmpModel = pmModelAlloc(PS_MODEL_GAUSS);
+    pmModel *tmpModel = pmModelAlloc(PS_MODEL_GAUSS);
     if (tmpModel == NULL) {
-        printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) returned a NULL psModel\n");
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) returned a NULL pmModel\n");
         testStatus = false;
     } else {
@@ -146,5 +146,5 @@
     tmpModel = pmModelAlloc(PS_MODEL_PGAUSS);
     if (tmpModel == NULL) {
-        printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) returned a NULL psModel\n");
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) returned a NULL pmModel\n");
         testStatus = false;
     } else {
@@ -168,5 +168,5 @@
     tmpModel = pmModelAlloc(PS_MODEL_TWIST_GAUSS);
     if (tmpModel == NULL) {
-        printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) returned a NULL psModel\n");
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) returned a NULL pmModel\n");
         testStatus = false;
     } else {
@@ -190,5 +190,5 @@
     tmpModel = pmModelAlloc(PS_MODEL_WAUSS);
     if (tmpModel == NULL) {
-        printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) returned a NULL psModel\n");
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) returned a NULL pmModel\n");
         testStatus = false;
     } else {
@@ -212,5 +212,5 @@
     tmpModel = pmModelAlloc(PS_MODEL_SERSIC);
     if (tmpModel == NULL) {
-        printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) returned a NULL psModel\n");
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) returned a NULL pmModel\n");
         testStatus = false;
     } else {
@@ -234,5 +234,5 @@
     tmpModel = pmModelAlloc(PS_MODEL_SERSIC_CORE);
     if (tmpModel == NULL) {
-        printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) returned a NULL psModel\n");
+        printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) returned a NULL pmModel\n");
         testStatus = false;
     } else {
@@ -253,7 +253,7 @@
     psFree(tmpModel);
 
-    psSource *tmpSource = pmSourceAlloc();
+    pmSource *tmpSource = pmSourceAlloc();
     if (tmpSource == NULL) {
-        printf("TEST ERROR: pmSourceAlloc() returned a NULL psSource\n");
+        printf("TEST ERROR: pmSourceAlloc() returned a NULL pmSource\n");
         testStatus = false;
     }
@@ -545,5 +545,5 @@
         // HEY: verify
         for (psS32 i = 0 ; i < outData->n ; i++) {
-            psPeak *tmpPeak = (psPeak *) outData->data[i];
+            pmPeak *tmpPeak = (pmPeak *) outData->data[i];
             if (((tmpPeak->x == 0) && (tmpPeak->y == 0)) ||
                     ((tmpPeak->x == 0) && (tmpPeak->y == numRows-1)) ||
@@ -803,6 +803,6 @@
         }
     }
-    psSource *rc = NULL;
-    psPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2),
+    pmSource *rc = NULL;
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2),
                                   (psF32) (TST04_NUM_COLS / 2),
                                   200.0,
@@ -813,5 +813,5 @@
     rc = pmSourceLocalSky(NULL, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
         psFree(rc);
         testStatus = false;
@@ -822,5 +822,5 @@
     rc = pmSourceLocalSky(imgDataF64, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
         psFree(rc);
         testStatus = false;
@@ -828,8 +828,8 @@
 
     printf("----------------------------------------------------------------------------------\n");
-    printf("Calling pmSourceLocalSky with NULL psPeak.  Should generate error and return NULL.\n");
+    printf("Calling pmSourceLocalSky with NULL pmPeak.  Should generate error and return NULL.\n");
     rc = pmSourceLocalSky(imgData, NULL, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
         psFree(rc);
         testStatus = false;
@@ -840,5 +840,5 @@
     rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, -10.0, 20.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
         psFree(rc);
         testStatus = false;
@@ -849,5 +849,5 @@
     rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 5.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
         psFree(rc);
         testStatus = false;
@@ -861,5 +861,5 @@
         rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
         if (rc != NULL) {
-            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
             psFree(rc);
             testStatus = false;
@@ -872,5 +872,5 @@
         rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
         if (rc != NULL) {
-            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
             psFree(rc);
             testStatus = false;
@@ -883,5 +883,5 @@
         rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0);
         if (rc != NULL) {
-            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
             psFree(rc);
             testStatus = false;
@@ -894,5 +894,5 @@
         rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, (psF32) TST04_INNER_RADIUS, (psF32) TST04_OUTER_RADIUS);
         if (rc != NULL) {
-            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL psSource.\n");
+            printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n");
             psFree(rc);
             testStatus = false;
@@ -915,28 +915,28 @@
 
     if (rc == NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
         testStatus = false;
     } else {
         if (rc->peak == NULL) {
-            printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource->peak.\n");
+            printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource->peak.\n");
             testStatus = false;
         } else {
             if (rc->peak->x != tmpPeak->x) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->peak->x was %d, should have been %d.\n", rc->peak->x, tmpPeak->x);
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->x was %d, should have been %d.\n", rc->peak->x, tmpPeak->x);
                 testStatus = false;
             }
 
             if (rc->peak->y != tmpPeak->y) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->peak->y was %d, should have been %d.\n", rc->peak->y, tmpPeak->y);
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->y was %d, should have been %d.\n", rc->peak->y, tmpPeak->y);
                 testStatus = false;
             }
 
             if (rc->peak->counts != tmpPeak->counts) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->peak->counts was %f, should have been %f.\n", rc->peak->counts, tmpPeak->counts);
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->counts was %f, should have been %f.\n", rc->peak->counts, tmpPeak->counts);
                 testStatus = false;
             }
 
             if (rc->peak->class != tmpPeak->class) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->peak->class was %d, should have been %d.\n", rc->peak->class, tmpPeak->class);
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->class was %d, should have been %d.\n", rc->peak->class, tmpPeak->class);
                 testStatus = false;
             }
@@ -944,9 +944,9 @@
 
         if (rc->pixels == NULL) {
-            printf("TEST ERROR: pmSourceLocalSky() psSource->pixels was NULL.\n");
+            printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels was NULL.\n");
             testStatus = false;
         } else {
             if (rc->pixels->numRows != (2 * TST04_OUTER_RADIUS)) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->pixels->numRows was %d, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->numRows was %d, should have been %d.\n",
                        rc->pixels->numRows, (2 * TST04_OUTER_RADIUS));
                 testStatus = false;
@@ -954,5 +954,5 @@
 
             if (rc->pixels->numCols != (2 * TST04_OUTER_RADIUS)) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->pixels->numCols was %d, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->numCols was %d, should have been %d.\n",
                        rc->pixels->numCols, (2 * TST04_OUTER_RADIUS));
                 testStatus = false;
@@ -960,5 +960,5 @@
 
             if (rc->pixels->col0 != (tmpPeak->x - TST04_OUTER_RADIUS)) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->pixels->col0 was %d, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->col0 was %d, should have been %d.\n",
                        rc->pixels->col0, (tmpPeak->x - TST04_OUTER_RADIUS));
                 testStatus = false;
@@ -966,5 +966,5 @@
 
             if (rc->pixels->row0 != (tmpPeak->y - TST04_OUTER_RADIUS)) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->pixels->row0 was %d, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->row0 was %d, should have been %d.\n",
                        rc->pixels->row0, (tmpPeak->y - TST04_OUTER_RADIUS));
                 testStatus = false;
@@ -972,5 +972,5 @@
 
             if (rc->pixels->type.type != PS_TYPE_F32) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->pixels->type was %d, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->type was %d, should have been %d.\n",
                        rc->pixels->type.type, PS_TYPE_F32);
                 testStatus = false;
@@ -982,9 +982,9 @@
 
         if (rc->mask == NULL) {
-            printf("TEST ERROR: pmSourceLocalSky() psSource->mask was NULL.\n");
+            printf("TEST ERROR: pmSourceLocalSky() pmSource->mask was NULL.\n");
             testStatus = false;
         } else {
             if (rc->mask->numRows != (2 * TST04_OUTER_RADIUS)) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->mask->numRows was %d, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->numRows was %d, should have been %d.\n",
                        rc->mask->numRows, (2 * TST04_OUTER_RADIUS));
                 testStatus = false;
@@ -992,5 +992,5 @@
 
             if (rc->mask->numCols != (2 * TST04_OUTER_RADIUS)) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->mask->numCols was %d, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->numCols was %d, should have been %d.\n",
                        rc->mask->numCols, (2 * TST04_OUTER_RADIUS));
                 testStatus = false;
@@ -998,5 +998,5 @@
 
             if (rc->mask->type.type != PS_TYPE_U8) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->mask->type was %d, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->type was %d, should have been %d.\n",
                        rc->mask->type.type, PS_TYPE_U8);
                 testStatus = false;
@@ -1018,10 +1018,10 @@
             }
             if (maskedPixels != PS_SQR(2*(TST04_INNER_RADIUS-1))) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->mask had %d masked pixels, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask had %d masked pixels, should have been %d.\n",
                        maskedPixels, PS_SQR(2*(TST04_INNER_RADIUS-1)));
                 testStatus = false;
             }
             if (unmaskedPixels != (PS_SQR(2*TST04_OUTER_RADIUS) - PS_SQR(2*(TST04_INNER_RADIUS-1)))) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->mask had %d masked pixels, should have been %d.\n",
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->mask had %d masked pixels, should have been %d.\n",
                        unmaskedPixels, (PS_SQR(2*TST04_OUTER_RADIUS) - PS_SQR(2*(TST04_INNER_RADIUS-1))));
                 testStatus = false;
@@ -1030,9 +1030,9 @@
 
         if (rc->moments == NULL) {
-            printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource->moments.\n");
+            printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource->moments.\n");
             testStatus = false;
         } else {
             if (rc->moments->Sky != TST04_SKY) {
-                printf("TEST ERROR: pmSourceLocalSky() psSource->moments->Sky was %f, should have been %f.\n", rc->moments->Sky, TST04_SKY);
+                printf("TEST ERROR: pmSourceLocalSky() pmSource->moments->Sky was %f, should have been %f.\n", rc->moments->Sky, TST04_SKY);
                 testStatus = false;
             }
@@ -1063,5 +1063,5 @@
 {
     bool testStatus = true;
-    psSource *tmpSource = NULL;
+    pmSource *tmpSource = NULL;
     bool rc = false;
     // Create the image used in this test.
@@ -1080,7 +1080,7 @@
 
     //
-    // Create a psPeak with the center pixel set to the peak.
-    //
-    psPeak *tmpPeak = pmPeakAlloc((psF32) (TST06_NUM_ROWS / 2),
+    // Create a pmPeak with the center pixel set to the peak.
+    //
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST06_NUM_ROWS / 2),
                                   (psF32) (TST06_NUM_COLS / 2),
                                   200.0,
@@ -1093,5 +1093,5 @@
                                  (psF32) TST06_OUTER_RADIUS);
     if (tmpSource == NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
         psFree(imgData);
         psFree(imgDataF64);
@@ -1102,5 +1102,5 @@
 
     printf("----------------------------------------------------------------------------------\n");
-    printf("Calling pmSourceSetPixelsCircle with NULL psSource.  Should generate error and return NULL.\n");
+    printf("Calling pmSourceSetPixelsCircle with NULL pmSource.  Should generate error and return NULL.\n");
     rc = pmSourceSetPixelsCircle(NULL, imgData, 10.0);
     if (rc == true) {
@@ -1108,5 +1108,5 @@
         testStatus = false;
     }
-    // XXX: test with psSource->peaks NULL
+    // XXX: test with pmSource->peaks NULL
 
     printf("----------------------------------------------------------------------------------\n");
@@ -1218,6 +1218,6 @@
 {
     bool testStatus = true;
-    psSource *tmpSource = NULL;
-    psSource *rc = NULL;
+    pmSource *tmpSource = NULL;
+    pmSource *rc = NULL;
     // Create the image used in this test.
     psImage *imgData = psImageAlloc(TST05_NUM_COLS, TST05_NUM_ROWS, PS_TYPE_F32);
@@ -1229,7 +1229,7 @@
 
     //
-    // Create a psPeak with the center pixel set to the peak.
-    //
-    psPeak *tmpPeak = pmPeakAlloc((psF32) (TST05_NUM_ROWS / 2),
+    // Create a pmPeak with the center pixel set to the peak.
+    //
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST05_NUM_ROWS / 2),
                                   (psF32) (TST05_NUM_COLS / 2),
                                   200.0,
@@ -1242,5 +1242,5 @@
                                  (psF32) TST05_OUTER_RADIUS);
     if (tmpSource == NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
         psFree(tmpSource);
         testStatus = false;
@@ -1249,13 +1249,13 @@
 
     printf("----------------------------------------------------------------------------------\n");
-    printf("Calling pmSourceMoments with NULL psSource.  Should generate error and return NULL.\n");
+    printf("Calling pmSourceMoments with NULL pmSource.  Should generate error and return NULL.\n");
     rc = pmSourceMoments(NULL, 10.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSourceMoments() returned a non-NULL psSource.\n");
-        testStatus = false;
-    }
-    // XXX: test with psSource->peaks NULL
-    // XXX: test with psSource->pixels NULL
-    // XXX: test with psSource->mask NULL
+        printf("TEST ERROR: pmSourceMoments() returned a non-NULL pmSource.\n");
+        testStatus = false;
+    }
+    // XXX: test with pmSource->peaks NULL
+    // XXX: test with pmSource->pixels NULL
+    // XXX: test with pmSource->mask NULL
 
     printf("----------------------------------------------------------------------------------\n");
@@ -1263,5 +1263,5 @@
     rc = pmSourceMoments(tmpSource, -10.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSourceMoments() returned a non-NULL psSource.\n");
+        printf("TEST ERROR: pmSourceMoments() returned a non-NULL pmSource.\n");
         testStatus = false;
     }
@@ -1485,7 +1485,7 @@
         }
     }
-    psSource *mySrc = NULL;
+    pmSource *mySrc = NULL;
     bool rc = false;
-    psPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2),
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2),
                                   (psF32) (TST04_NUM_COLS / 2),
                                   200.0,
@@ -1502,10 +1502,10 @@
 
     if (mySrc == NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource.\n");
-        testStatus = false;
-    }
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling pmSourceModelGuess with NULL psSource.  Should generate error, return FALSE.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------------------------\n");
+    printf("Calling pmSourceModelGuess with NULL pmSource.  Should generate error, return FALSE.\n");
     rc = pmSourceModelGuess(NULL, imgData, PS_MODEL_GAUSS);
     if (rc == true) {
@@ -1606,8 +1606,8 @@
         }
     }
-    psSource *mySrc = NULL;
+    pmSource *mySrc = NULL;
     psArray *rc = NULL;
 
-    psPeak *tmpPeak = pmPeakAlloc((psF32) (TST09_NUM_ROWS / 2),
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST09_NUM_ROWS / 2),
                                   (psF32) (TST09_NUM_COLS / 2),
                                   200.0,
@@ -1624,5 +1624,5 @@
 
     if (mySrc == NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource.\n");
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
         testStatus = false;
     }
@@ -1635,5 +1635,5 @@
 
     printf("----------------------------------------------------------------------------------\n");
-    printf("Calling pmSourceContour with NULL psSource .  Should generate error, return NULL.\n");
+    printf("Calling pmSourceContour with NULL pmSource .  Should generate error, return NULL.\n");
     rc = pmSourceContour(NULL, imgData, LEVEL, PS_CONTOUR_CRUDE);
     if (rc != NULL) {
@@ -1660,11 +1660,11 @@
         printf("Calling pmSourceContour with acceptable data.\n");
         printf("NOTE: must figure out the parameters for this test to be meaningful.\n");
-        mySrc->models->params->data.F32[0] = TST09_SKY;
-        mySrc->models->params->data.F32[1] = 15.0;
-        mySrc->models->params->data.F32[2] = (psF32) (TST09_NUM_ROWS / 2);
-        mySrc->models->params->data.F32[3] = (psF32) (TST09_NUM_COLS / 2);
-        mySrc->models->params->data.F32[4] = 2.0;
-        mySrc->models->params->data.F32[5] = 2.0;
-        mySrc->models->params->data.F32[6] = 2.0;
+        mySrc->modelPSF->params->data.F32[0] = TST09_SKY;
+        mySrc->modelPSF->params->data.F32[1] = 15.0;
+        mySrc->modelPSF->params->data.F32[2] = (psF32) (TST09_NUM_ROWS / 2);
+        mySrc->modelPSF->params->data.F32[3] = (psF32) (TST09_NUM_COLS / 2);
+        mySrc->modelPSF->params->data.F32[4] = 2.0;
+        mySrc->modelPSF->params->data.F32[5] = 2.0;
+        mySrc->modelPSF->params->data.F32[6] = 2.0;
         rc = pmSourceContour(mySrc, imgData, LEVEL, PS_CONTOUR_CRUDE);
         if (rc == NULL) {
@@ -1703,8 +1703,8 @@
         }
     }
-    psSource *mySrc = NULL;
+    pmSource *mySrc = NULL;
     psBool rc = false;
 
-    psPeak *tmpPeak = pmPeakAlloc((psF32) (TST15_NUM_ROWS / 2),
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST15_NUM_ROWS / 2),
                                   (psF32) (TST15_NUM_COLS / 2),
                                   200.0,
@@ -1721,16 +1721,16 @@
 
     if (mySrc == NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource.\n");
-        testStatus = false;
-    }
-
-    mySrc->models = pmModelAlloc(PS_MODEL_GAUSS);
-    mySrc->models->params->data.F32[0] = 5.0;
-    mySrc->models->params->data.F32[1] = 70.0;
-    mySrc->models->params->data.F32[2] = (psF32) (TST15_NUM_ROWS / 2);
-    mySrc->models->params->data.F32[3] = (psF32) (TST15_NUM_COLS / 2);
-    mySrc->models->params->data.F32[4] = 1.0;
-    mySrc->models->params->data.F32[5] = 1.0;
-    mySrc->models->params->data.F32[6] = 2.0;
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS);
+    mySrc->modelPSF->params->data.F32[0] = 5.0;
+    mySrc->modelPSF->params->data.F32[1] = 70.0;
+    mySrc->modelPSF->params->data.F32[2] = (psF32) (TST15_NUM_ROWS / 2);
+    mySrc->modelPSF->params->data.F32[3] = (psF32) (TST15_NUM_COLS / 2);
+    mySrc->modelPSF->params->data.F32[4] = 1.0;
+    mySrc->modelPSF->params->data.F32[5] = 1.0;
+    mySrc->modelPSF->params->data.F32[6] = 2.0;
 
     printf("----------------------------------------------------------------------------------\n");
@@ -1783,8 +1783,8 @@
         }
     }
-    psSource *mySrc = NULL;
+    pmSource *mySrc = NULL;
     psBool rc = false;
 
-    psPeak *tmpPeak = pmPeakAlloc((psF32) (TST16_NUM_ROWS / 2),
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST16_NUM_ROWS / 2),
                                   (psF32) (TST16_NUM_COLS / 2),
                                   200.0,
@@ -1801,16 +1801,16 @@
 
     if (mySrc == NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource.\n");
-        testStatus = false;
-    }
-
-    mySrc->models = pmModelAlloc(PS_MODEL_GAUSS);
-    mySrc->models->params->data.F32[0] = 5.0;
-    mySrc->models->params->data.F32[1] = 70.0;
-    mySrc->models->params->data.F32[2] = (psF32) (TST16_NUM_ROWS / 2);
-    mySrc->models->params->data.F32[3] = (psF32) (TST16_NUM_COLS / 2);
-    mySrc->models->params->data.F32[4] = 1.0;
-    mySrc->models->params->data.F32[5] = 1.0;
-    mySrc->models->params->data.F32[6] = 2.0;
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS);
+    mySrc->modelPSF->params->data.F32[0] = 5.0;
+    mySrc->modelPSF->params->data.F32[1] = 70.0;
+    mySrc->modelPSF->params->data.F32[2] = (psF32) (TST16_NUM_ROWS / 2);
+    mySrc->modelPSF->params->data.F32[3] = (psF32) (TST16_NUM_COLS / 2);
+    mySrc->modelPSF->params->data.F32[4] = 1.0;
+    mySrc->modelPSF->params->data.F32[5] = 1.0;
+    mySrc->modelPSF->params->data.F32[6] = 2.0;
 
     printf("----------------------------------------------------------------------------------\n");
@@ -1863,8 +1863,8 @@
         }
     }
-    psSource *mySrc = NULL;
+    pmSource *mySrc = NULL;
     psBool rc = false;
 
-    psPeak *tmpPeak = pmPeakAlloc((psF32) (TST20_NUM_ROWS / 2),
+    pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST20_NUM_ROWS / 2),
                                   (psF32) (TST20_NUM_COLS / 2),
                                   200.0,
@@ -1881,18 +1881,18 @@
 
     if (mySrc == NULL) {
-        printf("TEST ERROR: pmSourceLocalSky() returned a NULL psSource.\n");
-        testStatus = false;
-    }
-
-    mySrc->models = pmModelAlloc(PS_MODEL_GAUSS);
-
-
-    mySrc->models->params->data.F32[0] = 5.0;
-    mySrc->models->params->data.F32[1] = 70.0;
-    mySrc->models->params->data.F32[2] = (psF32) (TST20_NUM_ROWS / 2);
-    mySrc->models->params->data.F32[3] = (psF32) (TST20_NUM_COLS / 2);
-    mySrc->models->params->data.F32[4] = 1.0;
-    mySrc->models->params->data.F32[5] = 1.0;
-    mySrc->models->params->data.F32[6] = 2.0;
+        printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n");
+        testStatus = false;
+    }
+
+    mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS);
+
+
+    mySrc->modelPSF->params->data.F32[0] = 5.0;
+    mySrc->modelPSF->params->data.F32[1] = 70.0;
+    mySrc->modelPSF->params->data.F32[2] = (psF32) (TST20_NUM_ROWS / 2);
+    mySrc->modelPSF->params->data.F32[3] = (psF32) (TST20_NUM_COLS / 2);
+    mySrc->modelPSF->params->data.F32[4] = 1.0;
+    mySrc->modelPSF->params->data.F32[5] = 1.0;
+    mySrc->modelPSF->params->data.F32[6] = 2.0;
 
     printf("----------------------------------------------------------------------------------\n");
@@ -1905,5 +1905,5 @@
 
     printf("----------------------------------------------------------------------------------\n");
-    printf("Calling pmSourceFitModel with NULL psSource.  Should generate error, return FALSE.\n");
+    printf("Calling pmSourceFitModel with NULL pmSource.  Should generate error, return FALSE.\n");
     rc = pmSourceFitModel(NULL, imgData);
     if (rc == true) {
Index: /trunk/psModules/test/tst_pmReadoutCombine.c
===================================================================
--- /trunk/psModules/test/tst_pmReadoutCombine.c	(revision 4769)
+++ /trunk/psModules/test/tst_pmReadoutCombine.c	(revision 4770)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-10 22:22:52 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -56,4 +56,5 @@
 int main(int argc, char* argv[])
 {
+    psLogSetFormat("HLNM");
     return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
 }
@@ -118,9 +119,9 @@
         *(int *) (& (tmpImage->col0)) = baseCols[r];
         /*
-                psReadout *tmpReadout = psReadoutAlloc(baseColsReadout[r],
+                pmReadout *tmpReadout = pmReadoutAlloc(baseColsReadout[r],
                                                        baseRowsReadout[r],
                                                        tmpImage);
         */
-        psReadout *tmpReadout = psReadoutAlloc();
+        pmReadout *tmpReadout = pmReadoutAlloc(NULL);
         tmpReadout->image = tmpImage;
 
@@ -154,5 +155,5 @@
     psListElem *tmpInput = (psListElem *) list->head;
     while (NULL != tmpInput) {
-        psReadout *tmpReadout = (psReadout *) tmpInput->data;
+        pmReadout *tmpReadout = (pmReadout *) tmpInput->data;
         psFree(tmpReadout);
         tmpInput = tmpInput->next;
@@ -236,9 +237,9 @@
         *(int *) (& (tmpImage->col0)) = baseCols[r];
         /*
-                psReadout *tmpReadout = psReadoutAlloc(baseColsReadout[r],
+                pmReadout *tmpReadout = pmReadoutAlloc(baseColsReadout[r],
                                                        baseRowsReadout[r],
                                                        tmpImage);
         */
-        psReadout *tmpReadout = psReadoutAlloc();
+        pmReadout *tmpReadout = pmReadoutAlloc(NULL);
         tmpReadout->image = tmpImage;
         minOutRow = PS_MIN(minOutRow, (baseRowsReadout[r] + baseRows[r]));
@@ -441,5 +442,5 @@
     psListElem *tmpInput = (psListElem *) list->head;
     while (NULL != tmpInput) {
-        psReadout *tmpReadout = (psReadout *) tmpInput->data;
+        pmReadout *tmpReadout = (pmReadout *) tmpInput->data;
         psFree(tmpReadout);
         tmpInput = tmpInput->next;
Index: /trunk/psModules/test/tst_pmSubtractBias.c
===================================================================
--- /trunk/psModules/test/tst_pmSubtractBias.c	(revision 4769)
+++ /trunk/psModules/test/tst_pmSubtractBias.c	(revision 4770)
@@ -14,6 +14,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-31 02:01:57 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -42,4 +42,5 @@
 int main(int argc, char* argv[])
 {
+    psLogSetFormat("HLNM");
     return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
 }
@@ -48,6 +49,6 @@
 #define NUM_COLS 8
 /******************************************************************************
-doSubtractBiasFullFrame(): a sample psReadout as well as a bias image are
-created and the bias image is subtracted from the psReadout.
+doSubtractBiasFullFrame(): a sample pmReadout as well as a bias image are
+created and the bias image is subtracted from the pmReadout.
  *****************************************************************************/
 int doSubtractBiasFullFrame(int numCols, int numRows)
@@ -60,8 +61,8 @@
     psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     psImage *tmpImage2 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    //    psReadout *myReadout = psReadoutAlloc(numCols, numRows, tmpImage1);
-    //    psReadout *myBias = psReadoutAlloc(numCols, numRows, tmpImage2);
-    psReadout *myReadout = psReadoutAlloc();
-    psReadout *myBias = psReadoutAlloc();
+    //    pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImage1);
+    //    pmReadout *myBias = pmReadoutAlloc(numCols, numRows, tmpImage2);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    pmReadout *myBias = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
     myBias->image = tmpImage2;
@@ -110,7 +111,7 @@
 
 /******************************************************************************
-doSubtractFullOverscans(): a sample psReadout as well as several overscan
+doSubtractFullOverscans(): a sample pmReadout as well as several overscan
 images of the same size are created.  The overscan images are then subtracted
-from the psReadout.
+from the pmReadout.
  *****************************************************************************/
 int doSubtractFullOverscans(int numCols, int numRows)
@@ -125,6 +126,6 @@
     psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    //    psReadout *myReadout = psReadoutAlloc(numCols, numRows, tmpImage1);
-    psReadout *myReadout = psReadoutAlloc();
+    //    pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImage1);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
 
@@ -185,7 +186,7 @@
 
 /******************************************************************************
-doSubtractFullOverscans(): a sample psReadout as well as several overscan
+doSubtractFullOverscans(): a sample pmReadout as well as several overscan
 images of the same size are created.  The overscan images are collected
-pixel-by-pixel then subtracted column-wise from the psReadout.
+pixel-by-pixel then subtracted column-wise from the pmReadout.
  *****************************************************************************/
 int doSubtractFullOverscanColumns(int numCols, int numRows)
@@ -200,5 +201,5 @@
     psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
     psList *list;
@@ -245,7 +246,7 @@
 }
 /******************************************************************************
-doSubtractFullOverscans(): a sample psReadout as well as several overscan
+doSubtractFullOverscans(): a sample pmReadout as well as several overscan
 images of the same size are created.  The overscan images are collected
-pixel-by-pixel then subtracted column-wise from the psReadout.
+pixel-by-pixel then subtracted column-wise from the pmReadout.
  *****************************************************************************/
 int doSubtractFullOverscanColumnsPoly(int numCols, int numRows)
@@ -260,5 +261,5 @@
     psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
     psList *list;
@@ -307,7 +308,7 @@
 }
 /******************************************************************************
-doSubtractFullOverscansSmall(): a sample psReadout as well as several overscan
+doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan
 images of smaller size are created.  The overscan images are collected
-pixel-by-pixel then subtracted column-wise from the psReadout.
+pixel-by-pixel then subtracted column-wise from the pmReadout.
  *****************************************************************************/
 int doSubtractFullOverscanColumnsSmall(int numCols, int numRows)
@@ -319,5 +320,5 @@
     int testStatus = 0;
     psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
     psImage *tmpImage2 = psImageAlloc(numCols/2, numRows/2, PS_TYPE_F32);
@@ -390,7 +391,7 @@
 
 /******************************************************************************
-doSubtractFullOverscans(): a sample psReadout as well as several overscan
+doSubtractFullOverscans(): a sample pmReadout as well as several overscan
 images of the same size are created.  The overscan images are collected
-pixel-by-pixel then subtracted row-wise from the psReadout.
+pixel-by-pixel then subtracted row-wise from the pmReadout.
  *****************************************************************************/
 int doSubtractFullOverscanRows(int numCols, int numRows)
@@ -405,5 +406,5 @@
     psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
     psList *list;
@@ -451,7 +452,7 @@
 
 /******************************************************************************
-doSubtractFullOverscansSmall(): a sample psReadout as well as several overscan
+doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan
 images of smaller size are created.  The overscan images are collected
-pixel-by-pixel then subtracted row-wise from the psReadout.
+pixel-by-pixel then subtracted row-wise from the pmReadout.
  *****************************************************************************/
 int doSubtractFullOverscanRowsSmall(int numCols, int numRows)
@@ -474,5 +475,5 @@
     psImage *tmpImage3 = psImageAlloc(OSnumCols, OSnumRows, PS_TYPE_F32);
     psImage *tmpImage4 = psImageAlloc(OSnumCols, OSnumRows, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
     psList *list;
@@ -554,20 +555,20 @@
     psImage *tmpImage3Short = psImageAlloc(numCols-1, numRows-1, PS_TYPE_F32);
     psImage *tmpImage4Short = psImageAlloc(numCols-1, numRows-1, PS_TYPE_F32);
-    psReadout *myReadout = psReadoutAlloc();
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
-    psReadout *rc = NULL;
+    pmReadout *rc = NULL;
     psList *list;
     psList *listShort;
     psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
     psImage *tmpImage5 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    psReadout *myBias = psReadoutAlloc();
+    pmReadout *myBias = pmReadoutAlloc(NULL);
     myBias->image = tmpImage5;
     printPositiveTestHeader(stdout, "pmSubtractBias", "Testing input parameter error conditions");
 
     psImage *tmpImage5ShortRows = psImageAlloc(numCols, numRows-1, PS_TYPE_F32);
-    psReadout *myBiasShortRows = psReadoutAlloc();
+    pmReadout *myBiasShortRows = pmReadoutAlloc(NULL);
     myBiasShortRows->image = tmpImage5ShortRows;
     psImage *tmpImage5ShortCols = psImageAlloc(numCols-1, numRows, PS_TYPE_F32);
-    psReadout *myBiasShortCols = psReadoutAlloc();
+    pmReadout *myBiasShortCols = pmReadoutAlloc(NULL);
     myBiasShortCols->image = tmpImage5ShortCols;
 
@@ -611,5 +612,5 @@
     rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_ALL, stat, 0, PM_FIT_NONE, NULL);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractBias() did not return input psReadout.\n");
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
         testStatus = false;
     }
@@ -619,5 +620,5 @@
     rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_ROWS, stat, 0, PM_FIT_NONE, NULL);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractBias() did not return input psReadout.\n");
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
         testStatus = false;
         psFree(rc);
@@ -628,5 +629,5 @@
     rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_COLUMNS, stat, 0, PM_FIT_NONE, NULL);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractBias() did not return input psReadout.\n");
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
         testStatus = false;
         psFree(rc);
@@ -694,5 +695,5 @@
     rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_NONE, stat, 0, PM_FIT_SPLINE, myBias);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractBias() did not return input psReadout.\n");
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
         testStatus = false;
         psFree(rc);
@@ -770,5 +771,5 @@
                                0, PM_FIT_NONE, myBiasShortRows);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractBias() did not return input psReadout.\n");
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
         testStatus = false;
         psFree(rc);
@@ -781,5 +782,5 @@
                                0, PM_FIT_NONE, myBiasShortCols);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractBias() did not return input psReadout.\n");
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
         testStatus = false;
         psFree(rc);
@@ -791,5 +792,5 @@
                                0, 54321, NULL);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractBias() did not return input psReadout.\n");
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
         testStatus = false;
         psFree(rc);
@@ -801,5 +802,5 @@
                                0, PM_FIT_NONE, NULL);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractBias() did not return input psReadout.\n");
+        printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n");
         testStatus = false;
         psFree(rc);
@@ -847,7 +848,7 @@
 
 /******************************************************************************
-doSubtractFullOverscansSmall(): a sample psReadout as well as several overscan
+doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan
 images of smaller size are created.  The overscan images are collected
-pixel-by-pixel then subtracted column-wise from the psReadout.
+pixel-by-pixel then subtracted column-wise from the pmReadout.
  *****************************************************************************/
 int doSubtractFullOverscanColumnsGeneric(int imageNumCols,
@@ -866,6 +867,6 @@
 
     psImage *tmpImage1 = psImageAlloc(imageNumCols, imageNumRows, PS_TYPE_F32);
-    //    psReadout *myReadout = psReadoutAlloc(imageNumCols, imageNumRows, tmpImage1);
-    psReadout *myReadout = psReadoutAlloc();
+    //    pmReadout *myReadout = pmReadoutAlloc(imageNumCols, imageNumRows, tmpImage1);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImage1;
     for (i=0;i<imageNumRows;i++) {
Index: /trunk/psModules/test/tst_pmSubtractSky.c
===================================================================
--- /trunk/psModules/test/tst_pmSubtractSky.c	(revision 4769)
+++ /trunk/psModules/test/tst_pmSubtractSky.c	(revision 4770)
@@ -7,6 +7,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-31 20:41:35 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-16 01:10:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -39,4 +39,5 @@
 int main(int argc, char* argv[])
 {
+    psLogSetFormat("HLNM");
     return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
     //    test00();
@@ -51,6 +52,6 @@
     int testStatus = 0;
     psImage *tmpImageF32 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    //    psReadout *myReadout = psReadoutAlloc(numCols, numRows, tmpImageF32);
-    psReadout *myReadout = psReadoutAlloc();
+    //    pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImageF32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImageF32;
     psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
@@ -89,6 +90,6 @@
     int testStatus = 0;
     psImage *tmpImageF32 = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    //    psReadout *myReadout = psReadoutAlloc(numCols, numRows, tmpImageF32);
-    psReadout *myReadout = psReadoutAlloc();
+    //    pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImageF32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
     myReadout->image = tmpImageF32;
     psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
@@ -193,8 +194,8 @@
     psImage *tmpImageF32 = psImageAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, PS_TYPE_F32);
     psImage *tmpImageF64 = psImageAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, PS_TYPE_F64);
-    //    psReadout *myReadout = psReadoutAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, tmpImageF32);
-    psReadout *myReadout = psReadoutAlloc();
-    myReadout->image = tmpImageF32;
-    psReadout *rc = NULL;
+    //    pmReadout *myReadout = pmReadoutAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, tmpImageF32);
+    pmReadout *myReadout = pmReadoutAlloc(NULL);
+    myReadout->image = tmpImageF32;
+    pmReadout *rc = NULL;
     psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
     psPolynomial2D *myPoly = psPolynomial2DAlloc(POLY_X_ORDER, POLY_Y_ORDER, PS_POLYNOMIAL_ORD);
@@ -208,27 +209,27 @@
 
     printf("----------------------------------------------------------------\n");
-    printf("Calling pmSubtractSky() with NULL psReadout.  Should error.\n\n");
+    printf("Calling pmSubtractSky() with NULL pmReadout.  Should error.\n\n");
     rc = pmSubtractSky(NULL, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
-        testStatus = false;
-    }
-
-    printf("----------------------------------------------------------------\n");
-    printf("Calling pmSubtractSky() with NULL psReadout->image.  Should error.\n\n");
+        printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with NULL pmReadout->image.  Should error.\n\n");
     myReadout->image = NULL;
     rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
-        testStatus = false;
-    }
-    myReadout->image = tmpImageF32;
-
-    printf("----------------------------------------------------------------\n");
-    printf("Calling pmSubtractSky() with PS_TYPE_F64 psReadout->image.  Should error.\n\n");
+        printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n");
+        testStatus = false;
+    }
+    myReadout->image = tmpImageF32;
+
+    printf("----------------------------------------------------------------\n");
+    printf("Calling pmSubtractSky() with PS_TYPE_F64 pmReadout->image.  Should error.\n\n");
     myReadout->image = tmpImageF64;
     rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
     if (rc != NULL) {
-        printf("TEST ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
+        printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n");
         testStatus = false;
     }
@@ -239,5 +240,5 @@
     rc = pmSubtractSky(myReadout, NULL, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractSky() returned something other than psReadout\n");
+        printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n");
         testStatus = false;
     }
@@ -247,5 +248,5 @@
     rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_NONE, 1, myStats, 2.0);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractSky() returned something other than psReadout\n");
+        printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n");
         testStatus = false;
     }
@@ -255,5 +256,5 @@
     rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_SPLINE, 1, myStats, 2.0);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractSky() returned something other than psReadout\n");
+        printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n");
         testStatus = false;
     }
@@ -347,5 +348,5 @@
     rc = pmSubtractSky(myReadout, (void *) myPoly, 54321, 1, myStats, -1.0);
     if (rc != myReadout) {
-        printf("TEST ERROR: pmSubtractSky() returned something other than psReadout\n");
+        printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n");
         testStatus = false;
     }
Index: /trunk/psModules/test/verified/tst_pmImageCombine.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmImageCombine.stderr	(revision 4769)
+++ /trunk/psModules/test/verified/tst_pmImageCombine.stderr	(revision 4770)
@@ -5,19 +5,19 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)
+<HOST>|E|pmCombineImages (FILE:LINENO)
     Unallowable operation: images is NULL.
-<DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)
+<HOST>|E|pmCombineImages (FILE:LINENO)
     images and errors args must have same length (6 != 5)
-<DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)
+<HOST>|E|pmCombineImages (FILE:LINENO)
     Unallowable operation: psImage tmpDataImg has incorrect type.
-<DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)
+<HOST>|E|pmCombineImages (FILE:LINENO)
     images and errors args must have same length (5 != 6)
-<DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)
+<HOST>|E|pmCombineImages (FILE:LINENO)
     Unallowable operation: psImage tmpErrorImg has incorrect type.
-<DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)
+<HOST>|E|pmCombineImages (FILE:LINENO)
     images and masks args must have same length (5 != 6)
-<DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)
+<HOST>|E|pmCombineImages (FILE:LINENO)
     Unallowable operation: psImage tmpMaskImg has incorrect type.
-<DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)
+<HOST>|E|pmCombineImages (FILE:LINENO)
     Unallowable operation: stats is NULL.
 
Index: /trunk/psModules/test/verified/tst_pmImageSubtract.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmImageSubtract.stdout	(revision 4769)
+++ /trunk/psModules/test/verified/tst_pmImageSubtract.stdout	(revision 4770)
@@ -30,5 +30,5 @@
 Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.
 The solution vector is:
-(1.37) (-0.00) (0.10) (0.08) (0.14) (0.10) (0.01) (0.02) (0.00) (-0.02) (-0.01) (-0.00) (0.00) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.02) (-0.01) (-0.01) (0.00) (0.00) (0.00) (-0.02) (0.01) (0.00) (-0.01) (0.00) (-0.00) (0.01) (-0.00) (-0.01) (0.00) (0.01) (0.01) (0.01) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.00) (0.00) (0.01) (-0.00) (-0.00) (-0.01) (0.02) (-0.00) (0.00) (-0.00) (-0.00) (-0.01) (-0.01) (0.02) (0.01) (-0.01) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (-0.00) (0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.00) (-0.01) (-0.03) (-0.00) (0.04) (0.01) (-0.00) (-0.03) (0.02) (0.02) (0.01) (-0.03) (-0.03) (-0.02) (0.01) (-0.01) (-0.01) (0.00) (0.00) (0.01) (0.02) (-0.02) (-0.02) (0.02) (0.02) (0.02) (0.03) (-0.03) (-0.03) (0.02) (0.02) (0.02) (0.00) (0.01) (-0.02) (-0.01) (-0.01) (0.02) (-0.03) (0.02) (0.03) (-0.02) (-0.03) (-0.02) (-0.01) (-0.01) (0.00) (0.01) (-0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.01) (-0.01) (-0.02) (0.02) (0.01) (-0.02) (-0.02) (-0.00) (0.02) (-0.01) (-0.02) (0.01) (0.00) (0.01) (-0.02) (0.01) (0.00) (-0.00) (-0.01) (0.00) (0.00) (-0.01) (-0.01) (0.01) (0.01) (0.01) (0.51) 
+(-64611.38) (9775.94) (-39812.77) (9051.88) (0.14) (-36863.67) (0.01) (0.02) (0.00) (-0.02) (-0.01) (-0.00) (0.00) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.02) (-0.01) (-0.01) (0.00) (0.00) (0.00) (-0.02) (0.01) (0.00) (-0.01) (0.00) (-0.00) (0.01) (-0.00) (-0.01) (0.00) (0.01) (0.01) (0.01) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.00) (0.00) (0.01) (-0.00) (-0.00) (-0.01) (0.02) (-0.00) (0.00) (-0.00) (-0.00) (-0.01) (-0.01) (0.02) (0.01) (-0.01) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (-0.00) (0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.00) (-0.01) (-0.03) (-0.00) (0.04) (0.01) (-0.00) (-0.03) (0.02) (0.02) (0.01) (-0.03) (-0.03) (-0.02) (0.01) (-0.01) (-0.01) (0.00) (0.00) (0.01) (0.02) (-0.02) (-0.02) (0.02) (0.02) (0.02) (0.03) (-0.03) (-0.03) (0.02) (0.02) (0.02) (0.00) (0.01) (-0.02) (-0.01) (-0.01) (0.02) (-0.03) (0.02) (0.03) (-0.02) (-0.03) (-0.02) (-0.01) (-0.01) (0.00) (0.01) (-0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.01) (-0.01) (-0.02) (0.02) (0.01) (-0.02) (-0.02) (-0.00) (0.02) (-0.01) (-0.02) (0.01) (0.00) (0.01) (-0.02) (0.01) (0.00) (-0.00) (-0.01) (0.00) (0.00) (-0.01) (-0.01) (0.01) (0.01) (0.01) (0.51) 
 Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.
 Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.
@@ -39,9 +39,9 @@
 Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
 Calling pmSubtractionKernelImage() with acceptable input parameters.  Should return a psImage.
--0.000774 -0.013938 0.010689 -0.013394 -0.015507 
--0.009241 -0.020300 -0.002732 0.016843 0.010743 
-0.008820 0.015628 1.495404 -0.021095 -0.009788 
-0.003371 -0.001256 0.017835 0.003308 0.008175 
-0.009877 -0.010686 0.014775 0.003368 0.006204 
+-0.000791 -0.014015 0.010665 -0.013466 -0.015527 
+-0.009282 -0.020460 -0.002556 0.016698 0.010701 
+0.008812 0.015715 -86582.703125 -0.020967 -0.009787 
+0.003316 -0.001408 0.018001 0.003171 0.008132 
+0.009856 -0.010723 0.014779 0.003320 0.006181 
 Testing pmSubtractionCalculateEquation(): 
     image size is (25, 25)
@@ -58,5 +58,5 @@
 Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.
 The solution vector is:
-(0.09) (-0.01) (-0.01) (0.00) (-0.00) (-0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.55) 
+(0.09) (-0.01) (-0.01) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.55) 
 Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.
 Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.
Index: /trunk/psModules/test/verified/tst_pmNonLinear.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmNonLinear.stderr	(revision 4769)
+++ /trunk/psModules/test/verified/tst_pmNonLinear.stderr	(revision 4770)
@@ -23,9 +23,9 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
+<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
     Unallowable operation: inputReadout is NULL.
-<DATE><TIME>|<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
+<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
     Unallowable operation: inputReadout->image is NULL.
-<DATE><TIME>|<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
+<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)
     Unallowable operation: input1DPoly is NULL.
 
@@ -38,33 +38,33 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
     Unallowable operation: inputReadout is NULL.
-<DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
     Unallowable operation: inputReadout->image is NULL.
-<DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
     Unallowable operation: inFlux is NULL.
-<DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
     Unallowable operation: outFlux is NULL.
-<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
+<HOST>|W|pmNonLinearityLookup
     WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (24, 25)
-<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
+<HOST>|W|pmNonLinearityLookup
     WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (24, 23)
-<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
+<HOST>|W|pmNonLinearityLookup
     WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (23, 24)
-<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
+<HOST>|W|pmNonLinearityLookup
     WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (25, 24)
-<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
+<HOST>|W|pmNonLinearityLookup
     WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (23, 25)
-<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
+<HOST>|W|pmNonLinearityLookup
     WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (25, 23)
-<DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
+<HOST>|E|pmNonLinearityLookup (FILE:LINENO)
     pmNonLinearityLookup(): input vector less than 2 elements.  Returning inputReadout image.
-<DATE><TIME>|<HOST>|W|vectorBinDisectF32
+<HOST>|W|vectorBinDisectF32
     vectorBinDisectF32(): ordinate -1.000000 is outside vector range (0.000000 - 23.000000).
-<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
+<HOST>|W|pmNonLinearityLookup
     WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table.
-<DATE><TIME>|<HOST>|W|vectorBinDisectF32
+<HOST>|W|vectorBinDisectF32
     vectorBinDisectF32(): ordinate 100.000000 is outside vector range (0.000000 - 23.000000).
-<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
+<HOST>|W|pmNonLinearityLookup
     WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table.
 
Index: /trunk/psModules/test/verified/tst_pmNonLinear.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmNonLinear.stdout	(revision 4769)
+++ /trunk/psModules/test/verified/tst_pmNonLinear.stdout	(revision 4770)
@@ -84,7 +84,7 @@
 Calling pmNonLinearityPolynomial() with NULL polynomial.  Should generate error, return NULL.
 ------------------------------------------------------------
-Calling pmNonLinearityLookup() with NULL input psReadout.  Should generate error, return NULL.
+Calling pmNonLinearityLookup() with NULL input pmReadout.  Should generate error, return NULL.
 ------------------------------------------------------------
-Calling pmNonLinearityLookup() with NULL input psReadout->image.  Should generate error, return NULL.
+Calling pmNonLinearityLookup() with NULL input pmReadout->image.  Should generate error, return NULL.
 ------------------------------------------------------------
 Calling pmNonLinearityLookup() with NULL inFlux psVector.  Should generate error, return NULL.
@@ -104,5 +104,5 @@
 Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors.  Should generate warning.
 ------------------------------------------------------------
-Calling pmNonLinearityLookup() with inFlux psVector size 1.  Should generate error, return original psReadout.
+Calling pmNonLinearityLookup() with inFlux psVector size 1.  Should generate error, return original pmReadout.
 ------------------------------------------------------------
 Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.
Index: /trunk/psModules/test/verified/tst_pmObjects01.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmObjects01.stderr	(revision 4769)
+++ /trunk/psModules/test/verified/tst_pmObjects01.stderr	(revision 4770)
@@ -14,9 +14,9 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
+<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
     Unallowable operation: psVector vector or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
+<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
     Unallowable operation: psVector vector has no elements.
-<DATE><TIME>|<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
+<HOST>|E|pmFindVectorPeaks (FILE:LINENO)
     Unallowable operation: psVector vector has incorrect type.
 
@@ -29,11 +29,11 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|psImageAlloc (FILE:LINENO)
+<HOST>|E|psImageAlloc (FILE:LINENO)
     Specified number of rows (0) or columns (0) is invalid.
-<DATE><TIME>|<HOST>|E|pmFindImagePeaks (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmFindImagePeaks (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmFindImagePeaks (FILE:LINENO)
+<HOST>|E|pmFindImagePeaks (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmFindImagePeaks (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmFindImagePeaks (FILE:LINENO)
     Unallowable operation: psImage image has incorrect type.
 
@@ -55,13 +55,13 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
     Unallowable operation: psImage image has incorrect type.
-<DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
     Unallowable operation: peak is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
     Error: (0.0 > innerRadius) (0.000000 -10.000000)
-<DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)
+<HOST>|E|pmSourceLocalSky (FILE:LINENO)
     Error: (innerRadius > outerRadius) (10.000000 5.000000)
 
@@ -74,11 +74,11 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
-    Unallowable operation: source is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
+<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
+    Unallowable operation: source is NULL.
+<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
     Unallowable operation: psImage image has incorrect type.
-<DATE><TIME>|<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
+<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)
     Error: (0.0 > radius) (0.000000 -10.000000)
 
@@ -91,7 +91,7 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmSourceMoments (FILE:LINENO)
-    Unallowable operation: source is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceMoments (FILE:LINENO)
+<HOST>|E|pmSourceMoments (FILE:LINENO)
+    Unallowable operation: source is NULL.
+<HOST>|E|pmSourceMoments (FILE:LINENO)
     Error: (0.0 > radius) (0.000000 -10.000000)
 
@@ -104,31 +104,31 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
+<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
     This function is not implemented yet.
-<DATE><TIME>|<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
-    Unallowable operation: psVector x or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
+<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_Sersic (FILE:LINENO)
+    Unallowable operation: psVector x or its data is NULL.
+<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
     This function is not implemented yet.
-<DATE><TIME>|<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
-    Unallowable operation: psVector params or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
+<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
+    Unallowable operation: psVector params or its data is NULL.
+<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)
     Unallowable operation: psVector x or its data is NULL.
 
@@ -141,20 +141,20 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmSourceModelGuess (FILE:LINENO)
-    Unallowable operation: source is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceModelGuess (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceModelGuess (FILE:LINENO)
+<HOST>|E|pmSourceModelGuess (FILE:LINENO)
+    Unallowable operation: source is NULL.
+<HOST>|E|pmSourceModelGuess (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSourceModelGuess (FILE:LINENO)
     Undefined psModelType
-<DATE><TIME>|<HOST>|W|pmSourceModelGuess
-    WARNING: source->models was non-NULL; calling psFree(source->models).
-<DATE><TIME>|<HOST>|W|pmSourceModelGuess
-    WARNING: source->models was non-NULL; calling psFree(source->models).
-<DATE><TIME>|<HOST>|W|pmSourceModelGuess
-    WARNING: source->models was non-NULL; calling psFree(source->models).
-<DATE><TIME>|<HOST>|W|pmSourceModelGuess
-    WARNING: source->models was non-NULL; calling psFree(source->models).
-<DATE><TIME>|<HOST>|W|pmSourceModelGuess
-    WARNING: source->models was non-NULL; calling psFree(source->models).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
+<HOST>|W|pmSourceModelGuess
+    WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).
 
 ---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceModelGuess()} | tst_pmObjects01.c)
@@ -166,7 +166,7 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmSourceContour (FILE:LINENO)
-    Unallowable operation: source is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceContour (FILE:LINENO)
+<HOST>|E|pmSourceContour (FILE:LINENO)
+    Unallowable operation: source is NULL.
+<HOST>|E|pmSourceContour (FILE:LINENO)
     Unallowable operation: image is NULL.
 
@@ -179,7 +179,7 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<DATE><TIME>|<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
+<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
     Unallowable operation: src is NULL.
 
@@ -192,7 +192,7 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<DATE><TIME>|<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
+<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|sourceAddOrSubModel (FILE:LINENO)
     Unallowable operation: src is NULL.
 
@@ -205,7 +205,7 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmSourceFitModel (FILE:LINENO)
-    Unallowable operation: psImage image or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmSourceFitModel (FILE:LINENO)
+<HOST>|E|pmSourceFitModel (FILE:LINENO)
+    Unallowable operation: psImage image or its data is NULL.
+<HOST>|E|pmSourceFitModel (FILE:LINENO)
     Unallowable operation: source is NULL.
 
Index: /trunk/psModules/test/verified/tst_pmObjects01.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmObjects01.stdout	(revision 4769)
+++ /trunk/psModules/test/verified/tst_pmObjects01.stdout	(revision 4770)
@@ -81,5 +81,5 @@
 Calling pmSourceLocalSky with wrong-type psImage.  Should generate error and return NULL.
 ----------------------------------------------------------------------------------
-Calling pmSourceLocalSky with NULL psPeak.  Should generate error and return NULL.
+Calling pmSourceLocalSky with NULL pmPeak.  Should generate error and return NULL.
 ----------------------------------------------------------------------------------
 Calling pmSourceLocalSky with innerRadius<0.0.  Should generate error and return NULL.
@@ -90,5 +90,5 @@
 ----------------------------------------------------------------------------------
 ----------------------------------------------------------------------------------
-Calling pmSourceSetPixelsCircle with NULL psSource.  Should generate error and return NULL.
+Calling pmSourceSetPixelsCircle with NULL pmSource.  Should generate error and return NULL.
 ----------------------------------------------------------------------------------
 Calling pmSourceSetPixelsCircle with NULL psImage.  Should generate error and return NULL.
@@ -101,5 +101,5 @@
 ----------------------------------------------------------------------------------
 ----------------------------------------------------------------------------------
-Calling pmSourceMoments with NULL psSource.  Should generate error and return NULL.
+Calling pmSourceMoments with NULL pmSource.  Should generate error and return NULL.
 ----------------------------------------------------------------------------------
 Calling pmSourceMoments with radius < 0.0.  Should generate error and return NULL.
@@ -143,5 +143,5 @@
 Calling pmSourceLocalSky with valid data.
 ----------------------------------------------------------------------------------
-Calling pmSourceModelGuess with NULL psSource.  Should generate error, return FALSE.
+Calling pmSourceModelGuess with NULL pmSource.  Should generate error, return FALSE.
 ----------------------------------------------------------------------------------
 Calling pmSourceModelGuess with NULL psImage.  Should generate error, return FALSE.
@@ -162,5 +162,5 @@
 Calling pmSourceLocalSky with valid data.
 ----------------------------------------------------------------------------------
-Calling pmSourceContour with NULL psSource .  Should generate error, return NULL.
+Calling pmSourceContour with NULL pmSource .  Should generate error, return NULL.
 ----------------------------------------------------------------------------------
 Calling pmSourceContour with NULL psImage .  Should generate error, return NULL.
@@ -183,5 +183,5 @@
 Calling pmSourceFitModel with NULL psImage.  Should generate error, return FALSE.
 ----------------------------------------------------------------------------------
-Calling pmSourceFitModel with NULL psSource.  Should generate error, return FALSE.
+Calling pmSourceFitModel with NULL pmSource.  Should generate error, return FALSE.
 ----------------------------------------------------------------------------------
 Calling pmSourceFitModel with acceptable data.
Index: /trunk/psModules/test/verified/tst_pmSubtractSky.stderr
===================================================================
--- /trunk/psModules/test/verified/tst_pmSubtractSky.stderr	(revision 4769)
+++ /trunk/psModules/test/verified/tst_pmSubtractSky.stderr	(revision 4770)
@@ -5,27 +5,27 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|W|p_psVectorSampleStdev
+<HOST>|W|p_psVectorSampleStdev
     WARNING: p_psVectorSampleStdev(): only one valid psVector elements (1).  Setting stats->sampleStdev = 0.0.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-<DATE><TIME>|<HOST>|W|p_psVectorSampleStdev
+<HOST>|W|p_psVectorSampleStdev
     WARNING: p_psVectorSampleStdev(): only one valid psVector elements (1).  Setting stats->sampleStdev = 0.0.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.
-<DATE><TIME>|<HOST>|W|ImageFitPolynomial
+<HOST>|W|ImageFitPolynomial
     WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.
 
@@ -38,23 +38,23 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|pmSubtractSky (FILE:LINENO)
+<HOST>|E|pmSubtractSky (FILE:LINENO)
     Unallowable operation: psReadout in or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmSubtractSky (FILE:LINENO)
+<HOST>|E|pmSubtractSky (FILE:LINENO)
     Unallowable operation: psReadout in or its data is NULL.
-<DATE><TIME>|<HOST>|E|pmSubtractSky (FILE:LINENO)
+<HOST>|E|pmSubtractSky (FILE:LINENO)
     Unallowable operation: psImage in has incorrect type.
-<DATE><TIME>|<HOST>|W|pmSubtractSky
+<HOST>|W|pmSubtractSky
     WARNING: pmSubtractSky(): input parameter stats is NULL
-<DATE><TIME>|<HOST>|W|pmSubtractSky
+<HOST>|W|pmSubtractSky
     WARNING: pmSubtractSky(): no stats->options was requested
-<DATE><TIME>|<HOST>|W|pmSubtractSky
+<HOST>|W|pmSubtractSky
     WARNING: Multiple statistical options have been requested.
-<DATE><TIME>|<HOST>|W|pmSubtractSky
+<HOST>|W|pmSubtractSky
     WARNING: pmSubtractSky(): binFactor is 0
-<DATE><TIME>|<HOST>|W|pmSubtractSky
+<HOST>|W|pmSubtractSky
     WARNING: pmSubtractSky(): binFactor is -1
-<DATE><TIME>|<HOST>|W|pmSubtractSky
+<HOST>|W|pmSubtractSky
     WARNING: pmSubtractSky(): clipSD is -1.000000
-<DATE><TIME>|<HOST>|E|pmSubtractSky (FILE:LINENO)
+<HOST>|E|pmSubtractSky (FILE:LINENO)
     psFit is unallowable (54321).  Returning in image.
 
Index: /trunk/psModules/test/verified/tst_pmSubtractSky.stdout
===================================================================
--- /trunk/psModules/test/verified/tst_pmSubtractSky.stdout	(revision 4769)
+++ /trunk/psModules/test/verified/tst_pmSubtractSky.stdout	(revision 4770)
@@ -176,11 +176,11 @@
 
 ----------------------------------------------------------------
-Calling pmSubtractSky() with NULL psReadout.  Should error.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with NULL psReadout->image.  Should error.
-
-----------------------------------------------------------------
-Calling pmSubtractSky() with PS_TYPE_F64 psReadout->image.  Should error.
+Calling pmSubtractSky() with NULL pmReadout.  Should error.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with NULL pmReadout->image.  Should error.
+
+----------------------------------------------------------------
+Calling pmSubtractSky() with PS_TYPE_F64 pmReadout->image.  Should error.
 
 ----------------------------------------------------------------
