Index: /trunk/psLib/pslib.kdevelop
===================================================================
--- /trunk/psLib/pslib.kdevelop	(revision 3475)
+++ /trunk/psLib/pslib.kdevelop	(revision 3476)
@@ -113,4 +113,6 @@
       <group pattern="*.h" name="Header files" />
       <group pattern="*.c" name="Source files" />
+      <hidenonprojectfiles>false</hidenonprojectfiles>
+      <hidenonlocation>false</hidenonlocation>
     </groups>
     <tree>
Index: /trunk/psLib/pslib.kdevses
===================================================================
--- /trunk/psLib/pslib.kdevses	(revision 3475)
+++ /trunk/psLib/pslib.kdevses	(revision 3476)
@@ -2,16 +2,25 @@
 <!DOCTYPE KDevPrjSession>
 <KDevPrjSession>
- <DocsAndViews NumberOfDocuments="3" >
-  <Doc0 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psMetadata.c" >
-   <View0 line="92" Type="Source" />
+ <DocsAndViews NumberOfDocuments="5" >
+  <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/fileUtils/psFits.h" >
+   <View0 line="219" Type="Source" />
   </Doc0>
-  <Doc1 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psDB.c" >
-   <View0 line="101" Type="Source" />
+  <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/fileUtils/psFits.c" >
+   <View0 line="1379" Type="Source" />
   </Doc1>
-  <Doc2 NumberOfViews="1" URL="file:/usr/share/aclocal/pilot-link.m4" >
-   <View0 line="0" Type="Source" />
+  <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/test/fileUtils/tst_psFits.c" >
+   <View0 line="917" Type="Source" />
   </Doc2>
+  <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/collections/psVector.h" >
+   <View0 line="156" Type="Source" />
+  </Doc3>
+  <Doc4 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/collections/psVector.c" >
+   <View0 line="537" Type="Source" />
+  </Doc4>
  </DocsAndViews>
  <pluginList>
+  <kdevdebugger>
+   <breakpointList/>
+  </kdevdebugger>
   <kdevbookmarks>
    <bookmarks/>
@@ -23,7 +32,4 @@
    <kcachegrind path="" />
   </kdevvalgrind>
-  <kdevdebugger>
-   <breakpointList/>
-  </kdevdebugger>
  </pluginList>
 </KDevPrjSession>
Index: /trunk/psLib/src/collections/psVector.c
===================================================================
--- /trunk/psLib/src/collections/psVector.c	(revision 3475)
+++ /trunk/psLib/src/collections/psVector.c	(revision 3476)
@@ -9,6 +9,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-03-11 20:38:56 $
+*  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-03-22 21:52:49 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -37,5 +37,5 @@
     }
 
-    psFree(psVec->data.V);
+    psFree(psVec->data.U8);
 }
 
@@ -59,5 +59,5 @@
 
     // Create vector data array
-    psVec->data.V = psAlloc(nalloc * elementSize);
+    psVec->data.U8 = psAlloc(nalloc * elementSize);
 
     return psVec;
@@ -80,5 +80,5 @@
         }
         // Realloc after decrementation to avoid accessing freed array elements
-        in->data.V = psRealloc(in->data.V, nalloc * elementSize);
+        in->data.U8 = psRealloc(in->data.U8, nalloc * elementSize);
         in->nalloc = nalloc;
     }
@@ -107,5 +107,5 @@
     // need to increase data buffer?
     if (byteSize > in->nalloc*PSELEMTYPE_SIZEOF(in->type.type)) {
-        in->data.V = psRealloc(in->data.V, byteSize);
+        in->data.U8 = psRealloc(in->data.U8, byteSize);
         in->nalloc = n;
     }
@@ -235,5 +235,5 @@
     inType = inVector->type.type;
     N = inVector->n;
-    inVec = inVector->data.V;
+    inVec = (psPtr)inVector->data.U8;
     elSize = PSELEMTYPE_SIZEOF(inType);
 
@@ -249,5 +249,5 @@
     }
     outVector->n = N;
-    outVec = outVector->data.V;
+    outVec = outVector->data.U8;
 
     if (N == 0) {
@@ -496,2 +496,46 @@
 }
 
+psF64 p_psVectorGetElementF64(psVector* vector,
+                              int position)
+{
+    if (vector == NULL) {
+        return NAN;
+    }
+    if (position < 0 || position >= vector->n) {
+        return NAN;
+    }
+
+    switch (vector->type.type) {
+    case PS_TYPE_U8:
+        return vector->data.U8[position];
+        break;
+    case PS_TYPE_U16:
+        return vector->data.U16[position];
+        break;
+    case PS_TYPE_U32:
+        return vector->data.U32[position];
+        break;
+    case PS_TYPE_U64:
+        return vector->data.U64[position];
+        break;
+    case PS_TYPE_S8:
+        return vector->data.S8[position];
+        break;
+    case PS_TYPE_S16:
+        return vector->data.S16[position];
+        break;
+    case PS_TYPE_S32:
+        return vector->data.S32[position];
+        break;
+    case PS_TYPE_S64:
+        return vector->data.S64[position];
+        break;
+    case PS_TYPE_F32:
+        return vector->data.F32[position];
+        break;
+    case PS_TYPE_F64:
+        return vector->data.F64[position];
+    default:
+        return NAN;
+    }
+}
Index: /trunk/psLib/src/collections/psVector.h
===================================================================
--- /trunk/psLib/src/collections/psVector.h	(revision 3475)
+++ /trunk/psLib/src/collections/psVector.h	(revision 3476)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-11 20:38:56 $
+ *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -37,5 +37,4 @@
 
     union {
-        psBool B;               ///< Boolean data.
         psU8* U8;               ///< Unsigned 8-bit integer data.
         psU16* U16;             ///< Unsigned 16-bit integer data.
@@ -50,5 +49,4 @@
         psC32* C32;             ///< Single-precision complex data.
         psC64* C64;             ///< Double-precision complex data.
-        psPtr V;                ///< Pointer to data.
     } data;                     ///< Union for data types.
 }
@@ -153,4 +151,14 @@
 );
 
+/** Returns an element in the vector as a psF64 value
+ *
+ *  @return psF64          the value at specified position, or NAN if position is invalid.
+ */
+psF64 p_psVectorGetElementF64(
+    psVector* vector,                  ///< vector to retrieve element
+    int position                       ///< the vector position to get
+);
+
+
 /// @}
 
Index: /trunk/psLib/src/dataIO/psFits.c
===================================================================
--- /trunk/psLib/src/dataIO/psFits.c	(revision 3475)
+++ /trunk/psLib/src/dataIO/psFits.c	(revision 3476)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-11 20:38:56 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -78,9 +78,13 @@
     case TDBLCOMPLEX:
         return PS_TYPE_C64;
+    case TLOGICAL:
+        return PS_TYPE_BOOL;
     default:
+        psError(PS_ERR_IO, true,
+                "Unknown FITS datatype, %d.",
+                datatype);
         return PS_TYPE_PTR;
     }
 }
-
 
 static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType)
@@ -1295,5 +1299,21 @@
     fits_get_num_rows(fits->p_fd, &numRows, &status);
 
+    // get the column length.
+    int width;
+    if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) {
+        char fitsErr[MAX_STRING_LENGTH];
+        (void)fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_IO, true,
+                PS_ERRORTEXT_psFits_GET_COLTYPE,
+                fitsErr);
+        return NULL;
+    }
+
+    // allocate the buffers
     psArray* result = psArrayAlloc(numRows);
+    for (int row = 0; row < numRows; row++) {
+        result->data[row] = psAlloc((width+1)*sizeof(char));
+    }
+    result->n = numRows;
 
     fits_read_col_str(fits->p_fd,
@@ -1322,6 +1342,6 @@
                                    const char* colname)
 {
+    int status = 0;
     int colnum = 0;
-    int status = 0;
 
     if (fits == NULL) {
@@ -1359,5 +1379,7 @@
     // get the number of rows
     long numRows = 0;
-    fits_get_num_rows(fits->p_fd, &numRows, &status);
+    fits_get_num_rows(fits->p_fd,
+                      &numRows,
+                      &status);
 
     // get the column datatype.
@@ -1376,7 +1398,14 @@
     psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
 
-    fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */,
-                  1 /* firstelem */, numRows, NULL, result->data.V,
-                  NULL, &status);
+    fits_read_col(fits->p_fd,
+                  typecode,
+                  colnum,
+                  1 /* firstrow */,
+                  1 /* firstelem */,
+                  numRows,
+                  NULL,
+                  (psPtr)(result->data.U8),
+                  NULL,
+                  &status);
 
     if ( status != 0) {
Index: /trunk/psLib/src/dataIO/psFits.h
===================================================================
--- /trunk/psLib/src/dataIO/psFits.h	(revision 3475)
+++ /trunk/psLib/src/dataIO/psFits.h	(revision 3476)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-11 20:38:56 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -206,6 +206,6 @@
  */
 psArray* psFitsReadTableColumn(
-    psFits* fits,
-    const char* colname
+    psFits* fits,                      ///< the psFits object
+    const char* colname                ///< the column name
 );
 
@@ -262,5 +262,4 @@
     ///< Array of psMetadata items, which contains the output data items of each row.
     int row                            ///< the row number to update.
-
 );
 
Index: /trunk/psLib/src/dataManip/psConstants.h
===================================================================
--- /trunk/psLib/src/dataManip/psConstants.h	(revision 3475)
+++ /trunk/psLib/src/dataManip/psConstants.h	(revision 3476)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-24 00:19:51 $
+ *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -191,5 +191,5 @@
 #define PS_VECTOR_CHECK_NULL(NAME, RVAL) PS_VECTOR_CHECK_NULL_GENERAL(NAME, return RVAL)
 #define PS_VECTOR_CHECK_NULL_GENERAL(NAME, CLEANUP) \
-if (NAME == NULL || NAME->data.V == NULL) { \
+if (NAME == NULL || NAME->data.U8 == NULL) { \
     psError(PS_ERR_BAD_PARAMETER_NULL, true, \
             "Unallowable operation: psVector %s or its data is NULL.", \
@@ -272,5 +272,5 @@
     NEW_STATIC32 = psVectorRecycle(NEW_STATIC32, OLD->n, PS_TYPE_F32); \
     p_psMemSetPersistent(NEW_STATIC32, true); \
-    p_psMemSetPersistent(NEW_STATIC32->data.V, true); \
+    p_psMemSetPersistent(NEW_STATIC32->data.U8, true); \
     for (i=0; i < OLD->n ; i++) { \
         NEW_STATIC32->data.F32[i] = (float) OLD->data.F64[i]; \
@@ -285,5 +285,5 @@
     NEW_STATIC64 = psVectorRecycle(NEW_STATIC64, OLD->n, PS_TYPE_F64); \
     p_psMemSetPersistent(NEW_STATIC64, true); \
-    p_psMemSetPersistent(NEW_STATIC64->data.V, true); \
+    p_psMemSetPersistent(NEW_STATIC64->data.U8, true); \
     for (i=0; i < OLD->n ; i++) { \
         NEW_STATIC64->data.F64[i] = (double) OLD->data.F32[i]; \
@@ -295,5 +295,5 @@
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
 p_psMemSetPersistent(VEC, true); \
-p_psMemSetPersistent(VEC->data.V, true); \
+p_psMemSetPersistent(VEC->data.U8, true); \
 for (int i=0;i<N;i++) { \
     VEC->data.F32[i] = 1.0; \
@@ -303,5 +303,5 @@
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \
 p_psMemSetPersistent(VEC, true); \
-p_psMemSetPersistent(VEC->data.V, true); \
+p_psMemSetPersistent(VEC->data.U8, true); \
 for (int i=0;i<N;i++) { \
     VEC->data.F64[i] = 1.0; \
@@ -311,5 +311,5 @@
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
 p_psMemSetPersistent(VEC, true); \
-p_psMemSetPersistent(VEC->data.V, true); \
+p_psMemSetPersistent(VEC->data.U8, true); \
 for (int i=0;i<N;i++) { \
     VEC->data.F32[i] = (float) i; \
@@ -319,5 +319,5 @@
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \
 p_psMemSetPersistent(VEC, true); \
-p_psMemSetPersistent(VEC->data.V, true); \
+p_psMemSetPersistent(VEC->data.U8, true); \
 for (int i=0;i<N;i++) { \
     VEC->data.F64[i] = (float) i; \
@@ -328,5 +328,5 @@
 NAME = psVectorRecycle(NAME, SIZE, TYPE); \
 p_psMemSetPersistent(NAME, true); \
-p_psMemSetPersistent(NAME->data.V, true); \
+p_psMemSetPersistent(NAME->data.U8, true); \
 
 #define PS_VECTOR_DECLARE_ALLOC_STATIC(NAME, SIZE, TYPE) \
Index: /trunk/psLib/src/dataManip/psMatrix.c
===================================================================
--- /trunk/psLib/src/dataManip/psMatrix.c	(revision 3475)
+++ /trunk/psLib/src/dataManip/psMatrix.c	(revision 3476)
@@ -21,6 +21,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-28 23:34:10 $
+ *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -216,5 +216,5 @@
 
     (*outPerm)->n = numCols;
-    perm.data = (*outPerm)->data.V;
+    perm.data = (psPtr)((*outPerm)->data.U8);
     lu = gsl_matrix_alloc(numRows, numCols);
 
@@ -273,5 +273,5 @@
     outVector->n = numCols;
     perm.size = inPerm->n;
-    perm.data = inPerm->data.V;
+    perm.data = (psPtr)(inPerm->data.U8);
 
     // Solve for {x} in equation: {b} = [A]{x}
@@ -580,5 +580,5 @@
     }
 
-    memcpy(outVector->data.V, inImage->data.V[0], size);
+    memcpy(outVector->data.U8, inImage->data.U8[0], size);
 
     return outVector;
@@ -637,5 +637,5 @@
     PS_CHECK_DIMEN_AND_TYPE(outImage, PS_DIMEN_IMAGE, VECTORTOMATRIX_CLEANUP);
 
-    memcpy(outImage->data.V[0], inVector->data.V, size);
+    memcpy(outImage->data.U8[0], inVector->data.U8, size);
 
     return outImage;
Index: /trunk/psLib/src/dataManip/psMinimize.c
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.c	(revision 3475)
+++ /trunk/psLib/src/dataManip/psMinimize.c	(revision 3476)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:23 $
+ *  @version $Revision: 1.107 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1608,5 +1608,5 @@
         myParamMask = psVectorRecycle(myParamMask, params->n, PS_TYPE_U8);
         p_psMemSetPersistent(myParamMask, true);
-        p_psMemSetPersistent(myParamMask->data.V, true);
+        p_psMemSetPersistent(myParamMask->data.U8, true);
         for (i=0;i<myParamMask->n;i++) {
             myParamMask->data.U8[i] = 0;
Index: /trunk/psLib/src/dataManip/psVectorFFT.c
===================================================================
--- /trunk/psLib/src/dataManip/psVectorFFT.c	(revision 3475)
+++ /trunk/psLib/src/dataManip/psVectorFFT.c	(revision 3476)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:23 $
+ *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -87,5 +87,5 @@
         }
         out->type.type = PS_TYPE_F32;
-        out->data.V = psRealloc(out->data.V,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);
+        out->data.U8 = psRealloc(out->data.U8,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);
     }
 
@@ -113,5 +113,5 @@
         out = psVectorRecycle(out, numElements, type);
         out->n = numElements;
-        memcpy(out->data.V, in->data.V, numElements * PSELEMTYPE_SIZEOF(type));
+        memcpy(out->data.U8, in->data.U8, numElements * PSELEMTYPE_SIZEOF(type));
         return out;
     }
@@ -172,5 +172,5 @@
         out = psVectorRecycle(out, numElements, type);
         out->n = numElements;
-        memset(out->data.V, 0, PSELEMTYPE_SIZEOF(type) * numElements);
+        memset(out->data.U8, 0, PSELEMTYPE_SIZEOF(type) * numElements);
         return out;
     }
@@ -298,5 +298,5 @@
         out = psVectorRecycle(out, numElements, type);
         out->n = numElements;
-        memcpy(out->data.V, in->data.V, PSELEMTYPE_SIZEOF(type) * numElements);
+        memcpy(out->data.U8, in->data.U8, PSELEMTYPE_SIZEOF(type) * numElements);
         return out;
     }
Index: /trunk/psLib/src/fft/psVectorFFT.c
===================================================================
--- /trunk/psLib/src/fft/psVectorFFT.c	(revision 3475)
+++ /trunk/psLib/src/fft/psVectorFFT.c	(revision 3476)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:23 $
+ *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -87,5 +87,5 @@
         }
         out->type.type = PS_TYPE_F32;
-        out->data.V = psRealloc(out->data.V,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);
+        out->data.U8 = psRealloc(out->data.U8,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);
     }
 
@@ -113,5 +113,5 @@
         out = psVectorRecycle(out, numElements, type);
         out->n = numElements;
-        memcpy(out->data.V, in->data.V, numElements * PSELEMTYPE_SIZEOF(type));
+        memcpy(out->data.U8, in->data.U8, numElements * PSELEMTYPE_SIZEOF(type));
         return out;
     }
@@ -172,5 +172,5 @@
         out = psVectorRecycle(out, numElements, type);
         out->n = numElements;
-        memset(out->data.V, 0, PSELEMTYPE_SIZEOF(type) * numElements);
+        memset(out->data.U8, 0, PSELEMTYPE_SIZEOF(type) * numElements);
         return out;
     }
@@ -298,5 +298,5 @@
         out = psVectorRecycle(out, numElements, type);
         out->n = numElements;
-        memcpy(out->data.V, in->data.V, PSELEMTYPE_SIZEOF(type) * numElements);
+        memcpy(out->data.U8, in->data.U8, PSELEMTYPE_SIZEOF(type) * numElements);
         return out;
     }
Index: /trunk/psLib/src/fileUtils/psFits.c
===================================================================
--- /trunk/psLib/src/fileUtils/psFits.c	(revision 3475)
+++ /trunk/psLib/src/fileUtils/psFits.c	(revision 3476)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-11 20:38:56 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -78,9 +78,13 @@
     case TDBLCOMPLEX:
         return PS_TYPE_C64;
+    case TLOGICAL:
+        return PS_TYPE_BOOL;
     default:
+        psError(PS_ERR_IO, true,
+                "Unknown FITS datatype, %d.",
+                datatype);
         return PS_TYPE_PTR;
     }
 }
-
 
 static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType)
@@ -1295,5 +1299,21 @@
     fits_get_num_rows(fits->p_fd, &numRows, &status);
 
+    // get the column length.
+    int width;
+    if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) {
+        char fitsErr[MAX_STRING_LENGTH];
+        (void)fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_IO, true,
+                PS_ERRORTEXT_psFits_GET_COLTYPE,
+                fitsErr);
+        return NULL;
+    }
+
+    // allocate the buffers
     psArray* result = psArrayAlloc(numRows);
+    for (int row = 0; row < numRows; row++) {
+        result->data[row] = psAlloc((width+1)*sizeof(char));
+    }
+    result->n = numRows;
 
     fits_read_col_str(fits->p_fd,
@@ -1322,6 +1342,6 @@
                                    const char* colname)
 {
+    int status = 0;
     int colnum = 0;
-    int status = 0;
 
     if (fits == NULL) {
@@ -1359,5 +1379,7 @@
     // get the number of rows
     long numRows = 0;
-    fits_get_num_rows(fits->p_fd, &numRows, &status);
+    fits_get_num_rows(fits->p_fd,
+                      &numRows,
+                      &status);
 
     // get the column datatype.
@@ -1376,7 +1398,14 @@
     psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
 
-    fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */,
-                  1 /* firstelem */, numRows, NULL, result->data.V,
-                  NULL, &status);
+    fits_read_col(fits->p_fd,
+                  typecode,
+                  colnum,
+                  1 /* firstrow */,
+                  1 /* firstelem */,
+                  numRows,
+                  NULL,
+                  (psPtr)(result->data.U8),
+                  NULL,
+                  &status);
 
     if ( status != 0) {
Index: /trunk/psLib/src/fileUtils/psFits.h
===================================================================
--- /trunk/psLib/src/fileUtils/psFits.h	(revision 3475)
+++ /trunk/psLib/src/fileUtils/psFits.h	(revision 3476)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-11 20:38:56 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -206,6 +206,6 @@
  */
 psArray* psFitsReadTableColumn(
-    psFits* fits,
-    const char* colname
+    psFits* fits,                      ///< the psFits object
+    const char* colname                ///< the column name
 );
 
@@ -262,5 +262,4 @@
     ///< Array of psMetadata items, which contains the output data items of each row.
     int row                            ///< the row number to update.
-
 );
 
Index: /trunk/psLib/src/fits/psFits.c
===================================================================
--- /trunk/psLib/src/fits/psFits.c	(revision 3475)
+++ /trunk/psLib/src/fits/psFits.c	(revision 3476)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-11 20:38:56 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -78,9 +78,13 @@
     case TDBLCOMPLEX:
         return PS_TYPE_C64;
+    case TLOGICAL:
+        return PS_TYPE_BOOL;
     default:
+        psError(PS_ERR_IO, true,
+                "Unknown FITS datatype, %d.",
+                datatype);
         return PS_TYPE_PTR;
     }
 }
-
 
 static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType)
@@ -1295,5 +1299,21 @@
     fits_get_num_rows(fits->p_fd, &numRows, &status);
 
+    // get the column length.
+    int width;
+    if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) {
+        char fitsErr[MAX_STRING_LENGTH];
+        (void)fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_IO, true,
+                PS_ERRORTEXT_psFits_GET_COLTYPE,
+                fitsErr);
+        return NULL;
+    }
+
+    // allocate the buffers
     psArray* result = psArrayAlloc(numRows);
+    for (int row = 0; row < numRows; row++) {
+        result->data[row] = psAlloc((width+1)*sizeof(char));
+    }
+    result->n = numRows;
 
     fits_read_col_str(fits->p_fd,
@@ -1322,6 +1342,6 @@
                                    const char* colname)
 {
+    int status = 0;
     int colnum = 0;
-    int status = 0;
 
     if (fits == NULL) {
@@ -1359,5 +1379,7 @@
     // get the number of rows
     long numRows = 0;
-    fits_get_num_rows(fits->p_fd, &numRows, &status);
+    fits_get_num_rows(fits->p_fd,
+                      &numRows,
+                      &status);
 
     // get the column datatype.
@@ -1376,7 +1398,14 @@
     psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
 
-    fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */,
-                  1 /* firstelem */, numRows, NULL, result->data.V,
-                  NULL, &status);
+    fits_read_col(fits->p_fd,
+                  typecode,
+                  colnum,
+                  1 /* firstrow */,
+                  1 /* firstelem */,
+                  numRows,
+                  NULL,
+                  (psPtr)(result->data.U8),
+                  NULL,
+                  &status);
 
     if ( status != 0) {
Index: /trunk/psLib/src/fits/psFits.h
===================================================================
--- /trunk/psLib/src/fits/psFits.h	(revision 3475)
+++ /trunk/psLib/src/fits/psFits.h	(revision 3476)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-11 20:38:56 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -206,6 +206,6 @@
  */
 psArray* psFitsReadTableColumn(
-    psFits* fits,
-    const char* colname
+    psFits* fits,                      ///< the psFits object
+    const char* colname                ///< the column name
 );
 
@@ -262,5 +262,4 @@
     ///< Array of psMetadata items, which contains the output data items of each row.
     int row                            ///< the row number to update.
-
 );
 
Index: /trunk/psLib/src/image/psImageErrors.dat
===================================================================
--- /trunk/psLib/src/image/psImageErrors.dat	(revision 3475)
+++ /trunk/psLib/src/image/psImageErrors.dat	(revision 3476)
@@ -79,2 +79,3 @@
 psImageConvolve_KERNEL_TOO_LARGE       Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d.
 psImage_COEFF_NULL                     Polynomial coefficients cannot be NULL.
+psImageManip_TRANSFORM_NULL            Specified input transform can not be NULL.
Index: /trunk/psLib/src/image/psImageErrors.h
===================================================================
--- /trunk/psLib/src/image/psImageErrors.h	(revision 3475)
+++ /trunk/psLib/src/image/psImageErrors.h	(revision 3476)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -96,4 +96,5 @@
 #define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d."
 #define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL."
+#define PS_ERRORTEXT_psImageManip_TRANSFORM_NULL "Specified input transform can not be NULL"
 //~End
 
Index: /trunk/psLib/src/image/psImageExtraction.c
===================================================================
--- /trunk/psLib/src/image/psImageExtraction.c	(revision 3475)
+++ /trunk/psLib/src/image/psImageExtraction.c	(revision 3476)
@@ -9,6 +9,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-24 00:19:51 $
+ *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -370,6 +370,6 @@
                 ps##TYPE *imgVecData = imgVec->data.TYPE; \
                 if (maskVec != NULL) { \
-                    maskVecData = maskVec->data.V; \
-                    maskData = (psMaskType* )(mask->data.V[row0]) + c; \
+                    maskVecData = maskVec->data.U8; \
+                    maskData = (psMaskType* )(mask->data.U8[row0]) + c; \
                 } \
                 for (psS32 r=row0;r<row1;r++) { \
@@ -453,7 +453,7 @@
             // point the vector struct to the
             // data to calculate the stats
-            imgVec->data.V = (psPtr )(in->data.U8[r] + col0 * elementSize);
+            imgVec->data.U8 = (psPtr )(in->data.U8[r] + col0 * elementSize);
             if (maskVec != NULL) {
-                maskVec->data.V = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));
+                maskVec->data.U8 = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));
             }
             myStats = psVectorStats(myStats, imgVec, NULL, maskVec, maskVal);
Index: /trunk/psLib/src/image/psImageManip.c
===================================================================
--- /trunk/psLib/src/image/psImageManip.c	(revision 3475)
+++ /trunk/psLib/src/image/psImageManip.c	(revision 3476)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-18 02:35:14 $
+ *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -27,4 +27,5 @@
 #include "psConstants.h"
 #include "psImageErrors.h"
+#include "psCoord.h"
 
 psS32 psImageClip(psImage* input,
@@ -1034,5 +1035,4 @@
     break;
 
-
     switch (mode) {
         PSIMAGE_SHIFT_ARBITRARY_CASE(FLAT);
@@ -1049,2 +1049,35 @@
     return out;
 }
+
+
+// XXX: implementation is awaiting working psPlaneTransform functions like
+// invert.  Also, the next SDRS should have a different signature.
+psImage* psImageTransform(psImage *output,
+                          const psImage *input,
+                          const psImage *inputMask,
+                          int inputMaskVal,
+                          const psPlaneTransform *outToIn,
+                          const psImage *combineMask,
+                          int combineMaskVal)
+{
+    if (input == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psImage_IMAGE_NULL);
+        return NULL;
+    }
+
+    if (outToIn == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psImageManip_TRANSFORM_NULL);
+        return NULL;
+    }
+
+    // find the input image domain in the output image
+
+    // loop through the output image using the domain above and transform
+    // each output pixel to input coordinates and use psImagePixelInterpolate
+    // to determine the pixel value.
+
+
+    return NULL;
+}
Index: /trunk/psLib/src/image/psImageManip.h
===================================================================
--- /trunk/psLib/src/image/psImageManip.h	(revision 3475)
+++ /trunk/psLib/src/image/psImageManip.h	(revision 3476)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -20,4 +20,5 @@
 
 #include "psImage.h"
+#include "psCoord.h"
 
 /// @addtogroup Image
@@ -180,3 +181,34 @@
 );
 
+/** Transform the input image according the supplied transformation.
+ *
+ *  Transform the input image according the supplied transformation. In the
+ *  event that the output is NULL, the smallest possible image capable of
+ *  containing the entire transformed input image is to be returned; otherwise
+ *  only the image size specified in the output image is to be used. If the
+ *  inputMask is not NULL, those pixels in the inputMask matching inputMaskVal
+ *  are to be ignored in the transformation. The inputMask must be of type
+ *  psU8, and of the same size as the input, otherwise the function shall
+ *  generate an error and return NULL. The transformation outToIn specifies
+ *  the coordinates in the input image of a pixel in the output image - note
+ *  that this is the reverse of what might be naively expected, but it is what
+ *  is required in order to use psImagePixelInterpolate. If combineMask is not
+ *  NULL, then those pixels that match combineMaskVal are not transformed.
+ *  combineMask must be of type psU8 and of the same size as the output,
+ *  otherwise the function shall generate an error and return NULL. This
+ *  function must be capable of handling the following types for the input
+ *  (with corresponding types for the output): psF32, psF64.
+ *
+ *  @return psImage*    The transformed image.
+ */
+psImage* psImageTransform(
+    psImage *output,                   ///< psImage to recycle, or NULL
+    const psImage *input,              ///< psImage to apply transform to
+    const psImage *inputMask,          ///< if not NULL, mask of input psImage
+    int inputMaskVal,                  ///< masking value for inputMask
+    const psPlaneTransform *outToIn,   ///< the transform to apply
+    const psImage *combineMask,        ///< if not NULL, mask of pixels not to be transformed
+    int combineMaskVal                 ///< masking value for combineMask
+);
+
 #endif
Index: /trunk/psLib/src/image/psImageStats.c
===================================================================
--- /trunk/psLib/src/image/psImageStats.c	(revision 3475)
+++ /trunk/psLib/src/image/psImageStats.c	(revision 3476)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-23 21:32:40 $
+ *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -63,5 +63,5 @@
         junkData->nalloc = in->numRows * in->numCols;
         junkData->n = junkData->nalloc;
-        junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
+        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
     } else {
         // image not necessarily contiguous
@@ -73,5 +73,5 @@
         junkData->n = junkData->nalloc;
 
-        psU8* data = junkData->data.V;
+        psU8* data = junkData->data.U8;
         for (int row = 0; row < numRows; row++) {
             memcpy(data, in->data.V[row], rowSize);
@@ -87,5 +87,5 @@
             junkMask->nalloc = mask->numRows * mask->numCols;
             junkMask->n = junkMask->nalloc;
-            junkMask->data.V = mask->data.V[0];
+            junkMask->data.U8 = mask->data.V[0];
         } else {
             // image not necessarily contiguous
@@ -97,5 +97,5 @@
             junkMask->n = junkMask->nalloc;
 
-            psU8* data = junkMask->data.V;
+            psU8* data = junkMask->data.U8;
             for (int row = 0; row < numRows; row++) {
                 memcpy(data, mask->data.V[row], rowSize);
@@ -136,5 +136,5 @@
         junkData->nalloc = in->numRows * in->numCols;
         junkData->n = junkData->nalloc;
-        junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
+        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
     } else {
         // image not necessarily contiguous
@@ -146,5 +146,5 @@
         junkData->n = junkData->nalloc;
 
-        psU8* data = junkData->data.V;
+        psU8* data = junkData->data.U8;
         for (int row = 0; row < numRows; row++) {
             memcpy(data, in->data.V[row], rowSize);
@@ -160,5 +160,5 @@
             junkMask->nalloc = mask->numRows * mask->numCols;
             junkMask->n = junkMask->nalloc;
-            junkMask->data.V = mask->data.V[0];
+            junkMask->data.U8 = mask->data.V[0];
         } else {
             // image not necessarily contiguous
@@ -170,5 +170,5 @@
             junkMask->n = junkMask->nalloc;
 
-            psU8* data = junkMask->data.V;
+            psU8* data = junkMask->data.U8;
             for (int row = 0; row < numRows; row++) {
                 memcpy(data, mask->data.V[row], rowSize);
Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 3475)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 3476)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-23 21:32:40 $
+ *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -63,5 +63,5 @@
         junkData->nalloc = in->numRows * in->numCols;
         junkData->n = junkData->nalloc;
-        junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
+        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
     } else {
         // image not necessarily contiguous
@@ -73,5 +73,5 @@
         junkData->n = junkData->nalloc;
 
-        psU8* data = junkData->data.V;
+        psU8* data = junkData->data.U8;
         for (int row = 0; row < numRows; row++) {
             memcpy(data, in->data.V[row], rowSize);
@@ -87,5 +87,5 @@
             junkMask->nalloc = mask->numRows * mask->numCols;
             junkMask->n = junkMask->nalloc;
-            junkMask->data.V = mask->data.V[0];
+            junkMask->data.U8 = mask->data.V[0];
         } else {
             // image not necessarily contiguous
@@ -97,5 +97,5 @@
             junkMask->n = junkMask->nalloc;
 
-            psU8* data = junkMask->data.V;
+            psU8* data = junkMask->data.U8;
             for (int row = 0; row < numRows; row++) {
                 memcpy(data, mask->data.V[row], rowSize);
@@ -136,5 +136,5 @@
         junkData->nalloc = in->numRows * in->numCols;
         junkData->n = junkData->nalloc;
-        junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
+        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
     } else {
         // image not necessarily contiguous
@@ -146,5 +146,5 @@
         junkData->n = junkData->nalloc;
 
-        psU8* data = junkData->data.V;
+        psU8* data = junkData->data.U8;
         for (int row = 0; row < numRows; row++) {
             memcpy(data, in->data.V[row], rowSize);
@@ -160,5 +160,5 @@
             junkMask->nalloc = mask->numRows * mask->numCols;
             junkMask->n = junkMask->nalloc;
-            junkMask->data.V = mask->data.V[0];
+            junkMask->data.U8 = mask->data.V[0];
         } else {
             // image not necessarily contiguous
@@ -170,5 +170,5 @@
             junkMask->n = junkMask->nalloc;
 
-            psU8* data = junkMask->data.V;
+            psU8* data = junkMask->data.U8;
             for (int row = 0; row < numRows; row++) {
                 memcpy(data, mask->data.V[row], rowSize);
Index: /trunk/psLib/src/math/psConstants.h
===================================================================
--- /trunk/psLib/src/math/psConstants.h	(revision 3475)
+++ /trunk/psLib/src/math/psConstants.h	(revision 3476)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-24 00:19:51 $
+ *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -191,5 +191,5 @@
 #define PS_VECTOR_CHECK_NULL(NAME, RVAL) PS_VECTOR_CHECK_NULL_GENERAL(NAME, return RVAL)
 #define PS_VECTOR_CHECK_NULL_GENERAL(NAME, CLEANUP) \
-if (NAME == NULL || NAME->data.V == NULL) { \
+if (NAME == NULL || NAME->data.U8 == NULL) { \
     psError(PS_ERR_BAD_PARAMETER_NULL, true, \
             "Unallowable operation: psVector %s or its data is NULL.", \
@@ -272,5 +272,5 @@
     NEW_STATIC32 = psVectorRecycle(NEW_STATIC32, OLD->n, PS_TYPE_F32); \
     p_psMemSetPersistent(NEW_STATIC32, true); \
-    p_psMemSetPersistent(NEW_STATIC32->data.V, true); \
+    p_psMemSetPersistent(NEW_STATIC32->data.U8, true); \
     for (i=0; i < OLD->n ; i++) { \
         NEW_STATIC32->data.F32[i] = (float) OLD->data.F64[i]; \
@@ -285,5 +285,5 @@
     NEW_STATIC64 = psVectorRecycle(NEW_STATIC64, OLD->n, PS_TYPE_F64); \
     p_psMemSetPersistent(NEW_STATIC64, true); \
-    p_psMemSetPersistent(NEW_STATIC64->data.V, true); \
+    p_psMemSetPersistent(NEW_STATIC64->data.U8, true); \
     for (i=0; i < OLD->n ; i++) { \
         NEW_STATIC64->data.F64[i] = (double) OLD->data.F32[i]; \
@@ -295,5 +295,5 @@
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
 p_psMemSetPersistent(VEC, true); \
-p_psMemSetPersistent(VEC->data.V, true); \
+p_psMemSetPersistent(VEC->data.U8, true); \
 for (int i=0;i<N;i++) { \
     VEC->data.F32[i] = 1.0; \
@@ -303,5 +303,5 @@
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \
 p_psMemSetPersistent(VEC, true); \
-p_psMemSetPersistent(VEC->data.V, true); \
+p_psMemSetPersistent(VEC->data.U8, true); \
 for (int i=0;i<N;i++) { \
     VEC->data.F64[i] = 1.0; \
@@ -311,5 +311,5 @@
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
 p_psMemSetPersistent(VEC, true); \
-p_psMemSetPersistent(VEC->data.V, true); \
+p_psMemSetPersistent(VEC->data.U8, true); \
 for (int i=0;i<N;i++) { \
     VEC->data.F32[i] = (float) i; \
@@ -319,5 +319,5 @@
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \
 p_psMemSetPersistent(VEC, true); \
-p_psMemSetPersistent(VEC->data.V, true); \
+p_psMemSetPersistent(VEC->data.U8, true); \
 for (int i=0;i<N;i++) { \
     VEC->data.F64[i] = (float) i; \
@@ -328,5 +328,5 @@
 NAME = psVectorRecycle(NAME, SIZE, TYPE); \
 p_psMemSetPersistent(NAME, true); \
-p_psMemSetPersistent(NAME->data.V, true); \
+p_psMemSetPersistent(NAME->data.U8, true); \
 
 #define PS_VECTOR_DECLARE_ALLOC_STATIC(NAME, SIZE, TYPE) \
Index: /trunk/psLib/src/math/psMatrix.c
===================================================================
--- /trunk/psLib/src/math/psMatrix.c	(revision 3475)
+++ /trunk/psLib/src/math/psMatrix.c	(revision 3476)
@@ -21,6 +21,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-28 23:34:10 $
+ *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -216,5 +216,5 @@
 
     (*outPerm)->n = numCols;
-    perm.data = (*outPerm)->data.V;
+    perm.data = (psPtr)((*outPerm)->data.U8);
     lu = gsl_matrix_alloc(numRows, numCols);
 
@@ -273,5 +273,5 @@
     outVector->n = numCols;
     perm.size = inPerm->n;
-    perm.data = inPerm->data.V;
+    perm.data = (psPtr)(inPerm->data.U8);
 
     // Solve for {x} in equation: {b} = [A]{x}
@@ -580,5 +580,5 @@
     }
 
-    memcpy(outVector->data.V, inImage->data.V[0], size);
+    memcpy(outVector->data.U8, inImage->data.U8[0], size);
 
     return outVector;
@@ -637,5 +637,5 @@
     PS_CHECK_DIMEN_AND_TYPE(outImage, PS_DIMEN_IMAGE, VECTORTOMATRIX_CLEANUP);
 
-    memcpy(outImage->data.V[0], inVector->data.V, size);
+    memcpy(outImage->data.U8[0], inVector->data.U8, size);
 
     return outImage;
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 3475)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 3476)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:23 $
+ *  @version $Revision: 1.107 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1608,5 +1608,5 @@
         myParamMask = psVectorRecycle(myParamMask, params->n, PS_TYPE_U8);
         p_psMemSetPersistent(myParamMask, true);
-        p_psMemSetPersistent(myParamMask->data.V, true);
+        p_psMemSetPersistent(myParamMask->data.U8, true);
         for (i=0;i<myParamMask->n;i++) {
             myParamMask->data.U8[i] = 0;
Index: /trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.c	(revision 3475)
+++ /trunk/psLib/src/mathtypes/psVector.c	(revision 3476)
@@ -9,6 +9,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-03-11 20:38:56 $
+*  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-03-22 21:52:49 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -37,5 +37,5 @@
     }
 
-    psFree(psVec->data.V);
+    psFree(psVec->data.U8);
 }
 
@@ -59,5 +59,5 @@
 
     // Create vector data array
-    psVec->data.V = psAlloc(nalloc * elementSize);
+    psVec->data.U8 = psAlloc(nalloc * elementSize);
 
     return psVec;
@@ -80,5 +80,5 @@
         }
         // Realloc after decrementation to avoid accessing freed array elements
-        in->data.V = psRealloc(in->data.V, nalloc * elementSize);
+        in->data.U8 = psRealloc(in->data.U8, nalloc * elementSize);
         in->nalloc = nalloc;
     }
@@ -107,5 +107,5 @@
     // need to increase data buffer?
     if (byteSize > in->nalloc*PSELEMTYPE_SIZEOF(in->type.type)) {
-        in->data.V = psRealloc(in->data.V, byteSize);
+        in->data.U8 = psRealloc(in->data.U8, byteSize);
         in->nalloc = n;
     }
@@ -235,5 +235,5 @@
     inType = inVector->type.type;
     N = inVector->n;
-    inVec = inVector->data.V;
+    inVec = (psPtr)inVector->data.U8;
     elSize = PSELEMTYPE_SIZEOF(inType);
 
@@ -249,5 +249,5 @@
     }
     outVector->n = N;
-    outVec = outVector->data.V;
+    outVec = outVector->data.U8;
 
     if (N == 0) {
@@ -496,2 +496,46 @@
 }
 
+psF64 p_psVectorGetElementF64(psVector* vector,
+                              int position)
+{
+    if (vector == NULL) {
+        return NAN;
+    }
+    if (position < 0 || position >= vector->n) {
+        return NAN;
+    }
+
+    switch (vector->type.type) {
+    case PS_TYPE_U8:
+        return vector->data.U8[position];
+        break;
+    case PS_TYPE_U16:
+        return vector->data.U16[position];
+        break;
+    case PS_TYPE_U32:
+        return vector->data.U32[position];
+        break;
+    case PS_TYPE_U64:
+        return vector->data.U64[position];
+        break;
+    case PS_TYPE_S8:
+        return vector->data.S8[position];
+        break;
+    case PS_TYPE_S16:
+        return vector->data.S16[position];
+        break;
+    case PS_TYPE_S32:
+        return vector->data.S32[position];
+        break;
+    case PS_TYPE_S64:
+        return vector->data.S64[position];
+        break;
+    case PS_TYPE_F32:
+        return vector->data.F32[position];
+        break;
+    case PS_TYPE_F64:
+        return vector->data.F64[position];
+    default:
+        return NAN;
+    }
+}
Index: /trunk/psLib/src/mathtypes/psVector.h
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.h	(revision 3475)
+++ /trunk/psLib/src/mathtypes/psVector.h	(revision 3476)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-11 20:38:56 $
+ *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -37,5 +37,4 @@
 
     union {
-        psBool B;               ///< Boolean data.
         psU8* U8;               ///< Unsigned 8-bit integer data.
         psU16* U16;             ///< Unsigned 16-bit integer data.
@@ -50,5 +49,4 @@
         psC32* C32;             ///< Single-precision complex data.
         psC64* C64;             ///< Double-precision complex data.
-        psPtr V;                ///< Pointer to data.
     } data;                     ///< Union for data types.
 }
@@ -153,4 +151,14 @@
 );
 
+/** Returns an element in the vector as a psF64 value
+ *
+ *  @return psF64          the value at specified position, or NAN if position is invalid.
+ */
+psF64 p_psVectorGetElementF64(
+    psVector* vector,                  ///< vector to retrieve element
+    int position                       ///< the vector position to get
+);
+
+
 /// @}
 
Index: /trunk/psLib/src/sys/psError.c
===================================================================
--- /trunk/psLib/src/sys/psError.c	(revision 3475)
+++ /trunk/psLib/src/sys/psError.c	(revision 3476)
@@ -10,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -103,4 +103,27 @@
 
     return code;
+}
+
+void p_psWarning(const char* file,
+                 int lineno,
+                 const char* func,
+                 const char* fmt,
+                 ...)
+{
+    char msgName[1024];
+
+    snprintf(msgName,1024,"%s (%s:%d)",func,file,lineno);
+
+    va_list argPtr;             // variable list argument pointer
+
+    // Get the variable list parameters to pass to logging function
+    va_start(argPtr, fmt);
+
+    psLogMsgV(msgName, PS_LOG_WARN, fmt, argPtr);
+
+    // Clean up stack after variable argument has been used
+    va_end(argPtr);
+
+    return;
 }
 
Index: /trunk/psLib/src/sys/psError.h
===================================================================
--- /trunk/psLib/src/sys/psError.h	(revision 3475)
+++ /trunk/psLib/src/sys/psError.h	(revision 3476)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -106,4 +106,5 @@
 #endif
 
+#ifdef DOXYGEN
 /** Reports an error message to the logging facility
  *
@@ -116,8 +117,19 @@
  *  @return psErrorCode    the given error code
  */
-#ifdef DOXYGEN
 psErrorCode psError(
     psErrorCode code,                  ///< Error class code
     psBool new,                        ///< true if error originates at this location
+    const char* fmt,
+    ...
+);
+
+/** Logs a warning message.
+ *
+ *  This procedure logs a message to the destination set by a prior
+ *  call to psLogSetDestination(), This is equivalent to calling
+ *  psLogMsg with a level of PS_LOG_WARN.
+ *
+ */
+void psWarning(
     const char* fmt,
     ...
@@ -133,7 +145,16 @@
     ...
 );
+void p_psWarning(
+    const char* file,
+    int lineno,
+    const char* func,
+    const char* fmt,
+    ...
+);
+
 
 #ifndef SWIG
 #define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
+#define psWarning(...) p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__)
 #endif
 
Index: /trunk/psLib/src/sys/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sys/psLogMsg.c	(revision 3475)
+++ /trunk/psLib/src/sys/psLogMsg.c	(revision 3476)
@@ -11,6 +11,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -383,10 +383,2 @@
     va_end(ap);
 }
-void psWarning(const char* name, const char* fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    psLogMsgV(name, PS_LOG_WARN, fmt, ap);
-    va_end(ap);
-}
Index: /trunk/psLib/src/sys/psLogMsg.h
===================================================================
--- /trunk/psLib/src/sys/psLogMsg.h	(revision 3475)
+++ /trunk/psLib/src/sys/psLogMsg.h	(revision 3476)
@@ -11,6 +11,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -102,17 +102,4 @@
 };
 
-/** Logs a warning message.
- *
- *  This procedure logs a message to the destination set by a prior
- *  call to psLogSetDestination(), This is equivalent to calling
- *  psLogMsg with a level of PS_LOG_WARN.
- *
- */
-void psWarning(
-    const char* name,
-    const char* fmt,
-    ...
-);
-
 /// @}
 
Index: /trunk/psLib/src/sysUtils/psError.c
===================================================================
--- /trunk/psLib/src/sysUtils/psError.c	(revision 3475)
+++ /trunk/psLib/src/sysUtils/psError.c	(revision 3476)
@@ -10,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -103,4 +103,27 @@
 
     return code;
+}
+
+void p_psWarning(const char* file,
+                 int lineno,
+                 const char* func,
+                 const char* fmt,
+                 ...)
+{
+    char msgName[1024];
+
+    snprintf(msgName,1024,"%s (%s:%d)",func,file,lineno);
+
+    va_list argPtr;             // variable list argument pointer
+
+    // Get the variable list parameters to pass to logging function
+    va_start(argPtr, fmt);
+
+    psLogMsgV(msgName, PS_LOG_WARN, fmt, argPtr);
+
+    // Clean up stack after variable argument has been used
+    va_end(argPtr);
+
+    return;
 }
 
Index: /trunk/psLib/src/sysUtils/psError.h
===================================================================
--- /trunk/psLib/src/sysUtils/psError.h	(revision 3475)
+++ /trunk/psLib/src/sysUtils/psError.h	(revision 3476)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -106,4 +106,5 @@
 #endif
 
+#ifdef DOXYGEN
 /** Reports an error message to the logging facility
  *
@@ -116,8 +117,19 @@
  *  @return psErrorCode    the given error code
  */
-#ifdef DOXYGEN
 psErrorCode psError(
     psErrorCode code,                  ///< Error class code
     psBool new,                        ///< true if error originates at this location
+    const char* fmt,
+    ...
+);
+
+/** Logs a warning message.
+ *
+ *  This procedure logs a message to the destination set by a prior
+ *  call to psLogSetDestination(), This is equivalent to calling
+ *  psLogMsg with a level of PS_LOG_WARN.
+ *
+ */
+void psWarning(
     const char* fmt,
     ...
@@ -133,7 +145,16 @@
     ...
 );
+void p_psWarning(
+    const char* file,
+    int lineno,
+    const char* func,
+    const char* fmt,
+    ...
+);
+
 
 #ifndef SWIG
 #define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
+#define psWarning(...) p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__)
 #endif
 
Index: /trunk/psLib/src/sysUtils/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sysUtils/psLogMsg.c	(revision 3475)
+++ /trunk/psLib/src/sysUtils/psLogMsg.c	(revision 3476)
@@ -11,6 +11,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -383,10 +383,2 @@
     va_end(ap);
 }
-void psWarning(const char* name, const char* fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    psLogMsgV(name, PS_LOG_WARN, fmt, ap);
-    va_end(ap);
-}
Index: /trunk/psLib/src/sysUtils/psLogMsg.h
===================================================================
--- /trunk/psLib/src/sysUtils/psLogMsg.h	(revision 3475)
+++ /trunk/psLib/src/sysUtils/psLogMsg.h	(revision 3476)
@@ -11,6 +11,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-22 21:52:49 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -102,17 +102,4 @@
 };
 
-/** Logs a warning message.
- *
- *  This procedure logs a message to the destination set by a prior
- *  call to psLogSetDestination(), This is equivalent to calling
- *  psLogMsg with a level of PS_LOG_WARN.
- *
- */
-void psWarning(
-    const char* name,
-    const char* fmt,
-    ...
-);
-
 /// @}
 
