Index: /trunk/psLib/src/fits/psFitsHeader.c
===================================================================
--- /trunk/psLib/src/fits/psFitsHeader.c	(revision 7228)
+++ /trunk/psLib/src/fits/psFitsHeader.c	(revision 7229)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-26 03:24:49 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-27 01:49:22 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -219,9 +219,7 @@
 
 
-// Do the work of writing out the header.
-// Doesn't check to see if a new HDU needs to be created
-bool p_psFitsWriteHeader(psMetadata *output, // Metadata that is to be output into the FITS file
-                         psFits *fits   // The FITS file handle
-                        )
+bool psFitsWriteHeader(psMetadata *output, // Metadata that is to be output into the FITS file
+                       psFits *fits     // The FITS file handle
+                      )
 {
     if (!fits) {
@@ -314,6 +312,6 @@
 }
 
-bool psFitsWriteHeader(psMetadata* output,
-                       psFits* fits)
+bool psFitsWriteBlank(psMetadata* output,
+                      psFits* fits)
 {
     if (!fits) {
@@ -327,19 +325,15 @@
     }
 
-    // Check to see if there are any extant HDUs
-    int hdus = psFitsGetSize(fits);     // Number of HDUs
-    if (hdus == 0) {
-        // Need to create a dummy image HDU for the primary HDU
-        int status = 0;                 // Status of cfitsio
-        fits_create_img(fits->fd, 16, 0, NULL, &status);
-        if (status) {
-            char fitsErr[MAX_STRING_LENGTH];
-            (void)fits_get_errstatus(status, fitsErr);
-            psError(PS_ERR_IO, true, "Unable to create primary header.\n%s\n", fitsErr);
-            return false;
-        }
-    }
-
-    return p_psFitsWriteHeader(output, fits);
+    // Create a dummy image HDU for the primary HDU
+    int status = 0;                 // Status of cfitsio
+    fits_create_img(fits->fd, 16, 0, NULL, &status);
+    if (status) {
+        char fitsErr[MAX_STRING_LENGTH];
+        (void)fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_IO, true, "Unable to create primary header.\n%s\n", fitsErr);
+        return false;
+    }
+
+    return psFitsWriteHeader(output, fits);
 }
 
Index: /trunk/psLib/src/fits/psFitsHeader.h
===================================================================
--- /trunk/psLib/src/fits/psFitsHeader.h	(revision 7228)
+++ /trunk/psLib/src/fits/psFitsHeader.h	(revision 7229)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-26 03:24:49 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-27 01:49:22 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -42,20 +42,20 @@
 
 /** Writes the values of the metadata to the current HDU header.
- *  Doesn't check if the header has to be created, so not for general public use.
+ *  Doesn't check if the header has to be created.
  *
  * @return bool         if TRUE, the write was successful, otherwise FALSE.
  */
-bool p_psFitsWriteHeader(
+bool psFitsWriteHeader(
     psMetadata* output,                 ///< the psMetadata data in which to write
     psFits* fits                        ///< the psFits object
 );
 
-/** Writes the values of the metadata to an HDU header.
+/** Writes a "blank" --- a header only, with no image or table.
  *
  *  @return bool        if TRUE, the write was successful, otherwise FALSE.
  */
-bool psFitsWriteHeader(
+bool psFitsWriteBlank(
     psMetadata* output,                 ///< the psMetadata data in which to write
-    psFits* fits                       ///< the psFits object
+    psFits* fits                        ///< the psFits object
 );
 
Index: /trunk/psLib/src/fits/psFitsImage.c
===================================================================
--- /trunk/psLib/src/fits/psFitsImage.c	(revision 7228)
+++ /trunk/psLib/src/fits/psFitsImage.c	(revision 7229)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-26 03:24:49 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-27 01:49:22 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -335,6 +335,5 @@
     } else {
         if (!after) {
-            int chdu = psFitsGetExtNum(fits);   // Current HDU number
-            if (chdu == 0) {
+            if (psFitsGetExtNum(fits) == 0) {
                 // We're creating a replacement primary HDU.
                 // Set status to signal fits_insert_img to insert a new primary HDU
@@ -349,5 +348,5 @@
     }
 
-    if (header && !p_psFitsWriteHeader(header, fits)) {
+    if (header && !psFitsWriteHeader(header, fits)) {
         psError(PS_ERR_IO, false, "Unable to write FITS header.\n");
         return false;
