Index: /trunk/psLib/src/fits/psFits.c
===================================================================
--- /trunk/psLib/src/fits/psFits.c	(revision 5148)
+++ /trunk/psLib/src/fits/psFits.c	(revision 5149)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-27 02:27:28 $
+ *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-27 19:55:32 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -77,5 +77,5 @@
 }
 
-static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType)
+static bool convertPsTypeToFits(int type, int* bitPix, double* bZero, int* dataType)
 {
 
@@ -91,5 +91,4 @@
         break;
 
-    case PS_TYPE_BOOL:
     case PS_TYPE_S8:
         bitpix = BYTE_IMG;
@@ -128,4 +127,14 @@
         bitpix = DOUBLE_IMG;
         datatype = TDOUBLE;
+        break;
+
+    case PS_DATA_STRING:
+        bitpix = BYTE_IMG;
+        datatype = TSTRING;
+        break;
+
+    case PS_DATA_BOOL:
+        bitpix = BYTE_IMG;
+        datatype = TLOGICAL;
         break;
 
@@ -1539,5 +1548,5 @@
         if (fitsType[strlen(fitsType)-1] == 'A') {
             // string type -- append length to the type.
-            psStringPrepend(&fitsType,"%d",strlen(((psMetadataItem*)columns->data[n])->data.V)+1);
+            psStringPrepend(&fitsType,"%d",strlen(((psMetadataItem*)columns->data[n])->data.V));
         }
         columnTypes->data[n] = fitsType;
@@ -1715,5 +1724,7 @@
 
     while ( (item=psMetadataGetAndIncrement(iter)) != NULL) {
-        if (PS_DATA_IS_PRIMITIVE(item->type) || item->type == PS_DATA_STRING) {
+        if (PS_DATA_IS_PRIMITIVE(item->type) ||
+                item->type == PS_DATA_BOOL ||
+                item->type == PS_DATA_STRING) {
             // operating on primitive data type or string, i.e., not a complex object
             int colnum = 0;
@@ -1721,8 +1732,6 @@
             if ( fits_get_colnum(fits->fd, CASESEN, item->name, &colnum, &status) == 0) {
                 // cooresponding column found in table
-                int dataType = TSTRING; // assume string unless it is a primative type
-                if (PS_DATA_IS_PRIMITIVE(item->type)) {
-                    convertPsTypeToFits(item->type, NULL, NULL, &dataType);
-                }
+                int dataType;
+                convertPsTypeToFits(item->type, NULL, NULL, &dataType);
 
                 if (fits_write_col(fits->fd, dataType, colnum, row+1, 1, 1, &item->data,&status) != 0) {
