Index: /trunk/psLib/Makefile.am
===================================================================
--- /trunk/psLib/Makefile.am	(revision 5511)
+++ /trunk/psLib/Makefile.am	(revision 5512)
@@ -15,8 +15,10 @@
     autogen.sh
 
+if DOXYGEN
 docs: Doxyfile $(prefix)/docs/pslib $(mandir)/man3
-	$(DOXYGEN)
+	doxygen Doxyfile
 	mv -f $(prefix)/docs/pslib/man/man3/* $(mandir)/man3
 	rm -rf $(prefix)/docs/pslib/man
+endif
 
 $(prefix)/docs/pslib:
Index: /trunk/psLib/configure.ac
===================================================================
--- /trunk/psLib/configure.ac	(revision 5511)
+++ /trunk/psLib/configure.ac	(revision 5512)
@@ -1,3 +1,3 @@
-AC_PREREQ(2.57)
+AC_PREREQ(2.59)
 
 AC_INIT([pslib],[0.8.99],[http://pan-starrs.ifa.hawaii.edu/bugzilla])
@@ -6,5 +6,5 @@
 
 AM_INIT_AUTOMAKE([1.7 foreign dist-bzip2])
-AM_CONFIG_HEADER(src/config.h)
+AC_CONFIG_HEADERS([src/config.h])
 AM_MAINTAINER_MODE
 
@@ -12,11 +12,14 @@
 AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION)
 
-dnl Determine the location of GNU sed
-AC_CHECK_PROGS([SED],[gsed sed])
-if test "${SED}" == ""
-then
-  AC_MSG_ERROR([GNU SED is required.])
-fi
-AC_SUBST(SED,[${SED}])
+dnl ------------------- PERL options ---------------------
+  AC_ARG_WITH(perl,
+    [AS_HELP_STRING(--with-perl=FILE,Specify location of PERL executable.)],
+    [AC_CHECK_PROG(PERL, $withval, $withval)],
+    [AC_CHECK_PROG(PERL, perl, `which perl`)])
+    if test "$PERL" == ""
+    then
+      AC_MSG_ERROR([PERL is required.  Use --with-perl to specify its install location.])
+    fi
+    AC_SUBST(PERL,$PERL)
 
 SUBDIR="etc src test" dnl don't include 'swig', as it is optional
@@ -24,7 +27,8 @@
 SRCPATH='${top_srcdir}/src'
 SRCDIRS="sys astro db fft fits imageops math mathtypes types xml"
-SRCINC=`echo "${SRCDIRS=}" | ${SED} "s|\(\\w\+\)|-I\${SRCPATH=}/\1|g"`
+# escape two escapes at this level so \\ gets passed to the shell and \ to perl
+SRCINC=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH=}/\1|g"`
 SRCINC="-I${SRCPATH=} ${SRCINC=}"
-SRCSUBLIBS=`echo "${SRCDIRS=}" | ${SED} "s|\(\\w\+\)|\1/libpslib\1.la|g"`
+SRCSUBLIBS=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|\1/libpslib\1.la|g"`
 AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS=})
 AC_SUBST(SRCINC,${SRCINC=})
@@ -49,11 +53,4 @@
 )
 
-case $host in
-  *-apple-darwin*)
-dnl    CFLAGS="${CFLAGS=} -Wno-long-double -fno-strict-aliasing"
-dnl GCC 4.0 on OSX seems to hate that.
-    ;;
-esac
-
 AC_LANG(C)
 AC_PROG_CC
@@ -69,15 +66,12 @@
 
 dnl check for standard language functionality
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([float.h limits.h stdint.h stdlib.h string.h sys/time.h unistd.h])
-AC_HEADER_STDBOOL
+AC_CHECK_HEADERS([fcntl.h float.h limits.h stdint.h stdlib.h string.h sys/time.h unistd.h])
 AC_C_CONST
 AC_C_INLINE
-AC_TYPE_PID_T
-AC_C_RESTRICT
-AC_TYPE_SIZE_T
+AC_HEADER_STDBOOL
+AC_HEADER_SYS_WAIT
 AC_HEADER_TIME
 AC_STRUCT_TM
+AC_TYPE_SIZE_T
 
 dnl Checks for library functions.
@@ -160,11 +154,32 @@
 [CFITSIO_LDFLAGS="-L$withval"])
 PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${CFITSIO_CFLAGS}"
-PSLIB_LIBS="${PSLIB_LIBS=} $CFITSIO_LDFLAGS -lcfitsio"
+PSLIB_LIBS="${PSLIB_LIBS=} $CFITSIO_LDFLAGS -lcfitsio -lm"
+
+dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
 TMP_CFLAGS=${CFLAGS}
-CFLAGS=${CFITSIO_CFLAGS}
+TMP_LDFLAGS=${LDFLAGS}
+
+CFLAGS=${PSLIB_CFLAGS}
+LDFLAGS=${PSLIB_LIBS}
 AC_CHECK_HEADERS([fitsio.h],[],
-   [AC_MSG_ERROR([CFITSIO is required.  Obtain it at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio or use --with-cfitsio to specify location.])])
+   [AC_MSG_ERROR([CFITSIO headers not found.  Obtain CFITSIO at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio or use --with-cfitsio to specify location.])]
+)
+TMP_LIBS=${LIBS}
+AC_CHECK_LIB(cfitsio,ffopen,[],
+  [AC_MSG_ERROR([CFITSIO library not found.  Obtain it at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio or use --with-cfitsio to specify location.])]
+)
+dnl Now check if CFITSIO supports fits_open_diskfile, i.e., is at least version 2.501
+AC_CHECK_LIB(cfitsio,ffdkopen,
+  [CFITSIO_DISKFILE=1],
+  [AC_MSG_WARN([The CFITSIO library version is rather old.  Suggested version is 2.501 or greater.])
+   CFITSIO_DISKFILE=0]
+)
+LIBS=${TMP_LIBS}
+
+dnl restore the CFLAGS/LDFLAGS
 CFLAGS=${TMP_CFLAGS}
-
+LDFLAGS=${TMP_LDFLAGS}
+
+AC_DEFINE_UNQUOTED([CFITSIO_DISKFILE],${CFITSIO_DISKFILE},[Define to 1 if you have fits_open_diskfile in CFITSIO])
 AC_SUBST([CFITSIO_CFLAGS])
 
@@ -182,9 +197,23 @@
 PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${FFTW3_CFLAGS}"
 PSLIB_LIBS="${PSLIB_LIBS=} $FFTW3_LDFLAGS -lfftw3f"
+
+dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
 TMP_CFLAGS=${CFLAGS}
-CFLAGS=${FFTW3_CFLAGS}
+TMP_LDFLAGS=${LDFLAGS}
+
+CFLAGS="${TMP_CFLAGS} ${PSLIB_CFLAGS}"
+LDFLAGS="${TMP_LDFLAGS} ${PSLIB_LIBS}"
 AC_CHECK_HEADERS([fftw3.h],[],
-   [AC_MSG_ERROR([FFTW version 3 with float support is required.  Obtain it at http://www.fftw.org/or use --with-fftw3 to specify location.])])
+  [AC_MSG_ERROR([FFTW version 3 (--withfloat) headers not found.  Obtain it at http://www.fftw.org/or use --with-fftw3 to specify location.])]
+)
+TMP_LIBS=${LIBS}
+AC_CHECK_LIB(fftw3f,fftwf_plan_dft_2d,[],
+  [AC_MSG_ERROR([FFTW version 3 (--withfloat) library not found.  Obtain it at http://www.fftw.org/or use --with-fftw3 to specify location.])]
+)
+LIBS=${TMP_LIBS}
+
+dnl restore the CFLAGS/LDFLAGS
 CFLAGS=${TMP_CFLAGS}
+LDFLAGS=${TMP_LDFLAGS}
 
 AC_SUBST([FFTW3_CFLAGS])
@@ -197,9 +226,15 @@
 AC_CHECK_FILE($GSL_CONFIG,[],
     [AC_MSG_ERROR([GSL is required.  Obtain it at http://www.gnu.org/software/gsl or use --with-gsl-config to specify location.])])
+
 AC_MSG_CHECKING([GSL cflags])
 GSL_CFLAGS="`${GSL_CONFIG} --cflags`"
 AC_MSG_RESULT([${GSL_CFLAGS}])
+
+AC_MSG_CHECKING([GSL ldflags])
+GSL_LDFLAGS="`${GSL_CONFIG} --libs`"
+AC_MSG_RESULT([${GSL_LDFLAGS}])
+
 PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${GSL_CFLAGS}"
-PSLIB_LIBS="${PSLIB_LIBS=} `${GSL_CONFIG} --libs`"
+PSLIB_LIBS="${PSLIB_LIBS=} ${GSL_LDFLAGS}"
 
 AC_SUBST([GSL_CFLAGS])
@@ -212,9 +247,15 @@
 AC_CHECK_FILE($XML_CONFIG,[],
     [AC_MSG_ERROR([GNOME XML C parser is required.  Obtain it at http://www.xmlsoft.org or use --with-xml2-config to specify location.])])
+
 AC_MSG_CHECKING([xml2 cflags])
 XML_CFLAGS="`${XML_CONFIG} --cflags`"
 AC_MSG_RESULT([${XML_CFLAGS}])
+
+AC_MSG_CHECKING([xml2 ldflags])
+XML_LDFLAGS="`${XML_CONFIG} --libs`"
+AC_MSG_RESULT([${XML_LDFLAGS}])
+
 PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${XML_CFLAGS}"
-PSLIB_LIBS="${PSLIB_LIBS=} `${XML_CONFIG} --libs`"
+PSLIB_LIBS="${PSLIB_LIBS=} ${XML_LDFLAGS}"
 
 AC_SUBST([XML_CFLAGS])
@@ -239,15 +280,4 @@
   SUBDIR="${SUBDIR=} swig"
 
-dnl ------------------- PERL options ---------------------
-  AC_ARG_WITH(perl,
-    [AS_HELP_STRING(--with-perl=FILE,Specify location of PERL executable.)],
-    [AC_CHECK_PROG(PERL, $withval, $withval)],
-    [AC_CHECK_PROG(PERL, perl, `which perl`)])
-    if test "$PERL" == ""
-    then
-      AC_MSG_ERROR([PERL is required.  Use --with-perl to specify its install location.])
-    fi
-    AC_SUBST(PERL,$PERL)
-
 dnl ---------------- PERLPREFIX option -------------------
   AC_ARG_WITH(perlprefix,
@@ -262,15 +292,20 @@
 fi
 
-dnl for MacOSX, check if sqrtf is in mx library.
+dnl for MacOSX suppport -- check if sqrtf is in mx library.
+TMP_LIBS=${LIBS}
 AC_CHECK_LIB(mx,sqrtf,
   [PSLIB_LIBS="${PSLIB_LIBS=} -lmx"])
+LIBS=${TMP_LIBS}
 AC_CHECK_FUNC(atoll, [],
-  [AC_MSG_ERROR([The C99 function, atoll, is required; update your compiler?])])
-
-DOXYGEN="doxygen Doxyfile"
-AC_CHECK_PROG(DOXYGEN,doxygen,[echo Doxygen not detected in configure stage.])
-AC_SUBST(DOXYGEN,$DOXYGEN)
-
-CFLAGS="${CFLAGS=} -Wall -Werror"
+  [AC_MSG_ERROR([The C99 function, atoll, is required; update your compiler version?])])
+
+AC_CHECK_PROG(doxygen,[doxygen],[true],[false])
+AM_CONDITIONAL(DOXYGEN, test x$doxygen = xtrue)
+
+
+dnl ------- restore CFLAGS / LDFLAGS (tests done) --------
+CFLAGS="${CFLAGS} -Wall -Werror"
+AC_MSG_RESULT([CFLAGS is ${CFLAGS}])
+AC_MSG_RESULT([LDFLAGS is ${LDFLAGS}])
 
 dnl ---------------- export variables --------------------
Index: /trunk/psLib/etc/pslib/Makefile.am
===================================================================
--- /trunk/psLib/etc/pslib/Makefile.am	(revision 5511)
+++ /trunk/psLib/etc/pslib/Makefile.am	(revision 5512)
@@ -8,5 +8,5 @@
 
 pslib.config: pslib.config.template
-	sed 's|PREFIX|$(prefix)|' $? > $@
+	$(PERL) -pe 's|PREFIX|$(prefix)|' $? > $@
 
 $(sysconfdir)/pslib:
Index: /trunk/psLib/src/Makefile.am
===================================================================
--- /trunk/psLib/src/Makefile.am	(revision 5511)
+++ /trunk/psLib/src/Makefile.am	(revision 5512)
@@ -25,4 +25,4 @@
 
 install-exec-hook: libpslib.la
-	sed "s|\(^dependency_libs=.*\)|dependency_libs=\'$(PSLIB_LIBS)\'|" $(libdir)/libpslib.la > libpslib.la.temp
+	$(PERL) -pe "s|(^dependency_libs=.*)|dependency_libs=\'$(PSLIB_LIBS)\'|" $(libdir)/libpslib.la > libpslib.la.temp
 	$(INSTALL) libpslib.la.temp $(libdir)/libpslib.la
Index: /trunk/psLib/src/psErrorText_en.dat
===================================================================
--- /trunk/psLib/src/psErrorText_en.dat	(revision 5511)
+++ /trunk/psLib/src/psErrorText_en.dat	(revision 5512)
@@ -127,10 +127,10 @@
 psFits_FILENAME_NULL                   Specified filename can not be NULL.
 psFits_EXTNAME_NULL                    Specified extension name can not be NULL.
-psFits_EXTNAME_INVALID                 Could not find HDU '%s' in file %s.\nCFITSIO Error: %s
-psFits_EXTNUM_ABS_MOVE_FAILED          Could not move to specified HDU #%d in file %s.\nCFITSIO Error: %s
-psFits_EXTNUM_REL_MOVE_FAILED          Could not move %d HDUs from current position in file %s.\nCFITSIO Error: %s
+psFits_EXTNAME_INVALID                 Could not find HDU '%s'.\nCFITSIO Error: %s
+psFits_EXTNUM_ABS_MOVE_FAILED          Could not move to specified HDU #%d.\nCFITSIO Error: %s
+psFits_EXTNUM_REL_MOVE_FAILED          Could not move %d HDUs from current position.\nCFITSIO Error: %s
 psFits_GET_EXTNUM_FAILED               Failed to determine the current HDU number in file %s.\nCFITSIO Error: %s
-psFits_GETNUMHDUS_FAILED               Failed to determine the number of HDUs in file %s.\nCFITSIO Error: %s
-psFits_GETHDUTYPE_FAILED               Failed to determine an HDU type in file %s.\nCFITSIO Error: %s
+psFits_GETNUMHDUS_FAILED               Failed to determine the number of HDUs.\nCFITSIO Error: %s
+psFits_GETHDUTYPE_FAILED               Failed to determine an HDU type.\nCFITSIO Error: %s
 psFits_GETNUMKEYS_FAILED               Failed to determine the number of header keys in file %s.\nCFITSIO Error: %s
 psFits_GET_TABLE_SIZE_FAILED           Failed to determine the size of the current HDU table.\nCFITSIO Error: %s
@@ -145,5 +145,5 @@
 psFits_METATYPE_INVALID                Specified FITS metadata type, %c, is not supported.
 psFits_METADATA_ADD_FAILED             Failed to add metadata item, %s.
-psFits_WRITE_FAILED                    Could not write data to file,'%s'.\nCFITSIO Error: %s
+psFits_WRITE_FAILED                    Could not write data to file.\nCFITSIO Error: %s
 psFits_IMAGE_NULL                      The input psImage was NULL.  Need a non-NULL psImage for operation to be performed.
 psFits_METADATA_NULL                   The input psMetadata was NULL.  Need a non-NULL psMetadata for operation to be performed.
Index: /trunk/psLib/src/pslib_strict.h
===================================================================
--- /trunk/psLib/src/pslib_strict.h	(revision 5511)
+++ /trunk/psLib/src/pslib_strict.h	(revision 5512)
@@ -9,6 +9,6 @@
 *  @author Eric Van Alst, MHPCC
 *
-*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-10-26 01:20:14 $
+*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-11-14 22:18:05 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -48,4 +48,7 @@
 /// @{
 #include "psFits.h"
+#include "psFitsHeader.h"
+#include "psFitsImage.h"
+#include "psFitsTable.h"
 /// @}
 
Index: /trunk/psLib/test/fits/verified/tst_psFits.stderr
===================================================================
--- /trunk/psLib/test/fits/verified/tst_psFits.stderr	(revision 5511)
+++ /trunk/psLib/test/fits/verified/tst_psFits.stderr	(revision 5512)
@@ -1,14 +1,18 @@
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsAlloc}                                       *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|tst_psFitsAlloc
+*            TestPoint: psImage{psFitsOpen}                                        *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<DATE><TIME>|<HOST>|I|tst_psFitsOpen
     Following should generate an error message
-<DATE><TIME>|<HOST>|E|psFitsAlloc (FILE:LINENO)
+<DATE><TIME>|<HOST>|E|psFitsOpen (FILE:LINENO)
     Specified filename can not be NULL.
-
----> TESTPOINT PASSED (psImage{psFitsAlloc} | tst_psFits.c)
+<DATE><TIME>|<HOST>|I|tst_psFitsOpen
+    Following should generate an error message
+<DATE><TIME>|<HOST>|E|psFitsOpen (FILE:LINENO)
+    Specified mode, 'b+', is invalid.  Supported modes are r, r+, rw, w, w+, a, or a+.
+
+---> TESTPOINT PASSED (psImage{psFitsOpen} | tst_psFits.c)
 
 /***************************** TESTPOINT ******************************************\
@@ -21,5 +25,5 @@
     Following should be an error.
 <DATE><TIME>|<HOST>|E|psFitsMoveExtName (FILE:LINENO)
-    Could not find HDU 'bogus' in file multi.fits.
+    Could not find HDU 'bogus'.
     CFITSIO Error: illegal HDU number
 <DATE><TIME>|<HOST>|I|tst_psFitsMoveExtName
@@ -51,20 +55,20 @@
     Following should be an error.
 <DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    Could not move to specified HDU #-1 in file multi.fits.
+    Could not move to specified HDU #-1.
     CFITSIO Error: illegal HDU number
 <DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
     Following should be an error.
 <DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    Could not move -1 HDUs from current position in file multi.fits.
+    Could not move -1 HDUs from current position.
     CFITSIO Error: illegal HDU number
 <DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
     Following should be an error.
 <DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    Could not move to specified HDU #8 in file multi.fits.
+    Could not move to specified HDU #8.
     CFITSIO Error: tried to move past end of file
 <DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
     Following should be an error.
 <DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    Could not move 1 HDUs from current position in file multi.fits.
+    Could not move 1 HDUs from current position.
     CFITSIO Error: tried to move past end of file
 <DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
@@ -171,5 +175,5 @@
     Following should be an error.
 <DATE><TIME>|<HOST>|E|psFitsUpdateTable (FILE:LINENO)
-    Could not write data to file,'table.fits'.
+    Could not write data to file.
     CFITSIO Error: bad first row number
 
Index: /trunk/psLib/test/imageops/tst_psImageGeomManip.c
===================================================================
--- /trunk/psLib/test/imageops/tst_psImageGeomManip.c	(revision 5511)
+++ /trunk/psLib/test/imageops/tst_psImageGeomManip.c	(revision 5512)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-10-13 00:38:53 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-14 22:18:46 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -537,20 +537,12 @@
     // write results of various rotates to a file and verify with truth images
     mkdir("temp",0777);
-    remove
-        ("fOut.fits");
-    remove
-        ("sOut.fits");
-    remove
-        ("fBiOut.fits");
-    remove
-        ("sBiOut.fits");
     psS32 index = 0;
     psBool fail = false;
     psF32 radianRot;
 
-    psFits* fOutFile = psFitsAlloc("fOut.fits");
-    psFits* sOutFile = psFitsAlloc("sOut.fits");
-    psFits* fBiOutFile = psFitsAlloc("fBiOut.fits");
-    psFits* sBiOutFile = psFitsAlloc("sBiOut.fits");
+    psFits* fOutFile = psFitsOpen("fOut.fits","w");
+    psFits* sOutFile = psFitsOpen("sOut.fits","w");
+    psFits* fBiOutFile = psFitsOpen("fBiOut.fits","w");
+    psFits* sBiOutFile = psFitsOpen("sBiOut.fits","w");
     if (fOutFile == NULL ||sOutFile == NULL || fBiOutFile == NULL || sBiOutFile == NULL) {
         psError(PS_ERR_UNKNOWN, true, "Can not create output files, so why continue!?");
@@ -558,8 +550,8 @@
     }
 
-    psFits* fTruthFile = psFitsAlloc(VERIFIED_DIR "/fOut.fits");
-    psFits* sTruthFile = psFitsAlloc(VERIFIED_DIR "/sOut.fits");
-    psFits* fBiTruthFile = psFitsAlloc(VERIFIED_DIR "/fBiOut.fits");
-    psFits* sBiTruthFile = psFitsAlloc(VERIFIED_DIR "/sBiOut.fits");
+    psFits* fTruthFile = psFitsOpen(VERIFIED_DIR "/fOut.fits","r");
+    psFits* sTruthFile = psFitsOpen(VERIFIED_DIR "/sOut.fits","r");
+    psFits* fBiTruthFile = psFitsOpen(VERIFIED_DIR "/fBiOut.fits","r");
+    psFits* sBiTruthFile = psFitsOpen(VERIFIED_DIR "/sBiOut.fits","r");
     if (fTruthFile == NULL ||sTruthFile == NULL || fBiTruthFile == NULL || sBiTruthFile == NULL) {
         psError(PS_ERR_UNKNOWN, true, "Can not open truth files, so why continue!?");
Index: /trunk/psLib/test/sys/table.fits
===================================================================
--- /trunk/psLib/test/sys/table.fits	(revision 5511)
+++ /trunk/psLib/test/sys/table.fits	(revision 5512)
@@ -1,9 +1,1 @@
-SIMPLE  =                    T / file does conform to FITS standard             BITPIX  =                  -32 / number of bits per data pixel                  NAXIS   =                    2 / number of data axes                            NAXIS1  =                   16 / length of data axis 1                          NAXIS2  =                   16 / length of data axis 2                          EXTEND  =                    T / FITS dataset may contain extensions            COMMENT   FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / 8-bit bytes                                    NAXIS   =                    2 / 2-dimensional binary table                     NAXIS1  =                   17 / width of table in bytes                        NAXIS2  =                   11 / number of rows in table                        PCOUNT  =                    0 / size of special data area                      GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                    4 / number of fields in each row                   TTYPE1  = 'MYINT   '           / label for field   1                            TFORM1  = '1J      '           / data format of field: 4-byte INTEGER           TTYPE2  = 'MYFLT   '           / label for field   2                            TFORM2  = '1E      '           / data format of field: 4-byte REAL              TTYPE3  = 'MYDBL   '           / label for field   3                            TFORM3  = '1D      '           / data format of field: 8-byte DOUBLE            TTYPE4  = 'MYBOOL  '           / label for field   4                            TFORM4  = '1L      '           / data format of field: 1-byte LOGICAL           END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           TÿÿÿÿœÌÌÍ¿záG®{FÿÿÿþŸLÌÍ¿záG®{TÿÿÿýŸ¿žQë
-
-žFÿÿÿüŸÌÌÍ¿€záG®{Tÿÿÿû¿   ¿©Fÿÿÿú¿¿®žQë
-
-žTÿÿÿù¿333¿±ë
-
-žQìFÿÿÿø¿LÌÍ¿ŽzáG®{Tÿÿÿ÷¿fff¿·
-=p£×
-Fÿÿÿö¿  ¿¹                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
+END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
Index: /trunk/psLib/test/sys/tst_psMemory.c
===================================================================
--- /trunk/psLib/test/sys/tst_psMemory.c	(revision 5511)
+++ /trunk/psLib/test/sys/tst_psMemory.c	(revision 5512)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-09-22 22:51:46 $
+*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-11-14 22:18:48 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -581,6 +581,8 @@
 
     psFits *fits;
-    char *filename = "table.fits";
-    fits = psFitsAlloc(filename);
+    fits = psFitsOpen("test.fits","w");
+    psImage* img = psImageAlloc(16,16,PS_TYPE_F32);
+    psFitsWriteImage(fits,NULL,img,1);
+    psFree(img);
     if ( !psMemCheckType(PS_DATA_FITS, fits) ) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckFits failed in memCheckType. \n");
@@ -588,5 +590,5 @@
         return 1;
     }
-    psFree(fits);
+    psFitsClose(fits);
 
     psHash *hash;
