Index: trunk/psLib/src/dataIO/psFits.c
===================================================================
--- trunk/psLib/src/dataIO/psFits.c	(revision 3407)
+++ 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) {
