Index: trunk/psLib/src/image/Makefile.am
===================================================================
--- trunk/psLib/src/image/Makefile.am	(revision 4029)
+++ trunk/psLib/src/image/Makefile.am	(revision 4128)
@@ -15,5 +15,4 @@
 	psImagePixelExtract.c \
 	psImageStructManip.c \
-	psImageIO.c \
 	psImageGeomManip.c \
 	psImagePixelManip.c \
@@ -33,5 +32,4 @@
 	psImagePixelExtract.h \
 	psImageStructManip.h \
-	psImageIO.h \
 	psImageGeomManip.h \
 	psImagePixelManip.h \
Index: trunk/psLib/src/image/image.i
===================================================================
--- trunk/psLib/src/image/image.i	(revision 4029)
+++ trunk/psLib/src/image/image.i	(revision 4128)
@@ -6,5 +6,4 @@
 %include "psImageFFT.h"
 %include "psImage.h"
-%include "psImageIO.h"
 %include "psImageGeomManip.h"
 %include "psImagePixelManip.h"
Index: trunk/psLib/src/image/psImage.c
===================================================================
--- trunk/psLib/src/image/psImage.c	(revision 4029)
+++ trunk/psLib/src/image/psImage.c	(revision 4128)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-19 05:18:20 $
+ *  @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-07 02:29:44 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -352,4 +352,19 @@
 
     return numFreed;
+}
+
+bool p_psImagePrint (FILE *f, psImage *a, char *name)
+{
+
+    fprintf (f, "matrix: %s\n", name);
+
+    for (int j = 0; j < a[0].numRows; j++) {
+        for (int i = 0; i < a[0].numCols; i++) {
+            fprintf (f, "%f  ", p_psImageGetElementF64(a, i, j));
+        }
+        fprintf (f, "\n");
+    }
+    fprintf (f, "\n");
+    return (true);
 }
 
Index: trunk/psLib/src/image/psImage.h
===================================================================
--- trunk/psLib/src/image/psImage.h	(revision 4029)
+++ trunk/psLib/src/image/psImage.h	(revision 4128)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-19 23:57:37 $
+ *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-07 02:29:44 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -176,4 +176,14 @@
 );
 
+/** print image pixel values.
+ *
+ *  @return bool    TRUE is successful, otherwise FALSE.
+ */
+bool p_psImagePrint(
+    FILE *f,                           ///< Destination stream
+    psImage *a,                        ///< image to print
+    char *name                         ///< name of the image (for title)
+);
+
 /** Interpolate image pixel value given floating point coordinates.
  *
Index: trunk/psLib/src/image/psImageConvolve.c
===================================================================
--- trunk/psLib/src/image/psImageConvolve.c	(revision 4029)
+++ trunk/psLib/src/image/psImageConvolve.c	(revision 4128)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-19 05:18:20 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-07 02:29:44 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -20,5 +20,4 @@
 #include "psLogMsg.h"
 #include "psError.h"
-#include "psImageIO.h"
 
 #include "psImageErrors.h"
Index: trunk/psLib/src/image/psImageFFT.c
===================================================================
--- trunk/psLib/src/image/psImageFFT.c	(revision 4029)
+++ trunk/psLib/src/image/psImageFFT.c	(revision 4128)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-19 05:18:20 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-07 02:29:44 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -19,5 +19,4 @@
 #include "psMemory.h"
 #include "psLogMsg.h"
-#include "psImageIO.h"
 #include "psImageStructManip.h"
 
Index: trunk/psLib/src/image/psImageIO.c
===================================================================
--- trunk/psLib/src/image/psImageIO.c	(revision 4029)
+++ 	(revision )
@@ -1,436 +1,0 @@
-/** @file  psImageIO.c
- *
- *  @brief Contains image I/O routines.
- *
- *  This file defines the file input/output functions for the psImage structure.
- *
- *  @author Robert DeSonia, MHPCC
- *
- *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-29 02:25:10 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- */
-
-#include <fitsio.h>
-#include <unistd.h>
-
-#include "psImageIO.h"
-#include "psError.h"
-#include "psMemory.h"
-#include "psLogMsg.h"
-
-#include "psImageErrors.h"
-
-psImage* psImageReadSection(psImage* output,
-                            psS32 col,
-                            psS32 row,
-                            psS32 numCols,
-                            psS32 numRows,
-                            psS32 z,
-                            char *extname,
-                            psS32 extnum,
-                            char *filename)
-{
-    fitsfile *fptr = NULL;      /* Pointer to the FITS file */
-    psS32 status = 0;           /* CFITSIO file vars */
-    psS32 nAxis = 0;
-    psS32 anynull = 0;
-    psS32 bitPix = 0;           /* Pixel type */
-    long nAxes[3];
-    long firstPixel[3];         /* lower-left corner of image subset */
-    long lastPixel[3];          /* upper-right corner of image subset */
-    long increment[3];          /* increment for image subset */
-    char fitsErr[80] = "";      /* CFITSIO error message string */
-    psS32 hduType = IMAGE_HDU;
-    psS32 fitsDatatype = 0;
-    psS32 datatype = 0;
-
-    psLogMsg(__func__,PS_LOG_WARN, "psImageReadSection is deprecated.  Consider using psFitsReadImage instead.");
-
-    if (filename == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                PS_ERRORTEXT_psImageIO_FILENAME_NULL);
-        psFree(output);
-        return NULL;
-    }
-
-    /* Open the FITS file */
-    (void)fits_open_file(&fptr, filename, READONLY, &status);
-    if (fptr == NULL || status != 0) {
-        fits_get_errstatus(status, fitsErr);
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                PS_ERRORTEXT_psImageIO_FILENAME_INVALID,
-                filename, fitsErr);
-        psFree(output);
-        return NULL;
-    }
-
-    /* find the specified extension */
-    if (extname != NULL) {
-        if (fits_movnam_hdu(fptr, hduType, extname, 0, &status) != 0) {
-            fits_get_errstatus(status, fitsErr);
-            status = 0;
-            (void)fits_close_file(fptr, &status);
-            psError(PS_ERR_LOCATION_INVALID, true,
-                    PS_ERRORTEXT_psImageIO_EXTNAME_INVALID,
-                    extname, filename, fitsErr);
-            psFree(output);
-            return NULL;
-        }
-    } else {
-        if (fits_movabs_hdu(fptr, extnum + 1, &hduType, &status) != 0) {
-            fits_get_errstatus(status, fitsErr);
-            status = 0;
-            (void)fits_close_file(fptr, &status);
-            psError(PS_ERR_LOCATION_INVALID, true,
-                    PS_ERRORTEXT_psImageIO_EXTNUM_INVALID,
-                    extnum, filename, fitsErr);
-            psFree(output);
-            return NULL;
-        }
-    }
-
-    /* Get the data type 'bitPix' from the FITS image */
-    if (fits_get_img_equivtype(fptr, &bitPix, &status) != 0) {
-        fits_get_errstatus(status, fitsErr);
-        status = 0;
-        (void)fits_close_file(fptr, &status);
-        psError(PS_ERR_IO, true,
-                PS_ERRORTEXT_psImageIO_DATATYPE_UNKNOWN,
-                filename, fitsErr);
-        psFree(output);
-        return NULL;
-    }
-
-    /* Get the dimensions 'nAxis' from the FITS image */
-    if (fits_get_img_dim(fptr, &nAxis, &status) != 0) {
-        (void)fits_get_errstatus(status, fitsErr);
-        status = 0;
-        (void)fits_close_file(fptr, &status);
-        psError(PS_ERR_IO, true,
-                PS_ERRORTEXT_psImageIO_IMAGE_DIM_UNKNOWN,
-                filename, fitsErr);
-        psFree(output);
-        return NULL;
-    }
-
-    /* Validate the number of axis */
-    if ((nAxis < 2) || (nAxis > 3)) {
-        status = 0;
-        (void)fits_close_file(fptr, &status);
-        psError(PS_ERR_IO, true,
-                PS_ERRORTEXT_psImageIO_IMAGE_DIMENSION_UNSUPPORTED,
-                nAxis);
-        psFree(output);
-        return NULL;
-    }
-
-    /* Get the Image size from the FITS file */
-    if (fits_get_img_size(fptr, nAxis, nAxes, &status) != 0) {
-        (void)fits_get_errstatus(status, fitsErr);
-        status = 0;
-        (void)fits_close_file(fptr, &status);
-        psError(PS_ERR_IO, true,
-                PS_ERRORTEXT_psImageIO_IMAGE_SIZE_UNKNOWN,
-                filename, fitsErr);
-        psFree(output);
-        return NULL;
-    }
-
-    if (numCols < 1) {
-        numCols += nAxes[0] - col;
-    }
-    if (numRows < 1) {
-        numRows += nAxes[1] - row;
-    }
-
-    firstPixel[0] = col + 1;
-    firstPixel[1] = row + 1;
-    firstPixel[2] = z + 1;
-
-    lastPixel[0] = firstPixel[0] + numCols - 1;
-    lastPixel[1] = firstPixel[1] + numRows - 1;
-    lastPixel[2] = z + 1;
-
-    increment[0] = 1;
-    increment[1] = 1;
-    increment[2] = 1;
-
-    switch (bitPix) {
-    case BYTE_IMG:
-        datatype = PS_TYPE_U8;
-        fitsDatatype = TBYTE;
-        break;
-    case SBYTE_IMG:
-        datatype = PS_TYPE_S8;
-        fitsDatatype = TSBYTE;
-        break;
-    case USHORT_IMG:
-        datatype = PS_TYPE_U16;
-        fitsDatatype = TUSHORT;
-        break;
-    case SHORT_IMG:
-        datatype = PS_TYPE_S16;
-        fitsDatatype = TSHORT;
-        break;
-    case ULONG_IMG:
-        datatype = PS_TYPE_U32;
-        fitsDatatype = TUINT;
-        break;
-    case LONG_IMG:
-        datatype = PS_TYPE_S32;
-        fitsDatatype = TINT;
-        break;
-    case LONGLONG_IMG:
-        datatype = PS_TYPE_S64;
-        fitsDatatype = TLONGLONG;
-        break;
-    case FLOAT_IMG:
-        datatype = PS_TYPE_F32;
-        fitsDatatype = TFLOAT;
-        break;
-    case DOUBLE_IMG:
-        datatype = PS_TYPE_F64;
-        fitsDatatype = TDOUBLE;
-        break;
-    default:
-        psError(PS_ERR_IO, true,
-                PS_ERRORTEXT_psImageIO_FITS_TYPE_UNSUPPORTED,
-                bitPix, filename);
-        psFree(output);
-        return NULL;
-    }
-    output = psImageRecycle(output, numCols, numRows, datatype);
-    if (fits_read_subset(fptr, fitsDatatype, firstPixel, lastPixel, increment,
-                         NULL, output->data.V[0], &anynull, &status) != 0) {
-        psFree(output);
-        (void)fits_get_errstatus(status, fitsErr);
-        status = 0;
-        (void)fits_close_file(fptr, &status);
-        psError(PS_ERR_IO, true,
-                PS_ERRORTEXT_psImageIO_READ_FAILED,
-                filename, fitsErr);
-        return NULL;
-    }
-
-    (void)fits_close_file(fptr, &status);
-
-    return output;
-}
-
-psBool psImageWriteSection(psImage* input,
-                           psS32 col0,
-                           psS32 row0,
-                           psS32 z,
-                           char *extname,
-                           psS32 extnum,
-                           char *filename)
-{
-    psS32 numCols = 0;
-    psS32 numRows = 0;
-
-    psS32 status = 0;             /* CFITSIO status */
-    fitsfile *fptr = NULL;      /* pointer to the FITS file */
-    long nAxes[3];              /* Image axis vars */
-    long firstPixel[3];         /* First Pixel to read */
-    long lastPixel[3];          /* Last Pixel to read */
-    char fitsErr[80];           /* FITSIO message string */
-    psS32 datatype = 0;           /* the datatype of the image */
-    psS32 bitPix = 0;             /* FITS bitPix value */
-    psS32 hduType = IMAGE_HDU;    /* the HDU type (image,table, etc.) */
-    double bscale = 1.0;
-    double bzero = 0.0;
-    psBool createNewHDU = false;
-
-    psLogMsg(__func__,PS_LOG_WARN, "psImageWriteSection is deprecated.  Consider using psFitsWriteImage instead.");
-
-    /* need a valid image to write */
-    if (input == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                PS_ERRORTEXT_psImage_IMAGE_NULL);
-        return false;
-    }
-
-    numRows = input->numRows;
-    numCols = input->numCols;
-
-    switch (input->type.type) {
-    case PS_TYPE_U8:
-        bitPix = BYTE_IMG;
-        datatype = TBYTE;
-        break;
-    case PS_TYPE_S8:
-        bitPix = BYTE_IMG;
-        bzero = INT8_MIN;
-        datatype = TSBYTE;
-        break;
-    case PS_TYPE_U16:
-        bitPix = SHORT_IMG;
-        bzero = -1.0f * INT16_MIN;
-        datatype = TUSHORT;
-        break;
-    case PS_TYPE_S16:
-        bitPix = SHORT_IMG;
-        datatype = TSHORT;
-        break;
-    case PS_TYPE_U32:
-        bitPix = LONG_IMG;
-        bzero = -1.0f * INT32_MIN;
-        datatype = TUINT;
-        break;
-    case PS_TYPE_S32:
-        bitPix = LONG_IMG;
-        datatype = TINT;
-        break;
-    case PS_TYPE_F32:
-        bitPix = FLOAT_IMG;
-        datatype = TFLOAT;
-        break;
-    case PS_TYPE_F64:
-        bitPix = DOUBLE_IMG;
-        datatype = TDOUBLE;
-        break;
-    default: {
-            char* typeStr;
-            PS_TYPE_NAME(typeStr,input->type.type);
-            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
-                    PS_ERRORTEXT_psImageIO_TYPE_UNSUPPORTED,
-                    typeStr);
-            return false;
-        }
-    }
-
-    /* Open the FITS file */
-    if (access(filename, F_OK) == 0) {     // file
-        // exists
-        (void)fits_open_file(&fptr, filename, READWRITE, &status);
-        if (fptr == NULL || status != 0) {
-            fits_get_errstatus(status, fitsErr);
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                    PS_ERRORTEXT_psImageIO_FILENAME_INVALID,
-                    filename, fitsErr);
-            return false;
-        }
-
-        /* find the specified extension */
-        if (extname != NULL) {
-            if (fits_movnam_hdu(fptr, hduType, extname, 0, &status) != 0) {
-                fits_get_errstatus(status, fitsErr);
-                status = 0;
-                (void)fits_close_file(fptr, &status);
-                psError(PS_ERR_LOCATION_INVALID, true,
-                        PS_ERRORTEXT_psImageIO_EXTNAME_INVALID,
-                        extname, filename, fitsErr);
-                return false;
-            }
-        } else {
-            psS32 numHDUs = 0;
-
-            fits_get_num_hdus(fptr, &numHDUs, &status);
-            if (numHDUs < extnum) {
-                status = 0;
-                (void)fits_close_file(fptr, &status);
-                psError(PS_ERR_LOCATION_INVALID, true,
-                        PS_ERRORTEXT_psImageIO_WRITE_EXTNUM_INVALID,
-                        extnum, numHDUs);
-                return false;
-            } else if (numHDUs == extnum) {
-                createNewHDU = true;
-            } else if (fits_movabs_hdu(fptr, extnum + 1, &hduType, &status) != 0) {
-                fits_get_errstatus(status, fitsErr);
-                status = 0;
-                (void)fits_close_file(fptr, &status);
-                psError(PS_ERR_LOCATION_INVALID, true,
-                        PS_ERRORTEXT_psImageIO_EXTNUM_INVALID,
-                        extnum, filename, fitsErr);
-                return false;
-            }
-        }
-
-    } else {
-        // file does not exist
-
-        (void)fits_create_file(&fptr, filename, &status);
-        if (fptr == NULL || status != 0) {
-            fits_get_errstatus(status, fitsErr);
-            psError(PS_ERR_IO, true,
-                    PS_ERRORTEXT_psImageIO_FILENAME_CREATE_FAILED,
-                    filename, fitsErr);
-            return false;
-        }
-        createNewHDU = true;
-    }
-
-    if (createNewHDU) {
-        /* create the mandatory image keywords */
-        nAxes[0] = col0 + numCols;
-        nAxes[1] = row0 + numRows;
-        nAxes[2] = z + 1;
-        if (fits_create_img(fptr, bitPix, 3, nAxes, &status) != 0) {
-            (void)fits_get_errstatus(status, fitsErr);
-            status = 0;
-            (void)fits_close_file(fptr, &status);
-            psError(PS_ERR_IO, true,
-                    PS_ERRORTEXT_psImageIO_CREATE_HDU_FAILED,
-                    filename, fitsErr);
-            return false;
-        }
-        // set the bscale/bzero
-        fits_write_key_dbl(fptr, "BZERO", bzero, 12, "Pixel Value Offset", &status);
-        fits_write_key_dbl(fptr, "BSCALE", bscale, 12, "Pixel Value Scale", &status);
-        fits_set_bscale(fptr, bscale, bzero, &status);
-
-        if (extname != NULL) {
-            /* create the extension for the Primary HDU */
-            if (fits_write_key_str(fptr, "EXTNAME", extname, "Extension Name", &status) != 0) {
-                (void)fits_get_errstatus(status, fitsErr);
-                status = 0;
-                (void)fits_close_file(fptr, &status);
-                psError(PS_ERR_IO, true,
-                        PS_ERRORTEXT_psImageIO_CREATE_EXTENSION_FAILED,
-                        filename, fitsErr);
-                return false;
-            }
-        }
-    }
-
-    firstPixel[0] = col0 + 1;
-    firstPixel[1] = row0 + 1;
-    firstPixel[2] = z + 1;
-
-    lastPixel[0] = firstPixel[0] + numCols - 1;
-    lastPixel[1] = firstPixel[1] + numRows - 1;
-    lastPixel[2] = z + 1;
-
-    if (fits_write_subset(fptr, datatype, firstPixel, lastPixel, input->data.V[0], &status) != 0) {
-        (void)fits_get_errstatus(status, fitsErr);
-        status = 0;
-        (void)fits_close_file(fptr, &status);
-        psError(PS_ERR_IO, true,
-                PS_ERRORTEXT_psImageIO_WRITE_FAILED,
-                filename, fitsErr);
-        return false;
-    }
-
-    status = 0;
-    (void)fits_close_file(fptr, &status);
-
-    return true;
-}
-
-bool p_psImagePrint (FILE *f, psImage *a, char *name)
-{
-
-    fprintf (f, "matrix: %s\n", name);
-
-    for (int j = 0; j < a[0].numRows; j++) {
-        for (int i = 0; i < a[0].numCols; i++) {
-            fprintf (f, "%f  ", p_psImageGetElementF64(a, i, j));
-        }
-        fprintf (f, "\n");
-    }
-    fprintf (f, "\n");
-    return (true);
-}
-
Index: trunk/psLib/src/image/psImageIO.h
===================================================================
--- trunk/psLib/src/image/psImageIO.h	(revision 4029)
+++ 	(revision )
@@ -1,106 +1,0 @@
-
-/** @file  psImageIO.h
- *
- *  @brief Contains image input/output routines
- *
- *  This file defines the file input/output functions for the psImage structure.
- *
- *  @ingroup ImageIO
- *
- *  @author Robert DeSonia, MHPCC
- *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-29 02:25:10 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- */
-#ifndef PS_IMAGEIO_H
-#define PS_IMAGEIO_H
-
-#include "psImage.h"
-
-/// @addtogroup ImageIO
-/// @{
-
-/** Read an image or subimage from a FITS file specified by a filename.
- *
- *  return psImage* The image read from the specified file.  NULL
- *                          signifies that a problem had occured.
- */
-psImage* psImageReadSection(
-    psImage* output,
-    /**< the output psImage to recycle, or NULL if new psImage desired */
-
-    psS32 col0,
-    /**< the column index of the origin to start reading */
-
-    psS32 row0,
-    /**< the row index of the origin to start reading */
-
-    psS32 numCols,
-    /**< the number of desired columns to read */
-
-    psS32 numRows,
-    /**< the number of desired rows to read */
-
-    psS32 z,
-    /**< the z index to read if file is organized as a 3D image cube. */
-
-    char *extname,
-    /**< the image extension to read (this should match the EXTNAME keyword in
-        *   the extension If NULL, the extnum parameter is to be used instead
-        */
-
-    psS32 extnum,
-    /**< the image extension to read (0=PHU, 1=first extension, etc.)  This is
-        *   only used if extname is NULL
-        */
-
-    char *filename
-    /**< the filename of the FITS image file to read */
-);
-
-/** Read an image or subimage from a FITS file specified by a filename.
- *
- *  return psBool         TRUE is successful, otherwise FALSE.
- */
-psBool psImageWriteSection(
-    psImage* input,
-    /**< the psImage to write */
-
-    psS32 col0,
-    /**< the column index of the origin to start writing */
-
-    psS32 row0,
-    /**< the row index of the origin to start writing */
-
-    psS32 z,
-    /**< the z index to start writing */
-
-    char *extname,
-    /**< the image extension to write (this should match the EXTNAME keyword in
-    *   the extension If NULL, the extnum parameter is to be used instead
-    */
-
-    psS32 extnum,
-    /**< the image extension to write (0=PHU, 1=first extension, etc.)  This is
-    *   only used if extname is NULL.
-    */
-
-    char *filename
-    /**< the filename of the FITS image file to write */
-);
-
-/** print image pixel values.
- *
- *  @return bool    TRUE is successful, otherwise FALSE.
- */
-bool p_psImagePrint(
-    FILE *f,                           ///< Destination stream
-    psImage *a,                        ///< image to print
-    char *name                         ///< name of the image (for title)
-);
-
-/// @}
-
-#endif // PS_IMAGEIO_H
