Index: trunk/psLib/src/fits/psFits.c
===================================================================
--- trunk/psLib/src/fits/psFits.c	(revision 15625)
+++ trunk/psLib/src/fits/psFits.c	(revision 15908)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-11-16 00:14:49 $
+ *  @version $Revision: 1.75 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-12-24 21:00:07 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -570,4 +570,7 @@
     }
 
+    // if we are setting a trivial compression (NONE), don't bother with the other parameters
+    if (type == PS_FITS_COMPRESS_NONE) return true;
+
     // convert a psVector into the (long *) array that cfitsio requires
     psVector *dim = NULL;
@@ -592,11 +595,15 @@
     }
 
-    if (fits_set_noise_bits(fits->fd, noisebits, &status)) {
-        fits_set_compression_type(fits->fd, 0x0, &status);
-        char fitsErr[MAX_STRING_LENGTH];
-        fits_get_errstatus(status, fitsErr);
-        psError(PS_ERR_BAD_FITS, true,
-            "Error while configuring compression. CFITSIO error: %s", fitsErr);
-        return false;
+    // noise bits are irrelevant (not allowed) for PLIO.  XXX actually, it is the data type
+    // that is the restriction; data must be 32 or 64 bit for noise bits to be valid.
+    if (type != PS_FITS_COMPRESS_PLIO) {
+	if (fits_set_noise_bits(fits->fd, noisebits, &status)) {
+	    fits_set_compression_type(fits->fd, 0x0, &status);
+	    char fitsErr[MAX_STRING_LENGTH];
+	    fits_get_errstatus(status, fitsErr);
+	    psError(PS_ERR_BAD_FITS, true,
+		    "Error while configuring compression. CFITSIO error: %s", fitsErr);
+	    return false;
+	}
     }
 
@@ -776,4 +783,5 @@
     case PS_TYPE_U8:
         bitpix = BYTE_IMG;
+        bzero = -1.0 * INT8_MIN;
         datatype = TBYTE;
         break;
@@ -781,5 +789,4 @@
     case PS_TYPE_S8:
         bitpix = BYTE_IMG;
-        bzero = INT8_MIN;
         datatype = TSBYTE;
         break;
