From 9024993dfd44291dfb83e10f9492f0dac5ef7eff Mon Sep 17 00:00:00 2001
From: Tony Farrell <tony.farrell@mq.edu.au>
Date: Mon, 15 Nov 2004 14:00:46 +1100
Subject: [PATCH] CFITSIO with version tag 2500        Version marked with 2500
 - archived as 25.0

---
 Licence.txt          |    24 +-
 Makefile.in          |    68 +-
 README               |    41 +-
 README.MacOS         |     6 +-
 README.txt           |    20 +-
 README.win32         |    50 +
 Readme.win32         |    15 -
 buffers.c            |   158 +-
 cfileio.c            |  1727 +++-
 cfitsio.doc          | 12094 ++++++++++++-----------
 cfitsio.ps           | 21664 ++++++++++++++++++++++-------------------
 cfitsio.tex          | 12974 ++++++++++++------------
 cfitsio.toc          |   215 +-
 cfitsiohtml.tar.gz   |   Bin 144428 -> 0 bytes
 cfortran.doc         |    58 +-
 cfortran.h           |   585 +-
 changes.txt          |  1084 ++-
 checksum.c           |     3 +
 compress.c           |    88 +-
 compress_alternate.c |   155 +
 compress_fits.c      |   160 -
 configure            |   327 +-
 configure.in         |   138 +-
 drvrfile.c           |   167 +-
 drvrmem.c            |   373 +-
 drvrnet.c            |   384 +-
 drvrsmem.c           |    19 +
 drvrsmem.h           |     1 +
 editcol.c            |   422 +-
 edithdu.c            |   168 +-
 eval.y               |   782 +-
 eval_defs.h          |     6 +-
 eval_f.c             |    77 +-
 eval_tab.h           |    58 +-
 eval_y.c             |  2174 +++--
 f77_wrap.h           |    16 +-
 f77_wrap1.c          |   768 +-
 f77_wrap2.c          |   546 +-
 f77_wrap3.c          |   758 ++
 f77_wrap4.c          |   570 ++
 fitscopy.c           |    85 +-
 fitscore.c           |  1196 ++-
 fitsio.doc           |  1591 +--
 fitsio.h             |   237 +-
 fitsio.ps            | 11389 ++++++++++++----------
 fitsio.tex           |  2065 ++--
 fitsio.toc           |   155 +-
 fitsio2.h            |   299 +-
 fitsiohtml.tar.gz    |   Bin 112610 -> 0 bytes
 getcol.c             |   213 +-
 getcolb.c            |   316 +-
 getcold.c            |   215 +-
 getcole.c            |   218 +-
 getcoli.c            |   303 +-
 getcolj.c            |  2133 ++++
 getcolk.c            |   300 +
 getcoll.c            |    30 +-
 getcols.c            |   103 +-
 getcolsb.c           |  2133 ++++
 getcolui.c           |   300 +
 getcoluj.c           |   300 +
 getcoluk.c           |   300 +
 getkey.c             |   115 +-
 group.c              |   488 +-
 grparser.c           |    78 +-
 grparser.h           |     6 +-
 histo.c              |    18 +-
 imcompress.c         |  1373 ++-
 imcompress.h         |    56 -
 imcopy.c             |   188 +
 iraffits.c           |   656 +-
 iter_a.fit           |     2 +-
 iter_b.fit           |   Bin 408960 -> 408960 bytes
 listhead.c           |   103 +-
 longnam.h            |    56 +-
 make_dfloat.com      |    11 +-
 make_gfloat.com      |    11 +-
 make_ieee.com        |    11 +-
 makefile.bc          |    27 +
 makefile.vcc         |    57 +-
 makepc.bat           |     6 +-
 modkey.c             |    14 +-
 pctype.h             |   155 -
 pliocomp.c           |   129 +-
 putcol.c             |   492 +-
 putcolb.c            |   169 +-
 putcold.c            |   220 +-
 putcole.c            |   222 +-
 putcoli.c            |   175 +-
 putcolj.c            |  1138 ++-
 putcolk.c            |   174 +-
 putcoll.c            |     5 +-
 putcols.c            |     2 +-
 putcolsb.c           |  1030 ++
 putcolu.c            |   327 +-
 putcolui.c           |   169 +-
 putcoluj.c           |   169 +-
 putcoluk.c           |   169 +-
 putkey.c             |   111 +-
 quick.ps             |  3850 ++++++++
 quick.tex            |  2156 ++++
 quick.toc            |    25 +
 region.c             |   226 +-
 ricecomp.c           |    10 +
 scalnull.c           |    11 +
 smem.c               |    16 +-
 speed.c              |    14 +-
 testf77.f            |    20 +-
 testf77.out          |     6 +-
 testf77.std          |   Bin 66240 -> 66240 bytes
 testprog.c           |    12 +-
 testprog.out         |     4 +-
 testprog.std         |    13 +-
 uncompress_fits.c    |    71 -
 wcsutil.c            |    94 +-
 winDumpExts.mak      |   191 +
 windumpexts.c        |   502 +
 117 files changed, 64319 insertions(+), 33858 deletions(-)
 create mode 100644 README.win32
 delete mode 100644 Readme.win32
 delete mode 100644 cfitsiohtml.tar.gz
 create mode 100644 compress_alternate.c
 delete mode 100644 compress_fits.c
 create mode 100644 f77_wrap3.c
 create mode 100644 f77_wrap4.c
 delete mode 100644 fitsiohtml.tar.gz
 create mode 100644 getcolsb.c
 delete mode 100644 imcompress.h
 create mode 100644 imcopy.c
 delete mode 100644 pctype.h
 create mode 100644 putcolsb.c
 create mode 100644 quick.ps
 create mode 100644 quick.tex
 create mode 100644 quick.toc
 delete mode 100644 uncompress_fits.c
 create mode 100644 winDumpExts.mak
 create mode 100644 windumpexts.c

diff --git a/Licence.txt b/Licence.txt
index cd81b89..f769809 100644
--- a/Licence.txt
+++ b/Licence.txt
@@ -6,6 +6,8 @@ claimed in the United States under Title 17, U.S. Code.
 Permission to freely use, copy, modify, and distribute this software
 and its documentation without fee is hereby granted, provided that this
 copyright notice and disclaimer of warranty appears in all copies.
+(However, see the restriction on the use of the gzip compression code,
+below).
 
 DISCLAIMER:
 
@@ -22,9 +24,23 @@ CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
 CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY
 PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED
 FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
-SERVICES PROVIDED HEREUNDER."
+SERVICES PROVIDED HEREUNDER.
 
 The file compress.c contains (slightly modified) source code that
-originally came from gzip-1.2.4 which is freely distributed under the
-GNU General Public Licence.  A copy of the GNU licence is included
-at the beginning of that file.
+originally came from gzip-1.2.4, copyright (C) 1992-1993 by Jean-loup
+Gailly.  This gzip code is distributed under the GNU General Public
+Licence and thus requires that any software that uses the CFITSIO
+library (which in turn uses the gzip code) must conform to the
+provisions in the GNU General Public License.  A copy of the GNU
+licence is included at the beginning of compress.c file.
+
+An alternate version of the compress.c file (called compress_alternate.c)
+is provided for users who want to use the CFITSIO library but are
+unwilling or unable to publicly release their software under the terms
+of the GNU General Public License.   This alternate version contains
+non-functional stubs for the file compression and uncompression
+routines used by CFITSIO.  Replace the file 'compress.c' with
+'compress_alternate.c' before compiling the CFITSIO library.  This will
+produce a version of CFITSIO which does not support reading or writing
+compressed FITS files but is otherwise identical to the standard
+version.
diff --git a/Makefile.in b/Makefile.in
index ccafead..72ce590 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -8,17 +8,19 @@
 #       NASA GSFC
 #       Oct 1996
 #
+# 25-Jan-01 : removed conditional drvrsmem.c compilation because this
+#             is now handled within the source file itself.
 # 09-Mar-98 : modified to conditionally compile drvrsmem.c. Also
 # changes to target all (deleted clean), added DEFS, LIBS, added
 # DEFS to .c.o, added SOURCES_SHMEM and MY_SHMEM, expanded getcol*
 # and putcol* in SOURCES, modified OBJECTS, mv changed to /bin/mv
 # (to bypass aliasing), cp changed to /bin/cp, add smem and
 # testprog targets. See also changes and comments in configure.in
-# If for any reason shared memory driver cannot be compiled
-# set MY_SHMEM variable to empty string and remove HAVE_SHMEM_SERVICES
-# from DEFS, then recompile library.
 #
 
+CFITSIO_LIB =	@CFITSIO_PREFIX@/lib
+CFITSIO_INCLUDE =	@CFITSIO_PREFIX@/include
+
 SHELL =		/bin/sh
 RANLIB =	@RANLIB@
 CC =		@CC@
@@ -30,34 +32,33 @@ LIBS =		@LIBS@
 FLEX =		flex
 BISON =		bison
 
+SHLIB_LD =	@SHLIB_LD@
+SHLIB_SUFFIX =	@SHLIB_SUFFIX@
+
 .c.o:
 		$(CC) -c $(CFLAGS) $(DEFS) $<
 
 
-SOURCES_SHMEM =	drvrsmem.c
-MY_SHMEM =	@my_shmem@
-
 CORE_SOURCES = 	buffers.c cfileio.c checksum.c compress.c drvrfile.c drvrmem.c \
-		drvrnet.c  editcol.c edithdu.c eval_l.c eval_y.c eval_f.c \
-		fitscore.c getcol.c getcolb.c getcold.c getcole.c \
-		getcoli.c getcolj.c getcolk.c getcoll.c getcols.c getcoluk.c \
-		getcolui.c getcoluj.c getkey.c group.c grparser.c histo.c \
-		iraffits.c \
+		drvrnet.c drvrsmem.c editcol.c edithdu.c eval_l.c eval_y.c \
+		eval_f.c fitscore.c getcol.c getcolb.c getcold.c getcole.c \
+		getcoli.c getcolj.c getcolk.c getcoll.c getcols.c getcolsb.c \
+		getcoluk.c getcolui.c getcoluj.c getkey.c group.c grparser.c \
+		histo.c iraffits.c \
 		modkey.c putcol.c putcolb.c putcold.c putcole.c putcoli.c \
-		putcolj.c putcolk.c putcoluk.c putcoll.c putcols.c putcolu.c \
-		putcolui.c putcoluj.c putkey.c region.c scalnull.c swapproc.c \
-		wcsutil.c imcompress.c quantize.c ricecomp.c pliocomp.c \
-		${MY_SHMEM} 
-
-SOURCES = ${CORE_SOURCES} wcssub.c ${FITSIO_SRC}
+		putcolj.c putcolk.c putcoluk.c putcoll.c putcols.c putcolsb.c \
+		putcolu.c putcolui.c putcoluj.c putkey.c region.c scalnull.c \
+		swapproc.c wcssub.c wcsutil.c imcompress.c quantize.c ricecomp.c \
+		pliocomp.c
 
+SOURCES = ${CORE_SOURCES} @F77_WRAPPERS@
 
 OBJECTS = 	${SOURCES:.c=.o}
 
 CORE_OBJECTS = 	${CORE_SOURCES:.c=.o}
 
 
-FITSIO_SRC =	f77_wrap1.c f77_wrap2.c
+FITSIO_SRC =	f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c
 
 # ============ description of all targets =============
 #       -  <<-- ignore error code
@@ -78,9 +79,19 @@ libcfitsio.a:	${OBJECTS}
 		ar rv libcfitsio.a ${OBJECTS}; \
 		${RANLIB} libcfitsio.a;
 
-install:	libcfitsio.a
-		/bin/mv libcfitsio.a ${FTOOLS_LIB}
-		/bin/cp *.h ${FTOOLS_INCLUDE}/
+shared: libcfitsio${SHLIB_SUFFIX}
+
+libcfitsio${SHLIB_SUFFIX}: ${OBJECTS}
+		${SHLIB_LD} -o $@ ${OBJECTS}
+
+install:	libcfitsio.a ${CFITSIO_LIB} ${CFITSIO_INCLUDE}
+		@if [ -f libcfitsio.a ]; then \
+			/bin/mv libcfitsio.a ${CFITSIO_LIB}; \
+		fi; \
+		if [ -f libcfitsio${SHLIB_SUFFIX} ]; then \
+			/bin/mv libcfitsio${SHLIB_SUFFIX} ${CFITSIO_LIB}; \
+		fi; \
+		/bin/cp fitsio.h fitsio2.h longnam.h drvrsmem.h ${CFITSIO_INCLUDE}/
 
 smem:		smem.o libcfitsio.a ${OBJECTS}
 		${CC} $(CFLAGS) $(DEFS) -o smem smem.o -L. -lcfitsio -lm
@@ -94,18 +105,15 @@ fitscopy:	fitscopy.o libcfitsio.a ${OBJECTS}
 speed:		speed.o libcfitsio.a ${OBJECTS}
 		${CC} $(CFLAGS) $(DEFS) -o speed speed.o -L. -lcfitsio -lm ${LIBS}
 
+imcopy:		imcopy.o libcfitsio.a ${OBJECTS}
+		${CC} $(CFLAGS) $(DEFS) -o imcopy imcopy.o -L. -lcfitsio -lm ${LIBS}
+
 listhead:	listhead.o libcfitsio.a ${OBJECTS}
 		${CC} $(CFLAGS) $(DEFS) -o listhead listhead.o -L. -lcfitsio -lm ${LIBS}
 
 cookbook:	cookbook.o libcfitsio.a ${OBJECTS}
 		${CC} $(CFLAGS) $(DEFS) -o cookbook cookbook.o -L. -lcfitsio -lm ${LIBS}
 
-compress_fits:	compress_fits.o libcfitsio.a ${OBJECTS}
-		${CC} $(CFLAGS) $(DEFS) -o compress_fits compress_fits.o -L. -lcfitsio -lm ${LIBS}
-
-uncompress_fits:	uncompress_fits.o libcfitsio.a ${OBJECTS}
-		${CC} $(CFLAGS) $(DEFS) -o uncompress_fits uncompress_fits.o -L. -lcfitsio -lm ${LIBS}
-
 eval:		# Rebuild eval_* files from flex/bison source
 		$(FLEX) -t eval.l > eval_l.c1
 		/bin/sed -e 's/yy/ff/g' -e 's/YY/FF/g' eval_l.c1 > eval_l.c
@@ -116,7 +124,8 @@ eval:		# Rebuild eval_* files from flex/bison source
 		/bin/rm -f y.tab.c y.tab.h
 
 clean:
-	-	/bin/rm -f *.o libcfitsio.a smem testprog y.output
+	-	/bin/rm -f *.o libcfitsio.a libcfitsio${SHLIB_SUFFIX} \
+			smem testprog y.output
 
 distclean:	clean
 	-	/bin/rm -f Makefile config.*
@@ -131,3 +140,6 @@ cfitsioLibObjs:
 # This target actually builds the objects needed for the lib in the above
 # case
 objs: ${CORE_OBJECTS}
+
+${CFITSIO_LIB} ${CFITSIO_INCLUDE}:
+	@if [ ! -d $@ ]; then mkdir $@; fi
diff --git a/README b/README
index 1ba241f..bcd3123 100644
--- a/README
+++ b/README
@@ -14,12 +14,25 @@ BUILDING CFITSIO
 The CFITSIO code is contained in about 40 *.c source files and several *.h
 header files.  The CFITSIO library is built on Unix systems by typing:
 
->  ./configure
->  make
-
-at the operating system prompt.  The 'configure' command customizes
-the Makefile for your particular system, then the 'make' command
-builds the library.
+ >  ./configure [--prefix=/target/installation/path]
+ >  make          (or  'make shared')
+ >  make install  (this step is optional)
+
+at the operating system prompt.  The configure command customizes the
+Makefile for the particular system, then the `make' command compiles the
+source files and builds the library.  Type `./configure' and not simply
+`configure' to ensure that the configure script in the current directory
+is run and not some other system-wide configure script.  The optional
+'prefix' argument to configure gives the path to the directory where
+the CFITSIO library and include files should be installed via the later
+'make install' command. For example,
+
+   > ./configure --prefix=/usr1/local
+
+will cause the 'make install' command to copy the CFITSIO libcfitsio file 
+to /usr1/local/lib and the necessary include files to /usr1/local/include
+(assuming of course that the  process has permission to write to these 
+directories).
 
 On VAX/VMS and ALPHA/VMS systems the make.com command file may be used
 to build the cfitsio.olb object library using the default G-floating
@@ -44,11 +57,12 @@ containing OS/2 software, such as
 ftp-os2.nmsu.edu/pub/os2/dev/emx/v0.9c and
 ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc.
 
-The MacOS version of the cfitsio library can be built by (1) un binhex
-and unstuff cfitsio_mac.sit.hqx, (2) put CFitsioPPC.mcp in the cfitsio
-directory, and (3) load CFitsioPPC.mcp into CodeWarrior Pro 5 and
-make.  This builds the cfitsio library for PPC.  There are also targets
-for both the test program and the speed test program.
+When building on Mac OS-X, users should follow the Unix instructions,
+above. Previous MacOS versions of the cfitsio library can be built by
+(1) un binhex and unstuff cfitsio_mac.sit.hqx, (2) put CFitsioPPC.mcp
+in the cfitsio directory, and (3) load CFitsioPPC.mcp into CodeWarrior
+Pro 5 and make.  This builds the cfitsio library for PPC.  There are
+also targets for both the test program and the speed test program.
 
 To use the MacOS port you can add Cfitsio PPC.lib to your Codewarrior
 Pro 5 project.  Note that this only has been tested for the PPC and
@@ -117,10 +131,11 @@ CFITSIO has currently been tested on the following platforms:
    Linux                      gcc
    MkLinux                    DR3
    Windows 95/98/NT           Borland C++ V4.5
-   Windows 95/98/NT           Microsoft/Compaq Visual C++ v5.0, v6.0
+   Windows 95/98/NT/ME/XP     Microsoft/Compaq Visual C++ v5.0, v6.0
    Windows 95/98/NT           Cygwin gcc
    OS/2                       gcc + EMX
-   MacOS 7.1 or greater       Metrowerks 10.+
+   Mac OS 7.1 or greater      Metrowerks 10.+
+   Mac OS-X 10.1 or greater   cc (gcc)
 
 CFITSIO will probably run on most other Unix platforms without
 modification.  Cray supercomputers and IBM mainframe computers are
diff --git a/README.MacOS b/README.MacOS
index 01124fc..6deedcf 100644
--- a/README.MacOS
+++ b/README.MacOS
@@ -1,4 +1,8 @@
-To build the MacOS port:
+To build the CFITSIO library on Mac OS-X systems, follow the
+instructions for Unix platforms given in the CFITSIO User's Reference
+Guide (cfitsio.doc).
+
+To build the MacOS port on classic Mac OS-9 or earlier:
 
 1. Un binhex and unstuff cfitsio_mac.sit.hqx
 2. put CFitsioPPC.mcp in the cfitsio directory.
diff --git a/README.txt b/README.txt
index 950050e..e87a059 100644
--- a/README.txt
+++ b/README.txt
@@ -1,6 +1,24 @@
 # "@(#) $Id$"
 
-William D. Pence's C FITSIO Library.  See README file for details.
+William D. Pence's C FITSIO Library.  See README file for details.  Web
+page is http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html
+
+This module is used to maintain copies of the cfitsio library as used
+by the AAO.  Normally the major version number is constructed from
+the cfitsio version number and sub-version  numbers used for patch levels
+or AAO modifcations.  E.g.
+
+
+        File marked with version 2500 -> ACMM Version 25.0
+
+(This was only started from version 2500).
+
+The normal update procedure for ACMM is modify the ACMM module and then
+rename it (to say "cfitsio.orig).  Then unpack the new version, copy across
+the .mid, ChangeLog README.txt files from the original ACMM directory to 
+the new cfitsio directory.  Then archive the result specifing an appropiate 
+version number.
+
 
 This software has made use of the ESO cmm system (known internally
 at AAO as "acmm").  
diff --git a/README.win32 b/README.win32
new file mode 100644
index 0000000..cbc5697
--- /dev/null
+++ b/README.win32
@@ -0,0 +1,50 @@
+To build the CFITSIO dll library using Visual C++:
+
+	Execute the vcvars32.bat file that is distributed with Visual C++
+
+	Unpack the CFITSIO source files (cfit2xxx.zip) into temporary directory
+
+	In a dos command window, cd to that directory and enter the 
+        following commands:
+
+		nmake winDumpExts.mak
+		nmake makefile.vcc
+			(ignore the compiler warning messages)
+
+	This creates the cfitsio.def, cfitsio.dll, and cfitsio.lib files.  The
+	fitsio.h and longnam.h files are also needed to compile any programs
+	that use CFITSIO.
+
+	To test that the library works correctly, enter:
+		cl /MD testprog.c cfitsio.lib
+		testprog.exe
+
+	The testprog program prints out a long list of diagnostic messages
+	that should end with "Status = 0; OK - no error"
+
+
+To build a program using the CFITSIO dll:
+
+	Include the header files fitsio.h and longnam.h in your source code
+
+	Link your program using the .lib file
+
+
+To build the test program using Microsoft Visual C++:
+
+	cl /MD testprog.c cfitsio.lib
+
+To build the test program using Borland C:
+
+	bcc32 -f testprog.c cfitsio.lib
+
+NOTE: The /MD command line switch must be specified on the cl command line
+to force the compiler/linker to use the appropriete runtime library.  
+If this switch is omitted, then the fits_report_error function in CFITSIO
+will likely crash.  
+
+When building programs in the Visual Studio environment, one can force
+the equivalent of the /MD switch by selecting 'Settings...' under the
+'Project' menu, then click on the C/C++ tab and select the 'Code
+Generator' category.  Then under 'User Run-time Library' select
+'Multithreaded DLL'.
diff --git a/Readme.win32 b/Readme.win32
deleted file mode 100644
index 1ed4f89..0000000
--- a/Readme.win32
+++ /dev/null
@@ -1,15 +0,0 @@
-To build a program using the CFITSIO dll:
-
-	Include the header files fitsio.h and longnam.h in your source code
-
-	Link your program using the .lib file
-
-
-
-To build the test program using Microsoft Visual C++:
-
-	cl testprog.c cfitsio.lib
-
-To build the test program using Borland C:
-
-      bcc32 -f testprog.c cfitsio.lib
diff --git a/buffers.c b/buffers.c
index d571633..914f674 100644
--- a/buffers.c
+++ b/buffers.c
@@ -40,7 +40,8 @@ int ffmbyt(fitsfile *fptr,    /* I - FITS file pointer                */
     record = bytepos / IOBUFLEN;  /* zero-indexed record number */
 
     /* if this is not the current record, then load it */
-    if (record != bufrecnum[(fptr->Fptr)->curbuf]) 
+    if ( ((fptr->Fptr)->curbuf < 0) || 
+         (record != bufrecnum[(fptr->Fptr)->curbuf])) 
         ffldrc(fptr, record, err_mode, status);
 
     if (*status <= 0)
@@ -74,6 +75,11 @@ int ffpbyt(fitsfile *fptr,   /* I - FITS file pointer                    */
     cptr = (char *)buffer;
     ntodo =  nbytes;
 
+    if ((fptr->Fptr)->curbuf < 0)  /* no current data buffer for this file */
+    {                              /* so reload the last one that was used */
+      ffldrc(fptr, ((fptr->Fptr)->bytepos) / IOBUFLEN, REPORT_EOF, status);
+    }
+
     if (nbytes >= MINDIRECT)
     {
       /* write large blocks of data directly to disk instead of via buffers */
@@ -198,6 +204,11 @@ int ffpbytoff(fitsfile *fptr, /* I - FITS file pointer                   */
     if (fptr->HDUposition != (fptr->Fptr)->curhdu)
         ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
 
+    if ((fptr->Fptr)->curbuf < 0)  /* no current data buffer for this file */
+    {                              /* so reload the last one that was used */
+      ffldrc(fptr, ((fptr->Fptr)->bytepos) / IOBUFLEN, REPORT_EOF, status);
+    }
+
     cptr = (char *)buffer;
     bcurrent = (fptr->Fptr)->curbuf;     /* number of the current IO buffer */
     record = bufrecnum[bcurrent];  /* zero-indexed record number */
@@ -295,7 +306,11 @@ int ffgbyt(fitsfile *fptr,    /* I - FITS file pointer             */
       /* read large blocks of data directly from disk instead of via buffers */
       filepos = (fptr->Fptr)->bytepos; /* save the read starting position */
 
-      recstart = bufrecnum[(fptr->Fptr)->curbuf];          /* starting record */
+/*  note that in this case, ffmbyt has not been called, and so        */
+/*  bufrecnum[(fptr->Fptr)->curbuf] does not point to the intended */
+/*  output buffer */
+
+      recstart = filepos / IOBUFLEN;               /* starting record */
       recend = (filepos + nbytes - 1) / IOBUFLEN;  /* ending record   */
 
       for (ii = 0; ii < NIOBUF; ii++) /* flush any affected buffers to disk */
@@ -318,6 +333,11 @@ int ffgbyt(fitsfile *fptr,    /* I - FITS file pointer             */
     {
       /* read small chucks of data using the IO buffers for efficiency */
 
+      if ((fptr->Fptr)->curbuf < 0)  /* no current data buffer for this file */
+      {                              /* so reload the last one that was used */
+        ffldrc(fptr, ((fptr->Fptr)->bytepos) / IOBUFLEN, REPORT_EOF, status);
+      }
+
       /* bufpos is the starting position in IO buffer */
       bufpos = (fptr->Fptr)->bytepos - ((OFF_T)bufrecnum[(fptr->Fptr)->curbuf] *
                 IOBUFLEN);
@@ -368,6 +388,11 @@ int ffgbytoff(fitsfile *fptr, /* I - FITS file pointer                   */
     if (fptr->HDUposition != (fptr->Fptr)->curhdu)
         ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
 
+    if ((fptr->Fptr)->curbuf < 0)  /* no current data buffer for this file */
+    {                              /* so reload the last one that was used */
+      ffldrc(fptr, ((fptr->Fptr)->bytepos) / IOBUFLEN, REPORT_EOF, status);
+    }
+
     cptr = (char *)buffer;
     bcurrent = (fptr->Fptr)->curbuf;     /* number of the current IO buffer */
     record = bufrecnum[bcurrent];  /* zero-indexed record number */
@@ -553,30 +578,16 @@ int ffwhbf(fitsfile *fptr,        /* I - FITS file pointer             */
     }
 
     /* all the buffers are locked, so we have to reuse the current one */
-    /* Returns -1 if there is no current buffer (i.e. too many open files) */
-    return(*nbuff = (fptr->Fptr)->curbuf);
-}
-/*--------------------------------------------------------------------------*/
-int ffcurbuf(int nbuff,             /* i - buffer index number           */
-             FITSfile **Fptr)       /* I - FITS file pointer             */
-{
-/*
-  returns pointer to the corresponding FITSfile structure if the input
-  buffer is the current I/O buffer for that FITSfile.  If it is not the
-  current buffer, then it returns a null pointer.
-*/
-    if (bufptr[nbuff] != NULL)
-    {
-        if ((bufptr[nbuff])->curbuf == nbuff)
-        {
-             /* this is the current buffer for this file */
-             *Fptr = bufptr[nbuff];
-            return(0);
-        }
+    /* If there is no current buffer (e.g., file has just been opened) */
+    /* then use the oldest buffer.                                     */
+
+    if ((fptr->Fptr)->curbuf < 0) {
+        bufptr[ageindex[0]]->curbuf = -1; /* this buffer no longer contains */
+                                      /* the current buffer of another file */
+        return(*nbuff = ageindex[0]);  /* return oldest buffer */
+    } else {
+        return(*nbuff = (fptr->Fptr)->curbuf);  /* return current buffer */
     }
-
-    *Fptr = NULL;
-    return(0);
 }
 /*--------------------------------------------------------------------------*/
 int ffflus(fitsfile *fptr,   /* I - FITS file pointer                       */
@@ -631,7 +642,9 @@ int ffflsh(fitsfile *fptr,        /* I - FITS file pointer           */
       }
     }
 
-    ffflushx(fptr->Fptr);  /* flush system buffers to disk */
+    if (*status != READONLY_FILE)
+      ffflushx(fptr->Fptr);  /* flush system buffers to disk */
+
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -661,7 +674,7 @@ int ffbfwt(int nbuff,             /* I - which buffer to write          */
            int *status)           /* IO - error status                  */
 {
 /*
-  write contents of buffer to disk;  If the position of the buffer
+  write contents of buffer to file;  If the position of the buffer
   is beyond the current EOF, then the file may need to be extended
   with fill values, and/or with the contents of some of the other
   i/o buffers.
@@ -674,6 +687,14 @@ int ffbfwt(int nbuff,             /* I - which buffer to write          */
     static char zeros[IOBUFLEN];  /*  initialized to zero by default */
 
     Fptr = bufptr[nbuff];
+    if (!(Fptr->writemode) )
+    {
+        ffpmsg("Error: trying to write to READONLY file.");
+        dirty[nbuff] = FALSE;  /* reset buffer status to prevent later probs */
+        *status = READONLY_FILE;
+        return(*status);
+    }
+
     filepos = (OFF_T)bufrecnum[nbuff] * IOBUFLEN;
 
     if (filepos <= Fptr->filesize)
@@ -726,7 +747,7 @@ int ffbfwt(int nbuff,             /* I - which buffer to write          */
         if (filepos > Fptr->filesize)
         {                    
           nloop = (filepos - (Fptr->filesize)) / IOBUFLEN; 
-          for (jj = 0; jj < nloop; jj++)
+          for (jj = 0; jj < nloop && !(*status); jj++)
             ffwrite(Fptr, IOBUFLEN, zeros, status);
 
 /*
@@ -744,6 +765,7 @@ ffseek(Fptr, filepos);
 
       Fptr->io_pos = Fptr->filesize;  /* currently positioned at EOF */
     }
+
     return(*status);       
 }
 /*--------------------------------------------------------------------------*/
@@ -985,6 +1007,54 @@ int ffgi4b(fitsfile *fptr,  /* I - FITS file pointer                        */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffgi8b(fitsfile *fptr,  /* I - FITS file pointer                        */
+           OFF_T byteloc,   /* I - position within file to start reading    */
+           long nvals,      /* I - number of pixels to read                 */
+           long incre,      /* I - byte increment between pixels            */
+           long *values,  /* O - returned array of values                 */
+           int *status)     /* IO - error status                            */
+/*
+  get (read) the array of values from the FITS file, doing machine dependent
+  format conversion (e.g. byte-swapping) if necessary.
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  This routine reads 'nvals' 8-byte integers into 'values'.
+  This works both on platforms that have sizeof(long) = 64, and 32,
+  as long as 'values' has been allocated to large enough to hold
+  8 * nvals bytes of data.
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+*/
+{
+    OFF_T  postemp;
+
+    if (incre == 8)      /* read all the values at once (contiguous bytes) */
+    {
+        if (nvals * 8 < MINDIRECT)  /* read normally via IO buffers */
+        {
+           ffmbyt(fptr, byteloc, REPORT_EOF, status);
+           ffgbyt(fptr, nvals * 8, values, status);
+        }
+        else            /* read directly from disk, bypassing IO buffers */
+        {
+           postemp = (fptr->Fptr)->bytepos;   /* store current file position */
+           (fptr->Fptr)->bytepos = byteloc;   /* set to the desired position */
+           ffgbyt(fptr, nvals * 8, values, status);
+           (fptr->Fptr)->bytepos = postemp;   /* reset to original position */
+        }
+    }
+    else         /* have to read each value individually (not contiguous ) */
+    {
+        ffmbyt(fptr, byteloc, REPORT_EOF, status);
+        ffgbytoff(fptr, 8, nvals, incre - 8, values, status);
+    }
+
+#if BYTESWAPPED
+    ffswap8((double *) values, nvals); /* reverse bytes in each value */
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffgr4b(fitsfile *fptr,  /* I - FITS file pointer                        */
            OFF_T byteloc,   /* I - position within file to start reading    */
            long nvals,      /* I - number of pixels to read                 */
@@ -1264,6 +1334,38 @@ int ffpi4b(fitsfile *fptr, /* I - FITS file pointer                         */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffpi8b(fitsfile *fptr, /* I - FITS file pointer                         */
+           long nvals,     /* I - number of pixels in the values array      */
+           long incre,     /* I - byte increment between pixels             */
+           long *values,   /* I - array of values to write                */
+           int *status)    /* IO - error status                             */
+/*
+  put (write) the array of values to the FITS file, doing machine dependent
+  format conversion (e.g. byte-swapping) if necessary.
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  This routine writes 'nvals' 8-byte integers from 'values'.
+  This works both on platforms that have sizeof(long) = 64, and 32,
+  as long as 'values' has been allocated to large enough to hold
+  8 * nvals bytes of data.
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+*/
+{
+#if BYTESWAPPED
+    ffswap8((double *) values, nvals);    /* reverse bytes in each value */
+#endif
+
+    if (incre == 8)      /* write all the values at once (contiguous bytes) */
+
+        ffpbyt(fptr, nvals * 8, values, status);
+
+    else         /* have to write each value individually (not contiguous ) */
+
+        ffpbytoff(fptr, 8, nvals, incre - 8, values, status);
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffpr4b(fitsfile *fptr, /* I - FITS file pointer                         */
            long nvals,     /* I - number of pixels in the values array      */
            long incre,     /* I - byte increment between pixels             */
diff --git a/cfileio.c b/cfileio.c
index ca86523..73bcc97 100644
--- a/cfileio.c
+++ b/cfileio.c
@@ -8,12 +8,13 @@
 #include <stdlib.h>
 #include <math.h>
 #include <ctype.h>
+#include <errno.h>
 #include <stddef.h>  /* apparently needed to define size_t */
 #include "fitsio2.h"
 #include "group.h"
 
 #define MAX_PREFIX_LEN 20  /* max length of file type prefix (e.g. 'http://') */
-#define MAX_DRIVERS 20     /* max number of file I/O drivers */
+#define MAX_DRIVERS 22     /* max number of file I/O drivers */
 
 typedef struct    /* structure containing pointers to I/O driver functions */ 
 {   char prefix[MAX_PREFIX_LEN];
@@ -37,6 +38,9 @@ typedef struct    /* structure containing pointers to I/O driver functions */
 
 fitsdriver driverTable[MAX_DRIVERS];  /* allocate driver tables */
 
+FITSfile *FptrTable[NMAXFILES];  /* this table of Fptr pointers is */
+                                 /* used by fits_already_open */
+
 int need_to_initialize = 1;    /* true if CFITSIO has not been initialized */
 int no_of_drivers = 0;         /* number of currently defined I/O drivers */
 
@@ -121,7 +125,7 @@ int ffomem(fitsfile **fptr,      /* O - FITS file pointer                   */
     if (!(*fptr))
     {
         (*driverTable[driver].close)(handle);  /* close the file */
-        ffpmsg("failed to allocate structure for following file: (ffopen)");
+        ffpmsg("failed to allocate structure for following file: (ffomem)");
         ffpmsg(url);
         return(*status = MEMORY_ALLOCATION);
     }
@@ -132,7 +136,7 @@ int ffomem(fitsfile **fptr,      /* O - FITS file pointer                   */
     if (!((*fptr)->Fptr))
     {
         (*driverTable[driver].close)(handle);  /* close the file */
-        ffpmsg("failed to allocate structure for following file: (ffopen)");
+        ffpmsg("failed to allocate structure for following file: (ffomem)");
         ffpmsg(url);
         free(*fptr);
         *fptr = 0;       
@@ -146,8 +150,23 @@ int ffomem(fitsfile **fptr,      /* O - FITS file pointer                   */
     if ( !(((*fptr)->Fptr)->filename) )
     {
         (*driverTable[driver].close)(handle);  /* close the file */
-        ffpmsg("failed to allocate memory for filename: (ffopen)");
+        ffpmsg("failed to allocate memory for filename: (ffomem)");
+        ffpmsg(url);
+        free((*fptr)->Fptr);
+        free(*fptr);
+        *fptr = 0;              /* return null file pointer */
+        return(*status = MEMORY_ALLOCATION);
+    }
+
+    /* mem for headstart array */
+    ((*fptr)->Fptr)->headstart = (OFF_T *) calloc(1001, sizeof(OFF_T)); 
+
+    if ( !(((*fptr)->Fptr)->headstart) )
+    {
+        (*driverTable[driver].close)(handle);  /* close the file */
+        ffpmsg("failed to allocate memory for headstart array: (ffomem)");
         ffpmsg(url);
+        free( ((*fptr)->Fptr)->filename);
         free((*fptr)->Fptr);
         free(*fptr);
         *fptr = 0;              /* return null file pointer */
@@ -155,6 +174,7 @@ int ffomem(fitsfile **fptr,      /* O - FITS file pointer                   */
     }
 
         /* store the parameters describing the file */
+    ((*fptr)->Fptr)->MAXHDU = 1000;              /* initial size of headstart */
     ((*fptr)->Fptr)->filehandle = handle;        /* file handle */
     ((*fptr)->Fptr)->driver = driver;            /* driver number */
     strcpy(((*fptr)->Fptr)->filename, url);      /* full input filename */
@@ -168,10 +188,12 @@ int ffomem(fitsfile **fptr,      /* O - FITS file pointer                   */
 
     ffldrc(*fptr, 0, REPORT_EOF, status);     /* load first record */
 
+    fits_store_Fptr( (*fptr)->Fptr, status);  /* store Fptr address */
+
     if (ffrhdu(*fptr, &hdutyp, status) > 0)  /* determine HDU structure */
     {
         ffpmsg(
-          "ffopen could not interpret primary array header of file: (ffomem)");
+          "ffomem could not interpret primary array header of file: (ffomem)");
         ffpmsg(url);
 
         if (*status == UNKNOWN_REC)
@@ -209,7 +231,7 @@ int ffomem(fitsfile **fptr,      /* O - FITS file pointer                   */
 
       if (*status > 0)
       {
-        ffpmsg("ffopen could not move to the specified extension:");
+        ffpmsg("ffomem could not move to the specified extension:");
         if (extnum > 0)
         {
           sprintf(errmsg,
@@ -245,6 +267,78 @@ int ffomem(fitsfile **fptr,      /* O - FITS file pointer                   */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffdopn(fitsfile **fptr,      /* O - FITS file pointer                   */ 
+           const char *name,     /* I - full name of file to open           */
+           int mode,             /* I - 0 = open readonly; 1 = read/write   */
+           int *status)          /* IO - error status                       */
+/*
+  Open an existing FITS file with either readonly or read/write access. and
+  move to the first HDU that contains 'interesting' data, if the primary
+  array contains a null image (i.e., NAXIS = 0). 
+*/
+{
+    if (*status > 0)
+        return(*status);
+
+    *status = SKIP_NULL_PRIMARY;
+
+    ffopen(fptr, name, mode, status);
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fftopn(fitsfile **fptr,      /* O - FITS file pointer                   */ 
+           const char *name,     /* I - full name of file to open           */
+           int mode,             /* I - 0 = open readonly; 1 = read/write   */
+           int *status)          /* IO - error status                       */
+/*
+  Open an existing FITS file with either readonly or read/write access. and
+  move to the first HDU that contains 'interesting' table (not an image). 
+*/
+{
+    int hdutype;
+
+    if (*status > 0)
+        return(*status);
+
+    *status = SKIP_IMAGE;
+
+    ffopen(fptr, name, mode, status);
+
+    if (ffghdt(*fptr, &hdutype, status) <= 0) {
+        if (hdutype == IMAGE_HDU)
+            *status = NOT_TABLE;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffiopn(fitsfile **fptr,      /* O - FITS file pointer                   */ 
+           const char *name,     /* I - full name of file to open           */
+           int mode,             /* I - 0 = open readonly; 1 = read/write   */
+           int *status)          /* IO - error status                       */
+/*
+  Open an existing FITS file with either readonly or read/write access. and
+  move to the first HDU that contains 'interesting' image (not an table). 
+*/
+{
+    int hdutype;
+
+    if (*status > 0)
+        return(*status);
+
+    *status = SKIP_TABLE;
+
+    ffopen(fptr, name, mode, status);
+
+    if (ffghdt(*fptr, &hdutype, status) <= 0) {
+        if (hdutype != IMAGE_HDU)
+            *status = NOT_IMAGE;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffopen(fitsfile **fptr,      /* O - FITS file pointer                   */ 
            const char *name,     /* I - full name of file to open           */
            int mode,             /* I - 0 = open readonly; 1 = read/write   */
@@ -253,13 +347,13 @@ int ffopen(fitsfile **fptr,      /* O - FITS file pointer                   */
   Open an existing FITS file with either readonly or read/write access.
 */
 {
-    int  driver, hdutyp, slen, writecopy, isopen;
+    int  driver, hdutyp, hdunum, slen, writecopy, isopen;
     OFF_T filesize;
     long rownum, nrows, goodrows;
-    int extnum, extvers, handle, movetotype;
+    int extnum, extvers, handle, movetotype, tstatus = 0;
     char urltype[MAX_PREFIX_LEN], infile[FLEN_FILENAME], outfile[FLEN_FILENAME];
     char origurltype[MAX_PREFIX_LEN], extspec[FLEN_FILENAME];
-    char extname[FLEN_VALUE], rowfilter[FLEN_FILENAME];
+    char extname[FLEN_VALUE], rowfilter[FLEN_FILENAME], tblname[FLEN_VALUE];
     char imagecolname[FLEN_VALUE], rowexpress[FLEN_FILENAME];
     char binspec[FLEN_FILENAME], colspec[FLEN_FILENAME];
     char histfilename[FLEN_FILENAME];
@@ -271,7 +365,8 @@ int ffopen(fitsfile **fptr,      /* O - FITS file pointer                   */
 
     char *url;
     double minin[4], maxin[4], binsizein[4], weight;
-    int imagetype, haxis, recip;
+    int imagetype, naxis = 1, haxis, recip;
+    int skip_null = 0, skip_image = 0, skip_table = 0;
     char colname[4][FLEN_VALUE];
     char errmsg[FLEN_ERRMSG];
     char *hdtype[3] = {"IMAGE", "TABLE", "BINTABLE"};
@@ -280,6 +375,31 @@ int ffopen(fitsfile **fptr,      /* O - FITS file pointer                   */
     if (*status > 0)
         return(*status);
 
+    if (*status == SKIP_NULL_PRIMARY)
+    {
+      /* this special status value is used as a flag by ffdopn to tell */
+      /* ffopen to skip over a null primary array when opening the file. */
+
+       skip_null = 1;
+       *status = 0;
+    }
+    else if (*status == SKIP_IMAGE)
+    {
+      /* this special status value is used as a flag by fftopn to tell */
+      /* ffopen to move to 1st significant table when opening the file. */
+
+       skip_image = 1;
+       *status = 0;
+    }
+    else if (*status == SKIP_TABLE)
+    {
+      /* this special status value is used as a flag by fftopn to tell */
+      /* ffopen to move to 1st significant image when opening the file. */
+
+       skip_table = 1;
+       *status = 0;
+    }
+
     *fptr = 0;              /* initialize null file pointer */
     writecopy = 0;  /* have we made a write-able copy of the input file? */
 
@@ -473,7 +593,22 @@ int ffopen(fitsfile **fptr,      /* O - FITS file pointer                   */
         return(*status = MEMORY_ALLOCATION);
     }
 
+    /* mem for headstart array */
+    ((*fptr)->Fptr)->headstart = (OFF_T *) calloc(1001, sizeof(OFF_T));
+
+    if ( !(((*fptr)->Fptr)->headstart) )
+    {
+        (*driverTable[driver].close)(handle);  /* close the file */
+        ffpmsg("failed to allocate memory for headstart array: (ffopen)");
+        ffpmsg(url);
+        free( ((*fptr)->Fptr)->filename);
+        free((*fptr)->Fptr);
+        free(*fptr);
+        *fptr = 0;              /* return null file pointer */
+        return(*status = MEMORY_ALLOCATION);
+    }
         /* store the parameters describing the file */
+    ((*fptr)->Fptr)->MAXHDU = 1000;              /* initial size of headstart */
     ((*fptr)->Fptr)->filehandle = handle;        /* file handle */
     ((*fptr)->Fptr)->driver = driver;            /* driver number */
     strcpy(((*fptr)->Fptr)->filename, url);      /* full input filename */
@@ -487,6 +622,8 @@ int ffopen(fitsfile **fptr,      /* O - FITS file pointer                   */
 
     ffldrc(*fptr, 0, REPORT_EOF, status);     /* load first record */
 
+    fits_store_Fptr( (*fptr)->Fptr, status);  /* store Fptr address */
+
     if (ffrhdu(*fptr, &hdutyp, status) > 0)  /* determine HDU structure */
     {
         ffpmsg(
@@ -558,14 +695,92 @@ move2hdu:
 
           ffpmsg(" doesn't exist or couldn't be opened.");
         }
+
+        ffclos(*fptr, status);
+        *fptr = 0;              /* return null file pointer */
         return(*status);
       }
     }
+    else if (skip_null || skip_image || skip_table ||
+            (*imagecolname || *colspec || *rowfilter || *binspec))
+    {
+      /* ------------------------------------------------------------------
+
+      If no explicit extension specifier is given as part of the file
+      name, and, if a) skip_null is true (set if ffopen is called by
+      ffdopn) or b) skip_image or skip_table is true (set if ffopen is
+      called by fftopn or ffdopn) or c) other file filters are
+      specified, then CFITSIO will attempt to move to the first
+      'interesting' HDU after opening an existing FITS file (or to
+      first interesting table HDU if skip_image is true);
+
+      An 'interesting' HDU is defined to be either an image with NAXIS
+      > 0 (i.e., not a null array) or a table which has an EXTNAME
+      value which does not contain any of the following strings:
+         'GTI'  - Good Time Interval extension
+         'OBSTABLE'  - used in Beppo SAX data files
+
+      The main purpose for this is to allow CFITSIO to skip over a null
+      primary and other non-interesting HDUs when opening an existing
+      file, and move directly to the first extension that contains
+      significant data.
+      ------------------------------------------------------------------ */
+
+      fits_get_hdu_num(*fptr, &hdunum);
+      if (hdunum == 1) {
+
+        fits_get_img_dim(*fptr, &naxis, status);
+
+        if (naxis == 0 || skip_image) /* skip primary array */
+        {
+          while(1) 
+          {
+            /* see if the next HDU is 'interesting' */
+            if (fits_movrel_hdu(*fptr, 1, &hdutyp, status))
+            {
+               if (*status == END_OF_FILE)
+                  *status = 0;  /* reset expected error */
+
+               /* didn't find an interesting HDU so move back to beginning */
+               fits_movabs_hdu(*fptr, 1, &hdutyp, status);
+               break;
+            }
+
+            if (hdutyp == IMAGE_HDU && skip_image) {
+
+                continue;   /* skip images */
+
+            } else if (hdutyp != IMAGE_HDU && skip_table) {
+
+                continue;   /* skip tables */
+
+            } else if (hdutyp == IMAGE_HDU) {
+
+               fits_get_img_dim(*fptr, &naxis, status);
+               if (naxis > 0)
+                  break;  /* found a non-null image */
+
+            } else {
+
+               tstatus = 0;
+               tblname[0] = '\0';
+               fits_read_key(*fptr, TSTRING, "EXTNAME", tblname, NULL,&tstatus);
+
+               if ( (!strstr(tblname, "GTI") && !strstr(tblname, "gti")) &&
+                    strncasecmp(tblname, "OBSTABLE", 8) )
+                  break;  /* found an interesting table */
+            }
+          }  /* end while */
+        }
+      } /* end if (hdunum==1) */
+    }
 
     if (*imagecolname)
     {
-       /* we need to open an image contained in a single table cell */
-       /* First, determine which row of the table to use. */
+       /* ----------------------------------------------------------------- */
+       /* we need to open an image contained in a single table cell         */
+       /* First, determine which row of the table to use.                   */
+       /* ----------------------------------------------------------------- */
 
        if (isdigit((int) *rowexpress))  /* is the row specification a number? */
        {
@@ -576,6 +791,8 @@ move2hdu:
              ffpmsg(rowexpress);
              ffpmsg("Could not open the following image in a table cell:");
              ffpmsg(extspec);
+             ffclos(*fptr, status);
+             *fptr = 0;              /* return null file pointer */
              return(*status = BAD_ROW_NUM);
           }
        }
@@ -585,6 +802,8 @@ move2hdu:
           ffpmsg(rowexpress);
           ffpmsg("Could not open the following image in a table cell:");
           ffpmsg(extspec);
+          ffclos(*fptr, status);
+          *fptr = 0;              /* return null file pointer */
           return(*status);
        }
 
@@ -594,6 +813,8 @@ move2hdu:
           ffpmsg(rowexpress);
           ffpmsg("Could not open the following image in a table cell:");
           ffpmsg(extspec);
+          ffclos(*fptr, status);
+          *fptr = 0;              /* return null file pointer */
           return(*status = BAD_ROW_NUM);
        }
 
@@ -611,6 +832,8 @@ move2hdu:
        {
           ffpmsg("Failed to copy table cell to new primary array:");
           ffpmsg(extspec);
+          ffclos(*fptr, status);
+          *fptr = 0;              /* return null file pointer */
           return(*status);
        }
 
@@ -619,9 +842,9 @@ move2hdu:
        /* add some HISTORY; fits_copy_image_cell also wrote HISTORY keywords */
        
        if (*extname)
-         sprintf(card,"HISTORY  in HDU '%.16s' of file '%.36s'", extname, infile);
+        sprintf(card,"HISTORY  in HDU '%.16s' of file '%.36s'",extname,infile);
        else
-         sprintf(card,"HISTORY  in HDU %d of file '%.45s'", extnum, infile);
+        sprintf(card,"HISTORY  in HDU %d of file '%.45s'", extnum, infile);
 
        ffprec(*fptr, card, status);
     }
@@ -658,6 +881,8 @@ move2hdu:
            ffpmsg("editing columns in input table failed (ffopen)");
            ffpmsg(" while trying to perform the following operation:");
            ffpmsg(colspec);
+           ffclos(*fptr, status);
+           *fptr = 0;              /* return null file pointer */
            return(*status);
        }
     }
@@ -669,7 +894,6 @@ move2hdu:
  
     if (*rowfilter)
     {
-
      fits_get_hdu_type(*fptr, &hdutyp, status);  /* get type of HDU */
      if (hdutyp == IMAGE_HDU)
      {
@@ -682,7 +906,7 @@ move2hdu:
 
         /* create new file containing the image section, plus a copy of */
         /* any other HDUs that exist in the input file.  This routine   */
-        /* will the close the original image file and return a pointer  */
+        /* will close the original image file and return a pointer      */
         /* to the new file. */
 
         if (fits_select_image_section(fptr, outfile, rowfilter, status) > 0)
@@ -690,6 +914,8 @@ move2hdu:
            ffpmsg("on-the-fly selection of image section failed (ffopen)");
            ffpmsg(" while trying to use the following section filter:");
            ffpmsg(rowfilter);
+           ffclos(*fptr, status);
+           *fptr = 0;              /* return null file pointer */
            return(*status);
         }
         writecopy = 1;
@@ -716,6 +942,8 @@ move2hdu:
            "failed to allocate memory for selected columns array (ffopen)");
            ffpmsg(" while trying to select rows with the following filter:");
            ffpmsg(rowfilter);
+           ffclos(*fptr, status);
+           *fptr = 0;              /* return null file pointer */
            return(*status = MEMORY_ALLOCATION);
         }
 
@@ -725,6 +953,9 @@ move2hdu:
            ffpmsg("selection of rows in input table failed (ffopen)");
            ffpmsg(" while trying to select rows with the following filter:");
            ffpmsg(rowfilter);
+           free(rowselect);
+           ffclos(*fptr, status);
+           *fptr = 0;              /* return null file pointer */
            return(*status);
         }
       }
@@ -737,8 +968,8 @@ move2hdu:
         {
            if (*filtfilename && *outfile == '\0')
                strcpy(outfile, filtfilename); /* the original outfile name */
-           else if (*outfile == '\0') /* output file name not already defined? */
-             strcpy(outfile, "mem://_2");  /* will create copy in memory */
+           else if (*outfile == '\0') /* output filename not already defined? */
+               strcpy(outfile, "mem://_2");  /* will create copy in memory */
         }
         else
         {
@@ -756,10 +987,18 @@ move2hdu:
           ffpmsg("on-the-fly selection of rows in input table failed (ffopen)");
            ffpmsg(" while trying to select rows with the following filter:");
            ffpmsg(rowfilter);
+           ffclos(*fptr, status);
+           *fptr = 0;              /* return null file pointer */
            return(*status);
         }
 
-      }    /* end of no binspec case */
+        /* write history records */
+        ffphis(*fptr, 
+        "CFITSIO used the following filtering expression to create this table:",
+        status);
+        ffphis(*fptr, name, status);
+
+      }   /* end of no binspec case */
      }   /* end of table HDU case */
     }  /* end of rowfilter exists case */
 
@@ -781,22 +1020,30 @@ move2hdu:
                           minname, maxname, binname,
                           &weight, wtcol, &recip, status);
 
-       /* Create the histogram primary array and open it as the current fptr.  */
+       /* Create the histogram primary array and open it as the current fptr */
        /* This will close the table that was used to create the histogram. */
        ffhist(fptr, outfile, imagetype, haxis, colname, minin, maxin,
               binsizein, minname, maxname, binname,
               weight, wtcol, recip, rowselect, status);
 
+       if (rowselect)
+          free(rowselect);
+
        if (*status > 0)
        {
-           ffpmsg("on-the-fly histogramming of input table failed (ffopen)");
-           ffpmsg(" while trying to execute the following histogram specification:");
-           ffpmsg(binspec);
+      ffpmsg("on-the-fly histogramming of input table failed (ffopen)");
+      ffpmsg(" while trying to execute the following histogram specification:");
+      ffpmsg(binspec);
+           ffclos(*fptr, status);
+           *fptr = 0;              /* return null file pointer */
            return(*status);
        }
 
-       if (rowselect)
-          free(rowselect);
+        /* write history records */
+        ffphis(*fptr,
+        "CFITSIO used the following expression to create this histogram:", 
+        status);
+        ffphis(*fptr, name, status);
     }
 
     return(*status);
@@ -830,6 +1077,43 @@ int ffreopen(fitsfile *openfptr, /* I - FITS file pointer to open file  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fits_store_Fptr(FITSfile *Fptr,  /* O - FITS file pointer               */ 
+           int *status)              /* IO - error status                   */
+/*
+   store the new Fptr address for future use by fits_already_open 
+*/
+{
+    int ii;
+
+    if (*status > 0)
+        return(*status);
+
+    for (ii = 0; ii < NMAXFILES; ii++) {
+        if (FptrTable[ii] == 0) {
+            FptrTable[ii] = Fptr;
+            break;
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_clear_Fptr(FITSfile *Fptr,  /* O - FITS file pointer               */ 
+           int *status)              /* IO - error status                   */
+/*
+   clear the Fptr address from the Fptr Table  
+*/
+{
+    int ii;
+
+    for (ii = 0; ii < NMAXFILES; ii++) {
+        if (FptrTable[ii] == Fptr) {
+            FptrTable[ii] = 0;
+            break;
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fits_already_open(fitsfile **fptr, /* I/O - FITS file pointer       */ 
            char *url, 
            char *urltype, 
@@ -852,11 +1136,10 @@ int fits_already_open(fitsfile **fptr, /* I/O - FITS file pointer       */
        was opened with another file path. For instance, if the CWD is
        /a/b/c and I open /a/b/c/foo.fits then open ./foo.fits the previous
        version of this function would not have reconized that the two files
-       were the same. This version does reconize that the two files are
+       were the same. This version does recognize that the two files are
        the same.
      */
 {
-
     FITSfile *oldFptr;
     int ii;
     char oldurltype[MAX_PREFIX_LEN], oldinfile[FLEN_FILENAME];
@@ -884,11 +1167,12 @@ int fits_already_open(fitsfile **fptr, /* I/O - FITS file pointer       */
     else
       strcpy(tmpinfile,infile);
 
-    for (ii = 0; ii < NIOBUF; ii++)   /* check every buffer */
+    for (ii = 0; ii < NMAXFILES; ii++)   /* check every buffer */
     {
-        ffcurbuf(ii, &oldFptr);  
-        if (oldFptr)            /* this is the current buffer of a file */
+        if (FptrTable[ii] != 0)
         {
+          oldFptr = FptrTable[ii];
+
           ffiurl(oldFptr->filename, oldurltype, 
                     oldinfile, oldoutfile, oldextspec, oldrowfilter, 
                     oldbinspec, oldcolspec, status);
@@ -1017,7 +1301,8 @@ int ffedit_columns(
 */
 {
     fitsfile *newptr;
-    int ii, hdunum, slen, colnum;
+    int ii, hdunum, slen, colnum, deletecol = 0, savecol = 0;
+    int numcols = 0, *colindex = 0, tstatus = 0;
     char *cptr, *cptr2, *cptr3, clause[FLEN_FILENAME], keyname[FLEN_KEYWORD];
     char colname[FLEN_VALUE], oldname[FLEN_VALUE], colformat[FLEN_VALUE];
     char *file_expr = NULL;
@@ -1046,7 +1331,6 @@ int ffedit_columns(
       if (*status == END_OF_FILE)
       {
         *status = 0;              /* got the expected EOF error; reset = 0  */
-        ffxmsg(-2, NULL);         /* remove extraneous error message */
       }
       else if (*status > 0)
       {
@@ -1083,6 +1367,9 @@ int ffedit_columns(
           cptr++;         /* skip leading white space... again */
     }
 
+    tstatus = 0;
+    ffgncl(*fptr, &numcols, &tstatus);  /* get initial # of cols */
+
     /* parse expression and get first clause, if more than 1 */
 
     while ((slen = fits_get_token(&cptr, ";", clause, NULL)) > 0 )
@@ -1090,9 +1377,11 @@ int ffedit_columns(
         if( *cptr==';' ) cptr++;
         clause[slen] = '\0';
 
-        if (clause[0] == '!')
+        if (clause[0] == '!' || clause[0] == '-')
         {
-            /* delete this column or keyword */
+            /* ===================================== */
+            /* Case I. delete this column or keyword */
+            /* ===================================== */
 
             if (ffgcno(*fptr, CASEINSEN, &clause[1], &colnum, status) <= 0)
             {
@@ -1101,9 +1390,12 @@ int ffedit_columns(
                 {
                     ffpmsg("failed to delete column in input file:");
                     ffpmsg(clause);
+                    if( colindex ) free( colindex );
                     if( file_expr ) free( file_expr );
                     return(*status);
                 }
+                deletecol = 1; /* set flag that at least one col was deleted */
+                numcols--;
             }
             else
             {
@@ -1113,6 +1405,7 @@ int ffedit_columns(
                 {
                     ffpmsg("column or keyword to be deleted does not exist:");
                     ffpmsg(clause);
+                    if( colindex ) free( colindex );
                     if( file_expr ) free( file_expr );
                     return(*status);
                 }
@@ -1120,42 +1413,112 @@ int ffedit_columns(
         }
         else
         {
-            /*
-               this is either a column or keyword name followed by a 
-               single "=" and a calculation expression, or
-               a column name followed by double = ("==") followed
-               by the new name to which it should be renamed.
-            */
+            /* ===================================================== */
+            /* Case II:
+	       this is either a column name, (case 1) 
 
+               or a new column name followed by double = ("==") followed
+               by the old name which is to be renamed. (case 2A)
+
+               or a column or keyword name followed by a single "=" and a
+	       calculation expression (case 2B) */
+            /* ===================================================== */
             cptr2 = clause;
-            slen = fits_get_token(&cptr2, " =", colname, NULL);
+            slen = fits_get_token(&cptr2, "( =", colname, NULL);
+
+
             if (slen == 0)
             {
                 ffpmsg("error: column or keyword name is blank:");
                 ffpmsg(clause);
+                if( colindex ) free( colindex );
                 if( file_expr ) free( file_expr );
                 return(*status= URL_PARSE_ERROR);
             }
 
+            /* if we encountered an opening parenthesis, then we need to */
+            /* find the closing parenthesis, and concatinate the 2 strings */
+            /* This supports expressions like:
+                [col #EXTNAME(Extension name)="GTI"]
+            */
+            if (*cptr2  == '(')
+            {
+                fits_get_token(&cptr2, ")", oldname, NULL);
+                strcat(colname, oldname);
+                strcat(colname, ")");
+                cptr2++;
+            }
+
             while (*cptr2 == ' ')
                  cptr2++;         /* skip white space */
 
             if (*cptr2 != '=')
             {
+              /* ------------------------------------ */
+              /* case 1 - simply the name of a column */
+              /* ------------------------------------ */
+
+              /* look for matching column */
+              ffgcno(*fptr, CASEINSEN, colname, &colnum, status);
+
+              while (*status == COL_NOT_UNIQUE) 
+              {
+                 /* the column name contained wild cards, and it */
+                 /* matches more than one column in the table. */
+
+                 /* keep this column in the output file */
+                 savecol = 1;
+
+                 if (!colindex)
+                    colindex = calloc(999, sizeof(int));
+
+                 colindex[colnum - 1] = 1;  /* flag this column number */
+
+                 /* look for other matching column names */
+                 ffgcno(*fptr, CASEINSEN, colname, &colnum, status);
+
+                 if (*status == COL_NOT_FOUND)
+                    *status = 999;  /* temporary status flag value */
+              }
+
+              if (*status <= 0)
+              {
+                 /* keep this column in the output file */
+                 savecol = 1;
+
+                 if (!colindex)
+                    colindex = calloc(999, sizeof(int));
+
+                 colindex[colnum - 1] = 1;  /* flag this column number */
+              }
+              else if (*status == 999)
+              {
+                  /* this special flag value does not represent an error */
+                  *status = 0;  
+              }
+              else
+              {
                ffpmsg("Syntax error in columns specifier in input URL:");
                ffpmsg(cptr2);
+               if( colindex ) free( colindex );
                if( file_expr ) free( file_expr );
                return(*status = URL_PARSE_ERROR);
+              }
             }
+            else
+            {
+              /* ----------------------------------------------- */
+              /* case 2 where the token ends with an equals sign */
+              /* ----------------------------------------------- */
 
-            cptr2++;   /* skip over the first '=' */
+              cptr2++;   /* skip over the first '=' */
 
-            if (*cptr2 == '=')
-            {
-                /*
-                    Case 1:  rename a column or keyword;  syntax is
-                    "new_name == old_name"
-                */
+              if (*cptr2 == '=')
+              {
+                /*................................................. */
+                /*  Case A:  rename a column or keyword;  syntax is
+                    "new_name == old_name"  */
+                /*................................................. */
 
                 cptr2++;  /* skip the 2nd '=' */
                 while (*cptr2 == ' ')
@@ -1176,9 +1539,16 @@ int ffedit_columns(
                       ffpmsg(oldname);
                       ffpmsg(" newname =");
                       ffpmsg(colname);
+                      if( colindex ) free( colindex );
                       if( file_expr ) free( file_expr );
                       return(*status);
                     }
+                    /* keep this column in the output file */
+                    savecol = 1;
+                    if (!colindex)
+                       colindex = calloc(999, sizeof(int));
+
+                    colindex[colnum - 1] = 1;  /* flag this column number */
                 }
                 else
                 {
@@ -1188,15 +1558,19 @@ int ffedit_columns(
                     {
                       ffpmsg("column or keyword to be renamed does not exist:");
                         ffpmsg(clause);
+                        if( colindex ) free( colindex );
                         if( file_expr ) free( file_expr );
                         return(*status);
                     }
                 }
-            }  
-            else
-            {
+              }  
+              else
+              {
+                /*...................................................... */
+                /* Case B: */
                 /* this must be a general column/keyword calc expression */
                 /* "name = expression" or "colname(TFORM) = expression" */
+                /*...................................................... */
 
                 /* parse the name and TFORM values, if present */
                 colformat[0] = '\0';
@@ -1210,13 +1584,53 @@ int ffedit_columns(
                    fits_get_token(&cptr3, ")", colformat, NULL);
                 }
 
-                /* calculate values for the column or keyword */ 
+                /* calculate values for the column or keyword */
+                /*   cptr2 = the expression to be calculated */
+                /*   oldname = name of the column or keyword */
+                /*   colformat = column format, or keyword comment string */
+
                 fits_calculator(*fptr, cptr2, *fptr, oldname, colformat,
        	                        status);
+
+                /* test if this is a column and not a keyword */
+                tstatus = 0;
+                ffgcno(*fptr, CASEINSEN, oldname, &colnum, &tstatus);
+                if (tstatus == 0)
+                {
+                    /* keep this column in the output file */
+                    savecol = 1;
+
+                    if (!colindex)
+                      colindex = calloc(999, sizeof(int));
+
+                    colindex[colnum - 1] = 1;
+                    if (colnum > numcols)numcols++;
+                }
+              }
             }
         }
     }
 
+    if (savecol && !deletecol)
+    {
+       /* need to delete all but the specified columns */
+       for (ii = numcols; ii > 0; ii--)
+       {
+         if (!colindex[ii-1])  /* delete this column */
+         {
+           if (ffdcol(*fptr, ii, status) > 0)
+           {
+             ffpmsg("failed to delete column in input file:");
+             ffpmsg(clause);
+             if( colindex ) free( colindex );
+             if( file_expr ) free( file_expr );
+             return(*status);
+           }
+         }
+       }
+    }
+
+    if( colindex ) free( colindex );
     if( file_expr ) free( file_expr );
     return(*status);
 }
@@ -1444,11 +1858,21 @@ int fits_copy_image_cell(
     /* finally, copy the data, one buffer size at a time */
     ffmbyt(*fptr, startpos, TRUE, status);
     firstbyte = 1; 
+
+    /* the upper limit on the number of bytes must match the declaration */
+    /* read up to the first 30000 bytes in the normal way with ffgbyt */
+    ntodo = minvalue(30000L, nbytes);
+    ffgbyt(*fptr, ntodo, buffer, status);
+    ffptbb(newptr, 1, firstbyte, ntodo, buffer, status);
+
+    nbytes    -= ntodo;
+    firstbyte += ntodo;
+
+    /* read any additional bytes with low-level ffread routine, for speed */
     while (nbytes && (*status <= 0) )
     {
-     /* the upper limit on the number of bytes must match the declaration */
         ntodo = minvalue(30000L, nbytes);
-        ffgbyt(*fptr, ntodo, buffer, status);
+        ffread((*fptr)->Fptr, ntodo, buffer, status);
         ffptbb(newptr, 1, firstbyte, ntodo, buffer, status);
         nbytes    -= ntodo;
         firstbyte += ntodo;
@@ -1555,7 +1979,7 @@ int fits_select_image_section(
     fitsfile *newptr;
     int ii, hdunum, naxis, bitpix, tstatus, anynull, nkey, numkeys;
     long naxes[9], smin, smax, sinc, fpixels[9], lpixels[9], incs[9];
-    long outnaxes[9], outsize, buffsize;
+    long outnaxes[9], outsize, buffsize, dummy[2];
     char *cptr, keyname[FLEN_KEYWORD], card[FLEN_CARD];
     double *buffer = 0, crpix, cdelt;
 
@@ -1757,7 +2181,12 @@ int fits_select_image_section(
     /* reduces the probability that the memory for the FITS file will have */
     /* to be reallocated to a new location later. */
 
-    if (fits_write_img(newptr, TLONG, outsize, 1, incs, status) > 0)
+    /* turn off any scaling of the pixel values */
+    fits_set_bscale(*fptr,  1.0, 0.0, status);
+    fits_set_bscale(newptr, 1.0, 0.0, status);
+
+    dummy[0] = 0;
+    if (fits_write_img(newptr, TLONG, outsize, 1, dummy, status) > 0)
     {
         ffpmsg("error trying to write dummy value to the last image pixel");
         ffclos(newptr, status);
@@ -1775,10 +2204,6 @@ int fits_select_image_section(
         return(*status = MEMORY_ALLOCATION);
     }
 
-    /* turn off any scaling of the pixel values */
-    fits_set_bscale(*fptr,  1.0, 0.0, status);
-    fits_set_bscale(newptr, 1.0, 0.0, status);
-
     /* read the image section then write it to the output file */
 
     if (bitpix == 8)
@@ -1851,7 +2276,20 @@ int fits_select_image_section(
     *fptr = newptr; /* reset the pointer to the new table */
 
     /* move back to the image subsection */
-    fits_movabs_hdu(*fptr, hdunum, NULL, status);
+    if (ii - 1 != hdunum)
+        fits_movabs_hdu(*fptr, hdunum, NULL, status);
+    else
+    {
+        /* may have to reset BSCALE and BZERO pixel scaling, */
+        /* since the keywords were previously turned off */
+
+        if (ffrdef(*fptr, status) > 0)  
+        {
+            ffclos(*fptr, status);
+            return(*status);
+        }
+
+    }
 
     return(*status);
 }
@@ -2026,55 +2464,188 @@ int ffselect_table(
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
-int ffinit(fitsfile **fptr,      /* O - FITS file pointer                   */
-           const char *name,     /* I - name of file to create              */
+int ffparsecompspec(fitsfile *fptr,  /* I - FITS file pointer               */
+           char *compspec,     /* I - image compression specification */
            int *status)          /* IO - error status                       */
 /*
-  Create and initialize a new FITS file.
+  Parse the image compression specification that was give in square brackets
+  following the output FITS file name, as in these examples:
+
+    myfile.fits[compress]  - default Rice compression, row by row 
+    myfile.fits[compress TYPE] -  the first letter of TYPE defines the
+                                  compression algorithm:
+                                   R = Rice
+                                   G = GZIP
+                                   P = PLIO
+
+    myfile.fits[compress TYPE 100,100] - the numbers give the dimensions
+                                         of the compression tiles.  Default
+                                         is NAXIS1, 1, 1, ...
+
+    myfile.fits[compress; 5]               The number following the semicolon
+    mufile.fits[compress TYPE; 5]          gives the value of the noisebits
+    myfile.fits[compress TYPE 100,100; 5]  parameter that is used when
+                                           quantizing floating point images.
+
+The compression parameters are saved in the fptr->Fptr structure for use
+when writing FITS images.
+
 */
 {
-    int driver, slen, clobber;
-    char *url;
-    char urltype[MAX_PREFIX_LEN], outfile[FLEN_FILENAME];
-    char tmplfile[FLEN_FILENAME];
-    int handle;
+    char *ptr1;
 
-    if (*status > 0)
-        return(*status);
+    /* initialize with default values */
+    int ii, compresstype = RICE_1, noisebits = 4;
+    long tilesize[9] = {0,1,1,1,1,1,1,1,1};
 
-    *fptr = 0;              /* initialize null file pointer */
+    ptr1 = compspec;
+    while (*ptr1 == ' ')    /* ignore leading blanks */
+           ptr1++;
 
-    if (need_to_initialize)            /* this is called only once */
-       *status = fits_init_cfitsio();
+    if (strncmp(ptr1, "compress", 8) && strncmp(ptr1, "COMPRESS", 8) )
+    {
+       /* apparently this string does not specify compression parameters */
+       return(*status = URL_PARSE_ERROR);
+    }
 
-    if (*status > 0)
-        return(*status);
+    ptr1 += 8;
+    while (*ptr1 == ' ')    /* ignore leading blanks */
+           ptr1++;
 
-    url = (char *) name;
-    while (*url == ' ')  /* ignore leading spaces in the filename */
-        url++;
+    /* ========================= */
+    /* look for compression type */
+    /* ========================= */
 
-    if (*url == '\0')
+    if (*ptr1 == 'r' || *ptr1 == 'R')
     {
-        ffpmsg("Name of file to create is blank. (ffinit)");
-        return(*status = FILE_NOT_CREATED);
+        compresstype = RICE_1;
+        while (*ptr1 != ' ' && *ptr1 != ';' && *ptr1 != '\0') 
+           ptr1++;
     }
+    else if (*ptr1 == 'g' || *ptr1 == 'G')
+    {
+        compresstype = GZIP_1;
+        while (*ptr1 != ' ' && *ptr1 != ';' && *ptr1 != '\0') 
+           ptr1++;
 
-    /* check for clobber symbol, i.e,  overwrite existing file */
-    if (*url == '!')
+    }
+    else if (*ptr1 == 'p' || *ptr1 == 'P')
     {
-        clobber = TRUE;
-        url++;
+        compresstype = PLIO_1;
+        while (*ptr1 != ' ' && *ptr1 != ';' && *ptr1 != '\0') 
+           ptr1++;
     }
-    else
-        clobber = FALSE;
 
-        /* parse the output file specification */
-    ffourl(url, urltype, outfile, tmplfile, status);
+    /* ======================== */
+    /* look for tile dimensions */
+    /* ======================== */
 
-    if (*status > 0)
+    while (*ptr1 == ' ')    /* ignore leading blanks */
+           ptr1++;
+
+    ii = 0;
+    while (isdigit( (int) *ptr1) && ii < 9)
     {
-        ffpmsg("could not parse the output filename: (ffinit)");
+       tilesize[ii] = atol(ptr1);  /* read the integer value */
+       ii++;
+
+       while (isdigit((int) *ptr1))    /* skip over the integer */
+           ptr1++;
+
+       if (*ptr1 == ',')
+           ptr1++;   /* skip over the comma */
+          
+       while (*ptr1 == ' ')    /* ignore leading blanks */
+           ptr1++;
+    }
+
+    /* ============================= */
+    /* look for noise bits parameter */
+    /* ============================= */
+
+    if (*ptr1 == ';')
+    {
+        ptr1++;
+
+        while (*ptr1 == ' ')    /* ignore leading blanks */
+           ptr1++;
+
+       if (!isdigit((int) *ptr1) )
+           return(*status = URL_PARSE_ERROR);
+
+       noisebits = atol(ptr1);  /* read the integer value */
+
+       while (isdigit((int) *ptr1))    /* skip over the integer */
+           ptr1++;
+    }
+
+    while (*ptr1 == ' ')    /* ignore leading blanks */
+         ptr1++;
+
+    if (*ptr1 != 0)  /* remaining junk in the string?? */
+       return(*status = URL_PARSE_ERROR);
+
+    /* ================================= */
+    /* finished parsing; save the values */
+    /* ================================= */
+
+    (fptr->Fptr)->request_compress_type = compresstype;
+    for (ii = 0; ii < 9; ii++)
+       (fptr->Fptr)->request_tilesize[ii] = tilesize[ii];
+    (fptr->Fptr)->request_rice_nbits = noisebits;
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffinit(fitsfile **fptr,      /* O - FITS file pointer                   */
+           const char *name,     /* I - name of file to create              */
+           int *status)          /* IO - error status                       */
+/*
+  Create and initialize a new FITS file.
+*/
+{
+    int driver, slen, clobber;
+    char *url;
+    char urltype[MAX_PREFIX_LEN], outfile[FLEN_FILENAME];
+    char tmplfile[FLEN_FILENAME], compspec[80];
+    int handle;
+
+    if (*status > 0)
+        return(*status);
+
+    *fptr = 0;              /* initialize null file pointer */
+
+    if (need_to_initialize)            /* this is called only once */
+       *status = fits_init_cfitsio();
+
+    if (*status > 0)
+        return(*status);
+
+    url = (char *) name;
+    while (*url == ' ')  /* ignore leading spaces in the filename */
+        url++;
+
+    if (*url == '\0')
+    {
+        ffpmsg("Name of file to create is blank. (ffinit)");
+        return(*status = FILE_NOT_CREATED);
+    }
+
+    /* check for clobber symbol, i.e,  overwrite existing file */
+    if (*url == '!')
+    {
+        clobber = TRUE;
+        url++;
+    }
+    else
+        clobber = FALSE;
+
+        /* parse the output file specification */
+    ffourl(url, urltype, outfile, tmplfile, compspec, status);
+
+    if (*status > 0)
+    {
+        ffpmsg("could not parse the output filename: (ffinit)");
         ffpmsg(url);
         return(*status);
     }
@@ -2102,7 +2673,7 @@ int ffinit(fitsfile **fptr,      /* O - FITS file pointer                   */
         *status = (*driverTable[driver].create)(outfile, &handle);
         if (*status)
         {
-            ffpmsg("failed to create the following file: (ffinit)");
+            ffpmsg("failed to create new file (already exists?):");
             ffpmsg(url);
             return(*status);
        }
@@ -2153,7 +2724,23 @@ int ffinit(fitsfile **fptr,      /* O - FITS file pointer                   */
         return(*status = FILE_NOT_CREATED);
     }
 
+    /* mem for headstart array */
+    ((*fptr)->Fptr)->headstart = (OFF_T *) calloc(1001, sizeof(OFF_T)); 
+
+    if ( !(((*fptr)->Fptr)->headstart) )
+    {
+        (*driverTable[driver].close)(handle);  /* close the file */
+        ffpmsg("failed to allocate memory for headstart array: (ffinit)");
+        ffpmsg(url);
+        free( ((*fptr)->Fptr)->filename);
+        free((*fptr)->Fptr);
+        free(*fptr);
+        *fptr = 0;              /* return null file pointer */
+        return(*status = MEMORY_ALLOCATION);
+    }
+
         /* store the parameters describing the file */
+    ((*fptr)->Fptr)->MAXHDU = 1000;              /* initial size of headstart */
     ((*fptr)->Fptr)->filehandle = handle;        /* store the file pointer */
     ((*fptr)->Fptr)->driver = driver;            /*  driver number         */
     strcpy(((*fptr)->Fptr)->filename, url);      /* full input filename    */
@@ -2167,10 +2754,17 @@ int ffinit(fitsfile **fptr,      /* O - FITS file pointer                   */
 
     ffldrc(*fptr, 0, IGNORE_EOF, status);     /* initialize first record */
 
+    fits_store_Fptr( (*fptr)->Fptr, status);  /* store Fptr address */
+
     /* if template file was given, use it to define structure of new file */
+
     if (tmplfile[0])
         ffoptplt(*fptr, tmplfile, status);
 
+    /* parse and save image compression specification, if given */
+    if (compspec[0])
+        ffparsecompspec(*fptr, compspec, status);
+
     return(*status);                       /* successful return */
 }
 /*--------------------------------------------------------------------------*/
@@ -2257,7 +2851,22 @@ int ffimem(fitsfile **fptr,      /* O - FITS file pointer                   */
         return(*status = MEMORY_ALLOCATION);
     }
 
+    /* mem for headstart array */
+    ((*fptr)->Fptr)->headstart = (OFF_T *) calloc(1001, sizeof(OFF_T)); 
+
+    if ( !(((*fptr)->Fptr)->headstart) )
+    {
+        (*driverTable[driver].close)(handle);  /* close the file */
+        ffpmsg("failed to allocate memory for headstart array: (ffinit)");
+        free( ((*fptr)->Fptr)->filename);
+        free((*fptr)->Fptr);
+        free(*fptr);
+        *fptr = 0;              /* return null file pointer */
+        return(*status = MEMORY_ALLOCATION);
+    }
+
         /* store the parameters describing the file */
+    ((*fptr)->Fptr)->MAXHDU = 1000;              /* initial size of headstart */
     ((*fptr)->Fptr)->filehandle = handle;        /* file handle */
     ((*fptr)->Fptr)->driver = driver;            /* driver number */
     strcpy(((*fptr)->Fptr)->filename, "memfile"); /* dummy filename */
@@ -2270,6 +2879,7 @@ int ffimem(fitsfile **fptr,      /* O - FITS file pointer                   */
     ((*fptr)->Fptr)->validcode = VALIDSTRUC; /* flag denoting valid structure */
 
     ffldrc(*fptr, 0, IGNORE_EOF, status);     /* initialize first record */
+    fits_store_Fptr( (*fptr)->Fptr, status);  /* store Fptr address */
     return(*status); 
 }
 /*--------------------------------------------------------------------------*/
@@ -2304,7 +2914,7 @@ int fits_init_cfitsio(void)
 
     /* register the standard I/O drivers that are always available */
 
-    /*--------------------disk file driver-----------------------*/
+    /* 1--------------------disk file driver-----------------------*/
     status = fits_register_driver("file://", 
             file_init,
             file_shutdown,
@@ -2333,7 +2943,7 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*------------ output temporary memory file driver -----------------------*/
+    /* 2------------ output temporary memory file driver ----------------*/
     status = fits_register_driver("mem://", 
             mem_init,
             mem_shutdown,
@@ -2359,7 +2969,7 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*--------------input pre-existing memory file driver------------------*/
+    /* 3--------------input pre-existing memory file driver----------------*/
     status = fits_register_driver("memkeep://", 
             mem_init,
             mem_shutdown,
@@ -2385,7 +2995,7 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-   /*-------------------stdin stream driver----------------------*/
+   /* 4-------------------stdin stream driver----------------------*/
    /*  the stdin stream is copied to memory then opened in memory */
 
     status = fits_register_driver("stdin://", 
@@ -2412,8 +3022,8 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-   /*-------------------stdin file stream driver----------------------*/
-   /*  the stdin stream is copied to a disk file, then the disk file is opened */
+   /* 5-------------------stdin file stream driver----------------------*/
+   /*  the stdin stream is copied to a disk file then the disk file is opened */
 
     status = fits_register_driver("stdinfile://", 
             mem_init,
@@ -2439,12 +3049,12 @@ int fits_init_cfitsio(void)
 
     if (status)
     {
-        ffpmsg("failed to register the stdin:// driver (init_cfitsio)");
+        ffpmsg("failed to register the stdinfile:// driver (init_cfitsio)");
         return(status);
     }
 
 
-    /*-----------------------stdout stream driver------------------*/
+    /* 6-----------------------stdout stream driver------------------*/
     status = fits_register_driver("stdout://",
             mem_init,
             mem_shutdown,
@@ -2469,7 +3079,7 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*------------------iraf disk file to memory driver -----------*/
+    /* 7------------------iraf disk file to memory driver -----------*/
     status = fits_register_driver("irafmem://",
             mem_init,
             mem_shutdown,
@@ -2494,7 +3104,32 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*------------------compressed disk file to memory driver -----------*/
+    /* 8------------------raw binary file to memory driver -----------*/
+    status = fits_register_driver("rawfile://",
+            mem_init,
+            mem_shutdown,
+            mem_setoptions,
+            mem_getoptions, 
+            mem_getversion,
+            NULL,            /* checkfile not needed */ 
+            mem_rawfile_open,
+            NULL,            /* create function not required */
+            mem_truncate,
+            mem_close_free,
+            NULL,            /* remove function not required */
+            mem_size,
+            NULL,            /* flush function not required */
+            mem_seek,
+            mem_read,
+            mem_write);
+
+    if (status)
+    {
+        ffpmsg("failed to register the rawfile:// driver (init_cfitsio)");
+        return(status);
+    }
+
+    /* 9------------------compressed disk file to memory driver -----------*/
     status = fits_register_driver("compress://",
             mem_init,
             mem_shutdown,
@@ -2519,7 +3154,34 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*------------------compressed disk file to disk file driver -------*/
+    /* 10------------------compressed disk file to memory driver -----------*/
+    /*  Identical to compress://, except it allows READWRITE access      */
+
+    status = fits_register_driver("compressmem://",
+            mem_init,
+            mem_shutdown,
+            mem_setoptions,
+            mem_getoptions, 
+            mem_getversion,
+            NULL,            /* checkfile not needed */ 
+            mem_compress_openrw,
+            NULL,            /* create function not required */
+            mem_truncate,
+            mem_close_free,
+            NULL,            /* remove function not required */
+            mem_size,
+            NULL,            /* flush function not required */
+            mem_seek,
+            mem_read,
+            mem_write);
+
+    if (status)
+    {
+        ffpmsg("failed to register the compressmem:// driver (init_cfitsio)");
+        return(status);
+    }
+
+    /* 11------------------compressed disk file to disk file driver -------*/
     status = fits_register_driver("compressfile://",
             file_init,
             file_shutdown,
@@ -2548,11 +3210,38 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
+    /* 12---create file in memory, then compress it to disk file on close--*/
+    status = fits_register_driver("compressoutfile://", 
+            mem_init,
+            mem_shutdown,
+            mem_setoptions,
+            mem_getoptions, 
+            mem_getversion,
+            NULL,            /* checkfile not needed */
+            NULL,            /* open function not allowed */
+            mem_create_comp, 
+            mem_truncate,
+            mem_close_comp,
+            file_remove,     /* delete existing compressed disk file */
+            mem_size,
+            NULL,            /* flush function not required */
+            mem_seek,
+            mem_read,
+            mem_write);
+
+
+    if (status)
+    {
+        ffpmsg(
+        "failed to register the compressoutfile:// driver (init_cfitsio)");
+        return(status);
+    }
+
     /* Register Optional drivers */
 
 #ifdef HAVE_NET_SERVICES
 
-    /*--------------------root driver-----------------------*/
+    /* 13--------------------root driver-----------------------*/
 
     status = fits_register_driver("root://",
 				  root_init,
@@ -2578,7 +3267,7 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*--------------------http  driver-----------------------*/
+    /* 14--------------------http  driver-----------------------*/
     status = fits_register_driver("http://",
             mem_init,
             mem_shutdown,
@@ -2603,7 +3292,7 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*--------------------http file driver-----------------------*/
+    /* 15--------------------http file driver-----------------------*/
 
     status = fits_register_driver("httpfile://",
             file_init,
@@ -2633,7 +3322,33 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*--------------------httpcompress file driver-----------------------*/
+    /* 16--------------------http memory driver-----------------------*/
+    /*  same as http:// driver, except memory file can be opened READWRITE */
+    status = fits_register_driver("httpmem://",
+            mem_init,
+            mem_shutdown,
+            mem_setoptions,
+            mem_getoptions, 
+            mem_getversion,
+            http_checkfile,
+            http_file_open,  /* this will simply call http_open */
+            NULL,            /* create function not required */
+            mem_truncate,
+            mem_close_free,
+            NULL,            /* remove function not required */
+            mem_size,
+            NULL,            /* flush function not required */
+            mem_seek,
+            mem_read,
+            mem_write);
+
+    if (status)
+    {
+        ffpmsg("failed to register the httpmem:// driver (init_cfitsio)");
+        return(status);
+    }
+
+    /* 17--------------------httpcompress file driver-----------------------*/
 
     status = fits_register_driver("httpcompress://",
             mem_init,
@@ -2660,7 +3375,7 @@ int fits_init_cfitsio(void)
     }
 
 
-    /*--------------------ftp driver-----------------------*/
+    /* 18--------------------ftp driver-----------------------*/
     status = fits_register_driver("ftp://",
             mem_init,
             mem_shutdown,
@@ -2685,7 +3400,7 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*--------------------ftp file driver-----------------------*/
+    /* 19--------------------ftp file driver-----------------------*/
     status = fits_register_driver("ftpfile://",
             file_init,
             file_shutdown,
@@ -2714,7 +3429,33 @@ int fits_init_cfitsio(void)
         return(status);
     }
 
-    /*--------------------ftp compressed file driver------------------*/
+    /* 20--------------------ftp mem driver-----------------------*/
+    /*  same as ftp:// driver, except memory file can be opened READWRITE */
+    status = fits_register_driver("ftpmem://",
+            mem_init,
+            mem_shutdown,
+            mem_setoptions,
+            mem_getoptions, 
+            mem_getversion,
+            ftp_checkfile,
+            ftp_file_open,   /* this will simply call ftp_open */
+            NULL,            /* create function not required */
+            mem_truncate,
+            mem_close_free,
+            NULL,            /* remove function not required */
+            mem_size,
+            NULL,            /* flush function not required */
+            mem_seek,
+            mem_read,
+            mem_write);
+
+    if (status)
+    {
+        ffpmsg("failed to register the ftpmem:// driver (init_cfitsio)");
+        return(status);
+    }
+
+    /* 21--------------------ftp compressed file driver------------------*/
     status = fits_register_driver("ftpcompress://",
             mem_init,
             mem_shutdown,
@@ -2745,7 +3486,7 @@ int fits_init_cfitsio(void)
 
 #ifdef HAVE_SHMEM_SERVICES
 
-    /*--------------------shared memory driver-----------------------*/
+    /* 22--------------------shared memory driver-----------------------*/
     status = fits_register_driver("shmem://", 
             smem_init,
             smem_shutdown,
@@ -2774,8 +3515,6 @@ int fits_init_cfitsio(void)
 
 /* ==================== END OF SHARED MEMORY DRIVER SECTION ================ */
 
-
-
     return(status);
 }
 /*--------------------------------------------------------------------------*/
@@ -2802,7 +3541,7 @@ int fits_register_driver(char *prefix,
 {
     int status;
 
-    if (no_of_drivers + 1 == MAX_DRIVERS)
+    if (no_of_drivers + 1 > MAX_DRIVERS)
         return(TOO_MANY_DRIVERS);
 
     if (prefix  == NULL)
@@ -2840,22 +3579,25 @@ int fits_register_driver(char *prefix,
     return(0);
  }
 /*--------------------------------------------------------------------------*/
-int ffiurl(char *url, 
-                    char *urltype,
-                    char *infilex,
-                    char *outfile, 
-                    char *extspec,
-                    char *rowfilterx,
-                    char *binspec,
-                    char *colspec,
-                    int *status)
+int ffiurl(char *url,               /* input filename */
+           char *urltype,    /* e.g., 'file://', 'http://', 'mem://' */
+           char *infilex,    /* root filename (may be complete path) */
+           char *outfile,    /* optional output file name            */
+           char *extspec,    /* extension spec: +n or [extname, extver]  */
+           char *rowfilterx, /* boolean row filter expression */
+           char *binspec,    /* histogram binning specifier   */
+           char *colspec,    /* column or keyword modifier expression */
+           int *status)
 /*
    parse the input URL into its basic components.
+   This routine is big and ugly and should be redesigned someday!
 */
-
 { 
     int ii, jj, slen, infilelen, plus_ext = 0, collen;
     char *ptr1, *ptr2, *ptr3, *tmptr;
+    int hasAt, hasDot, hasOper, followingOper, spaceTerm, rowFilter;
+    int colStart, binStart;
+
 
     /* must have temporary variable for these, in case inputs are NULL */
     char *infile;
@@ -2865,59 +3607,64 @@ int ffiurl(char *url,
     if (*status > 0)
         return(*status);
 
-    if (infilex)
-        *infilex  = '\0';
-    if (rowfilterx)
-        *rowfilterx = '\0';
-
-    if (urltype)
-        *urltype = '\0';
-    if (outfile)
-        *outfile = '\0';
-    if (extspec)
-        *extspec = '\0';
-    if (binspec)
-        *binspec = '\0';
-    if (colspec)
-        *colspec = '\0';
-
+    /* Initialize null strings */
+    if (infilex) *infilex  = '\0';
+    if (urltype) *urltype = '\0';
+    if (outfile) *outfile = '\0';
+    if (extspec) *extspec = '\0';
+    if (binspec) *binspec = '\0';
+    if (colspec) *colspec = '\0';
+    if (rowfilterx) *rowfilterx = '\0';
+ 
     slen = strlen(url);
 
     if (slen == 0)       /* blank filename ?? */
         return(*status);
 
     /* allocate memory for 3 strings, each as long as the input url */
-    infile = (char *) malloc(3 * (slen + 1) );
+    infile = (char *) calloc(3,  slen + 1);
     if (!infile)
        return(*status = MEMORY_ALLOCATION);
 
     rowfilter = &infile[slen + 1];
     tmpstr = &rowfilter[slen + 1];
 
-    *infile = '\0';
-    *rowfilter = '\0';
-    *tmpstr = '\0';
-
     ptr1 = url;
 
-        /*  get urltype (e.g., file://, ftp://, http://, etc.)  */
-    if (*ptr1 == '-' && 
-                     ( *(ptr1 +1) ==  0   || *(ptr1 +1) == ' ' || 
-                       *(ptr1 +1) == '['  || *(ptr1 +1) == '(' ) )
+    /* -------------------------------------------------------- */
+    /*  get urltype (e.g., file://, ftp://, http://, etc.)  */
+    /* --------------------------------------------------------- */
 
-         /* "-" means read file from stdin */
-         /* also support "- ", "-[extname]" and '-(outfile.fits)"    */
-         /* but exclude disk file names that begin with a minus sign */
-         /* e.g., "-55d33m.fits"   */
+    if (*ptr1 == '-' && ( *(ptr1 +1) ==  0   || *(ptr1 +1) == ' '  || 
+                          *(ptr1 +1) == '['  || *(ptr1 +1) == '(' ) )
     {
+        /* "-" means read file from stdin. Also support "- ",        */
+        /* "-[extname]" and '-(outfile.fits)" but exclude disk file  */
+        /* names that begin with a minus sign, e.g., "-55d33m.fits"  */
+
         if (urltype)
             strcat(urltype, "stdin://");
         ptr1++;
     }
+    else if (!strncasecmp(ptr1, "stdin", 5))
+    {
+        if (urltype)
+            strcat(urltype, "stdin://");
+        ptr1 = ptr1 + 5;
+    }
     else
     {
         ptr2 = strstr(ptr1, "://");
-        if (ptr2)                  /* copy the explicit urltype string */ 
+        ptr3 = strstr(ptr1, "(" );
+
+        if (ptr3 && (ptr3 < ptr2) )
+        {
+           /* the urltype follows a '(' character, so it must apply */
+           /* to the output file, and is not the urltype of the input file */
+           ptr2 = 0;   /* so reset pointer to zero */
+        }
+
+        if (ptr2)            /* copy the explicit urltype string */ 
         {
             if (urltype)
                  strncat(urltype, ptr1, ptr2 - ptr1 + 3);
@@ -2960,8 +3707,40 @@ int ffiurl(char *url,
         }
     }
 
+    /* ----------------------------------------------------------    
+       If this is a http:// type file, then the cgi file name could
+       include the '[' character, which should not be interpreted
+       as part of CFITSIO's Extended File Name Syntax.  Test for this
+       case by seeing if the last character is a ']' or ')'.  If it 
+       is not, then just treat the whole input string as the file name
+       and do not attempt to interprete the name using the extended
+       filename syntax.
+     ----------------------------------------------------------- */
+
+    if (urltype && !strncmp(urltype, "http://", 7) )
+    {
+        /* test for opening parenthesis or bracket in the file name */
+        if( strchr(ptr1, '(' ) || strchr(ptr1, '[' ) )
+        {
+            slen = strlen(ptr1);
+            ptr3 = ptr1 + slen - 1;
+            while (*ptr3 == ' ')    /* ignore trailing blanks */
+                ptr3--;
+
+            if (*ptr3 != ']' && *ptr3 != ')' )
+            {
+                /* name doesn't end with a ']' or ')' so don't try */
+                /* to parse this unusual string (may be cgi string)  */
+                if (infilex)
+                    strcpy(infilex, ptr1);
 
-    /*
+                free(infile);
+                return(*status);
+            }
+        }
+    }
+
+    /* ----------------------------------------------------------    
        Look for VMS style filenames like: 
             disk:[directory.subdirectory]filename.ext, or
                  [directory.subdirectory]filename.ext
@@ -2970,7 +3749,7 @@ int ffiurl(char *url,
        or if there is a ':[' string in the remaining url string. If
        so, then need to move past this bracket character before
        search for the opening bracket of a filter specification.
-    */
+     ----------------------------------------------------------- */
 
     tmptr = ptr1;
     if (*ptr1 == '[')
@@ -2987,7 +3766,10 @@ int ffiurl(char *url,
           tmptr = ptr1;
     }
 
+    /* ------------------------ */
     /*  get the input file name */
+    /* ------------------------ */
+
     ptr2 = strchr(tmptr, '(');   /* search for opening parenthesis ( */
     ptr3 = strchr(tmptr, '[');   /* search for opening bracket [ */
 
@@ -2995,7 +3777,8 @@ int ffiurl(char *url,
     {
         strcat(infile, ptr1);
     }
-    else if (!ptr3)     /* no bracket, so () enclose output file name */
+    else if (!ptr3 ||         /* no bracket, so () enclose output file name */
+         (ptr2 && (ptr2 < ptr3)) ) /* () enclose output name before bracket */
     {
         strncat(infile, ptr1, ptr2 - ptr1);
         ptr2++;
@@ -3009,21 +3792,12 @@ int ffiurl(char *url,
 
         if (outfile)
             strncat(outfile, ptr2, ptr1 - ptr2);
-    }
-    else if (ptr2 && (ptr2 < ptr3)) /* () enclose output name before bracket */
-    {
-        strncat(infile, ptr1, ptr2 - ptr1);
-        ptr2++;
 
-        ptr1 = strchr(ptr2, ')' );   /* search for closing ) */
-        if (!ptr1)
-        {
-            free(infile);
-            return(*status = URL_PARSE_ERROR);  /* error, no closing ) */
-        }
+        /* the opening [ could have been part of output name,    */
+        /*      e.g., file(out[compress])[3][#row > 5]           */
+        /* so search again for opening bracket following the closing ) */
+        ptr3 = strchr(ptr1, '[');
 
-        if (outfile)
-            strncat(outfile, ptr2, ptr1 - ptr2);
     }
     else    /*   bracket comes first, so there is no output name */
     {
@@ -3031,25 +3805,16 @@ int ffiurl(char *url,
     }
 
    /* strip off any trailing blanks in the names */
+
     slen = strlen(infile);
-    for (ii = slen - 1; ii > 0; ii--)   
-    {
-            if (infile[ii] == ' ')
-                infile[ii] = '\0';
-            else
-                break;
-    }
+    while ( (--slen) > 0  && infile[slen] == ' ') 
+         infile[slen] = '\0';
 
     if (outfile)
     {
         slen = strlen(outfile);
-        for (ii = slen - 1; ii > 0; ii--)   
-        {
-            if (outfile[ii] == ' ')
-                outfile[ii] = '\0';
-            else
-                break;
-        }
+        while ( (--slen) > 0  && outfile[slen] == ' ') 
+            outfile[slen] = '\0';
     }
 
     /* --------------------------------------------- */
@@ -3075,7 +3840,7 @@ int ffiurl(char *url,
             break;
     }
 
-    if (ii > 0 && (jj - ii) < 5)  /* limit extension numbers to 4 digits */
+    if (ii > 0 && (jj - ii) < 6)  /* limit extension numbers to 4 digits */
     {
         infilelen = ii;
         ii++;
@@ -3100,13 +3865,16 @@ int ffiurl(char *url,
         }
     }
 
+    /* -------------------------------------------------------------------- */
     /* if '*' was given for the output name expand it to the root file name */
+    /* -------------------------------------------------------------------- */
+
     if (outfile && outfile[0] == '*')
     {
         /* scan input name backwards to the first '/' character */
         for (ii = jj - 1; ii >= 0; ii--)
         {
-            if (infile[ii] == '/')
+            if (infile[ii] == '/' || ii == 0)
             {
                 strcpy(outfile, &infile[ii + 1]);
                 break;
@@ -3114,11 +3882,16 @@ int ffiurl(char *url,
         }
     }
 
+    /* ------------------------------------------ */
     /* copy strings from local copy to the output */
+    /* ------------------------------------------ */
     if (infilex)
         strcpy(infilex, infile);
 
-    if (!ptr3)     /* no [ character in the input string? */
+    /* ---------------------------------------------------------- */
+    /* if no '[' character in the input string, then we are done. */
+    /* ---------------------------------------------------------- */
+    if (!ptr3) 
     {
         free(infile);
         return(*status);
@@ -3131,6 +3904,10 @@ int ffiurl(char *url,
     if (!plus_ext) /* extension no. not already specified?  Then      */
                    /* first brackets must enclose extension name or # */
                    /* or it encloses a image subsection specification */
+                   /* or a raw binary image specifier */
+
+                   /* Or, the extension specification may have been */
+                   /* omitted and we have to guess what the user intended */
     {
        ptr1 = ptr3 + 1;    /* pointer to first char after the [ */
 
@@ -3142,8 +3919,78 @@ int ffiurl(char *url,
             return(*status = URL_PARSE_ERROR);  /* error, no closing ] */
        }
 
-       /* test if this is an image section:  an integer followed by ':' */
-       /*  or a '*' or '-*'  */
+       /* ---------------------------------------------- */
+       /* First, test if this is a rawfile specifier     */
+       /* which looks something like: '[ib512,512:2880]' */
+       /* Test if first character is b,i,j,d,r,f, or u,  */
+       /* and optional second character is b or l,       */
+       /* followed by one or more digits,                */
+       /* finally followed by a ',', ':', or ']'         */
+       /* ---------------------------------------------- */
+
+       if (*ptr1 == 'b' || *ptr1 == 'B' || *ptr1 == 'i' || *ptr1 == 'I' ||
+           *ptr1 == 'j' || *ptr1 == 'J' || *ptr1 == 'd' || *ptr1 == 'D' ||
+           *ptr1 == 'r' || *ptr1 == 'R' || *ptr1 == 'f' || *ptr1 == 'F' ||
+           *ptr1 == 'u' || *ptr1 == 'U')
+       {
+           /* next optional character may be a b or l (for Big or Little) */
+           ptr1++;
+           if (*ptr1 == 'b' || *ptr1 == 'B' || *ptr1 == 'l' || *ptr1 == 'L')
+              ptr1++;
+
+           if (isdigit((int) *ptr1))  /* must have at least 1 digit */
+           {
+             while (isdigit((int) *ptr1))
+              ptr1++;             /* skip over digits */
+
+             if (*ptr1 == ',' || *ptr1 == ':' || *ptr1 == ']' )
+             {
+               /* OK, this looks like a rawfile specifier */
+
+               if (urltype)
+               {
+                 if (strstr(urltype, "stdin") )
+                   strcpy(urltype, "rawstdin://");
+                 else
+                   strcpy(urltype, "rawfile://");
+               }
+
+               /* append the raw array specifier to infilex */
+               if (infilex)
+               {
+                 strcat(infilex, ptr3);
+                 ptr1 = strchr(infilex, ']'); /* find the closing ] char */
+                 if (ptr1)
+                   *(ptr1 + 1) = '\0';  /* terminate string after the ] */
+               }
+
+               if (extspec)
+                  strcpy(extspec, "0"); /* the 0 ext number is implicit */
+
+               tmptr = strchr(ptr2 + 1, '[' ); /* search for another [ char */ 
+
+               /* copy any remaining characters into rowfilterx  */
+               if (tmptr && rowfilterx)
+               {
+                 strcat(rowfilterx, tmptr + 1);
+
+                 tmptr = strchr(rowfilterx, ']' );   /* search for closing ] */
+                 if (tmptr)
+                   *tmptr = '\0'; /* overwrite the ] with null terminator */
+               }
+
+               free(infile);        /* finished parsing, so return */
+               return(*status);
+             }
+           }   
+       }        /* end of rawfile specifier test */
+
+       /* -------------------------------------------------------- */
+       /* Not a rawfile, so next, test if this is an image section */
+       /* i.e., an integer followed by a ':' or a '*' or '-*'      */
+       /* -------------------------------------------------------- */
+ 
+       ptr1 = ptr3 + 1;    /* reset pointer to first char after the [ */
        tmptr = ptr1;
 
        while (*tmptr == ' ')
@@ -3155,34 +4002,188 @@ int ffiurl(char *url,
        if (*tmptr == ':' || *tmptr == '*' || *tmptr == '-')
        {
            /* this is an image section specifier */
-           if (extspec)
-              strcpy(extspec, "0"); /* the 0 extension number is implicit */
            strcat(rowfilter, ptr3);
+/*
+  don't want to assume 0 extension any more; may imply an image extension.
+           if (extspec)
+              strcpy(extspec, "0");
+*/
        }
        else
        {
-           /* copy the extension specification */
-           if (extspec)
-               strncat(extspec, ptr1, ptr2 - ptr1);
+       /* ----------------------------------------------------------------- 
+         Not an image section or rawfile spec so may be an extension spec. 
+
+         Examples of valid extension specifiers:
+            [3]                - 3rd extension; 0 = primary array
+            [events]           - events extension
+            [events, 2]        - events extension, with EXTVER = 2
+            [events,2]         - spaces are optional
+            [events, 3, b]     - same as above, plus XTENSION = 'BINTABLE'
+            [PICS; colName(12)] - an image in row 12 of the colName column
+                                      in the PICS table extension             
+            [PICS; colName(exposure > 1000)] - as above, but find image in
+                          first row with with exposure column value > 1000.
+            [Rate Table] - extension name can contain spaces!
+            [Rate Table;colName(exposure>1000)]
+
+         Examples of other types of specifiers (Not extension specifiers)
+
+            [bin]  !!! this is ambiguous, and can't be distinguished from
+                       a valid extension specifier
+            [bini X=1:512:16]  (also binb, binj, binr, and bind are allowed)
+            [binr (X,Y) = 5]
+            [bin @binfilter.txt]
+
+            [col Time;rate]
+            [col PI=PHA * 1.1]
+            [col -Time; status]
+
+            [X > 5]
+            [X>5]
+            [@filter.txt]
+            [StatusCol]  !!! this is ambiguous, and can't be distinguished
+                       from a valid extension specifier
+            [StatusCol==0]
+            [StatusCol || x>6]
+            [gtifilter()]
+            [regfilter("region.reg)]
+
+         There will always be some ambiguity between an extension name and 
+         a boolean row filtering expression, (as in a couple of the above
+         examples).  If there is any doubt, the expression should be treated
+         as an extension specification;  The user can always add an explicit
+         expression specifier to override this interpretation.
+
+         The following decision logic will be used:
+
+         1) locate the first token, terminated with a space, comma, 
+            semi-colon, or closing bracket.
+
+         2) the token is not part of an extension specifier if any of
+            the following is true:
+
+            - if the token begins with '@' and contains a '.'
+            - if the token contains an operator: = > < || && 
+            - if the token begins with "gtifilter(" or "regfilter(" 
+            - if the token is terminated by a space and is followed by
+               additional characters (not a ']')  AND any of the following:
+                 - the token is 'col'
+                 - the token is 3 or 4 chars long and begins with 'bin'
+                 - the second token begins with an operator:
+                     ! = < > | & + - * / %
+                 
+
+         3) otherwise, the string is assumed to be an extension specifier
+
+         ----------------------------------------------------------------- */
+
+           tmptr = ptr1;
+           while(*tmptr == ' ')
+               tmptr++;
+
+           hasAt = 0;
+           hasDot = 0;
+           hasOper = 0;
+           followingOper = 0;
+           spaceTerm = 0;
+           rowFilter = 0;
+           colStart = 0;
+           binStart = 0;
+
+           if (*tmptr == '@')  /* test for leading @ symbol */
+               hasAt = 1;
+
+           if ( !strncasecmp(tmptr, "col ", 4) )
+              colStart = 1;
+
+           if ( !strncasecmp(tmptr, "bin", 3) )
+              binStart = 1;
+
+           if ( !strncasecmp(tmptr, "gtifilter(", 10) ||
+                !strncasecmp(tmptr, "regfilter(", 10) )
+           {
+               rowFilter = 1;
+           }
+           else
+           {
+             /* parse the first token of the expression */
+             for (ii = 0; ii < ptr2 - ptr1 + 1; ii++, tmptr++)
+             {
+               if (*tmptr == '.')
+                   hasDot = 1;
+               else if (*tmptr == '=' || *tmptr == '>' || *tmptr == '<' ||
+                   (*tmptr == '|' && *(tmptr+1) == '|') ||
+                   (*tmptr == '&' && *(tmptr+1) == '&') )
+                   hasOper = 1;
+
+               else if (*tmptr == ',' || *tmptr == ';' || *tmptr == ']')
+               {
+                  break;
+               }
+               else if (*tmptr == ' ')   /* a space char? */
+               {
+                  while(*tmptr == ' ')  /* skip spaces */
+                    tmptr++;
+
+                  if (*tmptr == ']') /* is this the end? */
+                     break;  
+
+                  spaceTerm = 1; /* 1st token is terminated by space */
+
+                  /* test if this is a column or binning specifier */
+                  if (colStart || (ii <= 4 && binStart) )
+                     rowFilter = 1;
+                  else
+                  {
+  
+                    /* check if next character is an operator */
+                    if (*tmptr == '=' || *tmptr == '>' || *tmptr == '<' ||
+                      *tmptr == '|' || *tmptr == '&' || *tmptr == '!' ||
+                      *tmptr == '+' || *tmptr == '-' || *tmptr == '*' ||
+                      *tmptr == '/' || *tmptr == '%')
+                       followingOper = 1;
+                  }
+                  break;
+               }
+             }
+           }
 
-           /* copy any remaining chars to filter spec string */
-           strcat(rowfilter, ptr2 + 1);
+           /* test if this is NOT an extension specifier */
+           if ( rowFilter ||
+                (hasAt && hasDot) ||
+                hasOper ||
+                (spaceTerm && followingOper) )
+           {
+               /* this is (probably) not an extension specifier */
+               /* so copy all chars to filter spec string */
+               strcat(rowfilter, ptr3);
+           }
+           else
+           {
+               /* this appears to be a legit extension specifier */
+               /* copy the extension specification */
+               if (extspec)
+                   strncat(extspec, ptr1, ptr2 - ptr1);
+
+               /* copy any remaining chars to filter spec string */
+               strcat(rowfilter, ptr2 + 1);
+           }
        }
-    }
-    else   /* copy all remaining input chars to filter spec */
+    }      /* end of  if (!plus_ext)     */
+    else   
     {
+      /* ------------------------------------------------------------------ */
+      /* already have extension, so this must be a filter spec of some sort */
+      /* ------------------------------------------------------------------ */
+
         strcat(rowfilter, ptr3);
     }
 
     /* strip off any trailing blanks from filter */
     slen = strlen(rowfilter);
-    for (ii = slen - 1; ii > 0; ii--)   
-    {
-        if (rowfilter[ii] == ' ')
-            rowfilter[ii] = '\0';
-        else
-            break;
-    }
+    while ( (--slen) >= 0  && rowfilter[slen] == ' ') 
+         rowfilter[slen] = '\0';
 
     if (!rowfilter[0])
     {
@@ -3302,9 +4303,7 @@ int ffiurl(char *url,
             colspec[collen] = '\0';
  
             while (colspec[--collen] == ' ')
-            {
                 colspec[collen] = '\0';  /* strip trailing blanks */
-            }
         }
 
         /* delete the column selection spec from the row filter string */
@@ -3330,6 +4329,63 @@ int ffiurl(char *url,
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffexist(const char *infile, /* I - input filename or URL */
+            int *exists,        /* O -  2 = a compressed version of file exists */
+	                        /*      1 = yes, disk file exists               */
+	                        /*      0 = no, disk file could not be found    */
+				/*     -1 = infile is not a disk file (could    */
+				/*       be a http, ftp, smem, or stdin file)   */
+            int *status)        /* I/O  status  */
+
+/*
+   test if the input file specifier is an existing file on disk
+   If the specified file can't be found, it then searches for a 
+   compressed version of the file.
+*/
+{
+    FILE *diskfile;
+    char rootname[FLEN_FILENAME];
+    char *ptr1;
+    
+    if (*status > 0)
+        return(*status);
+
+    /* strip off any extname or filters from the name */
+    ffrtnm( (char *)infile, rootname, status);
+
+    ptr1 = strstr(rootname, "://");
+    
+    if (ptr1 || *rootname == '-') {
+        if (!strncmp(rootname, "file", 4) ) {
+	    ptr1 = ptr1 + 3;   /* pointer to start of the disk file name */
+	} else {
+	    *exists = -1;   /* this is not a disk file */
+	    return (*status);
+	}
+    } else {
+        ptr1 = rootname;
+    }
+    
+    /* see if the disk file exists */
+    if (file_openfile(ptr1, 0, &diskfile)) {
+    
+        /* no, couldn't open file, so see if there is a compressed version */
+        if (file_is_compressed(ptr1) ) {
+           *exists = 2;  /* a compressed version of the file exists */
+        } else {
+	   *exists = 0;  /* neither file nor compressed version exist */
+	}
+	
+    } else {
+    
+        /* yes, file exists */
+        *exists = 1; 
+	fclose(diskfile);
+    }
+    	   
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffrtnm(char *url, 
            char *rootname,
            int *status)
@@ -3357,9 +4413,24 @@ int ffrtnm(char *url,
         strcat(urltype, "-");
         ptr1++;
     }
+    else if (!strncmp(ptr1, "stdin", 5) || !strncmp(ptr1, "STDIN", 5))
+    {
+        strcat(urltype, "-");
+        ptr1 = ptr1 + 5;
+    }
     else
     {
         ptr2 = strstr(ptr1, "://");
+        ptr3 = strstr(ptr1, "(" );
+
+        if (ptr3 && (ptr3 < ptr2) )
+        {
+           /* the urltype follows a '(' character, so it must apply */
+           /* to the output file, and is not the urltype of the input file */
+           ptr2 = 0;   /* so reset pointer to zero */
+        }
+
+
         if (ptr2)                  /* copy the explicit urltype string */ 
         {
             strncat(urltype, ptr1, ptr2 - ptr1 + 3);
@@ -3448,11 +4519,12 @@ int ffrtnm(char *url,
             break;
     }
 
-    if (ii != 0 && (jj - ii) < 5)  /* limit extension numbers to 4 digits */
+    if (ii > 0 && (jj - ii) < 5)  /* limit extension numbers to 4 digits */
     {
         infilelen = ii;
         ii++;
 
+
         for (; ii < jj; ii++)
         {
             if (!isdigit((int) infile[ii] ) ) /* are all the chars digits? */
@@ -3477,32 +4549,36 @@ int ffourl(char *url,             /* I - full input URL   */
            char *urltype,          /* O - url type         */
            char *outfile,          /* O - base file name   */
            char *tpltfile,         /* O - template file name, if any */
+           char *compspec,         /* O - compression specification, if any */
            int *status)
 /*
    parse the output URL into its basic components.
 */
 
 { 
-    char *ptr1, *ptr2;
+    char *ptr1, *ptr2, *ptr3;
 
     if (*status > 0)
         return(*status);
 
-    ptr1 = url;
     if (urltype)
       *urltype = '\0';
     if (outfile)
       *outfile = '\0';
     if (tpltfile)
       *tpltfile = '\0';
+    if (compspec)
+      *compspec = '\0';
 
-    /*  get urltype (e.g., file://, ftp://, http://, etc.)  */
-    if (*ptr1 == '-' && 
-                     ( *(ptr1 +1) ==  0   || *(ptr1 +1) == ' ' || 
-                       *(ptr1 +1) == '['  || *(ptr1 +1) == '(' ) )
+    ptr1 = url;
+    while (*ptr1 == ' ')    /* ignore leading blanks */
+           ptr1++;
+
+    if ( ( (*ptr1 == '-') &&  ( *(ptr1 +1) ==  0   || *(ptr1 +1) == ' ' ) )
+         ||  !strcmp(ptr1, "stdout")
+         ||  !strcmp(ptr1, "STDOUT"))
 
-         /* "-" means write to stdout */
-         /* also support "- ", "-[extname]" and '-(outfile.fits)"    */
+         /* "-" means write to stdout;  also support "- "            */
          /* but exclude disk file names that begin with a minus sign */
          /* e.g., "-55d33m.fits"   */
     {
@@ -3511,6 +4587,9 @@ int ffourl(char *url,             /* I - full input URL   */
     }
     else
     {
+        /* not writing to stdout */
+        /*  get urltype (e.g., file://, ftp://, http://, etc.)  */
+
         ptr2 = strstr(ptr1, "://");
         if (ptr2)                  /* copy the explicit urltype string */ 
         {
@@ -3528,11 +4607,24 @@ int ffourl(char *url,             /* I - full input URL   */
         /* look for template file name, enclosed in parenthesis */
         ptr2 = strchr(ptr1, '('); 
 
-        if (ptr2)   /* template file was specified  */
+        /* look for image compression parameters, enclosed in sq. brackets */
+        ptr3 = strchr(ptr1, '['); 
+
+        if (outfile)
         {
-            if (outfile)
-                strncat(outfile, ptr1, ptr2 - ptr1);
+          if (ptr2)   /* template file was specified  */
+             strncat(outfile, ptr1, ptr2 - ptr1);
 
+          else if (ptr3)   /* compression was specified  */
+             strncat(outfile, ptr1, ptr3 - ptr1);
+
+          else  /* no template file or compression */
+             strcpy(outfile, ptr1);
+        }
+
+
+        if (ptr2)   /* template file was specified  */
+        {
             ptr2++;
 
             ptr1 = strchr(ptr2, ')' );   /* search for closing ) */
@@ -3545,10 +4637,36 @@ int ffourl(char *url,             /* I - full input URL   */
             if (tpltfile)
                 strncat(tpltfile, ptr2, ptr1 - ptr2);
         }
-        else  /* no template file */
+        
+        if (ptr3)   /* compression was specified  */
         {
-            if (outfile)
-                strcpy(outfile, ptr1);
+            ptr3++;
+
+            ptr1 = strchr(ptr3, ']' );   /* search for closing ] */
+
+            if (!ptr1)
+            {
+                return(*status = URL_PARSE_ERROR);  /* error, no closing ] */
+            }
+
+            if (compspec)
+                strncat(compspec, ptr3, ptr1 - ptr3);
+        }
+
+        /* check if a .gz compressed output file is to be created */
+        /* by seeing if the filename ends in '.gz'   */
+        if (urltype && outfile)
+        {
+            if (!strcmp(urltype, "file://") )
+            {
+                ptr1 = strstr(outfile, ".gz");
+                if (ptr1)
+                {    /* make sure the ".gz" is at the end of the file name */
+                   ptr1 += 3;
+                   if (*ptr1 ==  0  || *ptr1 == ' '  )
+                      strcpy(urltype, "compressoutfile://");
+                }
+            }
         }
     }
     return(*status);
@@ -3572,7 +4690,8 @@ int ffexts(char *extspec,
 */
     char *ptr1, *ptr2;
     int slen, nvals;
-    char tmpname[FLEN_VALUE];
+    int notint = 1; /* initially assume specified extname is not an integer */
+    char tmpname[FLEN_VALUE], *loc;
 
     *extnum = 0;
     *extname = '\0';
@@ -3590,17 +4709,47 @@ int ffexts(char *extspec,
         ptr1++;
 
     if (isdigit((int) *ptr1))  /* is the extension specification a number? */
+    {
+        notint = 0;  /* looks like extname may actually be the ext. number */
+        *extnum = strtol(ptr1, &loc, 10);  /* read the string as an integer */
+
+        while (*loc == ' ')  /* skip over trailing blanks */
+           loc++;
+
+        /* check for read error, or junk following the integer */
+        if ((*loc != '\0'  ) || (errno == ERANGE) )
+        {
+           *extnum = 0;
+           notint = 1;  /* no, extname was not a simple integer after all */
+        }
+
+        if ( *extnum < 0 || *extnum > 99999)
+        {
+            *extnum = 0;   /* this is not a reasonable extension number */
+            ffpmsg("specified extension number is out of range:");
+            ffpmsg(extspec);
+            return(*status = URL_PARSE_ERROR); 
+        }
+    }
+
+
+/*  This logic was too simple, and failed on extnames like '1000TEMP' 
+    where it would try to move to the 1000th extension
+
+    if (isdigit((int) *ptr1))  
     {
         sscanf(ptr1, "%d", extnum);
         if (*extnum < 0 || *extnum > 9999)
         {
-            *extnum = 0;   /* this is not a reasonable extension number */
+            *extnum = 0;   
             ffpmsg("specified extension number is out of range:");
             ffpmsg(extspec);
             return(*status = URL_PARSE_ERROR); 
         }
     }
-    else
+*/
+
+    if (notint)
     {
            /* not a number, so EXTNAME must be specified, followed by */
            /* optional EXTVERS and XTENSION  values */
@@ -3854,7 +5003,7 @@ int ffimport_file( char *filename,   /* Text file to read                   */
    reallocating memory.
 */
 {
-   int allocLen, totalLen, lineLen;
+   int allocLen, totalLen, llen, eoline;
    char *lines,line[256];
    FILE *aFile;
 
@@ -3862,7 +5011,7 @@ int ffimport_file( char *filename,   /* Text file to read                   */
 
    totalLen =    0;
    allocLen = 1024;
-   lines    = (char *)malloc( (2+allocLen)*sizeof(char) );
+   lines    = (char *)malloc( allocLen * sizeof(char) );
    if( !lines ) {
       ffpmsg("Couldn't allocate memory to hold ASCII file contents.");
       return(*status = MEMORY_ALLOCATION );
@@ -3877,12 +5026,25 @@ int ffimport_file( char *filename,   /* Text file to read                   */
    }
 
    while( fgets(line,256,aFile)!=NULL ) {
-      lineLen = strlen(line);
-      
-      if( line[lineLen-1]=='\n' ) line[--lineLen] = '\0';
+      llen = strlen(line);
+      if ((llen > 1) && (line[0] == '/' && line[1] == '/'))
+          continue;       /* skip comment lines begging with // */
+
+      eoline = 0;
 
-      if( totalLen+lineLen>=allocLen ) {
-         lines = (char *)realloc(lines, (2+(allocLen+=256))*sizeof(char) );
+      /* replace CR and newline chars at end of line with nulls */
+      if ((llen > 0) && (line[llen-1]=='\n' || line[llen-1] == '\r')) {
+          line[--llen] = '\0';
+          eoline = 1;   /* found an end of line character */
+
+          if ((llen > 0) && (line[llen-1]=='\n' || line[llen-1] == '\r')) {
+                 line[--llen] = '\0';
+          }
+      }
+
+      if( totalLen + llen + 3 >= allocLen ) {
+         allocLen += 256;
+         lines = (char *)realloc(lines, allocLen * sizeof(char) );
          if( ! lines ) {
             ffpmsg("Couldn't allocate memory to hold ASCII file contents.");
             *status = MEMORY_ALLOCATION;
@@ -3890,7 +5052,12 @@ int ffimport_file( char *filename,   /* Text file to read                   */
          }
       }
       strcpy( lines+totalLen, line );
-      totalLen += lineLen;
+      totalLen += llen;
+
+      if (eoline) {
+         strcpy( lines+totalLen, " "); /* add a space between lines */
+         totalLen += 1;
+      }
    }
    fclose(aFile);
 
@@ -3930,7 +5097,8 @@ int fits_get_token(char **ptr,
             for (ii = 0; ii < slen; ii++)
             {
                 if ( !isdigit((int) token[ii]) && token[ii] != '.' && 
-                     token[ii] != '-')
+                     token[ii] != '-' && token[ii] != '+' &&
+                     token[ii] != 'E' && token[ii] != 'e')
                 {
                     *isanumber = 0;
                     break;
@@ -3941,6 +5109,60 @@ int fits_get_token(char **ptr,
 
     return(slen);
 }
+/*---------------------------------------------------------------------------*/
+char *fits_split_names(
+   char *list)   /* I   - input list of names */
+{
+/*  
+   A sequence of calls to fits_split_names will split the input string
+   into name tokens.  The string typically contains a list of file or
+   column names.  The names must be delimited by a comma and/or spaces.
+   This routine ignores spaces and commas that occur within parentheses,
+   brackets, or curly brackets.  It also strips any leading and trailing
+   blanks from the returned name.
+
+   This routine is similar to the ANSI C 'strtok' function:
+
+   The first call to fits_split_names has a non-null input string.
+   It finds the first name in the string and terminates it by
+   overwriting the next character of the string with a '\0' and returns
+   a pointer to the name.  Each subsequent call, indicated by a NULL
+   value of the input string, returns the next name, searching from
+   just past the end of the previous name.  It returns NULL when no
+   further names are found.
+
+   The following line illustrates how a string would be split into 3 names:
+    myfile[1][bin (x,y)=4], file2.fits  file3.fits
+    ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^  ^^^^^^^^^^
+      1st name               2nd name    3rd name
+
+*/
+    int depth = 0;
+    char *start;
+    static char *ptr;
+
+    if (list)  /* reset ptr if a string is given */
+        ptr = list;
+
+    while (*ptr == ' ')ptr++;  /* skip leading white space */
+
+    if (*ptr == '\0')return(0);  /* no remaining file names */
+
+    start = ptr;
+
+    while (*ptr != '\0') {
+       if ((*ptr == '[') || (*ptr == '(') || (*ptr == '{')) depth ++;
+       else if ((*ptr == '}') || (*ptr == ')') || (*ptr == ']')) depth --;
+       else if ((depth == 0) && (*ptr == ','  || *ptr == ' ')) {
+          *ptr = '\0';  /* terminate the filename here */
+          ptr++;  /* save pointer to start of next filename */
+          break;  
+       }
+       ptr++;
+    }
+    
+    return(start);
+}
 /*--------------------------------------------------------------------------*/
 int urltype2driver(char *urltype, int *driver)
 /*
@@ -3972,12 +5194,19 @@ int ffclos(fitsfile *fptr,      /* I - FITS file pointer */
   then calling the system dependent routine to physically close the FITS file
 */   
 {
+    int tstatus = NO_CLOSE_ERROR, zerostatus = 0;
+
     if (!fptr)
         return(*status = NULL_INPUT_PTR);
     else if ((fptr->Fptr)->validcode != VALIDSTRUC) /* check for magic value */
         return(*status = BAD_FILEPTR); 
 
-    ffchdu(fptr, status);         /* close and flush the current HDU   */
+    /* close and flush the current HDU */
+    if (*status > 0)
+       ffchdu(fptr, &tstatus);  /* turn off the error message from ffchdu */
+    else
+       ffchdu(fptr, status);         
+
     ((fptr->Fptr)->open_count)--;           /* decrement usage counter */
 
     if ((fptr->Fptr)->open_count == 0)  /* if no other files use structure */
@@ -3997,6 +5226,8 @@ int ffclos(fitsfile *fptr,      /* I - FITS file pointer */
             }
         }
 
+        fits_clear_Fptr( fptr->Fptr, status);  /* clear Fptr address */
+        free((fptr->Fptr)->headstart);    /* free memory for headstart array */
         free((fptr->Fptr)->filename);     /* free memory for the filename */
         (fptr->Fptr)->filename = 0;
         (fptr->Fptr)->validcode = 0; /* magic value to indicate invalid fptr */
@@ -4005,7 +5236,17 @@ int ffclos(fitsfile *fptr,      /* I - FITS file pointer */
     }
     else
     {
-        ffflsh(fptr, FALSE, status); /* flush but don't disassociate buffers */
+        /*
+           to minimize the fallout from any previous error (e.g., trying to 
+           open a non-existent extension in a already opened file), 
+           always call ffflsh with status = 0.
+        */
+        /* just flush the buffers, don't disassociate them */
+        if (*status > 0)
+            ffflsh(fptr, FALSE, &zerostatus); 
+        else
+            ffflsh(fptr, FALSE, status); 
+
         free(fptr);               /* free memory for the FITS file structure */
     }
 
@@ -4019,7 +5260,7 @@ int ffdelt(fitsfile *fptr,      /* I - FITS file pointer */
 */
 {
     char *basename;
-    int slen;
+    int slen, tstatus = 0;
 
     if (!fptr)
         return(*status = NULL_INPUT_PTR);
@@ -4051,7 +5292,7 @@ int ffdelt(fitsfile *fptr,      /* I - FITS file pointer */
             return(*status = MEMORY_ALLOCATION);
     
         ffiurl((fptr->Fptr)->filename, NULL, basename, NULL, NULL, NULL, NULL,
-               NULL, status);
+               NULL, &tstatus);
 
        if ((*driverTable[(fptr->Fptr)->driver].remove)(basename))
         {
@@ -4063,6 +5304,8 @@ int ffdelt(fitsfile *fptr,      /* I - FITS file pointer */
         free(basename);
     }
 
+    fits_clear_Fptr( fptr->Fptr, status);  /* clear Fptr address */
+    free((fptr->Fptr)->headstart);    /* free memory for headstart array */
     free((fptr->Fptr)->filename);     /* free memory for the filename */
     (fptr->Fptr)->filename = 0;
     (fptr->Fptr)->validcode = 0;      /* magic value to indicate invalid fptr */
@@ -4086,7 +5329,7 @@ int fftrun( fitsfile *fptr,    /* I - FITS file pointer           */
     (fptr->Fptr)->logfilesize = filesize;
     (fptr->Fptr)->bytepos = filesize;
     ffbfeof(fptr, status);   /* eliminate any buffers beyond current EOF */
-    return (
+    return (*status = 
      (*driverTable[(fptr->Fptr)->driver].truncate)((fptr->Fptr)->filehandle,
      filesize) );
   }
@@ -4191,8 +5434,7 @@ int ffoptplt(fitsfile *fptr,      /* O - FITS file pointer                   */
 
     if (tstatus)  /* not a FITS file, so treat it as an ASCII template */
     {
-        ffxmsg(-2, card);  /* clear the  error message */
-
+        ffxmsg(2, card);  /* clear the  error message */
         fits_execute_template(fptr, (char *) tempname, status);
 
         ffmahd(fptr, 1, 0, status);   /* move back to the primary array */
@@ -4216,7 +5458,6 @@ int ffoptplt(fitsfile *fptr,      /* O - FITS file pointer                   */
 
         if (*status == END_OF_FILE)
         {
-           ffxmsg(-2, card);  /* clear the end of file error message */
            *status = 0;              /* expected error condition */
         }
         ffclos(tptr, status);       /* close the template file */
diff --git a/cfitsio.doc b/cfitsio.doc
index 4c015e8..ae4c307 100644
--- a/cfitsio.doc
+++ b/cfitsio.doc
@@ -1,7 +1,7 @@
          CFITSIO - An Interface to FITS Format Files for C Programmers
  
                     William D Pence, HEASARC, NASA/GSFC
-                               Version 2.0 
+                               Version 2.4 
  
  
 [Note: This file contains various formatting command symbols ('*', '-')
@@ -9,20 +9,23 @@ in the first column which are used when generating the LATeX version of
 this document.]
 
 *I.  Introduction
+
+**A.   A Brief Overview
  
 CFITSIO is a machine-independent library of routines for reading and
 writing data files in the FITS (Flexible Image Transport System) data
-format.  It can also read IRAF format image files by converting them on
-the fly into a temporary FITS format file.  This library is written in
-ANSI C and provides a powerful yet simple interface for accessing FITS
-files which will run on most commonly used computers and workstations.
-CFITSIO supports all the features described in the official NOST
-definition of the FITS format and can read and write all the currently
-defined types of extensions, including ASCII tables (TABLE), Binary
-tables (BINTABLE) and IMAGE extensions.  The CFITSIO routines insulate
-the programmer from having to deal with the complicated formatting
-details in the FITS file, however, it is assumed that users have a
-general knowledge about the structure and usage of FITS files.
+format.  It can also read IRAF format image files and raw binary data
+arrays by converting them on the fly into a virtual FITS format file.
+This library is written in ANSI C and provides a powerful yet simple
+interface for accessing FITS files which will run on most commonly used
+computers and workstations.  CFITSIO supports all the features
+described in the official NOST definition of the FITS format and can
+read and write all the currently defined types of extensions, including
+ASCII tables (TABLE), Binary tables (BINTABLE) and IMAGE extensions.
+The CFITSIO routines insulate the programmer from having to deal with
+the complicated formatting details in the FITS file, however, it is
+assumed that users have a general knowledge about the structure and
+usage of FITS files.
 
 CFITSIO also contains a set of Fortran callable wrapper routines which
 allow Fortran programs to call the CFITSIO routines.  See the companion
@@ -41,6 +44,8 @@ and the XMM/ESTEC project in The Netherlands made especially significant
 contributions that resulted in many of the new features that appeared
 in v2.0 of CFITSIO.
 
+**B.  Sources of FITS Software and Information
+
 The latest version of the CFITSIO source code,
 documentation, and example programs are available on the World-Wide
 Web or via anonymous ftp from:
@@ -48,7 +53,7 @@ Web or via anonymous ftp from:
         http://heasarc.gsfc.nasa.gov/fitsio
         ftp://legacy.gsfc.nasa.gov/software/fitsio/c
 -
-\newpage
+
 Any questions, bug reports, or suggested enhancements related to the CFITSIO
 package should be sent to the primary author:
 -
@@ -59,31 +64,155 @@ package should be sent to the primary author:
 -
 This User's Guide assumes that readers already have a general
 understanding of the definition and structure of FITS format files.
-Further information about FITS formats is available in the `FITS User's
-Guide' and the `NOST FITS Standard', which are available from the NASA
-Science Office of Standards and Technology at the address given below.
-Both of these documents are available electronically from their Web
-site and via anonymous ftp at nssdc.gsfc.nasa.gov in the /pub/fits
-directory. Any questions about FITS formats should be directed to the
-NOST, at:
--
-        NASA, Science Office of Standards and Technology
-        Code 633.2,
-        Goddard Space Flight Center
-        Greenbelt MD 20771, USA
-        WWW: http://fits.gsfc.nasa.gov/
-        E-mail: fits@fits.gsfc.nasa.gov
-        (301) 286-2899
--
+Further information about FITS formats is available from the FITS Support
+Office at {\tt http://fits.gsfc.nasa.gov}.  In particular, the
+'NOST FITS Standard' gives the authoritative definition of the FITS data
+format, and the  `FITS User's Guide' provides additional historical background
+and practical advice on using FITS files.
+
+The HEASARC also provides a very sophisticated FITS file analysis
+program called `Fv' which can be used to display and edit the contents
+of any FITS file as well as construct new FITS files from scratch. The
+display functions in Fv allow users to interactively adjust the
+brightness and contrast of images, pan, zoom, and blink images, and
+measure the positions and brightnesses of objects within images. FITS
+tables can be displayed like a spread sheet, and then modified using
+powerful calculator and sorting functions.  Fv is freely available for
+most Unix platforms, Mac PCs, and Windows PCs.
 CFITSIO users may also be interested in the FTOOLS package of programs
 that can be used to manipulate and analyze FITS format files.
-Information about FTOOLS can be obtained on the Web or via anonymous
-ftp at:
+Fv and FTOOLS are available from their respective Web sites at:
 -
+        http://fv.gsfc.nasa.gov
         http://heasarc.gsfc.nasa.gov/ftools
-        ftp://legacy.gsfc.nasa.gov/software/ftools/release
 -
-
+
+**C.  Acknowledgements
+
+The development of the powerful features in CFITSIO was made
+possible through collaborations with many people or organizations from
+around the world.  The following in particular have made especially
+significant contributions:
+
+Programmers from the Integral Science Data Center, Switzerland (namely,
+Jurek Borkowski, Bruce O'Neel, and Don Jennings), designed the concept
+for the plug-in I/O drivers that was introduced with CFITSIO 2.0.  The
+use of `drivers' greatly simplified  the low-level I/O, which in turn
+made other new features in CFITSIO (e.g., support for compressed FITS
+files and support for IRAF format image files) much easier to
+implement.  Jurek Borkowski wrote the Shared Memory driver, and Bruce
+O'Neel wrote the drivers for accessing FITS files over the network
+using the FTP, HTTP, and ROOT protocols.
+
+The ISDC also provided the template parsing routines (written by Jurek
+Borkowski) and the hierarchical grouping routines (written by Don
+Jennings).  The ISDC DAL (Data Access Layer) routines are layered on
+top of CFITSIO and make extensive use of these features.
+
+Uwe Lammers (XMM/ESA/ESTEC, The Netherlands) designed the
+high-performance lexical parsing algorithm that is used to do
+on-the-fly filtering of FITS tables.  This algorithm essentially
+pre-compiles the user-supplied selection expression into a form that
+can be rapidly evaluated for each row.  Peter Wilson (RSTX, NASA/GSFC)
+then wrote the parsing routines used by CFITSIO based on Lammers'
+design, combined with other techniques such as the CFITSIO iterator
+routine to further enhance the data processing throughput.  This effort
+also benefited from a much earlier lexical parsing routine that was
+developed by Kent Blackburn (NASA/GSFC). More recently, Craig Markwardt
+(NASA/GSFC) implemented additional functions (median, average, stddev)
+and other enhancements to the lexical parser.
+
+The CFITSIO iterator function is loosely based on similar ideas
+developed for the XMM Data Access Layer.
+
+Peter Wilson (RSTX, NASA/GSFC) wrote the complete set of
+Fortran-callable wrappers for all the CFITSIO routines, which in turn
+rely on the CFORTRAN macro developed by Burkhard Burow.
+
+The syntax used by CFITSIO for filtering or binning input FITS files is
+based on ideas developed for the AXAF Science Center Data Model by
+Jonathan McDowell, Antonella Fruscione, Aneta Siemiginowska and Bill
+Joye. See http://heasarc.gsfc.nasa.gov/docs/journal/axaf7.html for
+further description of the AXAF Data Model.
+
+The file decompression code were taken directly from the gzip (GNU zip)
+program developed by Jean-loup Gailly and others.
+
+The new compressed image data format (where the image is tiled and
+the compressed byte stream from each tile is stored in a binary table)
+was implemented in collaboration with Richard White (STScI), Perry
+Greenfield (STScI) and Doug Tody (NOAO). 
+
+Doug Mink (SAO) provided the routines for converting IRAF format 
+images into FITS format.
+
+In addition, many other people have made valuable contributions to the
+development of CFITSIO.  These include (with apologies to others that may
+have inadvertently been omitted):
+
+Steve Allen, Carl Akerlof, Keith Arnaud, Morten Krabbe Barfoed, Kent
+Blackburn, G Bodammer, Romke Bontekoe, Lucio Chiappetti, Keith Costorf,
+Robin Corbet, John Davis,  Richard Fink, Ning Gan, Emily Greene, Gretchen
+Green, Joe Harrington, Cheng Ho, Phil Hodge, Jim Ingham, Yoshitaka
+Ishisaki, Diab Jerius, Mark Levine, Todd Karakaskian, Edward King,
+Scott Koch,  Claire Larkin, Rob Managan, Eric Mandel, Richard Mathar,
+John Mattox, Carsten Meyer, Emi Miyata, Stefan Mochnacki, Mike Noble,
+Oliver Oberdorf, Clive Page, Arvind Parmar, Jeff Pedelty, Tim Pearson,
+Philippe Prugniel, Maren Purves, Scott Randall, Chris Rogers, Arnold Rots,
+Barry Schlesinger, Robin Stebbins, Andrew Szymkowiak, Allyn Tennant,
+Peter Teuben, James Theiler, Doug Tody, Shiro Ueno, Steve Walton, Archie
+Warnock, Alan Watson, Dan Whipple, Wim Wimmers, Peter Young, Jianjun Xu,
+and Nelson Zarate.
+
+**D.  Legal Stuff
+
+Copyright (Unpublished--all rights reserved under the copyright laws of
+the United States), U.S. Government as represented by the Administrator
+of the National Aeronautics and Space Administration.  No copyright is
+claimed in the United States under Title 17, U.S. Code.
+
+Permission to freely use, copy, modify, and distribute this software
+and its documentation without fee is hereby granted, provided that this
+copyright notice and disclaimer of warranty appears in all copies.
+(However, see the restriction on the use of the gzip compression code,
+below).
+
+DISCLAIMER:
+
+THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND,
+EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO,
+ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY
+IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE
+DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE
+SOFTWARE WILL BE ERROR FREE.  IN NO EVENT SHALL NASA BE LIABLE FOR ANY
+DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY
+CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
+CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY
+PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED
+FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
+SERVICES PROVIDED HEREUNDER."
+
+The file compress.c contains (slightly modified) source code that
+originally came from gzip-1.2.4, copyright (C) 1992-1993 by Jean-loup
+Gailly.  This gzip code is distributed under the GNU General Public
+License and thus requires that any software that uses the CFITSIO
+library (which in turn uses the gzip code) must conform to the
+provisions in the GNU General Public License.  A copy of the GNU
+license is included at the beginning of compress.c file.
+
+An alternate version of the compress.c file (called
+compress\_alternate.c) is provided for users who want to use the CFITSIO
+library but are unwilling or unable to publicly release their software
+under the terms of the GNU General Public License.   This alternate
+version contains non-functional stubs for the file compression and
+uncompression routines used by CFITSIO.  Replace the file `compress.c'
+with `compress\_alternate.c' before compiling the CFITSIO library.  This
+will produce a version of CFITSIO which does not support reading or
+writing compressed FITS files but is otherwise identical to the
+standard version.  
+
 *II.  Creating the CFITSIO Library
  
 **A.  Building the Library
@@ -108,72 +237,44 @@ CFITSIO has currently been tested on the following platforms:
    Linux                      gcc
    MkLinux                    DR3
    Windows 95/98/NT           Borland C++ V4.5
-   Windows 95/98/NT           Microsoft/Compaq Visual C++ v5.0, v6.0
+   Windows 95/98/NT/ME/XP     Microsoft/Compaq Visual C++ v5.0, v6.0
    Windows 95/98/NT           Cygwin gcc
-   OS/2                       gcc + EMX
    MacOS 7.1 or greater       Metrowerks 10.+
+   MacOS-X 10.1 or greater    cc (gcc)
 -
 CFITSIO will probably run on most other Unix platforms.  Cray
-supercomputers and IBM mainframe computers are currently not
-supported.
-\newpage
+supercomputers are currently not supported.
 
-***1.   Unix Systems
+***1.  Unix Systems
 
 The CFITSIO library is built on Unix systems by typing:
 -
-   > ./configure
-   > make
--
-at the operating system prompt.  Type ./configure and not simply
-`configure' to ensure that the configure script in the current
-directory is run and not some other system-wide configure script.  The
-configure command customizes the Makefile for the particular system,
-then the `make' command compiles the source files and builds the
-library.
-
-On HP/UX systems, the environment variable CFLAGS should be set
-to -Ae before running configure to enable "extended ANSI" features.
-
-By default, a set of Fortran-callable wrapper routines are
-also built and included in the CFITSIO library.  If these wrapper
-routines are not needed (i.e., the CFITSIO library will not
-be linked to any Fortran applications which call FITSIO subroutines)
-then they may be omitted from the build by typing 'make all-nofitsio'
-instead of simply typing 'make'.  This will reduce the size
-of the CFITSIO library slightly.
-
-Most 32-bit operating systems have only supported disk files up to
-2.1GB (2**31 bytes) in size.  Starting with version 2.1 of CFITSIO,
-FITS files larger than this limit (up to 6 terabytes) can be read and
-written on platforms which support large files (e.g., Solaris).  To
-enable this feature, CFITSIO must be compiled with the
-`-D\_FILE\_OFFSET\_BITS=64' compiler flag.  All programs which link to
-the CFITSIO library must also be compiled with this flag or must
-include this preprocessor definition at the start of the source code
-file. See the `CFITSIO Size Limitations' section in Chapter 5 for
-further details.
-
-It may not be possible to staticly link programs that use CFITSIO on
-some platforms (namely, on Solaris 2.6) due to the network drivers
-(which provide FTP and HTTP access to FITS files).  It is possible to
-make both a dynamic and a static version of the CFITSIO library, but
-network file access will not be possible using the static version.  To
-build the dynamic libcfitsio.so library (on solaris), type 'make
-clean', then edit the Makefile to add -fPIC or -KPIC (gcc or cc) to the
-CFLAGS line, then rebuild the library with 'make'.  Once you're done,
-build the shared library with 
--
- ld -G -z text -o libcfitsio.so *.o
--
-Then to get the staticly linkable libcfitsio.a library file do another
-make clean, undefine HAVE\_NET\_SERVICES on the CFLAGS line and rebuild.
-It's unimportant whether or not you use -fPIC for static builds.
-
-When using the shared library the executable code is not copied into
-your program at link time and instead the program locates the necessary
-library code at run time, normally through LD\_LIBRARY\_PATH or some
-other method.  The advantages are:
+ >  ./configure [--prefix=/target/installation/path]
+ >  make          (or  'make shared')
+ >  make install  (this step is optional)
+-
+at the operating system prompt.  The configure command customizes the
+Makefile for the particular system, then the `make' command compiles the
+source files and builds the library.  Type `./configure' and not simply
+`configure' to ensure that the configure script in the current directory
+is run and not some other system-wide configure script.  The optional
+'prefix' argument to configure gives the path to the directory where
+the CFITSIO library and include files should be installed via the later
+'make install' command. For example,
+-
+   > ./configure --prefix=/usr1/local
+-
+will cause the 'make install' command to copy the CFITSIO libcfitsio file 
+to /usr1/local/lib and the necessary include files to /usr1/local/include
+(assuming of course that the  process has permission to write to these 
+directories).
+
+The 'make shared' option builds a shared or dynamic version of the
+CFITSIO library.  When using the shared library the executable code is
+not copied into your program at link time and instead the program
+locates the necessary library code at run time, normally through
+LD\_LIBRARY\_PATH or some other method. The advantages of using a shared
+library are:
 -
    1.  Less disk space if you build more than 1 program
    2.  Less memory if more than one copy of a program using the shared
@@ -189,12 +290,47 @@ The disadvantages are:
 -
    1. More hassle at runtime.  You have to either build the programs
       specially or have LD_LIBRARY_PATH set right.
-   2. There may be a slight start up penality, depending on where you are
+   2. There may be a slight start up penalty, depending on where you are
       reading the shared library and the program from and if your CPU is
       either really slow or really heavily loaded.
 -
 
+On Mac OS X platforms the 'make shared' command works like on other
+UNIX platforms, but a .dylib file will be created instead of .so.  If
+installed in a nonstandard location, add its location to the
+DYLD\_LIBRARY\_PATH environment variable so that the library can be found
+at run time.
+
+On HP/UX systems, the environment variable CFLAGS should be set
+to -Ae before running configure to enable "extended ANSI" features.
+
+By default, a set of Fortran-callable wrapper routines are
+also built and included in the CFITSIO library.  If these wrapper
+routines are not needed (i.e., the CFITSIO library will not
+be linked to any Fortran applications which call FITSIO subroutines)
+then they may be omitted from the build by typing 'make all-nofitsio'
+instead of simply typing 'make'.  This will reduce the size
+of the CFITSIO library slightly.
+
+Most 32-bit operating systems have only supported disk files up to 2.1GB
+(2**31 bytes) in size.  Starting with version 2.1 of CFITSIO, FITS files
+larger than this limit (up to 6 terabytes) can be read and written on
+platforms that support large files (e.g., Solaris).  To enable this
+feature, CFITSIO must be compiled with the `-D\_FILE\_OFFSET\_BITS=64'
+compiler flag.  Some platforms may also require the `-D\_LARGE\_FILES'
+compiler flag.   All programs that link to the CFITSIO library must also
+be compiled with this flag or must include this preprocessor definition
+at the start of the source code file. See the `CFITSIO Size Limitations'
+section in Chapter 4 for further details.
+
+It may not be possible to staticly link programs that use CFITSIO on
+some platforms (namely, on Solaris 2.6) due to the network drivers
+(which provide FTP and HTTP access to FITS files).  It is possible to
+make both a dynamic and a static version of the CFITSIO library, but
+network file access will not be possible using the static version. 
+
 ***2.  VMS
+
 On VAX/VMS and ALPHA/VMS systems the make\_gfloat.com command file may
 be executed to build the cfitsio.olb object library using the default
 G-floating point option for double variables.  The make\_dfloat.com and
@@ -218,24 +354,17 @@ makefile.bc or makefile.vcc  files.  Finally, the makepc.bat file gives
 an example of  building CFITSIO with the Borland C++ v4.5 compiler
 using older DOS commands.
 
-***4.  OS/2
-
-On OS/2 systems, CFITSIO can be built by typing 'make -f
-makefile.os2'.  This makefile requires the GCC compiler and EMX
-library, which are available from many Internet sites containing OS/2
-software, such as 
--
-     ftp-os2.nmsu.edu/pub/os2/dev/emx/v0.9c   and
-     ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc.
--
+***4.  Macintosh PCs
 
-***5.  Macintosh PCs
+When building on Mac OS-X, users should follow the Unix instructions,
+above.
 
-The MacOS version of the CFITSIO library can be built by (1) un binhex
-and unstuff cfitsio\_mac.sit.hqx, (2) put CFitsioPPC.mcp in the cfitsio
-directory, and (3) load CFitsioPPC.mcp into CodeWarrior Pro 5 and make.
-This builds the cfitsio library for PPC.  There are also targets for
-both the test program and the speed test program.
+The classic MacOS version (OS 9 or earlier) of the CFITSIO library can
+be built by (1) un binhex and unstuff cfitsio\_mac.sit.hqx, (2) put
+CFitsioPPC.mcp in the cfitsio directory, and (3) load CFitsioPPC.mcp
+into CodeWarrior Pro 5 and make.  This builds the CFITSIO library for
+PPC.  There are also targets for both the test program and the speed
+test program.
 
 To use the MacOS port you can add Cfitsio PPC.lib to your CodeWarrior
 Pro 5 project.  Note that this only has been tested for the PPC and
@@ -260,13 +389,13 @@ On Unix systems, type:
     $ link testprog, cfitsio/lib, alpha$library:vaxcrtl/lib
     $ run testprog
 -
-The testprog program should produce a FITS file called `testprog.fit'
+The test program should produce a FITS file called `testprog.fit'
 that is identical to the `testprog.std' FITS file included with this
 release.  The diagnostic messages (which were piped to the file
 testprog.lis in the Unix example) should be identical to the listing
 contained in the file testprog.out.  The 'diff' and 'cmp' commands
 shown above should not report any differences in the files.  (There
-may be some minor formating differences, such as the presence or
+may be some minor format differences, such as the presence or
 absence of leading zeros, or 3 digit exponents in numbers, 
 which can be ignored).
 
@@ -295,7 +424,9 @@ program may differ slightly from the testf77.std template, if leading
 zeros are not printed by default before the decimal point when using F
 format.
 
-A few other utility programs are included with CFITSIO: 
+A few other utility programs are included with CFITSIO; the first four
+of this programs can be compiled an linked by typing `make
+program\_name' where `program\_name' is the actual name of the program:
 -
     speed - measures the maximum throughput (in MB per second)
               for writing and reading FITS files with CFITSIO.
@@ -305,15 +436,10 @@ A few other utility programs are included with CFITSIO:
     fitscopy - copies any FITS file (especially useful in conjunction
                  with the CFITSIO's extended input filename syntax).
 
-    cookbook - a sample program that peforms common read and
+    cookbook - a sample program that performs common read and
                  write operations on a FITS file.
 
-    iter_a, iter_b, iter_c - tests of the CFITSIO iterator routine
--
-
-The first 4 of these utility programs can be compiled and linked by typing
--
-   %  make program_name
+    iter_a, iter_b, iter_c - examples of the CFITSIO iterator routine
 -
 
 **C.  Linking Programs with CFITSIO
@@ -329,44 +455,47 @@ are not needed on VMS and Windows platforms, because FTP file access is
 not currently supported on those platforms.
 
 Note that when upgrading to a newer version of CFITSIO it is usually
-necessay to recompile, as well as relink, the programs that use CFITSIO,
+necessary to recompile, as well as relink, the programs that use CFITSIO,
 because the definitions in fitsio.h often change.
  
 **D.  Getting Started with CFITSIO
 
-In order to effectively use the CFITSIO library as quickly as possible,
-it is recommended that new users follow these steps:
+In order to effectively use the CFITSIO library it is recommended that
+new users begin by reading the ``CFITSIO Quick Start Guide''.  It
+contains all the basic information needed to write programs that
+perform most types of operations on FITS files.  The set of example
+FITS utility programs that are available from the CFITSIO web site are
+also very useful for learning how to use CFITSIO.  To learn even more
+about the capabilities of the CFITSIO library the following steps are
+recommended:
 
-1.  Read the following `FITS Primer' chapter for an overview of the
-structure of FITS files.  This is especially important for users who
-are unfamiliar with the FITS table and image extensions.
+1.  Read the following short `FITS Primer' chapter for an overview of
+the structure of FITS files.
 
-2. Review the various topics discussed in Chapters 4 and 5 to become
-familiar with the conventions and advanced features of the CFITSIO
-interface.
+2. Review the Programming Guidelines in Chapter 4 to become familiar
+with the conventions used by the CFITSIO interface.
 
 3.  Refer to the cookbook.c, listhead.c, and fitscopy.c programs that
 are included with this release for examples of routines that perform
-various common FITS file operations.  Type 'make program\_name' to compile
-and link these programs on Unix systems.
+various common FITS file operations.  Type 'make program\_name' to
+compile and link these programs on Unix systems.
 
 4.  Write a simple program to read or write a FITS file using the Basic
-Interface routines described in Chapter 7.
+Interface routines described in Chapter 5.
 
 5.  Scan through the more specialized routines that are described in
-Chapter 8 to become familiar with the functionality that they provide.
+the following chapters to become familiar with the functionality that
+they provide.
 
 **E.  Example Program
 
 The following listing shows an example of how to use the CFITSIO
-routines in a C program.  The error checking of the returned status
-value has been omitted for the sake of clarity.  Refer to the
-cookbook.c program that is included with the CFITSIO distribution for
-other example programs.
+routines in a C program.    Refer to the cookbook.c program that is
+included with the CFITSIO distribution for other example routines.
 
 This program creates a new FITS file, containing a FITS image.  An
 `EXPOSURE' keyword is written to the header, then the image data are
-writen to the FITS file before closing the FITS file.
+written to the FITS file before closing the FITS file.
 -
 #include "fitsio.h"  /* required by every program that uses CFITSIO  */
 main()
@@ -404,110 +533,7 @@ main()
     return( status );           
 }
 -
-**F.  Legal Stuff
-
-Copyright (Unpublished--all rights reserved under the copyright laws of
-the United States), U.S. Government as represented by the Administrator
-of the National Aeronautics and Space Administration.  No copyright is
-claimed in the United States under Title 17, U.S. Code.
-
-Permission to freely use, copy, modify, and distribute this software
-and its documentation without fee is hereby granted, provided that this
-copyright notice and disclaimer of warranty appears in all copies.
-
-DISCLAIMER:
-
-THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND,
-EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO,
-ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY
-IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE
-DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE
-SOFTWARE WILL BE ERROR FREE.  IN NO EVENT SHALL NASA BE LIABLE FOR ANY
-DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR
-CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY
-CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
-CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY
-PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED
-FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
-SERVICES PROVIDED HEREUNDER."
-
-The file compress.c contains (slightly modified) source code that
-originally came from gzip-1.2.4 which is freely distributed under the
-GNU General Public Licence.  A copy of the GNU licence is included
-at the beginning of that file.
-
-**G.  Acknowledgements
-
-The development of many of the powerful features in CFITSIO was made
-possible through collaborations with many people or organizations from
-around the world.  The following, in particular, have made especially
-significant contributions:
-
-Programmers from the Integral Science Data Center, Switzerland (namely,
-Jurek Borkowski, Bruce O'Neel, and Don Jennings), designed the concept
-for the plug-in I/O drivers that was introduced with CFITSIO 2.0.  The
-use of `drivers' greatly simplified  the low-level I/O, which in turn
-made other new features in CFITSIO (e.g., support for compressed FITS
-files and support for IRAF format image files) much easier to
-implement.  Jurek Borkowski wrote the Shared Memory driver, and Bruce
-O'Neel wrote the drivers for accessing FITS files over the network
-using the FTP, HTTP, and ROOT protocols.
-
-The ISDC also provided the template parsing routines (written by Jurek
-Borkowski) and the hierarchical grouping routines (written by Don
-Jennings).  The ISDC DAL (Data Access Layer) routines are layered on
-top of CFITSIO and make extensive use of these features.
-
-Uwe Lammers (XMM/ESA/ESTEC, The Netherlands) designed the
-high-performance lexical parsing algorithm that is used to do
-on-the-fly filtering of FITS tables.  This algorithm essentially
-pre-compiles the user-supplied selection expression into a form that
-can be rapidly evaluated for each row.  Peter Wilson (RSTX, NASA/GSFC)
-then wrote the parsing routines used by CFITSIO based on Lammers'
-design, combined with other techniques such as the CFITSIO iterator
-routine to further enhance the data processing throughput.  This effort
-also benefitted from a much earlier lexical parsing routine that was
-developed by Kent Blackburn (NASA/GSFC).
-
-The CFITSIO iterator function is loosely based on similar ideas
-developed for the XMM Data Access Layer.
-
-Peter Wilson (RSTX, NASA/GSFC) wrote the complete set of
-Fortran-callable wrappers for all the CFITSIO routines, which in turn
-rely on the CFORTRAN macro developed by Burkhard Burow.
-
-The syntax used by CFITSIO for filtering or binning input FITS files is
-based on ideas developed for the AXAF Science Center Data Model by
-Jonathan McDowell, Antonella Fruscione, Aneta Siemiginowska and Bill
-Joye. See http://heasarc.gsfc.nasa.gov/docs/journal/axaf7.html for
-further description of the AXAF Data Model.
-
-The file decompression code were taken directly from the gzip (GNU zip)
-program developed by Jean-loup Gailly and others.
-
-Doug Mink, SAO, provided the routines for converting IRAF format 
-images into FITS format.
-
-In addition, many other people have made valuable contributions to the
-development of CFITSIO.  These include (with apologies to others that may
-have inadvertently been omitted):
-
-Steve Allen, Carl Akerlof, Keith Arnaud, Morten Krabbe Barfoed, Kent
-Blackburn, G Bodammer, Romke Bontekoe, Lucio Chiappetti, Keith Costorf,
-Robin Corbet, John Davis,  Richard Fink, Ning Gan, Emily Greene,
-Gretchen Green, Joe Harrington, Cheng Ho, Phil Hodge, Jim Ingham,
-Yoshitaka Ishisaki, Diab Jerius, Mark Levine, Todd Karakaskian, Edward
-King, Scott Koch,  Claire Larkin, Rob Managan, Eric Mandel, John
-Mattox, Carsten Meyer, Emi Miyata, Stefan Mochnacki, Mike Noble, Oliver
-Oberdorf, Clive Page, Arvind Parmar, Jeff Pedelty, Tim Pearson, Maren
-Purves, Scott Randall, Chris Rogers, Arnold Rots, Barry Schlesinger,
-Robin Stebbins, Andrew Szymkowiak, Allyn Tennant, Peter Teuben, James
-Theiler, Doug Tody, Shiro Ueno, Steve Walton, Archie Warnock, Alan
-Watson, Dan Whipple, Wim Wimmers, Peter Young, Jianjun Xu, and Nelson
-Zarate.
 
-
 *III.  A FITS Primer
 
 This section gives a brief overview of the structure of FITS files.
@@ -524,7 +550,7 @@ A FITS file consists of one or more Header + Data Units (HDUs), where
 the first HDU is called the `Primary HDU', or `Primary Array'.  The
 primary array contains an N-dimensional array of pixels, such as a 1-D
 spectrum, a 2-D image, or a 3-D data cube.  Five different primary
-datatypes are supported: Unsigned 8-bit bytes, 16 and 32-bit signed
+data types are supported: Unsigned 8-bit bytes, 16 and 32-bit signed
 integers, and 32 and 64-bit floating point reals.  FITS also has a
 convention for storing 16 and 32-bit unsigned integers (see the later
 section entitled `Unsigned Integers' for more details). The primary HDU
@@ -590,10 +616,10 @@ previous Data Unit (or Header Unit if there is no Data Unit).
 The main required keywords in FITS primary arrays or image extensions are:
 \begin{itemize}
 \item
-BITPIX -- defines the datatype of the array: 8, 16, 32, -32, -64
-for unsigned 8--bit byte, 16--bit integer, 32--bit integer, 32--bit
-IEEE floating point, and 64--bit IEEE double precision floating point,
-respectively.
+BITPIX -- defines the data type of the array: 8, 16, 32, -32, -64 for
+unsigned 8--bit byte, 16--bit signed integer, 32--bit signed integer,
+32--bit IEEE floating point, and 64--bit IEEE double precision floating
+point, respectively.
 \item
 NAXIS --  the number of dimensions in the array, usually 0, 1, 2, 3, or 4.
 \item
@@ -612,2984 +638,3417 @@ NAXIS2 -- number of rows in the table
 TTYPEn -- for each column (n ranges from 1 to TFIELDS) gives the
 name of the column
 \item
-TFORMn -- the datatype of the column
+TFORMn -- the data type of the column
 \item
 TUNITn -- the physical units of the column (optional)
 \end{itemize}
 
-Users should refer to the NOST documentation for more details about the
-required keywords and their allowed values.
+Users should refer to the FITS Support Office at {\tt http://fits.gsfc.nasa.gov}
+for futher information about the FITS format and related software 
+packages.
 
-*IV.   Extended File Name Syntax
-
-**A.  Overview
-
-CFITSIO supports an extended syntax when specifying the name of the
-data file to be opened or created  that includes the following
-features:
 
-\begin{itemize}
-\item
-CFITSIO can read IRAF format images which have header file names that
-end with the '.imh' extension, as well as reading and writing FITS
-files,   This feature is implemented in CFITSIO by first converting the
-IRAF image into a temporary FITS format file in memory, then opening
-the FITS file.  Any of the usual CFITSIO routines then may be used to
-read the image header or data.
+*IV.  Programming Guidelines
 
-\item
-FITS files on the internet can be read (and sometimes written) using the FTP,
-HTTP, or ROOT protocols.
+**A.  CFITSIO Definitions
 
-\item
-FITS files can be piped between tasks on the stdin and stdout streams.
+Any program that uses the CFITSIO interface must include the fitsio.h
+header file with the statement
+-
+  #include "fitsio.h"
+-
+This header file contains the prototypes for all the CFITSIO user
+interface routines as well as the definitions of various constants used
+in the interface.  It also defines a C structure of type `fitsfile'
+that is used by CFITSIO to store the relevant parameters that define
+the format of a particular FITS file.  Application programs must define
+a pointer to this structure for each FITS file that is to be opened.
+This structure is initialized (i.e., memory is allocated for the
+structure) when the FITS file is first opened or created with the
+fits\_open\_file or fits\_create\_file routines.  This fitsfile pointer
+is then passed as the first argument to every other CFITSIO routine
+that operates on the FITS file.  Application programs must not directly
+read or write elements in this fitsfile structure because the
+definition of the structure may change in future versions of CFITSIO.
 
-\item
-FITS files can be read and written in shared memory.  This can potentially
-achieve much better data I/O performance compared to reading and
-writing the same FITS files on magnetic disk.
-
-\item
-Compressed FITS files in gzip or Unix COMPRESS format can be directly read.
-
-\item
-FITS table columns can be created, modified, or deleted 'on-the-fly' as
-the table is opened by CFITSIO.  This creates a virtual FITS file containing
-the modifications that is then opened by the application program.
+A number of symbolic constants are also defined in fitsio.h for the
+convenience of application programmers.  Use of these symbolic
+constants rather than the actual numeric value will help to make the
+source code more readable and easier for others to understand.
+-
+String Lengths, for use when allocating character arrays:
 
-\item
-Table rows may be selected, or filtered out, on the fly when the table
-is opened by CFITSIO, based on an arbitrary user-specified expression.
-Only rows for which the expression evaluates to 'TRUE' are retained
-in the copy of the table that is opened by the application program.
+  #define FLEN_FILENAME 1025 /* max length of a filename                  */
+  #define FLEN_KEYWORD   72  /* max length of a keyword                   */
+  #define FLEN_CARD      81  /* max length of a FITS header card          */
+  #define FLEN_VALUE     71  /* max length of a keyword value string      */
+  #define FLEN_COMMENT   73  /* max length of a keyword comment string    */
+  #define FLEN_ERRMSG    81  /* max length of a CFITSIO error message     */
+  #define FLEN_STATUS    31  /* max length of a CFITSIO status text string */
 
-\item
-Histogram images may be created on the fly by binning the values in
-table columns, resulting in a virtual N-dimensional FITS image.  The
-application program then only sees the FITS image (in the primary
-array) instead of the original FITS table.
-\end{itemize}
+  Note that FLEN_KEYWORD is longer than the nominal 8-character keyword
+  name length because the HIERARCH convention supports longer keyword names.
+ 
+Access modes when opening a FITS file:
 
-The latter 3 features in particular add very powerful data processing
-capabilities directly into CFITSIO, and hence into every task that uses
-CFITSIO to read or write FITS files.  For example, these features
-transform a very simple program that just copies an input FITS file to
-a new output file (like the `fitscopy' program that is distributed with
-CFITSIO) into a multipurpose FITS file processing tool.  By appending
-fairly simple qualifiers onto the name of the input FITS file, the user
-can perform quite complex table editing operations (e.g., create new
-columns, or filter out rows in a table) or create FITS images by
-binning or histogramming the values in table columns.  In addition,
-these functions have been coded using new state-of-the art algorithms
-that are, in some cases, 10 - 100 times faster than previous widely
-used implementations.
+  #define READONLY  0
+  #define READWRITE 1
+ 
+BITPIX data type code values for FITS images:
 
-Before describing the complete syntax for the extended FITS file names
-in the next section, here are a few examples of FITS file names that
-give a quick overview of the allowed syntax:
+  #define BYTE_IMG      8  /*  8-bit unsigned integers */
+  #define SHORT_IMG    16  /* 16-bit   signed integers */
+  #define LONG_IMG     32  /* 32-bit   signed integers */
+  #define FLOAT_IMG   -32  /* 32-bit single precision floating point */
+  #define DOUBLE_IMG  -64  /* 64-bit double precision floating point */
 
-\begin{itemize}
-\item
-{\tt 'myfile.fits'}: the simplest case of a FITS file on disk in the current
-directory.
+  The following 4 data type codes are also supported by CFITSIO:
+  #define LONGLONG_IMG 64 /* 64-bit long signed integers */
+  #define SBYTE_IMG  10   /*  8-bit signed integers, equivalent to */
+                          /*  BITPIX = 8, BSCALE = 1, BZERO = -128 */
+  #define USHORT_IMG  20  /* 16-bit unsigned integers, equivalent to */
+                          /*  BITPIX = 16, BSCALE = 1, BZERO = 32768 */
+  #define ULONG_IMG   40  /* 32-bit unsigned integers, equivalent to */
+                          /*  BITPIX = 32, BSCALE = 1, BZERO = 2147483648 */
 
-\item
-{\tt 'myfile.imh'}: opens an IRAF format image file and converts it on the
-fly into a temporary FITS format image in memory which can then be read with
-any other CFITSIO routine.
+Codes for the data type of binary table columns and/or for the
+data type of variables when reading or writing keywords or data:
 
-\item
-{\tt 'myfile.fits.gz[events, 2]'}:  opens and uncompresses the gzipped file
-myfile.fits then moves to the extension which has the keywords EXTNAME
-= 'EVENTS' and EXTVER = 2.
+                              DATATYPE               TFORM CODE
+  #define TBIT          1  /*                            'X' */
+  #define TBYTE        11  /* 8-bit unsigned byte,       'B' */
+  #define TLOGICAL     14  /* logicals (int for keywords     */
+                           /*  and char for table cols   'L' */
+  #define TSTRING      16  /* ASCII string,              'A' */
+  #define TSHORT       21  /* signed short,              'I' */
+  #define TINT32BIT    41  /* signed 32-bit int,         'J' */
+  #define TLONG        41  /* signed long,                   */
+  #define TFLOAT       42  /* single precision float,    'E' */
+  #define TDOUBLE      82  /* double precision float,    'D' */
+  #define TCOMPLEX     83  /* complex (pair of floats)   'C' */
+  #define TDBLCOMPLEX 163  /* double complex (2 doubles) 'M' */
 
-\item
-{\tt '-'}:  a dash (minus sign) signifies that the input file is to be read
-from the stdin file stream, or that the output file is to be written to
-the stdout stream. 
+  The following data type codes are also supported by CFITSIO:
+  #define TINT         31  /* int                            */
+  #define TSBYTE       12  /* 8-bit signed byte,         'S' */
+  #define TUINT        30  /* unsigned int               'V' */
+  #define TUSHORT      20  /* unsigned short             'U'  */
+  #define TULONG       40  /* unsigned long                  */
+  #define TLONGLONG    81  /* 64-bit long signed integer 'K' */
 
-\item
-{\tt 'ftp://legacy.gsfc.nasa.gov/test/vela.fits'}:  FITS files in any ftp
-archive site on the internet may be directly opened with read-only
-access.
+HDU type code values (value returned when moving to new HDU):
 
-\item
-{\tt 'http://legacy.gsfc.nasa.gov/software/test.fits'}: any valid URL to a
-FITS file on the Web may be opened with read-only access.
+  #define IMAGE_HDU  0  /* Primary Array or IMAGE HDU */
+  #define ASCII_TBL  1  /* ASCII  table HDU */
+  #define BINARY_TBL 2  /* Binary table HDU */
+  #define ANY_HDU   -1  /* matches any type of HDU */
+ 
+Column name and string matching case-sensitivity:
 
-\item
-{\tt 'root://legacy.gsfc.nasa.gov/test/vela.fits'}: similar to ftp access
-except that it provides write as well as read access to the files
-across the network. This uses the root protocol developed at CERN.
+  #define CASESEN   1   /* do case-sensitive string match */
+  #define CASEINSEN 0   /* do case-insensitive string match */
 
-\item
-{\tt 'shmem://h2[events]'}: opens the FITS file in a shared memory segment and
-moves to the EVENTS extension.  
+Logical states (if TRUE and FALSE are not already defined):
 
-\item
-{\tt 'mem://'}:  creates a scratch output file in core computer memory.  The
-resulting 'file' will disappear when the program exits, so this
-is mainly useful for testing purposes when one does not want a
-permanent copy of the output file.
+  #define TRUE 1
+  #define FALSE 0
 
-\item
-{\tt 'myfile.fits[3; Images(10)]'}: opens a copy of the image contained in the
-10th row of the 'Images' column in the binary table in the 3th extension
-of the FITS file.  The application just sees this single image as the 
-primary array.
+Values to represent undefined floating point numbers:
 
-\item
-{\tt 'myfile.fits[1:512:2, 1:512:2]'}: opens a section of the input image
-ranging from the 1st to the 512th pixel in  X and Y, and selects every 
-second pixel in both dimensions, resulting in a 256 x 256 pixel image 
-in this case.
+  #define FLOATNULLVALUE -9.11912E-36F
+  #define DOUBLENULLVALUE -9.1191291391491E-36
 
-\item
-{\tt 'myfile.fits[EVENTS][col Rad = sqrt(X**2 + Y**2)]'}:  creates and opens
-a temporary file on the fly (in memory or on disk) that is identical to
-myfile.fits except that it will contain a new column in the EVENTS
-extension called 'Rad' whose value is computed using the indicated
-expresson which is a function of the values in the X and Y columns.
+Image compression algorithm definitions
 
-\item
-{\tt 'myfile.fits[EVENTS][PHA > 5]'}:  creates and opens a temporary FITS
-files that is identical to 'myfile.fits' except that the EVENTS table
-will only contain the rows that have values of the PHA column greater
-than 5.  In general, any arbitrary boolean expression using a C or
-Fortran-like syntax, which may combine AND and OR operators,
-may be used to select rows from a table.
+  #define RICE_1      11
+  #define GZIP_1      21
+  #define PLIO_1      31
+- 
 
-\item
-{\tt 'myfile.fits[EVENTS][bin (X,Y)=1,2048,4]'}:  creates a temporary FITS
-primary array image which is computed on the fly by binning (i.e,
-computing the 2-dimensional histogram) of the values in the X and Y
-columns of the EVENTS extension.  In this case the X and Y coordinates
-range from 1 to 2048 and the image pixel size is 4 units in both
-dimensions, so the resulting image is 512 x 512 pixels in size.
+**B.  Current Header Data Unit (CHDU)
+
+The concept of the Current Header and Data Unit, or CHDU, is
+fundamental to the use of the CFITSIO library.  A simple FITS image may
+only contain a single Header and Data unit (HDU), but in general FITS
+files can contain multiple Header Data Units (also known as
+`extensions'), concatenated one after the other in the file.  The user
+can specify which HDU should be initially opened at run time by giving
+the HDU name or number after the root file name.  For example,
+'myfile.fits[4]' opens the 5th HDU in the file (note that the numbering
+starts with 0), and 'myfile.fits[EVENTS] opens the HDU with the name
+'EVENTS' (as defined by the EXTNAME or HDUNAME keywords).  If no HDU is
+specified then CFITSIO opens the first HDU (the primary array) by
+default.  The CFITSIO routines which read and write data  only operate
+within the opened HDU,  Other CFITSIO routines are provided to move to
+and open any other existing HDU within the FITS file or to append or
+insert new HDUs in the FITS file.
+
+**C.  Function Names and Variable Datatypes
+
+Most of the CFITSIO routines have both a short name as well as a
+longer descriptive name.  The short name is only 5 or 6 characters long
+and is similar to the subroutine name in the Fortran-77 version of
+FITSIO.  The longer name is more descriptive and it is recommended that
+it be used instead of the short name to more clearly document the
+source code.
 
-\item
-The final example combines many of these feature into one complex
-expression (it is broken into several lines for clarity):
+Many of the CFITSIO routines come in families which differ only in the
+data type of the associated parameter(s).  The data type of these
+routines is indicated by the suffix of the routine name.  The short
+routine names have a 1 or 2 character suffix (e.g., 'j' in 'ffpkyj')
+while the long routine names have a 4 character or longer suffix
+as shown in the following table:
 -
-  'ftp://legacy.gsfc.nasa.gov/data/sample.fits.gz[EVENTS]
-   [col phacorr = pha * 1.1 - 0.3][phacorr >= 5.0 && phacorr <= 14.0]
-   [bin (X,Y)=32]' 
+    Long      Short  Data
+    Names     Names  Type
+    -----     -----  ----
+    _bit        x    bit
+    _byt        b    unsigned byte
+    _sbyt       sb   signed byte
+    _sht        i    short integer
+    _lng        j    long integer
+    _lnglng     jj   8-byte LONGLONG integer (see note below)
+    _usht       ui   unsigned short integer
+    _ulng       uj   unsigned long integer
+    _uint       uk   unsigned int integer
+    _int        k    int integer
+    _flt        e    real exponential floating point (float)
+    _fixflt     f    real fixed-decimal format floating point (float)
+    _dbl        d    double precision real floating-point (double)
+    _fixdbl     g    double precision fixed-format floating point (double)
+    _cmp        c    complex reals (pairs of float values)
+    _fixcmp     fc   complex reals, fixed-format floating point
+    _dblcmp     m    double precision complex (pairs of double values)
+    _fixdblcmp  fm   double precision complex, fixed-format floating point
+    _log        l    logical (int)
+    _str        s    character string
 -
-In this case, CFITSIO (1) copies and uncompresses the FITS file from
-the ftp site on the legacy machine, (2) moves to the 'EVENTS'
-extension, (3) calculates a new column called 'phacorr', (4) selects
-the rows in the table that have phacorr in the range 5 to 14, and
-finally (5) bins the remaining rows on the X and Y column coordinates,
-using a pixel size = 32 to create a 2D image.  All this processing is
-completely transparent to the application program, which simply sees
-the final 2-D image in the primary array of the opened file.
-\end{itemize}
-
 
-**B.  Detailed Filename Syntax
-
-This section describes the full extended syntax for the CFITSIO FITS file names.
-The filename can contain several different components depending on the context:
--
-When creating a new file:
-   filetype://BaseFilename(templateName)
+The logical data type corresponds to `int' for logical keyword values,
+and `byte' for logical binary table columns.  In other words, the value
+when writing a logical keyword must be stored in an `int' variable, and
+must be stored in a `char' array when reading or writing to `L' columns
+in a binary table.  Inplicit data type conversion is not supported for
+logical table columns, but is for keywords, so a logical keyword may be
+read and cast to any numerical data type; a returned value = 0
+indicates false, and any other value = true.
 
-When opening an existing primary array or image HDU:
-   filetype://BaseFilename(outName)[HDUlocation][ImageSection]
+The `int' data type may be 2 bytes long on some IBM PC compatible
+systems and is usually 4 bytes long on most other systems.  Some 64-bit
+machines, however, like the Dec Alpha/OSF, define the `short', `int',
+and `long' integer data types to be 2, 4, and 8 bytes long,
+respectively.  The FITS standard only supports 2 and 4 byte integer
+data types, so CFITSIO internally converts between 4 and 8 bytes when
+reading or writing `long' integers on Alpha/OSF systems.
 
-When opening an existing table HDU:
-   filetype://BaseFilename(outName)[HDUlocation][colFilter][rowFilter][binSpec]
--
-The filetype, BaseFilename, outName, HDUlocation, and ImageSection
-components, if present, must be given in that order, but the colFilter,
-rowFilter, and binSpec specifiers may follow in any order.  Regardless
-of the order, however, the colFilter specifier, if present, will be
-processed first by CFITSIO, followed by the rowFilter specifier, and
-finally by the binSpec specifier.
+The 8-byte 'LONGLONG' integer data type is supported on most platforms.
+CFITSIO defines the LONGLONG data type to be equivalent to 'long long'
+on most Unix platforms and on Mac OS-X.  Since most Windows compilers don't
+support the 'long long' data type, LONGLONG is defined instead to be
+equivalent to '\_\_int64'.  If the compiler does not support a 8-byte
+integer data type then LONGLONG is defined to be equivalent to 'long'.
+Note that the C format specifier to print out these long integer values
+is "\%lld" on most unix machines, except on OSF platforms where "\%ld"
+must be used.  On Windows platform that have the \_\_int64 data type,
+the format specifier is "\%INT64d".
+
+When dealing with the FITS byte data type it is important to remember
+that the raw values (before any scaling by the BSCALE and BZERO, or
+TSCALn and TZEROn keyword values) in byte arrays (BITPIX = 8) or byte
+columns (TFORMn = 'B') are interpreted as unsigned bytes with values
+ranging from 0 to 255.  Some C compilers define a 'char' variable as
+signed, so it is important to explicitly declare a numeric char
+variable as 'unsigned char' to avoid any ambiguity
 
-***1.  Filetype
+One feature of the CFITSIO routines is that they can operate on a `X'
+(bit) column in a binary table as though it were a `B' (byte) column.
+For example a `11X' data type column can be interpreted the same as a
+`2B' column (i.e., 2 unsigned 8-bit bytes).  In some instances, it can
+be more efficient to read and write whole bytes at a time, rather than
+reading or writing each individual bit.
 
-The type of file determines the medium on which the file is located
-(e.g., disk or network) and, hence, which internal device driver is used by
-CFITSIO to read and/or write the file.  Currently supported types are
--
-        file://  - file on local magnetic disk (default)
-        ftp://   - a readonly file accessed with the anonymous FTP protocol.
-                   It also supports  ftp://username:password@hostname/...
-                   for accessing password-protected ftp sites.
-        http://  - a readonly file accessed with the HTTP protocol.  It
-                   does not  support username:password like the ftp driver.
-        root://  - uses the CERN root protocol for writing as well as
-                   reading files over the network.
-        shmem:// - opens or creates a file which persists in the computer's
-                   shared memory.
-        mem://   - opens a temporary file in core memory.  The file 
-                   disappears when the program exits so this is mainly
-                   useful for test purposes when a permanent output file
-                   is not desired.
--
-If the filetype is not specified, then type file:// is assumed.
-The double slashes '//' are optional and may be omitted in most cases.
+The complex and double precision complex data types are not directly
+supported in ANSI C so these data types should be interpreted as pairs
+of float or double values, respectively, where the first  value in each
+pair is the real part, and the second is the imaginary part.
 
-****1.  Notes about the root filetype
+**D.  Support for Unsigned Integers and Signed Bytes
 
+Although FITS does not directly support unsigned integers as one of its
+fundamental data types, FITS can still be used to efficiently store
+unsigned integer data values in images and binary tables.  The
+convention used in FITS files is to store the unsigned integers as
+signed integers with an associated offset (specified by the BZERO or
+TZEROn keyword).  For example, to store unsigned 16-bit integer values
+in a FITS image the image would be defined as a signed 16-bit integer
+(with BITPIX keyword = SHORT\_IMG = 16) with the keywords BSCALE = 1.0
+and BZERO = 32768.  Thus the unsigned values of 0, 32768, and 65535,
+for example, are physically stored in the FITS image as -32768, 0, and
+32767, respectively;  CFITSIO automatically adds the BZERO offset to
+these values when they are read.  Similarly, in the case of unsigned
+32-bit integers the BITPIX keyword would be equal to LONG\_IMG = 32 and
+BZERO would be equal to 2147483648 (i.e. 2 raised to the 31st power).
 
-The original rootd server can be obtained from:
--
-       ftp://root.cern.ch/root/rootd.tar.gz
--
-but, for it to work correctly with CFITSIO one has to use a modified
-version which supports a command to return the length of the file. 
-This modified version is available in rootd subdirectory
-in the CFITSIO ftp area at
--
-      ftp://legacy.gsfc.nasa.gov/software/fitsio/c/root/rootd.tar.gz.  
+The CFITSIO interface routines will efficiently and transparently apply
+the appropriate offset in these cases so in general application
+programs do not need to be concerned with how the unsigned values are
+actually stored in the FITS file.  As a convenience for users, CFITSIO
+has several predefined constants for the value of BITPIX  (USHORT\_IMG,
+ULONG\_IMG) and for the TFORMn value in the case of binary tables (`U'
+and `V') which programmers can use when creating FITS files containing
+unsigned integer values.  The following code fragment illustrates how
+to write a FITS 1-D primary array of unsigned 16-bit integers:
 -
+      unsigned short uarray[100];
+      int naxis, status;
+      long naxes[10], group, firstelem, nelements;
+       ...
+      status = 0;
+      naxis = 1;
+      naxes[0] = 100;
+      fits_create_img(fptr, USHORT_IMG, naxis, naxes, &status);
 
-This small server is started either by inetd when a client requests a
-connection to a rootd server or by hand (i.e. from the command line).
-The rootd server works with the ROOT TNetFile class. It allows remote
-access to ROOT database files in either read or write mode. By default
-TNetFile assumes port 432 (which requires rootd to be started as root).
-To run rootd via inetd add the following line to /etc/services:
--                                                                          
-  rootd     432/tcp                                                    
--                                                                    
-and to /etc/inetd.conf, add the following line: 
--
-  rootd stream tcp nowait root /user/rdm/root/bin/rootd rootd -i       
--                                                                    
-Force inetd to reread its conf file with "kill -HUP <pid inetd>".    
-You can also start rootd by hand running directly under your private 
-account (no root system priviliges needed). For example to start     
-rootd listening on port 5151 just type:                              
--
-  rootd -p 5151                                                        
--
-Notice: no \& is needed. Rootd will go into background by itself.       
--
-  Rootd arguments:                                                     
-    -i                says we were started by inetd                    
-    -p port#          specifies a different port to listen on          
-    -d level          level of debug info written to syslog            
-                      0 = no debug (default)                           
-                      1 = minimum                                      
-                      2 = medium                                       
-                      3 = maximum                                      
--
-Rootd can also be configured for anonymous usage (like anonymous ftp).
-To setup rootd to accept anonymous logins do the following (while being
-logged in as root):                                  
--
-   - Add the following line to /etc/passwd:                             
-                                                                     
-     rootd:*:71:72:Anonymous rootd:/var/spool/rootd:/bin/false          
-                                                                     
-     where you may modify the uid, gid (71, 72) and the home directory  
-     to suite your system.                                              
-                                                                     
-   - Add the following line to /etc/group:                              
-                                                                     
-     rootd:*:72:rootd                                                   
-                                                                     
-     where the gid must match the gid in /etc/passwd.                   
-                                                                     
-   - Create the directories:                                            
-                                                                     
-     mkdir /var/spool/rootd                                             
-     mkdir /var/spool/rootd/tmp                                         
-     chmod 777 /var/spool/rootd/tmp                                     
-                                                                     
-     Where /var/spool/rootd must match the rootd home directory as      
-     specified in the rootd /etc/passwd entry.                          
-                                                                     
-   - To make writeable directories for anonymous do, for example:       
-                                                                     
-     mkdir /var/spool/rootd/pub                                         
-     chown rootd:rootd /var/spool/rootd/pub                             
+      firstelem = 1;
+      nelements = 100;
+      fits_write_img(fptr, TUSHORT, firstelem, nelements,
+                          uarray, &status);
+       ...
 -
-That's all.  Several additional remarks:  you can login to an anonymous
-server either with the names "anonymous" or "rootd".  The password should
-be of type user@host.do.main. Only the @ is enforced for the time
-being.  In anonymous mode the top of the file tree is set to the rootd
-home directory, therefore only files below the home directory can be
-accessed.  Anonymous mode only works when the server is started via
-inetd.
-
-                                                        
-****2.  Notes about the shmem filetype:
+In the above example, the 2nd parameter in fits\_create\_img tells
+CFITSIO to write the header keywords appropriate for an array of 16-bit
+unsigned integers (i.e., BITPIX = 16 and BZERO = 32768).  Then the
+fits\_write\_img routine writes the array of unsigned short integers
+(uarray) into the primary array of the FITS file.  Similarly, a 32-bit
+unsigned integer image may be created by setting the second parameter
+in fits\_create\_img equal to `ULONG\_IMG' and by calling the
+fits\_write\_img routine with the second parameter = TULONG to write
+the array of unsigned long image pixel values.
 
-Shared memory files are currently supported on most Unix platforms,
-where the shared memory segments are managed by the operating system
-kernel and `live' independently of processes. They are not deleted (by
-default) when the process which created them terminates, although they
-will disappear if the system is rebooted.  Applications can create
-shared memory files in CFITSIO by calling:
--
-   fit_create_file(&fitsfileptr, "shmem://h2", &status);
+An analogous set of routines are available for reading or writing unsigned
+integer values and signed byte values in a FITS binary table extension.
+When specifying the TFORMn keyword value which defines the format of a
+column, CFITSIO recognized 3 additional data type codes besides those
+already defined in the FITS standard: `U' meaning a 16-bit unsigned
+integer column, `V' for a 32-bit unsigned integer column, and 'S'
+for a signed byte column.  These non-standard data type codes are not
+actually written into the FITS file but instead are just used internally
+within CFITSIO.  The following code fragment illustrates how to use
+these features:
 -
-where the root `file' names are currently restricted to be 'h0', 'h1',
-'h2', 'h3', etc., up to a maximumn number defined by the the value of
-SHARED\_MAXSEG (equal to 16 by default).  This is a prototype
-implementation of the shared memory interface and a more robust
-interface, which will have fewer restrictions on the number of files
-and on their names, may be developed in the future.
+      unsigned short uarray[100];
+      unsigned int  varray[100];
 
-When opening an already existing FITS file in shared memory one calls
-the usual CFITSIO routine:
--
-   fits_open_file(&fitsfileptr, "shmem://h7", mode, &status)
--
-The file mode can be READWRITE or READONLY just as with disk files.
-More than one process can operate on READONLY mode files at the same
-time.  CFITSIO supports proper filelocking (both in READONLY and
-READWRITE modes), so calls to fits\_open\_file may be locked out until
-another other process closes the file.
+      int colnum, tfields, status;
+      long nrows, firstrow, firstelem, nelements, pcount;
 
-When an application is finished accessing a FITS file in a shared
-memory segment, it may close it  (and the file will remain in the
-system) with fits\_close\_file, or delete it with fits\_delete\_file.
-Physical deletion is postponed until the last process calls
-ffclos/ffdelt.  fits\_delete\_file tries to obtain a READWRITE lock on
-the file to be deleted, thus it can be blocked if the object was not
-opened in READWRITE mode.
+      char extname[] = "Test_table";           /* extension name */
 
-A shared memory management utility program called `smem', is included
-with the CFITSIO distribution.  It can be built by typing `make smem';
-then type `smem -h' to get a list of valid options.  Executing smem
-without any options causes it to list all the shared memory segments
-currently residing in the system and managed by the shared memory
-driver. To get a list of all the shared memory objects, run the system
-utility program `ipcs  [-a]'.
+      /* define the name, data type, and physical units for the 2 columns */
+      char *ttype[] = { "Col_1", "Col_2", "Col_3" };
+      char *tform[] = { "1U",      "1V",    "1S"};  /* special CFITSIO codes */
+      char *tunit[] = { " ",        " ",    " " };
+       ...
 
-***2.  Base Filename
+           /* write the header keywords */
+      status  = 0;
+      nrows   = 1;
+      tfields = 3
+      pcount  = 0;
+      fits_create_tbl(fptr, BINARY_TBL, nrows, tfields, ttype, tform,
+                tunit, extname, &status);
 
-The base filename is the name of the file optionally including the
-director/subdirectory path, and in the case of `ftp', `http', and `root'
-filetypes, the machine identifier.  Examples:
--
-    myfile.fits
-    !data.fits
-    /data/myfile.fits
-    fits.gsfc.nasa.gov/ftp/sampledata/myfile.fits.gz
+           /* write the unsigned shorts to the 1st column */
+      colnum    = 1;
+      firstrow  = 1;
+      firstelem = 1;
+      nelements = 100;
+      fits_write_col(fptr, TUSHORT, colnum, firstrow, firstelem,
+              nelements, uarray, &status);
+
+           /* now write the unsigned longs to the 2nd column */
+      colnum    = 2;
+      fits_write_col(fptr, TUINT, colnum, firstrow, firstelem,
+              nelements, varray, &status);
+       ...
 -
+Note that the non-standard TFORM values for the 3 columns, `U' and `V',
+tell CFITSIO to write the keywords appropriate for unsigned 16-bit and
+unsigned 32-bit integers, respectively (i.e., TFORMn = '1I' and TZEROn
+= 32678 for unsigned 16-bit integers, and TFORMn = '1J' and TZEROn =
+2147483648 for unsigned 32-bit integers).  The 'S' TFORMn value tells
+CFITSIO to write the keywords appropriate for a signed 8-bit byte column
+with TFORMn = '1B' and TZEROn = -128.  The calls to fits\_write\_col
+then write the arrays of unsigned integer values to the columns.
 
-When creating a new output file on magnetic disk (of type file://) if
-the base filename begins with an exclamation point (!) then any
-existing file with that same basename will be deleted prior to creating
-the new FITS file.  Otherwise if the file to be created already exists,
-then CFITSIO will return an error and will not overwrite the existing
-file.  Note  that the exclamation point,  '!', is a special UNIX character,
-so if it is used  on the command line rather than entered at a task
-prompt, it must be  preceded by a backslash to force the UNIX
-shell to pass it verbatim to the application program.
+**E.  Dealing with Character Strings
 
-The input file may be compressed with the gzip or Unix compress
-algorithms, in which case CFITSIO will uncompress the file on the fly
-into a temporary file (in memory or on disk).  Compressed files may
-only be opened with read-only permission.  When specifying the name of
-a compressed FITS file it is not necessary to append the file suffix
-(e.g., `.gz' or `.Z').  If CFITSIO cannot find the input file name
-without the suffix, then it will automatically search for a compressed
-file with the same root name.  In the case of reading ftp and http type
-files, CFITSIO generally looks for a compressed version of the file
-first, before trying to open the uncompressed file.  By default,
-CFITSIO copies (and uncompressed if necessary) the ftp or http FITS
-file into memory on the local machine before opening it.  This will
-fail if the local machine does not have enough memory to hold the whole
-FITS file, so in this case, the output filename specifier (see the next
-section) can be used to further control how CFITSIO reads ftp and http
-files.
+The character string values in a FITS header or in an ASCII column in a
+FITS table extension are generally padded out with non-significant
+space characters (ASCII 32) to fill up the header record or the column
+width.  When reading a FITS string value, the CFITSIO routines will
+strip off these non-significant trailing spaces and will return a
+null-terminated string value containing only the significant
+characters.  Leading spaces in a FITS string are considered
+significant.  If the string contains all blanks, then CFITSIO will
+return a single blank character, i.e, the first blank is considered to
+be significant, since it distinguishes the string from a null or
+undefined string, but the remaining trailing spaces are not
+significant.
+
+Similarly, when writing string values to a FITS file the
+CFITSIO routines expect to get a null-terminated string as input;
+CFITSIO will pad the string with blanks if necessary when writing it
+to the FITS file.  
 
-One special case is where the filename = `-' (a dash or minus sign),
-which signifies that the input file is to be read from the stdin
-stream, or written to the stdout stream if a new output file is being
-created.  In the case of reading from stdin, CFITSIO first copies the
-whole stream into a temporary FITS file (in memory or on disk), and
-subsequent reading of the FITS file occurs in this copy.  When writing
-to stdout, CFITSIO first constructs the whole file in memory (since
-random access is required), then flushes it out to the stdout stream
-when the file is closed.  This feature allows FITS files to be piped
-between tasks in memory rather than having to create temporary
-intermediate FITS files on disk.  For example if task1 creates an
-output FITS file, and task2 reads an input FITS file, the FITS file may
-be piped between the 2 tasks by specifying
+When calling CFITSIO routines that return a character string it is
+vital that the size of the char array be large enough to hold the
+entire string of characters, otherwise CFITSIO will overwrite whatever
+memory locations follow the char array, possibly causing the program to
+execute incorrectly.  This type of error can be difficult to debug, so
+programmers should always ensure that the char arrays are allocated
+enough space to hold the longest possible string, {\bf including} the
+terminating NULL character.  The fitsio.h file contains the following
+defined constants which programmers are strongly encouraged to use
+whenever they are allocating space for char arrays:
 -
-   task1 - | task2 - 
+#define FLEN_FILENAME 1025 /* max length of a filename */
+#define FLEN_KEYWORD   72  /* max length of a keyword  */
+#define FLEN_CARD      81  /* length of a FITS header card */
+#define FLEN_VALUE     71  /* max length of a keyword value string */
+#define FLEN_COMMENT   73  /* max length of a keyword comment string */
+#define FLEN_ERRMSG    81  /* max length of a CFITSIO error message */ 
+#define FLEN_STATUS    31  /* max length of a CFITSIO status text string */ 
 -
-where the vertical bar is the Unix piping symbol.  This assumes that the 2
-tasks read the name of the FITS file off of the command line.
-
-***3.  Output File Name when Opening an Existing File
-
-An optional output filename may be specified in parentheses immediately
-following the base file name to be opened.  This is mainly useful in
-those cases where CFITSIO creates a temporary copy of the input FITS
-file before it is opened and passed to the application program.  This
-happens by default when opening a network FTP or HTTP-type file, when
-reading a compressed FITS file on a local disk, when reading from the
-stdin stream, or when a column filter, row filter, or binning specifier
-is included as part of the input file specification.  By default this
-temporary file is created in memory.  If there is not enough memory to
-create the file copy, then CFITSIO will exit with an error.   In these
-cases one can force a permanent file to be created on disk, instead of
-a temporary file in memory, by supplying the name in parentheses
-immediately following the base file name.  The output filename can
-include the '!' clobber flag.
-
-Thus, if the input filename to CFITSIO is:
+For example, when declaring a char array to hold the value string
+of FITS keyword, use the following statement:
 -
-    file1.fits.gz(file2.fits)
+    char value[FLEN_VALUE];
 -
-then CFITSIO will uncompress `file1.fits.gz' into the local disk file
-`file2.fits' before opening it.  CFITSIO does not automatically delete
-the output file, so it will still exist after the application program
-exits.
-
-In some cases, several different temporary FITS files will be created
-in sequence, for instance, if one opens a remote file using FTP, then
-filters rows in a binary table extension, then create an image by
-binning a pair of columns.  In this case, the remote file will be
-copied to a temporary local file, then a second temporary file will be
-created containing the filtered rows of the table, and finally a third
-temporary file containing the binned image will be created.  In cases
-like this where multiple files are created, the outfile specifier will
-be interpreted the name of the final file as described below, in descending
-priority:
-
-\begin{itemize}
-\item
-as the name of the final image file if an image within a single binary
-table cell is opened or if an image is created by binning a table column.
-\item
-as the name of the file containing the filtered table if a column filter
-and/or a row filter are specified.
-\item
-as the name of the local copy of the remote FTP or HTTP file.
-\item
-as the name of the uncompressed version of the FITS file, if a
-compressed FITS file on local disk has been opened.
-\item
-otherwise, the output filename is ignored.
-\end{itemize}
-
+Note that FLEN\_KEYWORD is longer than needed for the nominal 8-character
+keyword name because the HIERARCH convention supports longer keyword names.
+ 
+**F.  Implicit Data Type Conversion
+ 
+The CFITSIO routines that read and write numerical data can perform
+implicit data type conversion.  This means that the data type of the
+variable or array in the program does not need to be the same as the
+data type of the value in the FITS file.  Data type conversion is
+supported for numerical and string data types (if the string contains a
+valid number enclosed in quotes) when reading a FITS header keyword
+value and for numeric values when reading or writing values in the
+primary array or a table column.  CFITSIO returns status =
+NUM\_OVERFLOW  if the converted data value exceeds the range of the
+output data type.  Implicit data type conversion is not supported
+within binary tables for string, logical, complex, or double complex
+data types.
+
+In addition, any table column may be read as if it contained string values.
+In the case of numeric columns the returned string will be formatted
+using the TDISPn display format if it exists.
+
+**G.  Data Scaling
+ 
+When reading numerical data values in the primary array or a
+table column, the values will be scaled automatically by the BSCALE and
+BZERO (or TSCALn and TZEROn) header values if they are
+present in the header.  The scaled data that is returned to the reading
+program will have
+-
+        output value = (FITS value) * BSCALE + BZERO
+-
+(a corresponding formula using TSCALn and TZEROn is used when reading
+from table columns).  In the case of integer output values the floating
+point scaled value is truncated to an integer (not rounded to the
+nearest integer).  The fits\_set\_bscale and fits\_set\_tscale routines
+(described in the `Advanced' chapter) may be used to override the
+scaling parameters defined in the header (e.g., to turn off the scaling
+so that the program can read the raw unscaled values from the FITS
+file).
 
-The output file specifier is useful when reading FTP or HTTP-type
-FITS files since it can be used to create a local disk copy of the file
-that can be reused in the future.  If the output file name = `*' then a
-local file with the same name as the network file will be created.
-Note that CFITSIO will behave differently depending on whether the
-remote file is compressed or not as shown by the following examples:
-\begin{itemize}
-\item
-`ftp://remote.machine/tmp/myfile.fits.gz(*)' - the remote compressed
-file is copied to the local compressed file `myfile.fits.gz', which
-is then uncompressed in local memory before being opened and passed
-to the application program.
+When writing numerical data to the primary array or to a table column
+the data values will generally be automatically inversely scaled by the
+value of the BSCALE and BZERO (or TSCALn and TZEROn) keyword values if
+they they exist in the header.  These keywords must have been written
+to the header before any data is written for them to have any immediate
+effect.  One may also use the fits\_set\_bscale and fits\_set\_tscale
+routines to define or override the scaling keywords in the header
+(e.g., to turn off the scaling so that the program can write the raw
+unscaled values into the FITS file). If scaling is performed, the
+inverse scaled output value that is written into the FITS file will
+have
+-
+         FITS value = ((input value) - BZERO) / BSCALE
+-
+(a corresponding formula using TSCALn and TZEROn is used when
+writing to table columns).  Rounding to the nearest integer, rather
+than truncation, is performed when writing integer data types to the
+FITS file.
+ 
+**H.  Support for IEEE Special Values
+ 
+The ANSI/IEEE-754 floating-point number standard defines certain
+special values that are used to represent such quantities as
+Not-a-Number (NaN), denormalized, underflow, overflow, and infinity.
+(See the Appendix in the NOST FITS standard or the NOST FITS User's
+Guide for a list of these values).  The CFITSIO routines that read
+floating point data in FITS files recognize these IEEE special values
+and by default interpret the overflow and infinity values as being
+equivalent to a NaN, and convert the underflow and denormalized values
+into zeros.  In some cases programmers may want access to the raw IEEE
+values, without any modification by CFITSIO.  This can be done by
+calling the fits\_read\_img or fits\_read\_col routines while
+specifying 0.0 as the value of the NULLVAL parameter.  This will force
+CFITSIO to simply pass the IEEE values through to the application
+program without any modification.  This is not fully supported on
+VAX/VMS machines, however, where there is no easy way to bypass the
+default interpretation of the IEEE special values.
 
-\item
-`ftp://remote.machine/tmp/myfile.fits.gz(myfile.fits)' - the remote
-compressed file is copied and uncompressed into the local file
-`myfile.fits'.  This example requires less local memory than the
-previous example since the file is uncompressed on disk instead of
-in memory.
+**I.  Error Status Values and the Error Message Stack
 
-\item
-`ftp://remote.machine/tmp/myfile.fits(myfile.fits.gz)' - this will
-usually produce an error since CFITSIO itself cannot compress files.
-\end{itemize}
+Nearly all the CFITSIO routines return an error status value
+in 2 ways: as the value of the last parameter in the function call,
+and as the returned value of the function itself.  This provides
+some flexibility in the way programmers can test if an error
+occurred, as illustrated in the following 2 code fragments:
+-
+    if ( fits_write_record(fptr, card, &status) )
+         printf(" Error occurred while writing keyword.");
 
-The exact behavior of CFITSIO in the latter case depends on the type of
-ftp server running on the remote machine and how it is configured.  In
-some cases, if the file `myfile.fits.gz' exists on the remote machine,
-then the server will copy it to the local machine.  In other cases the
-ftp server will automatically create and transmit a compressed version
-of the file if only the uncompressed version exists.  This can get
-rather confusing, so users should use a certain amount of caution when
-using the output file specifier with FTP or HTTP file types, to make
-sure they get the behavior that they expect.
+or,
 
-***4.  Template File Name when Creating a New File
+    fits_write_record(fptr, card, &status);
+    if ( status )
+         printf(" Error occurred while writing keyword.");
+-
+A listing of all the CFITSIO status code values is given at the end of
+this document.  Programmers are encouraged to use the symbolic
+mnemonics (defined in fitsio.h) rather than the actual integer status
+values to improve the readability of their code.
 
-When a new FITS file is created with a call to fits\_create\_file, the
-name of a template file may be supplied in parentheses immediately
-following the name of the new file to be created.  This template is
-used to define the structure of one or more HDUs in the new file.  The
-template file may be another FITS file, in which case the newly created
-file will have exactly the same keywords in each HDU as in the template
-FITS file, but all the data units will be filled with zeros.  The
-template file may also be an ASCII text file, where each line (in
-general) describes one FITS keyword record.  The format of the ASCII
-template file is described below.
+The CFITSIO library uses an `inherited status' convention for the
+status parameter which means that if a routine is called with a
+positive input value of the status parameter as input, then the routine
+will exit immediately without changing the value of the status
+parameter.  Thus, if one passes the status value returned from each
+CFITSIO routine as input to the next CFITSIO routine, then whenever an
+error is detected all further CFITSIO processing will cease.  This
+convention can simplify the error checking in application programs
+because it is not necessary to check the value of the status parameter
+after every single CFITSIO routine call.  If a program contains a
+sequence of several CFITSIO calls, one can just check the status value
+after the last call.  Since the returned status values are generally
+distinctive, it should be possible to determine which routine
+originally returned the error status.
 
+CFITSIO also maintains an internal stack of error messages
+(80-character maximum length)  which in many cases provide a more
+detailed explanation of the cause of the error than is provided by the
+error status number alone.  It is recommended that the error message
+stack be printed out whenever a program detects a CFITSIO error.  The
+function fits\_report\_error will print out the entire error message
+stack, or alternatively one may call fits\_read\_errmsg to get the
+error messages one at a time.
 
-****1   Detailed Template Line Format
+**J.  Variable-Length Arrays in Binary Tables
+ 
+CFITSIO provides easy-to-use support for reading and writing data in
+variable length fields of a binary table. The variable length columns
+have TFORMn keyword values of the form `1Pt(len)' where `t' is the
+data type code (e.g., I, J, E, D, etc.) and `len' is an integer
+specifying the maximum length of the vector in the table.  If the value
+of `len' is not specified when the table is created (e.g., if the TFORM
+keyword value is simply specified as '1PE' instead of '1PE(400) ), then
+CFITSIO will automatically scan the table when it is closed to
+determine the maximum length of the vector and will append this value
+to the TFORMn value.
 
-The format of each ASCII template line closely follows the format of a
-FITS keyword record:
--
-  KEYWORD = KEYVALUE / COMMENT
--
-except that free format may be used (e.g., the equals sign may appear
-at any position in the line) and TAB characters are allowed and are
-treated the same as space characters.  The KEYVALUE and COMMENT fields
-are optional.  The equals sign character is also optional, but it is
-recommended that it be included for clarity.  Any template line that
-begins with the pound '\#' character is ignored by the template parser
-and may be use to insert comments into the template file itself.
+The same routines that read and write data in an ordinary fixed length
+binary table extension are also used for variable length fields,
+however, the routine parameters take on a slightly different
+interpretation as described below.
 
-The KEYWORD name field is limited to 8 characters in length and only
-the letters A-Z, digits 0-9, and the hyphen and underscore characters
-may be used, without any embedded spaces. Lowercase letters in the
-template keyword name will be converted to uppercase.  Leading spaces
-in the template line preceding the keyword name are generally ignored,
-except if the first 8 characters of a template line are all blank, then
-the entire line is treated as a FITS comment keyword (with a blank
-keyword name) and is copied verbatim into the FITS header.
+All the data in a variable length field is written into an area called
+the `heap' which follows the main fixed-length FITS binary table. The
+size of the heap, in bytes, is specified by the PCOUNT keyword in the
+FITS header. When creating a new binary table, the initial value of
+PCOUNT should usually be set to zero. CFITSIO will recompute the size
+of the heap as the data is written and will automatically update the
+PCOUNT keyword value when the table is closed.  When writing variable
+length data to a table, CFITSIO will automatically extend the size
+of the heap area if necessary, so that any following HDUs do not
+get overwritten.
 
-The KEYVALUE field may have any allowed  FITS  data type: character
-string, logical, integer, real, complex integer, or complex real.  The
-character string values need not be enclosed in single quote characters
-unless they are necessary to distinguish the string from a different
-data type (e.g.  2.0 is a real but '2.0' is a string).  The keyword has
-an undefined (null) value if the template record only contains blanks
-following the "=" or between the "=" and the "/" comment field
-delimiter.
+By default the heap data area starts immediately after the last row of
+the fixed-length table.  This default starting location may be
+overridden by the THEAP keyword, but this is not recommended.  
+If additional rows of data are added to the table, CFITSIO will
+automatically shift the the heap down to make room for the new
+rows, but it is obviously be more efficient to initially
+create the table with the necessary number of blank rows, so that
+the heap does not needed to be constantly moved.
 
-String keyword values longer than 68 characters (the maximum length
-that will fit in a single FITS keyword record) are permitted using the
-CFITSIO long string convention. They can either be specified as a
-single long line in the template, or by using multiple lines where the
-continuing lines contain the 'CONTINUE' keyword, as in this example:
-- 
-  LONGKEY = 'This is a long string value that is contin&'
-  CONTINUE  'ued over 2 records' / comment field goes here
--
-The format of template lines with CONTINUE keyword is very strict:  3
-spaces must follow CONTINUE and the rest of the line is copied verbatim
-to the FITS file.
+When writing to a variable length field the entire array of values for
+a given row of the table must be written with a single call to
+fits\_write\_col.  The total length of the array is given by nelements
++ firstelem - 1.  Additional elements cannot be appended to an existing
+vector at a later time since any attempt to do so will simply overwrite
+all the previously written data.  Note also that the new data will be
+written to a new area of the heap and the heap space used by the
+previous write cannot be reclaimed.  For this reason each row of a
+variable length field should only be written once.  An exception to
+this general rule occurs when setting elements of an array as
+undefined.  One must first write a dummy value into the array with
+fits\_write\_col, and then call fits\_write\_col\_nul to flag the
+desired elements as undefined.  (Do not use the fits\_write\_colnull
+routines with variable length fields).  Note that the rows of a table,
+whether fixed or variable length, do not have to be written
+consecutively and may be written in any order.
 
-The start of the optional COMMENT field must be preceded by "/", which
-is used to separate it from the keyword value field. Exceptions are if
-the KEYWORD name field contains COMMENT, HISTORY, CONTINUE, or if the
-first 8 characters of the template line are blanks.
+When writing to a variable length ASCII character field (e.g., TFORM =
+'1PA') only a single character string can be written.  The `firstelem'
+and `nelements' parameter values in the fits\_write\_col routine are
+ignored and the number of characters to write is simply determined by
+the length of the input null-terminated character string.
 
-More than one Header-Data Unit (HDU) may be defined in the template
-file.  The start of an HDU definition is denoted with a SIMPLE or
-XTENSION template line:
+The fits\_write\_descript routine is useful in situations where
+multiple rows of a variable length column have the identical array of
+values.  One can simply write the array once for the first row, and
+then use fits\_write\_descript to write the same descriptor values into
+the other rows;  all the rows will then point to the same storage
+location thus saving disk space.
 
-1) SIMPLE begins a Primary HDU definition. SIMPLE may only appear as
-the  first keyword in the template file. If the template file begins
-with XTENSION instead of SIMPLE, then a default empty Primary HDU is
-created, and the template is then assumed to define the keywords
-starting with the first extension following the Primary HDU.
-
-2) XTENSION marks the beginning of a new extension HDU definition.  The
-previous HDU will be closed at this point and processing of the next
-extension begins.
+When reading from a variable length array field one can only read as
+many elements as actually exist in that row of the table; reading does
+not automatically continue with the next row of the table as occurs
+when reading an ordinary fixed length table field.  Attempts to read
+more than this will cause an error status to be returned.  One can
+determine the number of elements in each row of a variable column with
+the fits\_read\_descript routine.
 
-****2   Auto-indexing of Keywords
+**K.  Multiple Access to the Same FITS File
 
-If a template keyword name ends with a "\#" character, it is said to be
-'auto-indexed'.   Each "\#" character will be replaced by the current
-integer index value, which gets reset = 1 at the start of each new HDU
-in the file (or 7 in the special case of a GROUP definition).  The
-FIRST indexed keyword in each template HDU definition is used as the
-'incrementor';  each subsequent occurence of this SAME keyword will
-cause the index value to be incremented.  This behavior can be rather
-subtle, as illustrated in the following examples in which the TTYPE
-keyword is the incrementor in both cases:
--
-  TTYPE# = TIME
-  TFORM# = 1D
-  TTYPE# = RATE
-  TFORM# = 1E
--
-will create TTYPE1, TFORM1, TTYPE2, and TFORM2 keywords.  But if the
-template looks like,
--
-  TTYPE# = TIME
-  TTYPE# = RATE
-  TFORM# = 1D
-  TFORM# = 1E
--
-this results in a FITS files with  TTYPE1, TTYPE2, TFORM2, and TFORM2,
-which is probably not what was intended!
+CFITSIO supports simultaneous read and write access to multiple HDUs in
+the same FITS file.  Thus, one can open the same FITS file twice within
+a single program and move to 2 different HDUs in the file, and then
+read and write data or keywords to the 2 extensions just as if one were
+accessing 2 completely separate FITS files.   Since in general it is
+not possible to physically open the same file twice and then expect to
+be able to simultaneously (or in alternating succession) write to 2
+different locations in the file, CFITSIO recognizes when the file to be
+opened (in the call to fits\_open\_file) has already been opened and
+instead of actually opening the file again, just logically links the
+new file to the old file.  (This only applies if the file is opened
+more than once within the same program, and does not prevent the same
+file from being simultaneously opened by more than one program).  Then
+before CFITSIO reads or writes to either (logical) file, it makes sure
+that any modifications made to the other file have been completely
+flushed from the internal buffers to the file.  Thus, in principle, one
+could open a file twice, in one case pointing to the first extension
+and in the other pointing to the 2nd extension and then write data to
+both extensions, in any order, without danger of corrupting the file,
+There may be some efficiency penalties in doing this however, since
+CFITSIO has to flush all the internal buffers related to one file
+before switching to the  other, so it would still be prudent to
+minimize the number of times one switches back and forth between doing
+I/O to different HDUs in the same file.
 
-****3   Template Parser Directives
+**L.  When the Final Size of the FITS HDU is Unknown
 
-In addition to the template lines which define individual keywords, the
-template parser recognizes 3 special directives which are each preceded
-by the backslash character:  \verb+ \include, \group+, and \verb+ \end+.
+It is not required to know the total size of a FITS data array or table
+before beginning to write the data to the FITS file.  In the case of
+the primary array or an image extension, one should initially create
+the array with the size of the highest dimension (largest NAXISn
+keyword) set to a dummy value, such as 1.  Then after all the data have
+been written and the true dimensions are known, then the NAXISn value
+should be updated using the fits\_update\_key routine before moving to
+another extension or closing the FITS file.
 
-The 'include' directive must be followed by a filename. It forces the
-parser to temporarily stop reading the current template file and begin
-reading the include file. Once the parser reaches the end of the
-include file it continues parsing the current template file.  Include
-files can be nested, and HDU definitions can span multiple template
-files.
+When writing to FITS tables, CFITSIO automatically keeps track of the
+highest row number that is written to, and will increase the size of
+the table if necessary.  CFITSIO will also automatically insert space
+in the FITS file if necessary, to ensure that the data 'heap', if it
+exists, and/or any additional HDUs that follow the table do not get
+overwritten as new rows are written to the table.
 
-The start of a GROUP definition is denoted with the 'group' directive,
-and the end of a GROUP definition is denoted with the 'end' directive.
-Each GROUP contains 0 or more member blocks (HDUs or GROUPs). Member
-blocks of type GROUP can contain their own member blocks. The GROUP
-definition itself occupies one FITS file HDU of special type (GROUP
-HDU), so if a template specifies 1 group with 1 member HDU like:
--
-\group
-grpdescr = 'demo'
-xtension bintable
-# this bintable has 0 cols, 0 rows
-\end
--
-then the parser creates a FITS file with 3 HDUs :
--
-1) dummy PHDU
-2) GROUP HDU (has 1 member, which is bintable in HDU number 3)
-3) bintable (member of GROUP in HDU number 2)
--
-Technically speaking, the GROUP HDU is a BINTABLE with 6 columns. Applications
-can define additional columns in a GROUP HDU using TFORMn and TTYPEn
-(where n is 7, 8, ....) keywords or their auto-indexing equivalents.
+As a general rule it is best to specify the initial number of rows = 0
+when the table is created, then let CFITSIO keep track of the number of
+rows that are actually written.  The application program should not
+manually update the number of rows in the table (as given by the NAXIS2
+keyword) since CFITSIO does this automatically.  If a table is
+initially created with more than zero rows, then this will usually be
+considered as the minimum size of the table, even if fewer rows are
+actually written to the table.  Thus, if a table is initially created
+with NAXIS2 = 20, and CFITSIO only writes 10 rows of data before
+closing the table, then NAXIS2 will remain equal to 20.  If however, 30
+rows of data are written to this table, then NAXIS2 will be increased
+from 20 to 30.  The one exception to this automatic updating of the
+NAXIS2 keyword is if the application program directly modifies the
+value of NAXIS2 (up or down) itself just before closing the table.  In this
+case, CFITSIO does not update NAXIS2 again, since it assumes that the
+application program must have had a good reason for changing the value
+directly.  This is not recommended, however, and is only provided for
+backward compatibility with software that initially creates a table
+with a large number of rows, than decreases the NAXIS2 value to the
+actual smaller value just before closing the table.
 
-For a more complicated example of a template file using the group directives,
-look at the sample.tpl file that is included in the CFITSIO distribution.
+**M.  CFITSIO Size Limitations
 
-****4   Formal Template Syntax
+CFITSIO places very few restrictions on the size of FITS files that it
+reads or writes.  There are a few limits, however, that may affect
+some extreme cases:
 
-The template syntax can formally be defined as follows:
--
-    TEMPLATE = BLOCK [ BLOCK ... ]
+1.  The maximum number of FITS files that may be simultaneously opened
+by CFITSIO is set by NMAXFILES as defined in fitsio2.h.  It is currently
+set = 300 by default.  CFITSIO will allocate about 80 * NMAXFILES bytes
+of memory for internal use.  Note that the underlying C compiler or
+operating system, may have a smaller limit on the number of opened files.
+The C symbolic constant FOPEN\_MAX is intended to define the maximum
+number of files that may open at once (including any other text or
+binary files that may be open, not just FITS files).  On some systems it
+has been found that gcc supports a maximum of 255 opened files.
+
+Note that opening and operating on many FITS files simultaneously in
+parallel may be less efficient than operating on smaller groups of files
+in series.  CFITSIO only has NIOBUF number of internal buffers (set = 40
+by default) that are used for temporary storage of the most recent data
+records that have been read or written in the FITS files.  If the number
+of opened files is greater than NIOBUF, then CFITSIO may waste more time
+flushing and re-reading or re-writing the same records in the FITS files.
+
+2.  By default, CFITSIO can handle FITS files up to 2.1 GB in size
+(2**31 bytes).  This file size limit is often imposed by 32-bit operating
+systems.  More recently, as 64-bit operating systems become more common,
+an industry-wide standard (at least on Unix systems) has been developed to
+support larger sized files (see http://ftp.sas.com/standards/large.file/).
+Starting with version 2.1 of CFITSIO, larger FITS files up to 6
+terabytes in size may be read and written on certain supported platforms.
+In order to support these larger files, CFITSIO must be compiled with
+the `-D\_FILE\_OFFSET\_BITS=64' compiler flag.  Some platforms may
+also require the `-D\_LARGE\_FILES' compiler flag.  All programs that
+link to the CFITSIO library must also be compiled with this flag or must
+include this preprocessor definition at the start of the source code file.
+This causes the compiler to allocate 8-bytes instead of 4-bytes for the
+`off\_t' data type that is used to store file offset positions.
 
-       BLOCK = { HDU | GROUP }
+If CFITSIO is compiled with the -D\_FILE\_OFFSET\_BITS=64 flag on a
+platform that supports large files, then it can read and write FITS
+files that contain up to 2**31 2880-byte FITS records, or approximately
+6 terabytes in size.  It is still required that the value of the NAXISn
+and PCOUNT keywords in each extension be within the range of a signed
+4-byte integer (max value = 2,147,483,648).  Thus, each dimension of an
+image (given by the NAXISn keywords), the total width of a table
+(NAXIS1 keyword), the number of rows in a table (NAXIS2 keyword), and
+the total size of the variable-length array heap in binary tables
+(PCOUNT keyword) must be less than this limit.
 
-       GROUP = \GROUP [ BLOCK ... ] \END
+Currently, support for large files within CFITSIO has been tested
+on the Solaris 2.6 operating system using the Sun cc compiler or gcc
+and on IBM AIX POWER3 and POWER4 systems.
 
-         HDU = XTENSION [ LINE ... ] { XTENSION | \GROUP | \END | EOF }
+*V.  Basic CFITSIO Interface Routines
+ 
+This chapter describes the basic routines in the CFITSIO user interface
+that provide all the functions normally needed to read and write most
+FITS files.  It is recommended that these routines be used for most
+applications and that the more advanced routines described in the
+next chapter only be used in special circumstances when necessary.
 
-        LINE = [ KEYWORD [ = ] ] [ VALUE ] [ / COMMENT ]
+The following conventions are used in this chapter in the description
+of each function:
 
-    X ...     - X can be present 1 or more times
-    { X | Y } - X or Y
-    [ X ]     - X is optional
--
+1. Most functions have 2 names: a long descriptive name and a short
+concise name.  Both names are listed on the first line of the following
+descriptions, separated by a slash (/) character.  Programmers may use
+either name in their programs but the long names are recommended to
+help document the code and make it easier to read.
 
-At the topmost level, the template defines 1 or more template blocks. Blocks
-can be either HDU (Header Data Unit) or a GROUP. For each block the parser
-creates 1 (or more for GROUPs) FITS file HDUs.
+2. A right arrow symbol ($>$) is used in the function descriptions to
+separate the input parameters from the output parameters in the
+definition of each routine.  This symbol is not actually part of the C
+calling sequence. 
 
+3. The function parameters are defined in more detail in the
+alphabetical listing in Appendix B.
 
-****5   Errors
+4.  The first argument in almost all the functions is a pointer to a
+structure of type `fitsfile'.  Memory for this structure is allocated
+by CFITSIO when the FITS file is first opened or created and is freed
+when the FITS file is closed.
 
-In general the fits\_execute\_template() function tries to be as atomic
-as possible, so either everything is done or nothing is done. If an
-error occurs during parsing of the template, fits\_execute\_template()
-will (try to) delete the top level BLOCK (with all its children if any)
-in which the error occured, then it will stop reading the template file
-and it will return with an error.
+5.  The last argument in almost all the functions is the error status
+parameter.  It must be equal to 0 on input, otherwise the function will
+immediately exit without doing anything.  A non-zero output value
+indicates that an error occurred in the function.  In most cases the
+status value is also returned as the value of the function itself.
 
-****6   Examples
+**A.  CFITSIO Error Status Routines
 
-1. This template file will create a 200 x 300 pixel image, with 4-byte
-integer pixel values, in the primary HDU:
+>1  Return a descriptive text string (30 char max.) corresponding to 
+>   a CFITSIO error status code.\label{ffgerr}
 -
-  SIMPLE = T 
-  BITPIX = 32
-  NAXIS = 2     / number of dimensions
-  NAXIS1 = 100  / length of first axis
-  NAXIS2 = 200  / length of second axis
-  OBJECT = NGC 253 / name of observed object
+  void fits_get_errstatus / ffgerr (int status, > char *err_text)
+-
+>2  Return the top (oldest) 80-character error message from the
+    internal CFITSIO stack of error messages and shift any remaining
+    messages on the stack up one level.  Call this routine
+    repeatedly to get each message in sequence.  The function returns
+   a value = 0 and a null error message when the error stack is empty.
+>\label{ffgmsg}
+-
+  int fits_read_errmsg / ffgmsg (char *err_msg)
+-
+>3  Print out the error message corresponding to the input status
+    value and all the error messages on the CFITSIO stack to the specified
+    file stream  (normally to stdout or stderr).  If the input
+    status value = 0 then this routine does nothing.
+>\label{ffrprt}
+-
+  void fits_report_error / ffrprt (FILE *stream, > status)
+-
+>4 The fits\_write\_errmark routine puts an invisible marker on the 
+   CFITSIO error stack.  The fits\_clear\_errmark routine can then be
+   used to delete any more recent error messages on the stack, back to
+   the position of the marker.  This preserves any older error messages
+   on the stack.  The fits\_clear\_errmsg routine simply clears all the
+   messages (and marks) from the stack.  These routines are called
+   without any arguments.
+>\label{ffpmrk}  \label{ffcmsg}
+-
+  void fits_write_errmark / ffpmrk (void)
+  void fits_clear_errmark / ffcmrk (void)
+  void fits_clear_errmsg / ffcmsg (void)
 -
-The allowed values of BITPIX are 8, 16, 32, -32, or -64,
-representing, respectively, 8-bit integer, 16-bit integer, 32-bit
-integer, 32-bit floating point, or 64 bit floating point pixels.
 
-2.  To create a FITS  table, the template first needs to include
-XTENSION = TABLE or BINTABLE to define whether it is an ASCII or binary
-table, and NAXIS2 to define the number of rows in the table.  Two
-template lines are then needed to define the name (TTYPEn) and FITS data
-format (TFORMn) of the columns, as in this example:
+**B.  FITS File Access Routines
+
+>1  Open an existing data file. \label{ffopen}
+
+-
+int fits_open_file / ffopen
+    (fitsfile **fptr, char *filename, int iomode, > int *status)
+
+int fits_open_data / ffdopn
+    (fitsfile **fptr, char *filename, int iomode, > int *status)
+
+int fits_open_table / fftopn
+    (fitsfile **fptr, char *filename, int iomode, > int *status)
+
+int fits_open_image / ffiopn
+    (fitsfile **fptr, char *filename, int iomode, > int *status)
+-
+
+The iomode parameter determines the read/write access allowed in the
+file and can have values of READONLY (0) or READWRITE (1). The filename
+parameter gives the name of the file to be opened, followed by an
+optional argument giving the name or index number of the extension
+within the FITS file that should be moved to and opened (e.g.,
+\verb-myfile.fits+3- or \verb-myfile.fits[3]- moves to the 3rd extension within
+the file, and \verb-myfile.fits[events]- moves to the extension with the
+keyword EXTNAME = 'EVENTS').
+
+The fits\_open\_data routine is similar to the fits\_open\_file routine
+except that it will move to the first HDU containing significant data,
+if a HDU name or number to open was not explicitly specified as
+part of the filename.  In this case, it will look for the first
+IMAGE HDU with NAXIS > 0, or the first table that does not contain the
+strings `GTI' (Good Time Interval extension) or `OBSTABLE' in the
+EXTNAME keyword value.
+
+The fits\_open\_table and fits\_open\_image routines are similar to
+fits\_open\_data except they will move to the first significant table
+HDU or image HDU in the file, respectively, if a HDU name or
+number is not specified as part of the filename.
+
+IRAF images (.imh format files) and raw binary data arrays may also be
+opened with READONLY access.  CFITSIO will automatically test if the
+input file is an IRAF image, and if, so will convert it on the fly into
+a virtual FITS image before it is opened by the application program.
+If the input file is a raw binary data array of numbers, then the data type
+and dimensions of the array must be specified in square brackets
+following the name of the file (e.g.  'rawfile.dat[i512,512]' opens a
+512 x 512 short integer image).  See the `Extended File Name Syntax'
+chapter for more details on how to specify the raw file name.  The raw
+file is converted on the fly into a virtual FITS image in memory that
+is then opened by the application program with READONLY access.
+
+Programs can read the input file from the 'stdin' file stream if a dash
+character ('-') is given as the filename. Files can also be opened over
+the network using FTP or HTTP protocols by supplying the appropriate URL
+as the filename. 
+
+The input file can be modified in various ways to create a virtual file
+(usually stored in memory) that is then opened by the application
+program by supplying a filtering or binning specifier in square brackets
+following the filename. Some of the more common filtering methods are
+illustrated in the following paragraphs, but users should refer to the
+'Extended File Name Syntax' chapter for a complete description of
+the full file filtering syntax. 
+
+When opening an image, a rectangular subset of the physical image may be
+opened by listing the first and last pixel in each dimension (and
+optional pixel skipping factor):
+-
+myimage.fits[101:200,301:400]
+-
+will create and open a 100x100 pixel virtual image of that section of
+the physical image, and \verb+myimage.fits[*,-*]+ opens a virtual image
+that is the same size as the physical image but has been flipped in
+the vertical direction.
+
+When opening a table, the filtering syntax can be used to add or delete
+columns or keywords in the virtual table: 
+\verb-myfile.fits[events][col !time; PI = PHA*1.2]- opens a virtual table in which the TIME column
+has been deleted and a new PI column has been added with a value 1.2
+times that of the PHA column. Similarly, one can filter a table to keep
+only those rows that satisfy a selection criterion:
+\verb-myfile.fits[events][pha > 50]- creates and opens a virtual table
+containing only those rows with a PHA value greater than 50. A large
+number of boolean and mathematical operators can be used in the
+selection expression. One can also filter table rows using 'Good Time
+Interval' extensions, and spatial region filters as in
+\verb-myfile.fits[events][gtifilter()]- and
+\verb-myfile.fits[events][regfilter( "stars.rng")]-.
+
+Finally, table columns may be binned or histogrammed to generate a
+virtual image. For example, \verb-myfile.fits[events][bin (X,Y)=4]- will
+result in a 2-dimensional image calculated by binning the X and Y
+columns in the event table with a bin size of 4 in each dimension. The
+TLMINn and TLMAXn keywords will be used by default to determine the
+range of the image. 
+
+A single program can open the same FITS file more than once and then
+treat the resulting fitsfile pointers as though they were completely
+independent FITS files. Using this facility, a program can open a FITS
+file twice, move to 2 different extensions within the file, and then
+> read and write data in those extensions in any order.
+
+>2   Create and open a new empty output FITS file. \label{ffinit}
+
+-
+int fits_create_file / ffinit
+    (fitsfile **fptr, char *filename, > int *status)
+-
+
+An error will be returned if the specified file already exists, unless
+the filename is prefixed with an exclamation point (!). In that case
+CFITSIO will overwrite (delete) any existing file with the same name.
+Note that the exclamation point is a special UNIX character so if
+it is used on the command line it must be preceded by a backslash to
+force the UNIX shell to accept the character as part of the filename. 
+
+The output file will be written to the 'stdout' file stream if a dash
+character ('-') or the string 'stdout' is given as the filename. Similarly,
+'-.gz' or 'stdout.gz' will cause the file to be gzip compressed before
+it is written out to the stdout stream.
+
+Optionally, the name of a template file that is used to define the
+structure of the new file may be specified in parentheses following the
+output file name. The template file may be another FITS file, in which
+case the new file, at the time it is opened, will be an exact copy of
+the template file except that the data structures (images and tables)
+will be filled with zeros. Alternatively, the template file may be an
+ASCII format text file containing directives that define the keywords to be
+created in each HDU of the file. See the 'Extended File Name Syntax'
+> section for a complete description of the template file syntax. 
+
+>3  Close a previously opened FITS file.  The first routine simply
+closes the file, whereas the second one also DELETES THE FILE, which
+can be useful in cases where a FITS file has been partially created,
+but then an error occurs which prevents it from being completed.
+> \label{ffclos} \label{ffdelt}
 -
-  xtension = bintable
-  naxis2 = 40
-  ttype# = Name
-  tform# = 10a
-  ttype# = Npoints
-  tform# = j
-  ttype# = Rate
-  tunit# = counts/s
-  tform# = e
+  int fits_close_file / ffclos (fitsfile *fptr, > int *status)
+
+  int fits_delete_file / ffdelt (fitsfile *fptr, > int *status)
 -
-The above example defines a null primary array followed by a 40-row
-binary table extension with 3 columns called 'Name', 'Npoints', and
-'Rate', with data formats of '10A' (ASCII character string), '1J'
-(integer) and '1E' (floating point), respectively.  Note that the other
-required FITS keywords (BITPIX, NAXIS, NAXIS1, PCOUNT, GCOUNT, TFIELDS,
-and END) do not need to be explicitly defined in the template because
-their values can be inferred from the other keywords in the template.
-This example also illustrates that the templates are generally
-case-insensitive (the keyword names and TFORMn values are converted to
-upper-case in the FITS file) and that string keyword values generally
-do not need to be enclosed in quotes.
+>4 Return the name, I/O mode (READONLY or READWRITE), and/or the file
+type (e.g. 'file://', 'ftp://') of the opened FITS file. \label{ffflnm}
+> \label{ffflmd} \label{ffurlt}
+-
+  int fits_file_name / ffflnm (fitsfile *fptr, > char *filename, int *status)
 
-***5.  HDU Location Specification
+  int fits_file_mode / ffflmd (fitsfile *fptr, > int *iomode, int *status)
+ 
+  int fits_url_type / ffurlt (fitsfile *fptr, > char *urltype, int *status)
+-
+**C.  HDU Access Routines
 
-The optional HDU location specifier defines which HDU (Header-Data
-Unit, also known as an `extension') within the FITS file to initially
-open.  It must immediately follow the base file name (or the output
-file name if present).  If it is not specified then the first HDU (the
-primary array) is opened.  The HDU location specifier is required if
-the colFilter, rowFilter, or binSpec specifiers are present, because
-the primary array is not a valid HDU for these operations. The HDU may
-be specified either by absolute position number, starting with 0 for
-the primary array, or by reference to the HDU name, and optionally, the
-version number and the HDU type of the desired extension.  The location
-of an image within a single cell of a binary table may also be 
-specified, as described below.
-
-The absolute position of the extension is specified either by enclosed
-the number in square brackets (e.g., `[1]' = the first extension
-following the primary array) or by preceded the number with a plus sign
-(`+1').  To specify the HDU by name, give the name of the desired HDU
-(the value of the EXTNAME or HDUNAME keyword) and optionally the
-extension version number (value of the EXTVER keyword) and the
-extension type (value of the XTENSION keyword: IMAGE, ASCII or TABLE,
-or BINTABLE), separated by commas and all enclosed in square brackets.
-If the value of EXTVER and XTENSION are not specified, then the first
-extension with the correct value of EXTNAME is opened. The extension
-name and type are not case sensitive, and the extension type may be
-abbreviated to a single letter (e.g., I = IMAGE extension or primary
-array, A or T = ASCII table extension, and B = binary table BINTABLE
-extension).   If the HDU location specifier is equal to `[PRIMARY]' or
-`[P]', then the primary array (the first HDU) will be opened.
+The following functions perform operations on Header-Data Units (HDUs)
+as a whole.
+
+>1  Move to a different HDU in the file.  The first routine moves to a
+    specified absolute HDU number (starting with 1 for the primary
+    array) in the FITS file, and the second routine moves a relative
+    number HDUs forward or backward from the current HDU.  A null
+    pointer may be given for the hdutype parameter if it's value is not
+    needed.  The third routine moves to the (first) HDU which has the
+    specified extension type and EXTNAME and EXTVER keyword values (or
+    HDUNAME and HDUVER keywords).  The hdutype parameter may have a
+    value of IMAGE\_HDU, ASCII\_TBL, BINARY\_TBL, or ANY\_HDU where
+    ANY\_HDU means that only the extname and extver values will be used
+    to locate the correct extension.  If the input value of extver is 0
+    then the EXTVER keyword is ignored and the first HDU with a
+    matching EXTNAME (or HDUNAME) keyword will be found.  If no
+    matching HDU is found in the file then the current HDU will remain
+    unchanged and a status = BAD\_HDU\_NUM will be returned.
+>  \label{ffmahd} \label{ffmrhd} \label{ffmnhd}
+-
+  int fits_movabs_hdu / ffmahd
+      (fitsfile *fptr, int hdunum, > int *hdutype, int *status)
 
-FITS images are most commonly stored in the primary array or an image
-extension, but images can also be stored as a vector in a single cell
-of a binary table (i.e. each row of the vector column contains a
-different image).  Such an image can be opened with CFITSIO by
-specifying the desired column  name and the row number after the binary
-table HDU specifier as shown in the following examples. The column name
-is separated from the HDU specifier by a semicolon and the row number
-is enclosed in parentheses.  In this case CFITSIO copies the image from
-the table cell into a temporary primary array before it is opened.  The
-application program then just sees the image in the primary array,
-without any extensions.  The particular row to be opened may be
-specified either by giving an absolute integer row number (starting
-with 1 for the first row), or by specifying a boolean expression that
-evaluates to TRUE for the desired row.  The first row that satisfies
-the expression will be used.  The row selection expression has the same
-syntax as described in the Row Filter Specifier section, below.
+  int fits_movrel_hdu / ffmrhd
+      (fitsfile *fptr, int nmove, > int *hdutype, int *status)
 
- Examples:
+  int fits_movnam_hdu / ffmnhd
+      (fitsfile *fptr, int hdutype, char *extname, int extver, > int *status)
 -
-   myfile.fits[3] - open the 3rd HDU following the primary array
-   myfile.fits+3  - same as above, but using the FTOOLS-style notation  
-   myfile.fits[EVENTS] - open the extension that has EXTNAME = 'EVENTS'
-   myfile.fits[EVENTS, 2]  - same as above, but also requires EXTVER = 2
-   myfile.fits[events,2,b] - same, but also requires XTENSION = 'BINTABLE'
-   myfile.fits[3; images(17)] - opens the image in row 17 of the 'images'
-                                column in the 3rd extension of the file.
-   myfile.fits[3; images(exposure > 100)] - as above, but opens the image
-                   in the first row that has an 'exposure' column value
-                   greater than 100.
+>2  Return the total number of HDUs in the FITS file.
+>   The current HDU remains unchanged. \label{ffthdu}
 -
-
-***6.  Image Section
-
-A virtual file containing a rectangular subsection of an image can be
-extracted and opened by specifying the range of pixels (start:end)
-along each axis to be extracted from the original image.  One can also
-specify an optional pixel increment (start:end:step) for each axis of
-the input image.  A pixel step = 1 will be assumed if it is not
-specified.  If the start pixel is larger then the end pixel, then the
-image will be flipped (producing a mirror image) along that dimension.
-An asterisk, '*', may be used to specify the entire range of an axis,
-and '-*' will flip the entire axis. The input image can be in the
-primary array, in an image extension, or contained in a vector cell of
-a binary table. In the later 2 cases the extension name or number must
-be specified before the image section specifier.
-
- Examples:
+  int fits_get_num_hdus / ffthdu
+      (fitsfile *fptr, > int *hdunum, int *status)
 -
-  myfile.fits[1:512:2, 2:512:2] -  open a 256x256 pixel image
-              consisting of the odd numbered columns (1st axis) and 
-              the even numbered rows (2nd axis) of the image in the 
-              primary array of the file.
+>3  Return the number of the current HDU (CHDU) in the FITS file (where
+    the primary array = 1).  This function returns the HDU number
+>   rather than a status value.  \label{ffghdn}
+-
+  int fits_get_hdu_num / ffghdn
+      (fitsfile *fptr, > int *hdunum)
+-
+>4  Return the type of the current HDU in the FITS file.  The possible
+>   values for hdutype are: IMAGE\_HDU, ASCII\_TBL, or BINARY\_TBL.  \label{ffghdt}
+-
+  int fits_get_hdu_type / ffghdt
+      (fitsfile *fptr, > int *hdutype, int *status)
+-
+>5  Copy all or part of the HDUs in the FITS file associated with infptr
+    and append them to the end of the FITS file associated with
+    outfptr.  If 'previous' is true (not 0), then any HDUs preceding
+    the current HDU in the input file will be copied to the output
+    file.  Similarly, 'current' and 'following' determine whether the
+    current HDU, and/or any following HDUs in the input file will be
+    copied to the output file. Thus, if all 3 parameters are true, then the
+    entire input file will be copied.  On exit, the current HDU in
+    the input file will be unchanged, and the last HDU in the output
+>   file will be the current HDU.  \label{ffcpfl}
+-
+  int fits_copy_file / ffcpfl
+      (fitsfile *infptr, fitsfile *outfptr, int previous, int current,
+          int following, > int *status)
+-
+>6  Copy the current HDU from the FITS file associated with infptr and append it
+    to the end of the FITS file associated with outfptr.  Space may be 
+>   reserved for MOREKEYS additional keywords in the output header. \label{ffcopy}
+-
+  int fits_copy_hdu / ffcopy
+      (fitsfile *infptr, fitsfile *outfptr, int morekeys, > int *status)
+-
+>7   Copy the header (and not the data) from the CHDU associated with infptr
+    to the CHDU associated with outfptr.  If the current output HDU
+    is not completely empty, then the CHDU will be closed and a new
+    HDU will be appended to the output file.   An empty output data unit
+>   will be created with all values initially = 0). \label{ffcphd}
+-
+  int fits_copy_header / ffcphd
+      (fitsfile *infptr, fitsfile *outfptr, > int *status)
+-
+>8   Delete the CHDU in the FITS file.  Any following HDUs will be shifted
+    forward in the file, to fill in the gap created by the deleted
+    HDU.  In the case of deleting the primary array (the first HDU in
+    the file) then the current primary array will be replace by a null
+    primary array containing the minimum set of required keywords and
+    no data.  If there are more extensions in the file following the
+    one that is deleted, then the the CHDU will be redefined to point
+    to the following extension.  If there are no following extensions
+    then the CHDU will be redefined to point to the previous HDU.  The
+    output hdutype parameter returns the type of the new CHDU.  A null
+    pointer may be given for
+>   hdutype if the returned value is not needed. \label{ffdhdu}
+-
+  int fits_delete_hdu / ffdhdu
+      (fitsfile *fptr, > int *hdutype, int *status)
+-
+**D.  Header Keyword Read/Write Routines
 
-  myfile.fits[*, 512:256] - open an image consisting of all the columns
-              in the input image, but only rows 256 through 512.  
-              The image will be flipped along the 2nd axis since
-              the starting pixel is greater than the ending pixel.
+These routines read or write keywords in the Current Header Unit
+(CHU).  Wild card characters (*, ?, or \#) may be used when specifying
+the name of the keyword to be read: a '?' will match any single
+character at that position in the keyword name and a '*' will match any
+length (including zero) string of characters.  The '\#' character will
+match any consecutive string of decimal digits (0 - 9).  When a wild
+card is used the routine will only search for a match from the current
+header position to the end of the header and will not resume the search
+from the top of the header back to the original header position as is
+done when no wildcards are included in the keyword name.  The
+fits\_read\_record routine may be used to set the starting position
+when doing wild card searchs.  A status value of KEY\_NO\_EXIST is
+returned if the specified keyword to be read is not found in the
+header.
 
-  myfile.fits[*:2, 512:256:2] - same as above but keeping only
-              every other row and column in the input image.
+***1.  Keyword Reading Routines
 
-  myfile.fits[-*, *] - copy the entire image, flipping it along
-              the first axis.
+>1  Return the number of existing keywords (not counting the
+    END keyword) and the amount of space currently available for more
+    keywords.  It returns morekeys = -1 if the header has not yet been
+    closed.  Note that CFITSIO will dynamically add space if required
+    when writing new keywords to a header so in practice there is no
+    limit to the number of keywords that can be added to a header.  A
+    null pointer may be entered for the morekeys parameter if it's
+>   value is not needed. \label{ffghsp}
+-
+  int fits_get_hdrspace / ffghsp
+      (fitsfile *fptr, > int *keysexist, int *morekeys, int *status)
+-
+>2  Return the specified keyword.  In the first routine, 
+    the datatype parameter specifies the desired returned data type of the
+    keyword value and can have one of the following symbolic constant
+    values:  TSTRING, TLOGICAL (== int), TBYTE, TSHORT, TUSHORT, TINT,
+    TUINT, TLONG, TULONG, TFLOAT, TDOUBLE, TCOMPLEX, and TDBLCOMPLEX.
+    Within the context of this routine, TSTRING corresponds to a
+    'char*' data type, i.e., a pointer to a character array.  Data type
+    conversion will be performed for numeric values if the keyword
+    value does not have the same data type.  If the value of the keyword
+    is undefined (i.e., the value field is blank) then an error status
+    = VALUE\_UNDEFINED will be returned.
 
-  myfile.fits[3][1:256,1:256] - opens a subsection of the image that
-              is in the 3rd extension of the file.
+    The second routine returns the keyword value as a character string
+    (a literal copy of what is in the value field) regardless of the
+    intrinsic data type of the keyword.  The third routine returns
+    the entire 80-character header record of the keyword.
 
-  myfile.fits[4; images(12)][1:10,1:10] - open an image consisting
-	      of the first 10 pixels in both dimensions. The original
-	      image resides in the 12th row of the 'images' vector
-	      column in the table in the 4th extension of the file.
+    If a NULL comment pointer is supplied then the comment string
+>   will not be returned. \label{ffgky} \label{ffgkey} \label{ffgcrd}
 -
+  int fits_read_key / ffgky
+      (fitsfile *fptr, int datatype, char *keyname, > DTYPE *value,
+       char *comment, int *status)
 
-When CFITSIO opens an image section it first creates a temporary file
-containing the image section plus a copy of any other HDUs in the
-file.  This temporary file is then opened by the application program,
-so it is not possible to write to or modify the input file when
-specifying an image section.  Note that CFITSIO automatically updates
-the world coordinate system keywords in the header of the image
-section, if they exist, so that the coordinate associated with each
-pixel in the image section will be computed correctly.
-
-***7.  Column and Keyword Filtering Specification
+  int fits_read_keyword / ffgkey
+      (fitsfile *fptr, char *keyname, > char *value, char *comment,
+       int *status)
 
-The optional column/keyword filtering specifier is used to modify the
-column structure and/or the header keywords in the HDU that was
-selected with the previous HDU location specifier. This filtering
-specifier must be enclosed in square brackets and can be distinguished
-from a general row filter specifier (described below) by the fact that
-it begins with the string 'col ' and is not immediately followed by an
-equals sign.  The original file is not changed by this filtering
-operation, and instead the modifications are made on a copy of the
-input FITS file (usually in memory), which also contains a copy of all
-the other HDUs in the file.  This temporary file is passed to the
-application program and will persist only until the file is closed or
-until the program exits, unless the outfile specifier (see above) is
-also supplied.
+  int fits_read_card / ffgcrd
+      (fitsfile *fptr, char *keyname, > char *card, int *status)
+-
+>3  Return the nth header record in the CHU.  The first keyword
+   in the header is at keynum = 1;  if keynum = 0 then these routines
+   simply reset the internal CFITSIO pointer to the beginning of the header
+   so that subsequent keyword operations will start at the top of the
+   header (e.g., prior to searching for keywords using wild cards in
+   the keyword name).   The first routine returns the entire
+   80-character header record, while the second routine parses the
+   record and returns the name, value, and comment fields as separate
+   character strings.  If a NULL comment pointer is given on input,
+   then the comment string will not be 
+>  returned. \label{ffgrec} \label{ffgkyn}
+-
+  int fits_read_record / ffgrec
+      (fitsfile *fptr, int keynum, > char *card, int *status)
 
-The column/keyword filter can be used to perform the following
-operations.  More than one operation may be specified by separating
-them with semi-colons.
+  int fits_read_keyn / ffgkyn
+      (fitsfile *fptr, int keynum, > char *keyname, char *value,
+       char *comment, int *status)
+-
+>4  Return the next keyword whose name matches one of the strings in
+    'inclist' but does not match any of the strings in 'exclist'.
+    The strings in inclist and exclist may contain wild card characters
+    (*, ?, and \#) as described at the beginning of this section.
+    This routine searches from the current header position to the
+    end of the header, only, and does not continue the search from
+    the top of the header back to the original position.  The current
+    header position may be reset with the ffgrec routine.  Note
+    that nexc may be set = 0 if there are no keywords to be excluded.
+    This routine returns status = KEY\_NO\_EXIST if a matching
+>   keyword is not found. \label{ffgnxk}
+-
+  int fits_find_nextkey / ffgnxk
+      (fitsfile *fptr, char **inclist, int ninc, char **exclist,
+       int nexc, > char *card, int  *status)
+-
+>5  Return the physical units string from an existing keyword.  This
+    routine uses a local convention, shown in the following example,
+    in which the keyword units are enclosed in square brackets in the
+    beginning of the keyword comment field.  A null string is returned
+>   if no units are defined for the keyword.  \label{ffgunt}
+-
+     VELOCITY=                 12.3 / [km/s] orbital speed
 
-\begin{itemize}
-\item
-Delete a column or keyword by listing the name preceeded by an
-exclamation mark (!), e.g., '!TIME' will delete the TIME column if it
-exists, otherwise the TIME keyword.  An error is returned if neither a
-column nor keyword with this name exists.  Note  that the exclamation
-point,  '!', is a special UNIX character, so if it is used  on the
-command line rather than entered at a task prompt, it must be  preceded
-by a backslash to force the UNIX shell to ignore it.
+  int fits_read_key_unit / ffgunt
+      (fitsfile *fptr, char *keyname, > char *unit, int *status)
+-
+>6  Concatenate the header keywords in the CHDU into a single long
+    string of characters.  This provides a convenient way of passing
+    all or part of the header information in a FITS HDU to other subroutines.
+    Each 80-character fixed-length keyword record is appended to the
+    output character string, in order, with no intervening separator or
+    terminating characters. The last header record is terminated with
+    a NULL character.  This routine allocates memory for the returned
+    character array, so the calling program must free the memory when
+    finished.
+
+    Selected keywords may be excluded from the returned character string.
+    If the second parameter (nocomments) is TRUE (nonzero) then any
+    COMMENT, HISTORY, or blank keywords in the header will not be copied
+    to the output string.
+
+    The 'exclist' parameter may be used to supply a list of keywords
+    that are to be excluded from the output character string. Wild card
+    characters (*, ?, and \#) may be used in the excluded keyword names.
+    If no additional keywords are to be excluded, then set nexc = 0 and
+>   specify NULL for the the **header  parameter.  \label{ffhdr2str}
+-
+  int fits_hdr2str
+      (fitsfile *fptr, int nocomments, char **exclist, int nexc, 
+      > char **header, int *nkeys, int *status)
+-
+
+***2.  Keyword Writing Routines
+
+>1  Write a keyword of the appropriate data type into the
+    CHU.  The first routine simply appends a new keyword whereas the
+    second routine will update the value and comment fields of the
+    keyword if it already exists, otherwise it appends a new
+    keyword.  Note that the address to the value, and not the value
+    itself, must be entered.    The datatype parameter specifies the
+    data type of the keyword value with one of the following values:
+    TSTRING, TLOGICAL (== int), TBYTE, TSHORT, TUSHORT, TINT, TUINT,
+    TLONG, TULONG, TFLOAT, TDOUBLE.  Within the context of this
+    routine, TSTRING corresponds to a 'char*' data type, i.e., a pointer
+    to a character array.  A null pointer may be entered for the
+    comment parameter in which case the  keyword comment
+>   field will be unmodified or left blank.  \label{ffpky} \label{ffuky}
+-
+  int fits_write_key / ffpky
+      (fitsfile *fptr, int datatype, char *keyname, DTYPE *value,
+          char *comment, > int *status)
 
-\item
-Rename an existing column or keyword with the syntax 'NewName ==
-OldName'.  An error is returned if neither a column nor keyword with
-this name exists.
+  int fits_update_key / ffuky
+      (fitsfile *fptr, int datatype, char *keyname, DTYPE *value,
+          char *comment, > int *status)
+-
+>2  Write a keyword with a null or undefined value (i.e., the
+    value field in the keyword is left blank).  The first routine
+    simply appends a new keyword whereas the second routine will update
+    the value and comment fields of the keyword if it already exists,
+    otherwise it appends a new keyword.  A null pointer may be
+    entered for the comment parameter in which case the  keyword
+    comment
+>   field will be unmodified or left blank. \label{ffpkyu} \label{ffukyu}
+-
+  int fits_write_key_null / ffpkyu
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
 
-\item
-Append a new column or keyword to the table.  To create a column,
-give the new name, optionally followed by the datatype in parentheses,
-followed by a single equals sign and an  expression to be used to
-compute the value (e.g., 'newcol(1J) = 0' will create a new 32-bit
-integer column called 'newcol' filled with zeros).  The datatype is
-specified using the same syntax that is allowed for the value of the
-FITS TFORMn keyword (e.g., 'I', 'J', 'E', 'D', etc. for binary tables,
-and 'I8', F12.3', 'E20.12', etc. for ASCII tables).  If the datatype is
-not specified then an appropriate datatype will be chosen depending on
-the form of the expression (may be a character string, logical, bit, long
-integer, or double column). An appropriate vector count (in the case
-of binary tables) will also be added if not explicitly specified.
+  int fits_update_key_null / ffukyu
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+-
+>3  Write (append) a COMMENT or HISTORY keyword to the CHU.  The comment or 
+    history string will be continued over multiple keywords if it is longer
+>   than 70 characters. \label{ffpcom} \label{ffphis}
+-
+  int fits_write_comment / ffpcom
+      (fitsfile *fptr, char *comment, > int *status)
 
-When creating a new keyword, the keyword name must be preceeded by a 
-pound sign '\#', and the expression must evaluate to a scalar
-(i.e., cannot have a column name in the expression).  The comment
-string for the keyword may be specified in parentheses immediately
-following the keyword name (instead of supplying a datatype as in
-the case of creating a new column).
-
-\item
-Recompute (overwrite) the values in an existing column or keyword by
-giving the name followed by an equals sign and an arithmetic
-expression.
-\end{itemize}
-
-The expression that is used when appending or recomuting columns or
-keywords can be arbitrarily complex and may be a function of other
-header keyword values and other columns (in the same row).  The full
-syntax and available functions for the expression are described below
-in the row filter specification section.
-
-For  complex  or commonly used operations,  one  can also  place the
-operations into a text  file and  import it  into the  column filter
-using  the syntax '[col @filename.txt]'.   The operations can extend
-over multiple lines of the  file, but multiple operations must still
-be separated by semicolons.
-
-Examples:
+  int fits_write_history / ffphis
+      (fitsfile *fptr, char *history, > int *status)
 -
-   [col !TIME; Good == STATUS]   - deletes the TIME column and
-                                   renames the status column to 'Good'
-
-   [col PI=PHA * 1.1 + 0.2]      - creates new PI column from PHA values
-
-   [col rate = rate/exposure]   - recomputes the rate column by dividing
-                                   it by the EXPOSURE keyword value.
+>4  Write the DATE keyword to the CHU. The keyword value will contain
+    the current system date as a character string in 'yyyy-mm-ddThh:mm:ss' 
+    format. If a DATE keyword already exists in the header, then this
+    routine will simply update the keyword value with the current date.
+>   \label{ffpdat}
 -
-
-***8.  Row Filtering Specification
-
-    The  optional row filter is a  boolean expression enclosed in square
-    brackets for filtering or selecting rows from  the input FITS table.
-    A new FITS file is then created  which contains only those
-    rows for  which  the boolean   expression evaluates  to true.   (The
-    primary array and any  other extensions in the  input file  are also
-    copied to the new file).  The original FITS file is closed and
-    the new  file  is opened  and  passed to  the  application
-    program.  The new file will persist only until the file is closed
-    or until the program exits, unless the output file specifier (see 
-    above) is also supplied.
-
-    The expression can  be an arbitrarily  complex  series of operations
-    performed on constants, keyword values,  and column data taken  from
-    the specified FITS TABLE extension.
-
-    Keyword and   column data  are referenced by   name.  Any  string of
-    characters not surrounded by    quotes (ie, a constant  string)   or
-    followed by   an open parentheses (ie,   a  function name)   will be
-    initially interpretted   as a column  name and  its contents for the
-    current row inserted into the expression.  If no such column exists,
-    a keyword of that  name will be searched for  and its value used, if
-    found.  To force the  name to be  interpretted as a keyword (in case
-    there is both a column and keyword with the  same name), precede the
-    keyword name with a single pound sign, '\#', as in '\#NAXIS2'.  Due to
-    the generalities of FITS column and  keyword names, if the column or
-    keyword name  contains a space or a  character which might appear as
-    an arithmetic  term then inclose  the  name in '\$'  characters as in
-    \$MAX PHA\$ or \#\$MAX-PHA\$.  Names are case insensitive.
-
-    To access a table entry in a row other  than the current one, follow
-    the  column's name  with  a row  offset  within  curly  braces.  For
-    example, 'PHA{-3}' will evaluate to the value  of column PHA, 3 rows
-    above  the  row currently  being processed.   One  cannot specify an
-    absolute row number, only a relative offset.  Rows that fall outside
-    the table will be treated as undefined, or NULLs.
-
-    Boolean   operators can be  used in  the expression  in either their
-    Fortran or C forms.  The following boolean operators are available:
+  int fits_write_date / ffpdat
+      (fitsfile *fptr, > int *status)
 -
-    "equal"         .eq. .EQ. ==  "not equal"          .ne.  .NE.  !=
-    "less than"     .lt. .LT. <   "less than/equal"    .le.  .LE.  <= =<
-    "greater than"  .gt. .GT. >   "greater than/equal" .ge.  .GE.  >= =>
-    "or"            .or. .OR. ||  "and"                .and. .AND. &&
-    "negation"     .not. .NOT. !  "approx. equal(1e-7)"  ~
+>5 Write a user specified keyword record into the CHU.  This is
+   a low--level routine which can be used to write any arbitrary
+   record into the header.  The record must conform to the all
+>  the FITS format requirements. \label{ffprec}
 -
-
-Note  that the exclamation
-point,  '!', is a special UNIX character, so if it is used  on the
-command line rather than entered at a task prompt, it must be  preceded
-by a backslash to force the UNIX shell to ignore it.
-
-    The expression may  also include arithmetic operators and functions.
-    Trigonometric  functions use  radians,  not degrees.  The  following
-    arithmetic  operators and  functions  can be  used in the expression
-    (function names are case insensitive):
-
+  int fits_write_record / ffprec
+      (fitsfile *fptr, char *card, > int *status)
 -
-    "addition"           +          "subtraction"          -
-    "multiplication"     *          "division"             /
-    "negation"           -          "exponentiation"       **   ^
-    "absolute value"     abs(x)     "cosine"               cos(x)
-    "sine"               sin(x)     "tangent"              tan(x)
-    "arc cosine"         arccos(x)  "arc sine"             arcsin(x)
-    "arc tangent"        arctan(x)  "arc tangent"          arctan2(x,y)
-    "exponential"        exp(x)     "square root"          sqrt(x)
-    "natural log"        log(x)     "common log"           log10(x)
-    "modulus"            i % j      "random # [0.0,1.0)"   random()
-    "minimum"            min(x,y)   "maximum"              max(x,y)
-    "if-then-else"       b?x:y
+>6 Update an 80-character record in the CHU.  If a keyword with the input
+   name already exists, then it is overwritten by the value of card.  This
+   could modify the keyword name as well as the value and comment fields.
+   If the keyword doesn't already exist then a new keyword card is appended
+>  to the header. \label{ffucrd}
+-
+  int fits_update_card / ffucrd
+      (fitsfile *fptr, char *keyname, char *card, > int *status)
 -
 
-    An alternate syntax for the min and max functions  has only a single
-    argument which  should be  a  vector value (see  below).  The result
-    will be the minimum/maximum element contained within the vector.
-
-    There are three functions that are primarily for use with SAO region
-    files and the  FSAOI  task, but they  can  be  used  directly.  They
-    return  a  boolean true   or  false  depending   on  whether a   two
-    dimensional point is in the region or not:
+>>7  Modify (overwrite) the comment field of an existing keyword. \label{ffmcom}
 -
-    "point in a circular region"
-          circle(xcntr,ycntr,radius,Xcolumn,Ycolumn)
-    
-    "point in an elliptical region"
-         ellipse(xcntr,ycntr,xhlf_wdth,yhlf_wdth,rotation,Xcolumn,Ycolumn)
-    
-    "point in a rectangular region"
-             box(xcntr,ycntr,xfll_wdth,yfll_wdth,rotation,Xcolumn,Ycolumn)
-    
-    where 
-       (xcntr,ycntr) are the (x,y) position of the center of the region
-       (xhlf_wdth,yhlf_wdth) are the (x,y) half widths of the region
-       (xfll_wdth,yfll_wdth) are the (x,y) full widths of the region
-       (radius) is half the diameter of the circle
-       (rotation) is the angle(degrees) that the region is rotated with
-             respect to (xcntr,ycntr)
-       (Xcoord,Ycoord) are the (x,y) coordinates to test, usually column
-             names
-       NOTE: each parameter can itself be an expression, not merely a
-             column name or constant.
+  int fits_modify_comment / ffmcom
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
 -
 
-    There is also a function for testing if  two  values  are  close  to
-    each  other,  i.e.,  if  they are "near" each other to within a user
-    specified tolerance. The  arguments,  value\_1  and  value\_2  can  be
-    integer  or  real  and  represent  the two values who's proximity is
-    being tested to be within the specified tolerance, also  an  integer
-    or real:
+>8  Write the physical units string into an existing keyword.  This
+    routine uses a local convention, shown in the following example,
+    in which the keyword units are enclosed in square brackets in the
+>   beginning of the keyword comment field.  \label{ffpunt}
 -
-                    near(value_1, value_2, tolerance)
+     VELOCITY=                 12.3 / [km/s] orbital speed
+
+  int fits_write_key_unit / ffpunt
+      (fitsfile *fptr, char *keyname, char *unit, > int *status)
 -
-    When  a  NULL, or undefined, value is encountered in the FITS table,
-    the expression will evaluate to NULL unless the undefined  value  is
-    not   actually   required  for  evaluation,  eg.  "TRUE  .or.  NULL" 
-    evaluates to TRUE. The  following  two  functions  allow  some  NULL
-    detection  and  handling:  ISNULL(x)  and  DEFNULL(x,y).  The former
-    returns a boolean value of TRUE if the  argument  x  is  NULL.   The
-    later  "defines"  a  value  to  be  substituted  for NULL values; it
-    returns the value of x if x is not NULL, otherwise  it  returns  the
-    value of y.
-    
-    The  following  type  casting  operators  are  available,  where the
-    inclosing parentheses are required and taken  from  the  C  language
-    usage. Also, the integer to real casts values to double precision:
+>9  Rename an existing keyword, preserving the current value
+>   and comment fields. \label{ffmnam}
 -
-                "real to integer"    (int) x     (INT) x
-                "integer to real"    (float) i   (FLOAT) i
+  int fits_modify_name / ffmnam
+      (fitsfile *fptr, char *oldname, char *newname, > int *status)
 -
+>10  Delete a keyword record.  The space occupied by
+    the keyword is reclaimed by moving all the following header records up
+    one row in the header.  The first routine deletes a keyword at a
+    specified position in the header (the first keyword is at position 1),
+    whereas the second routine deletes a specifically named keyword.
+    Wild card characters may be used when specifying the name of the keyword
+>   to be deleted. \label{ffdrec} \label{ffdkey}
+-
+  int fits_delete_record / ffdrec
+      (fitsfile *fptr, int   keynum,  > int *status)
 
-    Bit  masks can be used to select out rows from bit columns (TFORMn =
-    \#X) in FITS files. To represent the mask,  binary,  octal,  and  hex
-    formats are allowed:
-
+  int fits_delete_key / ffdkey
+      (fitsfile *fptr, char *keyname, > int *status)
 -
-                 binary:   b0110xx1010000101xxxx0001
-                 octal:    o720x1 -> (b111010000xxx001)
-                 hex:      h0FxD  -> (b00001111xxxx1101)
+**E.  Primary Array or IMAGE Extension I/O Routines 
+ 
+These routines read or write data values in the primary data array (i.e.,
+the first HDU in a FITS file) or an IMAGE extension.   There are also
+routines to get information about the data type and size of the image.
+Users should also read the following chapter on the CFITSIO iterator
+function which provides a more `object oriented' method of reading and
+writing images.  The iterator function is a little more complicated to
+use, but the advantages are that it usually takes less code to perform
+the same operation, and the resulting program oftens runs faster because
+the FITS files are read and written using the most efficient block size.
+
+C programmers should note that the ordering of arrays in FITS files, and
+hence in all the CFITSIO calls, is more similar to the dimensionality
+of arrays in Fortran rather than C.  For instance if a FITS image has
+NAXIS1 = 100 and NAXIS2 = 50, then a 2-D array just large enough to hold
+the image should be declared as array[50][100] and not as array[100][50].
+
+The `datatype'  parameter specifies the data type of the `nulval'  and
+`array' pointers and can have one of the following  values:  TBYTE,
+TSBYTE, TSHORT, TUSHORT, TINT, TUINT, TLONG, TLONGLONG, TULONG, TFLOAT,
+TDOUBLE.  Automatic data type conversion is performed if the data type
+of the FITS array (as defined by the BITPIX keyword) differs from that
+specified by 'datatype'.  The data values are also automatically scaled
+by the BSCALE and BZERO keyword values as they are being read or written
+in the FITS array.
+
+>1  Get the data type or equivalent data type of the image.  The 
+    first routine returns the physical data type of the FITS image, as
+    given by the BITPIX keyword, with allowed values of BYTE\_IMG (8),
+    SHORT\_IMG (16), LONG\_IMG (32), FLOAT\_IMG (-32), and DOUBLE\_IMG
+    (-64).  The second routine is similar, except that if the image pixel
+    values are scaled, with non-default values for the BZERO and BSCALE
+    keywords, then the routine will return the 'equivalent' data type
+    that is needed to store the scaled values.  For example, if BITPIX
+    = 16 and BSCALE = 0.1 then the equivalent data type is FLOAT\_IMG.
+    Similarly if BITPIX = 16, BSCALE = 1, and BZERO = 32768, then the
+    the pixel values span the range of an unsigned short integer and
+>   the returned data type will be USHORT\_IMG. \label{ffgidt}
 -
-   
-    In  all  the  representations, an x or X is allowed in the mask as a
-    wild card. Note that the x represents a  different  number  of  wild
-    card  bits  in  each  representation.  All  representations are case
-    insensitive.
-    
-    To construct the boolean expression using the mask  as  the  boolean
-    equal  operator  discribed above on a bit table column. For example,
-    if you had a 7 bit column named flags in a  FITS  table  and  wanted
-    all  rows  having  the bit pattern 0010011, the selection expression
-    would be:
+  int fits_get_img_type / ffgidt
+      (fitsfile *fptr, > int *bitpix, int *status)
 
+  int fits_get_img_equivtype / ffgiet
+      (fitsfile *fptr, > int *bitpix, int *status)
 -
-                            flags == b0010011
-    or
-                            flags .eq. b10011
+>2  Get the number of dimensions, and/or the size of
+    each dimension in the image .  The number of axes in the image is
+    given by naxis, and the size of each dimension is given by the
+    naxes array (a maximum of maxdim dimensions will be returned).
+>   \label{ffgidm} \label{ffgisz} \label{ffgipr}
 -
+  int fits_get_img_dim / ffgidm
+      (fitsfile *fptr, > int *naxis, int *status)
 
-    It is also possible to test if a range of bits is  less  than,  less
-    than  equal,  greater  than  and  greater than equal to a particular
-    boolean value:
+  int fits_get_img_size / ffgisz
+      (fitsfile *fptr, int maxdim, > long *naxes, int *status)
 
+  int fits_get_img_param / ffgipr
+      (fitsfile *fptr, int maxdim, > int *bitpix, int *naxis, long *naxes, 
+       int *status)
 -
-                            flags <= bxxx010xx
-                            flags .gt. bxxx100xx
-                            flags .le. b1xxxxxxx
+>3 Create a new primary array or IMAGE extension with a specified
+   data type and size.  If the FITS file is currently empty then a
+   primary array is created, otherwise a new IMAGE extension is
+>  appended to the file. \label{ffcrim}
 -
-   
-    Notice the use of the x bit value to limit the range of  bits  being
-    compared.
-    
-    It  is  not necessary to specify the leading (most significant) zero
-    (0) bits in the mask, as shown in the second expression above.
-    
-    Bit wise AND, OR and NOT operations are  also  possible  on  two  or
-    more  bit  fields  using  the  '\&'(AND),  '$|$'(OR),  and the '!'(NOT)
-    operators. All of these operators result in a bit  field  which  can
-    then be used with the equal operator. For example:
-
+  int fits_create_img / ffcrim
+      ( fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
 -
-                          (!flags) == b1101100
-                          (flags & b1000001) == bx000001
+>4  Write a rectangular subimage (or the whole image) to the FITS data
+    array.  The fpixel and lpixel arrays give the coordinates of the
+    first (lower left corner) and last (upper right corner) pixels in
+>   FITS image to be written to.  \label{ffpss}
 -
-
-    Bit  fields can be appended as well using the '+' operator.  Strings
-    can be concatenated this way, too.
-    
-    In addition, several constants are built in  for  use  in  numerical
-    expressions:
-
+  int fits_write_subset / ffpss
+      (fitsfile *fptr, int datatype, long *fpixel, long *lpixel,
+       DTYPE *array, > int *status)
 -
-        #pi              3.1415...      #e             2.7182...
-        #deg             #pi/180        #row           current row number
-        #null         undefined value   #snull         undefined string
+>5  Write pixels into the FITS data array.  'fpixel' is an array of
+   length NAXIS which gives the coordinate of the starting pixel to be
+   written to, such that fpixel[0] is in the range 1 to NAXIS1,
+   fpixel[1] is in the range 1 to NAXIS2, etc.  The first routine
+   simply writes the array of pixels to the FITS file (doing data type
+   conversion if necessary) whereas the second routine will substitute
+   the  appropriate FITS null value for any elements which are equal to
+   the input value of nulval (note that this parameter gives the
+   address of the null value, not the null value itself).  For integer
+   FITS arrays, the FITS null value is defined by the BLANK keyword (an
+   error is returned if the BLANK keyword doesn't exist).  For floating
+   point FITS arrays  the special IEEE NaN (Not-a-Number) value will be
+   written into the FITS file.  If a null pointer is entered for
+   nulval, then the null value is ignored and this routine behaves
+>  the same as fits\_write\_pix.   \label{ffppx} \label{ffppxn}
 -
+  int fits_write_pix / ffppx
+      (fitsfile *fptr, int datatype, long *fpixel, long nelements,
+       DTYPE *array, int *status);
 
-    A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
-    "null" constants  are useful for conditionally  setting table values
-    to a NULL, or undefined, value (eg., "col1==-99 ? \#NULL : col1").
-
-  Vector Columns
-
-    Vector columns can also be used  in  building  the  expression.   No
-    special  syntax  is required if one wants to operate on all elements
-    of the vector.  Simply use the column name as for a  scalar  column.
-    Vector  columns  can  be  freely  intermixed  with scalar columns or
-    constants in virtually all expressions.  The result will be  of  the
-    same dimension as the vector.  Two vectors in an expression, though,
-    need to  have  the  same  number  of  elements  and  have  the  same
-    dimensions.   The  only  places  a vector column cannot be used (for
-    now, anyway) are the SAO  region  functions  and  the  NEAR  boolean
-    function.
-
-    Arithmetic and logical operations are all performed on an element by
-    element basis.  Comparing two vector columns,  eg  "COL1  ==  COL2",
-    thus  results  in  another vector of boolean values indicating which
-    elements of the two vectors are equal.  Two functions are  available
-    which   operate   on  vectors:  SUM(x)  and  NELEM(x).   The  former 
-    literally sums all the elements in x, returning a scalar value.   If
-    x  is  a  boolean  vector,  SUM returns the number of TRUE elements.
-    The latter, NELEM, returns the  number  of  elements  in  vector  x.
-    (NELEM  also  operates  on  bit  and string columns, returning their
-    column widths.)  As an example, to test whether all elements of  two
-    vectors  satisfy  a  given  logical  comparison,  one  can  use  the 
-    expression
-
+  int fits_write_pixnull / ffppxn
+      (fitsfile *fptr, int datatype, long *fpixel, long nelements,
+       DTYPE *array, DTYPE *nulval, > int *status);
 -
-              SUM( COL1 > COL2 ) == NELEM( COL1 )
+>6  Set FITS data array elements equal to the appropriate null pixel
+    value. For integer FITS arrays, the FITS null value is defined by
+    the BLANK keyword  (an error is returned if the BLANK keyword
+    doesn't exist). For floating point FITS arrays the special IEEE NaN
+    (Not-a-Number) value will be written into the FITS file.  Note that
+    'firstelem' is a scalar giving the  offset to the first pixel to be
+>    written in the equivalent 1-dimensional array of image pixels. \label{ffpprn}
+-
+  int fits_write_null_img / ffpprn
+      (fitsfile *fptr, long firstelem, long nelements, > int *status)
+-
+>7  Read a rectangular subimage (or the whole image) from the FITS 
+    data array.  The fpixel and lpixel arrays give the coordinates of
+    the first (lower left corner) and last (upper right corner) pixels
+    to be read from the FITS image. Undefined FITS array elements will
+    be returned with a value = *nullval, (note that this parameter
+    gives the address of the null value, not the null value itself)
+    unless nulval = 0 or *nulval = 0, in which case no checks for
+>   undefined pixels will be performed.  \label{ffgsv}
+-
+  int fits_read_subset / ffgsv
+      (fitsfile *fptr, int  datatype, long *fpixel, long *lpixel, long *inc,
+       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
+-
+>8  Read pixels from the FITS data array.  'fpixel' is the starting
+    pixel location and is an array of length NAXIS such that fpixel[0]
+    is in the range 1 to NAXIS1, fpixel[1] is in the range 1 to NAXIS2,
+    etc. The nelements parameter specifies the number of pixels to
+    read.  If fpixel is set to the first pixel, and nelements is set
+    equal to the NAXIS1 value, then this routine would read the first
+    row of the image.  Alternatively, if nelements is set equal to
+    NAXIS1 * NAXIS2 then it would read an entire 2D image, or the first
+    plane of a 3-D datacube.
+
+    The first routine will return any undefined pixels in the FITS array
+    equal to the value of *nullval (note that this parameter gives the
+    address of the null value, not the null value itself) unless nulval
+    = 0 or *nulval = 0, in which case no checks for undefined pixels
+    will be performed.  The second routine is similar except that any
+    undefined pixels will have the corresponding nullarray element set
+>   equal to TRUE (= 1).  \label{ffgpxv}  \label{ffgpxf}
 -
+  int fits_read_pix / ffgpxv
+      (fitsfile *fptr, int  datatype, long *fpixel, long nelements,
+       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
 
-    which will return TRUE if all elements  of  COL1  are  greater  than
-    their corresponding elements in COL2.
-    
-    To  specify  a  single  element  of  a  vector, give the column name
-    followed by  a  comma-separated  list  of  coordinates  enclosed  in
-    square  brackets.  For example, if a vector column named PHAS exists
-    in the table as a one dimensional, 256  component  list  of  numbers
-    from  which  you  wanted to select the 57th component for use in the
-    expression, then PHAS[57] would do the  trick.   Higher  dimensional
-    arrays  of  data  may appear in a column.  But in order to interpret
-    them, the TDIMn keyword must appear in the header.  Assuming that  a
-    (4,4,4,4)  array  is packed into each row of a column named ARRAY4D,
-    the  (1,2,3,4)  component  element  of  each  row  is  accessed   by 
-    ARRAY4D[1,2,3,4].    Arrays   up   to   dimension  5  are  currently 
-    supported.  Each vector index can itself be an expression,  although
-    it  must  evaluate  to  an  integer  value  within the bounds of the
-    vector.  Vector columns which contain spaces or arithmetic operators
-    must   have   their   names  enclosed  in  "\$"  characters  as  with 
-    \$ARRAY-4D\$[1,2,3,4].
-    
-    A  more  C-like  syntax  for  specifying  vector  indices  is   also 
-    available.   The element used in the preceding example alternatively
-    could be specified with the syntax  ARRAY4D[4][3][2][1].   Note  the
-    reverse  order  of  indices  (as in C), as well as the fact that the
-    values are still ones-based (as  in  Fortran  --  adopted  to  avoid
-    ambiguity  for  1D vectors).  With this syntax, one does not need to
-    specify all of the indices.  To  extract  a  3D  slice  of  this  4D
-    array, use ARRAY4D[4].
-    
-    Variable-length vector columns are not supported.
-    
-    Vectors can  be manually constructed  within the expression  using a
-    comma-separated list of  elements surrounded by curly braces ('{}').
-    For example, '{1,3,6,1}' is a 4-element vector containing the values
-    1, 3, 6, and 1.  The  vector can contain  only boolean, integer, and
-    real values (or expressions).  The elements will  be promoted to the
-    highest  datatype   present.  Any   elements   which  are themselves
-    vectors, will be expanded out with  each of its elements becoming an
-    element in the constructed vector.
+  int fits_read_pixnull / ffgpxf
+      (fitsfile *fptr, int  datatype, long *fpixel, long nelements,
+       > DTYPE *array, char *nullarray, int *anynul, int *status)
+-
+**F.  Image Compression  
+
+CFITSIO now transparently supports 2 types of image compression:
+
+1)  The entire FITS file may be externally compressed with the gzip or
+Unix compress algorithm, producing a *.gz or *.Z file, respectively.
+When reading compressed files of this type, CFITSIO first uncompresses
+the entire file into memory before performing the requested read
+operations.  Output files can be directly written in the gzip
+compressed format if the user-specified filename ends with `.gz'.  In
+this case, CFITSIO initially writes the uncompressed file in memory and
+then compresses it and writes it to disk when the FITS file is closed,
+thus saving user disk space. Read and write access to these compressed
+FITS files is generally quite fast; the main limitation is that there
+must be enough available memory (or swap space) to hold the entire
+uncompressed FITS file.
+
+2) CFITSIO also supports a newer image compression format in which the
+image is divided into a grid of rectangular tiles, and each tile of
+pixels is individually compressed.  The compressed tiles are stored in
+rows of a variable length array column in a FITS binary table, but
+CFITSIO recognizes that the binary table extension contains an image
+and treats it as if it were an IMAGE extension.  This tile-compressed
+format is especially well suited for compressing very large images
+because a) the FITS header keywords remain uncompressed for rapid read
+access, and because b) it is possible to extract and uncompress
+sections of the image without having to uncompress the entire image.
+This format is also much more effective in compressing floating point
+images (using a lossy compression algorithm) than simply compressing
+the image using gzip or compress.
+
+A detailed description of this format is available at:
+-
+http://heasarc.gsfc.nasa.gov/docs/software/fitsio/
+       compression/compress_image.html
+-
+
+The N-dimensional FITS image can be divided into any
+desired rectangular grid of compression tiles.  By default the tiles
+are chosen to correspond to the rows of the image, each containing
+NAXIS1 pixels.  For example, a 800 x 800 x 4 pixel data cube would be
+divided in to 3200 tiles containing 800 pixels each by default.
+Alternatively, this data cube could be divided into 256 tiles that are each
+100 X 100 X 1 pixels in size, or 4 tiles containing 800 x 800 X 1
+pixels, or a single tile containing the entire data cube.  Note that
+the image dimensions are not required to be an integer multiple of the
+tile dimensions, so, for example, this data cube could also be divided
+into 250 X 200 pixel tiles, in which case the last tile in each row
+would only contain 50 X 200 pixels.
+
+Currently, 3 image compression algorithms are supported:  Rice, GZIP,
+and PLIO.  Rice and GZIP are general purpose algorithms that can be
+used to compress almost any image.  The PLIO  algorithm, on the other
+hand, is more specialized and was developed for use in IRAF to store
+pixel data quality masks. It is designed to only work on images
+containing positive integers with values up to about 2**24.  Other
+image compression algorithms may be supported in the future.
+
+The 3 supported image compression algorithms are all 'loss-less' when
+applied to integer FITS images;  the pixel values are preserved exactly
+with no loss of information during the compression and uncompression
+process. Floating point FITS images (which have BITPIX = -32 or -64)
+are first quantized into scaled integer pixel values before being
+compressed.  This technique produces much higher compression factors
+than simply using GZIP to compress the image, but it also means that
+the original floating value pixel values may not be precisely returned
+when the image is uncompressed.  When done properly, this only discards
+the 'noise' from the floating point values without losing any
+significant information.  The amount of noise that is discarded can be
+controlled by the 'noise\_bits' compression parameter.
+
+No special action is required to read tile-compressed images because
+all the CFITSIO routines that read normal uncompressed FITS images can
+also read images in the tile-compressed format;  CFITSIO essentially
+treats the binary table that contains the compressed tiles as if
+it were an IMAGE extension.
+
+When creating (writing) a new image with CFITSIO, a normal uncompressed
+FITS primary array or IMAGE extension will be written unless the
+tile-compressed format has been specified in 1 of 2 possible ways:
+
+1)  At run time, when specifying the name of the output FITS file to be
+created at run time, the user can indicate that images should be
+written in tile-compressed format by enclosing the compression
+parameters in square brackets following the root disk file name.   The
+`imcopy' example program that included with the CFITSIO distribution
+can be used for this purpose to compress or uncompress images.  Here
+are some examples of the extended file name syntax for specifying
+tile-compressed output images:
+-
+    myfile.fit[compress]    - use the default compression algorithm (Rice)
+                              and the default tile size (row by row)
+
+    myfile.fit[compress GZIP] - use the specified compression algorithm;
+    myfile.fit[compress Rice]     only the first letter of the algorithm 
+    myfile.fit[compress PLIO]     name is required.
+
+    myfile.fit[compress R 100,100]   - use Rice compression and 
+                                       100 x 100 pixel tile size
+
+    myfile.fit[compress R 100,100;2] - as above, and also use noisebits = 2
+-
+
+2)  Before calling the CFITSIO routine to write the image header
+keywords (e.g., fits\_create\_image) the programmer can call the
+routines described below to specify the compression algorithm and the
+tiling pattern that is to be used.  There are 3 routines for specifying
+the various compression parameters and 3 corresponding routines to
+return the current values of the parameters:
+\label{ffsetcomp}  \label{ffgetcomp}
+-
+  int fits_set_compression_type(fitsfile *fptr, int comptype, int *status)
+  int fits_set_tile_dim(fitsfile *fptr, int ndim, long *tilesize, int *status)
+  int fits_set_noise_bits(fitsfile *fptr, int noisebits, int *status)
+
+  int fits_get_compression_type(fitsfile *fptr, int *comptype, int *status)
+  int fits_get_tile_dim(fitsfile *fptr, int ndim, long *tilesize, int *status)
+  int fits_get_noise_bits(fitsfile *fptr, int *noisebits, int *status)
+-
+3 symbolic constants are defined for use as the value of the
+`comptype' parameter:  GZIP\_1, RICE\_1, or PLIO\_1.  Entering NULL for
+comptype will turn off the tile-compression and cause normal FITS
+images to be written.
+
+The 'noisebits' parameter is only used when compressing floating point
+images.   The default value is 4.  Decreasing the value of noisebits
+will improve the overall compression efficiency at the expense of
+losing more information.
+
+A small example program called 'imcopy' is included with CFITSIO that
+can be used to compress (or uncompress) any FITS image.  This
+program can be used to experiment with the various compression options
+on existing FITS images as shown in these examples:
+-
+1)  imcopy infile.fit 'outfile.fit[compress]' 
+
+       This will use the default compression algorithm (Rice) and the
+       default tile size (row by row)
+
+2)  imcopy infile.fit 'outfile.fit[compress GZIP]' 
+
+       This will use the GZIP compression algorithm and the default
+       tile size (row by row).  The allowed compression algorithms are
+       Rice, GZIP, and PLIO.  Only the first letter of the algorithm
+       name needs to be specified.
+
+3)  imcopy infile.fit 'outfile.fit[compress G 100,100]' 
 
-    A common filtering method  applied to  FITS  files is a time  filter
-    using a Good Time Interval (GTI)  extension.  A high-level function,
-    gtifilter(a,b,c,d),  is  available   which  performs this    special
-    evaluation, returning a boolean result for each time element tested.
-    Its syntax is
+       This will use the GZIP compression algorithm and 100 X 100 pixel
+       tiles.
+
+4)  imcopy infile.fit 'outfile.fit[compress R 100,100; 4]' 
 
--
-       gtifilter( [ "filename" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
--
+       This will use the Rice compression algorithm, 100 X 100 pixel
+       tiles, and noise_bits = 4 (assuming the input image has a
+       floating point data type).  Decreasing the value of noisebits
+       will improve the overall compression efficiency at the expense
+       of losing more information.
 
-    where  each  "[]" demarks   optional parameters.   The  filename, if
-    specified,  can be  blank  ("") which will    mean to use  the first
-    extension  with   the name "*GTI*"  in   the current  file,  a plain
-    extension  specifier (eg, "+2",  "[2]", or "[STDGTI]") which will be
-    used  to  select  an extension  in  the current  file, or  a regular
-    filename with or without an extension  specifier which in the latter
-    case  will mean to  use the first  extension  with an extension name
-    "*GTI*".  Expr can be   any arithmetic expression, including  simply
-    the time  column  name.  A  vector  time expression  will  produce a
-    vector boolean  result.  STARTCOL and  STOPCOL are the  names of the
-    START/STOP   columns in the    GTI extension.  If   one  of them  is
-    specified, they both  must be. Note that  the quotes surrounding the
-    filename and START/STOP column names are required.
+5)  imcopy infile.fit outfile.fit
 
-    In  its  simplest form, no parameters need to be provided -- default
-    values will be used.  The expression "gtifilter()" is equivalent to
+       If the input file is in tile-compressed format, then it will be
+       uncompressed to the output file.  Otherwise, it simply copies
+       the input image to the output image.
+
+6)  imcopy 'infile.fit[1001:1500,2001:2500]'  outfile.fit
+
+       This extracts a 500 X 500 pixel section of the much larger
+       input image (which may be in tile-compressed format).  The
+       output is a normal uncompressed FITS image.
+
+7)  imcopy 'infile.fit[1001:1500,2001:2500]'  outfile.fit.gz
+
+       Same as above, except the output file is externally compressed
+       using the gzip algorithm.
 
 -
-       gtifilter( "", TIME, "*START*", "*STOP*" )
--
+**G.  ASCII and Binary Table Routines
+ 
+These routines perform read and write operations on columns of data in
+FITS ASCII or Binary tables.  Note that in the following discussions,
+the first row and column in a table is at position 1 not 0.
 
-    This will search the current file for a GTI  extension,  filter  the
-    TIME  column in the current table, using START/STOP times taken from
-    columns in the GTI  extension  with  names  containing  the  strings
-    "START"  and "STOP".  The wildcards ('*') allow slight variations in
-    naming conventions  such  as  "TSTART"  or  "STARTTIME".   The  same
-    default  values  apply for unspecified parameters when the first one
-    or  two  parameters  are  specified.   The  function   automatically 
-    searches   for   TIMEZERO/I/F   keywords  in  the  current  and  GTI 
-    extensions, applying a relative time offset, if necessary.
+Users should also read the following chapter on the CFITSIO iterator
+function which provides a more `object oriented' method of reading and
+writing table columns.  The iterator function is a little more
+complicated to use, but the advantages are that it usually takes less
+code to perform the same operation, and the resulting program oftens
+runs faster because the FITS files are read and written using the most
+efficient block size.
 
-    Another common  filtering method is  a  spatial filter using  a SAO-
-    style region file.  The syntax for this high-level filter is
+***1.  Create New Table
 
+>1 Create a new ASCII or bintable table extension. If
+   the FITS file is currently empty then a dummy primary array will be
+   created before appending the table extension to it.  The tbltype
+   parameter defines the type of table and can have values of
+   ASCII\_TBL or BINARY\_TBL.  The naxis2 parameter gives the initial
+   number of rows to be created in the table, and should normally be
+   set = 0.  CFITSIO will automatically increase the size of the table
+   as additional rows are written.  A non-zero number of rows may be
+   specified to reserve space for that many rows, even if a fewer
+   number of rows will be written.  The tunit and extname parameters
+   are optional and a null pointer may be given if they are not
+   defined.  The FITS Standard recommends that only letters, digits,
+   and the underscore character be used in column names (the ttype
+   parameter) with no embedded spaces.  Trailing blank characters are
+   not significant.  It is recommended that all the column names in a
+   given table be unique within the first 8 characters, and strongly
+   recommended that the names be
+>  unique within the first 16 characters. \label{ffcrtb}
 -
-       regfilter( "regfilename" [ , Xexpr, Yexpr [ , "wcs cols" ] ] )
+  int fits_create_tbl / ffcrtb
+      (fitsfile *fptr, int tbltype, long naxis2, int tfields, char *ttype[],
+       char *tform[], char *tunit[], char *extname, int *status)
 -
+***2.  Column Information Routines
 
-    The region file name is required, but the rest is optional.  Without
-    any explicit expression for the X and Y coordinates (in pixels), the
-    filter will search for  and operate on columns "X"  and "Y".  If the
-    region file is   in "degrees" format  instead  of "pixels" ("hhmmss"
-    format is not supported, yet), the  filter will need WCS information
-    to convert the region coordinates to pixels.  If supplied, the final
-    parameter string contains the names of the 2 columns (space or comma
-    separated) which contain   the   desired WCS information.    If  not
-    supplied, the filter  will scan the X  and Y expressions for  column
-    names.  If only one is found in each  expression, those columns will
-    be used.  Otherwise, an error will be returned.
-
-    The region shapes supported are (names are case insensitive):
+>1   Get the number of rows or columns in the current FITS table.
+     The number of rows is given by the NAXIS2 keyword and the
+     number of columns is given by the TFIELDS keyword in the header
+>    of the table. \label{ffgnrw} 
 -
-       Point         ( X1, Y1 )               <- One pixel square region
-       Line          ( X1, Y1, X2, Y2 )       <- One pixel wide region
-       Polygon       ( X1, Y1, X2, Y2, ... )  <- Rest are interiors with
-       Rectangle     ( X1, Y1, X2, Y2, A )       | boundaries considered
-       Box           ( Xc, Yc, Wdth, Hght, A )   V within the region
-       Diamond       ( Xc, Yc, Wdth, Hght, A )
-       Circle        ( Xc, Yc, R )
-       Annulus       ( Xc, Yc, Rin, Rout )
-       Ellipse       ( Xc, Yc, Rx, Ry, A )
-       Elliptannulus ( Xc, Yc, Rinx, Riny, Routx, Routy, Ain, Aout )
-       Sector        ( Xc, Yc, Amin, Amax )
+  int fits_get_num_rows / ffgnrw 
+      (fitsfile *fptr, > long *nrows, int *status);
+
+  int fits_get_num_cols / ffgncl
+      (fitsfile *fptr, > int *ncols, int *status);
 -
 
-    where (Xc,Yc) is  the coordinate of  the shape's center; (X\#,Y\#) are
-    the coordinates  of the shape's edges;  Rxxx are the shapes' various
-    Radii or semimajor/minor  axes; and Axxx  are the angles of rotation
-    (or bounding angles for Sector) in degrees.  For rotated shapes, the
-    rotation angle  can  be left  off, indicating  no rotation.   Common
-    alternate  names for the regions  can also be  used: rotbox == box;
-    rotrectangle == rectangle;  (rot)rhombus == (rot)diamond;  and pie
-    == sector.  When a  shape's name is  preceded by a minus sign, '-',
-    the defined region  is instead the area  *outside* its boundary (ie,
-    the region is inverted).  All the shapes within a single region file
-    are AND'd together to create the region.
+>2  Get the table column number (and name) of the column whose name
+matches an input template name.   If casesen  = CASESEN then the column
+name match will be case-sensitive, whereas if casesen = CASEINSEN then
+the case will be ignored.  As a general rule, the column names should
+be treated as case INsensitive.
 
-    For  complex  or commonly  used filters,  one   can also  place  the
-    expression into a text file and import it  into the row filter using
-    the syntax  '[@filename.txt]'.  The   expression can be  arbitrarily
-    complex and extend over multiple lines of the file.
+The input column name template may be either the exact name of the
+column to be searched for, or it may contain wild card characters (*,
+?, or \#), or it may contain the integer number of the desired column
+(with the first column = 1).  The `*' wild card character matches any
+sequence of characters (including zero characters) and the `?'
+character matches any single character.  The \# wildcard will match any
+consecutive string of decimal digits (0-9).  If more than one column
+name in the table matches the template string, then the first match is
+returned and the status value will be set to COL\_NOT\_UNIQUE  as a
+warning that a unique match was not found.  To find the other cases
+that match the template, call the routine again leaving the input
+status value equal to COL\_NOT\_UNIQUE and the next matching name will
+then be returned.  Repeat this process until a status =
+COL\_NOT\_FOUND  is returned.
 
+The FITS Standard recommends that only letters, digits, and the
+underscore character be used in column names (with no embedded
+spaces).  Trailing blank characters are not significant.  It is
+recommended that all the column names in a given table be unique within
+the first 8 characters, and strongly recommended that the names be
+> unique within the first 16 characters. \label{ffgcno} \label{ffgcnn}
+-
+  int fits_get_colnum / ffgcno
+      (fitsfile *fptr, int casesen, char *templt, > int *colnum,
+       int *status)
+ 
+  int fits_get_colname / ffgcnn
+      (fitsfile *fptr, int casesen, char *templt, > char *colname,
+       int *colnum, int *status)
+-
+>3  Return the data type, vector repeat value, and the width in bytes
+    of a column in an ASCII or binary table.  Allowed values for the
+    data type in ASCII tables are:  TSTRING, TSHORT, TLONG, TFLOAT, and
+    TDOUBLE.  Binary tables also support these types: TLOGICAL, TBIT,
+    TBYTE, TCOMPLEX and TDBLCOMPLEX.  The negative of the data type code
+    value is returned if it is a variable length array column.  Note
+    that in the case of a 'J' 32-bit integer binary table column, this
+    routine will return data type = TINT32BIT (which in fact is
+    equivalent to TLONG).  With most current C compilers, a value in a
+    'J' column has the same size as an 'int' variable, and may not be
+    equivalent to a 'long' variable, which is 64-bits long on an
+    increasing number of compilers.
 
-EXAMPLES:
+    The 'repeat' parameter returns the vector repeat count on the binary
+    table TFORMn keyword value. (ASCII table columns always have repeat
+    = 1).  The 'width' parameter returns the width in bytes of a single
+    column element (e.g., a '10D' binary table column will have width =
+    8, an ASCII table 'F12.2' column will have width = 12, and a binary
+    table'60A' character string  column will have width = 60);  Note that
+    this routine supports the local convention for specifying arrays of
+    fixed length strings within a binary table character column using
+    the syntax TFORM = 'rAw' where 'r' is the total number of characters
+    (= the width of the column) and 'w' is the width of a unit string
+    within the column.  Thus if the column has TFORM = '60A12' then this
+    means that each row of the table contains 5 12-character substrings
+    within the 60-character field, and thus in this case this routine will
+    return typecode = TSTRING, repeat = 60, and width = 12.  The number
+    of substings in any binary table character string field can be
+    calculated by (repeat/width).  A null pointer may be given for any of
+    the output parameters that are not needed.
+
+   The second routine, fit\_get\_eqcoltype is similar except that in
+   the case of scaled integer columns it returns the 'equivalent' data
+   type that is needed to store the scaled values, and not necessarily
+   the physical data type of the unscaled values as stored in the FITS
+   table.  For example if a '1I' column in a binary table has TSCALn =
+   1 and TZEROn = 32768, then this column effectively contains unsigned
+   short integer values, and thus the returned value of typecode will
+   be TUSHORT, not TSHORT.  Similarly, if a column has TTYPEn = '1I'
+   and TSCALn = 0.12, then the returned typecode
+>  will be TFLOAT. \label{ffgtcl}
 -
-    [ binary && mag <= 5.0]        - Extract all binary stars brighter
-                                     than  fifth magnitude (note that
-                                     the initial space is necessary to
-                                     prevent it from being treated as a
-                                     binning specification)
+  int fits_get_coltype / ffgtcl
+      (fitsfile *fptr, int colnum, > int *typecode, long *repeat,
+       long *width, int *status)
 
-    [#row >= 125 && #row <= 175]   - Extract row numbers 125 through 175
+  int fits_get_eqcoltype / ffeqty
+      (fitsfile *fptr, int colnum, > int *typecode, long *repeat,
+       long *width, int *status)
+-
+>4  Return the display width of a column.  This is the length
+    of the string that will be returned by the fits\_read\_col routine 
+    when reading the column as a formatted string.  The display width is
+    determined by the TDISPn keyword, if present, otherwise by the data
+>   type of the column. \label{ffgcdw}
+-
+  int fits_get_col_display_width / ffgcdw
+      (fitsfile *fptr, int colnum, > int *dispwidth, int *status)
+-
 
-    [IMAGE[4,5] .gt. 100]          - Extract all rows that have the
-                                     (4,5) component of the IMAGE column
-                                     greater than 100
+>5  Return the number of and size of the dimensions of a table column in 
+    a binary table. Normally this information is given by the TDIMn keyword,
+    but if this keyword is not present then this routine returns naxis = 1
+>   and naxes[0] equal to the repeat count in the TFORM keyword. \label{ffgtdm}
+-
+  int fits_read_tdim / ffgtdm
+      (fitsfile *fptr, int colnum, int maxdim, > int *naxis,
+       long *naxes, int *status)
+-
+>6  Decode the input TDIMn keyword string (e.g. '(100,200)') and return the
+    number of and size of the dimensions of a binary table column. If the input
+    tdimstr character string is null, then this routine returns naxis = 1
+    and naxes[0] equal to the repeat count in the TFORM keyword. This routine
+>   is called by fits\_read\_tdim.  \label{ffdtdm}
+-
+  int fits_decode_tdim / ffdtdm
+      (fitsfile *fptr, char *tdimstr, int colnum, int maxdim, > int *naxis,
+       long *naxes, int *status)
+-
+>7  Write a TDIMn keyword whose value has the form '(l,m,n...)'
+    where l, m, n... are the dimensions of a multidimension array
+>   column in a binary table. \label{ffptdm}
+-
+  int fits_write_tdim / ffptdm
+      (fitsfile *fptr, int colnum, int naxis, long *naxes, > int *status)
+-
 
-    [abs(sin(theta * #deg)) < 0.5] - Extract all rows having the
-                                     absolute value of the sine of theta
-                                     less  than a half where the angles
-                                     are tabulated in degrees
+***3.  Routines to Edit Rows or Columns
 
-    [SUM( SPEC > 3*BACKGRND )>=1]  - Extract all rows containing a
-                                     spectrum, held in vector column
-                                     SPEC, with at least one value 3
-                                     times greater than the background
-                                     level held in a keyword, BACKGRND
+>1  Insert or delete rows in an ASCII or binary table. When inserting rows
+    all the rows following row FROW are shifted down by NROWS rows;  if
+    FROW = 0 then the blank rows are inserted at the beginning of the
+    table.  The first delete routine deletes NROWS consecutive rows
+    starting with row FIRSTROW.  The second delete routine takes an
+    input string that lists the rows or row ranges (e.g.,
+    '5-10,12,20-30'), whereas the third delete routine takes an input
+    integer array that specifies each individual row to be deleted. In
+    both latter cases, the input list of rows to delete must be sorted
+    in ascending order.  These routines update the NAXIS2 keyword to
+    reflect the new number of rows in the
+>   table. \label{ffirow} \label{ffdrow} \label{ffdrws} \label{ffdrrg}
+-
+  int fits_insert_rows / ffirow
+      (fitsfile *fptr, long firstrow, long nrows, > int *status)
 
-    [VCOL=={1,4,2}]                - Extract all rows whose vector column
-                                     VCOL contains the 3-elements 1, 4, and
-                                     2.
+  int fits_delete_rows / ffdrow
+      (fitsfile *fptr, long firstrow, long nrows, > int *status)
 
-    [@rowFilter.txt]               - Extract rows using the expression
-                                     contained within the text file
-                                     rowFilter.txt
+  int fits_delete_rowrange / ffdrrg
+      (fitsfile *fptr, char *rangelist, > int *status)
+
+  int fits_delete_rowlist / ffdrws
+      (fitsfile *fptr, long *rowlist, long nrows, > int *status)
 -
+>2  Insert or delete column(s) in an ASCII or binary
+    table.  When inserting, COLNUM specifies the column number that the
+    (first) new column should occupy in the table.  NCOLS specifies how
+    many columns are to be inserted. Any existing columns from this
+    position and higher are shifted over to allow room for the new
+    column(s).  The index number on all the following keywords will be
+    incremented or decremented if necessary to reflect the new position
+    of the column(s) in the table:  TBCOLn, TFORMn, TTYPEn, TUNITn,
+    TNULLn, TSCALn, TZEROn, TDISPn, TDIMn, TLMINn, TLMAXn, TDMINn,
+    TDMAXn, TCTYPn, TCRPXn, TCRVLn, TCDLTn, TCROTn,
+>   and TCUNIn. \label{fficol} \label{fficls} \label{ffdcol}
+-
+  int fits_insert_col / fficol
+      (fitsfile *fptr, int colnum, char *ttype, char *tform,
+       > int *status)
 
-***9.  Binning or Histogramming Specification
+  int fits_insert_cols / fficls
+      (fitsfile *fptr, int colnum, int ncols, char **ttype,
+       char **tform, > int *status)
 
-The optional binning specifier is enclosed in square brackets and can
-be distinguished from a general row filter specification by the fact
-that it begins with the keyword 'bin'  not immediately followed by an
-equals sign.  When binning is specfied, a temporary N-dimensional FITS
-primary array is created by computing the histogram of the values in
-the specified columns of a FITS table extension.  After the histogram
-is computed the input FITS file containing the table is then closed and
-the temporary FITS primary array is opened and passed to the
-application program.  Thus, the application program never sees the
-original FITS table and only sees the image in the new temporary file
-(which has no additional extensions).  Obviously, the application
-program must be expecting to open a FITS image and not a FITS table in
-this case.
-
-The data type of the FITS histogram image may be specified by appending
-'b' (for 8-bit byte), 'i' (for 16-bit integers), 'j' (for 32-bit
-integer), 'r' (for 32-bit floating points), or 'd' (for 64-bit double
-precision floating point)  to the 'bin' keyword (e.g. '[binr X]'
-creates a real floating point image).  If the datatype is not
-explicitly specified then a 32-bit integer image will be created by
-default, unless the weighting option is also specified in which case
-the image will have a 32-bit floating point data type by default.
-
-The histogram image may have from 1 to 4 dimensions (axes), depending
-on the number of columns that are specified.  The general form of the
-binning specification is:
--
- [bin{bijrd}  Xcol=min:max:binsize, Ycol= ..., Zcol=..., Tcol=...; weight]
+  int fits_delete_col / ffdcol(fitsfile *fptr, int colnum, > int *status)
 -
-in which up to 4 columns, each corresponding to an axis of the image,
-are listed. The column names are case insensitive, and the column
-number may be given instead of the name, preceded by a pound sign
-(e.g., [bin \#4=1:512]).  If the column name is not specified, then
-CFITSIO will first try to use the 'preferred column' as specified by
-the CPREF keyword if it exists (e.g., 'CPREF = 'DETX,DETY'), otherwise
-column names 'X', 'Y', 'Z', and 'T' will be assumed for each of the 4
-axes, respectively.
-
-Each column name may be followed by an equals sign and then the lower
-and upper range of the histogram, and the size of the histogram bins,
-separated by colons.  Spaces are allowed before and after the equals
-sign but not within the 'min:max:binsize' string.  The min, max and
-binsize values may be integer or floating point numbers, or they may be
-the names of keywords in the header of the table.  If the latter, then
-the value of that keyword is substituted into the expression.
-
-Default values for the min, max and binsize quantities will be
-used if not explicitly given in the binning expression as shown
-in these examples:
+>3  Copy a column from one HDU to another (or to the same HDU).  If
+    create\_col = TRUE, then a new column will be inserted in the output
+    table, at position `outcolumn', otherwise the existing output column will
+    be overwritten (in which case it must have a compatible data type).
+    If outcolnum is greater than the number of column in the table, then
+    the new column will be appended to the end of the table.  
+    Note that the first column in a table is at colnum = 1. 
+    The standard indexed keywords that related to the column (e.g., TDISPn,
+>   TUNITn, TCRPXn, TCDLTn, etc.) will also be copied. \label{ffcpcl}
+-
+  int fits_copy_col / ffcpcl
+      (fitsfile *infptr, fitsfile *outfptr, int incolnum, int outcolnum, 
+       int create_col, > int *status);
+-
+>4  Modify the vector length of a binary table column (e.g.,
+    change a column from TFORMn = '1E' to '20E').  The vector
+>   length may be increased or decreased from the current value. \label{ffmvec}
 -
-    [bin x = :512:2]  - use default minimum value
-    [bin x = 1::2]    - use default maximum value
-    [bin x = 1:512]   - use default bin size
-    [bin x = 1:]      - use default maximum value and bin size
-    [bin x = :512]    - use default minimum value and bin size
-    [bin x = 2]       - use default minimum and maximum values
-    [bin x]           - use default minimum, maximum and bin size
-    [bin 4]           - default 2-D image, bin size = 4 in both axes
-    [bin]             - default 2-D image
+  int fits_modify_vector_len / ffmvec
+      (fitsfile *fptr, int colnum, long newveclen, > int *status)
 -
-CFITSIO  will use the value of the TLMINn, TLMAXn, and TDBINn keywords,
-if they exist, for the default min, max, and binsize, respectively.  If
-they do not exist then CFITSIO will use the actual minimum and maximum
-values in the column for the histogram min and max values.  The default
-binsize will be set to 1, or (max - min) / 10., whichever is smaller,
-so that the histogram will have at least 10 bins along each axis.
+***4.  Read and Write Column Data Routines 
 
-A shortcut notation is allowed if all the columns/axes have the same
-binning specification.  In this case all the column names may be listed
-within parentheses, followed by the (single) binning specification, as
-in:
--
-    [bin (X,Y)=1:512:2]
-    [bin (X,Y) = 5]
--
+The following routines write or read data values in the current ASCII
+or binary table extension.  If a write operation extends beyond the
+current size of the table, then the number of rows in the table will
+automatically be increased and the NAXIS2 keyword value will be
+updated.  Attempts to read beyond the end of the table will result in
+an error.
 
-The optional weighting factor is the last item in the binning specifier
-and, if present, is separated from the list of columns by a
-semi-colon.  As the histogram is accumulated, this weight is used to
-incremented the value of the appropriated bin in the histogram.  If the
-weighting factor is not specified, then the default weight = 1 is
-assumed.  The weighting factor may be a constant integer or floating
-point number, or the name of a keyword containing the weighting value.
-Or the weighting factor may be the name of a table column in which case
-the value in that column, on a row by row basis, will be used.
+Automatic data type conversion is performed for numerical data types
+(only) if the data type of the column (defined by the TFORMn keyword)
+differs from the data type of the calling routine.  ASCII and binary
+tables support the following data type values:  TSTRING, TBYTE, TSBYTE, TSHORT,
+TUSHORT, TINT, TUINT, TLONG, TLONGLONG, TULONG, TFLOAT, or TDOUBLE.
+Binary tables also support TLOGICAL (internally mapped to the `char'
+data type), TCOMPLEX, and TDBLCOMPLEX.
+
+Note that within the context of these routines, the TSTRING data type
+corresponds to a C 'char**' data type, i.e., a pointer to an array of
+pointers to an array of characters.  This is different from the keyword
+reading and writing routines where TSTRING corresponds to a C 'char*'
+data type, i.e., a single pointer to an array of characters.  When
+reading strings from a table, the char arrays obviously must have been
+allocated long enough to hold the whole FITS table string.
 
-In some cases, the column or keyword may give the reciprocal of the
-actual weight value that is needed.  In this case, precede the weight
-keyword or column name by a slash '/' to tell CFITSIO to use the
-reciprocal of the value when constructing the histogram. 
+Numerical data values are automatically scaled by the TSCALn and TZEROn
+keyword values (if they exist).
 
-For  complex or commonly  used  histograms, one  can also  place its
-description  into  a  text  file and  import   it  into  the binning
-specification  using the  syntax [bin  @filename.txt].  The
-file's contents  can extend over   multiple lines, although  it must
-still conform to the  no-spaces rule  for the min:max:binsize syntax
-and each axis specification must still be comma-separated.
+In the case of binary tables with vector elements, the 'felem'
+parameter defines the starting element (beginning with 1, not 0) within
+the cell (a cell is defined as the intersection of a row and a column
+and may contain a single value or a vector of values).  The felem
+parameter is ignored when dealing with ASCII tables. Similarly, in the
+case of binary tables the 'nelements' parameter specifies the total
+number of vector values to be read or written (continuing on subsequent
+rows if required) and not the number of table cells.
+
+>>1  Write elements into an ASCII or binary table column.
+   The first routine simply writes the array of values to the FITS file
+   (doing data type conversion if necessary) whereas the second routine
+   will substitute the  appropriate FITS null value for all elements
+   which are equal to the input value of nulval (note that this
+   parameter gives the address of nulval, not the null value
+   itself).  For integer columns the FITS null value is defined by the
+   TNULLn keyword (an error is returned if the keyword doesn't exist).
+   For floating point columns  the special IEEE NaN (Not-a-Number)
+   value will be written into the FITS file.  If a null pointer is
+   entered for nulval, then the null value is ignored and this routine
+   behaves the same as the first routine. The second routine must not
+   be used to write to variable length array columns.  The third routine
+   simply writes undefined pixel values to the column.
+   \label{ffpcl} \label{ffpcn} \label{ffpclu}
+-
+  int fits_write_col / ffpcl
+      (fitsfile *fptr, int datatype, int colnum, long firstrow,
+       long firstelem, long nelements, DTYPE *array, > int *status)
 
- Examples:
+  int fits_write_colnull / ffpcn
+      (fitsfile *fptr, int datatype, int colnum, long firstrow,
+      long firstelem, long nelements, DTYPE *array, DTYPE *nulval,
+      > int *status)
 
+   int fits_write_col_null / ffpclu
+       (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+        long nelements, > int *status)
 -
-    [bini detx, dety]                - 2-D, 16-bit integer histogram
-                                       of DETX and DETY columns, using
-                                       default values for the histogram
-                                       range and binsize
-
-    [bin (detx, dety)=16; /exposure] - 2-D, 32-bit real histogram of DETX
-                                       and DETY columns with a bin size = 16
-                                       in both axes. The histogram values
-                                       are divided by the EXPOSURE keyword
-                                       value.
+>2  Read elements from an ASCII or binary table column.  The data type
+    parameter specifies the data type of the `nulval' and `array'  pointers;
+    Undefined array elements will be returned with a value = *nullval,
+    (note that this parameter gives the address of the null value, not the
+    null value itself) unless nulval = 0 or *nulval = 0, in which case
+    no checking for undefined pixels will be performed.  The second
+    routine is similar except that any undefined pixels will have the
+    corresponding nullarray element set equal to TRUE (= 1).
 
-    [bin time=TSTART:TSTOP:0.1]      - 1-D lightcurve, range determined by
-                                       the TSTART and TSTOP keywords, 
-                                       with 0.1 unit size bins.  
- 
-    [bin pha, time=8000.:8100.:0.1]  - 2-D image using default binning
-                                       of the PHA column for the X axis,
-                                       and 1000 bins in the range 
-                                       8000. to 8100. for the Y axis.
-    
-    [bin @binFilter.txt]             - Use the contents of the text file
-                                       binFilter.txt for the binning
-                                       specifications.
+    Any column, regardless of it's intrinsic data type, may be read as a
+    string.  It should be noted however that reading a numeric column
+    as a string is 10 - 100 times slower than reading the same column
+    as a number due to the large overhead in constructing the formatted
+    strings.  The display format of the returned strings will be
+    determined by the TDISPn keyword, if it exists, otherwise by the
+    data type of the column.  The length of the returned strings (not
+    including the null terminating character) can be determined with
+    the fits\_get\_col\_display\_width routine.  The following TDISPn
+    display formats are currently supported:
+-
+    Iw.m   Integer
+    Ow.m   Octal integer
+    Zw.m   Hexadecimal integer
+    Fw.d   Fixed floating point
+    Ew.d   Exponential floating point
+    Dw.d   Exponential floating point
+    Gw.d   General; uses Fw.d if significance not lost, else Ew.d
+-
+    where w is the width in characters of the displayed values, m is the minimum
+    number of digits displayed, and d is the number of digits to the right of the 
+    decimal.  The .m field is optional.
+>   \label{ffgcv} \label{ffgcf}
+-
+  int fits_read_col / ffgcv
+      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
+       long nelements, DTYPE *nulval, DTYPE *array, int *anynul, int *status)
 
+  int fits_read_colnull / ffgcf
+      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
+      long nelements, DTYPE *array, char *nullarray, int *anynul, int *status)
 -
 
-
-*V.  CFITSIO Conventions and Guidelines
+***5.  Row Selection and Calculator Routines 
 
-**A.  CFITSIO Definitions
+These routines all parse and evaluate an input string containing a user
+defined arithmetic expression.  The first 3 routines select rows in a
+FITS table, based on whether the expression evaluates to true (not
+equal to zero) or false (zero).  The other routines evaluate the
+expression and calculate a value for each row of the table.  The
+allowed expression syntax is described in the row filter section in the
+`Extended File Name Syntax' chapter of this document.  The expression
+may also be written to a text file, and the name of the file, prepended
+with a '@' character may be supplied for the 'expr' parameter (e.g.
+'@filename.txt'). The  expression  in  the  file can be arbitrarily
+complex and extend over multiple lines of the file.  Lines  that begin
+with 2 slash characters ('//') will  be ignored and may be used to add
+comments to the file.
 
-Any program that uses the CFITSIO interface must include the fitsio.h
-header file with the statement
+>1  Evaluate a boolean expression over the indicated rows, returning an     
+> array of flags indicating which rows evaluated to TRUE/FALSE  \label{fffrow}
 -
-  #include "fitsio.h"
+  int fits_find_rows / fffrow
+      (fitsfile *fptr,  char *expr, long firstrow, long nrows,
+      > long *n_good_rows, char *row_status,  int *status)             
 -
-This header file contains the prototypes for all the CFITSIO user
-interface routines as well as the definitions of various constants used
-in the interface.  It also defines a C structure of type `fitsfile'
-that is used by CFITSIO to store the relevant parameters that define
-the format of a particular FITS file.  Application programs must define
-a pointer to this structure for each FITS file that is to be opened.
-This structure is initialized (i.e., memory is allocated for the
-structure) when the FITS file is first opened or created with the
-fits\_open\_file or fits\_create\_file routines.  This fitsfile pointer
-is then passed as the first argument to every other CFITSIO routine
-that operates on the FITS file.  Application programs must not directly
-read or write elements in this fitsfile structure because the
-definition of the structure may change in future versions of CFITSIO.
-
-A number of symbolic constants are also defined in fitsio.h for the
-convenience of application programmers.  Use of these symbolic
-constants rather than the actual numeric value will help to make the
-source code more readable and easier for others to understand.
+>>2  Find the first row which satisfies the input boolean expression \label{ffffrw}
+-
+  int fits_find_first_row / ffffrw
+      (fitsfile *fptr,  char *expr, > long *rownum, int *status)             
+-
+>3 Evaluate an expression on all rows of a table.  If the input and output  
+files are not the same, copy the TRUE rows to the output file.  If the   
+>files are the same, delete the FALSE rows (preserve the TRUE rows). \label{ffsrow}
+-
+  int fits_select_rows / ffsrow
+      (fitsfile *infptr, fitsfile *outfptr,  char *expr,  > int *status )
+-
+>4  Calculate an expression for the indicated rows of a table, returning     
+the results, cast as datatype (TSHORT, TDOUBLE, etc), in array.  If      
+nulval==NULL, UNDEFs will be zeroed out.  For vector results, the number 
+of elements returned may be less than nelements if nelements is not an   
+even multiple of the result dimension.  Call fits\_test\_expr to obtain    
+>the dimensions of the results.  \label{ffcrow}  
+-
+  int fits_calc_rows / ffcrow
+      (fitsfile *fptr,  int datatype, char *expr, long firstrow,
+       long nelements, void *nulval, > void *array,  int *anynul, int *status)
+-
+>5 Evaluate an expression and write the result either to a column (if
+the expression is a function of other columns in the table) or to a
+keyword (if the expression evaluates to a constant and is not a
+function of other columns in the table).  In the former case, the
+parName parameter is the name of the column (which may or may not already
+exist) into which to write the results, and parInfo contains an
+optional TFORM keyword value if a new column is being created.  If a
+TFORM value is not specified then a default format will be used,
+depending on the expression.  If the expression evaluates to a constant,
+then the result will be written to the keyword name given by the
+parName parameter, and the parInfo parameter may be used to supply an
+optional comment for the keyword.  If the keyword does not already
+exist, then the name of the keyword must be preceded with a '\#' character,
+otherwise the result will be written to a column with that name.
+> \label{ffcalc}        
+-
+  int fits_calculator / ffcalc
+      (fitsfile *infptr, char *expr, fitsfile *outfptr, char *parName,
+       char *parInfo, >  int *status)                   
+-
+>6  This calculator routine is similar to the previous routine, except
+that the expression is only evaluated over the specified 
+row ranges.  nranges specifies the number of row ranges, and firstrow
+and lastrow give the starting and ending row number of each range.
+> \label{ffcalcrng}
+-
+  int fits_calculator_rng / ffcalc_rng
+      (fitsfile *infptr, char *expr, fitsfile *outfptr, char *parName,
+       char *parInfo, int nranges, long *firstrow, long *lastrow 
+       >  int *status)                   
 -
-String Lengths, for use when allocating character arrays:
 
-  #define FLEN_FILENAME 1025 /* max length of a filename                  */
-  #define FLEN_KEYWORD   72  /* max length of a keyword                   */
-  #define FLEN_CARD      81  /* max length of a FITS header card          */
-  #define FLEN_VALUE     71  /* max length of a keyword value string      */
-  #define FLEN_COMMENT   73  /* max length of a keyword comment string    */
-  #define FLEN_ERRMSG    81  /* max length of a CFITSIO error message     */
-  #define FLEN_STATUS    31  /* max length of a CFITSIO status text string */
-
-  Note that FLEN_KEYWORD is longer than the nominal 8-character keyword
-  name length because the HIERARCH convention supports longer keyword names.
- 
-Access modes when opening a FITS file:
-
-  #define READONLY  0
-  #define READWRITE 1
- 
-BITPIX data type code values for FITS images:
-
-  #define BYTE_IMG      8  /*  8-bit unsigned integers */
-  #define SHORT_IMG    16  /* 16-bit   signed integers */
-  #define LONG_IMG     32  /* 32-bit   signed integers */
-  #define FLOAT_IMG   -32  /* 32-bit single precision floating point */
-  #define DOUBLE_IMG  -64  /* 64-bit double precision floating point */
-
-  The following 2 data type codes are also supported by CFITSIO:
-  #define USHORT_IMG  20  /* 16-bit unsigned integers, equivalent to */
-                          /*  BITPIX = 16, BSCALE = 1, BZERO = 32768 */
-  #define ULONG_IMG   40  /* 32-bit unsigned integers, equivalent to */
-                          /*  BITPIX = 32, BSCALE = 1, BZERO = 2147483648 */
+>>7 Evaluate the given expression and return information on the result. \label{fftexp}
+-
+  int fits_test_expr / fftexp
+      (fitsfile *fptr, char *expr, > int *datatype, long *nelem, int *naxis,
+       long *naxes, int *status)                 
+-
 
-Codes for the datatype of binary table columns and/or for the
-datatype of variables when reading or writing keywords or data:
 
-                              DATATYPE               TFORM CODE
-  #define TBIT          1  /*                            'X' */
-  #define TBYTE        11  /* 8-bit unsigned byte,       'B' */
-  #define TLOGICAL     14  /* logicals (int for keywords     */
-                           /*  and char for table cols   'L' */
-  #define TSTRING      16  /* ASCII string,              'A' */
-  #define TSHORT       21  /* signed short,              'I' */
-  #define TINT32BIT    41  /* signed 32-bit int,         'J' */
-  #define TLONG        41  /* signed long,                   */
-  #define TFLOAT       42  /* single precision float,    'E' */
-  #define TDOUBLE      82  /* double precision float,    'D' */
-  #define TCOMPLEX     83  /* complex (pair of floats)   'C' */
-  #define TDBLCOMPLEX 163  /* double complex (2 doubles) 'M' */
+**H.  Utility Routines
 
-  The following data type codes are also supported by CFITSIO:
-  #define TINT         31  /* int                            */
-  #define TUINT        30  /* unsigned int                   */
-  #define TUSHORT      20  /* unsigned short                 */
-  #define TULONG       40  /* unsigned long                  */
+***1.  File Checksum Routines 
+ 
+The following routines either compute or validate the checksums for the
+CHDU.  The DATASUM keyword is used to store the numerical value of the
+32-bit, 1's complement checksum for the data unit alone.  If there is
+no data unit then the value is set to zero. The numerical value is
+stored as an ASCII string of digits, enclosed in quotes, because the
+value may be too large to represent as a 32-bit signed integer.  The
+CHECKSUM keyword is used to store the ASCII encoded COMPLEMENT of the
+checksum for the entire HDU.  Storing the complement, rather than the
+actual checksum, forces the checksum for the whole HDU to equal zero.
+If the file has been modified since the checksums were computed, then
+the HDU checksum will usually not equal zero.  These checksum keyword
+conventions are based on a paper by Rob Seaman published in the
+proceedings of the ADASS IV conference in Baltimore in November 1994
+and a later revision in June 1995.  See Appendix B for the definition
+of the parameters used in these routines.
+ 
+>1  Compute and write the DATASUM and CHECKSUM keyword values for the CHDU
+    into the current header.  If the keywords already exist, their values
+    will be updated only if necessary (i.e., if the file
+    has been modified since the original keyword
+>   values were computed). \label{ffpcks}
+-
+  int fits_write_chksum / ffpcks
+      (fitsfile *fptr, > int *status)
+-
+>2  Update the CHECKSUM keyword value in the CHDU, assuming that the
+    DATASUM keyword exists and already has the correct value.  This routine
+    calculates the new checksum for the current header unit, adds it to the
+    data unit checksum, encodes the value into an ASCII string, and writes
+>   the string to the CHECKSUM keyword. \label{ffupck}
+-
+  int fits_update_chksum / ffupck
+      (fitsfile *fptr, > int *status)
+-
+>3  Verify the CHDU by computing the checksums and comparing
+    them with the keywords.  The data unit is verified correctly
+    if the computed checksum equals the value of the DATASUM
+    keyword.  The checksum for the entire HDU (header plus data unit) is
+    correct if it equals zero.  The output DATAOK and HDUOK parameters
+    in this routine are integers which will have a value = 1
+    if the data or HDU is verified correctly, a value = 0
+    if the DATASUM or CHECKSUM keyword is not present, or value = -1
+>   if the computed checksum is not correct. \label{ffvcks}
+-
+  int fits_verify_chksum / ffvcks
+      (fitsfile *fptr, > int *dataok, int *hduok, int *status)
+-
+>4  Compute and return the checksum values for the CHDU
+    without creating or modifying the
+    CHECKSUM and DATASUM keywords.  This routine is used internally by
+>   ffvcks, but may be useful in other situations as well. \label{ffgcks}
+-
+  int fits_get_chksum/ /ffgcks
+      (fitsfile *fptr, > unsigned long *datasum, unsigned long *hdusum,
+       int *status)
+-
+>5  Encode a checksum value 
+    into a 16-character string.  If complm is non-zero (true) then the 32-bit
+>   sum value will be complemented before encoding. \label{ffesum}
+-
+  int fits_encode_chksum / ffesum
+      (unsigned long sum, int complm, > char *ascii);
+-
+>6  Decode a 16-character checksum string into a unsigned long value.
+    If is non-zero (true). then the 32-bit sum value will be complemented
+    after decoding.  The checksum value is also returned as the 
+>   value of the function. \label{ffdsum}
+-
+  unsigned long fits_decode_chksum / ffdsum
+           (char *ascii, int complm, > unsigned long *sum);
+-
 
-HDU type code values (value returned when moving to new HDU):
+***2.  Date and Time Utility Routines 
 
-  #define IMAGE_HDU  0  /* Primary Array or IMAGE HDU */
-  #define ASCII_TBL  1  /* ASCII  table HDU */
-  #define BINARY_TBL 2  /* Binary table HDU */
-  #define ANY_HDU   -1  /* matches any type of HDU */
- 
-Column name and string matching case-sensitivity:
+The following routines help to construct or parse the FITS date/time
+strings.   Starting in the year 2000, the FITS DATE keyword values (and
+the values of other `DATE-' keywords) must have the form 'YYYY-MM-DD'
+(date only) or 'YYYY-MM-DDThh:mm:ss.ddd...' (date and time) where the
+number of decimal places in the seconds value is optional.  These times
+are in UTC.  The older 'dd/mm/yy' date format may not be used for dates
+after 01 January 2000.  See Appendix B for the definition of the
+parameters used in these routines.
 
-  #define CASESEN   1   /* do case-sensitive string match */
-  #define CASEINSEN 0   /* do case-insensitive string match */
+>1  Get the current system date.  C already provides standard
+    library routines for getting the current date and time,
+    but this routine is provided for compatibility with
+    the Fortran FITSIO library.  The returned year has 4 digits
+>    (1999, 2000, etc.) \label{ffgsdt}
+-
+  int fits_get_system_date/ffgsdt
+      ( > int *day, int *month, int *year, int *status )
+-
 
-Logical states (if TRUE and FALSE are not already defined):
+>2  Get the current system date and time string ('YYYY-MM-DDThh:mm:ss').
+The time will be in UTC/GMT if available, as indicated by a returned timeref 
+value = 0.  If the returned value of timeref = 1 then this indicates that
+it was not possible to convert the local time to UTC, and thus the local
+>time was returned.
+-
+  int fits_get_system_time/ffgstm
+      (> char *datestr, int  *timeref, int *status)
+-
 
-  #define TRUE 1
-  #define FALSE 0
+>3  Construct a date string from the input date values.  If the year
+is between 1900 and 1998, inclusive, then the returned date string will
+have the old FITS format ('dd/mm/yy'), otherwise the date string will
+have the new FITS format ('YYYY-MM-DD').  Use fits\_time2str instead
+> to always return a date string using the new FITS format. \label{ffdt2s}
+-
+  int fits_date2str/ffdt2s   
+      (int year, int month, int day, > char *datestr, int *status)
+-
 
-Values to represent undefined floating point numbers:
+>4  Construct a new-format date + time string ('YYYY-MM-DDThh:mm:ss.ddd...').
+  If the year, month, and day values all = 0 then only the time is encoded
+  with format 'hh:mm:ss.ddd...'.  The decimals parameter specifies how many
+  decimal places of fractional seconds to include in the string.  If `decimals'
+> is negative, then only the date will be return ('YYYY-MM-DD').
+-
+  int fits_time2str/fftm2s   
+      (int year, int month, int day, int hour, int minute, double second,
+      int decimals, > char *datestr, int *status)
+-
 
-  #define FLOATNULLVALUE -9.11912E-36F
-  #define DOUBLENULLVALUE -9.1191291391491E-36
-- 
-**B.  CFITSIO Size Limitations
+>5  Return the date as read from the input string, where the string may be
+in either the old ('dd/mm/yy')  or new ('YYYY-MM-DDThh:mm:ss' or
+'YYYY-MM-DD') FITS format.  Null pointers may be supplied for any
+>  unwanted output date parameters.
+-
+  int fits_str2date/ffs2dt 
+      (char *datestr, > int *year, int *month, int *day, int *status)
+-
 
-CFITSIO places few restrictions on the size of FITS files that it
-reads or writes.  There are a few limits, however, which may affect
-some extreme cases:
+>6  Return the date and time as read from the input string, where the
+string may be in either the old  or new FITS format.  The returned hours,
+minutes, and seconds values will be set to zero if the input string
+does not include the time ('dd/mm/yy' or 'YYYY-MM-DD') .  Similarly,
+the returned year, month, and date values will be set to zero if the
+date is not included in the input string ('hh:mm:ss.ddd...').  Null
+pointers may be supplied for any unwanted output date and time
+>parameters.
+-
+  int fits_str2time/ffs2tm 
+      (char *datestr, > int *year, int *month, int *day, int *hour,
+      int *minute, double *second, int *status)
+-
 
-1.  The maximum number of files that may be simultaneously opened is
-limited to the number of internal IO buffers allocated in CFITSIO
-(currently 25, as defined by NIOBUF in the file fitsio2.h), or by the
-limit of the underlying C compiler or machine operating system, which
-ever is smaller.  The C symbolic constant FOPEN\_MAX usually defines
-the total number of files that may open at once (this includes any
-other text or binary files which may be open, not just FITS files).
-
-2.  The maximum number of extensions (HDUs) that can be read or written
-in a single FITS file is currently set to 1000 as defined by MAXHDU in
-the fitsio.h file.  This value may be increased if necessary, but the
-access times to the later extensions in such files may become excessively
-long.
-
-3.  By default, CFITSIO can handle FITS files up to 2.1 GB in size
-(2**31 bytes).  This file size limit is often imposed by 32-bit
-operating systems.  More recently, as 64-bit operating systems become
-more common, an industry-wide standard (at least on Unix systems) has
-been developed to support larger sized files (see
-http://ftp.sas.com/standards/large.file/).  Starting with version 2.1
-of CFITSIO, larger FITS files up to 6 terabytes in size may be read and
-written on certain supported platforms.  In order to support these
-larger files, CFITSIO must be compiled with the
-`-D\_FILE\_OFFSET\_BITS=64' compiler flag.  All programs which link to
-the CFITSIO library must also be compiled with this flag or must
-include this preprocessor definition at the start of the source code
-file.  This causes the compiler to allocate 8-bytes instead of 4-bytes
-for the `off\_t' datatype which is used to store file offset
-positions.
+***3.  General Utility Routines 
+ 
+The following utility routines may be useful for certain applications.
 
-If CFITSIO is compiled with the -D\_FILE\_OFFSET\_BITS=64 flag on a
-platform that supports large files, then it can read and write FITS
-files that contain up to 2**31 2880-byte FITS records, or approximately
-6 terabytes in size.  It is still required that the value of the NAXISn
-and PCOUNT keywords in each extension be within the range of a signed
-4-byte integer (max value = 2,147,483,648).  Thus, each dimension of an
-image (given by the NAXISn keywords), the total width of a table
-(NAXIS1 keyword), the number of rows in a table (NAXIS2 keyword), and
-the total size of the variable-length array heap in binary tables
-(PCOUNT keyword) must be less than this limit.
+>1  Return the revision number of the CFITSIO library.
+    The revision number will be incremented with each new
+>   release of CFITSIO. \label{ffvers}
+-
+  float fits_get_version / ffvers ( > float *version)
+-
+>2  Write an 80-character message to the CFITSIO error stack.  Application
+    programs should not normally write to the stack, but there may be
+>   some situations where this is desirable. \label{ffpmsg}
+-
+  void fits_write_errmsg / ffpmsg (char *err_msg)
+-
+>>3  Convert a character string to uppercase (operates in place). \label{ffupch}
+-
+  void fits_uppercase / ffupch (char *string)
+-
+>4   Compare the input template string against the reference string
+    to see if they match.  The template string may contain wildcard
+    characters: '*' will match any sequence of characters (including
+    zero characters) and '\%' will match any single character in the
+    reference string.  If casesen = CASESEN = TRUE then the match will be
+    case sensitive, otherwise the case of the letters will be ignored
+    if casesen = CASEINSEN = FALSE.  The returned MATCH parameter will be 
+    TRUE if the 2 strings match, and EXACT will be TRUE if the match is
+    exact (i.e., if no wildcard characters were used in the match).
+>   Both strings must be 68 characters or less in length. \label{ffcmps}
+-
+  void fits_compare_str / ffcmps
+       (char *templt, char *string, int casesen, > int *match, int *exact)
+-
+>5 Split a string containing a list of names (typically file names or column 
+   names) into individual name tokens by a sequence of calls to
+   fits\_split\_names.  The names in the list must be delimited by a comma
+   and/or spaces.  This routine ignores spaces and commas that occur
+   within parentheses, brackets, or curly brackets.  It also strips any
+   leading and trailing blanks from the returned name.
 
-Currently, support for large files within CFITSIO has only been tested
-on the Solaris 2.6 operating system using the Sun cc compiler or gcc
-2.95.2.
+   This routine is similar to the ANSI C 'strtok' function:
 
-**C.  Multiple Access to the Same FITS File
+   The first call to fits\_split\_names has a non-null input string.
+   It finds the first name in the string and terminates it by overwriting
+   the next character of the string with a null terminator and returns a
+   pointer to the name.  Each subsequent call, indicated by a NULL value
+   of the input string, returns the next name, searching from just past
+   the end of the previous name.  It returns NULL when no further names
+>  are found.  \label{splitnames}
+-
+   char *fits_split_names(char *namelist) 
+-
+   The following example shows how a string would be split into 3 names:
+-
+    myfile[1][bin (x,y)=4], file2.fits  file3.fits
+    ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^  ^^^^^^^^^^
+        1st name             2nd name    3rd name
+-
+>6  Test that the keyword name contains only legal characters (A-Z,0-9,
+    hyphen, and underscore) or that the keyword record contains only legal
+>   printable ASCII characters  \label{fftkey} \label{fftrec}
+-
+  int fits_test_keyword / fftkey (char *keyname, > int *status)
 
-CFITSIO supports simultaneous read and write access to multiple HDUs in
-the same FITS file.  Thus, one can open the same FITS file twice within
-a single program and move to 2 different HDUs in the file, and then
-read and write data or keywords to the 2 extensions just as if one were
-accessing 2 completely separate FITS files.   Since in general it is
-not possible to physically open the same file twice and then expect to
-be able to simultaneously (or in alternating succession) write to 2
-different locations in the file, CFITSIO recognizes when the file to be
-opened (in the call to fits\_open\_file) has already been opened and
-instead of actually opening the file again, just logically links the
-new file to the old file.  (This only applies if the file is opened
-more than once within the same program, and does not prevent the same
-file from being simultaneously opened by more than one program).  Then
-before CFITSIO reads or writes to either (logical) file, it makes sure
-that any modifications made to the other file have been completely
-flushed from the internal buffers to the file.  Thus, in principle, one
-could open a file twice, in one case pointing to the first extension
-and in the other pointing to the 2nd extension and then write data to
-both extensions, in any order, without danger of corrupting the file,
-There may be some efficiency penalties in doing this however, since
-CFITSIO has to flush all the internal buffers related to one file
-before switching to the  other, so it would still be prudent to
-minimize the number of times one switches back and forth between doing
-I/O to different HDUs in the same file.
-
-**D.  Current Header Data Unit (CHDU)
-
-In general, a FITS file can contain multiple Header Data Units, also
-called extensions.  CFITSIO only operates within one HDU at any given
-time, and the currently selected HDU is called the Current Header Data
-Unit (CHDU).  When a FITS file is first created or opened the CHDU is
-automatically defined to be the first HDU (i.e., the primary array).
-CFITSIO routines are provided to move to and open any other existing
-HDU within the FITS file or to append or insert a new HDU in the FITS
-file which then becomes the CHDU.
-
-**E.  Function Names and Datatypes
-
-All the CFITSIO functions have both a short name as well as a longer
-descriptive name.  The short name is only 5 or 6 characters long and is
-similar to the subroutine name in the Fortran-77 version of FITSIO.
-The longer name is more descriptive and it is recommended that it be
-used instead of the short name to more clearly document the source
-code.
-
-Many of the CFITSIO routines come in families which differ only in the
-datatype of the associated parameter(s).  The datatype of these
-routines is indicated by the suffix of the routine name.  The short
-routine names have a 1 or 2 character suffix (e.g., 'j' in 'ffpkyj')
-while the long routine names have a 4 character or longer suffix
-as shown in the following table:
+  int fits_test_record / fftrec (char *card, > int *status)
 -
-    Long      Short  Data
-    Names     Names  Type
-    -----     -----  ----
-    _bit        x    bit
-    _byt        b    unsigned byte
-    _sht        i    short integer
-    _lng        j    long integer
-    _usht       ui   unsigned short integer
-    _ulng       uj   unsigned long integer
-    _uint       uk   unsigned int integer
-    _int        k    int integer
-    _flt        e    real exponential floating point (float)
-    _fixflt     f    real fixed-decimal format floating point (float)
-    _dbl        d    double precision real floating-point (double)
-    _fixdbl     g    double precision fixed-format floating point (double)
-    _cmp        c    complex reals (pairs of float values)
-    _fixcmp     fc   complex reals, fixed-format floating point
-    _dblcmp     m    double precision complex (pairs of double values)
-    _fixdblcmp  fm   double precision complex, fixed-format floating point
-    _log        l    logical (int)
-    _str        s    character string
+>7  Test whether the current header contains any NULL (ASCII 0) characters.
+    These characters are illegal in the header, but they will go undetected
+    by most of the CFITSIO keyword header routines, because the null is 
+    interpreted as the normal end-of-string terminator.  This routine returns
+    the position of the first null character in the header, or zero if there
+    are no nulls.  For example a returned value of 110 would indicate that
+    the first NULL is located in the 30th character of the second keyword
+    in the header (recall that each header record is 80 characters long).
+    Note that this is one of the few CFITSIO routines in which the returned
+    value is not necessarily equal to the status value).
+>   \label{ffnchk}
 -
-
-The logical datatype corresponds to `int' for logical keyword values,
-and `byte' for logical binary table columns.  In otherwords, the value
-when writing a logical keyword must be stored in an `int' variable, and
-must be stored in a `char' array when reading or writing to `L' columns
-in a binary table.  Inplicit data type conversion is not supported for
-logical table columns, but is for keywords, so a logical keyword may be
-read and cast to any numerical data type; a returned value = 0
-indicates false, and any other value = true.
-
-The `int' datatype may be 2 bytes long on some IBM PC compatible
-systems and is usually 4 bytes long on most other systems.  Some 64-bit
-machines, however, like the Dec Alpha/OSF, define the `short', `int',
-and `long' integer datatypes to be 2, 4, and 8 bytes long,
-respectively.  The FITS standard only supports 2 and 4 byte integer
-data types, so CFITSIO internally converts between 4 and 8 bytes when
-reading or writing `long' integers on Alpha/OSF systems.
-
-When dealing with the FITS byte datatype it is important to remember
-that the raw values (before any scaling by the BSCALE and BZERO, or
-TSCALn and TZEROn keyword values) in byte arrays (BITPIX = 8) or byte
-columns (TFORMn = 'B') are interpreted as unsigned bytes with values
-ranging from 0 to 255.  Some C compilers define a 'char' variable as
-signed, so it is important to explicitly declare a numeric char
-variable as 'unsigned char' to avoid any ambiguity
-
-One feature of the CFITSIO routines is that they can operate on a `X'
-(bit) column in a binary table as though it were a `B' (byte) column.
-For example a `11X' datatype column can be interpreted the same as a
-`2B' column (i.e., 2 unsigned 8-bit bytes).  In some instances, it can
-be more efficient to read and write whole bytes at a time, rather than
-reading or writing each individual bit.
-
-The complex and double precision complex datatypes are not directly
-supported in ANSI C so these datatypes should be interpreted as pairs
-of float or double values, respectively, where the first  value in each
-pair is the real part, and the second is the imaginary part.
-
-**E.  Unsigned Integers
-
-Although FITS does not directly support unsigned integers as one of its
-fundamental datatypes, FITS can still be used to efficiently store
-unsigned integer data values in images and binary tables.  The
-convention used in FITS files is to store the unsigned integers as
-signed integers with an associated offset (specified by the BZERO or
-TZEROn keyword).  For example, to store unsigned 16-bit integer values
-in a FITS image the image would be defined as a signed 16-bit integer
-(with BITPIX keyword = SHORT\_IMG = 16) with the keywords BSCALE = 1.0
-and BZERO = 32768.  Thus the unsigned values of 0, 32768, and 65535,
-for example, are physically stored in the FITS image as -32768, 0, and
-32767, respectively;  CFITSIO automatically adds the BZERO offset to
-these values when they are read.  Similarly, in the case of unsigned
-32-bit integers the BITPIX keyword would be equal to LONG\_IMG = 32 and
-BZERO would be equal to 2147483648 (i.e. 2 raised to the 31st power).
-
-The CFITSIO interface routines will efficiently and transparently apply
-the appropriate offset in these cases so in general application
-programs do not need to be concerned with how the unsigned values are
-actually stored in the FITS file.  As a convenience for users, CFITSIO
-has several predefined constants for the value of BITPIX  (USHORT\_IMG,
-ULONG\_IMG) and for the TFORMn value in the case of binary tables (`U'
-and `V') which programmers can use when creating FITS files containing
-unsigned integer values.  The following code fragment illustrates how
-to write a FITS 1-D primary array of unsigned 16-bit integers:
+  int fits_null_check / ffnchk (char *card, > int *status)
 -
-      unsigned short uarray[100];
-      int naxis, status;
-      long naxes[10], group, firstelem, nelements;
-       ...
-      status = 0;
-      naxis = 1;
-      naxes[0] = 100;
-      fits_create_img(fptr, USHORT_IMG, naxis, naxes, &status);
-
-      firstelem = 1;
-      nelements = 100;
-      fits_write_img(fptr, TUSHORT, firstelem, nelements,
-                          uarray, &status);
-       ...
+>8  Parse a header keyword record and return the name of the keyword,
+    and the length of the name.
+    The keyword name normally occupies the first 8 characters of the
+    record, except under the HIERARCH convention where the name can
+>   be up to 70 characters in length. \label{ffgknm}
 -
-In the above example, the 2nd parameter in fits\_create\_img tells
-CFITSIO to write the header keywords appropriate for an array of 16-bit
-unsigned integers (i.e., BITPIX = 16 and BZERO = 32768).  Then the
-fits\_write\_img routine writes the array of unsigned short integers
-(uarray) into the primary array of the FITS file.  Similarly, a 32-bit
-unsigned integer image may be created by setting the second parameter
-in fits\_create\_img equal to `ULONG\_IMG' and by calling the
-fits\_write\_img routine with the second parameter = TULONG to write
-the array of unsigned long image pixel values.
-
-An analogous set of routines are available for reading or writing
-unsigned integer values in a FITS binary table extension.  When
-specifying the TFORMn keyword value which defines the format of a
-column, CFITSIO recognized 2 additional datatype codes besides those
-already defined in the FITS standard: `U' meaning a 16-bit unsigned
-integer column, and `V' for a 32-bit unsigned integer column.  These
-non-standard datatype codes are not actually written into the FITS file
-but instead are just used internally within CFITSIO.  The following
-code fragment illustrates how to use these features:
+  int fits_get_keyname / ffgknm
+      (char *card, > char *keyname, int *keylength, int *status)
 -
-      unsigned short uarray[100];
-      unsigned int  varray[100];
-
-      int colnum, tfields, status;
-      long nrows, firstrow, firstelem, nelements, pcount;
-
-      char extname[] = "Test_table";           /* extension name */
-
-      /* define the name, datatype, and physical units for the 2 columns */
-      char *ttype[] = { "Col_1", "Col_2" };
-      char *tform[] = { "1U",      "1V"   };  /* special CFITSIO codes */
-      char *tunit[] = { " ",        " "   };
-       ...
-
-           /* write the header keywords */
-      status  = 0;
-      nrows   = 1;
-      tfields = 2
-      pcount  = 0;
-      fits_create_tbl(fptr, BINARY_TBL, nrows, tfields, ttype, tform,
-                tunit, extname, &status);
-
-           /* write the unsigned shorts to the 1st column */
-      colnum    = 1;
-      firstrow  = 1;
-      firstelem = 1;
-      nelements = 100;
-      fits_write_col(fptr, TUSHORT, colnum, firstrow, firstelem,
-              nelements, uarray, &status);
-
-           /* now write the unsigned longs to the 2nd column */
-      colnum    = 2;
-      fits_write_col(fptr, TUINT, colnum, firstrow, firstelem,
-              nelements, varray, &status);
-       ...
+>9  Parse a header keyword record, returning the value (as
+    a literal character string) and comment strings.  If the keyword has no
+    value (columns 9-10 not equal to '= '), then a null value string is 
+    returned and the comment string is set equal to column 9 - 80 of the
+>   input string. \label{ffpsvc}
 -
-Note that the non-standard TFORM values for the 2 columns, `U' and `V',
-tell CFITSIO to write the keywords appropriate for unsigned 16-bit and
-unsigned 32-bit integers, respectively (i.e., TFORMn = '1I' and TZEROn
-= 32678 for unsigned 16-bit integers, and TFORMn = '1J' and TZEROn =
-2147483648 for unsigned 32-bit integers).  The calls to
-fits\_write\_col then write the arrays of unsigned integer values to
-the columns.
-
-**F.  Character Strings
-
-The character string values in a FITS header or in an ASCII column in a
-FITS table extension are generally padded out with non-significant
-space characters (ASCII 32) to fill up the header record or the column
-width.  When reading a FITS string value, the CFITSIO routines will
-strip off these non-significant trailing spaces and will return a
-null-terminated string value containing only the significant
-characters.  Leading spaces in a FITS string are considered
-significant.  If the string contains all blanks, then CFITSIO will
-return a single blank character, i.e, the first blank is considered to
-be significant, since it distinquishes the string from a null or
-undefined string, but the remaining trailing spaces are not
-significant.
-
-Similarly, when writing string values to a FITS file the
-CFITSIO routines expect to get a null-terminated string as input;
-CFITSIO will pad the string with blanks if necessary when writing it
-to the FITS file.  
-
-When calling CFITSIO routines that return a character string it is
-vital that the size of the char array be large enough to hold the
-entire string of characters, otherwise CFITSIO will overwrite whatever
-memory locations follow the char array, possibly causing the program to
-execute incorrectly.  This type of error can be difficult to debug, so
-programmers should always ensure that the char arrays are allocated
-enough space to hold the longest possible string, {\bf including} the
-terminating NULL character.  The fitsio.h file contains the following
-defined constants which programmers are strongly encouraged to use
-whenever they are allocating space for char arrays:
+  int fits_parse_value / ffpsvc
+      (char *card, > char *value, char *comment, int *status)
 -
-#define FLEN_FILENAME 1025  /* max length of a filename */
-#define FLEN_KEYWORD   72  /* max length of a keyword  */
-#define FLEN_CARD      81  /* length of a FITS header card */
-#define FLEN_VALUE     71  /* max length of a keyword value string */
-#define FLEN_COMMENT   73  /* max length of a keyword comment string */
-#define FLEN_ERRMSG    81  /* max length of a CFITSIO error message */ 
-#define FLEN_STATUS    31  /* max length of a CFITSIO status text string */ 
+>10 Construct an array indexed keyword name (ROOT + nnn).
+    This routine appends the sequence number to the root string to create
+>   a keyword name (e.g., 'NAXIS' + 2 = 'NAXIS2') \label{ffkeyn}
 -
-For example, when declaring a char array to hold the value string
-of FITS keyword, use the following statement:
+  int fits_make_keyn / ffkeyn
+      (char *keyroot, int value, > char *keyname, int *status)
 -
-    char value[FLEN_VALUE];
+>11  Construct a sequence keyword name (n + ROOT).
+    This routine concatenates the sequence number to the front of the
+>   root string to create a keyword name (e.g., 1 + 'CTYP' = '1CTYP') \label{ffnkey}
 -
-Note that FLEN\_KEYWORD is longer than needed for the nominal 8-character
-keyword name because the HIERARCH convention supports longer keyword names.
- 
-**G.  Implicit Data Type Conversion
- 
-The CFITSIO routines that read and write numerical data can perform
-implicit data type conversion.  This means that the data type of the
-variable or array in the program does not need to be the same as the
-data type of the value in the FITS file.  Data type conversion is
-supported for numerical data types when reading a FITS header keyword
-value and when reading or writing values in the primary array or a
-table column.  CFITSIO returns status = NUM\_OVERFLOW  if the converted
-data value exceeds the range of the output data type.  Implicit data type
-conversion is not supported for string, logical, complex, or double
-complex data types.
-
-**H.  Data Scaling
- 
-When reading numerical data values in the primary array or a
-table column, the values will be scaled automatically by the BSCALE and
-BZERO (or TSCALn and TZEROn) header values if they are
-present in the header.  The scaled data that is returned to the reading
-program will have
+  int fits_make_nkey / ffnkey
+      (int value, char *keyroot, > char *keyname, int *status)
 -
-        output value = (FITS value) * BSCALE + BZERO
+>12 Determine the data type of a keyword value string. This routine
+    parses the keyword value string  to determine its data type. 
+    Returns 'C', 'L', 'I', 'F' or 'X', for character string, logical,
+>   integer, floating point, or complex, respectively. \label{ffdtyp}
 -
-(a corresponding formula using TSCALn and TZEROn is used when reading
-from table columns).  In the case of integer output values the floating
-point scaled value is truncated to an integer (not rounded to the
-nearest integer).  The fits\_set\_bscale and fits\_set\_tscale routines
-(described in the `Advanced' chapter) may be used to override the
-scaling parameters defined in the header (e.g., to turn off the scaling
-so that the program can read the raw unscaled values from the FITS
-file).
-
-When writing numerical data to the primary array or to a table column
-the data values will generally be automatically inversely scaled by the
-value of the BSCALE and BZERO (or TSCALn and TZEROn) keyword values if
-they they exist in the header.  These keywords must have been written
-to the header before any data is written for them to have any immediate
-effect.  One may also use the fits\_set\_bscale and fits\_set\_tscale
-routines to define or override the scaling keywords in the header
-(e.g., to turn off the scaling so that the program can write the raw
-unscaled values into the FITS file). If scaling is performed, the
-inverse scaled output value that is written into the FITS file will
-have
+  int fits_get_keytype / ffdtyp
+      (char *value, > char *dtype, int *status)
 -
-         FITS value = ((input value) - BZERO) / BSCALE
+>13 Return the class of an input header record.  The record is classified
+    into one of the following categories (the class values are
+    defined in fitsio.h).  Note that this is one of the few CFITSIO
+>   routines that does not return a status value. \label{ffgkcl}
 -
-(a corresponding formula using TSCALn and TZEROn is used when
-writing to table columns).  Rounding to the nearest integer, rather
-than truncation, is performed when writing integer datatypes to the
-FITS file.
- 
-**I.  Error Status Values and the Error Message Stack
+       Class  Value             Keywords
+  TYP_STRUC_KEY  10  SIMPLE, BITPIX, NAXIS, NAXISn, EXTEND, BLOCKED,
+                     GROUPS, PCOUNT, GCOUNT, END
+                     XTENSION, TFIELDS, TTYPEn, TBCOLn, TFORMn, THEAP,
+                     and the first 4 COMMENT keywords in the primary array
+                     that define the FITS format.
+  TYP_CMPRS_KEY  20  The experimental keywords used in the compressed 
+                     image format ZIMAGE, ZCMPTYPE, ZNAMEn, ZVALn,
+                     ZTILEn, ZBITPIX, ZNAXISn, ZSCALE, ZZERO, ZBLANK
+  TYP_SCAL_KEY   30  BSCALE, BZERO, TSCALn, TZEROn
+  TYP_NULL_KEY   40  BLANK, TNULLn
+  TYP_DIM_KEY    50  TDIMn
+  TYP_RANG_KEY   60  TLMINn, TLMAXn, TDMINn, TDMAXn, DATAMIN, DATAMAX
+  TYP_UNIT_KEY   70  BUNIT, TUNITn
+  TYP_DISP_KEY   80  TDISPn
+  TYP_HDUID_KEY  90  EXTNAME, EXTVER, EXTLEVEL, HDUNAME, HDUVER, HDULEVEL
+  TYP_CKSUM_KEY 100  CHECKSUM, DATASUM
+  TYP_WCS_KEY   110  CTYPEn, CUNITn, CRVALn, CRPIXn, CROTAn, CDELTn
+                     CDj_is, PVj_ms, LONPOLEs, LATPOLEs
+                     TCTYPn, TCTYns, TCUNIn, TCUNns, TCRVLn, TCRVns, TCRPXn,
+                     TCRPks, TCDn_k, TCn_ks, TPVn_m, TPn_ms, TCDLTn, TCROTn
+                     jCTYPn, jCTYns, jCUNIn, jCUNns, jCRVLn, jCRVns, iCRPXn,
+                     iCRPns, jiCDn,  jiCDns, jPVn_m, jPn_ms, jCDLTn, jCROTn
+                     (i,j,m,n are integers, s is any letter)
+  TYP_REFSYS_KEY 120 EQUINOXs, EPOCH, MJD-OBSs, RADECSYS, RADESYSs
+  TYP_COMM_KEY   130 COMMENT, HISTORY, (blank keyword)
+  TYP_CONT_KEY   140 CONTINUE
+  TYP_USER_KEY   150 all other keywords
 
-Nearly all the CFITSIO routines return an error status value
-in 2 ways: as the value of the last parameter in the function call,
-and as the returned value of the function itself.  This provides
-some flexibility in the way programmers can test if an error
-occurred, as illustrated in the following 2 code fragments:
+  int fits_get_keyclass / ffgkcl (char *card)
 -
-    if ( fits_write_record(fptr, card, &status) )
-         printf(" Error occurred while writing keyword.");
+>14 Parse the 'TFORM' binary table column format string.
+    This routine parses the input TFORM character string and returns the
+    integer data type code, the repeat count of the field, and, in the case
+    of character string fields, the length of the unit string.  See Appendix
+    B for the allowed values for the returned typecode parameter.  A
+>   null pointer may be given for any output parameters that are not needed. \label{ffbnfm}
 -
-or,
+   int fits_binary_tform / ffbnfm
+       (char *tform, > int *typecode, long *repeat, long *width, 
+        int *status)
 -
-    fits_write_record(fptr, card, &status);
-    if ( status )
-         printf(" Error occurred while writing keyword.");
+>15 Parse the 'TFORM' keyword value that defines the column format in
+    an ASCII table.  This routine parses the input TFORM character
+    string and returns the data type code, the width of the column,
+    and (if it is a floating point column) the number of decimal places
+    to the right of the decimal point.  The returned data type codes are
+    the same as for the binary table, with the following
+    additional rules:  integer columns that are between 1 and 4 characters
+    wide are defined to be short integers (code = TSHORT).  Wider integer
+    columns are defined to be regular integers (code = TLONG).  Similarly,
+    Fixed decimal point columns (with TFORM = 'Fw.d') are defined to
+    be single precision reals (code = TFLOAT) if w is between 1 and 7 characters
+    wide, inclusive.  Wider 'F' columns will return a double precision
+    data code (= TDOUBLE).  'Ew.d' format columns will have datacode = TFLOAT,
+    and 'Dw.d' format columns will have datacode = TDOUBLE. A null
+>   pointer may be given for any output parameters that are not needed. \label{ffasfm}
+-
+  int fits_ascii_tform / ffasfm
+      (char *tform, > int *typecode, long *width, int *decimals, 
+       int *status)
+-
+>16 Calculate the starting column positions and total ASCII table width
+    based on the input array of ASCII table TFORM values.  The SPACE input
+    parameter defines how many blank spaces to leave between each column
+    (it is recommended to have one space between columns for better human
+>   readability). \label{ffgabc}
+-
+  int fits_get_tbcol / ffgabc
+      (int tfields, char **tform, int space, > long *rowlen, 
+       long *tbcol, int *status)
+-
+>17 Parse a template header record and return a formatted 80-character string
+    suitable for appending to (or deleting from) a FITS header file.
+    This routine is useful for parsing lines from an ASCII template file
+    and reformatting them into legal FITS header records.  The formatted
+    string may then be passed to the fits\_write\_record, ffmcrd, or 
+    fits\_delete\_key routines
+>   to append or modify a FITS header record. \label{ffgthd}
+-
+  int fits_parse_template / ffgthd
+      (char *templt, > char *card, int *keytype, int *status)
+-
+    The input templt character string generally should contain 3 tokens:
+    (1) the KEYNAME, (2) the VALUE, and (3) the COMMENT string.  The
+    TEMPLATE string must adhere to the following format:
+ 
+>-      The KEYNAME token must begin in columns 1-8 and be a maximum  of 8
+        characters long.  A legal FITS keyword name may only
+        contain the characters A-Z, 0-9, and '-' (minus sign) and
+        underscore.  This routine will automatically convert any lowercase
+        characters to uppercase in the output string.  If the first 8 characters 
+        of the template line are
+        blank then the remainder of the line is considered to be a FITS comment
+>       (with a blank keyword name).  
+ 
+>-      The VALUE token must be separated from the KEYNAME token by one or more
+        spaces and/or an '=' character.  The data type of the VALUE token
+        (numeric, logical, or character string) is automatically determined
+        and  the output CARD string is formatted accordingly.  The value
+        token may be forced to be interpreted as a string (e.g. if it is a
+>       string of numeric digits) by enclosing it in single quotes.
+ 
+>-      The COMMENT token is optional, but if present must be separated from
+>       the VALUE token by at least one blank space and a  '/' character.
+ 
+>-      One exception to the above rules is that if the first non-blank
+        character in the first 8 characters of the template string is a 
+        minus sign ('-') followed
+        by a single token, or a single token followed by an equal sign,
+        then it is interpreted as the name of a keyword which is to be
+>       deleted from the FITS header.
+ 
+>-      The second exception is that if the template string starts with
+        a minus sign and is followed by 2 tokens (without an equals sign between
+        them) then the second token
+        is interpreted as the new name for the keyword specified by
+        first token.  In this case the old keyword name (first token)
+        is returned in characters 1-8 of the returned CARD string, and
+        the new keyword name (the second token) is returned in characters
+        41-48 of the returned CARD string.  These old and new names
+        may then be passed to the ffmnam routine which will change
+>       the keyword name.
+ 
+    The keytype output parameter indicates how the returned CARD string
+    should be interpreted:
+-
+        keytype                  interpretation
+        -------          -------------------------------------------------
+           -2            Rename the keyword with name = the first 8 characters of CARD
+                         to the new name given in characters 41 - 48 of CARD.
+ 
+           -1            delete the keyword with this name from the FITS header.
+ 
+            0            append the CARD string to the FITS header if the
+                         keyword does not already exist, otherwise update
+                         the keyword value and/or comment field if is already exists.
+ 
+            1            This is a HISTORY or COMMENT keyword; append it to the header
+ 
+            2            END record; do not explicitly write it to the FITS file.
+-
+     EXAMPLES:  The following lines illustrate valid input template strings:
+-
+      INTVAL 7 / This is an integer keyword
+      RVAL           34.6   /     This is a floating point keyword
+      EVAL=-12.45E-03  / This is a floating point keyword in exponential notation
+      lval F / This is a boolean keyword
+                  This is a comment keyword with a blank keyword name
+      SVAL1 = 'Hello world'   /  this is a string keyword
+      SVAL2  '123.5'  this is also a string keyword
+      sval3  123+  /  this is also a string keyword with the value '123+    '
+      # the following template line deletes the DATE keyword
+      - DATE
+      # the following template line modifies the NAME keyword to OBJECT
+      - NAME OBJECT
+-
+>18  Parse the input string containing a list of rows or row ranges, and
+     return integer arrays containing the first and last row in each
+     range.  For example, if rowlist = "3-5, 6, 8-9" then it will
+     return numranges = 3, rangemin = 3, 6, 8 and rangemax = 5, 6, 9.
+     At most, 'maxranges' number of ranges will be returned.  'maxrows'
+     is the maximum number of rows in the table; any rows or ranges
+     larger than this will be ignored.  The rows must be specified in
+     increasing order, and the ranges must not overlap. A minus sign
+     may be use to specify all the rows to the upper or lower bound, so
+     "50-" means all the rows from 50 to the end of the table, and "-"
+     means all the rows in the table, from 1 - maxrows.
+>   \label{ffrwrg}
+-
+    int fits_parse_range / ffrwrg(char *rowlist, long maxrows, int maxranges, >  
+       int *numranges, long *rangemin, long *rangemax, int *status)
+-
+>19  Check that the Header fill bytes (if any) are all blank.  These are the bytes
+     that may follow END keyword and before the beginning of data unit,
+     or the end of the HDU if there is no data unit.
+>   \label{ffchfl}
+-
+    int ffchfl(fitsfile *fptr, > int *status)
+-
+>20  Check that the Data fill bytes (if any) are all zero (for IMAGE or 
+     BINARY Table HDU) or all blanks (for ASCII table HDU).  These file
+     bytes may be located after the last valid data byte in the HDU and
+     before the physical end of the HDU.
+>     \label{ffcdfl}
+-
+    int ffcdfl(fitsfile *fptr, > int *status)
 -
-A listing of all the CFITSIO status code values is given at the end of
-this document.  Programmers are encouraged to use the symbolic
-mnemonics (defined in fitsio.h) rather than the actual integer status
-values to improve the readability of their code.
 
-The CFITSIO library uses an `inherited status' convention for the
-status parameter which means that if a routine is called with a
-positive input value of the status parameter as input, then the routine
-will exit immediately without changing the value of the status
-parameter.  Thus, if one passes the status value returned from each
-CFITSIO routine as input to the next CFITSIO routine, then whenever an
-error is detected all further CFITSIO processing will cease.  This
-convention can simplify the error checking in application programs
-because it is not necessary to check the value of the status parameter
-after every single CFITSIO routine call.  If a program contains a
-sequence of several CFITSIO calls, one can just check the status value
-after the last call.  Since the returned status values are generally
-distinctive, it should be possible to determine which routine
-originally returned the error status.
+*VII.  The CFITSIO Iterator Function
 
-CFITSIO also maintains an internal stack of error messages
-(80-character maximum length)  which in many cases provide a more
-detailed explanation of the cause of the error than is provided by the
-error status number alone.  It is recommended that the error message
-stack be printed out whenever a program detects a CFITSIO error.  The
-function fits\_report\_error will print out the entire error message
-stack, or alternatively one may call fits\_read\_errmsg to get the
-error messages one at a time.
+The fits\_iterate\_data function in CFITSIO provides a unique method of
+executing an arbitrary user-supplied `work' function that operates on
+rows of data in  FITS tables or on pixels in FITS images.  Rather than
+explicitly reading and writing the FITS images or columns of data, one
+instead calls the CFITSIO iterator routine, passing to it the name of
+the user's work function that is to be executed along with a list of
+all the table columns or image arrays that are to be passed to the work
+function.  The CFITSIO iterator function then does all the work of
+allocating memory for the arrays, reading the input data from the FITS
+file, passing them to the work function, and then writing any output
+data back to the FITS file after the work function exits.  Because
+it is often more efficient to process only a subset of the total table
+rows at one time, the iterator function can determine the optimum
+amount of data to pass in each iteration and repeatly call the work
+function until the entire table been processed.
 
-**J.  Variable-Length Arrays in Binary Tables
- 
-CFITSIO provides easy-to-use support for reading and writing data in
-variable length fields of a binary table. The variable length columns
-have TFORMn keyword values of the form `1Pt(len)' where `t' is the
-datatype code (e.g., I, J, E, D, etc.) and `len' is an integer
-specifying the maximum length of the vector in the table.  If the value
-of `len' is not specified when the table is created (e.g., if the TFORM
-keyword value is simply specified as '1PE' instead of '1PE(400) ), then
-CFITSIO will automatically scan the table when it is closed to
-determine the maximum length of the vector and will append this value
-to the TFORMn value.
+For many applications this single CFITSIO iterator function can
+effectively replace all the other CFITSIO routines for reading or
+writing data in FITS images or tables.  Using the iterator has several
+important advantages over the traditional method of reading and writing
+FITS data files:
 
-The same routines which read and write data in an ordinary fixed length
-binary table extension are also used for variable length fields,
-however, the routine parameters take on a slightly different
-interpretation as described below.
+\begin{itemize}
+\item
+It cleanly separates the data I/O from the routine that operates on
+the data.  This leads to a more modular and `object oriented'
+programming style.  
 
-All the data in a variable length field is written into an area called
-the `heap' which follows the main fixed-length FITS binary table. The
-size of the heap, in bytes, is specified by the PCOUNT keyword in the
-FITS header. When creating a new binary table, the initial value of
-PCOUNT should usually be set to zero. CFITSIO will recompute the size
-of the heap as the data is written and will automatically update the
-PCOUNT keyword value when the table is closed.  When writing variable
-length data to a table, CFITSIO will automatically extend the size
-of the heap area if necessary, so that any following HDUs do not
-get overwritten.
-
-By default the heap data area starts immediately after the last row of
-the fixed-length table.  This default starting location may be
-overridden by the THEAP keyword, but this is not recommended.  
-If addtional rows of data are added to the table, CFITSIO will
-automatically shift the the heap down to make room for the new
-rows, but it is obviously be more efficient to initially
-create the table with the necessary number of blank rows, so that
-the heap does not needed to be constantly moved.
-
-When writing to a variable length field the entire array of values for
-a given row of the table must be written with a single call to
-fits\_write\_col.  The total length of the array is given by nelements
-+ firstelem - 1.  Additional elements cannot be appended to an existing
-vector at a later time since any attempt to do so will simply overwrite
-all the previously written data.  Note also that the new data will be
-written to a new area of the heap and the heap space used by the
-previous write cannot be reclaimed.  For this reason each row of a
-variable length field should only be written once.  An exception to
-this general rule occurs when setting elements of an array as
-undefined.  One must first write a dummy value into the array with
-fits\_write\_col, and then call fits\_write\_col\_nul to flag the
-desired elements as undefined.  (Do not use the fits\_write\_colnull
-routines with variable length fields).  Note that the rows of a table,
-whether fixed or variable length, do not have to be written
-consecutively and may be written in any order.
-
-When writing to a variable length ASCII character field (e.g., TFORM =
-'1PA') only a single character string can be written.  The `firstelem'
-and `nelements' parameter values in the fits\_write\_col routine are
-ignored and the number of characters to write is simply determined by
-the length of the input null-terminated character string.
-
-The fits\_write\_descript routine is useful in situations where
-multiple rows of a variable length column have the identical array of
-values.  One can simply write the array once for the first row, and
-then use fits\_write\_descript to write the same descriptor values into
-the other rows;  all the rows will then point to the same storage
-location thus saving disk space.
+\item
+It simplifies the application program by eliminating the need to allocate
+memory for the data arrays and eliminates most of the calls to the CFITSIO
+routines that explicitly read and write the data.
 
-When reading from a variable length array field one can only read as
-many elements as actually exist in that row of the table; reading does
-not automatically continue with the next row of the table as occurs
-when reading an ordinary fixed length table field.  Attempts to read
-more than this will cause an error status to be returned.  One can
-determine the number of elements in each row of a variable column with
-the fits\_read\_descript routine.
+\item
+It ensures that the data are processed as efficiently as possible.
+This is especially important when processing tabular data since
+the iterator function will calculate the most efficient number
+of rows in the table to be passed at one time to the user's work 
+function on each iteration.
 
-**K.  Support for IEEE Special Values
- 
-The ANSI/IEEE-754 floating-point number standard defines certain
-special values that are used to represent such quantities as
-Not-a-Number (NaN), denormalized, underflow, overflow, and infinity.
-(See the Appendix in the NOST FITS standard or the NOST FITS User's
-Guide for a list of these values).  The CFITSIO routines that read
-floating point data in FITS files recognize these IEEE special values
-and by default interpret the overflow and infinity values as being
-equivalent to a NaN, and convert the underflow and denormalized values
-into zeros.  In some cases programmers may want access to the raw IEEE
-values, without any modification by CFITSIO.  This can be done by
-calling the fits\_read\_img or fits\_read\_col routines while
-specifying 0.0 as the value of the NULLVAL parameter.  This will force
-CFITSIO to simply pass the IEEE values through to the application
-program without any modification.  This is not fully supported on
-VAX/VMS machines, however, where there is no easy way to bypass the
-default interpretation of the IEEE special values.
+\item
+Makes it possible for larger projects to develop a library of work
+functions that all have a uniform calling sequence and are all
+independent of the details of the FITS file format.
 
-**L.  When the Final Size of the FITS HDU is Unknown
+\end{itemize}
 
-It is not required to know the total size of a FITS data array or table
-before beginning to write the data to the FITS file.  In the case of
-the primary array or an image extension, one should initially create
-the array with the size of the highest dimension (largest NAXISn
-keyword) set to a dummy value, such as 1.  Then after all the data have
-been written and the true dimensions are known, then the NAXISn value
-should be updated using the fits\_update\_key routine before moving to
-another extension or closing the FITS file.
+There are basically 2 steps in using the CFITSIO iterator function.
+The first step is to design the work function itself which must have a
+prescribed set of input parameters.  One of these parameters is a
+structure containing pointers to the arrays of data; the work function
+can perform any desired operations on these arrays and does not need to
+worry about how the input data were read from the file or how the
+output data get written back to the file.
 
-When writing to FITS tables, CFITSIO automatically keeps track of the
-highest row number that is written to, and will increase the size of
-the table if necessary.  CFITSIO will also automatically insert space
-in the FITS file if necessary, to ensure that the data 'heap', if it
-exists, and/or any additional HDUs that follow the table do not get
-overwritten as new rows are written to the table.
+The second step is to design the driver routine that opens all the
+necessary FITS files and initializes  the input parameters to the
+iterator function.  The driver program calls the CFITSIO iterator
+function which then reads the data and passes it to the user's work
+function.
 
-As a general rule it is best to specify the initial number of rows = 0
-when the table is created, then let CFITSIO keep track of the number of
-rows that are actually written.  The application program should not
-manually update the number of rows in the table (as given by the NAXIS2
-keyword) since CFITSIO does this automatically.  If a table is
-initially created with more than zero rows, then this will ususally be
-considered as the minimum size of the table, even if fewer rows are
-actually written to the table.  Thus, if a table is initially created
-with NAXIS2 = 20, and CFITSIO only writes 10 rows of data before
-closing the table, then NAXIS2 will remain equal to 20.  If however, 30
-rows of data are written to this table, then NAXIS2 will be increased
-from 20 to 30.  The one exception to this automatic updating of the
-NAXIS2 keyword is if the application program directly modifies the
-value of NAXIS2 (up or down) itself just before closing the table.  In this
-case, CFITSIO does not update NAXIS2 again, since it assumes that the
-application program must have had a good reason for changing the value
-directly.  This is not recommended, however, and is only provided for
-backward compatibility with software that initially creates a table
-with a large number of rows, than decreases the NAXIS2 value to the
-actual smaller value just before closing the table.
+The following 2 sections describe these steps in more detail.  There
+are also several example programs included with the CFITSIO
+distribution which illustrate how to use the iterator function.
 
-**M.  Local FITS Conventions supported by CFITSIO
+**A   The Iterator Work Function
 
-CFITSIO supports several local FITS conventions which are not
-defined in the official NOST FITS standard and which are not
-necessarily recognized or supported by other FITS software packages.
-Programmers should be cautious about using these features, especially
-if the FITS files that are produced are expected to be processed by
-other software systems which do not use the CFITSIO interface.  
+The user-supplied iterator work function must have the following set of
+input parameters (the function can be given any desired name):
 
-***1.  Long String Keyword Values.
- 
-The length of a standard FITS string keyword is limited to 68
-characters because it must fit entirely within a single FITS header
-keyword record.  In some instances it is necessary to encode strings
-longer than this limit, so CFITSIO supports a local convention in which
-the string value is continued over multiple keywords.  This
-continuation convention uses an ampersand character at the end of each
-substring to indicate that it is continued on the next keyword, and the
-continuation keywords all have the name CONTINUE without an equal sign
-in column 9. The string value may be continued in this way over as many
-additional CONTINUE keywords as is required.  The following lines
-illustrate this continuation convention which is used in the value of
-the STRKEY keyword:
--
-LONGSTRN= 'OGIP 1.0'    / The OGIP Long String Convention may be used.
-STRKEY  = 'This is a very long string keyword&'  / Optional Comment
-CONTINUE  ' value that is continued over 3 keywords in the &  '
-CONTINUE  'FITS header.' / This is another optional comment.
+- 
+  int user_fn( long totaln, long offset, long firstn, long nvalues,
+               int narrays, iteratorCol *data,  void *userPointer )
 -
-It is recommended that the LONGSTRN keyword, as shown here, always be
-included in any HDU that uses this longstring convention as a warning
-to any software that must read the keywords.  A routine called fits\_write\_key\_longwarn
-has been provided in CFITSIO to write this keyword if it does not
-already exist.
 
-This long string convention is supported by the following CFITSIO
-routines:
--
-    fits_write_key_longstr  - write a long string keyword value
-    fits_insert_key_longstr - insert a long string keyword value
-    fits_modify_key_longstr - modify a long string keyword value
-    fits_update_key_longstr - modify a long string keyword value
-    fits_read_key_longstr   - read  a long string keyword value
-    fits_delete_key         - delete a keyword
--
-The fits\_read\_key\_longstr routine is unique among all the CFITSIO
-routines in that it internally allocates memory for the long string
-value;  all the other CFITSIO routines that deal with arrays require
-that the calling program pre-allocate adequate space to hold the array
-of data.  Consequently, programs which use the fits\_read\_key\_longstr
-routine must be careful to free the allocated memory for the string
-when it is no longer needed.
+\begin{itemize}
 
-The following 2 routines also have limited support for this long string
-convention,
--
-      fits_modify_key_str - modify an existing string keyword value
-      fits_update_key_str - update a string keyword value
--
-in that they will correctly overwrite an existing long string value,
-but the new string value is limited to a maximum of 68 characters in
-length.
+\item
+  totaln -- the total number of table rows or image pixels
+            that will be passed to the work function
+            during 1 or more iterations. 
 
-The more commonly used CFITSIO routines to write string valued keywords
-(fits\_update\_key and fits\_write\_key) do not support this long
-string convention and only support strings up to 68 characters in
-length.  This has been done deliberately to prevent programs from
-inadvertently writing keywords using this non-standard convention
-without the explicit intent of the programmer or user.   The
-fits\_write\_key\_longstr routine must be called instead to write long
-strings.  This routine can also be used to write ordinary string values
-less than 68 characters in length.
+\item
+  offset     -- the offset applied to the first table row or image
+                pixel to be passed to the work function.  In other
+                words, this is the number of rows or pixels that
+                are skipped over before starting the iterations. If 
+                offset = 0, then all the table rows or image pixels
+                will be passed to the work function.
 
-***2.  Arrays of Fixed-Length Strings in Binary Tables
- 
-The definition of the FITS binary table extension format does not
-provide a simple way to specify that a character column contains an
-array of fixed-length strings.  To support this feature, CFITSIO uses a
-local convention for the format of the TFORMn keyword value of the form
-'rAw' where 'r' is an integer specifying the total width in characters
-of the column, and 'w' is an integer specifying the (fixed) length of
-an individual unit string within the vector.  For example, TFORM1 =
-'120A10' would indicate that the binary table column is 120 characters
-wide and consists of 12 10-character length strings.  This convention
-is recognized by the CFITSIO routines that read or write strings in
-binary tables.   The Binary Table definition document specifies that
-other optional characters may follow the datatype code in the TFORM
-keyword, so this local convention is in compliance with the
-FITS standard although other FITS readers may not
-recognize this convention.
- 
-The Binary Table definition document that was approved by the IAU in
-1994 contains an appendix describing an alternate convention for
-specifying arrays of fixed or variable length strings in a binary table
-character column (with the form 'rA:SSTRw/nnn)'.  This appendix was not
-officially voted on by the IAU and hence is still provisional.  CFITSIO
-does not currently support this proposal.
+\item
+  firstn     -- the number of the first table row or image pixel
+                (starting with 1)  that is being passed in this 
+                particular call to the work function.
 
-***3.  Keyword Units Strings
+\item
+  nvalues    -- the number of table rows or image pixels that are
+                being passed in this particular call to the work
+                function.  nvalues will always be less than or
+                equal to totaln and will have the same value on
+                each iteration, except possibly on the last 
+                call which may have a smaller value.
 
-One deficiency of the current FITS Standard is that it does not define
-a specific convention for recording the physical units of a keyword
-value.  The TUNITn keyword can be used to specify the physical units of
-the values in a table column, but there is no analogous convention for
-keyword values.  The comment field of the keyword is often used for
-this purpose, but the units are usually not specified in a well defined
-format that FITS readers can easily recognize and extract.
+\item
+  narrays     -- the number of arrays of data that are being passed
+                 to the work function.  There is one array for each 
+                 image or table column.      
 
-To solve this deficiency, CFITSIO uses a local convention in which the
-keyword units are enclosed in square brackets as the first token in the
-keyword comment field; more specifically, the opening square bracket
-immediately follows the slash '/' comment field delimiter and a single
-space character.  The following examples illustrate keywords that use
-this convention:
+\item
+  *data   -- array of structures, one for each 
+             column or image.  Each structure contains a pointer
+             to the array of data as well as other descriptive
+             parameters about that array.  
 
+\item
+  *userPointer -- a user supplied pointer that can be used
+                 to pass ancillary information from the driver function
+                 to the work function.
+                 This pointer is passed to the CFITSIO iterator function
+                 which then passes it on to the
+                 work function without any modification.
+                 It may point to a single number, to an array of values,
+                 to a structure containing an arbitrary set of parameters
+                 of different types, 
+                 or it may be a null pointer if it is not needed.
+                 The work function must cast this pointer to the
+                 appropriate data type before using it it.
+\end{itemize}
+
+The totaln, offset, narrays, data, and userPointer parameters are
+guaranteed to have the same value on each iteration.  Only firstn,
+nvalues, and the arrays of data pointed to by the data structures may
+change on each iterative call to the work function.
+
+Note that the iterator treats an image as a long 1-D array of pixels
+regardless of it's intrinsic dimensionality.  The total number of
+pixels is just the product of the size of each dimension, and the order
+of the pixels is the same as the order that they are stored in the FITS
+file. If the work function needs to know the number and size of the
+image dimensions then these parameters can be passed via the
+userPointer structure.
+
+The iteratorCol structure is currently defined as follows:
 -
-EXPOSURE=               1800.0 / [s] elapsed exposure time
-V_HELIO =                16.23 / [km s**(-1)] heliocentric velocity
-LAMBDA  =                5400. / [angstrom] central wavelength
-FLUX    = 4.9033487787637465E-30 / [J/cm**2/s] average flux
--
+typedef struct  /* structure for the iterator function column information */
+{  
+   /* structure elements required as input to fits_iterate_data: */
 
-In general, the units named in the IAU(1988) Style Guide are
-recommended, with the main exception that the preferred unit for angle
-is 'deg' for degrees.
+  fitsfile *fptr;       /* pointer to the HDU containing the column or image */
+  int      colnum;      /* column number in the table; ignored for images    */
+  char     colname[70]; /* name (TTYPEn) of the column; null for images      */
+  int      datatype;    /* output data type (converted if necessary) */
+  int      iotype;      /* type: InputCol, InputOutputCol, or OutputCol */
 
-The fits\_read\_key\_unit and fits\_write\_key\_unit routines in
-CFITSIO read and write, respectively, the keyword unit strings in an
-existing keyword.
+  /* output structure elements that may be useful for the work function: */
 
-***4.  HIERARCH Convention for Extended Keyword Names
+  void     *array;    /* pointer to the array (and the null value) */
+  long     repeat;    /* binary table vector repeat value; set     */
+                      /*     equal to 1 for images                 */
+  long     tlmin;     /* legal minimum data value, if any          */
+  long     tlmax;     /* legal maximum data value, if any          */
+  char     unit[70];  /* physical unit string (BUNIT or TUNITn)    */
+  char     tdisp[70]; /* suggested display format; null if none    */
 
-CFITSIO supports the HIERARCH keyword convention which allows keyword
-names that are longer then 8 characters and may contain the full range
-of printable ASCII text characters.  This convention 
-was developed at the European Southern Observatory (ESO)  to support 
-hierarchical FITS keyword such as:
--
-HIERARCH ESO INS FOCU POS = -0.00002500 / Focus position
+} iteratorCol;
 -
-Basically, this convention uses the FITS keyword 'HIERARCH' to indicate
-that this convention is being used, then the actual keyword name
-({\tt'ESO INS FOCU POS'} in this example) begins in column 10 and can
-contain any printable ASCII text characters, including spaces.  The
-equals sign marks the end of the keyword name and is followed by the
-usual value and comment fields just as in standard FITS keywords.
-Further details of this convention are described at
-http://arcdev.hq.eso.org/dicb/dicd/dic-1-1.4.html (search for
-HIERARCH).
 
-This convention allows a much broader range of keyword names 
-than is allowed by the FITS Standard.  Here are more examples
-of such keywords:
--
-HIERARCH LongKeyword = 47.5 / Keyword has > 8 characters, and mixed case
-HIERARCH XTE$TEMP = 98.6 / Keyword contains the '$' character
-HIERARCH Earth is a star = F / Keyword contains embedded spaces
--
-CFITSIO will transparently read and write these keywords, so application
-programs do not in general need to know anything about the specific
-implementation details of the HIERARCH convention.  In particular,
-application programs do not need to specify the `HIERARCH' part of the
-keyword name when reading or writing keywords (although it
-may be included if desired).  When writing a keyword, CFITSIO first
-checks to see if the keyword name is legal as a standard FITS keyword
-(no more than 8 characters long and containing only letters, digits, or
-a minus sign or underscore). If so it writes it as a standard FITS
-keyword, otherwise it uses the hierarch convention to write the
-keyword.   The maximum keyword name length is 67 characters, which
-leaves only 1 space for the value field.  A more practical limit is
-about 40 characters, which leaves enough room for most keyword values.
-CFITSIO returns an error if there is not enough room for both the
-keyword name and the keyword value on the 80-character card, except for
-string-valued keywords which are simply truncated so that the closing
-quote character falls in column 80.  In the current implementation,
-CFITSIO preserves the case of the letters when writing the keyword
-name, but it is case-insensitive when reading or searching for a
-keyword.  The current implementation allows any ASCII text character
-(ASCII 32 to ASCII 126) in the keyword name except for the '='
-character.  A space is also required on either side of the equal sign.
+Instead of directly reading or writing the elements in this structure,
+it is recommended that programmers use the access functions that are
+provided for this purpose.
 
-**N.  Optimizing Code for Maximum Processing Speed
- 
-CFITSIO has been carefully designed to obtain the highest possible
-speed when reading and writing FITS files.  In order to achieve the
-best performance, however, application programmers must be careful to
-call the CFITSIO routines appropriately and in an efficient sequence;
-inappropriate usage of CFITSIO routines can greatly slow down the
-execution speed of a program.
+The first five elements in this structure must be initially defined by
+the driver routine before calling the iterator routine.  The CFITSIO
+iterator routine uses this information to determine what column or
+array to pass to the work function, and whether the array is to be
+input to the work function, output from the work function, or both.
+The CFITSIO iterator function fills in the values of the remaining
+structure elements before passing it to the work function.
 
-The maximum possible I/O speed of CFITSIO depends of course on the type
-of computer system that it is running on.  As a rough guide, the
-current generation of workstations can achieve speeds of 2 -- 10 MB/s
-when reading or writing FITS images and similar, or slightly slower
-speeds with FITS binary tables.  Reading of FITS files can occur at
-even higher rates (30MB/s or more) if the FITS file is still cached in
-system memory following a previous read or write operation on the same
-file.  To more accurately predict the best performance that is possible
-on any particular system, a diagnostic program called ``speed.c'' is
-included with the CFITSIO distribution which can be run to
-approximately measure the maximum possible speed of writing and reading
-a test FITS file.
+The array structure element is a pointer to the actual data array and
+it must be cast to the correct data type before it is used.  The
+`repeat' structure element give the number of data values in each row
+of the table, so that the total number of data values in the array is
+given by repeat * nvalues.  In the case of image arrays and ASCII
+tables, repeat will always be equal to 1.  When the data type is a
+character string, the array pointer is actually a pointer to an array
+of string pointers (i.e., char **array).  The other output structure
+elements are provided for convenience in case that information is
+needed within the work function.  Any other information may be passed
+from the driver routine to the work function via the userPointer
+parameter.
 
-The following 2 sections provide some background on how CFITSIO
-internally manages the data I/O and describes some strategies that may
-be used to optimize the processing speed of software that uses
-CFITSIO.
+Upon completion, the work routine must return an integer status value,
+with 0 indicating success and any other value indicating an error which
+will cause the iterator function to immediately exit at that point.  Return status
+values in the range 1 -- 1000 should be avoided since these are
+reserved for use by CFITSIO.  A return status value of -1 may be used to
+force the CFITSIO iterator function to stop at that point and return
+control to the driver routine after writing any output arrays to the
+FITS file.  CFITSIO does not considered this to be an error condition,
+so any further processing by the application program will continue normally.
 
-***1.  Background Information: How CFITSIO Manages Data I/O
+**B   The Iterator Driver Function
 
-Many CFITSIO operations involve transferring only a small number of
-bytes to or from the FITS file (e.g, reading a keyword, or writing a
-row in a table); it would be very inefficient to physically read or
-write such small blocks of data directly in the FITS file on disk,
-therefore CFITSIO maintains a set of internal Input--Output (IO)
-buffers in RAM memory that each contain one FITS block (2880 bytes) of
-data.  Whenever CFITSIO needs to access data in the FITS file, it first
-transfers the FITS block containing those bytes into one of the IO
-buffers in memory.  The next time CFITSIO needs to access bytes in the
-same block it can then go to the fast IO buffer rather than using a
-much slower system disk access routine.  The number of available IO
-buffers is determined by the NIOBUF parameter (in fitsio2.h) and is
-currently set to 25.
+The iterator driver function must open the necessary FITS files and
+position them to the correct HDU.  It must also initialize the following
+parameters in the iteratorCol structure (defined above) for each
+column or image before calling the CFITSIO iterator function.
+Several `constructor' routines are provided in CFITSIO for this
+purpose.
 
-Whenever CFITSIO reads or writes data it first checks to see if that
-block of the FITS file is already loaded into one of the IO buffers.
-If not, and if there is an empty IO buffer available, then it will load
-that block into the IO buffer (when reading a FITS file) or will
-initialize a new block (when writing to a FITS file).  If all the IO
-buffers are already full, it must decide which one to reuse (generally
-the one that has been accessed least recently), and flush the contents
-back to disk if it has been modified before loading the new block.
+\begin{itemize}
+\item 
+  *fptr --  The fitsfile pointer to the table or image.
+\item
+colnum -- the number of the column in the table.  This value is ignored
+          in the case of images.  If colnum equals 0, then the column name
+          will be used to identify the column to be passed to the
+          work function.
 
-The one major exception to the above process occurs whenever a large
-contiguous set of bytes are accessed, as might occur when reading or
-writing a FITS image.  In this case CFITSIO bypasses the internal IO
-buffers and simply reads or writes the desired bytes directly in the
-disk file with a single call to a low-level file read or write
-routine.  The minimum threshold for the number of bytes to read or
-write this way is set by the MINDIRECT parameter and is currently set
-to 3 FITS blocks = 8640 bytes.  This is the most efficient way to read
-or write large chunks of data and can achieve IO transfer rates of
-5 -- 10MB/s or greater.  Note that this fast direct IO process is not
-applicable when accessing columns of data in a FITS table because the
-bytes are generally not contiguous since they are interleaved by the
-other columns of data in the table.  This explains why the speed for
-accessing FITS tables is generally slower than accessing
-FITS images.
+\item
+colname -- the name (TTYPEn keyword) of the column.  This is
+           only required if colnum = 0 and is ignored for images.
+\item
+datatype -- The desired data type of the array to be passed to the
+            work function.  For numerical data the data type does
+            not need to be the same as the actual data type in the
+            FITS file, in which case CFITSIO will do the conversion.
+            Allowed values are: TSTRING, TLOGICAL, TBYTE, TSBYTE, TSHORT, TUSHORT, 
+            TINT, TLONG, TULONG, TFLOAT, TDOUBLE.  If the input
+            value of data type equals 0, then the  existing
+            data type of the column or image will be used without
+            any conversion.
 
-Given this background information, the general strategy for efficiently
-accessing FITS files should now be apparent:  when dealing with FITS
-images, read or write large chunks of data at a time so that the direct
-IO mechanism will be invoked;  when accessing FITS headers or FITS
-tables, on the other hand, once a particular FITS block has been
-loading into one of the IO buffers, try to access all the needed
-information in that block before it gets flushed out of the IO buffer.
-It is important to avoid the situation where the same FITS block is
-being read then flushed from a IO buffer multiple times.
+\item
+iotype -- defines whether the data array is to be input to the
+          work function (i.e, read from the FITS file), or output
+          from the work function (i.e., written to the FITS file) or
+          both.  Allowed values are InputCol, OutputCol, or InputOutputCol.
+	  Variable-length array columns are supported as InputCol or 
+	  InputOutputCol types, but may not be used for an OutputCol type.
+\end{itemize}
 
-The following section gives more specific suggestions for optimizing
-the use of CFITSIO.
+After the driver routine has initialized all these parameters, it
+can then call the CFITSIO iterator function:
 
-***2.  Optimization Strategies
+-
+  int fits_iterate_data(int narrays, iteratorCol *data, long offset,
+      long nPerLoop, int (*workFn)( ), void *userPointer, int *status);
+-
 
-1.  When dealing with a FITS primary array or IMAGE extension, it is
-more efficient to read or write large chunks of the  image at a time
-(at least 3 FITS blocks = 8640 bytes) so that the direct IO mechanism
-will be used as described in the previous section.  Smaller chunks of
-data are read or written via the IO buffers, which is somewhat less
-efficient because of the extra copy operation and additional
-bookkeeping steps that are required.  In principle it is more efficient
-to read or write as big an array of image pixels at one time as
-possible, however, if the array becomes so large that the operating
-system cannot store it all in RAM, then the performance may be degraded
-because of the increased swapping of virtual memory to disk.
+\begin{itemize}
+\item
 
-2.  When dealing with FITS tables, the most important efficiency factor
-in the software design is to read or write the data in the FITS file in
-a single pass through the file.  An example of poor program design
-would be to read a large, 3-column table by sequentially reading the
-entire first column, then going back to read the 2nd column, and
-finally the 3rd column; this obviously requires 3 passes through the
-file which could triple the execution time of an IO limited program.
-For small tables this is not important, but when reading multi-megabyte
-sized tables these inefficiencies can become significant.  The more
-efficient procedure in this case is to read or write only as many rows
-of the table as will fit into the available internal IO buffers, then
-access all the necessary columns of data within that range of rows.
-Then after the program is completely finished with the data in those
-rows it can move on to the next range of rows that will fit in the
-buffers, continuing in this way until the entire file has been
-processed.  By using this procedure of accessing all the columns of a
-table in parallel rather than sequentially, each block of the FITS file
-will only be read or written once.
+   narrays    -- the number of columns or images that are to be passed
+                 to the work function.  
+\item
+   *data --     pointer to array of structures containing information 
+                about each column or image.
 
-The optimal number of rows to read or write at one time in a given
-table depends on the width of the table row, on the number of IO
-buffers that have been allocated in CFITSIO, and also on the number of
-other FITS files that are open at the same time (since one IO buffer is
-always reserved for each open FITS file).  Fortunately, a CFITSIO
-routine is available that will return the optimal number of rows for a
-given table:  fits\_get\_rowsize.  It is not critical to use exactly
-the value of nrows returned by this routine, as long as one does not
-exceed it.  Using a very small value however can also lead to poor
-performance because of the overhead from the larger number of
-subroutine calls.
+\item
+   offset      -- if positive, this number of rows at the
+                      beginning of the table (or pixels in the image) 
+                      will be skipped and will not be passed to the work
+                      function.
 
-The optimal number of rows returned by fits\_get\_rowsize is valid only
-as long as the application program is only reading or writing data in
-the specified table.  Any other calls to access data in the table
-header or in any other FITS file would  cause additional blocks of data
-to be loaded into the IO buffers displacing data from the original
-table, and should be avoided during the critical period while the table
-is being read or written.
+\item
+   nPerLoop   - specifies the number of table rows (or number of
+                    image pixels) that are to be passed to the work
+                    function on each iteration.  If nPerLoop = 0
+                    then CFITSIO will calculate the optimum number
+                    for greatest efficiency.
+                    If nPerLoop is negative, then all the rows
+                    or pixels will be passed at one time, and the work
+                    function will only be called once.  If any variable
+		    length arrays are being processed, then the nPerLoop
+		    value is ignored, and the iterator will always process
+		    one row of the table at a time.
 
-Occasionally it is necessary to simultaneously access more than one
-FITS table, for example when transferring values from an input table to
-an output table.  In cases like this, one should call
-fits\_get\_rowsize to get the optimal number of rows for each table
-separately, than reduce the number of rows proportionally.  For
-example, if the optimal number of rows in the input table is 3600 and
-is 1400 in the output table, then these values should be cut in half to
-1800 and 700, respectively, if both tables are going to be accessed at
-the same time.
+\item
+   *workFn     - the name (actually the address) of the work function
+                 that is to be called by fits\_iterate\_data.
 
-3.  Use binary table extensions rather than ASCII table
-extensions for better efficiency  when dealing with tabular data.  The
-I/O to ASCII tables is slower because of the overhead in formatting or
-parsing the ASCII data fields and because ASCII tables are about twice
-as large as binary tables with the same information content.
+\item
+   *userPointer - this is a user supplied pointer that can be used
+                  to pass ancillary information from the driver routine
+                  to the work function.  It may point to a single number,
+                  an array, or to a structure containing an arbitrary set
+                  of parameters.
 
-4. Design software so that it reads the FITS header keywords in the
-same order in which they occur in the file.  When reading keywords,
-CFITSIO searches forward starting from the position of the last keyword
-that was read.  If it reaches the end of the header without finding the
-keyword, it then goes back to the start of the header and continues the
-search down to the position where it started.  In practice, as long as
-the entire FITS header can fit at one time in the available internal IO
-buffers, then the header keyword access will be very fast and it makes
-little difference which order they are accessed.
+\item
+   *status      - The CFITSIO error status.  Should = 0 on input;
+                  a non-zero output value indicates an error.
+\end{itemize}
 
-5. Avoid the use of scaling (by using the BSCALE and BZERO or TSCAL and
-TZERO keywords) in FITS files since the scaling operations add to the
-processing time needed to read or write the data.  In some cases it may
-be more efficient to temporarily turn off the scaling (using fits\_set\_bscale or
-fits\_set\_tscale) and then read or write the raw unscaled values in the FITS
-file.
+When fits\_iterate\_data is called it first allocates memory to hold
+all the requested columns of data or image pixel arrays.  It then reads
+the input data from the FITS tables or images into the arrays then
+passes the structure with pointers to these data arrays to the work
+function.  After the work function returns, the iterator function
+writes any output columns of data or images back to the FITS files.  It
+then repeats this process for any remaining sets of rows or image
+pixels until it has processed the entire table or image or until the
+work function returns a non-zero status value.  The iterator then frees
+the memory that it initially allocated and returns control to the
+driver routine that called it.
 
-6. Avoid using the `implicit datatype conversion' capability in
-CFITSIO.  For instance, when reading a FITS image with BITPIX = -32
-(32-bit floating point pixels), read the data into a single precision
-floating point data array in the program.  Forcing CFITSIO to convert
-the data to a different datatype can slow the program.
+**C.  Guidelines for Using the Iterator Function
 
-7. Where feasible, design FITS binary tables using vector column
-elements so that the data are written as a contiguous set of bytes,
-rather than as single elements in multiple rows.  For example, it is
-faster to access the data in a table that contains a single row
-and 2 columns with TFORM keywords equal to  '10000E' and '10000J', than
-it is to access the same amount of data in a table with 10000 rows
-which has columns with the TFORM keywords equal to '1E' and '1J'.  In
-the former case the 10000 floating point values in the first column are
-all written in a contiguous block of the file which can be read or
-written quickly, whereas in the second case each floating point value
-in the first column is interleaved with the integer value in the second
-column of the same row so CFITSIO has to explicitly move to the
-position of each element to be read or written.
+The totaln, offset, firstn, and nvalues parameters that are passed to
+the work function are useful for determining how much of the data has
+been processed and how much remains left to do.  On the very first call
+to the work function firstn will be equal to offset + 1;  the work
+function may need to perform various initialization tasks before
+starting to  process the data. Similarly, firstn + nvalues - 1 will be
+equal to totaln on the last iteration, at which point the work function
+may need to perform some clean up operations before exiting for the
+last time.  The work function can also force an early termination of
+the iterations by returning a status value = -1.
 
-8. Avoid the use of variable length vector columns in binary tables,
-since any reading or writing of these data requires that CFITSIO first
-look up or compute the starting address of each row of data in the
-heap.
+The narrays and iteratorCol.datatype arguments allow the work function
+to double check that the number of input arrays and their data types
+have the expected values.  The iteratorCol.fptr and iteratorCol.colnum
+structure elements can be used if the work function needs to read or
+write the values of other keywords in the FITS file associated with
+the array.  This should generally only be done during the
+initialization step or during the clean up step after the last set of
+data has been processed.  Extra FITS file I/O during the main
+processing loop of the work function can seriously degrade the speed of
+the program.
 
-9. When copying data from one FITS table to another, it is faster to
-transfer the raw bytes instead of reading then writing each column of
-the table.  The CFITSIO routines fits\_read\_tblbytes and
-fits\_write\_tblbytes will perform low-level reads or writes of any
-contiguous range of bytes in a table extension.  These routines can be
-used to read or write a whole row (or multiple rows  for even greater
-efficiency) of a table with a single function call.   These routines
-are fast because they bypass all the usual data scaling, error checking
-and machine dependent data conversion that is normally done by CFITSIO,
-and they allow the program to write the data to the output file in
-exactly the same byte order.  For these same reasons, these routines
-can corrupt the FITS data file if used incorrectly because no
-validation or machine dependent conversion is performed by these
-routines.  These routines are only recommended for optimizing critical
-pieces of code and should only be used by programmers who thoroughly
-understand the internal format of the FITS tables they are reading or
-writing.
+If variable-length array columns are being processed, then the iterator
+will operate on one row of the table at a time.  In this case the
+the repeat element in the interatorCol structure will be set equal to
+the number of elements in the current row that is being processed.
 
-10. Another strategy for improving the speed of writing a FITS table,
-similar to the previous one, is to directly construct the entire byte
-stream for a whole table row (or multiple rows) within the application
-program and then write it to the FITS file with
-fits\_write\_tblbytes.  This avoids all the overhead normally present
-in the column-oriented CFITSIO write routines.  This technique should
-only be used for critical applications, because it makes the code more
-difficult to understand and maintain, and it makes the code more system
-dependent (e.g., do the bytes need to be swapped before writing to the
-FITS file?).
+One important feature of the iterator is that the first element in each
+array that is passed to the work function gives the value that is used
+to represent null or undefined values in the array.  The real data then
+begins with the second element of the array (i.e., array[1], not
+array[0]).  If the first array element is equal to zero, then this
+indicates that all the array elements have defined values and there are
+no undefined values.  If array[0] is not equal to zero, then this
+indicates that some of the data values are undefined and this value
+(array[0]) is used to represent them.  In the case of output arrays
+(i.e., those arrays that will be written back to the FITS file by the
+iterator function after the work function exits) the work function must
+set the first array element to the desired null value if necessary,
+otherwise the first element should be set to zero to indicate that
+there are no null values in the output array.  CFITSIO defines 2
+values, FLOATNULLVALUE and DOUBLENULLVALUE, that can be used as default
+null values for float and double data types, respectively.  In the case
+of character string data types, a null string is always used to
+represent undefined strings.
 
-11.  Finally, external factors such as the type of magnetic disk
-controller (SCSI or IDE), the size of the disk cache, the average seek
-speed of the disk, the amount of disk fragmentation, and the amount of
-RAM available on the system can all have a significant impact on
-overall I/O efficiency.  For critical applications, a system
-administrator should review the proposed system hardware to identify any
-potential I/O bottlenecks.
+In some applications it may be necessary to recursively call the iterator
+function.  An example of this is given by one of the example programs
+that is distributed with CFITSIO: it first calls a work function that
+writes out a 2D histogram image.  That work function in turn calls
+another work function that reads the  `X' and `Y' columns in a table to
+calculate the value of each 2D histogram image pixel. Graphically, the
+program structure can be described as:
+-
+ driver --> iterator --> work1_fn --> iterator --> work2_fn
+-
 
-
-*VI.  The CFITSIO Iterator Function
+Finally, it should be noted that the table columns or image arrays that
+are passed to the work function do not all have to come from the same
+FITS file and instead may come from any combination of sources as long
+as they have the same length.   The length of the first table column or
+image array is used by the iterator if they do not all have the same
+length.
 
-The fits\_iterate\_data function in CFITSIO provides a unique method of
-executing an arbitrary user-supplied `work' function that operates on
-rows of data in  FITS tables or on pixels in FITS images.  Rather than
-explicitly reading and writing the FITS images or columns of data, one
-instead calls the CFITSIO iterator routine, passing to it the name of
-the user's work function that is to be executed along with a list of
-all the table columns or image arrays that are to be passed to the work
-function.  The CFITSIO iterator function then does all the work of
-allocating memory for the arrays, reading the input data from the FITS
-file, passing them to the work function, and then writing any output
-data back to the FITS file after the work function exits.  Because
-it is often more efficient to process only a subset of the total table
-rows at one time, the iterator function can determine the optimum
-amount of data to pass in each iteration and repeatly call the work
-function until the entire table been processed.
+**D.  Complete List of Iterator Routines
 
-For many applications this single CFITSIO iterator function can
-effectively replace all the other CFITSIO routines for reading or
-writing data in FITS images or tables.  Using the iterator has several
-important advantages over the traditional method of reading and writing
-FITS data files:
+All of the iterator routines are listed below.  Most of these routines
+do not have a corresponding short function name.
 
-\begin{itemize}
-\item
-It cleanly separates the data I/O from the routine that operates on
-the data.  This leads to a more modular and `object oriented'
-programming style.  
+>1   Iterator `constructor' functions that set 
+   the value of elements in the iteratorCol structure 
+   that define the columns or arrays. These set the fitsfile
+    pointer, column name, column number, datatype, and iotype,
+    respectively.  The last 2 routines allow all the parameters
+    to be set with one function call (one supplies the column
+>   name, the other the column number). \label{ffiterset}
 
-\item
-It simplifies the application program by eliminating the need to allocate
-memory for the data arrays and eliminates most of the calls to the CFITSIO
-routines that explicitly read and write the data.
+-
+  int fits_iter_set_file(iteratorCol *col, fitsfile *fptr);
 
-\item
-It ensures that the data are processed as efficiently as possible.
-This is especially important when processing tabular data since
-the iterator function will calculate the most efficient number
-of rows in the table to be passed at one time to the user's work 
-function on each iteration.
+  int fits_iter_set_colname(iteratorCol *col, char *colname);
 
-\item
-Makes it possible for larger projects to develop a library of work
-functions that all have a uniform calling sequence and are all
-independent of the details of the FITS file format.
+  int fits_iter_set_colnum(iteratorCol *col, int colnum);
 
-\end{itemize}
+  int fits_iter_set_datatype(iteratorCol *col, int datatype);
 
-There are basically 2 steps in using the CFITSIO iterator function.
-The first step is to design the work function itself which must have a
-prescribed set of input parameters.  One of these parameters is a
-structure containing pointers to the arrays of data; the work function
-can perform any desired operations on these arrays and does not need to
-worry about how the input data were read from the file or how the
-output data get written back to the file.
+  int fits_iter_set_iotype(iteratorCol *col, int iotype);
 
-The second step is to design the driver routine that opens all the
-necessary FITS files and initializes  the input parameters to the
-iterator function.  The driver program calls the CFITSIO iterator
-function which then reads the data and passes it to the user's work
-function.
-
-The following 2 sections describe these steps in more detail.  There
-are also several example programs included with the CFITSIO
-distribution which illustrate how to use the iterator function.
-
-**A   The Iterator Work Function
-
-The user-supplied iterator work function must have the following set of
-input parameters (the function can be given any desired name):
+  int fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr,
+          char *colname, int datatype,  int iotype);
 
-- 
-  int user_fn( long totaln, long offset, long firstn, long nvalues,
-               int narrays, iteratorCol *data,  void *userPointer )
+  int fits_iter_set_by_num(iteratorCol *col, fitsfile *fptr,
+          int colnum, int datatype,  int iotype);
 -
+>2   Iterator `accessor' functions that return the value of the 
+     element in the iteratorCol structure
+>    that describes a particular data column or array \label{ffiterget}
+-
+  fitsfile * fits_iter_get_file(iteratorCol *col);
 
-\begin{itemize}
-
-\item
-  totaln -- the total number of table rows or image pixels
-            that will be passed to the work function
-            during 1 or more iterations. 
+  char * fits_iter_get_colname(iteratorCol *col);
 
-\item
-  offset     -- the offset applied to the first table row or image
-                pixel to be passed to the work function.  In other
-                words, this is the number of rows or pixels that
-                are skipped over before starting the iterations. If 
-                offset = 0, then all the table rows or image pixels
-                will be passed to the work function.
+  int fits_iter_get_colnum(iteratorCol *col);
 
-\item
-  firstn     -- the number of the first table row or image pixel
-                (starting with 1)  that is being passed in this 
-                particular call to the work function.
+  int fits_iter_get_datatype(iteratorCol *col);
 
-\item
-  nvalues    -- the number of table rows or image pixels that are
-                being passed in this particular call to the work
-                function.  nvalues will always be less than or
-                equal to totaln and will have the same value on
-                each iteration, except possibly on the last 
-                call which may have a smaller value.
+  int fits_iter_get_iotype(iteratorCol *col);
 
-\item
-  narrays     -- the number of arrays of data that are being passed
-                 to the work function.  There is one array for each 
-                 image or table column.      
+  void * fits_iter_get_array(iteratorCol *col);
 
-\item
-  *data   -- array of structures, one for each 
-             column or image.  Each structure contains a pointer
-             to the array of data as well as other descriptive
-             parameters about that array.  
+  long fits_iter_get_tlmin(iteratorCol *col);
 
-\item
-  *userPointer -- a user supplied pointer that can be used
-                 to pass ancillary information from the driver function
-                 to the work function.
-                 This pointer is passed to the CFITSIO iterator function
-                 which then passes it on to the
-                 work function without any modification.
-                 It may point to a single number, to an array of values,
-                 to a structure containing an arbitrary set of parameters
-                 of different types, 
-                 or it may be a null pointer if it is not needed.
-                 The work function must cast this pointer to the
-                 appropriate data type before using it it.
-\end{itemize}
+  long fits_iter_get_tlmax(iteratorCol *col);
 
-The totaln, offset, narrays, data, and userPointer parameters are
-guaranteed to have the same value on each iteration.  Only firstn,
-nvalues, and the arrays of data pointed to by the data structures may
-change on each iterative call to the work function.
+  long fits_iter_get_repeat(iteratorCol *col);
 
-Note that the iterator treats an image as a long 1-D array of pixels
-regardless of it's intrinsic dimensionality.  The total number of
-pixels is just the product of the size of each dimension, and the order
-of the pixels is the same as the order that they are stored in the FITS
-file. If the work function needs to know the number and size of the
-image dimensions then these parameters can be passed via the
-userPointer structure.
+  char * fits_iter_get_tunit(iteratorCol *col);
 
-The iteratorCol structure is currently defined as follows:
+  char * fits_iter_get_tdisp(iteratorCol *col);
+-
+>>3   The CFITSIO iterator function \label{ffiter}
+-
+  int fits_iterate_data(int narrays,  iteratorCol *data, long offset,
+            long nPerLoop,
+            int (*workFn)( long totaln, long offset, long firstn,
+                           long nvalues, int narrays, iteratorCol *data,
+                           void *userPointer),
+            void *userPointer,
+            int *status);
 -
-typedef struct  /* structure for the iterator function column information */
-{  
-   /* structure elements required as input to fits_iterate_data: */
-
-  fitsfile *fptr;       /* pointer to the HDU containing the column or image */
-  int      colnum;      /* column number in the table; ignored for images    */
-  char     colname[70]; /* name (TTYPEn) of the column; null for images      */
-  int      datatype;    /* output datatype (converted if necessary) */
-  int      iotype;      /* type: InputCol, InputOutputCol, or OutputCol */
-
-  /* output structure elements that may be useful for the work function: */
 
-  void     *array;    /* pointer to the array (and the null value) */
-  long     repeat;    /* binary table vector repeat value; set     */
-                      /*     equal to 1 for images                 */
-  long     tlmin;     /* legal minimum data value, if any          */
-  long     tlmax;     /* legal maximum data value, if any          */
-  char     unit[70];  /* physical unit string (BUNIT or TUNITn)    */
-  char     tdisp[70]; /* suggested display format; null if none    */
+*IX.  Celestial Coordinate System Routines
+
+The FITS community has adopted a set of keyword conventions that define
+the transformations needed to convert between pixel locations in an
+image and the corresponding celestial coordinates on the sky, or more
+generally, that define world coordinates that are to be associated with
+any pixel location in an n-dimensional FITS array. CFITSIO is distributed
+with a couple of self-contained World Coordinate System (WCS) routines,
+however, these routines DO NOT support all the latest WCS conventions,
+so it is STRONGLY RECOMMENDED that software developers use a more robust
+external WCS library.  Several recommended libraries are:
+
+-
+  WCSLIB -  supported by Mark Calabretta
+  WCSTools - supported by Doug Mink
+  AST library - developed by the U.K. Starlink project
+-
+
+More information about the WCS keyword conventions and links to all of
+these WCS libraries can be found on the FITS Support Office web site at
+http://fits.gsfc.nasa.gov under the WCS link.
+
+The functions provided in these external WCS libraries will need
+access to the  WCS information contained in the FITS file headers.
+One convenient way to pass this information to the extermal library is
+to use the fits\_hdr2str routine in CFITSIO (defined below) to copy the
+header keywords into one long string, and then pass this string to an
+interface routine in the external library that will extract
+the necessary WCS information (e.g., see the astFitsChan and astPutCards
+routines in the Starlink AST library).
+  
+>1  Concatenate the header keywords in the CHDU into a single long
+    string of characters. Each 80-character fixed-length keyword
+    record is appended to the output character string, in order, with
+    no intervening separator or terminating characters. The last header
+    record is terminated with a NULL character.  This routine allocates
+    memory for the returned character array, so the calling program must
+    free the memory when finished.
+
+    Selected keywords may be excluded from the returned character string.
+    If the second parameter (nocomments) is TRUE (nonzero) then any
+    COMMENT, HISTORY, or blank keywords in the header will not be copied
+    to the output string.
+
+    The 'exclist' parameter may be used to supply a list of keywords
+    that are to be excluded from the output character string. Wild card
+    characters (*, ?, and \#) may be used in the excluded keyword names.
+    If no additional keywords are to be excluded, then set nexc = 0 and
+>   specify NULL for the the **header  parameter.  \label{hdr2str}
+-
+  int fits_hdr2str
+      (fitsfile *fptr, int nocomments, char **exclist, int nexc, 
+      > char **header, int *nkeys, int *status)
+-
+
+**A.   Self-contained WCS Routines
+
+The following routines DO NOT support the more recent WCS conventions
+that have been approved as part of the FITS standard.  Consequently,
+the following routines ARE NOW DEPRECATED.  It is STRONGLY RECOMMENDED
+that software developers not use these routines, and instead use an
+external WCS library, as described in the previous section.
+
+These routines are included mainly for backward compatibility with
+existing software.  They support the following standard map 
+projections: -SIN, -TAN, -ARC, -NCP, -GLS, -MER, and -AIT (these are the
+legal values for the coordtype parameter).  These routines are based
+on similar functions in Classic AIPS.  All the angular quantities are
+given in units of degrees.
+
+>1  Get the values of the basic set of standard FITS celestial coordinate
+    system keywords from the header of a FITS image (i.e., the primary
+    array or an IMAGE extension).  These values may then be passed to
+    the fits\_pix\_to\_world and fits\_world\_to\_pix routines that
+    perform the coordinate transformations.  If any or all of the WCS
+    keywords are not present, then default values will be returned. If
+    the first coordinate axis is the declination-like coordinate, then
+    this routine will swap them so that the longitudinal-like coordinate
+    is returned as the first axis.
 
-} iteratorCol;
+    If the file uses the newer 'CDj\_i' WCS transformation matrix
+    keywords instead of old style 'CDELTn' and 'CROTA2' keywords, then
+    this routine will calculate and return the values of the equivalent
+    old-style keywords.  Note that the conversion from the new-style
+    keywords to the old-style values is sometimes only an
+    approximation, so if the approximation is larger than an internally
+    defined threshold level, then CFITSIO will still return the
+    approximate WCS keyword values, but will also return with status =
+    APPROX\_WCS\_KEY, to warn the calling program that approximations
+    have been made.  It is then up to the calling program to decide
+    whether the approximations are sufficiently accurate for the
+    particular application, or whether more precise WCS transformations
+>   must be performed using new-style WCS keywords directly. \label{ffgics}
+-
+  int fits_read_img_coord / ffgics
+      (fitsfile *fptr, > double *xrefval, double *yrefval, 
+       double *xrefpix, double *yrefpix, double *xinc, double *yinc,
+       double *rot, char *coordtype, int *status)
+-
+>2  Get the values of the standard FITS celestial coordinate system
+    keywords from the header of a FITS table where the X and Y (or RA
+    and DEC) coordinates are stored in 2 separate columns of the table
+    (as in the Event List table format that is often used by high energy
+    astrophysics missions).  These values may then be passed to the
+    fits\_pix\_to\_world and fits\_world\_to\_pix routines that perform
+>   the coordinate transformations. \label{ffgtcs}
+-
+  int fits_read_tbl_coord / ffgtcs
+      (fitsfile *fptr, int xcol, int ycol, > double *xrefval,
+       double *yrefval, double *xrefpix, double *yrefpix, double *xinc,
+       double *yinc, double *rot, char *coordtype, int *status)
+-
+>3   Calculate the celestial coordinate corresponding to the input
+>    X and Y pixel location in the image. \label{ffwldp}
+-
+  int fits_pix_to_world / ffwldp
+      (double xpix, double ypix, double xrefval, double yrefval,
+       double xrefpix, double yrefpix, double xinc, double yinc,
+       double rot, char *coordtype, > double *xpos, double *ypos,
+       int *status)
+-
+>4   Calculate the X and Y pixel location corresponding to the input
+>    celestial coordinate in the image. \label{ffxypx}
+-
+  int fits_world_to_pix / ffxypx
+      (double xpos, double ypos, double xrefval, double yrefval, 
+       double xrefpix, double yrefpix, double xinc, double yinc,
+       double rot, char *coordtype, > double *xpix, double *ypix,
+       int *status)
 -
 
-Instead of directly reading or writing the elements in this structure,
-it is recommended that programmers use the access functions that are
-provided for this purpose.
 
-The first five elements in this structure must be initially defined by
-the driver routine before calling the iterator routine.  The CFITSIO
-iterator routine uses this information to determine what column or
-array to pass to the work function, and whether the array is to be
-input to the work function, output from the work function, or both.
-The CFITSIO iterator function fills in the values of the remaining
-structure elements before passing it to the work function.
+*VIII  Hierarchical Grouping Routines
 
-The array structure element is a pointer to the actual data array and
-it must be cast to the correct data type before it is used.  The
-`repeat' structure element give the number of data values in each row
-of the table, so that the total number of data values in the array is
-given by repeat * nvalues.  In the case of image arrays and ASCII
-tables, repeat will always be equal to 1.  When the datatype is a
-character string, the array pointer is actually a pointer to an array
-of string pointers (i.e., char **array).  The other output structure
-elements are provided for convenience in case that information is
-needed within the work function.  Any other information may be passed
-from the driver routine to the work function via the userPointer
-parameter.
+These functions allow for the creation and manipulation of FITS HDU
+Groups, as defined in "A Hierarchical Grouping Convention for FITS" by
+Jennings, Pence, Folk and Schlesinger ( http:
+//adfwww.gsfc.nasa.gov/other/convert/group.html ). A group is a
+collection of HDUs whose association is defined by a {\it grouping
+table}.  HDUs which are part of a group are referred to as {\it member
+HDUs} or simply as {\it members}. Grouping table member HDUs may
+themselves be grouping tables, thus allowing for the construction of
+open-ended hierarchies of HDUs.
 
-Upon completion, the work routine must return an integer status value,
-with 0 indicating success and any other value indicating an error which
-will cause the iterator function to immediately exit at that point.  Return status
-values in the range 1 -- 1000 should be avoided since these are
-reserved for use by CFITSIO.  A return status value of -1 may be used to
-force the CFITSIO iterator function to stop at that point and return
-control to the driver routine after writing any output arrays to the
-FITS file.  CFITSIO does not considered this to be an error condition,
-so any further processing by the application program will continue normally.
+Grouping tables contain one row for each member HDU. The grouping table
+columns provide identification information that allows applications to
+reference or "point to" the member HDUs. Member HDUs are expected, but
+not required, to contain a set of GRPIDn/GRPLCn keywords in their
+headers for each grouping table that they are referenced by. In this
+sense, the GRPIDn/GRPLCn keywords "link" the member HDU back to its
+Grouping table. Note that a member HDU need not reside in the same FITS
+file as its grouping table, and that a given HDU may be referenced by
+up to 999 grouping tables simultaneously.
 
-**B   The Iterator Driver Function
+Grouping tables are implemented as FITS binary tables with up to six 
+pre-defined column TTYPEn values: 'MEMBER\_XTENSION', 'MEMBER\_NAME', 
+'MEMBER\_VERSION', 'MEMBER\_POSITION', 'MEMBER\_URI\_TYPE' and 'MEMBER\_LOCATION'. 
+The first three columns allow member HDUs to be identified by reference to
+their XTENSION, EXTNAME and EXTVER keyword values. The fourth column allows
+member HDUs to be identified by HDU position within their FITS file.
+The last two columns identify the FITS file in which the member HDU resides,
+if different from the grouping table FITS file.
 
-The iterator driver function must open the necessary FITS files and
-position them to the correct HDU.  It must also initialize the following
-parameters in the iteratorCol structure (defined above) for each
-column or image before calling the CFITSIO iterator function.
-Several `constructor' routines are provided in CFITSIO for this
-purpose.
+Additional user defined "auxiliary" columns may also be included with any 
+grouping table. When a grouping table is copied or modified the presence of 
+auxiliary columns is always taken into account by the grouping support 
+functions; however, the grouping support functions cannot directly
+make use of this data.
 
-\begin{itemize}
-\item 
-  *fptr --  The fitsfile pointer to the table or image.
-\item
-colnum -- the number of the column in the table.  This value is ignored
-          in the case of images.  If colnum equals 0, then the column name
-          will be used to identify the column to be passed to the
-          work function.
+If a grouping table column is defined but the corresponding member HDU 
+information is unavailable then a null value of the appropriate data type
+is inserted in the column field. Integer columns (MEMBER\_POSITION, 
+MEMBER\_VERSION) are defined with a TNULLn value of zero (0). Character field
+columns (MEMBER\_XTENSION, MEMBER\_NAME, MEMBER\_URI\_TYPE, MEMBER\_LOCATION) 
+utilize an ASCII null character to denote a null field value.
 
-\item
-colname -- the name (TTYPEn keyword) of the column.  This is
-           only required if colnum = 0 and is ignored for images.
-\item
-datatype -- The desired datatype of the array to be passed to the
-            work function.  For numerical data the datatype does
-            not need to be the same as the actual datatype in the
-            FITS file, in which case CFITSIO will do the conversion.
-            Allowed values are: TSTRING, TLOGICAL, TBYTE, TSHORT, TUSHORT, 
-            TINT, TLONG, TULONG, TFLOAT, TDOUBLE.  If the input
-            value of datatype equals 0, then the  existing
-            datatype of the column or image will be used without
-            any conversion.
+The grouping support functions belong to two basic categories: those that
+work with grouping table HDUs (ffgt**) and those that work with member HDUs
+(ffgm**). Two functions, fits\_copy\_group() and fits\_remove\_group(), have the
+option to recursively copy/delete entire groups. Care should be taken when
+employing these functions in recursive mode as poorly defined groups could
+cause unpredictable results. The problem of a grouping table directly or 
+indirectly referencing itself (thus creating an infinite loop) is protected 
+against; in fact, neither function will attempt to copy or delete an HDU
+twice.
 
-\item
-iotype -- defines whether the data array is to be input to the
-          work function (i.e, read from the FITS file), or output
-          from the work function (i.e., written to the FITS file) or
-          both.  Allowed values are InputCol, OutputCol, or InputOutputCol.
-\end{itemize}
+**A.  Grouping Table Routines
 
-After the driver routine has initialized all these parameters, it
-can then call the CFITSIO iterator function:
-
--
-  int fits_iterate_data(int narrays, iteratorCol *data, long offset,
-      long nPerLoop, int (*workFn)( ), void *userPointer, int *status);
--
-
-\begin{itemize}
-\item
-
-   narrays    -- the number of columns or images that are to be passed
-                 to the work function.  
-\item
-   *data --     pointer to array of structures containing information 
-                about each column or image.
-
-\item
-   offset      -- if positive, this number of rows at the
-                      beginning of the table (or pixels in the image) 
-                      will be skipped and will not be passed to the work
-                      function.
-
-\item
-   nPerLoop   - specifies the number of table rows (or number of
-                    image pixels) that are to be passed to the work
-                    function on each iteration.  If nPerLoop = 0
-                    then CFITSIO will calculate the optimum number
-                    for greatest efficiency.
-                    If nPerLoop is negative, then all the rows
-                    or pixels will be passed at one time, and the work
-                    function will only be called once.
-
-\item
-   *workFn     - the name (actually the address) of the work function
-                 that is to be called by fits\_iterate\_data.
-
-\item
-   *userPointer - this is a user supplied pointer that can be used
-                  to pass ancillary information from the driver routine
-                  to the work function.  It may point to a single number,
-                  an array, or to a structure containing an arbitrary set
-                  of parameters.
-
-\item
-   *status      - The CFITSIO error status.  Should = 0 on input;
-                  a non-zero output value indicates an error.
-\end{itemize}
-
-When fits\_iterate\_data is called it first allocates memory to hold
-all the requested columns of data or image pixel arrays.  It then reads
-the input data from the FITS tables or images into the arrays then
-passes the structure with pointers to these data arrays to the work
-function.  After the work function returns, the iterator function
-writes any output columns of data or images back to the FITS files.  It
-then repeats this process for any remaining sets of rows or image
-pixels until it has processed the entire table or image or until the
-work function returns a non-zero status value.  The iterator then frees
-the memory that it initially allocated and returns control to the
-driver routine that called it.
-
-**C.  Guidelines for Using the Iterator Function
-
-The totaln, offset, firstn, and nvalues parameters that are passed to
-the work function are useful for determining how much of the data has
-been processed and how much remains left to do.  On the very first call
-to the work function firstn will be equal to offset + 1;  the work
-function may need to perform various initialization tasks before
-starting to  process the data. Similarly, firstn + nvalues - 1 will be
-equal to totaln on the last iteration, at which point the work function
-may need to perform some clean up operations before exiting for the
-last time.  The work function can also force an early termination of
-the iterations by returning a status value = -1.
-
-The narrays and iteratorCol.datatype arguments allow the work function
-to double check that the number of input arrays and their datatypes
-have the expected values.  The iteratorCol.fptr and iteratorCol.colnum
-structure elements can be used if the work function needs to read or
-write the values of other keywords in the FITS file associated with
-the array.  This should generally only be done during the
-initialization step or during the clean up step after the last set of
-data has been processed.  Extra FITS file I/O during the main
-processing loop of the work function can seriously degrade the speed of
-the program.
-
-One important feature of the iterator is that the first element in each
-array that is passed to the work function gives the value that is used
-to represent null or undefined values in the array.  The real data then
-begins with the second element of the array (i.e., array[1], not
-array[0]).  If the first array element is equal to zero, then this
-indicates that all the array elements have defined values and there are
-no undefined values.  If array[0] is not equal to zero, then this
-indicates that some of the data values are undefined and this value
-(array[0]) is used to represent them.  In the case of output arrays
-(i.e., those arrays that will be written back to the FITS file by the
-iterator function after the work function exits) the work function must
-set the first array element to the desired null value if necessary,
-otherwise the first element should be set to zero to indicate that
-there are no null values in the output array.  CFITSIO defines 2
-values, FLOATNULLVALUE and DOUBLENULLVALUE, that can be used as default
-null values for float and double datatypes, respectively.  In the case
-of character string datatypes, a null string is always used to
-represent undefined strings.
-
-In some applications it may be necessary to recursively call the iterator
-function.  An example of this is given by one of the example programs
-that is distributed with CFITSIO: it first calls a work function that
-writes out a 2D histogram image.  That work function in turn calls
-another work function that reads the  `X' and `Y' columns in a table to
-calculate the value of each 2D histogram image pixel. Graphically, the
-program structure can be described as:
+>1 Create (append) a grouping table at the end of the current FITS file 
+   pointed to by fptr. The grpname parameter provides the grouping table
+   name (GRPNAME keyword value) and may be set to NULL if no group name
+   is to be specified. The grouptype parameter specifies the desired 
+   structure of the grouping table and may take on the values: 
+   GT\_ID\_ALL\_URI (all columns created), GT\_ID\_REF (ID by reference columns),
+   GT\_ID\_POS (ID by position columns), GT\_ID\_ALL (ID by reference and 
+   position columns), GT\_ID\_REF\_URI (ID by reference and FITS file URI 
+>  columns), and GT\_ID\_POS\_URI (ID by position and FITS file URI columns). \label{ffgtcr}
 -
- driver --> iterator --> work1_fn --> iterator --> work2_fn
+  int fits_create_group / ffgtcr 
+      (fitsfile *fptr, char *grpname, int grouptype, > int *status)
 -
-
-Finally, it should be noted that the table columns or image arrays that
-are passed to the work function do not all have to come from the same
-FITS file and instead may come from any combination of sources as long
-as they have the same length.   The length of the first table column or
-image array is used by the iterator if they do not all have the same
-length.
-
-
-
-*VII.  Basic CFITSIO Interface Routines
- 
-This chapter describes the basic routines in the CFITSIO user interface
-that provide all the functions normally needed to read and write most
-FITS files.  It is recommended that these routines be used for most
-applications and that the more advanced routines described in the
-next chapter only be used in special circumstances when necessary.
-
-The following conventions are used in this chapter in the description
-of each function:
-
-1. Most functions have 2 names: a long descriptive name and a short
-concise name.  Both names are listed on the first line of the following
-descriptions, separated by a slash (/) character.  Programmers may use
-either name in their programs but the long names are recommended to
-help document the code and make it easier to read.
-
-2. A right arrow symbol ($>$) is used in the function descriptions to
-separate the input parameters from the output parameters in the
-definition of each routine.  This symbol is not actually part of the C
-calling sequence. 
-
-3. The function parameters are defined in more detail in the
-alphabetical listing in Appendix B.
-
-4.  The first argument in almost all the functions is a pointer to a
-structure of type `fitsfile'.  Memory for this structure is allocated
-by CFITSIO when the FITS file is first opened or created and is freed
-when the FITS file is closed.
-
-5.  The last argument in almost all the functions is the error status
-parameter.  It must be equal to 0 on input, otherwise the function will
-immediately exit without doing anything.  A non-zero output value
-indicates that an error occurred in the function.  In most cases the
-status value is also returned as the value of the function itself.
-
-**A.  CFITSIO Error Status Routines
-
->1  Return the revision number of the CFITSIO library.
-    The revision number will be incremented with each new
->   release of CFITSIO. \label{ffvers}
+>2 Create (insert) a grouping table just after the CHDU of the current FITS 
+   file pointed to by fptr. All HDUs below the the insertion point will be
+   shifted downwards to make room for the new HDU. The grpname parameter 
+   provides the grouping table name (GRPNAME keyword value) and may be set to 
+   NULL if no group name is to be specified. The grouptype parameter specifies
+   the desired structure of the grouping table and may take on the values: 
+   GT\_ID\_ALL\_URI (all columns created), GT\_ID\_REF (ID by reference columns),
+   GT\_ID\_POS (ID by position columns), GT\_ID\_ALL (ID by reference and 
+   position columns), GT\_ID\_REF\_URI (ID by reference and FITS file URI 
+>  columns), and GT\_ID\_POS\_URI (ID by position and FITS file URI columns) \label{ffgtis}.
 -
-  float fits_get_version / ffvers ( > float *version)
+  int fits_insert_group / ffgtis 
+      (fitsfile *fptr, char *grpname, int grouptype, > int *status)
 -
->2  Return a descriptive text string (30 char max.) corresponding to 
->   a CFITSIO error status code. \label{ffgerr}
+>3 Change the structure of an existing grouping table pointed to by
+   gfptr. The grouptype parameter (see fits\_create\_group() for valid
+   parameter values) specifies the new structure of the grouping table. This
+   function only adds or removes grouping table columns, it does not add
+   or delete group members (i.e., table rows). If the grouping table already
+   has the desired structure then no operations are performed and function   
+   simply returns with a (0) success status code. If the requested structure
+   change creates new grouping table columns, then the column values for all
+   existing members will be filled with the null values appropriate to the
+>  column type. \label{ffgtch}
 -
-  void fits_get_errstatus / ffgerr (int status, > char *err_text)
+  int fits_change_group / ffgtch 
+      (fitsfile *gfptr, int grouptype, > int *status)
 -
->3  Return the top (oldest) 80-character error message from the
-    internal CFITSIO stack of error messages and shift any remaining
-    messages on the stack up one level.  Call this routine
-    repeatedly to get each message in sequence.  The function returns
-   a value = 0 and a null error message when the error stack is empty.
->\label{ffgmsg}
+>4 Remove the group defined by the grouping table pointed to by gfptr, and 
+   optionally all the group member HDUs. The rmopt parameter specifies the 
+   action to be taken for
+   all members of the group defined by the grouping table. Valid values are:
+   OPT\_RM\_GPT (delete only the grouping table) and OPT\_RM\_ALL (recursively
+   delete all HDUs that belong to the group). Any groups containing the 
+   grouping table gfptr as a member are updated, and if rmopt == OPT\_RM\_GPT 
+   all members have their GRPIDn and GRPLCn  keywords updated accordingly. 
+   If rmopt == OPT\_RM\_ALL, then other groups that contain the deleted members
+>  of gfptr are updated to reflect the deletion accordingly. \label{ffgtrm}
 -
-  int fits_read_errmsg / ffgmsg (char *err_msg)
+  int fits_remove_group / ffgtrm 
+      (fitsfile *gfptr, int rmopt, > int *status)
 -
->4  Print out the error message corresponding to the input status
-    value and all the error messages on the CFITSIO stack to the specified
-    file stream  (normally to stdout or stderr).  If the input
-    status value = 0 then this routine does nothing.
->\label{ffrprt}
+>5 Copy (append) the group defined by the grouping table pointed to by infptr,
+   and optionally all group member HDUs, to the FITS file pointed to by 
+   outfptr. The cpopt parameter specifies the action to be taken for all 
+   members of the group infptr. Valid values are: OPT\_GCP\_GPT (copy only 
+   the grouping table) and OPT\_GCP\_ALL (recursively copy ALL the HDUs that 
+   belong to the group defined by infptr). If the cpopt == OPT\_GCP\_GPT then 
+   the members of infptr have their GRPIDn and GRPLCn keywords updated to 
+   reflect the existence of the new grouping table outfptr, since they now 
+   belong to the new group. If cpopt == OPT\_GCP\_ALL then the new 
+   grouping table outfptr only contains pointers to the copied member HDUs
+   and not the original member HDUs of infptr. Note that, when 
+   cpopt == OPT\_GCP\_ALL, all members of the group defined by infptr will be
+   copied to a single FITS file pointed to by outfptr regardless of their 
+>  file distribution in the original group.  \label{ffgtcp}
 -
-  void fits_report_error / ffrprt (FILE *stream, > status)
+  int fits_copy_group / ffgtcp 
+      (fitsfile *infptr, fitsfile *outfptr, int cpopt, > int *status)
 -
->5  Write an 80-character message to the CFITSIO error stack.  Application
-    programs should not normally write to the stack, but there may be
->   some situations where this is desirable. \label{ffpmsg}
+>6  Merge the two groups defined by the grouping table HDUs infptr and outfptr
+    by combining their members into a single grouping table. All member HDUs
+    (rows) are copied from infptr to outfptr. If mgopt == OPT\_MRG\_COPY then
+    infptr continues to exist unaltered after the merge. If the mgopt ==
+    OPT\_MRG\_MOV then infptr is deleted after the merge. In both cases,
+>   the GRPIDn and GRPLCn keywords of the member HDUs are updated accordingly. \label{ffgtmg}
 -
-  void fits_write_errmsg / ffpmsg (char *err_msg)
+  int fits_merge_groups / ffgtmg 
+      (fitsfile *infptr, fitsfile *outfptr, int mgopt, > int *status)
 -
->6   Clear the entire error message stack.  This routine is useful
-     to clear any error message that may have been generated by
-     a non-fatal CFITSIO error. This routine is called without 
->    any arguments. \label{ffcmsg}
+>7 "Compact" the group defined by grouping table pointed to by gfptr. The 
+   compaction is achieved by merging (via fits\_merge\_groups()) all direct 
+   member HDUs of gfptr that are themselves grouping tables. The cmopt 
+   parameter defines whether the merged grouping table HDUs remain after 
+   merging (cmopt == OPT\_CMT\_MBR) or if they are deleted after merging 
+   (cmopt == OPT\_CMT\_MBR\_DEL). If the grouping table contains no direct
+   member HDUs that are themselves grouping tables then this function 
+   does nothing. Note that this function is not recursive, i.e., only the 
+>  direct member HDUs of gfptr are considered for merging. \label{ffgtcm}
 -
-  void fits_clear_errmsg / ffcmsg (void)
+  int fits_compact_group / ffgtcm 
+      (fitsfile *gfptr, int cmopt, > int *status)
+-
+>8 Verify the integrity of the grouping table pointed to by gfptr to make 
+   sure that all group members are accessible and that all links to other 
+   grouping tables are valid. The firstfailed parameter returns the member 
+   ID (row number) of the first member HDU to fail verification (if positive 
+   value) or the first group link to fail (if negative value). If gfptr is 
+>  successfully verified then firstfailed contains a return value of 0. \label{ffgtvf}
+-
+  int fits_verify_group / ffgtvf 
+      (fitsfile *gfptr, > long *firstfailed, int *status)
+-
+>9  Open a grouping table that contains the member HDU pointed to by mfptr. 
+    The grouping table to open is defined by the grpid parameter, which 
+    contains the keyword index value of the GRPIDn/GRPLCn keyword(s) that 
+    link the member HDU mfptr to the grouping table. If the grouping table 
+    resides in a file other than the member HDUs file then an attempt is 
+    first made to open the file readwrite, and failing that readonly. A 
+    pointer to the opened grouping table HDU is returned in gfptr.
+ 
+    Note that it is possible, although unlikely and undesirable, for the 
+    GRPIDn/GRPLCn keywords in a member HDU header to be non-continuous, e.g., 
+    GRPID1, GRPID2, GRPID5, GRPID6. In such cases, the grpid index value 
+    specified in the function call shall identify the (grpid)th GRPID value. 
+    In the above example, if grpid == 3, then the group specified by GRPID5 
+>   would be opened. \label{ffgtop}
+-
+  int fits_open_group / ffgtop 
+      (fitsfile *mfptr, int group, > fitsfile **gfptr, int *status)
+-
+>10  Add a member HDU to an existing grouping table pointed to by gfptr.
+   The member HDU may either be pointed to mfptr (which must be positioned
+   to the member HDU) or, if mfptr == NULL, identified by the hdupos parameter 
+   (the HDU position number, Primary array == 1) if both the grouping table 
+   and the member HDU reside in the same FITS file. The new member HDU shall 
+   have the appropriate GRPIDn and GRPLCn keywords created in its header.
+   Note that if the member HDU is already a member of the group then it will 
+>  not be added a second time. \label{ffgtam}
+-
+  int fits_add_group_member / ffgtam 
+      (fitsfile *gfptr, fitsfile *mfptr, int hdupos, > int *status)
+-
+
+**B.  Group Member Routines
+
+>1  Return the number of member HDUs in a grouping table gfptr. The number
+    member HDUs is just the NAXIS2 value (number of rows) of the grouping 
+>   table. \label{ffgtnm}
+-
+  int fits_get_num_members / ffgtnm 
+      (fitsfile *gfptr, > long *nmembers, int *status)
+-
+>2   Return the number of groups to which the HDU pointed to by mfptr is 
+     linked, as defined by the number of GRPIDn/GRPLCn keyword records that 
+     appear in its header. Note that each time this function is called, the 
+     indices of the GRPIDn/GRPLCn keywords are checked to make sure they 
+     are continuous (ie no gaps) and are re-enumerated to eliminate gaps if 
+>    found.  \label{ffgmng}
+-
+  int fits_get_num_groups / ffgmng 
+      (fitsfile *mfptr, > long *nmembers, int *status)
+-
+>3  Open a member of the grouping table pointed to by gfptr. The member to 
+    open is identified by its row number within the grouping table as given
+    by the parameter 'member' (first member == 1) . A fitsfile pointer to 
+    the opened member HDU is returned as mfptr. Note that if the member HDU 
+    resides in a FITS file different from the grouping table HDU then the 
+>   member file is first opened readwrite and, failing this, opened readonly. \label{ffgmop}
+-
+  int fits_open_member / ffgmop 
+      (fitsfile *gfptr, long member, > fitsfile **mfptr, int *status)
+-
+>4 Copy (append) a member HDU of the grouping table pointed to by gfptr. 
+   The member HDU is identified by its row number within the grouping table 
+   as given by the parameter 'member' (first member == 1). The copy of the 
+   group member HDU will be appended to the FITS file pointed to by mfptr, 
+   and upon return mfptr shall point to the copied member HDU. The cpopt 
+   parameter may take on the following values: OPT\_MCP\_ADD which adds a new
+   entry in gfptr for the copied member HDU, OPT\_MCP\_NADD which does not add 
+   an entry in gfptr for the copied member, and OPT\_MCP\_REPL which replaces 
+>  the original member entry with the copied member entry. \label{ffgmcp}
+-
+  int fits_copy_member / ffgmcp 
+      (fitsfile *gfptr, fitsfile *mfptr, long member, int cpopt, > int *status)
+-
+>5 Transfer a group member HDU from the grouping table pointed to by
+   infptr to the grouping table pointed to by outfptr. The member HDU to 
+   transfer is identified by its row number within infptr as specified by 
+   the parameter 'member' (first member == 1). If tfopt == OPT\_MCP\_ADD then 
+   the member HDU is made 
+   a member of outfptr and remains a member of infptr. If tfopt == OPT\_MCP\_MOV
+>  then the member HDU is deleted from infptr after the transfer to outfptr. \label{ffgmtf}
+-
+  int fits_transfer_member / ffgmtf 
+      (fitsfile *infptr, fitsfile *outfptr, long member, int tfopt,
+       > int *status)
+-
+>6 Remove a member HDU from the grouping table pointed to by gfptr. The 
+   member HDU to be deleted is identified by its row number in the grouping 
+   table as specified by the parameter 'member' (first member == 1). The rmopt 
+   parameter may take on the following values: OPT\_RM\_ENTRY which 
+   removes the member HDU entry from the grouping table and updates the 
+   member's GRPIDn/GRPLCn keywords, and OPT\_RM\_MBR which removes the member 
+>  HDU entry from the grouping table and deletes the member HDU itself. \label{ffgmrm}
+-
+  int fits_remove_member / ffgmrm
+      (fitsfile *fptr, long member, int rmopt, > int *status)
 -
-
-**B.  FITS File Access Routines
 
-These routines will open or close a new or existing FITS file or return
-information about the opened FITS file.  These routines support the 
-extended file name syntax that is described in a previous chapter.
-See Appendix B for the definition of the parameters used in these routines.
+*IX   Specialized CFITSIO Interface Routines
+
+The basic interface routines described previously are recommended
+for most uses, but the routines described in this chapter
+are also available if necessary.  Some of these routines perform more
+specialized function that cannot easily be done with the basic
+interface routines while others duplicate the functionality of the
+basic routines but have a slightly different calling sequence.
+See Appendix B for the definition of each function parameter.
 
-The same FITS file may be opened more than once simultaneously and the
-resulting pointers to the files may be treated as though they were
-completely independent FITS files.  Thus, one could open a FITS file
-twice, move to different extensions within the file, and then read or
-write data to the 2 extensions in any order.
+**A.  FITS File Access Routines
 
->1  Open an existing FITS file with a specified access mode.
-    The iomode parameter may have a value of READONLY or READWRITE.
->\label{ffopen}
+>1  Open an existing FITS file residing in core computer memory.  This
+routine is analogous to fits\_open\_file.   The 'filename'  is
+currently ignored by this routine and may be any arbitrary string. In
+general, the application must have preallocated an initial block of
+memory to hold the FITS file prior to calling this routine:  'memptr'
+points to the starting address and 'memsize' gives the initial size of
+the block of memory.  'mem\_realloc' is a pointer to an optional
+function that CFITSIO can call to allocate additional memory, if needed
+(only if mode = READWRITE), and is modeled after the standard C
+'realloc' function;  a null pointer may be given if the initial
+allocation of memory is all that will be required (e.g., if the file is
+opened with mode = READONLY).  The 'deltasize' parameter may be used to
+suggest a minimum amount of additional memory that should be allocated
+during each call to the memory reallocation function.  By default,
+CFITSIO will reallocate enough additional space to hold the entire
+currently defined FITS file (as given by the NAXISn keywords) or 1 FITS
+block (= 2880 bytes), which ever is larger.  Values of deltasize less
+than 2880 will be ignored.  Since the memory reallocation operation can
+be computationally expensive, allocating a larger initial block of
+memory, and/or specifying a larger deltasize value may help to reduce
+the number of reallocation calls and make the application program run
+> faster. \label{ffomem}
+-
+  int fits_open_memfile / ffomem
+      (fitsfile **fptr, const char *filename, int mode, void **memptr,
+       size_t *memsize, size_t deltasize,
+       void *(*mem_realloc)(void *p, size_t newsize), int *status)
+-
+>2  Create a new FITS file residing in core computer memory.  This
+routine is analogous to fits\_create\_file.    In general, the
+application must have preallocated an initial block of memory to hold
+the FITS file prior to calling this routine:  'memptr' points to the
+starting address and 'memsize' gives the initial size of the block of
+memory.  'mem\_realloc' is a pointer to an optional function that
+CFITSIO can call to allocate additional memory, if needed, and is
+modeled after the standard C 'realloc' function;  a null pointer may be
+given if the initial allocation of memory is all that will be
+required.  The 'deltasize' parameter may be used to suggest a minimum
+amount of additional memory that should be allocated during each call
+to the memory reallocation function.  By default, CFITSIO will
+reallocate enough additional space to hold 1 FITS block (= 2880 bytes)
+and  values of deltasize less than 2880 will be ignored.  Since the
+memory reallocation operation can be computationally expensive,
+allocating a larger initial block of memory, and/or specifying a larger
+deltasize value may help to reduce the number of reallocation calls
+and make the application program run
+> faster. \label{ffimem}
 -
-  int fits_open_file / ffopen
-      (fitsfile **fptr, char *filename, int iomode, > int *status)
+  int fits_create_memfile / ffimem
+      (fitsfile **fptr, void **memptr,
+       size_t *memsize, size_t deltasize,
+       void *(*mem_realloc)(void *p, size_t newsize), int *status)
 -
->2  Reopen a FITS file that was previously opened with 
+>3  Reopen a FITS file that was previously opened with 
     fits\_open\_file or fits\_create\_file.  The new fitsfile
     pointer may then be treated as a separate file, and one may
     simultaneously read or write to 2 (or more)  different extensions in
@@ -3602,19 +4061,7 @@ write data to the 2 extensions in any order.
   int fits_reopen_file / ffreopen
       (fitsfile *openfptr, fitsfile **newfptr, > int *status)
 -
->3   Create a new empty FITS file.  A template file may also be
-   specified to define the structure of the new file (see secion 4.2.4). 
-   An error will be returned if
-   the specified file already exists unless the filename is
-   prefixed with an exclamation point (!).  In that case CFITSIO
-   will overwrite the existing file. Note  that the exclamation point,
-   '!', is a special UNIX character, so if it is used  on the command
-   line rather than entered at a task prompt, it must be  preceded by a
->  backslash to force the UNIX shell to ignore it. \label{ffinit}
--
-  int fits_create_file / ffinit
-      (fitsfile **fptr, char *filename, > int *status)
--
+
 >4   Create a new FITS file, using a template file to define its
   initial size and structure.  The template may be another FITS HDU
   or an ASCII template file.  If the input template file name pointer
@@ -3627,55 +4074,25 @@ write data to the 2 extensions in any order.
   int fits_create_template / fftplt
       (fitsfile **fptr, char *filename, char *tpltfile > int *status)
 -
->>5  Close a previously opened FITS file. \label{ffclos}
--
-  int fits_close_file / ffclos (fitsfile *fptr, > int *status)
--
->6  Close and DELETE a FITS disk file previously opened with ffopen or ffinit.
-    This routine may be  useful in cases where a FITS file is created but
-    then an error occurs which prevents the file from being completed.
->  \label{ffdelt}
--
-  int fits_delete_file / ffdelt
-      (fitsfile *fptr, > int *status)
--
->>7 Return the name of the opened FITS file. \label{ffflnm}
--
-  int fits_file_name / ffflnm
-      (fitsfile *fptr, > char *filename, int *status)
--
->8 Return the I/O mode of the open FITS file (READONLY or READWRITE).
->\label{ffflmd}
--
-  int fits_file_mode / ffflmd
-      (fitsfile *fptr, > int *iomode, int *status)
--
->9 Return the file type of the opened FITS file (e.g. 'file://', 'ftp://',
-   etc.).
->\label{ffurlt}
--
-  int fits_url_type / ffurlt
-      (fitsfile *fptr, > char *urltype, int *status)
--
->10  Parse the input filename or URL into its component parts: the file
+
+>5  Parse the input filename or URL into its component parts: the file
 type (file://, ftp://, http://, etc), the base input file name, the
 name of the output file that the input file is to be copied to prior
 to opening, the HDU or extension specification, the filtering
 specifier, the binning specifier, and the column specifier.  Null
 strings will be returned for any components that are not present
-in the input file name.
-> \label{ffiurl}
+> in the input file name. \label{ffiurl}
 -
   int fits_parse_input_url / ffiurl
       (char *filename, > char *filetype, char *infile, char *outfile, char
        *extspec, char *filter, char *binspec, char *colspec, int *status)
 -
->11  Parse the input filename and return the HDU number that would be
+>6  Parse the input filename and return the HDU number that would be
 moved to if the file were opened with fits\_open\_file.  The returned
 HDU number begins with 1 for the primary array, so for example, if the
 input filename = `myfile.fits[2]' then hdunum = 3 will be returned.
 CFITSIO does not open the file to check if the extension actually
-exists if an extension number is specified. If an extension *name* is
+exists if an extension number is specified. If an extension name is
 included in the file name specification (e.g.  `myfile.fits[EVENTS]'
 then this routine will have to open the FITS file and look for the
 position of the named extension, then close file again.  This is not
@@ -3694,799 +4111,1042 @@ call to fits\_open\_file.
    int fits_parse_extnum / ffextn 
        (char *filename, > int *hdunum, int *status)
 -
->12 Parse the input file name and return the root file name.  The root
+>7 Parse the input file name and return the root file name.  The root
 name includes the file type if specified, (e.g.  'ftp://' or 'http://')
 and the full path name, to the extent that it is specified in the input
-filename.  It does not enclude the HDU name or number, or any filtering
+filename.  It does not include the HDU name or number, or any filtering
 specifications.
 > \label{ffrtnm}
 -
    int fits_parse_rootname / ffrtnm
        (char *filename, > char *rootname, int *status);
 -
+>8 Test if the input file or a compressed version of the file (with
+a .gz, .Z, .z, or .zip extension) exists on disk.  The returned value of 
+the 'exists' parameter will have 1 of the 4 following values:
+-
+   2:  the file does not exist, but a compressed version does exist
+   1:  the disk file does exist
+   0:  neither the file nor a compressed version of the file exist
+  -1:  the input file name is not a disk file (could be a ftp, http,
+       smem, or mem file, or a file piped in on the STDIN stream)
+-
+
+> \label{ffexist}
+-
+   int fits_file_exists / ffexist
+       (char *filename, > int *exists, int *status);
+-
+>9 Flush any internal buffers of data to the output FITS file. These 
+   routines rarely need to be called, but can be useful in cases where
+   other processes need to access the same FITS file in real time,
+   either on disk or in memory.  These routines also help to ensure
+   that if the application program subsequently aborts then the FITS
+   file will have been closed properly.  The first routine,
+   fits\_flush\_file is more rigorous and completely closes, then
+   reopens, the current HDU, before flushing the internal buffers, thus
+   ensuring that the output FITS file is identical to what would be
+   produced if the FITS was closed at that point (i.e., with a call to
+   fits\_close\_file).  The second routine, fits\_flush\_buffer simply
+   flushes the internal CFITSIO buffers of data to the output FITS
+   file, without updating and closing the current HDU.  This is much
+   faster, but there may be circumstances where the flushed file does
+   not completely reflect the final state of the file as it will exist
+   when the file is actually closed.
+
+   A typical use of these routines would be to flush the state of a
+   FITS table to disk after each row of the table is written.  It is
+   recommend that fits\_flush\_file be called after the first row is
+   written, then fits\_flush\_buffer may be called after each
+   subsequent row is written.  Note that this latter routine will not
+   automatically update the NAXIS2 keyword which records the number of
+   rows of data in the table, so this keyword must be explicitly
+   updated by the application program after each row is written.
+>  \label{ffflus}
+-
+  int fits_flush_file / ffflus
+      (fitsfile *fptr, > int *status)
 
-
-**C.  HDU Access Routines\label{FFMAHD}
-
-The following functions perform operations on Header-Data Units (HDUs)
-as a whole.  See Appendix B for the definition of the parameters used in
-these routines.
+  int fits_flush_buffer / ffflsh
+      (fitsfile *fptr, 0, > int *status)
 
->1  Move to a specified absolute HDU number in the FITS file.  A
-    null pointer may be given for the hdutype parameter if it's value is
->   not needed. \label{ffmahd}
+      (Note:  The second argument must be 0).
 -
-  int fits_movabs_hdu / ffmahd
-      (fitsfile *fptr, int hdunum, > int *hdutype, int *status)
+
+**B.  HDU Access Routines
+
+>1  Get the byte offsets in the FITS file to the start of the header 
+    and the start and end of the data in the CHDU. The difference
+    between headstart and dataend equals the size of the CHDU.  If the
+    CHDU is the last HDU in the file, then dataend is also equal to the
+    size of the entire FITS file.  Null pointers may be input for any
+    of the address parameters if their values are not needed.  The
+    fits\_get\_hduaddr routine is obsolete and should no longer be
+    used.  The newer fits\_get\_hduoff routine uses the 'off\_t'
+    data type which can support offsets in large files greater than 
+>   2.1GB in size. \label{ffghad}
 -
->2  Move a relative number of HDUs forward or backwards in the FITS file
-    from the current position. A null pointer may be given for the hdutype
->   parameter if it's value is not needed.   \label{ffmrhd}
+  int fits_get_hduoff / ffghof
+       (fitsfile *fptr, > off_t *headstart, off_t *datastart, off_t *dataend,
+        int *status)
+
+  int fits_get_hduaddr / ffghad  (OBSOLETE routine)
+       (fitsfile *fptr, > long *headstart, long *datastart, long *dataend,
+        int *status)
 -
-  int fits_movrel_hdu / ffmrhd
-      (fitsfile *fptr, int nmove, > int *hdutype, int *status)
+>2  Create (append) a new empty HDU at the end of the FITS file.
+    This is now  the CHDU but it is completely empty and has
+    no header keywords.  It is recommended that fits\_create\_img or 
+> fits\_create\_tbl be used instead of this routine. \label{ffcrhd}
 -
->3  Move to the (first) HDU which has the specified extension type and
-    EXTNAME (or HDUNAME) and EXTVER keyword values.  The hdutype parameter
-    may have
-    a value of IMAGE\_HDU, ASCII\_TBL, BINARY\_TBL, or ANY\_HDU where
-    ANY\_HDU means that only the extname and extver values will be
-    used to locate the correct extension.  If the input value of
-    extver is 0 then the EXTVER keyword is ignored and the first HDU
-    with a matching EXTNAME (or HDUNAME) keyword will be found.  If no
-    matching HDU is found in the file then the current HDU will remain
-    unchanged
->   and a status = BAD\_HDU\_NUM will be returned. \label{ffmnhd}
+  int fits_create_hdu / ffcrhd
+      (fitsfile *fptr, > int *status)
 -
-  int fits_movnam_hdu / ffmnhd
-      (fitsfile *fptr, int hdutype, char *extname, int extver, > int *status)
+>3  Insert a new IMAGE extension immediately following the CHDU, or
+    insert a new Primary Array at the beginning of the file.  Any
+    following extensions in the file will be shifted down to make room
+    for the new extension.  If the CHDU is the last HDU in the file
+    then the new image extension will simply be appended to the end of
+    the file.   One can force a new primary array to be inserted at the
+    beginning of the FITS file by setting status = PREPEND\_PRIMARY prior
+    to calling the routine.  In this case the old primary array will be
+    converted to an IMAGE extension. The new extension (or primary
+    array) will become the CHDU.  Refer to Chapter 9 for a list of
+>   pre-defined bitpix values.  \label{ffiimg}
 -
->4  Return the number of the current HDU in the FITS file (primary array = 1).
->   This function returns the HDU number rather than a status value.  \label{ffghdn}
+  int fits_insert_img / ffiimg
+      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
 -
-  int fits_get_hdu_num / ffghdn
-      (fitsfile *fptr, > int *hdunum)
+>4  Insert a new ASCII or binary table extension immediately following the CHDU.
+    Any following extensions will be shifted down to make room for the
+    new extension.  If there are no other following extensions then the
+    new table extension will simply be appended to the end of the
+    file.   If the FITS file is currently empty then this routine will
+    create a dummy primary array before appending the table to it. The
+    new extension will become the CHDU.  The tunit and extname
+    parameters are optional and a null pointer may be given if they are
+    not defined.  When inserting an ASCII table with
+    fits\_insert\_atbl, a null pointer  may given for the *tbcol
+    parameter in which case each column of the table will be separated
+    by a single space character. Similarly, if the input value of
+    rowlen is  0, then CFITSIO will calculate the default rowlength
+    based on the tbcol and ttype values.  When inserting a binary table
+    with fits\_insert\_btbl, if there are following extensions in the
+    file and if the table contains variable length array columns then
+    pcount must specify the expected final size of the data heap,
+>   otherwise pcount must = 0. \label{ffitab} \label{ffibin}
 -
->5  Return the type of the current HDU in the FITS file.  The possible
->   values for hdutype are: IMAGE\_HDU, ASCII\_TBL, or BINARY\_TBL.  \label{ffghdt}
+  int fits_insert_atbl / ffitab
+      (fitsfile *fptr, long rowlen, long nrows, int tfields, char *ttype[],
+       long *tbcol, char *tform[], char *tunit[], char *extname, > int *status)
+
+  int fits_insert_btbl / ffibin
+      (fitsfile *fptr, long nrows, int tfields, char **ttype,
+      char **tform, char **tunit, char *extname, long pcount, > int *status)
 -
-  int fits_get_hdu_type / ffghdt
-      (fitsfile *fptr, > int *hdutype, int *status)
+>5  Modify the size, dimensions, and/or data type of the current
+    primary array or image extension. If the new image, as specified
+    by the input arguments, is larger than the current existing image
+    in the FITS file then zero fill data will be inserted at the end
+    of the current image and any following extensions will be moved 
+    further back in the file.  Similarly, if the new image is
+    smaller than the current image then any following extensions
+    will be shifted up towards the beginning of the FITS file
+    and the image data will be truncated to the new size.
+    This routine rewrites the BITPIX, NAXIS, and NAXISn keywords
+>   with the appropriate values for the new image. \label{ffrsim}
 -
->6  Return the total number of HDUs in the FITS file.
->   The CHDU remains unchanged. \label{ffthdu}
+  int fits_resize_img / ffrsim
+      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
 -
-  int fits_get_num_hdus / ffthdu
-      (fitsfile *fptr, > int *hdunum, int *status)
+>6  Copy the data (and not the header) from the CHDU associated with infptr
+    to the CHDU associated with outfptr. This will overwrite any data
+    previously in the output CHDU.  This low level routine is used by 
+    fits\_copy\_hdu, but it may also be useful in certain application programs
+    that want to copy the data from one FITS file to another but also
+    want to modify the header keywords. The required FITS header keywords 
+    which define the structure of the HDU must be written to the 
+>   output CHDU before calling this routine. \label{ffcpdt}
 -
->7 Create a new primary array or IMAGE extension. 
-   If the FITS file is currently empty then a primary array
-   is created, otherwise a new IMAGE extension is appended to the file.
->\label{ffcrim}
+  int fits_copy_data / ffcpdt
+      (fitsfile *infptr, fitsfile *outfptr, > int *status)
 -
-  int fits_create_img / ffcrim
-      ( fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
+>7  This routine forces CFITSIO to rescan the current header keywords that
+    define the structure of the HDU (such as the NAXIS and BITPIX
+    keywords) so that it reinitializes the internal buffers that
+    describe the HDU structure.  This routine is useful for
+    reinitializing the structure of an HDU if any of the required
+    keywords (e.g., NAXISn) have been modified.  In practice it should
+    rarely be necessary to call this routine because CFITSIO
+>   internally calls it in most situations. \label{ffrdef}
 -
->8 Create a new ASCII or bintable table extension. If
-   the FITS file is currently empty then a dummy primary array will be
-   created before appending the table extension to it. 
-   The tbltype parameter defines the type of table and can have 
-   values of ASCII\_TBL or BINARY\_TBL.  The naxis2 parameter gives the
-   initial number of rows to be created in the table, and should normally 
-   be set = 0.  CFITSIO 
-   will automatically increase the size of the table as 
-   additional rows are written.  A non-zero number of rows may be specified
-   to reserve space for that many rows, even if a fewer number of rows will
-   be written.  The tunit and extname parameters
-   are optional and a null pointer may be given if they are not defined.
-   The FITS Standard recommends that only letters, digits, and the
-   underscore character be used in column names (the ttype parameter) with no
-   embedded spaces).  Trailing blank characters are not significant.  It is
-   recommended that all the column names in a given table be unique within
-   the first 8 characters, and strongly recommended that the names be
->  unique within the first 16 characters. \label{ffcrtb}
--
-  int fits_create_tbl / ffcrtb
-      (fitsfile *fptr, int tbltype, long naxis2, int tfields, char *ttype[],
-       char *tform[], char *tunit[], char *extname, int *status)
+  int fits_set_hdustruc / ffrdef
+      (fitsfile *fptr, > int *status)   (DEPRECATED)
 -
->9  Copy the CHDU from the FITS file associated with infptr and append it
-    to the end of the FITS file associated with outfptr.  Space may be 
->   reserved for MOREKEYS additional keywords in the output header. \label{ffcopy}
+**C.  Specialized Header Keyword Routines
+
+***1.  Header Information Routines
+
+>1  Reserve space in the CHU for MOREKEYS more header keywords.
+    This routine may be called to allocate space for additional keywords
+    at the time the header is created (prior to writing any data).
+    CFITSIO can dynamically add more space to the header when needed,
+    however it is more efficient to preallocate the required space
+>   if the size is known in advance. \label{ffhdef}
 -
-  int fits_copy_hdu / ffcopy
-      (fitsfile *infptr, fitsfile *outfptr, int morekeys, > int *status)
+  int fits_set_hdrsize / ffhdef
+      (fitsfile *fptr, int morekeys, > int *status)
 -
->10 Delete the CHDU in the FITS file.  Any following HDUs will be shifted
-    forward in the file, to fill in the gap created by the deleted
-    HDU.  In the case of deleting the primary array (the first HDU in
-    the file) then the current primary array will be replace by a null
-    primary array containing the minimum set of required keywords and
-    no data.  If there are more extensions in the file following the
-    one that is deleted, then the the CHDU will be redefined to point
-    to the following extension.  If there are no following extensions
-    then the CHDU will be redefined to point to the previous HDU.  The
-    output hdutype parameter returns the type of the new CHDU.  A null
-    pointer may be given for
->   hdutype if the returned value is not needed. \label{ffdhdu}
+>2  Return the number of keywords in the header (not counting the END
+    keyword) and the current position
+    in the header.  The position is the number of the keyword record that
+    will be read next (or one greater than the position of the last keyword
+    that was read). A value of 1 is returned if the pointer is
+>   positioned at the beginning of the header. \label{ffghps}
 -
-  int fits_delete_hdu / ffdhdu
-      (fitsfile *fptr, > int *hdutype, int *status)
+  int fits_get_hdrpos / ffghps
+      (fitsfile *fptr, > int *keysexist, int *keynum, int *status)
 -
-
-
-**D.  Header Keyword Read/Write Routines
 
-These routines read or write keywords in the Current Header Unit
-(CHU).  Wild card characters (*, ?, or \#) may be used when specifying
-the name of the keyword to be read: a '?' will match any single
-character at that position in the keyword name and a '*' will match any
-length (including zero) string of characters.  The '\#' character will
-match any consecutive string of decimal digits (0 - 9).  When a wild
-card is used the routine will only search for a match from the current
-header position to the end of the header and will not resume the search
-from the top of the header back to the original header position as is
-done when no wildcards are included in the keyword name.  The
-fits\_read\_record routine may be used to set the starting position
-when doing wild card searchs.  A status value of KEY\_NO\_EXIST is
-returned if the specified keyword to be read is not found in the
-header.  See Appendix B for the definition of the parameters used in
-these routines.
+***2.  Read and Write the Required Keywords
 
+>1  Write the primary header or IMAGE extension keywords into the CHU.
+  The simpler fits\_write\_imghdr routine is equivalent to calling
+  fits\_write\_grphdr with the default values of simple = TRUE, pcount
+  = 0, gcount = 1, and extend = TRUE.  The PCOUNT, GCOUNT and EXTEND
+  keywords are not required in the primary header and are only written
+  if pcount is not equal to zero, gcount is not equal to zero or one,
+  and if extend is TRUE, respectively.  When writing to an IMAGE
+  extension, the SIMPLE and EXTEND parameters are ignored.  It is
+  recommended that fits\_create\_image or fits\_create\_tbl be used
+  instead of these routines to write the
+> required header keywords. \label{ffphpr} \label{ffphps}
+-
+  int fits_write_imghdr / ffphps
+      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
 
->1  Return the number of existing keywords (not counting the
-    END keyword) and the amount of space currently available
-    for more keywords.
-    It returns morekeys = -1 if the header has not yet been closed.
-    Note that CFITSIO will dynamically add space if required when
-    writing new keywords to a header so in practice there is no
-    limit to the number of keywords that can be added to a header.
-    A null pointer may be entered for the morekeys parameter if it's 
->   value is not needed. \label{ffghsp}
+  int fits_write_grphdr / ffphpr
+      (fitsfile *fptr, int simple, int bitpix, int naxis, long *naxes,
+       long pcount, long gcount, int extend, > int *status)
 -
-  int fits_get_hdrspace / ffghsp
-      (fitsfile *fptr, > int *keysexist, int *morekeys, int *status)
+>2  Write the ASCII table header keywords into the CHU.  The optional
+    TUNITn and EXTNAME keywords are written only if the input pointers
+    are not null.  A null pointer may given for the
+    *tbcol parameter in which case a single space will be inserted
+    between each column of the table.  Similarly, if rowlen is
+    given = 0, then CFITSIO will calculate the default rowlength based on
+>   the tbcol and ttype values. \label{ffphtb}
 -
->2  Write (append) a new keyword of the appropriate datatype into the
-    CHU.  Note that the address to the value, and not the value itself, must
-    be entered.    The datatype parameter specifies the datatype of the
-    keyword value with one of the following values:  TSTRING, TLOGICAL (== int),
-    TBYTE, TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG, TFLOAT, TDOUBLE. 
-    Within the context of this routine, TSTRING corresponds to a 'char*'
-    datatype, i.e., a pointer to a character array.  A null
-    pointer may be entered for the comment parameter which will cause the
->   comment field to be left blank.  \label{ffpky}
+  int fits_write_atblhdr / ffphtb
+      (fitsfile *fptr, long rowlen, long nrows, int tfields, char **ttype,
+       long *tbcol, char **tform, char **tunit, char *extname, > int *status)
 -
-  int fits_write_key / ffpky
-      (fitsfile *fptr, int datatype, char *keyname, DTYPE *value,
-          char *comment, > int *status)
+>3  Write the binary table header keywords into the CHU.   The optional
+   TUNITn and EXTNAME keywords are written only if the input pointers
+   are not null.  The pcount parameter, which specifies the
+   size of the variable length array heap, should initially = 0;
+   CFITSIO will automatically update the PCOUNT keyword value if any
+   variable length array data is written to the heap.  The TFORM keyword
+   value for variable length vector columns should have the form 'Pt(len)'
+   or '1Pt(len)' where `t' is the data type code letter (A,I,J,E,D, etc.)
+   and  `len' is an integer specifying the maximum length of the vectors
+   in that column (len must be greater than or equal to the longest
+   vector in the column).  If `len' is not specified when the table is
+   created (e.g., the input TFORMn value is just '1Pt') then CFITSIO will
+   scan the column when the table is first closed and will append the
+   maximum length to the TFORM keyword value.  Note that if the table
+   is subsequently modified to increase the maximum length of the vectors
+   then the modifying program is responsible for also updating the TFORM 
+>  keyword value.  \label{ffphbn}
 -
->3  Write (update) a keyword of the appropriate datatype into the CHU.
-    This routine will modify the value and comment field if the keyword
-    already exists in the header, otherwise it will append a new
-    keyword at the end of the header. Note that the address to the
-    value, and not the value itself, must be entered. The datatype
-    parameter specifies the datatype of the keyword value and can have
-    one of the following values:  TSTRING, TLOGICAL (== int), TBYTE,
-    TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG, TFLOAT, TDOUBLE,
-    TCOMPLEX, and TDBLCOMPLEX. Within the context of this routine,
-    TSTRING corresponds to a 'char*' datatype, i.e., a pointer to a
-    character array. A null pointer may be entered for the comment
-    parameter which will leave the comment field blank (or
-    unmodified).
-> \label{ffuky}
+  int fits_write_btblhdr / ffphbn
+      (fitsfile *fptr, long nrows, int tfields, char **ttype,
+       char **tform, char **tunit, char *extname, long pcount, > int *status)
 -
-  int fits_update_key / ffuky
-      (fitsfile *fptr, int datatype, char *keyname, DTYPE *value,
-          char *comment, > int *status)
+>4  Read the required keywords from the CHDU (image or table).  When
+    reading from an IMAGE extension the SIMPLE and EXTEND parameters are
+    ignored.  A null pointer may be supplied for any of the returned
+>   parameters that are not needed. \label{ffghpr} \label{ffghtb} \label{ffghbn}
 -
->4  Write a keyword with a null or undefined value (i.e., the value
-    field in the keyword is left blank).
-    This routine will modify the value and comment field if the
-    keyword already exists in the header, otherwise it will append
-    a new null-valued keyword at the end of the header. 
-    A null pointer may be entered for the comment parameter which will leave
->   the comment field blank (or unmodified). \label{ffukyu}
+  int fits_read_imghdr / ffghpr
+      (fitsfile *fptr, int maxdim, > int *simple, int *bitpix, int *naxis,
+       long *naxes, long *pcount, long *gcount, int *extend, int *status)
+
+  int fits_read_atblhdr / ffghtb
+      (fitsfile *fptr,int maxdim, > long *rowlen, long *nrows,
+       int *tfields, char **ttype, long *tbcol, char **tform, char **tunit,
+       char *extname,  int *status)
+
+  int fits_read_btblhdr / ffghbn
+      (fitsfile *fptr, int maxdim, > long *nrows, int *tfields,
+       char **ttype, char **tform, char **tunit, char *extname,
+       long *pcount, int *status)
 -
-  int fits_update_key_null / ffukyu
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+***3.  Write Keyword Routines
+
+These routines simply append a new keyword to the header and do not
+check to see if a keyword with the same name already exists.  In
+general it is preferable to use the fits\_update\_key routine to ensure
+that the same keyword is not written more than once to the header.  See
+Appendix B for the definition of the parameters used in these
+routines.
+
+
+>1   Write (append) a new keyword of the appropriate data type into the CHU.
+     A null pointer may be entered for the comment parameter, which
+     will cause the comment field of the keyword to be left blank.  The
+     flt, dbl, cmp, and dblcmp versions of this routine have the added
+     feature that if the 'decimals' parameter is negative, then the 'G'
+     display format rather then the 'E' format will be used when
+     constructing the keyword value, taking the absolute value of
+     'decimals' for the precision.  This will suppress trailing zeros,
+     and will use a fixed format rather than an exponential format,
+>    depending on the magnitude of the value. \label{ffpkyx}
 -
->5  Write (append) a COMMENT keyword to the CHU.  The comment string will
-    be split over multiple COMMENT keywords if it is longer than 70 characters.
-> \label{ffpcom}
+  int fits_write_key_str / ffpkys
+      (fitsfile *fptr, char *keyname, char *value, char *comment,
+       > int *status)
+ 
+  int fits_write_key_[log, lng] /  ffpky[lj]
+      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
+       > int *status)
+ 
+  int fits_write_key_[flt, dbl, fixflg, fixdbl] / ffpky[edfg] 
+      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
+      char *comment, > int *status)
+
+  int fits_write_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffpk[yc,ym,fc,fm]
+      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
+      char *comment, > int *status)
 -
-  int fits_write_comment / ffpcom
-      (fitsfile *fptr, char *comment, > int *status)
+>2  Write (append) a string valued keyword into the CHU which may be longer
+    than 68 characters in length.  This uses the Long String Keyword
+    convention that is described in the`Local FITS Conventions' section
+    in Chapter 4.  Since this uses a non-standard FITS convention to
+    encode the long keyword string, programs which use this routine
+    should also call the fits\_write\_key\_longwarn routine to add some
+    COMMENT keywords to warn users of the FITS file that this
+    convention is being used.  The fits\_write\_key\_longwarn routine
+    also writes a keyword called LONGSTRN to record the version of the
+    longstring convention that has been used, in case a new convention
+    is adopted at some point in the future.   If the LONGSTRN keyword
+    is already present in the header, then fits\_write\_key\_longwarn
+    will
+>   simply return without doing anything. \label{ffpkls} \label{ffplsw}
 -
->6 Write (append) a HISTORY keyword to the CHU.  The comment string will
-   be split over multiple HISTORY keywords if it is longer than 70 characters.
-> \label{ffphis}
+  int fits_write_key_longstr / ffpkls
+      (fitsfile *fptr, char *keyname, char *longstr, char *comment,
+       > int *status)
+ 
+  int fits_write_key_longwarn / ffplsw
+      (fitsfile *fptr, > int *status)
 -
-  int fits_write_history / ffphis
-      (fitsfile *fptr, char *history, > int *status)
+>3  Write (append) a numbered sequence of keywords into the CHU.  The
+    starting index number (nstart) must be greater than 0. One may
+    append the same comment to every keyword (and eliminate the need
+    to have an array of identical comment strings, one for each keyword) by
+    including the ampersand character as the last non-blank character in the
+    (first) COMMENTS string parameter.  This same string
+    will then be used for the comment field in all the keywords.
+    One may also enter a null pointer for the comment parameter to
+>   leave the comment field of the keyword blank. \label{ffpknx}
 -
->7  Write the DATE keyword to the CHU. The keyword value will contain
-    the current system date as a character string in 'yyyy-mm-ddThh:mm:ss' 
-    format. If a DATE keyword already exists in the header, then this
-    routine will simply update the keyword value with the current date.
->   \label{ffpdat}
+  int fits_write_keys_str / ffpkns
+      (fitsfile *fptr, char *keyroot, int nstart, int nkeys,
+       char **value, char **comment, > int *status)
+ 
+  int fits_write_keys_[log, lng] / ffpkn[lj]
+      (fitsfile *fptr, char *keyroot, int nstart, int nkeys,
+       DTYPE *numval, char **comment, int *status)
+ 
+  int fits_write_keys_[flt, dbl, fixflg, fixdbl] / ffpkne[edfg]
+      (fitsfile *fptr, char *keyroot, int nstart, int nkey,
+       DTYPE *numval, int decimals, char **comment, > int *status)
 -
-  int fits_write_date / ffpdat
-      (fitsfile *fptr, > int *status)
+>4 Copy an indexed keyword from one HDU to another, modifying
+    the index number of the keyword name in the process.  For example,
+    this routine could read the TLMIN3 keyword from the input HDU
+    (by giving keyroot = `TLMIN' and innum = 3) and write it to the
+    output HDU with the keyword name TLMIN4 (by setting outnum = 4).
+    If the input keyword does not exist, then this routine simply
+>   returns without indicating an error. \label{ffcpky}
 -
->8 Write a user specified keyword record into the CHU.  This is
-   a low--level routine which can be used to write any arbitrary
-   record into the header.  The record must conform to the all
->  the FITS format requirements. \label{ffprec}
+  int fits_copy_key / ffcpky
+      (fitsfile *infptr, fitsfile *outfptr, int innum, int outnum,
+       char *keyroot, > int *status)
 -
-  int fits_write_record / ffprec
-      (fitsfile *fptr, char *card, > int *status)
+>5 Write (append) a `triple precision' keyword into the CHU in F28.16 format.
+    The floating point keyword value is constructed by concatenating the
+    input integer value with the input double precision fraction value
+    (which must have a value between 0.0 and 1.0). The ffgkyt routine should
+    be used to read this keyword value, because the other keyword reading
+>   routines will not preserve the full precision of the value. \label{ffpkyt}
 -
->9 Update an 80-character record in the CHU.  If a keyword with the input
-   name already exists, then it is overwritten by the value of card.  This
-   could modify the keyword name as well as the value and comment fields.
-   If the keyword doesn't already exist then a new keyword card is appended
->   to the header. \label{ffucrd}
+  int fits_write_key_triple / ffpkyt
+      (fitsfile *fptr, char *keyname, long intval, double frac,
+       char *comment, > int *status)
 -
-  int fits_update_card / ffucrd
-      (fitsfile *fptr, char *keyname, char *card, > int *status)
+>6 Write keywords to the CHDU that are defined in an ASCII template file.
+   The format of the template file is described under the fits\_parse\_template
+>  routine. \label{ffpktp}
 -
->10  Write the physical units string into an existing keyword.  This
-    routine uses a local convention, shown in the following example,
-    in which the keyword units are enclosed in square brackets in the
->   beginning of the keyword comment field.  \label{ffpunt}
+  int fits_write_key_template / ffpktp
+      (fitsfile *fptr, const char *filename, > int *status)
 -
-  VELOCITY=                 12.3 / [km/s] orbital speed
+***4.  Insert Keyword Routines
 
-  int fits_write_key_unit / ffpunt
-      (fitsfile *fptr, char *keyname, char *unit, > int *status)
+These insert routines are somewhat less efficient than the `update' or
+`write' keyword routines  because the following keywords in the header
+must be shifted down to make room for the inserted keyword.  See
+Appendix B for the definition of the parameters used in these
+routines.
+
+>1  Insert a new keyword record into the CHU at the specified position
+    (i.e., immediately preceding the (keynum)th keyword in the header.)
+>  \label{ffirec}
 -
->11  Rename an existing keyword preserving the current value
->   and comment fields. \label{ffmnam}
+  int fits_insert_record / ffirec
+      (fitsfile *fptr, int keynum, char *card, > int *status)
 -
-  int fits_modify_name / ffmnam
-      (fitsfile *fptr, char *oldname, char *newname, > int *status)
--
->>12  Modify (overwrite) the comment field of an existing keyword. \label{ffmcom}
--
-  int fits_modify_comment / ffmcom
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
--
->13 Read the nth header record in the CHU.  The first keyword
-   in the header is at keynum = 1;  if keynum = 0 then this routine
-   simply moves the internal CFITSIO pointer to the beginning of the header
-   so that subsequent keyword operations will start at the top of 
-   the header (e.g., prior to searching for keywords using wild
->  cards in the keyword name). \label{ffgrec}
--
-  int fits_read_record / ffgrec
-      (fitsfile *fptr, int keynum, > char *card, int *status)
--
->>14  Read the header record having the specified keyword name. \label{ffgcrd}
--
-  int fits_read_card / ffgcrd
-      (fitsfile *fptr, char *keyname, > char *card, int *status)
--
->15 Read a specified keyword value and comment.
-    The datatype parameter specifies the returned datatype of the
-    keyword value and can have one of the following symbolic constant
-    values:  TSTRING, TLOGICAL (== int), TBYTE, TSHORT, TUSHORT, TINT,
-    TUINT, TLONG, TULONG, TFLOAT, TDOUBLE, TCOMPLEX, and TDBLCOMPLEX.
-    Within the context of this routine, TSTRING corresponds to a
-    'char*' datatype, i.e., a pointer to a character array.  Data type
-    conversion will be performed for numeric values if the keyword
-    value does not have the same datatype.  If the value of the keyword
-    is undefined (i.e., the value field is blank) then an error status
-    = VALUE\_UNDEFINED will be returned. If a NULL comment pointer is
-    given on input
->   then the comment string   will not be returned.   \label{ffgky}
--
-  int fits_read_key / ffgky
-      (fitsfile *fptr, int datatype, char *keyname, > DTYPE *value,
-       char *comment, int *status)
--
->16 Read the physical units string in an existing keyword.  This
-    routine uses a local convention, shown in the following example,
-    in which the keyword units are enclosed in square brackets in the
-    beginning of the keyword comment field.  A null string is returned
->   if no units are defined for the keyword.  \label{ffgunt}
+>2  Insert a new keyword into the CHU.  The new keyword is inserted
+    immediately following the last keyword that has been read from the
+    header.  The `longstr' version has the same functionality as the
+    `str' version except that it also supports the local long string
+    keyword convention for strings longer than 68 characters.  A null
+    pointer may be entered for the comment parameter which will cause
+    the comment field to be left blank.  The flt, dbl, cmp, and dblcmp
+    versions of this routine have the added
+     feature that if the 'decimals' parameter is negative, then the 'G'
+     display format rather then the 'E' format will be used when
+     constructing the keyword value, taking the absolute value of
+     'decimals' for the precision.  This will suppress trailing zeros,
+     and will use a fixed format rather than an exponential format,
+>    depending on the magnitude of the value. \label{ffikyx}
 -
-  VELOCITY=                 12.3 / [km/s] orbital speed
+  int fits_insert_card / ffikey
+      (fitsfile *fptr, char *card, > &status)
 
-  int fits_read_key_unit / ffgunt
-      (fitsfile *fptr, char *keyname, > char *unit, int *status)
+  int fits_insert_key_[str, longstr] / ffi[kys, kls]
+      (fitsfile *fptr, char *keyname, char *value, char *comment,
+       > int *status)
+ 
+  int fits_insert_key_[log, lng] / ffiky[lj]
+      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
+       > int *status)
+ 
+  int fits_insert_key_[flt, fixflt, dbl, fixdbl] / ffiky[edfg]
+      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
+       char *comment, > int *status)
+
+  int fits_insert_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffik[yc,ym,fc,fm]
+      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
+       char *comment, > int *status)
 -
->17 Delete a keyword record.  The space previously occupied by
-    the keyword is reclaimed by moving all the following header records up
-    one row in the header.  The first routine deletes a keyword at a
-    specified position in the header (the first keyword is at position 1),
-    whereas the second routine deletes a specifically named keyword.
-    Wild card characters may be used when specifying the name of the keyword
->   to be deleted. \label{ffdrec} \label{ffdkey}
+>3  Insert a new keyword with an undefined, or null, value into the CHU.
+>   The value string of the keyword is left blank in this case. \label{ffikyu}
 -
-  int fits_delete_record / ffdrec
-      (fitsfile *fptr, int   keynum,  > int *status)
-
-  int fits_delete_key / ffdkey
-      (fitsfile *fptr, char *keyname, > int *status)
+  int fits_insert_key_null / ffikyu
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
 -
-
-
-**E.  Iterator Routines 
 
-The use of these routines is described in the previous chapter.
-Most of these routines do not have a corresponding short function
-name.
+***5.  Read Keyword Routines
 
->1   Iterator `constructor' functions that set 
-   the value of elements in the iteratorCol structure 
-   that define the columns or arrays. These set the fitsfile
-    pointer, column name, column number, datatype, and iotype,
-    respectively.  The last 2 routines allow all the parameters
-    to be set with one function call (one supplies the column
->   name, the other the column number). \label{ffiterset}
+Wild card characters may be used when specifying the name of the
+keyword to be read.
 
+>1  Read a keyword value (with the appropriate data type) and comment from
+    the CHU.  If a NULL comment pointer is given on input, then the comment
+    string will not be returned.  If the value of the keyword is not defined
+    (i.e., the value field is blank) then an error status = VALUE\_UNDEFINED
+    will be returned and the input value will not be changed (except that
+    ffgkys will reset the value to a null string).
+>  \label{ffgkyx} \label{ffgkls}
 -
-  int fits_iter_set_file(iteratorCol *col, fitsfile *fptr);
-
-  int fits_iter_set_colname(iteratorCol *col, char *colname);
-
-  int fits_iter_set_colnum(iteratorCol *col, int colnum);
-
-  int fits_iter_set_datatype(iteratorCol *col, int datatype);
-
-  int fits_iter_set_iotype(iteratorCol *col, int iotype);
+  int fits_read_key_str / ffgkys
+      (fitsfile *fptr, char *keyname, > char *value, char *comment,
+       int *status);
+ 
+  NOTE: after calling the following routine, programs must explicitly free
+        the memory allocated for 'longstr' after it is no longer needed.
 
-  int fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr,
-          char *colname, int datatype,  int iotype);
+  int fits_read_key_longstr / ffgkls
+      (fitsfile *fptr, char *keyname, > char **longstr, char *comment,
+             int *status)
+ 
+  int fits_read_key_[log, lng, flt, dbl, cmp, dblcmp] / ffgky[ljedcm]
+      (fitsfile *fptr, char *keyname, > DTYPE *numval, char *comment,
+       int *status)
 
-  int fits_iter_set_by_num(iteratorCol *col, fitsfile *fptr,
-          int colnum, int datatype,  int iotype);
 -
->2   Iterator `accessor' functions that return the value of the 
-     element in the iteratorCol structure
->    that describes a particular data column or array \label{ffiterget}
+>2  Read a sequence of indexed keyword values (e.g., NAXIS1, NAXIS2, ...).
+    The input starting index number (nstart) must be greater than 0.
+    If the value of any of the keywords is not defined (i.e., the value
+    field is blank) then an error status = VALUE\_UNDEFINED will be
+    returned and the input value for the undefined keyword(s) will not
+    be changed.  These routines do not support wild card characters in
+    the root name.  If there are no indexed keywords in the header with
+    the input root name then these routines do not return a non-zero
+>   status value and instead simply return nfound = 0. \label{ffgknx}
 -
-  fitsfile * fits_iter_get_file(iteratorCol *col);
-
-  char * fits_iter_get_colname(iteratorCol *col);
-
-  int fits_iter_get_colnum(iteratorCol *col);
-
-  int fits_iter_get_datatype(iteratorCol *col);
-
-  int fits_iter_get_iotype(iteratorCol *col);
-
-  void * fits_iter_get_array(iteratorCol *col);
-
-  long fits_iter_get_tlmin(iteratorCol *col);
-
-  long fits_iter_get_tlmax(iteratorCol *col);
-
-  long fits_iter_get_repeat(iteratorCol *col);
-
-  char * fits_iter_get_tunit(iteratorCol *col);
-
-  char * fits_iter_get_tdisp(iteratorCol *col);
+  int fits_read_keys_str / ffgkns
+      (fitsfile *fptr, char *keyname, int nstart, int nkeys,
+       > char **value, int *nfound,  int *status)
+ 
+  int fits_read_keys_[log, lng, flt, dbl] / ffgkn[ljed]
+      (fitsfile *fptr, char *keyname, int nstart, int nkeys,
+       > DTYPE *numval, int *nfound, int *status)
 -
->>3   The CFITSIO iterator function \label{ffiter}
+>3  Read the value of a floating point keyword, returning the integer and
+    fractional parts of the value in separate routine arguments.
+    This routine may be used to read any keyword but is especially
+    useful for reading the 'triple precision' keywords written by ffpkyt.
+>  \label{ffgkyt}
 -
-  int fits_iterate_data(int narrays,  iteratorCol *data, long offset,
-            long nPerLoop,
-            int (*workFn)( long totaln, long offset, long firstn,
-                           long nvalues, int narrays, iteratorCol *data,
-                           void *userPointer),
-            void *userPointer,
-            int *status);
+  int fits_read_key_triple / ffgkyt
+      (fitsfile *fptr, char *keyname, > long *intval, double *frac,
+       char *comment, int *status)
 -
-
-
-**E.  Primary Array or IMAGE Extension I/O Routines 
- 
-These routines read or write data values in the primary data array
-(i.e., the first HDU in a FITS file) or an IMAGE extension.   There are
-also routines to get information about the data type and size of the
-image.  C programmers should note that the ordering of arrays in FITS
-files, and hence in all the CFITSIO calls, is more similar to the
-dimensionality of arrays in Fortran rather than C.  For instance if a
-FITS image has NAXIS1 = 100 and NAXIS2 = 50, then a 2-D array just
-large enough to hold the image should be declared as array[50][100] and
-not as array[100][50].
+***6.  Modify Keyword Routines
 
-The `datatype'  parameter specifies the datatype of the `nulval'  and
-`array' pointers and can have one of the following  values:  TBYTE,
-TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG, TFLOAT, TDOUBLE.
-Automatic data type conversion is performed if the data type of the
-FITS array (as defined by the BITPIX keyword) differs from that
-specified by 'datatype'.  The data values are also automatically scaled
-by the BSCALE and BZERO keyword values as they are being read or
-written in the FITS array.  See Appendix B for further information 
-about the parameters used in these routines.
+These routines modify the value of an existing keyword.  An error is
+returned if the keyword does not exist.  Wild card characters may be
+used when specifying the name of the keyword to be modified.  See
+Appendix B for the definition of the parameters used in these
+routines.
 
->1  Get the data type of the image (= BITPIX value).  Possible returned 
- values are: BYTE\_IMG (8), SHORT\_IMG (16), LONG\_IMG (32), 
->  FLOAT\_IMG (-32), or DOUBLE\_IMG (-64). \label{ffgidt}
--
-  int fits_get_img_type / ffgidt
-      (fitsfile *fptr, > int *bitpix, int *status)
--
->>2  Get the dimension (number of axes = NAXIS) of the image \label{ffgidm}
+>>1  Modify (overwrite) the nth 80-character header record in the CHU. \label{ffmrec}
 -
-  int fits_get_img_dim / ffgidm
-      (fitsfile *fptr, > int *naxis, int *status)
+  int fits_modify_record / ffmrec
+      (fitsfile *fptr, int keynum, char *card, > int *status)
 -
->3  Get the size of all the dimensions (up to maxdim dimensions) of
->  the image \label{ffgisz}
+>2  Modify (overwrite) the 80-character header record for the named keyword
+    in the CHU.  This can be used to overwrite the name of the keyword as
+>   well as its value and comment fields. \label{ffmcrd}
 -
-  int fits_get_img_size / ffgisz
-      (fitsfile *fptr, int maxdim, > long *naxes, int *status)
+  int fits_modify_card / ffmcrd
+      (fitsfile *fptr, char *keyname, char *card, > int *status)
 -
->4   Get the parameters that define the type and size of the image.  This
->    routine simply combines calls to the above 3 routines. \label{ffgipr}
+>5  Modify the value and comment fields of an existing keyword in the CHU.
+    The `longstr' version has the same functionality as the `str'
+    version except that it also supports the local long string keyword
+    convention for strings longer than 68 characters.  Optionally, one
+    may modify only the value field and leave the comment field
+    unchanged by setting the input COMMENT parameter equal to the
+    ampersand character (\&) or by entering a null pointer for the
+    comment parameter.  The flt, dbl, cmp, and dblcmp versions of this
+    routine have the added feature that if the 'decimals' parameter is
+    negative, then the 'G' display format rather then the 'E' format
+    will be used when constructing the keyword value, taking the
+    absolute value of 'decimals' for the precision.  This will suppress
+    trailing zeros, and will use a fixed format rather than an
+    exponential format,
+>   depending on the magnitude of the value. \label{ffmkyx}
 -
-  int fits_get_img_param / ffgipr
-      (fitsfile *fptr, int maxdim, > int *bitpix, int *naxis, long *naxes, 
-       int *status)
+  int fits_modify_key_[str, longstr] / ffm[kys, kls]
+      (fitsfile *fptr, char *keyname, char *value, char *comment,
+       > int *status);
+ 
+  int fits_modify_key_[log, lng] / ffmky[lj]
+      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
+       > int *status)
+ 
+  int fits_modify_key_[flt, dbl, fixflt, fixdbl] / ffmky[edfg]
+      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
+       char *comment, > int *status)
+
+  int fits_modify_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffmk[yc,ym,fc,fm]
+      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
+       char *comment, > int *status)
 -
->5  Write pixels into the FITS data array.  'fpixel' is an array of
-   length NAXIS which gives the coordinate of the starting pixel to be
-   written to, such that fpixel[0] is in the range 1 to NAXIS1,
->  fpixel[1] is in the range 1 to NAXIS2, etc. \label{ffppx}
+>6  Modify the value of an existing keyword to be undefined, or null.
+    The value string of the keyword is set to blank.
+    Optionally, one may leave the comment field unchanged by setting the 
+    input COMMENT parameter equal to 
+>   the ampersand character (\&) or by entering a null pointer.  \label{ffmkyu} 
 -
-  int fits_write_pix / ffppx
-      (fitsfile *fptr, int datatype, long *fpixel, long nelements,
-       DTYPE *array, int *status);
+  int fits_modify_key_null / ffmkyu
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
 -
->6 Write pixels into the FITS data array, substituting the appropriate 
-   FITS null value for all elements which are equal to the input value
-   of nulval (note that this parameter gives the address of the null
-   value, not the null value itself).  For integer FITS arrays, the
-   FITS null value is defined by the BLANK keyword (an error is
-   returned if the BLANK keyword doesn't exist).  For floating point
-   FITS arrays  the special IEEE NaN (Not-a-Number) value will be
-   written into the FITS file.  If a null pointer is entered for
-   nulval, then the null value is  ignored and this routine behaves
->  the same as fits\_write\_pix.   \label{ffppxn}
+***7.  Update Keyword Routines 
+
+>1  These update routines modify the value, and optionally the comment field,
+    of the keyword if it already exists, otherwise the new keyword is
+    appended to the header.  A separate routine is provided for each
+    keyword data type.  The `longstr' version has the same functionality
+    as the `str' version except that it also supports the local long
+    string keyword convention for strings longer than 68 characters.  A
+    null pointer may be entered for the comment parameter which will
+    leave the comment field unchanged or blank.  The flt, dbl, cmp, and
+    dblcmp versions of this routine have the added feature that if the
+    'decimals' parameter is negative, then the 'G' display format
+    rather then the 'E' format will be used when constructing the
+    keyword value, taking the absolute value of 'decimals' for the
+    precision.  This will suppress trailing zeros, and will use a fixed
+    format rather than an exponential format,
+>   depending on the magnitude of the value. \label{ffukyx}
 -
-  int fits_write_pixnull / ffppxn
-      (fitsfile *fptr, int datatype, long *fpixel, long nelements,
-       DTYPE *array, DTYPE *nulval, > int *status);
+  int fits_update_key_[str, longstr] / ffu[kys, kls]
+      (fitsfile *fptr, char *keyname, char *value, char *comment,
+       > int *status)
+ 
+  int fits_update_key_[log, lng] / ffuky[lj]
+      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
+       > int *status)
+ 
+  int fits_update_key_[flt, dbl, fixflt, fixdbl] / ffuky[edfg]
+      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
+       char *comment, > int *status)
+
+  int fits_update_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffuk[yc,ym,fc,fm]
+      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
+       char *comment, > int *status)
 -
->7  Set FITS data array elements equal to the appropriate null pixel
-    value. For integer FITS arrays, the FITS null value is defined by
-    the BLANK keyword  (an error is returned if the BLANK keyword
-    doesn't exist). For floating point FITS arrays the special IEEE NaN
-    (Not-a-Number) value will be written into the FITS file.  Note that
-    'firstelem' is a scalar giving the  offset to the first pixel to be
->   written in the equivalent 1-dimensional array of image pixels. \label{ffpprn}
+
+**D.  Define Data Scaling and Undefined Pixel Parameters
+ 
+These routines set or modify the internal parameters used by CFITSIO
+to either scale the data or to represent undefined pixels.  Generally
+CFITSIO will scale the data according to the values of the BSCALE and
+BZERO (or TSCALn and TZEROn) keywords, however these routines may be
+used to override the keyword values.  This may be useful when one wants
+to read or write the raw unscaled values in the FITS file.  Similarly,
+CFITSIO generally uses the value of the BLANK or TNULLn keyword to
+signify an undefined pixel, but these routines may be used to override
+this value.  These routines do not create or modify the corresponding
+header keyword values.  See Appendix B for the definition of the
+parameters used in these routines.
+ 
+>1  Reset the scaling factors in the primary array or image extension; does
+    not change the BSCALE and BZERO keyword values and only affects the
+    automatic scaling performed when the data elements are written/read
+    to/from the FITS file.   When reading from a FITS file the returned
+    data value = (the value given in the FITS array) * BSCALE + BZERO.
+    The inverse formula is used when writing data values to the FITS
+>   file. \label{ffpscl}
 -
-  int fits_write_null_img / ffpprn
-      (fitsfile *fptr, long firstelem, long nelements, > int *status)
+  int fits_set_bscale / ffpscl
+      (fitsfile *fptr, double scale, double zero, > int *status)
 -
->8  Read a rectangular subset from the FITS data array.   Undefined FITS array
-    elements will be returned with a value = *nullval, (note that this
-    parameter gives the address of the null value, not the null value
-    itself) unless nulval = 0 or *nulval = 0, in which case no checks for
->   undefined pixels will be performed.  \label{ffgsv}
+>2  Reset the scaling parameters for a table column; does not change
+    the TSCALn or TZEROn keyword values and only affects the automatic
+    scaling performed when the data elements are written/read to/from
+    the FITS file.  When reading from a FITS file the returned data
+    value = (the value given in the FITS array) * TSCAL + TZERO.  The
+    inverse formula is used when writing data values to the FITS file.
+>   \label{fftscl}
 -
-  int fits_read_subset / ffgsv
-      (fitsfile *fptr, int  datatype, long *fpixel, long *lpixel, long *inc,
-       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
+  int fits_set_tscale / fftscl
+      (fitsfile *fptr, int colnum, double scale, double zero,
+       > int *status)
+-
+>3  Define the integer value to be used to signify undefined pixels in the
+    primary array or image extension.  This is only used if BITPIX = 8, 16,
+    or 32.  This does not create or change the value of the BLANK keyword in
+>   the header. \label{ffpnul}
 -
->9  Read pixels from the FITS data array.   Undefined FITS array
-    pixels will be returned with a value = *nullval, (note that this
-    parameter gives the address of the null value, not the null value
-    itself) unless nulval = 0 or *nulval = 0, in which case no checks for
-    undefined pixels will be performed. 'fpixel' is an array of
-    length NAXIS which gives the coordinate of the starting pixel to be
-    read, such that fpixel[0] is in the range 1 to NAXIS1,
->   fpixel[1] is in the range 1 to NAXIS2, etc. \label{ffgpxv}
+  int fits_set_imgnul / ffpnul
+      (fitsfile *fptr, long nulval, > int *status)
 -
-  int fits_read_pix / ffgpxv
-      (fitsfile *fptr, int  datatype, long *fpixel, long nelements,
-       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
+>4  Define the string to be used to signify undefined pixels in
+    a column in an ASCII table.  This does not create or change the value
+>   of the TNULLn keyword. \label{ffsnul}
 -
->10  Read pixels from the FITS data array.   Any undefined FITS array
-    elements will have the corresponding nullarray element set
->   to TRUE.  \label{ffgpxf}
+  int fits_set_atblnull / ffsnul
+      (fitsfile *fptr, int colnum, char *nulstr, > int *status)
 -
-  int fits_read_pixnull / ffgpxf
-      (fitsfile *fptr, int  datatype, long *fpixel, long nelements,
-       > DTYPE *array, char *nullarray, int *anynul, int *status)
+>5  Define the value to be used to signify undefined pixels in
+    an integer column in a binary table (where TFORMn = 'B', 'I', or 'J').
+    This does not create or  change the value of the TNULLn keyword.
+>   \label{fftnul}
+-
+  int fits_set_btblnull / fftnul
+      (fitsfile *fptr, int colnum, long nulval, > int *status)
 -
 
-**F.  ASCII and Binary Table Routines
+**E.  Specialized FITS Primary Array or IMAGE Extension I/O Routines 
  
-These routines perform read and write operations on columns of data in
-FITS ASCII or Binary tables.  Note that in the following discussions,
-the first row and column in a table is at position 1 not 0.  See
-Appendix B for the definition of the parameters used in these
-routines.
+These routines read or write data values in the primary data array
+(i.e., the first HDU in the FITS file) or an IMAGE extension.
+Automatic data type conversion is performed for if the data type of the
+FITS array (as defined by the BITPIX keyword) differs from the data
+type of the array in the calling routine.  The data values are
+automatically scaled by the BSCALE and BZERO header values as they are
+being written or read from the FITS array.  Unlike the basic routines
+described in the previous chapter, most of these routines specifically
+support the FITS random groups format.  See Appendix B for the
+definition of the parameters used in these routines.
 
-***1.  Column Information Routines \label{FFGCNO}
+The more primitive reading and writing routines (i. e., ffppr\_,
+ffppn\_, ffppn, ffgpv\_, or ffgpf\_) simply treat the primary array as
+a long 1-dimensional array of pixels, ignoring the intrinsic
+dimensionality of the array.  When dealing with a 2D image, for
+example, the application program must calculate the pixel offset in the
+1-D array that corresponds to any particular X, Y coordinate in the
+image.  C programmers should note that the ordering of arrays in FITS
+files, and hence in all the CFITSIO calls, is more similar to the
+dimensionality of arrays in Fortran rather than C.  For instance if a
+FITS image has NAXIS1 = 100 and NAXIS2 = 50, then a 2-D array just
+large enough to hold the image should be declared as array[50][100] and
+not as array[100][50].
 
->1   Get the number of rows or columns in the current FITS table.
-     The number of rows is given by the NAXIS2 keyword and the
-     number of columns is given by the TFIELDS keyword in the header
->    of the table. \label{ffgnrw} 
--
-  int fits_get_num_rows / ffgnrw 
-      (fitsfile *fptr, > long *nrows, int *status);
+For convenience, higher-level routines are also provided to specificly
+deal with 2D images (ffp2d\_ and ffg2d\_) and 3D data cubes (ffp3d\_
+and ffg3d\_).  The dimensionality of the FITS image is passed by the
+naxis1, naxis2, and naxis3 parameters and the declared dimensions of
+the program array are passed in the dim1 and dim2 parameters.  Note
+that the dimensions of the program array may be larger than the
+dimensions of the FITS array.  For example if a FITS image with NAXIS1
+= NAXIS2 = 400 is read into a program array which is dimensioned as 512
+x 512 pixels, then the image will just fill the lower left corner of
+the array with pixels in the range 1 - 400 in the X an Y directions.
+This has the effect of taking a contiguous set of pixel value in the
+FITS array and writing them to a non-contiguous array in program memory
+(i.e., there are now some blank pixels around the edge of the image in
+the program array).
 
-  int fits_get_num_cols / ffgncl
-      (fitsfile *fptr, > int *ncols, int *status);
+The most general set of routines (ffpss\_, ffgsv\_, and ffgsf\_) may be
+used to transfer a rectangular subset of the pixels in a FITS
+N-dimensional image to or from an array which has been declared in the
+calling program.  The fpixel and lpixel parameters are integer arrays
+which specify the starting and ending pixel coordinate in each dimension
+(starting with 1, not 0) of the FITS image that is to be read or
+written.  It is important to note that these are the starting and
+ending pixels in the FITS image, not in the declared array in the
+program. The array parameter in these routines is treated simply as a
+large one-dimensional array of the appropriate data type containing the
+pixel values; The pixel values in the FITS array are read/written
+from/to this program array in strict sequence without any gaps;  it is
+up to the calling routine to correctly interpret the dimensionality of
+this array.  The two FITS reading routines (ffgsv\_ and ffgsf\_ ) also
+have an `inc' parameter which defines the data sampling interval in
+each dimension of the FITS array.  For example, if inc[0]=2 and
+inc[1]=3 when reading a 2-dimensional FITS image, then only every other
+pixel in the first dimension and every 3rd pixel in the second
+dimension will be returned to the 'array' parameter.
+
+Two types of routines are provided to read the data array which differ in
+the way undefined pixels are handled.  The first type of routines (e.g.,
+ffgpv\_) simply return an array of data elements in which undefined
+pixels are set equal to a value specified by the user in the `nulval'
+parameter.  An additional feature of these routines is that if the user
+sets nulval = 0, then no checks for undefined pixels will be performed,
+thus reducing the amount of CPU processing.  The second type of routines
+(e.g., ffgpf\_) returns the data element array and, in addition, a char
+array that indicates whether the value of the corresponding data pixel
+is undefined (= 1) or defined (= 0).  The latter type of routines may
+be more convenient to use in some circumstances, however, it requires
+an additional array of logical values which can be unwieldy when working
+with large data arrays.
+
+>1  Write elements into the FITS data array.  
+> \label{ffppr} \label{ffpprx} \label{ffppn} \label{ffppnx}
 -
+  int fits_write_img / ffppr
+      (fitsfile *fptr, int datatype, long firstelem, long nelements,
+       DTYPE *array, int *status);
 
->2  Get the table column number (and name) of the column whose name
-matches an input template name.   If casesen  = CASESEN then the column
-name match will be case-sensitive, whereas if casesen = CASEINSEN then
-the case will be ignored.  As a general rule, the column names should
-be treated as case INsensitive.
+  int fits_write_img_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffppr[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long firstelem, long nelements,
+       DTYPE *array, > int *status);
 
-The input column name template may be either the exact name of the
-column to be searched for, or it may contain wild card characters (*,
-?, or \#), or it may contain the integer number of the desired column
-(with the first column = 1).  The `*' wild card character matches any
-sequence of characters (including zero characters) and the `?'
-character matches any single character.  The \# wildcard will match any
-consecutive string of decimal digits (0-9).  If more than one column
-name in the table matches the template string, then the first match is
-returned and the status value will be set to COL\_NOT\_UNIQUE  as a
-warning that a unique match was not found.  To find the other cases
-that match the template, call the routine again leaving the input
-status value equal to COL\_NOT\_UNIQUE and the next matching name will
-then be returned.  Repeat this process until a status =
-COL\_NOT\_FOUND  is returned.
+  int fits_write_imgnull / ffppn
+      (fitsfile *fptr, int datatype, long firstelem, long nelements,
+       DTYPE *array, DTYPE *nulval, > int *status);
 
-The FITS Standard recommends that only letters, digits, and the
-underscore character be used in column names (with no embedded
-spaces).  Trailing blank characters are not significant.  It is
-recommended that all the column names in a given table be unique within
-the first 8 characters, and strongly recommended that the names be
-> unique within the first 16 characters. \label{ffgcno} \label{ffgcnn}
+  int fits_write_imgnull_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffppn[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long firstelem,
+           long nelements, DTYPE *array, DTYPE nulval, > int *status);
 -
-  int fits_get_colnum / ffgcno
-      (fitsfile *fptr, int casesen, char *templt, > int *colnum,
-       int *status)
- 
-  int fits_get_colname / ffgcnn
-      (fitsfile *fptr, int casesen, char *templt, > char *colname,
-       int *colnum, int *status)
+>>2 Set data array elements as undefined. \label{ffppru}
 -
->3  Return the datatype, vector repeat value, and the width in bytes
-    of a column in an ASCII or binary table.  Allowed values for the
-    datatype in ASCII tables are:  TSTRING, TSHORT, TLONG, TFLOAT, and
-    TDOUBLE.  Binary tables also support these types: TLOGICAL, TBIT,
-    TBYTE, TCOMPLEX and TDBLCOMPLEX.  The negative of the datatype code
-    value is returned if it is a variable length array column.  Note
-    that in the case of a 'J' 32-bit integer binary table column, this
-    routine will return datatype = TINT32BIT (which in fact is
-    equivalent to TLONG).  With most current C compilers, a value in a
-    'J' column has the same size as an 'int' variable, and may not be
-    equivalent to a 'long' variable, which is 64-bits long on an
-    increasing number of compilers.
-
-    The 'repeat' parameter returns the vector repeat count on the binary
-    table TFORMn keyword value; ASCII table columns always have repeat
-    = 1.  The 'width' parameter returns the width in bytes of a single
-    column value (e.g., a '10D' binary table column will have width =
-    8; an ASCII table 'F12.2' column will have width = 12);  Note that
-    this routine supports the local convention for specifying arrays of
-    fixed length strings within a binary table character column using
-    the syntax TFORM = 'rAw' where 'r' is the total number of
-    characters (= the width of the column) and 'w' is the width of a
-    unit string within the column.  Thus if the column has TFORM =
-    '60A12' then this routine will return typecode = TSTRING, repeat =
-    60, and width = 12.  A null pointer may be given for any of
->   the output parameters that are not needed. \label{ffgtcl}
+  int fits_write_img_null / ffppru
+      (fitsfile *fptr, long group, long firstelem, long nelements,
+       > int *status)
 -
-  int fits_get_coltype / ffgtcl
-      (fitsfile *fptr, int colnum, > int *typecode, long *repeat,
-       long *width, int *status)
+>3  Write values into group parameters.  This routine only applies
+    to the `Random Grouped' FITS format which has been used for
+    applications in radio interferometry, but is officially deprecated
+>   for future use.  \label{ffpgpx}
 -
->4  Return the display width of a column.  This is the length
-    of the string that will be returned by the fits\_read\_col routine 
-    when reading the column as a formatted string.  The display width is
-    determined by the TDISPn keyword, if present, otherwise by the data
->   type of the column. \label{ffgcdw}
+  int fits_write_grppar_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffpgp[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long firstelem, long nelements,
+       > DTYPE *array, int *status)
 -
-  int fits_get_col_display_width / ffgcdw
-      (fitsfile *fptr, int colnum, > int *dispwidth, int *status)
+>>4  Write a 2-D or 3-D image into the data array. \label{ffp2dx} \label{ffp3dx}
 -
+  int fits_write_2d_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffp2d[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long dim1, long naxis1,
+       long naxis2, DTYPE *array, > int *status)
 
->5  Write (append) a TDIMn keyword whose value has the form '(l,m,n...)'
-    where l, m, n... are the dimensions of a multidimension array
->   column in a binary table. \label{ffptdm}
--
-  int fits_write_tdim / ffptdm
-      (fitsfile *fptr, int colnum, int naxis, long *naxes, > int *status)
--
->6  Return the number of and size of the dimensions of a table column in 
-    a binary table. Normally this information is given by the TDIMn keyword,
-    but if this keyword is not present then this routine returns naxis = 1
->   and naxes[0] equal to the repeat count in the TFORM keyword. \label{ffgtdm}
+  int fits_write_3d_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffp3d[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long dim1, long dim2,
+       long naxis1, long naxis2, long naxis3, DTYPE *array, > int *status)
 -
-  int fits_read_tdim / ffgtdm
-      (fitsfile *fptr, int colnum, int maxdim, > int *naxis,
-       long *naxes, int *status)
+>>5   Write an arbitrary data subsection into the data array. \label{ffpssx}
 -
->7  Decode the input TDIMn keyword string (e.g. '(100,200)') and return the
-    number of and size of the dimensions of a binary table column. If the input
-    tdimstr character string is null, then this routine returns naxis = 1
-    and naxes[0] equal to the repeat count in the TFORM keyword. This routine
->   is called by fits\_read\_tdim.  \label{ffdtdm}
+  int fits_write_subset_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffpss[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long naxis, long *naxes,
+       long *fpixel, long *lpixel, DTYPE *array, > int *status)
 -
-  int fits_decode_tdim / ffdtdm
-      (fitsfile *fptr, char *tdimstr, int colnum, int maxdim, > int *naxis,
-       long *naxes, int *status)
+>6  Read elements from the FITS data array.
+>    \label{ffgpv} \label{ffgpvx} \label{ffgpf} \label{ffgpfx}
 -
+  int fits_read_img / ffgpv
+      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
+       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
 
-***2.  Routines to Edit Rows or Columns \label{FFIROW}
+  int fits_read_img_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffgpv[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long firstelem, long nelements,
+       DTYPE nulval, > DTYPE *array, int *anynul, int *status)
 
->1  Insert blank rows into an ASCII or binary table. All the rows following
-    row FROW are shifted down by NROWS rows.  If FROW = 0 then the blank rows
-    are inserted at the beginning of the table.  This routine updates the
-    NAXIS2 keyword to reflect the new
->   number of rows in the table. \label{ffirow}
--
-  int fits_insert_rows / ffirow
-      (fitsfile *fptr, long firstrow, long nrows, > int *status)
+  int fits_read_imgnull / ffgpf
+      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
+       > DTYPE *array, char *nullarray, int *anynul, int *status)
+
+  int  fits_read_imgnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
+       ffgpf[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, long group, long firstelem, long nelements,
+       > DTYPE *array, char *nullarray, int *anynul, int *status)
 -
->2  Delete rows from an ASCII or binary table (in the CDU).
-    The NROWS number of rows are deleted, starting with row FROW.
-    Any remaining rows in the table are shifted up to fill in the space.
-    This routine modifies the NAXIS2 keyword to reflect the new number
->   of rows in the table.   \label{ffdrow}
+>7  Read values from group parameters.  This routine only applies
+    to the `Random Grouped' FITS format which has been used for
+    applications in radio interferometry, but is officially deprecated
+>   for future use. \label{ffggpx}
 -
-  int fits_delete_rows / ffdrow
-      (fitsfile *fptr, long firstrow, long nrows, > int *status)
+  int  fits_read_grppar_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffggp[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, long group, long firstelem, long nelements,
+       > DTYPE *array, int *status)
 -
->3  Delete a list of rows from an ASCII or binary table (in the CDU).
-    rowlist is an array of row numbers to be deleted from the table.
-    (The first row in the table is 1 not 0).  The list of
-    row numbers must be sorted in ascending order.  nrows is the
->   number of row numbers in the list. \label{ffdrws}
+>8   Read 2-D or 3-D image from the data array.  Undefined
+     pixels in the array will be set equal to the value of 'nulval',
+     unless nulval=0 in which case no testing for undefined pixels will
+>    be performed. \label{ffg2dx} \label{ffg3dx}
 -
-  int fits_delete_rowlist / ffdrws
-      (fitsfile *fptr, long *rowlist, long nrows, > int *status)
+  int  fits_read_2d_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffg2d[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, long group, DTYPE nulval, long dim1, long naxis1,
+       long naxis2, > DTYPE *array, int *anynul, int *status)
+
+  int  fits_read_3d_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffg3d[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, long group, DTYPE nulval, long dim1,
+       long dim2, long naxis1, long naxis2, long naxis3,
+       > DTYPE *array, int *anynul, int *status)
 -
->4  Insert a blank column (or columns) into an ASCII or binary
-    table.  COLNUM specifies the column number that the (first)
-    new column should occupy in the table.  NCOLS specifies how many
-    columns are to be inserted. Any existing columns from this position and
-    higher are shifted over to allow room for the new column(s).
-    The index number on all the following keywords will be incremented
-    if necessary to reflect the new position of the column(s) in the table:
-    TBCOLn, TFORMn, TTYPEn, TUNITn, TNULLn, TSCALn, TZEROn, TDISPn, TDIMn,
-    TLMINn, TLMAXn, TDMINn, TDMAXn, TCTYPn, TCRPXn, TCRVLn, TCDLTn, TCROTn,
->   and TCUNIn. \label{fficol} \label{fficls}
+>9    Read an arbitrary data subsection from the data array.
+>      \label{ffgsvx} \label{ffgsfx}
 -
-  int fits_insert_col / fficol
-      (fitsfile *fptr, int colnum, char *ttype, char *tform,
-       > int *status)
+  int  fits_read_subset_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffgsv[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, int group, int naxis, long *naxes, 
+       long *fpixel, long *lpixel, long *inc, DTYPE nulval, 
+       > DTYPE *array, int *anynul, int *status)
 
-  int fits_insert_cols / fficls
-      (fitsfile *fptr, int colnum, int ncols, char **ttype,
-       char **tform, > int *status)
+  int  fits_read_subsetnull_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffgsf[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, int group, int naxis, long *naxes, 
+       long *fpixel, long *lpixel, long *inc, > DTYPE *array, 
+       char *nullarray, int *anynul, int *status)
 -
->5  Modify the vector length of a binary table column (e.g.,
-    change a column from TFORMn = '1E' to '20E').  The vector
->   length may be increased or decreased from the current value. \label{ffmvec}
+
+**F.  Specialized FITS ASCII and Binary Table Routines
+
+***1.  General Column Routines
+
+>1  Get information about an existing ASCII or binary table column.   A null
+    pointer may be given for any of the output parameters that are not
+    needed.  DATATYPE is a character string which returns the data type
+    of the column as defined by the TFORMn keyword (e.g., 'I', 'J','E',
+    'D', etc.).  In the case of an ASCII character column, typecode
+    will have a value of the form 'An' where 'n' is an integer
+    expressing the width of the field in characters.  For example, if
+    TFORM = '160A8' then ffgbcl will return typechar='A8' and
+    repeat=20.   All the returned parameters are scalar quantities.
+>   \label{ffgacl} \label{ffgbcl}
+-
+  int fits_get_acolparms / ffgacl
+    (fitsfile *fptr, int colnum, > char *ttype, long *tbcol,
+     char *tunit, char *tform, double *scale, double *zero,
+     char *nulstr, char *tdisp, int *status)
+
+  int fits_get_bcolparms / ffgbcl
+      (fitsfile *fptr, int colnum, > char *ttype, char *tunit,
+       char *typechar, long *repeat, double *scale, double *zero,
+       long *nulval, char *tdisp, int  *status)
 -
-  int fits_modify_vector_len / ffmvec
-      (fitsfile *fptr, int colnum, long newveclen, > int *status)
+>2  Return optimal number of rows to read or write at one time for 
+    maximum I/O efficiency.  Refer to the
+    ``Optimizing Code'' section in Chapter 5 for more discussion on how 
+>   to use this routine. \label{ffgrsz}
 -
->6  Delete a column from an  ASCII or binary table (in the CDU).
-    The index number of all the keywords listed above will be
-    decremented if necessary to reflect the new position of the column(s) in
-    the table.    The physical size of the FITS file may
-    not be reduced by this operation, and the empty FITS blocks if any
->   at the end of the file will be padded with zeros. \label{ffdcol}
+  int fits_get_rowsize / ffgrsz
+      (fitsfile *fptr, long *nrows, *status)
 -
-  int fits_delete_col / ffdcol(fitsfile *fptr, int colnum, > int *status)
+>3  Define the zero indexed byte offset of the 'heap' measured from
+    the start of the binary table data.  By default the heap is assumed
+    to start immediately following the regular table data, i.e., at
+    location NAXIS1 x NAXIS2.  This routine is only relevant for
+    binary tables which contain variable length array columns (with
+    TFORMn = 'Pt').  This routine also automatically writes
+    the value of theap to a keyword in the extension header.  This
+    routine must be called after the required keywords have been
+    written (with ffphbn) 
+>   but before any data is written to the table. \label{ffpthp}
 -
->7  Copy a column from one HDU to another (or to the same HDU).  If
-    create\_col = TRUE, then a new column will be inserted in the output
-    table, at position `outcolumn', otherwise the existing output column will
-    be overwritten (in which case it must have a compatible datatype).  
->   Note that the first column in a table is at colnum = 1. \label{ffcpcl}
+  int fits_write_theap / ffpthp
+      (fitsfile *fptr, long theap, > int *status)
 -
-int fits_copy_col / ffcpcl
-    (fitsfile *infptr, fitsfile *outfptr, int incolnum, int outcolnum, 
-     int create_col, > int *status);
+>4  Test the contents of the binary table variable array heap, returning
+    the size of the heap, the number of unused bytes that are not currently
+    pointed to by any of the descriptors, and the number of bytes which are
+    pointed to by multiple descriptors.  It also returns valid = FALSE if
+    any of the descriptors point to invalid addresses  out of range of the
+>    heap. \label{fftheap}
+-
+  int fits_test_heap / fftheap
+      (fitsfile *fptr, > long *heapsize, long *unused, long *overlap, 
+       int *validheap, int *status)
+-
+>5  Re-pack the vectors in the binary table variable array heap to recover
+    any unused space.  Normally, when a vector in a variable length
+    array column is rewritten the previously written array remains in
+    the heap as wasted unused space.  This routine will repack the
+    arrays that are still in use, thus eliminating any bytes in the
+    heap that are no longer in use.  Note that if several vectors point
+    to the same bytes in the heap, then this routine will make
+    duplicate copies of the bytes for each vector, which will actually
+>   expand the size of the heap. \label{ffcmph}
+-
+  int fits_compress_heap / ffcmph
+      (fitsfile *fptr, > int *status)
 -
-***3.  Read and Write Column Data Routines \label{FFPCLS}
 
-The following routines write or read data values in the current ASCII
-or binary table extension.  If a write operation extends beyond the
-current size of the table, then the number of rows in the table will
-automatically be increased and the NAXIS2 keyword value will be
-updated.  Attempts to read beyond the end of the table will result in
-an error.
+***2.  Low-Level Table Access Routines
+ 
+The following 2 routines provide low-level access to the data in ASCII
+or binary tables and are mainly useful as an efficient way to copy all
+or part of a table from one location to another.  These routines simply
+read or write the specified number of consecutive bytes in an ASCII or
+binary table, without regard for column boundaries or the row length in
+the table.  These routines do not perform any machine dependent data
+conversion or byte swapping.  See Appendix B for the definition of the
+parameters used in these routines.
 
-Automatic data type conversion is performed for numerical data types
-(only) if the data type of the column (defined by the TFORMn keyword)
-differs from the data type of the calling routine.  ASCII tables
-support the following datatype values:  TSTRING, TBYTE, TSHORT,
-TUSHORT, TINT, TUINT, TLONG, TULONG, TFLOAT, or TDOUBLE.  Binary tables
-also support TLOGICAL (internally mapped to the `char' datatype),
-TCOMPLEX, and TDBLCOMPLEX.
-
-Note that within the context of these routines, the TSTRING datatype
-corresponds to a C 'char**' datatype, i.e., a pointer to an array of
-pointers to an array of characters.  This is different from the keyword
-reading and writing routines where TSTRING corresponds to a C 'char*'
-datatype, i.e., a single pointer to an array of characters.  When
-reading strings from a table, the char arrays obviously must have been
-allocated long enough to hold the whole FITS table string.
+>1  Read or write a consecutive array of bytes from an ASCII or binary
+>   table \label{ffgtbb}  \label{ffptbb}
+-
+  int fits_read_tblbytes / ffgtbb
+      (fitsfile *fptr, long firstrow, long firstchar, long nchars,
+       > unsigned char *values, int *status)
 
-Numerical data values are automatically scaled by the TSCALn and TZEROn
-keyword values (if they exist).
+  int fits_write_tblbytes / ffptbb
+      (fitsfile *fptr, long firstrow, long firstchar, long nchars,
+       unsigned char *values, > int *status)
+-
 
-In the case of binary tables with vector elements, the 'felem'
-parameter defines the starting element (beginning with 1, not 0) within
-the cell (a cell is defined as the intersection of a row and a column
-and may contain a single value or a vector of values).  The felem
-parameter is ignored when dealing with ASCII tables. Similarly, in the
-case of binary tables the 'nelements' parameter specifies the total
-number of vector values to be read or written (continuing on subsequent
-rows if required) and not the number of table cells.  See Appendix B
-for the further definitions of the parameters used in these routines.
+***3.  Write Column Data Routines
 
->>1  Write elements into an ASCII or binary table column. \label{ffpcl}
+>1  Write elements into an ASCII or binary table column (in the CDU).
+    The data type of the array is implied by the suffix of the
+>   routine name. \label{ffpcls}
 -
-  int fits_write_col / ffpcl
-      (fitsfile *fptr, int datatype, int colnum, long firstrow,
-       long firstelem, long nelements, DTYPE *array, > int *status)
+  int fits_write_col_str / ffpcls
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, char **array, > int *status)
+ 
+  int fits_write_col_[log,byt,sht,usht,int,uint,lng,ulng,lnglng,flt,dbl,cmp,dblcmp] /
+      ffpcl[l,b,i,ui,k,uk,j,uj,jj,e,d,c,m]
+      (fitsfile *fptr, int colnum, long firstrow,
+           long firstelem, long nelements, DTYPE *array, > int *status)
 -
->2  Write elements into an ASCII or binary table column,
+>2  Write elements into an ASCII or binary table column
     substituting the appropriate FITS null value for any elements that
-    are equal to the nulval parameter (note that this parameter gives the
-    address of the null value, not the null value itself).  For all ASCII
-    table columns and for integer columns in binary tables, the null value
-    to be used in the FITS file is defined  by the TNULLn keyword
-    and an error is returned if the TNULLn keyword doesn't exist.
-    For floating point columns in binary tables the special IEEE NaN 
-    (Not-a-Number) value will be written into the FITS column.  
-    If a null pointer is entered for nulval, then the null value is 
-    ignored and this routine behaves the same as fits\_write\_col.
->   This routine must not be used to write to variable length array columns.  \label{ffpcn}
+    are equal to the nulval parameter.  This routines must not be used to
+>   write to  variable length array columns.  \label{ffpcnx}
 -
-  int fits_write_colnull / ffpcn
-      (fitsfile *fptr, int datatype, int colnum, long firstrow,
-      long firstelem, long nelements, DTYPE *array, DTYPE *nulval,
-      > int *status)
+  int fits_write_colnull_[log, byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffpcn[l,b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, DTYPE *array, DTYPE nulval, > int *status)
 -
->3  Set elements in a table column as undefined.  For all ASCII
-    table columns and for integer columns in binary tables, the null value
-    to be used in the FITS file is defined by the TNULLn keyword
-    and an error is returned if the TNULLn keyword doesn't exist.
-    For floating point columns in binary tables the special IEEE NaN 
->   (Not-a-Number) value will be written into the FITS column.   \label{ffpclu}
+>3  Write string elements into a binary table column (in the CDU)
+    substituting the FITS null value for any elements that
+    are equal to the nulstr string.  This routine must NOT be 
+>   used to write to  variable length array columns. \label{ffpcns}
 -
-   int fits_write_col_null / ffpclu
-       (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-        long nelements, > int *status)
+  int fits_write_colnull_str / ffpcns
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, char **array, char *nulstr, > int *status)
 -
->4  Read elements from an ASCII or binary table column.  The datatype
-    parameter specifies the datatype of the `nulval' and `array'  pointers;
-    Undefined array elements will be returned with a value = *nullval,
-    (note that this parameter gives the address of the null value, not the
-    null value itself) unless nulval = 0 or *nulval = 0, in which case no
-    checking for undefined pixels will be performed. 
+>4  Write bit values into a binary byte ('B') or bit ('X') table column (in
+    the CDU).  Larray is an array of characters corresponding to the
+    sequence of bits to be written.  If an element of larray is true
+    (not equal to zero) then the corresponding bit in the FITS table is
+    set to 1, otherwise the bit is set to 0.  The 'X' column in a FITS
+    table is always padded out to a multiple of 8 bits where the bit
+    array starts with the most significant bit of the byte and works
+    down towards the 1's bit.  For example, a '4X' array, with the
+    first bit = 1 and the remaining 3 bits = 0 is equivalent to the 8-bit
+    unsigned byte decimal value of 128  ('1000 0000B').  In the case of
+    'X' columns, CFITSIO can write to all 8 bits of each byte whether
+    they are formally valid or not.  Thus if the column is defined as
+    '4X', and one calls ffpclx with firstbit=1 and nbits=8, then all
+    8 bits will be written into the first byte (as opposed to writing
+    the first 4 bits into the first row and then the next 4 bits into
+    the next row), even though the last 4 bits of each byte are formally
+    not defined and should all be set = 0.  It should also be noted that
+    it is more efficient to write 'X' columns an entire byte at a time,
+    instead of bit by bit.  Any of the CFITSIO routines that write to
+    columns (e.g. fits\_write\_col\_byt) may be used for this purpose.
+    These routines will interpret 'X' columns as though they were 'B'
+    columns (e.g.,  '1X' through '8X' is equivalent
+>   to '1B', and '9X' through '16X' is equivalent to '2B').  \label{ffpclx}
+-
+  int fits_write_col_bit / ffpclx
+      (fitsfile *fptr, int colnum, long firstrow, long firstbit, 
+       long nbits, char *larray, > int *status)
+-
+>5  Write the descriptor for a variable length column in a binary table.
+    This routine can be used in conjunction with ffgdes to enable
+    2 or more arrays to point to the same storage location to save
+>   storage space if the arrays are identical. \label{ffpdes}
+-
+    int fits_write_descript / ffpdes
+        (fitsfile *fptr, int colnum, long rownum, long repeat,
+         long offset, > int *status)
+-
+***4.  Read Column Data Routines
 
-    Any column, regardless of it's intrinsic datatype, may be read as a
-    string.  It should be noted however that reading a numeric column
-    as a string is 10 - 100 times slower than reading the same column
-    as a number due to the large overhead in constructing the formatted
-    strings.  The display format of the returned strings will be
+Two types of routines are provided to get the column data which differ
+in the way undefined pixels are handled.  The first set of routines
+(ffgcv) simply return an array of data elements in which undefined
+pixels are set equal to a value specified by the user in the 'nullval'
+parameter.  If nullval = 0, then no checks for undefined pixels will be
+performed, thus increasing the speed of the program.  The second set of
+routines (ffgcf) returns the data element array and in addition a
+logical array of flags which defines whether the corresponding data
+pixel is undefined.  See Appendix B for the definition of the
+parameters used in these routines.
+
+    Any column, regardless of it's intrinsic data type, may be read as a
+    string.  It should be noted however that reading a numeric column as
+    a string is 10 - 100 times slower than reading the same column as a number
+    due to the large overhead in constructing the formatted strings.
+    The display format of the returned strings will be
     determined by the TDISPn keyword, if it exists, otherwise by the
-    datatype of the column.  The length of the returned strings (not
+    data type of the column.  The length of the returned strings (not
     including the null terminating character) can be determined with
     the fits\_get\_col\_display\_width routine.  The following TDISPn
     display formats are currently supported:
 -
-
     Iw.m   Integer
     Ow.m   Octal integer
     Zw.m   Hexadecimal integer
@@ -4495,2240 +5155,2284 @@ for the further definitions of the parameters used in these routines.
     Dw.d   Exponential floating point
     Gw.d   General; uses Fw.d if significance not lost, else Ew.d
 -
-    where w is the width in characters of the displayed values, m is the minimum
-    number of digits displayed, and d is the number of digits to the right of the 
-    decimal.  The .m field is optional.
->   \label{ffgcv}
--
-  int fits_read_col / ffgcv
-      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
-       long nelements, DTYPE *nulval, DTYPE *array, int *anynul, int *status)
--
->5  Read elements from an ASCII or binary table column.  The datatype
-    parameter specifies the datatype of the and `array'  pointer;
-    Any undefined elements will have the corresponding nullarray element set
->   to TRUE. \label{ffgcf}
+    where w is the width in characters of the displayed values, m is
+    the minimum number of digits displayed, and d is the number of
+    digits to the right of the decimal.  The .m field is optional.
+
+>1  Read elements from an ASCII or binary table column (in the CDU).  These
+    routines return the values of the table column array elements.  Undefined
+    array elements will be returned with a value = nulval, unless nulval = 0
+    (or = ' ' for ffgcvs) in which case no checking for undefined values will
+    be performed. The ANYF parameter is set to true if any of the returned
+>   elements are undefined. \label{ffgcvx}
+- 
+  int fits_read_col_str / ffgcvs
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, char *nulstr, > char **array, int *anynul,
+       int *status)
+ 
+  int fits_read_col_[log,byt,sht,usht,int,uint,lng,ulng, lnglng, flt, dbl, cmp, dblcmp] /
+      ffgcv[l,b,i,ui,k,uk,j,uj,jj,e,d,c,m]
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, DTYPE nulval, > DTYPE *array, int *anynul,
+       int *status)
 -
-  int fits_read_colnull / ffgcf
-      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
-      long nelements, DTYPE *array, char *nullarray, int *anynul, int *status)
+>2  Read elements and null flags from an ASCII or binary table column (in the
+    CHDU).  These routines return the values of the table column array elements.
+    Any undefined array elements will have the corresponding nullarray element
+    set equal to TRUE.  The anynul parameter is set to true if any of the
+>   returned elements are undefined. \label{ffgcfx}
 -
+  int fits_read_colnull_str / ffgcfs
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, > char **array, char *nullarray, int *anynul,
+       int *status)
 
-**G.  Celestial Coordinate System Routines \label{FFGICS}
-
-Two complimentary sets of routines are provided for calculating the
-transformation between pixel location in an image and the the
-corresponding celestial coordinates on the sky.  These routines rely on
-a set of standard World Coordinate System (WCS) keywords in the header
-of the HDU which define the parameters to be used when calculating the
-coordinate transformation.
-
-Both sets of routines require that a 2 step procedure be followed:
-first an initialization routine must be called to read the relevent WCS
-keywords in the header.  These parameters are then passed to a pair of
-routines that convert from pixel to sky coordinates, or from sky to
-pixel coordinates.  See Appendix B for the definition of the
-parameters used in these routines.
-
-The first set of routines described below have the advantage that they
-are completely self-contained within the CFITSIO library and thus are
-guaranteed to be available on the system.  These routines  only support
-the most common types of map projections and WCS keyword conventions
-however.
-
-The second set of routines are available in a WCS library written by
-Doug Mink at SAO.  These routines are more powerful than the ones
-contained in CFITSIO itself because they support all the defined WCS
-map projections and they  support a number of non-standard keyword
-conventions that have been adopted over the years by various different
-observatories.  To use these routines, however, requires that a
-separate WCS library be built and installed on the system in addition
-to CFITSIO.        
-
-***1.   Self-contained WCS Routines
-
-The following routines are included in the CFITSIO library to help
-calculate the transformation between pixel location in an image and the
-corresponding celestial coordinates on the sky.  These support the
-following standard map projections:  -SIN, -TAN, -ARC, -NCP, -GLS,
-  -MER, and -AIT (these are the legal values for the coordtype
-parameter).  These routines are based on similar functions in Classic
-AIPS.  All the angular quantities are given in units of degrees.
-
->1  Get the values of all the standard FITS celestial coordinate system
-    keywords from the header of a FITS image (i.e., the primary array or
-    an image extension).  These values may then be passed to the routines
-    that perform the coordinate transformations.  If any or all of the WCS 
-    keywords are not present, then default values will be returned. If
-    the first coordinate axis is the declination-like coordinate, then
-    this routine will swap them so that the longitudinal-like coordinate
-    is returned as the first axis.
-
-    If the file uses the newer 'CDj\_i' WCS transformation matrix
-    keywords instead of old style 'CDELTn' and 'CROTA2' keywords, then
-    this routine will calculate and return the values of the equivalent
-    old-style keywords.  Note that the conversion from the new-style
-    keywords to the old-style values is sometimes only an
-    approximation, so if the approximation is larger than an internally
-    defined threshold level, then CFITSIO will still return the
-    approximate WCS keyword values, but will also return with status =
-    APPROX\_WCS\_KEY, to warn the calling program that approximations
-    have been made.  It is then up to the calling program to decide
-    whether the approximations are sufficiently accurate for the
-    particular application, or whether more precise WCS transformations
->   must be performed using new-style WCS keywords directly. \label{ffgics}
+  int fits_read_colnull_[log,byt,sht,usht,int,uint,lng,ulng,lnglng,flt,dbl,cmp,dblcmp] /
+      ffgcf[l,b,i,ui,k,uk,j,uj,jj,e,d,c,m]
+      (fitsfile *fptr, int colnum, long firstrow, 
+       long firstelem, long nelements, > DTYPE *array,
+       char *nullarray, int *anynul, int *status)
 -
-  int fits_read_img_coord / ffgics
-      (fitsfile *fptr, > double *xrefval, double *yrefval, 
-       double *xrefpix, double *yrefpix, double *xinc, double *yinc,
-       double *rot, char *coordtype, int *status)
+>3  Read an arbitrary data subsection from an N-dimensional array
+    in a binary table vector column.  Undefined pixels
+    in the array will be set equal to the value of 'nulval',
+    unless nulval=0 in which case no testing for undefined pixels will
+    be performed.  The first and last rows in the table to be read
+    are specified by fpixel(naxis+1) and lpixel(naxis+1), and hence
+    are treated as the next higher dimension of the FITS N-dimensional
+    array.  The INC parameter specifies the sampling interval in
+>   each dimension between the data elements that will be returned. \label{ffgsvx2}
 -
->2  Get the values of all the standard FITS celestial coordinate system
-    keywords from the header of a FITS table where the X and Y (or RA and
-    DEC coordinates are stored in 2 separate columns of the table.
-    These values may then be passed to the routines that perform the
->   coordinate transformations. \label{ffgtcs}
+  int fits_read_subset_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffgsv[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, int colnum, int naxis, long *naxes, long *fpixel,
+       long *lpixel, long *inc, DTYPE nulval, > DTYPE *array, int *anynul,
+       int *status)
 -
-  int fits_read_tbl_coord / ffgtcs
-      (fitsfile *fptr, int xcol, int ycol, > double *xrefval,
-       double *yrefval, double *xrefpix, double *yrefpix, double *xinc,
-       double *yinc, double *rot, char *coordtype, int *status)
+>4  Read an arbitrary data subsection from an N-dimensional array
+    in a binary table vector column.  Any Undefined
+    pixels in the array will have the corresponding 'nullarray'
+    element set equal to TRUE.  The first and last rows in the table
+    to be read are specified by fpixel(naxis+1) and lpixel(naxis+1),
+    and hence are treated as the next higher dimension of the FITS
+    N-dimensional array.  The INC parameter specifies the sampling
+    interval in each dimension between the data elements that will be
+>   returned. \label{ffgsfx2}
 -
->3   Calculate the celestial coordinate corresponding to the input
->    X and Y pixel location in the image. \label{ffwldp}
+  int fits_read_subsetnull_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffgsf[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, int colnum, int naxis, long *naxes, 
+       long *fpixel, long *lpixel, long *inc, > DTYPE *array, 
+       char *nullarray, int *anynul, int *status)
 -
-  int fits_pix_to_world / ffwldp
-      (double xpix, double ypix, double xrefval, double yrefval,
-       double xrefpix, double yrefpix, double xinc, double yinc,
-       double rot, char *coordtype, > double *xpos, double *ypos,
-       int *status)
+>5  Read bit values from a byte ('B') or bit (`X`) table column (in the
+    CDU).  Larray is an array of logical values corresponding to the
+    sequence of bits to be read.  If larray is true then the
+    corresponding bit was set to 1, otherwise the bit was set to 0.
+    The 'X' column in a FITS table is always padded out to a multiple
+    of 8 bits where the bit array starts with the most significant bit
+    of the byte and works down towards the 1's bit.  For example, a
+    '4X' array, with the first bit = 1 and the remaining 3 bits = 0 is
+    equivalent to the 8-bit unsigned byte value of 128. 
+    Note that in the case of 'X' columns, CFITSIO can read  all 8 bits
+    of each byte whether they are formally valid or not.  Thus if the
+    column is defined as '4X', and one calls ffgcx with  firstbit=1 and
+    nbits=8, then all 8 bits will be read from the first byte (as
+    opposed to reading the first 4 bits from the first row and then the
+    first 4 bits from the next row), even though the last 4 bits of
+    each byte are formally not defined.  It should also be noted that
+    it is more efficient to read 'X' columns an entire byte at a time,
+    instead of bit by bit.  Any of the CFITSIO routines that read 
+    columns (e.g. fits\_read\_col\_byt) may be used for this
+    purpose.  These routines will interpret 'X' columns as though they
+    were 'B' columns (e.g.,  '8X' is equivalent to '1B', and '16X' is
+>   equivalent to '2B').  \label{ffgcx}
 -
->4   Calculate the X and Y pixel location corresponding to the input
->    celestial coordinate in the image. \label{ffxypx}
+  int fits_read_col_bit / ffgcx
+      (fitsfile *fptr, int colnum, long firstrow, long firstbit, 
+       long nbits, > char *larray, int *status)
 -
-  int fits_world_to_pix / ffxypx
-      (double xpos, double ypos, double xrefval, double yrefval, 
-       double xrefpix, double yrefpix, double xinc, double yinc,
-       double rot, char *coordtype, double *xpix, double *ypix,
-       int *status)
+>6  Read any consecutive set of bits from an 'X' or 'B' column and
+    interpret them as an unsigned n-bit integer.  nbits must be less
+    than 16 or 32 in ffgcxui and ffgcxuk, respectively.  If nrows
+    is greater than 1, then the same set of bits will be read from
+    each row, starting with firstrow. The bits are numbered with
+    1 = the most significant bit of the first element of the column.
+>   \label{ffgcxui}
+-
+  int fits_read_col_bit_[usht, uint] / ffgcx[ui,uk]
+      (fitsfile *fptr, int colnum, long firstrow, long, nrows,
+       long firstbit, long nbits, > DTYPE *array, int *status)
+-
+>7  Return the descriptor for a variable length column in a binary table.
+    The descriptor consists of 2 integer parameters: the number of elements
+    in the array and the starting offset relative to the start of the heap.
+    The first routine returns a single descriptor whereas the second routine
+    returns the descriptors for a range of rows in the table.
+>   \label{ffgdes}
 -
+  int fits_read_descript / ffgdes
+      (fitsfile *fptr, int colnum, long rownum, > long *repeat,
+           long *offset, int *status)
 
-***2.  WCS Routines that require the WCS library
+  int fits_read_descripts / ffgdess
+      (fitsfile *fptr, int colnum, long firstrow, long nrows > long *repeat,
+           long *offset, int *status)
+-
 
-The routines described in this section use the WCS library written
-by Doug Mink at SAO.  This library is available at
+*X.   Extended File Name Syntax
 
--
-http://tdc-www.harvard.edu/software/wcstools/    and
-http://tdc-www.harvard.edu/software/wcstools/wcs.html
--
+**A.  Overview
 
-You do not need the entire WCSTools package to use the routines
-described here.  Instead, you only need to install the World Coordinate
-System Subroutine library.  It is available from the
-ftp site as a gzipped .tar file (e.g., wcssubs-2.5.tar.gz) or as a
-zipped file (e.g., wcssub25.zip).  Any questions about using this
-library should be sent to the author at dmink@cfa.harvard.edu.
+CFITSIO supports an extended syntax when specifying the name of the
+data file to be opened or created  that includes the following
+features:
 
-The advantage of using the WCS library instead of the self-contained WCS
-routines decribed in the previous section is that they provide support
-for all currently defined projection geometries, and they also support
-most standard as well as many non-standard WCS keyword conventions that
-have been used by different observatories in the past.  This library is
-also actively maintained so it is likely that it will support
-any new FITS WCS keyword conventions that are adopted in the
-future. 
+\begin{itemize}
+\item
+CFITSIO can read IRAF format images which have header file names that
+end with the '.imh' extension, as well as reading and writing FITS
+files,   This feature is implemented in CFITSIO by first converting the
+IRAF image into a temporary FITS format file in memory, then opening
+the FITS file.  Any of the usual CFITSIO routines then may be used to
+read the image header or data.  Similarly, raw binary data arrays can
+be read by converting them on the fly into virtual FITS images.
 
-The first 3 routines described below are CFITSIO routines that create a
-character string array containing all the WCS keywords that are needed
-as input to the WCS library 'wcsinit' routine.  These 3 routines
-provide a convenient interface for calling the WCS library routines
-from CFITSIO, but do not actually call any routines in the WCS library
-themselves.
+\item
+FITS files on the internet can be read (and sometimes written) using the FTP,
+HTTP, or ROOT protocols.
 
->1   Copy all the WCS-related keywords from the header of the primary
-array or an image extension into a single long character string array.  The
-80-char header keywords are simply concatinated one after the other in
-the returned string.  The character array is dynamically allocated and must be
-freed by the calling program when it is no longer needed.  In the current
->implementation, all the header keywords are copied into the array.
+\item
+FITS files can be piped between tasks on the stdin and stdout streams.
 
--
-  int fits_get_image_wcs_keys / ffgiwcs
-      (fitsfile *fptr, char **header, int *status)
--
+\item
+FITS files can be read and written in shared memory.  This can
+potentially achieve better data I/O performance compared to reading and
+writing the same FITS files on magnetic disk.
 
->2    Copy all the WCS-related keywords for a given pair of columns in
-a table extension into a single long character string array. The pair
-of columns must contain a list of the X and Y coordinates of each event
-in the image (i.e., this is an image in pixel-list or event-list
-format).  The names of the WCS keywords in the table header are
-translated into the keywords that would correspond to an image HDU
-(e.g., TCRPXn for the X column becomes the CRPIX1 keyword).  The
-80-char header keywords are simply concatinated one after the other in
-the string. The character array is dynamically allocated and must be
-> freed by the calling program when it is no longer needed.
+\item
+Compressed FITS files in gzip or Unix COMPRESS format can be directly read.
 
-- 
-  int fits_get_table_wcs_keys / ffgtwcs
-      (fitsfile *fptr, int xcol, int ycol, char **header, int *status) 
--
+\item
+Output FITS files can be written directly in compressed gzip format,
+thus saving disk space.
 
->3    Copy all the WCS-related keywords for an image that is contained
-in a single vector cell of a binary table extension into a single long
-character string array. In this type of image format, the table column
-is a 2-dimensional vector and each row of the table contains an image.
-The names of the WCS keywords in the table header are translated into
-the keywords corresponding to an image (e.g., 1CRPn becomes the CRPIX1
-keyword).  The 80-char header keywords are simply concatinated one
-after the other in the string. The character array is dynamically
-allocated and must be freed by the calling program when it is no longer
-> needed.
+\item
+FITS table columns can be created, modified, or deleted 'on-the-fly' as
+the table is opened by CFITSIO.  This creates a virtual FITS file containing
+the modifications that is then opened by the application program.
 
--
-  int fits_get_imagecell_wcs_keys / ffgicwcs
-      (fitsfile *fptr, int column, long row, char **header, int *status)
--
+\item
+Table rows may be selected, or filtered out, on the fly when the table
+is opened by CFITSIO, based on an user-specified expression.
+Only rows for which the expression evaluates to 'TRUE' are retained
+in the copy of the table that is opened by the application program.
 
->4   This WCS library routine returns a pointer to a structure that
-contains all the WCS parameters extracted from the input header
-keywords.  The input  header keyword string can be produced by any of
-the 3 previous routines.  The returned WorldCoor structure is used as
-input to the next 2 WCS library routines that convert between sky
-coordinates and pixel coordinates.  This routine dynamically allocates
-the WorldCoor structure, so it must be freed by calling the wcsfree
-> routine when it is no longer needed.
+\item
+Histogram images may be created on the fly by binning the values in
+table columns, resulting in a virtual N-dimensional FITS image.  The
+application program then only sees the FITS image (in the primary
+array) instead of the original FITS table.
+\end{itemize}
 
--
-  struct WorldCoor *wcsinit (char *header)
--
+The latter 3 table filtering features in particular add very powerful
+data processing capabilities directly into CFITSIO, and hence into
+every task that uses CFITSIO to read or write FITS files.  For example,
+these features transform a very simple program that just copies an
+input FITS file to a new output file (like the `fitscopy' program that
+is distributed with CFITSIO) into a multipurpose FITS file processing
+tool.  By appending fairly simple qualifiers onto the name of the input
+FITS file, the user can perform quite complex table editing operations
+(e.g., create new columns, or filter out rows in a table) or create
+FITS images by binning or histogramming the values in table columns.
+In addition, these functions have been coded using new state-of-the art
+algorithms that are, in some cases, 10 - 100 times faster than previous
+widely used implementations.
 
->5   Calculate the sky coordinate corresponding to the input pixel
-coordinate using the conversion parameters defined in the wcs
->structure.  This is a WCS library routine.
+Before describing the complete syntax for the extended FITS file names
+in the next section, here are a few examples of FITS file names that
+give a quick overview of the allowed syntax:
 
--
-  void pix2wcs (struct WorldCoor *wcs, double xpix, double ypix, 
-        > double *xpos, double *ypos)
--
+\begin{itemize}
+\item
+{\tt myfile.fits}: the simplest case of a FITS file on disk in the current
+directory.
 
->6  Calculate the pixel coordinate corresponding to the input sky coordinate
-using the conversion parameters defined in the wcs structure.  The returned
-offscale parameter equals 0 if the coordinate is within bounds of the image.
-> This is a WCS library routine.
+\item
+{\tt myfile.imh}: opens an IRAF format image file and converts it on the
+fly into a temporary FITS format image in memory which can then be read with
+any other CFITSIO routine.
 
--
-  void wcs2pix (struct WorldCoor *wcs, double xpos, double ypos, 
-       > double *xpix, double *ypix, int *offscale)
--
+\item
+{\tt rawfile.dat[i512,512]}: opens a raw binary data array (a 512 x 512
+short integer array in this case) and converts it on the fly into a
+temporary FITS format image in memory which can then be read with any
+other CFITSIO routine.
 
->7   Free the WCS structure that was created by wcsinit.  This is a WCS 
->    library routine.
--
-  void wcsfree(struct WorldCoor *wcs)
--
+\item
+{\tt myfile.fits.gz}: if this is the name of a new output file, the '.gz'
+suffix will cause it to be compressed in gzip format when it is written to 
+disk.
 
-**H.  Hierarchical Grouping Convention Support Routines
+\item
+{\tt myfile.fits.gz[events, 2]}:  opens and uncompresses the gzipped file
+myfile.fits then moves to the extension with the keywords EXTNAME
+= 'EVENTS' and EXTVER = 2.
 
-These functions allow for the creation and manipulation of FITS HDU Groups,
-as defined in "A Hierarchical Grouping Convention for FITS" by Jennings, 
-Pence, Folk and Schlesinger 
-( http: //adfwww.gsfc.nasa.gov/other/convert/group.html ). A group is a
-collection of HDUs whose association is defined by a {\it grouping table}. 
-HDUs which are part of a group are referred to as {\it member HDUs} or
-simply as {\it members}. Grouping table member HDUs may themselves be
-grouping tables, thus allowing for the construction of open-ended
-hierarchies of HDUs.
+\item
+{\tt -}:  a dash (minus sign) signifies that the input file is to be read
+from the stdin file stream, or that the output file is to be written to
+the stdout stream. 
 
-Grouping tables contain one row for each member HDU. The grouping table columns
-provide identification information that allows applications to reference or
-"point to" the member HDUs. Member HDUs are expected, but not required, to
-contain a set of GRPIDn/GRPLCn keywords in their headers for each grouping
-table that they are referenced by. In this sense, the GRPIDn/GRPLCn keywords
-"link" the member HDU back to its Grouping table. Note that a member HDU need
-not reside in the same FITS file as its grouping table, and that a given
-HDU may be referenced by up to 999 grouping tables simultaneously.
+\item
+{\tt ftp://legacy.gsfc.nasa.gov/test/vela.fits}:  FITS files in any ftp
+archive site on the internet may be directly opened with read-only
+access.
 
-Grouping tables are implemented as FITS binary tables with up to six 
-pre-defined column TTYPEn values: 'MEMBER\_XTENSION', 'MEMBER\_NAME', 
-'MEMBER\_VERSION', 'MEMBER\_POSITION', 'MEMBER\_URI\_TYPE' and 'MEMBER\_LOCATION'. 
-The first three columns allow member HDUs to be identified by reference to
-their XTENSION, EXTNAME and EXTVER keyword values. The fourth column allows
-member HDUs to be identified by HDU position within their FITS file.
-The last two columns identify the FITS file in which the member HDU resides,
-if different from the grouping table FITS file.
+\item
+{\tt http://legacy.gsfc.nasa.gov/software/test.fits}: any valid URL to a
+FITS file on the Web may be opened with read-only access.
 
-Additional user defined "auxiliary" columns may also be included with any 
-grouping table. When a grouping table is copied or modified the presence of 
-auxiliary columns is always taken into account by the grouping support 
-functions; however, the grouping support functions cannot directly
-make use of this data.
+\item
+{\tt root://legacy.gsfc.nasa.gov/test/vela.fits}: similar to ftp access
+except that it provides write as well as read access to the files
+across the network. This uses the root protocol developed at CERN.
 
-If a grouping table column is defined but the corresponding member HDU 
-information is unavailable then a null value of the appropriate data type
-is inserted in the column field. Integer columns (MEMBER\_POSITION, 
-MEMBER\_VERSION) are defined with a TNULLn value of zero (0). Character field
-columns (MEMBER\_XTENSION, MEMBER\_NAME, MEMBER\_URI\_TYPE, MEMBER\_LOCATION) 
-utilize an ASCII null character to denote a null field value.
+\item
+{\tt shmem://h2[events]}: opens the FITS file in a shared memory segment and
+moves to the EVENTS extension.  
 
-The grouping support functions belong to two basic categories: those that
-work with grouping table HDUs (ffgt**) and those that work with member HDUs
-(ffgm**). Two functions, fits\_copy\_group() and fits\_remove\_group(), have the
-option to recursively copy/delete entire groups. Care should be taken when
-employing these functions in recursive mode as poorly defined groups could
-cause unpredictable results. The problem of a grouping table directly or 
-indirectly referencing itself (thus creating an infinite loop) is protected 
-against; in fact, neither function will attempt to copy or delete an HDU
-twice.
+\item
+{\tt mem://}:  creates a scratch output file in core computer memory.  The
+resulting 'file' will disappear when the program exits, so this
+is mainly useful for testing purposes when one does not want a
+permanent copy of the output file.
 
->1 Create (append) a grouping table at the end of the current FITS file 
-   pointed to by fptr. The grpname parameter provides the grouping table
-   name (GRPNAME keyword value) and may be set to NULL if no group name
-   is to be specified. The grouptype parameter specifies the desired 
-   structure of the grouping table and may take on the values: 
-   GT\_ID\_ALL\_URI (all columns created), GT\_ID\_REF (ID by reference columns),
-   GT\_ID\_POS (ID by position columns), GT\_ID\_ALL (ID by reference and 
-   position columns), GT\_ID\_REF\_URI (ID by reference and FITS file URI 
->  columns), and GT\_ID\_POS\_URI (ID by position and FITS file URI columns). \label{ffgtcr}
+\item
+{\tt myfile.fits[3; Images(10)]}: opens a copy of the image contained in the
+10th row of the 'Images' column in the binary table in the 3th extension
+of the FITS file.  The virtual file that is opened by the application just
+contains this single image in the primary array.
+
+\item
+{\tt myfile.fits[1:512:2, 1:512:2]}: opens a section of the input image
+ranging from the 1st to the 512th pixel in  X and Y, and selects every 
+second pixel in both dimensions, resulting in a 256 x 256 pixel input image 
+in this case.
+
+\item
+{\tt myfile.fits[EVENTS][col Rad = sqrt(X**2 + Y**2)]}:  creates and opens
+a virtual file on the fly that is identical to
+myfile.fits except that it will contain a new column in the EVENTS
+extension called 'Rad' whose value is computed using the indicated
+expression which is a function of the values in the X and Y columns.
+
+\item
+{\tt myfile.fits[EVENTS][PHA > 5]}:  creates and opens a virtual FITS
+files that is identical to 'myfile.fits' except that the EVENTS table
+will only contain the rows that have values of the PHA column greater
+than 5.  In general, any arbitrary boolean expression using a C or
+Fortran-like syntax, which may combine AND and OR operators,
+may be used to select rows from a table.
+
+\item
+{\tt myfile.fits[EVENTS][bin (X,Y)=1,2048,4]}:  creates a temporary FITS
+primary array image which is computed on the fly by binning (i.e,
+computing the 2-dimensional histogram) of the values in the X and Y
+columns of the EVENTS extension.  In this case the X and Y coordinates
+range from 1 to 2048 and the image pixel size is 4 units in both
+dimensions, so the resulting image is 512 x 512 pixels in size.
+
+\item
+The final example combines many of these feature into one complex
+expression (it is broken into several lines for clarity):
 -
-  int fits_create_group / ffgtcr 
-      (fitsfile *fptr, char *grpname, int grouptype, > int *status)
+   ftp://legacy.gsfc.nasa.gov/data/sample.fits.gz[EVENTS]
+   [col phacorr = pha * 1.1 - 0.3][phacorr >= 5.0 && phacorr <= 14.0]
+   [bin (X,Y)=32] 
 -
->2 Create (insert) a grouping table just after the CHDU of the current FITS 
-   file pointed to by fptr. All HDUs below the the insertion point will be
-   shifted downwards to make room for the new HDU. The grpname parameter 
-   provides the grouping table name (GRPNAME keyword value) and may be set to 
-   NULL if no group name is to be specified. The grouptype parameter specifies
-   the desired structure of the grouping table and may take on the values: 
-   GT\_ID\_ALL\_URI (all columns created), GT\_ID\_REF (ID by reference columns),
-   GT\_ID\_POS (ID by position columns), GT\_ID\_ALL (ID by reference and 
-   position columns), GT\_ID\_REF\_URI (ID by reference and FITS file URI 
->  columns), and GT\_ID\_POS\_URI (ID by position and FITS file URI columns) \label{ffgtis}.
+In this case, CFITSIO (1) copies and uncompresses the FITS file from
+the ftp site on the legacy machine, (2) moves to the 'EVENTS'
+extension, (3) calculates a new column called 'phacorr', (4) selects
+the rows in the table that have phacorr in the range 5 to 14, and
+finally (5) bins the remaining rows on the X and Y column coordinates,
+using a pixel size = 32 to create a 2D image.  All this processing is
+completely transparent to the application program, which simply sees
+the final 2-D image in the primary array of the opened file.
+\end{itemize}
+
+The full extended CFITSIO FITS file name can contain several different
+components depending on the context.  These components are described in
+the following sections:
 -
-  int fits_insert_group / ffgtis 
-      (fitsfile *fptr, char *grpname, int grouptype, > int *status)
+When creating a new file:
+   filetype://BaseFilename(templateName)[compress]
+
+When opening an existing primary array or image HDU:
+   filetype://BaseFilename(outName)[HDUlocation][ImageSection]
+
+When opening an existing table HDU:
+   filetype://BaseFilename(outName)[HDUlocation][colFilter][rowFilter][binSpec]
 -
->3 Change the structure of an existing grouping table pointed to by
-   gfptr. The grouptype parameter (see fits\_create\_group() for valid
-   parameter values) specifies the new structure of the grouping table. This
-   function only adds or removes grouping table columns, it does not add
-   or delete group members (i.e., table rows). If the grouping table already
-   has the desired structure then no operations are performed and function   
-   simply returns with a (0) success status code. If the requested structure
-   change creates new grouping table columns, then the column values for all
-   existing members will be filled with the null values appropriate to the
->  column type. \label{ffgtch}
+The filetype, BaseFilename, outName, HDUlocation, and ImageSection
+components, if present, must be given in that order, but the colFilter,
+rowFilter, and binSpec specifiers may follow in any order.  Regardless
+of the order, however, the colFilter specifier, if present, will be
+processed first by CFITSIO, followed by the rowFilter specifier, and
+finally by the binSpec specifier.
+
+**A.  Filetype
+
+The type of file determines the medium on which the file is located
+(e.g., disk or network) and, hence, which internal device driver is used by
+CFITSIO to read and/or write the file.  Currently supported types are
 -
-  int fits_change_group / ffgtch 
-      (fitsfile *gfptr, int grouptype, > int *status)
+        file://  - file on local magnetic disk (default)
+        ftp://   - a readonly file accessed with the anonymous FTP protocol.
+                   It also supports  ftp://username:password@hostname/...
+                   for accessing password-protected ftp sites.
+        http://  - a readonly file accessed with the HTTP protocol.  It
+                   does not  support username:password like the ftp driver.
+                   Proxy HTTP survers are supported using the http_proxy
+                   environment variable.
+        root://  - uses the CERN root protocol for writing as well as
+                   reading files over the network.
+        shmem:// - opens or creates a file which persists in the computer's
+                   shared memory.
+        mem://   - opens a temporary file in core memory.  The file 
+                   disappears when the program exits so this is mainly
+                   useful for test purposes when a permanent output file
+                   is not desired.
 -
->4 Remove the group defined by the grouping table pointed to by gfptr, and 
-   optionally all the group member HDUs. The rmopt parameter specifies the 
-   action to be taken for
-   all members of the group defined by the grouping table. Valid values are:
-   OPT\_RM\_GPT (delete only the grouping table) and OPT\_RM\_ALL (recursively
-   delete all HDUs that belong to the group). Any groups containing the 
-   grouping table gfptr as a member are updated, and if rmopt == OPT\_RM\_GPT 
-   all members have their GRPIDn and GRPLCn  keywords updated accordingly. 
-   If rmopt == OPT\_RM\_ALL, then other groups that contain the deleted members
->  of gfptr are updated to reflect the deletion accordingly. \label{ffgtrm}
+If the filetype is not specified, then type file:// is assumed.
+The double slashes '//' are optional and may be omitted in most cases.
+
+***1.  Notes about HTTP proxy servers
+
+A proxy HTTP server may be used by defining the address (URL) and port 
+number of the proxy server with the http\_proxy environment variable.
+For example
 -
-  int fits_remove_group / ffgtrm 
-      (fitsfile *gfptr, int rmopt, > int *status)
+    setenv http_proxy http://heasarc.gsfc.nasa.gov:3128
 -
->5 Copy (append) the group defined by the grouping table pointed to by infptr,
-   and optionally all group member HDUs, to the FITS file pointed to by 
-   outfptr. The cpopt parameter specifies the action to be taken for all 
-   members of the group infptr. Valid values are: OPT\_GCP\_GPT (copy only 
-   the grouping table) and OPT\_GCP\_ALL (recursively copy ALL the HDUs that 
-   belong to the group defined by infptr). If the cpopt == OPT\_GCP\_GPT then 
-   the members of infptr have their GRPIDn and GRPLCn keywords updated to 
-   reflect the existence of the new grouping table outfptr, since they now 
-   belong to the new group. If cpopt == OPT\_GCP\_ALL then the new 
-   grouping table outfptr only contains pointers to the copied member HDUs
-   and not the original member HDUs of infptr. Note that, when 
-   cpopt == OPT\_GCP\_ALL, all members of the group defined by infptr will be
-   copied to a single FITS file pointed to by outfptr regardless of their 
->  file distribution in the original group.  \label{ffgtcp}
+will cause CFITSIO to use port 3128 on the heasarc proxy server whenever
+reading a FITS file with HTTP.
+
+***2.  Notes about the root filetype
+
+The original rootd server can be obtained from: 
+\verb-ftp://root.cern.ch/root/rootd.tar.gz-
+but, for it to work correctly with CFITSIO one has to use a modified
+version which supports a command to return the length of the file. 
+This modified version is available in rootd subdirectory
+in the CFITSIO ftp area at
 -
-  int fits_copy_group / ffgtcp 
-      (fitsfile *infptr, fitsfile *outfptr, int cpopt, > int *status)
+      ftp://legacy.gsfc.nasa.gov/software/fitsio/c/root/rootd.tar.gz.  
 -
->6  Merge the two groups defined by the grouping table HDUs infptr and outfptr
-    by combining their members into a single grouping table. All member HDUs
-    (rows) are copied from infptr to outfptr. If mgopt == OPT\_MRG\_COPY then
-    infptr continues to exist unaltered after the merge. If the mgopt ==
-    OPT\_MRG\_MOV then infptr is deleted after the merge. In both cases,
->   the GRPIDn and GRPLCn keywords of the member HDUs are updated accordingly. \label{ffgtmg}
+
+This small server is started either by inetd when a client requests a
+connection to a rootd server or by hand (i.e. from the command line).
+The rootd server works with the ROOT TNetFile class. It allows remote
+access to ROOT database files in either read or write mode. By default
+TNetFile assumes port 432 (which requires rootd to be started as root).
+To run rootd via inetd add the following line to /etc/services:
+-                                                                          
+  rootd     432/tcp                                                    
+-                                                                    
+and to /etc/inetd.conf, add the following line: 
 -
-  int fits_merge_groups / ffgtmg 
-      (fitsfile *infptr, fitsfile *outfptr, int mgopt, > int *status)
+  rootd stream tcp nowait root /user/rdm/root/bin/rootd rootd -i       
+-                                                                    
+Force inetd to reread its conf file with \verb+kill -HUP <pid inetd>+.    
+You can also start rootd by hand running directly under your private 
+account (no root system privileges needed). For example to start     
+rootd listening on port 5151 just type:   \verb+rootd -p 5151+  
+Notice that no \& is needed. Rootd will go into background by itself.       
 -
->7 "Compact" the group defined by grouping table pointed to by gfptr. The 
-   compaction is achieved by merging (via fits\_merge\_groups()) all direct 
-   member HDUs of gfptr that are themselves grouping tables. The cmopt 
-   parameter defines whether the merged grouping table HDUs remain after 
-   merging (cmopt == OPT\_CMT\_MBR) or if they are deleted after merging 
-   (cmopt == OPT\_CMT\_MBR\_DEL). If the grouping table contains no direct
-   member HDUs that are themselves grouping tables then this function 
-   does nothing. Note that this function is not recursive, i.e., only the 
->  direct member HDUs of gfptr are considered for merging. \label{ffgtcm}
+  Rootd arguments:                                                     
+    -i                says we were started by inetd                    
+    -p port#          specifies a different port to listen on          
+    -d level          level of debug info written to syslog            
+                      0 = no debug (default)                           
+                      1 = minimum                                      
+                      2 = medium                                       
+                      3 = maximum                                      
 -
-  int fits_compact_group / ffgtcm 
-      (fitsfile *gfptr, int cmopt, > int *status)
+Rootd can also be configured for anonymous usage (like anonymous ftp).
+To setup rootd to accept anonymous logins do the following (while being
+logged in as root):                                  
 -
->8 Verify the integrity of the grouping table pointed to by gfptr to make 
-   sure that all group members are accessible and that all links to other 
-   grouping tables are valid. The firstfailed parameter returns the member 
-   ID (row number) of the first member HDU to fail verification (if positive 
-   value) or the first group link to fail (if negative value). If gfptr is 
->  successfully verified then firstfailed contains a return value of 0. \label{ffgtvf}
+   - Add the following line to /etc/passwd:                             
+                                                                     
+     rootd:*:71:72:Anonymous rootd:/var/spool/rootd:/bin/false          
+                                                                     
+     where you may modify the uid, gid (71, 72) and the home directory  
+     to suite your system.                                              
+                                                                     
+   - Add the following line to /etc/group:                              
+                                                                     
+     rootd:*:72:rootd                                                   
+                                                                     
+     where the gid must match the gid in /etc/passwd.                   
+                                                                     
+   - Create the directories:                                            
+                                                                     
+     mkdir /var/spool/rootd                                             
+     mkdir /var/spool/rootd/tmp                                         
+     chmod 777 /var/spool/rootd/tmp                                     
+                                                                     
+     Where /var/spool/rootd must match the rootd home directory as      
+     specified in the rootd /etc/passwd entry.                          
+                                                                     
+   - To make writeable directories for anonymous do, for example:       
+                                                                     
+     mkdir /var/spool/rootd/pub                                         
+     chown rootd:rootd /var/spool/rootd/pub                             
 -
-  int fits_verify_group / ffgtvf 
-      (fitsfile *gfptr, > long *firstfailed, int *status)
+That's all.  Several additional remarks:  you can login to an anonymous
+server either with the names "anonymous" or "rootd".  The password should
+be of type user@host.do.main. Only the @ is enforced for the time
+being.  In anonymous mode the top of the file tree is set to the rootd
+home directory, therefore only files below the home directory can be
+accessed.  Anonymous mode only works when the server is started via
+inetd.
+                                                        
+***3.  Notes about the shmem filetype:
+
+Shared memory files are currently supported on most Unix platforms,
+where the shared memory segments are managed by the operating system
+kernel and `live' independently of processes. They are not deleted (by
+default) when the process which created them terminates, although they
+will disappear if the system is rebooted.  Applications can create
+shared memory files in CFITSIO by calling:
 -
->9  Open a grouping table that contains the member HDU pointed to by mfptr. 
-    The grouping table to open is defined by the grpid parameter, which 
-    contains the keyword index value of the GRPIDn/GRPLCn keyword(s) that 
-    link the member HDU mfptr to the grouping table. If the grouping table 
-    resides in a file other than the member HDUs file then an attempt is 
-    first made to open the file readwrite, and failing that readonly. A 
-    pointer to the opened grouping table HDU is returned in gfptr.
- 
-    Note that it is possible, although unlikely and undesirable, for the 
-    GRPIDn/GRPLCn keywords in a member HDU header to be non-continuous, e.g., 
-    GRPID1, GRPID2, GRPID5, GRPID6. In such cases, the grpid index value 
-    specified in the function call shall identify the (grpid)th GRPID value. 
-    In the above example, if grpid == 3, then the group specified by GRPID5 
->   would be opened. \label{ffgtop}
+   fit_create_file(&fitsfileptr, "shmem://h2", &status);
 -
-  int fits_open_group / ffgtop 
-      (fitsfile *mfptr, int group, > fitsfile **gfptr, int *status)
+where the root `file' names are currently restricted to be 'h0', 'h1',
+'h2', 'h3', etc., up to a maximum number defined by the the value of
+SHARED\_MAXSEG (equal to 16 by default).  This is a prototype
+implementation of the shared memory interface and a more robust
+interface, which will have fewer restrictions on the number of files
+and on their names, may be developed in the future.
+
+When opening an already existing FITS file in shared memory one calls
+the usual CFITSIO routine:
 -
->10  Add a member HDU to an existing grouping table pointed to by gfptr.
-   The member HDU may either be pointed to mfptr (which must be positioned
-   to the member HDU) or, if mfptr == NULL, identified by the hdupos parameter 
-   (the HDU position number, Primary array == 1) if both the grouping table 
-   and the member HDU reside in the same FITS file. The new member HDU shall 
-   have the appropriate GRPIDn and GRPLCn keywords created in its header.
-   Note that if the member HDU is already a member of the group then it will 
->  not be added a second time. \label{ffgtam}
+   fits_open_file(&fitsfileptr, "shmem://h7", mode, &status)
 -
-  int fits_add_group_member / ffgtam 
-      (fitsfile *gfptr, fitsfile *mfptr, int hdupos, > int *status)
+The file mode can be READWRITE or READONLY just as with disk files.
+More than one process can operate on READONLY mode files at the same
+time.  CFITSIO supports proper file locking (both in READONLY and
+READWRITE modes), so calls to fits\_open\_file may be locked out until
+another other process closes the file.
+
+When an application is finished accessing a FITS file in a shared
+memory segment, it may close it  (and the file will remain in the
+system) with fits\_close\_file, or delete it with fits\_delete\_file.
+Physical deletion is postponed until the last process calls
+ffclos/ffdelt.  fits\_delete\_file tries to obtain a READWRITE lock on
+the file to be deleted, thus it can be blocked if the object was not
+opened in READWRITE mode.
+
+A shared memory management utility program called `smem', is included
+with the CFITSIO distribution.  It can be built by typing `make smem';
+then type `smem -h' to get a list of valid options.  Executing smem
+without any options causes it to list all the shared memory segments
+currently residing in the system and managed by the shared memory
+driver. To get a list of all the shared memory objects, run the system
+utility program `ipcs  [-a]'.
+
+**B.  Base Filename
+
+The base filename is the name of the file optionally including the
+director/subdirectory path, and in the case of `ftp', `http', and `root'
+filetypes, the machine identifier.  Examples:
 -
->11 Return the number of member HDUs in a grouping table gfptr. The number
-    member HDUs is just the NAXIS2 value (number of rows) of the grouping 
->   table. \label{ffgtnm}
+    myfile.fits
+    !data.fits
+    /data/myfile.fits
+    fits.gsfc.nasa.gov/ftp/sampledata/myfile.fits.gz
 -
-  int fits_get_num_members / ffgtnm 
-      (fitsfile *gfptr, > long *nmembers, int *status)
+
+When creating a new output file on magnetic disk (of type file://) if
+the base filename begins with an exclamation point (!) then any
+existing file with that same basename will be deleted prior to creating
+the new FITS file.  Otherwise if the file to be created already exists,
+then CFITSIO will return an error and will not overwrite the existing
+file.  Note  that the exclamation point,  '!', is a special UNIX
+character, so if it is used  on the command line rather than entered at
+a task prompt, it must be  preceded by a backslash to force the UNIX
+shell to pass it verbatim to the application program.
+
+If the output disk file name ends with the suffix '.gz', then CFITSIO
+will compress the file using the gzip compression algorithm before
+writing it to disk.  This can reduce the amount of disk space used by
+the file.  Note that this feature requires that the uncompressed file
+be constructed in memory before it is compressed and written to disk,
+so it can fail if there is insufficient available memory.
+
+An input FITS file may be compressed with the gzip or Unix compress
+algorithms, in which case CFITSIO will uncompress the file on the fly
+into a temporary file (in memory or on disk).  Compressed files may
+only be opened with read-only permission.  When specifying the name of
+a compressed FITS file it is not necessary to append the file suffix
+(e.g., `.gz' or `.Z').  If CFITSIO cannot find the input file name
+without the suffix, then it will automatically search for a compressed
+file with the same root name.  In the case of reading ftp and http type
+files, CFITSIO generally looks for a compressed version of the file
+first, before trying to open the uncompressed file.  By default,
+CFITSIO copies (and uncompressed if necessary) the ftp or http FITS
+file into memory on the local machine before opening it.  This will
+fail if the local machine does not have enough memory to hold the whole
+FITS file, so in this case, the output filename specifier (see the next
+section) can be used to further control how CFITSIO reads ftp and http
+files.
+
+If the input file is an IRAF image file (*.imh file) then CFITSIO will
+automatically convert it on the fly into a virtual FITS image before it
+is opened by the application program.  IRAF images can only be opened
+with READONLY file access.
+
+Similarly, if the input file is a raw binary data array, then CFITSIO
+will convert it on the fly into a virtual FITS image with the basic set
+of required header keywords before it is opened by the application
+program (with READONLY access).  In this case the data type and
+dimensions of the image must be specified in square brackets following
+the filename (e.g. rawfile.dat[ib512,512]). The first character (case
+insensitive) defines the data type of the array:
+-
+     b         8-bit unsigned byte
+     i        16-bit signed integer
+     u        16-bit unsigned integer
+     j        32-bit signed integer
+     r or f   32-bit floating point
+     d        64-bit floating point
+-
+An optional second character specifies the byte order of the array
+values: b or B indicates big endian (as in FITS files and the native
+format of SUN UNIX workstations and Mac PCs) and l or L indicates
+little endian (native format of DEC OSF workstations and IBM PCs).  If
+this character is omitted then the array is assumed to have the native
+byte order of the local machine.  These data type characters are then
+followed by a series of one or more integer values separated by commas
+which define the size of each dimension of the raw array.  Arrays with
+up to 5 dimensions are currently supported.  Finally, a byte offset to
+the position of the first pixel in the data file may be specified by
+separating it with a ':' from the last dimension value.  If omitted, it
+is assumed that the offset = 0.  This parameter may be used to skip
+over any header information in the file that precedes the binary data.
+Further examples:
+-
+  raw.dat[b10000]           1-dimensional 10000 pixel byte array
+  raw.dat[rb400,400,12]     3-dimensional floating point big-endian array
+  img.fits[ib512,512:2880]  reads the 512 x 512 short integer array in 
+                            a FITS file, skipping over the 2880 byte header
+-
+
+One special case of input file is where the filename = `-' (a dash or
+minus sign) or 'stdin' or 'stdout', which signifies that the input file
+is to be read from the stdin stream, or written to the stdout stream if
+a new output file is being created.  In the case of reading from stdin,
+CFITSIO first copies the whole stream into a temporary FITS file (in
+memory or on disk), and subsequent reading of the FITS file occurs in
+this copy.  When writing to stdout, CFITSIO first constructs the whole
+file in memory (since random access is required), then flushes it out
+to the stdout stream when the file is closed.  In addition, if the
+output filename = '-.gz' or 'stdout.gz' then it will be gzip compressed
+before being written to stdout.
+
+This ability to read and write on the stdin and stdout steams allows
+FITS files to be piped between tasks in memory rather than having to
+create temporary intermediate FITS files on disk.  For example if task1
+creates an output FITS file, and task2 reads an input FITS file, the
+FITS file may be piped between the 2 tasks by specifying
 -
->12  Return the number of groups to which the HDU pointed to by mfptr is 
-     linked, as defined by the number of GRPIDn/GRPLCn keyword records that 
-     appear in its header. Note that each time this function is called, the 
-     indices of the GRPIDn/GRPLCn keywords are checked to make sure they 
-     are continuous (ie no gaps) and are re-enumerated to eliminate gaps if 
->    found.  \label{ffgmng}
--
-  int fits_get_num_groups / ffgmng 
-      (fitsfile *mfptr, > long *nmembers, int *status)
--
->13 Open a member of the grouping table pointed to by gfptr. The member to 
-    open is identified by its row number within the grouping table as given
-    by the parameter 'member' (first member == 1) . A fitsfile pointer to 
-    the opened member HDU is returned as mfptr. Note that if the member HDU 
-    resides in a FITS file different from the grouping table HDU then the 
->   member file is first opened readwrite and, failing this, opened readonly. \label{ffgmop}
--
-  int fits_open_member / ffgmop 
-      (fitsfile *gfptr, long member, > fitsfile **mfptr, int *status)
--
->14 Copy (append) a member HDU of the grouping table pointed to by gfptr. 
-   The member HDU is identified by its row number within the grouping table 
-   as given by the parameter 'member' (first member == 1). The copy of the 
-   group member HDU will be appended to the FITS file pointed to by mfptr, 
-   and upon return mfptr shall point to the copied member HDU. The cpopt 
-   parameter may take on the following values: OPT\_MCP\_ADD which adds a new
-   entry in gfptr for the copied member HDU, OPT\_MCP\_NADD which does not add 
-   an entry in gfptr for the copied member, and OPT\_MCP\_REPL which replaces 
->  the original member entry with the copied member entry. \label{ffgmcp}
--
-  int fits_copy_member / ffgmcp 
-      (fitsfile *gfptr, fitsfile *mfptr, long member, int cpopt, > int *status)
--
->15 Transfer a group member HDU from the grouping table pointed to by
-   infptr to the grouping table pointed to by outfptr. The member HDU to 
-   transfer is identified by its row number within infptr as specified by 
-   the parameter 'member' (first member == 1). If tfopt == OPT\_MCP\_ADD then 
-   the member HDU is made 
-   a member of outfptr and remains a member of infptr. If tfopt == OPT\_MCP\_MOV
->  then the member HDU is deleted from infptr after the transfer to outfptr. \label{ffgmtf}
--
-  int fits_transfer_member / ffgmtf 
-      (fitsfile *infptr, fitsfile *outfptr, long member, int tfopt,
-       > int *status)
--
->16 Remove a member HDU from the grouping table pointed to by gfptr. The 
-   member HDU to be deleted is identified by its row number in the grouping 
-   table as specified by the parameter 'member' (first member == 1). The rmopt 
-   parameter may take on the following values: OPT\_RM\_ENTRY which 
-   removes the member HDU entry from the grouping table and updates the 
-   member's GRPIDn/GRPLCn keywords, and OPT\_RM\_MBR which removes the member 
->  HDU entry from the grouping table and deletes the member HDU itself. \label{ffgmrm}
--
-  int fits_remove_member / ffgmrm
-      (fitsfile *fptr, long member, int rmopt, > int *status)
+   task1 - | task2 - 
 -
-
-**I.  Row Selection and Calculator Routines 
-
-These routines all parse and evaluate an input string containing a user
-defined arithmetic expression.  The first 3 routines select rows in a
-FITS table, based on whether the expression evaluates to true (not
-equal to zero) or false (zero).  The other routines evaluate the
-expression and calculate a value for each row of the table.  The
-allowed expression syntax is described in the row filter section in the
-earlier `Extended File Name Syntax' chapter of this document.  See
-Appendix B for the definition of the parameters used in these
-routines.
+where the vertical bar is the Unix piping symbol.  This assumes that the 2
+tasks read the name of the FITS file off of the command line.
 
->1  Evaluate a boolean expression over the indicated rows, returning an     
-> array of flags indicating which rows evaluated to TRUE/FALSE  \label{fffrow}
--
-  int fits_find_rows / fffrow
-      (fitsfile *fptr,  char *expr, long firstrow, long nrows,
-      > long *n_good_rows, char *row_status,  int *status)             
--
->>2  Find the first row which satisfies the input boolean expression \label{ffffrw}
--
-  int fits_find_first_row / ffffrw
-      (fitsfile *fptr,  char *expr, > long *rownum, int *status)             
--
->3 Evaluate an expression on all rows of a table.  If the input and output  
-files are not the same, copy the TRUE rows to the output file.  If the   
->files are the same, delete the FALSE rows (preserve the TRUE rows). \label{ffsrow}
--
-  int fits_select_rows / ffsrow
-      (fitsfile *infptr, fitsfile *outfptr,  char *expr,  > int *status )
--
->4  Calculate an expression for the indicated rows of a table, returning     
-the results, cast as datatype (TSHORT, TDOUBLE, etc), in array.  If      
-nulval==NULL, UNDEFs will be zeroed out.  For vector results, the number 
-of elements returned may be less than nelements if nelements is not an   
-even multiple of the result dimension.  Call fits\_test\_expr to obtain    
->the dimensions of the results.  \label{ffcrow}  
--
-  int fits_calc_rows / ffcrow
-      (fitsfile *fptr,  int datatype, char *expr, long firstrow,
-       long nelements, void *nulval, > void *array,  int *anynul, int *status)
--
->5 Evaluate an expression and write the result either to a column (if
-the expression is a function of other columns in the table) or to a
-keyword (if the expression evaluates to a constant and is not a
-function of other columns in the table).  In the former case, the
-parName parameter is the name of the column (which may or may not already
-exist) into which to write the results, and parInfo contains an
-optional TFORM keyword value if a new column is being created.  If a
-TFORM value is not specified then a default format will be used,
-depending on the expression.  If the expression evalutes to a constant,
-then the result will be written to the keyword name given by the
-parName parameter, and the parInfo parameter may be used to supply an
-optional comment for the keyword.  If the keyword does not already
-exist, then the name of the keyword must be preceeded with a '\#' character,
-otherwise the result will be written to a column with that name.
-> \label{ffcalc}        
--
-  int fits_calculator / ffcalc
-      (fitsfile *infptr, char *expr, fitsfile *outfptr, char *parName,
-       char *parInfo, >  int *status)                   
--
->6  This calculator routine is similar to the previous routine, except
-that the expression is only evaluated over the specified 
-row ranges.  nranges specifies the number of row ranges, and firstrow
-and lastrow give the starting and ending row number of each range.
-> \label{ffcalcrng}
--
-  int fits_calculator_rng / ffcalc_rng
-      (fitsfile *infptr, char *expr, fitsfile *outfptr, char *parName,
-       char *parInfo, int nranges, long *firstrow, long *lastrow 
-       >  int *status)                   
--
+**C.  Output File Name when Opening an Existing File
 
->>7 Evaluate the given expression and return information on the result. \label{fftexp}
--
-  int fits_test_expr / fftexp
-      (fitsfile *fptr, char *expr, > int *datatype, long *nelem, int *naxis,
-       long *naxes, int *status)                 
--
-
-**J.  File Checksum Routines \label{FFPCKS}
- 
-The following routines either compute or validate the checksums for the
-CHDU.  The DATASUM keyword is used to store the numerical value of the
-32-bit, 1's complement checksum for the data unit alone.  If there is
-no data unit then the value is set to zero. The numerical value is
-stored as an ASCII string of digits, enclosed in quotes, because the
-value may be too large to represent as a 32-bit signed integer.  The
-CHECKSUM keyword is used to store the ASCII encoded COMPLEMENT of the
-checksum for the entire HDU.  Storing the complement, rather than the
-actual checksum, forces the checksum for the whole HDU to equal zero.
-If the file has been modified since the checksums were computed, then
-the HDU checksum will usually not equal zero.  These checksum keyword
-conventions are based on a paper by Rob Seaman published in the
-proceedings of the ADASS IV conference in Baltimore in November 1994
-and a later revision in June 1995.  See Appendix B for the definition
-of the parameters used in these routines.
- 
->1  Compute and write the DATASUM and CHECKSUM keyword values for the CHDU
-    into the current header.  If the keywords already exist, their values
-    will be updated only if necessary (i.e., if the file
-    has been modified since the original keyword
->   values were computed). \label{ffpcks}
--
-  int fits_write_chksum / ffpcks
-      (fitsfile *fptr, > int *status)
--
->2  Update the CHECKSUM keyword value in the CHDU, assuming that the
-    DATASUM keyword exists and already has the correct value.  This routine
-    calculates the new checksum for the current header unit, adds it to the
-    data unit checksum, encodes the value into an ASCII string, and writes
->   the string to the CHECKSUM keyword. \label{ffupck}
--
-  int fits_update_chksum / ffupck
-      (fitsfile *fptr, > int *status)
--
->3  Verify the CHDU by computing the checksums and comparing
-    them with the keywords.  The data unit is verified correctly
-    if the computed checksum equals the value of the DATASUM
-    keyword.  The checksum for the entire HDU (header plus data unit) is
-    correct if it equals zero.  The output DATAOK and HDUOK parameters
-    in this routine are integers which will have a value = 1
-    if the data or HDU is verified correctly, a value = 0
-    if the DATASUM or CHECKSUM keyword is not present, or value = -1
->   if the computed checksum is not correct. \label{ffvcks}
--
-  int fits_verify_chksum / ffvcks
-      (fitsfile *fptr, > int *dataok, int *hduok, int *status)
--
->4  Compute and return the checksum values for the CHDU
-    without creating or modifying the
-    CHECKSUM and DATASUM keywords.  This routine is used internally by
->   ffvcks, but may be useful in other situations as well. \label{ffgcks}
--
-  int fits_get_chksum/ /ffgcks
-      (fitsfile *fptr, > unsigned long *datasum, unsigned long *hdusum,
-       int *status)
--
->5  Encode a checksum value 
-    into a 16-character string.  If complm is non-zero (true) then the 32-bit
->   sum value will be complemented before encoding. \label{ffesum}
--
-  int fits_encode_chksum / ffesum
-      (unsigned long sum, int complm, > char *ascii);
--
->6  Decode a 16-character checksum string into a unsigned long value.
-    If is non-zero (true). then the 32-bit sum value will be complemented
-    after decoding.  The checksum value is also returned as the 
->   value of the function. \label{ffdsum}
--
-  unsigned long fits_decode_chksum / ffdsum
-           (char *ascii, int complm, > unsigned long *sum);
--
-**K.    Date and Time Utility Routines 
+An optional output filename may be specified in parentheses immediately
+following the base file name to be opened.  This is mainly useful in
+those cases where CFITSIO creates a temporary copy of the input FITS
+file before it is opened and passed to the application program.  This
+happens by default when opening a network FTP or HTTP-type file, when
+reading a compressed FITS file on a local disk, when reading from the
+stdin stream, or when a column filter, row filter, or binning specifier
+is included as part of the input file specification.  By default this
+temporary file is created in memory.  If there is not enough memory to
+create the file copy, then CFITSIO will exit with an error.   In these
+cases one can force a permanent file to be created on disk, instead of
+a temporary file in memory, by supplying the name in parentheses
+immediately following the base file name.  The output filename can
+include the '!' clobber flag.
 
-The following routines help to construct or parse the FITS date/time
-strings.   Starting in the year 2000, the FITS DATE keyword values (and
-the values of other `DATE-' keywords) must have the form 'YYYY-MM-DD'
-(date only) or 'YYYY-MM-DDThh:mm:ss.ddd...' (date and time) where the
-number of decimal places in the seconds value is optional.  These times
-are in UTC.  The older 'dd/mm/yy' date format may not be used for dates
-after 01 January 2000.  See Appendix B for the definition of the
-parameters used in these routines.
+Thus, if the input filename to CFITSIO is: 
+\verb+file1.fits.gz(file2.fits)+
+then CFITSIO will uncompress `file1.fits.gz' into the local disk file
+`file2.fits' before opening it.  CFITSIO does not automatically delete
+the output file, so it will still exist after the application program
+exits.
 
->1  Get the current system date.  C already provides standard
-    library routines for getting the current date and time,
-    but this routine is provided for compatibility with
-    the Fortran FITSIO library.  The returned year has 4 digits
->    (1999, 2000, etc.) \label{ffgsdt}
--
-  int fits_get_system_date/ffgsdt
-      ( > int *day, int *month, int *year, int *status )
--
+The output filename "mem://" is also allowed, which will write the 
+output file into memory, and also allow write access to the file.  This
+'file' will disappear when it is closed, but this may be useful for
+some applications which only need to modify a temporary copy of the file.
 
->2  Get the current system date and time string ('YYYY-MM-DDThh:mm:ss').
-The time will be in UTC/GMT if available, as indicated by a returned timeref 
-value = 0.  If the returned value of timeref = 1 then this indicates that
-it was not possible to convert the local time to UTC, and thus the local
->time was returned.
--
-  int fits_get_system_time/ffgstm
-      (> char *datestr, int  *timeref, int *status)
--
+In some cases, several different temporary FITS files will be created
+in sequence, for instance, if one opens a remote file using FTP, then
+filters rows in a binary table extension, then create an image by
+binning a pair of columns.  In this case, the remote file will be
+copied to a temporary local file, then a second temporary file will be
+created containing the filtered rows of the table, and finally a third
+temporary file containing the binned image will be created.  In cases
+like this where multiple files are created, the outfile specifier will
+be interpreted the name of the final file as described below, in descending
+priority:
 
->3  Construct a date string from the input date values.  If the year
-is between 1900 and 1998, inclusive, then the returned date string will
-have the old FITS format ('dd/mm/yy'), otherwise the date string will
-have the new FITS format ('YYYY-MM-DD').  Use fits\_time2str instead
-> to always return a date string using the new FITS format. \label{ffdt2s}
--
-  int fits_date2str/ffdt2s   
-      (int year, int month, int day, > char *datestr, int *status)
--
-
->4  Construct a new-format date + time string ('YYYY-MM-DDThh:mm:ss.ddd...').
-  If the year, month, and day values all = 0 then only the time is encoded
-  with format 'hh:mm:ss.ddd...'.  The decimals parameter specifies how many
-  decimal places of fractional seconds to include in the string.  If `decimals'
-> is negative, then only the date will be return ('YYYY-MM-DD').
--
-  int fits_time2str/fftm2s   
-      (int year, int month, int day, int hour, int minute, double second,
-      int decimals, > char *datestr, int *status)
--
-
->5  Return the date as read from the input string, where the string may be
-in either the old ('dd/mm/yy')  or new ('YYYY-MM-DDThh:mm:ss' or
-'YYYY-MM-DD') FITS format.  Null pointers may be supplied for any
->  unwanted output date parameters.
--
-  int fits_str2date/ffs2dt 
-      (char *datestr, > int *year, int *month, int *day, int *status)
--
-
->6  Return the date and time as read from the input string, where the
-string may be in either the old  or new FITS format.  The returned hours,
-minutes, and seconds values will be set to zero if the input string
-does not include the time ('dd/mm/yy' or 'YYYY-MM-DD') .  Similarly,
-the returned year, month, and date values will be set to zero if the
-date is not included in the input string ('hh:mm:ss.ddd...').  Null
-pointers may be supplied for any unwanted output date and time
->parameters.
--
-  int fits_str2time/ffs2tm 
-      (char *datestr, > int *year, int *month, int *day, int *hour,
-      int *minute, double *second, int *status)
--
-**L.   General Utility Routines 
- 
-The following utility routines may be useful for certain applications.
-See Appendix B for the definition of the parameters used in these
-routines.
-
->>1  Convert a character string to uppercase (operates in place). \label{ffupch}
--
-  void fits_uppercase / ffupch (char *string)
--
->2   Compare the input template string against the reference string
-    to see if they match.  The template string may contain wildcard
-    characters: '*' will match any sequence of characters (including
-    zero characters) and '\%' will match any single character in the
-    reference string.  If casesen = CASESEN = TRUE then the match will be
-    case sensitive, otherwise the case of the letters will be ignored
-    if casesen = CASEINSEN = FALSE.  The returned MATCH parameter will be 
-    TRUE if the 2 strings match, and EXACT will be TRUE if the match is
-    exact (i.e., if no wildcard characters were used in the match).
->   Both strings must be 68 characters or less in length. \label{ffcmps}
--
-  void fits_compare_str / ffcmps
-       (char *templt, char *string, int casesen, > int *match, int *exact)
--
->3  Test that the keyword name contains only legal characters: A-Z,0-9,
->   hyphen, and underscore. \label{fftkey}
--
-  int fits_test_keyword / fftkey (char *keyname, > int *status)
--
->4  Test that the keyword record contains only legal printable ASCII characters
->   \label{fftrec}
--
-  int fits_test_record / fftrec (char *card, > int *status)
--
->5  Test whether the current header contains any NULL (ASCII 0) characters.
-    These characters are illegal in the header, but they will go undetected
-    by most of the CFITSIO keyword header routines, because the null is 
-    interpreted as the normal end-of-string terminator.  This routine returns
-    the position of the first null character in the header, or zero if there
-    are no nulls.  For example a returned value of 110 would indicate that
-    the first NULL is located in the 30th character of the second keyword
-    in the header (recall that each header record is 80 characters long).
-    Note that this is one of the few CFITSIO routines in which the returned
-    value is not necessarily equal to the status value).
->   \label{ffnchk}
--
-  int fits_null_check / ffnchk (char *card, > int *status)
--
->6  Parse a header keyword record and return the name of the keyword,
-    and the length of the name.
-    The keyword name normally occupies the first 8 characters of the
-    record, except under the HIERARCH convention where the name can
->   be up to 70 characters in length. \label{ffgknm}
--
-  int fits_get_keyname / ffgknm
-      (char *card, > char *keyname, int *keylength, int *status)
--
->7  Parse a header keyword record, returning the value (as
-    a literal character string) and comment strings.  If the keyword has no
-    value (columns 9-10 not equal to '= '), then a null value string is 
-    returned and the comment string is set equal to column 9 - 80 of the
->   input string. \label{ffpsvc}
--
-  int fits_parse_value / ffpsvc
-      (char *card, > char *value, char *comment, int *status)
--
->8  Construct an array indexed keyword name (ROOT + nnn).
-    This routine appends the sequence number to the root string to create
->   a keyword name (e.g., 'NAXIS' + 2 = 'NAXIS2') \label{ffkeyn}
--
-  int fits_make_keyn / ffkeyn
-      (char *keyroot, int value, > char *keyname, int *status)
--
->9  Construct a sequence keyword name (n + ROOT).
-    This routine concatenates the sequence number to the front of the
->   root string to create a keyword name (e.g., 1 + 'CTYP' = '1CTYP') \label{ffnkey}
--
-  int fits_make_nkey / ffnkey
-      (int value, char *keyroot, > char *keyname, int *status)
--
->10 Determine the datatype of a keyword value string. This routine
-    parses the keyword value string  to determine its datatype. 
-    Returns 'C', 'L', 'I', 'F' or 'X', for character string, logical,
->   integer, floating point, or complex, respectively. \label{ffdtyp}
--
-  int fits_get_keytype / ffdtyp
-      (char *value, > char *dtype, int *status)
--
->11 Return the class of input header record.  The record is classified
-    into one of the following catagories (the class values are
-    defined in fitsio.h).  Note that this is one of the few CFITSIO
->   routines that does not return a status value. \label{ffgkcl}
--
-       Class  Value             Keywords
-  TYP_STRUC_KEY  10  SIMPLE, BITPIX, NAXIS, NAXISn, EXTEND, BLOCKED,
-                     GROUPS, PCOUNT, GCOUNT, END
-                     XTENSION, TFIELDS, TTYPEn, TBCOLn, TFORMn, THEAP,
-                     and the first 4 COMMENT keywords in the primary array
-                     that define the FITS format.
-  TYP_CMPRS_KEY  20  The experimental keywords used in the compressed 
-                     image format ZIMAGE, ZCMPTYPE, ZNAMEn, ZVALn,
-                     ZTILEn, ZBITPIX, ZNAXISn, ZSCALE, ZZERO, ZBLANK
-  TYP_SCAL_KEY   30  BSCALE, BZERO, TSCALn, TZEROn
-  TYP_NULL_KEY   40  BLANK, TNULLn
-  TYP_DIM_KEY    50  TDIMn
-  TYP_RANG_KEY   60  TLMINn, TLMAXn, TDMINn, TDMAXn, DATAMIN, DATAMAX
-  TYP_UNIT_KEY   70  BUNIT, TUNITn
-  TYP_DISP_KEY   80  TDISPn
-  TYP_HDUID_KEY  90  EXTNAME, EXTVER, EXTLEVEL, HDUNAME, HDUVER, HDULEVEL
-  TYP_CKSUM_KEY 100  CHECKSUM, DATASUM
-  TYP_WCS_KEY   110  CTYPEn, CUNITn, CRVALn, CRPIXn, CROTAn, CDELTn
-                     CDj_is, PVj_ms, LONPOLEs, LATPOLEs
-                     TCTYPn, TCTYns, TCUNIn, TCUNns, TCRVLn, TCRVns, TCRPXn,
-                     TCRPks, TCDn_k, TCn_ks, TPVn_m, TPn_ms, TCDLTn, TCROTn
-                     jCTYPn, jCTYns, jCUNIn, jCUNns, jCRVLn, jCRVns, iCRPXn,
-                     iCRPns, jiCDn,  jiCDns, jPVn_m, jPn_ms, jCDLTn, jCROTn
-                     (i,j,m,n are integers, s is any letter)
-  TYP_REFSYS_KEY 120 EQUINOXs, EPOCH, MJD-OBSs, RADECSYS, RADESYSs
-  TYP_COMM_KEY   130 COMMENT, HISTORY, (blank keyword)
-  TYP_CONT_KEY   140 CONTINUE
-  TYP_USER_KEY   150 all other keywords
+\begin{itemize}
+\item
+as the name of the final image file if an image within a single binary
+table cell is opened or if an image is created by binning a table column.
+\item
+as the name of the file containing the filtered table if a column filter
+and/or a row filter are specified.
+\item
+as the name of the local copy of the remote FTP or HTTP file.
+\item
+as the name of the uncompressed version of the FITS file, if a
+compressed FITS file on local disk has been opened.
+\item
+otherwise, the output filename is ignored.
+\end{itemize}
 
-  int fits_get_keyclass / ffgkcl (char *card)
--
->12 Parse the 'TFORM' binary table column format string.
-    This routine parses the input TFORM character string and returns the
-    integer datatype code, the repeat count of the field, and, in the case
-    of character string fields, the length of the unit string.  See Appendix
-    B for the allowed values for the returned typecode parameter.  A
->   null pointer may be given for any output parameters that are not needed. \label{ffbnfm}
--
-   int fits_binary_tform / ffbnfm
-       (char *tform, > int *typecode, long *repeat, long *width, 
-        int *status)
--
->13 Parse the 'TFORM' keyword value that defines the column format in
-    an ASCII table.  This routine parses the input TFORM character
-    string and returns the datatype code, the width of the column,
-    and (if it is a floating point column) the number of decimal places
-    to the right of the decimal point.  The returned datatype codes are
-    the same as for the binary table, with the following
-    additional rules:  integer columns that are between 1 and 4 characters
-    wide are defined to be short integers (code = TSHORT).  Wider integer
-    columns are defined to be regular integers (code = TLONG).  Similarly,
-    Fixed decimal point columns (with TFORM = 'Fw.d') are defined to
-    be single precision reals (code = TFLOAT) if w is between 1 and 7 characters
-    wide, inclusive.  Wider 'F' columns will return a double precision
-    data code (= TDOUBLE).  'Ew.d' format columns will have datacode = TFLOAT,
-    and 'Dw.d' format columns will have datacode = TDOUBLE. A null
->   pointer may be given for any output parameters that are not needed. \label{ffasfm}
--
-  int fits_ascii_tform / ffasfm
-      (char *tform, > int *typecode, long *width, int *decimals, 
-       int *status)
--
->14 Calculate the starting column positions and total ASCII table width
-    based on the input array of ASCII table TFORM values.  The SPACE input
-    parameter defines how many blank spaces to leave between each column
-    (it is recommended to have one space between columns for better human
->   readability). \label{ffgabc}
--
-  int fits_get_tbcol / ffgabc
-      (int tfields, char **tform, int space, > long *rowlen, 
-       long *tbcol, int *status)
--
->15 Parse a template header record and return a formatted 80-character string
-    suitable for appending to (or deleting from) a FITS header file.
-    This routine is useful for parsing lines from an ASCII template file
-    and reformatting them into legal FITS header records.  The formatted
-    string may then be passed to the fits\_write\_record, ffmcrd, or 
-    fits\_delete\_key routines
->   to append or modify a FITS header record. \label{ffgthd}
--
-  int fits_parse_template / ffgthd
-      (char *templt, > char *card, int *keytype, int *status)
--
-    The input templt character string generally should contain 3 tokens:
-    (1) the KEYNAME, (2) the VALUE, and (3) the COMMENT string.  The
-    TEMPLATE string must adhere to the following format:
- 
->-      The KEYNAME token must begin in columns 1-8 and be a maximum  of 8
-        characters long.  A legal FITS keyword name may only
-        contain the characters A-Z, 0-9, and '-' (minus sign) and
-        underscore.  This routine will automatically convert any lowercase
-        characters to uppercase in the output string.  If the first 8 characters 
-        of the template line are
-        blank then the remainder of the line is considered to be a FITS comment
->       (with a blank keyword name).  
- 
->-      The VALUE token must be separated from the KEYNAME token by one or more
-        spaces and/or an '=' character.  The datatype of the VALUE token
-        (numeric, logical, or character string) is automatically determined
-        and  the output CARD string is formatted accordingly.  The value
-        token may be forced to be interpreted as a string (e.g. if it is a
->       string of numeric digits) by enclosing it in single quotes.
- 
->-      The COMMENT token is optional, but if present must be separated from
->       the VALUE token by at least one blank space and a  '/' character.
- 
->-      One exception to the above rules is that if the first non-blank
-        character in the first 8 characters of the template string is a 
-        minus sign ('-') followed
-        by a single token, or a single token followed by an equal sign,
-        then it is interpreted as the name of a keyword which is to be
->       deleted from the FITS header.
- 
->-      The second exception is that if the template string starts with
-        a minus sign and is followed by 2 tokens (without an equals sign between
-        them) then the second token
-        is interpreted as the new name for the keyword specified by
-        first token.  In this case the old keyword name (first token)
-        is returned in characters 1-8 of the returned CARD string, and
-        the new keyword name (the second token) is returned in characters
-        41-48 of the returned CARD string.  These old and new names
-        may then be passed to the ffmnam routine which will change
->       the keyword name.
- 
-    The keytype output parameter indicates how the returned CARD string
-    should be interpreted:
--
-        keytype                  interpretation
-        -------          -------------------------------------------------
-           -2            Rename the keyword with name = the first 8 characters of CARD
-                         to the new name given in characters 41 - 48 of CARD.
- 
-           -1            delete the keyword with this name from the FITS header.
- 
-            0            append the CARD string to the FITS header if the
-                         keyword does not already exist, otherwise update
-                         the keyword value and/or comment field if is already exists.
- 
-            1            This is a HISTORY or COMMENT keyword; append it to the header
- 
-            2            END record; do not explicitly write it to the FITS file.
--
-     EXAMPLES:  The following lines illustrate valid input template strings:
--
-      INTVAL 7 / This is an integer keyword
-      RVAL           34.6   /     This is a floating point keyword
-      EVAL=-12.45E-03  / This is a floating point keyword in exponential notation
-      lval F / This is a boolean keyword
-                  This is a comment keyword with a blank keyword name
-      SVAL1 = 'Hello world'   /  this is a string keyword
-      SVAL2  '123.5'  this is also a string keyword
-      sval3  123+  /  this is also a string keyword with the value '123+    '
-      # the following template line deletes the DATE keyword
-      - DATE
-      # the following template line modifies the NAME keyword to OBJECT
-      - NAME OBJECT
--
->16  Check that the Header fill bytes (if any) are all blank.  These are the bytes
-     that may follow END keyword and before the beginning of data unit, or the end of
-     the HDU if there is no data unit.
->   \label{ffchfl}
--
-    int ffchfl(fitsfile *fptr, > int *status)
--
->17  Check that the Data fill bytes (if any) are all zero (for IMAGE or BINARY Table HDU)
-    or all blanks (for ASCII table HDU).  These file bytes may be
-   located after the last valid data byte in the HDU and before the physcal end of the HDU.
->     \label{ffcdfl}
--
-    int ffcdfl(fitsfile *fptr, > int *status)
--
+The output file specifier is useful when reading FTP or HTTP-type
+FITS files since it can be used to create a local disk copy of the file
+that can be reused in the future.  If the output file name = `*' then a
+local file with the same name as the network file will be created.
+Note that CFITSIO will behave differently depending on whether the
+remote file is compressed or not as shown by the following examples:
+\begin{itemize}
+\item
+\verb+ftp://remote.machine/tmp/myfile.fits.gz(*)+ - the remote compressed
+file is copied to the local compressed file `myfile.fits.gz', which
+is then uncompressed in local memory before being opened and passed
+to the application program.
 
-
-*VIII   Specialized CFITSIO Interface Routines
+\item
+\verb+ftp://remote.machine/tmp/myfile.fits.gz(myfile.fits)+ - the
+remote compressed file is copied and uncompressed into the local file
+`myfile.fits'.  This example requires less local memory than the
+previous example since the file is uncompressed on disk instead of in
+memory.
 
-The basic interface routines described in the previous chapter should
-be used  whenever possible, but the routines described in this chapter
-are also available if necessary.  Some of these routines perform more
-specialized function that cannot easily be done with the basic
-interface routines while others duplicate the functionality of the
-basic routines but have a slightly different calling sequence.  See
-Appendix B for the definition of the parameters used in these
-routines.
+\item
+\verb+ftp://remote.machine/tmp/myfile.fits(myfile.fits.gz)+ - this will
+usually produce an error since CFITSIO itself cannot compress files.
+\end{itemize}
 
-**A.  Specialized FITS File Access Routines
+The exact behavior of CFITSIO in the latter case depends on the type of
+ftp server running on the remote machine and how it is configured.  In
+some cases, if the file `myfile.fits.gz' exists on the remote machine,
+then the server will copy it to the local machine.  In other cases the
+ftp server will automatically create and transmit a compressed version
+of the file if only the uncompressed version exists.  This can get
+rather confusing, so users should use a certain amount of caution when
+using the output file specifier with FTP or HTTP file types, to make
+sure they get the behavior that they expect.
 
->1  Open an existing FITS file residing in core computer memory.  This
-routine is analogous to fits\_open\_file.   The 'filename'  is
-currently ignored by this routine and may be any arbitrary string. In
-general, the application must have preallocated an initial block of
-memory to hold the FITS file prior to calling this routine:  'memptr'
-points to the starting address and 'memsize' gives the initial size of
-the block of memory.  'mem\_realloc' is a pointer to an optional
-function that CFITSIO can call to allocate additional memory, if needed
-(only if mode = READWRITE), and is modeled after the standard C
-'realloc' function;  a null pointer may be given if the initial
-allocation of memory is all that will be required (e.g., if the file is
-opened with mode = READONLY).  The 'deltasize' parameter may be used to
-suggest a minimum amount of additional memory that should be allocated
-during each call to the memory reallocation function.  By default,
-CFITSIO will reallocate enough additional space to hold the entire
-currently defined FITS file (as given by the NAXISn keywords) or 1 FITS
-block (= 2880 bytes), which ever is larger.  Values of deltasize less
-than 2880 will be ignored.  Since the memory reallocation operation can
-be computationally expensive, allocating a larger initial block of
-memory, and/or specifying a larger deltasize value may help to reduce
-the number of reallocation calls and make the application program run
-> faster. \label{ffomem}
--
-  int fits_open_memfile / ffomem
-      (fitsfile **fptr, const char *filename, int mode, void **memptr,
-       size_t *memsize, size_t deltasize,
-       void *(*mem_realloc)(void *p, size_t newsize), int *status)
--
->2  Create a new FITS file residing in core computer memory.  This
-routine is analogous to fits\_create\_file.    In general, the
-application must have preallocated an initial block of memory to hold
-the FITS file prior to calling this routine:  'memptr' points to the
-starting address and 'memsize' gives the initial size of the block of
-memory.  'mem\_realloc' is a pointer to an optional function that
-CFITSIO can call to allocate additional memory, if needed, and is
-modeled after the standard C 'realloc' function;  a null pointer may be
-given if the initial allocation of memory is all that will be
-required.  The 'deltasize' parameter may be used to suggest a minimum
-amount of additional memory that should be allocated during each call
-to the memory reallocation function.  By default, CFITSIO will
-reallocate enough additional space to hold 1 FITS block (= 2880 bytes)
-and  values of deltasize less than 2880 will be ignored.  Since the
-memory reallocation operation can be computationally expensive,
-allocating a larger initial block of memory, and/or specifying a larger
-deltasize value may help to reduce the number of reallocation calls
-and make the application program run
-> faster. \label{ffimem}
--
-  int fits_create_memfile / ffimem
-      (fitsfile **fptr, void **memptr,
-       size_t *memsize, size_t deltasize,
-       void *(*mem_realloc)(void *p, size_t newsize), int *status)
--
->3 Flush any internal buffers of data to the output FITS file. This 
-   routine rarely needs to be called, but can be useful when writing to
-   the FITS files in memory, and will ensure
-   that if the program subsequently aborts then the FITS file will
->  have been closed properly. \label{ffflus}
--
-  int fits_flush_file / ffflus
-      (fitsfile *fptr, > int *status)
--
-
-**B.  Specialized HDU Access Routines
+**D.  Template File Name when Creating a New File
 
->1  Get the byte offsets in the FITS file to the start of the header 
-    and the start and end of the data in the CHDU. The difference
-    between headstart and dataend equals the size of the CHDU.  If the
-    CHDU is the last HDU in the file, then dataend is also equal to the
-    size of the entire FITS file.  Null pointers may be input for any
-    of the address parameters if their values are not needed.  The
-    fits\_get\_hduaddr routine is obsolete and should no longer be
-    used.  The newer fits\_get\_hduoff routine uses the 'off\_t'
-    datatype which can support offsets in large files greater than 
->   2.1GB in size. \label{ffghad}
--
-  int fits_get_hduoff / ffghof
-       (fitsfile *fptr, > off_t *headstart, off_t *datastart, off_t *dataend,
-        int *status)
+When a new FITS file is created with a call to fits\_create\_file, the
+name of a template file may be supplied in parentheses immediately
+following the name of the new file to be created.  This template is
+used to define the structure of one or more HDUs in the new file.  The
+template file may be another FITS file, in which case the newly created
+file will have exactly the same keywords in each HDU as in the template
+FITS file, but all the data units will be filled with zeros.  The
+template file may also be an ASCII text file, where each line (in
+general) describes one FITS keyword record.  The format of the ASCII
+template file is described in the following Template Files chapter.
 
-  int fits_get_hduaddr / ffghad  (OBSOLETE routine)
-       (fitsfile *fptr, > long *headstart, long *datastart, long *dataend,
-        int *status)
--
->2  Create (append) a new empty HDU at the end of the FITS file.
-    This is now  the CHDU but it is completely empty and has
-    no header keywords.  It is recommended that fits\_create\_img or 
-> fits\_create\_tbl be used instead of this routine. \label{ffcrhd}
--
-  int fits_create_hdu / ffcrhd
-      (fitsfile *fptr, > int *status)
--
->3  Insert a new IMAGE extension immediately following the CHDU.
-    Any following extensions will be shifted down to make room for
-    the new extension.  If there are no other following extensions
-    then the new image extension will simply be appended to the
-    end of the file.  The new extension will become the CHDU.
->   Refer to Chapter 9 for a list of pre-defined bitpix values. \label{ffiimg}
--
-  int fits_insert_img / ffiimg
-      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
--
->4  Insert a new ASCII or binary table extension immediately following the CHDU.
-    Any following extensions will be shifted down to make room for
-    the new extension.  If there are no other following extensions
-    then the new table extension will simply be appended to the
-    end of the file.   If the FITS file is currently empty 
-    then this routine will create a dummy primary array before
-    appending the table to it. The new extension will become the CHDU.
-    The tunit and
-    extname parameters are optional and a null pointer may be given
-    if they are not defined.  When inserting an ASCII table with
-    fits\_insert\_atbl, a null pointer  may given for the
-    *tbcol parameter in which case each column of the table
-    will be separated by a single space character. Similarly, if the
-    input value of rowlen is  0, then CFITSIO will calculate 
-    the default rowlength based on the tbcol and ttype values.
-    When inserting a binary table with fits\_insert\_btbl,
-    if there are following extensions in the file and if 
-    the table contains variable length array columns
-    then pcount must specify the expected final size of the data heap, 
->   otherwise pcount must = 0. \label{ffitab} \label{ffibin}
--
-  int fits_insert_atbl / ffitab
-      (fitsfile *fptr, long rowlen, long nrows, int tfields, char *ttype[],
-       long *tbcol, char *tform[], char *tunit[], char *extname, > int *status)
+**E.  Image Tile-Compression Specification
 
-  int fits_insert_btbl / ffibin
-      (fitsfile *fptr, long nrows, int tfields, char **ttype,
-      char **tform, char **tunit, char *extname, long pcount, > int *status)
--
->5  Modify the size, dimensions, and/or datatype of the current
-    primary array or image extension. If the new image, as specified
-    by the input arguments, is larger than the current existing image
-    in the FITS file then zero fill data will be inserted at the end
-    of the current image and any following extensions will be moved 
-    further back in the file.  Similarly, if the new image is
-    smaller than the current image then any following extensions
-    will be shifted up towards the beginning of the FITS file
-    and the image data will be truncated to the new size.
-    This routine rewrites the BITPIX, NAXIS, and NAXISn keywords
->   with the appropriate values for the new image. \label{ffrsim}
--
-  int fits_resize_img / ffrsim
-      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
--
->6  Copy the header (and not the data) from the CHDU associated with infptr
-    to the CHDU associated with outfptr.  If the current output HDU
-    is not completely empty, then the CHDU will be closed and a new
-    HDU will be appended to the output file.  This routine will automatically
-    transform the necessary keywords when copying a primary array to
-    and image extension, or an image extension to a primary array. 
->   An empty output data unit will be created (all values = 0). \label{ffcphd}
--
-  int fits_copy_header / ffcphd
-      (fitsfile *infptr, fitsfile *outfptr, > int *status)
--
->7  Copy the data (and not the header) from the CHDU associated with infptr
-    to the CHDU associated with outfptr. This will overwrite any data
-    previously in the output CHDU.  This low level routine is used by 
-    fits\_copy\_hdu, but it may also be useful in certain application programs
-    that want to copy the data from one FITS file to another but also
-    want to modify the header keywords. The required FITS header keywords 
-    which define the structure of the HDU must be written to the 
->   output CHDU before calling this routine. \label{ffcpdt}
+When specifying the name of the output FITS file to be created, the
+user can indicate that images should be written in tile-compressed
+format (see section 5.5, ``Primary Array or IMAGE Extension I/O
+Routines'') by enclosing the compression parameters in square brackets
+following the root disk file name.  Here are some examples of the
+syntax for specifying tile-compressed output images:
 -
-  int fits_copy_data / ffcpdt
-      (fitsfile *infptr, fitsfile *outfptr, > int *status)
--
->8  This routine forces CFITSIO to rescan the current header keywords that
-    define the structure of the HDU (such as the NAXIS and BITPIX
-    keywords) so that it reinitializes the internal buffers that
-    describe the HDU structure.  This routine is useful for
-    reinitializing the structure of an HDU if any of the required
-    keywords (e.g., NAXISn) have been modified.  In practice it should
-    rarely be necessary to call this routine because CFITSIO
->   internally calls it in most situations. \label{ffrdef}
--
-  int fits_set_hdustruc / ffrdef
-      (fitsfile *fptr, > int *status)   (DEPRECATED)
--
-
-**C.  Specialized Header Keyword Routines
+    myfile.fit[compress]    - use Rice algorithm and default tile size
 
-***1.  Header Information Routines
+    myfile.fit[compress GZIP] - use the specified compression algorithm;
+    myfile.fit[compress Rice]     only the first letter of the algorithm 
+    myfile.fit[compress PLIO]     name is required.
 
->1  Reserve space in the CHU for MOREKEYS more header keywords.
-    This routine may be called to allocate space for additional keywords
-    at the time the header is created (prior to writing any data).
-    CFITSIO can dynamically add more space to the header when needed,
-    however it is more efficient to preallocate the required space
->   if the size is known in advance. \label{ffhdef}
--
-  int fits_set_hdrsize / ffhdef
-      (fitsfile *fptr, int morekeys, > int *status)
--
->2  Return the number of keywords in the header (not counting the END
-    keyword) and the current position
-    in the header.  The position is the number of the keyword record that
-    will be read next (or one greater than the position of the last keyword
-    that was read). A value of 1 is returned if the pointer is
->   positioned at the beginning of the header. \label{ffghps}
--
-  int fits_get_hdrpos / ffghps
-      (fitsfile *fptr, > int *keysexist, int *keynum, int *status)
+    myfile.fit[compress Rice 100,100]   - use 100 x 100 pixel tile size
+    myfile.fit[compress Rice 100,100;2] - as above, and use noisebits = 2
 -
 
-***2.  Read and Write the Required Keywords
+**F.  HDU Location Specification
 
->1  Write the primary header or IMAGE extension keywords into the CHU.
-  The simpler fits\_write\_imghdr routine is equivalent to calling 
-  fits\_write\_grphdr with the default values of simple = TRUE, pcount = 0,
-  gcount = 1, and extend =
-  TRUE.  The PCOUNT, GCOUNT and EXTEND keywords are not required in the
-  primary header and are only written if pcount is not equal to zero,
-  gcount is not equal to zero or one, and if extend is TRUE,
-  respectively.  When writing to an IMAGE extension, the SIMPLE and
-  EXTEND parameters are ignored.  It is recommended that fits\_create\_image
-  or fits\_create\_tbl be used instead of these routines to write the
-> required header keywords. \label{ffphpr} \label{ffphps}
--
-  int fits_write_imghdr / ffphps
-      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
+The optional HDU location specifier defines which HDU (Header-Data
+Unit, also known as an `extension') within the FITS file to initially
+open.  It must immediately follow the base file name (or the output
+file name if present).  If it is not specified then the first HDU (the
+primary array) is opened.  The HDU location specifier is required if
+the colFilter, rowFilter, or binSpec specifiers are present, because
+the primary array is not a valid HDU for these operations. The HDU may
+be specified either by absolute position number, starting with 0 for
+the primary array, or by reference to the HDU name, and optionally, the
+version number and the HDU type of the desired extension.  The location
+of an image within a single cell of a binary table may also be 
+specified, as described below.
 
-  int fits_write_grphdr / ffphpr
-      (fitsfile *fptr, int simple, int bitpix, int naxis, long *naxes,
-       long pcount, long gcount, int extend, > int *status)
--
->2  Write the ASCII table header keywords into the CHU.  The optional
-    TUNITn and EXTNAME keywords are written only if the input pointers
-    are not null.  A null pointer may given for the
-    *tbcol parameter in which case a single space will be inserted
-    between each column of the table.  Similarly, if rowlen is
-    given = 0, then CFITSIO will calculate the default rowlength based on
->   the tbcol and ttype values. \label{ffphtb}
--
-  int fits_write_atblhdr / ffphtb
-      (fitsfile *fptr, long rowlen, long nrows, int tfields, char **ttype,
-       long *tbcol, char **tform, char **tunit, char *extname, > int *status)
--
->3  Write the binary table header keywords into the CHU.   The optional
-   TUNITn and EXTNAME keywords are written only if the input pointers
-   are not null.  The pcount parameter, which specifies the
-   size of the variable length array heap, should initially = 0;
-   CFITSIO will automatically update the PCOUNT keyword value if any
-   variable length array data is written to the heap.  The TFORM keyword
-   value for variable length vector columns should have the form 'Pt(len)'
-   or '1Pt(len)' where `t' is the data type code letter (A,I,J,E,D, etc.)
-   and  `len' is an integer specifying the maximum length of the vectors
-   in that column (len must be greater than or equal to the longest
-   vector in the column).  If `len' is not specified when the table is
-   created (e.g., the input TFORMn value is just '1Pt') then CFITSIO will
-   scan the column when the table is first closed and will append the
-   maximum length to the TFORM keyword value.  Note that if the table
-   is subsequently modified to increase the maximum length of the vectors
-   then the modifying program is responsible for also updating the TFORM 
->  keyword value.  \label{ffphbn}
--
-  int fits_write_btblhdr / ffphbn
-      (fitsfile *fptr, long nrows, int tfields, char **ttype,
-       char **tform, char **tunit, char *extname, long pcount, > int *status)
--
->4  Read the primary header or IMAGE extension keywords in the CHU.  When
-    reading from an IMAGE extension the SIMPLE and EXTEND parameters are
-    ignored.  A null pointer may be supplied for any of the returned
->   parameters that are not needed. \label{ffghpr}
--
-  int fits_read_imghdr / ffghpr
-      (fitsfile *fptr, int maxdim, > int *simple, int *bitpix, int *naxis,
-       long *naxes, long *pcount, long *gcount, int *extend, int *status)
--
->5  Read the ASCII table header keywords in the CHU.
-    A null pointer may be supplied for any of the returned
->   parameters that are not needed. \label{ffghtb}
--
-  int fits_read_atblhdr / ffghtb
-      (fitsfile *fptr,int maxdim, > long *rowlen, long *nrows,
-       int *tfields, char **ttype, long *tbcol, char **tform, char **tunit,
-       char *extname,  int *status)
--
->6 Read the binary table header keywords from the CHU.
-    A null pointer may be supplied for any of the returned
->   parameters that are not needed. \label{ffghbn}
--
-  int fits_read_btblhdr / ffghbn
-      (fitsfile *fptr, int maxdim, > long *nrows, int *tfields,
-       char **ttype, char **tform, char **tunit, char *extname,
-       long *pcount, int *status)
--
-***3.  Specialized Write Keyword Routines
+The absolute position of the extension is specified either by enclosed
+the number in square brackets (e.g., `[1]' = the first extension
+following the primary array) or by preceded the number with a plus sign
+(`+1').  To specify the HDU by name, give the name of the desired HDU
+(the value of the EXTNAME or HDUNAME keyword) and optionally the
+extension version number (value of the EXTVER keyword) and the
+extension type (value of the XTENSION keyword: IMAGE, ASCII or TABLE,
+or BINTABLE), separated by commas and all enclosed in square brackets.
+If the value of EXTVER and XTENSION are not specified, then the first
+extension with the correct value of EXTNAME is opened. The extension
+name and type are not case sensitive, and the extension type may be
+abbreviated to a single letter (e.g., I = IMAGE extension or primary
+array, A or T = ASCII table extension, and B = binary table BINTABLE
+extension).   If the HDU location specifier is equal to `[PRIMARY]' or
+`[P]', then the primary array (the first HDU) will be opened.
 
-These routines simply append a new keyword to the header and do not
-check to see if a keyword with the same name already exists.  In
-general it is preferable to use the fits\_update\_key routine to ensure
-that the same keyword is not written more than once to the header.  See
-Appendix B for the definition of the parameters used in these
-routines.
+FITS images are most commonly stored in the primary array or an image
+extension, but images can also be stored as a vector in a single cell
+of a binary table (i.e. each row of the vector column contains a
+different image).  Such an image can be opened with CFITSIO by
+specifying the desired column  name and the row number after the binary
+table HDU specifier as shown in the following examples. The column name
+is separated from the HDU specifier by a semicolon and the row number
+is enclosed in parentheses.  In this case CFITSIO copies the image from
+the table cell into a temporary primary array before it is opened.  The
+application program then just sees the image in the primary array,
+without any extensions.  The particular row to be opened may be
+specified either by giving an absolute integer row number (starting
+with 1 for the first row), or by specifying a boolean expression that
+evaluates to TRUE for the desired row.  The first row that satisfies
+the expression will be used.  The row selection expression has the same
+syntax as described in the Row Filter Specifier section, below.
 
->1  Write (append) a new keyword with an undefined, or null, value into the CHU.
-    The value string of the keyword is left blank in this case.  A null
->   pointer may be entered for the comment parameter. \label{ffpkyu}
+ Examples:
 -
-  int fits_write_key_null / ffpkyu
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+   myfile.fits[3] - open the 3rd HDU following the primary array
+   myfile.fits+3  - same as above, but using the FTOOLS-style notation  
+   myfile.fits[EVENTS] - open the extension that has EXTNAME = 'EVENTS'
+   myfile.fits[EVENTS, 2]  - same as above, but also requires EXTVER = 2
+   myfile.fits[events,2,b] - same, but also requires XTENSION = 'BINTABLE'
+   myfile.fits[3; images(17)] - opens the image in row 17 of the 'images'
+                                column in the 3rd extension of the file.
+   myfile.fits[3; images(exposure > 100)] - as above, but opens the image
+                   in the first row that has an 'exposure' column value
+                   greater than 100.
 -
 
->2   Write (append) a new keyword of the appropriate datatype into the CHU.
-     A null pointer may be entered for the comment parameter, which
-     will cause the comment field of the keyword to be left blank.  The
-     flt, dbl, cmp, and dblcmp versions of this routine have the added
-     feature that if the 'decimals' parameter is negative, then the 'G'
-     display format rather then the 'E' format will be used when
-     constructing the keyword value, taking the absolute value of
-     'decimals' for the precision.  This will suppress trailing zeros,
-     and will use a fixed format rather than an exponential format,
->    depending on the magnitude of the value. \label{ffpkyx}
--
-  int fits_write_key_str / ffpkys
-      (fitsfile *fptr, char *keyname, char *value, char *comment,
-       > int *status)
- 
-  int fits_write_key_[log, lng] /  ffpky[lj]
-      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
-       > int *status)
- 
-  int fits_write_key_[flt, dbl, fixflg, fixdbl] / ffpky[edfg] 
-      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
-      char *comment, > int *status)
+**G.  Image Section
 
-  int fits_write_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffpk[yc,ym,fc,fm]
-      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
-      char *comment, > int *status)
--
->3  Write (append) a string valued keyword into the CHU which may be longer
-    than 68 characters in length.  This uses the Long String Keyword
-    convention that is described in the`Local FITS Conventions' section
-    in Chapter 4.  Since this uses a non-standard FITS convention to
-    encode the long keyword string, programs which use this routine
-    should also call the fits\_write\_key\_longwarn routine to add some
-    COMMENT keywords to warn users of the FITS file that this
-    convention is being used.  The fits\_write\_key\_longwarn routine
-    also writes a keyword called LONGSTRN to record the version of the
-    longstring convention that has been used, in case a new convention
-    is adopted at some point in the future.   If the LONGSTRN keyword
-    is already present in the header, then fits\_write\_key\_longwarn
-    will
->   simply return without doing anything. \label{ffpkls} \label{ffplsw}
--
-  int fits_write_key_longstr / ffpkls
-      (fitsfile *fptr, char *keyname, char *longstr, char *comment,
-       > int *status)
- 
-  int fits_write_key_longwarn / ffplsw
-      (fitsfile *fptr, > int *status)
--
->4  Write (append) a numbered sequence of keywords into the CHU.  The
-    starting index number (nstart) must be greater than 0. One may
-    append the same comment to every keyword (and eliminate the need
-    to have an array of identical comment strings, one for each keyword) by
-    including the ampersand character as the last non-blank character in the
-    (first) COMMENTS string parameter.  This same string
-    will then be used for the comment field in all the keywords.
-    One may also enter a null pointer for the comment parameter to
->   leave the comment field of the keyword blank. \label{ffpknx}
--
-  int fits_write_keys_str / ffpkns
-      (fitsfile *fptr, char *keyroot, int nstart, int nkeys,
-       char **value, char **comment, > int *status)
- 
-  int fits_write_keys_[log, lng] / ffpkn[lj]
-      (fitsfile *fptr, char *keyroot, int nstart, int nkeys,
-       DTYPE *numval, char **comment, int *status)
- 
-  int fits_write_keys_[flt, dbl, fixflg, fixdbl] / ffpkne[edfg]
-      (fitsfile *fptr, char *keyroot, int nstart, int nkey,
-       DTYPE *numval, int decimals, char **comment, > int *status)
--
->5 Copy an indexed keyword from one HDU to another, modifying
-    the index number of the keyword name in the process.  For example,
-    this routine could read the TLMIN3 keyword from the input HDU
-    (by giving keyroot = "TLMIN" and innum = 3) and write it to the
-    output HDU with the keyword name TLMIN4 (by setting outnum = 4).
-    If the input keyword does not exist, then this routine simply
->   returns without indicating an error. \label{ffcpky}
--
-  int fits_copy_key / ffcpky
-      (fitsfile *infptr, fitsfile *outfptr, int innum, int outnum,
-       char *keyroot, > int *status)
--
->6 Write (append) a `triple precision' keyword into the CHU in F28.16 format.
-    The floating point keyword value is constructed by concatenating the
-    input integer value with the input double precision fraction value
-    (which must have a value between 0.0 and 1.0). The ffgkyt routine should
-    be used to read this keyword value, because the other keyword reading
->   routines will not preserve the full precision of the value. \label{ffpkyt}
--
-  int fits_write_key_triple / ffpkyt
-      (fitsfile *fptr, char *keyname, long intval, double frac,
-       char *comment, > int *status)
--
->7 Write keywords to the CHDU that are defined in an ASCII template file.
-   The format of the template file is described under the fits\_parse\_template
->  routine below. \label{ffpktp}
--
-  int fits_write_key_template / ffpktp
-      (fitsfile *fptr, const char *filename, > int *status)
+A virtual file containing a rectangular subsection of an image can be
+extracted and opened by specifying the range of pixels (start:end)
+along each axis to be extracted from the original image.  One can also
+specify an optional pixel increment (start:end:step) for each axis of
+the input image.  A pixel step = 1 will be assumed if it is not
+specified.  If the start pixel is larger then the end pixel, then the
+image will be flipped (producing a mirror image) along that dimension.
+An asterisk, '*', may be used to specify the entire range of an axis,
+and '-*' will flip the entire axis. The input image can be in the
+primary array, in an image extension, or contained in a vector cell of
+a binary table. In the later 2 cases the extension name or number must
+be specified before the image section specifier.
+
+ Examples:
 -
-***4.   Insert Keyword Routines
+  myfile.fits[1:512:2, 2:512:2] -  open a 256x256 pixel image
+              consisting of the odd numbered columns (1st axis) and 
+              the even numbered rows (2nd axis) of the image in the 
+              primary array of the file.
 
-These insert routines are somewhat less efficient than the `update' or
-`write' keyword routines  because the following keywords in the header
-must be shifted down to make room for the inserted keyword.  See
-Appendix B for the definition of the parameters used in these
-routines.
+  myfile.fits[*, 512:256] - open an image consisting of all the columns
+              in the input image, but only rows 256 through 512.  
+              The image will be flipped along the 2nd axis since
+              the starting pixel is greater than the ending pixel.
 
->1  Insert a new keyword record into the CHU at the specified position
-    (i.e., immediately preceding the (keynum)th keyword in the header.)
->  \label{ffirec}
--
-  int fits_insert_record / ffirec
-      (fitsfile *fptr, int keynum, char *card, > int *status)
+  myfile.fits[*:2, 512:256:2] - same as above but keeping only
+              every other row and column in the input image.
+
+  myfile.fits[-*, *] - copy the entire image, flipping it along
+              the first axis.
+
+  myfile.fits[3][1:256,1:256] - opens a subsection of the image that
+              is in the 3rd extension of the file.
+
+  myfile.fits[4; images(12)][1:10,1:10] - open an image consisting
+	      of the first 10 pixels in both dimensions. The original
+	      image resides in the 12th row of the 'images' vector
+	      column in the table in the 4th extension of the file.
 -
->2  Insert a new keyword into the CHU.  The new keyword is inserted
-    immediately following the last keyword that has been read from the
-    header.  The `longstr' version has the same functionality as the
-    `str' version except that it also supports the local long string
-    keyword convention for strings longer than 68 characters.  A null
-    pointer may be entered for the comment parameter which will cause
-    the comment field to be left blank.  The flt, dbl, cmp, and dblcmp
-    versions of this routine have the added
-     feature that if the 'decimals' parameter is negative, then the 'G'
-     display format rather then the 'E' format will be used when
-     constructing the keyword value, taking the absolute value of
-     'decimals' for the precision.  This will suppress trailing zeros,
-     and will use a fixed format rather than an exponential format,
->    depending on the magnitude of the value. \label{ffikyx}
+
+When CFITSIO opens an image section it first creates a temporary file
+containing the image section plus a copy of any other HDUs in the
+file.  This temporary file is then opened by the application program,
+so it is not possible to write to or modify the input file when
+specifying an image section.  Note that CFITSIO automatically updates
+the world coordinate system keywords in the header of the image
+section, if they exist, so that the coordinate associated with each
+pixel in the image section will be computed correctly.
+
+**H.  Column and Keyword Filtering Specification
+
+The optional column/keyword filtering specifier is used to modify the
+column structure and/or the header keywords in the HDU that was
+selected with the previous HDU location specifier. This filtering
+specifier must be enclosed in square brackets and can be distinguished
+from a general row filter specifier (described below) by the fact that
+it begins with the string 'col ' and is not immediately followed by an
+equals sign.  The original file is not changed by this filtering
+operation, and instead the modifications are made on a copy of the
+input FITS file (usually in memory), which also contains a copy of all
+the other HDUs in the file.  This temporary file is passed to the
+application program and will persist only until the file is closed or
+until the program exits, unless the outfile specifier (see above) is
+also supplied.
+
+The column/keyword filter can be used to perform the following
+operations.  More than one operation may be specified by separating
+them with semi-colons.
+
+\begin{itemize}
+
+\item
+Copy only a specified list of columns columns to the filtered input file.
+The list of column name should be separated by semi-colons.  Wild card
+characters may be used in the column names to match multiple columns.
+If the expression contains both a list of columns to be included and
+columns to be deleted, then all the columns in the original table 
+except the explicitly deleted columns will appear in the filtered
+table (i.e., there is no need to explicitly list the columns to
+be included if any columns are being deleted).
+
+\item
+Delete a column or keyword by listing the name preceded by a minus sign
+or an exclamation mark (!), e.g., '-TIME' will delete the TIME column
+if it exists, otherwise the TIME keyword.  An error is returned if
+neither a column nor keyword with this name exists.  Note  that the
+exclamation point,  '!', is a special UNIX character, so if it is used
+on the command line rather than entered at a task prompt, it must be
+preceded by a backslash to force the UNIX shell to ignore it.
+
+\item
+Rename an existing column or keyword with the syntax 'NewName ==
+OldName'.  An error is returned if neither a column nor keyword with
+this name exists.
+
+\item
+Append a new column or keyword to the table.  To create a column,
+give the new name, optionally followed by the data type in parentheses,
+followed by a single equals sign and an  expression to be used to
+compute the value (e.g., 'newcol(1J) = 0' will create a new 32-bit
+integer column called 'newcol' filled with zeros).  The data type is
+specified using the same syntax that is allowed for the value of the
+FITS TFORMn keyword (e.g., 'I', 'J', 'E', 'D', etc. for binary tables,
+and 'I8', F12.3', 'E20.12', etc. for ASCII tables).  If the data type is
+not specified then an appropriate data type will be chosen depending on
+the form of the expression (may be a character string, logical, bit, long
+integer, or double column). An appropriate vector count (in the case
+of binary tables) will also be added if not explicitly specified.
+
+When creating a new keyword, the keyword name must be preceded by a 
+pound sign '\#', and the expression must evaluate to a scalar
+(i.e., cannot have a column name in the expression).  The comment
+string for the keyword may be specified in parentheses immediately
+following the keyword name (instead of supplying a data type as in
+the case of creating a new column).
+
+\item
+Recompute (overwrite) the values in an existing column or keyword by
+giving the name followed by an equals sign and an arithmetic
+expression.
+\end{itemize}
+
+The expression that is used when appending or recomputing columns or
+keywords can be arbitrarily complex and may be a function of other
+header keyword values and other columns (in the same row).  The full
+syntax and available functions for the expression are described below
+in the row filter specification section.
+
+
+For  complex  or commonly used operations,  one  can also  place the
+operations into an external text  file and import it  into the  column
+filter using  the syntax '[col @filename.txt]'.   The operations can
+extend over multiple lines of the  file, but multiple operations must
+still be separated by semicolons.   Any lines in the external text file
+that begin with 2 slash characters ('//') will be ignored and may be
+used to add comments into the file.
+
+Examples:
 -
-  int fits_insert_key_[str, longstr] / ffi[kys, kls]
-      (fitsfile *fptr, char *keyname, char *value, char *comment,
-       > int *status)
- 
-  int fits_insert_key_[log, lng] / ffiky[lj]
-      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
-       > int *status)
- 
-  int fits_insert_key_[flt, fixflt, dbl, fixdbl] / ffiky[edfg]
-      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
-       char *comment, > int *status)
+   [col Time;rate]               - only the Time and rate columns will
+                                   appear in the filtered input file.
 
-  int fits_insert_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffik[yc,ym,fc,fm]
-      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
-       char *comment, > int *status)
+   [col Time;*raw]               - include the Time column and any other
+                                   columns whose name ends with 'raw'.
+
+   [col -TIME; Good == STATUS]   - deletes the TIME column and
+                                   renames the status column to 'Good'
+
+   [col PI=PHA * 1.1 + 0.2]      - creates new PI column from PHA values
+
+   [col rate = rate/exposure]   - recomputes the rate column by dividing
+                                   it by the EXPOSURE keyword value.
 -
->3  Insert a new keyword with an undefined, or null, value into the CHU.
->   The value string of the keyword is left blank in this case. \label{ffikyu}
+
+**I.  Row Filtering Specification
+
+    When entering the name of a FITS table that is to be opened by a
+    program, an optional row filter may be specified to select a subset
+    of the rows in the table.  A temporary new FITS file is created on
+    the fly which contains only those rows for which the row filter
+    expression evaluates to true.  (The primary array and any other
+    extensions in the input file are also copied to the temporary
+    file).  The original FITS file is closed and the new virtual file
+    is opened by the application program.  The row filter expression is
+    enclosed in square brackets following the file name and extension
+    name (e.g., 'file.fits[events][GRADE==50]'  selects only those rows
+    where the GRADE column value equals 50).   When dealing with tables
+    where each row has an associated time and/or 2D spatial position,
+    the row filter expression can also be used to select rows based on
+    the times in a Good Time Intervals (GTI) extension, or on spatial
+    position as given in a SAO-style region file.
+
+***1.  General Syntax
+
+    The row filtering  expression can be an arbitrarily  complex series
+    of operations performed  on constants,  keyword values,  and column
+    data taken from the specified FITS TABLE extension.  The expression
+    must evaluate to a boolean  value for each row  of the table, where
+    a value of FALSE means that the row will be excluded.
+
+    For complex or commonly  used filters, one can place the expression
+    into a text file and import it into the row filter using the syntax
+    '[@filename.txt]'.  The expression can be  arbitrarily complex and
+    extend over multiple lines of the file.  Any lines in the external
+    text file that begin with 2 slash characters ('//') will be ignored
+    and may be used to add comments into the file.
+
+    Keyword and   column data  are referenced by   name.  Any  string of
+    characters not surrounded by    quotes (ie, a constant  string)   or
+    followed by   an open parentheses (ie,   a  function name)   will be
+    initially interpreted   as a column  name and  its contents for the
+    current row inserted into the expression.  If no such column exists,
+    a keyword of that  name will be searched for  and its value used, if
+    found.  To force the  name to be  interpreted as a keyword (in case
+    there is both a column and keyword with the  same name), precede the
+    keyword name with a single pound sign, '\#', as in '\#NAXIS2'.  Due to
+    the generalities of FITS column and  keyword names, if the column or
+    keyword name  contains a space or a  character which might appear as
+    an arithmetic  term then inclose  the  name in '\$'  characters as in
+    \$MAX PHA\$ or \#\$MAX-PHA\$.  Names are case insensitive.
+
+    To access a table entry in a row other  than the current one, follow
+    the  column's name  with  a row  offset  within  curly  braces.  For
+    example, 'PHA\{-3\}' will evaluate to the value  of column PHA, 3 rows
+    above  the  row currently  being processed.   One  cannot specify an
+    absolute row number, only a relative offset.  Rows that fall outside
+    the table will be treated as undefined, or NULLs.
+
+    Boolean   operators can be  used in  the expression  in either their
+    Fortran or C forms.  The following boolean operators are available:
 -
-  int fits_insert_key_null / ffikyu
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+    "equal"         .eq. .EQ. ==  "not equal"          .ne.  .NE.  !=
+    "less than"     .lt. .LT. <   "less than/equal"    .le.  .LE.  <= =<
+    "greater than"  .gt. .GT. >   "greater than/equal" .ge.  .GE.  >= =>
+    "or"            .or. .OR. ||  "and"                .and. .AND. &&
+    "negation"     .not. .NOT. !  "approx. equal(1e-7)"  ~
 -
 
-***5.   Specialized Read Keyword Routines
+Note  that the exclamation
+point,  '!', is a special UNIX character, so if it is used  on the
+command line rather than entered at a task prompt, it must be  preceded
+by a backslash to force the UNIX shell to ignore it.
 
-Wild card characters may be used when specifying the name of the
-keyword to be read.  See Appendix B for the definition of the
-parameters used in these routines.
+    The expression may  also include arithmetic operators and functions.
+    Trigonometric  functions use  radians,  not degrees.  The  following
+    arithmetic  operators and  functions  can be  used in the expression
+    (function names are case insensitive). A null value will be returned
+    in case of illegal operations such as divide by zero, sqrt(negative)
+    log(negative), log10(negative), arccos(.gt. 1), arcsin(.gt. 1).
 
->1  Read the name, value (as a string), and comment of the nth keyword in CHU.
-    If a NULL comment pointer is given on input,
-    then the comment string will not be returned.  A null value string
-    will be returned if the keyword has no defined value (i.e., if the
->   value field in the keyword is blank). \label{ffgkyn}
--
-  int fits_read_keyn / ffgkyn
-      (fitsfile *fptr, int keynum, > char *keyname, char *value,
-       char *comment, int *status)
 -
->2  Read the next keyword whose name matches one of the strings in
-    'inclist' but does not match any of the strings in 'exclist'.
-    The strings in inclist and exclist may contain wild card characters
-    (*, ?, and \#) as described at the beginning of this section.
-    This routine searches from the current header position to the
-    end of the header, only, and does not continue the search from
-    the top of the header back to the original position.  The current
-    header position may be reset with the ffgrec routine.  Note
-    that nexc may be set = 0 if there are no keywords to be excluded.
-    This routine returns status = KEY\_NO\_EXIST if a matching
->   keyword is not found. \label{ffgnxk}
+    "addition"           +          "subtraction"          -
+    "multiplication"     *          "division"             /
+    "negation"           -          "exponentiation"       **   ^
+    "absolute value"     abs(x)     "cosine"               cos(x)
+    "sine"               sin(x)     "tangent"              tan(x)
+    "arc cosine"         arccos(x)  "arc sine"             arcsin(x)
+    "arc tangent"        arctan(x)  "arc tangent"          arctan2(x,y)
+    "hyperbolic cos"     cosh(x)    "hyperbolic sin"       sinh(x)
+    "hyperbolic tan"     tanh(x)    "round to nearest int" round(x)
+    "round down to int"  floor(x)   "round up to int"      ceil(x)
+    "exponential"        exp(x)     "square root"          sqrt(x)
+    "natural log"        log(x)     "common log"           log10(x)
+    "modulus"            i % j      "random # [0.0,1.0)"   random()
+    "minimum"            min(x,y)   "maximum"              max(x,y)
+    "if-then-else"       b?x:y
 -
-  int fits_find_nextkey / ffgnxk
-      (fitsfile *fptr, char **inclist, int ninc, char **exclist,
-       int nexc, > char *card, int  *status)
+
+    An alternate syntax for the min and max functions  has only a single
+    argument which  should be  a  vector value (see  below).  The result
+    will be the minimum/maximum element contained within the vector.
+    
+    The  following  type  casting  operators  are  available,  where the
+    inclosing parentheses are required and taken  from  the  C  language
+    usage. Also, the integer to real casts values to double precision:
 -
->3  Read the literal keyword value as a character string.  Regardless
-    of the datatype of the keyword, this routine simply returns the
-    string of characters in the value field of the keyword along with
-    the comment field.   If a NULL comment pointer is given on input,
->   then the comment string will not be returned. \label{ffgkey}
+                "real to integer"    (int) x     (INT) x
+                "integer to real"    (float) i   (FLOAT) i
 -
-  int fits_read_keyword / ffgkey
-      (fitsfile *fptr, char *keyname, > char *value, char *comment,
-       int *status)
+
+    In addition, several constants are built in  for  use  in  numerical
+    expressions:
+
 -
->4  Read a keyword value (with the appropriate datatype) and comment from
-    the CHU.  If a NULL comment pointer is given on input, then the comment
-    string will not be returned.  If the value of the keyword is not defined
-    (i.e., the value field is blank) then an error status = VALUE\_UNDEFINED
-    will be returned and the input value will not be changed.
->  \label{ffgkyx} \label{ffgkls}
+        #pi              3.1415...      #e             2.7182...
+        #deg             #pi/180        #row           current row number
+        #null         undefined value   #snull         undefined string
 -
-  int fits_read_key_str / ffgkys
-      (fitsfile *fptr, char *keyname, > char *value, char *comment,
-       int *status);
- 
-  NOTE: after calling the following routine, programs must explicitly free
-        the memory allocated for 'longstr' after it is no longer needed.
 
-  int fits_read_key_longstr / ffgkls
-      (fitsfile *fptr, char *keyname, > char **longstr, char *comment,
-             int *status)
- 
-  int fits_read_key_[log, lng, flt, dbl, cmp, dblcmp] / ffgky[ljedcm]
-      (fitsfile *fptr, char *keyname, > DTYPE *numval, char *comment,
-       int *status)
+    A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
+    "null" constants  are useful for conditionally  setting table values
+    to a NULL, or undefined, value (eg., "col1==-99 ? \#NULL : col1").
 
+    There is also a function for testing if  two  values  are  close  to
+    each  other,  i.e.,  if  they are "near" each other to within a user
+    specified tolerance. The  arguments,  value\_1  and  value\_2  can  be
+    integer  or  real  and  represent  the two values who's proximity is
+    being tested to be within the specified tolerance, also  an  integer
+    or real:
 -
->5  Read a sequence of indexed keyword values.   The starting index number
-    (nstart) must be greater than 0.   If the value of any of
-    the keywords is not defined (i.e., the value field is blank) then an
-    error status = VALUE\_UNDEFINED will be returned and the input 
-    value for the undefined keyword(s) will not be changed.  These
->   routines do not support wild card characters in the root name.\label{ffgknx}
--
-  int fits_read_keys_str / ffgkns
-      (fitsfile *fptr, char *keyname, int nstart, int nkeys,
-       > char **value, int *nfound,  int *status)
- 
-  int fits_read_keys_[log, lng, flt, dbl] / ffgkn[ljed]
-      (fitsfile *fptr, char *keyname, int nstart, int nkeys,
-       > DTYPE *numval, int *nfound, int *status)
+                    near(value_1, value_2, tolerance)
 -
->6  Read the value of a floating point keyword, returning the integer and
-    fractional parts of the value in separate routine arguments.
-    This routine may be used to read any keyword but is especially
-    useful for reading the 'triple precision' keywords written by ffpkyt.
->  \label{ffgkyt}
+    When  a  NULL, or undefined, value is encountered in the FITS table,
+    the expression will evaluate to NULL unless the undefined  value  is
+    not   actually   required  for  evaluation,  e.g. "TRUE  .or.  NULL" 
+    evaluates to TRUE. The  following  two  functions  allow  some  NULL
+    detection  and  handling:
 -
-  int fits_read_key_triple / ffgkyt
-      (fitsfile *fptr, char *keyname, > long *intval, double *frac,
-       char *comment, int *status)
+         "a null value?"              ISNULL(x)
+         "define a value for null"    DEFNULL(x,y)
 -
-***6.   Modify Keyword Routines
+    The former
+    returns a boolean value of TRUE if the  argument  x  is  NULL.   The
+    later  "defines"  a  value  to  be  substituted  for NULL values; it
+    returns the value of x if x is not NULL, otherwise  it  returns  the
+    value of y.
+    
+***2.  Bit Masks
 
-These routines modify the value of an existing keyword.  An error is
-returned if the keyword does not exist.  Wild card characters may be
-used when specifying the name of the keyword to be modified.  See
-Appendix B for the definition of the parameters used in these
-routines.
+    Bit  masks can be used to select out rows from bit columns (TFORMn =
+    \#X) in FITS files. To represent the mask,  binary,  octal,  and  hex
+    formats are allowed:
 
->>1  Modify (overwrite) the nth 80-character header record in the CHU. \label{ffmrec}
--
-  int fits_modify_record / ffmrec
-      (fitsfile *fptr, int keynum, char *card, > int *status)
 -
->2  Modify (overwrite) the 80-character header record for the named keyword
-    in the CHU.  This can be used to overwrite the name of the keyword as
->   well as its value and comment fields. \label{ffmcrd}
+                 binary:   b0110xx1010000101xxxx0001
+                 octal:    o720x1 -> (b111010000xxx001)
+                 hex:      h0FxD  -> (b00001111xxxx1101)
 -
-  int fits_modify_card / ffmcrd
-      (fitsfile *fptr, char *keyname, char *card, > int *status)
+   
+    In  all  the  representations, an x or X is allowed in the mask as a
+    wild card. Note that the x represents a  different  number  of  wild
+    card  bits  in  each  representation.  All  representations are case
+    insensitive.
+    
+    To construct the boolean expression using the mask  as  the  boolean
+    equal  operator  described above on a bit table column. For example,
+    if you had a 7 bit column named flags in a  FITS  table  and  wanted
+    all  rows  having  the bit pattern 0010011, the selection expression
+    would be:
+
 -
->5  Modify the value and comment fields of an existing keyword in the CHU.
-    The `longstr' version has the same functionality as the `str'
-    version except that it also supports the local long string keyword
-    convention for strings longer than 68 characters.  Optionally, one
-    may modify only the value field and leave the comment field
-    unchanged by setting the input COMMENT parameter equal to the
-    ampersand character (\&) or by entering a null pointer for the
-    comment parameter.  The flt, dbl, cmp, and dblcmp versions of this
-    routine have the added feature that if the 'decimals' parameter is
-    negative, then the 'G' display format rather then the 'E' format
-    will be used when constructing the keyword value, taking the
-    absolute value of 'decimals' for the precision.  This will suppress
-    trailing zeros, and will use a fixed format rather than an
-    exponential format,
->   depending on the magnitude of the value. \label{ffmkyx}
+                            flags == b0010011
+    or
+                            flags .eq. b10011
 -
-  int fits_modify_key_[str, longstr] / ffm[kys, kls]
-      (fitsfile *fptr, char *keyname, char *value, char *comment,
-       > int *status);
- 
-  int fits_modify_key_[log, lng] / ffmky[lj]
-      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
-       > int *status)
- 
-  int fits_modify_key_[flt, dbl, fixflt, fixdbl] / ffmky[edfg]
-      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
-       char *comment, > int *status)
 
-  int fits_modify_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffmk[yc,ym,fc,fm]
-      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
-       char *comment, > int *status)
+    It is also possible to test if a range of bits is  less  than,  less
+    than  equal,  greater  than  and  greater than equal to a particular
+    boolean value:
+
 -
->6  Modify the value of an existing keyword to be undefined, or null.
-    The value string of the keyword is set to blank.
-    Optionally, one may leave the comment field unchanged by setting the 
-    input COMMENT parameter equal to 
->   the ampersand character (\&) or by entering a null pointer.  \label{ffmkyu} 
+                            flags <= bxxx010xx
+                            flags .gt. bxxx100xx
+                            flags .le. b1xxxxxxx
+-
+   
+    Notice the use of the x bit value to limit the range of  bits  being
+    compared.
+    
+    It  is  not necessary to specify the leading (most significant) zero
+    (0) bits in the mask, as shown in the second expression above.
+    
+    Bit wise AND, OR and NOT operations are  also  possible  on  two  or
+    more  bit  fields  using  the  '\&'(AND),  '$|$'(OR),  and the '!'(NOT)
+    operators. All of these operators result in a bit  field  which  can
+    then be used with the equal operator. For example:
+
 -
-  int fits_modify_key_null / ffmkyu
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+                          (!flags) == b1101100
+                          (flags & b1000001) == bx000001
 -
-***7.   Specialized Update Keyword Routines \label{FFUCRD}
 
->1  These update routines modify the value, and optionally the comment field,
-    of the keyword if it already exists, otherwise the new keyword is
-    appended to the header.  A separate routine is provided for each
-    keyword datatype.  The `longstr' version has the same functionality
-    as the `str' version except that it also supports the local long
-    string keyword convention for strings longer than 68 characters.  A
-    null pointer may be entered for the comment parameter which will
-    leave the comment field unchanged or blank.  The flt, dbl, cmp, and
-    dblcmp versions of this routine have the added feature that if the
-    'decimals' parameter is negative, then the 'G' display format
-    rather then the 'E' format will be used when constructing the
-    keyword value, taking the absolute value of 'decimals' for the
-    precision.  This will suppress trailing zeros, and will use a fixed
-    format rather than an exponential format,
->   depending on the magnitude of the value. \label{ffukyx}
--
-  int fits_update_key_[str, longstr] / ffu[kys, kls]
-      (fitsfile *fptr, char *keyname, char *value, char *comment,
-       > int *status)
- 
-  int fits_update_key_[log, lng] / ffuky[lj]
-      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
-       > int *status)
- 
-  int fits_update_key_[flt, dbl, fixflt, fixdbl] / ffuky[edfg]
-      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
-       char *comment, > int *status)
+    Bit  fields can be appended as well using the '+' operator.  Strings
+    can be concatenated this way, too.
 
-  int fits_update_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffuk[yc,ym,fc,fm]
-      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
-       char *comment, > int *status)
+***3.  Vector Columns
+
+    Vector columns can also be used  in  building  the  expression.   No
+    special  syntax  is required if one wants to operate on all elements
+    of the vector.  Simply use the column name as for a  scalar  column.
+    Vector  columns  can  be  freely  intermixed  with scalar columns or
+    constants in virtually all expressions.  The result will be  of  the
+    same dimension as the vector.  Two vectors in an expression, though,
+    need to  have  the  same  number  of  elements  and  have  the  same
+    dimensions.   The  only  places  a vector column cannot be used (for
+    now, anyway) are the SAO  region  functions  and  the  NEAR  boolean
+    function.
+
+    Arithmetic and logical operations are all performed on an element by
+    element basis.  Comparing two vector columns,  eg  "COL1  ==  COL2",
+    thus  results  in  another vector of boolean values indicating which
+    elements of the two vectors are equal.
+
+    Eight functions are available that operate on a vector and return a
+    scalar result:
 -
-
-**D.  Define Data Scaling and Undefined Pixel Parameters
- 
-These routines define or modify the internal parameters used by CFITSIO
-to either scale the data or to represent undefined pixels.  Generally
-CFITSIO will scale the data according to the values of the BSCALE and
-BZERO (or TSCALn and TZEROn) keywords, however these routines may be
-used to override the keyword values.  This may be useful when one wants
-to read or write the raw unscaled values in the FITS file.  Similarly,
-CFITSIO generally uses the value of the BLANK or TNULLn keyword to
-signify an undefined pixel, but these routines may be used to override
-this value.  These routines do not create or modify the corresponding
-header keyword values.  See Appendix B for the definition of the
-parameters used in these routines.
- 
->1  Reset the scaling factors in the primary array or image extension; does
-    not change the BSCALE and BZERO keyword values and only affects the
-    automatic scaling performed when the data elements are written/read
-    to/from the FITS file.   When reading from a FITS file the returned
-    data value = (the value given in the FITS array) * BSCALE + BZERO.
-    The inverse formula is used when writing data values to the FITS
->   file. \label{ffpscl}
+    "minimum"      MIN(V)          "maximum"               MAX(V)
+    "average"      AVERAGE(V)      "median"                MEDIAN(V)
+    "sumation"     SUM(V)          "standard deviation"    STDDEV(V)
+    "# of values"  NELEM(V)        "# of non-null values"  NVALID(V)
 -
-  int fits_set_bscale / ffpscl
-      (fitsfile *fptr, double scale, double zero, > int *status)
+    where V represents the name of a vector column or a manually 
+    constructed vector using curly brackets as described below.  The
+    first 6 of these functions ignore any null values in the vector when
+    computing the result.
+    
+    The SUM function literally sums all  the elements in x,  returning a 
+    scalar value.   If V  is  a  boolean  vector, SUM returns the number
+    of TRUE elements. The NELEM function  returns the number of elements
+    in vector V whereas NVALID return the number of non-null elements in
+    the  vector.   (NELEM  also  operates  on  bit  and string  columns, 
+    returning their column widths.)  As an example, to  test whether all 
+    elements of two vectors satisfy a  given logical comparison, one can
+    use the expression
 -
->2  Reset the scaling parameters for a table column; does not change
-    the TSCALn or TZEROn keyword values and only affects the automatic
-    scaling performed when the data elements are written/read to/from
-    the FITS file.  When reading from a FITS file the returned data
-    value = (the value given in the FITS array) * TSCAL + TZERO.  The
-    inverse formula is used when writing data values to the FITS file.
->   \label{fftscl}
+              SUM( COL1 > COL2 ) == NELEM( COL1 )
 -
-  int fits_set_tscale / fftscl
-      (fitsfile *fptr, int colnum, double scale, double zero,
-       > int *status)
+
+    which will return TRUE if all elements  of  COL1  are  greater  than
+    their corresponding elements in COL2.
+    
+    To  specify  a  single  element  of  a  vector, give the column name
+    followed by  a  comma-separated  list  of  coordinates  enclosed  in
+    square  brackets.  For example, if a vector column named PHAS exists
+    in the table as a one dimensional, 256  component  list  of  numbers
+    from  which  you  wanted to select the 57th component for use in the
+    expression, then PHAS[57] would do the  trick.   Higher  dimensional
+    arrays  of  data  may appear in a column.  But in order to interpret
+    them, the TDIMn keyword must appear in the header.  Assuming that  a
+    (4,4,4,4)  array  is packed into each row of a column named ARRAY4D,
+    the  (1,2,3,4)  component  element  of  each  row  is  accessed   by 
+    ARRAY4D[1,2,3,4].    Arrays   up   to   dimension  5  are  currently 
+    supported.  Each vector index can itself be an expression,  although
+    it  must  evaluate  to  an  integer  value  within the bounds of the
+    vector.  Vector columns which contain spaces or arithmetic operators
+    must   have   their   names  enclosed  in  "\$"  characters  as  with 
+    \$ARRAY-4D\$[1,2,3,4].
+    
+    A  more  C-like  syntax  for  specifying  vector  indices  is   also 
+    available.   The element used in the preceding example alternatively
+    could be specified with the syntax  ARRAY4D[4][3][2][1].   Note  the
+    reverse  order  of  indices  (as in C), as well as the fact that the
+    values are still ones-based (as  in  Fortran  --  adopted  to  avoid
+    ambiguity  for  1D vectors).  With this syntax, one does not need to
+    specify all of the indices.  To  extract  a  3D  slice  of  this  4D
+    array, use ARRAY4D[4].
+    
+    Variable-length vector columns are not supported.
+    
+    Vectors can  be manually constructed  within the expression  using a
+    comma-separated list of  elements surrounded by curly braces ('\{\}').
+    For example, '\{1,3,6,1\}' is a 4-element vector containing the values
+    1, 3, 6, and 1.  The  vector can contain  only boolean, integer, and
+    real values (or expressions).  The elements will  be promoted to the
+    highest  data type   present.  Any   elements   which  are themselves
+    vectors, will be expanded out with  each of its elements becoming an
+    element in the constructed vector.
+
+***4.  Good Time Interval Filtering
+
+    A common filtering method involves selecting rows which have a time
+    value which lies within what is called a Good Time Interval or GTI.
+    The time intervals are defined in a separate FITS table extension
+    which contains 2 columns giving the start and stop time of each
+    good interval.  The filtering operation accepts only those rows of
+    the input table which have an associated time which falls within
+    one of the time intervals defined in the GTI extension. A high
+    level function, gtifilter(a,b,c,d), is available which evaluates
+    each row of the input table  and returns TRUE  or FALSE depending
+    whether the row is inside or outside the  good time interval.  The
+    syntax is
+-
+      gtifilter( [ "gtifile" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
+-
+    where  each "[]" demarks optional parameters.  Note that  the quotes
+    around the gtifile and START/STOP column are required.  Either single
+    or double quotes may be used. The gtifile,
+    if specified,  can be blank  ("") which will  mean to use  the first
+    extension  with   the name "*GTI*"  in   the current  file,  a plain
+    extension  specifier (eg, "+2",  "[2]", or "[STDGTI]") which will be
+    used  to  select  an extension  in  the current  file, or  a regular
+    filename with or without an extension  specifier which in the latter
+    case  will mean to  use the first  extension  with an extension name
+    "*GTI*".  Expr can be   any arithmetic expression, including  simply
+    the time  column  name.  A  vector  time expression  will  produce a
+    vector boolean  result.  STARTCOL and  STOPCOL are the  names of the
+    START/STOP   columns in the    GTI extension.  If   one  of them  is
+    specified, they both  must be.
+
+    In  its  simplest form, no parameters need to be provided -- default
+    values will be used.  The expression "gtifilter()" is equivalent to
+-   
+       gtifilter( "", TIME, "*START*", "*STOP*" )
+-    
+    This will search the current file for a GTI  extension,  filter  the
+    TIME  column in the current table, using START/STOP times taken from
+    columns in the GTI  extension  with  names  containing  the  strings
+    "START"  and "STOP".  The wildcards ('*') allow slight variations in
+    naming conventions  such  as  "TSTART"  or  "STARTTIME".   The  same
+    default  values  apply for unspecified parameters when the first one
+    or  two  parameters  are  specified.   The  function   automatically 
+    searches   for   TIMEZERO/I/F   keywords  in  the  current  and  GTI 
+    extensions, applying a relative time offset, if necessary.
+
+***5.  Spatial Region Filtering
+
+    Another common  filtering method selects rows based on whether the
+    spatial position associated with each row is located within a given 
+    2-dimensional region.  The syntax for this high-level filter is
 -
->3  Define the integer value to be used to signify undefined pixels in the
-    primary array or image extension.  This is only used if BITPIX = 8, 16,
-    or 32.  This does not create or change the value of the BLANK keyword in
->   the header. \label{ffpnul}
+       regfilter( "regfilename" [ , Xexpr, Yexpr [ , "wcs cols" ] ] )
 -
-  int fits_set_imgnul / ffpnul
-      (fitsfile *fptr, long nulval, > int *status)
+    where each "[]" demarks optional parameters. The region file name
+    is required and must be  enclosed in quotes.  The remaining
+    parameters are optional.  The region file is an ASCII text file
+    which contains a list of one or more geometric shapes (circle,
+    ellipse, box, etc.) which defines a region on the celestial sphere
+    or an area within a particular 2D image.  The region file is
+    typically generated using an image display program such as fv/POW
+    (distribute by the HEASARC), or ds9 (distributed by the Smithsonian
+    Astrophysical Observatory).  Users should refer to the documentation
+    provided with these programs for more details on the syntax used in
+    the region files.
+
+    In its simpliest form, (e.g., regfilter("region.reg") ) the
+    coordinates in the default 'X' and 'Y' columns will be used to
+    determine if each row is inside or outside the area specified in
+    the region file.  Alternate position column names, or expressions,
+    may be entered if needed, as in
+-
+        regfilter("region.reg", XPOS, YPOS)
+-
+    Region filtering can be applied most unambiguously if the positions
+    in the region file and in the table to be filtered are both give in
+    terms of absolute celestial coordinate units.  In this case the
+    locations and sizes of the geometric shapes in the region file are
+    specified in angular units on the sky (e.g., positions given in
+    R.A. and Dec.  and sizes in arcseconds or arcminutes).  Similarly,
+    each row of the filtered table will have a celestial coordinate
+    associated with it.  This association is usually implemented using
+    a set of so-called 'World Coordinate System' (or WCS) FITS keywords
+    that define the coordinate transformation that must be applied to
+    the values in the 'X' and 'Y' columns to calculate the coordinate.
+
+    Alternatively, one can perform spatial filtering using unitless
+    'pixel' coordinates for the regions and row positions.  In this
+    case the user must be careful to ensure that the positions in the 2
+    files are self-consistent.  A typical problem is that the region
+    file may be generated using a binned image, but the unbinned
+    coordinates are given in the event table.  The ROSAT events files,
+    for example, have X and Y pixel coordinates that range from 1 -
+    15360.  These coordinates are typically binned by a factor of 32 to
+    produce a 480x480 pixel image.  If one then uses a region file
+    generated from this image (in image pixel units) to filter the
+    ROSAT events file, then the X and Y column values must be converted
+    to corresponding pixel units as in:
+-
+        regfilter("rosat.reg", X/32.+.5, Y/32.+.5)
+-
+    Note that this binning conversion is not necessary if the region
+    file is specified using celestial coordinate units instead of pixel
+    units because CFITSIO is then able to directly compare the
+    celestial coordinate of each row in the table with the celestial
+    coordinates in the region file without having to know anything
+    about how the image may have been binned.
+
+    The last "wcs cols" parameter should rarely be needed. If supplied,
+    this  string contains the names of the 2 columns (space or comma
+    separated) which have the associated WCS keywords. If not supplied,
+    the filter  will scan the X  and Y expressions for column names.
+    If only one is found in each  expression, those columns will be
+    used, otherwise an error will be returned.
+
+    These region shapes are supported (names are case insensitive):
 -
->4  Define the string to be used to signify undefined pixels in
-    a column in an ASCII table.  This does not create or change the value
->   of the TNULLn keyword. \label{ffsnul}
+       Point         ( X1, Y1 )               <- One pixel square region
+       Line          ( X1, Y1, X2, Y2 )       <- One pixel wide region
+       Polygon       ( X1, Y1, X2, Y2, ... )  <- Rest are interiors with
+       Rectangle     ( X1, Y1, X2, Y2, A )       | boundaries considered
+       Box           ( Xc, Yc, Wdth, Hght, A )   V within the region
+       Diamond       ( Xc, Yc, Wdth, Hght, A )
+       Circle        ( Xc, Yc, R )
+       Annulus       ( Xc, Yc, Rin, Rout )
+       Ellipse       ( Xc, Yc, Rx, Ry, A )
+       Elliptannulus ( Xc, Yc, Rinx, Riny, Routx, Routy, Ain, Aout )
+       Sector        ( Xc, Yc, Amin, Amax )
 -
-  int fits_set_atblnull / ffsnul
-      (fitsfile *fptr, int colnum, char *nulstr, > int *status)
+    where (Xc,Yc) is  the coordinate of  the shape's center; (X\#,Y\#) are
+    the coordinates  of the shape's edges;  Rxxx are the shapes' various
+    Radii or semimajor/minor  axes; and Axxx  are the angles of rotation
+    (or bounding angles for Sector) in degrees.  For rotated shapes, the
+    rotation angle  can  be left  off, indicating  no rotation.   Common
+    alternate  names for the regions  can also be  used: rotbox = box;
+    rotrectangle = rectangle;  (rot)rhombus = (rot)diamond;  and pie
+    = sector.  When a  shape's name is  preceded by a minus sign, '-',
+    the defined region  is instead the area  *outside* its boundary (ie,
+    the region is inverted).  All the shapes within a single region
+    file are OR'd together to create the region, and the order is
+    significant. The overall way of looking at region files is that if
+    the first region is an excluded region then a dummy included region
+    of the whole detector is inserted in the front. Then each region
+    specification as it is processed overrides any selections inside of
+    that region specified by previous regions. Another way of thinking
+    about this is that if a previous excluded region is completely
+    inside of a subsequent included region the excluded region is
+    ignored.
+
+    The positional coordinates may be given either in pixel units,
+    decimal degrees or hh:mm:ss.s, dd:mm:ss.s units.  The shape sizes
+    may be given in pixels, degrees, arcminutes, or arcseconds.  Look
+    at examples of region file produced by fv/POW or ds9 for further
+    details of the region file format.
+
+    There are three functions that are primarily for use with SAO region
+    files and the  FSAOI  task, but they  can  be  used  directly.  They
+    return  a  boolean true   or  false  depending   on  whether a   two
+    dimensional point is in the region or not:
 -
->5  Define the value to be used to signify undefined pixels in
-    an integer column in a binary table (where TFORMn = 'B', 'I', or 'J').
-    This does not create or  change the value of the TNULLn keyword.
->   \label{fftnul}
+    "point in a circular region"
+          circle(xcntr,ycntr,radius,Xcolumn,Ycolumn)
+    
+    "point in an elliptical region"
+         ellipse(xcntr,ycntr,xhlf_wdth,yhlf_wdth,rotation,Xcolumn,Ycolumn)
+    
+    "point in a rectangular region"
+             box(xcntr,ycntr,xfll_wdth,yfll_wdth,rotation,Xcolumn,Ycolumn)
+    
+    where 
+       (xcntr,ycntr) are the (x,y) position of the center of the region
+       (xhlf_wdth,yhlf_wdth) are the (x,y) half widths of the region
+       (xfll_wdth,yfll_wdth) are the (x,y) full widths of the region
+       (radius) is half the diameter of the circle
+       (rotation) is the angle(degrees) that the region is rotated with
+             respect to (xcntr,ycntr)
+       (Xcoord,Ycoord) are the (x,y) coordinates to test, usually column
+             names
+       NOTE: each parameter can itself be an expression, not merely a
+             column name or constant.
 -
-  int fits_set_btblnul / fftnul
-      (fitsfile *fptr, int colnum, long nulval, > int *status)
+
+***5.  Example Row Filters
 -
-
-**E.  Specialized FITS Primary Array or IMAGE Extension I/O Routines 
- 
-These routines read or write data values in the primary data array
-(i.e., the first HDU in the FITS file) or an IMAGE extension.
-Automatic data type conversion is performed for if the data type of the
-FITS array (as defined by the BITPIX keyword) differs from the data
-type of the array in the calling routine.  The data values are
-automatically scaled by the BSCALE and BZERO header values as they are
-being written or read from the FITS array.  Unlike the basic routines
-described in the previous chapter, most of these routines specifically
-support the FITS random groups format.  See Appendix B for the
-definition of the parameters used in these routines.
+    [ binary && mag <= 5.0]        - Extract all binary stars brighter
+                                     than  fifth magnitude (note that
+                                     the initial space is necessary to
+                                     prevent it from being treated as a
+                                     binning specification)
 
-The more primitive reading and writing routines (i. e., ffppr\_,
-ffppn\_, ffppn, ffgpv\_, or ffgpf\_) simply treat the primary array as
-a long 1-dimensional array of pixels, ignoring the intrinsic
-dimensionality of the array.  When dealing with a 2D image, for
-example, the application program must calculate the pixel offset in the
-1-D array that corresponds to any particular X, Y coordinate in the
-image.  C programmers should note that the ordering of arrays in FITS
-files, and hence in all the CFITSIO calls, is more similar to the
-dimensionality of arrays in Fortran rather than C.  For instance if a
-FITS image has NAXIS1 = 100 and NAXIS2 = 50, then a 2-D array just
-large enough to hold the image should be declared as array[50][100] and
-not as array[100][50].
+    [#row >= 125 && #row <= 175]   - Extract row numbers 125 through 175
+
+    [IMAGE[4,5] .gt. 100]          - Extract all rows that have the
+                                     (4,5) component of the IMAGE column
+                                     greater than 100
+
+    [abs(sin(theta * #deg)) < 0.5] - Extract all rows having the
+                                     absolute value of the sine of theta
+                                     less  than a half where the angles
+                                     are tabulated in degrees
+
+    [SUM( SPEC > 3*BACKGRND )>=1]  - Extract all rows containing a
+                                     spectrum, held in vector column
+                                     SPEC, with at least one value 3
+                                     times greater than the background
+                                     level held in a keyword, BACKGRND
 
-For convenience, higher-level routines are also provided to specificly
-deal with 2D images (ffp2d\_ and ffg2d\_) and 3D data cubes (ffp3d\_
-and ffg3d\_).  The dimensionality of the FITS image is passed by the
-naxis1, naxis2, and naxis3 parameters and the declared dimensions of
-the program array are passed in the dim1 and dim2 parameters.  Note
-that the dimensions of the program array may be larger than the
-dimensions of the FITS array.  For example if a FITS image with NAXIS1
-= NAXIS2 = 400 is read into a program array which is dimensioned as 512
-x 512 pixels, then the image will just fill the lower left corner of
-the array with pixels in the range 1 - 400 in the X an Y directions.
-This has the effect of taking a contiguous set of pixel value in the
-FITS array and writing them to a non-contiguous array in program memory
-(i.e., there are now some blank pixels around the edge of the image in
-the program array).
+    [VCOL=={1,4,2}]                - Extract all rows whose vector column
+                                     VCOL contains the 3-elements 1, 4, and
+                                     2.
 
-The most general set of routines (ffpss\_, ffgsv\_, and ffgsf\_) may be
-used to transfer a rectangular subset of the pixels in a FITS
-N-dimensional image to or from an array which has been declared in the
-calling program.  The fpixel and lpixel parameters are integer arrays
-which specify the starting and ending pixel coordinate in each dimension
-(starting with 1, not 0) of the FITS image that is to be read or
-written.  It is important to note that these are the starting and
-ending pixels in the FITS image, not in the declared array in the
-program. The array parameter in these routines is treated simply as a
-large one-dimensional array of the appropriate datatype containing the
-pixel values; The pixel values in the FITS array are read/written
-from/to this program array in strict sequence without any gaps;  it is
-up to the calling routine to correctly interpret the dimensionality of
-this array.  The two FITS reading routines (ffgsv\_ and ffgsf\_ ) also
-have an `inc' parameter which defines the data sampling interval in
-each dimension of the FITS array.  For example, if inc[0]=2 and
-inc[1]=3 when reading a 2-dimensional FITS image, then only every other
-pixel in the first dimension and every 3rd pixel in the second
-dimension will be returned to the 'array' parameter.
+    [@rowFilter.txt]               - Extract rows using the expression
+                                     contained within the text file
+                                     rowFilter.txt
 
-Two types of routines are provided to read the data array which differ
-in the way undefined pixels are handled.  The first type of routines
-(e.g., ffgpv\_) simply return an array of data elements in which
-undefined pixels are set equal to a value specified by the user in the
-`nulval' parameter.  An additional feature of these routines is that if
-the user sets nulval = 0, then no checks for undefined pixels will be
-performed, thus reducing the amount of CPU processing.  The second type
-of routines (e.g., ffgpf\_) returns the data element array and, in
-addition, a char array which defines whether the corresponding data
-pixel is defined (= 1) or not (= 0).  The latter type of routines may
-be more convenient to use in some circumstances, however, it requires
-an additional array of logical values which can be unwieldy when
-working with large data arrays.
+    [gtifilter()]                  - Search the current file for a GTI
+				     extension,  filter  the TIME
+				     column in the current table, using
+				     START/STOP times taken from
+				     columns in the GTI  extension
 
->>1  Write elements into the FITS data array.  \label{ffppr}
--
-  int fits_write_img / ffppr
-      (fitsfile *fptr, int datatype, long firstelem, long nelements,
-       DTYPE *array, int *status);
--
->2  Write elements into the data array.  The datatype is specified
->   by the suffix of the name of the routine. \label{ffpprx}
--
-  int fits_write_img_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffppr[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long firstelem, long nelements,
-       DTYPE *array, > int *status);
--
->3  Write elements into the FITS data array, substituting the appropriate 
-   FITS null value for all elements which are equal to the input value
-   of nulval (note that this parameter gives the address of the null
-   value, not the null value itself).  For integer FITS arrays, the
-   FITS null value is defined by the BLANK keyword (an error is
-   returned if the BLANK keyword doesn't exist).  For floating point
-   FITS arrays  the special IEEE NaN (Not-a-Number) value will be
-   written into the FITS file.  If a null pointer is entered for
-   nulval, then the null value is
->  ignored and this routine behaves the same as fits\_write\_img. \label{ffppn}
+    [regfilter("pow.reg")]         - Extract rows which have a coordinate
+                                     (as given in the X and Y columns) 
+                                     within the spatial region specified
+                                     in the pow.reg region file. 
+
+    [regfilter("pow.reg", Xs, Ys)] - Same as above, except that the
+                                     Xs and Ys columns will be used to 
+                                     determine the coordinate of each
+                                     row in the table.
 -
-  int fits_write_imgnull / ffppn
-      (fitsfile *fptr, int datatype, long firstelem, long nelements,
-       DTYPE *array, DTYPE *nulval, > int *status);
+
+**J.   Binning or Histogramming Specification
+
+The optional binning specifier is enclosed in square brackets and can
+be distinguished from a general row filter specification by the fact
+that it begins with the keyword 'bin'  not immediately followed by an
+equals sign.  When binning is specified, a temporary N-dimensional FITS
+primary array is created by computing the histogram of the values in
+the specified columns of a FITS table extension.  After the histogram
+is computed the input FITS file containing the table is then closed and
+the temporary FITS primary array is opened and passed to the
+application program.  Thus, the application program never sees the
+original FITS table and only sees the image in the new temporary file
+(which has no additional extensions).  Obviously, the application
+program must be expecting to open a FITS image and not a FITS table in
+this case.
+
+The data type of the FITS histogram image may be specified by appending
+'b' (for 8-bit byte), 'i' (for 16-bit integers), 'j' (for 32-bit
+integer), 'r' (for 32-bit floating points), or 'd' (for 64-bit double
+precision floating point)  to the 'bin' keyword (e.g. '[binr X]'
+creates a real floating point image).  If the data type is not
+explicitly specified then a 32-bit integer image will be created by
+default, unless the weighting option is also specified in which case
+the image will have a 32-bit floating point data type by default.
+
+The histogram image may have from 1 to 4 dimensions (axes), depending
+on the number of columns that are specified.  The general form of the
+binning specification is:
 -
->4 Write elements into the data array, substituting the appropriate FITS null
-   value for all elements which are equal to the value of NULLVAL.  For
-   integer FITS arrays, the null value defined by the BLANK keyword or
-   a previous call to ffpnul
-   will be substituted;  for floating point FITS arrays (BITPIX = -32
-   or -64) then the special IEEE NaN (Not-a-Number) value will be
->  substituted.  \label{ffppnx}
+ [bin{bijrd}  Xcol=min:max:binsize, Ycol= ..., Zcol=..., Tcol=...; weight]
 -
-  int fits_write_imgnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffppn[b,i,ui,k,uk,j,uje,d]
-      (fitsfile *fptr, long group, long firstelem,
-           long nelements, DTYPE *array, DTYPE nulval, > int *status);
+in which up to 4 columns, each corresponding to an axis of the image,
+are listed. The column names are case insensitive, and the column
+number may be given instead of the name, preceded by a pound sign
+(e.g., [bin \#4=1:512]).  If the column name is not specified, then
+CFITSIO will first try to use the 'preferred column' as specified by
+the CPREF keyword if it exists (e.g., 'CPREF = 'DETX,DETY'), otherwise
+column names 'X', 'Y', 'Z', and 'T' will be assumed for each of the 4
+axes, respectively.  In cases where the column name could be confused
+with an arithmetic expression, enclose the column name in parentheses to
+force the name to be interpreted literally.
+
+Each column name may be followed by an equals sign and then the lower
+and upper range of the histogram, and the size of the histogram bins,
+separated by colons.  Spaces are allowed before and after the equals
+sign but not within the 'min:max:binsize' string.  The min, max and
+binsize values may be integer or floating point numbers, or they may be
+the names of keywords in the header of the table.  If the latter, then
+the value of that keyword is substituted into the expression.
+
+Default values for the min, max and binsize quantities will be
+used if not explicitly given in the binning expression as shown
+in these examples:
 -
->>5 Set data array elements as undefined. \label{ffppru}
+    [bin x = :512:2]  - use default minimum value
+    [bin x = 1::2]    - use default maximum value
+    [bin x = 1:512]   - use default bin size
+    [bin x = 1:]      - use default maximum value and bin size
+    [bin x = :512]    - use default minimum value and bin size
+    [bin x = 2]       - use default minimum and maximum values
+    [bin x]           - use default minimum, maximum and bin size
+    [bin 4]           - default 2-D image, bin size = 4 in both axes
+    [bin]             - default 2-D image
 -
-  int fits_write_img_null / ffppru
-      (fitsfile *fptr, long group, long firstelem, long nelements,
-       > int *status)
+CFITSIO  will use the value of the TLMINn, TLMAXn, and TDBINn keywords,
+if they exist, for the default min, max, and binsize, respectively.  If
+they do not exist then CFITSIO will use the actual minimum and maximum
+values in the column for the histogram min and max values.  The default
+binsize will be set to 1, or (max - min) / 10., whichever is smaller,
+so that the histogram will have at least 10 bins along each axis.
+
+A shortcut notation is allowed if all the columns/axes have the same
+binning specification.  In this case all the column names may be listed
+within parentheses, followed by the (single) binning specification, as
+in:
 -
->6  Write values into group parameters.  This routine only applies
-    to the `Random Grouped' FITS format which has been used for
-    applications in radio interferometry, but is offically deprecated
->   for future use.  \label{ffpgpx}
+    [bin (X,Y)=1:512:2]
+    [bin (X,Y) = 5]
 -
-  int fits_write_grppar_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffpgp[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long firstelem, long nelements,
-       > DTYPE *array, int *status)
+
+The optional weighting factor is the last item in the binning specifier
+and, if present, is separated from the list of columns by a
+semi-colon.  As the histogram is accumulated, this weight is used to
+incremented the value of the appropriated bin in the histogram.  If the
+weighting factor is not specified, then the default weight = 1 is
+assumed.  The weighting factor may be a constant integer or floating
+point number, or the name of a keyword containing the weighting value.
+Or the weighting factor may be the name of a table column in which case
+the value in that column, on a row by row basis, will be used.
+
+In some cases, the column or keyword may give the reciprocal of the
+actual weight value that is needed.  In this case, precede the weight
+keyword or column name by a slash '/' to tell CFITSIO to use the
+reciprocal of the value when constructing the histogram. 
+
+For  complex or commonly  used  histograms, one  can also  place its
+description  into  a  text  file and  import   it  into  the binning
+specification  using the  syntax [bin  @filename.txt].  The file's
+contents  can extend over   multiple lines, although  it must still
+conform to the  no-spaces rule  for the min:max:binsize syntax and each
+axis specification must still be comma-separated.  Any lines in the
+external text file that begin with 2 slash characters ('//') will be
+ignored and may be used to add comments into the file.
+
+ Examples:
+
 -
->>7  Write a 2-D image into the data array. \label{ffp2dx}
+    [bini detx, dety]                - 2-D, 16-bit integer histogram
+                                       of DETX and DETY columns, using
+                                       default values for the histogram
+                                       range and binsize
+
+    [bin (detx, dety)=16; /exposure] - 2-D, 32-bit real histogram of DETX
+                                       and DETY columns with a bin size = 16
+                                       in both axes. The histogram values
+                                       are divided by the EXPOSURE keyword
+                                       value.
+
+    [bin time=TSTART:TSTOP:0.1]      - 1-D lightcurve, range determined by
+                                       the TSTART and TSTOP keywords, 
+                                       with 0.1 unit size bins.  
+ 
+    [bin pha, time=8000.:8100.:0.1]  - 2-D image using default binning
+                                       of the PHA column for the X axis,
+                                       and 1000 bins in the range 
+                                       8000. to 8100. for the Y axis.
+    
+    [bin @binFilter.txt]             - Use the contents of the text file
+                                       binFilter.txt for the binning
+                                       specifications.
+
 -
-  int fits_write_2d_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffp2d[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long dim1, long naxis1,
-       long naxis2, DTYPE *array, > int *status)
+*X.  Template Files
+
+When a new FITS file is created with a call to fits\_create\_file, the
+name of a template file may be supplied in parentheses immediately
+following the name of the new file to be created.  This template is
+used to define the structure of one or more HDUs in the new file.  The
+template file may be another FITS file, in which case the newly created
+file will have exactly the same keywords in each HDU as in the template
+FITS file, but all the data units will be filled with zeros.  The
+template file may also be an ASCII text file, where each line (in
+general) describes one FITS keyword record.  The format of the ASCII
+template file is described in the following sections.
+
+**A   Detailed Template Line Format
+
+The format of each ASCII template line closely follows the format of a
+FITS keyword record:
 -
->>8  Write a 3-D cube into the data array. \label{ffp3dx}
+  KEYWORD = KEYVALUE / COMMENT
 -
-  int fits_write_3d_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffp3d[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long dim1, long dim2,
-       long naxis1, long naxis2, long naxis3, DTYPE *array, > int *status)
+except that free format may be used (e.g., the equals sign may appear
+at any position in the line) and TAB characters are allowed and are
+treated the same as space characters.  The KEYVALUE and COMMENT fields
+are optional.  The equals sign character is also optional, but it is
+recommended that it be included for clarity.  Any template line that
+begins with the pound '\#' character is ignored by the template parser
+and may be use to insert comments into the template file itself.
+
+The KEYWORD name field is limited to 8 characters in length and only
+the letters A-Z, digits 0-9, and the hyphen and underscore characters
+may be used, without any embedded spaces. Lowercase letters in the
+template keyword name will be converted to uppercase.  Leading spaces
+in the template line preceding the keyword name are generally ignored,
+except if the first 8 characters of a template line are all blank, then
+the entire line is treated as a FITS comment keyword (with a blank
+keyword name) and is copied verbatim into the FITS header.
+
+The KEYVALUE field may have any allowed  FITS  data type: character
+string, logical, integer, real, complex integer, or complex real.  The
+character string values need not be enclosed in single quote characters
+unless they are necessary to distinguish the string from a different
+data type (e.g.  2.0 is a real but '2.0' is a string).  The keyword has
+an undefined (null) value if the template record only contains blanks
+following the "=" or between the "=" and the "/" comment field
+delimiter.
+
+String keyword values longer than 68 characters (the maximum length
+that will fit in a single FITS keyword record) are permitted using the
+CFITSIO long string convention. They can either be specified as a
+single long line in the template, or by using multiple lines where the
+continuing lines contain the 'CONTINUE' keyword, as in this example:
+- 
+  LONGKEY = 'This is a long string value that is contin&'
+  CONTINUE  'ued over 2 records' / comment field goes here
 -
->>9   Write an arbitrary data subsection into the data array. \label{ffpssx}
+The format of template lines with CONTINUE keyword is very strict:  3
+spaces must follow CONTINUE and the rest of the line is copied verbatim
+to the FITS file.
+
+The start of the optional COMMENT field must be preceded by "/", which
+is used to separate it from the keyword value field. Exceptions are if
+the KEYWORD name field contains COMMENT, HISTORY, CONTINUE, or if the
+first 8 characters of the template line are blanks.
+
+More than one Header-Data Unit (HDU) may be defined in the template
+file.  The start of an HDU definition is denoted with a SIMPLE or
+XTENSION template line:
+
+1) SIMPLE begins a Primary HDU definition. SIMPLE may only appear as
+the  first keyword in the template file. If the template file begins
+with XTENSION instead of SIMPLE, then a default empty Primary HDU is
+created, and the template is then assumed to define the keywords
+starting with the first extension following the Primary HDU.
+
+2) XTENSION marks the beginning of a new extension HDU definition.  The
+previous HDU will be closed at this point and processing of the next
+extension begins.
+
+**B   Auto-indexing of Keywords
+
+If a template keyword name ends with a "\#" character, it is said to be
+'auto-indexed'.   Each "\#" character will be replaced by the current
+integer index value, which gets reset = 1 at the start of each new HDU
+in the file (or 7 in the special case of a GROUP definition).  The
+FIRST indexed keyword in each template HDU definition is used as the
+'incrementor';  each subsequent occurrence of this SAME keyword will
+cause the index value to be incremented.  This behavior can be rather
+subtle, as illustrated in the following examples in which the TTYPE
+keyword is the incrementor in both cases:
 -
-  int fits_write_subset_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffpss[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long naxis, long *naxes,
-       long *fpixel, long *lpixel, DTYPE *array, > int *status)
+  TTYPE# = TIME
+  TFORM# = 1D
+  TTYPE# = RATE
+  TFORM# = 1E
 -
->10  Read elements from the FITS data array.   Undefined FITS array
-    elements will be returned with a value = *nullval, (note that this
-    parameter gives the address of the null value, not the null value
-    itself) unless nulval = 0 or *nulval = 0, in which case no checks for
->   undefined pixels will be performed. \label{ffgpv}
+will create TTYPE1, TFORM1, TTYPE2, and TFORM2 keywords.  But if the
+template looks like,
 -
-  int fits_read_img / ffgpv
-      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
-       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
+  TTYPE# = TIME
+  TTYPE# = RATE
+  TFORM# = 1D
+  TFORM# = 1E
 -
->11  Read elements from the data array.  Undefined array elements will be
-    returned with a value = nullval, unless nullval = 0 in which case no
->   checks for undefined pixels will be performed. \label{ffgpvx}
+this results in a FITS files with  TTYPE1, TTYPE2, TFORM2, and TFORM2,
+which is probably not what was intended!
+
+**C   Template Parser Directives
+
+In addition to the template lines which define individual keywords, the
+template parser recognizes 3 special directives which are each preceded
+by the backslash character:  \verb+ \include, \group+, and \verb+ \end+.
+
+The 'include' directive must be followed by a filename. It forces the
+parser to temporarily stop reading the current template file and begin
+reading the include file. Once the parser reaches the end of the
+include file it continues parsing the current template file.  Include
+files can be nested, and HDU definitions can span multiple template
+files.
+
+The start of a GROUP definition is denoted with the 'group' directive,
+and the end of a GROUP definition is denoted with the 'end' directive.
+Each GROUP contains 0 or more member blocks (HDUs or GROUPs). Member
+blocks of type GROUP can contain their own member blocks. The GROUP
+definition itself occupies one FITS file HDU of special type (GROUP
+HDU), so if a template specifies 1 group with 1 member HDU like:
 -
-  int fits_read_img_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffgpv[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long firstelem, long nelements,
-       DTYPE nulval, > DTYPE *array, int *anynul, int *status)
+\group
+grpdescr = 'demo'
+xtension bintable
+# this bintable has 0 cols, 0 rows
+\end
 -
->12  Read elements from the FITS data array.   Any undefined FITS array
-    elements will have the corresponding nullarray element set
->   to TRUE.  \label{ffgpf}
+then the parser creates a FITS file with 3 HDUs :
 -
-  int fits_read_imgnull / ffgpf
-      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
-       > DTYPE *array, char *nullarray, int *anynul, int *status)
+1) dummy PHDU
+2) GROUP HDU (has 1 member, which is bintable in HDU number 3)
+3) bintable (member of GROUP in HDU number 2)
 -
->13  Read elements and nullflags from data array.
-    Any undefined array elements will have the corresponding nularray element
->   set equal to 1, else 0. \label{ffgpfx}
+Technically speaking, the GROUP HDU is a BINTABLE with 6 columns. Applications
+can define additional columns in a GROUP HDU using TFORMn and TTYPEn
+(where n is 7, 8, ....) keywords or their auto-indexing equivalents.
+
+For a more complicated example of a template file using the group directives,
+look at the sample.tpl file that is included in the CFITSIO distribution.
+
+**D   Formal Template Syntax
+
+The template syntax can formally be defined as follows:
 -
-  int  fits_read_imgnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffgpf[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, long group, long firstelem, long nelements,
-       > DTYPE *array, char *nularray, int *anynul, int *status)
+    TEMPLATE = BLOCK [ BLOCK ... ]
+
+       BLOCK = { HDU | GROUP }
+
+       GROUP = \GROUP [ BLOCK ... ] \END
+
+         HDU = XTENSION [ LINE ... ] { XTENSION | \GROUP | \END | EOF }
+
+        LINE = [ KEYWORD [ = ] ] [ VALUE ] [ / COMMENT ]
+
+    X ...     - X can be present 1 or more times
+    { X | Y } - X or Y
+    [ X ]     - X is optional
 -
->14  Read values from group parameters.  This routine only applies
-    to the `Random Grouped' FITS format which has been used for
-    applications in radio interferometry, but is offically deprecated
->   for future use. \label{ffggpx}
+
+At the topmost level, the template defines 1 or more template blocks. Blocks
+can be either HDU (Header Data Unit) or a GROUP. For each block the parser
+creates 1 (or more for GROUPs) FITS file HDUs.
+
+
+**E   Errors
+
+In general the fits\_execute\_template() function tries to be as atomic
+as possible, so either everything is done or nothing is done. If an
+error occurs during parsing of the template, fits\_execute\_template()
+will (try to) delete the top level BLOCK (with all its children if any)
+in which the error occurred, then it will stop reading the template file
+and it will return with an error.
+
+**F   Examples
+
+1. This template file will create a 200 x 300 pixel image, with 4-byte
+integer pixel values, in the primary HDU:
 -
-  int  fits_read_grppar_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffggp[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, long group, long firstelem, long nelements,
-       > DTYPE *array, int *status)
+  SIMPLE = T 
+  BITPIX = 32
+  NAXIS = 2     / number of dimensions
+  NAXIS1 = 100  / length of first axis
+  NAXIS2 = 200  / length of second axis
+  OBJECT = NGC 253 / name of observed object
 -
->15   Read 2-D image from the data array.  Undefined
-     pixels in the array will be set equal to the value of 'nulval',
-     unless nulval=0 in which case no testing for undefined pixels will
->    be performed. \label{ffg2dx}
+The allowed values of BITPIX are 8, 16, 32, -32, or -64,
+representing, respectively, 8-bit integer, 16-bit integer, 32-bit
+integer, 32-bit floating point, or 64 bit floating point pixels.
+
+2.  To create a FITS  table, the template first needs to include
+XTENSION = TABLE or BINTABLE to define whether it is an ASCII or binary
+table, and NAXIS2 to define the number of rows in the table.  Two
+template lines are then needed to define the name (TTYPEn) and FITS data
+format (TFORMn) of the columns, as in this example:
 -
-  int  fits_read_2d_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffg2d[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, long group, DTYPE nulval, long dim1, long naxis1,
-       long naxis2, > DTYPE *array, int *anynul, int *status)
+  xtension = bintable
+  naxis2 = 40
+  ttype# = Name
+  tform# = 10a
+  ttype# = Npoints
+  tform# = j
+  ttype# = Rate
+  tunit# = counts/s
+  tform# = e
 -
->16  Read 3-D cube from the data array.   Undefined
-    pixels in the array will be set equal to the value of 'nulval',
-    unless nulval=0 in which case no testing for undefined pixels will
->   be performed. \label{ffg3dx}
+The above example defines a null primary array followed by a 40-row
+binary table extension with 3 columns called 'Name', 'Npoints', and
+'Rate', with data formats of '10A' (ASCII character string), '1J'
+(integer) and '1E' (floating point), respectively.  Note that the other
+required FITS keywords (BITPIX, NAXIS, NAXIS1, PCOUNT, GCOUNT, TFIELDS,
+and END) do not need to be explicitly defined in the template because
+their values can be inferred from the other keywords in the template.
+This example also illustrates that the templates are generally
+case-insensitive (the keyword names and TFORMn values are converted to
+upper-case in the FITS file) and that string keyword values generally
+do not need to be enclosed in quotes.
+
+*XI.   Local FITS Conventions
+
+CFITSIO supports several local FITS conventions which are not
+defined in the official NOST FITS standard and which are not
+necessarily recognized or supported by other FITS software packages.
+Programmers should be cautious about using these features, especially
+if the FITS files that are produced are expected to be processed by
+other software systems which do not use the CFITSIO interface.  
+
+**A.  64-Bit Long Integers
+
+CFITSIO can read and write FITS images or table columns containing
+64-bit integer data values.  This data type is not recognized in the
+official FITS Standard definition document, but it is likely that FITS
+will eventually support this data type, especially as computers that
+run 64-bit operating systems become more common.  Support for reading
+and writing 64-bit integers in CFITSIO can be controlled with the
+\#define statement at the beginning of the fitsio2.h file by setting
+SUPPORT\_64BIT\_INTEGERS to 1 (enable) or 0 (disable).
+
+Under the convention used by CFITSIO, FITS 64-bit images have BITPIX =
+64, and the 64-bit binary table columns have TFORMn = 'K'.  The use of
+these data types on platforms where the size of a 'long' (or 'longlong')
+integer = 8 bytes is rather intuitive.  CFITSIO will write 64-bit
+'long' variable values to the FITS file and read them back into 'long'
+variables just as one would expect.  CFITSIO also supports implicit
+data type conversion between 64-bit integer images and columns and any
+other supported data type, although some loss of numerical precision or
+numerical overflow is likely in this case.
+
+The situation is more difficult on 32-bit computing platforms that do
+not support an intrinsic 64-bit integer data type.  In this case it is
+not possible to return the full 64 precision of the FITS data values when
+reading the values into a program variable.  CFITSIO will still
+convert the 64-bit integer values into any other supported data type;
+the 64-bit double data type is probably the most useful in this case.
+It only provides about 52-bits of precision in the mantissa, however,
+so some lose of precision is possible.
+
+**B.  Long String Keyword Values.
+ 
+The length of a standard FITS string keyword is limited to 68
+characters because it must fit entirely within a single FITS header
+keyword record.  In some instances it is necessary to encode strings
+longer than this limit, so CFITSIO supports a local convention in which
+the string value is continued over multiple keywords.  This
+continuation convention uses an ampersand character at the end of each
+substring to indicate that it is continued on the next keyword, and the
+continuation keywords all have the name CONTINUE without an equal sign
+in column 9. The string value may be continued in this way over as many
+additional CONTINUE keywords as is required.  The following lines
+illustrate this continuation convention which is used in the value of
+the STRKEY keyword:
 -
-  int  fits_read_3d_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffg3d[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, long group, DTYPE nulval, long dim1,
-       long dim2, long naxis1, long naxis2, long naxis3,
-       > DTYPE *array, int *anynul, int *status)
+LONGSTRN= 'OGIP 1.0'    / The OGIP Long String Convention may be used.
+STRKEY  = 'This is a very long string keyword&'  / Optional Comment
+CONTINUE  ' value that is continued over 3 keywords in the &  '
+CONTINUE  'FITS header.' / This is another optional comment.
 -
->17    Read an arbitrary data subsection from the data array.  Undefined
-       pixels in the array will be set equal to the value of 'nulval',
-       unless nullval=0 in which case no testing for undefined pixels will
->      be performed. \label{ffgsvx}
+It is recommended that the LONGSTRN keyword, as shown here, always be
+included in any HDU that uses this longstring convention as a warning
+to any software that must read the keywords.  A routine called fits\_write\_key\_longwarn
+has been provided in CFITSIO to write this keyword if it does not
+already exist.
+
+This long string convention is supported by the following CFITSIO
+routines:
 -
-  int  fits_read_subset_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffgsv[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, int group, int naxis, long *naxes, 
-       long *fpixel, long *lpixel, long *inc, DTYPE nulval, 
-       > DTYPE *array, int *anynul, int *status)
+    fits_write_key_longstr  - write a long string keyword value
+    fits_insert_key_longstr - insert a long string keyword value
+    fits_modify_key_longstr - modify a long string keyword value
+    fits_update_key_longstr - modify a long string keyword value
+    fits_read_key_longstr   - read  a long string keyword value
+    fits_delete_key         - delete a keyword
 -
->18    Read an arbitrary data subsection from the data array.  Any Undefined
-       pixels in the array will have the corresponding 'nularray'
->      element set equal to TRUE. \label{ffgsfx}
+The fits\_read\_key\_longstr routine is unique among all the CFITSIO
+routines in that it internally allocates memory for the long string
+value;  all the other CFITSIO routines that deal with arrays require
+that the calling program pre-allocate adequate space to hold the array
+of data.  Consequently, programs which use the fits\_read\_key\_longstr
+routine must be careful to free the allocated memory for the string
+when it is no longer needed.
+
+The following 2 routines also have limited support for this long string
+convention,
 -
-  int  fits_read_subsetnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffgsf[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, int group, int naxis, long *naxes, 
-       long *fpixel, long *lpixel, long *inc, > DTYPE *array, 
-       char *nularray, int *anynul, int *status)
+      fits_modify_key_str - modify an existing string keyword value
+      fits_update_key_str - update a string keyword value
 -
-
-**G.  Specialized FITS ASCII and Binary Table Routines
+in that they will correctly overwrite an existing long string value,
+but the new string value is limited to a maximum of 68 characters in
+length.
 
-***1.  Column Information Routines
+The more commonly used CFITSIO routines to write string valued keywords
+(fits\_update\_key and fits\_write\_key) do not support this long
+string convention and only support strings up to 68 characters in
+length.  This has been done deliberately to prevent programs from
+inadvertently writing keywords using this non-standard convention
+without the explicit intent of the programmer or user.   The
+fits\_write\_key\_longstr routine must be called instead to write long
+strings.  This routine can also be used to write ordinary string values
+less than 68 characters in length.
+
+**C.  Arrays of Fixed-Length Strings in Binary Tables
+ 
+The definition of the FITS binary table extension format does not
+provide a simple way to specify that a character column contains an
+array of fixed-length strings.  To support this feature, CFITSIO uses a
+local convention for the format of the TFORMn keyword value of the form
+'rAw' where 'r' is an integer specifying the total width in characters
+of the column, and 'w' is an integer specifying the (fixed) length of
+an individual unit string within the vector.  For example, TFORM1 =
+'120A10' would indicate that the binary table column is 120 characters
+wide and consists of 12 10-character length strings.  This convention
+is recognized by the CFITSIO routines that read or write strings in
+binary tables.   The Binary Table definition document specifies that
+other optional characters may follow the data type code in the TFORM
+keyword, so this local convention is in compliance with the
+FITS standard although other FITS readers may not
+recognize this convention.
+ 
+The Binary Table definition document that was approved by the IAU in
+1994 contains an appendix describing an alternate convention for
+specifying arrays of fixed or variable length strings in a binary table
+character column (with the form 'rA:SSTRw/nnn)'.  This appendix was not
+officially voted on by the IAU and hence is still provisional.  CFITSIO
+does not currently support this proposal.
+
+**D.  Keyword Units Strings
+
+One limitation of the current FITS Standard is that it does not define
+a specific convention for recording the physical units of a keyword
+value.  The TUNITn keyword can be used to specify the physical units of
+the values in a table column, but there is no analogous convention for
+keyword values.  The comment field of the keyword is often used for
+this purpose, but the units are usually not specified in a well defined
+format that FITS readers can easily recognize and extract.
+
+To solve this problem, CFITSIO uses a local convention in which the
+keyword units are enclosed in square brackets as the first token in the
+keyword comment field; more specifically, the opening square bracket
+immediately follows the slash '/' comment field delimiter and a single
+space character.  The following examples illustrate keywords that use
+this convention:
 
->1  Get information about an existing ASCII table column.   A null pointer may
->   be given for any of the output parameters that are not needed. \label{ffgacl}
--
-int fits_get_acolparms / ffgacl
-    (fitsfile *fptr, int colnum, > char *ttype, long *tbcol,
-     char *tunit, char *tform, double *scale, double *zero,
-     char *nulstr, char *tdisp, int *status)
--
->2  Get information about an existing binary table column. DATATYPE is a
-    character string which returns the datatype of the column as defined
-    by the TFORMn keyword (e.g., 'I', 'J','E', 'D', etc.).  In the case
-    of an ASCII character column, typecode will have a value of the
-    form 'An' where 'n' is an integer expressing the width of the field
-    in characters.  For example, if TFORM = '160A8' then ffgbcl will return
-    typechar='A8' and repeat=20.   All the returned parameters are scalar
-    quantities.   A null pointer may be given for any of the output
->   parameters that are not needed. \label{ffgbcl}
 -
-  int fits_get_bcolparms / ffgbcl
-      (fitsfile *fptr, int colnum, > char *ttype, char *tunit,
-       char *typechar, long *repeat, double *scale, double *zero,
-       long *nulval, char *tdisp, int  *status)
+EXPOSURE=               1800.0 / [s] elapsed exposure time
+V_HELIO =                16.23 / [km s**(-1)] heliocentric velocity
+LAMBDA  =                5400. / [angstrom] central wavelength
+FLUX    = 4.9033487787637465E-30 / [J/cm**2/s] average flux
 -
->3  Return optimal number of rows to read or write at one time for 
-    maximum I/O efficiency.  Refer to the
-    ``Optimizing Code'' section in Chapter 5 for more discussion on how 
->   to use this routine. \label{ffgrsz}
+
+In general, the units named in the IAU(1988) Style Guide are
+recommended, with the main exception that the preferred unit for angle
+is 'deg' for degrees.
+
+The fits\_read\_key\_unit and fits\_write\_key\_unit routines in
+CFITSIO read and write, respectively, the keyword unit strings in an
+existing keyword.
+
+**E.  HIERARCH Convention for Extended Keyword Names
+
+CFITSIO supports the HIERARCH keyword convention which allows keyword
+names that are longer then 8 characters and may contain the full range
+of printable ASCII text characters.  This convention 
+was developed at the European Southern Observatory (ESO)  to support 
+hierarchical FITS keyword such as:
 -
-  int fits_get_rowsize / ffgrsz
-      (fitsfile *fptr, long *nrows, *status)
+HIERARCH ESO INS FOCU POS = -0.00002500 / Focus position
 -
->4  Define the zero indexed byte offset of the 'heap' measured from
-    the start of the binary table data.  By default the heap is assumed
-    to start immediately following the regular table data, i.e., at
-    location NAXIS1 x NAXIS2.  This routine is only relevant for
-    binary tables which contain variable length array columns (with
-    TFORMn = 'Pt').  This routine also automatically writes
-    the value of theap to a keyword in the extension header.  This
-    routine must be called after the required keywords have been
-    written (with ffphbn) and after the table structure has been defined
->   (with ffbdef) but before any data is written to the table. \label{ffpthp}
+Basically, this convention uses the FITS keyword 'HIERARCH' to indicate
+that this convention is being used, then the actual keyword name
+({\tt'ESO INS FOCU POS'} in this example) begins in column 10 and can
+contain any printable ASCII text characters, including spaces.  The
+equals sign marks the end of the keyword name and is followed by the
+usual value and comment fields just as in standard FITS keywords.
+Further details of this convention are described at
+http://arcdev.hq.eso.org/dicb/dicd/dic-1-1.4.html (search for
+HIERARCH).
+
+This convention allows a much broader range of keyword names 
+than is allowed by the FITS Standard.  Here are more examples
+of such keywords:
 -
-  int fits_write_theap / ffpthp
-      (fitsfile *fptr, long theap, > int *status)
+HIERARCH LongKeyword = 47.5 / Keyword has > 8 characters, and mixed case
+HIERARCH XTE$TEMP = 98.6 / Keyword contains the '$' character
+HIERARCH Earth is a star = F / Keyword contains embedded spaces
 -
+CFITSIO will transparently read and write these keywords, so application
+programs do not in general need to know anything about the specific
+implementation details of the HIERARCH convention.  In particular,
+application programs do not need to specify the `HIERARCH' part of the
+keyword name when reading or writing keywords (although it
+may be included if desired).  When writing a keyword, CFITSIO first
+checks to see if the keyword name is legal as a standard FITS keyword
+(no more than 8 characters long and containing only letters, digits, or
+a minus sign or underscore). If so it writes it as a standard FITS
+keyword, otherwise it uses the hierarch convention to write the
+keyword.   The maximum keyword name length is 67 characters, which
+leaves only 1 space for the value field.  A more practical limit is
+about 40 characters, which leaves enough room for most keyword values.
+CFITSIO returns an error if there is not enough room for both the
+keyword name and the keyword value on the 80-character card, except for
+string-valued keywords which are simply truncated so that the closing
+quote character falls in column 80.  In the current implementation,
+CFITSIO preserves the case of the letters when writing the keyword
+name, but it is case-insensitive when reading or searching for a
+keyword.  The current implementation allows any ASCII text character
+(ASCII 32 to ASCII 126) in the keyword name except for the '='
+character.  A space is also required on either side of the equal sign.
 
-***2.  Low-Level Table Access Routines \label{FFGTBB}
+**F.  Tile-Compressed Image Format
+
+CFITSIO supports a convention for compressing n-dimensional images and
+storing the resulting byte stream in a variable-length column in a FITS
+binary table.  The general principle used in this convention is to
+first divide the n-dimensional image into a rectangular grid of
+subimages or `tiles'.  Each tile is then compressed as a continuous
+block of data, and the resulting compressed byte stream is stored in a
+row of a variable length column in a FITS binary table. By dividing the
+image into tiles it is generally possible to extract and uncompress
+subsections of the image without having to uncompress the whole image.
+The default tiling pattern treats each row of a 2-dimensional image (or
+higher dimensional cube) as a tile, such that each tile contains NAXIS1
+pixels. Any other rectangular tiling pattern may also be defined. In
+the case of relatively small images it may be sufficient to compress
+the entire image as a single tile, resulting in an output binary table
+with 1 row.  In the case of 3-dimensional data cubes, it may be
+advantageous to treat each plane of the cube as a separate tile if
+application software typically needs to access the cube on a plane by
+plane basis.
+
+See section 5.6 ``Image Compression''
+for more information on using this tile-compressed image format.
+
+*XII.  Optimizing Programs
  
-The following 2 routines provide low-level access to the data in ASCII
-or binary tables and are mainly useful as an efficient way to copy all
-or part of a table from one location to another.  These routines simply
-read or write the specified number of consecutive bytes in an ASCII or
-binary table, without regard for column boundaries or the row length in
-the table.  These routines do not perform any machine dependent data
-conversion or byte swapping.  See Appendix B for the definition of the
-parameters used in these routines.
+CFITSIO has been carefully designed to obtain the highest possible
+speed when reading and writing FITS files.  In order to achieve the
+best performance, however, application programmers must be careful to
+call the CFITSIO routines appropriately and in an efficient sequence;
+inappropriate usage of CFITSIO routines can greatly slow down the
+execution speed of a program.
 
->>1  Read a consecutive array of bytes from an ASCII or binary table \label{ffgtbb}
--
-  int fits_read_tblbytes / ffgtbb
-      (fitsfile *fptr, long firstrow, long firstchar, long nchars,
-       > unsigned char *values, int *status)
--
->>2  Write a consecutive array of bytes to an ASCII or binary table \label{ffptbb}
--
-  int fits_write_tblbytes / ffptbb
-      (fitsfile *fptr, long firstrow, long firstchar, long nchars,
-       unsigned char *values, > int *status)
--
+The maximum possible I/O speed of CFITSIO depends of course on the type
+of computer system that it is running on.  As a rough guide, the
+current generation of workstations can achieve speeds of 2 -- 10 MB/s
+when reading or writing FITS images and similar, or slightly slower
+speeds with FITS binary tables.  Reading of FITS files can occur at
+even higher rates (30MB/s or more) if the FITS file is still cached in
+system memory following a previous read or write operation on the same
+file.  To more accurately predict the best performance that is possible
+on any particular system, a diagnostic program called ``speed.c'' is
+included with the CFITSIO distribution which can be run to
+approximately measure the maximum possible speed of writing and reading
+a test FITS file.
 
-***3.  Specialized Write Column Data Routines
+The following 2 sections provide some background on how CFITSIO
+internally manages the data I/O and describes some strategies that may
+be used to optimize the processing speed of software that uses
+CFITSIO.
 
->1  Write elements into an ASCII or binary table column (in the CDU).
-    The datatype of the array is implied by the suffix of the
->   routine name. \label{ffpcls}
--
-  int fits_write_col_str / ffpcls
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, char **array, > int *status)
- 
-  int fits_write_col_[log,byt,sht,usht,int,uint,lng,ulng,flt,dbl,cmp,dblcmp] /
-      ffpcl[l,b,i,ui,k,uk,j,uj,e,d,c,m]
-      (fitsfile *fptr, int colnum, long firstrow,
-           long firstelem, long nelements, DTYPE *array, > int *status)
--
->2  Write elements into an ASCII or binary table column
-    substituting the appropriate FITS null value for any elements that
-    are equal to the nulval parameter.  This routines must not be used to
->   write to  variable length array columns.  \label{ffpcnx}
--
-  int fits_write_colnull_[log, byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffpcn[l,b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, DTYPE *array, DTYPE nulval, > int *status)
--
->3  Write string elements into a binary table column (in the CDU)
-    substituting the FITS null value for any elements that
-    are equal to the nulstr string.  This routine must NOT be 
->   used to write to  variable length array columns. \label{ffpcns}
--
-  int fits_write_colnull_str / ffpcns
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, char **array, char *nulstr, > int *status)
--
->4  Write bit values into a binary byte ('B') or bit ('X') table column (in
-    the CDU).  Larray is an array of logical values corresponding to the
-    sequence of bits to be written.  If larray is true then the
-    corresponding bit is set to 1, otherwise the bit is set to 0.  Note
-    that in the case of 'X' columns, CFITSIO can write to all 8 bits of
-    each byte whether they are formally valid or not.  Thus if the
-    column is defined as '4X', and one calls ffpclx with  firstbit=1
-    and nbits=8, then all 8 bits will be written into the first byte
-    (as opposed to writing the first 4 bits into the first row and then
-    the next 4 bits into the next row), even though the last 4 bits of
-    each byte are formally not defined.  It should also be noted that
-    it is more efficient to write 'X' columns an entire byte at a time,
-    instead of bit by bit.  Any of the CFITSIO routines that write to
-    columns (e.g. fits\_write\_col\_byt) may be used for this
-    purpose.  These routines will interpret 'X' columns as though they
-    were 'B' columns (e.g.,  '8X' is equivalent to '1B', and '16X' is
->   equivalent to '2B'). \label{ffpclx}
--
-  int fits_write_col_bit / ffpclx
-      (fitsfile *fptr, int colnum, long firstrow, long firstbit, 
-       long nbits, char *larray, > int *status)
--
->5  Write the descriptor for a variable length column in a binary table.
-    This routine can be used in conjunction with FFGDES to enable
-    2 or more arrays to point to the same storage location to save
->   storage space if the arrays are identical. \label{ffpdes}
--
-    int fits_write_descript / ffpdes
-        (fitsfile *fptr, int colnum, long rownum, long repeat,
-         long offset, > int *status)
--
-***4.  Specialized Read Column Data Routines
+**A.  How CFITSIO Manages Data I/O
+
+Many CFITSIO operations involve transferring only a small number of
+bytes to or from the FITS file (e.g, reading a keyword, or writing a
+row in a table); it would be very inefficient to physically read or
+write such small blocks of data directly in the FITS file on disk,
+therefore CFITSIO maintains a set of internal Input--Output (IO)
+buffers in RAM memory that each contain one FITS block (2880 bytes) of
+data.  Whenever CFITSIO needs to access data in the FITS file, it first
+transfers the FITS block containing those bytes into one of the IO
+buffers in memory.  The next time CFITSIO needs to access bytes in the
+same block it can then go to the fast IO buffer rather than using a
+much slower system disk access routine.  The number of available IO
+buffers is determined by the NIOBUF parameter (in fitsio2.h) and is
+currently set to 40 by default.
+
+Whenever CFITSIO reads or writes data it first checks to see if that
+block of the FITS file is already loaded into one of the IO buffers.
+If not, and if there is an empty IO buffer available, then it will load
+that block into the IO buffer (when reading a FITS file) or will
+initialize a new block (when writing to a FITS file).  If all the IO
+buffers are already full, it must decide which one to reuse (generally
+the one that has been accessed least recently), and flush the contents
+back to disk if it has been modified before loading the new block.
+
+The one major exception to the above process occurs whenever a large
+contiguous set of bytes are accessed, as might occur when reading or
+writing a FITS image.  In this case CFITSIO bypasses the internal IO
+buffers and simply reads or writes the desired bytes directly in the
+disk file with a single call to a low-level file read or write
+routine.  The minimum threshold for the number of bytes to read or
+write this way is set by the MINDIRECT parameter and is currently set
+to 3 FITS blocks = 8640 bytes.  This is the most efficient way to read
+or write large chunks of data and can achieve IO transfer rates of
+5 -- 10MB/s or greater.  Note that this fast direct IO process is not
+applicable when accessing columns of data in a FITS table because the
+bytes are generally not contiguous since they are interleaved by the
+other columns of data in the table.  This explains why the speed for
+accessing FITS tables is generally slower than accessing
+FITS images.
+
+Given this background information, the general strategy for efficiently
+accessing FITS files should be apparent:  when dealing with FITS
+images, read or write large chunks of data at a time so that the direct
+IO mechanism will be invoked;  when accessing FITS headers or FITS
+tables, on the other hand, once a particular FITS block has been
+loading into one of the IO buffers, try to access all the needed
+information in that block before it gets flushed out of the IO buffer.
+It is important to avoid the situation where the same FITS block is
+being read then flushed from a IO buffer multiple times.
+
+The following section gives more specific suggestions for optimizing
+the use of CFITSIO.
+
+**B.  Optimization Strategies
+
+1.  When dealing with a FITS primary array or IMAGE extension, it is
+more efficient to read or write large chunks of the  image at a time
+(at least 3 FITS blocks = 8640 bytes) so that the direct IO mechanism
+will be used as described in the previous section.  Smaller chunks of
+data are read or written via the IO buffers, which is somewhat less
+efficient because of the extra copy operation and additional
+bookkeeping steps that are required.  In principle it is more efficient
+to read or write as big an array of image pixels at one time as
+possible, however, if the array becomes so large that the operating
+system cannot store it all in RAM, then the performance may be degraded
+because of the increased swapping of virtual memory to disk.
+
+2.  When dealing with FITS tables, the most important efficiency factor
+in the software design is to read or write the data in the FITS file in
+a single pass through the file.  An example of poor program design
+would be to read a large, 3-column table by sequentially reading the
+entire first column, then going back to read the 2nd column, and
+finally the 3rd column; this obviously requires 3 passes through the
+file which could triple the execution time of an IO limited program.
+For small tables this is not important, but when reading multi-megabyte
+sized tables these inefficiencies can become significant.  The more
+efficient procedure in this case is to read or write only as many rows
+of the table as will fit into the available internal IO buffers, then
+access all the necessary columns of data within that range of rows.
+Then after the program is completely finished with the data in those
+rows it can move on to the next range of rows that will fit in the
+buffers, continuing in this way until the entire file has been
+processed.  By using this procedure of accessing all the columns of a
+table in parallel rather than sequentially, each block of the FITS file
+will only be read or written once.
+
+The optimal number of rows to read or write at one time in a given
+table depends on the width of the table row, on the number of IO
+buffers that have been allocated in CFITSIO, and also on the number of
+other FITS files that are open at the same time (since one IO buffer is
+always reserved for each open FITS file).  The CFITSIO Iterator routine
+will automatically use the optimal-sized buffer, but there is also a
+CFITSIO routine that will return the optimal number of rows for a given
+table:  fits\_get\_rowsize.  It is not critical to use exactly the
+value of nrows returned by this routine, as long as one does not exceed
+it.  Using a very small value however can also lead to poor performance
+because of the overhead from the larger number of subroutine calls.
+
+The optimal number of rows returned by fits\_get\_rowsize is valid only
+as long as the application program is only reading or writing data in
+the specified table.  Any other calls to access data in the table
+header or in any other FITS file would  cause additional blocks of data
+to be loaded into the IO buffers displacing data from the original
+table, and should be avoided during the critical period while the table
+is being read or written.
 
-Two types of routines are provided to get the column data which differ
-in the way undefined pixels are handled.  The first set of routines
-(ffgcv) simply return an array of data elements in which undefined
-pixels are set equal to a value specified by the user in the 'nullval'
-parameter.  If nullval = 0, then no checks for undefined pixels will be
-performed, thus increasing the speed of the program.  The second set of
-routines (ffgcf) returns the data element array and in addition a
-logical array of flags which defines whether the corresponding data
-pixel is undefined.  See Appendix B for the definition of the
-parameters used in these routines.
+Occasionally it is necessary to simultaneously access more than one
+FITS table, for example when transferring values from an input table to
+an output table.  In cases like this, one should call
+fits\_get\_rowsize to get the optimal number of rows for each table
+separately, than reduce the number of rows proportionally.  For
+example, if the optimal number of rows in the input table is 3600 and
+is 1400 in the output table, then these values should be cut in half to
+1800 and 700, respectively, if both tables are going to be accessed at
+the same time.
 
-    Any column, regardless of it's intrinsic datatype, may be read as a
-    string.  It should be noted however that reading a numeric column as
-    a string is 10 - 100 times slower than reading the same column as a number
-    due to the large overhead in constructing the formatted strings.
-    The display format of the returned strings will be
-    determined by the TDISPn keyword, if it exists, otherwise by the
-    datatype of the column.  The length of the returned strings (not
-    including the null terminating character) can be determined with
-    the fits\_get\_col\_display\_width routine.  The following TDISPn
-    display formats are currently supported:
--
-    Iw.m   Integer
-    Ow.m   Octal integer
-    Zw.m   Hexadecimal integer
-    Fw.d   Fixed floating point
-    Ew.d   Exponential floating point
-    Dw.d   Exponential floating point
-    Gw.d   General; uses Fw.d if significance not lost, else Ew.d
--
-    where w is the width in characters of the displayed values, m is
-    the minimum number of digits displayed, and d is the number of
-    digits to the right of the decimal.  The .m field is optional.
+3.  Use the CFITSIO Iterator routine.  This routine provides a
+more `object oriented' way of reading and writing FITS files
+which automatically uses the most appropriate data buffer size 
+to achieve the maximum I/O throughput.  
 
->1  Read elements from an ASCII or binary table column (in the CDU).  These
-    routines return the values of the table column array elements.  Undefined
-    array elements will be returned with a value = nulval, unless nulval = 0
-    (or = ' ' for ffgcvs) in which case no checking for undefined values will
-    be performed. The ANYF parameter is set to true if any of the returned
->   elements are undefined. \label{ffgcvx}
-- 
-  int fits_read_col_str / ffgcvs
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, char *nulstr, > char **array, int *anynul,
-       int *status)
- 
-  int fits_read_col_[log,byt,sht,usht,int,uint,lng,ulng, flt, dbl, cmp, dblcmp] /
-      ffgcv[l,b,i,ui,k,uk,j,uj,e,d,c,m]
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, DTYPE nulval, > DTYPE *array, int *anynul,
-       int *status)
--
->2  Read elements and null flags from an ASCII or binary table column (in the
-    CHDU).  These routines return the values of the table column array elements.
-    Any undefined array elements will have the corresponding nularray element
-    set equal to TRUE.  The anynul parameter is set to true if any of the
->   returned elements are undefined. \label{ffgcfx}
--
-  int fits_read_colnull_str / ffgcfs
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, > char **array, char *nularray, int *anynul,
-       int *status)
+4.  Use binary table extensions rather than ASCII table
+extensions for better efficiency  when dealing with tabular data.  The
+I/O to ASCII tables is slower because of the overhead in formatting or
+parsing the ASCII data fields and because ASCII tables are about twice
+as large as binary tables with the same information content.
 
-  int fits_read_colnull_[log,byt,sht,usht,int,uint,lng,ulng,flt,dbl,cmp,dblcmp] /
-      ffgcf[l,b,i,ui,k,uk,j,uj,e,d,c,m]
-      (fitsfile *fptr, int colnum, long firstrow, 
-       long firstelem, long nelements, > DTYPE *array,
-       char *nularray, int *anynul, int *status)
--
->3  Read an arbitrary data subsection from an N-dimensional array
-    in a binary table vector column.  Undefined pixels
-    in the array will be set equal to the value of 'nulval',
-    unless nulval=0 in which case no testing for undefined pixels will
-    be performed.  The first and last rows in the table to be read
-    are specified by fpixel(naxis+1) and lpixel(naxis+1), and hence
-    are treated as the next higher dimension of the FITS N-dimensional
-    array.  The INC parameter specifies the sampling interval in
->   each dimension between the data elements that will be returned. \label{ffgsvx2}
--
-  int fits_read_subset_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffgsv[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, int colnum, int naxis, long *naxes, long *fpixel,
-       long *lpixel, long *inc, DTYPE nulval, > DTYPE *array, int *anynul,
-       int *status)
--
->4  Read an arbitrary data subsection from an N-dimensional array
-    in a binary table vector column.  Any Undefined
-    pixels in the array will have the corresponding 'nularray'
-    element set equal to TRUE.  The first and last rows in the table
-    to be read are specified by fpixel(naxis+1) and lpixel(naxis+1),
-    and hence are treated as the next higher dimension of the FITS
-    N-dimensional array.  The INC parameter specifies the sampling
-    interval in each dimension between the data elements that will be
->   returned. \label{ffgsfx2}
--
-  int fits_read_subsetnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffgsf[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, int colnum, int naxis, long *naxes, 
-       long *fpixel, long *lpixel, long *inc, > DTYPE *array, 
-       char *nularray, int *anynul, int *status)
--
->5  Read bit values from a byte ('B') or bit (`X`) table column (in the
-    CDU).  Larray is an array of logical values corresponding to the
-    sequence of bits to be read.  If larray is true then the
-    corresponding bit was set to 1, otherwise the bit was set to 0.
-    Note that in the case of 'X' columns, CFITSIO can read  all 8 bits
-    of each byte whether they are formally valid or not.  Thus if the
-    column is defined as '4X', and one calls ffgcx with  firstbit=1 and
-    nbits=8, then all 8 bits will be read from the first byte (as
-    opposed to reading the first 4 bits from the first row and then the
-    first 4 bits from the next row), even though the last 4 bits of
-    each byte are formally not defined.  It should also be noted that
-    it is more efficient to read 'X' columns an entire byte at a time,
-    instead of bit by bit.  Any of the CFITSIO routines that read 
-    columns (e.g. fits\_read\_col\_byt) may be used for this
-    purpose.  These routines will interpret 'X' columns as though they
-    were 'B' columns (e.g.,  '8X' is equivalent to '1B', and '16X' is
->   equivalent to '2B').  \label{ffgcx}
--
-  int fits_read_col_bit / ffgcx
-      (fitsfile *fptr, int colnum, long firstrow, long firstbit, 
-       long nbits, > char *larray, int *status)
--
->6  Read any consecutive set of bits from an 'X' or 'B' column and
-    interpret them as an unsigned n-bit integer.  nbits must be less
-    than 16 or 32 in ffgcxui and ffgcxuk, respectively.  If nrows
-    is greater than 1, then the same set of bits will be read from
-    each row, starting with firstrow. The bits are numbered with
-    1 = the most significant bit of the first element of the column.
->   \label{ffgcxui}
--
-  int fits_read_col_bit_[usht, uint] / ffgcx[ui,uk]
-      (fitsfile *fptr, int colnum, long firstrow, long, nrows,
-       long firstbit, long nbits, > DTYPE *array, int *status)
--
->7  Return the descriptor for a variable length column in a binary table.
-    The descriptor consists of 2 integer parameters: the number of elements
-    in the array and the starting offset relative to the start of the heap.
-    The first routine returns a single descriptor whereas the second routine
-    returns the descriptors for a range of rows in the table.
->   \label{ffgdes}
--
-  int fits_read_descript / ffgdes
-      (fitsfile *fptr, int colnum, long rownum, > long *repeat,
-           long *offset, int *status)
+5. Design software so that it reads the FITS header keywords in the
+same order in which they occur in the file.  When reading keywords,
+CFITSIO searches forward starting from the position of the last keyword
+that was read.  If it reaches the end of the header without finding the
+keyword, it then goes back to the start of the header and continues the
+search down to the position where it started.  In practice, as long as
+the entire FITS header can fit at one time in the available internal IO
+buffers, then the header keyword access will be very fast and it makes
+little difference which order they are accessed.
+
+6. Avoid the use of scaling (by using the BSCALE and BZERO or TSCAL and
+TZERO keywords) in FITS files since the scaling operations add to the
+processing time needed to read or write the data.  In some cases it may
+be more efficient to temporarily turn off the scaling (using fits\_set\_bscale or
+fits\_set\_tscale) and then read or write the raw unscaled values in the FITS
+file.
+
+7. Avoid using the `implicit data type conversion' capability in
+CFITSIO.  For instance, when reading a FITS image with BITPIX = -32
+(32-bit floating point pixels), read the data into a single precision
+floating point data array in the program.  Forcing CFITSIO to convert
+the data to a different data type can slow the program.
+
+8. Where feasible, design FITS binary tables using vector column
+elements so that the data are written as a contiguous set of bytes,
+rather than as single elements in multiple rows.  For example, it is
+faster to access the data in a table that contains a single row
+and 2 columns with TFORM keywords equal to  '10000E' and '10000J', than
+it is to access the same amount of data in a table with 10000 rows
+which has columns with the TFORM keywords equal to '1E' and '1J'.  In
+the former case the 10000 floating point values in the first column are
+all written in a contiguous block of the file which can be read or
+written quickly, whereas in the second case each floating point value
+in the first column is interleaved with the integer value in the second
+column of the same row so CFITSIO has to explicitly move to the
+position of each element to be read or written.
+
+9. Avoid the use of variable length vector columns in binary tables,
+since any reading or writing of these data requires that CFITSIO first
+look up or compute the starting address of each row of data in the
+heap.
+
+10. When copying data from one FITS table to another, it is faster to
+transfer the raw bytes instead of reading then writing each column of
+the table.  The CFITSIO routines fits\_read\_tblbytes and
+fits\_write\_tblbytes will perform low-level reads or writes of any
+contiguous range of bytes in a table extension.  These routines can be
+used to read or write a whole row (or multiple rows  for even greater
+efficiency) of a table with a single function call.   These routines
+are fast because they bypass all the usual data scaling, error checking
+and machine dependent data conversion that is normally done by CFITSIO,
+and they allow the program to write the data to the output file in
+exactly the same byte order.  For these same reasons, these routines
+can corrupt the FITS data file if used incorrectly because no
+validation or machine dependent conversion is performed by these
+routines.  These routines are only recommended for optimizing critical
+pieces of code and should only be used by programmers who thoroughly
+understand the internal format of the FITS tables they are reading or
+writing.
+
+11. Another strategy for improving the speed of writing a FITS table,
+similar to the previous one, is to directly construct the entire byte
+stream for a whole table row (or multiple rows) within the application
+program and then write it to the FITS file with
+fits\_write\_tblbytes.  This avoids all the overhead normally present
+in the column-oriented CFITSIO write routines.  This technique should
+only be used for critical applications because it makes the code more
+difficult to understand and maintain, and it makes the code more system
+dependent (e.g., do the bytes need to be swapped before writing to the
+FITS file?).
+
+12.  Finally, external factors such as the type of magnetic disk
+controller (SCSI or IDE), the size of the disk cache, the average seek
+speed of the disk, the amount of disk fragmentation, and the amount of
+RAM available on the system can all have a significant impact on
+overall I/O efficiency.  For critical applications, a system
+administrator should review the proposed system hardware to identify any
+potential I/O bottlenecks.
 
-  int fits_read_descripts / ffgdess
-      (fitsfile *fptr, int colnum, long firstrow, long nrows > long *repeat,
-           long *offset, int *status)
--
 
 \appendix
 *1   Index of Routines
@@ -6740,12 +7444,15 @@ fits\_calculator     & \pageref{ffcalc} \\
 fits\_calculator\_rng     & \pageref{ffcalcrng} \\
 fits\_calc\_rows    & \pageref{ffcrow} \\
 fits\_change\_group  & \pageref{ffgtch} \\
+fits\_clear\_errmark  & \pageref{ffpmrk} \\
 fits\_clear\_errmsg   & \pageref{ffcmsg} \\
 fits\_close\_file     & \pageref{ffclos} \\
 fits\_compact\_group & \pageref{ffgtcm} \\
 fits\_compare\_str    & \pageref{ffcmps} \\
+fits\_compress\_heap & \pageref{ffcmph} \\
 fits\_copy\_col     & \pageref{ffcpcl} \\
 fits\_copy\_data      & \pageref{ffcpdt} \\
+fits\_copy\_file      & \pageref{ffcpfl} \\
 fits\_copy\_group    & \pageref{ffgtcp} \\
 fits\_copy\_hdu       & \pageref{ffcopy} \\
 fits\_copy\_header    & \pageref{ffcphd} \\
@@ -6762,20 +7469,23 @@ fits\_date2str  & \pageref{ffdt2s} \\
 fits\_decode\_chksum  & \pageref{ffdsum} \\
 fits\_decode\_tdim    & \pageref{ffdtdm} \\
 fits\_delete\_col   & \pageref{ffdcol} \\
+\end{tabular}
+\begin{tabular}{lr}
 fits\_delete\_file    & \pageref{ffdelt} \\
 fits\_delete\_hdu     & \pageref{ffdhdu} \\
 fits\_delete\_key     & \pageref{ffdkey} \\
-\end{tabular}
-\begin{tabular}{lr}
 fits\_delete\_record  & \pageref{ffdrec} \\
 fits\_delete\_rowlist & \pageref{ffdrws} \\
+fits\_delete\_rowrange & \pageref{ffdrrg} \\
 fits\_delete\_rows  & \pageref{ffdrow} \\
 fits\_encode\_chksum  & \pageref{ffesum} \\
+fits\_file\_exists    & \pageref{ffexist} \\
 fits\_file\_mode      & \pageref{ffflmd} \\
 fits\_file\_name      & \pageref{ffflnm} \\
 fits\_find\_first\_row    & \pageref{ffffrw} \\
 fits\_find\_nextkey      & \pageref{ffgnxk} \\
 fits\_find\_rows    & \pageref{fffrow} \\
+fits\_flush\_buffer     & \pageref{ffflus} \\
 fits\_flush\_file     & \pageref{ffflus} \\
 fits\_get\_acolparms  & \pageref{ffgacl} \\
 fits\_get\_bcolparms  & \pageref{ffgbcl} \\
@@ -6784,6 +7494,8 @@ fits\_get\_col\_display\_width    & \pageref{ffgcdw} \\
 fits\_get\_colname    & \pageref{ffgcnn} \\
 fits\_get\_colnum     & \pageref{ffgcno} \\
 fits\_get\_coltype    & \pageref{ffgtcl} \\
+fits\_get\_compression\_type & \pageref{ffgetcomp} \\
+fits\_get\_eqcoltype    & \pageref{ffgtcl} \\
 fits\_get\_errstatus  & \pageref{ffgerr} \\
 fits\_get\_hdrpos        & \pageref{ffghps} \\
 fits\_get\_hdrspace      & \pageref{ffghsp} \\
@@ -6791,24 +7503,28 @@ fits\_get\_hdu\_num    & \pageref{ffghdn} \\
 fits\_get\_hdu\_type   & \pageref{ffghdt} \\
 fits\_get\_hduaddr    & \pageref{ffghad} \\
 fits\_get\_hduoff    & \pageref{ffghad} \\
+\end{tabular}
+\begin{tabular}{lr}
 fits\_get\_img\_dim & \pageref{ffgidm} \\
+fits\_get\_img\_equivtype & \pageref{ffgidt} \\
 fits\_get\_img\_param & \pageref{ffgipr} \\
 fits\_get\_img\_size & \pageref{ffgisz} \\
 fits\_get\_img\_type & \pageref{ffgidt} \\
 fits\_get\_keyclass    & \pageref{ffgkcl} \\
 fits\_get\_keyname    & \pageref{ffgknm} \\
 fits\_get\_keytype    & \pageref{ffdtyp} \\
+fits\_get\_noise\_bits   & \pageref{ffgetcomp} \\
 fits\_get\_num\_cols     & \pageref{ffgnrw} \\
-\end{tabular}
-\begin{tabular}{lr}
 fits\_get\_num\_groups  & \pageref{ffgmng} \\
 fits\_get\_num\_hdus   & \pageref{ffthdu} \\
 fits\_get\_num\_members  & \pageref{ffgtnm} \\
 fits\_get\_num\_rows     & \pageref{ffgnrw} \\
 fits\_get\_rowsize    & \pageref{ffgrsz} \\
 fits\_get\_system\_time  & \pageref{ffdt2s} \\
+fits\_get\_tile\_dim     & \pageref{ffgetcomp} \\
 fits\_get\_tbcol      & \pageref{ffgabc} \\
 fits\_get\_version    & \pageref{ffvers} \\
+fits\_hdr2str         & \pageref{ffhdr2str}, \pageref{hdr2str} \\
 fits\_insert\_atbl    & \pageref{ffitab} \\
 fits\_insert\_btbl    & \pageref{ffibin} \\
 fits\_insert\_col   & \pageref{fficol} \\
@@ -6821,6 +7537,9 @@ fits\_insert\_record     & \pageref{ffirec} \\
 fits\_insert\_rows  & \pageref{ffirow} \\
 fits\_iterate\_data   & \pageref{ffiter} \\
 fits\_make\_keyn      & \pageref{ffkeyn} \\
+\end{tabular}
+\newpage
+\begin{tabular}{lr}
 fits\_make\_nkey      & \pageref{ffnkey} \\
 fits\_merge\_groups  & \pageref{ffgtmg} \\
 fits\_modify\_card       & \pageref{ffmcrd} \\
@@ -6833,16 +7552,17 @@ fits\_modify\_vector\_len  & \pageref{ffmvec} \\
 fits\_movabs\_hdu     & \pageref{ffmahd} \\
 fits\_movnam\_hdu     & \pageref{ffmnhd} \\
 fits\_movrel\_hdu     & \pageref{ffmrhd} \\
-\end{tabular}
-\newpage
-\begin{tabular}{lr}
 fits\_null\_check     & \pageref{ffnchk} \\
+fits\_open\_data      & \pageref{ffopen} \\
 fits\_open\_file      & \pageref{ffopen} \\
+fits\_open\_image      & \pageref{ffopen} \\
+fits\_open\_table      & \pageref{ffopen} \\
 fits\_open\_group    & \pageref{ffgtop} \\
 fits\_open\_member    & \pageref{ffgmop} \\
 fits\_open\_memfile   & \pageref{ffomem} \\
 fits\_parse\_extnum   & \pageref{ffextn} \\
 fits\_parse\_input\_url & \pageref{ffiurl} \\
+fits\_parse\_range    & \pageref{ffrwrg} \\
 fits\_parse\_rootname & \pageref{ffrtnm} \\
 fits\_parse\_template & \pageref{ffgthd} \\
 fits\_parse\_value    & \pageref{ffpsvc} \\
@@ -6867,6 +7587,8 @@ fits\_read\_img\_TYP     & \pageref{ffgpvx} \\
 fits\_read\_imghdr       & \pageref{ffghpr} \\
 fits\_read\_imgnull & \pageref{ffgpf} \\
 fits\_read\_imgnull\_TYP & \pageref{ffgpfx} \\
+\end{tabular}
+\begin{tabular}{lr}
 fits\_read\_key          & \pageref{ffgky} \\
 fits\_read\_key\_longstr  & \pageref{ffgkls} \\
 fits\_read\_key\_triple   & \pageref{ffgkyt} \\
@@ -6882,8 +7604,6 @@ fits\_read\_subset\_TYP  & \pageref{ffgsvx} \pageref{ffgsvx2}\\
 fits\_read\_subsetnull\_TYP & \pageref{ffgsfx} \pageref{ffgsfx2} \\
 fits\_read\_tbl\_coord & \pageref{ffgtcs} \\
 fits\_read\_tblbytes    & \pageref{ffgtbb} \\
-\end{tabular}
-\begin{tabular}{lr}
 fits\_read\_tdim         & \pageref{ffgtdm} \\
 fits\_remove\_group  & \pageref{ffgtrm} \\
 fits\_remove\_member   & \pageref{ffgmrm} \\
@@ -6894,13 +7614,18 @@ fits\_select\_rows  & \pageref{ffsrow} \\
 fits\_set\_atblnull   & \pageref{ffsnul} \\
 fits\_set\_bscale     & \pageref{ffpscl} \\
 fits\_set\_btblnull   & \pageref{fftnul} \\
+fits\_set\_compression\_type  & \pageref{ffsetcomp} \\
 fits\_set\_hdrsize    & \pageref{ffhdef} \\
 fits\_set\_hdustruc   & \pageref{ffrdef} \\
 fits\_set\_imgnull    & \pageref{ffpnul} \\
+fits\_set\_noise\_bits  & \pageref{ffsetcomp} \\
+fits\_set\_tile\_dim  & \pageref{ffsetcomp} \\
 fits\_set\_tscale     & \pageref{fftscl} \\
+fits\_split\_names    & \pageref{splitnames} \\
 fits\_str2date        & \pageref{ffdt2s} \\
 fits\_str2time        & \pageref{ffdt2s} \\
-fits\_test\_expr    & \pageref{fftexp} \\
+fits\_test\_expr      & \pageref{fftexp} \\
+fits\_test\_heap      & \pageref{fftheap} \\
 fits\_test\_keyword   & \pageref{fftkey} \\
 fits\_test\_record    & \pageref{fftrec} \\
 fits\_time2str  & \pageref{ffdt2s} \\
@@ -6911,6 +7636,8 @@ fits\_update\_key        & \pageref{ffuky} \\
 fits\_update\_key\_null   & \pageref{ffukyu} \\
 fits\_update\_key\_TYP    & \pageref{ffukyx} \\
 fits\_uppercase      & \pageref{ffupch} \\
+\end{tabular}
+\begin{tabular}{lr}
 fits\_url\_type      & \pageref{ffurlt} \\
 fits\_verify\_chksum  & \pageref{ffvcks} \\
 fits\_verify\_group  & \pageref{ffgtvf} \\
@@ -6923,15 +7650,15 @@ fits\_write\_chksum   & \pageref{ffpcks} \\
 fits\_write\_col         & \pageref{ffpcl} \\
 fits\_write\_col\_bit     & \pageref{ffpclx} \\
 fits\_write\_col\_TYP     & \pageref{ffpcls} \\
+fits\_write\_col\_null      & \pageref{ffpclu} \\
 fits\_write\_colnull      & \pageref{ffpcn} \\
 fits\_write\_colnull\_TYP & \pageref{ffpcnx} \\
 fits\_write\_comment      & \pageref{ffpcom} \\
 fits\_write\_date         & \pageref{ffpdat} \\
 fits\_write\_descript  & \pageref{ffpdes} \\
+fits\_write\_errmark   & \pageref{ffpmrk} \\
 fits\_write\_errmsg   & \pageref{ffpmsg} \\
 fits\_write\_grphdr       & \pageref{ffphpr} \\
-\end{tabular}
-\begin{tabular}{lr}
 fits\_write\_grppar\_TYP & \pageref{ffpgpx} \\
 fits\_write\_history      & \pageref{ffphis} \\
 fits\_write\_img        & \pageref{ffppr} \\
@@ -6953,6 +7680,7 @@ fits\_write\_null\_img    & \pageref{ffpprn} \\
 fits\_write\_pix          & \pageref{ffppx} \\
 fits\_write\_pixnull      & \pageref{ffppxn} \\
 fits\_write\_record       & \pageref{ffprec} \\
+fits\_write\_subset       & \pageref{ffpss} \\
 fits\_write\_subset\_TYP  & \pageref{ffpssx} \\
 fits\_write\_tblbytes  & \pageref{ffptbb} \\
 fits\_write\_tdim         & \pageref{ffptdm} \\
@@ -6966,11 +7694,14 @@ ffbnfm   & \pageref{ffbnfm} \\
 ffcalc     & \pageref{ffcalc} \\
 ffcalc\_rng     & \pageref{ffcalcrng} \\
 ffclos     & \pageref{ffclos} \\
+ffcmph & \pageref{ffcmph} \\
 ffcmps    & \pageref{ffcmps} \\
+ffcmrk  & \pageref{ffpmrk} \\
 ffcmsg  & \pageref{ffcmsg} \\
 ffcopy     & \pageref{ffcopy} \\
 ffcpcl     & \pageref{ffcpcl} \\
 ffcpdt      & \pageref{ffcpdt} \\
+ffcpfl      & \pageref{ffcpfl} \\
 ffcphd   & \pageref{ffcphd} \\
 ffcpky       & \pageref{ffcpky} \\
 ffcrhd     & \pageref{ffcrhd} \\
@@ -6981,18 +7712,23 @@ ffdcol   & \pageref{ffdcol} \\
 ffdelt    & \pageref{ffdelt} \\
 ffdhdu     & \pageref{ffdhdu} \\
 ffdkey     & \pageref{ffdkey} \\
+ffdopn      & \pageref{ffopen} \\
 ffdrec  & \pageref{ffdrec} \\
 ffdrow  & \pageref{ffdrow} \\
+ffdrrg  & \pageref{ffdrrg} \\
 ffdrws & \pageref{ffdrws} \\
 ffdsum  & \pageref{ffdsum} \\
 ffdt2s  & \pageref{ffdt2s} \\
 ffdtdm   & \pageref{ffdtdm} \\
 ffdtyp    & \pageref{ffdtyp} \\
+ffeqty    & \pageref{ffgtcl} \\
 ffesum  & \pageref{ffesum} \\
+ffexest  & \pageref{ffexist} \\
 ffextn   & \pageref{ffextn} \\
 ffffrw    & \pageref{ffffrw} \\
 ffflmd      & \pageref{ffflmd} \\
 ffflnm      & \pageref{ffflnm} \\
+ffflsh     & \pageref{ffflus} \\
 ffflus     & \pageref{ffflus} \\
 fffrow    & \pageref{fffrow} \\
 ffg2d\_      & \pageref{ffg2dx} \\
@@ -7000,6 +7736,8 @@ ffg3d\_      & \pageref{ffg3dx} \\
 ffgabc      & \pageref{ffgabc} \\
 ffgacl  & \pageref{ffgacl} \\
 ffgbcl  & \pageref{ffgbcl} \\
+\end{tabular}
+\begin{tabular}{lr}
 ffgcdw  & \pageref{ffgcdw} \\
 ffgcf    & \pageref{ffgcf} \\
 ffgcf\_    & \pageref{ffgcfx} \\
@@ -7007,8 +7745,6 @@ ffgcks     & \pageref{ffgcks} \\
 ffgcnn    & \pageref{ffgcnn} \\
 ffgcno     & \pageref{ffgcno} \\
 ffgcrd         & \pageref{ffgcrd} \\
-\end{tabular}
-\begin{tabular}{lr}
 ffgcv        & \pageref{ffgcv} \\
 ffgcv\_    & \pageref{ffgcvx} \\
 ffgcx     & \pageref{ffgcx} \\
@@ -7028,6 +7764,7 @@ ffghtb      & \pageref{ffghtb} \\
 ffgics & \pageref{ffgics} \\
 ffgidm & \pageref{ffgidm} \\
 ffgidt & \pageref{ffgidt} \\
+ffgiet & \pageref{ffgidt} \\
 ffgipr & \pageref{ffgipr} \\
 ffgisz & \pageref{ffgisz} \\
 ffgkcl      & \pageref{ffgkcl} \\
@@ -7048,6 +7785,9 @@ ffgmtf  & \pageref{ffgmtf} \\
 ffgncl     & \pageref{ffgnrw} \\
 ffgnrw     & \pageref{ffgnrw} \\
 ffgnxk      & \pageref{ffgnxk} \\
+
+\end{tabular}
+\begin{tabular}{lr}
 ffgpf & \pageref{ffgpf} \\
 ffgpf\_ & \pageref{ffgpfx} \\
 ffgpv         & \pageref{ffgpv} \\
@@ -7055,8 +7795,6 @@ ffgpv\_     & \pageref{ffgpvx} \\
 ffgpxv   & \pageref{ffgpxv} \\
 ffgpxf  & \pageref{ffgpxf} \\
 ffgrec       & \pageref{ffgrec} \\
-\end{tabular}
-\begin{tabular}{lr}
 ffgrsz    & \pageref{ffgrsz} \\
 ffgsdt        & \pageref{ffdt2s} \\
 ffgsf\_ & \pageref{ffgsfx} \pageref{ffgsfx2} \\
@@ -7089,6 +7827,7 @@ ffikyu   & \pageref{ffikyu} \\
 ffiky\_    & \pageref{ffikyx} \\
 ffimem  & \pageref{ffimem} \\
 ffinit  & \pageref{ffinit} \\
+ffiopn & \pageref{ffopen} \\
 ffirec     & \pageref{ffirec} \\
 ffirow  & \pageref{ffirow} \\
 ffitab    & \pageref{ffitab} \\
@@ -7096,6 +7835,9 @@ ffiter   & \pageref{ffiter} \\
 ffiurl & \pageref{ffiurl} \\
 ffkeyn      & \pageref{ffkeyn} \\
 ffmahd     & \pageref{ffmahd} \\
+
+\end{tabular}
+\begin{tabular}{lr}
 ffmcom    & \pageref{ffmcom} \\
 ffmcrd       & \pageref{ffmcrd} \\
 ffmkls    & \pageref{ffmkyx} \\
@@ -7103,8 +7845,6 @@ ffmkyu   & \pageref{ffmkyu} \\
 ffmky\_    & \pageref{ffmkyx} \\
 ffmnam       & \pageref{ffmnam} \\
 ffmnhd     & \pageref{ffmnhd} \\
-\end{tabular}
-\begin{tabular}{lr}
 ffmrec     & \pageref{ffmrec} \\
 ffmrhd     & \pageref{ffmrhd} \\
 ffmvec  & \pageref{ffmvec} \\
@@ -7118,6 +7858,7 @@ ffpcks   & \pageref{ffpcks} \\
 ffpcl         & \pageref{ffpcl} \\
 ffpcls     & \pageref{ffpcls} \\
 ffpcl\_     & \pageref{ffpclx} \\
+ffpclu      & \pageref{ffpclu} \\
 ffpcn    & \pageref{ffpcn} \\
 ffpcn\_ & \pageref{ffpcnx} \\
 ffpcom      & \pageref{ffpcom} \\
@@ -7137,22 +7878,24 @@ ffpkyt   & \pageref{ffpkyt} \\
 ffpkyu     & \pageref{ffpkyu} \\
 ffpky\_      & \pageref{ffpkyx} \\
 ffplsw & \pageref{ffplsw} \\
+ffpmrk   & \pageref{ffpmrk} \\
 ffpmsg   & \pageref{ffpmsg} \\
 ffpnul    & \pageref{ffpnul} \\
 ffppn     & \pageref{ffppn} \\
 ffppn\_ & \pageref{ffppnx} \\
 ffppr        & \pageref{ffppr} \\
 ffpprn & \pageref{ffpprn} \\
+\end{tabular}
+\begin{tabular}{lr}
 ffppru & \pageref{ffppru} \\
 ffppr\_    & \pageref{ffpprx} \\
 ffppx & \pageref{ffppx} \\
 ffppxn & \pageref{ffppxn} \\
 ffprec       & \pageref{ffprec} \\
 ffpscl     & \pageref{ffpscl} \\
+ffpss    & \pageref{ffpss} \\
 ffpss\_  & \pageref{ffpssx} \\
 ffpsvc    & \pageref{ffpsvc} \\
-\end{tabular}
-\begin{tabular}{lr}
 ffptbb  & \pageref{ffptbb} \\
 ffptdm         & \pageref{ffptdm} \\
 ffpthp    & \pageref{ffpthp} \\
@@ -7162,15 +7905,18 @@ ffreopen      & \pageref{ffreopen} \\
 ffrprt   & \pageref{ffrprt} \\
 ffrsim     & \pageref{ffrsim} \\
 ffrtnm & \pageref{ffrtnm} \\
+ffrwrg    & \pageref{ffrwrg} \\
 ffs2dt  & \pageref{ffdt2s} \\
 ffs2tm  & \pageref{ffdt2s} \\
 ffsnul   & \pageref{ffsnul} \\
 ffsrow  & \pageref{ffsrow} \\
 fftexp    & \pageref{fftexp} \\
 ffthdu   & \pageref{ffthdu} \\
+fftheap  & \pageref{fftheap} \\
 fftkey   & \pageref{fftkey} \\
 fftm2s  & \pageref{ffdt2s} \\
 fftnul   & \pageref{fftnul} \\
+fftopn & \pageref{ffopen} \\
 fftplt & \pageref{fftplt} \\
 fftrec    & \pageref{fftrec} \\
 fftscl     & \pageref{fftscl} \\
@@ -7199,9 +7945,12 @@ binspec  - the input table binning specifier
 bitpix   - bits per pixel. The following symbolic mnemonics are predefined: 
                BYTE_IMG   =   8 (unsigned char)
                SHORT_IMG  =  16 (signed short integer)
-               LONG_IMG   = �32 (signed long integer)
+               LONG_IMG   =  32 (signed long integer)
+               LONGLONG_IMG =  64 (signed long 64-bit integer)
                FLOAT_IMG  = -32 (float)
                DOUBLE_IMG = -64 (double).
+           The LONGLONG_IMG type is experimental and is not officially
+           recognized in the FITS Standard document.
            Two additional values, USHORT_IMG and ULONG_IMG are also available
            for creating unsigned integer images.  These are equivalent to
            creating a signed integer image with BZERO offset keyword values
@@ -7217,6 +7966,7 @@ colspec  - the input file column specification; used to delete, create, or renam
            table columns
 comment  - the keyword comment field (72 char max, null-terminated)
 complm   - should the checksum be complemented?
+comptype - compression algorithm to use: GZIP_1, RICE_1, or PLIO_1
 coordtype- type of coordinate projection (-SIN, -TAN, -ARC, -NCP, 
            -GLS, -MER, or -AIT)
 cpopt    - grouping table copy option parameter. Allowed values are:
@@ -7224,13 +7974,14 @@ cpopt    - grouping table copy option parameter. Allowed values are:
            OPT_MCP_REPL, amd OPT_MCP_MOV.
 create_col- If TRUE, then insert a new column in the table, otherwise
            overwrite the existing column.
+current  - if TRUE, then the current HDU will be copied
 dataok   - was the data unit verification successful (=1) or
            not (= -1).  Equals zero if the DATASUM keyword is not present.
 datasum  - 32-bit 1's complement checksum for the data unit
 dataend  - address (in bytes) of the end of the HDU
 datastart- address (in bytes) of the start of the data unit
-datatype - specifies the datatype of the value.  Allowed value are:
-           TSTRING, TLOGICAL, TBYTE, TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG,
+datatype - specifies the data type of the value.  Allowed value are:  TSTRING,
+           TLOGICAL, TBYTE, TSBYTE, TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG,
            TFLOAT, TDOUBLE, TCOMPLEX, and TDBLCOMPLEX
 datestr  - FITS date/time string: 'YYYY-MM-DDThh:mm:ss.ddd', 'YYYY-MM-dd',
            or 'dd/mm/yy'
@@ -7240,7 +7991,7 @@ deltasize - increment for allocating more memory
 dim1     - declared size of the first dimension of the image or cube array
 dim2     - declared size of the second dimension of the data cube array
 dispwidth - display width of a column = length of string that will be read
-dtype    - datatype of the keyword ('C', 'L', 'I', 'F' or 'X')
+dtype    - data type of the keyword ('C', 'L', 'I', 'F' or 'X')
                 C = character string
                 L = logical
                 I = integer
@@ -7251,6 +8002,7 @@ err_text - error message string corresponding to error number (30 chars max)
 exact    - TRUE (=1) if the strings match exactly; 
            FALSE (=0) if wildcards are used
 exclist  - array of pointers to keyword names to be excluded from search
+exists   - flag indicating whether the file or compressed file exists on disk
 expr     - boolean or arithmetic expression
 extend   - TRUE (=1) if FITS file may have extensions, else FALSE (=0)
 extname  - value of the EXTNAME keyword (null-terminated)
@@ -7264,6 +8016,7 @@ firstfailed - member HDU ID (if positive) or grouping table GRPIDn index
            value (if negative) that failed grouping table verification.
 firstelem- first element in a vector (ignored for ASCII tables)
 firstrow - starting row number (first row of table = 1)
+following- if TRUE, any HDUs following the current HDU will be copied
 fpixel   - coordinate of the first pixel to be read or written in the
            FITS array.  The array must be of length NAXIS and have values such
            that fpixel[0] is in the range 1 to NAXIS1, fpixel[1] is in the
@@ -7275,7 +8028,7 @@ gfptr    - fitsfile* pointer to a grouping table HDU.
 group    - GRPIDn/GRPLCn index value identifying a grouping table HDU, or
            data group number (=0 for non-grouped data)
 grouptype - Grouping table parameter that specifies the columns to be
-           created in a grouing table HDU. Allowed values are: GT_ID_ALL_URI,
+           created in a grouping table HDU. Allowed values are: GT_ID_ALL_URI,
            GT_ID_REF, GT_ID_POS, GT_ID_ALL, GT_ID_REF_URI, and GT_ID_POS_URI. 
 grpname  - value to use for the GRPNAME keyword value. 
 hdunum   - sequence number of the HDU (Primary array = 1)
@@ -7283,7 +8036,9 @@ hduok    - was the HDU verification successful (=1) or
            not (= -1).  Equals zero if the CHECKSUM keyword is not present.
 hdusum   - 32 bit 1's complement checksum for the entire CHDU
 hdutype  - type of HDU: IMAGE_HDU (=0), ASCII_TBL (=1), or BINARY_TBL (=2)
+header   - returned character string containing all the keyword records
 headstart- starting address (in bytes) of the CHDU
+heapsize - size of the binary table heap, in bytes
 history  - the HISTORY keyword comment string (70 char max, null-terminated)
 hour     - hour within day (UTC) (0 - 23)
 inc      - sampling interval for pixels in each FITS dimension
@@ -7317,6 +8072,7 @@ minute   - minute within hour (UTC) (0 - 59)
 month    - calendar month (UTC) (1 - 12)
 morekeys - space in the header for this many more keywords
 n_good_rows - number of rows evaluating to TRUE
+namelist - string containing a comma or space delimited list of names
 naxes    - size of each dimension in the FITS array
 naxis    - number of dimensions in the FITS array
 naxis1   - length of the X/first axis of the FITS array
@@ -7332,19 +8088,24 @@ nkeys    - number of keywords in the sequence
 ninc     - number of names in the inclusion list
 nmembers - Number of grouping table members (NAXIS2 value).
 nmove    - number of HDUs to move (+ or -), relative to current position
+nocomments - if equal to TRUE, then no commentary keywords will be copied
+noisebits- number of bits to ignore when compressing floating point images
 nrows    - number of rows in the table
 nstart   - first integer value
-nularray - set to TRUE (=1) if corresponding data element is undefined
+nullarray- set to TRUE (=1) if corresponding data element is undefined
 nulval   - numerical value to represent undefined pixels
 nulstr   - character string used to represent undefined values in ASCII table
-numval   - numerical data value, of the appropriate datatype
+numval   - numerical data value, of the appropriate data type
 offset   -  byte offset in the heap to the first element of the vector
 openfptr - pointer to a currently open FITS file
+overlap  - number of bytes in the binary table heap pointed to by more than 1
+           descriptor
 outcolnum- output column number; range = 1 to TFIELDS + 1
 outfile  - and optional output filename; the input file will be copied to this prior
            to opening the file
 outfptr  - pointer to a 'fitsfile' structure describing the output FITS file.
 pcount   - value of the PCOUNT keyword = size of binary table heap
+previous - if TRUE, any previous HDUs in the input file will be copied.
 repeat   - length of column vector (e.g. 12J); == 1 for ASCII table
 rmopt    - grouping table remove option parameter. Allowed values are:
            OPT_RM_GPT, OPT_RM_ENTRY, OPT_RM_MBR, and OPT_RM_ALL.
@@ -7353,9 +8114,10 @@ rot      - celestial coordinate rotation angle (degrees)
 rowlen   - length of a table row, in characters or bytes
 rowlist  - sorted list of row numbers to be deleted from the table
 rownum   - number of the row (first row = 1)
+rowrange - list of rows or row ranges: '3,6-8,12,56-80' or '500-'
 row_status - array of True/False results for each row that was evaluated
 scale    - linear scaling factor; true value = (FITS value) * scale + zero
-second   - second within minute (0 - 60.9999999999) (leapsecond!)
+second   - second within minute (0 - 60.9999999999) (leap second!)
 simple   - TRUE (=1) if FITS file conforms to the Standard, else FALSE (=0)
 space    - number of blank spaces to leave between ASCII table columns
 status   - returned error status code (0 = OK)
@@ -7371,17 +8133,19 @@ tform    - format of the column (null-terminated); allowed values are:
            ASCII tables:  Iw, Aw, Fww.dd, Eww.dd, or Dww.dd
            Binary tables: rL, rX, rB, rI, rJ, rA, rAw, rE, rD, rC, rM
            where 'w'=width of the field, 'd'=no. of decimals, 'r'=repeat count.
-           Variable length array columns are denoted by a '1P' before the datatype
+           Variable length array columns are denoted by a '1P' before the data type
            character (e.g., '1PJ').  When creating a binary table, 2 addition tform
-           datatype codes are recognized by CFITSIO: 'rU' and 'rV' for unsigned
+           data type codes are recognized by CFITSIO: 'rU' and 'rV' for unsigned
            16-bit and unsigned 32-bit integer, respectively.
 
 theap    - zero indexed byte offset of starting address of the heap
            relative to the beginning of the binary table data
+tilesize - array of length NAXIS that specifies the dimensions of
+           the image compression tiles
 ttype    - label or name for table column (null-terminated)
 tunit    - physical unit for table column (null-terminated)
-typechar - symbolic code of the table column datatype
-typecode - datatype code of the table column.  The negative of
+typechar - symbolic code of the table column data type
+typecode - data type code of the table column.  The negative of
            the value indicates a variable length array column.
                 Datatype             typecode    Mnemonic
                 bit, X                   1        TBIT
@@ -7390,12 +8154,18 @@ typecode - datatype code of the table column.  The negative of
                 ASCII character, A      16        TSTRING
                 short integer, I        21        TSHORT
                 integer, J              41        TINT32BIT
+                long long integer, K    81        TLONGLONG
                 real, E                 42        TFLOAT
                 double precision, D     82        TDOUBLE
                 complex, C              83        TCOMPLEX
                 double complex, M      163        TDBLCOMPLEX
+             The TLONGLONG column type is experimental and is not
+             recognized in the official FITS Standard document
 unit     - the physical unit string (e.g., 'km/s') for a keyword
+unused   - number of unused bytes in the binary table heap 
 urltype  - the file type of the FITS file (file://, ftp://, mem://, etc.)
+validheap- returned value = FALSE if any of the variable length array
+           address are outside the valid range of addresses in the heap 
 value    - the keyword value string (70 char max, null-terminated)
 version  - current version number of the CFITSIO library
 width    - width of the character string field
@@ -7445,6 +8215,7 @@ improve the readability of their code.
  DRIVER_INIT_FAILED 123   driver initialization failed 
  NO_MATCHING_DRIVER 124   matching driver is not registered 
  URL_PARSE_ERROR    125   failed to parse input file URL
+ RANGE_PARSE_ERROR  126   parse error in range list
 
  SHARED_BADARG     151    bad argument in shared memory driver
  SHARED_NULPTR     152    null pointer passed as an argument
@@ -7499,17 +8270,18 @@ improve the readability of their code.
  BAD_HEADER_FILL   254    Header fill area contains non-blank chars
  BAD_DATA_FILL     255    Illegal data fill bytes (not zero or blank)
  BAD_TFORM         261    illegal TFORM format code
- BAD_TFORM_DTYPE   262    unrecognizable TFORM datatype code
+ BAD_TFORM_DTYPE   262    unrecognizable TFORM data type code
  BAD_TDIM          263    illegal TDIMn keyword value
- 
- BAD_HDU_NUM       301    HDU number < 1 or > MAXHDU
+ BAD_HEAP_PTR      264    invalid BINTABLE heap pointer is out of range
+
+ BAD_HDU_NUM       301    HDU number < 1
  BAD_COL_NUM       302    column number < 1 or > tfields
  NEG_FILE_POS      304    tried to move to negative byte location in file
  NEG_BYTES         306    tried to read or write negative number of bytes
  BAD_ROW_NUM       307    illegal starting row number in table
  BAD_ELEM_NUM      308    illegal starting element number in vector
  NOT_ASCII_COL     309    this is not an ASCII string column
- NOT_LOGICAL_COL   310    this is not a logical datatype column
+ NOT_LOGICAL_COL   310    this is not a logical data type column
  BAD_ATABLE_FORMAT 311    ASCII table column has wrong format
  BAD_BTABLE_FORMAT 312    Binary table column has wrong format
  NO_NULL           314    null value has not been defined
@@ -7528,6 +8300,8 @@ improve the readability of their code.
  HDU_ALREADY_TRACKED   346
  BAD_OPTION            347
  IDENTICAL_POINTERS    348
+ BAD_GROUP_ATTACH      349
+ BAD_GROUP_DETACH      350
 
  NGP_NO_MEMORY         360     malloc failed
  NGP_READ_ERR          361     read error from file
@@ -7557,7 +8331,7 @@ improve the readability of their code.
  BAD_C2D           409    bad formatted string to double conversion
  BAD_DATATYPE      410    illegal datatype code value
  BAD_DECIM         411    bad number of decimal places specified
- NUM_OVERFLOW      412    overflow during datatype conversion
+ NUM_OVERFLOW      412    overflow during data type conversion
  DATA_COMPRESSION_ERR   413  error compressing image 
  DATA_DECOMPRESSION_ERR 414  error uncompressing image 
 
diff --git a/cfitsio.ps b/cfitsio.ps
index 19f6102..4ea49a4 100644
--- a/cfitsio.ps
+++ b/cfitsio.ps
@@ -1,14 +1,14 @@
 %!PS-Adobe-2.0
 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software
 %%Title: cfitsio.dvi
-%%Pages: 148
+%%Pages: 168
 %%PageOrder: Ascend
-%%BoundingBox: 0 0 596 842
+%%BoundingBox: 0 0 612 792
 %%EndComments
 %DVIPSWebPage: (www.radicaleye.com)
 %DVIPSCommandLine: dvips -N0 cfitsio
 %DVIPSParameters: dpi=600, compressed
-%DVIPSSource:  TeX output 2000.10.18:1437
+%DVIPSSource:  TeX output 2004.07.28:1247
 %%BeginProcSet: texc.pro
 %!
 /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -67,7 +67,7 @@ p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
 rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
 
 %%EndProcSet
-TeXDict begin 39158280 55380996 1000 600 600 (cfitsio.dvi)
+TeXDict begin 40258431 52099146 1000 600 600 (cfitsio.dvi)
 @start
 %DVIPSBitmapFont: Fa cmti10 10.95 17
 /Fa 17 118 df<49B712C018F818FE903B0003FE0003FF9438007F804BEC1FC0F00FE0F0
@@ -145,473 +145,218 @@ EE07FCEE1FF0EE7FC04B48C7FCED07FCED1FF0ED7FC04A48C8FCEC07FCEC1FF0EC7FC049
 48C9FCEB07FCEB1FF0EB7FC04848CAFCEA07FCEA1FF0EA7FC048CBFC12FC1270363678B1
 47>62 D E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fc cmsy10 10.95 2
-/Fc 2 107 df<EB0FFCEB3FFF90B512C0000314F04880488048804880A2481580A3B712
+%DVIPSBitmapFont: Fc cmsy10 10.95 4
+/Fc 4 107 df<EB0FFCEB3FFF90B512C0000314F04880488048804880A2481580A3B712
 C0AA6C1580A36C1500A26C5C6C5C6C5C6C5CC614C0013F90C7FCEB0FFC22227BA72D>15
-D<126012F0B3B3B3B3B11260045B76C319>106 D E
+D<153FEC03FFEC0FE0EC3F80EC7E00495A5C495AA2495AB3AA130F5C131F495A91C7FC13
+FEEA03F8EA7FE048C8FCEA7FE0EA03F8EA00FE133F806D7E130F801307B3AA6D7EA26D7E
+80EB007EEC3F80EC0FE0EC03FFEC003F205B7AC32D>102 D<12FCEAFFC0EA07F0EA01FC
+EA007E6D7E131F6D7EA26D7EB3AA801303806D7E1300147FEC1FC0EC07FEEC00FFEC07FE
+EC1FC0EC7F0014FC1301495A5C13075CB3AA495AA2495A133F017EC7FC485AEA07F0EAFF
+C000FCC8FC205B7AC32D>I<126012F0B3B3B3B3B11260045B76C319>106
+D E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fd cmbx12 12 59
-/Fd 59 123 df<ED0FFF4AB512C0020F14F0027F80903A01FFF803FC499038C000FE010F
+%DVIPSBitmapFont: Fd cmbx12 12 58
+/Fd 58 122 df<ED0FFF4AB512C0020F14F0027F80903A01FFF803FC499038C000FE010F
 EB00034948497E49485B5C495A4C138001FF6E13005CA3705AEE01F893C8FCA74BB51280
 B9FCA5C69038E00003B3B0007FD9FFC1B6FCA538467EC53E>12 D<B612F8A91D097F9A25
 >45 D<EA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7FFCEA3FF8EA1FF0EA07C00F0F788E1F
->I<EE01C0EE03E01607A2160F17C0161F1780A2163F17005E167EA216FE5E15015EA215
-035EA215075E150F5EA2151F5E153F93C7FCA25D157E15FE5DA214015D14035DA214075D
-140F5DA2141F5D143F92C8FCA25C147EA214FE5C13015CA213035C13075CA2130F5C131F
-5CA2133F91C9FC5B137EA213FE5B12015BA212035BA212075B120F5BA2121F5B123F90CA
-FCA25A127E12FE5AA25A12782B647ACA38>I<EC03C01407141F147FEB03FF133FB6FCA4
-13C3EA0003B3B3ADB712FCA5264177C038>49 D<ECFFE0010F13FE013F6D7E90B612E000
-0315F82607FC0313FE3A0FE0007FFFD81F806D138048C7000F13C0488001C015E001F07F
-00FF6E13F07F17F881A46C5A6C5A6C5AC9FC17F05DA217E05D17C04B13804B1300A2ED1F
-FC4B5A5E4B5A4B5A4A90C7FC4A5A4A5AEC0FF04A5AEC3F804AC7127814FE495A494814F8
-D907E014F0495A495A49C8FC017C140149140348B7FC4816E05A5A5A5A5AB8FC17C0A42D
-417BC038>I<ECFFF0010713FF011F14C0017F14F049C66C7ED803F8EB3FFED807E06D7E
-81D80FF86D138013FE001F16C07FA66C5A6C4815806C485BC814005D5E4B5A4B5A4B5A4A
-5B020F1380902607FFFEC7FC15F815FF16C090C713F0ED3FFCED0FFEEEFF80816F13C017
-E0A26F13F0A217F8A3EA0FC0EA3FF0487EA2487EA217F0A25D17E06C5A494913C05BD83F
-80491380D81FF0491300D80FFEEBFFFE6CB612F800015D6C6C14C0011F49C7FC010113E0
-2D427BC038>I<163FA25E5E5D5DA25D5D5D5DA25D92B5FCEC01F7EC03E7140715C7EC0F
-87EC1F07143E147E147C14F8EB01F0EB03E0130714C0EB0F80EB1F00133E5BA25B485A48
-5A485A120F5B48C7FC123E5A12FCB91280A5C8000F90C7FCAC027FB61280A531417DC038
->I<0007150301E0143F01FFEB07FF91B6FC5E5E5E5E5E16804BC7FC5D15E092C8FC01C0
-C9FCAAEC3FF001C1B5FC01C714C001DF14F09039FFE03FFC9138000FFE01FC6D7E01F06D
-13804915C0497F6C4815E0C8FC6F13F0A317F8A4EA0F80EA3FE0487E12FF7FA317F05B5D
-6C4815E05B007EC74813C0123E003F4A1380D81FC0491300D80FF0495AD807FEEBFFFC6C
-B612F0C65D013F1480010F01FCC7FC010113C02D427BC038>I<4AB47E021F13F0027F13
-FC49B6FC01079038807F8090390FFC001FD93FF014C04948137F4948EBFFE048495A5A14
-00485A120FA248486D13C0EE7F80EE1E00003F92C7FCA25B127FA2EC07FC91381FFF8000
-FF017F13E091B512F89039F9F01FFC9039FBC007FE9039FF8003FF17804A6C13C05B6F13
-E0A24915F0A317F85BA4127FA5123FA217F07F121FA2000F4A13E0A26C6C15C06D491380
-6C018014006C6D485A6C9038E01FFC6DB55A011F5C010714C0010191C7FC9038003FF02D
-427BC038>I<121E121F13FC90B712FEA45A17FC17F817F017E017C0A2481680007EC8EA
-3F00007C157E5E00785D15014B5A00F84A5A484A5A5E151FC848C7FC157E5DA24A5A1403
-5D14074A5AA2141F5D143FA2147F5D14FFA25BA35B92C8FCA35BA55BAA6D5A6D5A6D5A2F
-447AC238>I<EC7FF00103B5FC010F14C0013F14F090397F801FFC3A01FC0003FE48486D
-7E497F4848EC7F80163F484815C0A2001F151FA27FA27F7F01FE143F6D158002C0137F02
-F014006C01FC5B6E485A6C9038FF83FCEDE7F86CECFFE06C5D6C92C7FC6D14C06D80010F
-14F882013F8090B7FC48013F14802607FC0F14C0260FF80314E04848C6FC496D13F0003F
-141F48481307496D13F8150000FF157F90C8123F161F160FA21607A36D15F0127F160F6D
-15E06C6C141F6DEC3FC06C6CEC7F80D80FFE903801FF003A07FFC00FFE6C90B55AC615F0
-013F14C0010F91C7FC010013F02D427BC038>I<EC7FF0903807FFFE011F6D7E017F14E0
-9039FFE03FF0489038800FF848496C7E48488048486D7E001F80003F1680A2484815C081
-17E0A212FF17F0A617F8A45D127FA3003F5CA26C7E5D6C6C5B12076C6C133E6CEBC07C6C
-EBFFF8013F5B010F01C013F00101130090C8FCA217E05DA2EA03C0D80FF015C0487E486C
-491380A217004B5A150F5E49495A6C48495A01C0EBFFE0260FF0035B6CB65A6C4AC7FC6C
-14F86C6C13E0D907FEC8FC2D427BC038>I<EA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7F
-FCEA3FF8EA1FF0EA07C0C7FCAEEA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7FFCEA3FF8EA
-1FF0EA07C00F2C78AB1F>I<EE1F80A24C7EA24C7EA34C7EA24B7FA34B7FA24B7FA34B7F
-169F031F80161F82033F80ED3E07037E80157C8203FC804B7E02018115F0820203814B13
-7F0207815D173F020F814B7F021F8292C77EA24A82023E80027E82027FB7FCA291B87EA2
-498302F0C8FCA20103834A157F0107834A153FA249488284011F8491C97E4984133E017E
-82B6020FB612F0A54C457CC455>65 D<B9FC18F018FE727E19E026003FFCC700077F0501
-7F716C7E727E727EA2721380A37213C0A74E1380A24E1300A24E5A4E5A4E5A4D5B05075B
-94B5128091B700FCC7FC18F018FF19E002FCC7000113F8716C7EF01FFE727E7213801AC0
-7213E0A27213F0A31AF8A71AF0A2601AE0604E13C0604E138095B5120005075BBA12F861
-19C04EC7FC18E045447CC350>I<DCFFF01470031F01FF14F04AB6EAE0010207EDF80302
-3FEDFE0791B539E001FF0F4949C7EA3F9F010701F0EC0FFF4901C0804990C87E49488149
-48814948167F4849163F4849161F5A4A160F485B19074890CAFC19035A5BA2007F1801A3
-4994C7FC12FFAE127F7F1AF0A2123FA27F6C18011AE06C7F19036C6D17C06E16077E6C6D
-EE0F806C6DEE1F006D6C5E6D6C167E6D6C6C5D6D6D4A5A6D01F0EC07F0010101FEEC1FE0
-6D903AFFF001FF80023F90B6C7FC020715FC020115F0DA001F1480030001F8C8FC44467A
-C451>I<B9FC18F018FE727E19E026003FFEC7001F13F805017F9438003FFF060F7F727F
-727F727F84737E737EA2737EA2737EA21B80A2851BC0A51BE0AD1BC0A51B8061A21B0061
-62193F624F5A19FF624E5B06075B4E5B063F90C7FC4DB45A050F13F8BA5A19C04EC8FC18
-F095C9FC4B447CC356>I<BA12F8A485D8001F90C71201EF003F180F180318011800A219
-7E193EA3191EA21778A285A405F890C7FCA316011603161F92B5FCA5ED001F1603160116
-00A2F101E01778A2F103C0A494C7FC1907A21A80A2190FA2191FA2193FF17F0061601807
-181F4DB5FCBBFC61A443447DC34A>I<BA1280A419C026003FFEC7121F1701EF007F183F
-181F180F180719E01803A31801A3EE01E0F000F0A419001603A31607160F167F91B6FCA5
-9138FE007F160F16071603A31601A693C9FCAFB712F0A53C447CC346>I<B7D88003B612
-FEA526003FFEC9EBF800B3A791B9FCA54AC9FCB3AAB7D88003B612FEA54F447CC358>72
-D<B712E0A5D8001F90C7FCB3B3B3A4B712E0A523447DC32A>I<B76C0103B512F8A52600
-3FFEC93807E0004F5A4F5A077EC7FC614E5A4E5A4E5AF01F804EC8FC187E604D5AEF07F0
-EF0FC04D5A4DC9FC177E4C5AEE03F04C5A4C5A4C7EEE7FF04C7E5D4B7F4B7F4B7FED3F3F
-DB7E1F7F03FC806E486C7F4B7E4B6C7F0380804B6C7F4A7F717E84717F83717F85717F83
-717F85717F187F727E86727F84727F86727F84B76C90B612FCA54E447CC358>75
-D<B712F0A526003FFECAFCB3B1F00780A4180F1900A460A360A2187EA218FE1701170317
-07171F177FEE03FFB95AA539447CC343>I<B500FE067FB512806E95B6FCA26F5EA2D800
-3F50C7FC013D6DEE03DFA2013C6DEE079FA26E6CEE0F1FA26E6C161EA26E6C163CA36E6C
-1678A26E6C16F0A26E6DEC01E0A26E6DEC03C0A36E6DEC0780A26F6CEC0F00A26F6C141E
-A26F6C5CA36F6C5CA26F6C5CA26F6D485AA26F6D485AA26F6D485AA3706C48C7FCA29338
-3FF81EA2706C5AA2706C5AA3706C5AA2705BA2705BA2705BA2B6057FB6128071C7FCA217
-3E171C61447CC36A>I<B64BB512FE8181A281D8003F6D91C7EA780081013D7F81133C6E
-7E6E7F6E7F6E7F6E7F82806E7F6E7F6F7E6F7F83816F7F6F7F6F7F6F7F6F7F8382707F70
-7F707F707F8482707F707F717E7113807113C019E0837113F07113F87113FC7113FE19FF
-847213F884848484A28484197F193F191FA2190F1907B61603190119001A78A24F447CC3
-58>I<923807FFC092B512FE0207ECFFC0021F15F091267FFE0013FC902601FFF0EB1FFF
-01070180010313C04990C76C7FD91FFC6E6C7E49486F7E49486F7E01FF8348496F7E4849
-6F1380A248496F13C0A24890C96C13E0A24819F04982003F19F8A3007F19FC49177FA400
-FF19FEAD007F19FC6D17FFA3003F19F8A26D5E6C19F0A26E5D6C19E0A26C6D4B13C06C19
-806E5D6C6D4B13006C6D4B5A6D6C4B5A6D6C4B5A6D6C4A5B6D01C001075B6D01F0011F5B
-010101FE90B5C7FC6D90B65A023F15F8020715C002004AC8FC030713C047467AC454>I<
-B9FC18F018FE727E19E0D8001F90C7000F7F05017F716C7E727E727E721380A21AC084A2
-1AE0A91AC0A24E1380A21A00604E5A4E5A4D485A050F5B92B712C096C7FC18FC18C092CB
-FCB3A7B712E0A543447DC34D>I<B812F8EFFFC018F818FE727ED8001F90C7003F13E005
-037F05007F727E727E727EA28684A286A762A24E90C7FCA24E5A61187F943801FFF00507
-5B053F138092B7C8FC18F818E018F892C77FEF3FFF050F7F717F717FA2717FA2717FA785
-A61B0F85A2187F73131F72141EB700E06DEB803E72EBE0FC72EBFFF8060114F0726C13E0
-CC0007138050457DC354>82 D<DAFFE0131C010701FE133C013F9038FF807C90B6EAE0FC
-4815F9489038801FFF3907FC00014848EB007F4848143F4848140F491407007F15035B16
-01160012FF177CA27FA26D153C7F7F6D92C7FC6C7EEBFFE014FE6CEBFFF015FF6C15E016
-FC6C816C6F7E6C826C826C6C81011F810107811300020F80140003077FED007F82040F13
-80828212F082A282A27EA218007EA26C5D6C5E6D14036D5D6D140701F84A5A01FFEC3FF0
-02F8EBFFE0486CB65AD8FC1F92C7FCD8F80714FC48C614F0480107138031467AC43E>I<
-003FBA12E0A59026FE000FEB8003D87FE09338003FF049171F90C71607A2007E1803007C
-1801A300781800A400F819F8481978A5C81700B3B3A20107B8FCA545437CC24E>I<B76C
-010FB512F8A526003FFEC93803E000B3B3A9011F17076280190F6D606F151F6D95C7FC6D
-6D5D197E6D6D5D6D6D1403DA7FFC4A5A6EB4EC3FF0020F9039F003FFE06E90B612800201
-93C8FC6E6C14FC030F14E09226007FFEC9FC4D457CC356>I<B792B6FCA526003FFECAEA
-FC00806D606F15016D608119036D606F15076D606F150F6D6081191F6D6D93C7FC61027F
-163E6F157E023F167C8119FC6E6D5C18016E5E7013036E5E8218076E6D5C180F6E5E7013
-1F6E93C8FC705B037F143E82187E033F147C7013FC6F5C17816F5C17C117C36F5C17E76F
-5C17FF6F5CA36F91C9FCA2705AA2705AA3705AA2705AA2705AA250457EC355>I<B600FE
-017FB691B512FEA526007FFCC8D83FFEC9EA7C006E82013F701778807415F86D705F6F70
-14016D705FA26F7014036D64814E6D14076D646F70140F6D041E94C7FCA26F023E6D5C6D
-DC3C7F151E81027F037C6D5CF0783F6F70147C023F4B6C1578A26F01016F13F86E4B6C5D
-16806E02036F485A4E7E04C0EEE0036E4A486C5DA2DCE00FEDF0076E4B6C5D16F06E4A6F
-48C8FC051E7F04F8705A6E4A027F131EA2DCFC7CEDFE3E037F0178023F133C04FE16FF03
-3F01F85E4D8004FF17F86F496E5BA36F496E5BA26F604D80A26F90C86C5BA36F486F90C9
-FCA26F48167EA30478163C6F457EC374>I<903801FFE0011F13FE017F6D7E48B612E03A
-03FE007FF84848EB1FFC6D6D7E486C6D7EA26F7FA36F7F6C5A6C5AEA00F090C7FCA40203
-B5FC91B6FC1307013F13F19038FFFC01000313E0000F1380381FFE00485A5B127F5B12FF
-5BA35DA26D5B6C6C5B4B13F0D83FFE013EEBFFC03A1FFF80FC7F0007EBFFF86CECE01FC6
-6CEB8007D90FFCC9FC322F7DAD36>97 D<EB7FC0B5FCA512037EB1ED0FF892B57E02C314
-E002CF14F89139DFC03FFC9139FF000FFE02FCEB03FF4A6D13804A15C04A6D13E05CEF7F
-F0A218F8173FA318FCAC18F8A2177F18F0A3EFFFE06E15C06E5B6E491380027C49130049
-6C495A903AFC1FC07FFC496CB512F0D9F00314C049C691C7FCC8EA1FF036467DC43E>I<
-EC3FFC49B512C0010F14F0013F14FC90397FF003FE9039FFC001FF0003495A4849481380
-5B120F485AA2485A6F1300007F6E5AED00784991C7FCA212FFAC6C7EA3123F6DEC03C0A2
-6C6C1407000F16806D140F6C6DEB1F006C6D133E6C01F05B3A007FFC03F86DB55A010F14
-C0010391C7FC9038003FF82A2F7CAD32>I<EE03FEED07FFA5ED001F160FB1EC3FE09038
-03FFFC010FEBFF8F013F14CF9039FFF807FF48EBC00148903880007F4890C7123F484814
-1F49140F121F485AA3127F5BA212FFAC127FA37F123FA26C6C141FA26C6C143F0007157F
-6C6C91B5FC6CD9C00314FC6C9038F01FEF6DB5128F011FEBFE0F010713F89026007FC0EB
-F80036467CC43E>I<EC3FF80103B57E010F14E0013F8090397FF83FF89039FFC007FC48
-496C7E48496C7E48486D1380485A001FED7FC05B003FED3FE0A2127F5B17F0161F12FFA2
-90B7FCA401F0C9FCA5127FA27FA2123F17F06C7E16016C6C15E06C6C14036C6DEB07C06C
-6DEB0F806C01F0EB3F0090397FFE01FE011FB55A010714F0010114C09026001FFEC7FC2C
-2F7DAD33>I<EDFF80020F13E0027F13F049B512F849EB8FFC90390FFE0FFE90381FFC1F
-14F8133FEB7FF0A2ED0FFCEBFFE0ED03F0ED00C01600ABB612F8A5C601E0C7FCB3B0007F
-EBFFE0A527467DC522>I<DAFFE0137E010F9039FE03FF80013FEBFF8F90B812C048D9C0
-7F133F489038001FF84848EB0FFC4848903907FE1F80001F9238FF0F00496D90C7FCA200
-3F82A8001F93C7FCA26D5B000F5D6C6C495A6C6C495A6C9038C07FF04890B55A1680D807
-8F49C8FC018013E0000F90CAFCA47F7F7F90B612C016FC6CEDFF8017E06C826C16FC7E00
-0382000F82D81FF0C77ED83FC014074848020113808248C9FC177FA46D15FF007F17006D
-5C6C6C4A5A6C6C4A5AD80FFEEC3FF83B07FFC001FFF0000190B612C06C6C92C7FC010F14
-F8D9007F90C8FC32427DAC38>I<EB7FC0B5FCA512037EB1ED07FE92383FFF8092B512E0
-02C114F89139C7F03FFC9138CF801F9139DF000FFE14DE14FC4A6D7E5CA25CA35CB3A7B6
-0083B512FEA537457CC43E>I<137C48B4FC4813804813C0A24813E0A56C13C0A26C1380
-6C1300EA007C90C7FCAAEB7FC0EA7FFFA512037EB3AFB6FCA518467CC520>I<EB7FC0B5
-FCA512037EB293387FFFE0A593380FE0004C5A4CC7FC167E5EED03F8ED07E04B5A4B5A03
-7FC8FC15FEECC1FCECC3FE14C7ECDFFF91B57E82A202F97F02E17F02C07FEC807F6F7E82
-6F7E816F7F836F7F816F7F83707E163FB60003B512F8A535457DC43B>107
-D<EB7FC0B5FCA512037EB3B3B3A3B61280A519457CC420>I<90277F8007FEEC0FFCB590
-263FFFC090387FFF8092B5D8F001B512E002816E4880913D87F01FFC0FE03FF8913D8FC0
-0FFE1F801FFC0003D99F009026FF3E007F6C019E6D013C130F02BC5D02F86D496D7EA24A
-5D4A5DA34A5DB3A7B60081B60003B512FEA5572D7CAC5E>I<90397F8007FEB590383FFF
-8092B512E0028114F8913987F03FFC91388F801F000390399F000FFE6C139E14BC02F86D
-7E5CA25CA35CB3A7B60083B512FEA5372D7CAC3E>I<EC1FFC49B512C0010714F0011F14
-FC90397FF80FFF9026FFC0017F48496C7F4848C7EA3FE000078248486E7E49140F001F82
-A2003F82491407007F82A400FF1780AA007F1700A46C6C4A5AA2001F5E6D141F000F5E6C
-6C4A5AA26C6C6CEBFFE06C6D485B27007FF80F90C7FC6DB55A010F14F8010114C0902600
-1FFCC8FC312F7DAD38>I<90397FC00FF8B590B57E02C314E002CF14F89139DFC03FFC91
-39FF001FFE000301FCEB07FF6C496D13804A15C04A6D13E05C7013F0A2EF7FF8A4EF3FFC
-ACEF7FF8A318F017FFA24C13E06E15C06E5B6E4913806E4913006E495A9139DFC07FFC02
-CFB512F002C314C002C091C7FCED1FF092C9FCADB67EA536407DAC3E>I<DA3FE0131E90
-2603FFFC133E010F01FF137E013F1480903AFFF80FE0FE489038E003F148EBC001489038
-8000FB4890C7127F49143F001F151F485A160F5B127FA3485AAC6C7EA46C7EA26C6C141F
-163F6C6C147F6C15FF6C6D5A6C9038E003EF6C9038F01FCF6DB5128F011FEBFE0F010313
-F89038007FC091C7FCAD0307B512FCA536407CAC3B>I<90387F807FB53881FFE0028313
-F0028F13F8ED8FFC91389F1FFE000313BE6C13BC14F8A214F0ED0FFC9138E007F8ED01E0
-92C7FCA35CB3A5B612E0A5272D7DAC2E>I<90391FFC038090B51287000314FF120F381F
-F003383FC00049133F48C7121F127E00FE140FA215077EA27F01E090C7FC13FE387FFFF0
-14FF6C14C015F06C14FC6C800003806C15806C7E010F14C0EB003F020313E0140000F014
-3FA26C141F150FA27EA26C15C06C141FA26DEB3F8001E0EB7F009038F803FE90B55A00FC
-5CD8F03F13E026E007FEC7FC232F7CAD2C>I<EB01E0A51303A41307A2130FA2131FA213
-3F137F13FF1203000F90B51280B7FCA4C601E0C7FCB3A3ED01E0A9150302F013C0137F15
-0790393FF80F8090391FFC1F006DB5FC6D13FC01015B9038003FE023407EBE2C>I<D97F
-C049B4FCB50103B5FCA50003EC000F6C81B3A85EA25EA25E7E6E491380017FD901F713FE
-9138F807E76DB512C7010F1407010313FE9026007FF0EBFC00372E7CAC3E>I<B6903803
-FFFCA5000101E09038003E006C163C80017F5D8017F8013F5D6E1301011F5D6E1303010F
-5D6E13076D5DED800F6D92C7FC15C05E6DEBE01E163E6D143CEDF07C027F1378EDF8F802
-3F5B15FD021F5B15FF6E5BA36E5BA26E90C8FCA26E5AA26E5AA21578362C7EAB3B>I<B5
-D8FE1FB539801FFFF0A500019027C0003FE0C7EA7C007114786E17F86C6F6C5C6E160101
-7F6E6C5CA26E011F1403013F6F5C6E013F1407011F6F5CA26E0179140F010F048090C7FC
-6E01F95C6D02F0EBC01E15806D902681E07F5B18E003C3157C6D9139C03FF07815E76DDA
-801F5B18F803FF14F96E9039000FFDE018FF6E486D5BA36E486D5BA26E486D90C8FCA24B
-7F02075DA26E48147C4B143C4C2C7EAB51>I<B500FE90383FFFF0A5C601F0903803E000
-6D6C495A013F4A5A6D6C49C7FC6E5B6D6C137E6DEB807C6D6D5A6DEBC1F0EDE3E06DEBF7
-C06EB45A806E90C8FC5D6E7E6E7F6E7FA24A7F4A7F8291381F3FFCEC3E1F027C7F4A6C7E
-49486C7F01036D7F49487E02C08049486C7F49C76C7E013E6E7E017E141FB500E090B512
-FCA5362C7EAB3B>I<B6903803FFFCA5000101E09038003E006C163C80017F5D8017F801
-3F5D6E1301011F5D6E1303010F5D6E13076D5DED800F6D92C7FC15C05E6DEBE01E163E6D
-143CEDF07C027F1378EDF8F8023F5B15FD021F5B15FF6E5BA36E5BA26E90C8FCA26E5AA2
-6E5AA21578A215F85D14015D001F1303D83F805B387FC007D8FFE05B140F92C9FC5C143E
-495A387FC1F8EB07F06CB45A6C5B000790CAFCEA01FC36407EAB3B>I<001FB71280A490
-26FC001F130001E0495A5B49495A90C7485A48495B123E4A5B4A5B003C495BA24A90C7FC
-4A5A4A5AC7FC4A5A495B495BA2495B499038800780491300A2495A4948130F49481400A2
-485B48495B485BA248495B4890C75A48485C15034848EB1FFEB7FCA4292C7DAB32>I
+>I<EC3FF849B5FC010F14E0013F14F890397FF01FFC9039FFC007FE4890380001FF4848
+6D1380000716C049147F000F16E049143F001F16F0A2003F16F8A249141F007F16FCA600
+FF16FEB3A3007F16FCA56C6CEC3FF8A3001F16F0A2000F16E06D147F000716C06D14FF6C
+6C4913806C6D4813006C6D485A90397FF01FFC6DB55A010F14E0010314809026003FF8C7
+FC2F427CC038>48 D<EC03C01407141F147FEB03FF133FB6FCA413C3EA0003B3B3ADB712
+FCA5264177C038>I<ECFFE0010F13FE013F6D7E90B612E0000315F82607FC0313FE3A0F
+E0007FFFD81F806D138048C7000F13C0488001C015E001F07F00FF6E13F07F17F881A46C
+5A6C5A6C5AC9FC17F05DA217E05D17C04B13804B1300A2ED1FFC4B5A5E4B5A4B5A4A90C7
+FC4A5A4A5AEC0FF04A5AEC3F804AC7127814FE495A494814F8D907E014F0495A495A49C8
+FC017C140149140348B7FC4816E05A5A5A5A5AB8FC17C0A42D417BC038>I<ECFFF00107
+13FF011F14C0017F14F049C66C7ED803F8EB3FFED807E06D7E81D80FF86D138013FE001F
+16C07FA66C5A6C4815806C485BC814005D5E4B5A4B5A4B5A4A5B020F1380902607FFFEC7
+FC15F815FF16C090C713F0ED3FFCED0FFEEEFF80816F13C017E0A26F13F0A217F8A3EA0F
+C0EA3FF0487EA2487EA217F0A25D17E06C5A494913C05BD83F80491380D81FF0491300D8
+0FFEEBFFFE6CB612F800015D6C6C14C0011F49C7FC010113E02D427BC038>I<163FA25E
+5E5D5DA25D5D5D5DA25D92B5FCEC01F7EC03E7140715C7EC0F87EC1F07143E147E147C14
+F8EB01F0EB03E0130714C0EB0F80EB1F00133E5BA25B485A485A485A120F5B48C7FC123E
+5A12FCB91280A5C8000F90C7FCAC027FB61280A531417DC038>I<0007150301E0143F01
+FFEB07FF91B6FC5E5E5E5E5E16804BC7FC5D15E092C8FC01C0C9FCAAEC3FF001C1B5FC01
+C714C001DF14F09039FFE03FFC9138000FFE01FC6D7E01F06D13804915C0497F6C4815E0
+C8FC6F13F0A317F8A4EA0F80EA3FE0487E12FF7FA317F05B5D6C4815E05B007EC74813C0
+123E003F4A1380D81FC0491300D80FF0495AD807FEEBFFFC6CB612F0C65D013F1480010F
+01FCC7FC010113C02D427BC038>I<4AB47E021F13F0027F13FC49B6FC01079038807F80
+90390FFC001FD93FF014C04948137F4948EBFFE048495A5A1400485A120FA248486D13C0
+EE7F80EE1E00003F92C7FCA25B127FA2EC07FC91381FFF8000FF017F13E091B512F89039
+F9F01FFC9039FBC007FE9039FF8003FF17804A6C13C05B6F13E0A24915F0A317F85BA412
+7FA5123FA217F07F121FA2000F4A13E0A26C6C15C06D4913806C018014006C6D485A6C90
+38E01FFC6DB55A011F5C010714C0010191C7FC9038003FF02D427BC038>I<121E121F13
+FC90B712FEA45A17FC17F817F017E017C0A2481680007EC8EA3F00007C157E5E00785D15
+014B5A00F84A5A484A5A5E151FC848C7FC157E5DA24A5A14035D14074A5AA2141F5D143F
+A2147F5D14FFA25BA35B92C8FCA35BA55BAA6D5A6D5A6D5A2F447AC238>I<EC7FF00103
+B5FC010F14C0013F14F090397F801FFC3A01FC0003FE48486D7E497F4848EC7F80163F48
+4815C0A2001F151FA27FA27F7F01FE143F6D158002C0137F02F014006C01FC5B6E485A6C
+9038FF83FCEDE7F86CECFFE06C5D6C92C7FC6D14C06D80010F14F882013F8090B7FC4801
+3F14802607FC0F14C0260FF80314E04848C6FC496D13F0003F141F48481307496D13F815
+0000FF157F90C8123F161F160FA21607A36D15F0127F160F6D15E06C6C141F6DEC3FC06C
+6CEC7F80D80FFE903801FF003A07FFC00FFE6C90B55AC615F0013F14C0010F91C7FC0100
+13F02D427BC038>I<EC7FF0903807FFFE011F6D7E017F14E09039FFE03FF0489038800F
+F848496C7E48488048486D7E001F80003F1680A2484815C08117E0A212FF17F0A617F8A4
+5D127FA3003F5CA26C7E5D6C6C5B12076C6C133E6CEBC07C6CEBFFF8013F5B010F01C013
+F00101130090C8FCA217E05DA2EA03C0D80FF015C0487E486C491380A217004B5A150F5E
+49495A6C48495A01C0EBFFE0260FF0035B6CB65A6C4AC7FC6C14F86C6C13E0D907FEC8FC
+2D427BC038>I<EA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7FFCEA3FF8EA1FF0EA07C0C7
+FCAEEA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7FFCEA3FF8EA1FF0EA07C00F2C78AB1F>
+I<EE1F80A24C7EA24C7EA34C7EA24B7FA34B7FA24B7FA34B7F169F031F80161F82033F80
+ED3E07037E80157C8203FC804B7E02018115F0820203814B137F0207815D173F020F814B
+7F021F8292C77EA24A82023E80027E82027FB7FCA291B87EA2498302F0C8FCA20103834A
+157F0107834A153FA249488284011F8491C97E4984133E017E82B6020FB612F0A54C457C
+C455>65 D<B9FC18F018FE727E19E026003FFCC700077F05017F716C7E727E727EA27213
+80A37213C0A74E1380A24E1300A24E5A4E5A4E5A4D5B05075B94B5128091B700FCC7FC18
+F018FF19E002FCC7000113F8716C7EF01FFE727E7213801AC07213E0A27213F0A31AF8A7
+1AF0A2601AE0604E13C0604E138095B5120005075BBA12F86119C04EC7FC18E045447CC3
+50>I<DCFFF01470031F01FF14F04AB6EAE0010207EDF803023FEDFE0791B539E001FF0F
+4949C7EA3F9F010701F0EC0FFF4901C0804990C87E4948814948814948167F4849163F48
+49161F5A4A160F485B19074890CAFC19035A5BA2007F1801A34994C7FC12FFAE127F7F1A
+F0A2123FA27F6C18011AE06C7F19036C6D17C06E16077E6C6DEE0F806C6DEE1F006D6C5E
+6D6C167E6D6C6C5D6D6D4A5A6D01F0EC07F0010101FEEC1FE06D903AFFF001FF80023F90
+B6C7FC020715FC020115F0DA001F1480030001F8C8FC44467AC451>I<B9FC18F018FE72
+7E19E026003FFEC7001F13F805017F9438003FFF060F7F727F727F727F84737E737EA273
+7EA2737EA21B80A2851BC0A51BE0AD1BC0A51B8061A21B006162193F624F5A19FF624E5B
+06075B4E5B063F90C7FC4DB45A050F13F8BA5A19C04EC8FC18F095C9FC4B447CC356>I<
+BA12F8A485D8001F90C71201EF003F180F180318011800A2197E193EA3191EA21778A285
+A405F890C7FCA316011603161F92B5FCA5ED001F160316011600A2F101E01778A2F103C0
+A494C7FC1907A21A80A2190FA2191FA2193FF17F0061601807181F4DB5FCBBFC61A44344
+7DC34A>I<BA1280A419C026003FFEC7121F1701EF007F183F181F180F180719E01803A3
+1801A3EE01E0F000F0A419001603A31607160F167F91B6FCA59138FE007F160F16071603
+A31601A693C9FCAFB712F0A53C447CC346>I<DCFFF01470031F01FF14F04AB6EAE00102
+07EDF803023FEDFE0791B539E001FF0F4949C7EA3F9F010701F0EC0FFF4901C0804990C8
+7E4948814948814948167F4849163F4849161F5A4A160F485B19074890CAFC19035A5BA2
+007F1801A34994C8FC12FFAD057FB612F0127F7FA3003FDC0001EBF000A27F7EA26C7FA2
+6C7F807E6C7F6C7F6D7E6D6C5D6D6C7E6D6D5C6D01F05C010101FE143F6D903AFFF001FF
+9F023F90B6120F0207EDFC030201EDF000DA001F02C01330030001FCC9FC4C467AC458>
+I<B7D88003B612FEA526003FFEC9EBF800B3A791B9FCA54AC9FCB3AAB7D88003B612FEA5
+4F447CC358>I<B712E0A5D8001F90C7FCB3B3B3A4B712E0A523447DC32A>I<B76C0103B5
+12F8A526003FFEC93807E0004F5A4F5A077EC7FC614E5A4E5A4E5AF01F804EC8FC187E60
+4D5AEF07F0EF0FC04D5A4DC9FC177E4C5AEE03F04C5A4C5A4C7EEE7FF04C7E5D4B7F4B7F
+4B7FED3F3FDB7E1F7F03FC806E486C7F4B7E4B6C7F0380804B6C7F4A7F717E84717F8371
+7F85717F83717F85717F187F727E86727F84727F86727F84B76C90B612FCA54E447CC358
+>75 D<B712F0A526003FFECAFCB3B1F00780A4180F1900A460A360A2187EA218FE170117
+031707171F177FEE03FFB95AA539447CC343>I<B500FE067FB512806E95B6FCA26F5EA2
+D8003F50C7FC013D6DEE03DFA2013C6DEE079FA26E6CEE0F1FA26E6C161EA26E6C163CA3
+6E6C1678A26E6C16F0A26E6DEC01E0A26E6DEC03C0A36E6DEC0780A26F6CEC0F00A26F6C
+141EA26F6C5CA36F6C5CA26F6C5CA26F6D485AA26F6D485AA26F6D485AA3706C48C7FCA2
+93383FF81EA2706C5AA2706C5AA3706C5AA2705BA2705BA2705BA2B6057FB6128071C7FC
+A2173E171C61447CC36A>I<B64BB512FE8181A281D8003F6D91C7EA780081013D7F8113
+3C6E7E6E7F6E7F6E7F6E7F82806E7F6E7F6F7E6F7F83816F7F6F7F6F7F6F7F6F7F838270
+7F707F707F707F8482707F707F717E7113807113C019E0837113F07113F87113FC7113FE
+19FF847213F884848484A28484197F193F191FA2190F1907B61603190119001A78A24F44
+7CC358>I<B9FC18F018FE727E19E0D8001F90C7000F7F05017F716C7E727E727E721380
+A21AC084A21AE0A91AC0A24E1380A21A00604E5A4E5A4D485A050F5B92B712C096C7FC18
+FC18C092CBFCB3A7B712E0A543447DC34D>80 D<B812F8EFFFC018F818FE727ED8001F90
+C7003F13E005037F05007F727E727E727EA28684A286A762A24E90C7FCA24E5A61187F94
+3801FFF005075B053F138092B7C8FC18F818E018F892C77FEF3FFF050F7F717F717FA271
+7FA2717FA785A61B0F85A2187F73131F72141EB700E06DEB803E72EBE0FC72EBFFF80601
+14F0726C13E0CC0007138050457DC354>82 D<DAFFE0131C010701FE133C013F9038FF80
+7C90B6EAE0FC4815F9489038801FFF3907FC00014848EB007F4848143F4848140F491407
+007F15035B1601160012FF177CA27FA26D153C7F7F6D92C7FC6C7EEBFFE014FE6CEBFFF0
+15FF6C15E016FC6C816C6F7E6C826C826C6C81011F810107811300020F80140003077FED
+007F82040F1380828212F082A282A27EA218007EA26C5D6C5E6D14036D5D6D140701F84A
+5A01FFEC3FF002F8EBFFE0486CB65AD8FC1F92C7FCD8F80714FC48C614F0480107138031
+467AC43E>I<003FBA12E0A59026FE000FEB8003D87FE09338003FF049171F90C71607A2
+007E1803007C1801A300781800A400F819F8481978A5C81700B3B3A20107B8FCA545437C
+C24E>I<B76C010FB512F8A526003FFEC93803E000B3B3A9011F17076280190F6D606F15
+1F6D95C7FC6D6D5D197E6D6D5D6D6D1403DA7FFC4A5A6EB4EC3FF0020F9039F003FFE06E
+90B61280020193C8FC6E6C14FC030F14E09226007FFEC9FC4D457CC356>I<B792B6FCA5
+26003FFECAEAFC00806D606F15016D608119036D606F15076D606F150F6D6081191F6D6D
+93C7FC61027F163E6F157E023F167C8119FC6E6D5C18016E5E7013036E5E8218076E6D5C
+180F6E5E70131F6E93C8FC705B037F143E82187E033F147C7013FC6F5C17816F5C17C117
+C36F5C17E76F5C17FF6F5CA36F91C9FCA2705AA2705AA3705AA2705AA2705AA250457EC3
+55>I<B600FE017FB691B512FEA526007FFCC8D83FFEC9EA7C006E82013F701778807415
+F86D705F6F7014016D705FA26F7014036D64814E6D14076D646F70140F6D041E94C7FCA2
+6F023E6D5C6DDC3C7F151E81027F037C6D5CF0783F6F70147C023F4B6C1578A26F01016F
+13F86E4B6C5D16806E02036F485A4E7E04C0EEE0036E4A486C5DA2DCE00FEDF0076E4B6C
+5D16F06E4A6F48C8FC051E7F04F8705A6E4A027F131EA2DCFC7CEDFE3E037F0178023F13
+3C04FE16FF033F01F85E4D8004FF17F86F496E5BA36F496E5BA26F604D80A26F90C86C5B
+A36F486F90C9FCA26F48167EA30478163C6F457EC374>I<903801FFE0011F13FE017F6D
+7E48B612E03A03FE007FF84848EB1FFC6D6D7E486C6D7EA26F7FA36F7F6C5A6C5AEA00F0
+90C7FCA40203B5FC91B6FC1307013F13F19038FFFC01000313E0000F1380381FFE00485A
+5B127F5B12FF5BA35DA26D5B6C6C5B4B13F0D83FFE013EEBFFC03A1FFF80FC7F0007EBFF
+F86CECE01FC66CEB8007D90FFCC9FC322F7DAD36>97 D<EB7FC0B5FCA512037EB1ED0FF8
+92B57E02C314E002CF14F89139DFC03FFC9139FF000FFE02FCEB03FF4A6D13804A15C04A
+6D13E05CEF7FF0A218F8173FA318FCAC18F8A2177F18F0A3EFFFE06E15C06E5B6E491380
+027C491300496C495A903AFC1FC07FFC496CB512F0D9F00314C049C691C7FCC8EA1FF036
+467DC43E>I<EC3FFC49B512C0010F14F0013F14FC90397FF003FE9039FFC001FF000349
+5A48494813805B120F485AA2485A6F1300007F6E5AED00784991C7FCA212FFAC6C7EA312
+3F6DEC03C0A26C6C1407000F16806D140F6C6DEB1F006C6D133E6C01F05B3A007FFC03F8
+6DB55A010F14C0010391C7FC9038003FF82A2F7CAD32>I<EE03FEED07FFA5ED001F160F
+B1EC3FE0903803FFFC010FEBFF8F013F14CF9039FFF807FF48EBC00148903880007F4890
+C7123F4848141F49140F121F485AA3127F5BA212FFAC127FA37F123FA26C6C141FA26C6C
+143F0007157F6C6C91B5FC6CD9C00314FC6C9038F01FEF6DB5128F011FEBFE0F010713F8
+9026007FC0EBF80036467CC43E>I<EC3FF80103B57E010F14E0013F8090397FF83FF890
+39FFC007FC48496C7E48496C7E48486D1380485A001FED7FC05B003FED3FE0A2127F5B17
+F0161F12FFA290B7FCA401F0C9FCA5127FA27FA2123F17F06C7E16016C6C15E06C6C1403
+6C6DEB07C06C6DEB0F806C01F0EB3F0090397FFE01FE011FB55A010714F0010114C09026
+001FFEC7FC2C2F7DAD33>I<EDFF80020F13E0027F13F049B512F849EB8FFC90390FFE0F
+FE90381FFC1F14F8133FEB7FF0A2ED0FFCEBFFE0ED03F0ED00C01600ABB612F8A5C601E0
+C7FCB3B0007FEBFFE0A527467DC522>I<DAFFE0137E010F9039FE03FF80013FEBFF8F90
+B812C048D9C07F133F489038001FF84848EB0FFC4848903907FE1F80001F9238FF0F0049
+6D90C7FCA2003F82A8001F93C7FCA26D5B000F5D6C6C495A6C6C495A6C9038C07FF04890
+B55A1680D8078F49C8FC018013E0000F90CAFCA47F7F7F90B612C016FC6CEDFF8017E06C
+826C16FC7E000382000F82D81FF0C77ED83FC014074848020113808248C9FC177FA46D15
+FF007F17006D5C6C6C4A5A6C6C4A5AD80FFEEC3FF83B07FFC001FFF0000190B612C06C6C
+92C7FC010F14F8D9007F90C8FC32427DAC38>I<EB7FC0B5FCA512037EB1ED07FE92383F
+FF8092B512E002C114F89139C7F03FFC9138CF801F9139DF000FFE14DE14FC4A6D7E5CA2
+5CA35CB3A7B60083B512FEA537457CC43E>I<137C48B4FC4813804813C0A24813E0A56C
+13C0A26C13806C1300EA007C90C7FCAAEB7FC0EA7FFFA512037EB3AFB6FCA518467CC520
+>I<EB7FC0B5FCA512037EB293387FFFE0A593380FE0004C5A4CC7FC167E5EED03F8ED07
+E04B5A4B5A037FC8FC15FEECC1FCECC3FE14C7ECDFFF91B57E82A202F97F02E17F02C07F
+EC807F6F7E826F7E816F7F836F7F816F7F83707E163FB60003B512F8A535457DC43B>
+107 D<EB7FC0B5FCA512037EB3B3B3A3B61280A519457CC420>I<90277F8007FEEC0FFC
+B590263FFFC090387FFF8092B5D8F001B512E002816E4880913D87F01FFC0FE03FF8913D
+8FC00FFE1F801FFC0003D99F009026FF3E007F6C019E6D013C130F02BC5D02F86D496D7E
+A24A5D4A5DA34A5DB3A7B60081B60003B512FEA5572D7CAC5E>I<90397F8007FEB59038
+3FFF8092B512E0028114F8913987F03FFC91388F801F000390399F000FFE6C139E14BC02
+F86D7E5CA25CA35CB3A7B60083B512FEA5372D7CAC3E>I<EC1FFC49B512C0010714F001
+1F14FC90397FF80FFF9026FFC0017F48496C7F4848C7EA3FE000078248486E7E49140F00
+1F82A2003F82491407007F82A400FF1780AA007F1700A46C6C4A5AA2001F5E6D141F000F
+5E6C6C4A5AA26C6C6CEBFFE06C6D485B27007FF80F90C7FC6DB55A010F14F8010114C090
+26001FFCC8FC312F7DAD38>I<90397FC00FF8B590B57E02C314E002CF14F89139DFC03F
+FC9139FF001FFE000301FCEB07FF6C496D13804A15C04A6D13E05C7013F0A2EF7FF8A4EF
+3FFCACEF7FF8A318F017FFA24C13E06E15C06E5B6E4913806E4913006E495A9139DFC07F
+FC02CFB512F002C314C002C091C7FCED1FF092C9FCADB67EA536407DAC3E>I<DA3FE013
+1E902603FFFC133E010F01FF137E013F1480903AFFF80FE0FE489038E003F148EBC00148
+90388000FB4890C7127F49143F001F151F485A160F5B127FA3485AAC6C7EA46C7EA26C6C
+141F163F6C6C147F6C15FF6C6D5A6C9038E003EF6C9038F01FCF6DB5128F011FEBFE0F01
+0313F89038007FC091C7FCAD0307B512FCA536407CAC3B>I<90387F807FB53881FFE002
+8313F0028F13F8ED8FFC91389F1FFE000313BE6C13BC14F8A214F0ED0FFC9138E007F8ED
+01E092C7FCA35CB3A5B612E0A5272D7DAC2E>I<90391FFC038090B51287000314FF120F
+381FF003383FC00049133F48C7121F127E00FE140FA215077EA27F01E090C7FC13FE387F
+FFF014FF6C14C015F06C14FC6C800003806C15806C7E010F14C0EB003F020313E0140000
+F0143FA26C141F150FA27EA26C15C06C141FA26DEB3F8001E0EB7F009038F803FE90B55A
+00FC5CD8F03F13E026E007FEC7FC232F7CAD2C>I<EB01E0A51303A41307A2130FA2131F
+A2133F137F13FF1203000F90B51280B7FCA4C601E0C7FCB3A3ED01E0A9150302F013C013
+7F150790393FF80F8090391FFC1F006DB5FC6D13FC01015B9038003FE023407EBE2C>I<
+D97FC049B4FCB50103B5FCA50003EC000F6C81B3A85EA25EA25E7E6E491380017FD901F7
+13FE9138F807E76DB512C7010F1407010313FE9026007FF0EBFC00372E7CAC3E>I<B690
+3803FFFCA5000101E09038003E006C163C80017F5D8017F8013F5D6E1301011F5D6E1303
+010F5D6E13076D5DED800F6D92C7FC15C05E6DEBE01E163E6D143CEDF07C027F1378EDF8
+F8023F5B15FD021F5B15FF6E5BA36E5BA26E90C8FCA26E5AA26E5AA21578362C7EAB3B>
+I<B5D8FE1FB539801FFFF0A500019027C0003FE0C7EA7C007114786E17F86C6F6C5C6E16
+01017F6E6C5CA26E011F1403013F6F5C6E013F1407011F6F5CA26E0179140F010F048090
+C7FC6E01F95C6D02F0EBC01E15806D902681E07F5B18E003C3157C6D9139C03FF07815E7
+6DDA801F5B18F803FF14F96E9039000FFDE018FF6E486D5BA36E486D5BA26E486D90C8FC
+A24B7F02075DA26E48147C4B143C4C2C7EAB51>I<B500FE90383FFFF0A5C601F0903803
+E0006D6C495A013F4A5A6D6C49C7FC6E5B6D6C137E6DEB807C6D6D5A6DEBC1F0EDE3E06D
+EBF7C06EB45A806E90C8FC5D6E7E6E7F6E7FA24A7F4A7F8291381F3FFCEC3E1F027C7F4A
+6C7E49486C7F01036D7F49487E02C08049486C7F49C76C7E013E6E7E017E141FB500E090
+B512FCA5362C7EAB3B>I<B6903803FFFCA5000101E09038003E006C163C80017F5D8017
+F8013F5D6E1301011F5D6E1303010F5D6E13076D5DED800F6D92C7FC15C05E6DEBE01E16
+3E6D143CEDF07C027F1378EDF8F8023F5B15FD021F5B15FF6E5BA36E5BA26E90C8FCA26E
+5AA26E5AA21578A215F85D14015D001F1303D83F805B387FC007D8FFE05B140F92C9FC5C
+143E495A387FC1F8EB07F06CB45A6C5B000790CAFCEA01FC36407EAB3B>I
 E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fe cmbx12 14.4 62
-/Fe 62 123 df<922601FFFC903801FFE0033F9026FF801F13F84AB6D8E07F13FE020F03
-F9B6FC023FD9C00FB500C0138091277FFC0003D9FE0113C0902601FFE049495A49494949
-4813E04990C714F049484A13E0495A19C0495A7413C0017F17804A6E6E1380719138007E
-007192C7FCAEBCFCA526007FF8C7000301C0C8FCB3B3A7007FB5D8F803B612F0A553547D
-D34E>11 D<EEFFFC031FEBFF804AB612E0020781021F9038C00FF8913A7FFE0003FCDAFF
-F0EB00FE4949EB03FF4901805B4990C7487F49485CA2495A4D7F013F6F5B5CA37190C7FC
-715AEF01F894C9FCA90403B512C0BAFCA526003FFCC7120783B3B3A6003FB5D8FC03B612
-C0A542547DD34B>I<151E153E157E15FCEC01F8EC07F0EC0FE0EC1FC01580143FEC7F00
-14FE1301495A5C1307495AA2495A133F5C137FA2495AA24890C7FCA25A5BA21207A2485A
-A3121F5BA3123FA25BA3127FA55B12FFB3A3127F7FA5123FA37FA2121FA37F120FA36C7E
-A21203A27F7EA26C7FA26D7EA2133F80131F6D7EA26D7E1303806D7E1300147FEC3F8014
-1F15C0EC0FE0EC07F0EC01F8EC00FC157E153E151E1F7973D934>40
-D<127012F8127C127E7EEA1FC06C7E6C7E12037F6C7E6C7E7F6D7E133F806D7EA26D7E80
-130780A26D7EA26D7EA215807FA215C0A2EC7FE0A315F0143FA315F8A2141FA315FCA514
-0F15FEB3A315FC141FA515F8A3143FA215F0A3147F15E0A3ECFFC0A21580A25B1500A249
-5AA2495AA25C130F5C495AA2495A5C137F49C7FC5B485A485A5B1207485A485A48C8FC12
-7E127C5A12701F7979D934>I<B712F0AB240B7F9F2D>45 D<EA07F0487E487E487E487E
-B51280A76C13006C5A6C5A6C5A6C5A1111769025>I<EF01E01703EF07F0A2170FA2EF1F
-E0A218C0173FA2EF7F80A218005FA24C5AA25F1603A24C5AA25F160FA24C5AA25F163FA2
-4C5AA294C7FC5EA24B5AA25E1503A24B5AA25E150FA24B5AA25E153FA24B5AA293C8FC5D
-A24A5AA25D1403A25D1407A24A5AA25D141FA24A5AA25D147FA24AC9FCA25C1301A2495A
-A25C1307A2495AA25C131FA2495AA25C137FA249CAFCA25B1201A2485AA25B1207A2485A
-A25B121FA2485AA25B127FA248CBFCA25AA2127CA2347879D943>I<913803FFC0023F13
-FC91B6FC010315C0010F018113F0903A1FFC003FF849486D7E49486D7E49486D7E48496D
-138048496D13C0A24817E04890C813F0A34817F8A24817FC49157FA3007F17FEA600FF17
-FFB3A5007F17FEA6003F17FCA26D15FFA26C17F8A36C17F0A26C6D4913E0A26C6D4913C0
-6C17806E5B6C6D4913006D6C495AD91FFCEB3FF8903A0FFF81FFF06D90B55A01011580D9
-003F01FCC7FC020313C0384F7BCD43>I<157815FC14031407141F14FF130F0007B5FCB6
-FCA2147F13F0EAF800C7FCB3B3B3A6007FB712FEA52F4E76CD43>I<EC3FFE0103B512E0
-010F14FC013F14FF90B712C048D9C07F7F2703FE000F13F8D807F801037FD80FE06D7F48
-486D7F48488001F01680486C6E13C07F486C6E13E07FA27013F0A56C5AA26C5AEA0FF0EA
-03C0C914E05EA218C05E1880A24C13005F4C5A4B5B5F4B5B5F4B5B4B90C7FC4B5A5E4B5A
-ED7FE04B5A4A5B4A48C8FC4A5A5D4A48EB01F04A5AEC3F804AC7FC02FEEC03E0495A495A
-495A495AD91F80140749C8FC013E150F017FB7FC90B812C05A5A5A5A5A5A5AB9FC1880A4
-344E79CD43>I<91380FFFC091B512FC0107ECFF80011F15E090263FF8077F9026FF8001
-13FC4848C76C7ED803F86E7E491680D807FC8048B416C080486D15E0A4805CA36C17C06C
-5B6C90C75AD801FC1680C9FC4C13005FA24C5A4B5B4B5B4B13C04B5BDBFFFEC7FC91B512
-F816E016FCEEFF80DA000713E0030113F89238007FFE707E7013807013C018E07013F0A2
-18F8A27013FCA218FEA2EA03E0EA0FF8487E487E487EB57EA318FCA25E18F891C7FC6C17
-F0495C6C4816E001F04A13C06C484A1380D80FF84A13006CB44A5A6CD9F0075BC690B612
-F06D5D011F1580010302FCC7FCD9001F1380374F7ACD43>I<177C17FEA2160116031607
-160FA2161F163F167FA216FF5D5DA25D5DED1FBFED3F3F153E157C15FCEC01F815F0EC03
-E01407EC0FC01580EC1F005C147E147C5C1301495A495A5C495A131F49C7FC133E5B13FC
-485A5B485A1207485A485A90C8FC123E127E5ABA12C0A5C96C48C7FCAF020FB712C0A53A
-4F7CCE43>I<D80380150ED807E0157E01FEEC03FED9FFF0137F91B65A5F5F5F5F5F94C7
-FC5E5E16F016C093C8FC15F801E190C9FC01E0CAFCABEC0FFF027F13F001E3B512FE01E7
-6E7E9026FFF8077FDAC0017F49C713F8496E7E49143F4981496E7E6C481680C9FC18C082
-18E0A418F0A3EA0FE0487E487E487E487EA418E0A35B6C484A13C05B491680003EC85A00
-3F17006C6C4A5A6D5D6C6C4A5AD807F8495BD803FE01075B2701FFC03F5B6C90B65A013F
-4AC7FC6D14F8010314C09026007FF8C8FC344F79CD43>I<ED0FFF92B512E0020780021F
-14FC91397FFE03FE903A01FFF0007F4901C0EB3F804990C7121F4948EC7FC0494814FF49
-484913E049485B01FF5C485BA2485B5AA2486F13C04A6D1380486F1300177E94C7FC5AA2
-91CAFC5AA21508913801FFF8020713FFB54814C04A14F04AC66C7E023C6D7E4A6D7E4A6D
-7E7013804A15C0A24A15E07013F05C18F8A491C714FCA37EA67EA46C17F880A27E18F06C
-5D18E06C6D15C07E6E4913806C6D15006D6C495A6D6CEB7FFC6DB448485A6D90B55A0103
-15C0010092C7FC023F13FC020713C0364F7ACD43>I<121F7F7FEBFF8091B81280A45A19
-00606060A2606060485F0180C86CC7FC007EC95A4C5A007C4B5A5F4C5A160F4C5A484B5A
-4C5A94C8FC16FEC812014B5A5E4B5A150F4B5AA24B5AA24B5A15FFA24A90C9FCA25C5D14
-07A2140FA25D141FA2143FA4147F5DA314FFA55BAC6D5BA2EC3FC06E5A395279D043>I<
-913807FFC0027F13FC0103B67E010F15E090261FFC0113F8903A3FE0003FFCD97F80EB0F
-FE49C76C7E48488048486E1380000717C04980120F18E0177FA2121F7FA27F7F6E14FF02
-E015C014F802FE4913806C7FDBC00313009238F007FE6C02F85B9238FE1FF86C9138FFBF
-F06CEDFFE017806C4BC7FC6D806D81010F15E06D81010115FC010781011F81491680EBFF
-E748018115C048D9007F14E04848011F14F048487F48481303030014F8484880161F4848
-020713FC1601824848157F173FA2171FA2170FA218F8A27F007F17F06D151FA26C6CED3F
-E0001F17C06D157F6C6CEDFF806C6C6C010313006C01E0EB0FFE6C01FCEBFFFC6C6CB612
-F06D5D010F1580010102FCC7FCD9000F13C0364F7ACD43>I<91380FFF8091B512F80103
-14FE010F6E7E4901037F90267FF8007F4948EB3FF048496D7E484980486F7E4849808248
-17805A91C714C05A7013E0A218F0B5FCA318F8A618FCA46C5DA37EA25E6C7F6C5DA26C5D
-6C7F6C6D137B6C6D13F390387FF803011FB512E36D14C30103028313F89039007FFE03EC
-00401500A218F05EA3D801F816E0487E486C16C0487E486D491380A218005E5F4C5A91C7
-FC6C484A5A494A5A49495B6C48495BD803FC010F5B9027FF807FFEC7FC6C90B55A6C6C14
-F06D14C0010F49C8FC010013F0364F7ACD43>I<171F4D7E4D7EA24D7EA34C7FA24C7FA3
-4C7FA34C7FA24C7FA34C8083047F80167E8304FE804C7E03018116F8830303814C7E0307
-8116E083030F814C7E031F81168083033F8293C77E4B82157E8403FE824B800201835D84
-0203834B800207835D844AB87EA24A83A3DA3F80C88092C97E4A84A2027E8202FE844A82
-010185A24A820103854A82010785A24A82010F855C011F717FEBFFFCB600F8020FB712E0
-A55B547BD366>65 D<BA12C019FEF1FFC01AF01AFCD8000701F0C7000313FFDE007F7F73
-7F070F7F737F878587858785A287A84F5BA263616361634F5B4F5B077F90C7FC4E485A06
-0713F892B812E097C8FC861AF003F0C7000313FE9539003FFF80070F13E0737F07017F87
-737F747E1C807413C0A27413E0A31CF0A386A362A31CE0A2621CC0A250138097B5FC1C00
-4F5B19074F5B073F13F04EB55ABC128098C7FC1AF81AC007F8C8FC54527CD160>I<9326
-01FFFCEC01C0047FD9FFC013030307B600F81307033F03FE131F92B8EA803F0203DAE003
-EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01800203B5FC494848C9FC4901F88249
-49824949824949824949824990CA7E494883A2484983485B1B7F485B481A3FA24849181F
-A3485B1B0FA25AA298C7FC5CA2B5FCAE7EA280A2F307C07EA36C7FA21B0F6C6D1980A26C
-1A1F6C7F1C006C6D606C6D187EA26D6C606D6D4C5A6D6D16036D6D4C5A6D6D4C5A6D01FC
-4C5A6D6DEE7F806D6C6C6C4BC7FC6E01E0EC07FE020F01FEEC1FF80203903AFFE001FFF0
-020091B612C0033F93C8FC030715FCDB007F14E0040101FCC9FC525479D261>I<BA7E19
-FCF1FF801AF01AFCD8000701F0C7000F13FF060014C0071F7F070713F807017F737F747E
-747F747F86747F747F8886888688A2757EA31D8087A21DC0A51DE0A387A963A31DC0A51D
-80A2631D00A3515AA2646264505B6264505B505B5090C7FCF2FFFE4F5B07075B071F5B96
-B512C0060F91C8FCBB5A1AF01AC007FCC9FC19805B527CD167>I<BC1280A5D8000701F8
-C7000114C0F0001F19071901851A7F1A3F1A1FA2F20FE0A21A07A31A03A318F81BF01A01
-A497C7FC1701A317031707170F177F92B6FCA59238F8007F170F170717031701A317001B
-3EA31B7CA395C8FCA21BFCA21BF8A21A01A31A031BF01A071A0FA21A1F1A3FF27FE0F101
-FF1907191F0603B5FCBCFCA21BC0A34F517CD058>I<BB12FEA5D8000701F8C700077FF0
-007F191F190785858586861B80A21A1FA31A0FA41BC006F81307A497C7FCA31701A31703
-1707170F177F92B6FCA59238F8007F170F170717031701A31700A795C9FCB3B812F8A54A
-517CD055>I<932601FFFCEC01C0047FD9FFC013030307B600F81307033F03FE131F92B8
-EA803F0203DAE003EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01800203B5FC4948
-48C9FC4901F8824949824949824949824949824990CA7E494883A2484983485B1B7F485B
-481A3FA24849181FA3485B1B0FA25AA298C8FC5CA2B5FCAE6C057FB712E0A280A36C94C7
-003FEBC000A36C7FA36C7FA27E6C7FA26C7F6C7FA26D7E6D7F6D7F6D6D5E6D7F6D01FC93
-B5FC6D13FF6D6C6D5C6E01F0EC07FB020F01FEEC1FF10203903AFFF001FFE0020091B6EA
-C07F033FEE001F030703FC1307DB007F02E01301040149CAFC5B5479D26A>I<B8D8C003
-B8FCA5D8000701F8C9001FEBE000B3AE92BAFCA503F8C9121FB3B1B8D8C003B8FCA56052
-7CD169>I<B812C0A5D8000701F8C7FCB3B3B3B2B812C0A52A527CD132>I<B800C091B612
-F8A5D8000701F8C90003EBF8009738007F8051C7FC505AF203F8F20FF0505A505A505A50
-C8FCF101FCF107F84F5A4F5A4F5A4F5A07FEC9FCF003FC4E5A4E5A4E5A4E5A4E5ADD01FE
-CAFC4D5A4D5A4D5A4D7E173F4D7E4C487E4C7F5E4C804C804C80EEFF7F9226F9FE3F7FDB
-FBFC809226FFF81F7F4C7EDCC0077F0480804C7E4B6D804B6D804B8284727F727F868472
-7F727F8784728087737F85737F87737F85737F88857380747F888697B512FCB800C0013F
-ECFFFEA55F527CD169>75 D<B812F8A5D8000701F8CAFCB3B3A91A7CA41AFC1AF8A51901
-A31903A219071AF0190FA2191F193F197F19FF180360183F4DB5FCBB12E0A546527CD151
->I<B600FC073FB512FE6F61A26F96B6FCA2D80007F5C00070EF01EFA202EF6DEF03CFA2
-02E76DEF078FA202E36DEF0F0FA202E16D171EA302E06D173CA26F6C1778A26F6C17F0A2
-6F6DED01E0A26F6DED03C0A36F6DED0780A26F6DED0F00A26F6D151EA26F6D5DA3706C5D
-A2706C5DA2706D495AA2706D495AA2706D495AA3706D49C7FCA2706D131EA2706D5BA271
-6C5BA3716C5BA271EB81E0A271EBC3C0A271EBE780A27101FFC8FCA3715BA2715BA2725A
-A2725AA2D93FFC6F5AB74DB712FEA2725AA2725A77527CD180>I<B600FC93B7FC8181A2
-82D800076E9239003FFC0070EE07E08282A28202EF7F02E77F02E380A202E18002E0806F
-7F6F7F6F7FA26F7F6F7F6F806F80A26F80707F707F707F707FA2707F7080708070808583
-717F717F717F717FA27114807114C07114E07213F07213F8A27213FC7213FE7213FF7214
-87A27214C77214E77313F77313FF85A285858585A28586868686A286868686A2D93FFC18
-7FB7173F1B1F1B0F1B07755A60527CD169>I<93380FFFC00303B6FC031F15E092B712FC
-0203D9FC0013FF020F01C0010F13C0023F90C7000313F0DA7FFC02007F494848ED7FFE49
-01E0ED1FFF49496F7F49496F7F4990C96C7F49854948707F4948707FA24849717E48864A
-83481B804A83481BC0A2481BE04A83A2481BF0A348497113F8A5B51AFCAF6C1BF86E5FA4
-6C1BF0A26E5F6C1BE0A36C6D4D13C0A26C6D4D1380A26C1B006C6D4D5A6E5E6C626D6C4C
-5B6D6D4B5B6D6D4B5B6D6D4B5B6D6D4B5B6D6D4B90C7FC6D6D4B5A6D01FF02035B023F01
-E0011F13F0020F01FC90B512C0020390B7C8FC020016FC031F15E0030392C9FCDB001F13
-E0565479D265>I<BAFC19F819FF1AE086D8000701F0C7001F13FC060113FF726C138073
-13C0070F13E01BF0857313F81BFCA27313FEA41BFFA81BFEA31BFC61A21BF84F13F04F13
-E0614F13C04F13004E485A061F5B92B812F01AC04FC7FC19E003F8CBFCB3AEB812C0A550
-527CD15C>I<B912F0F0FF8019F819FF1AC0D8000701F0C714F0060F7F060113FE727F73
-7F737F85737F87A2737FA387A863A2616363A24F5B4F5B4F90C8FC4F5A06035B060F13F0
-95B512C092B8C9FC19F819E019F89226F0000313FE9439007FFF80727F727F727F727F72
-7F8684A28684A787A71D1C75133EA38575137E73157C7513FC731401B86C6D9038F803F8
-07039038FE07F07390B512E0736C14C0080F1400CEEA7FFC5F537CD164>82
-D<91260FFF80130791B500F85B010702FF5B011FEDC03F49EDF07F9026FFFC006D5A4801
-E0EB0FFD4801800101B5FC4848C87E48488149150F001F824981123F4981007F82A28412
-FF84A27FA26D82A27F7F6D93C7FC14C06C13F014FF15F86CECFF8016FC6CEDFFC017F06C
-16FC6C16FF6C17C06C836C836D826D82010F821303010082021F16801400030F15C0ED00
-7F040714E01600173F050F13F08383A200788200F882A3187FA27EA219E07EA26CEFFFC0
-A27F6D4B13806D17006D5D01FC4B5A01FF4B5A02C04A5A02F8EC7FF0903B1FFFC003FFE0
-486C90B65AD8FC0393C7FC48C66C14FC48010F14F048D9007F90C8FC3C5479D24B>I<00
-3FBC1280A59126C0003F9038C0007F49C71607D87FF8060113C001E08449197F49193F90
-C8171FA2007E1A0FA3007C1A07A500FC1BE0481A03A6C994C7FCB3B3AC91B912F0A55351
-7BD05E>I<B800C00103B612FCA5D8000701F8CAEBF000F31F80B3B3B11B3FA26D97C7FC
-81637F1B7E6D6D17FE505A6E7E505A6E6D15076E4D5A6E6D4B5A6E6D4B5A6E01F84B5A6E
-6DDA03FFC8FC6E6CB46CEB0FFE6F9039F001FFF8030F90B65A030316C0DB007F92C9FC04
-0F14F8DC007F13805E537CD167>I<B700FE031FB512FEA5D8001F01F0CA383FFE00F307
-F06D626F170F6D62811B1F6D6D601B3F6D97C7FC6F5F6D197E821BFE6E6D5E1A016E6D5E
-1A036E60701507A26E6D5E1A0F6E6D5E1A1F6E6070153FA26E6D93C8FC626E6E147E1AFE
-6F5E711301A26F6D5C19036F6D5C19076F5E71130FA26F6D5C191F6F6D5C193F6F93C9FC
-715BA26FEC807E19FE706D5A18C1705C18E3705C18F318F770EBFFE0A2705CA2705CA370
-91CAFCA2705BA2715AA3715AA2715AA2715A715A5F537DD166>I<B700FC017FB600FE91
-B612F0A5D8003F01C0C8001F01E0C9EBF8006F71EE0FC06D7161876F1C1F6D7196C7FC6F
-8373606D1E3E6F836D7160876F1CFC6D666F4B801F016D66704A806E525A88704A17076E
-059F5F70021F80080F160F6E6570023F806EDC3E074CC8FC8870027E5F6EDC7C03163E70
-02FC804F6C167E6E1C7C700101814F6C16FC6E745B70010317016E4C6D5D060716C00580
-496D14036F63DDC00F16E04F6D14076F07F05BDDE01F170F6F92C76C5D1DF8DDF03E6E14
-1F6F98C9FCDDF87E16FC067C6E5C6FF1FE3EDDFCFC177E6F4A6E147C1DFFDDFFF06E14FC
-6F62A24E816F62A270496F5BA24E817061A295C97E7061A270487090CAFCA37048705AA2
-4D1601040360A27048705A84537DD18B>I<EC7FFF0107B512F0013F14FE90B77E48D9E0
-0F7F2703FE000113F0486C6D7F6EEB3FFC48826E131F83707FA36C496D7FA26C90C7FC6C
-5AC9FCA6037FB5FC020FB6FC91B7FC01071487013FEBF0074913803901FFFC004813F048
-5B485B485B4890C7FC5A5BA2485AA45EA26D5C007F151D163D6C6C02797F6C6D01F113F8
-6C9026C003E1EBFFE06C9026F81FC014F06C90B5487EC6ED001F011F01FC010713E00101
-01E090C8FC3C387CB641>97 D<EB3FF0B5FCA51203C6FCB3A4923801FFE0030F13FE033F
-EBFFC092B612F002F301017F913AF7F8003FFEDAFFE0EB0FFF03806D7F92C76C7F4A6E7F
-4A824A6E7FA2727EA285A28584A31A80AC1A00A44E5AA36118FF616E4A5BA26E4A5B6E4A
-5B6F495BDACFC04990C7FCDA87F0EB7FFC913A03FE03FFF849C6B612E0496D148049011F
-01FCC8FC90C7000313C041547BD24B>I<913801FFF8021FEBFF8091B612F0010315FC01
-0F9038C00FFE903A1FFE0001FFD97FFC491380D9FFF05B4817C048495B5C5A485BA2486F
-138091C7FC486F1300705A4892C8FC5BA312FFAD127F7FA27EA2EF03E06C7F17076C6D15
-C07E6E140F6CEE1F806C6DEC3F006C6D147ED97FFE5C6D6CEB03F8010F9038E01FF00103
-90B55A01001580023F49C7FC020113E033387CB63C>I<4DB47E0407B5FCA5EE001F1707
-B3A4913801FFE0021F13FC91B6FC010315C7010F9038E03FE74990380007F7D97FFC0101
-B5FC49487F4849143F484980485B83485B5A91C8FC5AA3485AA412FFAC127FA36C7EA37E
-A26C7F5F6C6D5C7E6C6D5C6C6D49B5FC6D6C4914E0D93FFED90FEFEBFF80903A0FFFC07F
-CF6D90B5128F0101ECFE0FD9003F13F8020301C049C7FC41547CD24B>I<913803FFC002
-3F13FC49B6FC010715C04901817F903A3FFC007FF849486D7E49486D7E4849130F48496D
-7E48178048497F18C0488191C7FC4817E0A248815B18F0A212FFA490B8FCA318E049CAFC
-A6127FA27F7EA218E06CEE01F06E14037E6C6DEC07E0A26C6DEC0FC06C6D141F6C6DEC3F
-806D6CECFF00D91FFEEB03FE903A0FFFC03FF8010390B55A010015C0021F49C7FC020113
-F034387CB63D>I<ED3FFC0203B5FC020F14C0023F14E09139FFF81FF0499038C03FF849
-EB807F49903800FFFC495A495AA2495AA2EE7FF8495AEE3FF0EE0FC093C7FCAEB712E0A5
-26007FF8C8FCB3B3A7007FB512FEA52E547CD329>I<DA3FFF14FF0103B5D8F00713C001
-0FDAFC1F13E0013FECFF7F90267FFC0F9038FF9FF09026FFE001EBF83F48496C13E04849
-90387FF01F4890C7D83FF813E0489338FC0FC0F0078048486E6CC7FCA2003F82A9001F5E
-A26C6C4A5AA26C5E6C6D495A6C6D495A6C6D485BDAFC0F5B4890B6C8FCD803EF14FC01C3
-14F02607C03F90C9FC91CBFCA2120FA37FA213F813FE90B7FC6C16F817FF18C06C836C83
-6C836D828448B9FC12074848C700031480D81FF8EC003F4848150748486F13C083485A83
-A56D5D007F18806D5D003F18006C6C4B5AD80FFEED1FFC6C6C6CEC7FF86C01E049485A6C
-01FE011F5B6C6CB71280010F03FCC7FC010115E0D9000F01FCC8FC3C4F7CB543>I<EB3F
-F0B5FCA51203C6FCB3A4EE1FFC93B512C0030314F0030F8092391FE07FFC92393F001FFE
-037C8003F07FDAF1E081ECF3C0DAF7807F8502FFC7FC5CA25CA45CB3ACB6D8F807B612C0
-A542537BD24B>I<137F497E000313E0487FA2487FA76C5BA26C5BC613806DC7FC90C8FC
-ADEB3FF0B5FCA512017EB3B3A6B612E0A51B547BD325>I<EB3FF0B5FCA51203C6FCB3A5
-4CB512F8A59339003FFE00EF1FF0EF3FC04D5A4DC7FCEE03FEEE07F84C5A4C5AEE7FC04C
-C8FC4B5A4B5AED0FF8ED1FE04B7E4B7EECF1FF02F37F02F77F91B6FC83159F030F7F02FE
-80DAF8077F4A7E6F7F6F7F83707E82707F84707F707F82707F84707F177F717E4D13C0B6
-D8F003B6FCA540537CD247>107 D<EB3FF0B5FCA512017EB3B3B3B1B612F0A51C537BD2
-25>I<D93FF0D91FFCEDFFE0B591B500C0010713FE030302F0011F6D7E030F6E017F8092
-271FE07FFCD9FF037F922A3F001FFE01F8007F0003027C9126FF03E080C602F06DD90780
-137FDAF1E0038FC77FDAF3C0159EDAF7806D01BC143F07FC8102FFC75C4A5EA24A5EA44A
-5EB3ACB6D8F807B6D8C03FB512FEA567367BB570>I<D93FF0EB1FFCB591B512C0030314
-F0030F8092391FE07FFC92393F001FFE0003027C80C602F07FDAF1E081ECF3C0DAF7807F
-8502FFC7FC5CA25CA45CB3ACB6D8F807B612C0A542367BB54B>I<913801FFE0021F13FE
-91B612C0010315F0010F9038807FFC903A1FFC000FFED97FF86D6C7E49486D7F48496D7F
-48496D7F4A147F48834890C86C7EA24883A248486F7EA3007F1880A400FF18C0AC007F18
-80A3003F18006D5DA26C5FA26C5F6E147F6C5F6C6D4A5A6C6D495B6C6D495B6D6C495BD9
-3FFE011F90C7FC903A0FFF807FFC6D90B55A010015C0023F91C8FC020113E03A387CB643
->I<903A3FF001FFE0B5010F13FE033FEBFFC092B612F002F301017F913AF7F8007FFE00
-03D9FFE0EB1FFFC602806D7F92C76C7F4A824A6E7F4A6E7FA2717FA285187F85A4721380
-AC1A0060A36118FFA2615F616E4A5BA26E4A5B6E4A5B6F495B6F4990C7FC03F0EBFFFC91
-26FBFE075B02F8B612E06F1480031F01FCC8FC030313C092CBFCB1B612F8A5414D7BB54B
->I<90397FE003FEB590380FFF80033F13E04B13F09238FE1FF89139E1F83FFC0003D9E3
-E013FEC6ECC07FECE78014EF150014EE02FEEB3FFC5CEE1FF8EE0FF04A90C7FCA55CB3AA
-B612FCA52F367CB537>114 D<903903FFF00F013FEBFE1F90B7FC120348EB003FD80FF8
-1307D81FE0130148487F4980127F90C87EA24881A27FA27F01F091C7FC13FCEBFFC06C13
-FF15F86C14FF16C06C15F06C816C816C81C681013F1580010F15C01300020714E0EC003F
-030713F015010078EC007F00F8153F161F7E160FA27E17E07E6D141F17C07F6DEC3F8001
-F8EC7F0001FEEB01FE9039FFC00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7FC2C38
-7CB635>I<143EA6147EA414FEA21301A313031307A2130F131F133F13FF5A000F90B6FC
-B8FCA426003FFEC8FCB3A9EE07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6DEBF0FC
-6DEBFFF86D6C5B021F5B020313802A4D7ECB34>I<D93FF8913801FFC0B50207B5FCA500
-03ED001FC61607B3AE5FA35FA2017F5D173B177B6D6C14F3DC01E313F06D6CD907C3EBFF
-C0903A0FFFC03F836D90B51203010114FE6D6C13F8020701E091C7FC42377BB54B>I<B6
-00F00107B5FCA5000101F8C8EA7FE06C6DED3F00A2017F163E6E157E013F167C6E15FC6D
-5E6F13016D5E8117036D5E6F13076D5E6F130F6D5E6F131F6D93C7FC815F6E6C133E177E
-023F147C6F13FC6E5C16816E5C16C3A26EEBE3E016E76E5C16FF6E5CA26E91C8FCA26F5A
-A36F5AA26F5AA26F5AA26F5A6F5A40367DB447>I<B6D8E07FB5D8C003B512C0A5000101
-F0C701F0C7381FF8006E027FED07E06C715DA26E023F150F017F705DA26E181F013F4B6C
-92C7FC6E606D70143E94B5FC6F177E6D4A6E137C03C001F315FC6D715B160303E001E114
-016D020702E05B03F013C06D71485A160F03F8D9807F13076D05F85B93381F003F03FC16
-0F027F4902FC5BDBFE3E011F131F023F04FE90C8FC167EDBFF7C010F5B6E01FCECFF3E4C
-6D137E6E5FA24C7F6E5F4C7F6E5FA24C7F6E5F4C147FA26E5F93C8123F6F5EA2033E6FC9
-FC5A367DB461>I<007FB500F090387FFFFEA5C66C48C7000F90C7FC6D6CEC07F86D6D5C
-6D6D495A6D4B5A6F495A6D6D91C8FC6D6D137E6D6D5B91387FFE014C5A6E6C485A6EEB8F
-E06EEBCFC06EEBFF806E91C9FCA26E5B6E5B6F7E6F7EA26F7F834B7F4B7F92B5FCDA01FD
-7F03F87F4A486C7E4A486C7E020F7FDA1FC0804A486C7F4A486C7F02FE6D7F4A6D7F495A
-49486D7F01076F7E49486E7E49486E7FEBFFF0B500FE49B612C0A542357EB447>I<B600
-F00107B5FCA5C601F8C8EA7FE06EED3F00A26D6C153E187E013F167C6E15FC6D5E6F1301
-6D5E6F13036D5E8117076D6D5C170F6D6D5C171F6D93C7FC6F5B027F143E6F137E023F14
-7C6F13FCA26E6D5A16816EEBC1F016C36E5C16E76E5C16FF6E5CA26E91C8FCA36F5AA26F
-5AA26F5AA26F5AA26F5AA35E150F5E151F93C9FC5DD81FC0133E486C137E486C137C486C
-13FC5D14015D14034A5A6C48485A49485A263FC07FCAFCEB81FE6CB45A6C13F000035BC6
-90CBFC404D7DB447>I<001FB8FC1880A3912680007F130001FCC7B5FC01F0495B495D49
-495B495B4B5B48C75C5D4B5B5F003E4A90C7FC92B5FC4A5B5E4A5B5CC7485B5E4A5B5C4A
-5B93C8FC91B5FC495B5D4949EB0F805B495B5D495B49151F4949140092C7FC495A485E48
-5B5C485E485B4A5C48495B4815074849495A91C712FFB8FCA37E31357CB43C>I
-E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Ff cmtt10 10.95 93
-/Ff 93 127 df<121C127FEAFF80B3EA7F00B2123EC7FCA8121C127FA2EAFF80A3EA7F00
+%DVIPSBitmapFont: Fe cmtt10 10.95 93
+/Fe 93 127 df<121C127FEAFF80B3EA7F00B2123EC7FCA8121C127FA2EAFF80A3EA7F00
 A2121C09396DB830>33 D<00101304007C131F00FEEB3F80A26C137FA248133FB2007E14
 00007C7F003C131E00101304191C75B830>I<903907C007C0A2496C487EA8011F131FA2
 02C05BA3007FB7FCA2B81280A36C16006C5D3A007F807F80A2020090C7FCA9495BA2003F
@@ -882,290 +627,572 @@ FC90C7EA0FF8ED1FF0ED3FE0ED7FC0EDFF80003E491300C7485A4A5A4A5A4A5A4A5A4A5A
 3848B4137C48EB80FE4813C14813C348EBEFFC397FEFFFF0D8FF8713E0010713C0486C13
 80D87C0113003838007C1F0C78B730>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fg cmbx12 20.74 21
-/Fg 21 121 df<EE01F0EE07F8160F163F167FED01FF150F153F4AB5FC143F010FB6FCB8
-FCA54A7E14C0EBF000C8FCB3B3B3B3AE007FBA12F0A8447171F061>49
-D<92380FFFE04AB67E020F15F0027F15FE49B87E4917E0010F17F8013F8349D9C01F14FF
-9027FFFC0001814801E06D6C80480180021F804890C86C8048486F8048486F8001FF6F80
-4801C06E8002F081486D18806E816E18C0B5821BE06E81A37214F0A56C5BA36C5B6C5B6C
-5B000313C0C690C9FC90CA15E060A34E14C0A21B80601B0060626295B55A5F624D5C624D
-5C4D91C7FC614D5B4D13F04D5B6194B55A4C49C8FC4C5B4C5B4C13E04C5B604C90C9FCEE
-7FFC4C5A4B5B4B5B4B0180EC0FF04B90C8FC4B5A4B5A4B48ED1FE0EDFFE04A5B4A5B4A90
-C9FC4A48163F4A5ADA3FF017C05D4A48167F4A5A4990CA12FFD903FC160749BAFC5B4919
-805B5B90BBFC5A5A5A5A481A005A5ABCFCA462A44C7176F061>I<923801FFFE033FEBFF
-F84AB7FC020F16E0023F16F84A16FE49B97E49DA003F80010F01F0010714F04901800101
-804948C880D97FF86F7F02E081496C834801FC6F148014FF486E6E14C08181481AE081A9
-6C5C1BC06C4A5C6C5C6D90C815806D5AD90FF85D90CA150062606295B55A4D5C624D5C4D
-5C4D91C7FC4D13FC4D5B4CB512E0047F1480037FB548C8FC92B612F818C018F8F0FF806F
-15F092C7003F13FC050713FF050114C071807213F8727F727F867214801BC07214E01BF0
-A27214F81BFCA37214FEA31BFFEBFF80000313E0487F001F13FC487FA2487FA2B67EA31B
-FEA3601BFCA292C8FC6C1AF84A5D4A18F06C494B14E05C6C01C04B14C06C90C915804E14
-006C6D4B5B6C01F092B55A6C01FC4A5C27007FFFC001075C6D01FE013F14C0010F90B85A
-6D4DC7FC010117F8D9003F16E0020F93C8FC020015F0030749C9FC507378F061>I<F10F
-F04F7E193FA2197F19FF60A260606060A2606095B5FCA25F5F5FA25F5F5F5F18BFEFFF3F
-5EEE03FE17FCEE07F8160FEE1FF0EE3FE017C0167FEEFF804B13005E4B5A15074B5A4B5A
-5E153F4B5A4B5A93C7FC4A5A14034A5A5D4A5A141F4A5A4A5A5D4AC8FC5B495A5C495A13
-0F495A495A5C137F495A4890C9FC5B485A1207485A485A5B123F485A485A90BC12FCA8CB
-02F8C7FCB3A20307B912FCA856727BF161>I<0170187001FEEF01F86D6C160F02F8167F
-DAFF80EC07FF03FE49B5FC92B85A6262A26297C7FC61616119E061614EC8FC18F86018C0
-95C9FC17F817C0020701F8CAFC91CDFCB0923801FFFC031FEBFFE092B612FC020315FF02
-0F16C04A16F0027FD9003F7FDAFFF0010F13FE038001037F4AC76C8002F86E804A6F7F4A
-6F7F4A834A6F7F91C980137E017C707F90CAFC1B80A21BC0A2841BE0A51BF0A313FE3803
-FF80000F7F4813F0487F5A80B5FCA41BE0A44E14C05C7E4A18805C4A5D6C90C9150001E0
-606C6C5E6D606C6C4C5B7F000794B55A6C6C6C4A5C6C6D4A5C6E4A5C26007FF8021F49C7
-FC6DB4027F5B6DD9F007B55A6D90B712E0010317806D4CC8FC6D6C15F8021F15C002034A
-C9FCDA003F13804C7376F061>I<94381FFF800403B512F8043F14FE4BB77E030782031F
-16F0037F8292B5D8FC017F02039139C0001FFE4A49C7EA07FF021F01F8804A496E13804A
-01C0140F91B548023F13C04991C85A494992B5FC49494A14E0495B495E5D5B495BA290B5
-5A5A5D487114C0A24891C91480731300735A48F00FF896C8FC485BA45AA44849903803FF
-E0041F13FE047FEBFFC04BB612F84B81030F15FFB590261FF8038092273FE0007F13E004
-80011F7F4BC76C7F03FE6E7F4B6E7FDAFDF86E7FDAFFF017804B6E14C01BE05D7313F05D
-1BF8A292C914FC85A21BFE5CA31BFFA26C5BA87EA4807EA21BFE7EA37E1BFC6E5E6C1AF8
-A27E6F17F06C95B512E06D7F1BC06D6D4A14806D4C1400816D6D4A5B6D6D4A5B6D01FF4A
-13F001006E017F5B6ED9F007B55A6E90B7C7FC020F5E020316F86E16E0DA003F15800307
-02FCC8FCDB007F1380507378F061>I<EA03FCA2487E7F14C0ECFFF092BA12C0A45AA31C
-801C0063A2486263636363A26398C7FC48616249CAEA0FF801F0171F494D5A4F5A49604F
-5A007F4D90C8FC60494C5A4E5A614E5A4E5A48CA127F4E5A4D5B96C9FCCA485A4D5A170F
-4D5A60173F4D5A6017FF4C5BA25E4C90CAFCA24C5A161FA24C5AA2167FA24C5AA25DA24B
-5BA25DA25DA25F5DA25DA35DA392B5FCA25FA25CA45CA75CAD6E5CA26E91CBFCA26E5BED
-3FF8ED0FE0527775F461>I<93B57E031F14FC92B77E020316F0020F16FC023F16FF4A83
-49B5D8800314E04901F8C7003F7F4901C0020F7F4990C800037FD91FFC6F7F49486F6C7E
-137F4A7013804948827313C05A4A821BE05AA285487FA38080806E5E8003C017C08103F8
-5D03FE17806F6C5C6C6F160004F05C04FC4A5A6C6F5D706C13FFDDE0015B6CDCF8035BDD
-FC0F13C06DDBFF1F5B6D93B5C7FC19FC6D17F06D5F6D17806D17E06D836D6C16FC6E16FF
-020F836E17E06E83020F83023F8391B97E4984010701F0178049D9C07F16C0013FD9801F
-16E049EB00074948010116F048497F4849023F15F84849140F4A6E15FC48160148496E6C
-14FE4A151F488391C9120348050014FF193F49838500FF84854983A28586A3861BFEA27F
-A2007F1AFC7F1A7F1BF86C7FF2FFF06C7F6E4C13E06C6D4C13C06C6D5E6E4C13806C6D4C
-13006C6D6CED7FFE6C02E04A485A013F01FC020F13F06D9026FFC001B55A010791B71280
-6D95C7FC010017FC021F16F002071680DA007F02FCC8FC030191C9FC507378F061>I<F1
-03F84F7E4F7EA24F7EA34F7FA24F7FA396B57EA24E80A34E80A24E80A34E80A24E80A34E
-81A24E81A219BFDEFF9F80191F4D6D80A218FE05036D8018FC05076D80A218F8050F6D80
-18F0051F6D80A260053F6E8060057F6E80A26005FF6E8095C7FC4C6F80A25F04036F805F
-04076F80A25F040F6F805F041F6F80A25F043F70805F047F7080A25F04FF708094C9FC4B
-7180A25E030371805E4BBB7EA34B86A24B86A3DB3FE0CA6C805E037F7280A25E03FF7280
-A24A90CB6C80A25D02037380A24A487280A25D020F7380A24B84021F885D023F7480A24B
-85027F895D902607FFFC7380B86C031FB912E0A8837979F892>65
-D<BDFC1CFEF4FFC01DF81DFF1EC01EF08AC7003F49C9000F14FE090180756C800A1F8076
-80768076807680A27680A2777FA2208089A320C0A289A565A32080A3531400A29AB55AA2
-525C6764525C525C525C525C5249C7FC51B55A090714F0093F14C00807B6C8FC93BA12F8
-1DC0651DFCF5FF801EF04CCA14FC0A3F13FF0A0F800A0314E076807614FC777F777F2080
-897714C020E0A27714F0A220F88920FCA47714FEA96520FCA45314F8A26520F06520E053
-14C0659AB61280521500525C1C0F5214F899B65A09075DC05A9CC7FC1EFC1EF01EC053C8
-FC1DE00AF8C9FC777679F58A>I<96267FFFE01670063FB6ED01F80503B700F01403053F
-04FC14074CB96C130F040706E0131F043F72133F93BA00FC137F0303DC00076D13FF030F
-03C09039003FFF814B02FCC8000713C3037F02E0030113F792B600806F6CB5FC02034ACA
-121F4A02F8834A02E0834A4A1701027F4A8391B548CC7E494A85495C4C854988494A8549
-4A85495C8A4991CDFC90B54886A2484A1B7FA2481E3F5D481E1F5D5A1F0FA2485CA3481E
-075DA2F703F0489BC7FCA45DA2B6FCB27EA281A47EA2F703F06FF307F87EA36C80A21F0F
-7E6F1CF07E6F1B1F7E20E06C6E1B3F816DF57FC06D80F7FF806D806D6E4F13006D6E616D
-525A826D6E4F5A6D6E4F5A6E6D6C4E5A021F6EF0FFE06E6E4D5B6E02F84D5B6E02FE050F
-90C7FC02006E6CEE3FFE6F02F0EEFFFC031F02FE03035B6FDAFFC0021F13E0030303FF01
-03B55A030093B7C8FC043F18FC040718F0040118C0DC003F94C9FC050316F8DD003F1580
-DE007F01F0CAFC757A75F78C>I<92383FFFF80207B612E0027F15FC49B87E010717E001
-1F83499026F0007F13FC4948C7000F7F90B502036D7E486E6D806F6D80727F486E6E7F84
-86727FA28684A26C5C72806C5C6D90C8FC6D5AEB0FF8EB03E090CAFCA70507B6FC041FB7
-FC0303B8FC157F0203B9FC021FECFE0391B612800103ECF800010F14C04991C7FC017F13
-FC90B512F04814C0485C4891C8FC485B5A485B5C5A5CA2B5FC5CA360A36E5DA26C5F6E5D
-187E6C6D846E4A48806C6D4A4814FC6C6ED90FF0ECFFFC6C02E090263FE07F14FE000191
-39FC03FFC06C91B6487E013F4B487E010F4B1307010303F01301D9003F0280D9003F13FC
-020101F8CBFC57507ACE5E>97 D<97380FFFE00607B6FCA8F00003190086B3AD93383FFF
-800307B512F8033F14FF4AB712C0020716F0021F16FC027F9039FE007FFE91B500F0EB0F
-FF01030280010190B5FC4949C87E49498149498149498149498190B548814884484A8192
-CAFC5AA2485BA25A5C5AA35A5CA4B5FCAF7EA4807EA37EA2807EA26C7F616C6E5D6C606C
-80616D6D5D6D6D5D6D6D92B67E6D6D4A15FC010301FF0207EDFFFE6D02C0EB3FFE6D6C90
-39FC01FFF86E90B65A020F16C002031600DA007F14FC030F14E09226007FFEC749C7FC5F
-797AF76C>100 D<93387FFF80030FB512FC037FECFF804AB712E0020716F8021F16FE02
-7FD9F8077F49B5D8C000804991C7003F13E04901FC020F7F49496E7F49498049496E7F49
-496E7F90B55A48727E92C914804884485B1BC048841BE0485BA27313F05AA25C5AA21BF8
-85A2B5FCA391BAFCA41BF002F8CCFCA67EA3807EA47E806CF103F0F207F86C7F1A0F6C6E
-17F06C191F6F17E06C6E163F6D6DEE7FC06D6D16FF6D6D4B13806D6D4B13006D6D6CEC0F
-FE6D02E0EC3FFC6D02F8ECFFF86D9126FFC00F5B023F91B65A020F178002034CC7FC0200
-16F8031F15E0030392C8FCDB000F13E04D507BCE58>I<903801FFFCB6FCA8C67E131F7F
-B3AD95380FFFE095B512FE05036E7E050F15E0053F15F84D81932701FFF01F7F4CD90007
-7FDC07FC6D80DC0FF06D80DC1FC07F4C48824CC8FC047E6F7F5EEDFDF85E03FF707F5EA2
-5EA25EA293C9FCA45DB3B3A6B8D8E003B81280A8617879F76C>104
-D<EB01FCEB07FF011F13C0497F497F90B57EA24880A24880A76C5CA26C5CA26D5B6D5B6D
-5B010790C8FCEB01FC90CAFCB2903801FFFC007FB5FCA8C67E131F7FB3B3B3A5B81280A8
-297979F835>I<902601FFF891380FFFE0B692B512FE05036E7E050F15E0053F15F84D81
-932701FFF01F7F4CD900077FDC07FC6D80C66CDA0FF06D80011FDA1FC07F6D4A48824CC8
-FC047E6F7F5EEDF9F85E03FB707F5E15FF5EA25EA293C9FCA45DB3B3A6B8D8E003B81280
-A8614E79CD6C>110 D<902601FFFCEC7FFEB6020FB512F0057F14FE4CB712C0040716F0
-041F82047F16FE93B5C66C7F92B500F0010F14C0C66C0380010380011F4AC76C806D4A6E
-8004F06F7F4C6F7F4C6F7F4C8193C915804B7014C0861DE0A27414F0A27414F8A47513FC
-A57513FEAF5113FCA598B512F8A31DF0621DE0621DC0621D806F5E701800704B5B505B70
-4B5B7092B55A04FC4A5C704A5C706C010F5C05E0013F49C7FC9227FE7FFC01B55A70B712
-F0040F16C0040393C8FC040015F8053F14C0050301F0C9FC94CCFCB3A6B812E0A85F6F7A
-CD6C>112 D<902601FFF8EB07FEB691383FFFC094B512F00403804C14FE4C8093261FFC
-3F138093263FE07F13C0DC7F80B5FCC66C5D011FDAFE0114E06DEBF9FC16F815FB16F016
-E015FF16C07114C05E72138095381FFE0093C76C5AF001E095C8FCA25DA65DB3B3A2B812
-F8A8434E7ACD4F>114 D<15FFA75CA55CA45CA25CA25CA25CA25C91B5FCA25B5B5B131F
-5B90B9FC120FBAFCA6D8000791C9FCB3B3A3F01FE0AE183F7014C07F187F7014806D16FF
-826D4B13006E6D485AEEFE0F6E90B55A020F5D6E5D020115C06E6C5C031F49C7FC030113
-F03B6E7CEC4B>116 D<007FB7023FB612F0A8D8000302C0020191C7FC6D6E9138007FF0
-705E6D4E5A6E6D4A5B6E6D4A90C8FC6E6D5C704A5A6E4C5A6E6E5C6E6E495A6E6E495A71
-13FF6E6E485B6F4A5B6F6D4890C9FC6F01FE5B71485A6FEC9FF86F14BF6FECFFF06F5D61
-6F5D7091CAFC705B828470808270807080854C805E4C80854C804C81EE7FE7DCFFE3804B
-01C1804B0180804D804B487F4B486D7F031F6E7F4B486D7F4B48824B487F4C6D804A496D
-804A90C8804A844A48814A486F7F4A486F7F4B6F7F4A48844A486F80010F01F881B76C91
-B712FEA85F4D7DCC66>120 D E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fh cmsl10 10.95 36
-/Fh 36 91 df<007FB5FCA2B512FEA418067C961E>45 D<121EEA3F80EA7FC012FFA413
-80EA7F00123C0A0A788919>I<1703EF0780170FA2EF1F00A2173EA25FA25FA24C5AA24C
-5AA24C5AA24C5AA24CC7FCA2163E167E167C5EA24B5AA24B5AA24B5AA24B5AA24BC8FCA2
-153EA25DA25DA24A5AA24A5AA24A5AA24A5AA24AC9FCA2143EA25CA25CA2495AA2495AA2
-495AA2495A131F91CAFC133EA25BA25BA2485AA2485AA2485AA2485AA248CBFCA2123EA2
-5AA25AA21270315B7FC32D>I<157015F014011407143F903803FFE0137FEBFFCFEBF80F
-1300141F15C0A5143F1580A5147F1500A55C5CA513015CA513035CA513075CA5130F5CA3
-131F497EB612F8A31D3D78BC2D>49 D<EC01FE91380FFFE0023F13F89138FC07FC903901
-E001FE903907C000FF49C7EA7F80011E15C0163F4915E05B0170141F13FF80A35A163FA2
-6C90C7FC137E0118EC7FC090C8FCEEFF80A24B1300A24B5A5E4B5A4B5A4B5A5E4B5A4BC7
-FC15FEEC01F84A5A4A5A4A5A4AC8FC143E5C5CEB01E04948130E49485B49C7FC131E495C
-13705B48485C484814F0000FB6FC5A485D5AB7FC5EA22B3D7CBC2D>I<EC07FC91383FFF
-809138F80FE0903903C007F09039078003FC90380F0001011C14FE013C14FF137F1480EB
-FFC0A31480A291380003FE137E90C7FCED07FC16F8150F16F0ED1FE016C0ED3F80ED7E00
-5DEC07F0903803FF8015F090380001FC6E7EED7F80ED3FC0A2ED1FE016F0A316F8A4120E
-EA3F80486C133F16F012FFA216E0157F5B48C7EAFFC000F01580007049130012786C495A
-003EEB07F86C495A390FE03FE00003B51280C649C7FCEB1FE0283F7ABC2D>I<161C163C
-167CA216FCED01F815031507150FA2151DED3BF0157315E315C31401EC038391380707E0
-140E141CA2143814709138E00FC0EB01C014801303EB0700130E49EB1F805B133013705B
-485A4848EB3F0090C7FC5A120E5A5A48147E1260B8FCA3C73801FE00A25DA41403A25DA3
-14074A7E0107B512F8A3283E7BBD2D>I<01061403D90780131F90390FF801FE91B512FC
-16F816F016E0168049EBFE0015F890381C7FC091C8FCA3133C1338A513781370A2EC1FE0
-ECFFF8903873E03E9038FF001F01FCEB0F804914C049EB07E04914F049130390C7FC16F8
-A61507A21206EA3F80487EA2150F00FF15F0A24914E090C7121F00FC15C000F0143F0070
-1580ED7F0012786C14FE4A5A6C495A390F800FE03907E03FC06CB5C7FCC613FCEB1FE028
-3F7ABC2D>I<ED7F80913803FFE091380FC0F091383E003802FC131C495A494813FE9038
-07E003EB0FC090381F8007133FD97F0013FC01FE1303ED01F0484890C7FC1203A2485AA2
-120F5BA2001FEB3F809038E0FFE0393FE3C0F89038E7007C01EE7F01FC133F4848EB1F80
-A24914C05B16E0A2485AA216F05BA2ED3FE0A290C7FCA4157F16C0A316804814FF007E15
-00007F5C14016C5C4A5A6C6C485A4A5A6C6C485A2607E07FC7FC3803FFFEC613F8EB3FC0
-273F78BC2D>I<EA0380120713E090B712805AA217005E485D5E001EC85A484A5A00385D
-150300784A5A00704AC7FC151E5D485CC8127015F04A5A4A5A4A5A4AC8FC140E141E5C14
-7C14785C1301495AA213075C130F495AA2133F91C9FC5BA25B5B1201A312035BA21207A3
-485AA5121F5BA26C5AEA0780294074BD2D>I<EC03FC91381FFF8091387C07E0903901F0
-01F0903903C000F84948137C49C7123E131E013E141F133C137C137813F8A3163F486C14
-3E167E6D147C6C6C14FC6E13F89138C001F09138F003E090397FF807C09138FC0F009038
-3FFF3E6D13F86D13E06D7F01017F8101077F90391F1FFF80D93E0F13C0EBF8072601F001
-13E048486C13F04848137F4848131F001FEC0FF890C71207003E1403A2481401A300FC15
-F05AA3ED03E0A26CEC07C0007C1580007E140F003EEC1F00003F143E6C6C5B6C6C485A39
-07F00FE00001B512806C6C48C7FCEB0FF0283F7ABC2D>I<EC07F8EC3FFE9138FC0F8090
-3901F007C0903907E003E0D90FC013F090381F8001013F14F8EB7F004914FC48481300A2
-4848EB01FEA21207A3485AA41503121F5BA31507A2000F15FC150FA2151F1207153F0003
-15F86C6C137F000014EF90387C01CF90393E078FF090380FFE1FEB03F890C713E0A2ED3F
-C0A3ED7F8016005D003F5C487E4A5A00FF495A5D4A5A49485A48495A007049C7FC007813
-7E383E03FC381FFFF06C13C0D801FEC8FC273F79BC2D>I<17E016011603831607A2160F
-A2161F83163FA2167F167716F7EEE7FCED01E316C3150316831507EE03FEED0F01150E15
-1E151C153C03387FED7800157015F05D4A4880177F4A5AA24AC7FCA2020E81173F5C021F
-B6FC5CA20270C7EA3FE0171F5CA2495AA2494881170F49C8FCA2130EA24982013C1507A2
-137CD801FE4B7E2607FF80EC3FFEB500F00107B512FC19F85E3E417DC044>65
-D<013FB7FC18E018FC903B007FE00007FE6E48903801FF809438007FC05DF03FE0F01FF0
-A3027F16F892C8FCA54A16F04A153F19E0187F19C0F0FF8001014B13004A4A5A4D5AEF1F
-F04D5ADC03FFC7FC49B612F8EFFF8002F8C7EA3FE0EF0FF0EF07FC717E010715014A8171
-1380A319C0130F5CA5011F4B13805C19005F601707013F4B5A4A4A5A4D5A4D5A017F9138
-01FF8001FF020F90C7FCB812FC17F094C8FC3D3E7DBD40>I<DCFFC01338030F01F01378
-037F01FC13F0913A01FF803F01913A07FC000781DA1FE0EB03C3DA7FC0EB01E74AC812FF
-4948ED7FE0D907FC153F495A4948151F495A4948150F494816C018074890C9FC485AA248
-5A000F1880491603121FA248481607A295C7FC485AA412FF5BA75BA2181C183C1838A27F
-007F1778187018F0003F5F6D150160001F16036C6C4B5A95C7FC6C6C5D6C6C151E6C6C5D
-6C6C15F86D6C495A6D6CEB07C0D91FF0EB1F80D907FE01FEC8FC0101B512F86D6C13E0DA
-07FEC9FC3D4276BF42>I<013FB7FC18E018F8903B007FF0000FFE6E48EB01FF9438007F
-C04B6E7E180F85727E727E147F4B6E7EA2727EA302FF178092C9FCA54918C05CA41A8013
-034A5DA41A0013074A5DA261A24E5A130F4A5E180F61181F61011F4C5A5C4E5A4EC7FC4D
-5A4D5A013F4B5A4A4A5AEF3FE0EF7F80017F4A48C8FC01FFEC1FFCB812F0178004FCC9FC
-423E7DBD45>I<013FB812F8A39026007FF0C7127F6E48140F18034B14011800A3197814
-7F4B1570A502FF147092C7FCA3190017F0495D4A1301A21607161F91B6FC495DA29138FC
-003F160F1607160301075D5CA219E0180119C0010FEC07004A90C712031980A218071900
-011F5E5C181EA2183E183C013F167C4A15FC4D5A1707017F151F01FF4AB45AB9FCA2603D
-3E7DBD3E>I<013FB812E0A3903A007FF000016E48EB003F180F4B14071803A31801147F
-4B15C0A514FF92C71270A395C7FC17F0495D5C160116031607161F49B65AA39138FC003F
-160F160701075D4A1303A5010F4AC8FC5C93C9FCA4131F5CA5133F5CA3137FEBFFF0B612
-F8A33B3E7DBD3B>I<4BB46C1370031F01F013F0037F9038FC01E0913A03FF807E03913A
-0FF8000F83DA1FE0EB07C7DA7F80EB01EF4AC812FFD903FE16C04948157F4948153F495A
-4948151F495A4948168091C9120F5A485AA2485A000F18004982121FA248485EA295C7FC
-485AA412FF5BA6043FB512E05BA29339001FFC00715AA2607F127FA2171F123F6D5EA212
-1F7F000F163F6C7E6C6C4B5A7F6C6C15FF6C6DEB01EFD93FC0EB07C7D91FF0EB1F87D907
-FE9038FE03800101B5EAF8016D6C01E0C8FCDA07FEC9FC3C4276BF47>I<013FB5D8F807
-B6FC04F015FEA29026007FF0C7380FFE006E486E5AA24B5DA4180F147F4B5DA4181F14FF
-92C85BA4183F5B4A5EA491B8FC5B6102FCC8127FA318FF13074A93C7FCA45F130F4A5DA4
-1703131F4A5DA41707133F4A5DA3017F150F496C4A7EB6D8E01FB512FC6115C0483E7DBD
-44>I<011FB512FC5BA29039003FF8006E5AA25DA5143F5DA5147F5DA514FF92C7FCA55B
-5CA513035CA513075CA5130F5CA5131F5CA3133F497E007FB512F0A2B6FC263E7EBD21>
-I<013FB500F8010FB5FC4C5BA29026007FF0C7000313E06E486E130019FC4B15F04E5A4E
-5A4E5A061EC7FC027F5D4B5C4D5A4D5AEF07804DC8FC02FF141E92C7127C5FEE01E04C5A
-4C5A49021FC9FC4A5B5E4C7E5D03077F01035B9139FC1F3FE0153C4B6C7E15F09139FFE0
-0FF84913C092380007FC5C4A6D7E5C707E130F4A6D7F84177F717EA2011F6F7E5C717EA2
-717EA2013F6F7E5C84A2017F83496C4A13E0B600E0017F13FFA24B90B6FC483E7DBD47>
-75 D<013FB512FEA25E9026007FF8C8FCEC3FE0A25DA5147F5DA514FF92C9FCA55B5CA5
-13035CA513075CA21838A21870130F5CA218E0A3011F15014A15C01703A21707EF0F8001
-3F151F4A143F177FEFFF00017F140301FF143FB9FC5FA2353E7DBD39>I<90263FFFF093
-381FFFF85013F0629026007FF8EFF000023F4D5AA2023B933801DFC0A2DA39FCED039FA2
-F1073F14790271040E5BEC70FE191C19381A7F02F01670DAE07F94C7FC19E0A2F001C062
-01016D6C495A02C05FF00700A2180E6F6C14010103161C028003385BA218706F7EF0E003
-13070200DA01C05BA2923907F00380A294380700075B010E902603F80E5C5FA25F190F01
-1E6D6C5A011C605FA2EEFDC0DB00FF141F013C5D013860013C92C7FC017C5C01FE027E14
-3F2607FF80017C4A7EB500FC037FB512E004785E4A1338553E7CBD53>I<90263FFFE002
-3FB5FC6F16FEA29026003FF8020313C0021F030013004A6C157C023B163C6F1538143981
-0238167802787FDA707F157082153F82031F15F002F07FDAE00F5D821507820303140101
-0180DAC0015D82811780047F1303010315C04A013F5C17E0161F17F0040F1307010715F8
-91C7000791C7FC17FC160317FE04015B4915FF010E6E130E188E177F18CEEF3FDE011E16
-FE011C6F5AA2170FA21707133C01386F5A133C017C150113FE2607FF801400B512FC1870
-5C483E7DBD44>I<923803FF80031F13F09238FE01FE913903F0003FDA0FC0EB1FC0DA3F
-80EB07E0027EC76C7E49486E7E49488149486E7E4948157F495A013F17804948ED3FC049
-C9FCA24848EE1FE012035B000718F05B120FA2485A19F8123F5BA2127FA219F04848163F
-A5F07FE0A35BF0FFC0A219805F19007F4D5A127F4D5A60003F160F6D5E001F4C5A4D5A6C
-6C4B5A95C7FC6C6C15FE00034B5A6C6C4A5A6C6C4A5A017FEC1FC06D6C495AD90FE001FE
-C8FC903903F807F80100B512C0DA0FFCC9FC3D4276BF47>I<013FB612FEEFFFE018F890
-3B007FF0000FFC6E48EB01FF7113804BEC7FC0183F19E0F01FF0A2147F5D19F8A402FFED
-3FF092C8FCA219E0A2F07FC05B4AEDFF8019004D5A4D5AEF0FF80103ED3FE04A903801FF
-8091B648C7FC17F002FCCAFCA213075CA5130F5CA5131F5CA5133F5CA3137F497EB612E0
-A25D3D3E7DBD3E>I<013FB612F017FF18E0903B007FF0003FF86E48EB07FCEF01FE4B6D
-7EF07F8019C0183F19E0147F4B15F0A502FFED7FE092C8FCA219C0F0FF80A2494B13004A
-5D4D5AEF0FF04D5AEF7F800103DA07FEC7FC91B612F017809139FC0007E0EE03F8EE00FC
-0107814A147F717EA284A2130F5CA484011F157F5CA41902013F17075CA2F0F00F017F17
-0E496C143FB600E0011F131C94380FF83C4B01071378CA3801FFE09438003F8040407DBD
-43>82 D<9238FF80070207EBE00F021FEBF81E91387F00FE02FCEB1F3ED903F0EB0FFE49
-481307494813034AEB01FC49C7FC491400133E137E177C491578A57F1770A26D15008080
-80EB7FFEECFFE06D13FEEDFFC06D14F06D14FC010380010080143F02031480DA003F13C0
-15031500EE7FE0163F161FA2160F121CA31607160F003C16C0A31780003E151F1700007E
-5D007F153E6D5C16FC01E0495AD87DF0495AD8FCFCEB0FC03AF87F803F8027F01FFFFEC7
-FCD8E00713F839C0007FC030427BBF33>I<0007B912F0A33C0FFE000FF8003F01F0160F
-01C04A13034848160190C7FC121EF000E048141F5E1238A212781270153F5E5AA3C81600
-157F5EA515FF93C9FCA55C5DA514035DA514075DA5140F5DA3141FEC7FFC0003B7FCA33C
-3D76BC42>I<B600E090B512FC4B15F8A2000101C0C7000F13006C49EC03FCEF01F091C9
-FC60A317015A495EA417031203495EA4170712074993C7FCA45F120F49150EA4171E121F
-49151CA4173C123F491538A31778177017F05F001F15015F16036D4A5A000F93C8FC5E6C
-6C141E6C6C5C000115F86C6C495A017FEB07C090393FC03F8090260FFFFEC9FC010313F8
-9038007FC03E4073BD44>I<B6020FB5FC19FEA2000301E0020113E06C01809138007F80
-91C9EA7E006C173C18386E15781870017F16F0604D5A804D5A133F4DC7FCA26E140E171E
-011F151C173C17386E1478010F15705FA24C5A8001074A5AA24CC8FC5E6E130E0103141E
-161C163C16386E5B13015EA24B5A14FF6D495AA24BC9FC5D158EEC7F9E159C15B8A215F0
-143F5DA25DA26E5AA292CAFCA2140E404074BD44>I<B6017FB5D88007B512804A1A00A2
-000701C0010101E0C713F06C90C80180EC3FC06C48735A99C7FC057F150E1B1E6D191C6C
-1A3C1B3805FF15787214705E636EEB03BF017F4E5AEE073F505A040E7F051F4AC8FC161C
-6E170E013F143862167804706D5BEEF00F04E05D90381FE00104C015F003035E04801401
-06F85B9226070007130302F05F010F010E150797C9FC5D190E4BEB03FC616E5A01075F5D
-61DAF9C014FE05015BECFB8002FF6F5A7F92C75CA24A93CAFC835C606D5A605C604A1578
-1870594074BD5D>I<010FB500F090B512F85B5FD9003F902680003F1300DA0FFEC7EA1F
-F84BEC0FE00207168096C7FC6E6C141E181C6E6C143C606E6D5B4D5ADB7FC05B4D5A9238
-3FE0074DC8FC92381FF01E171C6F6C5A5F923807FCF0EEFDE06FB45A5F6F90C9FCA26F7F
-A2707EA216FF4B7FED03DF9238079FF0ED0F1F92380E0FF8151C92383C07FC15784B6C7E
-EC01E04B6C7EEC038002076D7F4AC7FC021E6E7E5C02386E7E5C02F06E7E495A49486E7E
-130749486E7E497E017F4B7E2603FFF091383FFF80007F01FC49B512FEB55CA2453E7EBD
-44>I<B66C0103B51280A3000101F0C8EBF0006C49ED7FC06D486FC7FC6E153E013F163C
-606D6C5D606D6C4A5A17036D6C4A5A95C8FC6E140E0103151E5F6D6C14385F6D6D13F04C
-5ADA7FC05B4C5AEDE007023F49C9FC161E91381FF01C5E91380FF8785E6E6C5AEDFDC015
-FF6E5B93CAFC6E5AA35DA21403A45DA21407A45DA2140FA4141F4A7E013FB512F0A3413E
-75BD44>I<010FB712FEA39239C00007FCD91FFCC7EA0FF814F04AEC1FF00280EC3FE091
-C8EA7FC0013EEDFF80A2013C4A13004C5A494A5A4C5A13704C5A4C5A494A5A4C5AA290C7
-4890C7FC4B5A4B5A4B5AA24B5A4B5A4B5A4B5AA24A90C8FC4A5A4A5A4A5AA24A5A4A5A4A
-48EB01C04A5AEF03804990C7FC495A495A494814071800495A49485C495A495A171E4890
-C8123E485A4848157E484815FE4C5A484814074848141F4848EB01FFB8FC5FA2373E7BBD
-38>I E
+%DVIPSBitmapFont: Ff cmbx12 14.4 62
+/Ff 62 123 df<922601FFFC903801FFE0033F9026FF801F13F84AB6D8E07F13FE020F03
+F9B6FC023FD9C00FB500C0138091277FFC0003D9FE0113C0902601FFE049495A49494949
+4813E04990C714F049484A13E0495A19C0495A7413C0017F17804A6E6E1380719138007E
+007192C7FCAEBCFCA526007FF8C7000301C0C8FCB3B3A7007FB5D8F803B612F0A553547D
+D34E>11 D<EEFFFC031FEBFF804AB612E0020781021F9038C00FF8913A7FFE0003FCDAFF
+F0EB00FE4949EB03FF4901805B4990C7487F49485CA2495A4D7F013F6F5B5CA37190C7FC
+715AEF01F894C9FCA90403B512C0BAFCA526003FFCC7120783B3B3A6003FB5D8FC03B612
+C0A542547DD34B>I<151E153E157E15FCEC01F8EC07F0EC0FE0EC1FC01580143FEC7F00
+14FE1301495A5C1307495AA2495A133F5C137FA2495AA24890C7FCA25A5BA21207A2485A
+A3121F5BA3123FA25BA3127FA55B12FFB3A3127F7FA5123FA37FA2121FA37F120FA36C7E
+A21203A27F7EA26C7FA26D7EA2133F80131F6D7EA26D7E1303806D7E1300147FEC3F8014
+1F15C0EC0FE0EC07F0EC01F8EC00FC157E153E151E1F7973D934>40
+D<127012F8127C127E7EEA1FC06C7E6C7E12037F6C7E6C7E7F6D7E133F806D7EA26D7E80
+130780A26D7EA26D7EA215807FA215C0A2EC7FE0A315F0143FA315F8A2141FA315FCA514
+0F15FEB3A315FC141FA515F8A3143FA215F0A3147F15E0A3ECFFC0A21580A25B1500A249
+5AA2495AA25C130F5C495AA2495A5C137F49C7FC5B485A485A5B1207485A485A48C8FC12
+7E127C5A12701F7979D934>I<B712F0AB240B7F9F2D>45 D<EA07F0487E487E487E487E
+B51280A76C13006C5A6C5A6C5A6C5A1111769025>I<EF01E01703EF07F0A2170FA2EF1F
+E0A218C0173FA2EF7F80A218005FA24C5AA25F1603A24C5AA25F160FA24C5AA25F163FA2
+4C5AA294C7FC5EA24B5AA25E1503A24B5AA25E150FA24B5AA25E153FA24B5AA293C8FC5D
+A24A5AA25D1403A25D1407A24A5AA25D141FA24A5AA25D147FA24AC9FCA25C1301A2495A
+A25C1307A2495AA25C131FA2495AA25C137FA249CAFCA25B1201A2485AA25B1207A2485A
+A25B121FA2485AA25B127FA248CBFCA25AA2127CA2347879D943>I<913803FFC0023F13
+FC91B6FC010315C0010F018113F0903A1FFC003FF849486D7E49486D7E49486D7E48496D
+138048496D13C0A24817E04890C813F0A34817F8A24817FC49157FA3007F17FEA600FF17
+FFB3A5007F17FEA6003F17FCA26D15FFA26C17F8A36C17F0A26C6D4913E0A26C6D4913C0
+6C17806E5B6C6D4913006D6C495AD91FFCEB3FF8903A0FFF81FFF06D90B55A01011580D9
+003F01FCC7FC020313C0384F7BCD43>I<157815FC14031407141F14FF130F0007B5FCB6
+FCA2147F13F0EAF800C7FCB3B3B3A6007FB712FEA52F4E76CD43>I<EC3FFE0103B512E0
+010F14FC013F14FF90B712C048D9C07F7F2703FE000F13F8D807F801037FD80FE06D7F48
+486D7F48488001F01680486C6E13C07F486C6E13E07FA27013F0A56C5AA26C5AEA0FF0EA
+03C0C914E05EA218C05E1880A24C13005F4C5A4B5B5F4B5B5F4B5B4B90C7FC4B5A5E4B5A
+ED7FE04B5A4A5B4A48C8FC4A5A5D4A48EB01F04A5AEC3F804AC7FC02FEEC03E0495A495A
+495A495AD91F80140749C8FC013E150F017FB7FC90B812C05A5A5A5A5A5A5AB9FC1880A4
+344E79CD43>I<91380FFFC091B512FC0107ECFF80011F15E090263FF8077F9026FF8001
+13FC4848C76C7ED803F86E7E491680D807FC8048B416C080486D15E0A4805CA36C17C06C
+5B6C90C75AD801FC1680C9FC4C13005FA24C5A4B5B4B5B4B13C04B5BDBFFFEC7FC91B512
+F816E016FCEEFF80DA000713E0030113F89238007FFE707E7013807013C018E07013F0A2
+18F8A27013FCA218FEA2EA03E0EA0FF8487E487E487EB57EA318FCA25E18F891C7FC6C17
+F0495C6C4816E001F04A13C06C484A1380D80FF84A13006CB44A5A6CD9F0075BC690B612
+F06D5D011F1580010302FCC7FCD9001F1380374F7ACD43>I<177C17FEA2160116031607
+160FA2161F163F167FA216FF5D5DA25D5DED1FBFED3F3F153E157C15FCEC01F815F0EC03
+E01407EC0FC01580EC1F005C147E147C5C1301495A495A5C495A131F49C7FC133E5B13FC
+485A5B485A1207485A485A90C8FC123E127E5ABA12C0A5C96C48C7FCAF020FB712C0A53A
+4F7CCE43>I<D80380150ED807E0157E01FEEC03FED9FFF0137F91B65A5F5F5F5F5F94C7
+FC5E5E16F016C093C8FC15F801E190C9FC01E0CAFCABEC0FFF027F13F001E3B512FE01E7
+6E7E9026FFF8077FDAC0017F49C713F8496E7E49143F4981496E7E6C481680C9FC18C082
+18E0A418F0A3EA0FE0487E487E487E487EA418E0A35B6C484A13C05B491680003EC85A00
+3F17006C6C4A5A6D5D6C6C4A5AD807F8495BD803FE01075B2701FFC03F5B6C90B65A013F
+4AC7FC6D14F8010314C09026007FF8C8FC344F79CD43>I<ED0FFF92B512E0020780021F
+14FC91397FFE03FE903A01FFF0007F4901C0EB3F804990C7121F4948EC7FC0494814FF49
+484913E049485B01FF5C485BA2485B5AA2486F13C04A6D1380486F1300177E94C7FC5AA2
+91CAFC5AA21508913801FFF8020713FFB54814C04A14F04AC66C7E023C6D7E4A6D7E4A6D
+7E7013804A15C0A24A15E07013F05C18F8A491C714FCA37EA67EA46C17F880A27E18F06C
+5D18E06C6D15C07E6E4913806C6D15006D6C495A6D6CEB7FFC6DB448485A6D90B55A0103
+15C0010092C7FC023F13FC020713C0364F7ACD43>I<121F7F7FEBFF8091B81280A45A19
+00606060A2606060485F0180C86CC7FC007EC95A4C5A007C4B5A5F4C5A160F4C5A484B5A
+4C5A94C8FC16FEC812014B5A5E4B5A150F4B5AA24B5AA24B5A15FFA24A90C9FCA25C5D14
+07A2140FA25D141FA2143FA4147F5DA314FFA55BAC6D5BA2EC3FC06E5A395279D043>I<
+913807FFC0027F13FC0103B67E010F15E090261FFC0113F8903A3FE0003FFCD97F80EB0F
+FE49C76C7E48488048486E1380000717C04980120F18E0177FA2121F7FA27F7F6E14FF02
+E015C014F802FE4913806C7FDBC00313009238F007FE6C02F85B9238FE1FF86C9138FFBF
+F06CEDFFE017806C4BC7FC6D806D81010F15E06D81010115FC010781011F81491680EBFF
+E748018115C048D9007F14E04848011F14F048487F48481303030014F8484880161F4848
+020713FC1601824848157F173FA2171FA2170FA218F8A27F007F17F06D151FA26C6CED3F
+E0001F17C06D157F6C6CEDFF806C6C6C010313006C01E0EB0FFE6C01FCEBFFFC6C6CB612
+F06D5D010F1580010102FCC7FCD9000F13C0364F7ACD43>I<91380FFF8091B512F80103
+14FE010F6E7E4901037F90267FF8007F4948EB3FF048496D7E484980486F7E4849808248
+17805A91C714C05A7013E0A218F0B5FCA318F8A618FCA46C5DA37EA25E6C7F6C5DA26C5D
+6C7F6C6D137B6C6D13F390387FF803011FB512E36D14C30103028313F89039007FFE03EC
+00401500A218F05EA3D801F816E0487E486C16C0487E486D491380A218005E5F4C5A91C7
+FC6C484A5A494A5A49495B6C48495BD803FC010F5B9027FF807FFEC7FC6C90B55A6C6C14
+F06D14C0010F49C8FC010013F0364F7ACD43>I<171F4D7E4D7EA24D7EA34C7FA24C7FA3
+4C7FA34C7FA24C7FA34C8083047F80167E8304FE804C7E03018116F8830303814C7E0307
+8116E083030F814C7E031F81168083033F8293C77E4B82157E8403FE824B800201835D84
+0203834B800207835D844AB87EA24A83A3DA3F80C88092C97E4A84A2027E8202FE844A82
+010185A24A820103854A82010785A24A82010F855C011F717FEBFFFCB600F8020FB712E0
+A55B547BD366>65 D<BA12C019FEF1FFC01AF01AFCD8000701F0C7000313FFDE007F7F73
+7F070F7F737F878587858785A287A84F5BA263616361634F5B4F5B077F90C7FC4E485A06
+0713F892B812E097C8FC861AF003F0C7000313FE9539003FFF80070F13E0737F07017F87
+737F747E1C807413C0A27413E0A31CF0A386A362A31CE0A2621CC0A250138097B5FC1C00
+4F5B19074F5B073F13F04EB55ABC128098C7FC1AF81AC007F8C8FC54527CD160>I<9326
+01FFFCEC01C0047FD9FFC013030307B600F81307033F03FE131F92B8EA803F0203DAE003
+EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01800203B5FC494848C9FC4901F88249
+49824949824949824949824990CA7E494883A2484983485B1B7F485B481A3FA24849181F
+A3485B1B0FA25AA298C7FC5CA2B5FCAE7EA280A2F307C07EA36C7FA21B0F6C6D1980A26C
+1A1F6C7F1C006C6D606C6D187EA26D6C606D6D4C5A6D6D16036D6D4C5A6D6D4C5A6D01FC
+4C5A6D6DEE7F806D6C6C6C4BC7FC6E01E0EC07FE020F01FEEC1FF80203903AFFE001FFF0
+020091B612C0033F93C8FC030715FCDB007F14E0040101FCC9FC525479D261>I<BA7E19
+FCF1FF801AF01AFCD8000701F0C7000F13FF060014C0071F7F070713F807017F737F747E
+747F747F86747F747F8886888688A2757EA31D8087A21DC0A51DE0A387A963A31DC0A51D
+80A2631D00A3515AA2646264505B6264505B505B5090C7FCF2FFFE4F5B07075B071F5B96
+B512C0060F91C8FCBB5A1AF01AC007FCC9FC19805B527CD167>I<BC1280A5D8000701F8
+C7000114C0F0001F19071901851A7F1A3F1A1FA2F20FE0A21A07A31A03A318F81BF01A01
+A497C7FC1701A317031707170F177F92B6FCA59238F8007F170F170717031701A317001B
+3EA31B7CA395C8FCA21BFCA21BF8A21A01A31A031BF01A071A0FA21A1F1A3FF27FE0F101
+FF1907191F0603B5FCBCFCA21BC0A34F517CD058>I<BB12FEA5D8000701F8C700077FF0
+007F191F190785858586861B80A21A1FA31A0FA41BC006F81307A497C7FCA31701A31703
+1707170F177F92B6FCA59238F8007F170F170717031701A31700A795C9FCB3B812F8A54A
+517CD055>I<932601FFFCEC01C0047FD9FFC013030307B600F81307033F03FE131F92B8
+EA803F0203DAE003EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01800203B5FC4948
+48C9FC4901F8824949824949824949824949824990CA7E494883A2484983485B1B7F485B
+481A3FA24849181FA3485B1B0FA25AA298C8FC5CA2B5FCAE6C057FB712E0A280A36C94C7
+003FEBC000A36C7FA36C7FA27E6C7FA26C7F6C7FA26D7E6D7F6D7F6D6D5E6D7F6D01FC93
+B5FC6D13FF6D6C6D5C6E01F0EC07FB020F01FEEC1FF10203903AFFF001FFE0020091B6EA
+C07F033FEE001F030703FC1307DB007F02E01301040149CAFC5B5479D26A>I<B8D8C003
+B8FCA5D8000701F8C9001FEBE000B3AE92BAFCA503F8C9121FB3B1B8D8C003B8FCA56052
+7CD169>I<B812C0A5D8000701F8C7FCB3B3B3B2B812C0A52A527CD132>I<B800C091B612
+F8A5D8000701F8C90003EBF8009738007F8051C7FC505AF203F8F20FF0505A505A505A50
+C8FCF101FCF107F84F5A4F5A4F5A4F5A07FEC9FCF003FC4E5A4E5A4E5A4E5A4E5ADD01FE
+CAFC4D5A4D5A4D5A4D7E173F4D7E4C487E4C7F5E4C804C804C80EEFF7F9226F9FE3F7FDB
+FBFC809226FFF81F7F4C7EDCC0077F0480804C7E4B6D804B6D804B8284727F727F868472
+7F727F8784728087737F85737F87737F85737F88857380747F888697B512FCB800C0013F
+ECFFFEA55F527CD169>75 D<B812F8A5D8000701F8CAFCB3B3A91A7CA41AFC1AF8A51901
+A31903A219071AF0190FA2191F193F197F19FF180360183F4DB5FCBB12E0A546527CD151
+>I<B600FC073FB512FE6F61A26F96B6FCA2D80007F5C00070EF01EFA202EF6DEF03CFA2
+02E76DEF078FA202E36DEF0F0FA202E16D171EA302E06D173CA26F6C1778A26F6C17F0A2
+6F6DED01E0A26F6DED03C0A36F6DED0780A26F6DED0F00A26F6D151EA26F6D5DA3706C5D
+A2706C5DA2706D495AA2706D495AA2706D495AA3706D49C7FCA2706D131EA2706D5BA271
+6C5BA3716C5BA271EB81E0A271EBC3C0A271EBE780A27101FFC8FCA3715BA2715BA2725A
+A2725AA2D93FFC6F5AB74DB712FEA2725AA2725A77527CD180>I<B600FC93B7FC8181A2
+82D800076E9239003FFC0070EE07E08282A28202EF7F02E77F02E380A202E18002E0806F
+7F6F7F6F7FA26F7F6F7F6F806F80A26F80707F707F707F707FA2707F7080708070808583
+717F717F717F717FA27114807114C07114E07213F07213F8A27213FC7213FE7213FF7214
+87A27214C77214E77313F77313FF85A285858585A28586868686A286868686A2D93FFC18
+7FB7173F1B1F1B0F1B07755A60527CD169>I<93380FFFC00303B6FC031F15E092B712FC
+0203D9FC0013FF020F01C0010F13C0023F90C7000313F0DA7FFC02007F494848ED7FFE49
+01E0ED1FFF49496F7F49496F7F4990C96C7F49854948707F4948707FA24849717E48864A
+83481B804A83481BC0A2481BE04A83A2481BF0A348497113F8A5B51AFCAF6C1BF86E5FA4
+6C1BF0A26E5F6C1BE0A36C6D4D13C0A26C6D4D1380A26C1B006C6D4D5A6E5E6C626D6C4C
+5B6D6D4B5B6D6D4B5B6D6D4B5B6D6D4B5B6D6D4B90C7FC6D6D4B5A6D01FF02035B023F01
+E0011F13F0020F01FC90B512C0020390B7C8FC020016FC031F15E0030392C9FCDB001F13
+E0565479D265>I<BAFC19F819FF1AE086D8000701F0C7001F13FC060113FF726C138073
+13C0070F13E01BF0857313F81BFCA27313FEA41BFFA81BFEA31BFC61A21BF84F13F04F13
+E0614F13C04F13004E485A061F5B92B812F01AC04FC7FC19E003F8CBFCB3AEB812C0A550
+527CD15C>I<B912F0F0FF8019F819FF1AC0D8000701F0C714F0060F7F060113FE727F73
+7F737F85737F87A2737FA387A863A2616363A24F5B4F5B4F90C8FC4F5A06035B060F13F0
+95B512C092B8C9FC19F819E019F89226F0000313FE9439007FFF80727F727F727F727F72
+7F8684A28684A787A71D1C75133EA38575137E73157C7513FC731401B86C6D9038F803F8
+07039038FE07F07390B512E0736C14C0080F1400CEEA7FFC5F537CD164>82
+D<91260FFF80130791B500F85B010702FF5B011FEDC03F49EDF07F9026FFFC006D5A4801
+E0EB0FFD4801800101B5FC4848C87E48488149150F001F824981123F4981007F82A28412
+FF84A27FA26D82A27F7F6D93C7FC14C06C13F014FF15F86CECFF8016FC6CEDFFC017F06C
+16FC6C16FF6C17C06C836C836D826D82010F821303010082021F16801400030F15C0ED00
+7F040714E01600173F050F13F08383A200788200F882A3187FA27EA219E07EA26CEFFFC0
+A27F6D4B13806D17006D5D01FC4B5A01FF4B5A02C04A5A02F8EC7FF0903B1FFFC003FFE0
+486C90B65AD8FC0393C7FC48C66C14FC48010F14F048D9007F90C8FC3C5479D24B>I<00
+3FBC1280A59126C0003F9038C0007F49C71607D87FF8060113C001E08449197F49193F90
+C8171FA2007E1A0FA3007C1A07A500FC1BE0481A03A6C994C7FCB3B3AC91B912F0A55351
+7BD05E>I<B800C00103B612FCA5D8000701F8CAEBF000F31F80B3B3B11B3FA26D97C7FC
+81637F1B7E6D6D17FE505A6E7E505A6E6D15076E4D5A6E6D4B5A6E6D4B5A6E01F84B5A6E
+6DDA03FFC8FC6E6CB46CEB0FFE6F9039F001FFF8030F90B65A030316C0DB007F92C9FC04
+0F14F8DC007F13805E537CD167>I<B700FE031FB512FEA5D8001F01F0CA383FFE00F307
+F06D626F170F6D62811B1F6D6D601B3F6D97C7FC6F5F6D197E821BFE6E6D5E1A016E6D5E
+1A036E60701507A26E6D5E1A0F6E6D5E1A1F6E6070153FA26E6D93C8FC626E6E147E1AFE
+6F5E711301A26F6D5C19036F6D5C19076F5E71130FA26F6D5C191F6F6D5C193F6F93C9FC
+715BA26FEC807E19FE706D5A18C1705C18E3705C18F318F770EBFFE0A2705CA2705CA370
+91CAFCA2705BA2715AA3715AA2715AA2715A715A5F537DD166>I<B700FC017FB600FE91
+B612F0A5D8003F01C0C8001F01E0C9EBF8006F71EE0FC06D7161876F1C1F6D7196C7FC6F
+8373606D1E3E6F836D7160876F1CFC6D666F4B801F016D66704A806E525A88704A17076E
+059F5F70021F80080F160F6E6570023F806EDC3E074CC8FC8870027E5F6EDC7C03163E70
+02FC804F6C167E6E1C7C700101814F6C16FC6E745B70010317016E4C6D5D060716C00580
+496D14036F63DDC00F16E04F6D14076F07F05BDDE01F170F6F92C76C5D1DF8DDF03E6E14
+1F6F98C9FCDDF87E16FC067C6E5C6FF1FE3EDDFCFC177E6F4A6E147C1DFFDDFFF06E14FC
+6F62A24E816F62A270496F5BA24E817061A295C97E7061A270487090CAFCA37048705AA2
+4D1601040360A27048705A84537DD18B>I<EC7FFF0107B512F0013F14FE90B77E48D9E0
+0F7F2703FE000113F0486C6D7F6EEB3FFC48826E131F83707FA36C496D7FA26C90C7FC6C
+5AC9FCA6037FB5FC020FB6FC91B7FC01071487013FEBF0074913803901FFFC004813F048
+5B485B485B4890C7FC5A5BA2485AA45EA26D5C007F151D163D6C6C02797F6C6D01F113F8
+6C9026C003E1EBFFE06C9026F81FC014F06C90B5487EC6ED001F011F01FC010713E00101
+01E090C8FC3C387CB641>97 D<EB3FF0B5FCA51203C6FCB3A4923801FFE0030F13FE033F
+EBFFC092B612F002F301017F913AF7F8003FFEDAFFE0EB0FFF03806D7F92C76C7F4A6E7F
+4A824A6E7FA2727EA285A28584A31A80AC1A00A44E5AA36118FF616E4A5BA26E4A5B6E4A
+5B6F495BDACFC04990C7FCDA87F0EB7FFC913A03FE03FFF849C6B612E0496D148049011F
+01FCC8FC90C7000313C041547BD24B>I<913801FFF8021FEBFF8091B612F0010315FC01
+0F9038C00FFE903A1FFE0001FFD97FFC491380D9FFF05B4817C048495B5C5A485BA2486F
+138091C7FC486F1300705A4892C8FC5BA312FFAD127F7FA27EA2EF03E06C7F17076C6D15
+C07E6E140F6CEE1F806C6DEC3F006C6D147ED97FFE5C6D6CEB03F8010F9038E01FF00103
+90B55A01001580023F49C7FC020113E033387CB63C>I<4DB47E0407B5FCA5EE001F1707
+B3A4913801FFE0021F13FC91B6FC010315C7010F9038E03FE74990380007F7D97FFC0101
+B5FC49487F4849143F484980485B83485B5A91C8FC5AA3485AA412FFAC127FA36C7EA37E
+A26C7F5F6C6D5C7E6C6D5C6C6D49B5FC6D6C4914E0D93FFED90FEFEBFF80903A0FFFC07F
+CF6D90B5128F0101ECFE0FD9003F13F8020301C049C7FC41547CD24B>I<913803FFC002
+3F13FC49B6FC010715C04901817F903A3FFC007FF849486D7E49486D7E4849130F48496D
+7E48178048497F18C0488191C7FC4817E0A248815B18F0A212FFA490B8FCA318E049CAFC
+A6127FA27F7EA218E06CEE01F06E14037E6C6DEC07E0A26C6DEC0FC06C6D141F6C6DEC3F
+806D6CECFF00D91FFEEB03FE903A0FFFC03FF8010390B55A010015C0021F49C7FC020113
+F034387CB63D>I<ED3FFC0203B5FC020F14C0023F14E09139FFF81FF0499038C03FF849
+EB807F49903800FFFC495A495AA2495AA2EE7FF8495AEE3FF0EE0FC093C7FCAEB712E0A5
+26007FF8C8FCB3B3A7007FB512FEA52E547CD329>I<DA3FFF14FF0103B5D8F00713C001
+0FDAFC1F13E0013FECFF7F90267FFC0F9038FF9FF09026FFE001EBF83F48496C13E04849
+90387FF01F4890C7D83FF813E0489338FC0FC0F0078048486E6CC7FCA2003F82A9001F5E
+A26C6C4A5AA26C5E6C6D495A6C6D495A6C6D485BDAFC0F5B4890B6C8FCD803EF14FC01C3
+14F02607C03F90C9FC91CBFCA2120FA37FA213F813FE90B7FC6C16F817FF18C06C836C83
+6C836D828448B9FC12074848C700031480D81FF8EC003F4848150748486F13C083485A83
+A56D5D007F18806D5D003F18006C6C4B5AD80FFEED1FFC6C6C6CEC7FF86C01E049485A6C
+01FE011F5B6C6CB71280010F03FCC7FC010115E0D9000F01FCC8FC3C4F7CB543>I<EB3F
+F0B5FCA51203C6FCB3A4EE1FFC93B512C0030314F0030F8092391FE07FFC92393F001FFE
+037C8003F07FDAF1E081ECF3C0DAF7807F8502FFC7FC5CA25CA45CB3ACB6D8F807B612C0
+A542537BD24B>I<137F497E000313E0487FA2487FA76C5BA26C5BC613806DC7FC90C8FC
+ADEB3FF0B5FCA512017EB3B3A6B612E0A51B547BD325>I<EB3FF0B5FCA51203C6FCB3A5
+4CB512F8A59339003FFE00EF1FF0EF3FC04D5A4DC7FCEE03FEEE07F84C5A4C5AEE7FC04C
+C8FC4B5A4B5AED0FF8ED1FE04B7E4B7EECF1FF02F37F02F77F91B6FC83159F030F7F02FE
+80DAF8077F4A7E6F7F6F7F83707E82707F84707F707F82707F84707F177F717E4D13C0B6
+D8F003B6FCA540537CD247>107 D<EB3FF0B5FCA512017EB3B3B3B1B612F0A51C537BD2
+25>I<D93FF0D91FFCEDFFE0B591B500C0010713FE030302F0011F6D7E030F6E017F8092
+271FE07FFCD9FF037F922A3F001FFE01F8007F0003027C9126FF03E080C602F06DD90780
+137FDAF1E0038FC77FDAF3C0159EDAF7806D01BC143F07FC8102FFC75C4A5EA24A5EA44A
+5EB3ACB6D8F807B6D8C03FB512FEA567367BB570>I<D93FF0EB1FFCB591B512C0030314
+F0030F8092391FE07FFC92393F001FFE0003027C80C602F07FDAF1E081ECF3C0DAF7807F
+8502FFC7FC5CA25CA45CB3ACB6D8F807B612C0A542367BB54B>I<913801FFE0021F13FE
+91B612C0010315F0010F9038807FFC903A1FFC000FFED97FF86D6C7E49486D7F48496D7F
+48496D7F4A147F48834890C86C7EA24883A248486F7EA3007F1880A400FF18C0AC007F18
+80A3003F18006D5DA26C5FA26C5F6E147F6C5F6C6D4A5A6C6D495B6C6D495B6D6C495BD9
+3FFE011F90C7FC903A0FFF807FFC6D90B55A010015C0023F91C8FC020113E03A387CB643
+>I<903A3FF001FFE0B5010F13FE033FEBFFC092B612F002F301017F913AF7F8007FFE00
+03D9FFE0EB1FFFC602806D7F92C76C7F4A824A6E7F4A6E7FA2717FA285187F85A4721380
+AC1A0060A36118FFA2615F616E4A5BA26E4A5B6E4A5B6F495B6F4990C7FC03F0EBFFFC91
+26FBFE075B02F8B612E06F1480031F01FCC8FC030313C092CBFCB1B612F8A5414D7BB54B
+>I<90397FE003FEB590380FFF80033F13E04B13F09238FE1FF89139E1F83FFC0003D9E3
+E013FEC6ECC07FECE78014EF150014EE02FEEB3FFC5CEE1FF8EE0FF04A90C7FCA55CB3AA
+B612FCA52F367CB537>114 D<903903FFF00F013FEBFE1F90B7FC120348EB003FD80FF8
+1307D81FE0130148487F4980127F90C87EA24881A27FA27F01F091C7FC13FCEBFFC06C13
+FF15F86C14FF16C06C15F06C816C816C81C681013F1580010F15C01300020714E0EC003F
+030713F015010078EC007F00F8153F161F7E160FA27E17E07E6D141F17C07F6DEC3F8001
+F8EC7F0001FEEB01FE9039FFC00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7FC2C38
+7CB635>I<143EA6147EA414FEA21301A313031307A2130F131F133F13FF5A000F90B6FC
+B8FCA426003FFEC8FCB3A9EE07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6DEBF0FC
+6DEBFFF86D6C5B021F5B020313802A4D7ECB34>I<D93FF8913801FFC0B50207B5FCA500
+03ED001FC61607B3AE5FA35FA2017F5D173B177B6D6C14F3DC01E313F06D6CD907C3EBFF
+C0903A0FFFC03F836D90B51203010114FE6D6C13F8020701E091C7FC42377BB54B>I<B6
+00F00107B5FCA5000101F8C8EA7FE06C6DED3F00A2017F163E6E157E013F167C6E15FC6D
+5E6F13016D5E8117036D5E6F13076D5E6F130F6D5E6F131F6D93C7FC815F6E6C133E177E
+023F147C6F13FC6E5C16816E5C16C3A26EEBE3E016E76E5C16FF6E5CA26E91C8FCA26F5A
+A36F5AA26F5AA26F5AA26F5A6F5A40367DB447>I<B6D8E07FB5D8C003B512C0A5000101
+F0C701F0C7381FF8006E027FED07E06C715DA26E023F150F017F705DA26E181F013F4B6C
+92C7FC6E606D70143E94B5FC6F177E6D4A6E137C03C001F315FC6D715B160303E001E114
+016D020702E05B03F013C06D71485A160F03F8D9807F13076D05F85B93381F003F03FC16
+0F027F4902FC5BDBFE3E011F131F023F04FE90C8FC167EDBFF7C010F5B6E01FCECFF3E4C
+6D137E6E5FA24C7F6E5F4C7F6E5FA24C7F6E5F4C147FA26E5F93C8123F6F5EA2033E6FC9
+FC5A367DB461>I<007FB500F090387FFFFEA5C66C48C7000F90C7FC6D6CEC07F86D6D5C
+6D6D495A6D4B5A6F495A6D6D91C8FC6D6D137E6D6D5B91387FFE014C5A6E6C485A6EEB8F
+E06EEBCFC06EEBFF806E91C9FCA26E5B6E5B6F7E6F7EA26F7F834B7F4B7F92B5FCDA01FD
+7F03F87F4A486C7E4A486C7E020F7FDA1FC0804A486C7F4A486C7F02FE6D7F4A6D7F495A
+49486D7F01076F7E49486E7E49486E7FEBFFF0B500FE49B612C0A542357EB447>I<B600
+F00107B5FCA5C601F8C8EA7FE06EED3F00A26D6C153E187E013F167C6E15FC6D5E6F1301
+6D5E6F13036D5E8117076D6D5C170F6D6D5C171F6D93C7FC6F5B027F143E6F137E023F14
+7C6F13FCA26E6D5A16816EEBC1F016C36E5C16E76E5C16FF6E5CA26E91C8FCA36F5AA26F
+5AA26F5AA26F5AA26F5AA35E150F5E151F93C9FC5DD81FC0133E486C137E486C137C486C
+13FC5D14015D14034A5A6C48485A49485A263FC07FCAFCEB81FE6CB45A6C13F000035BC6
+90CBFC404D7DB447>I<001FB8FC1880A3912680007F130001FCC7B5FC01F0495B495D49
+495B495B4B5B48C75C5D4B5B5F003E4A90C7FC92B5FC4A5B5E4A5B5CC7485B5E4A5B5C4A
+5B93C8FC91B5FC495B5D4949EB0F805B495B5D495B49151F4949140092C7FC495A485E48
+5B5C485E485B4A5C48495B4815074849495A91C712FFB8FCA37E31357CB43C>I
+E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fg cmbx12 20.74 23
+/Fg 23 121 df<EE3FFF0307B512F8033F14FF4AB712E0020716F8021F16FE4AD9F8077F
+91B5D8C00014C04991C7003F7F4901FC020F7F49496E7F49496E7F49496E7F49496E7F4B
+81498590B5C96C7FA24849707FA24886A248864A824886A34886A448864A82A4481B80A8
+B51AC0B3AA6C1B80A86C1B006E5EA46C62A36C62A36C6D4C5BA36C62A26C6D4C5BA26C6E
+4B5B6D616F92B5FC6D96C7FC6D6D4A5B6D6D4A5B6D6D4A5B6D6D4A5B6D01FF023F5B6D02
+C090B55A6ED9F8075C021F90B648C8FC020716F8020116E06E6C1580030702F8C9FCDB00
+3F90CAFC527379F061>48 D<EE01F0EE07F8160F163F167FED01FF150F153F4AB5FC143F
+010FB6FCB8FCA54A7E14C0EBF000C8FCB3B3B3B3AE007FBA12F0A8447171F061>I<9238
+0FFFE04AB67E020F15F0027F15FE49B87E4917E0010F17F8013F8349D9C01F14FF9027FF
+FC0001814801E06D6C80480180021F804890C86C8048486F8048486F8001FF6F804801C0
+6E8002F081486D18806E816E18C0B5821BE06E81A37214F0A56C5BA36C5B6C5B6C5B0003
+13C0C690C9FC90CA15E060A34E14C0A21B80601B0060626295B55A5F624D5C624D5C4D91
+C7FC614D5B4D13F04D5B6194B55A4C49C8FC4C5B4C5B4C13E04C5B604C90C9FCEE7FFC4C
+5A4B5B4B5B4B0180EC0FF04B90C8FC4B5A4B5A4B48ED1FE0EDFFE04A5B4A5B4A90C9FC4A
+48163F4A5ADA3FF017C05D4A48167F4A5A4990CA12FFD903FC160749BAFC5B4919805B5B
+90BBFC5A5A5A5A481A005A5ABCFCA462A44C7176F061>I<923801FFFE033FEBFFF84AB7
+FC020F16E0023F16F84A16FE49B97E49DA003F80010F01F0010714F04901800101804948
+C880D97FF86F7F02E081496C834801FC6F148014FF486E6E14C08181481AE081A96C5C1B
+C06C4A5C6C5C6D90C815806D5AD90FF85D90CA150062606295B55A4D5C624D5C4D5C4D91
+C7FC4D13FC4D5B4CB512E0047F1480037FB548C8FC92B612F818C018F8F0FF806F15F092
+C7003F13FC050713FF050114C071807213F8727F727F867214801BC07214E01BF0A27214
+F81BFCA37214FEA31BFFEBFF80000313E0487F001F13FC487FA2487FA2B67EA31BFEA360
+1BFCA292C8FC6C1AF84A5D4A18F06C494B14E05C6C01C04B14C06C90C915804E14006C6D
+4B5B6C01F092B55A6C01FC4A5C27007FFFC001075C6D01FE013F14C0010F90B85A6D4DC7
+FC010117F8D9003F16E0020F93C8FC020015F0030749C9FC507378F061>I<F10FF04F7E
+193FA2197F19FF60A260606060A2606095B5FCA25F5F5FA25F5F5F5F18BFEFFF3F5EEE03
+FE17FCEE07F8160FEE1FF0EE3FE017C0167FEEFF804B13005E4B5A15074B5A4B5A5E153F
+4B5A4B5A93C7FC4A5A14034A5A5D4A5A141F4A5A4A5A5D4AC8FC5B495A5C495A130F495A
+495A5C137F495A4890C9FC5B485A1207485A485A5B123F485A485A90BC12FCA8CB02F8C7
+FCB3A20307B912FCA856727BF161>I<0170187001FEEF01F86D6C160F02F8167FDAFF80
+EC07FF03FE49B5FC92B85A6262A26297C7FC61616119E061614EC8FC18F86018C095C9FC
+17F817C0020701F8CAFC91CDFCB0923801FFFC031FEBFFE092B612FC020315FF020F16C0
+4A16F0027FD9003F7FDAFFF0010F13FE038001037F4AC76C8002F86E804A6F7F4A6F7F4A
+834A6F7F91C980137E017C707F90CAFC1B80A21BC0A2841BE0A51BF0A313FE3803FF8000
+0F7F4813F0487F5A80B5FCA41BE0A44E14C05C7E4A18805C4A5D6C90C9150001E0606C6C
+5E6D606C6C4C5B7F000794B55A6C6C6C4A5C6C6D4A5C6E4A5C26007FF8021F49C7FC6DB4
+027F5B6DD9F007B55A6D90B712E0010317806D4CC8FC6D6C15F8021F15C002034AC9FCDA
+003F13804C7376F061>I<94381FFF800403B512F8043F14FE4BB77E030782031F16F003
+7F8292B5D8FC017F02039139C0001FFE4A49C7EA07FF021F01F8804A496E13804A01C014
+0F91B548023F13C04991C85A494992B5FC49494A14E0495B495E5D5B495BA290B55A5A5D
+487114C0A24891C91480731300735A48F00FF896C8FC485BA45AA44849903803FFE0041F
+13FE047FEBFFC04BB612F84B81030F15FFB590261FF8038092273FE0007F13E00480011F
+7F4BC76C7F03FE6E7F4B6E7FDAFDF86E7FDAFFF017804B6E14C01BE05D7313F05D1BF8A2
+92C914FC85A21BFE5CA31BFFA26C5BA87EA4807EA21BFE7EA37E1BFC6E5E6C1AF8A27E6F
+17F06C95B512E06D7F1BC06D6D4A14806D4C1400816D6D4A5B6D6D4A5B6D01FF4A13F001
+006E017F5B6ED9F007B55A6E90B7C7FC020F5E020316F86E16E0DA003F1580030702FCC8
+FCDB007F1380507378F061>I<EA03FCA2487E7F14C0ECFFF092BA12C0A45AA31C801C00
+63A2486263636363A26398C7FC48616249CAEA0FF801F0171F494D5A4F5A49604F5A007F
+4D90C8FC60494C5A4E5A614E5A4E5A48CA127F4E5A4D5B96C9FCCA485A4D5A170F4D5A60
+173F4D5A6017FF4C5BA25E4C90CAFCA24C5A161FA24C5AA2167FA24C5AA25DA24B5BA25D
+A25DA25F5DA25DA35DA392B5FCA25FA25CA45CA75CAD6E5CA26E91CBFCA26E5BED3FF8ED
+0FE0527775F461>I<93B57E031F14FC92B77E020316F0020F16FC023F16FF4A8349B5D8
+800314E04901F8C7003F7F4901C0020F7F4990C800037FD91FFC6F7F49486F6C7E137F4A
+7013804948827313C05A4A821BE05AA285487FA38080806E5E8003C017C08103F85D03FE
+17806F6C5C6C6F160004F05C04FC4A5A6C6F5D706C13FFDDE0015B6CDCF8035BDDFC0F13
+C06DDBFF1F5B6D93B5C7FC19FC6D17F06D5F6D17806D17E06D836D6C16FC6E16FF020F83
+6E17E06E83020F83023F8391B97E4984010701F0178049D9C07F16C0013FD9801F16E049
+EB00074948010116F048497F4849023F15F84849140F4A6E15FC48160148496E6C14FE4A
+151F488391C9120348050014FF193F49838500FF84854983A28586A3861BFEA27FA2007F
+1AFC7F1A7F1BF86C7FF2FFF06C7F6E4C13E06C6D4C13C06C6D5E6E4C13806C6D4C13006C
+6D6CED7FFE6C02E04A485A013F01FC020F13F06D9026FFC001B55A010791B712806D95C7
+FC010017FC021F16F002071680DA007F02FCC8FC030191C9FC507378F061>I<93B5FC03
+1F14F092B612FE02076F7E021F16E04A16F891B87E49DAF00713FF0107DA0001804901FC
+6D6C7F49496E7F49496E7F49496E7F90B5486E7F484A8048854891C86C7FA2487114805C
+481AC0A2487213E0A2484918F0A31BF8A2B5FCA27313FCA51BFEA71BFF61A27EA396B6FC
+7EA2806C5FA27E606C7F607E6C6E5C6CEF1FBF6D6DEC3F3F6D6D147F6D6D14FE6D6DEB01
+FC6D01FE130701019039FFC01FF86D91B500F014FE023F15C06E15800203ECFE00DA007F
+13F8030713C092C9FC4F13FCA41BF8A31BF0D91FF093B5FCEB7FFC496C18E0487F486E17
+C06048801B804E1400A26260624E5B4B5C626C91C8485B4A4B5B4A92B55A6C01F04A91C7
+FC02804A5B6C01E0020F5B6D6C023F13F002FE91B55A90273FFFE00F5C6D90B7C8FC0107
+16FC6D16F0010016C0023F92C9FC020714F09126007FFECAFC507378F061>I<F103F84F
+7E4F7EA24F7EA34F7FA24F7FA396B57EA24E80A34E80A24E80A34E80A24E80A34E81A24E
+81A219BFDEFF9F80191F4D6D80A218FE05036D8018FC05076D80A218F8050F6D8018F005
+1F6D80A260053F6E8060057F6E80A26005FF6E8095C7FC4C6F80A25F04036F805F04076F
+80A25F040F6F805F041F6F80A25F043F70805F047F7080A25F04FF708094C9FC4B7180A2
+5E030371805E4BBB7EA34B86A24B86A3DB3FE0CA6C805E037F7280A25E03FF7280A24A90
+CB6C80A25D02037380A24A487280A25D020F7380A24B84021F885D023F7480A24B85027F
+895D902607FFFC7380B86C031FB912E0A8837979F892>65 D<BDFC1CFEF4FFC01DF81DFF
+1EC01EF08AC7003F49C9000F14FE090180756C800A1F807680768076807680A27680A277
+7FA2208089A320C0A289A565A32080A3531400A29AB55AA2525C6764525C525C525C525C
+5249C7FC51B55A090714F0093F14C00807B6C8FC93BA12F81DC0651DFCF5FF801EF04CCA
+14FC0A3F13FF0A0F800A0314E076807614FC777F777F2080897714C020E0A27714F0A220
+F88920FCA47714FEA96520FCA45314F8A26520F06520E05314C0659AB61280521500525C
+1C0F5214F899B65A09075DC05A9CC7FC1EFC1EF01EC053C8FC1DE00AF8C9FC777679F58A
+>I<96267FFFE01670063FB6ED01F80503B700F01403053F04FC14074CB96C130F040706
+E0131F043F72133F93BA00FC137F0303DC00076D13FF030F03C09039003FFF814B02FCC8
+000713C3037F02E0030113F792B600806F6CB5FC02034ACA121F4A02F8834A02E0834A4A
+1701027F4A8391B548CC7E494A85495C4C854988494A85494A85495C8A4991CDFC90B548
+86A2484A1B7FA2481E3F5D481E1F5D5A1F0FA2485CA3481E075DA2F703F0489BC7FCA45D
+A2B6FCB27EA281A47EA2F703F06FF307F87EA36C80A21F0F7E6F1CF07E6F1B1F7E20E06C
+6E1B3F816DF57FC06D80F7FF806D806D6E4F13006D6E616D525A826D6E4F5A6D6E4F5A6E
+6D6C4E5A021F6EF0FFE06E6E4D5B6E02F84D5B6E02FE050F90C7FC02006E6CEE3FFE6F02
+F0EEFFFC031F02FE03035B6FDAFFC0021F13E0030303FF0103B55A030093B7C8FC043F18
+FC040718F0040118C0DC003F94C9FC050316F8DD003F1580DE007F01F0CAFC757A75F78C
+>I<92383FFFF80207B612E0027F15FC49B87E010717E0011F83499026F0007F13FC4948
+C7000F7F90B502036D7E486E6D806F6D80727F486E6E7F8486727FA28684A26C5C72806C
+5C6D90C8FC6D5AEB0FF8EB03E090CAFCA70507B6FC041FB7FC0303B8FC157F0203B9FC02
+1FECFE0391B612800103ECF800010F14C04991C7FC017F13FC90B512F04814C0485C4891
+C8FC485B5A485B5C5A5CA2B5FC5CA360A36E5DA26C5F6E5D187E6C6D846E4A48806C6D4A
+4814FC6C6ED90FF0ECFFFC6C02E090263FE07F14FE00019139FC03FFC06C91B6487E013F
+4B487E010F4B1307010303F01301D9003F0280D9003F13FC020101F8CBFC57507ACE5E>
+97 D<97380FFFE00607B6FCA8F00003190086B3AD93383FFF800307B512F8033F14FF4A
+B712C0020716F0021F16FC027F9039FE007FFE91B500F0EB0FFF01030280010190B5FC49
+49C87E49498149498149498149498190B548814884484A8192CAFC5AA2485BA25A5C5AA3
+5A5CA4B5FCAF7EA4807EA37EA2807EA26C7F616C6E5D6C606C80616D6D5D6D6D5D6D6D92
+B67E6D6D4A15FC010301FF0207EDFFFE6D02C0EB3FFE6D6C9039FC01FFF86E90B65A020F
+16C002031600DA007F14FC030F14E09226007FFEC749C7FC5F797AF76C>100
+D<93387FFF80030FB512FC037FECFF804AB712E0020716F8021F16FE027FD9F8077F49B5
+D8C000804991C7003F13E04901FC020F7F49496E7F49498049496E7F49496E7F90B55A48
+727E92C914804884485B1BC048841BE0485BA27313F05AA25C5AA21BF885A2B5FCA391BA
+FCA41BF002F8CCFCA67EA3807EA47E806CF103F0F207F86C7F1A0F6C6E17F06C191F6F17
+E06C6E163F6D6DEE7FC06D6D16FF6D6D4B13806D6D4B13006D6D6CEC0FFE6D02E0EC3FFC
+6D02F8ECFFF86D9126FFC00F5B023F91B65A020F178002034CC7FC020016F8031F15E003
+0392C8FCDB000F13E04D507BCE58>I<903801FFFCB6FCA8C67E131F7FB3AD95380FFFE0
+95B512FE05036E7E050F15E0053F15F84D81932701FFF01F7F4CD900077FDC07FC6D80DC
+0FF06D80DC1FC07F4C48824CC8FC047E6F7F5EEDFDF85E03FF707F5EA25EA25EA293C9FC
+A45DB3B3A6B8D8E003B81280A8617879F76C>104 D<EB01FCEB07FF011F13C0497F497F
+90B57EA24880A24880A76C5CA26C5CA26D5B6D5B6D5B010790C8FCEB01FC90CAFCB29038
+01FFFC007FB5FCA8C67E131F7FB3B3B3A5B81280A8297979F835>I<902601FFF891380F
+FFE0B692B512FE05036E7E050F15E0053F15F84D81932701FFF01F7F4CD900077FDC07FC
+6D80C66CDA0FF06D80011FDA1FC07F6D4A48824CC8FC047E6F7F5EEDF9F85E03FB707F5E
+15FF5EA25EA293C9FCA45DB3B3A6B8D8E003B81280A8614E79CD6C>110
+D<902601FFFCEC7FFEB6020FB512F0057F14FE4CB712C0040716F0041F82047F16FE93B5
+C66C7F92B500F0010F14C0C66C0380010380011F4AC76C806D4A6E8004F06F7F4C6F7F4C
+6F7F4C8193C915804B7014C0861DE0A27414F0A27414F8A47513FCA57513FEAF5113FCA5
+98B512F8A31DF0621DE0621DC0621D806F5E701800704B5B505B704B5B7092B55A04FC4A
+5C704A5C706C010F5C05E0013F49C7FC9227FE7FFC01B55A70B712F0040F16C0040393C8
+FC040015F8053F14C0050301F0C9FC94CCFCB3A6B812E0A85F6F7ACD6C>112
+D<902601FFF8EB07FEB691383FFFC094B512F00403804C14FE4C8093261FFC3F13809326
+3FE07F13C0DC7F80B5FCC66C5D011FDAFE0114E06DEBF9FC16F815FB16F016E015FF16C0
+7114C05E72138095381FFE0093C76C5AF001E095C8FCA25DA65DB3B3A2B812F8A8434E7A
+CD4F>114 D<15FFA75CA55CA45CA25CA25CA25CA25C91B5FCA25B5B5B131F5B90B9FC12
+0FBAFCA6D8000791C9FCB3B3A3F01FE0AE183F7014C07F187F7014806D16FF826D4B1300
+6E6D485AEEFE0F6E90B55A020F5D6E5D020115C06E6C5C031F49C7FC030113F03B6E7CEC
+4B>116 D<007FB7023FB612F0A8D8000302C0020191C7FC6D6E9138007FF0705E6D4E5A
+6E6D4A5B6E6D4A90C8FC6E6D5C704A5A6E4C5A6E6E5C6E6E495A6E6E495A7113FF6E6E48
+5B6F4A5B6F6D4890C9FC6F01FE5B71485A6FEC9FF86F14BF6FECFFF06F5D616F5D7091CA
+FC705B828470808270807080854C805E4C80854C804C81EE7FE7DCFFE3804B01C1804B01
+80804D804B487F4B486D7F031F6E7F4B486D7F4B48824B487F4C6D804A496D804A90C880
+4A844A48814A486F7F4A486F7F4B6F7F4A48844A486F80010F01F881B76C91B712FEA85F
+4D7DCC66>120 D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fh cmsl10 10.95 39
+/Fh 39 91 df<1530157015E0EC03C0EC0780EC0F00141E5C147C5C5C495A1303495A5C
+130F49C7FCA2133E137E137C13FC5B1201A2485AA25B1207A2485AA3485AA448C8FCA45A
+127EA512FE5AA95AA87EA2127CA5123C123EA2121EA2121F7EA26C7EA26C7EA26C7E1200
+13707FA213181C5A74C323>40 D<497E806D7E1470147880A280A280A2EC0780A215C014
+03A215E0A3EC01F0A615F8AF140315F0A5140715E0A4140F15C0A3141F1580A3EC3F00A2
+143E147EA2147C14FC5C13015C13035C13075C495AA249C7FC131E133E5B13785B485A48
+5A12075B000EC8FC5A5A12F05A1D5A7FC323>I<007FB5FCA2B512FEA418067C961E>45
+D<121EEA3F80EA7FC012FFA41380EA7F00123C0A0A788919>I<1703EF0780170FA2EF1F
+00A2173EA25FA25FA24C5AA24C5AA24C5AA24C5AA24CC7FCA2163E167E167C5EA24B5AA2
+4B5AA24B5AA24B5AA24BC8FCA2153EA25DA25DA24A5AA24A5AA24A5AA24A5AA24AC9FCA2
+143EA25CA25CA2495AA2495AA2495AA2495A131F91CAFC133EA25BA25BA2485AA2485AA2
+485AA2485AA248CBFCA2123EA25AA25AA21270315B7FC32D>I<EC07F8EC3FFF9138FC0F
+C0903903F003E0903907C001F0D90F8013F849C7FC013E14FC017E147C017C147E13FC48
+5AA20003157F5B1207A2120F5BA2121F16FF5BA2123FA44848EB01FEA648C7EA03FCA5ED
+07F8A25A16F0A2150F16E0A3ED1FC0A21680007E143F1600157E123E003F5C4A5AD81F80
+5B000FEB07E06C6C485A2603F03FC7FC3800FFFCEB1FE0283F79BC2D>I<157015F01401
+1407143F903803FFE0137FEBFFCFEBF80F1300141F15C0A5143F1580A5147F1500A55C5C
+A513015CA513035CA513075CA5130F5CA3131F497EB612F8A31D3D78BC2D>I<EC01FE91
+380FFFE0023F13F89138FC07FC903901E001FE903907C000FF49C7EA7F80011E15C0163F
+4915E05B0170141F13FF80A35A163FA26C90C7FC137E0118EC7FC090C8FCEEFF80A24B13
+00A24B5A5E4B5A4B5A4B5A5E4B5A4BC7FC15FEEC01F84A5A4A5A4A5A4AC8FC143E5C5CEB
+01E04948130E49485B49C7FC131E495C13705B48485C484814F0000FB6FC5A485D5AB7FC
+5EA22B3D7CBC2D>I<EC07FC91383FFF809138F80FE0903903C007F09039078003FC9038
+0F0001011C14FE013C14FF137F1480EBFFC0A31480A291380003FE137E90C7FCED07FC16
+F8150F16F0ED1FE016C0ED3F80ED7E005DEC07F0903803FF8015F090380001FC6E7EED7F
+80ED3FC0A2ED1FE016F0A316F8A4120EEA3F80486C133F16F012FFA216E0157F5B48C7EA
+FFC000F01580007049130012786C495A003EEB07F86C495A390FE03FE00003B51280C649
+C7FCEB1FE0283F7ABC2D>I<161C163C167CA216FCED01F815031507150FA2151DED3BF0
+157315E315C31401EC038391380707E0140E141CA2143814709138E00FC0EB01C0148013
+03EB0700130E49EB1F805B133013705B485A4848EB3F0090C7FC5A120E5A5A48147E1260
+B8FCA3C73801FE00A25DA41403A25DA314074A7E0107B512F8A3283E7BBD2D>I<010614
+03D90780131F90390FF801FE91B512FC16F816F016E0168049EBFE0015F890381C7FC091
+C8FCA3133C1338A513781370A2EC1FE0ECFFF8903873E03E9038FF001F01FCEB0F804914
+C049EB07E04914F049130390C7FC16F8A61507A21206EA3F80487EA2150F00FF15F0A249
+14E090C7121F00FC15C000F0143F00701580ED7F0012786C14FE4A5A6C495A390F800FE0
+3907E03FC06CB5C7FCC613FCEB1FE0283F7ABC2D>I<ED7F80913803FFE091380FC0F091
+383E003802FC131C495A494813FE903807E003EB0FC090381F8007133FD97F0013FC01FE
+1303ED01F0484890C7FC1203A2485AA2120F5BA2001FEB3F809038E0FFE0393FE3C0F890
+38E7007C01EE7F01FC133F4848EB1F80A24914C05B16E0A2485AA216F05BA2ED3FE0A290
+C7FCA4157F16C0A316804814FF007E1500007F5C14016C5C4A5A6C6C485A4A5A6C6C485A
+2607E07FC7FC3803FFFEC613F8EB3FC0273F78BC2D>I<EA0380120713E090B712805AA2
+17005E485D5E001EC85A484A5A00385D150300784A5A00704AC7FC151E5D485CC8127015
+F04A5A4A5A4A5A4AC8FC140E141E5C147C14785C1301495AA213075C130F495AA2133F91
+C9FC5BA25B5B1201A312035BA21207A3485AA5121F5BA26C5AEA0780294074BD2D>I<EC
+03FC91381FFF8091387C07E0903901F001F0903903C000F84948137C49C7123E131E013E
+141F133C137C137813F8A3163F486C143E167E6D147C6C6C14FC6E13F89138C001F09138
+F003E090397FF807C09138FC0F0090383FFF3E6D13F86D13E06D7F01017F8101077F9039
+1F1FFF80D93E0F13C0EBF8072601F00113E048486C13F04848137F4848131F001FEC0FF8
+90C71207003E1403A2481401A300FC15F05AA3ED03E0A26CEC07C0007C1580007E140F00
+3EEC1F00003F143E6C6C5B6C6C485A3907F00FE00001B512806C6C48C7FCEB0FF0283F7A
+BC2D>I<EC07F8EC3FFE9138FC0F80903901F007C0903907E003E0D90FC013F090381F80
+01013F14F8EB7F004914FC48481300A24848EB01FEA21207A3485AA41503121F5BA31507
+A2000F15FC150FA2151F1207153F000315F86C6C137F000014EF90387C01CF90393E078F
+F090380FFE1FEB03F890C713E0A2ED3FC0A3ED7F8016005D003F5C487E4A5A00FF495A5D
+4A5A49485A48495A007049C7FC0078137E383E03FC381FFFF06C13C0D801FEC8FC273F79
+BC2D>I<17E016011603831607A2160FA2161F83163FA2167F167716F7EEE7FCED01E316
+C3150316831507EE03FEED0F01150E151E151C153C03387FED7800157015F05D4A488017
+7F4A5AA24AC7FCA2020E81173F5C021FB6FC5CA20270C7EA3FE0171F5CA2495AA2494881
+170F49C8FCA2130EA24982013C1507A2137CD801FE4B7E2607FF80EC3FFEB500F00107B5
+12FC19F85E3E417DC044>65 D<013FB7FC18E018FC903B007FE00007FE6E48903801FF80
+9438007FC05DF03FE0F01FF0A3027F16F892C8FCA54A16F04A153F19E0187F19C0F0FF80
+01014B13004A4A5A4D5AEF1FF04D5ADC03FFC7FC49B612F8EFFF8002F8C7EA3FE0EF0FF0
+EF07FC717E010715014A81711380A319C0130F5CA5011F4B13805C19005F601707013F4B
+5A4A4A5A4D5A4D5A017F913801FF8001FF020F90C7FCB812FC17F094C8FC3D3E7DBD40>
+I<DCFFC01338030F01F01378037F01FC13F0913A01FF803F01913A07FC000781DA1FE0EB
+03C3DA7FC0EB01E74AC812FF4948ED7FE0D907FC153F495A4948151F495A4948150F4948
+16C018074890C9FC485AA2485A000F1880491603121FA248481607A295C7FC485AA412FF
+5BA75BA2181C183C1838A27F007F1778187018F0003F5F6D150160001F16036C6C4B5A95
+C7FC6C6C5D6C6C151E6C6C5D6C6C15F86D6C495A6D6CEB07C0D91FF0EB1F80D907FE01FE
+C8FC0101B512F86D6C13E0DA07FEC9FC3D4276BF42>I<013FB7FC18E018F8903B007FF0
+000FFE6E48EB01FF9438007FC04B6E7E180F85727E727E147F4B6E7EA2727EA302FF1780
+92C9FCA54918C05CA41A8013034A5DA41A0013074A5DA261A24E5A130F4A5E180F61181F
+61011F4C5A5C4E5A4EC7FC4D5A4D5A013F4B5A4A4A5AEF3FE0EF7F80017F4A48C8FC01FF
+EC1FFCB812F0178004FCC9FC423E7DBD45>I<013FB812F8A39026007FF0C7127F6E4814
+0F18034B14011800A31978147F4B1570A502FF147092C7FCA3190017F0495D4A1301A216
+07161F91B6FC495DA29138FC003F160F1607160301075D5CA219E0180119C0010FEC0700
+4A90C712031980A218071900011F5E5C181EA2183E183C013F167C4A15FC4D5A1707017F
+151F01FF4AB45AB9FCA2603D3E7DBD3E>I<013FB812E0A3903A007FF000016E48EB003F
+180F4B14071803A31801147F4B15C0A514FF92C71270A395C7FC17F0495D5C1601160316
+07161F49B65AA39138FC003F160F160701075D4A1303A5010F4AC8FC5C93C9FCA4131F5C
+A5133F5CA3137FEBFFF0B612F8A33B3E7DBD3B>I<4BB46C1370031F01F013F0037F9038
+FC01E0913A03FF807E03913A0FF8000F83DA1FE0EB07C7DA7F80EB01EF4AC812FFD903FE
+16C04948157F4948153F495A4948151F495A4948168091C9120F5A485AA2485A000F1800
+4982121FA248485EA295C7FC485AA412FF5BA6043FB512E05BA29339001FFC00715AA260
+7F127FA2171F123F6D5EA2121F7F000F163F6C7E6C6C4B5A7F6C6C15FF6C6DEB01EFD93F
+C0EB07C7D91FF0EB1F87D907FE9038FE03800101B5EAF8016D6C01E0C8FCDA07FEC9FC3C
+4276BF47>I<013FB5D8F807B6FC04F015FEA29026007FF0C7380FFE006E486E5AA24B5D
+A4180F147F4B5DA4181F14FF92C85BA4183F5B4A5EA491B8FC5B6102FCC8127FA318FF13
+074A93C7FCA45F130F4A5DA41703131F4A5DA41707133F4A5DA3017F150F496C4A7EB6D8
+E01FB512FC6115C0483E7DBD44>I<011FB512FC5BA29039003FF8006E5AA25DA5143F5D
+A5147F5DA514FF92C7FCA55B5CA513035CA513075CA5130F5CA5131F5CA3133F497E007F
+B512F0A2B6FC263E7EBD21>I<013FB500F8010FB5FC4C5BA29026007FF0C7000313E06E
+486E130019FC4B15F04E5A4E5A4E5A061EC7FC027F5D4B5C4D5A4D5AEF07804DC8FC02FF
+141E92C7127C5FEE01E04C5A4C5A49021FC9FC4A5B5E4C7E5D03077F01035B9139FC1F3F
+E0153C4B6C7E15F09139FFE00FF84913C092380007FC5C4A6D7E5C707E130F4A6D7F8417
+7F717EA2011F6F7E5C717EA2717EA2013F6F7E5C84A2017F83496C4A13E0B600E0017F13
+FFA24B90B6FC483E7DBD47>75 D<013FB512FEA25E9026007FF8C8FCEC3FE0A25DA5147F
+5DA514FF92C9FCA55B5CA513035CA513075CA21838A21870130F5CA218E0A3011F15014A
+15C01703A21707EF0F80013F151F4A143F177FEFFF00017F140301FF143FB9FC5FA2353E
+7DBD39>I<90263FFFF093381FFFF85013F0629026007FF8EFF000023F4D5AA2023B9338
+01DFC0A2DA39FCED039FA2F1073F14790271040E5BEC70FE191C19381A7F02F01670DAE0
+7F94C7FC19E0A2F001C06201016D6C495A02C05FF00700A2180E6F6C14010103161C0280
+03385BA218706F7EF0E00313070200DA01C05BA2923907F00380A294380700075B010E90
+2603F80E5C5FA25F190F011E6D6C5A011C605FA2EEFDC0DB00FF141F013C5D013860013C
+92C7FC017C5C01FE027E143F2607FF80017C4A7EB500FC037FB512E004785E4A1338553E
+7CBD53>I<90263FFFE0023FB5FC6F16FEA29026003FF8020313C0021F030013004A6C15
+7C023B163C6F15381439810238167802787FDA707F157082153F82031F15F002F07FDAE0
+0F5D8215078203031401010180DAC0015D82811780047F1303010315C04A013F5C17E016
+1F17F0040F1307010715F891C7000791C7FC17FC160317FE04015B4915FF010E6E130E18
+8E177F18CEEF3FDE011E16FE011C6F5AA2170FA21707133C01386F5A133C017C150113FE
+2607FF801400B512FC18705C483E7DBD44>I<923803FF80031F13F09238FE01FE913903
+F0003FDA0FC0EB1FC0DA3F80EB07E0027EC76C7E49486E7E49488149486E7E4948157F49
+5A013F17804948ED3FC049C9FCA24848EE1FE012035B000718F05B120FA2485A19F8123F
+5BA2127FA219F04848163FA5F07FE0A35BF0FFC0A219805F19007F4D5A127F4D5A60003F
+160F6D5E001F4C5A4D5A6C6C4B5A95C7FC6C6C15FE00034B5A6C6C4A5A6C6C4A5A017FEC
+1FC06D6C495AD90FE001FEC8FC903903F807F80100B512C0DA0FFCC9FC3D4276BF47>I<
+013FB612FEEFFFE018F8903B007FF0000FFC6E48EB01FF7113804BEC7FC0183F19E0F01F
+F0A2147F5D19F8A402FFED3FF092C8FCA219E0A2F07FC05B4AEDFF8019004D5A4D5AEF0F
+F80103ED3FE04A903801FF8091B648C7FC17F002FCCAFCA213075CA5130F5CA5131F5CA5
+133F5CA3137F497EB612E0A25D3D3E7DBD3E>I<013FB612F017FF18E0903B007FF0003F
+F86E48EB07FCEF01FE4B6D7EF07F8019C0183F19E0147F4B15F0A502FFED7FE092C8FCA2
+19C0F0FF80A2494B13004A5D4D5AEF0FF04D5AEF7F800103DA07FEC7FC91B612F0178091
+39FC0007E0EE03F8EE00FC0107814A147F717EA284A2130F5CA484011F157F5CA4190201
+3F17075CA2F0F00F017F170E496C143FB600E0011F131C94380FF83C4B01071378CA3801
+FFE09438003F8040407DBD43>82 D<9238FF80070207EBE00F021FEBF81E91387F00FE02
+FCEB1F3ED903F0EB0FFE49481307494813034AEB01FC49C7FC491400133E137E177C4915
+78A57F1770A26D1500808080EB7FFEECFFE06D13FEEDFFC06D14F06D14FC010380010080
+143F02031480DA003F13C015031500EE7FE0163F161FA2160F121CA31607160F003C16C0
+A31780003E151F1700007E5D007F153E6D5C16FC01E0495AD87DF0495AD8FCFCEB0FC03A
+F87F803F8027F01FFFFEC7FCD8E00713F839C0007FC030427BBF33>I<0007B912F0A33C
+0FFE000FF8003F01F0160F01C04A13034848160190C7FC121EF000E048141F5E1238A212
+781270153F5E5AA3C81600157F5EA515FF93C9FCA55C5DA514035DA514075DA5140F5DA3
+141FEC7FFC0003B7FCA33C3D76BC42>I<B600E090B512FC4B15F8A2000101C0C7000F13
+006C49EC03FCEF01F091C9FC60A317015A495EA417031203495EA4170712074993C7FCA4
+5F120F49150EA4171E121F49151CA4173C123F491538A31778177017F05F001F15015F16
+036D4A5A000F93C8FC5E6C6C141E6C6C5C000115F86C6C495A017FEB07C090393FC03F80
+90260FFFFEC9FC010313F89038007FC03E4073BD44>I<B6020FB5FC19FEA2000301E002
+0113E06C01809138007F8091C9EA7E006C173C18386E15781870017F16F0604D5A804D5A
+133F4DC7FCA26E140E171E011F151C173C17386E1478010F15705FA24C5A8001074A5AA2
+4CC8FC5E6E130E0103141E161C163C16386E5B13015EA24B5A14FF6D495AA24BC9FC5D15
+8EEC7F9E159C15B8A215F0143F5DA25DA26E5AA292CAFCA2140E404074BD44>I<B6017F
+B5D88007B512804A1A00A2000701C0010101E0C713F06C90C80180EC3FC06C48735A99C7
+FC057F150E1B1E6D191C6C1A3C1B3805FF15787214705E636EEB03BF017F4E5AEE073F50
+5A040E7F051F4AC8FC161C6E170E013F143862167804706D5BEEF00F04E05D90381FE001
+04C015F003035E0480140106F85B9226070007130302F05F010F010E150797C9FC5D190E
+4BEB03FC616E5A01075F5D61DAF9C014FE05015BECFB8002FF6F5A7F92C75CA24A93CAFC
+835C606D5A605C604A15781870594074BD5D>I<010FB500F090B512F85B5FD9003F9026
+80003F1300DA0FFEC7EA1FF84BEC0FE00207168096C7FC6E6C141E181C6E6C143C606E6D
+5B4D5ADB7FC05B4D5A92383FE0074DC8FC92381FF01E171C6F6C5A5F923807FCF0EEFDE0
+6FB45A5F6F90C9FCA26F7FA2707EA216FF4B7FED03DF9238079FF0ED0F1F92380E0FF815
+1C92383C07FC15784B6C7EEC01E04B6C7EEC038002076D7F4AC7FC021E6E7E5C02386E7E
+5C02F06E7E495A49486E7E130749486E7E497E017F4B7E2603FFF091383FFF80007F01FC
+49B512FEB55CA2453E7EBD44>I<B66C0103B51280A3000101F0C8EBF0006C49ED7FC06D
+486FC7FC6E153E013F163C606D6C5D606D6C4A5A17036D6C4A5A95C8FC6E140E0103151E
+5F6D6C14385F6D6D13F04C5ADA7FC05B4C5AEDE007023F49C9FC161E91381FF01C5E9138
+0FF8785E6E6C5AEDFDC015FF6E5B93CAFC6E5AA35DA21403A45DA21407A45DA2140FA414
+1F4A7E013FB512F0A3413E75BD44>I<010FB712FEA39239C00007FCD91FFCC7EA0FF814
+F04AEC1FF00280EC3FE091C8EA7FC0013EEDFF80A2013C4A13004C5A494A5A4C5A13704C
+5A4C5A494A5A4C5AA290C74890C7FC4B5A4B5A4B5AA24B5A4B5A4B5A4B5AA24A90C8FC4A
+5A4A5A4A5AA24A5A4A5A4A48EB01C04A5AEF03804990C7FC495A495A494814071800495A
+49485C495A495A171E4890C8123E485A4848157E484815FE4C5A484814074848141F4848
+EB01FFB8FC5FA2373E7BBD38>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fi cmbx10 10.95 52
-/Fi 52 123 df<EDFFF8020F13FF027F8049B612E001079038C01FF090390FFE0007D91F
+%DVIPSBitmapFont: Fi cmbx10 10.95 50
+/Fi 50 123 df<EDFFF8020F13FF027F8049B612E001079038C01FF090390FFE0007D91F
 F8497ED93FE0131F4948497E13FF5C5A91C7FCA2705A705AEE03C093C8FCA6EE03FCB8FC
 A50001903880001F160FB3AB007FD9FE03B512F0A534407EBF3A>12
 D<B612E0A91B097F9823>45 D<ECFFE0010713FC011F13FF017F14C0D9FFE07F48903880
@@ -1205,133 +1232,125 @@ F02B3D7CBB34>I<903801FFE0010F13FC013F13FF90B612C04801E07F489038003FF048
 486D7E000F6E7E485A6F7E123F48488081178012FFA217C0A517E0A4007F5CA4003F5C6C
 7E5D6C7E00075C3903FF80FB6C13FF6C6C13F36D13C3010F018313C090380008031400A2
 4B1380EA03F0487E486C1500487E4B5AA25E151F4B5A495C6C48EBFFE049485B2607FC0F
-5B6CB6C7FC6C14FC6C14F06D13C0D90FFEC8FC2B3D7CBB34>I<EA0FC0EA1FE0EA3FF0EA
-7FF8EAFFFCA6EA7FF8EA3FF0EA1FE0EA0FC0C7FCACEA0FC0EA1FE0EA3FF0EA7FF8EAFFFC
-A6EA7FF8EA3FF0EA1FE0EA0FC00E2879A71D>I<16FCA24B7EA24B7EA34B7FA24B7FA34B
-7FA24B7FA34B7F157C03FC7FEDF87FA2020180EDF03F0203804B7E02078115C082020F81
-4B7E021F811500824A81023E7F027E81027C7FA202FC814A147F49B77EA34982A2D907E0
-C7001F7F4A80010F835C83011F8391C87E4983133E83017E83017C81B500FC91B612FCA5
-463F7CBE4F>65 D<B812F8EFFF8018F018FC8426003FFCC7EA3FFF050F13807113C07113
-E08319F0A27113F8A719F05FA24D13E019C04D13804D1300EF3FFE933801FFF891B712E0
-188018F818FE02FCC7380FFF80050313C07113E07113F019F8F07FFCA2F03FFEA219FFA3
-8460A419FE187FA2F0FFFC4D13F85F4D13F0053F13E0BA12C0190018FC18F095C7FC403E
-7DBD4A>I<922607FFC0130E92B500FC131E020702FF133E023FEDC07E91B7EAE1FE0103
-9138803FFB499039F80003FF4901C01300013F90C8127F4948151FD9FFF8150F48491507
-485B4A1503481701485B18004890CAFC197E5A5B193E127FA349170012FFAC127F7F193E
-A2123FA27F6C187E197C6C7F19FC6C6D16F86C6D150119F06C6D15036C6DED07E0D97FFE
-ED0FC06D6CED3F80010F01C0ECFF006D01F8EB03FE6D9039FF801FFC010091B55A023F15
-E002071580020002FCC7FC030713C03F407ABE4C>I<B812F8EFFF8018F018FC18FF2600
-3FFCC76C13C005077F05017F716C7E727E727E727E721380A27213C0A27213E0A21AF084
-A21AF8A41AFCA5197FA319FFA51AF8A41AF0A2601AE0A24E13C0A24E13804E1300604E5A
-4E5A4D485A050713E0057F5BBA5A4EC7FC18F818C005F8C8FC463E7DBD50>I<BAFCA419
-8026003FFEC7123F1707170183183FA2181FF00FC0A31807EE07C0A3F003E0A3160F95C7
-FC161F163F16FF91B6FCA54AC6FC163F161F040F147CA2160719F8A593C71201A219F018
-03A21807A2180FF01FE0183F18FF1703173FBAFCA219C0A33E3D7DBC45>I<B912FEA484
-26003FFEC77E170F1703170084A284F01F80A3180FA2EE07C0A2F007C0A4040F90C7FCA2
-161F163F16FF91B6FCA54AC6FC163F161F160FA21607A693C9FCACB712E0A53A3D7DBC42
->I<922607FFC0130E92B500FC131E020702FF133E023FEDC07E91B7EAE1FE0103913880
-3FFB499039F80003FF4901C01300013F90C8127F4948151FD9FFF8150F48491507485B4A
-1503481701485B18004890CAFC197E5A5B193E127FA34994C7FC12FFAB0407B612FC127F
-7FA3003F92C7383FFE00A27F7EA26C7FA26C7F6C7FA26C7F6C7FD97FFE157F6D6C7E010F
-01E014FF6D01F813036D9038FF801F010091B512F3023F15C00207ED803E02009138FE00
-0E030701E090C7FC46407ABE52>I<B71280A526003FFEC7FCB3B3B0B71280A5213E7DBD
-28>73 D<B76C90B6FCA526003FFEC8D801FCC7FCF007F84E5A4E5AF03F804EC8FC18FEEF
-03FC4D5A4D5AEF1FC04D5A4DC9FCEE01FE4C5A4C5AEE0FE04C5A4C5A16FF4B7F4B7F5D4B
-7F4B7F037F7F92B5FC6E486C7E9238F83FFF03F0804B7E4B6C7F4B6C7F0300804A7F707F
-707F84717E83717F85717F83717F85717F83727E85727F84B7D88007B612C0A54A3E7DBD
-52>75 D<B712E0A526003FFEC9FCB3AD183EA4187E187CA418FCA21701A2EF03F8A21707
-170F171F177FEE01FF160FB9FC18F0A4373E7DBD3F>I<B6037FB512E0A2818181D8003F
-6D9139001F800081A281816E7E6E7F6E7F80826E7F6E7F6E7F6E7F157F826F7F6F7F6F7F
-6F7F81836F7F6F7F707E701380A27013C07013E07013F07013F87013FCA27013FEEF7FFF
-71139F7113DF8319FF8383838384A28484848484A284B600C080197F193F191FA24B3E7D
-BD52>78 D<ED3FFF0203B512F0021F14FE027F6E7E902701FFF80713E00107D9C00013F8
-4990C7EA3FFCD93FFCEC0FFF49486E7F49486E7F48496E7F4A80488448496F7EA24890C9
-6C7E4884A249161F003F84A34848701380A400FF19C0AD007F19806D5EA3003F1900A26D
-5E6C60A26C6D4B5AA26C6D4B5A6C6D4A5BA26C6D4A5B6C6D4A5B6D6C4A5B6DB4023F90C7
-FC6D01C0EBFFFE0107D9F80713F8010190B612E06D5E021F4AC8FC020314F0DA003F90C9
-FC42407ABE4F>I<B812F017FF18C018F018FC26003FFCC77FEF1FFF7113807113C07113
-E0A27113F0A319F8A819F0A34D13E019C05F4D1380053F1300EFFFFE91B712F860188005
-FCC7FC4ACAFCB3A4B77EA53D3E7DBD47>I<B87E17FCEFFF8018F08428003FFC000113FE
-9338003FFF050F7F717F717FA2858385A761A25F61614D5B4D90C8FCEF3FFE4CB45A91B7
-12F018C04DC9FC717E9126FC000F7F040113F0707F717EA2717EA2717EA685A6F207C019
-C0A271140F07E01380B76DEBF01F719038FC3F007190B5FC716C5B061F13F8CB000113E0
-4A3F7DBD4E>82 D<903A03FFC001C0011FEBF803017FEBFE0748B6128F4815DF48010013
-FFD80FF8130F48481303497F4848EB007F127F49143F161F12FF160FA27F1607A27F7F01
-FC91C7FCEBFF806C13F8ECFFC06C14FCEDFF806C15E016F86C816C816C816C16806C6C15
-C07F010715E0EB007F020714F0EC003F1503030013F8167F163F127800F8151FA2160FA2
-7EA217F07E161F6C16E06D143F01E015C001F8EC7F8001FEEB01FF9026FFE00713004890
-B55A486C14F8D8F81F5CD8F00314C027E0003FFEC7FC2D407ABE3A>I<003FB912FCA590
-3BFE003FFE003FD87FF0EE0FFE01C0160349160190C71500197E127EA2007C183EA400FC
-183F48181FA5C81600B3AF010FB712F8A5403D7CBC49>I<903807FFC0013F13F848B6FC
-48812607FE037F260FF8007F6DEB3FF0486C806F7EA36F7EA26C5A6C5AEA01E0C8FC153F
-91B5FC130F137F3901FFFE0F4813E0000F1380381FFE00485A5B485A12FF5BA4151F7F00
-7F143F6D90387BFF806C6C01FB13FE391FFF07F36CEBFFE100031480C6EC003FD91FF890
-C7FC2F2B7DA933>97 D<13FFB5FCA512077EAFEDFFE0020713FC021FEBFF80027F80DAFF
-8113F09139FC003FF802F06D7E4A6D7E4A13074A80701380A218C082A318E0AA18C0A25E
-1880A218005E6E5C6E495A6E495A02FCEB7FF0903AFCFF01FFE0496CB55AD9F01F91C7FC
-D9E00713FCC7000113C033407DBE3A>I<EC7FF00107B5FC011F14C0017F14E09039FFF0
-1FF0489038800FF848EB001F4848EB3FFC120F485AA2485AA2007FEC1FF849EB0FF0ED03
-C000FF91C7FCAB127F7FA3003F153E7F001F157E6C6C147C6C6C14FC91388001F86C9038
-C003F0C69038F81FE06DB512C0011F14800107EBFE009038007FF0272B7DA92E>I<EE07
-F8ED07FFA5ED003F161FAFEC7FF0903807FFFE011FEBFF9F017F14DF9039FFF01FFF48EB
-C00348EB00014848EB007F485A001F153F5B123FA2127F5BA212FFAA127FA37F123FA26C
-6C147F120F6D14FF6C6C01037F6C6D48EBFFE06CEBF03F6C6CB512BF6D143F010713FC01
-0001E0EBE00033407DBE3A>I<ECFFF0010713FE011F6D7E017F809039FFE07FE0489038
-801FF048496C7E48486D7E48486D7E121F491301003F81A2485A6F1380A212FFA290B7FC
-A401F0C9FCA5127FA27F123FEE0F806C7E161F6C6C15006C6C5C6C6D137E6C9038E001FC
-6C9038F80FF8013FB55A6D14C0010391C7FC9038007FF8292B7DA930>I<EC07FE91387F
-FF8049B512C0010714E090390FFE3FF0EB1FF090393FE07FF8EB7FC013FF1480A2489038
-003FF0ED1FE0ED0FC092C7FCAAB612E0A500010180C7FCB3AC007FEBFF80A525407DBF20
->I<903A03FF8007F0013F9038F83FF8499038FCFFFC48B712FE48018313F93A07FC007F
-C34848EB3FE1001FEDF1FC4990381FF0F81700003F81A7001F5DA26D133F000F5D6C6C49
-5A3A03FF83FF8091B5C7FC4814FC01BF5BD80F03138090CAFCA2487EA27F13F06CB6FC16
-F016FC6C15FF17806C16C06C16E01207001F16F0393FE000034848EB003F49EC1FF800FF
-150F90C81207A56C6CEC0FF06D141F003F16E001F0147FD81FFC903801FFC02707FF800F
-13006C90B55AC615F8013F14E0010101FCC7FC2F3D7DA834>I<13FFB5FCA512077EAFED
-1FF8EDFFFE02036D7E4A80DA0FE07F91381F007F023C805C4A6D7E5CA25CA35CB3A4B5D8
-FE0FB512E0A5333F7CBE3A>I<EA01F8487E487E487E481380A66C13006C5A6C5A6C5AC8
-FCA913FFB5FCA512077EB3ABB512F8A515407CBF1D>I<13FFB5FCA512077EB3B3AFB512
-FCA5163F7CBE1D>108 D<01FFD91FF8ECFFC0B590B5010713F80203DAC01F13FE4A6E48
-7FDA0FE09026F07F077F91261F003FEBF8010007013EDAF9F0806C0178ECFBC04A6DB448
-6C7FA24A92C7FC4A5CA34A5CB3A4B5D8FE07B5D8F03FEBFF80A551297CA858>I<01FFEB
-1FF8B5EBFFFE02036D7E4A80DA0FE07F91381F007F0007013C806C5B4A6D7E5CA25CA35C
-B3A4B5D8FE0FB512E0A533297CA83A>I<EC7FF0903803FFFE011FEBFFC0017F14F09039
-FFE03FF8489038800FFC3A03FE0003FE48486D7E000F168048486D13C0A2003F16E04914
-7F007F16F0A400FF16F8AA007F16F0A46C6CECFFE0A2001F16C06C6C491380A26C6C4913
-003A03FF800FFE6C9038E03FFC6C6CB512F0011F14C0010791C7FC9038007FF02D2B7DA9
-34>I<01FFEBFFE0B5000713FC021FEBFF80027F80DAFF8113F09139FC007FF8000701F0
-6D7E6C496D7E4A130F4A6D7E1880A27013C0A38218E0AA4C13C0A318805E18005E6E5C6E
-495A6E495A02FCEBFFF0DAFF035B92B55A029F91C7FC028713FC028113C00280C9FCACB5
-12FEA5333B7DA83A>I<3901FE01FE00FF903807FF804A13E04A13F0EC3F1F91387C3FF8
-000713F8000313F0EBFFE0A29138C01FF0ED0FE091388007C092C7FCA391C8FCB3A2B6FC
-A525297DA82B>114 D<90383FFC1E48B512BE000714FE5A381FF00F383F800148C7FC00
-7E147EA200FE143EA27E7F6D90C7FC13F8EBFFE06C13FF15C06C14F06C806C806C806C80
-C61580131F1300020713C014000078147F00F8143F151F7EA27E16806C143F6D140001E0
-13FF9038F803FE90B55A15F0D8F87F13C026E00FFEC7FC222B7DA929>I<EB07C0A5130F
-A4131FA3133F137FA213FF5A1207001FEBFFFEB6FCA40001EBC000B3151FA96CEBE03EA2
-017F137EECF8FC90383FFFF86D13F0010713E001001380203B7EB929>I<D9FF80EB0FF8
-B5EB0FFFA50007EC007F6C153FB3A5167FA316FF6C5C4B7F6C903AC007DFFFE09138F01F
-9F6DB5121F6D13FE010F13F8010101E0EBE000332A7CA83A>I<B500FC90383FFFC0A500
-0101C0903803E0006E1307A26C5E6E130F017F5D6E131F013F92C7FC6E5B011F143E6E13
-7E010F147C6E13FCA26D5C15816D5C15C36D5C15E76D5C15FF6E5BA36E90C8FCA26E5AA2
-6E5AA26E5AA26E5AA232287EA737>I<B53CFC3FFFFC03FFFEA50003D980009039C0000F
-806E161F6C037F15006E496C5B6C183E836E48157E017F177C6E486D13FC013F02EF5C83
-DAFC071401011F02C75CDAFE0FEBFE03010F02835C17FFDAFF1F14076D02015C03BF148F
-6DD9BE005C18CF03FE14DF6D49017F90C7FC18FF6D496D5AA36E486D5AA26E486D5AA36E
-486D5AA26E486D5A47287EA74C>I<B5D8FC03B51280A5C69026E0007FC7FC6E13FE6D6C
-5B6D6C485A6D6C485A010F13076D6C485AED9FC06DEBFF806D91C8FC6D5B6E5AA2143F6E
-7E140F814A7F4A7F4A7F02FE7F903801FC7F49486C7E02F07F49486C7E49486C7E011F7F
-49486C7FD97F008001FE6D7FB5D8C007EBFFC0A532287EA737>I<B500FC90383FFFC0A5
-000101C0903803E0006E1307A26C5E6E130F017F5D6E131F013F92C7FC6E5B011F143E6E
-137E010F147C6E13FCA26D5C15816D5C15C36D5C15E76D5C15FF6E5BA36E90C8FCA26E5A
-A26E5AA26E5AA26E5AA35D14075D000E130FD83F805B387FC01FD8FFE090C9FC5C143E14
-7E5CEBC1F8387FC3F0387E0FE06CB45A6C5B6C48CAFCEA03F8323B7EA737>I<003FB612
-F8A4D9F80113F001C014E0495A494813C04A1380007E15005C4A5A007C5C147F4A5A495B
-5DC65A495B495BA249EB007C495A5C137F494813FC484913F85C5A48EBC0011480481403
-4813004848130749131F007FECFFF0B7FCA426287DA72E>I E
+5B6CB6C7FC6C14FC6C14F06D13C0D90FFEC8FC2B3D7CBB34>I<16FCA24B7EA24B7EA34B
+7FA24B7FA34B7FA24B7FA34B7F157C03FC7FEDF87FA2020180EDF03F0203804B7E020781
+15C082020F814B7E021F811500824A81023E7F027E81027C7FA202FC814A147F49B77EA3
+4982A2D907E0C7001F7F4A80010F835C83011F8391C87E4983133E83017E83017C81B500
+FC91B612FCA5463F7CBE4F>65 D<B812F8EFFF8018F018FC8426003FFCC7EA3FFF050F13
+807113C07113E08319F0A27113F8A719F05FA24D13E019C04D13804D1300EF3FFE933801
+FFF891B712E0188018F818FE02FCC7380FFF80050313C07113E07113F019F8F07FFCA2F0
+3FFEA219FFA38460A419FE187FA2F0FFFC4D13F85F4D13F0053F13E0BA12C0190018FC18
+F095C7FC403E7DBD4A>I<922607FFC0130E92B500FC131E020702FF133E023FEDC07E91
+B7EAE1FE01039138803FFB499039F80003FF4901C01300013F90C8127F4948151FD9FFF8
+150F48491507485B4A1503481701485B18004890CAFC197E5A5B193E127FA349170012FF
+AC127F7F193EA2123FA27F6C187E197C6C7F19FC6C6D16F86C6D150119F06C6D15036C6D
+ED07E0D97FFEED0FC06D6CED3F80010F01C0ECFF006D01F8EB03FE6D9039FF801FFC0100
+91B55A023F15E002071580020002FCC7FC030713C03F407ABE4C>I<B812F8EFFF8018F0
+18FC18FF26003FFCC76C13C005077F05017F716C7E727E727E727E721380A27213C0A272
+13E0A21AF084A21AF8A41AFCA5197FA319FFA51AF8A41AF0A2601AE0A24E13C0A24E1380
+4E1300604E5A4E5A4D485A050713E0057F5BBA5A4EC7FC18F818C005F8C8FC463E7DBD50
+>I<BAFCA4198026003FFEC7123F1707170183183FA2181FF00FC0A31807EE07C0A3F003
+E0A3160F95C7FC161F163F16FF91B6FCA54AC6FC163F161F040F147CA2160719F8A593C7
+1201A219F01803A21807A2180FF01FE0183F18FF1703173FBAFCA219C0A33E3D7DBC45>
+I<B912FEA48426003FFEC77E170F1703170084A284F01F80A3180FA2EE07C0A2F007C0A4
+040F90C7FCA2161F163F16FF91B6FCA54AC6FC163F161F160FA21607A693C9FCACB712E0
+A53A3D7DBC42>I<922607FFC0130E92B500FC131E020702FF133E023FEDC07E91B7EAE1
+FE01039138803FFB499039F80003FF4901C01300013F90C8127F4948151FD9FFF8150F48
+491507485B4A1503481701485B18004890CAFC197E5A5B193E127FA34994C7FC12FFAB04
+07B612FC127F7FA3003F92C7383FFE00A27F7EA26C7FA26C7F6C7FA26C7F6C7FD97FFE15
+7F6D6C7E010F01E014FF6D01F813036D9038FF801F010091B512F3023F15C00207ED803E
+02009138FE000E030701E090C7FC46407ABE52>I<B7D8803FB612E0A526003FFEC8000F
+EB8000B3A491B9FCA54AC8120FB3A7B7D8803FB612E0A54B3E7DBD52>I<B71280A52600
+3FFEC7FCB3B3B0B71280A5213E7DBD28>I<B712E0A526003FFEC9FCB3AD183EA4187E18
+7CA418FCA21701A2EF03F8A21707170F171F177FEE01FF160FB9FC18F0A4373E7DBD3F>
+76 D<B6037FB512E0A2818181D8003F6D9139001F800081A281816E7E6E7F6E7F80826E
+7F6E7F6E7F6E7F157F826F7F6F7F6F7F6F7F81836F7F6F7F707E701380A27013C07013E0
+7013F07013F87013FCA27013FEEF7FFF71139F7113DF8319FF8383838384A28484848484
+A284B600C080197F193F191FA24B3E7DBD52>78 D<ED3FFF0203B512F0021F14FE027F6E
+7E902701FFF80713E00107D9C00013F84990C7EA3FFCD93FFCEC0FFF49486E7F49486E7F
+48496E7F4A80488448496F7EA24890C96C7E4884A249161F003F84A34848701380A400FF
+19C0AD007F19806D5EA3003F1900A26D5E6C60A26C6D4B5AA26C6D4B5A6C6D4A5BA26C6D
+4A5B6C6D4A5B6D6C4A5B6DB4023F90C7FC6D01C0EBFFFE0107D9F80713F8010190B612E0
+6D5E021F4AC8FC020314F0DA003F90C9FC42407ABE4F>I<B812F017FF18C018F018FC26
+003FFCC77FEF1FFF7113807113C07113E0A27113F0A319F8A819F0A34D13E019C05F4D13
+80053F1300EFFFFE91B712F860188005FCC7FC4ACAFCB3A4B77EA53D3E7DBD47>I<B87E
+17FCEFFF8018F08428003FFC000113FE9338003FFF050F7F717F717FA2858385A761A25F
+61614D5B4D90C8FCEF3FFE4CB45A91B712F018C04DC9FC717E9126FC000F7F040113F070
+7F717EA2717EA2717EA685A6F207C019C0A271140F07E01380B76DEBF01F719038FC3F00
+7190B5FC716C5B061F13F8CB000113E04A3F7DBD4E>82 D<903A03FFC001C0011FEBF803
+017FEBFE0748B6128F4815DF48010013FFD80FF8130F48481303497F4848EB007F127F49
+143F161F12FF160FA27F1607A27F7F01FC91C7FCEBFF806C13F8ECFFC06C14FCEDFF806C
+15E016F86C816C816C816C16806C6C15C07F010715E0EB007F020714F0EC003F15030300
+13F8167F163F127800F8151FA2160FA27EA217F07E161F6C16E06D143F01E015C001F8EC
+7F8001FEEB01FF9026FFE00713004890B55A486C14F8D8F81F5CD8F00314C027E0003FFE
+C7FC2D407ABE3A>I<003FB912FCA5903BFE003FFE003FD87FF0EE0FFE01C01603491601
+90C71500197E127EA2007C183EA400FC183F48181FA5C81600B3AF010FB712F8A5403D7C
+BC49>I<903807FFC0013F13F848B6FC48812607FE037F260FF8007F6DEB3FF0486C806F
+7EA36F7EA26C5A6C5AEA01E0C8FC153F91B5FC130F137F3901FFFE0F4813E0000F138038
+1FFE00485A5B485A12FF5BA4151F7F007F143F6D90387BFF806C6C01FB13FE391FFF07F3
+6CEBFFE100031480C6EC003FD91FF890C7FC2F2B7DA933>97 D<13FFB5FCA512077EAFED
+FFE0020713FC021FEBFF80027F80DAFF8113F09139FC003FF802F06D7E4A6D7E4A13074A
+80701380A218C082A318E0AA18C0A25E1880A218005E6E5C6E495A6E495A02FCEB7FF090
+3AFCFF01FFE0496CB55AD9F01F91C7FCD9E00713FCC7000113C033407DBE3A>I<EC7FF0
+0107B5FC011F14C0017F14E09039FFF01FF0489038800FF848EB001F4848EB3FFC120F48
+5AA2485AA2007FEC1FF849EB0FF0ED03C000FF91C7FCAB127F7FA3003F153E7F001F157E
+6C6C147C6C6C14FC91388001F86C9038C003F0C69038F81FE06DB512C0011F14800107EB
+FE009038007FF0272B7DA92E>I<EE07F8ED07FFA5ED003F161FAFEC7FF0903807FFFE01
+1FEBFF9F017F14DF9039FFF01FFF48EBC00348EB00014848EB007F485A001F153F5B123F
+A2127F5BA212FFAA127FA37F123FA26C6C147F120F6D14FF6C6C01037F6C6D48EBFFE06C
+EBF03F6C6CB512BF6D143F010713FC010001E0EBE00033407DBE3A>I<ECFFF0010713FE
+011F6D7E017F809039FFE07FE0489038801FF048496C7E48486D7E48486D7E121F491301
+003F81A2485A6F1380A212FFA290B7FCA401F0C9FCA5127FA27F123FEE0F806C7E161F6C
+6C15006C6C5C6C6D137E6C9038E001FC6C9038F80FF8013FB55A6D14C0010391C7FC9038
+007FF8292B7DA930>I<EC07FE91387FFF8049B512C0010714E090390FFE3FF0EB1FF090
+393FE07FF8EB7FC013FF1480A2489038003FF0ED1FE0ED0FC092C7FCAAB612E0A5000101
+80C7FCB3AC007FEBFF80A525407DBF20>I<903A03FF8007F0013F9038F83FF8499038FC
+FFFC48B712FE48018313F93A07FC007FC34848EB3FE1001FEDF1FC4990381FF0F8170000
+3F81A7001F5DA26D133F000F5D6C6C495A3A03FF83FF8091B5C7FC4814FC01BF5BD80F03
+138090CAFCA2487EA27F13F06CB6FC16F016FC6C15FF17806C16C06C16E01207001F16F0
+393FE000034848EB003F49EC1FF800FF150F90C81207A56C6CEC0FF06D141F003F16E001
+F0147FD81FFC903801FFC02707FF800F13006C90B55AC615F8013F14E0010101FCC7FC2F
+3D7DA834>I<13FFB5FCA512077EAFED1FF8EDFFFE02036D7E4A80DA0FE07F91381F007F
+023C805C4A6D7E5CA25CA35CB3A4B5D8FE0FB512E0A5333F7CBE3A>I<EA01F8487E487E
+487E481380A66C13006C5A6C5A6C5AC8FCA913FFB5FCA512077EB3ABB512F8A515407CBF
+1D>I<13FFB5FCA512077EB3B3AFB512FCA5163F7CBE1D>108 D<01FFD91FF8ECFFC0B590
+B5010713F80203DAC01F13FE4A6E487FDA0FE09026F07F077F91261F003FEBF801000701
+3EDAF9F0806C0178ECFBC04A6DB4486C7FA24A92C7FC4A5CA34A5CB3A4B5D8FE07B5D8F0
+3FEBFF80A551297CA858>I<01FFEB1FF8B5EBFFFE02036D7E4A80DA0FE07F91381F007F
+0007013C806C5B4A6D7E5CA25CA35CB3A4B5D8FE0FB512E0A533297CA83A>I<EC7FF090
+3803FFFE011FEBFFC0017F14F09039FFE03FF8489038800FFC3A03FE0003FE48486D7E00
+0F168048486D13C0A2003F16E049147F007F16F0A400FF16F8AA007F16F0A46C6CECFFE0
+A2001F16C06C6C491380A26C6C4913003A03FF800FFE6C9038E03FFC6C6CB512F0011F14
+C0010791C7FC9038007FF02D2B7DA934>I<01FFEBFFE0B5000713FC021FEBFF80027F80
+DAFF8113F09139FC007FF8000701F06D7E6C496D7E4A130F4A6D7E1880A27013C0A38218
+E0AA4C13C0A318805E18005E6E5C6E495A6E495A02FCEBFFF0DAFF035B92B55A029F91C7
+FC028713FC028113C00280C9FCACB512FEA5333B7DA83A>I<3901FE01FE00FF903807FF
+804A13E04A13F0EC3F1F91387C3FF8000713F8000313F0EBFFE0A29138C01FF0ED0FE091
+388007C092C7FCA391C8FCB3A2B6FCA525297DA82B>114 D<90383FFC1E48B512BE0007
+14FE5A381FF00F383F800148C7FC007E147EA200FE143EA27E7F6D90C7FC13F8EBFFE06C
+13FF15C06C14F06C806C806C806C80C61580131F1300020713C014000078147F00F8143F
+151F7EA27E16806C143F6D140001E013FF9038F803FE90B55A15F0D8F87F13C026E00FFE
+C7FC222B7DA929>I<EB07C0A5130FA4131FA3133F137FA213FF5A1207001FEBFFFEB6FC
+A40001EBC000B3151FA96CEBE03EA2017F137EECF8FC90383FFFF86D13F0010713E00100
+1380203B7EB929>I<D9FF80EB0FF8B5EB0FFFA50007EC007F6C153FB3A5167FA316FF6C
+5C4B7F6C903AC007DFFFE09138F01F9F6DB5121F6D13FE010F13F8010101E0EBE000332A
+7CA83A>I<B500FC90383FFFC0A5000101C0903803E0006E1307A26C5E6E130F017F5D6E
+131F013F92C7FC6E5B011F143E6E137E010F147C6E13FCA26D5C15816D5C15C36D5C15E7
+6D5C15FF6E5BA36E90C8FCA26E5AA26E5AA26E5AA26E5AA232287EA737>I<B5D8FC03B5
+1280A5C69026E0007FC7FC6E13FE6D6C5B6D6C485A6D6C485A010F13076D6C485AED9FC0
+6DEBFF806D91C8FC6D5B6E5AA2143F6E7E140F814A7F4A7F4A7F02FE7F903801FC7F4948
+6C7E02F07F49486C7E49486C7E011F7F49486C7FD97F008001FE6D7FB5D8C007EBFFC0A5
+32287EA737>120 D<B500FC90383FFFC0A5000101C0903803E0006E1307A26C5E6E130F
+017F5D6E131F013F92C7FC6E5B011F143E6E137E010F147C6E13FCA26D5C15816D5C15C3
+6D5C15E76D5C15FF6E5BA36E90C8FCA26E5AA26E5AA26E5AA26E5AA35D14075D000E130F
+D83F805B387FC01FD8FFE090C9FC5C143E147E5CEBC1F8387FC3F0387E0FE06CB45A6C5B
+6C48CAFCEA03F8323B7EA737>I<003FB612F8A4D9F80113F001C014E0495A494813C04A
+1380007E15005C4A5A007C5C147F4A5A495B5DC65A495B495BA249EB007C495A5C137F49
+4813FC484913F85C5A48EBC00114804814034813004848130749131F007FECFFF0B7FCA4
+26287DA72E>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fj cmr10 10.95 93
-/Fj 93 124 df<4AB4EB0FE0021F9038E03FFC913A7F00F8FC1ED901FC90383FF03FD907
+%DVIPSBitmapFont: Fj cmr10 10.95 92
+/Fj 92 124 df<4AB4EB0FE0021F9038E03FFC913A7F00F8FC1ED901FC90383FF03FD907
 F090397FE07F80494801FF13FF4948485BD93F805C137F0200ED7F00EF003E01FE6D91C7
 FC82ADB97EA3C648C76CC8FCB3AE486C4A7E007FD9FC3FEBFF80A339407FBF35>11
 D<EC03FE91383FFF809138FE03E0903903F800F0D90FE013384948137C90393F8001FE90
@@ -1431,261 +1450,260 @@ EB8007391E000FE0001F495A260FC07FC7FC3803FFFE6C13F838003FC0243F7CBC2D>I<
 121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121EEA7F80A2EAFFC0A4EA7F80A2EA1E
 000A2779A619>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121E127FEAFF80A2
 13C0A4127F121E1200A412011380A3120313005A1206120E120C121C5A1230A20A3979A6
-19>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCA8120C121EAB123FACEA7F80ACEA
-FFC0A9EA7F80EA1E000A4179AC19>I<007FB912E0BA12F0A26C18E0CDFCAE007FB912E0
-BA12F0A26C18E03C167BA147>I<EB0780EB1FE0A2497EA46D5AA2EB078090C8FCA81303
-80A4130791C7FCA65BA3131EA2133E133C137CA25B1201485A485A120F485A485A127FA2
-48C7127C15FEEC01FFA480157F6C141EA26C6C133C1578390FC001E03907F00FC03901FF
-FE0038003FF020407BAC2B>I<EB1FF890B5FC3903E01FC0390F0007F0001EEB03F848EB
-01FC4814FE140000FE14FF7E7FA46CC7FC123EC7EA01FEA2EC03FCEC07F815F0EC0FC0EC
-1F80EC3F00143E5C147814F85C13015CA2495AA25CAB91C7FC90C8FCA8EB0780EB1FE0A2
-497EA46D5AA2EB078020407BBF2B>I<ED7FE0913807FFFE91391F801F809139780001E0
-D901E0EB0078D90780141E49C87E011E6F7E0138ED01C0496F7E49167000011778484882
-49D93F80131C28070001FFF07F48902607E07C130F000E90260FC01E7F001E90263F0007
-1480001C499038038003003C01FED901C013C0003849ECFE010101EC00FF267803F8027F
-13E000701700495AA200F018F000E01870495AA96D7E12F01270A26D7E007818E0263801
-FC5C01005C003C7F001C017F49EB01C0001E6DEB077F000E903B0FC01E3F8380000F903B
-07E07C1F87006C903A01FFF007FE3C0380003F8001F86D90CAFC6C7E120013707F011EEE
-03F06D160F6D6CED3FC0D901E0913801FE00D90078EC1FF0913A1F8003FF800207B500F8
-C7FC9126007FFEC8FC3C417BBF47>I<15074B7EA34B7EA34B7EA34B7EA34B7E15E7A291
-3801C7FC15C3A291380381FEA34AC67EA3020E6D7EA34A6D7EA34A6D7EA34A6D7EA34A6D
-7EA349486D7E91B6FCA249819138800001A249C87EA24982010E157FA2011E82011C153F
-A2013C820138151FA2017882170F13FC00034C7ED80FFF4B7EB500F0010FB512F8A33D41
-7DC044>I<B712FCEEFF8017F00001903980000FF86C6CC7EA03FE707E701380EF7FC0EF
-3FE0A2EF1FF0A218F8A3170F171FA318F0A2EF3FE0177F18C0EFFF804C1300EE03FCEE0F
-F8EE7FE091B6C7FC17E091C7EA07FCEE01FE933800FF80EF7FC0EF3FE0EF1FF018F8170F
-18FC1707A218FEA718FC170FA2EF1FF818F0173FEF7FE0EFFFC00403138048486C90380F
-FE00B85A17E094C7FC373E7DBD40>I<DB3FF01306912603FFFE130E020F9038FF801E91
-3A3FF007E03E9139FF8000F8D903FEC7EA7C7ED907F8EC1EFE4948140FD93FE014074948
-1403495A91C812014848150012034848167E5B000F173EA24848161EA2123F5B180E127F
-A349160012FFAC127F7F180EA2123FA27F001F171E181C6C7EA20007173C6D16386C6C16
-78000117706C6C16F06EEC01E06D6C15C06D6C1403D90FF0EC07806D6CEC1F00D903FE14
-3E902600FF8013F891393FF007F0020FB512C0020391C7FC9138003FF037427BBF42>I<
-B712FCEEFF8017E000019039C0001FF86C6C48EB03FEEE00FF717E717EEF0FE084717E71
-7E170184717EA21980187F19C0A3F03FE0A519F0AB19E0A5F07FC0A21980A218FF19004D
-5AA24D5A6017074D5A4D5AEF7FC04DC7FCEE03FE48486CEB1FF8B85A178004FCC8FC3C3E
-7DBD45>I<B912E0A300019038C000016C6C48EB001FEF0FF01703A217011700A31870A4
-18381638A41800A21678A216F81501150791B5FCA3EC8007150115001678A21638A2180E
-A3181C93C7FCA4183C1838A21878A318F8EF01F0A21707170F173F48486CEB03FFB912E0
-A3373E7DBD3E>I<B91280A300019038C000036C6C48EB007FEF1FC0170F1707A21703A3
-1701A4EF00E0A21638A31800A31678A216F81501150791B5FCA3EC8007150115001678A2
-1638A693C8FCAF3801FFE0B612F0A3333E7DBD3B>I<DB3FE0130C912603FFFE131C021F
-9038FF803C913A7FF00FC07C9139FF0001F0D903FC90380078FC4948143DD91FE0141F49
-48140F4948140701FF15034890C8FC491501485A000716005B000F177C5B001F173CA248
-5AA2181C127FA25B95C7FC12FFAB041FB512F0127FA26D9139000FFE00EF03FC123FA27F
-121FA26C7EA212077F12036C7E7F6C7F6D6C14076D7E6D6C140FD907F8141ED903FEEC3C
-7C902600FF80EBF83C913A7FF007F01C021FB5EAC00C020391C8FC9138003FF03C427BBF
-47>I<B6D8C01FB512F8A3000101E0C7383FFC0026007F80EC0FF0B3A691B7FCA30280C7
-120FB3A92601FFE0EC3FFCB6D8C01FB512F8A33D3E7DBD44>I<B612F0A3C6EBF000EB3F
-C0B3B3B2EBFFF0B612F0A31C3E7EBD21>I<011FB512FCA3D9000713006E5A1401B3B3A6
-123FEA7F80EAFFC0A44A5A1380D87F005B007C130700385C003C495A6C495A6C495A2603
-E07EC7FC3800FFF8EB3FC026407CBD2F>I<B600C090387FFFFCA3000101E0C7000F1380
-26007F80913807FE0018F818E0604D5A4DC7FC173E5F5F4C5A4C5A4C5A4C5A4CC8FC163E
-5E5E4B5A4B5AED07804B7E151F4B7E4B7E15FF913881EFF8913883C7FCEC878791388F03
-FE91389E01FF14BCDAF8007F4A6D7E5C4A6D7E4A6D7EA2707E707EA2707E707EA2707F71
-7E84173F717E717EA2717E848419802601FFE04A13C0B600C090B6FCA3403E7DBD47>I<
-B612F8A3000101E0C9FC38007F80B3B0EF0380A517071800A45FA35FA25F5F5F4C5A1607
-48486C133FB8FCA3313E7DBD39>I<B500C093B512C0A300016D4BEBE000D8007F1880D9
-77F0ED03BFA3D973F8ED073FA3D971FC150EA2D970FE151CA3027F1538A36E6C1470A36E
-6C14E0A26E6CEB01C0A36E6CEB0380A36E6CEB0700A26E6C130EA36E6C5BA3037F5BA26F
-6C5AA36F6C5AA392380FE1C0A3923807F380A26FB4C7FCA36F5AA213F8486C6D5AD807FF
-EFFFE0B500F80178017FEBFFC0A34A3E7CBD53>I<B56C91B512F88080D8007F03071300
-6EEC01FC6E6E5A1870EB77FCEB73FEA2EB71FF01707FA26E7E6E7EA26E7E6E7EA26E7E6E
-7EA26E7E6E7FA26F7E6F7EA26F7E6F7EA26F7E6F7EA26F7E6F1380A2EE7FC0EE3FE0A2EE
-1FF0EE0FF8A2EE07FCEE03FEA2EE01FF7013F0A2177F173FA2171F170FA2170701F81503
-487ED807FF1501B500F81400A218703D3E7DBD44>I<ED7FE0913807FFFE91391FC03F80
-91397E0007E04948EB03F8D907F0EB00FE4948147F49486E7E49486E7E49C86C7E01FE6F
-7E00018349150300038348486F7EA248486F7EA2001F188049167F003F18C0A3007F18E0
-49163FA300FF18F0AC007F18E06D167FA4003F18C0A26C6CEEFF80A36C6C4B1300A26C6C
-4B5A00035F6D150700015F6C6C4B5A6D5E6D6C4A5A6D6C4A5A6D6C4AC7FC6D6C14FED901
-FCEB03F8D9007FEB0FE091391FC03F80912607FFFEC8FC9138007FE03C427BBF47>I<B7
-12F8EEFF8017E000019039C0003FF86C6C48EB07FCEE01FE707EEF7F80EF3FC018E0A2EF
-1FF0A218F8A818F0A2EF3FE0A218C0EF7F80EFFF004C5AEE07FCEE3FF091B612C04CC7FC
-0280C9FCB3A73801FFE0B612C0A3353E7DBD3E>I<ED7FE0913807FFFE91391FC03F8091
-397F000FE0D901FCEB03F8D907F0EB00FE4948147F49486E7E49486E7E49C86C7E498248
-486F7E49150300038348486F7EA2000F834981001F1880A24848EE7FC0A3007F18E0A249
-163FA200FF18F0AC007F18E0A26D167FA3003F18C0A26C6CEEFF80A3000F18006D5D0007
-DA0F805B6C6C90393FE003FCED70706C6C496C485A6C6C48486C485A017FD9800E5BD93F
-819038061FC0D91FC19038073F80D90FE14AC7FCD907F1EB03FE902601FDC013F8903A00
-7EE007E091271FF03FC013180207B5FC9139007FE1E0DB0001143883711378A2706C13F0
-EFFF0318FFA27113E0A37113C0711380711300715AEF01F83D527BBF47>I<B712C016FC
-EEFF800001D9C00013E06C6C48EB1FF0EE07FCEE01FE707E84717EA2717EA284A760177F
-606017FF95C7FCEE01FCEE07F8EE1FE0EEFF8091B500FCC8FC16F091388001FCED003FEE
-1FC0707E707E83160383160183A383A484A4F0C004190EA28218E0057F131E2601FFE016
-1CB600C0EB3FF094381FF83805071370CA3801FFE09438003F803F407DBD43>I<D907FC
-131890391FFF8038017FEBE0783901FC03F83A03F0007CF8D807C0133F4848130F001F14
-0748C7FC003E1403007E1401A2007C140012FC1678A46C1538A27EA26C6C14007F7FEA3F
-F8EBFF806C13F86CEBFF806C14F06C14FC6C14FF6C15C0013F14E0010714F0EB007F0207
-13F89138007FFC150FED07FE15031501ED00FFA200E0157FA3163FA27EA3163E7E167E6C
-157C6C15FC6C15F86D13016DEB03F06DEB07E0D8F9FCEB0FC03AF07F803F8090391FFFFE
-00D8E00713F839C0007FC028427BBF33>I<003FB91280A3903AF0007FE001018090393F
-C0003F48C7ED1FC0007E1707127C00781703A300701701A548EF00E0A5C81600B3B14B7E
-4B7E0107B612FEA33B3D7DBC42>I<B600C090B512F8A3000101E0C70007130026007F80
-EC01FC715A1870B3B3A4013F16F06E5DA21701011F5E80010F15036E4A5A010793C7FC6D
-6C5C6D6C141E6D6C5C027F14F86E6C485A91390FF00FE00203B51280020049C8FCED1FF0
-3D407DBD44>I<B691380FFFFEA3000301E0020113E06C01809138007F806CEF3F00017F
-163E181C6E153C013F1638A26E1578011F1670A26D6C5DA26E140101075EA26E14030103
-5EA26D6C4AC7FCA2806D150EA26F131E027F141CA26F133C023F1438A26E6C5BA26F13F0
-020F5CA2EDF80102075CA26E6C485AA2EDFE07020191C8FCA26F5A6E130EA2ED7F9CA216
-DCED3FF8A36F5AA36F5AA26F5AA36F5A3F407EBD44>I<B500FE017FB5D88007B5FCA300
-0301C0010101E0C713F86C90C849EC3FE07148EC0F807E7215006E143F017F190E84A26D
-6C60A24D7E6D6C60A2EFE7F86D6C60A2933801C3FC6E18F001076104037F6E0281140101
-036104077F17006D6C4D5AA2040EEB7F806D6C4DC7FCA24CEB3FC0DA7F80160EA24CEB1F
-E003C0161E023F171C047814F0DBE070010F133C021F173804F014F84C1307DA0FF05EA2
-DBF1C0EB03FCDA07F95EA2DBFB80EB01FEDA03FF6F5AA293C8FCA26E5FA24B157F020094
-C8FCA24B81037C153EA20378151E0338151C58407EBD5D>I<007FB5D8C003B512E0A3C6
-49C7EBFC00D93FF8EC3FE06D48EC1F806D6C92C7FC171E6D6C141C6D6C143C5F6D6C1470
-6D6D13F04C5ADA7FC05B023F13036F485ADA1FF090C8FC020F5BEDF81E913807FC1C163C
-6E6C5A913801FF7016F06E5B6F5AA26F7E6F7EA28282153FED3BFEED71FF15F103E07F91
-3801C07F0203804B6C7EEC07004A6D7E020E6D7E5C023C6D7E02386D7E14784A6D7E4A6D
-7F130149486E7E4A6E7E130749C86C7E496F7E497ED9FFC04A7E00076DEC7FFFB500FC01
-03B512FEA33F3E7EBD44>I<B66C0103B51280A3000101F0C8EBF8006C6C48ED3FC0725A
-013F041EC7FC6D7E606D6C15386D6C1578606D6C5D6E14016D5E6D6D1303606E6C49C8FC
-6E6C5B170E6E6C131E171C6E6C5B6E6C137817706E6C13F06F5B6E13016EEB83C05FED7F
-C7DB3FE7C9FC16EFED1FFE5E150F6F5AB3A4ED1FFC020FB512FCA3413E7FBD44>I<003F
-B712F8A391C7EA1FF013F801E0EC3FE00180EC7FC090C8FC003EEDFF80A2003C4A130000
-7C4A5A12784B5A4B5AA200704A5AA24B5A4B5AA2C8485A4A90C7FCA24A5A4A5AA24A5AA2
-4A5A4A5AA24A5A4A5AA24990C8FCA2495A4948141CA2495A495AA2495A495A173C495AA2
-4890C8FC485A1778485A484815F8A24848140116034848140F4848143FED01FFB8FCA32E
-3E7BBD38>I<EAFFFCA4EAF000B3B3B3B3ABEAFFFCA40E5B77C319>I<486C13C000031301
-01001380481303000EEB070048130E0018130C0038131C003013180070133800601330A3
-00E01370481360A400CFEB678039FFC07FE001E013F0A3007F133FA2003F131F01C013E0
-390F0007801C1C73BE2D>I<EAFFFCA4EA003CB3B3B3B3ABEAFFFCA40E5B7FC319>I<EA01
-80120313005A120E5A12181238123012701260A312E05AA412CFEAFFC013E0A3127FA212
-3F13C0EA0F000B1C7ABE19>96 D<EB0FF8EBFFFE3903F01F8039078007E0000F6D7E9038
-E001F8D81FF07F6E7EA3157F6C5AEA0380C8FCA4EC1FFF0103B5FC90381FF87FEB7F8038
-01FC00EA07F8EA0FE0485A485AA248C7FCEE038012FEA315FFA3007F5BEC03BF3B3F8007
-1F8700261FC00E13CF3A07F03C0FFE3A01FFF807FC3A003FC001F0292A7DA82D>I<EA01
-FC12FFA3120712031201B1EC03FC91381FFF8091387C07E09039FDE001F09039FFC000FC
-4A137E91C77E49158049141F17C0EE0FE0A217F0A2160717F8AA17F0A2160FA217E0161F
-17C06D1580EE3F006D5C6E13FE9039F3C001F89039F1E003F09039E0780FC09026C03FFF
-C7FCC7EA07F82D407EBE33>I<49B4FC010F13E090383F00F8017C131E4848131F484813
-7F0007ECFF80485A5B121FA24848EB7F00151C007F91C7FCA290C9FC5AAB6C7EA3003FEC
-01C07F001F140316806C6C13076C6C14000003140E6C6C131E6C6C137890383F01F09038
-0FFFC0D901FEC7FC222A7DA828>I<ED01FC15FFA3150715031501B114FF010713E19038
-1F80F990387E003D49131FD803F81307485A49130348481301121F123F5B127FA290C7FC
-A25AAA7E7FA2123FA26C7E000F14037F000714076C6C497E6C6C497ED8007C017913F890
-383F01F190380FFFC1903A01FE01FC002D407DBE33>I<EB01FE90380FFFC090383F03F0
-9038FC01F848486C7E4848137E48487F000F158049131F001F15C04848130FA2127F16E0
-90C7FCA25AA290B6FCA290C9FCA67EA27F123F16E06C7E1501000F15C06C6C13036DEB07
-806C6C1400C66C131E017E5B90381F80F8903807FFE0010090C7FC232A7EA828>I<EC1F
-C0EC7FF8903801F83C903807E07E90380FC0FFEB1FC1EB3F811401137FEC00FE01FE137C
-1500AEB6FCA3C648C7FCB3AE487E007F13FFA320407EBF1C>I<167C903903F801FF903A
-1FFF078F8090397E0FDE1F9038F803F83803F001A23B07E000FC0600000F6EC7FC49137E
-001F147FA8000F147E6D13FE00075C6C6C485AA23901F803E03903FE0FC026071FFFC8FC
-EB03F80006CAFC120EA3120FA27F7F6CB512E015FE6C6E7E6C15E06C810003813A0FC000
-1FFC48C7EA01FE003E140048157E825A82A46C5D007C153E007E157E6C5D6C6C495A6C6C
-495AD803F0EB0FC0D800FE017FC7FC90383FFFFC010313C0293D7EA82D>I<EA01FC12FF
-A3120712031201B1EC01FE913807FFC091381E07E091387803F09138E001F8D9FDC07F14
-8001FF6D7E91C7FCA25BA25BB3A6486C497EB5D8F87F13FCA32E3F7DBE33>I<EA01E0EA
-07F8A2487EA46C5AA2EA01E0C8FCACEA01FC127FA3120712031201B3AC487EB512F0A314
-3E7DBD1A>I<1478EB01FEA2EB03FFA4EB01FEA2EB00781400AC147FEB7FFFA313017F14
-7FB3B3A5123E127F38FF807E14FEA214FCEB81F8EA7F01387C03F0381E07C0380FFF8038
-01FC00185185BD1C>I<EA01FC12FFA3120712031201B292B51280A392383FFC0016E016
-8093C7FC153C5D5D4A5AEC07C04A5A4AC8FC143E147F4A7E13FD9038FFDFC0EC9FE0140F
-496C7E01FC7F496C7E1401816E7E81826F7E151F826F7EA282486C14FEB539F07FFFE0A3
-2B3F7EBE30>I<EA01FC12FFA3120712031201B3B3B1487EB512F8A3153F7DBE1A>I<2701
-F801FE14FF00FF902707FFC00313E0913B1E07E00F03F0913B7803F03C01F80007903BE0
-01F87000FC2603F9C06D487F000101805C01FBD900FF147F91C75B13FF4992C7FCA2495C
-B3A6486C496CECFF80B5D8F87FD9FC3F13FEA347287DA74C>I<3901F801FE00FF903807
-FFC091381E07E091387803F000079038E001F82603F9C07F0001138001FB6D7E91C7FC13
-FF5BA25BB3A6486C497EB5D8F87F13FCA32E287DA733>I<14FF010713E090381F81F890
-387E007E01F8131F4848EB0F804848EB07C04848EB03E0000F15F04848EB01F8A2003F15
-FCA248C812FEA44815FFA96C15FEA36C6CEB01FCA3001F15F86C6CEB03F0A26C6CEB07E0
-6C6CEB0FC06C6CEB1F80D8007EEB7E0090383F81FC90380FFFF0010090C7FC282A7EA82D
->I<3901FC03FC00FF90381FFF8091387C0FE09039FDE003F03A07FFC001FC6C496C7E6C
-90C7127F49EC3F805BEE1FC017E0A2EE0FF0A3EE07F8AAEE0FF0A4EE1FE0A2EE3FC06D15
-80EE7F007F6E13FE9138C001F89039FDE007F09039FC780FC0DA3FFFC7FCEC07F891C9FC
-AD487EB512F8A32D3A7EA733>I<02FF131C0107EBC03C90381F80F090397F00387C01FC
-131CD803F8130E4848EB0FFC150748481303121F485A1501485AA448C7FCAA6C7EA36C7E
-A2001F14036C7E15076C6C130F6C7E6C6C133DD8007E137990383F81F190380FFFC19038
-01FE0190C7FCAD4B7E92B512F8A32D3A7DA730>I<3901F807E000FFEB1FF8EC787CECE1
-FE3807F9C100031381EA01FB1401EC00FC01FF1330491300A35BB3A5487EB512FEA31F28
-7EA724>I<90383FC0603901FFF8E03807C03F381F000F003E1307003C1303127C007813
-0112F81400A27E7E7E6D1300EA7FF8EBFFC06C13F86C13FE6C7F6C1480000114C0D8003F
-13E0010313F0EB001FEC0FF800E01303A214017E1400A27E15F07E14016C14E06CEB03C0
-903880078039F3E01F0038E0FFFC38C01FE01D2A7DA824>I<131CA6133CA4137CA213FC
-A2120112031207001FB512C0B6FCA2D801FCC7FCB3A215E0A912009038FE01C0A2EB7F03
-013F138090381F8700EB07FEEB01F81B397EB723>I<D801FC14FE00FF147FA300071403
-0003140100011400B3A51501A31503120015076DEB06FF017E010E13806D4913FC90381F
-C078903807FFE00100903880FE002E297DA733>I<B539E00FFFE0A32707FE000313006C
-48EB00FC5E00015D7F00005DA26D13016D5CA26D6C485AA2ECC007011F91C7FCA290380F
-E00EA2ECF01E0107131CA26D6C5AA2ECFC7801011370A2ECFEF001005BA2EC7FC0A36E5A
-A26EC8FCA3140E2B287EA630>I<B53BC3FFFE03FFF8A3290FFE003FE00013C06C486D48
-EB3F806C4817006D010F141E00016F131C15076D163C00004A6C1338A2017F5E4B7E151D
-D93F805DED3DFC1538D91FC04A5AED78FE9238707E03D90FE0017F5BEDE03F02F0140701
-070387C7FC9138F1C01F02F9148F010315CE9138FB800F02FF14DE6D15FCED00076D5DA2
-4A1303027E5CA2027C1301023C5C023813003D287EA642>I<B539F01FFFE0A30003D9C0
-0F1300C690388007F8D97F0013E002805BD93FC05B011F49C7FC90380FE00EECF01E6D6C
-5A01035B6D6C5A6E5AEB00FF6E5A6E5A81141F814A7E81147BECF1FC903801E1FEECC0FF
-01037F49486C7ED90F007F011E6D7E013E130F496D7E01FC80486C80000F4A7EB539803F
-FFF8A32D277FA630>I<B539E00FFFE0A32707FE000313006C48EB01FC6F5A00015D7F00
-005DA2017F495AA2EC8003013F5CA26D6C48C7FCA26E5A010F130EA26D6C5AA2ECF83C01
-031338A26D6C5AA2ECFEF001005BA2EC7FC0A36E5AA36EC8FCA2140EA2141E141C143C14
-38A2147800181370127EB45BA2495AA248485AD87E07C9FCEA780EEA3C3CEA1FF8EA07E0
-2B3A7EA630>I<001FB61280A2EBE0000180140049485A001E495A121C4A5A003C495A14
-1F00385C4A5A147F5D4AC7FCC6485AA2495A495A130F5C495A90393FC00380A2EB7F80EB
-FF005A5B484813071207491400485A48485BA248485B4848137F00FF495A90B6FCA22127
-7EA628>I<B812F0A22C0280982D>I E
+19>I<007FB912E0BA12F0A26C18E0CDFCAE007FB912E0BA12F0A26C18E03C167BA147>
+61 D<EB0780EB1FE0A2497EA46D5AA2EB078090C8FCA8130380A4130791C7FCA65BA313
+1EA2133E133C137CA25B1201485A485A120F485A485A127FA248C7127C15FEEC01FFA480
+157F6C141EA26C6C133C1578390FC001E03907F00FC03901FFFE0038003FF020407BAC2B
+>I<EB1FF890B5FC3903E01FC0390F0007F0001EEB03F848EB01FC4814FE140000FE14FF
+7E7FA46CC7FC123EC7EA01FEA2EC03FCEC07F815F0EC0FC0EC1F80EC3F00143E5C147814
+F85C13015CA2495AA25CAB91C7FC90C8FCA8EB0780EB1FE0A2497EA46D5AA2EB07802040
+7BBF2B>I<ED7FE0913807FFFE91391F801F809139780001E0D901E0EB0078D90780141E
+49C87E011E6F7E0138ED01C0496F7E4916700001177848488249D93F80131C28070001FF
+F07F48902607E07C130F000E90260FC01E7F001E90263F00071480001C49903803800300
+3C01FED901C013C0003849ECFE010101EC00FF267803F8027F13E000701700495AA200F0
+18F000E01870495AA96D7E12F01270A26D7E007818E0263801FC5C01005C003C7F001C01
+7F49EB01C0001E6DEB077F000E903B0FC01E3F8380000F903B07E07C1F87006C903A01FF
+F007FE3C0380003F8001F86D90CAFC6C7E120013707F011EEE03F06D160F6D6CED3FC0D9
+01E0913801FE00D90078EC1FF0913A1F8003FF800207B500F8C7FC9126007FFEC8FC3C41
+7BBF47>I<15074B7EA34B7EA34B7EA34B7EA34B7E15E7A2913801C7FC15C3A291380381
+FEA34AC67EA3020E6D7EA34A6D7EA34A6D7EA34A6D7EA34A6D7EA349486D7E91B6FCA249
+819138800001A249C87EA24982010E157FA2011E82011C153FA2013C820138151FA20178
+82170F13FC00034C7ED80FFF4B7EB500F0010FB512F8A33D417DC044>I<B712FCEEFF80
+17F00001903980000FF86C6CC7EA03FE707E701380EF7FC0EF3FE0A2EF1FF0A218F8A317
+0F171FA318F0A2EF3FE0177F18C0EFFF804C1300EE03FCEE0FF8EE7FE091B6C7FC17E091
+C7EA07FCEE01FE933800FF80EF7FC0EF3FE0EF1FF018F8170F18FC1707A218FEA718FC17
+0FA2EF1FF818F0173FEF7FE0EFFFC00403138048486C90380FFE00B85A17E094C7FC373E
+7DBD40>I<DB3FF01306912603FFFE130E020F9038FF801E913A3FF007E03E9139FF8000
+F8D903FEC7EA7C7ED907F8EC1EFE4948140FD93FE0140749481403495A91C81201484815
+0012034848167E5B000F173EA24848161EA2123F5B180E127FA349160012FFAC127F7F18
+0EA2123FA27F001F171E181C6C7EA20007173C6D16386C6C1678000117706C6C16F06EEC
+01E06D6C15C06D6C1403D90FF0EC07806D6CEC1F00D903FE143E902600FF8013F891393F
+F007F0020FB512C0020391C7FC9138003FF037427BBF42>I<B712FCEEFF8017E0000190
+39C0001FF86C6C48EB03FEEE00FF717E717EEF0FE084717E717E170184717EA21980187F
+19C0A3F03FE0A519F0AB19E0A5F07FC0A21980A218FF19004D5AA24D5A6017074D5A4D5A
+EF7FC04DC7FCEE03FE48486CEB1FF8B85A178004FCC8FC3C3E7DBD45>I<B912E0A30001
+9038C000016C6C48EB001FEF0FF01703A217011700A31870A418381638A41800A21678A2
+16F81501150791B5FCA3EC8007150115001678A21638A2180EA3181C93C7FCA4183C1838
+A21878A318F8EF01F0A21707170F173F48486CEB03FFB912E0A3373E7DBD3E>I<B91280
+A300019038C000036C6C48EB007FEF1FC0170F1707A21703A31701A4EF00E0A21638A318
+00A31678A216F81501150791B5FCA3EC8007150115001678A21638A693C8FCAF3801FFE0
+B612F0A3333E7DBD3B>I<DB3FE0130C912603FFFE131C021F9038FF803C913A7FF00FC0
+7C9139FF0001F0D903FC90380078FC4948143DD91FE0141F4948140F4948140701FF1503
+4890C8FC491501485A000716005B000F177C5B001F173CA2485AA2181C127FA25B95C7FC
+12FFAB041FB512F0127FA26D9139000FFE00EF03FC123FA27F121FA26C7EA212077F1203
+6C7E7F6C7F6D6C14076D7E6D6C140FD907F8141ED903FEEC3C7C902600FF80EBF83C913A
+7FF007F01C021FB5EAC00C020391C8FC9138003FF03C427BBF47>I<B6D8C01FB512F8A3
+000101E0C7383FFC0026007F80EC0FF0B3A691B7FCA30280C7120FB3A92601FFE0EC3FFC
+B6D8C01FB512F8A33D3E7DBD44>I<B612F0A3C6EBF000EB3FC0B3B3B2EBFFF0B612F0A3
+1C3E7EBD21>I<011FB512FCA3D9000713006E5A1401B3B3A6123FEA7F80EAFFC0A44A5A
+1380D87F005B007C130700385C003C495A6C495A6C495A2603E07EC7FC3800FFF8EB3FC0
+26407CBD2F>I<B600C090387FFFFCA3000101E0C7000F138026007F80913807FE0018F8
+18E0604D5A4DC7FC173E5F5F4C5A4C5A4C5A4C5A4CC8FC163E5E5E4B5A4B5AED07804B7E
+151F4B7E4B7E15FF913881EFF8913883C7FCEC878791388F03FE91389E01FF14BCDAF800
+7F4A6D7E5C4A6D7E4A6D7EA2707E707EA2707E707EA2707F717E84173F717E717EA2717E
+848419802601FFE04A13C0B600C090B6FCA3403E7DBD47>I<B612F8A3000101E0C9FC38
+007F80B3B0EF0380A517071800A45FA35FA25F5F5F4C5A160748486C133FB8FCA3313E7D
+BD39>I<B500C093B512C0A300016D4BEBE000D8007F1880D977F0ED03BFA3D973F8ED07
+3FA3D971FC150EA2D970FE151CA3027F1538A36E6C1470A36E6C14E0A26E6CEB01C0A36E
+6CEB0380A36E6CEB0700A26E6C130EA36E6C5BA3037F5BA26F6C5AA36F6C5AA392380FE1
+C0A3923807F380A26FB4C7FCA36F5AA213F8486C6D5AD807FFEFFFE0B500F80178017FEB
+FFC0A34A3E7CBD53>I<B56C91B512F88080D8007F030713006EEC01FC6E6E5A1870EB77
+FCEB73FEA2EB71FF01707FA26E7E6E7EA26E7E6E7EA26E7E6E7EA26E7E6E7FA26F7E6F7E
+A26F7E6F7EA26F7E6F7EA26F7E6F1380A2EE7FC0EE3FE0A2EE1FF0EE0FF8A2EE07FCEE03
+FEA2EE01FF7013F0A2177F173FA2171F170FA2170701F81503487ED807FF1501B500F814
+00A218703D3E7DBD44>I<ED7FE0913807FFFE91391FC03F8091397E0007E04948EB03F8
+D907F0EB00FE4948147F49486E7E49486E7E49C86C7E01FE6F7E00018349150300038348
+486F7EA248486F7EA2001F188049167F003F18C0A3007F18E049163FA300FF18F0AC007F
+18E06D167FA4003F18C0A26C6CEEFF80A36C6C4B1300A26C6C4B5A00035F6D150700015F
+6C6C4B5A6D5E6D6C4A5A6D6C4A5A6D6C4AC7FC6D6C14FED901FCEB03F8D9007FEB0FE091
+391FC03F80912607FFFEC8FC9138007FE03C427BBF47>I<B712F8EEFF8017E000019039
+C0003FF86C6C48EB07FCEE01FE707EEF7F80EF3FC018E0A2EF1FF0A218F8A818F0A2EF3F
+E0A218C0EF7F80EFFF004C5AEE07FCEE3FF091B612C04CC7FC0280C9FCB3A73801FFE0B6
+12C0A3353E7DBD3E>I<ED7FE0913807FFFE91391FC03F8091397F000FE0D901FCEB03F8
+D907F0EB00FE4948147F49486E7E49486E7E49C86C7E498248486F7E4915030003834848
+6F7EA2000F834981001F1880A24848EE7FC0A3007F18E0A249163FA200FF18F0AC007F18
+E0A26D167FA3003F18C0A26C6CEEFF80A3000F18006D5D0007DA0F805B6C6C90393FE003
+FCED70706C6C496C485A6C6C48486C485A017FD9800E5BD93F819038061FC0D91FC19038
+073F80D90FE14AC7FCD907F1EB03FE902601FDC013F8903A007EE007E091271FF03FC013
+180207B5FC9139007FE1E0DB0001143883711378A2706C13F0EFFF0318FFA27113E0A371
+13C0711380711300715AEF01F83D527BBF47>I<B712C016FCEEFF800001D9C00013E06C
+6C48EB1FF0EE07FCEE01FE707E84717EA2717EA284A760177F606017FF95C7FCEE01FCEE
+07F8EE1FE0EEFF8091B500FCC8FC16F091388001FCED003FEE1FC0707E707E8316038316
+0183A383A484A4F0C004190EA28218E0057F131E2601FFE0161CB600C0EB3FF094381FF8
+3805071370CA3801FFE09438003F803F407DBD43>I<D907FC131890391FFF8038017FEB
+E0783901FC03F83A03F0007CF8D807C0133F4848130F001F140748C7FC003E1403007E14
+01A2007C140012FC1678A46C1538A27EA26C6C14007F7FEA3FF8EBFF806C13F86CEBFF80
+6C14F06C14FC6C14FF6C15C0013F14E0010714F0EB007F020713F89138007FFC150FED07
+FE15031501ED00FFA200E0157FA3163FA27EA3163E7E167E6C157C6C15FC6C15F86D1301
+6DEB03F06DEB07E0D8F9FCEB0FC03AF07F803F8090391FFFFE00D8E00713F839C0007FC0
+28427BBF33>I<003FB91280A3903AF0007FE001018090393FC0003F48C7ED1FC0007E17
+07127C00781703A300701701A548EF00E0A5C81600B3B14B7E4B7E0107B612FEA33B3D7D
+BC42>I<B600C090B512F8A3000101E0C70007130026007F80EC01FC715A1870B3B3A401
+3F16F06E5DA21701011F5E80010F15036E4A5A010793C7FC6D6C5C6D6C141E6D6C5C027F
+14F86E6C485A91390FF00FE00203B51280020049C8FCED1FF03D407DBD44>I<B691380F
+FFFEA3000301E0020113E06C01809138007F806CEF3F00017F163E181C6E153C013F1638
+A26E1578011F1670A26D6C5DA26E140101075EA26E140301035EA26D6C4AC7FCA2806D15
+0EA26F131E027F141CA26F133C023F1438A26E6C5BA26F13F0020F5CA2EDF80102075CA2
+6E6C485AA2EDFE07020191C8FCA26F5A6E130EA2ED7F9CA216DCED3FF8A36F5AA36F5AA2
+6F5AA36F5A3F407EBD44>I<B500FE017FB5D88007B5FCA3000301C0010101E0C713F86C
+90C849EC3FE07148EC0F807E7215006E143F017F190E84A26D6C60A24D7E6D6C60A2EFE7
+F86D6C60A2933801C3FC6E18F001076104037F6E0281140101036104077F17006D6C4D5A
+A2040EEB7F806D6C4DC7FCA24CEB3FC0DA7F80160EA24CEB1FE003C0161E023F171C0478
+14F0DBE070010F133C021F173804F014F84C1307DA0FF05EA2DBF1C0EB03FCDA07F95EA2
+DBFB80EB01FEDA03FF6F5AA293C8FCA26E5FA24B157F020094C8FCA24B81037C153EA203
+78151E0338151C58407EBD5D>I<007FB5D8C003B512E0A3C649C7EBFC00D93FF8EC3FE0
+6D48EC1F806D6C92C7FC171E6D6C141C6D6C143C5F6D6C14706D6D13F04C5ADA7FC05B02
+3F13036F485ADA1FF090C8FC020F5BEDF81E913807FC1C163C6E6C5A913801FF7016F06E
+5B6F5AA26F7E6F7EA28282153FED3BFEED71FF15F103E07F913801C07F0203804B6C7EEC
+07004A6D7E020E6D7E5C023C6D7E02386D7E14784A6D7E4A6D7F130149486E7E4A6E7E13
+0749C86C7E496F7E497ED9FFC04A7E00076DEC7FFFB500FC0103B512FEA33F3E7EBD44>
+I<B66C0103B51280A3000101F0C8EBF8006C6C48ED3FC0725A013F041EC7FC6D7E606D6C
+15386D6C1578606D6C5D6E14016D5E6D6D1303606E6C49C8FC6E6C5B170E6E6C131E171C
+6E6C5B6E6C137817706E6C13F06F5B6E13016EEB83C05FED7FC7DB3FE7C9FC16EFED1FFE
+5E150F6F5AB3A4ED1FFC020FB512FCA3413E7FBD44>I<003FB712F8A391C7EA1FF013F8
+01E0EC3FE00180EC7FC090C8FC003EEDFF80A2003C4A1300007C4A5A12784B5A4B5AA200
+704A5AA24B5A4B5AA2C8485A4A90C7FCA24A5A4A5AA24A5AA24A5A4A5AA24A5A4A5AA249
+90C8FCA2495A4948141CA2495A495AA2495A495A173C495AA24890C8FC485A1778485A48
+4815F8A24848140116034848140F4848143FED01FFB8FCA32E3E7BBD38>I<EAFFFCA4EA
+F000B3B3B3B3ABEAFFFCA40E5B77C319>I<486C13C00003130101001380481303000EEB
+070048130E0018130C0038131C003013180070133800601330A300E01370481360A400CF
+EB678039FFC07FE001E013F0A3007F133FA2003F131F01C013E0390F0007801C1C73BE2D
+>I<EAFFFCA4EA003CB3B3B3B3ABEAFFFCA40E5B7FC319>I<EA0180120313005A120E5A12
+181238123012701260A312E05AA412CFEAFFC013E0A3127FA2123F13C0EA0F000B1C7ABE
+19>96 D<EB0FF8EBFFFE3903F01F8039078007E0000F6D7E9038E001F8D81FF07F6E7EA3
+157F6C5AEA0380C8FCA4EC1FFF0103B5FC90381FF87FEB7F803801FC00EA07F8EA0FE048
+5A485AA248C7FCEE038012FEA315FFA3007F5BEC03BF3B3F80071F8700261FC00E13CF3A
+07F03C0FFE3A01FFF807FC3A003FC001F0292A7DA82D>I<EA01FC12FFA3120712031201
+B1EC03FC91381FFF8091387C07E09039FDE001F09039FFC000FC4A137E91C77E49158049
+141F17C0EE0FE0A217F0A2160717F8AA17F0A2160FA217E0161F17C06D1580EE3F006D5C
+6E13FE9039F3C001F89039F1E003F09039E0780FC09026C03FFFC7FCC7EA07F82D407EBE
+33>I<49B4FC010F13E090383F00F8017C131E4848131F4848137F0007ECFF80485A5B12
+1FA24848EB7F00151C007F91C7FCA290C9FC5AAB6C7EA3003FEC01C07F001F140316806C
+6C13076C6C14000003140E6C6C131E6C6C137890383F01F090380FFFC0D901FEC7FC222A
+7DA828>I<ED01FC15FFA3150715031501B114FF010713E190381F80F990387E003D4913
+1FD803F81307485A49130348481301121F123F5B127FA290C7FCA25AAA7E7FA2123FA26C
+7E000F14037F000714076C6C497E6C6C497ED8007C017913F890383F01F190380FFFC190
+3A01FE01FC002D407DBE33>I<EB01FE90380FFFC090383F03F09038FC01F848486C7E48
+48137E48487F000F158049131F001F15C04848130FA2127F16E090C7FCA25AA290B6FCA2
+90C9FCA67EA27F123F16E06C7E1501000F15C06C6C13036DEB07806C6C1400C66C131E01
+7E5B90381F80F8903807FFE0010090C7FC232A7EA828>I<EC1FC0EC7FF8903801F83C90
+3807E07E90380FC0FFEB1FC1EB3F811401137FEC00FE01FE137C1500AEB6FCA3C648C7FC
+B3AE487E007F13FFA320407EBF1C>I<167C903903F801FF903A1FFF078F8090397E0FDE
+1F9038F803F83803F001A23B07E000FC0600000F6EC7FC49137E001F147FA8000F147E6D
+13FE00075C6C6C485AA23901F803E03903FE0FC026071FFFC8FCEB03F80006CAFC120EA3
+120FA27F7F6CB512E015FE6C6E7E6C15E06C810003813A0FC0001FFC48C7EA01FE003E14
+0048157E825A82A46C5D007C153E007E157E6C5D6C6C495A6C6C495AD803F0EB0FC0D800
+FE017FC7FC90383FFFFC010313C0293D7EA82D>I<EA01FC12FFA3120712031201B1EC01
+FE913807FFC091381E07E091387803F09138E001F8D9FDC07F148001FF6D7E91C7FCA25B
+A25BB3A6486C497EB5D8F87F13FCA32E3F7DBE33>I<EA01E0EA07F8A2487EA46C5AA2EA
+01E0C8FCACEA01FC127FA3120712031201B3AC487EB512F0A3143E7DBD1A>I<1478EB01
+FEA2EB03FFA4EB01FEA2EB00781400AC147FEB7FFFA313017F147FB3B3A5123E127F38FF
+807E14FEA214FCEB81F8EA7F01387C03F0381E07C0380FFF803801FC00185185BD1C>I<
+EA01FC12FFA3120712031201B292B51280A392383FFC0016E0168093C7FC153C5D5D4A5A
+EC07C04A5A4AC8FC143E147F4A7E13FD9038FFDFC0EC9FE0140F496C7E01FC7F496C7E14
+01816E7E81826F7E151F826F7EA282486C14FEB539F07FFFE0A32B3F7EBE30>I<EA01FC
+12FFA3120712031201B3B3B1487EB512F8A3153F7DBE1A>I<2701F801FE14FF00FF9027
+07FFC00313E0913B1E07E00F03F0913B7803F03C01F80007903BE001F87000FC2603F9C0
+6D487F000101805C01FBD900FF147F91C75B13FF4992C7FCA2495CB3A6486C496CECFF80
+B5D8F87FD9FC3F13FEA347287DA74C>I<3901F801FE00FF903807FFC091381E07E09138
+7803F000079038E001F82603F9C07F0001138001FB6D7E91C7FC13FF5BA25BB3A6486C49
+7EB5D8F87F13FCA32E287DA733>I<14FF010713E090381F81F890387E007E01F8131F48
+48EB0F804848EB07C04848EB03E0000F15F04848EB01F8A2003F15FCA248C812FEA44815
+FFA96C15FEA36C6CEB01FCA3001F15F86C6CEB03F0A26C6CEB07E06C6CEB0FC06C6CEB1F
+80D8007EEB7E0090383F81FC90380FFFF0010090C7FC282A7EA82D>I<3901FC03FC00FF
+90381FFF8091387C0FE09039FDE003F03A07FFC001FC6C496C7E6C90C7127F49EC3F805B
+EE1FC017E0A2EE0FF0A3EE07F8AAEE0FF0A4EE1FE0A2EE3FC06D1580EE7F007F6E13FE91
+38C001F89039FDE007F09039FC780FC0DA3FFFC7FCEC07F891C9FCAD487EB512F8A32D3A
+7EA733>I<02FF131C0107EBC03C90381F80F090397F00387C01FC131CD803F8130E4848
+EB0FFC150748481303121F485A1501485AA448C7FCAA6C7EA36C7EA2001F14036C7E1507
+6C6C130F6C7E6C6C133DD8007E137990383F81F190380FFFC1903801FE0190C7FCAD4B7E
+92B512F8A32D3A7DA730>I<3901F807E000FFEB1FF8EC787CECE1FE3807F9C100031381
+EA01FB1401EC00FC01FF1330491300A35BB3A5487EB512FEA31F287EA724>I<90383FC0
+603901FFF8E03807C03F381F000F003E1307003C1303127C0078130112F81400A27E7E7E
+6D1300EA7FF8EBFFC06C13F86C13FE6C7F6C1480000114C0D8003F13E0010313F0EB001F
+EC0FF800E01303A214017E1400A27E15F07E14016C14E06CEB03C0903880078039F3E01F
+0038E0FFFC38C01FE01D2A7DA824>I<131CA6133CA4137CA213FCA2120112031207001F
+B512C0B6FCA2D801FCC7FCB3A215E0A912009038FE01C0A2EB7F03013F138090381F8700
+EB07FEEB01F81B397EB723>I<D801FC14FE00FF147FA3000714030003140100011400B3
+A51501A31503120015076DEB06FF017E010E13806D4913FC90381FC078903807FFE00100
+903880FE002E297DA733>I<B539E00FFFE0A32707FE000313006C48EB00FC5E00015D7F
+00005DA26D13016D5CA26D6C485AA2ECC007011F91C7FCA290380FE00EA2ECF01E010713
+1CA26D6C5AA2ECFC7801011370A2ECFEF001005BA2EC7FC0A36E5AA26EC8FCA3140E2B28
+7EA630>I<B53BC3FFFE03FFF8A3290FFE003FE00013C06C486D48EB3F806C4817006D01
+0F141E00016F131C15076D163C00004A6C1338A2017F5E4B7E151DD93F805DED3DFC1538
+D91FC04A5AED78FE9238707E03D90FE0017F5BEDE03F02F0140701070387C7FC9138F1C0
+1F02F9148F010315CE9138FB800F02FF14DE6D15FCED00076D5DA24A1303027E5CA2027C
+1301023C5C023813003D287EA642>I<B539F01FFFE0A30003D9C00F1300C690388007F8
+D97F0013E002805BD93FC05B011F49C7FC90380FE00EECF01E6D6C5A01035B6D6C5A6E5A
+EB00FF6E5A6E5A81141F814A7E81147BECF1FC903801E1FEECC0FF01037F49486C7ED90F
+007F011E6D7E013E130F496D7E01FC80486C80000F4A7EB539803FFFF8A32D277FA630>
+I<B539E00FFFE0A32707FE000313006C48EB01FC6F5A00015D7F00005DA2017F495AA2EC
+8003013F5CA26D6C48C7FCA26E5A010F130EA26D6C5AA2ECF83C01031338A26D6C5AA2EC
+FEF001005BA2EC7FC0A36E5AA36EC8FCA2140EA2141E141C143C1438A214780018137012
+7EB45BA2495AA248485AD87E07C9FCEA780EEA3C3CEA1FF8EA07E02B3A7EA630>I<001F
+B61280A2EBE0000180140049485A001E495A121C4A5A003C495A141F00385C4A5A147F5D
+4AC7FCC6485AA2495A495A130F5C495A90393FC00380A2EB7F80EBFF005A5B4848130712
+07491400485A48485BA248485B4848137F00FF495A90B6FCA221277EA628>I<B812F0A2
+2C0280982D>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fk cmr12 14.4 15
-/Fk 15 117 df<120FEA3FC0EA7FE0EAFFF0A6EA7FE0EA3FC0EA0F000C0C768B21>46
+%DVIPSBitmapFont: Fk cmr12 14.4 16
+/Fk 16 122 df<120FEA3FC0EA7FE0EAFFF0A6EA7FE0EA3FC0EA0F000C0C768B21>46
 D<EC1FF891B5FC010314C090390FF81FF090391FC003F849486C7E017EC7127E49800001
 168049141F4848EC0FC0000716E0491407000F16F0A34848EC03F8A2003F16FCA44848EC
 01FEA700FF16FFB3A5007F16FEA56D1403A2003F16FCA4001F16F8A26D1407000F16F0A2
 6C6CEC0FE0A26C6CEC1FC0A26C6CEC3F806C6CEC7F00017F14FE6D6C485A6D6C485A9039
-0FF81FF00103B512C0010091C7FCEC1FF830517BCE3B>48 D<14075C5C147F5C1307133F
-000FB5FCB6FC13F913C1EAF0011200B3B3B3A7497F010F13E0B712FEA4274F75CE3B>I<
-EC7FE0903803FFFE010F6D7E013F14E0D9FF0013F8D801F8EB1FFCD803E06D7E4848EB03
-FF48486D138090C813C0001E16E0001C157F003CED3FF012380078ED1FF81270A2B4ED0F
-FC13C07FA66C5A6C5A000EC8FCC9EA1FF8A317F0163FA2EE7FE017C016FF17804B1300A2
-4B5A4B5A5E4B5A4B5A4B5A5E4BC7FC15FE4A5A4A5A4A5A4A5A5D4A5A4AC8FC147E5C4948
-141CEB03E0495A4948143891C8FC131E5B5B491578485A48481570484815F048B7FCA25A
-5A5AB812E0A42E4F7ACE3B>I<EE7FF80307B57E033F14F09239FFC00FFC913A03FE0001
-FFDA0FF89038007FC0DA3FE0EC1FF0DA7F80EC07F84AC86C7E49486F7E49486F7E494870
-7E4948707E4948707E4948707E017F844948707E91CA120348854848717EA24848711380
-A2000F1AC049187F001F1AE0A34848F03FF0A3007F1AF8A249181FA300FF1AFCAE6C6CF0
-3FF8A5003F1AF06D187FA2001F1AE0A26D18FF000F1AC0A26C6C4D1380A200031A006D5F
-6C616C6D4C5A6E160F017F606D6C4C5A6D6C4C5AA26D6C4C5A6D6C4C5A6D6C4B90C7FCD9
-00FFED03FCDA7FC0EC0FF86E6C4A5ADA0FF8EC7FC0DA03FE4948C8FC913A00FFC00FFC03
-3FB512F0030714809226007FF8C9FC4E567AD35B>79 D<B600FC030FB512E0A4C691CAEB
-FC00D97FFCEF3FF06D48EF1FC0011F616E71C7FC130F1A0E6E171E0107181CA26E173C6D
-1838816D60A26F16F06D6081027F4C5AA281023F4C5AA26F1507021F94C8FC81020F160E
-A26F151E0207161CA26F153C6E1638826E5EA27014F06E5E821801037F5D82033F4A5AA2
-701307031F92C9FC82030F140EA270131E0307141CA270133C6F143817806F5CA2EFC0F0
-6F5C17E017E1047F5B17F193383FF380A217FF7090CAFCA2705AA3705AA3705AA2705AA3
-705A53547ED158>86 D<EB7F80B5FCA41203C6FC137FB3A6ED07FC92387FFF800281B512
-E0913987F00FF891398F8001FC029EC7B4FC02BC6E7E02F86E7E4A6E7E4A6E7E4A140784
-4A6E7EA2841701A284A283A21980AB19005FA360A24D5AA24D5A804D5A6E5D6E4A5AD97E
-784A5A6E4AC7FCD97C1EEB01FE6E495A903A7807E01FF00201B512C0902670007F90C8FC
-90C7EA0FF839547DD241>98 D<EC0FFE91387FFFE049B512F8903907F801FE90391FE000
-1FD93F80EB078049C7EA0FC001FE143F484815E00003157F485A485AA2485AEE3FC0003F
-ED0F004991C7FCA2127FA35B12FFAB127F7FA3123F6D1570121F6D15F0000F16E06D1401
-12076C6CEC03C06D15806C6C14076C6DEB0F00D93FC0131E6D6C137C903907FC03F06DB5
-5AD9007F1380DA0FF8C7FC2C367CB434>I<EC0FF891B5FC010314C090390FF80FF09039
-1FC003FC90397F8001FE49C77E4848EC7F804848143F49EC1FC0485A000FED0FE05B001F
-16F01607485AA2007F16F8A25B160312FF90B7FCA30180C9FCA8127F7FA2123FA26D1538
-121F17786C6C1570000716F06D15E06C6C14016C6CEC03C06C6C15806D6C130F6D6CEB1F
-00D90FF0133C903907FE01F80101B512E06D6C1380DA07FCC7FC2D367DB434>101
-D<1378EA01FE487E487FA66C90C7FC6C5AEA007890C8FCB0EB7F80B5FCA41203C6FC137F
-B3B3A43801FFE0B61280A419507CCF21>105 D<01FFEB07FCB590383FFF8092B512E091
-3901F00FF8913903C007FC000349C66C7EC6010E13016D486D7E5C143002706E7E146014
-E05CA35CB3AD2601FFE0903801FFE0B600C0B612C0A43A347CB341>110
-D<EC0FFC91387FFF8049B512E0903907F807F890391FE001FE90393F80007F017EC7EA1F
-80496E7E48486E7E00038248486E7EA248486E7EA248486E7EA2003F82A24848ED7F80A4
-00FF17C0AB007F1780A26D15FFA2003F1700A2001F5E6D1401000F5E6D140300075E6C6C
-4A5A6C6C4A5AA2D8007FEC3F806D6C49C7FC90391FE001FE903907F807F86DB55AD9007F
-1380DA0FFCC8FC32367CB43B>I<01FFEB1F80B5EB7FF0913801FFF8913803E1FC913807
-83FE0003EB0F07C6131EEB7F1C1438143091387003FC91386000F0160014E05CA45CB3AA
-8048487EB612F0A427347DB32E>114 D<D907FE13C090387FFF8148B512E33907F803FF
-390FC0007F4848133F48C7121F003E140F007E1407127C00FC1403A315017EA27E7F6C6C
-90C7FC13F013FF6C13F86CEBFF806C14E06C14F86C14FEC680013F1480010714C0D9003F
-13E014039138007FF0151F00E0140FED07F8A26C1403A215017EA36C15F0A26C14036C15
-E015076DEB0FC06DEB1F80D8FDF0EB3F0039F8FC01FE39F07FFFF8D8E01F13E0D8C00390
-C7FC25367CB42E>I<EB01C0A71303A41307A3130FA2131FA2133F137F13FF5A5A001F90
-B512E0B7FCA326003FC0C7FCB3A71638AC6E1378011F1470A26D6C13F016E0903807F801
-903903FC03C0903901FE07806DB51200EC3FFCEC07F0254B7EC92E>I
-E
+0FF81FF00103B512C0010091C7FCEC1FF830517BCE3B>48 D<EC7FE0903803FFFE010F6D
+7E013F14E0D9FF0013F8D801F8EB1FFCD803E06D7E4848EB03FF48486D138090C813C000
+1E16E0001C157F003CED3FF012380078ED1FF81270A2B4ED0FFC13C07FA66C5A6C5A000E
+C8FCC9EA1FF8A317F0163FA2EE7FE017C016FF17804B1300A24B5A4B5A5E4B5A4B5A4B5A
+5E4BC7FC15FE4A5A4A5A4A5A4A5A5D4A5A4AC8FC147E5C4948141CEB03E0495A49481438
+91C8FC131E5B5B491578485A48481570484815F048B7FCA25A5A5AB812E0A42E4F7ACE3B
+>50 D<160F5EA25E5EA25E5DA25D5DA25D151E151C153C5D157015F04A5A5D14035D4A5A
+5C140E5C143C14385C14F05C495A13035C130749C7FC130E131E5B133813785B5B120148
+5A5B120748C8FC120E121E5A123812785AB912F0A4C8000190C7FCAF4B7F4B7F020FB612
+E0A434507DCF3B>52 D<000316C001C0140301F8141F903AFFC003FF8091B612005E5E5E
+16E016804BC7FC019F13F8018113800180C9FCB0EC0FF0ECFFFE01836D7E903987F01FE0
+90399F0007F801BE6D7E01F86D7E496D7E49EC7F805BEE3FC04915E0C9121F17F0A317F8
+160FA317FCA5120EEA3F80487E12FF7FA217F85B161F5B48C813F012700078ED3FE0A26C
+16C0167F6CEDFF80001F16006C6C495A6C6C13036C6CEB07F8D801F8EB1FF06CB4EB7FE0
+6DB51280011F49C7FC010713F8010013C02E517ACE3B>I<49B612FEA490C7003F138092
+380FFE001507B3B3B3A21206EA3FC0487E487EA44B5AA25B007F5D0180131F0078C75B6C
+143F003E4A5A6C5D6C6C495A2707E003FEC7FC3901FC07FC6CB512F0013F13C0D907FCC8
+FC2F547BD13C>74 D<B600FC030FB512E0A4C691CAEBFC00D97FFCEF3FF06D48EF1FC001
+1F616E71C7FC130F1A0E6E171E0107181CA26E173C6D1838816D60A26F16F06D6081027F
+4C5AA281023F4C5AA26F1507021F94C8FC81020F160EA26F151E0207161CA26F153C6E16
+38826E5EA27014F06E5E821801037F5D82033F4A5AA2701307031F92C9FC82030F140EA2
+70131E0307141CA270133C6F143817806F5CA2EFC0F06F5C17E017E1047F5B17F193383F
+F380A217FF7090CAFCA2705AA3705AA3705AA2705AA3705A53547ED158>86
+D<EC0FF891B5FC010314C090390FF80FF090391FC003FC90397F8001FE49C77E4848EC7F
+804848143F49EC1FC0485A000FED0FE05B001F16F01607485AA2007F16F8A25B160312FF
+90B7FCA30180C9FCA8127F7FA2123FA26D1538121F17786C6C1570000716F06D15E06C6C
+14016C6CEC03C06C6C15806D6C130F6D6CEB1F00D90FF0133C903907FE01F80101B512E0
+6D6C1380DA07FCC7FC2D367DB434>101 D<1378EA01FE487E487FA66C90C7FC6C5AEA00
+7890C8FCB0EB7F80B5FCA41203C6FC137FB3B3A43801FFE0B61280A419507CCF21>105
+D<EB7F80B5FCA41203C6FC137FB3B3B3B13801FFE0B612C0A41A537CD221>108
+D<01FFEB07FCB590383FFF8092B512E0913901F00FF8913903C007FC000349C66C7EC601
+0E13016D486D7E5C143002706E7E146014E05CA35CB3AD2601FFE0903801FFE0B600C0B6
+12C0A43A347CB341>110 D<EC0FFC91387FFF8049B512E0903907F807F890391FE001FE
+90393F80007F017EC7EA1F80496E7E48486E7E00038248486E7EA248486E7EA248486E7E
+A2003F82A24848ED7F80A400FF17C0AB007F1780A26D15FFA2003F1700A2001F5E6D1401
+000F5E6D140300075E6C6C4A5A6C6C4A5AA2D8007FEC3F806D6C49C7FC90391FE001FE90
+3907F807F86DB55AD9007F1380DA0FFCC8FC32367CB43B>I<01FFEB1F80B5EB7FF09138
+01FFF8913803E1FC91380783FE0003EB0F07C6131EEB7F1C1438143091387003FC913860
+00F0160014E05CA45CB3AA8048487EB612F0A427347DB32E>114
+D<D907FE13C090387FFF8148B512E33907F803FF390FC0007F4848133F48C7121F003E14
+0F007E1407127C00FC1403A315017EA27E7F6C6C90C7FC13F013FF6C13F86CEBFF806C14
+E06C14F86C14FEC680013F1480010714C0D9003F13E014039138007FF0151F00E0140FED
+07F8A26C1403A215017EA36C15F0A26C14036C15E015076DEB0FC06DEB1F80D8FDF0EB3F
+0039F8FC01FE39F07FFFF8D8E01F13E0D8C00390C7FC25367CB42E>I<D97F80EC7F80B5
+91B5FCA400031503C61500017F157FB3AC17FFA35EA3013F5C6EEB077FA2011F020E7F6D
+6C011C13F06E0178EBFFC0903903FC01F06DB512E06D6C1380912607FC00EB80003A357C
+B341>117 D<B60103B51280A4000301F09039007FF800C601C0EC3FE0017FED1F8095C7
+FC133F6E141E131F171C6E143C010F15388001075DA26E14F001035D8001014A5AA26E13
+036D5D1580027F49C8FCA26F5A023F130E15E0021F5BA2EDF03C020F133815F802075BA2
+EDFCF002035B15FE6E6C5AA36E5BA26FC9FCA3153EA2151CA2153C153815781570A215F0
+5D14015DA2003E495A127F486C48CAFCA2140E141E495A6C5B007C5B383F03E06CB45A00
+075BD801FCCBFC394B7EB23E>121 D E
 %EndDVIPSBitmapFont
 %DVIPSBitmapFont: Fl cmbx12 17.28 20
 /Fl 20 117 df<F00FE04E7EA24E7EA34E7EA24E7EA34D7FA24D80A24D80A34D80A24D80
@@ -1776,8 +1794,8 @@ A25B5B5B5B137F48B5FC000F91B512FEB8FCA5D8001F01E0C8FCB3AFEF0FC0AC171F6D6D
 1480A2173F6D16006F5B6D6D137E6D6D5B6DEBFF836EEBFFF86E5C020F14C002035C9126
 003FFCC7FC325C7DDA3F>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fm cmbx12 24.88 40
-/Fm 40 123 df[<96380FFFFE060FB612E04DB712FC051F16FF94B912C0040784041F18
+%DVIPSBitmapFont: Fm cmbx12 24.88 41
+/Fm 41 123 df[<96380FFFFE060FB612E04DB712FC051F16FF94B912C0040784041F18
 F8047F9126FC001F7F4BB6008001017F030702F8C8EA3FFF4B02E0030F7F033F02804B7F
 4B49C9127F92B54893B57E4A02F05D4A4A4B804A4A5D4A4A84634A91C9FC4A5BA24A5B51
 80755C91B5FC5EA3755CA2755C755C755CE23FFEC8FCF40FF899CAFCAF083FB612FCBFFC
@@ -1842,162 +1860,164 @@ C0051F90B5FC4B92CB7E033F02FC18034B02F08492B648844A0380193F4A92CD7E4A4A86
 806E03C0606E816F02F8606F02FE60030F6E606F03E0173F030103F85F6F03FF933801FF
 FC043F03E00307497E040F03FF033F497E040304FC0107B5EAE00F040093B8487E053FF2
 0001050F07FCEB007F050107F0141FDD003F06C01407060795C81201DE007F04F8ED0070
-0703048093C8FCDF000302E0CDFC>157 146 115 271 183 I[<BC12C0A9C7000103E0C8
-FCB3B3B3B3B3B3B0BC12C0A9>74 142 122 269 87 73 D[<BC12F8A9C7000303C0CEFC
-B3B3B3B3A5F8FF80A4672100A667A368A21F07A41F0FA3555AA21F3FA21F7FA21FFFA266
-6668666666666653B5FC65650B1F5C1D7F0A03B6FC1C1F0903B7FCC1FCA468A5>121
-142 120 269 140 76 D[<B900E04EB912F884848484A2848585C700037094C7000302FC
-C7FC73DF000F90C8FC7C5A85858585A27081708170817081868270817081708187837181
-718171817181A2718171817181728188847281728172817281A272817281738173818985
-738173817381898573817481748174818A867481748174818A8675817581758175818B87
-7581758175818C887681768176817681A276817681768177158021C0897715E07715F077
-15F87715FCA27715FE7715FF7815877815C722E78A7815F77815FF8AA28A8A8B8B8BA28B
-8B8B8BA28B8C8C8C8CA28C8C8C8CA28D8D8D8D8DA24A6D8849B500FE88B900FC86227FA2
-223F221F220F2207A27C5A>165 142 120 269 182 78 D[<97B512F0077FECFFE00607
-B712FE067FEEFFE00503B912FC051FF0FF80057F19E00403BB12FC040F9226E0007F14FF
-043F02FCC7000315C04C02E0DA007F804BB60080031F14F8030702FCC9000314FE4B4A70
-804B02E0706C80037F0280051F14E092B6CB6C804A4A72804A4A72804A02F00600804A4A
-737F4A4A73804A8B4A4A738091B6CD6C80494A7480A2494A7480494A7480498C4C86498D
-4C87498D494A7580A290B68B4C87488EA24892CF6C80A3488E4B88A2488EA3484A761580
-A34823C0A5484A7615E0A7B621F0B36C23E0A26F64A56C23C0A46F646C2380A36C23006F
-64A26C6AA270636C6AA26C6A70636C6A70636D69A26D6E98B65AA26D6E505DA26D6E5092
-C7FC6D6870626D6E505C6D686D6F4F5C6E6E4F5C6E6E4F5CA26E6E96B65A6E6E4E92C8FC
-6E6E4E5C020102FF060F14F86E6F4D5C6F6E4D5C6F02F094B65A030F6E4C92C9FC6F02FE
-04075C03016E6C031F14F86F03F092B65A043F02FE020715C0040FDAFFF090B7CAFC0403
-92B812FC04001AF0051F198005074ECBFCDD007F17E0060F94CCFCDE007F15E0070002F0
-CDFC>148 146 115 271 175 I[<BE12F8F5FFF01EFF1FE01FFCF7FF8020E020F820FEC7
-00030380C8000781E2003F15C00B03810B00810C3F8078800C07807880788178818E8B8E
-8B8E8B8EA28EA28B8EA42380AC2300A46A67A26AA26A676A676A9CB65A6A665492C7FC54
-5C0C1F5C545C9BB612E00B075D0B3F5D0A07B648C8FC95BB12F820E0208055C9FC1FF09C
-CAFC1EF00BF8CBFC06C0D0FCB3B3B2BCFCA9>137 142 120 269
-159 I[<BD12FCF4FFFCF5FFE01EFCF6FFC01FF01FFE797E20E0C700030380C86C15F80A
-0181E2003F14FF0B07810B0115E0776C8078807880788078808A78818E7881A28E8B8EA3
-7980A48EAA6AA3676AA26AA29CB65AA26A545D9FCAFC66545C545C545C545C9BB612C053
-5D0B074ACBFC0B3F5C52B612F00A7F15C095BBCCFC1FF81FC054CDFC66F6FF801FE00680
-C7000315F8E1003F14FE0A0F800A0315C07681766C807780778077808C7781898D898D89
-8DA38A8DAD8DACA1EB1FC0A1EB3FE08D8AA37880A1137FA114C078817818FF7C1580785F
-786F1500BB00FE6F6F5B796E495A7902FEEB1FFC799139FFC07FF80D0792B55A0D015F79
-6C5E0E1F5E0E034BC7FCD4001F14F8E7003F13C0>163 144 120
-269 173 82 D[<93260FFFF8163E4BB600E0153F031F03FE5D037FDBFFC05C0203B800F0
-5B020F05FC5B4A05FF5B027FF0C00F91B526FE000FECF01F010302C0D9007F6D5A4991C8
-00076D5A4901FC030090B6FC4901F0163F4949160F4901808290B5170192CBFC48498448
-49181F87484984A2484984874886A248498588A24887A388A2B58680A36E85A280A26E85
-80A2818103F0725A6C6E96C7FC15FE8116E06C15FEEEFFE017FF6C17F0F0FF806C18F8F1
-FFC06C19FCF2FF806C1AE01BF86C1AFE6C747E6D1AE0886D866D866D1AFF6D876D870100
-87806E86020F86020386020086153F030F851501DB001F19801601DC000F18C0EF007F06
-0717E0F0003F070316F0F1003F1A0F080315F81A00871B1F877514FCA287007F86486C85
-A288A388A36D86A31EF87FA37F1EF0A26D626D1CE0A27F6D5013C0A26E1B806E96B5FC6E
-1B0002F8606E4E5B6E626E6C5F03E04D5B03F84D5B03FE057F5BDBFFC093B55A04F80303
-5C496CD9FF80021F91C7FCD9FC1F02FF49B55AD9F80792B75A496C19F049C66149011F18
-804901074DC8FC90C817F848031F16C048030003FCC9FC007C04011480>102
-146 115 271 129 I[<000FC312F8A6488EA304C0C7001F4AC7120103F8C8F0000F03C0
-1C0192C9737E02FC1E1F4A1E0702E08A4A8A4A8A4890CA757EA249203F49201FA349200F
-A2492007A4492003007F8EA4498CA848487A1380A6CC99C7FCB3B3B3B3AA030FBD12FCA9
->145 140 120 267 162 I[<BC040FB912C0A9C7000303C0CD001F02E0C7FC9E26007FF8
-C8FC7C5AB3B3B3B3B36E555AA3848022FF6BA26F65726481696F9CC9FC72626F66210F6F
-6E505AA26F6E505A6F535A6F6E1AFF734E5B706E4E5B70637002F04E5B706E063F90CAFC
-706E4E5A7002FF4D485A04006F04075B7102E0043F5B7102FC4BB55A050FDAFF80020F14
-807103FC0103B6CBFC050192B812FC716C61061F19E006031980060006FCCCFC071F17F0
-07011780DF001F03F8CDFCE0001F49CEFC>162 144 120 269 179
-I<93B512FC037FECFFF00207B8FC023F17E091B912F84918FE0107727E499126C0007F14
-E04901E0C7000F80496D020380496D020014FE6F6F7F90B570806F6F8085486E6F807380
-A27380A28885886C5CA26D4982886D5B6D5B010713C0010190CAFC90CCFCA90603B7FC05
-0FB8FC0403B9FC167F0307BAFC153F4AB7EA807F020FEDE000023F02FCC7FC91B612E001
-0392C8FC4914FC011F14F04914C0495C90B548C9FC485C485C485C485C5A5D485CA24891
-CAFCA3B6FC5CA397B6FCA461806C60F107EF6C6E150F6F16CF6C183F6FDB7F8F806C6EDB
-FF0F14E06C02FCDA03FE15FE6C6E91260FFC0791B5FC6C6E6CD93FF817806C923AF803FF
-F003013F91B6487E010FEF8000010394C77E010004FC141F021F03F0140702010380DA00
-7F1400DA000701F8CDFC695F79DD71>97 D[<ED1FF0017FB5FCB7FCA9EA003F1307A27F
-B3B296383FFFC00607B512FE063FECFFE04DB712F8050716FF051F17C0057F17F094B5D8
-C00F8004F301FCC714FE04F701E0023F7F93B50080020F804DC86C14E005F80301804D6F
-804D707F05808294CA804C717F4C7180A24C71808BA27680A28B88A28BA28BA3888BA520
-80B02000A56764A267A3676467A2525CA267647062704D91C7FC704D5BA2714C5B7193B5
-5A05F04B5CDCBFF84B5CDC1FFC030F5C4B6CB44B91C8FC7001C0027F5B4B6C01F00103B5
-5A4BC601FF013F14F04B6D90B712C04B011F94C9FC4B6D16FC4B010316F092C86C15804A
-030F02F8CAFC90CB49CBFC>113 144 121 270 129 I<94387FFFF0041FB612E093B712
-FE0307707E031F17F092B97E4A18FE020784021F9126F8000F14804A0280010014C04A49
-C74814E049B500F85C494A17F0494A5C495C494A4A14F84991C8FC5D495B90B5FC5D5A48
-5C7314F05A4B6F14E05A7314C0487214804B93383FFE00F20FF84896C8FCA4485CA5B6FC
-B07EA281A37EA36C80A37E6F18FE6CF201FFA26C6E5F1CFE6C801B076C6EEF0FFC6D7F70
-EE1FF86DF13FF06D6E167F6D6EEEFFE06D02F84B13C06D6E5D6D02FF030F13806D03C002
-3F1300023F02F0903801FFFC6E9126FF801F5B020792B65A6E18C0020060033F4CC7FC03
-0716F8030016C0041F4AC8FCDC007F13C0585F78DD67>I[<F53FE098B6FC4FB7FCA996C7
-7E1B0FA287B3B294383FFF80040FB512FC93B71280030716E0031F16F8037F16FE4AB912
-8702074AC66C13C7021F02E0010713F74A91C890B6FC4A01FC153F49B548150F4902E081
-494A81494A814991CA7E495B8749498390B548835A5D5AA2485CA25A5D5AA35AA25D5AA5
-B6FCB07EA57E81A37EA27EA2817EA26C80A26C626C6E5F636D7F6D6D94B6FC6D606D6D16
-07705D6D6E4B81010102F0157F6D6E92B712FE6E01FE020301EF91B512806E6D6C011F13
-CF020FDAF801B5120F020391B612FE6E17F86E6C16E0030F16800301EDFC00DB003F14E0
-040049C74AC8FC>113 144 120 270 129 I<94387FFFC0040FB6FC93B712E0030716FC
-031F16FF037F17C04AB912F00207DAF80380021F912680003F13FE4A49C7000F7F4A01F8
-02038049B5486E804902C06E6C7F494A6F7F4991C9FC49727F4949707F4B84498490B548
-707F5A4B198048855D481CC086481CE05D5A871DF05AA25D5AA21DF887A2B6FCA392BBFC
-A51DF00380CDFCA77EA4817EA37EA2817EA26CF307F06FF00FF87E816C1B1F6F19F06C1B
-3F6D6DF07FE06D7FF4FFC06D6E4C13806D6E5E6D02F04C13006D6EEE1FFE6D6E4C5A6D6C
-01FFEEFFF86E02E002035B6E02FC021F5B02079126FFC003B55A6E92B7C7FC020060033F
-17F8030F17E003011780DB003F03FCC8FC040315C0DC000F01F8C9FC5D5F7ADD6A>I[<95
-383FFF80050FB512F094B612FE040781041F16C0047F824BB87E0307DAF8077F031FDAC0
-0F7F4B49C6487F4B495B92B500F0814A4A5B4A5C4A93B612805F4A91C7FC5C5E5C5E5C73
-1400A24C6E5B91B56F5BA2735B070313E00700138097C8FCB3A4BA12F8A9C702FCCBFCB3
-B3B3B3A2003FB9FCA9>81 144 121 271 71 I<F5FFC093260FFFFC030F13F04BB600E0
-027F7F031F03FE49B512FE037F9226FF8007800203B8EAF01F020FDDFC3F15804A714813
-3F027FDA003F90B500F014C091B500F80107ED807F4902E00101ECFC00010702806D6C5B
-93C87E49496F7F49496F7F49496F6D6D1380491A8077130090B5486F6E6C5AF503F84875
-C8FCA2484A6F80A44887AB6C63A46C6E4B5CA26C63A26D6D4B5CA26D97C9FC6D6D4B5B6D
-6D4B5B6D6D4B5B705C010102E049B512E06D02F801075C4902FF013F5C4992B648CAFC49
-6002F317F090260FE07F1680031F4BCBFC90261FC00115E0DB000F01FCCCFC013F91CFFC
-A3137FA280A380A28080806E7E15F092B812F06DF0FFE01BFEF3FFC06D1AF81CFE767E6D
-1BE06D87896D1BFE6D877F6E878A0103BD7E130F013F8890BEFC4802E0C9003F814891CB
-FC4801FC180F48490601804849727E484985884849737F88A2B55A88A66E616C65A26E61
-6C6D4F5B6C656E616C6D4F5B6C6D96B55A6C6D6C05035C6F5FC602F0051F49C7FC6D01FC
-057F5B6DD9FF800303B55A010F02F8033F14E06DDAFFE0010FB65A010192B9C8FCD9003F
-19F8020F19E0020196C9FCDA001F17F0030194CAFCDB000192CBFC6A887ADD74>I[<ED1F
-F0017FB5FCB7FCA9EA003F1307A27FB3B2963803FFFC073FEBFFE096B612F8060715FE06
-1F6F7E4E16E095B87E4DD9FC03804DD9C000804D48C76C7FDD0FF880DD1FE0824D486E80
-4D5A05FEC881DCF1FC815F04F385EEF7F04D81EEFFC0A24D84A294C9FCA25EA35EA45EB3
-B3AFB9D8E001B912C0A9>114 143 119 270 129 I[<EC3FC0ECFFF0010313FC497F497F
-498049804980A290B67EA24881A86C5DA26D5CA26D5C6D5C6D91C8FC6D5B6D5B010013F0
-EC3FC091CAFCB3A3ED1FF0017FB5FCB7FCA9EA003F1307A27FB3B3B3B0B91280A9>49
-144 119 271 65 I[<ED1FF0017FB5FCB7FCA9EA003F1307A27FB3B3B3B3B3B3ACB912C0
-A9>50 143 119 270 65 108 D<DB3FE0912601FFFC943801FFFC017FB5031FD9FFE004
-1FEBFFE0B792B600FC93B612FC060303FF030315FF060F04C0020F16C0063F04F0023F16
-F095B86C91B87E4DD9FC036E49D9FC03804DD9C0006E49D9C000804D48C7003F6D4948C7
-003F7FDD0FF86EDB0FF880D8003F4B48714848830107DB3FC06E9126C03FC06E804D484E
-5A6D4BC86F48C881DCE1FE6FDAE1FE814D61DCE3F8DEF3F884DCE7F0F0F7F04D6F4B81DC
-EFC0F0FFC0A2DCFF804F84A294C993C9FCA24C61A34C61A44C61B3B3AFB900E090B900E0
-90B912E0A9B35D77DCC2>I<DB3FE0913803FFFC017FB5033FEBFFE0B792B612F8060715
-FE061F6F7E4E16E095B87E4DD9FC03804DD9C000804D48C76C7FDD0FF880D8003FDB1FE0
-8201074B486E804D5A6D03FEC881DCE1FC815F04E385EEE7F04D81EEEFC0A2DCFF8084A2
-94C9FCA25EA35EA45EB3B3AFB9D8E001B912C0A9725D77DC81>I<94381FFFF00407B612
-C0047F15FC0303B87E030F17E0037F17FC4ABAFC4A9126FC007F80020F02C0010714E04A
-49C880027F01F8033F13FC91B5486F7F4902C003077F494A6F804991C96C804949708049
-49717F49874949717FA290B548717F48884B83481D80A2481DC04B83481DE0A2481DF0A3
-484A7114F8A4481DFCA5B61BFEAF6C1DFCA56C6E4D14F8A36C1DF0A36C1DE06F5F6C1DC0
-A26C6E4D1480A26C1D006F5F6C646D6D4D5B6F94B5FC6D636D6D4C5C6D6E4B5C6D6E4B5C
-6D02F0031F5C6D6E4B91C7FC6D6C01FE92B512FC6ED9FFC001075C6E02FC017F5C020791
-B812C0020196C8FC6E6C17FC031F17F003031780DB007F03FCC9FC040715C0DC001F01F0
-CAFC675F7ADD74>I<DB1FF091381FFFC0017FB50203B6FCB7021F15E095B712FC050316
-FF050F17C0053F17F094B912FC04F1DAC01F8004F79026FC00018093B500E06D6C14C0D8
-003F93C86C8001074B030F8005F86F806D03E06F804D6F804D8194CA6C7F4C864C71805E
-7680A27680A27680A28B88A28BA288A28BA4882080B0200064A467A26467A3525CA26764
-676467647062704D91C7FC7094B55AA2714B5C714B5C714B5C05F84B5C71033F5C05FF4B
-91C8FC06C049B55A04FB01F001075C04F801FF017F14F07190B712C0051F94C9FC7116FC
-050316F0DD007F1580060F02F8CAFC060049CBFC96CDFCB3ACB912E0A9718579DC81>I<
-DB7FC049B47E90B6021F13F8B7027F13FE4DB67E4D15E04D814D814D01077F94263FF00F
-7F94387FC01F4D48487FD8003F16000107DAC1FE491480EEC3FC6D5DEEC7F05F16CF5F16
-DF4D6D1400A204FFC76C5BA2735B4C6E5B735B070013C04C92C8FCA45EA65EB3B3AAB912
-FCA9515D79DC5F>114 D<92261FFFF814F80203B638C001FC023FEDFC0791B8121F0103
-17FF130F013F9038F8001F4990C8FCD9FFF8153F4801E0150F484915034849814890CAFC
-197F4848173F191F485AA2007F180FA31907487EA27FA28002E0705A6E93C8FC14FC14FF
-15F06CECFF8016FCEEFFF06CEEFF8018F06C17FE727E6C18E0856C18FC6C846C727E6C85
-6D84011F846D841303010084023F83140F020183EC001FDB007F16801603DC000F15C017
-00183F060F14E0007F1703486C82727E857F85857FA2857F1BC07FA27F1B806D5F7F1B00
-6E5E6E5F6E163F6E4C5A02FC4C5A6E03035B6E6C4A5B03F0023F5B03FF0107B55A01F991
-B7C7FCD9F07F16FCD9E01F16F0D9800716C0D9000193C8FC48D9003F14F8007C020349C9
-FC4B5F78DD5C>I[<ED03FEA81507A5150FA4151FA3153FA2157FA215FFA25CA25C5CA25C
-5C5C5C91B5FC13035B131F017F91B712F00007BAFCBBFCA7C74AC9FCB3B3AAF101FFB161
-6E17FE82A219076E17FC836EEE0FF871131F6E6EEB3FF071137F6E6EEBFFE06EDAFF0313
-C06E92B512806E1700033F5D6F5D03075D030015E0041F1480040001FCC7FC>72
+0703048093C8FCDF000302E0CDFC>157 146 115 271 183 I[<BC0207BB12F8A9C70003
+03C0CC001F4AC8FCB3B3B395BEFCA906C0CC121FB3B3B3A6BC0207BB12F8A9>165
+142 120 269 182 I[<BC12C0A9C7000103E0C8FCB3B3B3B3B3B3B0BC12C0A9>74
+142 122 269 87 I[<BC12F8A9C7000303C0CEFCB3B3B3B3A5F8FF80A4672100A667A368
+A21F07A41F0FA3555AA21F3FA21F7FA21FFFA2666668666666666653B5FC65650B1F5C1D
+7F0A03B6FC1C1F0903B7FCC1FCA468A5>121 142 120 269 140
+76 D[<B900E04EB912F884848484A2848585C700037094C7000302FCC7FC73DF000F90C8
+FC7C5A85858585A27081708170817081868270817081708187837181718171817181A271
+8171817181728188847281728172817281A2728172817381738189857381738173818985
+73817481748174818A867481748174818A8675817581758175818B877581758175818C88
+7681768176817681A276817681768177158021C0897715E07715F07715F87715FCA27715
+FE7715FF7815877815C722E78A7815F77815FF8AA28A8A8B8B8BA28B8B8B8BA28B8C8C8C
+8CA28C8C8C8CA28D8D8D8D8DA24A6D8849B500FE88B900FC86227FA2223F221F220F2207
+A27C5A>165 142 120 269 182 78 D[<97B512F0077FECFFE00607B712FE067FEEFFE0
+0503B912FC051FF0FF80057F19E00403BB12FC040F9226E0007F14FF043F02FCC7000315
+C04C02E0DA007F804BB60080031F14F8030702FCC9000314FE4B4A70804B02E0706C8003
+7F0280051F14E092B6CB6C804A4A72804A4A72804A02F00600804A4A737F4A4A73804A8B
+4A4A738091B6CD6C80494A7480A2494A7480494A7480498C4C86498D4C87498D494A7580
+A290B68B4C87488EA24892CF6C80A3488E4B88A2488EA3484A761580A34823C0A5484A76
+15E0A7B621F0B36C23E0A26F64A56C23C0A46F646C2380A36C23006F64A26C6AA270636C
+6AA26C6A70636C6A70636D69A26D6E98B65AA26D6E505DA26D6E5092C7FC6D6870626D6E
+505C6D686D6F4F5C6E6E4F5C6E6E4F5CA26E6E96B65A6E6E4E92C8FC6E6E4E5C020102FF
+060F14F86E6F4D5C6F6E4D5C6F02F094B65A030F6E4C92C9FC6F02FE04075C03016E6C03
+1F14F86F03F092B65A043F02FE020715C0040FDAFFF090B7CAFC040392B812FC04001AF0
+051F198005074ECBFCDD007F17E0060F94CCFCDE007F15E0070002F0CDFC>148
+146 115 271 175 I[<BE12F8F5FFF01EFF1FE01FFCF7FF8020E020F820FEC700030380
+C8000781E2003F15C00B03810B00810C3F8078800C07807880788178818E8B8E8B8E8B8E
+A28EA28B8EA42380AC2300A46A67A26AA26A676A676A9CB65A6A665492C7FC545C0C1F5C
+545C9BB612E00B075D0B3F5D0A07B648C8FC95BB12F820E0208055C9FC1FF09CCAFC1EF0
+0BF8CBFC06C0D0FCB3B3B2BCFCA9>137 142 120 269 159 I[<BD12FCF4FFFCF5FFE01E
+FCF6FFC01FF01FFE797E20E0C700030380C86C15F80A0181E2003F14FF0B07810B0115E0
+776C8078807880788078808A78818E7881A28E8B8EA37980A48EAA6AA3676AA26AA29CB6
+5AA26A545D9FCAFC66545C545C545C545C9BB612C0535D0B074ACBFC0B3F5C52B612F00A
+7F15C095BBCCFC1FF81FC054CDFC66F6FF801FE00680C7000315F8E1003F14FE0A0F800A
+0315C07681766C807780778077808C7781898D898D898DA38A8DAD8DACA1EB1FC0A1EB3F
+E08D8AA37880A1137FA114C078817818FF7C1580785F786F1500BB00FE6F6F5B796E495A
+7902FEEB1FFC799139FFC07FF80D0792B55A0D015F796C5E0E1F5E0E034BC7FCD4001F14
+F8E7003F13C0>163 144 120 269 173 82 D[<93260FFFF8163E4BB600E0153F031F03
+FE5D037FDBFFC05C0203B800F05B020F05FC5B4A05FF5B027FF0C00F91B526FE000FECF0
+1F010302C0D9007F6D5A4991C800076D5A4901FC030090B6FC4901F0163F4949160F4901
+808290B5170192CBFC4849844849181F87484984A2484984874886A248498588A24887A3
+88A2B58680A36E85A280A26E8580A2818103F0725A6C6E96C7FC15FE8116E06C15FEEEFF
+E017FF6C17F0F0FF806C18F8F1FFC06C19FCF2FF806C1AE01BF86C1AFE6C747E6D1AE088
+6D866D866D1AFF6D876D87010087806E86020F86020386020086153F030F851501DB001F
+19801601DC000F18C0EF007F060717E0F0003F070316F0F1003F1A0F080315F81A00871B
+1F877514FCA287007F86486C85A288A388A36D86A31EF87FA37F1EF0A26D626D1CE0A27F
+6D5013C0A26E1B806E96B5FC6E1B0002F8606E4E5B6E626E6C5F03E04D5B03F84D5B03FE
+057F5BDBFFC093B55A04F803035C496CD9FF80021F91C7FCD9FC1F02FF49B55AD9F80792
+B75A496C19F049C66149011F18804901074DC8FC90C817F848031F16C048030003FCC9FC
+007C04011480>102 146 115 271 129 I[<000FC312F8A6488EA304C0C7001F4AC71201
+03F8C8F0000F03C01C0192C9737E02FC1E1F4A1E0702E08A4A8A4A8A4890CA757EA24920
+3F49201FA349200FA2492007A4492003007F8EA4498CA848487A1380A6CC99C7FCB3B3B3
+B3AA030FBD12FCA9>145 140 120 267 162 I[<BC040FB912C0A9C7000303C0CD001F02
+E0C7FC9E26007FF8C8FC7C5AB3B3B3B3B36E555AA3848022FF6BA26F65726481696F9CC9
+FC72626F66210F6F6E505AA26F6E505A6F535A6F6E1AFF734E5B706E4E5B70637002F04E
+5B706E063F90CAFC706E4E5A7002FF4D485A04006F04075B7102E0043F5B7102FC4BB55A
+050FDAFF80020F14807103FC0103B6CBFC050192B812FC716C61061F19E0060319800600
+06FCCCFC071F17F007011780DF001F03F8CDFCE0001F49CEFC>162
+144 120 269 179 I<93B512FC037FECFFF00207B8FC023F17E091B912F84918FE010772
+7E499126C0007F14E04901E0C7000F80496D020380496D020014FE6F6F7F90B570806F6F
+8085486E6F807380A27380A28885886C5CA26D4982886D5B6D5B010713C0010190CAFC90
+CCFCA90603B7FC050FB8FC0403B9FC167F0307BAFC153F4AB7EA807F020FEDE000023F02
+FCC7FC91B612E0010392C8FC4914FC011F14F04914C0495C90B548C9FC485C485C485C48
+5C5A5D485CA24891CAFCA3B6FC5CA397B6FCA461806C60F107EF6C6E150F6F16CF6C183F
+6FDB7F8F806C6EDBFF0F14E06C02FCDA03FE15FE6C6E91260FFC0791B5FC6C6E6CD93FF8
+17806C923AF803FFF003013F91B6487E010FEF8000010394C77E010004FC141F021F03F0
+140702010380DA007F1400DA000701F8CDFC695F79DD71>97 D[<ED1FF0017FB5FCB7FC
+A9EA003F1307A27FB3B296383FFFC00607B512FE063FECFFE04DB712F8050716FF051F17
+C0057F17F094B5D8C00F8004F301FCC714FE04F701E0023F7F93B50080020F804DC86C14
+E005F80301804D6F804D707F05808294CA804C717F4C7180A24C71808BA27680A28B88A2
+8BA28BA3888BA52080B02000A56764A267A3676467A2525CA267647062704D91C7FC704D
+5BA2714C5B7193B55A05F04B5CDCBFF84B5CDC1FFC030F5C4B6CB44B91C8FC7001C0027F
+5B4B6C01F00103B55A4BC601FF013F14F04B6D90B712C04B011F94C9FC4B6D16FC4B0103
+16F092C86C15804A030F02F8CAFC90CB49CBFC>113 144 121 270
+129 I<94387FFFF0041FB612E093B712FE0307707E031F17F092B97E4A18FE020784021F
+9126F8000F14804A0280010014C04A49C74814E049B500F85C494A17F0494A5C495C494A
+4A14F84991C8FC5D495B90B5FC5D5A485C7314F05A4B6F14E05A7314C0487214804B9338
+3FFE00F20FF84896C8FCA4485CA5B6FCB07EA281A37EA36C80A37E6F18FE6CF201FFA26C
+6E5F1CFE6C801B076C6EEF0FFC6D7F70EE1FF86DF13FF06D6E167F6D6EEEFFE06D02F84B
+13C06D6E5D6D02FF030F13806D03C0023F1300023F02F0903801FFFC6E9126FF801F5B02
+0792B65A6E18C0020060033F4CC7FC030716F8030016C0041F4AC8FCDC007F13C0585F78
+DD67>I[<F53FE098B6FC4FB7FCA996C77E1B0FA287B3B294383FFF80040FB512FC93B712
+80030716E0031F16F8037F16FE4AB9128702074AC66C13C7021F02E0010713F74A91C890
+B6FC4A01FC153F49B548150F4902E081494A81494A814991CA7E495B8749498390B54883
+5A5D5AA2485CA25A5D5AA35AA25D5AA5B6FCB07EA57E81A37EA27EA2817EA26C80A26C62
+6C6E5F636D7F6D6D94B6FC6D606D6D1607705D6D6E4B81010102F0157F6D6E92B712FE6E
+01FE020301EF91B512806E6D6C011F13CF020FDAF801B5120F020391B612FE6E17F86E6C
+16E0030F16800301EDFC00DB003F14E0040049C74AC8FC>113 144
+120 270 129 I<94387FFFC0040FB6FC93B712E0030716FC031F16FF037F17C04AB912F0
+0207DAF80380021F912680003F13FE4A49C7000F7F4A01F802038049B5486E804902C06E
+6C7F494A6F7F4991C9FC49727F4949707F4B84498490B548707F5A4B198048855D481CC0
+86481CE05D5A871DF05AA25D5AA21DF887A2B6FCA392BBFCA51DF00380CDFCA77EA4817E
+A37EA2817EA26CF307F06FF00FF87E816C1B1F6F19F06C1B3F6D6DF07FE06D7FF4FFC06D
+6E4C13806D6E5E6D02F04C13006D6EEE1FFE6D6E4C5A6D6C01FFEEFFF86E02E002035B6E
+02FC021F5B02079126FFC003B55A6E92B7C7FC020060033F17F8030F17E003011780DB00
+3F03FCC8FC040315C0DC000F01F8C9FC5D5F7ADD6A>I[<95383FFF80050FB512F094B612
+FE040781041F16C0047F824BB87E0307DAF8077F031FDAC00F7F4B49C6487F4B495B92B5
+00F0814A4A5B4A5C4A93B612805F4A91C7FC5C5E5C5E5C731400A24C6E5B91B56F5BA273
+5B070313E00700138097C8FCB3A4BA12F8A9C702FCCBFCB3B3B3B3A2003FB9FCA9>81
+144 121 271 71 I<F5FFC093260FFFFC030F13F04BB600E0027F7F031F03FE49B512FE
+037F9226FF8007800203B8EAF01F020FDDFC3F15804A7148133F027FDA003F90B500F014
+C091B500F80107ED807F4902E00101ECFC00010702806D6C5B93C87E49496F7F49496F7F
+49496F6D6D1380491A8077130090B5486F6E6C5AF503F84875C8FCA2484A6F80A44887AB
+6C63A46C6E4B5CA26C63A26D6D4B5CA26D97C9FC6D6D4B5B6D6D4B5B6D6D4B5B705C0101
+02E049B512E06D02F801075C4902FF013F5C4992B648CAFC496002F317F090260FE07F16
+80031F4BCBFC90261FC00115E0DB000F01FCCCFC013F91CFFCA3137FA280A380A2808080
+6E7E15F092B812F06DF0FFE01BFEF3FFC06D1AF81CFE767E6D1BE06D87896D1BFE6D877F
+6E878A0103BD7E130F013F8890BEFC4802E0C9003F814891CBFC4801FC180F4849060180
+4849727E484985884849737F88A2B55A88A66E616C65A26E616C6D4F5B6C656E616C6D4F
+5B6C6D96B55A6C6D6C05035C6F5FC602F0051F49C7FC6D01FC057F5B6DD9FF800303B55A
+010F02F8033F14E06DDAFFE0010FB65A010192B9C8FCD9003F19F8020F19E0020196C9FC
+DA001F17F0030194CAFCDB000192CBFC6A887ADD74>I[<ED1FF0017FB5FCB7FCA9EA003F
+1307A27FB3B2963803FFFC073FEBFFE096B612F8060715FE061F6F7E4E16E095B87E4DD9
+FC03804DD9C000804D48C76C7FDD0FF880DD1FE0824D486E804D5A05FEC881DCF1FC815F
+04F385EEF7F04D81EEFFC0A24D84A294C9FCA25EA35EA45EB3B3AFB9D8E001B912C0A9>
+114 143 119 270 129 I[<EC3FC0ECFFF0010313FC497F497F498049804980A290B67E
+A24881A86C5DA26D5CA26D5C6D5C6D91C8FC6D5B6D5B010013F0EC3FC091CAFCB3A3ED1F
+F0017FB5FCB7FCA9EA003F1307A27FB3B3B3B0B91280A9>49 144
+119 271 65 I[<ED1FF0017FB5FCB7FCA9EA003F1307A27FB3B3B3B3B3B3ACB912C0A9>
+50 143 119 270 65 108 D<DB3FE0912601FFFC943801FFFC017FB5031FD9FFE0041FEB
+FFE0B792B600FC93B612FC060303FF030315FF060F04C0020F16C0063F04F0023F16F095
+B86C91B87E4DD9FC036E49D9FC03804DD9C0006E49D9C000804D48C7003F6D4948C7003F
+7FDD0FF86EDB0FF880D8003F4B48714848830107DB3FC06E9126C03FC06E804D484E5A6D
+4BC86F48C881DCE1FE6FDAE1FE814D61DCE3F8DEF3F884DCE7F0F0F7F04D6F4B81DCEFC0
+F0FFC0A2DCFF804F84A294C993C9FCA24C61A34C61A44C61B3B3AFB900E090B900E090B9
+12E0A9B35D77DCC2>I<DB3FE0913803FFFC017FB5033FEBFFE0B792B612F8060715FE06
+1F6F7E4E16E095B87E4DD9FC03804DD9C000804D48C76C7FDD0FF880D8003FDB1FE08201
+074B486E804D5A6D03FEC881DCE1FC815F04E385EEE7F04D81EEEFC0A2DCFF8084A294C9
+FCA25EA35EA45EB3B3AFB9D8E001B912C0A9725D77DC81>I<94381FFFF00407B612C004
+7F15FC0303B87E030F17E0037F17FC4ABAFC4A9126FC007F80020F02C0010714E04A49C8
+80027F01F8033F13FC91B5486F7F4902C003077F494A6F804991C96C8049497080494971
+7F49874949717FA290B548717F48884B83481D80A2481DC04B83481DE0A2481DF0A3484A
+7114F8A4481DFCA5B61BFEAF6C1DFCA56C6E4D14F8A36C1DF0A36C1DE06F5F6C1DC0A26C
+6E4D1480A26C1D006F5F6C646D6D4D5B6F94B5FC6D636D6D4C5C6D6E4B5C6D6E4B5C6D02
+F0031F5C6D6E4B91C7FC6D6C01FE92B512FC6ED9FFC001075C6E02FC017F5C020791B812
+C0020196C8FC6E6C17FC031F17F003031780DB007F03FCC9FC040715C0DC001F01F0CAFC
+675F7ADD74>I<DB1FF091381FFFC0017FB50203B6FCB7021F15E095B712FC050316FF05
+0F17C0053F17F094B912FC04F1DAC01F8004F79026FC00018093B500E06D6C14C0D8003F
+93C86C8001074B030F8005F86F806D03E06F804D6F804D8194CA6C7F4C864C71805E7680
+A27680A27680A28B88A28BA288A28BA4882080B0200064A467A26467A3525CA267646764
+67647062704D91C7FC7094B55AA2714B5C714B5C714B5C05F84B5C71033F5C05FF4B91C8
+FC06C049B55A04FB01F001075C04F801FF017F14F07190B712C0051F94C9FC7116FC0503
+16F0DD007F1580060F02F8CAFC060049CBFC96CDFCB3ACB912E0A9718579DC81>I<DB7F
+C049B47E90B6021F13F8B7027F13FE4DB67E4D15E04D814D814D01077F94263FF00F7F94
+387FC01F4D48487FD8003F16000107DAC1FE491480EEC3FC6D5DEEC7F05F16CF5F16DF4D
+6D1400A204FFC76C5BA2735B4C6E5B735B070013C04C92C8FCA45EA65EB3B3AAB912FCA9
+515D79DC5F>114 D<92261FFFF814F80203B638C001FC023FEDFC0791B8121F010317FF
+130F013F9038F8001F4990C8FCD9FFF8153F4801E0150F484915034849814890CAFC197F
+4848173F191F485AA2007F180FA31907487EA27FA28002E0705A6E93C8FC14FC14FF15F0
+6CECFF8016FCEEFFF06CEEFF8018F06C17FE727E6C18E0856C18FC6C846C727E6C856D84
+011F846D841303010084023F83140F020183EC001FDB007F16801603DC000F15C0170018
+3F060F14E0007F1703486C82727E857F85857FA2857F1BC07FA27F1B806D5F7F1B006E5E
+6E5F6E163F6E4C5A02FC4C5A6E03035B6E6C4A5B03F0023F5B03FF0107B55A01F991B7C7
+FCD9F07F16FCD9E01F16F0D9800716C0D9000193C8FC48D9003F14F8007C020349C9FC4B
+5F78DD5C>I[<ED03FEA81507A5150FA4151FA3153FA2157FA215FFA25CA25C5CA25C5C5C
+5C91B5FC13035B131F017F91B712F00007BAFCBBFCA7C74AC9FCB3B3AAF101FFB1616E17
+FE82A219076E17FC836EEE0FF871131F6E6EEB3FF071137F6E6EEBFFE06EDAFF0313C06E
+92B512806E1700033F5D6F5D03075D030015E0041F1480040001FCC7FC>72
 132 124 258 90 I<DB0FF8F01FF0017FB594B6FCB74BB7FCA9D8003F94C77E0107190F
 A26D85B3B3B063A463A263A27F6398B6FCA26DF001FB7015036EEF07F3E00FE3806E6D15
 1FE07FC314FF6E6D6CDAFF83EDFFC06E6E010313036E02FCEB3FFE6E91B612FC020017F8
@@ -2036,866 +2056,992 @@ end
 %%BeginSetup
 %%Feature: *Resolution 600dpi
 TeXDict begin
-%%PaperSize: A4
 
 %%EndSetup
 %%Page: 1 1
-1 0 bop 777 1799 a Fm(CFITSIO)76 b(User's)g(Guide)727
+1 0 bop 240 1799 a Fm(CFITSIO)76 b(User's)g(Reference)i(Guide)727
 2258 y Fl(An)53 b(In)l(terface)f(to)i(FITS)g(F)-13 b(ormat)53
 b(Files)1263 2518 y(for)h(C)f(Programmers)1667 3013 y
-Fk(V)-10 b(ersion)38 b(2.1)1727 3916 y Fj(HEASAR)m(C)1764
+Fk(V)-10 b(ersion)38 b(2.5)1727 3916 y Fj(HEASAR)m(C)1764
 4029 y(Co)s(de)30 b(662)1363 4142 y(Go)s(ddard)f(Space)i(Fligh)m(t)f
 (Cen)m(ter)1522 4255 y(Green)m(b)s(elt,)g(MD)i(20771)1857
-4367 y(USA)1607 5239 y Fk(Octob)s(er)38 b(2000)p eop
+4367 y(USA)1704 5227 y Fk(July)38 b(2004)p eop
 %%Page: 2 2
 2 1 bop 0 299 a Fj(ii)p eop
 %%Page: 3 3
 3 2 bop 0 1267 a Fm(Con)-6 b(ten)g(ts)0 1858 y Fi(1)84
-b(In)m(tro)s(duction)3136 b(1)0 2118 y(2)119 b(Creating)34
-b(the)h(CFITSIO)e(Library)2256 b(3)136 2280 y Fj(2.1)94
-b(Building)28 b(the)i(Library)57 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(3)345 2442
-y(2.1.1)137 b(Unix)29 b(Systems)84 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+b(In)m(tro)s(duction)3136 b(1)136 2020 y Fj(1.1)125 b(A)30
+b(Brief)g(Ov)m(erview)84 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
 (.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(4)345 2604
-y(2.1.2)106 b(VMS)33 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(5)345
-2766 y(2.1.3)106 b(Windo)m(ws)30 b(PCs)g(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(5)345
-2928 y(2.1.4)106 b(OS/2)94 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(5)345
-3090 y(2.1.5)106 b(Macin)m(tosh)31 b(PCs)55 b(.)46 b(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(6)136
-3252 y(2.2)94 b(T)-8 b(esting)31 b(the)f(Library)i(.)46
+g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(1)136 2182
+y(1.2)94 b(Sources)30 b(of)h(FITS)f(Soft)m(w)m(are)h(and)f(Information)
+37 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(1)136 2344 y(1.3)94
+b(Ac)m(kno)m(wledgemen)m(ts)60 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(2)136 2506
+y(1.4)94 b(Legal)31 b(Stu\013)92 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131
+b(3)0 2766 y Fi(2)119 b(Creating)34 b(the)h(CFITSIO)e(Library)2256
+b(5)136 2928 y Fj(2.1)94 b(Building)28 b(the)i(Library)57
+b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)131 b(5)345 3090 y(2.1.1)106 b(Unix)30 b(Systems)44
+b(.)h(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+f(.)131 b(5)345 3252 y(2.1.2)106 b(VMS)33 b(.)46 b(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131
+b(7)345 3413 y(2.1.3)106 b(Windo)m(ws)30 b(PCs)g(.)45
+b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)
+131 b(7)345 3575 y(2.1.4)106 b(Macin)m(tosh)31 b(PCs)55
+b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
+(.)131 b(7)136 3737 y(2.2)94 b(T)-8 b(esting)31 b(the)f(Library)i(.)46
 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
 (.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)131 b(6)136 3413 y(2.3)94 b(Linking)29 b(Programs)h(with)f(CFITSIO)
+f(.)131 b(8)136 3899 y(2.3)94 b(Linking)29 b(Programs)h(with)f(CFITSIO)
 45 b(.)g(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(7)136
-3575 y(2.4)94 b(Getting)31 b(Started)g(with)e(CFITSIO)60
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(9)136
+4061 y(2.4)94 b(Getting)31 b(Started)g(with)e(CFITSIO)60
 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
 h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131
-b(7)136 3737 y(2.5)94 b(Example)30 b(Program)86 b(.)46
+b(9)136 4223 y(2.5)94 b(Example)30 b(Program)86 b(.)46
 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
 (.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)131 b(8)136 3899 y(2.6)94 b(Legal)31 b(Stu\013)92
-b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(9)136 4061 y(2.7)94
-b(Ac)m(kno)m(wledgemen)m(ts)60 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(10)0 4321
-y Fi(3)119 b(A)35 b(FITS)f(Primer)2917 b(13)0 4581 y(4)119
-b(Extended)35 b(File)f(Name)g(Syn)m(tax)2330 b(15)136
-4742 y Fj(4.1)94 b(Ov)m(erview)83 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(15)136 4904 y(4.2)94 b(Detailed)31 b(Filename)f(Syn)m(tax)61
+f(.)85 b(10)0 4483 y Fi(3)119 b(A)35 b(FITS)f(Primer)2917
+b(13)0 4742 y(4)119 b(Programming)35 b(Guidelines)2482
+b(15)136 4904 y Fj(4.1)94 b(CFITSIO)29 b(De\014nitions)42
+b(.)j(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+f(.)85 b(15)136 5066 y(4.2)94 b(Curren)m(t)30 b(Header)h(Data)h(Unit)d
+(\(CHDU\))87 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(17)136 5228 y(4.3)94 b(F)-8 b(unction)31 b(Names)f(and)g(V)-8
+b(ariable)30 b(Datat)m(yp)s(es)41 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(18)136 5390 y(4.4)94 b(Supp)s(ort)29 b(for)h(Unsigned)f(In)m(tegers)i
+(and)f(Signed)f(Bytes)86 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(19)136 5552
+y(4.5)94 b(Dealing)31 b(with)e(Character)h(Strings)60
+b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
+h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(21)136 5714 y(4.6)94 b(Implicit)28 b(Data)k(T)m(yp)s(e)e(Con)m(v)m
+(ersion)64 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(22)1912 5942 y(iii)p eop
+%%Page: 4 4
+4 3 bop 0 299 a Fj(iv)3310 b Fh(CONTENTS)136 555 y Fj(4.7)94
+b(Data)32 b(Scaling)87 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(22)136
+720 y(4.8)94 b(Supp)s(ort)29 b(for)h(IEEE)g(Sp)s(ecial)e(V)-8
+b(alues)67 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(23)136 885 y(4.9)94 b(Error)30 b(Status)g(V)-8 b(alues)31
+b(and)e(the)i(Error)e(Message)j(Stac)m(k)44 b(.)i(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(23)136 1049 y(4.10)49 b(V)-8 b(ariable-Length)31 b(Arra)m(ys)f(in)f
+(Binary)h(T)-8 b(ables)30 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(24)136 1214 y(4.11)49 b(Multiple)29 b(Access)i(to)g(the)g(Same)f
+(FITS)g(File)f(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(25)136 1379 y(4.12)49 b(When)31 b(the)f(Final)f(Size)h(of)h(the)f
+(FITS)g(HDU)h(is)e(Unkno)m(wn)34 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(26)136
+1543 y(4.13)49 b(CFITSIO)29 b(Size)h(Limitations)39 b(.)46
+b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(26)0 1817 y Fi(5)f(Basic)36 b(CFITSIO)d(In)m(terface)h(Routines)2074
+b(29)136 1982 y Fj(5.1)94 b(CFITSIO)29 b(Error)h(Status)g(Routines)88
+b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(29)136
+2146 y(5.2)94 b(FITS)30 b(File)g(Access)h(Routines)f(.)46
+b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(30)136 2311 y(5.3)94 b(HDU)32 b(Access)f(Routines)71
+b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
+(.)85 b(33)136 2476 y(5.4)94 b(Header)31 b(Keyw)m(ord)f(Read/W)-8
+b(rite)32 b(Routines)39 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(34)345 2640 y(5.4.1)106 b(Keyw)m(ord)30 b(Reading)g(Routines)64
+b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(35)345
+2805 y(5.4.2)106 b(Keyw)m(ord)30 b(W)-8 b(riting)30 b(Routines)85
+b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(37)136
+2970 y(5.5)94 b(Primary)29 b(Arra)m(y)i(or)f(IMA)m(GE)i(Extension)d
+(I/O)h(Routines)53 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(39)136 3135 y(5.6)94
+b(Image)32 b(Compression)e(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
+g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(42)136 3299
+y(5.7)94 b(ASCI)s(I)29 b(and)h(Binary)g(T)-8 b(able)30
+b(Routines)84 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(45)345 3464 y(5.7.1)106 b(Create)32 b(New)e(T)-8 b(able)83
 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
 g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(17)345 5066 y(4.2.1)106 b(Filet)m(yp)s(e)52 b(.)45
+b(45)345 3629 y(5.7.2)106 b(Column)29 b(Information)g(Routines)h(.)46
+b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(45)345 3793 y(5.7.3)106
+b(Routines)30 b(to)h(Edit)e(Ro)m(ws)i(or)f(Columns)38
+b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)
+f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(48)345 3958 y(5.7.4)106
+b(Read)31 b(and)f(W)-8 b(rite)30 b(Column)f(Data)j(Routines)65
+b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)f(.)85 b(49)345 4123 y(5.7.5)106 b(Ro)m(w)31
+b(Selection)f(and)g(Calculator)f(Routines)87 b(.)46 b(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(51)136 4287 y(5.8)94 b(Utilit)m(y)30 b(Routines)c(.)45
 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
 (.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)f(.)85 b(18)345 5228 y(4.2.2)106 b(Base)32 b(Filename)79
-b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
-(.)85 b(21)345 5390 y(4.2.3)106 b(Output)30 b(File)f(Name)i(when)f(Op)s
-(ening)e(an)i(Existing)f(File)71 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(22)345 5552 y(4.2.4)106
-b(T)-8 b(emplate)31 b(File)e(Name)j(when)d(Creating)h(a)h(New)f(File)47
-b(.)f(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(23)345 5714 y(4.2.5)106 b(HDU)31 b(Lo)s(cation)g(Sp)s(eci\014cation)
-36 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(27)1912
-5942 y(iii)p eop
-%%Page: 4 4
-4 3 bop 0 299 a Fj(iv)3310 b Fh(CONTENTS)345 555 y Fj(4.2.6)106
-b(Image)32 b(Section)e(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)
-f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(28)345 717 y(4.2.7)106
-b(Column)29 b(and)h(Keyw)m(ord)g(Filtering)e(Sp)s(eci\014cation)80
-b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)85 b(29)345 879 y(4.2.8)106 b(Ro)m(w)31 b(Filtering)e(Sp)s
-(eci\014cation)71 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+h(.)g(.)f(.)85 b(53)345 4452 y(5.8.1)106 b(File)30 b(Chec)m(ksum)g
+(Routines)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
 (.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(30)345 1041 y(4.2.9)106 b(Binning)29 b(or)h(Histogramming)g(Sp)s
-(eci\014cation)51 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
-(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(37)0 1302 y Fi(5)f(CFITSIO)33
-b(Con)m(v)m(en)m(tions)j(and)e(Guidelines)1918 b(41)136
-1464 y Fj(5.1)94 b(CFITSIO)29 b(De\014nitions)42 b(.)j(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(41)136 1626 y(5.2)94 b(CFITSIO)29 b(Size)h(Limitations)39
-b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(43)136 1788 y(5.3)94 b(Multiple)29 b(Access)i(to)g(the)g(Same)f(FITS)
-g(File)f(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(44)136
-1951 y(5.4)94 b(Curren)m(t)30 b(Header)h(Data)h(Unit)d(\(CHDU\))87
-b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(44)136 2113
-y(5.5)94 b(F)-8 b(unction)31 b(Names)f(and)g(Datat)m(yp)s(es)47
-b(.)f(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(44)136 2275 y(5.6)94 b(Unsigned)29 b(In)m(tegers)f(.)46
-b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)f(.)85 b(46)136 2437 y(5.7)94 b(Character)31 b(Strings)i(.)46
-b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)f(.)85 b(48)136 2599 y(5.8)94 b(Implicit)28 b(Data)k(T)m(yp)s(e)e
-(Con)m(v)m(ersion)64 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)85 b(49)136 2761 y(5.9)94 b(Data)32 b(Scaling)87
-b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)f(.)85 b(49)136 2923 y(5.10)49 b(Error)30
-b(Status)g(V)-8 b(alues)31 b(and)e(the)i(Error)e(Message)j(Stac)m(k)44
-b(.)i(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)f(.)85 b(50)136 3085 y(5.11)49 b(V)-8 b(ariable-Length)31
-b(Arra)m(ys)f(in)f(Binary)h(T)-8 b(ables)30 b(.)46 b(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
-(.)f(.)85 b(50)136 3247 y(5.12)49 b(Supp)s(ort)29 b(for)h(IEEE)g(Sp)s
-(ecial)e(V)-8 b(alues)67 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)85 b(52)136 3409 y(5.13)49 b(When)31 b(the)f(Final)f(Size)h(of)h
-(the)f(FITS)g(HDU)h(is)e(Unkno)m(wn)34 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(52)136
-3571 y(5.14)49 b(Lo)s(cal)31 b(FITS)e(Con)m(v)m(en)m(tions)i(supp)s
-(orted)d(b)m(y)j(CFITSIO)77 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(53)345 3734
-y(5.14.1)61 b(Long)31 b(String)e(Keyw)m(ord)h(V)-8 b(alues.)56
-b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(53)345 3896
-y(5.14.2)61 b(Arra)m(ys)31 b(of)f(Fixed-Length)g(Strings)f(in)g(Binary)
-h(T)-8 b(ables)69 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)f(.)85 b(54)345 4058 y(5.14.3)61 b(Keyw)m(ord)30
-b(Units)g(Strings)i(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)85 b(54)345 4220 y(5.14.4)61 b(HIERAR)m(CH)31 b(Con)m(v)m(en)m
-(tion)g(for)f(Extended)g(Keyw)m(ord)g(Names)83 b(.)45
-b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(55)136
-4382 y(5.15)49 b(Optimizing)28 b(Co)s(de)i(for)g(Maxim)m(um)g(Pro)s
-(cessing)g(Sp)s(eed)44 b(.)i(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(56)345 4544 y(5.15.1)61
-b(Bac)m(kground)31 b(Information:)40 b(Ho)m(w)31 b(CFITSIO)e(Manages)j
-(Data)g(I/O)91 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(56)345 4706 y(5.15.2)61 b(Optimization)29 b(Strategies)68
-b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(57)0 4967 y Fi(6)119 b(The)35 b(CFITSIO)e(Iterator)g(F)-9
-b(unction)2154 b(61)136 5129 y Fj(6.1)94 b(The)30 b(Iterator)i(W)-8
+b(53)345 4617 y(5.8.2)106 b(Date)32 b(and)e(Time)f(Utilit)m(y)h
+(Routines)89 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(54)345
+4781 y(5.8.3)106 b(General)31 b(Utilit)m(y)e(Routines)j(.)46
+b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(55)0
+5055 y Fi(6)119 b(The)35 b(CFITSIO)e(Iterator)g(F)-9
+b(unction)2154 b(63)136 5220 y Fj(6.1)94 b(The)30 b(Iterator)i(W)-8
 b(ork)31 b(F)-8 b(unction)44 b(.)h(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
 (.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)f(.)85 b(62)136 5291 y(6.2)94 b(The)30 b(Iterator)i(Driv)m
+f(.)h(.)g(.)f(.)85 b(64)136 5385 y(6.2)94 b(The)30 b(Iterator)i(Driv)m
 (er)e(F)-8 b(unction)77 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
 h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)f(.)85 b(64)136 5453 y(6.3)94 b(Guidelines)28
+(.)g(.)f(.)85 b(66)136 5549 y(6.3)94 b(Guidelines)28
 b(for)i(Using)g(the)g(Iterator)i(F)-8 b(unction)44 b(.)i(.)g(.)f(.)h(.)
 g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
-(.)f(.)85 b(65)0 5714 y Fi(7)119 b(Basic)36 b(CFITSIO)d(In)m(terface)h
-(Routines)2039 b(67)p eop
+(.)f(.)85 b(67)136 5714 y(6.4)94 b(Complete)31 b(List)e(of)i(Iterator)g
+(Routines)61 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(68)p eop
 %%Page: 5 5
-5 4 bop 0 299 a Fh(CONTENTS)3334 b Fj(v)136 555 y(7.1)94
-b(CFITSIO)29 b(Error)h(Status)g(Routines)88 b(.)45 b(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)f(.)85 b(67)136 718 y(7.2)94 b(FITS)30
-b(File)g(Access)h(Routines)f(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g
-(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)f(.)85 b(68)136 881 y(7.3)94 b(HDU)32
-b(Access)f(Routines)71 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)f(.)85 b(71)136 1044 y(7.4)94 b(Header)31
-b(Keyw)m(ord)f(Read/W)-8 b(rite)32 b(Routines)39 b(.)45
-b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
-(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(73)136 1208 y(7.5)94
-b(Iterator)32 b(Routines)50 b(.)c(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(76)136 1371
-y(7.6)94 b(Primary)29 b(Arra)m(y)i(or)f(IMA)m(GE)i(Extension)d(I/O)h
-(Routines)53 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)f(.)85 b(78)136 1534 y(7.7)94 b(ASCI)s(I)29
-b(and)h(Binary)g(T)-8 b(able)30 b(Routines)84 b(.)46
-b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(80)345 1697
-y(7.7.1)106 b(Column)29 b(Information)g(Routines)101
-b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(80)345 1860
-y(7.7.2)106 b(Routines)30 b(to)h(Edit)e(Ro)m(ws)i(or)f(Columns)109
-b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)f(.)85 b(82)345 2023 y(7.7.3)106
-b(Read)31 b(and)f(W)-8 b(rite)30 b(Column)f(Data)j(Routines)65
-b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)f(.)85 b(83)136 2186 y(7.8)94 b(Celestial)30
-b(Co)s(ordinate)f(System)h(Routines)78 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g
+5 4 bop 0 299 a Fh(CONTENTS)3334 b Fj(v)0 555 y Fi(7)119
+b(Celestial)34 b(Co)s(ordinate)h(System)f(Routines)1882
+b(71)136 717 y Fj(7.1)125 b(Self-con)m(tained)30 b(W)m(CS)g(Routines)e
+(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(72)0 978 y Fi(8)119 b(Hierarc)m(hical)36 b(Grouping)g(Routines)2163
+b(75)136 1140 y Fj(8.1)94 b(Grouping)29 b(T)-8 b(able)30
+b(Routines)86 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
+g(.)f(.)85 b(76)136 1302 y(8.2)94 b(Group)30 b(Mem)m(b)s(er)g(Routines)
+g(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(78)0 1563 y Fi(9)119 b(Sp)s(ecialized)36 b(CFITSIO)d(In)m(terface)h
+(Routines)1777 b(81)136 1725 y Fj(9.1)94 b(FITS)30 b(File)g(Access)h
+(Routines)f(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
 (.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)85 b(85)345 2349 y(7.8.1)137 b(Self-con)m(tained)30
-b(W)m(CS)g(Routines)91 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+f(.)85 b(81)136 1887 y(9.2)94 b(HDU)32 b(Access)f(Routines)71
+b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
+(.)85 b(84)136 2049 y(9.3)94 b(Sp)s(ecialized)29 b(Header)h(Keyw)m(ord)
+h(Routines)73 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(86)345 2211 y(9.3.1)106 b(Header)31 b(Information)e(Routines)63
+b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(86)345 2373
+y(9.3.2)106 b(Read)31 b(and)f(W)-8 b(rite)30 b(the)h(Required)e(Keyw)m
+(ords)51 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(86)345 2536 y(9.3.3)106
+b(W)-8 b(rite)31 b(Keyw)m(ord)f(Routines)25 b(.)46 b(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(88)345 2698 y(9.3.4)106
+b(Insert)30 b(Keyw)m(ord)g(Routines)88 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)f(.)85 b(90)345 2860 y(9.3.5)106 b(Read)31
+b(Keyw)m(ord)f(Routines)44 b(.)i(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)85 b(91)345 3022 y(9.3.6)106 b(Mo)s(dify)29 b(Keyw)m(ord)i
+(Routines)k(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
 (.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(86)345 2512 y(7.8.2)106 b(W)m(CS)31 b(Routines)e(that)i(require)e
-(the)i(W)m(CS)f(library)78 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
-(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(87)136 2675 y(7.9)94
-b(Hierarc)m(hical)30 b(Grouping)f(Con)m(v)m(en)m(tion)i(Supp)s(ort)d
-(Routines)59 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)f(.)85 b(89)136 2839 y(7.10)49 b(Ro)m(w)31
-b(Selection)f(and)g(Calculator)g(Routines)24 b(.)45 b(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)f(.)85 b(94)136 3002 y(7.11)49 b(File)30 b(Chec)m(ksum)g
-(Routines)54 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)f(.)85 b(95)136 3165 y(7.12)80 b(Date)32 b(and)d(Time)h(Utilit)
-m(y)f(Routines)68 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(97)136 3328 y(7.13)80 b(General)30 b(Utilit)m(y)f(Routines)81
-b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(98)0 3594 y Fi(8)119 b(Sp)s(ecialized)36 b(CFITSIO)d(In)m(terface)h
-(Routines)1725 b(105)136 3757 y Fj(8.1)94 b(Sp)s(ecialized)29
-b(FITS)g(File)h(Access)h(Routines)58 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)40 b(105)136 3920 y(8.2)94 b(Sp)s(ecialized)29 b(HDU)i(Access)g
-(Routines)e(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
-(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
-b(106)136 4083 y(8.3)94 b(Sp)s(ecialized)29 b(Header)h(Keyw)m(ord)h
-(Routines)73 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
-b(108)345 4246 y(8.3.1)106 b(Header)31 b(Information)e(Routines)63
+b(92)345 3184 y(9.3.7)106 b(Up)s(date)31 b(Keyw)m(ord)f(Routines)25
+b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(93)136
+3346 y(9.4)94 b(De\014ne)31 b(Data)h(Scaling)d(and)h(Unde\014ned)f
+(Pixel)g(P)m(arameters)43 b(.)j(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(94)136 3508 y(9.5)94
+b(Sp)s(ecialized)29 b(FITS)g(Primary)g(Arra)m(y)i(or)f(IMA)m(GE)h
+(Extension)f(I/O)g(Routines)54 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)
+85 b(95)136 3670 y(9.6)94 b(Sp)s(ecialized)29 b(FITS)g(ASCI)s(I)g(and)h
+(Binary)f(T)-8 b(able)30 b(Routines)86 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(99)345
+3832 y(9.6.1)106 b(General)31 b(Column)d(Routines)50
+b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(99)345
+3994 y(9.6.2)106 b(Lo)m(w-Lev)m(el)32 b(T)-8 b(able)30
+b(Access)h(Routines)39 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(100)345 4156 y(9.6.3)106 b(W)-8 b(rite)31 b(Column)e(Data)j(Routines)
+51 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(100)345
+4318 y(9.6.4)106 b(Read)31 b(Column)d(Data)k(Routines)71
+b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(102)0 4579
+y Fi(10)67 b(Extended)35 b(File)f(Name)g(Syn)m(tax)2278
+b(105)136 4741 y Fj(10.1)49 b(Ov)m(erview)83 b(.)46 b(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)40 b(105)136 4903 y(10.2)49 b(Filet)m(yp)s(e)60
+b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(108)345 5066
+y(10.2.1)61 b(Notes)32 b(ab)s(out)e(HTTP)g(pro)m(xy)g(serv)m(ers)k(.)46
+b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(108)345 5228 y(10.2.2)61
+b(Notes)32 b(ab)s(out)e(the)h(ro)s(ot)f(\014let)m(yp)s(e)67
 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
 h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(108)345
-4409 y(8.3.2)106 b(Read)31 b(and)f(W)-8 b(rite)30 b(the)h(Required)e
-(Keyw)m(ords)51 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(109)345 4572 y(8.3.3)106
-b(Sp)s(ecialized)29 b(W)-8 b(rite)30 b(Keyw)m(ord)g(Routines)53
+5390 y(10.2.3)61 b(Notes)32 b(ab)s(out)e(the)h(shmem)e(\014let)m(yp)s
+(e:)69 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(110)136 5552
+y(10.3)49 b(Base)32 b(Filename)88 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
+h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(111)136 5714 y(10.4)49 b(Output)30 b(File)f(Name)i(when)f(Op)s(ening)
+e(an)i(Existing)f(File)79 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(113)p eop
+%%Page: 6 6
+6 5 bop 0 299 a Fj(vi)3310 b Fh(CONTENTS)136 555 y Fj(10.5)49
+b(T)-8 b(emplate)31 b(File)f(Name)h(when)e(Creating)h(a)h(New)f(File)55
+b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)f(.)40 b(114)136 721 y(10.6)49 b(Image)32
+b(Tile-Compression)27 b(Sp)s(eci\014cation)89 b(.)45
+b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(114)136 887 y(10.7)49
+b(HDU)32 b(Lo)s(cation)e(Sp)s(eci\014cation)45 b(.)g(.)h(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(115)136 1053
+y(10.8)49 b(Image)32 b(Section)38 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)
+f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(116)136 1219 y(10.9)49 b(Column)29 b(and)h(Keyw)m(ord)g(Filtering)e
+(Sp)s(eci\014cation)89 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(117)136
+1385 y(10.10)t(Ro)m(w)31 b(Filtering)e(Sp)s(eci\014cation)80
+b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(118)345 1551 y(10.10.1)16 b(General)31 b(Syn)m(tax)44
+b(.)i(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)
+40 b(119)345 1718 y(10.10.2)16 b(Bit)31 b(Masks)43 b(.)j(.)g(.)f(.)h(.)
+g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(121)345 1884 y(10.10.3)16 b(V)-8 b(ector)32 b(Columns)91
+b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(122)345 2050 y(10.10.4)16 b(Go)s(o)s(d)30 b(Time)g(In)m(terv)-5
+b(al)30 b(Filtering)59 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(123)345 2216 y(10.10.5)16 b(Spatial)29 b(Region)i(Filtering)56
 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)f(.)40 b(110)345 4735 y(8.3.4)137
-b(Insert)30 b(Keyw)m(ord)g(Routines)57 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g
+h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(124)345 2382 y(10.10.6)16 b(Example)30 b(Ro)m(w)h(Filters)f(.)45
+b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(126)136 2548 y(10.11)35 b(Binning)28 b(or)i(Histogramming)g(Sp)s
+(eci\014cation)f(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(127)0
+2828 y Fi(11)32 b(T)-9 b(emplate)34 b(Files)2933 b(131)136
+2994 y Fj(11.1)49 b(Detailed)31 b(T)-8 b(emplate)30 b(Line)g(F)-8
+b(ormat)48 b(.)e(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(131)136 3160 y(11.2)49 b(Auto-indexing)29 b(of)i(Keyw)m(ords)73
+b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(132)136 3326 y(11.3)49 b(T)-8 b(emplate)31 b(P)m(arser)g(Directiv)m
+(es)85 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(133)136 3492 y(11.4)49 b(F)-8 b(ormal)31 b(T)-8 b(emplate)31
+b(Syn)m(tax)j(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
+h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+(.)g(.)f(.)40 b(133)136 3658 y(11.5)49 b(Errors)63 b(.)46
+b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(134)136 3824 y(11.6)49
+b(Examples)71 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
 (.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)f(.)40 b(113)345 4898 y(8.3.5)137 b(Sp)s(ecialized)28
-b(Read)i(Keyw)m(ord)h(Routines)41 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g
-(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
-b(114)345 5061 y(8.3.6)137 b(Mo)s(dify)29 b(Keyw)m(ord)h(Routines)75
-b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(115)345
-5225 y(8.3.7)137 b(Sp)s(ecialized)28 b(Up)s(date)i(Keyw)m(ord)g
-(Routines)93 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
-(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(116)136 5388 y(8.4)94
-b(De\014ne)31 b(Data)h(Scaling)d(and)h(Unde\014ned)f(Pixel)g(P)m
-(arameters)43 b(.)j(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)f(.)40 b(117)136 5551 y(8.5)94 b(Sp)s(ecialized)29
-b(FITS)g(Primary)g(Arra)m(y)i(or)f(IMA)m(GE)h(Extension)f(I/O)g
-(Routines)54 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
-b(118)136 5714 y(8.6)94 b(Sp)s(ecialized)29 b(FITS)g(ASCI)s(I)g(and)h
-(Binary)f(T)-8 b(able)30 b(Routines)86 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(123)p
-eop
-%%Page: 6 6
-6 5 bop 0 299 a Fj(vi)3310 b Fh(CONTENTS)345 555 y Fj(8.6.1)106
-b(Column)29 b(Information)g(Routines)h(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)f(.)40 b(123)345 715 y(8.6.2)106 b(Lo)m(w-Lev)m(el)32
-b(T)-8 b(able)30 b(Access)h(Routines)110 b(.)46 b(.)g(.)f(.)h(.)g(.)f
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(134)0
+4105 y Fi(12)67 b(Lo)s(cal)35 b(FITS)g(Con)m(v)m(en)m(tions)2462
+b(137)136 4271 y Fj(12.1)49 b(64-Bit)32 b(Long)f(In)m(tegers)61
+b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)40 b(137)136 4437 y(12.2)49 b(Long)31 b(String)e(Keyw)m(ord)h(V)
+-8 b(alues.)64 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
 (.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)
-40 b(124)345 876 y(8.6.3)106 b(Sp)s(ecialized)29 b(W)-8
-b(rite)30 b(Column)f(Data)j(Routines)79 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)
+40 b(138)136 4603 y(12.3)49 b(Arra)m(ys)31 b(of)f(Fixed-Length)h
+(Strings)d(in)h(Binary)h(T)-8 b(ables)77 b(.)46 b(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(139)136 4769 y(12.4)49 b(Keyw)m(ord)31 b(Units)e(Strings)40
+b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
+(.)40 b(139)136 4935 y(12.5)49 b(HIERAR)m(CH)31 b(Con)m(v)m(en)m(tion)g
+(for)f(Extended)g(Keyw)m(ord)g(Names)91 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)
+g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(140)136 5101
+y(12.6)49 b(Tile-Compressed)29 b(Image)i(F)-8 b(ormat)52
+b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
 h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
-b(124)345 1036 y(8.6.4)106 b(Sp)s(ecialized)29 b(Read)h(Column)f(Data)j
-(Routines)27 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
-(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(125)0 1287 y Fi(A)57
-b(Index)35 b(of)g(Routines)2789 b(129)0 1538 y(B)62 b(P)m(arameter)34
-b(De\014nitions)2598 b(133)0 1789 y(C)60 b(CFITSIO)33
-b(Error)i(Status)f(Co)s(des)2255 b(139)p eop
-%%Page: 1 7
-1 6 bop 0 1225 a Fg(Chapter)65 b(1)0 1687 y Fm(In)-6
-b(tro)6 b(duction)0 2180 y Fj(CFITSIO)38 b(is)h(a)h(mac)m(hine-indep)s
-(enden)m(t)e(library)f(of)j(routines)e(for)i(reading)f(and)g(writing)e
-(data)k(\014les)d(in)h(the)0 2293 y(FITS)c(\(Flexible)f(Image)i(T)-8
-b(ransp)s(ort)34 b(System\))h(data)h(format.)56 b(It)35
-b(can)h(also)f(read)g(IRAF)h(format)f(image)h(\014les)0
-2406 y(b)m(y)c(con)m(v)m(erting)g(them)g(on)g(the)g(\015y)f(in)m(to)h
-(a)g(temp)s(orary)f(FITS)g(format)i(\014le.)44 b(This)30
-b(library)f(is)i(written)g(in)f(ANSI)0 2518 y(C)39 b(and)h(pro)m(vides)
-f(a)h(p)s(o)m(w)m(erful)e(y)m(et)j(simple)d(in)m(terface)j(for)e
-(accessing)i(FITS)e(\014les)g(whic)m(h)f(will)f(run)i(on)h(most)0
-2631 y(commonly)32 b(used)g(computers)h(and)f(w)m(orkstations.)47
-b(CFITSIO)32 b(supp)s(orts)e(all)i(the)h(features)g(describ)s(ed)d(in)i
-(the)0 2744 y(o\016cial)c(NOST)g(de\014nition)f(of)i(the)g(FITS)g
-(format)g(and)f(can)i(read)f(and)f(write)g(all)g(the)h(curren)m(tly)f
-(de\014ned)g(t)m(yp)s(es)0 2857 y(of)35 b(extensions,)h(including)c
-(ASCI)s(I)h(tables)i(\(T)-8 b(ABLE\),)36 b(Binary)e(tables)h(\(BINT)-8
-b(ABLE\))37 b(and)d(IMA)m(GE)i(exten-)0 2970 y(sions.)47
-b(The)32 b(CFITSIO)g(routines)f(insulate)h(the)h(programmer)f(from)g
-(ha)m(ving)h(to)g(deal)g(with)e(the)i(complicated)0 3083
-y(formatting)39 b(details)f(in)f(the)i(FITS)g(\014le,)h(ho)m(w)m(ev)m
-(er,)j(it)38 b(is)g(assumed)g(that)i(users)e(ha)m(v)m(e)i(a)f(general)g
-(kno)m(wledge)0 3196 y(ab)s(out)30 b(the)h(structure)f(and)f(usage)i
-(of)g(FITS)e(\014les.)0 3356 y(CFITSIO)34 b(also)i(con)m(tains)h(a)f
-(set)h(of)f(F)-8 b(ortran)36 b(callable)f(wrapp)s(er)g(routines)f(whic)
-m(h)h(allo)m(w)h(F)-8 b(ortran)36 b(programs)0 3469 y(to)31
+b(140)0 5382 y Fi(13)67 b(Optimizing)34 b(Programs)2588
+b(143)136 5548 y Fj(13.1)49 b(Ho)m(w)32 b(CFITSIO)c(Manages)k(Data)g
+(I/O)78 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
+h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(143)136 5714 y(13.2)49 b(Optimization)29 b(Strategies)76
+b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(144)p eop
+%%Page: 7 7
+7 6 bop 0 299 a Fh(CONTENTS)3284 b Fj(vii)0 555 y Fi(A)57
+b(Index)35 b(of)g(Routines)2789 b(147)0 806 y(B)62 b(P)m(arameter)34
+b(De\014nitions)2598 b(151)0 1057 y(C)60 b(CFITSIO)33
+b(Error)i(Status)f(Co)s(des)2255 b(157)p eop
+%%Page: 8 8
+8 7 bop 0 299 a Fj(viii)3258 b Fh(CONTENTS)p eop
+%%Page: 1 9
+1 8 bop 0 1225 a Fg(Chapter)65 b(1)0 1687 y Fm(In)-6
+b(tro)6 b(duction)0 2216 y Ff(1.1)180 b(A)45 b(Brief)g(Ov)l(erview)0
+2495 y Fj(CFITSIO)38 b(is)h(a)h(mac)m(hine-indep)s(enden)m(t)e(library)
+f(of)j(routines)e(for)i(reading)f(and)g(writing)e(data)k(\014les)d(in)h
+(the)0 2608 y(FITS)c(\(Flexible)f(Image)i(T)-8 b(ransp)s(ort)34
+b(System\))h(data)h(format.)56 b(It)35 b(can)h(also)f(read)g(IRAF)h
+(format)f(image)h(\014les)0 2721 y(and)g(ra)m(w)h(binary)e(data)i(arra)
+m(ys)g(b)m(y)g(con)m(v)m(erting)h(them)e(on)h(the)g(\015y)f(in)m(to)h
+(a)g(virtual)e(FITS)h(format)h(\014le.)59 b(This)0 2833
+y(library)30 b(is)i(written)g(in)f(ANSI)i(C)f(and)g(pro)m(vides)g(a)h
+(p)s(o)m(w)m(erful)e(y)m(et)j(simple)d(in)m(terface)i(for)g(accessing)g
+(FITS)f(\014les)0 2946 y(whic)m(h)j(will)f(run)h(on)h(most)h(commonly)f
+(used)g(computers)g(and)g(w)m(orkstations.)59 b(CFITSIO)35
+b(supp)s(orts)f(all)i(the)0 3059 y(features)26 b(describ)s(ed)d(in)h
+(the)h(o\016cial)g(NOST)f(de\014nition)f(of)j(the)f(FITS)g(format)h
+(and)e(can)i(read)f(and)g(write)g(all)f(the)0 3172 y(curren)m(tly)d
+(de\014ned)f(t)m(yp)s(es)i(of)g(extensions,)h(including)18
+b(ASCI)s(I)j(tables)g(\(T)-8 b(ABLE\),)23 b(Binary)e(tables)h(\(BINT)-8
+b(ABLE\))0 3285 y(and)27 b(IMA)m(GE)h(extensions.)39
+b(The)27 b(CFITSIO)f(routines)g(insulate)g(the)h(programmer)g(from)g
+(ha)m(ving)f(to)i(deal)f(with)0 3398 y(the)e(complicated)f(formatting)h
+(details)e(in)g(the)i(FITS)f(\014le,)h(ho)m(w)m(ev)m(er,)j(it)c(is)f
+(assumed)h(that)h(users)f(ha)m(v)m(e)i(a)f(general)0
+3511 y(kno)m(wledge)30 b(ab)s(out)g(the)h(structure)f(and)g(usage)h(of)
+f(FITS)g(\014les.)0 3671 y(CFITSIO)k(also)i(con)m(tains)h(a)f(set)h(of)
+f(F)-8 b(ortran)36 b(callable)f(wrapp)s(er)g(routines)f(whic)m(h)h
+(allo)m(w)h(F)-8 b(ortran)36 b(programs)0 3784 y(to)31
 b(call)e(the)h(CFITSIO)e(routines.)40 b(See)30 b(the)g(companion)f
 (\\FITSIO)g(User's)h(Guide")f(for)h(the)g(de\014nition)e(of)i(the)0
-3582 y(F)-8 b(ortran)39 b(subroutine)c(calling)i(sequences.)63
+3897 y(F)-8 b(ortran)39 b(subroutine)c(calling)i(sequences.)63
 b(These)38 b(wrapp)s(ers)e(replace)i(the)g(older)f(F)-8
-b(ortran)39 b(FITSIO)d(library)0 3695 y(whic)m(h)29 b(is)h(no)g(longer)
-g(supp)s(orted.)0 3855 y(The)20 b(CFITSIO)f(pac)m(k)-5
+b(ortran)39 b(FITSIO)d(library)0 4010 y(whic)m(h)29 b(is)h(no)g(longer)
+g(supp)s(orted.)0 4170 y(The)20 b(CFITSIO)f(pac)m(k)-5
 b(age)23 b(w)m(as)e(initially)d(dev)m(elop)s(ed)i(b)m(y)g(the)h(HEASAR)
-m(C)g(\(High)g(Energy)f(Astroph)m(ysics)g(Science)0 3968
+m(C)g(\(High)g(Energy)f(Astroph)m(ysics)g(Science)0 4283
 y(Arc)m(hiv)m(e)34 b(Researc)m(h)h(Cen)m(ter\))f(at)h(the)f(NASA)g(Go)s
 (ddard)e(Space)j(Fligh)m(t)e(Cen)m(ter)h(to)h(con)m(v)m(ert)g(v)-5
-b(arious)33 b(existing)0 4081 y(and)25 b(newly)g(acquired)g
+b(arious)33 b(existing)0 4396 y(and)25 b(newly)g(acquired)g
 (astronomical)h(data)g(sets)h(in)m(to)f(FITS)f(format)h(and)f(to)i
-(further)e(analyze)h(data)h(already)e(in)0 4194 y(FITS)i(format.)41
+(further)e(analyze)h(data)h(already)e(in)0 4509 y(FITS)i(format.)41
 b(New)28 b(features)g(con)m(tin)m(ue)g(to)h(b)s(e)e(added)h(to)g
 (CFITSIO)f(in)f(large)i(part)g(due)g(to)g(con)m(tributions)f(of)0
-4307 y(ideas)32 b(or)h(actual)g(co)s(de)g(from)f(users)g(of)h(the)g
+4622 y(ideas)32 b(or)h(actual)g(co)s(de)g(from)f(users)g(of)h(the)g
 (pac)m(k)-5 b(age.)49 b(The)33 b(In)m(tegral)g(Science)f(Data)i(Cen)m
-(ter)f(in)f(Switzerland,)0 4419 y(and)h(the)g(XMM/ESTEC)h(pro)5
+(ter)f(in)f(Switzerland,)0 4734 y(and)h(the)g(XMM/ESTEC)h(pro)5
 b(ject)34 b(in)e(The)h(Netherlands)f(made)h(esp)s(ecially)f
-(signi\014can)m(t)g(con)m(tributions)g(that)0 4532 y(resulted)d(in)g
+(signi\014can)m(t)g(con)m(tributions)g(that)0 4847 y(resulted)d(in)g
 (man)m(y)i(of)f(the)h(new)f(features)g(that)h(app)s(eared)f(in)f(v2.0)j
-(of)e(CFITSIO.)0 4693 y(The)22 b(latest)h(v)m(ersion)f(of)h(the)f
-(CFITSIO)f(source)i(co)s(de,)h(do)s(cumen)m(tation,)h(and)c(example)i
-(programs)f(are)h(a)m(v)-5 b(ailable)0 4805 y(on)30 b(the)h(W)-8
-b(orld-Wide)30 b(W)-8 b(eb)31 b(or)f(via)g(anon)m(ymous)g(ftp)g(from:)
-382 5065 y Ff(http://heasarc.gsfc.nasa)o(.go)o(v/fi)o(tsio)382
-5178 y(ftp://legacy.gsfc.nasa.g)o(ov/)o(soft)o(ware)o(/fi)o(tsio)o(/c)
-1927 5942 y Fj(1)p eop
-%%Page: 2 8
-2 7 bop 0 299 a Fj(2)2452 b Fh(CHAPTER)30 b(1.)71 b(INTR)m(ODUCTION)0
-555 y Fj(An)m(y)28 b(questions,)f(bug)g(rep)s(orts,)h(or)f(suggested)i
+(of)e(CFITSIO.)0 5322 y Ff(1.2)135 b(Sources)45 b(of)g(FITS)f(Soft)l(w)
+l(are)i(and)f(Information)0 5601 y Fj(The)22 b(latest)h(v)m(ersion)f
+(of)h(the)f(CFITSIO)f(source)i(co)s(de,)h(do)s(cumen)m(tation,)h(and)c
+(example)i(programs)f(are)h(a)m(v)-5 b(ailable)0 5714
+y(on)30 b(the)h(W)-8 b(orld-Wide)30 b(W)-8 b(eb)31 b(or)f(via)g(anon)m
+(ymous)g(ftp)g(from:)1927 5942 y(1)p eop
+%%Page: 2 10
+2 9 bop 0 299 a Fj(2)2452 b Fh(CHAPTER)30 b(1.)71 b(INTR)m(ODUCTION)382
+555 y Fe(http://heasarc.gsfc.nasa)o(.go)o(v/fi)o(tsio)382
+668 y(ftp://legacy.gsfc.nasa.g)o(ov/)o(soft)o(ware)o(/fi)o(tsio)o(/c)0
+902 y Fj(An)m(y)28 b(questions,)f(bug)g(rep)s(orts,)h(or)f(suggested)i
 (enhancemen)m(ts)f(related)f(to)i(the)e(CFITSIO)f(pac)m(k)-5
-b(age)30 b(should)c(b)s(e)0 668 y(sen)m(t)31 b(to)g(the)g(primary)d
-(author:)382 928 y Ff(Dr.)47 b(William)f(Pence)810 b(Telephone:)92
-b(\(301\))47 b(286-4599)382 1041 y(HEASARC,)e(Code)i(662)811
-b(E-mail:)45 b(pence@tetra.gsfc.nasa.gov)382 1154 y(NASA/Goddard)f
-(Space)j(Flight)f(Center)382 1267 y(Greenbelt,)f(MD)i(20771,)f(USA)0
-1526 y Fj(This)26 b(User's)i(Guide)f(assumes)g(that)i(readers)e
-(already)h(ha)m(v)m(e)h(a)f(general)g(understanding)d(of)j(the)g
-(de\014nition)e(and)0 1639 y(structure)32 b(of)h(FITS)g(format)g
-(\014les.)47 b(F)-8 b(urther)33 b(information)e(ab)s(out)h(FITS)h
-(formats)g(is)f(a)m(v)-5 b(ailable)32 b(in)f(the)i(`FITS)0
-1752 y(User's)f(Guide')f(and)g(the)h(`NOST)f(FITS)g(Standard',)g(whic)m
-(h)g(are)h(a)m(v)-5 b(ailable)31 b(from)g(the)h(NASA)g(Science)g
-(O\016ce)0 1865 y(of)j(Standards)f(and)h(T)-8 b(ec)m(hnology)36
-b(at)g(the)f(address)g(giv)m(en)g(b)s(elo)m(w.)54 b(Both)36
-b(of)f(these)h(do)s(cumen)m(ts)f(are)h(a)m(v)-5 b(ailable)0
-1978 y(electronically)35 b(from)h(their)f(W)-8 b(eb)37
-b(site)f(and)f(via)h(anon)m(ymous)g(ftp)g(at)h(nssdc.gsfc.nasa.go)m(v)h
-(in)d(the)h(/pub/\014ts)0 2091 y(directory)-8 b(.)41
-b(An)m(y)30 b(questions)g(ab)s(out)g(FITS)f(formats)i(should)d(b)s(e)i
-(directed)g(to)h(the)f(NOST,)g(at:)382 2351 y Ff(NASA,)46
-b(Science)g(Office)g(of)h(Standards)f(and)g(Technology)382
-2464 y(Code)g(633.2,)382 2577 y(Goddard)g(Space)g(Flight)g(Center)382
-2689 y(Greenbelt)f(MD)i(20771,)f(USA)382 2802 y(WWW:)g
-(http://fits.gsfc.nasa.gov/)382 2915 y(E-mail:)g
-(fits@fits.gsfc.nasa.gov)382 3028 y(\(301\))g(286-2899)0
-3288 y Fj(CFITSIO)33 b(users)g(ma)m(y)h(also)g(b)s(e)g(in)m(terested)g
-(in)f(the)h(FTOOLS)f(pac)m(k)-5 b(age)36 b(of)e(programs)g(that)g(can)h
-(b)s(e)e(used)g(to)0 3401 y(manipulate)i(and)g(analyze)i(FITS)f(format)
-g(\014les.)58 b(Information)35 b(ab)s(out)h(FTOOLS)f(can)i(b)s(e)f
-(obtained)f(on)i(the)0 3514 y(W)-8 b(eb)31 b(or)f(via)g(anon)m(ymous)h
-(ftp)f(at:)382 3774 y Ff(http://heasarc.gsfc.nasa)o(.go)o(v/ft)o(ools)
-382 3886 y(ftp://legacy.gsfc.nasa.g)o(ov/)o(soft)o(ware)o(/ft)o(ools)o
-(/rel)o(eas)o(e)p eop
-%%Page: 3 9
-3 8 bop 0 1225 a Fg(Chapter)65 b(2)0 1687 y Fm(Creating)77
-b(the)h(CFITSIO)e(Library)0 2216 y Fe(2.1)135 b(Building)45
+b(age)30 b(should)c(b)s(e)0 1015 y(sen)m(t)31 b(to)g(the)g(primary)d
+(author:)382 1249 y Fe(Dr.)47 b(William)f(Pence)810 b(Telephone:)92
+b(\(301\))47 b(286-4599)382 1362 y(HEASARC,)e(Code)i(662)811
+b(E-mail:)45 b(pence@tetra.gsfc.nasa.gov)382 1475 y(NASA/Goddard)f
+(Space)j(Flight)f(Center)382 1588 y(Greenbelt,)f(MD)i(20771,)f(USA)0
+1822 y Fj(This)39 b(User's)j(Guide)e(assumes)h(that)h(readers)f
+(already)f(ha)m(v)m(e)j(a)f(general)f(understanding)d(of)k(the)f
+(de\014nition)0 1935 y(and)31 b(structure)g(of)h(FITS)e(format)i
+(\014les.)43 b(F)-8 b(urther)32 b(information)d(ab)s(out)j(FITS)f
+(formats)g(is)g(a)m(v)-5 b(ailable)31 b(from)g(the)0
+2048 y(FITS)h(Supp)s(ort)f(O\016ce)i(at)g Fe(http://fits.gsfc.nasa.gov)
+o Fj(.)42 b(In)32 b(particular,)g(the)h('NOST)f(FITS)g(Standard')0
+2161 y(giv)m(es)i(the)h(authoritativ)m(e)f(de\014nition)e(of)i(the)g
+(FITS)g(data)h(format,)g(and)f(the)g(`FITS)g(User's)g(Guide')f(pro)m
+(vides)0 2274 y(additional)28 b(historical)h(bac)m(kground)h(and)g
+(practical)g(advice)g(on)g(using)f(FITS)h(\014les.)0
+2434 y(The)38 b(HEASAR)m(C)g(also)h(pro)m(vides)e(a)i(v)m(ery)g
+(sophisticated)f(FITS)f(\014le)h(analysis)f(program)h(called)g(`Fv')h
+(whic)m(h)0 2547 y(can)34 b(b)s(e)f(used)g(to)h(displa)m(y)e(and)h
+(edit)g(the)h(con)m(ten)m(ts)i(of)e(an)m(y)g(FITS)f(\014le)f(as)i(w)m
+(ell)f(as)h(construct)g(new)f(FITS)g(\014les)0 2660 y(from)j(scratc)m
+(h.)61 b(The)36 b(displa)m(y)f(functions)g(in)g(Fv)i(allo)m(w)f(users)g
+(to)i(in)m(teractiv)m(ely)e(adjust)g(the)h(brigh)m(tness)f(and)0
+2773 y(con)m(trast)i(of)f(images,)h(pan,)g(zo)s(om,)h(and)d(blink)e
+(images,)39 b(and)d(measure)h(the)f(p)s(ositions)f(and)h(brigh)m
+(tnesses)g(of)0 2886 y(ob)5 b(jects)33 b(within)d(images.)46
+b(FITS)31 b(tables)h(can)h(b)s(e)e(displa)m(y)m(ed)g(lik)m(e)h(a)g
+(spread)g(sheet,)h(and)f(then)f(mo)s(di\014ed)f(using)0
+2999 y(p)s(o)m(w)m(erful)25 b(calculator)i(and)e(sorting)h(functions.)
+38 b(Fv)27 b(is)e(freely)h(a)m(v)-5 b(ailable)26 b(for)g(most)h(Unix)e
+(platforms,)i(Mac)g(PCs,)0 3112 y(and)34 b(Windo)m(ws)f(PCs.)52
+b(CFITSIO)33 b(users)h(ma)m(y)h(also)f(b)s(e)g(in)m(terested)h(in)e
+(the)h(FTOOLS)f(pac)m(k)-5 b(age)37 b(of)d(programs)0
+3225 y(that)27 b(can)f(b)s(e)g(used)f(to)i(manipulate)e(and)g(analyze)i
+(FITS)e(format)i(\014les.)38 b(Fv)27 b(and)e(FTOOLS)g(are)i(a)m(v)-5
+b(ailable)25 b(from)0 3337 y(their)k(resp)s(ectiv)m(e)i(W)-8
+b(eb)31 b(sites)f(at:)382 3572 y Fe(http://fv.gsfc.nasa.gov)382
+3685 y(http://heasarc.gsfc.nasa)o(.go)o(v/ft)o(ools)0
+4014 y Ff(1.3)135 b(Ac)l(kno)l(wledgemen)l(ts)0 4264
+y Fj(The)34 b(dev)m(elopmen)m(t)g(of)g(the)g(p)s(o)m(w)m(erful)f
+(features)h(in)f(CFITSIO)g(w)m(as)h(made)g(p)s(ossible)e(through)h
+(collab)s(orations)0 4377 y(with)d(man)m(y)h(p)s(eople)f(or)g
+(organizations)h(from)g(around)f(the)h(w)m(orld.)41 b(The)30
+b(follo)m(wing)g(in)f(particular)h(ha)m(v)m(e)i(made)0
+4490 y(esp)s(ecially)d(signi\014can)m(t)g(con)m(tributions:)0
+4650 y(Programmers)c(from)h(the)f(In)m(tegral)h(Science)g(Data)h(Cen)m
+(ter,)g(Switzerland)d(\(namely)-8 b(,)27 b(Jurek)d(Bork)m(o)m(wski,)k
+(Bruce)0 4763 y(O'Neel,)33 b(and)f(Don)h(Jennings\),)e(designed)g(the)i
+(concept)g(for)f(the)h(plug-in)d(I/O)i(driv)m(ers)f(that)i(w)m(as)g(in)
+m(tro)s(duced)0 4876 y(with)h(CFITSIO)f(2.0.)56 b(The)34
+b(use)h(of)g(`driv)m(ers')f(greatly)h(simpli\014ed)d(the)j(lo)m(w-lev)m
+(el)g(I/O,)g(whic)m(h)e(in)h(turn)g(made)0 4989 y(other)40
+b(new)f(features)i(in)d(CFITSIO)g(\(e.g.,)45 b(supp)s(ort)38
+b(for)h(compressed)h(FITS)f(\014les)g(and)g(supp)s(ort)f(for)i(IRAF)0
+5102 y(format)32 b(image)f(\014les\))g(m)m(uc)m(h)g(easier)h(to)g
+(implemen)m(t.)42 b(Jurek)31 b(Bork)m(o)m(wski)g(wrote)h(the)g(Shared)e
+(Memory)i(driv)m(er,)0 5215 y(and)23 b(Bruce)i(O'Neel)f(wrote)g(the)g
+(driv)m(ers)f(for)g(accessing)i(FITS)e(\014les)g(o)m(v)m(er)i(the)f
+(net)m(w)m(ork)h(using)d(the)j(FTP)-8 b(,)24 b(HTTP)-8
+b(,)0 5328 y(and)30 b(R)m(OOT)g(proto)s(cols.)0 5488
+y(The)45 b(ISDC)g(also)g(pro)m(vided)f(the)i(template)g(parsing)e
+(routines)g(\(written)h(b)m(y)g(Jurek)g(Bork)m(o)m(wski\))h(and)f(the)0
+5601 y(hierarc)m(hical)36 b(grouping)f(routines)h(\(written)h(b)m(y)g
+(Don)h(Jennings\).)59 b(The)37 b(ISDC)f(D)m(AL)i(\(Data)h(Access)f(La)m
+(y)m(er\))0 5714 y(routines)29 b(are)i(la)m(y)m(ered)g(on)f(top)h(of)f
+(CFITSIO)f(and)h(mak)m(e)h(extensiv)m(e)g(use)f(of)h(these)g(features.)
+p eop
+%%Page: 3 11
+3 10 bop 0 299 a Fh(1.4.)72 b(LEGAL)30 b(STUFF)2995 b
+Fj(3)0 555 y(Uw)m(e)25 b(Lammers)e(\(XMM/ESA/ESTEC,)h(The)g
+(Netherlands\))f(designed)g(the)h(high-p)s(erformance)e(lexical)h
+(pars-)0 668 y(ing)41 b(algorithm)g(that)h(is)f(used)g(to)i(do)e
+(on-the-\015y)h(\014ltering)e(of)i(FITS)f(tables.)75
+b(This)40 b(algorithm)h(essen)m(tially)0 781 y(pre-compiles)34
+b(the)i(user-supplied)c(selection)k(expression)e(in)m(to)i(a)g(form)g
+(that)g(can)g(b)s(e)f(rapidly)e(ev)-5 b(aluated)36 b(for)0
+894 y(eac)m(h)31 b(ro)m(w.)40 b(P)m(eter)31 b(Wilson)d(\(RSTX,)h
+(NASA/GSF)m(C\))i(then)e(wrote)h(the)g(parsing)e(routines)g(used)h(b)m
+(y)g(CFITSIO)0 1007 y(based)i(on)f(Lammers')h(design,)f(com)m(bined)g
+(with)g(other)h(tec)m(hniques)f(suc)m(h)h(as)g(the)g(CFITSIO)f
+(iterator)h(routine)0 1120 y(to)h(further)e(enhance)h(the)h(data)g(pro)
+s(cessing)e(throughput.)42 b(This)30 b(e\013ort)i(also)f(b)s
+(ene\014ted)f(from)h(a)h(m)m(uc)m(h)f(earlier)0 1233
+y(lexical)22 b(parsing)h(routine)f(that)i(w)m(as)g(dev)m(elop)s(ed)f(b)
+m(y)h(Ken)m(t)g(Blac)m(kburn)e(\(NASA/GSF)m(C\).)j(More)g(recen)m(tly)
+-8 b(,)26 b(Craig)0 1346 y(Markw)m(ardt)j(\(NASA/GSF)m(C\))g(implemen)m
+(ted)e(additional)f(functions)h(\(median,)h(a)m(v)m(erage,)k(stddev\))c
+(and)g(other)0 1458 y(enhancemen)m(ts)j(to)g(the)g(lexical)e(parser.)0
+1619 y(The)40 b(CFITSIO)g(iterator)h(function)e(is)h(lo)s(osely)g
+(based)h(on)f(similar)f(ideas)h(dev)m(elop)s(ed)g(for)h(the)g(XMM)g
+(Data)0 1732 y(Access)31 b(La)m(y)m(er.)0 1892 y(P)m(eter)25
+b(Wilson)e(\(RSTX,)h(NASA/GSF)m(C\))h(wrote)g(the)f(complete)h(set)f
+(of)h(F)-8 b(ortran-callable)24 b(wrapp)s(ers)e(for)i(all)f(the)0
+2005 y(CFITSIO)29 b(routines,)g(whic)m(h)g(in)g(turn)h(rely)f(on)i(the)
+f(CF)m(OR)-8 b(TRAN)31 b(macro)g(dev)m(elop)s(ed)f(b)m(y)g(Burkhard)f
+(Buro)m(w.)0 2165 y(The)h(syn)m(tax)i(used)e(b)m(y)h(CFITSIO)f(for)g
+(\014ltering)g(or)h(binning)c(input)i(FITS)i(\014les)f(is)g(based)g(on)
+h(ideas)g(dev)m(elop)s(ed)0 2278 y(for)41 b(the)g(AXAF)h(Science)f(Cen)
+m(ter)h(Data)h(Mo)s(del)d(b)m(y)h(Jonathan)g(McDo)m(w)m(ell,)k(An)m
+(tonella)c(F)-8 b(ruscione,)44 b(Aneta)0 2391 y(Siemigino)m(wsk)-5
+b(a)24 b(and)h(Bill)f(Jo)m(y)m(e.)41 b(See)26 b(h)m
+(ttp://heasarc.gsfc.nasa.go)m(v/do)s(cs/journal/axaf7.h)m(t)q(ml)31
+b(for)25 b(further)0 2503 y(description)j(of)j(the)g(AXAF)g(Data)h(Mo)s
+(del.)0 2664 y(The)j(\014le)f(decompression)g(co)s(de)h(w)m(ere)h(tak)m
+(en)g(directly)e(from)g(the)i(gzip)e(\(GNU)i(zip\))f(program)g(dev)m
+(elop)s(ed)f(b)m(y)0 2777 y(Jean-loup)29 b(Gailly)g(and)h(others.)0
+2937 y(The)e(new)h(compressed)g(image)g(data)h(format)f(\(where)g(the)g
+(image)g(is)f(tiled)g(and)g(the)h(compressed)g(b)m(yte)h(stream)0
+3050 y(from)k(eac)m(h)i(tile)f(is)e(stored)i(in)f(a)h(binary)e(table\))
+j(w)m(as)f(implemen)m(ted)e(in)h(collab)s(oration)g(with)f(Ric)m(hard)h
+(White)0 3163 y(\(STScI\),)c(P)m(erry)g(Green\014eld)g(\(STScI\))g(and)
+f(Doug)i(T)-8 b(o)s(dy)30 b(\(NO)m(A)m(O\).)0 3323 y(Doug)h(Mink)f
+(\(SA)m(O\))g(pro)m(vided)f(the)i(routines)e(for)h(con)m(v)m(erting)i
+(IRAF)e(format)h(images)f(in)m(to)h(FITS)e(format.)0
+3483 y(In)e(addition,)g(man)m(y)h(other)g(p)s(eople)f(ha)m(v)m(e)i
+(made)f(v)-5 b(aluable)27 b(con)m(tributions)f(to)j(the)f(dev)m
+(elopmen)m(t)g(of)g(CFITSIO.)0 3596 y(These)i(include)e(\(with)i(ap)s
+(ologies)g(to)h(others)f(that)h(ma)m(y)g(ha)m(v)m(e)h(inadv)m(erten)m
+(tly)e(b)s(een)f(omitted\):)0 3756 y(Stev)m(e)g(Allen,)e(Carl)g(Ak)m
+(erlof,)h(Keith)f(Arnaud,)h(Morten)g(Krabb)s(e)e(Barfo)s(ed,)j(Ken)m(t)
+f(Blac)m(kburn,)g(G)g(Bo)s(dammer,)0 3869 y(Romk)m(e)h(Bon)m(tek)m(o)s
+(e,)i(Lucio)c(Chiapp)s(etti,)f(Keith)h(Costorf,)h(Robin)f(Corb)s(et,)h
+(John)e(Da)m(vis,)j(Ric)m(hard)e(Fink,)h(Ning)0 3982
+y(Gan,)j(Emily)d(Greene,)j(Gretc)m(hen)g(Green,)f(Jo)s(e)g(Harrington,)
+g(Cheng)g(Ho,)h(Phil)d(Ho)s(dge,)i(Jim)f(Ingham,)h(Y)-8
+b(oshi-)0 4095 y(tak)j(a)44 b(Ishisaki,)g(Diab)f(Jerius,)h(Mark)g
+(Levine,)h(T)-8 b(o)s(dd)42 b(Karak)-5 b(askian,)46 b(Edw)m(ard)c
+(King,)j(Scott)f(Ko)s(c)m(h,)i(Claire)0 4208 y(Larkin,)c(Rob)f
+(Managan,)j(Eric)c(Mandel,)j(Ric)m(hard)d(Mathar,)k(John)c(Matto)m(x,)
+46 b(Carsten)41 b(Mey)m(er,)k(Emi)39 b(Miy-)0 4320 y(ata,)44
+b(Stefan)c(Mo)s(c)m(hnac)m(ki,)k(Mik)m(e)d(Noble,)h(Oliv)m(er)d(Ob)s
+(erdorf,)i(Cliv)m(e)e(P)m(age,)45 b(Arvind)38 b(P)m(armar,)43
+b(Je\013)e(P)m(edelt)m(y)-8 b(,)0 4433 y(Tim)31 b(P)m(earson,)j
+(Philipp)s(e)28 b(Prugniel,)j(Maren)h(Purv)m(es,)h(Scott)g(Randall,)f
+(Chris)e(Rogers,)k(Arnold)c(Rots,)k(Barry)0 4546 y(Sc)m(hlesinger,)h
+(Robin)f(Stebbins,)h(Andrew)f(Szymk)m(o)m(wiak,)j(Allyn)c(T)-8
+b(ennan)m(t,)37 b(P)m(eter)g(T)-8 b(eub)s(en,)35 b(James)h(Theiler,)0
+4659 y(Doug)c(T)-8 b(o)s(dy)g(,)32 b(Shiro)e(Ueno,)j(Stev)m(e)f(W)-8
+b(alton,)33 b(Arc)m(hie)f(W)-8 b(arno)s(c)m(k,)33 b(Alan)e(W)-8
+b(atson,)33 b(Dan)f(Whipple,)e(Wim)h(Wim-)0 4772 y(mers,)f(P)m(eter)i
+(Y)-8 b(oung,)31 b(Jianjun)d(Xu,)i(and)g(Nelson)g(Zarate.)0
+5216 y Ff(1.4)135 b(Legal)46 b(Stu\013)0 5488 y Fj(Cop)m(yrigh)m(t)36
+b(\(Unpublished{all)d(righ)m(ts)j(reserv)m(ed)h(under)e(the)i(cop)m
+(yrigh)m(t)g(la)m(ws)f(of)h(the)g(United)f(States\),)k(U.S.)0
+5601 y(Go)m(v)m(ernmen)m(t)30 b(as)g(represen)m(ted)e(b)m(y)h(the)g
+(Administrator)e(of)i(the)g(National)f(Aeronautics)h(and)f(Space)h
+(Adminis-)0 5714 y(tration.)41 b(No)31 b(cop)m(yrigh)m(t)f(is)g
+(claimed)f(in)g(the)i(United)e(States)i(under)e(Title)h(17,)h(U.S.)f
+(Co)s(de.)p eop
+%%Page: 4 12
+4 11 bop 0 299 a Fj(4)2452 b Fh(CHAPTER)30 b(1.)71 b(INTR)m(ODUCTION)0
+555 y Fj(P)m(ermission)28 b(to)i(freely)e(use,)i(cop)m(y)-8
+b(,)31 b(mo)s(dify)-8 b(,)28 b(and)h(distribute)e(this)h(soft)m(w)m
+(are)j(and)e(its)g(do)s(cumen)m(tation)g(without)0 668
+y(fee)g(is)e(hereb)m(y)h(gran)m(ted,)i(pro)m(vided)d(that)i(this)e(cop)
+m(yrigh)m(t)i(notice)f(and)g(disclaimer)e(of)i(w)m(arran)m(t)m(y)i(app)
+s(ears)d(in)g(all)0 781 y(copies.)41 b(\(Ho)m(w)m(ev)m(er,)33
+b(see)e(the)f(restriction)f(on)i(the)f(use)g(of)h(the)f(gzip)g
+(compression)g(co)s(de,)h(b)s(elo)m(w\).)0 941 y(DISCLAIMER:)0
+1101 y(THE)i(SOFTW)-10 b(ARE)32 b(IS)g(PR)m(O)m(VIDED)i('AS)f(IS')g
+(WITHOUT)f(ANY)i(W)-10 b(ARRANTY)33 b(OF)g(ANY)h(KIND,)f(EI-)0
+1214 y(THER)42 b(EXPRESSED,)f(IMPLIED,)i(OR)e(ST)-8 b(A)g(TUTOR)g(Y,)43
+b(INCLUDING,)f(BUT)h(NOT)e(LIMITED)h(TO,)0 1327 y(ANY)33
+b(W)-10 b(ARRANTY)33 b(THA)-8 b(T)32 b(THE)g(SOFTW)-10
+b(ARE)32 b(WILL)g(CONF)m(ORM)g(TO)g(SPECIFICA)-8 b(TIONS,)30
+b(ANY)0 1440 y(IMPLIED)38 b(W)-10 b(ARRANTIES)37 b(OF)h(MER)m(CHANT)-8
+b(ABILITY,)38 b(FITNESS)f(F)m(OR)h(A)g(P)-8 b(AR)g(TICULAR)38
+b(PUR-)0 1553 y(POSE,)24 b(AND)i(FREEDOM)f(FR)m(OM)h(INFRINGEMENT,)g
+(AND)f(ANY)h(W)-10 b(ARRANTY)25 b(THA)-8 b(T)25 b(THE)g(DOC-)0
+1666 y(UMENT)-8 b(A)g(TION)31 b(WILL)f(CONF)m(ORM)h(TO)e(THE)h(SOFTW)
+-10 b(ARE,)30 b(OR)g(ANY)h(W)-10 b(ARRANTY)31 b(THA)-8
+b(T)30 b(THE)0 1779 y(SOFTW)-10 b(ARE)31 b(WILL)h(BE)g(ERR)m(OR)g
+(FREE.)g(IN)g(NO)f(EVENT)h(SHALL)f(NASA)h(BE)g(LIABLE)g(F)m(OR)g(ANY)0
+1892 y(D)m(AMA)m(GES,)26 b(INCLUDING,)e(BUT)f(NOT)g(LIMITED)h(TO,)f
+(DIRECT,)g(INDIRECT,)g(SPECIAL)f(OR)h(CON-)0 2005 y(SEQUENTIAL)28
+b(D)m(AMA)m(GES,)k(ARISING)d(OUT)g(OF,)h(RESUL)-8 b(TING)29
+b(FR)m(OM,)h(OR)f(IN)h(ANY)g(W)-10 b(A)i(Y)30 b(CON-)0
+2118 y(NECTED)25 b(WITH)g(THIS)f(SOFTW)-10 b(ARE,)25
+b(WHETHER)g(OR)g(NOT)g(BASED)g(UPON)g(W)-10 b(ARRANTY,)26
+b(CON-)0 2230 y(TRA)m(CT,)d(TOR)-8 b(T)23 b(,)g(OR)g(OTHER)-10
+b(WISE,)22 b(WHETHER)i(OR)f(NOT)f(INJUR)-8 b(Y)24 b(W)-10
+b(AS)23 b(SUST)-8 b(AINED)23 b(BY)h(PER-)0 2343 y(SONS)h(OR)i(PR)m
+(OPER)-8 b(TY)26 b(OR)g(OTHER)-10 b(WISE,)26 b(AND)h(WHETHER)g(OR)f
+(NOT)g(LOSS)f(W)-10 b(AS)26 b(SUST)-8 b(AINED)0 2456
+y(FR)m(OM,)37 b(OR)e(AR)m(OSE)h(OUT)f(OF)h(THE)g(RESUL)-8
+b(TS)35 b(OF,)h(OR)f(USE)h(OF,)g(THE)g(SOFTW)-10 b(ARE)35
+b(OR)g(SER-)0 2569 y(VICES)29 b(PR)m(O)m(VIDED)j(HEREUNDER.")0
+2729 y(The)i(\014le)h(compress.c)g(con)m(tains)g(\(sligh)m(tly)f(mo)s
+(di\014ed\))f(source)i(co)s(de)g(that)h(originally)c(came)k(from)f
+(gzip-1.2.4,)0 2842 y(cop)m(yrigh)m(t)26 b(\(C\))g(1992-1993)k(b)m(y)c
+(Jean-loup)f(Gailly)-8 b(.)38 b(This)24 b(gzip)h(co)s(de)h(is)f
+(distributed)e(under)i(the)h(GNU)g(General)0 2955 y(Public)k(License)i
+(and)f(th)m(us)h(requires)f(that)i(an)m(y)f(soft)m(w)m(are)i(that)f
+(uses)f(the)g(CFITSIO)f(library)f(\(whic)m(h)h(in)g(turn)0
+3068 y(uses)e(the)g(gzip)g(co)s(de\))h(m)m(ust)f(conform)g(to)h(the)f
+(pro)m(visions)e(in)h(the)i(GNU)g(General)f(Public)e(License.)40
+b(A)29 b(cop)m(y)h(of)0 3181 y(the)h(GNU)g(license)e(is)g(included)f
+(at)j(the)g(b)s(eginning)c(of)k(compress.c)g(\014le.)0
+3341 y(An)h(alternate)i(v)m(ersion)e(of)h(the)g(compress.c)g(\014le)f
+(\(called)g(compress)p 2381 3341 28 4 v 33 w(alternate.c\))i(is)e(pro)m
+(vided)f(for)i(users)e(who)0 3454 y(w)m(an)m(t)24 b(to)g(use)e(the)i
+(CFITSIO)d(library)g(but)h(are)h(un)m(willing)d(or)j(unable)e(to)j
+(publicly)c(release)j(their)f(soft)m(w)m(are)i(under)0
+3567 y(the)i(terms)g(of)g(the)g(GNU)h(General)e(Public)f(License.)39
+b(This)24 b(alternate)i(v)m(ersion)g(con)m(tains)g(non-functional)e
+(stubs)0 3680 y(for)g(the)h(\014le)e(compression)h(and)f(uncompression)
+g(routines)g(used)h(b)m(y)g(CFITSIO.)f(Replace)i(the)f(\014le)g
+(`compress.c')0 3793 y(with)32 b(`compress)p 600 3793
+V 33 w(alternate.c')j(b)s(efore)e(compiling)e(the)i(CFITSIO)f(library)
+-8 b(.)48 b(This)31 b(will)g(pro)s(duce)h(a)i(v)m(ersion)f(of)0
+3906 y(CFITSIO)20 b(whic)m(h)h(do)s(es)g(not)h(supp)s(ort)e(reading)h
+(or)h(writing)e(compressed)h(FITS)g(\014les)g(but)g(is)g(otherwise)g
+(iden)m(tical)0 4019 y(to)31 b(the)g(standard)e(v)m(ersion.)p
+eop
+%%Page: 5 13
+5 12 bop 0 1225 a Fg(Chapter)65 b(2)0 1687 y Fm(Creating)77
+b(the)h(CFITSIO)e(Library)0 2216 y Ff(2.1)135 b(Building)45
 b(the)h(Library)0 2466 y Fj(The)h(CFITSIO)f(co)s(de)h(is)g(con)m
 (tained)g(in)f(ab)s(out)h(40)h(C)f(source)h(\014les)e(\(*.c\))j(and)e
 (header)g(\014les)f(\(*.h\).)93 b(On)0 2579 y(V)-10 b(AX/VMS)31
 b(systems)g(2)f(assem)m(bly-co)s(de)h(\014les)e(\(vmsieeed.mar)h(and)g
 (vmsieeer.mar\))h(are)f(also)h(needed.)0 2739 y(CFITSIO)e(has)h(curren)
 m(tly)f(b)s(een)h(tested)h(on)f(the)h(follo)m(wing)e(platforms:)95
-2999 y Ff(OPERATING)46 b(SYSTEM)523 b(COMPILER)143 3112
+2959 y Fe(OPERATING)46 b(SYSTEM)523 b(COMPILER)143 3072
 y(Sun)47 b(OS)1002 b(gcc)47 b(and)g(cc)g(\(3.0.1\))143
-3225 y(Sun)g(Solaris)762 b(gcc)47 b(and)g(cc)143 3338
+3185 y(Sun)g(Solaris)762 b(gcc)47 b(and)g(cc)143 3298
 y(Silicon)f(Graphics)g(IRIX)285 b(gcc)47 b(and)g(cc)143
-3451 y(Silicon)f(Graphics)g(IRIX64)189 b(MIPS)143 3564
+3411 y(Silicon)f(Graphics)g(IRIX64)189 b(MIPS)143 3523
 y(Dec)47 b(Alpha)f(OSF/1)572 b(gcc)47 b(and)g(cc)143
-3677 y(DECstation)93 b(Ultrix)428 b(gcc)143 3790 y(Dec)47
-b(Alpha)f(OpenVMS)476 b(cc)143 3903 y(DEC)47 b(VAX/VMS)762
-b(gcc)47 b(and)g(cc)143 4015 y(HP-UX)1049 b(gcc)143 4128
-y(IBM)47 b(AIX)954 b(gcc)143 4241 y(Linux)1049 b(gcc)143
-4354 y(MkLinux)953 b(DR3)143 4467 y(Windows)46 b(95/98/NT)523
-b(Borland)46 b(C++)h(V4.5)143 4580 y(Windows)f(95/98/NT)523
+3636 y(DECstation)93 b(Ultrix)428 b(gcc)143 3749 y(Dec)47
+b(Alpha)f(OpenVMS)476 b(cc)143 3862 y(DEC)47 b(VAX/VMS)762
+b(gcc)47 b(and)g(cc)143 3975 y(HP-UX)1049 b(gcc)143 4088
+y(IBM)47 b(AIX)954 b(gcc)143 4201 y(Linux)1049 b(gcc)143
+4314 y(MkLinux)953 b(DR3)143 4427 y(Windows)46 b(95/98/NT)523
+b(Borland)46 b(C++)h(V4.5)143 4540 y(Windows)f(95/98/NT/ME/XP)235
 b(Microsoft/Compaq)43 b(Visual)j(C++)h(v5.0,)g(v6.0)143
-4693 y(Windows)f(95/98/NT)523 b(Cygwin)46 b(gcc)143 4806
-y(OS/2)1097 b(gcc)47 b(+)g(EMX)143 4919 y(MacOS)g(7.1)f(or)i(greater)
-332 b(Metrowerks)45 b(10.+)0 5179 y Fj(CFITSIO)31 b(will)e(probably)i
-(run)f(on)i(most)h(other)f(Unix)g(platforms.)45 b(Cra)m(y)32
-b(sup)s(ercomputers)e(and)i(IBM)h(main-)0 5291 y(frame)d(computers)g
-(are)h(curren)m(tly)f(not)g(supp)s(orted.)1927 5942 y(3)p
+4653 y(Windows)f(95/98/NT)523 b(Cygwin)46 b(gcc)143 4765
+y(MacOS)h(7.1)f(or)i(greater)332 b(Metrowerks)45 b(10.+)143
+4878 y(MacOS-X)h(10.1)h(or)g(greater)189 b(cc)47 b(\(gcc\))0
+5098 y Fj(CFITSIO)26 b(will)g(probably)g(run)g(on)i(most)g(other)h
+(Unix)d(platforms.)39 b(Cra)m(y)28 b(sup)s(ercomputers)e(are)j(curren)m
+(tly)e(not)0 5211 y(supp)s(orted.)0 5495 y Fd(2.1.1)112
+b(Unix)38 b(Systems)0 5714 y Fj(The)30 b(CFITSIO)f(library)f(is)h
+(built)f(on)j(Unix)e(systems)h(b)m(y)g(t)m(yping:)1927
+5942 y(5)p eop
+%%Page: 6 14
+6 13 bop 0 299 a Fj(6)1580 b Fh(CHAPTER)30 b(2.)112 b(CREA)-8
+b(TING)30 b(THE)g(CFITSIO)f(LIBRAR)-8 b(Y)48 555 y Fe(>)95
+b(./configure)45 b([--prefix=/target/insta)o(llat)o(ion)o(/pat)o(h])48
+668 y(>)95 b(make)476 b(\(or)95 b('make)46 b(shared'\))48
+781 y(>)95 b(make)47 b(install)93 b(\(this)46 b(step)h(is)g(optional\))
+0 1037 y Fj(at)24 b(the)g(op)s(erating)f(system)h(prompt.)38
+b(The)23 b(con\014gure)g(command)g(customizes)h(the)g(Mak)m(e\014le)g
+(for)g(the)g(particular)0 1150 y(system,)g(then)d(the)g(`mak)m(e')i
+(command)e(compiles)f(the)h(source)h(\014les)e(and)h(builds)d(the)j
+(library)-8 b(.)36 b(T)m(yp)s(e)21 b(`./con\014gure')0
+1263 y(and)34 b(not)h(simply)d(`con\014gure')j(to)h(ensure)e(that)h
+(the)g(con\014gure)g(script)e(in)h(the)h(curren)m(t)f(directory)g(is)g
+(run)g(and)0 1375 y(not)29 b(some)g(other)g(system-wide)f(con\014gure)g
+(script.)39 b(The)29 b(optional)f('pre\014x')g(argumen)m(t)h(to)g
+(con\014gure)g(giv)m(es)g(the)0 1488 y(path)f(to)i(the)f(directory)f
+(where)g(the)h(CFITSIO)f(library)e(and)i(include)f(\014les)g(should)g
+(b)s(e)h(installed)f(via)h(the)h(later)0 1601 y('mak)m(e)j(install')c
+(command.)41 b(F)-8 b(or)31 b(example,)143 1857 y Fe(>)48
+b(./configure)c(--prefix=/usr1/local)0 2113 y Fj(will)22
+b(cause)k(the)f('mak)m(e)h(install')d(command)i(to)h(cop)m(y)g(the)f
+(CFITSIO)e(lib)s(c\014tsio)f(\014le)j(to)g(/usr1/lo)s(cal/lib)e(and)i
+(the)0 2226 y(necessary)33 b(include)c(\014les)j(to)g(/usr1/lo)s
+(cal/include)f(\(assuming)g(of)h(course)g(that)h(the)f(pro)s(cess)g
+(has)g(p)s(ermission)0 2338 y(to)f(write)f(to)h(these)g(directories\).)
+0 2499 y(The)d('mak)m(e)h(shared')f(option)g(builds)d(a)k(shared)e(or)i
+(dynamic)e(v)m(ersion)h(of)g(the)h(CFITSIO)d(library)-8
+b(.)38 b(When)28 b(using)0 2612 y(the)f(shared)f(library)f(the)i
+(executable)g(co)s(de)g(is)f(not)h(copied)f(in)m(to)h(y)m(our)g
+(program)g(at)g(link)e(time)h(and)h(instead)f(the)0 2724
+y(program)h(lo)s(cates)h(the)g(necessary)g(library)d(co)s(de)j(at)g
+(run)e(time,)i(normally)e(through)g(LD)p 3065 2724 28
+4 v 33 w(LIBRAR)-8 b(Y)p 3514 2724 V 34 w(P)g(A)g(TH)28
+b(or)0 2837 y(some)j(other)f(metho)s(d.)41 b(The)29 b(adv)-5
+b(an)m(tages)33 b(of)d(using)f(a)i(shared)e(library)f(are:)143
+3093 y Fe(1.)95 b(Less)47 b(disk)f(space)h(if)g(you)g(build)f(more)h
+(than)f(1)i(program)143 3206 y(2.)95 b(Less)47 b(memory)f(if)h(more)g
+(than)f(one)h(copy)g(of)g(a)g(program)f(using)h(the)g(shared)334
+3319 y(library)f(is)h(running)f(at)h(the)g(same)g(time)f(since)h(the)g
+(system)f(is)h(smart)334 3432 y(enough)f(to)h(share)g(copies)f(of)h
+(the)g(shared)f(library)g(at)h(run)g(time.)143 3545 y(3.)95
+b(Possibly)46 b(easier)g(maintenance)e(since)j(a)g(new)g(version)f(of)h
+(the)g(shared)334 3658 y(library)f(can)h(be)g(installed)e(without)h
+(relinking)f(all)i(the)g(software)334 3770 y(that)g(uses)f(it)i(\(as)e
+(long)h(as)g(the)g(subroutine)e(names)i(and)f(calling)334
+3883 y(sequences)f(remain)h(unchanged\).)143 3996 y(4.)95
+b(No)47 b(run-time)f(penalty.)0 4252 y Fj(The)30 b(disadv)-5
+b(an)m(tages)31 b(are:)143 4508 y Fe(1.)47 b(More)g(hassle)f(at)h
+(runtime.)94 b(You)46 b(have)h(to)g(either)f(build)h(the)g(programs)286
+4621 y(specially)f(or)h(have)f(LD_LIBRARY_PATH)e(set)j(right.)143
+4733 y(2.)g(There)g(may)g(be)g(a)g(slight)f(start)h(up)g(penalty,)e
+(depending)h(on)h(where)f(you)h(are)286 4846 y(reading)f(the)h(shared)f
+(library)g(and)h(the)g(program)f(from)g(and)h(if)g(your)g(CPU)g(is)286
+4959 y(either)f(really)h(slow)f(or)h(really)f(heavily)g(loaded.)0
+5215 y Fj(On)32 b(Mac)i(OS)e(X)i(platforms)e(the)h('mak)m(e)h(shared')f
+(command)f(w)m(orks)h(lik)m(e)g(on)g(other)g(UNIX)g(platforms,)g(but)g
+(a)0 5328 y(.dylib)d(\014le)h(will)e(b)s(e)i(created)i(instead)f(of)g
+(.so.)46 b(If)31 b(installed)f(in)h(a)h(nonstandard)f(lo)s(cation,)h
+(add)f(its)h(lo)s(cation)f(to)0 5441 y(the)g(D)m(YLD)p
+422 5441 V 34 w(LIBRAR)-8 b(Y)p 872 5441 V 33 w(P)g(A)g(TH)31
+b(en)m(vironmen)m(t)f(v)-5 b(ariable)29 b(so)i(that)g(the)f(library)e
+(can)j(b)s(e)f(found)f(at)i(run)e(time.)0 5601 y(On)h(HP/UX)i(systems,)
+g(the)f(en)m(vironmen)m(t)g(v)-5 b(ariable)30 b(CFLA)m(GS)h(should)e(b)
+s(e)i(set)g(to)h(-Ae)g(b)s(efore)f(running)d(con-)0 5714
+y(\014gure)i(to)h(enable)f("extended)h(ANSI")f(features.)p
 eop
-%%Page: 4 10
-4 9 bop 0 299 a Fj(4)1580 b Fh(CHAPTER)30 b(2.)112 b(CREA)-8
-b(TING)30 b(THE)g(CFITSIO)f(LIBRAR)-8 b(Y)0 555 y Fd(2.1.1)150
-b(Unix)37 b(Systems)0 775 y Fj(The)30 b(CFITSIO)f(library)f(is)h(built)
-f(on)j(Unix)e(systems)h(b)m(y)g(t)m(yping:)143 1038 y
-Ff(>)48 b(./configure)143 1151 y(>)g(make)0 1414 y Fj(at)36
-b(the)g(op)s(erating)f(system)h(prompt.)55 b(T)m(yp)s(e)35
-b(./con\014gure)i(and)e(not)g(simply)f(`con\014gure')h(to)i(ensure)e
-(that)h(the)0 1527 y(con\014gure)22 b(script)f(in)g(the)h(curren)m(t)g
-(directory)g(is)f(run)f(and)i(not)g(some)h(other)f(system-wide)g
-(con\014gure)g(script.)36 b(The)0 1640 y(con\014gure)e(command)g
-(customizes)g(the)g(Mak)m(e\014le)h(for)f(the)g(particular)f(system,)i
-(then)f(the)h(`mak)m(e')g(command)0 1753 y(compiles)29
-b(the)i(source)f(\014les)g(and)f(builds)f(the)i(library)-8
-b(.)0 1913 y(On)30 b(HP/UX)i(systems,)g(the)f(en)m(vironmen)m(t)g(v)-5
-b(ariable)30 b(CFLA)m(GS)h(should)e(b)s(e)i(set)g(to)h(-Ae)g(b)s(efore)
-f(running)d(con-)0 2026 y(\014gure)i(to)h(enable)f("extended)h(ANSI")f
-(features.)0 2186 y(By)h(default,)g(a)g(set)h(of)f(F)-8
+%%Page: 7 15
+7 14 bop 0 299 a Fh(2.1.)72 b(BUILDING)31 b(THE)f(LIBRAR)-8
+b(Y)2507 b Fj(7)0 555 y(By)31 b(default,)g(a)g(set)h(of)f(F)-8
 b(ortran-callable)31 b(wrapp)s(er)e(routines)h(are)h(also)g(built)e
-(and)h(included)f(in)g(the)i(CFITSIO)0 2299 y(library)-8
+(and)h(included)f(in)g(the)i(CFITSIO)0 668 y(library)-8
 b(.)68 b(If)40 b(these)g(wrapp)s(er)f(routines)g(are)h(not)h(needed)e
 (\(i.e.,)44 b(the)c(CFITSIO)f(library)e(will)h(not)i(b)s(e)g(link)m(ed)
-0 2412 y(to)d(an)m(y)f(F)-8 b(ortran)37 b(applications)d(whic)m(h)h
+0 781 y(to)d(an)m(y)f(F)-8 b(ortran)37 b(applications)d(whic)m(h)h
 (call)g(FITSIO)g(subroutines\))f(then)i(they)g(ma)m(y)h(b)s(e)e
-(omitted)h(from)g(the)0 2525 y(build)26 b(b)m(y)k(t)m(yping)f('mak)m(e)
-h(all-no\014tsio')f(instead)f(of)i(simply)d(t)m(yping)i('mak)m(e'.)42
-b(This)27 b(will)g(reduce)i(the)h(size)f(of)h(the)0 2638
-y(CFITSIO)f(library)f(sligh)m(tly)-8 b(.)0 2798 y(Most)37
+(omitted)h(from)g(the)0 894 y(build)26 b(b)m(y)k(t)m(yping)f('mak)m(e)h
+(all-no\014tsio')f(instead)f(of)i(simply)d(t)m(yping)i('mak)m(e'.)42
+b(This)27 b(will)g(reduce)i(the)h(size)f(of)h(the)0 1007
+y(CFITSIO)f(library)f(sligh)m(tly)-8 b(.)0 1167 y(Most)37
 b(32-bit)g(op)s(erating)f(systems)g(ha)m(v)m(e)i(only)d(supp)s(orted)g
 (disk)g(\014les)g(up)g(to)i(2.1GB)i(\(2**31)g(b)m(ytes\))e(in)e(size.)0
-2911 y(Starting)k(with)f(v)m(ersion)g(2.1)j(of)e(CFITSIO,)f(FITS)g
+1280 y(Starting)k(with)f(v)m(ersion)g(2.1)j(of)e(CFITSIO,)f(FITS)g
 (\014les)h(larger)g(than)f(this)h(limit)e(\(up)h(to)i(6)g(terab)m
-(ytes\))h(can)0 3024 y(b)s(e)33 b(read)h(and)f(written)g(on)g
-(platforms)g(whic)m(h)f(supp)s(ort)g(large)i(\014les)f(\(e.g.,)j
-(Solaris\).)49 b(T)-8 b(o)34 b(enable)g(this)e(feature,)0
-3136 y(CFITSIO)j(m)m(ust)h(b)s(e)f(compiled)g(with)f(the)j(`-D)p
-1668 3136 28 4 v 34 w(FILE)p 1913 3136 V 32 w(OFFSET)p
-2313 3136 V 32 w(BITS=64')g(compiler)d(\015ag.)59 b(All)34
-b(programs)0 3249 y(whic)m(h)43 b(link)f(to)j(the)f(CFITSIO)f(library)f
-(m)m(ust)i(also)g(b)s(e)g(compiled)e(with)h(this)g(\015ag)i(or)f(m)m
-(ust)g(include)e(this)0 3362 y(prepro)s(cessor)c(de\014nition)f(at)i
-(the)g(start)h(of)f(the)g(source)g(co)s(de)g(\014le.)65
-b(See)39 b(the)g(`CFITSIO)f(Size)g(Limitations')0 3475
-y(section)31 b(in)e(Chapter)g(5)i(for)f(further)f(details.)0
-3635 y(It)37 b(ma)m(y)h(not)g(b)s(e)f(p)s(ossible)d(to)k(staticly)g
-(link)d(programs)i(that)h(use)f(CFITSIO)e(on)j(some)f(platforms)g
-(\(namely)-8 b(,)0 3748 y(on)35 b(Solaris)f(2.6\))i(due)f(to)h(the)f
-(net)m(w)m(ork)i(driv)m(ers)c(\(whic)m(h)i(pro)m(vide)f(FTP)h(and)g
-(HTTP)f(access)j(to)f(FITS)e(\014les\).)0 3861 y(It)i(is)e(p)s(ossible)
-f(to)k(mak)m(e)f(b)s(oth)f(a)h(dynamic)e(and)h(a)h(static)h(v)m(ersion)
-e(of)g(the)h(CFITSIO)e(library)-8 b(,)35 b(but)g(net)m(w)m(ork)0
-3974 y(\014le)f(access)i(will)31 b(not)k(b)s(e)f(p)s(ossible)e(using)h
-(the)i(static)g(v)m(ersion.)53 b(T)-8 b(o)35 b(build)d(the)j(dynamic)e
-(lib)s(c\014tsio.so)f(library)0 4087 y(\(on)37 b(solaris\),)g(t)m(yp)s
-(e)g('mak)m(e)h(clean',)h(then)d(edit)g(the)h(Mak)m(e\014le)g(to)g(add)
-f(-fPIC)g(or)h(-KPIC)f(\(gcc)i(or)f(cc\))g(to)h(the)0
-4200 y(CFLA)m(GS)g(line,)f(then)g(rebuild)d(the)k(library)d(with)h
-('mak)m(e'.)63 b(Once)37 b(y)m(ou're)h(done,)h(build)34
-b(the)k(shared)e(library)0 4313 y(with)48 4576 y Ff(ld)47
-b(-G)g(-z)g(text)g(-o)g(libcfitsio.so)d(*.o)0 4839 y
-Fj(Then)19 b(to)i(get)h(the)e(staticly)g(link)-5 b(able)18
-b(lib)s(c\014tsio.a)g(library)g(\014le)i(do)g(another)g(mak)m(e)h
-(clean,)i(unde\014ne)18 b(HA)-10 b(VE)p 3633 4839 V 34
-w(NET)p 3863 4839 V 32 w(SER)g(VICES)0 4952 y(on)29 b(the)h(CFLA)m(GS)g
-(line)d(and)i(rebuild.)38 b(It's)29 b(unimp)s(ortan)m(t)f(whether)h(or)
-g(not)h(y)m(ou)g(use)f(-fPIC)g(for)g(static)h(builds.)0
-5112 y(When)25 b(using)e(the)i(shared)f(library)f(the)i(executable)g
-(co)s(de)h(is)e(not)h(copied)f(in)m(to)h(y)m(our)g(program)f(at)i(link)
-d(time)i(and)0 5225 y(instead)20 b(the)g(program)g(lo)s(cates)h(the)f
-(necessary)h(library)d(co)s(de)i(at)h(run)e(time,)k(normally)18
-b(through)i(LD)p 3438 5225 V 33 w(LIBRAR)-8 b(Y)p 3887
-5225 V 33 w(P)g(A)g(TH)0 5338 y(or)30 b(some)h(other)g(metho)s(d.)40
-b(The)30 b(adv)-5 b(an)m(tages)32 b(are:)143 5601 y Ff(1.)95
-b(Less)47 b(disk)f(space)h(if)g(you)g(build)f(more)h(than)f(1)i
-(program)143 5714 y(2.)95 b(Less)47 b(memory)f(if)h(more)g(than)f(one)h
-(copy)g(of)g(a)g(program)f(using)h(the)g(shared)p eop
-%%Page: 5 11
-5 10 bop 0 299 a Fh(2.1.)72 b(BUILDING)31 b(THE)f(LIBRAR)-8
-b(Y)2507 b Fj(5)334 555 y Ff(library)46 b(is)h(running)f(at)h(the)g
-(same)g(time)f(since)h(the)g(system)f(is)h(smart)334
-668 y(enough)f(to)h(share)g(copies)f(of)h(the)g(shared)f(library)g(at)h
-(run)g(time.)143 781 y(3.)95 b(Possibly)46 b(easier)g(maintenance)e
-(since)j(a)g(new)g(version)f(of)h(the)g(shared)334 894
-y(library)f(can)h(be)g(installed)e(without)h(relinking)f(all)i(the)g
-(software)334 1007 y(that)g(uses)f(it)i(\(as)e(long)h(as)g(the)g
-(subroutine)e(names)i(and)f(calling)334 1120 y(sequences)f(remain)h
-(unchanged\).)143 1233 y(4.)95 b(No)47 b(run-time)f(penalty.)0
-1503 y Fj(The)30 b(disadv)-5 b(an)m(tages)31 b(are:)143
-1772 y Ff(1.)47 b(More)g(hassle)f(at)h(runtime.)94 b(You)46
-b(have)h(to)g(either)f(build)h(the)g(programs)286 1885
-y(specially)f(or)h(have)f(LD_LIBRARY_PATH)e(set)j(right.)143
-1998 y(2.)g(There)g(may)g(be)g(a)g(slight)f(start)h(up)g(penality,)e
-(depending)g(on)j(where)e(you)h(are)286 2111 y(reading)f(the)h(shared)f
-(library)g(and)h(the)g(program)f(from)g(and)h(if)g(your)g(CPU)g(is)286
-2224 y(either)f(really)h(slow)f(or)h(really)f(heavily)g(loaded.)0
-2527 y Fd(2.1.2)112 b(VMS)0 2748 y Fj(On)28 b(V)-10 b(AX/VMS)31
-b(and)d(ALPHA/VMS)i(systems)f(the)h(mak)m(e)p 2100 2748
-28 4 v 34 w(g\015oat.com)h(command)e(\014le)f(ma)m(y)i(b)s(e)f
-(executed)h(to)0 2861 y(build)j(the)k(c\014tsio.olb)e(ob)5
+(ytes\))h(can)0 1393 y(b)s(e)c(read)g(and)g(written)f(on)h(platforms)g
+(that)h(supp)s(ort)d(large)j(\014les)e(\(e.g.,)41 b(Solaris\).)60
+b(T)-8 b(o)38 b(enable)f(this)f(feature,)0 1506 y(CFITSIO)25
+b(m)m(ust)i(b)s(e)g(compiled)e(with)h(the)h(`-D)p 1613
+1506 28 4 v 34 w(FILE)p 1858 1506 V 32 w(OFFSET)p 2258
+1506 V 32 w(BITS=64')g(compiler)f(\015ag.)40 b(Some)27
+b(platforms)0 1619 y(ma)m(y)36 b(also)g(require)f(the)h(`-D)p
+993 1619 V 33 w(LAR)m(GE)p 1348 1619 V 34 w(FILES')f(compiler)f
+(\015ag.)58 b(All)34 b(programs)i(that)g(link)e(to)i(the)g(CFITSIO)0
+1732 y(library)23 b(m)m(ust)i(also)h(b)s(e)f(compiled)f(with)g(this)g
+(\015ag)i(or)g(m)m(ust)f(include)e(this)i(prepro)s(cessor)f
+(de\014nition)f(at)k(the)e(start)0 1844 y(of)i(the)h(source)f(co)s(de)h
+(\014le.)39 b(See)27 b(the)h(`CFITSIO)d(Size)i(Limitations')f(section)h
+(in)f(Chapter)h(4)h(for)f(further)f(details.)0 2005 y(It)j(ma)m(y)h
+(not)f(b)s(e)f(p)s(ossible)f(to)i(staticly)g(link)e(programs)i(that)g
+(use)g(CFITSIO)e(on)i(some)h(platforms)d(\(namely)-8
+b(,)30 b(on)0 2118 y(Solaris)k(2.6\))j(due)e(to)i(the)e(net)m(w)m(ork)i
+(driv)m(ers)d(\(whic)m(h)h(pro)m(vide)g(FTP)g(and)g(HTTP)g(access)i(to)
+g(FITS)e(\014les\).)56 b(It)0 2230 y(is)32 b(p)s(ossible)e(to)k(mak)m
+(e)f(b)s(oth)g(a)g(dynamic)e(and)h(a)i(static)f(v)m(ersion)f(of)h(the)g
+(CFITSIO)e(library)-8 b(,)32 b(but)g(net)m(w)m(ork)i(\014le)0
+2343 y(access)e(will)27 b(not)k(b)s(e)f(p)s(ossible)e(using)h(the)h
+(static)h(v)m(ersion.)0 2649 y Fd(2.1.2)112 b(VMS)0 2871
+y Fj(On)28 b(V)-10 b(AX/VMS)31 b(and)d(ALPHA/VMS)i(systems)f(the)h(mak)
+m(e)p 2100 2871 V 34 w(g\015oat.com)h(command)e(\014le)f(ma)m(y)i(b)s
+(e)f(executed)h(to)0 2984 y(build)j(the)k(c\014tsio.olb)e(ob)5
 b(ject)37 b(library)d(using)h(the)h(default)g(G-\015oating)g(p)s(oin)m
-(t)g(option)f(for)h(double)f(v)-5 b(ariables.)0 2974
-y(The)37 b(mak)m(e)p 405 2974 V 33 w(d\015oat.com)i(and)d(mak)m(e)p
-1279 2974 V 34 w(ieee.com)i(\014les)f(ma)m(y)g(b)s(e)g(used)f(instead)h
-(to)h(build)c(the)j(library)e(with)h(the)0 3087 y(other)26
+(t)g(option)f(for)h(double)f(v)-5 b(ariables.)0 3097
+y(The)37 b(mak)m(e)p 405 3097 V 33 w(d\015oat.com)i(and)d(mak)m(e)p
+1279 3097 V 34 w(ieee.com)i(\014les)f(ma)m(y)g(b)s(e)g(used)f(instead)h
+(to)h(build)c(the)j(library)e(with)h(the)0 3210 y(other)26
 b(\015oating)h(p)s(oin)m(t)e(options.)38 b(Note)28 b(that)f(the)f
 (getcwd)h(function)e(that)i(is)e(used)g(in)g(the)i(group.c)f(mo)s(dule)
-e(ma)m(y)0 3200 y(require)43 b(that)j(programs)e(using)f(CFITSIO)g(b)s
+e(ma)m(y)0 3322 y(require)43 b(that)j(programs)e(using)f(CFITSIO)g(b)s
 (e)h(link)m(ed)g(with)f(the)i(ALPHA$LIBRAR)-8 b(Y:V)e(AX)m(CR)i(TL.OLB)
-0 3313 y(library)g(.)39 b(See)30 b(the)h(example)f(link)e(line)h(in)g
+0 3435 y(library)g(.)39 b(See)30 b(the)h(example)f(link)e(line)h(in)g
 (the)i(next)f(section)h(of)f(this)g(do)s(cumen)m(t.)0
-3615 y Fd(2.1.3)112 b(Windo)m(ws)37 b(PCs)0 3836 y Fj(A)28
+3741 y Fd(2.1.3)112 b(Windo)m(ws)37 b(PCs)0 3963 y Fj(A)28
 b(precompiled)e(DLL)i(v)m(ersion)f(of)h(CFITSIO)e(is)h(a)m(v)-5
 b(ailable)28 b(for)f(IBM-PC)h(users)g(of)g(the)g(Borland)f(or)h
-(Microsoft)0 3949 y(Visual)44 b(C++)g(compilers)g(in)g(the)i(\014les)e
-(c\014tsio)s(dll)p 1802 3949 V 31 w(2xxx)p 2022 3949
+(Microsoft)0 4076 y(Visual)44 b(C++)g(compilers)g(in)g(the)i(\014les)e
+(c\014tsio)s(dll)p 1802 4076 V 31 w(2xxx)p 2022 4076
 V 33 w(b)s(orland.zip)e(and)j(c\014tsio)s(dll)p 3078
-3949 V 30 w(2xxx)p 3297 3949 V 33 w(v)m(cc.zip,)50 b(where)0
-4062 y('2xxx')45 b(represen)m(ts)f(the)g(curren)m(t)g(release)h(n)m(um)
+4076 V 30 w(2xxx)p 3297 4076 V 33 w(v)m(cc.zip,)50 b(where)0
+4189 y('2xxx')45 b(represen)m(ts)f(the)g(curren)m(t)g(release)h(n)m(um)
 m(b)s(er.)81 b(These)44 b(zip)f(arc)m(hiv)m(es)h(also)h(con)m(tains)f
-(other)g(\014les)g(and)0 4175 y(instructions)28 b(on)i(ho)m(w)h(to)g
-(use)f(the)h(CFITSIO)d(DLL)j(library)-8 b(.)0 4335 y(The)28
+(other)g(\014les)g(and)0 4302 y(instructions)28 b(on)i(ho)m(w)h(to)g
+(use)f(the)h(CFITSIO)d(DLL)j(library)-8 b(.)0 4462 y(The)28
 b(CFITSIO)g(library)e(ma)m(y)j(also)g(b)s(e)f(built)f(from)h(the)h
 (source)g(co)s(de)g(using)f(the)h(mak)m(e\014le.b)s(c)f(or)h(mak)m
-(e\014le.v)m(cc)0 4448 y(\014les.)54 b(Finally)-8 b(,)35
+(e\014le.v)m(cc)0 4575 y(\014les.)54 b(Finally)-8 b(,)35
 b(the)g(mak)m(ep)s(c.bat)h(\014le)e(giv)m(es)i(an)f(example)g(of)g
-(building)c(CFITSIO)j(with)f(the)j(Borland)e(C++)0 4561
+(building)c(CFITSIO)j(with)f(the)j(Borland)e(C++)0 4688
 y(v4.5)d(compiler)e(using)g(older)h(DOS)g(commands.)0
-4864 y Fd(2.1.4)112 b(OS/2)0 5085 y Fj(On)31 b(OS/2)i(systems,)f
-(CFITSIO)f(can)h(b)s(e)g(built)e(b)m(y)i(t)m(yping)g('mak)m(e)h(-f)f
-(mak)m(e\014le.os2'.)48 b(This)30 b(mak)m(e\014le)i(requires)0
-5198 y(the)27 b(GCC)g(compiler)e(and)i(EMX)g(library)-8
-b(,)26 b(whic)m(h)g(are)h(a)m(v)-5 b(ailable)27 b(from)f(man)m(y)h(In)m
-(ternet)h(sites)e(con)m(taining)h(OS/2)0 5311 y(soft)m(w)m(are,)32
-b(suc)m(h)e(as)239 5581 y Ff(ftp-os2.nmsu.edu/pub/os)o(2/de)o(v/e)o
-(mx/v)o(0.9c)136 b(and)239 5694 y(ftp.leo.org/pub/comp/os)o(/os2)o(/le)
-o(o/de)o(vtoo)o(ls/)o(emx+)o(gcc.)p eop
-%%Page: 6 12
-6 11 bop 0 299 a Fj(6)1580 b Fh(CHAPTER)30 b(2.)112 b(CREA)-8
-b(TING)30 b(THE)g(CFITSIO)f(LIBRAR)-8 b(Y)0 555 y Fd(2.1.5)112
-b(Macin)m(tosh)38 b(PCs)0 779 y Fj(The)47 b(MacOS)h(v)m(ersion)f(of)g
-(the)h(CFITSIO)e(library)f(can)j(b)s(e)e(built)g(b)m(y)h(\(1\))i(un)d
-(binhex)f(and)i(unstu\013)f(c\014t-)0 892 y(sio)p 112
-892 28 4 v 32 w(mac.sit.hqx,)d(\(2\))e(put)e(CFitsioPPC.mcp)f(in)h(the)
-h(c\014tsio)f(directory)-8 b(,)43 b(and)c(\(3\))i(load)f
-(CFitsioPPC.mcp)0 1005 y(in)m(to)32 b(Co)s(deW)-8 b(arrior)31
-b(Pro)h(5)g(and)f(mak)m(e.)47 b(This)30 b(builds)f(the)j(c\014tsio)f
-(library)f(for)h(PPC.)h(There)f(are)i(also)f(targets)0
-1118 y(for)e(b)s(oth)g(the)g(test)i(program)e(and)g(the)g(sp)s(eed)g
-(test)h(program.)0 1278 y(T)-8 b(o)27 b(use)f(the)h(MacOS)g(p)s(ort)f
-(y)m(ou)h(can)g(add)f(C\014tsio)g(PPC.lib)e(to)j(y)m(our)g(Co)s(deW)-8
-b(arrior)26 b(Pro)g(5)h(pro)5 b(ject.)40 b(Note)28 b(that)0
-1391 y(this)h(only)h(has)g(b)s(een)g(tested)h(for)f(the)g(PPC)g(and)g
-(probably)e(w)m(on't)j(w)m(ork)g(on)f(68k)h(Macs.)0 1749
-y Fe(2.2)135 b(T)-11 b(esting)46 b(the)f(Library)0 2004
-y Fj(The)40 b(CFITSIO)e(library)g(should)g(b)s(e)h(tested)i(b)m(y)f
-(building)c(and)j(running)f(the)i(testprog.c)h(program)f(that)h(is)0
-2117 y(included)28 b(with)h(the)h(release.)41 b(On)30
-b(Unix)f(systems,)i(t)m(yp)s(e:)191 2398 y Ff(\045)47
-b(make)g(testprog)191 2511 y(\045)g(testprog)f(>)h(testprog.lis)191
-2624 y(\045)g(diff)g(testprog.lis)d(testprog.out)191
-2737 y(\045)j(cmp)g(testprog.fit)e(testprog.std)0 3018
+4993 y Fd(2.1.4)112 b(Macin)m(tosh)38 b(PCs)0 5215 y
+Fj(When)30 b(building)d(on)j(Mac)h(OS-X,)g(users)e(should)g(follo)m(w)g
+(the)i(Unix)e(instructions,)f(ab)s(o)m(v)m(e.)0 5375
+y(The)h(classic)f(MacOS)h(v)m(ersion)g(\(OS)g(9)g(or)g(earlier\))f(of)i
+(the)f(CFITSIO)e(library)g(can)i(b)s(e)g(built)e(b)m(y)i(\(1\))h(un)e
+(binhex)0 5488 y(and)e(unstu\013)g(c\014tsio)p 714 5488
+V 33 w(mac.sit.hqx,)i(\(2\))g(put)e(CFitsioPPC.mcp)f(in)h(the)h
+(c\014tsio)g(directory)-8 b(,)28 b(and)e(\(3\))i(load)f(CFit-)0
+5601 y(sioPPC.mcp)i(in)m(to)i(Co)s(deW)-8 b(arrior)30
+b(Pro)g(5)h(and)f(mak)m(e.)42 b(This)29 b(builds)e(the)k(CFITSIO)e
+(library)f(for)i(PPC.)g(There)0 5714 y(are)h(also)f(targets)i(for)e(b)s
+(oth)g(the)g(test)i(program)e(and)f(the)i(sp)s(eed)e(test)j(program.)p
+eop
+%%Page: 8 16
+8 15 bop 0 299 a Fj(8)1580 b Fh(CHAPTER)30 b(2.)112 b(CREA)-8
+b(TING)30 b(THE)g(CFITSIO)f(LIBRAR)-8 b(Y)0 555 y Fj(T)g(o)27
+b(use)f(the)h(MacOS)g(p)s(ort)f(y)m(ou)h(can)g(add)f(C\014tsio)g
+(PPC.lib)e(to)j(y)m(our)g(Co)s(deW)-8 b(arrior)26 b(Pro)g(5)h(pro)5
+b(ject.)40 b(Note)28 b(that)0 668 y(this)h(only)h(has)g(b)s(een)g
+(tested)h(for)f(the)g(PPC)g(and)g(probably)e(w)m(on't)j(w)m(ork)g(on)f
+(68k)h(Macs.)0 1025 y Ff(2.2)135 b(T)-11 b(esting)46
+b(the)f(Library)0 1280 y Fj(The)40 b(CFITSIO)e(library)g(should)g(b)s
+(e)h(tested)i(b)m(y)f(building)c(and)j(running)f(the)i(testprog.c)h
+(program)f(that)h(is)0 1393 y(included)28 b(with)h(the)h(release.)41
+b(On)30 b(Unix)f(systems,)i(t)m(yp)s(e:)191 1672 y Fe(\045)47
+b(make)g(testprog)191 1785 y(\045)g(testprog)f(>)h(testprog.lis)191
+1898 y(\045)g(diff)g(testprog.lis)d(testprog.out)191
+2011 y(\045)j(cmp)g(testprog.fit)e(testprog.std)0 2290
 y Fj(On)30 b(VMS)g(systems,)g(\(assuming)g(cc)h(is)e(the)i(name)f(of)h
-(the)f(C)g(compiler)f(command\),)i(t)m(yp)s(e:)191 3298
-y Ff($)47 b(cc)h(testprog.c)191 3411 y($)f(link)g(testprog,)e
-(cfitsio/lib,)g(alpha$library:vaxcrtl/l)o(ib)191 3524
-y($)i(run)g(testprog)0 3805 y Fj(The)30 b(testprog)h(program)g(should)d
-(pro)s(duce)h(a)i(FITS)f(\014le)f(called)h(`testprog.\014t')i(that)f
-(is)e(iden)m(tical)h(to)h(the)f(`test-)0 3918 y(prog.std')25
-b(FITS)f(\014le)f(included)f(with)h(this)h(release.)39
-b(The)24 b(diagnostic)g(messages)i(\(whic)m(h)d(w)m(ere)i(pip)s(ed)e
-(to)i(the)g(\014le)0 4031 y(testprog.lis)f(in)f(the)i(Unix)e(example\))
-i(should)d(b)s(e)i(iden)m(tical)g(to)h(the)g(listing)d(con)m(tained)j
-(in)e(the)i(\014le)e(testprog.out.)0 4144 y(The)30 b('di\013)7
-b(')30 b(and)f('cmp')i(commands)f(sho)m(wn)g(ab)s(o)m(v)m(e)h(should)e
-(not)h(rep)s(ort)g(an)m(y)h(di\013erences)f(in)f(the)h(\014les.)40
-b(\(There)0 4257 y(ma)m(y)d(b)s(e)e(some)i(minor)d(formating)i
-(di\013erences,)h(suc)m(h)f(as)g(the)g(presence)g(or)g(absence)h(of)f
-(leading)f(zeros,)j(or)f(3)0 4370 y(digit)29 b(exp)s(onen)m(ts)h(in)f
-(n)m(um)m(b)s(ers,)h(whic)m(h)f(can)h(b)s(e)g(ignored\).)0
-4530 y(The)e(F)-8 b(ortran)30 b(wrapp)s(ers)d(in)g(CFITSIO)g(ma)m(y)j
-(b)s(e)e(tested)h(with)f(the)h(testf77)h(program)f(on)g(Unix)e(systems)
-i(with:)191 4811 y Ff(\045)47 b(f77)g(-o)g(testf77)f(testf77.f)g(-L.)g
-(-lcfitsio)g(-lnsl)g(-lsocket)95 4924 y(or)191 5036 y(\045)h(f77)g(-f)g
-(-o)h(testf77)d(testf77.f)h(-L.)h(-lcfitsio)188 b(\(under)46
-b(SUN)h(O/S\))95 5149 y(or)191 5262 y(\045)g(f77)g(-o)g(testf77)f
-(testf77.f)g(-Wl,-L.)f(-lcfitsio)h(-lm)h(-lnsl)f(-lsocket)f(\(HP/UX\))
-191 5488 y(\045)i(testf77)f(>)i(testf77.lis)191 5601
-y(\045)f(diff)g(testf77.lis)e(testf77.out)191 5714 y(\045)i(cmp)g
-(testf77.fit)e(testf77.std)p eop
-%%Page: 7 13
-7 12 bop 0 299 a Fh(2.3.)72 b(LINKING)30 b(PR)m(OGRAMS)h(WITH)f
-(CFITSIO)1975 b Fj(7)0 555 y(On)31 b(mac)m(hines)g(running)f(SUN)h
-(O/S,)h(F)-8 b(ortran)33 b(programs)e(m)m(ust)h(b)s(e)f(compiled)f
-(with)h(the)h('-f)7 b(')32 b(option)g(to)g(force)0 668
-y(double)24 b(precision)g(v)-5 b(ariables)24 b(to)i(b)s(e)f(aligned)f
-(on)i(8-b)m(yte)h(b)s(oundarys)c(to)j(mak)m(e)h(the)e(fortran-declared)
-g(v)-5 b(ariables)0 781 y(compatible)32 b(with)f(C.)h(A)h(similar)d
-(compiler)h(option)h(ma)m(y)h(b)s(e)f(required)f(on)h(other)h
-(platforms.)47 b(F)-8 b(ailing)31 b(to)i(use)0 894 y(this)25
-b(option)g(ma)m(y)h(cause)h(the)f(program)f(to)i(crash)e(on)h(FITSIO)f
-(routines)f(that)j(read)f(or)f(write)g(double)g(precision)0
-1007 y(v)-5 b(ariables.)0 1167 y(Also)30 b(note)h(that)f(on)g(some)h
+(the)f(C)g(compiler)f(command\),)i(t)m(yp)s(e:)191 2570
+y Fe($)47 b(cc)h(testprog.c)191 2683 y($)f(link)g(testprog,)e
+(cfitsio/lib,)g(alpha$library:vaxcrtl/l)o(ib)191 2796
+y($)i(run)g(testprog)0 3075 y Fj(The)42 b(test)h(program)f(should)e
+(pro)s(duce)h(a)i(FITS)e(\014le)h(called)f(`testprog.\014t')j(that)f
+(is)e(iden)m(tical)g(to)i(the)f(`test-)0 3188 y(prog.std')35
+b(FITS)e(\014le)h(included)d(with)i(this)g(release.)53
+b(The)34 b(diagnostic)g(messages)h(\(whic)m(h)f(w)m(ere)h(pip)s(ed)d
+(to)j(the)0 3301 y(\014le)g(testprog.lis)h(in)f(the)i(Unix)e(example\))
+h(should)e(b)s(e)i(iden)m(tical)f(to)i(the)f(listing)e(con)m(tained)j
+(in)e(the)h(\014le)g(test-)0 3414 y(prog.out.)63 b(The)37
+b('di\013)7 b(')37 b(and)g('cmp')h(commands)g(sho)m(wn)f(ab)s(o)m(v)m
+(e)i(should)c(not)j(rep)s(ort)f(an)m(y)h(di\013erences)f(in)g(the)0
+3527 y(\014les.)64 b(\(There)38 b(ma)m(y)h(b)s(e)f(some)h(minor)e
+(format)i(di\013erences,)h(suc)m(h)e(as)h(the)g(presence)f(or)h
+(absence)g(of)f(leading)0 3640 y(zeros,)31 b(or)g(3)f(digit)g(exp)s
+(onen)m(ts)g(in)f(n)m(um)m(b)s(ers,)g(whic)m(h)g(can)i(b)s(e)f
+(ignored\).)0 3800 y(The)e(F)-8 b(ortran)30 b(wrapp)s(ers)d(in)g
+(CFITSIO)g(ma)m(y)j(b)s(e)e(tested)h(with)f(the)h(testf77)h(program)f
+(on)g(Unix)e(systems)i(with:)191 4079 y Fe(\045)47 b(f77)g(-o)g
+(testf77)f(testf77.f)g(-L.)g(-lcfitsio)g(-lnsl)g(-lsocket)95
+4192 y(or)191 4305 y(\045)h(f77)g(-f)g(-o)h(testf77)d(testf77.f)h(-L.)h
+(-lcfitsio)188 b(\(under)46 b(SUN)h(O/S\))95 4418 y(or)191
+4531 y(\045)g(f77)g(-o)g(testf77)f(testf77.f)g(-Wl,-L.)f(-lcfitsio)h
+(-lm)h(-lnsl)f(-lsocket)f(\(HP/UX\))191 4757 y(\045)i(testf77)f(>)i
+(testf77.lis)191 4870 y(\045)f(diff)g(testf77.lis)e(testf77.out)191
+4983 y(\045)i(cmp)g(testf77.fit)e(testf77.std)0 5262
+y Fj(On)31 b(mac)m(hines)g(running)f(SUN)h(O/S,)h(F)-8
+b(ortran)33 b(programs)e(m)m(ust)h(b)s(e)f(compiled)f(with)h(the)h('-f)
+7 b(')32 b(option)g(to)g(force)0 5375 y(double)24 b(precision)g(v)-5
+b(ariables)24 b(to)i(b)s(e)f(aligned)f(on)i(8-b)m(yte)h(b)s(oundarys)c
+(to)j(mak)m(e)h(the)e(fortran-declared)g(v)-5 b(ariables)0
+5488 y(compatible)32 b(with)f(C.)h(A)h(similar)d(compiler)h(option)h
+(ma)m(y)h(b)s(e)f(required)f(on)h(other)h(platforms.)47
+b(F)-8 b(ailing)31 b(to)i(use)0 5601 y(this)25 b(option)g(ma)m(y)h
+(cause)h(the)f(program)f(to)i(crash)e(on)h(FITSIO)f(routines)f(that)j
+(read)f(or)f(write)g(double)g(precision)0 5714 y(v)-5
+b(ariables.)p eop
+%%Page: 9 17
+9 16 bop 0 299 a Fh(2.3.)72 b(LINKING)30 b(PR)m(OGRAMS)h(WITH)f
+(CFITSIO)1975 b Fj(9)0 555 y(Also)30 b(note)h(that)f(on)g(some)h
 (systems,)f(the)h(output)e(listing)f(of)j(the)f(testf77)i(program)d(ma)
-m(y)i(di\013er)e(sligh)m(tly)f(from)0 1280 y(the)j(testf77.std)h
+m(y)i(di\013er)e(sligh)m(tly)f(from)0 668 y(the)j(testf77.std)h
 (template,)f(if)f(leading)f(zeros)i(are)g(not)g(prin)m(ted)e(b)m(y)i
 (default)f(b)s(efore)g(the)h(decimal)e(p)s(oin)m(t)h(when)0
-1393 y(using)f(F)i(format.)0 1553 y(A)f(few)h(other)f(utilit)m(y)f
-(programs)h(are)h(included)c(with)i(CFITSIO:)191 1816
-y Ff(speed)46 b(-)i(measures)d(the)i(maximum)f(throughput)f(\(in)i(MB)g
-(per)g(second\))668 1929 y(for)g(writing)f(and)h(reading)f(FITS)g
-(files)h(with)f(CFITSIO.)191 2155 y(listhead)f(-)j(lists)e(all)h(the)g
-(header)f(keywords)g(in)h(any)g(FITS)f(file)191 2381
+781 y(using)f(F)i(format.)0 941 y(A)37 b(few)f(other)g(utilit)m(y)f
+(programs)h(are)h(included)d(with)h(CFITSIO;)g(the)i(\014rst)e(four)h
+(of)g(this)g(programs)g(can)h(b)s(e)0 1054 y(compiled)c(an)i(link)m(ed)
+e(b)m(y)i(t)m(yping)f(`mak)m(e)i(program)p 1815 1054
+28 4 v 33 w(name')f(where)f(`program)p 2746 1054 V 33
+w(name')h(is)f(the)h(actual)g(name)g(of)0 1167 y(the)c(program:)191
+1467 y Fe(speed)46 b(-)i(measures)d(the)i(maximum)f(throughput)f(\(in)i
+(MB)g(per)g(second\))668 1580 y(for)g(writing)f(and)h(reading)f(FITS)g
+(files)h(with)f(CFITSIO.)191 1806 y(listhead)f(-)j(lists)e(all)h(the)g
+(header)f(keywords)g(in)h(any)g(FITS)f(file)191 2032
 y(fitscopy)f(-)j(copies)e(any)h(FITS)g(file)f(\(especially)f(useful)h
-(in)h(conjunction)811 2494 y(with)g(the)g(CFITSIO's)e(extended)h(input)
-g(filename)g(syntax\).)191 2720 y(cookbook)f(-)j(a)f(sample)f(program)g
-(that)h(peforms)f(common)g(read)g(and)811 2833 y(write)h(operations)e
-(on)i(a)g(FITS)g(file.)191 3058 y(iter_a,)f(iter_b,)g(iter_c)g(-)h
-(tests)f(of)i(the)f(CFITSIO)e(iterator)h(routine)0 3322
-y Fj(The)30 b(\014rst)f(4)i(of)g(these)g(utilit)m(y)d(programs)i(can)h
-(b)s(e)f(compiled)f(and)g(link)m(ed)g(b)m(y)h(t)m(yping)143
-3585 y Ff(\045)95 b(make)47 b(program_name)0 3923 y Fe(2.3)135
-b(Linking)45 b(Programs)h(with)f(CFITSIO)0 4174 y Fj(When)25
-b(linking)e(applications)h(soft)m(w)m(are)j(with)d(the)i(CFITSIO)e
-(library)-8 b(,)25 b(sev)m(eral)h(system)g(libraries)d(usually)g(need)0
-4287 y(to)36 b(b)s(e)f(sp)s(eci\014ed)f(on)h(the)g(link)f(command)h
-(line.)54 b(On)34 b(Unix)h(systems,)i(the)e(most)h(reliable)d(w)m(a)m
-(y)k(to)f(determine)0 4400 y(what)26 b(libraries)e(are)i(required)f(is)
-g(to)i(t)m(yp)s(e)f('mak)m(e)i(testprog')f(and)f(see)h(what)f
-(libraries)e(the)i(con\014gure)g(script)f(has)0 4513
-y(added.)39 b(The)25 b(t)m(ypical)h(libraries)d(that)j(need)g(to)g(b)s
-(e)g(added)f(are)h(-lm)g(\(the)g(math)g(library\))e(and)h(-lnsl)f(and)i
-(-lso)s(c)m(k)m(et)0 4626 y(\(needed)k(only)f(for)h(FTP)g(and)f(HTTP)g
-(\014le)g(access\).)43 b(These)30 b(latter)g(2)g(libraries)d(are)k(not)
-f(needed)g(on)g(VMS)g(and)0 4739 y(Windo)m(ws)f(platforms,)h(b)s
-(ecause)g(FTP)h(\014le)e(access)j(is)d(not)i(curren)m(tly)e(supp)s
-(orted)g(on)h(those)h(platforms.)0 4899 y(Note)36 b(that)f(when)e
-(upgrading)f(to)j(a)g(new)m(er)f(v)m(ersion)g(of)h(CFITSIO)d(it)i(is)g
-(usually)e(necessa)m(y)j(to)g(recompile,)g(as)0 5012
-y(w)m(ell)29 b(as)i(relink,)e(the)h(programs)g(that)h(use)f(CFITSIO,)f
-(b)s(ecause)i(the)f(de\014nitions)e(in)h(\014tsio.h)h(often)g(c)m
-(hange.)0 5350 y Fe(2.4)135 b(Getting)46 b(Started)g(with)f(CFITSIO)0
-5601 y Fj(In)28 b(order)h(to)h(e\013ectiv)m(ely)g(use)f(the)g(CFITSIO)f
-(library)e(as)k(quic)m(kly)e(as)h(p)s(ossible,)e(it)i(is)f(recommended)
-h(that)g(new)0 5714 y(users)h(follo)m(w)f(these)i(steps:)p
+(in)h(conjunction)811 2145 y(with)g(the)g(CFITSIO's)e(extended)h(input)
+g(filename)g(syntax\).)191 2371 y(cookbook)f(-)j(a)f(sample)f(program)g
+(that)h(performs)e(common)i(read)f(and)811 2483 y(write)h(operations)e
+(on)i(a)g(FITS)g(file.)191 2709 y(iter_a,)f(iter_b,)g(iter_c)g(-)h
+(examples)f(of)h(the)g(CFITSIO)f(iterator)f(routine)0
+3091 y Ff(2.3)135 b(Linking)45 b(Programs)h(with)f(CFITSIO)0
+3350 y Fj(When)25 b(linking)e(applications)h(soft)m(w)m(are)j(with)d
+(the)i(CFITSIO)e(library)-8 b(,)25 b(sev)m(eral)h(system)g(libraries)d
+(usually)g(need)0 3463 y(to)36 b(b)s(e)f(sp)s(eci\014ed)f(on)h(the)g
+(link)f(command)h(line.)54 b(On)34 b(Unix)h(systems,)i(the)e(most)h
+(reliable)d(w)m(a)m(y)k(to)f(determine)0 3576 y(what)26
+b(libraries)e(are)i(required)f(is)g(to)i(t)m(yp)s(e)f('mak)m(e)i
+(testprog')f(and)f(see)h(what)f(libraries)e(the)i(con\014gure)g(script)
+f(has)0 3689 y(added.)39 b(The)25 b(t)m(ypical)h(libraries)d(that)j
+(need)g(to)g(b)s(e)g(added)f(are)h(-lm)g(\(the)g(math)g(library\))e
+(and)h(-lnsl)f(and)i(-lso)s(c)m(k)m(et)0 3802 y(\(needed)k(only)f(for)h
+(FTP)g(and)f(HTTP)g(\014le)g(access\).)43 b(These)30
+b(latter)g(2)g(libraries)d(are)k(not)f(needed)g(on)g(VMS)g(and)0
+3915 y(Windo)m(ws)f(platforms,)h(b)s(ecause)g(FTP)h(\014le)e(access)j
+(is)d(not)i(curren)m(tly)e(supp)s(orted)g(on)h(those)h(platforms.)0
+4075 y(Note)i(that)g(when)e(upgrading)f(to)j(a)f(new)m(er)g(v)m(ersion)
+f(of)h(CFITSIO)f(it)g(is)g(usually)f(necessary)i(to)h(recompile,)f(as)0
+4188 y(w)m(ell)d(as)i(relink,)e(the)h(programs)g(that)h(use)f(CFITSIO,)
+f(b)s(ecause)i(the)f(de\014nitions)e(in)h(\014tsio.h)h(often)g(c)m
+(hange.)0 4569 y Ff(2.4)135 b(Getting)46 b(Started)g(with)f(CFITSIO)0
+4829 y Fj(In)27 b(order)h(to)g(e\013ectiv)m(ely)h(use)f(the)g(CFITSIO)e
+(library)g(it)h(is)g(recommended)h(that)g(new)f(users)h(b)s(egin)e(b)m
+(y)i(reading)0 4942 y(the)g(\\CFITSIO)g(Quic)m(k)f(Start)h(Guide".)40
+b(It)28 b(con)m(tains)g(all)g(the)g(basic)g(information)e(needed)i(to)h
+(write)e(programs)0 5055 y(that)d(p)s(erform)f(most)h(t)m(yp)s(es)g(of)
+g(op)s(erations)f(on)h(FITS)f(\014les.)38 b(The)23 b(set)i(of)f
+(example)f(FITS)h(utilit)m(y)e(programs)h(that)0 5168
+y(are)29 b(a)m(v)-5 b(ailable)28 b(from)g(the)g(CFITSIO)f(w)m(eb)i
+(site)f(are)h(also)f(v)m(ery)h(useful)e(for)h(learning)f(ho)m(w)h(to)h
+(use)f(CFITSIO.)f(T)-8 b(o)0 5281 y(learn)22 b(ev)m(en)h(more)g(ab)s
+(out)f(the)h(capabilities)d(of)j(the)g(CFITSIO)e(library)f(the)j(follo)
+m(wing)e(steps)h(are)h(recommended:)0 5441 y(1.)41 b(Read)31
+b(the)f(follo)m(wing)f(short)h(`FITS)g(Primer')f(c)m(hapter)i(for)f(an)
+h(o)m(v)m(erview)g(of)f(the)h(structure)f(of)g(FITS)g(\014les.)0
+5601 y(2.)40 b(Review)27 b(the)g(Programming)f(Guidelines)f(in)h
+(Chapter)g(4)i(to)g(b)s(ecome)f(familiar)e(with)h(the)i(con)m(v)m(en)m
+(tions)g(used)0 5714 y(b)m(y)i(the)h(CFITSIO)e(in)m(terface.)p
 eop
-%%Page: 8 14
-8 13 bop 0 299 a Fj(8)1580 b Fh(CHAPTER)30 b(2.)112 b(CREA)-8
-b(TING)30 b(THE)g(CFITSIO)f(LIBRAR)-8 b(Y)0 555 y Fj(1.)41
-b(Read)29 b(the)g(follo)m(wing)e(`FITS)i(Primer')e(c)m(hapter)j(for)e
-(an)h(o)m(v)m(erview)h(of)f(the)g(structure)f(of)h(FITS)g(\014les.)39
-b(This)27 b(is)0 668 y(esp)s(ecially)i(imp)s(ortan)m(t)g(for)h(users)g
-(who)g(are)h(unfamiliar)c(with)i(the)h(FITS)g(table)g(and)g(image)h
-(extensions.)0 828 y(2.)39 b(Review)25 b(the)h(v)-5 b(arious)25
-b(topics)g(discussed)e(in)i(Chapters)f(4)i(and)f(5)h(to)g(b)s(ecome)g
-(familiar)d(with)h(the)i(con)m(v)m(en)m(tions)0 941 y(and)k(adv)-5
-b(anced)30 b(features)h(of)f(the)h(CFITSIO)e(in)m(terface.)0
-1101 y(3.)74 b(Refer)41 b(to)h(the)g(co)s(okb)s(o)s(ok.c,)j
+%%Page: 10 18
+10 17 bop 0 299 a Fj(10)1535 b Fh(CHAPTER)30 b(2.)112
+b(CREA)-8 b(TING)30 b(THE)g(CFITSIO)f(LIBRAR)-8 b(Y)0
+555 y Fj(3.)74 b(Refer)41 b(to)h(the)g(co)s(okb)s(o)s(ok.c,)j
 (listhead.c,)f(and)c(\014tscop)m(y)-8 b(.c)43 b(programs)e(that)h(are)g
-(included)c(with)i(this)h(re-)0 1214 y(lease)g(for)f(examples)g(of)h
+(included)c(with)i(this)h(re-)0 668 y(lease)g(for)f(examples)g(of)h
 (routines)e(that)i(p)s(erform)e(v)-5 b(arious)40 b(common)h(FITS)f
 (\014le)f(op)s(erations.)71 b(T)m(yp)s(e)40 b('mak)m(e)0
-1327 y(program)p 339 1327 28 4 v 33 w(name')30 b(to)h(compile)f(and)f
-(link)g(these)i(programs)f(on)g(Unix)f(systems.)0 1487
+781 y(program)p 339 781 28 4 v 33 w(name')30 b(to)h(compile)f(and)f
+(link)g(these)i(programs)f(on)g(Unix)f(systems.)0 941
 y(4.)40 b(W)-8 b(rite)29 b(a)f(simple)e(program)i(to)g(read)g(or)g
 (write)f(a)i(FITS)e(\014le)g(using)g(the)h(Basic)g(In)m(terface)h
-(routines)e(describ)s(ed)0 1600 y(in)i(Chapter)h(7.)0
-1760 y(5.)43 b(Scan)31 b(through)g(the)g(more)g(sp)s(ecialized)f
-(routines)g(that)h(are)h(describ)s(ed)d(in)h(Chapter)g(8)i(to)g(b)s
-(ecome)f(familiar)0 1873 y(with)e(the)i(functionalit)m(y)d(that)j(they)
-g(pro)m(vide.)0 2214 y Fe(2.5)135 b(Example)46 b(Program)0
-2465 y Fj(The)30 b(follo)m(wing)f(listing)g(sho)m(ws)h(an)g(example)h
-(of)f(ho)m(w)h(to)g(use)g(the)f(CFITSIO)f(routines)h(in)f(a)i(C)f
-(program.)41 b(The)0 2578 y(error)34 b(c)m(hec)m(king)h(of)g(the)f
-(returned)g(status)g(v)-5 b(alue)34 b(has)g(b)s(een)g(omitted)g(for)h
-(the)f(sak)m(e)i(of)e(clarit)m(y)-8 b(.)53 b(Refer)35
-b(to)g(the)0 2691 y(co)s(okb)s(o)s(ok.c)c(program)f(that)h(is)f
-(included)d(with)i(the)i(CFITSIO)e(distribution)e(for)j(other)g
-(example)g(programs.)0 2851 y(This)37 b(program)i(creates)h(a)f(new)f
-(FITS)g(\014le,)j(con)m(taining)d(a)h(FITS)f(image.)67
-b(An)38 b(`EXPOSURE')h(k)m(eyw)m(ord)g(is)0 2964 y(written)28
-b(to)h(the)f(header,)h(then)g(the)f(image)h(data)g(are)g(writen)e(to)i
+(routines)e(describ)s(ed)0 1054 y(in)i(Chapter)h(5.)0
+1214 y(5.)79 b(Scan)43 b(through)f(the)h(more)g(sp)s(ecialized)f
+(routines)f(that)j(are)f(describ)s(ed)e(in)h(the)h(follo)m(wing)f(c)m
+(hapters)h(to)0 1327 y(b)s(ecome)31 b(familiar)d(with)h(the)i
+(functionalit)m(y)d(that)j(they)g(pro)m(vide.)0 1660
+y Ff(2.5)135 b(Example)46 b(Program)0 1910 y Fj(The)c(follo)m(wing)g
+(listing)f(sho)m(ws)h(an)h(example)g(of)g(ho)m(w)g(to)g(use)g(the)g
+(CFITSIO)f(routines)f(in)h(a)h(C)g(program.)0 2023 y(Refer)26
+b(to)g(the)g(co)s(okb)s(o)s(ok.c)g(program)f(that)i(is)d(included)f
+(with)h(the)i(CFITSIO)e(distribution)e(for)j(other)h(example)0
+2136 y(routines.)0 2296 y(This)37 b(program)i(creates)h(a)f(new)f(FITS)
+g(\014le,)j(con)m(taining)d(a)h(FITS)f(image.)67 b(An)38
+b(`EXPOSURE')h(k)m(eyw)m(ord)g(is)0 2409 y(written)26
+b(to)h(the)f(header,)i(then)e(the)h(image)f(data)i(are)f(written)e(to)i
 (the)g(FITS)f(\014le)f(b)s(efore)i(closing)e(the)i(FITS)f(\014le.)0
-3230 y Ff(#include)46 b("fitsio.h")92 b(/*)47 b(required)f(by)h(every)g
-(program)e(that)i(uses)g(CFITSIO)93 b(*/)0 3343 y(main\(\))0
-3456 y({)191 3569 y(fitsfile)45 b(*fptr;)333 b(/*)47
+2665 y Fe(#include)46 b("fitsio.h")92 b(/*)47 b(required)f(by)h(every)g
+(program)e(that)i(uses)g(CFITSIO)93 b(*/)0 2778 y(main\(\))0
+2891 y({)191 3004 y(fitsfile)45 b(*fptr;)333 b(/*)47
 b(pointer)f(to)h(the)g(FITS)g(file;)f(defined)g(in)h(fitsio.h)f(*/)191
-3681 y(int)h(status,)f(ii,)h(jj;)191 3794 y(long)94 b(fpixel)46
+3117 y(int)h(status,)f(ii,)h(jj;)191 3230 y(long)94 b(fpixel)46
 b(=)i(1,)f(naxis)f(=)i(2,)f(nelements,)e(exposure;)191
-3907 y(long)i(naxes[2])e(=)j({)f(300,)g(200)g(};)142
+3343 y(long)i(naxes[2])e(=)j({)f(300,)g(200)g(};)142
 b(/*)47 b(image)g(is)g(300)g(pixels)f(wide)h(by)g(200)g(rows)f(*/)191
-4020 y(short)g(array[200][300];)191 4246 y(status)g(=)h(0;)429
+3456 y(short)g(array[200][300];)191 3681 y(status)g(=)h(0;)429
 b(/*)48 b(initialize)d(status)h(before)g(calling)g(fitsio)g(routines)f
-(*/)191 4359 y(fits_create_file\(&fptr,)c("testfile.fits",)j
+(*/)191 3794 y(fits_create_file\(&fptr,)c("testfile.fits",)j
 (&status\);)140 b(/*)48 b(create)e(new)h(file)f(*/)191
-4585 y(/*)h(Create)f(the)h(primary)f(array)g(image)h(\(16-bit)e(short)i
-(integer)f(pixels)g(*/)191 4698 y(fits_create_img\(fptr,)c(SHORT_IMG,)j
-(naxis,)h(naxes,)g(&status\);)191 4924 y(/*)h(Write)f(a)i(keyword;)d
+4020 y(/*)h(Create)f(the)h(primary)f(array)g(image)h(\(16-bit)e(short)i
+(integer)f(pixels)g(*/)191 4133 y(fits_create_img\(fptr,)c(SHORT_IMG,)j
+(naxis,)h(naxes,)g(&status\);)191 4359 y(/*)h(Write)f(a)i(keyword;)d
 (must)i(pass)g(the)g(ADDRESS)e(of)j(the)f(value)f(*/)191
-5036 y(exposure)f(=)j(1500.;)191 5149 y(fits_update_key\(fptr,)42
-b(TLONG,)k("EXPOSURE",)f(&exposure,)430 5262 y("Total)h(Exposure)f
-(Time",)h(&status\);)191 5488 y(/*)h(Initialize)e(the)i(values)f(in)h
+4472 y(exposure)f(=)j(1500.;)191 4585 y(fits_update_key\(fptr,)42
+b(TLONG,)k("EXPOSURE",)f(&exposure,)430 4698 y("Total)h(Exposure)f
+(Time",)h(&status\);)191 4924 y(/*)h(Initialize)e(the)i(values)f(in)h
 (the)g(image)g(with)f(a)i(linear)e(ramp)g(function)g(*/)191
-5601 y(for)h(\(jj)g(=)g(0;)g(jj)h(<)f(naxes[1];)e(jj++\))382
-5714 y(for)i(\(ii)g(=)g(0;)g(ii)g(<)h(naxes[0];)d(ii++\))p
-eop
-%%Page: 9 15
-9 14 bop 0 299 a Fh(2.6.)72 b(LEGAL)30 b(STUFF)2995 b
-Fj(9)573 555 y Ff(array[jj][ii])44 b(=)j(ii)h(+)f(jj;)191
-781 y(nelements)e(=)j(naxes[0])d(*)j(naxes[1];)474 b(/*)48
-b(number)e(of)h(pixels)f(to)h(write)g(*/)191 1007 y(/*)g(Write)f(the)h
-(array)g(of)g(integers)e(to)j(the)f(image)f(*/)191 1120
-y(fits_write_img\(fptr,)c(TSHORT,)k(fpixel,)g(nelements,)f(array[0],)g
-(&status\);)191 1346 y(fits_close_file\(fptr,)d(&status\);)570
-b(/*)47 b(close)g(the)g(file)f(*/)191 1571 y(fits_report_error\(stderr)
-o(,)c(status\);)93 b(/*)47 b(print)g(out)g(any)f(error)h(messages)e(*/)
-191 1684 y(return\()h(status)g(\);)0 1797 y(})0 2587
-y Fe(2.6)135 b(Legal)46 b(Stu\013)0 2928 y Fj(Cop)m(yrigh)m(t)36
-b(\(Unpublished{all)d(righ)m(ts)j(reserv)m(ed)h(under)e(the)i(cop)m
-(yrigh)m(t)g(la)m(ws)f(of)h(the)g(United)f(States\),)k(U.S.)0
-3041 y(Go)m(v)m(ernmen)m(t)30 b(as)g(represen)m(ted)e(b)m(y)h(the)g
-(Administrator)e(of)i(the)g(National)f(Aeronautics)h(and)f(Space)h
-(Adminis-)0 3154 y(tration.)41 b(No)31 b(cop)m(yrigh)m(t)f(is)g
-(claimed)f(in)g(the)i(United)e(States)i(under)e(Title)h(17,)h(U.S.)f
-(Co)s(de.)0 3314 y(P)m(ermission)e(to)i(freely)e(use,)i(cop)m(y)-8
-b(,)31 b(mo)s(dify)-8 b(,)28 b(and)h(distribute)e(this)h(soft)m(w)m
-(are)j(and)e(its)g(do)s(cumen)m(tation)g(without)0 3427
-y(fee)g(is)e(hereb)m(y)h(gran)m(ted,)i(pro)m(vided)d(that)i(this)e(cop)
-m(yrigh)m(t)i(notice)f(and)g(disclaimer)e(of)i(w)m(arran)m(t)m(y)i(app)
-s(ears)d(in)g(all)0 3540 y(copies.)0 3700 y(DISCLAIMER:)0
-3860 y(THE)33 b(SOFTW)-10 b(ARE)32 b(IS)g(PR)m(O)m(VIDED)i('AS)f(IS')g
-(WITHOUT)f(ANY)i(W)-10 b(ARRANTY)33 b(OF)g(ANY)h(KIND,)f(EI-)0
-3973 y(THER)42 b(EXPRESSED,)f(IMPLIED,)i(OR)e(ST)-8 b(A)g(TUTOR)g(Y,)43
-b(INCLUDING,)f(BUT)h(NOT)e(LIMITED)h(TO,)0 4086 y(ANY)33
-b(W)-10 b(ARRANTY)33 b(THA)-8 b(T)32 b(THE)g(SOFTW)-10
-b(ARE)32 b(WILL)g(CONF)m(ORM)g(TO)g(SPECIFICA)-8 b(TIONS,)30
-b(ANY)0 4199 y(IMPLIED)38 b(W)-10 b(ARRANTIES)37 b(OF)h(MER)m(CHANT)-8
-b(ABILITY,)38 b(FITNESS)f(F)m(OR)h(A)g(P)-8 b(AR)g(TICULAR)38
-b(PUR-)0 4312 y(POSE,)24 b(AND)i(FREEDOM)f(FR)m(OM)h(INFRINGEMENT,)g
-(AND)f(ANY)h(W)-10 b(ARRANTY)25 b(THA)-8 b(T)25 b(THE)g(DOC-)0
-4425 y(UMENT)-8 b(A)g(TION)31 b(WILL)f(CONF)m(ORM)h(TO)e(THE)h(SOFTW)
--10 b(ARE,)30 b(OR)g(ANY)h(W)-10 b(ARRANTY)31 b(THA)-8
-b(T)30 b(THE)0 4538 y(SOFTW)-10 b(ARE)31 b(WILL)h(BE)g(ERR)m(OR)g
-(FREE.)g(IN)g(NO)f(EVENT)h(SHALL)f(NASA)h(BE)g(LIABLE)g(F)m(OR)g(ANY)0
-4650 y(D)m(AMA)m(GES,)26 b(INCLUDING,)e(BUT)f(NOT)g(LIMITED)h(TO,)f
-(DIRECT,)g(INDIRECT,)g(SPECIAL)f(OR)h(CON-)0 4763 y(SEQUENTIAL)28
-b(D)m(AMA)m(GES,)k(ARISING)d(OUT)g(OF,)h(RESUL)-8 b(TING)29
-b(FR)m(OM,)h(OR)f(IN)h(ANY)g(W)-10 b(A)i(Y)30 b(CON-)0
-4876 y(NECTED)25 b(WITH)g(THIS)f(SOFTW)-10 b(ARE,)25
-b(WHETHER)g(OR)g(NOT)g(BASED)g(UPON)g(W)-10 b(ARRANTY,)26
-b(CON-)0 4989 y(TRA)m(CT,)d(TOR)-8 b(T)23 b(,)g(OR)g(OTHER)-10
-b(WISE,)22 b(WHETHER)i(OR)f(NOT)f(INJUR)-8 b(Y)24 b(W)-10
-b(AS)23 b(SUST)-8 b(AINED)23 b(BY)h(PER-)0 5102 y(SONS)h(OR)i(PR)m
-(OPER)-8 b(TY)26 b(OR)g(OTHER)-10 b(WISE,)26 b(AND)h(WHETHER)g(OR)f
-(NOT)g(LOSS)f(W)-10 b(AS)26 b(SUST)-8 b(AINED)0 5215
-y(FR)m(OM,)37 b(OR)e(AR)m(OSE)h(OUT)f(OF)h(THE)g(RESUL)-8
-b(TS)35 b(OF,)h(OR)f(USE)h(OF,)g(THE)g(SOFTW)-10 b(ARE)35
-b(OR)g(SER-)0 5328 y(VICES)29 b(PR)m(O)m(VIDED)j(HEREUNDER.")0
-5488 y(The)37 b(\014le)f(compress.c)h(con)m(tains)h(\(sligh)m(tly)d(mo)
-s(di\014ed\))h(source)h(co)s(de)g(that)h(originally)d(came)j(from)e
-(gzip-1.2.4)0 5601 y(whic)m(h)31 b(is)h(freely)f(distributed)f(under)h
-(the)h(GNU)h(General)g(Public)d(Licence.)47 b(A)32 b(cop)m(y)i(of)e
-(the)h(GNU)g(licence)f(is)0 5714 y(included)c(at)j(the)f(b)s(eginning)e
-(of)j(that)f(\014le.)p eop
-%%Page: 10 16
-10 15 bop 0 299 a Fj(10)1535 b Fh(CHAPTER)30 b(2.)112
-b(CREA)-8 b(TING)30 b(THE)g(CFITSIO)f(LIBRAR)-8 b(Y)0
-555 y Fe(2.7)135 b(Ac)l(kno)l(wledgemen)l(ts)0 838 y
-Fj(The)29 b(dev)m(elopmen)m(t)g(of)h(man)m(y)f(of)h(the)f(p)s(o)m(w)m
-(erful)f(features)h(in)f(CFITSIO)g(w)m(as)i(made)f(p)s(ossible)e
-(through)h(collab-)0 951 y(orations)34 b(with)f(man)m(y)i(p)s(eople)e
-(or)i(organizations)f(from)g(around)f(the)i(w)m(orld.)51
-b(The)34 b(follo)m(wing,)g(in)f(particular,)0 1064 y(ha)m(v)m(e)f(made)
-e(esp)s(ecially)f(signi\014can)m(t)g(con)m(tributions:)0
-1224 y(Programmers)c(from)h(the)f(In)m(tegral)h(Science)g(Data)h(Cen)m
-(ter,)g(Switzerland)d(\(namely)-8 b(,)27 b(Jurek)d(Bork)m(o)m(wski,)k
-(Bruce)0 1337 y(O'Neel,)33 b(and)f(Don)h(Jennings\),)e(designed)g(the)i
-(concept)g(for)f(the)h(plug-in)d(I/O)i(driv)m(ers)f(that)i(w)m(as)g(in)
-m(tro)s(duced)0 1450 y(with)h(CFITSIO)f(2.0.)56 b(The)34
-b(use)h(of)g(`driv)m(ers')f(greatly)h(simpli\014ed)d(the)j(lo)m(w-lev)m
-(el)g(I/O,)g(whic)m(h)e(in)h(turn)g(made)0 1563 y(other)40
-b(new)f(features)i(in)d(CFITSIO)g(\(e.g.,)45 b(supp)s(ort)38
-b(for)h(compressed)h(FITS)f(\014les)g(and)g(supp)s(ort)f(for)i(IRAF)0
-1676 y(format)32 b(image)f(\014les\))g(m)m(uc)m(h)g(easier)h(to)g
-(implemen)m(t.)42 b(Jurek)31 b(Bork)m(o)m(wski)g(wrote)h(the)g(Shared)e
-(Memory)i(driv)m(er,)0 1788 y(and)23 b(Bruce)i(O'Neel)f(wrote)g(the)g
-(driv)m(ers)f(for)g(accessing)i(FITS)e(\014les)g(o)m(v)m(er)i(the)f
-(net)m(w)m(ork)h(using)d(the)j(FTP)-8 b(,)24 b(HTTP)-8
-b(,)0 1901 y(and)30 b(R)m(OOT)g(proto)s(cols.)0 2062
-y(The)45 b(ISDC)g(also)g(pro)m(vided)f(the)i(template)g(parsing)e
-(routines)g(\(written)h(b)m(y)g(Jurek)g(Bork)m(o)m(wski\))h(and)f(the)0
-2174 y(hierarc)m(hical)36 b(grouping)f(routines)h(\(written)h(b)m(y)g
-(Don)h(Jennings\).)59 b(The)37 b(ISDC)f(D)m(AL)i(\(Data)h(Access)f(La)m
-(y)m(er\))0 2287 y(routines)29 b(are)i(la)m(y)m(ered)g(on)f(top)h(of)f
-(CFITSIO)f(and)h(mak)m(e)h(extensiv)m(e)g(use)f(of)h(these)g(features.)
-0 2448 y(Uw)m(e)25 b(Lammers)e(\(XMM/ESA/ESTEC,)h(The)g(Netherlands\))f
-(designed)g(the)h(high-p)s(erformance)e(lexical)h(pars-)0
-2560 y(ing)41 b(algorithm)g(that)h(is)f(used)g(to)i(do)e(on-the-\015y)h
-(\014ltering)e(of)i(FITS)f(tables.)75 b(This)40 b(algorithm)h(essen)m
-(tially)0 2673 y(pre-compiles)34 b(the)i(user-supplied)c(selection)k
-(expression)e(in)m(to)i(a)g(form)g(that)g(can)g(b)s(e)f(rapidly)e(ev)-5
-b(aluated)36 b(for)0 2786 y(eac)m(h)31 b(ro)m(w.)40 b(P)m(eter)31
-b(Wilson)d(\(RSTX,)h(NASA/GSF)m(C\))i(then)e(wrote)h(the)g(parsing)e
-(routines)g(used)h(b)m(y)g(CFITSIO)0 2899 y(based)i(on)f(Lammers')h
-(design,)f(com)m(bined)g(with)g(other)h(tec)m(hniques)f(suc)m(h)h(as)g
-(the)g(CFITSIO)f(iterator)h(routine)0 3012 y(to)f(further)d(enhance)i
-(the)g(data)h(pro)s(cessing)d(throughput.)39 b(This)27
-b(e\013ort)j(also)e(b)s(ene\014tted)h(from)f(a)h(m)m(uc)m(h)g(earlier)0
-3125 y(lexical)g(parsing)g(routine)h(that)h(w)m(as)f(dev)m(elop)s(ed)g
-(b)m(y)g(Ken)m(t)h(Blac)m(kburn)e(\(NASA/GSF)m(C\).)0
-3285 y(The)40 b(CFITSIO)g(iterator)h(function)e(is)h(lo)s(osely)g
-(based)h(on)f(similar)f(ideas)h(dev)m(elop)s(ed)g(for)h(the)g(XMM)g
-(Data)0 3398 y(Access)31 b(La)m(y)m(er.)0 3558 y(P)m(eter)25
-b(Wilson)e(\(RSTX,)h(NASA/GSF)m(C\))h(wrote)g(the)f(complete)h(set)f
-(of)h(F)-8 b(ortran-callable)24 b(wrapp)s(ers)e(for)i(all)f(the)0
-3671 y(CFITSIO)29 b(routines,)g(whic)m(h)g(in)g(turn)h(rely)f(on)i(the)
-f(CF)m(OR)-8 b(TRAN)31 b(macro)g(dev)m(elop)s(ed)f(b)m(y)g(Burkhard)f
-(Buro)m(w.)0 3831 y(The)h(syn)m(tax)i(used)e(b)m(y)h(CFITSIO)f(for)g
-(\014ltering)g(or)h(binning)c(input)i(FITS)i(\014les)f(is)g(based)g(on)
-h(ideas)g(dev)m(elop)s(ed)0 3944 y(for)41 b(the)g(AXAF)h(Science)f(Cen)
-m(ter)h(Data)h(Mo)s(del)d(b)m(y)h(Jonathan)g(McDo)m(w)m(ell,)k(An)m
-(tonella)c(F)-8 b(ruscione,)44 b(Aneta)0 4057 y(Siemigino)m(wsk)-5
-b(a)24 b(and)h(Bill)f(Jo)m(y)m(e.)41 b(See)26 b(h)m
-(ttp://heasarc.gsfc.nasa.go)m(v/do)s(cs/journal/axaf7.h)m(t)q(ml)31
-b(for)25 b(further)0 4170 y(description)j(of)j(the)g(AXAF)g(Data)h(Mo)s
-(del.)0 4330 y(The)j(\014le)f(decompression)g(co)s(de)h(w)m(ere)h(tak)m
-(en)g(directly)e(from)g(the)i(gzip)e(\(GNU)i(zip\))f(program)g(dev)m
-(elop)s(ed)f(b)m(y)0 4443 y(Jean-loup)29 b(Gailly)g(and)h(others.)0
-4603 y(Doug)h(Mink,)f(SA)m(O,)g(pro)m(vided)f(the)i(routines)e(for)h
-(con)m(v)m(erting)h(IRAF)g(format)g(images)f(in)m(to)g(FITS)g(format.)0
-4763 y(In)d(addition,)g(man)m(y)h(other)g(p)s(eople)f(ha)m(v)m(e)i
-(made)f(v)-5 b(aluable)27 b(con)m(tributions)f(to)j(the)f(dev)m
-(elopmen)m(t)g(of)g(CFITSIO.)0 4876 y(These)i(include)e(\(with)i(ap)s
-(ologies)g(to)h(others)f(that)h(ma)m(y)g(ha)m(v)m(e)h(inadv)m(erten)m
-(tly)e(b)s(een)f(omitted\):)0 5036 y(Stev)m(e)g(Allen,)e(Carl)g(Ak)m
-(erlof,)h(Keith)f(Arnaud,)h(Morten)g(Krabb)s(e)e(Barfo)s(ed,)j(Ken)m(t)
-f(Blac)m(kburn,)g(G)g(Bo)s(dammer,)0 5149 y(Romk)m(e)h(Bon)m(tek)m(o)s
-(e,)i(Lucio)c(Chiapp)s(etti,)f(Keith)h(Costorf,)h(Robin)f(Corb)s(et,)h
-(John)e(Da)m(vis,)j(Ric)m(hard)e(Fink,)h(Ning)0 5262
-y(Gan,)j(Emily)d(Greene,)j(Gretc)m(hen)g(Green,)f(Jo)s(e)g(Harrington,)
-g(Cheng)g(Ho,)h(Phil)d(Ho)s(dge,)i(Jim)f(Ingham,)h(Y)-8
-b(oshi-)0 5375 y(tak)j(a)44 b(Ishisaki,)g(Diab)f(Jerius,)h(Mark)g
-(Levine,)h(T)-8 b(o)s(dd)42 b(Karak)-5 b(askian,)46 b(Edw)m(ard)c
-(King,)j(Scott)f(Ko)s(c)m(h,)i(Claire)0 5488 y(Larkin,)26
-b(Rob)f(Managan,)k(Eric)c(Mandel,)h(John)f(Matto)m(x,)30
-b(Carsten)c(Mey)m(er,)i(Emi)d(Miy)m(ata,)j(Stefan)e(Mo)s(c)m(hnac)m
-(ki,)0 5601 y(Mik)m(e)48 b(Noble,)j(Oliv)m(er)46 b(Ob)s(erdorf,)j(Cliv)
-m(e)e(P)m(age,)53 b(Arvind)45 b(P)m(armar,)52 b(Je\013)47
-b(P)m(edelt)m(y)-8 b(,)53 b(Tim)45 b(P)m(earson,)53 b(Maren)0
-5714 y(Purv)m(es,)43 b(Scott)f(Randall,)h(Chris)38 b(Rogers,)45
-b(Arnold)39 b(Rots,)45 b(Barry)c(Sc)m(hlesinger,)h(Robin)d(Stebbins,)j
-(Andrew)p eop
-%%Page: 11 17
-11 16 bop 0 299 a Fh(2.7.)72 b(A)m(CKNO)m(WLEDGEMENTS)2515
-b Fj(11)0 555 y(Szymk)m(o)m(wiak,)40 b(Allyn)c(T)-8 b(ennan)m(t,)41
-b(P)m(eter)e(T)-8 b(eub)s(en,)39 b(James)f(Theiler,)g(Doug)g(T)-8
-b(o)s(dy)g(,)40 b(Shiro)d(Ueno,)j(Stev)m(e)f(W)-8 b(al-)0
-668 y(ton,)31 b(Arc)m(hie)f(W)-8 b(arno)s(c)m(k,)31 b(Alan)f(W)-8
-b(atson,)32 b(Dan)e(Whipple,)e(Wim)i(Wimmers,)f(P)m(eter)j(Y)-8
-b(oung,)31 b(Jianjun)c(Xu,)k(and)0 781 y(Nelson)f(Zarate.)p
-eop
-%%Page: 12 18
-12 17 bop 0 299 a Fj(12)1535 b Fh(CHAPTER)30 b(2.)112
+5036 y(for)h(\(jj)g(=)g(0;)g(jj)h(<)f(naxes[1];)e(jj++\))382
+5149 y(for)i(\(ii)g(=)g(0;)g(ii)g(<)h(naxes[0];)d(ii++\))573
+5262 y(array[jj][ii])f(=)j(ii)h(+)f(jj;)191 5488 y(nelements)e(=)j
+(naxes[0])d(*)j(naxes[1];)474 b(/*)48 b(number)e(of)h(pixels)f(to)h
+(write)g(*/)191 5714 y(/*)g(Write)f(the)h(array)g(of)g(integers)e(to)j
+(the)f(image)f(*/)p eop
+%%Page: 11 19
+11 18 bop 0 299 a Fh(2.5.)72 b(EXAMPLE)31 b(PR)m(OGRAM)2618
+b Fj(11)191 555 y Fe(fits_write_img\(fptr,)42 b(TSHORT,)k(fpixel,)g
+(nelements,)f(array[0],)g(&status\);)191 781 y(fits_close_file\(fptr,)d
+(&status\);)570 b(/*)47 b(close)g(the)g(file)f(*/)191
+1007 y(fits_report_error\(stderr)o(,)c(status\);)93 b(/*)47
+b(print)g(out)g(any)f(error)h(messages)e(*/)191 1120
+y(return\()h(status)g(\);)0 1233 y(})p eop
+%%Page: 12 20
+12 19 bop 0 299 a Fj(12)1535 b Fh(CHAPTER)30 b(2.)112
 b(CREA)-8 b(TING)30 b(THE)g(CFITSIO)f(LIBRAR)-8 b(Y)p
 eop
-%%Page: 13 19
-13 18 bop 0 1225 a Fg(Chapter)65 b(3)0 1687 y Fm(A)78
+%%Page: 13 21
+13 20 bop 0 1225 a Fg(Chapter)65 b(3)0 1687 y Fm(A)78
 b(FITS)f(Primer)0 2180 y Fj(This)22 b(section)j(giv)m(es)f(a)h(brief)d
 (o)m(v)m(erview)j(of)f(the)h(structure)e(of)i(FITS)e(\014les.)37
 b(Users)24 b(should)f(refer)g(to)i(the)g(do)s(cumen-)0
@@ -2912,10 +3058,10 @@ b(ages.)0 2952 y(A)34 b(FITS)f(\014le)f(consists)h(of)h(one)g(or)g
 (more)g(Header)g(+)f(Data)i(Units)e(\(HDUs\),)j(where)d(the)h(\014rst)f
 (HDU)h(is)f(called)0 3065 y(the)k(`Primary)e(HDU',)j(or)f(`Primary)e
 (Arra)m(y'.)60 b(The)36 b(primary)f(arra)m(y)i(con)m(tains)g(an)f
-(N-dimensional)f(arra)m(y)i(of)0 3177 y(pixels,)28 b(suc)m(h)g(as)h(a)h
-(1-D)g(sp)s(ectrum,)e(a)h(2-D)h(image,)g(or)f(a)g(3-D)h(data)g(cub)s
-(e.)39 b(Fiv)m(e)30 b(di\013eren)m(t)e(primary)f(datat)m(yp)s(es)0
-3290 y(are)f(supp)s(orted:)37 b(Unsigned)24 b(8-bit)i(b)m(ytes,)h(16)g
+(N-dimensional)f(arra)m(y)i(of)0 3177 y(pixels,)26 b(suc)m(h)h(as)h(a)f
+(1-D)h(sp)s(ectrum,)f(a)h(2-D)g(image,)h(or)e(a)g(3-D)i(data)f(cub)s
+(e.)39 b(Fiv)m(e)27 b(di\013eren)m(t)g(primary)e(data)j(t)m(yp)s(es)0
+3290 y(are)e(supp)s(orted:)37 b(Unsigned)24 b(8-bit)i(b)m(ytes,)h(16)g
 (and)e(32-bit)h(signed)e(in)m(tegers,)j(and)f(32)g(and)f(64-bit)h
 (\015oating)g(p)s(oin)m(t)0 3403 y(reals.)40 b(FITS)29
 b(also)h(has)g(a)g(con)m(v)m(en)m(tion)i(for)d(storing)h(16)h(and)e
@@ -2944,11 +3090,11 @@ h(long.)0 5059 y(An)m(y)30 b(un)m(used)g(space)g(is)g(padded)f(with)g
 5219 y(Eac)m(h)i(Header)f(Unit)g(consists)g(of)g(an)m(y)g(n)m(um)m(b)s
 (er)f(of)i(80-c)m(haracter)i(k)m(eyw)m(ord)d(records)g(or)g(`card)h
 (images')f(whic)m(h)0 5332 y(ha)m(v)m(e)g(the)e(general)h(form:)95
-5601 y Ff(KEYNAME)46 b(=)i(value)e(/)i(comment)d(string)95
+5601 y Fe(KEYNAME)46 b(=)i(value)e(/)i(comment)d(string)95
 5714 y(NULLKEY)h(=)334 b(/)48 b(comment:)d(This)i(keyword)f(has)g(no)i
 (value)1905 5942 y Fj(13)p eop
-%%Page: 14 20
-14 19 bop 0 299 a Fj(14)2398 b Fh(CHAPTER)30 b(3.)112
+%%Page: 14 22
+14 21 bop 0 299 a Fj(14)2398 b Fh(CHAPTER)30 b(3.)112
 b(A)30 b(FITS)g(PRIMER)0 555 y Fj(The)35 b(k)m(eyw)m(ord)i(names)f(ma)m
 (y)g(b)s(e)g(up)f(to)h(8)h(c)m(haracters)g(long)f(and)f(can)h(only)g
 (con)m(tain)g(upp)s(ercase)f(letters,)j(the)0 668 y(digits)23
@@ -2995,6152 +3141,4365 @@ y(If)24 b(there)i(is)e(more)h(than)f(one)h(HDU)h(in)e(the)h(FITS)f
 m(k)d(of)h(the)f(previous)f(Data)k(Unit)c(\(or)i(Header)g(Unit)f(if)f
 (there)i(is)f(no)g(Data)i(Unit\).)0 2937 y(The)k(main)f(required)g(k)m
 (eyw)m(ords)h(in)f(FITS)h(primary)f(arra)m(ys)h(or)h(image)f
-(extensions)g(are:)136 3172 y Fc(\017)46 b Fj(BITPIX)25
-b({)h(de\014nes)f(the)g(datat)m(yp)s(e)i(of)e(the)h(arra)m(y:)39
-b(8,)27 b(16,)g(32,)h(-32,)g(-64)e(for)f(unsigned)f(8{bit)h(b)m(yte,)j
-(16{bit)227 3284 y(in)m(teger,)g(32{bit)e(in)m(teger,)i(32{bit)f(IEEE)e
-(\015oating)h(p)s(oin)m(t,)g(and)g(64{bit)h(IEEE)e(double)g(precision)f
-(\015oating)227 3397 y(p)s(oin)m(t,)30 b(resp)s(ectiv)m(ely)-8
-b(.)136 3585 y Fc(\017)46 b Fj(NAXIS)30 b({)h(the)g(n)m(um)m(b)s(er)e
-(of)h(dimensions)e(in)h(the)i(arra)m(y)-8 b(,)31 b(usually)d(0,)j(1,)g
-(2,)g(3,)g(or)g(4.)136 3773 y Fc(\017)46 b Fj(NAXISn)30
-b({)h(\(n)f(ranges)g(from)g(1)h(to)g(NAXIS\))g(de\014nes)e(the)i(size)f
-(of)h(eac)m(h)g(dimension.)0 4008 y(FITS)e(tables)h(start)h(with)e(the)
-h(k)m(eyw)m(ord)g(XTENSION)g(=)f(`T)-8 b(ABLE')31 b(\(for)f(ASCI)s(I)f
-(tables\))h(or)g(XTENSION)f(=)0 4120 y(`BINT)-8 b(ABLE')32
-b(\(for)e(binary)f(tables\))h(and)g(ha)m(v)m(e)i(the)e(follo)m(wing)f
-(main)g(k)m(eyw)m(ords:)136 4355 y Fc(\017)46 b Fj(TFIELDS)30
-b({)h(n)m(um)m(b)s(er)e(of)h(\014elds)f(or)i(columns)e(in)g(the)h
-(table)136 4543 y Fc(\017)46 b Fj(NAXIS2)31 b({)g(n)m(um)m(b)s(er)e(of)
-h(ro)m(ws)h(in)e(the)h(table)136 4731 y Fc(\017)46 b
-Fj(TTYPEn)29 b({)i(for)f(eac)m(h)i(column)d(\(n)h(ranges)h(from)f(1)g
-(to)h(TFIELDS\))g(giv)m(es)f(the)h(name)f(of)h(the)f(column)136
-4918 y Fc(\017)46 b Fj(TF)m(ORMn)31 b({)f(the)h(datat)m(yp)s(e)g(of)g
-(the)f(column)136 5106 y Fc(\017)46 b Fj(TUNITn)30 b({)g(the)h(ph)m
-(ysical)e(units)g(of)h(the)h(column)e(\(optional\))0
-5341 y(Users)i(should)e(refer)i(to)h(the)g(NOST)e(do)s(cumen)m(tation)h
-(for)g(more)g(details)f(ab)s(out)h(the)h(required)d(k)m(eyw)m(ords)j
-(and)0 5454 y(their)d(allo)m(w)m(ed)i(v)-5 b(alues.)p
+(extensions)g(are:)136 3172 y Fc(\017)46 b Fj(BITPIX)39
+b({)h(de\014nes)f(the)g(data)h(t)m(yp)s(e)g(of)f(the)h(arra)m(y:)59
+b(8,)42 b(16,)h(32,)g(-32,)g(-64)d(for)f(unsigned)f(8{bit)h(b)m(yte,)
+227 3284 y(16{bit)h(signed)f(in)m(teger,)j(32{bit)f(signed)d(in)m
+(teger,)43 b(32{bit)d(IEEE)f(\015oating)g(p)s(oin)m(t,)i(and)f(64{bit)g
+(IEEE)227 3397 y(double)29 b(precision)g(\015oating)h(p)s(oin)m(t,)g
+(resp)s(ectiv)m(ely)-8 b(.)136 3585 y Fc(\017)46 b Fj(NAXIS)30
+b({)h(the)g(n)m(um)m(b)s(er)e(of)h(dimensions)e(in)h(the)i(arra)m(y)-8
+b(,)31 b(usually)d(0,)j(1,)g(2,)g(3,)g(or)g(4.)136 3773
+y Fc(\017)46 b Fj(NAXISn)30 b({)h(\(n)f(ranges)g(from)g(1)h(to)g
+(NAXIS\))g(de\014nes)e(the)i(size)f(of)h(eac)m(h)g(dimension.)0
+4008 y(FITS)e(tables)h(start)h(with)e(the)h(k)m(eyw)m(ord)g(XTENSION)g
+(=)f(`T)-8 b(ABLE')31 b(\(for)f(ASCI)s(I)f(tables\))h(or)g(XTENSION)f
+(=)0 4120 y(`BINT)-8 b(ABLE')32 b(\(for)e(binary)f(tables\))h(and)g(ha)
+m(v)m(e)i(the)e(follo)m(wing)f(main)g(k)m(eyw)m(ords:)136
+4355 y Fc(\017)46 b Fj(TFIELDS)30 b({)h(n)m(um)m(b)s(er)e(of)h
+(\014elds)f(or)i(columns)e(in)g(the)h(table)136 4543
+y Fc(\017)46 b Fj(NAXIS2)31 b({)g(n)m(um)m(b)s(er)e(of)h(ro)m(ws)h(in)e
+(the)h(table)136 4731 y Fc(\017)46 b Fj(TTYPEn)29 b({)i(for)f(eac)m(h)i
+(column)d(\(n)h(ranges)h(from)f(1)g(to)h(TFIELDS\))g(giv)m(es)f(the)h
+(name)f(of)h(the)f(column)136 4918 y Fc(\017)46 b Fj(TF)m(ORMn)31
+b({)f(the)h(data)g(t)m(yp)s(e)f(of)h(the)g(column)136
+5106 y Fc(\017)46 b Fj(TUNITn)30 b({)g(the)h(ph)m(ysical)e(units)g(of)h
+(the)h(column)e(\(optional\))0 5341 y(Users)e(should)e(refer)i(to)g
+(the)h(FITS)e(Supp)s(ort)f(O\016ce)i(at)h Fe(http://fits.gsfc.nasa.go)o
+(v)21 b Fj(for)27 b(futher)f(informa-)0 5454 y(tion)k(ab)s(out)g(the)h
+(FITS)e(format)i(and)f(related)g(soft)m(w)m(are)i(pac)m(k)-5
+b(ages.)p eop
+%%Page: 15 23
+15 22 bop 0 1225 a Fg(Chapter)65 b(4)0 1687 y Fm(Programming)77
+b(Guidelines)0 2216 y Ff(4.1)135 b(CFITSIO)44 b(De\014nitions)0
+2466 y Fj(An)m(y)30 b(program)g(that)h(uses)f(the)h(CFITSIO)d(in)m
+(terface)j(m)m(ust)f(include)e(the)j(\014tsio.h)e(header)h(\014le)g
+(with)f(the)h(state-)0 2579 y(men)m(t)95 2818 y Fe(#include)46
+b("fitsio.h")0 3057 y Fj(This)29 b(header)i(\014le)g(con)m(tains)g(the)
+g(protot)m(yp)s(es)h(for)f(all)f(the)h(CFITSIO)f(user)g(in)m(terface)i
+(routines)e(as)h(w)m(ell)f(as)i(the)0 3170 y(de\014nitions)e(of)i(v)-5
+b(arious)31 b(constan)m(ts)i(used)e(in)g(the)i(in)m(terface.)46
+b(It)32 b(also)g(de\014nes)f(a)i(C)f(structure)f(of)h(t)m(yp)s(e)h
+(`\014ts\014le')0 3283 y(that)j(is)f(used)g(b)m(y)g(CFITSIO)f(to)j
+(store)f(the)g(relev)-5 b(an)m(t)36 b(parameters)g(that)g(de\014ne)f
+(the)h(format)g(of)g(a)g(particular)0 3396 y(FITS)c(\014le.)47
+b(Application)31 b(programs)i(m)m(ust)g(de\014ne)f(a)h(p)s(oin)m(ter)f
+(to)h(this)f(structure)h(for)f(eac)m(h)i(FITS)e(\014le)g(that)i(is)0
+3508 y(to)i(b)s(e)f(op)s(ened.)56 b(This)34 b(structure)h(is)g
+(initialized)d(\(i.e.,)38 b(memory)d(is)g(allo)s(cated)g(for)h(the)g
+(structure\))f(when)g(the)0 3621 y(FITS)h(\014le)f(is)h(\014rst)f(op)s
+(ened)h(or)g(created)i(with)d(the)h(\014ts)p 1949 3621
+28 4 v 33 w(op)s(en)p 2172 3621 V 32 w(\014le)f(or)i(\014ts)p
+2596 3621 V 32 w(create)p 2864 3621 V 34 w(\014le)f(routines.)58
+b(This)34 b(\014ts\014le)0 3734 y(p)s(oin)m(ter)c(is)h(then)g(passed)g
+(as)g(the)h(\014rst)e(argumen)m(t)i(to)g(ev)m(ery)g(other)g(CFITSIO)d
+(routine)i(that)h(op)s(erates)g(on)f(the)0 3847 y(FITS)h(\014le.)47
+b(Application)31 b(programs)i(m)m(ust)g(not)g(directly)e(read)i(or)g
+(write)f(elemen)m(ts)h(in)f(this)g(\014ts\014le)f(structure)0
+3960 y(b)s(ecause)f(the)h(de\014nition)d(of)j(the)f(structure)g(ma)m(y)
+h(c)m(hange)g(in)f(future)f(v)m(ersions)h(of)g(CFITSIO.)0
+4120 y(A)45 b(n)m(um)m(b)s(er)e(of)i(sym)m(b)s(olic)e(constan)m(ts)j
+(are)f(also)f(de\014ned)g(in)f(\014tsio.h)h(for)g(the)h(con)m(v)m
+(enience)h(of)f(application)0 4233 y(programmers.)55
+b(Use)35 b(of)h(these)f(sym)m(b)s(olic)f(constan)m(ts)i(rather)f(than)g
+(the)h(actual)f(n)m(umeric)f(v)-5 b(alue)35 b(will)d(help)i(to)0
+4346 y(mak)m(e)d(the)g(source)f(co)s(de)h(more)g(readable)e(and)h
+(easier)h(for)f(others)g(to)h(understand.)0 4585 y Fe(String)46
+b(Lengths,)g(for)h(use)f(when)h(allocating)e(character)g(arrays:)95
+4811 y(#define)h(FLEN_FILENAME)e(1025)j(/*)g(max)g(length)f(of)h(a)h
+(filename)857 b(*/)95 4924 y(#define)46 b(FLEN_KEYWORD)140
+b(72)95 b(/*)47 b(max)g(length)f(of)h(a)h(keyword)905
+b(*/)95 5036 y(#define)46 b(FLEN_CARD)284 b(81)95 b(/*)47
+b(max)g(length)f(of)h(a)h(FITS)f(header)f(card)476 b(*/)95
+5149 y(#define)46 b(FLEN_VALUE)236 b(71)95 b(/*)47 b(max)g(length)f(of)
+h(a)h(keyword)e(value)g(string)285 b(*/)95 5262 y(#define)46
+b(FLEN_COMMENT)140 b(73)95 b(/*)47 b(max)g(length)f(of)h(a)h(keyword)e
+(comment)g(string)189 b(*/)95 5375 y(#define)46 b(FLEN_ERRMSG)188
+b(81)95 b(/*)47 b(max)g(length)f(of)h(a)h(CFITSIO)e(error)g(message)237
+b(*/)95 5488 y(#define)46 b(FLEN_STATUS)188 b(31)95 b(/*)47
+b(max)g(length)f(of)h(a)h(CFITSIO)e(status)g(text)g(string)h(*/)95
+5714 y(Note)g(that)g(FLEN_KEYWORD)d(is)j(longer)f(than)h(the)g(nominal)
+f(8-character)f(keyword)1905 5942 y Fj(15)p eop
+%%Page: 16 24
+16 23 bop 0 299 a Fj(16)1763 b Fh(CHAPTER)29 b(4.)112
+b(PR)m(OGRAMMING)32 b(GUIDELINES)95 555 y Fe(name)47
+b(length)f(because)g(the)h(HIERARCH)e(convention)g(supports)h(longer)g
+(keyword)g(names.)0 781 y(Access)g(modes)g(when)h(opening)f(a)h(FITS)g
+(file:)95 1007 y(#define)f(READONLY)94 b(0)95 1120 y(#define)46
+b(READWRITE)g(1)0 1346 y(BITPIX)g(data)h(type)f(code)h(values)f(for)h
+(FITS)g(images:)95 1571 y(#define)f(BYTE_IMG)284 b(8)96
+b(/*)f(8-bit)46 b(unsigned)f(integers)h(*/)95 1684 y(#define)g
+(SHORT_IMG)189 b(16)95 b(/*)47 b(16-bit)141 b(signed)46
+b(integers)g(*/)95 1797 y(#define)g(LONG_IMG)237 b(32)95
+b(/*)47 b(32-bit)141 b(signed)46 b(integers)g(*/)95 1910
+y(#define)g(FLOAT_IMG)141 b(-32)95 b(/*)47 b(32-bit)f(single)g
+(precision)f(floating)h(point)g(*/)95 2023 y(#define)g(DOUBLE_IMG)93
+b(-64)i(/*)47 b(64-bit)f(double)g(precision)f(floating)h(point)g(*/)95
+2249 y(The)h(following)f(4)h(data)g(type)f(codes)h(are)g(also)f
+(supported)g(by)h(CFITSIO:)95 2362 y(#define)f(LONGLONG_IMG)f(64)i(/*)g
+(64-bit)f(long)h(signed)f(integers)f(*/)95 2475 y(#define)h(SBYTE_IMG)
+93 b(10)143 b(/*)95 b(8-bit)46 b(signed)g(integers,)g(equivalent)f(to)i
+(*/)1241 2588 y(/*)95 b(BITPIX)46 b(=)h(8,)h(BSCALE)e(=)h(1,)g(BZERO)g
+(=)g(-128)g(*/)95 2700 y(#define)f(USHORT_IMG)93 b(20)i(/*)47
+b(16-bit)f(unsigned)g(integers,)f(equivalent)g(to)i(*/)1241
+2813 y(/*)95 b(BITPIX)46 b(=)h(16,)g(BSCALE)f(=)i(1,)f(BZERO)f(=)i
+(32768)e(*/)95 2926 y(#define)g(ULONG_IMG)141 b(40)95
+b(/*)47 b(32-bit)f(unsigned)g(integers,)f(equivalent)g(to)i(*/)1241
+3039 y(/*)95 b(BITPIX)46 b(=)h(32,)g(BSCALE)f(=)i(1,)f(BZERO)f(=)i
+(2147483648)d(*/)0 3265 y(Codes)h(for)h(the)g(data)g(type)f(of)i
+(binary)e(table)g(columns)g(and/or)g(for)h(the)0 3378
+y(data)g(type)f(of)h(variables)f(when)g(reading)g(or)h(writing)f
+(keywords)g(or)h(data:)1432 3604 y(DATATYPE)714 b(TFORM)46
+b(CODE)95 3717 y(#define)g(TBIT)476 b(1)96 b(/*)1335
+b('X')47 b(*/)95 3830 y(#define)f(TBYTE)381 b(11)95 b(/*)47
+b(8-bit)f(unsigned)g(byte,)332 b('B')47 b(*/)95 3942
+y(#define)f(TLOGICAL)237 b(14)95 b(/*)47 b(logicals)e(\(int)i(for)g
+(keywords)236 b(*/)1289 4055 y(/*)95 b(and)46 b(char)h(for)g(table)f
+(cols)142 b('L')47 b(*/)95 4168 y(#define)f(TSTRING)285
+b(16)95 b(/*)47 b(ASCII)f(string,)666 b('A')47 b(*/)95
+4281 y(#define)f(TSHORT)333 b(21)95 b(/*)47 b(signed)f(short,)666
+b('I')47 b(*/)95 4394 y(#define)f(TINT32BIT)189 b(41)95
+b(/*)47 b(signed)f(32-bit)g(int,)428 b('J')47 b(*/)95
+4507 y(#define)f(TLONG)381 b(41)95 b(/*)47 b(signed)f(long,)905
+b(*/)95 4620 y(#define)46 b(TFLOAT)333 b(42)95 b(/*)47
+b(single)f(precision)f(float,)189 b('E')47 b(*/)95 4733
+y(#define)f(TDOUBLE)285 b(82)95 b(/*)47 b(double)f(precision)f(float,)
+189 b('D')47 b(*/)95 4846 y(#define)f(TCOMPLEX)237 b(83)95
+b(/*)47 b(complex)f(\(pair)g(of)h(floats\))141 b('C')47
+b(*/)95 4959 y(#define)f(TDBLCOMPLEX)f(163)95 b(/*)47
+b(double)f(complex)g(\(2)h(doubles\))e('M')i(*/)95 5185
+y(The)g(following)f(data)g(type)h(codes)f(are)h(also)g(supported)e(by)i
+(CFITSIO:)95 5297 y(#define)f(TINT)429 b(31)95 b(/*)47
+b(int)1335 b(*/)95 5410 y(#define)46 b(TSBYTE)333 b(12)95
+b(/*)47 b(8-bit)f(signed)g(byte,)428 b('S')47 b(*/)95
+5523 y(#define)f(TUINT)381 b(30)95 b(/*)47 b(unsigned)e(int)715
+b('V')47 b(*/)95 5636 y(#define)f(TUSHORT)285 b(20)95
+b(/*)47 b(unsigned)e(short)619 b('U')95 b(*/)p eop
+%%Page: 17 25
+17 24 bop 0 299 a Fh(4.2.)72 b(CURRENT)30 b(HEADER)h(D)m(A)-8
+b(T)g(A)32 b(UNIT)e(\(CHDU\))1786 b Fj(17)95 555 y Fe(#define)46
+b(TULONG)333 b(40)95 b(/*)47 b(unsigned)e(long)858 b(*/)95
+668 y(#define)46 b(TLONGLONG)189 b(81)95 b(/*)47 b(64-bit)f(long)h
+(signed)f(integer)f('K')i(*/)0 894 y(HDU)g(type)g(code)f(values)g
+(\(value)g(returned)g(when)h(moving)f(to)h(new)g(HDU\):)95
+1120 y(#define)f(IMAGE_HDU)93 b(0)i(/*)48 b(Primary)d(Array)i(or)g
+(IMAGE)f(HDU)h(*/)95 1233 y(#define)f(ASCII_TBL)93 b(1)i(/*)48
+b(ASCII)94 b(table)46 b(HDU)h(*/)95 1346 y(#define)f(BINARY_TBL)f(2)95
+b(/*)48 b(Binary)e(table)g(HDU)h(*/)95 1458 y(#define)f(ANY_HDU)142
+b(-1)94 b(/*)48 b(matches)d(any)i(type)g(of)g(HDU)g(*/)0
+1684 y(Column)f(name)h(and)g(string)f(matching)f(case-sensitivity:)95
+1910 y(#define)h(CASESEN)142 b(1)g(/*)48 b(do)f(case-sensitive)d
+(string)i(match)g(*/)95 2023 y(#define)g(CASEINSEN)g(0)142
+b(/*)48 b(do)f(case-insensitive)c(string)j(match)h(*/)0
+2249 y(Logical)f(states)g(\(if)h(TRUE)f(and)h(FALSE)g(are)g(not)g
+(already)e(defined\):)95 2475 y(#define)h(TRUE)h(1)95
+2588 y(#define)f(FALSE)h(0)0 2813 y(Values)f(to)h(represent)f
+(undefined)f(floating)g(point)i(numbers:)95 3039 y(#define)f
+(FLOATNULLVALUE)e(-9.11912E-36F)95 3152 y(#define)i(DOUBLENULLVALUE)e
+(-9.1191291391491E-36)0 3378 y(Image)i(compression)f(algorithm)g
+(definitions)95 3604 y(#define)h(RICE_1)285 b(11)95 3717
+y(#define)46 b(GZIP_1)285 b(21)95 3830 y(#define)46 b(PLIO_1)285
+b(31)0 4306 y Ff(4.2)135 b(Curren)l(t)46 b(Header)f(Data)h(Unit)g
+(\(CHDU\))0 4585 y Fj(The)37 b(concept)h(of)g(the)f(Curren)m(t)g
+(Header)g(and)g(Data)i(Unit,)g(or)e(CHDU,)h(is)e(fundamen)m(tal)h(to)h
+(the)f(use)g(of)h(the)0 4698 y(CFITSIO)31 b(library)-8
+b(.)44 b(A)32 b(simple)f(FITS)g(image)i(ma)m(y)g(only)e(con)m(tain)i(a)
+f(single)f(Header)i(and)f(Data)h(unit)e(\(HDU\),)0 4811
+y(but)39 b(in)f(general)i(FITS)f(\014les)g(can)h(con)m(tain)g(m)m
+(ultiple)e(Header)i(Data)h(Units)e(\(also)h(kno)m(wn)f(as)h
+(`extensions'\),)0 4924 y(concatenated)c(one)f(after)f(the)h(other)f
+(in)f(the)h(\014le.)52 b(The)33 b(user)h(can)g(sp)s(ecify)f(whic)m(h)g
+(HDU)i(should)d(b)s(e)h(initially)0 5036 y(op)s(ened)j(at)i(run)d(time)
+i(b)m(y)g(giving)f(the)h(HDU)h(name)f(or)g(n)m(um)m(b)s(er)f(after)h
+(the)g(ro)s(ot)h(\014le)e(name.)60 b(F)-8 b(or)38 b(example,)0
+5149 y('m)m(y\014le.\014ts[4]')h(op)s(ens)e(the)h(5th)h(HDU)g(in)e(the)
+h(\014le)f(\(note)i(that)g(the)f(n)m(um)m(b)s(ering)e(starts)j(with)e
+(0\),)k(and)c('m)m(y-)0 5262 y(\014le.\014ts[EVENTS])j(op)s(ens)g(the)h
+(HDU)h(with)d(the)i(name)g('EVENTS')g(\(as)g(de\014ned)f(b)m(y)h(the)g
+(EXTNAME)g(or)0 5375 y(HDUNAME)35 b(k)m(eyw)m(ords\).)50
+b(If)33 b(no)g(HDU)h(is)e(sp)s(eci\014ed)g(then)h(CFITSIO)e(op)s(ens)i
+(the)g(\014rst)g(HDU)h(\(the)g(primary)0 5488 y(arra)m(y\))24
+b(b)m(y)e(default.)38 b(The)22 b(CFITSIO)f(routines)h(whic)m(h)g(read)g
+(and)g(write)h(data)g(only)f(op)s(erate)h(within)e(the)i(op)s(ened)0
+5601 y(HDU,)32 b(Other)e(CFITSIO)f(routines)h(are)h(pro)m(vided)e(to)j
+(mo)m(v)m(e)g(to)f(and)f(op)s(en)g(an)m(y)h(other)g(existing)f(HDU)h
+(within)0 5714 y(the)g(FITS)e(\014le)h(or)g(to)h(app)s(end)e(or)h
+(insert)f(new)h(HDUs)h(in)e(the)i(FITS)f(\014le.)p eop
+%%Page: 18 26
+18 25 bop 0 299 a Fj(18)1763 b Fh(CHAPTER)29 b(4.)112
+b(PR)m(OGRAMMING)32 b(GUIDELINES)0 555 y Ff(4.3)135 b(F)-11
+b(unction)44 b(Names)i(and)f(V)-11 b(ariable)46 b(Datat)l(yp)t(es)0
+806 y Fj(Most)33 b(of)f(the)g(CFITSIO)f(routines)g(ha)m(v)m(e)i(b)s
+(oth)e(a)i(short)e(name)h(as)h(w)m(ell)e(as)h(a)g(longer)g(descriptiv)m
+(e)f(name.)45 b(The)0 919 y(short)32 b(name)g(is)f(only)g(5)i(or)f(6)g
+(c)m(haracters)h(long)f(and)g(is)f(similar)e(to)k(the)f(subroutine)e
+(name)i(in)f(the)h(F)-8 b(ortran-77)0 1032 y(v)m(ersion)37
+b(of)h(FITSIO.)f(The)h(longer)f(name)h(is)f(more)h(descriptiv)m(e)f
+(and)g(it)g(is)g(recommended)h(that)g(it)g(b)s(e)f(used)0
+1145 y(instead)30 b(of)g(the)h(short)f(name)g(to)h(more)g(clearly)f(do)
+s(cumen)m(t)g(the)g(source)h(co)s(de.)0 1305 y(Man)m(y)c(of)f(the)g
+(CFITSIO)f(routines)g(come)i(in)d(families)g(whic)m(h)h(di\013er)g
+(only)g(in)g(the)h(data)h(t)m(yp)s(e)f(of)g(the)g(asso)s(ciated)0
+1418 y(parameter\(s\).)45 b(The)31 b(data)h(t)m(yp)s(e)g(of)g(these)g
+(routines)e(is)h(indicated)f(b)m(y)h(the)h(su\016x)e(of)i(the)g
+(routine)e(name.)44 b(The)0 1530 y(short)27 b(routine)g(names)h(ha)m(v)
+m(e)h(a)f(1)g(or)f(2)h(c)m(haracter)i(su\016x)c(\(e.g.,)31
+b('j')c(in)g('\013pkyj'\))h(while)d(the)j(long)f(routine)g(names)0
+1643 y(ha)m(v)m(e)32 b(a)e(4)h(c)m(haracter)h(or)e(longer)g(su\016x)g
+(as)g(sho)m(wn)g(in)f(the)i(follo)m(wing)e(table:)191
+1905 y Fe(Long)285 b(Short)94 b(Data)191 2018 y(Names)237
+b(Names)94 b(Type)191 2131 y(-----)237 b(-----)94 b(----)191
+2244 y(_bit)381 b(x)190 b(bit)191 2357 y(_byt)381 b(b)190
+b(unsigned)46 b(byte)191 2469 y(_sbyt)333 b(sb)142 b(signed)46
+b(byte)191 2582 y(_sht)381 b(i)190 b(short)47 b(integer)191
+2695 y(_lng)381 b(j)190 b(long)47 b(integer)191 2808
+y(_lnglng)237 b(jj)142 b(8-byte)46 b(LONGLONG)g(integer)g(\(see)g(note)
+h(below\))191 2921 y(_usht)333 b(ui)142 b(unsigned)46
+b(short)g(integer)191 3034 y(_ulng)333 b(uj)142 b(unsigned)46
+b(long)g(integer)191 3147 y(_uint)333 b(uk)142 b(unsigned)46
+b(int)h(integer)191 3260 y(_int)381 b(k)190 b(int)47
+b(integer)191 3373 y(_flt)381 b(e)190 b(real)47 b(exponential)e
+(floating)g(point)i(\(float\))191 3486 y(_fixflt)237
+b(f)190 b(real)47 b(fixed-decimal)d(format)i(floating)g(point)g
+(\(float\))191 3599 y(_dbl)381 b(d)190 b(double)46 b(precision)g(real)g
+(floating-point)e(\(double\))191 3711 y(_fixdbl)237 b(g)190
+b(double)46 b(precision)g(fixed-format)e(floating)i(point)g(\(double\))
+191 3824 y(_cmp)381 b(c)190 b(complex)46 b(reals)g(\(pairs)h(of)g
+(float)f(values\))191 3937 y(_fixcmp)237 b(fc)142 b(complex)46
+b(reals,)g(fixed-format)f(floating)g(point)191 4050 y(_dblcmp)237
+b(m)190 b(double)46 b(precision)g(complex)f(\(pairs)i(of)g(double)f
+(values\))191 4163 y(_fixdblcmp)93 b(fm)142 b(double)46
+b(precision)g(complex,)f(fixed-format)g(floating)g(point)191
+4276 y(_log)381 b(l)190 b(logical)46 b(\(int\))191 4389
+y(_str)381 b(s)190 b(character)46 b(string)0 4650 y Fj(The)32
+b(logical)g(data)i(t)m(yp)s(e)f(corresp)s(onds)e(to)j(`in)m(t')e(for)h
+(logical)f(k)m(eyw)m(ord)h(v)-5 b(alues,)33 b(and)f(`b)m(yte')i(for)f
+(logical)f(binary)0 4763 y(table)39 b(columns.)66 b(In)39
+b(other)g(w)m(ords,)i(the)f(v)-5 b(alue)38 b(when)h(writing)e(a)j
+(logical)e(k)m(eyw)m(ord)i(m)m(ust)f(b)s(e)g(stored)g(in)f(an)0
+4876 y(`in)m(t')g(v)-5 b(ariable,)38 b(and)g(m)m(ust)f(b)s(e)g(stored)h
+(in)f(a)h(`c)m(har')h(arra)m(y)f(when)f(reading)g(or)g(writing)f(to)j
+(`L')f(columns)e(in)h(a)0 4989 y(binary)e(table.)59 b(Inplicit)34
+b(data)j(t)m(yp)s(e)f(con)m(v)m(ersion)h(is)f(not)h(supp)s(orted)d(for)
+i(logical)g(table)h(columns,)g(but)f(is)f(for)0 5102
+y(k)m(eyw)m(ords,)30 b(so)f(a)h(logical)e(k)m(eyw)m(ord)i(ma)m(y)f(b)s
+(e)g(read)f(and)h(cast)h(to)g(an)m(y)f(n)m(umerical)f(data)h(t)m(yp)s
+(e;)h(a)g(returned)d(v)-5 b(alue)0 5215 y(=)30 b(0)h(indicates)e
+(false,)h(and)g(an)m(y)h(other)f(v)-5 b(alue)30 b(=)g(true.)0
+5375 y(The)37 b(`in)m(t')h(data)g(t)m(yp)s(e)g(ma)m(y)g(b)s(e)f(2)h(b)m
+(ytes)h(long)e(on)g(some)h(IBM)h(PC)e(compatible)g(systems)g(and)g(is)g
+(usually)f(4)0 5488 y(b)m(ytes)27 b(long)f(on)h(most)g(other)g
+(systems.)39 b(Some)27 b(64-bit)g(mac)m(hines,)g(ho)m(w)m(ev)m(er,)i
+(lik)m(e)d(the)h(Dec)h(Alpha/OSF,)e(de\014ne)0 5601 y(the)j(`short',)h
+(`in)m(t',)g(and)e(`long')h(in)m(teger)h(data)g(t)m(yp)s(es)f(to)h(b)s
+(e)e(2,)i(4,)g(and)f(8)g(b)m(ytes)h(long,)f(resp)s(ectiv)m(ely)-8
+b(.)40 b(The)29 b(FITS)0 5714 y(standard)j(only)g(supp)s(orts)g(2)h
+(and)g(4)g(b)m(yte)h(in)m(teger)f(data)h(t)m(yp)s(es,)g(so)f(CFITSIO)f
+(in)m(ternally)f(con)m(v)m(erts)j(b)s(et)m(w)m(een)p
 eop
-%%Page: 15 21
-15 20 bop 0 1225 a Fg(Chapter)65 b(4)0 1687 y Fm(Extended)77
-b(File)g(Name)g(Syn)-6 b(tax)0 2216 y Fe(4.1)135 b(Ov)l(erview)0
-2472 y Fj(CFITSIO)30 b(supp)s(orts)f(an)j(extended)f(syn)m(tax)h(when)f
-(sp)s(ecifying)e(the)j(name)f(of)h(the)g(data)g(\014le)e(to)i(b)s(e)f
-(op)s(ened)g(or)0 2585 y(created)g(that)g(includes)d(the)j(follo)m
-(wing)e(features:)136 2870 y Fc(\017)46 b Fj(CFITSIO)40
-b(can)i(read)f(IRAF)h(format)g(images)f(whic)m(h)f(ha)m(v)m(e)j(header)
-e(\014le)g(names)g(that)h(end)f(with)f(the)227 2983 y('.imh')d
-(extension,)i(as)f(w)m(ell)e(as)i(reading)e(and)h(writing)e(FITS)i
-(\014les,)h(This)e(feature)i(is)e(implemen)m(ted)g(in)227
-3096 y(CFITSIO)29 b(b)m(y)i(\014rst)e(con)m(v)m(erting)j(the)e(IRAF)h
-(image)g(in)m(to)f(a)h(temp)s(orary)f(FITS)g(format)h(\014le)e(in)g
-(memory)-8 b(,)227 3209 y(then)35 b(op)s(ening)e(the)i(FITS)f(\014le.)
-53 b(An)m(y)35 b(of)g(the)g(usual)e(CFITSIO)h(routines)f(then)i(ma)m(y)
-g(b)s(e)f(used)g(to)i(read)227 3322 y(the)31 b(image)f(header)h(or)f
-(data.)136 3534 y Fc(\017)46 b Fj(FITS)37 b(\014les)g(on)g(the)h(in)m
-(ternet)g(can)g(b)s(e)f(read)g(\(and)g(sometimes)h(written\))f(using)f
-(the)i(FTP)-8 b(,)38 b(HTTP)-8 b(,)38 b(or)227 3647 y(R)m(OOT)30
-b(proto)s(cols.)136 3860 y Fc(\017)46 b Fj(FITS)30 b(\014les)f(can)i(b)
-s(e)f(pip)s(ed)e(b)s(et)m(w)m(een)j(tasks)f(on)h(the)f(stdin)f(and)h
-(stdout)g(streams.)136 4073 y Fc(\017)46 b Fj(FITS)20
-b(\014les)g(can)h(b)s(e)f(read)g(and)g(written)g(in)f(shared)h(memory)
--8 b(.)38 b(This)19 b(can)i(p)s(oten)m(tially)e(ac)m(hiev)m(e)j(m)m(uc)
-m(h)f(b)s(etter)227 4186 y(data)26 b(I/O)e(p)s(erformance)g(compared)h
-(to)h(reading)e(and)g(writing)e(the)j(same)h(FITS)e(\014les)f(on)i
-(magnetic)g(disk.)136 4398 y Fc(\017)46 b Fj(Compressed)30
-b(FITS)f(\014les)h(in)f(gzip)h(or)g(Unix)f(COMPRESS)g(format)h(can)h(b)
-s(e)f(directly)f(read.)136 4611 y Fc(\017)46 b Fj(FITS)26
-b(table)g(columns)f(can)i(b)s(e)f(created,)i(mo)s(di\014ed,)e(or)g
-(deleted)g('on-the-\015y')h(as)g(the)g(table)f(is)f(op)s(ened)h(b)m(y)
-227 4724 y(CFITSIO.)32 b(This)g(creates)j(a)e(virtual)f(FITS)h(\014le)f
-(con)m(taining)h(the)h(mo)s(di\014cations)d(that)j(is)f(then)g(op)s
-(ened)227 4837 y(b)m(y)e(the)f(application)f(program.)136
-5050 y Fc(\017)46 b Fj(T)-8 b(able)28 b(ro)m(ws)f(ma)m(y)i(b)s(e)e
-(selected,)i(or)f(\014ltered)f(out,)h(on)g(the)g(\015y)f(when)g(the)h
-(table)g(is)f(op)s(ened)g(b)m(y)g(CFITSIO,)227 5162 y(based)f(on)h(an)f
-(arbitrary)g(user-sp)s(eci\014ed)e(expression.)38 b(Only)25
-b(ro)m(ws)i(for)f(whic)m(h)f(the)i(expression)e(ev)-5
-b(aluates)227 5275 y(to)31 b('TR)m(UE')g(are)g(retained)f(in)f(the)h
-(cop)m(y)i(of)e(the)h(table)f(that)h(is)e(op)s(ened)h(b)m(y)g(the)h
-(application)d(program.)136 5488 y Fc(\017)46 b Fj(Histogram)27
-b(images)g(ma)m(y)g(b)s(e)f(created)h(on)f(the)h(\015y)f(b)m(y)g
-(binning)e(the)i(v)-5 b(alues)26 b(in)f(table)i(columns,)f(resulting)
-227 5601 y(in)35 b(a)h(virtual)f(N-dimensional)e(FITS)j(image.)58
-b(The)35 b(application)f(program)i(then)g(only)f(sees)h(the)h(FITS)227
-5714 y(image)31 b(\(in)e(the)i(primary)d(arra)m(y\))k(instead)d(of)i
-(the)f(original)f(FITS)g(table.)1905 5942 y(15)p eop
-%%Page: 16 22
-16 21 bop 0 299 a Fj(16)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(The)43
-b(latter)h(3)g(features)g(in)e(particular)g(add)h(v)m(ery)h(p)s(o)m(w)m
-(erful)e(data)i(pro)s(cessing)e(capabilities)g(directly)g(in)m(to)0
-668 y(CFITSIO,)29 b(and)g(hence)h(in)m(to)g(ev)m(ery)g(task)h(that)f
-(uses)g(CFITSIO)e(to)j(read)f(or)g(write)f(FITS)g(\014les.)39
-b(F)-8 b(or)31 b(example,)0 781 y(these)d(features)f(transform)f(a)i(v)
-m(ery)f(simple)e(program)i(that)h(just)f(copies)g(an)g(input)e(FITS)h
-(\014le)g(to)i(a)g(new)e(output)0 894 y(\014le)35 b(\(lik)m(e)g(the)h
-(`\014tscop)m(y')h(program)f(that)g(is)f(distributed)e(with)h
-(CFITSIO\))h(in)m(to)h(a)g(m)m(ultipurp)s(ose)d(FITS)i(\014le)0
-1007 y(pro)s(cessing)23 b(to)s(ol.)39 b(By)25 b(app)s(ending)e(fairly)f
-(simple)h(quali\014ers)g(on)m(to)i(the)g(name)g(of)g(the)g(input)e
-(FITS)h(\014le,)h(the)g(user)0 1120 y(can)37 b(p)s(erform)f(quite)h
-(complex)g(table)g(editing)f(op)s(erations)g(\(e.g.,)41
-b(create)e(new)d(columns,)i(or)f(\014lter)g(out)g(ro)m(ws)0
-1233 y(in)f(a)h(table\))g(or)g(create)h(FITS)f(images)g(b)m(y)g
-(binning)c(or)k(histogramming)f(the)h(v)-5 b(alues)36
-b(in)g(table)h(columns.)59 b(In)0 1346 y(addition,)31
-b(these)i(functions)d(ha)m(v)m(e)k(b)s(een)d(co)s(ded)h(using)e(new)i
-(state-of-the)i(art)f(algorithms)e(that)i(are,)g(in)e(some)0
-1458 y(cases,)h(10)f(-)f(100)i(times)e(faster)h(than)f(previous)f
-(widely)f(used)i(implemen)m(tations.)0 1619 y(Before)k(describing)d
-(the)j(complete)g(syn)m(tax)g(for)f(the)h(extended)f(FITS)g(\014le)f
-(names)h(in)f(the)i(next)g(section,)g(here)0 1732 y(are)d(a)g(few)f
-(examples)g(of)g(FITS)g(\014le)f(names)i(that)f(giv)m(e)h(a)g(quic)m(k)
-f(o)m(v)m(erview)h(of)g(the)f(allo)m(w)m(ed)g(syn)m(tax:)136
-2005 y Fc(\017)46 b Ff('myfile.fits')p Fj(:)37 b(the)31
-b(simplest)d(case)k(of)e(a)h(FITS)f(\014le)f(on)i(disk)d(in)i(the)g
-(curren)m(t)g(directory)-8 b(.)136 2207 y Fc(\017)46
-b Ff('myfile.imh')p Fj(:)37 b(op)s(ens)28 b(an)h(IRAF)g(format)g(image)
-h(\014le)e(and)g(con)m(v)m(erts)i(it)f(on)g(the)g(\015y)f(in)m(to)h(a)g
-(temp)s(orary)227 2320 y(FITS)h(format)h(image)f(in)f(memory)i(whic)m
-(h)e(can)h(then)g(b)s(e)g(read)g(with)f(an)m(y)i(other)g(CFITSIO)e
-(routine.)136 2521 y Fc(\017)46 b Ff('myfile.fits.gz[events,)c(2]')p
-Fj(:)59 b(op)s(ens)40 b(and)f(uncompresses)g(the)i(gzipp)s(ed)d(\014le)
-i(m)m(y\014le.\014ts)f(then)227 2634 y(mo)m(v)m(es)34
-b(to)f(the)f(extension)g(whic)m(h)f(has)g(the)i(k)m(eyw)m(ords)f
-(EXTNAME)g(=)g('EVENTS')g(and)g(EXTVER)f(=)227 2747 y(2.)136
-2948 y Fc(\017)46 b Ff('-')p Fj(:)40 b(a)31 b(dash)f(\(min)m(us)f
-(sign\))h(signi\014es)e(that)j(the)g(input)e(\014le)g(is)h(to)h(b)s(e)f
-(read)g(from)g(the)h(stdin)e(\014le)g(stream,)227 3061
-y(or)i(that)g(the)f(output)g(\014le)g(is)f(to)i(b)s(e)f(written)f(to)i
-(the)g(stdout)f(stream.)136 3263 y Fc(\017)46 b Ff
-('ftp://legacy.gsfc.nasa.g)o(ov/t)o(est/)o(vel)o(a.fi)o(ts')p
-Fj(:)33 b(FITS)28 b(\014les)f(in)g(an)m(y)h(ftp)g(arc)m(hiv)m(e)h(site)
-f(on)g(the)227 3376 y(in)m(ternet)i(ma)m(y)h(b)s(e)f(directly)f(op)s
-(ened)h(with)f(read-only)h(access.)136 3577 y Fc(\017)46
-b Ff('http://legacy.gsfc.nasa.)o(gov/)o(soft)o(war)o(e/te)o(st.f)o(its)
-o(')p Fj(:)d(an)m(y)34 b(v)-5 b(alid)33 b(URL)h(to)h(a)f(FITS)g(\014le)
-f(on)227 3690 y(the)e(W)-8 b(eb)31 b(ma)m(y)g(b)s(e)f(op)s(ened)f(with)
-g(read-only)h(access.)136 3892 y Fc(\017)46 b Ff
-('root://legacy.gsfc.nasa.)o(gov/)o(test)o(/ve)o(la.f)o(its')o
-Fj(:)32 b(similar)21 b(to)j(ftp)f(access)i(except)g(that)f(it)f(pro-)
-227 4005 y(vides)29 b(write)h(as)g(w)m(ell)f(as)i(read)f(access)h(to)g
-(the)f(\014les)g(across)g(the)h(net)m(w)m(ork.)41 b(This)28
-b(uses)i(the)h(ro)s(ot)f(proto)s(col)227 4117 y(dev)m(elop)s(ed)g(at)h
-(CERN.)136 4319 y Fc(\017)46 b Ff('shmem://h2[events]')p
-Fj(:)35 b(op)s(ens)30 b(the)g(FITS)f(\014le)h(in)f(a)h(shared)f(memory)
-i(segmen)m(t)g(and)e(mo)m(v)m(es)j(to)f(the)227 4432
-y(EVENTS)f(extension.)136 4633 y Fc(\017)46 b Ff('mem://')p
-Fj(:)52 b(creates)39 b(a)e(scratc)m(h)i(output)d(\014le)h(in)e(core)j
-(computer)f(memory)-8 b(.)62 b(The)37 b(resulting)e('\014le')i(will)227
-4746 y(disapp)s(ear)24 b(when)g(the)i(program)f(exits,)h(so)g(this)e
-(is)h(mainly)e(useful)h(for)h(testing)h(purp)s(oses)d(when)i(one)g(do)s
-(es)227 4859 y(not)31 b(w)m(an)m(t)g(a)g(p)s(ermanen)m(t)f(cop)m(y)h
-(of)f(the)h(output)f(\014le.)136 5061 y Fc(\017)46 b
-Ff('myfile.fits[3;)e(Images\(10\)]')p Fj(:)49 b(op)s(ens)35
-b(a)i(cop)m(y)g(of)f(the)g(image)h(con)m(tained)f(in)f(the)i(10th)f(ro)
-m(w)h(of)227 5174 y(the)26 b('Images')i(column)c(in)h(the)h(binary)f
-(table)g(in)g(the)h(3th)h(extension)e(of)h(the)h(FITS)e(\014le.)38
-b(The)26 b(application)227 5287 y(just)k(sees)h(this)e(single)g(image)i
-(as)f(the)h(primary)d(arra)m(y)-8 b(.)136 5488 y Fc(\017)46
-b Ff('myfile.fits[1:512:2,)c(1:512:2]')p Fj(:)49 b(op)s(ens)35
-b(a)h(section)g(of)f(the)h(input)e(image)i(ranging)f(from)g(the)227
-5601 y(1st)26 b(to)g(the)f(512th)h(pixel)e(in)f(X)j(and)e(Y,)i(and)e
-(selects)i(ev)m(ery)f(second)h(pixel)d(in)h(b)s(oth)g(dimensions,)g
-(resulting)227 5714 y(in)29 b(a)i(256)h(x)e(256)i(pixel)c(image)j(in)e
-(this)g(case.)p eop
-%%Page: 17 23
-17 22 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(17)136 555 y Fc(\017)46 b Ff('myfile.fits[EVENTS][col)41
-b(Rad)47 b(=)h(sqrt\(X**2)d(+)j(Y**2\)]')p Fj(:)38 b(creates)30
-b(and)f(op)s(ens)f(a)h(temp)s(orary)227 668 y(\014le)e(on)g(the)g
-(\015y)g(\(in)f(memory)h(or)g(on)h(disk\))e(that)h(is)g(iden)m(tical)f
-(to)i(m)m(y\014le.\014ts)e(except)i(that)g(it)f(will)e(con)m(tain)227
-781 y(a)41 b(new)f(column)f(in)h(the)g(EVENTS)g(extension)g(called)g
-('Rad')h(whose)f(v)-5 b(alue)40 b(is)f(computed)i(using)e(the)227
-894 y(indicated)29 b(expresson)h(whic)m(h)f(is)h(a)g(function)f(of)i
-(the)g(v)-5 b(alues)29 b(in)g(the)i(X)f(and)g(Y)h(columns.)136
-1106 y Fc(\017)46 b Ff('myfile.fits[EVENTS][PHA)41 b(>)48
-b(5]')p Fj(:)37 b(creates)27 b(and)e(op)s(ens)g(a)h(temp)s(orary)f
-(FITS)g(\014les)f(that)i(is)f(iden)m(ti-)227 1219 y(cal)k(to)h('m)m
-(y\014le.\014ts')e(except)i(that)f(the)g(EVENTS)f(table)h(will)d(only)i
-(con)m(tain)h(the)g(ro)m(ws)g(that)h(ha)m(v)m(e)g(v)-5
-b(alues)227 1332 y(of)28 b(the)g(PHA)f(column)f(greater)j(than)e(5.)40
-b(In)27 b(general,)h(an)m(y)g(arbitrary)e(b)s(o)s(olean)h(expression)f
-(using)g(a)i(C)f(or)227 1445 y(F)-8 b(ortran-lik)m(e)29
-b(syn)m(tax,)g(whic)m(h)e(ma)m(y)i(com)m(bine)f(AND)h(and)f(OR)f(op)s
-(erators,)i(ma)m(y)g(b)s(e)f(used)f(to)i(select)g(ro)m(ws)227
-1557 y(from)h(a)h(table.)136 1769 y Fc(\017)46 b Ff
-('myfile.fits[EVENTS][bin)41 b(\(X,Y\)=1,2048,4]')p Fj(:)46
-b(creates)37 b(a)e(temp)s(orary)g(FITS)f(primary)f(arra)m(y)227
-1882 y(image)c(whic)m(h)f(is)g(computed)g(on)h(the)g(\015y)f(b)m(y)g
-(binning)e(\(i.e,)k(computing)d(the)i(2-dimensional)e(histogram\))227
-1995 y(of)34 b(the)f(v)-5 b(alues)33 b(in)f(the)i(X)g(and)e(Y)i
-(columns)e(of)i(the)f(EVENTS)g(extension.)49 b(In)33
-b(this)f(case)j(the)e(X)h(and)f(Y)227 2108 y(co)s(ordinates)g(range)h
-(from)f(1)h(to)g(2048)h(and)e(the)h(image)f(pixel)f(size)h(is)g(4)g
-(units)f(in)g(b)s(oth)h(dimensions,)f(so)227 2221 y(the)f(resulting)d
-(image)j(is)e(512)j(x)e(512)i(pixels)d(in)g(size.)136
-2433 y Fc(\017)46 b Fj(The)31 b(\014nal)f(example)i(com)m(bines)f(man)m
-(y)g(of)h(these)g(feature)g(in)m(to)f(one)h(complex)f(expression)f
-(\(it)i(is)e(brok)m(en)227 2546 y(in)m(to)h(sev)m(eral)f(lines)f(for)h
-(clarit)m(y\):)323 2832 y Ff('ftp://legacy.gsfc.nasa)o(.gov)o(/dat)o
-(a/s)o(ampl)o(e.fi)o(ts.)o(gz[E)o(VENT)o(S])370 2945
-y([col)47 b(phacorr)f(=)h(pha)g(*)h(1.1)f(-)g(0.3][phacorr)e(>=)i(5.0)g
-(&&)g(phacorr)f(<=)h(14.0])370 3058 y([bin)g(\(X,Y\)=32]')227
-3344 y Fj(In)37 b(this)g(case,)k(CFITSIO)36 b(\(1\))j(copies)f(and)f
-(uncompresses)g(the)h(FITS)f(\014le)g(from)g(the)h(ftp)f(site)h(on)g
-(the)227 3457 y(legacy)f(mac)m(hine,)h(\(2\))f(mo)m(v)m(es)g(to)g(the)g
-('EVENTS')f(extension,)h(\(3\))g(calculates)g(a)f(new)g(column)f
-(called)227 3570 y('phacorr',)30 b(\(4\))f(selects)g(the)g(ro)m(ws)g
-(in)e(the)i(table)g(that)g(ha)m(v)m(e)h(phacorr)e(in)f(the)i(range)g(5)
-g(to)h(14,)g(and)e(\014nally)227 3683 y(\(5\))35 b(bins)c(the)i
-(remaining)e(ro)m(ws)i(on)h(the)f(X)g(and)g(Y)g(column)f(co)s
-(ordinates,)i(using)d(a)j(pixel)d(size)i(=)g(32)h(to)227
-3796 y(create)d(a)f(2D)g(image.)41 b(All)28 b(this)g(pro)s(cessing)g
-(is)h(completely)g(transparen)m(t)g(to)i(the)e(application)f(program,)
-227 3908 y(whic)m(h)h(simply)f(sees)j(the)g(\014nal)e(2-D)i(image)g(in)
-e(the)h(primary)f(arra)m(y)i(of)f(the)h(op)s(ened)f(\014le.)0
-4271 y Fe(4.2)135 b(Detailed)47 b(Filename)f(Syn)l(tax)0
-4527 y Fj(This)34 b(section)i(describ)s(es)f(the)h(full)e(extended)i
-(syn)m(tax)g(for)g(the)h(CFITSIO)d(FITS)h(\014le)g(names.)58
-b(The)36 b(\014lename)0 4640 y(can)31 b(con)m(tain)f(sev)m(eral)h
-(di\013eren)m(t)f(comp)s(onen)m(ts)g(dep)s(ending)e(on)j(the)f(con)m
-(text:)0 4924 y Ff(When)47 b(creating)e(a)j(new)f(file:)143
-5036 y(filetype://BaseFilename\(t)o(empl)o(ate)o(Name)o(\))0
-5262 y(When)g(opening)e(an)j(existing)d(primary)h(array)g(or)i(image)e
-(HDU:)143 5375 y(filetype://BaseFilename\(o)o(utNa)o(me\))o([HDU)o
-(loca)o(tio)o(n][I)o(mage)o(Sec)o(tion)o(])0 5601 y(When)h(opening)e
-(an)j(existing)d(table)i(HDU:)143 5714 y(filetype://BaseFilename\(o)o
-(utNa)o(me\))o([HDU)o(loca)o(tio)o(n][c)o(olFi)o(lte)o(r][r)o(owFi)o
-(lte)o(r][b)o(inSp)o(ec])p eop
-%%Page: 18 24
-18 23 bop 0 299 a Fj(18)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(The)41
-b(\014let)m(yp)s(e,)j(BaseFilename,)h(outName,)g(HDUlo)s(cation,)g(and)
-c(ImageSection)h(comp)s(onen)m(ts,)j(if)c(presen)m(t,)0
-668 y(m)m(ust)30 b(b)s(e)g(giv)m(en)h(in)e(that)i(order,)g(but)f(the)g
-(colFilter,)g(ro)m(wFilter,)h(and)e(binSp)s(ec)g(sp)s(eci\014ers)f(ma)m
-(y)k(follo)m(w)d(in)h(an)m(y)0 781 y(order.)39 b(Regardless)28
-b(of)h(the)f(order,)g(ho)m(w)m(ev)m(er,)i(the)f(colFilter)e(sp)s
-(eci\014er,)g(if)g(presen)m(t,)i(will)d(b)s(e)h(pro)s(cessed)h(\014rst)
-f(b)m(y)0 894 y(CFITSIO,)i(follo)m(w)m(ed)h(b)m(y)g(the)h(ro)m(wFilter)
-f(sp)s(eci\014er,)f(and)g(\014nally)g(b)m(y)h(the)g(binSp)s(ec)e(sp)s
-(eci\014er.)0 1179 y Fd(4.2.1)112 b(Filet)m(yp)s(e)0
-1398 y Fj(The)37 b(t)m(yp)s(e)g(of)g(\014le)f(determines)g(the)h
-(medium)e(on)i(whic)m(h)f(the)h(\014le)f(is)h(lo)s(cated)g(\(e.g.,)j
-(disk)c(or)h(net)m(w)m(ork\))h(and,)0 1510 y(hence,)f(whic)m(h)d(in)m
-(ternal)g(device)h(driv)m(er)f(is)g(used)g(b)m(y)h(CFITSIO)f(to)i(read)
-f(and/or)g(write)f(the)h(\014le.)55 b(Curren)m(tly)0
-1623 y(supp)s(orted)29 b(t)m(yp)s(es)h(are)382 1845 y
-Ff(file://)93 b(-)48 b(file)e(on)i(local)e(magnetic)g(disk)g
-(\(default\))382 1958 y(ftp://)141 b(-)48 b(a)f(readonly)f(file)g
-(accessed)g(with)h(the)g(anonymous)e(FTP)i(protocol.)907
-2071 y(It)g(also)g(supports)93 b(ftp://username:password@)o(host)o(nam)
-o(e/..)o(.)907 2184 y(for)47 b(accessing)e(password-protected)e(ftp)k
-(sites.)382 2297 y(http://)93 b(-)48 b(a)f(readonly)f(file)g(accessed)g
-(with)h(the)g(HTTP)f(protocol.)93 b(It)907 2410 y(does)46
-b(not)95 b(support)46 b(username:password)d(like)k(the)g(ftp)f(driver.)
-382 2523 y(root://)93 b(-)48 b(uses)e(the)h(CERN)g(root)g(protocol)e
-(for)i(writing)f(as)h(well)g(as)907 2636 y(reading)f(files)g(over)h
-(the)g(network.)382 2749 y(shmem://)e(-)j(opens)e(or)h(creates)f(a)i
-(file)e(which)h(persists)e(in)i(the)g(computer's)907
-2862 y(shared)f(memory.)382 2974 y(mem://)141 b(-)48
-b(opens)e(a)i(temporary)d(file)i(in)g(core)f(memory.)94
-b(The)47 b(file)907 3087 y(disappears)e(when)h(the)h(program)f(exits)h
-(so)g(this)f(is)i(mainly)907 3200 y(useful)e(for)h(test)f(purposes)g
-(when)h(a)g(permanent)e(output)h(file)907 3313 y(is)h(not)g(desired.)0
-3535 y Fj(If)35 b(the)h(\014let)m(yp)s(e)f(is)f(not)i(sp)s(eci\014ed,)g
-(then)f(t)m(yp)s(e)h(\014le://)g(is)e(assumed.)56 b(The)35
-b(double)f(slashes)h('//')i(are)f(optional)0 3648 y(and)30
-b(ma)m(y)h(b)s(e)e(omitted)i(in)e(most)i(cases.)0 3930
-y Fi(Notes)k(ab)s(out)f(the)h(ro)s(ot)g(\014let)m(yp)s(e)0
-4148 y Fj(The)30 b(original)e(ro)s(otd)j(serv)m(er)f(can)h(b)s(e)f
-(obtained)f(from:)334 4370 y Ff(ftp://root.cern.ch/root/r)o(oot)o(d.ta)
-o(r.gz)0 4592 y Fj(but,)39 b(for)e(it)g(to)h(w)m(ork)g(correctly)g
-(with)e(CFITSIO)g(one)h(has)g(to)i(use)e(a)h(mo)s(di\014ed)d(v)m
-(ersion)i(whic)m(h)f(supp)s(orts)g(a)0 4705 y(command)31
-b(to)i(return)d(the)i(length)f(of)h(the)f(\014le.)44
-b(This)29 b(mo)s(di\014ed)h(v)m(ersion)h(is)f(a)m(v)-5
-b(ailable)31 b(in)g(ro)s(otd)g(sub)s(directory)0 4818
-y(in)e(the)i(CFITSIO)d(ftp)i(area)i(at)286 5040 y Ff
-(ftp://legacy.gsfc.nasa.gov)o(/so)o(ftwa)o(re/f)o(its)o(io/c)o(/roo)o
-(t/r)o(ootd)o(.tar)o(.gz)o(.)0 5262 y Fj(This)h(small)f(serv)m(er)j(is)
-f(started)g(either)g(b)m(y)h(inetd)e(when)g(a)i(clien)m(t)f(requests)g
-(a)h(connection)g(to)g(a)f(ro)s(otd)h(serv)m(er)0 5375
-y(or)30 b(b)m(y)g(hand)f(\(i.e.)41 b(from)30 b(the)g(command)g(line\).)
-40 b(The)29 b(ro)s(otd)h(serv)m(er)h(w)m(orks)f(with)f(the)h(R)m(OOT)g
-(TNetFile)g(class.)0 5488 y(It)g(allo)m(ws)e(remote)j(access)f(to)h(R)m
-(OOT)e(database)h(\014les)e(in)g(either)h(read)h(or)f(write)g(mo)s(de.)
-40 b(By)30 b(default)e(TNetFile)0 5601 y(assumes)38 b(p)s(ort)g(432)h
-(\(whic)m(h)e(requires)g(ro)s(otd)h(to)h(b)s(e)f(started)h(as)f(ro)s
-(ot\).)65 b(T)-8 b(o)39 b(run)e(ro)s(otd)h(via)g(inetd)f(add)h(the)0
-5714 y(follo)m(wing)29 b(line)g(to)i(/etc/services:)p
+%%Page: 19 27
+19 26 bop 0 299 a Fh(4.4.)72 b(SUPPOR)-8 b(T)30 b(F)m(OR)g(UNSIGNED)h
+(INTEGERS)f(AND)h(SIGNED)f(BYTES)942 b Fj(19)0 555 y(4)31
+b(and)f(8)g(b)m(ytes)h(when)f(reading)f(or)h(writing)f(`long')h(in)m
+(tegers)h(on)f(Alpha/OSF)f(systems.)0 715 y(The)e(8-b)m(yte)i
+('LONGLONG')f(in)m(teger)g(data)g(t)m(yp)s(e)g(is)e(supp)s(orted)g(on)i
+(most)f(platforms.)39 b(CFITSIO)26 b(de\014nes)h(the)0
+828 y(LONGLONG)i(data)g(t)m(yp)s(e)g(to)h(b)s(e)e(equiv)-5
+b(alen)m(t)29 b(to)g('long)g(long')g(on)f(most)i(Unix)d(platforms)h
+(and)g(on)h(Mac)h(OS-X.)0 941 y(Since)36 b(most)i(Windo)m(ws)e
+(compilers)g(don't)h(supp)s(ort)e(the)j('long)f(long')g(data)g(t)m(yp)s
+(e,)j(LONGLONG)d(is)f(de\014ned)0 1054 y(instead)e(to)h(b)s(e)f(equiv)
+-5 b(alen)m(t)33 b(to)i(')p 1141 1054 28 4 v 1175 1054
+V 66 w(in)m(t64'.)54 b(If)34 b(the)g(compiler)f(do)s(es)h(not)h(supp)s
+(ort)d(a)j(8-b)m(yte)h(in)m(teger)f(data)g(t)m(yp)s(e)0
+1167 y(then)d(LONGLONG)h(is)f(de\014ned)f(to)i(b)s(e)f(equiv)-5
+b(alen)m(t)33 b(to)g('long'.)48 b(Note)34 b(that)f(the)g(C)f(format)h
+(sp)s(eci\014er)e(to)i(prin)m(t)0 1280 y(out)38 b(these)g(long)g(in)m
+(teger)g(v)-5 b(alues)37 b(is)g("\045lld")g(on)h(most)g(unix)e(mac)m
+(hines,)k(except)e(on)g(OSF)g(platforms)e(where)0 1393
+y("\045ld")d(m)m(ust)g(b)s(e)f(used.)49 b(On)32 b(Windo)m(ws)g
+(platform)h(that)g(ha)m(v)m(e)i(the)p 2385 1393 V 2417
+1393 V 99 w(in)m(t64)e(data)h(t)m(yp)s(e,)h(the)e(format)h(sp)s
+(eci\014er)0 1506 y(is)29 b("\045INT64d".)0 1666 y(When)23
+b(dealing)f(with)g(the)i(FITS)f(b)m(yte)h(data)g(t)m(yp)s(e)f(it)g(is)g
+(imp)s(ortan)m(t)f(to)i(remem)m(b)s(er)f(that)h(the)g(ra)m(w)f(v)-5
+b(alues)23 b(\(b)s(efore)0 1779 y(an)m(y)i(scaling)e(b)m(y)h(the)h
+(BSCALE)e(and)h(BZER)m(O,)g(or)h(TSCALn)d(and)i(TZER)m(On)f(k)m(eyw)m
+(ord)i(v)-5 b(alues\))24 b(in)f(b)m(yte)i(arra)m(ys)0
+1892 y(\(BITPIX)37 b(=)f(8\))h(or)f(b)m(yte)i(columns)d(\(TF)m(ORMn)i
+(=)f('B'\))h(are)g(in)m(terpreted)f(as)h(unsigned)d(b)m(ytes)j(with)f
+(v)-5 b(alues)0 2005 y(ranging)33 b(from)h(0)g(to)h(255.)53
+b(Some)34 b(C)g(compilers)f(de\014ne)g(a)h('c)m(har')h(v)-5
+b(ariable)33 b(as)i(signed,)f(so)g(it)g(is)f(imp)s(ortan)m(t)g(to)0
+2118 y(explicitly)28 b(declare)i(a)h(n)m(umeric)e(c)m(har)i(v)-5
+b(ariable)29 b(as)i('unsigned)d(c)m(har')j(to)g(a)m(v)m(oid)g(an)m(y)g
+(am)m(biguit)m(y)0 2278 y(One)22 b(feature)h(of)g(the)g(CFITSIO)e
+(routines)h(is)f(that)j(they)f(can)g(op)s(erate)g(on)f(a)h(`X')h
+(\(bit\))e(column)g(in)f(a)i(binary)e(table)0 2391 y(as)33
+b(though)f(it)g(w)m(ere)h(a)g(`B')g(\(b)m(yte\))h(column.)46
+b(F)-8 b(or)33 b(example)f(a)h(`11X')h(data)f(t)m(yp)s(e)g(column)e
+(can)i(b)s(e)f(in)m(terpreted)0 2503 y(the)c(same)h(as)f(a)g(`2B')i
+(column)d(\(i.e.,)i(2)f(unsigned)e(8-bit)i(b)m(ytes\).)41
+b(In)27 b(some)i(instances,)f(it)f(can)i(b)s(e)e(more)h(e\016cien)m(t)0
+2616 y(to)j(read)f(and)g(write)g(whole)f(b)m(ytes)i(at)g(a)g(time,)f
+(rather)h(than)f(reading)f(or)i(writing)d(eac)m(h)k(individual)25
+b(bit.)0 2777 y(The)36 b(complex)h(and)f(double)g(precision)f(complex)i
+(data)h(t)m(yp)s(es)f(are)g(not)g(directly)f(supp)s(orted)f(in)h(ANSI)g
+(C)h(so)0 2889 y(these)g(data)g(t)m(yp)s(es)f(should)e(b)s(e)i(in)m
+(terpreted)g(as)g(pairs)f(of)i(\015oat)g(or)f(double)f(v)-5
+b(alues,)37 b(resp)s(ectiv)m(ely)-8 b(,)38 b(where)e(the)0
+3002 y(\014rst)30 b(v)-5 b(alue)29 b(in)h(eac)m(h)h(pair)e(is)h(the)g
+(real)g(part,)h(and)e(the)i(second)f(is)g(the)g(imaginary)f(part.)0
+3470 y Ff(4.4)135 b(Supp)t(ort)44 b(for)h(Unsigned)h(In)l(tegers)g(and)
+f(Signed)g(Bytes)0 3747 y Fj(Although)32 b(FITS)g(do)s(es)g(not)h
+(directly)f(supp)s(ort)f(unsigned)f(in)m(tegers)j(as)g(one)g(of)g(its)g
+(fundamen)m(tal)e(data)j(t)m(yp)s(es,)0 3860 y(FITS)27
+b(can)h(still)e(b)s(e)h(used)g(to)i(e\016cien)m(tly)f(store)g(unsigned)
+e(in)m(teger)i(data)h(v)-5 b(alues)27 b(in)g(images)h(and)f(binary)f
+(tables.)0 3973 y(The)42 b(con)m(v)m(en)m(tion)i(used)e(in)f(FITS)h
+(\014les)g(is)f(to)j(store)f(the)g(unsigned)d(in)m(tegers)j(as)g
+(signed)f(in)m(tegers)h(with)e(an)0 4086 y(asso)s(ciated)33
+b(o\013set)g(\(sp)s(eci\014ed)e(b)m(y)h(the)g(BZER)m(O)g(or)g(TZER)m
+(On)f(k)m(eyw)m(ord\).)47 b(F)-8 b(or)33 b(example,)f(to)h(store)g
+(unsigned)0 4199 y(16-bit)f(in)m(teger)g(v)-5 b(alues)31
+b(in)f(a)i(FITS)f(image)h(the)f(image)h(w)m(ould)f(b)s(e)f(de\014ned)h
+(as)h(a)g(signed)e(16-bit)i(in)m(teger)g(\(with)0 4312
+y(BITPIX)d(k)m(eyw)m(ord)g(=)g(SHOR)-8 b(T)p 1132 4312
+V 32 w(IMG)30 b(=)e(16\))j(with)c(the)j(k)m(eyw)m(ords)f(BSCALE)f(=)h
+(1.0)h(and)f(BZER)m(O)g(=)f(32768.)0 4425 y(Th)m(us)34
+b(the)h(unsigned)e(v)-5 b(alues)34 b(of)h(0,)i(32768,)h(and)d(65535,)j
+(for)d(example,)h(are)f(ph)m(ysically)e(stored)i(in)f(the)h(FITS)0
+4538 y(image)k(as)f(-32768,)43 b(0,)e(and)d(32767,)k(resp)s(ectiv)m
+(ely;)g(CFITSIO)37 b(automatically)h(adds)f(the)i(BZER)m(O)f(o\013set)h
+(to)0 4650 y(these)g(v)-5 b(alues)38 b(when)g(they)g(are)h(read.)65
+b(Similarly)-8 b(,)38 b(in)f(the)i(case)h(of)e(unsigned)f(32-bit)i(in)m
+(tegers)f(the)h(BITPIX)0 4763 y(k)m(eyw)m(ord)c(w)m(ould)e(b)s(e)h
+(equal)g(to)i(LONG)p 1392 4763 V 32 w(IMG)f(=)g(32)g(and)f(BZER)m(O)g
+(w)m(ould)g(b)s(e)g(equal)g(to)h(2147483648)k(\(i.e.)54
+b(2)0 4876 y(raised)29 b(to)i(the)g(31st)g(p)s(o)m(w)m(er\).)0
+5036 y(The)j(CFITSIO)g(in)m(terface)h(routines)f(will)e(e\016cien)m
+(tly)j(and)f(transparen)m(tly)h(apply)e(the)i(appropriate)f(o\013set)i
+(in)0 5149 y(these)29 b(cases)h(so)f(in)f(general)h(application)e
+(programs)i(do)g(not)g(need)f(to)i(b)s(e)e(concerned)h(with)f(ho)m(w)h
+(the)g(unsigned)0 5262 y(v)-5 b(alues)43 b(are)i(actually)f(stored)g
+(in)e(the)j(FITS)e(\014le.)81 b(As)44 b(a)g(con)m(v)m(enience)i(for)d
+(users,)k(CFITSIO)c(has)h(sev)m(eral)0 5375 y(prede\014ned)19
+b(constan)m(ts)j(for)f(the)g(v)-5 b(alue)20 b(of)h(BITPIX)g(\(USHOR)-8
+b(T)p 2189 5375 V 33 w(IMG,)21 b(ULONG)p 2790 5375 V
+33 w(IMG\))h(and)e(for)h(the)g(TF)m(ORMn)0 5488 y(v)-5
+b(alue)35 b(in)f(the)i(case)g(of)g(binary)e(tables)h(\(`U')i(and)e
+(`V'\))h(whic)m(h)e(programmers)h(can)h(use)f(when)g(creating)h(FITS)0
+5601 y(\014les)i(con)m(taining)g(unsigned)f(in)m(teger)i(v)-5
+b(alues.)65 b(The)39 b(follo)m(wing)e(co)s(de)i(fragmen)m(t)g
+(illustrates)e(ho)m(w)i(to)h(write)e(a)0 5714 y(FITS)30
+b(1-D)h(primary)e(arra)m(y)h(of)h(unsigned)d(16-bit)j(in)m(tegers:)p
 eop
-%%Page: 19 25
-19 24 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(19)95 555 y Ff(rootd)238 b(432/tcp)0 819
-y Fj(and)30 b(to)h(/etc/inetd.conf,)h(add)e(the)g(follo)m(wing)f(line:)
-95 1083 y Ff(rootd)47 b(stream)f(tcp)h(nowait)f(root)h
-(/user/rdm/root/bin/root)o(d)42 b(rootd)k(-i)0 1346 y
-Fj(F)-8 b(orce)34 b(inetd)d(to)j(reread)e(its)g(conf)g(\014le)g(with)f
-("kill)f(-HUP)j(<pid)e(inetd>".)46 b(Y)-8 b(ou)33 b(can)g(also)f(start)
-h(ro)s(otd)g(b)m(y)f(hand)0 1459 y(running)j(directly)h(under)f(y)m
-(our)j(priv)-5 b(ate)37 b(accoun)m(t)h(\(no)g(ro)s(ot)g(system)f
-(priviliges)d(needed\).)62 b(F)-8 b(or)38 b(example)f(to)0
-1572 y(start)31 b(ro)s(otd)f(listening)e(on)j(p)s(ort)e(5151)j(just)e
-(t)m(yp)s(e:)95 1836 y Ff(rootd)47 b(-p)g(5151)0 2100
-y Fj(Notice:)42 b(no)30 b(&)g(is)f(needed.)41 b(Ro)s(otd)30
-b(will)e(go)j(in)m(to)g(bac)m(kground)f(b)m(y)g(itself.)95
-2364 y Ff(Rootd)47 b(arguments:)191 2477 y(-i)763 b(says)47
-b(we)g(were)f(started)g(by)h(inetd)191 2589 y(-p)g(port#)476
-b(specifies)45 b(a)j(different)d(port)i(to)g(listen)f(on)191
-2702 y(-d)h(level)476 b(level)46 b(of)i(debug)e(info)h(written)e(to)j
-(syslog)1050 2815 y(0)f(=)h(no)f(debug)f(\(default\))1050
-2928 y(1)h(=)h(minimum)1050 3041 y(2)f(=)h(medium)1050
-3154 y(3)f(=)h(maximum)0 3418 y Fj(Ro)s(otd)29 b(can)f(also)g(b)s(e)g
-(con\014gured)g(for)g(anon)m(ymous)g(usage)h(\(lik)m(e)f(anon)m(ymous)g
-(ftp\).)40 b(T)-8 b(o)29 b(setup)f(ro)s(otd)g(to)h(accept)0
-3531 y(anon)m(ymous)h(logins)f(do)i(the)f(follo)m(wing)f(\(while)g(b)s
-(eing)g(logged)i(in)e(as)h(ro)s(ot\):)143 3794 y Ff(-)48
-b(Add)f(the)f(following)g(line)g(to)i(/etc/passwd:)239
-4020 y(rootd:*:71:72:Anonymous)41 b(rootd:/var/spool/rootd:/b)o(in/)o
-(fals)o(e)239 4246 y(where)46 b(you)h(may)g(modify)f(the)h(uid,)f(gid)h
-(\(71,)g(72\))g(and)g(the)g(home)f(directory)239 4359
-y(to)h(suite)f(your)h(system.)143 4585 y(-)h(Add)f(the)f(following)g
-(line)g(to)i(/etc/group:)239 4811 y(rootd:*:72:rootd)239
-5036 y(where)e(the)h(gid)g(must)f(match)h(the)g(gid)g(in)g
-(/etc/passwd.)143 5262 y(-)h(Create)e(the)h(directories:)239
-5488 y(mkdir)f(/var/spool/rootd)239 5601 y(mkdir)g
-(/var/spool/rootd/tmp)239 5714 y(chmod)g(777)h(/var/spool/rootd/tmp)p
+%%Page: 20 28
+20 27 bop 0 299 a Fj(20)1763 b Fh(CHAPTER)29 b(4.)112
+b(PR)m(OGRAMMING)32 b(GUIDELINES)286 555 y Fe(unsigned)46
+b(short)g(uarray[100];)286 668 y(int)h(naxis,)f(status;)286
+781 y(long)h(naxes[10],)e(group,)h(firstelem,)f(nelements;)334
+894 y(...)286 1007 y(status)h(=)i(0;)286 1120 y(naxis)f(=)g(1;)286
+1233 y(naxes[0])f(=)h(100;)286 1346 y(fits_create_img\(fptr,)42
+b(USHORT_IMG,)j(naxis,)h(naxes,)g(&status\);)286 1571
+y(firstelem)g(=)h(1;)286 1684 y(nelements)f(=)h(100;)286
+1797 y(fits_write_img\(fptr,)c(TUSHORT,)i(firstelem,)g(nelements,)1241
+1910 y(uarray,)h(&status\);)334 2023 y(...)0 2264 y Fj(In)40
+b(the)h(ab)s(o)m(v)m(e)i(example,)g(the)f(2nd)e(parameter)h(in)f
+(\014ts)p 1998 2264 28 4 v 33 w(create)p 2267 2264 V
+34 w(img)g(tells)g(CFITSIO)g(to)i(write)e(the)h(header)0
+2377 y(k)m(eyw)m(ords)34 b(appropriate)f(for)g(an)g(arra)m(y)i(of)e
+(16-bit)h(unsigned)e(in)m(tegers)i(\(i.e.,)h(BITPIX)e(=)g(16)i(and)e
+(BZER)m(O)g(=)0 2490 y(32768\).)41 b(Then)23 b(the)h(\014ts)p
+834 2490 V 32 w(write)p 1069 2490 V 32 w(img)g(routine)f(writes)f(the)j
+(arra)m(y)f(of)g(unsigned)e(short)h(in)m(tegers)h(\(uarra)m(y\))h(in)m
+(to)f(the)0 2603 y(primary)f(arra)m(y)i(of)g(the)g(FITS)f(\014le.)38
+b(Similarly)-8 b(,)23 b(a)i(32-bit)h(unsigned)c(in)m(teger)j(image)h
+(ma)m(y)f(b)s(e)f(created)i(b)m(y)f(setting)0 2716 y(the)34
+b(second)f(parameter)h(in)e(\014ts)p 1130 2716 V 33 w(create)p
+1399 2716 V 34 w(img)h(equal)g(to)h(`ULONG)p 2330 2716
+V 33 w(IMG')g(and)f(b)m(y)h(calling)d(the)j(\014ts)p
+3491 2716 V 33 w(write)p 3727 2716 V 32 w(img)0 2829
+y(routine)i(with)f(the)i(second)f(parameter)h(=)f(TULONG)h(to)g(write)f
+(the)g(arra)m(y)h(of)g(unsigned)e(long)h(image)h(pixel)0
+2942 y(v)-5 b(alues.)0 3102 y(An)27 b(analogous)g(set)g(of)g(routines)f
+(are)h(a)m(v)-5 b(ailable)27 b(for)f(reading)g(or)h(writing)e(unsigned)
+g(in)m(teger)i(v)-5 b(alues)27 b(and)f(signed)0 3215
+y(b)m(yte)i(v)-5 b(alues)27 b(in)g(a)h(FITS)f(binary)f(table)i
+(extension.)39 b(When)28 b(sp)s(ecifying)d(the)j(TF)m(ORMn)g(k)m(eyw)m
+(ord)g(v)-5 b(alue)27 b(whic)m(h)0 3328 y(de\014nes)36
+b(the)h(format)g(of)g(a)h(column,)f(CFITSIO)e(recognized)j(3)f
+(additional)e(data)i(t)m(yp)s(e)g(co)s(des)g(b)s(esides)e(those)0
+3440 y(already)29 b(de\014ned)g(in)f(the)i(FITS)f(standard:)40
+b(`U')30 b(meaning)f(a)h(16-bit)g(unsigned)e(in)m(teger)i(column,)f
+(`V')h(for)g(a)g(32-)0 3553 y(bit)25 b(unsigned)e(in)m(teger)j(column,)
+g(and)f('S')g(for)g(a)h(signed)f(b)m(yte)h(column.)38
+b(These)25 b(non-standard)g(data)h(t)m(yp)s(e)g(co)s(des)0
+3666 y(are)36 b(not)g(actually)g(written)f(in)m(to)g(the)h(FITS)g
+(\014le)e(but)i(instead)f(are)h(just)f(used)g(in)m(ternally)f(within)f
+(CFITSIO.)0 3779 y(The)d(follo)m(wing)f(co)s(de)h(fragmen)m(t)h
+(illustrates)e(ho)m(w)h(to)h(use)f(these)h(features:)286
+4020 y Fe(unsigned)46 b(short)g(uarray[100];)286 4133
+y(unsigned)g(int)95 b(varray[100];)286 4359 y(int)47
+b(colnum,)f(tfields,)g(status;)286 4472 y(long)h(nrows,)f(firstrow,)f
+(firstelem,)g(nelements,)g(pcount;)286 4698 y(char)i(extname[])e(=)j
+("Test_table";)521 b(/*)47 b(extension)f(name)g(*/)286
+4924 y(/*)i(define)e(the)h(name,)f(data)h(type,)f(and)h(physical)e
+(units)i(for)g(the)g(2)g(columns)f(*/)286 5036 y(char)h(*ttype[])f(=)h
+({)g("Col_1",)f("Col_2",)g("Col_3")f(};)286 5149 y(char)i(*tform[])f(=)
+h({)g("1U",)285 b("1V",)190 b("1S"};)94 b(/*)47 b(special)f(CFITSIO)g
+(codes)g(*/)286 5262 y(char)h(*tunit[])f(=)h({)g(")h(",)381
+b(")48 b(",)190 b(")47 b(")h(};)334 5375 y(...)525 5601
+y(/*)f(write)g(the)f(header)h(keywords)e(*/)286 5714
+y(status)94 b(=)48 b(0;)p eop
+%%Page: 21 29
+21 28 bop 0 299 a Fh(4.5.)72 b(DEALING)31 b(WITH)f(CHARA)m(CTER)g
+(STRINGS)1816 b Fj(21)286 555 y Fe(nrows)142 b(=)48 b(1;)286
+668 y(tfields)e(=)i(3)286 781 y(pcount)94 b(=)48 b(0;)286
+894 y(fits_create_tbl\(fptr,)42 b(BINARY_TBL,)j(nrows,)h(tfields,)g
+(ttype,)g(tform,)764 1007 y(tunit,)g(extname,)f(&status\);)525
+1233 y(/*)i(write)g(the)f(unsigned)g(shorts)g(to)h(the)g(1st)g(column)f
+(*/)286 1346 y(colnum)190 b(=)47 b(1;)286 1458 y(firstrow)94
+b(=)47 b(1;)286 1571 y(firstelem)f(=)h(1;)286 1684 y(nelements)f(=)h
+(100;)286 1797 y(fits_write_col\(fptr,)c(TUSHORT,)i(colnum,)h
+(firstrow,)f(firstelem,)668 1910 y(nelements,)g(uarray,)h(&status\);)
+525 2136 y(/*)h(now)g(write)f(the)h(unsigned)f(longs)g(to)h(the)g(2nd)g
+(column)f(*/)286 2249 y(colnum)190 b(=)47 b(2;)286 2362
+y(fits_write_col\(fptr,)c(TUINT,)j(colnum,)g(firstrow,)f(firstelem,)668
+2475 y(nelements,)g(varray,)h(&status\);)334 2588 y(...)0
+2865 y Fj(Note)22 b(that)g(the)f(non-standard)f(TF)m(ORM)h(v)-5
+b(alues)20 b(for)h(the)g(3)g(columns,)h(`U')f(and)g(`V',)h(tell)e
+(CFITSIO)f(to)j(write)e(the)0 2978 y(k)m(eyw)m(ords)27
+b(appropriate)e(for)h(unsigned)e(16-bit)j(and)e(unsigned)g(32-bit)h(in)
+m(tegers,)i(resp)s(ectiv)m(ely)d(\(i.e.,)j(TF)m(ORMn)0
+3091 y(=)39 b('1I')i(and)e(TZER)m(On)f(=)h(32678)j(for)e(unsigned)d
+(16-bit)j(in)m(tegers,)j(and)c(TF)m(ORMn)h(=)f('1J')h(and)f(TZER)m(On)0
+3204 y(=)c(2147483648)40 b(for)35 b(unsigned)e(32-bit)i(in)m(tegers\).)
+56 b(The)35 b('S')g(TF)m(ORMn)g(v)-5 b(alue)35 b(tells)g(CFITSIO)e(to)j
+(write)f(the)0 3317 y(k)m(eyw)m(ords)30 b(appropriate)f(for)h(a)g
+(signed)f(8-bit)h(b)m(yte)g(column)f(with)f(TF)m(ORMn)i(=)g('1B')h(and)
+e(TZER)m(On)g(=)g(-128.)0 3430 y(The)h(calls)f(to)j(\014ts)p
+628 3430 28 4 v 32 w(write)p 863 3430 V 32 w(col)e(then)g(write)g(the)h
+(arra)m(ys)f(of)h(unsigned)d(in)m(teger)j(v)-5 b(alues)30
+b(to)h(the)f(columns.)0 3784 y Ff(4.5)135 b(Dealing)47
+b(with)e(Character)h(Strings)0 4039 y Fj(The)36 b(c)m(haracter)j
+(string)c(v)-5 b(alues)37 b(in)e(a)i(FITS)f(header)h(or)g(in)e(an)i
+(ASCI)s(I)e(column)h(in)f(a)j(FITS)e(table)g(extension)0
+4152 y(are)j(generally)g(padded)f(out)h(with)f(non-signi\014can)m(t)g
+(space)h(c)m(haracters)i(\(ASCI)s(I)d(32\))i(to)g(\014ll)d(up)h(the)h
+(header)0 4264 y(record)33 b(or)h(the)f(column)g(width.)48
+b(When)33 b(reading)g(a)h(FITS)e(string)h(v)-5 b(alue,)34
+b(the)f(CFITSIO)f(routines)h(will)d(strip)0 4377 y(o\013)38
+b(these)f(non-signi\014can)m(t)f(trailing)f(spaces)i(and)g(will)d
+(return)i(a)i(n)m(ull-terminated)d(string)h(v)-5 b(alue)36
+b(con)m(taining)0 4490 y(only)d(the)h(signi\014can)m(t)e(c)m
+(haracters.)52 b(Leading)33 b(spaces)h(in)f(a)h(FITS)f(string)f(are)i
+(considered)f(signi\014can)m(t.)50 b(If)33 b(the)0 4603
+y(string)h(con)m(tains)h(all)f(blanks,)h(then)f(CFITSIO)g(will)e
+(return)i(a)h(single)e(blank)h(c)m(haracter,)k(i.e,)e(the)f(\014rst)f
+(blank)0 4716 y(is)29 b(considered)f(to)j(b)s(e)e(signi\014can)m(t,)g
+(since)g(it)g(distinguishes)e(the)j(string)e(from)i(a)g(n)m(ull)d(or)j
+(unde\014ned)e(string,)h(but)0 4829 y(the)i(remaining)d(trailing)g
+(spaces)j(are)g(not)g(signi\014can)m(t.)0 4989 y(Similarly)-8
+b(,)37 b(when)g(writing)f(string)h(v)-5 b(alues)37 b(to)i(a)g(FITS)e
+(\014le)g(the)h(CFITSIO)f(routines)g(exp)s(ect)h(to)h(get)g(a)g(n)m
+(ull-)0 5102 y(terminated)32 b(string)g(as)h(input;)f(CFITSIO)f(will)f
+(pad)i(the)h(string)f(with)f(blanks)g(if)h(necessary)h(when)f(writing)e
+(it)0 5215 y(to)h(the)g(FITS)e(\014le.)0 5375 y(When)j(calling)f
+(CFITSIO)g(routines)h(that)h(return)e(a)i(c)m(haracter)h(string)e(it)g
+(is)f(vital)h(that)h(the)g(size)f(of)h(the)g(c)m(har)0
+5488 y(arra)m(y)38 b(b)s(e)g(large)g(enough)f(to)i(hold)d(the)i(en)m
+(tire)g(string)f(of)h(c)m(haracters,)k(otherwise)37 b(CFITSIO)f(will)f
+(o)m(v)m(erwrite)0 5601 y(whatev)m(er)g(memory)e(lo)s(cations)g(follo)m
+(w)g(the)h(c)m(har)h(arra)m(y)-8 b(,)35 b(p)s(ossibly)c(causing)i(the)h
+(program)g(to)g(execute)h(incor-)0 5714 y(rectly)-8 b(.)41
+b(This)29 b(t)m(yp)s(e)h(of)h(error)f(can)h(b)s(e)f(di\016cult)e(to)j
+(debug,)f(so)h(programmers)f(should)e(alw)m(a)m(ys)j(ensure)f(that)h
+(the)p eop
+%%Page: 22 30
+22 29 bop 0 299 a Fj(22)1763 b Fh(CHAPTER)29 b(4.)112
+b(PR)m(OGRAMMING)32 b(GUIDELINES)0 555 y Fj(c)m(har)27
+b(arra)m(ys)g(are)g(allo)s(cated)g(enough)f(space)i(to)f(hold)f(the)g
+(longest)h(p)s(ossible)e(string,)h Fi(including)i Fj(the)f(terminat-)0
+668 y(ing)j(NULL)h(c)m(haracter.)45 b(The)30 b(\014tsio.h)g(\014le)h
+(con)m(tains)g(the)g(follo)m(wing)f(de\014ned)g(constan)m(ts)i(whic)m
+(h)e(programmers)0 781 y(are)h(strongly)f(encouraged)h(to)g(use)f
+(whenev)m(er)g(they)h(are)f(allo)s(cating)g(space)h(for)f(c)m(har)h
+(arra)m(ys:)0 1025 y Fe(#define)46 b(FLEN_FILENAME)e(1025)j(/*)g(max)g
+(length)f(of)h(a)g(filename)f(*/)0 1138 y(#define)g(FLEN_KEYWORD)140
+b(72)95 b(/*)47 b(max)g(length)f(of)h(a)g(keyword)94
+b(*/)0 1251 y(#define)46 b(FLEN_CARD)284 b(81)95 b(/*)47
+b(length)f(of)h(a)h(FITS)e(header)g(card)h(*/)0 1364
+y(#define)f(FLEN_VALUE)236 b(71)95 b(/*)47 b(max)g(length)f(of)h(a)g
+(keyword)f(value)h(string)f(*/)0 1477 y(#define)g(FLEN_COMMENT)140
+b(73)95 b(/*)47 b(max)g(length)f(of)h(a)g(keyword)f(comment)g(string)g
+(*/)0 1590 y(#define)g(FLEN_ERRMSG)188 b(81)95 b(/*)47
+b(max)g(length)f(of)h(a)g(CFITSIO)f(error)h(message)e(*/)0
+1703 y(#define)h(FLEN_STATUS)188 b(31)95 b(/*)47 b(max)g(length)f(of)h
+(a)g(CFITSIO)f(status)g(text)h(string)f(*/)0 1947 y Fj(F)-8
+b(or)23 b(example,)g(when)e(declaring)g(a)h(c)m(har)g(arra)m(y)h(to)f
+(hold)f(the)h(v)-5 b(alue)21 b(string)g(of)h(FITS)f(k)m(eyw)m(ord,)k
+(use)c(the)h(follo)m(wing)0 2060 y(statemen)m(t:)191
+2304 y Fe(char)47 b(value[FLEN_VALUE];)0 2548 y Fj(Note)41
+b(that)f(FLEN)p 686 2548 28 4 v 33 w(KEYW)m(ORD)g(is)e(longer)h(than)g
+(needed)g(for)g(the)h(nominal)d(8-c)m(haracter)42 b(k)m(eyw)m(ord)e
+(name)0 2661 y(b)s(ecause)30 b(the)h(HIERAR)m(CH)f(con)m(v)m(en)m(tion)
+i(supp)s(orts)c(longer)i(k)m(eyw)m(ord)h(names.)0 2992
+y Ff(4.6)135 b(Implicit)46 b(Data)g(T)l(yp)t(e)f(Con)l(v)l(ersion)0
+3242 y Fj(The)29 b(CFITSIO)e(routines)h(that)i(read)f(and)f(write)h(n)m
+(umerical)e(data)j(can)g(p)s(erform)d(implicit)f(data)k(t)m(yp)s(e)f
+(con)m(v)m(er-)0 3355 y(sion.)38 b(This)24 b(means)i(that)g(the)g(data)
+g(t)m(yp)s(e)g(of)g(the)g(v)-5 b(ariable)24 b(or)i(arra)m(y)g(in)e(the)
+i(program)g(do)s(es)f(not)h(need)f(to)i(b)s(e)e(the)0
+3468 y(same)g(as)f(the)h(data)g(t)m(yp)s(e)g(of)f(the)h(v)-5
+b(alue)24 b(in)f(the)h(FITS)g(\014le.)38 b(Data)26 b(t)m(yp)s(e)f(con)m
+(v)m(ersion)f(is)g(supp)s(orted)e(for)i(n)m(umerical)0
+3581 y(and)37 b(string)f(data)h(t)m(yp)s(es)h(\(if)e(the)h(string)f
+(con)m(tains)i(a)f(v)-5 b(alid)36 b(n)m(um)m(b)s(er)g(enclosed)g(in)g
+(quotes\))i(when)e(reading)h(a)0 3694 y(FITS)30 b(header)h(k)m(eyw)m
+(ord)g(v)-5 b(alue)30 b(and)g(for)h(n)m(umeric)f(v)-5
+b(alues)30 b(when)g(reading)g(or)g(writing)f(v)-5 b(alues)30
+b(in)g(the)h(primary)0 3807 y(arra)m(y)24 b(or)g(a)h(table)e(column.)38
+b(CFITSIO)22 b(returns)h(status)h(=)f(NUM)p 2267 3807
+V 34 w(O)m(VERFLO)m(W)i(if)d(the)i(con)m(v)m(erted)i(data)e(v)-5
+b(alue)0 3920 y(exceeds)33 b(the)g(range)g(of)g(the)f(output)g(data)i
+(t)m(yp)s(e.)47 b(Implicit)30 b(data)j(t)m(yp)s(e)g(con)m(v)m(ersion)g
+(is)e(not)i(supp)s(orted)d(within)0 4032 y(binary)f(tables)h(for)g
+(string,)f(logical,)i(complex,)f(or)g(double)f(complex)h(data)h(t)m(yp)
+s(es.)0 4193 y(In)g(addition,)f(an)m(y)h(table)g(column)f(ma)m(y)i(b)s
+(e)f(read)g(as)h(if)e(it)h(con)m(tained)g(string)f(v)-5
+b(alues.)43 b(In)31 b(the)g(case)i(of)e(n)m(umeric)0
+4306 y(columns)e(the)i(returned)e(string)g(will)f(b)s(e)i(formatted)h
+(using)d(the)j(TDISPn)e(displa)m(y)g(format)h(if)g(it)g(exists.)0
+4637 y Ff(4.7)135 b(Data)46 b(Scaling)0 4887 y Fj(When)38
+b(reading)e(n)m(umerical)h(data)h(v)-5 b(alues)37 b(in)f(the)i(primary)
+e(arra)m(y)i(or)g(a)g(table)g(column,)h(the)e(v)-5 b(alues)37
+b(will)f(b)s(e)0 5000 y(scaled)h(automatically)h(b)m(y)f(the)g(BSCALE)g
+(and)g(BZER)m(O)g(\(or)h(TSCALn)e(and)h(TZER)m(On\))f(header)h(v)-5
+b(alues)37 b(if)0 5113 y(they)31 b(are)f(presen)m(t)h(in)e(the)h
+(header.)41 b(The)30 b(scaled)g(data)h(that)g(is)e(returned)h(to)h(the)
+f(reading)g(program)g(will)e(ha)m(v)m(e)382 5357 y Fe(output)46
+b(value)g(=)i(\(FITS)e(value\))g(*)i(BSCALE)e(+)h(BZERO)0
+5601 y Fj(\(a)30 b(corresp)s(onding)d(form)m(ula)h(using)g(TSCALn)f
+(and)i(TZER)m(On)e(is)h(used)h(when)f(reading)g(from)h(table)g
+(columns\).)0 5714 y(In)i(the)i(case)g(of)f(in)m(teger)g(output)g(v)-5
+b(alues)31 b(the)i(\015oating)f(p)s(oin)m(t)f(scaled)g(v)-5
+b(alue)32 b(is)f(truncated)h(to)h(an)f(in)m(teger)g(\(not)p
 eop
-%%Page: 20 26
-20 25 bop 0 299 a Fj(20)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)239 668 y
-Ff(Where)46 b(/var/spool/rootd)d(must)k(match)f(the)h(rootd)g(home)f
-(directory)g(as)239 781 y(specified)f(in)i(the)g(rootd)f(/etc/passwd)f
-(entry.)143 1007 y(-)j(To)f(make)f(writeable)g(directories)e(for)j
-(anonymous)f(do,)h(for)f(example:)239 1233 y(mkdir)g
-(/var/spool/rootd/pub)239 1346 y(chown)g(rootd:rootd)f
-(/var/spool/rootd/pub)0 1593 y Fj(That's)d(all.)74 b(Sev)m(eral)42
-b(additional)e(remarks:)64 b(y)m(ou)42 b(can)g(login)f(to)i(an)f(anon)m
-(ymous)f(serv)m(er)i(either)e(with)g(the)0 1706 y(names)31
-b("anon)m(ymous")h(or)f("ro)s(otd".)43 b(The)31 b(passw)m(ord)f(should)
-f(b)s(e)i(of)g(t)m(yp)s(e)g(user@host.do.main.)42 b(Only)29
-b(the)i(@)0 1819 y(is)d(enforced)g(for)h(the)f(time)h(b)s(eing.)38
-b(In)28 b(anon)m(ymous)h(mo)s(de)f(the)g(top)h(of)g(the)g(\014le)e
-(tree)j(is)d(set)i(to)h(the)e(ro)s(otd)h(home)0 1932
-y(directory)-8 b(,)38 b(therefore)f(only)e(\014les)h(b)s(elo)m(w)f(the)
-i(home)f(directory)g(can)g(b)s(e)g(accessed.)60 b(Anon)m(ymous)36
-b(mo)s(de)g(only)0 2045 y(w)m(orks)30 b(when)g(the)g(serv)m(er)h(is)e
-(started)i(via)f(inetd.)0 2330 y Fi(Notes)35 b(ab)s(out)f(the)h(shmem)e
-(\014let)m(yp)s(e:)0 2549 y Fj(Shared)h(memory)h(\014les)f(are)h
-(curren)m(tly)f(supp)s(orted)f(on)i(most)h(Unix)e(platforms,)h(where)g
-(the)g(shared)f(memory)0 2662 y(segmen)m(ts)d(are)g(managed)g(b)m(y)f
-(the)g(op)s(erating)g(system)h(k)m(ernel)e(and)h(`liv)m(e')g(indep)s
-(enden)m(tly)d(of)k(pro)s(cesses.)40 b(They)0 2775 y(are)34
-b(not)g(deleted)g(\(b)m(y)g(default\))f(when)g(the)h(pro)s(cess)f(whic)
-m(h)g(created)i(them)f(terminates,)g(although)g(they)g(will)0
-2888 y(disapp)s(ear)d(if)h(the)i(system)f(is)f(reb)s(o)s(oted.)49
-b(Applications)31 b(can)j(create)h(shared)d(memory)h(\014les)f(in)g
-(CFITSIO)g(b)m(y)0 3001 y(calling:)143 3248 y Ff
-(fit_create_file\(&fitsfile)o(ptr,)41 b("shmem://h2",)j(&status\);)0
-3496 y Fj(where)22 b(the)g(ro)s(ot)h(`\014le')f(names)g(are)g(curren)m
-(tly)g(restricted)g(to)h(b)s(e)e('h0',)k('h1',)f('h2',)h('h3',)f(etc.,)
-i(up)21 b(to)i(a)g(maxim)m(umn)0 3609 y(n)m(um)m(b)s(er)d(de\014ned)f
-(b)m(y)i(the)g(the)g(v)-5 b(alue)21 b(of)g(SHARED)p 1746
-3609 28 4 v 33 w(MAXSEG)g(\(equal)g(to)g(16)h(b)m(y)f(default\).)37
-b(This)19 b(is)h(a)h(protot)m(yp)s(e)0 3722 y(implemen)m(tation)27
-b(of)i(the)g(shared)f(memory)g(in)m(terface)h(and)f(a)h(more)g(robust)f
-(in)m(terface,)i(whic)m(h)d(will)f(ha)m(v)m(e)k(few)m(er)0
-3835 y(restrictions)f(on)h(the)h(n)m(um)m(b)s(er)e(of)i(\014les)e(and)h
-(on)g(their)f(names,)i(ma)m(y)g(b)s(e)f(dev)m(elop)s(ed)f(in)g(the)i
-(future.)0 3995 y(When)23 b(op)s(ening)g(an)g(already)g(existing)g
-(FITS)g(\014le)g(in)f(shared)h(memory)h(one)g(calls)e(the)i(usual)f
-(CFITSIO)f(routine:)143 4243 y Ff(fits_open_file\(&fitsfilep)o(tr,)41
-b("shmem://h7",)j(mode,)j(&status\))0 4490 y Fj(The)26
-b(\014le)g(mo)s(de)h(can)g(b)s(e)f(READ)m(WRITE)h(or)g(READONL)-8
-b(Y)28 b(just)e(as)h(with)e(disk)h(\014les.)38 b(More)28
-b(than)e(one)h(pro)s(cess)0 4603 y(can)37 b(op)s(erate)g(on)g(READONL)
--8 b(Y)37 b(mo)s(de)g(\014les)e(at)j(the)f(same)g(time.)59
-b(CFITSIO)35 b(supp)s(orts)g(prop)s(er)h(\014lelo)s(c)m(king)0
-4716 y(\(b)s(oth)27 b(in)g(READONL)-8 b(Y)29 b(and)e(READ)m(WRITE)h(mo)
-s(des\),)h(so)f(calls)f(to)h(\014ts)p 2572 4716 V 33
-w(op)s(en)p 2795 4716 V 32 w(\014le)f(ma)m(y)h(b)s(e)f(lo)s(c)m(k)m(ed)
-i(out)f(un)m(til)0 4829 y(another)j(other)f(pro)s(cess)g(closes)h(the)f
-(\014le.)0 4989 y(When)g(an)g(application)f(is)g(\014nished)f
-(accessing)j(a)f(FITS)g(\014le)f(in)g(a)i(shared)e(memory)h(segmen)m
-(t,)i(it)e(ma)m(y)h(close)f(it)0 5102 y(\(and)k(the)g(\014le)f(will)e
-(remain)h(in)h(the)h(system\))g(with)f(\014ts)p 1955
-5102 V 32 w(close)p 2174 5102 V 33 w(\014le,)h(or)g(delete)g(it)g(with)
-e(\014ts)p 3191 5102 V 33 w(delete)p 3456 5102 V 33 w(\014le.)50
-b(Ph)m(ys-)0 5215 y(ical)34 b(deletion)g(is)g(p)s(ostp)s(oned)f(un)m
-(til)h(the)h(last)f(pro)s(cess)h(calls)f(\013clos/\013delt.)54
-b(\014ts)p 2801 5215 V 32 w(delete)p 3065 5215 V 33 w(\014le)34
-b(tries)h(to)g(obtain)g(a)0 5328 y(READ)m(WRITE)f(lo)s(c)m(k)f(on)g
-(the)g(\014le)g(to)h(b)s(e)e(deleted,)i(th)m(us)f(it)g(can)g(b)s(e)g
-(blo)s(c)m(k)m(ed)g(if)f(the)i(ob)5 b(ject)34 b(w)m(as)f(not)h(op)s
-(ened)0 5441 y(in)29 b(READ)m(WRITE)i(mo)s(de.)0 5601
-y(A)i(shared)f(memory)h(managemen)m(t)h(utilit)m(y)d(program)i(called)f
-(`smem',)h(is)f(included)e(with)i(the)h(CFITSIO)e(dis-)0
-5714 y(tribution.)37 b(It)27 b(can)g(b)s(e)f(built)f(b)m(y)i(t)m(yping)
-f(`mak)m(e)i(smem';)g(then)f(t)m(yp)s(e)g(`smem)f(-h')h(to)h(get)g(a)f
-(list)e(of)i(v)-5 b(alid)25 b(options.)p eop
-%%Page: 21 27
-21 26 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(21)0 555 y(Executing)36 b(smem)g(without)f(an)m(y)i
-(options)f(causes)g(it)g(to)h(list)e(all)g(the)i(shared)e(memory)i
-(segmen)m(ts)g(curren)m(tly)0 668 y(residing)31 b(in)h(the)h(system)h
-(and)e(managed)i(b)m(y)f(the)h(shared)e(memory)h(driv)m(er.)48
-b(T)-8 b(o)34 b(get)g(a)g(list)e(of)h(all)f(the)i(shared)0
-781 y(memory)c(ob)5 b(jects,)32 b(run)d(the)h(system)h(utilit)m(y)d
-(program)i(`ip)s(cs)g([-a]'.)0 1115 y Fd(4.2.2)112 b(Base)38
-b(Filename)0 1343 y Fj(The)31 b(base)g(\014lename)g(is)f(the)i(name)f
-(of)h(the)f(\014le)g(optionally)e(including)f(the)k(director/sub)s
-(directory)d(path,)j(and)0 1455 y(in)d(the)i(case)g(of)g(`ftp',)f(`h)m
-(ttp',)i(and)d(`ro)s(ot')j(\014let)m(yp)s(es,)d(the)i(mac)m(hine)f
-(iden)m(ti\014er.)39 b(Examples:)191 1752 y Ff(myfile.fits)191
-1865 y(!data.fits)191 1978 y(/data/myfile.fits)191 2091
-y(fits.gsfc.nasa.gov/ftp/s)o(ampl)o(eda)o(ta/m)o(yfil)o(e.f)o(its.)o
-(gz)0 2387 y Fj(When)29 b(creating)g(a)g(new)f(output)h(\014le)f(on)h
-(magnetic)g(disk)e(\(of)j(t)m(yp)s(e)f(\014le://\))g(if)f(the)h(base)g
-(\014lename)f(b)s(egins)f(with)0 2500 y(an)34 b(exclamation)h(p)s(oin)m
-(t)e(\(!\))54 b(then)34 b(an)m(y)g(existing)g(\014le)f(with)g(that)i
-(same)g(basename)g(will)d(b)s(e)h(deleted)h(prior)f(to)0
-2613 y(creating)h(the)g(new)g(FITS)f(\014le.)50 b(Otherwise)33
-b(if)g(the)h(\014le)f(to)h(b)s(e)g(created)h(already)e(exists,)i(then)e
-(CFITSIO)g(will)0 2726 y(return)g(an)h(error)f(and)g(will)f(not)i(o)m
-(v)m(erwrite)g(the)g(existing)f(\014le.)51 b(Note)35
-b(that)g(the)f(exclamation)g(p)s(oin)m(t,)g(')10 b(!',)36
-b(is)d(a)0 2839 y(sp)s(ecial)26 b(UNIX)i(c)m(haracter,)j(so)d(if)e(it)i
-(is)f(used)g(on)g(the)h(command)g(line)e(rather)i(than)f(en)m(tered)h
-(at)h(a)f(task)h(prompt,)0 2952 y(it)i(m)m(ust)g(b)s(e)g(preceded)g(b)m
-(y)h(a)g(bac)m(kslash)f(to)h(force)g(the)g(UNIX)g(shell)d(to)j(pass)f
-(it)h(v)m(erbatim)f(to)h(the)g(application)0 3065 y(program.)0
-3225 y(The)27 b(input)f(\014le)g(ma)m(y)i(b)s(e)f(compressed)h(with)e
-(the)i(gzip)f(or)g(Unix)g(compress)g(algorithms,)g(in)f(whic)m(h)h
-(case)h(CFIT-)0 3338 y(SIO)i(will)f(uncompress)h(the)i(\014le)e(on)i
-(the)f(\015y)g(in)m(to)h(a)f(temp)s(orary)g(\014le)g(\(in)f(memory)i
-(or)f(on)g(disk\).)43 b(Compressed)0 3451 y(\014les)34
-b(ma)m(y)h(only)f(b)s(e)h(op)s(ened)f(with)g(read-only)g(p)s
-(ermission.)51 b(When)35 b(sp)s(ecifying)e(the)i(name)g(of)g(a)g
-(compressed)0 3564 y(FITS)g(\014le)f(it)h(is)g(not)g(necessary)h(to)g
-(app)s(end)e(the)i(\014le)e(su\016x)g(\(e.g.,)39 b(`.gz')e(or)e
-(`.Z'\).)i(If)e(CFITSIO)e(cannot)j(\014nd)0 3676 y(the)31
-b(input)f(\014le)g(name)h(without)f(the)i(su\016x,)e(then)h(it)g(will)e
-(automatically)i(searc)m(h)h(for)e(a)i(compressed)f(\014le)f(with)0
-3789 y(the)35 b(same)g(ro)s(ot)g(name.)54 b(In)34 b(the)h(case)h(of)f
-(reading)f(ftp)g(and)h(h)m(ttp)g(t)m(yp)s(e)g(\014les,)g(CFITSIO)e
-(generally)h(lo)s(oks)g(for)0 3902 y(a)41 b(compressed)f(v)m(ersion)g
-(of)h(the)g(\014le)f(\014rst,)j(b)s(efore)d(trying)f(to)j(op)s(en)e
-(the)h(uncompressed)e(\014le.)71 b(By)40 b(default,)0
-4015 y(CFITSIO)d(copies)i(\(and)f(uncompressed)f(if)h(necessary\))h
-(the)g(ftp)f(or)h(h)m(ttp)g(FITS)e(\014le)h(in)m(to)h(memory)f(on)h
-(the)0 4128 y(lo)s(cal)32 b(mac)m(hine)g(b)s(efore)f(op)s(ening)g(it.)
-46 b(This)31 b(will)f(fail)h(if)g(the)h(lo)s(cal)g(mac)m(hine)g(do)s
-(es)g(not)g(ha)m(v)m(e)i(enough)e(memory)0 4241 y(to)d(hold)e(the)i
-(whole)f(FITS)f(\014le,)h(so)h(in)e(this)h(case,)i(the)e(output)g
-(\014lename)g(sp)s(eci\014er)f(\(see)i(the)g(next)g(section\))g(can)0
-4354 y(b)s(e)h(used)f(to)i(further)e(con)m(trol)i(ho)m(w)g(CFITSIO)e
-(reads)h(ftp)g(and)f(h)m(ttp)i(\014les.)0 4514 y(One)g(sp)s(ecial)g
-(case)h(is)f(where)g(the)h(\014lename)f(=)g(`-')i(\(a)f(dash)f(or)h
-(min)m(us)e(sign\),)i(whic)m(h)e(signi\014es)g(that)i(the)g(input)0
-4627 y(\014le)38 b(is)g(to)h(b)s(e)f(read)h(from)f(the)h(stdin)f
-(stream,)j(or)e(written)f(to)h(the)g(stdout)g(stream)g(if)f(a)h(new)g
-(output)f(\014le)g(is)0 4740 y(b)s(eing)e(created.)65
-b(In)37 b(the)h(case)h(of)f(reading)f(from)h(stdin,)g(CFITSIO)e
-(\014rst)i(copies)f(the)h(whole)f(stream)i(in)m(to)f(a)0
-4853 y(temp)s(orary)27 b(FITS)f(\014le)g(\(in)g(memory)h(or)g(on)g
-(disk\),)g(and)f(subsequen)m(t)h(reading)f(of)h(the)g(FITS)f(\014le)h
-(o)s(ccurs)f(in)g(this)0 4966 y(cop)m(y)-8 b(.)51 b(When)34
-b(writing)d(to)k(stdout,)f(CFITSIO)e(\014rst)h(constructs)h(the)f
-(whole)g(\014le)g(in)f(memory)h(\(since)h(random)0 5079
-y(access)j(is)e(required\),)g(then)h(\015ushes)e(it)h(out)h(to)g(the)g
-(stdout)g(stream)g(when)e(the)i(\014le)f(is)f(closed.)57
-b(This)33 b(feature)0 5192 y(allo)m(ws)k(FITS)g(\014les)g(to)i(b)s(e)e
-(pip)s(ed)e(b)s(et)m(w)m(een)k(tasks)f(in)f(memory)h(rather)f(than)h
-(ha)m(ving)f(to)i(create)g(temp)s(orary)0 5304 y(in)m(termediate)30
-b(FITS)f(\014les)g(on)g(disk.)40 b(F)-8 b(or)30 b(example)g(if)f(task1)
-i(creates)g(an)f(output)f(FITS)h(\014le,)f(and)g(task2)i(reads)0
-5417 y(an)f(input)f(FITS)g(\014le,)h(the)h(FITS)e(\014le)h(ma)m(y)h(b)s
-(e)e(pip)s(ed)f(b)s(et)m(w)m(een)j(the)g(2)g(tasks)g(b)m(y)f(sp)s
-(ecifying)143 5714 y Ff(task1)47 b(-)g(|)g(task2)g(-)p
+%%Page: 23 31
+23 30 bop 0 299 a Fh(4.8.)72 b(SUPPOR)-8 b(T)30 b(F)m(OR)g(IEEE)g
+(SPECIAL)f(V)-10 b(ALUES)1863 b Fj(23)0 555 y(rounded)35
+b(to)j(the)f(nearest)h(in)m(teger\).)61 b(The)36 b(\014ts)p
+1673 555 28 4 v 32 w(set)p 1816 555 V 34 w(bscale)h(and)f(\014ts)p
+2430 555 V 32 w(set)p 2573 555 V 34 w(tscale)h(routines)f(\(describ)s
+(ed)f(in)h(the)0 668 y(`Adv)-5 b(anced')29 b(c)m(hapter\))h(ma)m(y)g(b)
+s(e)e(used)h(to)g(o)m(v)m(erride)h(the)f(scaling)f(parameters)h
+(de\014ned)f(in)g(the)h(header)g(\(e.g.,)i(to)0 781 y(turn)e(o\013)i
+(the)g(scaling)e(so)i(that)g(the)f(program)g(can)h(read)f(the)h(ra)m(w)
+f(unscaled)g(v)-5 b(alues)29 b(from)h(the)h(FITS)e(\014le\).)0
+941 y(When)44 b(writing)f(n)m(umerical)g(data)i(to)g(the)g(primary)e
+(arra)m(y)i(or)f(to)h(a)g(table)g(column)e(the)i(data)g(v)-5
+b(alues)44 b(will)0 1054 y(generally)27 b(b)s(e)h(automatically)g(in)m
+(v)m(ersely)g(scaled)g(b)m(y)g(the)g(v)-5 b(alue)28 b(of)g(the)h
+(BSCALE)e(and)h(BZER)m(O)g(\(or)h(TSCALn)0 1167 y(and)35
+b(TZER)m(On\))f(k)m(eyw)m(ord)i(v)-5 b(alues)34 b(if)h(they)g(they)g
+(exist)h(in)e(the)h(header.)55 b(These)35 b(k)m(eyw)m(ords)h(m)m(ust)f
+(ha)m(v)m(e)i(b)s(een)0 1280 y(written)30 b(to)i(the)g(header)f(b)s
+(efore)g(an)m(y)g(data)h(is)f(written)f(for)h(them)g(to)h(ha)m(v)m(e)h
+(an)m(y)e(immediate)g(e\013ect.)45 b(One)30 b(ma)m(y)0
+1393 y(also)g(use)h(the)f(\014ts)p 623 1393 V 33 w(set)p
+767 1393 V 33 w(bscale)h(and)e(\014ts)p 1367 1393 V 33
+w(set)p 1511 1393 V 33 w(tscale)i(routines)f(to)h(de\014ne)f(or)g(o)m
+(v)m(erride)h(the)g(scaling)e(k)m(eyw)m(ords)i(in)0 1506
+y(the)e(header)g(\(e.g.,)i(to)e(turn)f(o\013)h(the)g(scaling)f(so)h
+(that)h(the)f(program)f(can)h(write)f(the)h(ra)m(w)g(unscaled)f(v)-5
+b(alues)28 b(in)m(to)0 1619 y(the)e(FITS)g(\014le\).)39
+b(If)25 b(scaling)g(is)h(p)s(erformed,)f(the)i(in)m(v)m(erse)f(scaled)g
+(output)f(v)-5 b(alue)26 b(that)h(is)e(written)g(in)m(to)h(the)h(FITS)0
+1732 y(\014le)i(will)f(ha)m(v)m(e)430 1992 y Fe(FITS)46
+b(value)h(=)g(\(\(input)f(value\))g(-)h(BZERO\))f(/)i(BSCALE)0
+2252 y Fj(\(a)39 b(corresp)s(onding)c(form)m(ula)i(using)g(TSCALn)f
+(and)h(TZER)m(On)g(is)g(used)g(when)f(writing)g(to)j(table)f
+(columns\).)0 2365 y(Rounding)33 b(to)j(the)g(nearest)g(in)m(teger,)h
+(rather)e(than)g(truncation,)i(is)d(p)s(erformed)g(when)g(writing)f(in)
+m(teger)j(data)0 2478 y(t)m(yp)s(es)30 b(to)i(the)e(FITS)g(\014le.)0
+2812 y Ff(4.8)135 b(Supp)t(ort)44 b(for)h(IEEE)h(Sp)t(ecial)f(V)-11
+b(alues)0 3062 y Fj(The)26 b(ANSI/IEEE-754)h(\015oating-p)s(oin)m(t)f
+(n)m(um)m(b)s(er)f(standard)g(de\014nes)h(certain)g(sp)s(ecial)f(v)-5
+b(alues)25 b(that)i(are)g(used)e(to)0 3175 y(represen)m(t)j(suc)m(h)g
+(quan)m(tities)f(as)h(Not-a-Num)m(b)s(er)h(\(NaN\),)h(denormalized,)d
+(under\015o)m(w,)g(o)m(v)m(er\015o)m(w,)j(and)d(in\014nit)m(y)-8
+b(.)0 3288 y(\(See)29 b(the)f(App)s(endix)d(in)i(the)h(NOST)g(FITS)f
+(standard)g(or)h(the)g(NOST)g(FITS)f(User's)h(Guide)f(for)h(a)g(list)f
+(of)h(these)0 3401 y(v)-5 b(alues\).)54 b(The)34 b(CFITSIO)f(routines)h
+(that)h(read)g(\015oating)f(p)s(oin)m(t)g(data)i(in)d(FITS)h(\014les)g
+(recognize)h(these)h(IEEE)0 3514 y(sp)s(ecial)22 b(v)-5
+b(alues)24 b(and)f(b)m(y)g(default)g(in)m(terpret)h(the)g(o)m(v)m
+(er\015o)m(w)h(and)e(in\014nit)m(y)e(v)-5 b(alues)24
+b(as)g(b)s(eing)e(equiv)-5 b(alen)m(t)23 b(to)i(a)f(NaN,)0
+3627 y(and)36 b(con)m(v)m(ert)i(the)e(under\015o)m(w)f(and)h
+(denormalized)f(v)-5 b(alues)35 b(in)m(to)i(zeros.)59
+b(In)36 b(some)g(cases)i(programmers)d(ma)m(y)0 3740
+y(w)m(an)m(t)d(access)h(to)g(the)e(ra)m(w)h(IEEE)f(v)-5
+b(alues,)31 b(without)g(an)m(y)h(mo)s(di\014cation)e(b)m(y)h(CFITSIO.)f
+(This)g(can)i(b)s(e)f(done)g(b)m(y)0 3853 y(calling)26
+b(the)j(\014ts)p 567 3853 V 32 w(read)p 771 3853 V 33
+w(img)e(or)h(\014ts)p 1209 3853 V 33 w(read)p 1414 3853
+V 32 w(col)g(routines)f(while)f(sp)s(ecifying)g(0.0)j(as)f(the)g(v)-5
+b(alue)28 b(of)g(the)g(NULL)-10 b(V)g(AL)0 3966 y(parameter.)59
+b(This)35 b(will)e(force)k(CFITSIO)e(to)i(simply)d(pass)i(the)h(IEEE)f
+(v)-5 b(alues)35 b(through)h(to)h(the)g(application)0
+4079 y(program)31 b(without)f(an)m(y)i(mo)s(di\014cation.)42
+b(This)29 b(is)i(not)g(fully)e(supp)s(orted)h(on)h(V)-10
+b(AX/VMS)32 b(mac)m(hines,)f(ho)m(w)m(ev)m(er,)0 4192
+y(where)f(there)g(is)g(no)g(easy)h(w)m(a)m(y)g(to)h(b)m(ypass)e(the)g
+(default)g(in)m(terpretation)f(of)i(the)g(IEEE)e(sp)s(ecial)g(v)-5
+b(alues.)0 4526 y Ff(4.9)135 b(Error)46 b(Status)f(V)-11
+b(alues)45 b(and)g(the)g(Error)g(Message)h(Stac)l(k)0
+4776 y Fj(Nearly)35 b(all)f(the)i(CFITSIO)e(routines)g(return)g(an)h
+(error)g(status)h(v)-5 b(alue)34 b(in)g(2)i(w)m(a)m(ys:)51
+b(as)36 b(the)f(v)-5 b(alue)35 b(of)h(the)f(last)0 4889
+y(parameter)29 b(in)e(the)h(function)f(call,)i(and)f(as)g(the)h
+(returned)e(v)-5 b(alue)28 b(of)g(the)h(function)e(itself.)39
+b(This)26 b(pro)m(vides)i(some)0 5002 y(\015exibilit)m(y)33
+b(in)h(the)i(w)m(a)m(y)h(programmers)e(can)h(test)h(if)e(an)g(error)h
+(o)s(ccurred,)g(as)g(illustrated)e(in)g(the)i(follo)m(wing)f(2)0
+5115 y(co)s(de)c(fragmen)m(ts:)191 5375 y Fe(if)47 b(\()h
+(fits_write_record\(fptr,)41 b(card,)46 b(&status\))g(\))430
+5488 y(printf\(")f(Error)h(occurred)g(while)g(writing)g(keyword."\);)0
+5714 y(or,)p eop
+%%Page: 24 32
+24 31 bop 0 299 a Fj(24)1763 b Fh(CHAPTER)29 b(4.)112
+b(PR)m(OGRAMMING)32 b(GUIDELINES)191 668 y Fe(fits_write_record\(fptr,)
+41 b(card,)47 b(&status\);)191 781 y(if)g(\()h(status)e(\))430
+894 y(printf\(")f(Error)h(occurred)g(while)g(writing)g(keyword."\);)0
+1109 y Fj(A)27 b(listing)e(of)j(all)e(the)h(CFITSIO)f(status)i(co)s(de)
+f(v)-5 b(alues)27 b(is)f(giv)m(en)h(at)h(the)g(end)e(of)i(this)e(do)s
+(cumen)m(t.)39 b(Programmers)0 1222 y(are)33 b(encouraged)g(to)g(use)f
+(the)h(sym)m(b)s(olic)d(mnemonics)h(\(de\014ned)h(in)f(\014tsio.h\))h
+(rather)g(than)g(the)h(actual)g(in)m(teger)0 1335 y(status)e(v)-5
+b(alues)29 b(to)j(impro)m(v)m(e)e(the)g(readabilit)m(y)f(of)i(their)e
+(co)s(de.)0 1495 y(The)j(CFITSIO)f(library)e(uses)j(an)g(`inherited)f
+(status')i(con)m(v)m(en)m(tion)g(for)f(the)h(status)f(parameter)h(whic)
+m(h)e(means)0 1608 y(that)37 b(if)e(a)i(routine)e(is)h(called)f(with)g
+(a)i(p)s(ositiv)m(e)e(input)g(v)-5 b(alue)36 b(of)g(the)h(status)f
+(parameter)h(as)g(input,)f(then)g(the)0 1721 y(routine)i(will)d(exit)k
+(immediately)e(without)g(c)m(hanging)i(the)f(v)-5 b(alue)38
+b(of)h(the)g(status)g(parameter.)65 b(Th)m(us,)40 b(if)e(one)0
+1834 y(passes)24 b(the)h(status)g(v)-5 b(alue)24 b(returned)g(from)g
+(eac)m(h)i(CFITSIO)d(routine)g(as)i(input)e(to)i(the)g(next)g(CFITSIO)e
+(routine,)0 1947 y(then)28 b(whenev)m(er)g(an)g(error)g(is)g(detected)h
+(all)f(further)f(CFITSIO)f(pro)s(cessing)h(will)f(cease.)42
+b(This)26 b(con)m(v)m(en)m(tion)k(can)0 2060 y(simplify)f(the)k(error)f
+(c)m(hec)m(king)i(in)d(application)g(programs)h(b)s(ecause)h(it)f(is)g
+(not)h(necessary)g(to)g(c)m(hec)m(k)i(the)d(v)-5 b(alue)0
+2173 y(of)30 b(the)g(status)h(parameter)f(after)h(ev)m(ery)g(single)d
+(CFITSIO)h(routine)g(call.)40 b(If)30 b(a)g(program)g(con)m(tains)g(a)h
+(sequence)0 2285 y(of)d(sev)m(eral)h(CFITSIO)e(calls,)h(one)g(can)h
+(just)e(c)m(hec)m(k)j(the)f(status)f(v)-5 b(alue)28 b(after)h(the)f
+(last)g(call.)39 b(Since)28 b(the)g(returned)0 2398 y(status)33
+b(v)-5 b(alues)32 b(are)h(generally)f(distinctiv)m(e,)g(it)h(should)d
+(b)s(e)j(p)s(ossible)d(to)j(determine)f(whic)m(h)g(routine)g
+(originally)0 2511 y(returned)d(the)i(error)f(status.)0
+2671 y(CFITSIO)c(also)h(main)m(tains)g(an)g(in)m(ternal)f(stac)m(k)j
+(of)f(error)f(messages)h(\(80-c)m(haracter)j(maxim)m(um)26
+b(length\))h(whic)m(h)0 2784 y(in)35 b(man)m(y)h(cases)h(pro)m(vide)e
+(a)h(more)g(detailed)g(explanation)f(of)h(the)g(cause)h(of)f(the)g
+(error)g(than)f(is)g(pro)m(vided)g(b)m(y)0 2897 y(the)40
+b(error)e(status)i(n)m(um)m(b)s(er)e(alone.)68 b(It)39
+b(is)g(recommended)g(that)g(the)h(error)f(message)h(stac)m(k)h(b)s(e)e
+(prin)m(ted)f(out)0 3010 y(whenev)m(er)h(a)g(program)g(detects)h(a)f
+(CFITSIO)e(error.)66 b(The)38 b(function)g(\014ts)p 2653
+3010 28 4 v 32 w(rep)s(ort)p 2931 3010 V 32 w(error)h(will)d(prin)m(t)i
+(out)h(the)0 3123 y(en)m(tire)30 b(error)f(message)h(stac)m(k,)i(or)d
+(alternativ)m(ely)h(one)g(ma)m(y)g(call)f(\014ts)p 2376
+3123 V 32 w(read)p 2580 3123 V 33 w(errmsg)g(to)h(get)h(the)f(error)f
+(messages)0 3236 y(one)i(at)g(a)g(time.)0 3563 y Ff(4.10)136
+b(V)-11 b(ariable-Length)45 b(Arra)l(ys)g(in)g(Binary)g(T)-11
+b(ables)0 3813 y Fj(CFITSIO)33 b(pro)m(vides)h(easy-to-use)i(supp)s
+(ort)d(for)i(reading)f(and)g(writing)f(data)i(in)f(v)-5
+b(ariable)33 b(length)h(\014elds)g(of)h(a)0 3926 y(binary)f(table.)55
+b(The)35 b(v)-5 b(ariable)34 b(length)g(columns)g(ha)m(v)m(e)j(TF)m
+(ORMn)e(k)m(eyw)m(ord)h(v)-5 b(alues)34 b(of)i(the)f(form)g
+(`1Pt\(len\)')0 4039 y(where)25 b(`t')i(is)d(the)i(data)g(t)m(yp)s(e)g
+(co)s(de)g(\(e.g.,)j(I,)c(J,)h(E,)f(D,)i(etc.\))40 b(and)25
+b(`len')h(is)e(an)i(in)m(teger)g(sp)s(ecifying)d(the)j(maxim)m(um)0
+4152 y(length)g(of)h(the)h(v)m(ector)g(in)e(the)h(table.)39
+b(If)27 b(the)g(v)-5 b(alue)26 b(of)h(`len')g(is)f(not)h(sp)s
+(eci\014ed)e(when)h(the)h(table)g(is)f(created)i(\(e.g.,)0
+4264 y(if)33 b(the)h(TF)m(ORM)h(k)m(eyw)m(ord)g(v)-5
+b(alue)33 b(is)g(simply)f(sp)s(eci\014ed)h(as)h('1PE')h(instead)e(of)h
+('1PE\(400\))j(\),)f(then)d(CFITSIO)0 4377 y(will)27
+b(automatically)i(scan)g(the)h(table)f(when)g(it)g(is)f(closed)h(to)h
+(determine)f(the)g(maxim)m(um)f(length)h(of)h(the)f(v)m(ector)0
+4490 y(and)h(will)d(app)s(end)i(this)g(v)-5 b(alue)30
+b(to)h(the)g(TF)m(ORMn)f(v)-5 b(alue.)0 4650 y(The)29
+b(same)h(routines)f(that)h(read)f(and)g(write)g(data)h(in)f(an)g
+(ordinary)f(\014xed)h(length)g(binary)f(table)h(extension)h(are)0
+4763 y(also)40 b(used)e(for)i(v)-5 b(ariable)38 b(length)h(\014elds,)h
+(ho)m(w)m(ev)m(er,)k(the)c(routine)e(parameters)i(tak)m(e)h(on)f(a)g
+(sligh)m(tly)d(di\013eren)m(t)0 4876 y(in)m(terpretation)30
+b(as)g(describ)s(ed)f(b)s(elo)m(w.)0 5036 y(All)35 b(the)h(data)h(in)e
+(a)i(v)-5 b(ariable)35 b(length)g(\014eld)g(is)g(written)h(in)m(to)g
+(an)g(area)h(called)f(the)g(`heap')g(whic)m(h)f(follo)m(ws)h(the)0
+5149 y(main)30 b(\014xed-length)h(FITS)f(binary)g(table.)43
+b(The)31 b(size)g(of)g(the)h(heap,)f(in)f(b)m(ytes,)i(is)f(sp)s
+(eci\014ed)e(b)m(y)i(the)h(PCOUNT)0 5262 y(k)m(eyw)m(ord)21
+b(in)e(the)i(FITS)f(header.)37 b(When)20 b(creating)h(a)g(new)f(binary)
+f(table,)j(the)f(initial)d(v)-5 b(alue)20 b(of)g(PCOUNT)g(should)0
+5375 y(usually)25 b(b)s(e)j(set)g(to)g(zero.)41 b(CFITSIO)26
+b(will)f(recompute)j(the)g(size)f(of)h(the)g(heap)g(as)g(the)g(data)g
+(is)f(written)f(and)i(will)0 5488 y(automatically)d(up)s(date)f(the)i
+(PCOUNT)e(k)m(eyw)m(ord)h(v)-5 b(alue)25 b(when)f(the)h(table)g(is)f
+(closed.)39 b(When)25 b(writing)e(v)-5 b(ariable)0 5601
+y(length)33 b(data)h(to)g(a)g(table,)h(CFITSIO)d(will)e(automatically)k
+(extend)f(the)h(size)f(of)h(the)g(heap)f(area)h(if)f(necessary)-8
+b(,)0 5714 y(so)31 b(that)g(an)m(y)f(follo)m(wing)f(HDUs)i(do)f(not)h
+(get)h(o)m(v)m(erwritten.)p eop
+%%Page: 25 33
+25 32 bop 0 299 a Fh(4.11.)73 b(MUL)-8 b(TIPLE)30 b(A)m(CCESS)f(TO)g
+(THE)i(SAME)f(FITS)f(FILE)1515 b Fj(25)0 555 y(By)30
+b(default)e(the)i(heap)f(data)i(area)f(starts)g(immediately)e(after)i
+(the)f(last)h(ro)m(w)f(of)h(the)g(\014xed-length)e(table.)41
+b(This)0 668 y(default)26 b(starting)g(lo)s(cation)h(ma)m(y)g(b)s(e)f
+(o)m(v)m(erridden)g(b)m(y)h(the)g(THEAP)f(k)m(eyw)m(ord,)i(but)f(this)e
+(is)h(not)h(recommended.)0 781 y(If)34 b(additional)e(ro)m(ws)i(of)g
+(data)h(are)g(added)e(to)i(the)f(table,)i(CFITSIO)c(will)g
+(automatically)i(shift)e(the)j(the)f(heap)0 894 y(do)m(wn)g(to)i(mak)m
+(e)f(ro)s(om)g(for)f(the)h(new)f(ro)m(ws,)i(but)e(it)h(is)e(ob)m
+(viously)h(b)s(e)g(more)h(e\016cien)m(t)g(to)g(initially)c(create)37
+b(the)0 1007 y(table)30 b(with)e(the)i(necessary)g(n)m(um)m(b)s(er)f
+(of)h(blank)e(ro)m(ws,)i(so)g(that)g(the)g(heap)g(do)s(es)f(not)h
+(needed)g(to)g(b)s(e)f(constan)m(tly)0 1120 y(mo)m(v)m(ed.)0
+1280 y(When)g(writing)f(to)i(a)g(v)-5 b(ariable)29 b(length)g(\014eld)f
+(the)i(en)m(tire)f(arra)m(y)h(of)g(v)-5 b(alues)29 b(for)h(a)g(giv)m
+(en)f(ro)m(w)h(of)g(the)g(table)f(m)m(ust)0 1393 y(b)s(e)e(written)f
+(with)h(a)h(single)e(call)g(to)j(\014ts)p 1363 1393 28
+4 v 32 w(write)p 1598 1393 V 32 w(col.)40 b(The)27 b(total)h(length)f
+(of)h(the)g(arra)m(y)g(is)e(giv)m(en)i(b)m(y)f(nelemen)m(ts)g(+)0
+1506 y(\014rstelem)33 b(-)g(1.)51 b(Additional)31 b(elemen)m(ts)j
+(cannot)g(b)s(e)f(app)s(ended)f(to)i(an)f(existing)g(v)m(ector)i(at)f
+(a)g(later)f(time)h(since)0 1619 y(an)m(y)c(attempt)g(to)g(do)f(so)g
+(will)e(simply)f(o)m(v)m(erwrite)k(all)e(the)i(previously)c(written)j
+(data.)41 b(Note)30 b(also)f(that)h(the)f(new)0 1732
+y(data)c(will)d(b)s(e)i(written)g(to)h(a)g(new)f(area)i(of)f(the)f
+(heap)h(and)f(the)h(heap)f(space)h(used)f(b)m(y)h(the)f(previous)g
+(write)f(cannot)0 1844 y(b)s(e)32 b(reclaimed.)45 b(F)-8
+b(or)34 b(this)d(reason)h(eac)m(h)i(ro)m(w)f(of)f(a)h(v)-5
+b(ariable)31 b(length)h(\014eld)f(should)f(only)i(b)s(e)f(written)h
+(once.)47 b(An)0 1957 y(exception)37 b(to)g(this)f(general)g(rule)f(o)s
+(ccurs)i(when)e(setting)i(elemen)m(ts)g(of)g(an)f(arra)m(y)h(as)g
+(unde\014ned.)57 b(One)36 b(m)m(ust)0 2070 y(\014rst)30
+b(write)g(a)i(dumm)m(y)d(v)-5 b(alue)31 b(in)m(to)g(the)g(arra)m(y)g
+(with)f(\014ts)p 1977 2070 V 32 w(write)p 2212 2070 V
+32 w(col,)i(and)e(then)h(call)f(\014ts)p 3086 2070 V
+32 w(write)p 3321 2070 V 32 w(col)p 3464 2070 V 33 w(n)m(ul)g(to)i
+(\015ag)0 2183 y(the)g(desired)e(elemen)m(ts)i(as)g(unde\014ned.)43
+b(\(Do)33 b(not)f(use)g(the)g(\014ts)p 2197 2183 V 32
+w(write)p 2432 2183 V 32 w(coln)m(ull)e(routines)g(with)h(v)-5
+b(ariable)31 b(length)0 2296 y(\014elds\).)45 b(Note)33
+b(that)g(the)f(ro)m(ws)h(of)f(a)g(table,)h(whether)f(\014xed)f(or)h(v)
+-5 b(ariable)31 b(length,)i(do)f(not)g(ha)m(v)m(e)h(to)g(b)s(e)f
+(written)0 2409 y(consecutiv)m(ely)f(and)e(ma)m(y)i(b)s(e)f(written)f
+(in)h(an)m(y)g(order.)0 2569 y(When)40 b(writing)f(to)i(a)g(v)-5
+b(ariable)39 b(length)h(ASCI)s(I)f(c)m(haracter)j(\014eld)d(\(e.g.,)45
+b(TF)m(ORM)c(=)f('1P)-8 b(A'\))43 b(only)c(a)i(single)0
+2682 y(c)m(haracter)22 b(string)d(can)i(b)s(e)e(written.)37
+b(The)20 b(`\014rstelem')f(and)h(`nelemen)m(ts')h(parameter)f(v)-5
+b(alues)20 b(in)f(the)h(\014ts)p 3526 2682 V 33 w(write)p
+3762 2682 V 32 w(col)0 2795 y(routine)34 b(are)i(ignored)e(and)g(the)i
+(n)m(um)m(b)s(er)d(of)j(c)m(haracters)g(to)g(write)e(is)h(simply)d
+(determined)i(b)m(y)h(the)g(length)g(of)0 2908 y(the)c(input)d(n)m
+(ull-terminated)g(c)m(haracter)k(string.)0 3068 y(The)21
+b(\014ts)p 305 3068 V 33 w(write)p 541 3068 V 32 w(descript)f(routine)h
+(is)f(useful)g(in)g(situations)h(where)g(m)m(ultiple)e(ro)m(ws)j(of)g
+(a)g(v)-5 b(ariable)20 b(length)h(column)0 3181 y(ha)m(v)m(e)32
+b(the)e(iden)m(tical)f(arra)m(y)i(of)g(v)-5 b(alues.)40
+b(One)30 b(can)g(simply)e(write)i(the)g(arra)m(y)h(once)g(for)g(the)f
+(\014rst)g(ro)m(w,)g(and)g(then)0 3294 y(use)c(\014ts)p
+280 3294 V 32 w(write)p 515 3294 V 32 w(descript)f(to)h(write)f(the)h
+(same)h(descriptor)d(v)-5 b(alues)26 b(in)m(to)g(the)g(other)g(ro)m
+(ws;)h(all)e(the)h(ro)m(ws)g(will)d(then)0 3407 y(p)s(oin)m(t)29
+b(to)i(the)g(same)g(storage)h(lo)s(cation)e(th)m(us)g(sa)m(ving)g(disk)
+f(space.)0 3567 y(When)35 b(reading)f(from)g(a)i(v)-5
+b(ariable)33 b(length)i(arra)m(y)g(\014eld)f(one)h(can)g(only)g(read)f
+(as)i(man)m(y)f(elemen)m(ts)g(as)g(actually)0 3680 y(exist)h(in)e(that)
+j(ro)m(w)e(of)h(the)g(table;)j(reading)c(do)s(es)h(not)g(automatically)
+f(con)m(tin)m(ue)h(with)f(the)h(next)g(ro)m(w)g(of)g(the)0
+3793 y(table)28 b(as)g(o)s(ccurs)g(when)f(reading)g(an)h(ordinary)f
+(\014xed)g(length)g(table)h(\014eld.)39 b(A)m(ttempts)29
+b(to)g(read)f(more)g(than)g(this)0 3906 y(will)h(cause)k(an)e(error)h
+(status)g(to)g(b)s(e)f(returned.)44 b(One)32 b(can)g(determine)f(the)h
+(n)m(um)m(b)s(er)e(of)i(elemen)m(ts)g(in)f(eac)m(h)i(ro)m(w)0
+4019 y(of)e(a)f(v)-5 b(ariable)29 b(column)h(with)f(the)h(\014ts)p
+1329 4019 V 33 w(read)p 1534 4019 V 32 w(descript)g(routine.)0
+4432 y Ff(4.11)136 b(Multiple)45 b(Access)g(to)g(the)g(Same)h(FITS)d
+(File)0 4698 y Fj(CFITSIO)35 b(supp)s(orts)g(sim)m(ultaneous)g(read)h
+(and)g(write)g(access)h(to)h(m)m(ultiple)c(HDUs)j(in)e(the)i(same)g
+(FITS)f(\014le.)0 4811 y(Th)m(us,)43 b(one)e(can)h(op)s(en)e(the)h
+(same)h(FITS)e(\014le)g(t)m(wice)i(within)c(a)k(single)d(program)i(and)
+g(mo)m(v)m(e)h(to)g(2)f(di\013eren)m(t)0 4924 y(HDUs)30
+b(in)e(the)i(\014le,)f(and)g(then)g(read)h(and)e(write)h(data)h(or)g(k)
+m(eyw)m(ords)g(to)g(the)g(2)f(extensions)h(just)e(as)i(if)f(one)g(w)m
+(ere)0 5036 y(accessing)e(2)g(completely)f(separate)h(FITS)f(\014les.)
+38 b(Since)26 b(in)f(general)h(it)g(is)g(not)h(p)s(ossible)d(to)j(ph)m
+(ysically)d(op)s(en)i(the)0 5149 y(same)36 b(\014le)f(t)m(wice)h(and)f
+(then)g(exp)s(ect)h(to)g(b)s(e)f(able)g(to)i(sim)m(ultaneously)c(\(or)j
+(in)e(alternating)h(succession\))h(write)0 5262 y(to)f(2)f(di\013eren)m
+(t)g(lo)s(cations)g(in)e(the)j(\014le,)f(CFITSIO)f(recognizes)i(when)e
+(the)h(\014le)f(to)i(b)s(e)f(op)s(ened)f(\(in)g(the)i(call)e(to)0
+5375 y(\014ts)p 127 5375 V 32 w(op)s(en)p 349 5375 V
+33 w(\014le\))28 b(has)g(already)g(b)s(een)g(op)s(ened)g(and)g(instead)
+g(of)h(actually)f(op)s(ening)f(the)i(\014le)f(again,)h(just)f
+(logically)0 5488 y(links)g(the)j(new)f(\014le)g(to)h(the)g(old)e
+(\014le.)41 b(\(This)29 b(only)h(applies)e(if)i(the)h(\014le)e(is)h(op)
+s(ened)g(more)g(than)g(once)i(within)c(the)0 5601 y(same)g(program,)g
+(and)f(do)s(es)h(not)f(prev)m(en)m(t)i(the)f(same)g(\014le)e(from)h(b)s
+(eing)g(sim)m(ultaneously)e(op)s(ened)i(b)m(y)g(more)h(than)0
+5714 y(one)h(program\).)40 b(Then)28 b(b)s(efore)g(CFITSIO)f(reads)h
+(or)h(writes)f(to)h(either)f(\(logical\))h(\014le,)f(it)g(mak)m(es)i
+(sure)d(that)j(an)m(y)p eop
+%%Page: 26 34
+26 33 bop 0 299 a Fj(26)1763 b Fh(CHAPTER)29 b(4.)112
+b(PR)m(OGRAMMING)32 b(GUIDELINES)0 555 y Fj(mo)s(di\014cations)e(made)h
+(to)h(the)g(other)g(\014le)e(ha)m(v)m(e)j(b)s(een)e(completely)g
+(\015ushed)e(from)i(the)h(in)m(ternal)e(bu\013ers)h(to)h(the)0
+668 y(\014le.)43 b(Th)m(us,)30 b(in)g(principle,)f(one)i(could)f(op)s
+(en)h(a)h(\014le)e(t)m(wice,)i(in)e(one)i(case)g(p)s(oin)m(ting)e(to)i
+(the)f(\014rst)g(extension)g(and)0 781 y(in)i(the)i(other)g(p)s(oin)m
+(ting)d(to)k(the)e(2nd)g(extension)h(and)e(then)i(write)e(data)j(to)f
+(b)s(oth)f(extensions,)h(in)e(an)m(y)i(order,)0 894 y(without)24
+b(danger)i(of)f(corrupting)g(the)g(\014le,)h(There)f(ma)m(y)h(b)s(e)f
+(some)h(e\016ciency)f(p)s(enalties)f(in)g(doing)h(this)f(ho)m(w)m(ev)m
+(er,)0 1007 y(since)j(CFITSIO)g(has)h(to)h(\015ush)d(all)h(the)h(in)m
+(ternal)f(bu\013ers)g(related)h(to)h(one)f(\014le)f(b)s(efore)h(switc)m
+(hing)e(to)j(the)f(other,)0 1120 y(so)i(it)g(w)m(ould)f(still)f(b)s(e)i
+(pruden)m(t)f(to)i(minimize)d(the)i(n)m(um)m(b)s(er)f(of)i(times)e(one)
+i(switc)m(hes)f(bac)m(k)h(and)e(forth)h(b)s(et)m(w)m(een)0
+1233 y(doing)f(I/O)i(to)g(di\013eren)m(t)f(HDUs)h(in)e(the)h(same)h
+(\014le.)0 1571 y Ff(4.12)136 b(When)44 b(the)h(Final)h(Size)f(of)g
+(the)g(FITS)f(HDU)h(is)g(Unkno)l(wn)0 1822 y Fj(It)27
+b(is)g(not)g(required)e(to)j(kno)m(w)f(the)h(total)g(size)f(of)g(a)h
+(FITS)e(data)i(arra)m(y)g(or)f(table)g(b)s(efore)g(b)s(eginning)d(to)k
+(write)f(the)0 1935 y(data)32 b(to)f(the)g(FITS)f(\014le.)42
+b(In)30 b(the)h(case)h(of)f(the)g(primary)e(arra)m(y)i(or)g(an)f(image)
+i(extension,)e(one)i(should)c(initially)0 2047 y(create)j(the)e(arra)m
+(y)h(with)d(the)j(size)f(of)g(the)g(highest)f(dimension)f(\(largest)j
+(NAXISn)e(k)m(eyw)m(ord\))i(set)g(to)g(a)f(dumm)m(y)0
+2160 y(v)-5 b(alue,)25 b(suc)m(h)f(as)g(1.)39 b(Then)23
+b(after)i(all)e(the)i(data)f(ha)m(v)m(e)i(b)s(een)d(written)g(and)h
+(the)g(true)g(dimensions)e(are)i(kno)m(wn,)h(then)0 2273
+y(the)33 b(NAXISn)f(v)-5 b(alue)32 b(should)f(b)s(e)h(up)s(dated)g
+(using)f(the)i(\014ts)p 2069 2273 28 4 v 33 w(up)s(date)p
+2378 2273 V 32 w(k)m(ey)g(routine)f(b)s(efore)h(mo)m(ving)f(to)i
+(another)0 2386 y(extension)c(or)g(closing)g(the)g(FITS)g(\014le.)0
+2546 y(When)f(writing)e(to)i(FITS)g(tables,)g(CFITSIO)e(automatically)i
+(k)m(eeps)h(trac)m(k)g(of)f(the)g(highest)g(ro)m(w)g(n)m(um)m(b)s(er)e
+(that)0 2659 y(is)k(written)g(to,)i(and)e(will)e(increase)j(the)g(size)
+g(of)g(the)g(table)f(if)g(necessary)-8 b(.)46 b(CFITSIO)30
+b(will)f(also)j(automatically)0 2772 y(insert)j(space)i(in)e(the)h
+(FITS)f(\014le)h(if)f(necessary)-8 b(,)39 b(to)e(ensure)e(that)i(the)f
+(data)h('heap',)h(if)d(it)h(exists,)h(and/or)g(an)m(y)0
+2885 y(additional)26 b(HDUs)j(that)g(follo)m(w)e(the)i(table)f(do)g
+(not)h(get)g(o)m(v)m(erwritten)g(as)f(new)g(ro)m(ws)g(are)h(written)e
+(to)i(the)g(table.)0 3045 y(As)37 b(a)h(general)f(rule)f(it)h(is)f(b)s
+(est)h(to)h(sp)s(ecify)e(the)i(initial)c(n)m(um)m(b)s(er)i(of)i(ro)m
+(ws)f(=)g(0)g(when)g(the)g(table)g(is)g(created,)0 3158
+y(then)h(let)g(CFITSIO)f(k)m(eep)i(trac)m(k)g(of)g(the)f(n)m(um)m(b)s
+(er)f(of)i(ro)m(ws)f(that)h(are)f(actually)g(written.)64
+b(The)38 b(application)0 3271 y(program)e(should)e(not)j(man)m(ually)e
+(up)s(date)g(the)i(n)m(um)m(b)s(er)e(of)h(ro)m(ws)g(in)f(the)i(table)f
+(\(as)h(giv)m(en)f(b)m(y)g(the)h(NAXIS2)0 3384 y(k)m(eyw)m(ord\))j
+(since)e(CFITSIO)f(do)s(es)i(this)f(automatically)-8
+b(.)66 b(If)38 b(a)i(table)e(is)g(initially)e(created)k(with)d(more)i
+(than)0 3497 y(zero)i(ro)m(ws,)j(then)c(this)g(will)d(usually)i(b)s(e)h
+(considered)f(as)i(the)g(minim)m(um)d(size)i(of)h(the)g(table,)i(ev)m
+(en)e(if)f(few)m(er)0 3610 y(ro)m(ws)30 b(are)g(actually)f(written)g
+(to)i(the)f(table.)40 b(Th)m(us,)30 b(if)e(a)j(table)e(is)g(initially)d
+(created)31 b(with)e(NAXIS2)h(=)f(20,)j(and)0 3723 y(CFITSIO)f(only)h
+(writes)f(10)j(ro)m(ws)e(of)h(data)g(b)s(efore)f(closing)g(the)h
+(table,)g(then)f(NAXIS2)h(will)d(remain)h(equal)h(to)0
+3836 y(20.)50 b(If)33 b(ho)m(w)m(ev)m(er,)i(30)g(ro)m(ws)e(of)g(data)h
+(are)g(written)e(to)i(this)e(table,)i(then)f(NAXIS2)h(will)c(b)s(e)j
+(increased)f(from)h(20)0 3949 y(to)f(30.)44 b(The)31
+b(one)g(exception)h(to)g(this)e(automatic)i(up)s(dating)d(of)i(the)h
+(NAXIS2)f(k)m(eyw)m(ord)h(is)e(if)g(the)i(application)0
+4061 y(program)c(directly)e(mo)s(di\014es)g(the)j(v)-5
+b(alue)27 b(of)h(NAXIS2)g(\(up)f(or)h(do)m(wn\))g(itself)f(just)g(b)s
+(efore)h(closing)f(the)h(table.)40 b(In)0 4174 y(this)27
+b(case,)j(CFITSIO)d(do)s(es)h(not)h(up)s(date)e(NAXIS2)i(again,)g
+(since)f(it)g(assumes)g(that)h(the)f(application)f(program)0
+4287 y(m)m(ust)32 b(ha)m(v)m(e)h(had)f(a)g(go)s(o)s(d)g(reason)h(for)f
+(c)m(hanging)g(the)g(v)-5 b(alue)32 b(directly)-8 b(.)45
+b(This)30 b(is)h(not)i(recommended,)f(ho)m(w)m(ev)m(er,)0
+4400 y(and)j(is)g(only)g(pro)m(vided)g(for)g(bac)m(kw)m(ard)h
+(compatibilit)m(y)e(with)h(soft)m(w)m(are)i(that)g(initially)32
+b(creates)37 b(a)f(table)g(with)0 4513 y(a)e(large)g(n)m(um)m(b)s(er)f
+(of)h(ro)m(ws,)h(than)f(decreases)g(the)h(NAXIS2)f(v)-5
+b(alue)33 b(to)i(the)f(actual)g(smaller)f(v)-5 b(alue)33
+b(just)g(b)s(efore)0 4626 y(closing)c(the)i(table.)0
+4964 y Ff(4.13)136 b(CFITSIO)44 b(Size)h(Limitations)0
+5215 y Fj(CFITSIO)29 b(places)i(v)m(ery)g(few)g(restrictions)e(on)i
+(the)g(size)f(of)h(FITS)f(\014les)g(that)h(it)g(reads)f(or)h(writes.)41
+b(There)30 b(are)i(a)0 5328 y(few)e(limits,)e(ho)m(w)m(ev)m(er,)k(that)
+f(ma)m(y)g(a\013ect)h(some)f(extreme)g(cases:)0 5488
+y(1.)43 b(The)31 b(maxim)m(um)f(n)m(um)m(b)s(er)g(of)h(FITS)f(\014les)g
+(that)i(ma)m(y)g(b)s(e)e(sim)m(ultaneously)f(op)s(ened)i(b)m(y)g
+(CFITSIO)e(is)h(set)i(b)m(y)0 5601 y(NMAXFILES)i(as)g(de\014ned)f(in)g
+(\014tsio2.h.)51 b(It)34 b(is)f(curren)m(tly)g(set)i(=)f(300)h(b)m(y)f
+(default.)51 b(CFITSIO)32 b(will)f(allo)s(cate)0 5714
+y(ab)s(out)i(80)g(*)h(NMAXFILES)f(b)m(ytes)g(of)g(memory)g(for)g(in)m
+(ternal)e(use.)48 b(Note)34 b(that)g(the)f(underlying)d(C)i(compiler)p
 eop
-%%Page: 22 28
-22 27 bop 0 299 a Fj(22)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(where)30
-b(the)h(v)m(ertical)g(bar)g(is)e(the)i(Unix)f(piping)e(sym)m(b)s(ol.)41
-b(This)29 b(assumes)h(that)i(the)f(2)g(tasks)g(read)g(the)g(name)g(of)0
-668 y(the)g(FITS)e(\014le)h(o\013)g(of)h(the)g(command)f(line.)0
-957 y Fd(4.2.3)112 b(Output)38 b(File)e(Name)h(when)h(Op)s(ening)g(an)g
-(Existing)e(File)0 1176 y Fj(An)g(optional)g(output)g(\014lename)g(ma)m
-(y)i(b)s(e)e(sp)s(eci\014ed)f(in)g(paren)m(theses)i(immediately)e
-(follo)m(wing)g(the)i(base)g(\014le)0 1289 y(name)28
-b(to)h(b)s(e)f(op)s(ened.)39 b(This)27 b(is)g(mainly)f(useful)h(in)g
-(those)h(cases)i(where)d(CFITSIO)g(creates)j(a)e(temp)s(orary)g(cop)m
-(y)0 1402 y(of)i(the)f(input)f(FITS)g(\014le)h(b)s(efore)g(it)g(is)f
-(op)s(ened)h(and)f(passed)h(to)h(the)g(application)e(program.)40
-b(This)27 b(happ)s(ens)h(b)m(y)0 1515 y(default)h(when)h(op)s(ening)f
-(a)h(net)m(w)m(ork)h(FTP)g(or)f(HTTP-t)m(yp)s(e)g(\014le,)g(when)f
-(reading)g(a)i(compressed)f(FITS)g(\014le)f(on)0 1628
-y(a)36 b(lo)s(cal)f(disk,)h(when)f(reading)g(from)h(the)g(stdin)e
-(stream,)k(or)d(when)g(a)i(column)d(\014lter,)j(ro)m(w)f(\014lter,)g
-(or)g(binning)0 1741 y(sp)s(eci\014er)28 b(is)g(included)f(as)j(part)f
-(of)g(the)h(input)e(\014le)g(sp)s(eci\014cation.)39 b(By)30
-b(default)f(this)f(temp)s(orary)h(\014le)f(is)h(created)0
-1853 y(in)g(memory)-8 b(.)41 b(If)29 b(there)h(is)f(not)h(enough)g
-(memory)g(to)h(create)g(the)g(\014le)e(cop)m(y)-8 b(,)31
-b(then)f(CFITSIO)e(will)f(exit)j(with)f(an)0 1966 y(error.)45
-b(In)32 b(these)g(cases)h(one)g(can)f(force)h(a)f(p)s(ermanen)m(t)g
-(\014le)f(to)i(b)s(e)e(created)i(on)f(disk,)f(instead)h(of)g(a)g(temp)s
-(orary)0 2079 y(\014le)37 b(in)f(memory)-8 b(,)40 b(b)m(y)d(supplying)d
-(the)k(name)g(in)e(paren)m(theses)i(immediately)e(follo)m(wing)g(the)h
-(base)h(\014le)f(name.)0 2192 y(The)30 b(output)g(\014lename)f(can)i
-(include)d(the)j(')10 b(!')41 b(clobb)s(er)29 b(\015ag.)0
-2352 y(Th)m(us,)h(if)f(the)h(input)f(\014lename)g(to)j(CFITSIO)c(is:)
-191 2602 y Ff(file1.fits.gz\(file2.fits)o(\))0 2851 y
-Fj(then)41 b(CFITSIO)f(will)e(uncompress)i(`\014le1.\014ts.gz')i(in)m
-(to)g(the)f(lo)s(cal)f(disk)g(\014le)g(`\014le2.\014ts')i(b)s(efore)e
-(op)s(ening)g(it.)0 2964 y(CFITSIO)34 b(do)s(es)i(not)g(automatically)g
-(delete)h(the)f(output)f(\014le,)i(so)f(it)g(will)d(still)h(exist)i
-(after)g(the)h(application)0 3077 y(program)30 b(exits.)0
-3237 y(In)35 b(some)i(cases,)h(sev)m(eral)e(di\013eren)m(t)g(temp)s
-(orary)f(FITS)h(\014les)f(will)e(b)s(e)i(created)i(in)e(sequence,)j
-(for)e(instance,)h(if)0 3350 y(one)g(op)s(ens)g(a)g(remote)h(\014le)e
-(using)g(FTP)-8 b(,)37 b(then)g(\014lters)f(ro)m(ws)h(in)f(a)i(binary)d
-(table)i(extension,)i(then)d(create)j(an)0 3463 y(image)e(b)m(y)g
-(binning)d(a)j(pair)f(of)h(columns.)59 b(In)36 b(this)g(case,)k(the)d
-(remote)h(\014le)e(will)e(b)s(e)i(copied)g(to)i(a)f(temp)s(orary)0
-3576 y(lo)s(cal)h(\014le,)i(then)e(a)h(second)f(temp)s(orary)h(\014le)e
-(will)f(b)s(e)i(created)i(con)m(taining)e(the)g(\014ltered)g(ro)m(ws)g
-(of)h(the)g(table,)0 3688 y(and)c(\014nally)e(a)j(third)d(temp)s(orary)
-i(\014le)g(con)m(taining)f(the)i(binned)d(image)i(will)e(b)s(e)i
-(created.)57 b(In)34 b(cases)i(lik)m(e)f(this)0 3801
-y(where)28 b(m)m(ultiple)e(\014les)h(are)i(created,)h(the)e(out\014le)g
-(sp)s(eci\014er)f(will)e(b)s(e)j(in)m(terpreted)g(the)g(name)g(of)h
-(the)f(\014nal)f(\014le)h(as)0 3914 y(describ)s(ed)g(b)s(elo)m(w,)i(in)
-f(descending)g(priorit)m(y:)136 4164 y Fc(\017)46 b Fj(as)29
-b(the)g(name)g(of)g(the)g(\014nal)e(image)i(\014le)f(if)f(an)i(image)g
-(within)d(a)j(single)e(binary)g(table)i(cell)f(is)f(op)s(ened)h(or)h
-(if)227 4276 y(an)i(image)f(is)g(created)h(b)m(y)f(binning)e(a)i(table)
-h(column.)136 4461 y Fc(\017)46 b Fj(as)33 b(the)f(name)h(of)f(the)h
-(\014le)e(con)m(taining)h(the)g(\014ltered)f(table)i(if)e(a)i(column)e
-(\014lter)g(and/or)h(a)h(ro)m(w)f(\014lter)g(are)227
-4574 y(sp)s(eci\014ed.)136 4758 y Fc(\017)46 b Fj(as)31
-b(the)f(name)h(of)f(the)h(lo)s(cal)f(cop)m(y)h(of)f(the)h(remote)g(FTP)
-f(or)h(HTTP)e(\014le.)136 4942 y Fc(\017)46 b Fj(as)31
-b(the)g(name)g(of)g(the)f(uncompressed)g(v)m(ersion)g(of)h(the)f(FITS)g
-(\014le,)g(if)g(a)h(compressed)f(FITS)g(\014le)g(on)h(lo)s(cal)227
-5055 y(disk)e(has)h(b)s(een)g(op)s(ened.)136 5239 y Fc(\017)46
-b Fj(otherwise,)30 b(the)h(output)f(\014lename)f(is)h(ignored.)0
-5488 y(The)f(output)f(\014le)g(sp)s(eci\014er)g(is)g(useful)f(when)h
-(reading)g(FTP)h(or)g(HTTP-t)m(yp)s(e)g(FITS)f(\014les)g(since)g(it)h
-(can)g(b)s(e)g(used)0 5601 y(to)34 b(create)i(a)e(lo)s(cal)f(disk)f
-(cop)m(y)j(of)f(the)g(\014le)e(that)j(can)f(b)s(e)f(reused)g(in)f(the)i
-(future.)50 b(If)33 b(the)h(output)g(\014le)e(name)i(=)0
-5714 y(`*')i(then)f(a)g(lo)s(cal)f(\014le)g(with)g(the)h(same)g(name)g
-(as)g(the)h(net)m(w)m(ork)f(\014le)f(will)f(b)s(e)h(created.)56
-b(Note)36 b(that)f(CFITSIO)p eop
-%%Page: 23 29
-23 28 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(23)0 555 y(will)27 b(b)s(eha)m(v)m(e)j(di\013eren)m(tly)
-f(dep)s(ending)e(on)j(whether)f(the)h(remote)g(\014le)f(is)g
-(compressed)g(or)h(not)g(as)g(sho)m(wn)f(b)m(y)h(the)0
-668 y(follo)m(wing)f(examples:)136 905 y Fc(\017)46 b
-Fj(`ftp://remote.mac)m(hine/tmp/m)m(y\014le.\014ts.gz\(*\)')i(-)43
-b(the)g(remote)h(compressed)f(\014le)f(is)g(copied)h(to)h(the)227
-1018 y(lo)s(cal)24 b(compressed)g(\014le)f(`m)m(y\014le.\014ts.gz',)k
-(whic)m(h)c(is)g(then)i(uncompressed)e(in)g(lo)s(cal)g(memory)h(b)s
-(efore)g(b)s(eing)227 1131 y(op)s(ened)30 b(and)g(passed)g(to)h(the)f
-(application)f(program.)136 1321 y Fc(\017)46 b Fj(`ftp://remote.mac)m
-(hine/tmp/m)m(y\014le.\014ts.gz\(m)m(y\014le.\014ts\)')40
-b(-)d(the)g(remote)g(compressed)f(\014le)g(is)f(copied)227
-1434 y(and)i(uncompressed)g(in)m(to)g(the)h(lo)s(cal)f(\014le)g(`m)m
-(y\014le.\014ts'.)63 b(This)35 b(example)j(requires)e(less)h(lo)s(cal)g
-(memory)227 1547 y(than)30 b(the)h(previous)e(example)h(since)g(the)g
-(\014le)g(is)f(uncompressed)g(on)h(disk)f(instead)h(of)g(in)g(memory)-8
-b(.)136 1737 y Fc(\017)46 b Fj(`ftp://remote.mac)m(hine/tmp/m)m
-(y\014le.\014ts\(m)m(y\014le.\014ts.gz\)')25 b(-)c(this)f(will)f
-(usually)g(pro)s(duce)h(an)h(error)g(since)227 1850 y(CFITSIO)29
-b(itself)g(cannot)i(compress)f(\014les.)0 2087 y(The)36
-b(exact)i(b)s(eha)m(vior)d(of)i(CFITSIO)e(in)g(the)i(latter)f(case)i
-(dep)s(ends)c(on)j(the)f(t)m(yp)s(e)h(of)g(ftp)f(serv)m(er)g(running)e
-(on)0 2200 y(the)d(remote)g(mac)m(hine)f(and)g(ho)m(w)g(it)g(is)f
-(con\014gured.)40 b(In)30 b(some)h(cases,)g(if)e(the)i(\014le)e(`m)m
-(y\014le.\014ts.gz')j(exists)e(on)g(the)0 2312 y(remote)38
-b(mac)m(hine,)g(then)f(the)g(serv)m(er)g(will)e(cop)m(y)i(it)g(to)g
-(the)h(lo)s(cal)e(mac)m(hine.)60 b(In)36 b(other)h(cases)h(the)f(ftp)g
-(serv)m(er)0 2425 y(will)c(automatically)j(create)h(and)f(transmit)f(a)
-h(compressed)g(v)m(ersion)f(of)h(the)g(\014le)f(if)g(only)g(the)h
-(uncompressed)0 2538 y(v)m(ersion)26 b(exists.)40 b(This)25
-b(can)i(get)h(rather)f(confusing,)g(so)g(users)f(should)f(use)i(a)g
-(certain)g(amoun)m(t)h(of)f(caution)g(when)0 2651 y(using)33
-b(the)i(output)f(\014le)g(sp)s(eci\014er)f(with)h(FTP)g(or)h(HTTP)f
-(\014le)g(t)m(yp)s(es,)i(to)f(mak)m(e)h(sure)e(they)h(get)h(the)f(b)s
-(eha)m(vior)0 2764 y(that)c(they)g(exp)s(ect.)0 3058
-y Fd(4.2.4)112 b(T)-9 b(emplate)37 b(File)f(Name)h(when)h(Creating)f(a)
-g(New)g(File)0 3277 y Fj(When)h(a)h(new)f(FITS)g(\014le)g(is)g(created)
-h(with)f(a)g(call)g(to)i(\014ts)p 2101 3277 28 4 v 32
-w(create)p 2369 3277 V 35 w(\014le,)f(the)g(name)g(of)g(a)g(template)g
-(\014le)e(ma)m(y)0 3390 y(b)s(e)i(supplied)e(in)i(paren)m(theses)h
-(immediately)e(follo)m(wing)g(the)j(name)f(of)g(the)g(new)f(\014le)g
-(to)i(b)s(e)e(created.)71 b(This)0 3503 y(template)26
-b(is)e(used)h(to)h(de\014ne)f(the)h(structure)f(of)h(one)f(or)h(more)g
-(HDUs)g(in)e(the)i(new)f(\014le.)38 b(The)25 b(template)h(\014le)e(ma)m
-(y)0 3616 y(b)s(e)32 b(another)h(FITS)f(\014le,)h(in)f(whic)m(h)f(case)
-j(the)f(newly)f(created)i(\014le)e(will)e(ha)m(v)m(e)k(exactly)g(the)f
-(same)g(k)m(eyw)m(ords)g(in)0 3729 y(eac)m(h)25 b(HDU)g(as)g(in)e(the)h
-(template)h(FITS)e(\014le,)i(but)e(all)h(the)g(data)h(units)d(will)g(b)
-s(e)i(\014lled)e(with)g(zeros.)40 b(The)24 b(template)0
-3842 y(\014le)h(ma)m(y)i(also)f(b)s(e)f(an)h(ASCI)s(I)e(text)j(\014le,)
-f(where)g(eac)m(h)h(line)d(\(in)h(general\))i(describ)s(es)d(one)i
-(FITS)f(k)m(eyw)m(ord)i(record.)0 3955 y(The)j(format)h(of)f(the)h
-(ASCI)s(I)e(template)h(\014le)g(is)f(describ)s(ed)f(b)s(elo)m(w.)0
-4245 y Fi(Detailed)34 b(T)-9 b(emplate)34 b(Line)h(F)-9
-b(ormat)0 4465 y Fj(The)30 b(format)h(of)f(eac)m(h)i(ASCI)s(I)c
-(template)j(line)e(closely)h(follo)m(ws)f(the)i(format)g(of)f(a)h(FITS)
-f(k)m(eyw)m(ord)g(record:)95 4727 y Ff(KEYWORD)46 b(=)i(KEYVALUE)d(/)j
-(COMMENT)0 4989 y Fj(except)22 b(that)g(free)g(format)f(ma)m(y)h(b)s(e)
-f(used)f(\(e.g.,)25 b(the)d(equals)e(sign)h(ma)m(y)g(app)s(ear)g(at)h
-(an)m(y)g(p)s(osition)d(in)h(the)i(line\))e(and)0 5102
-y(T)-8 b(AB)34 b(c)m(haracters)g(are)g(allo)m(w)m(ed)f(and)g(are)g
-(treated)h(the)g(same)f(as)h(space)f(c)m(haracters.)51
-b(The)33 b(KEYV)-10 b(ALUE)33 b(and)0 5215 y(COMMENT)d(\014elds)f(are)i
-(optional.)41 b(The)30 b(equals)g(sign)f(c)m(haracter)k(is)c(also)i
-(optional,)f(but)g(it)g(is)f(recommended)0 5328 y(that)42
-b(it)e(b)s(e)h(included)d(for)j(clarit)m(y)-8 b(.)73
-b(An)m(y)41 b(template)h(line)d(that)j(b)s(egins)e(with)f(the)j(p)s
-(ound)d('#')i(c)m(haracter)i(is)0 5441 y(ignored)29 b(b)m(y)i(the)f
-(template)h(parser)f(and)g(ma)m(y)h(b)s(e)e(use)h(to)h(insert)f(commen)
-m(ts)h(in)m(to)f(the)h(template)g(\014le)e(itself.)0
-5601 y(The)d(KEYW)m(ORD)g(name)g(\014eld)f(is)g(limited)f(to)j(8)f(c)m
-(haracters)h(in)e(length)h(and)f(only)g(the)h(letters)h(A-Z,)f(digits)f
-(0-9,)0 5714 y(and)j(the)g(h)m(yphen)f(and)h(underscore)g(c)m
-(haracters)h(ma)m(y)g(b)s(e)f(used,)g(without)g(an)m(y)g(em)m(b)s
-(edded)g(spaces.)40 b(Lo)m(w)m(ercase)p eop
-%%Page: 24 30
-24 29 bop 0 299 a Fj(24)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(letters)21
-b(in)f(the)i(template)f(k)m(eyw)m(ord)h(name)f(will)d(b)s(e)j(con)m(v)m
-(erted)i(to)f(upp)s(ercase.)36 b(Leading)21 b(spaces)g(in)f(the)i
-(template)0 668 y(line)i(preceding)h(the)g(k)m(eyw)m(ord)h(name)g(are)g
-(generally)f(ignored,)h(except)g(if)f(the)h(\014rst)f(8)h(c)m
-(haracters)h(of)f(a)g(template)0 781 y(line)d(are)j(all)e(blank,)h
-(then)g(the)g(en)m(tire)g(line)f(is)g(treated)i(as)f(a)h(FITS)e(commen)
-m(t)i(k)m(eyw)m(ord)g(\(with)e(a)i(blank)d(k)m(eyw)m(ord)0
-894 y(name\))31 b(and)f(is)f(copied)h(v)m(erbatim)g(in)m(to)g(the)h
-(FITS)e(header.)0 1054 y(The)37 b(KEYV)-10 b(ALUE)37
-b(\014eld)f(ma)m(y)i(ha)m(v)m(e)g(an)m(y)g(allo)m(w)m(ed)f(FITS)g(data)
-h(t)m(yp)s(e:)54 b(c)m(haracter)39 b(string,)g(logical,)f(in)m(teger,)0
-1167 y(real,)33 b(complex)f(in)m(teger,)i(or)e(complex)h(real.)46
-b(The)32 b(c)m(haracter)j(string)c(v)-5 b(alues)32 b(need)g(not)h(b)s
-(e)f(enclosed)g(in)f(single)0 1280 y(quote)e(c)m(haracters)h(unless)d
-(they)h(are)h(necessary)g(to)g(distinguish)24 b(the)29
-b(string)e(from)h(a)h(di\013eren)m(t)f(data)h(t)m(yp)s(e)f(\(e.g.)0
-1393 y(2.0)h(is)d(a)i(real)g(but)f('2.0')i(is)e(a)h(string\).)39
-b(The)27 b(k)m(eyw)m(ord)h(has)f(an)h(unde\014ned)d(\(n)m(ull\))h(v)-5
-b(alue)28 b(if)e(the)i(template)g(record)0 1506 y(only)h(con)m(tains)i
-(blanks)e(follo)m(wing)g(the)h("=")h(or)g(b)s(et)m(w)m(een)g(the)f("=")
-h(and)f(the)g("/")i(commen)m(t)g(\014eld)c(delimiter.)0
-1666 y(String)d(k)m(eyw)m(ord)i(v)-5 b(alues)26 b(longer)g(than)g(68)h
-(c)m(haracters)h(\(the)f(maxim)m(um)e(length)h(that)h(will)d(\014t)i
-(in)f(a)i(single)e(FITS)0 1779 y(k)m(eyw)m(ord)41 b(record\))g(are)g(p)
-s(ermitted)e(using)g(the)i(CFITSIO)e(long)h(string)g(con)m(v)m(en)m
-(tion.)73 b(They)40 b(can)h(either)f(b)s(e)0 1892 y(sp)s(eci\014ed)27
-b(as)j(a)f(single)f(long)g(line)g(in)f(the)j(template,)g(or)f(b)m(y)f
-(using)g(m)m(ultiple)f(lines)g(where)h(the)i(con)m(tin)m(uing)e(lines)0
-2005 y(con)m(tain)j(the)f('CONTINUE')g(k)m(eyw)m(ord,)h(as)g(in)e(this)
-g(example:)95 2257 y Ff(LONGKEY)46 b(=)i('This)e(is)h(a)h(long)e
-(string)g(value)h(that)f(is)i(contin&')95 2370 y(CONTINUE)94
-b('ued)46 b(over)h(2)g(records')f(/)h(comment)f(field)h(goes)f(here)0
-2622 y Fj(The)29 b(format)h(of)g(template)g(lines)d(with)i(CONTINUE)f
-(k)m(eyw)m(ord)i(is)f(v)m(ery)h(strict:)40 b(3)30 b(spaces)g(m)m(ust)f
-(follo)m(w)g(CON-)0 2735 y(TINUE)h(and)g(the)g(rest)h(of)f(the)h(line)e
-(is)g(copied)h(v)m(erbatim)g(to)h(the)g(FITS)e(\014le.)0
-2895 y(The)i(start)h(of)g(the)f(optional)g(COMMENT)g(\014eld)f(m)m(ust)
-i(b)s(e)e(preceded)i(b)m(y)f("/",)i(whic)m(h)d(is)h(used)g(to)h
-(separate)g(it)0 3008 y(from)e(the)g(k)m(eyw)m(ord)h(v)-5
-b(alue)29 b(\014eld.)40 b(Exceptions)29 b(are)i(if)e(the)i(KEYW)m(ORD)g
-(name)f(\014eld)f(con)m(tains)h(COMMENT,)0 3121 y(HISTOR)-8
-b(Y,)30 b(CONTINUE,)g(or)g(if)f(the)i(\014rst)f(8)g(c)m(haracters)i(of)
-f(the)f(template)h(line)e(are)i(blanks.)0 3281 y(More)c(than)f(one)h
-(Header-Data)i(Unit)d(\(HDU\))h(ma)m(y)g(b)s(e)f(de\014ned)f(in)g(the)i
-(template)g(\014le.)38 b(The)26 b(start)h(of)g(an)f(HDU)0
-3394 y(de\014nition)i(is)h(denoted)i(with)e(a)i(SIMPLE)e(or)i(XTENSION)
-e(template)i(line:)0 3554 y(1\))j(SIMPLE)f(b)s(egins)f(a)i(Primary)f
-(HDU)h(de\014nition.)48 b(SIMPLE)33 b(ma)m(y)h(only)f(app)s(ear)g(as)h
-(the)g(\014rst)f(k)m(eyw)m(ord)h(in)0 3667 y(the)e(template)h(\014le.)
-44 b(If)32 b(the)g(template)h(\014le)e(b)s(egins)f(with)h(XTENSION)g
-(instead)g(of)h(SIMPLE,)g(then)f(a)i(default)0 3780 y(empt)m(y)d
-(Primary)d(HDU)j(is)f(created,)i(and)d(the)i(template)g(is)e(then)h
-(assumed)f(to)i(de\014ne)f(the)h(k)m(eyw)m(ords)f(starting)0
-3893 y(with)g(the)i(\014rst)e(extension)h(follo)m(wing)f(the)i(Primary)
-e(HDU.)0 4053 y(2\))35 b(XTENSION)e(marks)g(the)i(b)s(eginning)c(of)j
-(a)h(new)e(extension)h(HDU)g(de\014nition.)50 b(The)33
-b(previous)g(HDU)i(will)0 4166 y(b)s(e)30 b(closed)g(at)h(this)e(p)s
-(oin)m(t)h(and)f(pro)s(cessing)h(of)g(the)h(next)f(extension)g(b)s
-(egins.)0 4452 y Fi(Auto-indexing)35 b(of)g(Keyw)m(ords)0
-4671 y Fj(If)c(a)h(template)f(k)m(eyw)m(ord)h(name)f(ends)g(with)f(a)h
-("#")h(c)m(haracter,)i(it)d(is)f(said)g(to)i(b)s(e)f('auto-indexed'.)43
-b(Eac)m(h)32 b("#")0 4784 y(c)m(haracter)i(will)c(b)s(e)i(replaced)h(b)
-m(y)f(the)h(curren)m(t)g(in)m(teger)g(index)e(v)-5 b(alue,)33
-b(whic)m(h)f(gets)h(reset)h(=)e(1)h(at)h(the)e(start)i(of)0
-4897 y(eac)m(h)h(new)f(HDU)g(in)f(the)h(\014le)f(\(or)h(7)h(in)d(the)i
-(sp)s(ecial)f(case)i(of)f(a)g(GR)m(OUP)h(de\014nition\).)49
-b(The)33 b(FIRST)g(indexed)0 5010 y(k)m(eyw)m(ord)e(in)f(eac)m(h)i
-(template)g(HDU)g(de\014nition)c(is)i(used)h(as)g(the)g('incremen)m
-(tor';)h(eac)m(h)g(subsequen)m(t)e(o)s(ccurence)0 5123
-y(of)i(this)e(SAME)h(k)m(eyw)m(ord)h(will)d(cause)j(the)g(index)e(v)-5
-b(alue)31 b(to)h(b)s(e)f(incremen)m(ted.)43 b(This)30
-b(b)s(eha)m(vior)g(can)i(b)s(e)f(rather)0 5236 y(subtle,)c(as)h
-(illustrated)e(in)g(the)i(follo)m(wing)e(examples)h(in)f(whic)m(h)h
-(the)h(TTYPE)e(k)m(eyw)m(ord)i(is)f(the)h(incremen)m(tor)f(in)0
-5349 y(b)s(oth)j(cases:)95 5601 y Ff(TTYPE#)47 b(=)g(TIME)95
-5714 y(TFORM#)g(=)g(1D)p eop
-%%Page: 25 31
-25 30 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(25)95 555 y Ff(TTYPE#)47 b(=)g(RATE)95
-668 y(TFORM#)g(=)g(1E)0 894 y Fj(will)23 b(create)28
-b(TTYPE1,)e(TF)m(ORM1,)i(TTYPE2,)f(and)e(TF)m(ORM2)i(k)m(eyw)m(ords.)40
-b(But)26 b(if)f(the)h(template)g(lo)s(oks)f(lik)m(e,)95
-1120 y Ff(TTYPE#)47 b(=)g(TIME)95 1233 y(TTYPE#)g(=)g(RATE)95
-1345 y(TFORM#)g(=)g(1D)95 1458 y(TFORM#)g(=)g(1E)0 1684
-y Fj(this)30 b(results)f(in)h(a)h(FITS)f(\014les)g(with)f(TTYPE1,)i
-(TTYPE2,)g(TF)m(ORM2,)h(and)e(TF)m(ORM2,)i(whic)m(h)e(is)g(probably)0
-1797 y(not)h(what)f(w)m(as)h(in)m(tended!)0 2079 y Fi(T)-9
-b(emplate)33 b(P)m(arser)j(Directiv)m(es)0 2298 y Fj(In)29
-b(addition)g(to)h(the)g(template)h(lines)d(whic)m(h)h(de\014ne)g
-(individual)d(k)m(eyw)m(ords,)k(the)g(template)h(parser)e(recognizes)0
-2411 y(3)h(sp)s(ecial)f(directiv)m(es)g(whic)m(h)g(are)h(eac)m(h)h
-(preceded)f(b)m(y)f(the)h(bac)m(kslash)g(c)m(haracter:)90
-b Ff(\\include,)45 b(\\group)p Fj(,)29 b(and)48 2524
-y Ff(\\end)p Fj(.)0 2684 y(The)37 b('include')f(directiv)m(e)i(m)m(ust)
-f(b)s(e)h(follo)m(w)m(ed)f(b)m(y)h(a)g(\014lename.)62
-b(It)38 b(forces)g(the)g(parser)f(to)i(temp)s(orarily)d(stop)0
-2797 y(reading)e(the)h(curren)m(t)g(template)g(\014le)f(and)g(b)s(egin)
-g(reading)g(the)h(include)d(\014le.)54 b(Once)35 b(the)g(parser)f(reac)
-m(hes)i(the)0 2910 y(end)f(of)h(the)g(include)d(\014le)i(it)g(con)m
-(tin)m(ues)g(parsing)g(the)g(curren)m(t)h(template)g(\014le.)55
-b(Include)34 b(\014les)h(can)h(b)s(e)f(nested,)0 3023
-y(and)30 b(HDU)h(de\014nitions)d(can)i(span)g(m)m(ultiple)e(template)j
-(\014les.)0 3183 y(The)g(start)h(of)g(a)g(GR)m(OUP)h(de\014nition)c(is)
-i(denoted)h(with)e(the)i('group')g(directiv)m(e,)f(and)h(the)f(end)h
-(of)f(a)i(GR)m(OUP)0 3296 y(de\014nition)i(is)i(denoted)g(with)f(the)i
-('end')f(directiv)m(e.)61 b(Eac)m(h)39 b(GR)m(OUP)e(con)m(tains)h(0)g
-(or)f(more)h(mem)m(b)s(er)f(blo)s(c)m(ks)0 3409 y(\(HDUs)44
-b(or)f(GR)m(OUPs\).)79 b(Mem)m(b)s(er)42 b(blo)s(c)m(ks)h(of)g(t)m(yp)s
-(e)g(GR)m(OUP)g(can)g(con)m(tain)g(their)f(o)m(wn)h(mem)m(b)s(er)f(blo)
-s(c)m(ks.)0 3522 y(The)32 b(GR)m(OUP)g(de\014nition)e(itself)h(o)s
-(ccupies)h(one)g(FITS)g(\014le)f(HDU)i(of)f(sp)s(ecial)f(t)m(yp)s(e)h
-(\(GR)m(OUP)h(HDU\),)h(so)e(if)g(a)0 3634 y(template)f(sp)s(eci\014es)e
-(1)i(group)e(with)g(1)i(mem)m(b)s(er)f(HDU)h(lik)m(e:)0
-3860 y Ff(\\group)0 3973 y(grpdescr)46 b(=)h('demo')0
-4086 y(xtension)f(bintable)0 4199 y(#)h(this)g(bintable)f(has)h(0)g
-(cols,)f(0)i(rows)0 4312 y(\\end)0 4538 y Fj(then)30
-b(the)h(parser)e(creates)j(a)f(FITS)f(\014le)f(with)g(3)i(HDUs)g(:)0
-4763 y Ff(1\))47 b(dummy)g(PHDU)0 4876 y(2\))g(GROUP)g(HDU)f(\(has)h(1)
-h(member,)d(which)i(is)g(bintable)e(in)j(HDU)f(number)f(3\))0
-4989 y(3\))h(bintable)f(\(member)g(of)h(GROUP)f(in)h(HDU)g(number)f
-(2\))0 5215 y Fj(T)-8 b(ec)m(hnically)29 b(sp)s(eaking,)g(the)g(GR)m
-(OUP)i(HDU)f(is)f(a)h(BINT)-8 b(ABLE)30 b(with)f(6)h(columns.)39
-b(Applications)28 b(can)i(de\014ne)0 5328 y(additional)20
-b(columns)h(in)f(a)j(GR)m(OUP)f(HDU)h(using)e(TF)m(ORMn)g(and)h(TTYPEn)
-f(\(where)g(n)h(is)f(7,)j(8,)h(....\))39 b(k)m(eyw)m(ords)0
-5441 y(or)30 b(their)g(auto-indexing)f(equiv)-5 b(alen)m(ts.)0
-5601 y(F)d(or)26 b(a)f(more)g(complicated)f(example)g(of)h(a)h
-(template)f(\014le)f(using)f(the)i(group)f(directiv)m(es,)i(lo)s(ok)e
-(at)h(the)g(sample.tpl)0 5714 y(\014le)k(that)i(is)f(included)d(in)j
-(the)g(CFITSIO)f(distribution.)p eop
-%%Page: 26 32
-26 31 bop 0 299 a Fj(26)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(F)f(ormal)34
-b(T)-9 b(emplate)34 b(Syn)m(tax)0 774 y Fj(The)c(template)h(syn)m(tax)g
-(can)f(formally)f(b)s(e)h(de\014ned)f(as)i(follo)m(ws:)191
-1012 y Ff(TEMPLATE)45 b(=)j(BLOCK)e([)i(BLOCK)e(...)h(])334
-1238 y(BLOCK)f(=)i({)f(HDU)g(|)h(GROUP)e(})334 1464 y(GROUP)g(=)i
-(\\GROUP)e([)h(BLOCK)g(...)g(])g(\\END)430 1689 y(HDU)f(=)i(XTENSION)d
-([)j(LINE)f(...)f(])i({)f(XTENSION)f(|)h(\\GROUP)f(|)i(\\END)f(|)g(EOF)
-g(})382 1915 y(LINE)f(=)i([)f(KEYWORD)f([)i(=)f(])h(])f([)g(VALUE)g(])g
-([)h(/)f(COMMENT)f(])191 2141 y(X)h(...)238 b(-)48 b(X)f(can)g(be)g
-(present)f(1)h(or)h(more)e(times)191 2254 y({)h(X)h(|)f(Y)h(})f(-)h(X)f
-(or)g(Y)191 2367 y([)g(X)h(])238 b(-)48 b(X)f(is)g(optional)0
-2605 y Fj(A)m(t)34 b(the)f(topmost)g(lev)m(el,)g(the)g(template)h
-(de\014nes)d(1)j(or)e(more)h(template)g(blo)s(c)m(ks.)48
-b(Blo)s(c)m(ks)33 b(can)g(b)s(e)f(either)g(HDU)0 2718
-y(\(Header)27 b(Data)h(Unit\))f(or)f(a)h(GR)m(OUP)-8
-b(.)28 b(F)-8 b(or)27 b(eac)m(h)g(blo)s(c)m(k)f(the)h(parser)f(creates)
-i(1)f(\(or)g(more)f(for)h(GR)m(OUPs\))g(FITS)0 2830 y(\014le)i(HDUs.)0
-3114 y Fi(Errors)0 3333 y Fj(In)24 b(general)g(the)g(\014ts)p
-692 3333 28 4 v 33 w(execute)p 1019 3333 V 34 w(template\(\))h
-(function)e(tries)h(to)h(b)s(e)f(as)g(atomic)h(as)g(p)s(ossible,)e(so)h
-(either)g(ev)m(erything)0 3446 y(is)f(done)h(or)g(nothing)e(is)h(done.)
-39 b(If)23 b(an)h(error)f(o)s(ccurs)h(during)e(parsing)g(of)i(the)g
-(template,)i(\014ts)p 3125 3446 V 33 w(execute)p 3452
-3446 V 34 w(template\(\))0 3559 y(will)k(\(try)j(to\))h(delete)f(the)g
-(top)g(lev)m(el)f(BLOCK)g(\(with)g(all)f(its)h(c)m(hildren)f(if)h(an)m
-(y\))h(in)e(whic)m(h)h(the)h(error)f(o)s(ccured,)0 3672
-y(then)e(it)g(will)e(stop)i(reading)g(the)g(template)h(\014le)e(and)h
-(it)g(will)e(return)h(with)g(an)h(error.)0 3956 y Fi(Examples)0
-4175 y Fj(1.)54 b(This)33 b(template)i(\014le)f(will)e(create)k(a)f
-(200)h(x)e(300)i(pixel)d(image,)k(with)c(4-b)m(yte)j(in)m(teger)f
-(pixel)e(v)-5 b(alues,)35 b(in)f(the)0 4288 y(primary)28
-b(HDU:)95 4526 y Ff(SIMPLE)47 b(=)g(T)95 4638 y(BITPIX)g(=)g(32)95
-4751 y(NAXIS)g(=)g(2)239 b(/)47 b(number)f(of)h(dimensions)95
-4864 y(NAXIS1)g(=)g(100)95 b(/)47 b(length)f(of)h(first)g(axis)95
-4977 y(NAXIS2)g(=)g(200)95 b(/)47 b(length)f(of)h(second)f(axis)95
-5090 y(OBJECT)h(=)g(NGC)g(253)g(/)g(name)g(of)g(observed)f(object)0
-5328 y Fj(The)35 b(allo)m(w)m(ed)g(v)-5 b(alues)35 b(of)g(BITPIX)g(are)
-h(8,)h(16,)h(32,)g(-32,)g(or)d(-64,)j(represen)m(ting,)e(resp)s(ectiv)m
-(ely)-8 b(,)37 b(8-bit)e(in)m(teger,)0 5441 y(16-bit)c(in)m(teger,)g
-(32-bit)f(in)m(teger,)h(32-bit)g(\015oating)f(p)s(oin)m(t,)g(or)g(64)h
-(bit)f(\015oating)g(p)s(oin)m(t)f(pixels.)0 5601 y(2.)39
-b(T)-8 b(o)23 b(create)h(a)f(FITS)e(table,)k(the)d(template)h(\014rst)f
-(needs)g(to)i(include)c(XTENSION)i(=)g(T)-8 b(ABLE)23
-b(or)f(BINT)-8 b(ABLE)0 5714 y(to)31 b(de\014ne)e(whether)g(it)g(is)g
-(an)g(ASCI)s(I)g(or)g(binary)f(table,)i(and)g(NAXIS2)g(to)g(de\014ne)f
-(the)h(n)m(um)m(b)s(er)f(of)h(ro)m(ws)f(in)g(the)p eop
-%%Page: 27 33
-27 32 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(27)0 555 y(table.)49 b(Tw)m(o)34 b(template)f(lines)f
-(are)i(then)f(needed)f(to)i(de\014ne)f(the)g(name)h(\(TTYPEn\))e(and)h
-(FITS)g(data)h(format)0 668 y(\(TF)m(ORMn\))d(of)f(the)h(columns,)e(as)
-i(in)e(this)g(example:)95 966 y Ff(xtension)46 b(=)h(bintable)95
-1079 y(naxis2)g(=)g(40)95 1192 y(ttype#)g(=)g(Name)95
-1305 y(tform#)g(=)g(10a)95 1418 y(ttype#)g(=)g(Npoints)95
-1531 y(tform#)g(=)g(j)95 1644 y(ttype#)g(=)g(Rate)95
-1756 y(tunit#)g(=)g(counts/s)95 1869 y(tform#)g(=)g(e)0
-2167 y Fj(The)26 b(ab)s(o)m(v)m(e)j(example)d(de\014nes)g(a)i(n)m(ull)d
-(primary)g(arra)m(y)i(follo)m(w)m(ed)g(b)m(y)g(a)g(40-ro)m(w)h(binary)d
-(table)i(extension)g(with)f(3)0 2280 y(columns)h(called)g('Name',)j
-('Np)s(oin)m(ts',)e(and)g('Rate',)i(with)d(data)i(formats)f(of)g('10A')
-i(\(ASCI)s(I)d(c)m(haracter)i(string\),)0 2393 y('1J')k(\(in)m(teger\))
-h(and)e('1E')i(\(\015oating)e(p)s(oin)m(t\),)h(resp)s(ectiv)m(ely)-8
-b(.)48 b(Note)34 b(that)f(the)g(other)g(required)e(FITS)h(k)m(eyw)m
-(ords)0 2506 y(\(BITPIX,)37 b(NAXIS,)g(NAXIS1,)h(PCOUNT,)e(GCOUNT,)h
-(TFIELDS,)f(and)g(END\))h(do)g(not)g(need)f(to)h(b)s(e)f(ex-)0
-2619 y(plicitly)f(de\014ned)h(in)h(the)g(template)h(b)s(ecause)g(their)
-f(v)-5 b(alues)37 b(can)h(b)s(e)f(inferred)e(from)j(the)f(other)h(k)m
-(eyw)m(ords)g(in)0 2732 y(the)d(template.)54 b(This)33
-b(example)i(also)g(illustrates)d(that)k(the)f(templates)g(are)g
-(generally)f(case-insensitiv)m(e)g(\(the)0 2845 y(k)m(eyw)m(ord)29
-b(names)g(and)g(TF)m(ORMn)f(v)-5 b(alues)29 b(are)g(con)m(v)m(erted)i
-(to)e(upp)s(er-case)g(in)e(the)i(FITS)g(\014le\))f(and)g(that)i(string)
-0 2958 y(k)m(eyw)m(ord)h(v)-5 b(alues)30 b(generally)f(do)h(not)h(need)
-f(to)h(b)s(e)f(enclosed)g(in)f(quotes.)0 3293 y Fd(4.2.5)112
-b(HDU)38 b(Lo)s(cation)f(Sp)s(eci\014cation)0 3521 y
-Fj(The)k(optional)f(HDU)j(lo)s(cation)e(sp)s(eci\014er)e(de\014nes)i
-(whic)m(h)f(HDU)i(\(Header-Data)i(Unit,)g(also)d(kno)m(wn)g(as)h(an)0
-3634 y(`extension'\))35 b(within)c(the)k(FITS)e(\014le)g(to)i
-(initially)c(op)s(en.)51 b(It)34 b(m)m(ust)g(immediately)f(follo)m(w)g
-(the)h(base)h(\014le)e(name)0 3747 y(\(or)h(the)g(output)g(\014le)f
-(name)g(if)g(presen)m(t\).)52 b(If)33 b(it)g(is)g(not)h(sp)s(eci\014ed)
-f(then)g(the)h(\014rst)f(HDU)i(\(the)f(primary)e(arra)m(y\))0
-3860 y(is)g(op)s(ened.)46 b(The)32 b(HDU)h(lo)s(cation)f(sp)s
-(eci\014er)f(is)h(required)f(if)g(the)i(colFilter,)f(ro)m(wFilter,)h
-(or)g(binSp)s(ec)d(sp)s(eci\014ers)0 3973 y(are)g(presen)m(t,)f(b)s
-(ecause)h(the)f(primary)e(arra)m(y)j(is)e(not)i(a)f(v)-5
-b(alid)28 b(HDU)i(for)f(these)g(op)s(erations.)40 b(The)29
-b(HDU)h(ma)m(y)g(b)s(e)0 4086 y(sp)s(eci\014ed)d(either)i(b)m(y)f
-(absolute)h(p)s(osition)e(n)m(um)m(b)s(er,)h(starting)h(with)e(0)j(for)
-e(the)h(primary)e(arra)m(y)-8 b(,)31 b(or)e(b)m(y)f(reference)0
-4199 y(to)h(the)g(HDU)g(name,)g(and)f(optionally)-8 b(,)28
-b(the)h(v)m(ersion)f(n)m(um)m(b)s(er)f(and)h(the)h(HDU)g(t)m(yp)s(e)g
-(of)f(the)h(desired)e(extension.)0 4312 y(The)32 b(lo)s(cation)f(of)h
-(an)g(image)h(within)c(a)k(single)d(cell)i(of)g(a)g(binary)f(table)h
-(ma)m(y)g(also)g(b)s(e)g(sp)s(eci\014ed,)f(as)h(describ)s(ed)0
-4425 y(b)s(elo)m(w.)0 4585 y(The)26 b(absolute)g(p)s(osition)e(of)i
-(the)h(extension)f(is)f(sp)s(eci\014ed)f(either)i(b)m(y)g(enclosed)g
-(the)h(n)m(um)m(b)s(er)e(in)g(square)g(brac)m(k)m(ets)0
-4698 y(\(e.g.,)k(`[1]')g(=)d(the)h(\014rst)f(extension)g(follo)m(wing)g
-(the)h(primary)d(arra)m(y\))k(or)f(b)m(y)f(preceded)h(the)g(n)m(um)m(b)
-s(er)e(with)h(a)h(plus)0 4811 y(sign)36 b(\(`+1'\).)63
-b(T)-8 b(o)38 b(sp)s(ecify)e(the)h(HDU)h(b)m(y)g(name,)h(giv)m(e)f(the)
-f(name)h(of)f(the)h(desired)e(HDU)i(\(the)f(v)-5 b(alue)37
-b(of)h(the)0 4924 y(EXTNAME)e(or)g(HDUNAME)h(k)m(eyw)m(ord\))g(and)f
-(optionally)e(the)i(extension)g(v)m(ersion)f(n)m(um)m(b)s(er)g(\(v)-5
-b(alue)36 b(of)g(the)0 5036 y(EXTVER)27 b(k)m(eyw)m(ord\))i(and)e(the)h
-(extension)g(t)m(yp)s(e)f(\(v)-5 b(alue)28 b(of)g(the)g(XTENSION)f(k)m
-(eyw)m(ord:)40 b(IMA)m(GE,)29 b(ASCI)s(I)d(or)0 5149
-y(T)-8 b(ABLE,)36 b(or)f(BINT)-8 b(ABLE\),)36 b(separated)f(b)m(y)g
-(commas)h(and)e(all)g(enclosed)h(in)f(square)h(brac)m(k)m(ets.)56
-b(If)34 b(the)h(v)-5 b(alue)0 5262 y(of)34 b(EXTVER)f(and)f(XTENSION)h
-(are)h(not)f(sp)s(eci\014ed,)g(then)g(the)h(\014rst)e(extension)i(with)
-e(the)h(correct)i(v)-5 b(alue)33 b(of)0 5375 y(EXTNAME)39
-b(is)f(op)s(ened.)67 b(The)38 b(extension)h(name)g(and)f(t)m(yp)s(e)i
-(are)f(not)h(case)g(sensitiv)m(e,)h(and)d(the)h(extension)0
-5488 y(t)m(yp)s(e)29 b(ma)m(y)g(b)s(e)f(abbreviated)g(to)h(a)g(single)e
-(letter)i(\(e.g.,)i(I)d(=)g(IMA)m(GE)i(extension)e(or)g(primary)f(arra)
-m(y)-8 b(,)30 b(A)f(or)f(T)g(=)0 5601 y(ASCI)s(I)d(table)h(extension,)h
-(and)f(B)h(=)f(binary)f(table)h(BINT)-8 b(ABLE)27 b(extension\).)40
-b(If)26 b(the)g(HDU)h(lo)s(cation)g(sp)s(eci\014er)0
-5714 y(is)i(equal)h(to)h(`[PRIMAR)-8 b(Y]')32 b(or)f(`[P]',)g(then)f
-(the)h(primary)d(arra)m(y)j(\(the)g(\014rst)f(HDU\))h(will)d(b)s(e)i
-(op)s(ened.)p eop
-%%Page: 28 34
-28 33 bop 0 299 a Fj(28)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(FITS)34
-b(images)h(are)g(most)h(commonly)e(stored)h(in)f(the)h(primary)e(arra)m
-(y)i(or)g(an)g(image)g(extension,)h(but)e(images)0 668
-y(can)d(also)g(b)s(e)f(stored)h(as)h(a)f(v)m(ector)h(in)e(a)h(single)f
-(cell)g(of)h(a)h(binary)d(table)i(\(i.e.)42 b(eac)m(h)32
-b(ro)m(w)f(of)g(the)h(v)m(ector)g(column)0 781 y(con)m(tains)c(a)h
-(di\013eren)m(t)e(image\).)41 b(Suc)m(h)27 b(an)h(image)h(can)f(b)s(e)g
-(op)s(ened)f(with)g(CFITSIO)f(b)m(y)i(sp)s(ecifying)e(the)i(desired)0
-894 y(column)j(name)h(and)f(the)h(ro)m(w)g(n)m(um)m(b)s(er)f(after)h
-(the)g(binary)e(table)i(HDU)h(sp)s(eci\014er)d(as)i(sho)m(wn)g(in)e
-(the)i(follo)m(wing)0 1007 y(examples.)70 b(The)40 b(column)f(name)i
-(is)e(separated)i(from)f(the)h(HDU)g(sp)s(eci\014er)e(b)m(y)h(a)h
-(semicolon)e(and)h(the)h(ro)m(w)0 1120 y(n)m(um)m(b)s(er)29
-b(is)g(enclosed)h(in)e(paren)m(theses.)41 b(In)30 b(this)f(case)i
-(CFITSIO)d(copies)i(the)g(image)h(from)e(the)i(table)f(cell)f(in)m(to)0
-1233 y(a)j(temp)s(orary)e(primary)g(arra)m(y)h(b)s(efore)g(it)g(is)f
-(op)s(ened.)43 b(The)30 b(application)g(program)h(then)g(just)g(sees)g
-(the)h(image)0 1346 y(in)h(the)i(primary)d(arra)m(y)-8
-b(,)37 b(without)c(an)m(y)i(extensions.)52 b(The)34 b(particular)e(ro)m
-(w)j(to)g(b)s(e)e(op)s(ened)h(ma)m(y)h(b)s(e)f(sp)s(eci\014ed)0
-1458 y(either)27 b(b)m(y)g(giving)f(an)h(absolute)g(in)m(teger)h(ro)m
-(w)g(n)m(um)m(b)s(er)e(\(starting)h(with)f(1)i(for)f(the)g(\014rst)g
-(ro)m(w\),)i(or)e(b)m(y)g(sp)s(ecifying)0 1571 y(a)33
-b(b)s(o)s(olean)e(expression)g(that)i(ev)-5 b(aluates)33
-b(to)g(TR)m(UE)g(for)f(the)g(desired)f(ro)m(w.)47 b(The)32
-b(\014rst)f(ro)m(w)i(that)g(satis\014es)f(the)0 1684
-y(expression)27 b(will)e(b)s(e)j(used.)39 b(The)28 b(ro)m(w)g
-(selection)g(expression)f(has)h(the)g(same)g(syn)m(tax)h(as)f(describ)s
-(ed)e(in)h(the)h(Ro)m(w)0 1797 y(Filter)i(Sp)s(eci\014er)e(section,)j
-(b)s(elo)m(w.)0 1957 y(Examples:)143 2203 y Ff(myfile.fits[3])44
-b(-)k(open)e(the)h(3rd)g(HDU)g(following)e(the)i(primary)f(array)143
-2316 y(myfile.fits+3)92 b(-)48 b(same)e(as)h(above,)f(but)h(using)g
-(the)g(FTOOLS-style)d(notation)143 2429 y(myfile.fits[EVENTS])f(-)k
-(open)g(the)g(extension)e(that)i(has)g(EXTNAME)e(=)j('EVENTS')143
-2542 y(myfile.fits[EVENTS,)43 b(2])95 b(-)47 b(same)g(as)g(above,)f
-(but)h(also)g(requires)e(EXTVER)h(=)i(2)143 2655 y
-(myfile.fits[events,2,b])42 b(-)47 b(same,)f(but)h(also)g(requires)f
-(XTENSION)f(=)j('BINTABLE')143 2768 y(myfile.fits[3;)c(images\(17\)])h
-(-)i(opens)g(the)g(image)f(in)h(row)g(17)g(of)g(the)g('images')1527
-2881 y(column)f(in)i(the)e(3rd)h(extension)f(of)h(the)g(file.)143
-2994 y(myfile.fits[3;)d(images\(exposure)g(>)j(100\)])g(-)g(as)g
-(above,)f(but)h(opens)g(the)f(image)907 3107 y(in)h(the)g(first)f(row)h
-(that)g(has)g(an)g('exposure')e(column)h(value)907 3220
-y(greater)g(than)g(100.)0 3508 y Fd(4.2.6)112 b(Image)38
-b(Section)0 3727 y Fj(A)j(virtual)e(\014le)g(con)m(taining)h(a)h
-(rectangular)g(subsection)e(of)i(an)g(image)f(can)h(b)s(e)f(extracted)i
-(and)e(op)s(ened)g(b)m(y)0 3840 y(sp)s(ecifying)30 b(the)j(range)g(of)g
-(pixels)e(\(start:end\))i(along)g(eac)m(h)h(axis)e(to)h(b)s(e)f
-(extracted)i(from)e(the)h(original)d(image.)0 3953 y(One)g(can)h(also)g
-(sp)s(ecify)e(an)i(optional)f(pixel)f(incremen)m(t)h
-(\(start:end:step\))i(for)f(eac)m(h)h(axis)e(of)h(the)g(input)d(image.)
-0 4066 y(A)g(pixel)d(step)j(=)f(1)h(will)d(b)s(e)i(assumed)f(if)h(it)g
-(is)f(not)i(sp)s(eci\014ed.)38 b(If)27 b(the)h(start)g(pixel)e(is)g
-(larger)i(then)f(the)h(end)e(pixel,)0 4179 y(then)32
-b(the)g(image)g(will)d(b)s(e)i(\015ipp)s(ed)e(\(pro)s(ducing)h(a)i
-(mirror)f(image\))h(along)g(that)g(dimension.)43 b(An)32
-b(asterisk,)g('*',)0 4292 y(ma)m(y)39 b(b)s(e)e(used)h(to)h(sp)s(ecify)
-e(the)h(en)m(tire)g(range)h(of)f(an)h(axis,)h(and)d('-*')j(will)35
-b(\015ip)i(the)h(en)m(tire)g(axis.)64 b(The)38 b(input)0
-4404 y(image)30 b(can)g(b)s(e)f(in)f(the)i(primary)e(arra)m(y)-8
-b(,)31 b(in)d(an)h(image)h(extension,)g(or)g(con)m(tained)f(in)g(a)h(v)
-m(ector)h(cell)e(of)h(a)g(binary)0 4517 y(table.)39 b(In)25
-b(the)h(later)g(2)g(cases)h(the)f(extension)g(name)g(or)f(n)m(um)m(b)s
-(er)g(m)m(ust)h(b)s(e)f(sp)s(eci\014ed)f(b)s(efore)i(the)g(image)g
-(section)0 4630 y(sp)s(eci\014er.)0 4790 y(Examples:)95
-5036 y Ff(myfile.fits[1:512:2,)43 b(2:512:2])i(-)95 b(open)47
-b(a)h(256x256)d(pixel)i(image)668 5149 y(consisting)e(of)i(the)g(odd)g
-(numbered)f(columns)g(\(1st)g(axis\))h(and)668 5262 y(the)g(even)g
-(numbered)e(rows)i(\(2nd)g(axis\))f(of)h(the)g(image)f(in)i(the)668
-5375 y(primary)e(array)g(of)i(the)e(file.)95 5601 y(myfile.fits[*,)e
-(512:256])i(-)h(open)g(an)g(image)g(consisting)e(of)i(all)g(the)g
-(columns)668 5714 y(in)g(the)g(input)g(image,)f(but)h(only)f(rows)h
-(256)g(through)f(512.)p eop
-%%Page: 29 35
-29 34 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(29)668 555 y Ff(The)47 b(image)f(will)h(be)g(flipped)f
-(along)g(the)h(2nd)g(axis)g(since)668 668 y(the)g(starting)f(pixel)g
-(is)h(greater)f(than)h(the)g(ending)f(pixel.)95 894 y(myfile.fits[*:2,)
-e(512:256:2])h(-)i(same)g(as)g(above)f(but)h(keeping)f(only)668
-1007 y(every)h(other)f(row)h(and)g(column)f(in)h(the)g(input)f(image.)
-95 1233 y(myfile.fits[-*,)e(*])j(-)h(copy)e(the)h(entire)f(image,)g
-(flipping)g(it)h(along)668 1346 y(the)g(first)f(axis.)95
-1571 y(myfile.fits[3][1:256,1:256)o(])c(-)47 b(opens)g(a)g(subsection)e
-(of)i(the)g(image)g(that)668 1684 y(is)g(in)h(the)e(3rd)h(extension)f
-(of)h(the)g(file.)95 1910 y(myfile.fits[4;)d(images\(12\)][1:10,1:10])e
-(-)48 b(open)e(an)h(image)g(consisting)286 2023 y(of)h(the)e(first)h
-(10)g(pixels)f(in)h(both)g(dimensions.)e(The)i(original)286
-2136 y(image)g(resides)f(in)h(the)g(12th)f(row)h(of)g(the)g('images')f
-(vector)286 2249 y(column)g(in)i(the)f(table)f(in)h(the)g(4th)g
-(extension)e(of)i(the)g(file.)0 2486 y Fj(When)23 b(CFITSIO)f(op)s(ens)
-h(an)g(image)g(section)h(it)f(\014rst)g(creates)h(a)g(temp)s(orary)f
-(\014le)g(con)m(taining)g(the)g(image)h(section)0 2599
-y(plus)31 b(a)j(cop)m(y)g(of)g(an)m(y)g(other)f(HDUs)h(in)e(the)i
-(\014le.)49 b(This)31 b(temp)s(orary)i(\014le)g(is)f(then)h(op)s(ened)g
-(b)m(y)g(the)h(application)0 2711 y(program,)28 b(so)g(it)f(is)f(not)i
-(p)s(ossible)d(to)j(write)f(to)h(or)g(mo)s(dify)e(the)h(input)f(\014le)
-g(when)h(sp)s(ecifying)e(an)j(image)g(section.)0 2824
-y(Note)39 b(that)f(CFITSIO)e(automatically)h(up)s(dates)g(the)g(w)m
-(orld)g(co)s(ordinate)g(system)h(k)m(eyw)m(ords)f(in)f(the)i(header)0
-2937 y(of)33 b(the)h(image)f(section,)h(if)e(they)i(exist,)g(so)f(that)
-h(the)f(co)s(ordinate)g(asso)s(ciated)h(with)e(eac)m(h)i(pixel)d(in)h
-(the)i(image)0 3050 y(section)d(will)c(b)s(e)j(computed)g(correctly)-8
-b(.)0 3337 y Fd(4.2.7)112 b(Column)37 b(and)h(Keyw)m(ord)g(Filtering)d
-(Sp)s(eci\014cation)0 3556 y Fj(The)27 b(optional)g(column/k)m(eyw)m
-(ord)h(\014ltering)e(sp)s(eci\014er)g(is)h(used)g(to)i(mo)s(dify)d(the)
-i(column)f(structure)g(and/or)h(the)0 3669 y(header)38
-b(k)m(eyw)m(ords)h(in)e(the)i(HDU)g(that)h(w)m(as)f(selected)g(with)e
-(the)i(previous)e(HDU)i(lo)s(cation)f(sp)s(eci\014er.)64
-b(This)0 3782 y(\014ltering)40 b(sp)s(eci\014er)g(m)m(ust)i(b)s(e)f
-(enclosed)h(in)e(square)i(brac)m(k)m(ets)h(and)e(can)h(b)s(e)f
-(distinguished)d(from)k(a)g(general)0 3895 y(ro)m(w)d(\014lter)f(sp)s
-(eci\014er)f(\(describ)s(ed)g(b)s(elo)m(w\))h(b)m(y)h(the)g(fact)h
-(that)f(it)f(b)s(egins)f(with)h(the)h(string)f('col)h(')g(and)f(is)g
-(not)0 4008 y(immediately)27 b(follo)m(w)m(ed)h(b)m(y)g(an)g(equals)g
-(sign.)39 b(The)28 b(original)e(\014le)h(is)h(not)g(c)m(hanged)h(b)m(y)
-f(this)g(\014ltering)e(op)s(eration,)0 4121 y(and)40
-b(instead)g(the)h(mo)s(di\014cations)e(are)i(made)f(on)h(a)g(cop)m(y)g
-(of)g(the)g(input)e(FITS)h(\014le)f(\(usually)g(in)g(memory\),)0
-4234 y(whic)m(h)32 b(also)h(con)m(tains)g(a)g(cop)m(y)h(of)f(all)f(the)
-i(other)f(HDUs)h(in)d(the)i(\014le.)48 b(This)32 b(temp)s(orary)g
-(\014le)g(is)g(passed)h(to)h(the)0 4347 y(application)c(program)i(and)f
-(will)e(p)s(ersist)h(only)h(un)m(til)f(the)i(\014le)f(is)g(closed)h(or)
-g(un)m(til)e(the)i(program)f(exits,)i(unless)0 4459 y(the)e(out\014le)e
-(sp)s(eci\014er)g(\(see)i(ab)s(o)m(v)m(e\))h(is)e(also)g(supplied.)0
-4620 y(The)h(column/k)m(eyw)m(ord)g(\014lter)f(can)h(b)s(e)g(used)f(to)
-i(p)s(erform)e(the)i(follo)m(wing)d(op)s(erations.)43
-b(More)32 b(than)f(one)g(op)s(er-)0 4733 y(ation)f(ma)m(y)h(b)s(e)f(sp)
-s(eci\014ed)f(b)m(y)h(separating)g(them)g(with)g(semi-colons.)136
-4969 y Fc(\017)46 b Fj(Delete)32 b(a)f(column)e(or)h(k)m(eyw)m(ord)h(b)
-m(y)g(listing)d(the)i(name)h(preceeded)f(b)m(y)h(an)f(exclamation)h
-(mark)f(\(!\),)h(e.g.,)227 5082 y(')10 b(!TIME')32 b(will)d(delete)i
-(the)h(TIME)f(column)f(if)g(it)h(exists,)h(otherwise)e(the)i(TIME)f(k)m
-(eyw)m(ord.)44 b(An)31 b(error)g(is)227 5195 y(returned)h(if)f(neither)
-g(a)i(column)f(nor)g(k)m(eyw)m(ord)g(with)g(this)f(name)i(exists.)46
-b(Note)34 b(that)f(the)g(exclamation)227 5308 y(p)s(oin)m(t,)25
-b(')10 b(!',)26 b(is)d(a)h(sp)s(ecial)e(UNIX)i(c)m(haracter,)j(so)e(if)
-d(it)i(is)f(used)g(on)g(the)h(command)g(line)e(rather)i(than)f(en)m
-(tered)227 5421 y(at)31 b(a)g(task)g(prompt,)f(it)g(m)m(ust)g(b)s(e)g
-(preceded)g(b)m(y)g(a)h(bac)m(kslash)f(to)h(force)g(the)f(UNIX)h(shell)
-e(to)i(ignore)f(it.)136 5601 y Fc(\017)46 b Fj(Rename)29
-b(an)g(existing)e(column)g(or)i(k)m(eyw)m(ord)g(with)e(the)i(syn)m(tax)
-g('NewName)h(==)e(OldName'.)39 b(An)28 b(error)227 5714
-y(is)i(returned)f(if)g(neither)h(a)g(column)f(nor)h(k)m(eyw)m(ord)h
-(with)e(this)h(name)g(exists.)p eop
-%%Page: 30 36
-30 35 bop 0 299 a Fj(30)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)136 555 y
-Fc(\017)46 b Fj(App)s(end)37 b(a)j(new)f(column)e(or)j(k)m(eyw)m(ord)f
-(to)h(the)f(table.)67 b(T)-8 b(o)40 b(create)g(a)g(column,)g(giv)m(e)g
-(the)f(new)g(name,)227 668 y(optionally)34 b(follo)m(w)m(ed)h(b)m(y)g
-(the)g(datat)m(yp)s(e)h(in)e(paren)m(theses,)j(follo)m(w)m(ed)e(b)m(y)g
-(a)h(single)e(equals)g(sign)g(and)h(an)227 781 y(expression)f(to)i(b)s
-(e)e(used)g(to)i(compute)f(the)g(v)-5 b(alue)34 b(\(e.g.,)k('new)m
-(col\(1J\))e(=)f(0')g(will)e(create)j(a)f(new)g(32-bit)227
-894 y(in)m(teger)j(column)e(called)h('new)m(col')g(\014lled)f(with)g
-(zeros\).)62 b(The)37 b(datat)m(yp)s(e)h(is)f(sp)s(eci\014ed)e(using)h
-(the)i(same)227 1007 y(syn)m(tax)28 b(that)h(is)d(allo)m(w)m(ed)i(for)f
-(the)h(v)-5 b(alue)27 b(of)h(the)g(FITS)f(TF)m(ORMn)g(k)m(eyw)m(ord)h
-(\(e.g.,)i('I',)f('J',)f('E',)g('D',)h(etc.)227 1120
-y(for)37 b(binary)e(tables,)k(and)d('I8',)k(F12.3',)h('E20.12',)g(etc.)
-62 b(for)37 b(ASCI)s(I)e(tables\).)61 b(If)37 b(the)g(datat)m(yp)s(e)h
-(is)e(not)227 1233 y(sp)s(eci\014ed)23 b(then)g(an)h(appropriate)g
-(datat)m(yp)s(e)h(will)c(b)s(e)j(c)m(hosen)g(dep)s(ending)e(on)i(the)g
-(form)g(of)g(the)g(expression)227 1346 y(\(ma)m(y)f(b)s(e)d(a)i(c)m
-(haracter)h(string,)g(logical,)f(bit,)h(long)e(in)m(teger,)j(or)d
-(double)f(column\).)37 b(An)21 b(appropriate)f(v)m(ector)227
-1458 y(coun)m(t)31 b(\(in)f(the)g(case)i(of)e(binary)f(tables\))h(will)
-e(also)i(b)s(e)g(added)g(if)f(not)i(explicitly)d(sp)s(eci\014ed.)227
-1612 y(When)23 b(creating)h(a)f(new)g(k)m(eyw)m(ord,)i(the)f(k)m(eyw)m
-(ord)f(name)h(m)m(ust)f(b)s(e)f(preceeded)i(b)m(y)f(a)g(p)s(ound)e
-(sign)h('#',)k(and)227 1725 y(the)j(expression)e(m)m(ust)h(ev)-5
-b(aluate)29 b(to)g(a)g(scalar)f(\(i.e.,)h(cannot)g(ha)m(v)m(e)h(a)f
-(column)e(name)h(in)f(the)i(expression\).)227 1838 y(The)j(commen)m(t)i
-(string)e(for)g(the)h(k)m(eyw)m(ord)h(ma)m(y)f(b)s(e)f(sp)s(eci\014ed)f
-(in)g(paren)m(theses)i(immediately)e(follo)m(wing)227
-1951 y(the)e(k)m(eyw)m(ord)f(name)g(\(instead)g(of)g(supplying)d(a)j
-(datat)m(yp)s(e)h(as)g(in)d(the)j(case)g(of)f(creating)g(a)h(new)f
-(column\).)136 2146 y Fc(\017)46 b Fj(Recompute)f(\(o)m(v)m(erwrite\))h
-(the)e(v)-5 b(alues)43 b(in)g(an)h(existing)g(column)f(or)h(k)m(eyw)m
-(ord)g(b)m(y)g(giving)g(the)g(name)227 2259 y(follo)m(w)m(ed)30
-b(b)m(y)h(an)f(equals)g(sign)f(and)h(an)g(arithmetic)g(expression.)0
-2527 y(The)d(expression)f(that)i(is)e(used)h(when)f(app)s(ending)f(or)j
-(recom)m(uting)f(columns)f(or)i(k)m(eyw)m(ords)f(can)h(b)s(e)f
-(arbitrarily)0 2639 y(complex)35 b(and)h(ma)m(y)g(b)s(e)f(a)h(function)
-f(of)h(other)g(header)g(k)m(eyw)m(ord)g(v)-5 b(alues)35
-b(and)g(other)h(columns)f(\(in)g(the)h(same)0 2752 y(ro)m(w\).)63
-b(The)37 b(full)e(syn)m(tax)k(and)e(a)m(v)-5 b(ailable)37
-b(functions)f(for)h(the)h(expression)e(are)i(describ)s(ed)e(b)s(elo)m
-(w)h(in)f(the)i(ro)m(w)0 2865 y(\014lter)29 b(sp)s(eci\014cation)h
-(section.)0 3025 y(F)-8 b(or)35 b(complex)f(or)h(commonly)f(used)g(op)s
-(erations,)h(one)g(can)f(also)h(place)f(the)h(op)s(erations)f(in)m(to)g
-(a)h(text)h(\014le)e(and)0 3138 y(imp)s(ort)d(it)h(in)m(to)g(the)h
-(column)e(\014lter)h(using)f(the)i(syn)m(tax)g('[col)g
-(@\014lename.txt]'.)47 b(The)32 b(op)s(erations)g(can)h(extend)0
-3251 y(o)m(v)m(er)f(m)m(ultiple)c(lines)g(of)j(the)f(\014le,)g(but)g(m)
-m(ultiple)e(op)s(erations)i(m)m(ust)g(still)e(b)s(e)i(separated)h(b)m
-(y)f(semicolons.)0 3411 y(Examples:)143 3679 y Ff([col)47
-b(!TIME;)f(Good)h(==)g(STATUS])141 b(-)47 b(deletes)f(the)h(TIME)g
-(column)f(and)1670 3792 y(renames)g(the)h(status)f(column)g(to)i
-('Good')143 4017 y([col)f(PI=PHA)f(*)h(1.1)g(+)h(0.2])285
-b(-)47 b(creates)f(new)h(PI)g(column)f(from)h(PHA)g(values)143
-4243 y([col)g(rate)f(=)i(rate/exposure])139 b(-)48 b(recomputes)d(the)i
-(rate)f(column)g(by)i(dividing)1670 4356 y(it)g(by)f(the)g(EXPOSURE)e
-(keyword)h(value.)0 4656 y Fd(4.2.8)112 b(Ro)m(w)37 b(Filtering)e(Sp)s
-(eci\014cation)0 4876 y Fj(The)29 b(optional)g(ro)m(w)g(\014lter)g(is)g
-(a)h(b)s(o)s(olean)e(expression)h(enclosed)g(in)f(square)h(brac)m(k)m
-(ets)i(for)f(\014ltering)e(or)h(selecting)0 4989 y(ro)m(ws)k(from)g
-(the)g(input)e(FITS)i(table.)49 b(A)33 b(new)g(FITS)f(\014le)g(is)h
-(then)g(created)h(whic)m(h)e(con)m(tains)h(only)f(those)i(ro)m(ws)0
-5102 y(for)e(whic)m(h)g(the)h(b)s(o)s(olean)e(expression)h(ev)-5
-b(aluates)33 b(to)g(true.)48 b(\(The)32 b(primary)f(arra)m(y)i(and)f
-(an)m(y)h(other)g(extensions)0 5215 y(in)28 b(the)h(input)e(\014le)h
-(are)h(also)g(copied)g(to)h(the)f(new)f(\014le\).)40
-b(The)28 b(original)g(FITS)g(\014le)g(is)g(closed)h(and)f(the)h(new)g
-(\014le)f(is)0 5328 y(op)s(ened)f(and)g(passed)g(to)i(the)f
-(application)e(program.)39 b(The)28 b(new)f(\014le)g(will)e(p)s(ersist)
-h(only)h(un)m(til)f(the)i(\014le)e(is)h(closed)0 5441
-y(or)j(un)m(til)f(the)i(program)f(exits,)g(unless)f(the)h(output)g
-(\014le)g(sp)s(eci\014er)f(\(see)i(ab)s(o)m(v)m(e\))h(is)d(also)i
-(supplied.)0 5601 y(The)c(expression)e(can)j(b)s(e)e(an)h(arbitrarily)d
-(complex)j(series)f(of)i(op)s(erations)e(p)s(erformed)f(on)i(constan)m
-(ts,)i(k)m(eyw)m(ord)0 5714 y(v)-5 b(alues,)30 b(and)g(column)f(data)i
-(tak)m(en)g(from)f(the)h(sp)s(eci\014ed)e(FITS)g(T)-8
-b(ABLE)31 b(extension.)p eop
-%%Page: 31 37
-31 36 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(31)0 555 y(Keyw)m(ord)37 b(and)f(column)f(data)j(are)f
-(referenced)g(b)m(y)g(name.)60 b(An)m(y)37 b(string)e(of)i(c)m
-(haracters)i(not)e(surrounded)d(b)m(y)0 668 y(quotes)41
-b(\(ie,)i(a)e(constan)m(t)h(string\))e(or)g(follo)m(w)m(ed)g(b)m(y)h
-(an)f(op)s(en)g(paren)m(theses)h(\(ie,)i(a)e(function)e(name\))i(will)d
-(b)s(e)0 781 y(initially)j(in)m(terpretted)j(as)g(a)h(column)e(name)i
-(and)e(its)h(con)m(ten)m(ts)i(for)e(the)h(curren)m(t)f(ro)m(w)g
-(inserted)f(in)m(to)i(the)0 894 y(expression.)59 b(If)36
-b(no)h(suc)m(h)f(column)g(exists,)i(a)f(k)m(eyw)m(ord)g(of)g(that)g
-(name)g(will)d(b)s(e)i(searc)m(hed)i(for)e(and)g(its)g(v)-5
-b(alue)0 1007 y(used,)31 b(if)f(found.)43 b(T)-8 b(o)31
-b(force)h(the)g(name)f(to)h(b)s(e)f(in)m(terpretted)g(as)h(a)f(k)m(eyw)
-m(ord)h(\(in)e(case)j(there)e(is)g(b)s(oth)f(a)i(column)0
-1120 y(and)d(k)m(eyw)m(ord)h(with)e(the)i(same)g(name\),)g(precede)g
-(the)f(k)m(eyw)m(ord)h(name)g(with)e(a)i(single)e(p)s(ound)f(sign,)i
-('#',)i(as)e(in)0 1233 y('#NAXIS2'.)40 b(Due)27 b(to)g(the)f
-(generalities)g(of)g(FITS)g(column)f(and)h(k)m(eyw)m(ord)h(names,)g(if)
-e(the)i(column)e(or)h(k)m(eyw)m(ord)0 1346 y(name)34
-b(con)m(tains)g(a)g(space)h(or)e(a)i(c)m(haracter)g(whic)m(h)e(migh)m
-(t)g(app)s(ear)g(as)i(an)e(arithmetic)g(term)h(then)g(inclose)f(the)0
-1458 y(name)d(in)f('$')j(c)m(haracters)g(as)e(in)f($MAX)j(PHA$)f(or)f
-(#$MAX-PHA$.)43 b(Names)31 b(are)f(case)i(insensitiv)m(e.)0
-1619 y(T)-8 b(o)41 b(access)i(a)e(table)g(en)m(try)g(in)f(a)h(ro)m(w)g
-(other)g(than)g(the)g(curren)m(t)g(one,)j(follo)m(w)c(the)h(column's)f
-(name)h(with)f(a)0 1732 y(ro)m(w)31 b(o\013set)h(within)c(curly)h
-(braces.)43 b(F)-8 b(or)31 b(example,)g('PHA-3')h(will)c(ev)-5
-b(aluate)32 b(to)f(the)g(v)-5 b(alue)31 b(of)g(column)e(PHA,)j(3)0
-1844 y(ro)m(ws)c(ab)s(o)m(v)m(e)i(the)e(ro)m(w)h(curren)m(tly)e(b)s
-(eing)g(pro)s(cessed.)40 b(One)28 b(cannot)h(sp)s(ecify)e(an)h
-(absolute)g(ro)m(w)g(n)m(um)m(b)s(er,)g(only)g(a)0 1957
-y(relativ)m(e)i(o\013set.)42 b(Ro)m(ws)31 b(that)g(fall)e(outside)h
-(the)g(table)g(will)e(b)s(e)i(treated)h(as)g(unde\014ned,)d(or)j
-(NULLs.)0 2118 y(Bo)s(olean)g(op)s(erators)g(can)g(b)s(e)f(used)f(in)h
-(the)g(expression)g(in)f(either)h(their)g(F)-8 b(ortran)31
-b(or)f(C)h(forms.)40 b(The)30 b(follo)m(wing)0 2230 y(b)s(o)s(olean)f
-(op)s(erators)i(are)g(a)m(v)-5 b(ailable:)191 2468 y
-Ff("equal")428 b(.eq.)46 b(.EQ.)h(==)95 b("not)46 b(equal")476
-b(.ne.)94 b(.NE.)h(!=)191 2581 y("less)46 b(than")238
-b(.lt.)46 b(.LT.)h(<)143 b("less)46 b(than/equal")188
-b(.le.)94 b(.LE.)h(<=)47 b(=<)191 2694 y("greater)e(than")95
-b(.gt.)46 b(.GT.)h(>)143 b("greater)45 b(than/equal")g(.ge.)94
-b(.GE.)h(>=)47 b(=>)191 2807 y("or")572 b(.or.)46 b(.OR.)h(||)95
-b("and")762 b(.and.)46 b(.AND.)h(&&)191 2920 y("negation")236
-b(.not.)46 b(.NOT.)h(!)95 b("approx.)45 b(equal\(1e-7\)")92
-b(~)0 3158 y Fj(Note)32 b(that)g(the)f(exclamation)g(p)s(oin)m(t,)f(')
-10 b(!',)33 b(is)d(a)h(sp)s(ecial)e(UNIX)j(c)m(haracter,)h(so)e(if)f
-(it)g(is)g(used)g(on)h(the)g(command)0 3271 y(line)g(rather)h(than)h
-(en)m(tered)g(at)g(a)g(task)g(prompt,)g(it)f(m)m(ust)g(b)s(e)g
-(preceded)h(b)m(y)f(a)h(bac)m(kslash)f(to)i(force)f(the)g(UNIX)0
-3384 y(shell)c(to)i(ignore)f(it.)0 3544 y(The)i(expression)f(ma)m(y)j
-(also)e(include)e(arithmetic)i(op)s(erators)h(and)f(functions.)46
-b(T)-8 b(rigonometric)32 b(functions)f(use)0 3657 y(radians,)22
-b(not)h(degrees.)38 b(The)22 b(follo)m(wing)e(arithmetic)h(op)s
-(erators)i(and)e(functions)f(can)j(b)s(e)e(used)g(in)g(the)h
-(expression)0 3770 y(\(function)29 b(names)i(are)f(case)i(insensitiv)m
-(e\):)191 4008 y Ff("addition")522 b(+)477 b("subtraction")d(-)191
-4121 y("multiplication")234 b(*)477 b("division")618
-b(/)191 4234 y("negation")522 b(-)477 b("exponentiation")330
-b(**)143 b(^)191 4347 y("absolute)45 b(value")237 b(abs\(x\))g
-("cosine")714 b(cos\(x\))191 4460 y("sine")g(sin\(x\))237
-b("tangent")666 b(tan\(x\))191 4573 y("arc)47 b(cosine")427
-b(arccos\(x\))93 b("arc)47 b(sine")619 b(arcsin\(x\))191
-4685 y("arc)47 b(tangent")379 b(arctan\(x\))93 b("arc)47
-b(tangent")475 b(arctan2\(x,y\))191 4798 y("exponential")378
-b(exp\(x\))237 b("square)46 b(root")476 b(sqrt\(x\))191
-4911 y("natural)45 b(log")381 b(log\(x\))237 b("common)46
-b(log")524 b(log10\(x\))191 5024 y("modulus")570 b(i)48
-b(\045)f(j)286 b("random)46 b(#)h([0.0,1.0\)")141 b(random\(\))191
-5137 y("minimum")570 b(min\(x,y\))141 b("maximum")666
-b(max\(x,y\))191 5250 y("if-then-else")330 b(b?x:y)0
-5488 y Fj(An)31 b(alternate)h(syn)m(tax)g(for)f(the)g(min)f(and)h(max)g
-(functions)f(has)h(only)f(a)i(single)e(argumen)m(t)i(whic)m(h)e(should)
-f(b)s(e)i(a)0 5601 y(v)m(ector)g(v)-5 b(alue)29 b(\(see)h(b)s(elo)m
-(w\).)40 b(The)29 b(result)f(will)f(b)s(e)h(the)i(minim)m(um/maxim)m
-(um)c(elemen)m(t)j(con)m(tained)h(within)d(the)0 5714
-y(v)m(ector.)p eop
-%%Page: 32 38
-32 37 bop 0 299 a Fj(32)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(There)37
-b(are)g(three)g(functions)f(that)h(are)h(primarily)c(for)i(use)h(with)f
-(SA)m(O)h(region)f(\014les)g(and)h(the)g(FSA)m(OI)g(task,)0
-668 y(but)e(they)h(can)h(b)s(e)e(used)g(directly)-8 b(.)57
-b(They)36 b(return)f(a)h(b)s(o)s(olean)f(true)h(or)g(false)f(dep)s
-(ending)f(on)i(whether)f(a)i(t)m(w)m(o)0 781 y(dimensional)28
-b(p)s(oin)m(t)h(is)g(in)g(the)i(region)f(or)g(not:)191
-1012 y Ff("point)46 b(in)h(a)h(circular)d(region")477
-1125 y(circle\(xcntr,ycntr,radius)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191
-1351 y("point)h(in)h(an)g(elliptical)e(region")430 1464
-y(ellipse\(xcntr,ycntr,xhl)o(f_w)o(dth,)o(yhlf)o(_wd)o(th,r)o(otat)o
-(ion)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191 1689 y("point)h(in)h(a)h
-(rectangular)c(region")620 1802 y(box\(xcntr,ycntr,xfll_wdth,)o(yfll)o
-(_wd)o(th,r)o(otat)o(ion)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191
-2028 y(where)334 2141 y(\(xcntr,ycntr\))g(are)j(the)g(\(x,y\))f
-(position)g(of)h(the)g(center)f(of)h(the)g(region)334
-2254 y(\(xhlf_wdth,yhlf_wdth\))42 b(are)47 b(the)g(\(x,y\))f(half)h
-(widths)f(of)h(the)g(region)334 2367 y(\(xfll_wdth,yfll_wdth\))42
-b(are)47 b(the)g(\(x,y\))f(full)h(widths)f(of)h(the)g(region)334
-2480 y(\(radius\))f(is)h(half)f(the)h(diameter)f(of)h(the)g(circle)334
-2593 y(\(rotation\))e(is)i(the)g(angle\(degrees\))d(that)j(the)g
-(region)f(is)h(rotated)f(with)620 2706 y(respect)g(to)h
-(\(xcntr,ycntr\))334 2818 y(\(Xcoord,Ycoord\))d(are)j(the)g(\(x,y\))f
-(coordinates)f(to)i(test,)f(usually)g(column)620 2931
-y(names)334 3044 y(NOTE:)g(each)h(parameter)e(can)i(itself)f(be)i(an)f
-(expression,)d(not)j(merely)f(a)620 3157 y(column)h(name)f(or)h
-(constant.)0 3388 y Fj(There)27 b(is)f(also)i(a)f(function)f(for)i
-(testing)f(if)f(t)m(w)m(o)j(v)-5 b(alues)27 b(are)h(close)f(to)i(eac)m
-(h)f(other,)h(i.e.,)f(if)e(they)i(are)g("near")g(eac)m(h)0
-3501 y(other)c(to)h(within)c(a)j(user)g(sp)s(eci\014ed)e(tolerance.)39
-b(The)24 b(argumen)m(ts,)h(v)-5 b(alue)p 2503 3501 28
-4 v 33 w(1)24 b(and)f(v)-5 b(alue)p 2980 3501 V 32 w(2)25
-b(can)f(b)s(e)f(in)m(teger)h(or)g(real)0 3614 y(and)32
-b(represen)m(t)h(the)g(t)m(w)m(o)h(v)-5 b(alues)32 b(who's)g(pro)m
-(ximit)m(y)g(is)g(b)s(eing)f(tested)i(to)h(b)s(e)e(within)e(the)j(sp)s
-(eci\014ed)e(tolerance,)0 3727 y(also)f(an)h(in)m(teger)f(or)h(real:)
-955 3958 y Ff(near\(value_1,)44 b(value_2,)h(tolerance\))0
-4189 y Fj(When)37 b(a)i(NULL,)e(or)h(unde\014ned,)g(v)-5
-b(alue)37 b(is)g(encoun)m(tered)h(in)e(the)i(FITS)f(table,)j(the)e
-(expression)e(will)f(ev)-5 b(alu-)0 4302 y(ate)38 b(to)f(NULL)g(unless)
-d(the)j(unde\014ned)e(v)-5 b(alue)36 b(is)f(not)i(actually)f(required)f
-(for)h(ev)-5 b(aluation,)38 b(eg.)60 b("TR)m(UE)37 b(.or.)0
-4414 y(NULL")26 b(ev)-5 b(aluates)26 b(to)h(TR)m(UE.)f(The)f(follo)m
-(wing)f(t)m(w)m(o)j(functions)d(allo)m(w)h(some)h(NULL)g(detection)g
-(and)f(handling:)0 4527 y(ISNULL\(x\))31 b(and)g(DEFNULL\(x,y\).)44
-b(The)31 b(former)g(returns)f(a)h(b)s(o)s(olean)g(v)-5
-b(alue)30 b(of)i(TR)m(UE)f(if)f(the)h(argumen)m(t)h(x)0
-4640 y(is)f(NULL.)h(The)g(later)g("de\014nes")g(a)g(v)-5
-b(alue)31 b(to)i(b)s(e)f(substituted)e(for)i(NULL)g(v)-5
-b(alues;)32 b(it)f(returns)g(the)h(v)-5 b(alue)32 b(of)g(x)0
-4753 y(if)d(x)i(is)e(not)i(NULL,)f(otherwise)g(it)g(returns)f(the)i(v)
--5 b(alue)29 b(of)i(y)-8 b(.)0 4913 y(The)38 b(follo)m(wing)f(t)m(yp)s
-(e)i(casting)g(op)s(erators)g(are)g(a)m(v)-5 b(ailable,)41
-b(where)d(the)h(inclosing)e(paren)m(theses)i(are)g(required)0
-5026 y(and)30 b(tak)m(en)h(from)f(the)h(C)f(language)g(usage.)42
-b(Also,)30 b(the)h(in)m(teger)f(to)i(real)e(casts)h(v)-5
-b(alues)29 b(to)j(double)d(precision:)764 5257 y Ff("real)46
-b(to)h(integer")189 b(\(int\))46 b(x)239 b(\(INT\))46
-b(x)764 5370 y("integer)f(to)i(real")190 b(\(float\))46
-b(i)143 b(\(FLOAT\))45 b(i)0 5601 y Fj(Bit)35 b(masks)g(can)h(b)s(e)f
-(used)f(to)i(select)g(out)f(ro)m(ws)h(from)e(bit)h(columns)f(\(TF)m
-(ORMn)h(=)g(#X\))h(in)e(FITS)g(\014les.)54 b(T)-8 b(o)0
-5714 y(represen)m(t)30 b(the)h(mask,)g(binary)-8 b(,)29
-b(o)s(ctal,)i(and)f(hex)g(formats)g(are)h(allo)m(w)m(ed:)p
-eop
-%%Page: 33 39
-33 38 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(33)811 555 y Ff(binary:)142 b(b0110xx1010000101xxxx00)o
-(01)811 668 y(octal:)190 b(o720x1)46 b(->)h(\(b111010000xxx001\))811
-781 y(hex:)286 b(h0FxD)94 b(->)47 b(\(b00001111xxxx1101\))0
-1045 y Fj(In)22 b(all)g(the)h(represen)m(tations,)i(an)d(x)h(or)g(X)g
-(is)f(allo)m(w)m(ed)h(in)e(the)i(mask)g(as)g(a)h(wild)c(card.)38
-b(Note)25 b(that)e(the)g(x)g(represen)m(ts)0 1158 y(a)k(di\013eren)m(t)
-g(n)m(um)m(b)s(er)f(of)h(wild)d(card)j(bits)f(in)g(eac)m(h)i(represen)m
-(tation.)40 b(All)25 b(represen)m(tations)i(are)h(case)g(insensitiv)m
-(e.)0 1318 y(T)-8 b(o)29 b(construct)g(the)g(b)s(o)s(olean)f
-(expression)f(using)g(the)i(mask)g(as)g(the)g(b)s(o)s(olean)e(equal)h
-(op)s(erator)h(discrib)s(ed)d(ab)s(o)m(v)m(e)0 1431 y(on)34
-b(a)h(bit)f(table)h(column.)52 b(F)-8 b(or)35 b(example,)h(if)d(y)m(ou)
-i(had)f(a)h(7)g(bit)f(column)f(named)h(\015ags)h(in)e(a)i(FITS)f(table)
-h(and)0 1544 y(w)m(an)m(ted)c(all)e(ro)m(ws)i(ha)m(ving)f(the)g(bit)g
-(pattern)g(0010011,)k(the)c(selection)h(expression)e(w)m(ould)g(b)s(e:)
-1336 1807 y Ff(flags)47 b(==)g(b0010011)191 1920 y(or)1336
-2033 y(flags)g(.eq.)f(b10011)0 2297 y Fj(It)35 b(is)f(also)h(p)s
-(ossible)d(to)k(test)g(if)e(a)h(range)g(of)g(bits)f(is)g(less)g(than,)i
-(less)e(than)h(equal,)h(greater)g(than)e(and)h(greater)0
-2410 y(than)30 b(equal)g(to)h(a)g(particular)e(b)s(o)s(olean)g(v)-5
-b(alue:)1336 2673 y Ff(flags)47 b(<=)g(bxxx010xx)1336
-2786 y(flags)g(.gt.)f(bxxx100xx)1336 2899 y(flags)h(.le.)f(b1xxxxxxx)0
-3163 y Fj(Notice)31 b(the)g(use)f(of)h(the)f(x)g(bit)g(v)-5
-b(alue)30 b(to)h(limit)d(the)i(range)h(of)g(bits)e(b)s(eing)g
-(compared.)0 3323 y(It)j(is)g(not)g(necessary)h(to)g(sp)s(ecify)e(the)i
-(leading)e(\(most)i(signi\014can)m(t\))f(zero)h(\(0\))g(bits)e(in)g
-(the)i(mask,)g(as)g(sho)m(wn)e(in)0 3436 y(the)g(second)f(expression)f
-(ab)s(o)m(v)m(e.)0 3596 y(Bit)43 b(wise)f(AND,)i(OR)e(and)g(NOT)h(op)s
-(erations)f(are)h(also)g(p)s(ossible)d(on)j(t)m(w)m(o)h(or)f(more)g
-(bit)f(\014elds)f(using)h(the)0 3709 y('&'\(AND\),)35
-b(')p Fc(j)p Fj('\(OR\),)g(and)e(the)h(')10 b(!'\(NOT\))34
-b(op)s(erators.)51 b(All)32 b(of)h(these)h(op)s(erators)g(result)e(in)h
-(a)h(bit)e(\014eld)g(whic)m(h)0 3822 y(can)f(then)f(b)s(e)f(used)h
-(with)f(the)i(equal)f(op)s(erator.)41 b(F)-8 b(or)31
-b(example:)1241 4085 y Ff(\(!flags\))45 b(==)j(b1101100)1241
-4198 y(\(flags)e(&)h(b1000001\))f(==)h(bx000001)0 4462
-y Fj(Bit)34 b(\014elds)f(can)h(b)s(e)f(app)s(ended)g(as)h(w)m(ell)f
-(using)g(the)h('+')g(op)s(erator.)53 b(Strings)32 b(can)j(b)s(e)e
-(concatenated)j(this)d(w)m(a)m(y)-8 b(,)0 4575 y(to)s(o.)0
-4735 y(In)30 b(addition,)e(sev)m(eral)j(constan)m(ts)h(are)f(built)d
-(in)h(for)h(use)g(in)f(n)m(umerical)g(expressions:)382
-4999 y Ff(#pi)667 b(3.1415...)284 b(#e)620 b(2.7182...)382
-5112 y(#deg)f(#pi/180)380 b(#row)524 b(current)46 b(row)h(number)382
-5224 y(#null)428 b(undefined)45 b(value)142 b(#snull)428
-b(undefined)45 b(string)0 5488 y Fj(A)40 b(string)e(constan)m(t)j(m)m
-(ust)e(b)s(e)g(enclosed)g(in)g(quotes)h(as)f(in)g('Crab'.)67
-b(The)39 b("n)m(ull")g(constan)m(ts)h(are)g(useful)e(for)0
-5601 y(conditionally)d(setting)j(table)g(v)-5 b(alues)37
-b(to)h(a)g(NULL,)g(or)g(unde\014ned,)f(v)-5 b(alue)38
-b(\(eg.,)j("col1==-99)e(?)62 b(#NULL)38 b(:)0 5714 y(col1"\).)p
-eop
-%%Page: 34 40
-34 39 bop 0 299 a Fj(34)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(V)g(ector)32
-b(Columns)0 715 y(V)-8 b(ector)37 b(columns)d(can)i(also)f(b)s(e)g
-(used)f(in)g(building)e(the)j(expression.)55 b(No)36
-b(sp)s(ecial)e(syn)m(tax)h(is)g(required)e(if)i(one)0
-828 y(w)m(an)m(ts)46 b(to)f(op)s(erate)h(on)f(all)f(elemen)m(ts)h(of)g
-(the)h(v)m(ector.)86 b(Simply)42 b(use)j(the)g(column)f(name)h(as)g
-(for)g(a)g(scalar)0 941 y(column.)c(V)-8 b(ector)32 b(columns)e(can)h
-(b)s(e)f(freely)g(in)m(termixed)g(with)f(scalar)i(columns)e(or)i
-(constan)m(ts)h(in)e(virtually)e(all)0 1054 y(expressions.)39
-b(The)29 b(result)f(will)e(b)s(e)j(of)g(the)g(same)h(dimension)c(as)k
-(the)f(v)m(ector.)42 b(Tw)m(o)29 b(v)m(ectors)i(in)d(an)h(expression,)0
-1167 y(though,)f(need)e(to)i(ha)m(v)m(e)g(the)f(same)g(n)m(um)m(b)s(er)
-f(of)h(elemen)m(ts)g(and)f(ha)m(v)m(e)j(the)e(same)g(dimensions.)37
-b(The)26 b(only)g(places)0 1280 y(a)35 b(v)m(ector)h(column)d(cannot)i
-(b)s(e)f(used)f(\(for)i(no)m(w,)g(an)m(yw)m(a)m(y\))h(are)f(the)g(SA)m
-(O)f(region)g(functions)f(and)g(the)i(NEAR)0 1393 y(b)s(o)s(olean)29
-b(function.)0 1553 y(Arithmetic)22 b(and)g(logical)h(op)s(erations)f
-(are)i(all)e(p)s(erformed)f(on)i(an)g(elemen)m(t)g(b)m(y)g(elemen)m(t)h
-(basis.)37 b(Comparing)22 b(t)m(w)m(o)0 1666 y(v)m(ector)32
-b(columns,)d(eg)i("COL1)f(==)g(COL2",)g(th)m(us)g(results)f(in)g
-(another)h(v)m(ector)i(of)e(b)s(o)s(olean)g(v)-5 b(alues)29
-b(indicating)0 1779 y(whic)m(h)d(elemen)m(ts)j(of)e(the)h(t)m(w)m(o)i
-(v)m(ectors)f(are)f(equal.)39 b(Tw)m(o)28 b(functions)e(are)j(a)m(v)-5
-b(ailable)27 b(whic)m(h)f(op)s(erate)j(on)e(v)m(ectors:)0
-1892 y(SUM\(x\))j(and)f(NELEM\(x\).)41 b(The)29 b(former)g(literally)e
-(sums)h(all)g(the)i(elemen)m(ts)g(in)e(x,)i(returning)d(a)j(scalar)f(v)
--5 b(alue.)0 2005 y(If)27 b(x)h(is)f(a)h(b)s(o)s(olean)f(v)m(ector,)j
-(SUM)d(returns)g(the)h(n)m(um)m(b)s(er)e(of)i(TR)m(UE)g(elemen)m(ts.)40
-b(The)27 b(latter,)i(NELEM,)f(returns)0 2118 y(the)34
-b(n)m(um)m(b)s(er)e(of)h(elemen)m(ts)h(in)e(v)m(ector)j(x.)49
-b(\(NELEM)34 b(also)f(op)s(erates)h(on)f(bit)g(and)f(string)h(columns,)
-g(returning)0 2230 y(their)g(column)h(widths.\))51 b(As)34
-b(an)g(example,)h(to)h(test)f(whether)e(all)h(elemen)m(ts)g(of)h(t)m(w)
-m(o)h(v)m(ectors)f(satisfy)f(a)h(giv)m(en)0 2343 y(logical)30
-b(comparison,)g(one)g(can)h(use)f(the)h(expression)668
-2579 y Ff(SUM\()47 b(COL1)f(>)i(COL2)f(\))g(==)g(NELEM\()f(COL1)h(\))0
-2815 y Fj(whic)m(h)31 b(will)e(return)i(TR)m(UE)h(if)f(all)g(elemen)m
-(ts)h(of)g(COL1)g(are)g(greater)h(than)f(their)f(corresp)s(onding)f
-(elemen)m(ts)i(in)0 2928 y(COL2.)0 3088 y(T)-8 b(o)32
-b(sp)s(ecify)e(a)j(single)d(elemen)m(t)i(of)g(a)g(v)m(ector,)i(giv)m(e)
-e(the)g(column)e(name)i(follo)m(w)m(ed)f(b)m(y)h(a)g(comma-separated)h
-(list)0 3201 y(of)c(co)s(ordinates)f(enclosed)h(in)e(square)i(brac)m(k)
-m(ets.)41 b(F)-8 b(or)30 b(example,)f(if)e(a)i(v)m(ector)i(column)c
-(named)i(PHAS)f(exists)g(in)0 3314 y(the)f(table)f(as)h(a)g(one)g
-(dimensional,)e(256)j(comp)s(onen)m(t)f(list)e(of)i(n)m(um)m(b)s(ers)e
-(from)h(whic)m(h)g(y)m(ou)h(w)m(an)m(ted)g(to)g(select)h(the)0
-3427 y(57th)k(comp)s(onen)m(t)g(for)f(use)g(in)f(the)i(expression,)e
-(then)i(PHAS[57])g(w)m(ould)e(do)i(the)f(tric)m(k.)44
-b(Higher)31 b(dimensional)0 3540 y(arra)m(ys)41 b(of)h(data)f(ma)m(y)h
-(app)s(ear)f(in)e(a)j(column.)72 b(But)41 b(in)f(order)g(to)i(in)m
-(terpret)e(them,)k(the)e(TDIMn)e(k)m(eyw)m(ord)0 3653
-y(m)m(ust)34 b(app)s(ear)g(in)f(the)h(header.)52 b(Assuming)33
-b(that)i(a)f(\(4,4,4,4\))k(arra)m(y)c(is)g(pac)m(k)m(ed)h(in)m(to)f
-(eac)m(h)i(ro)m(w)e(of)g(a)h(column)0 3766 y(named)26
-b(ARRA)-8 b(Y4D,)28 b(the)f(\(1,2,3,4\))i(comp)s(onen)m(t)e(elemen)m(t)
-f(of)h(eac)m(h)g(ro)m(w)g(is)e(accessed)j(b)m(y)e(ARRA)-8
-b(Y4D[1,2,3,4].)0 3878 y(Arra)m(ys)33 b(up)e(to)j(dimension)c(5)j(are)f
-(curren)m(tly)g(supp)s(orted.)46 b(Eac)m(h)33 b(v)m(ector)h(index)d
-(can)i(itself)e(b)s(e)h(an)h(expression,)0 3991 y(although)38
-b(it)g(m)m(ust)h(ev)-5 b(aluate)39 b(to)g(an)g(in)m(teger)g(v)-5
-b(alue)38 b(within)e(the)j(b)s(ounds)d(of)j(the)g(v)m(ector.)67
-b(V)-8 b(ector)40 b(columns)0 4104 y(whic)m(h)30 b(con)m(tain)h(spaces)
-h(or)f(arithmetic)f(op)s(erators)i(m)m(ust)f(ha)m(v)m(e)h(their)e
-(names)h(enclosed)g(in)f("$")i(c)m(haracters)h(as)0 4217
-y(with)c($ARRA)-8 b(Y-4D$[1,2,3,4].)0 4377 y(A)45 b(more)f(C-lik)m(e)g
-(syn)m(tax)i(for)e(sp)s(ecifying)e(v)m(ector)47 b(indices)42
-b(is)i(also)h(a)m(v)-5 b(ailable.)82 b(The)45 b(elemen)m(t)g(used)e(in)
-h(the)0 4490 y(preceding)27 b(example)h(alternativ)m(ely)g(could)f(b)s
-(e)h(sp)s(eci\014ed)f(with)f(the)j(syn)m(tax)g(ARRA)-8
-b(Y4D[4][3][2][1].)45 b(Note)30 b(the)0 4603 y(rev)m(erse)40
-b(order)f(of)h(indices)d(\(as)j(in)e(C\),)i(as)f(w)m(ell)g(as)g(the)h
-(fact)g(that)g(the)g(v)-5 b(alues)39 b(are)g(still)f(ones-based)h(\(as)
-h(in)0 4716 y(F)-8 b(ortran)39 b({)g(adopted)g(to)g(a)m(v)m(oid)g(am)m
-(biguit)m(y)f(for)h(1D)g(v)m(ectors\).)67 b(With)38 b(this)g(syn)m
-(tax,)j(one)e(do)s(es)f(not)h(need)f(to)0 4829 y(sp)s(ecify)29
-b(all)g(of)i(the)f(indices.)39 b(T)-8 b(o)31 b(extract)h(a)f(3D)g
-(slice)e(of)i(this)e(4D)i(arra)m(y)-8 b(,)32 b(use)e(ARRA)-8
-b(Y4D[4].)0 4989 y(V)g(ariable-length)30 b(v)m(ector)i(columns)d(are)h
-(not)h(supp)s(orted.)0 5149 y(V)-8 b(ectors)24 b(can)e(b)s(e)f(man)m
-(ually)f(constructed)j(within)c(the)j(expression)f(using)f(a)i
-(comma-separated)i(list)d(of)h(elemen)m(ts)0 5262 y(surrounded)30
-b(b)m(y)i(curly)e(braces)j(\(''\).)47 b(F)-8 b(or)33
-b(example,)f('1,3,6,1')k(is)31 b(a)h(4-elemen)m(t)i(v)m(ector)g(con)m
-(taining)d(the)i(v)-5 b(alues)0 5375 y(1,)31 b(3,)g(6,)g(and)f(1.)41
-b(The)30 b(v)m(ector)i(can)f(con)m(tain)f(only)g(b)s(o)s(olean,)f(in)m
-(teger,)i(and)f(real)g(v)-5 b(alues)30 b(\(or)h(expressions\).)39
-b(The)0 5488 y(elemen)m(ts)f(will)d(b)s(e)h(promoted)i(to)g(the)g
-(highest)e(datat)m(yp)s(e)j(presen)m(t.)62 b(An)m(y)37
-b(elemen)m(ts)h(whic)m(h)e(are)i(themselv)m(es)0 5601
-y(v)m(ectors,)i(will)34 b(b)s(e)i(expanded)g(out)h(with)f(eac)m(h)h(of)
-g(its)f(elemen)m(ts)i(b)s(ecoming)d(an)i(elemen)m(t)g(in)f(the)h
-(constructed)0 5714 y(v)m(ector.)p eop
-%%Page: 35 41
-35 40 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(35)0 555 y(A)44 b(common)h(\014ltering)d(metho)s(d)i
-(applied)e(to)j(FITS)e(\014les)h(is)f(a)h(time)g(\014lter)g(using)e(a)j
-(Go)s(o)s(d)f(Time)f(In)m(terv)-5 b(al)0 668 y(\(GTI\))36
-b(extension.)57 b(A)36 b(high-lev)m(el)e(function,)i
-(gti\014lter\(a,b,c,d\),)i(is)d(a)m(v)-5 b(ailable)35
-b(whic)m(h)f(p)s(erforms)h(this)f(sp)s(ecial)0 781 y(ev)-5
-b(aluation,)30 b(returning)f(a)h(b)s(o)s(olean)g(result)f(for)h(eac)m
-(h)i(time)e(elemen)m(t)h(tested.)41 b(Its)31 b(syn)m(tax)f(is)334
-1046 y Ff(gtifilter\()45 b([)j("filename")d([,)i(expr)f([,)i
-("STARTCOL",)c("STOPCOL")i(])h(])g(])h(\))0 1311 y Fj(where)32
-b(eac)m(h)h("[]")h(demarks)e(optional)f(parameters.)47
-b(The)32 b(\014lename,)g(if)f(sp)s(eci\014ed,)g(can)i(b)s(e)e(blank)g
-(\(""\))j(whic)m(h)0 1424 y(will)d(mean)j(to)g(use)g(the)g(\014rst)f
-(extension)g(with)g(the)h(name)f("*GTI*")j(in)c(the)i(curren)m(t)g
-(\014le,)g(a)g(plain)d(extension)0 1537 y(sp)s(eci\014er)d(\(eg,)k
-("+2",)f("[2]",)h(or)e("[STDGTI]"\))h(whic)m(h)e(will)e(b)s(e)i(used)h
-(to)g(select)h(an)f(extension)f(in)g(the)h(curren)m(t)0
-1650 y(\014le,)f(or)h(a)g(regular)f(\014lename)g(with)g(or)h(without)e
-(an)i(extension)g(sp)s(eci\014er)e(whic)m(h)g(in)h(the)h(latter)g(case)
-h(will)c(mean)0 1763 y(to)f(use)f(the)h(\014rst)f(extension)g(with)f
-(an)h(extension)g(name)h("*GTI*".)41 b(Expr)24 b(can)i(b)s(e)e(an)m(y)i
-(arithmetic)f(expression,)0 1876 y(including)31 b(simply)h(the)i(time)h
-(column)e(name.)53 b(A)34 b(v)m(ector)i(time)e(expression)f(will)f(pro)
-s(duce)h(a)i(v)m(ector)h(b)s(o)s(olean)0 1989 y(result.)75
-b(ST)-8 b(AR)g(TCOL)41 b(and)h(STOPCOL)e(are)j(the)f(names)g(of)g(the)h
-(ST)-8 b(AR)g(T/STOP)41 b(columns)g(in)g(the)h(GTI)0
-2102 y(extension.)54 b(If)34 b(one)h(of)g(them)g(is)f(sp)s(eci\014ed,)h
-(they)g(b)s(oth)f(m)m(ust)h(b)s(e.)53 b(Note)36 b(that)g(the)f(quotes)g
-(surrounding)d(the)0 2214 y(\014lename)e(and)f(ST)-8
-b(AR)g(T/STOP)30 b(column)f(names)h(are)h(required.)0
-2375 y(In)21 b(its)g(simplest)f(form,)k(no)d(parameters)h(need)g(to)h
-(b)s(e)e(pro)m(vided)f({)i(default)f(v)-5 b(alues)21
-b(will)f(b)s(e)h(used.)37 b(The)21 b(expression)0 2487
-y("gti\014lter\(\)")31 b(is)f(equiv)-5 b(alen)m(t)29
-b(to)334 2753 y Ff(gtifilter\()45 b("",)i(TIME,)f("*START*",)f
-("*STOP*")h(\))0 3018 y Fj(This)30 b(will)e(searc)m(h)k(the)g(curren)m
-(t)f(\014le)f(for)h(a)h(GTI)f(extension,)g(\014lter)g(the)g(TIME)g
-(column)f(in)g(the)i(curren)m(t)f(table,)0 3131 y(using)i(ST)-8
-b(AR)g(T/STOP)34 b(times)h(tak)m(en)g(from)g(columns)e(in)h(the)h(GTI)g
-(extension)f(with)g(names)g(con)m(taining)h(the)0 3243
-y(strings)c("ST)-8 b(AR)g(T")33 b(and)e("STOP".)46 b(The)32
-b(wildcards)d(\('*'\))34 b(allo)m(w)e(sligh)m(t)f(v)-5
-b(ariations)31 b(in)g(naming)g(con)m(v)m(en)m(tions)0
-3356 y(suc)m(h)38 b(as)g("TST)-8 b(AR)g(T")39 b(or)f("ST)-8
-b(AR)g(TTIME".)65 b(The)37 b(same)i(default)f(v)-5 b(alues)37
-b(apply)g(for)h(unsp)s(eci\014ed)e(parame-)0 3469 y(ters)g(when)f(the)h
-(\014rst)f(one)i(or)f(t)m(w)m(o)h(parameters)f(are)h(sp)s(eci\014ed.)55
-b(The)36 b(function)e(automatically)i(searc)m(hes)h(for)0
-3582 y(TIMEZER)m(O/I/F)g(k)m(eyw)m(ords)f(in)f(the)i(curren)m(t)f(and)g
-(GTI)g(extensions,)h(applying)e(a)h(relativ)m(e)h(time)f(o\013set,)j
-(if)0 3695 y(necessary)-8 b(.)0 3855 y(Another)31 b(common)h
-(\014ltering)d(metho)s(d)i(is)g(a)g(spatial)g(\014lter)f(using)g(a)i
-(SA)m(O-)f(st)m(yle)h(region)f(\014le.)42 b(The)31 b(syn)m(tax)h(for)0
-3968 y(this)d(high-lev)m(el)g(\014lter)h(is)334 4233
-y Ff(regfilter\()45 b("regfilename")f([)k(,)f(Xexpr,)f(Yexpr)h([)g(,)h
-("wcs)e(cols")h(])g(])g(\))0 4498 y Fj(The)32 b(region)g(\014le)f(name)
-h(is)g(required,)f(but)g(the)i(rest)f(is)g(optional.)45
-b(Without)32 b(an)m(y)h(explicit)e(expression)g(for)h(the)0
-4611 y(X)k(and)f(Y)h(co)s(ordinates)f(\(in)g(pixels\),)g(the)h
-(\014lter)f(will)e(searc)m(h)j(for)g(and)f(op)s(erate)h(on)g(columns)e
-("X")j(and)e("Y".)0 4724 y(If)j(the)g(region)f(\014le)g(is)g(in)g
-("degrees")j(format)e(instead)f(of)h("pixels")f(\("hhmmss")h(format)g
-(is)f(not)i(supp)s(orted,)0 4837 y(y)m(et\),)33 b(the)e(\014lter)f
-(will)e(need)i(W)m(CS)h(information)f(to)h(con)m(v)m(ert)i(the)e
-(region)f(co)s(ordinates)h(to)g(pixels.)41 b(If)30 b(supplied,)0
-4950 y(the)g(\014nal)e(parameter)i(string)f(con)m(tains)h(the)g(names)f
-(of)h(the)g(2)g(columns)e(\(space)j(or)e(comma)i(separated\))f(whic)m
-(h)0 5063 y(con)m(tain)g(the)g(desired)e(W)m(CS)i(information.)38
-b(If)30 b(not)g(supplied,)c(the)k(\014lter)f(will)e(scan)j(the)g(X)f
-(and)h(Y)f(expressions)0 5176 y(for)h(column)f(names.)40
-b(If)30 b(only)f(one)i(is)e(found)g(in)f(eac)m(h)k(expression,)d(those)
-h(columns)f(will)f(b)s(e)h(used.)40 b(Otherwise,)0 5289
-y(an)30 b(error)g(will)e(b)s(e)i(returned.)0 5449 y(The)g(region)g
-(shap)s(es)f(supp)s(orted)g(are)i(\(names)f(are)h(case)g(insensitiv)m
-(e\):)334 5714 y Ff(Point)428 b(\()48 b(X1,)f(Y1)g(\))715
-b(<-)48 b(One)f(pixel)f(square)g(region)p eop
-%%Page: 36 42
-36 41 bop 0 299 a Fj(36)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)334 555 y
-Ff(Line)476 b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2)i(\))333 b(<-)48
-b(One)f(pixel)f(wide)h(region)334 668 y(Polygon)332 b(\()48
-b(X1,)f(Y1,)g(X2,)f(Y2,)h(...)g(\))95 b(<-)48 b(Rest)e(are)h(interiors)
-e(with)334 781 y(Rectangle)236 b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2,)h(A)h
-(\))334 b(|)47 b(boundaries)e(considered)334 894 y(Box)524
-b(\()48 b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)i(\))143 b(V)47
-b(within)f(the)h(region)334 1007 y(Diamond)332 b(\()48
-b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)i(\))334 1120 y(Circle)380
-b(\()48 b(Xc,)f(Yc,)g(R)g(\))334 1233 y(Annulus)332 b(\()48
-b(Xc,)f(Yc,)g(Rin,)f(Rout)h(\))334 1346 y(Ellipse)332
-b(\()48 b(Xc,)f(Yc,)g(Rx,)f(Ry,)h(A)h(\))334 1458 y(Elliptannulus)c(\()
-k(Xc,)f(Yc,)g(Rinx,)f(Riny,)g(Routx,)g(Routy,)g(Ain,)h(Aout)g(\))334
-1571 y(Sector)380 b(\()48 b(Xc,)f(Yc,)g(Amin,)f(Amax)h(\))0
-1845 y Fj(where)28 b(\(Xc,Yc\))j(is)c(the)i(co)s(ordinate)g(of)f(the)h
-(shap)s(e's)f(cen)m(ter;)j(\(X#,Y#\))e(are)g(the)g(co)s(ordinates)f(of)
-h(the)g(shap)s(e's)0 1958 y(edges;)39 b(Rxxx)c(are)g(the)h(shap)s(es')f
-(v)-5 b(arious)34 b(Radii)g(or)h(semima)5 b(jor/minor)34
-b(axes;)k(and)d(Axxx)g(are)h(the)g(angles)f(of)0 2071
-y(rotation)d(\(or)f(b)s(ounding)e(angles)i(for)g(Sector\))h(in)e
-(degrees.)44 b(F)-8 b(or)32 b(rotated)h(shap)s(es,)e(the)g(rotation)h
-(angle)f(can)h(b)s(e)0 2184 y(left)f(o\013,)i(indicating)c(no)i
-(rotation.)45 b(Common)31 b(alternate)h(names)f(for)h(the)f(regions)g
-(can)h(also)g(b)s(e)e(used:)43 b(rotb)s(o)m(x)0 2297
-y(==)31 b(b)s(o)m(x;)h(rotrectangle)g(==)f(rectangle;)i(\(rot\)rhom)m
-(bus)e(==)f(\(rot\)diamond;)i(and)f(pie)f(==)h(sector.)44
-b(When)32 b(a)0 2410 y(shap)s(e's)h(name)g(is)f(preceded)h(b)m(y)g(a)h
-(min)m(us)e(sign,)h('-',)i(the)f(de\014ned)e(region)h(is)f(instead)g
-(the)i(area)g(*outside*)g(its)0 2523 y(b)s(oundary)26
-b(\(ie,)j(the)g(region)f(is)g(in)m(v)m(erted\).)40 b(All)27
-b(the)i(shap)s(es)e(within)f(a)j(single)e(region)h(\014le)g(are)h
-(AND'd)f(together)0 2636 y(to)j(create)h(the)f(region.)0
-2796 y(F)-8 b(or)29 b(complex)f(or)g(commonly)f(used)g(\014lters,)h
-(one)g(can)h(also)f(place)g(the)g(expression)f(in)m(to)h(a)g(text)h
-(\014le)e(and)h(imp)s(ort)0 2909 y(it)i(in)m(to)h(the)f(ro)m(w)h
-(\014lter)f(using)f(the)h(syn)m(tax)h('[@\014lename.txt]'.)42
-b(The)30 b(expression)g(can)h(b)s(e)e(arbitrarily)f(complex)0
-3022 y(and)i(extend)g(o)m(v)m(er)i(m)m(ultiple)c(lines)h(of)h(the)h
-(\014le.)0 3182 y(EXAMPLES:)191 3456 y Ff([)47 b(binary)f(&&)i(mag)f
-(<=)g(5.0])380 b(-)48 b(Extract)e(all)h(binary)f(stars)g(brighter)1766
-3569 y(than)94 b(fifth)47 b(magnitude)e(\(note)h(that)1766
-3681 y(the)h(initial)f(space)g(is)h(necessary)e(to)1766
-3794 y(prevent)h(it)h(from)g(being)f(treated)g(as)h(a)1766
-3907 y(binning)f(specification\))191 4133 y([#row)g(>=)h(125)g(&&)h
-(#row)e(<=)h(175])142 b(-)48 b(Extract)e(row)h(numbers)e(125)i(through)
-f(175)191 4359 y([IMAGE[4,5])f(.gt.)h(100])476 b(-)48
-b(Extract)e(all)h(rows)f(that)h(have)g(the)1766 4472
-y(\(4,5\))f(component)g(of)h(the)g(IMAGE)f(column)1766
-4585 y(greater)g(than)g(100)191 4811 y([abs\(sin\(theta)e(*)j(#deg\)\))
-f(<)i(0.5])e(-)i(Extract)e(all)h(rows)f(having)g(the)1766
-4924 y(absolute)f(value)i(of)g(the)g(sine)g(of)g(theta)1766
-5036 y(less)94 b(than)47 b(a)g(half)g(where)f(the)h(angles)1766
-5149 y(are)g(tabulated)e(in)i(degrees)191 5375 y([SUM\()f(SPEC)h(>)g
-(3*BACKGRND)e(\)>=1])94 b(-)48 b(Extract)e(all)h(rows)f(containing)f(a)
-1766 5488 y(spectrum,)g(held)i(in)g(vector)f(column)1766
-5601 y(SPEC,)g(with)h(at)g(least)f(one)h(value)g(3)1766
-5714 y(times)f(greater)g(than)h(the)g(background)p eop
-%%Page: 37 43
-37 42 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(37)1766 555 y Ff(level)46 b(held)h(in)g(a)h(keyword,)d
-(BACKGRND)191 781 y([VCOL=={1,4,2}])759 b(-)48 b(Extract)e(all)h(rows)f
-(whose)h(vector)f(column)1766 894 y(VCOL)h(contains)e(the)i(3-elements)
-e(1,)i(4,)g(and)1766 1007 y(2.)191 1233 y([@rowFilter.txt])711
-b(-)48 b(Extract)e(rows)g(using)h(the)g(expression)1766
-1346 y(contained)e(within)h(the)h(text)g(file)1766 1458
-y(rowFilter.txt)0 1801 y Fd(4.2.9)112 b(Binning)37 b(or)g
-(Histogramming)d(Sp)s(eci\014cation)0 2030 y Fj(The)44
-b(optional)g(binning)e(sp)s(eci\014er)h(is)h(enclosed)g(in)g(square)g
-(brac)m(k)m(ets)i(and)e(can)h(b)s(e)f(distinguished)d(from)k(a)0
-2143 y(general)35 b(ro)m(w)g(\014lter)f(sp)s(eci\014cation)f(b)m(y)i
-(the)g(fact)h(that)f(it)g(b)s(egins)e(with)h(the)h(k)m(eyw)m(ord)g
-('bin')f(not)h(immediately)0 2256 y(follo)m(w)m(ed)g(b)m(y)g(an)g
-(equals)f(sign.)54 b(When)35 b(binning)d(is)i(sp)s(ec\014ed,)i(a)f
-(temp)s(orary)g(N-dimensional)d(FITS)j(primary)0 2368
-y(arra)m(y)29 b(is)e(created)j(b)m(y)e(computing)f(the)i(histogram)f
-(of)h(the)f(v)-5 b(alues)28 b(in)f(the)h(sp)s(eci\014ed)f(columns)g(of)
-i(a)f(FITS)g(table)0 2481 y(extension.)40 b(After)30
-b(the)f(histogram)g(is)g(computed)g(the)h(input)d(FITS)i(\014le)g(con)m
-(taining)g(the)g(table)h(is)e(then)h(closed)0 2594 y(and)34
-b(the)h(temp)s(orary)f(FITS)g(primary)f(arra)m(y)i(is)f(op)s(ened)g
-(and)g(passed)g(to)h(the)g(application)e(program.)54
-b(Th)m(us,)0 2707 y(the)39 b(application)e(program)i(nev)m(er)g(sees)g
-(the)g(original)e(FITS)h(table)h(and)f(only)g(sees)i(the)f(image)g(in)e
-(the)i(new)0 2820 y(temp)s(orary)32 b(\014le)g(\(whic)m(h)g(has)g(no)h
-(additional)d(extensions\).)48 b(Ob)m(viously)-8 b(,)32
-b(the)h(application)e(program)h(m)m(ust)h(b)s(e)0 2933
-y(exp)s(ecting)d(to)h(op)s(en)f(a)h(FITS)e(image)i(and)f(not)g(a)h
-(FITS)f(table)g(in)f(this)g(case.)0 3093 y(The)h(data)h(t)m(yp)s(e)f
-(of)h(the)f(FITS)g(histogram)f(image)i(ma)m(y)g(b)s(e)f(sp)s(eci\014ed)
-e(b)m(y)i(app)s(ending)e('b')i(\(for)h(8-bit)f(b)m(yte\),)h('i')0
-3206 y(\(for)g(16-bit)f(in)m(tegers\),)h('j')g(\(for)g(32-bit)f(in)m
-(teger\),)i('r')e(\(for)h(32-bit)f(\015oating)h(p)s(oin)m(ts\),)e(or)i
-('d')f(\(for)h(64-bit)f(double)0 3319 y(precision)c(\015oating)i(p)s
-(oin)m(t\))g(to)g(the)h('bin')d(k)m(eyw)m(ord)j(\(e.g.)41
-b('[binr)27 b(X]')h(creates)i(a)e(real)g(\015oating)g(p)s(oin)m(t)f
-(image\).)40 b(If)0 3432 y(the)26 b(datat)m(yp)s(e)h(is)e(not)h
-(explicitly)e(sp)s(eci\014ed)g(then)i(a)g(32-bit)g(in)m(teger)h(image)f
-(will)d(b)s(e)i(created)i(b)m(y)f(default,)h(unless)0
-3545 y(the)i(w)m(eigh)m(ting)f(option)g(is)g(also)h(sp)s(eci\014ed)e
-(in)g(whic)m(h)h(case)h(the)g(image)g(will)d(ha)m(v)m(e)k(a)f(32-bit)g
-(\015oating)g(p)s(oin)m(t)e(data)0 3658 y(t)m(yp)s(e)k(b)m(y)f
-(default.)0 3818 y(The)24 b(histogram)f(image)i(ma)m(y)g(ha)m(v)m(e)g
-(from)f(1)g(to)h(4)g(dimensions)c(\(axes\),)27 b(dep)s(ending)22
-b(on)i(the)g(n)m(um)m(b)s(er)f(of)h(columns)0 3931 y(that)31
-b(are)g(sp)s(eci\014ed.)39 b(The)30 b(general)g(form)g(of)g(the)h
-(binning)c(sp)s(eci\014cation)i(is:)48 4234 y Ff([bin{bijrd})92
-b(Xcol=min:max:binsize,)42 b(Ycol=)47 b(...,)f(Zcol=...,)f(Tcol=...;)h
-(weight])0 4538 y Fj(in)38 b(whic)m(h)g(up)g(to)i(4)g(columns,)g(eac)m
-(h)g(corresp)s(onding)d(to)j(an)g(axis)e(of)i(the)f(image,)j(are)e
-(listed.)65 b(The)39 b(column)0 4650 y(names)27 b(are)h(case)h
-(insensitiv)m(e,)d(and)h(the)h(column)e(n)m(um)m(b)s(er)g(ma)m(y)i(b)s
-(e)f(giv)m(en)g(instead)g(of)h(the)g(name,)g(preceded)f(b)m(y)0
-4763 y(a)32 b(p)s(ound)e(sign)h(\(e.g.,)j([bin)c(#4=1:512]\).)47
-b(If)31 b(the)h(column)f(name)h(is)e(not)i(sp)s(eci\014ed,)f(then)g
-(CFITSIO)g(will)e(\014rst)0 4876 y(try)i(to)g(use)g(the)g('preferred)f
-(column')g(as)h(sp)s(eci\014ed)f(b)m(y)g(the)i(CPREF)e(k)m(eyw)m(ord)i
-(if)d(it)i(exists)g(\(e.g.,)i('CPREF)d(=)0 4989 y('DETX,DETY'\),)36
-b(otherwise)d(column)g(names)h('X',)h('Y',)g('Z',)f(and)g('T')g(will)d
-(b)s(e)j(assumed)f(for)h(eac)m(h)h(of)f(the)h(4)0 5102
-y(axes,)c(resp)s(ectiv)m(ely)-8 b(.)0 5262 y(Eac)m(h)33
-b(column)e(name)h(ma)m(y)h(b)s(e)f(follo)m(w)m(ed)f(b)m(y)i(an)f
-(equals)f(sign)h(and)f(then)h(the)g(lo)m(w)m(er)h(and)f(upp)s(er)e
-(range)i(of)h(the)0 5375 y(histogram,)e(and)f(the)h(size)g(of)g(the)g
-(histogram)g(bins,)e(separated)i(b)m(y)g(colons.)42 b(Spaces)31
-b(are)g(allo)m(w)m(ed)g(b)s(efore)g(and)0 5488 y(after)e(the)g(equals)f
-(sign)f(but)h(not)h(within)d(the)j('min:max:binsize')d(string.)39
-b(The)29 b(min,)e(max)i(and)f(binsize)f(v)-5 b(alues)0
-5601 y(ma)m(y)32 b(b)s(e)e(in)m(teger)h(or)g(\015oating)g(p)s(oin)m(t)f
-(n)m(um)m(b)s(ers,)g(or)h(they)g(ma)m(y)g(b)s(e)g(the)g(names)g(of)g(k)
-m(eyw)m(ords)g(in)f(the)h(header)g(of)0 5714 y(the)g(table.)40
-b(If)30 b(the)h(latter,)g(then)f(the)g(v)-5 b(alue)30
-b(of)h(that)g(k)m(eyw)m(ord)f(is)g(substituted)f(in)m(to)h(the)h
-(expression.)p eop
-%%Page: 38 44
-38 43 bop 0 299 a Fj(38)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(Default)36
-b(v)-5 b(alues)35 b(for)h(the)g(min,)g(max)g(and)g(binsize)e(quan)m
-(tities)h(will)e(b)s(e)i(used)h(if)e(not)j(explicitly)c(giv)m(en)j(in)f
-(the)0 668 y(binning)27 b(expression)i(as)i(sho)m(wn)f(in)f(these)i
-(examples:)191 917 y Ff([bin)47 b(x)g(=)g(:512:2])94
-b(-)47 b(use)g(default)f(minimum)g(value)191 1030 y([bin)h(x)g(=)g
-(1::2])190 b(-)47 b(use)g(default)f(maximum)g(value)191
-1143 y([bin)h(x)g(=)g(1:512])142 b(-)47 b(use)g(default)f(bin)h(size)
-191 1256 y([bin)g(x)g(=)g(1:])286 b(-)47 b(use)g(default)f(maximum)g
-(value)g(and)h(bin)g(size)191 1368 y([bin)g(x)g(=)g(:512])190
-b(-)47 b(use)g(default)f(minimum)g(value)g(and)h(bin)g(size)191
-1481 y([bin)g(x)g(=)g(2])334 b(-)47 b(use)g(default)f(minimum)g(and)h
-(maximum)f(values)191 1594 y([bin)h(x])524 b(-)47 b(use)g(default)f
-(minimum,)g(maximum)g(and)g(bin)h(size)191 1707 y([bin)g(4])524
-b(-)47 b(default)f(2-D)h(image,)f(bin)h(size)g(=)g(4)h(in)f(both)g
-(axes)191 1820 y([bin])619 b(-)47 b(default)f(2-D)h(image)0
-2069 y Fj(CFITSIO)31 b(will)f(use)i(the)h(v)-5 b(alue)32
-b(of)h(the)g(TLMINn,)f(TLMAXn,)h(and)f(TDBINn)h(k)m(eyw)m(ords,)h(if)d
-(they)i(exist,)g(for)0 2182 y(the)k(default)e(min,)i(max,)h(and)e
-(binsize,)g(resp)s(ectiv)m(ely)-8 b(.)59 b(If)36 b(they)h(do)f(not)h
-(exist)f(then)g(CFITSIO)f(will)f(use)i(the)0 2295 y(actual)c(minim)m
-(um)d(and)j(maxim)m(um)f(v)-5 b(alues)31 b(in)g(the)h(column)e(for)i
-(the)g(histogram)g(min)e(and)i(max)g(v)-5 b(alues.)44
-b(The)0 2408 y(default)33 b(binsize)e(will)g(b)s(e)i(set)h(to)h(1,)g
-(or)e(\(max)h(-)g(min\))e(/)i(10.,)i(whic)m(hev)m(er)d(is)g(smaller,)g
-(so)g(that)i(the)e(histogram)0 2520 y(will)28 b(ha)m(v)m(e)j(at)g
-(least)g(10)g(bins)e(along)h(eac)m(h)i(axis.)0 2681 y(A)41
-b(shortcut)g(notation)g(is)f(allo)m(w)m(ed)h(if)f(all)g(the)h
-(columns/axes)g(ha)m(v)m(e)h(the)f(same)g(binning)d(sp)s
-(eci\014cation.)72 b(In)0 2794 y(this)32 b(case)h(all)f(the)h(column)e
-(names)i(ma)m(y)g(b)s(e)f(listed)f(within)f(paren)m(theses,)k(follo)m
-(w)m(ed)f(b)m(y)f(the)h(\(single\))f(binning)0 2906 y(sp)s
-(eci\014cation,)d(as)i(in:)191 3155 y Ff([bin)47 b(\(X,Y\)=1:512:2])191
-3268 y([bin)g(\(X,Y\))f(=)h(5])0 3517 y Fj(The)31 b(optional)g(w)m
-(eigh)m(ting)h(factor)g(is)f(the)h(last)f(item)h(in)e(the)i(binning)d
-(sp)s(eci\014er)h(and,)i(if)e(presen)m(t,)j(is)d(separated)0
-3630 y(from)38 b(the)g(list)f(of)h(columns)f(b)m(y)h(a)h(semi-colon.)63
-b(As)39 b(the)f(histogram)g(is)f(accum)m(ulated,)k(this)c(w)m(eigh)m(t)
-i(is)e(used)0 3743 y(to)e(incremen)m(ted)e(the)h(v)-5
-b(alue)34 b(of)g(the)g(appropriated)e(bin)h(in)f(the)i(histogram.)51
-b(If)34 b(the)g(w)m(eigh)m(ting)g(factor)h(is)e(not)0
-3856 y(sp)s(eci\014ed,)23 b(then)g(the)g(default)f(w)m(eigh)m(t)i(=)e
-(1)i(is)e(assumed.)37 b(The)23 b(w)m(eigh)m(ting)g(factor)h(ma)m(y)f(b)
-s(e)g(a)g(constan)m(t)i(in)m(teger)e(or)0 3968 y(\015oating)29
-b(p)s(oin)m(t)f(n)m(um)m(b)s(er,)g(or)h(the)g(name)g(of)g(a)g(k)m(eyw)m
-(ord)h(con)m(taining)e(the)i(w)m(eigh)m(ting)e(v)-5 b(alue.)40
-b(Or)28 b(the)h(w)m(eigh)m(ting)0 4081 y(factor)g(ma)m(y)g(b)s(e)e(the)
-h(name)g(of)h(a)f(table)g(column)f(in)g(whic)m(h)f(case)k(the)e(v)-5
-b(alue)27 b(in)g(that)i(column,)e(on)h(a)h(ro)m(w)f(b)m(y)g(ro)m(w)0
-4194 y(basis,)h(will)f(b)s(e)i(used.)0 4354 y(In)35 b(some)h(cases,)i
-(the)d(column)g(or)g(k)m(eyw)m(ord)h(ma)m(y)g(giv)m(e)g(the)g(recipro)s
-(cal)e(of)i(the)g(actual)g(w)m(eigh)m(t)g(v)-5 b(alue)35
-b(that)h(is)0 4467 y(needed.)49 b(In)32 b(this)g(case,)j(precede)e(the)
-h(w)m(eigh)m(t)f(k)m(eyw)m(ord)h(or)f(column)f(name)h(b)m(y)g(a)g
-(slash)f('/')i(to)g(tell)e(CFITSIO)0 4580 y(to)f(use)f(the)h(recipro)s
-(cal)e(of)h(the)h(v)-5 b(alue)30 b(when)f(constructing)h(the)h
-(histogram.)0 4740 y(F)-8 b(or)25 b(complex)f(or)g(commonly)f(used)h
-(histograms,)h(one)f(can)h(also)f(place)g(its)f(description)f(in)m(to)i
-(a)h(text)g(\014le)e(and)h(im-)0 4853 y(p)s(ort)e(it)f(in)m(to)h(the)h
-(binning)c(sp)s(eci\014cation)i(using)f(the)j(syn)m(tax)f([bin)f
-(@\014lename.txt].)38 b(The)22 b(\014le's)f(con)m(ten)m(ts)j(can)e(ex-)
-0 4966 y(tend)h(o)m(v)m(er)i(m)m(ultiple)c(lines,)i(although)g(it)g(m)m
-(ust)g(still)e(conform)i(to)h(the)g(no-spaces)g(rule)e(for)h(the)h
-(min:max:binsize)0 5079 y(syn)m(tax)31 b(and)f(eac)m(h)h(axis)f(sp)s
-(eci\014cation)f(m)m(ust)i(still)d(b)s(e)i(comma-separated.)0
-5239 y(Examples:)191 5488 y Ff([bini)46 b(detx,)h(dety])762
-b(-)47 b(2-D,)g(16-bit)f(integer)g(histogram)1861 5601
-y(of)i(DETX)e(and)h(DETY)g(columns,)e(using)1861 5714
-y(default)h(values)g(for)h(the)g(histogram)p eop
-%%Page: 39 45
-39 44 bop 0 299 a Fh(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fj(39)1861 555 y Ff(range)47 b(and)g(binsize)191
-781 y([bin)g(\(detx,)f(dety\)=16;)f(/exposure])g(-)i(2-D,)g(32-bit)f
-(real)h(histogram)e(of)i(DETX)1861 894 y(and)g(DETY)g(columns)f(with)g
-(a)i(bin)f(size)f(=)i(16)1861 1007 y(in)g(both)e(axes.)h(The)f
-(histogram)g(values)1861 1120 y(are)h(divided)f(by)h(the)g(EXPOSURE)f
-(keyword)1861 1233 y(value.)191 1458 y([bin)h(time=TSTART:TSTOP:0.1])
-280 b(-)47 b(1-D)g(lightcurve,)e(range)h(determined)f(by)1861
-1571 y(the)i(TSTART)f(and)h(TSTOP)g(keywords,)1861 1684
-y(with)g(0.1)g(unit)g(size)f(bins.)191 1910 y([bin)h(pha,)f
-(time=8000.:8100.:0.1])90 b(-)47 b(2-D)g(image)g(using)f(default)g
-(binning)1861 2023 y(of)i(the)e(PHA)h(column)f(for)h(the)g(X)h(axis,)
-1861 2136 y(and)f(1000)g(bins)g(in)g(the)g(range)1861
-2249 y(8000.)g(to)g(8100.)f(for)h(the)g(Y)h(axis.)191
-2475 y([bin)f(@binFilter.txt])616 b(-)47 b(Use)g(the)g(contents)f(of)h
-(the)g(text)f(file)1861 2588 y(binFilter.txt)f(for)h(the)h(binning)1861
-2700 y(specifications.)p eop
-%%Page: 40 46
-40 45 bop 0 299 a Fj(40)1618 b Fh(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)p eop
-%%Page: 41 47
-41 46 bop 0 1225 a Fg(Chapter)65 b(5)0 1687 y Fm(CFITSIO)76
-b(Con)-6 b(v)g(en)g(tions)76 b(and)h(Guidelines)0 2216
-y Fe(5.1)135 b(CFITSIO)44 b(De\014nitions)0 2466 y Fj(An)m(y)30
-b(program)g(that)h(uses)f(the)h(CFITSIO)d(in)m(terface)j(m)m(ust)f
-(include)e(the)j(\014tsio.h)e(header)h(\014le)g(with)f(the)h(state-)0
-2579 y(men)m(t)95 2818 y Ff(#include)46 b("fitsio.h")0
-3057 y Fj(This)29 b(header)i(\014le)g(con)m(tains)g(the)g(protot)m(yp)s
-(es)h(for)f(all)f(the)h(CFITSIO)f(user)g(in)m(terface)i(routines)e(as)h
-(w)m(ell)f(as)i(the)0 3170 y(de\014nitions)e(of)i(v)-5
-b(arious)31 b(constan)m(ts)i(used)e(in)g(the)i(in)m(terface.)46
-b(It)32 b(also)g(de\014nes)f(a)i(C)f(structure)f(of)h(t)m(yp)s(e)h
-(`\014ts\014le')0 3283 y(that)j(is)f(used)g(b)m(y)g(CFITSIO)f(to)j
-(store)f(the)g(relev)-5 b(an)m(t)36 b(parameters)g(that)g(de\014ne)f
-(the)h(format)g(of)g(a)g(particular)0 3396 y(FITS)c(\014le.)47
-b(Application)31 b(programs)i(m)m(ust)g(de\014ne)f(a)h(p)s(oin)m(ter)f
-(to)h(this)f(structure)h(for)f(eac)m(h)i(FITS)e(\014le)g(that)i(is)0
-3508 y(to)i(b)s(e)f(op)s(ened.)56 b(This)34 b(structure)h(is)g
-(initialized)d(\(i.e.,)38 b(memory)d(is)g(allo)s(cated)g(for)h(the)g
-(structure\))f(when)g(the)0 3621 y(FITS)h(\014le)f(is)h(\014rst)f(op)s
-(ened)h(or)g(created)i(with)d(the)h(\014ts)p 1949 3621
-28 4 v 33 w(op)s(en)p 2172 3621 V 32 w(\014le)f(or)i(\014ts)p
-2596 3621 V 32 w(create)p 2864 3621 V 34 w(\014le)f(routines.)58
-b(This)34 b(\014ts\014le)0 3734 y(p)s(oin)m(ter)c(is)h(then)g(passed)g
-(as)g(the)h(\014rst)e(argumen)m(t)i(to)g(ev)m(ery)g(other)g(CFITSIO)d
-(routine)i(that)h(op)s(erates)g(on)f(the)0 3847 y(FITS)h(\014le.)47
-b(Application)31 b(programs)i(m)m(ust)g(not)g(directly)e(read)i(or)g
-(write)f(elemen)m(ts)h(in)f(this)g(\014ts\014le)f(structure)0
-3960 y(b)s(ecause)f(the)h(de\014nition)d(of)j(the)f(structure)g(ma)m(y)
-h(c)m(hange)g(in)f(future)f(v)m(ersions)h(of)g(CFITSIO.)0
-4120 y(A)45 b(n)m(um)m(b)s(er)e(of)i(sym)m(b)s(olic)e(constan)m(ts)j
-(are)f(also)f(de\014ned)g(in)f(\014tsio.h)h(for)g(the)h(con)m(v)m
-(enience)h(of)f(application)0 4233 y(programmers.)55
-b(Use)35 b(of)h(these)f(sym)m(b)s(olic)f(constan)m(ts)i(rather)f(than)g
-(the)h(actual)f(n)m(umeric)f(v)-5 b(alue)35 b(will)d(help)i(to)0
-4346 y(mak)m(e)d(the)g(source)f(co)s(de)h(more)g(readable)e(and)h
-(easier)h(for)f(others)g(to)h(understand.)0 4585 y Ff(String)46
-b(Lengths,)g(for)h(use)f(when)h(allocating)e(character)g(arrays:)95
-4811 y(#define)h(FLEN_FILENAME)e(1025)j(/*)g(max)g(length)f(of)h(a)h
-(filename)857 b(*/)95 4924 y(#define)46 b(FLEN_KEYWORD)140
-b(72)95 b(/*)47 b(max)g(length)f(of)h(a)h(keyword)905
-b(*/)95 5036 y(#define)46 b(FLEN_CARD)284 b(81)95 b(/*)47
-b(max)g(length)f(of)h(a)h(FITS)f(header)f(card)476 b(*/)95
-5149 y(#define)46 b(FLEN_VALUE)236 b(71)95 b(/*)47 b(max)g(length)f(of)
-h(a)h(keyword)e(value)g(string)285 b(*/)95 5262 y(#define)46
-b(FLEN_COMMENT)140 b(73)95 b(/*)47 b(max)g(length)f(of)h(a)h(keyword)e
-(comment)g(string)189 b(*/)95 5375 y(#define)46 b(FLEN_ERRMSG)188
-b(81)95 b(/*)47 b(max)g(length)f(of)h(a)h(CFITSIO)e(error)g(message)237
-b(*/)95 5488 y(#define)46 b(FLEN_STATUS)188 b(31)95 b(/*)47
-b(max)g(length)f(of)h(a)h(CFITSIO)e(status)g(text)g(string)h(*/)95
-5714 y(Note)g(that)g(FLEN_KEYWORD)d(is)j(longer)f(than)h(the)g(nominal)
-f(8-character)f(keyword)1905 5942 y Fj(41)p eop
-%%Page: 42 48
-42 47 bop 0 299 a Fj(42)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)95 555
-y Ff(name)47 b(length)f(because)g(the)h(HIERARCH)e(convention)g
-(supports)h(longer)g(keyword)g(names.)0 781 y(Access)g(modes)g(when)h
-(opening)f(a)h(FITS)g(file:)95 1007 y(#define)f(READONLY)94
-b(0)95 1120 y(#define)46 b(READWRITE)g(1)0 1346 y(BITPIX)g(data)h(type)
-f(code)h(values)f(for)h(FITS)g(images:)95 1571 y(#define)f(BYTE_IMG)284
-b(8)96 b(/*)f(8-bit)46 b(unsigned)f(integers)h(*/)95
-1684 y(#define)g(SHORT_IMG)189 b(16)95 b(/*)47 b(16-bit)141
-b(signed)46 b(integers)g(*/)95 1797 y(#define)g(LONG_IMG)237
-b(32)95 b(/*)47 b(32-bit)141 b(signed)46 b(integers)g(*/)95
-1910 y(#define)g(FLOAT_IMG)141 b(-32)95 b(/*)47 b(32-bit)f(single)g
-(precision)f(floating)h(point)g(*/)95 2023 y(#define)g(DOUBLE_IMG)93
-b(-64)i(/*)47 b(64-bit)f(double)g(precision)f(floating)h(point)g(*/)95
-2249 y(The)h(following)f(2)h(data)g(type)f(codes)h(are)g(also)f
-(supported)g(by)h(CFITSIO:)95 2362 y(#define)f(USHORT_IMG)93
-b(20)i(/*)47 b(16-bit)f(unsigned)g(integers,)f(equivalent)g(to)i(*/)
-1241 2475 y(/*)95 b(BITPIX)46 b(=)h(16,)g(BSCALE)f(=)i(1,)f(BZERO)f(=)i
-(32768)e(*/)95 2588 y(#define)g(ULONG_IMG)141 b(40)95
-b(/*)47 b(32-bit)f(unsigned)g(integers,)f(equivalent)g(to)i(*/)1241
-2700 y(/*)95 b(BITPIX)46 b(=)h(32,)g(BSCALE)f(=)i(1,)f(BZERO)f(=)i
-(2147483648)d(*/)0 2926 y(Codes)h(for)h(the)g(datatype)f(of)h(binary)f
-(table)g(columns)g(and/or)g(for)h(the)0 3039 y(datatype)f(of)h
-(variables)e(when)i(reading)e(or)j(writing)d(keywords)h(or)h(data:)1432
-3265 y(DATATYPE)714 b(TFORM)46 b(CODE)95 3378 y(#define)g(TBIT)476
-b(1)96 b(/*)1335 b('X')47 b(*/)95 3491 y(#define)f(TBYTE)381
-b(11)95 b(/*)47 b(8-bit)f(unsigned)g(byte,)332 b('B')47
-b(*/)95 3604 y(#define)f(TLOGICAL)237 b(14)95 b(/*)47
-b(logicals)e(\(int)i(for)g(keywords)236 b(*/)1289 3717
-y(/*)95 b(and)46 b(char)h(for)g(table)f(cols)142 b('L')47
-b(*/)95 3830 y(#define)f(TSTRING)285 b(16)95 b(/*)47
-b(ASCII)f(string,)666 b('A')47 b(*/)95 3942 y(#define)f(TSHORT)333
-b(21)95 b(/*)47 b(signed)f(short,)666 b('I')47 b(*/)95
-4055 y(#define)f(TINT32BIT)189 b(41)95 b(/*)47 b(signed)f(32-bit)g
-(int,)428 b('J')47 b(*/)95 4168 y(#define)f(TLONG)381
-b(41)95 b(/*)47 b(signed)f(long,)905 b(*/)95 4281 y(#define)46
-b(TFLOAT)333 b(42)95 b(/*)47 b(single)f(precision)f(float,)189
-b('E')47 b(*/)95 4394 y(#define)f(TDOUBLE)285 b(82)95
-b(/*)47 b(double)f(precision)f(float,)189 b('D')47 b(*/)95
-4507 y(#define)f(TCOMPLEX)237 b(83)95 b(/*)47 b(complex)f(\(pair)g(of)h
-(floats\))141 b('C')47 b(*/)95 4620 y(#define)f(TDBLCOMPLEX)f(163)95
-b(/*)47 b(double)f(complex)g(\(2)h(doubles\))e('M')i(*/)95
-4846 y(The)g(following)f(data)g(type)h(codes)f(are)h(also)g(supported)e
-(by)i(CFITSIO:)95 4959 y(#define)f(TINT)429 b(31)95 b(/*)47
-b(int)1335 b(*/)95 5072 y(#define)46 b(TUINT)381 b(30)95
-b(/*)47 b(unsigned)e(int)906 b(*/)95 5185 y(#define)46
-b(TUSHORT)285 b(20)95 b(/*)47 b(unsigned)e(short)810
-b(*/)95 5297 y(#define)46 b(TULONG)333 b(40)95 b(/*)47
-b(unsigned)e(long)858 b(*/)0 5523 y(HDU)47 b(type)g(code)f(values)g
-(\(value)g(returned)g(when)h(moving)f(to)h(new)g(HDU\):)p
-eop
-%%Page: 43 49
-43 48 bop 0 299 a Fh(5.2.)72 b(CFITSIO)29 b(SIZE)g(LIMIT)-8
-b(A)g(TIONS)2345 b Fj(43)95 555 y Ff(#define)46 b(IMAGE_HDU)93
-b(0)i(/*)48 b(Primary)d(Array)i(or)g(IMAGE)f(HDU)h(*/)95
-668 y(#define)f(ASCII_TBL)93 b(1)i(/*)48 b(ASCII)94 b(table)46
-b(HDU)h(*/)95 781 y(#define)f(BINARY_TBL)f(2)95 b(/*)48
-b(Binary)e(table)g(HDU)h(*/)95 894 y(#define)f(ANY_HDU)142
-b(-1)94 b(/*)48 b(matches)d(any)i(type)g(of)g(HDU)g(*/)0
-1120 y(Column)f(name)h(and)g(string)f(matching)f(case-sensitivity:)95
-1346 y(#define)h(CASESEN)142 b(1)g(/*)48 b(do)f(case-sensitive)d
-(string)i(match)g(*/)95 1458 y(#define)g(CASEINSEN)g(0)142
-b(/*)48 b(do)f(case-insensitive)c(string)j(match)h(*/)0
-1684 y(Logical)f(states)g(\(if)h(TRUE)f(and)h(FALSE)g(are)g(not)g
-(already)e(defined\):)95 1910 y(#define)h(TRUE)h(1)95
-2023 y(#define)f(FALSE)h(0)0 2249 y(Values)f(to)h(represent)f
-(undefined)f(floating)g(point)i(numbers:)95 2475 y(#define)f
-(FLOATNULLVALUE)e(-9.11912E-36F)95 2588 y(#define)i(DOUBLENULLVALUE)e
-(-9.1191291391491E-36)0 3001 y Fe(5.2)135 b(CFITSIO)44
-b(Size)h(Limitations)0 3267 y Fj(CFITSIO)31 b(places)h(few)h
-(restrictions)e(on)i(the)f(size)h(of)f(FITS)g(\014les)g(that)h(it)f
-(reads)g(or)h(writes.)46 b(There)32 b(are)h(a)g(few)0
-3380 y(limits,)28 b(ho)m(w)m(ev)m(er,)k(whic)m(h)d(ma)m(y)i(a\013ect)h
-(some)f(extreme)g(cases:)0 3540 y(1.)48 b(The)33 b(maxim)m(um)e(n)m(um)
-m(b)s(er)h(of)h(\014les)f(that)h(ma)m(y)g(b)s(e)g(sim)m(ultaneously)d
-(op)s(ened)i(is)g(limited)f(to)i(the)g(n)m(um)m(b)s(er)f(of)0
-3653 y(in)m(ternal)25 b(IO)g(bu\013ers)g(allo)s(cated)h(in)e(CFITSIO)h
-(\(curren)m(tly)g(25,)j(as)e(de\014ned)f(b)m(y)h(NIOBUF)g(in)f(the)h
-(\014le)f(\014tsio2.h\),)0 3766 y(or)34 b(b)m(y)g(the)g(limit)e(of)i
-(the)g(underlying)d(C)i(compiler)g(or)h(mac)m(hine)f(op)s(erating)h
-(system,)h(whic)m(h)d(ev)m(er)j(is)e(smaller.)0 3878
-y(The)28 b(C)h(sym)m(b)s(olic)e(constan)m(t)j(F)m(OPEN)p
-1344 3878 28 4 v 33 w(MAX)g(usually)c(de\014nes)i(the)h(total)h(n)m(um)
-m(b)s(er)d(of)i(\014les)f(that)i(ma)m(y)f(op)s(en)f(at)0
-3991 y(once)j(\(this)f(includes)e(an)m(y)i(other)h(text)g(or)g(binary)d
-(\014les)i(whic)m(h)f(ma)m(y)i(b)s(e)f(op)s(en,)f(not)i(just)f(FITS)g
-(\014les\).)0 4152 y(2.)50 b(The)32 b(maxim)m(um)g(n)m(um)m(b)s(er)g
-(of)i(extensions)e(\(HDUs\))j(that)f(can)f(b)s(e)g(read)g(or)g(written)
-f(in)g(a)i(single)d(FITS)i(\014le)0 4264 y(is)c(curren)m(tly)g(set)i
-(to)f(1000)i(as)e(de\014ned)f(b)m(y)h(MAXHDU)h(in)e(the)h(\014tsio.h)f
-(\014le.)40 b(This)28 b(v)-5 b(alue)30 b(ma)m(y)g(b)s(e)g(increased)f
-(if)0 4377 y(necessary)-8 b(,)31 b(but)f(the)h(access)g(times)f(to)h
-(the)g(later)f(extensions)g(in)f(suc)m(h)h(\014les)g(ma)m(y)h(b)s
-(ecome)f(excessiv)m(ely)h(long.)0 4538 y(3.)54 b(By)35
-b(default,)g(CFITSIO)e(can)i(handle)f(FITS)g(\014les)f(up)h(to)h(2.1)h
-(GB)g(in)d(size)i(\(2**31)i(b)m(ytes\).)54 b(This)33
-b(\014le)h(size)0 4650 y(limit)k(is)i(often)g(imp)s(osed)f(b)m(y)h
-(32-bit)h(op)s(erating)e(systems.)71 b(More)41 b(recen)m(tly)-8
-b(,)44 b(as)d(64-bit)f(op)s(erating)g(systems)0 4763
-y(b)s(ecome)33 b(more)g(common,)g(an)g(industry-wide)c(standard)j(\(at)
-i(least)e(on)h(Unix)e(systems\))i(has)g(b)s(een)f(dev)m(elop)s(ed)0
-4876 y(to)39 b(supp)s(ort)d(larger)h(sized)h(\014les)f(\(see)h(h)m
-(ttp://ftp.sas.com/standards/large.\014le/\).)66 b(Starting)38
-b(with)e(v)m(ersion)0 4989 y(2.1)j(of)e(CFITSIO,)g(larger)g(FITS)g
-(\014les)f(up)h(to)h(6)g(terab)m(ytes)h(in)d(size)h(ma)m(y)i(b)s(e)e
-(read)g(and)g(written)g(on)g(certain)0 5102 y(supp)s(orted)32
-b(platforms.)50 b(In)34 b(order)f(to)i(supp)s(ort)d(these)i(larger)g
-(\014les,)g(CFITSIO)f(m)m(ust)g(b)s(e)h(compiled)e(with)h(the)0
-5215 y(`-D)p 129 5215 V 34 w(FILE)p 374 5215 V 32 w(OFFSET)p
-774 5215 V 32 w(BITS=64')25 b(compiler)e(\015ag.)39 b(All)23
-b(programs)h(whic)m(h)f(link)f(to)j(the)f(CFITSIO)f(library)f(m)m(ust)0
-5328 y(also)j(b)s(e)f(compiled)f(with)h(this)f(\015ag)i(or)g(m)m(ust)g
-(include)d(this)i(prepro)s(cessor)g(de\014nition)e(at)k(the)f(start)g
-(of)g(the)g(source)0 5441 y(co)s(de)37 b(\014le.)60 b(This)35
-b(causes)i(the)g(compiler)f(to)h(allo)s(cate)h(8-b)m(ytes)g(instead)e
-(of)h(4-b)m(ytes)h(for)f(the)g(`o\013)p 3423 5441 V 34
-w(t')g(datat)m(yp)s(e)0 5554 y(whic)m(h)29 b(is)h(used)f(to)i(store)g
-(\014le)f(o\013set)h(p)s(ositions.)0 5714 y(If)20 b(CFITSIO)f(is)h
-(compiled)f(with)h(the)g(-D)p 1383 5714 V 34 w(FILE)p
-1628 5714 V 33 w(OFFSET)p 2029 5714 V 32 w(BITS=64)g(\015ag)h(on)g(a)g
-(platform)f(that)h(supp)s(orts)e(large)p eop
-%%Page: 44 50
-44 49 bop 0 299 a Fj(44)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fj(\014les,)c(then)g(it)g(can)h(read)f(and)g(write)g(FITS)f(\014les)h
-(that)h(con)m(tain)f(up)g(to)h(2**31)h(2880-b)m(yte)i(FITS)26
-b(records,)i(or)g(ap-)0 668 y(pro)m(ximately)c(6)g(terab)m(ytes)i(in)d
-(size.)39 b(It)24 b(is)f(still)f(required)h(that)i(the)f(v)-5
-b(alue)24 b(of)h(the)f(NAXISn)g(and)f(PCOUNT)h(k)m(ey-)0
-781 y(w)m(ords)h(in)f(eac)m(h)i(extension)f(b)s(e)g(within)d(the)k
+%%Page: 27 35
+27 34 bop 0 299 a Fh(4.13.)73 b(CFITSIO)28 b(SIZE)h(LIMIT)-8
+b(A)g(TIONS)2300 b Fj(27)0 555 y(or)39 b(op)s(erating)g(system,)k(ma)m
+(y)d(ha)m(v)m(e)g(a)g(smaller)e(limit)g(on)h(the)h(n)m(um)m(b)s(er)e
+(of)i(op)s(ened)e(\014les.)67 b(The)39 b(C)h(sym)m(b)s(olic)0
+668 y(constan)m(t)31 b(F)m(OPEN)p 690 668 28 4 v 34 w(MAX)f(is)f(in)m
+(tended)g(to)i(de\014ne)e(the)i(maxim)m(um)e(n)m(um)m(b)s(er)f(of)j
+(\014les)e(that)h(ma)m(y)h(op)s(en)e(at)i(once)0 781
+y(\(including)d(an)m(y)j(other)g(text)h(or)f(binary)e(\014les)h(that)i
+(ma)m(y)f(b)s(e)g(op)s(en,)f(not)h(just)g(FITS)f(\014les\).)42
+b(On)30 b(some)h(systems)0 894 y(it)f(has)g(b)s(een)g(found)f(that)i
+(gcc)g(supp)s(orts)e(a)h(maxim)m(um)g(of)g(255)i(op)s(ened)e(\014les.)0
+1054 y(Note)d(that)e(op)s(ening)f(and)h(op)s(erating)g(on)g(man)m(y)g
+(FITS)g(\014les)f(sim)m(ultaneously)f(in)h(parallel)f(ma)m(y)j(b)s(e)f
+(less)f(e\016cien)m(t)0 1167 y(than)k(op)s(erating)g(on)g(smaller)f
+(groups)h(of)h(\014les)e(in)g(series.)40 b(CFITSIO)27
+b(only)g(has)h(NIOBUF)h(n)m(um)m(b)s(er)f(of)g(in)m(ternal)0
+1280 y(bu\013ers)j(\(set)j(=)e(40)i(b)m(y)e(default\))h(that)g(are)g
+(used)f(for)g(temp)s(orary)g(storage)i(of)f(the)g(most)g(recen)m(t)h
+(data)f(records)0 1393 y(that)40 b(ha)m(v)m(e)g(b)s(een)e(read)h(or)g
+(written)f(in)f(the)i(FITS)f(\014les.)66 b(If)38 b(the)h(n)m(um)m(b)s
+(er)f(of)h(op)s(ened)f(\014les)g(is)g(greater)i(than)0
+1506 y(NIOBUF,)j(then)f(CFITSIO)e(ma)m(y)j(w)m(aste)h(more)e(time)g
+(\015ushing)d(and)j(re-reading)g(or)g(re-writing)e(the)j(same)0
+1619 y(records)30 b(in)f(the)i(FITS)e(\014les.)0 1779
+y(2.)79 b(By)43 b(default,)j(CFITSIO)41 b(can)j(handle)d(FITS)i
+(\014les)f(up)f(to)j(2.1)g(GB)g(in)e(size)h(\(2**31)i(b)m(ytes\).)80
+b(This)41 b(\014le)0 1892 y(size)e(limit)d(is)i(often)h(imp)s(osed)e(b)
+m(y)i(32-bit)g(op)s(erating)f(systems.)66 b(More)40 b(recen)m(tly)-8
+b(,)42 b(as)d(64-bit)g(op)s(erating)f(sys-)0 2005 y(tems)e(b)s(ecome)h
+(more)f(common,)i(an)e(industry-wide)d(standard)i(\(at)j(least)e(on)g
+(Unix)f(systems\))i(has)e(b)s(een)h(de-)0 2118 y(v)m(elop)s(ed)f(to)i
+(supp)s(ort)d(larger)i(sized)f(\014les)g(\(see)i(h)m
+(ttp://ftp.sas.com/standards/large.\014le/\).)60 b(Starting)35
+b(with)0 2230 y(v)m(ersion)i(2.1)h(of)f(CFITSIO,)f(larger)h(FITS)g
+(\014les)f(up)g(to)i(6)g(terab)m(ytes)g(in)e(size)h(ma)m(y)h(b)s(e)f
+(read)g(and)g(written)f(on)0 2343 y(certain)i(supp)s(orted)e
+(platforms.)63 b(In)38 b(order)f(to)i(supp)s(ort)e(these)h(larger)g
+(\014les,)h(CFITSIO)e(m)m(ust)h(b)s(e)f(compiled)0 2456
+y(with)43 b(the)h(`-D)p 520 2456 V 34 w(FILE)p 765 2456
+V 33 w(OFFSET)p 1166 2456 V 32 w(BITS=64')g(compiler)f(\015ag.)83
+b(Some)45 b(platforms)e(ma)m(y)i(also)f(require)f(the)h(`-)0
+2569 y(D)p 74 2569 V 33 w(LAR)m(GE)p 429 2569 V 34 w(FILES')c(compiler)
+f(\015ag.)71 b(All)39 b(programs)h(that)h(link)e(to)i(the)g(CFITSIO)e
+(library)f(m)m(ust)i(also)h(b)s(e)0 2682 y(compiled)29
+b(with)g(this)g(\015ag)i(or)g(m)m(ust)f(include)e(this)h(prepro)s
+(cessor)h(de\014nition)e(at)j(the)g(start)g(of)f(the)h(source)g(co)s
+(de)0 2795 y(\014le.)40 b(This)29 b(causes)i(the)f(compiler)f(to)j
+(allo)s(cate)f(8-b)m(ytes)g(instead)f(of)h(4-b)m(ytes)h(for)e(the)g
+(`o\013)p 3110 2795 V 34 w(t')h(data)g(t)m(yp)s(e)g(that)g(is)0
+2908 y(used)f(to)h(store)g(\014le)e(o\013set)j(p)s(ositions.)0
+3068 y(If)20 b(CFITSIO)f(is)h(compiled)f(with)h(the)g(-D)p
+1383 3068 V 34 w(FILE)p 1628 3068 V 33 w(OFFSET)p 2029
+3068 V 32 w(BITS=64)g(\015ag)h(on)g(a)g(platform)f(that)h(supp)s(orts)e
+(large)0 3181 y(\014les,)27 b(then)g(it)g(can)h(read)f(and)g(write)g
+(FITS)f(\014les)h(that)h(con)m(tain)f(up)g(to)h(2**31)h(2880-b)m(yte)i
+(FITS)26 b(records,)i(or)g(ap-)0 3294 y(pro)m(ximately)c(6)g(terab)m
+(ytes)i(in)d(size.)39 b(It)24 b(is)f(still)f(required)h(that)i(the)f(v)
+-5 b(alue)24 b(of)h(the)f(NAXISn)g(and)f(PCOUNT)h(k)m(ey-)0
+3407 y(w)m(ords)h(in)f(eac)m(h)i(extension)f(b)s(e)g(within)d(the)k
 (range)f(of)h(a)f(signed)f(4-b)m(yte)j(in)m(teger)f(\(max)f(v)-5
-b(alue)25 b(=)g(2,147,483,648\).)0 894 y(Th)m(us,)39
+b(alue)25 b(=)g(2,147,483,648\).)0 3520 y(Th)m(us,)39
 b(eac)m(h)h(dimension)c(of)i(an)g(image)h(\(giv)m(en)f(b)m(y)h(the)f
 (NAXISn)g(k)m(eyw)m(ords\),)j(the)d(total)h(width)e(of)h(a)h(table)0
-1007 y(\(NAXIS1)e(k)m(eyw)m(ord\),)i(the)e(n)m(um)m(b)s(er)e(of)h(ro)m
+3633 y(\(NAXIS1)e(k)m(eyw)m(ord\),)i(the)e(n)m(um)m(b)s(er)e(of)h(ro)m
 (ws)h(in)e(a)i(table)f(\(NAXIS2)h(k)m(eyw)m(ord\),)i(and)d(the)h(total)
-g(size)f(of)h(the)0 1120 y(v)-5 b(ariable-length)29 b(arra)m(y)i(heap)f
+g(size)f(of)h(the)0 3745 y(v)-5 b(ariable-length)29 b(arra)m(y)i(heap)f
 (in)f(binary)g(tables)h(\(PCOUNT)g(k)m(eyw)m(ord\))h(m)m(ust)f(b)s(e)g
-(less)g(than)g(this)f(limit.)0 1280 y(Curren)m(tly)-8
-b(,)27 b(supp)s(ort)e(for)i(large)g(\014les)f(within)f(CFITSIO)h(has)h
-(only)f(b)s(een)g(tested)i(on)f(the)h(Solaris)d(2.6)j(op)s(erating)0
-1393 y(system)j(using)d(the)j(Sun)e(cc)i(compiler)e(or)h(gcc)i(2.95.2.)
-0 1750 y Fe(5.3)135 b(Multiple)46 b(Access)e(to)i(the)f(Same)g(FITS)f
-(File)0 2005 y Fj(CFITSIO)35 b(supp)s(orts)g(sim)m(ultaneous)g(read)h
-(and)g(write)g(access)h(to)h(m)m(ultiple)c(HDUs)j(in)e(the)i(same)g
-(FITS)f(\014le.)0 2118 y(Th)m(us,)43 b(one)e(can)h(op)s(en)e(the)h
-(same)h(FITS)e(\014le)g(t)m(wice)i(within)c(a)k(single)d(program)i(and)
-g(mo)m(v)m(e)h(to)g(2)f(di\013eren)m(t)0 2231 y(HDUs)30
-b(in)e(the)i(\014le,)f(and)g(then)g(read)h(and)e(write)h(data)h(or)g(k)
-m(eyw)m(ords)g(to)g(the)g(2)f(extensions)h(just)e(as)i(if)f(one)g(w)m
-(ere)0 2344 y(accessing)e(2)g(completely)f(separate)h(FITS)f(\014les.)
-38 b(Since)26 b(in)f(general)h(it)g(is)g(not)h(p)s(ossible)d(to)j(ph)m
-(ysically)d(op)s(en)i(the)0 2457 y(same)36 b(\014le)f(t)m(wice)h(and)f
-(then)g(exp)s(ect)h(to)g(b)s(e)f(able)g(to)i(sim)m(ultaneously)c(\(or)j
-(in)e(alternating)h(succession\))h(write)0 2570 y(to)f(2)f(di\013eren)m
-(t)g(lo)s(cations)g(in)e(the)j(\014le,)f(CFITSIO)f(recognizes)i(when)e
-(the)h(\014le)f(to)i(b)s(e)f(op)s(ened)f(\(in)g(the)i(call)e(to)0
-2683 y(\014ts)p 127 2683 28 4 v 32 w(op)s(en)p 349 2683
-V 33 w(\014le\))28 b(has)g(already)g(b)s(een)g(op)s(ened)g(and)g
-(instead)g(of)h(actually)f(op)s(ening)f(the)i(\014le)f(again,)h(just)f
-(logically)0 2796 y(links)g(the)j(new)f(\014le)g(to)h(the)g(old)e
-(\014le.)41 b(\(This)29 b(only)h(applies)e(if)i(the)h(\014le)e(is)h(op)
-s(ened)g(more)g(than)g(once)i(within)c(the)0 2908 y(same)g(program,)g
-(and)f(do)s(es)h(not)f(prev)m(en)m(t)i(the)f(same)g(\014le)e(from)h(b)s
-(eing)g(sim)m(ultaneously)e(op)s(ened)i(b)m(y)g(more)h(than)0
-3021 y(one)h(program\).)40 b(Then)28 b(b)s(efore)g(CFITSIO)f(reads)h
-(or)h(writes)f(to)h(either)f(\(logical\))h(\014le,)f(it)g(mak)m(es)i
-(sure)d(that)j(an)m(y)0 3134 y(mo)s(di\014cations)g(made)h(to)h(the)g
-(other)g(\014le)e(ha)m(v)m(e)j(b)s(een)e(completely)g(\015ushed)e(from)
-i(the)h(in)m(ternal)e(bu\013ers)h(to)h(the)0 3247 y(\014le.)43
-b(Th)m(us,)30 b(in)g(principle,)f(one)i(could)f(op)s(en)h(a)h(\014le)e
-(t)m(wice,)i(in)e(one)i(case)g(p)s(oin)m(ting)e(to)i(the)f(\014rst)g
-(extension)g(and)0 3360 y(in)i(the)i(other)g(p)s(oin)m(ting)d(to)k(the)
-e(2nd)g(extension)h(and)e(then)i(write)e(data)j(to)f(b)s(oth)f
-(extensions,)h(in)e(an)m(y)i(order,)0 3473 y(without)24
-b(danger)i(of)f(corrupting)g(the)g(\014le,)h(There)f(ma)m(y)h(b)s(e)f
-(some)h(e\016ciency)f(p)s(enalties)f(in)g(doing)h(this)f(ho)m(w)m(ev)m
-(er,)0 3586 y(since)j(CFITSIO)g(has)h(to)h(\015ush)d(all)h(the)h(in)m
-(ternal)f(bu\013ers)g(related)h(to)h(one)f(\014le)f(b)s(efore)h(switc)m
-(hing)e(to)j(the)f(other,)0 3699 y(so)i(it)g(w)m(ould)f(still)f(b)s(e)i
-(pruden)m(t)f(to)i(minimize)d(the)i(n)m(um)m(b)s(er)f(of)i(times)e(one)
-i(switc)m(hes)f(bac)m(k)h(and)e(forth)h(b)s(et)m(w)m(een)0
-3812 y(doing)f(I/O)i(to)g(di\013eren)m(t)f(HDUs)h(in)e(the)h(same)h
-(\014le.)0 4169 y Fe(5.4)135 b(Curren)l(t)46 b(Header)f(Data)h(Unit)g
-(\(CHDU\))0 4424 y Fj(In)32 b(general,)i(a)g(FITS)e(\014le)h(can)g(con)
-m(tain)g(m)m(ultiple)e(Header)j(Data)h(Units,)e(also)g(called)f
-(extensions.)48 b(CFITSIO)0 4537 y(only)37 b(op)s(erates)i(within)d
-(one)i(HDU)h(at)g(an)m(y)g(giv)m(en)f(time,)i(and)e(the)g(curren)m(tly)
-f(selected)i(HDU)g(is)e(called)h(the)0 4650 y(Curren)m(t)h(Header)h
-(Data)h(Unit)e(\(CHDU\).)i(When)f(a)g(FITS)f(\014le)g(is)f(\014rst)h
-(created)i(or)f(op)s(ened)f(the)h(CHDU)g(is)0 4763 y(automatically)25
-b(de\014ned)e(to)j(b)s(e)e(the)h(\014rst)f(HDU)i(\(i.e.,)g(the)f
-(primary)e(arra)m(y\).)40 b(CFITSIO)23 b(routines)h(are)h(pro)m(vided)0
-4876 y(to)36 b(mo)m(v)m(e)h(to)g(and)e(op)s(en)g(an)m(y)h(other)g
-(existing)e(HDU)j(within)c(the)j(FITS)f(\014le)f(or)i(to)g(app)s(end)e
-(or)i(insert)e(a)i(new)0 4989 y(HDU)31 b(in)e(the)i(FITS)e(\014le)h
-(whic)m(h)f(then)h(b)s(ecomes)h(the)f(CHDU.)0 5346 y
-Fe(5.5)135 b(F)-11 b(unction)44 b(Names)i(and)f(Datat)l(yp)t(es)0
-5601 y Fj(All)25 b(the)i(CFITSIO)e(functions)h(ha)m(v)m(e)i(b)s(oth)e
-(a)h(short)f(name)h(as)g(w)m(ell)e(as)i(a)h(longer)e(descriptiv)m(e)f
-(name.)40 b(The)26 b(short)0 5714 y(name)i(is)f(only)g(5)h(or)g(6)g(c)m
-(haracters)h(long)f(and)f(is)g(similar)e(to)k(the)f(subroutine)d(name)j
-(in)f(the)h(F)-8 b(ortran-77)29 b(v)m(ersion)p eop
-%%Page: 45 51
-45 50 bop 0 299 a Fh(5.5.)72 b(FUNCTION)30 b(NAMES)h(AND)g(D)m(A)-8
-b(T)g(A)g(TYPES)1916 b Fj(45)0 555 y(of)31 b(FITSIO.)f(The)h(longer)f
-(name)i(is)e(more)h(descriptiv)m(e)f(and)g(it)h(is)f(recommended)h
-(that)g(it)g(b)s(e)f(used)g(instead)h(of)0 668 y(the)g(short)f(name)g
-(to)h(more)g(clearly)e(do)s(cumen)m(t)i(the)f(source)h(co)s(de.)0
-828 y(Man)m(y)d(of)g(the)g(CFITSIO)e(routines)h(come)h(in)f(families)e
-(whic)m(h)i(di\013er)f(only)h(in)f(the)i(datat)m(yp)s(e)h(of)f(the)f
-(asso)s(ciated)0 941 y(parameter\(s\).)50 b(The)33 b(datat)m(yp)s(e)h
-(of)f(these)h(routines)e(is)g(indicated)g(b)m(y)h(the)g(su\016x)f(of)i
-(the)f(routine)f(name.)49 b(The)0 1054 y(short)27 b(routine)g(names)h
-(ha)m(v)m(e)h(a)f(1)g(or)f(2)h(c)m(haracter)i(su\016x)c(\(e.g.,)31
-b('j')c(in)g('\013pkyj'\))h(while)d(the)j(long)f(routine)g(names)0
-1167 y(ha)m(v)m(e)32 b(a)e(4)h(c)m(haracter)h(or)e(longer)g(su\016x)g
-(as)g(sho)m(wn)g(in)f(the)i(follo)m(wing)e(table:)191
-1417 y Ff(Long)285 b(Short)94 b(Data)191 1530 y(Names)237
-b(Names)94 b(Type)191 1643 y(-----)237 b(-----)94 b(----)191
-1756 y(_bit)381 b(x)190 b(bit)191 1869 y(_byt)381 b(b)190
-b(unsigned)46 b(byte)191 1982 y(_sht)381 b(i)190 b(short)47
-b(integer)191 2095 y(_lng)381 b(j)190 b(long)47 b(integer)191
-2208 y(_usht)333 b(ui)142 b(unsigned)46 b(short)g(integer)191
-2321 y(_ulng)333 b(uj)142 b(unsigned)46 b(long)g(integer)191
-2433 y(_uint)333 b(uk)142 b(unsigned)46 b(int)h(integer)191
-2546 y(_int)381 b(k)190 b(int)47 b(integer)191 2659 y(_flt)381
-b(e)190 b(real)47 b(exponential)e(floating)g(point)i(\(float\))191
-2772 y(_fixflt)237 b(f)190 b(real)47 b(fixed-decimal)d(format)i
-(floating)g(point)g(\(float\))191 2885 y(_dbl)381 b(d)190
-b(double)46 b(precision)g(real)g(floating-point)e(\(double\))191
-2998 y(_fixdbl)237 b(g)190 b(double)46 b(precision)g(fixed-format)e
-(floating)i(point)g(\(double\))191 3111 y(_cmp)381 b(c)190
-b(complex)46 b(reals)g(\(pairs)h(of)g(float)f(values\))191
-3224 y(_fixcmp)237 b(fc)142 b(complex)46 b(reals,)g(fixed-format)f
-(floating)g(point)191 3337 y(_dblcmp)237 b(m)190 b(double)46
-b(precision)g(complex)f(\(pairs)i(of)g(double)f(values\))191
-3450 y(_fixdblcmp)93 b(fm)142 b(double)46 b(precision)g(complex,)f
-(fixed-format)g(floating)g(point)191 3563 y(_log)381
-b(l)190 b(logical)46 b(\(int\))191 3675 y(_str)381 b(s)190
-b(character)46 b(string)0 3926 y Fj(The)35 b(logical)f(datat)m(yp)s(e)i
-(corresp)s(onds)e(to)h(`in)m(t')g(for)g(logical)g(k)m(eyw)m(ord)g(v)-5
-b(alues,)36 b(and)e(`b)m(yte')i(for)f(logical)g(binary)0
-4039 y(table)41 b(columns.)73 b(In)41 b(otherw)m(ords,)j(the)e(v)-5
-b(alue)41 b(when)g(writing)e(a)j(logical)f(k)m(eyw)m(ord)h(m)m(ust)f(b)
-s(e)g(stored)h(in)e(an)0 4152 y(`in)m(t')e(v)-5 b(ariable,)38
-b(and)g(m)m(ust)f(b)s(e)g(stored)h(in)f(a)h(`c)m(har')h(arra)m(y)f
-(when)f(reading)g(or)g(writing)f(to)j(`L')f(columns)e(in)h(a)0
-4264 y(binary)e(table.)59 b(Inplicit)34 b(data)j(t)m(yp)s(e)f(con)m(v)m
-(ersion)h(is)f(not)h(supp)s(orted)d(for)i(logical)g(table)h(columns,)g
-(but)f(is)f(for)0 4377 y(k)m(eyw)m(ords,)30 b(so)f(a)h(logical)e(k)m
-(eyw)m(ord)i(ma)m(y)f(b)s(e)g(read)f(and)h(cast)h(to)g(an)m(y)f(n)m
-(umerical)f(data)h(t)m(yp)s(e;)h(a)g(returned)d(v)-5
-b(alue)0 4490 y(=)30 b(0)h(indicates)e(false,)h(and)g(an)m(y)h(other)f
-(v)-5 b(alue)30 b(=)g(true.)0 4650 y(The)c(`in)m(t')g(datat)m(yp)s(e)h
-(ma)m(y)g(b)s(e)e(2)i(b)m(ytes)f(long)g(on)g(some)h(IBM)f(PC)g
-(compatible)f(systems)h(and)g(is)f(usually)f(4)i(b)m(ytes)0
-4763 y(long)32 b(on)g(most)h(other)g(systems.)46 b(Some)33
-b(64-bit)g(mac)m(hines,)f(ho)m(w)m(ev)m(er,)j(lik)m(e)c(the)i(Dec)h
-(Alpha/OSF,)d(de\014ne)h(the)0 4876 y(`short',)42 b(`in)m(t',)f(and)d
-(`long')i(in)m(teger)f(datat)m(yp)s(es)h(to)g(b)s(e)e(2,)k(4,)f(and)e
-(8)g(b)m(ytes)h(long,)h(resp)s(ectiv)m(ely)-8 b(.)66
-b(The)39 b(FITS)0 4989 y(standard)32 b(only)g(supp)s(orts)g(2)h(and)g
-(4)g(b)m(yte)h(in)m(teger)f(data)h(t)m(yp)s(es,)g(so)f(CFITSIO)f(in)m
-(ternally)f(con)m(v)m(erts)j(b)s(et)m(w)m(een)0 5102
-y(4)d(and)f(8)g(b)m(ytes)h(when)f(reading)f(or)h(writing)f(`long')h(in)
-m(tegers)h(on)f(Alpha/OSF)f(systems.)0 5262 y(When)c(dealing)e(with)h
-(the)h(FITS)f(b)m(yte)h(datat)m(yp)s(e)h(it)f(is)e(imp)s(ortan)m(t)i
-(to)g(remem)m(b)s(er)f(that)i(the)f(ra)m(w)g(v)-5 b(alues)24
-b(\(b)s(efore)0 5375 y(an)m(y)h(scaling)e(b)m(y)h(the)h(BSCALE)e(and)h
-(BZER)m(O,)g(or)h(TSCALn)d(and)i(TZER)m(On)f(k)m(eyw)m(ord)i(v)-5
-b(alues\))24 b(in)f(b)m(yte)i(arra)m(ys)0 5488 y(\(BITPIX)37
-b(=)f(8\))h(or)f(b)m(yte)i(columns)d(\(TF)m(ORMn)i(=)f('B'\))h(are)g
-(in)m(terpreted)f(as)h(unsigned)d(b)m(ytes)j(with)f(v)-5
-b(alues)0 5601 y(ranging)33 b(from)h(0)g(to)h(255.)53
-b(Some)34 b(C)g(compilers)f(de\014ne)g(a)h('c)m(har')h(v)-5
-b(ariable)33 b(as)i(signed,)f(so)g(it)g(is)f(imp)s(ortan)m(t)g(to)0
-5714 y(explicitly)28 b(declare)i(a)h(n)m(umeric)e(c)m(har)i(v)-5
-b(ariable)29 b(as)i('unsigned)d(c)m(har')j(to)g(a)m(v)m(oid)g(an)m(y)g
-(am)m(biguit)m(y)p eop
-%%Page: 46 52
-46 51 bop 0 299 a Fj(46)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fj(One)22 b(feature)h(of)g(the)g(CFITSIO)e(routines)h(is)f(that)j(they)
-f(can)g(op)s(erate)g(on)f(a)h(`X')h(\(bit\))e(column)g(in)f(a)i(binary)
-e(table)0 668 y(as)35 b(though)e(it)h(w)m(ere)h(a)g(`B')g(\(b)m(yte\))g
-(column.)52 b(F)-8 b(or)35 b(example)f(a)g(`11X')i(datat)m(yp)s(e)f
-(column)e(can)i(b)s(e)f(in)m(terpreted)0 781 y(the)28
-b(same)h(as)f(a)g(`2B')i(column)d(\(i.e.,)i(2)f(unsigned)e(8-bit)i(b)m
-(ytes\).)41 b(In)27 b(some)i(instances,)f(it)f(can)i(b)s(e)e(more)h
-(e\016cien)m(t)0 894 y(to)j(read)f(and)g(write)g(whole)f(b)m(ytes)i(at)
-g(a)g(time,)f(rather)h(than)f(reading)f(or)i(writing)d(eac)m(h)k
-(individual)25 b(bit.)0 1054 y(The)39 b(complex)g(and)g(double)g
-(precision)e(complex)j(datat)m(yp)s(es)g(are)g(not)g(directly)e(supp)s
-(orted)g(in)g(ANSI)i(C)f(so)0 1167 y(these)26 b(datat)m(yp)s(es)h
-(should)d(b)s(e)h(in)m(terpreted)g(as)i(pairs)d(of)i(\015oat)h(or)f
-(double)e(v)-5 b(alues,)26 b(resp)s(ectiv)m(ely)-8 b(,)27
-b(where)f(the)g(\014rst)0 1280 y(v)-5 b(alue)30 b(in)f(eac)m(h)i(pair)f
-(is)f(the)i(real)f(part,)g(and)g(the)g(second)h(is)e(the)i(imaginary)e
-(part.)0 1606 y Fe(5.6)135 b(Unsigned)46 b(In)l(tegers)0
-1856 y Fj(Although)34 b(FITS)h(do)s(es)g(not)g(directly)f(supp)s(ort)g
-(unsigned)f(in)m(tegers)j(as)f(one)h(of)f(its)g(fundamen)m(tal)f(datat)
-m(yp)s(es,)0 1969 y(FITS)27 b(can)h(still)e(b)s(e)h(used)g(to)i
-(e\016cien)m(tly)f(store)g(unsigned)e(in)m(teger)i(data)h(v)-5
-b(alues)27 b(in)g(images)h(and)f(binary)f(tables.)0 2082
-y(The)42 b(con)m(v)m(en)m(tion)i(used)e(in)f(FITS)h(\014les)g(is)f(to)j
-(store)f(the)g(unsigned)d(in)m(tegers)j(as)g(signed)f(in)m(tegers)h
-(with)e(an)0 2195 y(asso)s(ciated)33 b(o\013set)g(\(sp)s(eci\014ed)e(b)
-m(y)h(the)g(BZER)m(O)g(or)g(TZER)m(On)f(k)m(eyw)m(ord\).)47
-b(F)-8 b(or)33 b(example,)f(to)h(store)g(unsigned)0 2308
-y(16-bit)f(in)m(teger)g(v)-5 b(alues)31 b(in)f(a)i(FITS)f(image)h(the)f
-(image)h(w)m(ould)f(b)s(e)f(de\014ned)h(as)h(a)g(signed)e(16-bit)i(in)m
-(teger)g(\(with)0 2421 y(BITPIX)d(k)m(eyw)m(ord)g(=)g(SHOR)-8
-b(T)p 1132 2421 28 4 v 32 w(IMG)30 b(=)e(16\))j(with)c(the)j(k)m(eyw)m
-(ords)f(BSCALE)f(=)h(1.0)h(and)f(BZER)m(O)g(=)f(32768.)0
-2534 y(Th)m(us)34 b(the)h(unsigned)e(v)-5 b(alues)34
-b(of)h(0,)i(32768,)h(and)d(65535,)j(for)d(example,)h(are)f(ph)m
-(ysically)e(stored)i(in)f(the)h(FITS)0 2647 y(image)k(as)f(-32768,)43
-b(0,)e(and)d(32767,)k(resp)s(ectiv)m(ely;)g(CFITSIO)37
-b(automatically)h(adds)f(the)i(BZER)m(O)f(o\013set)h(to)0
-2759 y(these)g(v)-5 b(alues)38 b(when)g(they)g(are)h(read.)65
-b(Similarly)-8 b(,)38 b(in)f(the)i(case)h(of)e(unsigned)f(32-bit)i(in)m
-(tegers)f(the)h(BITPIX)0 2872 y(k)m(eyw)m(ord)c(w)m(ould)e(b)s(e)h
-(equal)g(to)i(LONG)p 1392 2872 V 32 w(IMG)f(=)g(32)g(and)f(BZER)m(O)g
-(w)m(ould)g(b)s(e)g(equal)g(to)h(2147483648)k(\(i.e.)54
-b(2)0 2985 y(raised)29 b(to)i(the)g(31st)g(p)s(o)m(w)m(er\).)0
-3145 y(The)j(CFITSIO)g(in)m(terface)h(routines)f(will)e(e\016cien)m
-(tly)j(and)f(transparen)m(tly)h(apply)e(the)i(appropriate)f(o\013set)i
-(in)0 3258 y(these)29 b(cases)h(so)f(in)f(general)h(application)e
-(programs)i(do)g(not)g(need)f(to)i(b)s(e)e(concerned)h(with)f(ho)m(w)h
-(the)g(unsigned)0 3371 y(v)-5 b(alues)43 b(are)i(actually)f(stored)g
-(in)e(the)j(FITS)e(\014le.)81 b(As)44 b(a)g(con)m(v)m(enience)i(for)d
-(users,)k(CFITSIO)c(has)h(sev)m(eral)0 3484 y(prede\014ned)19
-b(constan)m(ts)j(for)f(the)g(v)-5 b(alue)20 b(of)h(BITPIX)g(\(USHOR)-8
-b(T)p 2189 3484 V 33 w(IMG,)21 b(ULONG)p 2790 3484 V
-33 w(IMG\))h(and)e(for)h(the)g(TF)m(ORMn)0 3597 y(v)-5
-b(alue)35 b(in)f(the)i(case)g(of)g(binary)e(tables)h(\(`U')i(and)e
-(`V'\))h(whic)m(h)e(programmers)h(can)h(use)f(when)g(creating)h(FITS)0
-3710 y(\014les)i(con)m(taining)g(unsigned)f(in)m(teger)i(v)-5
-b(alues.)65 b(The)39 b(follo)m(wing)e(co)s(de)i(fragmen)m(t)g
-(illustrates)e(ho)m(w)i(to)h(write)e(a)0 3823 y(FITS)30
-b(1-D)h(primary)e(arra)m(y)h(of)h(unsigned)d(16-bit)j(in)m(tegers:)286
-4034 y Ff(unsigned)46 b(short)g(uarray[100];)286 4147
-y(int)h(naxis,)f(status;)286 4260 y(long)h(naxes[10],)e(group,)h
-(firstelem,)f(nelements;)334 4373 y(...)286 4486 y(status)h(=)i(0;)286
-4599 y(naxis)f(=)g(1;)286 4712 y(naxes[0])f(=)h(100;)286
-4825 y(fits_create_img\(fptr,)42 b(USHORT_IMG,)j(naxis,)h(naxes,)g
-(&status\);)286 5051 y(firstelem)g(=)h(1;)286 5164 y(nelements)f(=)h
-(100;)286 5276 y(fits_write_img\(fptr,)c(TUSHORT,)i(firstelem,)g
-(nelements,)1241 5389 y(uarray,)h(&status\);)334 5502
-y(...)0 5714 y Fj(In)40 b(the)h(ab)s(o)m(v)m(e)i(example,)g(the)f(2nd)e
-(parameter)h(in)f(\014ts)p 1998 5714 V 33 w(create)p
-2267 5714 V 34 w(img)g(tells)g(CFITSIO)g(to)i(write)e(the)h(header)p
+(less)g(than)g(this)f(limit.)0 3906 y(Curren)m(tly)-8
+b(,)43 b(supp)s(ort)c(for)i(large)g(\014les)f(within)e(CFITSIO)i(has)h
+(b)s(een)f(tested)i(on)f(the)g(Solaris)e(2.6)j(op)s(erating)0
+4019 y(system)31 b(using)d(the)j(Sun)e(cc)i(compiler)e(or)h(gcc)i(and)e
+(on)g(IBM)h(AIX)f(PO)m(WER3)h(and)f(PO)m(WER4)h(systems.)p
 eop
-%%Page: 47 53
-47 52 bop 0 299 a Fh(5.6.)72 b(UNSIGNED)31 b(INTEGERS)2596
-b Fj(47)0 555 y(k)m(eyw)m(ords)34 b(appropriate)f(for)g(an)g(arra)m(y)i
-(of)e(16-bit)h(unsigned)e(in)m(tegers)i(\(i.e.,)h(BITPIX)e(=)g(16)i
-(and)e(BZER)m(O)g(=)0 668 y(32768\).)41 b(Then)23 b(the)h(\014ts)p
-834 668 28 4 v 32 w(write)p 1069 668 V 32 w(img)g(routine)f(writes)f
-(the)j(arra)m(y)f(of)g(unsigned)e(short)h(in)m(tegers)h(\(uarra)m(y\))h
-(in)m(to)f(the)0 781 y(primary)f(arra)m(y)i(of)g(the)g(FITS)f(\014le.)
-38 b(Similarly)-8 b(,)23 b(a)i(32-bit)h(unsigned)c(in)m(teger)j(image)h
-(ma)m(y)f(b)s(e)f(created)i(b)m(y)f(setting)0 894 y(the)34
-b(second)f(parameter)h(in)e(\014ts)p 1130 894 V 33 w(create)p
-1399 894 V 34 w(img)h(equal)g(to)h(`ULONG)p 2330 894
-V 33 w(IMG')g(and)f(b)m(y)h(calling)d(the)j(\014ts)p
-3491 894 V 33 w(write)p 3727 894 V 32 w(img)0 1007 y(routine)i(with)f
-(the)i(second)f(parameter)h(=)f(TULONG)h(to)g(write)f(the)g(arra)m(y)h
-(of)g(unsigned)e(long)h(image)h(pixel)0 1120 y(v)-5 b(alues.)0
-1280 y(An)29 b(analogous)h(set)f(of)h(routines)e(are)i(a)m(v)-5
-b(ailable)28 b(for)h(reading)g(or)g(writing)e(unsigned)h(in)m(teger)h
-(v)-5 b(alues)29 b(in)f(a)i(FITS)0 1393 y(binary)f(table)h(extension.)
-42 b(When)30 b(sp)s(ecifying)e(the)j(TF)m(ORMn)g(k)m(eyw)m(ord)g(v)-5
-b(alue)30 b(whic)m(h)f(de\014nes)h(the)h(format)g(of)0
-1506 y(a)37 b(column,)g(CFITSIO)e(recognized)i(2)f(additional)f(datat)m
-(yp)s(e)i(co)s(des)g(b)s(esides)d(those)j(already)f(de\014ned)g(in)f
-(the)0 1619 y(FITS)24 b(standard:)37 b(`U')25 b(meaning)f(a)h(16-bit)g
-(unsigned)e(in)m(teger)i(column,)g(and)f(`V')h(for)g(a)g(32-bit)g
-(unsigned)e(in)m(teger)0 1732 y(column.)38 b(These)26
-b(non-standard)g(datat)m(yp)s(e)h(co)s(des)f(are)h(not)g(actually)f
-(written)f(in)m(to)h(the)h(FITS)f(\014le)f(but)h(instead)0
-1844 y(are)k(just)f(used)g(in)m(ternally)f(within)f(CFITSIO.)h(The)i
-(follo)m(wing)e(co)s(de)i(fragmen)m(t)g(illustrates)e(ho)m(w)i(to)g
-(use)f(these)0 1957 y(features:)286 2214 y Ff(unsigned)46
-b(short)g(uarray[100];)286 2327 y(unsigned)g(int)95 b(varray[100];)286
-2552 y(int)47 b(colnum,)f(tfields,)g(status;)286 2665
-y(long)h(nrows,)f(firstrow,)f(firstelem,)g(nelements,)g(pcount;)286
-2891 y(char)i(extname[])e(=)j("Test_table";)521 b(/*)47
-b(extension)f(name)g(*/)286 3117 y(/*)i(define)e(the)h(name,)f
-(datatype,)f(and)i(physical)f(units)g(for)h(the)g(2)g(columns)f(*/)286
-3230 y(char)h(*ttype[])f(=)h({)g("Col_1",)f("Col_2")g(};)286
-3343 y(char)h(*tform[])f(=)h({)g("1U",)285 b("1V")143
-b(};)94 b(/*)48 b(special)d(CFITSIO)h(codes)h(*/)286
-3456 y(char)g(*tunit[])f(=)h({)g(")h(",)381 b(")48 b(")143
-b(};)334 3569 y(...)525 3794 y(/*)47 b(write)g(the)f(header)h(keywords)
-e(*/)286 3907 y(status)94 b(=)48 b(0;)286 4020 y(nrows)142
-b(=)48 b(1;)286 4133 y(tfields)e(=)i(2)286 4246 y(pcount)94
-b(=)48 b(0;)286 4359 y(fits_create_tbl\(fptr,)42 b(BINARY_TBL,)j
-(nrows,)h(tfields,)g(ttype,)g(tform,)764 4472 y(tunit,)g(extname,)f
-(&status\);)525 4698 y(/*)i(write)g(the)f(unsigned)g(shorts)g(to)h(the)
-g(1st)g(column)f(*/)286 4811 y(colnum)190 b(=)47 b(1;)286
-4924 y(firstrow)94 b(=)47 b(1;)286 5036 y(firstelem)f(=)h(1;)286
-5149 y(nelements)f(=)h(100;)286 5262 y(fits_write_col\(fptr,)c
-(TUSHORT,)i(colnum,)h(firstrow,)f(firstelem,)668 5375
-y(nelements,)g(uarray,)h(&status\);)525 5601 y(/*)h(now)g(write)f(the)h
-(unsigned)f(longs)g(to)h(the)g(2nd)g(column)f(*/)286
-5714 y(colnum)190 b(=)47 b(2;)p eop
-%%Page: 48 54
-48 53 bop 0 299 a Fj(48)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)286 555
-y Ff(fits_write_col\(fptr,)43 b(TUINT,)j(colnum,)g(firstrow,)f
-(firstelem,)668 668 y(nelements,)g(varray,)h(&status\);)334
-781 y(...)0 1051 y Fj(Note)22 b(that)g(the)f(non-standard)f(TF)m(ORM)h
-(v)-5 b(alues)20 b(for)h(the)g(2)g(columns,)h(`U')f(and)g(`V',)h(tell)e
-(CFITSIO)f(to)j(write)e(the)0 1164 y(k)m(eyw)m(ords)27
-b(appropriate)e(for)h(unsigned)e(16-bit)j(and)e(unsigned)g(32-bit)h(in)
-m(tegers,)i(resp)s(ectiv)m(ely)d(\(i.e.,)j(TF)m(ORMn)0
-1277 y(=)39 b('1I')i(and)e(TZER)m(On)f(=)h(32678)j(for)e(unsigned)d
-(16-bit)j(in)m(tegers,)j(and)c(TF)m(ORMn)h(=)f('1J')h(and)f(TZER)m(On)0
-1389 y(=)g(2147483648)45 b(for)39 b(unsigned)f(32-bit)i(in)m(tegers\).)
-70 b(The)39 b(calls)g(to)i(\014ts)p 2506 1389 28 4 v
-32 w(write)p 2741 1389 V 32 w(col)f(then)g(write)f(the)h(arra)m(ys)g
-(of)0 1502 y(unsigned)28 b(in)m(teger)j(v)-5 b(alues)30
-b(to)h(the)f(columns.)0 1848 y Fe(5.7)135 b(Character)46
-b(Strings)0 2100 y Fj(The)36 b(c)m(haracter)j(string)c(v)-5
-b(alues)37 b(in)e(a)i(FITS)f(header)h(or)g(in)e(an)i(ASCI)s(I)e(column)
-h(in)f(a)j(FITS)e(table)g(extension)0 2213 y(are)j(generally)g(padded)f
-(out)h(with)f(non-signi\014can)m(t)g(space)h(c)m(haracters)i(\(ASCI)s
-(I)d(32\))i(to)g(\014ll)d(up)h(the)h(header)0 2326 y(record)33
-b(or)h(the)f(column)g(width.)48 b(When)33 b(reading)g(a)h(FITS)e
-(string)h(v)-5 b(alue,)34 b(the)f(CFITSIO)f(routines)h(will)d(strip)0
-2439 y(o\013)38 b(these)f(non-signi\014can)m(t)f(trailing)f(spaces)i
-(and)g(will)d(return)i(a)i(n)m(ull-terminated)d(string)h(v)-5
-b(alue)36 b(con)m(taining)0 2552 y(only)d(the)h(signi\014can)m(t)e(c)m
-(haracters.)52 b(Leading)33 b(spaces)h(in)f(a)h(FITS)f(string)f(are)i
-(considered)f(signi\014can)m(t.)50 b(If)33 b(the)0 2665
-y(string)h(con)m(tains)h(all)f(blanks,)h(then)f(CFITSIO)g(will)e
-(return)i(a)h(single)e(blank)h(c)m(haracter,)k(i.e,)e(the)f(\014rst)f
-(blank)0 2778 y(is)29 b(considered)f(to)i(b)s(e)f(signi\014can)m(t,)g
-(since)g(it)g(distinquishes)d(the)k(string)e(from)h(a)h(n)m(ull)e(or)h
-(unde\014ned)f(string,)h(but)0 2891 y(the)i(remaining)d(trailing)g
-(spaces)j(are)g(not)g(signi\014can)m(t.)0 3051 y(Similarly)-8
-b(,)37 b(when)g(writing)f(string)h(v)-5 b(alues)37 b(to)i(a)g(FITS)e
-(\014le)g(the)h(CFITSIO)f(routines)g(exp)s(ect)h(to)h(get)g(a)g(n)m
-(ull-)0 3164 y(terminated)32 b(string)g(as)h(input;)f(CFITSIO)f(will)f
-(pad)i(the)h(string)f(with)f(blanks)g(if)h(necessary)h(when)f(writing)e
-(it)0 3277 y(to)h(the)g(FITS)e(\014le.)0 3437 y(When)j(calling)f
-(CFITSIO)g(routines)h(that)h(return)e(a)i(c)m(haracter)h(string)e(it)g
-(is)f(vital)h(that)h(the)g(size)f(of)h(the)g(c)m(har)0
-3550 y(arra)m(y)38 b(b)s(e)g(large)g(enough)f(to)i(hold)d(the)i(en)m
-(tire)g(string)f(of)h(c)m(haracters,)k(otherwise)37 b(CFITSIO)f(will)f
-(o)m(v)m(erwrite)0 3663 y(whatev)m(er)g(memory)e(lo)s(cations)g(follo)m
-(w)g(the)h(c)m(har)h(arra)m(y)-8 b(,)35 b(p)s(ossibly)c(causing)i(the)h
-(program)g(to)g(execute)h(incor-)0 3776 y(rectly)-8 b(.)41
-b(This)29 b(t)m(yp)s(e)h(of)h(error)f(can)h(b)s(e)f(di\016cult)e(to)j
-(debug,)f(so)h(programmers)f(should)e(alw)m(a)m(ys)j(ensure)f(that)h
-(the)0 3888 y(c)m(har)c(arra)m(ys)g(are)g(allo)s(cated)g(enough)f
-(space)i(to)f(hold)f(the)g(longest)h(p)s(ossible)e(string,)h
-Fi(including)i Fj(the)f(terminat-)0 4001 y(ing)j(NULL)h(c)m(haracter.)
-45 b(The)30 b(\014tsio.h)g(\014le)h(con)m(tains)g(the)g(follo)m(wing)f
-(de\014ned)g(constan)m(ts)i(whic)m(h)e(programmers)0
-4114 y(are)h(strongly)f(encouraged)h(to)g(use)f(whenev)m(er)g(they)h
-(are)f(allo)s(cating)g(space)h(for)f(c)m(har)h(arra)m(ys:)0
-4384 y Ff(#define)46 b(FLEN_FILENAME)e(1025)94 b(/*)48
-b(max)e(length)h(of)g(a)g(filename)f(*/)0 4497 y(#define)g
-(FLEN_KEYWORD)140 b(72)95 b(/*)47 b(max)g(length)f(of)h(a)g(keyword)94
-b(*/)0 4610 y(#define)46 b(FLEN_CARD)284 b(81)95 b(/*)47
-b(length)f(of)h(a)h(FITS)e(header)g(card)h(*/)0 4723
-y(#define)f(FLEN_VALUE)236 b(71)95 b(/*)47 b(max)g(length)f(of)h(a)g
-(keyword)f(value)h(string)f(*/)0 4836 y(#define)g(FLEN_COMMENT)140
-b(73)95 b(/*)47 b(max)g(length)f(of)h(a)g(keyword)f(comment)g(string)g
-(*/)0 4949 y(#define)g(FLEN_ERRMSG)188 b(81)95 b(/*)47
-b(max)g(length)f(of)h(a)g(CFITSIO)f(error)h(message)e(*/)0
-5061 y(#define)h(FLEN_STATUS)188 b(31)95 b(/*)47 b(max)g(length)f(of)h
-(a)g(CFITSIO)f(status)g(text)h(string)f(*/)0 5331 y Fj(F)-8
-b(or)23 b(example,)g(when)e(declaring)g(a)h(c)m(har)g(arra)m(y)h(to)f
-(hold)f(the)h(v)-5 b(alue)21 b(string)g(of)h(FITS)f(k)m(eyw)m(ord,)k
-(use)c(the)h(follo)m(wing)0 5444 y(statemen)m(t:)191
-5714 y Ff(char)47 b(value[FLEN_VALUE];)p eop
-%%Page: 49 55
-49 54 bop 0 299 a Fh(5.8.)72 b(IMPLICIT)29 b(D)m(A)-8
-b(T)g(A)32 b(TYPE)e(CONVERSION)1938 b Fj(49)0 555 y(Note)41
-b(that)f(FLEN)p 686 555 28 4 v 33 w(KEYW)m(ORD)g(is)e(longer)h(than)g
-(needed)g(for)g(the)h(nominal)d(8-c)m(haracter)42 b(k)m(eyw)m(ord)e
-(name)0 668 y(b)s(ecause)30 b(the)h(HIERAR)m(CH)f(con)m(v)m(en)m(tion)i
-(supp)s(orts)c(longer)i(k)m(eyw)m(ord)h(names.)0 1055
-y Fe(5.8)135 b(Implicit)46 b(Data)g(T)l(yp)t(e)f(Con)l(v)l(ersion)0
-1316 y Fj(The)37 b(CFITSIO)f(routines)h(that)h(read)f(and)g(write)g(n)m
-(umerical)f(data)j(can)f(p)s(erform)e(implicit)e(data)39
-b(t)m(yp)s(e)e(con-)0 1429 y(v)m(ersion.)50 b(This)32
-b(means)i(that)g(the)g(data)h(t)m(yp)s(e)f(of)g(the)g(v)-5
-b(ariable)32 b(or)i(arra)m(y)g(in)f(the)h(program)f(do)s(es)h(not)g
-(need)f(to)0 1542 y(b)s(e)38 b(the)i(same)f(as)g(the)g(data)h(t)m(yp)s
-(e)f(of)g(the)g(v)-5 b(alue)39 b(in)f(the)h(FITS)f(\014le.)66
-b(Data)40 b(t)m(yp)s(e)f(con)m(v)m(ersion)h(is)e(supp)s(orted)0
-1654 y(for)30 b(n)m(umerical)f(data)j(t)m(yp)s(es)e(when)g(reading)f(a)
-i(FITS)f(header)g(k)m(eyw)m(ord)h(v)-5 b(alue)30 b(and)g(when)g
-(reading)f(or)i(writing)0 1767 y(v)-5 b(alues)32 b(in)g(the)i(primary)d
-(arra)m(y)i(or)h(a)f(table)g(column.)48 b(CFITSIO)31
-b(returns)h(status)i(=)f(NUM)p 3243 1767 V 33 w(O)m(VERFLO)m(W)h(if)0
-1880 y(the)c(con)m(v)m(erted)h(data)f(v)-5 b(alue)29
-b(exceeds)i(the)f(range)g(of)f(the)h(output)f(data)i(t)m(yp)s(e.)40
-b(Implicit)28 b(data)i(t)m(yp)s(e)g(con)m(v)m(ersion)0
-1993 y(is)f(not)i(supp)s(orted)e(for)h(string,)f(logical,)h(complex,)h
-(or)f(double)f(complex)h(data)h(t)m(yp)s(es.)0 2380 y
-Fe(5.9)135 b(Data)46 b(Scaling)0 2641 y Fj(When)38 b(reading)e(n)m
-(umerical)h(data)h(v)-5 b(alues)37 b(in)f(the)i(primary)e(arra)m(y)i
-(or)g(a)g(table)g(column,)h(the)e(v)-5 b(alues)37 b(will)f(b)s(e)0
-2754 y(scaled)h(automatically)h(b)m(y)f(the)g(BSCALE)g(and)g(BZER)m(O)g
-(\(or)h(TSCALn)e(and)h(TZER)m(On\))f(header)h(v)-5 b(alues)37
-b(if)0 2867 y(they)31 b(are)f(presen)m(t)h(in)e(the)h(header.)41
-b(The)30 b(scaled)g(data)h(that)g(is)e(returned)h(to)h(the)f(reading)g
-(program)g(will)e(ha)m(v)m(e)382 3171 y Ff(output)46
-b(value)g(=)i(\(FITS)e(value\))g(*)i(BSCALE)e(+)h(BZERO)0
-3476 y Fj(\(a)30 b(corresp)s(onding)d(form)m(ula)h(using)g(TSCALn)f
-(and)i(TZER)m(On)e(is)h(used)h(when)f(reading)g(from)h(table)g
-(columns\).)0 3589 y(In)i(the)i(case)g(of)f(in)m(teger)g(output)g(v)-5
-b(alues)31 b(the)i(\015oating)f(p)s(oin)m(t)f(scaled)g(v)-5
-b(alue)32 b(is)f(truncated)h(to)h(an)f(in)m(teger)g(\(not)0
-3702 y(rounded)j(to)j(the)f(nearest)h(in)m(teger\).)61
-b(The)36 b(\014ts)p 1673 3702 V 32 w(set)p 1816 3702
-V 34 w(bscale)h(and)f(\014ts)p 2430 3702 V 32 w(set)p
-2573 3702 V 34 w(tscale)h(routines)f(\(describ)s(ed)f(in)h(the)0
-3815 y(`Adv)-5 b(anced')29 b(c)m(hapter\))h(ma)m(y)g(b)s(e)e(used)h(to)
-g(o)m(v)m(erride)h(the)f(scaling)f(parameters)h(de\014ned)f(in)g(the)h
-(header)g(\(e.g.,)i(to)0 3928 y(turn)e(o\013)i(the)g(scaling)e(so)i
-(that)g(the)f(program)g(can)h(read)f(the)h(ra)m(w)f(unscaled)g(v)-5
-b(alues)29 b(from)h(the)h(FITS)e(\014le\).)0 4088 y(When)44
-b(writing)f(n)m(umerical)g(data)i(to)g(the)g(primary)e(arra)m(y)i(or)f
-(to)h(a)g(table)g(column)e(the)i(data)g(v)-5 b(alues)44
-b(will)0 4201 y(generally)27 b(b)s(e)h(automatically)g(in)m(v)m(ersely)
-g(scaled)g(b)m(y)g(the)g(v)-5 b(alue)28 b(of)g(the)h(BSCALE)e(and)h
-(BZER)m(O)g(\(or)h(TSCALn)0 4314 y(and)35 b(TZER)m(On\))f(k)m(eyw)m
-(ord)i(v)-5 b(alues)34 b(if)h(they)g(they)g(exist)h(in)e(the)h(header.)
-55 b(These)35 b(k)m(eyw)m(ords)h(m)m(ust)f(ha)m(v)m(e)i(b)s(een)0
-4427 y(written)30 b(to)i(the)g(header)f(b)s(efore)g(an)m(y)g(data)h(is)
-f(written)f(for)h(them)g(to)h(ha)m(v)m(e)h(an)m(y)e(immediate)g
-(e\013ect.)45 b(One)30 b(ma)m(y)0 4540 y(also)g(use)h(the)f(\014ts)p
-623 4540 V 33 w(set)p 767 4540 V 33 w(bscale)h(and)e(\014ts)p
-1367 4540 V 33 w(set)p 1511 4540 V 33 w(tscale)i(routines)f(to)h
-(de\014ne)f(or)g(o)m(v)m(erride)h(the)g(scaling)e(k)m(eyw)m(ords)i(in)0
-4653 y(the)e(header)g(\(e.g.,)i(to)e(turn)f(o\013)h(the)g(scaling)f(so)
-h(that)h(the)f(program)f(can)h(write)f(the)h(ra)m(w)g(unscaled)f(v)-5
-b(alues)28 b(in)m(to)0 4765 y(the)e(FITS)g(\014le\).)39
-b(If)25 b(scaling)g(is)h(p)s(erformed,)f(the)i(in)m(v)m(erse)f(scaled)g
-(output)f(v)-5 b(alue)26 b(that)h(is)e(written)g(in)m(to)h(the)h(FITS)0
-4878 y(\014le)i(will)f(ha)m(v)m(e)430 5183 y Ff(FITS)46
-b(value)h(=)g(\(\(input)f(value\))g(-)h(BZERO\))f(/)i(BSCALE)0
-5488 y Fj(\(a)39 b(corresp)s(onding)c(form)m(ula)i(using)g(TSCALn)f
-(and)h(TZER)m(On)g(is)g(used)g(when)f(writing)g(to)j(table)f
-(columns\).)0 5601 y(Rounding)18 b(to)j(the)g(nearest)g(in)m(teger,)h
-(rather)f(than)f(truncation,)i(is)d(p)s(erformed)g(when)g(writing)f(in)
-m(teger)j(datat)m(yp)s(es)0 5714 y(to)31 b(the)g(FITS)e(\014le.)p
+%%Page: 28 36
+28 35 bop 0 299 a Fj(28)1763 b Fh(CHAPTER)29 b(4.)112
+b(PR)m(OGRAMMING)32 b(GUIDELINES)p eop
+%%Page: 29 37
+29 36 bop 0 1225 a Fg(Chapter)65 b(5)0 1687 y Fm(Basic)77
+b(CFITSIO)f(In)-6 b(terface)77 b(Routines)0 2180 y Fj(This)29
+b(c)m(hapter)j(describ)s(es)d(the)j(basic)e(routines)g(in)g(the)h
+(CFITSIO)e(user)i(in)m(terface)g(that)h(pro)m(vide)e(all)g(the)i(func-)
+0 2293 y(tions)i(normally)f(needed)i(to)g(read)g(and)f(write)g(most)i
+(FITS)e(\014les.)53 b(It)35 b(is)f(recommended)g(that)i(these)f
+(routines)0 2406 y(b)s(e)d(used)g(for)g(most)h(applications)e(and)h
+(that)h(the)f(more)h(adv)-5 b(anced)33 b(routines)e(describ)s(ed)g(in)g
+(the)i(next)f(c)m(hapter)0 2518 y(only)d(b)s(e)h(used)g(in)f(sp)s
+(ecial)g(circumstances)h(when)f(necessary)-8 b(.)0 2679
+y(The)30 b(follo)m(wing)f(con)m(v)m(en)m(tions)i(are)g(used)e(in)h
+(this)f(c)m(hapter)i(in)e(the)h(description)f(of)h(eac)m(h)i(function:)
+0 2839 y(1.)39 b(Most)25 b(functions)d(ha)m(v)m(e)j(2)f(names:)37
+b(a)24 b(long)g(descriptiv)m(e)e(name)i(and)f(a)i(short)e(concise)h
+(name.)38 b(Both)25 b(names)f(are)0 2952 y(listed)e(on)h(the)g(\014rst)
+f(line)g(of)h(the)h(follo)m(wing)d(descriptions,)i(separated)g(b)m(y)h
+(a)f(slash)f(\(/\))i(c)m(haracter.)40 b(Programmers)0
+3065 y(ma)m(y)27 b(use)g(either)f(name)h(in)e(their)h(programs)h(but)f
+(the)h(long)f(names)h(are)g(recommended)f(to)i(help)d(do)s(cumen)m(t)i
+(the)0 3177 y(co)s(de)k(and)e(mak)m(e)j(it)e(easier)g(to)h(read.)0
+3338 y(2.)42 b(A)30 b(righ)m(t)g(arro)m(w)h(sym)m(b)s(ol)e(\()p
+Fb(>)p Fj(\))i(is)f(used)g(in)f(the)i(function)e(descriptions)f(to)k
+(separate)f(the)g(input)e(parameters)0 3451 y(from)k(the)g(output)f
+(parameters)i(in)e(the)h(de\014nition)e(of)i(eac)m(h)h(routine.)48
+b(This)31 b(sym)m(b)s(ol)h(is)g(not)h(actually)g(part)g(of)0
+3563 y(the)e(C)f(calling)e(sequence.)0 3724 y(3.)41 b(The)30
+b(function)f(parameters)i(are)g(de\014ned)e(in)g(more)h(detail)g(in)f
+(the)h(alphab)s(etical)f(listing)f(in)h(App)s(endix)f(B.)0
+3884 y(4.)39 b(The)23 b(\014rst)g(argumen)m(t)g(in)g(almost)g(all)g
+(the)g(functions)f(is)h(a)h(p)s(oin)m(ter)e(to)i(a)g(structure)f(of)h
+(t)m(yp)s(e)g(`\014ts\014le'.)37 b(Memory)0 3997 y(for)26
+b(this)f(structure)g(is)g(allo)s(cated)h(b)m(y)g(CFITSIO)e(when)h(the)h
+(FITS)g(\014le)f(is)g(\014rst)g(op)s(ened)g(or)h(created)h(and)e(is)g
+(freed)0 4110 y(when)k(the)i(FITS)f(\014le)f(is)g(closed.)0
+4270 y(5.)53 b(The)34 b(last)g(argumen)m(t)g(in)f(almost)i(all)e(the)h
+(functions)f(is)g(the)i(error)f(status)g(parameter.)53
+b(It)35 b(m)m(ust)f(b)s(e)f(equal)0 4383 y(to)k(0)g(on)f(input,)g
+(otherwise)g(the)g(function)f(will)f(immediately)g(exit)i(without)g
+(doing)f(an)m(ything.)58 b(A)36 b(non-zero)0 4496 y(output)27
+b(v)-5 b(alue)26 b(indicates)h(that)g(an)g(error)g(o)s(ccurred)g(in)f
+(the)h(function.)38 b(In)27 b(most)g(cases)h(the)g(status)f(v)-5
+b(alue)27 b(is)f(also)0 4608 y(returned)j(as)i(the)f(v)-5
+b(alue)30 b(of)h(the)f(function)f(itself.)0 4935 y Ff(5.1)135
+b(CFITSIO)44 b(Error)h(Status)h(Routines)0 5168 y Fi(1)81
+b Fj(Return)27 b(a)j(descriptiv)m(e)d(text)j(string)d(\(30)j(c)m(har)f
+(max.\))41 b(corresp)s(onding)27 b(to)i(a)g(CFITSIO)e(error)h(status)h
+(co)s(de.)95 5385 y Fe(void)47 b(fits_get_errstatus)c(/)k(ffgerr)f
+(\(int)h(status,)f(>)h(char)g(*err_text\))0 5601 y Fi(2)81
+b Fj(Return)35 b(the)h(top)g(\(oldest\))g(80-c)m(haracter)j(error)c
+(message)i(from)e(the)h(in)m(ternal)f(CFITSIO)f(stac)m(k)j(of)f(error)
+227 5714 y(messages)45 b(and)e(shift)g(an)m(y)h(remaining)e(messages)j
+(on)f(the)g(stac)m(k)h(up)e(one)h(lev)m(el.)81 b(Call)42
+b(this)h(routine)1905 5942 y(29)p eop
+%%Page: 30 38
+30 37 bop 0 299 a Fj(30)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
+555 y Fj(rep)s(eatedly)25 b(to)i(get)g(eac)m(h)g(message)f(in)f
+(sequence.)39 b(The)26 b(function)e(returns)h(a)h(v)-5
+b(alue)25 b(=)g(0)h(and)g(a)g(n)m(ull)d(error)227 668
+y(message)32 b(when)d(the)i(error)f(stac)m(k)i(is)d(empt)m(y)-8
+b(.)95 936 y Fe(int)47 b(fits_read_errmsg)d(/)j(ffgmsg)f(\(char)h
+(*err_msg\))0 1203 y Fi(3)81 b Fj(Prin)m(t)29 b(out)i(the)g(error)f
+(message)i(corresp)s(onding)d(to)i(the)g(input)e(status)i(v)-5
+b(alue)30 b(and)g(all)g(the)h(error)f(messages)227 1316
+y(on)d(the)h(CFITSIO)e(stac)m(k)j(to)f(the)f(sp)s(eci\014ed)f(\014le)g
+(stream)i(\(normally)e(to)i(stdout)f(or)g(stderr\).)40
+b(If)26 b(the)i(input)227 1429 y(status)j(v)-5 b(alue)30
+b(=)g(0)h(then)f(this)f(routine)g(do)s(es)h(nothing.)95
+1696 y Fe(void)47 b(fits_report_error)c(/)48 b(ffrprt)e(\(FILE)g
+(*stream,)g(>)h(status\))0 1964 y Fi(4)81 b Fj(The)44
+b(\014ts)p 461 1964 28 4 v 32 w(write)p 696 1964 V 32
+w(errmark)g(routine)g(puts)g(an)h(in)m(visible)c(mark)m(er)k(on)g(the)g
+(CFITSIO)e(error)h(stac)m(k.)85 b(The)227 2077 y(\014ts)p
+354 2077 V 33 w(clear)p 574 2077 V 33 w(errmark)31 b(routine)h(can)h
+(then)f(b)s(e)f(used)h(to)h(delete)g(an)m(y)g(more)f(recen)m(t)i(error)
+e(messages)h(on)g(the)227 2190 y(stac)m(k,)42 b(bac)m(k)c(to)g(the)g(p)
+s(osition)e(of)i(the)g(mark)m(er.)63 b(This)36 b(preserv)m(es)h(an)m(y)
+h(older)f(error)g(messages)i(on)f(the)227 2303 y(stac)m(k.)77
+b(The)41 b(\014ts)p 855 2303 V 32 w(clear)p 1074 2303
+V 33 w(errmsg)g(routine)g(simply)e(clears)j(all)f(the)h(messages)g
+(\(and)g(marks\))f(from)h(the)227 2415 y(stac)m(k.)g(These)31
+b(routines)e(are)i(called)e(without)h(an)m(y)g(argumen)m(ts.)95
+2683 y Fe(void)47 b(fits_write_errmark)c(/)k(ffpmrk)f(\(void\))95
+2796 y(void)h(fits_clear_errmark)c(/)k(ffcmrk)f(\(void\))95
+2909 y(void)h(fits_clear_errmsg)c(/)48 b(ffcmsg)e(\(void\))0
+3251 y Ff(5.2)135 b(FITS)44 b(File)i(Access)e(Routines)0
+3497 y Fi(1)81 b Fj(Op)s(en)29 b(an)h(existing)f(data)i(\014le.)227
+3759 y Fe(int)47 b(fits_open_file)d(/)k(ffopen)418 3872
+y(\(fitsfile)d(**fptr,)h(char)h(*filename,)e(int)i(iomode,)f(>)h(int)g
+(*status\))227 4098 y(int)g(fits_open_data)d(/)k(ffdopn)418
+4210 y(\(fitsfile)d(**fptr,)h(char)h(*filename,)e(int)i(iomode,)f(>)h
+(int)g(*status\))227 4436 y(int)g(fits_open_table)d(/)j(fftopn)418
+4549 y(\(fitsfile)e(**fptr,)h(char)h(*filename,)e(int)i(iomode,)f(>)h
+(int)g(*status\))227 4775 y(int)g(fits_open_image)d(/)j(ffiopn)418
+4888 y(\(fitsfile)e(**fptr,)h(char)h(*filename,)e(int)i(iomode,)f(>)h
+(int)g(*status\))227 5149 y Fj(The)41 b(iomo)s(de)g(parameter)h
+(determines)f(the)g(read/write)g(access)i(allo)m(w)m(ed)f(in)e(the)h
+(\014le)g(and)g(can)h(ha)m(v)m(e)227 5262 y(v)-5 b(alues)31
+b(of)h(READONL)-8 b(Y)32 b(\(0\))g(or)g(READ)m(WRITE)g(\(1\).)44
+b(The)31 b(\014lename)g(parameter)h(giv)m(es)g(the)f(name)h(of)227
+5375 y(the)f(\014le)f(to)h(b)s(e)f(op)s(ened,)h(follo)m(w)m(ed)f(b)m(y)
+h(an)f(optional)g(argumen)m(t)h(giving)f(the)h(name)f(or)h(index)e(n)m
+(um)m(b)s(er)h(of)227 5488 y(the)d(extension)f(within)f(the)h(FITS)g
+(\014le)g(that)h(should)e(b)s(e)h(mo)m(v)m(ed)i(to)f(and)f(op)s(ened)g
+(\(e.g.,)k Fe(myfile.fits+3)227 5601 y Fj(or)36 b Fe(myfile.fits[3])d
+Fj(mo)m(v)m(es)k(to)g(the)g(3rd)f(extension)f(within)f(the)j(\014le,)g
+(and)e Fe(myfile.fits[events])227 5714 y Fj(mo)m(v)m(es)d(to)f(the)g
+(extension)f(with)f(the)h(k)m(eyw)m(ord)h(EXTNAME)g(=)f('EVENTS'\).)p
 eop
-%%Page: 50 56
-50 55 bop 0 299 a Fj(50)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fe(5.10)136 b(Error)45 b(Status)g(V)-11 b(alues)45 b(and)g(the)g(Error)
-g(Message)h(Stac)l(k)0 807 y Fj(Nearly)35 b(all)f(the)i(CFITSIO)e
-(routines)g(return)g(an)h(error)g(status)h(v)-5 b(alue)34
-b(in)g(2)i(w)m(a)m(ys:)51 b(as)36 b(the)f(v)-5 b(alue)35
-b(of)h(the)f(last)0 920 y(parameter)29 b(in)e(the)h(function)f(call,)i
-(and)f(as)g(the)h(returned)e(v)-5 b(alue)28 b(of)g(the)h(function)e
-(itself.)39 b(This)26 b(pro)m(vides)i(some)0 1032 y(\015exibilit)m(y)33
-b(in)h(the)i(w)m(a)m(y)h(programmers)e(can)h(test)h(if)e(an)g(error)h
-(o)s(ccurred,)g(as)g(illustrated)e(in)g(the)i(follo)m(wing)f(2)0
-1145 y(co)s(de)c(fragmen)m(ts:)191 1410 y Ff(if)47 b(\()h
-(fits_write_record\(fptr,)41 b(card,)46 b(&status\))g(\))430
-1523 y(printf\(")f(Error)h(occurred)g(while)g(writing)g(keyword."\);)0
-1788 y Fj(or,)191 2053 y Ff(fits_write_record\(fptr,)41
-b(card,)47 b(&status\);)191 2166 y(if)g(\()h(status)e(\))430
-2279 y(printf\(")f(Error)h(occurred)g(while)g(writing)g(keyword."\);)0
-2544 y Fj(A)27 b(listing)e(of)j(all)e(the)h(CFITSIO)f(status)i(co)s(de)
-f(v)-5 b(alues)27 b(is)f(giv)m(en)h(at)h(the)g(end)e(of)i(this)e(do)s
-(cumen)m(t.)39 b(Programmers)0 2657 y(are)33 b(encouraged)g(to)g(use)f
-(the)h(sym)m(b)s(olic)d(mnemonics)h(\(de\014ned)h(in)f(\014tsio.h\))h
-(rather)g(than)g(the)h(actual)g(in)m(teger)0 2770 y(status)e(v)-5
-b(alues)29 b(to)j(impro)m(v)m(e)e(the)g(readabilit)m(y)f(of)i(their)e
-(co)s(de.)0 2930 y(The)j(CFITSIO)f(library)e(uses)j(an)g(`inherited)f
-(status')i(con)m(v)m(en)m(tion)g(for)f(the)h(status)f(parameter)h(whic)
-m(h)e(means)0 3043 y(that)37 b(if)e(a)i(routine)e(is)h(called)f(with)g
-(a)i(p)s(ositiv)m(e)e(input)g(v)-5 b(alue)36 b(of)g(the)h(status)f
-(parameter)h(as)g(input,)f(then)g(the)0 3156 y(routine)i(will)d(exit)k
-(immediately)e(without)g(c)m(hanging)i(the)f(v)-5 b(alue)38
-b(of)h(the)g(status)g(parameter.)65 b(Th)m(us,)40 b(if)e(one)0
-3269 y(passes)24 b(the)h(status)g(v)-5 b(alue)24 b(returned)g(from)g
-(eac)m(h)i(CFITSIO)d(routine)g(as)i(input)e(to)i(the)g(next)g(CFITSIO)e
-(routine,)0 3382 y(then)28 b(whenev)m(er)g(an)g(error)g(is)g(detected)h
-(all)f(further)f(CFITSIO)f(pro)s(cessing)h(will)f(cease.)42
-b(This)26 b(con)m(v)m(en)m(tion)k(can)0 3495 y(simplify)f(the)k(error)f
-(c)m(hec)m(king)i(in)d(application)g(programs)h(b)s(ecause)h(it)f(is)g
-(not)h(necessary)g(to)g(c)m(hec)m(k)i(the)d(v)-5 b(alue)0
-3608 y(of)30 b(the)g(status)h(parameter)f(after)h(ev)m(ery)g(single)d
-(CFITSIO)h(routine)g(call.)40 b(If)30 b(a)g(program)g(con)m(tains)g(a)h
-(sequence)0 3720 y(of)d(sev)m(eral)h(CFITSIO)e(calls,)h(one)g(can)h
-(just)e(c)m(hec)m(k)j(the)f(status)f(v)-5 b(alue)28 b(after)h(the)f
-(last)g(call.)39 b(Since)28 b(the)g(returned)0 3833 y(status)33
-b(v)-5 b(alues)32 b(are)h(generally)f(distinctiv)m(e,)g(it)h(should)d
-(b)s(e)j(p)s(ossible)d(to)j(determine)f(whic)m(h)g(routine)g
-(originally)0 3946 y(returned)d(the)i(error)f(status.)0
-4106 y(CFITSIO)c(also)h(main)m(tains)g(an)g(in)m(ternal)f(stac)m(k)j
-(of)f(error)f(messages)h(\(80-c)m(haracter)j(maxim)m(um)26
-b(length\))h(whic)m(h)0 4219 y(in)35 b(man)m(y)h(cases)h(pro)m(vide)e
-(a)h(more)g(detailed)g(explanation)f(of)h(the)g(cause)h(of)f(the)g
-(error)g(than)f(is)g(pro)m(vided)g(b)m(y)0 4332 y(the)40
-b(error)e(status)i(n)m(um)m(b)s(er)e(alone.)68 b(It)39
-b(is)g(recommended)g(that)g(the)h(error)f(message)h(stac)m(k)h(b)s(e)e
-(prin)m(ted)f(out)0 4445 y(whenev)m(er)h(a)g(program)g(detects)h(a)f
-(CFITSIO)e(error.)66 b(The)38 b(function)g(\014ts)p 2653
-4445 28 4 v 32 w(rep)s(ort)p 2931 4445 V 32 w(error)h(will)d(prin)m(t)i
-(out)h(the)0 4558 y(en)m(tire)30 b(error)f(message)h(stac)m(k,)i(or)d
-(alternativ)m(ely)h(one)g(ma)m(y)g(call)f(\014ts)p 2376
-4558 V 32 w(read)p 2580 4558 V 33 w(errmsg)g(to)h(get)h(the)f(error)f
-(messages)0 4671 y(one)i(at)g(a)g(time.)0 5011 y Fe(5.11)136
-b(V)-11 b(ariable-Length)45 b(Arra)l(ys)g(in)g(Binary)g(T)-11
-b(ables)0 5262 y Fj(CFITSIO)33 b(pro)m(vides)h(easy-to-use)i(supp)s
-(ort)d(for)i(reading)f(and)g(writing)f(data)i(in)f(v)-5
-b(ariable)33 b(length)h(\014elds)g(of)h(a)0 5375 y(binary)f(table.)55
-b(The)35 b(v)-5 b(ariable)34 b(length)g(columns)g(ha)m(v)m(e)j(TF)m
-(ORMn)e(k)m(eyw)m(ord)h(v)-5 b(alues)34 b(of)i(the)f(form)g
-(`1Pt\(len\)')0 5488 y(where)27 b(`t')g(is)f(the)i(datat)m(yp)s(e)g(co)
-s(de)f(\(e.g.,)j(I,)d(J,)g(E,)g(D,)g(etc.\))41 b(and)27
-b(`len')f(is)h(an)f(in)m(teger)i(sp)s(ecifying)d(the)i(maxim)m(um)0
-5601 y(length)f(of)h(the)h(v)m(ector)g(in)e(the)h(table.)39
-b(If)27 b(the)g(v)-5 b(alue)26 b(of)h(`len')g(is)f(not)h(sp)s
-(eci\014ed)e(when)h(the)h(table)g(is)f(created)i(\(e.g.,)0
-5714 y(if)33 b(the)h(TF)m(ORM)h(k)m(eyw)m(ord)g(v)-5
-b(alue)33 b(is)g(simply)f(sp)s(eci\014ed)h(as)h('1PE')h(instead)e(of)h
-('1PE\(400\))j(\),)f(then)d(CFITSIO)p eop
-%%Page: 51 57
-51 56 bop 0 299 a Fh(5.11.)73 b(V)-10 b(ARIABLE-LENGTH)31
-b(ARRA)-8 b(YS)30 b(IN)g(BINAR)-8 b(Y)32 b(T)-8 b(ABLES)1327
-b Fj(51)0 555 y(will)27 b(automatically)i(scan)g(the)h(table)f(when)g
-(it)g(is)f(closed)h(to)h(determine)f(the)g(maxim)m(um)f(length)h(of)h
-(the)f(v)m(ector)0 668 y(and)h(will)d(app)s(end)i(this)g(v)-5
-b(alue)30 b(to)h(the)g(TF)m(ORMn)f(v)-5 b(alue.)0 828
-y(The)35 b(same)h(routines)e(whic)m(h)g(read)i(and)f(write)f(data)i(in)
-e(an)i(ordinary)e(\014xed)g(length)h(binary)f(table)h(extension)0
-941 y(are)29 b(also)h(used)e(for)h(v)-5 b(ariable)28
-b(length)g(\014elds,)g(ho)m(w)m(ev)m(er,)j(the)e(routine)f(parameters)i
-(tak)m(e)h(on)e(a)g(sligh)m(tly)e(di\013eren)m(t)0 1054
-y(in)m(terpretation)j(as)g(describ)s(ed)f(b)s(elo)m(w.)0
-1214 y(All)35 b(the)h(data)h(in)e(a)i(v)-5 b(ariable)35
-b(length)g(\014eld)g(is)g(written)h(in)m(to)g(an)g(area)h(called)f(the)
-g(`heap')g(whic)m(h)f(follo)m(ws)h(the)0 1327 y(main)30
-b(\014xed-length)h(FITS)f(binary)g(table.)43 b(The)31
-b(size)g(of)g(the)h(heap,)f(in)f(b)m(ytes,)i(is)f(sp)s(eci\014ed)e(b)m
-(y)i(the)h(PCOUNT)0 1440 y(k)m(eyw)m(ord)21 b(in)e(the)i(FITS)f
-(header.)37 b(When)20 b(creating)h(a)g(new)f(binary)f(table,)j(the)f
-(initial)d(v)-5 b(alue)20 b(of)g(PCOUNT)g(should)0 1553
-y(usually)25 b(b)s(e)j(set)g(to)g(zero.)41 b(CFITSIO)26
-b(will)f(recompute)j(the)g(size)f(of)h(the)g(heap)g(as)g(the)g(data)g
-(is)f(written)f(and)i(will)0 1666 y(automatically)d(up)s(date)f(the)i
-(PCOUNT)e(k)m(eyw)m(ord)h(v)-5 b(alue)25 b(when)f(the)h(table)g(is)f
-(closed.)39 b(When)25 b(writing)e(v)-5 b(ariable)0 1779
-y(length)33 b(data)h(to)g(a)g(table,)h(CFITSIO)d(will)e(automatically)k
-(extend)f(the)h(size)f(of)h(the)g(heap)f(area)h(if)f(necessary)-8
-b(,)0 1892 y(so)31 b(that)g(an)m(y)f(follo)m(wing)f(HDUs)i(do)f(not)h
-(get)h(o)m(v)m(erwritten.)0 2052 y(By)e(default)e(the)i(heap)f(data)i
-(area)f(starts)g(immediately)e(after)i(the)f(last)h(ro)m(w)f(of)h(the)g
-(\014xed-length)e(table.)41 b(This)0 2165 y(default)26
-b(starting)g(lo)s(cation)h(ma)m(y)g(b)s(e)f(o)m(v)m(erridden)g(b)m(y)h
-(the)g(THEAP)f(k)m(eyw)m(ord,)i(but)f(this)e(is)h(not)h(recommended.)0
-2278 y(If)35 b(addtional)g(ro)m(ws)g(of)h(data)h(are)f(added)f(to)h
-(the)g(table,)h(CFITSIO)d(will)f(automatically)j(shift)e(the)i(the)g
-(heap)0 2391 y(do)m(wn)e(to)i(mak)m(e)f(ro)s(om)g(for)f(the)h(new)f(ro)
-m(ws,)i(but)e(it)h(is)e(ob)m(viously)h(b)s(e)g(more)h(e\016cien)m(t)g
-(to)g(initially)c(create)37 b(the)0 2503 y(table)30 b(with)e(the)i
-(necessary)g(n)m(um)m(b)s(er)f(of)h(blank)e(ro)m(ws,)i(so)g(that)g(the)
-g(heap)g(do)s(es)f(not)h(needed)g(to)g(b)s(e)f(constan)m(tly)0
-2616 y(mo)m(v)m(ed.)0 2777 y(When)g(writing)f(to)i(a)g(v)-5
-b(ariable)29 b(length)g(\014eld)f(the)i(en)m(tire)f(arra)m(y)h(of)g(v)
--5 b(alues)29 b(for)h(a)g(giv)m(en)f(ro)m(w)h(of)g(the)g(table)f(m)m
-(ust)0 2889 y(b)s(e)e(written)f(with)h(a)h(single)e(call)g(to)j(\014ts)
-p 1363 2889 28 4 v 32 w(write)p 1598 2889 V 32 w(col.)40
-b(The)27 b(total)h(length)f(of)h(the)g(arra)m(y)g(is)e(giv)m(en)i(b)m
-(y)f(nelemen)m(ts)g(+)0 3002 y(\014rstelem)33 b(-)g(1.)51
-b(Additional)31 b(elemen)m(ts)j(cannot)g(b)s(e)f(app)s(ended)f(to)i(an)
-f(existing)g(v)m(ector)i(at)f(a)g(later)f(time)h(since)0
-3115 y(an)m(y)c(attempt)g(to)g(do)f(so)g(will)e(simply)f(o)m(v)m
-(erwrite)k(all)e(the)i(previously)c(written)j(data.)41
-b(Note)30 b(also)f(that)h(the)f(new)0 3228 y(data)c(will)d(b)s(e)i
-(written)g(to)h(a)g(new)f(area)i(of)f(the)f(heap)h(and)f(the)h(heap)f
-(space)h(used)f(b)m(y)h(the)f(previous)g(write)f(cannot)0
-3341 y(b)s(e)32 b(reclaimed.)45 b(F)-8 b(or)34 b(this)d(reason)h(eac)m
-(h)i(ro)m(w)f(of)f(a)h(v)-5 b(ariable)31 b(length)h(\014eld)f(should)f
-(only)i(b)s(e)f(written)h(once.)47 b(An)0 3454 y(exception)37
-b(to)g(this)f(general)g(rule)f(o)s(ccurs)i(when)e(setting)i(elemen)m
-(ts)g(of)g(an)f(arra)m(y)h(as)g(unde\014ned.)57 b(One)36
-b(m)m(ust)0 3567 y(\014rst)30 b(write)g(a)i(dumm)m(y)d(v)-5
-b(alue)31 b(in)m(to)g(the)g(arra)m(y)g(with)f(\014ts)p
-1977 3567 V 32 w(write)p 2212 3567 V 32 w(col,)i(and)e(then)h(call)f
-(\014ts)p 3086 3567 V 32 w(write)p 3321 3567 V 32 w(col)p
-3464 3567 V 33 w(n)m(ul)g(to)i(\015ag)0 3680 y(the)g(desired)e(elemen)m
-(ts)i(as)g(unde\014ned.)43 b(\(Do)33 b(not)f(use)g(the)g(\014ts)p
-2197 3680 V 32 w(write)p 2432 3680 V 32 w(coln)m(ull)e(routines)g(with)
-h(v)-5 b(ariable)31 b(length)0 3793 y(\014elds\).)45
-b(Note)33 b(that)g(the)f(ro)m(ws)h(of)f(a)g(table,)h(whether)f(\014xed)
-f(or)h(v)-5 b(ariable)31 b(length,)i(do)f(not)g(ha)m(v)m(e)h(to)g(b)s
-(e)f(written)0 3906 y(consecutiv)m(ely)f(and)e(ma)m(y)i(b)s(e)f
-(written)f(in)h(an)m(y)g(order.)0 4066 y(When)40 b(writing)f(to)i(a)g
-(v)-5 b(ariable)39 b(length)h(ASCI)s(I)f(c)m(haracter)j(\014eld)d
-(\(e.g.,)45 b(TF)m(ORM)c(=)f('1P)-8 b(A'\))43 b(only)c(a)i(single)0
-4179 y(c)m(haracter)22 b(string)d(can)i(b)s(e)e(written.)37
-b(The)20 b(`\014rstelem')f(and)h(`nelemen)m(ts')h(parameter)f(v)-5
-b(alues)20 b(in)f(the)h(\014ts)p 3526 4179 V 33 w(write)p
-3762 4179 V 32 w(col)0 4292 y(routine)34 b(are)i(ignored)e(and)g(the)i
-(n)m(um)m(b)s(er)d(of)j(c)m(haracters)g(to)g(write)e(is)h(simply)d
-(determined)i(b)m(y)h(the)g(length)g(of)0 4405 y(the)c(input)d(n)m
-(ull-terminated)g(c)m(haracter)k(string.)0 4565 y(The)21
-b(\014ts)p 305 4565 V 33 w(write)p 541 4565 V 32 w(descript)f(routine)h
-(is)f(useful)g(in)g(situations)h(where)g(m)m(ultiple)e(ro)m(ws)j(of)g
-(a)g(v)-5 b(ariable)20 b(length)h(column)0 4678 y(ha)m(v)m(e)32
-b(the)e(iden)m(tical)f(arra)m(y)i(of)g(v)-5 b(alues.)40
-b(One)30 b(can)g(simply)e(write)i(the)g(arra)m(y)h(once)g(for)g(the)f
-(\014rst)g(ro)m(w,)g(and)g(then)0 4791 y(use)c(\014ts)p
-280 4791 V 32 w(write)p 515 4791 V 32 w(descript)f(to)h(write)f(the)h
-(same)h(descriptor)d(v)-5 b(alues)26 b(in)m(to)g(the)g(other)g(ro)m
-(ws;)h(all)e(the)h(ro)m(ws)g(will)d(then)0 4903 y(p)s(oin)m(t)29
-b(to)i(the)g(same)g(storage)h(lo)s(cation)e(th)m(us)g(sa)m(ving)g(disk)
-f(space.)0 5064 y(When)35 b(reading)f(from)g(a)i(v)-5
-b(ariable)33 b(length)i(arra)m(y)g(\014eld)f(one)h(can)g(only)g(read)f
-(as)i(man)m(y)f(elemen)m(ts)g(as)g(actually)0 5176 y(exist)h(in)e(that)
-j(ro)m(w)e(of)h(the)g(table;)j(reading)c(do)s(es)h(not)g(automatically)
-f(con)m(tin)m(ue)h(with)f(the)h(next)g(ro)m(w)g(of)g(the)0
-5289 y(table)28 b(as)g(o)s(ccurs)g(when)f(reading)g(an)h(ordinary)f
-(\014xed)g(length)g(table)h(\014eld.)39 b(A)m(ttempts)29
-b(to)g(read)f(more)g(than)g(this)0 5402 y(will)h(cause)k(an)e(error)h
-(status)g(to)g(b)s(e)f(returned.)44 b(One)32 b(can)g(determine)f(the)h
-(n)m(um)m(b)s(er)e(of)i(elemen)m(ts)g(in)f(eac)m(h)i(ro)m(w)0
-5515 y(of)e(a)f(v)-5 b(ariable)29 b(column)h(with)f(the)h(\014ts)p
-1329 5515 V 33 w(read)p 1534 5515 V 32 w(descript)g(routine.)p
+%%Page: 31 39
+31 38 bop 0 299 a Fh(5.2.)72 b(FITS)30 b(FILE)g(A)m(CCESS)f(R)m
+(OUTINES)2244 b Fj(31)227 555 y(The)33 b(\014ts)p 544
+555 28 4 v 32 w(op)s(en)p 766 555 V 32 w(data)h(routine)d(is)h(similar)
+e(to)k(the)f(\014ts)p 2113 555 V 32 w(op)s(en)p 2335
+555 V 33 w(\014le)e(routine)h(except)i(that)f(it)g(will)d(mo)m(v)m(e)k
+(to)227 668 y(the)23 b(\014rst)f(HDU)h(con)m(taining)f(signi\014can)m
+(t)f(data,)k(if)d(a)h(HDU)g(name)f(or)h(n)m(um)m(b)s(er)e(to)i(op)s(en)
+f(w)m(as)h(not)f(explicitly)227 781 y(sp)s(eci\014ed)36
+b(as)h(part)h(of)f(the)h(\014lename.)60 b(In)37 b(this)f(case,)k(it)d
+(will)e(lo)s(ok)i(for)g(the)g(\014rst)g(IMA)m(GE)h(HDU)g(with)227
+894 y(NAXIS)e(>)f(0,)j(or)d(the)h(\014rst)f(table)g(that)i(do)s(es)e
+(not)h(con)m(tain)g(the)g(strings)e(`GTI')i(\(Go)s(o)s(d)g(Time)e(In)m
+(terv)-5 b(al)227 1007 y(extension\))31 b(or)f(`OBST)-8
+b(ABLE')31 b(in)e(the)h(EXTNAME)h(k)m(eyw)m(ord)g(v)-5
+b(alue.)227 1157 y(The)25 b(\014ts)p 536 1157 V 32 w(op)s(en)p
+758 1157 V 32 w(table)g(and)f(\014ts)p 1305 1157 V 33
+w(op)s(en)p 1528 1157 V 32 w(image)h(routines)f(are)h(similar)e(to)i
+(\014ts)p 2828 1157 V 33 w(op)s(en)p 3051 1157 V 32 w(data)h(except)f
+(they)h(will)227 1270 y(mo)m(v)m(e)h(to)g(the)f(\014rst)f(signi\014can)
+m(t)f(table)i(HDU)g(or)g(image)g(HDU)g(in)e(the)i(\014le,)g(resp)s
+(ectiv)m(ely)-8 b(,)27 b(if)d(a)i(HDU)h(name)227 1383
+y(or)k(n)m(um)m(b)s(er)e(is)g(not)i(sp)s(eci\014ed)d(as)j(part)f(of)h
+(the)f(\014lename.)227 1533 y(IRAF)c(images)f(\(.imh)g(format)h
+(\014les\))e(and)h(ra)m(w)h(binary)d(data)k(arra)m(ys)e(ma)m(y)h(also)g
+(b)s(e)f(op)s(ened)f(with)g(READ-)227 1646 y(ONL)-8 b(Y)37
+b(access.)60 b(CFITSIO)35 b(will)f(automatically)i(test)i(if)d(the)i
+(input)d(\014le)i(is)f(an)i(IRAF)f(image,)j(and)d(if,)227
+1758 y(so)c(will)d(con)m(v)m(ert)k(it)e(on)g(the)h(\015y)f(in)m(to)h(a)
+g(virtual)d(FITS)i(image)h(b)s(efore)f(it)g(is)g(op)s(ened)f(b)m(y)i
+(the)g(application)227 1871 y(program.)64 b(If)37 b(the)h(input)f
+(\014le)g(is)g(a)h(ra)m(w)g(binary)f(data)h(arra)m(y)h(of)f(n)m(um)m(b)
+s(ers,)h(then)e(the)i(data)f(t)m(yp)s(e)h(and)227 1984
+y(dimensions)34 b(of)i(the)g(arra)m(y)h(m)m(ust)f(b)s(e)f(sp)s
+(eci\014ed)f(in)h(square)h(brac)m(k)m(ets)h(follo)m(wing)e(the)h(name)g
+(of)h(the)f(\014le)227 2097 y(\(e.g.)56 b('ra)m(w\014le.dat[i512,512]')
+38 b(op)s(ens)c(a)i(512)g(x)f(512)h(short)e(in)m(teger)i(image\).)55
+b(See)35 b(the)g(`Extended)g(File)227 2210 y(Name)k(Syn)m(tax')g(c)m
+(hapter)g(for)e(more)i(details)e(on)h(ho)m(w)g(to)h(sp)s(ecify)e(the)h
+(ra)m(w)h(\014le)e(name.)64 b(The)38 b(ra)m(w)g(\014le)227
+2323 y(is)j(con)m(v)m(erted)h(on)f(the)h(\015y)f(in)m(to)g(a)g(virtual)
+f(FITS)g(image)i(in)e(memory)h(that)h(is)e(then)h(op)s(ened)g(b)m(y)g
+(the)227 2436 y(application)29 b(program)h(with)f(READONL)-8
+b(Y)31 b(access.)227 2586 y(Programs)g(can)g(read)f(the)h(input)d
+(\014le)i(from)g(the)h('stdin')e(\014le)h(stream)h(if)e(a)i(dash)f(c)m
+(haracter)i(\('-'\))g(is)e(giv)m(en)227 2699 y(as)f(the)f(\014lename.)
+39 b(Files)28 b(can)g(also)g(b)s(e)g(op)s(ened)f(o)m(v)m(er)j(the)e
+(net)m(w)m(ork)h(using)e(FTP)h(or)g(HTTP)g(proto)s(cols)g(b)m(y)227
+2812 y(supplying)f(the)k(appropriate)e(URL)i(as)f(the)h(\014lename.)227
+2962 y(The)43 b(input)e(\014le)h(can)i(b)s(e)f(mo)s(di\014ed)e(in)g(v)
+-5 b(arious)43 b(w)m(a)m(ys)h(to)g(create)g(a)g(virtual)d(\014le)i
+(\(usually)e(stored)i(in)227 3075 y(memory\))31 b(that)g(is)f(then)g
+(op)s(ened)f(b)m(y)i(the)f(application)f(program)h(b)m(y)h(supplying)c
+(a)k(\014ltering)e(or)h(binning)227 3187 y(sp)s(eci\014er)d(in)g
+(square)h(brac)m(k)m(ets)h(follo)m(wing)e(the)h(\014lename.)39
+b(Some)29 b(of)f(the)g(more)h(common)f(\014ltering)f(meth-)227
+3300 y(o)s(ds)32 b(are)h(illustrated)e(in)g(the)i(follo)m(wing)f
+(paragraphs,)h(but)f(users)g(should)e(refer)j(to)g(the)g('Extended)g
+(File)227 3413 y(Name)e(Syn)m(tax')g(c)m(hapter)g(for)f(a)h(complete)g
+(description)d(of)j(the)f(full)f(\014le)g(\014ltering)g(syn)m(tax.)227
+3563 y(When)e(op)s(ening)e(an)i(image,)g(a)h(rectangular)e(subset)g(of)
+h(the)g(ph)m(ysical)e(image)i(ma)m(y)h(b)s(e)e(op)s(ened)f(b)m(y)i
+(listing)227 3676 y(the)k(\014rst)e(and)h(last)g(pixel)f(in)g(eac)m(h)j
+(dimension)c(\(and)i(optional)f(pixel)g(skipping)f(factor\):)227
+3924 y Fe(myimage.fits[101:200,301:)o(400])227 4172 y
+Fj(will)f(create)k(and)e(op)s(en)f(a)i(100x100)i(pixel)c(virtual)g
+(image)h(of)h(that)g(section)f(of)h(the)f(ph)m(ysical)f(image,)j(and)
+227 4285 y Fe(myimage.fits[*,-*])d Fj(op)s(ens)k(a)h(virtual)e(image)i
+(that)g(is)f(the)h(same)g(size)g(as)f(the)h(ph)m(ysical)f(image)h(but)
+227 4398 y(has)d(b)s(een)g(\015ipp)s(ed)e(in)h(the)h(v)m(ertical)h
+(direction.)227 4548 y(When)d(op)s(ening)f(a)h(table,)h(the)f
+(\014ltering)e(syn)m(tax)j(can)f(b)s(e)f(used)h(to)g(add)g(or)g(delete)
+g(columns)f(or)h(k)m(eyw)m(ords)227 4661 y(in)f(the)h(virtual)f(table:)
+39 b Fe(myfile.fits[events][col)j(!time;)k(PI)h(=)h(PHA*1.2])26
+b Fj(op)s(ens)h(a)h(virtual)f(ta-)227 4774 y(ble)k(in)f(whic)m(h)g(the)
+i(TIME)f(column)f(has)h(b)s(een)g(deleted)g(and)g(a)g(new)g(PI)g
+(column)g(has)g(b)s(een)g(added)f(with)227 4886 y(a)41
+b(v)-5 b(alue)39 b(1.2)j(times)d(that)i(of)f(the)h(PHA)f(column.)69
+b(Similarly)-8 b(,)39 b(one)i(can)f(\014lter)g(a)g(table)g(to)h(k)m
+(eep)g(only)227 4999 y(those)35 b(ro)m(ws)e(that)i(satisfy)e(a)h
+(selection)g(criterion:)46 b Fe(myfile.fits[events][pha)c(>)47
+b(50])33 b Fj(creates)j(and)227 5112 y(op)s(ens)31 b(a)g(virtual)f
+(table)h(con)m(taining)g(only)f(those)i(ro)m(ws)f(with)f(a)h(PHA)h(v)-5
+b(alue)30 b(greater)j(than)e(50.)44 b(A)31 b(large)227
+5225 y(n)m(um)m(b)s(er)d(of)h(b)s(o)s(olean)g(and)f(mathematical)i(op)s
+(erators)f(can)g(b)s(e)g(used)f(in)g(the)h(selection)g(expression.)39
+b(One)227 5338 y(can)25 b(also)f(\014lter)g(table)g(ro)m(ws)g(using)f
+('Go)s(o)s(d)i(Time)e(In)m(terv)-5 b(al')25 b(extensions,)g(and)f
+(spatial)f(region)h(\014lters)g(as)g(in)227 5451 y Fe
+(myfile.fits[events][gtifi)o(lter)o(\(\)])14 b Fj(and)19
+b Fe(myfile.fits[events][regfil)o(ter)o(\()42 b("stars.rng"\)])p
+Fj(.)227 5601 y(Finally)-8 b(,)31 b(table)g(columns)f(ma)m(y)i(b)s(e)f
+(binned)e(or)i(histogrammed)g(to)h(generate)h(a)e(virtual)f(image.)44
+b(F)-8 b(or)32 b(ex-)227 5714 y(ample,)c Fe(myfile.fits[events][bin)41
+b(\(X,Y\)=4])26 b Fj(will)e(result)j(in)f(a)i(2-dimensional)d(image)j
+(calculated)p eop
+%%Page: 32 40
+32 39 bop 0 299 a Fj(32)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
+555 y Fj(b)m(y)35 b(binning)c(the)k(X)f(and)g(Y)h(columns)e(in)g(the)i
+(ev)m(en)m(t)h(table)e(with)f(a)i(bin)e(size)h(of)h(4)f(in)g(eac)m(h)h
+(dimension.)227 668 y(The)30 b(TLMINn)g(and)f(TLMAXn)h(k)m(eyw)m(ords)h
+(will)d(b)s(e)h(used)h(b)m(y)g(default)g(to)h(determine)e(the)i(range)f
+(of)h(the)227 781 y(image.)227 928 y(A)j(single)e(program)h(can)g(op)s
+(en)g(the)h(same)f(FITS)g(\014le)f(more)i(than)f(once)h(and)f(then)g
+(treat)h(the)g(resulting)227 1041 y(\014ts\014le)29 b(p)s(oin)m(ters)g
+(as)h(though)g(they)g(w)m(ere)h(completely)f(indep)s(enden)m(t)e(FITS)h
+(\014les.)39 b(Using)30 b(this)f(facilit)m(y)-8 b(,)30
+b(a)227 1154 y(program)i(can)f(op)s(en)g(a)h(FITS)f(\014le)f(t)m(wice,)
+j(mo)m(v)m(e)g(to)f(2)g(di\013eren)m(t)f(extensions)g(within)e(the)i
+(\014le,)g(and)g(then)227 1267 y(read)g(and)e(write)h(data)h(in)e
+(those)i(extensions)f(in)f(an)m(y)i(order.)0 1506 y Fi(2)81
+b Fj(Create)31 b(and)f(op)s(en)f(a)i(new)f(empt)m(y)h(output)f(FITS)f
+(\014le.)227 1732 y Fe(int)47 b(fits_create_file)d(/)j(ffinit)418
+1845 y(\(fitsfile)e(**fptr,)h(char)h(*filename,)e(>)i(int)g(*status\))
+227 2071 y Fj(An)36 b(error)h(will)d(b)s(e)i(returned)f(if)g(the)i(sp)s
+(eci\014ed)e(\014le)h(already)g(exists,)i(unless)d(the)i(\014lename)e
+(is)h(pre\014xed)227 2184 y(with)29 b(an)h(exclamation)g(p)s(oin)m(t)f
+(\(!\).)42 b(In)29 b(that)i(case)g(CFITSIO)d(will)g(o)m(v)m(erwrite)i
+(\(delete\))h(an)m(y)g(existing)e(\014le)227 2297 y(with)35
+b(the)h(same)h(name.)57 b(Note)38 b(that)e(the)h(exclamation)f(p)s(oin)
+m(t)f(is)g(a)i(sp)s(ecial)d(UNIX)i(c)m(haracter)i(so)e(if)f(it)227
+2410 y(is)d(used)f(on)h(the)h(command)f(line)f(it)h(m)m(ust)g(b)s(e)g
+(preceded)g(b)m(y)g(a)g(bac)m(kslash)g(to)i(force)e(the)h(UNIX)g(shell)
+d(to)227 2523 y(accept)i(the)f(c)m(haracter)h(as)e(part)g(of)h(the)g
+(\014lename.)227 2670 y(The)26 b(output)h(\014le)f(will)e(b)s(e)i
+(written)g(to)h(the)g('stdout')g(\014le)f(stream)h(if)f(a)h(dash)f(c)m
+(haracter)i(\('-'\))g(or)f(the)g(string)227 2783 y('stdout')34
+b(is)e(giv)m(en)h(as)h(the)f(\014lename.)48 b(Similarly)-8
+b(,)31 b('-.gz')k(or)e('stdout.gz')i(will)c(cause)i(the)h(\014le)e(to)i
+(b)s(e)e(gzip)227 2896 y(compressed)e(b)s(efore)g(it)g(is)g(written)f
+(out)i(to)g(the)f(stdout)h(stream.)227 3042 y(Optionally)-8
+b(,)38 b(the)f(name)h(of)f(a)h(template)g(\014le)e(that)i(is)e(used)h
+(to)h(de\014ne)f(the)g(structure)g(of)g(the)h(new)f(\014le)227
+3155 y(ma)m(y)i(b)s(e)f(sp)s(eci\014ed)e(in)h(paren)m(theses)i(follo)m
+(wing)d(the)j(output)e(\014le)h(name.)64 b(The)38 b(template)g(\014le)g
+(ma)m(y)h(b)s(e)227 3268 y(another)32 b(FITS)e(\014le,)h(in)f(whic)m(h)
+g(case)j(the)e(new)g(\014le,)g(at)h(the)g(time)f(it)f(is)h(op)s(ened,)g
+(will)d(b)s(e)j(an)g(exact)i(cop)m(y)227 3381 y(of)38
+b(the)g(template)h(\014le)e(except)h(that)h(the)f(data)g(structures)g
+(\(images)g(and)f(tables\))h(will)d(b)s(e)j(\014lled)d(with)227
+3494 y(zeros.)41 b(Alternativ)m(ely)-8 b(,)29 b(the)g(template)h
+(\014le)e(ma)m(y)h(b)s(e)f(an)h(ASCI)s(I)e(format)i(text)h(\014le)e
+(con)m(taining)h(directiv)m(es)227 3607 y(that)g(de\014ne)e(the)h(k)m
+(eyw)m(ords)g(to)g(b)s(e)g(created)h(in)d(eac)m(h)j(HDU)g(of)f(the)g
+(\014le.)39 b(See)28 b(the)g('Extended)f(File)g(Name)227
+3720 y(Syn)m(tax')k(section)g(for)f(a)h(complete)f(description)f(of)h
+(the)h(template)g(\014le)e(syn)m(tax.)0 3959 y Fi(3)81
+b Fj(Close)27 b(a)g(previously)e(op)s(ened)i(FITS)g(\014le.)39
+b(The)27 b(\014rst)f(routine)h(simply)e(closes)i(the)h(\014le,)f
+(whereas)g(the)h(second)227 4072 y(one)41 b(also)f(DELETES)f(THE)h
+(FILE,)g(whic)m(h)f(can)i(b)s(e)e(useful)g(in)g(cases)i(where)e(a)i
+(FITS)e(\014le)h(has)g(b)s(een)227 4185 y(partially)29
+b(created,)i(but)f(then)g(an)g(error)g(o)s(ccurs)g(whic)m(h)g(prev)m
+(en)m(ts)g(it)g(from)g(b)s(eing)f(completed.)95 4424
+y Fe(int)47 b(fits_close_file)d(/)j(ffclos)g(\(fitsfile)e(*fptr,)h(>)h
+(int)g(*status\))95 4650 y(int)g(fits_delete_file)d(/)j(ffdelt)f
+(\(fitsfile)g(*fptr,)g(>)h(int)g(*status\))0 4890 y Fi(4)81
+b Fj(Return)21 b(the)i(name,)h(I/O)e(mo)s(de)g(\(READONL)-8
+b(Y)24 b(or)e(READ)m(WRITE\),)i(and/or)e(the)g(\014le)g(t)m(yp)s(e)g
+(\(e.g.)40 b('\014le://',)227 5003 y('ftp://'\))32 b(of)f(the)f(op)s
+(ened)g(FITS)g(\014le.)95 5242 y Fe(int)47 b(fits_file_name)d(/)k
+(ffflnm)e(\(fitsfile)f(*fptr,)h(>)i(char)e(*filename,)f(int)i
+(*status\))95 5468 y(int)g(fits_file_mode)d(/)k(ffflmd)e(\(fitsfile)f
+(*fptr,)h(>)i(int)f(*iomode,)e(int)i(*status\))95 5694
+y(int)g(fits_url_type)e(/)i(ffurlt)f(\(fitsfile)f(*fptr,)h(>)i(char)f
+(*urltype,)e(int)i(*status\))p eop
+%%Page: 33 41
+33 40 bop 0 299 a Fh(5.3.)72 b(HDU)31 b(A)m(CCESS)e(R)m(OUTINES)2488
+b Fj(33)0 555 y Ff(5.3)135 b(HDU)46 b(Access)e(Routines)0
+811 y Fj(The)30 b(follo)m(wing)f(functions)g(p)s(erform)g(op)s
+(erations)g(on)i(Header-Data)h(Units)e(\(HDUs\))i(as)e(a)h(whole.)0
+1097 y Fi(1)81 b Fj(Mo)m(v)m(e)44 b(to)g(a)f(di\013eren)m(t)f(HDU)h(in)
+f(the)h(\014le.)76 b(The)43 b(\014rst)f(routine)f(mo)m(v)m(es)j(to)g(a)
+f(sp)s(eci\014ed)e(absolute)h(HDU)227 1210 y(n)m(um)m(b)s(er)g
+(\(starting)g(with)g(1)g(for)h(the)g(primary)d(arra)m(y\))k(in)d(the)i
+(FITS)f(\014le,)j(and)d(the)g(second)h(routine)227 1323
+y(mo)m(v)m(es)35 b(a)e(relativ)m(e)g(n)m(um)m(b)s(er)f(HDUs)i(forw)m
+(ard)e(or)h(bac)m(kw)m(ard)h(from)f(the)g(curren)m(t)g(HDU.)h(A)f(n)m
+(ull)e(p)s(oin)m(ter)227 1436 y(ma)m(y)g(b)s(e)f(giv)m(en)g(for)g(the)g
+(hdut)m(yp)s(e)f(parameter)i(if)e(it's)h(v)-5 b(alue)30
+b(is)f(not)i(needed.)40 b(The)30 b(third)e(routine)i(mo)m(v)m(es)227
+1549 y(to)39 b(the)g(\(\014rst\))f(HDU)i(whic)m(h)d(has)h(the)h(sp)s
+(eci\014ed)d(extension)i(t)m(yp)s(e)h(and)f(EXTNAME)g(and)g(EXTVER)227
+1662 y(k)m(eyw)m(ord)26 b(v)-5 b(alues)25 b(\(or)h(HDUNAME)h(and)e
+(HDUVER)h(k)m(eyw)m(ords\).)40 b(The)24 b(hdut)m(yp)s(e)h(parameter)h
+(ma)m(y)g(ha)m(v)m(e)227 1775 y(a)d(v)-5 b(alue)21 b(of)h(IMA)m(GE)p
+935 1775 28 4 v 34 w(HDU,)h(ASCI)s(I)p 1476 1775 V 31
+w(TBL,)f(BINAR)-8 b(Y)p 2101 1775 V 34 w(TBL,)22 b(or)g(ANY)p
+2676 1775 V 34 w(HDU)g(where)g(ANY)p 3396 1775 V 33 w(HDU)h(means)227
+1888 y(that)33 b(only)f(the)g(extname)i(and)d(extv)m(er)j(v)-5
+b(alues)32 b(will)d(b)s(e)j(used)g(to)h(lo)s(cate)g(the)g(correct)g
+(extension.)47 b(If)32 b(the)227 2000 y(input)h(v)-5
+b(alue)35 b(of)g(extv)m(er)h(is)e(0)i(then)e(the)i(EXTVER)e(k)m(eyw)m
+(ord)i(is)e(ignored)g(and)h(the)g(\014rst)f(HDU)i(with)e(a)227
+2113 y(matc)m(hing)27 b(EXTNAME)h(\(or)f(HDUNAME\))i(k)m(eyw)m(ord)e
+(will)d(b)s(e)j(found.)38 b(If)27 b(no)f(matc)m(hing)h(HDU)h(is)e
+(found)227 2226 y(in)f(the)h(\014le)f(then)h(the)g(curren)m(t)g(HDU)g
+(will)e(remain)h(unc)m(hanged)g(and)h(a)g(status)g(=)g(BAD)p
+3246 2226 V 33 w(HDU)p 3484 2226 V 34 w(NUM)h(will)227
+2339 y(b)s(e)j(returned.)95 2625 y Fe(int)47 b(fits_movabs_hdu)d(/)j
+(ffmahd)286 2738 y(\(fitsfile)f(*fptr,)g(int)h(hdunum,)e(>)j(int)f
+(*hdutype,)e(int)i(*status\))95 2964 y(int)g(fits_movrel_hdu)d(/)j
+(ffmrhd)286 3076 y(\(fitsfile)f(*fptr,)g(int)h(nmove,)f(>)h(int)g
+(*hdutype,)e(int)i(*status\))95 3302 y(int)g(fits_movnam_hdu)d(/)j
+(ffmnhd)286 3415 y(\(fitsfile)f(*fptr,)g(int)h(hdutype,)e(char)i
+(*extname,)e(int)i(extver,)f(>)h(int)g(*status\))0 3701
+y Fi(2)81 b Fj(Return)29 b(the)i(total)g(n)m(um)m(b)s(er)e(of)i(HDUs)f
+(in)g(the)g(FITS)g(\014le.)40 b(The)29 b(curren)m(t)i(HDU)g(remains)e
+(unc)m(hanged.)95 3986 y Fe(int)47 b(fits_get_num_hdus)c(/)48
+b(ffthdu)286 4099 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*hdunum,)f(int)h
+(*status\))0 4385 y Fi(3)81 b Fj(Return)31 b(the)h(n)m(um)m(b)s(er)f
+(of)h(the)h(curren)m(t)e(HDU)i(\(CHDU\))h(in)c(the)j(FITS)e(\014le)g
+(\(where)h(the)g(primary)f(arra)m(y)h(=)227 4498 y(1\).)42
+b(This)28 b(function)h(returns)h(the)g(HDU)h(n)m(um)m(b)s(er)e(rather)h
+(than)h(a)f(status)h(v)-5 b(alue.)95 4784 y Fe(int)47
+b(fits_get_hdu_num)d(/)j(ffghdn)286 4897 y(\(fitsfile)f(*fptr,)g(>)h
+(int)g(*hdunum\))0 5182 y Fi(4)81 b Fj(Return)38 b(the)h(t)m(yp)s(e)h
+(of)f(the)h(curren)m(t)f(HDU)h(in)e(the)h(FITS)g(\014le.)66
+b(The)39 b(p)s(ossible)e(v)-5 b(alues)38 b(for)h(hdut)m(yp)s(e)f(are:)
+227 5295 y(IMA)m(GE)p 546 5295 V 34 w(HDU,)31 b(ASCI)s(I)p
+1095 5295 V 32 w(TBL,)f(or)g(BINAR)-8 b(Y)p 1840 5295
+V 34 w(TBL.)95 5581 y Fe(int)47 b(fits_get_hdu_type)c(/)48
+b(ffghdt)286 5694 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*hdutype,)e(int)i
+(*status\))p eop
+%%Page: 34 42
+34 41 bop 0 299 a Fj(34)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fi(5)81 b Fj(Cop)m(y)24 b(all)f(or)h(part)g(of)g(the)g(HDUs)h(in)
+e(the)h(FITS)g(\014le)f(asso)s(ciated)h(with)f(infptr)f(and)i(app)s
+(end)e(them)i(to)h(the)g(end)227 668 y(of)f(the)f(FITS)f(\014le)h(asso)
+s(ciated)g(with)f(outfptr.)38 b(If)23 b('previous')f(is)g(true)h(\(not)
+h(0\),)i(then)d(an)m(y)g(HDUs)h(preceding)227 781 y(the)35
+b(curren)m(t)f(HDU)g(in)f(the)i(input)d(\014le)h(will)f(b)s(e)h(copied)
+h(to)h(the)f(output)g(\014le.)51 b(Similarly)-8 b(,)32
+b('curren)m(t')j(and)227 894 y('follo)m(wing')28 b(determine)g(whether)
+g(the)h(curren)m(t)g(HDU,)g(and/or)g(an)m(y)g(follo)m(wing)e(HDUs)j(in)
+d(the)i(input)e(\014le)227 1007 y(will)g(b)s(e)i(copied)h(to)g(the)g
+(output)f(\014le.)40 b(Th)m(us,)29 b(if)f(all)h(3)h(parameters)g(are)g
+(true,)g(then)g(the)f(en)m(tire)h(input)e(\014le)227
+1120 y(will)33 b(b)s(e)h(copied.)55 b(On)35 b(exit,)h(the)g(curren)m(t)
+f(HDU)h(in)d(the)j(input)d(\014le)i(will)d(b)s(e)j(unc)m(hanged,)h(and)
+f(the)g(last)227 1233 y(HDU)c(in)e(the)i(output)f(\014le)f(will)f(b)s
+(e)i(the)g(curren)m(t)h(HDU.)95 1498 y Fe(int)47 b(fits_copy_file)d(/)k
+(ffcpfl)286 1611 y(\(fitsfile)e(*infptr,)f(fitsfile)h(*outfptr,)f(int)i
+(previous,)e(int)i(current,)477 1724 y(int)g(following,)e(>)j(int)f
+(*status\))0 1989 y Fi(6)81 b Fj(Cop)m(y)34 b(the)h(curren)m(t)f(HDU)h
+(from)f(the)g(FITS)g(\014le)g(asso)s(ciated)g(with)g(infptr)e(and)i
+(app)s(end)e(it)i(to)h(the)g(end)f(of)227 2102 y(the)39
+b(FITS)e(\014le)g(asso)s(ciated)i(with)e(outfptr.)64
+b(Space)38 b(ma)m(y)h(b)s(e)e(reserv)m(ed)i(for)f(MOREKEYS)f
+(additional)227 2215 y(k)m(eyw)m(ords)31 b(in)e(the)i(output)f(header.)
+95 2480 y Fe(int)47 b(fits_copy_hdu)e(/)i(ffcopy)286
+2593 y(\(fitsfile)f(*infptr,)f(fitsfile)h(*outfptr,)f(int)i(morekeys,)e
+(>)j(int)f(*status\))0 2858 y Fi(7)81 b Fj(Cop)m(y)43
+b(the)h(header)g(\(and)f(not)h(the)g(data\))h(from)e(the)h(CHDU)g(asso)
+s(ciated)g(with)f(infptr)e(to)k(the)f(CHDU)227 2971 y(asso)s(ciated)27
+b(with)e(outfptr.)39 b(If)26 b(the)h(curren)m(t)f(output)g(HDU)h(is)f
+(not)g(completely)g(empt)m(y)-8 b(,)29 b(then)d(the)h(CHDU)227
+3084 y(will)32 b(b)s(e)i(closed)g(and)g(a)h(new)f(HDU)h(will)d(b)s(e)i
+(app)s(ended)e(to)j(the)g(output)f(\014le.)52 b(An)34
+b(empt)m(y)h(output)f(data)227 3197 y(unit)29 b(will)f(b)s(e)i(created)
+h(with)e(all)g(v)-5 b(alues)30 b(initially)d(=)j(0\).)95
+3462 y Fe(int)47 b(fits_copy_header)d(/)j(ffcphd)286
+3575 y(\(fitsfile)f(*infptr,)f(fitsfile)h(*outfptr,)f(>)i(int)g
+(*status\))0 3841 y Fi(8)81 b Fj(Delete)34 b(the)f(CHDU)h(in)e(the)h
+(FITS)f(\014le.)49 b(An)m(y)33 b(follo)m(wing)f(HDUs)h(will)e(b)s(e)h
+(shifted)g(forw)m(ard)h(in)f(the)h(\014le,)g(to)227 3954
+y(\014ll)j(in)g(the)h(gap)h(created)g(b)m(y)g(the)f(deleted)g(HDU.)i
+(In)d(the)i(case)g(of)g(deleting)e(the)i(primary)d(arra)m(y)j(\(the)227
+4067 y(\014rst)30 b(HDU)h(in)e(the)i(\014le\))f(then)g(the)h(curren)m
+(t)f(primary)e(arra)m(y)j(will)d(b)s(e)i(replace)g(b)m(y)h(a)g(n)m(ull)
+d(primary)g(arra)m(y)227 4179 y(con)m(taining)j(the)h(minim)m(um)c(set)
+k(of)g(required)d(k)m(eyw)m(ords)j(and)e(no)i(data.)44
+b(If)31 b(there)g(are)h(more)f(extensions)227 4292 y(in)e(the)h(\014le)
+f(follo)m(wing)g(the)h(one)g(that)h(is)e(deleted,)h(then)g(the)g(the)g
+(CHDU)h(will)c(b)s(e)j(rede\014ned)e(to)j(p)s(oin)m(t)e(to)227
+4405 y(the)e(follo)m(wing)e(extension.)40 b(If)26 b(there)h(are)g(no)g
+(follo)m(wing)e(extensions)h(then)h(the)g(CHDU)g(will)d(b)s(e)i
+(rede\014ned)227 4518 y(to)36 b(p)s(oin)m(t)e(to)h(the)g(previous)e
+(HDU.)j(The)e(output)h(hdut)m(yp)s(e)e(parameter)i(returns)f(the)h(t)m
+(yp)s(e)g(of)f(the)h(new)227 4631 y(CHDU.)c(A)g(n)m(ull)d(p)s(oin)m
+(ter)h(ma)m(y)i(b)s(e)f(giv)m(en)h(for)f(hdut)m(yp)s(e)f(if)g(the)i
+(returned)e(v)-5 b(alue)30 b(is)f(not)i(needed.)95 4896
+y Fe(int)47 b(fits_delete_hdu)d(/)j(ffdhdu)286 5009 y(\(fitsfile)f
+(*fptr,)g(>)h(int)g(*hdutype,)e(int)i(*status\))0 5349
+y Ff(5.4)135 b(Header)46 b(Keyw)l(ord)g(Read/W)-11 b(rite)46
+b(Routines)0 5601 y Fj(These)35 b(routines)f(read)g(or)h(write)g(k)m
+(eyw)m(ords)g(in)f(the)h(Curren)m(t)f(Header)h(Unit)f(\(CHU\).)i(Wild)e
+(card)g(c)m(haracters)0 5714 y(\(*,)28 b(?,)g(or)e(#\))h(ma)m(y)g(b)s
+(e)f(used)g(when)f(sp)s(ecifying)g(the)i(name)f(of)h(the)g(k)m(eyw)m
+(ord)g(to)g(b)s(e)f(read:)39 b(a)27 b(')10 b(?')39 b(will)24
+b(matc)m(h)k(an)m(y)p eop
+%%Page: 35 43
+35 42 bop 0 299 a Fh(5.4.)72 b(HEADER)31 b(KEYW)m(ORD)g(READ/WRITE)g(R)
+m(OUTINES)1495 b Fj(35)0 555 y(single)33 b(c)m(haracter)i(at)g(that)f
+(p)s(osition)e(in)h(the)h(k)m(eyw)m(ord)h(name)f(and)f(a)h('*')h(will)d
+(matc)m(h)i(an)m(y)h(length)e(\(including)0 668 y(zero\))d(string)e(of)
+h(c)m(haracters.)42 b(The)28 b('#')h(c)m(haracter)i(will)26
+b(matc)m(h)k(an)m(y)f(consecutiv)m(e)h(string)e(of)h(decimal)f(digits)f
+(\(0)0 781 y(-)35 b(9\).)55 b(When)35 b(a)g(wild)e(card)i(is)f(used)g
+(the)h(routine)f(will)e(only)i(searc)m(h)i(for)f(a)g(matc)m(h)h(from)e
+(the)h(curren)m(t)g(header)0 894 y(p)s(osition)25 b(to)j(the)f(end)f
+(of)h(the)g(header)g(and)f(will)e(not)j(resume)g(the)g(searc)m(h)g
+(from)g(the)g(top)g(of)g(the)g(header)g(bac)m(k)g(to)0
+1007 y(the)k(original)f(header)h(p)s(osition)e(as)j(is)e(done)h(when)f
+(no)h(wildcards)e(are)j(included)c(in)i(the)h(k)m(eyw)m(ord)h(name.)43
+b(The)0 1120 y(\014ts)p 127 1120 28 4 v 32 w(read)p 331
+1120 V 33 w(record)32 b(routine)f(ma)m(y)h(b)s(e)g(used)f(to)h(set)h
+(the)f(starting)g(p)s(osition)e(when)h(doing)g(wild)e(card)j(searc)m
+(hs.)46 b(A)0 1233 y(status)29 b(v)-5 b(alue)29 b(of)g(KEY)p
+809 1233 V 32 w(NO)p 980 1233 V 33 w(EXIST)f(is)g(returned)f(if)h(the)h
+(sp)s(eci\014ed)e(k)m(eyw)m(ord)j(to)f(b)s(e)g(read)f(is)g(not)i(found)
+d(in)h(the)0 1346 y(header.)0 1648 y Fd(5.4.1)112 b(Keyw)m(ord)38
+b(Reading)f(Routines)0 1864 y Fi(1)81 b Fj(Return)33
+b(the)h(n)m(um)m(b)s(er)e(of)i(existing)f(k)m(eyw)m(ords)i(\(not)f
+(coun)m(ting)g(the)g(END)g(k)m(eyw)m(ord\))h(and)e(the)h(amoun)m(t)h
+(of)227 1977 y(space)e(curren)m(tly)e(a)m(v)-5 b(ailable)31
+b(for)h(more)g(k)m(eyw)m(ords.)46 b(It)32 b(returns)e(morek)m(eys)j(=)f
+(-1)g(if)f(the)h(header)g(has)g(not)227 2090 y(y)m(et)27
+b(b)s(een)d(closed.)39 b(Note)26 b(that)g(CFITSIO)d(will)g(dynamically)
+g(add)h(space)i(if)e(required)f(when)h(writing)f(new)227
+2203 y(k)m(eyw)m(ords)32 b(to)g(a)f(header)g(so)h(in)e(practice)h
+(there)h(is)e(no)h(limit)e(to)j(the)f(n)m(um)m(b)s(er)f(of)i(k)m(eyw)m
+(ords)f(that)h(can)g(b)s(e)227 2316 y(added)e(to)h(a)f(header.)41
+b(A)30 b(n)m(ull)e(p)s(oin)m(ter)i(ma)m(y)g(b)s(e)g(en)m(tered)h(for)f
+(the)g(morek)m(eys)h(parameter)g(if)e(it's)h(v)-5 b(alue)30
+b(is)227 2429 y(not)h(needed.)95 2698 y Fe(int)47 b(fits_get_hdrspace)c
+(/)48 b(ffghsp)286 2811 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*keysexist,)e
+(int)i(*morekeys,)e(int)i(*status\))0 3081 y Fi(2)81
+b Fj(Return)28 b(the)h(sp)s(eci\014ed)e(k)m(eyw)m(ord.)41
+b(In)29 b(the)g(\014rst)f(routine,)h(the)g(datat)m(yp)s(e)h(parameter)g
+(sp)s(eci\014es)d(the)i(desired)227 3194 y(returned)e(data)h(t)m(yp)s
+(e)g(of)g(the)g(k)m(eyw)m(ord)h(v)-5 b(alue)27 b(and)g(can)h(ha)m(v)m
+(e)h(one)f(of)g(the)g(follo)m(wing)e(sym)m(b)s(olic)h(constan)m(t)227
+3307 y(v)-5 b(alues:)46 b(TSTRING,)33 b(TLOGICAL)f(\(==)h(in)m(t\),)i
+(TBYTE,)e(TSHOR)-8 b(T,)33 b(TUSHOR)-8 b(T,)32 b(TINT,)h(TUINT,)227
+3420 y(TLONG,)39 b(TULONG,)f(TFLO)m(A)-8 b(T,)39 b(TDOUBLE,)g
+(TCOMPLEX,)e(and)h(TDBLCOMPLEX.)h(Within)227 3533 y(the)c(con)m(text)h
+(of)e(this)g(routine,)g(TSTRING)g(corresp)s(onds)e(to)j(a)g('c)m(har*')
+h(data)f(t)m(yp)s(e,)h(i.e.,)f(a)g(p)s(oin)m(ter)e(to)227
+3646 y(a)e(c)m(haracter)i(arra)m(y)-8 b(.)43 b(Data)32
+b(t)m(yp)s(e)f(con)m(v)m(ersion)g(will)d(b)s(e)i(p)s(erformed)g(for)g
+(n)m(umeric)g(v)-5 b(alues)30 b(if)g(the)g(k)m(eyw)m(ord)227
+3759 y(v)-5 b(alue)35 b(do)s(es)g(not)g(ha)m(v)m(e)h(the)f(same)h(data)
+g(t)m(yp)s(e.)55 b(If)34 b(the)h(v)-5 b(alue)35 b(of)g(the)g(k)m(eyw)m
+(ord)h(is)e(unde\014ned)f(\(i.e.,)k(the)227 3871 y(v)-5
+b(alue)30 b(\014eld)f(is)h(blank\))f(then)h(an)g(error)g(status)h(=)f
+(V)-10 b(ALUE)p 2280 3871 V 33 w(UNDEFINED)31 b(will)d(b)s(e)i
+(returned.)227 4027 y(The)36 b(second)g(routine)f(returns)g(the)h(k)m
+(eyw)m(ord)h(v)-5 b(alue)35 b(as)h(a)h(c)m(haracter)h(string)d(\(a)h
+(literal)f(cop)m(y)i(of)f(what)227 4140 y(is)d(in)f(the)i(v)-5
+b(alue)33 b(\014eld\))f(regardless)h(of)g(the)h(in)m(trinsic)d(data)j
+(t)m(yp)s(e)g(of)f(the)h(k)m(eyw)m(ord.)50 b(The)33 b(third)f(routine)
+227 4253 y(returns)d(the)i(en)m(tire)f(80-c)m(haracter)j(header)e
+(record)f(of)g(the)h(k)m(eyw)m(ord.)227 4408 y(If)f(a)h(NULL)f(commen)m
+(t)i(p)s(oin)m(ter)d(is)g(supplied)f(then)i(the)g(commen)m(t)i(string)d
+(will)f(not)i(b)s(e)g(returned.)95 4677 y Fe(int)47 b(fits_read_key)e
+(/)i(ffgky)286 4790 y(\(fitsfile)f(*fptr,)g(int)h(datatype,)e(char)i
+(*keyname,)e(>)i(DTYPE)g(*value,)334 4903 y(char)g(*comment,)e(int)i
+(*status\))95 5129 y(int)g(fits_read_keyword)c(/)48 b(ffgkey)286
+5242 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h(char)g(*value,)f
+(char)g(*comment,)334 5355 y(int)h(*status\))95 5581
+y(int)g(fits_read_card)d(/)k(ffgcrd)286 5694 y(\(fitsfile)e(*fptr,)g
+(char)g(*keyname,)g(>)h(char)g(*card,)f(int)h(*status\))p
 eop
-%%Page: 52 58
-52 57 bop 0 299 a Fj(52)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fe(5.12)136 b(Supp)t(ort)44 b(for)h(IEEE)g(Sp)t(ecial)h(V)-11
-b(alues)0 861 y Fj(The)26 b(ANSI/IEEE-754)h(\015oating-p)s(oin)m(t)f(n)
-m(um)m(b)s(er)f(standard)g(de\014nes)h(certain)g(sp)s(ecial)f(v)-5
-b(alues)25 b(that)i(are)g(used)e(to)0 974 y(represen)m(t)j(suc)m(h)g
-(quan)m(tities)f(as)h(Not-a-Num)m(b)s(er)h(\(NaN\),)h(denormalized,)d
-(under\015o)m(w,)g(o)m(v)m(er\015o)m(w,)j(and)d(in\014nit)m(y)-8
-b(.)0 1087 y(\(See)29 b(the)f(App)s(endix)d(in)i(the)h(NOST)g(FITS)f
-(standard)g(or)h(the)g(NOST)g(FITS)f(User's)h(Guide)f(for)h(a)g(list)f
-(of)h(these)0 1200 y(v)-5 b(alues\).)54 b(The)34 b(CFITSIO)f(routines)h
-(that)h(read)g(\015oating)f(p)s(oin)m(t)g(data)i(in)d(FITS)h(\014les)g
-(recognize)h(these)h(IEEE)0 1313 y(sp)s(ecial)22 b(v)-5
-b(alues)24 b(and)f(b)m(y)g(default)g(in)m(terpret)h(the)g(o)m(v)m
-(er\015o)m(w)h(and)e(in\014nit)m(y)e(v)-5 b(alues)24
-b(as)g(b)s(eing)e(equiv)-5 b(alen)m(t)23 b(to)i(a)f(NaN,)0
-1426 y(and)36 b(con)m(v)m(ert)i(the)e(under\015o)m(w)f(and)h
-(denormalized)f(v)-5 b(alues)35 b(in)m(to)i(zeros.)59
-b(In)36 b(some)g(cases)i(programmers)d(ma)m(y)0 1539
-y(w)m(an)m(t)d(access)h(to)g(the)e(ra)m(w)h(IEEE)f(v)-5
-b(alues,)31 b(without)g(an)m(y)h(mo)s(di\014cation)e(b)m(y)h(CFITSIO.)f
-(This)g(can)i(b)s(e)f(done)g(b)m(y)0 1652 y(calling)26
-b(the)j(\014ts)p 567 1652 28 4 v 32 w(read)p 771 1652
-V 33 w(img)e(or)h(\014ts)p 1209 1652 V 33 w(read)p 1414
-1652 V 32 w(col)g(routines)f(while)f(sp)s(ecifying)g(0.0)j(as)f(the)g
-(v)-5 b(alue)28 b(of)g(the)g(NULL)-10 b(V)g(AL)0 1765
-y(parameter.)59 b(This)35 b(will)e(force)k(CFITSIO)e(to)i(simply)d
-(pass)i(the)h(IEEE)f(v)-5 b(alues)35 b(through)h(to)h(the)g
-(application)0 1877 y(program)31 b(without)f(an)m(y)i(mo)s
-(di\014cation.)42 b(This)29 b(is)i(not)g(fully)e(supp)s(orted)h(on)h(V)
--10 b(AX/VMS)32 b(mac)m(hines,)f(ho)m(w)m(ev)m(er,)0
-1990 y(where)f(there)g(is)g(no)g(easy)h(w)m(a)m(y)g(to)h(b)m(ypass)e
-(the)g(default)g(in)m(terpretation)f(of)i(the)g(IEEE)e(sp)s(ecial)g(v)
--5 b(alues.)0 2603 y Fe(5.13)136 b(When)44 b(the)h(Final)h(Size)f(of)g
-(the)g(FITS)f(HDU)h(is)g(Unkno)l(wn)0 2910 y Fj(It)27
-b(is)g(not)g(required)e(to)j(kno)m(w)f(the)h(total)g(size)f(of)g(a)h
-(FITS)e(data)i(arra)m(y)g(or)f(table)g(b)s(efore)g(b)s(eginning)d(to)k
-(write)f(the)0 3022 y(data)32 b(to)f(the)g(FITS)f(\014le.)42
-b(In)30 b(the)h(case)h(of)f(the)g(primary)e(arra)m(y)i(or)g(an)f(image)
-i(extension,)e(one)i(should)c(initially)0 3135 y(create)j(the)e(arra)m
-(y)h(with)d(the)j(size)f(of)g(the)g(highest)f(dimension)f(\(largest)j
-(NAXISn)e(k)m(eyw)m(ord\))i(set)g(to)g(a)f(dumm)m(y)0
-3248 y(v)-5 b(alue,)25 b(suc)m(h)f(as)g(1.)39 b(Then)23
-b(after)i(all)e(the)i(data)f(ha)m(v)m(e)i(b)s(een)d(written)g(and)h
-(the)g(true)g(dimensions)e(are)i(kno)m(wn,)h(then)0 3361
-y(the)33 b(NAXISn)f(v)-5 b(alue)32 b(should)f(b)s(e)h(up)s(dated)g
-(using)f(the)i(\014ts)p 2069 3361 V 33 w(up)s(date)p
-2378 3361 V 32 w(k)m(ey)g(routine)f(b)s(efore)h(mo)m(ving)f(to)i
-(another)0 3474 y(extension)c(or)g(closing)g(the)g(FITS)g(\014le.)0
-3634 y(When)f(writing)e(to)i(FITS)g(tables,)g(CFITSIO)e(automatically)i
-(k)m(eeps)h(trac)m(k)g(of)f(the)g(highest)g(ro)m(w)g(n)m(um)m(b)s(er)e
-(that)0 3747 y(is)k(written)g(to,)i(and)e(will)e(increase)j(the)g(size)
-g(of)g(the)g(table)f(if)g(necessary)-8 b(.)46 b(CFITSIO)30
-b(will)f(also)j(automatically)0 3860 y(insert)j(space)i(in)e(the)h
-(FITS)f(\014le)h(if)f(necessary)-8 b(,)39 b(to)e(ensure)e(that)i(the)f
-(data)h('heap',)h(if)d(it)h(exists,)h(and/or)g(an)m(y)0
-3973 y(additional)26 b(HDUs)j(that)g(follo)m(w)e(the)i(table)f(do)g
-(not)h(get)g(o)m(v)m(erwritten)g(as)f(new)g(ro)m(ws)g(are)h(written)e
-(to)i(the)g(table.)0 4133 y(As)37 b(a)h(general)f(rule)f(it)h(is)f(b)s
-(est)h(to)h(sp)s(ecify)e(the)i(initial)c(n)m(um)m(b)s(er)i(of)i(ro)m
-(ws)f(=)g(0)g(when)g(the)g(table)g(is)g(created,)0 4246
-y(then)h(let)g(CFITSIO)f(k)m(eep)i(trac)m(k)g(of)g(the)f(n)m(um)m(b)s
-(er)f(of)i(ro)m(ws)f(that)h(are)f(actually)g(written.)64
-b(The)38 b(application)0 4359 y(program)e(should)e(not)j(man)m(ually)e
-(up)s(date)g(the)i(n)m(um)m(b)s(er)e(of)h(ro)m(ws)g(in)f(the)i(table)f
-(\(as)h(giv)m(en)f(b)m(y)g(the)h(NAXIS2)0 4472 y(k)m(eyw)m(ord\))j
-(since)e(CFITSIO)f(do)s(es)i(this)f(automatically)-8
-b(.)66 b(If)38 b(a)i(table)e(is)g(initially)e(created)k(with)d(more)i
-(than)0 4585 y(zero)g(ro)m(ws,)i(then)d(this)g(will)e(ususally)g(b)s(e)
-i(considered)f(as)i(the)g(minim)m(um)c(size)k(of)f(the)h(table,)i(ev)m
-(en)e(if)f(few)m(er)0 4698 y(ro)m(ws)30 b(are)g(actually)f(written)g
-(to)i(the)f(table.)40 b(Th)m(us,)30 b(if)e(a)j(table)e(is)g(initially)d
-(created)31 b(with)e(NAXIS2)h(=)f(20,)j(and)0 4811 y(CFITSIO)f(only)h
-(writes)f(10)j(ro)m(ws)e(of)h(data)g(b)s(efore)f(closing)g(the)h
-(table,)g(then)f(NAXIS2)h(will)d(remain)h(equal)h(to)0
-4924 y(20.)50 b(If)33 b(ho)m(w)m(ev)m(er,)i(30)g(ro)m(ws)e(of)g(data)h
-(are)g(written)e(to)i(this)e(table,)i(then)f(NAXIS2)h(will)c(b)s(e)j
-(increased)f(from)h(20)0 5036 y(to)f(30.)44 b(The)31
-b(one)g(exception)h(to)g(this)e(automatic)i(up)s(dating)d(of)i(the)h
-(NAXIS2)f(k)m(eyw)m(ord)h(is)e(if)g(the)i(application)0
-5149 y(program)c(directly)e(mo)s(di\014es)g(the)j(v)-5
-b(alue)27 b(of)h(NAXIS2)g(\(up)f(or)h(do)m(wn\))g(itself)f(just)g(b)s
-(efore)h(closing)f(the)h(table.)40 b(In)0 5262 y(this)27
-b(case,)j(CFITSIO)d(do)s(es)h(not)h(up)s(date)e(NAXIS2)i(again,)g
-(since)f(it)g(assumes)g(that)h(the)f(application)f(program)0
-5375 y(m)m(ust)32 b(ha)m(v)m(e)h(had)f(a)g(go)s(o)s(d)g(reason)h(for)f
-(c)m(hanging)g(the)g(v)-5 b(alue)32 b(directly)-8 b(.)45
-b(This)30 b(is)h(not)i(recommended,)f(ho)m(w)m(ev)m(er,)0
-5488 y(and)j(is)g(only)g(pro)m(vided)g(for)g(bac)m(kw)m(ard)h
-(compatibilit)m(y)e(with)h(soft)m(w)m(are)i(that)g(initially)32
-b(creates)37 b(a)f(table)g(with)0 5601 y(a)e(large)g(n)m(um)m(b)s(er)f
-(of)h(ro)m(ws,)h(than)f(decreases)g(the)h(NAXIS2)f(v)-5
-b(alue)33 b(to)i(the)f(actual)g(smaller)f(v)-5 b(alue)33
-b(just)g(b)s(efore)0 5714 y(closing)c(the)i(table.)p
+%%Page: 36 44
+36 43 bop 0 299 a Fj(36)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fi(3)81 b Fj(Return)27 b(the)h(n)m(th)h(header)f(record)g(in)f
+(the)h(CHU.)h(The)e(\014rst)h(k)m(eyw)m(ord)h(in)d(the)j(header)f(is)f
+(at)i(k)m(eyn)m(um)f(=)g(1;)i(if)227 668 y(k)m(eyn)m(um)g(=)f(0)i(then)
+e(these)h(routines)f(simply)e(reset)k(the)f(in)m(ternal)e(CFITSIO)g(p)s
+(oin)m(ter)h(to)i(the)f(b)s(eginning)227 781 y(of)f(the)g(header)g(so)g
+(that)g(subsequen)m(t)f(k)m(eyw)m(ord)h(op)s(erations)g(will)d(start)j
+(at)h(the)f(top)g(of)f(the)h(header)g(\(e.g.,)227 894
+y(prior)38 b(to)i(searc)m(hing)f(for)g(k)m(eyw)m(ords)h(using)e(wild)e
+(cards)j(in)f(the)i(k)m(eyw)m(ord)g(name\).)68 b(The)38
+b(\014rst)h(routine)227 1007 y(returns)j(the)h(en)m(tire)g(80-c)m
+(haracter)i(header)e(record,)j(while)41 b(the)i(second)g(routine)f
+(parses)g(the)h(record)227 1120 y(and)35 b(returns)f(the)i(name,)h(v)-5
+b(alue,)36 b(and)f(commen)m(t)h(\014elds)e(as)i(separate)g(c)m
+(haracter)h(strings.)54 b(If)35 b(a)h(NULL)227 1233 y(commen)m(t)c(p)s
+(oin)m(ter)d(is)g(giv)m(en)i(on)f(input,)f(then)h(the)g(commen)m(t)i
+(string)d(will)f(not)j(b)s(e)e(returned.)95 1509 y Fe(int)47
+b(fits_read_record)d(/)j(ffgrec)286 1622 y(\(fitsfile)f(*fptr,)g(int)h
+(keynum,)e(>)j(char)f(*card,)f(int)h(*status\))95 1848
+y(int)g(fits_read_keyn)d(/)k(ffgkyn)286 1961 y(\(fitsfile)e(*fptr,)g
+(int)h(keynum,)e(>)j(char)f(*keyname,)e(char)h(*value,)334
+2074 y(char)h(*comment,)e(int)i(*status\))0 2350 y Fi(4)81
+b Fj(Return)44 b(the)i(next)g(k)m(eyw)m(ord)g(whose)f(name)h(matc)m
+(hes)g(one)g(of)g(the)f(strings)g(in)f('inclist')g(but)h(do)s(es)g(not)
+227 2463 y(matc)m(h)31 b(an)m(y)g(of)g(the)f(strings)f(in)g('exclist'.)
+41 b(The)30 b(strings)f(in)g(inclist)f(and)i(exclist)g(ma)m(y)g(con)m
+(tain)h(wild)d(card)227 2576 y(c)m(haracters)34 b(\(*,)f(?,)f(and)f
+(#\))h(as)g(describ)s(ed)e(at)j(the)f(b)s(eginning)d(of)j(this)f
+(section.)45 b(This)30 b(routine)h(searc)m(hes)227 2689
+y(from)k(the)g(curren)m(t)g(header)g(p)s(osition)e(to)j(the)f(end)f(of)
+h(the)h(header,)g(only)-8 b(,)36 b(and)e(do)s(es)h(not)g(con)m(tin)m
+(ue)h(the)227 2802 y(searc)m(h)c(from)e(the)h(top)g(of)g(the)g(header)g
+(bac)m(k)g(to)h(the)f(original)e(p)s(osition.)40 b(The)31
+b(curren)m(t)f(header)h(p)s(osition)227 2915 y(ma)m(y)e(b)s(e)e(reset)h
+(with)f(the)h(\013grec)g(routine.)39 b(Note)29 b(that)g(nexc)f(ma)m(y)g
+(b)s(e)f(set)h(=)g(0)g(if)f(there)h(are)g(no)g(k)m(eyw)m(ords)227
+3027 y(to)h(b)s(e)f(excluded.)38 b(This)27 b(routine)g(returns)g
+(status)h(=)g(KEY)p 2268 3027 28 4 v 32 w(NO)p 2439 3027
+V 33 w(EXIST)f(if)g(a)i(matc)m(hing)f(k)m(eyw)m(ord)h(is)e(not)227
+3140 y(found.)95 3417 y Fe(int)47 b(fits_find_nextkey)c(/)48
+b(ffgnxk)286 3530 y(\(fitsfile)e(*fptr,)g(char)g(**inclist,)f(int)i
+(ninc,)g(char)f(**exclist,)334 3643 y(int)h(nexc,)f(>)i(char)e(*card,)h
+(int)94 b(*status\))0 3919 y Fi(5)81 b Fj(Return)25 b(the)h(ph)m
+(ysical)e(units)h(string)g(from)g(an)h(existing)f(k)m(eyw)m(ord.)39
+b(This)25 b(routine)g(uses)g(a)h(lo)s(cal)g(con)m(v)m(en)m(tion,)227
+4032 y(sho)m(wn)f(in)f(the)h(follo)m(wing)f(example,)i(in)e(whic)m(h)g
+(the)i(k)m(eyw)m(ord)f(units)f(are)i(enclosed)f(in)f(square)h(brac)m(k)
+m(ets)h(in)227 4145 y(the)k(b)s(eginning)d(of)j(the)g(k)m(eyw)m(ord)g
+(commen)m(t)g(\014eld.)39 b(A)30 b(n)m(ull)e(string)g(is)h(returned)f
+(if)h(no)g(units)f(are)i(de\014ned)227 4258 y(for)g(the)h(k)m(eyw)m
+(ord.)239 4534 y Fe(VELOCITY=)809 b(12.3)46 b(/)i([km/s])e(orbital)g
+(speed)95 4760 y(int)h(fits_read_key_unit)c(/)48 b(ffgunt)286
+4873 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h(char)g(*unit,)f
+(int)h(*status\))0 5149 y Fi(6)81 b Fj(Concatenate)39
+b(the)f(header)f(k)m(eyw)m(ords)h(in)f(the)g(CHDU)h(in)m(to)g(a)g
+(single)e(long)h(string)g(of)h(c)m(haracters.)64 b(This)227
+5262 y(pro)m(vides)27 b(a)i(con)m(v)m(enien)m(t)g(w)m(a)m(y)g(of)g
+(passing)e(all)g(or)h(part)g(of)g(the)h(header)f(information)e(in)h(a)i
+(FITS)e(HDU)i(to)227 5375 y(other)i(subroutines.)38 b(Eac)m(h)31
+b(80-c)m(haracter)h(\014xed-length)e(k)m(eyw)m(ord)g(record)g(is)f(app)
+s(ended)f(to)j(the)f(output)227 5488 y(c)m(haracter)j(string,)e(in)f
+(order,)h(with)f(no)h(in)m(terv)m(ening)g(separator)h(or)f(terminating)
+f(c)m(haracters.)45 b(The)31 b(last)227 5601 y(header)i(record)g(is)f
+(terminated)h(with)f(a)h(NULL)g(c)m(haracter.)50 b(This)32
+b(routine)g(allo)s(cates)h(memory)g(for)g(the)227 5714
+y(returned)c(c)m(haracter)j(arra)m(y)-8 b(,)32 b(so)f(the)f(calling)f
+(program)h(m)m(ust)g(free)h(the)g(memory)f(when)f(\014nished.)p
 eop
-%%Page: 53 59
-53 58 bop 0 299 a Fh(5.14.)73 b(LOCAL)29 b(FITS)h(CONVENTIONS)f(SUPPOR)
--8 b(TED)29 b(BY)i(CFITSIO)1102 b Fj(53)0 555 y Fe(5.14)136
-b(Lo)t(cal)45 b(FITS)e(Con)l(v)l(en)l(tions)k(supp)t(orted)d(b)l(y)h
-(CFITSIO)0 805 y Fj(CFITSIO)25 b(supp)s(orts)g(sev)m(eral)i(lo)s(cal)e
-(FITS)h(con)m(v)m(en)m(tions)i(whic)m(h)d(are)i(not)g(de\014ned)e(in)g
-(the)i(o\016cial)f(NOST)g(FITS)0 918 y(standard)k(and)g(whic)m(h)g(are)
-h(not)g(necessarily)e(recognized)i(or)g(supp)s(orted)e(b)m(y)i(other)g
-(FITS)f(soft)m(w)m(are)i(pac)m(k)-5 b(ages.)0 1031 y(Programmers)36
-b(should)e(b)s(e)h(cautious)h(ab)s(out)f(using)g(these)h(features,)i
-(esp)s(ecially)c(if)h(the)h(FITS)f(\014les)g(that)i(are)0
-1144 y(pro)s(duced)31 b(are)i(exp)s(ected)g(to)g(b)s(e)f(pro)s(cessed)g
-(b)m(y)h(other)f(soft)m(w)m(are)i(systems)f(whic)m(h)e(do)i(not)f(use)h
-(the)f(CFITSIO)0 1257 y(in)m(terface.)0 1547 y Fd(5.14.1)113
-b(Long)38 b(String)e(Keyw)m(ord)h(V)-9 b(alues.)0 1766
-y Fj(The)43 b(length)h(of)g(a)g(standard)g(FITS)f(string)g(k)m(eyw)m
-(ord)h(is)f(limited)f(to)j(68)f(c)m(haracters)i(b)s(ecause)e(it)f(m)m
-(ust)h(\014t)0 1879 y(en)m(tirely)33 b(within)e(a)j(single)f(FITS)g
-(header)g(k)m(eyw)m(ord)i(record.)50 b(In)33 b(some)i(instances)e(it)g
-(is)g(necessary)h(to)h(enco)s(de)0 1992 y(strings)28
-b(longer)i(than)f(this)f(limit,)g(so)i(CFITSIO)e(supp)s(orts)g(a)h(lo)s
-(cal)g(con)m(v)m(en)m(tion)i(in)d(whic)m(h)h(the)g(string)g(v)-5
-b(alue)29 b(is)0 2105 y(con)m(tin)m(ued)35 b(o)m(v)m(er)h(m)m(ultiple)c
-(k)m(eyw)m(ords.)55 b(This)33 b(con)m(tin)m(uation)h(con)m(v)m(en)m
-(tion)i(uses)f(an)f(amp)s(ersand)g(c)m(haracter)i(at)0
-2218 y(the)26 b(end)f(of)h(eac)m(h)g(substring)e(to)i(indicate)f(that)h
-(it)g(is)e(con)m(tin)m(ued)i(on)f(the)h(next)g(k)m(eyw)m(ord,)h(and)e
-(the)h(con)m(tin)m(uation)0 2331 y(k)m(eyw)m(ords)40
-b(all)f(ha)m(v)m(e)i(the)f(name)g(CONTINUE)f(without)g(an)h(equal)f
-(sign)g(in)g(column)g(9.)69 b(The)40 b(string)e(v)-5
-b(alue)0 2444 y(ma)m(y)33 b(b)s(e)f(con)m(tin)m(ued)g(in)g(this)f(w)m
-(a)m(y)i(o)m(v)m(er)h(as)f(man)m(y)g(additional)d(CONTINUE)i(k)m(eyw)m
-(ords)h(as)f(is)g(required.)45 b(The)0 2557 y(follo)m(wing)34
-b(lines)f(illustrate)g(this)h(con)m(tin)m(uation)h(con)m(v)m(en)m(tion)
-i(whic)m(h)c(is)i(used)f(in)g(the)h(v)-5 b(alue)35 b(of)g(the)g(STRKEY)
-0 2670 y(k)m(eyw)m(ord:)0 2927 y Ff(LONGSTRN=)45 b('OGIP)i(1.0')189
-b(/)48 b(The)f(OGIP)f(Long)h(String)f(Convention)f(may)i(be)g(used.)0
-3040 y(STRKEY)94 b(=)47 b('This)g(is)g(a)g(very)g(long)g(string)f
-(keyword&')93 b(/)47 b(Optional)f(Comment)0 3153 y(CONTINUE)93
-b(')48 b(value)e(that)h(is)g(continued)e(over)i(3)g(keywords)f(in)h
-(the)g(&)95 b(')0 3266 y(CONTINUE)e('FITS)47 b(header.')e(/)j(This)e
-(is)h(another)f(optional)g(comment.)0 3523 y Fj(It)29
-b(is)f(recommended)g(that)h(the)g(LONGSTRN)f(k)m(eyw)m(ord,)i(as)f(sho)
-m(wn)f(here,)h(alw)m(a)m(ys)h(b)s(e)e(included)e(in)h(an)m(y)i(HDU)0
-3636 y(that)i(uses)f(this)f(longstring)g(con)m(v)m(en)m(tion)j(as)f(a)f
-(w)m(arning)g(to)h(an)m(y)g(soft)m(w)m(are)g(that)g(m)m(ust)g(read)f
-(the)h(k)m(eyw)m(ords.)41 b(A)0 3749 y(routine)c(called)f(\014ts)p
-712 3749 28 4 v 33 w(write)p 948 3749 V 32 w(k)m(ey)p
-1113 3749 V 33 w(longw)m(arn)h(has)g(b)s(een)g(pro)m(vided)f(in)h
-(CFITSIO)e(to)k(write)d(this)h(k)m(eyw)m(ord)h(if)e(it)0
-3862 y(do)s(es)30 b(not)h(already)f(exist.)0 4022 y(This)f(long)h
-(string)f(con)m(v)m(en)m(tion)i(is)f(supp)s(orted)e(b)m(y)j(the)f
-(follo)m(wing)f(CFITSIO)g(routines:)191 4280 y Ff
-(fits_write_key_longstr)89 b(-)48 b(write)e(a)i(long)e(string)g
-(keyword)g(value)191 4393 y(fits_insert_key_longstr)41
-b(-)48 b(insert)e(a)h(long)g(string)f(keyword)g(value)191
-4506 y(fits_modify_key_longstr)41 b(-)48 b(modify)e(a)h(long)g(string)f
-(keyword)g(value)191 4619 y(fits_update_key_longstr)41
-b(-)48 b(modify)e(a)h(long)g(string)f(keyword)g(value)191
-4732 y(fits_read_key_longstr)137 b(-)48 b(read)94 b(a)48
-b(long)e(string)g(keyword)g(value)191 4844 y(fits_delete_key)425
-b(-)48 b(delete)e(a)h(keyword)0 5102 y Fj(The)36 b(\014ts)p
-320 5102 V 32 w(read)p 524 5102 V 33 w(k)m(ey)p 690 5102
-V 34 w(longstr)f(routine)h(is)f(unique)f(among)j(all)f(the)g(CFITSIO)f
-(routines)g(in)g(that)i(it)f(in)m(ternally)0 5215 y(allo)s(cates)e
-(memory)f(for)h(the)f(long)g(string)g(v)-5 b(alue;)35
-b(all)d(the)i(other)g(CFITSIO)e(routines)g(that)i(deal)f(with)g(arra)m
-(ys)0 5328 y(require)38 b(that)i(the)g(calling)e(program)h(pre-allo)s
-(cate)h(adequate)g(space)g(to)g(hold)e(the)i(arra)m(y)g(of)f(data.)69
-b(Conse-)0 5441 y(quen)m(tly)-8 b(,)30 b(programs)g(whic)m(h)f(use)h
-(the)g(\014ts)p 1443 5441 V 32 w(read)p 1647 5441 V 33
-w(k)m(ey)p 1813 5441 V 34 w(longstr)f(routine)g(m)m(ust)h(b)s(e)g
-(careful)f(to)i(free)g(the)f(allo)s(cated)0 5554 y(memory)g(for)g(the)h
-(string)e(when)h(it)g(is)f(no)h(longer)g(needed.)0 5714
-y(The)g(follo)m(wing)f(2)h(routines)g(also)g(ha)m(v)m(e)i(limited)c
-(supp)s(ort)g(for)i(this)g(long)g(string)f(con)m(v)m(en)m(tion,)p
+%%Page: 37 45
+37 44 bop 0 299 a Fh(5.4.)72 b(HEADER)31 b(KEYW)m(ORD)g(READ/WRITE)g(R)
+m(OUTINES)1495 b Fj(37)227 555 y(Selected)29 b(k)m(eyw)m(ords)f(ma)m(y)
+h(b)s(e)e(excluded)g(from)h(the)g(returned)f(c)m(haracter)j(string.)39
+b(If)27 b(the)i(second)f(param-)227 668 y(eter)h(\(no)s(commen)m(ts\))g
+(is)e(TR)m(UE)h(\(nonzero\))h(then)e(an)m(y)i(COMMENT,)f(HISTOR)-8
+b(Y,)27 b(or)h(blank)f(k)m(eyw)m(ords)227 781 y(in)i(the)i(header)f
+(will)e(not)i(b)s(e)g(copied)g(to)h(the)g(output)f(string.)227
+926 y(The)25 b('exclist')h(parameter)g(ma)m(y)g(b)s(e)f(used)g(to)h
+(supply)d(a)j(list)f(of)g(k)m(eyw)m(ords)h(that)h(are)f(to)g(b)s(e)f
+(excluded)f(from)227 1039 y(the)29 b(output)g(c)m(haracter)h(string.)40
+b(Wild)27 b(card)i(c)m(haracters)h(\(*,)g(?,)f(and)g(#\))g(ma)m(y)g(b)s
+(e)f(used)g(in)g(the)h(excluded)227 1152 y(k)m(eyw)m(ord)h(names.)41
+b(If)29 b(no)g(additional)f(k)m(eyw)m(ords)i(are)g(to)g(b)s(e)f
+(excluded,)g(then)g(set)h(nexc)g(=)f(0)h(and)f(sp)s(ecify)227
+1265 y(NULL)i(for)f(the)g(the)h(**header)g(parameter.)95
+1492 y Fe(int)47 b(fits_hdr2str)286 1605 y(\(fitsfile)f(*fptr,)g(int)h
+(nocomments,)d(char)j(**exclist,)e(int)i(nexc,)286 1718
+y(>)h(char)e(**header,)g(int)h(*nkeys,)e(int)i(*status\))0
+2004 y Fd(5.4.2)112 b(Keyw)m(ord)38 b(W)-9 b(riting)35
+b(Routines)0 2207 y Fi(1)81 b Fj(W)-8 b(rite)31 b(a)h(k)m(eyw)m(ord)g
+(of)f(the)h(appropriate)e(data)i(t)m(yp)s(e)g(in)m(to)f(the)h(CHU.)f
+(The)g(\014rst)g(routine)f(simply)f(app)s(ends)227 2320
+y(a)34 b(new)f(k)m(eyw)m(ord)h(whereas)f(the)g(second)h(routine)e(will)
+f(up)s(date)h(the)i(v)-5 b(alue)32 b(and)h(commen)m(t)h(\014elds)e(of)i
+(the)227 2433 y(k)m(eyw)m(ord)g(if)f(it)g(already)g(exists,)h
+(otherwise)f(it)g(app)s(ends)f(a)i(new)f(k)m(eyw)m(ord.)51
+b(Note)35 b(that)f(the)g(address)e(to)227 2546 y(the)37
+b(v)-5 b(alue,)37 b(and)e(not)i(the)f(v)-5 b(alue)35
+b(itself,)i(m)m(ust)f(b)s(e)f(en)m(tered.)59 b(The)35
+b(datat)m(yp)s(e)i(parameter)g(sp)s(eci\014es)e(the)227
+2659 y(data)40 b(t)m(yp)s(e)f(of)g(the)g(k)m(eyw)m(ord)g(v)-5
+b(alue)39 b(with)e(one)i(of)g(the)g(follo)m(wing)f(v)-5
+b(alues:)57 b(TSTRING,)38 b(TLOGICAL)227 2772 y(\(==)e(in)m(t\),)i
+(TBYTE,)f(TSHOR)-8 b(T,)35 b(TUSHOR)-8 b(T,)36 b(TINT,)g(TUINT,)g
+(TLONG,)g(TULONG,)g(TFLO)m(A)-8 b(T,)227 2885 y(TDOUBLE.)24
+b(Within)e(the)h(con)m(text)i(of)f(this)e(routine,)i(TSTRING)f(corresp)
+s(onds)f(to)i(a)g('c)m(har*')g(data)h(t)m(yp)s(e,)227
+2997 y(i.e.,)j(a)e(p)s(oin)m(ter)g(to)h(a)f(c)m(haracter)i(arra)m(y)-8
+b(.)40 b(A)27 b(n)m(ull)d(p)s(oin)m(ter)h(ma)m(y)i(b)s(e)f(en)m(tered)h
+(for)f(the)g(commen)m(t)h(parameter)227 3110 y(in)i(whic)m(h)g(case)j
+(the)e(k)m(eyw)m(ord)h(commen)m(t)h(\014eld)d(will)e(b)s(e)j(unmo)s
+(di\014ed)d(or)k(left)f(blank.)95 3338 y Fe(int)47 b(fits_write_key)d
+(/)k(ffpky)286 3451 y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(char)i
+(*keyname,)e(DTYPE)h(*value,)477 3564 y(char)h(*comment,)e(>)j(int)f
+(*status\))95 3789 y(int)g(fits_update_key)d(/)j(ffuky)286
+3902 y(\(fitsfile)f(*fptr,)g(int)h(datatype,)e(char)i(*keyname,)e
+(DTYPE)h(*value,)477 4015 y(char)h(*comment,)e(>)j(int)f(*status\))0
+4243 y Fi(2)81 b Fj(W)-8 b(rite)43 b(a)h(k)m(eyw)m(ord)f(with)f(a)i(n)m
+(ull)d(or)i(unde\014ned)e(v)-5 b(alue)42 b(\(i.e.,)47
+b(the)d(v)-5 b(alue)42 b(\014eld)g(in)g(the)h(k)m(eyw)m(ord)h(is)e
+(left)227 4356 y(blank\).)69 b(The)40 b(\014rst)f(routine)g(simply)f
+(app)s(ends)g(a)j(new)e(k)m(eyw)m(ord)i(whereas)f(the)g(second)g
+(routine)g(will)227 4469 y(up)s(date)27 b(the)h(v)-5
+b(alue)28 b(and)f(commen)m(t)i(\014elds)d(of)i(the)g(k)m(eyw)m(ord)g
+(if)f(it)g(already)h(exists,)g(otherwise)f(it)h(app)s(ends)227
+4581 y(a)h(new)g(k)m(eyw)m(ord.)40 b(A)29 b(n)m(ull)e(p)s(oin)m(ter)h
+(ma)m(y)h(b)s(e)g(en)m(tered)g(for)g(the)g(commen)m(t)g(parameter)h(in)
+d(whic)m(h)h(case)i(the)227 4694 y(k)m(eyw)m(ord)h(commen)m(t)h
+(\014eld)c(will)g(b)s(e)i(unmo)s(di\014ed)d(or)k(left)f(blank.)95
+4922 y Fe(int)47 b(fits_write_key_null)c(/)k(ffpkyu)286
+5035 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g(*comment,)g(>)h
+(int)g(*status\))95 5261 y(int)g(fits_update_key_null)c(/)k(ffukyu)286
+5374 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g(*comment,)g(>)h
+(int)g(*status\))0 5601 y Fi(3)81 b Fj(W)-8 b(rite)39
+b(\(app)s(end\))f(a)h(COMMENT)g(or)g(HISTOR)-8 b(Y)38
+b(k)m(eyw)m(ord)i(to)f(the)g(CHU.)h(The)e(commen)m(t)i(or)f(history)227
+5714 y(string)30 b(will)d(b)s(e)j(con)m(tin)m(ued)g(o)m(v)m(er)i(m)m
+(ultiple)c(k)m(eyw)m(ords)j(if)e(it)h(is)f(longer)h(than)g(70)i(c)m
+(haracters.)p eop
+%%Page: 38 46
+38 45 bop 0 299 a Fj(38)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
+555 y Fe(int)47 b(fits_write_comment)c(/)48 b(ffpcom)286
+668 y(\(fitsfile)e(*fptr,)g(char)g(*comment,)g(>)h(int)g(*status\))95
+894 y(int)g(fits_write_history)c(/)48 b(ffphis)286 1007
+y(\(fitsfile)e(*fptr,)g(char)g(*history,)g(>)h(int)g(*status\))0
+1269 y Fi(4)81 b Fj(W)-8 b(rite)28 b(the)h(D)m(A)-8 b(TE)29
+b(k)m(eyw)m(ord)g(to)g(the)g(CHU.)f(The)g(k)m(eyw)m(ord)h(v)-5
+b(alue)28 b(will)d(con)m(tain)k(the)g(curren)m(t)f(system)g(date)227
+1382 y(as)k(a)g(c)m(haracter)h(string)d(in)g('yyyy-mm-ddThh:mm:ss')f
+(format.)44 b(If)31 b(a)h(D)m(A)-8 b(TE)32 b(k)m(eyw)m(ord)g(already)f
+(exists)227 1495 y(in)c(the)g(header,)i(then)e(this)f(routine)h(will)e
+(simply)g(up)s(date)i(the)h(k)m(eyw)m(ord)g(v)-5 b(alue)27
+b(with)f(the)i(curren)m(t)g(date.)95 1757 y Fe(int)47
+b(fits_write_date)d(/)j(ffpdat)286 1870 y(\(fitsfile)f(*fptr,)g(>)h
+(int)g(*status\))0 2132 y Fi(5)81 b Fj(W)-8 b(rite)33
+b(a)h(user)f(sp)s(eci\014ed)f(k)m(eyw)m(ord)i(record)f(in)m(to)g(the)h
+(CHU.)g(This)d(is)i(a)h(lo)m(w{lev)m(el)f(routine)g(whic)m(h)f(can)i(b)
+s(e)227 2245 y(used)f(to)h(write)e(an)m(y)i(arbitrary)e(record)h(in)m
+(to)h(the)f(header.)50 b(The)32 b(record)i(m)m(ust)f(conform)g(to)h
+(the)g(all)e(the)227 2358 y(FITS)e(format)h(requiremen)m(ts.)95
+2620 y Fe(int)47 b(fits_write_record)c(/)48 b(ffprec)286
+2733 y(\(fitsfile)e(*fptr,)g(char)g(*card,)g(>)i(int)f(*status\))0
+2995 y Fi(6)81 b Fj(Up)s(date)34 b(an)g(80-c)m(haracter)j(record)e(in)e
+(the)h(CHU.)h(If)f(a)h(k)m(eyw)m(ord)f(with)g(the)g(input)f(name)h
+(already)g(exists,)227 3108 y(then)f(it)g(is)f(o)m(v)m(erwritten)h(b)m
+(y)g(the)g(v)-5 b(alue)33 b(of)g(card.)49 b(This)31 b(could)h(mo)s
+(dify)f(the)j(k)m(eyw)m(ord)f(name)g(as)h(w)m(ell)e(as)227
+3220 y(the)e(v)-5 b(alue)29 b(and)f(commen)m(t)j(\014elds.)39
+b(If)29 b(the)g(k)m(eyw)m(ord)h(do)s(esn't)f(already)g(exist)g(then)h
+(a)f(new)g(k)m(eyw)m(ord)h(card)227 3333 y(is)g(app)s(ended)e(to)j(the)
+g(header.)95 3595 y Fe(int)47 b(fits_update_card)d(/)j(ffucrd)286
+3708 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g(*card,)g(>)i
+(int)f(*status\))0 3970 y Fi(7)81 b Fj(Mo)s(dify)29 b(\(o)m(v)m
+(erwrite\))i(the)g(commen)m(t)g(\014eld)e(of)i(an)f(existing)f(k)m(eyw)
+m(ord.)95 4233 y Fe(int)47 b(fits_modify_comment)c(/)k(ffmcom)286
+4345 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g(*comment,)g(>)h
+(int)g(*status\))0 4608 y Fi(8)81 b Fj(W)-8 b(rite)32
+b(the)g(ph)m(ysical)f(units)g(string)g(in)m(to)h(an)g(existing)f(k)m
+(eyw)m(ord.)46 b(This)31 b(routine)g(uses)h(a)g(lo)s(cal)g(con)m(v)m
+(en)m(tion,)227 4720 y(sho)m(wn)g(in)f(the)i(follo)m(wing)e(example,)i
+(in)e(whic)m(h)g(the)i(k)m(eyw)m(ord)g(units)e(are)i(enclosed)f(in)f
+(square)h(brac)m(k)m(ets)227 4833 y(in)d(the)i(b)s(eginning)d(of)i(the)
+h(k)m(eyw)m(ord)g(commen)m(t)g(\014eld.)239 5095 y Fe(VELOCITY=)809
+b(12.3)46 b(/)i([km/s])e(orbital)g(speed)95 5321 y(int)h
+(fits_write_key_unit)c(/)k(ffpunt)286 5434 y(\(fitsfile)f(*fptr,)g
+(char)g(*keyname,)g(char)g(*unit,)g(>)i(int)f(*status\))0
+5696 y Fi(9)81 b Fj(Rename)30 b(an)h(existing)e(k)m(eyw)m(ord,)i
+(preserving)e(the)h(curren)m(t)h(v)-5 b(alue)29 b(and)h(commen)m(t)i
+(\014elds.)p eop
+%%Page: 39 47
+39 46 bop 0 299 a Fh(5.5.)72 b(PRIMAR)-8 b(Y)31 b(ARRA)-8
+b(Y)31 b(OR)f(IMA)m(GE)h(EXTENSION)f(I/O)g(R)m(OUTINES)1011
+b Fj(39)95 555 y Fe(int)47 b(fits_modify_name)d(/)j(ffmnam)286
+668 y(\(fitsfile)f(*fptr,)g(char)g(*oldname,)g(char)g(*newname,)g(>)h
+(int)g(*status\))0 920 y Fi(10)f Fj(Delete)36 b(a)f(k)m(eyw)m(ord)g
+(record.)54 b(The)34 b(space)i(o)s(ccupied)d(b)m(y)i(the)g(k)m(eyw)m
+(ord)g(is)f(reclaimed)g(b)m(y)g(mo)m(ving)h(all)f(the)227
+1033 y(follo)m(wing)d(header)i(records)f(up)g(one)h(ro)m(w)f(in)g(the)g
+(header.)48 b(The)32 b(\014rst)g(routine)f(deletes)i(a)g(k)m(eyw)m(ord)
+g(at)h(a)227 1146 y(sp)s(eci\014ed)22 b(p)s(osition)g(in)h(the)h
+(header)f(\(the)i(\014rst)e(k)m(eyw)m(ord)h(is)f(at)h(p)s(osition)e
+(1\),)k(whereas)e(the)g(second)g(routine)227 1259 y(deletes)29
+b(a)g(sp)s(eci\014cally)d(named)i(k)m(eyw)m(ord.)41 b(Wild)27
+b(card)h(c)m(haracters)i(ma)m(y)f(b)s(e)f(used)g(when)f(sp)s(ecifying)g
+(the)227 1372 y(name)k(of)f(the)h(k)m(eyw)m(ord)g(to)g(b)s(e)e
+(deleted.)95 1623 y Fe(int)47 b(fits_delete_record)c(/)48
+b(ffdrec)286 1736 y(\(fitsfile)e(*fptr,)g(int)142 b(keynum,)94
+b(>)47 b(int)g(*status\))95 1962 y(int)g(fits_delete_key)d(/)j(ffdkey)
+286 2075 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(>)h(int)g
+(*status\))0 2408 y Ff(5.5)135 b(Primary)46 b(Arra)l(y)f(or)g(IMA)l(GE)
+f(Extension)i(I/O)f(Routines)0 2658 y Fj(These)22 b(routines)f(read)i
+(or)f(write)g(data)h(v)-5 b(alues)22 b(in)f(the)h(primary)f(data)i
+(arra)m(y)g(\(i.e.,)i(the)d(\014rst)g(HDU)h(in)e(a)i(FITS)e(\014le\))0
+2771 y(or)32 b(an)g(IMA)m(GE)h(extension.)46 b(There)31
+b(are)i(also)f(routines)f(to)i(get)g(information)d(ab)s(out)i(the)g
+(data)h(t)m(yp)s(e)g(and)e(size)0 2884 y(of)c(the)g(image.)40
+b(Users)27 b(should)e(also)i(read)g(the)g(follo)m(wing)e(c)m(hapter)j
+(on)f(the)g(CFITSIO)e(iterator)j(function)d(whic)m(h)0
+2996 y(pro)m(vides)32 b(a)i(more)f(`ob)5 b(ject)35 b(orien)m(ted')e
+(metho)s(d)g(of)g(reading)f(and)h(writing)e(images.)50
+b(The)32 b(iterator)i(function)e(is)0 3109 y(a)f(little)f(more)h
+(complicated)f(to)i(use,)f(but)f(the)h(adv)-5 b(an)m(tages)32
+b(are)f(that)h(it)e(usually)f(tak)m(es)j(less)e(co)s(de)h(to)g(p)s
+(erform)0 3222 y(the)j(same)h(op)s(eration,)f(and)f(the)i(resulting)d
+(program)h(oftens)i(runs)d(faster)i(b)s(ecause)g(the)h(FITS)e(\014les)g
+(are)h(read)0 3335 y(and)c(written)f(using)g(the)i(most)f(e\016cien)m
+(t)h(blo)s(c)m(k)f(size.)0 3495 y(C)25 b(programmers)h(should)e(note)i
+(that)g(the)h(ordering)d(of)i(arra)m(ys)g(in)f(FITS)g(\014les,)h(and)f
+(hence)h(in)f(all)f(the)i(CFITSIO)0 3608 y(calls,)38
+b(is)e(more)h(similar)e(to)i(the)h(dimensionalit)m(y)c(of)j(arra)m(ys)g
+(in)f(F)-8 b(ortran)38 b(rather)f(than)f(C.)h(F)-8 b(or)38
+b(instance)f(if)f(a)0 3721 y(FITS)28 b(image)h(has)f(NAXIS1)h(=)f(100)i
+(and)e(NAXIS2)h(=)f(50,)i(then)e(a)h(2-D)h(arra)m(y)f(just)f(large)h
+(enough)f(to)i(hold)d(the)0 3834 y(image)k(should)d(b)s(e)i(declared)g
+(as)g(arra)m(y[50][100])k(and)c(not)h(as)f(arra)m(y[100][50].)0
+3994 y(The)h(`datat)m(yp)s(e')h(parameter)g(sp)s(eci\014es)d(the)j
+(data)g(t)m(yp)s(e)f(of)g(the)g(`n)m(ulv)-5 b(al')30
+b(and)h(`arra)m(y')h(p)s(oin)m(ters)e(and)g(can)i(ha)m(v)m(e)0
+4107 y(one)h(of)g(the)g(follo)m(wing)e(v)-5 b(alues:)45
+b(TBYTE,)33 b(TSBYTE,)f(TSHOR)-8 b(T,)32 b(TUSHOR)-8
+b(T,)32 b(TINT,)h(TUINT,)f(TLONG,)0 4220 y(TLONGLONG,)26
+b(TULONG,)g(TFLO)m(A)-8 b(T,)27 b(TDOUBLE.)f(Automatic)h(data)g(t)m(yp)
+s(e)g(con)m(v)m(ersion)f(is)f(p)s(erformed)g(if)0 4333
+y(the)j(data)h(t)m(yp)s(e)f(of)f(the)i(FITS)e(arra)m(y)h(\(as)g
+(de\014ned)f(b)m(y)h(the)g(BITPIX)f(k)m(eyw)m(ord\))i(di\013ers)d(from)
+i(that)g(sp)s(eci\014ed)e(b)m(y)0 4446 y('datat)m(yp)s(e'.)54
+b(The)34 b(data)h(v)-5 b(alues)34 b(are)g(also)h(automatically)f
+(scaled)g(b)m(y)g(the)h(BSCALE)f(and)f(BZER)m(O)h(k)m(eyw)m(ord)0
+4559 y(v)-5 b(alues)30 b(as)g(they)h(are)g(b)s(eing)e(read)h(or)g
+(written)g(in)f(the)h(FITS)g(arra)m(y)-8 b(.)0 4811 y
+Fi(1)81 b Fj(Get)39 b(the)f(data)h(t)m(yp)s(e)f(or)g(equiv)-5
+b(alen)m(t)37 b(data)i(t)m(yp)s(e)f(of)g(the)h(image.)64
+b(The)37 b(\014rst)g(routine)g(returns)g(the)h(ph)m(ys-)227
+4924 y(ical)j(data)g(t)m(yp)s(e)h(of)f(the)g(FITS)f(image,)k(as)e(giv)m
+(en)f(b)m(y)g(the)g(BITPIX)g(k)m(eyw)m(ord,)j(with)c(allo)m(w)m(ed)h(v)
+-5 b(alues)227 5036 y(of)44 b(BYTE)p 609 5036 28 4 v
+33 w(IMG)g(\(8\),)k(SHOR)-8 b(T)p 1376 5036 V 32 w(IMG)44
+b(\(16\),)49 b(LONG)p 2140 5036 V 33 w(IMG)44 b(\(32\),)49
+b(FLO)m(A)-8 b(T)p 2948 5036 V 33 w(IMG)44 b(\(-32\),)49
+b(and)43 b(DOU-)227 5149 y(BLE)p 415 5149 V 33 w(IMG)f(\(-64\).)75
+b(The)40 b(second)i(routine)e(is)g(similar,)i(except)g(that)g(if)e(the)
+h(image)h(pixel)d(v)-5 b(alues)41 b(are)227 5262 y(scaled,)28
+b(with)f(non-default)f(v)-5 b(alues)27 b(for)g(the)h(BZER)m(O)f(and)g
+(BSCALE)g(k)m(eyw)m(ords,)h(then)f(the)h(routine)f(will)227
+5375 y(return)35 b(the)h('equiv)-5 b(alen)m(t')35 b(data)h(t)m(yp)s(e)g
+(that)g(is)f(needed)g(to)i(store)f(the)g(scaled)f(v)-5
+b(alues.)56 b(F)-8 b(or)36 b(example,)h(if)227 5488 y(BITPIX)27
+b(=)f(16)i(and)e(BSCALE)h(=)f(0.1)i(then)f(the)g(equiv)-5
+b(alen)m(t)26 b(data)i(t)m(yp)s(e)f(is)f(FLO)m(A)-8 b(T)p
+3196 5488 V 33 w(IMG.)28 b(Similarly)23 b(if)227 5601
+y(BITPIX)28 b(=)g(16,)i(BSCALE)d(=)h(1,)h(and)f(BZER)m(O)g(=)g(32768,)j
+(then)d(the)g(the)h(pixel)d(v)-5 b(alues)28 b(span)f(the)i(range)227
+5714 y(of)i(an)f(unsigned)e(short)i(in)m(teger)h(and)f(the)h(returned)e
+(data)i(t)m(yp)s(e)f(will)e(b)s(e)i(USHOR)-8 b(T)p 3168
+5714 V 32 w(IMG.)p eop
+%%Page: 40 48
+40 47 bop 0 299 a Fj(40)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
+555 y Fe(int)47 b(fits_get_img_type)c(/)48 b(ffgidt)286
+668 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*bitpix,)f(int)h(*status\))95
+894 y(int)g(fits_get_img_equivtype)42 b(/)48 b(ffgiet)286
+1007 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*bitpix,)f(int)h(*status\))0
+1244 y Fi(2)81 b Fj(Get)34 b(the)g(n)m(um)m(b)s(er)e(of)i(dimensions,)e
+(and/or)i(the)g(size)f(of)h(eac)m(h)h(dimension)c(in)h(the)i(image)g(.)
+50 b(The)33 b(n)m(um)m(b)s(er)227 1357 y(of)h(axes)f(in)f(the)h(image)h
+(is)e(giv)m(en)h(b)m(y)g(naxis,)g(and)g(the)g(size)g(of)g(eac)m(h)i
+(dimension)30 b(is)i(giv)m(en)h(b)m(y)g(the)h(naxes)227
+1470 y(arra)m(y)d(\(a)g(maxim)m(um)f(of)g(maxdim)f(dimensions)f(will)f
+(b)s(e)j(returned\).)95 1707 y Fe(int)47 b(fits_get_img_dim)d(/)j
+(ffgidm)286 1819 y(\(fitsfile)f(*fptr,)g(>)h(int)g(*naxis,)f(int)h
+(*status\))95 2045 y(int)g(fits_get_img_size)c(/)48 b(ffgisz)286
+2158 y(\(fitsfile)e(*fptr,)g(int)h(maxdim,)e(>)j(long)f(*naxes,)e(int)i
+(*status\))95 2384 y(int)g(fits_get_img_param)c(/)48
+b(ffgipr)286 2497 y(\(fitsfile)e(*fptr,)g(int)h(maxdim,)e(>)j(int)f
+(*bitpix,)e(int)i(*naxis,)f(long)h(*naxes,)334 2610 y(int)g(*status\))0
+2847 y Fi(3)81 b Fj(Create)23 b(a)f(new)g(primary)e(arra)m(y)j(or)f
+(IMA)m(GE)i(extension)d(with)g(a)i(sp)s(eci\014ed)e(data)i(t)m(yp)s(e)f
+(and)g(size.)37 b(If)22 b(the)h(FITS)227 2960 y(\014le)29
+b(is)g(curren)m(tly)f(empt)m(y)i(then)g(a)g(primary)e(arra)m(y)i(is)f
+(created,)i(otherwise)e(a)h(new)f(IMA)m(GE)i(extension)e(is)227
+3073 y(app)s(ended)g(to)i(the)g(\014le.)95 3309 y Fe(int)47
+b(fits_create_img)d(/)j(ffcrim)286 3422 y(\()h(fitsfile)d(*fptr,)h(int)
+h(bitpix,)f(int)h(naxis,)f(long)h(*naxes,)f(>)h(int)g(*status\))0
+3659 y Fi(4)81 b Fj(W)-8 b(rite)39 b(a)g(rectangular)f(subimage)g(\(or)
+h(the)g(whole)f(image\))h(to)g(the)g(FITS)f(data)h(arra)m(y)-8
+b(.)67 b(The)38 b(fpixel)f(and)227 3772 y(lpixel)27 b(arra)m(ys)j(giv)m
+(e)g(the)g(co)s(ordinates)f(of)g(the)h(\014rst)f(\(lo)m(w)m(er)h(left)f
+(corner\))h(and)f(last)g(\(upp)s(er)f(righ)m(t)h(corner\))227
+3885 y(pixels)g(in)g(FITS)h(image)g(to)h(b)s(e)f(written)f(to.)95
+4122 y Fe(int)47 b(fits_write_subset)c(/)48 b(ffpss)286
+4235 y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(long)i(*fpixel,)e(long)i
+(*lpixel,)334 4348 y(DTYPE)f(*array,)g(>)i(int)f(*status\))0
+4585 y Fi(5)81 b Fj(W)-8 b(rite)38 b(pixels)f(in)m(to)h(the)h(FITS)f
+(data)h(arra)m(y)-8 b(.)66 b('fpixel')37 b(is)g(an)h(arra)m(y)h(of)g
+(length)f(NAXIS)g(whic)m(h)f(giv)m(es)i(the)227 4698
+y(co)s(ordinate)k(of)g(the)g(starting)f(pixel)f(to)j(b)s(e)e(written)g
+(to,)k(suc)m(h)d(that)g(fpixel[0])f(is)g(in)f(the)i(range)g(1)g(to)227
+4811 y(NAXIS1,)30 b(fpixel[1])d(is)g(in)g(the)i(range)g(1)f(to)h
+(NAXIS2,)h(etc.)41 b(The)28 b(\014rst)f(routine)h(simply)d(writes)j
+(the)g(arra)m(y)227 4924 y(of)e(pixels)d(to)j(the)g(FITS)f(\014le)f
+(\(doing)h(data)h(t)m(yp)s(e)g(con)m(v)m(ersion)f(if)g(necessary\))h
+(whereas)f(the)g(second)h(routine)227 5036 y(will)f(substitute)i(the)h
+(appropriate)f(FITS)g(n)m(ull)f(v)-5 b(alue)27 b(for)h(an)m(y)g(elemen)
+m(ts)g(whic)m(h)f(are)h(equal)f(to)i(the)f(input)227
+5149 y(v)-5 b(alue)25 b(of)h(n)m(ulv)-5 b(al)23 b(\(note)j(that)g(this)
+f(parameter)g(giv)m(es)h(the)g(address)e(of)h(the)h(n)m(ull)d(v)-5
+b(alue,)26 b(not)g(the)f(n)m(ull)e(v)-5 b(alue)227 5262
+y(itself)7 b(\).)45 b(F)-8 b(or)33 b(in)m(teger)f(FITS)f(arra)m(ys,)i
+(the)g(FITS)e(n)m(ull)f(v)-5 b(alue)31 b(is)g(de\014ned)g(b)m(y)h(the)g
+(BLANK)g(k)m(eyw)m(ord)h(\(an)227 5375 y(error)h(is)f(returned)h(if)f
+(the)h(BLANK)h(k)m(eyw)m(ord)f(do)s(esn't)h(exist\).)52
+b(F)-8 b(or)35 b(\015oating)f(p)s(oin)m(t)g(FITS)f(arra)m(ys)i(the)227
+5488 y(sp)s(ecial)29 b(IEEE)h(NaN)h(\(Not-a-Num)m(b)s(er\))h(v)-5
+b(alue)30 b(will)e(b)s(e)h(written)h(in)m(to)g(the)h(FITS)e(\014le.)40
+b(If)30 b(a)h(n)m(ull)d(p)s(oin)m(ter)227 5601 y(is)40
+b(en)m(tered)h(for)f(n)m(ulv)-5 b(al,)42 b(then)e(the)g(n)m(ull)f(v)-5
+b(alue)40 b(is)f(ignored)h(and)f(this)h(routine)f(b)s(eha)m(v)m(es)i
+(the)g(same)g(as)227 5714 y(\014ts)p 354 5714 28 4 v
+33 w(write)p 590 5714 V 32 w(pix.)p eop
+%%Page: 41 49
+41 48 bop 0 299 a Fh(5.5.)72 b(PRIMAR)-8 b(Y)31 b(ARRA)-8
+b(Y)31 b(OR)f(IMA)m(GE)h(EXTENSION)f(I/O)g(R)m(OUTINES)1011
+b Fj(41)95 555 y Fe(int)47 b(fits_write_pix)d(/)k(ffppx)286
+668 y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(long)i(*fpixel,)e(long)i
+(nelements,)334 781 y(DTYPE)f(*array,)g(int)h(*status\);)95
+1007 y(int)g(fits_write_pixnull)c(/)48 b(ffppxn)286 1120
+y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(long)i(*fpixel,)e(long)i
+(nelements,)334 1233 y(DTYPE)f(*array,)g(DTYPE)h(*nulval,)e(>)j(int)f
+(*status\);)0 1444 y Fi(6)81 b Fj(Set)24 b(FITS)g(data)i(arra)m(y)f
+(elemen)m(ts)g(equal)f(to)h(the)g(appropriate)e(n)m(ull)g(pixel)g(v)-5
+b(alue.)38 b(F)-8 b(or)25 b(in)m(teger)g(FITS)f(arra)m(ys,)227
+1557 y(the)34 b(FITS)e(n)m(ull)f(v)-5 b(alue)33 b(is)f(de\014ned)g(b)m
+(y)h(the)h(BLANK)f(k)m(eyw)m(ord)h(\(an)f(error)g(is)f(returned)g(if)g
+(the)i(BLANK)227 1670 y(k)m(eyw)m(ord)23 b(do)s(esn't)g(exist\).)38
+b(F)-8 b(or)23 b(\015oating)f(p)s(oin)m(t)g(FITS)g(arra)m(ys)g(the)h
+(sp)s(ecial)e(IEEE)h(NaN)h(\(Not-a-Num)m(b)s(er\))227
+1783 y(v)-5 b(alue)33 b(will)d(b)s(e)j(written)f(in)m(to)h(the)h(FITS)e
+(\014le.)48 b(Note)34 b(that)g('\014rstelem')f(is)f(a)i(scalar)f
+(giving)f(the)h(o\013set)h(to)227 1896 y(the)d(\014rst)e(pixel)g(to)i
+(b)s(e)f(written)f(in)h(the)g(equiv)-5 b(alen)m(t)30
+b(1-dimensional)e(arra)m(y)j(of)g(image)f(pixels.)95
+2108 y Fe(int)47 b(fits_write_null_img)c(/)k(ffpprn)286
+2221 y(\(fitsfile)f(*fptr,)g(long)g(firstelem,)f(long)i(nelements,)e(>)
+i(int)g(*status\))0 2432 y Fi(7)81 b Fj(Read)33 b(a)h(rectangular)g
+(subimage)f(\(or)h(the)g(whole)f(image\))h(from)f(the)h(FITS)f(data)h
+(arra)m(y)-8 b(.)52 b(The)33 b(fpixel)f(and)227 2545
+y(lpixel)27 b(arra)m(ys)j(giv)m(e)g(the)g(co)s(ordinates)f(of)g(the)h
+(\014rst)f(\(lo)m(w)m(er)h(left)f(corner\))h(and)f(last)g(\(upp)s(er)f
+(righ)m(t)h(corner\))227 2658 y(pixels)c(to)j(b)s(e)e(read)h(from)g
+(the)g(FITS)f(image.)40 b(Unde\014ned)25 b(FITS)h(arra)m(y)i(elemen)m
+(ts)f(will)d(b)s(e)i(returned)g(with)227 2771 y(a)k(v)-5
+b(alue)29 b(=)f(*n)m(ullv)-5 b(al,)28 b(\(note)i(that)g(this)e
+(parameter)i(giv)m(es)f(the)h(address)e(of)h(the)h(n)m(ull)d(v)-5
+b(alue,)29 b(not)h(the)f(n)m(ull)227 2884 y(v)-5 b(alue)35
+b(itself)7 b(\))35 b(unless)f(n)m(ulv)-5 b(al)34 b(=)i(0)g(or)f(*n)m
+(ulv)-5 b(al)35 b(=)g(0,)j(in)c(whic)m(h)g(case)j(no)f(c)m(hec)m(ks)h
+(for)e(unde\014ned)f(pixels)227 2997 y(will)28 b(b)s(e)i(p)s(erformed.)
+95 3209 y Fe(int)47 b(fits_read_subset)d(/)j(ffgsv)286
+3321 y(\(fitsfile)f(*fptr,)g(int)94 b(datatype,)46 b(long)g(*fpixel,)g
+(long)g(*lpixel,)g(long)h(*inc,)334 3434 y(DTYPE)f(*nulval,)g(>)h
+(DTYPE)g(*array,)f(int)h(*anynul,)e(int)i(*status\))0
+3646 y Fi(8)81 b Fj(Read)32 b(pixels)f(from)h(the)g(FITS)g(data)h(arra)
+m(y)-8 b(.)48 b('fpixel')31 b(is)h(the)g(starting)g(pixel)f(lo)s
+(cation)h(and)g(is)g(an)g(arra)m(y)h(of)227 3759 y(length)g(NAXIS)g
+(suc)m(h)g(that)h(fpixel[0])e(is)g(in)g(the)i(range)f(1)h(to)g(NAXIS1,)
+g(fpixel[1])e(is)h(in)f(the)h(range)h(1)f(to)227 3872
+y(NAXIS2,)c(etc.)41 b(The)28 b(nelemen)m(ts)g(parameter)g(sp)s
+(eci\014es)f(the)h(n)m(um)m(b)s(er)f(of)h(pixels)f(to)i(read.)39
+b(If)28 b(fpixel)e(is)h(set)227 3985 y(to)36 b(the)f(\014rst)f(pixel,)h
+(and)g(nelemen)m(ts)f(is)g(set)i(equal)f(to)g(the)g(NAXIS1)h(v)-5
+b(alue,)36 b(then)e(this)g(routine)g(w)m(ould)227 4098
+y(read)28 b(the)g(\014rst)f(ro)m(w)h(of)g(the)h(image.)40
+b(Alternativ)m(ely)-8 b(,)28 b(if)f(nelemen)m(ts)h(is)f(set)h(equal)g
+(to)g(NAXIS1)g(*)h(NAXIS2)227 4211 y(then)h(it)g(w)m(ould)f(read)i(an)f
+(en)m(tire)g(2D)h(image,)g(or)g(the)f(\014rst)g(plane)f(of)i(a)g(3-D)g
+(datacub)s(e.)227 4353 y(The)39 b(\014rst)f(routine)g(will)f(return)g
+(an)m(y)j(unde\014ned)d(pixels)g(in)h(the)h(FITS)f(arra)m(y)i(equal)e
+(to)i(the)f(v)-5 b(alue)39 b(of)227 4466 y(*n)m(ullv)-5
+b(al)41 b(\(note)i(that)g(this)e(parameter)i(giv)m(es)g(the)f(address)g
+(of)g(the)h(n)m(ull)d(v)-5 b(alue,)45 b(not)e(the)f(n)m(ull)e(v)-5
+b(alue)227 4579 y(itself)7 b(\))39 b(unless)f(n)m(ulv)-5
+b(al)37 b(=)i(0)h(or)f(*n)m(ulv)-5 b(al)38 b(=)h(0,)j(in)c(whic)m(h)g
+(case)j(no)e(c)m(hec)m(ks)i(for)e(unde\014ned)e(pixels)h(will)227
+4692 y(b)s(e)c(p)s(erformed.)51 b(The)34 b(second)g(routine)g(is)f
+(similar)f(except)j(that)g(an)m(y)g(unde\014ned)d(pixels)g(will)g(ha)m
+(v)m(e)k(the)227 4805 y(corresp)s(onding)29 b(n)m(ullarra)m(y)f(elemen)
+m(t)j(set)g(equal)f(to)h(TR)m(UE)g(\(=)f(1\).)95 5016
+y Fe(int)47 b(fits_read_pix)e(/)i(ffgpxv)286 5129 y(\(fitsfile)f
+(*fptr,)g(int)94 b(datatype,)46 b(long)g(*fpixel,)g(long)g(nelements,)
+334 5242 y(DTYPE)g(*nulval,)g(>)h(DTYPE)g(*array,)f(int)h(*anynul,)e
+(int)i(*status\))95 5468 y(int)g(fits_read_pixnull)c(/)48
+b(ffgpxf)286 5581 y(\(fitsfile)e(*fptr,)g(int)94 b(datatype,)46
+b(long)g(*fpixel,)g(long)g(nelements,)334 5694 y(>)i(DTYPE)e(*array,)g
+(char)g(*nullarray,)f(int)i(*anynul,)f(int)g(*status\))p
 eop
-%%Page: 54 60
-54 59 bop 0 299 a Fj(54)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)286 555
-y Ff(fits_modify_key_str)43 b(-)k(modify)f(an)i(existing)d(string)h
-(keyword)g(value)286 668 y(fits_update_key_str)d(-)k(update)f(a)i
-(string)e(keyword)g(value)0 918 y Fj(in)23 b(that)i(they)f(will)e
-(correctly)i(o)m(v)m(erwrite)h(an)f(existing)f(long)h(string)f(v)-5
-b(alue,)26 b(but)d(the)h(new)g(string)f(v)-5 b(alue)24
-b(is)f(limited)0 1031 y(to)31 b(a)g(maxim)m(um)e(of)i(68)g(c)m
-(haracters)h(in)d(length.)0 1191 y(The)g(more)h(commonly)g(used)f
-(CFITSIO)f(routines)h(to)h(write)f(string)g(v)-5 b(alued)29
-b(k)m(eyw)m(ords)h(\(\014ts)p 3254 1191 28 4 v 33 w(up)s(date)p
-3563 1191 V 32 w(k)m(ey)h(and)0 1304 y(\014ts)p 127 1304
-V 32 w(write)p 362 1304 V 32 w(k)m(ey\))j(do)e(not)h(supp)s(ort)d(this)
-h(long)h(string)g(con)m(v)m(en)m(tion)h(and)f(only)f(supp)s(ort)g
-(strings)g(up)g(to)i(68)g(c)m(har-)0 1417 y(acters)g(in)e(length.)47
-b(This)30 b(has)i(b)s(een)g(done)g(delib)s(erately)e(to)j(prev)m(en)m
-(t)g(programs)f(from)g(inadv)m(erten)m(tly)g(writing)0
-1530 y(k)m(eyw)m(ords)25 b(using)e(this)h(non-standard)f(con)m(v)m(en)m
-(tion)j(without)e(the)h(explicit)e(in)m(ten)m(t)i(of)g(the)f
-(programmer)h(or)f(user.)0 1643 y(The)36 b(\014ts)p 320
-1643 V 32 w(write)p 555 1643 V 32 w(k)m(ey)p 720 1643
-V 34 w(longstr)g(routine)f(m)m(ust)i(b)s(e)f(called)g(instead)f(to)j
-(write)d(long)h(strings.)58 b(This)35 b(routine)h(can)0
-1756 y(also)30 b(b)s(e)g(used)g(to)h(write)e(ordinary)g(string)g(v)-5
-b(alues)30 b(less)g(than)g(68)h(c)m(haracters)h(in)d(length.)0
-2045 y Fd(5.14.2)113 b(Arra)m(ys)37 b(of)g(Fixed-Length)i(Strings)e(in)
-f(Binary)h(T)-9 b(ables)0 2264 y Fj(The)29 b(de\014nition)e(of)j(the)f
-(FITS)g(binary)e(table)j(extension)f(format)g(do)s(es)h(not)f(pro)m
-(vide)g(a)g(simple)f(w)m(a)m(y)i(to)g(sp)s(ecify)0 2377
-y(that)24 b(a)f(c)m(haracter)i(column)d(con)m(tains)h(an)g(arra)m(y)h
-(of)f(\014xed-length)f(strings.)37 b(T)-8 b(o)24 b(supp)s(ort)d(this)h
-(feature,)j(CFITSIO)0 2490 y(uses)31 b(a)h(lo)s(cal)f(con)m(v)m(en)m
-(tion)h(for)f(the)h(format)g(of)g(the)f(TF)m(ORMn)g(k)m(eyw)m(ord)h(v)
--5 b(alue)31 b(of)h(the)g(form)f('rAw')g(where)g('r')0
-2603 y(is)c(an)g(in)m(teger)h(sp)s(ecifying)d(the)j(total)g(width)e(in)
-g(c)m(haracters)j(of)f(the)g(column,)f(and)g('w')g(is)g(an)g(in)m
-(teger)h(sp)s(ecifying)0 2716 y(the)c(\(\014xed\))g(length)g(of)g(an)g
-(individual)19 b(unit)k(string)g(within)e(the)j(v)m(ector.)41
-b(F)-8 b(or)24 b(example,)i(TF)m(ORM1)e(=)g('120A10')0
-2829 y(w)m(ould)k(indicate)g(that)h(the)h(binary)d(table)i(column)f(is)
-g(120)i(c)m(haracters)g(wide)e(and)h(consists)f(of)h(12)h(10-c)m
-(haracter)0 2942 y(length)c(strings.)38 b(This)24 b(con)m(v)m(en)m
-(tion)k(is)d(recognized)i(b)m(y)f(the)g(CFITSIO)f(routines)g(that)i
-(read)f(or)h(write)e(strings)g(in)0 3054 y(binary)30
-b(tables.)44 b(The)31 b(Binary)g(T)-8 b(able)31 b(de\014nition)e(do)s
-(cumen)m(t)i(sp)s(eci\014es)g(that)h(other)g(optional)e(c)m(haracters)j
-(ma)m(y)0 3167 y(follo)m(w)h(the)h(datat)m(yp)s(e)h(co)s(de)f(in)e(the)
-i(TF)m(ORM)g(k)m(eyw)m(ord,)i(so)e(this)f(lo)s(cal)g(con)m(v)m(en)m
-(tion)i(is)e(in)f(compliance)h(with)0 3280 y(the)d(FITS)e(standard)h
-(although)g(other)g(FITS)g(readers)g(ma)m(y)h(not)g(recognize)g(this)e
-(con)m(v)m(en)m(tion.)0 3440 y(The)c(Binary)g(T)-8 b(able)26
-b(de\014nition)d(do)s(cumen)m(t)j(that)h(w)m(as)f(appro)m(v)m(ed)g(b)m
-(y)g(the)g(IA)m(U)g(in)f(1994)j(con)m(tains)e(an)f(app)s(endix)0
-3553 y(describing)20 b(an)j(alternate)g(con)m(v)m(en)m(tion)h(for)f(sp)
-s(ecifying)d(arra)m(ys)j(of)g(\014xed)f(or)h(v)-5 b(ariable)22
-b(length)g(strings)f(in)h(a)h(binary)0 3666 y(table)34
-b(c)m(haracter)h(column)e(\(with)g(the)i(form)e('rA:SSTRw/nnn\)'.)50
-b(This)32 b(app)s(endix)f(w)m(as)k(not)f(o\016cially)f(v)m(oted)0
-3779 y(on)d(b)m(y)h(the)f(IA)m(U)h(and)f(hence)g(is)g(still)e(pro)m
-(visional.)39 b(CFITSIO)29 b(do)s(es)h(not)g(curren)m(tly)g(supp)s(ort)
-e(this)i(prop)s(osal.)0 4068 y Fd(5.14.3)113 b(Keyw)m(ord)37
-b(Units)g(Strings)0 4287 y Fj(One)g(de\014ciency)g(of)h(the)g(curren)m
-(t)g(FITS)f(Standard)f(is)h(that)i(it)e(do)s(es)g(not)h(de\014ne)f(a)i
-(sp)s(eci\014c)d(con)m(v)m(en)m(tion)j(for)0 4400 y(recording)29
-b(the)h(ph)m(ysical)f(units)g(of)h(a)g(k)m(eyw)m(ord)h(v)-5
-b(alue.)40 b(The)30 b(TUNITn)f(k)m(eyw)m(ord)h(can)g(b)s(e)g(used)f(to)
-i(sp)s(ecify)e(the)0 4513 y(ph)m(ysical)34 b(units)g(of)h(the)h(v)-5
-b(alues)35 b(in)f(a)h(table)h(column,)f(but)g(there)g(is)g(no)g
-(analogous)h(con)m(v)m(en)m(tion)g(for)f(k)m(eyw)m(ord)0
-4626 y(v)-5 b(alues.)41 b(The)30 b(commen)m(t)h(\014eld)f(of)g(the)h(k)
-m(eyw)m(ord)g(is)f(often)h(used)f(for)g(this)f(purp)s(ose,)h(but)f(the)
-i(units)e(are)i(usually)0 4739 y(not)g(sp)s(eci\014ed)d(in)h(a)i(w)m
-(ell)e(de\014ned)h(format)g(that)h(FITS)f(readers)g(can)h(easily)e
-(recognize)i(and)f(extract.)0 4899 y(T)-8 b(o)24 b(solv)m(e)g(this)e
-(de\014ciency)-8 b(,)25 b(CFITSIO)d(uses)h(a)g(lo)s(cal)g(con)m(v)m(en)
-m(tion)i(in)d(whic)m(h)g(the)i(k)m(eyw)m(ord)f(units)f(are)i(enclosed)f
-(in)0 5012 y(square)d(brac)m(k)m(ets)j(as)e(the)f(\014rst)g(tok)m(en)i
-(in)e(the)g(k)m(eyw)m(ord)i(commen)m(t)f(\014eld;)i(more)e(sp)s
-(eci\014cally)-8 b(,)21 b(the)g(op)s(ening)e(square)0
-5125 y(brac)m(k)m(et)28 b(immediately)d(follo)m(ws)g(the)i(slash)e('/')
-i(commen)m(t)h(\014eld)d(delimiter)f(and)i(a)g(single)f(space)i(c)m
-(haracter.)41 b(The)0 5238 y(follo)m(wing)29 b(examples)h(illustrate)e
-(k)m(eyw)m(ords)j(that)g(use)f(this)f(con)m(v)m(en)m(tion:)0
-5488 y Ff(EXPOSURE=)713 b(1800.0)47 b(/)g([s])g(elapsed)f(exposure)f
-(time)0 5601 y(V_HELIO)h(=)763 b(16.23)47 b(/)g([km)g(s**\(-1\)])e
-(heliocentric)g(velocity)0 5714 y(LAMBDA)94 b(=)763 b(5400.)47
-b(/)g([angstrom])e(central)h(wavelength)p eop
-%%Page: 55 61
-55 60 bop 0 299 a Fh(5.14.)73 b(LOCAL)29 b(FITS)h(CONVENTIONS)f(SUPPOR)
--8 b(TED)29 b(BY)i(CFITSIO)1102 b Fj(55)0 555 y Ff(FLUX)190
-b(=)47 b(4.9033487787637465E-30)42 b(/)47 b([J/cm**2/s])e(average)h
-(flux)0 789 y Fj(In)28 b(general,)g(the)h(units)d(named)i(in)f(the)i
-(IA)m(U\(1988\))i(St)m(yle)d(Guide)f(are)i(recommended,)f(with)f(the)i
-(main)e(excep-)0 902 y(tion)j(that)h(the)f(preferred)g(unit)e(for)j
-(angle)f(is)f('deg')j(for)e(degrees.)0 1063 y(The)38
-b(\014ts)p 322 1063 28 4 v 33 w(read)p 527 1063 V 33
-w(k)m(ey)p 693 1063 V 33 w(unit)g(and)g(\014ts)p 1234
-1063 V 32 w(write)p 1469 1063 V 32 w(k)m(ey)p 1634 1063
-V 34 w(unit)f(routines)h(in)g(CFITSIO)f(read)i(and)f(write,)j(resp)s
-(ectiv)m(ely)-8 b(,)0 1175 y(the)31 b(k)m(eyw)m(ord)f(unit)f(strings)h
-(in)f(an)h(existing)f(k)m(eyw)m(ord.)0 1462 y Fd(5.14.4)113
-b(HIERAR)m(CH)34 b(Con)m(v)m(en)m(tion)j(for)g(Extended)h(Keyw)m(ord)f
-(Names)0 1681 y Fj(CFITSIO)k(supp)s(orts)g(the)i(HIERAR)m(CH)g(k)m(eyw)
-m(ord)g(con)m(v)m(en)m(tion)h(whic)m(h)e(allo)m(ws)g(k)m(eyw)m(ord)h
-(names)g(that)h(are)0 1794 y(longer)33 b(then)f(8)i(c)m(haracters)g
-(and)f(ma)m(y)h(con)m(tain)f(the)g(full)e(range)i(of)h(prin)m(table)d
-(ASCI)s(I)g(text)j(c)m(haracters.)51 b(This)0 1907 y(con)m(v)m(en)m
-(tion)38 b(w)m(as)g(dev)m(elop)s(ed)e(at)i(the)f(Europ)s(ean)f
-(Southern)g(Observ)-5 b(atory)37 b(\(ESO\))f(to)i(supp)s(ort)d(hierarc)
-m(hical)0 2020 y(FITS)30 b(k)m(eyw)m(ord)g(suc)m(h)h(as:)0
-2254 y Ff(HIERARCH)46 b(ESO)g(INS)h(FOCU)g(POS)g(=)g(-0.00002500)e(/)j
-(Focus)e(position)0 2488 y Fj(Basically)-8 b(,)52 b(this)46
-b(con)m(v)m(en)m(tion)j(uses)e(the)h(FITS)f(k)m(eyw)m(ord)h('HIERAR)m
-(CH')h(to)f(indicate)f(that)h(this)e(con)m(v)m(en-)0
-2601 y(tion)e(is)f(b)s(eing)g(used,)k(then)d(the)g(actual)h(k)m(eyw)m
-(ord)f(name)h(\()p Ff('ESO)i(INS)f(FOCU)h(POS')c Fj(in)g(this)g
-(example\))h(b)s(e-)0 2714 y(gins)39 b(in)f(column)g(10)j(and)e(can)h
-(con)m(tain)f(an)m(y)h(prin)m(table)e(ASCI)s(I)g(text)j(c)m(haracters,)
-i(including)37 b(spaces.)68 b(The)0 2827 y(equals)43
-b(sign)h(marks)f(the)h(end)g(of)g(the)g(k)m(eyw)m(ord)h(name)f(and)f
-(is)h(follo)m(w)m(ed)f(b)m(y)h(the)g(usual)f(v)-5 b(alue)44
-b(and)f(com-)0 2940 y(men)m(t)31 b(\014elds)e(just)h(as)h(in)e
-(standard)h(FITS)g(k)m(eyw)m(ords.)41 b(F)-8 b(urther)30
-b(details)g(of)h(this)e(con)m(v)m(en)m(tion)j(are)f(describ)s(ed)d(at)0
-3053 y(h)m(ttp://arcdev.hq.eso.org/dicb/dicd/dic-1-1.4.h)m(tml)33
-b(\(searc)m(h)f(for)e(HIERAR)m(CH\).)0 3213 y(This)42
-b(con)m(v)m(en)m(tion)k(allo)m(ws)e(a)g(m)m(uc)m(h)h(broader)e(range)i
-(of)f(k)m(eyw)m(ord)h(names)f(than)h(is)e(allo)m(w)m(ed)h(b)m(y)g(the)h
-(FITS)0 3326 y(Standard.)40 b(Here)30 b(are)h(more)g(examples)f(of)g
-(suc)m(h)g(k)m(eyw)m(ords:)0 3560 y Ff(HIERARCH)46 b(LongKeyword)e(=)k
-(47.5)e(/)i(Keyword)e(has)h(>)g(8)g(characters,)e(and)i(mixed)f(case)0
-3673 y(HIERARCH)g(XTE$TEMP)f(=)j(98.6)e(/)i(Keyword)d(contains)h(the)h
-('$')g(character)0 3786 y(HIERARCH)f(Earth)g(is)h(a)h(star)e(=)i(F)f(/)
-h(Keyword)d(contains)h(embedded)f(spaces)0 4020 y Fj(CFITSIO)40
-b(will)f(transparen)m(tly)i(read)h(and)f(write)f(these)j(k)m(eyw)m
-(ords,)i(so)d(application)e(programs)h(do)g(not)h(in)0
-4133 y(general)32 b(need)g(to)h(kno)m(w)f(an)m(ything)g(ab)s(out)g(the)
-g(sp)s(eci\014c)f(implemen)m(tation)g(details)g(of)i(the)f(HIERAR)m(CH)
-g(con-)0 4246 y(v)m(en)m(tion.)49 b(In)32 b(particular,)h(application)e
-(programs)h(do)h(not)h(need)e(to)i(sp)s(ecify)e(the)h(`HIERAR)m(CH')h
-(part)f(of)g(the)0 4359 y(k)m(eyw)m(ord)g(name)f(when)g(reading)f(or)h
-(writing)f(k)m(eyw)m(ords)h(\(although)g(it)g(ma)m(y)h(b)s(e)f
-(included)d(if)j(desired\).)45 b(When)0 4472 y(writing)33
-b(a)i(k)m(eyw)m(ord,)h(CFITSIO)d(\014rst)h(c)m(hec)m(ks)i(to)f(see)g
-(if)f(the)h(k)m(eyw)m(ord)g(name)f(is)g(legal)g(as)h(a)g(standard)f
-(FITS)0 4585 y(k)m(eyw)m(ord)k(\(no)g(more)f(than)h(8)g(c)m(haracters)h
-(long)e(and)g(con)m(taining)g(only)f(letters,)k(digits,)e(or)g(a)g(min)
-m(us)d(sign)i(or)0 4698 y(underscore\).)68 b(If)39 b(so)h(it)f(writes)g
-(it)g(as)g(a)h(standard)f(FITS)g(k)m(eyw)m(ord,)k(otherwise)c(it)g
-(uses)g(the)h(hierarc)m(h)e(con-)0 4811 y(v)m(en)m(tion)33
-b(to)g(write)f(the)g(k)m(eyw)m(ord.)48 b(The)32 b(maxim)m(um)f(k)m(eyw)
-m(ord)i(name)f(length)g(is)g(67)h(c)m(haracters,)i(whic)m(h)c(lea)m(v)m
-(es)0 4924 y(only)c(1)i(space)g(for)f(the)h(v)-5 b(alue)28
-b(\014eld.)38 b(A)29 b(more)f(practical)g(limit)e(is)i(ab)s(out)g(40)h
-(c)m(haracters,)i(whic)m(h)c(lea)m(v)m(es)i(enough)0
-5036 y(ro)s(om)f(for)h(most)f(k)m(eyw)m(ord)h(v)-5 b(alues.)40
-b(CFITSIO)27 b(returns)g(an)h(error)h(if)e(there)i(is)e(not)i(enough)f
-(ro)s(om)h(for)f(b)s(oth)g(the)0 5149 y(k)m(eyw)m(ord)k(name)f(and)f
-(the)i(k)m(eyw)m(ord)f(v)-5 b(alue)31 b(on)g(the)h(80-c)m(haracter)h
-(card,)f(except)g(for)f(string-v)-5 b(alued)30 b(k)m(eyw)m(ords)0
-5262 y(whic)m(h)i(are)h(simply)d(truncated)j(so)g(that)h(the)f(closing)
-f(quote)i(c)m(haracter)g(falls)d(in)h(column)g(80.)49
-b(In)32 b(the)h(curren)m(t)0 5375 y(implemen)m(tation,)28
-b(CFITSIO)f(preserv)m(es)i(the)g(case)h(of)f(the)g(letters)g(when)f
-(writing)f(the)i(k)m(eyw)m(ord)g(name,)g(but)f(it)0 5488
-y(is)c(case-insensitiv)m(e)g(when)g(reading)g(or)h(searc)m(hing)g(for)g
-(a)g(k)m(eyw)m(ord.)40 b(The)24 b(curren)m(t)h(implemen)m(tation)e
-(allo)m(ws)i(an)m(y)0 5601 y(ASCI)s(I)k(text)j(c)m(haracter)h(\(ASCI)s
-(I)c(32)j(to)f(ASCI)s(I)f(126\))i(in)e(the)h(k)m(eyw)m(ord)g(name)g
-(except)h(for)e(the)h('=')g(c)m(haracter.)0 5714 y(A)f(space)h(is)f
-(also)g(required)f(on)h(either)g(side)f(of)i(the)f(equal)g(sign.)p
+%%Page: 42 50
+42 49 bop 0 299 a Fj(42)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Ff(5.6)135 b(Image)46 b(Compression)0 805 y Fj(CFITSIO)29
+b(no)m(w)h(transparen)m(tly)g(supp)s(orts)e(2)j(t)m(yp)s(es)f(of)h
+(image)g(compression:)0 966 y(1\))j(The)f(en)m(tire)h(FITS)e(\014le)h
+(ma)m(y)h(b)s(e)f(externally)g(compressed)g(with)f(the)i(gzip)f(or)g
+(Unix)f(compress)i(algorithm,)0 1078 y(pro)s(ducing)22
+b(a)j(*.gz)h(or)f(*.Z)g(\014le,)g(resp)s(ectiv)m(ely)-8
+b(.)38 b(When)25 b(reading)e(compressed)i(\014les)e(of)i(this)e(t)m(yp)
+s(e,)k(CFITSIO)c(\014rst)0 1191 y(uncompresses)j(the)i(en)m(tire)f
+(\014le)f(in)m(to)h(memory)g(b)s(efore)g(p)s(erforming)e(the)i
+(requested)g(read)g(op)s(erations.)39 b(Output)0 1304
+y(\014les)30 b(can)h(b)s(e)f(directly)f(written)h(in)f(the)i(gzip)f
+(compressed)g(format)h(if)f(the)h(user-sp)s(eci\014ed)d(\014lename)i
+(ends)g(with)0 1417 y(`.gz'.)42 b(In)29 b(this)f(case,)j(CFITSIO)d
+(initially)e(writes)j(the)h(uncompressed)e(\014le)h(in)f(memory)i(and)f
+(then)g(compresses)0 1530 y(it)k(and)f(writes)g(it)h(to)g(disk)f(when)g
+(the)h(FITS)f(\014le)h(is)f(closed,)h(th)m(us)g(sa)m(ving)g(user)f
+(disk)g(space.)49 b(Read)33 b(and)g(write)0 1643 y(access)c(to)g(these)
+f(compressed)f(FITS)g(\014les)g(is)g(generally)g(quite)g(fast;)i(the)f
+(main)e(limitation)g(is)h(that)h(there)g(m)m(ust)0 1756
+y(b)s(e)i(enough)g(a)m(v)-5 b(ailable)30 b(memory)g(\(or)h(sw)m(ap)f
+(space\))h(to)g(hold)e(the)i(en)m(tire)f(uncompressed)f(FITS)h(\014le.)
+0 1916 y(2\))36 b(CFITSIO)d(also)i(supp)s(orts)e(a)i(new)m(er)g(image)h
+(compression)e(format)h(in)f(whic)m(h)f(the)i(image)h(is)e(divided)e
+(in)m(to)0 2029 y(a)43 b(grid)e(of)h(rectangular)g(tiles,)j(and)c(eac)m
+(h)j(tile)d(of)i(pixels)d(is)i(individually)36 b(compressed.)76
+b(The)42 b(compressed)0 2142 y(tiles)36 b(are)h(stored)g(in)e(ro)m(ws)i
+(of)f(a)i(v)-5 b(ariable)35 b(length)h(arra)m(y)h(column)f(in)f(a)i
+(FITS)f(binary)f(table,)j(but)e(CFITSIO)0 2255 y(recognizes)31
+b(that)f(the)g(binary)f(table)g(extension)h(con)m(tains)g(an)g(image)g
+(and)g(treats)h(it)e(as)h(if)f(it)h(w)m(ere)g(an)g(IMA)m(GE)0
+2368 y(extension.)46 b(This)31 b(tile-compressed)g(format)i(is)e(esp)s
+(ecially)g(w)m(ell)g(suited)g(for)h(compressing)g(v)m(ery)g(large)h
+(images)0 2481 y(b)s(ecause)e(a\))h(the)g(FITS)e(header)h(k)m(eyw)m
+(ords)h(remain)e(uncompressed)g(for)h(rapid)e(read)i(access,)i(and)e(b)
+s(ecause)g(b\))0 2594 y(it)j(is)g(p)s(ossible)e(to)j(extract)i(and)d
+(uncompress)f(sections)i(of)f(the)h(image)g(without)f(ha)m(ving)g(to)h
+(uncompress)f(the)0 2706 y(en)m(tire)e(image.)45 b(This)30
+b(format)j(is)e(also)g(m)m(uc)m(h)h(more)g(e\013ectiv)m(e)i(in)d
+(compressing)f(\015oating)i(p)s(oin)m(t)f(images)h(\(using)0
+2819 y(a)f(lossy)e(compression)h(algorithm\))g(than)g(simply)e
+(compressing)h(the)i(image)f(using)f(gzip)h(or)g(compress.)0
+2979 y(A)g(detailed)g(description)e(of)j(this)e(format)i(is)e(a)m(v)-5
+b(ailable)30 b(at:)0 3227 y Fe(http://heasarc.gsfc.nasa)o(.gov)o(/doc)o
+(s/s)o(oftw)o(are/)o(fit)o(sio/)334 3340 y(compression/compress_imag)o
+(e.h)o(tml)0 3587 y Fj(The)36 b(N-dimensional)f(FITS)h(image)h(can)g(b)
+s(e)g(divided)d(in)m(to)j(an)m(y)g(desired)e(rectangular)i(grid)f(of)h
+(compression)0 3700 y(tiles.)75 b(By)43 b(default)e(the)i(tiles)e(are)h
+(c)m(hosen)h(to)g(corresp)s(ond)e(to)i(the)f(ro)m(ws)h(of)f(the)g
+(image,)k(eac)m(h)d(con)m(taining)0 3813 y(NAXIS1)36
+b(pixels.)56 b(F)-8 b(or)36 b(example,)h(a)g(800)g(x)f(800)h(x)f(4)g
+(pixel)e(data)j(cub)s(e)e(w)m(ould)g(b)s(e)g(divided)e(in)i(to)h(3200)i
+(tiles)0 3926 y(con)m(taining)30 b(800)h(pixels)d(eac)m(h)k(b)m(y)e
+(default.)40 b(Alternativ)m(ely)-8 b(,)30 b(this)f(data)i(cub)s(e)e
+(could)g(b)s(e)h(divided)d(in)m(to)j(256)i(tiles)0 4039
+y(that)c(are)g(eac)m(h)g(100)h(X)e(100)i(X)e(1)h(pixels)d(in)h(size,)i
+(or)f(4)h(tiles)e(con)m(taining)h(800)i(x)e(800)h(X)g(1)g(pixels,)e(or)
+h(a)h(single)e(tile)0 4152 y(con)m(taining)j(the)h(en)m(tire)f(data)h
+(cub)s(e.)40 b(Note)31 b(that)f(the)f(image)h(dimensions)d(are)j(not)f
+(required)f(to)i(b)s(e)f(an)h(in)m(teger)0 4264 y(m)m(ultiple)j(of)j
+(the)g(tile)e(dimensions,)h(so,)i(for)e(example,)i(this)e(data)h(cub)s
+(e)f(could)f(also)i(b)s(e)f(divided)d(in)m(to)k(250)h(X)0
+4377 y(200)32 b(pixel)c(tiles,)i(in)f(whic)m(h)g(case)j(the)e(last)g
+(tile)g(in)f(eac)m(h)j(ro)m(w)e(w)m(ould)f(only)h(con)m(tain)g(50)i(X)e
+(200)i(pixels.)0 4538 y(Curren)m(tly)-8 b(,)29 b(3)i(image)f
+(compression)g(algorithms)f(are)h(supp)s(orted:)39 b(Rice,)31
+b(GZIP)-8 b(,)30 b(and)g(PLIO.)g(Rice)g(and)f(GZIP)0
+4650 y(are)34 b(general)f(purp)s(ose)f(algorithms)g(that)i(can)g(b)s(e)
+f(used)g(to)h(compress)f(almost)h(an)m(y)f(image.)51
+b(The)32 b(PLIO)h(algo-)0 4763 y(rithm,)38 b(on)f(the)g(other)h(hand,)g
+(is)e(more)i(sp)s(ecialized)d(and)i(w)m(as)h(dev)m(elop)s(ed)e(for)h
+(use)g(in)f(IRAF)i(to)g(store)g(pixel)0 4876 y(data)31
+b(qualit)m(y)f(masks.)41 b(It)30 b(is)g(designed)f(to)i(only)f(w)m(ork)
+g(on)h(images)f(con)m(taining)g(p)s(ositiv)m(e)g(in)m(tegers)g(with)g
+(v)-5 b(alues)0 4989 y(up)29 b(to)i(ab)s(out)g(2**24.)42
+b(Other)30 b(image)h(compression)e(algorithms)h(ma)m(y)h(b)s(e)e(supp)s
+(orted)g(in)g(the)h(future.)0 5149 y(The)41 b(3)g(supp)s(orted)f(image)
+h(compression)f(algorithms)g(are)i(all)e('loss-less')h(when)f(applied)f
+(to)j(in)m(teger)g(FITS)0 5262 y(images;)34 b(the)f(pixel)e(v)-5
+b(alues)31 b(are)i(preserv)m(ed)g(exactly)g(with)e(no)i(loss)e(of)i
+(information)e(during)f(the)j(compression)0 5375 y(and)i(uncompression)
+f(pro)s(cess.)57 b(Floating)36 b(p)s(oin)m(t)f(FITS)g(images)h(\(whic)m
+(h)f(ha)m(v)m(e)i(BITPIX)f(=)f(-32)i(or)f(-64\))i(are)0
+5488 y(\014rst)33 b(quan)m(tized)h(in)m(to)g(scaled)g(in)m(teger)h
+(pixel)d(v)-5 b(alues)33 b(b)s(efore)h(b)s(eing)f(compressed.)51
+b(This)32 b(tec)m(hnique)i(pro)s(duces)0 5601 y(m)m(uc)m(h)27
+b(higher)e(compression)h(factors)h(than)g(simply)d(using)h(GZIP)h(to)i
+(compress)e(the)h(image,)h(but)e(it)g(also)h(means)0
+5714 y(that)46 b(the)f(original)f(\015oating)h(v)-5 b(alue)45
+b(pixel)e(v)-5 b(alues)45 b(ma)m(y)h(not)f(b)s(e)g(precisely)f
+(returned)g(when)g(the)h(image)h(is)p eop
+%%Page: 43 51
+43 50 bop 0 299 a Fh(5.6.)72 b(IMA)m(GE)31 b(COMPRESSION)2567
+b Fj(43)0 555 y(uncompressed.)55 b(When)35 b(done)h(prop)s(erly)-8
+b(,)35 b(this)g(only)f(discards)g(the)i('noise')g(from)f(the)h
+(\015oating)f(p)s(oin)m(t)g(v)-5 b(alues)0 668 y(without)25
+b(losing)h(an)m(y)g(signi\014can)m(t)g(information.)37
+b(The)26 b(amoun)m(t)h(of)g(noise)f(that)h(is)e(discarded)g(can)i(b)s
+(e)e(con)m(trolled)0 781 y(b)m(y)30 b(the)h('noise)p
+511 781 28 4 v 32 w(bits')f(compression)f(parameter.)0
+941 y(No)42 b(sp)s(ecial)e(action)i(is)e(required)g(to)i(read)g
+(tile-compressed)e(images)i(b)s(ecause)f(all)g(the)g(CFITSIO)f
+(routines)0 1054 y(that)33 b(read)g(normal)f(uncompressed)g(FITS)g
+(images)h(can)g(also)g(read)g(images)g(in)e(the)i(tile-compressed)f
+(format;)0 1167 y(CFITSIO)39 b(essen)m(tially)h(treats)h(the)g(binary)e
+(table)h(that)i(con)m(tains)f(the)f(compressed)h(tiles)e(as)i(if)f(it)g
+(w)m(ere)h(an)0 1280 y(IMA)m(GE)31 b(extension.)0 1440
+y(When)d(creating)h(\(writing\))f(a)h(new)f(image)h(with)e(CFITSIO,)h
+(a)h(normal)e(uncompressed)h(FITS)g(primary)e(arra)m(y)0
+1553 y(or)k(IMA)m(GE)h(extension)f(will)d(b)s(e)i(written)h(unless)e
+(the)i(tile-compressed)f(format)i(has)f(b)s(een)f(sp)s(eci\014ed)f(in)h
+(1)h(of)h(2)0 1666 y(p)s(ossible)d(w)m(a)m(ys:)0 1826
+y(1\))d(A)m(t)g(run)d(time,)j(when)e(sp)s(ecifying)f(the)i(name)g(of)g
+(the)g(output)g(FITS)f(\014le)g(to)i(b)s(e)e(created)i(at)g(run)d
+(time,)j(the)g(user)0 1939 y(can)j(indicate)g(that)g(images)h(should)d
+(b)s(e)h(written)h(in)e(tile-compressed)i(format)g(b)m(y)g(enclosing)g
+(the)g(compression)0 2052 y(parameters)23 b(in)e(square)h(brac)m(k)m
+(ets)i(follo)m(wing)d(the)h(ro)s(ot)h(disk)e(\014le)g(name.)39
+b(The)21 b(`imcop)m(y')i(example)f(program)g(that)0 2165
+y(included)30 b(with)i(the)i(CFITSIO)d(distribution)f(can)j(b)s(e)g
+(used)f(for)h(this)g(purp)s(ose)e(to)j(compress)f(or)g(uncompress)0
+2278 y(images.)58 b(Here)36 b(are)h(some)f(examples)g(of)g(the)g
+(extended)g(\014le)f(name)h(syn)m(tax)h(for)f(sp)s(ecifying)e
+(tile-compressed)0 2391 y(output)c(images:)191 2629 y
+Fe(myfile.fit[compress])185 b(-)48 b(use)f(the)g(default)e(compression)
+g(algorithm)g(\(Rice\))1432 2742 y(and)i(the)g(default)e(tile)i(size)g
+(\(row)f(by)i(row\))191 2967 y(myfile.fit[compress)42
+b(GZIP])47 b(-)g(use)g(the)g(specified)e(compression)g(algorithm;)191
+3080 y(myfile.fit[compress)d(Rice])238 b(only)46 b(the)h(first)g
+(letter)f(of)h(the)g(algorithm)191 3193 y(myfile.fit[compress)42
+b(PLIO])238 b(name)46 b(is)i(required.)191 3419 y(myfile.fit[compress)
+42 b(R)48 b(100,100])141 b(-)47 b(use)g(Rice)g(compression)e(and)1861
+3532 y(100)i(x)h(100)f(pixel)f(tile)h(size)191 3758 y
+(myfile.fit[compress)42 b(R)48 b(100,100;2])d(-)i(as)h(above,)e(and)h
+(also)f(use)h(noisebits)e(=)j(2)0 3996 y Fj(2\))29 b(Before)g(calling)d
+(the)i(CFITSIO)e(routine)h(to)i(write)e(the)h(image)g(header)g(k)m(eyw)
+m(ords)g(\(e.g.,)j(\014ts)p 3335 3996 V 32 w(create)p
+3603 3996 V 34 w(image\))0 4109 y(the)37 b(programmer)g(can)g(call)g
+(the)g(routines)f(describ)s(ed)f(b)s(elo)m(w)h(to)i(sp)s(ecify)e(the)h
+(compression)f(algorithm)h(and)0 4222 y(the)d(tiling)e(pattern)i(that)h
+(is)e(to)i(b)s(e)e(used.)51 b(There)34 b(are)h(3)f(routines)f(for)h(sp)
+s(ecifying)e(the)i(v)-5 b(arious)33 b(compression)0 4335
+y(parameters)e(and)e(3)i(corresp)s(onding)e(routines)g(to)i(return)e
+(the)i(curren)m(t)f(v)-5 b(alues)30 b(of)g(the)h(parameters:)95
+4573 y Fe(int)47 b(fits_set_compression_type\()o(fit)o(sfil)o(e)42
+b(*fptr,)k(int)h(comptype,)e(int)i(*status\))95 4685
+y(int)g(fits_set_tile_dim\(fitsfile)41 b(*fptr,)46 b(int)h(ndim,)f
+(long)h(*tilesize,)e(int)i(*status\))95 4798 y(int)g
+(fits_set_noise_bits\(fitsfi)o(le)41 b(*fptr,)47 b(int)f(noisebits,)f
+(int)i(*status\))95 5024 y(int)g(fits_get_compression_type\()o(fit)o
+(sfil)o(e)42 b(*fptr,)k(int)h(*comptype,)e(int)i(*status\))95
+5137 y(int)g(fits_get_tile_dim\(fitsfile)41 b(*fptr,)46
+b(int)h(ndim,)f(long)h(*tilesize,)e(int)i(*status\))95
+5250 y(int)g(fits_get_noise_bits\(fitsfi)o(le)41 b(*fptr,)47
+b(int)f(*noisebits,)f(int)i(*status\))0 5488 y Fj(3)24
+b(sym)m(b)s(olic)d(constan)m(ts)k(are)e(de\014ned)f(for)h(use)g(as)g
+(the)h(v)-5 b(alue)22 b(of)i(the)f(`compt)m(yp)s(e')h(parameter:)38
+b(GZIP)p 3447 5488 V 32 w(1,)25 b(RICE)p 3802 5488 V
+32 w(1,)0 5601 y(or)i(PLIO)p 336 5601 V 32 w(1.)39 b(En)m(tering)26
+b(NULL)h(for)f(compt)m(yp)s(e)h(will)d(turn)i(o\013)h(the)g
+(tile-compression)e(and)h(cause)h(normal)f(FITS)0 5714
+y(images)k(to)i(b)s(e)d(written.)p eop
+%%Page: 44 52
+44 51 bop 0 299 a Fj(44)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fj(The)g('noisebits')g(parameter)i(is)e(only)g(used)g(when)g
+(compressing)g(\015oating)h(p)s(oin)m(t)f(images.)43
+b(The)30 b(default)g(v)-5 b(alue)0 668 y(is)24 b(4.)40
+b(Decreasing)25 b(the)h(v)-5 b(alue)24 b(of)h(noisebits)f(will)e(impro)
+m(v)m(e)j(the)h(o)m(v)m(erall)f(compression)f(e\016ciency)h(at)h(the)f
+(exp)s(ense)0 781 y(of)31 b(losing)e(more)h(information.)0
+941 y(A)g(small)e(example)h(program)g(called)g('imcop)m(y')g(is)g
+(included)e(with)h(CFITSIO)g(that)i(can)f(b)s(e)g(used)g(to)h(compress)
+0 1054 y(\(or)44 b(uncompress\))g(an)m(y)g(FITS)g(image.)82
+b(This)42 b(program)i(can)h(b)s(e)e(used)h(to)g(exp)s(erimen)m(t)g
+(with)f(the)h(v)-5 b(arious)0 1167 y(compression)29 b(options)h(on)g
+(existing)g(FITS)f(images)i(as)f(sho)m(wn)g(in)f(these)i(examples:)0
+1423 y Fe(1\))95 b(imcopy)46 b(infile.fit)f('outfile.fit[compress]')334
+1649 y(This)i(will)f(use)h(the)g(default)f(compression)f(algorithm)g
+(\(Rice\))h(and)h(the)334 1762 y(default)f(tile)h(size)f(\(row)h(by)g
+(row\))0 1988 y(2\))95 b(imcopy)46 b(infile.fit)f
+('outfile.fit[compress)d(GZIP]')334 2214 y(This)47 b(will)f(use)h(the)g
+(GZIP)g(compression)e(algorithm)g(and)i(the)g(default)334
+2327 y(tile)g(size)f(\(row)h(by)g(row\).)94 b(The)47
+b(allowed)f(compression)f(algorithms)g(are)334 2439 y(Rice,)h(GZIP,)h
+(and)g(PLIO.)94 b(Only)46 b(the)h(first)g(letter)f(of)h(the)g
+(algorithm)334 2552 y(name)g(needs)f(to)h(be)g(specified.)0
+2778 y(3\))95 b(imcopy)46 b(infile.fit)f('outfile.fit[compress)d(G)47
+b(100,100]')334 3004 y(This)g(will)f(use)h(the)g(GZIP)g(compression)e
+(algorithm)g(and)i(100)g(X)g(100)g(pixel)334 3117 y(tiles.)0
+3343 y(4\))95 b(imcopy)46 b(infile.fit)f('outfile.fit[compress)d(R)47
+b(100,100;)f(4]')334 3569 y(This)h(will)f(use)h(the)g(Rice)g
+(compression)e(algorithm,)g(100)h(X)i(100)f(pixel)334
+3681 y(tiles,)f(and)h(noise_bits)e(=)j(4)f(\(assuming)e(the)i(input)g
+(image)f(has)h(a)334 3794 y(floating)f(point)g(data)h(type\).)93
+b(Decreasing)45 b(the)i(value)g(of)g(noisebits)334 3907
+y(will)g(improve)f(the)g(overall)g(compression)f(efficiency)g(at)i(the)
+g(expense)334 4020 y(of)g(losing)f(more)h(information.)0
+4246 y(5\))95 b(imcopy)46 b(infile.fit)f(outfile.fit)334
+4472 y(If)i(the)g(input)g(file)f(is)h(in)h(tile-compressed)43
+b(format,)j(then)h(it)g(will)f(be)334 4585 y(uncompressed)f(to)i(the)g
+(output)f(file.)94 b(Otherwise,)45 b(it)i(simply)f(copies)334
+4698 y(the)h(input)f(image)h(to)g(the)g(output)f(image.)0
+4924 y(6\))95 b(imcopy)46 b('infile.fit[1001:1500,20)o(01:2)o(500])o(')
+89 b(outfile.fit)334 5149 y(This)47 b(extracts)e(a)j(500)f(X)g(500)g
+(pixel)f(section)g(of)h(the)g(much)g(larger)334 5262
+y(input)f(image)h(\(which)f(may)h(be)g(in)g(tile-compressed)d
+(format\).)93 b(The)334 5375 y(output)46 b(is)h(a)h(normal)e
+(uncompressed)e(FITS)j(image.)0 5601 y(7\))95 b(imcopy)46
+b('infile.fit[1001:1500,20)o(01:2)o(500])o(')89 b(outfile.fit.gz)p
 eop
-%%Page: 56 62
-56 61 bop 0 299 a Fj(56)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fe(5.15)136 b(Optimizing)45 b(Co)t(de)g(for)h(Maxim)l(um)f(Pro)t
-(cessing)g(Sp)t(eed)0 810 y Fj(CFITSIO)22 b(has)h(b)s(een)f(carefully)g
-(designed)g(to)i(obtain)f(the)g(highest)g(p)s(ossible)d(sp)s(eed)j
-(when)f(reading)g(and)h(writing)0 923 y(FITS)33 b(\014les.)50
-b(In)33 b(order)h(to)g(ac)m(hiev)m(e)h(the)f(b)s(est)g(p)s(erformance,)
-g(ho)m(w)m(ev)m(er,)i(application)d(programmers)g(m)m(ust)h(b)s(e)0
-1036 y(careful)23 b(to)i(call)e(the)h(CFITSIO)f(routines)f
-(appropriately)h(and)g(in)g(an)g(e\016cien)m(t)i(sequence;)i
-(inappropriate)21 b(usage)0 1149 y(of)31 b(CFITSIO)d(routines)i(can)g
-(greatly)h(slo)m(w)f(do)m(wn)g(the)h(execution)f(sp)s(eed)g(of)g(a)h
-(program.)0 1309 y(The)f(maxim)m(um)g(p)s(ossible)e(I/O)j(sp)s(eed)f
-(of)h(CFITSIO)e(dep)s(ends)g(of)i(course)g(on)f(the)h(t)m(yp)s(e)g(of)g
-(computer)g(system)0 1422 y(that)g(it)e(is)g(running)e(on.)41
-b(As)30 b(a)g(rough)g(guide,)f(the)h(curren)m(t)g(generation)g(of)g(w)m
-(orkstations)g(can)h(ac)m(hiev)m(e)g(sp)s(eeds)0 1535
-y(of)k(2)g({)g(10)g(MB/s)h(when)e(reading)g(or)g(writing)f(FITS)h
-(images)h(and)f(similar,)f(or)i(sligh)m(tly)e(slo)m(w)m(er)i(sp)s(eeds)
-e(with)0 1648 y(FITS)c(binary)g(tables.)40 b(Reading)30
-b(of)g(FITS)g(\014les)f(can)i(o)s(ccur)f(at)h(ev)m(en)f(higher)f(rates)
-i(\(30MB/s)i(or)d(more\))h(if)e(the)0 1761 y(FITS)d(\014le)g(is)f
-(still)g(cac)m(hed)j(in)d(system)i(memory)f(follo)m(wing)g(a)h
-(previous)e(read)h(or)h(write)f(op)s(eration)g(on)h(the)g(same)0
-1873 y(\014le.)43 b(T)-8 b(o)32 b(more)g(accurately)g(predict)e(the)i
-(b)s(est)f(p)s(erformance)g(that)h(is)e(p)s(ossible)f(on)j(an)m(y)g
-(particular)d(system,)k(a)0 1986 y(diagnostic)f(program)h(called)f
-(\\sp)s(eed.c")h(is)f(included)e(with)i(the)h(CFITSIO)e(distribution)e
-(whic)m(h)j(can)h(b)s(e)f(run)0 2099 y(to)f(appro)m(ximately)f(measure)
-g(the)h(maxim)m(um)e(p)s(ossible)f(sp)s(eed)h(of)i(writing)d(and)i
-(reading)g(a)g(test)i(FITS)d(\014le.)0 2259 y(The)k(follo)m(wing)e(2)j
-(sections)f(pro)m(vide)g(some)g(bac)m(kground)g(on)h(ho)m(w)f(CFITSIO)f
-(in)m(ternally)f(manages)j(the)f(data)0 2372 y(I/O)g(and)g(describ)s
-(es)e(some)j(strategies)g(that)g(ma)m(y)g(b)s(e)e(used)h(to)h(optimize)
-e(the)i(pro)s(cessing)e(sp)s(eed)g(of)h(soft)m(w)m(are)0
-2485 y(that)e(uses)f(CFITSIO.)0 2799 y Fd(5.15.1)113
-b(Bac)m(kground)38 b(Information:)48 b(Ho)m(w)37 b(CFITSIO)h(Manages)h
-(Data)f(I/O)0 3022 y Fj(Man)m(y)22 b(CFITSIO)e(op)s(erations)h(in)m(v)m
-(olv)m(e)h(transferring)e(only)h(a)h(small)e(n)m(um)m(b)s(er)h(of)h(b)m
-(ytes)g(to)g(or)g(from)f(the)h(FITS)f(\014le)0 3135 y(\(e.g,)31
-b(reading)d(a)h(k)m(eyw)m(ord,)h(or)f(writing)e(a)i(ro)m(w)g(in)e(a)i
-(table\);)h(it)f(w)m(ould)e(b)s(e)h(v)m(ery)i(ine\016cien)m(t)e(to)h
-(ph)m(ysically)e(read)0 3248 y(or)32 b(write)g(suc)m(h)g(small)e(blo)s
-(c)m(ks)i(of)g(data)h(directly)e(in)g(the)h(FITS)g(\014le)f(on)h(disk,)
-g(therefore)g(CFITSIO)f(main)m(tains)0 3361 y(a)38 b(set)g(of)g(in)m
-(ternal)f(Input{Output)e(\(IO\))j(bu\013ers)f(in)f(RAM)i(memory)g(that)
-g(eac)m(h)h(con)m(tain)f(one)g(FITS)f(blo)s(c)m(k)0 3474
-y(\(2880)27 b(b)m(ytes\))f(of)f(data.)40 b(Whenev)m(er)25
-b(CFITSIO)f(needs)g(to)i(access)g(data)g(in)e(the)h(FITS)f(\014le,)i
-(it)e(\014rst)g(transfers)h(the)0 3587 y(FITS)30 b(blo)s(c)m(k)g(con)m
-(taining)g(those)h(b)m(ytes)g(in)m(to)f(one)h(of)f(the)h(IO)f
-(bu\013ers)f(in)g(memory)-8 b(.)42 b(The)30 b(next)g(time)g(CFITSIO)0
-3700 y(needs)36 b(to)g(access)i(b)m(ytes)e(in)f(the)h(same)h(blo)s(c)m
-(k)e(it)h(can)g(then)g(go)h(to)f(the)h(fast)f(IO)f(bu\013er)g(rather)h
-(than)g(using)f(a)0 3813 y(m)m(uc)m(h)d(slo)m(w)m(er)h(system)f(disk)f
-(access)i(routine.)45 b(The)32 b(n)m(um)m(b)s(er)f(of)h(a)m(v)-5
-b(ailable)32 b(IO)g(bu\013ers)f(is)g(determined)g(b)m(y)h(the)0
-3926 y(NIOBUF)f(parameter)g(\(in)e(\014tsio2.h\))h(and)g(is)g(curren)m
-(tly)f(set)i(to)g(25.)0 4086 y(Whenev)m(er)24 b(CFITSIO)f(reads)g(or)h
-(writes)f(data)h(it)g(\014rst)f(c)m(hec)m(ks)i(to)g(see)f(if)f(that)h
-(blo)s(c)m(k)g(of)g(the)g(FITS)f(\014le)f(is)h(already)0
-4199 y(loaded)32 b(in)m(to)g(one)g(of)g(the)g(IO)g(bu\013ers.)44
-b(If)32 b(not,)h(and)e(if)g(there)h(is)f(an)h(empt)m(y)h(IO)e(bu\013er)
-g(a)m(v)-5 b(ailable,)32 b(then)g(it)g(will)0 4312 y(load)g(that)i(blo)
-s(c)m(k)e(in)m(to)g(the)h(IO)g(bu\013er)e(\(when)h(reading)g(a)h(FITS)f
-(\014le\))g(or)h(will)d(initialize)g(a)j(new)f(blo)s(c)m(k)h(\(when)0
-4425 y(writing)i(to)j(a)g(FITS)f(\014le\).)61 b(If)37
-b(all)f(the)i(IO)e(bu\013ers)h(are)g(already)g(full,)g(it)g(m)m(ust)h
-(decide)e(whic)m(h)g(one)i(to)g(reuse)0 4538 y(\(generally)32
-b(the)h(one)g(that)g(has)f(b)s(een)g(accessed)i(least)e(recen)m(tly\),)
-i(and)e(\015ush)f(the)i(con)m(ten)m(ts)h(bac)m(k)g(to)f(disk)e(if)g(it)
-0 4650 y(has)f(b)s(een)g(mo)s(di\014ed)e(b)s(efore)i(loading)f(the)i
-(new)f(blo)s(c)m(k.)0 4811 y(The)g(one)g(ma)5 b(jor)30
-b(exception)h(to)g(the)f(ab)s(o)m(v)m(e)h(pro)s(cess)f(o)s(ccurs)g
-(whenev)m(er)g(a)g(large)h(con)m(tiguous)f(set)h(of)f(b)m(ytes)h(are)0
-4924 y(accessed,)37 b(as)d(migh)m(t)h(o)s(ccur)f(when)f(reading)h(or)g
-(writing)e(a)j(FITS)f(image.)53 b(In)34 b(this)f(case)i(CFITSIO)e(b)m
-(ypasses)0 5036 y(the)i(in)m(ternal)f(IO)h(bu\013ers)f(and)g(simply)f
-(reads)i(or)g(writes)g(the)g(desired)f(b)m(ytes)h(directly)f(in)g(the)h
-(disk)f(\014le)g(with)0 5149 y(a)j(single)e(call)g(to)i(a)g(lo)m(w-lev)
-m(el)f(\014le)f(read)h(or)h(write)e(routine.)57 b(The)36
-b(minim)m(um)e(threshold)g(for)i(the)h(n)m(um)m(b)s(er)e(of)0
-5262 y(b)m(ytes)40 b(to)g(read)f(or)g(write)f(this)h(w)m(a)m(y)h(is)e
-(set)i(b)m(y)f(the)g(MINDIRECT)g(parameter)h(and)e(is)h(curren)m(tly)f
-(set)i(to)g(3)0 5375 y(FITS)28 b(blo)s(c)m(ks)f(=)h(8640)i(b)m(ytes.)41
-b(This)27 b(is)g(the)h(most)h(e\016cien)m(t)g(w)m(a)m(y)g(to)g(read)g
-(or)f(write)g(large)g(c)m(h)m(unks)g(of)g(data)i(and)0
-5488 y(can)37 b(ac)m(hiev)m(e)h(IO)e(transfer)g(rates)h(of)g(5)g({)g
-(10MB/s)i(or)d(greater.)61 b(Note)38 b(that)f(this)f(fast)h(direct)f
-(IO)g(pro)s(cess)g(is)0 5601 y(not)29 b(applicable)d(when)h(accessing)i
-(columns)f(of)g(data)h(in)e(a)i(FITS)f(table)g(b)s(ecause)h(the)f(b)m
-(ytes)h(are)g(generally)f(not)0 5714 y(con)m(tiguous)h(since)f(they)h
-(are)h(in)m(terlea)m(v)m(ed)f(b)m(y)g(the)g(other)g(columns)f(of)h
-(data)g(in)f(the)h(table.)40 b(This)27 b(explains)g(wh)m(y)p
+%%Page: 45 53
+45 52 bop 0 299 a Fh(5.7.)72 b(ASCI)s(I)29 b(AND)i(BINAR)-8
+b(Y)31 b(T)-8 b(ABLE)31 b(R)m(OUTINES)1864 b Fj(45)334
+555 y Fe(Same)47 b(as)g(above,)f(except)g(the)h(output)f(file)h(is)g
+(externally)e(compressed)334 668 y(using)h(the)h(gzip)g(algorithm.)0
+1112 y Ff(5.7)135 b(ASCI)t(I)45 b(and)f(Binary)h(T)-11
+b(able)45 b(Routines)0 1363 y Fj(These)36 b(routines)f(p)s(erform)g
+(read)i(and)e(write)h(op)s(erations)g(on)g(columns)f(of)i(data)g(in)e
+(FITS)h(ASCI)s(I)e(or)j(Binary)0 1476 y(tables.)46 b(Note)33
+b(that)g(in)d(the)j(follo)m(wing)d(discussions,)g(the)i(\014rst)g(ro)m
+(w)g(and)f(column)g(in)g(a)h(table)g(is)g(at)g(p)s(osition)f(1)0
+1588 y(not)g(0.)0 1749 y(Users)k(should)f(also)i(read)f(the)h(follo)m
+(wing)e(c)m(hapter)j(on)e(the)h(CFITSIO)e(iterator)i(function)f(whic)m
+(h)f(pro)m(vides)h(a)0 1862 y(more)j(`ob)5 b(ject)39
+b(orien)m(ted')f(metho)s(d)g(of)g(reading)f(and)h(writing)e(table)i
+(columns.)62 b(The)37 b(iterator)i(function)d(is)i(a)0
+1974 y(little)c(more)i(complicated)f(to)h(use,)h(but)e(the)g(adv)-5
+b(an)m(tages)38 b(are)d(that)i(it)e(usually)e(tak)m(es)k(less)d(co)s
+(de)i(to)g(p)s(erform)0 2087 y(the)e(same)h(op)s(eration,)f(and)f(the)i
+(resulting)d(program)h(oftens)i(runs)d(faster)i(b)s(ecause)g(the)h
+(FITS)e(\014les)g(are)h(read)0 2200 y(and)c(written)f(using)g(the)i
+(most)f(e\016cien)m(t)h(blo)s(c)m(k)f(size.)0 2489 y
+Fd(5.7.1)112 b(Create)38 b(New)f(T)-9 b(able)0 2695 y
+Fi(1)81 b Fj(Create)40 b(a)f(new)g(ASCI)s(I)e(or)i(bin)m(table)f(table)
+h(extension.)67 b(If)39 b(the)g(FITS)g(\014le)f(is)g(curren)m(tly)g
+(empt)m(y)i(then)f(a)227 2808 y(dumm)m(y)25 b(primary)e(arra)m(y)j
+(will)d(b)s(e)i(created)i(b)s(efore)e(app)s(ending)e(the)j(table)f
+(extension)h(to)g(it.)39 b(The)25 b(tblt)m(yp)s(e)227
+2921 y(parameter)39 b(de\014nes)e(the)h(t)m(yp)s(e)h(of)f(table)g(and)f
+(can)i(ha)m(v)m(e)g(v)-5 b(alues)38 b(of)g(ASCI)s(I)p
+2924 2921 28 4 v 31 w(TBL)g(or)g(BINAR)-8 b(Y)p 3659
+2921 V 34 w(TBL.)227 3034 y(The)29 b(naxis2)f(parameter)i(giv)m(es)f
+(the)h(initial)c(n)m(um)m(b)s(er)i(of)h(ro)m(ws)g(to)h(b)s(e)f(created)
+h(in)e(the)h(table,)g(and)g(should)227 3147 y(normally)f(b)s(e)h(set)h
+(=)g(0.)40 b(CFITSIO)29 b(will)e(automatically)i(increase)h(the)f(size)
+h(of)g(the)g(table)f(as)h(additional)227 3260 y(ro)m(ws)d(are)g
+(written.)39 b(A)27 b(non-zero)g(n)m(um)m(b)s(er)f(of)h(ro)m(ws)g(ma)m
+(y)g(b)s(e)f(sp)s(eci\014ed)f(to)j(reserv)m(e)f(space)h(for)e(that)i
+(man)m(y)227 3373 y(ro)m(ws,)41 b(ev)m(en)e(if)f(a)h(few)m(er)g(n)m(um)
+m(b)s(er)e(of)i(ro)m(ws)f(will)e(b)s(e)i(written.)65
+b(The)38 b(tunit)f(and)h(extname)i(parameters)227 3486
+y(are)e(optional)e(and)h(a)h(n)m(ull)d(p)s(oin)m(ter)h(ma)m(y)i(b)s(e)f
+(giv)m(en)g(if)g(they)g(are)h(not)f(de\014ned.)61 b(The)37
+b(FITS)f(Standard)227 3599 y(recommends)29 b(that)h(only)f(letters,)h
+(digits,)f(and)g(the)g(underscore)g(c)m(haracter)i(b)s(e)e(used)g(in)f
+(column)g(names)227 3712 y(\(the)d(tt)m(yp)s(e)g(parameter\))g(with)d
+(no)i(em)m(b)s(edded)f(spaces.)40 b(T)-8 b(railing)21
+b(blank)i(c)m(haracters)j(are)e(not)h(signi\014can)m(t.)227
+3824 y(It)36 b(is)f(recommended)g(that)i(all)e(the)h(column)e(names)i
+(in)e(a)j(giv)m(en)e(table)h(b)s(e)f(unique)f(within)f(the)j(\014rst)g
+(8)227 3937 y(c)m(haracters,)25 b(and)c(strongly)f(recommended)h(that)h
+(the)f(names)h(b)s(e)e(unique)g(within)e(the)k(\014rst)e(16)i(c)m
+(haracters.)95 4296 y Fe(int)47 b(fits_create_tbl)d(/)j(ffcrtb)286
+4409 y(\(fitsfile)f(*fptr,)g(int)h(tbltype,)e(long)i(naxis2,)f(int)h
+(tfields,)e(char)i(*ttype[],)334 4522 y(char)g(*tform[],)e(char)i
+(*tunit[],)e(char)i(*extname,)e(int)i(*status\))0 4810
+y Fd(5.7.2)112 b(Column)37 b(Information)f(Routines)0
+5017 y Fi(1)81 b Fj(Get)30 b(the)g(n)m(um)m(b)s(er)e(of)i(ro)m(ws)g(or)
+f(columns)f(in)h(the)h(curren)m(t)f(FITS)g(table.)40
+b(The)29 b(n)m(um)m(b)s(er)f(of)i(ro)m(ws)g(is)e(giv)m(en)i(b)m(y)227
+5130 y(the)k(NAXIS2)f(k)m(eyw)m(ord)h(and)e(the)i(n)m(um)m(b)s(er)e(of)
+h(columns)f(is)g(giv)m(en)h(b)m(y)g(the)h(TFIELDS)e(k)m(eyw)m(ord)i(in)
+e(the)227 5242 y(header)e(of)h(the)g(table.)95 5488 y
+Fe(int)47 b(fits_get_num_rows)c(/)48 b(ffgnrw)286 5601
+y(\(fitsfile)e(*fptr,)g(>)h(long)g(*nrows,)f(int)h(*status\);)p
 eop
-%%Page: 57 63
-57 62 bop 0 299 a Fh(5.15.)73 b(OPTIMIZING)29 b(CODE)h(F)m(OR)h
-(MAXIMUM)g(PR)m(OCESSING)f(SPEED)971 b Fj(57)0 555 y(the)31
-b(sp)s(eed)e(for)h(accessing)h(FITS)f(tables)g(is)f(generally)h(slo)m
-(w)m(er)g(than)h(accessing)f(FITS)g(images.)0 715 y(Giv)m(en)h(this)g
-(bac)m(kground)g(information,)f(the)i(general)f(strategy)i(for)e
-(e\016cien)m(tly)g(accessing)h(FITS)f(\014les)f(should)0
-828 y(no)m(w)36 b(b)s(e)g(apparen)m(t:)52 b(when)35 b(dealing)g(with)g
-(FITS)h(images,)i(read)e(or)g(write)f(large)i(c)m(h)m(unks)f(of)g(data)
-h(at)g(a)f(time)0 941 y(so)30 b(that)h(the)f(direct)g(IO)f(mec)m
-(hanism)g(will)f(b)s(e)h(in)m(v)m(ok)m(ed;)i(when)e(accessing)i(FITS)e
-(headers)h(or)g(FITS)f(tables,)h(on)0 1054 y(the)35 b(other)g(hand,)g
-(once)g(a)g(particular)f(FITS)g(blo)s(c)m(k)g(has)g(b)s(een)g(loading)g
-(in)m(to)h(one)g(of)g(the)f(IO)h(bu\013ers,)g(try)f(to)0
-1167 y(access)39 b(all)d(the)h(needed)g(information)f(in)g(that)i(blo)s
-(c)m(k)f(b)s(efore)g(it)g(gets)h(\015ushed)d(out)j(of)g(the)f(IO)g
-(bu\013er.)60 b(It)38 b(is)0 1280 y(imp)s(ortan)m(t)30
-b(to)i(a)m(v)m(oid)f(the)g(situation)f(where)h(the)g(same)g(FITS)f(blo)
-s(c)m(k)h(is)f(b)s(eing)f(read)i(then)g(\015ushed)e(from)h(a)h(IO)0
-1393 y(bu\013er)e(m)m(ultiple)f(times.)0 1553 y(The)i(follo)m(wing)f
-(section)h(giv)m(es)h(more)f(sp)s(eci\014c)g(suggestions)g(for)g
-(optimizing)f(the)h(use)g(of)h(CFITSIO.)0 1852 y Fd(5.15.2)113
-b(Optimization)34 b(Strategies)0 2072 y Fj(1.)54 b(When)34
-b(dealing)f(with)h(a)h(FITS)e(primary)g(arra)m(y)i(or)g(IMA)m(GE)g
-(extension,)h(it)e(is)f(more)i(e\016cien)m(t)g(to)g(read)g(or)0
-2185 y(write)30 b(large)g(c)m(h)m(unks)g(of)g(the)h(image)f(at)i(a)e
-(time)g(\(at)i(least)e(3)h(FITS)f(blo)s(c)m(ks)f(=)h(8640)i(b)m(ytes\))
-f(so)g(that)g(the)f(direct)0 2298 y(IO)j(mec)m(hanism)g(will)d(b)s(e)j
-(used)g(as)g(describ)s(ed)f(in)g(the)h(previous)f(section.)50
-b(Smaller)32 b(c)m(h)m(unks)h(of)g(data)h(are)g(read)0
-2411 y(or)d(written)f(via)h(the)g(IO)f(bu\013ers,)g(whic)m(h)g(is)g
-(somewhat)h(less)f(e\016cien)m(t)i(b)s(ecause)f(of)g(the)g(extra)h(cop)
-m(y)f(op)s(eration)0 2524 y(and)26 b(additional)e(b)s(o)s(okk)m(eeping)
-i(steps)h(that)g(are)g(required.)38 b(In)26 b(principle)d(it)j(is)g
-(more)g(e\016cien)m(t)h(to)h(read)e(or)h(write)0 2636
-y(as)i(big)f(an)h(arra)m(y)h(of)f(image)g(pixels)e(at)j(one)f(time)f
-(as)i(p)s(ossible,)d(ho)m(w)m(ev)m(er,)j(if)e(the)i(arra)m(y)f(b)s
-(ecomes)g(so)g(large)g(that)0 2749 y(the)j(op)s(erating)f(system)g
-(cannot)h(store)g(it)f(all)g(in)f(RAM,)i(then)f(the)h(p)s(erformance)f
-(ma)m(y)h(b)s(e)f(degraded)g(b)s(ecause)0 2862 y(of)g(the)f(increased)g
-(sw)m(apping)f(of)h(virtual)f(memory)h(to)h(disk.)0 3022
-y(2.)51 b(When)33 b(dealing)g(with)f(FITS)h(tables,)i(the)f(most)g(imp)
-s(ortan)m(t)f(e\016ciency)g(factor)i(in)d(the)i(soft)m(w)m(are)h
-(design)e(is)0 3135 y(to)k(read)f(or)g(write)f(the)h(data)h(in)e(the)h
-(FITS)g(\014le)f(in)g(a)h(single)f(pass)h(through)f(the)h(\014le.)57
-b(An)36 b(example)g(of)g(p)s(o)s(or)0 3248 y(program)g(design)g(w)m
-(ould)f(b)s(e)h(to)h(read)g(a)f(large,)j(3-column)d(table)g(b)m(y)h
-(sequen)m(tially)e(reading)h(the)g(en)m(tire)h(\014rst)0
-3361 y(column,)24 b(then)g(going)g(bac)m(k)g(to)h(read)e(the)h(2nd)g
-(column,)g(and)f(\014nally)f(the)i(3rd)f(column;)i(this)e(ob)m(viously)
-f(requires)0 3474 y(3)27 b(passes)g(through)g(the)g(\014le)f(whic)m(h)g
-(could)g(triple)f(the)j(execution)f(time)g(of)g(an)g(IO)f(limited)f
-(program.)40 b(F)-8 b(or)27 b(small)0 3587 y(tables)j(this)f(is)h(not)g
-(imp)s(ortan)m(t,)g(but)g(when)f(reading)g(m)m(ulti-megab)m(yte)i
-(sized)f(tables)g(these)h(ine\016ciencies)e(can)0 3700
-y(b)s(ecome)g(signi\014can)m(t.)39 b(The)28 b(more)h(e\016cien)m(t)g
-(pro)s(cedure)e(in)h(this)f(case)j(is)d(to)j(read)e(or)h(write)f(only)f
-(as)i(man)m(y)g(ro)m(ws)0 3813 y(of)j(the)g(table)f(as)h(will)d(\014t)j
-(in)m(to)f(the)h(a)m(v)-5 b(ailable)31 b(in)m(ternal)f(IO)h(bu\013ers,)
-h(then)f(access)i(all)d(the)i(necessary)g(columns)0 3926
-y(of)f(data)h(within)c(that)k(range)f(of)g(ro)m(ws.)43
-b(Then)29 b(after)j(the)f(program)g(is)f(completely)g(\014nished)f
-(with)g(the)j(data)f(in)0 4039 y(those)i(ro)m(ws)e(it)h(can)g(mo)m(v)m
-(e)i(on)e(to)g(the)h(next)f(range)g(of)g(ro)m(ws)g(that)h(will)c(\014t)
-j(in)f(the)h(bu\013ers,)f(con)m(tin)m(uing)g(in)g(this)0
-4152 y(w)m(a)m(y)d(un)m(til)d(the)h(en)m(tire)h(\014le)f(has)g(b)s(een)
-g(pro)s(cessed.)39 b(By)27 b(using)e(this)h(pro)s(cedure)f(of)i
-(accessing)g(all)f(the)g(columns)g(of)0 4264 y(a)k(table)f(in)f
-(parallel)f(rather)i(than)g(sequen)m(tially)-8 b(,)29
-b(eac)m(h)h(blo)s(c)m(k)f(of)h(the)f(FITS)g(\014le)f(will)e(only)j(b)s
-(e)f(read)i(or)f(written)0 4377 y(once.)0 4538 y(The)g(optimal)f(n)m
-(um)m(b)s(er)g(of)i(ro)m(ws)f(to)i(read)e(or)g(write)g(at)h(one)g(time)
-f(in)f(a)i(giv)m(en)f(table)h(dep)s(ends)d(on)j(the)f(width)f(of)0
-4650 y(the)j(table)g(ro)m(w,)g(on)g(the)g(n)m(um)m(b)s(er)f(of)h(IO)g
-(bu\013ers)e(that)j(ha)m(v)m(e)g(b)s(een)e(allo)s(cated)h(in)f
-(CFITSIO,)g(and)g(also)h(on)g(the)0 4763 y(n)m(um)m(b)s(er)f(of)h
-(other)g(FITS)f(\014les)g(that)i(are)f(op)s(en)f(at)i(the)f(same)g
-(time)g(\(since)g(one)g(IO)f(bu\013er)g(is)g(alw)m(a)m(ys)i(reserv)m
-(ed)0 4876 y(for)e(eac)m(h)i(op)s(en)d(FITS)h(\014le\).)40
-b(F)-8 b(ortunately)g(,)32 b(a)f(CFITSIO)e(routine)g(is)h(a)m(v)-5
-b(ailable)29 b(that)i(will)d(return)h(the)i(optimal)0
-4989 y(n)m(um)m(b)s(er)24 b(of)i(ro)m(ws)f(for)h(a)g(giv)m(en)f(table:)
-38 b(\014ts)p 1455 4989 28 4 v 33 w(get)p 1608 4989 V
-34 w(ro)m(wsize.)h(It)26 b(is)e(not)i(critical)e(to)j(use)e(exactly)h
-(the)g(v)-5 b(alue)25 b(of)g(nro)m(ws)0 5102 y(returned)31
-b(b)m(y)g(this)g(routine,)h(as)g(long)f(as)h(one)g(do)s(es)g(not)g
-(exceed)h(it.)44 b(Using)31 b(a)i(v)m(ery)f(small)e(v)-5
-b(alue)31 b(ho)m(w)m(ev)m(er)j(can)0 5215 y(also)c(lead)f(to)i(p)s(o)s
-(or)e(p)s(erformance)g(b)s(ecause)g(of)h(the)g(o)m(v)m(erhead)h(from)f
-(the)g(larger)f(n)m(um)m(b)s(er)g(of)h(subroutine)e(calls.)0
-5375 y(The)36 b(optimal)f(n)m(um)m(b)s(er)g(of)h(ro)m(ws)g(returned)f
-(b)m(y)i(\014ts)p 1829 5375 V 32 w(get)p 1981 5375 V
-34 w(ro)m(wsize)f(is)g(v)-5 b(alid)34 b(only)h(as)i(long)f(as)g(the)h
-(application)0 5488 y(program)27 b(is)f(only)g(reading)h(or)g(writing)e
-(data)j(in)e(the)h(sp)s(eci\014ed)e(table.)40 b(An)m(y)27
-b(other)g(calls)g(to)h(access)g(data)g(in)e(the)0 5601
-y(table)31 b(header)g(or)g(in)e(an)m(y)j(other)f(FITS)f(\014le)g(w)m
-(ould)g(cause)h(additional)e(blo)s(c)m(ks)i(of)g(data)g(to)h(b)s(e)e
-(loaded)h(in)m(to)g(the)0 5714 y(IO)c(bu\013ers)g(displacing)f(data)i
-(from)g(the)g(original)e(table,)j(and)e(should)f(b)s(e)i(a)m(v)m(oided)
-g(during)e(the)i(critical)f(p)s(erio)s(d)p eop
-%%Page: 58 64
-58 63 bop 0 299 a Fj(58)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fj(while)d(the)j(table)f(is)g(b)s(eing)f(read)h(or)g(written.)0
-715 y(Occasionally)f(it)g(is)f(necessary)i(to)h(sim)m(ultaneously)c
-(access)k(more)f(than)f(one)h(FITS)f(table,)h(for)g(example)f(when)0
-828 y(transferring)41 b(v)-5 b(alues)42 b(from)g(an)h(input)d(table)j
-(to)g(an)g(output)f(table.)78 b(In)42 b(cases)h(lik)m(e)f(this,)j(one)e
-(should)e(call)0 941 y(\014ts)p 127 941 28 4 v 32 w(get)p
-279 941 V 34 w(ro)m(wsize)24 b(to)g(get)h(the)f(optimal)e(n)m(um)m(b)s
-(er)g(of)i(ro)m(ws)g(for)f(eac)m(h)i(table)e(separately)-8
-b(,)26 b(than)d(reduce)h(the)f(n)m(um)m(b)s(er)0 1054
-y(of)31 b(ro)m(ws)h(prop)s(ortionally)-8 b(.)41 b(F)-8
-b(or)32 b(example,)f(if)f(the)i(optimal)e(n)m(um)m(b)s(er)g(of)h(ro)m
-(ws)g(in)f(the)i(input)d(table)i(is)g(3600)i(and)0 1167
-y(is)f(1400)i(in)e(the)h(output)f(table,)h(then)g(these)g(v)-5
-b(alues)32 b(should)f(b)s(e)h(cut)h(in)e(half)h(to)h(1800)i(and)d(700,)
-j(resp)s(ectiv)m(ely)-8 b(,)0 1280 y(if)29 b(b)s(oth)h(tables)g(are)h
-(going)f(to)h(b)s(e)f(accessed)i(at)f(the)f(same)h(time.)0
-1440 y(3.)39 b(Use)24 b(binary)e(table)h(extensions)g(rather)g(than)h
-(ASCI)s(I)e(table)h(extensions)g(for)g(b)s(etter)h(e\016ciency)g(when)e
-(dealing)0 1553 y(with)36 b(tabular)h(data.)62 b(The)37
-b(I/O)g(to)h(ASCI)s(I)e(tables)h(is)g(slo)m(w)m(er)g(b)s(ecause)h(of)f
-(the)h(o)m(v)m(erhead)h(in)d(formatting)h(or)0 1666 y(parsing)31
-b(the)h(ASCI)s(I)f(data)i(\014elds)e(and)h(b)s(ecause)g(ASCI)s(I)f
-(tables)h(are)h(ab)s(out)f(t)m(wice)h(as)g(large)f(as)h(binary)d
-(tables)0 1779 y(with)f(the)i(same)f(information)f(con)m(ten)m(t.)0
-1939 y(4.)64 b(Design)38 b(soft)m(w)m(are)h(so)g(that)f(it)g(reads)g
-(the)g(FITS)f(header)h(k)m(eyw)m(ords)g(in)f(the)h(same)h(order)e(in)g
-(whic)m(h)g(they)0 2052 y(o)s(ccur)28 b(in)g(the)h(\014le.)39
-b(When)28 b(reading)g(k)m(eyw)m(ords,)i(CFITSIO)d(searc)m(hes)i(forw)m
-(ard)g(starting)f(from)g(the)h(p)s(osition)e(of)0 2165
-y(the)i(last)h(k)m(eyw)m(ord)f(that)h(w)m(as)g(read.)40
-b(If)29 b(it)f(reac)m(hes)j(the)e(end)g(of)g(the)h(header)f(without)f
-(\014nding)f(the)i(k)m(eyw)m(ord,)h(it)0 2278 y(then)j(go)s(es)h(bac)m
-(k)g(to)h(the)e(start)h(of)g(the)g(header)f(and)g(con)m(tin)m(ues)g
-(the)h(searc)m(h)g(do)m(wn)f(to)h(the)g(p)s(osition)d(where)i(it)0
-2391 y(started.)41 b(In)30 b(practice,)h(as)f(long)g(as)h(the)f(en)m
-(tire)h(FITS)e(header)h(can)h(\014t)f(at)h(one)g(time)f(in)f(the)h(a)m
-(v)-5 b(ailable)30 b(in)m(ternal)0 2503 y(IO)36 b(bu\013ers,)h(then)f
-(the)g(header)g(k)m(eyw)m(ord)h(access)g(will)d(b)s(e)i(v)m(ery)g(fast)
-h(and)f(it)f(mak)m(es)i(little)e(di\013erence)h(whic)m(h)0
-2616 y(order)30 b(they)g(are)h(accessed.)0 2777 y(5.)40
-b(Av)m(oid)28 b(the)f(use)h(of)f(scaling)g(\(b)m(y)h(using)e(the)i
-(BSCALE)e(and)h(BZER)m(O)h(or)f(TSCAL)g(and)g(TZER)m(O)f(k)m(eyw)m
-(ords\))0 2889 y(in)34 b(FITS)g(\014les)f(since)i(the)g(scaling)f(op)s
-(erations)g(add)g(to)i(the)f(pro)s(cessing)e(time)i(needed)f(to)i(read)
-f(or)g(write)f(the)0 3002 y(data.)39 b(In)24 b(some)h(cases)h(it)e(ma)m
-(y)h(b)s(e)f(more)g(e\016cien)m(t)h(to)h(temp)s(orarily)c(turn)i(o\013)
-h(the)f(scaling)g(\(using)f(\014ts)p 3490 3002 V 33 w(set)p
-3634 3002 V 33 w(bscale)0 3115 y(or)30 b(\014ts)p 238
-3115 V 33 w(set)p 382 3115 V 33 w(tscale\))i(and)d(then)h(read)h(or)f
-(write)g(the)g(ra)m(w)h(unscaled)e(v)-5 b(alues)30 b(in)f(the)h(FITS)g
-(\014le.)0 3275 y(6.)86 b(Av)m(oid)45 b(using)f(the)i(`implicit)c
-(datat)m(yp)s(e)47 b(con)m(v)m(ersion')e(capabilit)m(y)g(in)f(CFITSIO.)
-g(F)-8 b(or)46 b(instance,)j(when)0 3388 y(reading)27
-b(a)h(FITS)f(image)h(with)e(BITPIX)i(=)f(-32)i(\(32-bit)f(\015oating)g
-(p)s(oin)m(t)f(pixels\),)g(read)g(the)h(data)g(in)m(to)g(a)g(single)0
-3501 y(precision)38 b(\015oating)i(p)s(oin)m(t)f(data)i(arra)m(y)f(in)f
-(the)h(program.)69 b(F)-8 b(orcing)40 b(CFITSIO)f(to)i(con)m(v)m(ert)g
-(the)f(data)h(to)g(a)0 3614 y(di\013eren)m(t)30 b(datat)m(yp)s(e)h(can)
-g(slo)m(w)f(the)g(program.)0 3774 y(7.)57 b(Where)36
-b(feasible,)g(design)f(FITS)g(binary)f(tables)h(using)f(v)m(ector)k
-(column)c(elemen)m(ts)i(so)g(that)g(the)g(data)h(are)0
-3887 y(written)29 b(as)h(a)g(con)m(tiguous)g(set)g(of)g(b)m(ytes,)g
-(rather)g(than)f(as)h(single)e(elemen)m(ts)i(in)f(m)m(ultiple)e(ro)m
-(ws.)41 b(F)-8 b(or)30 b(example,)0 4000 y(it)35 b(is)g(faster)h(to)g
-(access)h(the)f(data)h(in)d(a)i(table)g(that)g(con)m(tains)g(a)g
-(single)e(ro)m(w)i(and)f(2)h(columns)e(with)h(TF)m(ORM)0
-4113 y(k)m(eyw)m(ords)e(equal)g(to)h('10000E')h(and)e('10000J',)j(than)
-d(it)f(is)g(to)i(access)g(the)g(same)f(amoun)m(t)h(of)f(data)h(in)e(a)h
-(table)0 4226 y(with)39 b(10000)k(ro)m(ws)d(whic)m(h)g(has)g(columns)f
-(with)g(the)i(TF)m(ORM)g(k)m(eyw)m(ords)g(equal)f(to)h('1E')h(and)e
-('1J'.)h(In)f(the)0 4339 y(former)27 b(case)i(the)f(10000)i(\015oating)
-e(p)s(oin)m(t)f(v)-5 b(alues)27 b(in)g(the)h(\014rst)f(column)g(are)h
-(all)f(written)g(in)f(a)i(con)m(tiguous)g(blo)s(c)m(k)0
-4452 y(of)e(the)f(\014le)g(whic)m(h)f(can)i(b)s(e)f(read)g(or)g
-(written)g(quic)m(kly)-8 b(,)26 b(whereas)f(in)f(the)i(second)f(case)i
-(eac)m(h)g(\015oating)e(p)s(oin)m(t)f(v)-5 b(alue)0 4565
-y(in)33 b(the)h(\014rst)f(column)f(is)h(in)m(terlea)m(v)m(ed)i(with)d
-(the)i(in)m(teger)h(v)-5 b(alue)33 b(in)g(the)h(second)g(column)e(of)i
-(the)g(same)h(ro)m(w)f(so)0 4678 y(CFITSIO)29 b(has)h(to)h(explicitly)d
-(mo)m(v)m(e)k(to)f(the)g(p)s(osition)d(of)j(eac)m(h)g(elemen)m(t)g(to)g
-(b)s(e)f(read)g(or)g(written.)0 4838 y(8.)52 b(Av)m(oid)34
-b(the)h(use)e(of)i(v)-5 b(ariable)32 b(length)i(v)m(ector)i(columns)c
-(in)h(binary)g(tables,)i(since)e(an)m(y)i(reading)e(or)h(writing)0
-4951 y(of)f(these)g(data)g(requires)e(that)i(CFITSIO)f(\014rst)f(lo)s
-(ok)i(up)e(or)i(compute)g(the)f(starting)h(address)f(of)g(eac)m(h)i(ro)
-m(w)f(of)0 5064 y(data)e(in)e(the)i(heap.)0 5224 y(9.)79
-b(When)43 b(cop)m(ying)h(data)f(from)g(one)h(FITS)e(table)h(to)h
-(another,)j(it)42 b(is)h(faster)g(to)h(transfer)f(the)g(ra)m(w)g(b)m
-(ytes)0 5337 y(instead)27 b(of)i(reading)e(then)h(writing)e(eac)m(h)j
-(column)e(of)h(the)g(table.)40 b(The)28 b(CFITSIO)e(routines)h(\014ts)p
-3349 5337 V 33 w(read)p 3554 5337 V 32 w(tblb)m(ytes)0
-5450 y(and)36 b(\014ts)p 310 5450 V 32 w(write)p 545
-5450 V 32 w(tblb)m(ytes)h(will)d(p)s(erform)h(lo)m(w-lev)m(el)h(reads)h
-(or)f(writes)g(of)h(an)m(y)g(con)m(tiguous)f(range)h(of)g(b)m(ytes)g
-(in)0 5562 y(a)d(table)f(extension.)50 b(These)33 b(routines)g(can)g(b)
-s(e)g(used)g(to)h(read)f(or)h(write)f(a)g(whole)g(ro)m(w)h(\(or)g(m)m
-(ultiple)d(ro)m(ws)i(for)0 5675 y(ev)m(en)e(greater)h(e\016ciency\))g
-(of)f(a)g(table)g(with)e(a)i(single)f(function)f(call.)41
-b(These)31 b(routines)f(are)h(fast)g(b)s(ecause)g(they)p
+%%Page: 46 54
+46 53 bop 0 299 a Fj(46)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
+555 y Fe(int)47 b(fits_get_num_cols)c(/)48 b(ffgncl)286
+668 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*ncols,)f(int)h(*status\);)0
+921 y Fi(2)81 b Fj(Get)25 b(the)f(table)h(column)e(n)m(um)m(b)s(er)g
+(\(and)h(name\))h(of)f(the)h(column)e(whose)h(name)g(matc)m(hes)i(an)e
+(input)f(template)227 1034 y(name.)48 b(If)32 b(casesen)i(=)e(CASESEN)g
+(then)g(the)h(column)e(name)i(matc)m(h)h(will)c(b)s(e)i(case-sensitiv)m
+(e,)i(whereas)227 1147 y(if)26 b(casesen)i(=)e(CASEINSEN)g(then)h(the)g
+(case)h(will)c(b)s(e)i(ignored.)39 b(As)27 b(a)g(general)g(rule,)f(the)
+h(column)f(names)227 1260 y(should)j(b)s(e)g(treated)j(as)e(case)i
+(INsensitiv)m(e.)227 1409 y(The)26 b(input)f(column)g(name)h(template)h
+(ma)m(y)g(b)s(e)f(either)g(the)h(exact)h(name)e(of)h(the)f(column)f(to)
+j(b)s(e)d(searc)m(hed)227 1522 y(for,)k(or)f(it)g(ma)m(y)h(con)m(tain)g
+(wild)d(card)i(c)m(haracters)i(\(*,)g(?,)f(or)f(#\),)h(or)f(it)g(ma)m
+(y)h(con)m(tain)g(the)f(in)m(teger)h(n)m(um)m(b)s(er)227
+1635 y(of)k(the)f(desired)e(column)h(\(with)g(the)i(\014rst)e(column)g
+(=)h(1\).)46 b(The)32 b(`*')h(wild)d(card)i(c)m(haracter)h(matc)m(hes)h
+(an)m(y)227 1748 y(sequence)h(of)g(c)m(haracters)h(\(including)c(zero)j
+(c)m(haracters\))i(and)d(the)h(`?')53 b(c)m(haracter)36
+b(matc)m(hes)g(an)m(y)f(single)227 1861 y(c)m(haracter.)42
+b(The)29 b(#)h(wildcard)d(will)g(matc)m(h)k(an)m(y)e(consecutiv)m(e)i
+(string)e(of)g(decimal)g(digits)f(\(0-9\).)43 b(If)29
+b(more)227 1974 y(than)43 b(one)f(column)g(name)g(in)f(the)i(table)g
+(matc)m(hes)g(the)g(template)g(string,)i(then)d(the)h(\014rst)e(matc)m
+(h)j(is)227 2087 y(returned)28 b(and)h(the)g(status)h(v)-5
+b(alue)29 b(will)d(b)s(e)j(set)h(to)g(COL)p 2171 2087
+28 4 v 32 w(NOT)p 2408 2087 V 32 w(UNIQUE)f(as)h(a)f(w)m(arning)f(that)
+i(a)g(unique)227 2199 y(matc)m(h)e(w)m(as)g(not)f(found.)39
+b(T)-8 b(o)27 b(\014nd)f(the)h(other)g(cases)h(that)g(matc)m(h)g(the)g
+(template,)g(call)e(the)i(routine)e(again)227 2312 y(lea)m(ving)f(the)g
+(input)e(status)i(v)-5 b(alue)25 b(equal)f(to)i(COL)p
+1950 2312 V 32 w(NOT)p 2187 2312 V 32 w(UNIQUE)f(and)f(the)h(next)h
+(matc)m(hing)f(name)g(will)227 2425 y(then)30 b(b)s(e)g(returned.)40
+b(Rep)s(eat)30 b(this)g(pro)s(cess)g(un)m(til)e(a)j(status)g(=)f(COL)p
+2628 2425 V 32 w(NOT)p 2865 2425 V 32 w(F)m(OUND)i(is)d(returned.)227
+2574 y(The)36 b(FITS)g(Standard)g(recommends)g(that)i(only)d(letters,)k
+(digits,)e(and)f(the)h(underscore)f(c)m(haracter)j(b)s(e)227
+2687 y(used)32 b(in)g(column)g(names)g(\(with)g(no)h(em)m(b)s(edded)f
+(spaces\).)49 b(T)-8 b(railing)30 b(blank)i(c)m(haracters)i(are)f(not)h
+(signif-)227 2800 y(ican)m(t.)57 b(It)36 b(is)f(recommended)g(that)h
+(all)f(the)h(column)e(names)i(in)e(a)i(giv)m(en)g(table)g(b)s(e)f
+(unique)f(within)f(the)227 2913 y(\014rst)i(8)i(c)m(haracters,)h(and)e
+(strongly)f(recommended)g(that)i(the)f(names)g(b)s(e)f(unique)f(within)
+f(the)j(\014rst)f(16)227 3026 y(c)m(haracters.)95 3279
+y Fe(int)47 b(fits_get_colnum)d(/)j(ffgcno)286 3392 y(\(fitsfile)f
+(*fptr,)g(int)h(casesen,)e(char)i(*templt,)e(>)j(int)f(*colnum,)334
+3505 y(int)g(*status\))95 3731 y(int)g(fits_get_colname)d(/)j(ffgcnn)
+286 3844 y(\(fitsfile)f(*fptr,)g(int)h(casesen,)e(char)i(*templt,)e(>)j
+(char)e(*colname,)334 3957 y(int)h(*colnum,)f(int)g(*status\))0
+4210 y Fi(3)81 b Fj(Return)30 b(the)i(data)g(t)m(yp)s(e,)h(v)m(ector)g
+(rep)s(eat)f(v)-5 b(alue,)31 b(and)g(the)h(width)e(in)g(b)m(ytes)i(of)g
+(a)g(column)e(in)g(an)i(ASCI)s(I)e(or)227 4323 y(binary)k(table.)55
+b(Allo)m(w)m(ed)35 b(v)-5 b(alues)35 b(for)g(the)h(data)g(t)m(yp)s(e)f
+(in)f(ASCI)s(I)g(tables)h(are:)51 b(TSTRING,)35 b(TSHOR)-8
+b(T,)227 4436 y(TLONG,)36 b(TFLO)m(A)-8 b(T,)36 b(and)f(TDOUBLE.)i
+(Binary)d(tables)i(also)g(supp)s(ort)e(these)i(t)m(yp)s(es:)52
+b(TLOGICAL,)227 4549 y(TBIT,)38 b(TBYTE,)h(TCOMPLEX)e(and)h
+(TDBLCOMPLEX.)h(The)f(negativ)m(e)h(of)g(the)g(data)g(t)m(yp)s(e)g(co)s
+(de)227 4661 y(v)-5 b(alue)31 b(is)f(returned)g(if)g(it)g(is)h(a)g(v)-5
+b(ariable)30 b(length)g(arra)m(y)i(column.)42 b(Note)32
+b(that)g(in)d(the)j(case)g(of)f(a)g('J')h(32-bit)227
+4774 y(in)m(teger)f(binary)d(table)i(column,)f(this)g(routine)g(will)e
+(return)i(data)i(t)m(yp)s(e)f(=)g(TINT32BIT)g(\(whic)m(h)f(in)g(fact)
+227 4887 y(is)35 b(equiv)-5 b(alen)m(t)35 b(to)i(TLONG\).)f(With)f
+(most)h(curren)m(t)g(C)f(compilers,)h(a)h(v)-5 b(alue)35
+b(in)f(a)j('J')f(column)e(has)i(the)227 5000 y(same)29
+b(size)f(as)h(an)f('in)m(t')h(v)-5 b(ariable,)28 b(and)f(ma)m(y)j(not)e
+(b)s(e)g(equiv)-5 b(alen)m(t)28 b(to)h(a)g('long')f(v)-5
+b(ariable,)28 b(whic)m(h)f(is)h(64-bits)227 5113 y(long)i(on)h(an)f
+(increasing)f(n)m(um)m(b)s(er)g(of)h(compilers.)227 5262
+y(The)22 b('rep)s(eat')h(parameter)g(returns)f(the)g(v)m(ector)i(rep)s
+(eat)f(coun)m(t)g(on)f(the)h(binary)e(table)h(TF)m(ORMn)g(k)m(eyw)m
+(ord)227 5375 y(v)-5 b(alue.)59 b(\(ASCI)s(I)35 b(table)i(columns)e
+(alw)m(a)m(ys)i(ha)m(v)m(e)h(rep)s(eat)e(=)g(1\).)60
+b(The)36 b('width')f(parameter)i(returns)f(the)227 5488
+y(width)29 b(in)g(b)m(ytes)i(of)g(a)f(single)f(column)h(elemen)m(t)h
+(\(e.g.,)h(a)f('10D')h(binary)d(table)h(column)f(will)f(ha)m(v)m(e)k
+(width)227 5601 y(=)d(8,)i(an)e(ASCI)s(I)f(table)h('F12.2')j(column)d
+(will)e(ha)m(v)m(e)j(width)e(=)h(12,)i(and)e(a)h(binary)d(table'60A')k
+(c)m(haracter)227 5714 y(string)36 b(column)g(will)f(ha)m(v)m(e)j
+(width)e(=)h(60\);)42 b(Note)c(that)g(this)e(routine)h(supp)s(orts)e
+(the)i(lo)s(cal)g(con)m(v)m(en)m(tion)p eop
+%%Page: 47 55
+47 54 bop 0 299 a Fh(5.7.)72 b(ASCI)s(I)29 b(AND)i(BINAR)-8
+b(Y)31 b(T)-8 b(ABLE)31 b(R)m(OUTINES)1864 b Fj(47)227
+555 y(for)42 b(sp)s(ecifying)d(arra)m(ys)k(of)f(\014xed)f(length)g
+(strings)f(within)g(a)i(binary)e(table)h(c)m(haracter)j(column)c(using)
+227 668 y(the)h(syn)m(tax)g(TF)m(ORM)g(=)g('rAw')f(where)g('r')h(is)f
+(the)h(total)g(n)m(um)m(b)s(er)e(of)i(c)m(haracters)h(\(=)f(the)g
+(width)e(of)227 781 y(the)g(column\))f(and)f('w')i(is)e(the)i(width)e
+(of)h(a)h(unit)e(string)g(within)f(the)j(column.)64 b(Th)m(us)37
+b(if)g(the)i(column)227 894 y(has)34 b(TF)m(ORM)h(=)f('60A12')j(then)d
+(this)f(means)h(that)h(eac)m(h)g(ro)m(w)g(of)f(the)h(table)f(con)m
+(tains)g(5)h(12-c)m(haracter)227 1007 y(substrings)22
+b(within)g(the)i(60-c)m(haracter)j(\014eld,)e(and)e(th)m(us)h(in)f
+(this)g(case)i(this)f(routine)f(will)e(return)i(t)m(yp)s(eco)s(de)227
+1120 y(=)36 b(TSTRING,)f(rep)s(eat)h(=)f(60,)j(and)d(width)f(=)i(12.)57
+b(The)35 b(n)m(um)m(b)s(er)g(of)h(substings)e(in)g(an)m(y)i(binary)e
+(table)227 1233 y(c)m(haracter)i(string)d(\014eld)f(can)i(b)s(e)g
+(calculated)g(b)m(y)f(\(rep)s(eat/width\).)52 b(A)34
+b(n)m(ull)d(p)s(oin)m(ter)i(ma)m(y)i(b)s(e)e(giv)m(en)h(for)227
+1346 y(an)m(y)d(of)g(the)f(output)g(parameters)h(that)g(are)g(not)f
+(needed.)227 1499 y(The)46 b(second)g(routine,)j(\014t)p
+1188 1499 28 4 v 33 w(get)p 1341 1499 V 34 w(eqcolt)m(yp)s(e)d(is)f
+(similar)f(except)j(that)f(in)f(the)h(case)i(of)e(scaled)g(in)m(teger)
+227 1612 y(columns)34 b(it)g(returns)g(the)h('equiv)-5
+b(alen)m(t')35 b(data)h(t)m(yp)s(e)f(that)h(is)e(needed)g(to)i(store)g
+(the)f(scaled)g(v)-5 b(alues,)36 b(and)227 1725 y(not)28
+b(necessarily)f(the)h(ph)m(ysical)e(data)i(t)m(yp)s(e)g(of)g(the)g
+(unscaled)e(v)-5 b(alues)28 b(as)f(stored)h(in)f(the)g(FITS)g(table.)40
+b(F)-8 b(or)227 1838 y(example)37 b(if)g(a)h('1I')g(column)e(in)g(a)i
+(binary)e(table)h(has)h(TSCALn)d(=)j(1)f(and)g(TZER)m(On)f(=)i(32768,)j
+(then)227 1951 y(this)28 b(column)f(e\013ectiv)m(ely)j(con)m(tains)e
+(unsigned)f(short)h(in)m(teger)h(v)-5 b(alues,)28 b(and)g(th)m(us)h
+(the)f(returned)g(v)-5 b(alue)28 b(of)227 2064 y(t)m(yp)s(eco)s(de)34
+b(will)c(b)s(e)j(TUSHOR)-8 b(T,)32 b(not)h(TSHOR)-8 b(T.)33
+b(Similarly)-8 b(,)30 b(if)i(a)i(column)e(has)g(TTYPEn)g(=)h('1I')h
+(and)227 2177 y(TSCALn)29 b(=)h(0.12,)i(then)e(the)h(returned)e(t)m(yp)
+s(eco)s(de)i(will)c(b)s(e)j(TFLO)m(A)-8 b(T.)95 2443
+y Fe(int)47 b(fits_get_coltype)d(/)j(ffgtcl)286 2556
+y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(>)j(int)f(*typecode,)e(long)h
+(*repeat,)334 2669 y(long)h(*width,)f(int)g(*status\))95
+2895 y(int)h(fits_get_eqcoltype)c(/)48 b(ffeqty)286 3008
+y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(>)j(int)f(*typecode,)e(long)h
+(*repeat,)334 3121 y(long)h(*width,)f(int)g(*status\))0
+3388 y Fi(4)81 b Fj(Return)29 b(the)h(displa)m(y)e(width)g(of)i(a)h
+(column.)39 b(This)28 b(is)h(the)h(length)g(of)g(the)g(string)f(that)i
+(will)c(b)s(e)i(returned)g(b)m(y)227 3500 y(the)34 b(\014ts)p
+514 3500 V 32 w(read)p 718 3500 V 33 w(col)f(routine)f(when)g(reading)g
+(the)i(column)d(as)j(a)f(formatted)h(string.)48 b(The)32
+b(displa)m(y)g(width)227 3613 y(is)c(determined)g(b)m(y)h(the)g(TDISPn)
+f(k)m(eyw)m(ord,)i(if)e(presen)m(t,)i(otherwise)e(b)m(y)h(the)g(data)h
+(t)m(yp)s(e)f(of)h(the)f(column.)95 3993 y Fe(int)47
+b(fits_get_col_display_width)41 b(/)47 b(ffgcdw)286 4106
+y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(>)j(int)f(*dispwidth,)e(int)h
+(*status\))0 4372 y Fi(5)81 b Fj(Return)27 b(the)i(n)m(um)m(b)s(er)e
+(of)i(and)e(size)i(of)f(the)h(dimensions)d(of)i(a)h(table)f(column)g
+(in)f(a)h(binary)f(table.)40 b(Normally)227 4485 y(this)27
+b(information)g(is)g(giv)m(en)h(b)m(y)g(the)h(TDIMn)f(k)m(eyw)m(ord,)h
+(but)e(if)h(this)f(k)m(eyw)m(ord)h(is)f(not)i(presen)m(t)f(then)g(this)
+227 4598 y(routine)i(returns)f(naxis)g(=)h(1)h(and)f(naxes[0])h(equal)f
+(to)h(the)g(rep)s(eat)f(coun)m(t)h(in)e(the)i(TF)m(ORM)g(k)m(eyw)m
+(ord.)95 4865 y Fe(int)47 b(fits_read_tdim)d(/)k(ffgtdm)286
+4978 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(int)i(maxdim,)f(>)i(int)f
+(*naxis,)334 5091 y(long)g(*naxes,)f(int)g(*status\))0
+5357 y Fi(6)81 b Fj(Deco)s(de)33 b(the)g(input)e(TDIMn)i(k)m(eyw)m(ord)
+g(string)e(\(e.g.)50 b('\(100,200\)'\))37 b(and)32 b(return)g(the)h(n)m
+(um)m(b)s(er)e(of)i(and)f(size)227 5470 y(of)c(the)g(dimensions)d(of)j
+(a)g(binary)e(table)h(column.)39 b(If)27 b(the)h(input)e(tdimstr)g(c)m
+(haracter)j(string)e(is)g(n)m(ull,)f(then)227 5583 y(this)e(routine)f
+(returns)g(naxis)g(=)i(1)f(and)g(naxes[0])i(equal)d(to)j(the)e(rep)s
+(eat)h(coun)m(t)g(in)e(the)h(TF)m(ORM)h(k)m(eyw)m(ord.)227
+5696 y(This)k(routine)g(is)h(called)f(b)m(y)h(\014ts)p
+1350 5696 V 33 w(read)p 1555 5696 V 33 w(tdim.)p eop
+%%Page: 48 56
+48 55 bop 0 299 a Fj(48)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
+555 y Fe(int)47 b(fits_decode_tdim)d(/)j(ffdtdm)286 668
+y(\(fitsfile)f(*fptr,)g(char)g(*tdimstr,)g(int)h(colnum,)e(int)i
+(maxdim,)f(>)i(int)e(*naxis,)334 781 y(long)h(*naxes,)f(int)g
+(*status\))0 1036 y Fi(7)81 b Fj(W)-8 b(rite)22 b(a)h(TDIMn)f(k)m(eyw)m
+(ord)h(whose)f(v)-5 b(alue)22 b(has)h(the)f(form)g('\(l,m,n...\)')39
+b(where)22 b(l,)h(m,)h(n...)38 b(are)23 b(the)g(dimensions)227
+1149 y(of)31 b(a)g(m)m(ultidimension)26 b(arra)m(y)31
+b(column)e(in)g(a)i(binary)d(table.)95 1403 y Fe(int)47
+b(fits_write_tdim)d(/)j(ffptdm)286 1516 y(\(fitsfile)f(*fptr,)g(int)h
+(colnum,)e(int)i(naxis,)f(long)h(*naxes,)f(>)h(int)g(*status\))0
+1806 y Fd(5.7.3)112 b(Routines)37 b(to)g(Edit)f(Ro)m(ws)h(or)g(Columns)
+0 2014 y Fi(1)81 b Fj(Insert)22 b(or)h(delete)g(ro)m(ws)f(in)g(an)h
+(ASCI)s(I)e(or)i(binary)e(table.)38 b(When)22 b(inserting)f(ro)m(ws)i
+(all)f(the)h(ro)m(ws)g(follo)m(wing)e(ro)m(w)227 2127
+y(FR)m(O)m(W)29 b(are)f(shifted)f(do)m(wn)g(b)m(y)h(NR)m(O)m(WS)g(ro)m
+(ws;)h(if)e(FR)m(O)m(W)i(=)e(0)h(then)f(the)h(blank)f(ro)m(ws)h(are)g
+(inserted)e(at)227 2240 y(the)h(b)s(eginning)d(of)j(the)f(table.)40
+b(The)26 b(\014rst)g(delete)h(routine)e(deletes)i(NR)m(O)m(WS)g
+(consecutiv)m(e)h(ro)m(ws)e(starting)227 2353 y(with)i(ro)m(w)i(FIRSTR)
+m(O)m(W.)g(The)f(second)g(delete)h(routine)e(tak)m(es)j(an)e(input)f
+(string)g(that)i(lists)e(the)i(ro)m(ws)f(or)227 2466
+y(ro)m(w)24 b(ranges)f(\(e.g.,)k('5-10,12,20-30'\),)k(whereas)23
+b(the)h(third)d(delete)j(routine)e(tak)m(es)j(an)e(input)f(in)m(teger)h
+(arra)m(y)227 2579 y(that)35 b(sp)s(eci\014es)e(eac)m(h)i(individual)30
+b(ro)m(w)k(to)h(b)s(e)f(deleted.)52 b(In)34 b(b)s(oth)f(latter)i
+(cases,)h(the)e(input)f(list)g(of)h(ro)m(ws)227 2692
+y(to)e(delete)f(m)m(ust)f(b)s(e)g(sorted)h(in)e(ascending)h(order.)41
+b(These)31 b(routines)e(up)s(date)h(the)h(NAXIS2)g(k)m(eyw)m(ord)g(to)
+227 2805 y(re\015ect)g(the)g(new)f(n)m(um)m(b)s(er)f(of)h(ro)m(ws)h(in)
+e(the)h(table.)95 3059 y Fe(int)47 b(fits_insert_rows)d(/)j(ffirow)286
+3172 y(\(fitsfile)f(*fptr,)g(long)g(firstrow,)g(long)g(nrows,)g(>)i
+(int)f(*status\))95 3398 y(int)g(fits_delete_rows)d(/)j(ffdrow)286
+3511 y(\(fitsfile)f(*fptr,)g(long)g(firstrow,)g(long)g(nrows,)g(>)i
+(int)f(*status\))95 3737 y(int)g(fits_delete_rowrange)c(/)k(ffdrrg)286
+3850 y(\(fitsfile)f(*fptr,)g(char)g(*rangelist,)f(>)j(int)e(*status\))
+95 4075 y(int)h(fits_delete_rowlist)c(/)k(ffdrws)286
+4188 y(\(fitsfile)f(*fptr,)g(long)g(*rowlist,)g(long)g(nrows,)g(>)i
+(int)f(*status\))0 4443 y Fi(2)81 b Fj(Insert)36 b(or)h(delete)h
+(column\(s\))e(in)g(an)h(ASCI)s(I)f(or)h(binary)e(table.)61
+b(When)37 b(inserting,)g(COLNUM)g(sp)s(eci\014es)227
+4556 y(the)28 b(column)f(n)m(um)m(b)s(er)g(that)h(the)g(\(\014rst\))g
+(new)f(column)g(should)f(o)s(ccup)m(y)i(in)f(the)h(table.)40
+b(NCOLS)26 b(sp)s(eci\014es)227 4669 y(ho)m(w)35 b(man)m(y)g(columns)e
+(are)i(to)g(b)s(e)f(inserted.)52 b(An)m(y)35 b(existing)f(columns)f
+(from)h(this)g(p)s(osition)e(and)i(higher)227 4782 y(are)c(shifted)e(o)
+m(v)m(er)i(to)g(allo)m(w)e(ro)s(om)h(for)g(the)h(new)e(column\(s\).)40
+b(The)29 b(index)e(n)m(um)m(b)s(er)h(on)h(all)f(the)h(follo)m(wing)227
+4895 y(k)m(eyw)m(ords)34 b(will)c(b)s(e)j(incremen)m(ted)g(or)g
+(decremen)m(ted)h(if)e(necessary)i(to)g(re\015ect)g(the)f(new)g(p)s
+(osition)e(of)j(the)227 5008 y(column\(s\))25 b(in)f(the)i(table:)38
+b(TBCOLn,)26 b(TF)m(ORMn,)h(TTYPEn,)e(TUNITn,)h(TNULLn,)g(TSCALn,)f
+(TZE-)227 5120 y(R)m(On,)43 b(TDISPn,)g(TDIMn,)g(TLMINn,)g(TLMAXn,)g
+(TDMINn,)g(TDMAXn,)h(TCTYPn,)e(TCRPXn,)227 5233 y(TCR)-10
+b(VLn,)29 b(TCDL)-8 b(Tn,)30 b(TCR)m(OTn,)f(and)h(TCUNIn.)95
+5488 y Fe(int)47 b(fits_insert_col)d(/)j(fficol)286 5601
+y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(char)i(*ttype,)f(char)h
+(*tform,)334 5714 y(>)h(int)e(*status\))p eop
+%%Page: 49 57
+49 56 bop 0 299 a Fh(5.7.)72 b(ASCI)s(I)29 b(AND)i(BINAR)-8
+b(Y)31 b(T)-8 b(ABLE)31 b(R)m(OUTINES)1864 b Fj(49)95
+668 y Fe(int)47 b(fits_insert_cols)d(/)j(fficls)286 781
+y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(int)i(ncols,)f(char)h(**ttype,)
+334 894 y(char)g(**tform,)e(>)j(int)f(*status\))95 1120
+y(int)g(fits_delete_col)d(/)j(ffdcol\(fitsfile)d(*fptr,)i(int)h
+(colnum,)f(>)h(int)g(*status\))0 1372 y Fi(3)81 b Fj(Cop)m(y)32
+b(a)h(column)f(from)g(one)h(HDU)g(to)h(another)e(\(or)h(to)h(the)f
+(same)g(HDU\).)h(If)e(create)p 3129 1372 28 4 v 34 w(col)h(=)f(TR)m
+(UE,)h(then)227 1485 y(a)40 b(new)e(column)g(will)e(b)s(e)j(inserted)f
+(in)f(the)i(output)g(table,)i(at)f(p)s(osition)d(`outcolumn',)k
+(otherwise)e(the)227 1598 y(existing)e(output)h(column)e(will)g(b)s(e)h
+(o)m(v)m(erwritten)h(\(in)f(whic)m(h)g(case)i(it)e(m)m(ust)h(ha)m(v)m
+(e)h(a)f(compatible)f(data)227 1711 y(t)m(yp)s(e\).)k(If)29
+b(outcoln)m(um)g(is)f(greater)j(than)e(the)h(n)m(um)m(b)s(er)e(of)h
+(column)f(in)g(the)i(table,)g(then)f(the)g(new)g(column)227
+1823 y(will)g(b)s(e)i(app)s(ended)f(to)j(the)f(end)f(of)g(the)h(table.)
+45 b(Note)33 b(that)f(the)g(\014rst)f(column)f(in)h(a)h(table)f(is)g
+(at)i(coln)m(um)227 1936 y(=)j(1.)58 b(The)36 b(standard)f(indexed)f(k)
+m(eyw)m(ords)j(that)f(related)g(to)h(the)f(column)f(\(e.g.,)k(TDISPn,)e
+(TUNITn,)227 2049 y(TCRPXn,)30 b(TCDL)-8 b(Tn,)29 b(etc.\))43
+b(will)27 b(also)k(b)s(e)e(copied.)95 2301 y Fe(int)47
+b(fits_copy_col)e(/)i(ffcpcl)286 2414 y(\(fitsfile)f(*infptr,)f
+(fitsfile)h(*outfptr,)f(int)i(incolnum,)e(int)i(outcolnum,)334
+2527 y(int)g(create_col,)e(>)i(int)g(*status\);)0 2779
+y Fi(4)81 b Fj(Mo)s(dify)36 b(the)h(v)m(ector)i(length)e(of)g(a)h
+(binary)d(table)i(column)f(\(e.g.,)41 b(c)m(hange)e(a)e(column)f(from)h
+(TF)m(ORMn)g(=)227 2892 y('1E')31 b(to)h('20E'\).)g(The)e(v)m(ector)i
+(length)d(ma)m(y)i(b)s(e)f(increased)g(or)g(decreased)h(from)f(the)g
+(curren)m(t)h(v)-5 b(alue.)95 3144 y Fe(int)47 b
+(fits_modify_vector_len)42 b(/)48 b(ffmvec)286 3257 y(\(fitsfile)e
+(*fptr,)g(int)h(colnum,)e(long)i(newveclen,)e(>)j(int)e(*status\))0
+3547 y Fd(5.7.4)112 b(Read)38 b(and)h(W)-9 b(rite)35
+b(Column)i(Data)g(Routines)0 3766 y Fj(The)e(follo)m(wing)e(routines)i
+(write)f(or)h(read)g(data)h(v)-5 b(alues)35 b(in)f(the)h(curren)m(t)g
+(ASCI)s(I)f(or)h(binary)f(table)h(extension.)0 3878 y(If)e(a)g(write)f
+(op)s(eration)h(extends)g(b)s(ey)m(ond)f(the)h(curren)m(t)g(size)g(of)g
+(the)g(table,)h(then)f(the)g(n)m(um)m(b)s(er)f(of)h(ro)m(ws)g(in)f(the)
+0 3991 y(table)i(will)e(automatically)i(b)s(e)f(increased)h(and)f(the)i
+(NAXIS2)f(k)m(eyw)m(ord)h(v)-5 b(alue)34 b(will)d(b)s(e)j(up)s(dated.)
+51 b(A)m(ttempts)0 4104 y(to)31 b(read)f(b)s(ey)m(ond)g(the)h(end)e(of)
+i(the)f(table)h(will)c(result)j(in)f(an)h(error.)0 4264
+y(Automatic)c(data)f(t)m(yp)s(e)g(con)m(v)m(ersion)g(is)f(p)s(erformed)
+g(for)g(n)m(umerical)g(data)h(t)m(yp)s(es)g(\(only\))g(if)f(the)h(data)
+h(t)m(yp)s(e)f(of)g(the)0 4377 y(column)f(\(de\014ned)h(b)m(y)g(the)h
+(TF)m(ORMn)f(k)m(eyw)m(ord\))h(di\013ers)e(from)h(the)h(data)g(t)m(yp)s
+(e)f(of)h(the)f(calling)f(routine.)38 b(ASCI)s(I)0 4490
+y(and)20 b(binary)e(tables)i(supp)s(ort)f(the)i(follo)m(wing)d(data)j
+(t)m(yp)s(e)g(v)-5 b(alues:)35 b(TSTRING,)20 b(TBYTE,)g(TSBYTE,)g
+(TSHOR)-8 b(T,)0 4603 y(TUSHOR)g(T,)22 b(TINT,)g(TUINT,)f(TLONG,)i
+(TLONGLONG,)f(TULONG,)g(TFLO)m(A)-8 b(T,)23 b(or)f(TDOUBLE.)h(Binary)0
+4716 y(tables)37 b(also)g(supp)s(ort)e(TLOGICAL)h(\(in)m(ternally)g
+(mapp)s(ed)g(to)h(the)h(`c)m(har')g(data)g(t)m(yp)s(e\),)h(TCOMPLEX,)e
+(and)0 4829 y(TDBLCOMPLEX.)0 4989 y(Note)25 b(that)g(within)c(the)j
+(con)m(text)i(of)e(these)g(routines,)h(the)f(TSTRING)f(data)h(t)m(yp)s
+(e)g(corresp)s(onds)f(to)h(a)h(C)e('c)m(har**')0 5102
+y(data)35 b(t)m(yp)s(e,)h(i.e.,)g(a)f(p)s(oin)m(ter)e(to)j(an)e(arra)m
+(y)h(of)g(p)s(oin)m(ters)e(to)i(an)g(arra)m(y)g(of)g(c)m(haracters.)54
+b(This)33 b(is)g(di\013eren)m(t)h(from)0 5215 y(the)e(k)m(eyw)m(ord)h
+(reading)e(and)g(writing)f(routines)h(where)h(TSTRING)f(corresp)s(onds)
+g(to)h(a)h(C)e('c)m(har*')j(data)f(t)m(yp)s(e,)0 5328
+y(i.e.,)f(a)f(single)f(p)s(oin)m(ter)g(to)i(an)f(arra)m(y)g(of)g(c)m
+(haracters.)45 b(When)30 b(reading)h(strings)e(from)i(a)g(table,)h(the)
+f(c)m(har)h(arra)m(ys)0 5441 y(ob)m(viously)d(m)m(ust)h(ha)m(v)m(e)i(b)
+s(een)e(allo)s(cated)g(long)g(enough)g(to)h(hold)e(the)i(whole)e(FITS)h
+(table)g(string.)0 5601 y(Numerical)h(data)i(v)-5 b(alues)32
+b(are)h(automatically)g(scaled)f(b)m(y)g(the)h(TSCALn)e(and)h(TZER)m
+(On)f(k)m(eyw)m(ord)i(v)-5 b(alues)32 b(\(if)0 5714 y(they)f(exist\).)p
 eop
-%%Page: 59 65
-59 64 bop 0 299 a Fh(5.15.)73 b(OPTIMIZING)29 b(CODE)h(F)m(OR)h
-(MAXIMUM)g(PR)m(OCESSING)f(SPEED)971 b Fj(59)0 555 y(b)m(ypass)36
-b(all)f(the)i(usual)e(data)i(scaling,)g(error)f(c)m(hec)m(king)h(and)f
-(mac)m(hine)g(dep)s(enden)m(t)f(data)i(con)m(v)m(ersion)g(that)g(is)0
-668 y(normally)e(done)i(b)m(y)f(CFITSIO,)g(and)g(they)h(allo)m(w)f(the)
-i(program)e(to)i(write)e(the)h(data)g(to)h(the)f(output)f(\014le)g(in)0
-781 y(exactly)29 b(the)f(same)h(b)m(yte)g(order.)40 b(F)-8
-b(or)29 b(these)f(same)h(reasons,)g(these)g(routines)e(can)h(corrupt)g
-(the)g(FITS)g(data)h(\014le)0 894 y(if)35 b(used)f(incorrectly)h(b)s
-(ecause)h(no)f(v)-5 b(alidation)34 b(or)i(mac)m(hine)f(dep)s(enden)m(t)
-f(con)m(v)m(ersion)i(is)f(p)s(erformed)f(b)m(y)h(these)0
-1007 y(routines.)54 b(These)35 b(routines)f(are)i(only)e(recommended)h
-(for)g(optimizing)e(critical)h(pieces)h(of)h(co)s(de)f(and)g(should)0
-1120 y(only)d(b)s(e)h(used)g(b)m(y)g(programmers)g(who)g(thoroughly)f
-(understand)f(the)j(in)m(ternal)e(format)i(of)f(the)h(FITS)e(tables)0
-1233 y(they)f(are)f(reading)g(or)g(writing.)0 1393 y(10.)41
-b(Another)30 b(strategy)g(for)g(impro)m(ving)d(the)j(sp)s(eed)e(of)i
-(writing)e(a)h(FITS)g(table,)h(similar)d(to)j(the)f(previous)f(one,)0
-1506 y(is)j(to)h(directly)f(construct)h(the)f(en)m(tire)h(b)m(yte)g
-(stream)g(for)g(a)g(whole)f(table)g(ro)m(w)h(\(or)g(m)m(ultiple)e(ro)m
-(ws\))i(within)d(the)0 1619 y(application)f(program)h(and)g(then)h
-(write)f(it)g(to)h(the)g(FITS)f(\014le)g(with)f(\014ts)p
-2520 1619 28 4 v 32 w(write)p 2755 1619 V 32 w(tblb)m(ytes.)40
-b(This)28 b(a)m(v)m(oids)i(all)f(the)0 1732 y(o)m(v)m(erhead)h
-(normally)e(presen)m(t)h(in)f(the)i(column-orien)m(ted)e(CFITSIO)g
-(write)g(routines.)39 b(This)28 b(tec)m(hnique)h(should)0
-1844 y(only)j(b)s(e)g(used)g(for)g(critical)g(applications,)g(b)s
-(ecause)g(it)g(mak)m(es)i(the)f(co)s(de)g(more)g(di\016cult)d(to)k
-(understand)d(and)0 1957 y(main)m(tain,)36 b(and)f(it)g(mak)m(es)h(the)
-g(co)s(de)f(more)h(system)g(dep)s(enden)m(t)e(\(e.g.,)39
-b(do)c(the)h(b)m(ytes)g(need)f(to)h(b)s(e)f(sw)m(app)s(ed)0
-2070 y(b)s(efore)30 b(writing)e(to)j(the)g(FITS)f(\014le?\).)0
-2230 y(11.)53 b(Finally)-8 b(,)34 b(external)g(factors)i(suc)m(h)e(as)g
-(the)h(t)m(yp)s(e)f(of)h(magnetic)f(disk)f(con)m(troller)h(\(SCSI)f(or)
-i(IDE\),)g(the)f(size)0 2343 y(of)h(the)g(disk)f(cac)m(he,)k(the)d(a)m
-(v)m(erage)i(seek)f(sp)s(eed)e(of)h(the)g(disk,)g(the)g(amoun)m(t)h(of)
-f(disk)e(fragmen)m(tation,)k(and)e(the)0 2456 y(amoun)m(t)29
-b(of)g(RAM)f(a)m(v)-5 b(ailable)28 b(on)h(the)f(system)h(can)g(all)e
-(ha)m(v)m(e)j(a)f(signi\014can)m(t)e(impact)i(on)f(o)m(v)m(erall)h(I/O)
-f(e\016ciency)-8 b(.)0 2569 y(F)g(or)36 b(critical)e(applications,)g(a)
-i(system)f(administrator)e(should)g(review)h(the)i(prop)s(osed)d
-(system)j(hardw)m(are)e(to)0 2682 y(iden)m(tify)29 b(an)m(y)i(p)s(oten)
-m(tial)e(I/O)i(b)s(ottlenec)m(ks.)p eop
-%%Page: 60 66
-60 65 bop 0 299 a Fj(60)1211 b Fh(CHAPTER)30 b(5.)71
-b(CFITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)p eop
-%%Page: 61 67
-61 66 bop 0 1225 a Fg(Chapter)65 b(6)0 1687 y Fm(The)77
-b(CFITSIO)f(Iterator)i(F)-19 b(unction)0 2180 y Fj(The)41
-b(\014ts)p 325 2180 28 4 v 33 w(iterate)p 615 2180 V
-33 w(data)i(function)d(in)h(CFITSIO)f(pro)m(vides)h(a)h(unique)d(metho)
-s(d)j(of)g(executing)g(an)f(arbitrary)0 2293 y(user-supplied)33
-b(`w)m(ork')k(function)e(that)i(op)s(erates)g(on)g(ro)m(ws)f(of)h(data)
-g(in)e(FITS)h(tables)g(or)g(on)h(pixels)d(in)i(FITS)0
-2406 y(images.)i(Rather)24 b(than)e(explicitly)f(reading)h(and)h
-(writing)e(the)i(FITS)g(images)g(or)g(columns)f(of)h(data,)i(one)f
-(instead)0 2518 y(calls)34 b(the)i(CFITSIO)d(iterator)j(routine,)g
-(passing)e(to)i(it)f(the)g(name)g(of)h(the)f(user's)g(w)m(ork)g
-(function)f(that)i(is)e(to)0 2631 y(b)s(e)c(executed)h(along)f(with)f
-(a)i(list)e(of)h(all)f(the)i(table)f(columns)f(or)h(image)g(arra)m(ys)h
-(that)g(are)f(to)h(b)s(e)f(passed)g(to)h(the)0 2744 y(w)m(ork)37
-b(function.)60 b(The)37 b(CFITSIO)e(iterator)j(function)e(then)h(do)s
-(es)g(all)f(the)h(w)m(ork)g(of)h(allo)s(cating)e(memory)h(for)0
-2857 y(the)28 b(arra)m(ys,)h(reading)e(the)h(input)d(data)k(from)e(the)
-h(FITS)f(\014le,)g(passing)g(them)h(to)g(the)g(w)m(ork)g(function,)f
-(and)g(then)0 2970 y(writing)34 b(an)m(y)j(output)f(data)h(bac)m(k)h
-(to)f(the)f(FITS)g(\014le)f(after)i(the)g(w)m(ork)g(function)e(exits.)
-58 b(Because)38 b(it)e(is)g(often)0 3083 y(more)h(e\016cien)m(t)h(to)g
-(pro)s(cess)f(only)f(a)i(subset)f(of)g(the)g(total)h(table)g(ro)m(ws)f
-(at)h(one)f(time,)i(the)f(iterator)f(function)0 3196
-y(can)f(determine)f(the)i(optim)m(um)e(amoun)m(t)h(of)g(data)h(to)g
-(pass)e(in)g(eac)m(h)i(iteration)f(and)f(rep)s(eatly)g(call)h(the)g(w)m
-(ork)0 3309 y(function)29 b(un)m(til)g(the)h(en)m(tire)h(table)f(b)s
-(een)f(pro)s(cessed.)0 3469 y(F)-8 b(or)37 b(man)m(y)f(applications)e
-(this)g(single)h(CFITSIO)f(iterator)j(function)d(can)i(e\013ectiv)m
-(ely)h(replace)f(all)f(the)h(other)0 3582 y(CFITSIO)g(routines)h(for)g
-(reading)g(or)g(writing)f(data)i(in)e(FITS)h(images)h(or)f(tables.)63
-b(Using)36 b(the)i(iterator)g(has)0 3695 y(sev)m(eral)31
-b(imp)s(ortan)m(t)e(adv)-5 b(an)m(tages)32 b(o)m(v)m(er)g(the)f
-(traditional)d(metho)s(d)i(of)h(reading)e(and)h(writing)e(FITS)i(data)h
-(\014les:)136 3961 y Fc(\017)46 b Fj(It)33 b(cleanly)f(separates)i(the)
-f(data)h(I/O)f(from)f(the)h(routine)f(that)i(op)s(erates)f(on)g(the)g
-(data.)49 b(This)31 b(leads)h(to)227 4074 y(a)f(more)g(mo)s(dular)d
-(and)i(`ob)5 b(ject)31 b(orien)m(ted')g(programming)e(st)m(yle.)136
-4268 y Fc(\017)46 b Fj(It)27 b(simpli\014es)c(the)k(application)e
-(program)i(b)m(y)f(eliminating)e(the)j(need)g(to)g(allo)s(cate)g
-(memory)g(for)f(the)h(data)227 4381 y(arra)m(ys)e(and)f(eliminates)f
-(most)h(of)h(the)f(calls)g(to)h(the)g(CFITSIO)d(routines)i(that)h
-(explicitly)d(read)i(and)g(write)227 4494 y(the)31 b(data.)136
-4689 y Fc(\017)46 b Fj(It)32 b(ensures)e(that)i(the)g(data)g(are)g(pro)
-s(cessed)f(as)h(e\016cien)m(tly)f(as)g(p)s(ossible.)42
-b(This)30 b(is)g(esp)s(ecially)g(imp)s(ortan)m(t)227
-4801 y(when)44 b(pro)s(cessing)f(tabular)h(data)i(since)e(the)h
-(iterator)g(function)e(will)f(calculate)j(the)g(most)g(e\016cien)m(t)
-227 4914 y(n)m(um)m(b)s(er)36 b(of)i(ro)m(ws)g(in)e(the)i(table)f(to)h
-(b)s(e)f(passed)g(at)i(one)e(time)h(to)g(the)g(user's)e(w)m(ork)i
-(function)e(on)i(eac)m(h)227 5027 y(iteration.)136 5222
-y Fc(\017)46 b Fj(Mak)m(es)39 b(it)d(p)s(ossible)f(for)i(larger)g(pro)5
-b(jects)37 b(to)h(dev)m(elop)f(a)h(library)c(of)k(w)m(ork)f(functions)f
-(that)h(all)f(ha)m(v)m(e)j(a)227 5335 y(uniform)28 b(calling)h
-(sequence)i(and)f(are)h(all)e(indep)s(enden)m(t)f(of)j(the)f(details)g
-(of)g(the)h(FITS)e(\014le)h(format.)0 5601 y(There)g(are)h(basically)e
-(2)j(steps)e(in)g(using)f(the)i(CFITSIO)e(iterator)i(function.)41
-b(The)30 b(\014rst)g(step)h(is)f(to)h(design)f(the)0
-5714 y(w)m(ork)c(function)e(itself)g(whic)m(h)g(m)m(ust)i(ha)m(v)m(e)g
-(a)g(prescrib)s(ed)d(set)j(of)g(input)e(parameters.)39
-b(One)25 b(of)h(these)g(parameters)1905 5942 y(61)p eop
-%%Page: 62 68
-62 67 bop 0 299 a Fj(62)1455 b Fh(CHAPTER)30 b(6.)112
-b(THE)30 b(CFITSIO)e(ITERA)-8 b(TOR)30 b(FUNCTION)0 555
-y Fj(is)e(a)h(structure)g(con)m(taining)g(p)s(oin)m(ters)e(to)j(the)f
-(arra)m(ys)h(of)f(data;)h(the)f(w)m(ork)h(function)d(can)j(p)s(erform)d
-(an)m(y)i(desired)0 668 y(op)s(erations)j(on)i(these)f(arra)m(ys)h(and)
-e(do)s(es)h(not)g(need)g(to)h(w)m(orry)f(ab)s(out)g(ho)m(w)g(the)h
-(input)d(data)j(w)m(ere)f(read)g(from)0 781 y(the)e(\014le)e(or)h(ho)m
-(w)h(the)f(output)g(data)h(get)h(written)d(bac)m(k)i(to)h(the)e
-(\014le.)0 941 y(The)24 b(second)h(step)g(is)e(to)j(design)d(the)i
-(driv)m(er)f(routine)f(that)j(op)s(ens)e(all)f(the)i(necessary)g(FITS)f
-(\014les)g(and)g(initializes)0 1054 y(the)41 b(input)f(parameters)h(to)
-h(the)g(iterator)f(function.)72 b(The)41 b(driv)m(er)f(program)h(calls)
-f(the)i(CFITSIO)e(iterator)0 1167 y(function)29 b(whic)m(h)g(then)h
-(reads)g(the)h(data)g(and)f(passes)g(it)g(to)h(the)g(user's)e(w)m(ork)i
-(function.)0 1327 y(The)20 b(follo)m(wing)f(2)i(sections)f(describ)s(e)
-f(these)i(steps)g(in)e(more)h(detail.)37 b(There)20 b(are)h(also)f(sev)
-m(eral)h(example)f(programs)0 1440 y(included)28 b(with)h(the)h
-(CFITSIO)f(distribution)e(whic)m(h)i(illustrate)g(ho)m(w)h(to)h(use)f
-(the)h(iterator)f(function.)0 1789 y Fe(6.1)135 b(The)45
-b(Iterator)h(W)-11 b(ork)45 b(F)-11 b(unction)0 2043
-y Fj(The)42 b(user-supplied)d(iterator)k(w)m(ork)g(function)e(m)m(ust)h
-(ha)m(v)m(e)i(the)f(follo)m(wing)e(set)i(of)g(input)d(parameters)j
-(\(the)0 2156 y(function)29 b(can)i(b)s(e)e(giv)m(en)i(an)m(y)g
-(desired)d(name\):)95 2429 y Ff(int)47 b(user_fn\()f(long)h(totaln,)e
-(long)i(offset,)f(long)g(firstn,)g(long)h(nvalues,)716
-2542 y(int)g(narrays,)e(iteratorCol)g(*data,)94 b(void)47
-b(*userPointer)d(\))136 2815 y Fc(\017)i Fj(totaln)23
-b({)g(the)f(total)i(n)m(um)m(b)s(er)d(of)h(table)h(ro)m(ws)f(or)g
-(image)h(pixels)e(that)i(will)c(b)s(e)j(passed)g(to)h(the)g(w)m(ork)f
-(function)227 2928 y(during)28 b(1)j(or)g(more)f(iterations.)136
-3129 y Fc(\017)46 b Fj(o\013set)d({)f(the)h(o\013set)f(applied)e(to)j
-(the)f(\014rst)f(table)h(ro)m(w)g(or)g(image)g(pixel)e(to)j(b)s(e)e
-(passed)g(to)i(the)f(w)m(ork)227 3241 y(function.)54
-b(In)34 b(other)i(w)m(ords,)g(this)e(is)g(the)h(n)m(um)m(b)s(er)f(of)h
-(ro)m(ws)h(or)f(pixels)e(that)j(are)f(skipp)s(ed)e(o)m(v)m(er)j(b)s
-(efore)227 3354 y(starting)29 b(the)h(iterations.)40
-b(If)28 b(o\013set)j(=)e(0,)h(then)f(all)f(the)h(table)h(ro)m(ws)f(or)g
-(image)h(pixels)d(will)g(b)s(e)h(passed)h(to)227 3467
-y(the)i(w)m(ork)f(function.)136 3668 y Fc(\017)46 b Fj(\014rstn)26
-b({)i(the)f(n)m(um)m(b)s(er)f(of)i(the)f(\014rst)g(table)g(ro)m(w)g(or)
-g(image)h(pixel)d(\(starting)j(with)e(1\))i(that)f(is)g(b)s(eing)e
-(passed)227 3781 y(in)k(this)h(particular)e(call)i(to)h(the)g(w)m(ork)f
-(function.)136 3982 y Fc(\017)46 b Fj(n)m(v)-5 b(alues)34
-b({)h(the)f(n)m(um)m(b)s(er)g(of)g(table)g(ro)m(ws)h(or)f(image)h
-(pixels)d(that)j(are)g(b)s(eing)e(passed)h(in)f(this)h(particular)227
-4095 y(call)g(to)i(the)f(w)m(ork)f(function.)53 b(n)m(v)-5
-b(alues)34 b(will)e(alw)m(a)m(ys)j(b)s(e)f(less)g(than)g(or)h(equal)f
-(to)i(totaln)f(and)f(will)e(ha)m(v)m(e)227 4208 y(the)i(same)f(v)-5
-b(alue)33 b(on)g(eac)m(h)h(iteration,)g(except)g(p)s(ossibly)d(on)i
-(the)g(last)g(call)g(whic)m(h)f(ma)m(y)h(ha)m(v)m(e)i(a)e(smaller)227
-4321 y(v)-5 b(alue.)136 4522 y Fc(\017)46 b Fj(narra)m(ys)31
-b({)g(the)g(n)m(um)m(b)s(er)f(of)h(arra)m(ys)g(of)g(data)h(that)f(are)g
-(b)s(eing)f(passed)g(to)i(the)f(w)m(ork)g(function.)41
-b(There)30 b(is)227 4635 y(one)h(arra)m(y)g(for)f(eac)m(h)i(image)e(or)
-g(table)h(column.)136 4835 y Fc(\017)46 b Fj(*data)31
-b({)e(arra)m(y)h(of)f(structures,)g(one)h(for)f(eac)m(h)h(column)e(or)h
-(image.)41 b(Eac)m(h)29 b(structure)g(con)m(tains)g(a)h(p)s(oin)m(ter)
-227 4948 y(to)h(the)g(arra)m(y)g(of)f(data)h(as)g(w)m(ell)e(as)i(other)
-g(descriptiv)m(e)e(parameters)i(ab)s(out)f(that)h(arra)m(y)-8
-b(.)136 5149 y Fc(\017)46 b Fj(*userP)m(oin)m(ter)25
-b({)h(a)f(user)f(supplied)e(p)s(oin)m(ter)i(that)i(can)f(b)s(e)f(used)h
-(to)g(pass)g(ancillary)e(information)g(from)i(the)227
-5262 y(driv)m(er)g(function)g(to)h(the)g(w)m(ork)g(function.)38
-b(This)24 b(p)s(oin)m(ter)h(is)g(passed)h(to)g(the)h(CFITSIO)d
-(iterator)i(function)227 5375 y(whic)m(h)36 b(then)g(passes)g(it)g(on)h
-(to)g(the)f(w)m(ork)h(function)e(without)h(an)m(y)h(mo)s(di\014cation.)
-57 b(It)37 b(ma)m(y)g(p)s(oin)m(t)e(to)j(a)227 5488 y(single)27
-b(n)m(um)m(b)s(er,)h(to)h(an)f(arra)m(y)h(of)g(v)-5 b(alues,)28
-b(to)h(a)g(structure)f(con)m(taining)g(an)g(arbitrary)f(set)i(of)g
-(parameters)227 5601 y(of)e(di\013eren)m(t)g(t)m(yp)s(es,)h(or)f(it)g
-(ma)m(y)g(b)s(e)g(a)g(n)m(ull)e(p)s(oin)m(ter)h(if)g(it)h(is)f(not)h
-(needed.)40 b(The)26 b(w)m(ork)h(function)f(m)m(ust)h(cast)227
-5714 y(this)j(p)s(oin)m(ter)f(to)i(the)g(appropriate)e(data)i(t)m(yp)s
-(e)g(b)s(efore)f(using)e(it)i(it.)p eop
-%%Page: 63 69
-63 68 bop 0 299 a Fh(6.1.)72 b(THE)30 b(ITERA)-8 b(TOR)30
-b(W)m(ORK)g(FUNCTION)2021 b Fj(63)0 555 y(The)23 b(totaln,)j(o\013set,)
-h(narra)m(ys,)e(data,)h(and)d(userP)m(oin)m(ter)h(parameters)g(are)g
-(guaran)m(teed)h(to)g(ha)m(v)m(e)g(the)f(same)g(v)-5
-b(alue)0 668 y(on)35 b(eac)m(h)i(iteration.)55 b(Only)33
-b(\014rstn,)j(n)m(v)-5 b(alues,)36 b(and)e(the)i(arra)m(ys)f(of)h(data)
-g(p)s(oin)m(ted)e(to)i(b)m(y)f(the)h(data)g(structures)0
-781 y(ma)m(y)31 b(c)m(hange)g(on)g(eac)m(h)g(iterativ)m(e)g(call)f(to)h
-(the)f(w)m(ork)h(function.)0 941 y(Note)43 b(that)g(the)f(iterator)g
-(treats)h(an)f(image)g(as)g(a)g(long)g(1-D)h(arra)m(y)f(of)h(pixels)d
-(regardless)h(of)h(it's)g(in)m(trinsic)0 1054 y(dimensionalit)m(y)-8
-b(.)48 b(The)33 b(total)i(n)m(um)m(b)s(er)d(of)i(pixels)e(is)h(just)g
-(the)h(pro)s(duct)e(of)i(the)g(size)g(of)f(eac)m(h)i(dimension,)e(and)0
-1167 y(the)g(order)g(of)g(the)g(pixels)e(is)h(the)h(same)g(as)g(the)h
-(order)e(that)h(they)h(are)f(stored)g(in)f(the)h(FITS)f(\014le.)47
-b(If)33 b(the)g(w)m(ork)0 1280 y(function)26 b(needs)h(to)h(kno)m(w)f
-(the)h(n)m(um)m(b)s(er)e(and)h(size)g(of)h(the)f(image)h(dimensions)c
-(then)j(these)h(parameters)g(can)g(b)s(e)0 1393 y(passed)i(via)g(the)g
-(userP)m(oin)m(ter)h(structure.)0 1553 y(The)f(iteratorCol)g(structure)
-g(is)f(curren)m(tly)h(de\014ned)f(as)h(follo)m(ws:)0
-1780 y Ff(typedef)46 b(struct)94 b(/*)47 b(structure)e(for)i(the)g
-(iterator)e(function)h(column)g(information)f(*/)0 1893
-y({)143 2005 y(/*)i(structure)f(elements)f(required)h(as)h(input)f(to)h
-(fits_iterate_data:)c(*/)95 2231 y(fitsfile)j(*fptr;)332
-b(/*)48 b(pointer)d(to)j(the)f(HDU)f(containing)f(the)i(column)f(or)i
-(image)e(*/)95 2344 y(int)286 b(colnum;)e(/*)48 b(column)e(number)g(in)
-h(the)g(table;)f(ignored)g(for)h(images)189 b(*/)95 2457
-y(char)238 b(colname[70];)44 b(/*)k(name)e(\(TTYPEn\))g(of)h(the)g
-(column;)f(null)g(for)h(images)285 b(*/)95 2570 y(int)h(datatype;)188
-b(/*)48 b(output)e(datatype)f(\(converted)g(if)i(necessary\))e(*/)95
-2683 y(int)286 b(iotype;)e(/*)48 b(type:)e(InputCol,)f(InputOutputCol,)
-f(or)j(OutputCol)e(*/)95 2909 y(/*)j(output)e(structure)f(elements)h
-(that)g(may)h(be)g(useful)f(for)h(the)g(work)g(function:)e(*/)95
-3135 y(void)238 b(*array;)189 b(/*)47 b(pointer)f(to)h(the)g(array)f
-(\(and)h(the)g(null)g(value\))f(*/)95 3247 y(long)238
-b(repeat;)189 b(/*)47 b(binary)f(table)h(vector)f(repeat)g(value;)g
-(set)238 b(*/)1050 3360 y(/*)g(equal)46 b(to)i(1)f(for)g(images)810
-b(*/)95 3473 y(long)238 b(tlmin;)f(/*)47 b(legal)g(minimum)e(data)i
-(value,)f(if)h(any)477 b(*/)95 3586 y(long)238 b(tlmax;)f(/*)47
-b(legal)g(maximum)e(data)i(value,)f(if)h(any)477 b(*/)95
-3699 y(char)238 b(unit[70];)93 b(/*)47 b(physical)f(unit)g(string)g
-(\(BUNIT)h(or)g(TUNITn\))189 b(*/)95 3812 y(char)238
-b(tdisp[70];)45 b(/*)i(suggested)e(display)h(format;)g(null)h(if)g
-(none)190 b(*/)0 4038 y(})47 b(iteratorCol;)0 4264 y
-Fj(Instead)34 b(of)g(directly)e(reading)h(or)h(writing)e(the)h(elemen)m
-(ts)i(in)d(this)h(structure,)h(it)g(is)e(recommended)i(that)g(pro-)0
-4377 y(grammers)c(use)g(the)h(access)h(functions)c(that)j(are)g(pro)m
-(vided)e(for)h(this)g(purp)s(ose.)0 4538 y(The)25 b(\014rst)g(\014v)m
-(e)h(elemen)m(ts)g(in)f(this)f(structure)i(m)m(ust)f(b)s(e)g(initially)
-e(de\014ned)h(b)m(y)i(the)g(driv)m(er)e(routine)h(b)s(efore)g(calling)0
-4650 y(the)f(iterator)g(routine.)37 b(The)23 b(CFITSIO)f(iterator)i
-(routine)f(uses)g(this)f(information)g(to)i(determine)f(what)g(column)0
-4763 y(or)32 b(arra)m(y)h(to)h(pass)e(to)h(the)g(w)m(ork)f(function,)g
-(and)g(whether)g(the)g(arra)m(y)h(is)f(to)h(b)s(e)f(input)f(to)i(the)f
-(w)m(ork)h(function,)0 4876 y(output)g(from)g(the)h(w)m(ork)f
-(function,)g(or)h(b)s(oth.)49 b(The)33 b(CFITSIO)f(iterator)h(function)
-f(\014lls)g(in)g(the)h(v)-5 b(alues)33 b(of)h(the)0 4989
-y(remaining)28 b(structure)i(elemen)m(ts)h(b)s(efore)f(passing)f(it)h
-(to)h(the)g(w)m(ork)f(function.)0 5149 y(The)d(arra)m(y)g(structure)g
-(elemen)m(t)h(is)e(a)h(p)s(oin)m(ter)f(to)i(the)g(actual)f(data)h(arra)
-m(y)g(and)e(it)h(m)m(ust)g(b)s(e)f(cast)j(to)e(the)h(correct)0
-5262 y(data)43 b(t)m(yp)s(e)f(b)s(efore)g(it)g(is)g(used.)75
-b(The)42 b(`rep)s(eat')h(structure)f(elemen)m(t)h(giv)m(e)g(the)f(n)m
-(um)m(b)s(er)f(of)i(data)g(v)-5 b(alues)41 b(in)0 5375
-y(eac)m(h)d(ro)m(w)f(of)g(the)g(table,)i(so)e(that)h(the)f(total)g(n)m
-(um)m(b)s(er)f(of)h(data)h(v)-5 b(alues)36 b(in)f(the)i(arra)m(y)h(is)e
-(giv)m(en)h(b)m(y)f(rep)s(eat)i(*)0 5488 y(n)m(v)-5 b(alues.)40
-b(In)28 b(the)h(case)h(of)f(image)g(arra)m(ys)g(and)f(ASCI)s(I)g
-(tables,)h(rep)s(eat)g(will)d(alw)m(a)m(ys)j(b)s(e)g(equal)f(to)h(1.)41
-b(When)29 b(the)0 5601 y(datat)m(yp)s(e)h(is)e(a)i(c)m(haracter)h
-(string,)d(the)i(arra)m(y)g(p)s(oin)m(ter)e(is)g(actually)h(a)h(p)s
-(oin)m(ter)e(to)i(an)f(arra)m(y)h(of)f(string)f(p)s(oin)m(ters)0
-5714 y(\(i.e.,)i(c)m(har)f(**arra)m(y\).)42 b(The)29
-b(other)g(output)g(structure)f(elemen)m(ts)i(are)f(pro)m(vided)f(for)g
-(con)m(v)m(enience)j(in)c(case)j(that)p eop
-%%Page: 64 70
-64 69 bop 0 299 a Fj(64)1455 b Fh(CHAPTER)30 b(6.)112
-b(THE)30 b(CFITSIO)e(ITERA)-8 b(TOR)30 b(FUNCTION)0 555
-y Fj(information)k(is)h(needed)g(within)e(the)j(w)m(ork)g(function.)55
-b(An)m(y)35 b(other)h(information)e(ma)m(y)i(b)s(e)f(passed)h(from)f
-(the)0 668 y(driv)m(er)29 b(routine)h(to)h(the)f(w)m(ork)h(function)e
-(via)h(the)g(userP)m(oin)m(ter)g(parameter.)0 828 y(Up)s(on)h
-(completion,)h(the)g(w)m(ork)h(routine)e(m)m(ust)h(return)f(an)h(in)m
-(teger)g(status)g(v)-5 b(alue,)33 b(with)d(0)j(indicating)d(success)0
-941 y(and)h(an)m(y)g(other)g(v)-5 b(alue)31 b(indicating)e(an)i(error)g
-(whic)m(h)f(will)e(cause)k(the)f(iterator)h(function)e(to)i
-(immediately)d(exit)0 1054 y(at)e(that)f(p)s(oin)m(t.)38
-b(Return)25 b(status)i(v)-5 b(alues)25 b(in)f(the)i(range)h(1)f({)g
-(1000)i(should)23 b(b)s(e)j(a)m(v)m(oided)g(since)f(these)i(are)f
-(reserv)m(ed)0 1167 y(for)d(use)g(b)m(y)h(CFITSIO.)e(A)i(return)e
-(status)i(v)-5 b(alue)23 b(of)h(-1)g(ma)m(y)g(b)s(e)f(used)f(to)j
-(force)f(the)f(CFITSIO)f(iterator)i(function)0 1280 y(to)j(stop)g(at)g
-(that)h(p)s(oin)m(t)d(and)h(return)g(con)m(trol)h(to)g(the)g(driv)m(er)
-e(routine)h(after)h(writing)d(an)m(y)j(output)f(arra)m(ys)h(to)h(the)0
-1393 y(FITS)e(\014le.)39 b(CFITSIO)26 b(do)s(es)g(not)i(considered)e
-(this)g(to)i(b)s(e)e(an)h(error)g(condition,)g(so)g(an)m(y)g(further)f
-(pro)s(cessing)g(b)m(y)0 1506 y(the)31 b(application)d(program)i(will)e
-(con)m(tin)m(ue)j(normally)-8 b(.)0 1838 y Fe(6.2)135
-b(The)45 b(Iterator)h(Driv)l(er)g(F)-11 b(unction)0 2088
-y Fj(The)33 b(iterator)g(driv)m(er)f(function)g(m)m(ust)i(op)s(en)e
-(the)i(necessary)f(FITS)g(\014les)f(and)h(p)s(osition)e(them)i(to)h
-(the)g(correct)0 2201 y(HDU.)23 b(It)f(m)m(ust)g(also)h(initialize)c
-(the)j(follo)m(wing)f(parameters)h(in)f(the)i(iteratorCol)f(structure)f
-(\(de\014ned)g(ab)s(o)m(v)m(e\))j(for)0 2314 y(eac)m(h)31
-b(column)e(or)h(image)g(b)s(efore)f(calling)g(the)h(CFITSIO)e(iterator)
-i(function.)39 b(Sev)m(eral)30 b(`constructor')h(routines)0
-2427 y(are)g(pro)m(vided)e(in)g(CFITSIO)g(for)h(this)f(purp)s(ose.)136
-2679 y Fc(\017)46 b Fj(*fptr)30 b({)h(The)f(\014ts\014le)f(p)s(oin)m
-(ter)g(to)j(the)e(table)g(or)h(image.)136 2864 y Fc(\017)46
-b Fj(coln)m(um)29 b({)g(the)h(n)m(um)m(b)s(er)e(of)h(the)h(column)e(in)
-g(the)h(table.)41 b(This)27 b(v)-5 b(alue)29 b(is)f(ignored)g(in)g(the)
-i(case)g(of)g(images.)227 2977 y(If)j(coln)m(um)g(equals)g(0,)h(then)g
-(the)f(column)f(name)i(will)c(b)s(e)j(used)g(to)h(iden)m(tify)e(the)h
-(column)g(to)h(b)s(e)e(passed)227 3090 y(to)f(the)g(w)m(ork)f
-(function.)136 3275 y Fc(\017)46 b Fj(colname)31 b({)f(the)g(name)h
-(\(TTYPEn)e(k)m(eyw)m(ord\))i(of)f(the)h(column.)39 b(This)28
-b(is)i(only)f(required)f(if)h(coln)m(um)h(=)g(0)227 3387
-y(and)g(is)f(ignored)h(for)g(images.)136 3572 y Fc(\017)46
-b Fj(datat)m(yp)s(e)24 b({)f(The)g(desired)e(datat)m(yp)s(e)j(of)f(the)
-g(arra)m(y)h(to)f(b)s(e)g(passed)f(to)i(the)f(w)m(ork)g(function.)37
-b(F)-8 b(or)23 b(n)m(umerical)227 3685 y(data)35 b(the)e(datat)m(yp)s
-(e)i(do)s(es)e(not)h(need)f(to)i(b)s(e)e(the)g(same)h(as)g(the)g
-(actual)g(datat)m(yp)s(e)h(in)d(the)i(FITS)e(\014le,)i(in)227
-3798 y(whic)m(h)i(case)h(CFITSIO)e(will)f(do)i(the)h(con)m(v)m(ersion.)
-60 b(Allo)m(w)m(ed)36 b(v)-5 b(alues)36 b(are:)53 b(TSTRING,)36
-b(TLOGICAL,)227 3911 y(TBYTE,)h(TSHOR)-8 b(T,)36 b(TUSHOR)-8
-b(T,)36 b(TINT,)h(TLONG,)f(TULONG,)h(TFLO)m(A)-8 b(T,)37
-b(TDOUBLE.)g(If)g(the)227 4024 y(input)31 b(v)-5 b(alue)32
-b(of)h(datat)m(yp)s(e)g(equals)f(0,)i(then)e(the)h(existing)e(datat)m
-(yp)s(e)j(of)e(the)h(column)e(or)i(image)g(will)d(b)s(e)227
-4137 y(used)g(without)f(an)m(y)i(con)m(v)m(ersion.)136
-4322 y Fc(\017)46 b Fj(iot)m(yp)s(e)27 b({)g(de\014nes)e(whether)h(the)
-h(data)g(arra)m(y)h(is)d(to)j(b)s(e)e(input)e(to)k(the)e(w)m(ork)h
-(function)e(\(i.e,)j(read)f(from)f(the)227 4435 y(FITS)i(\014le\),)h
-(or)g(output)f(from)h(the)g(w)m(ork)g(function)e(\(i.e.,)j(written)e
-(to)i(the)f(FITS)f(\014le\))g(or)h(b)s(oth.)39 b(Allo)m(w)m(ed)227
-4548 y(v)-5 b(alues)30 b(are)h(InputCol,)d(OutputCol,)h(or)i
-(InputOutputCol.)0 4800 y(After)g(the)f(driv)m(er)f(routine)g(has)h
-(initialized)e(all)h(these)h(parameters,)h(it)f(can)h(then)f(call)f
-(the)i(CFITSIO)e(iterator)0 4912 y(function:)95 5164
-y Ff(int)47 b(fits_iterate_data\(int)42 b(narrays,)k(iteratorCol)f
-(*data,)h(long)g(offset,)286 5277 y(long)h(nPerLoop,)e(int)i
-(\(*workFn\)\()e(\),)i(void)g(*userPointer,)d(int)j(*status\);)136
-5529 y Fc(\017)f Fj(narra)m(ys)31 b({)f(the)h(n)m(um)m(b)s(er)e(of)h
-(columns)f(or)i(images)f(that)h(are)g(to)g(b)s(e)f(passed)g(to)h(the)f
-(w)m(ork)h(function.)136 5714 y Fc(\017)46 b Fj(*data)32
-b({)f(p)s(oin)m(ter)e(to)i(arra)m(y)g(of)f(structures)g(con)m(taining)g
-(information)f(ab)s(out)h(eac)m(h)h(column)f(or)g(image.)p
-eop
-%%Page: 65 71
-65 70 bop 0 299 a Fh(6.3.)72 b(GUIDELINES)30 b(F)m(OR)h(USING)f(THE)g
-(ITERA)-8 b(TOR)30 b(FUNCTION)1200 b Fj(65)136 555 y
-Fc(\017)46 b Fj(o\013set)31 b({)f(if)e(p)s(ositiv)m(e,)h(this)g(n)m(um)
-m(b)s(er)f(of)i(ro)m(ws)f(at)h(the)g(b)s(eginning)d(of)j(the)f(table)h
-(\(or)g(pixels)d(in)i(the)g(image\))227 668 y(will)f(b)s(e)i(skipp)s
-(ed)e(and)h(will)f(not)j(b)s(e)e(passed)h(to)h(the)g(w)m(ork)f
-(function.)136 852 y Fc(\017)46 b Fj(nP)m(erLo)s(op)38
-b(-)h(sp)s(eci\014es)d(the)j(n)m(um)m(b)s(er)e(of)h(table)g(ro)m(ws)h
-(\(or)f(n)m(um)m(b)s(er)f(of)i(image)f(pixels\))f(that)i(are)g(to)g(b)s
-(e)227 965 y(passed)29 b(to)h(the)f(w)m(ork)h(function)d(on)i(eac)m(h)i
-(iteration.)40 b(If)28 b(nP)m(erLo)s(op)h(=)g(0)g(then)g(CFITSIO)f
-(will)f(calculate)227 1078 y(the)39 b(optim)m(um)e(n)m(um)m(b)s(er)h
-(for)g(greatest)i(e\016ciency)-8 b(.)66 b(If)38 b(nP)m(erLo)s(op)g(is)f
-(negativ)m(e,)42 b(then)c(all)g(the)g(ro)m(ws)h(or)227
-1190 y(pixels)29 b(will)f(b)s(e)h(passed)h(at)h(one)g(time,)f(and)g
-(the)h(w)m(ork)f(function)f(will)f(only)h(b)s(e)h(called)g(once.)136
-1374 y Fc(\017)46 b Fj(*w)m(orkFn)f(-)f(the)h(name)f(\(actually)g(the)h
-(address\))f(of)g(the)g(w)m(ork)h(function)e(that)i(is)e(to)i(b)s(e)f
-(called)f(b)m(y)227 1487 y(\014ts)p 354 1487 28 4 v 33
-w(iterate)p 644 1487 V 33 w(data.)136 1671 y Fc(\017)j
-Fj(*userP)m(oin)m(ter)33 b(-)g(this)f(is)g(a)h(user)f(supplied)e(p)s
-(oin)m(ter)i(that)h(can)g(b)s(e)g(used)f(to)h(pass)g(ancillary)e
-(information)227 1783 y(from)i(the)g(driv)m(er)f(routine)g(to)i(the)f
-(w)m(ork)g(function.)47 b(It)33 b(ma)m(y)h(p)s(oin)m(t)e(to)i(a)f
-(single)f(n)m(um)m(b)s(er,)g(an)h(arra)m(y)-8 b(,)35
-b(or)227 1896 y(to)c(a)g(structure)f(con)m(taining)g(an)g(arbitrary)f
-(set)i(of)g(parameters.)136 2080 y Fc(\017)46 b Fj(*status)30
-b(-)f(The)f(CFITSIO)f(error)h(status.)41 b(Should)26
-b(=)i(0)h(on)g(input;)e(a)i(non-zero)h(output)e(v)-5
-b(alue)28 b(indicates)227 2193 y(an)j(error.)0 2441 y(When)f(\014ts)p
-392 2441 V 32 w(iterate)p 681 2441 V 34 w(data)h(is)e(called)g(it)g
-(\014rst)h(allo)s(cates)g(memory)g(to)h(hold)d(all)h(the)h(requested)g
-(columns)f(of)h(data)0 2553 y(or)f(image)h(pixel)d(arra)m(ys.)41
-b(It)29 b(then)g(reads)g(the)h(input)d(data)j(from)f(the)g(FITS)f
-(tables)h(or)h(images)f(in)m(to)g(the)h(arra)m(ys)0 2666
-y(then)h(passes)h(the)g(structure)f(with)f(p)s(oin)m(ters)h(to)h(these)
-g(data)h(arra)m(ys)f(to)g(the)g(w)m(ork)g(function.)43
-b(After)32 b(the)g(w)m(ork)0 2779 y(function)k(returns,)h(the)h
-(iterator)f(function)f(writes)g(an)m(y)h(output)g(columns)e(of)i(data)h
-(or)f(images)g(bac)m(k)h(to)g(the)0 2892 y(FITS)31 b(\014les.)45
-b(It)32 b(then)g(rep)s(eats)g(this)f(pro)s(cess)h(for)f(an)m(y)i
-(remaining)d(sets)i(of)h(ro)m(ws)f(or)g(image)g(pixels)e(un)m(til)h(it)
-g(has)0 3005 y(pro)s(cessed)c(the)i(en)m(tire)f(table)f(or)h(image)h
-(or)f(un)m(til)e(the)i(w)m(ork)g(function)f(returns)g(a)h(non-zero)h
-(status)f(v)-5 b(alue.)39 b(The)0 3118 y(iterator)32
-b(then)g(frees)g(the)h(memory)e(that)i(it)f(initially)c(allo)s(cated)k
-(and)g(returns)f(con)m(trol)h(to)h(the)f(driv)m(er)f(routine)0
-3231 y(that)g(called)f(it.)0 3563 y Fe(6.3)135 b(Guidelines)46
-b(for)f(Using)h(the)f(Iterator)h(F)-11 b(unction)0 3813
-y Fj(The)34 b(totaln,)h(o\013set,)i(\014rstn,)d(and)f(n)m(v)-5
-b(alues)34 b(parameters)g(that)h(are)f(passed)g(to)h(the)f(w)m(ork)g
-(function)f(are)i(useful)0 3926 y(for)f(determining)e(ho)m(w)i(m)m(uc)m
-(h)g(of)h(the)f(data)h(has)f(b)s(een)f(pro)s(cessed)h(and)f(ho)m(w)h(m)
-m(uc)m(h)g(remains)f(left)h(to)h(do.)52 b(On)0 4039 y(the)36
-b(v)m(ery)h(\014rst)f(call)f(to)i(the)f(w)m(ork)h(function)e(\014rstn)g
-(will)e(b)s(e)j(equal)g(to)h(o\013set)g(+)f(1;)k(the)c(w)m(ork)g
-(function)f(ma)m(y)0 4152 y(need)c(to)g(p)s(erform)f(v)-5
-b(arious)30 b(initialization)d(tasks)32 b(b)s(efore)e(starting)h(to)g
-(pro)s(cess)g(the)g(data.)43 b(Similarly)-8 b(,)28 b(\014rstn)h(+)0
-4264 y(n)m(v)-5 b(alues)28 b(-)g(1)h(will)c(b)s(e)j(equal)f(to)i
-(totaln)g(on)f(the)g(last)g(iteration,)h(at)g(whic)m(h)e(p)s(oin)m(t)g
-(the)h(w)m(ork)h(function)d(ma)m(y)j(need)0 4377 y(to)k(p)s(erform)f
-(some)h(clean)g(up)e(op)s(erations)h(b)s(efore)h(exiting)f(for)g(the)h
-(last)g(time.)47 b(The)33 b(w)m(ork)f(function)g(can)h(also)0
-4490 y(force)e(an)f(early)g(termination)f(of)i(the)g(iterations)e(b)m
-(y)i(returning)d(a)j(status)g(v)-5 b(alue)29 b(=)h(-1.)0
-4650 y(The)f(narra)m(ys)g(and)g(iteratorCol.datat)m(yp)s(e)h(argumen)m
-(ts)g(allo)m(w)e(the)i(w)m(ork)f(function)f(to)i(double)e(c)m(hec)m(k)j
-(that)f(the)0 4763 y(n)m(um)m(b)s(er)37 b(of)h(input)e(arra)m(ys)i(and)
-f(their)h(datat)m(yp)s(es)g(ha)m(v)m(e)h(the)g(exp)s(ected)f(v)-5
-b(alues.)63 b(The)37 b(iteratorCol.fptr)h(and)0 4876
-y(iteratorCol.coln)m(um)31 b(structure)g(elemen)m(ts)g(can)h(b)s(e)f
-(used)f(if)h(the)g(w)m(ork)h(function)e(needs)h(to)h(read)f(or)g(write)
-g(the)0 4989 y(v)-5 b(alues)30 b(of)h(other)g(k)m(eyw)m(ords)g(in)f
-(the)h(FITS)f(\014le)g(asso)s(ciated)h(with)f(the)h(arra)m(y)-8
-b(.)43 b(This)29 b(should)g(generally)h(only)g(b)s(e)0
-5102 y(done)k(during)d(the)j(initialization)d(step)i(or)h(during)e(the)
-i(clean)f(up)g(step)h(after)g(the)g(last)g(set)g(of)g(data)g(has)g(b)s
-(een)0 5215 y(pro)s(cessed.)40 b(Extra)29 b(FITS)f(\014le)g(I/O)h
-(during)d(the)j(main)f(pro)s(cessing)g(lo)s(op)g(of)h(the)g(w)m(ork)g
-(function)f(can)h(seriously)0 5328 y(degrade)i(the)f(sp)s(eed)g(of)g
-(the)h(program.)0 5488 y(One)i(imp)s(ortan)m(t)f(feature)i(of)f(the)h
-(iterator)g(is)e(that)i(the)f(\014rst)g(elemen)m(t)h(in)e(eac)m(h)i
-(arra)m(y)g(that)g(is)e(passed)h(to)h(the)0 5601 y(w)m(ork)f(function)f
-(giv)m(es)h(the)g(v)-5 b(alue)32 b(that)i(is)e(used)g(to)h(represen)m
-(t)g(n)m(ull)e(or)i(unde\014ned)d(v)-5 b(alues)33 b(in)e(the)i(arra)m
-(y)-8 b(.)49 b(The)0 5714 y(real)30 b(data)h(then)f(b)s(egins)f(with)g
-(the)i(second)f(elemen)m(t)h(of)f(the)h(arra)m(y)g(\(i.e.,)g(arra)m
-(y[1],)h(not)f(arra)m(y[0]\).)42 b(If)30 b(the)h(\014rst)p
-eop
-%%Page: 66 72
-66 71 bop 0 299 a Fj(66)1455 b Fh(CHAPTER)30 b(6.)112
-b(THE)30 b(CFITSIO)e(ITERA)-8 b(TOR)30 b(FUNCTION)0 555
-y Fj(arra)m(y)23 b(elemen)m(t)h(is)e(equal)g(to)i(zero,)h(then)d(this)g
-(indicates)g(that)h(all)f(the)h(arra)m(y)h(elemen)m(ts)f(ha)m(v)m(e)h
-(de\014ned)d(v)-5 b(alues)23 b(and)0 668 y(there)31 b(are)g(no)f
-(unde\014ned)f(v)-5 b(alues.)40 b(If)31 b(arra)m(y[0])h(is)d(not)i
-(equal)f(to)i(zero,)f(then)g(this)e(indicates)h(that)h(some)g(of)g(the)
-0 781 y(data)e(v)-5 b(alues)27 b(are)h(unde\014ned)e(and)h(this)g(v)-5
-b(alue)27 b(\(arra)m(y[0]\))j(is)d(used)g(to)i(represen)m(t)e(them.)40
-b(In)27 b(the)h(case)h(of)f(output)0 894 y(arra)m(ys)e(\(i.e.,)i(those)
-f(arra)m(ys)f(that)h(will)c(b)s(e)i(written)h(bac)m(k)g(to)h(the)f
-(FITS)g(\014le)f(b)m(y)h(the)g(iterator)g(function)f(after)i(the)0
-1007 y(w)m(ork)k(function)e(exits\))i(the)g(w)m(ork)g(function)f(m)m
-(ust)g(set)i(the)f(\014rst)f(arra)m(y)h(elemen)m(t)g(to)h(the)f
-(desired)e(n)m(ull)g(v)-5 b(alue)30 b(if)0 1120 y(necessary)-8
-b(,)29 b(otherwise)e(the)h(\014rst)f(elemen)m(t)i(should)c(b)s(e)i(set)
-i(to)f(zero)h(to)f(indicate)f(that)h(there)g(are)g(no)g(n)m(ull)e(v)-5
-b(alues)0 1233 y(in)24 b(the)i(output)f(arra)m(y)-8 b(.)40
-b(CFITSIO)24 b(de\014nes)g(2)i(v)-5 b(alues,)26 b(FLO)m(A)-8
-b(TNULL)e(V)g(ALUE)26 b(and)f(DOUBLENULL)-10 b(V)g(ALUE,)0
-1346 y(that)32 b(can)g(b)s(e)f(used)f(as)i(default)e(n)m(ull)g(v)-5
-b(alues)31 b(for)g(\015oat)h(and)f(double)f(datat)m(yp)s(es,)i(resp)s
-(ectiv)m(ely)-8 b(.)44 b(In)31 b(the)g(case)i(of)0 1458
-y(c)m(haracter)f(string)d(datat)m(yp)s(es,)j(a)e(n)m(ull)f(string)g(is)
-h(alw)m(a)m(ys)g(used)g(to)h(represen)m(t)g(unde\014ned)d(strings.)0
-1619 y(In)33 b(some)h(applications)d(it)i(ma)m(y)h(b)s(e)f(necessary)h
-(to)g(recursiv)m(ely)e(call)h(the)h(iterator)g(function.)49
-b(An)33 b(example)g(of)0 1732 y(this)26 b(is)g(giv)m(en)h(b)m(y)g(one)h
-(of)f(the)h(example)e(programs)h(that)h(is)e(distributed)e(with)i
-(CFITSIO:)g(it)h(\014rst)f(calls)g(a)i(w)m(ork)0 1844
-y(function)37 b(that)h(writes)g(out)g(a)g(2D)h(histogram)f(image.)64
-b(That)38 b(w)m(ork)g(function)f(in)f(turn)h(calls)h(another)g(w)m(ork)
-0 1957 y(function)28 b(that)i(reads)g(the)f(`X')i(and)e(`Y')h(columns)e
-(in)g(a)i(table)g(to)g(calculate)g(the)f(v)-5 b(alue)30
-b(of)f(eac)m(h)i(2D)f(histogram)0 2070 y(image)h(pixel.)39
-b(Graphically)-8 b(,)29 b(the)h(program)g(structure)g(can)h(b)s(e)f
-(describ)s(ed)e(as:)48 2330 y Ff(driver)46 b(-->)h(iterator)e(-->)i
-(work1_fn)f(-->)h(iterator)e(-->)i(work2_fn)0 2590 y
-Fj(Finally)-8 b(,)39 b(it)f(should)e(b)s(e)i(noted)g(that)h(the)g
-(table)f(columns)f(or)h(image)h(arra)m(ys)g(that)g(are)f(passed)g(to)h
-(the)g(w)m(ork)0 2703 y(function)34 b(do)i(not)g(all)e(ha)m(v)m(e)j(to)
-f(come)h(from)e(the)h(same)g(FITS)f(\014le)f(and)h(instead)g(ma)m(y)h
-(come)h(from)e(an)m(y)h(com-)0 2816 y(bination)31 b(of)i(sources)g(as)h
-(long)e(as)i(they)f(ha)m(v)m(e)h(the)f(same)h(length.)48
-b(The)32 b(length)h(of)g(the)g(\014rst)f(table)h(column)f(or)0
-2929 y(image)f(arra)m(y)g(is)e(used)g(b)m(y)i(the)f(iterator)h(if)e
-(they)i(do)f(not)h(all)e(ha)m(v)m(e)j(the)e(same)h(length.)p
-eop
-%%Page: 67 73
-67 72 bop 0 1225 a Fg(Chapter)65 b(7)0 1687 y Fm(Basic)77
-b(CFITSIO)f(In)-6 b(terface)77 b(Routines)0 2180 y Fj(This)29
-b(c)m(hapter)j(describ)s(es)d(the)j(basic)e(routines)g(in)g(the)h
-(CFITSIO)e(user)i(in)m(terface)g(that)h(pro)m(vide)e(all)g(the)i(func-)
-0 2293 y(tions)i(normally)f(needed)i(to)g(read)g(and)f(write)g(most)i
-(FITS)e(\014les.)53 b(It)35 b(is)f(recommended)g(that)i(these)f
-(routines)0 2406 y(b)s(e)d(used)g(for)g(most)h(applications)e(and)h
-(that)h(the)f(more)h(adv)-5 b(anced)33 b(routines)e(describ)s(ed)g(in)g
-(the)i(next)f(c)m(hapter)0 2518 y(only)d(b)s(e)h(used)g(in)f(sp)s
-(ecial)g(circumstances)h(when)f(necessary)-8 b(.)0 2679
-y(The)30 b(follo)m(wing)f(con)m(v)m(en)m(tions)i(are)g(used)e(in)h
-(this)f(c)m(hapter)i(in)e(the)h(description)f(of)h(eac)m(h)i(function:)
-0 2839 y(1.)39 b(Most)25 b(functions)d(ha)m(v)m(e)j(2)f(names:)37
-b(a)24 b(long)g(descriptiv)m(e)e(name)i(and)f(a)i(short)e(concise)h
-(name.)38 b(Both)25 b(names)f(are)0 2952 y(listed)e(on)h(the)g(\014rst)
-f(line)g(of)h(the)h(follo)m(wing)d(descriptions,)i(separated)g(b)m(y)h
-(a)f(slash)f(\(/\))i(c)m(haracter.)40 b(Programmers)0
-3065 y(ma)m(y)27 b(use)g(either)f(name)h(in)e(their)h(programs)h(but)f
-(the)h(long)f(names)h(are)g(recommended)f(to)i(help)d(do)s(cumen)m(t)i
-(the)0 3177 y(co)s(de)k(and)e(mak)m(e)j(it)e(easier)g(to)h(read.)0
-3338 y(2.)42 b(A)30 b(righ)m(t)g(arro)m(w)h(sym)m(b)s(ol)e(\()p
-Fb(>)p Fj(\))i(is)f(used)g(in)f(the)i(function)e(descriptions)f(to)k
-(separate)f(the)g(input)e(parameters)0 3451 y(from)k(the)g(output)f
-(parameters)i(in)e(the)h(de\014nition)e(of)i(eac)m(h)h(routine.)48
-b(This)31 b(sym)m(b)s(ol)h(is)g(not)h(actually)g(part)g(of)0
-3563 y(the)e(C)f(calling)e(sequence.)0 3724 y(3.)41 b(The)30
-b(function)f(parameters)i(are)g(de\014ned)e(in)g(more)h(detail)g(in)f
-(the)h(alphab)s(etical)f(listing)f(in)h(App)s(endix)f(B.)0
-3884 y(4.)39 b(The)23 b(\014rst)g(argumen)m(t)g(in)g(almost)g(all)g
-(the)g(functions)f(is)h(a)h(p)s(oin)m(ter)e(to)i(a)g(structure)f(of)h
-(t)m(yp)s(e)g(`\014ts\014le'.)37 b(Memory)0 3997 y(for)26
-b(this)f(structure)g(is)g(allo)s(cated)h(b)m(y)g(CFITSIO)e(when)h(the)h
-(FITS)g(\014le)f(is)g(\014rst)g(op)s(ened)g(or)h(created)h(and)e(is)g
-(freed)0 4110 y(when)k(the)i(FITS)f(\014le)f(is)g(closed.)0
-4270 y(5.)53 b(The)34 b(last)g(argumen)m(t)g(in)f(almost)i(all)e(the)h
-(functions)f(is)g(the)i(error)f(status)g(parameter.)53
-b(It)35 b(m)m(ust)f(b)s(e)f(equal)0 4383 y(to)k(0)g(on)f(input,)g
-(otherwise)g(the)g(function)f(will)f(immediately)g(exit)i(without)g
-(doing)f(an)m(ything.)58 b(A)36 b(non-zero)0 4496 y(output)27
-b(v)-5 b(alue)26 b(indicates)h(that)g(an)g(error)g(o)s(ccurred)g(in)f
-(the)h(function.)38 b(In)27 b(most)g(cases)h(the)g(status)f(v)-5
-b(alue)27 b(is)f(also)0 4608 y(returned)j(as)i(the)f(v)-5
-b(alue)30 b(of)h(the)f(function)f(itself.)0 4998 y Fe(7.1)135
-b(CFITSIO)44 b(Error)h(Status)h(Routines)0 5273 y Fi(1)81
-b Fj(Return)30 b(the)h(revision)e(n)m(um)m(b)s(er)h(of)h(the)g(CFITSIO)
-f(library)-8 b(.)40 b(The)31 b(revision)e(n)m(um)m(b)s(er)h(will)e(b)s
-(e)i(incremen)m(ted)227 5386 y(with)f(eac)m(h)j(new)e(release)g(of)h
-(CFITSIO.)95 5694 y Ff(float)47 b(fits_get_version)c(/)48
-b(ffvers)e(\()h(>)h(float)e(*version\))1905 5942 y Fj(67)p
-eop
-%%Page: 68 74
-68 73 bop 0 299 a Fj(68)1339 b Fh(CHAPTER)30 b(7.)111
+%%Page: 50 58
+50 57 bop 0 299 a Fj(50)1379 b Fh(CHAPTER)30 b(5.)71
 b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(2)81 b Fj(Return)27 b(a)j(descriptiv)m(e)d(text)j(string)d
-(\(30)j(c)m(har)f(max.\))41 b(corresp)s(onding)27 b(to)i(a)g(CFITSIO)e
-(error)h(status)h(co)s(de.)95 939 y Ff(void)47 b(fits_get_errstatus)c
-(/)k(ffgerr)f(\(int)h(status,)f(>)h(char)g(*err_text\))0
-1209 y Fi(3)81 b Fj(Return)35 b(the)h(top)g(\(oldest\))g(80-c)m
-(haracter)j(error)c(message)i(from)e(the)h(in)m(ternal)f(CFITSIO)f
-(stac)m(k)j(of)f(error)227 1322 y(messages)45 b(and)e(shift)g(an)m(y)h
-(remaining)e(messages)j(on)f(the)g(stac)m(k)h(up)e(one)h(lev)m(el.)81
-b(Call)42 b(this)h(routine)227 1435 y(rep)s(eatedly)25
-b(to)i(get)g(eac)m(h)g(message)f(in)f(sequence.)39 b(The)26
-b(function)e(returns)h(a)h(v)-5 b(alue)25 b(=)g(0)h(and)g(a)g(n)m(ull)d
-(error)227 1548 y(message)32 b(when)d(the)i(error)f(stac)m(k)i(is)d
-(empt)m(y)-8 b(.)95 1819 y Ff(int)47 b(fits_read_errmsg)d(/)j(ffgmsg)f
-(\(char)h(*err_msg\))0 2089 y Fi(4)81 b Fj(Prin)m(t)29
-b(out)i(the)g(error)f(message)i(corresp)s(onding)d(to)i(the)g(input)e
-(status)i(v)-5 b(alue)30 b(and)g(all)g(the)h(error)f(messages)227
-2202 y(on)d(the)h(CFITSIO)e(stac)m(k)j(to)f(the)f(sp)s(eci\014ed)f
-(\014le)g(stream)i(\(normally)e(to)i(stdout)f(or)g(stderr\).)40
-b(If)26 b(the)i(input)227 2315 y(status)j(v)-5 b(alue)30
-b(=)g(0)h(then)f(this)f(routine)g(do)s(es)h(nothing.)95
-2586 y Ff(void)47 b(fits_report_error)c(/)48 b(ffrprt)e(\(FILE)g
-(*stream,)g(>)h(status\))0 2856 y Fi(5)81 b Fj(W)-8 b(rite)33
-b(an)h(80-c)m(haracter)i(message)e(to)g(the)g(CFITSIO)e(error)h(stac)m
-(k.)51 b(Application)31 b(programs)i(should)f(not)227
-2969 y(normally)d(write)g(to)j(the)e(stac)m(k,)i(but)e(there)g(ma)m(y)h
-(b)s(e)f(some)h(situations)e(where)h(this)f(is)h(desirable.)95
-3240 y Ff(void)47 b(fits_write_errmsg)c(/)48 b(ffpmsg)e(\(char)g
-(*err_msg\))0 3510 y Fi(6)81 b Fj(Clear)39 b(the)h(en)m(tire)f(error)h
-(message)h(stac)m(k.)70 b(This)38 b(routine)h(is)g(useful)f(to)i(clear)
-g(an)m(y)g(error)f(message)i(that)227 3623 y(ma)m(y)33
-b(ha)m(v)m(e)h(b)s(een)e(generated)h(b)m(y)f(a)h(non-fatal)g(CFITSIO)e
-(error.)46 b(This)31 b(routine)g(is)h(called)f(without)h(an)m(y)227
-3736 y(argumen)m(ts.)95 4007 y Ff(void)47 b(fits_clear_errmsg)c(/)48
-b(ffcmsg)e(\(void\))0 4353 y Fe(7.2)135 b(FITS)44 b(File)i(Access)e
-(Routines)0 4606 y Fj(These)24 b(routines)f(will)e(op)s(en)i(or)i
-(close)f(a)g(new)g(or)g(existing)f(FITS)g(\014le)g(or)h(return)f
-(information)g(ab)s(out)g(the)i(op)s(ened)0 4719 y(FITS)36
-b(\014le.)58 b(These)36 b(routines)f(supp)s(ort)g(the)i(extended)f
-(\014le)g(name)g(syn)m(tax)h(that)h(is)d(describ)s(ed)f(in)i(a)g
-(previous)0 4832 y(c)m(hapter.)41 b(See)31 b(App)s(endix)d(B)i(for)g
-(the)h(de\014nition)d(of)j(the)f(parameters)h(used)e(in)h(these)g
-(routines.)0 4992 y(The)k(same)i(FITS)e(\014le)g(ma)m(y)h(b)s(e)f(op)s
-(ened)g(more)h(than)g(once)h(sim)m(ultaneously)c(and)i(the)h(resulting)
-e(p)s(oin)m(ters)h(to)0 5105 y(the)e(\014les)f(ma)m(y)i(b)s(e)f
-(treated)h(as)f(though)g(they)g(w)m(ere)h(completely)f(indep)s(enden)m
-(t)d(FITS)j(\014les.)45 b(Th)m(us,)31 b(one)i(could)0
-5217 y(op)s(en)c(a)h(FITS)f(\014le)g(t)m(wice,)h(mo)m(v)m(e)h(to)g
-(di\013eren)m(t)e(extensions)g(within)e(the)j(\014le,)f(and)g(then)h
-(read)f(or)h(write)f(data)h(to)0 5330 y(the)h(2)f(extensions)g(in)f(an)
-m(y)i(order.)0 5601 y Fi(1)81 b Fj(Op)s(en)34 b(an)h(existing)f(FITS)h
-(\014le)g(with)f(a)i(sp)s(eci\014ed)e(access)i(mo)s(de.)56
-b(The)35 b(iomo)s(de)g(parameter)h(ma)m(y)g(ha)m(v)m(e)h(a)227
-5714 y(v)-5 b(alue)30 b(of)h(READONL)-8 b(Y)31 b(or)f(READ)m(WRITE.)p
-eop
-%%Page: 69 75
-69 74 bop 0 299 a Fh(7.2.)72 b(FITS)30 b(FILE)g(A)m(CCESS)f(R)m
-(OUTINES)2244 b Fj(69)95 555 y Ff(int)47 b(fits_open_file)d(/)k(ffopen)
-286 668 y(\(fitsfile)e(**fptr,)f(char)i(*filename,)e(int)i(iomode,)f(>)
-h(int)g(*status\))0 930 y Fi(2)81 b Fj(Reop)s(en)34 b(a)i(FITS)e
-(\014le)g(that)i(w)m(as)f(previously)e(op)s(ened)i(with)e(\014ts)p
-2414 930 28 4 v 33 w(op)s(en)p 2637 930 V 32 w(\014le)h(or)h(\014ts)p
-3058 930 V 33 w(create)p 3327 930 V 34 w(\014le.)54 b(The)34
-b(new)227 1043 y(\014ts\014le)h(p)s(oin)m(ter)h(ma)m(y)h(then)f(b)s(e)f
-(treated)j(as)e(a)h(separate)g(\014le,)g(and)f(one)h(ma)m(y)g(sim)m
-(ultaneously)d(read)i(or)227 1156 y(write)d(to)i(2)f(\(or)g(more\))g
-(di\013eren)m(t)f(extensions)g(in)g(the)h(same)g(\014le.)50
-b(The)33 b(\014ts)p 2886 1156 V 32 w(op)s(en)p 3108 1156
-V 32 w(\014le)g(routine)g(\(ab)s(o)m(v)m(e\))227 1269
-y(automatically)i(detects)i(cases)f(where)e(a)i(previously)d(op)s(ened)
-h(\014le)h(is)f(b)s(eing)g(op)s(ened)g(again,)j(and)d(then)227
-1382 y(in)m(ternally)29 b(call)g(\014ts)p 930 1382 V
-33 w(reop)s(en)p 1229 1382 V 32 w(\014le,)h(so)g(programs)g(should)f
-(rarely)g(need)h(to)h(explicitly)d(call)i(this)f(routine.)95
-1644 y Ff(int)47 b(fits_reopen_file)d(/)j(ffreopen)286
-1757 y(\(fitsfile)f(*openfptr,)f(fitsfile)g(**newfptr,)g(>)j(int)f
-(*status\))0 2019 y Fi(3)81 b Fj(Create)32 b(a)g(new)g(empt)m(y)g(FITS)
-f(\014le.)44 b(A)32 b(template)g(\014le)f(ma)m(y)h(also)g(b)s(e)f(sp)s
-(eci\014ed)f(to)i(de\014ne)g(the)f(structure)h(of)227
-2132 y(the)37 b(new)f(\014le)g(\(see)i(secion)e(4.2.4\).)62
-b(An)36 b(error)g(will)e(b)s(e)i(returned)g(if)f(the)i(sp)s(eci\014ed)e
-(\014le)h(already)g(exists)227 2245 y(unless)j(the)h(\014lename)g(is)f
-(pre\014xed)g(with)g(an)i(exclamation)f(p)s(oin)m(t)g(\(!\).)71
-b(In)40 b(that)g(case)i(CFITSIO)d(will)227 2358 y(o)m(v)m(erwrite)31
-b(the)f(existing)f(\014le.)39 b(Note)31 b(that)g(the)f(exclamation)g(p)
-s(oin)m(t,)f(')10 b(!',)31 b(is)e(a)h(sp)s(ecial)f(UNIX)h(c)m
-(haracter,)227 2471 y(so)25 b(if)f(it)g(is)g(used)g(on)g(the)h(command)
-g(line)e(rather)h(than)h(en)m(tered)g(at)h(a)f(task)g(prompt,)g(it)g(m)
-m(ust)f(b)s(e)g(preceded)227 2583 y(b)m(y)31 b(a)f(bac)m(kslash)g(to)h
-(force)g(the)g(UNIX)g(shell)d(to)j(ignore)f(it.)95 2845
-y Ff(int)47 b(fits_create_file)d(/)j(ffinit)286 2958
-y(\(fitsfile)f(**fptr,)f(char)i(*filename,)e(>)j(int)e(*status\))0
-3220 y Fi(4)81 b Fj(Create)24 b(a)g(new)f(FITS)g(\014le,)h(using)e(a)i
-(template)g(\014le)e(to)j(de\014ne)d(its)h(initial)e(size)j(and)f
-(structure.)37 b(The)24 b(template)227 3333 y(ma)m(y)i(b)s(e)f(another)
-g(FITS)g(HDU)h(or)f(an)g(ASCI)s(I)f(template)i(\014le.)38
-b(If)25 b(the)g(input)f(template)h(\014le)g(name)g(p)s(oin)m(ter)227
-3446 y(is)i(n)m(ull,)g(then)g(this)g(routine)f(b)s(eha)m(v)m(es)j(the)f
-(same)g(as)g(\014ts)p 2160 3446 V 32 w(create)p 2428
-3446 V 35 w(\014le.)39 b(The)27 b(curren)m(tly)g(supp)s(orted)f(format)
-227 3559 y(of)33 b(the)g(ASCI)s(I)e(template)i(\014le)e(is)h(describ)s
-(ed)e(under)h(the)i(\014ts)p 2350 3559 V 33 w(parse)p
-2591 3559 V 32 w(template)g(routine)f(\(in)f(the)i(general)227
-3672 y(Utilities)c(section\))95 3934 y Ff(int)47 b
-(fits_create_template)c(/)k(fftplt)286 4047 y(\(fitsfile)f(**fptr,)f
-(char)i(*filename,)e(char)i(*tpltfile)e(>)i(int)g(*status\))0
-4309 y Fi(5)81 b Fj(Close)30 b(a)g(previously)e(op)s(ened)i(FITS)g
-(\014le.)95 4571 y Ff(int)47 b(fits_close_file)d(/)j(ffclos)g
-(\(fitsfile)e(*fptr,)h(>)h(int)g(*status\))0 4833 y Fi(6)81
-b Fj(Close)30 b(and)h(DELETE)f(a)i(FITS)e(disk)g(\014le)g(previously)f
-(op)s(ened)h(with)g(\013op)s(en)g(or)h(\016nit.)42 b(This)29
-b(routine)h(ma)m(y)227 4946 y(b)s(e)k(useful)f(in)g(cases)i(where)f(a)h
-(FITS)e(\014le)h(is)f(created)j(but)d(then)h(an)h(error)f(o)s(ccurs)g
-(whic)m(h)f(prev)m(en)m(ts)i(the)227 5059 y(\014le)30
-b(from)g(b)s(eing)f(completed.)95 5321 y Ff(int)47 b(fits_delete_file)d
-(/)j(ffdelt)286 5434 y(\(fitsfile)f(*fptr,)g(>)h(int)g(*status\))0
-5696 y Fi(7)81 b Fj(Return)29 b(the)i(name)f(of)h(the)f(op)s(ened)g
-(FITS)g(\014le.)p eop
-%%Page: 70 76
-70 75 bop 0 299 a Fj(70)1339 b Fh(CHAPTER)30 b(7.)111
+555 y Fj(In)25 b(the)g(case)i(of)e(binary)f(tables)h(with)f(v)m(ector)j
+(elemen)m(ts,)g(the)f('felem')f(parameter)h(de\014nes)f(the)g(starting)
+g(elemen)m(t)0 668 y(\(b)s(eginning)g(with)h(1,)i(not)g(0\))g(within)d
+(the)i(cell)g(\(a)h(cell)e(is)g(de\014ned)g(as)i(the)f(in)m(tersection)
+g(of)h(a)f(ro)m(w)h(and)e(a)i(column)0 781 y(and)e(ma)m(y)h(con)m(tain)
+g(a)h(single)d(v)-5 b(alue)26 b(or)h(a)g(v)m(ector)h(of)f(v)-5
+b(alues\).)39 b(The)26 b(felem)h(parameter)g(is)f(ignored)f(when)h
+(dealing)0 894 y(with)33 b(ASCI)s(I)f(tables.)51 b(Similarly)-8
+b(,)32 b(in)g(the)j(case)f(of)h(binary)d(tables)h(the)i('nelemen)m(ts')
+f(parameter)g(sp)s(eci\014es)f(the)0 1007 y(total)27
+b(n)m(um)m(b)s(er)e(of)h(v)m(ector)i(v)-5 b(alues)26
+b(to)h(b)s(e)e(read)h(or)h(written)e(\(con)m(tin)m(uing)h(on)g
+(subsequen)m(t)f(ro)m(ws)i(if)e(required\))g(and)0 1120
+y(not)31 b(the)f(n)m(um)m(b)s(er)f(of)i(table)f(cells.)0
+1383 y Fi(1)81 b Fj(W)-8 b(rite)30 b(elemen)m(ts)h(in)m(to)f(an)h(ASCI)
+s(I)e(or)h(binary)e(table)j(column.)0 1647 y(The)38 b(\014rst)f
+(routine)g(simply)f(writes)h(the)h(arra)m(y)h(of)f(v)-5
+b(alues)38 b(to)h(the)f(FITS)g(\014le)f(\(doing)g(data)i(t)m(yp)s(e)g
+(con)m(v)m(ersion)0 1760 y(if)g(necessary\))i(whereas)f(the)h(second)f
+(routine)g(will)d(substitute)j(the)g(appropriate)f(FITS)h(n)m(ull)e(v)
+-5 b(alue)40 b(for)g(all)0 1873 y(elemen)m(ts)33 b(whic)m(h)f(are)h
+(equal)g(to)g(the)g(input)e(v)-5 b(alue)33 b(of)g(n)m(ulv)-5
+b(al)31 b(\(note)j(that)f(this)f(parameter)h(giv)m(es)h(the)f(address)0
+1986 y(of)40 b(n)m(ulv)-5 b(al,)42 b(not)e(the)g(n)m(ull)e(v)-5
+b(alue)40 b(itself)7 b(\).)70 b(F)-8 b(or)40 b(in)m(teger)h(columns)e
+(the)h(FITS)g(n)m(ull)e(v)-5 b(alue)39 b(is)h(de\014ned)f(b)m(y)h(the)0
+2099 y(TNULLn)32 b(k)m(eyw)m(ord)i(\(an)g(error)e(is)h(returned)f(if)g
+(the)i(k)m(eyw)m(ord)f(do)s(esn't)g(exist\).)50 b(F)-8
+b(or)34 b(\015oating)f(p)s(oin)m(t)f(columns)0 2212 y(the)i(sp)s(ecial)
+f(IEEE)h(NaN)h(\(Not-a-Num)m(b)s(er\))h(v)-5 b(alue)34
+b(will)d(b)s(e)j(written)f(in)m(to)i(the)f(FITS)g(\014le.)51
+b(If)34 b(a)h(n)m(ull)d(p)s(oin)m(ter)0 2325 y(is)g(en)m(tered)h(for)g
+(n)m(ulv)-5 b(al,)32 b(then)h(the)g(n)m(ull)e(v)-5 b(alue)32
+b(is)g(ignored)g(and)h(this)f(routine)f(b)s(eha)m(v)m(es)j(the)f(same)g
+(as)h(the)f(\014rst)0 2437 y(routine.)39 b(The)26 b(second)i(routine)e
+(m)m(ust)h(not)h(b)s(e)e(used)h(to)h(write)e(to)i(v)-5
+b(ariable)26 b(length)h(arra)m(y)h(columns.)38 b(The)27
+b(third)0 2550 y(routine)i(simply)f(writes)i(unde\014ned)e(pixel)h(v)-5
+b(alues)29 b(to)i(the)g(column.)95 2814 y Fe(int)47 b(fits_write_col)d
+(/)k(ffpcl)286 2927 y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(int)i
+(colnum,)f(long)g(firstrow,)334 3040 y(long)h(firstelem,)e(long)h
+(nelements,)f(DTYPE)i(*array,)f(>)h(int)g(*status\))95
+3266 y(int)g(fits_write_colnull)c(/)48 b(ffpcn)286 3379
+y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(int)i(colnum,)f(long)g
+(firstrow,)286 3491 y(long)h(firstelem,)e(long)i(nelements,)e(DTYPE)h
+(*array,)g(DTYPE)g(*nulval,)286 3604 y(>)i(int)f(*status\))143
+3830 y(int)g(fits_write_col_null)c(/)k(ffpclu)334 3943
+y(\(fitsfile)e(*fptr,)h(int)h(colnum,)f(long)h(firstrow,)e(long)i
+(firstelem,)382 4056 y(long)f(nelements,)f(>)j(int)f(*status\))0
+4320 y Fi(2)81 b Fj(Read)33 b(elemen)m(ts)h(from)f(an)g(ASCI)s(I)f(or)i
+(binary)d(table)i(column.)49 b(The)33 b(data)h(t)m(yp)s(e)g(parameter)g
+(sp)s(eci\014es)e(the)227 4433 y(data)c(t)m(yp)s(e)g(of)g(the)f(`n)m
+(ulv)-5 b(al')27 b(and)g(`arra)m(y')h(p)s(oin)m(ters;)g(Unde\014ned)d
+(arra)m(y)j(elemen)m(ts)g(will)d(b)s(e)i(returned)f(with)227
+4545 y(a)k(v)-5 b(alue)29 b(=)f(*n)m(ullv)-5 b(al,)28
+b(\(note)i(that)g(this)e(parameter)i(giv)m(es)f(the)h(address)e(of)h
+(the)h(n)m(ull)d(v)-5 b(alue,)29 b(not)h(the)f(n)m(ull)227
+4658 y(v)-5 b(alue)30 b(itself)7 b(\))30 b(unless)f(n)m(ulv)-5
+b(al)30 b(=)g(0)h(or)g(*n)m(ulv)-5 b(al)29 b(=)i(0,)g(in)e(whic)m(h)h
+(case)i(no)e(c)m(hec)m(king)i(for)e(unde\014ned)f(pixels)227
+4771 y(will)i(b)s(e)i(p)s(erformed.)48 b(The)33 b(second)g(routine)g
+(is)f(similar)f(except)j(that)g(an)m(y)g(unde\014ned)d(pixels)h(will)f
+(ha)m(v)m(e)227 4884 y(the)g(corresp)s(onding)d(n)m(ullarra)m(y)h
+(elemen)m(t)i(set)g(equal)f(to)h(TR)m(UE)f(\(=)h(1\).)227
+5036 y(An)m(y)c(column,)f(regardless)f(of)h(it's)g(in)m(trinsic)e(data)
+j(t)m(yp)s(e,)g(ma)m(y)g(b)s(e)e(read)i(as)f(a)g(string.)39
+b(It)26 b(should)e(b)s(e)i(noted)227 5149 y(ho)m(w)m(ev)m(er)32
+b(that)f(reading)e(a)i(n)m(umeric)e(column)g(as)i(a)g(string)e(is)g(10)
+j(-)e(100)i(times)e(slo)m(w)m(er)g(than)g(reading)g(the)227
+5262 y(same)22 b(column)f(as)g(a)h(n)m(um)m(b)s(er)e(due)h(to)i(the)e
+(large)h(o)m(v)m(erhead)h(in)d(constructing)h(the)h(formatted)g
+(strings.)36 b(The)227 5375 y(displa)m(y)24 b(format)i(of)f(the)h
+(returned)e(strings)g(will)f(b)s(e)i(determined)f(b)m(y)h(the)h(TDISPn)
+e(k)m(eyw)m(ord,)j(if)d(it)h(exists,)227 5488 y(otherwise)31
+b(b)m(y)g(the)g(data)h(t)m(yp)s(e)f(of)g(the)g(column.)42
+b(The)30 b(length)h(of)g(the)g(returned)f(strings)g(\(not)h(including)
+227 5601 y(the)26 b(n)m(ull)d(terminating)i(c)m(haracter\))i(can)f(b)s
+(e)f(determined)f(with)g(the)i(\014ts)p 2703 5601 28
+4 v 32 w(get)p 2855 5601 V 34 w(col)p 3000 5601 V 33
+w(displa)m(y)p 3313 5601 V 31 w(width)e(routine.)227
+5714 y(The)30 b(follo)m(wing)f(TDISPn)g(displa)m(y)g(formats)h(are)h
+(curren)m(tly)e(supp)s(orted:)p eop
+%%Page: 51 59
+51 58 bop 0 299 a Fh(5.7.)72 b(ASCI)s(I)29 b(AND)i(BINAR)-8
+b(Y)31 b(T)-8 b(ABLE)31 b(R)m(OUTINES)1864 b Fj(51)418
+555 y Fe(Iw.m)142 b(Integer)418 668 y(Ow.m)g(Octal)47
+b(integer)418 781 y(Zw.m)142 b(Hexadecimal)45 b(integer)418
+894 y(Fw.d)142 b(Fixed)47 b(floating)e(point)418 1007
+y(Ew.d)142 b(Exponential)45 b(floating)h(point)418 1120
+y(Dw.d)142 b(Exponential)45 b(floating)h(point)418 1233
+y(Gw.d)142 b(General;)46 b(uses)g(Fw.d)h(if)g(significance)e(not)i
+(lost,)f(else)h(Ew.d)227 1449 y Fj(where)24 b(w)h(is)e(the)i(width)e
+(in)g(c)m(haracters)j(of)f(the)g(displa)m(y)m(ed)e(v)-5
+b(alues,)26 b(m)e(is)g(the)g(minim)m(um)e(n)m(um)m(b)s(er)i(of)g
+(digits)227 1562 y(displa)m(y)m(ed,)j(and)g(d)g(is)g(the)g(n)m(um)m(b)s
+(er)g(of)g(digits)g(to)h(the)g(righ)m(t)f(of)g(the)h(decimal.)39
+b(The)27 b(.m)g(\014eld)f(is)h(optional.)95 1794 y Fe(int)47
+b(fits_read_col)e(/)i(ffgcv)286 1907 y(\(fitsfile)f(*fptr,)g(int)h
+(datatype,)e(int)i(colnum,)f(long)g(firstrow,)g(long)g(firstelem,)334
+2020 y(long)h(nelements,)e(DTYPE)h(*nulval,)g(DTYPE)g(*array,)g(int)h
+(*anynul,)e(int)i(*status\))95 2245 y(int)g(fits_read_colnull)c(/)48
+b(ffgcf)286 2358 y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(int)i
+(colnum,)f(long)g(firstrow,)g(long)g(firstelem,)286 2471
+y(long)h(nelements,)e(DTYPE)h(*array,)g(char)h(*nullarray,)e(int)h
+(*anynul,)g(int)h(*status\))0 2757 y Fd(5.7.5)112 b(Ro)m(w)37
+b(Selection)f(and)j(Calculator)d(Routines)0 2976 y Fj(These)21
+b(routines)e(all)h(parse)h(and)f(ev)-5 b(aluate)22 b(an)e(input)f
+(string)h(con)m(taining)h(a)g(user)f(de\014ned)g(arithmetic)g
+(expression.)0 3089 y(The)29 b(\014rst)f(3)i(routines)e(select)i(ro)m
+(ws)f(in)f(a)i(FITS)e(table,)i(based)f(on)g(whether)g(the)g(expression)
+f(ev)-5 b(aluates)30 b(to)g(true)0 3202 y(\(not)e(equal)e(to)i(zero\))g
+(or)f(false)g(\(zero\).)41 b(The)27 b(other)g(routines)f(ev)-5
+b(aluate)28 b(the)f(expression)f(and)g(calculate)i(a)f(v)-5
+b(alue)0 3315 y(for)26 b(eac)m(h)i(ro)m(w)f(of)g(the)g(table.)39
+b(The)26 b(allo)m(w)m(ed)h(expression)e(syn)m(tax)j(is)d(describ)s(ed)g
+(in)g(the)i(ro)m(w)g(\014lter)f(section)g(in)g(the)0
+3428 y(`Extended)32 b(File)f(Name)i(Syn)m(tax')g(c)m(hapter)g(of)f
+(this)f(do)s(cumen)m(t.)46 b(The)32 b(expression)f(ma)m(y)i(also)f(b)s
+(e)f(written)h(to)h(a)0 3541 y(text)h(\014le,)g(and)f(the)h(name)f(of)h
+(the)f(\014le,)h(prep)s(ended)d(with)h(a)i('@')g(c)m(haracter)h(ma)m(y)
+f(b)s(e)f(supplied)d(for)j(the)h('expr')0 3654 y(parameter)d(\(e.g.)42
+b('@\014lename.txt'\).)f(The)30 b(expression)f(in)g(the)h(\014le)g(can)
+g(b)s(e)g(arbitrarily)d(complex)j(and)g(extend)0 3767
+y(o)m(v)m(er)35 b(m)m(ultiple)d(lines)h(of)h(the)g(\014le.)52
+b(Lines)32 b(that)j(b)s(egin)e(with)g(2)h(slash)f(c)m(haracters)j
+(\('//'\))g(will)c(b)s(e)h(ignored)h(and)0 3880 y(ma)m(y)d(b)s(e)f
+(used)f(to)i(add)f(commen)m(ts)h(to)h(the)e(\014le.)0
+4111 y Fi(1)81 b Fj(Ev)-5 b(aluate)37 b(a)g(b)s(o)s(olean)f(expression)
+g(o)m(v)m(er)i(the)g(indicated)d(ro)m(ws,)k(returning)c(an)i(arra)m(y)h
+(of)f(\015ags)g(indicating)227 4224 y(whic)m(h)29 b(ro)m(ws)i(ev)-5
+b(aluated)30 b(to)h(TR)m(UE/F)-10 b(ALSE)95 4455 y Fe(int)47
+b(fits_find_rows)d(/)k(fffrow)286 4568 y(\(fitsfile)e(*fptr,)93
+b(char)47 b(*expr,)f(long)h(firstrow,)e(long)i(nrows,)286
+4681 y(>)h(long)e(*n_good_rows,)f(char)h(*row_status,)92
+b(int)47 b(*status\))0 4912 y Fi(2)81 b Fj(Find)28 b(the)j(\014rst)f
+(ro)m(w)g(whic)m(h)f(satis\014es)h(the)h(input)d(b)s(o)s(olean)h
+(expression)95 5144 y Fe(int)47 b(fits_find_first_row)c(/)k(ffffrw)286
+5257 y(\(fitsfile)f(*fptr,)93 b(char)47 b(*expr,)f(>)i(long)e(*rownum,)
+g(int)h(*status\))0 5488 y Fi(3)81 b Fj(Ev)-5 b(aluate)34
+b(an)g(expression)g(on)g(all)f(ro)m(ws)i(of)f(a)h(table.)53
+b(If)34 b(the)g(input)f(and)h(output)g(\014les)f(are)i(not)g(the)f
+(same,)227 5601 y(cop)m(y)39 b(the)f(TR)m(UE)g(ro)m(ws)h(to)f(the)h
+(output)e(\014le.)63 b(If)38 b(the)g(\014les)f(are)i(the)f(same,)j
+(delete)d(the)g(F)-10 b(ALSE)38 b(ro)m(ws)227 5714 y(\(preserv)m(e)31
+b(the)g(TR)m(UE)f(ro)m(ws\).)p eop
+%%Page: 52 60
+52 59 bop 0 299 a Fj(52)1379 b Fh(CHAPTER)30 b(5.)71
 b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
-555 y Ff(int)47 b(fits_file_name)d(/)k(ffflnm)286 668
-y(\(fitsfile)e(*fptr,)g(>)h(char)g(*filename,)e(int)i(*status\))0
-915 y Fi(8)81 b Fj(Return)29 b(the)i(I/O)f(mo)s(de)g(of)h(the)f(op)s
-(en)g(FITS)f(\014le)h(\(READONL)-8 b(Y)31 b(or)g(READ)m(WRITE\).)95
-1162 y Ff(int)47 b(fits_file_mode)d(/)k(ffflmd)286 1275
-y(\(fitsfile)e(*fptr,)g(>)h(int)g(*iomode,)f(int)h(*status\))0
-1522 y Fi(9)81 b Fj(Return)29 b(the)i(\014le)e(t)m(yp)s(e)i(of)f(the)h
-(op)s(ened)e(FITS)h(\014le)g(\(e.g.)42 b('\014le://',)31
-b('ftp://',)h(etc.\).)95 1769 y Ff(int)47 b(fits_url_type)e(/)i(ffurlt)
-286 1882 y(\(fitsfile)f(*fptr,)g(>)h(char)g(*urltype,)e(int)i
-(*status\))0 2129 y Fi(10)f Fj(P)m(arse)27 b(the)f(input)e(\014lename)i
-(or)g(URL)g(in)m(to)g(its)g(comp)s(onen)m(t)g(parts:)39
-b(the)26 b(\014le)f(t)m(yp)s(e)i(\(\014le://,)g(ftp://,)h(h)m(ttp://,)
-227 2242 y(etc\),)34 b(the)e(base)g(input)d(\014le)i(name,)h(the)g
-(name)g(of)g(the)g(output)f(\014le)g(that)h(the)g(input)e(\014le)g(is)h
-(to)h(b)s(e)f(copied)227 2355 y(to)38 b(prior)d(to)i(op)s(ening,)g(the)
-g(HDU)g(or)f(extension)h(sp)s(eci\014cation,)g(the)g(\014ltering)d(sp)s
-(eci\014er,)j(the)g(binning)227 2468 y(sp)s(eci\014er,)27
-b(and)h(the)g(column)f(sp)s(eci\014er.)38 b(Null)26 b(strings)h(will)e
-(b)s(e)j(returned)f(for)g(an)m(y)i(comp)s(onen)m(ts)f(that)h(are)227
-2581 y(not)i(presen)m(t)f(in)f(the)i(input)d(\014le)i(name.)95
-2828 y Ff(int)47 b(fits_parse_input_url)c(/)k(ffiurl)286
-2940 y(\(char)g(*filename,)e(>)i(char)g(*filetype,)e(char)h(*infile,)g
-(char)h(*outfile,)e(char)334 3053 y(*extspec,)g(char)i(*filter,)f(char)
-g(*binspec,)f(char)i(*colspec,)e(int)i(*status\))0 3300
-y Fi(11)f Fj(P)m(arse)32 b(the)g(input)d(\014lename)i(and)g(return)f
-(the)i(HDU)g(n)m(um)m(b)s(er)e(that)i(w)m(ould)e(b)s(e)h(mo)m(v)m(ed)i
-(to)f(if)e(the)i(\014le)e(w)m(ere)227 3413 y(op)s(ened)j(with)f(\014ts)
-p 878 3413 28 4 v 32 w(op)s(en)p 1100 3413 V 32 w(\014le.)48
-b(The)33 b(returned)f(HDU)i(n)m(um)m(b)s(er)e(b)s(egins)g(with)g(1)h
-(for)g(the)g(primary)f(arra)m(y)-8 b(,)227 3526 y(so)40
-b(for)f(example,)j(if)c(the)i(input)d(\014lename)i(=)g(`m)m
-(y\014le.\014ts[2]')h(then)f(hdun)m(um)e(=)i(3)h(will)d(b)s(e)i
-(returned.)227 3639 y(CFITSIO)j(do)s(es)i(not)g(op)s(en)f(the)g(\014le)
-g(to)i(c)m(hec)m(k)g(if)d(the)i(extension)g(actually)f(exists)g(if)g
-(an)g(extension)227 3752 y(n)m(um)m(b)s(er)36 b(is)f(sp)s(eci\014ed.)58
-b(If)36 b(an)g(extension)h(*name*)g(is)f(included)e(in)h(the)i(\014le)e
-(name)i(sp)s(eci\014cation)e(\(e.g.)227 3865 y(`m)m
-(y\014le.\014ts[EVENTS]')44 b(then)f(this)g(routine)g(will)f(ha)m(v)m
-(e)j(to)f(op)s(en)g(the)g(FITS)f(\014le)g(and)g(lo)s(ok)h(for)g(the)227
-3978 y(p)s(osition)29 b(of)h(the)h(named)f(extension,)h(then)f(close)h
-(\014le)e(again.)41 b(This)29 b(is)g(not)i(p)s(ossible)d(if)i(the)g
-(\014le)g(is)f(b)s(eing)227 4091 y(read)34 b(from)f(the)h(stdin)e
-(stream,)j(and)f(an)f(error)g(will)f(b)s(e)h(returned)f(in)h(this)f
-(case.)52 b(If)33 b(the)h(\014lename)f(do)s(es)227 4204
-y(not)42 b(sp)s(ecify)f(an)h(explicit)e(extension)i(\(e.g.)76
-b('m)m(y\014le.\014ts'\))42 b(then)g(hdun)m(um)e(=)h(-99)i(will)d(b)s
-(e)h(returned,)227 4317 y(whic)m(h)34 b(is)g(functionally)f(equiv)-5
-b(alen)m(t)34 b(to)i(hdun)m(um)d(=)h(1.)55 b(This)33
-b(routine)h(is)g(mainly)g(used)g(for)g(bac)m(kw)m(ard)227
-4430 y(compatibilit)m(y)h(in)h(the)g(fto)s(ols)h(soft)m(w)m(are)h(pac)m
-(k)-5 b(age)39 b(and)d(is)f(not)i(recommended)g(for)f(general)h(use.)59
-b(It)37 b(is)227 4542 y(generally)i(b)s(etter)g(and)g(more)g(e\016cien)
-m(t)h(to)g(\014rst)e(op)s(en)h(the)g(FITS)g(\014le)f(with)g(\014ts)p
-3125 4542 V 32 w(op)s(en)p 3347 4542 V 33 w(\014le,)i(then)f(use)227
-4655 y(\014ts)p 354 4655 V 33 w(get)p 507 4655 V 34 w(hdu)p
-694 4655 V 31 w(n)m(um)c(to)i(determine)f(whic)m(h)f(HDU)i(in)e(the)i
-(\014le)e(has)h(b)s(een)g(op)s(ened,)h(rather)f(than)g(calling)227
-4768 y(\014ts)p 354 4768 V 33 w(parse)p 595 4768 V 32
-w(input)p 841 4768 V 31 w(url)29 b(follo)m(w)m(ed)h(b)m(y)g(a)h(call)e
-(to)j(\014ts)p 1967 4768 V 32 w(op)s(en)p 2189 4768 V
-32 w(\014le.)143 5015 y Ff(int)47 b(fits_parse_extnum)c(/)48
-b(ffextn)334 5128 y(\(char)e(*filename,)f(>)j(int)f(*hdunum,)e(int)i
-(*status\))0 5375 y Fi(12)f Fj(P)m(arse)e(the)g(input)e(\014le)h(name)g
-(and)g(return)g(the)h(ro)s(ot)g(\014le)e(name.)81 b(The)43
-b(ro)s(ot)h(name)g(includes)d(the)j(\014le)227 5488 y(t)m(yp)s(e)35
-b(if)f(sp)s(eci\014ed,)h(\(e.g.)56 b('ftp://')37 b(or)e('h)m(ttp://'\))
-i(and)d(the)h(full)e(path)i(name,)h(to)g(the)f(exten)m(t)i(that)e(it)g
-(is)227 5601 y(sp)s(eci\014ed)24 b(in)f(the)j(input)d(\014lename.)38
-b(It)25 b(do)s(es)g(not)g(enclude)f(the)h(HDU)h(name)f(or)g(n)m(um)m(b)
-s(er,)g(or)g(an)m(y)h(\014ltering)227 5714 y(sp)s(eci\014cations.)p
-eop
-%%Page: 71 77
-71 76 bop 0 299 a Fh(7.3.)72 b(HDU)31 b(A)m(CCESS)e(R)m(OUTINES)2488
-b Fj(71)143 555 y Ff(int)47 b(fits_parse_rootname)c(/)k(ffrtnm)334
-668 y(\(char)f(*filename,)f(>)j(char)f(*rootname,)e(int)h(*status\);)0
-1006 y Fe(7.3)135 b(HDU)46 b(Access)e(Routines)0 1257
-y Fj(The)37 b(follo)m(wing)f(functions)g(p)s(erform)h(op)s(erations)f
-(on)i(Header-Data)i(Units)d(\(HDUs\))i(as)f(a)g(whole.)61
-b(See)38 b(Ap-)0 1370 y(p)s(endix)28 b(B)j(for)f(the)g(de\014nition)e
-(of)j(the)g(parameters)f(used)g(in)f(these)i(routines.)0
-1633 y Fi(1)81 b Fj(Mo)m(v)m(e)29 b(to)f(a)g(sp)s(eci\014ed)d(absolute)
-i(HDU)i(n)m(um)m(b)s(er)d(in)g(the)h(FITS)g(\014le.)39
-b(A)27 b(n)m(ull)e(p)s(oin)m(ter)i(ma)m(y)h(b)s(e)e(giv)m(en)i(for)f
-(the)227 1745 y(hdut)m(yp)s(e)i(parameter)i(if)f(it's)g(v)-5
-b(alue)29 b(is)h(not)g(needed.)95 2009 y Ff(int)47 b(fits_movabs_hdu)d
-(/)j(ffmahd)286 2121 y(\(fitsfile)f(*fptr,)g(int)h(hdunum,)e(>)j(int)f
-(*hdutype,)e(int)i(*status\))0 2384 y Fi(2)81 b Fj(Mo)m(v)m(e)23
-b(a)f(relativ)m(e)f(n)m(um)m(b)s(er)f(of)h(HDUs)h(forw)m(ard)f(or)g
-(bac)m(kw)m(ards)h(in)e(the)h(FITS)g(\014le)f(from)h(the)h(curren)m(t)f
-(p)s(osition.)227 2497 y(A)31 b(n)m(ull)d(p)s(oin)m(ter)h(ma)m(y)i(b)s
-(e)f(giv)m(en)h(for)f(the)g(hdut)m(yp)s(e)f(parameter)i(if)e(it's)h(v)
--5 b(alue)30 b(is)g(not)g(needed.)95 2760 y Ff(int)47
-b(fits_movrel_hdu)d(/)j(ffmrhd)286 2873 y(\(fitsfile)f(*fptr,)g(int)h
-(nmove,)f(>)h(int)g(*hdutype,)e(int)i(*status\))0 3136
-y Fi(3)81 b Fj(Mo)m(v)m(e)22 b(to)f(the)f(\(\014rst\))h(HDU)g(whic)m(h)
-e(has)h(the)g(sp)s(eci\014ed)f(extension)h(t)m(yp)s(e)g(and)g(EXTNAME)g
-(\(or)h(HDUNAME\))227 3249 y(and)32 b(EXTVER)g(k)m(eyw)m(ord)h(v)-5
-b(alues.)47 b(The)32 b(hdut)m(yp)s(e)f(parameter)i(ma)m(y)h(ha)m(v)m(e)
-f(a)g(v)-5 b(alue)32 b(of)h(IMA)m(GE)p 3640 3249 28 4
-v 34 w(HDU,)227 3362 y(ASCI)s(I)p 486 3362 V 32 w(TBL,)f(BINAR)-8
-b(Y)p 1122 3362 V 34 w(TBL,)32 b(or)h(ANY)p 1718 3362
-V 33 w(HDU)g(where)f(ANY)p 2458 3362 V 33 w(HDU)i(means)e(that)h(only)f
-(the)g(extname)227 3475 y(and)k(extv)m(er)h(v)-5 b(alues)35
-b(will)e(b)s(e)i(used)g(to)i(lo)s(cate)g(the)f(correct)h(extension.)57
-b(If)35 b(the)h(input)e(v)-5 b(alue)36 b(of)g(extv)m(er)227
-3588 y(is)c(0)h(then)f(the)g(EXTVER)h(k)m(eyw)m(ord)g(is)e(ignored)h
-(and)g(the)g(\014rst)g(HDU)h(with)e(a)i(matc)m(hing)g(EXTNAME)227
-3701 y(\(or)j(HDUNAME\))h(k)m(eyw)m(ord)f(will)c(b)s(e)j(found.)55
-b(If)34 b(no)i(matc)m(hing)f(HDU)h(is)f(found)f(in)g(the)h(\014le)g
-(then)g(the)227 3814 y(curren)m(t)30 b(HDU)i(will)27
-b(remain)j(unc)m(hanged)g(and)f(a)i(status)g(=)f(BAD)p
-2535 3814 V 34 w(HDU)p 2774 3814 V 33 w(NUM)h(will)d(b)s(e)i(returned.)
-95 4077 y Ff(int)47 b(fits_movnam_hdu)d(/)j(ffmnhd)286
-4190 y(\(fitsfile)f(*fptr,)g(int)h(hdutype,)e(char)i(*extname,)e(int)i
-(extver,)f(>)h(int)g(*status\))0 4453 y Fi(4)81 b Fj(Return)35
-b(the)i(n)m(um)m(b)s(er)e(of)i(the)f(curren)m(t)h(HDU)g(in)e(the)i
-(FITS)e(\014le)h(\(primary)f(arra)m(y)i(=)f(1\).)60 b(This)34
-b(function)227 4566 y(returns)29 b(the)i(HDU)g(n)m(um)m(b)s(er)e
-(rather)h(than)h(a)f(status)h(v)-5 b(alue.)95 4829 y
-Ff(int)47 b(fits_get_hdu_num)d(/)j(ffghdn)286 4942 y(\(fitsfile)f
-(*fptr,)g(>)h(int)g(*hdunum\))0 5205 y Fi(5)81 b Fj(Return)38
-b(the)h(t)m(yp)s(e)h(of)f(the)h(curren)m(t)f(HDU)h(in)e(the)h(FITS)g
-(\014le.)66 b(The)39 b(p)s(ossible)e(v)-5 b(alues)38
-b(for)h(hdut)m(yp)s(e)f(are:)227 5318 y(IMA)m(GE)p 546
-5318 V 34 w(HDU,)31 b(ASCI)s(I)p 1095 5318 V 32 w(TBL,)f(or)g(BINAR)-8
-b(Y)p 1840 5318 V 34 w(TBL.)95 5581 y Ff(int)47 b(fits_get_hdu_type)c
-(/)48 b(ffghdt)286 5694 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*hdutype,)e
-(int)i(*status\))p eop
-%%Page: 72 78
-72 77 bop 0 299 a Fj(72)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(6)81 b Fj(Return)29 b(the)i(total)g(n)m(um)m(b)s(er)e(of)i
-(HDUs)f(in)g(the)g(FITS)g(\014le.)40 b(The)29 b(CHDU)i(remains)e(unc)m
-(hanged.)95 775 y Ff(int)47 b(fits_get_num_hdus)c(/)48
-b(ffthdu)286 888 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*hdunum,)f(int)h
-(*status\))0 1107 y Fi(7)81 b Fj(Create)36 b(a)f(new)g(primary)f(arra)m
-(y)i(or)f(IMA)m(GE)h(extension.)56 b(If)34 b(the)i(FITS)f(\014le)f(is)g
-(curren)m(tly)h(empt)m(y)h(then)f(a)227 1220 y(primary)29
-b(arra)m(y)i(is)e(created,)j(otherwise)e(a)g(new)g(IMA)m(GE)h
-(extension)f(is)g(app)s(ended)f(to)i(the)f(\014le.)95
-1440 y Ff(int)47 b(fits_create_img)d(/)j(ffcrim)286 1553
-y(\()h(fitsfile)d(*fptr,)h(int)h(bitpix,)f(int)h(naxis,)f(long)h
-(*naxes,)f(>)h(int)g(*status\))0 1773 y Fi(8)81 b Fj(Create)40
-b(a)f(new)g(ASCI)s(I)e(or)i(bin)m(table)f(table)h(extension.)67
-b(If)39 b(the)g(FITS)g(\014le)f(is)g(curren)m(tly)g(empt)m(y)i(then)f
-(a)227 1886 y(dumm)m(y)25 b(primary)e(arra)m(y)j(will)d(b)s(e)i
-(created)i(b)s(efore)e(app)s(ending)e(the)j(table)f(extension)h(to)g
-(it.)39 b(The)25 b(tblt)m(yp)s(e)227 1998 y(parameter)39
-b(de\014nes)e(the)h(t)m(yp)s(e)h(of)f(table)g(and)f(can)i(ha)m(v)m(e)g
-(v)-5 b(alues)38 b(of)g(ASCI)s(I)p 2924 1998 28 4 v 31
-w(TBL)g(or)g(BINAR)-8 b(Y)p 3659 1998 V 34 w(TBL.)227
-2111 y(The)29 b(naxis2)f(parameter)i(giv)m(es)f(the)h(initial)c(n)m(um)
-m(b)s(er)i(of)h(ro)m(ws)g(to)h(b)s(e)f(created)h(in)e(the)h(table,)g
-(and)g(should)227 2224 y(normally)f(b)s(e)h(set)h(=)g(0.)40
-b(CFITSIO)29 b(will)e(automatically)i(increase)h(the)f(size)h(of)g(the)
-g(table)f(as)h(additional)227 2337 y(ro)m(ws)d(are)g(written.)39
-b(A)27 b(non-zero)g(n)m(um)m(b)s(er)f(of)h(ro)m(ws)g(ma)m(y)g(b)s(e)f
-(sp)s(eci\014ed)f(to)j(reserv)m(e)f(space)h(for)e(that)i(man)m(y)227
-2450 y(ro)m(ws,)41 b(ev)m(en)e(if)f(a)h(few)m(er)g(n)m(um)m(b)s(er)e
-(of)i(ro)m(ws)f(will)e(b)s(e)i(written.)65 b(The)38 b(tunit)f(and)h
-(extname)i(parameters)227 2563 y(are)e(optional)e(and)h(a)h(n)m(ull)d
-(p)s(oin)m(ter)h(ma)m(y)i(b)s(e)f(giv)m(en)g(if)g(they)g(are)h(not)f
-(de\014ned.)61 b(The)37 b(FITS)f(Standard)227 2676 y(recommends)29
-b(that)h(only)f(letters,)h(digits,)f(and)g(the)g(underscore)g(c)m
-(haracter)i(b)s(e)e(used)g(in)f(column)g(names)227 2789
-y(\(the)22 b(tt)m(yp)s(e)f(parameter\))h(with)e(no)h(em)m(b)s(edded)f
-(spaces\).)38 b(T)-8 b(railing)19 b(blank)h(c)m(haracters)i(are)f(not)h
-(signi\014can)m(t.)227 2902 y(It)36 b(is)f(recommended)g(that)i(all)e
-(the)h(column)e(names)i(in)e(a)j(giv)m(en)e(table)h(b)s(e)f(unique)f
-(within)f(the)j(\014rst)g(8)227 3015 y(c)m(haracters,)25
-b(and)c(strongly)f(recommended)h(that)h(the)f(names)h(b)s(e)e(unique)g
-(within)e(the)k(\014rst)e(16)i(c)m(haracters.)95 3347
-y Ff(int)47 b(fits_create_tbl)d(/)j(ffcrtb)286 3460 y(\(fitsfile)f
-(*fptr,)g(int)h(tbltype,)e(long)i(naxis2,)f(int)h(tfields,)e(char)i
-(*ttype[],)334 3573 y(char)g(*tform[],)e(char)i(*tunit[],)e(char)i
-(*extname,)e(int)i(*status\))0 3793 y Fi(9)81 b Fj(Cop)m(y)26
-b(the)g(CHDU)h(from)e(the)i(FITS)e(\014le)g(asso)s(ciated)i(with)e
-(infptr)f(and)h(app)s(end)g(it)g(to)i(the)g(end)e(of)h(the)h(FITS)227
-3906 y(\014le)j(asso)s(ciated)h(with)f(outfptr.)41 b(Space)30
-b(ma)m(y)i(b)s(e)e(reserv)m(ed)h(for)f(MOREKEYS)g(additional)e(k)m(eyw)
-m(ords)j(in)227 4018 y(the)g(output)f(header.)95 4238
-y Ff(int)47 b(fits_copy_hdu)e(/)i(ffcopy)286 4351 y(\(fitsfile)f
-(*infptr,)f(fitsfile)h(*outfptr,)f(int)i(morekeys,)e(>)j(int)f
-(*status\))0 4571 y Fi(10)f Fj(Delete)33 b(the)g(CHDU)g(in)e(the)h
-(FITS)f(\014le.)46 b(An)m(y)32 b(follo)m(wing)f(HDUs)i(will)d(b)s(e)h
-(shifted)g(forw)m(ard)h(in)f(the)h(\014le,)g(to)227 4684
-y(\014ll)k(in)g(the)h(gap)h(created)g(b)m(y)g(the)f(deleted)g(HDU.)i
-(In)d(the)i(case)g(of)g(deleting)e(the)i(primary)d(arra)m(y)j(\(the)227
-4797 y(\014rst)30 b(HDU)h(in)e(the)i(\014le\))f(then)g(the)h(curren)m
-(t)f(primary)e(arra)m(y)j(will)d(b)s(e)i(replace)g(b)m(y)h(a)g(n)m(ull)
-d(primary)g(arra)m(y)227 4909 y(con)m(taining)j(the)h(minim)m(um)c(set)
-k(of)g(required)d(k)m(eyw)m(ords)j(and)e(no)i(data.)44
-b(If)31 b(there)g(are)h(more)f(extensions)227 5022 y(in)e(the)h(\014le)
-f(follo)m(wing)g(the)h(one)g(that)h(is)e(deleted,)h(then)g(the)g(the)g
-(CHDU)h(will)c(b)s(e)j(rede\014ned)e(to)j(p)s(oin)m(t)e(to)227
-5135 y(the)e(follo)m(wing)e(extension.)40 b(If)26 b(there)h(are)g(no)g
-(follo)m(wing)e(extensions)h(then)h(the)g(CHDU)g(will)d(b)s(e)i
-(rede\014ned)227 5248 y(to)36 b(p)s(oin)m(t)e(to)h(the)g(previous)e
-(HDU.)j(The)e(output)h(hdut)m(yp)s(e)e(parameter)i(returns)f(the)h(t)m
-(yp)s(e)g(of)f(the)h(new)227 5361 y(CHDU.)c(A)g(n)m(ull)d(p)s(oin)m
-(ter)h(ma)m(y)i(b)s(e)f(giv)m(en)h(for)f(hdut)m(yp)s(e)f(if)g(the)i
-(returned)e(v)-5 b(alue)30 b(is)f(not)i(needed.)95 5581
-y Ff(int)47 b(fits_delete_hdu)d(/)j(ffdhdu)286 5694 y(\(fitsfile)f
-(*fptr,)g(>)h(int)g(*hdutype,)e(int)i(*status\))p eop
-%%Page: 73 79
-73 78 bop 0 299 a Fh(7.4.)72 b(HEADER)31 b(KEYW)m(ORD)g(READ/WRITE)g(R)
-m(OUTINES)1495 b Fj(73)0 555 y Fe(7.4)135 b(Header)46
-b(Keyw)l(ord)g(Read/W)-11 b(rite)46 b(Routines)0 809
-y Fj(These)35 b(routines)f(read)g(or)h(write)g(k)m(eyw)m(ords)g(in)f
-(the)h(Curren)m(t)f(Header)h(Unit)f(\(CHU\).)i(Wild)e(card)g(c)m
-(haracters)0 922 y(\(*,)28 b(?,)g(or)e(#\))h(ma)m(y)g(b)s(e)f(used)g
-(when)f(sp)s(ecifying)g(the)i(name)f(of)h(the)g(k)m(eyw)m(ord)g(to)g(b)
-s(e)f(read:)39 b(a)27 b(')10 b(?')39 b(will)24 b(matc)m(h)k(an)m(y)0
-1035 y(single)33 b(c)m(haracter)i(at)g(that)f(p)s(osition)e(in)h(the)h
-(k)m(eyw)m(ord)h(name)f(and)f(a)h('*')h(will)d(matc)m(h)i(an)m(y)h
-(length)e(\(including)0 1148 y(zero\))d(string)e(of)h(c)m(haracters.)42
-b(The)28 b('#')h(c)m(haracter)i(will)26 b(matc)m(h)k(an)m(y)f
-(consecutiv)m(e)h(string)e(of)h(decimal)f(digits)f(\(0)0
-1261 y(-)35 b(9\).)55 b(When)35 b(a)g(wild)e(card)i(is)f(used)g(the)h
-(routine)f(will)e(only)i(searc)m(h)i(for)f(a)g(matc)m(h)h(from)e(the)h
-(curren)m(t)g(header)0 1374 y(p)s(osition)25 b(to)j(the)f(end)f(of)h
-(the)g(header)g(and)f(will)e(not)j(resume)g(the)g(searc)m(h)g(from)g
-(the)g(top)g(of)g(the)g(header)g(bac)m(k)g(to)0 1487
-y(the)k(original)f(header)h(p)s(osition)e(as)j(is)e(done)h(when)f(no)h
-(wildcards)e(are)j(included)c(in)i(the)h(k)m(eyw)m(ord)h(name.)43
-b(The)0 1600 y(\014ts)p 127 1600 28 4 v 32 w(read)p 331
-1600 V 33 w(record)32 b(routine)f(ma)m(y)h(b)s(e)g(used)f(to)h(set)h
-(the)f(starting)g(p)s(osition)e(when)h(doing)g(wild)e(card)j(searc)m
-(hs.)46 b(A)0 1713 y(status)29 b(v)-5 b(alue)29 b(of)g(KEY)p
-809 1713 V 32 w(NO)p 980 1713 V 33 w(EXIST)f(is)g(returned)f(if)h(the)h
-(sp)s(eci\014ed)e(k)m(eyw)m(ord)j(to)f(b)s(e)g(read)f(is)g(not)i(found)
-d(in)h(the)0 1825 y(header.)41 b(See)30 b(App)s(endix)e(B)j(for)f(the)g
-(de\014nition)e(of)j(the)f(parameters)h(used)f(in)f(these)i(routines.)0
-2102 y Fi(1)81 b Fj(Return)33 b(the)h(n)m(um)m(b)s(er)e(of)i(existing)f
-(k)m(eyw)m(ords)i(\(not)f(coun)m(ting)g(the)g(END)g(k)m(eyw)m(ord\))h
-(and)e(the)h(amoun)m(t)h(of)227 2215 y(space)e(curren)m(tly)e(a)m(v)-5
-b(ailable)31 b(for)h(more)g(k)m(eyw)m(ords.)46 b(It)32
-b(returns)e(morek)m(eys)j(=)f(-1)g(if)f(the)h(header)g(has)g(not)227
-2328 y(y)m(et)27 b(b)s(een)d(closed.)39 b(Note)26 b(that)g(CFITSIO)d
-(will)g(dynamically)g(add)h(space)i(if)e(required)f(when)h(writing)f
-(new)227 2441 y(k)m(eyw)m(ords)32 b(to)g(a)f(header)g(so)h(in)e
-(practice)h(there)h(is)e(no)h(limit)e(to)j(the)f(n)m(um)m(b)s(er)f(of)i
-(k)m(eyw)m(ords)f(that)h(can)g(b)s(e)227 2553 y(added)e(to)h(a)f
-(header.)41 b(A)30 b(n)m(ull)e(p)s(oin)m(ter)i(ma)m(y)g(b)s(e)g(en)m
-(tered)h(for)f(the)g(morek)m(eys)h(parameter)g(if)e(it's)h(v)-5
-b(alue)30 b(is)227 2666 y(not)h(needed.)95 2943 y Ff(int)47
-b(fits_get_hdrspace)c(/)48 b(ffghsp)286 3056 y(\(fitsfile)e(*fptr,)g(>)
-h(int)g(*keysexist,)e(int)i(*morekeys,)e(int)i(*status\))0
-3332 y Fi(2)81 b Fj(W)-8 b(rite)24 b(\(app)s(end\))f(a)h(new)g(k)m(eyw)
-m(ord)g(of)g(the)h(appropriate)e(datat)m(yp)s(e)h(in)m(to)g(the)h(CHU.)
-f(Note)h(that)g(the)f(address)227 3445 y(to)30 b(the)g(v)-5
-b(alue,)29 b(and)f(not)i(the)f(v)-5 b(alue)29 b(itself,)f(m)m(ust)h(b)s
-(e)g(en)m(tered.)41 b(The)28 b(datat)m(yp)s(e)i(parameter)g(sp)s
-(eci\014es)e(the)227 3558 y(datat)m(yp)s(e)43 b(of)f(the)g(k)m(eyw)m
-(ord)g(v)-5 b(alue)42 b(with)e(one)i(of)g(the)h(follo)m(wing)d(v)-5
-b(alues:)63 b(TSTRING,)41 b(TLOGICAL)227 3671 y(\(==)36
-b(in)m(t\),)i(TBYTE,)f(TSHOR)-8 b(T,)35 b(TUSHOR)-8 b(T,)36
-b(TINT,)g(TUINT,)g(TLONG,)g(TULONG,)g(TFLO)m(A)-8 b(T,)227
-3784 y(TDOUBLE.)26 b(Within)e(the)h(con)m(text)i(of)f(this)e(routine,)i
-(TSTRING)e(corresp)s(onds)g(to)i(a)g('c)m(har*')h(datat)m(yp)s(e,)227
-3896 y(i.e.,)h(a)e(p)s(oin)m(ter)g(to)h(a)f(c)m(haracter)i(arra)m(y)-8
-b(.)40 b(A)27 b(n)m(ull)d(p)s(oin)m(ter)h(ma)m(y)i(b)s(e)f(en)m(tered)h
-(for)f(the)g(commen)m(t)h(parameter)227 4009 y(whic)m(h)i(will)f(cause)
-j(the)g(commen)m(t)g(\014eld)e(to)i(b)s(e)f(left)g(blank.)95
-4286 y Ff(int)47 b(fits_write_key)d(/)k(ffpky)286 4399
-y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(char)i(*keyname,)e(DTYPE)h
-(*value,)477 4512 y(char)h(*comment,)e(>)j(int)f(*status\))0
-4788 y Fi(3)81 b Fj(W)-8 b(rite)31 b(\(up)s(date\))f(a)i(k)m(eyw)m(ord)
-f(of)g(the)g(appropriate)e(datat)m(yp)s(e)j(in)m(to)f(the)g(CHU.)g
-(This)e(routine)h(will)e(mo)s(dify)227 4901 y(the)h(v)-5
-b(alue)28 b(and)g(commen)m(t)h(\014eld)f(if)f(the)i(k)m(eyw)m(ord)g
-(already)f(exists)g(in)f(the)i(header,)g(otherwise)f(it)g(will)e(ap-)
-227 5014 y(p)s(end)e(a)i(new)e(k)m(eyw)m(ord)i(at)g(the)g(end)e(of)i
-(the)f(header.)39 b(Note)27 b(that)f(the)f(address)g(to)h(the)f(v)-5
-b(alue,)26 b(and)f(not)h(the)227 5127 y(v)-5 b(alue)30
-b(itself,)g(m)m(ust)h(b)s(e)f(en)m(tered.)43 b(The)30
-b(datat)m(yp)s(e)h(parameter)h(sp)s(eci\014es)d(the)i(datat)m(yp)s(e)h
-(of)f(the)f(k)m(eyw)m(ord)227 5240 y(v)-5 b(alue)31 b(and)g(can)h(ha)m
-(v)m(e)h(one)e(of)h(the)g(follo)m(wing)e(v)-5 b(alues:)42
-b(TSTRING,)31 b(TLOGICAL)f(\(==)h(in)m(t\),)h(TBYTE,)227
-5352 y(TSHOR)-8 b(T,)28 b(TUSHOR)-8 b(T,)28 b(TINT,)g(TUINT,)g(TLONG,)g
-(TULONG,)h(TFLO)m(A)-8 b(T,)29 b(TDOUBLE,)f(TCOM-)227
-5465 y(PLEX,)g(and)f(TDBLCOMPLEX.)g(Within)f(the)i(con)m(text)i(of)d
-(this)g(routine,)g(TSTRING)g(corresp)s(onds)f(to)227
-5578 y(a)k('c)m(har*')h(datat)m(yp)s(e,)g(i.e.,)f(a)g(p)s(oin)m(ter)e
-(to)j(a)e(c)m(haracter)j(arra)m(y)-8 b(.)41 b(A)29 b(n)m(ull)f(p)s(oin)
-m(ter)g(ma)m(y)j(b)s(e)d(en)m(tered)i(for)g(the)227 5691
-y(commen)m(t)i(parameter)f(whic)m(h)e(will)e(lea)m(v)m(e)32
-b(the)f(commen)m(t)g(\014eld)e(blank)g(\(or)i(unmo)s(di\014ed\).)p
+555 y Fe(int)47 b(fits_select_rows)d(/)j(ffsrow)286 668
+y(\(fitsfile)f(*infptr,)f(fitsfile)h(*outfptr,)93 b(char)46
+b(*expr,)94 b(>)48 b(int)f(*status)e(\))0 943 y Fi(4)81
+b Fj(Calculate)26 b(an)h(expression)e(for)i(the)f(indicated)g(ro)m(ws)g
+(of)h(a)g(table,)h(returning)d(the)i(results,)f(cast)i(as)f(datat)m(yp)
+s(e)227 1056 y(\(TSHOR)-8 b(T,)32 b(TDOUBLE,)h(etc\),)h(in)d(arra)m(y)
+-8 b(.)48 b(If)31 b(n)m(ulv)-5 b(al==NULL,)31 b(UNDEFs)i(will)c(b)s(e)j
+(zero)s(ed)g(out.)47 b(F)-8 b(or)227 1169 y(v)m(ector)37
+b(results,)e(the)g(n)m(um)m(b)s(er)e(of)i(elemen)m(ts)h(returned)d(ma)m
+(y)j(b)s(e)e(less)g(than)h(nelemen)m(ts)f(if)g(nelemen)m(ts)h(is)227
+1282 y(not)d(an)g(ev)m(en)h(m)m(ultiple)c(of)j(the)g(result)f
+(dimension.)42 b(Call)31 b(\014ts)p 2392 1282 28 4 v
+32 w(test)p 2570 1282 V 34 w(expr)g(to)h(obtain)g(the)g(dimensions)d
+(of)227 1395 y(the)i(results.)95 1670 y Fe(int)47 b(fits_calc_rows)d(/)
+k(ffcrow)286 1783 y(\(fitsfile)e(*fptr,)93 b(int)47 b(datatype,)f(char)
+g(*expr,)g(long)h(firstrow,)334 1896 y(long)g(nelements,)e(void)h
+(*nulval,)g(>)h(void)g(*array,)94 b(int)46 b(*anynul,)g(int)h
+(*status\))0 2172 y Fi(5)81 b Fj(Ev)-5 b(aluate)32 b(an)h(expression)e
+(and)i(write)e(the)i(result)f(either)g(to)i(a)f(column)e(\(if)h(the)h
+(expression)e(is)h(a)h(function)227 2285 y(of)d(other)g(columns)f(in)f
+(the)i(table\))g(or)g(to)g(a)h(k)m(eyw)m(ord)f(\(if)f(the)h(expression)
+e(ev)-5 b(aluates)31 b(to)f(a)g(constan)m(t)i(and)227
+2397 y(is)e(not)g(a)h(function)e(of)i(other)f(columns)g(in)f(the)h
+(table\).)41 b(In)30 b(the)h(former)e(case,)j(the)f(parName)f
+(parameter)227 2510 y(is)39 b(the)h(name)f(of)h(the)g(column)e(\(whic)m
+(h)h(ma)m(y)h(or)f(ma)m(y)h(not)g(already)f(exist\))h(in)m(to)f(whic)m
+(h)g(to)h(write)f(the)227 2623 y(results,)e(and)g(parInfo)e(con)m
+(tains)i(an)g(optional)e(TF)m(ORM)i(k)m(eyw)m(ord)g(v)-5
+b(alue)37 b(if)e(a)i(new)f(column)g(is)f(b)s(eing)227
+2736 y(created.)42 b(If)28 b(a)h(TF)m(ORM)h(v)-5 b(alue)28
+b(is)g(not)h(sp)s(eci\014ed)f(then)g(a)i(default)e(format)h(will)e(b)s
+(e)h(used,)h(dep)s(ending)d(on)227 2849 y(the)35 b(expression.)53
+b(If)34 b(the)h(expression)e(ev)-5 b(aluates)36 b(to)f(a)g(constan)m
+(t,)i(then)e(the)g(result)e(will)f(b)s(e)i(written)g(to)227
+2962 y(the)28 b(k)m(eyw)m(ord)g(name)f(giv)m(en)g(b)m(y)h(the)f
+(parName)h(parameter,)h(and)d(the)i(parInfo)e(parameter)i(ma)m(y)g(b)s
+(e)f(used)227 3075 y(to)k(supply)d(an)i(optional)g(commen)m(t)h(for)f
+(the)g(k)m(eyw)m(ord.)42 b(If)29 b(the)i(k)m(eyw)m(ord)g(do)s(es)f(not)
+g(already)g(exist,)g(then)227 3188 y(the)g(name)f(of)h(the)g(k)m(eyw)m
+(ord)g(m)m(ust)f(b)s(e)g(preceded)g(with)f(a)i('#')f(c)m(haracter,)j
+(otherwise)d(the)g(result)g(will)e(b)s(e)227 3301 y(written)j(to)h(a)g
+(column)e(with)g(that)i(name.)95 3576 y Fe(int)47 b(fits_calculator)d
+(/)j(ffcalc)286 3689 y(\(fitsfile)f(*infptr,)f(char)i(*expr,)f
+(fitsfile)f(*outfptr,)h(char)g(*parName,)334 3802 y(char)h(*parInfo,)e
+(>)95 b(int)47 b(*status\))0 4077 y Fi(6)81 b Fj(This)37
+b(calculator)j(routine)f(is)f(similar)f(to)j(the)g(previous)e(routine,)
+j(except)g(that)f(the)g(expression)e(is)h(only)227 4190
+y(ev)-5 b(aluated)41 b(o)m(v)m(er)g(the)f(sp)s(eci\014ed)f(ro)m(w)h
+(ranges.)70 b(nranges)39 b(sp)s(eci\014es)g(the)h(n)m(um)m(b)s(er)f(of)
+h(ro)m(w)h(ranges,)i(and)227 4303 y(\014rstro)m(w)30
+b(and)g(lastro)m(w)g(giv)m(e)h(the)g(starting)f(and)g(ending)f(ro)m(w)h
+(n)m(um)m(b)s(er)f(of)i(eac)m(h)g(range.)95 4578 y Fe(int)47
+b(fits_calculator_rng)c(/)k(ffcalc_rng)286 4691 y(\(fitsfile)f
+(*infptr,)f(char)i(*expr,)f(fitsfile)f(*outfptr,)h(char)g(*parName,)334
+4804 y(char)h(*parInfo,)e(int)i(nranges,)e(long)i(*firstrow,)e(long)i
+(*lastrow)334 4917 y(>)95 b(int)47 b(*status\))0 5193
+y Fi(7)81 b Fj(Ev)-5 b(aluate)30 b(the)h(giv)m(en)f(expression)f(and)h
+(return)f(information)g(on)h(the)h(result.)95 5468 y
+Fe(int)47 b(fits_test_expr)d(/)k(fftexp)286 5581 y(\(fitsfile)e(*fptr,)
+g(char)g(*expr,)g(>)i(int)f(*datatype,)e(long)h(*nelem,)g(int)h
+(*naxis,)334 5694 y(long)g(*naxes,)f(int)g(*status\))p
 eop
-%%Page: 74 80
-74 79 bop 0 299 a Fj(74)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
-555 y Ff(int)47 b(fits_update_key)d(/)j(ffuky)286 668
-y(\(fitsfile)f(*fptr,)g(int)h(datatype,)e(char)i(*keyname,)e(DTYPE)h
-(*value,)477 781 y(char)h(*comment,)e(>)j(int)f(*status\))0
-1043 y Fi(4)81 b Fj(W)-8 b(rite)25 b(a)h(k)m(eyw)m(ord)g(with)e(a)h(n)m
-(ull)f(or)h(unde\014ned)e(v)-5 b(alue)25 b(\(i.e.,)i(the)e(v)-5
-b(alue)25 b(\014eld)f(in)g(the)i(k)m(eyw)m(ord)f(is)g(left)g(blank\).)
-227 1156 y(This)37 b(routine)g(will)e(mo)s(dify)h(the)i(v)-5
-b(alue)38 b(and)f(commen)m(t)i(\014eld)e(if)g(the)h(k)m(eyw)m(ord)h
-(already)e(exists)h(in)f(the)227 1269 y(header,)31 b(otherwise)f(it)g
-(will)e(app)s(end)h(a)i(new)f(n)m(ull-v)-5 b(alued)28
-b(k)m(eyw)m(ord)j(at)h(the)e(end)g(of)h(the)g(header.)41
-b(A)31 b(n)m(ull)227 1382 y(p)s(oin)m(ter)d(ma)m(y)h(b)s(e)f(en)m
-(tered)h(for)f(the)h(commen)m(t)h(parameter)f(whic)m(h)e(will)f(lea)m
-(v)m(e)k(the)f(commen)m(t)g(\014eld)e(blank)227 1495
-y(\(or)k(unmo)s(di\014ed\).)95 1757 y Ff(int)47 b(fits_update_key_null)
-c(/)k(ffukyu)286 1870 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g
-(*comment,)g(>)h(int)g(*status\))0 2132 y Fi(5)81 b Fj(W)-8
-b(rite)40 b(\(app)s(end\))f(a)i(COMMENT)e(k)m(eyw)m(ord)i(to)g(the)f
-(CHU.)g(The)g(commen)m(t)h(string)e(will)e(b)s(e)i(split)g(o)m(v)m(er)
-227 2245 y(m)m(ultiple)28 b(COMMENT)i(k)m(eyw)m(ords)h(if)e(it)h(is)g
-(longer)g(than)g(70)h(c)m(haracters.)95 2507 y Ff(int)47
-b(fits_write_comment)c(/)48 b(ffpcom)286 2620 y(\(fitsfile)e(*fptr,)g
-(char)g(*comment,)g(>)h(int)g(*status\))0 2882 y Fi(6)81
-b Fj(W)-8 b(rite)21 b(\(app)s(end\))f(a)i(HISTOR)-8 b(Y)21
-b(k)m(eyw)m(ord)g(to)h(the)g(CHU.)f(The)g(commen)m(t)h(string)e(will)f
-(b)s(e)h(split)g(o)m(v)m(er)i(m)m(ultiple)227 2995 y(HISTOR)-8
-b(Y)30 b(k)m(eyw)m(ords)h(if)e(it)h(is)f(longer)h(than)g(70)i(c)m
-(haracters.)95 3257 y Ff(int)47 b(fits_write_history)c(/)48
-b(ffphis)286 3370 y(\(fitsfile)e(*fptr,)g(char)g(*history,)g(>)h(int)g
-(*status\))0 3632 y Fi(7)81 b Fj(W)-8 b(rite)28 b(the)h(D)m(A)-8
-b(TE)29 b(k)m(eyw)m(ord)g(to)g(the)g(CHU.)f(The)g(k)m(eyw)m(ord)h(v)-5
-b(alue)28 b(will)d(con)m(tain)k(the)g(curren)m(t)f(system)g(date)227
-3745 y(as)k(a)g(c)m(haracter)h(string)d(in)g('yyyy-mm-ddThh:mm:ss')f
-(format.)44 b(If)31 b(a)h(D)m(A)-8 b(TE)32 b(k)m(eyw)m(ord)g(already)f
-(exists)227 3858 y(in)c(the)g(header,)i(then)e(this)f(routine)h(will)e
-(simply)g(up)s(date)i(the)h(k)m(eyw)m(ord)g(v)-5 b(alue)27
-b(with)f(the)i(curren)m(t)g(date.)95 4120 y Ff(int)47
-b(fits_write_date)d(/)j(ffpdat)286 4233 y(\(fitsfile)f(*fptr,)g(>)h
-(int)g(*status\))0 4495 y Fi(8)81 b Fj(W)-8 b(rite)33
-b(a)h(user)f(sp)s(eci\014ed)f(k)m(eyw)m(ord)i(record)f(in)m(to)g(the)h
-(CHU.)g(This)d(is)i(a)h(lo)m(w{lev)m(el)f(routine)g(whic)m(h)f(can)i(b)
-s(e)227 4608 y(used)f(to)h(write)e(an)m(y)i(arbitrary)e(record)h(in)m
-(to)h(the)f(header.)50 b(The)32 b(record)i(m)m(ust)f(conform)g(to)h
-(the)g(all)e(the)227 4720 y(FITS)e(format)h(requiremen)m(ts.)95
-4982 y Ff(int)47 b(fits_write_record)c(/)48 b(ffprec)286
-5095 y(\(fitsfile)e(*fptr,)g(char)g(*card,)g(>)i(int)f(*status\))0
-5357 y Fi(9)81 b Fj(Up)s(date)34 b(an)g(80-c)m(haracter)j(record)e(in)e
-(the)h(CHU.)h(If)f(a)h(k)m(eyw)m(ord)f(with)g(the)g(input)f(name)h
-(already)g(exists,)227 5470 y(then)f(it)g(is)f(o)m(v)m(erwritten)h(b)m
-(y)g(the)g(v)-5 b(alue)33 b(of)g(card.)49 b(This)31 b(could)h(mo)s
-(dify)f(the)j(k)m(eyw)m(ord)f(name)g(as)h(w)m(ell)e(as)227
-5583 y(the)e(v)-5 b(alue)29 b(and)f(commen)m(t)j(\014elds.)39
-b(If)29 b(the)g(k)m(eyw)m(ord)h(do)s(esn't)f(already)g(exist)g(then)h
-(a)f(new)g(k)m(eyw)m(ord)h(card)227 5696 y(is)g(app)s(ended)e(to)j(the)
-g(header.)p eop
-%%Page: 75 81
-75 80 bop 0 299 a Fh(7.4.)72 b(HEADER)31 b(KEYW)m(ORD)g(READ/WRITE)g(R)
-m(OUTINES)1495 b Fj(75)95 555 y Ff(int)47 b(fits_update_card)d(/)j
-(ffucrd)286 668 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g
-(*card,)g(>)i(int)f(*status\))0 920 y Fi(10)f Fj(W)-8
-b(rite)31 b(the)h(ph)m(ysical)d(units)h(string)g(in)m(to)h(an)g
-(existing)f(k)m(eyw)m(ord.)43 b(This)29 b(routine)h(uses)h(a)g(lo)s
-(cal)g(con)m(v)m(en)m(tion,)227 1033 y(sho)m(wn)h(in)f(the)i(follo)m
-(wing)e(example,)i(in)e(whic)m(h)g(the)i(k)m(eyw)m(ord)g(units)e(are)i
-(enclosed)f(in)f(square)h(brac)m(k)m(ets)227 1146 y(in)d(the)i(b)s
-(eginning)d(of)i(the)h(k)m(eyw)m(ord)g(commen)m(t)g(\014eld.)95
-1398 y Ff(VELOCITY=)809 b(12.3)47 b(/)g([km/s])g(orbital)e(speed)95
-1623 y(int)i(fits_write_key_unit)c(/)k(ffpunt)286 1736
-y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g(*unit,)g(>)i(int)f
-(*status\))0 1988 y Fi(11)f Fj(Rename)31 b(an)f(existing)f(k)m(eyw)m
-(ord)i(preserving)e(the)i(curren)m(t)f(v)-5 b(alue)30
-b(and)f(commen)m(t)j(\014elds.)95 2240 y Ff(int)47 b(fits_modify_name)d
-(/)j(ffmnam)286 2353 y(\(fitsfile)f(*fptr,)g(char)g(*oldname,)g(char)g
-(*newname,)g(>)h(int)g(*status\))0 2605 y Fi(12)f Fj(Mo)s(dify)29
-b(\(o)m(v)m(erwrite\))j(the)e(commen)m(t)i(\014eld)d(of)h(an)h
-(existing)e(k)m(eyw)m(ord.)95 2856 y Ff(int)47 b(fits_modify_comment)c
-(/)k(ffmcom)286 2969 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g
-(*comment,)g(>)h(int)g(*status\))0 3221 y Fi(13)f Fj(Read)32
-b(the)f(n)m(th)g(header)g(record)h(in)e(the)h(CHU.)h(The)f(\014rst)f(k)
-m(eyw)m(ord)i(in)e(the)i(header)f(is)f(at)i(k)m(eyn)m(um)g(=)f(1;)h(if)
-227 3334 y(k)m(eyn)m(um)h(=)f(0)h(then)f(this)g(routine)f(simply)f(mo)m
-(v)m(es)k(the)f(in)m(ternal)e(CFITSIO)g(p)s(oin)m(ter)h(to)h(the)g(b)s
-(eginning)227 3447 y(of)c(the)g(header)g(so)g(that)g(subsequen)m(t)f(k)
-m(eyw)m(ord)h(op)s(erations)g(will)d(start)j(at)h(the)f(top)g(of)f(the)
-h(header)g(\(e.g.,)227 3560 y(prior)g(to)i(searc)m(hing)f(for)g(k)m
-(eyw)m(ords)h(using)e(wild)f(cards)i(in)f(the)i(k)m(eyw)m(ord)g
-(name\).)95 3812 y Ff(int)47 b(fits_read_record)d(/)j(ffgrec)286
-3925 y(\(fitsfile)f(*fptr,)g(int)h(keynum,)e(>)j(char)f(*card,)f(int)h
-(*status\))0 4176 y Fi(14)f Fj(Read)31 b(the)f(header)g(record)h(ha)m
-(ving)f(the)g(sp)s(eci\014ed)f(k)m(eyw)m(ord)i(name.)95
-4428 y Ff(int)47 b(fits_read_card)d(/)k(ffgcrd)286 4541
-y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h(char)g(*card,)f(int)h
-(*status\))0 4793 y Fi(15)f Fj(Read)32 b(a)h(sp)s(eci\014ed)e(k)m(eyw)m
-(ord)h(v)-5 b(alue)32 b(and)g(commen)m(t.)47 b(The)32
-b(datat)m(yp)s(e)h(parameter)g(sp)s(eci\014es)e(the)h(returned)227
-4906 y(datat)m(yp)s(e)k(of)f(the)h(k)m(eyw)m(ord)f(v)-5
-b(alue)35 b(and)f(can)h(ha)m(v)m(e)h(one)g(of)f(the)g(follo)m(wing)f
-(sym)m(b)s(olic)f(constan)m(t)j(v)-5 b(alues:)227 5019
-y(TSTRING,)24 b(TLOGICAL)g(\(==)g(in)m(t\),)i(TBYTE,)e(TSHOR)-8
-b(T,)24 b(TUSHOR)-8 b(T,)24 b(TINT,)g(TUINT,)g(TLONG,)227
-5132 y(TULONG,)i(TFLO)m(A)-8 b(T,)27 b(TDOUBLE,)f(TCOMPLEX,)f(and)h
-(TDBLCOMPLEX.)g(Within)e(the)i(con)m(text)227 5245 y(of)38
-b(this)e(routine,)i(TSTRING)e(corresp)s(onds)f(to)j(a)g('c)m(har*')g
-(datat)m(yp)s(e,)i(i.e.,)f(a)f(p)s(oin)m(ter)e(to)i(a)f(c)m(haracter)
-227 5357 y(arra)m(y)-8 b(.)49 b(Data)35 b(t)m(yp)s(e)e(con)m(v)m
-(ersion)g(will)d(b)s(e)i(p)s(erformed)f(for)i(n)m(umeric)f(v)-5
-b(alues)32 b(if)g(the)h(k)m(eyw)m(ord)g(v)-5 b(alue)32
-b(do)s(es)227 5470 y(not)h(ha)m(v)m(e)g(the)g(same)g(datat)m(yp)s(e.)47
-b(If)32 b(the)g(v)-5 b(alue)32 b(of)h(the)f(k)m(eyw)m(ord)h(is)e
-(unde\014ned)f(\(i.e.,)k(the)e(v)-5 b(alue)32 b(\014eld)f(is)227
-5583 y(blank\))g(then)g(an)h(error)f(status)h(=)f(V)-10
-b(ALUE)p 1764 5583 28 4 v 33 w(UNDEFINED)32 b(will)d(b)s(e)i(returned.)
-43 b(If)31 b(a)h(NULL)g(commen)m(t)227 5696 y(p)s(oin)m(ter)e(is)f(giv)
-m(en)h(on)h(input)d(then)i(the)h(commen)m(t)g(string)f(will)d(not)k(b)s
-(e)f(returned.)p eop
-%%Page: 76 82
-76 81 bop 0 299 a Fj(76)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
-555 y Ff(int)47 b(fits_read_key)e(/)i(ffgky)286 668 y(\(fitsfile)f
-(*fptr,)g(int)h(datatype,)e(char)i(*keyname,)e(>)i(DTYPE)g(*value,)334
-781 y(char)g(*comment,)e(int)i(*status\))0 1036 y Fi(16)f
-Fj(Read)37 b(the)h(ph)m(ysical)d(units)h(string)g(in)g(an)h(existing)f
-(k)m(eyw)m(ord.)61 b(This)36 b(routine)g(uses)h(a)g(lo)s(cal)g(con)m(v)
-m(en)m(tion,)227 1148 y(sho)m(wn)25 b(in)f(the)h(follo)m(wing)f
-(example,)i(in)e(whic)m(h)g(the)i(k)m(eyw)m(ord)f(units)f(are)i
-(enclosed)f(in)f(square)h(brac)m(k)m(ets)h(in)227 1261
-y(the)k(b)s(eginning)d(of)j(the)g(k)m(eyw)m(ord)g(commen)m(t)g
-(\014eld.)39 b(A)30 b(n)m(ull)e(string)g(is)h(returned)f(if)h(no)g
-(units)f(are)i(de\014ned)227 1374 y(for)g(the)h(k)m(eyw)m(ord.)95
-1629 y Ff(VELOCITY=)809 b(12.3)47 b(/)g([km/s])g(orbital)e(speed)95
-1855 y(int)i(fits_read_key_unit)c(/)48 b(ffgunt)286 1968
-y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h(char)g(*unit,)f(int)h
-(*status\))0 2222 y Fi(17)f Fj(Delete)32 b(a)g(k)m(eyw)m(ord)g(record.)
-43 b(The)31 b(space)g(previously)e(o)s(ccupied)h(b)m(y)h(the)h(k)m(eyw)
-m(ord)g(is)e(reclaimed)g(b)m(y)h(mo)m(v-)227 2335 y(ing)38
-b(all)g(the)h(follo)m(wing)e(header)i(records)f(up)g(one)h(ro)m(w)g(in)
-f(the)h(header.)65 b(The)39 b(\014rst)f(routine)g(deletes)h(a)227
-2448 y(k)m(eyw)m(ord)29 b(at)g(a)f(sp)s(eci\014ed)f(p)s(osition)f(in)g
-(the)j(header)f(\(the)g(\014rst)g(k)m(eyw)m(ord)g(is)f(at)i(p)s
-(osition)d(1\),)k(whereas)e(the)227 2561 y(second)f(routine)e(deletes)h
-(a)h(sp)s(eci\014cally)d(named)i(k)m(eyw)m(ord.)39 b(Wild)25
-b(card)h(c)m(haracters)i(ma)m(y)f(b)s(e)e(used)h(when)227
-2674 y(sp)s(ecifying)i(the)j(name)f(of)h(the)g(k)m(eyw)m(ord)f(to)i(b)s
-(e)d(deleted.)95 2928 y Ff(int)47 b(fits_delete_record)c(/)48
-b(ffdrec)286 3041 y(\(fitsfile)e(*fptr,)g(int)142 b(keynum,)94
-b(>)47 b(int)g(*status\))95 3267 y(int)g(fits_delete_key)d(/)j(ffdkey)
-286 3380 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(>)h(int)g
-(*status\))0 3713 y Fe(7.5)135 b(Iterator)47 b(Routines)0
-3963 y Fj(The)30 b(use)h(of)g(these)g(routines)f(is)f(describ)s(ed)g
-(in)h(the)h(previous)e(c)m(hapter.)42 b(Most)32 b(of)f(these)g
-(routines)f(do)h(not)g(ha)m(v)m(e)0 4076 y(a)g(corresp)s(onding)d
-(short)i(function)f(name.)0 4330 y Fi(1)81 b Fj(Iterator)32
-b(`constructor')h(functions)d(that)j(set)f(the)g(v)-5
-b(alue)31 b(of)h(elemen)m(ts)g(in)f(the)h(iteratorCol)f(structure)g
-(that)227 4443 y(de\014ne)k(the)h(columns)e(or)i(arra)m(ys.)56
-b(These)36 b(set)g(the)g(\014ts\014le)e(p)s(oin)m(ter,)i(column)e
-(name,)k(column)c(n)m(um)m(b)s(er,)227 4556 y(datat)m(yp)s(e,)28
-b(and)e(iot)m(yp)s(e,)h(resp)s(ectiv)m(ely)-8 b(.)39
-b(The)25 b(last)h(2)h(routines)e(allo)m(w)g(all)g(the)h(parameters)h
-(to)f(b)s(e)g(set)g(with)227 4669 y(one)31 b(function)e(call)h(\(one)h
-(supplies)c(the)k(column)e(name,)i(the)f(other)h(the)f(column)f(n)m(um)
-m(b)s(er\).)95 4924 y Ff(int)47 b(fits_iter_set_file\(iterato)o(rCo)o
-(l)42 b(*col,)k(fitsfile)g(*fptr\);)95 5149 y(int)h
-(fits_iter_set_colname\(iter)o(ato)o(rCol)41 b(*col,)46
-b(char)h(*colname\);)95 5375 y(int)g(fits_iter_set_colnum\(itera)o(tor)
-o(Col)41 b(*col,)47 b(int)g(colnum\);)95 5601 y(int)g
-(fits_iter_set_datatype\(ite)o(rat)o(orCo)o(l)42 b(*col,)k(int)h
-(datatype\);)p eop
-%%Page: 77 83
-77 82 bop 0 299 a Fh(7.5.)72 b(ITERA)-8 b(TOR)30 b(R)m(OUTINES)2592
-b Fj(77)95 555 y Ff(int)47 b(fits_iter_set_iotype\(itera)o(tor)o(Col)41
-b(*col,)47 b(int)g(iotype\);)95 781 y(int)g
-(fits_iter_set_by_name\(iter)o(ato)o(rCol)41 b(*col,)46
-b(fitsfile)g(*fptr,)477 894 y(char)h(*colname,)e(int)i(datatype,)93
-b(int)47 b(iotype\);)95 1120 y(int)g(fits_iter_set_by_num\(itera)o(tor)
-o(Col)41 b(*col,)47 b(fitsfile)e(*fptr,)477 1233 y(int)i(colnum,)f(int)
-h(datatype,)93 b(int)47 b(iotype\);)0 1588 y Fi(2)81
-b Fj(Iterator)38 b(`accessor')h(functions)d(that)h(return)g(the)g(v)-5
-b(alue)37 b(of)g(the)g(elemen)m(t)h(in)e(the)h(iteratorCol)g(structure)
-227 1701 y(that)31 b(describ)s(es)e(a)i(particular)d(data)j(column)f
-(or)g(arra)m(y)95 2056 y Ff(fitsfile)46 b(*)h
-(fits_iter_get_file\(iterato)o(rCol)41 b(*col\);)95 2281
-y(char)47 b(*)h(fits_iter_get_colname\(i)o(ter)o(ator)o(Col)41
-b(*col\);)95 2507 y(int)47 b(fits_iter_get_colnum\(itera)o(tor)o(Col)41
-b(*col\);)95 2733 y(int)47 b(fits_iter_get_datatype\(ite)o(rat)o(orCo)o
-(l)42 b(*col\);)95 2959 y(int)47 b(fits_iter_get_iotype\(itera)o(tor)o
-(Col)41 b(*col\);)95 3185 y(void)47 b(*)h(fits_iter_get_array\(ite)o
-(rat)o(orCo)o(l)42 b(*col\);)95 3410 y(long)47 b
-(fits_iter_get_tlmin\(itera)o(tor)o(Col)41 b(*col\);)95
-3636 y(long)47 b(fits_iter_get_tlmax\(itera)o(tor)o(Col)41
-b(*col\);)95 3862 y(long)47 b(fits_iter_get_repeat\(iter)o(ato)o(rCol)
-41 b(*col\);)95 4088 y(char)47 b(*)h(fits_iter_get_tunit\(ite)o(rat)o
-(orCo)o(l)42 b(*col\);)95 4314 y(char)47 b(*)h
-(fits_iter_get_tdisp\(ite)o(rat)o(orCo)o(l)42 b(*col\);)0
-4669 y Fi(3)81 b Fj(The)29 b(CFITSIO)g(iterator)i(function)95
-5024 y Ff(int)47 b(fits_iterate_data\(int)42 b(narrays,)94
-b(iteratorCol)44 b(*data,)i(long)h(offset,)573 5137 y(long)f(nPerLoop,)
-573 5250 y(int)h(\(*workFn\)\()e(long)h(totaln,)g(long)h(offset,)f
-(long)g(firstn,)1289 5363 y(long)g(nvalues,)g(int)h(narrays,)e
-(iteratorCol)g(*data,)1289 5475 y(void)h(*userPointer\),)573
-5588 y(void)g(*userPointer,)573 5701 y(int)h(*status\);)p
-eop
-%%Page: 78 84
-78 83 bop 0 299 a Fj(78)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fe(7.6)135 b(Primary)46 b(Arra)l(y)f(or)g(IMA)l(GE)f(Extension)i
-(I/O)f(Routines)0 809 y Fj(These)32 b(routines)f(read)h(or)g(write)f
-(data)i(v)-5 b(alues)32 b(in)e(the)j(primary)d(data)j(arra)m(y)f
-(\(i.e.,)i(the)e(\014rst)f(HDU)i(in)e(a)i(FITS)0 922
-y(\014le\))e(or)h(an)f(IMA)m(GE)i(extension.)44 b(There)31
-b(are)h(also)f(routines)g(to)h(get)h(information)c(ab)s(out)j(the)g
-(data)g(t)m(yp)s(e)g(and)0 1035 y(size)e(of)g(the)g(image.)40
-b(C)30 b(programmers)f(should)f(note)i(that)g(the)g(ordering)f(of)h
-(arra)m(ys)g(in)e(FITS)i(\014les,)f(and)g(hence)0 1147
-y(in)g(all)g(the)h(CFITSIO)e(calls,)i(is)f(more)h(similar)d(to)k(the)f
-(dimensionalit)m(y)e(of)i(arra)m(ys)g(in)f(F)-8 b(ortran)30
-b(rather)g(than)g(C.)0 1260 y(F)-8 b(or)35 b(instance)f(if)f(a)h(FITS)g
-(image)g(has)g(NAXIS1)h(=)e(100)j(and)d(NAXIS2)i(=)f(50,)i(then)e(a)g
-(2-D)i(arra)m(y)e(just)g(large)0 1373 y(enough)c(to)h(hold)e(the)i
-(image)f(should)f(b)s(e)h(declared)f(as)i(arra)m(y[50][100])j(and)c
-(not)h(as)f(arra)m(y[100][50].)0 1533 y(The)j(`datat)m(yp)s(e')i
-(parameter)e(sp)s(eci\014es)f(the)i(datat)m(yp)s(e)g(of)g(the)f(`n)m
-(ulv)-5 b(al')32 b(and)h(`arra)m(y')h(p)s(oin)m(ters)e(and)h(can)h(ha)m
-(v)m(e)0 1646 y(one)d(of)g(the)g(follo)m(wing)e(v)-5
-b(alues:)41 b(TBYTE,)30 b(TSHOR)-8 b(T,)30 b(TUSHOR)-8
-b(T,)31 b(TINT,)f(TUINT,)g(TLONG,)h(TULONG,)0 1759 y(TFLO)m(A)-8
-b(T,)31 b(TDOUBLE.)g(Automatic)g(data)g(t)m(yp)s(e)g(con)m(v)m(ersion)g
-(is)f(p)s(erformed)f(if)g(the)i(data)g(t)m(yp)s(e)g(of)g(the)g(FITS)0
-1872 y(arra)m(y)41 b(\(as)g(de\014ned)e(b)m(y)i(the)g(BITPIX)f(k)m(eyw)
-m(ord\))h(di\013ers)e(from)h(that)h(sp)s(eci\014ed)e(b)m(y)i('datat)m
-(yp)s(e'.)72 b(The)40 b(data)0 1985 y(v)-5 b(alues)26
-b(are)g(also)g(automatically)g(scaled)g(b)m(y)g(the)h(BSCALE)e(and)h
-(BZER)m(O)g(k)m(eyw)m(ord)g(v)-5 b(alues)26 b(as)g(they)h(are)f(b)s
-(eing)0 2098 y(read)32 b(or)h(written)e(in)g(the)h(FITS)g(arra)m(y)-8
-b(.)48 b(See)32 b(App)s(endix)e(B)i(for)g(further)f(information)g(ab)s
-(out)h(the)h(parameters)0 2211 y(used)d(in)f(these)h(routines.)0
-2485 y Fi(1)81 b Fj(Get)34 b(the)f(data)h(t)m(yp)s(e)f(of)g(the)g
-(image)h(\(=)f(BITPIX)f(v)-5 b(alue\).)49 b(P)m(ossible)32
-b(returned)g(v)-5 b(alues)32 b(are:)47 b(BYTE)p 3685
-2485 28 4 v 32 w(IMG)227 2598 y(\(8\),)32 b(SHOR)-8 b(T)p
-719 2598 V 32 w(IMG)31 b(\(16\),)h(LONG)p 1453 2598 V
-33 w(IMG)f(\(32\),)h(FLO)m(A)-8 b(T)p 2231 2598 V 33
-w(IMG)31 b(\(-32\),)h(or)f(DOUBLE)p 3232 2598 V 33 w(IMG)g(\(-64\).)95
-2871 y Ff(int)47 b(fits_get_img_type)c(/)48 b(ffgidt)286
-2984 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*bitpix,)f(int)h(*status\))0
-3258 y Fi(2)81 b Fj(Get)31 b(the)g(dimension)c(\(n)m(um)m(b)s(er)j(of)g
-(axes)h(=)f(NAXIS\))h(of)f(the)h(image)95 3532 y Ff(int)47
-b(fits_get_img_dim)d(/)j(ffgidm)286 3645 y(\(fitsfile)f(*fptr,)g(>)h
-(int)g(*naxis,)f(int)h(*status\))0 3919 y Fi(3)81 b Fj(Get)31
-b(the)g(size)f(of)g(all)g(the)g(dimensions)e(\(up)h(to)j(maxdim)d
-(dimensions\))f(of)i(the)h(image)95 4192 y Ff(int)47
-b(fits_get_img_size)c(/)48 b(ffgisz)286 4305 y(\(fitsfile)e(*fptr,)g
-(int)h(maxdim,)e(>)j(long)f(*naxes,)e(int)i(*status\))0
-4579 y Fi(4)81 b Fj(Get)35 b(the)f(parameters)g(that)h(de\014ne)e(the)h
-(t)m(yp)s(e)g(and)g(size)f(of)i(the)f(image.)52 b(This)32
-b(routine)h(simply)e(com)m(bines)227 4692 y(calls)f(to)h(the)f(ab)s(o)m
-(v)m(e)i(3)f(routines.)95 4966 y Ff(int)47 b(fits_get_img_param)c(/)48
-b(ffgipr)286 5079 y(\(fitsfile)e(*fptr,)g(int)h(maxdim,)e(>)j(int)f
-(*bitpix,)e(int)i(*naxis,)f(long)h(*naxes,)334 5192 y(int)g(*status\))0
-5465 y Fi(5)81 b Fj(W)-8 b(rite)38 b(pixels)f(in)m(to)h(the)h(FITS)f
-(data)h(arra)m(y)-8 b(.)66 b('fpixel')37 b(is)g(an)h(arra)m(y)h(of)g
-(length)f(NAXIS)g(whic)m(h)f(giv)m(es)i(the)227 5578
-y(co)s(ordinate)k(of)g(the)g(starting)f(pixel)f(to)j(b)s(e)e(written)g
-(to,)k(suc)m(h)d(that)g(fpixel[0])f(is)g(in)f(the)i(range)g(1)g(to)227
-5691 y(NAXIS1,)31 b(fpixel[1])f(is)f(in)g(the)i(range)f(1)h(to)g
-(NAXIS2,)g(etc.)p eop
-%%Page: 79 85
-79 84 bop 0 299 a Fh(7.6.)72 b(PRIMAR)-8 b(Y)31 b(ARRA)-8
-b(Y)31 b(OR)f(IMA)m(GE)h(EXTENSION)f(I/O)g(R)m(OUTINES)1011
-b Fj(79)95 555 y Ff(int)47 b(fits_write_pix)d(/)k(ffppx)286
-668 y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(long)i(*fpixel,)e(long)i
-(nelements,)334 781 y(DTYPE)f(*array,)g(int)h(*status\);)0
-1042 y Fi(6)81 b Fj(W)-8 b(rite)43 b(pixels)e(in)m(to)h(the)h(FITS)f
-(data)i(arra)m(y)-8 b(,)47 b(substituting)40 b(the)j(appropriate)f
-(FITS)g(n)m(ull)e(v)-5 b(alue)43 b(for)f(all)227 1155
-y(elemen)m(ts)e(whic)m(h)e(are)i(equal)f(to)i(the)e(input)f(v)-5
-b(alue)39 b(of)h(n)m(ulv)-5 b(al)38 b(\(note)i(that)g(this)f(parameter)
-h(giv)m(es)g(the)227 1268 y(address)34 b(of)g(the)h(n)m(ull)d(v)-5
-b(alue,)35 b(not)f(the)h(n)m(ull)d(v)-5 b(alue)34 b(itself)7
-b(\).)52 b(F)-8 b(or)35 b(in)m(teger)f(FITS)g(arra)m(ys,)i(the)e(FITS)g
-(n)m(ull)227 1381 y(v)-5 b(alue)26 b(is)g(de\014ned)g(b)m(y)g(the)h
-(BLANK)g(k)m(eyw)m(ord)g(\(an)g(error)f(is)g(returned)g(if)f(the)i
-(BLANK)g(k)m(eyw)m(ord)g(do)s(esn't)227 1494 y(exist\).)52
-b(F)-8 b(or)35 b(\015oating)f(p)s(oin)m(t)f(FITS)g(arra)m(ys)i(the)f
-(sp)s(ecial)f(IEEE)g(NaN)i(\(Not-a-Num)m(b)s(er\))h(v)-5
-b(alue)33 b(will)f(b)s(e)227 1607 y(written)25 b(in)m(to)i(the)f(FITS)f
-(\014le.)39 b(If)25 b(a)i(n)m(ull)d(p)s(oin)m(ter)h(is)g(en)m(tered)i
-(for)e(n)m(ulv)-5 b(al,)26 b(then)g(the)g(n)m(ull)e(v)-5
-b(alue)26 b(is)f(ignored)227 1720 y(and)30 b(this)f(routine)h(b)s(eha)m
-(v)m(es)h(the)f(same)h(as)g(\014ts)p 1857 1720 28 4 v
-32 w(write)p 2092 1720 V 32 w(pix.)95 1981 y Ff(int)47
-b(fits_write_pixnull)c(/)48 b(ffppxn)286 2094 y(\(fitsfile)e(*fptr,)g
-(int)h(datatype,)e(long)i(*fpixel,)e(long)i(nelements,)334
-2207 y(DTYPE)f(*array,)g(DTYPE)h(*nulval,)e(>)j(int)f(*status\);)0
-2468 y Fi(7)81 b Fj(Set)24 b(FITS)g(data)i(arra)m(y)f(elemen)m(ts)g
-(equal)f(to)h(the)g(appropriate)e(n)m(ull)g(pixel)g(v)-5
-b(alue.)38 b(F)-8 b(or)25 b(in)m(teger)g(FITS)f(arra)m(ys,)227
-2581 y(the)34 b(FITS)e(n)m(ull)f(v)-5 b(alue)33 b(is)f(de\014ned)g(b)m
-(y)h(the)h(BLANK)f(k)m(eyw)m(ord)h(\(an)f(error)g(is)f(returned)g(if)g
-(the)i(BLANK)227 2694 y(k)m(eyw)m(ord)23 b(do)s(esn't)g(exist\).)38
-b(F)-8 b(or)23 b(\015oating)f(p)s(oin)m(t)g(FITS)g(arra)m(ys)g(the)h
-(sp)s(ecial)e(IEEE)h(NaN)h(\(Not-a-Num)m(b)s(er\))227
-2807 y(v)-5 b(alue)33 b(will)d(b)s(e)j(written)f(in)m(to)h(the)h(FITS)e
-(\014le.)48 b(Note)34 b(that)g('\014rstelem')f(is)f(a)i(scalar)f
-(giving)f(the)h(o\013set)h(to)227 2920 y(the)d(\014rst)e(pixel)g(to)i
-(b)s(e)f(written)f(in)h(the)g(equiv)-5 b(alen)m(t)30
-b(1-dimensional)e(arra)m(y)j(of)g(image)f(pixels.)95
-3181 y Ff(int)47 b(fits_write_null_img)c(/)k(ffpprn)286
-3294 y(\(fitsfile)f(*fptr,)g(long)g(firstelem,)f(long)i(nelements,)e(>)
-i(int)g(*status\))0 3555 y Fi(8)81 b Fj(Read)35 b(a)g(rectangular)g
-(subset)f(from)g(the)h(FITS)f(data)i(arra)m(y)-8 b(.)55
-b(Unde\014ned)33 b(FITS)h(arra)m(y)h(elemen)m(ts)g(will)e(b)s(e)227
-3668 y(returned)40 b(with)g(a)h(v)-5 b(alue)41 b(=)f(*n)m(ullv)-5
-b(al,)42 b(\(note)g(that)g(this)e(parameter)h(giv)m(es)g(the)h(address)
-e(of)h(the)g(n)m(ull)227 3781 y(v)-5 b(alue,)31 b(not)f(the)h(n)m(ull)e
-(v)-5 b(alue)30 b(itself)7 b(\))29 b(unless)g(n)m(ulv)-5
-b(al)29 b(=)h(0)h(or)g(*n)m(ulv)-5 b(al)29 b(=)h(0,)i(in)d(whic)m(h)g
-(case)j(no)e(c)m(hec)m(ks)i(for)227 3894 y(unde\014ned)c(pixels)h(will)
-f(b)s(e)h(p)s(erformed.)95 4155 y Ff(int)47 b(fits_read_subset)d(/)j
-(ffgsv)286 4268 y(\(fitsfile)f(*fptr,)g(int)94 b(datatype,)46
-b(long)g(*fpixel,)g(long)g(*lpixel,)g(long)h(*inc,)334
-4381 y(DTYPE)f(*nulval,)g(>)h(DTYPE)g(*array,)f(int)h(*anynul,)e(int)i
-(*status\))0 4642 y Fi(9)81 b Fj(Read)37 b(pixels)e(from)i(the)g(FITS)f
-(data)i(arra)m(y)-8 b(.)62 b(Unde\014ned)36 b(FITS)g(arra)m(y)i(pixels)
-d(will)f(b)s(e)j(returned)f(with)g(a)227 4755 y(v)-5
-b(alue)34 b(=)f(*n)m(ullv)-5 b(al,)33 b(\(note)i(that)f(this)f
-(parameter)h(giv)m(es)g(the)g(address)f(of)h(the)g(n)m(ull)e(v)-5
-b(alue,)34 b(not)g(the)g(n)m(ull)227 4868 y(v)-5 b(alue)26
-b(itself)7 b(\))25 b(unless)f(n)m(ulv)-5 b(al)24 b(=)i(0)g(or)g(*n)m
-(ulv)-5 b(al)24 b(=)i(0,)h(in)e(whic)m(h)f(case)j(no)f(c)m(hec)m(ks)h
-(for)f(unde\014ned)e(pixels)g(will)227 4981 y(b)s(e)k(p)s(erformed.)38
-b('fpixel')27 b(is)h(an)g(arra)m(y)h(of)f(length)g(NAXIS)g(whic)m(h)f
-(giv)m(es)i(the)f(co)s(ordinate)g(of)h(the)f(starting)227
-5094 y(pixel)f(to)j(b)s(e)e(read,)h(suc)m(h)f(that)h(fpixel[0])f(is)g
-(in)f(the)i(range)g(1)g(to)g(NAXIS1,)h(fpixel[1])d(is)h(in)f(the)i
-(range)g(1)g(to)227 5207 y(NAXIS2,)i(etc.)95 5468 y Ff(int)47
-b(fits_read_pix)e(/)i(ffgpxv)286 5581 y(\(fitsfile)f(*fptr,)g(int)94
-b(datatype,)46 b(long)g(*fpixel,)g(long)g(nelements,)334
-5694 y(DTYPE)g(*nulval,)g(>)h(DTYPE)g(*array,)f(int)h(*anynul,)e(int)i
-(*status\))p eop
-%%Page: 80 86
-80 85 bop 0 299 a Fj(80)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(10)46 b Fj(Read)e(pixels)e(from)h(the)h(FITS)f(data)h(arra)m
-(y)-8 b(.)82 b(An)m(y)44 b(unde\014ned)d(FITS)i(arra)m(y)i(elemen)m(ts)
-f(will)d(ha)m(v)m(e)k(the)227 668 y(corresp)s(onding)29
-b(n)m(ullarra)m(y)f(elemen)m(t)j(set)g(to)g(TR)m(UE.)95
-914 y Ff(int)47 b(fits_read_pixnull)c(/)48 b(ffgpxf)286
-1027 y(\(fitsfile)e(*fptr,)g(int)94 b(datatype,)46 b(long)g(*fpixel,)g
-(long)g(nelements,)334 1140 y(>)i(DTYPE)e(*array,)g(char)g(*nullarray,)
-f(int)i(*anynul,)f(int)g(*status\))0 1471 y Fe(7.7)135
-b(ASCI)t(I)45 b(and)f(Binary)h(T)-11 b(able)45 b(Routines)0
-1721 y Fj(These)36 b(routines)f(p)s(erform)g(read)i(and)e(write)h(op)s
-(erations)g(on)g(columns)f(of)i(data)g(in)e(FITS)h(ASCI)s(I)e(or)j
-(Binary)0 1834 y(tables.)46 b(Note)33 b(that)g(in)d(the)j(follo)m(wing)
-d(discussions,)g(the)i(\014rst)g(ro)m(w)g(and)f(column)g(in)g(a)h
-(table)g(is)g(at)g(p)s(osition)f(1)0 1947 y(not)g(0.)41
-b(See)30 b(App)s(endix)e(B)j(for)f(the)g(de\014nition)e(of)j(the)g
-(parameters)f(used)g(in)f(these)i(routines.)0 2236 y
-Fd(7.7.1)112 b(Column)37 b(Information)f(Routines)0 2442
-y Fi(1)81 b Fj(Get)30 b(the)g(n)m(um)m(b)s(er)e(of)i(ro)m(ws)g(or)f
-(columns)f(in)h(the)h(curren)m(t)f(FITS)g(table.)40 b(The)29
-b(n)m(um)m(b)s(er)f(of)i(ro)m(ws)g(is)e(giv)m(en)i(b)m(y)227
-2555 y(the)k(NAXIS2)f(k)m(eyw)m(ord)h(and)e(the)i(n)m(um)m(b)s(er)e(of)
-h(columns)f(is)g(giv)m(en)h(b)m(y)g(the)h(TFIELDS)e(k)m(eyw)m(ord)i(in)
-e(the)227 2668 y(header)e(of)h(the)g(table.)95 2914 y
-Ff(int)47 b(fits_get_num_rows)c(/)48 b(ffgnrw)286 3027
-y(\(fitsfile)e(*fptr,)g(>)h(long)g(*nrows,)f(int)h(*status\);)95
-3253 y(int)g(fits_get_num_cols)c(/)48 b(ffgncl)286 3366
-y(\(fitsfile)e(*fptr,)g(>)h(int)g(*ncols,)f(int)h(*status\);)0
-3611 y Fi(2)81 b Fj(Get)25 b(the)f(table)h(column)e(n)m(um)m(b)s(er)g
-(\(and)h(name\))h(of)f(the)h(column)e(whose)h(name)g(matc)m(hes)i(an)e
-(input)f(template)227 3724 y(name.)48 b(If)32 b(casesen)i(=)e(CASESEN)g
-(then)g(the)h(column)e(name)i(matc)m(h)h(will)c(b)s(e)i(case-sensitiv)m
-(e,)i(whereas)227 3837 y(if)26 b(casesen)i(=)e(CASEINSEN)g(then)h(the)g
-(case)h(will)c(b)s(e)i(ignored.)39 b(As)27 b(a)g(general)g(rule,)f(the)
-h(column)f(names)227 3950 y(should)j(b)s(e)g(treated)j(as)e(case)i
-(INsensitiv)m(e.)227 4098 y(The)26 b(input)f(column)g(name)h(template)h
-(ma)m(y)g(b)s(e)f(either)g(the)h(exact)h(name)e(of)h(the)f(column)f(to)
-j(b)s(e)d(searc)m(hed)227 4211 y(for,)k(or)f(it)g(ma)m(y)h(con)m(tain)g
-(wild)d(card)i(c)m(haracters)i(\(*,)g(?,)f(or)f(#\),)h(or)f(it)g(ma)m
-(y)h(con)m(tain)g(the)f(in)m(teger)h(n)m(um)m(b)s(er)227
-4324 y(of)k(the)f(desired)e(column)h(\(with)g(the)i(\014rst)e(column)g
-(=)h(1\).)46 b(The)32 b(`*')h(wild)d(card)i(c)m(haracter)h(matc)m(hes)h
-(an)m(y)227 4437 y(sequence)h(of)g(c)m(haracters)h(\(including)c(zero)j
-(c)m(haracters\))i(and)d(the)h(`?')53 b(c)m(haracter)36
-b(matc)m(hes)g(an)m(y)f(single)227 4550 y(c)m(haracter.)42
-b(The)29 b(#)h(wildcard)d(will)g(matc)m(h)k(an)m(y)e(consecutiv)m(e)i
-(string)e(of)g(decimal)g(digits)f(\(0-9\).)43 b(If)29
-b(more)227 4663 y(than)43 b(one)f(column)g(name)g(in)f(the)i(table)g
-(matc)m(hes)g(the)g(template)g(string,)i(then)d(the)h(\014rst)e(matc)m
-(h)j(is)227 4776 y(returned)28 b(and)h(the)g(status)h(v)-5
-b(alue)29 b(will)d(b)s(e)j(set)h(to)g(COL)p 2171 4776
-28 4 v 32 w(NOT)p 2408 4776 V 32 w(UNIQUE)f(as)h(a)f(w)m(arning)f(that)
-i(a)g(unique)227 4888 y(matc)m(h)e(w)m(as)g(not)f(found.)39
-b(T)-8 b(o)27 b(\014nd)f(the)h(other)g(cases)h(that)g(matc)m(h)g(the)g
-(template,)g(call)e(the)i(routine)e(again)227 5001 y(lea)m(ving)f(the)g
-(input)e(status)i(v)-5 b(alue)25 b(equal)f(to)i(COL)p
-1950 5001 V 32 w(NOT)p 2187 5001 V 32 w(UNIQUE)f(and)f(the)h(next)h
-(matc)m(hing)f(name)g(will)227 5114 y(then)30 b(b)s(e)g(returned.)40
-b(Rep)s(eat)30 b(this)g(pro)s(cess)g(un)m(til)e(a)j(status)g(=)f(COL)p
-2628 5114 V 32 w(NOT)p 2865 5114 V 32 w(F)m(OUND)i(is)d(returned.)227
-5262 y(The)36 b(FITS)g(Standard)g(recommends)g(that)i(only)d(letters,)k
-(digits,)e(and)f(the)h(underscore)f(c)m(haracter)j(b)s(e)227
-5375 y(used)32 b(in)g(column)g(names)g(\(with)g(no)h(em)m(b)s(edded)f
-(spaces\).)49 b(T)-8 b(railing)30 b(blank)i(c)m(haracters)i(are)f(not)h
-(signif-)227 5488 y(ican)m(t.)57 b(It)36 b(is)f(recommended)g(that)h
-(all)f(the)h(column)e(names)i(in)e(a)i(giv)m(en)g(table)g(b)s(e)f
-(unique)f(within)f(the)227 5601 y(\014rst)i(8)i(c)m(haracters,)h(and)e
-(strongly)f(recommended)g(that)i(the)f(names)g(b)s(e)f(unique)f(within)
-f(the)j(\014rst)f(16)227 5714 y(c)m(haracters.)p eop
-%%Page: 81 87
-81 86 bop 0 299 a Fh(7.7.)72 b(ASCI)s(I)29 b(AND)i(BINAR)-8
-b(Y)31 b(T)-8 b(ABLE)31 b(R)m(OUTINES)1864 b Fj(81)95
-555 y Ff(int)47 b(fits_get_colnum)d(/)j(ffgcno)286 668
-y(\(fitsfile)f(*fptr,)g(int)h(casesen,)e(char)i(*templt,)e(>)j(int)f
-(*colnum,)334 781 y(int)g(*status\))95 1007 y(int)g(fits_get_colname)d
-(/)j(ffgcnn)286 1120 y(\(fitsfile)f(*fptr,)g(int)h(casesen,)e(char)i
-(*templt,)e(>)j(char)e(*colname,)334 1233 y(int)h(*colnum,)f(int)g
-(*status\))0 1484 y Fi(3)81 b Fj(Return)32 b(the)i(datat)m(yp)s(e,)h(v)
-m(ector)g(rep)s(eat)f(v)-5 b(alue,)33 b(and)g(the)h(width)d(in)h(b)m
-(ytes)i(of)g(a)g(column)e(in)g(an)h(ASCI)s(I)f(or)227
-1597 y(binary)k(table.)63 b(Allo)m(w)m(ed)37 b(v)-5 b(alues)37
-b(for)h(the)f(datat)m(yp)s(e)i(in)d(ASCI)s(I)h(tables)g(are:)56
-b(TSTRING,)37 b(TSHOR)-8 b(T,)227 1710 y(TLONG,)36 b(TFLO)m(A)-8
-b(T,)36 b(and)f(TDOUBLE.)i(Binary)d(tables)i(also)g(supp)s(ort)e(these)
-i(t)m(yp)s(es:)52 b(TLOGICAL,)227 1823 y(TBIT,)42 b(TBYTE,)h(TCOMPLEX)e
-(and)h(TDBLCOMPLEX.)g(The)g(negativ)m(e)h(of)g(the)f(datat)m(yp)s(e)i
-(co)s(de)227 1936 y(v)-5 b(alue)31 b(is)f(returned)g(if)g(it)g(is)h(a)g
-(v)-5 b(ariable)30 b(length)g(arra)m(y)i(column.)42 b(Note)32
-b(that)g(in)d(the)j(case)g(of)f(a)g('J')h(32-bit)227
-2049 y(in)m(teger)h(binary)e(table)h(column,)g(this)f(routine)g(will)f
-(return)h(datat)m(yp)s(e)i(=)f(TINT32BIT)h(\(whic)m(h)e(in)g(fact)227
-2162 y(is)k(equiv)-5 b(alen)m(t)35 b(to)i(TLONG\).)f(With)f(most)h
-(curren)m(t)g(C)f(compilers,)h(a)h(v)-5 b(alue)35 b(in)f(a)j('J')f
-(column)e(has)i(the)227 2275 y(same)29 b(size)f(as)h(an)f('in)m(t')h(v)
--5 b(ariable,)28 b(and)f(ma)m(y)j(not)e(b)s(e)g(equiv)-5
-b(alen)m(t)28 b(to)h(a)g('long')f(v)-5 b(ariable,)28
-b(whic)m(h)f(is)h(64-bits)227 2388 y(long)i(on)h(an)f(increasing)f(n)m
-(um)m(b)s(er)g(of)h(compilers.)227 2536 y(The)22 b('rep)s(eat')h
-(parameter)g(returns)f(the)g(v)m(ector)i(rep)s(eat)f(coun)m(t)g(on)f
-(the)h(binary)e(table)h(TF)m(ORMn)g(k)m(eyw)m(ord)227
-2649 y(v)-5 b(alue;)27 b(ASCI)s(I)c(table)i(columns)e(alw)m(a)m(ys)i
-(ha)m(v)m(e)h(rep)s(eat)f(=)g(1.)39 b(The)24 b('width')g(parameter)h
-(returns)f(the)h(width)227 2762 y(in)31 b(b)m(ytes)i(of)f(a)g(single)f
-(column)g(v)-5 b(alue)31 b(\(e.g.,)k(a)d('10D')i(binary)c(table)i
-(column)f(will)e(ha)m(v)m(e)34 b(width)c(=)i(8;)h(an)227
-2875 y(ASCI)s(I)c(table)h('F12.2')j(column)c(will)f(ha)m(v)m(e)k(width)
-c(=)i(12\);)i(Note)g(that)f(this)e(routine)h(supp)s(orts)e(the)j(lo)s
-(cal)227 2988 y(con)m(v)m(en)m(tion)c(for)d(sp)s(ecifying)f(arra)m(ys)j
-(of)f(\014xed)g(length)f(strings)g(within)f(a)i(binary)e(table)i(c)m
-(haracter)i(column)227 3101 y(using)k(the)i(syn)m(tax)f(TF)m(ORM)h(=)f
-('rAw')g(where)g('r')g(is)f(the)i(total)g(n)m(um)m(b)s(er)e(of)h(c)m
-(haracters)i(\(=)e(the)h(width)227 3214 y(of)g(the)g(column\))f(and)h
-('w')g(is)e(the)j(width)d(of)i(a)g(unit)e(string)h(within)e(the)j
-(column.)47 b(Th)m(us)32 b(if)g(the)h(column)227 3327
-y(has)k(TF)m(ORM)h(=)f('60A12')j(then)d(this)f(routine)h(will)d(return)
-j(t)m(yp)s(eco)s(de)h(=)f(TSTRING,)f(rep)s(eat)i(=)f(60,)227
-3440 y(and)31 b(width)e(=)h(12.)44 b(A)31 b(n)m(ull)e(p)s(oin)m(ter)h
-(ma)m(y)h(b)s(e)g(giv)m(en)g(for)f(an)m(y)i(of)f(the)g(output)f
-(parameters)i(that)f(are)h(not)227 3553 y(needed.)95
-3804 y Ff(int)47 b(fits_get_coltype)d(/)j(ffgtcl)286
-3917 y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(>)j(int)f(*typecode,)e
-(long)h(*repeat,)334 4030 y(long)h(*width,)f(int)g(*status\))0
-4282 y Fi(4)81 b Fj(Return)29 b(the)h(displa)m(y)e(width)g(of)i(a)h
-(column.)39 b(This)28 b(is)h(the)h(length)g(of)g(the)g(string)f(that)i
-(will)c(b)s(e)i(returned)g(b)m(y)227 4395 y(the)34 b(\014ts)p
-514 4395 28 4 v 32 w(read)p 718 4395 V 33 w(col)f(routine)f(when)g
-(reading)g(the)i(column)d(as)j(a)f(formatted)h(string.)48
-b(The)32 b(displa)m(y)g(width)227 4507 y(is)c(determined)g(b)m(y)h(the)
-g(TDISPn)f(k)m(eyw)m(ord,)i(if)e(presen)m(t,)i(otherwise)e(b)m(y)h(the)
-g(data)h(t)m(yp)s(e)f(of)h(the)f(column.)95 4872 y Ff(int)47
-b(fits_get_col_display_width)41 b(/)47 b(ffgcdw)286 4985
-y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(>)j(int)f(*dispwidth,)e(int)h
-(*status\))0 5236 y Fi(5)81 b Fj(W)-8 b(rite)28 b(\(app)s(end\))e(a)i
-(TDIMn)g(k)m(eyw)m(ord)g(whose)f(v)-5 b(alue)27 b(has)h(the)f(form)h
-('\(l,m,n...\)')40 b(where)27 b(l,)h(m,)g(n...)40 b(are)28
-b(the)227 5349 y(dimensions)g(of)i(a)h(m)m(ultidimension)c(arra)m(y)j
-(column)g(in)f(a)h(binary)f(table.)95 5601 y Ff(int)47
-b(fits_write_tdim)d(/)j(ffptdm)286 5714 y(\(fitsfile)f(*fptr,)g(int)h
-(colnum,)e(int)i(naxis,)f(long)h(*naxes,)f(>)h(int)g(*status\))p
-eop
-%%Page: 82 88
-82 87 bop 0 299 a Fj(82)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(6)81 b Fj(Return)27 b(the)i(n)m(um)m(b)s(er)e(of)i(and)e(size)
-i(of)f(the)h(dimensions)d(of)i(a)h(table)f(column)g(in)f(a)h(binary)f
-(table.)40 b(Normally)227 668 y(this)27 b(information)g(is)g(giv)m(en)h
-(b)m(y)g(the)h(TDIMn)f(k)m(eyw)m(ord,)h(but)e(if)h(this)f(k)m(eyw)m
-(ord)h(is)f(not)i(presen)m(t)f(then)g(this)227 781 y(routine)i(returns)
-f(naxis)g(=)h(1)h(and)f(naxes[0])h(equal)f(to)h(the)g(rep)s(eat)f(coun)
-m(t)h(in)e(the)i(TF)m(ORM)g(k)m(eyw)m(ord.)95 1023 y
-Ff(int)47 b(fits_read_tdim)d(/)k(ffgtdm)286 1136 y(\(fitsfile)e(*fptr,)
-g(int)h(colnum,)e(int)i(maxdim,)f(>)i(int)f(*naxis,)334
-1249 y(long)g(*naxes,)f(int)g(*status\))0 1491 y Fi(7)81
-b Fj(Deco)s(de)33 b(the)g(input)e(TDIMn)i(k)m(eyw)m(ord)g(string)e
-(\(e.g.)50 b('\(100,200\)'\))37 b(and)32 b(return)g(the)h(n)m(um)m(b)s
-(er)e(of)i(and)f(size)227 1604 y(of)c(the)g(dimensions)d(of)j(a)g
-(binary)e(table)h(column.)39 b(If)27 b(the)h(input)e(tdimstr)g(c)m
-(haracter)j(string)e(is)g(n)m(ull,)f(then)227 1717 y(this)e(routine)f
-(returns)g(naxis)g(=)i(1)f(and)g(naxes[0])i(equal)d(to)j(the)e(rep)s
-(eat)h(coun)m(t)g(in)e(the)h(TF)m(ORM)h(k)m(eyw)m(ord.)227
-1830 y(This)k(routine)g(is)h(called)f(b)m(y)h(\014ts)p
-1350 1830 28 4 v 33 w(read)p 1555 1830 V 33 w(tdim.)95
-2072 y Ff(int)47 b(fits_decode_tdim)d(/)j(ffdtdm)286
-2185 y(\(fitsfile)f(*fptr,)g(char)g(*tdimstr,)g(int)h(colnum,)e(int)i
-(maxdim,)f(>)i(int)e(*naxis,)334 2298 y(long)h(*naxes,)f(int)g
-(*status\))0 2586 y Fd(7.7.2)112 b(Routines)37 b(to)g(Edit)f(Ro)m(ws)h
-(or)g(Columns)0 2792 y Fi(1)81 b Fj(Insert)29 b(blank)f(ro)m(ws)h(in)m
-(to)g(an)h(ASCI)s(I)e(or)h(binary)f(table.)40 b(All)28
-b(the)i(ro)m(ws)f(follo)m(wing)f(ro)m(w)i(FR)m(O)m(W)g(are)g(shifted)
-227 2905 y(do)m(wn)h(b)m(y)h(NR)m(O)m(WS)g(ro)m(ws.)45
-b(If)31 b(FR)m(O)m(W)i(=)f(0)g(then)f(the)h(blank)e(ro)m(ws)i(are)g
-(inserted)e(at)j(the)f(b)s(eginning)d(of)227 3018 y(the)35
-b(table.)51 b(This)33 b(routine)g(up)s(dates)g(the)h(NAXIS2)h(k)m(eyw)m
-(ord)f(to)h(re\015ect)g(the)f(new)g(n)m(um)m(b)s(er)f(of)h(ro)m(ws)g
-(in)227 3131 y(the)d(table.)95 3373 y Ff(int)47 b(fits_insert_rows)d(/)
-j(ffirow)286 3486 y(\(fitsfile)f(*fptr,)g(long)g(firstrow,)g(long)g
-(nrows,)g(>)i(int)f(*status\))0 3729 y Fi(2)81 b Fj(Delete)38
-b(ro)m(ws)f(from)f(an)h(ASCI)s(I)f(or)h(binary)e(table)i(\(in)f(the)h
-(CDU\).)h(The)f(NR)m(O)m(WS)h(n)m(um)m(b)s(er)d(of)j(ro)m(ws)f(are)227
-3841 y(deleted,)e(starting)f(with)e(ro)m(w)i(FR)m(O)m(W.)h(An)m(y)f
-(remaining)e(ro)m(ws)i(in)f(the)h(table)f(are)i(shifted)d(up)h(to)h
-(\014ll)e(in)227 3954 y(the)h(space.)47 b(This)30 b(routine)i(mo)s
-(di\014es)e(the)j(NAXIS2)f(k)m(eyw)m(ord)h(to)g(re\015ect)g(the)g(new)e
-(n)m(um)m(b)s(er)g(of)i(ro)m(ws)f(in)227 4067 y(the)f(table.)95
-4310 y Ff(int)47 b(fits_delete_rows)d(/)j(ffdrow)286
-4422 y(\(fitsfile)f(*fptr,)g(long)g(firstrow,)g(long)g(nrows,)g(>)i
-(int)f(*status\))0 4665 y Fi(3)81 b Fj(Delete)37 b(a)f(list)e(of)i(ro)m
-(ws)g(from)g(an)f(ASCI)s(I)g(or)h(binary)e(table)h(\(in)g(the)h(CDU\).)
-h(ro)m(wlist)e(is)g(an)g(arra)m(y)i(of)f(ro)m(w)227 4778
-y(n)m(um)m(b)s(ers)29 b(to)h(b)s(e)f(deleted)h(from)f(the)h(table.)40
-b(\(The)30 b(\014rst)f(ro)m(w)g(in)g(the)h(table)f(is)g(1)h(not)g(0\).)
-41 b(The)30 b(list)e(of)i(ro)m(w)227 4891 y(n)m(um)m(b)s(ers)c(m)m(ust)
-i(b)s(e)e(sorted)i(in)e(ascending)h(order.)39 b(nro)m(ws)27
-b(is)g(the)g(n)m(um)m(b)s(er)g(of)g(ro)m(w)h(n)m(um)m(b)s(ers)e(in)g
-(the)i(list.)95 5133 y Ff(int)47 b(fits_delete_rowlist)c(/)k(ffdrws)286
-5246 y(\(fitsfile)f(*fptr,)g(long)g(*rowlist,)g(long)g(nrows,)g(>)i
-(int)f(*status\))0 5488 y Fi(4)81 b Fj(Insert)39 b(a)h(blank)f(column)f
-(\(or)j(columns\))d(in)m(to)i(an)g(ASCI)s(I)e(or)i(binary)e(table.)70
-b(COLNUM)39 b(sp)s(eci\014es)g(the)227 5601 y(column)44
-b(n)m(um)m(b)s(er)g(that)h(the)h(\(\014rst\))f(new)f(column)g(should)f
-(o)s(ccup)m(y)i(in)f(the)h(table.)85 b(NCOLS)44 b(sp)s(eci-)227
-5714 y(\014es)e(ho)m(w)g(man)m(y)h(columns)d(are)j(to)g(b)s(e)e
-(inserted.)75 b(An)m(y)43 b(existing)e(columns)g(from)g(this)g(p)s
-(osition)g(and)p eop
-%%Page: 83 89
-83 88 bop 0 299 a Fh(7.7.)72 b(ASCI)s(I)29 b(AND)i(BINAR)-8
-b(Y)31 b(T)-8 b(ABLE)31 b(R)m(OUTINES)1864 b Fj(83)227
-555 y(higher)44 b(are)h(shifted)e(o)m(v)m(er)j(to)f(allo)m(w)g(ro)s(om)
-f(for)g(the)h(new)g(column\(s\).)83 b(The)44 b(index)f(n)m(um)m(b)s(er)
-g(on)i(all)227 668 y(the)c(follo)m(wing)e(k)m(eyw)m(ords)h(will)e(b)s
-(e)i(incremen)m(ted)f(if)h(necessary)g(to)i(re\015ect)e(the)h(new)f(p)s
-(osition)e(of)j(the)227 781 y(column\(s\))25 b(in)f(the)i(table:)38
-b(TBCOLn,)26 b(TF)m(ORMn,)h(TTYPEn,)e(TUNITn,)h(TNULLn,)g(TSCALn,)f
-(TZE-)227 894 y(R)m(On,)43 b(TDISPn,)g(TDIMn,)g(TLMINn,)g(TLMAXn,)g
-(TDMINn,)g(TDMAXn,)h(TCTYPn,)e(TCRPXn,)227 1007 y(TCR)-10
-b(VLn,)29 b(TCDL)-8 b(Tn,)30 b(TCR)m(OTn,)f(and)h(TCUNIn.)95
-1261 y Ff(int)47 b(fits_insert_col)d(/)j(fficol)286 1374
-y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(char)i(*ttype,)f(char)h
-(*tform,)334 1487 y(>)h(int)e(*status\))95 1713 y(int)h
-(fits_insert_cols)d(/)j(fficls)286 1826 y(\(fitsfile)f(*fptr,)g(int)h
-(colnum,)e(int)i(ncols,)f(char)h(**ttype,)334 1939 y(char)g(**tform,)e
-(>)j(int)f(*status\))0 2193 y Fi(5)81 b Fj(Mo)s(dify)36
-b(the)h(v)m(ector)i(length)e(of)g(a)h(binary)d(table)i(column)f
-(\(e.g.,)41 b(c)m(hange)e(a)e(column)f(from)h(TF)m(ORMn)g(=)227
-2306 y('1E')31 b(to)h('20E'\).)g(The)e(v)m(ector)i(length)d(ma)m(y)i(b)
-s(e)f(increased)g(or)g(decreased)h(from)f(the)g(curren)m(t)h(v)-5
-b(alue.)95 2560 y Ff(int)47 b(fits_modify_vector_len)42
-b(/)48 b(ffmvec)286 2673 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i
-(newveclen,)e(>)j(int)e(*status\))0 2927 y Fi(6)81 b
-Fj(Delete)39 b(a)f(column)f(from)h(an)g(ASCI)s(I)f(or)h(binary)e(table)
-i(\(in)g(the)g(CDU\).)h(The)f(index)e(n)m(um)m(b)s(er)h(of)i(all)e(the)
-227 3040 y(k)m(eyw)m(ords)43 b(listed)d(ab)s(o)m(v)m(e)k(will)39
-b(b)s(e)j(decremen)m(ted)g(if)f(necessary)i(to)g(re\015ect)f(the)h(new)
-e(p)s(osition)f(of)j(the)227 3153 y(column\(s\))20 b(in)g(the)h(table.)
-37 b(The)21 b(ph)m(ysical)e(size)i(of)f(the)h(FITS)f(\014le)g(ma)m(y)i
-(not)f(b)s(e)f(reduced)g(b)m(y)h(this)e(op)s(eration,)227
-3266 y(and)30 b(the)h(empt)m(y)f(FITS)g(blo)s(c)m(ks)g(if)f(an)m(y)i
-(at)g(the)g(end)e(of)i(the)f(\014le)g(will)e(b)s(e)h(padded)g(with)g
-(zeros.)95 3520 y Ff(int)47 b(fits_delete_col)d(/)j(ffdcol\(fitsfile)d
-(*fptr,)i(int)h(colnum,)f(>)h(int)g(*status\))0 3775
-y Fi(7)81 b Fj(Cop)m(y)28 b(a)h(column)e(from)h(one)g(HDU)h(to)g
-(another)g(\(or)f(to)i(the)e(same)h(HDU\).)g(If)f(create)p
-3068 3775 28 4 v 35 w(col)g(=)g(TR)m(UE,)h(then)f(a)227
-3887 y(new)20 b(column)f(will)f(b)s(e)i(inserted)f(in)g(the)i(output)f
-(table,)j(at)e(p)s(osition)d(`outcolumn',)k(otherwise)e(the)h(existing)
-227 4000 y(output)29 b(column)e(will)f(b)s(e)i(o)m(v)m(erwritten)h
-(\(in)f(whic)m(h)f(case)j(it)e(m)m(ust)g(ha)m(v)m(e)i(a)f(compatible)f
-(datat)m(yp)s(e\).)42 b(Note)227 4113 y(that)31 b(the)g(\014rst)e
-(column)h(in)f(a)h(table)h(is)e(at)i(coln)m(um)f(=)g(1.)0
-4368 y Ff(int)47 b(fits_copy_col)d(/)k(ffcpcl)191 4480
-y(\(fitsfile)d(*infptr,)h(fitsfile)f(*outfptr,)h(int)g(incolnum,)g(int)
-h(outcolnum,)239 4593 y(int)g(create_col,)d(>)k(int)f(*status\);)0
-4883 y Fd(7.7.3)112 b(Read)38 b(and)h(W)-9 b(rite)35
-b(Column)i(Data)g(Routines)0 5102 y Fj(The)e(follo)m(wing)e(routines)i
-(write)f(or)h(read)g(data)h(v)-5 b(alues)35 b(in)f(the)h(curren)m(t)g
-(ASCI)s(I)f(or)h(binary)f(table)h(extension.)0 5215 y(If)e(a)g(write)f
-(op)s(eration)h(extends)g(b)s(ey)m(ond)f(the)h(curren)m(t)g(size)g(of)g
-(the)g(table,)h(then)f(the)g(n)m(um)m(b)s(er)f(of)h(ro)m(ws)g(in)f(the)
-0 5328 y(table)i(will)e(automatically)i(b)s(e)f(increased)h(and)f(the)i
-(NAXIS2)f(k)m(eyw)m(ord)h(v)-5 b(alue)34 b(will)d(b)s(e)j(up)s(dated.)
-51 b(A)m(ttempts)0 5441 y(to)31 b(read)f(b)s(ey)m(ond)g(the)h(end)e(of)
-i(the)f(table)h(will)c(result)j(in)f(an)h(error.)0 5601
-y(Automatic)c(data)f(t)m(yp)s(e)g(con)m(v)m(ersion)g(is)f(p)s(erformed)
-g(for)g(n)m(umerical)g(data)h(t)m(yp)s(es)g(\(only\))g(if)f(the)h(data)
-h(t)m(yp)s(e)f(of)g(the)0 5714 y(column)f(\(de\014ned)h(b)m(y)g(the)h
-(TF)m(ORMn)f(k)m(eyw)m(ord\))h(di\013ers)e(from)h(the)h(data)g(t)m(yp)s
-(e)f(of)h(the)f(calling)f(routine.)38 b(ASCI)s(I)p eop
-%%Page: 84 90
-84 89 bop 0 299 a Fj(84)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fj(tables)i(supp)s(ort)e(the)i(follo)m(wing)f(datat)m(yp)s(e)h(v)
--5 b(alues:)44 b(TSTRING,)31 b(TBYTE,)h(TSHOR)-8 b(T,)31
-b(TUSHOR)-8 b(T,)31 b(TINT,)0 668 y(TUINT,)37 b(TLONG,)h(TULONG,)g
-(TFLO)m(A)-8 b(T,)38 b(or)g(TDOUBLE.)g(Binary)f(tables)g(also)h(supp)s
-(ort)e(TLOGICAL)0 781 y(\(in)m(ternally)29 b(mapp)s(ed)g(to)i(the)f(`c)
-m(har')i(datat)m(yp)s(e\),)g(TCOMPLEX,)d(and)h(TDBLCOMPLEX.)0
-941 y(Note)d(that)f(within)d(the)j(con)m(text)h(of)f(these)g(routines,)
-f(the)h(TSTRING)e(datat)m(yp)s(e)j(corresp)s(onds)d(to)i(a)g(C)f('c)m
-(har**')0 1054 y(datat)m(yp)s(e,)39 b(i.e.,)f(a)f(p)s(oin)m(ter)e(to)i
-(an)f(arra)m(y)h(of)f(p)s(oin)m(ters)g(to)h(an)f(arra)m(y)h(of)f(c)m
-(haracters.)60 b(This)34 b(is)i(di\013eren)m(t)f(from)0
-1167 y(the)g(k)m(eyw)m(ord)g(reading)e(and)h(writing)f(routines)g
-(where)h(TSTRING)g(corresp)s(onds)f(to)i(a)g(C)f('c)m(har*')i(datat)m
-(yp)s(e,)0 1280 y(i.e.,)c(a)f(single)f(p)s(oin)m(ter)g(to)i(an)f(arra)m
-(y)g(of)g(c)m(haracters.)45 b(When)30 b(reading)h(strings)e(from)i(a)g
-(table,)h(the)f(c)m(har)h(arra)m(ys)0 1393 y(ob)m(viously)d(m)m(ust)h
-(ha)m(v)m(e)i(b)s(een)e(allo)s(cated)g(long)g(enough)g(to)h(hold)e(the)
-i(whole)e(FITS)h(table)g(string.)0 1553 y(Numerical)h(data)i(v)-5
-b(alues)32 b(are)h(automatically)g(scaled)f(b)m(y)g(the)h(TSCALn)e(and)
-h(TZER)m(On)f(k)m(eyw)m(ord)i(v)-5 b(alues)32 b(\(if)0
-1666 y(they)f(exist\).)0 1826 y(In)25 b(the)g(case)i(of)e(binary)f
-(tables)h(with)f(v)m(ector)j(elemen)m(ts,)g(the)f('felem')f(parameter)h
-(de\014nes)f(the)g(starting)g(elemen)m(t)0 1939 y(\(b)s(eginning)g
-(with)h(1,)i(not)g(0\))g(within)d(the)i(cell)g(\(a)h(cell)e(is)g
-(de\014ned)g(as)i(the)f(in)m(tersection)g(of)h(a)f(ro)m(w)h(and)e(a)i
-(column)0 2052 y(and)e(ma)m(y)h(con)m(tain)g(a)h(single)d(v)-5
-b(alue)26 b(or)h(a)g(v)m(ector)h(of)f(v)-5 b(alues\).)39
-b(The)26 b(felem)h(parameter)g(is)f(ignored)f(when)h(dealing)0
-2165 y(with)33 b(ASCI)s(I)f(tables.)51 b(Similarly)-8
-b(,)32 b(in)g(the)j(case)f(of)h(binary)d(tables)h(the)i('nelemen)m(ts')
-f(parameter)g(sp)s(eci\014es)f(the)0 2278 y(total)27
-b(n)m(um)m(b)s(er)e(of)h(v)m(ector)i(v)-5 b(alues)26
-b(to)h(b)s(e)e(read)h(or)h(written)e(\(con)m(tin)m(uing)h(on)g
-(subsequen)m(t)f(ro)m(ws)i(if)e(required\))g(and)0 2391
-y(not)34 b(the)g(n)m(um)m(b)s(er)f(of)h(table)g(cells.)50
-b(See)35 b(App)s(endix)c(B)j(for)g(the)g(further)f(de\014nitions)e(of)j
-(the)g(parameters)h(used)0 2503 y(in)29 b(these)i(routines.)0
-2762 y Fi(1)81 b Fj(W)-8 b(rite)30 b(elemen)m(ts)h(in)m(to)f(an)h(ASCI)
-s(I)e(or)h(binary)e(table)j(column.)95 3020 y Ff(int)47
-b(fits_write_col)d(/)k(ffpcl)286 3133 y(\(fitsfile)e(*fptr,)g(int)h
-(datatype,)e(int)i(colnum,)f(long)g(firstrow,)334 3246
-y(long)h(firstelem,)e(long)h(nelements,)f(DTYPE)i(*array,)f(>)h(int)g
-(*status\))0 3504 y Fi(2)81 b Fj(W)-8 b(rite)33 b(elemen)m(ts)h(in)m
-(to)g(an)f(ASCI)s(I)f(or)i(binary)d(table)j(column,)f(substituting)e
-(the)j(appropriate)e(FITS)h(n)m(ull)227 3617 y(v)-5 b(alue)27
-b(for)h(an)m(y)f(elemen)m(ts)h(that)h(are)e(equal)h(to)g(the)g(n)m(ulv)
--5 b(al)25 b(parameter)j(\(note)h(that)f(this)f(parameter)h(giv)m(es)
-227 3730 y(the)40 b(address)e(of)h(the)h(n)m(ull)d(v)-5
-b(alue,)41 b(not)f(the)f(n)m(ull)e(v)-5 b(alue)39 b(itself)7
-b(\).)67 b(F)-8 b(or)40 b(all)e(ASCI)s(I)f(table)j(columns)e(and)227
-3843 y(for)32 b(in)m(teger)h(columns)e(in)g(binary)g(tables,)i(the)g(n)
-m(ull)d(v)-5 b(alue)32 b(to)h(b)s(e)f(used)f(in)h(the)g(FITS)g(\014le)f
-(is)h(de\014ned)f(b)m(y)227 3955 y(the)36 b(TNULLn)e(k)m(eyw)m(ord)i
-(and)f(an)g(error)g(is)f(returned)h(if)f(the)h(TNULLn)g(k)m(eyw)m(ord)h
-(do)s(esn't)f(exist.)55 b(F)-8 b(or)227 4068 y(\015oating)31
-b(p)s(oin)m(t)f(columns)g(in)f(binary)h(tables)g(the)i(sp)s(ecial)d
-(IEEE)h(NaN)i(\(Not-a-Num)m(b)s(er\))h(v)-5 b(alue)30
-b(will)f(b)s(e)227 4181 y(written)34 b(in)m(to)g(the)h(FITS)f(column.)
-51 b(If)34 b(a)h(n)m(ull)e(p)s(oin)m(ter)g(is)h(en)m(tered)h(for)f(n)m
-(ulv)-5 b(al,)34 b(then)g(the)h(n)m(ull)d(v)-5 b(alue)34
-b(is)227 4294 y(ignored)27 b(and)g(this)g(routine)f(b)s(eha)m(v)m(es)i
-(the)g(same)g(as)g(\014ts)p 2158 4294 28 4 v 33 w(write)p
-2394 4294 V 32 w(col.)39 b(This)26 b(routine)h(m)m(ust)g(not)h(b)s(e)f
-(used)g(to)227 4407 y(write)j(to)h(v)-5 b(ariable)29
-b(length)h(arra)m(y)h(columns.)95 4665 y Ff(int)47 b
-(fits_write_colnull)c(/)48 b(ffpcn)286 4778 y(\(fitsfile)e(*fptr,)g
-(int)h(datatype,)e(int)i(colnum,)f(long)g(firstrow,)286
-4891 y(long)h(firstelem,)e(long)i(nelements,)e(DTYPE)h(*array,)g(DTYPE)
-g(*nulval,)286 5004 y(>)i(int)f(*status\))0 5262 y Fi(3)81
-b Fj(Set)43 b(elemen)m(ts)g(in)e(a)i(table)g(column)f(as)h
-(unde\014ned.)75 b(F)-8 b(or)44 b(all)d(ASCI)s(I)h(table)g(columns)g
-(and)g(for)h(in)m(teger)227 5375 y(columns)25 b(in)g(binary)f(tables,)j
-(the)g(n)m(ull)d(v)-5 b(alue)25 b(to)i(b)s(e)e(used)h(in)f(the)h(FITS)f
-(\014le)g(is)h(de\014ned)f(b)m(y)h(the)g(TNULLn)227 5488
-y(k)m(eyw)m(ord)35 b(and)f(an)h(error)f(is)f(returned)h(if)f(the)i
-(TNULLn)f(k)m(eyw)m(ord)h(do)s(esn't)f(exist.)53 b(F)-8
-b(or)35 b(\015oating)g(p)s(oin)m(t)227 5601 y(columns)g(in)f(binary)g
-(tables)i(the)g(sp)s(ecial)e(IEEE)h(NaN)i(\(Not-a-Num)m(b)s(er\))g(v)-5
-b(alue)36 b(will)d(b)s(e)i(written)g(in)m(to)227 5714
-y(the)c(FITS)e(column.)p eop
-%%Page: 85 91
-85 90 bop 0 299 a Fh(7.8.)72 b(CELESTIAL)29 b(COORDINA)-8
-b(TE)30 b(SYSTEM)f(R)m(OUTINES)1490 b Fj(85)143 555 y
-Ff(int)47 b(fits_write_col_null)c(/)k(ffpclu)334 668
-y(\(fitsfile)e(*fptr,)h(int)h(colnum,)f(long)h(firstrow,)e(long)i
-(firstelem,)382 781 y(long)f(nelements,)f(>)j(int)f(*status\))0
-1016 y Fi(4)81 b Fj(Read)35 b(elemen)m(ts)h(from)g(an)f(ASCI)s(I)f(or)i
-(binary)e(table)h(column.)56 b(The)35 b(datat)m(yp)s(e)h(parameter)g
-(sp)s(eci\014es)f(the)227 1129 y(datat)m(yp)s(e)c(of)f(the)f(`n)m(ulv)
--5 b(al')29 b(and)g(`arra)m(y')i(p)s(oin)m(ters;)e(Unde\014ned)f(arra)m
-(y)i(elemen)m(ts)g(will)d(b)s(e)i(returned)f(with)227
-1242 y(a)i(v)-5 b(alue)29 b(=)f(*n)m(ullv)-5 b(al,)28
-b(\(note)i(that)g(this)e(parameter)i(giv)m(es)f(the)h(address)e(of)h
-(the)h(n)m(ull)d(v)-5 b(alue,)29 b(not)h(the)f(n)m(ull)227
-1355 y(v)-5 b(alue)30 b(itself)7 b(\))30 b(unless)f(n)m(ulv)-5
-b(al)30 b(=)g(0)h(or)g(*n)m(ulv)-5 b(al)29 b(=)i(0,)g(in)e(whic)m(h)h
-(case)i(no)e(c)m(hec)m(king)i(for)e(unde\014ned)f(pixels)227
-1468 y(will)f(b)s(e)i(p)s(erformed.)227 1614 y(An)m(y)e(column,)g
-(regardless)f(of)h(it's)g(in)m(trinsic)d(datat)m(yp)s(e,)30
-b(ma)m(y)e(b)s(e)f(read)h(as)g(a)h(string.)39 b(It)28
-b(should)d(b)s(e)j(noted)227 1727 y(ho)m(w)m(ev)m(er)k(that)f(reading)e
-(a)i(n)m(umeric)e(column)g(as)i(a)g(string)e(is)g(10)j(-)e(100)i(times)
-e(slo)m(w)m(er)g(than)g(reading)g(the)227 1840 y(same)22
-b(column)f(as)g(a)h(n)m(um)m(b)s(er)e(due)h(to)i(the)e(large)h(o)m(v)m
-(erhead)h(in)d(constructing)h(the)h(formatted)g(strings.)36
-b(The)227 1953 y(displa)m(y)24 b(format)i(of)f(the)h(returned)e
-(strings)g(will)f(b)s(e)i(determined)f(b)m(y)h(the)h(TDISPn)e(k)m(eyw)m
-(ord,)j(if)d(it)h(exists,)227 2066 y(otherwise)33 b(b)m(y)g(the)g
-(datat)m(yp)s(e)h(of)f(the)g(column.)47 b(The)33 b(length)f(of)h(the)g
-(returned)f(strings)g(\(not)h(including)227 2179 y(the)26
-b(n)m(ull)d(terminating)i(c)m(haracter\))i(can)f(b)s(e)f(determined)f
-(with)g(the)i(\014ts)p 2703 2179 28 4 v 32 w(get)p 2855
-2179 V 34 w(col)p 3000 2179 V 33 w(displa)m(y)p 3313
-2179 V 31 w(width)e(routine.)227 2292 y(The)30 b(follo)m(wing)f(TDISPn)
-g(displa)m(y)g(formats)h(are)h(curren)m(tly)e(supp)s(orted:)418
-2626 y Ff(Iw.m)142 b(Integer)418 2739 y(Ow.m)g(Octal)47
-b(integer)418 2852 y(Zw.m)142 b(Hexadecimal)45 b(integer)418
-2965 y(Fw.d)142 b(Fixed)47 b(floating)e(point)418 3078
-y(Ew.d)142 b(Exponential)45 b(floating)h(point)418 3190
-y(Dw.d)142 b(Exponential)45 b(floating)h(point)418 3303
-y(Gw.d)142 b(General;)46 b(uses)g(Fw.d)h(if)g(significance)e(not)i
-(lost,)f(else)h(Ew.d)227 3525 y Fj(where)24 b(w)h(is)e(the)i(width)e
-(in)g(c)m(haracters)j(of)f(the)g(displa)m(y)m(ed)e(v)-5
-b(alues,)26 b(m)e(is)g(the)g(minim)m(um)e(n)m(um)m(b)s(er)i(of)g
-(digits)227 3638 y(displa)m(y)m(ed,)j(and)g(d)g(is)g(the)g(n)m(um)m(b)s
-(er)g(of)g(digits)g(to)h(the)g(righ)m(t)f(of)g(the)h(decimal.)39
-b(The)27 b(.m)g(\014eld)f(is)h(optional.)95 3873 y Ff(int)47
-b(fits_read_col)e(/)i(ffgcv)286 3986 y(\(fitsfile)f(*fptr,)g(int)h
-(datatype,)e(int)i(colnum,)f(long)g(firstrow,)g(long)g(firstelem,)334
-4099 y(long)h(nelements,)e(DTYPE)h(*nulval,)g(DTYPE)g(*array,)g(int)h
-(*anynul,)e(int)i(*status\))0 4334 y Fi(5)81 b Fj(Read)35
-b(elemen)m(ts)h(from)g(an)f(ASCI)s(I)f(or)i(binary)e(table)h(column.)56
-b(The)35 b(datat)m(yp)s(e)h(parameter)g(sp)s(eci\014es)f(the)227
-4447 y(datat)m(yp)s(e)44 b(of)f(the)g(and)f(`arra)m(y')i(p)s(oin)m
-(ter;)k(An)m(y)43 b(unde\014ned)e(elemen)m(ts)i(will)d(ha)m(v)m(e)k
-(the)f(corresp)s(onding)227 4560 y(n)m(ullarra)m(y)29
-b(elemen)m(t)i(set)g(to)g(TR)m(UE.)95 4795 y Ff(int)47
-b(fits_read_colnull)c(/)48 b(ffgcf)286 4908 y(\(fitsfile)e(*fptr,)g
-(int)h(datatype,)e(int)i(colnum,)f(long)g(firstrow,)g(long)g
-(firstelem,)286 5021 y(long)h(nelements,)e(DTYPE)h(*array,)g(char)h
-(*nullarray,)e(int)h(*anynul,)g(int)h(*status\))0 5351
-y Fe(7.8)135 b(Celestial)48 b(Co)t(ordinate)e(System)f(Routines)0
-5601 y Fj(Tw)m(o)31 b(complimen)m(tary)e(sets)i(of)g(routines)f(are)g
-(pro)m(vided)g(for)g(calculating)g(the)h(transformation)e(b)s(et)m(w)m
-(een)j(pixel)0 5714 y(lo)s(cation)25 b(in)e(an)i(image)h(and)e(the)h
-(the)g(corresp)s(onding)e(celestial)i(co)s(ordinates)g(on)g(the)g(sky)
--8 b(.)39 b(These)25 b(routines)f(rely)p eop
-%%Page: 86 92
-86 91 bop 0 299 a Fj(86)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fj(on)i(a)g(set)h(of)f(standard)f(W)-8 b(orld)32
-b(Co)s(ordinate)f(System)h(\(W)m(CS\))h(k)m(eyw)m(ords)f(in)f(the)h
-(header)g(of)g(the)g(HDU)h(whic)m(h)0 668 y(de\014ne)d(the)g
-(parameters)h(to)g(b)s(e)f(used)f(when)h(calculating)f(the)i(co)s
-(ordinate)f(transformation.)0 828 y(Both)25 b(sets)g(of)g(routines)f
-(require)f(that)i(a)g(2)g(step)g(pro)s(cedure)f(b)s(e)g(follo)m(w)m
-(ed:)37 b(\014rst)24 b(an)h(initialization)c(routine)j(m)m(ust)0
-941 y(b)s(e)31 b(called)g(to)h(read)g(the)f(relev)m(en)m(t)i(W)m(CS)e
-(k)m(eyw)m(ords)h(in)f(the)g(header.)45 b(These)31 b(parameters)h(are)g
-(then)f(passed)g(to)0 1054 y(a)f(pair)e(of)h(routines)f(that)i(con)m(v)
-m(ert)h(from)d(pixel)g(to)i(sky)f(co)s(ordinates,)g(or)g(from)g(sky)g
-(to)h(pixel)e(co)s(ordinates.)40 b(See)0 1167 y(App)s(endix)28
-b(B)i(for)h(the)f(de\014nition)e(of)j(the)f(parameters)h(used)e(in)h
-(these)g(routines.)0 1327 y(The)24 b(\014rst)h(set)g(of)g(routines)f
-(describ)s(ed)f(b)s(elo)m(w)h(ha)m(v)m(e)i(the)f(adv)-5
-b(an)m(tage)27 b(that)f(they)f(are)g(completely)g(self-con)m(tained)0
-1440 y(within)f(the)j(CFITSIO)f(library)e(and)j(th)m(us)f(are)i(guaran)
-m(teed)g(to)f(b)s(e)f(a)m(v)-5 b(ailable)27 b(on)g(the)g(system.)39
-b(These)27 b(routines)0 1553 y(only)i(supp)s(ort)g(the)i(most)f(common)
-h(t)m(yp)s(es)f(of)h(map)f(pro)5 b(jections)30 b(and)g(W)m(CS)g(k)m
-(eyw)m(ord)h(con)m(v)m(en)m(tions)g(ho)m(w)m(ev)m(er.)0
-1713 y(The)j(second)h(set)g(of)g(routines)f(are)h(a)m(v)-5
-b(ailable)34 b(in)g(a)h(W)m(CS)g(library)d(written)i(b)m(y)h(Doug)g
-(Mink)f(at)h(SA)m(O.)g(These)0 1826 y(routines)26 b(are)i(more)g(p)s(o)
-m(w)m(erful)e(than)h(the)g(ones)h(con)m(tained)g(in)e(CFITSIO)g(itself)
-g(b)s(ecause)h(they)h(supp)s(ort)d(all)i(the)0 1939 y(de\014ned)35
-b(W)m(CS)i(map)g(pro)5 b(jections)36 b(and)g(they)h(supp)s(ort)e(a)i(n)
-m(um)m(b)s(er)e(of)i(non-standard)f(k)m(eyw)m(ord)h(con)m(v)m(en)m
-(tions)0 2052 y(that)g(ha)m(v)m(e)h(b)s(een)e(adopted)h(o)m(v)m(er)h
-(the)f(y)m(ears)h(b)m(y)e(v)-5 b(arious)36 b(di\013eren)m(t)g(observ)-5
-b(atories.)60 b(T)-8 b(o)37 b(use)g(these)g(routines,)0
-2165 y(ho)m(w)m(ev)m(er,)c(requires)c(that)i(a)g(separate)h(W)m(CS)f
-(library)d(b)s(e)j(built)d(and)i(installed)f(on)i(the)g(system)g(in)e
-(addition)g(to)0 2278 y(CFITSIO.)0 2568 y Fd(7.8.1)150
-b(Self-con)m(tained)37 b(W)m(CS)g(Routines)0 2787 y Fj(The)e(follo)m
-(wing)f(routines)g(are)i(included)d(in)h(the)h(CFITSIO)f(library)f(to)j
-(help)e(calculate)i(the)g(transformation)0 2900 y(b)s(et)m(w)m(een)d
-(pixel)e(lo)s(cation)i(in)e(an)i(image)g(and)f(the)h(corresp)s(onding)e
-(celestial)h(co)s(ordinates)h(on)f(the)h(sky)-8 b(.)48
-b(These)0 3013 y(supp)s(ort)35 b(the)i(follo)m(wing)f(standard)g(map)h
-(pro)5 b(jections:)53 b(-SIN,)37 b(-T)-8 b(AN,)38 b(-AR)m(C,)g(-NCP)-8
-b(,)38 b(-GLS,)f(-MER,)g(and)g(-)0 3126 y(AIT)30 b(\(these)i(are)f(the)
-g(legal)f(v)-5 b(alues)30 b(for)h(the)g(co)s(ordt)m(yp)s(e)g
-(parameter\).)42 b(These)31 b(routines)e(are)j(based)e(on)h(similar)0
-3239 y(functions)e(in)g(Classic)g(AIPS.)h(All)f(the)i(angular)e(quan)m
-(tities)h(are)h(giv)m(en)f(in)f(units)g(of)h(degrees.)0
-3498 y Fi(1)81 b Fj(Get)34 b(the)f(v)-5 b(alues)32 b(of)h(all)f(the)h
-(standard)f(FITS)h(celestial)f(co)s(ordinate)h(system)g(k)m(eyw)m(ords)
-g(from)g(the)g(header)227 3611 y(of)g(a)g(FITS)f(image)h(\(i.e.,)g(the)
-g(primary)e(arra)m(y)i(or)f(an)h(image)g(extension\).)47
-b(These)32 b(v)-5 b(alues)32 b(ma)m(y)h(then)g(b)s(e)227
-3724 y(passed)28 b(to)g(the)g(routines)f(that)h(p)s(erform)f(the)h(co)s
-(ordinate)g(transformations.)39 b(If)27 b(an)m(y)h(or)g(all)f(of)h(the)
-g(W)m(CS)227 3837 y(k)m(eyw)m(ords)k(are)f(not)g(presen)m(t,)h(then)f
-(default)f(v)-5 b(alues)30 b(will)f(b)s(e)h(returned.)41
-b(If)31 b(the)g(\014rst)g(co)s(ordinate)f(axis)h(is)227
-3950 y(the)e(declination-lik)m(e)e(co)s(ordinate,)i(then)f(this)f
-(routine)h(will)e(sw)m(ap)i(them)h(so)g(that)g(the)g(longitudinal-lik)m
-(e)227 4063 y(co)s(ordinate)h(is)g(returned)f(as)i(the)f(\014rst)g
-(axis.)227 4213 y(If)35 b(the)h(\014le)e(uses)h(the)g(new)m(er)h('CDj)p
-1454 4213 28 4 v 32 w(i')f(W)m(CS)g(transformation)g(matrix)g(k)m(eyw)m
-(ords)g(instead)g(of)g(old)g(st)m(yle)227 4326 y('CDEL)-8
-b(Tn')37 b(and)f('CR)m(OT)-8 b(A2')38 b(k)m(eyw)m(ords,)h(then)e(this)e
-(routine)h(will)e(calculate)k(and)e(return)g(the)h(v)-5
-b(alues)227 4438 y(of)33 b(the)g(equiv)-5 b(alen)m(t)33
-b(old-st)m(yle)f(k)m(eyw)m(ords.)49 b(Note)34 b(that)g(the)f(con)m(v)m
-(ersion)g(from)f(the)i(new-st)m(yle)f(k)m(eyw)m(ords)227
-4551 y(to)f(the)f(old-st)m(yle)f(v)-5 b(alues)30 b(is)g(sometimes)g
-(only)g(an)h(appro)m(ximation,)f(so)g(if)g(the)h(appro)m(ximation)f(is)
-f(larger)227 4664 y(than)37 b(an)h(in)m(ternally)d(de\014ned)h
-(threshold)g(lev)m(el,)j(then)e(CFITSIO)f(will)f(still)g(return)h(the)i
-(appro)m(ximate)227 4777 y(W)m(CS)32 b(k)m(eyw)m(ord)h(v)-5
-b(alues,)32 b(but)f(will)e(also)j(return)f(with)g(status)h(=)f(APPR)m
-(O)m(X)p 2908 4777 V 34 w(W)m(CS)p 3149 4777 V 33 w(KEY,)g(to)i(w)m
-(arn)f(the)227 4890 y(calling)h(program)h(that)h(appro)m(ximations)e
-(ha)m(v)m(e)i(b)s(een)f(made.)52 b(It)35 b(is)e(then)h(up)f(to)i(the)f
-(calling)f(program)227 5003 y(to)d(decide)f(whether)f(the)h(appro)m
-(ximations)f(are)i(su\016cien)m(tly)d(accurate)k(for)e(the)g
-(particular)e(application,)227 5116 y(or)46 b(whether)e(more)i(precise)
-f(W)m(CS)g(transformations)g(m)m(ust)g(b)s(e)g(p)s(erformed)f(using)f
-(new-st)m(yle)j(W)m(CS)227 5229 y(k)m(eyw)m(ords)31 b(directly)-8
-b(.)95 5488 y Ff(int)47 b(fits_read_img_coord)c(/)k(ffgics)286
-5601 y(\(fitsfile)f(*fptr,)g(>)h(double)f(*xrefval,)g(double)g
-(*yrefval,)334 5714 y(double)g(*xrefpix,)f(double)i(*yrefpix,)e(double)
-h(*xinc,)g(double)g(*yinc,)p eop
-%%Page: 87 93
-87 92 bop 0 299 a Fh(7.8.)72 b(CELESTIAL)29 b(COORDINA)-8
-b(TE)30 b(SYSTEM)f(R)m(OUTINES)1490 b Fj(87)334 555 y
-Ff(double)46 b(*rot,)h(char)f(*coordtype,)f(int)i(*status\))0
-806 y Fi(2)81 b Fj(Get)34 b(the)f(v)-5 b(alues)32 b(of)h(all)f(the)h
-(standard)f(FITS)h(celestial)f(co)s(ordinate)h(system)g(k)m(eyw)m(ords)
-g(from)g(the)g(header)227 919 y(of)j(a)h(FITS)e(table)g(where)h(the)g
-(X)g(and)f(Y)h(\(or)g(RA)g(and)g(DEC)f(co)s(ordinates)h(are)g(stored)g
-(in)f(2)h(separate)227 1032 y(columns)j(of)h(the)g(table.)69
-b(These)40 b(v)-5 b(alues)39 b(ma)m(y)h(then)g(b)s(e)f(passed)g(to)i
-(the)f(routines)f(that)h(p)s(erform)f(the)227 1145 y(co)s(ordinate)30
-b(transformations.)95 1396 y Ff(int)47 b(fits_read_tbl_coord)c(/)k
-(ffgtcs)286 1508 y(\(fitsfile)f(*fptr,)g(int)h(xcol,)f(int)h(ycol,)f(>)
-i(double)e(*xrefval,)334 1621 y(double)g(*yrefval,)f(double)i
-(*xrefpix,)e(double)h(*yrefpix,)f(double)h(*xinc,)334
-1734 y(double)g(*yinc,)g(double)g(*rot,)h(char)f(*coordtype,)f(int)i
-(*status\))0 1985 y Fi(3)81 b Fj(Calculate)40 b(the)i(celestial)e(co)s
-(ordinate)h(corresp)s(onding)e(to)j(the)f(input)e(X)i(and)g(Y)g(pixel)e
-(lo)s(cation)i(in)f(the)227 2098 y(image.)95 2349 y Ff(int)47
-b(fits_pix_to_world)c(/)48 b(ffwldp)286 2462 y(\(double)e(xpix,)h
-(double)f(ypix,)g(double)g(xrefval,)g(double)g(yrefval,)334
-2575 y(double)g(xrefpix,)g(double)g(yrefpix,)f(double)h(xinc,)h(double)
-f(yinc,)334 2687 y(double)g(rot,)h(char)f(*coordtype,)f(>)j(double)e
-(*xpos,)g(double)g(*ypos,)334 2800 y(int)h(*status\))0
-3051 y Fi(4)81 b Fj(Calculate)40 b(the)i(X)f(and)f(Y)h(pixel)f(lo)s
-(cation)g(corresp)s(onding)f(to)j(the)f(input)e(celestial)i(co)s
-(ordinate)g(in)f(the)227 3164 y(image.)95 3415 y Ff(int)47
-b(fits_world_to_pix)c(/)48 b(ffxypx)286 3528 y(\(double)e(xpos,)h
-(double)f(ypos,)g(double)g(xrefval,)g(double)g(yrefval,)334
-3641 y(double)g(xrefpix,)g(double)g(yrefpix,)f(double)h(xinc,)h(double)
-f(yinc,)334 3754 y(double)g(rot,)h(char)f(*coordtype,)f(double)h
-(*xpix,)g(double)g(*ypix,)334 3867 y(int)h(*status\))0
-4156 y Fd(7.8.2)112 b(W)m(CS)38 b(Routines)e(that)i(require)e(the)i(W)m
-(CS)f(library)0 4375 y Fj(The)d(routines)g(describ)s(ed)f(in)h(this)g
-(section)h(use)g(the)g(W)m(CS)g(library)d(written)i(b)m(y)h(Doug)h
-(Mink)e(at)i(SA)m(O.)f(This)0 4488 y(library)28 b(is)h(a)m(v)-5
-b(ailable)30 b(at)0 4738 y Ff(http://tdc-www.harvard.e)o(du/s)o(oftw)o
-(are)o(/wcs)o(tool)o(s/)185 b(and)0 4851 y(http://tdc-www.harvard.e)o
-(du/s)o(oftw)o(are)o(/wcs)o(tool)o(s/w)o(cs.h)o(tml)0
-5102 y Fj(Y)-8 b(ou)25 b(do)g(not)g(need)g(the)g(en)m(tire)g(W)m(CST)-8
-b(o)s(ols)24 b(pac)m(k)-5 b(age)27 b(to)f(use)e(the)h(routines)f
-(describ)s(ed)f(here.)39 b(Instead,)26 b(y)m(ou)f(only)0
-5215 y(need)j(to)h(install)d(the)j(W)-8 b(orld)28 b(Co)s(ordinate)f
-(System)i(Subroutine)c(library)-8 b(.)39 b(It)28 b(is)f(a)m(v)-5
-b(ailable)28 b(from)g(the)h(ftp)f(site)g(as)0 5328 y(a)33
-b(gzipp)s(ed)d(.tar)j(\014le)f(\(e.g.,)i(w)m(cssubs-2.5.tar.gz\))h(or)e
-(as)f(a)h(zipp)s(ed)d(\014le)h(\(e.g.,)k(w)m(cssub25.zip\).)46
-b(An)m(y)33 b(questions)0 5441 y(ab)s(out)d(using)f(this)g(library)f
-(should)h(b)s(e)g(sen)m(t)i(to)g(the)g(author)f(at)h(dmink@cfa.harv)-5
-b(ard.edu.)0 5601 y(The)35 b(adv)-5 b(an)m(tage)38 b(of)f(using)d(the)i
-(W)m(CS)g(library)e(instead)h(of)h(the)g(self-con)m(tained)g(W)m(CS)g
-(routines)f(decrib)s(ed)f(in)0 5714 y(the)j(previous)e(section)h(is)g
-(that)h(they)g(pro)m(vide)e(supp)s(ort)g(for)h(all)g(curren)m(tly)f
-(de\014ned)h(pro)5 b(jection)36 b(geometries,)p eop
-%%Page: 88 94
-88 93 bop 0 299 a Fj(88)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fj(and)25 b(they)h(also)f(supp)s(ort)f(most)i(standard)f(as)h(w)m
-(ell)e(as)i(man)m(y)g(non-standard)e(W)m(CS)i(k)m(eyw)m(ord)g(con)m(v)m
-(en)m(tions)g(that)0 668 y(ha)m(v)m(e)36 b(b)s(een)e(used)g(b)m(y)h
-(di\013eren)m(t)f(observ)-5 b(atories)35 b(in)f(the)h(past.)54
-b(This)33 b(library)g(is)h(also)h(activ)m(ely)g(main)m(tained)f(so)0
-781 y(it)g(is)f(lik)m(ely)g(that)i(it)f(will)e(supp)s(ort)h(an)m(y)h
-(new)g(FITS)g(W)m(CS)g(k)m(eyw)m(ord)h(con)m(v)m(en)m(tions)g(that)g
-(are)g(adopted)g(in)e(the)0 894 y(future.)0 1054 y(The)39
-b(\014rst)g(3)h(routines)e(describ)s(ed)g(b)s(elo)m(w)g(are)i(CFITSIO)e
-(routines)h(that)h(create)h(a)f(c)m(haracter)h(string)d(arra)m(y)0
-1167 y(con)m(taining)d(all)f(the)h(W)m(CS)g(k)m(eyw)m(ords)h(that)f
-(are)h(needed)f(as)g(input)e(to)j(the)f(W)m(CS)h(library)c('w)m
-(csinit')j(routine.)0 1280 y(These)24 b(3)g(routines)f(pro)m(vide)g(a)h
-(con)m(v)m(enien)m(t)h(in)m(terface)g(for)f(calling)e(the)i(W)m(CS)g
-(library)e(routines)h(from)g(CFITSIO,)0 1393 y(but)30
-b(do)g(not)h(actually)f(call)f(an)m(y)i(routines)e(in)g(the)i(W)m(CS)f
-(library)e(themselv)m(es.)0 1655 y Fi(1)81 b Fj(Cop)m(y)42
-b(all)g(the)h(W)m(CS-related)f(k)m(eyw)m(ords)h(from)g(the)f(header)h
-(of)g(the)f(primary)f(arra)m(y)i(or)g(an)f(image)h(ex-)227
-1768 y(tension)38 b(in)m(to)g(a)h(single)e(long)h(c)m(haracter)i
-(string)d(arra)m(y)-8 b(.)66 b(The)38 b(80-c)m(har)i(header)e(k)m(eyw)m
-(ords)h(are)f(simply)227 1881 y(concatinated)d(one)e(after)h(the)f
-(other)h(in)e(the)h(returned)f(string.)49 b(The)32 b(c)m(haracter)j
-(arra)m(y)f(is)e(dynamically)227 1994 y(allo)s(cated)24
-b(and)f(m)m(ust)g(b)s(e)g(freed)g(b)m(y)g(the)h(calling)e(program)h
-(when)g(it)g(is)f(no)i(longer)f(needed.)38 b(In)22 b(the)i(curren)m(t)
-227 2107 y(implemen)m(tation,)30 b(all)f(the)h(header)h(k)m(eyw)m(ords)
-f(are)h(copied)f(in)m(to)g(the)h(arra)m(y)-8 b(.)95 2369
-y Ff(int)47 b(fits_get_image_wcs_keys)42 b(/)47 b(ffgiwcs)286
-2482 y(\(fitsfile)f(*fptr,)g(char)g(**header,)g(int)h(*status\))0
-2745 y Fi(2)81 b Fj(Cop)m(y)41 b(all)f(the)h(W)m(CS-related)h(k)m(eyw)m
-(ords)g(for)f(a)g(giv)m(en)g(pair)f(of)i(columns)e(in)g(a)h(table)g
-(extension)g(in)m(to)h(a)227 2858 y(single)34 b(long)h(c)m(haracter)i
-(string)d(arra)m(y)-8 b(.)56 b(The)35 b(pair)f(of)i(columns)e(m)m(ust)h
-(con)m(tain)g(a)h(list)e(of)h(the)h(X)f(and)g(Y)227 2970
-y(co)s(ordinates)27 b(of)g(eac)m(h)h(ev)m(en)m(t)g(in)e(the)h(image)g
-(\(i.e.,)h(this)e(is)g(an)h(image)g(in)e(pixel-list)g(or)i(ev)m(en)m
-(t-list)g(format\).)227 3083 y(The)33 b(names)h(of)g(the)f(W)m(CS)h(k)m
-(eyw)m(ords)g(in)e(the)i(table)f(header)h(are)g(translated)f(in)m(to)h
-(the)f(k)m(eyw)m(ords)h(that)227 3196 y(w)m(ould)29 b(corresp)s(ond)h
-(to)h(an)f(image)h(HDU)g(\(e.g.,)h(TCRPXn)d(for)h(the)h(X)g(column)e(b)
-s(ecomes)h(the)h(CRPIX1)227 3309 y(k)m(eyw)m(ord\).)54
-b(The)34 b(80-c)m(har)i(header)e(k)m(eyw)m(ords)h(are)g(simply)d
-(concatinated)j(one)g(after)g(the)g(other)g(in)e(the)227
-3422 y(string.)38 b(The)23 b(c)m(haracter)j(arra)m(y)e(is)f
-(dynamically)f(allo)s(cated)i(and)f(m)m(ust)h(b)s(e)f(freed)h(b)m(y)g
-(the)g(calling)e(program)227 3535 y(when)30 b(it)g(is)f(no)h(longer)g
-(needed.)95 3797 y Ff(int)47 b(fits_get_table_wcs_keys)42
-b(/)47 b(ffgtwcs)286 3910 y(\(fitsfile)f(*fptr,)g(int)h(xcol,)f(int)h
-(ycol,)f(char)h(**header,)e(int)i(*status\))0 4173 y
-Fi(3)81 b Fj(Cop)m(y)39 b(all)f(the)h(W)m(CS-related)h(k)m(eyw)m(ords)f
-(for)g(an)g(image)h(that)g(is)e(con)m(tained)h(in)f(a)i(single)e(v)m
-(ector)i(cell)f(of)227 4286 y(a)44 b(binary)d(table)j(extension)f(in)m
-(to)g(a)h(single)e(long)g(c)m(haracter)j(string)e(arra)m(y)-8
-b(.)80 b(In)43 b(this)f(t)m(yp)s(e)h(of)h(image)227 4399
-y(format,)f(the)c(table)g(column)g(is)f(a)i(2-dimensional)d(v)m(ector)k
-(and)e(eac)m(h)h(ro)m(w)g(of)g(the)f(table)g(con)m(tains)h(an)227
-4512 y(image.)g(The)26 b(names)h(of)g(the)g(W)m(CS)f(k)m(eyw)m(ords)h
-(in)f(the)h(table)f(header)h(are)g(translated)f(in)m(to)h(the)g(k)m
-(eyw)m(ords)227 4624 y(corresp)s(onding)d(to)j(an)f(image)g(\(e.g.,)j
-(1CRPn)c(b)s(ecomes)h(the)g(CRPIX1)g(k)m(eyw)m(ord\).)40
-b(The)26 b(80-c)m(har)h(header)227 4737 y(k)m(eyw)m(ords)36
-b(are)g(simply)e(concatinated)i(one)g(after)g(the)g(other)g(in)f(the)h
-(string.)55 b(The)35 b(c)m(haracter)j(arra)m(y)e(is)227
-4850 y(dynamically)27 b(allo)s(cated)h(and)g(m)m(ust)h(b)s(e)f(freed)g
-(b)m(y)h(the)f(calling)f(program)i(when)e(it)i(is)e(no)i(longer)f
-(needed.)95 5113 y Ff(int)47 b(fits_get_imagecell_wcs_key)o(s)42
-b(/)47 b(ffgicwcs)286 5226 y(\(fitsfile)f(*fptr,)g(int)h(column,)e
-(long)i(row,)g(char)f(**header,)g(int)h(*status\))0 5488
-y Fi(4)81 b Fj(This)23 b(W)m(CS)i(library)d(routine)i(returns)g(a)h(p)s
-(oin)m(ter)f(to)i(a)f(structure)g(that)g(con)m(tains)h(all)d(the)j(W)m
-(CS)f(parameters)227 5601 y(extracted)i(from)e(the)g(input)f(header)h
-(k)m(eyw)m(ords.)39 b(The)25 b(input)e(header)i(k)m(eyw)m(ord)h(string)
-e(can)i(b)s(e)f(pro)s(duced)227 5714 y(b)m(y)30 b(an)m(y)g(of)g(the)f
-(3)h(previous)e(routines.)40 b(The)29 b(returned)f(W)-8
-b(orldCo)s(or)29 b(structure)g(is)g(used)g(as)h(input)d(to)k(the)p
-eop
-%%Page: 89 95
-89 94 bop 0 299 a Fh(7.9.)72 b(HIERAR)m(CHICAL)30 b(GR)m(OUPING)h
-(CONVENTION)f(SUPPOR)-8 b(T)29 b(R)m(OUTINES)686 b Fj(89)227
-555 y(next)41 b(2)g(W)m(CS)f(library)e(routines)i(that)h(con)m(v)m(ert)
-h(b)s(et)m(w)m(een)f(sky)f(co)s(ordinates)g(and)g(pixel)f(co)s
-(ordinates.)227 668 y(This)34 b(routine)h(dynamically)e(allo)s(cates)j
-(the)g(W)-8 b(orldCo)s(or)35 b(structure,)i(so)f(it)f(m)m(ust)h(b)s(e)f
-(freed)g(b)m(y)g(calling)227 781 y(the)c(w)m(csfree)g(routine)e(when)g
-(it)h(is)g(no)g(longer)g(needed.)95 1034 y Ff(struct)47
-b(WorldCoor)e(*wcsinit)g(\(char)i(*header\))0 1287 y
-Fi(5)81 b Fj(Calculate)32 b(the)h(sky)g(co)s(ordinate)f(corresp)s
-(onding)f(to)j(the)f(input)d(pixel)i(co)s(ordinate)g(using)g(the)h(con)
-m(v)m(ersion)227 1400 y(parameters)e(de\014ned)e(in)g(the)i(w)m(cs)f
-(structure.)41 b(This)28 b(is)i(a)g(W)m(CS)h(library)d(routine.)95
-1653 y Ff(void)47 b(pix2wcs)f(\(struct)g(WorldCoor)f(*wcs,)h(double)g
-(xpix,)h(double)f(ypix,)382 1766 y(>)h(double)f(*xpos,)g(double)h
-(*ypos\))0 2019 y Fi(6)81 b Fj(Calculate)32 b(the)h(pixel)e(co)s
-(ordinate)i(corresp)s(onding)e(to)i(the)g(input)e(sky)i(co)s(ordinate)f
-(using)g(the)h(con)m(v)m(ersion)227 2132 y(parameters)42
-b(de\014ned)e(in)g(the)h(w)m(cs)h(structure.)73 b(The)40
-b(returned)h(o\013scale)h(parameter)f(equals)g(0)h(if)e(the)227
-2245 y(co)s(ordinate)30 b(is)g(within)e(b)s(ounds)g(of)i(the)h(image.)
-41 b(This)29 b(is)g(a)i(W)m(CS)f(library)e(routine.)95
-2498 y Ff(void)47 b(wcs2pix)f(\(struct)g(WorldCoor)f(*wcs,)h(double)g
-(xpos,)h(double)f(ypos,)334 2611 y(>)i(double)e(*xpix,)g(double)g
-(*ypix,)g(int)h(*offscale\))0 2864 y Fi(7)81 b Fj(F)-8
-b(ree)31 b(the)g(W)m(CS)f(structure)g(that)h(w)m(as)g(created)g(b)m(y)f
-(w)m(csinit.)40 b(This)28 b(is)i(a)g(W)m(CS)h(library)d(routine.)95
-3117 y Ff(void)47 b(wcsfree\(struct)d(WorldCoor)h(*wcs\))0
-3450 y Fe(7.9)135 b(Hierarc)l(hical)47 b(Grouping)d(Con)l(v)l(en)l
-(tion)j(Supp)t(ort)d(Routines)0 3700 y Fj(These)34 b(functions)g(allo)m
-(w)g(for)g(the)h(creation)g(and)f(manipulation)e(of)j(FITS)f(HDU)h
-(Groups,)h(as)f(de\014ned)e(in)g("A)0 3813 y(Hierarc)m(hical)22
-b(Grouping)g(Con)m(v)m(en)m(tion)h(for)g(FITS")f(b)m(y)h(Jennings,)g(P)
-m(ence,)i(F)-8 b(olk)24 b(and)e(Sc)m(hlesinger)g(\()h(h)m(ttp:)37
-b(//ad-)0 3926 y(fwww.gsfc.nasa.go)m(v/other/con)m(v)m(ert/group.h)m
-(tml)27 b(\).)38 b(A)23 b(group)g(is)e(a)j(collection)e(of)h(HDUs)h
-(whose)e(asso)s(ciation)0 4039 y(is)33 b(de\014ned)f(b)m(y)h(a)h
-Fa(gr)-5 b(ouping)37 b(table)p Fj(.)50 b(HDUs)35 b(whic)m(h)d(are)i
-(part)f(of)h(a)g(group)f(are)h(referred)f(to)h(as)g Fa(memb)-5
-b(er)36 b(HDUs)0 4152 y Fj(or)i(simply)d(as)i Fa(memb)-5
-b(ers)p Fj(.)63 b(Grouping)37 b(table)g(mem)m(b)s(er)g(HDUs)h(ma)m(y)g
-(themselv)m(es)g(b)s(e)f(grouping)f(tables,)j(th)m(us)0
-4264 y(allo)m(wing)29 b(for)h(the)h(construction)f(of)g(op)s(en-ended)g
-(hierarc)m(hies)f(of)h(HDUs.)0 4425 y(Grouping)25 b(tables)i(con)m
-(tain)g(one)g(ro)m(w)g(for)f(eac)m(h)i(mem)m(b)s(er)e(HDU.)i(The)e
-(grouping)f(table)i(columns)e(pro)m(vide)h(iden-)0 4538
-y(ti\014cation)h(information)f(that)i(allo)m(ws)f(applications)e(to)j
-(reference)g(or)g("p)s(oin)m(t)f(to")h(the)g(mem)m(b)s(er)f(HDUs.)40
-b(Mem-)0 4650 y(b)s(er)27 b(HDUs)h(are)g(exp)s(ected,)h(but)e(not)h
-(required,)e(to)j(con)m(tain)f(a)g(set)g(of)g(GRPIDn/GRPLCn)f(k)m(eyw)m
-(ords)h(in)e(their)0 4763 y(headers)k(for)h(eac)m(h)g(grouping)f(table)
-g(that)h(they)g(are)g(referenced)g(b)m(y)-8 b(.)41 b(In)30
-b(this)g(sense,)h(the)g(GRPIDn/GRPLCn)0 4876 y(k)m(eyw)m(ords)d("link")
-e(the)i(mem)m(b)s(er)f(HDU)h(bac)m(k)g(to)g(its)f(Grouping)f(table.)40
-b(Note)29 b(that)f(a)f(mem)m(b)s(er)g(HDU)h(need)g(not)0
-4989 y(reside)h(in)g(the)h(same)g(FITS)f(\014le)h(as)g(its)f(grouping)g
-(table,)h(and)f(that)i(a)f(giv)m(en)g(HDU)h(ma)m(y)g(b)s(e)e
-(referenced)h(b)m(y)g(up)0 5102 y(to)h(999)h(grouping)d(tables)h(sim)m
-(ultaneously)-8 b(.)0 5262 y(Grouping)21 b(tables)i(are)g(implemen)m
-(ted)e(as)i(FITS)f(binary)f(tables)h(with)g(up)f(to)j(six)d
-(pre-de\014ned)h(column)f(TTYPEn)0 5375 y(v)-5 b(alues:)35
-b('MEMBER)p 752 5375 28 4 v 34 w(XTENSION',)20 b('MEMBER)p
-1789 5375 V 33 w(NAME',)h('MEMBER)p 2620 5375 V 34 w(VERSION',)f
-('MEMBER)p 3590 5375 V 34 w(POSITION',)0 5488 y('MEMBER)p
-451 5488 V 34 w(URI)p 653 5488 V 32 w(TYPE')g(and)g('MEMBER)p
-1601 5488 V 34 w(LOCA)-8 b(TION'.)20 b(The)f(\014rst)h(three)g(columns)
-f(allo)m(w)h(mem)m(b)s(er)g(HDUs)0 5601 y(to)28 b(b)s(e)f(iden)m
-(ti\014ed)e(b)m(y)i(reference)h(to)g(their)e(XTENSION,)h(EXTNAME)g(and)
-g(EXTVER)g(k)m(eyw)m(ord)g(v)-5 b(alues.)39 b(The)0 5714
-y(fourth)29 b(column)g(allo)m(ws)h(mem)m(b)s(er)f(HDUs)i(to)g(b)s(e)f
-(iden)m(ti\014ed)e(b)m(y)i(HDU)h(p)s(osition)d(within)g(their)h(FITS)h
-(\014le.)39 b(The)p eop
-%%Page: 90 96
-90 95 bop 0 299 a Fj(90)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fj(last)38 b(t)m(w)m(o)h(columns)d(iden)m(tify)g(the)i(FITS)f
-(\014le)g(in)f(whic)m(h)h(the)h(mem)m(b)s(er)f(HDU)h(resides,)h(if)d
-(di\013eren)m(t)i(from)f(the)0 668 y(grouping)29 b(table)h(FITS)g
-(\014le.)0 828 y(Additional)22 b(user)i(de\014ned)f("auxiliary")g
-(columns)g(ma)m(y)i(also)f(b)s(e)g(included)e(with)h(an)m(y)i(grouping)
-e(table.)38 b(When)25 b(a)0 941 y(grouping)h(table)i(is)f(copied)g(or)g
-(mo)s(di\014ed)f(the)i(presence)g(of)f(auxiliary)f(columns)g(is)h(alw)m
-(a)m(ys)h(tak)m(en)h(in)m(to)e(accoun)m(t)0 1054 y(b)m(y)k(the)g
-(grouping)f(supp)s(ort)g(functions;)g(ho)m(w)m(ev)m(er,)j(the)e
-(grouping)f(supp)s(ort)g(functions)f(cannot)j(directly)e(mak)m(e)0
-1167 y(use)g(of)h(this)e(data.)0 1327 y(If)44 b(a)h(grouping)e(table)h
-(column)f(is)h(de\014ned)f(but)h(the)g(corresp)s(onding)f(mem)m(b)s(er)
-g(HDU)j(information)c(is)i(un-)0 1440 y(a)m(v)-5 b(ailable)38
-b(then)f(a)i(n)m(ull)d(v)-5 b(alue)38 b(of)g(the)g(appropriate)g(data)g
-(t)m(yp)s(e)h(is)e(inserted)g(in)g(the)h(column)f(\014eld.)63
-b(In)m(teger)0 1553 y(columns)25 b(\(MEMBER)p 811 1553
-28 4 v 34 w(POSITION,)g(MEMBER)p 1771 1553 V 34 w(VERSION\))h(are)h
-(de\014ned)f(with)f(a)i(TNULLn)f(v)-5 b(alue)26 b(of)h(zero)0
-1666 y(\(0\).)41 b(Character)27 b(\014eld)e(columns)h(\(MEMBER)p
-1607 1666 V 34 w(XTENSION,)g(MEMBER)p 2600 1666 V 33
-w(NAME,)i(MEMBER)p 3388 1666 V 34 w(URI)p 3590 1666 V
-32 w(TYPE,)0 1779 y(MEMBER)p 426 1779 V 33 w(LOCA)-8
-b(TION\))30 b(utilize)f(an)h(ASCI)s(I)f(n)m(ull)f(c)m(haracter)k(to)f
-(denote)g(a)g(n)m(ull)d(\014eld)h(v)-5 b(alue.)0 1939
-y(The)23 b(grouping)f(supp)s(ort)g(functions)g(b)s(elong)h(to)h(t)m(w)m
-(o)h(basic)e(categories:)39 b(those)24 b(that)h(w)m(ork)e(with)g
-(grouping)f(table)0 2052 y(HDUs)k(\(\013gt**\))j(and)c(those)h(that)h
-(w)m(ork)f(with)e(mem)m(b)s(er)i(HDUs)g(\(\013gm**\).)41
-b(Tw)m(o)26 b(functions,)g(\014ts)p 3360 2052 V 32 w(cop)m(y)p
-3573 2052 V 34 w(group\(\))0 2165 y(and)40 b(\014ts)p
-314 2165 V 33 w(remo)m(v)m(e)p 626 2165 V 34 w(group\(\),)k(ha)m(v)m(e)
-e(the)f(option)f(to)i(recursiv)m(ely)d(cop)m(y/delete)k(en)m(tire)e
-(groups.)71 b(Care)41 b(should)0 2278 y(b)s(e)33 b(tak)m(en)h(when)f
-(emplo)m(ying)f(these)i(functions)e(in)g(recursiv)m(e)h(mo)s(de)g(as)g
-(p)s(o)s(orly)f(de\014ned)g(groups)h(could)f(cause)0
-2391 y(unpredictable)23 b(results.)38 b(The)25 b(problem)f(of)i(a)g
-(grouping)e(table)i(directly)e(or)i(indirectly)d(referencing)i(itself)f
-(\(th)m(us)0 2503 y(creating)40 b(an)g(in\014nite)d(lo)s(op\))j(is)e
-(protected)j(against;)k(in)38 b(fact,)44 b(neither)38
-b(function)h(will)e(attempt)k(to)f(cop)m(y)h(or)0 2616
-y(delete)31 b(an)f(HDU)h(t)m(wice.)0 2906 y Fi(1)81 b
-Fj(Create)34 b(\(app)s(end\))f(a)h(grouping)e(table)i(at)g(the)g(end)f
-(of)h(the)g(curren)m(t)f(FITS)g(\014le)g(p)s(oin)m(ted)g(to)h(b)m(y)g
-(fptr.)49 b(The)227 3019 y(grpname)28 b(parameter)h(pro)m(vides)f(the)h
-(grouping)e(table)h(name)h(\(GRPNAME)g(k)m(eyw)m(ord)g(v)-5
-b(alue\))28 b(and)g(ma)m(y)227 3132 y(b)s(e)42 b(set)h(to)g(NULL)f(if)f
-(no)h(group)g(name)g(is)g(to)h(b)s(e)e(sp)s(eci\014ed.)75
-b(The)42 b(groupt)m(yp)s(e)g(parameter)g(sp)s(eci\014es)227
-3245 y(the)c(desired)f(structure)g(of)h(the)g(grouping)e(table)i(and)f
-(ma)m(y)i(tak)m(e)g(on)f(the)g(v)-5 b(alues:)55 b(GT)p
-3355 3245 V 33 w(ID)p 3490 3245 V 33 w(ALL)p 3705 3245
-V 32 w(URI)227 3357 y(\(all)33 b(columns)f(created\),)k(GT)p
-1274 3357 V 33 w(ID)p 1409 3357 V 33 w(REF)d(\(ID)h(b)m(y)g(reference)g
-(columns\),)f(GT)p 2904 3357 V 33 w(ID)p 3039 3357 V
-33 w(POS)f(\(ID)i(b)m(y)g(p)s(osition)227 3470 y(columns\),)47
-b(GT)p 801 3470 V 32 w(ID)p 935 3470 V 33 w(ALL)d(\(ID)g(b)m(y)f
-(reference)i(and)e(p)s(osition)e(columns\),)47 b(GT)p
-3028 3470 V 32 w(ID)p 3162 3470 V 33 w(REF)p 3383 3470
-V 33 w(URI)d(\(ID)g(b)m(y)227 3583 y(reference)35 b(and)e(FITS)g
-(\014le)h(URI)f(columns\),)i(and)e(GT)p 2129 3583 V 33
-w(ID)p 2264 3583 V 33 w(POS)p 2481 3583 V 32 w(URI)h(\(ID)g(b)m(y)g(p)s
-(osition)e(and)i(FITS)f(\014le)227 3696 y(URI)e(columns\).)95
-3986 y Ff(int)47 b(fits_create_group)c(/)48 b(ffgtcr)286
-4099 y(\(fitsfile)e(*fptr,)g(char)g(*grpname,)g(int)h(grouptype,)e(>)i
-(int)g(*status\))0 4388 y Fi(2)81 b Fj(Create)26 b(\(insert\))f(a)g
-(grouping)f(table)h(just)g(after)h(the)f(CHDU)h(of)g(the)f(curren)m(t)g
-(FITS)g(\014le)f(p)s(oin)m(ted)g(to)i(b)m(y)g(fptr.)227
-4501 y(All)i(HDUs)h(b)s(elo)m(w)f(the)h(the)g(insertion)e(p)s(oin)m(t)g
-(will)g(b)s(e)h(shifted)f(do)m(wn)m(w)m(ards)h(to)i(mak)m(e)g(ro)s(om)e
-(for)g(the)h(new)227 4614 y(HDU.)23 b(The)e(grpname)h(parameter)g(pro)m
-(vides)e(the)i(grouping)f(table)g(name)h(\(GRPNAME)h(k)m(eyw)m(ord)f(v)
--5 b(alue\))227 4727 y(and)25 b(ma)m(y)i(b)s(e)e(set)h(to)h(NULL)e(if)g
-(no)h(group)f(name)h(is)f(to)h(b)s(e)f(sp)s(eci\014ed.)38
-b(The)25 b(groupt)m(yp)s(e)h(parameter)g(sp)s(eci-)227
-4840 y(\014es)g(the)h(desired)e(structure)h(of)h(the)f(grouping)f
-(table)i(and)f(ma)m(y)h(tak)m(e)h(on)e(the)h(v)-5 b(alues:)38
-b(GT)p 3355 4840 V 33 w(ID)p 3490 4840 V 33 w(ALL)p 3705
-4840 V 32 w(URI)227 4953 y(\(all)33 b(columns)f(created\),)k(GT)p
-1274 4953 V 33 w(ID)p 1409 4953 V 33 w(REF)d(\(ID)h(b)m(y)g(reference)g
-(columns\),)f(GT)p 2904 4953 V 33 w(ID)p 3039 4953 V
-33 w(POS)f(\(ID)i(b)m(y)g(p)s(osition)227 5065 y(columns\),)28
-b(GT)p 782 5065 V 33 w(ID)p 917 5065 V 33 w(ALL)g(\(ID)g(b)m(y)g
-(reference)h(and)e(p)s(osition)f(columns\),)i(GT)p 2897
-5065 V 33 w(ID)p 3032 5065 V 33 w(REF)p 3253 5065 V 32
-w(URI)g(\(ID)h(b)m(y)f(ref-)227 5178 y(erence)g(and)e(FITS)h(\014le)f
-(URI)h(columns\),)g(and)f(GT)p 1976 5178 V 33 w(ID)p
-2111 5178 V 33 w(POS)p 2328 5178 V 32 w(URI)h(\(ID)g(b)m(y)g(p)s
-(osition)e(and)i(FITS)f(\014le)g(URI)227 5291 y(columns\))k(.)95
-5581 y Ff(int)47 b(fits_insert_group)c(/)48 b(ffgtis)286
-5694 y(\(fitsfile)e(*fptr,)g(char)g(*grpname,)g(int)h(grouptype,)e(>)i
-(int)g(*status\))p eop
-%%Page: 91 97
-91 96 bop 0 299 a Fh(7.9.)72 b(HIERAR)m(CHICAL)30 b(GR)m(OUPING)h
-(CONVENTION)f(SUPPOR)-8 b(T)29 b(R)m(OUTINES)686 b Fj(91)0
-555 y Fi(3)81 b Fj(Change)20 b(the)h(structure)f(of)h(an)g(existing)e
-(grouping)h(table)g(p)s(oin)m(ted)g(to)h(b)m(y)g(gfptr.)37
-b(The)20 b(groupt)m(yp)s(e)g(parameter)227 668 y(\(see)27
-b(\014ts)p 532 668 28 4 v 32 w(create)p 800 668 V 35
-w(group\(\))e(for)h(v)-5 b(alid)24 b(parameter)i(v)-5
-b(alues\))25 b(sp)s(eci\014es)g(the)g(new)g(structure)h(of)f(the)h
-(grouping)227 781 y(table.)43 b(This)29 b(function)h(only)g(adds)h(or)g
-(remo)m(v)m(es)h(grouping)e(table)h(columns,)f(it)h(do)s(es)g(not)g
-(add)g(or)g(delete)227 894 y(group)26 b(mem)m(b)s(ers)f(\(i.e.,)j
-(table)e(ro)m(ws\).)40 b(If)26 b(the)g(grouping)f(table)h(already)g
-(has)g(the)h(desired)d(structure)i(then)227 1007 y(no)35
-b(op)s(erations)e(are)i(p)s(erformed)e(and)h(function)f(simply)g
-(returns)g(with)g(a)i(\(0\))g(success)g(status)g(co)s(de.)53
-b(If)227 1120 y(the)32 b(requested)g(structure)g(c)m(hange)h(creates)g
-(new)f(grouping)f(table)h(columns,)f(then)h(the)g(column)f(v)-5
-b(alues)227 1233 y(for)30 b(all)g(existing)f(mem)m(b)s(ers)h(will)d(b)s
-(e)j(\014lled)e(with)h(the)i(n)m(ull)d(v)-5 b(alues)30
-b(appropriate)f(to)i(the)g(column)e(t)m(yp)s(e.)95 1470
-y Ff(int)47 b(fits_change_group)c(/)48 b(ffgtch)286 1582
-y(\(fitsfile)e(*gfptr,)f(int)i(grouptype,)e(>)j(int)f(*status\))0
-1819 y Fi(4)81 b Fj(Remo)m(v)m(e)41 b(the)e(group)g(de\014ned)f(b)m(y)h
-(the)h(grouping)e(table)h(p)s(oin)m(ted)f(to)i(b)m(y)g(gfptr,)h(and)e
-(optionally)f(all)g(the)227 1932 y(group)29 b(mem)m(b)s(er)f(HDUs.)41
-b(The)28 b(rmopt)h(parameter)g(sp)s(eci\014es)f(the)h(action)g(to)h(b)s
-(e)e(tak)m(en)i(for)f(all)f(mem)m(b)s(ers)227 2045 y(of)f(the)g(group)g
-(de\014ned)e(b)m(y)i(the)g(grouping)f(table.)39 b(V)-8
-b(alid)26 b(v)-5 b(alues)26 b(are:)40 b(OPT)p 2848 2045
-V 32 w(RM)p 3030 2045 V 33 w(GPT)26 b(\(delete)i(only)e(the)227
-2158 y(grouping)32 b(table\))i(and)f(OPT)p 1259 2158
-V 32 w(RM)p 1441 2158 V 33 w(ALL)g(\(recursiv)m(ely)f(delete)i(all)e
-(HDUs)i(that)g(b)s(elong)e(to)i(the)g(group\).)227 2271
-y(An)m(y)d(groups)g(con)m(taining)g(the)g(grouping)f(table)h(gfptr)f
-(as)i(a)f(mem)m(b)s(er)g(are)g(up)s(dated,)f(and)h(if)f(rmopt)h(==)227
-2384 y(OPT)p 431 2384 V 32 w(RM)p 613 2384 V 33 w(GPT)21
-b(all)f(mem)m(b)s(ers)h(ha)m(v)m(e)h(their)e(GRPIDn)h(and)g(GRPLCn)f(k)
-m(eyw)m(ords)h(up)s(dated)f(accordingly)-8 b(.)227 2497
-y(If)36 b(rmopt)g(==)g(OPT)p 985 2497 V 32 w(RM)p 1167
-2497 V 33 w(ALL,)g(then)g(other)h(groups)e(that)i(con)m(tain)g(the)f
-(deleted)g(mem)m(b)s(ers)g(of)g(gfptr)227 2610 y(are)31
-b(up)s(dated)e(to)i(re\015ect)g(the)g(deletion)e(accordingly)-8
-b(.)95 2847 y Ff(int)47 b(fits_remove_group)c(/)48 b(ffgtrm)286
-2960 y(\(fitsfile)e(*gfptr,)f(int)i(rmopt,)f(>)i(int)f(*status\))0
-3197 y Fi(5)81 b Fj(Cop)m(y)28 b(\(app)s(end\))g(the)h(group)f
-(de\014ned)g(b)m(y)h(the)f(grouping)g(table)h(p)s(oin)m(ted)e(to)j(b)m
-(y)e(infptr,)g(and)g(optionally)f(all)227 3309 y(group)j(mem)m(b)s(er)h
-(HDUs,)g(to)h(the)f(FITS)f(\014le)f(p)s(oin)m(ted)h(to)i(b)m(y)e
-(outfptr.)41 b(The)31 b(cp)s(opt)f(parameter)h(sp)s(eci\014es)227
-3422 y(the)c(action)g(to)g(b)s(e)f(tak)m(en)h(for)g(all)e(mem)m(b)s
-(ers)h(of)g(the)h(group)f(infptr.)37 b(V)-8 b(alid)26
-b(v)-5 b(alues)25 b(are:)40 b(OPT)p 3443 3422 V 32 w(GCP)p
-3674 3422 V 32 w(GPT)227 3535 y(\(cop)m(y)d(only)f(the)g(grouping)f
-(table\))h(and)f(OPT)p 1887 3535 V 32 w(GCP)p 2118 3535
-V 33 w(ALL)h(\(recursiv)m(ely)f(cop)m(y)i(ALL)e(the)i(HDUs)f(that)227
-3648 y(b)s(elong)23 b(to)h(the)g(group)f(de\014ned)g(b)m(y)g(infptr\).)
-37 b(If)23 b(the)h(cp)s(opt)g(==)f(OPT)p 2618 3648 V
-32 w(GCP)p 2849 3648 V 32 w(GPT)h(then)f(the)h(mem)m(b)s(ers)f(of)227
-3761 y(infptr)h(ha)m(v)m(e)i(their)f(GRPIDn)g(and)g(GRPLCn)g(k)m(eyw)m
-(ords)h(up)s(dated)e(to)i(re\015ect)g(the)g(existence)g(of)g(the)f(new)
-227 3874 y(grouping)e(table)g(outfptr,)i(since)e(they)h(no)m(w)g(b)s
-(elong)f(to)h(the)g(new)g(group.)38 b(If)23 b(cp)s(opt)h(==)f(OPT)p
-3460 3874 V 32 w(GCP)p 3691 3874 V 32 w(ALL)227 3987
-y(then)29 b(the)g(new)g(grouping)f(table)h(outfptr)f(only)g(con)m
-(tains)i(p)s(oin)m(ters)e(to)i(the)f(copied)f(mem)m(b)s(er)h(HDUs)h
-(and)227 4100 y(not)38 b(the)g(original)d(mem)m(b)s(er)i(HDUs)h(of)g
-(infptr.)60 b(Note)39 b(that,)h(when)d(cp)s(opt)g(==)g(OPT)p
-3301 4100 V 32 w(GCP)p 3532 4100 V 33 w(ALL,)g(all)227
-4213 y(mem)m(b)s(ers)h(of)h(the)f(group)g(de\014ned)f(b)m(y)i(infptr)d
-(will)g(b)s(e)h(copied)h(to)h(a)g(single)e(FITS)h(\014le)g(p)s(oin)m
-(ted)f(to)i(b)m(y)227 4326 y(outfptr)30 b(regardless)g(of)g(their)g
-(\014le)f(distribution)e(in)i(the)i(original)d(group.)95
-4563 y Ff(int)47 b(fits_copy_group)d(/)j(ffgtcp)286 4675
-y(\(fitsfile)f(*infptr,)f(fitsfile)h(*outfptr,)f(int)i(cpopt,)f(>)h
-(int)g(*status\))0 4912 y Fi(6)81 b Fj(Merge)40 b(the)f(t)m(w)m(o)h
-(groups)e(de\014ned)g(b)m(y)h(the)g(grouping)f(table)g(HDUs)i(infptr)d
-(and)h(outfptr)h(b)m(y)f(com)m(bining)227 5025 y(their)29
-b(mem)m(b)s(ers)g(in)m(to)h(a)g(single)e(grouping)g(table.)41
-b(All)28 b(mem)m(b)s(er)h(HDUs)h(\(ro)m(ws\))h(are)f(copied)f(from)g
-(infptr)227 5138 y(to)f(outfptr.)39 b(If)26 b(mgopt)i(==)e(OPT)p
-1419 5138 V 32 w(MR)m(G)p 1669 5138 V 34 w(COPY)g(then)g(infptr)f(con)m
-(tin)m(ues)i(to)h(exist)f(unaltered)e(after)j(the)227
-5251 y(merge.)57 b(If)36 b(the)f(mgopt)i(==)e(OPT)p 1474
-5251 V 31 w(MR)m(G)p 1723 5251 V 34 w(MO)m(V)i(then)e(infptr)e(is)i
-(deleted)h(after)g(the)g(merge.)57 b(In)35 b(b)s(oth)227
-5364 y(cases,)d(the)e(GRPIDn)h(and)e(GRPLCn)h(k)m(eyw)m(ords)g(of)h
-(the)g(mem)m(b)s(er)e(HDUs)i(are)g(up)s(dated)e(accordingly)-8
-b(.)95 5601 y Ff(int)47 b(fits_merge_groups)c(/)48 b(ffgtmg)286
-5714 y(\(fitsfile)e(*infptr,)f(fitsfile)h(*outfptr,)f(int)i(mgopt,)f(>)
-h(int)g(*status\))p eop
-%%Page: 92 98
-92 97 bop 0 299 a Fj(92)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(7)81 b Fj("Compact")24 b(the)f(group)g(de\014ned)f(b)m(y)h
-(grouping)e(table)i(p)s(oin)m(ted)f(to)i(b)m(y)f(gfptr.)38
-b(The)23 b(compaction)g(is)f(ac)m(hiev)m(ed)227 668 y(b)m(y)37
-b(merging)g(\(via)g(\014ts)p 1034 668 28 4 v 32 w(merge)p
-1303 668 V 34 w(groups\(\)\))g(all)f(direct)h(mem)m(b)s(er)g(HDUs)g(of)
-h(gfptr)e(that)i(are)g(themselv)m(es)227 781 y(grouping)h(tables.)69
-b(The)40 b(cmopt)g(parameter)h(de\014nes)e(whether)g(the)i(merged)f
-(grouping)e(table)i(HDUs)227 894 y(remain)j(after)i(merging)e(\(cmopt)i
-(==)f(OPT)p 1852 894 V 32 w(CMT)p 2099 894 V 32 w(MBR\))h(or)f(if)f
-(they)i(are)f(deleted)g(after)h(merging)227 1007 y(\(cmopt)31
-b(==)f(OPT)p 916 1007 V 32 w(CMT)p 1163 1007 V 32 w(MBR)p
-1409 1007 V 34 w(DEL\).)g(If)g(the)h(grouping)d(table)j(con)m(tains)f
-(no)g(direct)g(mem)m(b)s(er)f(HDUs)227 1120 y(that)i(are)f(themselv)m
-(es)g(grouping)e(tables)i(then)f(this)g(function)f(do)s(es)i(nothing.)
-39 b(Note)31 b(that)g(this)d(function)227 1233 y(is)i(not)g(recursiv)m
-(e,)g(i.e.,)h(only)f(the)g(direct)g(mem)m(b)s(er)g(HDUs)h(of)f(gfptr)g
-(are)h(considered)e(for)h(merging.)95 1481 y Ff(int)47
-b(fits_compact_group)c(/)48 b(ffgtcm)286 1594 y(\(fitsfile)e(*gfptr,)f
-(int)i(cmopt,)f(>)i(int)f(*status\))0 1842 y Fi(8)81
-b Fj(V)-8 b(erify)20 b(the)i(in)m(tegrit)m(y)f(of)g(the)g(grouping)f
-(table)h(p)s(oin)m(ted)f(to)i(b)m(y)f(gfptr)g(to)h(mak)m(e)g(sure)e
-(that)i(all)e(group)h(mem)m(b)s(ers)227 1954 y(are)31
-b(accessible)g(and)f(that)h(all)e(links)g(to)i(other)g(grouping)e
-(tables)i(are)g(v)-5 b(alid.)40 b(The)30 b(\014rstfailed)e(parameter)
-227 2067 y(returns)e(the)i(mem)m(b)s(er)e(ID)h(\(ro)m(w)h(n)m(um)m(b)s
-(er\))e(of)i(the)f(\014rst)f(mem)m(b)s(er)h(HDU)h(to)g(fail)e(v)m
-(eri\014cation)g(\(if)h(p)s(ositiv)m(e)227 2180 y(v)-5
-b(alue\))35 b(or)f(the)h(\014rst)e(group)h(link)e(to)k(fail)d(\(if)g
-(negativ)m(e)j(v)-5 b(alue\).)53 b(If)34 b(gfptr)g(is)f(successfully)g
-(v)m(eri\014ed)g(then)227 2293 y(\014rstfailed)c(con)m(tains)h(a)h
-(return)e(v)-5 b(alue)30 b(of)h(0.)95 2541 y Ff(int)47
-b(fits_verify_group)c(/)48 b(ffgtvf)286 2654 y(\(fitsfile)e(*gfptr,)f
-(>)j(long)f(*firstfailed,)d(int)j(*status\))0 2902 y
-Fi(9)81 b Fj(Op)s(en)23 b(a)j(grouping)e(table)h(that)h(con)m(tains)f
-(the)h(mem)m(b)s(er)e(HDU)i(p)s(oin)m(ted)e(to)i(b)m(y)f(mfptr.)38
-b(The)25 b(grouping)f(table)227 3015 y(to)39 b(op)s(en)e(is)g
-(de\014ned)g(b)m(y)h(the)g(grpid)e(parameter,)k(whic)m(h)d(con)m(tains)
-h(the)g(k)m(eyw)m(ord)h(index)d(v)-5 b(alue)38 b(of)g(the)227
-3128 y(GRPIDn/GRPLCn)d(k)m(eyw)m(ord\(s\))g(that)h(link)d(the)i(mem)m
-(b)s(er)f(HDU)h(mfptr)f(to)i(the)f(grouping)e(table.)54
-b(If)227 3241 y(the)30 b(grouping)e(table)h(resides)f(in)h(a)g(\014le)g
-(other)g(than)h(the)f(mem)m(b)s(er)g(HDUs)h(\014le)e(then)h(an)h
-(attempt)g(is)f(\014rst)227 3354 y(made)g(to)h(op)s(en)e(the)h(\014le)f
-(readwrite,)h(and)f(failing)f(that)j(readonly)-8 b(.)39
-b(A)29 b(p)s(oin)m(ter)f(to)i(the)f(op)s(ened)f(grouping)227
-3467 y(table)j(HDU)g(is)e(returned)g(in)g(gfptr.)227
-3615 y(Note)35 b(that)g(it)e(is)g(p)s(ossible,)f(although)i(unlik)m
-(ely)d(and)i(undesirable,)f(for)i(the)g(GRPIDn/GRPLCn)f(k)m(ey-)227
-3728 y(w)m(ords)k(in)f(a)h(mem)m(b)s(er)g(HDU)h(header)f(to)h(b)s(e)e
-(non-con)m(tin)m(uous,)j(e.g.,)h(GRPID1,)g(GRPID2,)g(GRPID5,)227
-3841 y(GRPID6.)i(In)29 b(suc)m(h)g(cases,)i(the)f(grpid)e(index)g(v)-5
-b(alue)30 b(sp)s(eci\014ed)e(in)g(the)i(function)e(call)i(shall)e(iden)
-m(tify)g(the)227 3954 y(\(grpid\)th)35 b(GRPID)g(v)-5
-b(alue.)56 b(In)34 b(the)i(ab)s(o)m(v)m(e)h(example,)f(if)f(grpid)e(==)
-i(3,)j(then)d(the)g(group)g(sp)s(eci\014ed)f(b)m(y)227
-4067 y(GRPID5)d(w)m(ould)f(b)s(e)f(op)s(ened.)95 4315
-y Ff(int)47 b(fits_open_group)d(/)j(ffgtop)286 4428 y(\(fitsfile)f
-(*mfptr,)f(int)i(group,)f(>)i(fitsfile)d(**gfptr,)h(int)h(*status\))0
-4676 y Fi(10)f Fj(Add)38 b(a)h(mem)m(b)s(er)f(HDU)i(to)f(an)g(existing)
-e(grouping)h(table)h(p)s(oin)m(ted)e(to)j(b)m(y)e(gfptr.)66
-b(The)38 b(mem)m(b)s(er)g(HDU)227 4788 y(ma)m(y)30 b(either)f(b)s(e)g
-(p)s(oin)m(ted)f(to)i(mfptr)f(\(whic)m(h)f(m)m(ust)i(b)s(e)e(p)s
-(ositioned)g(to)i(the)f(mem)m(b)s(er)g(HDU\))i(or,)f(if)e(mfptr)227
-4901 y(==)36 b(NULL,)g(iden)m(ti\014ed)e(b)m(y)i(the)g(hdup)s(os)e
-(parameter)i(\(the)h(HDU)g(p)s(osition)d(n)m(um)m(b)s(er,)i(Primary)e
-(arra)m(y)227 5014 y(==)g(1\))i(if)e(b)s(oth)g(the)h(grouping)f(table)g
-(and)h(the)g(mem)m(b)s(er)f(HDU)h(reside)f(in)g(the)h(same)g(FITS)f
-(\014le.)53 b(The)227 5127 y(new)27 b(mem)m(b)s(er)f(HDU)h(shall)e(ha)m
-(v)m(e)j(the)f(appropriate)f(GRPIDn)g(and)g(GRPLCn)g(k)m(eyw)m(ords)h
-(created)h(in)e(its)227 5240 y(header.)44 b(Note)33 b(that)f(if)f(the)h
-(mem)m(b)s(er)e(HDU)j(is)d(already)h(a)h(mem)m(b)s(er)f(of)h(the)g
-(group)f(then)g(it)g(will)e(not)j(b)s(e)227 5353 y(added)e(a)h(second)f
-(time.)95 5601 y Ff(int)47 b(fits_add_group_member)42
-b(/)48 b(ffgtam)286 5714 y(\(fitsfile)e(*gfptr,)f(fitsfile)h(*mfptr,)g
-(int)h(hdupos,)f(>)h(int)g(*status\))p eop
-%%Page: 93 99
-93 98 bop 0 299 a Fh(7.9.)72 b(HIERAR)m(CHICAL)30 b(GR)m(OUPING)h
-(CONVENTION)f(SUPPOR)-8 b(T)29 b(R)m(OUTINES)686 b Fj(93)0
-555 y Fi(11)46 b Fj(Return)28 b(the)h(n)m(um)m(b)s(er)f(of)h(mem)m(b)s
-(er)g(HDUs)g(in)f(a)h(grouping)f(table)h(gfptr.)40 b(The)28
-b(n)m(um)m(b)s(er)g(mem)m(b)s(er)g(HDUs)i(is)227 668
-y(just)g(the)h(NAXIS2)f(v)-5 b(alue)30 b(\(n)m(um)m(b)s(er)g(of)g(ro)m
-(ws\))h(of)f(the)h(grouping)e(table.)95 903 y Ff(int)47
-b(fits_get_num_members)c(/)k(ffgtnm)286 1015 y(\(fitsfile)f(*gfptr,)f
-(>)j(long)f(*nmembers,)e(int)h(*status\))0 1250 y Fi(12)g
-Fj(Return)33 b(the)i(n)m(um)m(b)s(er)e(of)h(groups)f(to)i(whic)m(h)e
-(the)i(HDU)g(p)s(oin)m(ted)e(to)i(b)m(y)f(mfptr)f(is)g(link)m(ed,)h(as)
-g(de\014ned)f(b)m(y)227 1363 y(the)27 b(n)m(um)m(b)s(er)f(of)h
-(GRPIDn/GRPLCn)f(k)m(eyw)m(ord)i(records)e(that)i(app)s(ear)e(in)f(its)
-i(header.)39 b(Note)28 b(that)g(eac)m(h)227 1476 y(time)36
-b(this)g(function)f(is)g(called,)j(the)e(indices)f(of)i(the)f
-(GRPIDn/GRPLCn)g(k)m(eyw)m(ords)h(are)g(c)m(hec)m(k)m(ed)h(to)227
-1589 y(mak)m(e)29 b(sure)e(they)g(are)h(con)m(tin)m(uous)f(\(ie)h(no)f
-(gaps\))h(and)f(are)h(re-en)m(umerated)g(to)h(eliminate)d(gaps)i(if)e
-(found.)95 1936 y Ff(int)47 b(fits_get_num_groups)c(/)k(ffgmng)286
-2049 y(\(fitsfile)f(*mfptr,)f(>)j(long)f(*nmembers,)e(int)h(*status\))0
-2283 y Fi(13)g Fj(Op)s(en)25 b(a)i(mem)m(b)s(er)f(of)h(the)g(grouping)e
-(table)h(p)s(oin)m(ted)g(to)h(b)m(y)f(gfptr.)40 b(The)26
-b(mem)m(b)s(er)g(to)h(op)s(en)f(is)f(iden)m(ti\014ed)g(b)m(y)227
-2396 y(its)k(ro)m(w)h(n)m(um)m(b)s(er)e(within)f(the)i(grouping)g
-(table)g(as)h(giv)m(en)f(b)m(y)h(the)f(parameter)h('mem)m(b)s(er')f
-(\(\014rst)h(mem)m(b)s(er)227 2509 y(==)g(1\))g(.)41
-b(A)30 b(\014ts\014le)e(p)s(oin)m(ter)h(to)i(the)f(op)s(ened)f(mem)m(b)
-s(er)g(HDU)i(is)e(returned)g(as)h(mfptr.)39 b(Note)31
-b(that)g(if)e(the)227 2622 y(mem)m(b)s(er)f(HDU)h(resides)f(in)f(a)i
-(FITS)f(\014le)f(di\013eren)m(t)h(from)g(the)h(grouping)e(table)h(HDU)i
-(then)e(the)h(mem)m(b)s(er)227 2735 y(\014le)h(is)f(\014rst)h(op)s
-(ened)f(readwrite)h(and,)g(failing)e(this,)i(op)s(ened)f(readonly)-8
-b(.)95 2969 y Ff(int)47 b(fits_open_member)d(/)j(ffgmop)286
-3082 y(\(fitsfile)f(*gfptr,)f(long)i(member,)f(>)h(fitsfile)f(**mfptr,)
-f(int)i(*status\))0 3317 y Fi(14)f Fj(Cop)m(y)32 b(\(app)s(end\))f(a)h
-(mem)m(b)s(er)g(HDU)g(of)g(the)h(grouping)d(table)i(p)s(oin)m(ted)f(to)
-i(b)m(y)e(gfptr.)45 b(The)32 b(mem)m(b)s(er)f(HDU)227
-3430 y(is)26 b(iden)m(ti\014ed)f(b)m(y)h(its)h(ro)m(w)f(n)m(um)m(b)s
-(er)g(within)e(the)j(grouping)e(table)i(as)g(giv)m(en)f(b)m(y)h(the)g
-(parameter)g('mem)m(b)s(er')227 3543 y(\(\014rst)36 b(mem)m(b)s(er)f
-(==)g(1\).)58 b(The)35 b(cop)m(y)i(of)f(the)g(group)f(mem)m(b)s(er)g
-(HDU)i(will)c(b)s(e)i(app)s(ended)f(to)j(the)f(FITS)227
-3656 y(\014le)28 b(p)s(oin)m(ted)g(to)h(b)m(y)f(mfptr,)h(and)f(up)s(on)
-f(return)g(mfptr)h(shall)f(p)s(oin)m(t)g(to)j(the)f(copied)f(mem)m(b)s
-(er)g(HDU.)h(The)227 3768 y(cp)s(opt)e(parameter)h(ma)m(y)g(tak)m(e)h
-(on)e(the)g(follo)m(wing)f(v)-5 b(alues:)39 b(OPT)p 2465
-3768 28 4 v 32 w(MCP)p 2708 3768 V 32 w(ADD)29 b(whic)m(h)d(adds)g(a)i
-(new)f(en)m(try)227 3881 y(in)c(gfptr)h(for)f(the)i(copied)e(mem)m(b)s
-(er)h(HDU,)h(OPT)p 1907 3881 V 31 w(MCP)p 2149 3881 V
-33 w(NADD)g(whic)m(h)e(do)s(es)h(not)g(add)f(an)h(en)m(try)h(in)d
-(gfptr)227 3994 y(for)j(the)h(copied)e(mem)m(b)s(er,)i(and)f(OPT)p
-1536 3994 V 32 w(MCP)p 1779 3994 V 32 w(REPL)g(whic)m(h)f(replaces)h
-(the)g(original)e(mem)m(b)s(er)i(en)m(try)g(with)227
-4107 y(the)31 b(copied)f(mem)m(b)s(er)f(en)m(try)-8 b(.)95
-4342 y Ff(int)47 b(fits_copy_member)d(/)j(ffgmcp)286
-4455 y(\(fitsfile)f(*gfptr,)f(fitsfile)h(*mfptr,)g(long)g(member,)g
-(int)h(cpopt,)f(>)i(int)f(*status\))0 4689 y Fi(15)f
-Fj(T)-8 b(ransfer)33 b(a)i(group)f(mem)m(b)s(er)f(HDU)i(from)f(the)g
-(grouping)f(table)h(p)s(oin)m(ted)f(to)i(b)m(y)f(infptr)e(to)j(the)f
-(grouping)227 4802 y(table)i(p)s(oin)m(ted)f(to)i(b)m(y)f(outfptr.)58
-b(The)35 b(mem)m(b)s(er)h(HDU)h(to)f(transfer)g(is)f(iden)m(ti\014ed)f
-(b)m(y)i(its)g(ro)m(w)g(n)m(um)m(b)s(er)227 4915 y(within)k(infptr)g
-(as)j(sp)s(eci\014ed)e(b)m(y)h(the)h(parameter)g('mem)m(b)s(er')f
-(\(\014rst)g(mem)m(b)s(er)g(==)f(1\).)78 b(If)42 b(tfopt)h(==)227
-5028 y(OPT)p 431 5028 V 32 w(MCP)p 674 5028 V 33 w(ADD)26
-b(then)f(the)h(mem)m(b)s(er)e(HDU)i(is)f(made)g(a)h(mem)m(b)s(er)f(of)g
-(outfptr)g(and)g(remains)f(a)i(mem)m(b)s(er)227 5141
-y(of)34 b(infptr.)50 b(If)34 b(tfopt)g(==)g(OPT)p 1339
-5141 V 32 w(MCP)p 1582 5141 V 32 w(MO)m(V)h(then)f(the)g(mem)m(b)s(er)f
-(HDU)i(is)e(deleted)h(from)f(infptr)f(after)227 5254
-y(the)f(transfer)f(to)h(outfptr.)95 5488 y Ff(int)47
-b(fits_transfer_member)c(/)k(ffgmtf)286 5601 y(\(fitsfile)f(*infptr,)f
-(fitsfile)h(*outfptr,)f(long)i(member,)e(int)i(tfopt,)334
-5714 y(>)h(int)e(*status\))p eop
-%%Page: 94 100
-94 99 bop 0 299 a Fj(94)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(16)46 b Fj(Remo)m(v)m(e)30 b(a)f(mem)m(b)s(er)e(HDU)i(from)f
-(the)g(grouping)f(table)h(p)s(oin)m(ted)g(to)h(b)m(y)f(gfptr.)39
-b(The)28 b(mem)m(b)s(er)g(HDU)h(to)g(b)s(e)227 668 y(deleted)36
-b(is)e(iden)m(ti\014ed)g(b)m(y)h(its)g(ro)m(w)h(n)m(um)m(b)s(er)f(in)f
-(the)i(grouping)e(table)h(as)h(sp)s(eci\014ed)e(b)m(y)i(the)f
-(parameter)227 781 y('mem)m(b)s(er')41 b(\(\014rst)g(mem)m(b)s(er)g(==)
-f(1\).)74 b(The)41 b(rmopt)g(parameter)h(ma)m(y)f(tak)m(e)i(on)e(the)h
-(follo)m(wing)d(v)-5 b(alues:)227 894 y(OPT)p 431 894
-28 4 v 32 w(RM)p 613 894 V 33 w(ENTR)d(Y)34 b(whic)m(h)d(remo)m(v)m(es)
-k(the)e(mem)m(b)s(er)g(HDU)h(en)m(try)f(from)g(the)g(grouping)f(table)h
-(and)g(up-)227 1007 y(dates)40 b(the)f(mem)m(b)s(er's)f(GRPIDn/GRPLCn)g
-(k)m(eyw)m(ords,)k(and)c(OPT)p 2687 1007 V 32 w(RM)p
-2869 1007 V 33 w(MBR)h(whic)m(h)f(remo)m(v)m(es)i(the)227
-1120 y(mem)m(b)s(er)30 b(HDU)h(en)m(try)g(from)f(the)g(grouping)f
-(table)i(and)e(deletes)i(the)f(mem)m(b)s(er)g(HDU)h(itself.)95
-1381 y Ff(int)47 b(fits_remove_member)c(/)48 b(ffgmrm)286
-1494 y(\(fitsfile)e(*fptr,)g(long)g(member,)g(int)h(rmopt,)f(>)i(int)f
-(*status\))0 1829 y Fe(7.10)136 b(Ro)l(w)45 b(Selection)h(and)f
-(Calculator)i(Routines)0 2080 y Fj(These)21 b(routines)e(all)h(parse)h
-(and)f(ev)-5 b(aluate)22 b(an)e(input)f(string)h(con)m(taining)h(a)g
-(user)f(de\014ned)g(arithmetic)g(expression.)0 2192 y(The)29
-b(\014rst)f(3)i(routines)e(select)i(ro)m(ws)f(in)f(a)i(FITS)e(table,)i
-(based)f(on)g(whether)g(the)g(expression)f(ev)-5 b(aluates)30
-b(to)g(true)0 2305 y(\(not)e(equal)e(to)i(zero\))g(or)f(false)g
-(\(zero\).)41 b(The)27 b(other)g(routines)f(ev)-5 b(aluate)28
-b(the)f(expression)f(and)g(calculate)i(a)f(v)-5 b(alue)0
-2418 y(for)26 b(eac)m(h)i(ro)m(w)f(of)g(the)g(table.)39
-b(The)26 b(allo)m(w)m(ed)h(expression)e(syn)m(tax)j(is)d(describ)s(ed)g
-(in)g(the)i(ro)m(w)g(\014lter)f(section)g(in)g(the)0
-2531 y(earlier)k(`Extended)h(File)f(Name)i(Syn)m(tax')g(c)m(hapter)g
-(of)f(this)f(do)s(cumen)m(t.)43 b(See)32 b(App)s(endix)c(B)k(for)f(the)
-g(de\014nition)0 2644 y(of)g(the)f(parameters)h(used)e(in)g(these)i
-(routines.)0 2905 y Fi(1)81 b Fj(Ev)-5 b(aluate)37 b(a)g(b)s(o)s(olean)
-f(expression)g(o)m(v)m(er)i(the)g(indicated)d(ro)m(ws,)k(returning)c
-(an)i(arra)m(y)h(of)f(\015ags)g(indicating)227 3018 y(whic)m(h)29
-b(ro)m(ws)i(ev)-5 b(aluated)30 b(to)h(TR)m(UE/F)-10 b(ALSE)95
-3279 y Ff(int)47 b(fits_find_rows)d(/)k(fffrow)286 3392
-y(\(fitsfile)e(*fptr,)93 b(char)47 b(*expr,)f(long)h(firstrow,)e(long)i
-(nrows,)286 3505 y(>)h(long)e(*n_good_rows,)f(char)h(*row_status,)92
-b(int)47 b(*status\))0 3766 y Fi(2)81 b Fj(Find)28 b(the)j(\014rst)f
-(ro)m(w)g(whic)m(h)f(satis\014es)h(the)h(input)d(b)s(o)s(olean)h
-(expression)95 4027 y Ff(int)47 b(fits_find_first_row)c(/)k(ffffrw)286
-4140 y(\(fitsfile)f(*fptr,)93 b(char)47 b(*expr,)f(>)i(long)e(*rownum,)
-g(int)h(*status\))0 4401 y Fi(3)81 b Fj(Ev)-5 b(aluate)34
-b(an)g(expression)g(on)g(all)f(ro)m(ws)i(of)f(a)h(table.)53
-b(If)34 b(the)g(input)f(and)h(output)g(\014les)f(are)i(not)g(the)f
-(same,)227 4514 y(cop)m(y)39 b(the)f(TR)m(UE)g(ro)m(ws)h(to)f(the)h
-(output)e(\014le.)63 b(If)38 b(the)g(\014les)f(are)i(the)f(same,)j
-(delete)d(the)g(F)-10 b(ALSE)38 b(ro)m(ws)227 4627 y(\(preserv)m(e)31
-b(the)g(TR)m(UE)f(ro)m(ws\).)95 4888 y Ff(int)47 b(fits_select_rows)d
-(/)j(ffsrow)286 5001 y(\(fitsfile)f(*infptr,)f(fitsfile)h(*outfptr,)93
-b(char)46 b(*expr,)94 b(>)48 b(int)f(*status)e(\))0 5262
-y Fi(4)81 b Fj(Calculate)26 b(an)h(expression)e(for)i(the)f(indicated)g
-(ro)m(ws)g(of)h(a)g(table,)h(returning)d(the)i(results,)f(cast)i(as)f
-(datat)m(yp)s(e)227 5375 y(\(TSHOR)-8 b(T,)32 b(TDOUBLE,)h(etc\),)h(in)
-d(arra)m(y)-8 b(.)48 b(If)31 b(n)m(ulv)-5 b(al==NULL,)31
-b(UNDEFs)i(will)c(b)s(e)j(zero)s(ed)g(out.)47 b(F)-8
-b(or)227 5488 y(v)m(ector)37 b(results,)e(the)g(n)m(um)m(b)s(er)e(of)i
-(elemen)m(ts)h(returned)d(ma)m(y)j(b)s(e)e(less)g(than)h(nelemen)m(ts)f
-(if)g(nelemen)m(ts)h(is)227 5601 y(not)d(an)g(ev)m(en)h(m)m(ultiple)c
-(of)j(the)g(result)f(dimension.)42 b(Call)31 b(\014ts)p
-2392 5601 V 32 w(test)p 2570 5601 V 34 w(expr)g(to)h(obtain)g(the)g
-(dimensions)d(of)227 5714 y(the)i(results.)p eop
-%%Page: 95 101
-95 100 bop 0 299 a Fh(7.11.)73 b(FILE)30 b(CHECKSUM)f(R)m(OUTINES)2263
-b Fj(95)95 555 y Ff(int)47 b(fits_calc_rows)d(/)k(ffcrow)286
-668 y(\(fitsfile)e(*fptr,)93 b(int)47 b(datatype,)f(char)g(*expr,)g
-(long)h(firstrow,)334 781 y(long)g(nelements,)e(void)h(*nulval,)g(>)h
-(void)g(*array,)94 b(int)46 b(*anynul,)g(int)h(*status\))0
-1036 y Fi(5)81 b Fj(Ev)-5 b(aluate)32 b(an)h(expression)e(and)i(write)e
-(the)i(result)f(either)g(to)i(a)f(column)e(\(if)h(the)h(expression)e
-(is)h(a)h(function)227 1148 y(of)d(other)g(columns)f(in)f(the)i
-(table\))g(or)g(to)g(a)h(k)m(eyw)m(ord)f(\(if)f(the)h(expression)e(ev)
--5 b(aluates)31 b(to)f(a)g(constan)m(t)i(and)227 1261
-y(is)e(not)g(a)h(function)e(of)i(other)f(columns)g(in)f(the)h(table\).)
-41 b(In)30 b(the)h(former)e(case,)j(the)f(parName)f(parameter)227
-1374 y(is)39 b(the)h(name)f(of)h(the)g(column)e(\(whic)m(h)h(ma)m(y)h
-(or)f(ma)m(y)h(not)g(already)f(exist\))h(in)m(to)f(whic)m(h)g(to)h
-(write)f(the)227 1487 y(results,)e(and)g(parInfo)e(con)m(tains)i(an)g
-(optional)e(TF)m(ORM)i(k)m(eyw)m(ord)g(v)-5 b(alue)37
-b(if)e(a)i(new)f(column)g(is)f(b)s(eing)227 1600 y(created.)60
-b(If)36 b(a)h(TF)m(ORM)g(v)-5 b(alue)36 b(is)f(not)i(sp)s(eci\014ed)e
-(then)h(a)h(default)f(format)g(will)e(b)s(e)i(used,)h(dep)s(ending)227
-1713 y(on)30 b(the)g(expression.)40 b(If)29 b(the)h(expression)f(ev)-5
-b(alutes)30 b(to)h(a)f(constan)m(t,)i(then)d(the)i(result)e(will)e(b)s
-(e)i(written)g(to)227 1826 y(the)f(k)m(eyw)m(ord)g(name)f(giv)m(en)g(b)
-m(y)h(the)f(parName)h(parameter,)h(and)d(the)i(parInfo)e(parameter)i
-(ma)m(y)g(b)s(e)f(used)227 1939 y(to)k(supply)d(an)i(optional)g(commen)
-m(t)h(for)f(the)g(k)m(eyw)m(ord.)42 b(If)29 b(the)i(k)m(eyw)m(ord)g(do)
-s(es)f(not)g(already)g(exist,)g(then)227 2052 y(the)35
-b(name)g(of)g(the)g(k)m(eyw)m(ord)h(m)m(ust)e(b)s(e)h(preceeded)g(with)
-e(a)j('#')f(c)m(haracter,)i(otherwise)e(the)g(result)f(will)227
-2165 y(b)s(e)c(written)f(to)j(a)e(column)f(with)h(that)h(name.)95
-2419 y Ff(int)47 b(fits_calculator)d(/)j(ffcalc)286 2532
-y(\(fitsfile)f(*infptr,)f(char)i(*expr,)f(fitsfile)f(*outfptr,)h(char)g
-(*parName,)334 2645 y(char)h(*parInfo,)e(>)95 b(int)47
-b(*status\))0 2899 y Fi(6)81 b Fj(This)37 b(calculator)j(routine)f(is)f
-(similar)f(to)j(the)g(previous)e(routine,)j(except)g(that)f(the)g
-(expression)e(is)h(only)227 3012 y(ev)-5 b(aluated)41
-b(o)m(v)m(er)g(the)f(sp)s(eci\014ed)f(ro)m(w)h(ranges.)70
-b(nranges)39 b(sp)s(eci\014es)g(the)h(n)m(um)m(b)s(er)f(of)h(ro)m(w)h
-(ranges,)i(and)227 3125 y(\014rstro)m(w)30 b(and)g(lastro)m(w)g(giv)m
-(e)h(the)g(starting)f(and)g(ending)f(ro)m(w)h(n)m(um)m(b)s(er)f(of)i
-(eac)m(h)g(range.)95 3380 y Ff(int)47 b(fits_calculator_rng)c(/)k
-(ffcalc_rng)286 3493 y(\(fitsfile)f(*infptr,)f(char)i(*expr,)f
-(fitsfile)f(*outfptr,)h(char)g(*parName,)334 3606 y(char)h(*parInfo,)e
-(int)i(nranges,)e(long)i(*firstrow,)e(long)i(*lastrow)334
-3719 y(>)95 b(int)47 b(*status\))0 3973 y Fi(7)81 b Fj(Ev)-5
-b(aluate)30 b(the)h(giv)m(en)f(expression)f(and)h(return)f(information)
-g(on)h(the)h(result.)95 4228 y Ff(int)47 b(fits_test_expr)d(/)k(fftexp)
-286 4340 y(\(fitsfile)e(*fptr,)g(char)g(*expr,)g(>)i(int)f(*datatype,)e
-(long)h(*nelem,)g(int)h(*naxis,)334 4453 y(long)g(*naxes,)f(int)g
-(*status\))0 4786 y Fe(7.11)136 b(File)45 b(Chec)l(ksum)g(Routines)0
-5036 y Fj(The)33 b(follo)m(wing)e(routines)h(either)h(compute)g(or)h(v)
--5 b(alidate)32 b(the)i(c)m(hec)m(ksums)f(for)g(the)h(CHDU.)g(The)e(D)m
-(A)-8 b(T)g(ASUM)0 5149 y(k)m(eyw)m(ord)33 b(is)e(used)g(to)i(store)f
-(the)h(n)m(umerical)d(v)-5 b(alue)32 b(of)g(the)g(32-bit,)h(1's)g
-(complemen)m(t)f(c)m(hec)m(ksum)h(for)f(the)g(data)0
-5262 y(unit)25 b(alone.)39 b(If)25 b(there)h(is)g(no)f(data)i(unit)e
-(then)g(the)h(v)-5 b(alue)26 b(is)f(set)h(to)h(zero.)40
-b(The)26 b(n)m(umerical)e(v)-5 b(alue)26 b(is)f(stored)h(as)g(an)0
-5375 y(ASCI)s(I)20 b(string)h(of)i(digits,)f(enclosed)g(in)e(quotes,)25
+%%Page: 53 61
+53 60 bop 0 299 a Fh(5.8.)72 b(UTILITY)30 b(R)m(OUTINES)2693
+b Fj(53)0 555 y Ff(5.8)135 b(Utilit)l(y)47 b(Routines)0
+809 y Fd(5.8.1)112 b(File)37 b(Chec)m(ksum)g(Routines)0
+1028 y Fj(The)c(follo)m(wing)e(routines)h(either)h(compute)g(or)h(v)-5
+b(alidate)32 b(the)i(c)m(hec)m(ksums)f(for)g(the)h(CHDU.)g(The)e(D)m(A)
+-8 b(T)g(ASUM)0 1140 y(k)m(eyw)m(ord)33 b(is)e(used)g(to)i(store)f(the)
+h(n)m(umerical)d(v)-5 b(alue)32 b(of)g(the)g(32-bit,)h(1's)g(complemen)
+m(t)f(c)m(hec)m(ksum)h(for)f(the)g(data)0 1253 y(unit)25
+b(alone.)39 b(If)25 b(there)h(is)g(no)f(data)i(unit)e(then)g(the)h(v)-5
+b(alue)26 b(is)f(set)h(to)h(zero.)40 b(The)26 b(n)m(umerical)e(v)-5
+b(alue)26 b(is)f(stored)h(as)g(an)0 1366 y(ASCI)s(I)20
+b(string)h(of)i(digits,)f(enclosed)g(in)e(quotes,)25
 b(b)s(ecause)d(the)g(v)-5 b(alue)22 b(ma)m(y)g(b)s(e)f(to)s(o)i(large)f
-(to)h(represen)m(t)f(as)g(a)h(32-bit)0 5488 y(signed)k(in)m(teger.)40
+(to)h(represen)m(t)f(as)g(a)h(32-bit)0 1479 y(signed)k(in)m(teger.)40
 b(The)27 b(CHECKSUM)g(k)m(eyw)m(ord)i(is)e(used)g(to)h(store)h(the)f
-(ASCI)s(I)e(enco)s(ded)i(COMPLEMENT)f(of)0 5601 y(the)f(c)m(hec)m(ksum)
+(ASCI)s(I)e(enco)s(ded)i(COMPLEMENT)f(of)0 1592 y(the)f(c)m(hec)m(ksum)
 h(for)f(the)h(en)m(tire)f(HDU.)h(Storing)e(the)i(complemen)m(t,)g
 (rather)f(than)g(the)h(actual)f(c)m(hec)m(ksum,)i(forces)0
-5714 y(the)k(c)m(hec)m(ksum)h(for)f(the)h(whole)e(HDU)i(to)g(equal)f
+1705 y(the)k(c)m(hec)m(ksum)h(for)f(the)h(whole)e(HDU)i(to)g(equal)f
 (zero.)47 b(If)31 b(the)i(\014le)e(has)h(b)s(een)f(mo)s(di\014ed)f
-(since)i(the)g(c)m(hec)m(ksums)p eop
-%%Page: 96 102
-96 101 bop 0 299 a Fj(96)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fj(w)m(ere)39 b(computed,)i(then)e(the)g(HDU)g(c)m(hec)m(ksum)h
-(will)c(usually)g(not)j(equal)g(zero.)66 b(These)39 b(c)m(hec)m(ksum)g
-(k)m(eyw)m(ord)0 668 y(con)m(v)m(en)m(tions)33 b(are)g(based)f(on)g(a)g
-(pap)s(er)f(b)m(y)h(Rob)g(Seaman)g(published)d(in)i(the)h(pro)s
-(ceedings)f(of)h(the)h(AD)m(ASS)f(IV)0 781 y(conference)h(in)d
-(Baltimore)i(in)e(No)m(v)m(em)m(b)s(er)j(1994)h(and)d(a)h(later)g
-(revision)e(in)g(June)h(1995.)47 b(See)32 b(App)s(endix)d(B)j(for)0
-894 y(the)f(de\014nition)d(of)i(the)h(parameters)f(used)g(in)f(these)i
-(routines.)0 1148 y Fi(1)81 b Fj(Compute)33 b(and)g(write)g(the)h(D)m
-(A)-8 b(T)g(ASUM)35 b(and)e(CHECKSUM)g(k)m(eyw)m(ord)h(v)-5
-b(alues)33 b(for)g(the)h(CHDU)g(in)m(to)g(the)227 1261
+(since)i(the)g(c)m(hec)m(ksums)0 1818 y(w)m(ere)39 b(computed,)i(then)e
+(the)g(HDU)g(c)m(hec)m(ksum)h(will)c(usually)g(not)j(equal)g(zero.)66
+b(These)39 b(c)m(hec)m(ksum)g(k)m(eyw)m(ord)0 1931 y(con)m(v)m(en)m
+(tions)33 b(are)g(based)f(on)g(a)g(pap)s(er)f(b)m(y)h(Rob)g(Seaman)g
+(published)d(in)i(the)h(pro)s(ceedings)f(of)h(the)h(AD)m(ASS)f(IV)0
+2044 y(conference)h(in)d(Baltimore)i(in)e(No)m(v)m(em)m(b)s(er)j(1994)h
+(and)d(a)h(later)g(revision)e(in)g(June)h(1995.)47 b(See)32
+b(App)s(endix)d(B)j(for)0 2157 y(the)f(de\014nition)d(of)i(the)h
+(parameters)f(used)g(in)f(these)i(routines.)0 2407 y
+Fi(1)81 b Fj(Compute)33 b(and)g(write)g(the)h(D)m(A)-8
+b(T)g(ASUM)35 b(and)e(CHECKSUM)g(k)m(eyw)m(ord)h(v)-5
+b(alues)33 b(for)g(the)h(CHDU)g(in)m(to)g(the)227 2520
 y(curren)m(t)e(header.)46 b(If)32 b(the)g(k)m(eyw)m(ords)h(already)f
 (exist,)g(their)g(v)-5 b(alues)31 b(will)f(b)s(e)h(up)s(dated)g(only)g
-(if)h(necessary)227 1374 y(\(i.e.,)f(if)f(the)g(\014le)g(has)g(b)s(een)
+(if)h(necessary)227 2633 y(\(i.e.,)f(if)f(the)g(\014le)g(has)g(b)s(een)
 f(mo)s(di\014ed)g(since)g(the)i(original)e(k)m(eyw)m(ord)h(v)-5
-b(alues)30 b(w)m(ere)h(computed\).)95 1628 y Ff(int)47
-b(fits_write_chksum)c(/)48 b(ffpcks)286 1741 y(\(fitsfile)e(*fptr,)g(>)
-h(int)g(*status\))0 1995 y Fi(2)81 b Fj(Up)s(date)28
+b(alues)30 b(w)m(ere)h(computed\).)95 2883 y Fe(int)47
+b(fits_write_chksum)c(/)48 b(ffpcks)286 2996 y(\(fitsfile)e(*fptr,)g(>)
+h(int)g(*status\))0 3246 y Fi(2)81 b Fj(Up)s(date)28
 b(the)h(CHECKSUM)e(k)m(eyw)m(ord)i(v)-5 b(alue)28 b(in)f(the)i(CHDU,)g
 (assuming)e(that)i(the)f(D)m(A)-8 b(T)g(ASUM)30 b(k)m(eyw)m(ord)227
-2108 y(exists)35 b(and)g(already)g(has)g(the)h(correct)g(v)-5
+3359 y(exists)35 b(and)g(already)g(has)g(the)h(correct)g(v)-5
 b(alue.)55 b(This)34 b(routine)g(calculates)i(the)g(new)f(c)m(hec)m
-(ksum)h(for)f(the)227 2221 y(curren)m(t)40 b(header)g(unit,)i(adds)d
+(ksum)h(for)f(the)227 3471 y(curren)m(t)40 b(header)g(unit,)i(adds)d
 (it)h(to)h(the)f(data)h(unit)e(c)m(hec)m(ksum,)44 b(enco)s(des)c(the)g
-(v)-5 b(alue)40 b(in)m(to)g(an)g(ASCI)s(I)227 2334 y(string,)30
+(v)-5 b(alue)40 b(in)m(to)g(an)g(ASCI)s(I)227 3584 y(string,)30
 b(and)g(writes)f(the)i(string)e(to)i(the)g(CHECKSUM)e(k)m(eyw)m(ord.)95
-2588 y Ff(int)47 b(fits_update_chksum)c(/)48 b(ffupck)286
-2701 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*status\))0 2955
+3834 y Fe(int)47 b(fits_update_chksum)c(/)48 b(ffupck)286
+3947 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*status\))0 4197
 y Fi(3)81 b Fj(V)-8 b(erify)34 b(the)g(CHDU)h(b)m(y)g(computing)e(the)i
 (c)m(hec)m(ksums)g(and)f(comparing)g(them)g(with)f(the)i(k)m(eyw)m
-(ords.)53 b(The)227 3068 y(data)34 b(unit)e(is)g(v)m(eri\014ed)g
+(ords.)53 b(The)227 4310 y(data)34 b(unit)e(is)g(v)m(eri\014ed)g
 (correctly)h(if)f(the)i(computed)f(c)m(hec)m(ksum)g(equals)g(the)g(v)-5
-b(alue)33 b(of)g(the)g(D)m(A)-8 b(T)g(ASUM)227 3181 y(k)m(eyw)m(ord.)64
+b(alue)33 b(of)g(the)g(D)m(A)-8 b(T)g(ASUM)227 4423 y(k)m(eyw)m(ord.)64
 b(The)37 b(c)m(hec)m(ksum)i(for)f(the)g(en)m(tire)f(HDU)i(\(header)f
 (plus)e(data)j(unit\))d(is)h(correct)i(if)e(it)h(equals)227
-3294 y(zero.)47 b(The)32 b(output)f(D)m(A)-8 b(T)g(A)m(OK)34
+4536 y(zero.)47 b(The)32 b(output)f(D)m(A)-8 b(T)g(A)m(OK)34
 b(and)d(HDUOK)i(parameters)f(in)f(this)g(routine)g(are)h(in)m(tegers)h
-(whic)m(h)e(will)227 3407 y(ha)m(v)m(e)36 b(a)f(v)-5
+(whic)m(h)e(will)227 4649 y(ha)m(v)m(e)36 b(a)f(v)-5
 b(alue)34 b(=)g(1)h(if)e(the)i(data)g(or)f(HDU)h(is)f(v)m(eri\014ed)f
 (correctly)-8 b(,)37 b(a)e(v)-5 b(alue)34 b(=)g(0)h(if)e(the)i(D)m(A)-8
-b(T)g(ASUM)36 b(or)227 3520 y(CHECKSUM)29 b(k)m(eyw)m(ord)g(is)g(not)g
+b(T)g(ASUM)36 b(or)227 4762 y(CHECKSUM)29 b(k)m(eyw)m(ord)g(is)g(not)g
 (presen)m(t,)h(or)f(v)-5 b(alue)29 b(=)g(-1)h(if)e(the)i(computed)f(c)m
-(hec)m(ksum)h(is)e(not)i(correct.)95 3887 y Ff(int)47
-b(fits_verify_chksum)c(/)48 b(ffvcks)286 4000 y(\(fitsfile)e(*fptr,)g
+(hec)m(ksum)h(is)e(not)i(correct.)95 5125 y Fe(int)47
+b(fits_verify_chksum)c(/)48 b(ffvcks)286 5238 y(\(fitsfile)e(*fptr,)g
 (>)h(int)g(*dataok,)f(int)h(*hduok,)e(int)i(*status\))0
-4254 y Fi(4)81 b Fj(Compute)40 b(and)g(return)g(the)h(c)m(hec)m(ksum)g
+5488 y Fi(4)81 b Fj(Compute)40 b(and)g(return)g(the)h(c)m(hec)m(ksum)g
 (v)-5 b(alues)40 b(for)h(the)g(CHDU)g(without)f(creating)h(or)g(mo)s
-(difying)d(the)227 4367 y(CHECKSUM)33 b(and)h(D)m(A)-8
+(difying)d(the)227 5601 y(CHECKSUM)33 b(and)h(D)m(A)-8
 b(T)g(ASUM)35 b(k)m(eyw)m(ords.)52 b(This)32 b(routine)h(is)g(used)g
 (in)m(ternally)f(b)m(y)i(\013v)m(c)m(ks,)i(but)d(ma)m(y)227
-4480 y(b)s(e)d(useful)f(in)g(other)h(situations)f(as)i(w)m(ell.)95
-4734 y Ff(int)47 b(fits_get_chksum/)d(/ffgcks)286 4847
+5714 y(b)s(e)d(useful)f(in)g(other)h(situations)f(as)i(w)m(ell.)p
+eop
+%%Page: 54 62
+54 61 bop 0 299 a Fj(54)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
+555 y Fe(int)47 b(fits_get_chksum/)d(/ffgcks)286 668
 y(\(fitsfile)i(*fptr,)g(>)h(unsigned)f(long)g(*datasum,)g(unsigned)f
-(long)i(*hdusum,)334 4960 y(int)g(*status\))0 5214 y
-Fi(5)81 b Fj(Enco)s(de)23 b(a)h(c)m(hec)m(ksum)g(v)-5
-b(alue)23 b(in)m(to)g(a)h(16-c)m(haracter)j(string.)37
-b(If)23 b(complm)g(is)f(non-zero)j(\(true\))f(then)f(the)h(32-bit)227
-5327 y(sum)30 b(v)-5 b(alue)30 b(will)d(b)s(e)j(complemen)m(ted)g(b)s
-(efore)g(enco)s(ding.)95 5581 y Ff(int)47 b(fits_encode_chksum)c(/)48
-b(ffesum)286 5694 y(\(unsigned)e(long)g(sum,)h(int)g(complm,)f(>)h
-(char)g(*ascii\);)p eop
-%%Page: 97 103
-97 102 bop 0 299 a Fh(7.12.)113 b(D)m(A)-8 b(TE)31 b(AND)g(TIME)f
-(UTILITY)g(R)m(OUTINES)1812 b Fj(97)0 555 y Fi(6)81 b
-Fj(Deco)s(de)24 b(a)f(16-c)m(haracter)j(c)m(hec)m(ksum)e(string)e(in)m
-(to)g(a)i(unsigned)d(long)h(v)-5 b(alue.)38 b(If)23 b(is)f(non-zero)h
-(\(true\).)39 b(then)23 b(the)227 668 y(32-bit)32 b(sum)e(v)-5
+(long)i(*hdusum,)334 781 y(int)g(*status\))0 1022 y Fi(5)81
+b Fj(Enco)s(de)23 b(a)h(c)m(hec)m(ksum)g(v)-5 b(alue)23
+b(in)m(to)g(a)h(16-c)m(haracter)j(string.)37 b(If)23
+b(complm)g(is)f(non-zero)j(\(true\))f(then)f(the)h(32-bit)227
+1135 y(sum)30 b(v)-5 b(alue)30 b(will)d(b)s(e)j(complemen)m(ted)g(b)s
+(efore)g(enco)s(ding.)95 1376 y Fe(int)47 b(fits_encode_chksum)c(/)48
+b(ffesum)286 1489 y(\(unsigned)e(long)g(sum,)h(int)g(complm,)f(>)h
+(char)g(*ascii\);)0 1730 y Fi(6)81 b Fj(Deco)s(de)24
+b(a)f(16-c)m(haracter)j(c)m(hec)m(ksum)e(string)e(in)m(to)g(a)i
+(unsigned)d(long)h(v)-5 b(alue.)38 b(If)23 b(is)f(non-zero)h(\(true\).)
+39 b(then)23 b(the)227 1842 y(32-bit)32 b(sum)e(v)-5
 b(alue)31 b(will)e(b)s(e)i(complemen)m(ted)g(after)h(deco)s(ding.)43
 b(The)31 b(c)m(hec)m(ksum)h(v)-5 b(alue)31 b(is)g(also)g(returned)227
-781 y(as)g(the)f(v)-5 b(alue)30 b(of)h(the)f(function.)95
-1040 y Ff(unsigned)46 b(long)h(fits_decode_chksum)42
-b(/)48 b(ffdsum)525 1152 y(\(char)e(*ascii,)g(int)h(complm,)f(>)h
-(unsigned)f(long)h(*sum\);)0 1486 y Fe(7.12)180 b(Date)46
-b(and)f(Time)g(Utilit)l(y)i(Routines)0 1736 y Fj(The)29
+1955 y(as)g(the)f(v)-5 b(alue)30 b(of)h(the)f(function.)95
+2196 y Fe(unsigned)46 b(long)h(fits_decode_chksum)42
+b(/)48 b(ffdsum)525 2309 y(\(char)e(*ascii,)g(int)h(complm,)f(>)h
+(unsigned)f(long)h(*sum\);)0 2597 y Fd(5.8.2)112 b(Date)38
+b(and)g(Time)e(Utilit)m(y)e(Routines)0 2816 y Fj(The)29
 b(follo)m(wing)f(routines)h(help)f(to)j(construct)f(or)f(parse)h(the)g
 (FITS)f(date/time)h(strings.)40 b(Starting)29 b(in)f(the)i(y)m(ear)0
-1849 y(2000,)k(the)d(FITS)g(D)m(A)-8 b(TE)32 b(k)m(eyw)m(ord)g(v)-5
+2929 y(2000,)k(the)d(FITS)g(D)m(A)-8 b(TE)32 b(k)m(eyw)m(ord)g(v)-5
 b(alues)30 b(\(and)i(the)f(v)-5 b(alues)31 b(of)g(other)h(`D)m(A)-8
 b(TE-')33 b(k)m(eyw)m(ords\))f(m)m(ust)f(ha)m(v)m(e)i(the)0
-1962 y(form)j('YYYY-MM-DD')k(\(date)e(only\))e(or)h
+3042 y(form)j('YYYY-MM-DD')k(\(date)e(only\))e(or)h
 ('YYYY-MM-DDThh:mm:ss.ddd...')61 b(\(date)38 b(and)e(time\))g(where)0
-2075 y(the)30 b(n)m(um)m(b)s(er)f(of)i(decimal)e(places)h(in)f(the)h
+3154 y(the)30 b(n)m(um)m(b)s(er)f(of)i(decimal)e(places)h(in)f(the)h
 (seconds)g(v)-5 b(alue)30 b(is)f(optional.)40 b(These)30
-b(times)g(are)g(in)f(UTC.)h(The)g(older)0 2188 y('dd/mm/yy')d(date)g
+b(times)g(are)g(in)f(UTC.)h(The)g(older)0 3267 y('dd/mm/yy')d(date)g
 (format)g(ma)m(y)h(not)f(b)s(e)f(used)g(for)h(dates)h(after)f(01)h(Jan)
 m(uary)e(2000.)42 b(See)27 b(App)s(endix)d(B)j(for)g(the)0
-2301 y(de\014nition)h(of)j(the)f(parameters)h(used)e(in)g(these)i
-(routines.)0 2559 y Fi(1)81 b Fj(Get)23 b(the)f(curren)m(t)f(system)i
+3380 y(de\014nition)h(of)j(the)f(parameters)h(used)e(in)g(these)i
+(routines.)0 3621 y Fi(1)81 b Fj(Get)23 b(the)f(curren)m(t)f(system)i
 (date.)38 b(C)22 b(already)f(pro)m(vides)g(standard)g(library)f
-(routines)h(for)g(getting)i(the)f(curren)m(t)227 2672
+(routines)h(for)g(getting)i(the)f(curren)m(t)227 3734
 y(date)k(and)e(time,)i(but)e(this)g(routine)g(is)g(pro)m(vided)g(for)g
 (compatibilit)m(y)g(with)f(the)i(F)-8 b(ortran)26 b(FITSIO)e(library)-8
-b(.)227 2785 y(The)30 b(returned)f(y)m(ear)j(has)e(4)g(digits)f
-(\(1999,)k(2000,)g(etc.\))95 3044 y Ff(int)47 b
-(fits_get_system_date/ffgsd)o(t)286 3156 y(\()h(>)f(int)g(*day,)g(int)f
-(*month,)g(int)h(*year,)f(int)h(*status)f(\))0 3415 y
+b(.)227 3847 y(The)30 b(returned)f(y)m(ear)j(has)e(4)g(digits)f
+(\(1999,)k(2000,)g(etc.\))95 4088 y Fe(int)47 b
+(fits_get_system_date/ffgsd)o(t)286 4201 y(\()h(>)f(int)g(*day,)g(int)f
+(*month,)g(int)h(*year,)f(int)h(*status)f(\))0 4442 y
 Fi(2)81 b Fj(Get)34 b(the)g(curren)m(t)g(system)f(date)i(and)e(time)g
 (string)g(\('YYYY-MM-DDThh:mm:ss'\).)53 b(The)33 b(time)h(will)d(b)s(e)
-227 3528 y(in)25 b(UTC/GMT)h(if)f(a)m(v)-5 b(ailable,)26
+227 4555 y(in)25 b(UTC/GMT)h(if)f(a)m(v)-5 b(ailable,)26
 b(as)h(indicated)d(b)m(y)i(a)g(returned)f(timeref)g(v)-5
 b(alue)26 b(=)f(0.)40 b(If)26 b(the)g(returned)e(v)-5
-b(alue)227 3641 y(of)31 b(timeref)f(=)h(1)g(then)f(this)g(indicates)f
+b(alue)227 4668 y(of)31 b(timeref)f(=)h(1)g(then)f(this)g(indicates)f
 (that)j(it)e(w)m(as)h(not)g(p)s(ossible)d(to)j(con)m(v)m(ert)i(the)d
-(lo)s(cal)g(time)h(to)g(UTC,)227 3754 y(and)f(th)m(us)g(the)h(lo)s(cal)
-e(time)h(w)m(as)h(returned.)95 4012 y Ff(int)47 b
-(fits_get_system_time/ffgst)o(m)286 4125 y(\(>)h(char)e(*datestr,)f
-(int)95 b(*timeref,)45 b(int)i(*status\))0 4384 y Fi(3)81
+(lo)s(cal)g(time)h(to)g(UTC,)227 4780 y(and)f(th)m(us)g(the)h(lo)s(cal)
+e(time)h(w)m(as)h(returned.)95 5021 y Fe(int)47 b
+(fits_get_system_time/ffgst)o(m)286 5134 y(\(>)h(char)e(*datestr,)f
+(int)95 b(*timeref,)45 b(int)i(*status\))0 5375 y Fi(3)81
 b Fj(Construct)26 b(a)i(date)g(string)e(from)h(the)g(input)e(date)j(v)
 -5 b(alues.)39 b(If)27 b(the)g(y)m(ear)h(is)f(b)s(et)m(w)m(een)g(1900)i
-(and)e(1998,)j(inclu-)227 4497 y(siv)m(e,)37 b(then)d(the)i(returned)d
+(and)e(1998,)j(inclu-)227 5488 y(siv)m(e,)37 b(then)d(the)i(returned)d
 (date)j(string)e(will)e(ha)m(v)m(e)37 b(the)e(old)f(FITS)g(format)i
-(\('dd/mm/yy'\),)h(otherwise)227 4610 y(the)32 b(date)f(string)f(will)f
+(\('dd/mm/yy'\),)h(otherwise)227 5601 y(the)32 b(date)f(string)f(will)f
 (ha)m(v)m(e)j(the)g(new)e(FITS)h(format)g(\('YYYY-MM-DD'\).)36
-b(Use)31 b(\014ts)p 3229 4610 28 4 v 33 w(time2str)g(instead)227
-4722 y(to)g(alw)m(a)m(ys)g(return)f(a)g(date)h(string)f(using)f(the)h
-(new)g(FITS)g(format.)95 4981 y Ff(int)47 b(fits_date2str/ffdt2s)286
-5094 y(\(int)g(year,)f(int)h(month,)f(int)h(day,)g(>)g(char)g
-(*datestr,)e(int)i(*status\))0 5352 y Fi(4)81 b Fj(Construct)34
-b(a)i(new-format)f(date)h(+)f(time)g(string)f
-(\('YYYY-MM-DDThh:mm:ss.ddd...'\).)57 b(If)34 b(the)i(y)m(ear,)227
-5465 y(mon)m(th,)d(and)e(da)m(y)h(v)-5 b(alues)31 b(all)g(=)g(0)h(then)
-g(only)f(the)h(time)f(is)g(enco)s(ded)g(with)g(format)h
-('hh:mm:ss.ddd...'.)227 5578 y(The)j(decimals)f(parameter)i(sp)s
-(eci\014es)d(ho)m(w)j(man)m(y)f(decimal)f(places)h(of)g(fractional)g
-(seconds)g(to)h(include)227 5691 y(in)29 b(the)i(string.)40
-b(If)29 b(`decimals')h(is)g(negativ)m(e,)h(then)g(only)e(the)i(date)g
-(will)c(b)s(e)j(return)f(\('YYYY-MM-DD'\).)p eop
-%%Page: 98 104
-98 103 bop 0 299 a Fj(98)1339 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
-555 y Ff(int)47 b(fits_time2str/fftm2s)286 668 y(\(int)g(year,)f(int)h
-(month,)f(int)h(day,)g(int)g(hour,)f(int)h(minute,)f(double)g(second,)
-286 781 y(int)h(decimals,)f(>)h(char)g(*datestr,)e(int)i(*status\))0
-1026 y Fi(5)81 b Fj(Return)44 b(the)g(date)i(as)f(read)f(from)h(the)g
+b(Use)31 b(\014ts)p 3229 5601 28 4 v 33 w(time2str)g(instead)227
+5714 y(to)g(alw)m(a)m(ys)g(return)f(a)g(date)h(string)f(using)f(the)h
+(new)g(FITS)g(format.)p eop
+%%Page: 55 63
+55 62 bop 0 299 a Fh(5.8.)72 b(UTILITY)30 b(R)m(OUTINES)2693
+b Fj(55)95 555 y Fe(int)47 b(fits_date2str/ffdt2s)286
+668 y(\(int)g(year,)f(int)h(month,)f(int)h(day,)g(>)g(char)g(*datestr,)
+e(int)i(*status\))0 928 y Fi(4)81 b Fj(Construct)34 b(a)i(new-format)f
+(date)h(+)f(time)g(string)f(\('YYYY-MM-DDThh:mm:ss.ddd...'\).)57
+b(If)34 b(the)i(y)m(ear,)227 1041 y(mon)m(th,)d(and)e(da)m(y)h(v)-5
+b(alues)31 b(all)g(=)g(0)h(then)g(only)f(the)h(time)f(is)g(enco)s(ded)g
+(with)g(format)h('hh:mm:ss.ddd...'.)227 1154 y(The)j(decimals)f
+(parameter)i(sp)s(eci\014es)d(ho)m(w)j(man)m(y)f(decimal)f(places)h(of)
+g(fractional)g(seconds)g(to)h(include)227 1266 y(in)29
+b(the)i(string.)40 b(If)29 b(`decimals')h(is)g(negativ)m(e,)h(then)g
+(only)e(the)i(date)g(will)c(b)s(e)j(return)f(\('YYYY-MM-DD'\).)95
+1526 y Fe(int)47 b(fits_time2str/fftm2s)286 1639 y(\(int)g(year,)f(int)
+h(month,)f(int)h(day,)g(int)g(hour,)f(int)h(minute,)f(double)g(second,)
+286 1752 y(int)h(decimals,)f(>)h(char)g(*datestr,)e(int)i(*status\))0
+2012 y Fi(5)81 b Fj(Return)44 b(the)g(date)i(as)f(read)f(from)h(the)g
 (input)d(string,)48 b(where)c(the)h(string)f(ma)m(y)h(b)s(e)f(in)g
-(either)g(the)h(old)227 1139 y(\('dd/mm/yy'\))29 b(or)f(new)f
+(either)g(the)h(old)227 2125 y(\('dd/mm/yy'\))29 b(or)f(new)f
 (\('YYYY-MM-DDThh:mm:ss')k(or)d('YYYY-MM-DD'\))j(FITS)d(format.)40
-b(Null)227 1252 y(p)s(oin)m(ters)30 b(ma)m(y)g(b)s(e)g(supplied)d(for)j
+b(Null)227 2237 y(p)s(oin)m(ters)30 b(ma)m(y)g(b)s(e)g(supplied)d(for)j
 (an)m(y)h(un)m(w)m(an)m(ted)g(output)f(date)h(parameters.)95
-1497 y Ff(int)47 b(fits_str2date/ffs2dt)286 1610 y(\(char)g(*datestr,)e
+2497 y Fe(int)47 b(fits_str2date/ffs2dt)286 2610 y(\(char)g(*datestr,)e
 (>)i(int)g(*year,)f(int)h(*month,)f(int)h(*day,)f(int)h(*status\))0
-1855 y Fi(6)81 b Fj(Return)30 b(the)h(date)h(and)f(time)g(as)g(read)g
+2870 y Fi(6)81 b Fj(Return)30 b(the)h(date)h(and)f(time)g(as)g(read)g
 (from)g(the)h(input)d(string,)h(where)h(the)h(string)e(ma)m(y)i(b)s(e)e
-(in)g(either)h(the)227 1968 y(old)d(or)g(new)g(FITS)g(format.)40
+(in)g(either)h(the)227 2983 y(old)d(or)g(new)g(FITS)g(format.)40
 b(The)28 b(returned)f(hours,)h(min)m(utes,)g(and)g(seconds)g(v)-5
-b(alues)28 b(will)d(b)s(e)j(set)h(to)g(zero)227 2081
+b(alues)28 b(will)d(b)s(e)j(set)h(to)g(zero)227 3095
 y(if)j(the)i(input)d(string)h(do)s(es)h(not)h(include)d(the)i(time)g
 (\('dd/mm/yy')g(or)h('YYYY-MM-DD'\))j(.)c(Similarly)-8
-b(,)227 2194 y(the)36 b(returned)e(y)m(ear,)j(mon)m(th,)g(and)d(date)i
+b(,)227 3208 y(the)36 b(returned)e(y)m(ear,)j(mon)m(th,)g(and)d(date)i
 (v)-5 b(alues)35 b(will)d(b)s(e)j(set)h(to)g(zero)g(if)e(the)h(date)h
-(is)e(not)i(included)c(in)227 2307 y(the)d(input)e(string)h
+(is)e(not)i(included)c(in)227 3321 y(the)d(input)e(string)h
 (\('hh:mm:ss.ddd...'\).)40 b(Null)27 b(p)s(oin)m(ters)g(ma)m(y)j(b)s(e)
 e(supplied)d(for)k(an)m(y)g(un)m(w)m(an)m(ted)g(output)227
-2420 y(date)i(and)f(time)g(parameters.)95 2665 y Ff(int)47
-b(fits_str2time/ffs2tm)286 2778 y(\(char)g(*datestr,)e(>)i(int)g
+3434 y(date)i(and)f(time)g(parameters.)95 3694 y Fe(int)47
+b(fits_str2time/ffs2tm)286 3807 y(\(char)g(*datestr,)e(>)i(int)g
 (*year,)f(int)h(*month,)f(int)h(*day,)f(int)h(*hour,)286
-2891 y(int)g(*minute,)f(double)g(*second,)f(int)i(*status\))0
-3222 y Fe(7.13)180 b(General)46 b(Utilit)l(y)h(Routines)0
-3472 y Fj(The)c(follo)m(wing)e(utilit)m(y)h(routines)g(ma)m(y)h(b)s(e)g
-(useful)e(for)i(certain)g(applications.)78 b(See)43 b(App)s(endix)d(B)k
-(for)f(the)0 3585 y(de\014nition)28 b(of)j(the)f(parameters)h(used)e
-(in)g(these)i(routines.)0 3830 y Fi(1)81 b Fj(Con)m(v)m(ert)31
-b(a)g(c)m(haracter)h(string)d(to)i(upp)s(ercase)e(\(op)s(erates)j(in)d
-(place\).)95 4075 y Ff(void)47 b(fits_uppercase)d(/)j(ffupch)g(\(char)f
-(*string\))0 4320 y Fi(2)81 b Fj(Compare)43 b(the)i(input)d(template)i
-(string)f(against)h(the)h(reference)f(string)f(to)i(see)g(if)e(they)h
-(matc)m(h.)82 b(The)227 4433 y(template)35 b(string)f(ma)m(y)h(con)m
-(tain)f(wildcard)e(c)m(haracters:)51 b('*')35 b(will)d(matc)m(h)j(an)m
-(y)g(sequence)g(of)f(c)m(haracters)227 4546 y(\(including)26
+3920 y(int)g(*minute,)f(double)g(*second,)f(int)i(*status\))0
+4210 y Fd(5.8.3)112 b(General)38 b(Utilit)m(y)c(Routines)0
+4429 y Fj(The)c(follo)m(wing)f(utilit)m(y)f(routines)i(ma)m(y)h(b)s(e)e
+(useful)g(for)h(certain)g(applications.)0 4689 y Fi(1)81
+b Fj(Return)30 b(the)h(revision)e(n)m(um)m(b)s(er)h(of)h(the)g(CFITSIO)
+f(library)-8 b(.)40 b(The)31 b(revision)e(n)m(um)m(b)s(er)h(will)e(b)s
+(e)i(incremen)m(ted)227 4802 y(with)f(eac)m(h)j(new)e(release)g(of)h
+(CFITSIO.)95 5061 y Fe(float)47 b(fits_get_version)c(/)48
+b(ffvers)e(\()h(>)h(float)e(*version\))0 5321 y Fi(2)81
+b Fj(W)-8 b(rite)33 b(an)h(80-c)m(haracter)i(message)e(to)g(the)g
+(CFITSIO)e(error)h(stac)m(k.)51 b(Application)31 b(programs)i(should)f
+(not)227 5434 y(normally)d(write)g(to)j(the)e(stac)m(k,)i(but)e(there)g
+(ma)m(y)h(b)s(e)f(some)h(situations)e(where)h(this)f(is)h(desirable.)95
+5694 y Fe(void)47 b(fits_write_errmsg)c(/)48 b(ffpmsg)e(\(char)g
+(*err_msg\))p eop
+%%Page: 56 64
+56 63 bop 0 299 a Fj(56)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fi(3)81 b Fj(Con)m(v)m(ert)31 b(a)g(c)m(haracter)h(string)d(to)i
+(upp)s(ercase)e(\(op)s(erates)j(in)d(place\).)95 829
+y Fe(void)47 b(fits_uppercase)d(/)j(ffupch)g(\(char)f(*string\))0
+1102 y Fi(4)81 b Fj(Compare)43 b(the)i(input)d(template)i(string)f
+(against)h(the)h(reference)f(string)f(to)i(see)g(if)e(they)h(matc)m(h.)
+82 b(The)227 1215 y(template)35 b(string)f(ma)m(y)h(con)m(tain)f
+(wildcard)e(c)m(haracters:)51 b('*')35 b(will)d(matc)m(h)j(an)m(y)g
+(sequence)g(of)f(c)m(haracters)227 1328 y(\(including)26
 b(zero)k(c)m(haracters\))h(and)d('\045')i(will)c(matc)m(h)k(an)m(y)f
 (single)f(c)m(haracter)j(in)c(the)j(reference)f(string.)39
-b(If)227 4659 y(casesen)25 b(=)f(CASESEN)f(=)h(TR)m(UE)h(then)e(the)i
+b(If)227 1441 y(casesen)25 b(=)f(CASESEN)f(=)h(TR)m(UE)h(then)e(the)i
 (matc)m(h)g(will)d(b)s(e)h(case)j(sensitiv)m(e,)f(otherwise)e(the)i
-(case)g(of)g(the)227 4772 y(letters)h(will)d(b)s(e)i(ignored)f(if)h
+(case)g(of)g(the)227 1554 y(letters)h(will)d(b)s(e)i(ignored)f(if)h
 (casesen)h(=)f(CASEINSEN)f(=)h(F)-10 b(ALSE.)25 b(The)g(returned)g(MA)
--8 b(TCH)25 b(parameter)227 4885 y(will)30 b(b)s(e)h(TR)m(UE)i(if)e
+-8 b(TCH)25 b(parameter)227 1667 y(will)30 b(b)s(e)h(TR)m(UE)i(if)e
 (the)h(2)h(strings)e(matc)m(h,)j(and)d(EXA)m(CT)h(will)e(b)s(e)h(TR)m
 (UE)i(if)e(the)h(matc)m(h)h(is)f(exact)h(\(i.e.,)227
-4998 y(if)27 b(no)h(wildcard)e(c)m(haracters)j(w)m(ere)g(used)e(in)f
+1779 y(if)27 b(no)h(wildcard)e(c)m(haracters)j(w)m(ere)g(used)e(in)f
 (the)j(matc)m(h\).)41 b(Both)28 b(strings)f(m)m(ust)h(b)s(e)f(68)i(c)m
-(haracters)h(or)e(less)227 5111 y(in)h(length.)95 5356
-y Ff(void)47 b(fits_compare_str)c(/)48 b(ffcmps)334 5469
+(haracters)h(or)e(less)227 1892 y(in)h(length.)95 2166
+y Fe(void)47 b(fits_compare_str)c(/)48 b(ffcmps)334 2279
 y(\(char)e(*templt,)g(char)h(*string,)e(int)i(casesen,)f(>)h(int)g
-(*match,)f(int)h(*exact\))0 5714 y Fi(3)81 b Fj(T)-8
-b(est)31 b(that)g(the)f(k)m(eyw)m(ord)h(name)f(con)m(tains)h(only)e
-(legal)i(c)m(haracters:)42 b(A-Z,0-9,)32 b(h)m(yphen,)d(and)h
-(underscore.)p eop
-%%Page: 99 105
-99 104 bop 0 299 a Fh(7.13.)113 b(GENERAL)30 b(UTILITY)g(R)m(OUTINES)
-2122 b Fj(99)95 555 y Ff(int)47 b(fits_test_keyword)c(/)48
-b(fftkey)e(\(char)g(*keyname,)g(>)h(int)g(*status\))0
-814 y Fi(4)81 b Fj(T)-8 b(est)31 b(that)g(the)f(k)m(eyw)m(ord)h(record)
-f(con)m(tains)h(only)e(legal)h(prin)m(table)f(ASCI)s(I)g(c)m(haracters)
-95 1073 y Ff(int)47 b(fits_test_record)d(/)j(fftrec)f(\(char)h(*card,)f
-(>)h(int)g(*status\))0 1332 y Fi(5)81 b Fj(T)-8 b(est)25
-b(whether)f(the)h(curren)m(t)f(header)h(con)m(tains)f(an)m(y)h(NULL)g
-(\(ASCI)s(I)e(0\))j(c)m(haracters.)40 b(These)24 b(c)m(haracters)j(are)
-227 1445 y(illegal)33 b(in)g(the)i(header,)g(but)f(they)g(will)e(go)j
+(*match,)f(int)h(*exact\))0 2552 y Fi(5)81 b Fj(Split)28
+b(a)k(string)e(con)m(taining)g(a)i(list)d(of)i(names)g(\(t)m(ypically)g
+(\014le)f(names)h(or)g(column)e(names\))j(in)m(to)f(individual)227
+2665 y(name)23 b(tok)m(ens)g(b)m(y)g(a)g(sequence)g(of)g(calls)e(to)j
+(\014ts)p 1814 2665 28 4 v 32 w(split)p 2020 2665 V 31
+w(names.)38 b(The)22 b(names)h(in)e(the)i(list)e(m)m(ust)h(b)s(e)g
+(delimited)227 2778 y(b)m(y)45 b(a)f(comma)i(and/or)e(spaces.)83
+b(This)43 b(routine)g(ignores)h(spaces)h(and)f(commas)h(that)g(o)s
+(ccur)f(within)227 2891 y(paren)m(theses,)36 b(brac)m(k)m(ets,)h(or)e
+(curly)e(brac)m(k)m(ets.)54 b(It)35 b(also)f(strips)f(an)m(y)i(leading)
+e(and)h(trailing)e(blanks)h(from)227 3004 y(the)e(returned)e(name.)227
+3161 y(This)g(routine)g(is)h(similar)d(to)k(the)g(ANSI)f(C)g('strtok')h
+(function:)227 3318 y(The)37 b(\014rst)f(call)g(to)i(\014ts)p
+1033 3318 V 32 w(split)p 1239 3318 V 31 w(names)f(has)g(a)g(non-n)m
+(ull)d(input)h(string.)60 b(It)37 b(\014nds)e(the)i(\014rst)f(name)h
+(in)f(the)227 3431 y(string)25 b(and)g(terminates)g(it)h(b)m(y)f(o)m(v)
+m(erwriting)g(the)h(next)g(c)m(haracter)h(of)f(the)g(string)e(with)h(a)
+h(n)m(ull)d(terminator)227 3544 y(and)31 b(returns)g(a)h(p)s(oin)m(ter)
+e(to)j(the)e(name.)45 b(Eac)m(h)32 b(subsequen)m(t)f(call,)h(indicated)
+e(b)m(y)h(a)h(NULL)g(v)-5 b(alue)31 b(of)h(the)227 3657
+y(input)e(string,)i(returns)f(the)h(next)h(name,)f(searc)m(hing)g(from)
+g(just)g(past)g(the)g(end)f(of)i(the)f(previous)f(name.)227
+3770 y(It)g(returns)e(NULL)h(when)g(no)g(further)f(names)h(are)h
+(found.)143 4043 y Fe(char)47 b(*fits_split_names\(char)42
+b(*namelist\))0 4316 y Fj(The)30 b(follo)m(wing)f(example)h(sho)m(ws)g
+(ho)m(w)g(a)h(string)e(w)m(ould)h(b)s(e)f(split)g(in)m(to)h(3)h(names:)
+191 4590 y Fe(myfile[1][bin)44 b(\(x,y\)=4],)h(file2.fits)93
+b(file3.fits)191 4703 y(^^^^^^^^^^^^^^^^^^^^^^)c(^^^^^^^^^^)k
+(^^^^^^^^^^)382 4816 y(1st)47 b(name)619 b(2nd)47 b(name)190
+b(3rd)47 b(name)0 5089 y Fi(6)81 b Fj(T)-8 b(est)34 b(that)g(the)g(k)m
+(eyw)m(ord)g(name)f(con)m(tains)h(only)e(legal)i(c)m(haracters)h
+(\(A-Z,0-9,)h(h)m(yphen,)d(and)g(underscore\))227 5202
+y(or)e(that)g(the)f(k)m(eyw)m(ord)h(record)f(con)m(tains)h(only)e
+(legal)h(prin)m(table)f(ASCI)s(I)g(c)m(haracters)95 5475
+y Fe(int)47 b(fits_test_keyword)c(/)48 b(fftkey)e(\(char)g(*keyname,)g
+(>)h(int)g(*status\))95 5701 y(int)g(fits_test_record)d(/)j(fftrec)f
+(\(char)h(*card,)f(>)h(int)g(*status\))p eop
+%%Page: 57 65
+57 64 bop 0 299 a Fh(5.8.)72 b(UTILITY)30 b(R)m(OUTINES)2693
+b Fj(57)0 555 y Fi(7)81 b Fj(T)-8 b(est)25 b(whether)f(the)h(curren)m
+(t)f(header)h(con)m(tains)f(an)m(y)h(NULL)g(\(ASCI)s(I)e(0\))j(c)m
+(haracters.)40 b(These)24 b(c)m(haracters)j(are)227 668
+y(illegal)33 b(in)g(the)i(header,)g(but)f(they)g(will)e(go)j
 (undetected)g(b)m(y)f(most)h(of)g(the)f(CFITSIO)f(k)m(eyw)m(ord)i
-(header)227 1558 y(routines,)28 b(b)s(ecause)g(the)h(n)m(ull)d(is)h(in)
-m(terpreted)g(as)i(the)f(normal)f(end-of-string)h(terminator.)40
-b(This)26 b(routine)227 1670 y(returns)i(the)g(p)s(osition)f(of)i(the)g
+(header)227 781 y(routines,)28 b(b)s(ecause)g(the)h(n)m(ull)d(is)h(in)m
+(terpreted)g(as)i(the)f(normal)f(end-of-string)h(terminator.)40
+b(This)26 b(routine)227 894 y(returns)i(the)g(p)s(osition)f(of)i(the)g
 (\014rst)f(n)m(ull)e(c)m(haracter)k(in)e(the)g(header,)h(or)g(zero)g
 (if)f(there)h(are)g(no)f(n)m(ulls.)38 b(F)-8 b(or)227
-1783 y(example)36 b(a)g(returned)f(v)-5 b(alue)36 b(of)g(110)h(w)m
+1007 y(example)36 b(a)g(returned)f(v)-5 b(alue)36 b(of)g(110)h(w)m
 (ould)e(indicate)g(that)i(the)f(\014rst)f(NULL)h(is)f(lo)s(cated)h(in)f
-(the)h(30th)227 1896 y(c)m(haracter)28 b(of)f(the)g(second)f(k)m(eyw)m
+(the)h(30th)227 1120 y(c)m(haracter)28 b(of)f(the)g(second)f(k)m(eyw)m
 (ord)h(in)e(the)i(header)f(\(recall)g(that)h(eac)m(h)h(header)e(record)
-h(is)e(80)i(c)m(haracters)227 2009 y(long\).)44 b(Note)33
+h(is)e(80)i(c)m(haracters)227 1233 y(long\).)44 b(Note)33
 b(that)f(this)f(is)f(one)i(of)g(the)g(few)f(CFITSIO)f(routines)g(in)h
 (whic)m(h)f(the)i(returned)e(v)-5 b(alue)31 b(is)g(not)227
-2122 y(necessarily)f(equal)f(to)j(the)e(status)h(v)-5
-b(alue\).)95 2381 y Ff(int)47 b(fits_null_check)d(/)j(ffnchk)g(\(char)f
-(*card,)g(>)h(int)g(*status\))0 2640 y Fi(6)81 b Fj(P)m(arse)25
+1346 y(necessarily)f(equal)f(to)j(the)e(status)h(v)-5
+b(alue\).)95 1597 y Fe(int)47 b(fits_null_check)d(/)j(ffnchk)g(\(char)f
+(*card,)g(>)h(int)g(*status\))0 1849 y Fi(8)81 b Fj(P)m(arse)25
 b(a)g(header)g(k)m(eyw)m(ord)g(record)g(and)f(return)g(the)h(name)g(of)
 g(the)g(k)m(eyw)m(ord,)i(and)d(the)h(length)g(of)g(the)g(name.)227
-2753 y(The)34 b(k)m(eyw)m(ord)h(name)f(normally)f(o)s(ccupies)g(the)i
+1962 y(The)34 b(k)m(eyw)m(ord)h(name)f(normally)f(o)s(ccupies)g(the)i
 (\014rst)e(8)i(c)m(haracters)g(of)g(the)f(record,)i(except)f(under)e
-(the)227 2866 y(HIERAR)m(CH)e(con)m(v)m(en)m(tion)g(where)f(the)h(name)
+(the)227 2075 y(HIERAR)m(CH)e(con)m(v)m(en)m(tion)g(where)f(the)h(name)
 f(can)h(b)s(e)f(up)f(to)i(70)g(c)m(haracters)h(in)d(length.)95
-3124 y Ff(int)47 b(fits_get_keyname)d(/)j(ffgknm)286
-3237 y(\(char)g(*card,)f(>)h(char)g(*keyname,)e(int)i(*keylength,)e
-(int)i(*status\))0 3496 y Fi(7)81 b Fj(P)m(arse)29 b(a)h(header)f(k)m
+2326 y Fe(int)47 b(fits_get_keyname)d(/)j(ffgknm)286
+2439 y(\(char)g(*card,)f(>)h(char)g(*keyname,)e(int)i(*keylength,)e
+(int)i(*status\))0 2691 y Fi(9)81 b Fj(P)m(arse)29 b(a)h(header)f(k)m
 (eyw)m(ord)h(record,)f(returning)f(the)h(v)-5 b(alue)29
 b(\(as)h(a)f(literal)f(c)m(haracter)j(string\))d(and)h(commen)m(t)227
-3609 y(strings.)39 b(If)27 b(the)g(k)m(eyw)m(ord)h(has)f(no)g(v)-5
+2804 y(strings.)39 b(If)27 b(the)g(k)m(eyw)m(ord)h(has)f(no)g(v)-5
 b(alue)27 b(\(columns)f(9-10)j(not)f(equal)e(to)i('=)g('\),)g(then)f(a)
-h(n)m(ull)d(v)-5 b(alue)27 b(string)227 3722 y(is)j(returned)f(and)h
+h(n)m(ull)d(v)-5 b(alue)27 b(string)227 2916 y(is)j(returned)f(and)h
 (the)g(commen)m(t)i(string)d(is)g(set)i(equal)f(to)h(column)e(9)i(-)g
-(80)g(of)g(the)f(input)f(string.)95 3981 y Ff(int)47
-b(fits_parse_value)d(/)j(ffpsvc)286 4094 y(\(char)g(*card,)f(>)h(char)g
-(*value,)f(char)g(*comment,)g(int)h(*status\))0 4353
-y Fi(8)81 b Fj(Construct)27 b(an)h(arra)m(y)g(indexed)f(k)m(eyw)m(ord)h
-(name)g(\(R)m(OOT)g(+)f(nnn\).)39 b(This)26 b(routine)h(app)s(ends)f
-(the)j(sequence)227 4466 y(n)m(um)m(b)s(er)g(to)i(the)g(ro)s(ot)g
+(80)g(of)g(the)f(input)f(string.)95 3168 y Fe(int)47
+b(fits_parse_value)d(/)j(ffpsvc)286 3281 y(\(char)g(*card,)f(>)h(char)g
+(*value,)f(char)g(*comment,)g(int)h(*status\))0 3533
+y Fi(10)f Fj(Construct)26 b(an)h(arra)m(y)g(indexed)e(k)m(eyw)m(ord)i
+(name)f(\(R)m(OOT)g(+)h(nnn\).)38 b(This)25 b(routine)g(app)s(ends)g
+(the)i(sequence)227 3645 y(n)m(um)m(b)s(er)i(to)i(the)g(ro)s(ot)g
 (string)e(to)i(create)h(a)f(k)m(eyw)m(ord)g(name)f(\(e.g.,)i('NAXIS')f
-(+)f(2)h(=)f('NAXIS2'\))95 4724 y Ff(int)47 b(fits_make_keyn)d(/)k
-(ffkeyn)286 4837 y(\(char)f(*keyroot,)e(int)i(value,)f(>)h(char)g
-(*keyname,)e(int)i(*status\))0 5096 y Fi(9)81 b Fj(Construct)42
-b(a)h(sequence)g(k)m(eyw)m(ord)h(name)f(\(n)f(+)h(R)m(OOT\).)f(This)f
-(routine)h(concatenates)k(the)d(sequence)227 5209 y(n)m(um)m(b)s(er)20
+(+)f(2)h(=)f('NAXIS2'\))95 3897 y Fe(int)47 b(fits_make_keyn)d(/)k
+(ffkeyn)286 4010 y(\(char)f(*keyroot,)e(int)i(value,)f(>)h(char)g
+(*keyname,)e(int)i(*status\))0 4261 y Fi(11)f Fj(Construct)41
+b(a)h(sequence)f(k)m(eyw)m(ord)h(name)g(\(n)f(+)g(R)m(OOT\).)g(This)f
+(routine)g(concatenates)k(the)e(sequence)227 4374 y(n)m(um)m(b)s(er)20
 b(to)j(the)e(fron)m(t)h(of)g(the)f(ro)s(ot)h(string)f(to)h(create)h(a)f
 (k)m(eyw)m(ord)g(name)g(\(e.g.,)j(1)d(+)f('CTYP')g(=)g('1CTYP'\))95
-5581 y Ff(int)47 b(fits_make_nkey)d(/)k(ffnkey)286 5694
+4739 y Fe(int)47 b(fits_make_nkey)d(/)k(ffnkey)286 4852
 y(\(int)f(value,)f(char)h(*keyroot,)e(>)i(char)g(*keyname,)e(int)i
-(*status\))p eop
-%%Page: 100 106
-100 105 bop 0 299 a Fj(100)1294 b Fh(CHAPTER)30 b(7.)111
+(*status\))0 5103 y Fi(12)f Fj(Determine)40 b(the)h(data)f(t)m(yp)s(e)h
+(of)f(a)h(k)m(eyw)m(ord)f(v)-5 b(alue)40 b(string.)69
+b(This)38 b(routine)i(parses)f(the)i(k)m(eyw)m(ord)f(v)-5
+b(alue)227 5216 y(string)27 b(to)i(determine)e(its)g(data)i(t)m(yp)s
+(e.)40 b(Returns)27 b('C',)h('L',)h('I',)f('F')h(or)f('X',)g(for)g(c)m
+(haracter)i(string,)d(logical,)227 5329 y(in)m(teger,)k(\015oating)g(p)
+s(oin)m(t,)e(or)i(complex,)f(resp)s(ectiv)m(ely)-8 b(.)95
+5581 y Fe(int)47 b(fits_get_keytype)d(/)j(ffdtyp)286
+5694 y(\(char)g(*value,)f(>)h(char)g(*dtype,)e(int)i(*status\))p
+eop
+%%Page: 58 66
+58 65 bop 0 299 a Fj(58)1379 b Fh(CHAPTER)30 b(5.)71
 b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(10)46 b Fj(Determine)25 b(the)g(datat)m(yp)s(e)h(of)f(a)h(k)m
-(eyw)m(ord)f(v)-5 b(alue)25 b(string.)38 b(This)23 b(routine)h(parses)h
-(the)g(k)m(eyw)m(ord)g(v)-5 b(alue)25 b(string)227 668
-y(to)h(determine)e(its)h(datat)m(yp)s(e.)39 b(Returns)25
-b('C',)g('L',)h('I',)f('F')h(or)f('X',)h(for)f(c)m(haracter)h(string,)f
-(logical,)h(in)m(teger,)227 781 y(\015oating)31 b(p)s(oin)m(t,)e(or)i
-(complex,)f(resp)s(ectiv)m(ely)-8 b(.)95 1054 y Ff(int)47
-b(fits_get_keytype)d(/)j(ffdtyp)286 1167 y(\(char)g(*value,)f(>)h(char)
-g(*dtype,)e(int)i(*status\))0 1441 y Fi(11)f Fj(Return)c(the)i(class)f
-(of)g(input)e(header)i(record.)79 b(The)43 b(record)g(is)f
-(classi\014ed)f(in)m(to)i(one)h(of)f(the)g(follo)m(wing)227
-1554 y(catagories)31 b(\(the)e(class)g(v)-5 b(alues)28
-b(are)i(de\014ned)d(in)h(\014tsio.h\).)40 b(Note)30 b(that)f(this)f(is)
-g(one)i(of)f(the)g(few)f(CFITSIO)227 1667 y(routines)i(that)g(do)s(es)h
-(not)f(return)f(a)i(status)g(v)-5 b(alue.)334 1940 y
-Ff(Class)94 b(Value)619 b(Keywords)95 2053 y(TYP_STRUC_KEY)92
-b(10)j(SIMPLE,)46 b(BITPIX,)g(NAXIS,)g(NAXISn,)g(EXTEND,)g(BLOCKED,)
-1002 2166 y(GROUPS,)g(PCOUNT,)g(GCOUNT,)g(END)1002 2279
-y(XTENSION,)g(TFIELDS,)f(TTYPEn,)h(TBCOLn,)g(TFORMn,)g(THEAP,)1002
-2392 y(and)h(the)g(first)f(4)i(COMMENT)e(keywords)f(in)i(the)g(primary)
-f(array)1002 2505 y(that)h(define)f(the)h(FITS)g(format.)95
-2618 y(TYP_CMPRS_KEY)92 b(20)j(The)47 b(experimental)e(keywords)g(used)
-i(in)g(the)g(compressed)1002 2731 y(image)g(format)f(ZIMAGE,)g
-(ZCMPTYPE,)f(ZNAMEn,)h(ZVALn,)1002 2843 y(ZTILEn,)g(ZBITPIX,)g
-(ZNAXISn,)f(ZSCALE,)h(ZZERO,)g(ZBLANK)95 2956 y(TYP_SCAL_KEY)140
-b(30)95 b(BSCALE,)46 b(BZERO,)g(TSCALn,)g(TZEROn)95 3069
-y(TYP_NULL_KEY)140 b(40)95 b(BLANK,)46 b(TNULLn)95 3182
-y(TYP_DIM_KEY)188 b(50)95 b(TDIMn)95 3295 y(TYP_RANG_KEY)140
+555 y Fi(13)46 b Fj(Return)35 b(the)g(class)g(of)h(an)f(input)f(header)
+h(record.)56 b(The)35 b(record)g(is)f(classi\014ed)g(in)m(to)i(one)f
+(of)h(the)f(follo)m(wing)227 668 y(categories)c(\(the)f(class)f(v)-5
+b(alues)29 b(are)g(de\014ned)f(in)g(\014tsio.h\).)40
+b(Note)31 b(that)f(this)e(is)g(one)i(of)f(the)g(few)g(CFITSIO)227
+781 y(routines)h(that)g(do)s(es)h(not)f(return)f(a)i(status)g(v)-5
+b(alue.)334 998 y Fe(Class)94 b(Value)619 b(Keywords)95
+1111 y(TYP_STRUC_KEY)92 b(10)j(SIMPLE,)46 b(BITPIX,)g(NAXIS,)g(NAXISn,)
+g(EXTEND,)g(BLOCKED,)1002 1224 y(GROUPS,)g(PCOUNT,)g(GCOUNT,)g(END)1002
+1337 y(XTENSION,)g(TFIELDS,)f(TTYPEn,)h(TBCOLn,)g(TFORMn,)g(THEAP,)1002
+1450 y(and)h(the)g(first)f(4)i(COMMENT)e(keywords)f(in)i(the)g(primary)
+f(array)1002 1563 y(that)h(define)f(the)h(FITS)g(format.)95
+1676 y(TYP_CMPRS_KEY)92 b(20)j(The)47 b(experimental)e(keywords)g(used)
+i(in)g(the)g(compressed)1002 1788 y(image)g(format)f(ZIMAGE,)g
+(ZCMPTYPE,)f(ZNAMEn,)h(ZVALn,)1002 1901 y(ZTILEn,)g(ZBITPIX,)g
+(ZNAXISn,)f(ZSCALE,)h(ZZERO,)g(ZBLANK)95 2014 y(TYP_SCAL_KEY)140
+b(30)95 b(BSCALE,)46 b(BZERO,)g(TSCALn,)g(TZEROn)95 2127
+y(TYP_NULL_KEY)140 b(40)95 b(BLANK,)46 b(TNULLn)95 2240
+y(TYP_DIM_KEY)188 b(50)95 b(TDIMn)95 2353 y(TYP_RANG_KEY)140
 b(60)95 b(TLMINn,)46 b(TLMAXn,)g(TDMINn,)g(TDMAXn,)g(DATAMIN,)f
-(DATAMAX)95 3408 y(TYP_UNIT_KEY)140 b(70)95 b(BUNIT,)46
-b(TUNITn)95 3521 y(TYP_DISP_KEY)140 b(80)95 b(TDISPn)95
-3634 y(TYP_HDUID_KEY)d(90)j(EXTNAME,)46 b(EXTVER,)g(EXTLEVEL,)f
-(HDUNAME,)g(HDUVER,)h(HDULEVEL)95 3747 y(TYP_CKSUM_KEY)f(100)94
-b(CHECKSUM,)46 b(DATASUM)95 3860 y(TYP_WCS_KEY)141 b(110)94
+(DATAMAX)95 2466 y(TYP_UNIT_KEY)140 b(70)95 b(BUNIT,)46
+b(TUNITn)95 2579 y(TYP_DISP_KEY)140 b(80)95 b(TDISPn)95
+2692 y(TYP_HDUID_KEY)d(90)j(EXTNAME,)46 b(EXTVER,)g(EXTLEVEL,)f
+(HDUNAME,)g(HDUVER,)h(HDULEVEL)95 2805 y(TYP_CKSUM_KEY)f(100)94
+b(CHECKSUM,)46 b(DATASUM)95 2918 y(TYP_WCS_KEY)141 b(110)94
 b(CTYPEn,)46 b(CUNITn,)g(CRVALn,)g(CRPIXn,)g(CROTAn,)f(CDELTn)1002
-3973 y(CDj_is,)h(PVj_ms,)g(LONPOLEs,)f(LATPOLEs)1002
-4085 y(TCTYPn,)h(TCTYns,)g(TCUNIn,)g(TCUNns,)g(TCRVLn,)f(TCRVns,)h
-(TCRPXn,)1002 4198 y(TCRPks,)g(TCDn_k,)g(TCn_ks,)g(TPVn_m,)g(TPn_ms,)f
-(TCDLTn,)h(TCROTn)1002 4311 y(jCTYPn,)g(jCTYns,)g(jCUNIn,)g(jCUNns,)g
-(jCRVLn,)f(jCRVns,)h(iCRPXn,)1002 4424 y(iCRPns,)g(jiCDn,)94
+3030 y(CDj_is,)h(PVj_ms,)g(LONPOLEs,)f(LATPOLEs)1002
+3143 y(TCTYPn,)h(TCTYns,)g(TCUNIn,)g(TCUNns,)g(TCRVLn,)f(TCRVns,)h
+(TCRPXn,)1002 3256 y(TCRPks,)g(TCDn_k,)g(TCn_ks,)g(TPVn_m,)g(TPn_ms,)f
+(TCDLTn,)h(TCROTn)1002 3369 y(jCTYPn,)g(jCTYns,)g(jCUNIn,)g(jCUNns,)g
+(jCRVLn,)f(jCRVns,)h(iCRPXn,)1002 3482 y(iCRPns,)g(jiCDn,)94
 b(jiCDns,)46 b(jPVn_m,)g(jPn_ms,)f(jCDLTn,)h(jCROTn)1002
-4537 y(\(i,j,m,n)g(are)h(integers,)e(s)i(is)h(any)f(letter\))95
-4650 y(TYP_REFSYS_KEY)d(120)j(EQUINOXs,)f(EPOCH,)g(MJD-OBSs,)f
-(RADECSYS,)g(RADESYSs)95 4763 y(TYP_COMM_KEY)140 b(130)47
-b(COMMENT,)f(HISTORY,)f(\(blank)h(keyword\))95 4876 y(TYP_CONT_KEY)140
-b(140)47 b(CONTINUE)95 4989 y(TYP_USER_KEY)140 b(150)47
-b(all)g(other)g(keywords)95 5215 y(int)g(fits_get_keyclass)c(/)48
-b(ffgkcl)e(\(char)g(*card\))0 5488 y Fi(12)g Fj(P)m(arse)28
+3595 y(\(i,j,m,n)g(are)h(integers,)e(s)i(is)h(any)f(letter\))95
+3708 y(TYP_REFSYS_KEY)d(120)j(EQUINOXs,)f(EPOCH,)g(MJD-OBSs,)f
+(RADECSYS,)g(RADESYSs)95 3821 y(TYP_COMM_KEY)140 b(130)47
+b(COMMENT,)f(HISTORY,)f(\(blank)h(keyword\))95 3934 y(TYP_CONT_KEY)140
+b(140)47 b(CONTINUE)95 4047 y(TYP_USER_KEY)140 b(150)47
+b(all)g(other)g(keywords)95 4272 y(int)g(fits_get_keyclass)c(/)48
+b(ffgkcl)e(\(char)g(*card\))0 4489 y Fi(14)g Fj(P)m(arse)28
 b(the)g('TF)m(ORM')g(binary)e(table)h(column)g(format)g(string.)39
 b(This)26 b(routine)g(parses)h(the)h(input)e(TF)m(ORM)227
-5601 y(c)m(haracter)40 b(string)d(and)g(returns)g(the)i(in)m(teger)f
-(datat)m(yp)s(e)h(co)s(de,)i(the)d(rep)s(eat)g(coun)m(t)h(of)f(the)g
-(\014eld,)h(and,)227 5714 y(in)34 b(the)g(case)i(of)f(c)m(haracter)h
+4602 y(c)m(haracter)38 b(string)c(and)h(returns)g(the)g(in)m(teger)h
+(data)h(t)m(yp)s(e)f(co)s(de,)h(the)f(rep)s(eat)g(coun)m(t)g(of)g(the)f
+(\014eld,)h(and,)227 4715 y(in)e(the)g(case)i(of)f(c)m(haracter)h
 (string)e(\014elds,)g(the)h(length)f(of)h(the)g(unit)e(string.)53
-b(See)34 b(App)s(endix)e(B)j(for)g(the)p eop
-%%Page: 101 107
-101 106 bop 0 299 a Fh(7.13.)113 b(GENERAL)30 b(UTILITY)g(R)m(OUTINES)
-2077 b Fj(101)227 555 y(allo)m(w)m(ed)39 b(v)-5 b(alues)37
-b(for)i(the)f(returned)g(t)m(yp)s(eco)s(de)h(parameter.)65
+b(See)34 b(App)s(endix)e(B)j(for)g(the)227 4828 y(allo)m(w)m(ed)k(v)-5
+b(alues)37 b(for)i(the)f(returned)g(t)m(yp)s(eco)s(de)h(parameter.)65
 b(A)39 b(n)m(ull)d(p)s(oin)m(ter)i(ma)m(y)h(b)s(e)f(giv)m(en)g(for)h
-(an)m(y)227 668 y(output)30 b(parameters)h(that)g(are)g(not)f(needed.)
-143 918 y Ff(int)47 b(fits_binary_tform)c(/)48 b(ffbnfm)334
-1031 y(\(char)e(*tform,)g(>)i(int)f(*typecode,)e(long)h(*repeat,)g
-(long)g(*width,)382 1144 y(int)h(*status\))0 1393 y Fi(13)f
+(an)m(y)227 4941 y(output)30 b(parameters)h(that)g(are)g(not)f(needed.)
+143 5158 y Fe(int)47 b(fits_binary_tform)c(/)48 b(ffbnfm)334
+5271 y(\(char)e(*tform,)g(>)i(int)f(*typecode,)e(long)h(*repeat,)g
+(long)g(*width,)382 5384 y(int)h(*status\))0 5601 y Fi(15)f
 Fj(P)m(arse)38 b(the)f('TF)m(ORM')h(k)m(eyw)m(ord)g(v)-5
 b(alue)36 b(that)i(de\014nes)e(the)h(column)f(format)i(in)d(an)i(ASCI)s
-(I)f(table.)61 b(This)227 1506 y(routine)30 b(parses)h(the)g(input)f
-(TF)m(ORM)h(c)m(haracter)i(string)d(and)g(returns)g(the)i(datat)m(yp)s
-(e)g(co)s(de,)f(the)h(width)227 1619 y(of)c(the)f(column,)g(and)g(\(if)
-g(it)g(is)f(a)i(\015oating)f(p)s(oin)m(t)g(column\))f(the)i(n)m(um)m(b)
-s(er)e(of)h(decimal)g(places)g(to)h(the)f(righ)m(t)227
-1732 y(of)i(the)f(decimal)f(p)s(oin)m(t.)39 b(The)27
-b(returned)g(datat)m(yp)s(e)i(co)s(des)f(are)h(the)f(same)h(as)f(for)g
-(the)g(binary)f(table,)h(with)227 1845 y(the)j(follo)m(wing)e
-(additional)f(rules:)39 b(in)m(teger)31 b(columns)e(that)i(are)g(b)s
-(et)m(w)m(een)g(1)g(and)f(4)h(c)m(haracters)g(wide)f(are)227
-1958 y(de\014ned)39 b(to)i(b)s(e)f(short)g(in)m(tegers)g(\(co)s(de)h(=)
-f(TSHOR)-8 b(T\).)40 b(Wider)f(in)m(teger)i(columns)e(are)i(de\014ned)e
-(to)i(b)s(e)227 2071 y(regular)d(in)m(tegers)g(\(co)s(de)h(=)f
-(TLONG\).)h(Similarly)-8 b(,)37 b(Fixed)h(decimal)f(p)s(oin)m(t)g
-(columns)g(\(with)h(TF)m(ORM)227 2184 y(=)d('Fw.d'\))g(are)h(de\014ned)
-d(to)j(b)s(e)e(single)g(precision)f(reals)i(\(co)s(de)g(=)g(TFLO)m(A)-8
-b(T\))35 b(if)f(w)h(is)f(b)s(et)m(w)m(een)h(1)h(and)227
-2297 y(7)42 b(c)m(haracters)h(wide,)g(inclusiv)m(e.)72
-b(Wider)40 b('F')i(columns)e(will)f(return)h(a)i(double)e(precision)g
-(data)i(co)s(de)227 2409 y(\(=)32 b(TDOUBLE\).)h('Ew.d')f(format)g
-(columns)f(will)e(ha)m(v)m(e)34 b(dataco)s(de)f(=)e(TFLO)m(A)-8
-b(T,)33 b(and)e('Dw.d')i(format)227 2522 y(columns)44
-b(will)f(ha)m(v)m(e)k(dataco)s(de)f(=)f(TDOUBLE.)g(A)h(n)m(ull)d(p)s
-(oin)m(ter)i(ma)m(y)g(b)s(e)g(giv)m(en)h(for)f(an)m(y)g(output)227
-2635 y(parameters)31 b(that)g(are)g(not)f(needed.)95
-2885 y Ff(int)47 b(fits_ascii_tform)d(/)j(ffasfm)286
-2998 y(\(char)g(*tform,)f(>)h(int)g(*typecode,)e(long)i(*width,)e(int)i
-(*decimals,)334 3111 y(int)g(*status\))0 3360 y Fi(14)f
-Fj(Calculate)30 b(the)h(starting)f(column)g(p)s(ositions)e(and)i(total)
-h(ASCI)s(I)e(table)i(width)d(based)j(on)f(the)h(input)d(arra)m(y)227
-3473 y(of)f(ASCI)s(I)e(table)h(TF)m(ORM)h(v)-5 b(alues.)39
-b(The)26 b(SP)-8 b(A)m(CE)27 b(input)d(parameter)j(de\014nes)f(ho)m(w)h
-(man)m(y)f(blank)g(spaces)227 3586 y(to)40 b(lea)m(v)m(e)h(b)s(et)m(w)m
-(een)f(eac)m(h)g(column)f(\(it)g(is)f(recommended)h(to)h(ha)m(v)m(e)h
-(one)e(space)h(b)s(et)m(w)m(een)g(columns)e(for)227 3699
-y(b)s(etter)31 b(h)m(uman)e(readabilit)m(y\).)95 3949
-y Ff(int)47 b(fits_get_tbcol)d(/)k(ffgabc)286 4062 y(\(int)f(tfields,)f
-(char)g(**tform,)g(int)h(space,)f(>)h(long)g(*rowlen,)334
-4175 y(long)g(*tbcol,)f(int)g(*status\))0 4424 y Fi(15)g
-Fj(P)m(arse)27 b(a)g(template)g(header)f(record)g(and)g(return)g(a)g
-(formatted)h(80-c)m(haracter)j(string)25 b(suitable)g(for)h(app)s(end-)
-227 4537 y(ing)39 b(to)g(\(or)h(deleting)e(from\))h(a)g(FITS)g(header)g
-(\014le.)66 b(This)37 b(routine)h(is)g(useful)g(for)g(parsing)g(lines)f
-(from)227 4650 y(an)c(ASCI)s(I)f(template)h(\014le)f(and)h
-(reformatting)g(them)g(in)m(to)g(legal)g(FITS)f(header)h(records.)49
-b(The)32 b(format-)227 4763 y(ted)i(string)f(ma)m(y)h(then)f(b)s(e)g
-(passed)h(to)g(the)g(\014ts)p 1880 4763 28 4 v 32 w(write)p
-2115 4763 V 32 w(record,)h(\013mcrd,)f(or)g(\014ts)p
-3007 4763 V 32 w(delete)p 3271 4763 V 33 w(k)m(ey)h(routines)d(to)227
-4876 y(app)s(end)d(or)h(mo)s(dify)f(a)i(FITS)e(header)h(record.)95
-5125 y Ff(int)47 b(fits_parse_template)c(/)k(ffgthd)286
-5238 y(\(char)g(*templt,)e(>)j(char)e(*card,)g(int)h(*keytype,)f(int)h
-(*status\))0 5488 y Fj(The)31 b(input)f(templt)h(c)m(haracter)i(string)
-e(generally)g(should)e(con)m(tain)j(3)g(tok)m(ens:)44
-b(\(1\))33 b(the)f(KEYNAME,)g(\(2\))h(the)0 5601 y(V)-10
+(I)f(table.)61 b(This)227 5714 y(routine)28 b(parses)h(the)g(input)e
+(TF)m(ORM)i(c)m(haracter)h(string)e(and)h(returns)e(the)i(data)h(t)m
+(yp)s(e)f(co)s(de,)h(the)f(width)p eop
+%%Page: 59 67
+59 66 bop 0 299 a Fh(5.8.)72 b(UTILITY)30 b(R)m(OUTINES)2693
+b Fj(59)227 555 y(of)28 b(the)f(column,)g(and)g(\(if)g(it)g(is)f(a)i
+(\015oating)f(p)s(oin)m(t)g(column\))f(the)i(n)m(um)m(b)s(er)e(of)h
+(decimal)g(places)g(to)h(the)f(righ)m(t)227 668 y(of)39
+b(the)f(decimal)f(p)s(oin)m(t.)64 b(The)38 b(returned)f(data)i(t)m(yp)s
+(e)f(co)s(des)g(are)h(the)g(same)f(as)h(for)f(the)g(binary)f(table,)227
+781 y(with)25 b(the)i(follo)m(wing)e(additional)f(rules:)37
+b(in)m(teger)27 b(columns)e(that)i(are)f(b)s(et)m(w)m(een)h(1)g(and)f
+(4)g(c)m(haracters)i(wide)227 894 y(are)i(de\014ned)e(to)j(b)s(e)d
+(short)i(in)m(tegers)f(\(co)s(de)h(=)g(TSHOR)-8 b(T\).)29
+b(Wider)f(in)m(teger)i(columns)e(are)i(de\014ned)e(to)j(b)s(e)227
+1007 y(regular)38 b(in)m(tegers)g(\(co)s(de)h(=)f(TLONG\).)h(Similarly)
+-8 b(,)37 b(Fixed)h(decimal)f(p)s(oin)m(t)g(columns)g(\(with)h(TF)m
+(ORM)227 1120 y(=)d('Fw.d'\))g(are)h(de\014ned)d(to)j(b)s(e)e(single)g
+(precision)f(reals)i(\(co)s(de)g(=)g(TFLO)m(A)-8 b(T\))35
+b(if)f(w)h(is)f(b)s(et)m(w)m(een)h(1)h(and)227 1233 y(7)42
+b(c)m(haracters)h(wide,)g(inclusiv)m(e.)72 b(Wider)40
+b('F')i(columns)e(will)f(return)h(a)i(double)e(precision)g(data)i(co)s
+(de)227 1346 y(\(=)32 b(TDOUBLE\).)h('Ew.d')f(format)g(columns)f(will)e
+(ha)m(v)m(e)34 b(dataco)s(de)f(=)e(TFLO)m(A)-8 b(T,)33
+b(and)e('Dw.d')i(format)227 1458 y(columns)44 b(will)f(ha)m(v)m(e)k
+(dataco)s(de)f(=)f(TDOUBLE.)g(A)h(n)m(ull)d(p)s(oin)m(ter)i(ma)m(y)g(b)
+s(e)g(giv)m(en)h(for)f(an)m(y)g(output)227 1571 y(parameters)31
+b(that)g(are)g(not)f(needed.)95 1821 y Fe(int)47 b(fits_ascii_tform)d
+(/)j(ffasfm)286 1934 y(\(char)g(*tform,)f(>)h(int)g(*typecode,)e(long)i
+(*width,)e(int)i(*decimals,)334 2047 y(int)g(*status\))0
+2297 y Fi(16)f Fj(Calculate)30 b(the)h(starting)f(column)g(p)s
+(ositions)e(and)i(total)h(ASCI)s(I)e(table)i(width)d(based)j(on)f(the)h
+(input)d(arra)m(y)227 2409 y(of)f(ASCI)s(I)e(table)h(TF)m(ORM)h(v)-5
+b(alues.)39 b(The)26 b(SP)-8 b(A)m(CE)27 b(input)d(parameter)j
+(de\014nes)f(ho)m(w)h(man)m(y)f(blank)g(spaces)227 2522
+y(to)40 b(lea)m(v)m(e)h(b)s(et)m(w)m(een)f(eac)m(h)g(column)f(\(it)g
+(is)f(recommended)h(to)h(ha)m(v)m(e)h(one)e(space)h(b)s(et)m(w)m(een)g
+(columns)e(for)227 2635 y(b)s(etter)31 b(h)m(uman)e(readabilit)m(y\).)
+95 2885 y Fe(int)47 b(fits_get_tbcol)d(/)k(ffgabc)286
+2998 y(\(int)f(tfields,)f(char)g(**tform,)g(int)h(space,)f(>)h(long)g
+(*rowlen,)334 3111 y(long)g(*tbcol,)f(int)g(*status\))0
+3360 y Fi(17)g Fj(P)m(arse)27 b(a)g(template)g(header)f(record)g(and)g
+(return)g(a)g(formatted)h(80-c)m(haracter)j(string)25
+b(suitable)g(for)h(app)s(end-)227 3473 y(ing)39 b(to)g(\(or)h(deleting)
+e(from\))h(a)g(FITS)g(header)g(\014le.)66 b(This)37 b(routine)h(is)g
+(useful)g(for)g(parsing)g(lines)f(from)227 3586 y(an)c(ASCI)s(I)f
+(template)h(\014le)f(and)h(reformatting)g(them)g(in)m(to)g(legal)g
+(FITS)f(header)h(records.)49 b(The)32 b(format-)227 3699
+y(ted)i(string)f(ma)m(y)h(then)f(b)s(e)g(passed)h(to)g(the)g(\014ts)p
+1880 3699 28 4 v 32 w(write)p 2115 3699 V 32 w(record,)h(\013mcrd,)f
+(or)g(\014ts)p 3007 3699 V 32 w(delete)p 3271 3699 V
+33 w(k)m(ey)h(routines)d(to)227 3812 y(app)s(end)d(or)h(mo)s(dify)f(a)i
+(FITS)e(header)h(record.)95 4062 y Fe(int)47 b(fits_parse_template)c(/)
+k(ffgthd)286 4175 y(\(char)g(*templt,)e(>)j(char)e(*card,)g(int)h
+(*keytype,)f(int)h(*status\))0 4424 y Fj(The)31 b(input)f(templt)h(c)m
+(haracter)i(string)e(generally)g(should)e(con)m(tain)j(3)g(tok)m(ens:)
+44 b(\(1\))33 b(the)f(KEYNAME,)g(\(2\))h(the)0 4537 y(V)-10
 b(ALUE,)37 b(and)f(\(3\))i(the)f(COMMENT)g(string.)58
 b(The)37 b(TEMPLA)-8 b(TE)36 b(string)g(m)m(ust)g(adhere)h(to)h(the)e
-(follo)m(wing)0 5714 y(format:)p eop
-%%Page: 102 108
-102 107 bop 0 299 a Fj(102)1294 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(-)80 b Fj(The)32 b(KEYNAME)h(tok)m(en)h(m)m(ust)f(b)s(egin)e
-(in)h(columns)f(1-8)j(and)e(b)s(e)g(a)h(maxim)m(um)f(of)h(8)g(c)m
-(haracters)h(long.)48 b(A)227 668 y(legal)28 b(FITS)g(k)m(eyw)m(ord)h
-(name)f(ma)m(y)h(only)e(con)m(tain)i(the)g(c)m(haracters)g(A-Z,)g(0-9,)
-h(and)e('-')h(\(min)m(us)e(sign\))h(and)227 781 y(underscore.)40
-b(This)26 b(routine)i(will)e(automatically)i(con)m(v)m(ert)i(an)m(y)f
-(lo)m(w)m(ercase)h(c)m(haracters)g(to)g(upp)s(ercase)d(in)227
-894 y(the)k(output)f(string.)41 b(If)30 b(the)h(\014rst)f(8)h(c)m
+(follo)m(wing)0 4650 y(format:)0 4900 y Fi(-)80 b Fj(The)32
+b(KEYNAME)h(tok)m(en)h(m)m(ust)f(b)s(egin)e(in)h(columns)f(1-8)j(and)e
+(b)s(e)g(a)h(maxim)m(um)f(of)h(8)g(c)m(haracters)h(long.)48
+b(A)227 5013 y(legal)28 b(FITS)g(k)m(eyw)m(ord)h(name)f(ma)m(y)h(only)e
+(con)m(tain)i(the)g(c)m(haracters)g(A-Z,)g(0-9,)h(and)e('-')h(\(min)m
+(us)e(sign\))h(and)227 5125 y(underscore.)40 b(This)26
+b(routine)i(will)e(automatically)i(con)m(v)m(ert)i(an)m(y)f(lo)m(w)m
+(ercase)h(c)m(haracters)g(to)g(upp)s(ercase)d(in)227
+5238 y(the)k(output)f(string.)41 b(If)30 b(the)h(\014rst)f(8)h(c)m
 (haracters)h(of)f(the)g(template)g(line)e(are)i(blank)e(then)i(the)g
-(remainder)227 1007 y(of)g(the)f(line)f(is)h(considered)f(to)i(b)s(e)f
+(remainder)227 5351 y(of)g(the)f(line)f(is)h(considered)f(to)i(b)s(e)f
 (a)g(FITS)g(commen)m(t)h(\(with)f(a)h(blank)e(k)m(eyw)m(ord)h(name\).)0
-1244 y Fi(-)80 b Fj(The)26 b(V)-10 b(ALUE)26 b(tok)m(en)h(m)m(ust)e(b)s
+5601 y Fi(-)80 b Fj(The)26 b(V)-10 b(ALUE)26 b(tok)m(en)h(m)m(ust)e(b)s
 (e)h(separated)g(from)f(the)i(KEYNAME)f(tok)m(en)h(b)m(y)f(one)g(or)g
-(more)g(spaces)g(and/or)227 1357 y(an)i('=')g(c)m(haracter.)41
-b(The)27 b(datat)m(yp)s(e)i(of)f(the)g(V)-10 b(ALUE)27
-b(tok)m(en)i(\(n)m(umeric,)f(logical,)g(or)g(c)m(haracter)h(string\))e
-(is)227 1470 y(automatically)32 b(determined)e(and)i(the)g(output)f
-(CARD)h(string)f(is)g(formatted)h(accordingly)-8 b(.)45
-b(The)31 b(v)-5 b(alue)227 1582 y(tok)m(en)34 b(ma)m(y)f(b)s(e)f
-(forced)g(to)i(b)s(e)e(in)m(terpreted)f(as)i(a)g(string)f(\(e.g.)48
-b(if)32 b(it)g(is)f(a)i(string)f(of)g(n)m(umeric)g(digits\))f(b)m(y)227
-1695 y(enclosing)f(it)g(in)f(single)g(quotes.)0 1932
-y Fi(-)80 b Fj(The)28 b(COMMENT)g(tok)m(en)h(is)e(optional,)h(but)g(if)
-f(presen)m(t)h(m)m(ust)g(b)s(e)g(separated)g(from)g(the)g(V)-10
-b(ALUE)29 b(tok)m(en)g(b)m(y)227 2045 y(at)i(least)g(one)g(blank)e
-(space)i(and)e(a)i('/')g(c)m(haracter.)0 2282 y Fi(-)80
+(more)g(spaces)g(and/or)227 5714 y(an)g('=')g(c)m(haracter.)41
+b(The)25 b(data)h(t)m(yp)s(e)g(of)g(the)g(V)-10 b(ALUE)26
+b(tok)m(en)g(\(n)m(umeric,)g(logical,)h(or)f(c)m(haracter)h(string\))e
+(is)p eop
+%%Page: 60 68
+60 67 bop 0 299 a Fj(60)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
+555 y Fj(automatically)i(determined)e(and)i(the)g(output)f(CARD)h
+(string)f(is)g(formatted)h(accordingly)-8 b(.)45 b(The)31
+b(v)-5 b(alue)227 668 y(tok)m(en)34 b(ma)m(y)f(b)s(e)f(forced)g(to)i(b)
+s(e)e(in)m(terpreted)f(as)i(a)g(string)f(\(e.g.)48 b(if)32
+b(it)g(is)f(a)i(string)f(of)g(n)m(umeric)g(digits\))f(b)m(y)227
+781 y(enclosing)f(it)g(in)f(single)g(quotes.)0 1034 y
+Fi(-)80 b Fj(The)28 b(COMMENT)g(tok)m(en)h(is)e(optional,)h(but)g(if)f
+(presen)m(t)h(m)m(ust)g(b)s(e)g(separated)g(from)g(the)g(V)-10
+b(ALUE)29 b(tok)m(en)g(b)m(y)227 1147 y(at)i(least)g(one)g(blank)e
+(space)i(and)e(a)i('/')g(c)m(haracter.)0 1400 y Fi(-)80
 b Fj(One)29 b(exception)g(to)g(the)g(ab)s(o)m(v)m(e)i(rules)c(is)h
 (that)h(if)f(the)h(\014rst)g(non-blank)e(c)m(haracter)j(in)e(the)h
-(\014rst)f(8)h(c)m(haracters)227 2395 y(of)24 b(the)h(template)f
+(\014rst)f(8)h(c)m(haracters)227 1513 y(of)24 b(the)h(template)f
 (string)f(is)g(a)h(min)m(us)f(sign)g(\('-'\))i(follo)m(w)m(ed)f(b)m(y)g
 (a)g(single)f(tok)m(en,)j(or)e(a)h(single)d(tok)m(en)j(follo)m(w)m(ed)
-227 2508 y(b)m(y)k(an)g(equal)g(sign,)g(then)g(it)f(is)h(in)m
+227 1626 y(b)m(y)k(an)g(equal)g(sign,)g(then)g(it)f(is)h(in)m
 (terpreted)f(as)i(the)f(name)g(of)h(a)f(k)m(eyw)m(ord)h(whic)m(h)e(is)g
-(to)i(b)s(e)e(deleted)h(from)227 2621 y(the)i(FITS)e(header.)0
-2858 y Fi(-)80 b Fj(The)32 b(second)g(exception)g(is)f(that)i(if)e(the)
+(to)i(b)s(e)e(deleted)h(from)227 1739 y(the)i(FITS)e(header.)0
+1992 y Fi(-)80 b Fj(The)32 b(second)g(exception)g(is)f(that)i(if)e(the)
 h(template)g(string)f(starts)i(with)d(a)j(min)m(us)d(sign)h(and)g(is)g
-(follo)m(w)m(ed)h(b)m(y)227 2971 y(2)h(tok)m(ens)g(\(without)f(an)g
+(follo)m(w)m(ed)h(b)m(y)227 2105 y(2)h(tok)m(ens)g(\(without)f(an)g
 (equals)g(sign)g(b)s(et)m(w)m(een)h(them\))f(then)g(the)h(second)f(tok)
-m(en)i(is)d(in)m(terpreted)h(as)h(the)227 3084 y(new)f(name)h(for)f
+m(en)i(is)d(in)m(terpreted)h(as)h(the)227 2218 y(new)f(name)h(for)f
 (the)h(k)m(eyw)m(ord)g(sp)s(eci\014ed)e(b)m(y)i(\014rst)f(tok)m(en.)48
 b(In)32 b(this)f(case)j(the)f(old)f(k)m(eyw)m(ord)h(name)f(\(\014rst)
-227 3197 y(tok)m(en\))c(is)d(returned)f(in)h(c)m(haracters)i(1-8)g(of)g
+227 2331 y(tok)m(en\))c(is)d(returned)f(in)h(c)m(haracters)i(1-8)g(of)g
 (the)f(returned)e(CARD)j(string,)f(and)f(the)h(new)f(k)m(eyw)m(ord)i
-(name)227 3309 y(\(the)35 b(second)e(tok)m(en\))j(is)d(returned)f(in)h
+(name)227 2443 y(\(the)35 b(second)e(tok)m(en\))j(is)d(returned)f(in)h
 (c)m(haracters)i(41-48)h(of)e(the)g(returned)e(CARD)i(string.)50
-b(These)34 b(old)227 3422 y(and)i(new)f(names)h(ma)m(y)h(then)f(b)s(e)f
+b(These)34 b(old)227 2556 y(and)i(new)f(names)h(ma)m(y)h(then)f(b)s(e)f
 (passed)g(to)i(the)f(\013mnam)g(routine)f(whic)m(h)g(will)e(c)m(hange)k
-(the)f(k)m(eyw)m(ord)227 3535 y(name.)0 3772 y(The)30
+(the)f(k)m(eyw)m(ord)227 2669 y(name.)0 2922 y(The)30
 b(k)m(eyt)m(yp)s(e)h(output)f(parameter)h(indicates)e(ho)m(w)i(the)f
 (returned)g(CARD)g(string)f(should)g(b)s(e)g(in)m(terpreted:)382
-4009 y Ff(keytype)857 b(interpretation)382 4122 y(-------)475
+3175 y Fe(keytype)857 b(interpretation)382 3288 y(-------)475
 b(-------------------------)o(----)o(---)o(----)o(----)o(---)o(----)o
-(--)525 4235 y(-2)572 b(Rename)46 b(the)h(keyword)f(with)h(name)f(=)i
-(the)f(first)f(8)h(characters)e(of)j(CARD)1193 4348 y(to)f(the)g(new)g
+(--)525 3401 y(-2)572 b(Rename)46 b(the)h(keyword)f(with)h(name)f(=)i
+(the)f(first)f(8)h(characters)e(of)j(CARD)1193 3514 y(to)f(the)g(new)g
 (name)g(given)f(in)h(characters)e(41)j(-)f(48)g(of)g(CARD.)525
-4574 y(-1)572 b(delete)46 b(the)h(keyword)f(with)h(this)f(name)h(from)g
-(the)f(FITS)h(header.)573 4799 y(0)572 b(append)46 b(the)h(CARD)g
-(string)f(to)h(the)g(FITS)g(header)f(if)h(the)1193 4912
+3740 y(-1)572 b(delete)46 b(the)h(keyword)f(with)h(this)f(name)h(from)g
+(the)f(FITS)h(header.)573 3966 y(0)572 b(append)46 b(the)h(CARD)g
+(string)f(to)h(the)g(FITS)g(header)f(if)h(the)1193 4079
 y(keyword)f(does)h(not)g(already)e(exist,)h(otherwise)g(update)1193
-5025 y(the)h(keyword)f(value)g(and/or)g(comment)g(field)h(if)g(is)g
-(already)f(exists.)573 5251 y(1)572 b(This)47 b(is)g(a)g(HISTORY)f(or)h
+4192 y(the)h(keyword)f(value)g(and/or)g(comment)g(field)h(if)g(is)g
+(already)f(exists.)573 4417 y(1)572 b(This)47 b(is)g(a)g(HISTORY)f(or)h
 (COMMENT)f(keyword;)g(append)g(it)h(to)g(the)g(header)573
-5477 y(2)572 b(END)47 b(record;)f(do)h(not)g(explicitly)e(write)h(it)i
-(to)f(the)g(FITS)f(file.)0 5714 y Fj(EXAMPLES:)30 b(The)g(follo)m(wing)
-f(lines)f(illustrate)h(v)-5 b(alid)29 b(input)f(template)j(strings:)p
+4643 y(2)572 b(END)47 b(record;)f(do)h(not)g(explicitly)e(write)h(it)i
+(to)f(the)g(FITS)f(file.)0 4896 y Fj(EXAMPLES:)30 b(The)g(follo)m(wing)
+f(lines)f(illustrate)h(v)-5 b(alid)29 b(input)f(template)j(strings:)286
+5149 y Fe(INTVAL)46 b(7)i(/)f(This)g(is)g(an)g(integer)f(keyword)286
+5262 y(RVAL)524 b(34.6)142 b(/)239 b(This)46 b(is)i(a)f(floating)f
+(point)g(keyword)286 5375 y(EVAL=-12.45E-03)92 b(/)47
+b(This)g(is)g(a)g(floating)f(point)g(keyword)g(in)h(exponential)e
+(notation)286 5488 y(lval)i(F)g(/)h(This)f(is)g(a)g(boolean)f(keyword)
+859 5601 y(This)h(is)g(a)g(comment)f(keyword)g(with)h(a)g(blank)f
+(keyword)g(name)286 5714 y(SVAL1)h(=)g('Hello)f(world')142
+b(/)95 b(this)47 b(is)g(a)g(string)f(keyword)p eop
+%%Page: 61 69
+61 68 bop 0 299 a Fh(5.8.)72 b(UTILITY)30 b(R)m(OUTINES)2693
+b Fj(61)286 555 y Fe(SVAL2)94 b('123.5')g(this)47 b(is)g(also)f(a)i
+(string)e(keyword)286 668 y(sval3)94 b(123+)h(/)g(this)47
+b(is)g(also)f(a)i(string)e(keyword)g(with)g(the)h(value)g('123+)189
+b(')286 781 y(#)48 b(the)f(following)e(template)h(line)g(deletes)g(the)
+h(DATE)g(keyword)286 894 y(-)h(DATE)286 1007 y(#)g(the)f(following)e
+(template)h(line)g(modifies)g(the)h(NAME)f(keyword)g(to)h(OBJECT)286
+1120 y(-)h(NAME)e(OBJECT)0 1380 y Fi(18)g Fj(P)m(arse)35
+b(the)g(input)e(string)h(con)m(taining)g(a)h(list)f(of)h(ro)m(ws)f(or)h
+(ro)m(w)g(ranges,)h(and)e(return)g(in)m(teger)h(arra)m(ys)g(con-)227
+1492 y(taining)25 b(the)h(\014rst)f(and)g(last)h(ro)m(w)g(in)e(eac)m(h)
+j(range.)40 b(F)-8 b(or)26 b(example,)h(if)d(ro)m(wlist)h(=)g("3-5,)k
+(6,)e(8-9")h(then)d(it)h(will)227 1605 y(return)34 b(n)m(umranges)h(=)g
+(3,)h(rangemin)e(=)h(3,)i(6,)g(8)e(and)g(rangemax)g(=)g(5,)i(6,)g(9.)55
+b(A)m(t)36 b(most,)h('maxranges')227 1718 y(n)m(um)m(b)s(er)31
+b(of)h(ranges)f(will)e(b)s(e)j(returned.)43 b('maxro)m(ws')32
+b(is)f(the)h(maxim)m(um)f(n)m(um)m(b)s(er)f(of)i(ro)m(ws)g(in)e(the)i
+(table;)227 1831 y(an)m(y)e(ro)m(ws)f(or)g(ranges)g(larger)g(than)g
+(this)f(will)e(b)s(e)j(ignored.)39 b(The)29 b(ro)m(ws)g(m)m(ust)g(b)s
+(e)f(sp)s(eci\014ed)g(in)f(increasing)227 1944 y(order,)33
+b(and)f(the)g(ranges)h(m)m(ust)f(not)g(o)m(v)m(erlap.)47
+b(A)33 b(min)m(us)d(sign)i(ma)m(y)h(b)s(e)e(use)h(to)h(sp)s(ecify)e
+(all)g(the)i(ro)m(ws)f(to)227 2057 y(the)h(upp)s(er)d(or)j(lo)m(w)m(er)
+g(b)s(ound,)e(so)i("50-")h(means)e(all)g(the)h(ro)m(ws)f(from)g(50)h
+(to)h(the)e(end)g(of)h(the)f(table,)i(and)227 2170 y("-")e(means)e(all)
+f(the)i(ro)m(ws)f(in)f(the)i(table,)f(from)g(1)h(-)g(maxro)m(ws.)191
+2430 y Fe(int)47 b(fits_parse_range)c(/)48 b(ffrwrg\(char)c(*rowlist,)i
+(long)g(maxrows,)g(int)h(maxranges,)e(>)334 2543 y(int)i(*numranges,)e
+(long)h(*rangemin,)f(long)i(*rangemax,)e(int)i(*status\))0
+2802 y Fi(19)f Fj(Chec)m(k)37 b(that)g(the)g(Header)g(\014ll)e(b)m
+(ytes)i(\(if)f(an)m(y\))h(are)g(all)f(blank.)58 b(These)36
+b(are)h(the)g(b)m(ytes)g(that)g(ma)m(y)h(follo)m(w)227
+2915 y(END)e(k)m(eyw)m(ord)g(and)f(b)s(efore)g(the)h(b)s(eginning)d(of)
+j(data)g(unit,)f(or)h(the)g(end)f(of)g(the)h(HDU)g(if)f(there)g(is)g
+(no)227 3028 y(data)c(unit.)191 3288 y Fe(int)47 b(ffchfl\(fitsfile)c
+(*fptr,)k(>)g(int)g(*status\))0 3548 y Fi(20)f Fj(Chec)m(k)30
+b(that)g(the)f(Data)i(\014ll)c(b)m(ytes)j(\(if)f(an)m(y\))h(are)g(all)e
+(zero)i(\(for)f(IMA)m(GE)i(or)e(BINAR)-8 b(Y)30 b(T)-8
+b(able)29 b(HDU\))i(or)e(all)227 3661 y(blanks)f(\(for)h(ASCI)s(I)f
+(table)h(HDU\).)h(These)f(\014le)f(b)m(ytes)i(ma)m(y)f(b)s(e)g(lo)s
+(cated)g(after)h(the)f(last)g(v)-5 b(alid)27 b(data)j(b)m(yte)227
+3774 y(in)f(the)i(HDU)g(and)f(b)s(efore)g(the)g(ph)m(ysical)f(end)h(of)
+h(the)f(HDU.)191 4033 y Fe(int)47 b(ffcdfl\(fitsfile)c(*fptr,)k(>)g
+(int)g(*status\))p eop
+%%Page: 62 70
+62 69 bop 0 299 a Fj(62)1379 b Fh(CHAPTER)30 b(5.)71
+b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)p
+eop
+%%Page: 63 71
+63 70 bop 0 1225 a Fg(Chapter)65 b(6)0 1687 y Fm(The)77
+b(CFITSIO)f(Iterator)i(F)-19 b(unction)0 2180 y Fj(The)41
+b(\014ts)p 325 2180 28 4 v 33 w(iterate)p 615 2180 V
+33 w(data)i(function)d(in)h(CFITSIO)f(pro)m(vides)h(a)h(unique)d(metho)
+s(d)j(of)g(executing)g(an)f(arbitrary)0 2293 y(user-supplied)33
+b(`w)m(ork')k(function)e(that)i(op)s(erates)g(on)g(ro)m(ws)f(of)h(data)
+g(in)e(FITS)h(tables)g(or)g(on)h(pixels)d(in)i(FITS)0
+2406 y(images.)i(Rather)24 b(than)e(explicitly)f(reading)h(and)h
+(writing)e(the)i(FITS)g(images)g(or)g(columns)f(of)h(data,)i(one)f
+(instead)0 2518 y(calls)34 b(the)i(CFITSIO)d(iterator)j(routine,)g
+(passing)e(to)i(it)f(the)g(name)g(of)h(the)f(user's)g(w)m(ork)g
+(function)f(that)i(is)e(to)0 2631 y(b)s(e)c(executed)h(along)f(with)f
+(a)i(list)e(of)h(all)f(the)i(table)f(columns)f(or)h(image)g(arra)m(ys)h
+(that)g(are)f(to)h(b)s(e)f(passed)g(to)h(the)0 2744 y(w)m(ork)37
+b(function.)60 b(The)37 b(CFITSIO)e(iterator)j(function)e(then)h(do)s
+(es)g(all)f(the)h(w)m(ork)g(of)h(allo)s(cating)e(memory)h(for)0
+2857 y(the)28 b(arra)m(ys,)h(reading)e(the)h(input)d(data)k(from)e(the)
+h(FITS)f(\014le,)g(passing)g(them)h(to)g(the)g(w)m(ork)g(function,)f
+(and)g(then)0 2970 y(writing)34 b(an)m(y)j(output)f(data)h(bac)m(k)h
+(to)f(the)f(FITS)g(\014le)f(after)i(the)g(w)m(ork)g(function)e(exits.)
+58 b(Because)38 b(it)e(is)g(often)0 3083 y(more)h(e\016cien)m(t)h(to)g
+(pro)s(cess)f(only)f(a)i(subset)f(of)g(the)g(total)h(table)g(ro)m(ws)f
+(at)h(one)f(time,)i(the)f(iterator)f(function)0 3196
+y(can)f(determine)f(the)i(optim)m(um)e(amoun)m(t)h(of)g(data)h(to)g
+(pass)e(in)g(eac)m(h)i(iteration)f(and)f(rep)s(eatly)g(call)h(the)g(w)m
+(ork)0 3309 y(function)29 b(un)m(til)g(the)h(en)m(tire)h(table)f(b)s
+(een)f(pro)s(cessed.)0 3469 y(F)-8 b(or)37 b(man)m(y)f(applications)e
+(this)g(single)h(CFITSIO)f(iterator)j(function)d(can)i(e\013ectiv)m
+(ely)h(replace)f(all)f(the)h(other)0 3582 y(CFITSIO)g(routines)h(for)g
+(reading)g(or)g(writing)f(data)i(in)e(FITS)h(images)h(or)f(tables.)63
+b(Using)36 b(the)i(iterator)g(has)0 3695 y(sev)m(eral)31
+b(imp)s(ortan)m(t)e(adv)-5 b(an)m(tages)32 b(o)m(v)m(er)g(the)f
+(traditional)d(metho)s(d)i(of)h(reading)e(and)h(writing)e(FITS)i(data)h
+(\014les:)136 3961 y Fc(\017)46 b Fj(It)33 b(cleanly)f(separates)i(the)
+f(data)h(I/O)f(from)f(the)h(routine)f(that)i(op)s(erates)f(on)g(the)g
+(data.)49 b(This)31 b(leads)h(to)227 4074 y(a)f(more)g(mo)s(dular)d
+(and)i(`ob)5 b(ject)31 b(orien)m(ted')g(programming)e(st)m(yle.)136
+4268 y Fc(\017)46 b Fj(It)27 b(simpli\014es)c(the)k(application)e
+(program)i(b)m(y)f(eliminating)e(the)j(need)g(to)g(allo)s(cate)g
+(memory)g(for)f(the)h(data)227 4381 y(arra)m(ys)e(and)f(eliminates)f
+(most)h(of)h(the)f(calls)g(to)h(the)g(CFITSIO)d(routines)i(that)h
+(explicitly)d(read)i(and)g(write)227 4494 y(the)31 b(data.)136
+4689 y Fc(\017)46 b Fj(It)32 b(ensures)e(that)i(the)g(data)g(are)g(pro)
+s(cessed)f(as)h(e\016cien)m(tly)f(as)g(p)s(ossible.)42
+b(This)30 b(is)g(esp)s(ecially)g(imp)s(ortan)m(t)227
+4801 y(when)44 b(pro)s(cessing)f(tabular)h(data)i(since)e(the)h
+(iterator)g(function)e(will)f(calculate)j(the)g(most)g(e\016cien)m(t)
+227 4914 y(n)m(um)m(b)s(er)36 b(of)i(ro)m(ws)g(in)e(the)i(table)f(to)h
+(b)s(e)f(passed)g(at)i(one)e(time)h(to)g(the)g(user's)e(w)m(ork)i
+(function)e(on)i(eac)m(h)227 5027 y(iteration.)136 5222
+y Fc(\017)46 b Fj(Mak)m(es)39 b(it)d(p)s(ossible)f(for)i(larger)g(pro)5
+b(jects)37 b(to)h(dev)m(elop)f(a)h(library)c(of)k(w)m(ork)f(functions)f
+(that)h(all)f(ha)m(v)m(e)j(a)227 5335 y(uniform)28 b(calling)h
+(sequence)i(and)f(are)h(all)e(indep)s(enden)m(t)f(of)j(the)f(details)g
+(of)g(the)h(FITS)e(\014le)h(format.)0 5601 y(There)g(are)h(basically)e
+(2)j(steps)e(in)g(using)f(the)i(CFITSIO)e(iterator)i(function.)41
+b(The)30 b(\014rst)g(step)h(is)f(to)h(design)f(the)0
+5714 y(w)m(ork)c(function)e(itself)g(whic)m(h)g(m)m(ust)i(ha)m(v)m(e)g
+(a)g(prescrib)s(ed)d(set)j(of)g(input)e(parameters.)39
+b(One)25 b(of)h(these)g(parameters)1905 5942 y(63)p eop
+%%Page: 64 72
+64 71 bop 0 299 a Fj(64)1455 b Fh(CHAPTER)30 b(6.)112
+b(THE)30 b(CFITSIO)e(ITERA)-8 b(TOR)30 b(FUNCTION)0 555
+y Fj(is)e(a)h(structure)g(con)m(taining)g(p)s(oin)m(ters)e(to)j(the)f
+(arra)m(ys)h(of)f(data;)h(the)f(w)m(ork)h(function)d(can)j(p)s(erform)d
+(an)m(y)i(desired)0 668 y(op)s(erations)j(on)i(these)f(arra)m(ys)h(and)
+e(do)s(es)h(not)g(need)g(to)h(w)m(orry)f(ab)s(out)g(ho)m(w)g(the)h
+(input)d(data)j(w)m(ere)f(read)g(from)0 781 y(the)e(\014le)e(or)h(ho)m
+(w)h(the)f(output)g(data)h(get)h(written)d(bac)m(k)i(to)h(the)e
+(\014le.)0 941 y(The)24 b(second)h(step)g(is)e(to)j(design)d(the)i
+(driv)m(er)f(routine)f(that)j(op)s(ens)e(all)f(the)i(necessary)g(FITS)f
+(\014les)g(and)g(initializes)0 1054 y(the)41 b(input)f(parameters)h(to)
+h(the)g(iterator)f(function.)72 b(The)41 b(driv)m(er)f(program)h(calls)
+f(the)i(CFITSIO)e(iterator)0 1167 y(function)29 b(whic)m(h)g(then)h
+(reads)g(the)h(data)g(and)f(passes)g(it)g(to)h(the)g(user's)e(w)m(ork)i
+(function.)0 1327 y(The)20 b(follo)m(wing)f(2)i(sections)f(describ)s(e)
+f(these)i(steps)g(in)e(more)h(detail.)37 b(There)20 b(are)h(also)f(sev)
+m(eral)h(example)f(programs)0 1440 y(included)28 b(with)h(the)h
+(CFITSIO)f(distribution)e(whic)m(h)i(illustrate)g(ho)m(w)h(to)h(use)f
+(the)h(iterator)f(function.)0 1789 y Ff(6.1)135 b(The)45
+b(Iterator)h(W)-11 b(ork)45 b(F)-11 b(unction)0 2043
+y Fj(The)42 b(user-supplied)d(iterator)k(w)m(ork)g(function)e(m)m(ust)h
+(ha)m(v)m(e)i(the)f(follo)m(wing)e(set)i(of)g(input)d(parameters)j
+(\(the)0 2156 y(function)29 b(can)i(b)s(e)e(giv)m(en)i(an)m(y)g
+(desired)d(name\):)95 2429 y Fe(int)47 b(user_fn\()f(long)h(totaln,)e
+(long)i(offset,)f(long)g(firstn,)g(long)h(nvalues,)716
+2542 y(int)g(narrays,)e(iteratorCol)g(*data,)94 b(void)47
+b(*userPointer)d(\))136 2815 y Fc(\017)i Fj(totaln)23
+b({)g(the)f(total)i(n)m(um)m(b)s(er)d(of)h(table)h(ro)m(ws)f(or)g
+(image)h(pixels)e(that)i(will)c(b)s(e)j(passed)g(to)h(the)g(w)m(ork)f
+(function)227 2928 y(during)28 b(1)j(or)g(more)f(iterations.)136
+3129 y Fc(\017)46 b Fj(o\013set)d({)f(the)h(o\013set)f(applied)e(to)j
+(the)f(\014rst)f(table)h(ro)m(w)g(or)g(image)g(pixel)e(to)j(b)s(e)e
+(passed)g(to)i(the)f(w)m(ork)227 3241 y(function.)54
+b(In)34 b(other)i(w)m(ords,)g(this)e(is)g(the)h(n)m(um)m(b)s(er)f(of)h
+(ro)m(ws)h(or)f(pixels)e(that)j(are)f(skipp)s(ed)e(o)m(v)m(er)j(b)s
+(efore)227 3354 y(starting)29 b(the)h(iterations.)40
+b(If)28 b(o\013set)j(=)e(0,)h(then)f(all)f(the)h(table)h(ro)m(ws)f(or)g
+(image)h(pixels)d(will)g(b)s(e)h(passed)h(to)227 3467
+y(the)i(w)m(ork)f(function.)136 3668 y Fc(\017)46 b Fj(\014rstn)26
+b({)i(the)f(n)m(um)m(b)s(er)f(of)i(the)f(\014rst)g(table)g(ro)m(w)g(or)
+g(image)h(pixel)d(\(starting)j(with)e(1\))i(that)f(is)g(b)s(eing)e
+(passed)227 3781 y(in)k(this)h(particular)e(call)i(to)h(the)g(w)m(ork)f
+(function.)136 3982 y Fc(\017)46 b Fj(n)m(v)-5 b(alues)34
+b({)h(the)f(n)m(um)m(b)s(er)g(of)g(table)g(ro)m(ws)h(or)f(image)h
+(pixels)d(that)j(are)g(b)s(eing)e(passed)h(in)f(this)h(particular)227
+4095 y(call)g(to)i(the)f(w)m(ork)f(function.)53 b(n)m(v)-5
+b(alues)34 b(will)e(alw)m(a)m(ys)j(b)s(e)f(less)g(than)g(or)h(equal)f
+(to)i(totaln)f(and)f(will)e(ha)m(v)m(e)227 4208 y(the)i(same)f(v)-5
+b(alue)33 b(on)g(eac)m(h)h(iteration,)g(except)g(p)s(ossibly)d(on)i
+(the)g(last)g(call)g(whic)m(h)f(ma)m(y)h(ha)m(v)m(e)i(a)e(smaller)227
+4321 y(v)-5 b(alue.)136 4522 y Fc(\017)46 b Fj(narra)m(ys)31
+b({)g(the)g(n)m(um)m(b)s(er)f(of)h(arra)m(ys)g(of)g(data)h(that)f(are)g
+(b)s(eing)f(passed)g(to)i(the)f(w)m(ork)g(function.)41
+b(There)30 b(is)227 4635 y(one)h(arra)m(y)g(for)f(eac)m(h)i(image)e(or)
+g(table)h(column.)136 4835 y Fc(\017)46 b Fj(*data)31
+b({)e(arra)m(y)h(of)f(structures,)g(one)h(for)f(eac)m(h)h(column)e(or)h
+(image.)41 b(Eac)m(h)29 b(structure)g(con)m(tains)g(a)h(p)s(oin)m(ter)
+227 4948 y(to)h(the)g(arra)m(y)g(of)f(data)h(as)g(w)m(ell)e(as)i(other)
+g(descriptiv)m(e)e(parameters)i(ab)s(out)f(that)h(arra)m(y)-8
+b(.)136 5149 y Fc(\017)46 b Fj(*userP)m(oin)m(ter)25
+b({)h(a)f(user)f(supplied)e(p)s(oin)m(ter)i(that)i(can)f(b)s(e)f(used)h
+(to)g(pass)g(ancillary)e(information)g(from)i(the)227
+5262 y(driv)m(er)g(function)g(to)h(the)g(w)m(ork)g(function.)38
+b(This)24 b(p)s(oin)m(ter)h(is)g(passed)h(to)g(the)h(CFITSIO)d
+(iterator)i(function)227 5375 y(whic)m(h)36 b(then)g(passes)g(it)g(on)h
+(to)g(the)f(w)m(ork)h(function)e(without)h(an)m(y)h(mo)s(di\014cation.)
+57 b(It)37 b(ma)m(y)g(p)s(oin)m(t)e(to)j(a)227 5488 y(single)27
+b(n)m(um)m(b)s(er,)h(to)h(an)f(arra)m(y)h(of)g(v)-5 b(alues,)28
+b(to)h(a)g(structure)f(con)m(taining)g(an)g(arbitrary)f(set)i(of)g
+(parameters)227 5601 y(of)e(di\013eren)m(t)g(t)m(yp)s(es,)h(or)f(it)g
+(ma)m(y)g(b)s(e)g(a)g(n)m(ull)e(p)s(oin)m(ter)h(if)g(it)h(is)f(not)h
+(needed.)40 b(The)26 b(w)m(ork)h(function)f(m)m(ust)h(cast)227
+5714 y(this)j(p)s(oin)m(ter)f(to)i(the)g(appropriate)e(data)i(t)m(yp)s
+(e)g(b)s(efore)f(using)e(it)i(it.)p eop
+%%Page: 65 73
+65 72 bop 0 299 a Fh(6.1.)72 b(THE)30 b(ITERA)-8 b(TOR)30
+b(W)m(ORK)g(FUNCTION)2021 b Fj(65)0 555 y(The)23 b(totaln,)j(o\013set,)
+h(narra)m(ys,)e(data,)h(and)d(userP)m(oin)m(ter)h(parameters)g(are)g
+(guaran)m(teed)h(to)g(ha)m(v)m(e)g(the)f(same)g(v)-5
+b(alue)0 668 y(on)35 b(eac)m(h)i(iteration.)55 b(Only)33
+b(\014rstn,)j(n)m(v)-5 b(alues,)36 b(and)e(the)i(arra)m(ys)f(of)h(data)
+g(p)s(oin)m(ted)e(to)i(b)m(y)f(the)h(data)g(structures)0
+781 y(ma)m(y)31 b(c)m(hange)g(on)g(eac)m(h)g(iterativ)m(e)g(call)f(to)h
+(the)f(w)m(ork)h(function.)0 941 y(Note)43 b(that)g(the)f(iterator)g
+(treats)h(an)f(image)g(as)g(a)g(long)g(1-D)h(arra)m(y)f(of)h(pixels)d
+(regardless)h(of)h(it's)g(in)m(trinsic)0 1054 y(dimensionalit)m(y)-8
+b(.)48 b(The)33 b(total)i(n)m(um)m(b)s(er)d(of)i(pixels)e(is)h(just)g
+(the)h(pro)s(duct)e(of)i(the)g(size)g(of)f(eac)m(h)i(dimension,)e(and)0
+1167 y(the)g(order)g(of)g(the)g(pixels)e(is)h(the)h(same)g(as)g(the)h
+(order)e(that)h(they)h(are)f(stored)g(in)f(the)h(FITS)f(\014le.)47
+b(If)33 b(the)g(w)m(ork)0 1280 y(function)26 b(needs)h(to)h(kno)m(w)f
+(the)h(n)m(um)m(b)s(er)e(and)h(size)g(of)h(the)f(image)h(dimensions)c
+(then)j(these)h(parameters)g(can)g(b)s(e)0 1393 y(passed)i(via)g(the)g
+(userP)m(oin)m(ter)h(structure.)0 1553 y(The)f(iteratorCol)g(structure)
+g(is)f(curren)m(tly)h(de\014ned)f(as)h(follo)m(ws:)0
+1780 y Fe(typedef)46 b(struct)94 b(/*)47 b(structure)e(for)i(the)g
+(iterator)e(function)h(column)g(information)f(*/)0 1893
+y({)143 2005 y(/*)i(structure)f(elements)f(required)h(as)h(input)f(to)h
+(fits_iterate_data:)c(*/)95 2231 y(fitsfile)j(*fptr;)332
+b(/*)48 b(pointer)d(to)j(the)f(HDU)f(containing)f(the)i(column)f(or)i
+(image)e(*/)95 2344 y(int)286 b(colnum;)e(/*)48 b(column)e(number)g(in)
+h(the)g(table;)f(ignored)g(for)h(images)189 b(*/)95 2457
+y(char)238 b(colname[70];)44 b(/*)k(name)e(\(TTYPEn\))g(of)h(the)g
+(column;)f(null)g(for)h(images)285 b(*/)95 2570 y(int)h(datatype;)188
+b(/*)48 b(output)e(data)g(type)h(\(converted)e(if)i(necessary\))e(*/)95
+2683 y(int)286 b(iotype;)e(/*)48 b(type:)e(InputCol,)f(InputOutputCol,)
+f(or)j(OutputCol)e(*/)95 2909 y(/*)j(output)e(structure)f(elements)h
+(that)g(may)h(be)g(useful)f(for)h(the)g(work)g(function:)e(*/)95
+3135 y(void)238 b(*array;)189 b(/*)47 b(pointer)f(to)h(the)g(array)f
+(\(and)h(the)g(null)g(value\))f(*/)95 3247 y(long)238
+b(repeat;)189 b(/*)47 b(binary)f(table)h(vector)f(repeat)g(value;)g
+(set)238 b(*/)1050 3360 y(/*)g(equal)46 b(to)i(1)f(for)g(images)810
+b(*/)95 3473 y(long)238 b(tlmin;)f(/*)47 b(legal)g(minimum)e(data)i
+(value,)f(if)h(any)477 b(*/)95 3586 y(long)238 b(tlmax;)f(/*)47
+b(legal)g(maximum)e(data)i(value,)f(if)h(any)477 b(*/)95
+3699 y(char)238 b(unit[70];)93 b(/*)47 b(physical)f(unit)g(string)g
+(\(BUNIT)h(or)g(TUNITn\))189 b(*/)95 3812 y(char)238
+b(tdisp[70];)45 b(/*)i(suggested)e(display)h(format;)g(null)h(if)g
+(none)190 b(*/)0 4038 y(})47 b(iteratorCol;)0 4264 y
+Fj(Instead)34 b(of)g(directly)e(reading)h(or)h(writing)e(the)h(elemen)m
+(ts)i(in)d(this)h(structure,)h(it)g(is)e(recommended)i(that)g(pro-)0
+4377 y(grammers)c(use)g(the)h(access)h(functions)c(that)j(are)g(pro)m
+(vided)e(for)h(this)g(purp)s(ose.)0 4538 y(The)25 b(\014rst)g(\014v)m
+(e)h(elemen)m(ts)g(in)f(this)f(structure)i(m)m(ust)f(b)s(e)g(initially)
+e(de\014ned)h(b)m(y)i(the)g(driv)m(er)e(routine)h(b)s(efore)g(calling)0
+4650 y(the)f(iterator)g(routine.)37 b(The)23 b(CFITSIO)f(iterator)i
+(routine)f(uses)g(this)f(information)g(to)i(determine)f(what)g(column)0
+4763 y(or)32 b(arra)m(y)h(to)h(pass)e(to)h(the)g(w)m(ork)f(function,)g
+(and)g(whether)g(the)g(arra)m(y)h(is)f(to)h(b)s(e)f(input)f(to)i(the)f
+(w)m(ork)h(function,)0 4876 y(output)g(from)g(the)h(w)m(ork)f
+(function,)g(or)h(b)s(oth.)49 b(The)33 b(CFITSIO)f(iterator)h(function)
+f(\014lls)g(in)g(the)h(v)-5 b(alues)33 b(of)h(the)0 4989
+y(remaining)28 b(structure)i(elemen)m(ts)h(b)s(efore)f(passing)f(it)h
+(to)h(the)g(w)m(ork)f(function.)0 5149 y(The)d(arra)m(y)g(structure)g
+(elemen)m(t)h(is)e(a)h(p)s(oin)m(ter)f(to)i(the)g(actual)f(data)h(arra)
+m(y)g(and)e(it)h(m)m(ust)g(b)s(e)f(cast)j(to)e(the)h(correct)0
+5262 y(data)k(t)m(yp)s(e)f(b)s(efore)f(it)h(is)f(used.)41
+b(The)31 b(`rep)s(eat')g(structure)g(elemen)m(t)g(giv)m(e)g(the)h(n)m
+(um)m(b)s(er)d(of)i(data)h(v)-5 b(alues)30 b(in)g(eac)m(h)0
+5375 y(ro)m(w)g(of)g(the)g(table,)h(so)f(that)h(the)f(total)h(n)m(um)m
+(b)s(er)d(of)i(data)h(v)-5 b(alues)29 b(in)g(the)h(arra)m(y)h(is)e(giv)
+m(en)h(b)m(y)g(rep)s(eat)g(*)g(n)m(v)-5 b(alues.)0 5488
+y(In)36 b(the)g(case)i(of)e(image)h(arra)m(ys)g(and)e(ASCI)s(I)g
+(tables,)j(rep)s(eat)f(will)d(alw)m(a)m(ys)i(b)s(e)g(equal)g(to)h(1.)59
+b(When)37 b(the)f(data)0 5601 y(t)m(yp)s(e)k(is)e(a)i(c)m(haracter)h
+(string,)g(the)f(arra)m(y)g(p)s(oin)m(ter)e(is)h(actually)g(a)h(p)s
+(oin)m(ter)e(to)j(an)e(arra)m(y)h(of)g(string)e(p)s(oin)m(ters)0
+5714 y(\(i.e.,)30 b(c)m(har)f(**arra)m(y\).)42 b(The)29
+b(other)g(output)g(structure)f(elemen)m(ts)i(are)f(pro)m(vided)f(for)g
+(con)m(v)m(enience)j(in)c(case)j(that)p eop
+%%Page: 66 74
+66 73 bop 0 299 a Fj(66)1455 b Fh(CHAPTER)30 b(6.)112
+b(THE)30 b(CFITSIO)e(ITERA)-8 b(TOR)30 b(FUNCTION)0 555
+y Fj(information)k(is)h(needed)g(within)e(the)j(w)m(ork)g(function.)55
+b(An)m(y)35 b(other)h(information)e(ma)m(y)i(b)s(e)f(passed)h(from)f
+(the)0 668 y(driv)m(er)29 b(routine)h(to)h(the)f(w)m(ork)h(function)e
+(via)h(the)g(userP)m(oin)m(ter)g(parameter.)0 828 y(Up)s(on)h
+(completion,)h(the)g(w)m(ork)h(routine)e(m)m(ust)h(return)f(an)h(in)m
+(teger)g(status)g(v)-5 b(alue,)33 b(with)d(0)j(indicating)d(success)0
+941 y(and)h(an)m(y)g(other)g(v)-5 b(alue)31 b(indicating)e(an)i(error)g
+(whic)m(h)f(will)e(cause)k(the)f(iterator)h(function)e(to)i
+(immediately)d(exit)0 1054 y(at)e(that)f(p)s(oin)m(t.)38
+b(Return)25 b(status)i(v)-5 b(alues)25 b(in)f(the)i(range)h(1)f({)g
+(1000)i(should)23 b(b)s(e)j(a)m(v)m(oided)g(since)f(these)i(are)f
+(reserv)m(ed)0 1167 y(for)d(use)g(b)m(y)h(CFITSIO.)e(A)i(return)e
+(status)i(v)-5 b(alue)23 b(of)h(-1)g(ma)m(y)g(b)s(e)f(used)f(to)j
+(force)f(the)f(CFITSIO)f(iterator)i(function)0 1280 y(to)j(stop)g(at)g
+(that)h(p)s(oin)m(t)d(and)h(return)g(con)m(trol)h(to)g(the)g(driv)m(er)
+e(routine)h(after)h(writing)d(an)m(y)j(output)f(arra)m(ys)h(to)h(the)0
+1393 y(FITS)e(\014le.)39 b(CFITSIO)26 b(do)s(es)g(not)i(considered)e
+(this)g(to)i(b)s(e)e(an)h(error)g(condition,)g(so)g(an)m(y)g(further)f
+(pro)s(cessing)g(b)m(y)0 1506 y(the)31 b(application)d(program)i(will)e
+(con)m(tin)m(ue)j(normally)-8 b(.)0 1837 y Ff(6.2)135
+b(The)45 b(Iterator)h(Driv)l(er)g(F)-11 b(unction)0 2087
+y Fj(The)33 b(iterator)g(driv)m(er)f(function)g(m)m(ust)i(op)s(en)e
+(the)i(necessary)f(FITS)g(\014les)f(and)h(p)s(osition)e(them)i(to)h
+(the)g(correct)0 2200 y(HDU.)23 b(It)f(m)m(ust)g(also)h(initialize)c
+(the)j(follo)m(wing)f(parameters)h(in)f(the)i(iteratorCol)f(structure)f
+(\(de\014ned)g(ab)s(o)m(v)m(e\))j(for)0 2313 y(eac)m(h)31
+b(column)e(or)h(image)g(b)s(efore)f(calling)g(the)h(CFITSIO)e(iterator)
+i(function.)39 b(Sev)m(eral)30 b(`constructor')h(routines)0
+2426 y(are)g(pro)m(vided)e(in)g(CFITSIO)g(for)h(this)f(purp)s(ose.)136
+2670 y Fc(\017)46 b Fj(*fptr)30 b({)h(The)f(\014ts\014le)f(p)s(oin)m
+(ter)g(to)j(the)e(table)g(or)h(image.)136 2853 y Fc(\017)46
+b Fj(coln)m(um)29 b({)g(the)h(n)m(um)m(b)s(er)e(of)h(the)h(column)e(in)
+g(the)h(table.)41 b(This)27 b(v)-5 b(alue)29 b(is)f(ignored)g(in)g(the)
+i(case)g(of)g(images.)227 2966 y(If)j(coln)m(um)g(equals)g(0,)h(then)g
+(the)f(column)f(name)i(will)c(b)s(e)j(used)g(to)h(iden)m(tify)e(the)h
+(column)g(to)h(b)s(e)e(passed)227 3079 y(to)f(the)g(w)m(ork)f
+(function.)136 3261 y Fc(\017)46 b Fj(colname)31 b({)f(the)g(name)h
+(\(TTYPEn)e(k)m(eyw)m(ord\))i(of)f(the)h(column.)39 b(This)28
+b(is)i(only)f(required)f(if)h(coln)m(um)h(=)g(0)227 3374
+y(and)g(is)f(ignored)h(for)g(images.)136 3556 y Fc(\017)46
+b Fj(datat)m(yp)s(e)29 b({)g(The)e(desired)g(data)h(t)m(yp)s(e)g(of)h
+(the)f(arra)m(y)g(to)h(b)s(e)e(passed)h(to)h(the)f(w)m(ork)g(function.)
+39 b(F)-8 b(or)28 b(n)m(umer-)227 3669 y(ical)f(data)h(the)f(data)h(t)m
+(yp)s(e)g(do)s(es)f(not)g(need)g(to)h(b)s(e)f(the)g(same)h(as)f(the)h
+(actual)f(data)h(t)m(yp)s(e)g(in)e(the)h(FITS)g(\014le,)227
+3782 y(in)g(whic)m(h)h(case)h(CFITSIO)e(will)f(do)j(the)f(con)m(v)m
+(ersion.)41 b(Allo)m(w)m(ed)28 b(v)-5 b(alues)28 b(are:)40
+b(TSTRING,)28 b(TLOGICAL,)227 3895 y(TBYTE,)37 b(TSBYTE,)f(TSHOR)-8
+b(T,)36 b(TUSHOR)-8 b(T,)37 b(TINT,)f(TLONG,)h(TULONG,)f(TFLO)m(A)-8
+b(T,)38 b(TDOU-)227 4008 y(BLE.)33 b(If)g(the)g(input)e(v)-5
+b(alue)32 b(of)h(data)h(t)m(yp)s(e)f(equals)f(0,)j(then)d(the)h
+(existing)f(data)i(t)m(yp)s(e)f(of)g(the)g(column)f(or)227
+4121 y(image)f(will)d(b)s(e)h(used)h(without)f(an)m(y)i(con)m(v)m
+(ersion.)136 4303 y Fc(\017)46 b Fj(iot)m(yp)s(e)36 b({)g(de\014nes)e
+(whether)h(the)h(data)g(arra)m(y)g(is)f(to)h(b)s(e)f(input)f(to)i(the)g
+(w)m(ork)f(function)g(\(i.e,)i(read)e(from)227 4416 y(the)42
+b(FITS)e(\014le\),)j(or)e(output)g(from)g(the)g(w)m(ork)g(function)f
+(\(i.e.,)k(written)c(to)i(the)f(FITS)g(\014le\))f(or)h(b)s(oth.)227
+4529 y(Allo)m(w)m(ed)28 b(v)-5 b(alues)28 b(are)g(InputCol,)f
+(OutputCol,)h(or)g(InputOutputCol.)37 b(V)-8 b(ariable-length)27
+b(arra)m(y)i(columns)227 4642 y(are)h(supp)s(orted)e(as)i(InputCol)d
+(or)j(InputOutputCol)c(t)m(yp)s(es,)k(but)f(ma)m(y)h(not)g(b)s(e)e
+(used)h(for)g(an)h(OutputCol)227 4755 y(t)m(yp)s(e.)0
+4999 y(After)h(the)f(driv)m(er)f(routine)g(has)h(initialized)e(all)h
+(these)h(parameters,)h(it)f(can)h(then)f(call)f(the)i(CFITSIO)e
+(iterator)0 5112 y(function:)95 5357 y Fe(int)47 b
+(fits_iterate_data\(int)42 b(narrays,)k(iteratorCol)f(*data,)h(long)g
+(offset,)286 5470 y(long)h(nPerLoop,)e(int)i(\(*workFn\)\()e(\),)i
+(void)g(*userPointer,)d(int)j(*status\);)136 5714 y Fc(\017)f
+Fj(narra)m(ys)31 b({)f(the)h(n)m(um)m(b)s(er)e(of)h(columns)f(or)i
+(images)f(that)h(are)g(to)g(b)s(e)f(passed)g(to)h(the)f(w)m(ork)h
+(function.)p eop
+%%Page: 67 75
+67 74 bop 0 299 a Fh(6.3.)72 b(GUIDELINES)30 b(F)m(OR)h(USING)f(THE)g
+(ITERA)-8 b(TOR)30 b(FUNCTION)1200 b Fj(67)136 555 y
+Fc(\017)46 b Fj(*data)32 b({)f(p)s(oin)m(ter)e(to)i(arra)m(y)g(of)f
+(structures)g(con)m(taining)g(information)f(ab)s(out)h(eac)m(h)h
+(column)f(or)g(image.)136 736 y Fc(\017)46 b Fj(o\013set)31
+b({)f(if)e(p)s(ositiv)m(e,)h(this)g(n)m(um)m(b)s(er)f(of)i(ro)m(ws)f
+(at)h(the)g(b)s(eginning)d(of)j(the)f(table)h(\(or)g(pixels)d(in)i(the)
+g(image\))227 849 y(will)f(b)s(e)i(skipp)s(ed)e(and)h(will)f(not)j(b)s
+(e)e(passed)h(to)h(the)g(w)m(ork)f(function.)136 1030
+y Fc(\017)46 b Fj(nP)m(erLo)s(op)38 b(-)h(sp)s(eci\014es)d(the)j(n)m
+(um)m(b)s(er)e(of)h(table)g(ro)m(ws)h(\(or)f(n)m(um)m(b)s(er)f(of)i
+(image)f(pixels\))f(that)i(are)g(to)g(b)s(e)227 1143
+y(passed)29 b(to)h(the)f(w)m(ork)h(function)d(on)i(eac)m(h)i
+(iteration.)40 b(If)28 b(nP)m(erLo)s(op)h(=)g(0)g(then)g(CFITSIO)f
+(will)f(calculate)227 1256 y(the)22 b(optim)m(um)f(n)m(um)m(b)s(er)f
+(for)h(greatest)j(e\016ciency)-8 b(.)38 b(If)21 b(nP)m(erLo)s(op)g(is)g
+(negativ)m(e,)k(then)c(all)g(the)h(ro)m(ws)f(or)h(pixels)227
+1368 y(will)33 b(b)s(e)i(passed)g(at)h(one)g(time,)h(and)d(the)i(w)m
+(ork)g(function)e(will)f(only)h(b)s(e)h(called)g(once.)56
+b(If)35 b(an)m(y)h(v)-5 b(ariable)227 1481 y(length)32
+b(arra)m(ys)h(are)g(b)s(eing)e(pro)s(cessed,)i(then)g(the)f(nP)m(erLo)s
+(op)h(v)-5 b(alue)32 b(is)f(ignored,)i(and)f(the)h(iterator)g(will)227
+1594 y(alw)m(a)m(ys)e(pro)s(cess)f(one)h(ro)m(w)f(of)h(the)f(table)h
+(at)g(a)g(time.)136 1775 y Fc(\017)46 b Fj(*w)m(orkFn)f(-)f(the)h(name)
+f(\(actually)g(the)h(address\))f(of)g(the)g(w)m(ork)h(function)e(that)i
+(is)e(to)i(b)s(e)f(called)f(b)m(y)227 1888 y(\014ts)p
+354 1888 28 4 v 33 w(iterate)p 644 1888 V 33 w(data.)136
+2069 y Fc(\017)j Fj(*userP)m(oin)m(ter)33 b(-)g(this)f(is)g(a)h(user)f
+(supplied)e(p)s(oin)m(ter)i(that)h(can)g(b)s(e)g(used)f(to)h(pass)g
+(ancillary)e(information)227 2182 y(from)i(the)g(driv)m(er)f(routine)g
+(to)i(the)f(w)m(ork)g(function.)47 b(It)33 b(ma)m(y)h(p)s(oin)m(t)e(to)
+i(a)f(single)f(n)m(um)m(b)s(er,)g(an)h(arra)m(y)-8 b(,)35
+b(or)227 2295 y(to)c(a)g(structure)f(con)m(taining)g(an)g(arbitrary)f
+(set)i(of)g(parameters.)136 2476 y Fc(\017)46 b Fj(*status)30
+b(-)f(The)f(CFITSIO)f(error)h(status.)41 b(Should)26
+b(=)i(0)h(on)g(input;)e(a)i(non-zero)h(output)e(v)-5
+b(alue)28 b(indicates)227 2588 y(an)j(error.)0 2828 y(When)f(\014ts)p
+392 2828 V 32 w(iterate)p 681 2828 V 34 w(data)h(is)e(called)g(it)g
+(\014rst)h(allo)s(cates)g(memory)g(to)h(hold)d(all)h(the)h(requested)g
+(columns)f(of)h(data)0 2941 y(or)f(image)h(pixel)d(arra)m(ys.)41
+b(It)29 b(then)g(reads)g(the)h(input)d(data)j(from)f(the)g(FITS)f
+(tables)h(or)h(images)f(in)m(to)g(the)h(arra)m(ys)0 3054
+y(then)h(passes)h(the)g(structure)f(with)f(p)s(oin)m(ters)h(to)h(these)
+g(data)h(arra)m(ys)f(to)g(the)g(w)m(ork)g(function.)43
+b(After)32 b(the)g(w)m(ork)0 3167 y(function)k(returns,)h(the)h
+(iterator)f(function)f(writes)g(an)m(y)h(output)g(columns)e(of)i(data)h
+(or)f(images)g(bac)m(k)h(to)g(the)0 3279 y(FITS)31 b(\014les.)45
+b(It)32 b(then)g(rep)s(eats)g(this)f(pro)s(cess)h(for)f(an)m(y)i
+(remaining)d(sets)i(of)h(ro)m(ws)f(or)g(image)g(pixels)e(un)m(til)h(it)
+g(has)0 3392 y(pro)s(cessed)c(the)i(en)m(tire)f(table)f(or)h(image)h
+(or)f(un)m(til)e(the)i(w)m(ork)g(function)f(returns)g(a)h(non-zero)h
+(status)f(v)-5 b(alue.)39 b(The)0 3505 y(iterator)32
+b(then)g(frees)g(the)h(memory)e(that)i(it)f(initially)c(allo)s(cated)k
+(and)g(returns)f(con)m(trol)h(to)h(the)f(driv)m(er)f(routine)0
+3618 y(that)g(called)f(it.)0 3949 y Ff(6.3)135 b(Guidelines)46
+b(for)f(Using)h(the)f(Iterator)h(F)-11 b(unction)0 4199
+y Fj(The)34 b(totaln,)h(o\013set,)i(\014rstn,)d(and)f(n)m(v)-5
+b(alues)34 b(parameters)g(that)h(are)f(passed)g(to)h(the)f(w)m(ork)g
+(function)f(are)i(useful)0 4312 y(for)f(determining)e(ho)m(w)i(m)m(uc)m
+(h)g(of)h(the)f(data)h(has)f(b)s(een)f(pro)s(cessed)h(and)f(ho)m(w)h(m)
+m(uc)m(h)g(remains)f(left)h(to)h(do.)52 b(On)0 4425 y(the)36
+b(v)m(ery)h(\014rst)f(call)f(to)i(the)f(w)m(ork)h(function)e(\014rstn)g
+(will)e(b)s(e)j(equal)g(to)h(o\013set)g(+)f(1;)k(the)c(w)m(ork)g
+(function)f(ma)m(y)0 4538 y(need)c(to)g(p)s(erform)f(v)-5
+b(arious)30 b(initialization)d(tasks)32 b(b)s(efore)e(starting)h(to)g
+(pro)s(cess)g(the)g(data.)43 b(Similarly)-8 b(,)28 b(\014rstn)h(+)0
+4650 y(n)m(v)-5 b(alues)28 b(-)g(1)h(will)c(b)s(e)j(equal)f(to)i
+(totaln)g(on)f(the)g(last)g(iteration,)h(at)g(whic)m(h)e(p)s(oin)m(t)g
+(the)h(w)m(ork)h(function)d(ma)m(y)j(need)0 4763 y(to)k(p)s(erform)f
+(some)h(clean)g(up)e(op)s(erations)h(b)s(efore)h(exiting)f(for)g(the)h
+(last)g(time.)47 b(The)33 b(w)m(ork)f(function)g(can)h(also)0
+4876 y(force)e(an)f(early)g(termination)f(of)i(the)g(iterations)e(b)m
+(y)i(returning)d(a)j(status)g(v)-5 b(alue)29 b(=)h(-1.)0
+5036 y(The)f(narra)m(ys)g(and)g(iteratorCol.datat)m(yp)s(e)h(argumen)m
+(ts)g(allo)m(w)e(the)i(w)m(ork)f(function)f(to)i(double)e(c)m(hec)m(k)j
+(that)f(the)0 5149 y(n)m(um)m(b)s(er)k(of)i(input)e(arra)m(ys)i(and)f
+(their)f(data)j(t)m(yp)s(es)e(ha)m(v)m(e)i(the)f(exp)s(ected)g(v)-5
+b(alues.)56 b(The)35 b(iteratorCol.fptr)g(and)0 5262
+y(iteratorCol.coln)m(um)c(structure)g(elemen)m(ts)g(can)h(b)s(e)f(used)
+f(if)h(the)g(w)m(ork)h(function)e(needs)h(to)h(read)f(or)g(write)g(the)
+0 5375 y(v)-5 b(alues)30 b(of)h(other)g(k)m(eyw)m(ords)g(in)f(the)h
+(FITS)f(\014le)g(asso)s(ciated)h(with)f(the)h(arra)m(y)-8
+b(.)43 b(This)29 b(should)g(generally)h(only)g(b)s(e)0
+5488 y(done)k(during)d(the)j(initialization)d(step)i(or)h(during)e(the)
+i(clean)f(up)g(step)h(after)g(the)g(last)g(set)g(of)g(data)g(has)g(b)s
+(een)0 5601 y(pro)s(cessed.)40 b(Extra)29 b(FITS)f(\014le)g(I/O)h
+(during)d(the)j(main)f(pro)s(cessing)g(lo)s(op)g(of)h(the)g(w)m(ork)g
+(function)f(can)h(seriously)0 5714 y(degrade)i(the)f(sp)s(eed)g(of)g
+(the)h(program.)p eop
+%%Page: 68 76
+68 75 bop 0 299 a Fj(68)1455 b Fh(CHAPTER)30 b(6.)112
+b(THE)30 b(CFITSIO)e(ITERA)-8 b(TOR)30 b(FUNCTION)0 555
+y Fj(If)i(v)-5 b(ariable-length)32 b(arra)m(y)h(columns)f(are)h(b)s
+(eing)e(pro)s(cessed,)i(then)g(the)g(iterator)g(will)d(op)s(erate)k(on)
+f(one)g(ro)m(w)g(of)0 668 y(the)j(table)f(at)h(a)g(time.)56
+b(In)34 b(this)h(case)h(the)g(the)f(rep)s(eat)h(elemen)m(t)g(in)e(the)i
+(in)m(teratorCol)f(structure)g(will)e(b)s(e)h(set)0 781
+y(equal)c(to)h(the)g(n)m(um)m(b)s(er)e(of)h(elemen)m(ts)h(in)e(the)i
+(curren)m(t)f(ro)m(w)g(that)h(is)f(b)s(eing)f(pro)s(cessed.)0
+941 y(One)k(imp)s(ortan)m(t)f(feature)i(of)f(the)h(iterator)g(is)e
+(that)i(the)f(\014rst)g(elemen)m(t)h(in)e(eac)m(h)i(arra)m(y)g(that)g
+(is)e(passed)h(to)h(the)0 1054 y(w)m(ork)f(function)f(giv)m(es)h(the)g
+(v)-5 b(alue)32 b(that)i(is)e(used)g(to)h(represen)m(t)g(n)m(ull)e(or)i
+(unde\014ned)d(v)-5 b(alues)33 b(in)e(the)i(arra)m(y)-8
+b(.)49 b(The)0 1167 y(real)40 b(data)h(then)g(b)s(egins)e(with)g(the)h
+(second)h(elemen)m(t)g(of)g(the)f(arra)m(y)h(\(i.e.,)j(arra)m(y[1],)h
+(not)c(arra)m(y[0]\).)73 b(If)40 b(the)0 1280 y(\014rst)e(arra)m(y)h
+(elemen)m(t)g(is)f(equal)g(to)h(zero,)j(then)c(this)f(indicates)h(that)
+h(all)f(the)g(arra)m(y)h(elemen)m(ts)g(ha)m(v)m(e)h(de\014ned)0
+1393 y(v)-5 b(alues)32 b(and)g(there)h(are)g(no)g(unde\014ned)d(v)-5
+b(alues.)47 b(If)33 b(arra)m(y[0])h(is)e(not)h(equal)f(to)h(zero,)i
+(then)d(this)g(indicates)f(that)0 1506 y(some)j(of)g(the)g(data)h(v)-5
+b(alues)33 b(are)h(unde\014ned)d(and)j(this)e(v)-5 b(alue)34
+b(\(arra)m(y[0]\))i(is)c(used)h(to)i(represen)m(t)f(them.)51
+b(In)33 b(the)0 1619 y(case)i(of)e(output)g(arra)m(ys)h(\(i.e.,)h
+(those)f(arra)m(ys)g(that)g(will)d(b)s(e)i(written)f(bac)m(k)i(to)h
+(the)e(FITS)g(\014le)f(b)m(y)i(the)g(iterator)0 1732
+y(function)g(after)j(the)f(w)m(ork)f(function)g(exits\))h(the)g(w)m
+(ork)g(function)e(m)m(ust)i(set)g(the)g(\014rst)f(arra)m(y)h(elemen)m
+(t)g(to)h(the)0 1844 y(desired)f(n)m(ull)f(v)-5 b(alue)36
+b(if)g(necessary)-8 b(,)40 b(otherwise)d(the)g(\014rst)g(elemen)m(t)g
+(should)e(b)s(e)i(set)g(to)h(zero)g(to)g(indicate)e(that)0
+1957 y(there)30 b(are)h(no)e(n)m(ull)f(v)-5 b(alues)30
+b(in)e(the)i(output)g(arra)m(y)-8 b(.)42 b(CFITSIO)28
+b(de\014nes)h(2)h(v)-5 b(alues,)30 b(FLO)m(A)-8 b(TNULL)e(V)g(ALUE)31
+b(and)0 2070 y(DOUBLENULL)-10 b(V)g(ALUE,)37 b(that)f(can)h(b)s(e)e
+(used)g(as)i(default)e(n)m(ull)f(v)-5 b(alues)35 b(for)h(\015oat)h(and)
+e(double)g(data)i(t)m(yp)s(es,)0 2183 y(resp)s(ectiv)m(ely)-8
+b(.)58 b(In)35 b(the)i(case)g(of)f(c)m(haracter)i(string)d(data)i(t)m
+(yp)s(es,)h(a)e(n)m(ull)f(string)g(is)g(alw)m(a)m(ys)i(used)e(to)i
+(represen)m(t)0 2296 y(unde\014ned)28 b(strings.)0 2456
+y(In)33 b(some)h(applications)d(it)i(ma)m(y)h(b)s(e)f(necessary)h(to)g
+(recursiv)m(ely)e(call)h(the)h(iterator)g(function.)49
+b(An)33 b(example)g(of)0 2569 y(this)26 b(is)g(giv)m(en)h(b)m(y)g(one)h
+(of)f(the)h(example)e(programs)h(that)h(is)e(distributed)e(with)i
+(CFITSIO:)g(it)h(\014rst)f(calls)g(a)i(w)m(ork)0 2682
+y(function)37 b(that)h(writes)g(out)g(a)g(2D)h(histogram)f(image.)64
+b(That)38 b(w)m(ork)g(function)f(in)f(turn)h(calls)h(another)g(w)m(ork)
+0 2795 y(function)28 b(that)i(reads)g(the)f(`X')i(and)e(`Y')h(columns)e
+(in)g(a)i(table)g(to)g(calculate)g(the)f(v)-5 b(alue)30
+b(of)f(eac)m(h)i(2D)f(histogram)0 2908 y(image)h(pixel.)39
+b(Graphically)-8 b(,)29 b(the)h(program)g(structure)g(can)h(b)s(e)f
+(describ)s(ed)e(as:)48 3153 y Fe(driver)46 b(-->)h(iterator)e(-->)i
+(work1_fn)f(-->)h(iterator)e(-->)i(work2_fn)0 3399 y
+Fj(Finally)-8 b(,)39 b(it)f(should)e(b)s(e)i(noted)g(that)h(the)g
+(table)f(columns)f(or)h(image)h(arra)m(ys)g(that)g(are)f(passed)g(to)h
+(the)g(w)m(ork)0 3512 y(function)34 b(do)i(not)g(all)e(ha)m(v)m(e)j(to)
+f(come)h(from)e(the)h(same)g(FITS)f(\014le)f(and)h(instead)g(ma)m(y)h
+(come)h(from)e(an)m(y)h(com-)0 3625 y(bination)31 b(of)i(sources)g(as)h
+(long)e(as)i(they)f(ha)m(v)m(e)h(the)f(same)h(length.)48
+b(The)32 b(length)h(of)g(the)g(\014rst)f(table)h(column)f(or)0
+3738 y(image)f(arra)m(y)g(is)e(used)g(b)m(y)i(the)f(iterator)h(if)e
+(they)i(do)f(not)h(all)e(ha)m(v)m(e)j(the)e(same)h(length.)0
+4069 y Ff(6.4)135 b(Complete)47 b(List)e(of)g(Iterator)i(Routines)0
+4319 y Fj(All)34 b(of)h(the)g(iterator)g(routines)f(are)h(listed)f(b)s
+(elo)m(w.)53 b(Most)36 b(of)f(these)h(routines)d(do)i(not)g(ha)m(v)m(e)
+i(a)e(corresp)s(onding)0 4432 y(short)30 b(function)f(name.)0
+4678 y Fi(1)81 b Fj(Iterator)32 b(`constructor')h(functions)d(that)j
+(set)f(the)g(v)-5 b(alue)31 b(of)h(elemen)m(ts)g(in)f(the)h
+(iteratorCol)f(structure)g(that)227 4791 y(de\014ne)k(the)h(columns)e
+(or)i(arra)m(ys.)56 b(These)36 b(set)g(the)g(\014ts\014le)e(p)s(oin)m
+(ter,)i(column)e(name,)k(column)c(n)m(um)m(b)s(er,)227
+4904 y(datat)m(yp)s(e,)28 b(and)e(iot)m(yp)s(e,)h(resp)s(ectiv)m(ely)-8
+b(.)39 b(The)25 b(last)h(2)h(routines)e(allo)m(w)g(all)g(the)h
+(parameters)h(to)f(b)s(e)g(set)g(with)227 5017 y(one)31
+b(function)e(call)h(\(one)h(supplies)c(the)k(column)e(name,)i(the)f
+(other)h(the)f(column)f(n)m(um)m(b)s(er\).)95 5262 y
+Fe(int)47 b(fits_iter_set_file\(iterato)o(rCo)o(l)42
+b(*col,)k(fitsfile)g(*fptr\);)95 5488 y(int)h
+(fits_iter_set_colname\(iter)o(ato)o(rCol)41 b(*col,)46
+b(char)h(*colname\);)95 5714 y(int)g(fits_iter_set_colnum\(itera)o(tor)
+o(Col)41 b(*col,)47 b(int)g(colnum\);)p eop
+%%Page: 69 77
+69 76 bop 0 299 a Fh(6.4.)72 b(COMPLETE)29 b(LIST)g(OF)i(ITERA)-8
+b(TOR)29 b(R)m(OUTINES)1638 b Fj(69)95 668 y Fe(int)47
+b(fits_iter_set_datatype\(ite)o(rat)o(orCo)o(l)42 b(*col,)k(int)h
+(datatype\);)95 894 y(int)g(fits_iter_set_iotype\(itera)o(tor)o(Col)41
+b(*col,)47 b(int)g(iotype\);)95 1120 y(int)g
+(fits_iter_set_by_name\(iter)o(ato)o(rCol)41 b(*col,)46
+b(fitsfile)g(*fptr,)477 1233 y(char)h(*colname,)e(int)i(datatype,)93
+b(int)47 b(iotype\);)95 1458 y(int)g(fits_iter_set_by_num\(itera)o(tor)
+o(Col)41 b(*col,)47 b(fitsfile)e(*fptr,)477 1571 y(int)i(colnum,)f(int)
+h(datatype,)93 b(int)47 b(iotype\);)0 1820 y Fi(2)81
+b Fj(Iterator)38 b(`accessor')h(functions)d(that)h(return)g(the)g(v)-5
+b(alue)37 b(of)g(the)g(elemen)m(t)h(in)e(the)h(iteratorCol)g(structure)
+227 1933 y(that)31 b(describ)s(es)e(a)i(particular)d(data)j(column)f
+(or)g(arra)m(y)95 2181 y Fe(fitsfile)46 b(*)h
+(fits_iter_get_file\(iterato)o(rCol)41 b(*col\);)95 2407
+y(char)47 b(*)h(fits_iter_get_colname\(i)o(ter)o(ator)o(Col)41
+b(*col\);)95 2633 y(int)47 b(fits_iter_get_colnum\(itera)o(tor)o(Col)41
+b(*col\);)95 2858 y(int)47 b(fits_iter_get_datatype\(ite)o(rat)o(orCo)o
+(l)42 b(*col\);)95 3084 y(int)47 b(fits_iter_get_iotype\(itera)o(tor)o
+(Col)41 b(*col\);)95 3310 y(void)47 b(*)h(fits_iter_get_array\(ite)o
+(rat)o(orCo)o(l)42 b(*col\);)95 3536 y(long)47 b
+(fits_iter_get_tlmin\(itera)o(tor)o(Col)41 b(*col\);)95
+3762 y(long)47 b(fits_iter_get_tlmax\(itera)o(tor)o(Col)41
+b(*col\);)95 3987 y(long)47 b(fits_iter_get_repeat\(iter)o(ato)o(rCol)
+41 b(*col\);)95 4213 y(char)47 b(*)h(fits_iter_get_tunit\(ite)o(rat)o
+(orCo)o(l)42 b(*col\);)95 4439 y(char)47 b(*)h
+(fits_iter_get_tdisp\(ite)o(rat)o(orCo)o(l)42 b(*col\);)0
+4687 y Fi(3)81 b Fj(The)29 b(CFITSIO)g(iterator)i(function)95
+4936 y Fe(int)47 b(fits_iterate_data\(int)42 b(narrays,)94
+b(iteratorCol)44 b(*data,)i(long)h(offset,)573 5049 y(long)f(nPerLoop,)
+573 5161 y(int)h(\(*workFn\)\()e(long)h(totaln,)g(long)h(offset,)f
+(long)g(firstn,)1289 5274 y(long)g(nvalues,)g(int)h(narrays,)e
+(iteratorCol)g(*data,)1289 5387 y(void)h(*userPointer\),)573
+5500 y(void)g(*userPointer,)573 5613 y(int)h(*status\);)p
 eop
-%%Page: 103 109
-103 108 bop 0 299 a Fh(7.13.)113 b(GENERAL)30 b(UTILITY)g(R)m(OUTINES)
-2077 b Fj(103)286 555 y Ff(INTVAL)46 b(7)i(/)f(This)g(is)g(an)g
-(integer)f(keyword)286 668 y(RVAL)524 b(34.6)142 b(/)239
-b(This)46 b(is)i(a)f(floating)f(point)g(keyword)286 781
-y(EVAL=-12.45E-03)92 b(/)47 b(This)g(is)g(a)g(floating)f(point)g
-(keyword)g(in)h(exponential)e(notation)286 894 y(lval)i(F)g(/)h(This)f
-(is)g(a)g(boolean)f(keyword)859 1007 y(This)h(is)g(a)g(comment)f
-(keyword)g(with)h(a)g(blank)f(keyword)g(name)286 1120
-y(SVAL1)h(=)g('Hello)f(world')142 b(/)95 b(this)47 b(is)g(a)g(string)f
-(keyword)286 1233 y(SVAL2)94 b('123.5')g(this)47 b(is)g(also)f(a)i
-(string)e(keyword)286 1346 y(sval3)94 b(123+)h(/)g(this)47
-b(is)g(also)f(a)i(string)e(keyword)g(with)g(the)h(value)g('123+)189
-b(')286 1458 y(#)48 b(the)f(following)e(template)h(line)g(deletes)g
-(the)h(DATE)g(keyword)286 1571 y(-)h(DATE)286 1684 y(#)g(the)f
-(following)e(template)h(line)g(modifies)g(the)h(NAME)f(keyword)g(to)h
-(OBJECT)286 1797 y(-)h(NAME)e(OBJECT)0 2057 y Fi(16)g
-Fj(Chec)m(k)37 b(that)g(the)g(Header)g(\014ll)e(b)m(ytes)i(\(if)f(an)m
-(y\))h(are)g(all)f(blank.)58 b(These)36 b(are)h(the)g(b)m(ytes)g(that)g
-(ma)m(y)h(follo)m(w)227 2170 y(END)e(k)m(eyw)m(ord)g(and)f(b)s(efore)g
-(the)h(b)s(eginning)d(of)j(data)g(unit,)f(or)h(the)g(end)f(of)g(the)h
-(HDU)g(if)f(there)g(is)g(no)227 2283 y(data)c(unit.)191
-2543 y Ff(int)47 b(ffchfl\(fitsfile)c(*fptr,)k(>)g(int)g(*status\))0
-2802 y Fi(17)f Fj(Chec)m(k)30 b(that)g(the)f(Data)i(\014ll)c(b)m(ytes)j
-(\(if)f(an)m(y\))h(are)g(all)e(zero)i(\(for)f(IMA)m(GE)i(or)e(BINAR)-8
-b(Y)30 b(T)-8 b(able)29 b(HDU\))i(or)e(all)227 2915 y(blanks)f(\(for)h
-(ASCI)s(I)f(table)h(HDU\).)h(These)f(\014le)f(b)m(ytes)i(ma)m(y)f(b)s
-(e)g(lo)s(cated)g(after)h(the)f(last)g(v)-5 b(alid)27
-b(data)j(b)m(yte)227 3028 y(in)f(the)i(HDU)g(and)f(b)s(efore)g(the)g
-(ph)m(yscal)g(end)g(of)g(the)h(HDU.)191 3288 y Ff(int)47
-b(ffcdfl\(fitsfile)c(*fptr,)k(>)g(int)g(*status\))p eop
-%%Page: 104 110
-104 109 bop 0 299 a Fj(104)1294 b Fh(CHAPTER)30 b(7.)111
-b(BASIC)30 b(CFITSIO)f(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)p
+%%Page: 70 78
+70 77 bop 0 299 a Fj(70)1455 b Fh(CHAPTER)30 b(6.)112
+b(THE)30 b(CFITSIO)e(ITERA)-8 b(TOR)30 b(FUNCTION)p eop
+%%Page: 71 79
+71 78 bop 0 1225 a Fg(Chapter)65 b(7)0 1687 y Fm(Celestial)76
+b(Co)6 b(ordinate)78 b(System)f(Routines)0 2180 y Fj(The)36
+b(FITS)g(comm)m(unit)m(y)g(has)g(adopted)h(a)g(set)g(of)g(k)m(eyw)m
+(ord)g(con)m(v)m(en)m(tions)g(that)g(de\014ne)f(the)h(transformations)0
+2293 y(needed)30 b(to)i(con)m(v)m(ert)g(b)s(et)m(w)m(een)f(pixel)e(lo)s
+(cations)h(in)f(an)i(image)g(and)f(the)g(corresp)s(onding)f(celestial)h
+(co)s(ordinates)0 2406 y(on)25 b(the)h(sky)-8 b(,)27
+b(or)e(more)g(generally)-8 b(,)27 b(that)f(de\014ne)e(w)m(orld)g(co)s
+(ordinates)i(that)f(are)h(to)g(b)s(e)f(asso)s(ciated)h(with)e(an)m(y)i
+(pixel)0 2518 y(lo)s(cation)34 b(in)f(an)i(n-dimensional)c(FITS)j(arra)
+m(y)-8 b(.)54 b(CFITSIO)33 b(is)g(distributed)f(with)h(a)i(couple)e(of)
+i(self-con)m(tained)0 2631 y(W)-8 b(orld)27 b(Co)s(ordinate)f(System)g
+(\(W)m(CS\))i(routines,)f(ho)m(w)m(ev)m(er,)i(these)f(routines)e(DO)h
+(NOT)f(supp)s(ort)f(all)h(the)h(latest)0 2744 y(W)m(CS)38
+b(con)m(v)m(en)m(tions,)j(so)e(it)f(is)f(STR)m(ONGL)-8
+b(Y)38 b(RECOMMENDED)h(that)f(soft)m(w)m(are)i(dev)m(elop)s(ers)d(use)h
+(a)h(more)0 2857 y(robust)30 b(external)g(W)m(CS)g(library)-8
+b(.)39 b(Sev)m(eral)30 b(recommended)g(libraries)e(are:)95
+3094 y Fe(WCSLIB)47 b(-)95 b(supported)45 b(by)i(Mark)g(Calabretta)95
+3207 y(WCSTools)f(-)h(supported)f(by)h(Doug)g(Mink)95
+3320 y(AST)g(library)f(-)i(developed)d(by)i(the)g(U.K.)g(Starlink)e
+(project)0 3556 y Fj(More)30 b(information)d(ab)s(out)i(the)g(W)m(CS)g
+(k)m(eyw)m(ord)h(con)m(v)m(en)m(tions)g(and)e(links)f(to)j(all)e(of)h
+(these)g(W)m(CS)g(libraries)e(can)0 3669 y(b)s(e)j(found)f(on)h(the)h
+(FITS)e(Supp)s(ort)g(O\016ce)h(w)m(eb)g(site)h(at)g(h)m
+(ttp://\014ts.gsfc.nasa.go)m(v)j(under)29 b(the)h(W)m(CS)h(link.)0
+3829 y(The)i(functions)g(pro)m(vided)g(in)f(these)j(external)e(W)m(CS)h
+(libraries)e(will)f(need)j(access)h(to)g(the)f(W)m(CS)g(information)0
+3942 y(con)m(tained)g(in)e(the)i(FITS)f(\014le)g(headers.)51
+b(One)33 b(con)m(v)m(enien)m(t)i(w)m(a)m(y)g(to)f(pass)g(this)e
+(information)g(to)j(the)f(extermal)0 4055 y(library)29
+b(is)g(to)j(use)f(the)g(\014ts)p 942 4055 28 4 v 32 w(hdr2str)f
+(routine)g(in)g(CFITSIO)f(\(de\014ned)h(b)s(elo)m(w\))g(to)i(cop)m(y)g
+(the)f(header)g(k)m(eyw)m(ords)0 4168 y(in)m(to)j(one)f(long)h(string,)
+f(and)g(then)g(pass)g(this)g(string)f(to)j(an)e(in)m(terface)h(routine)
+f(in)f(the)i(external)f(library)e(that)0 4281 y(will)i(extract)j(the)g
+(necessary)f(W)m(CS)g(information)f(\(e.g.,)k(see)e(the)f(astFitsChan)g
+(and)f(astPutCards)h(routines)0 4394 y(in)29 b(the)i(Starlink)d(AST)h
+(library\).)0 4631 y Fi(1)81 b Fj(Concatenate)38 b(the)f(header)f(k)m
+(eyw)m(ords)h(in)e(the)h(CHDU)h(in)m(to)g(a)g(single)e(long)h(string)f
+(of)i(c)m(haracters.)60 b(Eac)m(h)227 4744 y(80-c)m(haracter)28
+b(\014xed-length)23 b(k)m(eyw)m(ord)i(record)g(is)f(app)s(ended)e(to)k
+(the)f(output)f(c)m(haracter)i(string,)f(in)e(order,)227
+4856 y(with)h(no)g(in)m(terv)m(ening)g(separator)h(or)g(terminating)f
+(c)m(haracters.)40 b(The)24 b(last)h(header)f(record)h(is)e(terminated)
+227 4969 y(with)32 b(a)h(NULL)f(c)m(haracter.)49 b(This)31
+b(routine)h(allo)s(cates)h(memory)f(for)h(the)g(returned)e(c)m
+(haracter)j(arra)m(y)-8 b(,)35 b(so)227 5082 y(the)c(calling)e(program)
+h(m)m(ust)g(free)h(the)f(memory)g(when)g(\014nished.)227
+5229 y(Selected)f(k)m(eyw)m(ords)f(ma)m(y)h(b)s(e)e(excluded)g(from)h
+(the)g(returned)f(c)m(haracter)j(string.)39 b(If)27 b(the)i(second)f
+(param-)227 5342 y(eter)h(\(no)s(commen)m(ts\))g(is)e(TR)m(UE)h
+(\(nonzero\))h(then)e(an)m(y)i(COMMENT,)f(HISTOR)-8 b(Y,)27
+b(or)h(blank)f(k)m(eyw)m(ords)227 5455 y(in)i(the)i(header)f(will)e
+(not)i(b)s(e)g(copied)g(to)h(the)g(output)f(string.)227
+5601 y(The)25 b('exclist')h(parameter)g(ma)m(y)g(b)s(e)f(used)g(to)h
+(supply)d(a)j(list)f(of)g(k)m(eyw)m(ords)h(that)h(are)f(to)g(b)s(e)f
+(excluded)f(from)227 5714 y(the)29 b(output)g(c)m(haracter)h(string.)40
+b(Wild)27 b(card)i(c)m(haracters)h(\(*,)g(?,)f(and)g(#\))g(ma)m(y)g(b)s
+(e)f(used)g(in)g(the)h(excluded)1905 5942 y(71)p eop
+%%Page: 72 80
+72 79 bop 0 299 a Fj(72)1003 b Fh(CHAPTER)30 b(7.)112
+b(CELESTIAL)28 b(COORDINA)-8 b(TE)30 b(SYSTEM)f(R)m(OUTINES)227
+555 y Fj(k)m(eyw)m(ord)h(names.)41 b(If)29 b(no)g(additional)f(k)m(eyw)
+m(ords)i(are)g(to)g(b)s(e)f(excluded,)g(then)g(set)h(nexc)g(=)f(0)h
+(and)f(sp)s(ecify)227 668 y(NULL)i(for)f(the)g(the)h(**header)g
+(parameter.)95 890 y Fe(int)47 b(fits_hdr2str)286 1003
+y(\(fitsfile)f(*fptr,)g(int)h(nocomments,)d(char)j(**exclist,)e(int)i
+(nexc,)286 1116 y(>)h(char)e(**header,)g(int)h(*nkeys,)e(int)i
+(*status\))0 1444 y Ff(7.1)180 b(Self-con)l(tained)46
+b(W)l(CS)f(Routines)0 1694 y Fj(The)21 b(follo)m(wing)f(routines)g(DO)h
+(NOT)g(supp)s(ort)f(the)h(more)h(recen)m(t)g(W)m(CS)f(con)m(v)m(en)m
+(tions)i(that)e(ha)m(v)m(e)i(b)s(een)e(appro)m(v)m(ed)0
+1807 y(as)34 b(part)g(of)g(the)g(FITS)f(standard.)50
+b(Consequen)m(tly)-8 b(,)34 b(the)g(follo)m(wing)f(routines)f(ARE)i(NO)
+m(W)h(DEPRECA)-8 b(TED.)0 1920 y(It)30 b(is)f(STR)m(ONGL)-8
+b(Y)30 b(RECOMMENDED)h(that)g(soft)m(w)m(are)g(dev)m(elop)s(ers)e(not)i
+(use)f(these)g(routines,)f(and)h(instead)0 2033 y(use)g(an)g(external)h
+(W)m(CS)f(library)-8 b(,)29 b(as)h(describ)s(ed)e(in)i(the)g(previous)f
+(section.)0 2193 y(These)21 b(routines)f(are)h(included)d(mainly)h(for)
+i(bac)m(kw)m(ard)g(compatibilit)m(y)f(with)f(existing)h(soft)m(w)m
+(are.)39 b(They)21 b(supp)s(ort)0 2306 y(the)30 b(follo)m(wing)f
+(standard)g(map)g(pro)5 b(jections:)40 b(-SIN,)30 b(-T)-8
+b(AN,)31 b(-AR)m(C,)g(-NCP)-8 b(,)30 b(-GLS,)g(-MER,)h(and)e(-AIT)h
+(\(these)0 2419 y(are)f(the)g(legal)f(v)-5 b(alues)28
+b(for)g(the)h(co)s(ordt)m(yp)s(e)f(parameter\).)41 b(These)28
+b(routines)g(are)h(based)f(on)g(similar)e(functions)h(in)0
+2532 y(Classic)i(AIPS.)h(All)f(the)i(angular)e(quan)m(tities)h(are)h
+(giv)m(en)f(in)f(units)g(of)h(degrees.)0 2754 y Fi(1)81
+b Fj(Get)41 b(the)f(v)-5 b(alues)40 b(of)h(the)f(basic)g(set)h(of)f
+(standard)g(FITS)f(celestial)h(co)s(ordinate)g(system)h(k)m(eyw)m(ords)
+f(from)227 2867 y(the)33 b(header)f(of)h(a)f(FITS)g(image)h(\(i.e.,)g
+(the)g(primary)e(arra)m(y)h(or)h(an)f(IMA)m(GE)i(extension\).)46
+b(These)33 b(v)-5 b(alues)227 2980 y(ma)m(y)35 b(then)f(b)s(e)g(passed)
+f(to)i(the)g(\014ts)p 1462 2980 28 4 v 32 w(pix)p 1619
+2980 V 31 w(to)p 1730 2980 V 34 w(w)m(orld)e(and)h(\014ts)p
+2321 2980 V 32 w(w)m(orld)p 2574 2980 V 32 w(to)p 2686
+2980 V 33 w(pix)f(routines)g(that)i(p)s(erform)e(the)227
+3093 y(co)s(ordinate)e(transformations.)41 b(If)30 b(an)m(y)h(or)f(all)
+g(of)h(the)g(W)m(CS)f(k)m(eyw)m(ords)h(are)g(not)g(presen)m(t,)g(then)g
+(default)227 3206 y(v)-5 b(alues)25 b(will)d(b)s(e)i(returned.)38
+b(If)24 b(the)i(\014rst)e(co)s(ordinate)h(axis)f(is)g(the)h
+(declination-lik)m(e)e(co)s(ordinate,)j(then)f(this)227
+3319 y(routine)30 b(will)d(sw)m(ap)k(them)f(so)h(that)g(the)f
+(longitudinal-lik)m(e)d(co)s(ordinate)j(is)f(returned)h(as)g(the)h
+(\014rst)e(axis.)227 3463 y(If)35 b(the)h(\014le)e(uses)h(the)g(new)m
+(er)h('CDj)p 1454 3463 V 32 w(i')f(W)m(CS)g(transformation)g(matrix)g
+(k)m(eyw)m(ords)g(instead)g(of)g(old)g(st)m(yle)227 3576
+y('CDEL)-8 b(Tn')37 b(and)f('CR)m(OT)-8 b(A2')38 b(k)m(eyw)m(ords,)h
+(then)e(this)e(routine)h(will)e(calculate)k(and)e(return)g(the)h(v)-5
+b(alues)227 3689 y(of)33 b(the)g(equiv)-5 b(alen)m(t)33
+b(old-st)m(yle)f(k)m(eyw)m(ords.)49 b(Note)34 b(that)g(the)f(con)m(v)m
+(ersion)g(from)f(the)i(new-st)m(yle)f(k)m(eyw)m(ords)227
+3801 y(to)f(the)f(old-st)m(yle)f(v)-5 b(alues)30 b(is)g(sometimes)g
+(only)g(an)h(appro)m(ximation,)f(so)g(if)g(the)h(appro)m(ximation)f(is)
+f(larger)227 3914 y(than)37 b(an)h(in)m(ternally)d(de\014ned)h
+(threshold)g(lev)m(el,)j(then)e(CFITSIO)f(will)f(still)g(return)h(the)i
+(appro)m(ximate)227 4027 y(W)m(CS)32 b(k)m(eyw)m(ord)h(v)-5
+b(alues,)32 b(but)f(will)e(also)j(return)f(with)g(status)h(=)f(APPR)m
+(O)m(X)p 2908 4027 V 34 w(W)m(CS)p 3149 4027 V 33 w(KEY,)g(to)i(w)m
+(arn)f(the)227 4140 y(calling)h(program)h(that)h(appro)m(ximations)e
+(ha)m(v)m(e)i(b)s(een)f(made.)52 b(It)35 b(is)e(then)h(up)f(to)i(the)f
+(calling)f(program)227 4253 y(to)d(decide)f(whether)f(the)h(appro)m
+(ximations)f(are)i(su\016cien)m(tly)d(accurate)k(for)e(the)g
+(particular)e(application,)227 4366 y(or)46 b(whether)e(more)i(precise)
+f(W)m(CS)g(transformations)g(m)m(ust)g(b)s(e)g(p)s(erformed)f(using)f
+(new-st)m(yle)j(W)m(CS)227 4479 y(k)m(eyw)m(ords)31 b(directly)-8
+b(.)95 4701 y Fe(int)47 b(fits_read_img_coord)c(/)k(ffgics)286
+4814 y(\(fitsfile)f(*fptr,)g(>)h(double)f(*xrefval,)g(double)g
+(*yrefval,)334 4927 y(double)g(*xrefpix,)f(double)i(*yrefpix,)e(double)
+h(*xinc,)g(double)g(*yinc,)334 5040 y(double)g(*rot,)h(char)f
+(*coordtype,)f(int)i(*status\))0 5262 y Fi(2)81 b Fj(Get)30
+b(the)f(v)-5 b(alues)29 b(of)g(the)h(standard)e(FITS)h(celestial)g(co)s
+(ordinate)g(system)g(k)m(eyw)m(ords)h(from)f(the)g(header)g(of)h(a)227
+5375 y(FITS)23 b(table)h(where)f(the)h(X)g(and)g(Y)g(\(or)g(RA)g(and)f
+(DEC\))h(co)s(ordinates)g(are)g(stored)g(in)e(2)i(separate)h(columns)
+227 5488 y(of)30 b(the)f(table)g(\(as)h(in)e(the)i(Ev)m(en)m(t)g(List)f
+(table)g(format)g(that)h(is)f(often)g(used)g(b)m(y)g(high)f(energy)h
+(astroph)m(ysics)227 5601 y(missions\).)69 b(These)40
+b(v)-5 b(alues)39 b(ma)m(y)i(then)f(b)s(e)f(passed)h(to)h(the)f(\014ts)
+p 2511 5601 V 33 w(pix)p 2669 5601 V 31 w(to)p 2780 5601
+V 34 w(w)m(orld)f(and)h(\014ts)p 3383 5601 V 32 w(w)m(orld)p
+3636 5601 V 32 w(to)p 3748 5601 V 33 w(pix)227 5714 y(routines)30
+b(that)g(p)s(erform)f(the)i(co)s(ordinate)f(transformations.)p
+eop
+%%Page: 73 81
+73 80 bop 0 299 a Fh(7.1.)113 b(SELF-CONT)-8 b(AINED)30
+b(W)m(CS)g(R)m(OUTINES)1984 b Fj(73)95 555 y Fe(int)47
+b(fits_read_tbl_coord)c(/)k(ffgtcs)286 668 y(\(fitsfile)f(*fptr,)g(int)
+h(xcol,)f(int)h(ycol,)f(>)i(double)e(*xrefval,)334 781
+y(double)g(*yrefval,)f(double)i(*xrefpix,)e(double)h(*yrefpix,)f
+(double)h(*xinc,)334 894 y(double)g(*yinc,)g(double)g(*rot,)h(char)f
+(*coordtype,)f(int)i(*status\))0 1154 y Fi(3)81 b Fj(Calculate)40
+b(the)i(celestial)e(co)s(ordinate)h(corresp)s(onding)e(to)j(the)f
+(input)e(X)i(and)g(Y)g(pixel)e(lo)s(cation)i(in)f(the)227
+1267 y(image.)95 1526 y Fe(int)47 b(fits_pix_to_world)c(/)48
+b(ffwldp)286 1639 y(\(double)e(xpix,)h(double)f(ypix,)g(double)g
+(xrefval,)g(double)g(yrefval,)334 1752 y(double)g(xrefpix,)g(double)g
+(yrefpix,)f(double)h(xinc,)h(double)f(yinc,)334 1865
+y(double)g(rot,)h(char)f(*coordtype,)f(>)j(double)e(*xpos,)g(double)g
+(*ypos,)334 1978 y(int)h(*status\))0 2238 y Fi(4)81 b
+Fj(Calculate)40 b(the)i(X)f(and)f(Y)h(pixel)f(lo)s(cation)g(corresp)s
+(onding)f(to)j(the)f(input)e(celestial)i(co)s(ordinate)g(in)f(the)227
+2351 y(image.)95 2611 y Fe(int)47 b(fits_world_to_pix)c(/)48
+b(ffxypx)286 2723 y(\(double)e(xpos,)h(double)f(ypos,)g(double)g
+(xrefval,)g(double)g(yrefval,)334 2836 y(double)g(xrefpix,)g(double)g
+(yrefpix,)f(double)h(xinc,)h(double)f(yinc,)334 2949
+y(double)g(rot,)h(char)f(*coordtype,)f(>)j(double)e(*xpix,)g(double)g
+(*ypix,)334 3062 y(int)h(*status\))p eop
+%%Page: 74 82
+74 81 bop 0 299 a Fj(74)1003 b Fh(CHAPTER)30 b(7.)112
+b(CELESTIAL)28 b(COORDINA)-8 b(TE)30 b(SYSTEM)f(R)m(OUTINES)p
+eop
+%%Page: 75 83
+75 82 bop 0 1225 a Fg(Chapter)65 b(8)0 1687 y Fm(Hierarc)-6
+b(hical)76 b(Grouping)h(Routines)0 2180 y Fj(These)34
+b(functions)g(allo)m(w)g(for)g(the)h(creation)g(and)f(manipulation)e
+(of)j(FITS)f(HDU)h(Groups,)h(as)f(de\014ned)e(in)g("A)0
+2293 y(Hierarc)m(hical)22 b(Grouping)g(Con)m(v)m(en)m(tion)h(for)g
+(FITS")f(b)m(y)h(Jennings,)g(P)m(ence,)i(F)-8 b(olk)24
+b(and)e(Sc)m(hlesinger)g(\()h(h)m(ttp:)37 b(//ad-)0 2406
+y(fwww.gsfc.nasa.go)m(v/other/con)m(v)m(ert/group.h)m(tml)27
+b(\).)38 b(A)23 b(group)g(is)e(a)j(collection)e(of)h(HDUs)h(whose)e
+(asso)s(ciation)0 2518 y(is)33 b(de\014ned)f(b)m(y)h(a)h
+Fa(gr)-5 b(ouping)37 b(table)p Fj(.)50 b(HDUs)35 b(whic)m(h)d(are)i
+(part)f(of)h(a)g(group)f(are)h(referred)f(to)h(as)g Fa(memb)-5
+b(er)36 b(HDUs)0 2631 y Fj(or)i(simply)d(as)i Fa(memb)-5
+b(ers)p Fj(.)63 b(Grouping)37 b(table)g(mem)m(b)s(er)g(HDUs)h(ma)m(y)g
+(themselv)m(es)g(b)s(e)f(grouping)f(tables,)j(th)m(us)0
+2744 y(allo)m(wing)29 b(for)h(the)h(construction)f(of)g(op)s(en-ended)g
+(hierarc)m(hies)f(of)h(HDUs.)0 2904 y(Grouping)25 b(tables)i(con)m
+(tain)g(one)g(ro)m(w)g(for)f(eac)m(h)i(mem)m(b)s(er)e(HDU.)i(The)e
+(grouping)f(table)i(columns)e(pro)m(vide)h(iden-)0 3017
+y(ti\014cation)h(information)f(that)i(allo)m(ws)f(applications)e(to)j
+(reference)g(or)g("p)s(oin)m(t)f(to")h(the)g(mem)m(b)s(er)f(HDUs.)40
+b(Mem-)0 3130 y(b)s(er)27 b(HDUs)h(are)g(exp)s(ected,)h(but)e(not)h
+(required,)e(to)j(con)m(tain)f(a)g(set)g(of)g(GRPIDn/GRPLCn)f(k)m(eyw)m
+(ords)h(in)e(their)0 3243 y(headers)k(for)h(eac)m(h)g(grouping)f(table)
+g(that)h(they)g(are)g(referenced)g(b)m(y)-8 b(.)41 b(In)30
+b(this)g(sense,)h(the)g(GRPIDn/GRPLCn)0 3356 y(k)m(eyw)m(ords)d("link")
+e(the)i(mem)m(b)s(er)f(HDU)h(bac)m(k)g(to)g(its)f(Grouping)f(table.)40
+b(Note)29 b(that)f(a)f(mem)m(b)s(er)g(HDU)h(need)g(not)0
+3469 y(reside)h(in)g(the)h(same)g(FITS)f(\014le)h(as)g(its)f(grouping)g
+(table,)h(and)f(that)i(a)f(giv)m(en)g(HDU)h(ma)m(y)g(b)s(e)e
+(referenced)h(b)m(y)g(up)0 3582 y(to)h(999)h(grouping)d(tables)h(sim)m
+(ultaneously)-8 b(.)0 3742 y(Grouping)21 b(tables)i(are)g(implemen)m
+(ted)e(as)i(FITS)f(binary)f(tables)h(with)g(up)f(to)j(six)d
+(pre-de\014ned)h(column)f(TTYPEn)0 3855 y(v)-5 b(alues:)35
+b('MEMBER)p 752 3855 28 4 v 34 w(XTENSION',)20 b('MEMBER)p
+1789 3855 V 33 w(NAME',)h('MEMBER)p 2620 3855 V 34 w(VERSION',)f
+('MEMBER)p 3590 3855 V 34 w(POSITION',)0 3968 y('MEMBER)p
+451 3968 V 34 w(URI)p 653 3968 V 32 w(TYPE')g(and)g('MEMBER)p
+1601 3968 V 34 w(LOCA)-8 b(TION'.)20 b(The)f(\014rst)h(three)g(columns)
+f(allo)m(w)h(mem)m(b)s(er)g(HDUs)0 4081 y(to)28 b(b)s(e)f(iden)m
+(ti\014ed)e(b)m(y)i(reference)h(to)g(their)e(XTENSION,)h(EXTNAME)g(and)
+g(EXTVER)g(k)m(eyw)m(ord)g(v)-5 b(alues.)39 b(The)0 4194
+y(fourth)29 b(column)g(allo)m(ws)h(mem)m(b)s(er)f(HDUs)i(to)g(b)s(e)f
+(iden)m(ti\014ed)e(b)m(y)i(HDU)h(p)s(osition)d(within)g(their)h(FITS)h
+(\014le.)39 b(The)0 4307 y(last)f(t)m(w)m(o)h(columns)d(iden)m(tify)g
+(the)i(FITS)f(\014le)g(in)f(whic)m(h)h(the)h(mem)m(b)s(er)f(HDU)h
+(resides,)h(if)d(di\013eren)m(t)i(from)f(the)0 4419 y(grouping)29
+b(table)h(FITS)g(\014le.)0 4580 y(Additional)22 b(user)i(de\014ned)f
+("auxiliary")g(columns)g(ma)m(y)i(also)f(b)s(e)g(included)e(with)h(an)m
+(y)i(grouping)e(table.)38 b(When)25 b(a)0 4693 y(grouping)h(table)i(is)
+f(copied)g(or)g(mo)s(di\014ed)f(the)i(presence)g(of)f(auxiliary)f
+(columns)g(is)h(alw)m(a)m(ys)h(tak)m(en)h(in)m(to)e(accoun)m(t)0
+4805 y(b)m(y)k(the)g(grouping)f(supp)s(ort)g(functions;)g(ho)m(w)m(ev)m
+(er,)j(the)e(grouping)f(supp)s(ort)g(functions)f(cannot)j(directly)e
+(mak)m(e)0 4918 y(use)g(of)h(this)e(data.)0 5079 y(If)44
+b(a)h(grouping)e(table)h(column)f(is)h(de\014ned)f(but)h(the)g(corresp)
+s(onding)f(mem)m(b)s(er)g(HDU)j(information)c(is)i(un-)0
+5191 y(a)m(v)-5 b(ailable)38 b(then)f(a)i(n)m(ull)d(v)-5
+b(alue)38 b(of)g(the)g(appropriate)g(data)g(t)m(yp)s(e)h(is)e(inserted)
+g(in)g(the)h(column)f(\014eld.)63 b(In)m(teger)0 5304
+y(columns)25 b(\(MEMBER)p 811 5304 V 34 w(POSITION,)g(MEMBER)p
+1771 5304 V 34 w(VERSION\))h(are)h(de\014ned)f(with)f(a)i(TNULLn)f(v)-5
+b(alue)26 b(of)h(zero)0 5417 y(\(0\).)41 b(Character)27
+b(\014eld)e(columns)h(\(MEMBER)p 1607 5417 V 34 w(XTENSION,)g(MEMBER)p
+2600 5417 V 33 w(NAME,)i(MEMBER)p 3388 5417 V 34 w(URI)p
+3590 5417 V 32 w(TYPE,)0 5530 y(MEMBER)p 426 5530 V 33
+w(LOCA)-8 b(TION\))30 b(utilize)f(an)h(ASCI)s(I)f(n)m(ull)f(c)m
+(haracter)k(to)f(denote)g(a)g(n)m(ull)d(\014eld)h(v)-5
+b(alue.)0 5690 y(The)23 b(grouping)f(supp)s(ort)g(functions)g(b)s
+(elong)h(to)h(t)m(w)m(o)h(basic)e(categories:)39 b(those)24
+b(that)h(w)m(ork)e(with)g(grouping)f(table)1905 5942
+y(75)p eop
+%%Page: 76 84
+76 83 bop 0 299 a Fj(76)1338 b Fh(CHAPTER)29 b(8.)112
+b(HIERAR)m(CHICAL)30 b(GR)m(OUPING)h(R)m(OUTINES)0 555
+y Fj(HDUs)26 b(\(\013gt**\))j(and)c(those)h(that)h(w)m(ork)f(with)e
+(mem)m(b)s(er)i(HDUs)g(\(\013gm**\).)41 b(Tw)m(o)26 b(functions,)g
+(\014ts)p 3360 555 28 4 v 32 w(cop)m(y)p 3573 555 V 34
+w(group\(\))0 668 y(and)40 b(\014ts)p 314 668 V 33 w(remo)m(v)m(e)p
+626 668 V 34 w(group\(\),)k(ha)m(v)m(e)e(the)f(option)f(to)i(recursiv)m
+(ely)d(cop)m(y/delete)k(en)m(tire)e(groups.)71 b(Care)41
+b(should)0 781 y(b)s(e)33 b(tak)m(en)h(when)f(emplo)m(ying)f(these)i
+(functions)e(in)g(recursiv)m(e)h(mo)s(de)g(as)g(p)s(o)s(orly)f
+(de\014ned)g(groups)h(could)f(cause)0 894 y(unpredictable)23
+b(results.)38 b(The)25 b(problem)f(of)i(a)g(grouping)e(table)i
+(directly)e(or)i(indirectly)d(referencing)i(itself)f(\(th)m(us)0
+1007 y(creating)40 b(an)g(in\014nite)d(lo)s(op\))j(is)e(protected)j
+(against;)k(in)38 b(fact,)44 b(neither)38 b(function)h(will)e(attempt)k
+(to)f(cop)m(y)h(or)0 1120 y(delete)31 b(an)f(HDU)h(t)m(wice.)0
+1453 y Ff(8.1)135 b(Grouping)45 b(T)-11 b(able)45 b(Routines)0
+1693 y Fi(1)81 b Fj(Create)34 b(\(app)s(end\))f(a)h(grouping)e(table)i
+(at)g(the)g(end)f(of)h(the)g(curren)m(t)f(FITS)g(\014le)g(p)s(oin)m
+(ted)g(to)h(b)m(y)g(fptr.)49 b(The)227 1806 y(grpname)28
+b(parameter)h(pro)m(vides)f(the)h(grouping)e(table)h(name)h(\(GRPNAME)g
+(k)m(eyw)m(ord)g(v)-5 b(alue\))28 b(and)g(ma)m(y)227
+1919 y(b)s(e)42 b(set)h(to)g(NULL)f(if)f(no)h(group)g(name)g(is)g(to)h
+(b)s(e)e(sp)s(eci\014ed.)75 b(The)42 b(groupt)m(yp)s(e)g(parameter)g
+(sp)s(eci\014es)227 2032 y(the)c(desired)f(structure)g(of)h(the)g
+(grouping)e(table)i(and)f(ma)m(y)i(tak)m(e)g(on)f(the)g(v)-5
+b(alues:)55 b(GT)p 3355 2032 V 33 w(ID)p 3490 2032 V
+33 w(ALL)p 3705 2032 V 32 w(URI)227 2145 y(\(all)33 b(columns)f
+(created\),)k(GT)p 1274 2145 V 33 w(ID)p 1409 2145 V
+33 w(REF)d(\(ID)h(b)m(y)g(reference)g(columns\),)f(GT)p
+2904 2145 V 33 w(ID)p 3039 2145 V 33 w(POS)f(\(ID)i(b)m(y)g(p)s
+(osition)227 2258 y(columns\),)47 b(GT)p 801 2258 V 32
+w(ID)p 935 2258 V 33 w(ALL)d(\(ID)g(b)m(y)f(reference)i(and)e(p)s
+(osition)e(columns\),)47 b(GT)p 3028 2258 V 32 w(ID)p
+3162 2258 V 33 w(REF)p 3383 2258 V 33 w(URI)d(\(ID)g(b)m(y)227
+2371 y(reference)35 b(and)e(FITS)g(\014le)h(URI)f(columns\),)i(and)e
+(GT)p 2129 2371 V 33 w(ID)p 2264 2371 V 33 w(POS)p 2481
+2371 V 32 w(URI)h(\(ID)g(b)m(y)g(p)s(osition)e(and)i(FITS)f(\014le)227
+2484 y(URI)e(columns\).)95 2742 y Fe(int)47 b(fits_create_group)c(/)48
+b(ffgtcr)286 2855 y(\(fitsfile)e(*fptr,)g(char)g(*grpname,)g(int)h
+(grouptype,)e(>)i(int)g(*status\))0 3113 y Fi(2)81 b
+Fj(Create)26 b(\(insert\))f(a)g(grouping)f(table)h(just)g(after)h(the)f
+(CHDU)h(of)g(the)f(curren)m(t)g(FITS)g(\014le)f(p)s(oin)m(ted)g(to)i(b)
+m(y)g(fptr.)227 3226 y(All)i(HDUs)h(b)s(elo)m(w)f(the)h(the)g
+(insertion)e(p)s(oin)m(t)g(will)g(b)s(e)h(shifted)f(do)m(wn)m(w)m(ards)
+h(to)i(mak)m(e)g(ro)s(om)e(for)g(the)h(new)227 3339 y(HDU.)23
+b(The)e(grpname)h(parameter)g(pro)m(vides)e(the)i(grouping)f(table)g
+(name)h(\(GRPNAME)h(k)m(eyw)m(ord)f(v)-5 b(alue\))227
+3451 y(and)25 b(ma)m(y)i(b)s(e)e(set)h(to)h(NULL)e(if)g(no)h(group)f
+(name)h(is)f(to)h(b)s(e)f(sp)s(eci\014ed.)38 b(The)25
+b(groupt)m(yp)s(e)h(parameter)g(sp)s(eci-)227 3564 y(\014es)g(the)h
+(desired)e(structure)h(of)h(the)f(grouping)f(table)i(and)f(ma)m(y)h
+(tak)m(e)h(on)e(the)h(v)-5 b(alues:)38 b(GT)p 3355 3564
+V 33 w(ID)p 3490 3564 V 33 w(ALL)p 3705 3564 V 32 w(URI)227
+3677 y(\(all)33 b(columns)f(created\),)k(GT)p 1274 3677
+V 33 w(ID)p 1409 3677 V 33 w(REF)d(\(ID)h(b)m(y)g(reference)g
+(columns\),)f(GT)p 2904 3677 V 33 w(ID)p 3039 3677 V
+33 w(POS)f(\(ID)i(b)m(y)g(p)s(osition)227 3790 y(columns\),)28
+b(GT)p 782 3790 V 33 w(ID)p 917 3790 V 33 w(ALL)g(\(ID)g(b)m(y)g
+(reference)h(and)e(p)s(osition)f(columns\),)i(GT)p 2897
+3790 V 33 w(ID)p 3032 3790 V 33 w(REF)p 3253 3790 V 32
+w(URI)g(\(ID)h(b)m(y)f(ref-)227 3903 y(erence)g(and)e(FITS)h(\014le)f
+(URI)h(columns\),)g(and)f(GT)p 1976 3903 V 33 w(ID)p
+2111 3903 V 33 w(POS)p 2328 3903 V 32 w(URI)h(\(ID)g(b)m(y)g(p)s
+(osition)e(and)i(FITS)f(\014le)g(URI)227 4016 y(columns\))k(.)95
+4274 y Fe(int)47 b(fits_insert_group)c(/)48 b(ffgtis)286
+4387 y(\(fitsfile)e(*fptr,)g(char)g(*grpname,)g(int)h(grouptype,)e(>)i
+(int)g(*status\))0 4645 y Fi(3)81 b Fj(Change)20 b(the)h(structure)f
+(of)h(an)g(existing)e(grouping)h(table)g(p)s(oin)m(ted)g(to)h(b)m(y)g
+(gfptr.)37 b(The)20 b(groupt)m(yp)s(e)g(parameter)227
+4758 y(\(see)27 b(\014ts)p 532 4758 V 32 w(create)p 800
+4758 V 35 w(group\(\))e(for)h(v)-5 b(alid)24 b(parameter)i(v)-5
+b(alues\))25 b(sp)s(eci\014es)g(the)g(new)g(structure)h(of)f(the)h
+(grouping)227 4871 y(table.)43 b(This)29 b(function)h(only)g(adds)h(or)
+g(remo)m(v)m(es)h(grouping)e(table)h(columns,)f(it)h(do)s(es)g(not)g
+(add)g(or)g(delete)227 4984 y(group)26 b(mem)m(b)s(ers)f(\(i.e.,)j
+(table)e(ro)m(ws\).)40 b(If)26 b(the)g(grouping)f(table)h(already)g
+(has)g(the)h(desired)d(structure)i(then)227 5097 y(no)35
+b(op)s(erations)e(are)i(p)s(erformed)e(and)h(function)f(simply)g
+(returns)g(with)g(a)i(\(0\))g(success)g(status)g(co)s(de.)53
+b(If)227 5210 y(the)32 b(requested)g(structure)g(c)m(hange)h(creates)g
+(new)f(grouping)f(table)h(columns,)f(then)h(the)g(column)f(v)-5
+b(alues)227 5323 y(for)30 b(all)g(existing)f(mem)m(b)s(ers)h(will)d(b)s
+(e)j(\014lled)e(with)h(the)i(n)m(ull)d(v)-5 b(alues)30
+b(appropriate)f(to)i(the)g(column)e(t)m(yp)s(e.)95 5581
+y Fe(int)47 b(fits_change_group)c(/)48 b(ffgtch)286 5694
+y(\(fitsfile)e(*gfptr,)f(int)i(grouptype,)e(>)j(int)f(*status\))p
+eop
+%%Page: 77 85
+77 84 bop 0 299 a Fh(8.1.)72 b(GR)m(OUPING)31 b(T)-8
+b(ABLE)31 b(R)m(OUTINES)2235 b Fj(77)0 555 y Fi(4)81
+b Fj(Remo)m(v)m(e)41 b(the)e(group)g(de\014ned)f(b)m(y)h(the)h
+(grouping)e(table)h(p)s(oin)m(ted)f(to)i(b)m(y)g(gfptr,)h(and)e
+(optionally)f(all)g(the)227 668 y(group)29 b(mem)m(b)s(er)f(HDUs.)41
+b(The)28 b(rmopt)h(parameter)g(sp)s(eci\014es)f(the)h(action)g(to)h(b)s
+(e)e(tak)m(en)i(for)f(all)f(mem)m(b)s(ers)227 781 y(of)f(the)g(group)g
+(de\014ned)e(b)m(y)i(the)g(grouping)f(table.)39 b(V)-8
+b(alid)26 b(v)-5 b(alues)26 b(are:)40 b(OPT)p 2848 781
+28 4 v 32 w(RM)p 3030 781 V 33 w(GPT)26 b(\(delete)i(only)e(the)227
+894 y(grouping)32 b(table\))i(and)f(OPT)p 1259 894 V
+32 w(RM)p 1441 894 V 33 w(ALL)g(\(recursiv)m(ely)f(delete)i(all)e(HDUs)
+i(that)g(b)s(elong)e(to)i(the)g(group\).)227 1007 y(An)m(y)d(groups)g
+(con)m(taining)g(the)g(grouping)f(table)h(gfptr)f(as)i(a)f(mem)m(b)s
+(er)g(are)g(up)s(dated,)f(and)h(if)f(rmopt)h(==)227 1120
+y(OPT)p 431 1120 V 32 w(RM)p 613 1120 V 33 w(GPT)21 b(all)f(mem)m(b)s
+(ers)h(ha)m(v)m(e)h(their)e(GRPIDn)h(and)g(GRPLCn)f(k)m(eyw)m(ords)h
+(up)s(dated)f(accordingly)-8 b(.)227 1233 y(If)36 b(rmopt)g(==)g(OPT)p
+985 1233 V 32 w(RM)p 1167 1233 V 33 w(ALL,)g(then)g(other)h(groups)e
+(that)i(con)m(tain)g(the)f(deleted)g(mem)m(b)s(ers)g(of)g(gfptr)227
+1346 y(are)31 b(up)s(dated)e(to)i(re\015ect)g(the)g(deletion)e
+(accordingly)-8 b(.)95 1582 y Fe(int)47 b(fits_remove_group)c(/)48
+b(ffgtrm)286 1695 y(\(fitsfile)e(*gfptr,)f(int)i(rmopt,)f(>)i(int)f
+(*status\))0 1932 y Fi(5)81 b Fj(Cop)m(y)28 b(\(app)s(end\))g(the)h
+(group)f(de\014ned)g(b)m(y)h(the)f(grouping)g(table)h(p)s(oin)m(ted)e
+(to)j(b)m(y)e(infptr,)g(and)g(optionally)f(all)227 2045
+y(group)j(mem)m(b)s(er)h(HDUs,)g(to)h(the)f(FITS)f(\014le)f(p)s(oin)m
+(ted)h(to)i(b)m(y)e(outfptr.)41 b(The)31 b(cp)s(opt)f(parameter)h(sp)s
+(eci\014es)227 2158 y(the)c(action)g(to)g(b)s(e)f(tak)m(en)h(for)g(all)
+e(mem)m(b)s(ers)h(of)g(the)h(group)f(infptr.)37 b(V)-8
+b(alid)26 b(v)-5 b(alues)25 b(are:)40 b(OPT)p 3443 2158
+V 32 w(GCP)p 3674 2158 V 32 w(GPT)227 2271 y(\(cop)m(y)d(only)f(the)g
+(grouping)f(table\))h(and)f(OPT)p 1887 2271 V 32 w(GCP)p
+2118 2271 V 33 w(ALL)h(\(recursiv)m(ely)f(cop)m(y)i(ALL)e(the)i(HDUs)f
+(that)227 2384 y(b)s(elong)23 b(to)h(the)g(group)f(de\014ned)g(b)m(y)g
+(infptr\).)37 b(If)23 b(the)h(cp)s(opt)g(==)f(OPT)p 2618
+2384 V 32 w(GCP)p 2849 2384 V 32 w(GPT)h(then)f(the)h(mem)m(b)s(ers)f
+(of)227 2497 y(infptr)h(ha)m(v)m(e)i(their)f(GRPIDn)g(and)g(GRPLCn)g(k)
+m(eyw)m(ords)h(up)s(dated)e(to)i(re\015ect)g(the)g(existence)g(of)g
+(the)f(new)227 2610 y(grouping)e(table)g(outfptr,)i(since)e(they)h(no)m
+(w)g(b)s(elong)f(to)h(the)g(new)g(group.)38 b(If)23 b(cp)s(opt)h(==)f
+(OPT)p 3460 2610 V 32 w(GCP)p 3691 2610 V 32 w(ALL)227
+2723 y(then)29 b(the)g(new)g(grouping)f(table)h(outfptr)f(only)g(con)m
+(tains)i(p)s(oin)m(ters)e(to)i(the)f(copied)f(mem)m(b)s(er)h(HDUs)h
+(and)227 2836 y(not)38 b(the)g(original)d(mem)m(b)s(er)i(HDUs)h(of)g
+(infptr.)60 b(Note)39 b(that,)h(when)d(cp)s(opt)g(==)g(OPT)p
+3301 2836 V 32 w(GCP)p 3532 2836 V 33 w(ALL,)g(all)227
+2949 y(mem)m(b)s(ers)h(of)h(the)f(group)g(de\014ned)f(b)m(y)i(infptr)d
+(will)g(b)s(e)h(copied)h(to)h(a)g(single)e(FITS)h(\014le)g(p)s(oin)m
+(ted)f(to)i(b)m(y)227 3061 y(outfptr)30 b(regardless)g(of)g(their)g
+(\014le)f(distribution)e(in)i(the)i(original)d(group.)95
+3298 y Fe(int)47 b(fits_copy_group)d(/)j(ffgtcp)286 3411
+y(\(fitsfile)f(*infptr,)f(fitsfile)h(*outfptr,)f(int)i(cpopt,)f(>)h
+(int)g(*status\))0 3648 y Fi(6)81 b Fj(Merge)40 b(the)f(t)m(w)m(o)h
+(groups)e(de\014ned)g(b)m(y)h(the)g(grouping)f(table)g(HDUs)i(infptr)d
+(and)h(outfptr)h(b)m(y)f(com)m(bining)227 3761 y(their)29
+b(mem)m(b)s(ers)g(in)m(to)h(a)g(single)e(grouping)g(table.)41
+b(All)28 b(mem)m(b)s(er)h(HDUs)h(\(ro)m(ws\))h(are)f(copied)f(from)g
+(infptr)227 3874 y(to)f(outfptr.)39 b(If)26 b(mgopt)i(==)e(OPT)p
+1419 3874 V 32 w(MR)m(G)p 1669 3874 V 34 w(COPY)g(then)g(infptr)f(con)m
+(tin)m(ues)i(to)h(exist)f(unaltered)e(after)j(the)227
+3987 y(merge.)57 b(If)36 b(the)f(mgopt)i(==)e(OPT)p 1474
+3987 V 31 w(MR)m(G)p 1723 3987 V 34 w(MO)m(V)i(then)e(infptr)e(is)i
+(deleted)h(after)g(the)g(merge.)57 b(In)35 b(b)s(oth)227
+4100 y(cases,)d(the)e(GRPIDn)h(and)e(GRPLCn)h(k)m(eyw)m(ords)g(of)h
+(the)g(mem)m(b)s(er)e(HDUs)i(are)g(up)s(dated)e(accordingly)-8
+b(.)95 4337 y Fe(int)47 b(fits_merge_groups)c(/)48 b(ffgtmg)286
+4450 y(\(fitsfile)e(*infptr,)f(fitsfile)h(*outfptr,)f(int)i(mgopt,)f(>)
+h(int)g(*status\))0 4687 y Fi(7)81 b Fj("Compact")24
+b(the)f(group)g(de\014ned)f(b)m(y)h(grouping)e(table)i(p)s(oin)m(ted)f
+(to)i(b)m(y)f(gfptr.)38 b(The)23 b(compaction)g(is)f(ac)m(hiev)m(ed)227
+4799 y(b)m(y)37 b(merging)g(\(via)g(\014ts)p 1034 4799
+V 32 w(merge)p 1303 4799 V 34 w(groups\(\)\))g(all)f(direct)h(mem)m(b)s
+(er)g(HDUs)g(of)h(gfptr)e(that)i(are)g(themselv)m(es)227
+4912 y(grouping)h(tables.)69 b(The)40 b(cmopt)g(parameter)h(de\014nes)e
+(whether)g(the)i(merged)f(grouping)e(table)i(HDUs)227
+5025 y(remain)j(after)i(merging)e(\(cmopt)i(==)f(OPT)p
+1852 5025 V 32 w(CMT)p 2099 5025 V 32 w(MBR\))h(or)f(if)f(they)i(are)f
+(deleted)g(after)h(merging)227 5138 y(\(cmopt)31 b(==)f(OPT)p
+916 5138 V 32 w(CMT)p 1163 5138 V 32 w(MBR)p 1409 5138
+V 34 w(DEL\).)g(If)g(the)h(grouping)d(table)j(con)m(tains)f(no)g
+(direct)g(mem)m(b)s(er)f(HDUs)227 5251 y(that)i(are)f(themselv)m(es)g
+(grouping)e(tables)i(then)f(this)g(function)f(do)s(es)i(nothing.)39
+b(Note)31 b(that)g(this)d(function)227 5364 y(is)i(not)g(recursiv)m(e,)
+g(i.e.,)h(only)f(the)g(direct)g(mem)m(b)s(er)g(HDUs)h(of)f(gfptr)g(are)
+h(considered)e(for)h(merging.)95 5601 y Fe(int)47 b(fits_compact_group)
+c(/)48 b(ffgtcm)286 5714 y(\(fitsfile)e(*gfptr,)f(int)i(cmopt,)f(>)i
+(int)f(*status\))p eop
+%%Page: 78 86
+78 85 bop 0 299 a Fj(78)1338 b Fh(CHAPTER)29 b(8.)112
+b(HIERAR)m(CHICAL)30 b(GR)m(OUPING)h(R)m(OUTINES)0 555
+y Fi(8)81 b Fj(V)-8 b(erify)20 b(the)i(in)m(tegrit)m(y)f(of)g(the)g
+(grouping)f(table)h(p)s(oin)m(ted)f(to)i(b)m(y)f(gfptr)g(to)h(mak)m(e)g
+(sure)e(that)i(all)e(group)h(mem)m(b)s(ers)227 668 y(are)31
+b(accessible)g(and)f(that)h(all)e(links)g(to)i(other)g(grouping)e
+(tables)i(are)g(v)-5 b(alid.)40 b(The)30 b(\014rstfailed)e(parameter)
+227 781 y(returns)e(the)i(mem)m(b)s(er)e(ID)h(\(ro)m(w)h(n)m(um)m(b)s
+(er\))e(of)i(the)f(\014rst)f(mem)m(b)s(er)h(HDU)h(to)g(fail)e(v)m
+(eri\014cation)g(\(if)h(p)s(ositiv)m(e)227 894 y(v)-5
+b(alue\))35 b(or)f(the)h(\014rst)e(group)h(link)e(to)k(fail)d(\(if)g
+(negativ)m(e)j(v)-5 b(alue\).)53 b(If)34 b(gfptr)g(is)f(successfully)g
+(v)m(eri\014ed)g(then)227 1007 y(\014rstfailed)c(con)m(tains)h(a)h
+(return)e(v)-5 b(alue)30 b(of)h(0.)95 1284 y Fe(int)47
+b(fits_verify_group)c(/)48 b(ffgtvf)286 1397 y(\(fitsfile)e(*gfptr,)f
+(>)j(long)f(*firstfailed,)d(int)j(*status\))0 1674 y
+Fi(9)81 b Fj(Op)s(en)23 b(a)j(grouping)e(table)h(that)h(con)m(tains)f
+(the)h(mem)m(b)s(er)e(HDU)i(p)s(oin)m(ted)e(to)i(b)m(y)f(mfptr.)38
+b(The)25 b(grouping)f(table)227 1787 y(to)39 b(op)s(en)e(is)g
+(de\014ned)g(b)m(y)h(the)g(grpid)e(parameter,)k(whic)m(h)d(con)m(tains)
+h(the)g(k)m(eyw)m(ord)h(index)d(v)-5 b(alue)38 b(of)g(the)227
+1900 y(GRPIDn/GRPLCn)d(k)m(eyw)m(ord\(s\))g(that)h(link)d(the)i(mem)m
+(b)s(er)f(HDU)h(mfptr)f(to)i(the)f(grouping)e(table.)54
+b(If)227 2013 y(the)30 b(grouping)e(table)h(resides)f(in)h(a)g(\014le)g
+(other)g(than)h(the)f(mem)m(b)s(er)g(HDUs)h(\014le)e(then)h(an)h
+(attempt)g(is)f(\014rst)227 2126 y(made)g(to)h(op)s(en)e(the)h(\014le)f
+(readwrite,)h(and)f(failing)f(that)j(readonly)-8 b(.)39
+b(A)29 b(p)s(oin)m(ter)f(to)i(the)f(op)s(ened)f(grouping)227
+2238 y(table)j(HDU)g(is)e(returned)g(in)g(gfptr.)227
+2397 y(Note)35 b(that)g(it)e(is)g(p)s(ossible,)f(although)i(unlik)m
+(ely)d(and)i(undesirable,)f(for)i(the)g(GRPIDn/GRPLCn)f(k)m(ey-)227
+2510 y(w)m(ords)k(in)f(a)h(mem)m(b)s(er)g(HDU)h(header)f(to)h(b)s(e)e
+(non-con)m(tin)m(uous,)j(e.g.,)h(GRPID1,)g(GRPID2,)g(GRPID5,)227
+2623 y(GRPID6.)i(In)29 b(suc)m(h)g(cases,)i(the)f(grpid)e(index)g(v)-5
+b(alue)30 b(sp)s(eci\014ed)e(in)g(the)i(function)e(call)i(shall)e(iden)
+m(tify)g(the)227 2736 y(\(grpid\)th)35 b(GRPID)g(v)-5
+b(alue.)56 b(In)34 b(the)i(ab)s(o)m(v)m(e)h(example,)f(if)f(grpid)e(==)
+i(3,)j(then)d(the)g(group)g(sp)s(eci\014ed)f(b)m(y)227
+2849 y(GRPID5)d(w)m(ould)f(b)s(e)f(op)s(ened.)95 3126
+y Fe(int)47 b(fits_open_group)d(/)j(ffgtop)286 3239 y(\(fitsfile)f
+(*mfptr,)f(int)i(group,)f(>)i(fitsfile)d(**gfptr,)h(int)h(*status\))0
+3516 y Fi(10)f Fj(Add)38 b(a)h(mem)m(b)s(er)f(HDU)i(to)f(an)g(existing)
+e(grouping)h(table)h(p)s(oin)m(ted)e(to)j(b)m(y)e(gfptr.)66
+b(The)38 b(mem)m(b)s(er)g(HDU)227 3629 y(ma)m(y)30 b(either)f(b)s(e)g
+(p)s(oin)m(ted)f(to)i(mfptr)f(\(whic)m(h)f(m)m(ust)i(b)s(e)e(p)s
+(ositioned)g(to)i(the)f(mem)m(b)s(er)g(HDU\))i(or,)f(if)e(mfptr)227
+3742 y(==)36 b(NULL,)g(iden)m(ti\014ed)e(b)m(y)i(the)g(hdup)s(os)e
+(parameter)i(\(the)h(HDU)g(p)s(osition)d(n)m(um)m(b)s(er,)i(Primary)e
+(arra)m(y)227 3855 y(==)g(1\))i(if)e(b)s(oth)g(the)h(grouping)f(table)g
+(and)h(the)g(mem)m(b)s(er)f(HDU)h(reside)f(in)g(the)h(same)g(FITS)f
+(\014le.)53 b(The)227 3968 y(new)27 b(mem)m(b)s(er)f(HDU)h(shall)e(ha)m
+(v)m(e)j(the)f(appropriate)f(GRPIDn)g(and)g(GRPLCn)g(k)m(eyw)m(ords)h
+(created)h(in)e(its)227 4081 y(header.)44 b(Note)33 b(that)f(if)f(the)h
+(mem)m(b)s(er)e(HDU)j(is)d(already)h(a)h(mem)m(b)s(er)f(of)h(the)g
+(group)f(then)g(it)g(will)e(not)j(b)s(e)227 4194 y(added)e(a)h(second)f
+(time.)95 4471 y Fe(int)47 b(fits_add_group_member)42
+b(/)48 b(ffgtam)286 4584 y(\(fitsfile)e(*gfptr,)f(fitsfile)h(*mfptr,)g
+(int)h(hdupos,)f(>)h(int)g(*status\))0 4938 y Ff(8.2)135
+b(Group)45 b(Mem)l(b)t(er)f(Routines)0 5191 y Fi(1)81
+b Fj(Return)29 b(the)h(n)m(um)m(b)s(er)f(of)i(mem)m(b)s(er)e(HDUs)i(in)
+e(a)i(grouping)d(table)j(gfptr.)40 b(The)30 b(n)m(um)m(b)s(er)e(mem)m
+(b)s(er)i(HDUs)h(is)227 5304 y(just)f(the)h(NAXIS2)f(v)-5
+b(alue)30 b(\(n)m(um)m(b)s(er)g(of)g(ro)m(ws\))h(of)f(the)h(grouping)e
+(table.)95 5581 y Fe(int)47 b(fits_get_num_members)c(/)k(ffgtnm)286
+5694 y(\(fitsfile)f(*gfptr,)f(>)j(long)f(*nmembers,)e(int)h(*status\))p
 eop
-%%Page: 105 111
-105 110 bop 0 1225 a Fg(Chapter)65 b(8)0 1687 y Fm(Sp)6
+%%Page: 79 87
+79 86 bop 0 299 a Fh(8.2.)72 b(GR)m(OUP)31 b(MEMBER)g(R)m(OUTINES)2295
+b Fj(79)0 555 y Fi(2)81 b Fj(Return)34 b(the)h(n)m(um)m(b)s(er)f(of)i
+(groups)e(to)i(whic)m(h)e(the)h(HDU)h(p)s(oin)m(ted)e(to)i(b)m(y)f
+(mfptr)f(is)h(link)m(ed,)g(as)g(de\014ned)f(b)m(y)227
+668 y(the)27 b(n)m(um)m(b)s(er)f(of)h(GRPIDn/GRPLCn)f(k)m(eyw)m(ord)i
+(records)e(that)i(app)s(ear)e(in)f(its)i(header.)39 b(Note)28
+b(that)g(eac)m(h)227 781 y(time)36 b(this)g(function)f(is)g(called,)j
+(the)e(indices)f(of)i(the)f(GRPIDn/GRPLCn)g(k)m(eyw)m(ords)h(are)g(c)m
+(hec)m(k)m(ed)h(to)227 894 y(mak)m(e)29 b(sure)e(they)g(are)h(con)m
+(tin)m(uous)f(\(ie)h(no)f(gaps\))h(and)f(are)h(re-en)m(umerated)g(to)h
+(eliminate)d(gaps)i(if)e(found.)95 1228 y Fe(int)47 b
+(fits_get_num_groups)c(/)k(ffgmng)286 1341 y(\(fitsfile)f(*mfptr,)f(>)j
+(long)f(*nmembers,)e(int)h(*status\))0 1563 y Fi(3)81
+b Fj(Op)s(en)26 b(a)i(mem)m(b)s(er)f(of)h(the)f(grouping)g(table)g(p)s
+(oin)m(ted)g(to)h(b)m(y)g(gfptr.)39 b(The)27 b(mem)m(b)s(er)g(to)i(op)s
+(en)e(is)f(iden)m(ti\014ed)g(b)m(y)227 1676 y(its)j(ro)m(w)h(n)m(um)m
+(b)s(er)e(within)f(the)i(grouping)g(table)g(as)h(giv)m(en)f(b)m(y)h
+(the)f(parameter)h('mem)m(b)s(er')f(\(\014rst)h(mem)m(b)s(er)227
+1788 y(==)g(1\))g(.)41 b(A)30 b(\014ts\014le)e(p)s(oin)m(ter)h(to)i
+(the)f(op)s(ened)f(mem)m(b)s(er)g(HDU)i(is)e(returned)g(as)h(mfptr.)39
+b(Note)31 b(that)g(if)e(the)227 1901 y(mem)m(b)s(er)f(HDU)h(resides)f
+(in)f(a)i(FITS)f(\014le)f(di\013eren)m(t)h(from)g(the)h(grouping)e
+(table)h(HDU)i(then)e(the)h(mem)m(b)s(er)227 2014 y(\014le)h(is)f
+(\014rst)h(op)s(ened)f(readwrite)h(and,)g(failing)e(this,)i(op)s(ened)f
+(readonly)-8 b(.)95 2236 y Fe(int)47 b(fits_open_member)d(/)j(ffgmop)
+286 2349 y(\(fitsfile)f(*gfptr,)f(long)i(member,)f(>)h(fitsfile)f
+(**mfptr,)f(int)i(*status\))0 2570 y Fi(4)81 b Fj(Cop)m(y)27
+b(\(app)s(end\))f(a)i(mem)m(b)s(er)f(HDU)h(of)f(the)h(grouping)d(table)
+j(p)s(oin)m(ted)e(to)i(b)m(y)f(gfptr.)39 b(The)27 b(mem)m(b)s(er)g(HDU)
+h(is)227 2683 y(iden)m(ti\014ed)j(b)m(y)i(its)g(ro)m(w)g(n)m(um)m(b)s
+(er)e(within)g(the)i(grouping)f(table)g(as)i(giv)m(en)f(b)m(y)f(the)i
+(parameter)f('mem)m(b)s(er')227 2796 y(\(\014rst)j(mem)m(b)s(er)f(==)g
+(1\).)58 b(The)35 b(cop)m(y)i(of)f(the)g(group)f(mem)m(b)s(er)g(HDU)i
+(will)c(b)s(e)i(app)s(ended)f(to)j(the)f(FITS)227 2909
+y(\014le)28 b(p)s(oin)m(ted)g(to)h(b)m(y)f(mfptr,)h(and)f(up)s(on)f
+(return)g(mfptr)h(shall)f(p)s(oin)m(t)g(to)j(the)f(copied)f(mem)m(b)s
+(er)g(HDU.)h(The)227 3022 y(cp)s(opt)e(parameter)h(ma)m(y)g(tak)m(e)h
+(on)e(the)g(follo)m(wing)f(v)-5 b(alues:)39 b(OPT)p 2465
+3022 28 4 v 32 w(MCP)p 2708 3022 V 32 w(ADD)29 b(whic)m(h)d(adds)g(a)i
+(new)f(en)m(try)227 3135 y(in)c(gfptr)h(for)f(the)i(copied)e(mem)m(b)s
+(er)h(HDU,)h(OPT)p 1907 3135 V 31 w(MCP)p 2149 3135 V
+33 w(NADD)g(whic)m(h)e(do)s(es)h(not)g(add)f(an)h(en)m(try)h(in)d
+(gfptr)227 3247 y(for)j(the)h(copied)e(mem)m(b)s(er,)i(and)f(OPT)p
+1536 3247 V 32 w(MCP)p 1779 3247 V 32 w(REPL)g(whic)m(h)f(replaces)h
+(the)g(original)e(mem)m(b)s(er)i(en)m(try)g(with)227
+3360 y(the)31 b(copied)f(mem)m(b)s(er)f(en)m(try)-8 b(.)95
+3582 y Fe(int)47 b(fits_copy_member)d(/)j(ffgmcp)286
+3695 y(\(fitsfile)f(*gfptr,)f(fitsfile)h(*mfptr,)g(long)g(member,)g
+(int)h(cpopt,)f(>)i(int)f(*status\))0 3916 y Fi(5)81
+b Fj(T)-8 b(ransfer)34 b(a)i(group)f(mem)m(b)s(er)f(HDU)i(from)f(the)h
+(grouping)e(table)h(p)s(oin)m(ted)f(to)i(b)m(y)f(infptr)f(to)i(the)f
+(grouping)227 4029 y(table)h(p)s(oin)m(ted)f(to)i(b)m(y)f(outfptr.)58
+b(The)35 b(mem)m(b)s(er)h(HDU)h(to)f(transfer)g(is)f(iden)m(ti\014ed)f
+(b)m(y)i(its)g(ro)m(w)g(n)m(um)m(b)s(er)227 4142 y(within)k(infptr)g
+(as)j(sp)s(eci\014ed)e(b)m(y)h(the)h(parameter)g('mem)m(b)s(er')f
+(\(\014rst)g(mem)m(b)s(er)g(==)f(1\).)78 b(If)42 b(tfopt)h(==)227
+4255 y(OPT)p 431 4255 V 32 w(MCP)p 674 4255 V 33 w(ADD)26
+b(then)f(the)h(mem)m(b)s(er)e(HDU)i(is)f(made)g(a)h(mem)m(b)s(er)f(of)g
+(outfptr)g(and)g(remains)f(a)i(mem)m(b)s(er)227 4368
+y(of)34 b(infptr.)50 b(If)34 b(tfopt)g(==)g(OPT)p 1339
+4368 V 32 w(MCP)p 1582 4368 V 32 w(MO)m(V)h(then)f(the)g(mem)m(b)s(er)f
+(HDU)i(is)e(deleted)h(from)f(infptr)f(after)227 4481
+y(the)f(transfer)f(to)h(outfptr.)95 4702 y Fe(int)47
+b(fits_transfer_member)c(/)k(ffgmtf)286 4815 y(\(fitsfile)f(*infptr,)f
+(fitsfile)h(*outfptr,)f(long)i(member,)e(int)i(tfopt,)334
+4928 y(>)h(int)e(*status\))0 5149 y Fi(6)81 b Fj(Remo)m(v)m(e)31
+b(a)e(mem)m(b)s(er)g(HDU)h(from)f(the)h(grouping)e(table)h(p)s(oin)m
+(ted)f(to)i(b)m(y)g(gfptr.)40 b(The)29 b(mem)m(b)s(er)f(HDU)i(to)h(b)s
+(e)227 5262 y(deleted)36 b(is)e(iden)m(ti\014ed)g(b)m(y)h(its)g(ro)m(w)
+h(n)m(um)m(b)s(er)f(in)f(the)i(grouping)e(table)h(as)h(sp)s(eci\014ed)e
+(b)m(y)i(the)f(parameter)227 5375 y('mem)m(b)s(er')41
+b(\(\014rst)g(mem)m(b)s(er)g(==)f(1\).)74 b(The)41 b(rmopt)g(parameter)
+h(ma)m(y)f(tak)m(e)i(on)e(the)h(follo)m(wing)d(v)-5 b(alues:)227
+5488 y(OPT)p 431 5488 V 32 w(RM)p 613 5488 V 33 w(ENTR)d(Y)34
+b(whic)m(h)d(remo)m(v)m(es)k(the)e(mem)m(b)s(er)g(HDU)h(en)m(try)f
+(from)g(the)g(grouping)f(table)h(and)g(up-)227 5601 y(dates)40
+b(the)f(mem)m(b)s(er's)f(GRPIDn/GRPLCn)g(k)m(eyw)m(ords,)k(and)c(OPT)p
+2687 5601 V 32 w(RM)p 2869 5601 V 33 w(MBR)h(whic)m(h)f(remo)m(v)m(es)i
+(the)227 5714 y(mem)m(b)s(er)30 b(HDU)h(en)m(try)g(from)f(the)g
+(grouping)f(table)i(and)e(deletes)i(the)f(mem)m(b)s(er)g(HDU)h(itself.)
+p eop
+%%Page: 80 88
+80 87 bop 0 299 a Fj(80)1338 b Fh(CHAPTER)29 b(8.)112
+b(HIERAR)m(CHICAL)30 b(GR)m(OUPING)h(R)m(OUTINES)95 555
+y Fe(int)47 b(fits_remove_member)c(/)48 b(ffgmrm)286
+668 y(\(fitsfile)e(*fptr,)g(long)g(member,)g(int)h(rmopt,)f(>)i(int)f
+(*status\))p eop
+%%Page: 81 89
+81 88 bop 0 1225 a Fg(Chapter)65 b(9)0 1687 y Fm(Sp)6
 b(ecialized)77 b(CFITSIO)f(In)-6 b(terface)0 1937 y(Routines)0
-2429 y Fj(The)34 b(basic)h(in)m(terface)g(routines)f(describ)s(ed)f(in)
-g(the)i(previous)f(c)m(hapter)h(should)e(b)s(e)h(used)g(whenev)m(er)h
-(p)s(ossible,)0 2542 y(but)g(the)i(routines)d(describ)s(ed)g(in)h(this)
-g(c)m(hapter)i(are)f(also)g(a)m(v)-5 b(ailable)36 b(if)f(necessary)-8
-b(.)58 b(Some)36 b(of)h(these)f(routines)0 2655 y(p)s(erform)23
-b(more)i(sp)s(ecialized)d(function)h(that)i(cannot)g(easily)f(b)s(e)g
-(done)g(with)f(the)i(basic)f(in)m(terface)h(routines)e(while)0
-2767 y(others)i(duplicate)e(the)h(functionalit)m(y)f(of)i(the)f(basic)g
-(routines)f(but)h(ha)m(v)m(e)i(a)f(sligh)m(tly)d(di\013eren)m(t)i
-(calling)f(sequence.)0 2880 y(See)31 b(App)s(endix)c(B)k(for)f(the)h
-(de\014nition)d(of)i(the)h(parameters)g(used)e(in)g(these)i(routines.)0
-3210 y Fe(8.1)135 b(Sp)t(ecialized)46 b(FITS)e(File)h(Access)f
-(Routines)0 3446 y Fi(1)81 b Fj(Op)s(en)37 b(an)i(existing)g(FITS)f
-(\014le)g(residing)f(in)h(core)i(computer)f(memory)-8
-b(.)68 b(This)37 b(routine)h(is)h(analogous)g(to)227
-3559 y(\014ts)p 354 3559 28 4 v 33 w(op)s(en)p 577 3559
-V 32 w(\014le.)54 b(The)35 b('\014lename')f(is)g(curren)m(tly)h
-(ignored)f(b)m(y)h(this)f(routine)g(and)h(ma)m(y)g(b)s(e)g(an)m(y)g
-(arbitrary)227 3672 y(string.)77 b(In)42 b(general,)k(the)d
-(application)e(m)m(ust)i(ha)m(v)m(e)h(preallo)s(cated)e(an)g(initial)e
-(blo)s(c)m(k)j(of)g(memory)f(to)227 3785 y(hold)h(the)i(FITS)f(\014le)g
-(prior)f(to)i(calling)e(this)g(routine:)69 b('memptr')44
-b(p)s(oin)m(ts)f(to)j(the)e(starting)h(address)227 3898
-y(and)39 b('memsize')h(giv)m(es)g(the)g(initial)d(size)i(of)h(the)g
-(blo)s(c)m(k)f(of)h(memory)-8 b(.)69 b('mem)p 2958 3898
-V 33 w(reallo)s(c')39 b(is)g(a)h(p)s(oin)m(ter)e(to)227
-4011 y(an)d(optional)g(function)e(that)j(CFITSIO)e(can)h(call)f(to)i
-(allo)s(cate)g(additional)d(memory)-8 b(,)37 b(if)d(needed)g(\(only)227
-4124 y(if)40 b(mo)s(de)f(=)h(READ)m(WRITE\),)i(and)e(is)f(mo)s(deled)g
-(after)i(the)f(standard)g(C)g('reallo)s(c')g(function;)k(a)d(n)m(ull)
-227 4237 y(p)s(oin)m(ter)f(ma)m(y)h(b)s(e)f(giv)m(en)h(if)e(the)i
-(initial)d(allo)s(cation)i(of)h(memory)f(is)g(all)f(that)i(will)d(b)s
-(e)i(required)f(\(e.g.,)227 4350 y(if)34 b(the)h(\014le)f(is)g(op)s
-(ened)g(with)g(mo)s(de)g(=)h(READONL)-8 b(Y\).)36 b(The)e('deltasize')h
-(parameter)g(ma)m(y)h(b)s(e)e(used)g(to)227 4463 y(suggest)g(a)f(minim)
-m(um)d(amoun)m(t)j(of)g(additional)e(memory)i(that)g(should)e(b)s(e)h
-(allo)s(cated)h(during)e(eac)m(h)j(call)227 4575 y(to)d(the)f(memory)f
-(reallo)s(cation)g(function.)39 b(By)30 b(default,)f(CFITSIO)f(will)f
-(reallo)s(cate)k(enough)e(additional)227 4688 y(space)44
-b(to)g(hold)e(the)i(en)m(tire)f(curren)m(tly)f(de\014ned)h(FITS)f
-(\014le)h(\(as)g(giv)m(en)h(b)m(y)f(the)h(NAXISn)e(k)m(eyw)m(ords\))227
-4801 y(or)g(1)f(FITS)g(blo)s(c)m(k)g(\(=)g(2880)i(b)m(ytes\),)i(whic)m
-(h)c(ev)m(er)h(is)e(larger.)73 b(V)-8 b(alues)42 b(of)f(deltasize)g
-(less)g(than)g(2880)227 4914 y(will)28 b(b)s(e)i(ignored.)41
-b(Since)30 b(the)h(memory)g(reallo)s(cation)f(op)s(eration)g(can)h(b)s
-(e)f(computationally)f(exp)s(ensiv)m(e,)227 5027 y(allo)s(cating)24
-b(a)h(larger)f(initial)e(blo)s(c)m(k)i(of)h(memory)-8
-b(,)26 b(and/or)f(sp)s(ecifying)d(a)j(larger)g(deltasize)f(v)-5
-b(alue)24 b(ma)m(y)h(help)227 5140 y(to)31 b(reduce)g(the)f(n)m(um)m(b)
-s(er)f(of)i(reallo)s(cation)e(calls)h(and)g(mak)m(e)h(the)g
-(application)d(program)i(run)f(faster.)95 5375 y Ff(int)47
-b(fits_open_memfile)c(/)48 b(ffomem)286 5488 y(\(fitsfile)e(**fptr,)f
-(const)i(char)f(*filename,)f(int)i(mode,)g(void)f(**memptr,)334
-5601 y(size_t)g(*memsize,)f(size_t)i(deltasize,)334 5714
-y(void)g(*\(*mem_realloc\)\(void)42 b(*p,)47 b(size_t)f(newsize\),)f
-(int)i(*status\))1882 5942 y Fj(105)p eop
-%%Page: 106 112
-106 111 bop 0 299 a Fj(106)958 b Fh(CHAPTER)30 b(8.)112
+2429 y Fj(The)28 b(basic)g(in)m(terface)i(routines)e(describ)s(ed)e
+(previously)h(are)i(recommended)f(for)h(most)g(uses,)g(but)f(the)h
+(routines)0 2542 y(describ)s(ed)g(in)g(this)h(c)m(hapter)h(are)h(also)e
+(a)m(v)-5 b(ailable)31 b(if)e(necessary)-8 b(.)43 b(Some)31
+b(of)g(these)g(routines)f(p)s(erform)f(more)i(sp)s(e-)0
+2655 y(cialized)26 b(function)f(that)j(cannot)f(easily)f(b)s(e)g(done)h
+(with)e(the)i(basic)g(in)m(terface)g(routines)f(while)e(others)j
+(duplicate)0 2767 y(the)j(functionalit)m(y)f(of)h(the)g(basic)g
+(routines)f(but)g(ha)m(v)m(e)i(a)g(sligh)m(tly)d(di\013eren)m(t)i
+(calling)e(sequence.)41 b(See)31 b(App)s(endix)0 2880
+y(B)g(for)f(the)g(de\014nition)e(of)j(eac)m(h)h(function)d(parameter.)0
+3210 y Ff(9.1)135 b(FITS)44 b(File)i(Access)e(Routines)0
+3446 y Fi(1)81 b Fj(Op)s(en)37 b(an)i(existing)g(FITS)f(\014le)g
+(residing)f(in)h(core)i(computer)f(memory)-8 b(.)68 b(This)37
+b(routine)h(is)h(analogous)g(to)227 3559 y(\014ts)p 354
+3559 28 4 v 33 w(op)s(en)p 577 3559 V 32 w(\014le.)54
+b(The)35 b('\014lename')f(is)g(curren)m(tly)h(ignored)f(b)m(y)h(this)f
+(routine)g(and)h(ma)m(y)g(b)s(e)g(an)m(y)g(arbitrary)227
+3672 y(string.)77 b(In)42 b(general,)k(the)d(application)e(m)m(ust)i
+(ha)m(v)m(e)h(preallo)s(cated)e(an)g(initial)e(blo)s(c)m(k)j(of)g
+(memory)f(to)227 3785 y(hold)h(the)i(FITS)f(\014le)g(prior)f(to)i
+(calling)e(this)g(routine:)69 b('memptr')44 b(p)s(oin)m(ts)f(to)j(the)e
+(starting)h(address)227 3898 y(and)39 b('memsize')h(giv)m(es)g(the)g
+(initial)d(size)i(of)h(the)g(blo)s(c)m(k)f(of)h(memory)-8
+b(.)69 b('mem)p 2958 3898 V 33 w(reallo)s(c')39 b(is)g(a)h(p)s(oin)m
+(ter)e(to)227 4011 y(an)d(optional)g(function)e(that)j(CFITSIO)e(can)h
+(call)f(to)i(allo)s(cate)g(additional)d(memory)-8 b(,)37
+b(if)d(needed)g(\(only)227 4124 y(if)40 b(mo)s(de)f(=)h(READ)m
+(WRITE\),)i(and)e(is)f(mo)s(deled)g(after)i(the)f(standard)g(C)g
+('reallo)s(c')g(function;)k(a)d(n)m(ull)227 4237 y(p)s(oin)m(ter)f(ma)m
+(y)h(b)s(e)f(giv)m(en)h(if)e(the)i(initial)d(allo)s(cation)i(of)h
+(memory)f(is)g(all)f(that)i(will)d(b)s(e)i(required)f(\(e.g.,)227
+4350 y(if)34 b(the)h(\014le)f(is)g(op)s(ened)g(with)g(mo)s(de)g(=)h
+(READONL)-8 b(Y\).)36 b(The)e('deltasize')h(parameter)g(ma)m(y)h(b)s(e)
+e(used)g(to)227 4463 y(suggest)g(a)f(minim)m(um)d(amoun)m(t)j(of)g
+(additional)e(memory)i(that)g(should)e(b)s(e)h(allo)s(cated)h(during)e
+(eac)m(h)j(call)227 4575 y(to)d(the)f(memory)f(reallo)s(cation)g
+(function.)39 b(By)30 b(default,)f(CFITSIO)f(will)f(reallo)s(cate)k
+(enough)e(additional)227 4688 y(space)44 b(to)g(hold)e(the)i(en)m(tire)
+f(curren)m(tly)f(de\014ned)h(FITS)f(\014le)h(\(as)g(giv)m(en)h(b)m(y)f
+(the)h(NAXISn)e(k)m(eyw)m(ords\))227 4801 y(or)g(1)f(FITS)g(blo)s(c)m
+(k)g(\(=)g(2880)i(b)m(ytes\),)i(whic)m(h)c(ev)m(er)h(is)e(larger.)73
+b(V)-8 b(alues)42 b(of)f(deltasize)g(less)g(than)g(2880)227
+4914 y(will)28 b(b)s(e)i(ignored.)41 b(Since)30 b(the)h(memory)g
+(reallo)s(cation)f(op)s(eration)g(can)h(b)s(e)f(computationally)f(exp)s
+(ensiv)m(e,)227 5027 y(allo)s(cating)24 b(a)h(larger)f(initial)e(blo)s
+(c)m(k)i(of)h(memory)-8 b(,)26 b(and/or)f(sp)s(ecifying)d(a)j(larger)g
+(deltasize)f(v)-5 b(alue)24 b(ma)m(y)h(help)227 5140
+y(to)31 b(reduce)g(the)f(n)m(um)m(b)s(er)f(of)i(reallo)s(cation)e
+(calls)h(and)g(mak)m(e)h(the)g(application)d(program)i(run)f(faster.)95
+5375 y Fe(int)47 b(fits_open_memfile)c(/)48 b(ffomem)286
+5488 y(\(fitsfile)e(**fptr,)f(const)i(char)f(*filename,)f(int)i(mode,)g
+(void)f(**memptr,)334 5601 y(size_t)g(*memsize,)f(size_t)i(deltasize,)
+334 5714 y(void)g(*\(*mem_realloc\)\(void)42 b(*p,)47
+b(size_t)f(newsize\),)f(int)i(*status\))1905 5942 y Fj(81)p
+eop
+%%Page: 82 90
+82 89 bop 0 299 a Fj(82)1003 b Fh(CHAPTER)30 b(9.)112
 b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
 555 y Fi(2)81 b Fj(Create)49 b(a)g(new)f(FITS)g(\014le)g(residing)e(in)
 i(core)h(computer)g(memory)-8 b(.)96 b(This)47 b(routine)g(is)h
@@ -9172,1934 +7531,4749 @@ b(of)i(deltasize)f(less)f(than)h(2880)i(will)29 b(b)s(e)j(ig-)227
 b(,)28 b(and/or)e(sp)s(ecifying)e(a)i(larger)g(deltasize)g(v)-5
 b(alue)26 b(ma)m(y)h(help)d(to)j(reduce)227 1910 y(the)k(n)m(um)m(b)s
 (er)e(of)h(reallo)s(cation)g(calls)g(and)f(mak)m(e)j(the)e(application)
-f(program)h(run)f(faster.)95 2195 y Ff(int)47 b(fits_create_memfile)c
-(/)k(ffimem)286 2308 y(\(fitsfile)f(**fptr,)f(void)i(**memptr,)334
-2421 y(size_t)f(*memsize,)f(size_t)i(deltasize,)334 2534
+f(program)h(run)f(faster.)95 2147 y Fe(int)47 b(fits_create_memfile)c
+(/)k(ffimem)286 2260 y(\(fitsfile)f(**fptr,)f(void)i(**memptr,)334
+2373 y(size_t)f(*memsize,)f(size_t)i(deltasize,)334 2486
 y(void)g(*\(*mem_realloc\)\(void)42 b(*p,)47 b(size_t)f(newsize\),)f
-(int)i(*status\))0 2819 y Fi(3)81 b Fj(Flush)38 b(an)m(y)j(in)m(ternal)
-e(bu\013ers)h(of)g(data)h(to)g(the)g(output)f(FITS)g(\014le.)70
-b(This)38 b(routine)i(rarely)f(needs)h(to)i(b)s(e)227
-2932 y(called,)36 b(but)e(can)h(b)s(e)f(useful)f(when)g(writing)g(to)i
-(the)g(FITS)f(\014les)g(in)f(memory)-8 b(,)37 b(and)d(will)e(ensure)i
-(that)h(if)227 3045 y(the)c(program)f(subsequen)m(tly)f(ab)s(orts)h
-(then)g(the)h(FITS)e(\014le)h(will)d(ha)m(v)m(e)32 b(b)s(een)e(closed)g
-(prop)s(erly)-8 b(.)95 3330 y Ff(int)47 b(fits_flush_file)d(/)j(ffflus)
-286 3443 y(\(fitsfile)f(*fptr,)g(>)h(int)g(*status\))0
-3807 y Fe(8.2)135 b(Sp)t(ecialized)46 b(HDU)f(Access)g(Routines)0
-4066 y Fi(1)81 b Fj(Get)28 b(the)f(b)m(yte)h(o\013sets)g(in)e(the)h
-(FITS)f(\014le)h(to)g(the)h(start)g(of)f(the)g(header)g(and)g(the)g
-(start)h(and)e(end)h(of)g(the)g(data)227 4179 y(in)33
-b(the)h(CHDU.)g(The)f(di\013erence)g(b)s(et)m(w)m(een)i(headstart)f
-(and)f(dataend)h(equals)f(the)h(size)f(of)h(the)g(CHDU.)227
-4292 y(If)e(the)h(CHDU)f(is)g(the)g(last)g(HDU)h(in)e(the)i(\014le,)f
-(then)g(dataend)g(is)f(also)i(equal)e(to)i(the)g(size)f(of)h(the)f(en)m
-(tire)227 4405 y(FITS)25 b(\014le.)38 b(Null)24 b(p)s(oin)m(ters)g(ma)m
-(y)i(b)s(e)f(input)e(for)j(an)m(y)f(of)h(the)g(address)e(parameters)i
-(if)f(their)f(v)-5 b(alues)25 b(are)h(not)227 4518 y(needed.)54
-b(The)34 b(\014ts)p 897 4518 V 32 w(get)p 1049 4518 V
-34 w(hduaddr)e(routine)i(is)g(obsolete)h(and)f(should)f(no)i(longer)f
-(b)s(e)g(used.)53 b(The)34 b(new)m(er)227 4631 y(\014ts)p
-354 4631 V 33 w(get)p 507 4631 V 34 w(hduo\013)26 b(routine)h(uses)g
-(the)h('o\013)p 1596 4631 V 33 w(t')g(datat)m(yp)s(e)h(whic)m(h)d(can)i
-(supp)s(ort)e(o\013sets)i(in)f(large)g(\014les)g(greater)227
-4744 y(than)j(2.1GB)j(in)c(size.)95 5029 y Ff(int)47
-b(fits_get_hduoff)d(/)j(ffghof)334 5142 y(\(fitsfile)e(*fptr,)h(>)i
-(off_t)e(*headstart,)f(off_t)h(*datastart,)f(off_t)h(*dataend,)382
-5255 y(int)h(*status\))95 5480 y(int)g(fits_get_hduaddr)d(/)j(ffghad)94
-b(\(OBSOLETE)45 b(routine\))334 5593 y(\(fitsfile)g(*fptr,)h(>)i(long)f
-(*headstart,)d(long)j(*datastart,)e(long)h(*dataend,)382
-5706 y(int)h(*status\))p eop
-%%Page: 107 113
-107 112 bop 0 299 a Fh(8.2.)72 b(SPECIALIZED)29 b(HDU)i(A)m(CCESS)e(R)m
-(OUTINES)1795 b Fj(107)0 555 y Fi(2)81 b Fj(Create)31
-b(\(app)s(end\))f(a)i(new)e(empt)m(y)i(HDU)f(at)h(the)f(end)f(of)i(the)
-f(FITS)f(\014le.)41 b(This)30 b(is)g(no)m(w)h(the)g(CHDU)g(but)f(it)227
-668 y(is)h(completely)f(empt)m(y)i(and)f(has)g(no)g(header)g(k)m(eyw)m
+(int)i(*status\))0 2723 y Fi(3)81 b Fj(Reop)s(en)34 b(a)i(FITS)e
+(\014le)g(that)i(w)m(as)f(previously)e(op)s(ened)i(with)e(\014ts)p
+2414 2723 V 33 w(op)s(en)p 2637 2723 V 32 w(\014le)h(or)h(\014ts)p
+3058 2723 V 33 w(create)p 3327 2723 V 34 w(\014le.)54
+b(The)34 b(new)227 2836 y(\014ts\014le)h(p)s(oin)m(ter)h(ma)m(y)h(then)
+f(b)s(e)f(treated)j(as)e(a)h(separate)g(\014le,)g(and)f(one)h(ma)m(y)g
+(sim)m(ultaneously)d(read)i(or)227 2949 y(write)d(to)i(2)f(\(or)g
+(more\))g(di\013eren)m(t)f(extensions)g(in)g(the)h(same)g(\014le.)50
+b(The)33 b(\014ts)p 2886 2949 V 32 w(op)s(en)p 3108 2949
+V 32 w(\014le)g(routine)g(\(ab)s(o)m(v)m(e\))227 3061
+y(automatically)i(detects)i(cases)f(where)e(a)i(previously)d(op)s(ened)
+h(\014le)h(is)f(b)s(eing)g(op)s(ened)g(again,)j(and)d(then)227
+3174 y(in)m(ternally)29 b(call)g(\014ts)p 930 3174 V
+33 w(reop)s(en)p 1229 3174 V 32 w(\014le,)h(so)g(programs)g(should)f
+(rarely)g(need)h(to)h(explicitly)d(call)i(this)f(routine.)95
+3411 y Fe(int)47 b(fits_reopen_file)d(/)j(ffreopen)286
+3524 y(\(fitsfile)f(*openfptr,)f(fitsfile)g(**newfptr,)g(>)j(int)f
+(*status\))0 3761 y Fi(4)81 b Fj(Create)24 b(a)g(new)f(FITS)g(\014le,)h
+(using)e(a)i(template)g(\014le)e(to)j(de\014ne)d(its)h(initial)e(size)j
+(and)f(structure.)37 b(The)24 b(template)227 3874 y(ma)m(y)i(b)s(e)f
+(another)g(FITS)g(HDU)h(or)f(an)g(ASCI)s(I)f(template)i(\014le.)38
+b(If)25 b(the)g(input)f(template)h(\014le)g(name)g(p)s(oin)m(ter)227
+3987 y(is)i(n)m(ull,)g(then)g(this)g(routine)f(b)s(eha)m(v)m(es)j(the)f
+(same)g(as)g(\014ts)p 2160 3987 V 32 w(create)p 2428
+3987 V 35 w(\014le.)39 b(The)27 b(curren)m(tly)g(supp)s(orted)f(format)
+227 4100 y(of)33 b(the)g(ASCI)s(I)e(template)i(\014le)e(is)h(describ)s
+(ed)e(under)h(the)i(\014ts)p 2350 4100 V 33 w(parse)p
+2591 4100 V 32 w(template)g(routine)f(\(in)f(the)i(general)227
+4213 y(Utilities)c(section\))95 4450 y Fe(int)47 b
+(fits_create_template)c(/)k(fftplt)286 4563 y(\(fitsfile)f(**fptr,)f
+(char)i(*filename,)e(char)i(*tpltfile)e(>)i(int)g(*status\))0
+4799 y Fi(5)81 b Fj(P)m(arse)28 b(the)f(input)f(\014lename)g(or)i(URL)f
+(in)m(to)g(its)g(comp)s(onen)m(t)h(parts:)39 b(the)27
+b(\014le)g(t)m(yp)s(e)h(\(\014le://,)g(ftp://,)h(h)m(ttp://,)227
+4912 y(etc\),)34 b(the)e(base)g(input)d(\014le)i(name,)h(the)g(name)g
+(of)g(the)g(output)f(\014le)g(that)h(the)g(input)e(\014le)g(is)h(to)h
+(b)s(e)f(copied)227 5025 y(to)38 b(prior)d(to)i(op)s(ening,)g(the)g
+(HDU)g(or)f(extension)h(sp)s(eci\014cation,)g(the)g(\014ltering)d(sp)s
+(eci\014er,)j(the)g(binning)227 5138 y(sp)s(eci\014er,)27
+b(and)h(the)g(column)f(sp)s(eci\014er.)38 b(Null)26 b(strings)h(will)e
+(b)s(e)j(returned)f(for)g(an)m(y)i(comp)s(onen)m(ts)f(that)h(are)227
+5251 y(not)i(presen)m(t)f(in)f(the)i(input)d(\014le)i(name.)95
+5488 y Fe(int)47 b(fits_parse_input_url)c(/)k(ffiurl)286
+5601 y(\(char)g(*filename,)e(>)i(char)g(*filetype,)e(char)h(*infile,)g
+(char)h(*outfile,)e(char)334 5714 y(*extspec,)g(char)i(*filter,)f(char)
+g(*binspec,)f(char)i(*colspec,)e(int)i(*status\))p eop
+%%Page: 83 91
+83 90 bop 0 299 a Fh(9.1.)72 b(FITS)30 b(FILE)g(A)m(CCESS)f(R)m
+(OUTINES)2244 b Fj(83)0 555 y Fi(6)81 b Fj(P)m(arse)33
+b(the)f(input)f(\014lename)h(and)f(return)h(the)h(HDU)g(n)m(um)m(b)s
+(er)e(that)i(w)m(ould)e(b)s(e)h(mo)m(v)m(ed)i(to)f(if)e(the)i(\014le)e
+(w)m(ere)227 668 y(op)s(ened)i(with)f(\014ts)p 878 668
+28 4 v 32 w(op)s(en)p 1100 668 V 32 w(\014le.)48 b(The)33
+b(returned)f(HDU)i(n)m(um)m(b)s(er)e(b)s(egins)g(with)g(1)h(for)g(the)g
+(primary)f(arra)m(y)-8 b(,)227 781 y(so)40 b(for)f(example,)j(if)c(the)
+i(input)d(\014lename)i(=)g(`m)m(y\014le.\014ts[2]')h(then)f(hdun)m(um)e
+(=)i(3)h(will)d(b)s(e)i(returned.)227 894 y(CFITSIO)j(do)s(es)i(not)g
+(op)s(en)f(the)g(\014le)g(to)i(c)m(hec)m(k)g(if)d(the)i(extension)g
+(actually)f(exists)g(if)g(an)g(extension)227 1007 y(n)m(um)m(b)s(er)e
+(is)h(sp)s(eci\014ed.)74 b(If)42 b(an)g(extension)g(name)g(is)g
+(included)d(in)i(the)i(\014le)e(name)h(sp)s(eci\014cation)f(\(e.g.)227
+1120 y(`m)m(y\014le.\014ts[EVENTS]')j(then)f(this)g(routine)g(will)f
+(ha)m(v)m(e)j(to)f(op)s(en)g(the)g(FITS)f(\014le)g(and)g(lo)s(ok)h(for)
+g(the)227 1233 y(p)s(osition)29 b(of)h(the)h(named)f(extension,)h(then)
+f(close)h(\014le)e(again.)41 b(This)29 b(is)g(not)i(p)s(ossible)d(if)i
+(the)g(\014le)g(is)f(b)s(eing)227 1346 y(read)34 b(from)f(the)h(stdin)e
+(stream,)j(and)f(an)f(error)g(will)f(b)s(e)h(returned)f(in)h(this)f
+(case.)52 b(If)33 b(the)h(\014lename)f(do)s(es)227 1458
+y(not)42 b(sp)s(ecify)f(an)h(explicit)e(extension)i(\(e.g.)76
+b('m)m(y\014le.\014ts'\))42 b(then)g(hdun)m(um)e(=)h(-99)i(will)d(b)s
+(e)h(returned,)227 1571 y(whic)m(h)34 b(is)g(functionally)f(equiv)-5
+b(alen)m(t)34 b(to)i(hdun)m(um)d(=)h(1.)55 b(This)33
+b(routine)h(is)g(mainly)g(used)g(for)g(bac)m(kw)m(ard)227
+1684 y(compatibilit)m(y)h(in)h(the)g(fto)s(ols)h(soft)m(w)m(are)h(pac)m
+(k)-5 b(age)39 b(and)d(is)f(not)i(recommended)g(for)f(general)h(use.)59
+b(It)37 b(is)227 1797 y(generally)i(b)s(etter)g(and)g(more)g(e\016cien)
+m(t)h(to)g(\014rst)e(op)s(en)h(the)g(FITS)g(\014le)f(with)g(\014ts)p
+3125 1797 V 32 w(op)s(en)p 3347 1797 V 33 w(\014le,)i(then)f(use)227
+1910 y(\014ts)p 354 1910 V 33 w(get)p 507 1910 V 34 w(hdu)p
+694 1910 V 31 w(n)m(um)c(to)i(determine)f(whic)m(h)f(HDU)i(in)e(the)i
+(\014le)e(has)h(b)s(een)g(op)s(ened,)h(rather)f(than)g(calling)227
+2023 y(\014ts)p 354 2023 V 33 w(parse)p 595 2023 V 32
+w(input)p 841 2023 V 31 w(url)29 b(follo)m(w)m(ed)h(b)m(y)g(a)h(call)e
+(to)j(\014ts)p 1967 2023 V 32 w(op)s(en)p 2189 2023 V
+32 w(\014le.)143 2280 y Fe(int)47 b(fits_parse_extnum)c(/)48
+b(ffextn)334 2393 y(\(char)e(*filename,)f(>)j(int)f(*hdunum,)e(int)i
+(*status\))0 2650 y Fi(7)81 b Fj(P)m(arse)45 b(the)g(input)d(\014le)i
+(name)h(and)f(return)f(the)i(ro)s(ot)g(\014le)f(name.)83
+b(The)44 b(ro)s(ot)h(name)g(includes)d(the)j(\014le)227
+2763 y(t)m(yp)s(e)35 b(if)f(sp)s(eci\014ed,)h(\(e.g.)56
+b('ftp://')37 b(or)e('h)m(ttp://'\))i(and)d(the)h(full)e(path)i(name,)h
+(to)g(the)f(exten)m(t)i(that)e(it)g(is)227 2875 y(sp)s(eci\014ed)25
+b(in)f(the)j(input)d(\014lename.)38 b(It)26 b(do)s(es)g(not)g(include)e
+(the)i(HDU)h(name)f(or)g(n)m(um)m(b)s(er,)g(or)g(an)m(y)h(\014ltering)
+227 2988 y(sp)s(eci\014cations.)143 3245 y Fe(int)47
+b(fits_parse_rootname)c(/)k(ffrtnm)334 3358 y(\(char)f(*filename,)f(>)j
+(char)f(*rootname,)e(int)h(*status\);)0 3615 y Fi(8)81
+b Fj(T)-8 b(est)37 b(if)e(the)i(input)e(\014le)h(or)g(a)h(compressed)g
+(v)m(ersion)f(of)h(the)g(\014le)e(\(with)h(a)h(.gz,)j(.Z,)c(.z,)j(or)e
+(.zip)f(extension\))227 3728 y(exists)i(on)g(disk.)62
+b(The)37 b(returned)g(v)-5 b(alue)37 b(of)h(the)h('exists')f(parameter)
+g(will)d(ha)m(v)m(e)40 b(1)e(of)g(the)g(4)g(follo)m(wing)227
+3841 y(v)-5 b(alues:)370 4087 y Fe(2:)95 b(the)47 b(file)g(does)g(not)f
+(exist,)h(but)f(a)i(compressed)d(version)h(does)g(exist)370
+4200 y(1:)95 b(the)47 b(disk)g(file)g(does)f(exist)370
+4313 y(0:)95 b(neither)46 b(the)h(file)g(nor)g(a)g(compressed)e
+(version)h(of)h(the)g(file)g(exist)323 4426 y(-1:)94
+b(the)47 b(input)g(file)f(name)h(is)g(not)g(a)g(disk)g(file)g(\(could)f
+(be)h(a)g(ftp,)g(http,)561 4539 y(smem,)g(or)g(mem)g(file,)f(or)h(a)h
+(file)e(piped)h(in)g(on)g(the)g(STDIN)f(stream\))143
+4892 y(int)h(fits_file_exists)c(/)48 b(ffexist)334 5005
+y(\(char)e(*filename,)f(>)j(int)f(*exists,)e(int)i(*status\);)0
+5262 y Fi(9)81 b Fj(Flush)35 b(an)m(y)j(in)m(ternal)e(bu\013ers)g(of)i
+(data)g(to)g(the)f(output)g(FITS)g(\014le.)61 b(These)37
+b(routines)f(rarely)g(need)h(to)i(b)s(e)227 5375 y(called,)g(but)d(can)
+i(b)s(e)f(useful)e(in)h(cases)j(where)d(other)i(pro)s(cesses)f(need)g
+(to)h(access)h(the)f(same)f(FITS)g(\014le)227 5488 y(in)i(real)i(time,)
+h(either)e(on)h(disk)e(or)h(in)f(memory)-8 b(.)71 b(These)41
+b(routines)e(also)h(help)f(to)j(ensure)d(that)i(if)f(the)227
+5601 y(application)34 b(program)g(subsequen)m(tly)g(ab)s(orts)g(then)h
+(the)g(FITS)f(\014le)g(will)e(ha)m(v)m(e)37 b(b)s(een)d(closed)g(prop)s
+(erly)-8 b(.)227 5714 y(The)43 b(\014rst)g(routine,)j(\014ts)p
+1110 5714 V 33 w(\015ush)p 1332 5714 V 31 w(\014le)c(is)h(more)g
+(rigorous)g(and)g(completely)g(closes,)k(then)d(reop)s(ens,)i(the)p
+eop
+%%Page: 84 92
+84 91 bop 0 299 a Fj(84)1003 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
+555 y Fj(curren)m(t)h(HDU,)h(b)s(efore)e(\015ushing)f(the)i(in)m
+(ternal)e(bu\013ers,)h(th)m(us)h(ensuring)e(that)i(the)g(output)g(FITS)
+f(\014le)g(is)227 668 y(iden)m(tical)35 b(to)h(what)f(w)m(ould)g(b)s(e)
+g(pro)s(duced)f(if)g(the)i(FITS)f(w)m(as)h(closed)f(at)h(that)g(p)s
+(oin)m(t)f(\(i.e.,)i(with)e(a)h(call)227 781 y(to)g(\014ts)p
+470 781 28 4 v 33 w(close)p 690 781 V 33 w(\014le\).)55
+b(The)35 b(second)g(routine,)h(\014ts)p 1912 781 V 33
+w(\015ush)p 2134 781 V 31 w(bu\013er)e(simply)f(\015ushes)h(the)h(in)m
+(ternal)f(CFITSIO)227 894 y(bu\013ers)28 b(of)h(data)h(to)f(the)h
+(output)e(FITS)g(\014le,)h(without)f(up)s(dating)f(and)h(closing)g(the)
+h(curren)m(t)g(HDU.)h(This)227 1007 y(is)36 b(m)m(uc)m(h)h(faster,)i
+(but)e(there)g(ma)m(y)g(b)s(e)f(circumstances)h(where)f(the)h
+(\015ushed)f(\014le)g(do)s(es)g(not)h(completely)227
+1120 y(re\015ect)31 b(the)g(\014nal)e(state)j(of)e(the)h(\014le)e(as)i
+(it)f(will)d(exist)k(when)e(the)h(\014le)g(is)f(actually)h(closed.)227
+1266 y(A)h(t)m(ypical)f(use)g(of)h(these)g(routines)e(w)m(ould)g(b)s(e)
+h(to)h(\015ush)e(the)h(state)i(of)f(a)g(FITS)e(table)i(to)g(disk)e
+(after)i(eac)m(h)227 1379 y(ro)m(w)36 b(of)f(the)h(table)f(is)f
+(written.)54 b(It)36 b(is)e(recommend)h(that)h(\014ts)p
+2392 1379 V 32 w(\015ush)p 2613 1379 V 32 w(\014le)e(b)s(e)h(called)f
+(after)i(the)f(\014rst)g(ro)m(w)227 1492 y(is)j(written,)i(then)e
+(\014ts)p 1023 1492 V 32 w(\015ush)p 1244 1492 V 31 w(bu\013er)g(ma)m
+(y)h(b)s(e)f(called)f(after)i(eac)m(h)h(subsequen)m(t)e(ro)m(w)g(is)g
+(written.)64 b(Note)227 1605 y(that)40 b(this)e(latter)h(routine)f
+(will)e(not)j(automatically)g(up)s(date)f(the)h(NAXIS2)g(k)m(eyw)m(ord)
+h(whic)m(h)d(records)227 1718 y(the)d(n)m(um)m(b)s(er)d(of)i(ro)m(ws)h
+(of)f(data)g(in)f(the)h(table,)h(so)g(this)e(k)m(eyw)m(ord)h(m)m(ust)g
+(b)s(e)f(explicitly)f(up)s(dated)h(b)m(y)h(the)227 1831
+y(application)c(program)h(after)h(eac)m(h)h(ro)m(w)e(is)f(written.)95
+2067 y Fe(int)47 b(fits_flush_file)d(/)j(ffflus)286 2180
+y(\(fitsfile)f(*fptr,)g(>)h(int)g(*status\))95 2406 y(int)g
+(fits_flush_buffer)c(/)48 b(ffflsh)286 2519 y(\(fitsfile)e(*fptr,)g(0,)
+h(>)g(int)g(*status\))286 2745 y(\(Note:)94 b(The)47
+b(second)f(argument)g(must)g(be)i(0\).)0 3075 y Ff(9.2)135
+b(HDU)46 b(Access)e(Routines)0 3311 y Fi(1)81 b Fj(Get)28
+b(the)f(b)m(yte)h(o\013sets)g(in)e(the)h(FITS)f(\014le)h(to)g(the)h
+(start)g(of)f(the)g(header)g(and)g(the)g(start)h(and)e(end)h(of)g(the)g
+(data)227 3424 y(in)33 b(the)h(CHDU.)g(The)f(di\013erence)g(b)s(et)m(w)
+m(een)i(headstart)f(and)f(dataend)h(equals)f(the)h(size)f(of)h(the)g
+(CHDU.)227 3537 y(If)e(the)h(CHDU)f(is)g(the)g(last)g(HDU)h(in)e(the)i
+(\014le,)f(then)g(dataend)g(is)f(also)i(equal)e(to)i(the)g(size)f(of)h
+(the)f(en)m(tire)227 3650 y(FITS)25 b(\014le.)38 b(Null)24
+b(p)s(oin)m(ters)g(ma)m(y)i(b)s(e)f(input)e(for)j(an)m(y)f(of)h(the)g
+(address)e(parameters)i(if)f(their)f(v)-5 b(alues)25
+b(are)h(not)227 3763 y(needed.)54 b(The)34 b(\014ts)p
+897 3763 V 32 w(get)p 1049 3763 V 34 w(hduaddr)e(routine)i(is)g
+(obsolete)h(and)f(should)f(no)i(longer)f(b)s(e)g(used.)53
+b(The)34 b(new)m(er)227 3876 y(\014ts)p 354 3876 V 33
+w(get)p 507 3876 V 34 w(hduo\013)24 b(routine)h(uses)g(the)h('o\013)p
+1588 3876 V 33 w(t')g(data)h(t)m(yp)s(e)f(whic)m(h)e(can)i(supp)s(ort)e
+(o\013sets)i(in)e(large)i(\014les)f(greater)227 3988
+y(than)30 b(2.1GB)j(in)c(size.)95 4225 y Fe(int)47 b(fits_get_hduoff)d
+(/)j(ffghof)334 4338 y(\(fitsfile)e(*fptr,)h(>)i(off_t)e(*headstart,)f
+(off_t)h(*datastart,)f(off_t)h(*dataend,)382 4451 y(int)h(*status\))95
+4676 y(int)g(fits_get_hduaddr)d(/)j(ffghad)94 b(\(OBSOLETE)45
+b(routine\))334 4789 y(\(fitsfile)g(*fptr,)h(>)i(long)f(*headstart,)d
+(long)j(*datastart,)e(long)h(*dataend,)382 4902 y(int)h(*status\))0
+5139 y Fi(2)81 b Fj(Create)31 b(\(app)s(end\))f(a)i(new)e(empt)m(y)i
+(HDU)f(at)h(the)f(end)f(of)i(the)f(FITS)f(\014le.)41
+b(This)30 b(is)g(no)m(w)h(the)g(CHDU)g(but)f(it)227 5252
+y(is)h(completely)f(empt)m(y)i(and)f(has)g(no)g(header)g(k)m(eyw)m
 (ords.)43 b(It)32 b(is)e(recommended)h(that)h(\014ts)p
-3344 668 28 4 v 32 w(create)p 3612 668 V 34 w(img)f(or)227
-781 y(\014ts)p 354 781 V 33 w(create)p 623 781 V 34 w(tbl)e(b)s(e)h
-(used)g(instead)f(of)i(this)e(routine.)95 1020 y Ff(int)47
-b(fits_create_hdu)d(/)j(ffcrhd)286 1133 y(\(fitsfile)f(*fptr,)g(>)h
-(int)g(*status\))0 1371 y Fi(3)81 b Fj(Insert)41 b(a)h(new)f(IMA)m(GE)i
-(extension)f(immediately)e(follo)m(wing)g(the)i(CHDU.)g(An)m(y)g(follo)
-m(wing)e(extensions)227 1484 y(will)c(b)s(e)i(shifted)f(do)m(wn)h(to)h
-(mak)m(e)g(ro)s(om)g(for)f(the)g(new)g(extension.)65
-b(If)38 b(there)h(are)f(no)h(other)f(follo)m(wing)227
-1597 y(extensions)29 b(then)g(the)h(new)e(image)i(extension)f(will)e
-(simply)f(b)s(e)j(app)s(ended)f(to)i(the)f(end)g(of)g(the)h(\014le.)39
-b(The)227 1710 y(new)h(extension)g(will)d(b)s(ecome)j(the)h(CHDU.)f
-(Refer)h(to)f(Chapter)g(9)g(for)g(a)h(list)d(of)j(pre-de\014ned)d
-(bitpix)227 1823 y(v)-5 b(alues.)95 2062 y Ff(int)47
-b(fits_insert_img)d(/)j(ffiimg)286 2175 y(\(fitsfile)f(*fptr,)g(int)h
-(bitpix,)e(int)i(naxis,)f(long)h(*naxes,)f(>)h(int)g(*status\))0
-2414 y Fi(4)81 b Fj(Insert)30 b(a)g(new)g(ASCI)s(I)f(or)i(binary)e
-(table)h(extension)g(immediately)f(follo)m(wing)g(the)i(CHDU.)g(An)m(y)
-f(follo)m(wing)227 2526 y(extensions)35 b(will)e(b)s(e)i(shifted)f(do)m
-(wn)h(to)h(mak)m(e)g(ro)s(om)g(for)f(the)g(new)g(extension.)56
-b(If)35 b(there)h(are)f(no)h(other)227 2639 y(follo)m(wing)29
-b(extensions)i(then)f(the)h(new)f(table)g(extension)h(will)d(simply)g
-(b)s(e)i(app)s(ended)f(to)i(the)g(end)f(of)h(the)227
-2752 y(\014le.)41 b(If)30 b(the)h(FITS)f(\014le)f(is)h(curren)m(tly)g
-(empt)m(y)h(then)f(this)f(routine)h(will)e(create)k(a)f(dumm)m(y)f
-(primary)e(arra)m(y)227 2865 y(b)s(efore)j(app)s(ending)e(the)j(table)g
-(to)g(it.)43 b(The)31 b(new)g(extension)h(will)c(b)s(ecome)k(the)g
-(CHDU.)g(The)f(tunit)g(and)227 2978 y(extname)39 b(parameters)g(are)f
-(optional)g(and)g(a)g(n)m(ull)e(p)s(oin)m(ter)i(ma)m(y)g(b)s(e)g(giv)m
-(en)g(if)f(they)i(are)f(not)h(de\014ned.)227 3091 y(When)32
-b(inserting)e(an)i(ASCI)s(I)f(table)h(with)e(\014ts)p
-1847 3091 V 33 w(insert)p 2104 3091 V 32 w(atbl,)i(a)g(n)m(ull)e(p)s
+3344 5252 V 32 w(create)p 3612 5252 V 34 w(img)f(or)227
+5365 y(\014ts)p 354 5365 V 33 w(create)p 623 5365 V 34
+w(tbl)e(b)s(e)h(used)g(instead)f(of)i(this)e(routine.)95
+5601 y Fe(int)47 b(fits_create_hdu)d(/)j(ffcrhd)286 5714
+y(\(fitsfile)f(*fptr,)g(>)h(int)g(*status\))p eop
+%%Page: 85 93
+85 92 bop 0 299 a Fh(9.2.)72 b(HDU)31 b(A)m(CCESS)e(R)m(OUTINES)2488
+b Fj(85)0 555 y Fi(3)81 b Fj(Insert)22 b(a)h(new)g(IMA)m(GE)h
+(extension)e(immediately)g(follo)m(wing)f(the)i(CHDU,)h(or)f(insert)f
+(a)h(new)f(Primary)g(Arra)m(y)227 668 y(at)30 b(the)e(b)s(eginning)e
+(of)j(the)g(\014le.)39 b(An)m(y)29 b(follo)m(wing)e(extensions)h(in)g
+(the)g(\014le)g(will)e(b)s(e)i(shifted)f(do)m(wn)i(to)g(mak)m(e)227
+781 y(ro)s(om)36 b(for)h(the)f(new)g(extension.)58 b(If)36
+b(the)h(CHDU)g(is)e(the)i(last)f(HDU)h(in)e(the)i(\014le)e(then)h(the)h
+(new)f(image)227 894 y(extension)30 b(will)e(simply)f(b)s(e)j(app)s
+(ended)e(to)j(the)f(end)g(of)g(the)g(\014le.)40 b(One)30
+b(can)g(force)h(a)g(new)e(primary)f(arra)m(y)227 1007
+y(to)35 b(b)s(e)d(inserted)h(at)h(the)g(b)s(eginning)d(of)i(the)h(FITS)
+f(\014le)f(b)m(y)i(setting)g(status)f(=)h(PREPEND)p 3432
+1007 28 4 v 32 w(PRIMAR)-8 b(Y)227 1120 y(prior)24 b(to)h(calling)f
+(the)h(routine.)37 b(In)25 b(this)e(case)j(the)f(old)f(primary)f(arra)m
+(y)j(will)c(b)s(e)i(con)m(v)m(erted)j(to)e(an)g(IMA)m(GE)227
+1233 y(extension.)48 b(The)32 b(new)g(extension)h(\(or)g(primary)e
+(arra)m(y\))i(will)e(b)s(ecome)i(the)g(CHDU.)g(Refer)g(to)h(Chapter)227
+1346 y(9)d(for)f(a)h(list)e(of)h(pre-de\014ned)f(bitpix)g(v)-5
+b(alues.)95 1605 y Fe(int)47 b(fits_insert_img)d(/)j(ffiimg)286
+1718 y(\(fitsfile)f(*fptr,)g(int)h(bitpix,)e(int)i(naxis,)f(long)h
+(*naxes,)f(>)h(int)g(*status\))0 1978 y Fi(4)81 b Fj(Insert)30
+b(a)g(new)g(ASCI)s(I)f(or)i(binary)e(table)h(extension)g(immediately)f
+(follo)m(wing)g(the)i(CHDU.)g(An)m(y)f(follo)m(wing)227
+2091 y(extensions)35 b(will)e(b)s(e)i(shifted)f(do)m(wn)h(to)h(mak)m(e)
+g(ro)s(om)g(for)f(the)g(new)g(extension.)56 b(If)35 b(there)h(are)f(no)
+h(other)227 2204 y(follo)m(wing)29 b(extensions)i(then)f(the)h(new)f
+(table)g(extension)h(will)d(simply)g(b)s(e)i(app)s(ended)f(to)i(the)g
+(end)f(of)h(the)227 2317 y(\014le.)41 b(If)30 b(the)h(FITS)f(\014le)f
+(is)h(curren)m(tly)g(empt)m(y)h(then)f(this)f(routine)h(will)e(create)k
+(a)f(dumm)m(y)f(primary)e(arra)m(y)227 2430 y(b)s(efore)j(app)s(ending)
+e(the)j(table)g(to)g(it.)43 b(The)31 b(new)g(extension)h(will)c(b)s
+(ecome)k(the)g(CHDU.)g(The)f(tunit)g(and)227 2543 y(extname)39
+b(parameters)g(are)f(optional)g(and)g(a)g(n)m(ull)e(p)s(oin)m(ter)i(ma)
+m(y)g(b)s(e)g(giv)m(en)g(if)f(they)i(are)f(not)h(de\014ned.)227
+2656 y(When)32 b(inserting)e(an)i(ASCI)s(I)f(table)h(with)e(\014ts)p
+1847 2656 V 33 w(insert)p 2104 2656 V 32 w(atbl,)i(a)g(n)m(ull)e(p)s
 (oin)m(ter)h(ma)m(y)i(giv)m(en)f(for)g(the)g(*tb)s(col)227
-3204 y(parameter)23 b(in)e(whic)m(h)h(case)h(eac)m(h)h(column)d(of)i
+2769 y(parameter)23 b(in)e(whic)m(h)h(case)h(eac)m(h)h(column)d(of)i
 (the)g(table)f(will)e(b)s(e)i(separated)h(b)m(y)f(a)h(single)e(space)i
-(c)m(haracter.)227 3317 y(Similarly)-8 b(,)25 b(if)g(the)i(input)e(v)-5
+(c)m(haracter.)227 2882 y(Similarly)-8 b(,)25 b(if)g(the)i(input)e(v)-5
 b(alue)26 b(of)h(ro)m(wlen)f(is)f(0,)j(then)f(CFITSIO)e(will)f
-(calculate)j(the)g(default)e(ro)m(wlength)227 3430 y(based)40
+(calculate)j(the)g(default)e(ro)m(wlength)227 2994 y(based)40
 b(on)h(the)g(tb)s(col)e(and)h(tt)m(yp)s(e)h(v)-5 b(alues.)71
 b(When)40 b(inserting)f(a)i(binary)d(table)j(with)e(\014ts)p
-3430 3430 V 32 w(insert)p 3686 3430 V 32 w(btbl,)227
-3543 y(if)g(there)i(are)f(follo)m(wing)f(extensions)h(in)f(the)h
+3430 2994 V 32 w(insert)p 3686 2994 V 32 w(btbl,)227
+3107 y(if)g(there)i(are)f(follo)m(wing)f(extensions)h(in)f(the)h
 (\014le)f(and)h(if)f(the)h(table)g(con)m(tains)h(v)-5
-b(ariable)39 b(length)g(arra)m(y)227 3656 y(columns)28
+b(ariable)39 b(length)g(arra)m(y)227 3220 y(columns)28
 b(then)h(p)s(coun)m(t)g(m)m(ust)g(sp)s(ecify)f(the)i(exp)s(ected)g
 (\014nal)e(size)h(of)g(the)h(data)g(heap,)g(otherwise)e(p)s(coun)m(t)
-227 3768 y(m)m(ust)j(=)f(0.)95 4007 y Ff(int)47 b(fits_insert_atbl)d(/)
-j(ffitab)286 4120 y(\(fitsfile)f(*fptr,)g(long)g(rowlen,)g(long)h
-(nrows,)f(int)h(tfields,)e(char)i(*ttype[],)334 4233
+227 3333 y(m)m(ust)j(=)f(0.)95 3593 y Fe(int)47 b(fits_insert_atbl)d(/)
+j(ffitab)286 3706 y(\(fitsfile)f(*fptr,)g(long)g(rowlen,)g(long)h
+(nrows,)f(int)h(tfields,)e(char)i(*ttype[],)334 3819
 y(long)g(*tbcol,)f(char)g(*tform[],)f(char)i(*tunit[],)e(char)i
-(*extname,)e(>)j(int)f(*status\))95 4459 y(int)g(fits_insert_btbl)d(/)j
-(ffibin)286 4572 y(\(fitsfile)f(*fptr,)g(long)g(nrows,)g(int)h
-(tfields,)f(char)h(**ttype,)286 4685 y(char)g(**tform,)f(char)g
+(*extname,)e(>)j(int)f(*status\))95 4045 y(int)g(fits_insert_btbl)d(/)j
+(ffibin)286 4158 y(\(fitsfile)f(*fptr,)g(long)g(nrows,)g(int)h
+(tfields,)f(char)h(**ttype,)286 4271 y(char)g(**tform,)f(char)g
 (**tunit,)g(char)g(*extname,)g(long)g(pcount,)g(>)i(int)e(*status\))0
-4924 y Fi(5)81 b Fj(Mo)s(dify)28 b(the)i(size,)g(dimensions,)e(and/or)h
-(datat)m(yp)s(e)i(of)f(the)g(curren)m(t)g(primary)e(arra)m(y)i(or)g
-(image)g(extension.)227 5036 y(If)39 b(the)h(new)e(image,)43
+4530 y Fi(5)81 b Fj(Mo)s(dify)26 b(the)i(size,)g(dimensions,)e(and/or)h
+(data)i(t)m(yp)s(e)f(of)f(the)h(curren)m(t)g(primary)d(arra)m(y)j(or)g
+(image)g(extension.)227 4643 y(If)39 b(the)h(new)e(image,)43
 b(as)c(sp)s(eci\014ed)f(b)m(y)h(the)g(input)f(argumen)m(ts,)k(is)c
-(larger)h(than)g(the)h(curren)m(t)f(existing)227 5149
+(larger)h(than)g(the)h(curren)m(t)f(existing)227 4756
 y(image)29 b(in)e(the)h(FITS)g(\014le)f(then)h(zero)h(\014ll)d(data)j
 (will)d(b)s(e)i(inserted)f(at)i(the)f(end)g(of)g(the)h(curren)m(t)f
-(image)h(and)227 5262 y(an)m(y)35 b(follo)m(wing)e(extensions)h(will)e
+(image)h(and)227 4869 y(an)m(y)35 b(follo)m(wing)e(extensions)h(will)e
 (b)s(e)i(mo)m(v)m(ed)i(further)d(bac)m(k)i(in)f(the)g(\014le.)53
-b(Similarly)-8 b(,)32 b(if)i(the)h(new)f(image)227 5375
+b(Similarly)-8 b(,)32 b(if)i(the)h(new)f(image)227 4982
 y(is)i(smaller)f(than)i(the)f(curren)m(t)h(image)g(then)f(an)m(y)h
 (follo)m(wing)e(extensions)h(will)e(b)s(e)i(shifted)g(up)f(to)m(w)m
-(ards)227 5488 y(the)h(b)s(eginning)d(of)j(the)g(FITS)f(\014le)g(and)g
+(ards)227 5095 y(the)h(b)s(eginning)d(of)j(the)g(FITS)f(\014le)g(and)g
 (the)h(image)g(data)g(will)e(b)s(e)h(truncated)g(to)i(the)f(new)f
-(size.)57 b(This)227 5601 y(routine)26 b(rewrites)g(the)i(BITPIX,)f
+(size.)57 b(This)227 5208 y(routine)26 b(rewrites)g(the)i(BITPIX,)f
 (NAXIS,)g(and)f(NAXISn)g(k)m(eyw)m(ords)i(with)e(the)h(appropriate)f(v)
--5 b(alues)26 b(for)227 5714 y(the)31 b(new)f(image.)p
-eop
-%%Page: 108 114
-108 113 bop 0 299 a Fj(108)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
-555 y Ff(int)47 b(fits_resize_img)d(/)j(ffrsim)286 668
+-5 b(alues)26 b(for)227 5321 y(the)31 b(new)f(image.)95
+5581 y Fe(int)47 b(fits_resize_img)d(/)j(ffrsim)286 5694
 y(\(fitsfile)f(*fptr,)g(int)h(bitpix,)e(int)i(naxis,)f(long)h(*naxes,)f
-(>)h(int)g(*status\))0 921 y Fi(6)81 b Fj(Cop)m(y)28
-b(the)i(header)e(\(and)h(not)g(the)g(data\))h(from)f(the)g(CHDU)g(asso)
-s(ciated)h(with)d(infptr)g(to)j(the)f(CHDU)g(asso-)227
-1034 y(ciated)e(with)e(outfptr.)39 b(If)25 b(the)i(curren)m(t)f(output)
-g(HDU)h(is)e(not)h(completely)g(empt)m(y)-8 b(,)29 b(then)d(the)g(CHDU)
-h(will)227 1146 y(b)s(e)d(closed)h(and)f(a)i(new)e(HDU)h(will)e(b)s(e)h
-(app)s(ended)f(to)j(the)f(output)f(\014le.)38 b(This)23
-b(routine)h(will)e(automatically)227 1259 y(transform)31
-b(the)g(necessary)h(k)m(eyw)m(ords)f(when)g(cop)m(ying)g(a)g(primary)f
-(arra)m(y)i(to)f(and)g(image)h(extension,)f(or)227 1372
-y(an)c(image)g(extension)f(to)h(a)h(primary)c(arra)m(y)-8
-b(.)41 b(An)26 b(empt)m(y)h(output)f(data)i(unit)d(will)f(b)s(e)i
-(created)i(\(all)e(v)-5 b(alues)227 1485 y(=)30 b(0\).)95
-1738 y Ff(int)47 b(fits_copy_header)d(/)j(ffcphd)286
-1851 y(\(fitsfile)f(*infptr,)f(fitsfile)h(*outfptr,)f(>)i(int)g
-(*status\))0 2103 y Fi(7)81 b Fj(Cop)m(y)43 b(the)h(data)h(\(and)e(not)
-h(the)g(header\))g(from)f(the)h(CHDU)g(asso)s(ciated)g(with)f(infptr)e
-(to)k(the)f(CHDU)227 2216 y(asso)s(ciated)33 b(with)e(outfptr.)47
+(>)h(int)g(*status\))p eop
+%%Page: 86 94
+86 93 bop 0 299 a Fj(86)1003 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fi(6)81 b Fj(Cop)m(y)43 b(the)h(data)h(\(and)e(not)h(the)g
+(header\))g(from)f(the)h(CHDU)g(asso)s(ciated)g(with)f(infptr)e(to)k
+(the)f(CHDU)227 668 y(asso)s(ciated)33 b(with)e(outfptr.)47
 b(This)31 b(will)e(o)m(v)m(erwrite)k(an)m(y)g(data)g(previously)e(in)g
-(the)i(output)f(CHDU.)h(This)227 2329 y(lo)m(w)38 b(lev)m(el)g(routine)
-f(is)g(used)g(b)m(y)h(\014ts)p 1510 2329 28 4 v 33 w(cop)m(y)p
-1724 2329 V 33 w(hdu,)h(but)e(it)h(ma)m(y)g(also)g(b)s(e)g(useful)e(in)
-h(certain)h(application)227 2442 y(programs)30 b(that)h(w)m(an)m(t)g
-(to)g(cop)m(y)g(the)f(data)h(from)f(one)h(FITS)e(\014le)h(to)h(another)
-f(but)f(also)i(w)m(an)m(t)g(to)g(mo)s(dify)227 2555 y(the)h(header)g(k)
-m(eyw)m(ords.)46 b(The)32 b(required)e(FITS)h(header)h(k)m(eyw)m(ords)g
+(the)i(output)f(CHDU.)h(This)227 781 y(lo)m(w)38 b(lev)m(el)g(routine)f
+(is)g(used)g(b)m(y)h(\014ts)p 1510 781 28 4 v 33 w(cop)m(y)p
+1724 781 V 33 w(hdu,)h(but)e(it)h(ma)m(y)g(also)g(b)s(e)g(useful)e(in)h
+(certain)h(application)227 894 y(programs)30 b(that)h(w)m(an)m(t)g(to)g
+(cop)m(y)g(the)f(data)h(from)f(one)h(FITS)e(\014le)h(to)h(another)f
+(but)f(also)i(w)m(an)m(t)g(to)g(mo)s(dify)227 1007 y(the)h(header)g(k)m
+(eyw)m(ords.)46 b(The)32 b(required)e(FITS)h(header)h(k)m(eyw)m(ords)g
 (whic)m(h)f(de\014ne)g(the)h(structure)g(of)g(the)227
-2668 y(HDU)f(m)m(ust)g(b)s(e)e(written)h(to)h(the)f(output)g(CHDU)h(b)s
-(efore)f(calling)f(this)g(routine.)95 2920 y Ff(int)47
-b(fits_copy_data)d(/)k(ffcpdt)286 3033 y(\(fitsfile)e(*infptr,)f
-(fitsfile)h(*outfptr,)f(>)i(int)g(*status\))0 3286 y
-Fi(8)81 b Fj(This)33 b(routine)g(forces)i(CFITSIO)f(to)h(rescan)g(the)g
+1120 y(HDU)f(m)m(ust)g(b)s(e)e(written)h(to)h(the)f(output)g(CHDU)h(b)s
+(efore)f(calling)f(this)g(routine.)95 1369 y Fe(int)47
+b(fits_copy_data)d(/)k(ffcpdt)286 1482 y(\(fitsfile)e(*infptr,)f
+(fitsfile)h(*outfptr,)f(>)i(int)g(*status\))0 1732 y
+Fi(7)81 b Fj(This)33 b(routine)g(forces)i(CFITSIO)f(to)h(rescan)g(the)g
 (curren)m(t)g(header)f(k)m(eyw)m(ords)h(that)g(de\014ne)f(the)h
-(structure)227 3399 y(of)f(the)f(HDU)h(\(suc)m(h)g(as)f(the)h(NAXIS)f
+(structure)227 1845 y(of)f(the)f(HDU)h(\(suc)m(h)g(as)f(the)h(NAXIS)f
 (and)g(BITPIX)g(k)m(eyw)m(ords\))h(so)f(that)h(it)f(reinitializes)e
-(the)i(in)m(ternal)227 3512 y(bu\013ers)26 b(that)h(describ)s(e)f(the)h
+(the)i(in)m(ternal)227 1958 y(bu\013ers)26 b(that)h(describ)s(e)f(the)h
 (HDU)g(structure.)39 b(This)25 b(routine)h(is)g(useful)f(for)h
-(reinitializing)d(the)k(structure)227 3625 y(of)34 b(an)f(HDU)h(if)e
+(reinitializing)d(the)k(structure)227 2071 y(of)34 b(an)f(HDU)h(if)e
 (an)m(y)i(of)g(the)f(required)f(k)m(eyw)m(ords)h(\(e.g.,)j(NAXISn\))d
 (ha)m(v)m(e)i(b)s(een)e(mo)s(di\014ed.)47 b(In)33 b(practice)227
-3737 y(it)d(should)e(rarely)h(b)s(e)g(necessary)h(to)h(call)e(this)g
+2184 y(it)d(should)e(rarely)h(b)s(e)g(necessary)h(to)h(call)e(this)g
 (routine)g(b)s(ecause)g(CFITSIO)g(in)m(ternally)f(calls)h(it)g(in)g
-(most)227 3850 y(situations.)95 4103 y Ff(int)47 b(fits_set_hdustruc)c
-(/)48 b(ffrdef)286 4216 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*status\))141
-b(\(DEPRECATED\))0 4548 y Fe(8.3)135 b(Sp)t(ecialized)46
-b(Header)g(Keyw)l(ord)f(Routines)0 4802 y Fd(8.3.1)112
-b(Header)38 b(Information)f(Routines)0 5010 y Fi(1)81
+(most)227 2297 y(situations.)95 2546 y Fe(int)47 b(fits_set_hdustruc)c
+(/)48 b(ffrdef)286 2659 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*status\))141
+b(\(DEPRECATED\))0 2991 y Ff(9.3)135 b(Sp)t(ecialized)46
+b(Header)g(Keyw)l(ord)f(Routines)0 3245 y Fd(9.3.1)112
+b(Header)38 b(Information)f(Routines)0 3452 y Fi(1)81
 b Fj(Reserv)m(e)29 b(space)g(in)d(the)j(CHU)f(for)g(MOREKEYS)f(more)h
 (header)g(k)m(eyw)m(ords.)41 b(This)26 b(routine)h(ma)m(y)i(b)s(e)f
-(called)227 5123 y(to)34 b(allo)s(cate)f(space)g(for)f(additional)f(k)m
+(called)227 3565 y(to)34 b(allo)s(cate)f(space)g(for)f(additional)f(k)m
 (eyw)m(ords)i(at)g(the)g(time)f(the)h(header)f(is)g(created)h(\(prior)f
-(to)h(writing)227 5235 y(an)m(y)h(data\).)51 b(CFITSIO)32
+(to)h(writing)227 3678 y(an)m(y)h(data\).)51 b(CFITSIO)32
 b(can)i(dynamically)d(add)i(more)g(space)h(to)g(the)g(header)f(when)f
-(needed,)j(ho)m(w)m(ev)m(er)227 5348 y(it)30 b(is)g(more)g(e\016cien)m
+(needed,)j(ho)m(w)m(ev)m(er)227 3791 y(it)30 b(is)g(more)g(e\016cien)m
 (t)h(to)g(preallo)s(cate)f(the)h(required)e(space)i(if)e(the)h(size)h
-(is)e(kno)m(wn)h(in)f(adv)-5 b(ance.)95 5601 y Ff(int)47
-b(fits_set_hdrsize)d(/)j(ffhdef)286 5714 y(\(fitsfile)f(*fptr,)g(int)h
-(morekeys,)e(>)i(int)g(*status\))p eop
-%%Page: 109 115
-109 114 bop 0 299 a Fh(8.3.)72 b(SPECIALIZED)29 b(HEADER)i(KEYW)m(ORD)g
-(R)m(OUTINES)1465 b Fj(109)0 555 y Fi(2)81 b Fj(Return)26
+(is)e(kno)m(wn)h(in)f(adv)-5 b(ance.)95 4041 y Fe(int)47
+b(fits_set_hdrsize)d(/)j(ffhdef)286 4153 y(\(fitsfile)f(*fptr,)g(int)h
+(morekeys,)e(>)i(int)g(*status\))0 4403 y Fi(2)81 b Fj(Return)26
 b(the)h(n)m(um)m(b)s(er)e(of)j(k)m(eyw)m(ords)f(in)e(the)i(header)g
 (\(not)h(coun)m(ting)f(the)g(END)g(k)m(eyw)m(ord\))h(and)e(the)h
-(curren)m(t)227 668 y(p)s(osition)32 b(in)h(the)h(header.)50
+(curren)m(t)227 4516 y(p)s(osition)32 b(in)h(the)h(header.)50
 b(The)34 b(p)s(osition)d(is)i(the)h(n)m(um)m(b)s(er)f(of)h(the)g(k)m
 (eyw)m(ord)g(record)f(that)i(will)c(b)s(e)i(read)227
-781 y(next)k(\(or)g(one)f(greater)i(than)e(the)h(p)s(osition)d(of)j
+4629 y(next)k(\(or)g(one)f(greater)i(than)e(the)h(p)s(osition)d(of)j
 (the)g(last)f(k)m(eyw)m(ord)h(that)g(w)m(as)g(read\).)59
-b(A)37 b(v)-5 b(alue)35 b(of)i(1)g(is)227 894 y(returned)29
+b(A)37 b(v)-5 b(alue)35 b(of)i(1)g(is)227 4742 y(returned)29
 b(if)h(the)g(p)s(oin)m(ter)g(is)f(p)s(ositioned)g(at)i(the)f(b)s
-(eginning)e(of)i(the)h(header.)95 1149 y Ff(int)47 b(fits_get_hdrpos)d
-(/)j(ffghps)286 1262 y(\(fitsfile)f(*fptr,)g(>)h(int)g(*keysexist,)e
-(int)i(*keynum,)e(int)i(*status\))0 1551 y Fd(8.3.2)112
+(eginning)e(of)i(the)h(header.)95 4992 y Fe(int)47 b(fits_get_hdrpos)d
+(/)j(ffghps)286 5105 y(\(fitsfile)f(*fptr,)g(>)h(int)g(*keysexist,)e
+(int)i(*keynum,)e(int)i(*status\))0 5394 y Fd(9.3.2)112
 b(Read)38 b(and)h(W)-9 b(rite)35 b(the)i(Required)g(Keyw)m(ords)0
-1760 y Fi(1)81 b Fj(W)-8 b(rite)20 b(the)h(primary)d(header)i(or)g(IMA)
+5601 y Fi(1)81 b Fj(W)-8 b(rite)20 b(the)h(primary)d(header)i(or)g(IMA)
 m(GE)i(extension)e(k)m(eyw)m(ords)g(in)m(to)g(the)h(CHU.)f(The)g
-(simpler)e(\014ts)p 3535 1760 28 4 v 32 w(write)p 3770
-1760 V 32 w(imghdr)227 1872 y(routine)32 b(is)h(equiv)-5
-b(alen)m(t)32 b(to)i(calling)e(\014ts)p 1604 1872 V 32
-w(write)p 1839 1872 V 32 w(grphdr)f(with)h(the)i(default)e(v)-5
-b(alues)32 b(of)i(simple)d(=)i(TR)m(UE,)227 1985 y(p)s(coun)m(t)39
-b(=)g(0,)j(gcoun)m(t)e(=)f(1,)j(and)c(extend)h(=)g(TR)m(UE.)g(The)g
-(PCOUNT,)g(GCOUNT)f(and)h(EXTEND)227 2098 y(k)m(eyw)m(ords)32
-b(are)f(not)g(required)f(in)f(the)i(primary)f(header)g(and)h(are)g
-(only)f(written)g(if)g(p)s(coun)m(t)h(is)f(not)h(equal)227
-2211 y(to)26 b(zero,)h(gcoun)m(t)f(is)e(not)i(equal)e(to)i(zero)g(or)f
-(one,)h(and)f(if)f(extend)h(is)f(TR)m(UE,)h(resp)s(ectiv)m(ely)-8
-b(.)39 b(When)25 b(writing)227 2324 y(to)37 b(an)f(IMA)m(GE)h
-(extension,)h(the)e(SIMPLE)f(and)h(EXTEND)g(parameters)g(are)h
-(ignored.)57 b(It)36 b(is)f(recom-)227 2437 y(mended)27
-b(that)i(\014ts)p 885 2437 V 33 w(create)p 1154 2437
-V 34 w(image)g(or)f(\014ts)p 1680 2437 V 32 w(create)p
-1948 2437 V 35 w(tbl)f(b)s(e)g(used)h(instead)f(of)i(these)f(routines)f
-(to)i(write)f(the)227 2550 y(required)h(header)h(k)m(eyw)m(ords.)95
-2805 y Ff(int)47 b(fits_write_imghdr)c(/)48 b(ffphps)286
-2917 y(\(fitsfile)e(*fptr,)g(int)h(bitpix,)e(int)i(naxis,)f(long)h
-(*naxes,)f(>)h(int)g(*status\))95 3143 y(int)g(fits_write_grphdr)c(/)48
-b(ffphpr)286 3256 y(\(fitsfile)e(*fptr,)g(int)h(simple,)e(int)i
-(bitpix,)f(int)h(naxis,)f(long)h(*naxes,)334 3369 y(long)g(pcount,)f
-(long)g(gcount,)g(int)h(extend,)f(>)h(int)g(*status\))0
-3624 y Fi(2)81 b Fj(W)-8 b(rite)29 b(the)h(ASCI)s(I)d(table)j(header)f
-(k)m(eyw)m(ords)g(in)m(to)h(the)f(CHU.)h(The)e(optional)h(TUNITn)f(and)
-h(EXTNAME)227 3737 y(k)m(eyw)m(ords)f(are)h(written)d(only)h(if)g(the)h
-(input)e(p)s(oin)m(ters)h(are)h(not)g(n)m(ull.)38 b(A)27
-b(n)m(ull)f(p)s(oin)m(ter)h(ma)m(y)h(giv)m(en)g(for)g(the)227
-3850 y(*tb)s(col)36 b(parameter)h(in)e(whic)m(h)g(case)j(a)e(single)f
-(space)i(will)d(b)s(e)i(inserted)f(b)s(et)m(w)m(een)i(eac)m(h)g(column)
-e(of)i(the)227 3963 y(table.)56 b(Similarly)-8 b(,)33
-b(if)i(ro)m(wlen)f(is)h(giv)m(en)g(=)g(0,)i(then)e(CFITSIO)f(will)f
-(calculate)i(the)h(default)e(ro)m(wlength)227 4075 y(based)c(on)h(the)f
-(tb)s(col)g(and)g(tt)m(yp)s(e)h(v)-5 b(alues.)95 4330
-y Ff(int)47 b(fits_write_atblhdr)c(/)48 b(ffphtb)286
-4443 y(\(fitsfile)e(*fptr,)g(long)g(rowlen,)g(long)h(nrows,)f(int)h
-(tfields,)e(char)i(**ttype,)334 4556 y(long)g(*tbcol,)f(char)g
-(**tform,)g(char)g(**tunit,)g(char)h(*extname,)e(>)i(int)g(*status\))0
-4811 y Fi(3)81 b Fj(W)-8 b(rite)29 b(the)g(binary)f(table)h(header)f(k)
-m(eyw)m(ords)i(in)m(to)f(the)g(CHU.)g(The)g(optional)f(TUNITn)g(and)h
-(EXTNAME)227 4924 y(k)m(eyw)m(ords)35 b(are)g(written)f(only)g(if)f
-(the)i(input)e(p)s(oin)m(ters)g(are)i(not)g(n)m(ull.)51
-b(The)35 b(p)s(coun)m(t)f(parameter,)i(whic)m(h)227 5036
-y(sp)s(eci\014es)g(the)h(size)f(of)h(the)g(v)-5 b(ariable)36
-b(length)g(arra)m(y)h(heap,)h(should)d(initially)e(=)k(0;)j(CFITSIO)c
-(will)e(au-)227 5149 y(tomatically)d(up)s(date)g(the)g(PCOUNT)f(k)m
-(eyw)m(ord)i(v)-5 b(alue)31 b(if)f(an)m(y)h(v)-5 b(ariable)30
-b(length)h(arra)m(y)h(data)g(is)e(written)227 5262 y(to)h(the)e(heap.)
-41 b(The)29 b(TF)m(ORM)g(k)m(eyw)m(ord)h(v)-5 b(alue)29
-b(for)h(v)-5 b(ariable)28 b(length)h(v)m(ector)i(columns)d(should)g(ha)
-m(v)m(e)j(the)227 5375 y(form)c('Pt\(len\)')i(or)e('1Pt\(len\)')i
-(where)e(`t')h(is)f(the)h(data)g(t)m(yp)s(e)g(co)s(de)f(letter)h
-(\(A,I,J,E,D,)h(etc.\))42 b(and)27 b(`len')g(is)227 5488
-y(an)h(in)m(teger)h(sp)s(ecifying)d(the)i(maxim)m(um)f(length)g(of)i
-(the)f(v)m(ectors)h(in)e(that)i(column)e(\(len)g(m)m(ust)h(b)s(e)g
-(greater)227 5601 y(than)36 b(or)g(equal)g(to)h(the)f(longest)h(v)m
+(simpler)e(\014ts)p 3535 5601 V 32 w(write)p 3770 5601
+V 32 w(imghdr)227 5714 y(routine)32 b(is)h(equiv)-5 b(alen)m(t)32
+b(to)i(calling)e(\014ts)p 1604 5714 V 32 w(write)p 1839
+5714 V 32 w(grphdr)f(with)h(the)i(default)e(v)-5 b(alues)32
+b(of)i(simple)d(=)i(TR)m(UE,)p eop
+%%Page: 87 95
+87 94 bop 0 299 a Fh(9.3.)72 b(SPECIALIZED)29 b(HEADER)i(KEYW)m(ORD)g
+(R)m(OUTINES)1510 b Fj(87)227 555 y(p)s(coun)m(t)39 b(=)g(0,)j(gcoun)m
+(t)e(=)f(1,)j(and)c(extend)h(=)g(TR)m(UE.)g(The)g(PCOUNT,)g(GCOUNT)f
+(and)h(EXTEND)227 668 y(k)m(eyw)m(ords)32 b(are)f(not)g(required)f(in)f
+(the)i(primary)f(header)g(and)h(are)g(only)f(written)g(if)g(p)s(coun)m
+(t)h(is)f(not)h(equal)227 781 y(to)26 b(zero,)h(gcoun)m(t)f(is)e(not)i
+(equal)e(to)i(zero)g(or)f(one,)h(and)f(if)f(extend)h(is)f(TR)m(UE,)h
+(resp)s(ectiv)m(ely)-8 b(.)39 b(When)25 b(writing)227
+894 y(to)37 b(an)f(IMA)m(GE)h(extension,)h(the)e(SIMPLE)f(and)h(EXTEND)
+g(parameters)g(are)h(ignored.)57 b(It)36 b(is)f(recom-)227
+1007 y(mended)27 b(that)i(\014ts)p 885 1007 28 4 v 33
+w(create)p 1154 1007 V 34 w(image)g(or)f(\014ts)p 1680
+1007 V 32 w(create)p 1948 1007 V 35 w(tbl)f(b)s(e)g(used)h(instead)f
+(of)i(these)f(routines)f(to)i(write)f(the)227 1120 y(required)h(header)
+h(k)m(eyw)m(ords.)95 1374 y Fe(int)47 b(fits_write_imghdr)c(/)48
+b(ffphps)286 1487 y(\(fitsfile)e(*fptr,)g(int)h(bitpix,)e(int)i(naxis,)
+f(long)h(*naxes,)f(>)h(int)g(*status\))95 1713 y(int)g
+(fits_write_grphdr)c(/)48 b(ffphpr)286 1826 y(\(fitsfile)e(*fptr,)g
+(int)h(simple,)e(int)i(bitpix,)f(int)h(naxis,)f(long)h(*naxes,)334
+1939 y(long)g(pcount,)f(long)g(gcount,)g(int)h(extend,)f(>)h(int)g
+(*status\))0 2194 y Fi(2)81 b Fj(W)-8 b(rite)29 b(the)h(ASCI)s(I)d
+(table)j(header)f(k)m(eyw)m(ords)g(in)m(to)h(the)f(CHU.)h(The)e
+(optional)h(TUNITn)f(and)h(EXTNAME)227 2307 y(k)m(eyw)m(ords)f(are)h
+(written)d(only)h(if)g(the)h(input)e(p)s(oin)m(ters)h(are)h(not)g(n)m
+(ull.)38 b(A)27 b(n)m(ull)f(p)s(oin)m(ter)h(ma)m(y)h(giv)m(en)g(for)g
+(the)227 2419 y(*tb)s(col)36 b(parameter)h(in)e(whic)m(h)g(case)j(a)e
+(single)f(space)i(will)d(b)s(e)i(inserted)f(b)s(et)m(w)m(een)i(eac)m(h)
+g(column)e(of)i(the)227 2532 y(table.)56 b(Similarly)-8
+b(,)33 b(if)i(ro)m(wlen)f(is)h(giv)m(en)g(=)g(0,)i(then)e(CFITSIO)f
+(will)f(calculate)i(the)h(default)e(ro)m(wlength)227
+2645 y(based)c(on)h(the)f(tb)s(col)g(and)g(tt)m(yp)s(e)h(v)-5
+b(alues.)95 2900 y Fe(int)47 b(fits_write_atblhdr)c(/)48
+b(ffphtb)286 3013 y(\(fitsfile)e(*fptr,)g(long)g(rowlen,)g(long)h
+(nrows,)f(int)h(tfields,)e(char)i(**ttype,)334 3126 y(long)g(*tbcol,)f
+(char)g(**tform,)g(char)g(**tunit,)g(char)h(*extname,)e(>)i(int)g
+(*status\))0 3380 y Fi(3)81 b Fj(W)-8 b(rite)29 b(the)g(binary)f(table)
+h(header)f(k)m(eyw)m(ords)i(in)m(to)f(the)g(CHU.)g(The)g(optional)f
+(TUNITn)g(and)h(EXTNAME)227 3493 y(k)m(eyw)m(ords)35
+b(are)g(written)f(only)g(if)f(the)i(input)e(p)s(oin)m(ters)g(are)i(not)
+g(n)m(ull.)51 b(The)35 b(p)s(coun)m(t)f(parameter,)i(whic)m(h)227
+3606 y(sp)s(eci\014es)g(the)h(size)f(of)h(the)g(v)-5
+b(ariable)36 b(length)g(arra)m(y)h(heap,)h(should)d(initially)e(=)k(0;)
+j(CFITSIO)c(will)e(au-)227 3719 y(tomatically)d(up)s(date)g(the)g
+(PCOUNT)f(k)m(eyw)m(ord)i(v)-5 b(alue)31 b(if)f(an)m(y)h(v)-5
+b(ariable)30 b(length)h(arra)m(y)h(data)g(is)e(written)227
+3832 y(to)h(the)e(heap.)41 b(The)29 b(TF)m(ORM)g(k)m(eyw)m(ord)h(v)-5
+b(alue)29 b(for)h(v)-5 b(ariable)28 b(length)h(v)m(ector)i(columns)d
+(should)g(ha)m(v)m(e)j(the)227 3945 y(form)c('Pt\(len\)')i(or)e
+('1Pt\(len\)')i(where)e(`t')h(is)f(the)h(data)g(t)m(yp)s(e)g(co)s(de)f
+(letter)h(\(A,I,J,E,D,)h(etc.\))42 b(and)27 b(`len')g(is)227
+4058 y(an)h(in)m(teger)h(sp)s(ecifying)d(the)i(maxim)m(um)f(length)g
+(of)i(the)f(v)m(ectors)h(in)e(that)i(column)e(\(len)g(m)m(ust)h(b)s(e)g
+(greater)227 4171 y(than)36 b(or)g(equal)g(to)h(the)f(longest)h(v)m
 (ector)g(in)e(the)i(column\).)57 b(If)36 b(`len')f(is)h(not)g(sp)s
-(eci\014ed)f(when)g(the)h(table)227 5714 y(is)31 b(created)h(\(e.g.,)h
+(eci\014ed)f(when)g(the)h(table)227 4284 y(is)31 b(created)h(\(e.g.,)h
 (the)f(input)d(TF)m(ORMn)i(v)-5 b(alue)31 b(is)f(just)h('1Pt'\))i(then)
-e(CFITSIO)f(will)e(scan)k(the)f(column)p eop
-%%Page: 110 116
-110 115 bop 0 299 a Fj(110)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
-555 y Fj(when)g(the)h(table)g(is)f(\014rst)g(closed)g(and)h(will)d(app)
-s(end)h(the)i(maxim)m(um)f(length)g(to)h(the)g(TF)m(ORM)g(k)m(eyw)m
-(ord)227 668 y(v)-5 b(alue.)40 b(Note)30 b(that)f(if)e(the)i(table)f
-(is)g(subsequen)m(tly)f(mo)s(di\014ed)f(to)k(increase)e(the)h(maxim)m
-(um)e(length)h(of)h(the)227 781 y(v)m(ectors)39 b(then)e(the)g(mo)s
-(difying)e(program)i(is)f(resp)s(onsible)f(for)i(also)g(up)s(dating)e
-(the)j(TF)m(ORM)f(k)m(eyw)m(ord)227 894 y(v)-5 b(alue.)95
-1161 y Ff(int)47 b(fits_write_btblhdr)c(/)48 b(ffphbn)286
-1274 y(\(fitsfile)e(*fptr,)g(long)g(nrows,)g(int)h(tfields,)f(char)h
-(**ttype,)334 1387 y(char)g(**tform,)e(char)i(**tunit,)e(char)i
-(*extname,)e(long)i(pcount,)f(>)h(int)g(*status\))0 1654
-y Fi(4)81 b Fj(Read)35 b(the)g(primary)e(header)i(or)g(IMA)m(GE)h
-(extension)e(k)m(eyw)m(ords)i(in)d(the)i(CHU.)h(When)e(reading)h(from)f
-(an)227 1767 y(IMA)m(GE)h(extension)f(the)g(SIMPLE)f(and)g(EXTEND)h
-(parameters)h(are)f(ignored.)50 b(A)35 b(n)m(ull)c(p)s(oin)m(ter)i(ma)m
-(y)227 1880 y(b)s(e)d(supplied)d(for)j(an)m(y)h(of)f(the)h(returned)e
-(parameters)i(that)g(are)g(not)f(needed.)95 2147 y Ff(int)47
-b(fits_read_imghdr)d(/)j(ffghpr)286 2260 y(\(fitsfile)f(*fptr,)g(int)h
-(maxdim,)e(>)j(int)f(*simple,)e(int)i(*bitpix,)f(int)h(*naxis,)334
-2373 y(long)g(*naxes,)f(long)g(*pcount,)g(long)g(*gcount,)g(int)h
-(*extend,)e(int)i(*status\))0 2640 y Fi(5)81 b Fj(Read)30
-b(the)h(ASCI)s(I)e(table)i(header)f(k)m(eyw)m(ords)h(in)e(the)i(CHU.)g
-(A)g(n)m(ull)d(p)s(oin)m(ter)i(ma)m(y)h(b)s(e)f(supplied)d(for)k(an)m
-(y)g(of)227 2753 y(the)g(returned)e(parameters)i(that)g(are)f(not)h
-(needed.)95 3020 y Ff(int)47 b(fits_read_atblhdr)c(/)48
-b(ffghtb)286 3133 y(\(fitsfile)e(*fptr,int)f(maxdim,)h(>)h(long)g
-(*rowlen,)e(long)i(*nrows,)334 3246 y(int)g(*tfields,)e(char)i
-(**ttype,)e(long)i(*tbcol,)f(char)h(**tform,)e(char)i(**tunit,)334
-3359 y(char)g(*extname,)93 b(int)47 b(*status\))0 3626
-y Fi(6)81 b Fj(Read)30 b(the)g(binary)f(table)h(header)g(k)m(eyw)m
-(ords)g(from)g(the)g(CHU.)g(A)g(n)m(ull)f(p)s(oin)m(ter)g(ma)m(y)h(b)s
-(e)g(supplied)d(for)j(an)m(y)227 3739 y(of)h(the)f(returned)g
-(parameters)g(that)h(are)g(not)g(needed.)95 4006 y Ff(int)47
-b(fits_read_btblhdr)c(/)48 b(ffghbn)286 4119 y(\(fitsfile)e(*fptr,)g
-(int)h(maxdim,)e(>)j(long)f(*nrows,)e(int)i(*tfields,)334
-4232 y(char)g(**ttype,)e(char)i(**tform,)e(char)i(**tunit,)f(char)g
-(*extname,)334 4345 y(long)h(*pcount,)e(int)i(*status\))0
-4644 y Fd(8.3.3)112 b(Sp)s(ecialized)37 b(W)-9 b(rite)35
-b(Keyw)m(ord)i(Routines)0 4865 y Fj(These)32 b(routines)g(simply)e(app)
-s(end)h(a)h(new)g(k)m(eyw)m(ord)h(to)h(the)e(header)h(and)f(do)g(not)h
-(c)m(hec)m(k)h(to)f(see)g(if)f(a)g(k)m(eyw)m(ord)0 4977
-y(with)c(the)h(same)h(name)f(already)g(exists.)40 b(In)28
-b(general)h(it)g(is)f(preferable)g(to)i(use)f(the)h(\014ts)p
-3009 4977 28 4 v 32 w(up)s(date)p 3317 4977 V 32 w(k)m(ey)g(routine)e
-(to)0 5090 y(ensure)34 b(that)h(the)g(same)g(k)m(eyw)m(ord)g(is)e(not)i
+e(CFITSIO)f(will)e(scan)k(the)f(column)227 4397 y(when)f(the)h(table)g
+(is)f(\014rst)g(closed)g(and)h(will)d(app)s(end)h(the)i(maxim)m(um)f
+(length)g(to)h(the)g(TF)m(ORM)g(k)m(eyw)m(ord)227 4509
+y(v)-5 b(alue.)40 b(Note)30 b(that)f(if)e(the)i(table)f(is)g(subsequen)
+m(tly)f(mo)s(di\014ed)f(to)k(increase)e(the)h(maxim)m(um)e(length)h(of)
+h(the)227 4622 y(v)m(ectors)39 b(then)e(the)g(mo)s(difying)e(program)i
+(is)f(resp)s(onsible)f(for)i(also)g(up)s(dating)e(the)j(TF)m(ORM)f(k)m
+(eyw)m(ord)227 4735 y(v)-5 b(alue.)95 4990 y Fe(int)47
+b(fits_write_btblhdr)c(/)48 b(ffphbn)286 5103 y(\(fitsfile)e(*fptr,)g
+(long)g(nrows,)g(int)h(tfields,)f(char)h(**ttype,)334
+5216 y(char)g(**tform,)e(char)i(**tunit,)e(char)i(*extname,)e(long)i
+(pcount,)f(>)h(int)g(*status\))0 5470 y Fi(4)81 b Fj(Read)30
+b(the)h(required)d(k)m(eyw)m(ords)j(from)f(the)h(CHDU)f(\(image)i(or)e
+(table\).)41 b(When)30 b(reading)g(from)g(an)g(IMA)m(GE)227
+5583 y(extension)23 b(the)h(SIMPLE)e(and)h(EXTEND)g(parameters)h(are)f
+(ignored.)38 b(A)23 b(n)m(ull)e(p)s(oin)m(ter)i(ma)m(y)h(b)s(e)e
+(supplied)227 5696 y(for)30 b(an)m(y)h(of)g(the)f(returned)f
+(parameters)i(that)g(are)g(not)f(needed.)p eop
+%%Page: 88 96
+88 95 bop 0 299 a Fj(88)1003 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
+555 y Fe(int)47 b(fits_read_imghdr)d(/)j(ffghpr)286 668
+y(\(fitsfile)f(*fptr,)g(int)h(maxdim,)e(>)j(int)f(*simple,)e(int)i
+(*bitpix,)f(int)h(*naxis,)334 781 y(long)g(*naxes,)f(long)g(*pcount,)g
+(long)g(*gcount,)g(int)h(*extend,)e(int)i(*status\))95
+1007 y(int)g(fits_read_atblhdr)c(/)48 b(ffghtb)286 1120
+y(\(fitsfile)e(*fptr,int)f(maxdim,)h(>)h(long)g(*rowlen,)e(long)i
+(*nrows,)334 1233 y(int)g(*tfields,)e(char)i(**ttype,)e(long)i(*tbcol,)
+f(char)h(**tform,)e(char)i(**tunit,)334 1346 y(char)g(*extname,)93
+b(int)47 b(*status\))95 1571 y(int)g(fits_read_btblhdr)c(/)48
+b(ffghbn)286 1684 y(\(fitsfile)e(*fptr,)g(int)h(maxdim,)e(>)j(long)f
+(*nrows,)e(int)i(*tfields,)334 1797 y(char)g(**ttype,)e(char)i
+(**tform,)e(char)i(**tunit,)f(char)g(*extname,)334 1910
+y(long)h(*pcount,)e(int)i(*status\))0 2197 y Fd(9.3.3)112
+b(W)-9 b(rite)36 b(Keyw)m(ord)h(Routines)0 2416 y Fj(These)32
+b(routines)g(simply)e(app)s(end)h(a)h(new)g(k)m(eyw)m(ord)h(to)h(the)e
+(header)h(and)f(do)g(not)h(c)m(hec)m(k)h(to)f(see)g(if)f(a)g(k)m(eyw)m
+(ord)0 2528 y(with)c(the)h(same)h(name)f(already)g(exists.)40
+b(In)28 b(general)h(it)g(is)f(preferable)g(to)i(use)f(the)h(\014ts)p
+3009 2528 28 4 v 32 w(up)s(date)p 3317 2528 V 32 w(k)m(ey)g(routine)e
+(to)0 2641 y(ensure)34 b(that)h(the)g(same)g(k)m(eyw)m(ord)g(is)e(not)i
 (written)f(more)h(than)f(once)h(to)h(the)e(header.)54
-b(See)34 b(App)s(endix)e(B)j(for)0 5203 y(the)c(de\014nition)d(of)i
-(the)h(parameters)f(used)g(in)f(these)i(routines.)0 5470
-y Fi(1)81 b Fj(W)-8 b(rite)26 b(\(app)s(end\))f(a)h(new)f(k)m(eyw)m
-(ord)i(with)d(an)i(unde\014ned,)f(or)h(n)m(ull,)f(v)-5
-b(alue)25 b(in)m(to)h(the)g(CHU.)g(The)g(v)-5 b(alue)25
-b(string)227 5583 y(of)39 b(the)f(k)m(eyw)m(ord)h(is)f(left)g(blank)f
-(in)g(this)g(case.)66 b(A)39 b(n)m(ull)d(p)s(oin)m(ter)h(ma)m(y)i(b)s
-(e)f(en)m(tered)h(for)f(the)h(commen)m(t)227 5696 y(parameter.)p
-eop
-%%Page: 111 117
-111 116 bop 0 299 a Fh(8.3.)72 b(SPECIALIZED)29 b(HEADER)i(KEYW)m(ORD)g
-(R)m(OUTINES)1465 b Fj(111)95 555 y Ff(int)47 b(fits_write_key_null)c
-(/)k(ffpkyu)286 668 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g
-(*comment,)g(>)h(int)g(*status\))0 887 y Fi(2)81 b Fj(W)-8
-b(rite)23 b(\(app)s(end\))g(a)h(new)f(k)m(eyw)m(ord)h(of)f(the)h
-(appropriate)f(datat)m(yp)s(e)h(in)m(to)g(the)f(CHU.)h(A)g(n)m(ull)d(p)
-s(oin)m(ter)h(ma)m(y)j(b)s(e)227 1000 y(en)m(tered)k(for)e(the)h
-(commen)m(t)h(parameter,)g(whic)m(h)d(will)g(cause)i(the)g(commen)m(t)h
-(\014eld)d(of)i(the)g(k)m(eyw)m(ord)g(to)h(b)s(e)227
-1113 y(left)e(blank.)38 b(The)27 b(\015t,)h(dbl,)e(cmp,)h(and)g(dblcmp)
-e(v)m(ersions)h(of)h(this)f(routine)g(ha)m(v)m(e)i(the)g(added)e
-(feature)h(that)227 1226 y(if)e(the)i('decimals')e(parameter)i(is)e
-(negativ)m(e,)k(then)d(the)g('G')h(displa)m(y)d(format)j(rather)f(then)
-g(the)g('E')h(format)227 1339 y(will)f(b)s(e)i(used)f(when)h
-(constructing)g(the)g(k)m(eyw)m(ord)h(v)-5 b(alue,)29
-b(taking)f(the)h(absolute)f(v)-5 b(alue)28 b(of)g('decimals')g(for)227
-1451 y(the)37 b(precision.)58 b(This)34 b(will)g(suppress)h(trailing)f
-(zeros,)39 b(and)d(will)e(use)j(a)g(\014xed)e(format)i(rather)g(than)f
-(an)227 1564 y(exp)s(onen)m(tial)30 b(format,)h(dep)s(ending)c(on)k
-(the)f(magnitude)g(of)g(the)h(v)-5 b(alue.)95 1783 y
-Ff(int)47 b(fits_write_key_str)c(/)48 b(ffpkys)286 1896
-y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(char)g(*value,)g(char)h
-(*comment,)334 2009 y(>)h(int)e(*status\))95 2235 y(int)h
-(fits_write_key_[log,)c(lng])j(/)95 b(ffpky[lj])286 2348
-y(\(fitsfile)46 b(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g(char)g
-(*comment,)334 2461 y(>)i(int)e(*status\))95 2686 y(int)h
-(fits_write_key_[flt,)c(dbl,)j(fixflg,)g(fixdbl])g(/)h(ffpky[edfg])286
-2799 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g(int)h
-(decimals,)286 2912 y(char)g(*comment,)e(>)j(int)f(*status\))95
-3138 y(int)g(fits_write_key_[cmp,)c(dblcmp,)i(fixcmp,)h(fixdblcmp])f(/)
-j(ffpk[yc,ym,fc,fm])286 3251 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g
-(DTYPE)g(*numval,)g(int)g(decimals,)286 3364 y(char)h(*comment,)e(>)j
-(int)f(*status\))0 3583 y Fi(3)81 b Fj(W)-8 b(rite)29
-b(\(app)s(end\))f(a)i(string)e(v)-5 b(alued)28 b(k)m(eyw)m(ord)i(in)m
-(to)f(the)g(CHU)h(whic)m(h)d(ma)m(y)j(b)s(e)f(longer)g(than)f(68)i(c)m
-(haracters)227 3696 y(in)42 b(length.)79 b(This)41 b(uses)i(the)g(Long)
-h(String)d(Keyw)m(ord)i(con)m(v)m(en)m(tion)i(that)e(is)g(describ)s(ed)
-e(in)h(the`Lo)s(cal)227 3808 y(FITS)c(Con)m(v)m(en)m(tions')h(section)g
-(in)f(Chapter)g(4.)66 b(Since)37 b(this)h(uses)g(a)h(non-standard)f
-(FITS)g(con)m(v)m(en)m(tion)227 3921 y(to)45 b(enco)s(de)f(the)g(long)g
-(k)m(eyw)m(ord)g(string,)j(programs)c(whic)m(h)g(use)h(this)f(routine)g
-(should)f(also)h(call)h(the)227 4034 y(\014ts)p 354 4034
-28 4 v 33 w(write)p 590 4034 V 32 w(k)m(ey)p 755 4034
-V 33 w(longw)m(arn)25 b(routine)f(to)i(add)f(some)h(COMMENT)f(k)m(eyw)m
-(ords)g(to)h(w)m(arn)f(users)g(of)g(the)h(FITS)227 4147
-y(\014le)42 b(that)i(this)d(con)m(v)m(en)m(tion)j(is)e(b)s(eing)f
-(used.)78 b(The)42 b(\014ts)p 2220 4147 V 32 w(write)p
-2455 4147 V 32 w(k)m(ey)p 2620 4147 V 34 w(longw)m(arn)g(routine)g
-(also)h(writes)f(a)227 4260 y(k)m(eyw)m(ord)29 b(called)e(LONGSTRN)g
-(to)i(record)f(the)g(v)m(ersion)g(of)g(the)g(longstring)f(con)m(v)m(en)
-m(tion)i(that)g(has)f(b)s(een)227 4373 y(used,)35 b(in)e(case)j(a)f
-(new)e(con)m(v)m(en)m(tion)j(is)e(adopted)g(at)h(some)g(p)s(oin)m(t)e
-(in)h(the)g(future.)52 b(If)34 b(the)h(LONGSTRN)227 4486
-y(k)m(eyw)m(ord)43 b(is)f(already)g(presen)m(t)h(in)f(the)g(header,)k
-(then)d(\014ts)p 2332 4486 V 32 w(write)p 2567 4486 V
-32 w(k)m(ey)p 2732 4486 V 34 w(longw)m(arn)f(will)e(simply)g(return)227
-4599 y(without)30 b(doing)f(an)m(ything.)95 4818 y Ff(int)47
-b(fits_write_key_longstr)42 b(/)48 b(ffpkls)286 4931
+b(See)34 b(App)s(endix)e(B)j(for)0 2754 y(the)c(de\014nition)d(of)i
+(the)h(parameters)f(used)g(in)f(these)i(routines.)0 2988
+y Fi(1)81 b Fj(W)-8 b(rite)29 b(\(app)s(end\))g(a)g(new)g(k)m(eyw)m
+(ord)h(of)g(the)f(appropriate)f(data)i(t)m(yp)s(e)g(in)m(to)f(the)h
+(CHU.)f(A)h(n)m(ull)d(p)s(oin)m(ter)h(ma)m(y)227 3101
+y(b)s(e)35 b(en)m(tered)h(for)f(the)h(commen)m(t)h(parameter,)g(whic)m
+(h)d(will)f(cause)j(the)g(commen)m(t)g(\014eld)e(of)i(the)f(k)m(eyw)m
+(ord)227 3214 y(to)43 b(b)s(e)e(left)h(blank.)75 b(The)41
+b(\015t,)k(dbl,)e(cmp,)i(and)d(dblcmp)e(v)m(ersions)h(of)h(this)f
+(routine)g(ha)m(v)m(e)i(the)g(added)227 3327 y(feature)33
+b(that)g(if)f(the)g('decimals')g(parameter)h(is)f(negativ)m(e,)i(then)e
+(the)h('G')g(displa)m(y)e(format)i(rather)f(then)227
+3440 y(the)i('E')f(format)h(will)c(b)s(e)j(used)f(when)g(constructing)h
+(the)h(k)m(eyw)m(ord)f(v)-5 b(alue,)34 b(taking)f(the)h(absolute)e(v)-5
+b(alue)227 3553 y(of)34 b('decimals')f(for)g(the)h(precision.)49
+b(This)32 b(will)f(suppress)g(trailing)h(zeros,)j(and)e(will)e(use)j(a)
+g(\014xed)f(format)227 3666 y(rather)e(than)f(an)g(exp)s(onen)m(tial)f
+(format,)i(dep)s(ending)d(on)i(the)h(magnitude)e(of)i(the)g(v)-5
+b(alue.)95 3899 y Fe(int)47 b(fits_write_key_str)c(/)48
+b(ffpkys)286 4012 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(char)g
+(*value,)g(char)h(*comment,)334 4125 y(>)h(int)e(*status\))95
+4351 y(int)h(fits_write_key_[log,)c(lng])j(/)95 b(ffpky[lj])286
+4464 y(\(fitsfile)46 b(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g
+(char)g(*comment,)334 4577 y(>)i(int)e(*status\))95 4803
+y(int)h(fits_write_key_[flt,)c(dbl,)j(fixflg,)g(fixdbl])g(/)h
+(ffpky[edfg])286 4916 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)
+g(numval,)g(int)h(decimals,)286 5028 y(char)g(*comment,)e(>)j(int)f
+(*status\))95 5254 y(int)g(fits_write_key_[cmp,)c(dblcmp,)i(fixcmp,)h
+(fixdblcmp])f(/)j(ffpk[yc,ym,fc,fm])286 5367 y(\(fitsfile)e(*fptr,)g
+(char)g(*keyname,)g(DTYPE)g(*numval,)g(int)g(decimals,)286
+5480 y(char)h(*comment,)e(>)j(int)f(*status\))0 5714
+y Fi(2)81 b Fj(W)-8 b(rite)29 b(\(app)s(end\))f(a)i(string)e(v)-5
+b(alued)28 b(k)m(eyw)m(ord)i(in)m(to)f(the)g(CHU)h(whic)m(h)d(ma)m(y)j
+(b)s(e)f(longer)g(than)f(68)i(c)m(haracters)p eop
+%%Page: 89 97
+89 96 bop 0 299 a Fh(9.3.)72 b(SPECIALIZED)29 b(HEADER)i(KEYW)m(ORD)g
+(R)m(OUTINES)1510 b Fj(89)227 555 y(in)42 b(length.)79
+b(This)41 b(uses)i(the)g(Long)h(String)d(Keyw)m(ord)i(con)m(v)m(en)m
+(tion)i(that)e(is)g(describ)s(ed)e(in)h(the`Lo)s(cal)227
+668 y(FITS)c(Con)m(v)m(en)m(tions')h(section)g(in)f(Chapter)g(4.)66
+b(Since)37 b(this)h(uses)g(a)h(non-standard)f(FITS)g(con)m(v)m(en)m
+(tion)227 781 y(to)45 b(enco)s(de)f(the)g(long)g(k)m(eyw)m(ord)g
+(string,)j(programs)c(whic)m(h)g(use)h(this)f(routine)g(should)f(also)h
+(call)h(the)227 894 y(\014ts)p 354 894 28 4 v 33 w(write)p
+590 894 V 32 w(k)m(ey)p 755 894 V 33 w(longw)m(arn)25
+b(routine)f(to)i(add)f(some)h(COMMENT)f(k)m(eyw)m(ords)g(to)h(w)m(arn)f
+(users)g(of)g(the)h(FITS)227 1007 y(\014le)42 b(that)i(this)d(con)m(v)m
+(en)m(tion)j(is)e(b)s(eing)f(used.)78 b(The)42 b(\014ts)p
+2220 1007 V 32 w(write)p 2455 1007 V 32 w(k)m(ey)p 2620
+1007 V 34 w(longw)m(arn)g(routine)g(also)h(writes)f(a)227
+1120 y(k)m(eyw)m(ord)29 b(called)e(LONGSTRN)g(to)i(record)f(the)g(v)m
+(ersion)g(of)g(the)g(longstring)f(con)m(v)m(en)m(tion)i(that)g(has)f(b)
+s(een)227 1233 y(used,)35 b(in)e(case)j(a)f(new)e(con)m(v)m(en)m(tion)j
+(is)e(adopted)g(at)h(some)g(p)s(oin)m(t)e(in)h(the)g(future.)52
+b(If)34 b(the)h(LONGSTRN)227 1346 y(k)m(eyw)m(ord)43
+b(is)f(already)g(presen)m(t)h(in)f(the)g(header,)k(then)d(\014ts)p
+2332 1346 V 32 w(write)p 2567 1346 V 32 w(k)m(ey)p 2732
+1346 V 34 w(longw)m(arn)f(will)e(simply)g(return)227
+1458 y(without)30 b(doing)f(an)m(ything.)95 1700 y Fe(int)47
+b(fits_write_key_longstr)42 b(/)48 b(ffpkls)286 1813
 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(char)g(*longstr,)g(char)g
-(*comment,)334 5043 y(>)i(int)e(*status\))95 5269 y(int)h
-(fits_write_key_longwarn)42 b(/)47 b(ffplsw)286 5382
-y(\(fitsfile)f(*fptr,)g(>)h(int)g(*status\))0 5601 y
-Fi(4)81 b Fj(W)-8 b(rite)37 b(\(app)s(end\))e(a)i(n)m(um)m(b)s(ered)e
+(*comment,)334 1926 y(>)i(int)e(*status\))95 2151 y(int)h
+(fits_write_key_longwarn)42 b(/)47 b(ffplsw)286 2264
+y(\(fitsfile)f(*fptr,)g(>)h(int)g(*status\))0 2506 y
+Fi(3)81 b Fj(W)-8 b(rite)37 b(\(app)s(end\))e(a)i(n)m(um)m(b)s(ered)e
 (sequence)i(of)g(k)m(eyw)m(ords)g(in)m(to)f(the)h(CHU.)g(The)f
-(starting)g(index)f(n)m(um)m(b)s(er)227 5714 y(\(nstart\))30
+(starting)g(index)f(n)m(um)m(b)s(er)227 2619 y(\(nstart\))30
 b(m)m(ust)e(b)s(e)g(greater)i(than)f(0.)40 b(One)28 b(ma)m(y)i(app)s
 (end)d(the)h(same)i(commen)m(t)f(to)h(ev)m(ery)f(k)m(eyw)m(ord)g(\(and)
-p eop
-%%Page: 112 118
-112 117 bop 0 299 a Fj(112)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
-555 y Fj(eliminate)i(the)i(need)f(to)h(ha)m(v)m(e)g(an)f(arra)m(y)h(of)
-f(iden)m(tical)g(commen)m(t)h(strings,)f(one)g(for)h(eac)m(h)g(k)m(eyw)
-m(ord\))g(b)m(y)227 668 y(including)21 b(the)k(amp)s(ersand)e(c)m
+227 2732 y(eliminate)j(the)i(need)f(to)h(ha)m(v)m(e)g(an)f(arra)m(y)h
+(of)f(iden)m(tical)g(commen)m(t)h(strings,)f(one)g(for)h(eac)m(h)g(k)m
+(eyw)m(ord\))g(b)m(y)227 2844 y(including)21 b(the)k(amp)s(ersand)e(c)m
 (haracter)j(as)e(the)h(last)f(non-blank)f(c)m(haracter)j(in)d(the)h
-(\(\014rst\))h(COMMENTS)227 781 y(string)d(parameter.)38
+(\(\014rst\))h(COMMENTS)227 2957 y(string)d(parameter.)38
 b(This)21 b(same)i(string)e(will)f(then)i(b)s(e)g(used)f(for)h(the)h
 (commen)m(t)g(\014eld)e(in)g(all)h(the)g(k)m(eyw)m(ords.)227
-894 y(One)32 b(ma)m(y)h(also)f(en)m(ter)g(a)h(n)m(ull)d(p)s(oin)m(ter)h
-(for)h(the)g(commen)m(t)h(parameter)g(to)f(lea)m(v)m(e)i(the)e(commen)m
-(t)h(\014eld)e(of)227 1007 y(the)g(k)m(eyw)m(ord)g(blank.)95
-1289 y Ff(int)47 b(fits_write_keys_str)c(/)k(ffpkns)286
-1402 y(\(fitsfile)f(*fptr,)g(char)g(*keyroot,)g(int)h(nstart,)e(int)i
-(nkeys,)334 1515 y(char)g(**value,)e(char)i(**comment,)e(>)i(int)g
-(*status\))95 1741 y(int)g(fits_write_keys_[log,)42 b(lng])47
-b(/)g(ffpkn[lj])286 1854 y(\(fitsfile)f(*fptr,)g(char)g(*keyroot,)g
-(int)h(nstart,)e(int)i(nkeys,)334 1967 y(DTYPE)f(*numval,)g(char)h
-(**comment,)e(int)i(*status\))95 2193 y(int)g(fits_write_keys_[flt,)42
+3070 y(One)32 b(ma)m(y)h(also)f(en)m(ter)g(a)h(n)m(ull)d(p)s(oin)m(ter)
+h(for)h(the)g(commen)m(t)h(parameter)g(to)f(lea)m(v)m(e)i(the)e(commen)
+m(t)h(\014eld)e(of)227 3183 y(the)g(k)m(eyw)m(ord)g(blank.)95
+3425 y Fe(int)47 b(fits_write_keys_str)c(/)k(ffpkns)286
+3537 y(\(fitsfile)f(*fptr,)g(char)g(*keyroot,)g(int)h(nstart,)e(int)i
+(nkeys,)334 3650 y(char)g(**value,)e(char)i(**comment,)e(>)i(int)g
+(*status\))95 3876 y(int)g(fits_write_keys_[log,)42 b(lng])47
+b(/)g(ffpkn[lj])286 3989 y(\(fitsfile)f(*fptr,)g(char)g(*keyroot,)g
+(int)h(nstart,)e(int)i(nkeys,)334 4102 y(DTYPE)f(*numval,)g(char)h
+(**comment,)e(int)i(*status\))95 4328 y(int)g(fits_write_keys_[flt,)42
 b(dbl,)47 b(fixflg,)f(fixdbl])g(/)h(ffpkne[edfg])286
-2305 y(\(fitsfile)f(*fptr,)g(char)g(*keyroot,)g(int)h(nstart,)e(int)i
-(nkey,)334 2418 y(DTYPE)f(*numval,)g(int)h(decimals,)e(char)i
-(**comment,)e(>)i(int)g(*status\))0 2701 y Fi(5)81 b
+4441 y(\(fitsfile)f(*fptr,)g(char)g(*keyroot,)g(int)h(nstart,)e(int)i
+(nkey,)334 4554 y(DTYPE)f(*numval,)g(int)h(decimals,)e(char)i
+(**comment,)e(>)i(int)g(*status\))0 4795 y Fi(4)81 b
 Fj(Cop)m(y)21 b(an)h(indexed)e(k)m(eyw)m(ord)j(from)e(one)h(HDU)h(to)f
 (another,)i(mo)s(difying)c(the)i(index)e(n)m(um)m(b)s(er)g(of)i(the)g
-(k)m(eyw)m(ord)227 2814 y(name)37 b(in)e(the)h(pro)s(cess.)58
+(k)m(eyw)m(ord)227 4908 y(name)37 b(in)e(the)h(pro)s(cess.)58
 b(F)-8 b(or)37 b(example,)h(this)d(routine)h(could)f(read)h(the)h
-(TLMIN3)f(k)m(eyw)m(ord)h(from)f(the)227 2927 y(input)27
-b(HDU)i(\(b)m(y)f(giving)f(k)m(eyro)s(ot)j(=)d("TLMIN")i(and)f(inn)m
-(um)e(=)i(3\))h(and)f(write)f(it)h(to)h(the)f(output)g(HDU)227
-3040 y(with)35 b(the)h(k)m(eyw)m(ord)h(name)f(TLMIN4)g(\(b)m(y)g
+(TLMIN3)f(k)m(eyw)m(ord)h(from)f(the)227 5021 y(input)29
+b(HDU)i(\(b)m(y)g(giving)f(k)m(eyro)s(ot)h(=)g(`TLMIN')g(and)f(inn)m
+(um)e(=)i(3\))i(and)e(write)g(it)g(to)h(the)g(output)f(HDU)227
+5134 y(with)35 b(the)h(k)m(eyw)m(ord)h(name)f(TLMIN4)g(\(b)m(y)g
 (setting)h(outn)m(um)e(=)h(4\).)58 b(If)36 b(the)g(input)e(k)m(eyw)m
-(ord)j(do)s(es)f(not)227 3152 y(exist,)31 b(then)f(this)f(routine)g
+(ord)j(do)s(es)f(not)227 5247 y(exist,)31 b(then)f(this)f(routine)g
 (simply)f(returns)h(without)h(indicating)e(an)i(error.)95
-3435 y Ff(int)47 b(fits_copy_key)e(/)i(ffcpky)286 3548
+5488 y Fe(int)47 b(fits_copy_key)e(/)i(ffcpky)286 5601
 y(\(fitsfile)f(*infptr,)f(fitsfile)h(*outfptr,)f(int)i(innum,)f(int)h
-(outnum,)334 3661 y(char)g(*keyroot,)e(>)i(int)g(*status\))0
-3943 y Fi(6)81 b Fj(W)-8 b(rite)29 b(\(app)s(end\))g(a)h(`triple)d
+(outnum,)334 5714 y(char)g(*keyroot,)e(>)i(int)g(*status\))p
+eop
+%%Page: 90 98
+90 97 bop 0 299 a Fj(90)1003 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fi(5)81 b Fj(W)-8 b(rite)29 b(\(app)s(end\))g(a)h(`triple)d
 (precision')h(k)m(eyw)m(ord)i(in)m(to)f(the)h(CHU)f(in)f(F28.16)k
-(format.)41 b(The)29 b(\015oating)g(p)s(oin)m(t)227 4056
+(format.)41 b(The)29 b(\015oating)g(p)s(oin)m(t)227 668
 y(k)m(eyw)m(ord)h(v)-5 b(alue)29 b(is)f(constructed)i(b)m(y)f
 (concatenating)i(the)e(input)f(in)m(teger)i(v)-5 b(alue)28
-b(with)g(the)i(input)d(double)227 4169 y(precision)33
+b(with)g(the)i(input)d(double)227 781 y(precision)33
 b(fraction)g(v)-5 b(alue)34 b(\(whic)m(h)f(m)m(ust)h(ha)m(v)m(e)i(a)e
 (v)-5 b(alue)34 b(b)s(et)m(w)m(een)g(0.0)i(and)d(1.0\).)53
-b(The)34 b(\013gkyt)h(routine)227 4282 y(should)c(b)s(e)i(used)f(to)i
+b(The)34 b(\013gkyt)h(routine)227 894 y(should)c(b)s(e)i(used)f(to)i
 (read)f(this)f(k)m(eyw)m(ord)i(v)-5 b(alue,)34 b(b)s(ecause)f(the)g
 (other)h(k)m(eyw)m(ord)f(reading)g(routines)f(will)227
-4395 y(not)f(preserv)m(e)f(the)h(full)d(precision)h(of)h(the)h(v)-5
-b(alue.)95 4677 y Ff(int)47 b(fits_write_key_triple)42
-b(/)48 b(ffpkyt)286 4790 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g
-(long)g(intval,)g(double)g(frac,)334 4903 y(char)h(*comment,)e(>)i(int)
-g(*status\))0 5185 y Fi(7)81 b Fj(W)-8 b(rite)36 b(k)m(eyw)m(ords)g(to)
+1007 y(not)f(preserv)m(e)f(the)h(full)d(precision)h(of)h(the)h(v)-5
+b(alue.)95 1268 y Fe(int)47 b(fits_write_key_triple)42
+b(/)48 b(ffpkyt)286 1380 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g
+(long)g(intval,)g(double)g(frac,)334 1493 y(char)h(*comment,)e(>)i(int)
+g(*status\))0 1754 y Fi(6)81 b Fj(W)-8 b(rite)36 b(k)m(eyw)m(ords)g(to)
 h(the)f(CHDU)g(that)h(are)f(de\014ned)f(in)g(an)h(ASCI)s(I)e(template)i
-(\014le.)57 b(The)35 b(format)i(of)f(the)227 5298 y(template)31
+(\014le.)57 b(The)35 b(format)i(of)f(the)227 1867 y(template)31
 b(\014le)f(is)f(describ)s(ed)f(under)h(the)i(\014ts)p
-1788 5298 28 4 v 32 w(parse)p 2028 5298 V 33 w(template)f(routine)g(b)s
-(elo)m(w.)95 5581 y Ff(int)47 b(fits_write_key_template)42
-b(/)47 b(ffpktp)286 5694 y(\(fitsfile)f(*fptr,)g(const)g(char)h
-(*filename,)e(>)i(int)g(*status\))p eop
-%%Page: 113 119
-113 118 bop 0 299 a Fh(8.3.)72 b(SPECIALIZED)29 b(HEADER)i(KEYW)m(ORD)g
-(R)m(OUTINES)1465 b Fj(113)0 555 y Fd(8.3.4)150 b(Insert)37
-b(Keyw)m(ord)g(Routines)0 777 y Fj(These)42 b(insert)g(routines)f(are)i
-(somewhat)g(less)e(e\016cien)m(t)i(than)g(the)f(`up)s(date')g(or)h
-(`write')f(k)m(eyw)m(ord)h(routines)0 890 y(b)s(ecause)30
+1788 1867 28 4 v 32 w(parse)p 2028 1867 V 33 w(template)f(routine.)95
+2128 y Fe(int)47 b(fits_write_key_template)42 b(/)47
+b(ffpktp)286 2241 y(\(fitsfile)f(*fptr,)g(const)g(char)h(*filename,)e
+(>)i(int)g(*status\))0 2532 y Fd(9.3.4)112 b(Insert)38
+b(Keyw)m(ord)f(Routines)0 2752 y Fj(These)42 b(insert)g(routines)f(are)
+i(somewhat)g(less)e(e\016cien)m(t)i(than)g(the)f(`up)s(date')g(or)h
+(`write')f(k)m(eyw)m(ord)h(routines)0 2864 y(b)s(ecause)30
 b(the)g(follo)m(wing)f(k)m(eyw)m(ords)h(in)f(the)h(header)g(m)m(ust)g
 (b)s(e)f(shifted)g(do)m(wn)g(to)i(mak)m(e)g(ro)s(om)f(for)g(the)g
-(inserted)0 1003 y(k)m(eyw)m(ord.)41 b(See)31 b(App)s(endix)c(B)k(for)f
+(inserted)0 2977 y(k)m(eyw)m(ord.)41 b(See)31 b(App)s(endix)c(B)k(for)f
 (the)h(de\014nition)d(of)i(the)h(parameters)g(used)e(in)g(these)i
-(routines.)0 1277 y Fi(1)81 b Fj(Insert)26 b(a)h(new)f(k)m(eyw)m(ord)h
+(routines.)0 3238 y Fi(1)81 b Fj(Insert)26 b(a)h(new)f(k)m(eyw)m(ord)h
 (record)g(in)m(to)f(the)h(CHU)g(at)g(the)g(sp)s(eci\014ed)e(p)s
-(osition)g(\(i.e.,)j(immediately)d(preceding)227 1390
+(osition)g(\(i.e.,)j(immediately)d(preceding)227 3351
 y(the)31 b(\(k)m(eyn)m(um\)th)g(k)m(eyw)m(ord)g(in)e(the)h(header.\))95
-1663 y Ff(int)47 b(fits_insert_record)c(/)48 b(ffirec)286
-1776 y(\(fitsfile)e(*fptr,)g(int)h(keynum,)e(char)i(*card,)f(>)i(int)f
-(*status\))0 2050 y Fi(2)81 b Fj(Insert)24 b(a)h(new)g(k)m(eyw)m(ord)g
+3612 y Fe(int)47 b(fits_insert_record)c(/)48 b(ffirec)286
+3725 y(\(fitsfile)e(*fptr,)g(int)h(keynum,)e(char)i(*card,)f(>)i(int)f
+(*status\))0 3985 y Fi(2)81 b Fj(Insert)24 b(a)h(new)g(k)m(eyw)m(ord)g
 (in)m(to)g(the)g(CHU.)g(The)g(new)f(k)m(eyw)m(ord)i(is)e(inserted)f
-(immediately)h(follo)m(wing)f(the)i(last)227 2163 y(k)m(eyw)m(ord)i
+(immediately)h(follo)m(wing)f(the)i(last)227 4098 y(k)m(eyw)m(ord)i
 (that)f(has)f(b)s(een)h(read)f(from)h(the)g(header.)39
 b(The)25 b(`longstr')h(v)m(ersion)f(has)g(the)h(same)g(functionalit)m
-(y)227 2276 y(as)33 b(the)g(`str')f(v)m(ersion)g(except)i(that)f(it)f
+(y)227 4211 y(as)33 b(the)g(`str')f(v)m(ersion)g(except)i(that)f(it)f
 (also)g(supp)s(orts)f(the)h(lo)s(cal)g(long)g(string)g(k)m(eyw)m(ord)h
-(con)m(v)m(en)m(tion)g(for)227 2389 y(strings)28 b(longer)g(than)h(68)h
+(con)m(v)m(en)m(tion)g(for)227 4324 y(strings)28 b(longer)g(than)h(68)h
 (c)m(haracters.)41 b(A)29 b(n)m(ull)e(p)s(oin)m(ter)h(ma)m(y)h(b)s(e)g
 (en)m(tered)g(for)g(the)g(commen)m(t)g(parameter)227
-2502 y(whic)m(h)c(will)d(cause)k(the)g(commen)m(t)h(\014eld)d(to)i(b)s
+4437 y(whic)m(h)c(will)d(cause)k(the)g(commen)m(t)h(\014eld)d(to)i(b)s
 (e)f(left)g(blank.)38 b(The)25 b(\015t,)h(dbl,)f(cmp,)i(and)e(dblcmp)e
-(v)m(ersions)i(of)227 2614 y(this)k(routine)g(ha)m(v)m(e)i(the)e(added)
+(v)m(ersions)i(of)227 4550 y(this)k(routine)g(ha)m(v)m(e)i(the)e(added)
 g(feature)i(that)f(if)f(the)h('decimals')f(parameter)h(is)f(negativ)m
-(e,)i(then)e(the)h('G')227 2727 y(displa)m(y)e(format)i(rather)f(then)g
+(e,)i(then)e(the)h('G')227 4663 y(displa)m(y)e(format)i(rather)f(then)g
 (the)h('E')f(format)h(will)d(b)s(e)i(used)f(when)h(constructing)g(the)g
-(k)m(eyw)m(ord)h(v)-5 b(alue,)227 2840 y(taking)26 b(the)h(absolute)f
+(k)m(eyw)m(ord)h(v)-5 b(alue,)227 4776 y(taking)26 b(the)h(absolute)f
 (v)-5 b(alue)25 b(of)i('decimals')e(for)h(the)h(precision.)37
 b(This)25 b(will)e(suppress)h(trailing)h(zeros,)j(and)227
-2953 y(will)34 b(use)j(a)g(\014xed)f(format)h(rather)g(than)f(an)h(exp)
+4889 y(will)34 b(use)j(a)g(\014xed)f(format)h(rather)g(than)f(an)h(exp)
 s(onen)m(tial)e(format,)k(dep)s(ending)34 b(on)j(the)g(magnitude)f(of)
-227 3066 y(the)31 b(v)-5 b(alue.)95 3340 y Ff(int)47
-b(fits_insert_key_[str,)42 b(longstr])k(/)h(ffi[kys,)f(kls])286
-3453 y(\(fitsfile)g(*fptr,)g(char)g(*keyname,)g(char)g(*value,)g(char)h
-(*comment,)334 3566 y(>)h(int)e(*status\))95 3791 y(int)h
-(fits_insert_key_[log,)42 b(lng])47 b(/)g(ffiky[lj])286
-3904 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g(char)
-g(*comment,)334 4017 y(>)i(int)e(*status\))95 4243 y(int)h
+227 5002 y(the)31 b(v)-5 b(alue.)95 5262 y Fe(int)47
+b(fits_insert_card)d(/)j(ffikey)286 5375 y(\(fitsfile)f(*fptr,)g(char)g
+(*card,)g(>)i(&status\))95 5601 y(int)f(fits_insert_key_[str,)42
+b(longstr])k(/)h(ffi[kys,)f(kls])286 5714 y(\(fitsfile)g(*fptr,)g(char)
+g(*keyname,)g(char)g(*value,)g(char)h(*comment,)p eop
+%%Page: 91 99
+91 98 bop 0 299 a Fh(9.3.)72 b(SPECIALIZED)29 b(HEADER)i(KEYW)m(ORD)g
+(R)m(OUTINES)1510 b Fj(91)334 555 y Fe(>)48 b(int)e(*status\))95
+781 y(int)h(fits_insert_key_[log,)42 b(lng])47 b(/)g(ffiky[lj])286
+894 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g(char)g
+(*comment,)334 1007 y(>)i(int)e(*status\))95 1233 y(int)h
 (fits_insert_key_[flt,)42 b(fixflt,)k(dbl,)h(fixdbl])f(/)h(ffiky[edfg])
-286 4356 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g
-(int)h(decimals,)334 4469 y(char)g(*comment,)e(>)i(int)g(*status\))95
-4695 y(int)g(fits_insert_key_[cmp,)42 b(dblcmp,)k(fixcmp,)g(fixdblcmp])
-f(/)i(ffik[yc,ym,fc,fm])286 4808 y(\(fitsfile)f(*fptr,)g(char)g
-(*keyname,)g(DTYPE)g(*numval,)g(int)g(decimals,)334 4921
-y(char)h(*comment,)e(>)i(int)g(*status\))0 5194 y Fi(3)81
+286 1346 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g
+(int)h(decimals,)334 1458 y(char)g(*comment,)e(>)i(int)g(*status\))95
+1684 y(int)g(fits_insert_key_[cmp,)42 b(dblcmp,)k(fixcmp,)g(fixdblcmp])
+f(/)i(ffik[yc,ym,fc,fm])286 1797 y(\(fitsfile)f(*fptr,)g(char)g
+(*keyname,)g(DTYPE)g(*numval,)g(int)g(decimals,)334 1910
+y(char)h(*comment,)e(>)i(int)g(*status\))0 2169 y Fi(3)81
 b Fj(Insert)32 b(a)i(new)f(k)m(eyw)m(ord)h(with)e(an)h(unde\014ned,)g
 (or)g(n)m(ull,)f(v)-5 b(alue)33 b(in)m(to)h(the)f(CHU.)h(The)f(v)-5
-b(alue)33 b(string)f(of)i(the)227 5307 y(k)m(eyw)m(ord)d(is)f(left)g
-(blank)f(in)g(this)g(case.)95 5581 y Ff(int)47 b(fits_insert_key_null)c
-(/)k(ffikyu)286 5694 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g
-(*comment,)g(>)h(int)g(*status\))p eop
-%%Page: 114 120
-114 119 bop 0 299 a Fj(114)958 b Fh(CHAPTER)30 b(8.)112
+b(alue)33 b(string)f(of)i(the)227 2282 y(k)m(eyw)m(ord)d(is)f(left)g
+(blank)f(in)g(this)g(case.)95 2541 y Fe(int)47 b(fits_insert_key_null)c
+(/)k(ffikyu)286 2654 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g
+(*comment,)g(>)h(int)g(*status\))0 2945 y Fd(9.3.5)112
+b(Read)38 b(Keyw)m(ord)g(Routines)0 3163 y Fj(Wild)29
+b(card)h(c)m(haracters)i(ma)m(y)f(b)s(e)f(used)f(when)h(sp)s(ecifying)e
+(the)i(name)h(of)f(the)h(k)m(eyw)m(ord)g(to)g(b)s(e)f(read.)0
+3422 y Fi(1)81 b Fj(Read)43 b(a)h(k)m(eyw)m(ord)g(v)-5
+b(alue)42 b(\(with)h(the)g(appropriate)g(data)h(t)m(yp)s(e\))g(and)e
+(commen)m(t)j(from)e(the)g(CHU.)h(If)f(a)227 3535 y(NULL)32
+b(commen)m(t)h(p)s(oin)m(ter)e(is)h(giv)m(en)g(on)g(input,)e(then)i
+(the)g(commen)m(t)i(string)d(will)e(not)j(b)s(e)g(returned.)44
+b(If)227 3648 y(the)32 b(v)-5 b(alue)32 b(of)g(the)g(k)m(eyw)m(ord)g
+(is)f(not)i(de\014ned)d(\(i.e.,)j(the)f(v)-5 b(alue)32
+b(\014eld)e(is)h(blank\))g(then)h(an)g(error)f(status)h(=)227
+3761 y(V)-10 b(ALUE)p 545 3761 28 4 v 33 w(UNDEFINED)29
+b(will)c(b)s(e)j(returned)e(and)h(the)h(input)e(v)-5
+b(alue)27 b(will)f(not)i(b)s(e)f(c)m(hanged)h(\(except)h(that)227
+3874 y(\013gkys)i(will)d(reset)j(the)f(v)-5 b(alue)30
+b(to)h(a)g(n)m(ull)d(string\).)95 4133 y Fe(int)47 b(fits_read_key_str)
+c(/)48 b(ffgkys)286 4246 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h
+(char)g(*value,)f(char)g(*comment,)334 4359 y(int)h(*status\);)95
+4585 y(NOTE:)g(after)f(calling)g(the)h(following)e(routine,)h(programs)
+f(must)i(explicitly)e(free)382 4698 y(the)i(memory)f(allocated)f(for)i
+('longstr')e(after)i(it)g(is)g(no)g(longer)f(needed.)95
+4924 y(int)h(fits_read_key_longstr)42 b(/)48 b(ffgkls)286
+5036 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h(char)g(**longstr,)e
+(char)h(*comment,)620 5149 y(int)h(*status\))95 5375
+y(int)g(fits_read_key_[log,)c(lng,)k(flt,)f(dbl,)h(cmp,)f(dblcmp])g(/)i
+(ffgky[ljedcm])286 5488 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h
+(DTYPE)f(*numval,)g(char)h(*comment,)334 5601 y(int)g(*status\))p
+eop
+%%Page: 92 100
+92 99 bop 0 299 a Fj(92)1003 b Fh(CHAPTER)30 b(9.)112
 b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fd(8.3.5)150 b(Sp)s(ecialized)36 b(Read)i(Keyw)m(ord)f(Routines)0
-775 y Fj(Wild)42 b(card)h(c)m(haracters)h(ma)m(y)g(b)s(e)f(used)f(when)
-g(sp)s(ecifying)f(the)j(name)f(of)g(the)h(k)m(eyw)m(ord)f(to)h(b)s(e)f
-(read.)79 b(See)0 888 y(App)s(endix)28 b(B)i(for)h(the)f(de\014nition)e
-(of)j(the)f(parameters)h(used)e(in)h(these)g(routines.)0
-1153 y Fi(1)81 b Fj(Read)42 b(the)g(name,)j(v)-5 b(alue)41
-b(\(as)i(a)f(string\),)i(and)e(commen)m(t)g(of)h(the)f(n)m(th)f(k)m
-(eyw)m(ord)i(in)d(CHU.)i(If)g(a)g(NULL)227 1265 y(commen)m(t)d(p)s(oin)
-m(ter)d(is)h(giv)m(en)g(on)h(input,)f(then)g(the)h(commen)m(t)h(string)
-d(will)f(not)j(b)s(e)f(returned.)60 b(A)38 b(n)m(ull)227
-1378 y(v)-5 b(alue)28 b(string)g(will)e(b)s(e)i(returned)f(if)h(the)h
-(k)m(eyw)m(ord)g(has)f(no)h(de\014ned)e(v)-5 b(alue)28
-b(\(i.e.,)i(if)d(the)i(v)-5 b(alue)28 b(\014eld)f(in)h(the)227
-1491 y(k)m(eyw)m(ord)j(is)f(blank\).)95 1756 y Ff(int)47
-b(fits_read_keyn)d(/)k(ffgkyn)286 1869 y(\(fitsfile)e(*fptr,)g(int)h
-(keynum,)e(>)j(char)f(*keyname,)e(char)h(*value,)334
-1982 y(char)h(*comment,)e(int)i(*status\))0 2246 y Fi(2)81
-b Fj(Read)22 b(the)g(next)g(k)m(eyw)m(ord)g(whose)g(name)g(matc)m(hes)h
-(one)f(of)g(the)g(strings)f(in)g('inclist')f(but)h(do)s(es)h(not)g
-(matc)m(h)h(an)m(y)227 2359 y(of)32 b(the)f(strings)f(in)g('exclist'.)
-43 b(The)30 b(strings)g(in)g(inclist)f(and)i(exclist)f(ma)m(y)i(con)m
-(tain)g(wild)c(card)j(c)m(haracters)227 2472 y(\(*,)38
-b(?,)e(and)e(#\))i(as)f(describ)s(ed)e(at)j(the)f(b)s(eginning)d(of)k
-(this)e(section.)55 b(This)33 b(routine)h(searc)m(hes)i(from)f(the)227
-2585 y(curren)m(t)28 b(header)f(p)s(osition)f(to)i(the)g(end)f(of)h
-(the)g(header,)g(only)-8 b(,)28 b(and)f(do)s(es)g(not)h(con)m(tin)m(ue)
-g(the)g(searc)m(h)g(from)227 2698 y(the)41 b(top)g(of)g(the)g(header)g
-(bac)m(k)h(to)f(the)g(original)e(p)s(osition.)71 b(The)40
-b(curren)m(t)h(header)f(p)s(osition)f(ma)m(y)j(b)s(e)227
-2811 y(reset)d(with)e(the)i(\013grec)g(routine.)65 b(Note)39
-b(that)g(nexc)g(ma)m(y)g(b)s(e)f(set)h(=)f(0)h(if)e(there)i(are)g(no)f
-(k)m(eyw)m(ords)h(to)227 2924 y(b)s(e)c(excluded.)56
-b(This)34 b(routine)h(returns)g(status)h(=)f(KEY)p 2222
-2924 28 4 v 33 w(NO)p 2394 2924 V 32 w(EXIST)g(if)g(a)h(matc)m(hing)g
-(k)m(eyw)m(ord)g(is)f(not)227 3036 y(found.)95 3301 y
-Ff(int)47 b(fits_find_nextkey)c(/)48 b(ffgnxk)286 3414
-y(\(fitsfile)e(*fptr,)g(char)g(**inclist,)f(int)i(ninc,)g(char)f
-(**exclist,)334 3527 y(int)h(nexc,)f(>)i(char)e(*card,)h(int)94
-b(*status\))0 3791 y Fi(3)81 b Fj(Read)26 b(the)g(literal)e(k)m(eyw)m
-(ord)i(v)-5 b(alue)26 b(as)g(a)g(c)m(haracter)i(string.)38
-b(Regardless)25 b(of)h(the)g(datat)m(yp)s(e)h(of)f(the)g(k)m(eyw)m
-(ord,)227 3904 y(this)36 b(routine)g(simply)f(returns)h(the)h(string)f
-(of)h(c)m(haracters)i(in)c(the)j(v)-5 b(alue)36 b(\014eld)g(of)h(the)g
-(k)m(eyw)m(ord)h(along)227 4017 y(with)c(the)i(commen)m(t)g(\014eld.)55
-b(If)35 b(a)g(NULL)h(commen)m(t)g(p)s(oin)m(ter)e(is)h(giv)m(en)g(on)g
-(input,)g(then)g(the)h(commen)m(t)227 4130 y(string)30
-b(will)d(not)k(b)s(e)f(returned.)95 4395 y Ff(int)47
-b(fits_read_keyword)c(/)48 b(ffgkey)286 4507 y(\(fitsfile)e(*fptr,)g
-(char)g(*keyname,)g(>)h(char)g(*value,)f(char)g(*comment,)334
-4620 y(int)h(*status\))0 4885 y Fi(4)81 b Fj(Read)26
-b(a)i(k)m(eyw)m(ord)f(v)-5 b(alue)26 b(\(with)g(the)g(appropriate)g
-(datat)m(yp)s(e\))i(and)e(commen)m(t)i(from)e(the)h(CHU.)g(If)f(a)h
-(NULL)227 4998 y(commen)m(t)41 b(p)s(oin)m(ter)d(is)g(giv)m(en)h(on)g
-(input,)h(then)f(the)h(commen)m(t)g(string)e(will)f(not)i(b)s(e)g
-(returned.)66 b(If)39 b(the)227 5111 y(v)-5 b(alue)41
-b(of)g(the)g(k)m(eyw)m(ord)h(is)e(not)h(de\014ned)f(\(i.e.,)45
-b(the)c(v)-5 b(alue)41 b(\014eld)e(is)h(blank\))g(then)h(an)g(error)g
-(status)g(=)227 5224 y(V)-10 b(ALUE)p 545 5224 V 33 w(UNDEFINED)32
-b(will)27 b(b)s(e)j(returned)f(and)h(the)h(input)d(v)-5
-b(alue)30 b(will)e(not)i(b)s(e)g(c)m(hanged.)95 5488
-y Ff(int)47 b(fits_read_key_str)c(/)48 b(ffgkys)286 5601
-y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h(char)g(*value,)f(char)g
-(*comment,)334 5714 y(int)h(*status\);)p eop
-%%Page: 115 121
-115 120 bop 0 299 a Fh(8.3.)72 b(SPECIALIZED)29 b(HEADER)i(KEYW)m(ORD)g
-(R)m(OUTINES)1465 b Fj(115)95 668 y Ff(NOTE:)47 b(after)f(calling)g
-(the)h(following)e(routine,)h(programs)f(must)i(explicitly)e(free)382
-781 y(the)i(memory)f(allocated)f(for)i('longstr')e(after)i(it)g(is)g
-(no)g(longer)f(needed.)95 1007 y(int)h(fits_read_key_longstr)42
-b(/)48 b(ffgkls)286 1120 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(>)h
-(char)g(**longstr,)e(char)h(*comment,)620 1233 y(int)h(*status\))95
-1458 y(int)g(fits_read_key_[log,)c(lng,)k(flt,)f(dbl,)h(cmp,)f(dblcmp])
-g(/)i(ffgky[ljedcm])286 1571 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g
-(>)h(DTYPE)f(*numval,)g(char)h(*comment,)334 1684 y(int)g(*status\))0
-2045 y Fi(5)81 b Fj(Read)23 b(a)h(sequence)g(of)g(indexed)e(k)m(eyw)m
-(ord)i(v)-5 b(alues.)38 b(The)23 b(starting)g(index)f(n)m(um)m(b)s(er)g
-(\(nstart\))i(m)m(ust)g(b)s(e)f(greater)227 2158 y(than)i(0.)39
-b(If)25 b(the)g(v)-5 b(alue)24 b(of)h(an)m(y)h(of)f(the)g(k)m(eyw)m
-(ords)g(is)f(not)h(de\014ned)f(\(i.e.,)j(the)e(v)-5 b(alue)24
-b(\014eld)g(is)g(blank\))f(then)i(an)227 2271 y(error)k(status)h(=)g(V)
--10 b(ALUE)p 1136 2271 28 4 v 32 w(UNDEFINED)31 b(will)c(b)s(e)i
-(returned)g(and)g(the)g(input)f(v)-5 b(alue)29 b(for)g(the)h
-(unde\014ned)227 2384 y(k)m(eyw)m(ord\(s\))36 b(will)31
-b(not)k(b)s(e)e(c)m(hanged.)54 b(These)34 b(routines)f(do)h(not)g(supp)
-s(ort)f(wild)f(card)i(c)m(haracters)i(in)d(the)227 2497
-y(ro)s(ot)e(name.)95 2745 y Ff(int)47 b(fits_read_keys_str)c(/)48
-b(ffgkns)286 2858 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(int)h
-(nstart,)e(int)i(nkeys,)334 2971 y(>)h(char)e(**value,)g(int)h
-(*nfound,)93 b(int)47 b(*status\))95 3197 y(int)g(fits_read_keys_[log,)
-c(lng,)j(flt,)h(dbl])g(/)g(ffgkn[ljed])286 3310 y(\(fitsfile)f(*fptr,)g
+555 y Fi(2)81 b Fj(Read)36 b(a)h(sequence)f(of)h(indexed)d(k)m(eyw)m
+(ord)j(v)-5 b(alues)36 b(\(e.g.,)j(NAXIS1,)g(NAXIS2,)f(...\).)59
+b(The)36 b(input)e(starting)227 668 y(index)j(n)m(um)m(b)s(er)f
+(\(nstart\))j(m)m(ust)f(b)s(e)f(greater)i(than)e(0.)64
+b(If)37 b(the)h(v)-5 b(alue)37 b(of)h(an)m(y)h(of)f(the)g(k)m(eyw)m
+(ords)g(is)f(not)227 781 y(de\014ned)d(\(i.e.,)i(the)f(v)-5
+b(alue)34 b(\014eld)f(is)h(blank\))g(then)g(an)g(error)h(status)g(=)f
+(V)-10 b(ALUE)p 3009 781 28 4 v 33 w(UNDEFINED)36 b(will)c(b)s(e)227
+894 y(returned)21 b(and)h(the)h(input)d(v)-5 b(alue)22
+b(for)g(the)g(unde\014ned)e(k)m(eyw)m(ord\(s\))k(will)19
+b(not)k(b)s(e)e(c)m(hanged.)39 b(These)22 b(routines)227
+1007 y(do)j(not)h(supp)s(ort)d(wild)g(card)i(c)m(haracters)i(in)d(the)i
+(ro)s(ot)f(name.)39 b(If)25 b(there)h(are)f(no)g(indexed)f(k)m(eyw)m
+(ords)i(in)e(the)227 1120 y(header)35 b(with)e(the)i(input)d(ro)s(ot)j
+(name)g(then)f(these)h(routines)f(do)g(not)h(return)e(a)i(non-zero)h
+(status)e(v)-5 b(alue)227 1233 y(and)30 b(instead)g(simply)e(return)h
+(nfound)f(=)i(0.)95 1489 y Fe(int)47 b(fits_read_keys_str)c(/)48
+b(ffgkns)286 1602 y(\(fitsfile)e(*fptr,)g(char)g(*keyname,)g(int)h
+(nstart,)e(int)i(nkeys,)334 1715 y(>)h(char)e(**value,)g(int)h
+(*nfound,)93 b(int)47 b(*status\))95 1941 y(int)g(fits_read_keys_[log,)
+c(lng,)j(flt,)h(dbl])g(/)g(ffgkn[ljed])286 2054 y(\(fitsfile)f(*fptr,)g
 (char)g(*keyname,)g(int)h(nstart,)e(int)i(nkeys,)334
-3423 y(>)h(DTYPE)e(*numval,)f(int)i(*nfound,)f(int)h(*status\))0
-3671 y Fi(6)81 b Fj(Read)37 b(the)h(v)-5 b(alue)37 b(of)h(a)g
+2167 y(>)h(DTYPE)e(*numval,)f(int)i(*nfound,)f(int)h(*status\))0
+2423 y Fi(3)81 b Fj(Read)37 b(the)h(v)-5 b(alue)37 b(of)h(a)g
 (\015oating)f(p)s(oin)m(t)g(k)m(eyw)m(ord,)j(returning)c(the)i(in)m
-(teger)g(and)f(fractional)g(parts)g(of)h(the)227 3784
+(teger)g(and)f(fractional)g(parts)g(of)h(the)227 2536
 y(v)-5 b(alue)34 b(in)e(separate)j(routine)e(argumen)m(ts.)52
 b(This)32 b(routine)h(ma)m(y)h(b)s(e)f(used)h(to)g(read)g(an)m(y)g(k)m
-(eyw)m(ord)h(but)e(is)227 3897 y(esp)s(ecially)c(useful)f(for)j
+(eyw)m(ord)h(but)e(is)227 2649 y(esp)s(ecially)c(useful)f(for)j
 (reading)e(the)i('triple)e(precision')f(k)m(eyw)m(ords)j(written)f(b)m
-(y)g(\013pkyt.)95 4145 y Ff(int)47 b(fits_read_key_triple)c(/)k(ffgkyt)
-286 4258 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(>)h(long)g
-(*intval,)e(double)h(*frac,)334 4371 y(char)h(*comment,)e(int)i
-(*status\))0 4660 y Fd(8.3.6)150 b(Mo)s(dify)37 b(Keyw)m(ord)h
-(Routines)0 4879 y Fj(These)31 b(routines)g(mo)s(dify)f(the)i(v)-5
+(y)g(\013pkyt.)95 2906 y Fe(int)47 b(fits_read_key_triple)c(/)k(ffgkyt)
+286 3019 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(>)h(long)g
+(*intval,)e(double)h(*frac,)334 3132 y(char)h(*comment,)e(int)i
+(*status\))0 3422 y Fd(9.3.6)112 b(Mo)s(dify)38 b(Keyw)m(ord)f
+(Routines)0 3641 y Fj(These)31 b(routines)g(mo)s(dify)f(the)i(v)-5
 b(alue)31 b(of)h(an)g(existing)e(k)m(eyw)m(ord.)46 b(An)31
 b(error)g(is)g(returned)f(if)h(the)h(k)m(eyw)m(ord)g(do)s(es)0
-4992 y(not)43 b(exist.)76 b(Wild)41 b(card)i(c)m(haracters)h(ma)m(y)f
+3753 y(not)43 b(exist.)76 b(Wild)41 b(card)i(c)m(haracters)h(ma)m(y)f
 (b)s(e)f(used)f(when)h(sp)s(ecifying)e(the)j(name)f(of)h(the)f(k)m(eyw)
-m(ord)h(to)h(b)s(e)0 5104 y(mo)s(di\014ed.)39 b(See)30
+m(ord)h(to)h(b)s(e)0 3866 y(mo)s(di\014ed.)39 b(See)30
 b(App)s(endix)e(B)j(for)f(the)g(de\014nition)e(of)j(the)f(parameters)h
-(used)f(in)f(these)i(routines.)0 5353 y Fi(1)81 b Fj(Mo)s(dify)29
+(used)f(in)f(these)i(routines.)0 4123 y Fi(1)81 b Fj(Mo)s(dify)29
 b(\(o)m(v)m(erwrite\))i(the)g(n)m(th)f(80-c)m(haracter)j(header)d
-(record)h(in)e(the)h(CHU.)95 5601 y Ff(int)47 b(fits_modify_record)c(/)
-48 b(ffmrec)286 5714 y(\(fitsfile)e(*fptr,)g(int)h(keynum,)e(char)i
-(*card,)f(>)i(int)f(*status\))p eop
-%%Page: 116 122
-116 121 bop 0 299 a Fj(116)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(2)81 b Fj(Mo)s(dify)36 b(\(o)m(v)m(erwrite\))j(the)f(80-c)m
-(haracter)j(header)c(record)h(for)f(the)h(named)f(k)m(eyw)m(ord)h(in)f
-(the)h(CHU.)g(This)227 668 y(can)31 b(b)s(e)f(used)f(to)i(o)m(v)m
-(erwrite)g(the)g(name)f(of)h(the)f(k)m(eyw)m(ord)h(as)g(w)m(ell)e(as)i
-(its)f(v)-5 b(alue)29 b(and)h(commen)m(t)i(\014elds.)95
-923 y Ff(int)47 b(fits_modify_card)d(/)j(ffmcrd)286 1036
-y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g(*card,)g(>)i(int)f
-(*status\))0 1290 y Fi(5)81 b Fj(Mo)s(dify)29 b(the)h(v)-5
-b(alue)30 b(and)f(commen)m(t)i(\014elds)e(of)h(an)g(existing)f(k)m(eyw)
-m(ord)i(in)e(the)h(CHU.)h(The)e(`longstr')h(v)m(ersion)227
-1403 y(has)41 b(the)h(same)f(functionalit)m(y)f(as)h(the)h(`str')f(v)m
-(ersion)g(except)h(that)g(it)f(also)g(supp)s(orts)e(the)j(lo)s(cal)e
-(long)227 1516 y(string)28 b(k)m(eyw)m(ord)i(con)m(v)m(en)m(tion)g(for)
-f(strings)e(longer)i(than)g(68)h(c)m(haracters.)41 b(Optionally)-8
-b(,)28 b(one)h(ma)m(y)h(mo)s(dify)227 1629 y(only)d(the)h(v)-5
+(record)h(in)e(the)h(CHU.)95 4380 y Fe(int)47 b(fits_modify_record)c(/)
+48 b(ffmrec)286 4492 y(\(fitsfile)e(*fptr,)g(int)h(keynum,)e(char)i
+(*card,)f(>)i(int)f(*status\))0 4749 y Fi(2)81 b Fj(Mo)s(dify)36
+b(\(o)m(v)m(erwrite\))j(the)f(80-c)m(haracter)j(header)c(record)h(for)f
+(the)h(named)f(k)m(eyw)m(ord)h(in)f(the)h(CHU.)g(This)227
+4862 y(can)31 b(b)s(e)f(used)f(to)i(o)m(v)m(erwrite)g(the)g(name)f(of)h
+(the)f(k)m(eyw)m(ord)h(as)g(w)m(ell)e(as)i(its)f(v)-5
+b(alue)29 b(and)h(commen)m(t)i(\014elds.)95 5119 y Fe(int)47
+b(fits_modify_card)d(/)j(ffmcrd)286 5231 y(\(fitsfile)f(*fptr,)g(char)g
+(*keyname,)g(char)g(*card,)g(>)i(int)f(*status\))0 5488
+y Fi(5)81 b Fj(Mo)s(dify)29 b(the)h(v)-5 b(alue)30 b(and)f(commen)m(t)i
+(\014elds)e(of)h(an)g(existing)f(k)m(eyw)m(ord)i(in)e(the)h(CHU.)h(The)
+e(`longstr')h(v)m(ersion)227 5601 y(has)41 b(the)h(same)f(functionalit)
+m(y)f(as)h(the)h(`str')f(v)m(ersion)g(except)h(that)g(it)f(also)g(supp)
+s(orts)e(the)j(lo)s(cal)e(long)227 5714 y(string)28 b(k)m(eyw)m(ord)i
+(con)m(v)m(en)m(tion)g(for)f(strings)e(longer)i(than)g(68)h(c)m
+(haracters.)41 b(Optionally)-8 b(,)28 b(one)h(ma)m(y)h(mo)s(dify)p
+eop
+%%Page: 93 101
+93 100 bop 0 299 a Fh(9.3.)72 b(SPECIALIZED)29 b(HEADER)i(KEYW)m(ORD)g
+(R)m(OUTINES)1510 b Fj(93)227 555 y(only)27 b(the)h(v)-5
 b(alue)27 b(\014eld)g(and)g(lea)m(v)m(e)i(the)f(commen)m(t)h(\014eld)d
 (unc)m(hanged)i(b)m(y)g(setting)f(the)h(input)e(COMMENT)227
-1742 y(parameter)d(equal)g(to)g(the)g(amp)s(ersand)e(c)m(haracter)j
+668 y(parameter)d(equal)g(to)g(the)g(amp)s(ersand)e(c)m(haracter)j
 (\(&\))f(or)g(b)m(y)g(en)m(tering)f(a)h(n)m(ull)e(p)s(oin)m(ter)h(for)g
-(the)h(commen)m(t)227 1855 y(parameter.)40 b(The)24 b(\015t,)i(dbl,)f
+(the)h(commen)m(t)227 781 y(parameter.)40 b(The)24 b(\015t,)i(dbl,)f
 (cmp,)g(and)g(dblcmp)d(v)m(ersions)j(of)g(this)f(routine)g(ha)m(v)m(e)i
-(the)f(added)f(feature)h(that)227 1968 y(if)g(the)i('decimals')e
+(the)f(added)f(feature)h(that)227 894 y(if)g(the)i('decimals')e
 (parameter)i(is)e(negativ)m(e,)k(then)d(the)g('G')h(displa)m(y)d
-(format)j(rather)f(then)g(the)g('E')h(format)227 2081
+(format)j(rather)f(then)g(the)g('E')h(format)227 1007
 y(will)f(b)s(e)i(used)f(when)h(constructing)g(the)g(k)m(eyw)m(ord)h(v)
 -5 b(alue,)29 b(taking)f(the)h(absolute)f(v)-5 b(alue)28
-b(of)g('decimals')g(for)227 2194 y(the)37 b(precision.)58
+b(of)g('decimals')g(for)227 1120 y(the)37 b(precision.)58
 b(This)34 b(will)g(suppress)h(trailing)f(zeros,)39 b(and)d(will)e(use)j
-(a)g(\014xed)e(format)i(rather)g(than)f(an)227 2307 y(exp)s(onen)m
+(a)g(\014xed)e(format)i(rather)g(than)f(an)227 1233 y(exp)s(onen)m
 (tial)30 b(format,)h(dep)s(ending)c(on)k(the)f(magnitude)g(of)g(the)h
-(v)-5 b(alue.)95 2561 y Ff(int)47 b(fits_modify_key_[str,)42
-b(longstr])k(/)h(ffm[kys,)f(kls])286 2674 y(\(fitsfile)g(*fptr,)g(char)
-g(*keyname,)g(char)g(*value,)g(char)h(*comment,)334 2787
-y(>)h(int)e(*status\);)95 3013 y(int)h(fits_modify_key_[log,)42
-b(lng])47 b(/)g(ffmky[lj])286 3126 y(\(fitsfile)f(*fptr,)g(char)g
-(*keyname,)g(DTYPE)g(numval,)g(char)g(*comment,)334 3239
-y(>)i(int)e(*status\))95 3465 y(int)h(fits_modify_key_[flt,)42
-b(dbl,)47 b(fixflt,)f(fixdbl])g(/)h(ffmky[edfg])286 3577
+(v)-5 b(alue.)95 1468 y Fe(int)47 b(fits_modify_key_[str,)42
+b(longstr])k(/)h(ffm[kys,)f(kls])286 1581 y(\(fitsfile)g(*fptr,)g(char)
+g(*keyname,)g(char)g(*value,)g(char)h(*comment,)334 1694
+y(>)h(int)e(*status\);)95 1920 y(int)h(fits_modify_key_[log,)42
+b(lng])47 b(/)g(ffmky[lj])286 2032 y(\(fitsfile)f(*fptr,)g(char)g
+(*keyname,)g(DTYPE)g(numval,)g(char)g(*comment,)334 2145
+y(>)i(int)e(*status\))95 2371 y(int)h(fits_modify_key_[flt,)42
+b(dbl,)47 b(fixflt,)f(fixdbl])g(/)h(ffmky[edfg])286 2484
 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g(int)h
-(decimals,)334 3690 y(char)g(*comment,)e(>)i(int)g(*status\))95
-3916 y(int)g(fits_modify_key_[cmp,)42 b(dblcmp,)k(fixcmp,)g(fixdblcmp])
-f(/)i(ffmk[yc,ym,fc,fm])286 4029 y(\(fitsfile)f(*fptr,)g(char)g
-(*keyname,)g(DTYPE)g(*numval,)g(int)g(decimals,)334 4142
-y(char)h(*comment,)e(>)i(int)g(*status\))0 4397 y Fi(6)81
+(decimals,)334 2597 y(char)g(*comment,)e(>)i(int)g(*status\))95
+2823 y(int)g(fits_modify_key_[cmp,)42 b(dblcmp,)k(fixcmp,)g(fixdblcmp])
+f(/)i(ffmk[yc,ym,fc,fm])286 2936 y(\(fitsfile)f(*fptr,)g(char)g
+(*keyname,)g(DTYPE)g(*numval,)g(int)g(decimals,)334 3049
+y(char)h(*comment,)e(>)i(int)g(*status\))0 3284 y Fi(6)81
 b Fj(Mo)s(dify)21 b(the)h(v)-5 b(alue)22 b(of)g(an)g(existing)g(k)m
 (eyw)m(ord)g(to)h(b)s(e)f(unde\014ned,)g(or)g(n)m(ull.)36
 b(The)22 b(v)-5 b(alue)21 b(string)h(of)g(the)g(k)m(eyw)m(ord)227
-4510 y(is)29 b(set)i(to)g(blank.)39 b(Optionally)-8 b(,)28
+3397 y(is)29 b(set)i(to)g(blank.)39 b(Optionally)-8 b(,)28
 b(one)i(ma)m(y)h(lea)m(v)m(e)g(the)g(commen)m(t)g(\014eld)d(unc)m
-(hanged)i(b)m(y)g(setting)g(the)g(input)227 4622 y(COMMENT)f(parameter)
+(hanged)i(b)m(y)g(setting)g(the)g(input)227 3510 y(COMMENT)f(parameter)
 g(equal)f(to)h(the)g(amp)s(ersand)e(c)m(haracter)k(\(&\))e(or)f(b)m(y)h
-(en)m(tering)f(a)h(n)m(ull)e(p)s(oin)m(ter.)95 4877 y
-Ff(int)47 b(fits_modify_key_null)c(/)k(ffmkyu)286 4990
+(en)m(tering)f(a)h(n)m(ull)e(p)s(oin)m(ter.)95 3745 y
+Fe(int)47 b(fits_modify_key_null)c(/)k(ffmkyu)286 3858
 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(char)g(*comment,)g(>)h(int)g
-(*status\))0 5280 y Fd(8.3.7)150 b(Sp)s(ecialized)36
-b(Up)s(date)i(Keyw)m(ord)g(Routines)0 5488 y Fi(1)81
-b Fj(These)29 b(up)s(date)g(routines)g(mo)s(dify)f(the)h(v)-5
-b(alue,)30 b(and)f(optionally)f(the)i(commen)m(t)h(\014eld,)e(of)h(the)
-g(k)m(eyw)m(ord)g(if)e(it)227 5601 y(already)33 b(exists,)g(otherwise)f
-(the)h(new)f(k)m(eyw)m(ord)h(is)e(app)s(ended)g(to)j(the)f(header.)47
-b(A)33 b(separate)g(routine)f(is)227 5714 y(pro)m(vided)e(for)h(eac)m
-(h)h(k)m(eyw)m(ord)g(datat)m(yp)s(e.)44 b(The)31 b(`longstr')g(v)m
-(ersion)g(has)g(the)g(same)h(functionalit)m(y)d(as)j(the)p
-eop
-%%Page: 117 123
-117 122 bop 0 299 a Fh(8.4.)72 b(DEFINE)31 b(D)m(A)-8
-b(T)g(A)32 b(SCALING)e(AND)h(UNDEFINED)h(PIXEL)d(P)-8
-b(ARAMETERS)655 b Fj(117)227 555 y(`str')31 b(v)m(ersion)f(except)i
+(*status\))0 4145 y Fd(9.3.7)112 b(Up)s(date)39 b(Keyw)m(ord)e
+(Routines)0 4350 y Fi(1)81 b Fj(These)29 b(up)s(date)g(routines)g(mo)s
+(dify)f(the)h(v)-5 b(alue,)30 b(and)f(optionally)f(the)i(commen)m(t)h
+(\014eld,)e(of)h(the)g(k)m(eyw)m(ord)g(if)e(it)227 4462
+y(already)33 b(exists,)g(otherwise)f(the)h(new)f(k)m(eyw)m(ord)h(is)e
+(app)s(ended)g(to)j(the)f(header.)47 b(A)33 b(separate)g(routine)f(is)
+227 4575 y(pro)m(vided)c(for)h(eac)m(h)h(k)m(eyw)m(ord)f(data)h(t)m(yp)
+s(e.)41 b(The)28 b(`longstr')h(v)m(ersion)g(has)f(the)i(same)f
+(functionalit)m(y)e(as)j(the)227 4688 y(`str')h(v)m(ersion)f(except)i
 (that)g(it)e(also)h(supp)s(orts)d(the)j(lo)s(cal)f(long)h(string)e(k)m
 (eyw)m(ord)j(con)m(v)m(en)m(tion)g(for)e(strings)227
-668 y(longer)h(than)g(68)h(c)m(haracters.)45 b(A)31 b(n)m(ull)e(p)s
-(oin)m(ter)i(ma)m(y)g(b)s(e)g(en)m(tered)h(for)f(the)g(commen)m(t)i
-(parameter)e(whic)m(h)227 781 y(will)f(lea)m(v)m(e)j(the)g(commen)m(t)g
-(\014eld)e(unc)m(hanged)h(or)g(blank.)45 b(The)31 b(\015t,)i(dbl,)e
-(cmp,)i(and)e(dblcmp)f(v)m(ersions)i(of)227 894 y(this)d(routine)g(ha)m
-(v)m(e)i(the)e(added)g(feature)i(that)f(if)f(the)h('decimals')f
-(parameter)h(is)f(negativ)m(e,)i(then)e(the)h('G')227
-1007 y(displa)m(y)e(format)i(rather)f(then)g(the)h('E')f(format)h(will)
-d(b)s(e)i(used)f(when)h(constructing)g(the)g(k)m(eyw)m(ord)h(v)-5
-b(alue,)227 1120 y(taking)26 b(the)h(absolute)f(v)-5
+4801 y(longer)h(than)g(68)h(c)m(haracters.)45 b(A)31
+b(n)m(ull)e(p)s(oin)m(ter)i(ma)m(y)g(b)s(e)g(en)m(tered)h(for)f(the)g
+(commen)m(t)i(parameter)e(whic)m(h)227 4914 y(will)f(lea)m(v)m(e)j(the)
+g(commen)m(t)g(\014eld)e(unc)m(hanged)h(or)g(blank.)45
+b(The)31 b(\015t,)i(dbl,)e(cmp,)i(and)e(dblcmp)f(v)m(ersions)i(of)227
+5027 y(this)d(routine)g(ha)m(v)m(e)i(the)e(added)g(feature)i(that)f(if)
+f(the)h('decimals')f(parameter)h(is)f(negativ)m(e,)i(then)e(the)h('G')
+227 5140 y(displa)m(y)e(format)i(rather)f(then)g(the)h('E')f(format)h
+(will)d(b)s(e)i(used)f(when)h(constructing)g(the)g(k)m(eyw)m(ord)h(v)-5
+b(alue,)227 5253 y(taking)26 b(the)h(absolute)f(v)-5
 b(alue)25 b(of)i('decimals')e(for)h(the)h(precision.)37
 b(This)25 b(will)e(suppress)h(trailing)h(zeros,)j(and)227
-1233 y(will)34 b(use)j(a)g(\014xed)f(format)h(rather)g(than)f(an)h(exp)
+5366 y(will)34 b(use)j(a)g(\014xed)f(format)h(rather)g(than)f(an)h(exp)
 s(onen)m(tial)e(format,)k(dep)s(ending)34 b(on)j(the)g(magnitude)f(of)
-227 1346 y(the)31 b(v)-5 b(alue.)95 1617 y Ff(int)47
-b(fits_update_key_[str,)42 b(longstr])k(/)h(ffu[kys,)f(kls])286
-1729 y(\(fitsfile)g(*fptr,)g(char)g(*keyname,)g(char)g(*value,)g(char)h
-(*comment,)334 1842 y(>)h(int)e(*status\))95 2068 y(int)h
-(fits_update_key_[log,)42 b(lng])47 b(/)g(ffuky[lj])286
-2181 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g(char)
-g(*comment,)334 2294 y(>)i(int)e(*status\))95 2520 y(int)h
+227 5479 y(the)31 b(v)-5 b(alue.)95 5714 y Fe(int)47
+b(fits_update_key_[str,)42 b(longstr])k(/)h(ffu[kys,)f(kls])p
+eop
+%%Page: 94 102
+94 101 bop 0 299 a Fj(94)1003 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)286
+555 y Fe(\(fitsfile)46 b(*fptr,)g(char)g(*keyname,)g(char)g(*value,)g
+(char)h(*comment,)334 668 y(>)h(int)e(*status\))95 894
+y(int)h(fits_update_key_[log,)42 b(lng])47 b(/)g(ffuky[lj])286
+1007 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(numval,)g(char)
+g(*comment,)334 1120 y(>)i(int)e(*status\))95 1346 y(int)h
 (fits_update_key_[flt,)42 b(dbl,)47 b(fixflt,)f(fixdbl])g(/)h
-(ffuky[edfg])286 2633 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)
-g(numval,)g(int)h(decimals,)334 2746 y(char)g(*comment,)e(>)i(int)g
-(*status\))95 2971 y(int)g(fits_update_key_[cmp,)42 b(dblcmp,)k
-(fixcmp,)g(fixdblcmp])f(/)i(ffuk[yc,ym,fc,fm])286 3084
+(ffuky[edfg])286 1458 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)
+g(numval,)g(int)h(decimals,)334 1571 y(char)g(*comment,)e(>)i(int)g
+(*status\))95 1797 y(int)g(fits_update_key_[cmp,)42 b(dblcmp,)k
+(fixcmp,)g(fixdblcmp])f(/)i(ffuk[yc,ym,fc,fm])286 1910
 y(\(fitsfile)f(*fptr,)g(char)g(*keyname,)g(DTYPE)g(*numval,)g(int)g
-(decimals,)334 3197 y(char)h(*comment,)e(>)i(int)g(*status\))0
-3544 y Fe(8.4)135 b(De\014ne)45 b(Data)h(Scaling)g(and)e(Unde\014ned)h
-(Pixel)h(P)l(arameters)0 3797 y Fj(These)29 b(routines)f(de\014ne)h(or)
-g(mo)s(dify)e(the)j(in)m(ternal)e(parameters)h(used)g(b)m(y)g(CFITSIO)f
-(to)i(either)e(scale)i(the)f(data)0 3910 y(or)36 b(to)h(represen)m(t)f
+(decimals,)334 2023 y(char)h(*comment,)e(>)i(int)g(*status\))0
+2363 y Ff(9.4)135 b(De\014ne)45 b(Data)h(Scaling)g(and)e(Unde\014ned)h
+(Pixel)h(P)l(arameters)0 2614 y Fj(These)37 b(routines)f(set)i(or)f(mo)
+s(dify)f(the)h(in)m(ternal)f(parameters)i(used)e(b)m(y)i(CFITSIO)d(to)j
+(either)f(scale)h(the)f(data)0 2727 y(or)f(to)h(represen)m(t)f
 (unde\014ned)d(pixels.)56 b(Generally)35 b(CFITSIO)f(will)g(scale)i
-(the)g(data)h(according)f(to)g(the)h(v)-5 b(alues)0 4023
+(the)g(data)h(according)f(to)g(the)h(v)-5 b(alues)0 2840
 y(of)35 b(the)f(BSCALE)g(and)g(BZER)m(O)h(\(or)g(TSCALn)d(and)i(TZER)m
 (On\))g(k)m(eyw)m(ords,)i(ho)m(w)m(ev)m(er)g(these)f(routines)e(ma)m(y)
-0 4136 y(b)s(e)f(used)h(to)h(o)m(v)m(erride)f(the)g(k)m(eyw)m(ord)h(v)
+0 2953 y(b)s(e)f(used)h(to)h(o)m(v)m(erride)f(the)g(k)m(eyw)m(ord)h(v)
 -5 b(alues.)48 b(This)31 b(ma)m(y)j(b)s(e)f(useful)e(when)h(one)i(w)m
-(an)m(ts)f(to)h(read)f(or)g(write)g(the)0 4249 y(ra)m(w)f(unscaled)f(v)
+(an)m(ts)f(to)h(read)f(or)g(write)g(the)0 3066 y(ra)m(w)f(unscaled)f(v)
 -5 b(alues)32 b(in)f(the)h(FITS)f(\014le.)46 b(Similarly)-8
 b(,)29 b(CFITSIO)i(generally)g(uses)h(the)g(v)-5 b(alue)32
-b(of)g(the)h(BLANK)0 4361 y(or)40 b(TNULLn)f(k)m(eyw)m(ord)h(to)h
+b(of)g(the)h(BLANK)0 3179 y(or)40 b(TNULLn)f(k)m(eyw)m(ord)h(to)h
 (signify)c(an)j(unde\014ned)e(pixel,)j(but)e(these)h(routines)f(ma)m(y)
-h(b)s(e)f(used)g(to)i(o)m(v)m(erride)0 4474 y(this)31
+h(b)s(e)f(used)g(to)i(o)m(v)m(erride)0 3292 y(this)31
 b(v)-5 b(alue.)47 b(These)32 b(routines)f(do)i(not)f(create)i(or)f(mo)s
 (dify)d(the)j(corresp)s(onding)d(header)j(k)m(eyw)m(ord)f(v)-5
-b(alues.)47 b(See)0 4587 y(App)s(endix)28 b(B)i(for)h(the)f
+b(alues.)47 b(See)0 3405 y(App)s(endix)28 b(B)i(for)h(the)f
 (de\014nition)e(of)j(the)f(parameters)h(used)e(in)h(these)g(routines.)0
-4858 y Fi(1)81 b Fj(Reset)26 b(the)g(scaling)e(factors)i(in)e(the)i
+3669 y Fi(1)81 b Fj(Reset)26 b(the)g(scaling)e(factors)i(in)e(the)i
 (primary)e(arra)m(y)i(or)f(image)h(extension;)h(do)s(es)e(not)g(c)m
-(hange)i(the)f(BSCALE)227 4971 y(and)i(BZER)m(O)g(k)m(eyw)m(ord)h(v)-5
+(hange)i(the)f(BSCALE)227 3782 y(and)i(BZER)m(O)g(k)m(eyw)m(ord)h(v)-5
 b(alues)27 b(and)h(only)f(a\013ects)j(the)e(automatic)i(scaling)d(p)s
-(erformed)g(when)g(the)h(data)227 5084 y(elemen)m(ts)e(are)g
+(erformed)g(when)g(the)h(data)227 3895 y(elemen)m(ts)e(are)g
 (written/read)f(to/from)h(the)g(FITS)f(\014le.)38 b(When)25
 b(reading)g(from)g(a)h(FITS)f(\014le)f(the)i(returned)227
-5197 y(data)i(v)-5 b(alue)27 b(=)g(\(the)h(v)-5 b(alue)27
+4008 y(data)i(v)-5 b(alue)27 b(=)g(\(the)h(v)-5 b(alue)27
 b(giv)m(en)h(in)e(the)h(FITS)g(arra)m(y\))h(*)g(BSCALE)f(+)g(BZER)m(O.)
-g(The)g(in)m(v)m(erse)h(form)m(ula)227 5310 y(is)i(used)f(when)h
+g(The)g(in)m(v)m(erse)h(form)m(ula)227 4121 y(is)i(used)f(when)h
 (writing)e(data)j(v)-5 b(alues)30 b(to)h(the)f(FITS)g(\014le.)95
-5581 y Ff(int)47 b(fits_set_bscale)d(/)j(ffpscl)286 5694
+4386 y Fe(int)47 b(fits_set_bscale)d(/)j(ffpscl)286 4499
 y(\(fitsfile)f(*fptr,)g(double)g(scale,)g(double)g(zero,)g(>)i(int)f
-(*status\))p eop
-%%Page: 118 124
-118 123 bop 0 299 a Fj(118)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(2)81 b Fj(Reset)39 b(the)f(scaling)g(parameters)g(for)h(a)f
-(table)g(column;)k(do)s(es)c(not)g(c)m(hange)i(the)e(TSCALn)f(or)h
-(TZER)m(On)227 668 y(k)m(eyw)m(ord)29 b(v)-5 b(alues)28
+(*status\))0 4764 y Fi(2)81 b Fj(Reset)39 b(the)f(scaling)g(parameters)
+g(for)h(a)f(table)g(column;)k(do)s(es)c(not)g(c)m(hange)i(the)e(TSCALn)
+f(or)h(TZER)m(On)227 4877 y(k)m(eyw)m(ord)29 b(v)-5 b(alues)28
 b(and)f(only)h(a\013ects)h(the)g(automatic)g(scaling)e(p)s(erformed)g
-(when)g(the)i(data)g(elemen)m(ts)g(are)227 781 y(written/read)i
+(when)g(the)i(data)g(elemen)m(ts)g(are)227 4990 y(written/read)i
 (to/from)h(the)g(FITS)f(\014le.)43 b(When)31 b(reading)f(from)h(a)h
 (FITS)f(\014le)f(the)i(returned)e(data)i(v)-5 b(alue)227
-894 y(=)25 b(\(the)i(v)-5 b(alue)25 b(giv)m(en)g(in)f(the)i(FITS)f
+5103 y(=)25 b(\(the)i(v)-5 b(alue)25 b(giv)m(en)g(in)f(the)i(FITS)f
 (arra)m(y\))h(*)g(TSCAL)e(+)i(TZER)m(O.)e(The)h(in)m(v)m(erse)h(form)m
-(ula)f(is)f(used)h(when)227 1007 y(writing)k(data)i(v)-5
-b(alues)29 b(to)j(the)e(FITS)g(\014le.)95 1261 y Ff(int)47
-b(fits_set_tscale)d(/)j(fftscl)286 1374 y(\(fitsfile)f(*fptr,)g(int)h
-(colnum,)e(double)i(scale,)f(double)g(zero,)334 1487
-y(>)i(int)e(*status\))0 1742 y Fi(3)81 b Fj(De\014ne)36
+(ula)f(is)f(used)h(when)227 5216 y(writing)k(data)i(v)-5
+b(alues)29 b(to)j(the)e(FITS)g(\014le.)95 5480 y Fe(int)47
+b(fits_set_tscale)d(/)j(fftscl)286 5593 y(\(fitsfile)f(*fptr,)g(int)h
+(colnum,)e(double)i(scale,)f(double)g(zero,)334 5706
+y(>)i(int)e(*status\))p eop
+%%Page: 95 103
+95 102 bop 0 299 a Fh(9.5.)72 b(SPECIALIZED)29 b(FITS)g(PRIMAR)-8
+b(Y)31 b(ARRA)-8 b(Y)32 b(OR)d(IMA)m(GE)j(EXTENSION)d(I/O)h(R)m
+(OUTINES)125 b Fj(95)0 555 y Fi(3)81 b Fj(De\014ne)36
 b(the)g(in)m(teger)h(v)-5 b(alue)35 b(to)i(b)s(e)e(used)h(to)h(signify)
 d(unde\014ned)g(pixels)g(in)h(the)h(primary)e(arra)m(y)j(or)f(image)227
-1855 y(extension.)53 b(This)33 b(is)g(only)h(used)g(if)f(BITPIX)h(=)h
+668 y(extension.)53 b(This)33 b(is)g(only)h(used)g(if)f(BITPIX)h(=)h
 (8,)h(16,)g(or)f(32.)54 b(This)33 b(do)s(es)h(not)h(create)h(or)e(c)m
-(hange)i(the)227 1968 y(v)-5 b(alue)30 b(of)h(the)f(BLANK)h(k)m(eyw)m
-(ord)g(in)e(the)h(header.)95 2222 y Ff(int)47 b(fits_set_imgnul)d(/)j
-(ffpnul)286 2335 y(\(fitsfile)f(*fptr,)g(long)g(nulval,)g(>)i(int)f
-(*status\))0 2590 y Fi(4)81 b Fj(De\014ne)36 b(the)g(string)f(to)h(b)s
+(hange)i(the)227 781 y(v)-5 b(alue)30 b(of)h(the)f(BLANK)h(k)m(eyw)m
+(ord)g(in)e(the)h(header.)95 1038 y Fe(int)47 b(fits_set_imgnul)d(/)j
+(ffpnul)286 1150 y(\(fitsfile)f(*fptr,)g(long)g(nulval,)g(>)i(int)f
+(*status\))0 1407 y Fi(4)81 b Fj(De\014ne)36 b(the)g(string)f(to)h(b)s
 (e)f(used)g(to)i(signify)d(unde\014ned)g(pixels)g(in)g(a)i(column)f(in)
-g(an)g(ASCI)s(I)g(table.)57 b(This)227 2703 y(do)s(es)30
+g(an)g(ASCI)s(I)g(table.)57 b(This)227 1520 y(do)s(es)30
 b(not)h(create)h(or)e(c)m(hange)i(the)e(v)-5 b(alue)30
-b(of)h(the)f(TNULLn)g(k)m(eyw)m(ord.)95 2957 y Ff(int)47
-b(fits_set_atblnull)c(/)48 b(ffsnul)286 3070 y(\(fitsfile)e(*fptr,)g
+b(of)h(the)f(TNULLn)g(k)m(eyw)m(ord.)95 1777 y Fe(int)47
+b(fits_set_atblnull)c(/)48 b(ffsnul)286 1889 y(\(fitsfile)e(*fptr,)g
 (int)h(colnum,)e(char)i(*nulstr,)f(>)h(int)g(*status\))0
-3325 y Fi(5)81 b Fj(De\014ne)34 b(the)h(v)-5 b(alue)33
+2146 y Fi(5)81 b Fj(De\014ne)34 b(the)h(v)-5 b(alue)33
 b(to)i(b)s(e)f(used)g(to)h(signify)d(unde\014ned)g(pixels)h(in)g(an)h
-(in)m(teger)h(column)e(in)g(a)h(binary)f(table)227 3438
+(in)m(teger)h(column)e(in)g(a)h(binary)f(table)227 2259
 y(\(where)c(TF)m(ORMn)f(=)g('B',)i('I',)f(or)f('J'\).)i(This)c(do)s(es)
 j(not)f(create)j(or)d(c)m(hange)i(the)e(v)-5 b(alue)28
-b(of)h(the)g(TNULLn)227 3550 y(k)m(eyw)m(ord.)95 3805
-y Ff(int)47 b(fits_set_btblnul)d(/)j(fftnul)286 3918
-y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(long)i(nulval,)f(>)h(int)g
-(*status\))0 4251 y Fe(8.5)135 b(Sp)t(ecialized)61 b(FITS)e(Primary)i
-(Arra)l(y)f(or)h(IMA)l(GE)e(Extension)j(I/O)306 4400
-y(Routines)0 4650 y Fj(These)27 b(routines)g(read)g(or)h(write)f(data)h
+b(of)h(the)g(TNULLn)227 2372 y(k)m(eyw)m(ord.)95 2628
+y Fe(int)47 b(fits_set_btblnull)c(/)48 b(fftnul)286 2741
+y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(nulval,)f(>)h(int)g
+(*status\))0 3074 y Ff(9.5)135 b(Sp)t(ecialized)61 b(FITS)e(Primary)i
+(Arra)l(y)f(or)h(IMA)l(GE)e(Extension)j(I/O)306 3224
+y(Routines)0 3474 y Fj(These)27 b(routines)g(read)g(or)h(write)f(data)h
 (v)-5 b(alues)27 b(in)g(the)g(primary)f(data)i(arra)m(y)h(\(i.e.,)f
-(the)g(\014rst)f(HDU)i(in)d(the)i(FITS)0 4763 y(\014le\))36
+(the)g(\014rst)f(HDU)i(in)d(the)i(FITS)0 3587 y(\014le\))36
 b(or)h(an)f(IMA)m(GE)h(extension.)59 b(Automatic)38 b(data)f(t)m(yp)s
 (e)g(con)m(v)m(ersion)f(is)g(p)s(erformed)f(for)h(if)g(the)h(data)g(t)m
-(yp)s(e)0 4876 y(of)c(the)g(FITS)f(arra)m(y)h(\(as)g(de\014ned)f(b)m(y)
+(yp)s(e)0 3700 y(of)c(the)g(FITS)f(arra)m(y)h(\(as)g(de\014ned)f(b)m(y)
 g(the)h(BITPIX)g(k)m(eyw)m(ord\))g(di\013ers)f(from)g(the)h(data)g(t)m
-(yp)s(e)g(of)g(the)g(arra)m(y)g(in)0 4989 y(the)c(calling)f(routine.)39
+(yp)s(e)g(of)g(the)g(arra)m(y)g(in)0 3813 y(the)c(calling)f(routine.)39
 b(The)28 b(data)i(v)-5 b(alues)28 b(are)i(automatically)f(scaled)f(b)m
-(y)h(the)h(BSCALE)e(and)g(BZER)m(O)h(header)0 5102 y(v)-5
+(y)h(the)h(BSCALE)e(and)g(BZER)m(O)h(header)0 3926 y(v)-5
 b(alues)24 b(as)i(they)f(are)g(b)s(eing)f(written)g(or)h(read)f(from)h
 (the)g(FITS)f(arra)m(y)-8 b(.)40 b(Unlik)m(e)24 b(the)h(basic)g
-(routines)e(describ)s(ed)g(in)0 5215 y(the)31 b(previous)f(c)m(hapter,)
+(routines)e(describ)s(ed)g(in)0 4039 y(the)31 b(previous)f(c)m(hapter,)
 j(most)e(of)h(these)g(routines)e(sp)s(eci\014cally)f(supp)s(ort)g(the)j
-(FITS)e(random)h(groups)f(format.)0 5328 y(See)h(App)s(endix)c(B)k(for)
+(FITS)e(random)h(groups)f(format.)0 4152 y(See)h(App)s(endix)c(B)k(for)
 f(the)h(de\014nition)d(of)i(the)h(parameters)g(used)e(in)g(these)i
-(routines.)0 5488 y(The)24 b(more)h(primitiv)m(e)e(reading)h(and)g
+(routines.)0 4312 y(The)24 b(more)h(primitiv)m(e)e(reading)h(and)g
 (writing)f(routines)g(\(i.)39 b(e.,)26 b(\013ppr)p 2364
-5488 28 4 v 32 w(,)g(\013ppn)p 2653 5488 V 31 w(,)g(\013ppn,)f(\013gp)m
-(v)p 3185 5488 V 33 w(,)h(or)f(\013gpf)p 3552 5488 V
-32 w(\))g(simply)0 5601 y(treat)g(the)g(primary)d(arra)m(y)j(as)f(a)h
+4312 28 4 v 32 w(,)g(\013ppn)p 2653 4312 V 31 w(,)g(\013ppn,)f(\013gp)m
+(v)p 3185 4312 V 33 w(,)h(or)f(\013gpf)p 3552 4312 V
+32 w(\))g(simply)0 4425 y(treat)g(the)g(primary)d(arra)m(y)j(as)f(a)h
 (long)f(1-dimensional)e(arra)m(y)j(of)f(pixels,)g(ignoring)f(the)h(in)m
-(trinsic)e(dimensionalit)m(y)0 5714 y(of)30 b(the)g(arra)m(y)-8
+(trinsic)e(dimensionalit)m(y)0 4538 y(of)30 b(the)g(arra)m(y)-8
 b(.)42 b(When)30 b(dealing)f(with)f(a)j(2D)g(image,)f(for)g(example,)g
-(the)g(application)f(program)h(m)m(ust)g(calculate)p
+(the)g(application)f(program)h(m)m(ust)g(calculate)0
+4650 y(the)i(pixel)e(o\013set)i(in)e(the)i(1-D)h(arra)m(y)f(that)g
+(corresp)s(onds)e(to)i(an)m(y)g(particular)e(X,)i(Y)f(co)s(ordinate)h
+(in)e(the)h(image.)0 4763 y(C)25 b(programmers)h(should)e(note)i(that)g
+(the)h(ordering)d(of)i(arra)m(ys)g(in)f(FITS)g(\014les,)h(and)f(hence)h
+(in)f(all)f(the)i(CFITSIO)0 4876 y(calls,)38 b(is)e(more)h(similar)e
+(to)i(the)h(dimensionalit)m(y)c(of)j(arra)m(ys)g(in)f(F)-8
+b(ortran)38 b(rather)f(than)f(C.)h(F)-8 b(or)38 b(instance)f(if)f(a)0
+4989 y(FITS)28 b(image)h(has)f(NAXIS1)h(=)f(100)i(and)e(NAXIS2)h(=)f
+(50,)i(then)e(a)h(2-D)h(arra)m(y)f(just)f(large)h(enough)f(to)i(hold)d
+(the)0 5102 y(image)k(should)d(b)s(e)i(declared)g(as)g(arra)m
+(y[50][100])k(and)c(not)h(as)f(arra)m(y[100][50].)0 5262
+y(F)-8 b(or)36 b(con)m(v)m(enience,)h(higher-lev)m(el)d(routines)g(are)
+h(also)g(pro)m(vided)f(to)h(sp)s(eci\014cly)e(deal)i(with)f(2D)h
+(images)g(\(\013p2d)p 3872 5262 V 0 5375 a(and)26 b(\013g2d)p
+372 5375 V 33 w(\))h(and)f(3D)i(data)f(cub)s(es)f(\(\013p3d)p
+1467 5375 V 59 w(and)g(\013g3d)p 1893 5375 V 33 w(\).)40
+b(The)26 b(dimensionalit)m(y)e(of)j(the)g(FITS)f(image)h(is)e(passed)0
+5488 y(b)m(y)36 b(the)h(naxis1,)g(naxis2,)h(and)e(naxis3)g(parameters)g
+(and)g(the)h(declared)e(dimensions)f(of)j(the)f(program)g(arra)m(y)0
+5601 y(are)30 b(passed)g(in)e(the)i(dim1)f(and)g(dim2)g(parameters.)41
+b(Note)31 b(that)f(the)g(dimensions)d(of)j(the)g(program)g(arra)m(y)g
+(ma)m(y)0 5714 y(b)s(e)35 b(larger)g(than)g(the)h(dimensions)d(of)j
+(the)g(FITS)e(arra)m(y)-8 b(.)58 b(F)-8 b(or)36 b(example)f(if)g(a)h
+(FITS)e(image)i(with)e(NAXIS1)i(=)p eop
+%%Page: 96 104
+96 103 bop 0 299 a Fj(96)1003 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fj(NAXIS2)36 b(=)g(400)h(is)e(read)h(in)m(to)g(a)h(program)f
+(arra)m(y)g(whic)m(h)f(is)g(dimensioned)e(as)k(512)g(x)f(512)h(pixels,)
+f(then)g(the)0 668 y(image)f(will)d(just)i(\014ll)e(the)j(lo)m(w)m(er)g
+(left)f(corner)g(of)h(the)g(arra)m(y)g(with)e(pixels)g(in)g(the)i
+(range)g(1)g(-)g(400)g(in)f(the)g(X)h(an)0 781 y(Y)g(directions.)52
+b(This)33 b(has)i(the)g(e\013ect)h(of)f(taking)f(a)i(con)m(tiguous)e
+(set)i(of)f(pixel)e(v)-5 b(alue)34 b(in)f(the)i(FITS)f(arra)m(y)i(and)0
+894 y(writing)28 b(them)i(to)h(a)f(non-con)m(tiguous)g(arra)m(y)h(in)d
+(program)i(memory)g(\(i.e.,)h(there)f(are)h(no)m(w)f(some)g(blank)f
+(pixels)0 1007 y(around)g(the)i(edge)g(of)g(the)f(image)h(in)e(the)h
+(program)g(arra)m(y\).)0 1167 y(The)k(most)i(general)e(set)i(of)f
+(routines)e(\(\013pss)p 1560 1167 28 4 v 33 w(,)j(\013gsv)p
+1836 1167 V 33 w(,)g(and)e(\013gsf)p 2273 1167 V 33 w(\))h(ma)m(y)h(b)s
+(e)e(used)g(to)h(transfer)g(a)g(rectangular)0 1280 y(subset)27
+b(of)h(the)g(pixels)d(in)i(a)h(FITS)f(N-dimensional)e(image)j(to)g(or)g
+(from)f(an)g(arra)m(y)i(whic)m(h)d(has)h(b)s(een)g(declared)g(in)0
+1393 y(the)i(calling)e(program.)40 b(The)28 b(fpixel)f(and)h(lpixel)e
+(parameters)j(are)g(in)m(teger)g(arra)m(ys)g(whic)m(h)e(sp)s(ecify)g
+(the)i(starting)0 1506 y(and)k(ending)e(pixel)h(co)s(ordinate)h(in)f
+(eac)m(h)i(dimension)d(\(starting)i(with)f(1,)i(not)g(0\))g(of)f(the)g
+(FITS)g(image)g(that)h(is)0 1619 y(to)f(b)s(e)e(read)g(or)h(written.)44
+b(It)32 b(is)f(imp)s(ortan)m(t)g(to)i(note)f(that)h(these)f(are)g(the)g
+(starting)g(and)f(ending)f(pixels)g(in)h(the)0 1732 y(FITS)j(image,)j
+(not)e(in)e(the)i(declared)g(arra)m(y)g(in)e(the)i(program.)54
+b(The)35 b(arra)m(y)g(parameter)g(in)f(these)h(routines)f(is)0
+1844 y(treated)g(simply)c(as)j(a)f(large)h(one-dimensional)e(arra)m(y)i
+(of)f(the)h(appropriate)f(data)h(t)m(yp)s(e)g(con)m(taining)f(the)h
+(pixel)0 1957 y(v)-5 b(alues;)36 b(The)e(pixel)f(v)-5
+b(alues)34 b(in)g(the)g(FITS)g(arra)m(y)h(are)g(read/written)f(from/to)
+i(this)d(program)i(arra)m(y)g(in)e(strict)0 2070 y(sequence)e(without)e
+(an)m(y)i(gaps;)g(it)f(is)f(up)g(to)j(the)e(calling)f(routine)g(to)j
+(correctly)e(in)m(terpret)g(the)h(dimensionalit)m(y)0
+2183 y(of)d(this)e(arra)m(y)-8 b(.)41 b(The)27 b(t)m(w)m(o)i(FITS)e
+(reading)g(routines)f(\(\013gsv)p 2018 2183 V 61 w(and)h(\013gsf)p
+2415 2183 V 61 w(\))h(also)f(ha)m(v)m(e)i(an)f(`inc')f(parameter)h
+(whic)m(h)0 2296 y(de\014nes)33 b(the)h(data)h(sampling)d(in)m(terv)-5
+b(al)34 b(in)e(eac)m(h)k(dimension)31 b(of)j(the)h(FITS)e(arra)m(y)-8
+b(.)53 b(F)-8 b(or)35 b(example,)g(if)e(inc[0]=2)0 2409
+y(and)j(inc[1]=3)i(when)e(reading)g(a)h(2-dimensional)e(FITS)h(image,)k
+(then)c(only)g(ev)m(ery)i(other)f(pixel)f(in)f(the)j(\014rst)0
+2522 y(dimension)28 b(and)i(ev)m(ery)h(3rd)f(pixel)e(in)h(the)i(second)
+f(dimension)e(will)g(b)s(e)i(returned)f(to)i(the)f('arra)m(y')i
+(parameter.)0 2682 y(Tw)m(o)d(t)m(yp)s(es)h(of)f(routines)f(are)i(pro)m
+(vided)d(to)j(read)f(the)h(data)g(arra)m(y)f(whic)m(h)f(di\013er)g(in)g
+(the)i(w)m(a)m(y)g(unde\014ned)d(pixels)0 2795 y(are)38
+b(handled.)59 b(The)37 b(\014rst)g(t)m(yp)s(e)g(of)g(routines)g
+(\(e.g.,)j(\013gp)m(v)p 2059 2795 V 34 w(\))d(simply)e(return)h(an)h
+(arra)m(y)h(of)g(data)g(elemen)m(ts)f(in)0 2908 y(whic)m(h)29
+b(unde\014ned)g(pixels)f(are)j(set)g(equal)f(to)i(a)f(v)-5
+b(alue)30 b(sp)s(eci\014ed)e(b)m(y)j(the)g(user)e(in)h(the)g(`n)m(ulv)
+-5 b(al')30 b(parameter.)41 b(An)0 3021 y(additional)27
+b(feature)i(of)g(these)h(routines)d(is)h(that)i(if)e(the)h(user)f(sets)
+h(n)m(ulv)-5 b(al)27 b(=)i(0,)h(then)e(no)h(c)m(hec)m(ks)h(for)f
+(unde\014ned)0 3134 y(pixels)23 b(will)f(b)s(e)j(p)s(erformed,)f(th)m
+(us)h(reducing)e(the)i(amoun)m(t)h(of)f(CPU)f(pro)s(cessing.)38
+b(The)24 b(second)h(t)m(yp)s(e)g(of)g(routines)0 3247
+y(\(e.g.,)36 b(\013gpf)p 413 3247 V 32 w(\))e(returns)e(the)i(data)g
+(elemen)m(t)f(arra)m(y)h(and,)g(in)e(addition,)g(a)i(c)m(har)g(arra)m
+(y)f(that)h(indicates)f(whether)0 3360 y(the)h(v)-5 b(alue)33
+b(of)h(the)f(corresp)s(onding)f(data)i(pixel)e(is)h(unde\014ned)e(\(=)j
+(1\))g(or)g(de\014ned)e(\(=)i(0\).)51 b(The)33 b(latter)h(t)m(yp)s(e)g
+(of)0 3472 y(routines)c(ma)m(y)i(b)s(e)e(more)i(con)m(v)m(enien)m(t)g
+(to)g(use)f(in)f(some)h(circumstances,)h(ho)m(w)m(ev)m(er,)h(it)d
+(requires)g(an)h(additional)0 3585 y(arra)m(y)g(of)f(logical)g(v)-5
+b(alues)30 b(whic)m(h)f(can)i(b)s(e)e(un)m(wieldy)f(when)i(w)m(orking)f
+(with)g(large)i(data)g(arra)m(ys.)0 3859 y Fi(1)81 b
+Fj(W)-8 b(rite)30 b(elemen)m(ts)h(in)m(to)f(the)h(FITS)f(data)h(arra)m
+(y)-8 b(.)95 4133 y Fe(int)47 b(fits_write_img)d(/)k(ffppr)286
+4246 y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(long)i(firstelem,)e
+(long)h(nelements,)334 4359 y(DTYPE)g(*array,)g(int)h(*status\);)95
+4585 y(int)g(fits_write_img_[byt,)c(sht,)j(usht,)h(int,)f(uint,)h(lng,)
+f(ulng,)h(lnglng,)e(flt,)i(dbl])g(/)286 4698 y
+(ffppr[b,i,ui,k,uk,j,uj,jj,)o(e,d)o(])286 4811 y(\(fitsfile)f(*fptr,)g
+(long)g(group,)g(long)h(firstelem,)e(long)i(nelements,)334
+4924 y(DTYPE)f(*array,)g(>)i(int)f(*status\);)95 5149
+y(int)g(fits_write_imgnull)c(/)48 b(ffppn)286 5262 y(\(fitsfile)e
+(*fptr,)g(int)h(datatype,)e(long)i(firstelem,)e(long)h(nelements,)334
+5375 y(DTYPE)g(*array,)g(DTYPE)h(*nulval,)e(>)j(int)f(*status\);)95
+5601 y(int)g(fits_write_imgnull_[byt,)42 b(sht,)k(usht,)h(int,)f(uint,)
+h(lng,)f(ulng,)h(lnglng,)e(flt,)i(dbl])g(/)286 5714 y
+(ffppn[b,i,ui,k,uk,j,uj,jj,)o(e,d)o(])p eop
+%%Page: 97 105
+97 104 bop 0 299 a Fh(9.5.)72 b(SPECIALIZED)29 b(FITS)g(PRIMAR)-8
+b(Y)31 b(ARRA)-8 b(Y)32 b(OR)d(IMA)m(GE)j(EXTENSION)d(I/O)h(R)m
+(OUTINES)125 b Fj(97)286 555 y Fe(\(fitsfile)46 b(*fptr,)g(long)g
+(group,)g(long)h(firstelem,)525 668 y(long)g(nelements,)e(DTYPE)h
+(*array,)g(DTYPE)g(nulval,)g(>)h(int)g(*status\);)0 924
+y Fi(2)81 b Fj(Set)30 b(data)h(arra)m(y)g(elemen)m(ts)g(as)f
+(unde\014ned.)95 1180 y Fe(int)47 b(fits_write_img_null)c(/)k(ffppru)
+286 1293 y(\(fitsfile)f(*fptr,)g(long)g(group,)g(long)h(firstelem,)e
+(long)i(nelements,)334 1406 y(>)h(int)e(*status\))0 1662
+y Fi(3)81 b Fj(W)-8 b(rite)31 b(v)-5 b(alues)29 b(in)m(to)i(group)f
+(parameters.)42 b(This)29 b(routine)g(only)h(applies)f(to)i(the)g
+(`Random)f(Group)s(ed')g(FITS)227 1775 y(format)22 b(whic)m(h)e(has)h
+(b)s(een)f(used)h(for)g(applications)e(in)h(radio)h(in)m(terferometry)
+-8 b(,)24 b(but)c(is)g(o\016cially)g(deprecated)227 1888
+y(for)30 b(future)g(use.)95 2144 y Fe(int)47 b(fits_write_grppar_[byt,)
+42 b(sht,)k(usht,)h(int,)f(uint,)h(lng,)f(ulng,)h(lnglng,)f(flt,)g
+(dbl])h(/)286 2257 y(ffpgp[b,i,ui,k,uk,j,uj,jj,)o(e,d)o(])286
+2370 y(\(fitsfile)f(*fptr,)g(long)g(group,)g(long)h(firstelem,)e(long)i
+(nelements,)334 2483 y(>)h(DTYPE)e(*array,)g(int)h(*status\))0
+2739 y Fi(4)81 b Fj(W)-8 b(rite)30 b(a)h(2-D)h(or)e(3-D)h(image)g(in)m
+(to)f(the)h(data)g(arra)m(y)-8 b(.)95 2996 y Fe(int)47
+b(fits_write_2d_[byt,)c(sht,)k(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f
+(lnglng,)g(flt,)g(dbl])h(/)286 3108 y(ffp2d[b,i,ui,k,uk,j,uj,jj,)o(e,d)
+o(])286 3221 y(\(fitsfile)f(*fptr,)g(long)g(group,)g(long)h(dim1,)f
+(long)h(naxis1,)334 3334 y(long)g(naxis2,)f(DTYPE)g(*array,)g(>)h(int)g
+(*status\))95 3560 y(int)g(fits_write_3d_[byt,)c(sht,)k(usht,)f(int,)h
+(uint,)f(lng,)h(ulng,)f(lnglng,)g(flt,)g(dbl])h(/)286
+3673 y(ffp3d[b,i,ui,k,uk,j,uj,jj,)o(e,d)o(])286 3786
+y(\(fitsfile)f(*fptr,)g(long)g(group,)g(long)h(dim1,)f(long)h(dim2,)334
+3899 y(long)g(naxis1,)f(long)g(naxis2,)g(long)h(naxis3,)e(DTYPE)i
+(*array,)f(>)h(int)g(*status\))0 4155 y Fi(5)81 b Fj(W)-8
+b(rite)30 b(an)h(arbitrary)e(data)i(subsection)e(in)m(to)i(the)f(data)h
+(arra)m(y)-8 b(.)95 4411 y Fe(int)47 b(fits_write_subset_[byt,)42
+b(sht,)k(usht,)h(int,)f(uint,)h(lng,)f(ulng,)h(lnglng,)f(flt,)g(dbl])h
+(/)286 4524 y(ffpss[b,i,ui,k,uk,j,uj,jj,)o(e,d)o(])286
+4637 y(\(fitsfile)f(*fptr,)g(long)g(group,)g(long)h(naxis,)f(long)h
+(*naxes,)334 4750 y(long)g(*fpixel,)e(long)i(*lpixel,)e(DTYPE)i
+(*array,)f(>)h(int)g(*status\))0 5006 y Fi(6)81 b Fj(Read)30
+b(elemen)m(ts)h(from)f(the)g(FITS)g(data)h(arra)m(y)-8
+b(.)95 5262 y Fe(int)47 b(fits_read_img)e(/)i(ffgpv)286
+5375 y(\(fitsfile)f(*fptr,)g(int)94 b(datatype,)46 b(long)g(firstelem,)
+f(long)i(nelements,)334 5488 y(DTYPE)f(*nulval,)g(>)h(DTYPE)g(*array,)f
+(int)h(*anynul,)e(int)i(*status\))95 5714 y(int)g(fits_read_img_[byt,)c
+(sht,)k(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f(lnglng,)g(flt,)g(dbl])h
+(/)p eop
+%%Page: 98 106
+98 105 bop 0 299 a Fj(98)1003 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)286
+555 y Fe(ffgpv[b,i,ui,k,uk,j,uj,jj,)o(e,d)o(])286 668
+y(\(fitsfile)46 b(*fptr,)g(long)g(group,)g(long)h(firstelem,)e(long)i
+(nelements,)334 781 y(DTYPE)f(nulval,)g(>)i(DTYPE)e(*array,)g(int)h
+(*anynul,)e(int)i(*status\))95 1007 y(int)g(fits_read_imgnull)c(/)48
+b(ffgpf)286 1120 y(\(fitsfile)e(*fptr,)g(int)94 b(datatype,)46
+b(long)g(firstelem,)f(long)i(nelements,)334 1233 y(>)h(DTYPE)e(*array,)
+g(char)g(*nullarray,)f(int)i(*anynul,)f(int)g(*status\))95
+1458 y(int)95 b(fits_read_imgnull_[byt,)42 b(sht,)k(usht,)h(int,)f
+(uint,)h(lng,)f(ulng,)h(flt,)f(dbl])h(/)334 1571 y
+(ffgpf[b,i,ui,k,uk,j,uj,jj)o(,e,)o(d])334 1684 y(\(fitsfile)e(*fptr,)h
+(long)h(group,)f(long)h(firstelem,)e(long)h(nelements,)334
+1797 y(>)i(DTYPE)e(*array,)g(char)g(*nullarray,)f(int)i(*anynul,)f(int)
+g(*status\))0 2055 y Fi(7)81 b Fj(Read)29 b(v)-5 b(alues)30
+b(from)f(group)g(parameters.)41 b(This)28 b(routine)g(only)h(applies)f
+(to)j(the)e(`Random)h(Group)s(ed')f(FITS)227 2168 y(format)22
+b(whic)m(h)e(has)h(b)s(een)f(used)h(for)g(applications)e(in)h(radio)h
+(in)m(terferometry)-8 b(,)24 b(but)c(is)g(o\016cially)g(deprecated)227
+2281 y(for)30 b(future)g(use.)95 2538 y Fe(int)95 b
+(fits_read_grppar_[byt,)42 b(sht,)k(usht,)h(int,)f(uint,)h(lng,)f
+(ulng,)h(lnglng,)f(flt,)g(dbl])h(/)334 2651 y
+(ffggp[b,i,ui,k,uk,j,uj,jj)o(,e,)o(d])334 2764 y(\(fitsfile)e(*fptr,)h
+(long)h(group,)f(long)h(firstelem,)e(long)h(nelements,)334
+2877 y(>)i(DTYPE)e(*array,)g(int)h(*status\))0 3135 y
+Fi(8)81 b Fj(Read)37 b(2-D)h(or)g(3-D)g(image)f(from)g(the)g(data)h
+(arra)m(y)-8 b(.)62 b(Unde\014ned)36 b(pixels)g(in)f(the)j(arra)m(y)g
+(will)c(b)s(e)j(set)g(equal)227 3247 y(to)32 b(the)g(v)-5
+b(alue)30 b(of)i('n)m(ulv)-5 b(al',)30 b(unless)g(n)m(ulv)-5
+b(al=0)29 b(in)h(whic)m(h)g(case)i(no)f(testing)h(for)f(unde\014ned)e
+(pixels)g(will)g(b)s(e)227 3360 y(p)s(erformed.)95 3618
+y Fe(int)95 b(fits_read_2d_[byt,)43 b(sht,)k(usht,)f(int,)h(uint,)f
+(lng,)h(ulng,)f(lnglng,)g(flt,)g(dbl])h(/)334 3731 y
+(ffg2d[b,i,ui,k,uk,j,uj,jj)o(,e,)o(d])334 3844 y(\(fitsfile)e(*fptr,)h
+(long)h(group,)f(DTYPE)h(nulval,)e(long)i(dim1,)f(long)h(naxis1,)334
+3957 y(long)g(naxis2,)f(>)h(DTYPE)f(*array,)g(int)h(*anynul,)f(int)h
+(*status\))95 4183 y(int)95 b(fits_read_3d_[byt,)43 b(sht,)k(usht,)f
+(int,)h(uint,)f(lng,)h(ulng,)f(lnglng,)g(flt,)g(dbl])h(/)334
+4295 y(ffg3d[b,i,ui,k,uk,j,uj,jj)o(,e,)o(d])334 4408
+y(\(fitsfile)e(*fptr,)h(long)h(group,)f(DTYPE)h(nulval,)e(long)i(dim1,)
+334 4521 y(long)g(dim2,)f(long)h(naxis1,)f(long)g(naxis2,)g(long)h
+(naxis3,)334 4634 y(>)h(DTYPE)e(*array,)g(int)h(*anynul,)e(int)i
+(*status\))0 4892 y Fi(9)81 b Fj(Read)30 b(an)g(arbitrary)g(data)h
+(subsection)e(from)h(the)g(data)i(arra)m(y)-8 b(.)95
+5149 y Fe(int)95 b(fits_read_subset_[byt,)42 b(sht,)k(usht,)h(int,)f
+(uint,)h(lng,)f(ulng,)h(lnglng,)f(flt,)g(dbl])h(/)334
+5262 y(ffgsv[b,i,ui,k,uk,j,uj,jj)o(,e,)o(d])334 5375
+y(\(fitsfile)e(*fptr,)h(int)h(group,)f(int)h(naxis,)f(long)h(*naxes,)
+334 5488 y(long)g(*fpixel,)e(long)i(*lpixel,)e(long)i(*inc,)f(DTYPE)h
+(nulval,)334 5601 y(>)h(DTYPE)e(*array,)g(int)h(*anynul,)e(int)i
+(*status\))p eop
+%%Page: 99 107
+99 106 bop 0 299 a Fh(9.6.)72 b(SPECIALIZED)29 b(FITS)g(ASCI)s(I)g(AND)
+i(BINAR)-8 b(Y)32 b(T)-8 b(ABLE)30 b(R)m(OUTINES)978
+b Fj(99)95 555 y Fe(int)95 b(fits_read_subsetnull_[byt)o(,)42
+b(sht,)k(usht,)h(int,)f(uint,)h(lng,)f(ulng,)h(lnglng,)f(flt,)g(dbl])h
+(/)334 668 y(ffgsf[b,i,ui,k,uk,j,uj,jj)o(,e,)o(d])334
+781 y(\(fitsfile)e(*fptr,)h(int)h(group,)f(int)h(naxis,)f(long)h
+(*naxes,)334 894 y(long)g(*fpixel,)e(long)i(*lpixel,)e(long)i(*inc,)f
+(>)i(DTYPE)e(*array,)334 1007 y(char)h(*nullarray,)d(int)j(*anynul,)f
+(int)h(*status\))0 1338 y Ff(9.6)135 b(Sp)t(ecialized)46
+b(FITS)e(ASCI)t(I)g(and)g(Binary)h(T)-11 b(able)45 b(Routines)0
+1591 y Fd(9.6.1)112 b(General)38 b(Column)e(Routines)0
+1797 y Fi(1)81 b Fj(Get)31 b(information)d(ab)s(out)i(an)g(existing)f
+(ASCI)s(I)f(or)i(binary)e(table)i(column.)40 b(A)30 b(n)m(ull)e(p)s
+(oin)m(ter)h(ma)m(y)i(b)s(e)e(giv)m(en)227 1910 y(for)40
+b(an)m(y)h(of)f(the)h(output)f(parameters)g(that)h(are)g(not)f(needed.)
+70 b(D)m(A)-8 b(T)g(A)g(TYPE)42 b(is)d(a)i(c)m(haracter)h(string)227
+2023 y(whic)m(h)c(returns)f(the)i(data)g(t)m(yp)s(e)g(of)g(the)f
+(column)g(as)h(de\014ned)e(b)m(y)i(the)f(TF)m(ORMn)h(k)m(eyw)m(ord)g
+(\(e.g.,)j('I',)227 2136 y('J','E',)28 b('D',)g(etc.\).)41
+b(In)27 b(the)g(case)g(of)g(an)g(ASCI)s(I)f(c)m(haracter)i(column,)f(t)
+m(yp)s(eco)s(de)g(will)d(ha)m(v)m(e)k(a)f(v)-5 b(alue)27
+b(of)g(the)227 2249 y(form)g('An')g(where)f('n')h(is)f(an)h(in)m(teger)
+h(expressing)d(the)i(width)f(of)h(the)g(\014eld)f(in)f(c)m(haracters.)
+41 b(F)-8 b(or)28 b(example,)227 2362 y(if)f(TF)m(ORM)i(=)e('160A8')k
+(then)d(\013gb)s(cl)f(will)e(return)i(t)m(yp)s(ec)m(har='A8')j(and)d
+(rep)s(eat=20.)41 b(All)27 b(the)h(returned)227 2475
+y(parameters)j(are)g(scalar)f(quan)m(tities.)95 2716
+y Fe(int)47 b(fits_get_acolparms)c(/)48 b(ffgacl)191
+2829 y(\(fitsfile)d(*fptr,)h(int)h(colnum,)f(>)h(char)g(*ttype,)f(long)
+h(*tbcol,)239 2942 y(char)f(*tunit,)g(char)h(*tform,)f(double)g
+(*scale,)f(double)i(*zero,)239 3055 y(char)f(*nulstr,)g(char)g(*tdisp,)
+g(int)h(*status\))95 3280 y(int)g(fits_get_bcolparms)c(/)48
+b(ffgbcl)286 3393 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(>)j(char)f
+(*ttype,)e(char)i(*tunit,)334 3506 y(char)g(*typechar,)e(long)h
+(*repeat,)g(double)g(*scale,)g(double)g(*zero,)334 3619
+y(long)h(*nulval,)e(char)i(*tdisp,)f(int)94 b(*status\))0
+3861 y Fi(2)81 b Fj(Return)27 b(optimal)g(n)m(um)m(b)s(er)g(of)h(ro)m
+(ws)g(to)h(read)f(or)g(write)f(at)i(one)f(time)g(for)g(maxim)m(um)f
+(I/O)g(e\016ciency)-8 b(.)41 b(Refer)227 3973 y(to)25
+b(the)g(\\Optimizing)d(Co)s(de")i(section)h(in)e(Chapter)h(5)g(for)g
+(more)h(discussion)d(on)i(ho)m(w)g(to)h(use)f(this)g(routine.)95
+4328 y Fe(int)47 b(fits_get_rowsize)d(/)j(ffgrsz)286
+4441 y(\(fitsfile)f(*fptr,)g(long)g(*nrows,)g(*status\))0
+4682 y Fi(3)81 b Fj(De\014ne)22 b(the)g(zero)i(indexed)c(b)m(yte)j
+(o\013set)g(of)g(the)f('heap')h(measured)e(from)h(the)h(start)g(of)f
+(the)g(binary)f(table)h(data.)227 4795 y(By)30 b(default)f(the)g(heap)h
+(is)e(assumed)h(to)h(start)g(immediately)e(follo)m(wing)g(the)i
+(regular)e(table)i(data,)g(i.e.,)g(at)227 4908 y(lo)s(cation)36
+b(NAXIS1)h(x)g(NAXIS2.)59 b(This)35 b(routine)g(is)h(only)f(relev)-5
+b(an)m(t)37 b(for)f(binary)f(tables)h(whic)m(h)g(con)m(tain)227
+5021 y(v)-5 b(ariable)23 b(length)h(arra)m(y)h(columns)e(\(with)g(TF)m
+(ORMn)h(=)g('Pt'\).)40 b(This)22 b(routine)i(also)g(automatically)g
+(writes)227 5134 y(the)35 b(v)-5 b(alue)34 b(of)h(theap)f(to)h(a)g(k)m
+(eyw)m(ord)g(in)f(the)g(extension)g(header.)53 b(This)33
+b(routine)g(m)m(ust)i(b)s(e)f(called)f(after)227 5247
+y(the)e(required)d(k)m(eyw)m(ords)i(ha)m(v)m(e)i(b)s(een)d(written)g
+(\(with)g(\013ph)m(bn\))g(but)h(b)s(efore)f(an)m(y)i(data)g(is)e
+(written)g(to)i(the)227 5360 y(table.)95 5601 y Fe(int)47
+b(fits_write_theap)d(/)j(ffpthp)286 5714 y(\(fitsfile)f(*fptr,)g(long)g
+(theap,)g(>)i(int)f(*status\))p eop
+%%Page: 100 108
+100 107 bop 0 299 a Fj(100)958 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fi(4)81 b Fj(T)-8 b(est)37 b(the)f(con)m(ten)m(ts)i(of)f(the)g
+(binary)d(table)j(v)-5 b(ariable)35 b(arra)m(y)i(heap,)h(returning)d
+(the)h(size)g(of)h(the)g(heap,)h(the)227 668 y(n)m(um)m(b)s(er)30
+b(of)h(un)m(used)e(b)m(ytes)j(that)f(are)g(not)g(curren)m(tly)f(p)s
+(oin)m(ted)g(to)i(b)m(y)e(an)m(y)i(of)f(the)g(descriptors,)f(and)g(the)
+227 781 y(n)m(um)m(b)s(er)d(of)h(b)m(ytes)h(whic)m(h)e(are)h(p)s(oin)m
+(ted)f(to)i(b)m(y)f(m)m(ultiple)e(descriptors.)39 b(It)28
+b(also)g(returns)f(v)-5 b(alid)27 b(=)g(F)-10 b(ALSE)227
+894 y(if)30 b(an)m(y)g(of)h(the)f(descriptors)g(p)s(oin)m(t)f(to)i(in)m
+(v)-5 b(alid)28 b(addresses)i(out)g(of)h(range)g(of)f(the)h(heap.)95
+1153 y Fe(int)47 b(fits_test_heap)d(/)k(fftheap)286 1266
+y(\(fitsfile)e(*fptr,)g(>)h(long)g(*heapsize,)e(long)h(*unused,)g(long)
+h(*overlap,)334 1379 y(int)g(*validheap,)e(int)i(*status\))0
+1637 y Fi(5)81 b Fj(Re-pac)m(k)33 b(the)f(v)m(ectors)h(in)d(the)i
+(binary)e(table)i(v)-5 b(ariable)30 b(arra)m(y)i(heap)g(to)g(reco)m(v)m
+(er)i(an)m(y)e(un)m(used)e(space.)45 b(Nor-)227 1750
+y(mally)-8 b(,)38 b(when)f(a)g(v)m(ector)i(in)d(a)h(v)-5
+b(ariable)36 b(length)h(arra)m(y)g(column)f(is)g(rewritten)h(the)g
+(previously)e(written)227 1863 y(arra)m(y)f(remains)d(in)h(the)h(heap)f
+(as)h(w)m(asted)h(un)m(used)d(space.)49 b(This)31 b(routine)g(will)g
+(repac)m(k)i(the)g(arra)m(ys)g(that)227 1976 y(are)h(still)d(in)h(use,)
+i(th)m(us)f(eliminating)d(an)m(y)k(b)m(ytes)g(in)e(the)h(heap)g(that)h
+(are)g(no)f(longer)g(in)f(use.)49 b(Note)34 b(that)227
+2089 y(if)e(sev)m(eral)h(v)m(ectors)h(p)s(oin)m(t)d(to)j(the)e(same)h
+(b)m(ytes)g(in)f(the)g(heap,)i(then)e(this)f(routine)h(will)e(mak)m(e)j
+(duplicate)227 2202 y(copies)d(of)h(the)g(b)m(ytes)f(for)h(eac)m(h)g(v)
+m(ector,)h(whic)m(h)d(will)f(actually)i(expand)g(the)g(size)h(of)f(the)
+h(heap.)95 2461 y Fe(int)47 b(fits_compress_heap)c(/)48
+b(ffcmph)286 2574 y(\(fitsfile)e(*fptr,)g(>)h(int)g(*status\))0
+2864 y Fd(9.6.2)112 b(Lo)m(w-Lev)m(el)38 b(T)-9 b(able)37
+b(Access)g(Routines)0 3083 y Fj(The)g(follo)m(wing)g(2)h(routines)e
+(pro)m(vide)h(lo)m(w-lev)m(el)h(access)h(to)g(the)f(data)g(in)f(ASCI)s
+(I)f(or)i(binary)e(tables)h(and)h(are)0 3196 y(mainly)27
+b(useful)g(as)j(an)f(e\016cien)m(t)g(w)m(a)m(y)h(to)g(cop)m(y)g(all)e
+(or)h(part)g(of)g(a)g(table)g(from)g(one)g(lo)s(cation)g(to)h(another.)
+40 b(These)0 3309 y(routines)23 b(simply)f(read)i(or)h(write)e(the)i
+(sp)s(eci\014ed)d(n)m(um)m(b)s(er)h(of)i(consecutiv)m(e)g(b)m(ytes)g
+(in)e(an)h(ASCI)s(I)f(or)h(binary)f(table,)0 3422 y(without)g(regard)h
+(for)f(column)g(b)s(oundaries)e(or)j(the)g(ro)m(w)g(length)f(in)f(the)i
+(table.)39 b(These)23 b(routines)g(do)g(not)h(p)s(erform)0
+3535 y(an)m(y)36 b(mac)m(hine)g(dep)s(enden)m(t)f(data)i(con)m(v)m
+(ersion)f(or)h(b)m(yte)f(sw)m(apping.)57 b(See)36 b(App)s(endix)d(B)k
+(for)f(the)g(de\014nition)e(of)0 3648 y(the)d(parameters)f(used)g(in)f
+(these)i(routines.)0 3906 y Fi(1)81 b Fj(Read)30 b(or)h(write)e(a)i
+(consecutiv)m(e)g(arra)m(y)g(of)g(b)m(ytes)f(from)g(an)h(ASCI)s(I)d(or)
+j(binary)d(table)95 4165 y Fe(int)47 b(fits_read_tblbytes)c(/)48
+b(ffgtbb)286 4278 y(\(fitsfile)e(*fptr,)g(long)g(firstrow,)g(long)g
+(firstchar,)f(long)i(nchars,)334 4391 y(>)h(unsigned)d(char)i(*values,)
+e(int)i(*status\))95 4617 y(int)g(fits_write_tblbytes)c(/)k(ffptbb)286
+4730 y(\(fitsfile)f(*fptr,)g(long)g(firstrow,)g(long)g(firstchar,)f
+(long)i(nchars,)334 4843 y(unsigned)f(char)g(*values,)g(>)h(int)g
+(*status\))0 5133 y Fd(9.6.3)112 b(W)-9 b(rite)36 b(Column)g(Data)i
+(Routines)0 5342 y Fi(1)81 b Fj(W)-8 b(rite)27 b(elemen)m(ts)h(in)m(to)
+f(an)h(ASCI)s(I)d(or)j(binary)d(table)j(column)e(\(in)g(the)i(CDU\).)g
+(The)f(data)h(t)m(yp)s(e)f(of)h(the)f(arra)m(y)227 5455
+y(is)j(implied)d(b)m(y)j(the)h(su\016x)e(of)i(the)f(routine)g(name.)95
+5714 y Fe(int)47 b(fits_write_col_str)c(/)48 b(ffpcls)p
+eop
+%%Page: 101 109
+101 108 bop 0 299 a Fh(9.6.)72 b(SPECIALIZED)29 b(FITS)g(ASCI)s(I)g
+(AND)i(BINAR)-8 b(Y)32 b(T)-8 b(ABLE)30 b(R)m(OUTINES)933
+b Fj(101)286 555 y Fe(\(fitsfile)46 b(*fptr,)g(int)h(colnum,)e(long)i
+(firstrow,)e(long)i(firstelem,)334 668 y(long)g(nelements,)e(char)h
+(**array,)g(>)h(int)g(*status\))95 894 y(int)g
+(fits_write_col_[log,byt,sh)o(t,u)o(sht,)o(int,)o(uin)o(t,ln)o(g,ul)o
+(ng,)o(lngl)o(ng,f)o(lt,)o(dbl,)o(cmp,)o(dbl)o(cmp])41
+b(/)286 1007 y(ffpcl[l,b,i,ui,k,uk,j,uj,j)o(j,e)o(,d,c)o(,m])286
+1120 y(\(fitsfile)46 b(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)525
+1233 y(long)g(firstelem,)e(long)h(nelements,)f(DTYPE)i(*array,)e(>)j
+(int)f(*status\))0 1487 y Fi(2)81 b Fj(W)-8 b(rite)35
+b(elemen)m(ts)h(in)m(to)g(an)f(ASCI)s(I)f(or)i(binary)d(table)j(column)
+e(substituting)f(the)j(appropriate)e(FITS)h(n)m(ull)227
+1600 y(v)-5 b(alue)37 b(for)h(an)m(y)g(elemen)m(ts)g(that)g(are)g
+(equal)f(to)i(the)f(n)m(ulv)-5 b(al)36 b(parameter.)63
+b(This)36 b(routines)g(m)m(ust)i(not)g(b)s(e)227 1713
+y(used)30 b(to)h(write)f(to)h(v)-5 b(ariable)29 b(length)h(arra)m(y)g
+(columns.)95 1967 y Fe(int)47 b(fits_write_colnull_[log,)42
+b(byt,)k(sht,)h(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f(lnglng,)g(flt,)h
+(dbl])f(/)286 2080 y(ffpcn[l,b,i,ui,k,uk,j,uj,j)o(j,e)o(,d])286
+2193 y(\(fitsfile)g(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
+(firstelem,)334 2306 y(long)g(nelements,)e(DTYPE)h(*array,)g(DTYPE)g
+(nulval,)g(>)i(int)e(*status\))0 2560 y Fi(3)81 b Fj(W)-8
+b(rite)26 b(string)g(elemen)m(ts)h(in)m(to)f(a)h(binary)e(table)h
+(column)f(\(in)h(the)g(CDU\))i(substituting)c(the)i(FITS)g(n)m(ull)e(v)
+-5 b(alue)227 2673 y(for)28 b(an)m(y)f(elemen)m(ts)h(that)g(are)g
+(equal)f(to)i(the)e(n)m(ulstr)f(string.)39 b(This)26
+b(routine)g(m)m(ust)i(NOT)f(b)s(e)g(used)f(to)j(write)227
+2786 y(to)i(v)-5 b(ariable)30 b(length)f(arra)m(y)i(columns.)95
+3040 y Fe(int)47 b(fits_write_colnull_str)42 b(/)48 b(ffpcns)286
+3153 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
+(firstelem,)334 3266 y(long)g(nelements,)e(char)h(**array,)g(char)h
+(*nulstr,)e(>)j(int)e(*status\))0 3520 y Fi(4)81 b Fj(W)-8
+b(rite)33 b(bit)f(v)-5 b(alues)32 b(in)m(to)h(a)h(binary)d(b)m(yte)i
+(\('B'\))i(or)e(bit)f(\('X'\))i(table)f(column)f(\(in)g(the)h(CDU\).)h
+(Larra)m(y)f(is)f(an)227 3633 y(arra)m(y)25 b(of)g(c)m(haracters)h
+(corresp)s(onding)d(to)i(the)g(sequence)g(of)f(bits)g(to)h(b)s(e)f
+(written.)38 b(If)24 b(an)g(elemen)m(t)h(of)g(larra)m(y)227
+3746 y(is)j(true)h(\(not)h(equal)e(to)i(zero\))g(then)f(the)g(corresp)s
+(onding)e(bit)h(in)g(the)h(FITS)f(table)h(is)f(set)i(to)g(1,)g
+(otherwise)227 3859 y(the)37 b(bit)f(is)g(set)h(to)g(0.)60
+b(The)37 b('X')g(column)e(in)h(a)h(FITS)f(table)g(is)g(alw)m(a)m(ys)h
+(padded)f(out)h(to)g(a)g(m)m(ultiple)e(of)227 3972 y(8)i(bits)e(where)h
+(the)g(bit)g(arra)m(y)g(starts)h(with)e(the)i(most)f(signi\014can)m(t)f
+(bit)h(of)g(the)h(b)m(yte)g(and)e(w)m(orks)h(do)m(wn)227
+4085 y(to)m(w)m(ards)h(the)g(1's)f(bit.)58 b(F)-8 b(or)37
+b(example,)h(a)e('4X')h(arra)m(y)-8 b(,)39 b(with)c(the)i(\014rst)e
+(bit)h(=)f(1)i(and)f(the)g(remaining)f(3)227 4197 y(bits)30
+b(=)h(0)h(is)e(equiv)-5 b(alen)m(t)31 b(to)h(the)g(8-bit)f(unsigned)e
+(b)m(yte)j(decimal)e(v)-5 b(alue)31 b(of)h(128)g(\('1000)i(0000B'\).)g
+(In)d(the)227 4310 y(case)h(of)f('X')g(columns,)f(CFITSIO)g(can)h
+(write)f(to)h(all)f(8)h(bits)f(of)h(eac)m(h)h(b)m(yte)f(whether)f(they)
+h(are)g(formally)227 4423 y(v)-5 b(alid)32 b(or)h(not.)50
+b(Th)m(us)32 b(if)h(the)g(column)f(is)h(de\014ned)f(as)h('4X',)i(and)e
+(one)g(calls)g(\013p)s(clx)f(with)g(\014rstbit=1)g(and)227
+4536 y(n)m(bits=8,)i(then)g(all)e(8)j(bits)d(will)f(b)s(e)j(written)f
+(in)m(to)g(the)h(\014rst)f(b)m(yte)i(\(as)f(opp)s(osed)f(to)i(writing)c
+(the)j(\014rst)g(4)227 4649 y(bits)27 b(in)m(to)h(the)f(\014rst)g(ro)m
+(w)h(and)f(then)h(the)g(next)g(4)g(bits)e(in)m(to)i(the)g(next)g(ro)m
+(w\),)h(ev)m(en)f(though)f(the)h(last)g(4)g(bits)227
+4762 y(of)j(eac)m(h)g(b)m(yte)g(are)f(formally)f(not)h(de\014ned)f(and)
+h(should)e(all)h(b)s(e)g(set)i(=)f(0.)41 b(It)30 b(should)e(also)j(b)s
+(e)e(noted)h(that)227 4875 y(it)j(is)e(more)i(e\016cien)m(t)h(to)f
+(write)f('X')i(columns)d(an)i(en)m(tire)g(b)m(yte)g(at)h(a)f(time,)g
+(instead)f(of)h(bit)f(b)m(y)h(bit.)47 b(An)m(y)227 4988
+y(of)31 b(the)g(CFITSIO)e(routines)g(that)j(write)e(to)h(columns)e
+(\(e.g.)43 b(\014ts)p 2481 4988 28 4 v 33 w(write)p 2717
+4988 V 32 w(col)p 2860 4988 V 32 w(b)m(yt\))32 b(ma)m(y)f(b)s(e)f(used)
+g(for)g(this)227 5101 y(purp)s(ose.)60 b(These)36 b(routines)h(will)d
+(in)m(terpret)j('X')g(columns)f(as)h(though)g(they)h(w)m(ere)f('B')h
+(columns)e(\(e.g.,)227 5214 y('1X')c(through)d('8X')j(is)d(equiv)-5
+b(alen)m(t)30 b(to)h('1B',)h(and)e('9X')h(through)f('16X')i(is)d(equiv)
+-5 b(alen)m(t)30 b(to)h('2B'\).)95 5468 y Fe(int)47 b
+(fits_write_col_bit)c(/)48 b(ffpclx)286 5581 y(\(fitsfile)e(*fptr,)g
+(int)h(colnum,)e(long)i(firstrow,)e(long)i(firstbit,)334
+5694 y(long)g(nbits,)f(char)g(*larray,)g(>)h(int)g(*status\))p
+eop
+%%Page: 102 110
+102 109 bop 0 299 a Fj(102)958 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
+555 y Fi(5)81 b Fj(W)-8 b(rite)34 b(the)g(descriptor)f(for)g(a)h(v)-5
+b(ariable)33 b(length)g(column)g(in)f(a)j(binary)d(table.)51
+b(This)32 b(routine)g(can)j(b)s(e)e(used)227 668 y(in)g(conjunction)g
+(with)f(\013gdes)i(to)h(enable)e(2)h(or)g(more)g(arra)m(ys)h(to)f(p)s
+(oin)m(t)f(to)i(the)f(same)g(storage)h(lo)s(cation)227
+781 y(to)c(sa)m(v)m(e)h(storage)g(space)f(if)e(the)i(arra)m(ys)g(are)g
+(iden)m(tical.)191 1045 y Fe(int)47 b(fits_write_descript)42
+b(/)48 b(ffpdes)382 1158 y(\(fitsfile)d(*fptr,)h(int)h(colnum,)f(long)h
+(rownum,)e(long)i(repeat,)430 1271 y(long)f(offset,)g(>)h(int)g
+(*status\))0 1567 y Fd(9.6.4)112 b(Read)38 b(Column)f(Data)h(Routines)0
+1787 y Fj(Tw)m(o)28 b(t)m(yp)s(es)f(of)h(routines)e(are)i(pro)m(vided)e
+(to)i(get)h(the)e(column)g(data)h(whic)m(h)e(di\013er)g(in)g(the)i(w)m
+(a)m(y)h(unde\014ned)c(pixels)0 1900 y(are)40 b(handled.)65
+b(The)39 b(\014rst)g(set)h(of)f(routines)f(\(\013gcv\))j(simply)c
+(return)h(an)h(arra)m(y)h(of)g(data)g(elemen)m(ts)f(in)f(whic)m(h)0
+2013 y(unde\014ned)28 b(pixels)h(are)i(set)g(equal)f(to)h(a)g(v)-5
+b(alue)30 b(sp)s(eci\014ed)f(b)m(y)i(the)f(user)g(in)f(the)i('n)m(ullv)
+-5 b(al')29 b(parameter.)41 b(If)30 b(n)m(ullv)-5 b(al)0
+2126 y(=)22 b(0,)j(then)d(no)g(c)m(hec)m(ks)i(for)e(unde\014ned)e
+(pixels)h(will)f(b)s(e)i(p)s(erformed,)g(th)m(us)g(increasing)g(the)g
+(sp)s(eed)g(of)g(the)h(program.)0 2239 y(The)36 b(second)g(set)g(of)h
+(routines)d(\(\013gcf)7 b(\))38 b(returns)d(the)h(data)h(elemen)m(t)f
+(arra)m(y)h(and)e(in)g(addition)f(a)j(logical)e(arra)m(y)0
+2351 y(of)e(\015ags)f(whic)m(h)f(de\014nes)h(whether)g(the)g(corresp)s
+(onding)f(data)i(pixel)d(is)i(unde\014ned.)44 b(See)33
+b(App)s(endix)d(B)j(for)f(the)0 2464 y(de\014nition)c(of)j(the)f
+(parameters)h(used)e(in)g(these)i(routines.)0 2625 y(An)m(y)39
+b(column,)g(regardless)f(of)h(it's)f(in)m(trinsic)e(data)k(t)m(yp)s(e,)
+h(ma)m(y)e(b)s(e)f(read)g(as)h(a)g(string.)65 b(It)38
+b(should)f(b)s(e)h(noted)0 2737 y(ho)m(w)m(ev)m(er)32
+b(that)f(reading)e(a)i(n)m(umeric)e(column)g(as)i(a)f(string)g(is)f(10)
+i(-)g(100)g(times)f(slo)m(w)m(er)h(than)f(reading)f(the)i(same)0
+2850 y(column)f(as)i(a)g(n)m(um)m(b)s(er)e(due)h(to)h(the)g(large)g(o)m
+(v)m(erhead)g(in)f(constructing)g(the)h(formatted)g(strings.)43
+b(The)31 b(displa)m(y)0 2963 y(format)26 b(of)g(the)h(returned)d
+(strings)h(will)e(b)s(e)j(determined)e(b)m(y)i(the)g(TDISPn)f(k)m(eyw)m
+(ord,)j(if)c(it)i(exists,)h(otherwise)e(b)m(y)0 3076
+y(the)i(data)g(t)m(yp)s(e)f(of)h(the)f(column.)38 b(The)26
+b(length)g(of)h(the)f(returned)f(strings)g(\(not)i(including)c(the)k(n)
+m(ull)d(terminating)0 3189 y(c)m(haracter\))38 b(can)e(b)s(e)g
+(determined)e(with)h(the)h(\014ts)p 1722 3189 28 4 v
+33 w(get)p 1875 3189 V 34 w(col)p 2020 3189 V 32 w(displa)m(y)p
+2332 3189 V 31 w(width)f(routine.)56 b(The)36 b(follo)m(wing)e(TDISPn)0
+3302 y(displa)m(y)29 b(formats)h(are)h(curren)m(tly)e(supp)s(orted:)191
+3566 y Fe(Iw.m)142 b(Integer)191 3679 y(Ow.m)g(Octal)46
+b(integer)191 3792 y(Zw.m)142 b(Hexadecimal)45 b(integer)191
+3905 y(Fw.d)142 b(Fixed)46 b(floating)g(point)191 4018
+y(Ew.d)142 b(Exponential)45 b(floating)g(point)191 4131
+y(Dw.d)142 b(Exponential)45 b(floating)g(point)191 4244
+y(Gw.d)142 b(General;)46 b(uses)g(Fw.d)h(if)g(significance)d(not)j
+(lost,)g(else)f(Ew.d)0 4508 y Fj(where)37 b(w)h(is)f(the)h(width)e(in)h
+(c)m(haracters)i(of)f(the)h(displa)m(y)m(ed)d(v)-5 b(alues,)40
+b(m)d(is)g(the)h(minim)m(um)e(n)m(um)m(b)s(er)g(of)i(digits)0
+4621 y(displa)m(y)m(ed,)29 b(and)h(d)g(is)f(the)i(n)m(um)m(b)s(er)e(of)
+h(digits)f(to)i(the)g(righ)m(t)f(of)h(the)f(decimal.)40
+b(The)30 b(.m)g(\014eld)f(is)g(optional.)0 4885 y Fi(1)81
+b Fj(Read)29 b(elemen)m(ts)h(from)f(an)g(ASCI)s(I)f(or)i(binary)e
+(table)h(column)f(\(in)h(the)g(CDU\).)i(These)e(routines)f(return)h
+(the)227 4998 y(v)-5 b(alues)29 b(of)h(the)g(table)g(column)f(arra)m(y)
+h(elemen)m(ts.)41 b(Unde\014ned)28 b(arra)m(y)j(elemen)m(ts)f(will)d(b)
+s(e)i(returned)g(with)g(a)227 5111 y(v)-5 b(alue)29 b(=)f(n)m(ulv)-5
+b(al,)28 b(unless)f(n)m(ulv)-5 b(al)27 b(=)h(0)i(\(or)f(=)f(')h(')g
+(for)g(\013gcvs\))g(in)f(whic)m(h)f(case)j(no)f(c)m(hec)m(king)h(for)e
+(unde\014ned)227 5224 y(v)-5 b(alues)27 b(will)e(b)s(e)i(p)s(erformed.)
+39 b(The)27 b(ANYF)h(parameter)g(is)f(set)h(to)g(true)g(if)f(an)m(y)g
+(of)h(the)g(returned)f(elemen)m(ts)227 5337 y(are)k(unde\014ned.)95
+5601 y Fe(int)47 b(fits_read_col_str)c(/)48 b(ffgcvs)286
+5714 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
+(firstelem,)p eop
+%%Page: 103 111
+103 110 bop 0 299 a Fh(9.6.)72 b(SPECIALIZED)29 b(FITS)g(ASCI)s(I)g
+(AND)i(BINAR)-8 b(Y)32 b(T)-8 b(ABLE)30 b(R)m(OUTINES)933
+b Fj(103)334 555 y Fe(long)47 b(nelements,)e(char)h(*nulstr,)g(>)h
+(char)g(**array,)f(int)g(*anynul,)334 668 y(int)h(*status\))95
+894 y(int)g(fits_read_col_[log,byt,sht)o(,us)o(ht,i)o(nt,u)o(int)o
+(,lng)o(,uln)o(g,)41 b(lnglng,)46 b(flt,)h(dbl,)g(cmp,)f(dblcmp])g(/)
+286 1007 y(ffgcv[l,b,i,ui,k,uk,j,uj,j)o(j,e)o(,d,c)o(,m])286
+1120 y(\(fitsfile)g(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
+(firstelem,)334 1233 y(long)g(nelements,)e(DTYPE)h(nulval,)g(>)h(DTYPE)
+g(*array,)f(int)g(*anynul,)334 1346 y(int)h(*status\))0
+1632 y Fi(2)81 b Fj(Read)39 b(elemen)m(ts)h(and)f(n)m(ull)f(\015ags)i
+(from)f(an)g(ASCI)s(I)g(or)g(binary)f(table)i(column)e(\(in)h(the)h
+(CHDU\).)g(These)227 1745 y(routines)28 b(return)f(the)i(v)-5
+b(alues)28 b(of)h(the)g(table)g(column)e(arra)m(y)j(elemen)m(ts.)40
+b(An)m(y)29 b(unde\014ned)d(arra)m(y)k(elemen)m(ts)227
+1858 y(will)h(ha)m(v)m(e)k(the)f(corresp)s(onding)d(n)m(ullarra)m(y)h
+(elemen)m(t)i(set)g(equal)f(to)h(TR)m(UE.)g(The)f(an)m(yn)m(ul)g
+(parameter)h(is)227 1971 y(set)d(to)g(true)f(if)g(an)m(y)h(of)f(the)h
+(returned)e(elemen)m(ts)i(are)f(unde\014ned.)95 2257
+y Fe(int)47 b(fits_read_colnull_str)42 b(/)48 b(ffgcfs)286
+2370 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
+(firstelem,)334 2483 y(long)g(nelements,)e(>)i(char)g(**array,)e(char)i
+(*nullarray,)e(int)i(*anynul,)334 2596 y(int)g(*status\))95
+2822 y(int)g(fits_read_colnull_[log,byt)o(,sh)o(t,us)o(ht,i)o(nt,)o
+(uint)o(,lng)o(,ul)o(ng,l)o(ngln)o(g,f)o(lt,d)o(bl,c)o(mp,)o(dblc)o
+(mp])41 b(/)286 2935 y(ffgcf[l,b,i,ui,k,uk,j,uj,j)o(j,e)o(,d,c)o(,m])
+286 3048 y(\(fitsfile)46 b(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)
+334 3161 y(long)g(firstelem,)e(long)h(nelements,)f(>)j(DTYPE)e(*array,)
+334 3274 y(char)h(*nullarray,)d(int)j(*anynul,)f(int)h(*status\))0
+3560 y Fi(3)81 b Fj(Read)24 b(an)g(arbitrary)f(data)i(subsection)e
+(from)h(an)g(N-dimensional)e(arra)m(y)j(in)e(a)h(binary)f(table)h(v)m
+(ector)i(column.)227 3673 y(Unde\014ned)21 b(pixels)g(in)g(the)i(arra)m
+(y)g(will)d(b)s(e)i(set)h(equal)g(to)g(the)g(v)-5 b(alue)22
+b(of)h('n)m(ulv)-5 b(al',)23 b(unless)e(n)m(ulv)-5 b(al=0)21
+b(in)g(whic)m(h)227 3786 y(case)37 b(no)e(testing)g(for)g(unde\014ned)e
+(pixels)g(will)g(b)s(e)i(p)s(erformed.)53 b(The)35 b(\014rst)g(and)f
+(last)h(ro)m(ws)h(in)e(the)h(table)227 3899 y(to)30 b(b)s(e)e(read)h
+(are)g(sp)s(eci\014ed)f(b)m(y)h(fpixel\(naxis+1\))d(and)j
+(lpixel\(naxis+1\),)e(and)h(hence)h(are)h(treated)g(as)f(the)227
+4012 y(next)38 b(higher)e(dimension)f(of)j(the)f(FITS)g(N-dimensional)e
+(arra)m(y)-8 b(.)63 b(The)37 b(INC)h(parameter)g(sp)s(eci\014es)e(the)
+227 4125 y(sampling)29 b(in)m(terv)-5 b(al)29 b(in)g(eac)m(h)j
+(dimension)c(b)s(et)m(w)m(een)j(the)f(data)h(elemen)m(ts)g(that)g(will)
+d(b)s(e)h(returned.)95 4411 y Fe(int)47 b(fits_read_subset_[byt,)42
+b(sht,)47 b(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f(lnglng,)g(flt,)h
+(dbl])f(/)286 4524 y(ffgsv[b,i,ui,k,uk,j,uj,jj,)o(e,d)o(])286
+4637 y(\(fitsfile)g(*fptr,)g(int)h(colnum,)e(int)i(naxis,)f(long)h
+(*naxes,)f(long)h(*fpixel,)334 4750 y(long)g(*lpixel,)e(long)i(*inc,)f
+(DTYPE)h(nulval,)e(>)j(DTYPE)e(*array,)g(int)h(*anynul,)334
+4863 y(int)g(*status\))0 5149 y Fi(4)81 b Fj(Read)24
+b(an)g(arbitrary)f(data)i(subsection)e(from)h(an)g(N-dimensional)e
+(arra)m(y)j(in)e(a)h(binary)f(table)h(v)m(ector)i(column.)227
+5262 y(An)m(y)34 b(Unde\014ned)e(pixels)g(in)h(the)g(arra)m(y)i(will)c
+(ha)m(v)m(e)k(the)f(corresp)s(onding)d('n)m(ullarra)m(y')i(elemen)m(t)h
+(set)g(equal)227 5375 y(to)40 b(TR)m(UE.)e(The)h(\014rst)e(and)h(last)h
+(ro)m(ws)f(in)g(the)g(table)h(to)g(b)s(e)f(read)h(are)g(sp)s(eci\014ed)
+d(b)m(y)j(fpixel\(naxis+1\))227 5488 y(and)i(lpixel\(naxis+1\),)i(and)e
+(hence)h(are)g(treated)g(as)g(the)g(next)g(higher)f(dimension)e(of)j
+(the)g(FITS)f(N-)227 5601 y(dimensional)f(arra)m(y)-8
+b(.)78 b(The)41 b(INC)h(parameter)h(sp)s(eci\014es)e(the)i(sampling)d
+(in)m(terv)-5 b(al)42 b(in)f(eac)m(h)j(dimension)227
+5714 y(b)s(et)m(w)m(een)31 b(the)g(data)g(elemen)m(ts)g(that)g(will)c
+(b)s(e)j(returned.)p eop
+%%Page: 104 112
+104 111 bop 0 299 a Fj(104)958 b Fh(CHAPTER)30 b(9.)112
+b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)95
+555 y Fe(int)47 b(fits_read_subsetnull_[byt,)41 b(sht,)47
+b(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f(lnglng,)g(flt,)g(dbl])h(/)286
+668 y(ffgsf[b,i,ui,k,uk,j,uj,jj,)o(e,d)o(])286 781 y(\(fitsfile)f
+(*fptr,)g(int)h(colnum,)e(int)i(naxis,)f(long)h(*naxes,)334
+894 y(long)g(*fpixel,)e(long)i(*lpixel,)e(long)i(*inc,)f(>)i(DTYPE)e
+(*array,)334 1007 y(char)h(*nullarray,)d(int)j(*anynul,)f(int)h
+(*status\))0 1227 y Fi(5)81 b Fj(Read)35 b(bit)f(v)-5
+b(alues)34 b(from)h(a)g(b)m(yte)h(\('B'\))g(or)f(bit)f(\(`X`\))i(table)
+f(column)f(\(in)g(the)h(CDU\).)h(Larra)m(y)g(is)e(an)g(arra)m(y)227
+1340 y(of)g(logical)f(v)-5 b(alues)33 b(corresp)s(onding)f(to)i(the)g
+(sequence)g(of)g(bits)f(to)h(b)s(e)f(read.)51 b(If)33
+b(larra)m(y)g(is)g(true)g(then)h(the)227 1453 y(corresp)s(onding)h(bit)
+h(w)m(as)h(set)h(to)f(1,)j(otherwise)c(the)h(bit)f(w)m(as)h(set)h(to)f
+(0.)61 b(The)37 b('X')g(column)f(in)f(a)j(FITS)227 1566
+y(table)d(is)e(alw)m(a)m(ys)i(padded)f(out)h(to)g(a)g(m)m(ultiple)d(of)
+j(8)g(bits)e(where)h(the)h(bit)f(arra)m(y)h(starts)g(with)e(the)i(most)
+227 1678 y(signi\014can)m(t)h(bit)f(of)i(the)g(b)m(yte)g(and)f(w)m
+(orks)g(do)m(wn)h(to)m(w)m(ards)g(the)g(1's)g(bit.)58
+b(F)-8 b(or)37 b(example,)h(a)f('4X')h(arra)m(y)-8 b(,)227
+1791 y(with)32 b(the)i(\014rst)e(bit)h(=)g(1)h(and)e(the)i(remaining)d
+(3)j(bits)e(=)h(0)h(is)e(equiv)-5 b(alen)m(t)33 b(to)h(the)g(8-bit)f
+(unsigned)e(b)m(yte)227 1904 y(v)-5 b(alue)30 b(of)g(128.)42
+b(Note)31 b(that)g(in)d(the)j(case)g(of)f('X')g(columns,)f(CFITSIO)g
+(can)h(read)g(all)f(8)h(bits)f(of)h(eac)m(h)h(b)m(yte)227
+2017 y(whether)h(they)h(are)g(formally)e(v)-5 b(alid)31
+b(or)h(not.)48 b(Th)m(us)31 b(if)h(the)g(column)g(is)f(de\014ned)g(as)i
+('4X',)h(and)e(one)h(calls)227 2130 y(\013gcx)d(with)e(\014rstbit=1)f
+(and)i(n)m(bits=8,)f(then)h(all)f(8)h(bits)f(will)e(b)s(e)j(read)g
+(from)f(the)h(\014rst)g(b)m(yte)g(\(as)h(opp)s(osed)227
+2243 y(to)39 b(reading)e(the)h(\014rst)g(4)g(bits)f(from)h(the)g
+(\014rst)f(ro)m(w)h(and)g(then)f(the)i(\014rst)e(4)h(bits)f(from)h(the)
+g(next)g(ro)m(w\),)227 2356 y(ev)m(en)g(though)f(the)g(last)h(4)f(bits)
+f(of)i(eac)m(h)g(b)m(yte)g(are)f(formally)f(not)i(de\014ned.)60
+b(It)37 b(should)e(also)i(b)s(e)g(noted)227 2469 y(that)f(it)e(is)h
+(more)g(e\016cien)m(t)g(to)h(read)f('X')h(columns)d(an)i(en)m(tire)g(b)
+m(yte)h(at)g(a)f(time,)h(instead)e(of)i(bit)e(b)m(y)h(bit.)227
+2582 y(An)m(y)29 b(of)g(the)h(CFITSIO)d(routines)h(that)h(read)g
+(columns)f(\(e.g.)42 b(\014ts)p 2520 2582 28 4 v 32 w(read)p
+2724 2582 V 33 w(col)p 2868 2582 V 33 w(b)m(yt\))29 b(ma)m(y)h(b)s(e)e
+(used)g(for)h(this)227 2695 y(purp)s(ose.)60 b(These)36
+b(routines)h(will)d(in)m(terpret)j('X')g(columns)f(as)h(though)g(they)h
+(w)m(ere)f('B')h(columns)e(\(e.g.,)227 2808 y('8X')c(is)d(equiv)-5
+b(alen)m(t)30 b(to)h('1B',)h(and)e('16X')i(is)d(equiv)-5
+b(alen)m(t)30 b(to)h('2B'\).)95 3027 y Fe(int)47 b(fits_read_col_bit)c
+(/)48 b(ffgcx)286 3140 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i
+(firstrow,)e(long)i(firstbit,)334 3253 y(long)g(nbits,)f(>)h(char)g
+(*larray,)e(int)i(*status\))0 3473 y Fi(6)81 b Fj(Read)31
+b(an)m(y)h(consecutiv)m(e)h(set)f(of)g(bits)e(from)i(an)f('X')h(or)g
+('B')h(column)d(and)h(in)m(terpret)g(them)h(as)f(an)h(unsigned)227
+3586 y(n-bit)g(in)m(teger.)47 b(n)m(bits)32 b(m)m(ust)g(b)s(e)g(less)g
+(than)h(16)g(or)g(32)g(in)e(\013gcxui)i(and)e(\013gcxuk,)j(resp)s
+(ectiv)m(ely)-8 b(.)47 b(If)32 b(nro)m(ws)227 3699 y(is)27
+b(greater)i(than)f(1,)h(then)e(the)h(same)h(set)f(of)g(bits)f(will)e(b)
+s(e)i(read)h(from)f(eac)m(h)i(ro)m(w,)g(starting)f(with)e(\014rstro)m
+(w.)227 3812 y(The)k(bits)f(are)i(n)m(um)m(b)s(ered)e(with)g(1)i(=)f
+(the)h(most)f(signi\014can)m(t)g(bit)f(of)i(the)f(\014rst)g(elemen)m(t)
+h(of)f(the)h(column.)95 4032 y Fe(int)47 b(fits_read_col_bit_[usht,)42
+b(uint])k(/)h(ffgcx[ui,uk])286 4145 y(\(fitsfile)f(*fptr,)g(int)h
+(colnum,)e(long)i(firstrow,)e(long,)i(nrows,)334 4258
+y(long)g(firstbit,)e(long)i(nbits,)f(>)h(DTYPE)g(*array,)e(int)i
+(*status\))0 4478 y Fi(7)81 b Fj(Return)27 b(the)i(descriptor)e(for)i
+(a)g(v)-5 b(ariable)27 b(length)h(column)f(in)h(a)h(binary)d(table.)40
+b(The)28 b(descriptor)g(consists)g(of)227 4591 y(2)k(in)m(teger)f
+(parameters:)42 b(the)31 b(n)m(um)m(b)s(er)f(of)h(elemen)m(ts)h(in)d
+(the)i(arra)m(y)h(and)e(the)h(starting)g(o\013set)h(relativ)m(e)f(to)
+227 4704 y(the)d(start)f(of)g(the)h(heap.)39 b(The)27
+b(\014rst)f(routine)g(returns)g(a)h(single)f(descriptor)g(whereas)h
+(the)g(second)g(routine)227 4816 y(returns)i(the)i(descriptors)e(for)h
+(a)h(range)g(of)f(ro)m(ws)h(in)e(the)h(table.)95 5036
+y Fe(int)47 b(fits_read_descript)c(/)48 b(ffgdes)286
+5149 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(rownum,)f(>)h(long)
+g(*repeat,)525 5262 y(long)g(*offset,)e(int)i(*status\))95
+5488 y(int)g(fits_read_descripts)c(/)k(ffgdess)286 5601
+y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
+(nrows)f(>)i(long)e(*repeat,)525 5714 y(long)h(*offset,)e(int)i
+(*status\))p eop
+%%Page: 105 113
+105 112 bop 0 1225 a Fg(Chapter)65 b(10)0 1687 y Fm(Extended)77
+b(File)g(Name)g(Syn)-6 b(tax)0 2216 y Ff(10.1)136 b(Ov)l(erview)0
+2466 y Fj(CFITSIO)30 b(supp)s(orts)f(an)j(extended)f(syn)m(tax)h(when)f
+(sp)s(ecifying)e(the)j(name)f(of)h(the)g(data)g(\014le)e(to)i(b)s(e)f
+(op)s(ened)g(or)0 2579 y(created)g(that)g(includes)d(the)j(follo)m
+(wing)e(features:)136 2813 y Fc(\017)46 b Fj(CFITSIO)40
+b(can)i(read)f(IRAF)h(format)g(images)f(whic)m(h)f(ha)m(v)m(e)j(header)
+e(\014le)g(names)g(that)h(end)f(with)f(the)227 2926 y('.imh')d
+(extension,)i(as)f(w)m(ell)e(as)i(reading)e(and)h(writing)e(FITS)i
+(\014les,)h(This)e(feature)i(is)e(implemen)m(ted)g(in)227
+3039 y(CFITSIO)29 b(b)m(y)i(\014rst)e(con)m(v)m(erting)j(the)e(IRAF)h
+(image)g(in)m(to)f(a)h(temp)s(orary)f(FITS)g(format)h(\014le)e(in)g
+(memory)-8 b(,)227 3152 y(then)35 b(op)s(ening)e(the)i(FITS)f(\014le.)
+53 b(An)m(y)35 b(of)g(the)g(usual)e(CFITSIO)h(routines)f(then)i(ma)m(y)
+g(b)s(e)f(used)g(to)i(read)227 3265 y(the)31 b(image)f(header)g(or)h
+(data.)41 b(Similarly)-8 b(,)27 b(ra)m(w)j(binary)f(data)i(arra)m(ys)f
+(can)h(b)s(e)f(read)g(b)m(y)g(con)m(v)m(erting)h(them)227
+3378 y(on)g(the)f(\015y)g(in)m(to)g(virtual)f(FITS)h(images.)136
+3557 y Fc(\017)46 b Fj(FITS)37 b(\014les)g(on)g(the)h(in)m(ternet)g
+(can)g(b)s(e)f(read)g(\(and)g(sometimes)h(written\))f(using)f(the)i
+(FTP)-8 b(,)38 b(HTTP)-8 b(,)38 b(or)227 3670 y(R)m(OOT)30
+b(proto)s(cols.)136 3849 y Fc(\017)46 b Fj(FITS)30 b(\014les)f(can)i(b)
+s(e)f(pip)s(ed)e(b)s(et)m(w)m(een)j(tasks)f(on)h(the)f(stdin)f(and)h
+(stdout)g(streams.)136 4028 y Fc(\017)46 b Fj(FITS)36
+b(\014les)g(can)h(b)s(e)f(read)h(and)f(written)g(in)g(shared)g(memory)
+-8 b(.)60 b(This)35 b(can)i(p)s(oten)m(tially)f(ac)m(hiev)m(e)i(b)s
+(etter)227 4141 y(data)26 b(I/O)e(p)s(erformance)g(compared)h(to)h
+(reading)e(and)g(writing)e(the)j(same)h(FITS)e(\014les)f(on)i(magnetic)
+g(disk.)136 4320 y Fc(\017)46 b Fj(Compressed)30 b(FITS)f(\014les)h(in)
+f(gzip)h(or)g(Unix)f(COMPRESS)g(format)h(can)h(b)s(e)f(directly)f
+(read.)136 4499 y Fc(\017)46 b Fj(Output)28 b(FITS)h(\014les)f(can)h(b)
+s(e)g(written)f(directly)g(in)f(compressed)i(gzip)g(format,)h(th)m(us)e
+(sa)m(ving)h(disk)f(space.)136 4678 y Fc(\017)46 b Fj(FITS)26
+b(table)g(columns)f(can)i(b)s(e)f(created,)i(mo)s(di\014ed,)e(or)g
+(deleted)g('on-the-\015y')h(as)g(the)g(table)f(is)f(op)s(ened)h(b)m(y)
+227 4791 y(CFITSIO.)32 b(This)g(creates)j(a)e(virtual)f(FITS)h(\014le)f
+(con)m(taining)h(the)h(mo)s(di\014cations)d(that)j(is)f(then)g(op)s
+(ened)227 4904 y(b)m(y)e(the)f(application)f(program.)136
+5083 y Fc(\017)46 b Fj(T)-8 b(able)28 b(ro)m(ws)f(ma)m(y)i(b)s(e)e
+(selected,)i(or)f(\014ltered)f(out,)h(on)g(the)g(\015y)f(when)g(the)h
+(table)g(is)f(op)s(ened)g(b)m(y)g(CFITSIO,)227 5196 y(based)22
+b(on)f(an)g(user-sp)s(eci\014ed)f(expression.)37 b(Only)20
+b(ro)m(ws)h(for)g(whic)m(h)g(the)h(expression)e(ev)-5
+b(aluates)22 b(to)g('TR)m(UE')227 5309 y(are)31 b(retained)f(in)f(the)h
+(cop)m(y)i(of)e(the)h(table)f(that)h(is)e(op)s(ened)h(b)m(y)g(the)h
+(application)d(program.)136 5488 y Fc(\017)46 b Fj(Histogram)27
+b(images)g(ma)m(y)g(b)s(e)f(created)h(on)f(the)h(\015y)f(b)m(y)g
+(binning)e(the)i(v)-5 b(alues)26 b(in)f(table)i(columns,)f(resulting)
+227 5601 y(in)35 b(a)h(virtual)f(N-dimensional)e(FITS)j(image.)58
+b(The)35 b(application)f(program)i(then)g(only)f(sees)h(the)h(FITS)227
+5714 y(image)31 b(\(in)e(the)i(primary)d(arra)m(y\))k(instead)d(of)i
+(the)f(original)f(FITS)g(table.)1882 5942 y(105)p eop
+%%Page: 106 114
+106 113 bop 0 299 a Fj(106)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(The)39
+b(latter)h(3)g(table)g(\014ltering)e(features)i(in)e(particular)g(add)h
+(v)m(ery)h(p)s(o)m(w)m(erful)e(data)j(pro)s(cessing)d(capabilities)0
+668 y(directly)31 b(in)m(to)h(CFITSIO,)f(and)h(hence)h(in)m(to)f(ev)m
+(ery)h(task)g(that)g(uses)f(CFITSIO)f(to)i(read)f(or)h(write)e(FITS)h
+(\014les.)0 781 y(F)-8 b(or)29 b(example,)f(these)g(features)h
+(transform)e(a)h(v)m(ery)g(simple)e(program)i(that)g(just)g(copies)f
+(an)h(input)e(FITS)h(\014le)g(to)0 894 y(a)d(new)f(output)h(\014le)f
+(\(lik)m(e)g(the)h(`\014tscop)m(y')h(program)e(that)i(is)d(distributed)
+f(with)i(CFITSIO\))f(in)m(to)i(a)g(m)m(ultipurp)s(ose)0
+1007 y(FITS)33 b(\014le)f(pro)s(cessing)g(to)s(ol.)50
+b(By)33 b(app)s(ending)e(fairly)h(simple)f(quali\014ers)g(on)m(to)j
+(the)g(name)f(of)h(the)f(input)f(FITS)0 1120 y(\014le,)44
+b(the)e(user)f(can)h(p)s(erform)e(quite)h(complex)h(table)f(editing)g
+(op)s(erations)g(\(e.g.,)46 b(create)d(new)e(columns,)j(or)0
+1233 y(\014lter)31 b(out)i(ro)m(ws)f(in)f(a)h(table\))h(or)f(create)i
+(FITS)d(images)i(b)m(y)f(binning)d(or)j(histogramming)f(the)i(v)-5
+b(alues)31 b(in)g(table)0 1346 y(columns.)46 b(In)32
+b(addition,)f(these)i(functions)e(ha)m(v)m(e)j(b)s(een)e(co)s(ded)g
+(using)f(new)h(state-of-the)j(art)e(algorithms)e(that)0
+1458 y(are,)g(in)e(some)i(cases,)g(10)h(-)e(100)i(times)e(faster)h
+(than)f(previous)f(widely)f(used)h(implemen)m(tations.)0
+1619 y(Before)34 b(describing)d(the)j(complete)g(syn)m(tax)g(for)f(the)
+h(extended)f(FITS)g(\014le)f(names)h(in)f(the)i(next)g(section,)g(here)
+0 1732 y(are)d(a)g(few)f(examples)g(of)g(FITS)g(\014le)f(names)i(that)f
+(giv)m(e)h(a)g(quic)m(k)f(o)m(v)m(erview)h(of)g(the)f(allo)m(w)m(ed)g
+(syn)m(tax:)136 1984 y Fc(\017)46 b Fe(myfile.fits)p
+Fj(:)38 b(the)30 b(simplest)f(case)i(of)g(a)g(FITS)e(\014le)h(on)g
+(disk)f(in)g(the)i(curren)m(t)f(directory)-8 b(.)136
+2169 y Fc(\017)46 b Fe(myfile.imh)p Fj(:)i(op)s(ens)34
+b(an)h(IRAF)g(format)g(image)h(\014le)e(and)g(con)m(v)m(erts)j(it)d(on)
+h(the)g(\015y)g(in)m(to)g(a)g(temp)s(orary)227 2282 y(FITS)30
+b(format)h(image)f(in)f(memory)i(whic)m(h)e(can)h(then)g(b)s(e)g(read)g
+(with)f(an)m(y)i(other)g(CFITSIO)e(routine.)136 2467
+y Fc(\017)46 b Fe(rawfile.dat[i512,512])p Fj(:)35 b(op)s(ens)30
+b(a)g(ra)m(w)h(binary)d(data)j(arra)m(y)g(\(a)g(512)g(x)f(512)i(short)e
+(in)m(teger)g(arra)m(y)h(in)227 2580 y(this)h(case\))j(and)d(con)m(v)m
+(erts)j(it)d(on)h(the)g(\015y)g(in)m(to)g(a)g(temp)s(orary)g(FITS)f
+(format)h(image)h(in)d(memory)i(whic)m(h)227 2693 y(can)e(then)f(b)s(e)
+g(read)g(with)f(an)m(y)i(other)f(CFITSIO)f(routine.)136
+2878 y Fc(\017)46 b Fe(myfile.fits.gz)p Fj(:)d(if)32
+b(this)g(is)g(the)h(name)g(of)h(a)f(new)g(output)g(\014le,)g(the)g
+('.gz')i(su\016x)d(will)e(cause)k(it)f(to)h(b)s(e)227
+2991 y(compressed)c(in)f(gzip)h(format)h(when)e(it)h(is)g(written)f(to)
+i(disk.)136 3176 y Fc(\017)46 b Fe(myfile.fits.gz[events,)c(2])p
+Fj(:)35 b(op)s(ens)20 b(and)f(uncompresses)g(the)i(gzipp)s(ed)e(\014le)
+g(m)m(y\014le.\014ts)h(then)g(mo)m(v)m(es)227 3289 y(to)31
+b(the)g(extension)f(with)f(the)i(k)m(eyw)m(ords)f(EXTNAME)h(=)f
+('EVENTS')g(and)g(EXTVER)g(=)g(2.)136 3474 y Fc(\017)46
+b Fe(-)p Fj(:)40 b(a)30 b(dash)f(\(min)m(us)f(sign\))h(signi\014es)f
+(that)i(the)g(input)e(\014le)g(is)h(to)h(b)s(e)f(read)h(from)f(the)h
+(stdin)e(\014le)h(stream,)h(or)227 3587 y(that)h(the)g(output)f(\014le)
+f(is)h(to)h(b)s(e)f(written)f(to)i(the)g(stdout)f(stream.)136
+3772 y Fc(\017)46 b Fe(ftp://legacy.gsfc.nasa.go)o(v/te)o(st/v)o(ela)o
+(.fit)o(s)p Fj(:)k(FITS)37 b(\014les)g(in)g(an)m(y)i(ftp)e(arc)m(hiv)m
+(e)i(site)f(on)g(the)227 3885 y(in)m(ternet)30 b(ma)m(y)h(b)s(e)f
+(directly)f(op)s(ened)h(with)f(read-only)h(access.)136
+4070 y Fc(\017)46 b Fe(http://legacy.gsfc.nasa.g)o(ov/s)o(oftw)o(are)o
+(/tes)o(t.fi)o(ts)p Fj(:)33 b(an)m(y)27 b(v)-5 b(alid)26
+b(URL)h(to)h(a)g(FITS)e(\014le)h(on)g(the)227 4183 y(W)-8
+b(eb)31 b(ma)m(y)g(b)s(e)f(op)s(ened)g(with)f(read-only)g(access.)136
+4368 y Fc(\017)46 b Fe(root://legacy.gsfc.nasa.g)o(ov/t)o(est/)o(vel)o
+(a.fi)o(ts)p Fj(:)e(similar)33 b(to)j(ftp)f(access)i(except)f(that)g
+(it)f(pro-)227 4481 y(vides)29 b(write)h(as)g(w)m(ell)f(as)i(read)f
+(access)h(to)g(the)f(\014les)g(across)g(the)h(net)m(w)m(ork.)41
+b(This)28 b(uses)i(the)h(ro)s(ot)f(proto)s(col)227 4594
+y(dev)m(elop)s(ed)g(at)h(CERN.)136 4779 y Fc(\017)46
+b Fe(shmem://h2[events])p Fj(:)j(op)s(ens)36 b(the)i(FITS)e(\014le)g
+(in)g(a)h(shared)f(memory)h(segmen)m(t)h(and)f(mo)m(v)m(es)h(to)g(the)
+227 4892 y(EVENTS)30 b(extension.)136 5077 y Fc(\017)46
+b Fe(mem://)p Fj(:)65 b(creates)44 b(a)g(scratc)m(h)g(output)f(\014le)f
+(in)g(core)i(computer)f(memory)-8 b(.)79 b(The)43 b(resulting)e
+('\014le')i(will)227 5190 y(disapp)s(ear)24 b(when)g(the)i(program)f
+(exits,)h(so)g(this)e(is)h(mainly)e(useful)h(for)h(testing)h(purp)s
+(oses)d(when)i(one)g(do)s(es)227 5303 y(not)31 b(w)m(an)m(t)g(a)g(p)s
+(ermanen)m(t)f(cop)m(y)h(of)f(the)h(output)f(\014le.)136
+5488 y Fc(\017)46 b Fe(myfile.fits[3;)e(Images\(10\)])p
+Fj(:)c(op)s(ens)30 b(a)i(cop)m(y)g(of)g(the)g(image)f(con)m(tained)h
+(in)e(the)i(10th)g(ro)m(w)f(of)h(the)227 5601 y('Images')38
+b(column)e(in)g(the)h(binary)e(table)i(in)e(the)i(3th)g(extension)g(of)
+g(the)g(FITS)f(\014le.)59 b(The)37 b(virtual)e(\014le)227
+5714 y(that)c(is)f(op)s(ened)f(b)m(y)i(the)f(application)f(just)h(con)m
+(tains)g(this)f(single)g(image)i(in)e(the)i(primary)d(arra)m(y)-8
+b(.)p eop
+%%Page: 107 115
+107 114 bop 0 299 a Fh(10.1.)73 b(O)m(VER)-10 b(VIEW)2995
+b Fj(107)136 555 y Fc(\017)46 b Fe(myfile.fits[1:512:2,)d(1:512:2])p
+Fj(:)c(op)s(ens)30 b(a)h(section)g(of)h(the)f(input)e(image)i(ranging)f
+(from)g(the)h(1st)227 668 y(to)k(the)f(512th)h(pixel)d(in)h(X)h(and)g
+(Y,)g(and)f(selects)i(ev)m(ery)f(second)g(pixel)f(in)f(b)s(oth)h
+(dimensions,)g(resulting)227 781 y(in)c(a)i(256)h(x)e(256)i(pixel)c
+(input)h(image)h(in)g(this)f(case.)136 981 y Fc(\017)46
+b Fe(myfile.fits[EVENTS][col)c(Rad)47 b(=)g(sqrt\(X**2)e(+)j(Y**2\)])p
+Fj(:)36 b(creates)27 b(and)d(op)s(ens)h(a)g(virtual)f(\014le)g(on)227
+1094 y(the)i(\015y)f(that)i(is)e(iden)m(tical)f(to)j(m)m
+(y\014le.\014ts)e(except)h(that)h(it)e(will)e(con)m(tain)j(a)g(new)g
+(column)e(in)h(the)h(EVENTS)227 1207 y(extension)40 b(called)g('Rad')h
+(whose)f(v)-5 b(alue)40 b(is)g(computed)g(using)g(the)g(indicated)f
+(expression)h(whic)m(h)f(is)h(a)227 1320 y(function)29
+b(of)i(the)f(v)-5 b(alues)30 b(in)f(the)i(X)f(and)g(Y)h(columns.)136
+1520 y Fc(\017)46 b Fe(myfile.fits[EVENTS][PHA)c(>)47
+b(5])p Fj(:)41 b(creates)33 b(and)d(op)s(ens)g(a)i(virtual)d(FITS)h
+(\014les)g(that)h(is)f(iden)m(tical)g(to)227 1633 y('m)m
+(y\014le.\014ts')39 b(except)i(that)f(the)f(EVENTS)g(table)g(will)e
+(only)h(con)m(tain)i(the)f(ro)m(ws)h(that)g(ha)m(v)m(e)g(v)-5
+b(alues)39 b(of)227 1746 y(the)34 b(PHA)g(column)f(greater)i(than)e(5.)
+52 b(In)33 b(general,)i(an)m(y)f(arbitrary)f(b)s(o)s(olean)f
+(expression)h(using)f(a)j(C)e(or)227 1859 y(F)-8 b(ortran-lik)m(e)29
+b(syn)m(tax,)g(whic)m(h)e(ma)m(y)i(com)m(bine)f(AND)h(and)f(OR)f(op)s
+(erators,)i(ma)m(y)g(b)s(e)f(used)f(to)i(select)g(ro)m(ws)227
+1972 y(from)h(a)h(table.)136 2172 y Fc(\017)46 b Fe
+(myfile.fits[EVENTS][bin)c(\(X,Y\)=1,2048,4])p Fj(:)34
+b(creates)26 b(a)g(temp)s(orary)f(FITS)g(primary)e(arra)m(y)j(im-)227
+2285 y(age)38 b(whic)m(h)d(is)h(computed)g(on)g(the)h(\015y)f(b)m(y)g
+(binning)d(\(i.e,)39 b(computing)c(the)i(2-dimensional)d(histogram\))
+227 2398 y(of)g(the)f(v)-5 b(alues)33 b(in)f(the)i(X)g(and)e(Y)i
+(columns)e(of)i(the)f(EVENTS)g(extension.)49 b(In)33
+b(this)f(case)j(the)e(X)h(and)f(Y)227 2511 y(co)s(ordinates)g(range)h
+(from)f(1)h(to)g(2048)h(and)e(the)h(image)f(pixel)f(size)h(is)g(4)g
+(units)f(in)g(b)s(oth)h(dimensions,)f(so)227 2624 y(the)f(resulting)d
+(image)j(is)e(512)j(x)e(512)i(pixels)d(in)g(size.)136
+2824 y Fc(\017)46 b Fj(The)31 b(\014nal)f(example)i(com)m(bines)f(man)m
+(y)g(of)h(these)g(feature)g(in)m(to)f(one)h(complex)f(expression)f
+(\(it)i(is)e(brok)m(en)227 2937 y(in)m(to)h(sev)m(eral)f(lines)f(for)h
+(clarit)m(y\):)370 3206 y Fe(ftp://legacy.gsfc.nasa.gov)o(/dat)o(a/s)o
+(ampl)o(e.fi)o(ts.)o(gz[E)o(VENT)o(S])370 3319 y([col)47
+b(phacorr)f(=)h(pha)g(*)h(1.1)f(-)g(0.3][phacorr)e(>=)i(5.0)g(&&)g
+(phacorr)f(<=)h(14.0])370 3432 y([bin)g(\(X,Y\)=32])227
+3701 y Fj(In)37 b(this)g(case,)k(CFITSIO)36 b(\(1\))j(copies)f(and)f
+(uncompresses)g(the)h(FITS)f(\014le)g(from)g(the)h(ftp)f(site)h(on)g
+(the)227 3814 y(legacy)f(mac)m(hine,)h(\(2\))f(mo)m(v)m(es)g(to)g(the)g
+('EVENTS')f(extension,)h(\(3\))g(calculates)g(a)f(new)g(column)f
+(called)227 3927 y('phacorr',)30 b(\(4\))f(selects)g(the)g(ro)m(ws)g
+(in)e(the)i(table)g(that)g(ha)m(v)m(e)h(phacorr)e(in)f(the)i(range)g(5)
+g(to)h(14,)g(and)e(\014nally)227 4040 y(\(5\))35 b(bins)c(the)i
+(remaining)e(ro)m(ws)i(on)h(the)f(X)g(and)g(Y)g(column)f(co)s
+(ordinates,)i(using)d(a)j(pixel)d(size)i(=)g(32)h(to)227
+4153 y(create)d(a)f(2D)g(image.)41 b(All)28 b(this)g(pro)s(cessing)g
+(is)h(completely)g(transparen)m(t)g(to)i(the)e(application)f(program,)
+227 4266 y(whic)m(h)h(simply)f(sees)j(the)g(\014nal)e(2-D)i(image)g(in)
+e(the)h(primary)f(arra)m(y)i(of)f(the)h(op)s(ened)f(\014le.)0
+4538 y(The)c(full)f(extended)i(CFITSIO)e(FITS)h(\014le)g(name)h(can)g
+(con)m(tain)g(sev)m(eral)g(di\013eren)m(t)g(comp)s(onen)m(ts)g(dep)s
+(ending)d(on)0 4651 y(the)31 b(con)m(text.)42 b(These)30
+b(comp)s(onen)m(ts)h(are)g(describ)s(ed)d(in)h(the)h(follo)m(wing)f
+(sections:)0 4924 y Fe(When)47 b(creating)e(a)j(new)f(file:)143
+5036 y(filetype://BaseFilename\(t)o(empl)o(ate)o(Name)o(\)[co)o(mpr)o
+(ess])0 5262 y(When)g(opening)e(an)j(existing)d(primary)h(array)g(or)i
+(image)e(HDU:)143 5375 y(filetype://BaseFilename\(o)o(utNa)o(me\))o
+([HDU)o(loca)o(tio)o(n][I)o(mage)o(Sec)o(tion)o(])0 5601
+y(When)h(opening)e(an)j(existing)d(table)i(HDU:)143 5714
+y(filetype://BaseFilename\(o)o(utNa)o(me\))o([HDU)o(loca)o(tio)o(n][c)o
+(olFi)o(lte)o(r][r)o(owFi)o(lte)o(r][b)o(inSp)o(ec])p
+eop
+%%Page: 108 116
+108 115 bop 0 299 a Fj(108)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(The)41
+b(\014let)m(yp)s(e,)j(BaseFilename,)h(outName,)g(HDUlo)s(cation,)g(and)
+c(ImageSection)h(comp)s(onen)m(ts,)j(if)c(presen)m(t,)0
+668 y(m)m(ust)30 b(b)s(e)g(giv)m(en)h(in)e(that)i(order,)g(but)f(the)g
+(colFilter,)g(ro)m(wFilter,)h(and)e(binSp)s(ec)g(sp)s(eci\014ers)f(ma)m
+(y)k(follo)m(w)d(in)h(an)m(y)0 781 y(order.)39 b(Regardless)28
+b(of)h(the)f(order,)g(ho)m(w)m(ev)m(er,)i(the)f(colFilter)e(sp)s
+(eci\014er,)g(if)g(presen)m(t,)i(will)d(b)s(e)h(pro)s(cessed)h(\014rst)
+f(b)m(y)0 894 y(CFITSIO,)i(follo)m(w)m(ed)h(b)m(y)g(the)h(ro)m(wFilter)
+f(sp)s(eci\014er,)f(and)g(\014nally)g(b)m(y)h(the)g(binSp)s(ec)e(sp)s
+(eci\014er.)0 1221 y Ff(10.2)136 b(Filet)l(yp)t(e)0 1471
+y Fj(The)37 b(t)m(yp)s(e)g(of)g(\014le)f(determines)g(the)h(medium)e
+(on)i(whic)m(h)f(the)h(\014le)f(is)h(lo)s(cated)g(\(e.g.,)j(disk)c(or)h
+(net)m(w)m(ork\))h(and,)0 1584 y(hence,)f(whic)m(h)d(in)m(ternal)g
+(device)h(driv)m(er)f(is)g(used)g(b)m(y)h(CFITSIO)f(to)i(read)f(and/or)
+g(write)f(the)h(\014le.)55 b(Curren)m(tly)0 1697 y(supp)s(orted)29
+b(t)m(yp)s(es)h(are)382 1913 y Fe(file://)93 b(-)48 b(file)e(on)i
+(local)e(magnetic)g(disk)g(\(default\))382 2026 y(ftp://)141
+b(-)48 b(a)f(readonly)f(file)g(accessed)g(with)h(the)g(anonymous)e(FTP)
+i(protocol.)907 2139 y(It)g(also)g(supports)93 b
+(ftp://username:password@)o(host)o(nam)o(e/..)o(.)907
+2252 y(for)47 b(accessing)e(password-protected)e(ftp)k(sites.)382
+2365 y(http://)93 b(-)48 b(a)f(readonly)f(file)g(accessed)g(with)h(the)
+g(HTTP)f(protocol.)93 b(It)907 2478 y(does)46 b(not)95
+b(support)46 b(username:password)d(like)k(the)g(ftp)f(driver.)907
+2591 y(Proxy)g(HTTP)h(survers)f(are)h(supported)e(using)h(the)h
+(http_proxy)907 2704 y(environment)e(variable.)382 2817
+y(root://)93 b(-)48 b(uses)e(the)h(CERN)g(root)g(protocol)e(for)i
+(writing)f(as)h(well)g(as)907 2930 y(reading)f(files)g(over)h(the)g
+(network.)382 3042 y(shmem://)e(-)j(opens)e(or)h(creates)f(a)i(file)e
+(which)h(persists)e(in)i(the)g(computer's)907 3155 y(shared)f(memory.)
+382 3268 y(mem://)141 b(-)48 b(opens)e(a)i(temporary)d(file)i(in)g
+(core)f(memory.)94 b(The)47 b(file)907 3381 y(disappears)e(when)h(the)h
+(program)f(exits)h(so)g(this)f(is)i(mainly)907 3494 y(useful)e(for)h
+(test)f(purposes)g(when)h(a)g(permanent)e(output)h(file)907
+3607 y(is)h(not)g(desired.)0 3824 y Fj(If)35 b(the)h(\014let)m(yp)s(e)f
+(is)f(not)i(sp)s(eci\014ed,)g(then)f(t)m(yp)s(e)h(\014le://)g(is)e
+(assumed.)56 b(The)35 b(double)f(slashes)h('//')i(are)f(optional)0
+3937 y(and)30 b(ma)m(y)h(b)s(e)e(omitted)i(in)e(most)i(cases.)0
+4220 y Fd(10.2.1)113 b(Notes)36 b(ab)s(out)j(HTTP)d(pro)m(xy)i(serv)m
+(ers)0 4439 y Fj(A)32 b(pro)m(xy)g(HTTP)f(serv)m(er)h(ma)m(y)h(b)s(e)e
+(used)g(b)m(y)h(de\014ning)e(the)i(address)f(\(URL\))i(and)e(p)s(ort)g
+(n)m(um)m(b)s(er)g(of)h(the)g(pro)m(xy)0 4552 y(serv)m(er)f(with)e(the)
+h(h)m(ttp)p 801 4552 28 4 v 33 w(pro)m(xy)g(en)m(vironmen)m(t)g(v)-5
+b(ariable.)40 b(F)-8 b(or)31 b(example)191 4769 y Fe(setenv)46
+b(http_proxy)f(http://heasarc.gsfc.nasa)o(.gov)o(:312)o(8)0
+4985 y Fj(will)35 b(cause)j(CFITSIO)f(to)h(use)g(p)s(ort)f(3128)i(on)f
+(the)g(heasarc)g(pro)m(xy)g(serv)m(er)g(whenev)m(er)g(reading)f(a)h
+(FITS)f(\014le)0 5098 y(with)29 b(HTTP)-8 b(.)0 5382
+y Fd(10.2.2)113 b(Notes)36 b(ab)s(out)j(the)e(ro)s(ot)g(\014let)m(yp)s
+(e)0 5601 y Fj(The)20 b(original)g(ro)s(otd)g(serv)m(er)h(can)h(b)s(e)e
+(obtained)g(from:)36 b Fe(ftp://root.cern.ch/root)o(/roo)o(td.t)o(ar.)o
+(gz)15 b Fj(but,)22 b(for)0 5714 y(it)32 b(to)i(w)m(ork)f(correctly)g
+(with)e(CFITSIO)h(one)h(has)f(to)i(use)e(a)i(mo)s(di\014ed)c(v)m
+(ersion)j(whic)m(h)e(supp)s(orts)g(a)i(command)p eop
+%%Page: 109 117
+109 116 bop 0 299 a Fh(10.2.)73 b(FILETYPE)3037 b Fj(109)0
+555 y(to)41 b(return)d(the)j(length)e(of)h(the)g(\014le.)69
+b(This)38 b(mo)s(di\014ed)f(v)m(ersion)j(is)f(a)m(v)-5
+b(ailable)39 b(in)g(ro)s(otd)g(sub)s(directory)f(in)h(the)0
+668 y(CFITSIO)29 b(ftp)h(area)h(at)286 928 y Fe
+(ftp://legacy.gsfc.nasa.gov)o(/so)o(ftwa)o(re/f)o(its)o(io/c)o(/roo)o
+(t/r)o(ootd)o(.tar)o(.gz)o(.)0 1187 y Fj(This)i(small)f(serv)m(er)j(is)
+f(started)g(either)g(b)m(y)h(inetd)e(when)g(a)i(clien)m(t)f(requests)g
+(a)h(connection)g(to)g(a)f(ro)s(otd)h(serv)m(er)0 1300
+y(or)30 b(b)m(y)g(hand)f(\(i.e.)41 b(from)30 b(the)g(command)g(line\).)
+40 b(The)29 b(ro)s(otd)h(serv)m(er)h(w)m(orks)f(with)f(the)h(R)m(OOT)g
+(TNetFile)g(class.)0 1413 y(It)g(allo)m(ws)e(remote)j(access)f(to)h(R)m
+(OOT)e(database)h(\014les)e(in)g(either)h(read)h(or)f(write)g(mo)s(de.)
+40 b(By)30 b(default)e(TNetFile)0 1526 y(assumes)38 b(p)s(ort)g(432)h
+(\(whic)m(h)e(requires)g(ro)s(otd)h(to)h(b)s(e)f(started)h(as)f(ro)s
+(ot\).)65 b(T)-8 b(o)39 b(run)e(ro)s(otd)h(via)g(inetd)f(add)h(the)0
+1639 y(follo)m(wing)29 b(line)g(to)i(/etc/services:)95
+1898 y Fe(rootd)238 b(432/tcp)0 2158 y Fj(and)30 b(to)h
+(/etc/inetd.conf,)h(add)e(the)g(follo)m(wing)f(line:)95
+2417 y Fe(rootd)47 b(stream)f(tcp)h(nowait)f(root)h
+(/user/rdm/root/bin/root)o(d)42 b(rootd)k(-i)0 2677 y
+Fj(F)-8 b(orce)30 b(inetd)d(to)i(reread)f(its)g(conf)g(\014le)f(with)g
+Fe(kill)47 b(-HUP)g(<pid)f(inetd>)p Fj(.)39 b(Y)-8 b(ou)28
+b(can)h(also)f(start)h(ro)s(otd)f(b)m(y)g(hand)0 2790
+y(running)34 b(directly)h(under)f(y)m(our)j(priv)-5 b(ate)36
+b(accoun)m(t)h(\(no)g(ro)s(ot)g(system)f(privileges)e(needed\).)59
+b(F)-8 b(or)37 b(example)f(to)0 2903 y(start)f(ro)s(otd)g(listening)d
+(on)j(p)s(ort)f(5151)j(just)d(t)m(yp)s(e:)49 b Fe(rootd)e(-p)g(5151)33
+b Fj(Notice)j(that)g(no)e(&)h(is)e(needed.)54 b(Ro)s(otd)0
+3016 y(will)28 b(go)j(in)m(to)f(bac)m(kground)g(b)m(y)h(itself.)95
+3275 y Fe(Rootd)47 b(arguments:)191 3388 y(-i)763 b(says)47
+b(we)g(were)f(started)g(by)h(inetd)191 3501 y(-p)g(port#)476
+b(specifies)45 b(a)j(different)d(port)i(to)g(listen)f(on)191
+3614 y(-d)h(level)476 b(level)46 b(of)i(debug)e(info)h(written)e(to)j
+(syslog)1050 3727 y(0)f(=)h(no)f(debug)f(\(default\))1050
+3840 y(1)h(=)h(minimum)1050 3953 y(2)f(=)h(medium)1050
+4066 y(3)f(=)h(maximum)0 4325 y Fj(Ro)s(otd)29 b(can)f(also)g(b)s(e)g
+(con\014gured)g(for)g(anon)m(ymous)g(usage)h(\(lik)m(e)f(anon)m(ymous)g
+(ftp\).)40 b(T)-8 b(o)29 b(setup)f(ro)s(otd)g(to)h(accept)0
+4438 y(anon)m(ymous)h(logins)f(do)i(the)f(follo)m(wing)f(\(while)g(b)s
+(eing)g(logged)i(in)e(as)h(ro)s(ot\):)143 4698 y Fe(-)48
+b(Add)f(the)f(following)g(line)g(to)i(/etc/passwd:)239
+4924 y(rootd:*:71:72:Anonymous)41 b(rootd:/var/spool/rootd:/b)o(in/)o
+(fals)o(e)239 5149 y(where)46 b(you)h(may)g(modify)f(the)h(uid,)f(gid)h
+(\(71,)g(72\))g(and)g(the)g(home)f(directory)239 5262
+y(to)h(suite)f(your)h(system.)143 5488 y(-)h(Add)f(the)f(following)g
+(line)g(to)i(/etc/group:)239 5714 y(rootd:*:72:rootd)p
 eop
-%%Page: 119 125
-119 124 bop 0 299 a Fh(8.5.)72 b(SPECIALIZED)29 b(FITS)g(PRIMAR)-8
-b(Y)31 b(ARRA)-8 b(Y)32 b(OR)d(IMA)m(GE)j(EXTENSION)d(I/O)h(R)m
-(OUTINES)80 b Fj(119)0 555 y(the)32 b(pixel)e(o\013set)i(in)e(the)i
-(1-D)h(arra)m(y)f(that)g(corresp)s(onds)e(to)i(an)m(y)g(particular)e
-(X,)i(Y)f(co)s(ordinate)h(in)e(the)h(image.)0 668 y(C)25
-b(programmers)h(should)e(note)i(that)g(the)h(ordering)d(of)i(arra)m(ys)
-g(in)f(FITS)g(\014les,)h(and)f(hence)h(in)f(all)f(the)i(CFITSIO)0
-781 y(calls,)38 b(is)e(more)h(similar)e(to)i(the)h(dimensionalit)m(y)c
-(of)j(arra)m(ys)g(in)f(F)-8 b(ortran)38 b(rather)f(than)f(C.)h(F)-8
-b(or)38 b(instance)f(if)f(a)0 894 y(FITS)28 b(image)h(has)f(NAXIS1)h(=)
-f(100)i(and)e(NAXIS2)h(=)f(50,)i(then)e(a)h(2-D)h(arra)m(y)f(just)f
-(large)h(enough)f(to)i(hold)d(the)0 1007 y(image)k(should)d(b)s(e)i
-(declared)g(as)g(arra)m(y[50][100])k(and)c(not)h(as)f(arra)m
-(y[100][50].)0 1167 y(F)-8 b(or)36 b(con)m(v)m(enience,)h(higher-lev)m
-(el)d(routines)g(are)h(also)g(pro)m(vided)f(to)h(sp)s(eci\014cly)e
-(deal)i(with)f(2D)h(images)g(\(\013p2d)p 3872 1167 28
-4 v 0 1280 a(and)26 b(\013g2d)p 372 1280 V 33 w(\))h(and)f(3D)i(data)f
-(cub)s(es)f(\(\013p3d)p 1467 1280 V 59 w(and)g(\013g3d)p
-1893 1280 V 33 w(\).)40 b(The)26 b(dimensionalit)m(y)e(of)j(the)g(FITS)
-f(image)h(is)e(passed)0 1393 y(b)m(y)36 b(the)h(naxis1,)g(naxis2,)h
-(and)e(naxis3)g(parameters)g(and)g(the)h(declared)e(dimensions)f(of)j
-(the)f(program)g(arra)m(y)0 1506 y(are)30 b(passed)g(in)e(the)i(dim1)f
-(and)g(dim2)g(parameters.)41 b(Note)31 b(that)f(the)g(dimensions)d(of)j
-(the)g(program)g(arra)m(y)g(ma)m(y)0 1619 y(b)s(e)35
-b(larger)g(than)g(the)h(dimensions)d(of)j(the)g(FITS)e(arra)m(y)-8
-b(.)58 b(F)-8 b(or)36 b(example)f(if)g(a)h(FITS)e(image)i(with)e
-(NAXIS1)i(=)0 1732 y(NAXIS2)g(=)g(400)h(is)e(read)h(in)m(to)g(a)h
-(program)f(arra)m(y)g(whic)m(h)f(is)g(dimensioned)e(as)k(512)g(x)f(512)
-h(pixels,)f(then)g(the)0 1844 y(image)f(will)d(just)i(\014ll)e(the)j
-(lo)m(w)m(er)g(left)f(corner)g(of)h(the)g(arra)m(y)g(with)e(pixels)g
-(in)g(the)i(range)g(1)g(-)g(400)g(in)f(the)g(X)h(an)0
-1957 y(Y)g(directions.)52 b(This)33 b(has)i(the)g(e\013ect)h(of)f
-(taking)f(a)i(con)m(tiguous)e(set)i(of)f(pixel)e(v)-5
-b(alue)34 b(in)f(the)i(FITS)f(arra)m(y)i(and)0 2070 y(writing)28
-b(them)i(to)h(a)f(non-con)m(tiguous)g(arra)m(y)h(in)d(program)i(memory)
-g(\(i.e.,)h(there)f(are)h(no)m(w)f(some)g(blank)f(pixels)0
-2183 y(around)g(the)i(edge)g(of)g(the)f(image)h(in)e(the)h(program)g
-(arra)m(y\).)0 2343 y(The)k(most)i(general)e(set)i(of)f(routines)e
-(\(\013pss)p 1560 2343 V 33 w(,)j(\013gsv)p 1836 2343
-V 33 w(,)g(and)e(\013gsf)p 2273 2343 V 33 w(\))h(ma)m(y)h(b)s(e)e(used)
-g(to)h(transfer)g(a)g(rectangular)0 2456 y(subset)27
-b(of)h(the)g(pixels)d(in)i(a)h(FITS)f(N-dimensional)e(image)j(to)g(or)g
-(from)f(an)g(arra)m(y)i(whic)m(h)d(has)h(b)s(een)g(declared)g(in)0
-2569 y(the)i(calling)e(program.)40 b(The)28 b(fpixel)f(and)h(lpixel)e
-(parameters)j(are)g(in)m(teger)g(arra)m(ys)g(whic)m(h)e(sp)s(ecify)g
-(the)i(starting)0 2682 y(and)k(ending)e(pixel)h(co)s(ordinate)h(in)f
-(eac)m(h)i(dimension)d(\(starting)i(with)f(1,)i(not)g(0\))g(of)f(the)g
-(FITS)g(image)g(that)h(is)0 2795 y(to)f(b)s(e)e(read)g(or)h(written.)44
-b(It)32 b(is)f(imp)s(ortan)m(t)g(to)i(note)f(that)h(these)f(are)g(the)g
-(starting)g(and)f(ending)f(pixels)g(in)h(the)0 2908 y(FITS)j(image,)j
-(not)e(in)e(the)i(declared)g(arra)m(y)g(in)e(the)i(program.)54
-b(The)35 b(arra)m(y)g(parameter)g(in)f(these)h(routines)f(is)0
-3021 y(treated)i(simply)d(as)i(a)g(large)h(one-dimensional)d(arra)m(y)i
-(of)g(the)h(appropriate)e(datat)m(yp)s(e)i(con)m(taining)e(the)i(pixel)
-0 3134 y(v)-5 b(alues;)36 b(The)e(pixel)f(v)-5 b(alues)34
-b(in)g(the)g(FITS)g(arra)m(y)h(are)g(read/written)f(from/to)i(this)d
-(program)i(arra)m(y)g(in)e(strict)0 3247 y(sequence)e(without)e(an)m(y)
-i(gaps;)g(it)f(is)f(up)g(to)j(the)e(calling)f(routine)g(to)j(correctly)
-e(in)m(terpret)g(the)h(dimensionalit)m(y)0 3360 y(of)d(this)e(arra)m(y)
--8 b(.)41 b(The)27 b(t)m(w)m(o)i(FITS)e(reading)g(routines)f(\(\013gsv)
-p 2018 3360 V 61 w(and)h(\013gsf)p 2415 3360 V 61 w(\))h(also)f(ha)m(v)
-m(e)i(an)f(`inc')f(parameter)h(whic)m(h)0 3472 y(de\014nes)33
-b(the)h(data)h(sampling)d(in)m(terv)-5 b(al)34 b(in)e(eac)m(h)k
-(dimension)31 b(of)j(the)h(FITS)e(arra)m(y)-8 b(.)53
-b(F)-8 b(or)35 b(example,)g(if)e(inc[0]=2)0 3585 y(and)j(inc[1]=3)i
-(when)e(reading)g(a)h(2-dimensional)e(FITS)h(image,)k(then)c(only)g(ev)
-m(ery)i(other)f(pixel)f(in)f(the)j(\014rst)0 3698 y(dimension)28
-b(and)i(ev)m(ery)h(3rd)f(pixel)e(in)h(the)i(second)f(dimension)e(will)g
-(b)s(e)i(returned)f(to)i(the)f('arra)m(y')i(parameter.)0
-3858 y(Tw)m(o)d(t)m(yp)s(es)h(of)f(routines)f(are)i(pro)m(vided)d(to)j
-(read)f(the)h(data)g(arra)m(y)f(whic)m(h)f(di\013er)g(in)g(the)i(w)m(a)
-m(y)g(unde\014ned)d(pixels)0 3971 y(are)38 b(handled.)59
-b(The)37 b(\014rst)g(t)m(yp)s(e)g(of)g(routines)g(\(e.g.,)j(\013gp)m(v)
-p 2059 3971 V 34 w(\))d(simply)e(return)h(an)h(arra)m(y)h(of)g(data)g
-(elemen)m(ts)f(in)0 4084 y(whic)m(h)29 b(unde\014ned)g(pixels)f(are)j
-(set)g(equal)f(to)i(a)f(v)-5 b(alue)30 b(sp)s(eci\014ed)e(b)m(y)j(the)g
-(user)e(in)h(the)g(`n)m(ulv)-5 b(al')30 b(parameter.)41
-b(An)0 4197 y(additional)27 b(feature)i(of)g(these)h(routines)d(is)h
-(that)i(if)e(the)h(user)f(sets)h(n)m(ulv)-5 b(al)27 b(=)i(0,)h(then)e
-(no)h(c)m(hec)m(ks)h(for)f(unde\014ned)0 4310 y(pixels)23
-b(will)f(b)s(e)j(p)s(erformed,)f(th)m(us)h(reducing)e(the)i(amoun)m(t)h
-(of)f(CPU)f(pro)s(cessing.)38 b(The)24 b(second)h(t)m(yp)s(e)g(of)g
-(routines)0 4423 y(\(e.g.,)37 b(\013gpf)p 414 4423 V
-33 w(\))e(returns)e(the)h(data)h(elemen)m(t)g(arra)m(y)g(and,)g(in)e
-(addition,)h(a)h(c)m(har)g(arra)m(y)g(whic)m(h)e(de\014nes)h(whether)0
-4536 y(the)26 b(corresp)s(onding)e(data)i(pixel)e(is)h(de\014ned)f(\(=)
-i(1\))g(or)g(not)g(\(=)g(0\).)40 b(The)25 b(latter)h(t)m(yp)s(e)g(of)g
-(routines)e(ma)m(y)j(b)s(e)e(more)0 4649 y(con)m(v)m(enien)m(t)32
-b(to)h(use)e(in)f(some)h(circumstances,)h(ho)m(w)m(ev)m(er,)h(it)e
-(requires)f(an)h(additional)e(arra)m(y)j(of)g(logical)f(v)-5
-b(alues)0 4762 y(whic)m(h)29 b(can)i(b)s(e)f(un)m(wieldy)d(when)j(w)m
-(orking)f(with)g(large)i(data)g(arra)m(ys.)0 5004 y Fi(1)81
-b Fj(W)-8 b(rite)30 b(elemen)m(ts)h(in)m(to)f(the)h(FITS)f(data)h(arra)
-m(y)-8 b(.)95 5246 y Ff(int)47 b(fits_write_img)d(/)k(ffppr)286
-5359 y(\(fitsfile)e(*fptr,)g(int)h(datatype,)e(long)i(firstelem,)e
-(long)h(nelements,)334 5472 y(DTYPE)g(*array,)g(int)h(*status\);)0
-5714 y Fi(2)81 b Fj(W)-8 b(rite)33 b(elemen)m(ts)g(in)m(to)g(the)g
-(data)h(arra)m(y)-8 b(.)49 b(The)32 b(datat)m(yp)s(e)i(is)e(sp)s
-(eci\014ed)f(b)m(y)i(the)g(su\016x)f(of)h(the)g(name)g(of)g(the)p
+%%Page: 110 118
+110 117 bop 0 299 a Fj(110)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)239 668 y
+Fe(where)46 b(the)h(gid)g(must)f(match)h(the)g(gid)g(in)g(/etc/passwd.)
+143 894 y(-)h(Create)e(the)h(directories:)239 1120 y(mkdir)f
+(/var/spool/rootd)239 1233 y(mkdir)g(/var/spool/rootd/tmp)239
+1346 y(chmod)g(777)h(/var/spool/rootd/tmp)239 1571 y(Where)f
+(/var/spool/rootd)d(must)k(match)f(the)h(rootd)g(home)f(directory)g(as)
+239 1684 y(specified)f(in)i(the)g(rootd)f(/etc/passwd)f(entry.)143
+1910 y(-)j(To)f(make)f(writeable)g(directories)e(for)j(anonymous)f(do,)
+h(for)f(example:)239 2136 y(mkdir)g(/var/spool/rootd/pub)239
+2249 y(chown)g(rootd:rootd)f(/var/spool/rootd/pub)0 2492
+y Fj(That's)d(all.)74 b(Sev)m(eral)42 b(additional)e(remarks:)64
+b(y)m(ou)42 b(can)g(login)f(to)i(an)f(anon)m(ymous)f(serv)m(er)i
+(either)e(with)g(the)0 2605 y(names)31 b("anon)m(ymous")h(or)f("ro)s
+(otd".)43 b(The)31 b(passw)m(ord)f(should)f(b)s(e)i(of)g(t)m(yp)s(e)g
+(user@host.do.main.)42 b(Only)29 b(the)i(@)0 2718 y(is)d(enforced)g
+(for)h(the)f(time)h(b)s(eing.)38 b(In)28 b(anon)m(ymous)h(mo)s(de)f
+(the)g(top)h(of)g(the)g(\014le)e(tree)j(is)d(set)i(to)h(the)e(ro)s(otd)
+h(home)0 2831 y(directory)-8 b(,)38 b(therefore)f(only)e(\014les)h(b)s
+(elo)m(w)f(the)i(home)f(directory)g(can)g(b)s(e)g(accessed.)60
+b(Anon)m(ymous)36 b(mo)s(de)g(only)0 2944 y(w)m(orks)30
+b(when)g(the)g(serv)m(er)h(is)e(started)i(via)f(inetd.)0
+3232 y Fd(10.2.3)113 b(Notes)36 b(ab)s(out)j(the)e(shmem)g(\014let)m
+(yp)s(e:)0 3451 y Fj(Shared)d(memory)h(\014les)f(are)h(curren)m(tly)f
+(supp)s(orted)f(on)i(most)h(Unix)e(platforms,)h(where)g(the)g(shared)f
+(memory)0 3564 y(segmen)m(ts)d(are)g(managed)g(b)m(y)f(the)g(op)s
+(erating)g(system)h(k)m(ernel)e(and)h(`liv)m(e')g(indep)s(enden)m(tly)d
+(of)k(pro)s(cesses.)40 b(They)0 3677 y(are)34 b(not)g(deleted)g(\(b)m
+(y)g(default\))f(when)g(the)h(pro)s(cess)f(whic)m(h)g(created)i(them)f
+(terminates,)g(although)g(they)g(will)0 3790 y(disapp)s(ear)d(if)h(the)
+i(system)f(is)f(reb)s(o)s(oted.)49 b(Applications)31
+b(can)j(create)h(shared)d(memory)h(\014les)f(in)g(CFITSIO)g(b)m(y)0
+3903 y(calling:)143 4146 y Fe(fit_create_file\(&fitsfile)o(ptr,)41
+b("shmem://h2",)j(&status\);)0 4389 y Fj(where)25 b(the)g(ro)s(ot)h
+(`\014le')e(names)i(are)f(curren)m(tly)f(restricted)h(to)h(b)s(e)f
+('h0',)i('h1',)g('h2',)g('h3',)f(etc.,)i(up)d(to)g(a)h(maxim)m(um)0
+4502 y(n)m(um)m(b)s(er)20 b(de\014ned)f(b)m(y)i(the)g(the)g(v)-5
+b(alue)21 b(of)g(SHARED)p 1746 4502 28 4 v 33 w(MAXSEG)g(\(equal)g(to)g
+(16)h(b)m(y)f(default\).)37 b(This)19 b(is)h(a)h(protot)m(yp)s(e)0
+4615 y(implemen)m(tation)27 b(of)i(the)g(shared)f(memory)g(in)m
+(terface)h(and)f(a)h(more)g(robust)f(in)m(terface,)i(whic)m(h)d(will)f
+(ha)m(v)m(e)k(few)m(er)0 4728 y(restrictions)f(on)h(the)h(n)m(um)m(b)s
+(er)e(of)i(\014les)e(and)h(on)g(their)f(names,)i(ma)m(y)g(b)s(e)f(dev)m
+(elop)s(ed)f(in)g(the)i(future.)0 4888 y(When)23 b(op)s(ening)g(an)g
+(already)g(existing)g(FITS)g(\014le)g(in)f(shared)h(memory)h(one)g
+(calls)e(the)i(usual)f(CFITSIO)f(routine:)143 5132 y
+Fe(fits_open_file\(&fitsfilep)o(tr,)41 b("shmem://h7",)j(mode,)j
+(&status\))0 5375 y Fj(The)26 b(\014le)g(mo)s(de)h(can)g(b)s(e)f(READ)m
+(WRITE)h(or)g(READONL)-8 b(Y)28 b(just)e(as)h(with)e(disk)h(\014les.)38
+b(More)28 b(than)e(one)h(pro)s(cess)0 5488 y(can)35 b(op)s(erate)g(on)f
+(READONL)-8 b(Y)35 b(mo)s(de)f(\014les)g(at)h(the)f(same)h(time.)53
+b(CFITSIO)33 b(supp)s(orts)f(prop)s(er)h(\014le)h(lo)s(c)m(king)0
+5601 y(\(b)s(oth)27 b(in)g(READONL)-8 b(Y)29 b(and)e(READ)m(WRITE)h(mo)
+s(des\),)h(so)f(calls)f(to)h(\014ts)p 2572 5601 V 33
+w(op)s(en)p 2795 5601 V 32 w(\014le)f(ma)m(y)h(b)s(e)f(lo)s(c)m(k)m(ed)
+i(out)f(un)m(til)0 5714 y(another)j(other)f(pro)s(cess)g(closes)h(the)f
+(\014le.)p eop
+%%Page: 111 119
+111 118 bop 0 299 a Fh(10.3.)73 b(BASE)30 b(FILENAME)2739
+b Fj(111)0 555 y(When)30 b(an)g(application)f(is)g(\014nished)f
+(accessing)j(a)f(FITS)g(\014le)f(in)g(a)i(shared)e(memory)h(segmen)m
+(t,)i(it)e(ma)m(y)h(close)f(it)0 668 y(\(and)k(the)g(\014le)f(will)e
+(remain)h(in)h(the)h(system\))g(with)f(\014ts)p 1955
+668 28 4 v 32 w(close)p 2174 668 V 33 w(\014le,)h(or)g(delete)g(it)g
+(with)e(\014ts)p 3191 668 V 33 w(delete)p 3456 668 V
+33 w(\014le.)50 b(Ph)m(ys-)0 781 y(ical)34 b(deletion)g(is)g(p)s(ostp)s
+(oned)f(un)m(til)h(the)h(last)f(pro)s(cess)h(calls)f
+(\013clos/\013delt.)54 b(\014ts)p 2801 781 V 32 w(delete)p
+3065 781 V 33 w(\014le)34 b(tries)h(to)g(obtain)g(a)0
+894 y(READ)m(WRITE)f(lo)s(c)m(k)f(on)g(the)g(\014le)g(to)h(b)s(e)e
+(deleted,)i(th)m(us)f(it)g(can)g(b)s(e)g(blo)s(c)m(k)m(ed)g(if)f(the)i
+(ob)5 b(ject)34 b(w)m(as)f(not)h(op)s(ened)0 1007 y(in)29
+b(READ)m(WRITE)i(mo)s(de.)0 1167 y(A)i(shared)f(memory)h(managemen)m(t)
+h(utilit)m(y)d(program)i(called)f(`smem',)h(is)f(included)e(with)i(the)
+h(CFITSIO)e(dis-)0 1280 y(tribution.)37 b(It)27 b(can)g(b)s(e)f(built)f
+(b)m(y)i(t)m(yping)f(`mak)m(e)i(smem';)g(then)f(t)m(yp)s(e)g(`smem)f
+(-h')h(to)h(get)g(a)f(list)e(of)i(v)-5 b(alid)25 b(options.)0
+1393 y(Executing)36 b(smem)g(without)f(an)m(y)i(options)f(causes)g(it)g
+(to)h(list)e(all)g(the)i(shared)e(memory)i(segmen)m(ts)g(curren)m(tly)0
+1506 y(residing)31 b(in)h(the)h(system)h(and)e(managed)i(b)m(y)f(the)h
+(shared)e(memory)h(driv)m(er.)48 b(T)-8 b(o)34 b(get)g(a)g(list)e(of)h
+(all)f(the)i(shared)0 1619 y(memory)c(ob)5 b(jects,)32
+b(run)d(the)h(system)h(utilit)m(y)d(program)i(`ip)s(cs)g([-a]'.)0
+1978 y Ff(10.3)136 b(Base)45 b(Filename)0 2233 y Fj(The)31
+b(base)g(\014lename)g(is)f(the)i(name)f(of)h(the)f(\014le)g(optionally)
+e(including)f(the)k(director/sub)s(directory)d(path,)j(and)0
+2346 y(in)d(the)i(case)g(of)g(`ftp',)f(`h)m(ttp',)i(and)d(`ro)s(ot')j
+(\014let)m(yp)s(es,)d(the)i(mac)m(hine)f(iden)m(ti\014er.)39
+b(Examples:)191 2628 y Fe(myfile.fits)191 2741 y(!data.fits)191
+2854 y(/data/myfile.fits)191 2967 y(fits.gsfc.nasa.gov/ftp/s)o(ampl)o
+(eda)o(ta/m)o(yfil)o(e.f)o(its.)o(gz)0 3248 y Fj(When)29
+b(creating)g(a)g(new)f(output)h(\014le)f(on)h(magnetic)g(disk)e(\(of)j
+(t)m(yp)s(e)f(\014le://\))g(if)f(the)h(base)g(\014lename)f(b)s(egins)f
+(with)0 3361 y(an)34 b(exclamation)h(p)s(oin)m(t)e(\(!\))54
+b(then)34 b(an)m(y)g(existing)g(\014le)f(with)g(that)i(same)g(basename)
+g(will)d(b)s(e)h(deleted)h(prior)f(to)0 3474 y(creating)h(the)g(new)g
+(FITS)f(\014le.)50 b(Otherwise)33 b(if)g(the)h(\014le)f(to)h(b)s(e)g
+(created)h(already)e(exists,)i(then)e(CFITSIO)g(will)0
+3587 y(return)g(an)h(error)f(and)g(will)f(not)i(o)m(v)m(erwrite)g(the)g
+(existing)f(\014le.)51 b(Note)35 b(that)g(the)f(exclamation)g(p)s(oin)m
+(t,)g(')10 b(!',)36 b(is)d(a)0 3700 y(sp)s(ecial)26 b(UNIX)i(c)m
+(haracter,)j(so)d(if)e(it)i(is)f(used)g(on)g(the)h(command)g(line)e
+(rather)i(than)f(en)m(tered)h(at)h(a)f(task)h(prompt,)0
+3813 y(it)i(m)m(ust)g(b)s(e)g(preceded)g(b)m(y)h(a)g(bac)m(kslash)f(to)
+h(force)g(the)g(UNIX)g(shell)d(to)j(pass)f(it)h(v)m(erbatim)f(to)h(the)
+g(application)0 3926 y(program.)0 4086 y(If)24 b(the)i(output)e(disk)g
+(\014le)g(name)h(ends)f(with)f(the)i(su\016x)f('.gz',)k(then)d(CFITSIO)
+e(will)f(compress)j(the)g(\014le)f(using)g(the)0 4199
+y(gzip)g(compression)f(algorithm)g(b)s(efore)h(writing)e(it)i(to)h
+(disk.)37 b(This)22 b(can)j(reduce)f(the)g(amoun)m(t)h(of)f(disk)f
+(space)i(used)0 4312 y(b)m(y)34 b(the)h(\014le.)52 b(Note)36
+b(that)f(this)f(feature)h(requires)e(that)i(the)f(uncompressed)g
+(\014le)f(b)s(e)h(constructed)h(in)e(memory)0 4425 y(b)s(efore)d(it)g
+(is)f(compressed)h(and)g(written)g(to)h(disk,)e(so)h(it)g(can)h(fail)e
+(if)g(there)i(is)e(insu\016cien)m(t)g(a)m(v)-5 b(ailable)30
+b(memory)-8 b(.)0 4585 y(An)45 b(input)f(FITS)g(\014le)h(ma)m(y)h(b)s
+(e)f(compressed)g(with)g(the)g(gzip)g(or)h(Unix)e(compress)i
+(algorithms,)i(in)c(whic)m(h)0 4698 y(case)38 b(CFITSIO)e(will)f
+(uncompress)h(the)i(\014le)f(on)g(the)h(\015y)e(in)m(to)i(a)g(temp)s
+(orary)f(\014le)f(\(in)h(memory)g(or)g(on)h(disk\).)0
+4811 y(Compressed)32 b(\014les)h(ma)m(y)h(only)e(b)s(e)h(op)s(ened)f
+(with)g(read-only)h(p)s(ermission.)47 b(When)33 b(sp)s(ecifying)e(the)j
+(name)f(of)h(a)0 4924 y(compressed)h(FITS)g(\014le)g(it)g(is)g(not)h
+(necessary)g(to)g(app)s(end)e(the)i(\014le)f(su\016x)f(\(e.g.,)39
+b(`.gz')e(or)f(`.Z'\).)g(If)f(CFITSIO)0 5036 y(cannot)24
+b(\014nd)e(the)h(input)e(\014le)i(name)g(without)f(the)h(su\016x,)h
+(then)f(it)g(will)e(automatically)i(searc)m(h)h(for)f(a)g(compressed)0
+5149 y(\014le)35 b(with)f(the)i(same)g(ro)s(ot)g(name.)57
+b(In)35 b(the)h(case)h(of)f(reading)f(ftp)g(and)g(h)m(ttp)h(t)m(yp)s(e)
+g(\014les,)g(CFITSIO)f(generally)0 5262 y(lo)s(oks)i(for)h(a)g
+(compressed)g(v)m(ersion)f(of)h(the)g(\014le)f(\014rst,)i(b)s(efore)e
+(trying)g(to)i(op)s(en)e(the)h(uncompressed)e(\014le.)63
+b(By)0 5375 y(default,)36 b(CFITSIO)f(copies)g(\(and)h(uncompressed)e
+(if)h(necessary\))h(the)g(ftp)f(or)h(h)m(ttp)g(FITS)f(\014le)f(in)m(to)
+i(memory)0 5488 y(on)g(the)g(lo)s(cal)f(mac)m(hine)g(b)s(efore)h(op)s
+(ening)e(it.)57 b(This)34 b(will)f(fail)h(if)h(the)h(lo)s(cal)f(mac)m
+(hine)h(do)s(es)f(not)h(ha)m(v)m(e)h(enough)0 5601 y(memory)g(to)h
+(hold)e(the)h(whole)g(FITS)f(\014le,)j(so)e(in)f(this)g(case,)41
+b(the)c(output)g(\014lename)f(sp)s(eci\014er)g(\(see)i(the)g(next)0
+5714 y(section\))31 b(can)g(b)s(e)e(used)h(to)h(further)e(con)m(trol)i
+(ho)m(w)f(CFITSIO)f(reads)h(ftp)g(and)g(h)m(ttp)g(\014les.)p
 eop
-%%Page: 120 126
-120 125 bop 0 299 a Fj(120)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
-555 y Fj(routine.)95 813 y Ff(int)47 b(fits_write_img_[byt,)c(sht,)j
-(usht,)h(int,)f(uint,)h(lng,)f(ulng,)h(flt,)f(dbl])h(/)286
-925 y(ffppr[b,i,ui,k,uk,j,uj,e,d)o(])286 1038 y(\(fitsfile)f(*fptr,)g
-(long)g(group,)g(long)h(firstelem,)e(long)i(nelements,)334
-1151 y(DTYPE)f(*array,)g(>)i(int)f(*status\);)0 1409
-y Fi(3)81 b Fj(W)-8 b(rite)35 b(elemen)m(ts)f(in)m(to)h(the)g(FITS)f
-(data)h(arra)m(y)-8 b(,)37 b(substituting)32 b(the)j(appropriate)e
-(FITS)h(n)m(ull)f(v)-5 b(alue)34 b(for)g(all)227 1521
-y(elemen)m(ts)40 b(whic)m(h)e(are)i(equal)f(to)i(the)e(input)f(v)-5
-b(alue)39 b(of)h(n)m(ulv)-5 b(al)38 b(\(note)i(that)g(this)f(parameter)
-h(giv)m(es)g(the)227 1634 y(address)34 b(of)g(the)h(n)m(ull)d(v)-5
-b(alue,)35 b(not)f(the)h(n)m(ull)d(v)-5 b(alue)34 b(itself)7
-b(\).)52 b(F)-8 b(or)35 b(in)m(teger)f(FITS)g(arra)m(ys,)i(the)e(FITS)g
-(n)m(ull)227 1747 y(v)-5 b(alue)26 b(is)g(de\014ned)g(b)m(y)g(the)h
-(BLANK)g(k)m(eyw)m(ord)g(\(an)g(error)f(is)g(returned)g(if)f(the)i
-(BLANK)g(k)m(eyw)m(ord)g(do)s(esn't)227 1860 y(exist\).)52
-b(F)-8 b(or)35 b(\015oating)f(p)s(oin)m(t)f(FITS)g(arra)m(ys)i(the)f
-(sp)s(ecial)f(IEEE)g(NaN)i(\(Not-a-Num)m(b)s(er\))h(v)-5
-b(alue)33 b(will)f(b)s(e)227 1973 y(written)25 b(in)m(to)i(the)f(FITS)f
-(\014le.)39 b(If)25 b(a)i(n)m(ull)d(p)s(oin)m(ter)h(is)g(en)m(tered)i
-(for)e(n)m(ulv)-5 b(al,)26 b(then)g(the)g(n)m(ull)e(v)-5
-b(alue)26 b(is)f(ignored)227 2086 y(and)30 b(this)f(routine)h(b)s(eha)m
-(v)m(es)h(the)f(same)h(as)g(\014ts)p 1857 2086 28 4 v
-32 w(write)p 2092 2086 V 32 w(img.)95 2343 y Ff(int)47
-b(fits_write_imgnull)c(/)48 b(ffppn)286 2456 y(\(fitsfile)e(*fptr,)g
-(int)h(datatype,)e(long)i(firstelem,)e(long)h(nelements,)334
-2569 y(DTYPE)g(*array,)g(DTYPE)h(*nulval,)e(>)j(int)f(*status\);)0
-2826 y Fi(4)81 b Fj(W)-8 b(rite)25 b(elemen)m(ts)g(in)m(to)g(the)h
-(data)g(arra)m(y)-8 b(,)27 b(substituting)c(the)i(appropriate)f(FITS)g
-(n)m(ull)f(v)-5 b(alue)25 b(for)g(all)f(elemen)m(ts)227
-2939 y(whic)m(h)35 b(are)h(equal)f(to)h(the)g(v)-5 b(alue)36
-b(of)f(NULL)-10 b(V)g(AL.)36 b(F)-8 b(or)37 b(in)m(teger)f(FITS)f(arra)
-m(ys,)i(the)f(n)m(ull)e(v)-5 b(alue)35 b(de\014ned)227
-3052 y(b)m(y)j(the)g(BLANK)g(k)m(eyw)m(ord)h(or)f(a)g(previous)e(call)i
-(to)g(\013pn)m(ul)e(will)g(b)s(e)h(substituted;)j(for)e(\015oating)g(p)
-s(oin)m(t)227 3165 y(FITS)33 b(arra)m(ys)h(\(BITPIX)g(=)f(-32)h(or)g
-(-64\))h(then)e(the)h(sp)s(ecial)e(IEEE)h(NaN)h(\(Not-a-Num)m(b)s(er\))
-i(v)-5 b(alue)33 b(will)227 3278 y(b)s(e)d(substituted.)95
-3535 y Ff(int)47 b(fits_write_imgnull_[byt,)42 b(sht,)k(usht,)h(int,)f
-(uint,)h(lng,)f(ulng,)h(flt,)f(dbl])h(/)286 3648 y
-(ffppn[b,i,ui,k,uk,j,uje,d])286 3761 y(\(fitsfile)f(*fptr,)g(long)g
-(group,)g(long)h(firstelem,)525 3874 y(long)g(nelements,)e(DTYPE)h
-(*array,)g(DTYPE)g(nulval,)g(>)h(int)g(*status\);)0 4131
-y Fi(5)81 b Fj(Set)30 b(data)h(arra)m(y)g(elemen)m(ts)g(as)f
-(unde\014ned.)95 4389 y Ff(int)47 b(fits_write_img_null)c(/)k(ffppru)
-286 4502 y(\(fitsfile)f(*fptr,)g(long)g(group,)g(long)h(firstelem,)e
-(long)i(nelements,)334 4615 y(>)h(int)e(*status\))0 4872
-y Fi(6)81 b Fj(W)-8 b(rite)31 b(v)-5 b(alues)29 b(in)m(to)i(group)f
-(parameters.)42 b(This)29 b(routine)g(only)h(applies)f(to)i(the)g
-(`Random)f(Group)s(ed')g(FITS)227 4985 y(format)24 b(whic)m(h)e(has)h
-(b)s(een)f(used)h(for)g(applications)e(in)h(radio)h(in)m(terferometry)
--8 b(,)25 b(but)d(is)h(o\016cally)f(deprecated)227 5098
-y(for)30 b(future)g(use.)95 5355 y Ff(int)47 b(fits_write_grppar_[byt,)
-42 b(sht,)k(usht,)h(int,)f(uint,)h(lng,)f(ulng,)h(flt,)f(dbl])h(/)286
-5468 y(ffpgp[b,i,ui,k,uk,j,uj,e,d)o(])286 5581 y(\(fitsfile)f(*fptr,)g
-(long)g(group,)g(long)h(firstelem,)e(long)i(nelements,)334
-5694 y(>)h(DTYPE)e(*array,)g(int)h(*status\))p eop
-%%Page: 121 127
-121 126 bop 0 299 a Fh(8.5.)72 b(SPECIALIZED)29 b(FITS)g(PRIMAR)-8
-b(Y)31 b(ARRA)-8 b(Y)32 b(OR)d(IMA)m(GE)j(EXTENSION)d(I/O)h(R)m
-(OUTINES)80 b Fj(121)0 555 y Fi(7)h Fj(W)-8 b(rite)30
-b(a)h(2-D)h(image)e(in)m(to)h(the)f(data)h(arra)m(y)-8
-b(.)95 807 y Ff(int)47 b(fits_write_2d_[byt,)c(sht,)k(usht,)f(int,)h
-(uint,)f(lng,)h(ulng,)f(flt,)h(dbl])f(/)286 920 y
-(ffp2d[b,i,ui,k,uk,j,uj,e,d)o(])286 1033 y(\(fitsfile)g(*fptr,)g(long)g
-(group,)g(long)h(dim1,)f(long)h(naxis1,)334 1146 y(long)g(naxis2,)f
-(DTYPE)g(*array,)g(>)h(int)g(*status\))0 1397 y Fi(8)81
-b Fj(W)-8 b(rite)30 b(a)h(3-D)h(cub)s(e)d(in)m(to)i(the)f(data)h(arra)m
-(y)-8 b(.)95 1649 y Ff(int)47 b(fits_write_3d_[byt,)c(sht,)k(usht,)f
-(int,)h(uint,)f(lng,)h(ulng,)f(flt,)h(dbl])f(/)286 1762
-y(ffp3d[b,i,ui,k,uk,j,uj,e,d)o(])286 1874 y(\(fitsfile)g(*fptr,)g(long)
-g(group,)g(long)h(dim1,)f(long)h(dim2,)334 1987 y(long)g(naxis1,)f
-(long)g(naxis2,)g(long)h(naxis3,)e(DTYPE)i(*array,)f(>)h(int)g
-(*status\))0 2239 y Fi(9)81 b Fj(W)-8 b(rite)30 b(an)h(arbitrary)e
-(data)i(subsection)e(in)m(to)i(the)f(data)h(arra)m(y)-8
-b(.)95 2491 y Ff(int)47 b(fits_write_subset_[byt,)42
-b(sht,)k(usht,)h(int,)f(uint,)h(lng,)f(ulng,)h(flt,)f(dbl])h(/)286
-2603 y(ffpss[b,i,ui,k,uk,j,uj,e,d)o(])286 2716 y(\(fitsfile)f(*fptr,)g
-(long)g(group,)g(long)h(naxis,)f(long)h(*naxes,)334 2829
-y(long)g(*fpixel,)e(long)i(*lpixel,)e(DTYPE)i(*array,)f(>)h(int)g
-(*status\))0 3081 y Fi(10)f Fj(Read)26 b(elemen)m(ts)g(from)g(the)g
-(FITS)f(data)i(arra)m(y)-8 b(.)40 b(Unde\014ned)24 b(FITS)h(arra)m(y)i
-(elemen)m(ts)f(will)d(b)s(e)j(returned)e(with)227 3194
-y(a)30 b(v)-5 b(alue)29 b(=)f(*n)m(ullv)-5 b(al,)28 b(\(note)i(that)g
-(this)e(parameter)i(giv)m(es)f(the)h(address)e(of)h(the)h(n)m(ull)d(v)
--5 b(alue,)29 b(not)h(the)f(n)m(ull)227 3307 y(v)-5 b(alue)35
-b(itself)7 b(\))35 b(unless)f(n)m(ulv)-5 b(al)34 b(=)i(0)g(or)f(*n)m
-(ulv)-5 b(al)35 b(=)g(0,)j(in)c(whic)m(h)g(case)j(no)f(c)m(hec)m(ks)h
-(for)e(unde\014ned)f(pixels)227 3420 y(will)28 b(b)s(e)i(p)s(erformed.)
-95 3671 y Ff(int)47 b(fits_read_img)e(/)i(ffgpv)286 3784
-y(\(fitsfile)f(*fptr,)g(int)94 b(datatype,)46 b(long)g(firstelem,)f
-(long)i(nelements,)334 3897 y(DTYPE)f(*nulval,)g(>)h(DTYPE)g(*array,)f
-(int)h(*anynul,)e(int)i(*status\))0 4149 y Fi(11)f Fj(Read)31
-b(elemen)m(ts)g(from)f(the)h(data)h(arra)m(y)-8 b(.)42
-b(Unde\014ned)30 b(arra)m(y)h(elemen)m(ts)g(will)d(b)s(e)i(returned)g
-(with)f(a)i(v)-5 b(alue)30 b(=)227 4261 y(n)m(ullv)-5
-b(al,)28 b(unless)h(n)m(ullv)-5 b(al)28 b(=)i(0)h(in)e(whic)m(h)g(case)
-i(no)g(c)m(hec)m(ks)g(for)g(unde\014ned)d(pixels)g(will)g(b)s(e)i(p)s
-(erformed.)95 4513 y Ff(int)47 b(fits_read_img_[byt,)c(sht,)k(usht,)f
-(int,)h(uint,)f(lng,)h(ulng,)f(flt,)h(dbl])f(/)286 4626
-y(ffgpv[b,i,ui,k,uk,j,uj,e,d)o(])286 4739 y(\(fitsfile)g(*fptr,)g(long)
-g(group,)g(long)h(firstelem,)e(long)i(nelements,)334
-4852 y(DTYPE)f(nulval,)g(>)i(DTYPE)e(*array,)g(int)h(*anynul,)e(int)i
-(*status\))0 5103 y Fi(12)f Fj(Read)37 b(elemen)m(ts)f(from)g(the)h
-(FITS)f(data)h(arra)m(y)-8 b(.)60 b(An)m(y)36 b(unde\014ned)f(FITS)g
-(arra)m(y)i(elemen)m(ts)g(will)d(ha)m(v)m(e)k(the)227
-5216 y(corresp)s(onding)29 b(n)m(ullarra)m(y)f(elemen)m(t)j(set)g(to)g
-(TR)m(UE.)95 5468 y Ff(int)47 b(fits_read_imgnull)c(/)48
-b(ffgpf)286 5581 y(\(fitsfile)e(*fptr,)g(int)94 b(datatype,)46
-b(long)g(firstelem,)f(long)i(nelements,)334 5694 y(>)h(DTYPE)e(*array,)
-g(char)g(*nullarray,)f(int)i(*anynul,)f(int)g(*status\))p
+%%Page: 112 120
+112 119 bop 0 299 a Fj(112)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(If)32
+b(the)h(input)e(\014le)h(is)g(an)h(IRAF)g(image)g(\014le)f(\(*.imh)g
+(\014le\))h(then)f(CFITSIO)f(will)g(automatically)h(con)m(v)m(ert)j(it)
+d(on)0 668 y(the)27 b(\015y)g(in)m(to)g(a)h(virtual)d(FITS)h(image)i(b)
+s(efore)f(it)f(is)g(op)s(ened)h(b)m(y)g(the)g(application)f(program.)39
+b(IRAF)27 b(images)h(can)0 781 y(only)h(b)s(e)h(op)s(ened)g(with)f
+(READONL)-8 b(Y)31 b(\014le)e(access.)0 941 y(Similarly)-8
+b(,)28 b(if)i(the)h(input)e(\014le)i(is)f(a)h(ra)m(w)g(binary)e(data)j
+(arra)m(y)-8 b(,)33 b(then)d(CFITSIO)g(will)e(con)m(v)m(ert)33
+b(it)d(on)h(the)h(\015y)e(in)m(to)0 1054 y(a)38 b(virtual)e(FITS)i
+(image)g(with)e(the)i(basic)g(set)g(of)g(required)e(header)i(k)m(eyw)m
+(ords)g(b)s(efore)g(it)f(is)g(op)s(ened)g(b)m(y)h(the)0
+1167 y(application)29 b(program)i(\(with)f(READONL)-8
+b(Y)31 b(access\).)44 b(In)30 b(this)g(case)i(the)f(data)g(t)m(yp)s(e)g
+(and)g(dimensions)d(of)j(the)0 1280 y(image)c(m)m(ust)g(b)s(e)f(sp)s
+(eci\014ed)f(in)h(square)h(brac)m(k)m(ets)h(follo)m(wing)d(the)i
+(\014lename)f(\(e.g.)41 b(ra)m(w\014le.dat[ib512,512]\).)h(The)0
+1393 y(\014rst)30 b(c)m(haracter)i(\(case)f(insensitiv)m(e\))e
+(de\014nes)h(the)g(data)h(t)m(yp)s(e)g(of)f(the)h(arra)m(y:)239
+1671 y Fe(b)429 b(8-bit)46 b(unsigned)g(byte)239 1784
+y(i)381 b(16-bit)46 b(signed)g(integer)239 1897 y(u)381
+b(16-bit)46 b(unsigned)g(integer)239 2010 y(j)381 b(32-bit)46
+b(signed)g(integer)239 2123 y(r)h(or)g(f)143 b(32-bit)46
+b(floating)g(point)239 2235 y(d)381 b(64-bit)46 b(floating)g(point)0
+2514 y Fj(An)40 b(optional)f(second)h(c)m(haracter)i(sp)s(eci\014es)d
+(the)i(b)m(yte)f(order)g(of)g(the)h(arra)m(y)g(v)-5 b(alues:)59
+b(b)40 b(or)g(B)h(indicates)e(big)0 2626 y(endian)29
+b(\(as)h(in)f(FITS)g(\014les)g(and)g(the)h(nativ)m(e)h(format)f(of)g
+(SUN)g(UNIX)g(w)m(orkstations)g(and)g(Mac)h(PCs\))e(and)h(l)f(or)0
+2739 y(L)e(indicates)g(little)f(endian)g(\(nativ)m(e)j(format)e(of)h
+(DEC)g(OSF)f(w)m(orkstations)g(and)g(IBM)h(PCs\).)40
+b(If)27 b(this)f(c)m(haracter)0 2852 y(is)f(omitted)g(then)g(the)h
+(arra)m(y)g(is)f(assumed)g(to)h(ha)m(v)m(e)h(the)f(nativ)m(e)f(b)m(yte)
+i(order)e(of)g(the)h(lo)s(cal)f(mac)m(hine.)39 b(These)25
+b(data)0 2965 y(t)m(yp)s(e)35 b(c)m(haracters)h(are)g(then)e(follo)m(w)
+m(ed)h(b)m(y)f(a)i(series)e(of)h(one)g(or)g(more)g(in)m(teger)g(v)-5
+b(alues)34 b(separated)i(b)m(y)e(commas)0 3078 y(whic)m(h)40
+b(de\014ne)g(the)h(size)g(of)g(eac)m(h)h(dimension)d(of)i(the)g(ra)m(w)
+g(arra)m(y)-8 b(.)74 b(Arra)m(ys)41 b(with)e(up)h(to)i(5)f(dimensions)e
+(are)0 3191 y(curren)m(tly)30 b(supp)s(orted.)41 b(Finally)-8
+b(,)30 b(a)h(b)m(yte)h(o\013set)g(to)g(the)f(p)s(osition)f(of)h(the)g
+(\014rst)f(pixel)g(in)g(the)h(data)h(\014le)e(ma)m(y)i(b)s(e)0
+3304 y(sp)s(eci\014ed)g(b)m(y)h(separating)h(it)f(with)f(a)i(':')48
+b(from)33 b(the)h(last)f(dimension)e(v)-5 b(alue.)50
+b(If)33 b(omitted,)i(it)e(is)f(assumed)h(that)0 3417
+y(the)i(o\013set)h(=)f(0.)54 b(This)34 b(parameter)h(ma)m(y)h(b)s(e)e
+(used)g(to)i(skip)d(o)m(v)m(er)j(an)m(y)g(header)e(information)g(in)f
+(the)i(\014le)f(that)0 3530 y(precedes)c(the)h(binary)e(data.)41
+b(F)-8 b(urther)30 b(examples:)95 3808 y Fe(raw.dat[b10000])521
+b(1-dimensional)45 b(10000)h(pixel)g(byte)h(array)95
+3921 y(raw.dat[rb400,400,12])233 b(3-dimensional)45 b(floating)g(point)
+h(big-endian)f(array)95 4034 y(img.fits[ib512,512:2880])89
+b(reads)47 b(the)g(512)g(x)g(512)g(short)f(integer)g(array)g(in)1336
+4147 y(a)i(FITS)e(file,)h(skipping)e(over)i(the)g(2880)g(byte)f(header)
+0 4425 y Fj(One)25 b(sp)s(ecial)e(case)j(of)f(input)e(\014le)h(is)g
+(where)h(the)g(\014lename)f(=)h(`-')h(\(a)f(dash)g(or)g(min)m(us)e
+(sign\))h(or)h('stdin')f(or)h('stdout',)0 4538 y(whic)m(h)c
+(signi\014es)g(that)j(the)f(input)d(\014le)i(is)g(to)i(b)s(e)e(read)g
+(from)h(the)g(stdin)e(stream,)k(or)e(written)e(to)j(the)f(stdout)g
+(stream)0 4650 y(if)33 b(a)h(new)g(output)f(\014le)g(is)g(b)s(eing)g
+(created.)52 b(In)33 b(the)h(case)h(of)f(reading)g(from)f(stdin,)g
+(CFITSIO)g(\014rst)g(copies)h(the)0 4763 y(whole)g(stream)i(in)m(to)f
+(a)g(temp)s(orary)g(FITS)f(\014le)h(\(in)f(memory)h(or)g(on)g(disk\),)g
+(and)g(subsequen)m(t)f(reading)g(of)i(the)0 4876 y(FITS)c(\014le)g(o)s
+(ccurs)h(in)e(this)h(cop)m(y)-8 b(.)49 b(When)33 b(writing)e(to)i
+(stdout,)h(CFITSIO)d(\014rst)h(constructs)h(the)g(whole)f(\014le)g(in)0
+4989 y(memory)i(\(since)h(random)e(access)j(is)d(required\),)i(then)f
+(\015ushes)f(it)h(out)h(to)g(the)f(stdout)h(stream)g(when)e(the)i
+(\014le)0 5102 y(is)29 b(closed.)41 b(In)29 b(addition,)g(if)g(the)h
+(output)g(\014lename)f(=)h('-.gz')i(or)e('stdout.gz')h(then)f(it)g
+(will)d(b)s(e)j(gzip)f(compressed)0 5215 y(b)s(efore)h(b)s(eing)f
+(written)g(to)i(stdout.)0 5375 y(This)24 b(abilit)m(y)h(to)h(read)g
+(and)f(write)g(on)h(the)g(stdin)f(and)g(stdout)h(steams)g(allo)m(ws)g
+(FITS)f(\014les)g(to)h(b)s(e)g(pip)s(ed)d(b)s(et)m(w)m(een)0
+5488 y(tasks)42 b(in)e(memory)h(rather)g(than)h(ha)m(ving)f(to)h
+(create)h(temp)s(orary)e(in)m(termediate)g(FITS)f(\014les)h(on)g(disk.)
+72 b(F)-8 b(or)0 5601 y(example)27 b(if)e(task1)j(creates)h(an)e
+(output)f(FITS)g(\014le,)h(and)g(task2)g(reads)g(an)g(input)e(FITS)h
+(\014le,)h(the)g(FITS)f(\014le)g(ma)m(y)0 5714 y(b)s(e)k(pip)s(ed)e(b)s
+(et)m(w)m(een)j(the)f(2)h(tasks)g(b)m(y)f(sp)s(ecifying)p
 eop
-%%Page: 122 128
-122 127 bop 0 299 a Fj(122)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fi(13)46 b Fj(Read)e(elemen)m(ts)g(and)f(n)m(ull\015ags)e(from)j
-(data)g(arra)m(y)-8 b(.)81 b(An)m(y)44 b(unde\014ned)d(arra)m(y)j
-(elemen)m(ts)g(will)d(ha)m(v)m(e)k(the)227 668 y(corresp)s(onding)29
-b(n)m(ularra)m(y)g(elemen)m(t)i(set)g(equal)f(to)h(1,)g(else)f(0.)95
-938 y Ff(int)95 b(fits_read_imgnull_[byt,)42 b(sht,)k(usht,)h(int,)f
-(uint,)h(lng,)f(ulng,)h(flt,)f(dbl])h(/)334 1051 y
-(ffgpf[b,i,ui,k,uk,j,uj,e,)o(d])334 1164 y(\(fitsfile)e(*fptr,)h(long)h
-(group,)f(long)h(firstelem,)e(long)h(nelements,)334 1277
-y(>)i(DTYPE)e(*array,)g(char)g(*nularray,)f(int)i(*anynul,)f(int)h
-(*status\))0 1547 y Fi(14)f Fj(Read)29 b(v)-5 b(alues)27
-b(from)h(group)g(parameters.)40 b(This)27 b(routine)g(only)g(applies)g
-(to)i(the)f(`Random)g(Group)s(ed')g(FITS)227 1659 y(format)c(whic)m(h)e
-(has)h(b)s(een)f(used)h(for)g(applications)e(in)h(radio)h(in)m
-(terferometry)-8 b(,)25 b(but)d(is)h(o\016cally)f(deprecated)227
-1772 y(for)30 b(future)g(use.)95 2042 y Ff(int)95 b
-(fits_read_grppar_[byt,)42 b(sht,)k(usht,)h(int,)f(uint,)h(lng,)f
-(ulng,)h(flt,)f(dbl])h(/)334 2155 y(ffggp[b,i,ui,k,uk,j,uj,e,)o(d])334
-2268 y(\(fitsfile)e(*fptr,)h(long)h(group,)f(long)h(firstelem,)e(long)h
-(nelements,)334 2381 y(>)i(DTYPE)e(*array,)g(int)h(*status\))0
-2651 y Fi(15)f Fj(Read)25 b(2-D)g(image)g(from)f(the)g(data)h(arra)m(y)
--8 b(.)40 b(Unde\014ned)23 b(pixels)g(in)g(the)h(arra)m(y)h(will)d(b)s
-(e)i(set)h(equal)f(to)h(the)f(v)-5 b(alue)227 2764 y(of)31
-b('n)m(ulv)-5 b(al',)29 b(unless)g(n)m(ulv)-5 b(al=0)29
-b(in)g(whic)m(h)g(case)i(no)g(testing)f(for)g(unde\014ned)e(pixels)h
-(will)f(b)s(e)h(p)s(erformed.)95 3034 y Ff(int)95 b(fits_read_2d_[byt,)
-43 b(sht,)k(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f(flt,)h(dbl])f(/)334
-3146 y(ffg2d[b,i,ui,k,uk,j,uj,e,)o(d])334 3259 y(\(fitsfile)f(*fptr,)h
-(long)h(group,)f(DTYPE)h(nulval,)e(long)i(dim1,)f(long)h(naxis1,)334
-3372 y(long)g(naxis2,)f(>)h(DTYPE)f(*array,)g(int)h(*anynul,)f(int)h
-(*status\))0 3642 y Fi(16)f Fj(Read)27 b(3-D)i(cub)s(e)d(from)h(the)g
-(data)h(arra)m(y)-8 b(.)41 b(Unde\014ned)25 b(pixels)h(in)g(the)h(arra)
-m(y)h(will)c(b)s(e)j(set)g(equal)g(to)h(the)f(v)-5 b(alue)227
-3755 y(of)31 b('n)m(ulv)-5 b(al',)29 b(unless)g(n)m(ulv)-5
-b(al=0)29 b(in)g(whic)m(h)g(case)i(no)g(testing)f(for)g(unde\014ned)e
-(pixels)h(will)f(b)s(e)h(p)s(erformed.)95 4025 y Ff(int)95
-b(fits_read_3d_[byt,)43 b(sht,)k(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f
-(flt,)h(dbl])f(/)334 4138 y(ffg3d[b,i,ui,k,uk,j,uj,e,)o(d])334
-4251 y(\(fitsfile)f(*fptr,)h(long)h(group,)f(DTYPE)h(nulval,)e(long)i
-(dim1,)334 4364 y(long)g(dim2,)f(long)h(naxis1,)f(long)g(naxis2,)g
-(long)h(naxis3,)334 4477 y(>)h(DTYPE)e(*array,)g(int)h(*anynul,)e(int)i
-(*status\))0 4746 y Fi(17)f Fj(Read)25 b(an)g(arbitrary)f(data)h
-(subsection)f(from)h(the)g(data)g(arra)m(y)-8 b(.)40
-b(Unde\014ned)24 b(pixels)f(in)g(the)i(arra)m(y)h(will)c(b)s(e)i(set)
-227 4859 y(equal)33 b(to)h(the)f(v)-5 b(alue)33 b(of)h('n)m(ulv)-5
-b(al',)33 b(unless)e(n)m(ullv)-5 b(al=0)31 b(in)h(whic)m(h)g(case)i(no)
-f(testing)h(for)f(unde\014ned)e(pixels)227 4972 y(will)d(b)s(e)i(p)s
-(erformed.)95 5242 y Ff(int)95 b(fits_read_subset_[byt,)42
-b(sht,)k(usht,)h(int,)f(uint,)h(lng,)f(ulng,)h(flt,)f(dbl])h(/)334
-5355 y(ffgsv[b,i,ui,k,uk,j,uj,e,)o(d])334 5468 y(\(fitsfile)e(*fptr,)h
-(int)h(group,)f(int)h(naxis,)f(long)h(*naxes,)334 5581
-y(long)g(*fpixel,)e(long)i(*lpixel,)e(long)i(*inc,)f(DTYPE)h(nulval,)
-334 5694 y(>)h(DTYPE)e(*array,)g(int)h(*anynul,)e(int)i(*status\))p
+%%Page: 113 121
+113 120 bop 0 299 a Fh(10.4.)73 b(OUTPUT)29 b(FILE)h(NAME)h(WHEN)g
+(OPENING)f(AN)h(EXISTING)f(FILE)876 b Fj(113)143 555
+y Fe(task1)47 b(-)g(|)g(task2)g(-)0 783 y Fj(where)30
+b(the)h(v)m(ertical)g(bar)g(is)e(the)i(Unix)f(piping)e(sym)m(b)s(ol.)41
+b(This)29 b(assumes)h(that)i(the)f(2)g(tasks)g(read)g(the)g(name)g(of)0
+896 y(the)g(FITS)e(\014le)h(o\013)g(of)h(the)g(command)f(line.)0
+1224 y Ff(10.4)136 b(Output)44 b(File)i(Name)f(when)g(Op)t(ening)g(an)g
+(Existing)h(File)0 1474 y Fj(An)36 b(optional)g(output)g(\014lename)g
+(ma)m(y)i(b)s(e)e(sp)s(eci\014ed)f(in)g(paren)m(theses)i(immediately)e
+(follo)m(wing)g(the)i(base)g(\014le)0 1587 y(name)28
+b(to)h(b)s(e)f(op)s(ened.)39 b(This)27 b(is)g(mainly)f(useful)h(in)g
+(those)h(cases)i(where)d(CFITSIO)g(creates)j(a)e(temp)s(orary)g(cop)m
+(y)0 1700 y(of)i(the)f(input)f(FITS)g(\014le)h(b)s(efore)g(it)g(is)f
+(op)s(ened)h(and)f(passed)h(to)h(the)g(application)e(program.)40
+b(This)27 b(happ)s(ens)h(b)m(y)0 1813 y(default)h(when)h(op)s(ening)f
+(a)h(net)m(w)m(ork)h(FTP)g(or)f(HTTP-t)m(yp)s(e)g(\014le,)g(when)f
+(reading)g(a)i(compressed)f(FITS)g(\014le)f(on)0 1926
+y(a)36 b(lo)s(cal)f(disk,)h(when)f(reading)g(from)h(the)g(stdin)e
+(stream,)k(or)d(when)g(a)i(column)d(\014lter,)j(ro)m(w)f(\014lter,)g
+(or)g(binning)0 2039 y(sp)s(eci\014er)28 b(is)g(included)f(as)j(part)f
+(of)g(the)h(input)e(\014le)g(sp)s(eci\014cation.)39 b(By)30
+b(default)f(this)f(temp)s(orary)h(\014le)f(is)h(created)0
+2152 y(in)g(memory)-8 b(.)41 b(If)29 b(there)h(is)f(not)h(enough)g
+(memory)g(to)h(create)g(the)g(\014le)e(cop)m(y)-8 b(,)31
+b(then)f(CFITSIO)e(will)f(exit)j(with)f(an)0 2265 y(error.)45
+b(In)32 b(these)g(cases)h(one)g(can)f(force)h(a)f(p)s(ermanen)m(t)g
+(\014le)f(to)i(b)s(e)e(created)i(on)f(disk,)f(instead)h(of)g(a)g(temp)s
+(orary)0 2378 y(\014le)37 b(in)f(memory)-8 b(,)40 b(b)m(y)d(supplying)d
+(the)k(name)g(in)e(paren)m(theses)i(immediately)e(follo)m(wing)g(the)h
+(base)h(\014le)f(name.)0 2490 y(The)30 b(output)g(\014lename)f(can)i
+(include)d(the)j(')10 b(!')41 b(clobb)s(er)29 b(\015ag.)0
+2651 y(Th)m(us,)48 b(if)c(the)h(input)e(\014lename)h(to)h(CFITSIO)f
+(is:)69 b Fe(file1.fits.gz\(file2.fit)o(s\))39 b Fj(then)44
+b(CFITSIO)g(will)0 2764 y(uncompress)39 b(`\014le1.\014ts.gz')i(in)m
+(to)f(the)g(lo)s(cal)f(disk)f(\014le)h(`\014le2.\014ts')h(b)s(efore)g
+(op)s(ening)e(it.)69 b(CFITSIO)38 b(do)s(es)i(not)0 2876
+y(automatically)30 b(delete)h(the)f(output)g(\014le,)g(so)h(it)f(will)d
+(still)i(exist)h(after)h(the)f(application)f(program)h(exits.)0
+3037 y(The)i(output)h(\014lename)f("mem://")j(is)d(also)h(allo)m(w)m
+(ed,)h(whic)m(h)d(will)g(write)h(the)h(output)f(\014le)g(in)m(to)h
+(memory)-8 b(,)35 b(and)0 3150 y(also)27 b(allo)m(w)f(write)g(access)i
+(to)g(the)f(\014le.)38 b(This)25 b('\014le')i(will)d(disapp)s(ear)h
+(when)h(it)g(is)g(closed,)h(but)f(this)g(ma)m(y)i(b)s(e)e(useful)0
+3262 y(for)k(some)h(applications)d(whic)m(h)i(only)f(need)h(to)h(mo)s
+(dify)e(a)i(temp)s(orary)f(cop)m(y)h(of)f(the)h(\014le.)0
+3423 y(In)k(some)i(cases,)h(sev)m(eral)e(di\013eren)m(t)g(temp)s(orary)
+f(FITS)h(\014les)f(will)e(b)s(e)i(created)i(in)e(sequence,)j(for)e
+(instance,)h(if)0 3535 y(one)g(op)s(ens)g(a)g(remote)h(\014le)e(using)g
+(FTP)-8 b(,)37 b(then)g(\014lters)f(ro)m(ws)h(in)f(a)i(binary)d(table)i
+(extension,)i(then)d(create)j(an)0 3648 y(image)e(b)m(y)g(binning)d(a)j
+(pair)f(of)h(columns.)59 b(In)36 b(this)g(case,)k(the)d(remote)h
+(\014le)e(will)e(b)s(e)i(copied)g(to)i(a)f(temp)s(orary)0
+3761 y(lo)s(cal)h(\014le,)i(then)e(a)h(second)f(temp)s(orary)h(\014le)e
+(will)f(b)s(e)i(created)i(con)m(taining)e(the)g(\014ltered)g(ro)m(ws)g
+(of)h(the)g(table,)0 3874 y(and)c(\014nally)e(a)j(third)d(temp)s(orary)
+i(\014le)g(con)m(taining)f(the)i(binned)d(image)i(will)e(b)s(e)i
+(created.)57 b(In)34 b(cases)i(lik)m(e)f(this)0 3987
+y(where)28 b(m)m(ultiple)e(\014les)h(are)i(created,)h(the)e(out\014le)g
+(sp)s(eci\014er)f(will)e(b)s(e)j(in)m(terpreted)g(the)g(name)g(of)h
+(the)f(\014nal)f(\014le)h(as)0 4100 y(describ)s(ed)g(b)s(elo)m(w,)i(in)
+f(descending)g(priorit)m(y:)136 4327 y Fc(\017)46 b Fj(as)29
+b(the)g(name)g(of)g(the)g(\014nal)e(image)i(\014le)f(if)f(an)i(image)g
+(within)d(a)j(single)e(binary)g(table)i(cell)f(is)f(op)s(ened)h(or)h
+(if)227 4440 y(an)i(image)f(is)g(created)h(b)m(y)f(binning)e(a)i(table)
+h(column.)136 4617 y Fc(\017)46 b Fj(as)33 b(the)f(name)h(of)f(the)h
+(\014le)e(con)m(taining)h(the)g(\014ltered)f(table)i(if)e(a)i(column)e
+(\014lter)g(and/or)h(a)h(ro)m(w)f(\014lter)g(are)227
+4730 y(sp)s(eci\014ed.)136 4907 y Fc(\017)46 b Fj(as)31
+b(the)f(name)h(of)f(the)h(lo)s(cal)f(cop)m(y)h(of)f(the)h(remote)g(FTP)
+f(or)h(HTTP)e(\014le.)136 5084 y Fc(\017)46 b Fj(as)31
+b(the)g(name)g(of)g(the)f(uncompressed)g(v)m(ersion)g(of)h(the)f(FITS)g
+(\014le,)g(if)g(a)h(compressed)f(FITS)g(\014le)g(on)h(lo)s(cal)227
+5197 y(disk)e(has)h(b)s(een)g(op)s(ened.)136 5374 y Fc(\017)46
+b Fj(otherwise,)30 b(the)h(output)f(\014lename)f(is)h(ignored.)0
+5601 y(The)f(output)f(\014le)g(sp)s(eci\014er)g(is)g(useful)f(when)h
+(reading)g(FTP)h(or)g(HTTP-t)m(yp)s(e)g(FITS)f(\014les)g(since)g(it)h
+(can)g(b)s(e)g(used)0 5714 y(to)34 b(create)i(a)e(lo)s(cal)f(disk)f
+(cop)m(y)j(of)f(the)g(\014le)e(that)j(can)f(b)s(e)f(reused)g(in)f(the)i
+(future.)50 b(If)33 b(the)h(output)g(\014le)e(name)i(=)p
 eop
-%%Page: 123 129
-123 128 bop 0 299 a Fh(8.6.)72 b(SPECIALIZED)29 b(FITS)g(ASCI)s(I)g
-(AND)i(BINAR)-8 b(Y)32 b(T)-8 b(ABLE)30 b(R)m(OUTINES)933
-b Fj(123)0 555 y Fi(18)46 b Fj(Read)30 b(an)f(arbitrary)f(data)j
-(subsection)d(from)h(the)h(data)g(arra)m(y)-8 b(.)41
-b(An)m(y)30 b(Unde\014ned)e(pixels)g(in)g(the)i(arra)m(y)g(will)227
-668 y(ha)m(v)m(e)i(the)e(corresp)s(onding)f('n)m(ularra)m(y')h(elemen)m
-(t)h(set)g(equal)f(to)h(TR)m(UE.)95 921 y Ff(int)95 b
-(fits_read_subsetnull_[byt)o(,)42 b(sht,)k(usht,)h(int,)f(uint,)h(lng,)
-f(ulng,)h(flt,)f(dbl])h(/)334 1034 y(ffgsf[b,i,ui,k,uk,j,uj,e,)o(d])334
-1146 y(\(fitsfile)e(*fptr,)h(int)h(group,)f(int)h(naxis,)f(long)h
-(*naxes,)334 1259 y(long)g(*fpixel,)e(long)i(*lpixel,)e(long)i(*inc,)f
-(>)i(DTYPE)e(*array,)334 1372 y(char)h(*nularray,)e(int)i(*anynul,)e
-(int)i(*status\))0 1705 y Fe(8.6)135 b(Sp)t(ecialized)46
-b(FITS)e(ASCI)t(I)g(and)g(Binary)h(T)-11 b(able)45 b(Routines)0
-1958 y Fd(8.6.1)112 b(Column)37 b(Information)f(Routines)0
-2166 y Fi(1)81 b Fj(Get)30 b(information)d(ab)s(out)h(an)h(existing)f
-(ASCI)s(I)f(table)i(column.)39 b(A)29 b(n)m(ull)e(p)s(oin)m(ter)h(ma)m
-(y)i(b)s(e)e(giv)m(en)h(for)g(an)m(y)g(of)227 2279 y(the)i(output)f
-(parameters)h(that)f(are)h(not)g(needed.)0 2532 y Ff(int)47
-b(fits_get_acolparms)c(/)k(ffgacl)191 2645 y(\(fitsfile)e(*fptr,)h(int)
-h(colnum,)f(>)h(char)g(*ttype,)f(long)h(*tbcol,)239 2757
-y(char)f(*tunit,)g(char)h(*tform,)f(double)g(*scale,)f(double)i(*zero,)
-239 2870 y(char)f(*nulstr,)g(char)g(*tdisp,)g(int)h(*status\))0
-3123 y Fi(2)81 b Fj(Get)25 b(information)d(ab)s(out)i(an)g(existing)f
-(binary)f(table)i(column.)37 b(D)m(A)-8 b(T)g(A)g(TYPE)26
-b(is)d(a)i(c)m(haracter)g(string)e(whic)m(h)227 3236
-y(returns)j(the)h(datat)m(yp)s(e)h(of)f(the)h(column)d(as)j(de\014ned)d
-(b)m(y)i(the)g(TF)m(ORMn)g(k)m(eyw)m(ord)h(\(e.g.,)h('I',)f('J','E',)g
-('D',)227 3349 y(etc.\).)43 b(In)29 b(the)h(case)h(of)f(an)g(ASCI)s(I)f
-(c)m(haracter)j(column,)d(t)m(yp)s(eco)s(de)h(will)e(ha)m(v)m(e)j(a)f
-(v)-5 b(alue)30 b(of)g(the)g(form)g('An')227 3462 y(where)24
-b('n')g(is)f(an)h(in)m(teger)h(expressing)d(the)j(width)d(of)i(the)h
-(\014eld)d(in)h(c)m(haracters.)40 b(F)-8 b(or)25 b(example,)g(if)f(TF)m
-(ORM)227 3575 y(=)j('160A8')i(then)d(\013gb)s(cl)g(will)e(return)h(t)m
-(yp)s(ec)m(har='A8')k(and)d(rep)s(eat=20.)40 b(All)25
-b(the)i(returned)f(parameters)227 3687 y(are)31 b(scalar)f(quan)m
-(tities.)40 b(A)31 b(n)m(ull)d(p)s(oin)m(ter)i(ma)m(y)h(b)s(e)e(giv)m
-(en)i(for)f(an)m(y)h(of)f(the)h(output)f(parameters)h(that)g(are)227
-3800 y(not)g(needed.)95 4053 y Ff(int)47 b(fits_get_bcolparms)c(/)48
-b(ffgbcl)286 4166 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(>)j(char)f
-(*ttype,)e(char)i(*tunit,)334 4279 y(char)g(*typechar,)e(long)h
-(*repeat,)g(double)g(*scale,)g(double)g(*zero,)334 4392
-y(long)h(*nulval,)e(char)i(*tdisp,)f(int)94 b(*status\))0
-4644 y Fi(3)81 b Fj(Return)27 b(optimal)g(n)m(um)m(b)s(er)g(of)h(ro)m
-(ws)g(to)h(read)f(or)g(write)f(at)i(one)f(time)g(for)g(maxim)m(um)f
-(I/O)g(e\016ciency)-8 b(.)41 b(Refer)227 4757 y(to)25
-b(the)g(\\Optimizing)d(Co)s(de")i(section)h(in)e(Chapter)h(5)g(for)g
-(more)h(discussion)d(on)i(ho)m(w)g(to)h(use)f(this)g(routine.)95
-5123 y Ff(int)47 b(fits_get_rowsize)d(/)j(ffgrsz)286
-5235 y(\(fitsfile)f(*fptr,)g(long)g(*nrows,)g(*status\))0
-5488 y Fi(4)81 b Fj(De\014ne)22 b(the)g(zero)i(indexed)c(b)m(yte)j
-(o\013set)g(of)g(the)f('heap')h(measured)e(from)h(the)h(start)g(of)f
-(the)g(binary)f(table)h(data.)227 5601 y(By)30 b(default)f(the)g(heap)h
-(is)e(assumed)h(to)h(start)g(immediately)e(follo)m(wing)g(the)i
-(regular)e(table)i(data,)g(i.e.,)g(at)227 5714 y(lo)s(cation)36
-b(NAXIS1)h(x)g(NAXIS2.)59 b(This)35 b(routine)g(is)h(only)f(relev)-5
-b(an)m(t)37 b(for)f(binary)f(tables)h(whic)m(h)g(con)m(tain)p
+%%Page: 114 122
+114 121 bop 0 299 a Fj(114)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(`*')36
+b(then)f(a)g(lo)s(cal)f(\014le)g(with)g(the)h(same)g(name)g(as)g(the)h
+(net)m(w)m(ork)f(\014le)f(will)f(b)s(e)h(created.)56
+b(Note)36 b(that)f(CFITSIO)0 668 y(will)27 b(b)s(eha)m(v)m(e)j
+(di\013eren)m(tly)f(dep)s(ending)e(on)j(whether)f(the)h(remote)g
+(\014le)f(is)g(compressed)g(or)h(not)g(as)g(sho)m(wn)f(b)m(y)h(the)0
+781 y(follo)m(wing)f(examples:)136 1005 y Fc(\017)46
+b Fe(ftp://remote.machine/tmp/)o(myfi)o(le.f)o(its)o(.gz\()o(*\))28
+b Fj(-)35 b(the)g(remote)h(compressed)e(\014le)g(is)g(copied)g(to)227
+1117 y(the)e(lo)s(cal)f(compressed)h(\014le)f(`m)m(y\014le.\014ts.gz',)
+i(whic)m(h)d(is)h(then)h(uncompressed)e(in)h(lo)s(cal)g(memory)g(b)s
+(efore)227 1230 y(b)s(eing)e(op)s(ened)h(and)g(passed)f(to)j(the)e
+(application)f(program.)136 1414 y Fc(\017)46 b Fe
+(ftp://remote.machine/tmp/)o(myfi)o(le.f)o(its)o(.gz\()o(myfi)o(le.)o
+(fits)o(\))33 b Fj(-)39 b(the)g(remote)h(compressed)f(\014le)227
+1526 y(is)c(copied)g(and)g(uncompressed)g(in)m(to)g(the)h(lo)s(cal)f
+(\014le)g(`m)m(y\014le.\014ts'.)56 b(This)34 b(example)h(requires)g
+(less)g(lo)s(cal)227 1639 y(memory)21 b(than)g(the)g(previous)e
+(example)i(since)f(the)h(\014le)f(is)g(uncompressed)f(on)i(disk)f
+(instead)g(of)h(in)e(memory)-8 b(.)136 1822 y Fc(\017)46
+b Fe(ftp://remote.machine/tmp/)o(myfi)o(le.f)o(its)o(\(myf)o(ile.)o
+(fit)o(s.gz)o(\))24 b Fj(-)30 b(this)f(will)e(usually)h(pro)s(duce)h
+(an)227 1935 y(error)h(since)g(CFITSIO)f(itself)g(cannot)i(compress)f
+(\014les.)0 2159 y(The)36 b(exact)i(b)s(eha)m(vior)d(of)i(CFITSIO)e(in)
+g(the)i(latter)f(case)i(dep)s(ends)c(on)j(the)f(t)m(yp)s(e)h(of)g(ftp)f
+(serv)m(er)g(running)e(on)0 2272 y(the)d(remote)g(mac)m(hine)f(and)g
+(ho)m(w)g(it)g(is)f(con\014gured.)40 b(In)30 b(some)h(cases,)g(if)e
+(the)i(\014le)e(`m)m(y\014le.\014ts.gz')j(exists)e(on)g(the)0
+2385 y(remote)38 b(mac)m(hine,)g(then)f(the)g(serv)m(er)g(will)e(cop)m
+(y)i(it)g(to)g(the)h(lo)s(cal)e(mac)m(hine.)60 b(In)36
+b(other)h(cases)h(the)f(ftp)g(serv)m(er)0 2498 y(will)c(automatically)j
+(create)h(and)f(transmit)f(a)h(compressed)g(v)m(ersion)f(of)h(the)g
+(\014le)f(if)g(only)g(the)h(uncompressed)0 2611 y(v)m(ersion)26
+b(exists.)40 b(This)25 b(can)i(get)h(rather)f(confusing,)g(so)g(users)f
+(should)f(use)i(a)g(certain)g(amoun)m(t)h(of)f(caution)g(when)0
+2723 y(using)33 b(the)i(output)f(\014le)g(sp)s(eci\014er)f(with)h(FTP)g
+(or)h(HTTP)f(\014le)g(t)m(yp)s(es,)i(to)f(mak)m(e)h(sure)e(they)h(get)h
+(the)f(b)s(eha)m(vior)0 2836 y(that)c(they)g(exp)s(ect.)0
+3168 y Ff(10.5)136 b(T)-11 b(emplate)45 b(File)h(Name)g(when)e
+(Creating)j(a)e(New)g(File)0 3418 y Fj(When)38 b(a)h(new)f(FITS)g
+(\014le)g(is)g(created)h(with)f(a)g(call)g(to)i(\014ts)p
+2101 3418 28 4 v 32 w(create)p 2369 3418 V 35 w(\014le,)f(the)g(name)g
+(of)g(a)g(template)g(\014le)e(ma)m(y)0 3531 y(b)s(e)i(supplied)e(in)i
+(paren)m(theses)h(immediately)e(follo)m(wing)g(the)j(name)f(of)g(the)g
+(new)f(\014le)g(to)i(b)s(e)e(created.)71 b(This)0 3644
+y(template)26 b(is)e(used)h(to)h(de\014ne)f(the)h(structure)f(of)h(one)
+f(or)h(more)g(HDUs)g(in)e(the)i(new)f(\014le.)38 b(The)25
+b(template)h(\014le)e(ma)m(y)0 3757 y(b)s(e)32 b(another)h(FITS)f
+(\014le,)h(in)f(whic)m(h)f(case)j(the)f(newly)f(created)i(\014le)e
+(will)e(ha)m(v)m(e)k(exactly)g(the)f(same)g(k)m(eyw)m(ords)g(in)0
+3870 y(eac)m(h)25 b(HDU)g(as)g(in)e(the)h(template)h(FITS)e(\014le,)i
+(but)e(all)h(the)g(data)h(units)d(will)g(b)s(e)i(\014lled)e(with)g
+(zeros.)40 b(The)24 b(template)0 3983 y(\014le)h(ma)m(y)i(also)f(b)s(e)
+f(an)h(ASCI)s(I)e(text)j(\014le,)f(where)g(eac)m(h)h(line)d(\(in)h
+(general\))i(describ)s(es)d(one)i(FITS)f(k)m(eyw)m(ord)i(record.)0
+4096 y(The)j(format)h(of)f(the)h(ASCI)s(I)e(template)h(\014le)g(is)f
+(describ)s(ed)f(in)i(the)g(follo)m(wing)f(T)-8 b(emplate)30
+b(Files)g(c)m(hapter.)0 4427 y Ff(10.6)136 b(Image)46
+b(Tile-Compression)g(Sp)t(eci\014cation)0 4677 y Fj(When)28
+b(sp)s(ecifying)e(the)j(name)g(of)f(the)h(output)f(FITS)g(\014le)f(to)i
+(b)s(e)f(created,)i(the)f(user)f(can)g(indicate)g(that)h(images)0
+4790 y(should)c(b)s(e)i(written)f(in)g(tile-compressed)g(format)i
+(\(see)g(section)f(5.5,)i(\\Primary)d(Arra)m(y)i(or)f(IMA)m(GE)h
+(Extension)0 4903 y(I/O)f(Routines"\))h(b)m(y)f(enclosing)f(the)i
+(compression)e(parameters)i(in)e(square)h(brac)m(k)m(ets)i(follo)m
+(wing)d(the)i(ro)s(ot)f(disk)0 5016 y(\014le)i(name.)41
+b(Here)31 b(are)g(some)g(examples)f(of)g(the)h(syn)m(tax)g(for)f(sp)s
+(ecifying)e(tile-compressed)i(output)g(images:)191 5262
+y Fe(myfile.fit[compress])185 b(-)48 b(use)f(Rice)f(algorithm)g(and)h
+(default)e(tile)i(size)191 5488 y(myfile.fit[compress)42
+b(GZIP])47 b(-)g(use)g(the)g(specified)e(compression)g(algorithm;)191
+5601 y(myfile.fit[compress)d(Rice])238 b(only)46 b(the)h(first)g
+(letter)f(of)h(the)g(algorithm)191 5714 y(myfile.fit[compress)42
+b(PLIO])238 b(name)46 b(is)i(required.)p eop
+%%Page: 115 123
+115 122 bop 0 299 a Fh(10.7.)73 b(HDU)31 b(LOCA)-8 b(TION)29
+b(SPECIFICA)-8 b(TION)2019 b Fj(115)191 668 y Fe(myfile.fit[compress)42
+b(Rice)47 b(100,100])141 b(-)48 b(use)e(100)h(x)h(100)f(pixel)f(tile)h
+(size)191 781 y(myfile.fit[compress)42 b(Rice)47 b(100,100;2])e(-)j(as)
+f(above,)f(and)h(use)g(noisebits)e(=)i(2)0 1114 y Ff(10.7)136
+b(HDU)45 b(Lo)t(cation)g(Sp)t(eci\014cation)0 1364 y
+Fj(The)c(optional)f(HDU)j(lo)s(cation)e(sp)s(eci\014er)e(de\014nes)i
+(whic)m(h)f(HDU)i(\(Header-Data)i(Unit,)g(also)d(kno)m(wn)g(as)h(an)0
+1477 y(`extension'\))35 b(within)c(the)k(FITS)e(\014le)g(to)i
+(initially)c(op)s(en.)51 b(It)34 b(m)m(ust)g(immediately)f(follo)m(w)g
+(the)h(base)h(\014le)e(name)0 1590 y(\(or)h(the)g(output)g(\014le)f
+(name)g(if)g(presen)m(t\).)52 b(If)33 b(it)g(is)g(not)h(sp)s(eci\014ed)
+f(then)g(the)h(\014rst)f(HDU)i(\(the)f(primary)e(arra)m(y\))0
+1703 y(is)g(op)s(ened.)46 b(The)32 b(HDU)h(lo)s(cation)f(sp)s
+(eci\014er)f(is)h(required)f(if)g(the)i(colFilter,)f(ro)m(wFilter,)h
+(or)g(binSp)s(ec)d(sp)s(eci\014ers)0 1816 y(are)g(presen)m(t,)f(b)s
+(ecause)h(the)f(primary)e(arra)m(y)j(is)e(not)i(a)f(v)-5
+b(alid)28 b(HDU)i(for)f(these)g(op)s(erations.)40 b(The)29
+b(HDU)h(ma)m(y)g(b)s(e)0 1929 y(sp)s(eci\014ed)d(either)i(b)m(y)f
+(absolute)h(p)s(osition)e(n)m(um)m(b)s(er,)h(starting)h(with)e(0)j(for)
+e(the)h(primary)e(arra)m(y)-8 b(,)31 b(or)e(b)m(y)f(reference)0
+2042 y(to)h(the)g(HDU)g(name,)g(and)f(optionally)-8 b(,)28
+b(the)h(v)m(ersion)f(n)m(um)m(b)s(er)f(and)h(the)h(HDU)g(t)m(yp)s(e)g
+(of)f(the)h(desired)e(extension.)0 2155 y(The)32 b(lo)s(cation)f(of)h
+(an)g(image)h(within)c(a)k(single)d(cell)i(of)g(a)g(binary)f(table)h
+(ma)m(y)g(also)g(b)s(e)g(sp)s(eci\014ed,)f(as)h(describ)s(ed)0
+2268 y(b)s(elo)m(w.)0 2428 y(The)26 b(absolute)g(p)s(osition)e(of)i
+(the)h(extension)f(is)f(sp)s(eci\014ed)f(either)i(b)m(y)g(enclosed)g
+(the)h(n)m(um)m(b)s(er)e(in)g(square)g(brac)m(k)m(ets)0
+2541 y(\(e.g.,)k(`[1]')g(=)d(the)h(\014rst)f(extension)g(follo)m(wing)g
+(the)h(primary)d(arra)m(y\))k(or)f(b)m(y)f(preceded)h(the)g(n)m(um)m(b)
+s(er)e(with)h(a)h(plus)0 2654 y(sign)36 b(\(`+1'\).)63
+b(T)-8 b(o)38 b(sp)s(ecify)e(the)h(HDU)h(b)m(y)g(name,)h(giv)m(e)f(the)
+f(name)h(of)f(the)h(desired)e(HDU)i(\(the)f(v)-5 b(alue)37
+b(of)h(the)0 2766 y(EXTNAME)e(or)g(HDUNAME)h(k)m(eyw)m(ord\))g(and)f
+(optionally)e(the)i(extension)g(v)m(ersion)f(n)m(um)m(b)s(er)g(\(v)-5
+b(alue)36 b(of)g(the)0 2879 y(EXTVER)27 b(k)m(eyw)m(ord\))i(and)e(the)h
+(extension)g(t)m(yp)s(e)f(\(v)-5 b(alue)28 b(of)g(the)g(XTENSION)f(k)m
+(eyw)m(ord:)40 b(IMA)m(GE,)29 b(ASCI)s(I)d(or)0 2992
+y(T)-8 b(ABLE,)36 b(or)f(BINT)-8 b(ABLE\),)36 b(separated)f(b)m(y)g
+(commas)h(and)e(all)g(enclosed)h(in)f(square)h(brac)m(k)m(ets.)56
+b(If)34 b(the)h(v)-5 b(alue)0 3105 y(of)34 b(EXTVER)f(and)f(XTENSION)h
+(are)h(not)f(sp)s(eci\014ed,)g(then)g(the)h(\014rst)e(extension)i(with)
+e(the)h(correct)i(v)-5 b(alue)33 b(of)0 3218 y(EXTNAME)39
+b(is)f(op)s(ened.)67 b(The)38 b(extension)h(name)g(and)f(t)m(yp)s(e)i
+(are)f(not)h(case)g(sensitiv)m(e,)h(and)d(the)h(extension)0
+3331 y(t)m(yp)s(e)29 b(ma)m(y)g(b)s(e)f(abbreviated)g(to)h(a)g(single)e
+(letter)i(\(e.g.,)i(I)d(=)g(IMA)m(GE)i(extension)e(or)g(primary)f(arra)
+m(y)-8 b(,)30 b(A)f(or)f(T)g(=)0 3444 y(ASCI)s(I)d(table)h(extension,)h
+(and)f(B)h(=)f(binary)f(table)h(BINT)-8 b(ABLE)27 b(extension\).)40
+b(If)26 b(the)g(HDU)h(lo)s(cation)g(sp)s(eci\014er)0
+3557 y(is)i(equal)h(to)h(`[PRIMAR)-8 b(Y]')32 b(or)f(`[P]',)g(then)f
+(the)h(primary)d(arra)m(y)j(\(the)g(\014rst)f(HDU\))h(will)d(b)s(e)i
+(op)s(ened.)0 3717 y(FITS)k(images)h(are)g(most)h(commonly)e(stored)h
+(in)f(the)h(primary)e(arra)m(y)i(or)g(an)g(image)g(extension,)h(but)e
+(images)0 3830 y(can)d(also)g(b)s(e)f(stored)h(as)h(a)f(v)m(ector)h(in)
+e(a)h(single)f(cell)g(of)h(a)h(binary)d(table)i(\(i.e.)42
+b(eac)m(h)32 b(ro)m(w)f(of)g(the)h(v)m(ector)g(column)0
+3943 y(con)m(tains)c(a)h(di\013eren)m(t)e(image\).)41
+b(Suc)m(h)27 b(an)h(image)h(can)f(b)s(e)g(op)s(ened)f(with)g(CFITSIO)f
+(b)m(y)i(sp)s(ecifying)e(the)i(desired)0 4056 y(column)j(name)h(and)f
+(the)h(ro)m(w)g(n)m(um)m(b)s(er)f(after)h(the)g(binary)e(table)i(HDU)h
+(sp)s(eci\014er)d(as)i(sho)m(wn)g(in)e(the)i(follo)m(wing)0
+4169 y(examples.)70 b(The)40 b(column)f(name)i(is)e(separated)i(from)f
+(the)h(HDU)g(sp)s(eci\014er)e(b)m(y)h(a)h(semicolon)e(and)h(the)h(ro)m
+(w)0 4282 y(n)m(um)m(b)s(er)29 b(is)g(enclosed)h(in)e(paren)m(theses.)
+41 b(In)30 b(this)f(case)i(CFITSIO)d(copies)i(the)g(image)h(from)e(the)
+i(table)f(cell)f(in)m(to)0 4394 y(a)j(temp)s(orary)e(primary)g(arra)m
+(y)h(b)s(efore)g(it)g(is)f(op)s(ened.)43 b(The)30 b(application)g
+(program)h(then)g(just)g(sees)g(the)h(image)0 4507 y(in)h(the)i
+(primary)d(arra)m(y)-8 b(,)37 b(without)c(an)m(y)i(extensions.)52
+b(The)34 b(particular)e(ro)m(w)j(to)g(b)s(e)e(op)s(ened)h(ma)m(y)h(b)s
+(e)f(sp)s(eci\014ed)0 4620 y(either)27 b(b)m(y)g(giving)f(an)h
+(absolute)g(in)m(teger)h(ro)m(w)g(n)m(um)m(b)s(er)e(\(starting)h(with)f
+(1)i(for)f(the)g(\014rst)g(ro)m(w\),)i(or)e(b)m(y)g(sp)s(ecifying)0
+4733 y(a)33 b(b)s(o)s(olean)e(expression)g(that)i(ev)-5
+b(aluates)33 b(to)g(TR)m(UE)g(for)f(the)g(desired)f(ro)m(w.)47
+b(The)32 b(\014rst)f(ro)m(w)i(that)g(satis\014es)f(the)0
+4846 y(expression)27 b(will)e(b)s(e)j(used.)39 b(The)28
+b(ro)m(w)g(selection)g(expression)f(has)h(the)g(same)g(syn)m(tax)h(as)f
+(describ)s(ed)e(in)h(the)h(Ro)m(w)0 4959 y(Filter)i(Sp)s(eci\014er)e
+(section,)j(b)s(elo)m(w.)0 5119 y(Examples:)143 5375
+y Fe(myfile.fits[3])44 b(-)k(open)e(the)h(3rd)g(HDU)g(following)e(the)i
+(primary)f(array)143 5488 y(myfile.fits+3)92 b(-)48 b(same)e(as)h
+(above,)f(but)h(using)g(the)g(FTOOLS-style)d(notation)143
+5601 y(myfile.fits[EVENTS])f(-)k(open)g(the)g(extension)e(that)i(has)g
+(EXTNAME)e(=)j('EVENTS')143 5714 y(myfile.fits[EVENTS,)43
+b(2])95 b(-)47 b(same)g(as)g(above,)f(but)h(also)g(requires)e(EXTVER)h
+(=)i(2)p eop
+%%Page: 116 124
+116 123 bop 0 299 a Fj(116)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)143 555 y
+Fe(myfile.fits[events,2,b])42 b(-)47 b(same,)f(but)h(also)g(requires)f
+(XTENSION)f(=)j('BINTABLE')143 668 y(myfile.fits[3;)c(images\(17\)])h
+(-)i(opens)g(the)g(image)f(in)h(row)g(17)g(of)g(the)g('images')1527
+781 y(column)f(in)i(the)e(3rd)h(extension)f(of)h(the)g(file.)143
+894 y(myfile.fits[3;)d(images\(exposure)g(>)j(100\)])g(-)g(as)g(above,)
+f(but)h(opens)g(the)f(image)907 1007 y(in)h(the)g(first)f(row)h(that)g
+(has)g(an)g('exposure')e(column)h(value)907 1120 y(greater)g(than)g
+(100.)0 1449 y Ff(10.8)136 b(Image)46 b(Section)0 1699
+y Fj(A)41 b(virtual)e(\014le)g(con)m(taining)h(a)h(rectangular)g
+(subsection)e(of)i(an)g(image)f(can)h(b)s(e)f(extracted)i(and)e(op)s
+(ened)g(b)m(y)0 1812 y(sp)s(ecifying)30 b(the)j(range)g(of)g(pixels)e
+(\(start:end\))i(along)g(eac)m(h)h(axis)e(to)h(b)s(e)f(extracted)i
+(from)e(the)h(original)d(image.)0 1925 y(One)g(can)h(also)g(sp)s(ecify)
+e(an)i(optional)f(pixel)f(incremen)m(t)h(\(start:end:step\))i(for)f
+(eac)m(h)h(axis)e(of)h(the)g(input)d(image.)0 2038 y(A)g(pixel)d(step)j
+(=)f(1)h(will)d(b)s(e)i(assumed)f(if)h(it)g(is)f(not)i(sp)s(eci\014ed.)
+38 b(If)27 b(the)h(start)g(pixel)e(is)g(larger)i(then)f(the)h(end)e
+(pixel,)0 2151 y(then)32 b(the)g(image)g(will)d(b)s(e)i(\015ipp)s(ed)e
+(\(pro)s(ducing)h(a)i(mirror)f(image\))h(along)g(that)g(dimension.)43
+b(An)32 b(asterisk,)g('*',)0 2264 y(ma)m(y)39 b(b)s(e)e(used)h(to)h(sp)
+s(ecify)e(the)h(en)m(tire)g(range)h(of)f(an)h(axis,)h(and)d('-*')j
+(will)35 b(\015ip)i(the)h(en)m(tire)g(axis.)64 b(The)38
+b(input)0 2377 y(image)30 b(can)g(b)s(e)f(in)f(the)i(primary)e(arra)m
+(y)-8 b(,)31 b(in)d(an)h(image)h(extension,)g(or)g(con)m(tained)f(in)g
+(a)h(v)m(ector)h(cell)e(of)h(a)g(binary)0 2490 y(table.)39
+b(In)25 b(the)h(later)g(2)g(cases)h(the)f(extension)g(name)g(or)f(n)m
+(um)m(b)s(er)g(m)m(ust)h(b)s(e)f(sp)s(eci\014ed)f(b)s(efore)i(the)g
+(image)g(section)0 2603 y(sp)s(eci\014er.)0 2763 y(Examples:)95
+2996 y Fe(myfile.fits[1:512:2,)43 b(2:512:2])i(-)95 b(open)47
+b(a)h(256x256)d(pixel)i(image)668 3109 y(consisting)e(of)i(the)g(odd)g
+(numbered)f(columns)g(\(1st)g(axis\))h(and)668 3222 y(the)g(even)g
+(numbered)e(rows)i(\(2nd)g(axis\))f(of)h(the)g(image)f(in)i(the)668
+3335 y(primary)e(array)g(of)i(the)e(file.)95 3561 y(myfile.fits[*,)e
+(512:256])i(-)h(open)g(an)g(image)g(consisting)e(of)i(all)g(the)g
+(columns)668 3674 y(in)g(the)g(input)g(image,)f(but)h(only)f(rows)h
+(256)g(through)f(512.)668 3787 y(The)h(image)f(will)h(be)g(flipped)f
+(along)g(the)h(2nd)g(axis)g(since)668 3900 y(the)g(starting)f(pixel)g
+(is)h(greater)f(than)h(the)g(ending)f(pixel.)95 4125
+y(myfile.fits[*:2,)e(512:256:2])h(-)i(same)g(as)g(above)f(but)h
+(keeping)f(only)668 4238 y(every)h(other)f(row)h(and)g(column)f(in)h
+(the)g(input)f(image.)95 4464 y(myfile.fits[-*,)e(*])j(-)h(copy)e(the)h
+(entire)f(image,)g(flipping)g(it)h(along)668 4577 y(the)g(first)f
+(axis.)95 4803 y(myfile.fits[3][1:256,1:256)o(])c(-)47
+b(opens)g(a)g(subsection)e(of)i(the)g(image)g(that)668
+4916 y(is)g(in)h(the)e(3rd)h(extension)f(of)h(the)g(file.)95
+5142 y(myfile.fits[4;)d(images\(12\)][1:10,1:10])e(-)48
+b(open)e(an)h(image)g(consisting)286 5255 y(of)h(the)e(first)h(10)g
+(pixels)f(in)h(both)g(dimensions.)e(The)i(original)286
+5367 y(image)g(resides)f(in)h(the)g(12th)f(row)h(of)g(the)g('images')f
+(vector)286 5480 y(column)g(in)i(the)f(table)f(in)h(the)g(4th)g
+(extension)e(of)i(the)g(file.)0 5714 y Fj(When)23 b(CFITSIO)f(op)s(ens)
+h(an)g(image)g(section)h(it)f(\014rst)g(creates)h(a)g(temp)s(orary)f
+(\014le)g(con)m(taining)g(the)g(image)h(section)p eop
+%%Page: 117 125
+117 124 bop 0 299 a Fh(10.9.)73 b(COLUMN)30 b(AND)h(KEYW)m(ORD)g(FIL)-8
+b(TERING)30 b(SPECIFICA)-8 b(TION)1030 b Fj(117)0 555
+y(plus)31 b(a)j(cop)m(y)g(of)g(an)m(y)g(other)f(HDUs)h(in)e(the)i
+(\014le.)49 b(This)31 b(temp)s(orary)i(\014le)g(is)f(then)h(op)s(ened)g
+(b)m(y)g(the)h(application)0 668 y(program,)28 b(so)g(it)f(is)f(not)i
+(p)s(ossible)d(to)j(write)f(to)h(or)g(mo)s(dify)e(the)h(input)f(\014le)
+g(when)h(sp)s(ecifying)e(an)j(image)g(section.)0 781
+y(Note)39 b(that)f(CFITSIO)e(automatically)h(up)s(dates)g(the)g(w)m
+(orld)g(co)s(ordinate)g(system)h(k)m(eyw)m(ords)f(in)f(the)i(header)0
+894 y(of)33 b(the)h(image)f(section,)h(if)e(they)i(exist,)g(so)f(that)h
+(the)f(co)s(ordinate)g(asso)s(ciated)h(with)e(eac)m(h)i(pixel)d(in)h
+(the)i(image)0 1007 y(section)d(will)c(b)s(e)j(computed)g(correctly)-8
+b(.)0 1360 y Ff(10.9)136 b(Column)45 b(and)f(Keyw)l(ord)i(Filtering)g
+(Sp)t(eci\014cation)0 1615 y Fj(The)27 b(optional)g(column/k)m(eyw)m
+(ord)h(\014ltering)e(sp)s(eci\014er)g(is)h(used)g(to)i(mo)s(dify)d(the)
+i(column)f(structure)g(and/or)h(the)0 1728 y(header)38
+b(k)m(eyw)m(ords)h(in)e(the)i(HDU)g(that)h(w)m(as)f(selected)g(with)e
+(the)i(previous)e(HDU)i(lo)s(cation)f(sp)s(eci\014er.)64
+b(This)0 1840 y(\014ltering)40 b(sp)s(eci\014er)g(m)m(ust)i(b)s(e)f
+(enclosed)h(in)e(square)i(brac)m(k)m(ets)h(and)e(can)h(b)s(e)f
+(distinguished)d(from)k(a)g(general)0 1953 y(ro)m(w)d(\014lter)f(sp)s
+(eci\014er)f(\(describ)s(ed)g(b)s(elo)m(w\))h(b)m(y)h(the)g(fact)h
+(that)f(it)f(b)s(egins)f(with)h(the)h(string)f('col)h(')g(and)f(is)g
+(not)0 2066 y(immediately)27 b(follo)m(w)m(ed)h(b)m(y)g(an)g(equals)g
+(sign.)39 b(The)28 b(original)e(\014le)h(is)h(not)g(c)m(hanged)h(b)m(y)
+f(this)g(\014ltering)e(op)s(eration,)0 2179 y(and)40
+b(instead)g(the)h(mo)s(di\014cations)e(are)i(made)f(on)h(a)g(cop)m(y)g
+(of)g(the)g(input)e(FITS)h(\014le)f(\(usually)g(in)g(memory\),)0
+2292 y(whic)m(h)32 b(also)h(con)m(tains)g(a)g(cop)m(y)h(of)f(all)f(the)
+i(other)f(HDUs)h(in)d(the)i(\014le.)48 b(This)32 b(temp)s(orary)g
+(\014le)g(is)g(passed)h(to)h(the)0 2405 y(application)c(program)i(and)f
+(will)e(p)s(ersist)h(only)h(un)m(til)f(the)i(\014le)f(is)g(closed)h(or)
+g(un)m(til)e(the)i(program)f(exits,)i(unless)0 2518 y(the)e(out\014le)e
+(sp)s(eci\014er)g(\(see)i(ab)s(o)m(v)m(e\))h(is)e(also)g(supplied.)0
+2678 y(The)h(column/k)m(eyw)m(ord)g(\014lter)f(can)h(b)s(e)g(used)f(to)
+i(p)s(erform)e(the)i(follo)m(wing)d(op)s(erations.)43
+b(More)32 b(than)f(one)g(op)s(er-)0 2791 y(ation)f(ma)m(y)h(b)s(e)f(sp)
+s(eci\014ed)f(b)m(y)h(separating)g(them)g(with)g(semi-colons.)136
+3068 y Fc(\017)46 b Fj(Cop)m(y)36 b(only)f(a)h(sp)s(eci\014ed)f(list)f
+(of)i(columns)f(columns)f(to)j(the)f(\014ltered)f(input)f(\014le.)56
+b(The)36 b(list)e(of)i(column)227 3181 y(name)c(should)e(b)s(e)i
+(separated)g(b)m(y)g(semi-colons.)46 b(Wild)30 b(card)i(c)m(haracters)i
+(ma)m(y)e(b)s(e)g(used)f(in)g(the)h(column)227 3294 y(names)37
+b(to)h(matc)m(h)g(m)m(ultiple)d(columns.)60 b(If)37 b(the)g(expression)
+f(con)m(tains)i(b)s(oth)e(a)i(list)d(of)j(columns)e(to)i(b)s(e)227
+3406 y(included)f(and)h(columns)g(to)h(b)s(e)g(deleted,)i(then)d(all)g
+(the)h(columns)f(in)g(the)h(original)e(table)i(except)h(the)227
+3519 y(explicitly)28 b(deleted)i(columns)f(will)e(app)s(ear)j(in)f(the)
+h(\014ltered)f(table)h(\(i.e.,)h(there)f(is)g(no)g(need)f(to)i
+(explicitly)227 3632 y(list)e(the)i(columns)e(to)i(b)s(e)f(included)d
+(if)j(an)m(y)g(columns)f(are)i(b)s(eing)e(deleted\).)136
+3837 y Fc(\017)46 b Fj(Delete)31 b(a)e(column)f(or)h(k)m(eyw)m(ord)h(b)
+m(y)f(listing)e(the)i(name)g(preceded)g(b)m(y)g(a)g(min)m(us)f(sign)g
+(or)h(an)g(exclamation)227 3950 y(mark)c(\(!\),)h(e.g.,)i('-TIME')d
+(will)d(delete)j(the)f(TIME)h(column)e(if)g(it)i(exists,)g(otherwise)f
+(the)h(TIME)f(k)m(eyw)m(ord.)227 4063 y(An)35 b(error)f(is)g(returned)f
+(if)h(neither)f(a)j(column)d(nor)h(k)m(eyw)m(ord)h(with)f(this)f(name)i
+(exists.)53 b(Note)36 b(that)g(the)227 4176 y(exclamation)25
+b(p)s(oin)m(t,)h(')10 b(!',)27 b(is)d(a)h(sp)s(ecial)f(UNIX)h(c)m
+(haracter,)j(so)d(if)f(it)h(is)f(used)g(on)h(the)g(command)g(line)e
+(rather)227 4289 y(than)33 b(en)m(tered)h(at)g(a)g(task)g(prompt,)f(it)
+g(m)m(ust)g(b)s(e)g(preceded)g(b)m(y)g(a)h(bac)m(kslash)f(to)h(force)g
+(the)f(UNIX)h(shell)227 4401 y(to)d(ignore)f(it.)136
+4606 y Fc(\017)46 b Fj(Rename)29 b(an)g(existing)e(column)g(or)i(k)m
+(eyw)m(ord)g(with)e(the)i(syn)m(tax)g('NewName)h(==)e(OldName'.)39
+b(An)28 b(error)227 4719 y(is)i(returned)f(if)g(neither)h(a)g(column)f
+(nor)h(k)m(eyw)m(ord)h(with)e(this)h(name)g(exists.)136
+4924 y Fc(\017)46 b Fj(App)s(end)37 b(a)j(new)f(column)e(or)j(k)m(eyw)m
+(ord)f(to)h(the)f(table.)67 b(T)-8 b(o)40 b(create)g(a)g(column,)g(giv)
+m(e)g(the)f(new)g(name,)227 5036 y(optionally)32 b(follo)m(w)m(ed)g(b)m
+(y)h(the)g(data)h(t)m(yp)s(e)f(in)e(paren)m(theses,)j(follo)m(w)m(ed)f
+(b)m(y)g(a)g(single)f(equals)g(sign)g(and)g(an)227 5149
+y(expression)i(to)i(b)s(e)e(used)g(to)i(compute)f(the)g(v)-5
+b(alue)34 b(\(e.g.,)k('new)m(col\(1J\))e(=)f(0')g(will)e(create)j(a)f
+(new)g(32-bit)227 5262 y(in)m(teger)h(column)d(called)i('new)m(col')g
+(\014lled)e(with)h(zeros\).)55 b(The)35 b(data)g(t)m(yp)s(e)h(is)e(sp)s
+(eci\014ed)f(using)g(the)j(same)227 5375 y(syn)m(tax)j(that)g(is)e
+(allo)m(w)m(ed)h(for)g(the)g(v)-5 b(alue)38 b(of)g(the)g(FITS)f(TF)m
+(ORMn)h(k)m(eyw)m(ord)h(\(e.g.,)j('I',)d('J',)f('E',)h('D',)227
+5488 y(etc.)66 b(for)38 b(binary)e(tables,)41 b(and)c('I8',)k(F12.3',)i
+('E20.12',)g(etc.)65 b(for)38 b(ASCI)s(I)f(tables\).)65
+b(If)37 b(the)i(data)g(t)m(yp)s(e)227 5601 y(is)34 b(not)h(sp)s
+(eci\014ed)e(then)h(an)g(appropriate)g(data)h(t)m(yp)s(e)g(will)d(b)s
+(e)i(c)m(hosen)h(dep)s(ending)d(on)i(the)h(form)f(of)h(the)227
+5714 y(expression)43 b(\(ma)m(y)h(b)s(e)f(a)h(c)m(haracter)i(string,)g
+(logical,)h(bit,)f(long)d(in)m(teger,)48 b(or)43 b(double)g(column\).)
+79 b(An)p eop
+%%Page: 118 126
+118 125 bop 0 299 a Fj(118)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)227 555 y
+Fj(appropriate)38 b(v)m(ector)j(coun)m(t)e(\(in)f(the)h(case)h(of)f
+(binary)e(tables\))i(will)d(also)j(b)s(e)f(added)g(if)g(not)h
+(explicitly)227 668 y(sp)s(eci\014ed.)227 819 y(When)26
+b(creating)g(a)g(new)f(k)m(eyw)m(ord,)j(the)e(k)m(eyw)m(ord)g(name)g(m)
+m(ust)g(b)s(e)f(preceded)g(b)m(y)h(a)g(p)s(ound)e(sign)g('#',)k(and)227
+932 y(the)h(expression)e(m)m(ust)h(ev)-5 b(aluate)29
+b(to)g(a)g(scalar)f(\(i.e.,)h(cannot)g(ha)m(v)m(e)h(a)f(column)e(name)h
+(in)f(the)i(expression\).)227 1045 y(The)j(commen)m(t)i(string)e(for)g
+(the)h(k)m(eyw)m(ord)h(ma)m(y)f(b)s(e)f(sp)s(eci\014ed)f(in)g(paren)m
+(theses)i(immediately)e(follo)m(wing)227 1158 y(the)c(k)m(eyw)m(ord)g
+(name)f(\(instead)g(of)h(supplying)c(a)k(data)g(t)m(yp)s(e)g(as)f(in)f
+(the)i(case)g(of)g(creating)g(a)g(new)f(column\).)136
+1348 y Fc(\017)46 b Fj(Recompute)f(\(o)m(v)m(erwrite\))h(the)e(v)-5
+b(alues)43 b(in)g(an)h(existing)g(column)f(or)h(k)m(eyw)m(ord)g(b)m(y)g
+(giving)g(the)g(name)227 1461 y(follo)m(w)m(ed)30 b(b)m(y)h(an)f
+(equals)g(sign)f(and)h(an)g(arithmetic)g(expression.)0
+1722 y(The)23 b(expression)f(that)j(is)d(used)h(when)g(app)s(ending)e
+(or)i(recomputing)g(columns)f(or)i(k)m(eyw)m(ords)g(can)g(b)s(e)f
+(arbitrarily)0 1835 y(complex)35 b(and)h(ma)m(y)g(b)s(e)f(a)h(function)
+f(of)h(other)g(header)g(k)m(eyw)m(ord)g(v)-5 b(alues)35
+b(and)g(other)h(columns)f(\(in)g(the)h(same)0 1948 y(ro)m(w\).)63
+b(The)37 b(full)e(syn)m(tax)k(and)e(a)m(v)-5 b(ailable)37
+b(functions)f(for)h(the)h(expression)e(are)i(describ)s(ed)e(b)s(elo)m
+(w)h(in)f(the)i(ro)m(w)0 2061 y(\014lter)29 b(sp)s(eci\014cation)h
+(section.)0 2221 y(F)-8 b(or)30 b(complex)g(or)f(commonly)g(used)g(op)s
+(erations,)h(one)f(can)h(also)g(place)g(the)f(op)s(erations)g(in)m(to)h
+(an)f(external)h(text)0 2334 y(\014le)g(and)g(imp)s(ort)f(it)h(in)m(to)
+h(the)g(column)f(\014lter)f(using)h(the)h(syn)m(tax)g('[col)g
+(@\014lename.txt]'.)42 b(The)31 b(op)s(erations)f(can)0
+2447 y(extend)c(o)m(v)m(er)i(m)m(ultiple)c(lines)h(of)h(the)h(\014le,)g
+(but)e(m)m(ultiple)f(op)s(erations)i(m)m(ust)g(still)f(b)s(e)g
+(separated)i(b)m(y)g(semicolons.)0 2560 y(An)m(y)h(lines)f(in)g(the)h
+(external)h(text)g(\014le)e(that)i(b)s(egin)e(with)g(2)i(slash)e(c)m
+(haracters)j(\('//'\))g(will)c(b)s(e)h(ignored)h(and)f(ma)m(y)0
+2673 y(b)s(e)j(used)f(to)i(add)f(commen)m(ts)h(in)m(to)g(the)f(\014le.)
+0 2833 y(Examples:)143 3095 y Fe([col)47 b(Time;rate])713
+b(-)47 b(only)g(the)g(Time)g(and)g(rate)f(columns)g(will)1670
+3208 y(appear)h(in)g(the)g(filtered)e(input)i(file.)143
+3434 y([col)g(Time;*raw])713 b(-)47 b(include)f(the)h(Time)g(column)f
+(and)h(any)g(other)1670 3546 y(columns)f(whose)h(name)f(ends)h(with)g
+('raw'.)143 3772 y([col)g(-TIME;)f(Good)h(==)g(STATUS])141
+b(-)47 b(deletes)f(the)h(TIME)g(column)f(and)1670 3885
+y(renames)g(the)h(status)f(column)g(to)i('Good')143 4111
+y([col)f(PI=PHA)f(*)h(1.1)g(+)h(0.2])285 b(-)47 b(creates)f(new)h(PI)g
+(column)f(from)h(PHA)g(values)143 4337 y([col)g(rate)f(=)i
+(rate/exposure])139 b(-)48 b(recomputes)d(the)i(rate)f(column)g(by)i
+(dividing)1670 4450 y(it)g(by)f(the)g(EXPOSURE)e(keyword)h(value.)0
+4786 y Ff(10.10)136 b(Ro)l(w)46 b(Filtering)g(Sp)t(eci\014cation)0
+5036 y Fj(When)29 b(en)m(tering)g(the)g(name)g(of)g(a)g(FITS)f(table)h
+(that)h(is)d(to)j(b)s(e)e(op)s(ened)h(b)m(y)f(a)i(program,)f(an)g
+(optional)f(ro)m(w)h(\014lter)0 5149 y(ma)m(y)i(b)s(e)g(sp)s(eci\014ed)
+e(to)i(select)g(a)h(subset)e(of)h(the)g(ro)m(ws)f(in)g(the)h(table.)42
+b(A)31 b(temp)s(orary)f(new)g(FITS)g(\014le)g(is)g(created)0
+5262 y(on)25 b(the)h(\015y)e(whic)m(h)g(con)m(tains)h(only)g(those)h
+(ro)m(ws)f(for)g(whic)m(h)f(the)h(ro)m(w)g(\014lter)g(expression)f(ev)
+-5 b(aluates)25 b(to)h(true.)39 b(\(The)0 5375 y(primary)25
+b(arra)m(y)i(and)f(an)m(y)g(other)h(extensions)f(in)f(the)i(input)e
+(\014le)g(are)i(also)g(copied)f(to)h(the)f(temp)s(orary)h(\014le\).)38
+b(The)0 5488 y(original)27 b(FITS)i(\014le)f(is)g(closed)h(and)f(the)i
+(new)e(virtual)g(\014le)g(is)g(op)s(ened)g(b)m(y)h(the)h(application)d
+(program.)40 b(The)29 b(ro)m(w)0 5601 y(\014lter)36 b(expression)g(is)h
+(enclosed)g(in)f(square)h(brac)m(k)m(ets)i(follo)m(wing)d(the)h(\014le)
+g(name)g(and)g(extension)g(name)g(\(e.g.,)0 5714 y('\014le.\014ts[ev)m
+(en)m(ts][GRADE==50]')28 b(selects)d(only)f(those)i(ro)m(ws)f(where)f
+(the)h(GRADE)h(column)e(v)-5 b(alue)24 b(equals)g(50\).)p
 eop
-%%Page: 124 130
-124 129 bop 0 299 a Fj(124)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
-555 y Fj(v)-5 b(ariable)23 b(length)h(arra)m(y)h(columns)e(\(with)g(TF)
-m(ORMn)h(=)g('Pt'\).)40 b(This)22 b(routine)i(also)g(automatically)g
-(writes)227 668 y(the)35 b(v)-5 b(alue)34 b(of)h(theap)f(to)h(a)g(k)m
-(eyw)m(ord)g(in)f(the)g(extension)g(header.)53 b(This)33
-b(routine)g(m)m(ust)i(b)s(e)f(called)f(after)227 781
-y(the)27 b(required)e(k)m(eyw)m(ords)i(ha)m(v)m(e)h(b)s(een)e(written)g
-(\(with)g(\013ph)m(bn\))g(and)g(after)h(the)g(table)g(structure)f(has)h
-(b)s(een)227 894 y(de\014ned)i(\(with)h(\013b)s(def)7
-b(\))29 b(but)h(b)s(efore)g(an)m(y)h(data)g(is)e(written)h(to)h(the)f
-(table.)95 1175 y Ff(int)47 b(fits_write_theap)d(/)j(ffpthp)286
-1288 y(\(fitsfile)f(*fptr,)g(long)g(theap,)g(>)i(int)f(*status\))0
-1604 y Fd(8.6.2)112 b(Lo)m(w-Lev)m(el)38 b(T)-9 b(able)37
-b(Access)g(Routines)0 1828 y Fj(The)g(follo)m(wing)g(2)h(routines)e
-(pro)m(vide)h(lo)m(w-lev)m(el)h(access)h(to)g(the)f(data)g(in)f(ASCI)s
-(I)f(or)i(binary)e(tables)h(and)h(are)0 1941 y(mainly)27
-b(useful)g(as)j(an)f(e\016cien)m(t)g(w)m(a)m(y)h(to)g(cop)m(y)g(all)e
-(or)h(part)g(of)g(a)g(table)g(from)g(one)g(lo)s(cation)g(to)h(another.)
-40 b(These)0 2054 y(routines)23 b(simply)f(read)i(or)h(write)e(the)i
-(sp)s(eci\014ed)d(n)m(um)m(b)s(er)h(of)i(consecutiv)m(e)g(b)m(ytes)g
-(in)e(an)h(ASCI)s(I)f(or)h(binary)f(table,)0 2167 y(without)g(regard)h
-(for)f(column)g(b)s(oundaries)e(or)j(the)g(ro)m(w)g(length)f(in)f(the)i
-(table.)39 b(These)23 b(routines)g(do)g(not)h(p)s(erform)0
-2279 y(an)m(y)36 b(mac)m(hine)g(dep)s(enden)m(t)f(data)i(con)m(v)m
-(ersion)f(or)h(b)m(yte)f(sw)m(apping.)57 b(See)36 b(App)s(endix)d(B)k
-(for)f(the)g(de\014nition)e(of)0 2392 y(the)d(parameters)f(used)g(in)f
-(these)i(routines.)0 2674 y Fi(1)81 b Fj(Read)30 b(a)h(consecutiv)m(e)g
-(arra)m(y)g(of)g(b)m(ytes)g(from)e(an)i(ASCI)s(I)e(or)h(binary)e(table)
-95 2955 y Ff(int)47 b(fits_read_tblbytes)c(/)48 b(ffgtbb)286
-3068 y(\(fitsfile)e(*fptr,)g(long)g(firstrow,)g(long)g(firstchar,)f
-(long)i(nchars,)334 3180 y(>)h(unsigned)d(char)i(*values,)e(int)i
-(*status\))0 3462 y Fi(2)81 b Fj(W)-8 b(rite)30 b(a)h(consecutiv)m(e)g
-(arra)m(y)g(of)g(b)m(ytes)g(to)g(an)f(ASCI)s(I)f(or)h(binary)f(table)95
-3743 y Ff(int)47 b(fits_write_tblbytes)c(/)k(ffptbb)286
-3856 y(\(fitsfile)f(*fptr,)g(long)g(firstrow,)g(long)g(firstchar,)f
-(long)i(nchars,)334 3969 y(unsigned)f(char)g(*values,)g(>)h(int)g
-(*status\))0 4285 y Fd(8.6.3)112 b(Sp)s(ecialized)37
-b(W)-9 b(rite)35 b(Column)h(Data)i(Routines)0 4509 y
-Fi(1)81 b Fj(W)-8 b(rite)29 b(elemen)m(ts)g(in)m(to)g(an)g(ASCI)s(I)f
-(or)h(binary)e(table)i(column)f(\(in)g(the)h(CDU\).)h(The)f(datat)m(yp)
-s(e)h(of)f(the)g(arra)m(y)227 4622 y(is)h(implied)d(b)m(y)j(the)h
-(su\016x)e(of)i(the)f(routine)g(name.)95 4903 y Ff(int)47
-b(fits_write_col_str)c(/)48 b(ffpcls)286 5016 y(\(fitsfile)e(*fptr,)g
-(int)h(colnum,)e(long)i(firstrow,)e(long)i(firstelem,)334
-5129 y(long)g(nelements,)e(char)h(**array,)g(>)h(int)g(*status\))95
-5355 y(int)g(fits_write_col_[log,byt,sh)o(t,u)o(sht,)o(int,)o(uin)o
-(t,ln)o(g,ul)o(ng,)o(flt,)o(dbl,)o(cmp)o(,dbl)o(cmp])41
-b(/)286 5468 y(ffpcl[l,b,i,ui,k,uk,j,uj,e)o(,d,)o(c,m])286
-5581 y(\(fitsfile)46 b(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)525
-5694 y(long)g(firstelem,)e(long)h(nelements,)f(DTYPE)i(*array,)e(>)j
-(int)f(*status\))p eop
-%%Page: 125 131
-125 130 bop 0 299 a Fh(8.6.)72 b(SPECIALIZED)29 b(FITS)g(ASCI)s(I)g
-(AND)i(BINAR)-8 b(Y)32 b(T)-8 b(ABLE)30 b(R)m(OUTINES)933
-b Fj(125)0 555 y Fi(2)81 b Fj(W)-8 b(rite)35 b(elemen)m(ts)h(in)m(to)g
-(an)f(ASCI)s(I)f(or)i(binary)d(table)j(column)e(substituting)f(the)j
-(appropriate)e(FITS)h(n)m(ull)227 668 y(v)-5 b(alue)37
-b(for)h(an)m(y)g(elemen)m(ts)g(that)g(are)g(equal)f(to)i(the)f(n)m(ulv)
--5 b(al)36 b(parameter.)63 b(This)36 b(routines)g(m)m(ust)i(not)g(b)s
-(e)227 781 y(used)30 b(to)h(write)f(to)h(v)-5 b(ariable)29
-b(length)h(arra)m(y)g(columns.)95 1010 y Ff(int)47 b
-(fits_write_colnull_[log,)42 b(byt,)k(sht,)h(usht,)f(int,)h(uint,)f
-(lng,)h(ulng,)f(flt,)h(dbl])f(/)286 1123 y(ffpcn[l,b,i,ui,k,uk,j,uj,e)o
-(,d])286 1236 y(\(fitsfile)g(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)
-e(long)i(firstelem,)334 1349 y(long)g(nelements,)e(DTYPE)h(*array,)g
-(DTYPE)g(nulval,)g(>)i(int)e(*status\))0 1578 y Fi(3)81
-b Fj(W)-8 b(rite)26 b(string)g(elemen)m(ts)h(in)m(to)f(a)h(binary)e
-(table)h(column)f(\(in)h(the)g(CDU\))i(substituting)c(the)i(FITS)g(n)m
-(ull)e(v)-5 b(alue)227 1691 y(for)28 b(an)m(y)f(elemen)m(ts)h(that)g
-(are)g(equal)f(to)i(the)e(n)m(ulstr)f(string.)39 b(This)26
-b(routine)g(m)m(ust)i(NOT)f(b)s(e)g(used)f(to)j(write)227
-1804 y(to)i(v)-5 b(ariable)30 b(length)f(arra)m(y)i(columns.)95
-2034 y Ff(int)47 b(fits_write_colnull_str)42 b(/)48 b(ffpcns)286
-2146 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
-(firstelem,)334 2259 y(long)g(nelements,)e(char)h(**array,)g(char)h
-(*nulstr,)e(>)j(int)e(*status\))0 2489 y Fi(4)81 b Fj(W)-8
-b(rite)33 b(bit)f(v)-5 b(alues)32 b(in)m(to)h(a)h(binary)d(b)m(yte)i
-(\('B'\))i(or)e(bit)f(\('X'\))i(table)f(column)f(\(in)g(the)h(CDU\).)h
-(Larra)m(y)f(is)f(an)227 2602 y(arra)m(y)j(of)g(logical)f(v)-5
-b(alues)33 b(corresp)s(onding)g(to)i(the)f(sequence)h(of)g(bits)e(to)i
-(b)s(e)f(written.)52 b(If)34 b(larra)m(y)g(is)f(true)227
-2715 y(then)f(the)g(corresp)s(onding)e(bit)h(is)g(set)h(to)h(1,)g
-(otherwise)e(the)h(bit)f(is)g(set)i(to)g(0.)45 b(Note)34
-b(that)e(in)f(the)h(case)h(of)227 2827 y('X')d(columns,)e(CFITSIO)f
-(can)i(write)f(to)h(all)f(8)h(bits)e(of)i(eac)m(h)h(b)m(yte)g(whether)e
-(they)h(are)g(formally)e(v)-5 b(alid)27 b(or)227 2940
-y(not.)45 b(Th)m(us)30 b(if)h(the)g(column)g(is)f(de\014ned)g(as)i
-('4X',)h(and)e(one)h(calls)e(\013p)s(clx)g(with)h(\014rstbit=1)f(and)h
-(n)m(bits=8,)227 3053 y(then)j(all)f(8)h(bits)f(will)e(b)s(e)i(written)
-g(in)m(to)h(the)g(\014rst)g(b)m(yte)g(\(as)h(opp)s(osed)e(to)i(writing)
-c(the)k(\014rst)e(4)h(bits)f(in)m(to)227 3166 y(the)e(\014rst)f(ro)m(w)
-g(and)g(then)g(the)h(next)f(4)h(bits)e(in)m(to)i(the)f(next)h(ro)m
-(w\),)g(ev)m(en)g(though)f(the)h(last)f(4)h(bits)e(of)i(eac)m(h)227
-3279 y(b)m(yte)37 b(are)f(formally)e(not)h(de\014ned.)56
-b(It)35 b(should)f(also)i(b)s(e)f(noted)g(that)i(it)e(is)f(more)i
-(e\016cien)m(t)g(to)h(write)d('X')227 3392 y(columns)f(an)h(en)m(tire)h
-(b)m(yte)g(at)g(a)f(time,)i(instead)d(of)i(bit)e(b)m(y)h(bit.)52
-b(An)m(y)34 b(of)h(the)f(CFITSIO)f(routines)g(that)227
-3505 y(write)g(to)i(columns)d(\(e.g.)52 b(\014ts)p 1284
-3505 28 4 v 33 w(write)p 1520 3505 V 32 w(col)p 1663
-3505 V 33 w(b)m(yt\))34 b(ma)m(y)g(b)s(e)f(used)g(for)h(this)e(purp)s
-(ose.)49 b(These)34 b(routines)f(will)227 3618 y(in)m(terpret)g('X')g
-(columns)f(as)h(though)g(they)h(w)m(ere)f('B')h(columns)e(\(e.g.,)j
-('8X')f(is)f(equiv)-5 b(alen)m(t)32 b(to)i('1B',)h(and)227
-3731 y('16X')d(is)e(equiv)-5 b(alen)m(t)29 b(to)j('2B'\).)95
-3960 y Ff(int)47 b(fits_write_col_bit)c(/)48 b(ffpclx)286
-4073 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
-(firstbit,)334 4186 y(long)g(nbits,)f(char)g(*larray,)g(>)h(int)g
-(*status\))0 4415 y Fi(5)81 b Fj(W)-8 b(rite)28 b(the)g(descriptor)e
-(for)i(a)g(v)-5 b(ariable)26 b(length)h(column)g(in)f(a)i(binary)e
-(table.)40 b(This)26 b(routine)g(can)i(b)s(e)f(used)g(in)227
-4528 y(conjunction)k(with)f(FF)m(GDES)j(to)f(enable)f(2)h(or)g(more)f
-(arra)m(ys)h(to)h(p)s(oin)m(t)d(to)j(the)e(same)h(storage)h(lo)s
-(cation)227 4641 y(to)e(sa)m(v)m(e)h(storage)g(space)f(if)e(the)i(arra)
-m(ys)g(are)g(iden)m(tical.)191 4870 y Ff(int)47 b(fits_write_descript)
-42 b(/)48 b(ffpdes)382 4983 y(\(fitsfile)d(*fptr,)h(int)h(colnum,)f
-(long)h(rownum,)e(long)i(repeat,)430 5096 y(long)f(offset,)g(>)h(int)g
-(*status\))0 5382 y Fd(8.6.4)112 b(Sp)s(ecialized)37
-b(Read)g(Column)g(Data)h(Routines)0 5601 y Fj(Tw)m(o)28
-b(t)m(yp)s(es)f(of)h(routines)e(are)i(pro)m(vided)e(to)i(get)h(the)e
-(column)g(data)h(whic)m(h)e(di\013er)g(in)g(the)i(w)m(a)m(y)h
-(unde\014ned)c(pixels)0 5714 y(are)40 b(handled.)65 b(The)39
-b(\014rst)g(set)h(of)f(routines)f(\(\013gcv\))j(simply)c(return)h(an)h
-(arra)m(y)h(of)g(data)g(elemen)m(ts)f(in)f(whic)m(h)p
+%%Page: 119 127
+119 126 bop 0 299 a Fh(10.10.)73 b(R)m(O)m(W)31 b(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)1936 b Fj(119)0 555
+y(When)33 b(dealing)f(with)g(tables)g(where)h(eac)m(h)h(ro)m(w)f(has)g
+(an)g(asso)s(ciated)h(time)f(and/or)g(2D)g(spatial)g(p)s(osition,)f
+(the)0 668 y(ro)m(w)g(\014lter)g(expression)e(can)j(also)f(b)s(e)g
+(used)f(to)i(select)g(ro)m(ws)f(based)g(on)g(the)g(times)g(in)f(a)h(Go)
+s(o)s(d)g(Time)f(In)m(terv)-5 b(als)0 781 y(\(GTI\))31
+b(extension,)f(or)g(on)h(spatial)e(p)s(osition)g(as)h(giv)m(en)h(in)e
+(a)h(SA)m(O-st)m(yle)h(region)f(\014le.)0 1090 y Fd(10.10.1)113
+b(General)37 b(Syn)m(tax)0 1313 y Fj(The)32 b(ro)m(w)h(\014ltering)e
+(expression)h(can)h(b)s(e)f(an)h(arbitrarily)d(complex)i(series)g(of)h
+(op)s(erations)f(p)s(erformed)g(on)g(con-)0 1426 y(stan)m(ts,)39
+b(k)m(eyw)m(ord)e(v)-5 b(alues,)37 b(and)f(column)f(data)j(tak)m(en)f
+(from)f(the)h(sp)s(eci\014ed)d(FITS)i(T)-8 b(ABLE)37
+b(extension.)58 b(The)0 1539 y(expression)36 b(m)m(ust)i(ev)-5
+b(aluate)38 b(to)h(a)f(b)s(o)s(olean)f(v)-5 b(alue)37
+b(for)g(eac)m(h)i(ro)m(w)f(of)g(the)f(table,)j(where)d(a)h(v)-5
+b(alue)38 b(of)f(F)-10 b(ALSE)0 1652 y(means)30 b(that)h(the)g(ro)m(w)f
+(will)e(b)s(e)i(excluded.)0 1812 y(F)-8 b(or)34 b(complex)f(or)h
+(commonly)e(used)h(\014lters,)g(one)h(can)g(place)f(the)h(expression)e
+(in)m(to)h(a)h(text)g(\014le)f(and)g(imp)s(ort)e(it)0
+1925 y(in)m(to)37 b(the)f(ro)m(w)h(\014lter)f(using)f(the)i(syn)m(tax)g
+('[@\014lename.txt]'.)60 b(The)36 b(expression)g(can)g(b)s(e)g
+(arbitrarily)e(complex)0 2038 y(and)27 b(extend)i(o)m(v)m(er)g(m)m
+(ultiple)d(lines)g(of)i(the)h(\014le.)39 b(An)m(y)28
+b(lines)e(in)h(the)h(external)g(text)h(\014le)e(that)i(b)s(egin)e(with)
+g(2)h(slash)0 2151 y(c)m(haracters)k(\('//'\))g(will)c(b)s(e)i(ignored)
+f(and)h(ma)m(y)h(b)s(e)f(used)f(to)i(add)f(commen)m(ts)h(in)m(to)g(the)
+f(\014le.)0 2311 y(Keyw)m(ord)37 b(and)f(column)f(data)j(are)f
+(referenced)g(b)m(y)g(name.)60 b(An)m(y)37 b(string)e(of)i(c)m
+(haracters)i(not)e(surrounded)d(b)m(y)0 2424 y(quotes)41
+b(\(ie,)i(a)e(constan)m(t)h(string\))e(or)g(follo)m(w)m(ed)g(b)m(y)h
+(an)f(op)s(en)g(paren)m(theses)h(\(ie,)i(a)e(function)e(name\))i(will)d
+(b)s(e)0 2537 y(initially)33 b(in)m(terpreted)i(as)i(a)g(column)e(name)
+h(and)g(its)g(con)m(ten)m(ts)i(for)e(the)h(curren)m(t)f(ro)m(w)g
+(inserted)f(in)m(to)i(the)f(ex-)0 2650 y(pression.)j(If)28
+b(no)h(suc)m(h)g(column)f(exists,)h(a)h(k)m(eyw)m(ord)f(of)h(that)f
+(name)g(will)e(b)s(e)h(searc)m(hed)i(for)f(and)f(its)h(v)-5
+b(alue)28 b(used,)0 2763 y(if)35 b(found.)55 b(T)-8 b(o)36
+b(force)g(the)g(name)g(to)h(b)s(e)e(in)m(terpreted)g(as)h(a)g(k)m(eyw)m
+(ord)g(\(in)f(case)h(there)g(is)f(b)s(oth)g(a)h(column)f(and)0
+2875 y(k)m(eyw)m(ord)41 b(with)d(the)j(same)f(name\),)j(precede)d(the)h
+(k)m(eyw)m(ord)f(name)g(with)f(a)i(single)d(p)s(ound)g(sign,)k('#',)h
+(as)d(in)0 2988 y('#NAXIS2'.)g(Due)27 b(to)g(the)f(generalities)g(of)g
+(FITS)g(column)f(and)h(k)m(eyw)m(ord)h(names,)g(if)e(the)i(column)e(or)
+h(k)m(eyw)m(ord)0 3101 y(name)34 b(con)m(tains)g(a)g(space)h(or)e(a)i
+(c)m(haracter)g(whic)m(h)e(migh)m(t)g(app)s(ear)g(as)i(an)e(arithmetic)
+g(term)h(then)g(inclose)f(the)0 3214 y(name)d(in)f('$')j(c)m(haracters)
+g(as)e(in)f($MAX)j(PHA$)f(or)f(#$MAX-PHA$.)43 b(Names)31
+b(are)f(case)i(insensitiv)m(e.)0 3374 y(T)-8 b(o)32 b(access)g(a)g
+(table)f(en)m(try)h(in)e(a)i(ro)m(w)f(other)h(than)f(the)g(curren)m(t)g
+(one,)h(follo)m(w)f(the)g(column's)g(name)g(with)f(a)i(ro)m(w)0
+3487 y(o\013set)37 b(within)c(curly)h(braces.)57 b(F)-8
+b(or)36 b(example,)h('PHA)p Fc(f)p Fj(-3)p Fc(g)p Fj(')h(will)33
+b(ev)-5 b(aluate)37 b(to)f(the)g(v)-5 b(alue)35 b(of)h(column)e(PHA,)j
+(3)0 3600 y(ro)m(ws)28 b(ab)s(o)m(v)m(e)i(the)e(ro)m(w)h(curren)m(tly)e
+(b)s(eing)g(pro)s(cessed.)40 b(One)28 b(cannot)h(sp)s(ecify)e(an)h
+(absolute)g(ro)m(w)g(n)m(um)m(b)s(er,)g(only)g(a)0 3713
+y(relativ)m(e)i(o\013set.)42 b(Ro)m(ws)31 b(that)g(fall)e(outside)h
+(the)g(table)g(will)e(b)s(e)i(treated)h(as)g(unde\014ned,)d(or)j
+(NULLs.)0 3873 y(Bo)s(olean)g(op)s(erators)g(can)g(b)s(e)f(used)f(in)h
+(the)g(expression)g(in)f(either)h(their)g(F)-8 b(ortran)31
+b(or)f(C)h(forms.)40 b(The)30 b(follo)m(wing)0 3986 y(b)s(o)s(olean)f
+(op)s(erators)i(are)g(a)m(v)-5 b(ailable:)191 4262 y
+Fe("equal")428 b(.eq.)46 b(.EQ.)h(==)95 b("not)46 b(equal")476
+b(.ne.)94 b(.NE.)h(!=)191 4375 y("less)46 b(than")238
+b(.lt.)46 b(.LT.)h(<)143 b("less)46 b(than/equal")188
+b(.le.)94 b(.LE.)h(<=)47 b(=<)191 4488 y("greater)e(than")95
+b(.gt.)46 b(.GT.)h(>)143 b("greater)45 b(than/equal")g(.ge.)94
+b(.GE.)h(>=)47 b(=>)191 4601 y("or")572 b(.or.)46 b(.OR.)h(||)95
+b("and")762 b(.and.)46 b(.AND.)h(&&)191 4713 y("negation")236
+b(.not.)46 b(.NOT.)h(!)95 b("approx.)45 b(equal\(1e-7\)")92
+b(~)0 4989 y Fj(Note)32 b(that)g(the)f(exclamation)g(p)s(oin)m(t,)f(')
+10 b(!',)33 b(is)d(a)h(sp)s(ecial)e(UNIX)j(c)m(haracter,)h(so)e(if)f
+(it)g(is)g(used)g(on)h(the)g(command)0 5102 y(line)g(rather)h(than)h
+(en)m(tered)g(at)g(a)g(task)g(prompt,)g(it)f(m)m(ust)g(b)s(e)g
+(preceded)h(b)m(y)f(a)h(bac)m(kslash)f(to)i(force)f(the)g(UNIX)0
+5215 y(shell)c(to)i(ignore)f(it.)0 5375 y(The)i(expression)f(ma)m(y)j
+(also)e(include)e(arithmetic)i(op)s(erators)h(and)f(functions.)46
+b(T)-8 b(rigonometric)32 b(functions)f(use)0 5488 y(radians,)22
+b(not)h(degrees.)38 b(The)22 b(follo)m(wing)e(arithmetic)h(op)s
+(erators)i(and)e(functions)f(can)j(b)s(e)e(used)g(in)g(the)h
+(expression)0 5601 y(\(function)37 b(names)g(are)h(case)g(insensitiv)m
+(e\).)61 b(A)37 b(n)m(ull)f(v)-5 b(alue)37 b(will)d(b)s(e)j(returned)g
+(in)f(case)i(of)g(illegal)e(op)s(erations)0 5714 y(suc)m(h)30
+b(as)h(divide)d(b)m(y)i(zero,)i(sqrt\(negativ)m(e\))g(log\(negativ)m
+(e\),)g(log10\(negativ)m(e\),)i(arccos\(.gt.)43 b(1\),)32
+b(arcsin\(.gt.)41 b(1\).)p eop
+%%Page: 120 128
+120 127 bop 0 299 a Fj(120)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)191 555 y
+Fe("addition")522 b(+)477 b("subtraction")d(-)191 668
+y("multiplication")234 b(*)477 b("division")618 b(/)191
+781 y("negation")522 b(-)477 b("exponentiation")330 b(**)143
+b(^)191 894 y("absolute)45 b(value")237 b(abs\(x\))g("cosine")714
+b(cos\(x\))191 1007 y("sine")g(sin\(x\))237 b("tangent")666
+b(tan\(x\))191 1120 y("arc)47 b(cosine")427 b(arccos\(x\))93
+b("arc)47 b(sine")619 b(arcsin\(x\))191 1233 y("arc)47
+b(tangent")379 b(arctan\(x\))93 b("arc)47 b(tangent")475
+b(arctan2\(x,y\))191 1346 y("hyperbolic)45 b(cos")237
+b(cosh\(x\))189 b("hyperbolic)45 b(sin")333 b(sinh\(x\))191
+1458 y("hyperbolic)45 b(tan")237 b(tanh\(x\))189 b("round)46
+b(to)h(nearest)f(int")h(round\(x\))191 1571 y("round)f(down)h(to)g
+(int")94 b(floor\(x\))141 b("round)46 b(up)h(to)h(int")285
+b(ceil\(x\))191 1684 y("exponential")378 b(exp\(x\))237
+b("square)46 b(root")476 b(sqrt\(x\))191 1797 y("natural)45
+b(log")381 b(log\(x\))237 b("common)46 b(log")524 b(log10\(x\))191
+1910 y("modulus")570 b(i)48 b(\045)f(j)286 b("random)46
+b(#)h([0.0,1.0\)")141 b(random\(\))191 2023 y("minimum")570
+b(min\(x,y\))141 b("maximum")666 b(max\(x,y\))191 2136
+y("if-then-else")330 b(b?x:y)0 2392 y Fj(An)31 b(alternate)h(syn)m(tax)
+g(for)f(the)g(min)f(and)h(max)g(functions)f(has)h(only)f(a)i(single)e
+(argumen)m(t)i(whic)m(h)e(should)f(b)s(e)i(a)0 2505 y(v)m(ector)g(v)-5
+b(alue)29 b(\(see)h(b)s(elo)m(w\).)40 b(The)29 b(result)f(will)f(b)s(e)
+h(the)i(minim)m(um/maxim)m(um)c(elemen)m(t)j(con)m(tained)h(within)d
+(the)0 2617 y(v)m(ector.)0 2778 y(The)38 b(follo)m(wing)f(t)m(yp)s(e)i
+(casting)g(op)s(erators)g(are)g(a)m(v)-5 b(ailable,)41
+b(where)d(the)h(inclosing)e(paren)m(theses)i(are)g(required)0
+2891 y(and)30 b(tak)m(en)h(from)f(the)h(C)f(language)g(usage.)42
+b(Also,)30 b(the)h(in)m(teger)f(to)i(real)e(casts)h(v)-5
+b(alues)29 b(to)j(double)d(precision:)764 3146 y Fe("real)46
+b(to)h(integer")189 b(\(int\))46 b(x)239 b(\(INT\))46
+b(x)764 3259 y("integer)f(to)i(real")190 b(\(float\))46
+b(i)143 b(\(FLOAT\))45 b(i)0 3515 y Fj(In)30 b(addition,)e(sev)m(eral)j
+(constan)m(ts)h(are)f(built)d(in)h(for)h(use)g(in)f(n)m(umerical)g
+(expressions:)382 3770 y Fe(#pi)667 b(3.1415...)284 b(#e)620
+b(2.7182...)382 3883 y(#deg)f(#pi/180)380 b(#row)524
+b(current)46 b(row)h(number)382 3996 y(#null)428 b(undefined)45
+b(value)142 b(#snull)428 b(undefined)45 b(string)0 4252
+y Fj(A)40 b(string)e(constan)m(t)j(m)m(ust)e(b)s(e)g(enclosed)g(in)g
+(quotes)h(as)f(in)g('Crab'.)67 b(The)39 b("n)m(ull")g(constan)m(ts)h
+(are)g(useful)e(for)0 4365 y(conditionally)d(setting)j(table)g(v)-5
+b(alues)37 b(to)h(a)g(NULL,)g(or)g(unde\014ned,)f(v)-5
+b(alue)38 b(\(eg.,)j("col1==-99)e(?)62 b(#NULL)38 b(:)0
+4478 y(col1"\).)0 4638 y(There)27 b(is)f(also)i(a)f(function)f(for)i
+(testing)f(if)f(t)m(w)m(o)j(v)-5 b(alues)27 b(are)h(close)f(to)i(eac)m
+(h)f(other,)h(i.e.,)f(if)e(they)i(are)g("near")g(eac)m(h)0
+4751 y(other)c(to)h(within)c(a)j(user)g(sp)s(eci\014ed)e(tolerance.)39
+b(The)24 b(argumen)m(ts,)h(v)-5 b(alue)p 2503 4751 28
+4 v 33 w(1)24 b(and)f(v)-5 b(alue)p 2980 4751 V 32 w(2)25
+b(can)f(b)s(e)f(in)m(teger)h(or)g(real)0 4864 y(and)32
+b(represen)m(t)h(the)g(t)m(w)m(o)h(v)-5 b(alues)32 b(who's)g(pro)m
+(ximit)m(y)g(is)g(b)s(eing)f(tested)i(to)h(b)s(e)e(within)e(the)j(sp)s
+(eci\014ed)e(tolerance,)0 4977 y(also)f(an)h(in)m(teger)f(or)h(real:)
+955 5232 y Fe(near\(value_1,)44 b(value_2,)h(tolerance\))0
+5488 y Fj(When)24 b(a)i(NULL,)e(or)h(unde\014ned,)f(v)-5
+b(alue)24 b(is)g(encoun)m(tered)h(in)f(the)g(FITS)g(table,)i(the)f
+(expression)f(will)e(ev)-5 b(aluate)25 b(to)0 5601 y(NULL)31
+b(unless)e(the)i(unde\014ned)e(v)-5 b(alue)30 b(is)g(not)h(actually)f
+(required)f(for)i(ev)-5 b(aluation,)31 b(e.g.)43 b("TR)m(UE)31
+b(.or.)43 b(NULL")0 5714 y(ev)-5 b(aluates)31 b(to)g(TR)m(UE.)g(The)f
+(follo)m(wing)e(t)m(w)m(o)k(functions)d(allo)m(w)h(some)h(NULL)f
+(detection)h(and)f(handling:)p eop
+%%Page: 121 129
+121 128 bop 0 299 a Fh(10.10.)73 b(R)m(O)m(W)31 b(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)1936 b Fj(121)430 555
+y Fe("a)47 b(null)f(value?")667 b(ISNULL\(x\))430 668
+y("define)45 b(a)j(value)e(for)h(null")190 b(DEFNULL\(x,y\))0
+894 y Fj(The)36 b(former)h(returns)e(a)i(b)s(o)s(olean)f(v)-5
+b(alue)36 b(of)h(TR)m(UE)g(if)f(the)h(argumen)m(t)g(x)g(is)f(NULL.)h
+(The)f(later)h("de\014nes")g(a)0 1006 y(v)-5 b(alue)34
+b(to)h(b)s(e)e(substituted)g(for)h(NULL)g(v)-5 b(alues;)36
+b(it)e(returns)f(the)h(v)-5 b(alue)34 b(of)g(x)g(if)f(x)i(is)e(not)h
+(NULL,)h(otherwise)e(it)0 1119 y(returns)c(the)i(v)-5
+b(alue)30 b(of)g(y)-8 b(.)0 1405 y Fd(10.10.2)113 b(Bit)35
+b(Masks)0 1623 y Fj(Bit)g(masks)g(can)h(b)s(e)f(used)f(to)i(select)g
+(out)f(ro)m(ws)h(from)e(bit)h(columns)f(\(TF)m(ORMn)h(=)g(#X\))h(in)e
+(FITS)g(\014les.)54 b(T)-8 b(o)0 1736 y(represen)m(t)30
+b(the)h(mask,)g(binary)-8 b(,)29 b(o)s(ctal,)i(and)f(hex)g(formats)g
+(are)h(allo)m(w)m(ed:)811 1962 y Fe(binary:)142 b
+(b0110xx1010000101xxxx00)o(01)811 2075 y(octal:)190 b(o720x1)46
+b(->)h(\(b111010000xxx001\))811 2188 y(hex:)286 b(h0FxD)94
+b(->)47 b(\(b00001111xxxx1101\))0 2413 y Fj(In)22 b(all)g(the)h
+(represen)m(tations,)i(an)d(x)h(or)g(X)g(is)f(allo)m(w)m(ed)h(in)e(the)
+i(mask)g(as)g(a)h(wild)c(card.)38 b(Note)25 b(that)e(the)g(x)g
+(represen)m(ts)0 2526 y(a)k(di\013eren)m(t)g(n)m(um)m(b)s(er)f(of)h
+(wild)d(card)j(bits)f(in)g(eac)m(h)i(represen)m(tation.)40
+b(All)25 b(represen)m(tations)i(are)h(case)g(insensitiv)m(e.)0
+2686 y(T)-8 b(o)28 b(construct)g(the)g(b)s(o)s(olean)e(expression)h
+(using)f(the)i(mask)f(as)h(the)g(b)s(o)s(olean)e(equal)h(op)s(erator)h
+(describ)s(ed)e(ab)s(o)m(v)m(e)0 2799 y(on)34 b(a)h(bit)f(table)h
+(column.)52 b(F)-8 b(or)35 b(example,)h(if)d(y)m(ou)i(had)f(a)h(7)g
+(bit)f(column)f(named)h(\015ags)h(in)e(a)i(FITS)f(table)h(and)0
+2912 y(w)m(an)m(ted)c(all)e(ro)m(ws)i(ha)m(ving)f(the)g(bit)g(pattern)g
+(0010011,)k(the)c(selection)h(expression)e(w)m(ould)g(b)s(e:)1336
+3137 y Fe(flags)47 b(==)g(b0010011)191 3250 y(or)1336
+3363 y(flags)g(.eq.)f(b10011)0 3589 y Fj(It)35 b(is)f(also)h(p)s
+(ossible)d(to)k(test)g(if)e(a)h(range)g(of)g(bits)f(is)g(less)g(than,)i
+(less)e(than)h(equal,)h(greater)g(than)e(and)h(greater)0
+3702 y(than)30 b(equal)g(to)h(a)g(particular)e(b)s(o)s(olean)g(v)-5
+b(alue:)1336 3927 y Fe(flags)47 b(<=)g(bxxx010xx)1336
+4040 y(flags)g(.gt.)f(bxxx100xx)1336 4153 y(flags)h(.le.)f(b1xxxxxxx)0
+4378 y Fj(Notice)31 b(the)g(use)f(of)h(the)f(x)g(bit)g(v)-5
+b(alue)30 b(to)h(limit)d(the)i(range)h(of)g(bits)e(b)s(eing)g
+(compared.)0 4538 y(It)j(is)g(not)g(necessary)h(to)g(sp)s(ecify)e(the)i
+(leading)e(\(most)i(signi\014can)m(t\))f(zero)h(\(0\))g(bits)e(in)g
+(the)i(mask,)g(as)g(sho)m(wn)e(in)0 4651 y(the)g(second)f(expression)f
+(ab)s(o)m(v)m(e.)0 4811 y(Bit)43 b(wise)f(AND,)i(OR)e(and)g(NOT)h(op)s
+(erations)f(are)h(also)g(p)s(ossible)d(on)j(t)m(w)m(o)h(or)f(more)g
+(bit)f(\014elds)f(using)h(the)0 4924 y('&'\(AND\),)35
+b(')p Fc(j)p Fj('\(OR\),)g(and)e(the)h(')10 b(!'\(NOT\))34
+b(op)s(erators.)51 b(All)32 b(of)h(these)h(op)s(erators)g(result)e(in)h
+(a)h(bit)e(\014eld)g(whic)m(h)0 5037 y(can)f(then)f(b)s(e)f(used)h
+(with)f(the)i(equal)f(op)s(erator.)41 b(F)-8 b(or)31
+b(example:)1241 5263 y Fe(\(!flags\))45 b(==)j(b1101100)1241
+5376 y(\(flags)e(&)h(b1000001\))f(==)h(bx000001)0 5601
+y Fj(Bit)34 b(\014elds)f(can)h(b)s(e)f(app)s(ended)g(as)h(w)m(ell)f
+(using)g(the)h('+')g(op)s(erator.)53 b(Strings)32 b(can)j(b)s(e)e
+(concatenated)j(this)d(w)m(a)m(y)-8 b(,)0 5714 y(to)s(o.)p
+eop
+%%Page: 122 130
+122 129 bop 0 299 a Fj(122)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fd(10.10.3)113
+b(V)-9 b(ector)36 b(Columns)0 774 y Fj(V)-8 b(ector)37
+b(columns)d(can)i(also)f(b)s(e)g(used)f(in)g(building)e(the)j
+(expression.)55 b(No)36 b(sp)s(ecial)e(syn)m(tax)h(is)g(required)e(if)i
+(one)0 887 y(w)m(an)m(ts)46 b(to)f(op)s(erate)h(on)f(all)f(elemen)m(ts)
+h(of)g(the)h(v)m(ector.)86 b(Simply)42 b(use)j(the)g(column)f(name)h
+(as)g(for)g(a)g(scalar)0 1000 y(column.)c(V)-8 b(ector)32
+b(columns)e(can)h(b)s(e)f(freely)g(in)m(termixed)g(with)f(scalar)i
+(columns)e(or)i(constan)m(ts)h(in)e(virtually)e(all)0
+1113 y(expressions.)39 b(The)29 b(result)f(will)e(b)s(e)j(of)g(the)g
+(same)h(dimension)c(as)k(the)f(v)m(ector.)42 b(Tw)m(o)29
+b(v)m(ectors)i(in)d(an)h(expression,)0 1226 y(though,)f(need)e(to)i(ha)
+m(v)m(e)g(the)f(same)g(n)m(um)m(b)s(er)f(of)h(elemen)m(ts)g(and)f(ha)m
+(v)m(e)j(the)e(same)g(dimensions.)37 b(The)26 b(only)g(places)0
+1339 y(a)35 b(v)m(ector)h(column)d(cannot)i(b)s(e)f(used)f(\(for)i(no)m
+(w,)g(an)m(yw)m(a)m(y\))h(are)f(the)g(SA)m(O)f(region)g(functions)f
+(and)g(the)i(NEAR)0 1452 y(b)s(o)s(olean)29 b(function.)0
+1612 y(Arithmetic)22 b(and)g(logical)h(op)s(erations)f(are)i(all)e(p)s
+(erformed)f(on)i(an)g(elemen)m(t)g(b)m(y)g(elemen)m(t)h(basis.)37
+b(Comparing)22 b(t)m(w)m(o)0 1725 y(v)m(ector)32 b(columns,)d(eg)i
+("COL1)f(==)g(COL2",)g(th)m(us)g(results)f(in)g(another)h(v)m(ector)i
+(of)e(b)s(o)s(olean)g(v)-5 b(alues)29 b(indicating)0
+1837 y(whic)m(h)g(elemen)m(ts)i(of)f(the)h(t)m(w)m(o)h(v)m(ectors)f
+(are)g(equal.)0 1998 y(Eigh)m(t)f(functions)f(are)i(a)m(v)-5
+b(ailable)30 b(that)h(op)s(erate)g(on)f(a)h(v)m(ector)h(and)d(return)h
+(a)g(scalar)h(result:)191 2254 y Fe("minimum")284 b(MIN\(V\))475
+b("maximum")714 b(MAX\(V\))191 2367 y("average")284 b(AVERAGE\(V\))f
+("median")762 b(MEDIAN\(V\))191 2480 y("sumation")236
+b(SUM\(V\))475 b("standard)46 b(deviation")188 b(STDDEV\(V\))191
+2593 y("#)47 b(of)g(values")94 b(NELEM\(V\))379 b("#)48
+b(of)f(non-null)e(values")94 b(NVALID\(V\))0 2849 y Fj(where)40
+b(V)h(represen)m(ts)g(the)g(name)g(of)h(a)f(v)m(ector)h(column)e(or)h
+(a)h(man)m(ually)d(constructed)i(v)m(ector)i(using)c(curly)0
+2962 y(brac)m(k)m(ets)27 b(as)f(describ)s(ed)d(b)s(elo)m(w.)38
+b(The)25 b(\014rst)g(6)h(of)g(these)g(functions)e(ignore)h(an)m(y)h(n)m
+(ull)d(v)-5 b(alues)25 b(in)f(the)i(v)m(ector)h(when)0
+3075 y(computing)i(the)i(result.)0 3235 y(The)g(SUM)h(function)e
+(literally)g(sums)h(all)f(the)i(elemen)m(ts)g(in)f(x,)h(returning)e(a)i
+(scalar)g(v)-5 b(alue.)44 b(If)31 b(V)h(is)f(a)h(b)s(o)s(olean)0
+3348 y(v)m(ector,)40 b(SUM)c(returns)f(the)h(n)m(um)m(b)s(er)f(of)i(TR)
+m(UE)f(elemen)m(ts.)59 b(The)36 b(NELEM)g(function)f(returns)g(the)h(n)
+m(um)m(b)s(er)0 3461 y(of)h(elemen)m(ts)f(in)g(v)m(ector)i(V)e(whereas)
+h(NV)-10 b(ALID)36 b(return)g(the)h(n)m(um)m(b)s(er)e(of)h(non-n)m(ull)
+e(elemen)m(ts)j(in)e(the)i(v)m(ector.)0 3573 y(\(NELEM)28
+b(also)g(op)s(erates)g(on)g(bit)e(and)h(string)g(columns,)g(returning)f
+(their)h(column)f(widths.\))39 b(As)27 b(an)h(example,)0
+3686 y(to)42 b(test)g(whether)f(all)f(elemen)m(ts)i(of)g(t)m(w)m(o)g(v)
+m(ectors)h(satisfy)e(a)h(giv)m(en)f(logical)g(comparison,)i(one)f(can)g
+(use)f(the)0 3799 y(expression)668 4056 y Fe(SUM\()47
+b(COL1)f(>)i(COL2)f(\))g(==)g(NELEM\()f(COL1)h(\))0 4312
+y Fj(whic)m(h)31 b(will)e(return)i(TR)m(UE)h(if)f(all)g(elemen)m(ts)h
+(of)g(COL1)g(are)g(greater)h(than)f(their)f(corresp)s(onding)f(elemen)m
+(ts)i(in)0 4425 y(COL2.)0 4585 y(T)-8 b(o)32 b(sp)s(ecify)e(a)j(single)
+d(elemen)m(t)i(of)g(a)g(v)m(ector,)i(giv)m(e)e(the)g(column)e(name)i
+(follo)m(w)m(ed)f(b)m(y)h(a)g(comma-separated)h(list)0
+4698 y(of)c(co)s(ordinates)f(enclosed)h(in)e(square)i(brac)m(k)m(ets.)
+41 b(F)-8 b(or)30 b(example,)f(if)e(a)i(v)m(ector)i(column)c(named)i
+(PHAS)f(exists)g(in)0 4811 y(the)f(table)f(as)h(a)g(one)g(dimensional,)
+e(256)j(comp)s(onen)m(t)f(list)e(of)i(n)m(um)m(b)s(ers)e(from)h(whic)m
+(h)g(y)m(ou)h(w)m(an)m(ted)g(to)g(select)h(the)0 4924
+y(57th)k(comp)s(onen)m(t)g(for)f(use)g(in)f(the)i(expression,)e(then)i
+(PHAS[57])g(w)m(ould)e(do)i(the)f(tric)m(k.)44 b(Higher)31
+b(dimensional)0 5036 y(arra)m(ys)41 b(of)h(data)f(ma)m(y)h(app)s(ear)f
+(in)e(a)j(column.)72 b(But)41 b(in)f(order)g(to)i(in)m(terpret)e(them,)
+k(the)e(TDIMn)e(k)m(eyw)m(ord)0 5149 y(m)m(ust)34 b(app)s(ear)g(in)f
+(the)h(header.)52 b(Assuming)33 b(that)i(a)f(\(4,4,4,4\))k(arra)m(y)c
+(is)g(pac)m(k)m(ed)h(in)m(to)f(eac)m(h)i(ro)m(w)e(of)g(a)h(column)0
+5262 y(named)26 b(ARRA)-8 b(Y4D,)28 b(the)f(\(1,2,3,4\))i(comp)s(onen)m
+(t)e(elemen)m(t)f(of)h(eac)m(h)g(ro)m(w)g(is)e(accessed)j(b)m(y)e(ARRA)
+-8 b(Y4D[1,2,3,4].)0 5375 y(Arra)m(ys)33 b(up)e(to)j(dimension)c(5)j
+(are)f(curren)m(tly)g(supp)s(orted.)46 b(Eac)m(h)33 b(v)m(ector)h
+(index)d(can)i(itself)e(b)s(e)h(an)h(expression,)0 5488
+y(although)38 b(it)g(m)m(ust)h(ev)-5 b(aluate)39 b(to)g(an)g(in)m
+(teger)g(v)-5 b(alue)38 b(within)e(the)j(b)s(ounds)d(of)j(the)g(v)m
+(ector.)67 b(V)-8 b(ector)40 b(columns)0 5601 y(whic)m(h)30
+b(con)m(tain)h(spaces)h(or)f(arithmetic)f(op)s(erators)i(m)m(ust)f(ha)m
+(v)m(e)h(their)e(names)h(enclosed)g(in)f("$")i(c)m(haracters)h(as)0
+5714 y(with)c($ARRA)-8 b(Y-4D$[1,2,3,4].)p eop
+%%Page: 123 131
+123 130 bop 0 299 a Fh(10.10.)73 b(R)m(O)m(W)31 b(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)1936 b Fj(123)0 555
+y(A)45 b(more)f(C-lik)m(e)g(syn)m(tax)i(for)e(sp)s(ecifying)e(v)m
+(ector)47 b(indices)42 b(is)i(also)h(a)m(v)-5 b(ailable.)82
+b(The)45 b(elemen)m(t)g(used)e(in)h(the)0 668 y(preceding)27
+b(example)h(alternativ)m(ely)g(could)f(b)s(e)h(sp)s(eci\014ed)f(with)f
+(the)j(syn)m(tax)g(ARRA)-8 b(Y4D[4][3][2][1].)45 b(Note)30
+b(the)0 781 y(rev)m(erse)40 b(order)f(of)h(indices)d(\(as)j(in)e(C\),)i
+(as)f(w)m(ell)g(as)g(the)h(fact)g(that)g(the)g(v)-5 b(alues)39
+b(are)g(still)f(ones-based)h(\(as)h(in)0 894 y(F)-8 b(ortran)39
+b({)g(adopted)g(to)g(a)m(v)m(oid)g(am)m(biguit)m(y)f(for)h(1D)g(v)m
+(ectors\).)67 b(With)38 b(this)g(syn)m(tax,)j(one)e(do)s(es)f(not)h
+(need)f(to)0 1007 y(sp)s(ecify)29 b(all)g(of)i(the)f(indices.)39
+b(T)-8 b(o)31 b(extract)h(a)f(3D)g(slice)e(of)i(this)e(4D)i(arra)m(y)-8
+b(,)32 b(use)e(ARRA)-8 b(Y4D[4].)0 1167 y(V)g(ariable-length)30
+b(v)m(ector)i(columns)d(are)h(not)h(supp)s(orted.)0 1327
+y(V)-8 b(ectors)24 b(can)e(b)s(e)f(man)m(ually)f(constructed)j(within)c
+(the)j(expression)f(using)f(a)i(comma-separated)i(list)d(of)h(elemen)m
+(ts)0 1440 y(surrounded)35 b(b)m(y)j(curly)f(braces)i(\(')p
+Fc(fg)p Fj('\).)66 b(F)-8 b(or)38 b(example,)i(')p Fc(f)p
+Fj(1,3,6,1)p Fc(g)p Fj(')i(is)c(a)g(4-elemen)m(t)h(v)m(ector)h(con)m
+(taining)e(the)0 1553 y(v)-5 b(alues)25 b(1,)i(3,)g(6,)g(and)e(1.)40
+b(The)25 b(v)m(ector)i(can)f(con)m(tain)g(only)f(b)s(o)s(olean,)g(in)m
+(teger,)j(and)d(real)g(v)-5 b(alues)25 b(\(or)h(expressions\).)0
+1666 y(The)c(elemen)m(ts)h(will)d(b)s(e)i(promoted)h(to)g(the)g
+(highest)f(data)h(t)m(yp)s(e)g(presen)m(t.)38 b(An)m(y)22
+b(elemen)m(ts)h(whic)m(h)f(are)h(themselv)m(es)0 1779
+y(v)m(ectors,)40 b(will)34 b(b)s(e)i(expanded)g(out)h(with)f(eac)m(h)h
+(of)g(its)f(elemen)m(ts)i(b)s(ecoming)d(an)i(elemen)m(t)g(in)f(the)h
+(constructed)0 1892 y(v)m(ector.)0 2181 y Fd(10.10.4)113
+b(Go)s(o)s(d)38 b(Time)e(In)m(terv)-6 b(al)36 b(Filtering)0
+2400 y Fj(A)44 b(common)g(\014ltering)f(metho)s(d)g(in)m(v)m(olv)m(es)h
+(selecting)g(ro)m(ws)g(whic)m(h)e(ha)m(v)m(e)k(a)e(time)g(v)-5
+b(alue)43 b(whic)m(h)g(lies)f(within)0 2513 y(what)37
+b(is)f(called)h(a)h(Go)s(o)s(d)f(Time)f(In)m(terv)-5
+b(al)37 b(or)g(GTI.)g(The)g(time)g(in)m(terv)-5 b(als)36
+b(are)i(de\014ned)e(in)g(a)h(separate)i(FITS)0 2626 y(table)h
+(extension)g(whic)m(h)e(con)m(tains)i(2)h(columns)e(giving)f(the)j
+(start)f(and)g(stop)g(time)f(of)h(eac)m(h)i(go)s(o)s(d)e(in)m(terv)-5
+b(al.)0 2739 y(The)34 b(\014ltering)f(op)s(eration)i(accepts)h(only)d
+(those)j(ro)m(ws)e(of)h(the)g(input)e(table)i(whic)m(h)e(ha)m(v)m(e)j
+(an)f(asso)s(ciated)g(time)0 2852 y(whic)m(h)f(falls)h(within)e(one)j
+(of)g(the)g(time)f(in)m(terv)-5 b(als)35 b(de\014ned)g(in)f(the)i(GTI)g
+(extension.)56 b(A)36 b(high)f(lev)m(el)g(function,)0
+2965 y(gti\014lter\(a,b,c,d\),)42 b(is)d(a)m(v)-5 b(ailable)39
+b(whic)m(h)f(ev)-5 b(aluates)40 b(eac)m(h)h(ro)m(w)e(of)h(the)f(input)f
+(table)h(and)g(returns)f(TR)m(UE)i(or)0 3077 y(F)-10
+b(ALSE)30 b(dep)s(ending)e(whether)i(the)g(ro)m(w)h(is)e(inside)f(or)i
+(outside)g(the)h(go)s(o)s(d)f(time)g(in)m(terv)-5 b(al.)40
+b(The)30 b(syn)m(tax)h(is)286 3330 y Fe(gtifilter\()45
+b([)j("gtifile")d([,)i(expr)g([,)g("STARTCOL",)e("STOPCOL")g(])j(])f(])
+g(\))0 3582 y Fj(where)20 b(eac)m(h)h("[]")h(demarks)e(optional)f
+(parameters.)38 b(Note)21 b(that)g(the)g(quotes)f(around)g(the)g
+(gti\014le)g(and)f(ST)-8 b(AR)g(T/STOP)0 3695 y(column)32
+b(are)h(required.)47 b(Either)31 b(single)h(or)h(double)e(quotes)j(ma)m
+(y)f(b)s(e)g(used.)47 b(The)32 b(gti\014le,)h(if)f(sp)s(eci\014ed,)g
+(can)i(b)s(e)0 3808 y(blank)28 b(\(""\))j(whic)m(h)e(will)d(mean)k(to)g
+(use)g(the)f(\014rst)g(extension)g(with)g(the)g(name)h("*GTI*")h(in)d
+(the)i(curren)m(t)f(\014le,)h(a)0 3920 y(plain)24 b(extension)i(sp)s
+(eci\014er)f(\(eg,)k("+2",)f("[2]",)i(or)c("[STDGTI]"\))h(whic)m(h)f
+(will)d(b)s(e)j(used)g(to)h(select)g(an)f(extension)0
+4033 y(in)k(the)i(curren)m(t)f(\014le,)g(or)g(a)h(regular)f(\014lename)
+f(with)h(or)g(without)f(an)i(extension)f(sp)s(eci\014er)f(whic)m(h)g
+(in)g(the)i(latter)0 4146 y(case)e(will)c(mean)j(to)g(use)g(the)f
+(\014rst)g(extension)h(with)e(an)i(extension)f(name)h("*GTI*".)42
+b(Expr)27 b(can)i(b)s(e)f(an)m(y)i(arith-)0 4259 y(metic)e(expression,)
+f(including)d(simply)h(the)j(time)g(column)e(name.)40
+b(A)28 b(v)m(ector)h(time)f(expression)e(will)f(pro)s(duce)i(a)0
+4372 y(v)m(ector)34 b(b)s(o)s(olean)e(result.)45 b(ST)-8
+b(AR)g(TCOL)32 b(and)g(STOPCOL)e(are)j(the)f(names)h(of)f(the)h(ST)-8
+b(AR)g(T/STOP)31 b(columns)0 4485 y(in)e(the)i(GTI)f(extension.)40
+b(If)30 b(one)h(of)f(them)h(is)e(sp)s(eci\014ed,)g(they)h(b)s(oth)g(m)m
+(ust)g(b)s(e.)0 4645 y(In)21 b(its)g(simplest)f(form,)k(no)d
+(parameters)h(need)g(to)h(b)s(e)e(pro)m(vided)f({)i(default)f(v)-5
+b(alues)21 b(will)f(b)s(e)h(used.)37 b(The)21 b(expression)0
+4758 y("gti\014lter\(\)")31 b(is)f(equiv)-5 b(alen)m(t)29
+b(to)334 5010 y Fe(gtifilter\()45 b("",)i(TIME,)f("*START*",)f
+("*STOP*")h(\))0 5262 y Fj(This)30 b(will)e(searc)m(h)k(the)g(curren)m
+(t)f(\014le)f(for)h(a)h(GTI)f(extension,)g(\014lter)g(the)g(TIME)g
+(column)f(in)g(the)i(curren)m(t)f(table,)0 5375 y(using)i(ST)-8
+b(AR)g(T/STOP)34 b(times)h(tak)m(en)g(from)g(columns)e(in)h(the)h(GTI)g
+(extension)f(with)g(names)g(con)m(taining)h(the)0 5488
+y(strings)c("ST)-8 b(AR)g(T")33 b(and)e("STOP".)46 b(The)32
+b(wildcards)d(\('*'\))34 b(allo)m(w)e(sligh)m(t)f(v)-5
+b(ariations)31 b(in)g(naming)g(con)m(v)m(en)m(tions)0
+5601 y(suc)m(h)38 b(as)g("TST)-8 b(AR)g(T")39 b(or)f("ST)-8
+b(AR)g(TTIME".)65 b(The)37 b(same)i(default)f(v)-5 b(alues)37
+b(apply)g(for)h(unsp)s(eci\014ed)e(parame-)0 5714 y(ters)g(when)f(the)h
+(\014rst)f(one)i(or)f(t)m(w)m(o)h(parameters)f(are)h(sp)s(eci\014ed.)55
+b(The)36 b(function)e(automatically)i(searc)m(hes)h(for)p
+eop
+%%Page: 124 132
+124 131 bop 0 299 a Fj(124)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(TIMEZER)m(O/I/F)
+37 b(k)m(eyw)m(ords)f(in)f(the)i(curren)m(t)f(and)g(GTI)g(extensions,)h
+(applying)e(a)h(relativ)m(e)h(time)f(o\013set,)j(if)0
+668 y(necessary)-8 b(.)0 955 y Fd(10.10.5)113 b(Spatial)36
+b(Region)h(Filtering)0 1173 y Fj(Another)h(common)g(\014ltering)e
+(metho)s(d)h(selects)h(ro)m(ws)g(based)g(on)f(whether)h(the)g(spatial)f
+(p)s(osition)e(asso)s(ciated)0 1286 y(with)c(eac)m(h)j(ro)m(w)e(is)g
+(lo)s(cated)h(within)d(a)j(giv)m(en)f(2-dimensional)e(region.)47
+b(The)32 b(syn)m(tax)h(for)f(this)g(high-lev)m(el)f(\014lter)0
+1399 y(is)334 1632 y Fe(regfilter\()45 b("regfilename")f([)k(,)f
+(Xexpr,)f(Yexpr)h([)g(,)h("wcs)e(cols")h(])g(])g(\))0
+1865 y Fj(where)22 b(eac)m(h)i("[]")g(demarks)e(optional)g(parameters.)
+38 b(The)22 b(region)g(\014le)g(name)g(is)g(required)f(and)h(m)m(ust)g
+(b)s(e)g(enclosed)0 1978 y(in)38 b(quotes.)70 b(The)39
+b(remaining)f(parameters)i(are)g(optional.)68 b(The)39
+b(region)g(\014le)g(is)g(an)g(ASCI)s(I)g(text)h(\014le)f(whic)m(h)0
+2091 y(con)m(tains)30 b(a)f(list)f(of)i(one)f(or)h(more)f(geometric)i
+(shap)s(es)d(\(circle,)i(ellipse,)d(b)s(o)m(x,)j(etc.\))42
+b(whic)m(h)28 b(de\014nes)g(a)i(region)f(on)0 2204 y(the)i(celestial)f
+(sphere)g(or)h(an)g(area)g(within)d(a)j(particular)f(2D)h(image.)42
+b(The)30 b(region)h(\014le)f(is)f(t)m(ypically)h(generated)0
+2317 y(using)21 b(an)i(image)g(displa)m(y)e(program)i(suc)m(h)f(as)h
+(fv/PO)m(W)h(\(distribute)c(b)m(y)j(the)g(HEASAR)m(C\),)g(or)g(ds9)g
+(\(distributed)0 2430 y(b)m(y)k(the)g(Smithsonian)d(Astroph)m(ysical)i
+(Observ)-5 b(atory\).)39 b(Users)27 b(should)e(refer)h(to)i(the)f(do)s
+(cumen)m(tation)f(pro)m(vided)0 2543 y(with)j(these)i(programs)f(for)g
+(more)h(details)e(on)h(the)h(syn)m(tax)g(used)e(in)g(the)i(region)f
+(\014les.)0 2703 y(In)44 b(its)g(simpliest)e(form,)47
+b(\(e.g.,)j(reg\014lter\("region.reg"\))c(\))f(the)g(co)s(ordinates)f
+(in)f(the)i(default)e('X')i(and)f('Y')0 2816 y(columns)32
+b(will)e(b)s(e)i(used)g(to)i(determine)e(if)f(eac)m(h)j(ro)m(w)f(is)f
+(inside)f(or)i(outside)f(the)h(area)h(sp)s(eci\014ed)d(in)g(the)i
+(region)0 2928 y(\014le.)40 b(Alternate)31 b(p)s(osition)d(column)h
+(names,)i(or)f(expressions,)f(ma)m(y)i(b)s(e)f(en)m(tered)h(if)e
+(needed,)i(as)f(in)382 3161 y Fe(regfilter\("region.reg",)41
+b(XPOS,)47 b(YPOS\))0 3394 y Fj(Region)36 b(\014ltering)e(can)i(b)s(e)f
+(applied)e(most)j(unam)m(biguously)d(if)i(the)h(p)s(ositions)e(in)g
+(the)i(region)f(\014le)g(and)g(in)g(the)0 3507 y(table)g(to)h(b)s(e)e
+(\014ltered)g(are)i(b)s(oth)e(giv)m(e)i(in)e(terms)h(of)g(absolute)g
+(celestial)g(co)s(ordinate)g(units.)53 b(In)35 b(this)f(case)i(the)0
+3620 y(lo)s(cations)24 b(and)f(sizes)h(of)h(the)f(geometric)h(shap)s
+(es)f(in)f(the)h(region)g(\014le)f(are)i(sp)s(eci\014ed)e(in)g(angular)
+g(units)g(on)h(the)g(sky)0 3733 y(\(e.g.,)32 b(p)s(ositions)c(giv)m(en)
+j(in)e(R.A.)h(and)g(Dec.)42 b(and)30 b(sizes)g(in)f(arcseconds)h(or)h
+(arcmin)m(utes\).)40 b(Similarly)-8 b(,)27 b(eac)m(h)32
+b(ro)m(w)0 3846 y(of)h(the)h(\014ltered)e(table)h(will)d(ha)m(v)m(e)35
+b(a)e(celestial)g(co)s(ordinate)g(asso)s(ciated)g(with)f(it.)49
+b(This)31 b(asso)s(ciation)i(is)f(usually)0 3959 y(implemen)m(ted)37
+b(using)f(a)j(set)g(of)f(so-called)g('W)-8 b(orld)38
+b(Co)s(ordinate)g(System')g(\(or)h(W)m(CS\))f(FITS)g(k)m(eyw)m(ords)g
+(that)0 4072 y(de\014ne)27 b(the)g(co)s(ordinate)g(transformation)g
+(that)h(m)m(ust)f(b)s(e)f(applied)f(to)j(the)g(v)-5 b(alues)26
+b(in)g(the)i('X')g(and)e('Y')i(columns)0 4185 y(to)j(calculate)g(the)f
+(co)s(ordinate.)0 4345 y(Alternativ)m(ely)-8 b(,)27 b(one)g(can)g(p)s
+(erform)e(spatial)h(\014ltering)e(using)h(unitless)g('pixel')g(co)s
+(ordinates)i(for)f(the)h(regions)f(and)0 4458 y(ro)m(w)33
+b(p)s(ositions.)47 b(In)33 b(this)f(case)i(the)f(user)g(m)m(ust)g(b)s
+(e)f(careful)g(to)i(ensure)f(that)g(the)h(p)s(ositions)d(in)h(the)h(2)g
+(\014les)g(are)0 4571 y(self-consisten)m(t.)52 b(A)34
+b(t)m(ypical)g(problem)e(is)h(that)i(the)f(region)g(\014le)f(ma)m(y)i
+(b)s(e)e(generated)j(using)c(a)j(binned)c(image,)0 4684
+y(but)h(the)h(un)m(binned)d(co)s(ordinates)i(are)h(giv)m(en)g(in)e(the)
+i(ev)m(en)m(t)i(table.)47 b(The)32 b(R)m(OSA)-8 b(T)33
+b(ev)m(en)m(ts)h(\014les,)f(for)f(example,)0 4796 y(ha)m(v)m(e)f(X)f
+(and)f(Y)g(pixel)f(co)s(ordinates)h(that)i(range)f(from)f(1)h(-)g
+(15360.)42 b(These)30 b(co)s(ordinates)f(are)h(t)m(ypically)e(binned)0
+4909 y(b)m(y)33 b(a)h(factor)g(of)f(32)h(to)g(pro)s(duce)e(a)i(480x480)
+i(pixel)31 b(image.)50 b(If)32 b(one)i(then)f(uses)g(a)g(region)g
+(\014le)f(generated)i(from)0 5022 y(this)29 b(image)i(\(in)f(image)g
+(pixel)f(units\))h(to)h(\014lter)e(the)i(R)m(OSA)-8 b(T)30
+b(ev)m(en)m(ts)i(\014le,)e(then)g(the)h(X)g(and)f(Y)g(column)g(v)-5
+b(alues)0 5135 y(m)m(ust)30 b(b)s(e)g(con)m(v)m(erted)i(to)f(corresp)s
+(onding)d(pixel)h(units)g(as)h(in:)382 5368 y Fe
+(regfilter\("rosat.reg",)42 b(X/32.+.5,)j(Y/32.+.5\))0
+5601 y Fj(Note)h(that)f(this)e(binning)e(con)m(v)m(ersion)k(is)e(not)i
+(necessary)g(if)e(the)i(region)f(\014le)f(is)h(sp)s(eci\014ed)e(using)h
+(celestial)0 5714 y(co)s(ordinate)h(units)f(instead)g(of)h(pixel)f
+(units)g(b)s(ecause)h(CFITSIO)e(is)i(then)f(able)h(to)h(directly)e
+(compare)i(the)p eop
+%%Page: 125 133
+125 132 bop 0 299 a Fh(10.10.)73 b(R)m(O)m(W)31 b(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)1936 b Fj(125)0 555
+y(celestial)27 b(co)s(ordinate)h(of)f(eac)m(h)i(ro)m(w)f(in)e(the)i
+(table)f(with)g(the)g(celestial)h(co)s(ordinates)f(in)f(the)i(region)f
+(\014le)g(without)0 668 y(ha)m(ving)j(to)h(kno)m(w)f(an)m(ything)g(ab)s
+(out)g(ho)m(w)h(the)f(image)h(ma)m(y)g(ha)m(v)m(e)g(b)s(een)f(binned.)0
+828 y(The)f(last)g("w)m(cs)h(cols")g(parameter)g(should)d(rarely)h(b)s
+(e)h(needed.)40 b(If)29 b(supplied,)d(this)j(string)f(con)m(tains)i
+(the)f(names)0 941 y(of)37 b(the)g(2)h(columns)e(\(space)i(or)f(comma)g
+(separated\))h(whic)m(h)e(ha)m(v)m(e)i(the)g(asso)s(ciated)f(W)m(CS)g
+(k)m(eyw)m(ords.)61 b(If)37 b(not)0 1054 y(supplied,)d(the)i(\014lter)f
+(will)f(scan)i(the)g(X)g(and)f(Y)h(expressions)f(for)h(column)e(names.)
+58 b(If)35 b(only)g(one)i(is)e(found)f(in)0 1167 y(eac)m(h)e
+(expression,)d(those)i(columns)e(will)f(b)s(e)h(used,)h(otherwise)g(an)
+g(error)g(will)e(b)s(e)i(returned.)0 1327 y(These)g(region)g(shap)s(es)
+g(are)g(supp)s(orted)f(\(names)h(are)h(case)h(insensitiv)m(e\):)334
+1591 y Fe(Point)428 b(\()48 b(X1,)f(Y1)g(\))715 b(<-)48
+b(One)f(pixel)f(square)g(region)334 1704 y(Line)476 b(\()48
+b(X1,)f(Y1,)g(X2,)f(Y2)i(\))333 b(<-)48 b(One)f(pixel)f(wide)h(region)
+334 1817 y(Polygon)332 b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2,)h(...)g(\))95
+b(<-)48 b(Rest)e(are)h(interiors)e(with)334 1930 y(Rectangle)236
+b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2,)h(A)h(\))334 b(|)47 b(boundaries)e
+(considered)334 2043 y(Box)524 b(\()48 b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)
+i(\))143 b(V)47 b(within)f(the)h(region)334 2156 y(Diamond)332
+b(\()48 b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)i(\))334 2269
+y(Circle)380 b(\()48 b(Xc,)f(Yc,)g(R)g(\))334 2382 y(Annulus)332
+b(\()48 b(Xc,)f(Yc,)g(Rin,)f(Rout)h(\))334 2494 y(Ellipse)332
+b(\()48 b(Xc,)f(Yc,)g(Rx,)f(Ry,)h(A)h(\))334 2607 y(Elliptannulus)c(\()
+k(Xc,)f(Yc,)g(Rinx,)f(Riny,)g(Routx,)g(Routy,)g(Ain,)h(Aout)g(\))334
+2720 y(Sector)380 b(\()48 b(Xc,)f(Yc,)g(Amin,)f(Amax)h(\))0
+2984 y Fj(where)28 b(\(Xc,Yc\))j(is)c(the)i(co)s(ordinate)g(of)f(the)h
+(shap)s(e's)f(cen)m(ter;)j(\(X#,Y#\))e(are)g(the)g(co)s(ordinates)f(of)
+h(the)g(shap)s(e's)0 3097 y(edges;)39 b(Rxxx)c(are)g(the)h(shap)s(es')f
+(v)-5 b(arious)34 b(Radii)g(or)h(semima)5 b(jor/minor)34
+b(axes;)k(and)d(Axxx)g(are)h(the)g(angles)f(of)0 3210
+y(rotation)d(\(or)f(b)s(ounding)e(angles)i(for)g(Sector\))h(in)e
+(degrees.)44 b(F)-8 b(or)32 b(rotated)h(shap)s(es,)e(the)g(rotation)h
+(angle)f(can)h(b)s(e)0 3323 y(left)f(o\013,)i(indicating)c(no)i
+(rotation.)45 b(Common)31 b(alternate)h(names)f(for)h(the)f(regions)g
+(can)h(also)g(b)s(e)e(used:)43 b(rotb)s(o)m(x)0 3436
+y(=)29 b(b)s(o)m(x;)g(rotrectangle)h(=)f(rectangle;)h(\(rot\)rhom)m
+(bus)f(=)f(\(rot\)diamond;)i(and)e(pie)g(=)g(sector.)42
+b(When)28 b(a)i(shap)s(e's)0 3549 y(name)e(is)f(preceded)g(b)m(y)h(a)g
+(min)m(us)f(sign,)g('-',)j(the)e(de\014ned)e(region)i(is)f(instead)g
+(the)h(area)h(*outside*)f(its)f(b)s(oundary)0 3662 y(\(ie,)35
+b(the)f(region)g(is)f(in)m(v)m(erted\).)52 b(All)32 b(the)i(shap)s(es)f
+(within)f(a)i(single)f(region)g(\014le)h(are)g(OR'd)f(together)j(to)e
+(create)0 3775 y(the)29 b(region,)h(and)e(the)i(order)f(is)f
+(signi\014can)m(t.)39 b(The)29 b(o)m(v)m(erall)g(w)m(a)m(y)i(of)e(lo)s
+(oking)f(at)i(region)f(\014les)f(is)g(that)i(if)e(the)i(\014rst)0
+3888 y(region)e(is)g(an)h(excluded)f(region)g(then)g(a)i(dumm)m(y)d
+(included)f(region)j(of)g(the)g(whole)f(detector)i(is)e(inserted)f(in)h
+(the)0 4000 y(fron)m(t.)40 b(Then)25 b(eac)m(h)j(region)e(sp)s
+(eci\014cation)g(as)h(it)f(is)g(pro)s(cessed)g(o)m(v)m(errides)g(an)m
+(y)h(selections)g(inside)d(of)j(that)g(region)0 4113
+y(sp)s(eci\014ed)35 b(b)m(y)h(previous)f(regions.)58
+b(Another)37 b(w)m(a)m(y)g(of)g(thinking)d(ab)s(out)i(this)f(is)h(that)
+h(if)e(a)i(previous)e(excluded)0 4226 y(region)30 b(is)f(completely)h
+(inside)f(of)h(a)h(subsequen)m(t)e(included)f(region)i(the)h(excluded)e
+(region)h(is)f(ignored.)0 4386 y(The)44 b(p)s(ositional)f(co)s
+(ordinates)i(ma)m(y)g(b)s(e)g(giv)m(en)g(either)f(in)g(pixel)f(units,)k
+(decimal)d(degrees)i(or)f(hh:mm:ss.s,)0 4499 y(dd:mm:ss.s)25
+b(units.)37 b(The)26 b(shap)s(e)f(sizes)h(ma)m(y)g(b)s(e)g(giv)m(en)g
+(in)e(pixels,)i(degrees,)h(arcmin)m(utes,)g(or)f(arcseconds.)40
+b(Lo)s(ok)0 4612 y(at)31 b(examples)f(of)g(region)g(\014le)g(pro)s
+(duced)e(b)m(y)i(fv/PO)m(W)h(or)g(ds9)f(for)g(further)f(details)g(of)i
+(the)f(region)g(\014le)f(format.)0 4772 y(There)37 b(are)g(three)g
+(functions)f(that)h(are)h(primarily)c(for)i(use)h(with)f(SA)m(O)h
+(region)f(\014les)g(and)h(the)g(FSA)m(OI)g(task,)0 4885
+y(but)e(they)h(can)h(b)s(e)e(used)g(directly)-8 b(.)57
+b(They)36 b(return)f(a)h(b)s(o)s(olean)f(true)h(or)g(false)f(dep)s
+(ending)f(on)i(whether)f(a)i(t)m(w)m(o)0 4998 y(dimensional)28
+b(p)s(oin)m(t)h(is)g(in)g(the)i(region)f(or)g(not:)191
+5262 y Fe("point)46 b(in)h(a)h(circular)d(region")477
+5375 y(circle\(xcntr,ycntr,radius)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191
+5601 y("point)h(in)h(an)g(elliptical)e(region")430 5714
+y(ellipse\(xcntr,ycntr,xhl)o(f_w)o(dth,)o(yhlf)o(_wd)o(th,r)o(otat)o
+(ion)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))p eop
+%%Page: 126 134
+126 133 bop 0 299 a Fj(126)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)191 668 y
+Fe("point)46 b(in)h(a)h(rectangular)c(region")620 781
+y(box\(xcntr,ycntr,xfll_wdth,)o(yfll)o(_wd)o(th,r)o(otat)o(ion)o(,Xco)o
+(lumn)o(,Yc)o(olum)o(n\))191 1007 y(where)334 1120 y(\(xcntr,ycntr\))g
+(are)j(the)g(\(x,y\))f(position)g(of)h(the)g(center)f(of)h(the)g
+(region)334 1233 y(\(xhlf_wdth,yhlf_wdth\))42 b(are)47
+b(the)g(\(x,y\))f(half)h(widths)f(of)h(the)g(region)334
+1346 y(\(xfll_wdth,yfll_wdth\))42 b(are)47 b(the)g(\(x,y\))f(full)h
+(widths)f(of)h(the)g(region)334 1458 y(\(radius\))f(is)h(half)f(the)h
+(diameter)f(of)h(the)g(circle)334 1571 y(\(rotation\))e(is)i(the)g
+(angle\(degrees\))d(that)j(the)g(region)f(is)h(rotated)f(with)620
+1684 y(respect)g(to)h(\(xcntr,ycntr\))334 1797 y(\(Xcoord,Ycoord\))d
+(are)j(the)g(\(x,y\))f(coordinates)f(to)i(test,)f(usually)g(column)620
+1910 y(names)334 2023 y(NOTE:)g(each)h(parameter)e(can)i(itself)f(be)i
+(an)f(expression,)d(not)j(merely)f(a)620 2136 y(column)h(name)f(or)h
+(constant.)0 2443 y Fd(10.10.6)113 b(Example)36 b(Ro)m(w)h(Filters)191
+2665 y Fe([)47 b(binary)f(&&)i(mag)f(<=)g(5.0])380 b(-)48
+b(Extract)e(all)h(binary)f(stars)g(brighter)1766 2778
+y(than)94 b(fifth)47 b(magnitude)e(\(note)h(that)1766
+2891 y(the)h(initial)f(space)g(is)h(necessary)e(to)1766
+3004 y(prevent)h(it)h(from)g(being)f(treated)g(as)h(a)1766
+3117 y(binning)f(specification\))191 3343 y([#row)g(>=)h(125)g(&&)h
+(#row)e(<=)h(175])142 b(-)48 b(Extract)e(row)h(numbers)e(125)i(through)
+f(175)191 3569 y([IMAGE[4,5])f(.gt.)h(100])476 b(-)48
+b(Extract)e(all)h(rows)f(that)h(have)g(the)1766 3681
+y(\(4,5\))f(component)g(of)h(the)g(IMAGE)f(column)1766
+3794 y(greater)g(than)g(100)191 4020 y([abs\(sin\(theta)e(*)j(#deg\)\))
+f(<)i(0.5])e(-)i(Extract)e(all)h(rows)f(having)g(the)1766
+4133 y(absolute)f(value)i(of)g(the)g(sine)g(of)g(theta)1766
+4246 y(less)94 b(than)47 b(a)g(half)g(where)f(the)h(angles)1766
+4359 y(are)g(tabulated)e(in)i(degrees)191 4585 y([SUM\()f(SPEC)h(>)g
+(3*BACKGRND)e(\)>=1])94 b(-)48 b(Extract)e(all)h(rows)f(containing)f(a)
+1766 4698 y(spectrum,)g(held)i(in)g(vector)f(column)1766
+4811 y(SPEC,)g(with)h(at)g(least)f(one)h(value)g(3)1766
+4924 y(times)f(greater)g(than)h(the)g(background)1766
+5036 y(level)f(held)h(in)g(a)h(keyword,)d(BACKGRND)191
+5262 y([VCOL=={1,4,2}])759 b(-)48 b(Extract)e(all)h(rows)f(whose)h
+(vector)f(column)1766 5375 y(VCOL)h(contains)e(the)i(3-elements)e(1,)i
+(4,)g(and)1766 5488 y(2.)191 5714 y([@rowFilter.txt])711
+b(-)48 b(Extract)e(rows)g(using)h(the)g(expression)p
+eop
+%%Page: 127 135
+127 134 bop 0 299 a Fh(10.11.)113 b(BINNING)32 b(OR)e(HISTOGRAMMING)g
+(SPECIFICA)-8 b(TION)1223 b Fj(127)1766 555 y Fe(contained)45
+b(within)h(the)h(text)g(file)1766 668 y(rowFilter.txt)191
+894 y([gtifilter\(\)])855 b(-)48 b(Search)e(the)h(current)f(file)g(for)
+h(a)h(GTI)239 1007 y(extension,)92 b(filter)i(the)47
+b(TIME)239 1120 y(column)f(in)h(the)g(current)f(table,)g(using)239
+1233 y(START/STOP)f(times)h(taken)g(from)239 1346 y(columns)f(in)j(the)
+f(GTI)94 b(extension)191 1571 y([regfilter\("pow.reg"\)])423
+b(-)48 b(Extract)e(rows)g(which)h(have)f(a)i(coordinate)1766
+1684 y(\(as)f(given)f(in)h(the)g(X)h(and)f(Y)g(columns\))1766
+1797 y(within)f(the)h(spatial)f(region)g(specified)1766
+1910 y(in)h(the)g(pow.reg)f(region)g(file.)191 2136 y
+([regfilter\("pow.reg",)c(Xs,)47 b(Ys\)])f(-)i(Same)f(as)g(above,)f
+(except)g(that)h(the)1766 2249 y(Xs)g(and)g(Ys)g(columns)f(will)h(be)g
+(used)f(to)1766 2362 y(determine)f(the)i(coordinate)e(of)i(each)1766
+2475 y(row)g(in)g(the)g(table.)0 2811 y Ff(10.11)181
+b(Binning)44 b(or)h(Histogramming)i(Sp)t(eci\014cation)0
+3062 y Fj(The)22 b(optional)g(binning)e(sp)s(eci\014er)h(is)h(enclosed)
+h(in)f(square)g(brac)m(k)m(ets)j(and)d(can)h(b)s(e)f(distinguished)d
+(from)k(a)g(general)0 3175 y(ro)m(w)32 b(\014lter)g(sp)s(eci\014cation)
+f(b)m(y)h(the)h(fact)g(that)g(it)f(b)s(egins)f(with)g(the)h(k)m(eyw)m
+(ord)h('bin')e(not)i(immediately)d(follo)m(w)m(ed)0 3288
+y(b)m(y)41 b(an)f(equals)h(sign.)71 b(When)41 b(binning)c(is)j(sp)s
+(eci\014ed,)i(a)f(temp)s(orary)g(N-dimensional)d(FITS)i(primary)f(arra)
+m(y)0 3401 y(is)j(created)i(b)m(y)f(computing)g(the)g(histogram)g(of)g
+(the)g(v)-5 b(alues)43 b(in)e(the)j(sp)s(eci\014ed)d(columns)h(of)h(a)h
+(FITS)e(table)0 3514 y(extension.)e(After)30 b(the)f(histogram)g(is)g
+(computed)g(the)h(input)d(FITS)i(\014le)g(con)m(taining)g(the)g(table)h
+(is)e(then)h(closed)0 3627 y(and)34 b(the)h(temp)s(orary)f(FITS)g
+(primary)f(arra)m(y)i(is)f(op)s(ened)g(and)g(passed)g(to)h(the)g
+(application)e(program.)54 b(Th)m(us,)0 3740 y(the)39
+b(application)e(program)i(nev)m(er)g(sees)g(the)g(original)e(FITS)h
+(table)h(and)f(only)g(sees)i(the)f(image)g(in)e(the)i(new)0
+3853 y(temp)s(orary)32 b(\014le)g(\(whic)m(h)g(has)g(no)h(additional)d
+(extensions\).)48 b(Ob)m(viously)-8 b(,)32 b(the)h(application)e
+(program)h(m)m(ust)h(b)s(e)0 3966 y(exp)s(ecting)d(to)h(op)s(en)f(a)h
+(FITS)e(image)i(and)f(not)g(a)h(FITS)f(table)g(in)f(this)g(case.)0
+4126 y(The)h(data)h(t)m(yp)s(e)f(of)h(the)f(FITS)g(histogram)f(image)i
+(ma)m(y)g(b)s(e)f(sp)s(eci\014ed)e(b)m(y)i(app)s(ending)e('b')i(\(for)h
+(8-bit)f(b)m(yte\),)h('i')0 4239 y(\(for)g(16-bit)f(in)m(tegers\),)h
+('j')g(\(for)g(32-bit)f(in)m(teger\),)i('r')e(\(for)h(32-bit)f
+(\015oating)h(p)s(oin)m(ts\),)e(or)i('d')f(\(for)h(64-bit)f(double)0
+4351 y(precision)i(\015oating)j(p)s(oin)m(t\))e(to)i(the)g('bin')e(k)m
+(eyw)m(ord)i(\(e.g.)54 b('[binr)32 b(X]')j(creates)h(a)f(real)f
+(\015oating)g(p)s(oin)m(t)f(image\).)0 4464 y(If)h(the)i(data)f(t)m(yp)
+s(e)g(is)f(not)i(explicitly)c(sp)s(eci\014ed)h(then)i(a)g(32-bit)h(in)m
+(teger)f(image)g(will)d(b)s(e)j(created)h(b)m(y)e(default,)0
+4577 y(unless)23 b(the)j(w)m(eigh)m(ting)e(option)h(is)f(also)h(sp)s
+(eci\014ed)e(in)h(whic)m(h)g(case)i(the)f(image)h(will)c(ha)m(v)m(e)k
+(a)g(32-bit)f(\015oating)g(p)s(oin)m(t)0 4690 y(data)31
+b(t)m(yp)s(e)g(b)m(y)f(default.)0 4850 y(The)24 b(histogram)f(image)i
+(ma)m(y)g(ha)m(v)m(e)g(from)f(1)g(to)h(4)g(dimensions)c(\(axes\),)27
+b(dep)s(ending)22 b(on)i(the)g(n)m(um)m(b)s(er)f(of)h(columns)0
+4963 y(that)31 b(are)g(sp)s(eci\014ed.)39 b(The)30 b(general)g(form)g
+(of)g(the)h(binning)c(sp)s(eci\014cation)i(is:)48 5226
+y Fe([bin{bijrd})92 b(Xcol=min:max:binsize,)42 b(Ycol=)47
+b(...,)f(Zcol=...,)f(Tcol=...;)h(weight])0 5488 y Fj(in)38
+b(whic)m(h)g(up)g(to)i(4)g(columns,)g(eac)m(h)g(corresp)s(onding)d(to)j
+(an)g(axis)e(of)i(the)f(image,)j(are)e(listed.)65 b(The)39
+b(column)0 5601 y(names)27 b(are)h(case)h(insensitiv)m(e,)d(and)h(the)h
+(column)e(n)m(um)m(b)s(er)g(ma)m(y)i(b)s(e)f(giv)m(en)g(instead)g(of)h
+(the)g(name,)g(preceded)f(b)m(y)0 5714 y(a)32 b(p)s(ound)e(sign)h
+(\(e.g.,)j([bin)c(#4=1:512]\).)47 b(If)31 b(the)h(column)f(name)h(is)e
+(not)i(sp)s(eci\014ed,)f(then)g(CFITSIO)g(will)e(\014rst)p
+eop
+%%Page: 128 136
+128 135 bop 0 299 a Fj(128)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fj(try)37
+b(to)h(use)f(the)g('preferred)f(column')h(as)g(sp)s(eci\014ed)f(b)m(y)h
+(the)g(CPREF)g(k)m(eyw)m(ord)h(if)e(it)g(exists)h(\(e.g.,)k('CPREF)0
+668 y(=)i('DETX,DETY'\),)h(otherwise)f(column)f(names)h('X',)h('Y',)g
+('Z',)f(and)f('T')i(will)c(b)s(e)i(assumed)h(for)g(eac)m(h)h(of)0
+781 y(the)37 b(4)h(axes,)i(resp)s(ectiv)m(ely)-8 b(.)60
+b(In)37 b(cases)h(where)e(the)i(column)e(name)h(could)f(b)s(e)g
+(confused)h(with)f(an)h(arithmetic)0 894 y(expression,)29
+b(enclose)i(the)g(column)e(name)h(in)f(paren)m(theses)i(to)g(force)g
+(the)f(name)h(to)g(b)s(e)f(in)m(terpreted)f(literally)-8
+b(.)0 1054 y(Eac)m(h)33 b(column)e(name)h(ma)m(y)h(b)s(e)f(follo)m(w)m
+(ed)f(b)m(y)i(an)f(equals)f(sign)h(and)f(then)h(the)g(lo)m(w)m(er)h
+(and)f(upp)s(er)e(range)i(of)h(the)0 1167 y(histogram,)e(and)f(the)h
+(size)g(of)g(the)g(histogram)g(bins,)e(separated)i(b)m(y)g(colons.)42
+b(Spaces)31 b(are)g(allo)m(w)m(ed)g(b)s(efore)g(and)0
+1280 y(after)e(the)g(equals)f(sign)f(but)h(not)h(within)d(the)j
+('min:max:binsize')d(string.)39 b(The)29 b(min,)e(max)i(and)f(binsize)f
+(v)-5 b(alues)0 1393 y(ma)m(y)32 b(b)s(e)e(in)m(teger)h(or)g
+(\015oating)g(p)s(oin)m(t)f(n)m(um)m(b)s(ers,)g(or)h(they)g(ma)m(y)g(b)
+s(e)g(the)g(names)g(of)g(k)m(eyw)m(ords)g(in)f(the)h(header)g(of)0
+1506 y(the)g(table.)40 b(If)30 b(the)h(latter,)g(then)f(the)g(v)-5
+b(alue)30 b(of)h(that)g(k)m(eyw)m(ord)f(is)g(substituted)f(in)m(to)h
+(the)h(expression.)0 1666 y(Default)36 b(v)-5 b(alues)35
+b(for)h(the)g(min,)g(max)g(and)g(binsize)e(quan)m(tities)h(will)e(b)s
+(e)i(used)h(if)e(not)j(explicitly)c(giv)m(en)j(in)f(the)0
+1779 y(binning)27 b(expression)i(as)i(sho)m(wn)f(in)f(these)i
+(examples:)191 2033 y Fe([bin)47 b(x)g(=)g(:512:2])94
+b(-)47 b(use)g(default)f(minimum)g(value)191 2146 y([bin)h(x)g(=)g
+(1::2])190 b(-)47 b(use)g(default)f(maximum)g(value)191
+2259 y([bin)h(x)g(=)g(1:512])142 b(-)47 b(use)g(default)f(bin)h(size)
+191 2372 y([bin)g(x)g(=)g(1:])286 b(-)47 b(use)g(default)f(maximum)g
+(value)g(and)h(bin)g(size)191 2485 y([bin)g(x)g(=)g(:512])190
+b(-)47 b(use)g(default)f(minimum)g(value)g(and)h(bin)g(size)191
+2598 y([bin)g(x)g(=)g(2])334 b(-)47 b(use)g(default)f(minimum)g(and)h
+(maximum)f(values)191 2711 y([bin)h(x])524 b(-)47 b(use)g(default)f
+(minimum,)g(maximum)g(and)g(bin)h(size)191 2824 y([bin)g(4])524
+b(-)47 b(default)f(2-D)h(image,)f(bin)h(size)g(=)g(4)h(in)f(both)g
+(axes)191 2937 y([bin])619 b(-)47 b(default)f(2-D)h(image)0
+3191 y Fj(CFITSIO)31 b(will)f(use)i(the)h(v)-5 b(alue)32
+b(of)h(the)g(TLMINn,)f(TLMAXn,)h(and)f(TDBINn)h(k)m(eyw)m(ords,)h(if)d
+(they)i(exist,)g(for)0 3304 y(the)k(default)e(min,)i(max,)h(and)e
+(binsize,)g(resp)s(ectiv)m(ely)-8 b(.)59 b(If)36 b(they)h(do)f(not)h
+(exist)f(then)g(CFITSIO)f(will)f(use)i(the)0 3417 y(actual)c(minim)m
+(um)d(and)j(maxim)m(um)f(v)-5 b(alues)31 b(in)g(the)h(column)e(for)i
+(the)g(histogram)g(min)e(and)i(max)g(v)-5 b(alues.)44
+b(The)0 3530 y(default)33 b(binsize)e(will)g(b)s(e)i(set)h(to)h(1,)g
+(or)e(\(max)h(-)g(min\))e(/)i(10.,)i(whic)m(hev)m(er)d(is)g(smaller,)g
+(so)g(that)i(the)e(histogram)0 3643 y(will)28 b(ha)m(v)m(e)j(at)g
+(least)g(10)g(bins)e(along)h(eac)m(h)i(axis.)0 3803 y(A)41
+b(shortcut)g(notation)g(is)f(allo)m(w)m(ed)h(if)f(all)g(the)h
+(columns/axes)g(ha)m(v)m(e)h(the)f(same)g(binning)d(sp)s
+(eci\014cation.)72 b(In)0 3916 y(this)32 b(case)h(all)f(the)h(column)e
+(names)i(ma)m(y)g(b)s(e)f(listed)f(within)f(paren)m(theses,)k(follo)m
+(w)m(ed)f(b)m(y)f(the)h(\(single\))f(binning)0 4029 y(sp)s
+(eci\014cation,)d(as)i(in:)191 4283 y Fe([bin)47 b(\(X,Y\)=1:512:2])191
+4396 y([bin)g(\(X,Y\))f(=)h(5])0 4650 y Fj(The)31 b(optional)g(w)m
+(eigh)m(ting)h(factor)g(is)f(the)h(last)f(item)h(in)e(the)i(binning)d
+(sp)s(eci\014er)h(and,)i(if)e(presen)m(t,)j(is)d(separated)0
+4763 y(from)38 b(the)g(list)f(of)h(columns)f(b)m(y)h(a)h(semi-colon.)63
+b(As)39 b(the)f(histogram)g(is)f(accum)m(ulated,)k(this)c(w)m(eigh)m(t)
+i(is)e(used)0 4876 y(to)e(incremen)m(ted)e(the)h(v)-5
+b(alue)34 b(of)g(the)g(appropriated)e(bin)h(in)f(the)i(histogram.)51
+b(If)34 b(the)g(w)m(eigh)m(ting)g(factor)h(is)e(not)0
+4989 y(sp)s(eci\014ed,)23 b(then)g(the)g(default)f(w)m(eigh)m(t)i(=)e
+(1)i(is)e(assumed.)37 b(The)23 b(w)m(eigh)m(ting)g(factor)h(ma)m(y)f(b)
+s(e)g(a)g(constan)m(t)i(in)m(teger)e(or)0 5102 y(\015oating)29
+b(p)s(oin)m(t)f(n)m(um)m(b)s(er,)g(or)h(the)g(name)g(of)g(a)g(k)m(eyw)m
+(ord)h(con)m(taining)e(the)i(w)m(eigh)m(ting)e(v)-5 b(alue.)40
+b(Or)28 b(the)h(w)m(eigh)m(ting)0 5215 y(factor)g(ma)m(y)g(b)s(e)e(the)
+h(name)g(of)h(a)f(table)g(column)f(in)g(whic)m(h)f(case)k(the)e(v)-5
+b(alue)27 b(in)g(that)i(column,)e(on)h(a)h(ro)m(w)f(b)m(y)g(ro)m(w)0
+5328 y(basis,)h(will)f(b)s(e)i(used.)0 5488 y(In)35 b(some)h(cases,)i
+(the)d(column)g(or)g(k)m(eyw)m(ord)h(ma)m(y)g(giv)m(e)g(the)g(recipro)s
+(cal)e(of)i(the)g(actual)g(w)m(eigh)m(t)g(v)-5 b(alue)35
+b(that)h(is)0 5601 y(needed.)49 b(In)32 b(this)g(case,)j(precede)e(the)
+h(w)m(eigh)m(t)f(k)m(eyw)m(ord)h(or)f(column)f(name)h(b)m(y)g(a)g
+(slash)f('/')i(to)g(tell)e(CFITSIO)0 5714 y(to)f(use)f(the)h(recipro)s
+(cal)e(of)h(the)h(v)-5 b(alue)30 b(when)f(constructing)h(the)h
+(histogram.)p eop
+%%Page: 129 137
+129 136 bop 0 299 a Fh(10.11.)113 b(BINNING)32 b(OR)e(HISTOGRAMMING)g
+(SPECIFICA)-8 b(TION)1223 b Fj(129)0 555 y(F)-8 b(or)25
+b(complex)f(or)g(commonly)f(used)h(histograms,)h(one)f(can)h(also)f
+(place)g(its)f(description)f(in)m(to)i(a)h(text)g(\014le)e(and)h(im-)0
+668 y(p)s(ort)e(it)f(in)m(to)h(the)h(binning)c(sp)s(eci\014cation)i
+(using)f(the)j(syn)m(tax)f([bin)f(@\014lename.txt].)38
+b(The)22 b(\014le's)f(con)m(ten)m(ts)j(can)e(ex-)0 781
+y(tend)h(o)m(v)m(er)i(m)m(ultiple)c(lines,)i(although)g(it)g(m)m(ust)g
+(still)e(conform)i(to)h(the)g(no-spaces)g(rule)e(for)h(the)h
+(min:max:binsize)0 894 y(syn)m(tax)35 b(and)f(eac)m(h)h(axis)f(sp)s
+(eci\014cation)g(m)m(ust)g(still)e(b)s(e)i(comma-separated.)55
+b(An)m(y)34 b(lines)f(in)g(the)i(external)f(text)0 1007
+y(\014le)26 b(that)h(b)s(egin)f(with)f(2)j(slash)d(c)m(haracters)k
+(\('//'\))g(will)24 b(b)s(e)i(ignored)g(and)g(ma)m(y)i(b)s(e)e(used)g
+(to)i(add)e(commen)m(ts)i(in)m(to)0 1120 y(the)j(\014le.)0
+1280 y(Examples:)191 1540 y Fe([bini)46 b(detx,)h(dety])762
+b(-)47 b(2-D,)g(16-bit)f(integer)g(histogram)1861 1653
+y(of)i(DETX)e(and)h(DETY)g(columns,)e(using)1861 1766
+y(default)h(values)g(for)h(the)g(histogram)1861 1878
+y(range)g(and)g(binsize)191 2104 y([bin)g(\(detx,)f(dety\)=16;)f
+(/exposure])g(-)i(2-D,)g(32-bit)f(real)h(histogram)e(of)i(DETX)1861
+2217 y(and)g(DETY)g(columns)f(with)g(a)i(bin)f(size)f(=)i(16)1861
+2330 y(in)g(both)e(axes.)h(The)f(histogram)g(values)1861
+2443 y(are)h(divided)f(by)h(the)g(EXPOSURE)f(keyword)1861
+2556 y(value.)191 2782 y([bin)h(time=TSTART:TSTOP:0.1])280
+b(-)47 b(1-D)g(lightcurve,)e(range)h(determined)f(by)1861
+2895 y(the)i(TSTART)f(and)h(TSTOP)g(keywords,)1861 3008
+y(with)g(0.1)g(unit)g(size)f(bins.)191 3233 y([bin)h(pha,)f
+(time=8000.:8100.:0.1])90 b(-)47 b(2-D)g(image)g(using)f(default)g
+(binning)1861 3346 y(of)i(the)e(PHA)h(column)f(for)h(the)g(X)h(axis,)
+1861 3459 y(and)f(1000)g(bins)g(in)g(the)g(range)1861
+3572 y(8000.)g(to)g(8100.)f(for)h(the)g(Y)h(axis.)191
+3798 y([bin)f(@binFilter.txt])616 b(-)47 b(Use)g(the)g(contents)f(of)h
+(the)g(text)f(file)1861 3911 y(binFilter.txt)f(for)h(the)h(binning)1861
+4024 y(specifications.)p eop
+%%Page: 130 138
+130 137 bop 0 299 a Fj(130)1528 b Fh(CHAPTER)29 b(10.)113
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)p eop
+%%Page: 131 139
+131 138 bop 0 1225 a Fg(Chapter)65 b(11)0 1687 y Fm(T)-19
+b(emplate)76 b(Files)0 2180 y Fj(When)38 b(a)h(new)f(FITS)g(\014le)g
+(is)g(created)h(with)f(a)g(call)g(to)i(\014ts)p 2101
+2180 28 4 v 32 w(create)p 2369 2180 V 35 w(\014le,)f(the)g(name)g(of)g
+(a)g(template)g(\014le)e(ma)m(y)0 2293 y(b)s(e)i(supplied)e(in)i(paren)
+m(theses)h(immediately)e(follo)m(wing)g(the)j(name)f(of)g(the)g(new)f
+(\014le)g(to)i(b)s(e)e(created.)71 b(This)0 2406 y(template)26
+b(is)e(used)h(to)h(de\014ne)f(the)h(structure)f(of)h(one)f(or)h(more)g
+(HDUs)g(in)e(the)i(new)f(\014le.)38 b(The)25 b(template)h(\014le)e(ma)m
+(y)0 2518 y(b)s(e)32 b(another)h(FITS)f(\014le,)h(in)f(whic)m(h)f(case)
+j(the)f(newly)f(created)i(\014le)e(will)e(ha)m(v)m(e)k(exactly)g(the)f
+(same)g(k)m(eyw)m(ords)g(in)0 2631 y(eac)m(h)25 b(HDU)g(as)g(in)e(the)h
+(template)h(FITS)e(\014le,)i(but)e(all)h(the)g(data)h(units)d(will)g(b)
+s(e)i(\014lled)e(with)g(zeros.)40 b(The)24 b(template)0
+2744 y(\014le)h(ma)m(y)i(also)f(b)s(e)f(an)h(ASCI)s(I)e(text)j(\014le,)
+f(where)g(eac)m(h)h(line)d(\(in)h(general\))i(describ)s(es)d(one)i
+(FITS)f(k)m(eyw)m(ord)i(record.)0 2857 y(The)j(format)h(of)f(the)h
+(ASCI)s(I)e(template)h(\014le)g(is)f(describ)s(ed)f(in)i(the)g(follo)m
+(wing)f(sections.)0 3188 y Ff(11.1)136 b(Detailed)46
+b(T)-11 b(emplate)46 b(Line)f(F)-11 b(ormat)0 3438 y
+Fj(The)30 b(format)h(of)f(eac)m(h)i(ASCI)s(I)c(template)j(line)e
+(closely)h(follo)m(ws)f(the)i(format)g(of)f(a)h(FITS)f(k)m(eyw)m(ord)g
+(record:)95 3682 y Fe(KEYWORD)46 b(=)i(KEYVALUE)d(/)j(COMMENT)0
+3926 y Fj(except)22 b(that)g(free)g(format)f(ma)m(y)h(b)s(e)f(used)f
+(\(e.g.,)25 b(the)d(equals)e(sign)h(ma)m(y)g(app)s(ear)g(at)h(an)m(y)g
+(p)s(osition)d(in)h(the)i(line\))e(and)0 4039 y(T)-8
+b(AB)34 b(c)m(haracters)g(are)g(allo)m(w)m(ed)f(and)g(are)g(treated)h
+(the)g(same)f(as)h(space)f(c)m(haracters.)51 b(The)33
+b(KEYV)-10 b(ALUE)33 b(and)0 4152 y(COMMENT)d(\014elds)f(are)i
+(optional.)41 b(The)30 b(equals)g(sign)f(c)m(haracter)k(is)c(also)i
+(optional,)f(but)g(it)g(is)f(recommended)0 4264 y(that)42
+b(it)e(b)s(e)h(included)d(for)j(clarit)m(y)-8 b(.)73
+b(An)m(y)41 b(template)h(line)d(that)j(b)s(egins)e(with)f(the)j(p)s
+(ound)d('#')i(c)m(haracter)i(is)0 4377 y(ignored)29 b(b)m(y)i(the)f
+(template)h(parser)f(and)g(ma)m(y)h(b)s(e)e(use)h(to)h(insert)f(commen)
+m(ts)h(in)m(to)f(the)h(template)g(\014le)e(itself.)0
+4538 y(The)d(KEYW)m(ORD)g(name)g(\014eld)f(is)g(limited)f(to)j(8)f(c)m
+(haracters)h(in)e(length)h(and)f(only)g(the)h(letters)h(A-Z,)f(digits)f
+(0-9,)0 4650 y(and)j(the)g(h)m(yphen)f(and)h(underscore)g(c)m
+(haracters)h(ma)m(y)g(b)s(e)f(used,)g(without)g(an)m(y)g(em)m(b)s
+(edded)g(spaces.)40 b(Lo)m(w)m(ercase)0 4763 y(letters)21
+b(in)f(the)i(template)f(k)m(eyw)m(ord)h(name)f(will)d(b)s(e)j(con)m(v)m
+(erted)i(to)f(upp)s(ercase.)36 b(Leading)21 b(spaces)g(in)f(the)i
+(template)0 4876 y(line)i(preceding)h(the)g(k)m(eyw)m(ord)h(name)g(are)
+g(generally)f(ignored,)h(except)g(if)f(the)h(\014rst)f(8)h(c)m
+(haracters)h(of)f(a)g(template)0 4989 y(line)d(are)j(all)e(blank,)h
+(then)g(the)g(en)m(tire)g(line)f(is)g(treated)i(as)f(a)h(FITS)e(commen)
+m(t)i(k)m(eyw)m(ord)g(\(with)e(a)i(blank)d(k)m(eyw)m(ord)0
+5102 y(name\))31 b(and)f(is)f(copied)h(v)m(erbatim)g(in)m(to)g(the)h
+(FITS)e(header.)0 5262 y(The)37 b(KEYV)-10 b(ALUE)37
+b(\014eld)f(ma)m(y)i(ha)m(v)m(e)g(an)m(y)g(allo)m(w)m(ed)f(FITS)g(data)
+h(t)m(yp)s(e:)54 b(c)m(haracter)39 b(string,)g(logical,)f(in)m(teger,)0
+5375 y(real,)33 b(complex)f(in)m(teger,)i(or)e(complex)h(real.)46
+b(The)32 b(c)m(haracter)j(string)c(v)-5 b(alues)32 b(need)g(not)h(b)s
+(e)f(enclosed)g(in)f(single)0 5488 y(quote)e(c)m(haracters)h(unless)d
+(they)h(are)h(necessary)g(to)g(distinguish)24 b(the)29
+b(string)e(from)h(a)h(di\013eren)m(t)f(data)h(t)m(yp)s(e)f(\(e.g.)0
+5601 y(2.0)h(is)d(a)i(real)g(but)f('2.0')i(is)e(a)h(string\).)39
+b(The)27 b(k)m(eyw)m(ord)h(has)f(an)h(unde\014ned)d(\(n)m(ull\))h(v)-5
+b(alue)28 b(if)e(the)i(template)g(record)0 5714 y(only)h(con)m(tains)i
+(blanks)e(follo)m(wing)g(the)h("=")h(or)g(b)s(et)m(w)m(een)g(the)f("=")
+h(and)f(the)g("/")i(commen)m(t)g(\014eld)c(delimiter.)1882
+5942 y(131)p eop
+%%Page: 132 140
+132 139 bop 0 299 a Fj(132)2250 b Fh(CHAPTER)29 b(11.)72
+b(TEMPLA)-8 b(TE)30 b(FILES)0 555 y Fj(String)25 b(k)m(eyw)m(ord)i(v)-5
+b(alues)26 b(longer)g(than)g(68)h(c)m(haracters)h(\(the)f(maxim)m(um)e
+(length)h(that)h(will)d(\014t)i(in)f(a)i(single)e(FITS)0
+668 y(k)m(eyw)m(ord)41 b(record\))g(are)g(p)s(ermitted)e(using)g(the)i
+(CFITSIO)e(long)h(string)g(con)m(v)m(en)m(tion.)73 b(They)40
+b(can)h(either)f(b)s(e)0 781 y(sp)s(eci\014ed)27 b(as)j(a)f(single)f
+(long)g(line)g(in)f(the)j(template,)g(or)f(b)m(y)f(using)g(m)m(ultiple)
+f(lines)g(where)h(the)i(con)m(tin)m(uing)e(lines)0 894
+y(con)m(tain)j(the)f('CONTINUE')g(k)m(eyw)m(ord,)h(as)g(in)e(this)g
+(example:)95 1139 y Fe(LONGKEY)46 b(=)i('This)e(is)h(a)h(long)e(string)
+g(value)h(that)f(is)i(contin&')95 1252 y(CONTINUE)94
+b('ued)46 b(over)h(2)g(records')f(/)h(comment)f(field)h(goes)f(here)0
+1497 y Fj(The)29 b(format)h(of)g(template)g(lines)d(with)i(CONTINUE)f
+(k)m(eyw)m(ord)i(is)f(v)m(ery)h(strict:)40 b(3)30 b(spaces)g(m)m(ust)f
+(follo)m(w)g(CON-)0 1610 y(TINUE)h(and)g(the)g(rest)h(of)f(the)h(line)e
+(is)g(copied)h(v)m(erbatim)g(to)h(the)g(FITS)e(\014le.)0
+1771 y(The)i(start)h(of)g(the)f(optional)g(COMMENT)g(\014eld)f(m)m(ust)
+i(b)s(e)e(preceded)i(b)m(y)f("/",)i(whic)m(h)d(is)h(used)g(to)h
+(separate)g(it)0 1883 y(from)e(the)g(k)m(eyw)m(ord)h(v)-5
+b(alue)29 b(\014eld.)40 b(Exceptions)29 b(are)i(if)e(the)i(KEYW)m(ORD)g
+(name)f(\014eld)f(con)m(tains)h(COMMENT,)0 1996 y(HISTOR)-8
+b(Y,)30 b(CONTINUE,)g(or)g(if)f(the)i(\014rst)f(8)g(c)m(haracters)i(of)
+f(the)f(template)h(line)e(are)i(blanks.)0 2157 y(More)c(than)f(one)h
+(Header-Data)i(Unit)d(\(HDU\))h(ma)m(y)g(b)s(e)f(de\014ned)f(in)g(the)i
+(template)g(\014le.)38 b(The)26 b(start)h(of)g(an)f(HDU)0
+2269 y(de\014nition)i(is)h(denoted)i(with)e(a)i(SIMPLE)e(or)i(XTENSION)
+e(template)i(line:)0 2430 y(1\))j(SIMPLE)f(b)s(egins)f(a)i(Primary)f
+(HDU)h(de\014nition.)48 b(SIMPLE)33 b(ma)m(y)h(only)f(app)s(ear)g(as)h
+(the)g(\014rst)f(k)m(eyw)m(ord)h(in)0 2543 y(the)e(template)h(\014le.)
+44 b(If)32 b(the)g(template)h(\014le)e(b)s(egins)f(with)h(XTENSION)g
+(instead)g(of)h(SIMPLE,)g(then)f(a)i(default)0 2655 y(empt)m(y)d
+(Primary)d(HDU)j(is)f(created,)i(and)d(the)i(template)g(is)e(then)h
+(assumed)f(to)i(de\014ne)f(the)h(k)m(eyw)m(ords)f(starting)0
+2768 y(with)g(the)i(\014rst)e(extension)h(follo)m(wing)f(the)i(Primary)
+e(HDU.)0 2928 y(2\))35 b(XTENSION)e(marks)g(the)i(b)s(eginning)c(of)j
+(a)h(new)e(extension)h(HDU)g(de\014nition.)50 b(The)33
+b(previous)g(HDU)i(will)0 3041 y(b)s(e)30 b(closed)g(at)h(this)e(p)s
+(oin)m(t)h(and)f(pro)s(cessing)h(of)g(the)h(next)f(extension)g(b)s
+(egins.)0 3373 y Ff(11.2)136 b(Auto-indexing)45 b(of)g(Keyw)l(ords)0
+3623 y Fj(If)31 b(a)h(template)f(k)m(eyw)m(ord)h(name)f(ends)g(with)f
+(a)h("#")h(c)m(haracter,)i(it)d(is)f(said)g(to)i(b)s(e)f
+('auto-indexed'.)43 b(Eac)m(h)32 b("#")0 3736 y(c)m(haracter)i(will)c
+(b)s(e)i(replaced)h(b)m(y)f(the)h(curren)m(t)g(in)m(teger)g(index)e(v)
+-5 b(alue,)33 b(whic)m(h)f(gets)h(reset)h(=)e(1)h(at)h(the)e(start)i
+(of)0 3849 y(eac)m(h)h(new)f(HDU)g(in)f(the)h(\014le)f(\(or)h(7)h(in)d
+(the)i(sp)s(ecial)f(case)i(of)f(a)g(GR)m(OUP)h(de\014nition\).)49
+b(The)33 b(FIRST)g(indexed)0 3962 y(k)m(eyw)m(ord)c(in)e(eac)m(h)i
+(template)g(HDU)g(de\014nition)d(is)h(used)g(as)i(the)f('incremen)m
+(tor';)i(eac)m(h)f(subsequen)m(t)f(o)s(ccurrence)0 4075
+y(of)k(this)e(SAME)h(k)m(eyw)m(ord)h(will)d(cause)j(the)g(index)e(v)-5
+b(alue)31 b(to)h(b)s(e)f(incremen)m(ted.)43 b(This)30
+b(b)s(eha)m(vior)g(can)i(b)s(e)f(rather)0 4188 y(subtle,)c(as)h
+(illustrated)e(in)g(the)i(follo)m(wing)e(examples)h(in)f(whic)m(h)h
+(the)h(TTYPE)e(k)m(eyw)m(ord)i(is)f(the)h(incremen)m(tor)f(in)0
+4300 y(b)s(oth)j(cases:)95 4546 y Fe(TTYPE#)47 b(=)g(TIME)95
+4659 y(TFORM#)g(=)g(1D)95 4772 y(TTYPE#)g(=)g(RATE)95
+4884 y(TFORM#)g(=)g(1E)0 5130 y Fj(will)23 b(create)28
+b(TTYPE1,)e(TF)m(ORM1,)i(TTYPE2,)f(and)e(TF)m(ORM2)i(k)m(eyw)m(ords.)40
+b(But)26 b(if)f(the)h(template)g(lo)s(oks)f(lik)m(e,)95
+5375 y Fe(TTYPE#)47 b(=)g(TIME)95 5488 y(TTYPE#)g(=)g(RATE)95
+5601 y(TFORM#)g(=)g(1D)95 5714 y(TFORM#)g(=)g(1E)p eop
+%%Page: 133 141
+133 140 bop 0 299 a Fh(11.3.)73 b(TEMPLA)-8 b(TE)30 b(P)-8
+b(ARSER)30 b(DIRECTIVES)1982 b Fj(133)0 555 y(this)30
+b(results)f(in)h(a)h(FITS)f(\014les)g(with)f(TTYPE1,)i(TTYPE2,)g(TF)m
+(ORM2,)h(and)e(TF)m(ORM2,)i(whic)m(h)e(is)g(probably)0
+668 y(not)h(what)f(w)m(as)h(in)m(tended!)0 1000 y Ff(11.3)136
+b(T)-11 b(emplate)45 b(P)l(arser)h(Directiv)l(es)0 1251
+y Fj(In)29 b(addition)g(to)h(the)g(template)h(lines)d(whic)m(h)h
+(de\014ne)g(individual)d(k)m(eyw)m(ords,)k(the)g(template)h(parser)e
+(recognizes)0 1363 y(3)h(sp)s(ecial)f(directiv)m(es)g(whic)m(h)g(are)h
+(eac)m(h)h(preceded)f(b)m(y)f(the)h(bac)m(kslash)g(c)m(haracter:)90
+b Fe(\\include,)45 b(\\group)p Fj(,)29 b(and)48 1476
+y Fe(\\end)p Fj(.)0 1637 y(The)37 b('include')f(directiv)m(e)i(m)m(ust)
+f(b)s(e)h(follo)m(w)m(ed)f(b)m(y)h(a)g(\014lename.)62
+b(It)38 b(forces)g(the)g(parser)f(to)i(temp)s(orarily)d(stop)0
+1749 y(reading)e(the)h(curren)m(t)g(template)g(\014le)f(and)g(b)s(egin)
+g(reading)g(the)h(include)d(\014le.)54 b(Once)35 b(the)g(parser)f(reac)
+m(hes)i(the)0 1862 y(end)f(of)h(the)g(include)d(\014le)i(it)g(con)m
+(tin)m(ues)g(parsing)g(the)g(curren)m(t)h(template)g(\014le.)55
+b(Include)34 b(\014les)h(can)h(b)s(e)f(nested,)0 1975
+y(and)30 b(HDU)h(de\014nitions)d(can)i(span)g(m)m(ultiple)e(template)j
+(\014les.)0 2135 y(The)g(start)h(of)g(a)g(GR)m(OUP)h(de\014nition)c(is)
+i(denoted)h(with)e(the)i('group')g(directiv)m(e,)f(and)h(the)f(end)h
+(of)f(a)i(GR)m(OUP)0 2248 y(de\014nition)i(is)i(denoted)g(with)f(the)i
+('end')f(directiv)m(e.)61 b(Eac)m(h)39 b(GR)m(OUP)e(con)m(tains)h(0)g
+(or)f(more)h(mem)m(b)s(er)f(blo)s(c)m(ks)0 2361 y(\(HDUs)44
+b(or)f(GR)m(OUPs\).)79 b(Mem)m(b)s(er)42 b(blo)s(c)m(ks)h(of)g(t)m(yp)s
+(e)g(GR)m(OUP)g(can)g(con)m(tain)g(their)f(o)m(wn)h(mem)m(b)s(er)f(blo)
+s(c)m(ks.)0 2474 y(The)32 b(GR)m(OUP)g(de\014nition)e(itself)h(o)s
+(ccupies)h(one)g(FITS)g(\014le)f(HDU)i(of)f(sp)s(ecial)f(t)m(yp)s(e)h
+(\(GR)m(OUP)h(HDU\),)h(so)e(if)g(a)0 2587 y(template)f(sp)s(eci\014es)e
+(1)i(group)e(with)g(1)i(mem)m(b)s(er)f(HDU)h(lik)m(e:)0
+2838 y Fe(\\group)0 2951 y(grpdescr)46 b(=)h('demo')0
+3064 y(xtension)f(bintable)0 3177 y(#)h(this)g(bintable)f(has)h(0)g
+(cols,)f(0)i(rows)0 3290 y(\\end)0 3541 y Fj(then)30
+b(the)h(parser)e(creates)j(a)f(FITS)f(\014le)f(with)g(3)i(HDUs)g(:)0
+3792 y Fe(1\))47 b(dummy)g(PHDU)0 3905 y(2\))g(GROUP)g(HDU)f(\(has)h(1)
+h(member,)d(which)i(is)g(bintable)e(in)j(HDU)f(number)f(3\))0
+4018 y(3\))h(bintable)f(\(member)g(of)h(GROUP)f(in)h(HDU)g(number)f
+(2\))0 4269 y Fj(T)-8 b(ec)m(hnically)29 b(sp)s(eaking,)g(the)g(GR)m
+(OUP)i(HDU)f(is)f(a)h(BINT)-8 b(ABLE)30 b(with)f(6)h(columns.)39
+b(Applications)28 b(can)i(de\014ne)0 4382 y(additional)20
+b(columns)h(in)f(a)j(GR)m(OUP)f(HDU)h(using)e(TF)m(ORMn)g(and)h(TTYPEn)
+f(\(where)g(n)h(is)f(7,)j(8,)h(....\))39 b(k)m(eyw)m(ords)0
+4494 y(or)30 b(their)g(auto-indexing)f(equiv)-5 b(alen)m(ts.)0
+4655 y(F)d(or)26 b(a)f(more)g(complicated)f(example)g(of)h(a)h
+(template)f(\014le)f(using)f(the)i(group)f(directiv)m(es,)i(lo)s(ok)e
+(at)h(the)g(sample.tpl)0 4767 y(\014le)k(that)i(is)f(included)d(in)j
+(the)g(CFITSIO)f(distribution.)0 5100 y Ff(11.4)136 b(F)-11
+b(ormal)45 b(T)-11 b(emplate)46 b(Syn)l(tax)0 5350 y
+Fj(The)30 b(template)h(syn)m(tax)g(can)f(formally)f(b)s(e)h(de\014ned)f
+(as)i(follo)m(ws:)191 5601 y Fe(TEMPLATE)45 b(=)j(BLOCK)e([)i(BLOCK)e
+(...)h(])p eop
+%%Page: 134 142
+134 141 bop 0 299 a Fj(134)2250 b Fh(CHAPTER)29 b(11.)72
+b(TEMPLA)-8 b(TE)30 b(FILES)334 555 y Fe(BLOCK)46 b(=)i({)f(HDU)g(|)h
+(GROUP)e(})334 781 y(GROUP)g(=)i(\\GROUP)e([)h(BLOCK)g(...)g(])g(\\END)
+430 1007 y(HDU)f(=)i(XTENSION)d([)j(LINE)f(...)f(])i({)f(XTENSION)f(|)h
+(\\GROUP)f(|)i(\\END)f(|)g(EOF)g(})382 1233 y(LINE)f(=)i([)f(KEYWORD)f
+([)i(=)f(])h(])f([)g(VALUE)g(])g([)h(/)f(COMMENT)f(])191
+1458 y(X)h(...)238 b(-)48 b(X)f(can)g(be)g(present)f(1)h(or)h(more)e
+(times)191 1571 y({)h(X)h(|)f(Y)h(})f(-)h(X)f(or)g(Y)191
+1684 y([)g(X)h(])238 b(-)48 b(X)f(is)g(optional)0 1937
+y Fj(A)m(t)34 b(the)f(topmost)g(lev)m(el,)g(the)g(template)h(de\014nes)
+d(1)j(or)e(more)h(template)g(blo)s(c)m(ks.)48 b(Blo)s(c)m(ks)33
+b(can)g(b)s(e)f(either)g(HDU)0 2050 y(\(Header)27 b(Data)h(Unit\))f(or)
+f(a)h(GR)m(OUP)-8 b(.)28 b(F)-8 b(or)27 b(eac)m(h)g(blo)s(c)m(k)f(the)h
+(parser)f(creates)i(1)f(\(or)g(more)f(for)h(GR)m(OUPs\))g(FITS)0
+2163 y(\014le)i(HDUs.)0 2495 y Ff(11.5)136 b(Errors)0
+2745 y Fj(In)24 b(general)g(the)g(\014ts)p 692 2745 28
+4 v 33 w(execute)p 1019 2745 V 34 w(template\(\))h(function)e(tries)h
+(to)h(b)s(e)f(as)g(atomic)h(as)g(p)s(ossible,)e(so)h(either)g(ev)m
+(erything)0 2858 y(is)f(done)h(or)g(nothing)e(is)h(done.)39
+b(If)23 b(an)h(error)f(o)s(ccurs)h(during)e(parsing)g(of)i(the)g
+(template,)i(\014ts)p 3125 2858 V 33 w(execute)p 3452
+2858 V 34 w(template\(\))0 2971 y(will)i(\(try)j(to\))h(delete)f(the)g
+(top)g(lev)m(el)f(BLOCK)g(\(with)g(all)f(its)i(c)m(hildren)d(if)i(an)m
+(y\))h(in)f(whic)m(h)f(the)i(error)f(o)s(ccurred,)0 3084
+y(then)g(it)g(will)e(stop)i(reading)g(the)g(template)h(\014le)e(and)h
+(it)g(will)e(return)h(with)g(an)h(error.)0 3417 y Ff(11.6)136
+b(Examples)0 3667 y Fj(1.)54 b(This)33 b(template)i(\014le)f(will)e
+(create)k(a)f(200)h(x)e(300)i(pixel)d(image,)k(with)c(4-b)m(yte)j(in)m
+(teger)f(pixel)e(v)-5 b(alues,)35 b(in)f(the)0 3780 y(primary)28
+b(HDU:)95 4032 y Fe(SIMPLE)47 b(=)g(T)95 4145 y(BITPIX)g(=)g(32)95
+4258 y(NAXIS)g(=)g(2)239 b(/)47 b(number)f(of)h(dimensions)95
+4371 y(NAXIS1)g(=)g(100)95 b(/)47 b(length)f(of)h(first)g(axis)95
+4484 y(NAXIS2)g(=)g(200)95 b(/)47 b(length)f(of)h(second)f(axis)95
+4597 y(OBJECT)h(=)g(NGC)g(253)g(/)g(name)g(of)g(observed)f(object)0
+4850 y Fj(The)35 b(allo)m(w)m(ed)g(v)-5 b(alues)35 b(of)g(BITPIX)g(are)
+h(8,)h(16,)h(32,)g(-32,)g(or)d(-64,)j(represen)m(ting,)e(resp)s(ectiv)m
+(ely)-8 b(,)37 b(8-bit)e(in)m(teger,)0 4962 y(16-bit)c(in)m(teger,)g
+(32-bit)f(in)m(teger,)h(32-bit)g(\015oating)f(p)s(oin)m(t,)g(or)g(64)h
+(bit)f(\015oating)g(p)s(oin)m(t)f(pixels.)0 5123 y(2.)39
+b(T)-8 b(o)23 b(create)h(a)f(FITS)e(table,)k(the)d(template)h(\014rst)f
+(needs)g(to)i(include)c(XTENSION)i(=)g(T)-8 b(ABLE)23
+b(or)f(BINT)-8 b(ABLE)0 5235 y(to)31 b(de\014ne)e(whether)g(it)g(is)g
+(an)g(ASCI)s(I)g(or)g(binary)f(table,)i(and)g(NAXIS2)g(to)g(de\014ne)f
+(the)h(n)m(um)m(b)s(er)f(of)h(ro)m(ws)f(in)g(the)0 5348
+y(table.)49 b(Tw)m(o)34 b(template)f(lines)f(are)i(then)f(needed)f(to)i
+(de\014ne)f(the)g(name)h(\(TTYPEn\))e(and)h(FITS)g(data)h(format)0
+5461 y(\(TF)m(ORMn\))d(of)f(the)h(columns,)e(as)i(in)e(this)g(example:)
+95 5714 y Fe(xtension)46 b(=)h(bintable)p eop
+%%Page: 135 143
+135 142 bop 0 299 a Fh(11.6.)73 b(EXAMPLES)2993 b Fj(135)95
+555 y Fe(naxis2)47 b(=)g(40)95 668 y(ttype#)g(=)g(Name)95
+781 y(tform#)g(=)g(10a)95 894 y(ttype#)g(=)g(Npoints)95
+1007 y(tform#)g(=)g(j)95 1120 y(ttype#)g(=)g(Rate)95
+1233 y(tunit#)g(=)g(counts/s)95 1346 y(tform#)g(=)g(e)0
+1605 y Fj(The)26 b(ab)s(o)m(v)m(e)j(example)d(de\014nes)g(a)i(n)m(ull)d
+(primary)g(arra)m(y)i(follo)m(w)m(ed)g(b)m(y)g(a)g(40-ro)m(w)h(binary)d
+(table)i(extension)g(with)f(3)0 1718 y(columns)h(called)g('Name',)j
+('Np)s(oin)m(ts',)e(and)g('Rate',)i(with)d(data)i(formats)f(of)g('10A')
+i(\(ASCI)s(I)d(c)m(haracter)i(string\),)0 1831 y('1J')k(\(in)m(teger\))
+h(and)e('1E')i(\(\015oating)e(p)s(oin)m(t\),)h(resp)s(ectiv)m(ely)-8
+b(.)48 b(Note)34 b(that)f(the)g(other)g(required)e(FITS)h(k)m(eyw)m
+(ords)0 1944 y(\(BITPIX,)37 b(NAXIS,)g(NAXIS1,)h(PCOUNT,)e(GCOUNT,)h
+(TFIELDS,)f(and)g(END\))h(do)g(not)g(need)f(to)h(b)s(e)f(ex-)0
+2057 y(plicitly)f(de\014ned)h(in)h(the)g(template)h(b)s(ecause)g(their)
+f(v)-5 b(alues)37 b(can)h(b)s(e)f(inferred)e(from)j(the)f(other)h(k)m
+(eyw)m(ords)g(in)0 2170 y(the)d(template.)54 b(This)33
+b(example)i(also)g(illustrates)d(that)k(the)f(templates)g(are)g
+(generally)f(case-insensitiv)m(e)g(\(the)0 2283 y(k)m(eyw)m(ord)29
+b(names)g(and)g(TF)m(ORMn)f(v)-5 b(alues)29 b(are)g(con)m(v)m(erted)i
+(to)e(upp)s(er-case)g(in)e(the)i(FITS)g(\014le\))f(and)g(that)i(string)
+0 2396 y(k)m(eyw)m(ord)h(v)-5 b(alues)30 b(generally)f(do)h(not)h(need)
+f(to)h(b)s(e)f(enclosed)g(in)f(quotes.)p eop
+%%Page: 136 144
+136 143 bop 0 299 a Fj(136)2250 b Fh(CHAPTER)29 b(11.)72
+b(TEMPLA)-8 b(TE)30 b(FILES)p eop
+%%Page: 137 145
+137 144 bop 0 1225 a Fg(Chapter)65 b(12)0 1687 y Fm(Lo)6
+b(cal)78 b(FITS)e(Con)-6 b(v)g(en)g(tions)0 2180 y Fj(CFITSIO)25
+b(supp)s(orts)g(sev)m(eral)i(lo)s(cal)e(FITS)h(con)m(v)m(en)m(tions)i
+(whic)m(h)d(are)i(not)g(de\014ned)e(in)g(the)i(o\016cial)f(NOST)g(FITS)
+0 2293 y(standard)k(and)g(whic)m(h)g(are)h(not)g(necessarily)e
+(recognized)i(or)g(supp)s(orted)e(b)m(y)i(other)g(FITS)f(soft)m(w)m
+(are)i(pac)m(k)-5 b(ages.)0 2406 y(Programmers)36 b(should)e(b)s(e)h
+(cautious)h(ab)s(out)f(using)g(these)h(features,)i(esp)s(ecially)c(if)h
+(the)h(FITS)f(\014les)g(that)i(are)0 2518 y(pro)s(duced)31
+b(are)i(exp)s(ected)g(to)g(b)s(e)f(pro)s(cessed)g(b)m(y)h(other)f(soft)
+m(w)m(are)i(systems)f(whic)m(h)e(do)i(not)f(use)h(the)f(CFITSIO)0
+2631 y(in)m(terface.)0 3275 y Ff(12.1)136 b(64-Bit)45
+b(Long)g(In)l(tegers)0 3587 y Fj(CFITSIO)38 b(can)i(read)f(and)g(write)
+g(FITS)f(images)i(or)g(table)f(columns)f(con)m(taining)h(64-bit)h(in)m
+(teger)g(data)g(v)-5 b(al-)0 3700 y(ues.)63 b(This)37
+b(data)h(t)m(yp)s(e)g(is)f(not)i(recognized)f(in)f(the)h(o\016cial)f
+(FITS)h(Standard)e(de\014nition)g(do)s(cumen)m(t,)k(but)d(it)0
+3813 y(is)31 b(lik)m(ely)f(that)i(FITS)f(will)e(ev)m(en)m(tually)i
+(supp)s(ort)f(this)h(data)h(t)m(yp)s(e,)g(esp)s(ecially)e(as)i
+(computers)f(that)i(run)d(64-bit)0 3926 y(op)s(erating)25
+b(systems)h(b)s(ecome)f(more)h(common.)40 b(Supp)s(ort)23
+b(for)i(reading)g(and)g(writing)e(64-bit)j(in)m(tegers)g(in)e(CFIT-)0
+4039 y(SIO)32 b(can)i(b)s(e)f(con)m(trolled)g(with)f(the)i(#de\014ne)e
+(statemen)m(t)k(at)e(the)g(b)s(eginning)d(of)i(the)h(\014tsio2.h)f
+(\014le)f(b)m(y)i(setting)0 4152 y(SUPPOR)-8 b(T)p 444
+4152 28 4 v 32 w(64BIT)p 729 4152 V 33 w(INTEGERS)30
+b(to)h(1)g(\(enable\))f(or)h(0)f(\(disable\).)0 4312
+y(Under)k(the)h(con)m(v)m(en)m(tion)h(used)e(b)m(y)h(CFITSIO,)e(FITS)h
+(64-bit)h(images)g(ha)m(v)m(e)h(BITPIX)f(=)f(64,)j(and)e(the)g(64-bit)0
+4425 y(binary)e(table)i(columns)e(ha)m(v)m(e)j(TF)m(ORMn)f(=)f('K'.)i
+(The)e(use)g(of)h(these)h(data)f(t)m(yp)s(es)g(on)g(platforms)e(where)i
+(the)0 4538 y(size)26 b(of)h(a)g('long')f(\(or)h('longlong'\))g(in)m
+(teger)g(=)f(8)h(b)m(ytes)g(is)e(rather)i(in)m(tuitiv)m(e.)38
+b(CFITSIO)25 b(will)e(write)j(64-bit)h('long')0 4650
+y(v)-5 b(ariable)29 b(v)-5 b(alues)30 b(to)g(the)h(FITS)e(\014le)h(and)
+f(read)h(them)g(bac)m(k)h(in)m(to)g('long')f(v)-5 b(ariables)29
+b(just)g(as)i(one)f(w)m(ould)f(exp)s(ect.)0 4763 y(CFITSIO)j(also)h
+(supp)s(orts)f(implicit)e(data)k(t)m(yp)s(e)g(con)m(v)m(ersion)f(b)s
+(et)m(w)m(een)i(64-bit)e(in)m(teger)h(images)f(and)g(columns)0
+4876 y(and)24 b(an)m(y)h(other)f(supp)s(orted)f(data)i(t)m(yp)s(e,)h
+(although)e(some)h(loss)f(of)g(n)m(umerical)f(precision)g(or)i(n)m
+(umerical)e(o)m(v)m(er\015o)m(w)0 4989 y(is)29 b(lik)m(ely)g(in)g(this)
+h(case.)0 5149 y(The)h(situation)f(is)h(more)g(di\016cult)e(on)j
+(32-bit)f(computing)g(platforms)f(that)i(do)f(not)h(supp)s(ort)e(an)h
+(in)m(trinsic)e(64-)0 5262 y(bit)37 b(in)m(teger)i(data)g(t)m(yp)s(e.)
+65 b(In)38 b(this)f(case)i(it)f(is)f(not)i(p)s(ossible)d(to)j(return)e
+(the)i(full)d(64)j(precision)e(of)h(the)h(FITS)0 5375
+y(data)29 b(v)-5 b(alues)27 b(when)g(reading)g(the)i(v)-5
+b(alues)27 b(in)m(to)h(a)g(program)g(v)-5 b(ariable.)39
+b(CFITSIO)26 b(will)g(still)g(con)m(v)m(ert)j(the)g(64-bit)0
+5488 y(in)m(teger)d(v)-5 b(alues)25 b(in)m(to)g(an)m(y)h(other)g(supp)s
+(orted)e(data)i(t)m(yp)s(e;)i(the)d(64-bit)h(double)e(data)j(t)m(yp)s
+(e)e(is)g(probably)f(the)i(most)0 5601 y(useful)33 b(in)g(this)h(case.)
+55 b(It)35 b(only)f(pro)m(vides)f(ab)s(out)i(52-bits)g(of)g(precision)e
+(in)g(the)i(man)m(tissa,)h(ho)m(w)m(ev)m(er,)i(so)d(some)0
+5714 y(lose)30 b(of)h(precision)d(is)i(p)s(ossible.)1882
+5942 y(137)p eop
+%%Page: 138 146
+138 145 bop 0 299 a Fj(138)1741 b Fh(CHAPTER)30 b(12.)112
+b(LOCAL)29 b(FITS)h(CONVENTIONS)0 555 y Ff(12.2)136 b(Long)44
+b(String)i(Keyw)l(ord)f(V)-11 b(alues.)0 805 y Fj(The)43
+b(length)h(of)g(a)g(standard)g(FITS)f(string)g(k)m(eyw)m(ord)h(is)f
+(limited)f(to)j(68)f(c)m(haracters)i(b)s(ecause)e(it)f(m)m(ust)h(\014t)
+0 918 y(en)m(tirely)33 b(within)e(a)j(single)f(FITS)g(header)g(k)m(eyw)
+m(ord)i(record.)50 b(In)33 b(some)i(instances)e(it)g(is)g(necessary)h
+(to)h(enco)s(de)0 1031 y(strings)28 b(longer)i(than)f(this)f(limit,)g
+(so)i(CFITSIO)e(supp)s(orts)g(a)h(lo)s(cal)g(con)m(v)m(en)m(tion)i(in)d
+(whic)m(h)h(the)g(string)g(v)-5 b(alue)29 b(is)0 1144
+y(con)m(tin)m(ued)35 b(o)m(v)m(er)h(m)m(ultiple)c(k)m(eyw)m(ords.)55
+b(This)33 b(con)m(tin)m(uation)h(con)m(v)m(en)m(tion)i(uses)f(an)f(amp)
+s(ersand)g(c)m(haracter)i(at)0 1257 y(the)26 b(end)f(of)h(eac)m(h)g
+(substring)e(to)i(indicate)f(that)h(it)g(is)e(con)m(tin)m(ued)i(on)f
+(the)h(next)g(k)m(eyw)m(ord,)h(and)e(the)h(con)m(tin)m(uation)0
+1370 y(k)m(eyw)m(ords)40 b(all)f(ha)m(v)m(e)i(the)f(name)g(CONTINUE)f
+(without)g(an)h(equal)f(sign)g(in)g(column)g(9.)69 b(The)40
+b(string)e(v)-5 b(alue)0 1483 y(ma)m(y)33 b(b)s(e)f(con)m(tin)m(ued)g
+(in)g(this)f(w)m(a)m(y)i(o)m(v)m(er)h(as)f(man)m(y)g(additional)d
+(CONTINUE)i(k)m(eyw)m(ords)h(as)f(is)g(required.)45 b(The)0
+1596 y(follo)m(wing)34 b(lines)f(illustrate)g(this)h(con)m(tin)m
+(uation)h(con)m(v)m(en)m(tion)i(whic)m(h)c(is)i(used)f(in)g(the)h(v)-5
+b(alue)35 b(of)g(the)g(STRKEY)0 1709 y(k)m(eyw)m(ord:)0
+1939 y Fe(LONGSTRN=)45 b('OGIP)i(1.0')189 b(/)48 b(The)f(OGIP)f(Long)h
+(String)f(Convention)f(may)i(be)g(used.)0 2051 y(STRKEY)94
+b(=)47 b('This)g(is)g(a)g(very)g(long)g(string)f(keyword&')93
+b(/)47 b(Optional)f(Comment)0 2164 y(CONTINUE)93 b(')48
+b(value)e(that)h(is)g(continued)e(over)i(3)g(keywords)f(in)h(the)g(&)95
+b(')0 2277 y(CONTINUE)e('FITS)47 b(header.')e(/)j(This)e(is)h(another)f
+(optional)g(comment.)0 2507 y Fj(It)29 b(is)f(recommended)g(that)h(the)
+g(LONGSTRN)f(k)m(eyw)m(ord,)i(as)f(sho)m(wn)f(here,)h(alw)m(a)m(ys)h(b)
+s(e)e(included)e(in)h(an)m(y)i(HDU)0 2620 y(that)i(uses)f(this)f
+(longstring)g(con)m(v)m(en)m(tion)j(as)f(a)f(w)m(arning)g(to)h(an)m(y)g
+(soft)m(w)m(are)g(that)g(m)m(ust)g(read)f(the)h(k)m(eyw)m(ords.)41
+b(A)0 2733 y(routine)c(called)f(\014ts)p 712 2733 28
+4 v 33 w(write)p 948 2733 V 32 w(k)m(ey)p 1113 2733 V
+33 w(longw)m(arn)h(has)g(b)s(een)g(pro)m(vided)f(in)h(CFITSIO)e(to)k
+(write)d(this)h(k)m(eyw)m(ord)h(if)e(it)0 2846 y(do)s(es)30
+b(not)h(already)f(exist.)0 3006 y(This)f(long)h(string)f(con)m(v)m(en)m
+(tion)i(is)f(supp)s(orted)e(b)m(y)j(the)f(follo)m(wing)f(CFITSIO)g
+(routines:)191 3236 y Fe(fits_write_key_longstr)89 b(-)48
+b(write)e(a)i(long)e(string)g(keyword)g(value)191 3349
+y(fits_insert_key_longstr)41 b(-)48 b(insert)e(a)h(long)g(string)f
+(keyword)g(value)191 3462 y(fits_modify_key_longstr)41
+b(-)48 b(modify)e(a)h(long)g(string)f(keyword)g(value)191
+3575 y(fits_update_key_longstr)41 b(-)48 b(modify)e(a)h(long)g(string)f
+(keyword)g(value)191 3688 y(fits_read_key_longstr)137
+b(-)48 b(read)94 b(a)48 b(long)e(string)g(keyword)g(value)191
+3801 y(fits_delete_key)425 b(-)48 b(delete)e(a)h(keyword)0
+4030 y Fj(The)36 b(\014ts)p 320 4030 V 32 w(read)p 524
+4030 V 33 w(k)m(ey)p 690 4030 V 34 w(longstr)f(routine)h(is)f(unique)f
+(among)j(all)f(the)g(CFITSIO)f(routines)g(in)g(that)i(it)f(in)m
+(ternally)0 4143 y(allo)s(cates)e(memory)f(for)h(the)f(long)g(string)g
+(v)-5 b(alue;)35 b(all)d(the)i(other)g(CFITSIO)e(routines)g(that)i
+(deal)f(with)g(arra)m(ys)0 4256 y(require)38 b(that)i(the)g(calling)e
+(program)h(pre-allo)s(cate)h(adequate)g(space)g(to)g(hold)e(the)i(arra)
+m(y)g(of)f(data.)69 b(Conse-)0 4369 y(quen)m(tly)-8 b(,)30
+b(programs)g(whic)m(h)f(use)h(the)g(\014ts)p 1443 4369
+V 32 w(read)p 1647 4369 V 33 w(k)m(ey)p 1813 4369 V 34
+w(longstr)f(routine)g(m)m(ust)h(b)s(e)g(careful)f(to)i(free)g(the)f
+(allo)s(cated)0 4482 y(memory)g(for)g(the)h(string)e(when)h(it)g(is)f
+(no)h(longer)g(needed.)0 4642 y(The)g(follo)m(wing)f(2)h(routines)g
+(also)g(ha)m(v)m(e)i(limited)c(supp)s(ort)g(for)i(this)g(long)g(string)
+f(con)m(v)m(en)m(tion,)286 4872 y Fe(fits_modify_key_str)43
+b(-)k(modify)f(an)i(existing)d(string)h(keyword)g(value)286
+4985 y(fits_update_key_str)d(-)k(update)f(a)i(string)e(keyword)g(value)
+0 5215 y Fj(in)23 b(that)i(they)f(will)e(correctly)i(o)m(v)m(erwrite)h
+(an)f(existing)f(long)h(string)f(v)-5 b(alue,)26 b(but)d(the)h(new)g
+(string)f(v)-5 b(alue)24 b(is)f(limited)0 5328 y(to)31
+b(a)g(maxim)m(um)e(of)i(68)g(c)m(haracters)h(in)d(length.)0
+5488 y(The)g(more)h(commonly)g(used)f(CFITSIO)f(routines)h(to)h(write)f
+(string)g(v)-5 b(alued)29 b(k)m(eyw)m(ords)h(\(\014ts)p
+3254 5488 V 33 w(up)s(date)p 3563 5488 V 32 w(k)m(ey)h(and)0
+5601 y(\014ts)p 127 5601 V 32 w(write)p 362 5601 V 32
+w(k)m(ey\))j(do)e(not)h(supp)s(ort)d(this)h(long)h(string)g(con)m(v)m
+(en)m(tion)h(and)f(only)f(supp)s(ort)g(strings)g(up)g(to)i(68)g(c)m
+(har-)0 5714 y(acters)g(in)e(length.)47 b(This)30 b(has)i(b)s(een)g
+(done)g(delib)s(erately)e(to)j(prev)m(en)m(t)g(programs)f(from)g(inadv)
+m(erten)m(tly)g(writing)p eop
+%%Page: 139 147
+139 146 bop 0 299 a Fh(12.3.)73 b(ARRA)-8 b(YS)30 b(OF)h(FIXED-LENGTH)g
+(STRINGS)e(IN)h(BINAR)-8 b(Y)32 b(T)-8 b(ABLES)871 b
+Fj(139)0 555 y(k)m(eyw)m(ords)25 b(using)e(this)h(non-standard)f(con)m
+(v)m(en)m(tion)j(without)e(the)h(explicit)e(in)m(ten)m(t)i(of)g(the)f
+(programmer)h(or)f(user.)0 668 y(The)36 b(\014ts)p 320
+668 28 4 v 32 w(write)p 555 668 V 32 w(k)m(ey)p 720 668
+V 34 w(longstr)g(routine)f(m)m(ust)i(b)s(e)f(called)g(instead)f(to)j
+(write)d(long)h(strings.)58 b(This)35 b(routine)h(can)0
+781 y(also)30 b(b)s(e)g(used)g(to)h(write)e(ordinary)g(string)g(v)-5
+b(alues)30 b(less)g(than)g(68)h(c)m(haracters)h(in)d(length.)0
+1128 y Ff(12.3)136 b(Arra)l(ys)45 b(of)g(Fixed-Length)g(Strings)g(in)g
+(Binary)f(T)-11 b(ables)0 1381 y Fj(The)29 b(de\014nition)e(of)j(the)f
+(FITS)g(binary)e(table)j(extension)f(format)g(do)s(es)h(not)f(pro)m
+(vide)g(a)g(simple)f(w)m(a)m(y)i(to)g(sp)s(ecify)0 1494
+y(that)24 b(a)f(c)m(haracter)i(column)d(con)m(tains)h(an)g(arra)m(y)h
+(of)f(\014xed-length)f(strings.)37 b(T)-8 b(o)24 b(supp)s(ort)d(this)h
+(feature,)j(CFITSIO)0 1607 y(uses)31 b(a)h(lo)s(cal)f(con)m(v)m(en)m
+(tion)h(for)f(the)h(format)g(of)g(the)f(TF)m(ORMn)g(k)m(eyw)m(ord)h(v)
+-5 b(alue)31 b(of)h(the)g(form)f('rAw')g(where)g('r')0
+1720 y(is)c(an)g(in)m(teger)h(sp)s(ecifying)d(the)j(total)g(width)e(in)
+g(c)m(haracters)j(of)f(the)g(column,)f(and)g('w')g(is)g(an)g(in)m
+(teger)h(sp)s(ecifying)0 1833 y(the)c(\(\014xed\))g(length)g(of)g(an)g
+(individual)19 b(unit)k(string)g(within)e(the)j(v)m(ector.)41
+b(F)-8 b(or)24 b(example,)i(TF)m(ORM1)e(=)g('120A10')0
+1946 y(w)m(ould)k(indicate)g(that)h(the)h(binary)d(table)i(column)f(is)
+g(120)i(c)m(haracters)g(wide)e(and)h(consists)f(of)h(12)h(10-c)m
+(haracter)0 2059 y(length)c(strings.)38 b(This)24 b(con)m(v)m(en)m
+(tion)k(is)d(recognized)i(b)m(y)f(the)g(CFITSIO)f(routines)g(that)i
+(read)f(or)h(write)e(strings)g(in)0 2171 y(binary)30
+b(tables.)44 b(The)31 b(Binary)g(T)-8 b(able)31 b(de\014nition)e(do)s
+(cumen)m(t)i(sp)s(eci\014es)g(that)h(other)g(optional)e(c)m(haracters)j
+(ma)m(y)0 2284 y(follo)m(w)f(the)h(data)g(t)m(yp)s(e)g(co)s(de)g(in)e
+(the)i(TF)m(ORM)g(k)m(eyw)m(ord,)h(so)f(this)e(lo)s(cal)h(con)m(v)m(en)
+m(tion)i(is)e(in)f(compliance)h(with)0 2397 y(the)f(FITS)e(standard)h
+(although)g(other)g(FITS)g(readers)g(ma)m(y)h(not)g(recognize)g(this)e
+(con)m(v)m(en)m(tion.)0 2557 y(The)c(Binary)g(T)-8 b(able)26
+b(de\014nition)d(do)s(cumen)m(t)j(that)h(w)m(as)f(appro)m(v)m(ed)g(b)m
+(y)g(the)g(IA)m(U)g(in)f(1994)j(con)m(tains)e(an)f(app)s(endix)0
+2670 y(describing)20 b(an)j(alternate)g(con)m(v)m(en)m(tion)h(for)f(sp)
+s(ecifying)d(arra)m(ys)j(of)g(\014xed)f(or)h(v)-5 b(ariable)22
+b(length)g(strings)f(in)h(a)h(binary)0 2783 y(table)34
+b(c)m(haracter)h(column)e(\(with)g(the)i(form)e('rA:SSTRw/nnn\)'.)50
+b(This)32 b(app)s(endix)f(w)m(as)k(not)f(o\016cially)f(v)m(oted)0
+2896 y(on)d(b)m(y)h(the)f(IA)m(U)h(and)f(hence)g(is)g(still)e(pro)m
+(visional.)39 b(CFITSIO)29 b(do)s(es)h(not)g(curren)m(tly)g(supp)s(ort)
+e(this)i(prop)s(osal.)0 3243 y Ff(12.4)136 b(Keyw)l(ord)45
+b(Units)h(Strings)0 3496 y Fj(One)37 b(limitation)f(of)h(the)h(curren)m
+(t)g(FITS)e(Standard)h(is)g(that)h(it)f(do)s(es)g(not)h(de\014ne)f(a)h
+(sp)s(eci\014c)e(con)m(v)m(en)m(tion)j(for)0 3609 y(recording)29
+b(the)h(ph)m(ysical)f(units)g(of)h(a)g(k)m(eyw)m(ord)h(v)-5
+b(alue.)40 b(The)30 b(TUNITn)f(k)m(eyw)m(ord)h(can)g(b)s(e)g(used)f(to)
+i(sp)s(ecify)e(the)0 3722 y(ph)m(ysical)34 b(units)g(of)h(the)h(v)-5
+b(alues)35 b(in)f(a)h(table)h(column,)f(but)g(there)g(is)g(no)g
+(analogous)h(con)m(v)m(en)m(tion)g(for)f(k)m(eyw)m(ord)0
+3835 y(v)-5 b(alues.)41 b(The)30 b(commen)m(t)h(\014eld)f(of)g(the)h(k)
+m(eyw)m(ord)g(is)f(often)h(used)f(for)g(this)f(purp)s(ose,)h(but)f(the)
+i(units)e(are)i(usually)0 3948 y(not)g(sp)s(eci\014ed)d(in)h(a)i(w)m
+(ell)e(de\014ned)h(format)g(that)h(FITS)f(readers)g(can)h(easily)e
+(recognize)i(and)f(extract.)0 4108 y(T)-8 b(o)27 b(solv)m(e)h(this)d
+(problem,)i(CFITSIO)e(uses)i(a)g(lo)s(cal)f(con)m(v)m(en)m(tion)i(in)e
+(whic)m(h)f(the)j(k)m(eyw)m(ord)f(units)e(are)j(enclosed)e(in)0
+4221 y(square)20 b(brac)m(k)m(ets)j(as)e(the)f(\014rst)g(tok)m(en)i(in)
+e(the)g(k)m(eyw)m(ord)i(commen)m(t)f(\014eld;)i(more)e(sp)s
+(eci\014cally)-8 b(,)21 b(the)g(op)s(ening)e(square)0
+4334 y(brac)m(k)m(et)28 b(immediately)d(follo)m(ws)g(the)i(slash)e('/')
+i(commen)m(t)h(\014eld)d(delimiter)f(and)i(a)g(single)f(space)i(c)m
+(haracter.)41 b(The)0 4447 y(follo)m(wing)29 b(examples)h(illustrate)e
+(k)m(eyw)m(ords)j(that)g(use)f(this)f(con)m(v)m(en)m(tion:)0
+4718 y Fe(EXPOSURE=)713 b(1800.0)47 b(/)g([s])g(elapsed)f(exposure)f
+(time)0 4831 y(V_HELIO)h(=)763 b(16.23)47 b(/)g([km)g(s**\(-1\)])e
+(heliocentric)g(velocity)0 4944 y(LAMBDA)94 b(=)763 b(5400.)47
+b(/)g([angstrom])e(central)h(wavelength)0 5057 y(FLUX)190
+b(=)47 b(4.9033487787637465E-30)42 b(/)47 b([J/cm**2/s])e(average)h
+(flux)0 5328 y Fj(In)28 b(general,)g(the)h(units)d(named)i(in)f(the)i
+(IA)m(U\(1988\))i(St)m(yle)d(Guide)f(are)i(recommended,)f(with)f(the)i
+(main)e(excep-)0 5441 y(tion)j(that)h(the)f(preferred)g(unit)e(for)j
+(angle)f(is)f('deg')j(for)e(degrees.)0 5601 y(The)38
+b(\014ts)p 322 5601 V 33 w(read)p 527 5601 V 33 w(k)m(ey)p
+693 5601 V 33 w(unit)g(and)g(\014ts)p 1234 5601 V 32
+w(write)p 1469 5601 V 32 w(k)m(ey)p 1634 5601 V 34 w(unit)f(routines)h
+(in)g(CFITSIO)f(read)i(and)f(write,)j(resp)s(ectiv)m(ely)-8
+b(,)0 5714 y(the)31 b(k)m(eyw)m(ord)f(unit)f(strings)h(in)f(an)h
+(existing)f(k)m(eyw)m(ord.)p eop
+%%Page: 140 148
+140 147 bop 0 299 a Fj(140)1741 b Fh(CHAPTER)30 b(12.)112
+b(LOCAL)29 b(FITS)h(CONVENTIONS)0 555 y Ff(12.5)136 b(HIERAR)l(CH)46
+b(Con)l(v)l(en)l(tion)g(for)f(Extended)h(Keyw)l(ord)f(Names)0
+805 y Fj(CFITSIO)c(supp)s(orts)g(the)i(HIERAR)m(CH)g(k)m(eyw)m(ord)g
+(con)m(v)m(en)m(tion)h(whic)m(h)e(allo)m(ws)g(k)m(eyw)m(ord)h(names)g
+(that)h(are)0 918 y(longer)33 b(then)f(8)i(c)m(haracters)g(and)f(ma)m
+(y)h(con)m(tain)f(the)g(full)e(range)i(of)h(prin)m(table)d(ASCI)s(I)g
+(text)j(c)m(haracters.)51 b(This)0 1031 y(con)m(v)m(en)m(tion)38
+b(w)m(as)g(dev)m(elop)s(ed)e(at)i(the)f(Europ)s(ean)f(Southern)g
+(Observ)-5 b(atory)37 b(\(ESO\))f(to)i(supp)s(ort)d(hierarc)m(hical)0
+1144 y(FITS)30 b(k)m(eyw)m(ord)g(suc)m(h)h(as:)0 1395
+y Fe(HIERARCH)46 b(ESO)g(INS)h(FOCU)g(POS)g(=)g(-0.00002500)e(/)j
+(Focus)e(position)0 1646 y Fj(Basically)-8 b(,)52 b(this)46
+b(con)m(v)m(en)m(tion)j(uses)e(the)h(FITS)f(k)m(eyw)m(ord)h('HIERAR)m
+(CH')h(to)f(indicate)f(that)h(this)e(con)m(v)m(en-)0
+1759 y(tion)e(is)f(b)s(eing)g(used,)k(then)d(the)g(actual)h(k)m(eyw)m
+(ord)f(name)h(\()p Fe('ESO)i(INS)f(FOCU)h(POS')c Fj(in)g(this)g
+(example\))h(b)s(e-)0 1872 y(gins)39 b(in)f(column)g(10)j(and)e(can)h
+(con)m(tain)f(an)m(y)h(prin)m(table)e(ASCI)s(I)g(text)j(c)m(haracters,)
+i(including)37 b(spaces.)68 b(The)0 1985 y(equals)43
+b(sign)h(marks)f(the)h(end)g(of)g(the)g(k)m(eyw)m(ord)h(name)f(and)f
+(is)h(follo)m(w)m(ed)f(b)m(y)h(the)g(usual)f(v)-5 b(alue)44
+b(and)f(com-)0 2098 y(men)m(t)31 b(\014elds)e(just)h(as)h(in)e
+(standard)h(FITS)g(k)m(eyw)m(ords.)41 b(F)-8 b(urther)30
+b(details)g(of)h(this)e(con)m(v)m(en)m(tion)j(are)f(describ)s(ed)d(at)0
+2211 y(h)m(ttp://arcdev.hq.eso.org/dicb/dicd/dic-1-1.4.h)m(tml)33
+b(\(searc)m(h)f(for)e(HIERAR)m(CH\).)0 2371 y(This)42
+b(con)m(v)m(en)m(tion)k(allo)m(ws)e(a)g(m)m(uc)m(h)h(broader)e(range)i
+(of)f(k)m(eyw)m(ord)h(names)f(than)h(is)e(allo)m(w)m(ed)h(b)m(y)g(the)h
+(FITS)0 2484 y(Standard.)40 b(Here)30 b(are)h(more)g(examples)f(of)g
+(suc)m(h)g(k)m(eyw)m(ords:)0 2735 y Fe(HIERARCH)46 b(LongKeyword)e(=)k
+(47.5)e(/)i(Keyword)e(has)h(>)g(8)g(characters,)e(and)i(mixed)f(case)0
+2848 y(HIERARCH)g(XTE$TEMP)f(=)j(98.6)e(/)i(Keyword)d(contains)h(the)h
+('$')g(character)0 2961 y(HIERARCH)f(Earth)g(is)h(a)h(star)e(=)i(F)f(/)
+h(Keyword)d(contains)h(embedded)f(spaces)0 3212 y Fj(CFITSIO)40
+b(will)f(transparen)m(tly)i(read)h(and)f(write)f(these)j(k)m(eyw)m
+(ords,)i(so)d(application)e(programs)h(do)g(not)h(in)0
+3325 y(general)32 b(need)g(to)h(kno)m(w)f(an)m(ything)g(ab)s(out)g(the)
+g(sp)s(eci\014c)f(implemen)m(tation)g(details)g(of)i(the)f(HIERAR)m(CH)
+g(con-)0 3438 y(v)m(en)m(tion.)49 b(In)32 b(particular,)h(application)e
+(programs)h(do)h(not)h(need)e(to)i(sp)s(ecify)e(the)h(`HIERAR)m(CH')h
+(part)f(of)g(the)0 3551 y(k)m(eyw)m(ord)g(name)f(when)g(reading)f(or)h
+(writing)f(k)m(eyw)m(ords)h(\(although)g(it)g(ma)m(y)h(b)s(e)f
+(included)d(if)j(desired\).)45 b(When)0 3664 y(writing)33
+b(a)i(k)m(eyw)m(ord,)h(CFITSIO)d(\014rst)h(c)m(hec)m(ks)i(to)f(see)g
+(if)f(the)h(k)m(eyw)m(ord)g(name)f(is)g(legal)g(as)h(a)g(standard)f
+(FITS)0 3776 y(k)m(eyw)m(ord)k(\(no)g(more)f(than)h(8)g(c)m(haracters)h
+(long)e(and)g(con)m(taining)g(only)f(letters,)k(digits,)e(or)g(a)g(min)
+m(us)d(sign)i(or)0 3889 y(underscore\).)68 b(If)39 b(so)h(it)f(writes)g
+(it)g(as)g(a)h(standard)f(FITS)g(k)m(eyw)m(ord,)k(otherwise)c(it)g
+(uses)g(the)h(hierarc)m(h)e(con-)0 4002 y(v)m(en)m(tion)33
+b(to)g(write)f(the)g(k)m(eyw)m(ord.)48 b(The)32 b(maxim)m(um)f(k)m(eyw)
+m(ord)i(name)f(length)g(is)g(67)h(c)m(haracters,)i(whic)m(h)c(lea)m(v)m
+(es)0 4115 y(only)c(1)i(space)g(for)f(the)h(v)-5 b(alue)28
+b(\014eld.)38 b(A)29 b(more)f(practical)g(limit)e(is)i(ab)s(out)g(40)h
+(c)m(haracters,)i(whic)m(h)c(lea)m(v)m(es)i(enough)0
+4228 y(ro)s(om)f(for)h(most)f(k)m(eyw)m(ord)h(v)-5 b(alues.)40
+b(CFITSIO)27 b(returns)g(an)h(error)h(if)e(there)i(is)e(not)i(enough)f
+(ro)s(om)h(for)f(b)s(oth)g(the)0 4341 y(k)m(eyw)m(ord)k(name)f(and)f
+(the)i(k)m(eyw)m(ord)f(v)-5 b(alue)31 b(on)g(the)h(80-c)m(haracter)h
+(card,)f(except)g(for)f(string-v)-5 b(alued)30 b(k)m(eyw)m(ords)0
+4454 y(whic)m(h)i(are)h(simply)d(truncated)j(so)g(that)h(the)f(closing)
+f(quote)i(c)m(haracter)g(falls)d(in)h(column)g(80.)49
+b(In)32 b(the)h(curren)m(t)0 4567 y(implemen)m(tation,)28
+b(CFITSIO)f(preserv)m(es)i(the)g(case)h(of)f(the)g(letters)g(when)f
+(writing)f(the)i(k)m(eyw)m(ord)g(name,)g(but)f(it)0 4680
+y(is)c(case-insensitiv)m(e)g(when)g(reading)g(or)h(searc)m(hing)g(for)g
+(a)g(k)m(eyw)m(ord.)40 b(The)24 b(curren)m(t)h(implemen)m(tation)e
+(allo)m(ws)i(an)m(y)0 4793 y(ASCI)s(I)k(text)j(c)m(haracter)h(\(ASCI)s
+(I)c(32)j(to)f(ASCI)s(I)f(126\))i(in)e(the)h(k)m(eyw)m(ord)g(name)g
+(except)h(for)e(the)h('=')g(c)m(haracter.)0 4906 y(A)f(space)h(is)f
+(also)g(required)f(on)h(either)g(side)f(of)i(the)f(equal)g(sign.)0
+5238 y Ff(12.6)136 b(Tile-Compressed)46 b(Image)g(F)-11
+b(ormat)0 5488 y Fj(CFITSIO)36 b(supp)s(orts)f(a)j(con)m(v)m(en)m(tion)
+h(for)e(compressing)g(n-dimensional)d(images)j(and)g(storing)g(the)h
+(resulting)0 5601 y(b)m(yte)i(stream)g(in)e(a)i(v)-5
+b(ariable-length)38 b(column)g(in)g(a)i(FITS)f(binary)e(table.)68
+b(The)39 b(general)h(principle)c(used)i(in)0 5714 y(this)33
+b(con)m(v)m(en)m(tion)j(is)d(to)i(\014rst)f(divide)e(the)j
+(n-dimensional)c(image)k(in)m(to)f(a)h(rectangular)f(grid)f(of)i
+(subimages)e(or)p eop
+%%Page: 141 149
+141 148 bop 0 299 a Fh(12.6.)73 b(TILE-COMPRESSED)28
+b(IMA)m(GE)j(F)m(ORMA)-8 b(T)1838 b Fj(141)0 555 y(`tiles'.)55
+b(Eac)m(h)35 b(tile)g(is)f(then)h(compressed)g(as)g(a)h(con)m(tin)m
+(uous)f(blo)s(c)m(k)f(of)i(data,)h(and)e(the)g(resulting)e(compressed)0
+668 y(b)m(yte)k(stream)h(is)e(stored)h(in)e(a)i(ro)m(w)g(of)g(a)h(v)-5
+b(ariable)35 b(length)h(column)g(in)g(a)h(FITS)f(binary)f(table.)60
+b(By)37 b(dividing)0 781 y(the)j(image)f(in)m(to)g(tiles)g(it)g(is)f
+(generally)h(p)s(ossible)e(to)j(extract)h(and)d(uncompress)g
+(subsections)h(of)g(the)h(image)0 894 y(without)c(ha)m(ving)h(to)h
+(uncompress)e(the)h(whole)f(image.)61 b(The)37 b(default)f(tiling)f
+(pattern)j(treats)g(eac)m(h)g(ro)m(w)f(of)h(a)0 1007
+y(2-dimensional)33 b(image)i(\(or)g(higher)e(dimensional)f(cub)s(e\))j
+(as)g(a)g(tile,)h(suc)m(h)e(that)i(eac)m(h)g(tile)e(con)m(tains)h
+(NAXIS1)0 1120 y(pixels.)57 b(An)m(y)36 b(other)h(rectangular)f(tiling)
+f(pattern)h(ma)m(y)h(also)f(b)s(e)g(de\014ned.)58 b(In)35
+b(the)i(case)g(of)g(relativ)m(ely)e(small)0 1233 y(images)j(it)g(ma)m
+(y)h(b)s(e)f(su\016cien)m(t)f(to)i(compress)f(the)h(en)m(tire)f(image)g
+(as)h(a)f(single)f(tile,)j(resulting)c(in)h(an)h(output)0
+1346 y(binary)28 b(table)i(with)f(1)h(ro)m(w.)41 b(In)29
+b(the)h(case)h(of)f(3-dimensional)e(data)j(cub)s(es,)e(it)h(ma)m(y)g(b)
+s(e)f(adv)-5 b(an)m(tageous)32 b(to)f(treat)0 1458 y(eac)m(h)i(plane)e
+(of)h(the)g(cub)s(e)f(as)h(a)g(separate)h(tile)e(if)g(application)f
+(soft)m(w)m(are)k(t)m(ypically)c(needs)i(to)g(access)i(the)e(cub)s(e)0
+1571 y(on)e(a)h(plane)e(b)m(y)i(plane)e(basis.)0 1732
+y(See)41 b(section)f(5.6)i(\\Image)f(Compression")e(for)h(more)h
+(information)e(on)h(using)f(this)g(tile-compressed)h(image)0
+1844 y(format.)p eop
+%%Page: 142 150
+142 149 bop 0 299 a Fj(142)1741 b Fh(CHAPTER)30 b(12.)112
+b(LOCAL)29 b(FITS)h(CONVENTIONS)p eop
+%%Page: 143 151
+143 150 bop 0 1225 a Fg(Chapter)65 b(13)0 1687 y Fm(Optimizing)76
+b(Programs)0 2180 y Fj(CFITSIO)22 b(has)h(b)s(een)f(carefully)g
+(designed)g(to)i(obtain)f(the)g(highest)g(p)s(ossible)d(sp)s(eed)j
+(when)f(reading)g(and)h(writing)0 2293 y(FITS)33 b(\014les.)50
+b(In)33 b(order)h(to)g(ac)m(hiev)m(e)h(the)f(b)s(est)g(p)s(erformance,)
+g(ho)m(w)m(ev)m(er,)i(application)d(programmers)g(m)m(ust)h(b)s(e)0
+2406 y(careful)23 b(to)i(call)e(the)h(CFITSIO)f(routines)f
+(appropriately)h(and)g(in)g(an)g(e\016cien)m(t)i(sequence;)i
+(inappropriate)21 b(usage)0 2518 y(of)31 b(CFITSIO)d(routines)i(can)g
+(greatly)h(slo)m(w)f(do)m(wn)g(the)h(execution)f(sp)s(eed)g(of)g(a)h
+(program.)0 2679 y(The)f(maxim)m(um)g(p)s(ossible)e(I/O)j(sp)s(eed)f
+(of)h(CFITSIO)e(dep)s(ends)g(of)i(course)g(on)f(the)h(t)m(yp)s(e)g(of)g
+(computer)g(system)0 2791 y(that)g(it)e(is)g(running)e(on.)41
+b(As)30 b(a)g(rough)g(guide,)f(the)h(curren)m(t)g(generation)g(of)g(w)m
+(orkstations)g(can)h(ac)m(hiev)m(e)g(sp)s(eeds)0 2904
+y(of)k(2)g({)g(10)g(MB/s)h(when)e(reading)g(or)g(writing)f(FITS)h
+(images)h(and)f(similar,)f(or)i(sligh)m(tly)e(slo)m(w)m(er)i(sp)s(eeds)
+e(with)0 3017 y(FITS)c(binary)g(tables.)40 b(Reading)30
+b(of)g(FITS)g(\014les)f(can)i(o)s(ccur)f(at)h(ev)m(en)f(higher)f(rates)
+i(\(30MB/s)i(or)d(more\))h(if)e(the)0 3130 y(FITS)d(\014le)g(is)f
+(still)g(cac)m(hed)j(in)d(system)i(memory)f(follo)m(wing)g(a)h
+(previous)e(read)h(or)h(write)f(op)s(eration)g(on)h(the)g(same)0
+3243 y(\014le.)43 b(T)-8 b(o)32 b(more)g(accurately)g(predict)e(the)i
+(b)s(est)f(p)s(erformance)g(that)h(is)e(p)s(ossible)f(on)j(an)m(y)g
+(particular)d(system,)k(a)0 3356 y(diagnostic)f(program)h(called)f
+(\\sp)s(eed.c")h(is)f(included)e(with)i(the)h(CFITSIO)e(distribution)e
+(whic)m(h)j(can)h(b)s(e)f(run)0 3469 y(to)f(appro)m(ximately)f(measure)
+g(the)h(maxim)m(um)e(p)s(ossible)f(sp)s(eed)h(of)i(writing)d(and)i
+(reading)g(a)g(test)i(FITS)d(\014le.)0 3629 y(The)k(follo)m(wing)e(2)j
+(sections)f(pro)m(vide)g(some)g(bac)m(kground)g(on)h(ho)m(w)f(CFITSIO)f
+(in)m(ternally)f(manages)j(the)f(data)0 3742 y(I/O)g(and)g(describ)s
+(es)e(some)j(strategies)g(that)g(ma)m(y)g(b)s(e)e(used)h(to)h(optimize)
+e(the)i(pro)s(cessing)e(sp)s(eed)g(of)h(soft)m(w)m(are)0
+3855 y(that)e(uses)f(CFITSIO.)0 4271 y Ff(13.1)136 b(Ho)l(w)45
+b(CFITSIO)f(Manages)i(Data)g(I/O)0 4538 y Fj(Man)m(y)22
+b(CFITSIO)e(op)s(erations)h(in)m(v)m(olv)m(e)h(transferring)e(only)h(a)
+h(small)e(n)m(um)m(b)s(er)h(of)h(b)m(ytes)g(to)g(or)g(from)f(the)h
+(FITS)f(\014le)0 4650 y(\(e.g,)31 b(reading)d(a)h(k)m(eyw)m(ord,)h(or)f
+(writing)e(a)i(ro)m(w)g(in)e(a)i(table\);)h(it)f(w)m(ould)e(b)s(e)h(v)m
+(ery)i(ine\016cien)m(t)e(to)h(ph)m(ysically)e(read)0
+4763 y(or)32 b(write)g(suc)m(h)g(small)e(blo)s(c)m(ks)i(of)g(data)h
+(directly)e(in)g(the)h(FITS)g(\014le)f(on)h(disk,)g(therefore)g
+(CFITSIO)f(main)m(tains)0 4876 y(a)38 b(set)g(of)g(in)m(ternal)f
+(Input{Output)e(\(IO\))j(bu\013ers)f(in)f(RAM)i(memory)g(that)g(eac)m
+(h)h(con)m(tain)f(one)g(FITS)f(blo)s(c)m(k)0 4989 y(\(2880)27
+b(b)m(ytes\))f(of)f(data.)40 b(Whenev)m(er)25 b(CFITSIO)f(needs)g(to)i
+(access)g(data)g(in)e(the)h(FITS)f(\014le,)i(it)e(\014rst)g(transfers)h
+(the)0 5102 y(FITS)30 b(blo)s(c)m(k)g(con)m(taining)g(those)h(b)m(ytes)
+g(in)m(to)f(one)h(of)f(the)h(IO)f(bu\013ers)f(in)g(memory)-8
+b(.)42 b(The)30 b(next)g(time)g(CFITSIO)0 5215 y(needs)36
+b(to)g(access)i(b)m(ytes)e(in)f(the)h(same)h(blo)s(c)m(k)e(it)h(can)g
+(then)g(go)h(to)f(the)h(fast)f(IO)f(bu\013er)g(rather)h(than)g(using)f
+(a)0 5328 y(m)m(uc)m(h)d(slo)m(w)m(er)h(system)f(disk)f(access)i
+(routine.)45 b(The)32 b(n)m(um)m(b)s(er)f(of)h(a)m(v)-5
+b(ailable)32 b(IO)g(bu\013ers)f(is)g(determined)g(b)m(y)h(the)0
+5441 y(NIOBUF)f(parameter)g(\(in)e(\014tsio2.h\))h(and)g(is)g(curren)m
+(tly)f(set)i(to)g(40)g(b)m(y)g(default.)0 5601 y(Whenev)m(er)24
+b(CFITSIO)f(reads)g(or)h(writes)f(data)h(it)g(\014rst)f(c)m(hec)m(ks)i
+(to)g(see)f(if)f(that)h(blo)s(c)m(k)g(of)g(the)g(FITS)f(\014le)f(is)h
+(already)0 5714 y(loaded)32 b(in)m(to)g(one)g(of)g(the)g(IO)g
+(bu\013ers.)44 b(If)32 b(not,)h(and)e(if)g(there)h(is)f(an)h(empt)m(y)h
+(IO)e(bu\013er)g(a)m(v)-5 b(ailable,)32 b(then)g(it)g(will)1882
+5942 y(143)p eop
+%%Page: 144 152
+144 151 bop 0 299 a Fj(144)1876 b Fh(CHAPTER)30 b(13.)112
+b(OPTIMIZING)29 b(PR)m(OGRAMS)0 555 y Fj(load)j(that)i(blo)s(c)m(k)e
+(in)m(to)g(the)h(IO)g(bu\013er)e(\(when)h(reading)g(a)h(FITS)f
+(\014le\))g(or)h(will)d(initialize)g(a)j(new)f(blo)s(c)m(k)h(\(when)0
+668 y(writing)i(to)j(a)g(FITS)f(\014le\).)61 b(If)37
+b(all)f(the)i(IO)e(bu\013ers)h(are)g(already)g(full,)g(it)g(m)m(ust)h
+(decide)e(whic)m(h)g(one)i(to)g(reuse)0 781 y(\(generally)32
+b(the)h(one)g(that)g(has)f(b)s(een)g(accessed)i(least)e(recen)m(tly\),)
+i(and)e(\015ush)f(the)i(con)m(ten)m(ts)h(bac)m(k)g(to)f(disk)e(if)g(it)
+0 894 y(has)f(b)s(een)g(mo)s(di\014ed)e(b)s(efore)i(loading)f(the)i
+(new)f(blo)s(c)m(k.)0 1054 y(The)g(one)g(ma)5 b(jor)30
+b(exception)h(to)g(the)f(ab)s(o)m(v)m(e)h(pro)s(cess)f(o)s(ccurs)g
+(whenev)m(er)g(a)g(large)h(con)m(tiguous)f(set)h(of)f(b)m(ytes)h(are)0
+1167 y(accessed,)37 b(as)d(migh)m(t)h(o)s(ccur)f(when)f(reading)h(or)g
+(writing)e(a)j(FITS)f(image.)53 b(In)34 b(this)f(case)i(CFITSIO)e(b)m
+(ypasses)0 1280 y(the)i(in)m(ternal)f(IO)h(bu\013ers)f(and)g(simply)f
+(reads)i(or)g(writes)g(the)g(desired)f(b)m(ytes)h(directly)f(in)g(the)h
+(disk)f(\014le)g(with)0 1393 y(a)j(single)e(call)g(to)i(a)g(lo)m(w-lev)
+m(el)f(\014le)f(read)h(or)h(write)e(routine.)57 b(The)36
+b(minim)m(um)e(threshold)g(for)i(the)h(n)m(um)m(b)s(er)e(of)0
+1506 y(b)m(ytes)40 b(to)g(read)f(or)g(write)f(this)h(w)m(a)m(y)h(is)e
+(set)i(b)m(y)f(the)g(MINDIRECT)g(parameter)h(and)e(is)h(curren)m(tly)f
+(set)i(to)g(3)0 1619 y(FITS)28 b(blo)s(c)m(ks)f(=)h(8640)i(b)m(ytes.)41
+b(This)27 b(is)g(the)h(most)h(e\016cien)m(t)g(w)m(a)m(y)g(to)g(read)g
+(or)f(write)g(large)g(c)m(h)m(unks)g(of)g(data)i(and)0
+1732 y(can)37 b(ac)m(hiev)m(e)h(IO)e(transfer)g(rates)h(of)g(5)g({)g
+(10MB/s)i(or)d(greater.)61 b(Note)38 b(that)f(this)f(fast)h(direct)f
+(IO)g(pro)s(cess)g(is)0 1844 y(not)29 b(applicable)d(when)h(accessing)i
+(columns)f(of)g(data)h(in)e(a)i(FITS)f(table)g(b)s(ecause)h(the)f(b)m
+(ytes)h(are)g(generally)f(not)0 1957 y(con)m(tiguous)h(since)f(they)h
+(are)h(in)m(terlea)m(v)m(ed)f(b)m(y)g(the)g(other)g(columns)f(of)h
+(data)g(in)f(the)h(table.)40 b(This)27 b(explains)g(wh)m(y)0
+2070 y(the)k(sp)s(eed)e(for)h(accessing)h(FITS)f(tables)g(is)f
+(generally)h(slo)m(w)m(er)g(than)h(accessing)f(FITS)g(images.)0
+2230 y(Giv)m(en)h(this)g(bac)m(kground)g(information,)f(the)i(general)f
+(strategy)i(for)e(e\016cien)m(tly)g(accessing)h(FITS)f(\014les)f
+(should)0 2343 y(b)s(e)f(apparen)m(t:)41 b(when)28 b(dealing)h(with)f
+(FITS)h(images,)h(read)f(or)h(write)f(large)g(c)m(h)m(unks)h(of)g(data)
+g(at)g(a)g(time)f(so)h(that)0 2456 y(the)25 b(direct)f(IO)g(mec)m
+(hanism)f(will)f(b)s(e)i(in)m(v)m(ok)m(ed;)j(when)d(accessing)h(FITS)f
+(headers)g(or)g(FITS)g(tables,)i(on)e(the)h(other)0 2569
+y(hand,)35 b(once)g(a)g(particular)e(FITS)h(blo)s(c)m(k)h(has)f(b)s
+(een)g(loading)g(in)m(to)g(one)h(of)g(the)g(IO)f(bu\013ers,)h(try)g(to)
+g(access)h(all)0 2682 y(the)30 b(needed)g(information)e(in)h(that)h
+(blo)s(c)m(k)g(b)s(efore)g(it)f(gets)i(\015ushed)d(out)j(of)f(the)g(IO)
+f(bu\013er.)40 b(It)30 b(is)f(imp)s(ortan)m(t)g(to)0
+2795 y(a)m(v)m(oid)e(the)g(situation)e(where)h(the)h(same)g(FITS)e(blo)
+s(c)m(k)h(is)g(b)s(eing)f(read)h(then)g(\015ushed)f(from)h(a)h(IO)f
+(bu\013er)f(m)m(ultiple)0 2908 y(times.)0 3068 y(The)30
+b(follo)m(wing)f(section)h(giv)m(es)h(more)f(sp)s(eci\014c)g
+(suggestions)g(for)g(optimizing)f(the)h(use)g(of)h(CFITSIO.)0
+3481 y Ff(13.2)136 b(Optimization)46 b(Strategies)0 3747
+y Fj(1.)54 b(When)34 b(dealing)f(with)h(a)h(FITS)e(primary)g(arra)m(y)i
+(or)g(IMA)m(GE)g(extension,)h(it)e(is)f(more)i(e\016cien)m(t)g(to)g
+(read)g(or)0 3860 y(write)30 b(large)g(c)m(h)m(unks)g(of)g(the)h(image)
+f(at)i(a)e(time)g(\(at)i(least)e(3)h(FITS)f(blo)s(c)m(ks)f(=)h(8640)i
+(b)m(ytes\))f(so)g(that)g(the)f(direct)0 3973 y(IO)j(mec)m(hanism)g
+(will)d(b)s(e)j(used)g(as)g(describ)s(ed)f(in)g(the)h(previous)f
+(section.)50 b(Smaller)32 b(c)m(h)m(unks)h(of)g(data)h(are)g(read)0
+4086 y(or)d(written)f(via)h(the)g(IO)f(bu\013ers,)g(whic)m(h)g(is)g
+(somewhat)h(less)f(e\016cien)m(t)i(b)s(ecause)f(of)g(the)g(extra)h(cop)
+m(y)f(op)s(eration)0 4199 y(and)26 b(additional)e(b)s(o)s(okk)m(eeping)
+i(steps)h(that)g(are)g(required.)38 b(In)26 b(principle)d(it)j(is)g
+(more)g(e\016cien)m(t)h(to)h(read)e(or)h(write)0 4312
+y(as)i(big)f(an)h(arra)m(y)h(of)f(image)g(pixels)e(at)j(one)f(time)f
+(as)i(p)s(ossible,)d(ho)m(w)m(ev)m(er,)j(if)e(the)i(arra)m(y)f(b)s
+(ecomes)g(so)g(large)g(that)0 4425 y(the)j(op)s(erating)f(system)g
+(cannot)h(store)g(it)f(all)g(in)f(RAM,)i(then)f(the)h(p)s(erformance)f
+(ma)m(y)h(b)s(e)f(degraded)g(b)s(ecause)0 4538 y(of)g(the)f(increased)g
+(sw)m(apping)f(of)h(virtual)f(memory)h(to)h(disk.)0 4698
+y(2.)51 b(When)33 b(dealing)g(with)f(FITS)h(tables,)i(the)f(most)g(imp)
+s(ortan)m(t)f(e\016ciency)g(factor)i(in)d(the)i(soft)m(w)m(are)h
+(design)e(is)0 4811 y(to)k(read)f(or)g(write)f(the)h(data)h(in)e(the)h
+(FITS)g(\014le)f(in)g(a)h(single)f(pass)h(through)f(the)h(\014le.)57
+b(An)36 b(example)g(of)g(p)s(o)s(or)0 4924 y(program)g(design)g(w)m
+(ould)f(b)s(e)h(to)h(read)g(a)f(large,)j(3-column)d(table)g(b)m(y)h
+(sequen)m(tially)e(reading)h(the)g(en)m(tire)h(\014rst)0
+5036 y(column,)24 b(then)g(going)g(bac)m(k)g(to)h(read)e(the)h(2nd)g
+(column,)g(and)f(\014nally)f(the)i(3rd)f(column;)i(this)e(ob)m(viously)
+f(requires)0 5149 y(3)27 b(passes)g(through)g(the)g(\014le)f(whic)m(h)g
+(could)g(triple)f(the)j(execution)f(time)g(of)g(an)g(IO)f(limited)f
+(program.)40 b(F)-8 b(or)27 b(small)0 5262 y(tables)j(this)f(is)h(not)g
+(imp)s(ortan)m(t,)g(but)g(when)f(reading)g(m)m(ulti-megab)m(yte)i
+(sized)f(tables)g(these)h(ine\016ciencies)e(can)0 5375
+y(b)s(ecome)g(signi\014can)m(t.)39 b(The)28 b(more)h(e\016cien)m(t)g
+(pro)s(cedure)e(in)h(this)f(case)j(is)d(to)j(read)e(or)h(write)f(only)f
+(as)i(man)m(y)g(ro)m(ws)0 5488 y(of)j(the)g(table)f(as)h(will)d(\014t)j
+(in)m(to)f(the)h(a)m(v)-5 b(ailable)31 b(in)m(ternal)f(IO)h(bu\013ers,)
+h(then)f(access)i(all)d(the)i(necessary)g(columns)0 5601
+y(of)f(data)h(within)c(that)k(range)f(of)g(ro)m(ws.)43
+b(Then)29 b(after)j(the)f(program)g(is)f(completely)g(\014nished)f
+(with)g(the)j(data)f(in)0 5714 y(those)i(ro)m(ws)e(it)h(can)g(mo)m(v)m
+(e)i(on)e(to)g(the)h(next)f(range)g(of)g(ro)m(ws)g(that)h(will)c(\014t)
+j(in)f(the)h(bu\013ers,)f(con)m(tin)m(uing)g(in)g(this)p
 eop
-%%Page: 126 132
-126 131 bop 0 299 a Fj(126)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0
-555 y Fj(unde\014ned)e(pixels)h(are)i(set)g(equal)f(to)h(a)g(v)-5
-b(alue)30 b(sp)s(eci\014ed)f(b)m(y)i(the)f(user)g(in)f(the)i('n)m(ullv)
--5 b(al')29 b(parameter.)41 b(If)30 b(n)m(ullv)-5 b(al)0
-668 y(=)22 b(0,)j(then)d(no)g(c)m(hec)m(ks)i(for)e(unde\014ned)e
-(pixels)h(will)f(b)s(e)i(p)s(erformed,)g(th)m(us)g(increasing)g(the)g
-(sp)s(eed)g(of)g(the)h(program.)0 781 y(The)36 b(second)g(set)g(of)h
-(routines)d(\(\013gcf)7 b(\))38 b(returns)d(the)h(data)h(elemen)m(t)f
-(arra)m(y)h(and)e(in)g(addition)f(a)j(logical)e(arra)m(y)0
-894 y(of)e(\015ags)f(whic)m(h)f(de\014nes)h(whether)g(the)g(corresp)s
-(onding)f(data)i(pixel)d(is)i(unde\014ned.)44 b(See)33
-b(App)s(endix)d(B)j(for)f(the)0 1007 y(de\014nition)c(of)j(the)f
-(parameters)h(used)e(in)g(these)i(routines.)0 1167 y(An)m(y)41
-b(column,)h(regardless)e(of)h(it's)f(in)m(trinsic)e(datat)m(yp)s(e,)45
-b(ma)m(y)c(b)s(e)f(read)h(as)g(a)g(string.)70 b(It)41
-b(should)e(b)s(e)h(noted)0 1280 y(ho)m(w)m(ev)m(er)32
-b(that)f(reading)e(a)i(n)m(umeric)e(column)g(as)i(a)f(string)g(is)f(10)
-i(-)g(100)g(times)f(slo)m(w)m(er)h(than)f(reading)f(the)i(same)0
-1393 y(column)f(as)i(a)g(n)m(um)m(b)s(er)e(due)h(to)h(the)g(large)g(o)m
-(v)m(erhead)g(in)f(constructing)g(the)h(formatted)g(strings.)43
-b(The)31 b(displa)m(y)0 1506 y(format)26 b(of)g(the)h(returned)d
-(strings)h(will)e(b)s(e)j(determined)e(b)m(y)i(the)g(TDISPn)f(k)m(eyw)m
-(ord,)j(if)c(it)i(exists,)h(otherwise)e(b)m(y)0 1619
-y(the)j(datat)m(yp)s(e)i(of)e(the)g(column.)39 b(The)28
-b(length)f(of)i(the)f(returned)f(strings)g(\(not)i(including)c(the)j(n)
-m(ull)e(terminating)0 1732 y(c)m(haracter\))38 b(can)e(b)s(e)g
-(determined)e(with)h(the)h(\014ts)p 1722 1732 28 4 v
-33 w(get)p 1875 1732 V 34 w(col)p 2020 1732 V 32 w(displa)m(y)p
-2332 1732 V 31 w(width)f(routine.)56 b(The)36 b(follo)m(wing)e(TDISPn)0
-1844 y(displa)m(y)29 b(formats)h(are)h(curren)m(tly)e(supp)s(orted:)191
-2099 y Ff(Iw.m)142 b(Integer)191 2212 y(Ow.m)g(Octal)46
-b(integer)191 2325 y(Zw.m)142 b(Hexadecimal)45 b(integer)191
-2438 y(Fw.d)142 b(Fixed)46 b(floating)g(point)191 2551
-y(Ew.d)142 b(Exponential)45 b(floating)g(point)191 2664
-y(Dw.d)142 b(Exponential)45 b(floating)g(point)191 2776
-y(Gw.d)142 b(General;)46 b(uses)g(Fw.d)h(if)g(significance)d(not)j
-(lost,)g(else)f(Ew.d)0 3031 y Fj(where)37 b(w)h(is)f(the)h(width)e(in)h
-(c)m(haracters)i(of)f(the)h(displa)m(y)m(ed)d(v)-5 b(alues,)40
-b(m)d(is)g(the)h(minim)m(um)e(n)m(um)m(b)s(er)g(of)i(digits)0
-3144 y(displa)m(y)m(ed,)29 b(and)h(d)g(is)f(the)i(n)m(um)m(b)s(er)e(of)
-h(digits)f(to)i(the)g(righ)m(t)f(of)h(the)f(decimal.)40
-b(The)30 b(.m)g(\014eld)f(is)g(optional.)0 3398 y Fi(1)81
-b Fj(Read)29 b(elemen)m(ts)h(from)f(an)g(ASCI)s(I)f(or)i(binary)e
-(table)h(column)f(\(in)h(the)g(CDU\).)i(These)e(routines)f(return)h
-(the)227 3511 y(v)-5 b(alues)29 b(of)h(the)g(table)g(column)f(arra)m(y)
-h(elemen)m(ts.)41 b(Unde\014ned)28 b(arra)m(y)j(elemen)m(ts)f(will)d(b)
-s(e)i(returned)g(with)g(a)227 3624 y(v)-5 b(alue)29 b(=)f(n)m(ulv)-5
-b(al,)28 b(unless)f(n)m(ulv)-5 b(al)27 b(=)h(0)i(\(or)f(=)f(')h(')g
-(for)g(\013gcvs\))g(in)f(whic)m(h)f(case)j(no)f(c)m(hec)m(king)h(for)e
-(unde\014ned)227 3737 y(v)-5 b(alues)27 b(will)e(b)s(e)i(p)s(erformed.)
-39 b(The)27 b(ANYF)h(parameter)g(is)f(set)h(to)g(true)g(if)f(an)m(y)g
-(of)h(the)g(returned)f(elemen)m(ts)227 3850 y(are)k(unde\014ned.)95
-4104 y Ff(int)47 b(fits_read_col_str)c(/)48 b(ffgcvs)286
-4217 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
-(firstelem,)334 4330 y(long)g(nelements,)e(char)h(*nulstr,)g(>)h(char)g
-(**array,)f(int)g(*anynul,)334 4443 y(int)h(*status\))95
-4669 y(int)g(fits_read_col_[log,byt,sht)o(,us)o(ht,i)o(nt,u)o(int)o
-(,lng)o(,uln)o(g,)41 b(flt,)47 b(dbl,)g(cmp,)f(dblcmp])g(/)286
-4782 y(ffgcv[l,b,i,ui,k,uk,j,uj,e)o(,d,)o(c,m])286 4895
-y(\(fitsfile)g(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
-(firstelem,)334 5008 y(long)g(nelements,)e(DTYPE)h(nulval,)g(>)h(DTYPE)
-g(*array,)f(int)g(*anynul,)334 5121 y(int)h(*status\))0
-5375 y Fi(2)81 b Fj(Read)39 b(elemen)m(ts)h(and)f(n)m(ull)f(\015ags)i
-(from)f(an)g(ASCI)s(I)g(or)g(binary)f(table)i(column)e(\(in)h(the)h
-(CHDU\).)g(These)227 5488 y(routines)28 b(return)f(the)i(v)-5
-b(alues)28 b(of)h(the)g(table)g(column)e(arra)m(y)j(elemen)m(ts.)40
-b(An)m(y)29 b(unde\014ned)d(arra)m(y)k(elemen)m(ts)227
-5601 y(will)j(ha)m(v)m(e)k(the)e(corresp)s(onding)f(n)m(ularra)m(y)h
-(elemen)m(t)h(set)g(equal)f(to)h(TR)m(UE.)f(The)g(an)m(yn)m(ul)g
-(parameter)h(is)227 5714 y(set)31 b(to)g(true)f(if)g(an)m(y)h(of)f(the)
-h(returned)e(elemen)m(ts)i(are)f(unde\014ned.)p eop
-%%Page: 127 133
-127 132 bop 0 299 a Fh(8.6.)72 b(SPECIALIZED)29 b(FITS)g(ASCI)s(I)g
-(AND)i(BINAR)-8 b(Y)32 b(T)-8 b(ABLE)30 b(R)m(OUTINES)933
-b Fj(127)95 555 y Ff(int)47 b(fits_read_colnull_str)42
-b(/)48 b(ffgcfs)286 668 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i
-(firstrow,)e(long)i(firstelem,)334 781 y(long)g(nelements,)e(>)i(char)g
-(**array,)e(char)i(*nularray,)e(int)i(*anynul,)334 894
-y(int)g(*status\))95 1120 y(int)g(fits_read_colnull_[log,byt)o(,sh)o
-(t,us)o(ht,i)o(nt,)o(uint)o(,lng)o(,ul)o(ng,f)o(lt,d)o(bl,)o(cmp,)o
-(dblc)o(mp])41 b(/)286 1233 y(ffgcf[l,b,i,ui,k,uk,j,uj,e)o(,d,)o(c,m])
-286 1346 y(\(fitsfile)46 b(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)
-334 1458 y(long)g(firstelem,)e(long)h(nelements,)f(>)j(DTYPE)e(*array,)
-334 1571 y(char)h(*nularray,)e(int)i(*anynul,)e(int)i(*status\))0
-1835 y Fi(3)81 b Fj(Read)24 b(an)g(arbitrary)f(data)i(subsection)e
-(from)h(an)g(N-dimensional)e(arra)m(y)j(in)e(a)h(binary)f(table)h(v)m
-(ector)i(column.)227 1948 y(Unde\014ned)21 b(pixels)g(in)g(the)i(arra)m
-(y)g(will)d(b)s(e)i(set)h(equal)g(to)g(the)g(v)-5 b(alue)22
-b(of)h('n)m(ulv)-5 b(al',)23 b(unless)e(n)m(ulv)-5 b(al=0)21
-b(in)g(whic)m(h)227 2061 y(case)37 b(no)e(testing)g(for)g(unde\014ned)e
-(pixels)g(will)g(b)s(e)i(p)s(erformed.)53 b(The)35 b(\014rst)g(and)f
-(last)h(ro)m(ws)h(in)e(the)h(table)227 2174 y(to)30 b(b)s(e)e(read)h
-(are)g(sp)s(eci\014ed)f(b)m(y)h(fpixel\(naxis+1\))d(and)j
-(lpixel\(naxis+1\),)e(and)h(hence)h(are)h(treated)g(as)f(the)227
-2287 y(next)38 b(higher)e(dimension)f(of)j(the)f(FITS)g(N-dimensional)e
-(arra)m(y)-8 b(.)63 b(The)37 b(INC)h(parameter)g(sp)s(eci\014es)e(the)
-227 2400 y(sampling)29 b(in)m(terv)-5 b(al)29 b(in)g(eac)m(h)j
-(dimension)c(b)s(et)m(w)m(een)j(the)f(data)h(elemen)m(ts)g(that)g(will)
-d(b)s(e)h(returned.)95 2664 y Ff(int)47 b(fits_read_subset_[byt,)42
-b(sht,)47 b(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f(flt,)h(dbl])f(/)286
-2777 y(ffgsv[b,i,ui,k,uk,j,uj,e,d)o(])286 2890 y(\(fitsfile)g(*fptr,)g
-(int)h(colnum,)e(int)i(naxis,)f(long)h(*naxes,)f(long)h(*fpixel,)334
-3003 y(long)g(*lpixel,)e(long)i(*inc,)f(DTYPE)h(nulval,)e(>)j(DTYPE)e
-(*array,)g(int)h(*anynul,)334 3115 y(int)g(*status\))0
-3379 y Fi(4)81 b Fj(Read)24 b(an)g(arbitrary)f(data)i(subsection)e
-(from)h(an)g(N-dimensional)e(arra)m(y)j(in)e(a)h(binary)f(table)h(v)m
-(ector)i(column.)227 3492 y(An)m(y)36 b(Unde\014ned)e(pixels)g(in)g
-(the)i(arra)m(y)g(will)d(ha)m(v)m(e)k(the)f(corresp)s(onding)e('n)m
-(ularra)m(y')h(elemen)m(t)h(set)g(equal)227 3605 y(to)k(TR)m(UE.)e(The)
-h(\014rst)e(and)h(last)h(ro)m(ws)f(in)g(the)g(table)h(to)g(b)s(e)f
-(read)h(are)g(sp)s(eci\014ed)d(b)m(y)j(fpixel\(naxis+1\))227
-3718 y(and)i(lpixel\(naxis+1\),)i(and)e(hence)h(are)g(treated)g(as)g
-(the)g(next)g(higher)f(dimension)e(of)j(the)g(FITS)f(N-)227
-3831 y(dimensional)f(arra)m(y)-8 b(.)78 b(The)41 b(INC)h(parameter)h
-(sp)s(eci\014es)e(the)i(sampling)d(in)m(terv)-5 b(al)42
-b(in)f(eac)m(h)j(dimension)227 3944 y(b)s(et)m(w)m(een)31
-b(the)g(data)g(elemen)m(ts)g(that)g(will)c(b)s(e)j(returned.)95
-4208 y Ff(int)47 b(fits_read_subsetnull_[byt,)41 b(sht,)47
-b(usht,)f(int,)h(uint,)f(lng,)h(ulng,)f(flt,)h(dbl])f(/)286
-4321 y(ffgsf[b,i,ui,k,uk,j,uj,e,d)o(])286 4434 y(\(fitsfile)g(*fptr,)g
-(int)h(colnum,)e(int)i(naxis,)f(long)h(*naxes,)334 4547
-y(long)g(*fpixel,)e(long)i(*lpixel,)e(long)i(*inc,)f(>)i(DTYPE)e
-(*array,)334 4660 y(char)h(*nularray,)e(int)i(*anynul,)e(int)i
-(*status\))0 4924 y Fi(5)81 b Fj(Read)35 b(bit)f(v)-5
-b(alues)34 b(from)h(a)g(b)m(yte)h(\('B'\))g(or)f(bit)f(\(`X`\))i(table)
-f(column)f(\(in)g(the)h(CDU\).)h(Larra)m(y)g(is)e(an)g(arra)m(y)227
-5036 y(of)g(logical)f(v)-5 b(alues)33 b(corresp)s(onding)f(to)i(the)g
-(sequence)g(of)g(bits)f(to)h(b)s(e)f(read.)51 b(If)33
-b(larra)m(y)g(is)g(true)g(then)h(the)227 5149 y(corresp)s(onding)f(bit)
-g(w)m(as)h(set)h(to)g(1,)h(otherwise)e(the)g(bit)g(w)m(as)g(set)h(to)g
-(0.)53 b(Note)35 b(that)g(in)e(the)i(case)g(of)f('X')227
-5262 y(columns,)h(CFITSIO)f(can)h(read)g(all)f(8)h(bits)f(of)i(eac)m(h)
-g(b)m(yte)g(whether)e(they)h(are)h(formally)d(v)-5 b(alid)33
-b(or)i(not.)227 5375 y(Th)m(us)d(if)g(the)h(column)f(is)g(de\014ned)g
-(as)h('4X',)i(and)d(one)i(calls)e(\013gcx)i(with)d(\014rstbit=1)h(and)g
-(n)m(bits=8,)h(then)227 5488 y(all)28 b(8)i(bits)e(will)e(b)s(e)j(read)
-g(from)g(the)g(\014rst)f(b)m(yte)i(\(as)g(opp)s(osed)e(to)i(reading)e
-(the)i(\014rst)e(4)i(bits)e(from)g(the)i(\014rst)227
-5601 y(ro)m(w)37 b(and)g(then)g(the)g(\014rst)f(4)i(bits)e(from)g(the)i
-(next)f(ro)m(w\),)i(ev)m(en)f(though)f(the)g(last)g(4)h(bits)e(of)h
-(eac)m(h)h(b)m(yte)227 5714 y(are)30 b(formally)d(not)i(de\014ned.)39
-b(It)30 b(should)d(also)i(b)s(e)f(noted)h(that)h(it)e(is)g(more)h
-(e\016cien)m(t)h(to)g(read)f('X')g(columns)p eop
-%%Page: 128 134
-128 133 bop 0 299 a Fj(128)958 b Fh(CHAPTER)30 b(8.)112
-b(SPECIALIZED)28 b(CFITSIO)h(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)227
-555 y Fj(an)42 b(en)m(tire)h(b)m(yte)f(at)h(a)g(time,)i(instead)c(of)i
-(bit)e(b)m(y)h(bit.)75 b(An)m(y)43 b(of)f(the)h(CFITSIO)d(routines)h
-(that)i(read)227 668 y(columns)33 b(\(e.g.)52 b(\014ts)p
-934 668 28 4 v 32 w(read)p 1138 668 V 33 w(col)p 1282
-668 V 33 w(b)m(yt\))34 b(ma)m(y)h(b)s(e)e(used)g(for)g(this)g(purp)s
-(ose.)49 b(These)34 b(routines)e(will)g(in)m(terpret)227
-781 y('X')37 b(columns)d(as)i(though)f(they)h(w)m(ere)g('B')h(columns)d
-(\(e.g.,)39 b('8X')e(is)e(equiv)-5 b(alen)m(t)35 b(to)h('1B',)i(and)d
-('16X')i(is)227 894 y(equiv)-5 b(alen)m(t)30 b(to)h('2B'\).)95
-1154 y Ff(int)47 b(fits_read_col_bit)c(/)48 b(ffgcx)286
-1267 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
-(firstbit,)334 1380 y(long)g(nbits,)f(>)h(char)g(*larray,)e(int)i
-(*status\))0 1639 y Fi(6)81 b Fj(Read)31 b(an)m(y)h(consecutiv)m(e)h
-(set)f(of)g(bits)e(from)i(an)f('X')h(or)g('B')h(column)d(and)h(in)m
-(terpret)g(them)h(as)f(an)h(unsigned)227 1752 y(n-bit)g(in)m(teger.)47
-b(n)m(bits)32 b(m)m(ust)g(b)s(e)g(less)g(than)h(16)g(or)g(32)g(in)e
-(\013gcxui)i(and)e(\013gcxuk,)j(resp)s(ectiv)m(ely)-8
-b(.)47 b(If)32 b(nro)m(ws)227 1865 y(is)27 b(greater)i(than)f(1,)h
-(then)e(the)h(same)h(set)f(of)g(bits)f(will)e(b)s(e)i(read)h(from)f
-(eac)m(h)i(ro)m(w,)g(starting)f(with)e(\014rstro)m(w.)227
-1978 y(The)k(bits)f(are)i(n)m(um)m(b)s(ered)e(with)g(1)i(=)f(the)h
-(most)f(signi\014can)m(t)g(bit)f(of)i(the)f(\014rst)g(elemen)m(t)h(of)f
-(the)h(column.)95 2238 y Ff(int)47 b(fits_read_col_bit_[usht,)42
-b(uint])k(/)h(ffgcx[ui,uk])286 2351 y(\(fitsfile)f(*fptr,)g(int)h
-(colnum,)e(long)i(firstrow,)e(long,)i(nrows,)334 2464
-y(long)g(firstbit,)e(long)i(nbits,)f(>)h(DTYPE)g(*array,)e(int)i
-(*status\))0 2723 y Fi(7)81 b Fj(Return)27 b(the)i(descriptor)e(for)i
-(a)g(v)-5 b(ariable)27 b(length)h(column)f(in)h(a)h(binary)d(table.)40
-b(The)28 b(descriptor)g(consists)g(of)227 2836 y(2)k(in)m(teger)f
-(parameters:)42 b(the)31 b(n)m(um)m(b)s(er)f(of)h(elemen)m(ts)h(in)d
-(the)i(arra)m(y)h(and)e(the)h(starting)g(o\013set)h(relativ)m(e)f(to)
-227 2949 y(the)d(start)f(of)g(the)h(heap.)39 b(The)27
-b(\014rst)f(routine)g(returns)g(a)h(single)f(descriptor)g(whereas)h
-(the)g(second)g(routine)227 3062 y(returns)i(the)i(descriptors)e(for)h
-(a)h(range)g(of)f(ro)m(ws)h(in)e(the)h(table.)95 3322
-y Ff(int)47 b(fits_read_descript)c(/)48 b(ffgdes)286
-3435 y(\(fitsfile)e(*fptr,)g(int)h(colnum,)e(long)i(rownum,)f(>)h(long)
-g(*repeat,)525 3548 y(long)g(*offset,)e(int)i(*status\))95
-3774 y(int)g(fits_read_descripts)c(/)k(ffgdess)286 3886
-y(\(fitsfile)f(*fptr,)g(int)h(colnum,)e(long)i(firstrow,)e(long)i
-(nrows)f(>)i(long)e(*repeat,)525 3999 y(long)h(*offset,)e(int)i
-(*status\))p eop
-%%Page: 129 135
-129 134 bop 0 1225 a Fg(App)5 b(endix)65 b(A)0 1687 y
+%%Page: 145 153
+145 152 bop 0 299 a Fh(13.2.)73 b(OPTIMIZA)-8 b(TION)29
+b(STRA)-8 b(TEGIES)2186 b Fj(145)0 555 y(w)m(a)m(y)28
+b(un)m(til)d(the)h(en)m(tire)h(\014le)f(has)g(b)s(een)g(pro)s(cessed.)
+39 b(By)27 b(using)e(this)h(pro)s(cedure)f(of)i(accessing)g(all)f(the)g
+(columns)g(of)0 668 y(a)k(table)f(in)f(parallel)f(rather)i(than)g
+(sequen)m(tially)-8 b(,)29 b(eac)m(h)h(blo)s(c)m(k)f(of)h(the)f(FITS)g
+(\014le)f(will)e(only)j(b)s(e)f(read)i(or)f(written)0
+781 y(once.)0 941 y(The)g(optimal)f(n)m(um)m(b)s(er)g(of)i(ro)m(ws)f
+(to)i(read)e(or)g(write)g(at)h(one)g(time)f(in)f(a)i(giv)m(en)f(table)h
+(dep)s(ends)d(on)j(the)f(width)f(of)0 1054 y(the)j(table)g(ro)m(w,)g
+(on)g(the)g(n)m(um)m(b)s(er)f(of)h(IO)g(bu\013ers)e(that)j(ha)m(v)m(e)g
+(b)s(een)e(allo)s(cated)h(in)f(CFITSIO,)g(and)g(also)h(on)g(the)0
+1167 y(n)m(um)m(b)s(er)f(of)h(other)g(FITS)f(\014les)g(that)i(are)f(op)
+s(en)f(at)i(the)f(same)g(time)g(\(since)g(one)g(IO)f(bu\013er)g(is)g
+(alw)m(a)m(ys)i(reserv)m(ed)0 1280 y(for)i(eac)m(h)h(op)s(en)e(FITS)g
+(\014le\).)50 b(The)34 b(CFITSIO)e(Iterator)j(routine)e(will)e
+(automatically)j(use)f(the)h(optimal-sized)0 1393 y(bu\013er,)43
+b(but)c(there)i(is)f(also)h(a)g(CFITSIO)e(routine)h(that)h(will)d
+(return)i(the)h(optimal)e(n)m(um)m(b)s(er)h(of)g(ro)m(ws)h(for)g(a)0
+1506 y(giv)m(en)36 b(table:)52 b(\014ts)p 644 1506 28
+4 v 32 w(get)p 796 1506 V 34 w(ro)m(wsize.)57 b(It)37
+b(is)d(not)j(critical)d(to)j(use)f(exactly)g(the)h(v)-5
+b(alue)35 b(of)h(nro)m(ws)f(returned)g(b)m(y)h(this)0
+1619 y(routine,)30 b(as)h(long)f(as)h(one)g(do)s(es)f(not)h(exceed)g
+(it.)41 b(Using)30 b(a)h(v)m(ery)g(small)e(v)-5 b(alue)30
+b(ho)m(w)m(ev)m(er)i(can)f(also)f(lead)h(to)g(p)s(o)s(or)0
+1732 y(p)s(erformance)f(b)s(ecause)g(of)h(the)f(o)m(v)m(erhead)i(from)e
+(the)g(larger)g(n)m(um)m(b)s(er)f(of)i(subroutine)d(calls.)0
+1892 y(The)36 b(optimal)f(n)m(um)m(b)s(er)g(of)h(ro)m(ws)g(returned)f
+(b)m(y)i(\014ts)p 1829 1892 V 32 w(get)p 1981 1892 V
+34 w(ro)m(wsize)f(is)g(v)-5 b(alid)34 b(only)h(as)i(long)f(as)g(the)h
+(application)0 2005 y(program)27 b(is)f(only)g(reading)h(or)g(writing)e
+(data)j(in)e(the)h(sp)s(eci\014ed)e(table.)40 b(An)m(y)27
+b(other)g(calls)g(to)h(access)g(data)g(in)e(the)0 2118
+y(table)31 b(header)g(or)g(in)e(an)m(y)j(other)f(FITS)f(\014le)g(w)m
+(ould)g(cause)h(additional)e(blo)s(c)m(ks)i(of)g(data)g(to)h(b)s(e)e
+(loaded)h(in)m(to)g(the)0 2230 y(IO)c(bu\013ers)g(displacing)f(data)i
+(from)g(the)g(original)e(table,)j(and)e(should)f(b)s(e)i(a)m(v)m(oided)
+g(during)e(the)i(critical)f(p)s(erio)s(d)0 2343 y(while)h(the)j(table)f
+(is)g(b)s(eing)f(read)h(or)g(written.)0 2503 y(Occasionally)f(it)g(is)f
+(necessary)i(to)h(sim)m(ultaneously)c(access)k(more)f(than)f(one)h
+(FITS)f(table,)h(for)g(example)f(when)0 2616 y(transferring)41
+b(v)-5 b(alues)42 b(from)g(an)h(input)d(table)j(to)g(an)g(output)f
+(table.)78 b(In)42 b(cases)h(lik)m(e)f(this,)j(one)e(should)e(call)0
+2729 y(\014ts)p 127 2729 V 32 w(get)p 279 2729 V 34 w(ro)m(wsize)24
+b(to)g(get)h(the)f(optimal)e(n)m(um)m(b)s(er)g(of)i(ro)m(ws)g(for)f
+(eac)m(h)i(table)e(separately)-8 b(,)26 b(than)d(reduce)h(the)f(n)m(um)
+m(b)s(er)0 2842 y(of)31 b(ro)m(ws)h(prop)s(ortionally)-8
+b(.)41 b(F)-8 b(or)32 b(example,)f(if)f(the)i(optimal)e(n)m(um)m(b)s
+(er)g(of)h(ro)m(ws)g(in)f(the)i(input)d(table)i(is)g(3600)i(and)0
+2955 y(is)f(1400)i(in)e(the)h(output)f(table,)h(then)g(these)g(v)-5
+b(alues)32 b(should)f(b)s(e)h(cut)h(in)e(half)h(to)h(1800)i(and)d(700,)
+j(resp)s(ectiv)m(ely)-8 b(,)0 3068 y(if)29 b(b)s(oth)h(tables)g(are)h
+(going)f(to)h(b)s(e)f(accessed)i(at)f(the)f(same)h(time.)0
+3228 y(3.)39 b(Use)25 b(the)g(CFITSIO)e(Iterator)j(routine.)38
+b(This)23 b(routine)h(pro)m(vides)f(a)j(more)e(`ob)5
+b(ject)26 b(orien)m(ted')f(w)m(a)m(y)h(of)f(reading)0
+3341 y(and)34 b(writing)e(FITS)i(\014les)f(whic)m(h)h(automatically)g
+(uses)g(the)g(most)h(appropriate)f(data)h(bu\013er)e(size)h(to)i(ac)m
+(hiev)m(e)0 3454 y(the)31 b(maxim)m(um)e(I/O)h(throughput.)0
+3614 y(4.)39 b(Use)24 b(binary)e(table)h(extensions)g(rather)g(than)h
+(ASCI)s(I)e(table)h(extensions)g(for)g(b)s(etter)h(e\016ciency)g(when)e
+(dealing)0 3727 y(with)36 b(tabular)h(data.)62 b(The)37
+b(I/O)g(to)h(ASCI)s(I)e(tables)h(is)g(slo)m(w)m(er)g(b)s(ecause)h(of)f
+(the)h(o)m(v)m(erhead)h(in)d(formatting)h(or)0 3840 y(parsing)31
+b(the)h(ASCI)s(I)f(data)i(\014elds)e(and)h(b)s(ecause)g(ASCI)s(I)f
+(tables)h(are)h(ab)s(out)f(t)m(wice)h(as)g(large)f(as)h(binary)d
+(tables)0 3953 y(with)f(the)i(same)f(information)f(con)m(ten)m(t.)0
+4113 y(5.)64 b(Design)38 b(soft)m(w)m(are)h(so)g(that)f(it)g(reads)g
+(the)g(FITS)f(header)h(k)m(eyw)m(ords)g(in)f(the)h(same)h(order)e(in)g
+(whic)m(h)g(they)0 4226 y(o)s(ccur)28 b(in)g(the)h(\014le.)39
+b(When)28 b(reading)g(k)m(eyw)m(ords,)i(CFITSIO)d(searc)m(hes)i(forw)m
+(ard)g(starting)f(from)g(the)h(p)s(osition)e(of)0 4339
+y(the)i(last)h(k)m(eyw)m(ord)f(that)h(w)m(as)g(read.)40
+b(If)29 b(it)f(reac)m(hes)j(the)e(end)g(of)g(the)h(header)f(without)f
+(\014nding)f(the)i(k)m(eyw)m(ord,)h(it)0 4452 y(then)j(go)s(es)h(bac)m
+(k)g(to)h(the)e(start)h(of)g(the)g(header)f(and)g(con)m(tin)m(ues)g
+(the)h(searc)m(h)g(do)m(wn)f(to)h(the)g(p)s(osition)d(where)i(it)0
+4565 y(started.)41 b(In)30 b(practice,)h(as)f(long)g(as)h(the)f(en)m
+(tire)h(FITS)e(header)h(can)h(\014t)f(at)h(one)g(time)f(in)f(the)h(a)m
+(v)-5 b(ailable)30 b(in)m(ternal)0 4678 y(IO)36 b(bu\013ers,)h(then)f
+(the)g(header)g(k)m(eyw)m(ord)h(access)g(will)d(b)s(e)i(v)m(ery)g(fast)
+h(and)f(it)f(mak)m(es)i(little)e(di\013erence)h(whic)m(h)0
+4791 y(order)30 b(they)g(are)h(accessed.)0 4951 y(6.)40
+b(Av)m(oid)28 b(the)f(use)h(of)f(scaling)g(\(b)m(y)h(using)e(the)i
+(BSCALE)e(and)h(BZER)m(O)h(or)f(TSCAL)g(and)g(TZER)m(O)f(k)m(eyw)m
+(ords\))0 5064 y(in)34 b(FITS)g(\014les)f(since)i(the)g(scaling)f(op)s
+(erations)g(add)g(to)i(the)f(pro)s(cessing)e(time)i(needed)f(to)i(read)
+f(or)g(write)f(the)0 5176 y(data.)39 b(In)24 b(some)h(cases)h(it)e(ma)m
+(y)h(b)s(e)f(more)g(e\016cien)m(t)h(to)h(temp)s(orarily)c(turn)i(o\013)
+h(the)f(scaling)g(\(using)f(\014ts)p 3490 5176 V 33 w(set)p
+3634 5176 V 33 w(bscale)0 5289 y(or)30 b(\014ts)p 238
+5289 V 33 w(set)p 382 5289 V 33 w(tscale\))i(and)d(then)h(read)h(or)f
+(write)g(the)g(ra)m(w)h(unscaled)e(v)-5 b(alues)30 b(in)f(the)h(FITS)g
+(\014le.)0 5450 y(7.)77 b(Av)m(oid)42 b(using)f(the)i(`implicit)c(data)
+44 b(t)m(yp)s(e)e(con)m(v)m(ersion')h(capabilit)m(y)e(in)g(CFITSIO.)g
+(F)-8 b(or)44 b(instance,)h(when)0 5562 y(reading)27
+b(a)h(FITS)f(image)h(with)e(BITPIX)i(=)f(-32)i(\(32-bit)f(\015oating)g
+(p)s(oin)m(t)f(pixels\),)g(read)g(the)h(data)g(in)m(to)g(a)g(single)0
+5675 y(precision)38 b(\015oating)i(p)s(oin)m(t)f(data)i(arra)m(y)f(in)f
+(the)h(program.)69 b(F)-8 b(orcing)40 b(CFITSIO)f(to)i(con)m(v)m(ert)g
+(the)f(data)h(to)g(a)p eop
+%%Page: 146 154
+146 153 bop 0 299 a Fj(146)1876 b Fh(CHAPTER)30 b(13.)112
+b(OPTIMIZING)29 b(PR)m(OGRAMS)0 555 y Fj(di\013eren)m(t)h(data)h(t)m
+(yp)s(e)f(can)h(slo)m(w)f(the)h(program.)0 715 y(8.)57
+b(Where)36 b(feasible,)g(design)f(FITS)g(binary)f(tables)h(using)f(v)m
+(ector)k(column)c(elemen)m(ts)i(so)g(that)g(the)g(data)h(are)0
+828 y(written)29 b(as)h(a)g(con)m(tiguous)g(set)g(of)g(b)m(ytes,)g
+(rather)g(than)f(as)h(single)e(elemen)m(ts)i(in)f(m)m(ultiple)e(ro)m
+(ws.)41 b(F)-8 b(or)30 b(example,)0 941 y(it)35 b(is)g(faster)h(to)g
+(access)h(the)f(data)h(in)d(a)i(table)g(that)g(con)m(tains)g(a)g
+(single)e(ro)m(w)i(and)f(2)h(columns)e(with)h(TF)m(ORM)0
+1054 y(k)m(eyw)m(ords)e(equal)g(to)h('10000E')h(and)e('10000J',)j(than)
+d(it)f(is)g(to)i(access)g(the)g(same)f(amoun)m(t)h(of)f(data)h(in)e(a)h
+(table)0 1167 y(with)39 b(10000)k(ro)m(ws)d(whic)m(h)g(has)g(columns)f
+(with)g(the)i(TF)m(ORM)g(k)m(eyw)m(ords)g(equal)f(to)h('1E')h(and)e
+('1J'.)h(In)f(the)0 1280 y(former)27 b(case)i(the)f(10000)i(\015oating)
+e(p)s(oin)m(t)f(v)-5 b(alues)27 b(in)g(the)h(\014rst)f(column)g(are)h
+(all)f(written)g(in)f(a)i(con)m(tiguous)g(blo)s(c)m(k)0
+1393 y(of)e(the)f(\014le)g(whic)m(h)f(can)i(b)s(e)f(read)g(or)g
+(written)g(quic)m(kly)-8 b(,)26 b(whereas)f(in)f(the)i(second)f(case)i
+(eac)m(h)g(\015oating)e(p)s(oin)m(t)f(v)-5 b(alue)0 1506
+y(in)33 b(the)h(\014rst)f(column)f(is)h(in)m(terlea)m(v)m(ed)i(with)d
+(the)i(in)m(teger)h(v)-5 b(alue)33 b(in)g(the)h(second)g(column)e(of)i
+(the)g(same)h(ro)m(w)f(so)0 1619 y(CFITSIO)29 b(has)h(to)h(explicitly)d
+(mo)m(v)m(e)k(to)f(the)g(p)s(osition)d(of)j(eac)m(h)g(elemen)m(t)g(to)g
+(b)s(e)f(read)g(or)g(written.)0 1779 y(9.)52 b(Av)m(oid)34
+b(the)h(use)e(of)i(v)-5 b(ariable)32 b(length)i(v)m(ector)i(columns)c
+(in)h(binary)g(tables,)i(since)e(an)m(y)i(reading)e(or)h(writing)0
+1892 y(of)f(these)g(data)g(requires)e(that)i(CFITSIO)f(\014rst)f(lo)s
+(ok)i(up)e(or)i(compute)g(the)f(starting)h(address)f(of)g(eac)m(h)i(ro)
+m(w)f(of)0 2005 y(data)e(in)e(the)i(heap.)0 2165 y(10.)73
+b(When)40 b(cop)m(ying)h(data)h(from)e(one)h(FITS)f(table)h(to)g
+(another,)j(it)d(is)e(faster)j(to)f(transfer)g(the)f(ra)m(w)h(b)m(ytes)
+0 2278 y(instead)27 b(of)i(reading)e(then)h(writing)e(eac)m(h)j(column)
+e(of)h(the)g(table.)40 b(The)28 b(CFITSIO)e(routines)h(\014ts)p
+3349 2278 28 4 v 33 w(read)p 3554 2278 V 32 w(tblb)m(ytes)0
+2391 y(and)36 b(\014ts)p 310 2391 V 32 w(write)p 545
+2391 V 32 w(tblb)m(ytes)h(will)d(p)s(erform)h(lo)m(w-lev)m(el)h(reads)h
+(or)f(writes)g(of)h(an)m(y)g(con)m(tiguous)f(range)h(of)g(b)m(ytes)g
+(in)0 2503 y(a)d(table)f(extension.)50 b(These)33 b(routines)g(can)g(b)
+s(e)g(used)g(to)h(read)f(or)h(write)f(a)g(whole)g(ro)m(w)h(\(or)g(m)m
+(ultiple)d(ro)m(ws)i(for)0 2616 y(ev)m(en)e(greater)h(e\016ciency\))g
+(of)f(a)g(table)g(with)e(a)i(single)f(function)f(call.)41
+b(These)31 b(routines)f(are)h(fast)g(b)s(ecause)g(they)0
+2729 y(b)m(ypass)36 b(all)f(the)i(usual)e(data)i(scaling,)g(error)f(c)m
+(hec)m(king)h(and)f(mac)m(hine)g(dep)s(enden)m(t)f(data)i(con)m(v)m
+(ersion)g(that)g(is)0 2842 y(normally)e(done)i(b)m(y)f(CFITSIO,)g(and)g
+(they)h(allo)m(w)f(the)i(program)e(to)i(write)e(the)h(data)g(to)h(the)f
+(output)f(\014le)g(in)0 2955 y(exactly)29 b(the)f(same)h(b)m(yte)g
+(order.)40 b(F)-8 b(or)29 b(these)f(same)h(reasons,)g(these)g(routines)
+e(can)h(corrupt)g(the)g(FITS)g(data)h(\014le)0 3068 y(if)35
+b(used)f(incorrectly)h(b)s(ecause)h(no)f(v)-5 b(alidation)34
+b(or)i(mac)m(hine)f(dep)s(enden)m(t)f(con)m(v)m(ersion)i(is)f(p)s
+(erformed)f(b)m(y)h(these)0 3181 y(routines.)54 b(These)35
+b(routines)f(are)i(only)e(recommended)h(for)g(optimizing)e(critical)h
+(pieces)h(of)h(co)s(de)f(and)g(should)0 3294 y(only)d(b)s(e)h(used)g(b)
+m(y)g(programmers)g(who)g(thoroughly)f(understand)f(the)j(in)m(ternal)e
+(format)i(of)f(the)h(FITS)e(tables)0 3407 y(they)f(are)f(reading)g(or)g
+(writing.)0 3567 y(11.)41 b(Another)30 b(strategy)g(for)g(impro)m(ving)
+d(the)j(sp)s(eed)e(of)i(writing)e(a)h(FITS)g(table,)h(similar)d(to)j
+(the)f(previous)f(one,)0 3680 y(is)j(to)h(directly)f(construct)h(the)f
+(en)m(tire)h(b)m(yte)g(stream)g(for)g(a)g(whole)f(table)g(ro)m(w)h
+(\(or)g(m)m(ultiple)e(ro)m(ws\))i(within)d(the)0 3793
+y(application)f(program)h(and)g(then)h(write)f(it)g(to)h(the)g(FITS)f
+(\014le)g(with)f(\014ts)p 2520 3793 V 32 w(write)p 2755
+3793 V 32 w(tblb)m(ytes.)40 b(This)28 b(a)m(v)m(oids)i(all)f(the)0
+3906 y(o)m(v)m(erhead)h(normally)e(presen)m(t)h(in)f(the)i
+(column-orien)m(ted)e(CFITSIO)g(write)g(routines.)39
+b(This)28 b(tec)m(hnique)h(should)0 4019 y(only)34 b(b)s(e)f(used)h
+(for)g(critical)f(applications)g(b)s(ecause)h(it)g(mak)m(es)i(the)e(co)
+s(de)h(more)f(di\016cult)f(to)i(understand)e(and)0 4131
+y(main)m(tain,)j(and)f(it)g(mak)m(es)h(the)g(co)s(de)f(more)h(system)g
+(dep)s(enden)m(t)e(\(e.g.,)39 b(do)c(the)h(b)m(ytes)g(need)f(to)h(b)s
+(e)f(sw)m(app)s(ed)0 4244 y(b)s(efore)30 b(writing)e(to)j(the)g(FITS)f
+(\014le?\).)0 4405 y(12.)53 b(Finally)-8 b(,)34 b(external)g(factors)i
+(suc)m(h)e(as)g(the)h(t)m(yp)s(e)f(of)h(magnetic)f(disk)f(con)m
+(troller)h(\(SCSI)f(or)i(IDE\),)g(the)f(size)0 4517 y(of)h(the)g(disk)f
+(cac)m(he,)k(the)d(a)m(v)m(erage)i(seek)f(sp)s(eed)e(of)h(the)g(disk,)g
+(the)g(amoun)m(t)h(of)f(disk)e(fragmen)m(tation,)k(and)e(the)0
+4630 y(amoun)m(t)29 b(of)g(RAM)f(a)m(v)-5 b(ailable)28
+b(on)h(the)f(system)h(can)g(all)e(ha)m(v)m(e)j(a)f(signi\014can)m(t)e
+(impact)i(on)f(o)m(v)m(erall)h(I/O)f(e\016ciency)-8 b(.)0
+4743 y(F)g(or)36 b(critical)e(applications,)g(a)i(system)f
+(administrator)e(should)g(review)h(the)i(prop)s(osed)d(system)j(hardw)m
+(are)e(to)0 4856 y(iden)m(tify)29 b(an)m(y)i(p)s(oten)m(tial)e(I/O)i(b)
+s(ottlenec)m(ks.)p eop
+%%Page: 147 155
+147 154 bop 0 1225 a Fg(App)5 b(endix)65 b(A)0 1687 y
 Fm(Index)77 b(of)h(Routines)50 2154 y Fj(\014ts)p 177
 2154 28 4 v 32 w(add)p 356 2154 V 32 w(group)p 616 2154
-V 33 w(mem)m(b)s(er)144 b(92)50 2267 y(\014ts)p 177 2267
-V 32 w(ascii)p 382 2267 V 32 w(tform)433 b(101)50 2380
-y(\014ts)p 177 2380 V 32 w(binary)p 466 2380 V 31 w(tform)350
-b(101)50 2493 y(\014ts)p 177 2493 V 32 w(calculator)514
-b(95)50 2606 y(\014ts)p 177 2606 V 32 w(calculator)p
-598 2606 V 33 w(rng)349 b(95)50 2719 y(\014ts)p 177 2719
-V 32 w(calc)p 360 2719 V 34 w(ro)m(ws)538 b(94)50 2832
+V 33 w(mem)m(b)s(er)144 b(78)50 2267 y(\014ts)p 177 2267
+V 32 w(ascii)p 382 2267 V 32 w(tform)478 b(59)50 2380
+y(\014ts)p 177 2380 V 32 w(binary)p 466 2380 V 31 w(tform)395
+b(58)50 2493 y(\014ts)p 177 2493 V 32 w(calculator)514
+b(52)50 2606 y(\014ts)p 177 2606 V 32 w(calculator)p
+598 2606 V 33 w(rng)349 b(52)50 2719 y(\014ts)p 177 2719
+V 32 w(calc)p 360 2719 V 34 w(ro)m(ws)538 b(52)50 2832
 y(\014ts)p 177 2832 V 32 w(c)m(hange)p 478 2832 V 34
-w(group)372 b(91)50 2945 y(\014ts)p 177 2945 V 32 w(clear)p
-396 2945 V 33 w(errmsg)414 b(68)50 3057 y(\014ts)p 177
-3057 V 32 w(close)p 396 3057 V 33 w(\014le)566 b(69)50
-3170 y(\014ts)p 177 3170 V 32 w(compact)p 541 3170 V
-34 w(group)309 b(92)50 3283 y(\014ts)p 177 3283 V 32
-w(compare)p 542 3283 V 34 w(str)429 b(98)50 3396 y(\014ts)p
-177 3396 V 32 w(cop)m(y)p 390 3396 V 34 w(col)577 b(83)50
-3509 y(\014ts)p 177 3509 V 32 w(cop)m(y)p 390 3509 V
-34 w(data)467 b(108)50 3622 y(\014ts)p 177 3622 V 32
-w(cop)m(y)p 390 3622 V 34 w(group)460 b(91)50 3735 y(\014ts)p
-177 3735 V 32 w(cop)m(y)p 390 3735 V 34 w(hdu)535 b(72)50
+w(group)372 b(76)50 2945 y(\014ts)p 177 2945 V 32 w(clear)p
+396 2945 V 33 w(errmark)366 b(30)50 3057 y(\014ts)p 177
+3057 V 32 w(clear)p 396 3057 V 33 w(errmsg)414 b(30)50
+3170 y(\014ts)p 177 3170 V 32 w(close)p 396 3170 V 33
+w(\014le)566 b(32)50 3283 y(\014ts)p 177 3283 V 32 w(compact)p
+541 3283 V 34 w(group)309 b(77)50 3396 y(\014ts)p 177
+3396 V 32 w(compare)p 542 3396 V 34 w(str)429 b(56)50
+3509 y(\014ts)p 177 3509 V 32 w(compress)p 569 3509 V
+33 w(heap)278 b(100)50 3622 y(\014ts)p 177 3622 V 32
+w(cop)m(y)p 390 3622 V 34 w(col)577 b(49)50 3735 y(\014ts)p
+177 3735 V 32 w(cop)m(y)p 390 3735 V 34 w(data)512 b(86)50
 3848 y(\014ts)p 177 3848 V 32 w(cop)m(y)p 390 3848 V
-34 w(header)380 b(108)50 3961 y(\014ts)p 177 3961 V 32
-w(cop)m(y)p 390 3961 V 34 w(k)m(ey)510 b(112)50 4074
-y(\014ts)p 177 4074 V 32 w(cop)m(y)p 390 4074 V 34 w(mem)m(b)s(er)369
-b(93)50 4187 y(\014ts)p 177 4187 V 32 w(create)p 445
-4187 V 35 w(\014le)515 b(69)50 4299 y(\014ts)p 177 4299
-V 32 w(create)p 445 4299 V 35 w(group)404 b(90)50 4412
-y(\014ts)p 177 4412 V 32 w(create)p 445 4412 V 35 w(hdu)434
-b(107)50 4525 y(\014ts)p 177 4525 V 32 w(create)p 445
-4525 V 35 w(img)485 b(72)50 4638 y(\014ts)p 177 4638
-V 32 w(create)p 445 4638 V 35 w(mem\014le)278 b(106)50
-4751 y(\014ts)p 177 4751 V 32 w(create)p 445 4751 V 35
-w(tbl)520 b(72)50 4864 y(\014ts)p 177 4864 V 32 w(create)p
-445 4864 V 35 w(template)284 b(69)50 4977 y(\014ts)p
-177 4977 V 32 w(date2str)580 b(97)50 5090 y(\014ts)p
-177 5090 V 32 w(deco)s(de)p 479 5090 V 33 w(c)m(hksum)301
-b(97)50 5203 y(\014ts)p 177 5203 V 32 w(deco)s(de)p 479
-5203 V 33 w(tdim)412 b(82)50 5316 y(\014ts)p 177 5316
-V 32 w(delete)p 441 5316 V 33 w(col)527 b(83)50 5429
-y(\014ts)p 177 5429 V 32 w(delete)p 441 5429 V 33 w(\014le)521
-b(69)50 5541 y(\014ts)p 177 5541 V 32 w(delete)p 441
-5541 V 33 w(hdu)485 b(72)50 5654 y(\014ts)p 177 5654
-V 32 w(delete)p 441 5654 V 33 w(k)m(ey)505 b(76)1328
-2154 y(\014ts)p 1455 2154 V 33 w(delete)p 1720 2154 V
-33 w(record)468 b(76)1328 2267 y(\014ts)p 1455 2267 V
-33 w(delete)p 1720 2267 V 33 w(ro)m(wlist)449 b(82)1328
-2380 y(\014ts)p 1455 2380 V 33 w(delete)p 1720 2380 V
-33 w(ro)m(ws)536 b(82)1328 2493 y(\014ts)p 1455 2493
-V 33 w(enco)s(de)p 1758 2493 V 32 w(c)m(hksum)380 b(96)1328
-2606 y(\014ts)p 1455 2606 V 33 w(\014le)p 1605 2606 V
-31 w(mo)s(de)618 b(70)1328 2719 y(\014ts)p 1455 2719
-V 33 w(\014le)p 1605 2719 V 31 w(name)j(69)1328 2832
-y(\014ts)p 1455 2832 V 33 w(\014nd)p 1641 2832 V 31 w(\014rst)p
-1830 2832 V 32 w(ro)m(w)463 b(94)1328 2945 y(\014ts)p
-1455 2945 V 33 w(\014nd)p 1641 2945 V 31 w(nextk)m(ey)444
-b(114)1328 3057 y(\014ts)p 1455 3057 V 33 w(\014nd)p
-1641 3057 V 31 w(ro)m(ws)617 b(94)1328 3170 y(\014ts)p
-1455 3170 V 33 w(\015ush)p 1677 3170 V 31 w(\014le)598
-b(106)1328 3283 y(\014ts)p 1455 3283 V 33 w(get)p 1608
-3283 V 33 w(acolparms)382 b(123)1328 3396 y(\014ts)p
-1455 3396 V 33 w(get)p 1608 3396 V 33 w(b)s(colparms)373
-b(123)1328 3509 y(\014ts)p 1455 3509 V 33 w(get)p 1608
-3509 V 33 w(c)m(hksum)529 b(96)1328 3622 y(\014ts)p 1455
-3622 V 33 w(get)p 1608 3622 V 33 w(col)p 1752 3622 V
-33 w(displa)m(y)p 2065 3622 V 31 w(width)144 b(81)1328
-3735 y(\014ts)p 1455 3735 V 33 w(get)p 1608 3735 V 33
-w(colname)505 b(80)1328 3848 y(\014ts)p 1455 3848 V 33
-w(get)p 1608 3848 V 33 w(coln)m(um)542 b(80)1328 3961
-y(\014ts)p 1455 3961 V 33 w(get)p 1608 3961 V 33 w(colt)m(yp)s(e)h(81)
-1328 4074 y(\014ts)p 1455 4074 V 33 w(get)p 1608 4074
-V 33 w(errstatus)478 b(68)1328 4187 y(\014ts)p 1455 4187
-V 33 w(get)p 1608 4187 V 33 w(hdrp)s(os)509 b(109)1328
-4299 y(\014ts)p 1455 4299 V 33 w(get)p 1608 4299 V 33
-w(hdrspace)478 b(73)1328 4412 y(\014ts)p 1455 4412 V
-33 w(get)p 1608 4412 V 33 w(hdu)p 1794 4412 V 32 w(n)m(um)468
-b(71)1328 4525 y(\014ts)p 1455 4525 V 33 w(get)p 1608
-4525 V 33 w(hdu)p 1794 4525 V 32 w(t)m(yp)s(e)h(71)1328
-4638 y(\014ts)p 1455 4638 V 33 w(get)p 1608 4638 V 33
-w(hduaddr)446 b(106)1328 4751 y(\014ts)p 1455 4751 V
-33 w(get)p 1608 4751 V 33 w(hduo\013)531 b(106)1328 4864
-y(\014ts)p 1455 4864 V 33 w(get)p 1608 4864 V 33 w(img)p
-1788 4864 V 33 w(dim)495 b(78)1328 4977 y(\014ts)p 1455
-4977 V 33 w(get)p 1608 4977 V 33 w(img)p 1788 4977 V
-33 w(param)395 b(78)1328 5090 y(\014ts)p 1455 5090 V
-33 w(get)p 1608 5090 V 33 w(img)p 1788 5090 V 33 w(size)506
-b(78)1328 5203 y(\014ts)p 1455 5203 V 33 w(get)p 1608
-5203 V 33 w(img)p 1788 5203 V 33 w(t)m(yp)s(e)474 b(78)1328
-5316 y(\014ts)p 1455 5316 V 33 w(get)p 1608 5316 V 33
-w(k)m(eyclass)466 b(100)1328 5429 y(\014ts)p 1455 5429
-V 33 w(get)p 1608 5429 V 33 w(k)m(eyname)483 b(99)1328
-5541 y(\014ts)p 1455 5541 V 33 w(get)p 1608 5541 V 33
-w(k)m(eyt)m(yp)s(e)475 b(100)1328 5654 y(\014ts)p 1455
-5654 V 33 w(get)p 1608 5654 V 33 w(n)m(um)p 1816 5654
-V 32 w(cols)f(80)2684 2154 y(\014ts)p 2811 2154 V 33
-w(get)p 2964 2154 V 34 w(n)m(um)p 3173 2154 V 32 w(groups)235
-b(93)2684 2267 y(\014ts)p 2811 2267 V 33 w(get)p 2964
-2267 V 34 w(n)m(um)p 3173 2267 V 32 w(hdus)310 b(72)2684
-2380 y(\014ts)p 2811 2380 V 33 w(get)p 2964 2380 V 34
-w(n)m(um)p 3173 2380 V 32 w(mem)m(b)s(ers)144 b(93)2684
-2493 y(\014ts)p 2811 2493 V 33 w(get)p 2964 2493 V 34
-w(n)m(um)p 3173 2493 V 32 w(ro)m(ws)319 b(80)2684 2606
-y(\014ts)p 2811 2606 V 33 w(get)p 2964 2606 V 34 w(ro)m(wsize)375
-b(123)2684 2719 y(\014ts)p 2811 2719 V 33 w(get)p 2964
-2719 V 34 w(system)p 3269 2719 V 33 w(time)225 b(97)2684
-2832 y(\014ts)p 2811 2832 V 33 w(get)p 2964 2832 V 34
-w(tb)s(col)461 b(101)2684 2945 y(\014ts)p 2811 2945 V
-33 w(get)p 2964 2945 V 34 w(v)m(ersion)427 b(67)2684
-3057 y(\014ts)p 2811 3057 V 33 w(insert)p 3068 3057 V
-32 w(atbl)402 b(107)2684 3170 y(\014ts)p 2811 3170 V
-33 w(insert)p 3068 3170 V 32 w(btbl)396 b(107)2684 3283
-y(\014ts)p 2811 3283 V 33 w(insert)p 3068 3283 V 32 w(col)493
-b(83)2684 3396 y(\014ts)p 2811 3396 V 33 w(insert)p 3068
-3396 V 32 w(cols)457 b(83)2684 3509 y(\014ts)p 2811 3509
-V 33 w(insert)p 3068 3509 V 32 w(group)376 b(90)2684
-3622 y(\014ts)p 2811 3622 V 33 w(insert)p 3068 3622 V
-32 w(img)412 b(107)2684 3735 y(\014ts)p 2811 3735 V 33
-w(insert)p 3068 3735 V 32 w(k)m(ey)p 3233 3735 V 33 w(n)m(ull)242
-b(113)2684 3848 y(\014ts)p 2811 3848 V 33 w(insert)p
-3068 3848 V 32 w(k)m(ey)p 3233 3848 V 33 w(TYP)197 b(113)2684
-3961 y(\014ts)p 2811 3961 V 33 w(insert)p 3068 3961 V
-32 w(record)311 b(113)2684 4074 y(\014ts)p 2811 4074
-V 33 w(insert)p 3068 4074 V 32 w(ro)m(ws)424 b(82)2684
-4187 y(\014ts)p 2811 4187 V 33 w(iterate)p 3101 4187
-V 33 w(data)394 b(77)2684 4299 y(\014ts)p 2811 4299 V
-33 w(mak)m(e)p 3050 4299 V 34 w(k)m(eyn)436 b(99)2684
-4412 y(\014ts)p 2811 4412 V 33 w(mak)m(e)p 3050 4412
-V 34 w(nk)m(ey)g(99)2684 4525 y(\014ts)p 2811 4525 V
-33 w(merge)p 3081 4525 V 33 w(groups)326 b(91)2684 4638
-y(\014ts)p 2811 4638 V 33 w(mo)s(dify)p 3121 4638 V 31
-w(card)335 b(116)2684 4751 y(\014ts)p 2811 4751 V 33
-w(mo)s(dify)p 3121 4751 V 31 w(commen)m(t)192 b(75)2684
-4864 y(\014ts)p 2811 4864 V 33 w(mo)s(dify)p 3121 4864
-V 31 w(k)m(ey)p 3285 4864 V 33 w(n)m(ull)e(116)2684 4977
-y(\014ts)p 2811 4977 V 33 w(mo)s(dify)p 3121 4977 V 31
-w(k)m(ey)p 3285 4977 V 33 w(TYP)145 b(116)2684 5090 y(\014ts)p
-2811 5090 V 33 w(mo)s(dify)p 3121 5090 V 31 w(name)340
-b(75)2684 5203 y(\014ts)p 2811 5203 V 33 w(mo)s(dify)p
-3121 5203 V 31 w(record)259 b(115)2684 5316 y(\014ts)p
-2811 5316 V 33 w(mo)s(dify)p 3121 5316 V 31 w(v)m(ector)p
-3393 5316 V 34 w(len)160 b(83)2684 5429 y(\014ts)p 2811
-5429 V 33 w(mo)m(v)-5 b(abs)p 3137 5429 V 33 w(hdu)381
-b(71)2684 5541 y(\014ts)p 2811 5541 V 33 w(mo)m(vnam)p
-3182 5541 V 33 w(hdu)336 b(71)2684 5654 y(\014ts)p 2811
-5654 V 33 w(mo)m(vrel)p 3112 5654 V 33 w(hdu)406 b(71)1882
-5942 y(129)p eop
-%%Page: 130 136
-130 135 bop 0 299 a Fj(130)2084 b Fh(APPENDIX)31 b(A.)61
+34 w(\014le)571 b(34)50 3961 y(\014ts)p 177 3961 V 32
+w(cop)m(y)p 390 3961 V 34 w(group)460 b(77)50 4074 y(\014ts)p
+177 4074 V 32 w(cop)m(y)p 390 4074 V 34 w(hdu)535 b(34)50
+4187 y(\014ts)p 177 4187 V 32 w(cop)m(y)p 390 4187 V
+34 w(header)425 b(34)50 4299 y(\014ts)p 177 4299 V 32
+w(cop)m(y)p 390 4299 V 34 w(k)m(ey)555 b(89)50 4412 y(\014ts)p
+177 4412 V 32 w(cop)m(y)p 390 4412 V 34 w(mem)m(b)s(er)369
+b(79)50 4525 y(\014ts)p 177 4525 V 32 w(create)p 445
+4525 V 35 w(\014le)515 b(32)50 4638 y(\014ts)p 177 4638
+V 32 w(create)p 445 4638 V 35 w(group)404 b(76)50 4751
+y(\014ts)p 177 4751 V 32 w(create)p 445 4751 V 35 w(hdu)479
+b(84)50 4864 y(\014ts)p 177 4864 V 32 w(create)p 445
+4864 V 35 w(img)485 b(40)50 4977 y(\014ts)p 177 4977
+V 32 w(create)p 445 4977 V 35 w(mem\014le)323 b(82)50
+5090 y(\014ts)p 177 5090 V 32 w(create)p 445 5090 V 35
+w(tbl)520 b(45)50 5203 y(\014ts)p 177 5203 V 32 w(create)p
+445 5203 V 35 w(template)284 b(82)50 5316 y(\014ts)p
+177 5316 V 32 w(date2str)580 b(54)50 5429 y(\014ts)p
+177 5429 V 32 w(deco)s(de)p 479 5429 V 33 w(c)m(hksum)301
+b(54)50 5541 y(\014ts)p 177 5541 V 32 w(deco)s(de)p 479
+5541 V 33 w(tdim)412 b(47)50 5654 y(\014ts)p 177 5654
+V 32 w(delete)p 441 5654 V 33 w(col)527 b(48)1325 2154
+y(\014ts)p 1452 2154 V 33 w(delete)p 1717 2154 V 33 w(\014le)559
+b(32)1325 2267 y(\014ts)p 1452 2267 V 33 w(delete)p 1717
+2267 V 33 w(hdu)523 b(34)1325 2380 y(\014ts)p 1452 2380
+V 33 w(delete)p 1717 2380 V 33 w(k)m(ey)543 b(39)1325
+2493 y(\014ts)p 1452 2493 V 33 w(delete)p 1717 2493 V
+33 w(record)428 b(39)1325 2606 y(\014ts)p 1452 2606 V
+33 w(delete)p 1717 2606 V 33 w(ro)m(wlist)409 b(48)1325
+2719 y(\014ts)p 1452 2719 V 33 w(delete)p 1717 2719 V
+33 w(ro)m(wrange)315 b(48)1325 2832 y(\014ts)p 1452 2832
+V 33 w(delete)p 1717 2832 V 33 w(ro)m(ws)496 b(48)1325
+2945 y(\014ts)p 1452 2945 V 33 w(enco)s(de)p 1755 2945
+V 33 w(c)m(hksum)339 b(54)1325 3057 y(\014ts)p 1452 3057
+V 33 w(\014le)p 1602 3057 V 32 w(exists)571 b(83)1325
+3170 y(\014ts)p 1452 3170 V 33 w(\014le)p 1602 3170 V
+32 w(mo)s(de)577 b(32)1325 3283 y(\014ts)p 1452 3283
+V 33 w(\014le)p 1602 3283 V 32 w(name)j(32)1325 3396
+y(\014ts)p 1452 3396 V 33 w(\014nd)p 1638 3396 V 31 w(\014rst)p
+1827 3396 V 32 w(ro)m(w)423 b(51)1325 3509 y(\014ts)p
+1452 3509 V 33 w(\014nd)p 1638 3509 V 31 w(nextk)m(ey)450
+b(36)1325 3622 y(\014ts)p 1452 3622 V 33 w(\014nd)p 1638
+3622 V 31 w(ro)m(ws)577 b(51)1325 3735 y(\014ts)p 1452
+3735 V 33 w(\015ush)p 1674 3735 V 31 w(bu\013er)490 b(84)1325
+3848 y(\014ts)p 1452 3848 V 33 w(\015ush)p 1674 3848
+V 31 w(\014le)604 b(84)1325 3961 y(\014ts)p 1452 3961
+V 33 w(get)p 1605 3961 V 34 w(acolparms)387 b(99)1325
+4074 y(\014ts)p 1452 4074 V 33 w(get)p 1605 4074 V 34
+w(b)s(colparms)378 b(99)1325 4187 y(\014ts)p 1452 4187
+V 33 w(get)p 1605 4187 V 34 w(c)m(hksum)488 b(53)1325
+4299 y(\014ts)p 1452 4299 V 33 w(get)p 1605 4299 V 34
+w(col)p 1750 4299 V 32 w(displa)m(y)p 2062 4299 V 31
+w(width)104 b(47)1325 4412 y(\014ts)p 1452 4412 V 33
+w(get)p 1605 4412 V 34 w(colname)464 b(46)1325 4525 y(\014ts)p
+1452 4525 V 33 w(get)p 1605 4525 V 34 w(coln)m(um)501
+b(46)1325 4638 y(\014ts)p 1452 4638 V 33 w(get)p 1605
+4638 V 34 w(colt)m(yp)s(e)h(47)1325 4751 y(\014ts)p 1452
+4751 V 33 w(get)p 1605 4751 V 34 w(compression)p 2121
+4751 V 31 w(t)m(yp)s(e)100 b(43)1325 4864 y(\014ts)p
+1452 4864 V 33 w(get)p 1605 4864 V 34 w(eqcolt)m(yp)s(e)414
+b(47)1325 4977 y(\014ts)p 1452 4977 V 33 w(get)p 1605
+4977 V 34 w(errstatus)437 b(29)1325 5090 y(\014ts)p 1452
+5090 V 33 w(get)p 1605 5090 V 34 w(hdrp)s(os)514 b(86)1325
+5203 y(\014ts)p 1452 5203 V 33 w(get)p 1605 5203 V 34
+w(hdrspace)437 b(35)1325 5316 y(\014ts)p 1452 5316 V
+33 w(get)p 1605 5316 V 34 w(hdu)p 1792 5316 V 31 w(n)m(um)428
+b(33)1325 5429 y(\014ts)p 1452 5429 V 33 w(get)p 1605
+5429 V 34 w(hdu)p 1792 5429 V 31 w(t)m(yp)s(e)h(33)1325
+5541 y(\014ts)p 1452 5541 V 33 w(get)p 1605 5541 V 34
+w(hduaddr)451 b(84)1325 5654 y(\014ts)p 1452 5654 V 33
+w(get)p 1605 5654 V 34 w(hduo\013)536 b(84)2639 2154
+y(\014ts)p 2766 2154 V 33 w(get)p 2919 2154 V 34 w(img)p
+3100 2154 V 32 w(dim)479 b(40)2639 2267 y(\014ts)p 2766
+2267 V 33 w(get)p 2919 2267 V 34 w(img)p 3100 2267 V
+32 w(equivt)m(yp)s(e)245 b(39)2639 2380 y(\014ts)p 2766
+2380 V 33 w(get)p 2919 2380 V 34 w(img)p 3100 2380 V
+32 w(param)379 b(40)2639 2493 y(\014ts)p 2766 2493 V
+33 w(get)p 2919 2493 V 34 w(img)p 3100 2493 V 32 w(size)490
+b(40)2639 2606 y(\014ts)p 2766 2606 V 33 w(get)p 2919
+2606 V 34 w(img)p 3100 2606 V 32 w(t)m(yp)s(e)458 b(39)2639
+2719 y(\014ts)p 2766 2719 V 33 w(get)p 2919 2719 V 34
+w(k)m(eyclass)495 b(58)2639 2832 y(\014ts)p 2766 2832
+V 33 w(get)p 2919 2832 V 34 w(k)m(eyname)466 b(57)2639
+2945 y(\014ts)p 2766 2945 V 33 w(get)p 2919 2945 V 34
+w(k)m(eyt)m(yp)s(e)504 b(57)2639 3057 y(\014ts)p 2766
+3057 V 33 w(get)p 2919 3057 V 34 w(noise)p 3151 3057
+V 32 w(bits)433 b(43)2639 3170 y(\014ts)p 2766 3170 V
+33 w(get)p 2919 3170 V 34 w(n)m(um)p 3128 3170 V 32 w(cols)457
+b(45)2639 3283 y(\014ts)p 2766 3283 V 33 w(get)p 2919
+3283 V 34 w(n)m(um)p 3128 3283 V 32 w(groups)340 b(79)2639
+3396 y(\014ts)p 2766 3396 V 33 w(get)p 2919 3396 V 34
+w(n)m(um)p 3128 3396 V 32 w(hdus)415 b(33)2639 3509 y(\014ts)p
+2766 3509 V 33 w(get)p 2919 3509 V 34 w(n)m(um)p 3128
+3509 V 32 w(mem)m(b)s(ers)249 b(78)2639 3622 y(\014ts)p
+2766 3622 V 33 w(get)p 2919 3622 V 34 w(n)m(um)p 3128
+3622 V 32 w(ro)m(ws)424 b(45)2639 3735 y(\014ts)p 2766
+3735 V 33 w(get)p 2919 3735 V 34 w(ro)m(wsize)525 b(99)2639
+3848 y(\014ts)p 2766 3848 V 33 w(get)p 2919 3848 V 34
+w(system)p 3224 3848 V 33 w(time)330 b(54)2639 3961 y(\014ts)p
+2766 3961 V 33 w(get)p 2919 3961 V 34 w(tile)p 3080 3961
+V 32 w(dim)499 b(43)2639 4074 y(\014ts)p 2766 4074 V
+33 w(get)p 2919 4074 V 34 w(tb)s(col)611 b(59)2639 4187
+y(\014ts)p 2766 4187 V 33 w(get)p 2919 4187 V 34 w(v)m(ersion)532
+b(55)2639 4299 y(\014ts)p 2766 4299 V 33 w(hdr2str)d(37,)31
+b(72)2639 4412 y(\014ts)p 2766 4412 V 33 w(insert)p 3023
+4412 V 31 w(atbl)553 b(85)2639 4525 y(\014ts)p 2766 4525
+V 33 w(insert)p 3023 4525 V 31 w(btbl)547 b(85)2639 4638
+y(\014ts)p 2766 4638 V 33 w(insert)p 3023 4638 V 31 w(col)599
+b(48)2639 4751 y(\014ts)p 2766 4751 V 33 w(insert)p 3023
+4751 V 31 w(cols)563 b(48)2639 4864 y(\014ts)p 2766 4864
+V 33 w(insert)p 3023 4864 V 31 w(group)482 b(76)2639
+4977 y(\014ts)p 2766 4977 V 33 w(insert)p 3023 4977 V
+31 w(img)563 b(85)2639 5090 y(\014ts)p 2766 5090 V 33
+w(insert)p 3023 5090 V 31 w(k)m(ey)p 3187 5090 V 34 w(n)m(ull)392
+b(91)2639 5203 y(\014ts)p 2766 5203 V 33 w(insert)p 3023
+5203 V 31 w(k)m(ey)p 3187 5203 V 34 w(TYP)347 b(90)2639
+5316 y(\014ts)p 2766 5316 V 33 w(insert)p 3023 5316 V
+31 w(record)462 b(90)2639 5429 y(\014ts)p 2766 5429 V
+33 w(insert)p 3023 5429 V 31 w(ro)m(ws)530 b(48)2639
+5541 y(\014ts)p 2766 5541 V 33 w(iterate)p 3056 5541
+V 33 w(data)499 b(69)2639 5654 y(\014ts)p 2766 5654 V
+33 w(mak)m(e)p 3005 5654 V 33 w(k)m(eyn)542 b(57)1882
+5942 y(147)p eop
+%%Page: 148 156
+148 155 bop 0 299 a Fj(148)2084 b Fh(APPENDIX)31 b(A.)61
 b(INDEX)31 b(OF)f(R)m(OUTINES)50 543 y Fj(\014ts)p 177
-543 28 4 v 32 w(n)m(ull)p 360 543 V 31 w(c)m(hec)m(k)748
-b(99)50 656 y(\014ts)p 177 656 V 32 w(op)s(en)p 399 656
-V 32 w(\014le)804 b(68)50 769 y(\014ts)p 177 769 V 32
-w(op)s(en)p 399 769 V 32 w(group)693 b(92)50 882 y(\014ts)p
-177 882 V 32 w(op)s(en)p 399 882 V 32 w(mem)m(b)s(er)602
-b(93)50 995 y(\014ts)p 177 995 V 32 w(op)s(en)p 399 995
-V 32 w(mem\014le)566 b(105)50 1107 y(\014ts)p 177 1107
-V 32 w(parse)p 417 1107 V 33 w(extn)m(um)604 b(70)50
-1220 y(\014ts)p 177 1220 V 32 w(parse)p 417 1220 V 33
-w(input)p 664 1220 V 31 w(url)544 b(70)50 1333 y(\014ts)p
-177 1333 V 32 w(parse)p 417 1333 V 33 w(ro)s(otname)526
-b(70)50 1446 y(\014ts)p 177 1446 V 32 w(parse)p 417 1446
-V 33 w(template)508 b(101)50 1559 y(\014ts)p 177 1559
-V 32 w(parse)p 417 1559 V 33 w(v)-5 b(alue)697 b(99)50
-1672 y(\014ts)p 177 1672 V 32 w(pix)p 334 1672 V 32 w(to)p
-446 1672 V 33 w(w)m(orld)652 b(87)50 1785 y(\014ts)p
-177 1785 V 32 w(read)p 381 1785 V 33 w(2d)p 510 1785
-V 33 w(TYP)567 b(122)50 1898 y(\014ts)p 177 1898 V 32
-w(read)p 381 1898 V 33 w(3d)p 510 1898 V 33 w(TYP)g(122)50
-2011 y(\014ts)p 177 2011 V 32 w(read)p 381 2011 V 33
-w(atblhdr)597 b(110)50 2124 y(\014ts)p 177 2124 V 32
-w(read)p 381 2124 V 33 w(btblhdr)591 b(110)50 2237 y(\014ts)p
-177 2237 V 32 w(read)p 381 2237 V 33 w(card)766 b(75)50
-2349 y(\014ts)p 177 2349 V 32 w(read)p 381 2349 V 33
-w(col)827 b(85)50 2462 y(\014ts)p 177 2462 V 32 w(read)p
-381 2462 V 33 w(col)p 525 2462 V 33 w(bit)p 670 2462
-V 636 w(128)50 2575 y(\014ts)p 177 2575 V 32 w(read)p
-381 2575 V 33 w(col)p 525 2575 V 33 w(TYP)552 b(126)50
-2688 y(\014ts)p 177 2688 V 32 w(read)p 381 2688 V 33
-w(coln)m(ull)676 b(85)50 2801 y(\014ts)p 177 2801 V 32
-w(read)p 381 2801 V 33 w(coln)m(ull)p 676 2801 V 31 w(TYP)403
-b(126)50 2914 y(\014ts)p 177 2914 V 32 w(read)p 381 2914
-V 33 w(descript)577 b(128)50 3027 y(\014ts)p 177 3027
-V 32 w(read)p 381 3027 V 33 w(descripts)541 b(128)50
-3140 y(\014ts)p 177 3140 V 32 w(read)p 381 3140 V 33
-w(errmsg)669 b(68)50 3253 y(\014ts)p 177 3253 V 32 w(read)p
-381 3253 V 33 w(grppar)p 678 3253 V 32 w(TYP)400 b(122)50
-3366 y(\014ts)p 177 3366 V 32 w(read)p 381 3366 V 33
-w(img)745 b(121)50 3479 y(\014ts)p 177 3479 V 32 w(read)p
-381 3479 V 33 w(img)p 561 3479 V 32 w(co)s(ord)539 b(86)50
+543 28 4 v 32 w(mak)m(e)p 415 543 V 34 w(nk)m(ey)450
+b(57)50 656 y(\014ts)p 177 656 V 32 w(merge)p 446 656
+V 34 w(groups)339 b(77)50 769 y(\014ts)p 177 769 V 32
+w(mo)s(dify)p 486 769 V 31 w(card)394 b(92)50 882 y(\014ts)p
+177 882 V 32 w(mo)s(dify)p 486 882 V 31 w(commen)m(t)206
+b(38)50 995 y(\014ts)p 177 995 V 32 w(mo)s(dify)p 486
+995 V 31 w(k)m(ey)p 650 995 V 34 w(n)m(ull)248 b(93)50
+1107 y(\014ts)p 177 1107 V 32 w(mo)s(dify)p 486 1107
+V 31 w(k)m(ey)p 650 1107 V 34 w(TYP)203 b(93)50 1220
+y(\014ts)p 177 1220 V 32 w(mo)s(dify)p 486 1220 V 31
+w(name)354 b(38)50 1333 y(\014ts)p 177 1333 V 32 w(mo)s(dify)p
+486 1333 V 31 w(record)318 b(92)50 1446 y(\014ts)p 177
+1446 V 32 w(mo)s(dify)p 486 1446 V 31 w(v)m(ector)p 758
+1446 V 35 w(len)173 b(49)50 1559 y(\014ts)p 177 1559
+V 32 w(mo)m(v)-5 b(abs)p 502 1559 V 33 w(hdu)395 b(33)50
+1672 y(\014ts)p 177 1672 V 32 w(mo)m(vnam)p 547 1672
+V 33 w(hdu)350 b(33)50 1785 y(\014ts)p 177 1785 V 32
+w(mo)m(vrel)p 477 1785 V 33 w(hdu)420 b(33)50 1898 y(\014ts)p
+177 1898 V 32 w(n)m(ull)p 360 1898 V 31 w(c)m(hec)m(k)479
+b(57)50 2011 y(\014ts)p 177 2011 V 32 w(op)s(en)p 399
+2011 V 32 w(data)d(30)50 2124 y(\014ts)p 177 2124 V 32
+w(op)s(en)p 399 2124 V 32 w(\014le)535 b(30)50 2237 y(\014ts)p
+177 2237 V 32 w(op)s(en)p 399 2237 V 32 w(image)420 b(30)50
+2349 y(\014ts)p 177 2349 V 32 w(op)s(en)p 399 2349 V
+32 w(table)455 b(30)50 2462 y(\014ts)p 177 2462 V 32
+w(op)s(en)p 399 2462 V 32 w(group)424 b(78)50 2575 y(\014ts)p
+177 2575 V 32 w(op)s(en)p 399 2575 V 32 w(mem)m(b)s(er)333
+b(79)50 2688 y(\014ts)p 177 2688 V 32 w(op)s(en)p 399
+2688 V 32 w(mem\014le)343 b(81)50 2801 y(\014ts)p 177
+2801 V 32 w(parse)p 417 2801 V 33 w(extn)m(um)335 b(83)50
+2914 y(\014ts)p 177 2914 V 32 w(parse)p 417 2914 V 33
+w(input)p 664 2914 V 31 w(url)275 b(82)50 3027 y(\014ts)p
+177 3027 V 32 w(parse)p 417 3027 V 33 w(range)416 b(61)50
+3140 y(\014ts)p 177 3140 V 32 w(parse)p 417 3140 V 33
+w(ro)s(otname)257 b(83)50 3253 y(\014ts)p 177 3253 V
+32 w(parse)p 417 3253 V 33 w(template)285 b(59)50 3366
+y(\014ts)p 177 3366 V 32 w(parse)p 417 3366 V 33 w(v)-5
+b(alue)428 b(57)50 3479 y(\014ts)p 177 3479 V 32 w(pix)p
+334 3479 V 32 w(to)p 446 3479 V 33 w(w)m(orld)383 b(73)50
 3591 y(\014ts)p 177 3591 V 32 w(read)p 381 3591 V 33
-w(img)p 561 3591 V 32 w(TYP)517 b(121)50 3704 y(\014ts)p
-177 3704 V 32 w(read)p 381 3704 V 33 w(imghdr)607 b(110)50
-3817 y(\014ts)p 177 3817 V 32 w(read)p 381 3817 V 33
-w(imgn)m(ull)594 b(121)50 3930 y(\014ts)p 177 3930 V
-32 w(read)p 381 3930 V 33 w(imgn)m(ull)p 712 3930 V 30
-w(TYP)368 b(122)50 4043 y(\014ts)p 177 4043 V 32 w(read)p
-381 4043 V 33 w(k)m(ey)805 b(75)50 4156 y(\014ts)p 177
-4156 V 32 w(read)p 381 4156 V 33 w(k)m(ey)p 547 4156
-V 34 w(longstr)451 b(114)50 4269 y(\014ts)p 177 4269
-V 32 w(read)p 381 4269 V 33 w(k)m(ey)p 547 4269 V 34
-w(triple)511 b(115)50 4382 y(\014ts)p 177 4382 V 32 w(read)p
-381 4382 V 33 w(k)m(ey)p 547 4382 V 34 w(unit)608 b(76)50
-4495 y(\014ts)p 177 4495 V 32 w(read)p 381 4495 V 33
-w(k)m(ey)p 547 4495 V 34 w(TYP)529 b(114)50 4608 y(\014ts)p
-177 4608 V 32 w(read)p 381 4608 V 33 w(k)m(eyn)708 b(114)50
-4721 y(\014ts)p 177 4721 V 32 w(read)p 381 4721 V 33
-w(k)m(eys)p 583 4721 V 33 w(TYP)494 b(115)50 4833 y(\014ts)p
-177 4833 V 32 w(read)p 381 4833 V 33 w(k)m(eyw)m(ord)564
-b(114)50 4946 y(\014ts)p 177 4946 V 32 w(read)p 381 4946
-V 33 w(pix)813 b(79)50 5059 y(\014ts)p 177 5059 V 32
-w(read)p 381 5059 V 33 w(pixn)m(ull)662 b(80)50 5172
-y(\014ts)p 177 5172 V 32 w(read)p 381 5172 V 33 w(record)690
-b(75)50 5285 y(\014ts)p 177 5285 V 32 w(read)p 381 5285
-V 33 w(subset)p 663 5285 V 32 w(TYP)248 b(122)32 b(127)50
-5398 y(\014ts)p 177 5398 V 32 w(read)p 381 5398 V 33
-w(subsetn)m(ull)p 814 5398 V 30 w(TYP)99 b(123)32 b(127)50
-5511 y(\014ts)p 177 5511 V 32 w(read)p 381 5511 V 33
-w(tbl)p 526 5511 V 32 w(co)s(ord)574 b(87)50 5624 y(\014ts)p
-177 5624 V 32 w(read)p 381 5624 V 33 w(tblb)m(ytes)f(124)1557
-543 y(\014ts)p 1684 543 V 33 w(read)p 1889 543 V 32 w(tdim)476
-b(82)1557 656 y(\014ts)p 1684 656 V 33 w(remo)m(v)m(e)p
-1996 656 V 34 w(group)327 b(91)1557 769 y(\014ts)p 1684
-769 V 33 w(remo)m(v)m(e)p 1996 769 V 34 w(mem)m(b)s(er)236
-b(94)1557 882 y(\014ts)p 1684 882 V 33 w(reop)s(en)p
-1983 882 V 32 w(\014le)453 b(69)1557 995 y(\014ts)p 1684
-995 V 33 w(rep)s(ort)p 1963 995 V 32 w(error)397 b(68)1557
-1107 y(\014ts)p 1684 1107 V 33 w(resize)p 1935 1107 V
-32 w(img)426 b(107)1557 1220 y(\014ts)p 1684 1220 V 33
-w(select)p 1934 1220 V 33 w(ro)m(ws)438 b(94)1557 1333
-y(\014ts)p 1684 1333 V 33 w(set)p 1828 1333 V 33 w(atbln)m(ull)371
-b(118)1557 1446 y(\014ts)p 1684 1446 V 33 w(set)p 1828
-1446 V 33 w(bscale)441 b(117)1557 1559 y(\014ts)p 1684
-1559 V 33 w(set)p 1828 1559 V 33 w(btbln)m(ull)365 b(118)1557
-1672 y(\014ts)p 1684 1672 V 33 w(set)p 1828 1672 V 33
-w(hdrsize)399 b(108)1557 1785 y(\014ts)p 1684 1785 V
-33 w(set)p 1828 1785 V 33 w(hdustruc)328 b(108)1557 1898
-y(\014ts)p 1684 1898 V 33 w(set)p 1828 1898 V 33 w(imgn)m(ull)381
-b(118)1557 2011 y(\014ts)p 1684 2011 V 33 w(set)p 1828
-2011 V 33 w(tscale)457 b(118)1557 2124 y(\014ts)p 1684
-2124 V 33 w(str2date)545 b(97)1557 2237 y(\014ts)p 1684
-2237 V 33 w(str2time)539 b(97)1557 2349 y(\014ts)p 1684
-2349 V 33 w(test)p 1863 2349 V 33 w(expr)514 b(95)1557
-2462 y(\014ts)p 1684 2462 V 33 w(test)p 1863 2462 V 33
-w(k)m(eyw)m(ord)361 b(98)1557 2575 y(\014ts)p 1684 2575
-V 33 w(test)p 1863 2575 V 33 w(record)441 b(99)1557 2688
-y(\014ts)p 1684 2688 V 33 w(time2str)539 b(97)1557 2801
-y(\014ts)p 1684 2801 V 33 w(transfer)p 2024 2801 V 32
-w(mem)m(b)s(er)210 b(93)1557 2914 y(\014ts)p 1684 2914
-V 33 w(up)s(date)p 1993 2914 V 32 w(card)388 b(74)1557
-3027 y(\014ts)p 1684 3027 V 33 w(up)s(date)p 1993 3027
-V 32 w(c)m(hksum)261 b(96)1557 3140 y(\014ts)p 1684 3140
-V 33 w(up)s(date)p 1993 3140 V 32 w(k)m(ey)427 b(73)1557
-3253 y(\014ts)p 1684 3253 V 33 w(up)s(date)p 1993 3253
-V 32 w(k)m(ey)p 2158 3253 V 33 w(n)m(ull)243 b(74)1557
-3366 y(\014ts)p 1684 3366 V 33 w(up)s(date)p 1993 3366
-V 32 w(k)m(ey)p 2158 3366 V 33 w(TYP)153 b(117)1557 3479
-y(\014ts)p 1684 3479 V 33 w(upp)s(ercase)475 b(98)1557
-3591 y(\014ts)p 1684 3591 V 33 w(url)p 1830 3591 V 31
-w(t)m(yp)s(e)550 b(70)1557 3704 y(\014ts)p 1684 3704
-V 33 w(v)m(erify)p 1940 3704 V 32 w(c)m(hksum)314 b(96)1557
-3817 y(\014ts)p 1684 3817 V 33 w(v)m(erify)p 1940 3817
-V 32 w(group)385 b(92)1557 3930 y(\014ts)p 1684 3930
-V 33 w(w)m(orld)p 1938 3930 V 31 w(to)p 2049 3930 V 34
-w(pix)377 b(87)1557 4043 y(\014ts)p 1684 4043 V 33 w(write)p
-1920 4043 V 32 w(2d)p 2048 4043 V 32 w(TYP)264 b(121)1557
-4156 y(\014ts)p 1684 4156 V 33 w(write)p 1920 4156 V
-32 w(3d)p 2048 4156 V 32 w(TYP)g(121)1557 4269 y(\014ts)p
-1684 4269 V 33 w(write)p 1920 4269 V 32 w(atblhdr)293
-b(109)1557 4382 y(\014ts)p 1684 4382 V 33 w(write)p 1920
-4382 V 32 w(btblhdr)287 b(110)1557 4495 y(\014ts)p 1684
-4495 V 33 w(write)p 1920 4495 V 32 w(c)m(hksum)334 b(96)1557
-4608 y(\014ts)p 1684 4608 V 33 w(write)p 1920 4608 V
-32 w(col)522 b(84)1557 4721 y(\014ts)p 1684 4721 V 33
-w(write)p 1920 4721 V 32 w(col)p 2063 4721 V 33 w(bit)332
-b(125)1557 4833 y(\014ts)p 1684 4833 V 33 w(write)p 1920
-4833 V 32 w(col)p 2063 4833 V 33 w(TYP)248 b(124)1557
-4946 y(\014ts)p 1684 4946 V 33 w(write)p 1920 4946 V
-32 w(coln)m(ull)371 b(84)1557 5059 y(\014ts)p 1684 5059
-V 33 w(write)p 1920 5059 V 32 w(coln)m(ull)p 2214 5059
-V 31 w(TYP)99 b(125)1557 5172 y(\014ts)p 1684 5172 V
-33 w(write)p 1920 5172 V 32 w(commen)m(t)273 b(74)1557
-5285 y(\014ts)p 1684 5285 V 33 w(write)p 1920 5285 V
-32 w(date)462 b(74)1557 5398 y(\014ts)p 1684 5398 V 33
-w(write)p 1920 5398 V 32 w(descript)273 b(125)1557 5511
-y(\014ts)p 1684 5511 V 33 w(write)p 1920 5511 V 32 w(errmsg)364
-b(68)1557 5624 y(\014ts)p 1684 5624 V 33 w(write)p 1920
-5624 V 32 w(grphdr)318 b(109)2791 1728 y(\014ts)p 2918
-1728 V 33 w(write)p 3154 1728 V 32 w(grppar)p 3450 1728
-V 31 w(TYP)136 b(120)2791 1841 y(\014ts)p 2918 1841 V
-33 w(write)p 3154 1841 V 32 w(history)396 b(74)2791 1954
-y(\014ts)p 2918 1954 V 33 w(write)p 3154 1954 V 32 w(img)480
-b(119)2791 2067 y(\014ts)p 2918 2067 V 33 w(write)p 3154
-2067 V 32 w(img)p 3333 2067 V 32 w(n)m(ull)297 b(120)2791
-2180 y(\014ts)p 2918 2180 V 33 w(write)p 3154 2180 V
-32 w(img)p 3333 2180 V 32 w(TYP)252 b(120)2791 2293 y(\014ts)p
-2918 2293 V 33 w(write)p 3154 2293 V 32 w(imghdr)342
-b(109)2791 2406 y(\014ts)p 2918 2406 V 33 w(write)p 3154
-2406 V 32 w(imgn)m(ull)329 b(120)2791 2519 y(\014ts)p
-2918 2519 V 33 w(write)p 3154 2519 V 32 w(imgn)m(ull)p
-3484 2519 V 30 w(TYP)103 b(120)2791 2632 y(\014ts)p 2918
-2632 V 33 w(write)p 3154 2632 V 32 w(k)m(ey)540 b(73)2791
-2745 y(\014ts)p 2918 2745 V 33 w(write)p 3154 2745 V
-32 w(k)m(ey)p 3319 2745 V 33 w(longstr)187 b(111)2791
-2858 y(\014ts)p 2918 2858 V 33 w(write)p 3154 2858 V
-32 w(k)m(ey)p 3319 2858 V 33 w(longw)m(arn)99 b(111)2791
-2970 y(\014ts)p 2918 2970 V 33 w(write)p 3154 2970 V
-32 w(k)m(ey)p 3319 2970 V 33 w(n)m(ull)310 b(110)2791
-3083 y(\014ts)p 2918 3083 V 33 w(write)p 3154 3083 V
-32 w(k)m(ey)p 3319 3083 V 33 w(template)113 b(112)2791
-3196 y(\014ts)p 2918 3196 V 33 w(write)p 3154 3196 V
-32 w(k)m(ey)p 3319 3196 V 33 w(triple)247 b(112)2791
-3309 y(\014ts)p 2918 3309 V 33 w(write)p 3154 3309 V
-32 w(k)m(ey)p 3319 3309 V 33 w(unit)344 b(75)2791 3422
-y(\014ts)p 2918 3422 V 33 w(write)p 3154 3422 V 32 w(k)m(ey)p
-3319 3422 V 33 w(TYP)265 b(111)2791 3535 y(\014ts)p 2918
-3535 V 33 w(write)p 3154 3535 V 32 w(k)m(eys)p 3355 3535
-V 33 w(TYP)229 b(112)2791 3648 y(\014ts)p 2918 3648 V
-33 w(write)p 3154 3648 V 32 w(n)m(ull)p 3337 3648 V 30
-w(img)345 b(79)2791 3761 y(\014ts)p 2918 3761 V 33 w(write)p
-3154 3761 V 32 w(pix)548 b(78)2791 3874 y(\014ts)p 2918
-3874 V 33 w(write)p 3154 3874 V 32 w(pixn)m(ull)397 b(79)2791
-3987 y(\014ts)p 2918 3987 V 33 w(write)p 3154 3987 V
-32 w(record)425 b(74)2791 4100 y(\014ts)p 2918 4100 V
-33 w(write)p 3154 4100 V 32 w(subset)p 3435 4100 V 32
-w(TYP)150 b(121)2791 4212 y(\014ts)p 2918 4212 V 33 w(write)p
-3154 4212 V 32 w(tblb)m(ytes)308 b(124)2791 4325 y(\014ts)p
-2918 4325 V 33 w(write)p 3154 4325 V 32 w(tdim)485 b(81)2791
-4438 y(\014ts)p 2918 4438 V 33 w(write)p 3154 4438 V
-32 w(theap)405 b(124)p eop
-%%Page: 131 137
-131 136 bop 3764 299 a Fj(131)50 543 y(\013asfm)230 b(101)50
-656 y(\013bnfm)209 b(101)50 769 y(\013calc)310 b(95)50
-882 y(\013calc)p 259 882 28 4 v 33 w(rng)145 b(95)50
-995 y(\013clos)314 b(69)50 1107 y(\013cmps)258 b(98)50
-1220 y(\013cmsg)264 b(68)50 1333 y(\013cop)m(y)280 b(72)50
-1446 y(\013cp)s(cl)301 b(83)50 1559 y(\013cp)s(dt)235
-b(108)50 1672 y(\013cphd)222 b(108)50 1785 y(\013cpky)228
-b(112)50 1898 y(\013crhd)237 b(107)50 2011 y(\013crim)283
-b(72)50 2124 y(\013cro)m(w)277 b(94)50 2237 y(\013crtb)299
-b(72)50 2349 y(\013dcol)g(83)50 2462 y(\013delt)309 b(69)50
-2575 y(\013dhdu)257 b(72)50 2688 y(\013dk)m(ey)277 b(76)50
-2801 y(\013drec)294 b(76)50 2914 y(\013dro)m(w)266 b(82)50
-3027 y(\013drws)272 b(82)50 3140 y(\013dsum)247 b(97)50
-3253 y(\013dt2s)294 b(97)50 3366 y(\013dtdm)248 b(82)50
-3479 y(\013dt)m(yp)233 b(100)50 3591 y(\013esum)258 b(96)50
-3704 y(\013extn)287 b(70)50 3817 y(\013\013rw)306 b(94)50
-3930 y(\013\015md)283 b(70)50 4043 y(\013\015nm)g(69)50
-4156 y(\013\015us)277 b(106)50 4269 y(\013fro)m(w)289
-b(94)50 4382 y(\013g2d)p 249 4382 V 274 w(122)50 4495
-y(\013g3d)p 249 4495 V 274 w(122)50 4608 y(\013gab)s(c)231
-b(101)50 4721 y(\013gacl)259 b(123)50 4833 y(\013gb)s(cl)250
-b(123)50 4946 y(\013gcdw)259 b(81)50 5059 y(\013gcf)348
-b(85)50 5172 y(\013gcf)p 221 5172 V 302 w(126)50 5285
-y(\013gc)m(ks)295 b(96)50 5398 y(\013gcnn)274 b(80)50
-5511 y(\013gcno)280 b(80)50 5624 y(\013gcrd)289 b(75)785
-543 y(\013gcv)244 b(85)785 656 y(\013gcv)p 976 656 V
-199 w(126)785 769 y(\013gcx)199 b(128)785 882 y(\013gdes)160
-b(128)785 995 y(\013gdess)124 b(128)785 1107 y(\013gerr)220
-b(68)785 1220 y(\013ggp)p 984 1220 V 191 w(122)785 1333
-y(\013ghad)140 b(106)785 1446 y(\013gh)m(bn)d(110)785
-1559 y(\013ghdn)179 b(71)785 1672 y(\013ghdt)195 b(71)785
-1785 y(\013ghof)163 b(106)785 1898 y(\013ghpr)149 b(110)785
-2011 y(\013ghps)g(109)785 2124 y(\013ghsp)194 b(73)785
-2237 y(\013gh)m(tb)153 b(110)785 2349 y(\013gics)230
-b(86)785 2462 y(\013gidm)179 b(78)785 2575 y(\013gidt)220
-b(78)785 2688 y(\013gipr)f(78)785 2801 y(\013gisz)230
-b(78)785 2914 y(\013gk)m(cl)176 b(100)785 3027 y(\013gk)m(ey)154
-b(114)785 3140 y(\013gkls)177 b(114)785 3253 y(\013gkn)p
-987 3253 V 188 w(115)785 3366 y(\013gknm)157 b(99)785
-3479 y(\013gky)236 b(75)785 3591 y(\013gkyn)140 b(114)785
-3704 y(\013gkyt)156 b(115)785 3817 y(\013gky)p 984 3817
-V 191 w(114)785 3930 y(\013gmcp)165 b(93)785 4043 y(\013gmng)160
-b(93)785 4156 y(\013gmop)g(93)785 4269 y(\013gmrm)144
-b(94)785 4382 y(\013gmsg)175 b(68)785 4495 y(\013gm)m(tf)196
-b(93)785 4608 y(\013gncl)215 b(80)785 4721 y(\013gnrw)179
-b(80)785 4833 y(\013gnxk)140 b(114)785 4946 y(\013gpf)208
-b(121)785 5059 y(\013gpf)p 967 5059 V 208 w(122)785 5172
-y(\013gp)m(v)191 b(121)785 5285 y(\013gp)m(v)p 984 5285
-V 191 w(121)785 5398 y(\013gp)m(xv)d(79)785 5511 y(\013gp)m(xf)208
-b(80)785 5624 y(\013grec)216 b(75)1436 543 y(\013grsz)357
-b(123)1436 656 y(\013gsdt)392 b(97)1436 769 y(\013gsf)p
-1603 769 V 238 w(123)32 b(127)1436 882 y(\013gstm)367
-b(97)1436 995 y(\013gsv)p 1623 995 V 218 w(122)32 b(127)1436
-1107 y(\013gtam)358 b(92)1436 1220 y(\013gtbb)332 b(124)1436
-1333 y(\013gtc)m(h)391 b(91)1436 1446 y(\013gtcl)413
-b(81)1436 1559 y(\013gtcm)363 b(92)1436 1672 y(\013gtcp)388
-b(91)1436 1785 y(\013gtcr)403 b(90)1436 1898 y(\013gtcs)g(87)1436
-2011 y(\013gtdm)352 b(82)1436 2124 y(\013gthd)332 b(101)1436
-2237 y(\013gtis)417 b(90)1436 2349 y(\013gtmg)358 b(91)1436
-2462 y(\013gtnm)352 b(93)1436 2575 y(\013gtop)383 b(92)1436
-2688 y(\013gtrm)367 b(91)1436 2801 y(\013gtvf)403 b(92)1436
-2914 y(\013gun)m(t)380 b(76)1436 3027 y(\013hdef)344
-b(108)1436 3140 y(\016bin)363 b(107)1436 3253 y(\016cls)434
-b(83)1436 3366 y(\016col)425 b(83)1436 3479 y(\016img)344
-b(107)1436 3591 y(\016kls)381 b(113)1436 3704 y(\016kyu)344
-b(113)1436 3817 y(\016ky)p 1613 3817 V 395 w(113)1436
-3930 y(\016mem)299 b(106)1436 4043 y(\016nit)424 b(69)1436
-4156 y(\016rec)375 b(113)1436 4269 y(\016ro)m(w)392 b(82)1436
-4382 y(\016tab)360 b(107)1436 4495 y(\016ter)425 b(77)1436
-4608 y(\016url)e(70)1436 4721 y(\013k)m(eyn)375 b(99)1436
-4833 y(\013mahd)336 b(71)1436 4946 y(\013mcom)322 b(75)1436
-5059 y(\013mcrd)311 b(116)1436 5172 y(\013mkls)328 b(116)1436
-5285 y(\013mkyu)291 b(116)1436 5398 y(\013mky)p 1666
-5398 V 342 w(116)1436 5511 y(\013mnam)311 b(75)1436 5624
-y(\013mnhd)330 b(71)2269 543 y(\013mrec)145 b(115)2269
-656 y(\013mrhd)169 b(71)2269 769 y(\013m)m(v)m(ec)185
-b(83)2269 882 y(\013nc)m(hk)196 b(99)2269 995 y(\013nk)m(ey)j(99)2269
-1107 y(\013omem)100 b(105)2269 1220 y(\013op)s(en)193
-b(68)2269 1333 y(\013p2d)p 2474 1333 V 190 w(121)2269
-1446 y(\013p3d)p 2474 1446 V 190 w(121)2269 1559 y(\013p)s(c)m(ks)208
-b(96)2269 1672 y(\013p)s(cl)263 b(84)2269 1785 y(\013p)s(cls)181
-b(124)2269 1898 y(\013p)s(cl)p 2447 1898 V 217 w(125)2269
-2011 y(\013p)s(cn)238 b(84)2269 2124 y(\013p)s(cn)p 2472
-2124 V 192 w(125)2269 2237 y(\013p)s(com)168 b(74)2269
-2349 y(\013p)s(dat)198 b(74)2269 2462 y(\013p)s(des)156
-b(125)2269 2575 y(\013pgp)p 2474 2575 V 190 w(120)2269
-2688 y(\013ph)m(bn)136 b(110)2269 2801 y(\013phis)219
-b(74)2269 2914 y(\013phpr)148 b(109)2269 3027 y(\013phps)g(109)2269
-3140 y(\013ph)m(tb)k(109)2269 3253 y(\013pkls)176 b(111)2269
-3366 y(\013pkn)p 2477 3366 V 187 w(112)2269 3479 y(\013pktp)152
-b(112)2269 3591 y(\013pky)236 b(73)2269 3704 y(\013pkyt)155
-b(112)2269 3817 y(\013pkyu)139 b(110)2269 3930 y(\013pky)p
-2474 3930 V 190 w(111)2269 4043 y(\013plsw)158 b(111)2269
-4156 y(\013pmsg)175 b(68)2269 4269 y(\013pn)m(ul)161
-b(118)2269 4382 y(\013ppn)184 b(120)2269 4495 y(\013ppn)p
-2480 4495 V 184 w(120)2269 4608 y(\013ppr)199 b(119)2269
-4721 y(\013pprn)194 b(79)2269 4833 y(\013ppru)148 b(120)2269
-4946 y(\013ppr)p 2465 4946 V 199 w(120)2269 5059 y(\013pp)m(x)236
-b(78)2269 5172 y(\013pp)m(xn)185 b(79)2269 5285 y(\013prec)216
-b(74)2269 5398 y(\013pscl)184 b(117)2269 5511 y(\013pss)p
-2450 5511 V 214 w(121)2269 5624 y(\013psv)m(c)211 b(99)2926
-1277 y(\013ptbb)177 b(124)2926 1390 y(\013ptdm)197 b(81)2926
-1503 y(\013pthp)177 b(124)2926 1616 y(\013pun)m(t)225
-b(75)2926 1728 y(\013rdef)210 b(108)2926 1841 y(\013reop)s(en)144
-b(69)2926 1954 y(\013rprt)252 b(68)2926 2067 y(\013rsim)191
-b(107)2926 2180 y(\013rtnm)212 b(70)2926 2293 y(\013s2dt)243
-b(97)2926 2406 y(\013s2tm)218 b(97)2926 2519 y(\013sn)m(ul)204
-b(118)2926 2632 y(\013sro)m(w)230 b(94)2926 2745 y(\013texp)236
-b(95)2926 2858 y(\013thdu)222 b(72)2926 2970 y(\013tk)m(ey)242
-b(98)2926 3083 y(\013tm2s)218 b(97)2926 3196 y(\013tn)m(ul)205
-b(118)2926 3309 y(\013tplt)263 b(69)2926 3422 y(\013trec)c(99)2926
-3535 y(\013tscl)228 b(118)2926 3648 y(\013ucrd)k(74)2926
-3761 y(\013ukls)204 b(117)2926 3874 y(\013uky)263 b(73)2926
-3987 y(\013ukyu)212 b(74)2926 4100 y(\013uky)p 3131 4100
-V 218 w(117)2926 4212 y(\013up)s(c)m(h)217 b(98)2926
-4325 y(\013up)s(c)m(k)j(96)2926 4438 y(\013urlt)262 b(70)2926
-4551 y(\013v)m(c)m(ks)244 b(96)2926 4664 y(\013v)m(ers)253
-b(67)2926 4777 y(\013wldp)216 b(87)2926 4890 y(\013xyp)m(x)i(87)p
-eop
-%%Page: 132 138
-132 137 bop 0 299 a Fj(132)2084 b Fh(APPENDIX)31 b(A.)61
+w(2d)p 510 3591 V 33 w(TYP)344 b(98)50 3704 y(\014ts)p
+177 3704 V 32 w(read)p 381 3704 V 33 w(3d)p 510 3704
+V 33 w(TYP)g(98)50 3817 y(\014ts)p 177 3817 V 32 w(read)p
+381 3817 V 33 w(atblhdr)374 b(87)50 3930 y(\014ts)p 177
+3930 V 32 w(read)p 381 3930 V 33 w(btblhdr)368 b(87)50
+4043 y(\014ts)p 177 4043 V 32 w(read)p 381 4043 V 33
+w(card)497 b(35)50 4156 y(\014ts)p 177 4156 V 32 w(read)p
+381 4156 V 33 w(col)558 b(51)50 4269 y(\014ts)p 177 4269
+V 32 w(read)p 381 4269 V 33 w(col)p 525 4269 V 33 w(bit)p
+670 4269 V 367 w(104)50 4382 y(\014ts)p 177 4382 V 32
+w(read)p 381 4382 V 33 w(col)p 525 4382 V 33 w(TYP)283
+b(102)50 4495 y(\014ts)p 177 4495 V 32 w(read)p 381 4495
+V 33 w(coln)m(ull)407 b(51)50 4608 y(\014ts)p 177 4608
+V 32 w(read)p 381 4608 V 33 w(coln)m(ull)p 676 4608 V
+31 w(TYP)134 b(103)50 4721 y(\014ts)p 177 4721 V 32 w(read)p
+381 4721 V 33 w(descript)308 b(104)50 4833 y(\014ts)p
+177 4833 V 32 w(read)p 381 4833 V 33 w(descripts)272
+b(104)50 4946 y(\014ts)p 177 4946 V 32 w(read)p 381 4946
+V 33 w(errmsg)400 b(30)50 5059 y(\014ts)p 177 5059 V
+32 w(read)p 381 5059 V 33 w(grppar)p 678 5059 V 32 w(TYP)177
+b(98)50 5172 y(\014ts)p 177 5172 V 32 w(read)p 381 5172
+V 33 w(img)522 b(97)50 5285 y(\014ts)p 177 5285 V 32
+w(read)p 381 5285 V 33 w(img)p 561 5285 V 32 w(co)s(ord)270
+b(72)50 5398 y(\014ts)p 177 5398 V 32 w(read)p 381 5398
+V 33 w(img)p 561 5398 V 32 w(TYP)294 b(97)50 5511 y(\014ts)p
+177 5511 V 32 w(read)p 381 5511 V 33 w(imghdr)384 b(87)50
+5624 y(\014ts)p 177 5624 V 32 w(read)p 381 5624 V 33
+w(imgn)m(ull)371 b(97)50 5737 y(\014ts)p 177 5737 V 32
+w(read)p 381 5737 V 33 w(imgn)m(ull)p 712 5737 V 30 w(TYP)145
+b(97)1289 543 y(\014ts)p 1416 543 V 32 w(read)p 1620
+543 V 33 w(k)m(ey)761 b(35)1289 656 y(\014ts)p 1416 656
+V 32 w(read)p 1620 656 V 33 w(k)m(ey)p 1786 656 V 33
+w(longstr)454 b(91)1289 769 y(\014ts)p 1416 769 V 32
+w(read)p 1620 769 V 33 w(k)m(ey)p 1786 769 V 33 w(triple)514
+b(92)1289 882 y(\014ts)p 1416 882 V 32 w(read)p 1620
+882 V 33 w(k)m(ey)p 1786 882 V 33 w(unit)565 b(36)1289
+995 y(\014ts)p 1416 995 V 32 w(read)p 1620 995 V 33 w(k)m(ey)p
+1786 995 V 33 w(TYP)532 b(91)1289 1107 y(\014ts)p 1416
+1107 V 32 w(read)p 1620 1107 V 33 w(k)m(eyn)710 b(36)1289
+1220 y(\014ts)p 1416 1220 V 32 w(read)p 1620 1220 V 33
+w(k)m(eys)p 1822 1220 V 33 w(TYP)496 b(92)1289 1333 y(\014ts)p
+1416 1333 V 32 w(read)p 1620 1333 V 33 w(k)m(eyw)m(ord)566
+b(35)1289 1446 y(\014ts)p 1416 1446 V 32 w(read)p 1620
+1446 V 33 w(pix)769 b(41)1289 1559 y(\014ts)p 1416 1559
+V 32 w(read)p 1620 1559 V 33 w(pixn)m(ull)618 b(41)1289
+1672 y(\014ts)p 1416 1672 V 32 w(read)p 1620 1672 V 33
+w(record)646 b(36)1289 1785 y(\014ts)p 1416 1785 V 32
+w(read)p 1620 1785 V 33 w(subset)p 1902 1785 V 32 w(TYP)250
+b(98)31 b(103)1289 1898 y(\014ts)p 1416 1898 V 32 w(read)p
+1620 1898 V 33 w(subsetn)m(ull)p 2053 1898 V 30 w(TYP)101
+b(98)31 b(103)1289 2011 y(\014ts)p 1416 2011 V 32 w(read)p
+1620 2011 V 33 w(tbl)p 1765 2011 V 32 w(co)s(ord)530
+b(72)1289 2124 y(\014ts)p 1416 2124 V 32 w(read)p 1620
+2124 V 33 w(tblb)m(ytes)f(100)1289 2237 y(\014ts)p 1416
+2237 V 32 w(read)p 1620 2237 V 33 w(tdim)706 b(47)1289
+2349 y(\014ts)p 1416 2349 V 32 w(remo)m(v)m(e)p 1727
+2349 V 34 w(group)558 b(77)1289 2462 y(\014ts)p 1416
+2462 V 32 w(remo)m(v)m(e)p 1727 2462 V 34 w(mem)m(b)s(er)467
+b(79)1289 2575 y(\014ts)p 1416 2575 V 32 w(reop)s(en)p
+1714 2575 V 32 w(\014le)684 b(82)1289 2688 y(\014ts)p
+1416 2688 V 32 w(rep)s(ort)p 1694 2688 V 32 w(error)628
+b(30)1289 2801 y(\014ts)p 1416 2801 V 32 w(resize)p 1666
+2801 V 33 w(img)701 b(85)1289 2914 y(\014ts)p 1416 2914
+V 32 w(select)p 1665 2914 V 34 w(ro)m(ws)668 b(51)1289
+3027 y(\014ts)p 1416 3027 V 32 w(set)p 1559 3027 V 33
+w(atbln)m(ull)647 b(95)1289 3140 y(\014ts)p 1416 3140
+V 32 w(set)p 1559 3140 V 33 w(bscale)717 b(94)1289 3253
+y(\014ts)p 1416 3253 V 32 w(set)p 1559 3253 V 33 w(btbln)m(ull)641
+b(95)1289 3366 y(\014ts)p 1416 3366 V 32 w(set)p 1559
+3366 V 33 w(compression)p 2074 3366 V 32 w(t)m(yp)s(e)267
+b(43)1289 3479 y(\014ts)p 1416 3479 V 32 w(set)p 1559
+3479 V 33 w(hdrsize)675 b(86)1289 3591 y(\014ts)p 1416
+3591 V 32 w(set)p 1559 3591 V 33 w(hdustruc)604 b(86)1289
+3704 y(\014ts)p 1416 3704 V 32 w(set)p 1559 3704 V 33
+w(imgn)m(ull)657 b(95)1289 3817 y(\014ts)p 1416 3817
+V 32 w(set)p 1559 3817 V 33 w(noise)p 1790 3817 V 33
+w(bits)576 b(43)1289 3930 y(\014ts)p 1416 3930 V 32 w(set)p
+1559 3930 V 33 w(tile)p 1719 3930 V 32 w(dim)643 b(43)1289
+4043 y(\014ts)p 1416 4043 V 32 w(set)p 1559 4043 V 33
+w(tscale)733 b(94)1289 4156 y(\014ts)p 1416 4156 V 32
+w(split)p 1622 4156 V 31 w(names)646 b(56)1289 4269 y(\014ts)p
+1416 4269 V 32 w(str2date)776 b(54)1289 4382 y(\014ts)p
+1416 4382 V 32 w(str2time)770 b(54)1289 4495 y(\014ts)p
+1416 4495 V 32 w(test)p 1594 4495 V 34 w(expr)744 b(52)1289
+4608 y(\014ts)p 1416 4608 V 32 w(test)p 1594 4608 V 34
+w(heap)686 b(100)1289 4721 y(\014ts)p 1416 4721 V 32
+w(test)p 1594 4721 V 34 w(k)m(eyw)m(ord)591 b(56)1289
+4833 y(\014ts)p 1416 4833 V 32 w(test)p 1594 4833 V 34
+w(record)671 b(56)1289 4946 y(\014ts)p 1416 4946 V 32
+w(time2str)770 b(54)1289 5059 y(\014ts)p 1416 5059 V
+32 w(transfer)p 1755 5059 V 32 w(mem)m(b)s(er)441 b(79)1289
+5172 y(\014ts)p 1416 5172 V 32 w(up)s(date)p 1724 5172
+V 32 w(card)619 b(38)1289 5285 y(\014ts)p 1416 5285 V
+32 w(up)s(date)p 1724 5285 V 32 w(c)m(hksum)492 b(53)1289
+5398 y(\014ts)p 1416 5398 V 32 w(up)s(date)p 1724 5398
+V 32 w(k)m(ey)658 b(37)1289 5511 y(\014ts)p 1416 5511
+V 32 w(up)s(date)p 1724 5511 V 32 w(k)m(ey)p 1889 5511
+V 34 w(n)m(ull)473 b(37)1289 5624 y(\014ts)p 1416 5624
+V 32 w(up)s(date)p 1724 5624 V 32 w(k)m(ey)p 1889 5624
+V 34 w(TYP)428 b(93)1289 5737 y(\014ts)p 1416 5737 V
+32 w(upp)s(ercase)706 b(56)2753 543 y(\014ts)p 2880 543
+V 32 w(url)p 3025 543 V 31 w(t)m(yp)s(e)590 b(32)2753
+656 y(\014ts)p 2880 656 V 32 w(v)m(erify)p 3135 656 V
+32 w(c)m(hksum)354 b(53)2753 769 y(\014ts)p 2880 769
+V 32 w(v)m(erify)p 3135 769 V 32 w(group)425 b(78)2753
+882 y(\014ts)p 2880 882 V 32 w(w)m(orld)p 3133 882 V
+32 w(to)p 3245 882 V 33 w(pix)417 b(73)2753 995 y(\014ts)p
+2880 995 V 32 w(write)p 3115 995 V 32 w(2d)p 3243 995
+V 33 w(TYP)348 b(97)2753 1107 y(\014ts)p 2880 1107 V
+32 w(write)p 3115 1107 V 32 w(3d)p 3243 1107 V 33 w(TYP)g(97)2753
+1220 y(\014ts)p 2880 1220 V 32 w(write)p 3115 1220 V
+32 w(atblhdr)378 b(87)2753 1333 y(\014ts)p 2880 1333
+V 32 w(write)p 3115 1333 V 32 w(btblhdr)372 b(87)2753
+1446 y(\014ts)p 2880 1446 V 32 w(write)p 3115 1446 V
+32 w(c)m(hksum)i(53)2753 1559 y(\014ts)p 2880 1559 V
+32 w(write)p 3115 1559 V 32 w(col)562 b(50)2753 1672
+y(\014ts)p 2880 1672 V 32 w(write)p 3115 1672 V 32 w(col)p
+3258 1672 V 33 w(bit)372 b(101)2753 1785 y(\014ts)p 2880
+1785 V 32 w(write)p 3115 1785 V 32 w(col)p 3258 1785
+V 33 w(TYP)288 b(100)2753 1898 y(\014ts)p 2880 1898 V
+32 w(write)p 3115 1898 V 32 w(col)p 3258 1898 V 33 w(n)m(ull)378
+b(50)2753 2011 y(\014ts)p 2880 2011 V 32 w(write)p 3115
+2011 V 32 w(coln)m(ull)411 b(50)2753 2124 y(\014ts)p
+2880 2124 V 32 w(write)p 3115 2124 V 32 w(coln)m(ull)p
+3409 2124 V 31 w(TYP)139 b(101)2753 2237 y(\014ts)p 2880
+2237 V 32 w(write)p 3115 2237 V 32 w(commen)m(t)313 b(37)2753
+2349 y(\014ts)p 2880 2349 V 32 w(write)p 3115 2349 V
+32 w(date)502 b(38)2753 2462 y(\014ts)p 2880 2462 V 32
+w(write)p 3115 2462 V 32 w(descript)313 b(102)2753 2575
+y(\014ts)p 2880 2575 V 32 w(write)p 3115 2575 V 32 w(errmark)356
+b(30)2753 2688 y(\014ts)p 2880 2688 V 32 w(write)p 3115
+2688 V 32 w(errmsg)404 b(55)2753 2801 y(\014ts)p 2880
+2801 V 32 w(write)p 3115 2801 V 32 w(grphdr)f(87)2753
+2914 y(\014ts)p 2880 2914 V 32 w(write)p 3115 2914 V
+32 w(grppar)p 3411 2914 V 32 w(TYP)181 b(97)2753 3027
+y(\014ts)p 2880 3027 V 32 w(write)p 3115 3027 V 32 w(history)396
+b(37)2753 3140 y(\014ts)p 2880 3140 V 32 w(write)p 3115
+3140 V 32 w(img)526 b(96)2753 3253 y(\014ts)p 2880 3253
+V 32 w(write)p 3115 3253 V 32 w(img)p 3294 3253 V 32
+w(n)m(ull)343 b(97)2753 3366 y(\014ts)p 2880 3366 V 32
+w(write)p 3115 3366 V 32 w(img)p 3294 3366 V 32 w(TYP)298
+b(96)2753 3479 y(\014ts)p 2880 3479 V 32 w(write)p 3115
+3479 V 32 w(imghdr)388 b(87)2753 3591 y(\014ts)p 2880
+3591 V 32 w(write)p 3115 3591 V 32 w(imgn)m(ull)375 b(96)2753
+3704 y(\014ts)p 2880 3704 V 32 w(write)p 3115 3704 V
+32 w(imgn)m(ull)p 3445 3704 V 30 w(TYP)149 b(96)2753
+3817 y(\014ts)p 2880 3817 V 32 w(write)p 3115 3817 V
+32 w(k)m(ey)540 b(37)2753 3930 y(\014ts)p 2880 3930 V
+32 w(write)p 3115 3930 V 32 w(k)m(ey)p 3280 3930 V 34
+w(longstr)232 b(89)2753 4043 y(\014ts)p 2880 4043 V 32
+w(write)p 3115 4043 V 32 w(k)m(ey)p 3280 4043 V 34 w(longw)m(arn)144
+b(89)2753 4156 y(\014ts)p 2880 4156 V 32 w(write)p 3115
+4156 V 32 w(k)m(ey)p 3280 4156 V 34 w(n)m(ull)355 b(37)2753
+4269 y(\014ts)p 2880 4269 V 32 w(write)p 3115 4269 V
+32 w(k)m(ey)p 3280 4269 V 34 w(template)158 b(90)2753
+4382 y(\014ts)p 2880 4382 V 32 w(write)p 3115 4382 V
+32 w(k)m(ey)p 3280 4382 V 34 w(triple)292 b(90)2753 4495
+y(\014ts)p 2880 4495 V 32 w(write)p 3115 4495 V 32 w(k)m(ey)p
+3280 4495 V 34 w(unit)343 b(38)2753 4608 y(\014ts)p 2880
+4608 V 32 w(write)p 3115 4608 V 32 w(k)m(ey)p 3280 4608
+V 34 w(TYP)310 b(88)2753 4721 y(\014ts)p 2880 4721 V
+32 w(write)p 3115 4721 V 32 w(k)m(eys)p 3316 4721 V 33
+w(TYP)275 b(89)2753 4833 y(\014ts)p 2880 4833 V 32 w(write)p
+3115 4833 V 32 w(n)m(ull)p 3298 4833 V 31 w(img)344 b(41)2753
+4946 y(\014ts)p 2880 4946 V 32 w(write)p 3115 4946 V
+32 w(pix)548 b(40)2753 5059 y(\014ts)p 2880 5059 V 32
+w(write)p 3115 5059 V 32 w(pixn)m(ull)397 b(40)2753 5172
+y(\014ts)p 2880 5172 V 32 w(write)p 3115 5172 V 32 w(record)425
+b(38)2753 5285 y(\014ts)p 2880 5285 V 32 w(write)p 3115
+5285 V 32 w(subset)f(40)2753 5398 y(\014ts)p 2880 5398
+V 32 w(write)p 3115 5398 V 32 w(subset)p 3396 5398 V
+32 w(TYP)196 b(97)2753 5511 y(\014ts)p 2880 5511 V 32
+w(write)p 3115 5511 V 32 w(tblb)m(ytes)309 b(100)2753
+5624 y(\014ts)p 2880 5624 V 32 w(write)p 3115 5624 V
+32 w(tdim)485 b(48)2753 5737 y(\014ts)p 2880 5737 V 32
+w(write)p 3115 5737 V 32 w(theap)451 b(99)p eop
+%%Page: 149 157
+149 156 bop 3764 299 a Fj(149)50 543 y(\013asfm)276 b(59)50
+656 y(\013bnfm)255 b(58)50 769 y(\013calc)310 b(52)50
+882 y(\013calc)p 259 882 28 4 v 33 w(rng)145 b(52)50
+995 y(\013clos)314 b(32)50 1107 y(\013cmph)197 b(100)50
+1220 y(\013cmps)258 b(56)50 1333 y(\013cmrk)j(30)50 1446
+y(\013cmsg)j(30)50 1559 y(\013cop)m(y)280 b(34)50 1672
+y(\013cp)s(cl)301 b(49)50 1785 y(\013cp)s(dt)281 b(86)50
+1898 y(\013cp\015)319 b(34)50 2011 y(\013cphd)268 b(34)50
+2124 y(\013cpky)274 b(89)50 2237 y(\013crhd)283 b(84)50
+2349 y(\013crim)g(40)50 2462 y(\013cro)m(w)277 b(52)50
+2575 y(\013crtb)299 b(45)50 2688 y(\013dcol)g(48)50 2801
+y(\013delt)309 b(32)50 2914 y(\013dhdu)257 b(34)50 3027
+y(\013dk)m(ey)277 b(39)50 3140 y(\013dopn)263 b(30)50
+3253 y(\013drec)294 b(39)50 3366 y(\013dro)m(w)266 b(48)50
+3479 y(\013drrg)293 b(48)50 3591 y(\013drws)272 b(48)50
+3704 y(\013dsum)247 b(54)50 3817 y(\013dt2s)294 b(54)50
+3930 y(\013dtdm)248 b(47)50 4043 y(\013dt)m(yp)279 b(57)50
+4156 y(\013eqt)m(y)293 b(47)50 4269 y(\013esum)258 b(54)50
+4382 y(\013exest)k(83)50 4495 y(\013extn)287 b(83)50
+4608 y(\013\013rw)306 b(51)50 4721 y(\013\015md)283 b(32)50
+4833 y(\013\015nm)g(32)50 4946 y(\013\015sh)323 b(84)50
+5059 y(\013\015us)g(84)50 5172 y(\013fro)m(w)289 b(51)50
+5285 y(\013g2d)p 249 5285 V 320 w(98)50 5398 y(\013g3d)p
+249 5398 V 320 w(98)50 5511 y(\013gab)s(c)277 b(59)50
+5624 y(\013gacl)305 b(99)50 5737 y(\013gb)s(cl)296 b(99)785
+543 y(\013gcdw)175 b(47)785 656 y(\013gcf)264 b(51)785
+769 y(\013gcf)p 956 769 V 219 w(103)785 882 y(\013gc)m(ks)211
+b(53)785 995 y(\013gcnn)190 b(46)785 1107 y(\013gcno)196
+b(46)785 1220 y(\013gcrd)205 b(35)785 1333 y(\013gcv)244
+b(51)785 1446 y(\013gcv)p 976 1446 V 199 w(102)785 1559
+y(\013gcx)199 b(104)785 1672 y(\013gdes)160 b(104)785
+1785 y(\013gdess)124 b(104)785 1898 y(\013gerr)220 b(29)785
+2011 y(\013ggp)p 984 2011 V 236 w(98)785 2124 y(\013ghad)185
+b(84)785 2237 y(\013gh)m(bn)d(87)785 2349 y(\013ghdn)d(33)785
+2462 y(\013ghdt)195 b(33)785 2575 y(\013ghof)208 b(84)785
+2688 y(\013ghpr)194 b(87)785 2801 y(\013ghps)g(86)785
+2914 y(\013ghsp)g(35)785 3027 y(\013gh)m(tb)k(87)785
+3140 y(\013gics)230 b(72)785 3253 y(\013gidm)179 b(40)785
+3366 y(\013gidt)220 b(39)785 3479 y(\013giet)231 b(39)785
+3591 y(\013gipr)219 b(40)785 3704 y(\013gisz)230 b(40)785
+3817 y(\013gk)m(cl)221 b(58)785 3930 y(\013gk)m(ey)199
+b(35)785 4043 y(\013gkls)222 b(91)785 4156 y(\013gkn)p
+987 4156 V 233 w(92)785 4269 y(\013gknm)157 b(57)785
+4382 y(\013gky)236 b(35)785 4495 y(\013gkyn)185 b(36)785
+4608 y(\013gkyt)201 b(92)785 4721 y(\013gky)p 984 4721
+V 236 w(91)785 4833 y(\013gmcp)165 b(79)785 4946 y(\013gmng)160
+b(79)785 5059 y(\013gmop)g(79)785 5172 y(\013gmrm)144
+b(79)785 5285 y(\013gmsg)175 b(30)785 5398 y(\013gm)m(tf)196
+b(79)785 5511 y(\013gncl)215 b(45)785 5624 y(\013gnrw)179
+b(45)785 5737 y(\013gnxk)185 b(36)1436 543 y(\013gpf)365
+b(97)1436 656 y(\013gpf)p 1618 656 V 365 w(97)1436 769
+y(\013gp)m(v)348 b(97)1436 882 y(\013gp)m(v)p 1635 882
+V 348 w(97)1436 995 y(\013gp)m(xv)300 b(41)1436 1107
+y(\013gp)m(xf)320 b(41)1436 1220 y(\013grec)328 b(36)1436
+1333 y(\013grsz)k(99)1436 1446 y(\013gsdt)322 b(54)1436
+1559 y(\013gsf)p 1603 1559 V 213 w(98)31 b(103)1436 1672
+y(\013gstm)297 b(54)1436 1785 y(\013gsv)p 1623 1785 V
+193 w(98)31 b(103)1436 1898 y(\013gtam)288 b(78)1436
+2011 y(\013gtbb)261 b(100)1436 2124 y(\013gtc)m(h)321
+b(76)1436 2237 y(\013gtcl)343 b(47)1436 2349 y(\013gtcm)293
+b(77)1436 2462 y(\013gtcp)318 b(77)1436 2575 y(\013gtcr)333
+b(76)1436 2688 y(\013gtcs)g(72)1436 2801 y(\013gtdm)282
+b(47)1436 2914 y(\013gthd)307 b(59)1436 3027 y(\013gtis)347
+b(76)1436 3140 y(\013gtmg)288 b(77)1436 3253 y(\013gtnm)282
+b(78)1436 3366 y(\013gtop)313 b(78)1436 3479 y(\013gtrm)297
+b(77)1436 3591 y(\013gtvf)333 b(78)1436 3704 y(\013gun)m(t)310
+b(36)1436 3817 y(\013hdef)319 b(86)1436 3930 y(\016bin)338
+b(85)1436 4043 y(\016cls)364 b(48)1436 4156 y(\016col)355
+b(48)1436 4269 y(\016img)319 b(85)1436 4382 y(\016kls)356
+b(90)1436 4495 y(\016kyu)319 b(91)1436 4608 y(\016ky)p
+1613 4608 V 370 w(90)1436 4721 y(\016mem)274 b(82)1436
+4833 y(\016nit)354 b(32)1436 4946 y(\016opn)319 b(30)1436
+5059 y(\016rec)350 b(90)1436 5172 y(\016ro)m(w)322 b(48)1436
+5285 y(\016tab)335 b(85)1436 5398 y(\016ter)355 b(69)1436
+5511 y(\016url)e(82)1436 5624 y(\013k)m(eyn)305 b(57)1436
+5737 y(\013mahd)266 b(33)2198 543 y(\013mcom)156 b(38)2198
+656 y(\013mcrd)190 b(92)2198 769 y(\013mkls)207 b(93)2198
+882 y(\013mkyu)170 b(93)2198 995 y(\013mky)p 2428 995
+V 221 w(93)2198 1107 y(\013mnam)145 b(38)2198 1220 y(\013mnhd)164
+b(33)2198 1333 y(\013mrec)201 b(92)2198 1446 y(\013mrhd)179
+b(33)2198 1559 y(\013m)m(v)m(ec)195 b(49)2198 1672 y(\013nc)m(hk)206
+b(57)2198 1785 y(\013nk)m(ey)j(57)2198 1898 y(\013omem)156
+b(81)2198 2011 y(\013op)s(en)203 b(30)2198 2124 y(\013p2d)p
+2403 2124 V 246 w(97)2198 2237 y(\013p3d)p 2403 2237
+V 246 w(97)2198 2349 y(\013p)s(c)m(ks)218 b(53)2198 2462
+y(\013p)s(cl)273 b(50)2198 2575 y(\013p)s(cls)192 b(100)2198
+2688 y(\013p)s(cl)p 2376 2688 V 228 w(101)2198 2801 y(\013p)s(clu)222
+b(50)2198 2914 y(\013p)s(cn)248 b(50)2198 3027 y(\013p)s(cn)p
+2401 3027 V 203 w(101)2198 3140 y(\013p)s(com)178 b(37)2198
+3253 y(\013p)s(dat)208 b(38)2198 3366 y(\013p)s(des)167
+b(102)2198 3479 y(\013pgp)p 2403 3479 V 246 w(97)2198
+3591 y(\013ph)m(bn)192 b(87)2198 3704 y(\013phis)229
+b(37)2198 3817 y(\013phpr)204 b(87)2198 3930 y(\013phps)g(87)2198
+4043 y(\013ph)m(tb)k(87)2198 4156 y(\013pkls)232 b(89)2198
+4269 y(\013pkn)p 2406 4269 V 243 w(89)2198 4382 y(\013pktp)208
+b(90)2198 4495 y(\013pky)246 b(37)2198 4608 y(\013pkyt)211
+b(90)2198 4721 y(\013pkyu)195 b(37)2198 4833 y(\013pky)p
+2403 4833 V 246 w(88)2198 4946 y(\013plsw)214 b(89)2198
+5059 y(\013pmrk)182 b(30)2198 5172 y(\013pmsg)j(55)2198
+5285 y(\013pn)m(ul)217 b(95)2198 5398 y(\013ppn)240 b(96)2198
+5511 y(\013ppn)p 2409 5511 V 240 w(96)2198 5624 y(\013ppr)255
+b(96)2198 5737 y(\013pprn)204 b(41)2865 656 y(\013ppru)221
+b(97)2865 769 y(\013ppr)p 3061 769 V 272 w(96)2865 882
+y(\013pp)m(x)263 b(40)2865 995 y(\013pp)m(xn)212 b(40)2865
+1107 y(\013prec)243 b(38)2865 1220 y(\013pscl)257 b(94)2865
+1333 y(\013pss)287 b(40)2865 1446 y(\013pss)p 3046 1446
+V 287 w(97)2865 1559 y(\013psv)m(c)238 b(57)2865 1672
+y(\013ptbb)177 b(100)2865 1785 y(\013ptdm)197 b(48)2865
+1898 y(\013pthp)222 b(99)2865 2011 y(\013pun)m(t)j(38)2865
+2124 y(\013rdef)255 b(86)2865 2237 y(\013reop)s(en)144
+b(82)2865 2349 y(\013rprt)252 b(30)2865 2462 y(\013rsim)236
+b(85)2865 2575 y(\013rtnm)212 b(83)2865 2688 y(\013rwrg)227
+b(61)2865 2801 y(\013s2dt)243 b(54)2865 2914 y(\013s2tm)218
+b(54)2865 3027 y(\013sn)m(ul)249 b(95)2865 3140 y(\013sro)m(w)230
+b(51)2865 3253 y(\013texp)236 b(52)2865 3366 y(\013thdu)222
+b(33)2865 3479 y(\013theap)143 b(100)2865 3591 y(\013tk)m(ey)242
+b(56)2865 3704 y(\013tm2s)218 b(54)2865 3817 y(\013tn)m(ul)250
+b(95)2865 3930 y(\013topn)228 b(30)2865 4043 y(\013tplt)263
+b(82)2865 4156 y(\013trec)c(56)2865 4269 y(\013tscl)273
+b(94)2865 4382 y(\013ucrd)232 b(38)2865 4495 y(\013ukls)249
+b(93)2865 4608 y(\013uky)263 b(37)2865 4721 y(\013ukyu)212
+b(37)2865 4833 y(\013uky)p 3070 4833 V 263 w(93)2865
+4946 y(\013up)s(c)m(h)217 b(56)2865 5059 y(\013up)s(c)m(k)j(53)2865
+5172 y(\013urlt)262 b(32)2865 5285 y(\013v)m(c)m(ks)244
+b(53)2865 5398 y(\013v)m(ers)253 b(55)2865 5511 y(\013wldp)216
+b(73)2865 5624 y(\013xyp)m(x)i(73)p eop
+%%Page: 150 158
+150 157 bop 0 299 a Fj(150)2084 b Fh(APPENDIX)31 b(A.)61
 b(INDEX)31 b(OF)f(R)m(OUTINES)p eop
-%%Page: 133 139
-133 138 bop 0 1225 a Fg(App)5 b(endix)65 b(B)0 1687 y
-Fm(P)-6 b(arameter)77 b(De\014nitions)0 2180 y Ff(anynul)142
+%%Page: 151 159
+151 158 bop 0 1225 a Fg(App)5 b(endix)65 b(B)0 1687 y
+Fm(P)-6 b(arameter)77 b(De\014nitions)0 2180 y Fe(anynul)142
 b(-)47 b(set)g(to)g(TRUE)g(\(=1\))f(if)i(any)e(returned)g(values)g(are)
 h(undefined,)e(else)i(FALSE)0 2293 y(array)190 b(-)47
 b(array)f(of)i(numerical)d(data)h(values)h(to)g(read)f(or)i(write)0
@@ -11109,316 +12283,348 @@ b(array)f(of)i(numerical)d(data)h(values)h(to)g(read)f(or)i(write)0
 (symbolic)g(mnemonics)h(are)h(predefined:)716 2744 y(BYTE_IMG)141
 b(=)i(8)47 b(\(unsigned)f(char\))716 2857 y(SHORT_IMG)93
 b(=)i(16)47 b(\(signed)f(short)g(integer\))716 2970 y(LONG_IMG)141
-b(=)47 b(32)h(\(signed)d(long)i(integer\))716 3083 y(FLOAT_IMG)93
-b(=)47 b(-32)g(\(float\))716 3196 y(DOUBLE_IMG)e(=)i(-64)g(\(double\).)
-525 3309 y(Two)g(additional)e(values,)h(USHORT_IMG)f(and)i(ULONG_IMG)e
-(are)i(also)f(available)525 3422 y(for)h(creating)e(unsigned)h(integer)
-g(images.)93 b(These)47 b(are)g(equivalent)e(to)525 3535
+b(=)95 b(32)47 b(\(signed)f(long)h(integer\))716 3083
+y(LONGLONG_IMG)d(=)96 b(64)47 b(\(signed)f(long)g(64-bit)g(integer\))
+716 3196 y(FLOAT_IMG)93 b(=)47 b(-32)g(\(float\))716
+3309 y(DOUBLE_IMG)e(=)i(-64)g(\(double\).)525 3422 y(The)g
+(LONGLONG_IMG)d(type)j(is)g(experimental)e(and)i(is)g(not)g(officially)
+525 3535 y(recognized)e(in)i(the)g(FITS)g(Standard)e(document.)525
+3648 y(Two)i(additional)e(values,)h(USHORT_IMG)f(and)i(ULONG_IMG)e(are)
+i(also)f(available)525 3760 y(for)h(creating)e(unsigned)h(integer)g
+(images.)93 b(These)47 b(are)g(equivalent)e(to)525 3873
 y(creating)h(a)h(signed)f(integer)g(image)g(with)h(BZERO)f(offset)g
-(keyword)g(values)525 3648 y(of)h(32768)g(or)g(2147483648,)d
+(keyword)g(values)525 3986 y(of)h(32768)g(or)g(2147483648,)d
 (respectively,)h(which)h(is)h(the)g(convention)e(that)525
-3760 y(FITS)i(uses)f(to)h(store)g(unsigned)e(integers.)0
-3873 y(card)238 b(-)47 b(header)f(record)g(to)h(be)h(read)e(or)h
-(written)f(\(80)h(char)g(max,)f(null-terminated\))0 3986
+4099 y(FITS)i(uses)f(to)h(store)g(unsigned)e(integers.)0
+4212 y(card)238 b(-)47 b(header)f(record)g(to)h(be)h(read)e(or)h
+(written)f(\(80)h(char)g(max,)f(null-terminated\))0 4325
 y(casesen)94 b(-)47 b(CASESEN)f(\(=1\))g(for)h(case-sensitive)d(string)
-i(matching,)g(else)g(CASEINSEN)g(\(=0\))0 4099 y(cmopt)190
+i(matching,)g(else)g(CASEINSEN)g(\(=0\))0 4438 y(cmopt)190
 b(-)47 b(grouping)f(table)g("compact")f(option)h(parameter.)f(Allowed)h
-(values)g(are:)525 4212 y(OPT_CMT_MBR)f(and)i(OPT_CMT_MBR_DEL.)0
-4325 y(colname)94 b(-)47 b(name)g(of)g(the)g(column)f
-(\(null-terminated\))0 4438 y(colnum)142 b(-)47 b(column)f(number)g
-(\(first)g(column)g(=)i(1\))0 4551 y(colspec)94 b(-)47
+(values)g(are:)525 4551 y(OPT_CMT_MBR)f(and)i(OPT_CMT_MBR_DEL.)0
+4664 y(colname)94 b(-)47 b(name)g(of)g(the)g(column)f
+(\(null-terminated\))0 4777 y(colnum)142 b(-)47 b(column)f(number)g
+(\(first)g(column)g(=)i(1\))0 4890 y(colspec)94 b(-)47
 b(the)g(input)f(file)h(column)f(specification;)e(used)j(to)g(delete,)f
-(create,)f(or)j(rename)525 4664 y(table)e(columns)0 4777
+(create,)f(or)j(rename)525 5002 y(table)e(columns)0 5115
 y(comment)94 b(-)47 b(the)g(keyword)f(comment)g(field)g(\(72)h(char)f
-(max,)h(null-terminated\))0 4890 y(complm)142 b(-)47
-b(should)f(the)h(checksum)f(be)h(complemented?)0 5002
-y(coordtype-)e(type)i(of)g(coordinate)e(projection)g(\(-SIN,)h(-TAN,)g
-(-ARC,)h(-NCP,)525 5115 y(-GLS,)f(-MER,)h(or)g(-AIT\))0
-5228 y(cpopt)190 b(-)47 b(grouping)f(table)g(copy)h(option)f
-(parameter.)f(Allowed)g(values)i(are:)525 5341 y(OPT_GCP_GPT,)d
-(OPT_GCP_MBR,)h(OPT_GCP_ALL,)f(OPT_MCP_ADD,)h(OPT_MCP_NADD,)525
-5454 y(OPT_MCP_REPL,)f(amd)j(OPT_MCP_MOV.)0 5567 y(create_col-)e(If)i
+(max,)h(null-terminated\))0 5228 y(complm)142 b(-)47
+b(should)f(the)h(checksum)f(be)h(complemented?)0 5341
+y(comptype)f(-)h(compression)e(algorithm)g(to)i(use:)g(GZIP_1,)f
+(RICE_1,)f(or)j(PLIO_1)0 5454 y(coordtype-)d(type)i(of)g(coordinate)e
+(projection)g(\(-SIN,)h(-TAN,)g(-ARC,)h(-NCP,)525 5567
+y(-GLS,)f(-MER,)h(or)g(-AIT\))0 5680 y(cpopt)190 b(-)47
+b(grouping)f(table)g(copy)h(option)f(parameter.)f(Allowed)g(values)i
+(are:)1882 5942 y Fj(151)p eop
+%%Page: 152 160
+152 159 bop 0 299 a Fj(152)1822 b Fh(APPENDIX)31 b(B.)61
+b(P)-8 b(ARAMETER)30 b(DEFINITIONS)525 555 y Fe(OPT_GCP_GPT,)44
+b(OPT_GCP_MBR,)h(OPT_GCP_ALL,)f(OPT_MCP_ADD,)h(OPT_MCP_NADD,)525
+668 y(OPT_MCP_REPL,)f(amd)j(OPT_MCP_MOV.)0 781 y(create_col-)e(If)i
 (TRUE,)f(then)h(insert)f(a)h(new)g(column)f(in)i(the)f(table,)f
-(otherwise)525 5680 y(overwrite)f(the)i(existing)f(column.)1882
-5942 y Fj(133)p eop
-%%Page: 134 140
-134 139 bop 0 299 a Fj(134)1822 b Fh(APPENDIX)31 b(B.)61
-b(P)-8 b(ARAMETER)30 b(DEFINITIONS)0 555 y Ff(dataok)142
-b(-)47 b(was)g(the)g(data)f(unit)h(verification)e(successful)g(\(=1\))h
-(or)525 668 y(not)h(\(=)g(-1\).)94 b(Equals)47 b(zero)f(if)h(the)g
-(DATASUM)f(keyword)g(is)h(not)g(present.)0 781 y(datasum)94
-b(-)47 b(32-bit)f(1's)h(complement)e(checksum)h(for)g(the)h(data)g
-(unit)0 894 y(dataend)94 b(-)47 b(address)f(\(in)h(bytes\))f(of)h(the)g
-(end)g(of)g(the)g(HDU)0 1007 y(datastart-)e(address)h(\(in)h(bytes\))f
-(of)h(the)g(start)f(of)h(the)g(data)g(unit)0 1120 y(datatype)f(-)h
-(specifies)e(the)i(datatype)f(of)h(the)g(value.)94 b(Allowed)45
-b(value)i(are:)525 1233 y(TSTRING,)f(TLOGICAL,)f(TBYTE,)h(TSHORT,)g
-(TUSHORT,)f(TINT,)i(TUINT,)f(TLONG,)g(TULONG,)525 1346
-y(TFLOAT,)g(TDOUBLE,)f(TCOMPLEX,)h(and)h(TDBLCOMPLEX)0
-1458 y(datestr)94 b(-)47 b(FITS)g(date/time)e(string:)h
+(otherwise)525 894 y(overwrite)f(the)i(existing)f(column.)0
+1007 y(current)94 b(-)47 b(if)g(TRUE,)g(then)f(the)h(current)f(HDU)h
+(will)f(be)i(copied)0 1120 y(dataok)142 b(-)47 b(was)g(the)g(data)f
+(unit)h(verification)e(successful)g(\(=1\))h(or)525 1233
+y(not)h(\(=)g(-1\).)94 b(Equals)47 b(zero)f(if)h(the)g(DATASUM)f
+(keyword)g(is)h(not)g(present.)0 1346 y(datasum)94 b(-)47
+b(32-bit)f(1's)h(complement)e(checksum)h(for)g(the)h(data)g(unit)0
+1458 y(dataend)94 b(-)47 b(address)f(\(in)h(bytes\))f(of)h(the)g(end)g
+(of)g(the)g(HDU)0 1571 y(datastart-)e(address)h(\(in)h(bytes\))f(of)h
+(the)g(start)f(of)h(the)g(data)g(unit)0 1684 y(datatype)f(-)h
+(specifies)e(the)i(data)g(type)f(of)i(the)f(value.)93
+b(Allowed)46 b(value)h(are:)94 b(TSTRING,)525 1797 y(TLOGICAL,)45
+b(TBYTE,)h(TSBYTE,)g(TSHORT,)g(TUSHORT,)g(TINT,)g(TUINT,)g(TLONG,)g
+(TULONG,)525 1910 y(TFLOAT,)g(TDOUBLE,)f(TCOMPLEX,)h(and)h(TDBLCOMPLEX)
+0 2023 y(datestr)94 b(-)47 b(FITS)g(date/time)e(string:)h
 ('YYYY-MM-DDThh:mm:ss.dd)o(d',)41 b('YYYY-MM-dd',)525
-1571 y(or)47 b('dd/mm/yy')0 1684 y(day)286 b(-)47 b(calendar)f(day)g
-(\(UTC\))h(\(1-31\))0 1797 y(decimals)f(-)h(number)f(of)h(decimal)f
-(places)g(to)h(be)h(displayed)0 1910 y(deltasize)d(-)j(increment)d(for)
-i(allocating)e(more)i(memory)0 2023 y(dim1)238 b(-)47
+2136 y(or)47 b('dd/mm/yy')0 2249 y(day)286 b(-)47 b(calendar)f(day)g
+(\(UTC\))h(\(1-31\))0 2362 y(decimals)f(-)h(number)f(of)h(decimal)f
+(places)g(to)h(be)h(displayed)0 2475 y(deltasize)d(-)j(increment)d(for)
+i(allocating)e(more)i(memory)0 2588 y(dim1)238 b(-)47
 b(declared)f(size)g(of)h(the)g(first)g(dimension)e(of)i(the)g(image)f
-(or)i(cube)e(array)0 2136 y(dim2)238 b(-)47 b(declared)f(size)g(of)h
+(or)i(cube)e(array)0 2700 y(dim2)238 b(-)47 b(declared)f(size)g(of)h
 (the)g(second)f(dimension)g(of)h(the)g(data)f(cube)h(array)0
-2249 y(dispwidth)e(-)j(display)e(width)g(of)h(a)h(column)e(=)h(length)f
-(of)h(string)f(that)h(will)g(be)g(read)0 2362 y(dtype)190
-b(-)47 b(datatype)f(of)h(the)g(keyword)e(\('C',)i('L',)f('I',)h('F')g
-(or)g('X'\))764 2475 y(C)g(=)h(character)d(string)764
-2588 y(L)i(=)h(logical)764 2700 y(I)f(=)h(integer)764
-2813 y(F)f(=)h(floating)d(point)h(number)764 2926 y(X)h(=)h(complex,)d
-(e.g.,)h("\(1.23,)g(-4.56\)")0 3039 y(err_msg)94 b(-)47
+2813 y(dispwidth)e(-)j(display)e(width)g(of)h(a)h(column)e(=)h(length)f
+(of)h(string)f(that)h(will)g(be)g(read)0 2926 y(dtype)190
+b(-)47 b(data)g(type)f(of)h(the)g(keyword)f(\('C',)h('L',)f('I',)h('F')
+g(or)g('X'\))764 3039 y(C)g(=)h(character)d(string)764
+3152 y(L)i(=)h(logical)764 3265 y(I)f(=)h(integer)764
+3378 y(F)f(=)h(floating)d(point)h(number)764 3491 y(X)h(=)h(complex,)d
+(e.g.,)h("\(1.23,)g(-4.56\)")0 3604 y(err_msg)94 b(-)47
 b(error)f(message)g(on)h(the)g(internal)f(stack)g(\(80)h(chars)f(max\))
-0 3152 y(err_text)g(-)h(error)f(message)g(string)g(corresponding)e(to)k
-(error)e(number)g(\(30)h(chars)f(max\))0 3265 y(exact)190
+0 3717 y(err_text)g(-)h(error)f(message)g(string)g(corresponding)e(to)k
+(error)e(number)g(\(30)h(chars)f(max\))0 3830 y(exact)190
 b(-)47 b(TRUE)g(\(=1\))f(if)h(the)g(strings)f(match)h(exactly;)525
-3378 y(FALSE)f(\(=0\))h(if)g(wildcards)e(are)i(used)0
-3491 y(exclist)94 b(-)47 b(array)f(of)i(pointers)d(to)i(keyword)f
-(names)g(to)i(be)f(excluded)e(from)i(search)0 3604 y(expr)238
-b(-)47 b(boolean)f(or)h(arithmetic)e(expression)0 3717
-y(extend)142 b(-)47 b(TRUE)g(\(=1\))f(if)h(FITS)g(file)g(may)g(have)f
-(extensions,)f(else)i(FALSE)f(\(=0\))0 3830 y(extname)94
-b(-)47 b(value)f(of)i(the)e(EXTNAME)g(keyword)g(\(null-terminated\))0
-3942 y(extspec)94 b(-)47 b(the)g(extension)e(or)i(HDU)g(specifier;)e(a)
-j(number)e(or)h(name,)f(version,)g(and)h(type)0 4055
-y(extver)142 b(-)47 b(value)f(of)i(the)e(EXTVER)h(keyword)e(=)j
-(integer)e(version)f(number)0 4168 y(filename)h(-)h(full)g(name)f(of)h
+3942 y(FALSE)f(\(=0\))h(if)g(wildcards)e(are)i(used)0
+4055 y(exclist)94 b(-)47 b(array)f(of)i(pointers)d(to)i(keyword)f
+(names)g(to)i(be)f(excluded)e(from)i(search)0 4168 y(exists)142
+b(-)47 b(flag)g(indicating)e(whether)g(the)i(file)g(or)g(compressed)e
+(file)i(exists)f(on)h(disk)0 4281 y(expr)238 b(-)47 b(boolean)f(or)h
+(arithmetic)e(expression)0 4394 y(extend)142 b(-)47 b(TRUE)g(\(=1\))f
+(if)h(FITS)g(file)g(may)g(have)f(extensions,)f(else)i(FALSE)f(\(=0\))0
+4507 y(extname)94 b(-)47 b(value)f(of)i(the)e(EXTNAME)g(keyword)g
+(\(null-terminated\))0 4620 y(extspec)94 b(-)47 b(the)g(extension)e(or)
+i(HDU)g(specifier;)e(a)j(number)e(or)h(name,)f(version,)g(and)h(type)0
+4733 y(extver)142 b(-)47 b(value)f(of)i(the)e(EXTVER)h(keyword)e(=)j
+(integer)e(version)f(number)0 4846 y(filename)h(-)h(full)g(name)f(of)h
 (the)g(FITS)g(file,)f(including)g(optional)f(HDU)i(and)g(filtering)e
-(specs)0 4281 y(filetype)h(-)h(type)g(of)g(file)f(\(file://,)g(ftp://,)
-g(http://,)f(etc.\))0 4394 y(filter)142 b(-)47 b(the)g(input)f(file)h
-(filtering)e(specifier)0 4507 y(firstchar-)g(starting)h(byte)g(in)h
-(the)g(row)g(\(first)f(byte)h(of)g(row)g(=)g(1\))0 4620
+(specs)0 4959 y(filetype)h(-)h(type)g(of)g(file)f(\(file://,)g(ftp://,)
+g(http://,)f(etc.\))0 5072 y(filter)142 b(-)47 b(the)g(input)f(file)h
+(filtering)e(specifier)0 5185 y(firstchar-)g(starting)h(byte)g(in)h
+(the)g(row)g(\(first)f(byte)h(of)g(row)g(=)g(1\))0 5297
 y(firstfailed)e(-)i(member)f(HDU)h(ID)g(\(if)g(positive\))f(or)h
-(grouping)e(table)i(GRPIDn)f(index)525 4733 y(value)g(\(if)h
+(grouping)e(table)i(GRPIDn)f(index)525 5410 y(value)g(\(if)h
 (negative\))f(that)g(failed)g(grouping)g(table)g(verification.)0
-4846 y(firstelem-)f(first)h(element)g(in)h(a)h(vector)e(\(ignored)f
-(for)i(ASCII)g(tables\))0 4959 y(firstrow)f(-)h(starting)f(row)g
-(number)h(\(first)f(row)h(of)g(table)f(=)i(1\))0 5072
-y(fpixel)142 b(-)47 b(coordinate)e(of)i(the)g(first)f(pixel)h(to)g(be)g
-(read)g(or)g(written)f(in)h(the)525 5185 y(FITS)g(array.)93
-b(The)47 b(array)g(must)f(be)i(of)f(length)f(NAXIS)g(and)h(have)g
-(values)f(such)525 5297 y(that)h(fpixel[0])e(is)i(in)g(the)g(range)g(1)
-g(to)g(NAXIS1,)f(fpixel[1])f(is)i(in)h(the)525 5410 y(range)e(1)i(to)f
-(NAXIS2,)f(etc.)0 5523 y(fptr)238 b(-)47 b(pointer)f(to)h(a)g
-('fitsfile')e(structure)h(describing)f(the)i(FITS)f(file.)0
-5636 y(frac)238 b(-)47 b(factional)e(part)i(of)g(the)g(keyword)f(value)
-p eop
-%%Page: 135 141
-135 140 bop 3764 299 a Fj(135)0 555 y Ff(gcount)142 b(-)47
-b(number)f(of)h(groups)f(in)i(the)e(primary)g(array)h(\(usually)e(=)j
-(1\))0 668 y(gfptr)190 b(-)47 b(fitsfile*)e(pointer)h(to)h(a)h
-(grouping)d(table)i(HDU.)0 781 y(group)190 b(-)47 b(GRPIDn/GRPLCn)d
-(index)j(value)f(identifying)f(a)i(grouping)f(table)g(HDU,)h(or)525
-894 y(data)g(group)f(number)g(\(=0)h(for)g(non-grouped)e(data\))0
-1007 y(grouptype)g(-)j(Grouping)d(table)i(parameter)e(that)i(specifies)
-e(the)i(columns)f(to)h(be)525 1120 y(created)f(in)h(a)g(grouing)f
-(table)h(HDU.)f(Allowed)g(values)g(are:)h(GT_ID_ALL_URI,)525
-1233 y(GT_ID_REF,)e(GT_ID_POS,)g(GT_ID_ALL,)g(GT_ID_REF_URI,)f(and)j
-(GT_ID_POS_URI.)0 1346 y(grpname)94 b(-)47 b(value)f(to)i(use)e(for)h
-(the)g(GRPNAME)f(keyword)g(value.)0 1458 y(hdunum)142
+5523 y(firstelem-)f(first)h(element)g(in)h(a)h(vector)e(\(ignored)f
+(for)i(ASCII)g(tables\))0 5636 y(firstrow)f(-)h(starting)f(row)g
+(number)h(\(first)f(row)h(of)g(table)f(=)i(1\))p eop
+%%Page: 153 161
+153 160 bop 3764 299 a Fj(153)0 555 y Fe(following-)45
+b(if)i(TRUE,)g(any)f(HDUs)h(following)e(the)i(current)f(HDU)h(will)g
+(be)g(copied)0 668 y(fpixel)142 b(-)47 b(coordinate)e(of)i(the)g(first)
+f(pixel)h(to)g(be)g(read)g(or)g(written)f(in)h(the)525
+781 y(FITS)g(array.)93 b(The)47 b(array)g(must)f(be)i(of)f(length)f
+(NAXIS)g(and)h(have)g(values)f(such)525 894 y(that)h(fpixel[0])e(is)i
+(in)g(the)g(range)g(1)g(to)g(NAXIS1,)f(fpixel[1])f(is)i(in)h(the)525
+1007 y(range)e(1)i(to)f(NAXIS2,)f(etc.)0 1120 y(fptr)238
+b(-)47 b(pointer)f(to)h(a)g('fitsfile')e(structure)h(describing)f(the)i
+(FITS)f(file.)0 1233 y(frac)238 b(-)47 b(factional)e(part)i(of)g(the)g
+(keyword)f(value)0 1346 y(gcount)142 b(-)47 b(number)f(of)h(groups)f
+(in)i(the)e(primary)g(array)h(\(usually)e(=)j(1\))0 1458
+y(gfptr)190 b(-)47 b(fitsfile*)e(pointer)h(to)h(a)h(grouping)d(table)i
+(HDU.)0 1571 y(group)190 b(-)47 b(GRPIDn/GRPLCn)d(index)j(value)f
+(identifying)f(a)i(grouping)f(table)g(HDU,)h(or)525 1684
+y(data)g(group)f(number)g(\(=0)h(for)g(non-grouped)e(data\))0
+1797 y(grouptype)g(-)j(Grouping)d(table)i(parameter)e(that)i(specifies)
+e(the)i(columns)f(to)h(be)525 1910 y(created)f(in)h(a)g(grouping)f
+(table)g(HDU.)h(Allowed)f(values)g(are:)h(GT_ID_ALL_URI,)525
+2023 y(GT_ID_REF,)e(GT_ID_POS,)g(GT_ID_ALL,)g(GT_ID_REF_URI,)f(and)j
+(GT_ID_POS_URI.)0 2136 y(grpname)94 b(-)47 b(value)f(to)i(use)e(for)h
+(the)g(GRPNAME)f(keyword)g(value.)0 2249 y(hdunum)142
 b(-)47 b(sequence)f(number)g(of)h(the)g(HDU)g(\(Primary)e(array)i(=)g
-(1\))0 1571 y(hduok)190 b(-)47 b(was)g(the)g(HDU)g(verification)d
-(successful)h(\(=1\))i(or)525 1684 y(not)g(\(=)g(-1\).)94
+(1\))0 2362 y(hduok)190 b(-)47 b(was)g(the)g(HDU)g(verification)d
+(successful)h(\(=1\))i(or)525 2475 y(not)g(\(=)g(-1\).)94
 b(Equals)47 b(zero)f(if)h(the)g(CHECKSUM)f(keyword)g(is)h(not)g
-(present.)0 1797 y(hdusum)142 b(-)47 b(32)g(bit)g(1's)g(complement)e
-(checksum)h(for)g(the)h(entire)f(CHDU)0 1910 y(hdutype)94
+(present.)0 2588 y(hdusum)142 b(-)47 b(32)g(bit)g(1's)g(complement)e
+(checksum)h(for)g(the)h(entire)f(CHDU)0 2700 y(hdutype)94
 b(-)47 b(type)g(of)g(HDU:)f(IMAGE_HDU)g(\(=0\),)g(ASCII_TBL)f(\(=1\),)i
-(or)g(BINARY_TBL)e(\(=2\))0 2023 y(headstart-)g(starting)h(address)f
-(\(in)i(bytes\))f(of)i(the)e(CHDU)0 2136 y(history)94
-b(-)47 b(the)g(HISTORY)f(keyword)g(comment)f(string)h(\(70)h(char)g
-(max,)g(null-terminated\))0 2249 y(hour)238 b(-)47 b(hour)g(within)f
-(day)h(\(UTC\))f(\(0)h(-)h(23\))0 2362 y(inc)286 b(-)47
-b(sampling)f(interval)f(for)i(pixels)f(in)h(each)g(FITS)g(dimension)0
-2475 y(inclist)94 b(-)47 b(array)f(of)i(pointers)d(to)i(matching)f
-(keyword)g(names)0 2588 y(incolnum)g(-)h(input)f(column)g(number;)g
-(range)h(=)g(1)h(to)f(TFIELDS)0 2700 y(infile)142 b(-)47
+(or)g(BINARY_TBL)e(\(=2\))0 2813 y(header)142 b(-)47
+b(returned)f(character)f(string)h(containing)f(all)i(the)g(keyword)f
+(records)0 2926 y(headstart-)f(starting)h(address)f(\(in)i(bytes\))f
+(of)i(the)e(CHDU)0 3039 y(heapsize)g(-)h(size)g(of)g(the)g(binary)f
+(table)g(heap,)h(in)g(bytes)0 3152 y(history)94 b(-)47
+b(the)g(HISTORY)f(keyword)g(comment)f(string)h(\(70)h(char)g(max,)g
+(null-terminated\))0 3265 y(hour)238 b(-)47 b(hour)g(within)f(day)h
+(\(UTC\))f(\(0)h(-)h(23\))0 3378 y(inc)286 b(-)47 b(sampling)f
+(interval)f(for)i(pixels)f(in)h(each)g(FITS)g(dimension)0
+3491 y(inclist)94 b(-)47 b(array)f(of)i(pointers)d(to)i(matching)f
+(keyword)g(names)0 3604 y(incolnum)g(-)h(input)f(column)g(number;)g
+(range)h(=)g(1)h(to)f(TFIELDS)0 3717 y(infile)142 b(-)47
 b(the)g(input)f(filename,)g(including)f(path)h(if)i(specified)0
-2813 y(infptr)142 b(-)47 b(pointer)f(to)h(a)g('fitsfile')e(structure)h
-(describing)f(the)i(input)f(FITS)h(file.)0 2926 y(intval)142
+3830 y(infptr)142 b(-)47 b(pointer)f(to)h(a)g('fitsfile')e(structure)h
+(describing)f(the)i(input)f(FITS)h(file.)0 3942 y(intval)142
 b(-)47 b(integer)f(part)g(of)i(the)f(keyword)e(value)0
-3039 y(iomode)142 b(-)47 b(file)g(access)f(mode:)g(either)g(READONLY)g
-(\(=0\))g(or)i(READWRITE)d(\(=1\))0 3152 y(keyname)94
+4055 y(iomode)142 b(-)47 b(file)g(access)f(mode:)g(either)g(READONLY)g
+(\(=0\))g(or)i(READWRITE)d(\(=1\))0 4168 y(keyname)94
 b(-)47 b(name)g(of)g(a)g(keyword)f(\(8)h(char)g(max,)g
-(null-terminated\))0 3265 y(keynum)142 b(-)47 b(position)f(of)h
+(null-terminated\))0 4281 y(keynum)142 b(-)47 b(position)f(of)h
 (keyword)f(in)h(header)f(\(1st)g(keyword)g(=)i(1\))0
-3378 y(keyroot)94 b(-)47 b(root)g(string)f(for)h(the)g(keyword)e(name)i
-(\(5)g(char)g(max,)f(null-terminated\))0 3491 y(keysexist-)f(number)h
+4394 y(keyroot)94 b(-)47 b(root)g(string)f(for)h(the)g(keyword)e(name)i
+(\(5)g(char)g(max,)f(null-terminated\))0 4507 y(keysexist-)f(number)h
 (of)h(existing)f(keyword)g(records)f(in)j(the)f(CHU)0
-3604 y(keytype)94 b(-)47 b(header)f(record)g(type:)h(-1=delete;)92
-b(0=append)46 b(or)h(replace;)907 3717 y(1=append;)e(2=this)h(is)h(the)
-g(END)g(keyword)0 3830 y(longstr)94 b(-)47 b(arbitrarily)e(long)h
-(string)g(keyword)g(value)h(\(null-terminated\))0 3942
+4620 y(keytype)94 b(-)47 b(header)f(record)g(type:)h(-1=delete;)92
+b(0=append)46 b(or)h(replace;)907 4733 y(1=append;)e(2=this)h(is)h(the)
+g(END)g(keyword)0 4846 y(longstr)94 b(-)47 b(arbitrarily)e(long)h
+(string)g(keyword)g(value)h(\(null-terminated\))0 4959
 y(lpixel)142 b(-)47 b(coordinate)e(of)i(the)g(last)g(pixel)f(to)h(be)g
-(read)g(or)g(written)f(in)h(the)525 4055 y(FITS)g(array.)93
+(read)g(or)g(written)f(in)h(the)525 5072 y(FITS)g(array.)93
 b(The)47 b(array)g(must)f(be)i(of)f(length)f(NAXIS)g(and)h(have)g
-(values)f(such)525 4168 y(that)h(lpixel[0])e(is)i(in)g(the)g(range)g(1)
-g(to)g(NAXIS1,)f(lpixel[1])f(is)i(in)h(the)525 4281 y(range)e(1)i(to)f
-(NAXIS2,)f(etc.)0 4394 y(match)190 b(-)47 b(TRUE)g(\(=1\))f(if)h(the)g
-(2)h(strings)e(match,)g(else)g(FALSE)h(\(=0\))0 4507
+(values)f(such)525 5185 y(that)h(lpixel[0])e(is)i(in)g(the)g(range)g(1)
+g(to)g(NAXIS1,)f(lpixel[1])f(is)i(in)h(the)525 5297 y(range)e(1)i(to)f
+(NAXIS2,)f(etc.)0 5410 y(match)190 b(-)47 b(TRUE)g(\(=1\))f(if)h(the)g
+(2)h(strings)e(match,)g(else)g(FALSE)h(\(=0\))0 5523
 y(maxdim)142 b(-)47 b(maximum)f(number)g(of)h(values)f(to)h(return)0
-4620 y(member)142 b(-)47 b(row)g(number)f(of)h(a)h(grouping)d(table)i
-(member)f(HDU.)0 4733 y(memptr)142 b(-)47 b(pointer)f(to)h(the)g(a)g
-(FITS)g(file)g(in)g(memory)0 4846 y(mem_realloc)e(-)i(pointer)f(to)h(a)
-h(function)d(for)i(reallocating)e(more)h(memory)0 4959
-y(memsize)94 b(-)47 b(size)g(of)g(the)g(memory)f(block)g(allocated)f
-(for)i(the)g(FITS)g(file)0 5072 y(mfptr)190 b(-)47 b(fitsfile*)e
-(pointer)h(to)h(a)h(grouping)d(table)i(member)f(HDU.)0
-5185 y(mgopt)190 b(-)47 b(grouping)f(table)g(merge)g(option)g
-(parameter.)f(Allowed)h(values)g(are:)525 5297 y(OPT_MRG_COPY,)e(and)j
-(OPT_MRG_MOV.)0 5410 y(minute)142 b(-)47 b(minute)f(within)g(hour)h
-(\(UTC\))f(\(0)h(-)h(59\))0 5523 y(month)190 b(-)47 b(calendar)f(month)
-g(\(UTC\))g(\(1)h(-)h(12\))0 5636 y(morekeys)e(-)h(space)f(in)i(the)e
-(header)h(for)f(this)h(many)g(more)f(keywords)p eop
-%%Page: 136 142
-136 141 bop 0 299 a Fj(136)1822 b Fh(APPENDIX)31 b(B.)61
-b(P)-8 b(ARAMETER)30 b(DEFINITIONS)0 555 y Ff(n_good_rows)45
-b(-)i(number)f(of)h(rows)g(evaluating)e(to)i(TRUE)0 668
-y(naxes)190 b(-)47 b(size)g(of)g(each)f(dimension)g(in)h(the)g(FITS)f
-(array)0 781 y(naxis)190 b(-)47 b(number)f(of)h(dimensions)e(in)i(the)g
-(FITS)g(array)0 894 y(naxis1)142 b(-)47 b(length)f(of)h(the)g(X/first)f
-(axis)h(of)g(the)g(FITS)f(array)0 1007 y(naxis2)142 b(-)47
-b(length)f(of)h(the)g(Y/second)f(axis)g(of)i(the)e(FITS)h(array)0
-1120 y(naxis3)142 b(-)47 b(length)f(of)h(the)g(Z/third)f(axis)h(of)g
-(the)g(FITS)f(array)0 1233 y(nchars)142 b(-)47 b(number)f(of)h
-(characters)e(to)i(read)g(or)g(write)0 1346 y(nelements-)e(number)h(of)
-h(data)g(elements)e(to)j(read)e(or)h(write)0 1458 y(newfptr)94
-b(-)47 b(returned)f(pointer)f(to)j(the)e(reopened)g(file)0
-1571 y(newveclen-)f(new)i(value)f(for)h(the)g(column)f(vector)g(repeat)
-g(parameter)0 1684 y(nexc)238 b(-)47 b(number)f(of)h(names)g(in)g(the)g
-(exclusion)e(list)i(\(may)f(=)i(0\))0 1797 y(nfound)142
-b(-)47 b(number)f(of)h(keywords)f(found)g(\(highest)g(keyword)g
-(number\))0 1910 y(nkeys)190 b(-)47 b(number)f(of)h(keywords)f(in)h
-(the)g(sequence)0 2023 y(ninc)238 b(-)47 b(number)f(of)h(names)g(in)g
-(the)g(inclusion)e(list)0 2136 y(nmembers)h(-)h(Number)f(of)h(grouping)
-f(table)g(members)g(\(NAXIS2)g(value\).)0 2249 y(nmove)190
-b(-)47 b(number)f(of)h(HDUs)g(to)g(move)g(\(+)g(or)g(-\),)g(relative)f
-(to)h(current)f(position)0 2362 y(nrows)190 b(-)47 b(number)f(of)h
-(rows)g(in)g(the)g(table)0 2475 y(nstart)142 b(-)47 b(first)f(integer)g
-(value)0 2588 y(nularray)g(-)h(set)g(to)g(TRUE)g(\(=1\))f(if)i
-(corresponding)c(data)i(element)g(is)h(undefined)0 2700
-y(nulval)142 b(-)47 b(numerical)e(value)i(to)g(represent)e(undefined)g
-(pixels)0 2813 y(nulstr)142 b(-)47 b(character)e(string)h(used)h(to)g
-(represent)e(undefined)h(values)g(in)h(ASCII)f(table)0
-2926 y(numval)142 b(-)47 b(numerical)e(data)i(value,)f(of)h(the)g
-(appropriate)e(datatype)0 3039 y(offset)142 b(-)95 b(byte)46
-b(offset)g(in)i(the)f(heap)f(to)h(the)g(first)g(element)e(of)j(the)f
-(vector)0 3152 y(openfptr)f(-)h(pointer)f(to)h(a)g(currently)f(open)g
-(FITS)h(file)0 3265 y(outcolnum-)e(output)h(column)g(number;)g(range)g
-(=)i(1)f(to)g(TFIELDS)f(+)i(1)0 3378 y(outfile)94 b(-)47
-b(and)g(optional)e(output)i(filename;)e(the)i(input)f(file)h(will)f(be)
-i(copied)e(to)h(this)f(prior)525 3491 y(to)h(opening)f(the)h(file)0
-3604 y(outfptr)94 b(-)47 b(pointer)f(to)h(a)g('fitsfile')e(structure)h
-(describing)f(the)i(output)f(FITS)g(file.)0 3717 y(pcount)142
-b(-)47 b(value)f(of)i(the)e(PCOUNT)h(keyword)e(=)j(size)e(of)i(binary)e
-(table)g(heap)0 3830 y(repeat)142 b(-)47 b(length)f(of)h(column)f
-(vector)g(\(e.g.)h(12J\);)f(==)h(1)h(for)f(ASCII)f(table)0
-3942 y(rmopt)190 b(-)47 b(grouping)f(table)g(remove)g(option)g
-(parameter.)f(Allowed)h(values)g(are:)525 4055 y(OPT_RM_GPT,)f
-(OPT_RM_ENTRY,)f(OPT_RM_MBR,)h(and)i(OPT_RM_ALL.)0 4168
+5636 y(member)142 b(-)47 b(row)g(number)f(of)h(a)h(grouping)d(table)i
+(member)f(HDU.)p eop
+%%Page: 154 162
+154 161 bop 0 299 a Fj(154)1822 b Fh(APPENDIX)31 b(B.)61
+b(P)-8 b(ARAMETER)30 b(DEFINITIONS)0 555 y Fe(memptr)142
+b(-)47 b(pointer)f(to)h(the)g(a)g(FITS)g(file)g(in)g(memory)0
+668 y(mem_realloc)e(-)i(pointer)f(to)h(a)h(function)d(for)i
+(reallocating)e(more)h(memory)0 781 y(memsize)94 b(-)47
+b(size)g(of)g(the)g(memory)f(block)g(allocated)f(for)i(the)g(FITS)g
+(file)0 894 y(mfptr)190 b(-)47 b(fitsfile*)e(pointer)h(to)h(a)h
+(grouping)d(table)i(member)f(HDU.)0 1007 y(mgopt)190
+b(-)47 b(grouping)f(table)g(merge)g(option)g(parameter.)f(Allowed)h
+(values)g(are:)525 1120 y(OPT_MRG_COPY,)e(and)j(OPT_MRG_MOV.)0
+1233 y(minute)142 b(-)47 b(minute)f(within)g(hour)h(\(UTC\))f(\(0)h(-)h
+(59\))0 1346 y(month)190 b(-)47 b(calendar)f(month)g(\(UTC\))g(\(1)h(-)
+h(12\))0 1458 y(morekeys)e(-)h(space)f(in)i(the)e(header)h(for)f(this)h
+(many)g(more)f(keywords)0 1571 y(n_good_rows)f(-)i(number)f(of)h(rows)g
+(evaluating)e(to)i(TRUE)0 1684 y(namelist)f(-)h(string)f(containing)f
+(a)j(comma)e(or)h(space)f(delimited)g(list)g(of)i(names)0
+1797 y(naxes)190 b(-)47 b(size)g(of)g(each)f(dimension)g(in)h(the)g
+(FITS)f(array)0 1910 y(naxis)190 b(-)47 b(number)f(of)h(dimensions)e
+(in)i(the)g(FITS)g(array)0 2023 y(naxis1)142 b(-)47 b(length)f(of)h
+(the)g(X/first)f(axis)h(of)g(the)g(FITS)f(array)0 2136
+y(naxis2)142 b(-)47 b(length)f(of)h(the)g(Y/second)f(axis)g(of)i(the)e
+(FITS)h(array)0 2249 y(naxis3)142 b(-)47 b(length)f(of)h(the)g(Z/third)
+f(axis)h(of)g(the)g(FITS)f(array)0 2362 y(nchars)142
+b(-)47 b(number)f(of)h(characters)e(to)i(read)g(or)g(write)0
+2475 y(nelements-)e(number)h(of)h(data)g(elements)e(to)j(read)e(or)h
+(write)0 2588 y(newfptr)94 b(-)47 b(returned)f(pointer)f(to)j(the)e
+(reopened)g(file)0 2700 y(newveclen-)f(new)i(value)f(for)h(the)g
+(column)f(vector)g(repeat)g(parameter)0 2813 y(nexc)238
+b(-)47 b(number)f(of)h(names)g(in)g(the)g(exclusion)e(list)i(\(may)f(=)
+i(0\))0 2926 y(nfound)142 b(-)47 b(number)f(of)h(keywords)f(found)g
+(\(highest)g(keyword)g(number\))0 3039 y(nkeys)190 b(-)47
+b(number)f(of)h(keywords)f(in)h(the)g(sequence)0 3152
+y(ninc)238 b(-)47 b(number)f(of)h(names)g(in)g(the)g(inclusion)e(list)0
+3265 y(nmembers)h(-)h(Number)f(of)h(grouping)f(table)g(members)g
+(\(NAXIS2)g(value\).)0 3378 y(nmove)190 b(-)47 b(number)f(of)h(HDUs)g
+(to)g(move)g(\(+)g(or)g(-\),)g(relative)f(to)h(current)f(position)0
+3491 y(nocomments)f(-)i(if)h(equal)e(to)h(TRUE,)g(then)f(no)h
+(commentary)e(keywords)h(will)h(be)g(copied)0 3604 y(noisebits-)e
+(number)h(of)h(bits)g(to)g(ignore)f(when)h(compressing)e(floating)g
+(point)h(images)0 3717 y(nrows)190 b(-)47 b(number)f(of)h(rows)g(in)g
+(the)g(table)0 3830 y(nstart)142 b(-)47 b(first)f(integer)g(value)0
+3942 y(nullarray-)f(set)i(to)g(TRUE)g(\(=1\))f(if)i(corresponding)c
+(data)i(element)g(is)h(undefined)0 4055 y(nulval)142
+b(-)47 b(numerical)e(value)i(to)g(represent)e(undefined)g(pixels)0
+4168 y(nulstr)142 b(-)47 b(character)e(string)h(used)h(to)g(represent)e
+(undefined)h(values)g(in)h(ASCII)f(table)0 4281 y(numval)142
+b(-)47 b(numerical)e(data)i(value,)f(of)h(the)g(appropriate)e(data)h
+(type)0 4394 y(offset)142 b(-)95 b(byte)46 b(offset)g(in)i(the)f(heap)f
+(to)h(the)g(first)g(element)e(of)j(the)f(vector)0 4507
+y(openfptr)f(-)h(pointer)f(to)h(a)g(currently)f(open)g(FITS)h(file)0
+4620 y(overlap)94 b(-)47 b(number)f(of)h(bytes)g(in)g(the)g(binary)f
+(table)g(heap)h(pointed)f(to)h(by)g(more)g(than)f(1)525
+4733 y(descriptor)0 4846 y(outcolnum-)f(output)h(column)g(number;)g
+(range)g(=)i(1)f(to)g(TFIELDS)f(+)i(1)0 4959 y(outfile)94
+b(-)47 b(and)g(optional)e(output)i(filename;)e(the)i(input)f(file)h
+(will)f(be)i(copied)e(to)h(this)f(prior)525 5072 y(to)h(opening)f(the)h
+(file)0 5185 y(outfptr)94 b(-)47 b(pointer)f(to)h(a)g('fitsfile')e
+(structure)h(describing)f(the)i(output)f(FITS)g(file.)0
+5297 y(pcount)142 b(-)47 b(value)f(of)i(the)e(PCOUNT)h(keyword)e(=)j
+(size)e(of)i(binary)e(table)g(heap)0 5410 y(previous)g(-)h(if)g(TRUE,)g
+(any)f(previous)g(HDUs)h(in)g(the)g(input)f(file)h(will)f(be)i(copied.)
+0 5523 y(repeat)142 b(-)47 b(length)f(of)h(column)f(vector)g(\(e.g.)h
+(12J\);)f(==)h(1)h(for)f(ASCII)f(table)0 5636 y(rmopt)190
+b(-)47 b(grouping)f(table)g(remove)g(option)g(parameter.)f(Allowed)h
+(values)g(are:)p eop
+%%Page: 155 163
+155 162 bop 3764 299 a Fj(155)525 555 y Fe(OPT_RM_GPT,)45
+b(OPT_RM_ENTRY,)f(OPT_RM_MBR,)h(and)i(OPT_RM_ALL.)0 668
 y(rootname)f(-)h(root)g(filename,)e(minus)h(any)h(extension)e(or)j
-(filtering)d(specifications)0 4281 y(rot)286 b(-)47 b(celestial)e
-(coordinate)g(rotation)h(angle)g(\(degrees\))0 4394 y(rowlen)142
+(filtering)d(specifications)0 781 y(rot)286 b(-)47 b(celestial)e
+(coordinate)g(rotation)h(angle)g(\(degrees\))0 894 y(rowlen)142
 b(-)47 b(length)f(of)h(a)h(table)e(row,)h(in)g(characters)e(or)i(bytes)
-0 4507 y(rowlist)94 b(-)47 b(sorted)f(list)h(of)g(row)g(numbers)f(to)h
-(be)g(deleted)f(from)g(the)h(table)0 4620 y(rownum)142
+0 1007 y(rowlist)94 b(-)47 b(sorted)f(list)h(of)g(row)g(numbers)f(to)h
+(be)g(deleted)f(from)g(the)h(table)0 1120 y(rownum)142
 b(-)47 b(number)f(of)h(the)g(row)g(\(first)f(row)h(=)h(1\))0
-4733 y(row_status)d(-)i(array)g(of)g(True/False)e(results)h(for)h(each)
-f(row)h(that)g(was)g(evaluated)0 4846 y(scale)190 b(-)47
-b(linear)f(scaling)g(factor;)g(true)g(value)h(=)g(\(FITS)g(value\))f(*)
-h(scale)f(+)i(zero)0 4959 y(second)142 b(-)47 b(second)f(within)g
-(minute)g(\(0)h(-)h(60.9999999999\))c(\(leapsecond!\))0
-5072 y(simple)142 b(-)47 b(TRUE)g(\(=1\))f(if)h(FITS)g(file)g(conforms)
-e(to)i(the)g(Standard,)f(else)g(FALSE)h(\(=0\))0 5185
-y(space)190 b(-)47 b(number)f(of)h(blank)g(spaces)f(to)h(leave)f
-(between)g(ASCII)g(table)h(columns)0 5297 y(status)142
+1233 y(rowrange)e(-)h(list)g(of)g(rows)f(or)i(row)f(ranges:)e
+('3,6-8,12,56-80')f(or)j('500-')0 1346 y(row_status)e(-)i(array)g(of)g
+(True/False)e(results)h(for)h(each)f(row)h(that)g(was)g(evaluated)0
+1458 y(scale)190 b(-)47 b(linear)f(scaling)g(factor;)g(true)g(value)h
+(=)g(\(FITS)g(value\))f(*)h(scale)f(+)i(zero)0 1571 y(second)142
+b(-)47 b(second)f(within)g(minute)g(\(0)h(-)h(60.9999999999\))c(\(leap)
+i(second!\))0 1684 y(simple)142 b(-)47 b(TRUE)g(\(=1\))f(if)h(FITS)g
+(file)g(conforms)e(to)i(the)g(Standard,)f(else)g(FALSE)h(\(=0\))0
+1797 y(space)190 b(-)47 b(number)f(of)h(blank)g(spaces)f(to)h(leave)f
+(between)g(ASCII)g(table)h(columns)0 1910 y(status)142
 b(-)47 b(returned)f(error)g(status)g(code)h(\(0)g(=)g(OK\))0
-5410 y(sum)286 b(-)47 b(32)g(bit)g(unsigned)f(checksum)f(value)0
-5523 y(tbcol)190 b(-)47 b(byte)g(position)e(in)i(row)g(to)g(start)g(of)
-g(column)f(\(1st)h(col)g(has)g(tbcol)f(=)h(1\))0 5636
+2023 y(sum)286 b(-)47 b(32)g(bit)g(unsigned)f(checksum)f(value)0
+2136 y(tbcol)190 b(-)47 b(byte)g(position)e(in)i(row)g(to)g(start)g(of)
+g(column)f(\(1st)h(col)g(has)g(tbcol)f(=)h(1\))0 2249
 y(tdisp)190 b(-)47 b(Fortran)f(style)g(display)g(format)g(for)h(the)g
-(table)f(column)p eop
-%%Page: 137 143
-137 142 bop 3764 299 a Fj(137)0 555 y Ff(tdimstr)94 b(-)47
-b(the)g(value)f(of)h(the)g(TDIMn)g(keyword)0 668 y(templt)142
-b(-)47 b(template)f(string)g(used)g(in)h(comparison)e
-(\(null-terminated\))0 781 y(tfields)94 b(-)47 b(number)f(of)h(fields)f
-(\(columns\))g(in)h(the)g(table)0 894 y(tfopt)190 b(-)47
-b(grouping)f(table)g(member)g(transfer)g(option)g(parameter.)f(Allowed)
-g(values)i(are:)525 1007 y(OPT_MCP_ADD,)d(and)j(OPT_MCP_MOV.)0
-1120 y(tform)190 b(-)47 b(format)f(of)h(the)g(column)f
-(\(null-terminated\);)d(allowed)j(values)g(are:)525 1233
-y(ASCII)g(tables:)94 b(Iw,)47 b(Aw,)g(Fww.dd,)f(Eww.dd,)f(or)j(Dww.dd)
-525 1346 y(Binary)e(tables:)g(rL,)h(rX,)g(rB,)g(rI,)g(rJ,)f(rA,)h(rAw,)
-g(rE,)g(rD,)g(rC,)g(rM)525 1458 y(where)f('w'=width)g(of)h(the)g
-(field,)f('d'=no.)g(of)h(decimals,)e('r'=repeat)g(count.)525
-1571 y(Variable)h(length)g(array)g(columns)g(are)h(denoted)f(by)h(a)g
-('1P')g(before)f(the)h(datatype)525 1684 y(character)e(\(e.g.,)h
-('1PJ'\).)94 b(When)47 b(creating)e(a)j(binary)e(table,)g(2)h(addition)
-f(tform)525 1797 y(datatype)g(codes)g(are)h(recognized)e(by)i(CFITSIO:)
-f('rU')g(and)h('rV')g(for)g(unsigned)525 1910 y(16-bit)f(and)h
-(unsigned)f(32-bit)g(integer,)f(respectively.)0 2136
-y(theap)190 b(-)47 b(zero)g(indexed)e(byte)i(offset)f(of)h(starting)f
-(address)g(of)h(the)g(heap)525 2249 y(relative)f(to)h(the)g(beginning)e
-(of)i(the)g(binary)f(table)g(data)0 2362 y(ttype)190
+(table)f(column)0 2362 y(tdimstr)94 b(-)47 b(the)g(value)f(of)h(the)g
+(TDIMn)g(keyword)0 2475 y(templt)142 b(-)47 b(template)f(string)g(used)
+g(in)h(comparison)e(\(null-terminated\))0 2588 y(tfields)94
+b(-)47 b(number)f(of)h(fields)f(\(columns\))g(in)h(the)g(table)0
+2700 y(tfopt)190 b(-)47 b(grouping)f(table)g(member)g(transfer)g
+(option)g(parameter.)f(Allowed)g(values)i(are:)525 2813
+y(OPT_MCP_ADD,)d(and)j(OPT_MCP_MOV.)0 2926 y(tform)190
+b(-)47 b(format)f(of)h(the)g(column)f(\(null-terminated\);)d(allowed)j
+(values)g(are:)525 3039 y(ASCII)g(tables:)94 b(Iw,)47
+b(Aw,)g(Fww.dd,)f(Eww.dd,)f(or)j(Dww.dd)525 3152 y(Binary)e(tables:)g
+(rL,)h(rX,)g(rB,)g(rI,)g(rJ,)f(rA,)h(rAw,)g(rE,)g(rD,)g(rC,)g(rM)525
+3265 y(where)f('w'=width)g(of)h(the)g(field,)f('d'=no.)g(of)h
+(decimals,)e('r'=repeat)g(count.)525 3378 y(Variable)h(length)g(array)g
+(columns)g(are)h(denoted)f(by)h(a)g('1P')g(before)f(the)h(data)f(type)
+525 3491 y(character)f(\(e.g.,)h('1PJ'\).)94 b(When)47
+b(creating)e(a)j(binary)e(table,)g(2)h(addition)f(tform)525
+3604 y(data)h(type)f(codes)h(are)g(recognized)e(by)i(CFITSIO:)e('rU')i
+(and)g('rV')f(for)h(unsigned)525 3717 y(16-bit)f(and)h(unsigned)f
+(32-bit)g(integer,)f(respectively.)0 3942 y(theap)190
+b(-)47 b(zero)g(indexed)e(byte)i(offset)f(of)h(starting)f(address)g(of)
+h(the)g(heap)525 4055 y(relative)f(to)h(the)g(beginning)e(of)i(the)g
+(binary)f(table)g(data)0 4168 y(tilesize)g(-)h(array)f(of)i(length)e
+(NAXIS)g(that)h(specifies)e(the)i(dimensions)e(of)525
+4281 y(the)i(image)f(compression)f(tiles)0 4394 y(ttype)190
 b(-)47 b(label)f(or)i(name)e(for)h(table)f(column)h
-(\(null-terminated\))0 2475 y(tunit)190 b(-)47 b(physical)f(unit)g(for)
-h(table)f(column)h(\(null-terminated\))0 2588 y(typechar)f(-)h
-(symbolic)f(code)g(of)h(the)g(table)g(column)f(datatype)0
-2700 y(typecode)g(-)h(datatype)f(code)g(of)h(the)g(table)g(column.)93
-b(The)47 b(negative)f(of)525 2813 y(the)h(value)f(indicates)g(a)h
-(variable)f(length)g(array)g(column.)764 2926 y(Datatype)618
-b(typecode)189 b(Mnemonic)764 3039 y(bit,)46 b(X)907
-b(1)381 b(TBIT)764 3152 y(byte,)46 b(B)811 b(11)381 b(TBYTE)764
-3265 y(logical,)45 b(L)668 b(14)381 b(TLOGICAL)764 3378
+(\(null-terminated\))0 4507 y(tunit)190 b(-)47 b(physical)f(unit)g(for)
+h(table)f(column)h(\(null-terminated\))0 4620 y(typechar)f(-)h
+(symbolic)f(code)g(of)h(the)g(table)g(column)f(data)g(type)0
+4733 y(typecode)g(-)h(data)g(type)f(code)h(of)g(the)g(table)f(column.)
+94 b(The)47 b(negative)e(of)525 4846 y(the)i(value)f(indicates)g(a)h
+(variable)f(length)g(array)g(column.)764 4959 y(Datatype)618
+b(typecode)189 b(Mnemonic)764 5072 y(bit,)46 b(X)907
+b(1)381 b(TBIT)764 5185 y(byte,)46 b(B)811 b(11)381 b(TBYTE)764
+5297 y(logical,)45 b(L)668 b(14)381 b(TLOGICAL)764 5410
 y(ASCII)46 b(character,)f(A)286 b(16)381 b(TSTRING)764
-3491 y(short)46 b(integer,)g(I)381 b(21)g(TSHORT)764
-3604 y(integer,)45 b(J)668 b(41)381 b(TINT32BIT)764 3717
-y(real,)46 b(E)811 b(42)381 b(TFLOAT)764 3830 y(double)46
-b(precision,)f(D)238 b(82)381 b(TDOUBLE)764 3942 y(complex,)45
-b(C)668 b(83)381 b(TCOMPLEX)764 4055 y(double)46 b(complex,)f(M)286
-b(163)381 b(TDBLCOMPLEX)0 4168 y(unit)238 b(-)47 b(the)g(physical)e
-(unit)i(string)f(\(e.g.,)g('km/s'\))g(for)h(a)g(keyword)0
-4281 y(urltype)94 b(-)47 b(the)g(file)g(type)f(of)h(the)g(FITS)g(file)g
-(\(file://,)e(ftp://,)h(mem://,)f(etc.\))0 4394 y(value)190
-b(-)47 b(the)g(keyword)f(value)g(string)g(\(70)h(char)g(max,)f
-(null-terminated\))0 4507 y(version)94 b(-)47 b(current)f(version)g
-(number)g(of)h(the)g(CFITSIO)f(library)0 4620 y(width)190
-b(-)47 b(width)f(of)i(the)e(character)g(string)g(field)0
-4733 y(xcol)238 b(-)47 b(number)f(of)h(the)g(column)f(containing)f(the)
-i(X)h(coordinate)d(values)0 4846 y(xinc)238 b(-)47 b(X)g(axis)g
-(coordinate)e(increment)g(at)j(reference)d(pixel)h(\(deg\))0
-4959 y(xpix)238 b(-)47 b(X)g(axis)g(pixel)f(location)0
-5072 y(xpos)238 b(-)47 b(X)g(axis)g(celestial)e(coordinate)g(\(usually)
-h(RA\))h(\(deg\))0 5185 y(xrefpix)94 b(-)47 b(X)g(axis)g(reference)e
-(pixel)i(array)f(location)0 5297 y(xrefval)94 b(-)47
+5523 y(short)46 b(integer,)g(I)381 b(21)g(TSHORT)764
+5636 y(integer,)45 b(J)668 b(41)381 b(TINT32BIT)p eop
+%%Page: 156 164
+156 163 bop 0 299 a Fj(156)1822 b Fh(APPENDIX)31 b(B.)61
+b(P)-8 b(ARAMETER)30 b(DEFINITIONS)764 555 y Fe(long)46
+b(long)h(integer,)e(K)191 b(81)381 b(TLONGLONG)764 668
+y(real,)46 b(E)811 b(42)381 b(TFLOAT)764 781 y(double)46
+b(precision,)f(D)238 b(82)381 b(TDOUBLE)764 894 y(complex,)45
+b(C)668 b(83)381 b(TCOMPLEX)764 1007 y(double)46 b(complex,)f(M)286
+b(163)381 b(TDBLCOMPLEX)620 1120 y(The)47 b(TLONGLONG)f(column)g(type)g
+(is)i(experimental)c(and)j(is)g(not)620 1233 y(recognized)e(in)j(the)f
+(official)e(FITS)i(Standard)e(document)0 1346 y(unit)238
+b(-)47 b(the)g(physical)e(unit)i(string)f(\(e.g.,)g('km/s'\))g(for)h(a)
+g(keyword)0 1458 y(unused)142 b(-)47 b(number)f(of)h(unused)f(bytes)h
+(in)g(the)g(binary)f(table)g(heap)0 1571 y(urltype)94
+b(-)47 b(the)g(file)g(type)f(of)h(the)g(FITS)g(file)g(\(file://,)e
+(ftp://,)h(mem://,)f(etc.\))0 1684 y(validheap-)g(returned)h(value)g(=)
+h(FALSE)g(if)g(any)g(of)g(the)g(variable)e(length)i(array)525
+1797 y(address)f(are)h(outside)f(the)g(valid)h(range)f(of)h(addresses)f
+(in)h(the)g(heap)0 1910 y(value)190 b(-)47 b(the)g(keyword)f(value)g
+(string)g(\(70)h(char)g(max,)f(null-terminated\))0 2023
+y(version)94 b(-)47 b(current)f(version)g(number)g(of)h(the)g(CFITSIO)f
+(library)0 2136 y(width)190 b(-)47 b(width)f(of)i(the)e(character)g
+(string)g(field)0 2249 y(xcol)238 b(-)47 b(number)f(of)h(the)g(column)f
+(containing)f(the)i(X)h(coordinate)d(values)0 2362 y(xinc)238
+b(-)47 b(X)g(axis)g(coordinate)e(increment)g(at)j(reference)d(pixel)h
+(\(deg\))0 2475 y(xpix)238 b(-)47 b(X)g(axis)g(pixel)f(location)0
+2588 y(xpos)238 b(-)47 b(X)g(axis)g(celestial)e(coordinate)g(\(usually)
+h(RA\))h(\(deg\))0 2700 y(xrefpix)94 b(-)47 b(X)g(axis)g(reference)e
+(pixel)i(array)f(location)0 2813 y(xrefval)94 b(-)47
 b(X)g(axis)g(coordinate)e(value)h(at)i(the)f(reference)e(pixel)h
-(\(deg\))0 5410 y(ycol)238 b(-)47 b(number)f(of)h(the)g(column)f
-(containing)f(the)i(X)h(coordinate)d(values)0 5523 y(year)238
+(\(deg\))0 2926 y(ycol)238 b(-)47 b(number)f(of)h(the)g(column)f
+(containing)f(the)i(X)h(coordinate)d(values)0 3039 y(year)238
 b(-)47 b(calendar)f(year)g(\(e.g.)h(1999,)f(2000,)g(etc\))0
-5636 y(yinc)238 b(-)47 b(Y)g(axis)g(coordinate)e(increment)g(at)j
-(reference)d(pixel)h(\(deg\))p eop
-%%Page: 138 144
-138 143 bop 0 299 a Fj(138)1822 b Fh(APPENDIX)31 b(B.)61
-b(P)-8 b(ARAMETER)30 b(DEFINITIONS)0 555 y Ff(ypix)238
-b(-)47 b(y)g(axis)g(pixel)f(location)0 668 y(ypos)238
-b(-)47 b(y)g(axis)g(celestial)e(coordinate)g(\(usually)h(DEC\))h
-(\(deg\))0 781 y(yrefpix)94 b(-)47 b(Y)g(axis)g(reference)e(pixel)i
-(array)f(location)0 894 y(yrefval)94 b(-)47 b(Y)g(axis)g(coordinate)e
-(value)h(at)i(the)f(reference)e(pixel)h(\(deg\))0 1007
-y(zero)238 b(-)47 b(scaling)f(offset;)g(true)g(value)h(=)g(\(FITS)f
-(value\))h(*)g(scale)f(+)i(zero)p eop
-%%Page: 139 145
-139 144 bop 0 1225 a Fg(App)5 b(endix)65 b(C)0 1687 y
+3152 y(yinc)238 b(-)47 b(Y)g(axis)g(coordinate)e(increment)g(at)j
+(reference)d(pixel)h(\(deg\))0 3265 y(ypix)238 b(-)47
+b(y)g(axis)g(pixel)f(location)0 3378 y(ypos)238 b(-)47
+b(y)g(axis)g(celestial)e(coordinate)g(\(usually)h(DEC\))h(\(deg\))0
+3491 y(yrefpix)94 b(-)47 b(Y)g(axis)g(reference)e(pixel)i(array)f
+(location)0 3604 y(yrefval)94 b(-)47 b(Y)g(axis)g(coordinate)e(value)h
+(at)i(the)f(reference)e(pixel)h(\(deg\))0 3717 y(zero)238
+b(-)47 b(scaling)f(offset;)g(true)g(value)h(=)g(\(FITS)f(value\))h(*)g
+(scale)f(+)i(zero)p eop
+%%Page: 157 165
+157 164 bop 0 1225 a Fg(App)5 b(endix)65 b(C)0 1687 y
 Fm(CFITSIO)76 b(Error)h(Status)h(Co)6 b(des)0 2180 y
 Fj(The)28 b(follo)m(wing)e(table)i(lists)f(all)g(the)h(error)g(status)g
 (co)s(des)g(used)f(b)m(y)h(CFITSIO.)f(Programmers)h(are)g(encouraged)0
 2293 y(to)37 b(use)e(the)h(sym)m(b)s(olic)f(mnemonics)f(\(de\014ned)h
 (in)g(the)h(\014le)f(\014tsio.h\))h(rather)f(than)h(the)g(actual)g(in)m
 (teger)h(status)0 2406 y(v)-5 b(alues)30 b(to)h(impro)m(v)m(e)f(the)h
-(readabilit)m(y)d(of)j(their)e(co)s(de.)48 2665 y Ff(Symbolic)45
+(readabilit)m(y)d(of)j(their)e(co)s(de.)48 2665 y Fe(Symbolic)45
 b(Const)190 b(Value)237 b(Meaning)48 2778 y(--------------)187
 b(-----)94 b(------------------------)o(----)o(---)o(----)o(----)o(--)
 1002 2891 y(0)191 b(OK,)47 b(no)g(error)48 3004 y(SAME_FILE)427
@@ -11446,175 +12652,179 @@ b(to)h(register)f(too)h(many)g(IO)g(drivers)48 4924 y
 (DRIVER_INIT_FAILED)c(123)142 b(driver)46 b(initialization)e(failed)48
 5036 y(NO_MATCHING_DRIVER)f(124)142 b(matching)45 b(driver)i(is)g(not)g
 (registered)48 5149 y(URL_PARSE_ERROR)187 b(125)142 b(failed)46
-b(to)h(parse)g(input)f(file)h(URL)48 5375 y(SHARED_BADARG)235
-b(151)190 b(bad)47 b(argument)e(in)j(shared)e(memory)g(driver)48
-5488 y(SHARED_NULPTR)235 b(152)190 b(null)47 b(pointer)e(passed)h(as)i
-(an)f(argument)48 5601 y(SHARED_TABFULL)187 b(153)j(no)47
-b(more)g(free)f(shared)g(memory)h(handles)48 5714 y(SHARED_NOTINIT)187
-b(154)j(shared)46 b(memory)g(driver)g(is)h(not)g(initialized)1882
-5942 y Fj(139)p eop
-%%Page: 140 146
-140 145 bop 0 299 a Fj(140)1589 b Fh(APPENDIX)31 b(C.)61
+b(to)h(parse)g(input)f(file)h(URL)48 5262 y(RANGE_PARSE_ERROR)91
+b(126)142 b(parse)46 b(error)h(in)g(range)f(list)48 5488
+y(SHARED_BADARG)235 b(151)190 b(bad)47 b(argument)e(in)j(shared)e
+(memory)g(driver)48 5601 y(SHARED_NULPTR)235 b(152)190
+b(null)47 b(pointer)e(passed)h(as)i(an)f(argument)48
+5714 y(SHARED_TABFULL)187 b(153)j(no)47 b(more)g(free)f(shared)g
+(memory)h(handles)1882 5942 y Fj(157)p eop
+%%Page: 158 166
+158 165 bop 0 299 a Fj(158)1589 b Fh(APPENDIX)31 b(C.)61
 b(CFITSIO)29 b(ERR)m(OR)h(ST)-8 b(A)g(TUS)30 b(CODES)48
-555 y Ff(SHARED_IPCERR)235 b(155)190 b(IPC)47 b(error)f(returned)g(by)h
-(a)g(system)f(call)48 668 y(SHARED_NOMEM)283 b(156)190
-b(no)47 b(memory)f(in)h(shared)f(memory)h(driver)48 781
-y(SHARED_AGAIN)283 b(157)190 b(resource)45 b(deadlock)h(would)g(occur)
-48 894 y(SHARED_NOFILE)235 b(158)190 b(attempt)46 b(to)h(open/create)e
-(lock)h(file)h(failed)48 1007 y(SHARED_NORESIZE)139 b(159)190
-b(shared)46 b(memory)g(block)g(cannot)h(be)g(resized)f(at)h(the)g
-(moment)48 1233 y(HEADER_NOT_EMPTY)91 b(201)190 b(header)46
-b(already)g(contains)f(keywords)48 1346 y(KEY_NO_EXIST)283
-b(202)190 b(keyword)46 b(not)h(found)f(in)h(header)48
-1458 y(KEY_OUT_BOUNDS)187 b(203)j(keyword)46 b(record)g(number)g(is)h
-(out)g(of)g(bounds)48 1571 y(VALUE_UNDEFINED)139 b(204)190
-b(keyword)46 b(value)g(field)g(is)i(blank)48 1684 y(NO_QUOTE)475
-b(205)190 b(string)46 b(is)h(missing)f(the)h(closing)f(quote)48
-1797 y(BAD_KEYCHAR)331 b(207)190 b(illegal)46 b(character)f(in)i
-(keyword)f(name)h(or)g(card)48 1910 y(BAD_ORDER)427 b(208)190
-b(required)45 b(keywords)h(out)h(of)g(order)48 2023 y(NOT_POS_INT)331
-b(209)190 b(keyword)46 b(value)g(is)h(not)g(a)h(positive)d(integer)48
-2136 y(NO_END)571 b(210)190 b(couldn't)45 b(find)i(END)g(keyword)48
-2249 y(BAD_BITPIX)379 b(211)190 b(illegal)46 b(BITPIX)g(keyword)g
-(value)48 2362 y(BAD_NAXIS)427 b(212)190 b(illegal)46
-b(NAXIS)g(keyword)g(value)48 2475 y(BAD_NAXES)427 b(213)190
-b(illegal)46 b(NAXISn)g(keyword)g(value)48 2588 y(BAD_PCOUNT)379
-b(214)190 b(illegal)46 b(PCOUNT)g(keyword)g(value)48
-2700 y(BAD_GCOUNT)379 b(215)190 b(illegal)46 b(GCOUNT)g(keyword)g
-(value)48 2813 y(BAD_TFIELDS)331 b(216)190 b(illegal)46
-b(TFIELDS)g(keyword)f(value)48 2926 y(NEG_WIDTH)427 b(217)190
-b(negative)45 b(table)i(row)g(size)48 3039 y(NEG_ROWS)475
-b(218)190 b(negative)45 b(number)i(of)g(rows)f(in)i(table)48
-3152 y(COL_NOT_FOUND)235 b(219)190 b(column)46 b(with)h(this)f(name)h
-(not)g(found)f(in)h(table)48 3265 y(BAD_SIMPLE)379 b(220)190
-b(illegal)46 b(value)g(of)h(SIMPLE)f(keyword)48 3378
-y(NO_SIMPLE)427 b(221)190 b(Primary)46 b(array)g(doesn't)g(start)g
-(with)h(SIMPLE)48 3491 y(NO_BITPIX)427 b(222)190 b(Second)46
-b(keyword)g(not)h(BITPIX)48 3604 y(NO_NAXIS)475 b(223)190
-b(Third)46 b(keyword)g(not)h(NAXIS)48 3717 y(NO_NAXES)475
-b(224)190 b(Couldn't)45 b(find)i(all)g(the)g(NAXISn)f(keywords)48
-3830 y(NO_XTENSION)331 b(225)190 b(HDU)47 b(doesn't)f(start)g(with)h
-(XTENSION)e(keyword)48 3942 y(NOT_ATABLE)379 b(226)190
-b(the)47 b(CHDU)f(is)i(not)f(an)g(ASCII)f(table)g(extension)48
-4055 y(NOT_BTABLE)379 b(227)190 b(the)47 b(CHDU)f(is)i(not)f(a)g
-(binary)f(table)g(extension)48 4168 y(NO_PCOUNT)427 b(228)190
-b(couldn't)45 b(find)i(PCOUNT)f(keyword)48 4281 y(NO_GCOUNT)427
-b(229)190 b(couldn't)45 b(find)i(GCOUNT)f(keyword)48
-4394 y(NO_TFIELDS)379 b(230)190 b(couldn't)45 b(find)i(TFIELDS)f
-(keyword)48 4507 y(NO_TBCOL)475 b(231)190 b(couldn't)45
-b(find)i(TBCOLn)f(keyword)48 4620 y(NO_TFORM)475 b(232)190
-b(couldn't)45 b(find)i(TFORMn)f(keyword)48 4733 y(NOT_IMAGE)427
-b(233)190 b(the)47 b(CHDU)f(is)i(not)f(an)g(IMAGE)f(extension)48
-4846 y(BAD_TBCOL)427 b(234)190 b(TBCOLn)46 b(keyword)g(value)g(<)i(0)f
-(or)g(>)h(rowlength)48 4959 y(NOT_TABLE)427 b(235)190
-b(the)47 b(CHDU)f(is)i(not)f(a)g(table)48 5072 y(COL_TOO_WIDE)283
-b(236)190 b(column)46 b(is)h(too)g(wide)g(to)g(fit)g(in)g(table)48
-5185 y(COL_NOT_UNIQUE)187 b(237)j(more)47 b(than)f(1)i(column)e(name)g
-(matches)g(template)48 5297 y(BAD_ROW_WIDTH)235 b(241)190
-b(sum)47 b(of)g(column)f(widths)g(not)h(=)h(NAXIS1)48
-5410 y(UNKNOWN_EXT)331 b(251)190 b(unrecognizable)44
-b(FITS)i(extension)g(type)48 5523 y(UNKNOWN_REC)331 b(252)190
-b(unknown)46 b(record;)g(1st)g(keyword)g(not)h(SIMPLE)f(or)h(XTENSION)
-48 5636 y(END_JUNK)475 b(253)190 b(END)47 b(keyword)f(is)h(not)g(blank)
-p eop
-%%Page: 141 147
-141 146 bop 3764 299 a Fj(141)48 555 y Ff(BAD_HEADER_FILL)139
-b(254)190 b(Header)46 b(fill)h(area)f(contains)g(non-blank)f(chars)48
-668 y(BAD_DATA_FILL)235 b(255)190 b(Illegal)46 b(data)g(fill)h(bytes)f
-(\(not)h(zero)g(or)g(blank\))48 781 y(BAD_TFORM)427 b(261)190
-b(illegal)46 b(TFORM)g(format)g(code)48 894 y(BAD_TFORM_DTYPE)139
-b(262)190 b(unrecognizable)44 b(TFORM)i(datatype)g(code)48
-1007 y(BAD_TDIM)475 b(263)190 b(illegal)46 b(TDIMn)g(keyword)g(value)48
-1233 y(BAD_HDU_NUM)331 b(301)190 b(HDU)47 b(number)f(<)h(1)h(or)f(>)g
-(MAXHDU)48 1346 y(BAD_COL_NUM)331 b(302)190 b(column)46
-b(number)g(<)i(1)f(or)g(>)h(tfields)48 1458 y(NEG_FILE_POS)283
-b(304)190 b(tried)46 b(to)h(move)g(to)g(negative)f(byte)g(location)g
-(in)h(file)48 1571 y(NEG_BYTES)427 b(306)190 b(tried)46
-b(to)h(read)g(or)g(write)g(negative)e(number)h(of)h(bytes)48
-1684 y(BAD_ROW_NUM)331 b(307)190 b(illegal)46 b(starting)f(row)i
-(number)f(in)h(table)48 1797 y(BAD_ELEM_NUM)283 b(308)190
-b(illegal)46 b(starting)f(element)h(number)g(in)h(vector)48
-1910 y(NOT_ASCII_COL)235 b(309)190 b(this)47 b(is)g(not)g(an)g(ASCII)f
-(string)g(column)48 2023 y(NOT_LOGICAL_COL)139 b(310)190
-b(this)47 b(is)g(not)g(a)g(logical)f(datatype)f(column)48
-2136 y(BAD_ATABLE_FORMAT)e(311)190 b(ASCII)46 b(table)h(column)f(has)h
-(wrong)f(format)48 2249 y(BAD_BTABLE_FORMAT)d(312)190
-b(Binary)46 b(table)g(column)g(has)h(wrong)g(format)48
-2362 y(NO_NULL)523 b(314)190 b(null)47 b(value)f(has)h(not)g(been)f
-(defined)48 2475 y(NOT_VARI_LEN)283 b(317)190 b(this)47
-b(is)g(not)g(a)g(variable)f(length)g(column)48 2588 y(BAD_DIMEN)427
-b(320)190 b(illegal)46 b(number)g(of)h(dimensions)e(in)i(array)48
-2700 y(BAD_PIX_NUM)331 b(321)190 b(first)46 b(pixel)h(number)f(greater)
-g(than)g(last)h(pixel)48 2813 y(ZERO_SCALE)379 b(322)190
-b(illegal)46 b(BSCALE)g(or)h(TSCALn)f(keyword)g(=)h(0)48
-2926 y(NEG_AXIS)475 b(323)190 b(illegal)46 b(axis)g(length)g(<)i(1)48
-3152 y(NOT_GROUP_TABLE)330 b(340)142 b(Grouping)46 b(function)f(error)
-48 3265 y(HDU_ALREADY_MEMBER)186 b(341)48 3378 y(MEMBER_NOT_FOUND)282
-b(342)48 3491 y(GROUP_NOT_FOUND)330 b(343)48 3604 y(BAD_GROUP_ID)474
-b(344)48 3717 y(TOO_MANY_HDUS_TRACKED)42 b(345)48 3830
-y(HDU_ALREADY_TRACKED)138 b(346)48 3942 y(BAD_OPTION)570
-b(347)48 4055 y(IDENTICAL_POINTERS)186 b(348)48 4281
-y(NGP_NO_MEMORY)426 b(360)238 b(malloc)46 b(failed)48
-4394 y(NGP_READ_ERR)474 b(361)238 b(read)46 b(error)h(from)f(file)48
-4507 y(NGP_NUL_PTR)522 b(362)238 b(null)46 b(pointer)g(passed)g(as)h
-(an)g(argument.)1575 4620 y(Passing)f(null)g(pointer)g(as)h(a)h(name)f
-(of)1575 4733 y(template)f(file)g(raises)g(this)h(error)48
-4846 y(NGP_EMPTY_CURLINE)234 b(363)k(line)46 b(read)h(seems)f(to)h(be)h
-(empty)e(\(used)1575 4959 y(internally\))48 5072 y
+555 y Fe(SHARED_NOTINIT)187 b(154)j(shared)46 b(memory)g(driver)g(is)h
+(not)g(initialized)48 668 y(SHARED_IPCERR)235 b(155)190
+b(IPC)47 b(error)f(returned)g(by)h(a)g(system)f(call)48
+781 y(SHARED_NOMEM)283 b(156)190 b(no)47 b(memory)f(in)h(shared)f
+(memory)h(driver)48 894 y(SHARED_AGAIN)283 b(157)190
+b(resource)45 b(deadlock)h(would)g(occur)48 1007 y(SHARED_NOFILE)235
+b(158)190 b(attempt)46 b(to)h(open/create)e(lock)h(file)h(failed)48
+1120 y(SHARED_NORESIZE)139 b(159)190 b(shared)46 b(memory)g(block)g
+(cannot)h(be)g(resized)f(at)h(the)g(moment)48 1346 y(HEADER_NOT_EMPTY)
+91 b(201)190 b(header)46 b(already)g(contains)f(keywords)48
+1458 y(KEY_NO_EXIST)283 b(202)190 b(keyword)46 b(not)h(found)f(in)h
+(header)48 1571 y(KEY_OUT_BOUNDS)187 b(203)j(keyword)46
+b(record)g(number)g(is)h(out)g(of)g(bounds)48 1684 y(VALUE_UNDEFINED)
+139 b(204)190 b(keyword)46 b(value)g(field)g(is)i(blank)48
+1797 y(NO_QUOTE)475 b(205)190 b(string)46 b(is)h(missing)f(the)h
+(closing)f(quote)48 1910 y(BAD_KEYCHAR)331 b(207)190
+b(illegal)46 b(character)f(in)i(keyword)f(name)h(or)g(card)48
+2023 y(BAD_ORDER)427 b(208)190 b(required)45 b(keywords)h(out)h(of)g
+(order)48 2136 y(NOT_POS_INT)331 b(209)190 b(keyword)46
+b(value)g(is)h(not)g(a)h(positive)d(integer)48 2249 y(NO_END)571
+b(210)190 b(couldn't)45 b(find)i(END)g(keyword)48 2362
+y(BAD_BITPIX)379 b(211)190 b(illegal)46 b(BITPIX)g(keyword)g(value)48
+2475 y(BAD_NAXIS)427 b(212)190 b(illegal)46 b(NAXIS)g(keyword)g(value)
+48 2588 y(BAD_NAXES)427 b(213)190 b(illegal)46 b(NAXISn)g(keyword)g
+(value)48 2700 y(BAD_PCOUNT)379 b(214)190 b(illegal)46
+b(PCOUNT)g(keyword)g(value)48 2813 y(BAD_GCOUNT)379 b(215)190
+b(illegal)46 b(GCOUNT)g(keyword)g(value)48 2926 y(BAD_TFIELDS)331
+b(216)190 b(illegal)46 b(TFIELDS)g(keyword)f(value)48
+3039 y(NEG_WIDTH)427 b(217)190 b(negative)45 b(table)i(row)g(size)48
+3152 y(NEG_ROWS)475 b(218)190 b(negative)45 b(number)i(of)g(rows)f(in)i
+(table)48 3265 y(COL_NOT_FOUND)235 b(219)190 b(column)46
+b(with)h(this)f(name)h(not)g(found)f(in)h(table)48 3378
+y(BAD_SIMPLE)379 b(220)190 b(illegal)46 b(value)g(of)h(SIMPLE)f
+(keyword)48 3491 y(NO_SIMPLE)427 b(221)190 b(Primary)46
+b(array)g(doesn't)g(start)g(with)h(SIMPLE)48 3604 y(NO_BITPIX)427
+b(222)190 b(Second)46 b(keyword)g(not)h(BITPIX)48 3717
+y(NO_NAXIS)475 b(223)190 b(Third)46 b(keyword)g(not)h(NAXIS)48
+3830 y(NO_NAXES)475 b(224)190 b(Couldn't)45 b(find)i(all)g(the)g
+(NAXISn)f(keywords)48 3942 y(NO_XTENSION)331 b(225)190
+b(HDU)47 b(doesn't)f(start)g(with)h(XTENSION)e(keyword)48
+4055 y(NOT_ATABLE)379 b(226)190 b(the)47 b(CHDU)f(is)i(not)f(an)g
+(ASCII)f(table)g(extension)48 4168 y(NOT_BTABLE)379 b(227)190
+b(the)47 b(CHDU)f(is)i(not)f(a)g(binary)f(table)g(extension)48
+4281 y(NO_PCOUNT)427 b(228)190 b(couldn't)45 b(find)i(PCOUNT)f(keyword)
+48 4394 y(NO_GCOUNT)427 b(229)190 b(couldn't)45 b(find)i(GCOUNT)f
+(keyword)48 4507 y(NO_TFIELDS)379 b(230)190 b(couldn't)45
+b(find)i(TFIELDS)f(keyword)48 4620 y(NO_TBCOL)475 b(231)190
+b(couldn't)45 b(find)i(TBCOLn)f(keyword)48 4733 y(NO_TFORM)475
+b(232)190 b(couldn't)45 b(find)i(TFORMn)f(keyword)48
+4846 y(NOT_IMAGE)427 b(233)190 b(the)47 b(CHDU)f(is)i(not)f(an)g(IMAGE)
+f(extension)48 4959 y(BAD_TBCOL)427 b(234)190 b(TBCOLn)46
+b(keyword)g(value)g(<)i(0)f(or)g(>)h(rowlength)48 5072
+y(NOT_TABLE)427 b(235)190 b(the)47 b(CHDU)f(is)i(not)f(a)g(table)48
+5185 y(COL_TOO_WIDE)283 b(236)190 b(column)46 b(is)h(too)g(wide)g(to)g
+(fit)g(in)g(table)48 5297 y(COL_NOT_UNIQUE)187 b(237)j(more)47
+b(than)f(1)i(column)e(name)g(matches)g(template)48 5410
+y(BAD_ROW_WIDTH)235 b(241)190 b(sum)47 b(of)g(column)f(widths)g(not)h
+(=)h(NAXIS1)48 5523 y(UNKNOWN_EXT)331 b(251)190 b(unrecognizable)44
+b(FITS)i(extension)g(type)48 5636 y(UNKNOWN_REC)331 b(252)190
+b(unknown)46 b(record;)g(1st)g(keyword)g(not)h(SIMPLE)f(or)h(XTENSION)p
+eop
+%%Page: 159 167
+159 166 bop 3764 299 a Fj(159)48 555 y Fe(END_JUNK)475
+b(253)190 b(END)47 b(keyword)f(is)h(not)g(blank)48 668
+y(BAD_HEADER_FILL)139 b(254)190 b(Header)46 b(fill)h(area)f(contains)g
+(non-blank)f(chars)48 781 y(BAD_DATA_FILL)235 b(255)190
+b(Illegal)46 b(data)g(fill)h(bytes)f(\(not)h(zero)g(or)g(blank\))48
+894 y(BAD_TFORM)427 b(261)190 b(illegal)46 b(TFORM)g(format)g(code)48
+1007 y(BAD_TFORM_DTYPE)139 b(262)190 b(unrecognizable)44
+b(TFORM)i(data)h(type)f(code)48 1120 y(BAD_TDIM)475 b(263)190
+b(illegal)46 b(TDIMn)g(keyword)g(value)48 1233 y(BAD_HEAP_PTR)283
+b(264)190 b(invalid)46 b(BINTABLE)f(heap)i(pointer)f(is)h(out)g(of)g
+(range)48 1458 y(BAD_HDU_NUM)331 b(301)190 b(HDU)47 b(number)f(<)h(1)48
+1571 y(BAD_COL_NUM)331 b(302)190 b(column)46 b(number)g(<)i(1)f(or)g(>)
+h(tfields)48 1684 y(NEG_FILE_POS)283 b(304)190 b(tried)46
+b(to)h(move)g(to)g(negative)f(byte)g(location)g(in)h(file)48
+1797 y(NEG_BYTES)427 b(306)190 b(tried)46 b(to)h(read)g(or)g(write)g
+(negative)e(number)h(of)h(bytes)48 1910 y(BAD_ROW_NUM)331
+b(307)190 b(illegal)46 b(starting)f(row)i(number)f(in)h(table)48
+2023 y(BAD_ELEM_NUM)283 b(308)190 b(illegal)46 b(starting)f(element)h
+(number)g(in)h(vector)48 2136 y(NOT_ASCII_COL)235 b(309)190
+b(this)47 b(is)g(not)g(an)g(ASCII)f(string)g(column)48
+2249 y(NOT_LOGICAL_COL)139 b(310)190 b(this)47 b(is)g(not)g(a)g
+(logical)f(data)h(type)f(column)48 2362 y(BAD_ATABLE_FORMAT)d(311)190
+b(ASCII)46 b(table)h(column)f(has)h(wrong)f(format)48
+2475 y(BAD_BTABLE_FORMAT)d(312)190 b(Binary)46 b(table)g(column)g(has)h
+(wrong)g(format)48 2588 y(NO_NULL)523 b(314)190 b(null)47
+b(value)f(has)h(not)g(been)f(defined)48 2700 y(NOT_VARI_LEN)283
+b(317)190 b(this)47 b(is)g(not)g(a)g(variable)f(length)g(column)48
+2813 y(BAD_DIMEN)427 b(320)190 b(illegal)46 b(number)g(of)h(dimensions)
+e(in)i(array)48 2926 y(BAD_PIX_NUM)331 b(321)190 b(first)46
+b(pixel)h(number)f(greater)g(than)g(last)h(pixel)48 3039
+y(ZERO_SCALE)379 b(322)190 b(illegal)46 b(BSCALE)g(or)h(TSCALn)f
+(keyword)g(=)h(0)48 3152 y(NEG_AXIS)475 b(323)190 b(illegal)46
+b(axis)g(length)g(<)i(1)48 3378 y(NOT_GROUP_TABLE)330
+b(340)142 b(Grouping)46 b(function)f(error)48 3491 y
+(HDU_ALREADY_MEMBER)186 b(341)48 3604 y(MEMBER_NOT_FOUND)282
+b(342)48 3717 y(GROUP_NOT_FOUND)330 b(343)48 3830 y(BAD_GROUP_ID)474
+b(344)48 3942 y(TOO_MANY_HDUS_TRACKED)42 b(345)48 4055
+y(HDU_ALREADY_TRACKED)138 b(346)48 4168 y(BAD_OPTION)570
+b(347)48 4281 y(IDENTICAL_POINTERS)186 b(348)48 4394
+y(BAD_GROUP_ATTACH)282 b(349)48 4507 y(BAD_GROUP_DETACH)g(350)48
+4733 y(NGP_NO_MEMORY)426 b(360)238 b(malloc)46 b(failed)48
+4846 y(NGP_READ_ERR)474 b(361)238 b(read)46 b(error)h(from)f(file)48
+4959 y(NGP_NUL_PTR)522 b(362)238 b(null)46 b(pointer)g(passed)g(as)h
+(an)g(argument.)1575 5072 y(Passing)f(null)g(pointer)g(as)h(a)h(name)f
+(of)1575 5185 y(template)f(file)g(raises)g(this)h(error)48
+5297 y(NGP_EMPTY_CURLINE)234 b(363)k(line)46 b(read)h(seems)f(to)h(be)h
+(empty)e(\(used)1575 5410 y(internally\))48 5523 y
 (NGP_UNREAD_QUEUE_FULL)c(364)238 b(cannot)46 b(unread)g(more)g(then)h
-(1)g(line)g(\(or)g(single)1575 5185 y(line)g(twice\))48
-5297 y(NGP_INC_NESTING)330 b(365)238 b(too)46 b(deep)h(include)f(file)h
-(nesting)e(\(infinite)1575 5410 y(loop,)h(template)g(includes)f(itself)
-i(?\))48 5523 y(NGP_ERR_FOPEN)426 b(366)238 b(fopen\(\))45
-b(failed,)h(cannot)g(open)h(template)e(file)48 5636 y(NGP_EOF)714
-b(367)238 b(end)46 b(of)i(file)e(encountered)f(and)i(not)g(expected)p
+(1)g(line)g(\(or)g(single)1575 5636 y(line)g(twice\))p
 eop
-%%Page: 142 148
-142 147 bop 0 299 a Fj(142)1589 b Fh(APPENDIX)31 b(C.)61
+%%Page: 160 168
+160 167 bop 0 299 a Fj(160)1589 b Fh(APPENDIX)31 b(C.)61
 b(CFITSIO)29 b(ERR)m(OR)h(ST)-8 b(A)g(TUS)30 b(CODES)48
-555 y Ff(NGP_BAD_ARG)522 b(368)238 b(bad)46 b(arguments)g(passed.)g
-(Usually)f(means)1575 668 y(internal)h(parser)g(error.)g(Should)g(not)h
-(happen)48 781 y(NGP_TOKEN_NOT_EXPECT)90 b(369)238 b(token)46
-b(not)h(expected)e(here)48 1007 y(BAD_I2C)523 b(401)190
-b(bad)47 b(int)g(to)g(formatted)e(string)h(conversion)48
-1120 y(BAD_F2C)523 b(402)190 b(bad)47 b(float)f(to)h(formatted)f
-(string)g(conversion)48 1233 y(BAD_INTKEY)379 b(403)190
+555 y Fe(NGP_INC_NESTING)330 b(365)238 b(too)46 b(deep)h(include)f
+(file)h(nesting)e(\(infinite)1575 668 y(loop,)h(template)g(includes)f
+(itself)i(?\))48 781 y(NGP_ERR_FOPEN)426 b(366)238 b(fopen\(\))45
+b(failed,)h(cannot)g(open)h(template)e(file)48 894 y(NGP_EOF)714
+b(367)238 b(end)46 b(of)i(file)e(encountered)f(and)i(not)g(expected)48
+1007 y(NGP_BAD_ARG)522 b(368)238 b(bad)46 b(arguments)g(passed.)g
+(Usually)f(means)1575 1120 y(internal)h(parser)g(error.)g(Should)g(not)
+h(happen)48 1233 y(NGP_TOKEN_NOT_EXPECT)90 b(369)238
+b(token)46 b(not)h(expected)e(here)48 1458 y(BAD_I2C)523
+b(401)190 b(bad)47 b(int)g(to)g(formatted)e(string)h(conversion)48
+1571 y(BAD_F2C)523 b(402)190 b(bad)47 b(float)f(to)h(formatted)f
+(string)g(conversion)48 1684 y(BAD_INTKEY)379 b(403)190
 b(can't)46 b(interpret)g(keyword)f(value)i(as)g(integer)48
-1346 y(BAD_LOGICALKEY)187 b(404)j(can't)46 b(interpret)g(keyword)f
-(value)i(as)g(logical)48 1458 y(BAD_FLOATKEY)283 b(405)190
+1797 y(BAD_LOGICALKEY)187 b(404)j(can't)46 b(interpret)g(keyword)f
+(value)i(as)g(logical)48 1910 y(BAD_FLOATKEY)283 b(405)190
 b(can't)46 b(interpret)g(keyword)f(value)i(as)g(float)48
-1571 y(BAD_DOUBLEKEY)235 b(406)190 b(can't)46 b(interpret)g(keyword)f
-(value)i(as)g(double)48 1684 y(BAD_C2I)523 b(407)190
+2023 y(BAD_DOUBLEKEY)235 b(406)190 b(can't)46 b(interpret)g(keyword)f
+(value)i(as)g(double)48 2136 y(BAD_C2I)523 b(407)190
 b(bad)47 b(formatted)e(string)h(to)h(int)g(conversion)48
-1797 y(BAD_C2F)523 b(408)190 b(bad)47 b(formatted)e(string)h(to)h
-(float)g(conversion)48 1910 y(BAD_C2D)523 b(409)190 b(bad)47
-b(formatted)e(string)h(to)h(double)f(conversion)48 2023
+2249 y(BAD_C2F)523 b(408)190 b(bad)47 b(formatted)e(string)h(to)h
+(float)g(conversion)48 2362 y(BAD_C2D)523 b(409)190 b(bad)47
+b(formatted)e(string)h(to)h(double)f(conversion)48 2475
 y(BAD_DATATYPE)283 b(410)190 b(illegal)46 b(datatype)f(code)i(value)48
-2136 y(BAD_DECIM)427 b(411)190 b(bad)47 b(number)f(of)h(decimal)f
-(places)g(specified)48 2249 y(NUM_OVERFLOW)283 b(412)190
-b(overflow)45 b(during)i(datatype)e(conversion)48 2362
-y(DATA_COMPRESSION_ERR)137 b(413)95 b(error)46 b(compressing)f(image)48
-2475 y(DATA_DECOMPRESSION_ERR)c(414)95 b(error)46 b(uncompressing)f
-(image)48 2700 y(BAD_DATE)475 b(420)190 b(error)46 b(in)h(date)g(or)g
-(time)g(conversion)48 2926 y(PARSE_SYNTAX_ERR)91 b(431)190
-b(syntax)46 b(error)g(in)i(parser)e(expression)48 3039
-y(PARSE_BAD_TYPE)187 b(432)j(expression)45 b(did)i(not)g(evaluate)e(to)
-i(desired)f(type)48 3152 y(PARSE_LRG_VECTOR)91 b(433)190
-b(vector)46 b(result)g(too)h(large)f(to)i(return)e(in)h(array)48
-3265 y(PARSE_NO_OUTPUT)139 b(434)190 b(data)47 b(parser)f(failed)g(not)
-h(sent)f(an)h(out)g(column)48 3378 y(PARSE_BAD_COL)235
-b(435)190 b(bad)47 b(data)f(encounter)g(while)g(parsing)g(column)48
-3491 y(PARSE_BAD_OUTPUT)91 b(436)190 b(Output)46 b(file)h(not)g(of)g
-(proper)f(type)48 3717 y(ANGLE_TOO_BIG)235 b(501)190
-b(celestial)45 b(angle)i(too)f(large)h(for)g(projection)48
-3830 y(BAD_WCS_VAL)331 b(502)190 b(bad)47 b(celestial)e(coordinate)g
-(or)i(pixel)g(value)48 3942 y(WCS_ERROR)427 b(503)190
-b(error)46 b(in)h(celestial)f(coordinate)f(calculation)48
-4055 y(BAD_WCS_PROJ)283 b(504)190 b(unsupported)45 b(type)h(of)h
-(celestial)f(projection)48 4168 y(NO_WCS_KEY)379 b(505)190
-b(celestial)45 b(coordinate)g(keywords)h(not)h(found)48
-4281 y(APPROX_WCS_KEY)187 b(506)j(approximate)45 b(wcs)i(keyword)e
-(values)h(were)h(returned)p eop
+2588 y(BAD_DECIM)427 b(411)190 b(bad)47 b(number)f(of)h(decimal)f
+(places)g(specified)48 2700 y(NUM_OVERFLOW)283 b(412)190
+b(overflow)45 b(during)i(data)f(type)h(conversion)48
+2813 y(DATA_COMPRESSION_ERR)137 b(413)95 b(error)46 b(compressing)f
+(image)48 2926 y(DATA_DECOMPRESSION_ERR)c(414)95 b(error)46
+b(uncompressing)f(image)48 3152 y(BAD_DATE)475 b(420)190
+b(error)46 b(in)h(date)g(or)g(time)g(conversion)48 3378
+y(PARSE_SYNTAX_ERR)91 b(431)190 b(syntax)46 b(error)g(in)i(parser)e
+(expression)48 3491 y(PARSE_BAD_TYPE)187 b(432)j(expression)45
+b(did)i(not)g(evaluate)e(to)i(desired)f(type)48 3604
+y(PARSE_LRG_VECTOR)91 b(433)190 b(vector)46 b(result)g(too)h(large)f
+(to)i(return)e(in)h(array)48 3717 y(PARSE_NO_OUTPUT)139
+b(434)190 b(data)47 b(parser)f(failed)g(not)h(sent)f(an)h(out)g(column)
+48 3830 y(PARSE_BAD_COL)235 b(435)190 b(bad)47 b(data)f(encounter)g
+(while)g(parsing)g(column)48 3942 y(PARSE_BAD_OUTPUT)91
+b(436)190 b(Output)46 b(file)h(not)g(of)g(proper)f(type)48
+4168 y(ANGLE_TOO_BIG)235 b(501)190 b(celestial)45 b(angle)i(too)f
+(large)h(for)g(projection)48 4281 y(BAD_WCS_VAL)331 b(502)190
+b(bad)47 b(celestial)e(coordinate)g(or)i(pixel)g(value)48
+4394 y(WCS_ERROR)427 b(503)190 b(error)46 b(in)h(celestial)f
+(coordinate)f(calculation)48 4507 y(BAD_WCS_PROJ)283
+b(504)190 b(unsupported)45 b(type)h(of)h(celestial)f(projection)48
+4620 y(NO_WCS_KEY)379 b(505)190 b(celestial)45 b(coordinate)g(keywords)
+h(not)h(found)48 4733 y(APPROX_WCS_KEY)187 b(506)j(approximate)45
+b(wcs)i(keyword)e(values)h(were)h(returned)p eop
 %%Trailer
 end
 userdict /end-hook known{end-hook}if
diff --git a/cfitsio.tex b/cfitsio.tex
index 5e394ad..59264f9 100644
--- a/cfitsio.tex
+++ b/cfitsio.tex
@@ -1,9 +1,9 @@
 \documentclass[11pt]{book}
-%\input{html.sty}
-%\htmladdtonavigation
-%   {\begin{rawhtml}
-% <A HREF="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html">FITSIO Home</A>
-%    \end{rawhtml}}
+\input{html.sty}
+\htmladdtonavigation
+   {\begin{rawhtml}
+ <A HREF="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html">FITSIO Home</A>
+    \end{rawhtml}}
 \oddsidemargin=0.00in
 \evensidemargin=0.00in
 \textwidth=6.5in
@@ -18,7 +18,7 @@
 \normalsize
 \vspace*{4.0cm}
 \begin{center}
-{\Huge \bf CFITSIO User's Guide}\\
+{\Huge \bf CFITSIO User's Reference Guide}\\
 \end{center}
 \medskip 
 \medskip 
@@ -31,7 +31,7 @@
 \medskip
 \medskip
 \begin{center}
-{\Large Version 2.1 \\}
+{\Large Version 2.5 \\}
 \end{center}
 \bigskip
 \vskip 2.5cm
@@ -46,7 +46,7 @@ USA}
 \vfill
 \bigskip
 \begin{center}
-{\Large October 2000\\}
+{\Large July 2004\\}
 \end{center}
 \vfill
 \end{titlepage}
@@ -57,19 +57,23 @@ USA}
 \chapter{Introduction }
 \pagenumbering{arabic}
 
+
+\section{ A Brief Overview}
+
 CFITSIO is a machine-independent library of routines for reading and
 writing data files in the FITS (Flexible Image Transport System) data
-format.  It can also read IRAF format image files by converting them on
-the fly into a temporary FITS format file.  This library is written in
-ANSI C and provides a powerful yet simple interface for accessing FITS
-files which will run on most commonly used computers and workstations.
-CFITSIO supports all the features described in the official NOST
-definition of the FITS format and can read and write all the currently
-defined types of extensions, including ASCII tables (TABLE), Binary
-tables (BINTABLE) and IMAGE extensions.  The CFITSIO routines insulate
-the programmer from having to deal with the complicated formatting
-details in the FITS file, however, it is assumed that users have a
-general knowledge about the structure and usage of FITS files.
+format.  It can also read IRAF format image files and raw binary data
+arrays by converting them on the fly into a virtual FITS format file.
+This library is written in ANSI C and provides a powerful yet simple
+interface for accessing FITS files which will run on most commonly used
+computers and workstations.  CFITSIO supports all the features
+described in the official NOST definition of the FITS format and can
+read and write all the currently defined types of extensions, including
+ASCII tables (TABLE), Binary tables (BINTABLE) and IMAGE extensions.
+The CFITSIO routines insulate the programmer from having to deal with
+the complicated formatting details in the FITS file, however, it is
+assumed that users have a general knowledge about the structure and
+usage of FITS files.
 
 CFITSIO also contains a set of Fortran callable wrapper routines which
 allow Fortran programs to call the CFITSIO routines.  See the companion
@@ -88,18 +92,21 @@ and the XMM/ESTEC project in The Netherlands made especially significant
 contributions that resulted in many of the new features that appeared
 in v2.0 of CFITSIO.
 
+
+\section{Sources of FITS Software and Information}
+
 The latest version of the CFITSIO source code,
 documentation, and example programs are available on the World-Wide
 Web or via anonymous ftp from:
- 
+
 \begin{verbatim}
         http://heasarc.gsfc.nasa.gov/fitsio
         ftp://legacy.gsfc.nasa.gov/software/fitsio/c
 \end{verbatim}
-\newpage
+
 Any questions, bug reports, or suggested enhancements related to the CFITSIO
 package should be sent to the primary author:
- 
+
 \begin{verbatim}
         Dr. William Pence                 Telephone:  (301) 286-4599
         HEASARC, Code 662                 E-mail: pence@tetra.gsfc.nasa.gov
@@ -108,36 +115,161 @@ package should be sent to the primary author:
 \end{verbatim}
 This User's Guide assumes that readers already have a general
 understanding of the definition and structure of FITS format files.
-Further information about FITS formats is available in the `FITS User's
-Guide' and the `NOST FITS Standard', which are available from the NASA
-Science Office of Standards and Technology at the address given below.
-Both of these documents are available electronically from their Web
-site and via anonymous ftp at nssdc.gsfc.nasa.gov in the /pub/fits
-directory. Any questions about FITS formats should be directed to the
-NOST, at:
- 
-\begin{verbatim}
-        NASA, Science Office of Standards and Technology
-        Code 633.2,
-        Goddard Space Flight Center
-        Greenbelt MD 20771, USA
-        WWW: http://fits.gsfc.nasa.gov/
-        E-mail: fits@fits.gsfc.nasa.gov
-        (301) 286-2899
-\end{verbatim}
+Further information about FITS formats is available from the FITS Support
+Office at {\tt http://fits.gsfc.nasa.gov}.  In particular, the
+'NOST FITS Standard' gives the authoritative definition of the FITS data
+format, and the  `FITS User's Guide' provides additional historical background
+and practical advice on using FITS files.
+
+The HEASARC also provides a very sophisticated FITS file analysis
+program called `Fv' which can be used to display and edit the contents
+of any FITS file as well as construct new FITS files from scratch. The
+display functions in Fv allow users to interactively adjust the
+brightness and contrast of images, pan, zoom, and blink images, and
+measure the positions and brightnesses of objects within images. FITS
+tables can be displayed like a spread sheet, and then modified using
+powerful calculator and sorting functions.  Fv is freely available for
+most Unix platforms, Mac PCs, and Windows PCs.
 CFITSIO users may also be interested in the FTOOLS package of programs
 that can be used to manipulate and analyze FITS format files.
-Information about FTOOLS can be obtained on the Web or via anonymous
-ftp at:
- 
+Fv and FTOOLS are available from their respective Web sites at:
+
 \begin{verbatim}
+        http://fv.gsfc.nasa.gov
         http://heasarc.gsfc.nasa.gov/ftools
-        ftp://legacy.gsfc.nasa.gov/software/ftools/release
 \end{verbatim}
-
+
+
+\section{Acknowledgements}
+
+The development of the powerful features in CFITSIO was made
+possible through collaborations with many people or organizations from
+around the world.  The following in particular have made especially
+significant contributions:
+
+Programmers from the Integral Science Data Center, Switzerland (namely,
+Jurek Borkowski, Bruce O'Neel, and Don Jennings), designed the concept
+for the plug-in I/O drivers that was introduced with CFITSIO 2.0.  The
+use of `drivers' greatly simplified  the low-level I/O, which in turn
+made other new features in CFITSIO (e.g., support for compressed FITS
+files and support for IRAF format image files) much easier to
+implement.  Jurek Borkowski wrote the Shared Memory driver, and Bruce
+O'Neel wrote the drivers for accessing FITS files over the network
+using the FTP, HTTP, and ROOT protocols.
+
+The ISDC also provided the template parsing routines (written by Jurek
+Borkowski) and the hierarchical grouping routines (written by Don
+Jennings).  The ISDC DAL (Data Access Layer) routines are layered on
+top of CFITSIO and make extensive use of these features.
+
+Uwe Lammers (XMM/ESA/ESTEC, The Netherlands) designed the
+high-performance lexical parsing algorithm that is used to do
+on-the-fly filtering of FITS tables.  This algorithm essentially
+pre-compiles the user-supplied selection expression into a form that
+can be rapidly evaluated for each row.  Peter Wilson (RSTX, NASA/GSFC)
+then wrote the parsing routines used by CFITSIO based on Lammers'
+design, combined with other techniques such as the CFITSIO iterator
+routine to further enhance the data processing throughput.  This effort
+also benefited from a much earlier lexical parsing routine that was
+developed by Kent Blackburn (NASA/GSFC). More recently, Craig Markwardt
+(NASA/GSFC) implemented additional functions (median, average, stddev)
+and other enhancements to the lexical parser.
+
+The CFITSIO iterator function is loosely based on similar ideas
+developed for the XMM Data Access Layer.
+
+Peter Wilson (RSTX, NASA/GSFC) wrote the complete set of
+Fortran-callable wrappers for all the CFITSIO routines, which in turn
+rely on the CFORTRAN macro developed by Burkhard Burow.
+
+The syntax used by CFITSIO for filtering or binning input FITS files is
+based on ideas developed for the AXAF Science Center Data Model by
+Jonathan McDowell, Antonella Fruscione, Aneta Siemiginowska and Bill
+Joye. See http://heasarc.gsfc.nasa.gov/docs/journal/axaf7.html for
+further description of the AXAF Data Model.
+
+The file decompression code were taken directly from the gzip (GNU zip)
+program developed by Jean-loup Gailly and others.
+
+The new compressed image data format (where the image is tiled and
+the compressed byte stream from each tile is stored in a binary table)
+was implemented in collaboration with Richard White (STScI), Perry
+Greenfield (STScI) and Doug Tody (NOAO).
+
+Doug Mink (SAO) provided the routines for converting IRAF format
+images into FITS format.
+
+In addition, many other people have made valuable contributions to the
+development of CFITSIO.  These include (with apologies to others that may
+have inadvertently been omitted):
+
+Steve Allen, Carl Akerlof, Keith Arnaud, Morten Krabbe Barfoed, Kent
+Blackburn, G Bodammer, Romke Bontekoe, Lucio Chiappetti, Keith Costorf,
+Robin Corbet, John Davis,  Richard Fink, Ning Gan, Emily Greene, Gretchen
+Green, Joe Harrington, Cheng Ho, Phil Hodge, Jim Ingham, Yoshitaka
+Ishisaki, Diab Jerius, Mark Levine, Todd Karakaskian, Edward King,
+Scott Koch,  Claire Larkin, Rob Managan, Eric Mandel, Richard Mathar,
+John Mattox, Carsten Meyer, Emi Miyata, Stefan Mochnacki, Mike Noble,
+Oliver Oberdorf, Clive Page, Arvind Parmar, Jeff Pedelty, Tim Pearson,
+Philippe Prugniel, Maren Purves, Scott Randall, Chris Rogers, Arnold Rots,
+Barry Schlesinger, Robin Stebbins, Andrew Szymkowiak, Allyn Tennant,
+Peter Teuben, James Theiler, Doug Tody, Shiro Ueno, Steve Walton, Archie
+Warnock, Alan Watson, Dan Whipple, Wim Wimmers, Peter Young, Jianjun Xu,
+and Nelson Zarate.
+
+
+\section{Legal Stuff}
+
+Copyright (Unpublished--all rights reserved under the copyright laws of
+the United States), U.S. Government as represented by the Administrator
+of the National Aeronautics and Space Administration.  No copyright is
+claimed in the United States under Title 17, U.S. Code.
+
+Permission to freely use, copy, modify, and distribute this software
+and its documentation without fee is hereby granted, provided that this
+copyright notice and disclaimer of warranty appears in all copies.
+(However, see the restriction on the use of the gzip compression code,
+below).
+
+DISCLAIMER:
+
+THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND,
+EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO,
+ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY
+IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE
+DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE
+SOFTWARE WILL BE ERROR FREE.  IN NO EVENT SHALL NASA BE LIABLE FOR ANY
+DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY
+CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
+CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY
+PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED
+FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
+SERVICES PROVIDED HEREUNDER."
+
+The file compress.c contains (slightly modified) source code that
+originally came from gzip-1.2.4, copyright (C) 1992-1993 by Jean-loup
+Gailly.  This gzip code is distributed under the GNU General Public
+License and thus requires that any software that uses the CFITSIO
+library (which in turn uses the gzip code) must conform to the
+provisions in the GNU General Public License.  A copy of the GNU
+license is included at the beginning of compress.c file.
+
+An alternate version of the compress.c file (called
+compress\_alternate.c) is provided for users who want to use the CFITSIO
+library but are unwilling or unable to publicly release their software
+under the terms of the GNU General Public License.   This alternate
+version contains non-functional stubs for the file compression and
+uncompression routines used by CFITSIO.  Replace the file `compress.c'
+with `compress\_alternate.c' before compiling the CFITSIO library.  This
+will produce a version of CFITSIO which does not support reading or
+writing compressed FITS files but is otherwise identical to the
+standard version.
+
 \chapter{ Creating the CFITSIO Library }
 
- 
+
 \section{Building the Library}
 
 The CFITSIO code is contained in about 40 C source files (*.c) and header
@@ -145,7 +277,7 @@ files (*.h). On VAX/VMS systems 2 assembly-code files (vmsieeed.mar and
 vmsieeer.mar) are also needed.
 
 CFITSIO has currently been tested on the following platforms:
- 
+
 \begin{verbatim}
   OPERATING SYSTEM           COMPILER
    Sun OS                     gcc and cc (3.0.1)
@@ -161,76 +293,48 @@ CFITSIO has currently been tested on the following platforms:
    Linux                      gcc
    MkLinux                    DR3
    Windows 95/98/NT           Borland C++ V4.5
-   Windows 95/98/NT           Microsoft/Compaq Visual C++ v5.0, v6.0
+   Windows 95/98/NT/ME/XP     Microsoft/Compaq Visual C++ v5.0, v6.0
    Windows 95/98/NT           Cygwin gcc
-   OS/2                       gcc + EMX
    MacOS 7.1 or greater       Metrowerks 10.+
+   MacOS-X 10.1 or greater    cc (gcc)
 \end{verbatim}
 CFITSIO will probably run on most other Unix platforms.  Cray
-supercomputers and IBM mainframe computers are currently not
-supported.
-\newpage
+supercomputers are currently not supported.
 
- 
-\subsection{ Unix Systems}
+
+\subsection{Unix Systems}
 
 The CFITSIO library is built on Unix systems by typing:
- 
+
 \begin{verbatim}
-   > ./configure
-   > make
+ >  ./configure [--prefix=/target/installation/path]
+ >  make          (or  'make shared')
+ >  make install  (this step is optional)
 \end{verbatim}
-at the operating system prompt.  Type ./configure and not simply
-`configure' to ensure that the configure script in the current
-directory is run and not some other system-wide configure script.  The
-configure command customizes the Makefile for the particular system,
-then the `make' command compiles the source files and builds the
-library.
-
-On HP/UX systems, the environment variable CFLAGS should be set
-to -Ae before running configure to enable "extended ANSI" features.
-
-By default, a set of Fortran-callable wrapper routines are
-also built and included in the CFITSIO library.  If these wrapper
-routines are not needed (i.e., the CFITSIO library will not
-be linked to any Fortran applications which call FITSIO subroutines)
-then they may be omitted from the build by typing 'make all-nofitsio'
-instead of simply typing 'make'.  This will reduce the size
-of the CFITSIO library slightly.
+at the operating system prompt.  The configure command customizes the
+Makefile for the particular system, then the `make' command compiles the
+source files and builds the library.  Type `./configure' and not simply
+`configure' to ensure that the configure script in the current directory
+is run and not some other system-wide configure script.  The optional
+'prefix' argument to configure gives the path to the directory where
+the CFITSIO library and include files should be installed via the later
+'make install' command. For example,
 
-Most 32-bit operating systems have only supported disk files up to
-2.1GB (2**31 bytes) in size.  Starting with version 2.1 of CFITSIO,
-FITS files larger than this limit (up to 6 terabytes) can be read and
-written on platforms which support large files (e.g., Solaris).  To
-enable this feature, CFITSIO must be compiled with the
-`-D\_FILE\_OFFSET\_BITS=64' compiler flag.  All programs which link to
-the CFITSIO library must also be compiled with this flag or must
-include this preprocessor definition at the start of the source code
-file. See the `CFITSIO Size Limitations' section in Chapter 5 for
-further details.
-
-It may not be possible to staticly link programs that use CFITSIO on
-some platforms (namely, on Solaris 2.6) due to the network drivers
-(which provide FTP and HTTP access to FITS files).  It is possible to
-make both a dynamic and a static version of the CFITSIO library, but
-network file access will not be possible using the static version.  To
-build the dynamic libcfitsio.so library (on solaris), type 'make
-clean', then edit the Makefile to add -fPIC or -KPIC (gcc or cc) to the
-CFLAGS line, then rebuild the library with 'make'.  Once you're done,
-build the shared library with
- 
 \begin{verbatim}
- ld -G -z text -o libcfitsio.so *.o
+   > ./configure --prefix=/usr1/local
 \end{verbatim}
-Then to get the staticly linkable libcfitsio.a library file do another
-make clean, undefine HAVE\_NET\_SERVICES on the CFLAGS line and rebuild.
-It's unimportant whether or not you use -fPIC for static builds.
+will cause the 'make install' command to copy the CFITSIO libcfitsio file
+to /usr1/local/lib and the necessary include files to /usr1/local/include
+(assuming of course that the  process has permission to write to these
+directories).
+
+The 'make shared' option builds a shared or dynamic version of the
+CFITSIO library.  When using the shared library the executable code is
+not copied into your program at link time and instead the program
+locates the necessary library code at run time, normally through
+LD\_LIBRARY\_PATH or some other method. The advantages of using a shared
+library are:
 
-When using the shared library the executable code is not copied into
-your program at link time and instead the program locates the necessary
-library code at run time, normally through LD\_LIBRARY\_PATH or some
-other method.  The advantages are:
- 
 \begin{verbatim}
    1.  Less disk space if you build more than 1 program
    2.  Less memory if more than one copy of a program using the shared
@@ -243,17 +347,52 @@ other method.  The advantages are:
    4.  No run-time penalty.
 \end{verbatim}
 The disadvantages are:
- 
+
 \begin{verbatim}
    1. More hassle at runtime.  You have to either build the programs
       specially or have LD_LIBRARY_PATH set right.
-   2. There may be a slight start up penality, depending on where you are
+   2. There may be a slight start up penalty, depending on where you are
       reading the shared library and the program from and if your CPU is
       either really slow or really heavily loaded.
 \end{verbatim}
 
- 
+On Mac OS X platforms the 'make shared' command works like on other
+UNIX platforms, but a .dylib file will be created instead of .so.  If
+installed in a nonstandard location, add its location to the
+DYLD\_LIBRARY\_PATH environment variable so that the library can be found
+at run time.
+
+On HP/UX systems, the environment variable CFLAGS should be set
+to -Ae before running configure to enable "extended ANSI" features.
+
+By default, a set of Fortran-callable wrapper routines are
+also built and included in the CFITSIO library.  If these wrapper
+routines are not needed (i.e., the CFITSIO library will not
+be linked to any Fortran applications which call FITSIO subroutines)
+then they may be omitted from the build by typing 'make all-nofitsio'
+instead of simply typing 'make'.  This will reduce the size
+of the CFITSIO library slightly.
+
+Most 32-bit operating systems have only supported disk files up to 2.1GB
+(2**31 bytes) in size.  Starting with version 2.1 of CFITSIO, FITS files
+larger than this limit (up to 6 terabytes) can be read and written on
+platforms that support large files (e.g., Solaris).  To enable this
+feature, CFITSIO must be compiled with the `-D\_FILE\_OFFSET\_BITS=64'
+compiler flag.  Some platforms may also require the `-D\_LARGE\_FILES'
+compiler flag.   All programs that link to the CFITSIO library must also
+be compiled with this flag or must include this preprocessor definition
+at the start of the source code file. See the `CFITSIO Size Limitations'
+section in Chapter 4 for further details.
+
+It may not be possible to staticly link programs that use CFITSIO on
+some platforms (namely, on Solaris 2.6) due to the network drivers
+(which provide FTP and HTTP access to FITS files).  It is possible to
+make both a dynamic and a static version of the CFITSIO library, but
+network file access will not be possible using the static version.
+
+
 \subsection{VMS}
+
 On VAX/VMS and ALPHA/VMS systems the make\_gfloat.com command file may
 be executed to build the cfitsio.olb object library using the default
 G-floating point option for double variables.  The make\_dfloat.com and
@@ -263,7 +402,7 @@ used in the group.c module may require that programs using CFITSIO be
 linked with the ALPHA\$LIBRARY:VAXCRTL.OLB library.  See the example
 link line in the next section of this document.
 
- 
+
 \subsection{Windows PCs}
 
 A precompiled DLL version of CFITSIO is available for IBM-PC users of
@@ -278,40 +417,31 @@ makefile.bc or makefile.vcc  files.  Finally, the makepc.bat file gives
 an example of  building CFITSIO with the Borland C++ v4.5 compiler
 using older DOS commands.
 
- 
-\subsection{OS/2}
 
-On OS/2 systems, CFITSIO can be built by typing 'make -f
-makefile.os2'.  This makefile requires the GCC compiler and EMX
-library, which are available from many Internet sites containing OS/2
-software, such as
- 
-\begin{verbatim}
-     ftp-os2.nmsu.edu/pub/os2/dev/emx/v0.9c   and
-     ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc.
-\end{verbatim}
-
- 
 \subsection{Macintosh PCs}
 
-The MacOS version of the CFITSIO library can be built by (1) un binhex
-and unstuff cfitsio\_mac.sit.hqx, (2) put CFitsioPPC.mcp in the cfitsio
-directory, and (3) load CFitsioPPC.mcp into CodeWarrior Pro 5 and make.
-This builds the cfitsio library for PPC.  There are also targets for
-both the test program and the speed test program.
+When building on Mac OS-X, users should follow the Unix instructions,
+above.
+
+The classic MacOS version (OS 9 or earlier) of the CFITSIO library can
+be built by (1) un binhex and unstuff cfitsio\_mac.sit.hqx, (2) put
+CFitsioPPC.mcp in the cfitsio directory, and (3) load CFitsioPPC.mcp
+into CodeWarrior Pro 5 and make.  This builds the CFITSIO library for
+PPC.  There are also targets for both the test program and the speed
+test program.
 
 To use the MacOS port you can add Cfitsio PPC.lib to your CodeWarrior
 Pro 5 project.  Note that this only has been tested for the PPC and
 probably won't work on 68k Macs.
 
 
- 
+
 \section{Testing the Library}
 
 The CFITSIO library should be tested by building and running
 the testprog.c program that is included with the release.
 On Unix systems, type:
- 
+
 \begin{verbatim}
     % make testprog
     % testprog > testprog.lis
@@ -320,25 +450,25 @@ On Unix systems, type:
 \end{verbatim}
  On VMS systems,
 (assuming cc is the name of the C compiler command), type:
- 
+
 \begin{verbatim}
     $ cc testprog.c
     $ link testprog, cfitsio/lib, alpha$library:vaxcrtl/lib
     $ run testprog
 \end{verbatim}
-The testprog program should produce a FITS file called `testprog.fit'
+The test program should produce a FITS file called `testprog.fit'
 that is identical to the `testprog.std' FITS file included with this
 release.  The diagnostic messages (which were piped to the file
 testprog.lis in the Unix example) should be identical to the listing
 contained in the file testprog.out.  The 'diff' and 'cmp' commands
 shown above should not report any differences in the files.  (There
-may be some minor formating differences, such as the presence or
+may be some minor format differences, such as the presence or
 absence of leading zeros, or 3 digit exponents in numbers,
 which can be ignored).
 
 The Fortran wrappers in CFITSIO may be tested with the testf77
 program on Unix systems with:
- 
+
 \begin{verbatim}
     % f77 -o testf77 testf77.f -L. -lcfitsio -lnsl -lsocket
   or
@@ -362,8 +492,10 @@ program may differ slightly from the testf77.std template, if leading
 zeros are not printed by default before the decimal point when using F
 format.
 
-A few other utility programs are included with CFITSIO:
- 
+A few other utility programs are included with CFITSIO; the first four
+of this programs can be compiled an linked by typing `make
+program\_name' where `program\_name' is the actual name of the program:
+
 \begin{verbatim}
     speed - measures the maximum throughput (in MB per second)
               for writing and reading FITS files with CFITSIO.
@@ -373,19 +505,13 @@ A few other utility programs are included with CFITSIO:
     fitscopy - copies any FITS file (especially useful in conjunction
                  with the CFITSIO's extended input filename syntax).
 
-    cookbook - a sample program that peforms common read and
+    cookbook - a sample program that performs common read and
                  write operations on a FITS file.
 
-    iter_a, iter_b, iter_c - tests of the CFITSIO iterator routine
+    iter_a, iter_b, iter_c - examples of the CFITSIO iterator routine
 \end{verbatim}
 
-The first 4 of these utility programs can be compiled and linked by typing
- 
-\begin{verbatim}
-   %  make program_name
-\end{verbatim}
 
- 
 \section{Linking Programs with CFITSIO}
 
 When linking applications software with the CFITSIO library, several
@@ -399,47 +525,50 @@ are not needed on VMS and Windows platforms, because FTP file access is
 not currently supported on those platforms.
 
 Note that when upgrading to a newer version of CFITSIO it is usually
-necessay to recompile, as well as relink, the programs that use CFITSIO,
+necessary to recompile, as well as relink, the programs that use CFITSIO,
 because the definitions in fitsio.h often change.
 
- 
+
 \section{Getting Started with CFITSIO}
 
-In order to effectively use the CFITSIO library as quickly as possible,
-it is recommended that new users follow these steps:
+In order to effectively use the CFITSIO library it is recommended that
+new users begin by reading the ``CFITSIO Quick Start Guide''.  It
+contains all the basic information needed to write programs that
+perform most types of operations on FITS files.  The set of example
+FITS utility programs that are available from the CFITSIO web site are
+also very useful for learning how to use CFITSIO.  To learn even more
+about the capabilities of the CFITSIO library the following steps are
+recommended:
 
-1.  Read the following `FITS Primer' chapter for an overview of the
-structure of FITS files.  This is especially important for users who
-are unfamiliar with the FITS table and image extensions.
+1.  Read the following short `FITS Primer' chapter for an overview of
+the structure of FITS files.
 
-2. Review the various topics discussed in Chapters 4 and 5 to become
-familiar with the conventions and advanced features of the CFITSIO
-interface.
+2. Review the Programming Guidelines in Chapter 4 to become familiar
+with the conventions used by the CFITSIO interface.
 
 3.  Refer to the cookbook.c, listhead.c, and fitscopy.c programs that
 are included with this release for examples of routines that perform
-various common FITS file operations.  Type 'make program\_name' to compile
-and link these programs on Unix systems.
+various common FITS file operations.  Type 'make program\_name' to
+compile and link these programs on Unix systems.
 
 4.  Write a simple program to read or write a FITS file using the Basic
-Interface routines described in Chapter 7.
+Interface routines described in Chapter 5.
 
 5.  Scan through the more specialized routines that are described in
-Chapter 8 to become familiar with the functionality that they provide.
+the following chapters to become familiar with the functionality that
+they provide.
+
 
- 
 \section{Example Program}
 
 The following listing shows an example of how to use the CFITSIO
-routines in a C program.  The error checking of the returned status
-value has been omitted for the sake of clarity.  Refer to the
-cookbook.c program that is included with the CFITSIO distribution for
-other example programs.
+routines in a C program.    Refer to the cookbook.c program that is
+included with the CFITSIO distribution for other example routines.
 
 This program creates a new FITS file, containing a FITS image.  An
 `EXPOSURE' keyword is written to the header, then the image data are
-writen to the FITS file before closing the FITS file.
- 
+written to the FITS file before closing the FITS file.
+
 \begin{verbatim}
 #include "fitsio.h"  /* required by every program that uses CFITSIO  */
 main()
@@ -477,112 +606,7 @@ main()
     return( status );
 }
 \end{verbatim}
- 
-\section{Legal Stuff}
-
-Copyright (Unpublished--all rights reserved under the copyright laws of
-the United States), U.S. Government as represented by the Administrator
-of the National Aeronautics and Space Administration.  No copyright is
-claimed in the United States under Title 17, U.S. Code.
-
-Permission to freely use, copy, modify, and distribute this software
-and its documentation without fee is hereby granted, provided that this
-copyright notice and disclaimer of warranty appears in all copies.
-
-DISCLAIMER:
-
-THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND,
-EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO,
-ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY
-IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE
-DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE
-SOFTWARE WILL BE ERROR FREE.  IN NO EVENT SHALL NASA BE LIABLE FOR ANY
-DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR
-CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY
-CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
-CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY
-PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED
-FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
-SERVICES PROVIDED HEREUNDER."
-
-The file compress.c contains (slightly modified) source code that
-originally came from gzip-1.2.4 which is freely distributed under the
-GNU General Public Licence.  A copy of the GNU licence is included
-at the beginning of that file.
-
- 
-\section{Acknowledgements}
-
-The development of many of the powerful features in CFITSIO was made
-possible through collaborations with many people or organizations from
-around the world.  The following, in particular, have made especially
-significant contributions:
 
-Programmers from the Integral Science Data Center, Switzerland (namely,
-Jurek Borkowski, Bruce O'Neel, and Don Jennings), designed the concept
-for the plug-in I/O drivers that was introduced with CFITSIO 2.0.  The
-use of `drivers' greatly simplified  the low-level I/O, which in turn
-made other new features in CFITSIO (e.g., support for compressed FITS
-files and support for IRAF format image files) much easier to
-implement.  Jurek Borkowski wrote the Shared Memory driver, and Bruce
-O'Neel wrote the drivers for accessing FITS files over the network
-using the FTP, HTTP, and ROOT protocols.
-
-The ISDC also provided the template parsing routines (written by Jurek
-Borkowski) and the hierarchical grouping routines (written by Don
-Jennings).  The ISDC DAL (Data Access Layer) routines are layered on
-top of CFITSIO and make extensive use of these features.
-
-Uwe Lammers (XMM/ESA/ESTEC, The Netherlands) designed the
-high-performance lexical parsing algorithm that is used to do
-on-the-fly filtering of FITS tables.  This algorithm essentially
-pre-compiles the user-supplied selection expression into a form that
-can be rapidly evaluated for each row.  Peter Wilson (RSTX, NASA/GSFC)
-then wrote the parsing routines used by CFITSIO based on Lammers'
-design, combined with other techniques such as the CFITSIO iterator
-routine to further enhance the data processing throughput.  This effort
-also benefitted from a much earlier lexical parsing routine that was
-developed by Kent Blackburn (NASA/GSFC).
-
-The CFITSIO iterator function is loosely based on similar ideas
-developed for the XMM Data Access Layer.
-
-Peter Wilson (RSTX, NASA/GSFC) wrote the complete set of
-Fortran-callable wrappers for all the CFITSIO routines, which in turn
-rely on the CFORTRAN macro developed by Burkhard Burow.
-
-The syntax used by CFITSIO for filtering or binning input FITS files is
-based on ideas developed for the AXAF Science Center Data Model by
-Jonathan McDowell, Antonella Fruscione, Aneta Siemiginowska and Bill
-Joye. See http://heasarc.gsfc.nasa.gov/docs/journal/axaf7.html for
-further description of the AXAF Data Model.
-
-The file decompression code were taken directly from the gzip (GNU zip)
-program developed by Jean-loup Gailly and others.
-
-Doug Mink, SAO, provided the routines for converting IRAF format
-images into FITS format.
-
-In addition, many other people have made valuable contributions to the
-development of CFITSIO.  These include (with apologies to others that may
-have inadvertently been omitted):
-
-Steve Allen, Carl Akerlof, Keith Arnaud, Morten Krabbe Barfoed, Kent
-Blackburn, G Bodammer, Romke Bontekoe, Lucio Chiappetti, Keith Costorf,
-Robin Corbet, John Davis,  Richard Fink, Ning Gan, Emily Greene,
-Gretchen Green, Joe Harrington, Cheng Ho, Phil Hodge, Jim Ingham,
-Yoshitaka Ishisaki, Diab Jerius, Mark Levine, Todd Karakaskian, Edward
-King, Scott Koch,  Claire Larkin, Rob Managan, Eric Mandel, John
-Mattox, Carsten Meyer, Emi Miyata, Stefan Mochnacki, Mike Noble, Oliver
-Oberdorf, Clive Page, Arvind Parmar, Jeff Pedelty, Tim Pearson, Maren
-Purves, Scott Randall, Chris Rogers, Arnold Rots, Barry Schlesinger,
-Robin Stebbins, Andrew Szymkowiak, Allyn Tennant, Peter Teuben, James
-Theiler, Doug Tody, Shiro Ueno, Steve Walton, Archie Warnock, Alan
-Watson, Dan Whipple, Wim Wimmers, Peter Young, Jianjun Xu, and Nelson
-Zarate.
-
-
 \chapter{  A FITS Primer }
 
 This section gives a brief overview of the structure of FITS files.
@@ -599,7 +623,7 @@ A FITS file consists of one or more Header + Data Units (HDUs), where
 the first HDU is called the `Primary HDU', or `Primary Array'.  The
 primary array contains an N-dimensional array of pixels, such as a 1-D
 spectrum, a 2-D image, or a 3-D data cube.  Five different primary
-datatypes are supported: Unsigned 8-bit bytes, 16 and 32-bit signed
+data types are supported: Unsigned 8-bit bytes, 16 and 32-bit signed
 integers, and 32 and 64-bit floating point reals.  FITS also has a
 convention for storing 16 and 32-bit unsigned integers (see the later
 section entitled `Unsigned Integers' for more details). The primary HDU
@@ -627,7 +651,7 @@ with fill characters (ASCII blanks or zeros).
 Each Header Unit consists of any number of 80-character keyword records
 or `card images' which have the
 general form:
- 
+
 \begin{verbatim}
   KEYNAME = value / comment string
   NULLKEY =       / comment: This keyword has no value
@@ -666,10 +690,10 @@ previous Data Unit (or Header Unit if there is no Data Unit).
 The main required keywords in FITS primary arrays or image extensions are:
 \begin{itemize}
 \item
-BITPIX -- defines the datatype of the array: 8, 16, 32, -32, -64
-for unsigned 8--bit byte, 16--bit integer, 32--bit integer, 32--bit
-IEEE floating point, and 64--bit IEEE double precision floating point,
-respectively.
+BITPIX -- defines the data type of the array: 8, 16, 32, -32, -64 for
+unsigned 8--bit byte, 16--bit signed integer, 32--bit signed integer,
+32--bit IEEE floating point, and 64--bit IEEE double precision floating
+point, respectively.
 \item
 NAXIS --  the number of dimensions in the array, usually 0, 1, 2, 3, or 4.
 \item
@@ -688,4387 +712,3500 @@ NAXIS2 -- number of rows in the table
 TTYPEn -- for each column (n ranges from 1 to TFIELDS) gives the
 name of the column
 \item
-TFORMn -- the datatype of the column
+TFORMn -- the data type of the column
 \item
 TUNITn -- the physical units of the column (optional)
 \end{itemize}
 
-Users should refer to the NOST documentation for more details about the
-required keywords and their allowed values.
+Users should refer to the FITS Support Office at {\tt http://fits.gsfc.nasa.gov}
+for futher information about the FITS format and related software
+packages.
 
-\chapter{  Extended File Name Syntax }
 
- 
-\section{Overview}
+\chapter{ Programming Guidelines }
 
-CFITSIO supports an extended syntax when specifying the name of the
-data file to be opened or created  that includes the following
-features:
 
-\begin{itemize}
-\item
-CFITSIO can read IRAF format images which have header file names that
-end with the '.imh' extension, as well as reading and writing FITS
-files,   This feature is implemented in CFITSIO by first converting the
-IRAF image into a temporary FITS format file in memory, then opening
-the FITS file.  Any of the usual CFITSIO routines then may be used to
-read the image header or data.
+\section{CFITSIO Definitions}
 
-\item
-FITS files on the internet can be read (and sometimes written) using the FTP,
-HTTP, or ROOT protocols.
+Any program that uses the CFITSIO interface must include the fitsio.h
+header file with the statement
 
-\item
-FITS files can be piped between tasks on the stdin and stdout streams.
+\begin{verbatim}
+  #include "fitsio.h"
+\end{verbatim}
+This header file contains the prototypes for all the CFITSIO user
+interface routines as well as the definitions of various constants used
+in the interface.  It also defines a C structure of type `fitsfile'
+that is used by CFITSIO to store the relevant parameters that define
+the format of a particular FITS file.  Application programs must define
+a pointer to this structure for each FITS file that is to be opened.
+This structure is initialized (i.e., memory is allocated for the
+structure) when the FITS file is first opened or created with the
+fits\_open\_file or fits\_create\_file routines.  This fitsfile pointer
+is then passed as the first argument to every other CFITSIO routine
+that operates on the FITS file.  Application programs must not directly
+read or write elements in this fitsfile structure because the
+definition of the structure may change in future versions of CFITSIO.
 
-\item
-FITS files can be read and written in shared memory.  This can potentially
-achieve much better data I/O performance compared to reading and
-writing the same FITS files on magnetic disk.
+A number of symbolic constants are also defined in fitsio.h for the
+convenience of application programmers.  Use of these symbolic
+constants rather than the actual numeric value will help to make the
+source code more readable and easier for others to understand.
 
-\item
-Compressed FITS files in gzip or Unix COMPRESS format can be directly read.
+\begin{verbatim}
+String Lengths, for use when allocating character arrays:
 
-\item
-FITS table columns can be created, modified, or deleted 'on-the-fly' as
-the table is opened by CFITSIO.  This creates a virtual FITS file containing
-the modifications that is then opened by the application program.
+  #define FLEN_FILENAME 1025 /* max length of a filename                  */
+  #define FLEN_KEYWORD   72  /* max length of a keyword                   */
+  #define FLEN_CARD      81  /* max length of a FITS header card          */
+  #define FLEN_VALUE     71  /* max length of a keyword value string      */
+  #define FLEN_COMMENT   73  /* max length of a keyword comment string    */
+  #define FLEN_ERRMSG    81  /* max length of a CFITSIO error message     */
+  #define FLEN_STATUS    31  /* max length of a CFITSIO status text string */
 
-\item
-Table rows may be selected, or filtered out, on the fly when the table
-is opened by CFITSIO, based on an arbitrary user-specified expression.
-Only rows for which the expression evaluates to 'TRUE' are retained
-in the copy of the table that is opened by the application program.
+  Note that FLEN_KEYWORD is longer than the nominal 8-character keyword
+  name length because the HIERARCH convention supports longer keyword names.
 
-\item
-Histogram images may be created on the fly by binning the values in
-table columns, resulting in a virtual N-dimensional FITS image.  The
-application program then only sees the FITS image (in the primary
-array) instead of the original FITS table.
-\end{itemize}
+Access modes when opening a FITS file:
 
-The latter 3 features in particular add very powerful data processing
-capabilities directly into CFITSIO, and hence into every task that uses
-CFITSIO to read or write FITS files.  For example, these features
-transform a very simple program that just copies an input FITS file to
-a new output file (like the `fitscopy' program that is distributed with
-CFITSIO) into a multipurpose FITS file processing tool.  By appending
-fairly simple qualifiers onto the name of the input FITS file, the user
-can perform quite complex table editing operations (e.g., create new
-columns, or filter out rows in a table) or create FITS images by
-binning or histogramming the values in table columns.  In addition,
-these functions have been coded using new state-of-the art algorithms
-that are, in some cases, 10 - 100 times faster than previous widely
-used implementations.
+  #define READONLY  0
+  #define READWRITE 1
 
-Before describing the complete syntax for the extended FITS file names
-in the next section, here are a few examples of FITS file names that
-give a quick overview of the allowed syntax:
+BITPIX data type code values for FITS images:
 
-\begin{itemize}
-\item
-{\tt 'myfile.fits'}: the simplest case of a FITS file on disk in the current
-directory.
+  #define BYTE_IMG      8  /*  8-bit unsigned integers */
+  #define SHORT_IMG    16  /* 16-bit   signed integers */
+  #define LONG_IMG     32  /* 32-bit   signed integers */
+  #define FLOAT_IMG   -32  /* 32-bit single precision floating point */
+  #define DOUBLE_IMG  -64  /* 64-bit double precision floating point */
 
-\item
-{\tt 'myfile.imh'}: opens an IRAF format image file and converts it on the
-fly into a temporary FITS format image in memory which can then be read with
-any other CFITSIO routine.
+  The following 4 data type codes are also supported by CFITSIO:
+  #define LONGLONG_IMG 64 /* 64-bit long signed integers */
+  #define SBYTE_IMG  10   /*  8-bit signed integers, equivalent to */
+                          /*  BITPIX = 8, BSCALE = 1, BZERO = -128 */
+  #define USHORT_IMG  20  /* 16-bit unsigned integers, equivalent to */
+                          /*  BITPIX = 16, BSCALE = 1, BZERO = 32768 */
+  #define ULONG_IMG   40  /* 32-bit unsigned integers, equivalent to */
+                          /*  BITPIX = 32, BSCALE = 1, BZERO = 2147483648 */
 
-\item
-{\tt 'myfile.fits.gz[events, 2]'}:  opens and uncompresses the gzipped file
-myfile.fits then moves to the extension which has the keywords EXTNAME
-= 'EVENTS' and EXTVER = 2.
+Codes for the data type of binary table columns and/or for the
+data type of variables when reading or writing keywords or data:
 
-\item
-{\tt '-'}:  a dash (minus sign) signifies that the input file is to be read
-from the stdin file stream, or that the output file is to be written to
-the stdout stream.
+                              DATATYPE               TFORM CODE
+  #define TBIT          1  /*                            'X' */
+  #define TBYTE        11  /* 8-bit unsigned byte,       'B' */
+  #define TLOGICAL     14  /* logicals (int for keywords     */
+                           /*  and char for table cols   'L' */
+  #define TSTRING      16  /* ASCII string,              'A' */
+  #define TSHORT       21  /* signed short,              'I' */
+  #define TINT32BIT    41  /* signed 32-bit int,         'J' */
+  #define TLONG        41  /* signed long,                   */
+  #define TFLOAT       42  /* single precision float,    'E' */
+  #define TDOUBLE      82  /* double precision float,    'D' */
+  #define TCOMPLEX     83  /* complex (pair of floats)   'C' */
+  #define TDBLCOMPLEX 163  /* double complex (2 doubles) 'M' */
 
-\item
-{\tt 'ftp://legacy.gsfc.nasa.gov/test/vela.fits'}:  FITS files in any ftp
-archive site on the internet may be directly opened with read-only
-access.
+  The following data type codes are also supported by CFITSIO:
+  #define TINT         31  /* int                            */
+  #define TSBYTE       12  /* 8-bit signed byte,         'S' */
+  #define TUINT        30  /* unsigned int               'V' */
+  #define TUSHORT      20  /* unsigned short             'U'  */
+  #define TULONG       40  /* unsigned long                  */
+  #define TLONGLONG    81  /* 64-bit long signed integer 'K' */
 
-\item
-{\tt 'http://legacy.gsfc.nasa.gov/software/test.fits'}: any valid URL to a
-FITS file on the Web may be opened with read-only access.
+HDU type code values (value returned when moving to new HDU):
 
-\item
-{\tt 'root://legacy.gsfc.nasa.gov/test/vela.fits'}: similar to ftp access
-except that it provides write as well as read access to the files
-across the network. This uses the root protocol developed at CERN.
+  #define IMAGE_HDU  0  /* Primary Array or IMAGE HDU */
+  #define ASCII_TBL  1  /* ASCII  table HDU */
+  #define BINARY_TBL 2  /* Binary table HDU */
+  #define ANY_HDU   -1  /* matches any type of HDU */
 
-\item
-{\tt 'shmem://h2[events]'}: opens the FITS file in a shared memory segment and
-moves to the EVENTS extension.
+Column name and string matching case-sensitivity:
 
-\item
-{\tt 'mem://'}:  creates a scratch output file in core computer memory.  The
-resulting 'file' will disappear when the program exits, so this
-is mainly useful for testing purposes when one does not want a
-permanent copy of the output file.
+  #define CASESEN   1   /* do case-sensitive string match */
+  #define CASEINSEN 0   /* do case-insensitive string match */
 
-\item
-{\tt 'myfile.fits[3; Images(10)]'}: opens a copy of the image contained in the
-10th row of the 'Images' column in the binary table in the 3th extension
-of the FITS file.  The application just sees this single image as the
-primary array.
+Logical states (if TRUE and FALSE are not already defined):
 
-\item
-{\tt 'myfile.fits[1:512:2, 1:512:2]'}: opens a section of the input image
-ranging from the 1st to the 512th pixel in  X and Y, and selects every
-second pixel in both dimensions, resulting in a 256 x 256 pixel image
-in this case.
+  #define TRUE 1
+  #define FALSE 0
 
-\item
-{\tt 'myfile.fits[EVENTS][col Rad = sqrt(X**2 + Y**2)]'}:  creates and opens
-a temporary file on the fly (in memory or on disk) that is identical to
-myfile.fits except that it will contain a new column in the EVENTS
-extension called 'Rad' whose value is computed using the indicated
-expresson which is a function of the values in the X and Y columns.
+Values to represent undefined floating point numbers:
 
-\item
-{\tt 'myfile.fits[EVENTS][PHA > 5]'}:  creates and opens a temporary FITS
-files that is identical to 'myfile.fits' except that the EVENTS table
-will only contain the rows that have values of the PHA column greater
-than 5.  In general, any arbitrary boolean expression using a C or
-Fortran-like syntax, which may combine AND and OR operators,
-may be used to select rows from a table.
+  #define FLOATNULLVALUE -9.11912E-36F
+  #define DOUBLENULLVALUE -9.1191291391491E-36
 
-\item
-{\tt 'myfile.fits[EVENTS][bin (X,Y)=1,2048,4]'}:  creates a temporary FITS
-primary array image which is computed on the fly by binning (i.e,
-computing the 2-dimensional histogram) of the values in the X and Y
-columns of the EVENTS extension.  In this case the X and Y coordinates
-range from 1 to 2048 and the image pixel size is 4 units in both
-dimensions, so the resulting image is 512 x 512 pixels in size.
+Image compression algorithm definitions
 
-\item
-The final example combines many of these feature into one complex
-expression (it is broken into several lines for clarity):
- 
-\begin{verbatim}
-  'ftp://legacy.gsfc.nasa.gov/data/sample.fits.gz[EVENTS]
-   [col phacorr = pha * 1.1 - 0.3][phacorr >= 5.0 && phacorr <= 14.0]
-   [bin (X,Y)=32]'
+  #define RICE_1      11
+  #define GZIP_1      21
+  #define PLIO_1      31
 \end{verbatim}
-In this case, CFITSIO (1) copies and uncompresses the FITS file from
-the ftp site on the legacy machine, (2) moves to the 'EVENTS'
-extension, (3) calculates a new column called 'phacorr', (4) selects
-the rows in the table that have phacorr in the range 5 to 14, and
-finally (5) bins the remaining rows on the X and Y column coordinates,
-using a pixel size = 32 to create a 2D image.  All this processing is
-completely transparent to the application program, which simply sees
-the final 2-D image in the primary array of the opened file.
-\end{itemize}
 
 
- 
-\section{Detailed Filename Syntax}
+\section{Current Header Data Unit (CHDU)}
 
-This section describes the full extended syntax for the CFITSIO FITS file names.
-The filename can contain several different components depending on the context:
- 
-\begin{verbatim}
-When creating a new file:
-   filetype://BaseFilename(templateName)
+The concept of the Current Header and Data Unit, or CHDU, is
+fundamental to the use of the CFITSIO library.  A simple FITS image may
+only contain a single Header and Data unit (HDU), but in general FITS
+files can contain multiple Header Data Units (also known as
+`extensions'), concatenated one after the other in the file.  The user
+can specify which HDU should be initially opened at run time by giving
+the HDU name or number after the root file name.  For example,
+'myfile.fits[4]' opens the 5th HDU in the file (note that the numbering
+starts with 0), and 'myfile.fits[EVENTS] opens the HDU with the name
+'EVENTS' (as defined by the EXTNAME or HDUNAME keywords).  If no HDU is
+specified then CFITSIO opens the first HDU (the primary array) by
+default.  The CFITSIO routines which read and write data  only operate
+within the opened HDU,  Other CFITSIO routines are provided to move to
+and open any other existing HDU within the FITS file or to append or
+insert new HDUs in the FITS file.
+
+
+\section{Function Names and Variable Datatypes}
+
+Most of the CFITSIO routines have both a short name as well as a
+longer descriptive name.  The short name is only 5 or 6 characters long
+and is similar to the subroutine name in the Fortran-77 version of
+FITSIO.  The longer name is more descriptive and it is recommended that
+it be used instead of the short name to more clearly document the
+source code.
 
-When opening an existing primary array or image HDU:
-   filetype://BaseFilename(outName)[HDUlocation][ImageSection]
+Many of the CFITSIO routines come in families which differ only in the
+data type of the associated parameter(s).  The data type of these
+routines is indicated by the suffix of the routine name.  The short
+routine names have a 1 or 2 character suffix (e.g., 'j' in 'ffpkyj')
+while the long routine names have a 4 character or longer suffix
+as shown in the following table:
 
-When opening an existing table HDU:
-   filetype://BaseFilename(outName)[HDUlocation][colFilter][rowFilter][binSpec]
+\begin{verbatim}
+    Long      Short  Data
+    Names     Names  Type
+    -----     -----  ----
+    _bit        x    bit
+    _byt        b    unsigned byte
+    _sbyt       sb   signed byte
+    _sht        i    short integer
+    _lng        j    long integer
+    _lnglng     jj   8-byte LONGLONG integer (see note below)
+    _usht       ui   unsigned short integer
+    _ulng       uj   unsigned long integer
+    _uint       uk   unsigned int integer
+    _int        k    int integer
+    _flt        e    real exponential floating point (float)
+    _fixflt     f    real fixed-decimal format floating point (float)
+    _dbl        d    double precision real floating-point (double)
+    _fixdbl     g    double precision fixed-format floating point (double)
+    _cmp        c    complex reals (pairs of float values)
+    _fixcmp     fc   complex reals, fixed-format floating point
+    _dblcmp     m    double precision complex (pairs of double values)
+    _fixdblcmp  fm   double precision complex, fixed-format floating point
+    _log        l    logical (int)
+    _str        s    character string
 \end{verbatim}
-The filetype, BaseFilename, outName, HDUlocation, and ImageSection
-components, if present, must be given in that order, but the colFilter,
-rowFilter, and binSpec specifiers may follow in any order.  Regardless
-of the order, however, the colFilter specifier, if present, will be
-processed first by CFITSIO, followed by the rowFilter specifier, and
-finally by the binSpec specifier.
 
- 
-\subsection{Filetype}
+The logical data type corresponds to `int' for logical keyword values,
+and `byte' for logical binary table columns.  In other words, the value
+when writing a logical keyword must be stored in an `int' variable, and
+must be stored in a `char' array when reading or writing to `L' columns
+in a binary table.  Inplicit data type conversion is not supported for
+logical table columns, but is for keywords, so a logical keyword may be
+read and cast to any numerical data type; a returned value = 0
+indicates false, and any other value = true.
 
-The type of file determines the medium on which the file is located
-(e.g., disk or network) and, hence, which internal device driver is used by
-CFITSIO to read and/or write the file.  Currently supported types are
- 
-\begin{verbatim}
-        file://  - file on local magnetic disk (default)
-        ftp://   - a readonly file accessed with the anonymous FTP protocol.
-                   It also supports  ftp://username:password@hostname/...
-                   for accessing password-protected ftp sites.
-        http://  - a readonly file accessed with the HTTP protocol.  It
-                   does not  support username:password like the ftp driver.
-        root://  - uses the CERN root protocol for writing as well as
-                   reading files over the network.
-        shmem:// - opens or creates a file which persists in the computer's
-                   shared memory.
-        mem://   - opens a temporary file in core memory.  The file
-                   disappears when the program exits so this is mainly
-                   useful for test purposes when a permanent output file
-                   is not desired.
-\end{verbatim}
-If the filetype is not specified, then type file:// is assumed.
-The double slashes '//' are optional and may be omitted in most cases.
+The `int' data type may be 2 bytes long on some IBM PC compatible
+systems and is usually 4 bytes long on most other systems.  Some 64-bit
+machines, however, like the Dec Alpha/OSF, define the `short', `int',
+and `long' integer data types to be 2, 4, and 8 bytes long,
+respectively.  The FITS standard only supports 2 and 4 byte integer
+data types, so CFITSIO internally converts between 4 and 8 bytes when
+reading or writing `long' integers on Alpha/OSF systems.
 
- 
-\subsubsection{Notes about the root filetype}
+The 8-byte 'LONGLONG' integer data type is supported on most platforms.
+CFITSIO defines the LONGLONG data type to be equivalent to 'long long'
+on most Unix platforms and on Mac OS-X.  Since most Windows compilers don't
+support the 'long long' data type, LONGLONG is defined instead to be
+equivalent to '\_\_int64'.  If the compiler does not support a 8-byte
+integer data type then LONGLONG is defined to be equivalent to 'long'.
+Note that the C format specifier to print out these long integer values
+is "\%lld" on most unix machines, except on OSF platforms where "\%ld"
+must be used.  On Windows platform that have the \_\_int64 data type,
+the format specifier is "\%INT64d".
+
+When dealing with the FITS byte data type it is important to remember
+that the raw values (before any scaling by the BSCALE and BZERO, or
+TSCALn and TZEROn keyword values) in byte arrays (BITPIX = 8) or byte
+columns (TFORMn = 'B') are interpreted as unsigned bytes with values
+ranging from 0 to 255.  Some C compilers define a 'char' variable as
+signed, so it is important to explicitly declare a numeric char
+variable as 'unsigned char' to avoid any ambiguity
 
+One feature of the CFITSIO routines is that they can operate on a `X'
+(bit) column in a binary table as though it were a `B' (byte) column.
+For example a `11X' data type column can be interpreted the same as a
+`2B' column (i.e., 2 unsigned 8-bit bytes).  In some instances, it can
+be more efficient to read and write whole bytes at a time, rather than
+reading or writing each individual bit.
 
-The original rootd server can be obtained from:
- 
-\begin{verbatim}
-       ftp://root.cern.ch/root/rootd.tar.gz
-\end{verbatim}
-but, for it to work correctly with CFITSIO one has to use a modified
-version which supports a command to return the length of the file.
-This modified version is available in rootd subdirectory
-in the CFITSIO ftp area at
- 
-\begin{verbatim}
-      ftp://legacy.gsfc.nasa.gov/software/fitsio/c/root/rootd.tar.gz.
-\end{verbatim}
+The complex and double precision complex data types are not directly
+supported in ANSI C so these data types should be interpreted as pairs
+of float or double values, respectively, where the first  value in each
+pair is the real part, and the second is the imaginary part.
+
+
+\section{Support for Unsigned Integers and Signed Bytes}
+
+Although FITS does not directly support unsigned integers as one of its
+fundamental data types, FITS can still be used to efficiently store
+unsigned integer data values in images and binary tables.  The
+convention used in FITS files is to store the unsigned integers as
+signed integers with an associated offset (specified by the BZERO or
+TZEROn keyword).  For example, to store unsigned 16-bit integer values
+in a FITS image the image would be defined as a signed 16-bit integer
+(with BITPIX keyword = SHORT\_IMG = 16) with the keywords BSCALE = 1.0
+and BZERO = 32768.  Thus the unsigned values of 0, 32768, and 65535,
+for example, are physically stored in the FITS image as -32768, 0, and
+32767, respectively;  CFITSIO automatically adds the BZERO offset to
+these values when they are read.  Similarly, in the case of unsigned
+32-bit integers the BITPIX keyword would be equal to LONG\_IMG = 32 and
+BZERO would be equal to 2147483648 (i.e. 2 raised to the 31st power).
+
+The CFITSIO interface routines will efficiently and transparently apply
+the appropriate offset in these cases so in general application
+programs do not need to be concerned with how the unsigned values are
+actually stored in the FITS file.  As a convenience for users, CFITSIO
+has several predefined constants for the value of BITPIX  (USHORT\_IMG,
+ULONG\_IMG) and for the TFORMn value in the case of binary tables (`U'
+and `V') which programmers can use when creating FITS files containing
+unsigned integer values.  The following code fragment illustrates how
+to write a FITS 1-D primary array of unsigned 16-bit integers:
 
-This small server is started either by inetd when a client requests a
-connection to a rootd server or by hand (i.e. from the command line).
-The rootd server works with the ROOT TNetFile class. It allows remote
-access to ROOT database files in either read or write mode. By default
-TNetFile assumes port 432 (which requires rootd to be started as root).
-To run rootd via inetd add the following line to /etc/services:
- 
-\begin{verbatim}
-  rootd     432/tcp
-\end{verbatim}
-and to /etc/inetd.conf, add the following line:
- 
-\begin{verbatim}
-  rootd stream tcp nowait root /user/rdm/root/bin/rootd rootd -i
-\end{verbatim}
-Force inetd to reread its conf file with "kill -HUP <pid inetd>".
-You can also start rootd by hand running directly under your private
-account (no root system priviliges needed). For example to start
-rootd listening on port 5151 just type:
- 
-\begin{verbatim}
-  rootd -p 5151
-\end{verbatim}
-Notice: no \& is needed. Rootd will go into background by itself.
- 
 \begin{verbatim}
-  Rootd arguments:
-    -i                says we were started by inetd
-    -p port#          specifies a different port to listen on
-    -d level          level of debug info written to syslog
-                      0 = no debug (default)
-                      1 = minimum
-                      2 = medium
-                      3 = maximum
+      unsigned short uarray[100];
+      int naxis, status;
+      long naxes[10], group, firstelem, nelements;
+       ...
+      status = 0;
+      naxis = 1;
+      naxes[0] = 100;
+      fits_create_img(fptr, USHORT_IMG, naxis, naxes, &status);
+
+      firstelem = 1;
+      nelements = 100;
+      fits_write_img(fptr, TUSHORT, firstelem, nelements,
+                          uarray, &status);
+       ...
 \end{verbatim}
-Rootd can also be configured for anonymous usage (like anonymous ftp).
-To setup rootd to accept anonymous logins do the following (while being
-logged in as root):
- 
-\begin{verbatim}
-   - Add the following line to /etc/passwd:
+In the above example, the 2nd parameter in fits\_create\_img tells
+CFITSIO to write the header keywords appropriate for an array of 16-bit
+unsigned integers (i.e., BITPIX = 16 and BZERO = 32768).  Then the
+fits\_write\_img routine writes the array of unsigned short integers
+(uarray) into the primary array of the FITS file.  Similarly, a 32-bit
+unsigned integer image may be created by setting the second parameter
+in fits\_create\_img equal to `ULONG\_IMG' and by calling the
+fits\_write\_img routine with the second parameter = TULONG to write
+the array of unsigned long image pixel values.
 
-     rootd:*:71:72:Anonymous rootd:/var/spool/rootd:/bin/false
+An analogous set of routines are available for reading or writing unsigned
+integer values and signed byte values in a FITS binary table extension.
+When specifying the TFORMn keyword value which defines the format of a
+column, CFITSIO recognized 3 additional data type codes besides those
+already defined in the FITS standard: `U' meaning a 16-bit unsigned
+integer column, `V' for a 32-bit unsigned integer column, and 'S'
+for a signed byte column.  These non-standard data type codes are not
+actually written into the FITS file but instead are just used internally
+within CFITSIO.  The following code fragment illustrates how to use
+these features:
 
-     where you may modify the uid, gid (71, 72) and the home directory
-     to suite your system.
+\begin{verbatim}
+      unsigned short uarray[100];
+      unsigned int  varray[100];
 
-   - Add the following line to /etc/group:
+      int colnum, tfields, status;
+      long nrows, firstrow, firstelem, nelements, pcount;
 
-     rootd:*:72:rootd
+      char extname[] = "Test_table";           /* extension name */
 
-     where the gid must match the gid in /etc/passwd.
+      /* define the name, data type, and physical units for the 2 columns */
+      char *ttype[] = { "Col_1", "Col_2", "Col_3" };
+      char *tform[] = { "1U",      "1V",    "1S"};  /* special CFITSIO codes */
+      char *tunit[] = { " ",        " ",    " " };
+       ...
 
-   - Create the directories:
+           /* write the header keywords */
+      status  = 0;
+      nrows   = 1;
+      tfields = 3
+      pcount  = 0;
+      fits_create_tbl(fptr, BINARY_TBL, nrows, tfields, ttype, tform,
+                tunit, extname, &status);
 
-     mkdir /var/spool/rootd
-     mkdir /var/spool/rootd/tmp
-     chmod 777 /var/spool/rootd/tmp
+           /* write the unsigned shorts to the 1st column */
+      colnum    = 1;
+      firstrow  = 1;
+      firstelem = 1;
+      nelements = 100;
+      fits_write_col(fptr, TUSHORT, colnum, firstrow, firstelem,
+              nelements, uarray, &status);
 
-     Where /var/spool/rootd must match the rootd home directory as
-     specified in the rootd /etc/passwd entry.
+           /* now write the unsigned longs to the 2nd column */
+      colnum    = 2;
+      fits_write_col(fptr, TUINT, colnum, firstrow, firstelem,
+              nelements, varray, &status);
+       ...
+\end{verbatim}
+Note that the non-standard TFORM values for the 3 columns, `U' and `V',
+tell CFITSIO to write the keywords appropriate for unsigned 16-bit and
+unsigned 32-bit integers, respectively (i.e., TFORMn = '1I' and TZEROn
+= 32678 for unsigned 16-bit integers, and TFORMn = '1J' and TZEROn =
+2147483648 for unsigned 32-bit integers).  The 'S' TFORMn value tells
+CFITSIO to write the keywords appropriate for a signed 8-bit byte column
+with TFORMn = '1B' and TZEROn = -128.  The calls to fits\_write\_col
+then write the arrays of unsigned integer values to the columns.
 
-   - To make writeable directories for anonymous do, for example:
 
-     mkdir /var/spool/rootd/pub
-     chown rootd:rootd /var/spool/rootd/pub
-\end{verbatim}
-That's all.  Several additional remarks:  you can login to an anonymous
-server either with the names "anonymous" or "rootd".  The password should
-be of type user@host.do.main. Only the @ is enforced for the time
-being.  In anonymous mode the top of the file tree is set to the rootd
-home directory, therefore only files below the home directory can be
-accessed.  Anonymous mode only works when the server is started via
-inetd.
+\section{Dealing with Character Strings}
 
+The character string values in a FITS header or in an ASCII column in a
+FITS table extension are generally padded out with non-significant
+space characters (ASCII 32) to fill up the header record or the column
+width.  When reading a FITS string value, the CFITSIO routines will
+strip off these non-significant trailing spaces and will return a
+null-terminated string value containing only the significant
+characters.  Leading spaces in a FITS string are considered
+significant.  If the string contains all blanks, then CFITSIO will
+return a single blank character, i.e, the first blank is considered to
+be significant, since it distinguishes the string from a null or
+undefined string, but the remaining trailing spaces are not
+significant.
 
- 
-\subsubsection{Notes about the shmem filetype:}
+Similarly, when writing string values to a FITS file the
+CFITSIO routines expect to get a null-terminated string as input;
+CFITSIO will pad the string with blanks if necessary when writing it
+to the FITS file.
+
+When calling CFITSIO routines that return a character string it is
+vital that the size of the char array be large enough to hold the
+entire string of characters, otherwise CFITSIO will overwrite whatever
+memory locations follow the char array, possibly causing the program to
+execute incorrectly.  This type of error can be difficult to debug, so
+programmers should always ensure that the char arrays are allocated
+enough space to hold the longest possible string, {\bf including} the
+terminating NULL character.  The fitsio.h file contains the following
+defined constants which programmers are strongly encouraged to use
+whenever they are allocating space for char arrays:
 
-Shared memory files are currently supported on most Unix platforms,
-where the shared memory segments are managed by the operating system
-kernel and `live' independently of processes. They are not deleted (by
-default) when the process which created them terminates, although they
-will disappear if the system is rebooted.  Applications can create
-shared memory files in CFITSIO by calling:
- 
 \begin{verbatim}
-   fit_create_file(&fitsfileptr, "shmem://h2", &status);
+#define FLEN_FILENAME 1025 /* max length of a filename */
+#define FLEN_KEYWORD   72  /* max length of a keyword  */
+#define FLEN_CARD      81  /* length of a FITS header card */
+#define FLEN_VALUE     71  /* max length of a keyword value string */
+#define FLEN_COMMENT   73  /* max length of a keyword comment string */
+#define FLEN_ERRMSG    81  /* max length of a CFITSIO error message */
+#define FLEN_STATUS    31  /* max length of a CFITSIO status text string */
 \end{verbatim}
-where the root `file' names are currently restricted to be 'h0', 'h1',
-'h2', 'h3', etc., up to a maximumn number defined by the the value of
-SHARED\_MAXSEG (equal to 16 by default).  This is a prototype
-implementation of the shared memory interface and a more robust
-interface, which will have fewer restrictions on the number of files
-and on their names, may be developed in the future.
+For example, when declaring a char array to hold the value string
+of FITS keyword, use the following statement:
 
-When opening an already existing FITS file in shared memory one calls
-the usual CFITSIO routine:
- 
 \begin{verbatim}
-   fits_open_file(&fitsfileptr, "shmem://h7", mode, &status)
+    char value[FLEN_VALUE];
 \end{verbatim}
-The file mode can be READWRITE or READONLY just as with disk files.
-More than one process can operate on READONLY mode files at the same
-time.  CFITSIO supports proper filelocking (both in READONLY and
-READWRITE modes), so calls to fits\_open\_file may be locked out until
-another other process closes the file.
+Note that FLEN\_KEYWORD is longer than needed for the nominal 8-character
+keyword name because the HIERARCH convention supports longer keyword names.
 
-When an application is finished accessing a FITS file in a shared
-memory segment, it may close it  (and the file will remain in the
-system) with fits\_close\_file, or delete it with fits\_delete\_file.
-Physical deletion is postponed until the last process calls
-ffclos/ffdelt.  fits\_delete\_file tries to obtain a READWRITE lock on
-the file to be deleted, thus it can be blocked if the object was not
-opened in READWRITE mode.
 
-A shared memory management utility program called `smem', is included
-with the CFITSIO distribution.  It can be built by typing `make smem';
-then type `smem -h' to get a list of valid options.  Executing smem
-without any options causes it to list all the shared memory segments
-currently residing in the system and managed by the shared memory
-driver. To get a list of all the shared memory objects, run the system
-utility program `ipcs  [-a]'.
+\section{Implicit Data Type Conversion}
 
- 
-\subsection{Base Filename}
+The CFITSIO routines that read and write numerical data can perform
+implicit data type conversion.  This means that the data type of the
+variable or array in the program does not need to be the same as the
+data type of the value in the FITS file.  Data type conversion is
+supported for numerical and string data types (if the string contains a
+valid number enclosed in quotes) when reading a FITS header keyword
+value and for numeric values when reading or writing values in the
+primary array or a table column.  CFITSIO returns status =
+NUM\_OVERFLOW  if the converted data value exceeds the range of the
+output data type.  Implicit data type conversion is not supported
+within binary tables for string, logical, complex, or double complex
+data types.
 
-The base filename is the name of the file optionally including the
-director/subdirectory path, and in the case of `ftp', `http', and `root'
-filetypes, the machine identifier.  Examples:
- 
-\begin{verbatim}
-    myfile.fits
-    !data.fits
-    /data/myfile.fits
-    fits.gsfc.nasa.gov/ftp/sampledata/myfile.fits.gz
-\end{verbatim}
+In addition, any table column may be read as if it contained string values.
+In the case of numeric columns the returned string will be formatted
+using the TDISPn display format if it exists.
 
-When creating a new output file on magnetic disk (of type file://) if
-the base filename begins with an exclamation point (!) then any
-existing file with that same basename will be deleted prior to creating
-the new FITS file.  Otherwise if the file to be created already exists,
-then CFITSIO will return an error and will not overwrite the existing
-file.  Note  that the exclamation point,  '!', is a special UNIX character,
-so if it is used  on the command line rather than entered at a task
-prompt, it must be  preceded by a backslash to force the UNIX
-shell to pass it verbatim to the application program.
 
-The input file may be compressed with the gzip or Unix compress
-algorithms, in which case CFITSIO will uncompress the file on the fly
-into a temporary file (in memory or on disk).  Compressed files may
-only be opened with read-only permission.  When specifying the name of
-a compressed FITS file it is not necessary to append the file suffix
-(e.g., `.gz' or `.Z').  If CFITSIO cannot find the input file name
-without the suffix, then it will automatically search for a compressed
-file with the same root name.  In the case of reading ftp and http type
-files, CFITSIO generally looks for a compressed version of the file
-first, before trying to open the uncompressed file.  By default,
-CFITSIO copies (and uncompressed if necessary) the ftp or http FITS
-file into memory on the local machine before opening it.  This will
-fail if the local machine does not have enough memory to hold the whole
-FITS file, so in this case, the output filename specifier (see the next
-section) can be used to further control how CFITSIO reads ftp and http
-files.
+\section{Data Scaling}
+
+When reading numerical data values in the primary array or a
+table column, the values will be scaled automatically by the BSCALE and
+BZERO (or TSCALn and TZEROn) header values if they are
+present in the header.  The scaled data that is returned to the reading
+program will have
 
-One special case is where the filename = `-' (a dash or minus sign),
-which signifies that the input file is to be read from the stdin
-stream, or written to the stdout stream if a new output file is being
-created.  In the case of reading from stdin, CFITSIO first copies the
-whole stream into a temporary FITS file (in memory or on disk), and
-subsequent reading of the FITS file occurs in this copy.  When writing
-to stdout, CFITSIO first constructs the whole file in memory (since
-random access is required), then flushes it out to the stdout stream
-when the file is closed.  This feature allows FITS files to be piped
-between tasks in memory rather than having to create temporary
-intermediate FITS files on disk.  For example if task1 creates an
-output FITS file, and task2 reads an input FITS file, the FITS file may
-be piped between the 2 tasks by specifying
- 
 \begin{verbatim}
-   task1 - | task2 -
+        output value = (FITS value) * BSCALE + BZERO
 \end{verbatim}
-where the vertical bar is the Unix piping symbol.  This assumes that the 2
-tasks read the name of the FITS file off of the command line.
-
- 
-\subsection{Output File Name when Opening an Existing File}
+(a corresponding formula using TSCALn and TZEROn is used when reading
+from table columns).  In the case of integer output values the floating
+point scaled value is truncated to an integer (not rounded to the
+nearest integer).  The fits\_set\_bscale and fits\_set\_tscale routines
+(described in the `Advanced' chapter) may be used to override the
+scaling parameters defined in the header (e.g., to turn off the scaling
+so that the program can read the raw unscaled values from the FITS
+file).
 
-An optional output filename may be specified in parentheses immediately
-following the base file name to be opened.  This is mainly useful in
-those cases where CFITSIO creates a temporary copy of the input FITS
-file before it is opened and passed to the application program.  This
-happens by default when opening a network FTP or HTTP-type file, when
-reading a compressed FITS file on a local disk, when reading from the
-stdin stream, or when a column filter, row filter, or binning specifier
-is included as part of the input file specification.  By default this
-temporary file is created in memory.  If there is not enough memory to
-create the file copy, then CFITSIO will exit with an error.   In these
-cases one can force a permanent file to be created on disk, instead of
-a temporary file in memory, by supplying the name in parentheses
-immediately following the base file name.  The output filename can
-include the '!' clobber flag.
+When writing numerical data to the primary array or to a table column
+the data values will generally be automatically inversely scaled by the
+value of the BSCALE and BZERO (or TSCALn and TZEROn) keyword values if
+they they exist in the header.  These keywords must have been written
+to the header before any data is written for them to have any immediate
+effect.  One may also use the fits\_set\_bscale and fits\_set\_tscale
+routines to define or override the scaling keywords in the header
+(e.g., to turn off the scaling so that the program can write the raw
+unscaled values into the FITS file). If scaling is performed, the
+inverse scaled output value that is written into the FITS file will
+have
 
-Thus, if the input filename to CFITSIO is:
- 
 \begin{verbatim}
-    file1.fits.gz(file2.fits)
+         FITS value = ((input value) - BZERO) / BSCALE
 \end{verbatim}
-then CFITSIO will uncompress `file1.fits.gz' into the local disk file
-`file2.fits' before opening it.  CFITSIO does not automatically delete
-the output file, so it will still exist after the application program
-exits.
-
-In some cases, several different temporary FITS files will be created
-in sequence, for instance, if one opens a remote file using FTP, then
-filters rows in a binary table extension, then create an image by
-binning a pair of columns.  In this case, the remote file will be
-copied to a temporary local file, then a second temporary file will be
-created containing the filtered rows of the table, and finally a third
-temporary file containing the binned image will be created.  In cases
-like this where multiple files are created, the outfile specifier will
-be interpreted the name of the final file as described below, in descending
-priority:
+(a corresponding formula using TSCALn and TZEROn is used when
+writing to table columns).  Rounding to the nearest integer, rather
+than truncation, is performed when writing integer data types to the
+FITS file.
 
-\begin{itemize}
-\item
-as the name of the final image file if an image within a single binary
-table cell is opened or if an image is created by binning a table column.
-\item
-as the name of the file containing the filtered table if a column filter
-and/or a row filter are specified.
-\item
-as the name of the local copy of the remote FTP or HTTP file.
-\item
-as the name of the uncompressed version of the FITS file, if a
-compressed FITS file on local disk has been opened.
-\item
-otherwise, the output filename is ignored.
-\end{itemize}
 
+\section{Support for IEEE Special Values}
 
-The output file specifier is useful when reading FTP or HTTP-type
-FITS files since it can be used to create a local disk copy of the file
-that can be reused in the future.  If the output file name = `*' then a
-local file with the same name as the network file will be created.
-Note that CFITSIO will behave differently depending on whether the
-remote file is compressed or not as shown by the following examples:
-\begin{itemize}
-\item
-`ftp://remote.machine/tmp/myfile.fits.gz(*)' - the remote compressed
-file is copied to the local compressed file `myfile.fits.gz', which
-is then uncompressed in local memory before being opened and passed
-to the application program.
+The ANSI/IEEE-754 floating-point number standard defines certain
+special values that are used to represent such quantities as
+Not-a-Number (NaN), denormalized, underflow, overflow, and infinity.
+(See the Appendix in the NOST FITS standard or the NOST FITS User's
+Guide for a list of these values).  The CFITSIO routines that read
+floating point data in FITS files recognize these IEEE special values
+and by default interpret the overflow and infinity values as being
+equivalent to a NaN, and convert the underflow and denormalized values
+into zeros.  In some cases programmers may want access to the raw IEEE
+values, without any modification by CFITSIO.  This can be done by
+calling the fits\_read\_img or fits\_read\_col routines while
+specifying 0.0 as the value of the NULLVAL parameter.  This will force
+CFITSIO to simply pass the IEEE values through to the application
+program without any modification.  This is not fully supported on
+VAX/VMS machines, however, where there is no easy way to bypass the
+default interpretation of the IEEE special values.
 
-\item
-`ftp://remote.machine/tmp/myfile.fits.gz(myfile.fits)' - the remote
-compressed file is copied and uncompressed into the local file
-`myfile.fits'.  This example requires less local memory than the
-previous example since the file is uncompressed on disk instead of
-in memory.
 
-\item
-`ftp://remote.machine/tmp/myfile.fits(myfile.fits.gz)' - this will
-usually produce an error since CFITSIO itself cannot compress files.
-\end{itemize}
+\section{Error Status Values and the Error Message Stack}
 
-The exact behavior of CFITSIO in the latter case depends on the type of
-ftp server running on the remote machine and how it is configured.  In
-some cases, if the file `myfile.fits.gz' exists on the remote machine,
-then the server will copy it to the local machine.  In other cases the
-ftp server will automatically create and transmit a compressed version
-of the file if only the uncompressed version exists.  This can get
-rather confusing, so users should use a certain amount of caution when
-using the output file specifier with FTP or HTTP file types, to make
-sure they get the behavior that they expect.
+Nearly all the CFITSIO routines return an error status value
+in 2 ways: as the value of the last parameter in the function call,
+and as the returned value of the function itself.  This provides
+some flexibility in the way programmers can test if an error
+occurred, as illustrated in the following 2 code fragments:
 
- 
-\subsection{Template File Name when Creating a New File}
+\begin{verbatim}
+    if ( fits_write_record(fptr, card, &status) )
+         printf(" Error occurred while writing keyword.");
 
-When a new FITS file is created with a call to fits\_create\_file, the
-name of a template file may be supplied in parentheses immediately
-following the name of the new file to be created.  This template is
-used to define the structure of one or more HDUs in the new file.  The
-template file may be another FITS file, in which case the newly created
-file will have exactly the same keywords in each HDU as in the template
-FITS file, but all the data units will be filled with zeros.  The
-template file may also be an ASCII text file, where each line (in
-general) describes one FITS keyword record.  The format of the ASCII
-template file is described below.
+or,
 
+    fits_write_record(fptr, card, &status);
+    if ( status )
+         printf(" Error occurred while writing keyword.");
+\end{verbatim}
+A listing of all the CFITSIO status code values is given at the end of
+this document.  Programmers are encouraged to use the symbolic
+mnemonics (defined in fitsio.h) rather than the actual integer status
+values to improve the readability of their code.
 
- 
-\subsubsection{Detailed Template Line Format}
+The CFITSIO library uses an `inherited status' convention for the
+status parameter which means that if a routine is called with a
+positive input value of the status parameter as input, then the routine
+will exit immediately without changing the value of the status
+parameter.  Thus, if one passes the status value returned from each
+CFITSIO routine as input to the next CFITSIO routine, then whenever an
+error is detected all further CFITSIO processing will cease.  This
+convention can simplify the error checking in application programs
+because it is not necessary to check the value of the status parameter
+after every single CFITSIO routine call.  If a program contains a
+sequence of several CFITSIO calls, one can just check the status value
+after the last call.  Since the returned status values are generally
+distinctive, it should be possible to determine which routine
+originally returned the error status.
 
-The format of each ASCII template line closely follows the format of a
-FITS keyword record:
- 
-\begin{verbatim}
-  KEYWORD = KEYVALUE / COMMENT
-\end{verbatim}
-except that free format may be used (e.g., the equals sign may appear
-at any position in the line) and TAB characters are allowed and are
-treated the same as space characters.  The KEYVALUE and COMMENT fields
-are optional.  The equals sign character is also optional, but it is
-recommended that it be included for clarity.  Any template line that
-begins with the pound '\#' character is ignored by the template parser
-and may be use to insert comments into the template file itself.
+CFITSIO also maintains an internal stack of error messages
+(80-character maximum length)  which in many cases provide a more
+detailed explanation of the cause of the error than is provided by the
+error status number alone.  It is recommended that the error message
+stack be printed out whenever a program detects a CFITSIO error.  The
+function fits\_report\_error will print out the entire error message
+stack, or alternatively one may call fits\_read\_errmsg to get the
+error messages one at a time.
 
-The KEYWORD name field is limited to 8 characters in length and only
-the letters A-Z, digits 0-9, and the hyphen and underscore characters
-may be used, without any embedded spaces. Lowercase letters in the
-template keyword name will be converted to uppercase.  Leading spaces
-in the template line preceding the keyword name are generally ignored,
-except if the first 8 characters of a template line are all blank, then
-the entire line is treated as a FITS comment keyword (with a blank
-keyword name) and is copied verbatim into the FITS header.
 
-The KEYVALUE field may have any allowed  FITS  data type: character
-string, logical, integer, real, complex integer, or complex real.  The
-character string values need not be enclosed in single quote characters
-unless they are necessary to distinguish the string from a different
-data type (e.g.  2.0 is a real but '2.0' is a string).  The keyword has
-an undefined (null) value if the template record only contains blanks
-following the "=" or between the "=" and the "/" comment field
-delimiter.
+\section{Variable-Length Arrays in Binary Tables}
 
-String keyword values longer than 68 characters (the maximum length
-that will fit in a single FITS keyword record) are permitted using the
-CFITSIO long string convention. They can either be specified as a
-single long line in the template, or by using multiple lines where the
-continuing lines contain the 'CONTINUE' keyword, as in this example:
- 
-\begin{verbatim}
-  LONGKEY = 'This is a long string value that is contin&'
-  CONTINUE  'ued over 2 records' / comment field goes here
-\end{verbatim}
-The format of template lines with CONTINUE keyword is very strict:  3
-spaces must follow CONTINUE and the rest of the line is copied verbatim
-to the FITS file.
+CFITSIO provides easy-to-use support for reading and writing data in
+variable length fields of a binary table. The variable length columns
+have TFORMn keyword values of the form `1Pt(len)' where `t' is the
+data type code (e.g., I, J, E, D, etc.) and `len' is an integer
+specifying the maximum length of the vector in the table.  If the value
+of `len' is not specified when the table is created (e.g., if the TFORM
+keyword value is simply specified as '1PE' instead of '1PE(400) ), then
+CFITSIO will automatically scan the table when it is closed to
+determine the maximum length of the vector and will append this value
+to the TFORMn value.
 
-The start of the optional COMMENT field must be preceded by "/", which
-is used to separate it from the keyword value field. Exceptions are if
-the KEYWORD name field contains COMMENT, HISTORY, CONTINUE, or if the
-first 8 characters of the template line are blanks.
+The same routines that read and write data in an ordinary fixed length
+binary table extension are also used for variable length fields,
+however, the routine parameters take on a slightly different
+interpretation as described below.
 
-More than one Header-Data Unit (HDU) may be defined in the template
-file.  The start of an HDU definition is denoted with a SIMPLE or
-XTENSION template line:
+All the data in a variable length field is written into an area called
+the `heap' which follows the main fixed-length FITS binary table. The
+size of the heap, in bytes, is specified by the PCOUNT keyword in the
+FITS header. When creating a new binary table, the initial value of
+PCOUNT should usually be set to zero. CFITSIO will recompute the size
+of the heap as the data is written and will automatically update the
+PCOUNT keyword value when the table is closed.  When writing variable
+length data to a table, CFITSIO will automatically extend the size
+of the heap area if necessary, so that any following HDUs do not
+get overwritten.
 
-1) SIMPLE begins a Primary HDU definition. SIMPLE may only appear as
-the  first keyword in the template file. If the template file begins
-with XTENSION instead of SIMPLE, then a default empty Primary HDU is
-created, and the template is then assumed to define the keywords
-starting with the first extension following the Primary HDU.
+By default the heap data area starts immediately after the last row of
+the fixed-length table.  This default starting location may be
+overridden by the THEAP keyword, but this is not recommended.
+If additional rows of data are added to the table, CFITSIO will
+automatically shift the the heap down to make room for the new
+rows, but it is obviously be more efficient to initially
+create the table with the necessary number of blank rows, so that
+the heap does not needed to be constantly moved.
 
-2) XTENSION marks the beginning of a new extension HDU definition.  The
-previous HDU will be closed at this point and processing of the next
-extension begins.
+When writing to a variable length field the entire array of values for
+a given row of the table must be written with a single call to
+fits\_write\_col.  The total length of the array is given by nelements
++ firstelem - 1.  Additional elements cannot be appended to an existing
+vector at a later time since any attempt to do so will simply overwrite
+all the previously written data.  Note also that the new data will be
+written to a new area of the heap and the heap space used by the
+previous write cannot be reclaimed.  For this reason each row of a
+variable length field should only be written once.  An exception to
+this general rule occurs when setting elements of an array as
+undefined.  One must first write a dummy value into the array with
+fits\_write\_col, and then call fits\_write\_col\_nul to flag the
+desired elements as undefined.  (Do not use the fits\_write\_colnull
+routines with variable length fields).  Note that the rows of a table,
+whether fixed or variable length, do not have to be written
+consecutively and may be written in any order.
 
- 
-\subsubsection{Auto-indexing of Keywords}
+When writing to a variable length ASCII character field (e.g., TFORM =
+'1PA') only a single character string can be written.  The `firstelem'
+and `nelements' parameter values in the fits\_write\_col routine are
+ignored and the number of characters to write is simply determined by
+the length of the input null-terminated character string.
+
+The fits\_write\_descript routine is useful in situations where
+multiple rows of a variable length column have the identical array of
+values.  One can simply write the array once for the first row, and
+then use fits\_write\_descript to write the same descriptor values into
+the other rows;  all the rows will then point to the same storage
+location thus saving disk space.
+
+When reading from a variable length array field one can only read as
+many elements as actually exist in that row of the table; reading does
+not automatically continue with the next row of the table as occurs
+when reading an ordinary fixed length table field.  Attempts to read
+more than this will cause an error status to be returned.  One can
+determine the number of elements in each row of a variable column with
+the fits\_read\_descript routine.
+
+
+\section{Multiple Access to the Same FITS File}
+
+CFITSIO supports simultaneous read and write access to multiple HDUs in
+the same FITS file.  Thus, one can open the same FITS file twice within
+a single program and move to 2 different HDUs in the file, and then
+read and write data or keywords to the 2 extensions just as if one were
+accessing 2 completely separate FITS files.   Since in general it is
+not possible to physically open the same file twice and then expect to
+be able to simultaneously (or in alternating succession) write to 2
+different locations in the file, CFITSIO recognizes when the file to be
+opened (in the call to fits\_open\_file) has already been opened and
+instead of actually opening the file again, just logically links the
+new file to the old file.  (This only applies if the file is opened
+more than once within the same program, and does not prevent the same
+file from being simultaneously opened by more than one program).  Then
+before CFITSIO reads or writes to either (logical) file, it makes sure
+that any modifications made to the other file have been completely
+flushed from the internal buffers to the file.  Thus, in principle, one
+could open a file twice, in one case pointing to the first extension
+and in the other pointing to the 2nd extension and then write data to
+both extensions, in any order, without danger of corrupting the file,
+There may be some efficiency penalties in doing this however, since
+CFITSIO has to flush all the internal buffers related to one file
+before switching to the  other, so it would still be prudent to
+minimize the number of times one switches back and forth between doing
+I/O to different HDUs in the same file.
+
+
+\section{When the Final Size of the FITS HDU is Unknown}
+
+It is not required to know the total size of a FITS data array or table
+before beginning to write the data to the FITS file.  In the case of
+the primary array or an image extension, one should initially create
+the array with the size of the highest dimension (largest NAXISn
+keyword) set to a dummy value, such as 1.  Then after all the data have
+been written and the true dimensions are known, then the NAXISn value
+should be updated using the fits\_update\_key routine before moving to
+another extension or closing the FITS file.
+
+When writing to FITS tables, CFITSIO automatically keeps track of the
+highest row number that is written to, and will increase the size of
+the table if necessary.  CFITSIO will also automatically insert space
+in the FITS file if necessary, to ensure that the data 'heap', if it
+exists, and/or any additional HDUs that follow the table do not get
+overwritten as new rows are written to the table.
+
+As a general rule it is best to specify the initial number of rows = 0
+when the table is created, then let CFITSIO keep track of the number of
+rows that are actually written.  The application program should not
+manually update the number of rows in the table (as given by the NAXIS2
+keyword) since CFITSIO does this automatically.  If a table is
+initially created with more than zero rows, then this will usually be
+considered as the minimum size of the table, even if fewer rows are
+actually written to the table.  Thus, if a table is initially created
+with NAXIS2 = 20, and CFITSIO only writes 10 rows of data before
+closing the table, then NAXIS2 will remain equal to 20.  If however, 30
+rows of data are written to this table, then NAXIS2 will be increased
+from 20 to 30.  The one exception to this automatic updating of the
+NAXIS2 keyword is if the application program directly modifies the
+value of NAXIS2 (up or down) itself just before closing the table.  In this
+case, CFITSIO does not update NAXIS2 again, since it assumes that the
+application program must have had a good reason for changing the value
+directly.  This is not recommended, however, and is only provided for
+backward compatibility with software that initially creates a table
+with a large number of rows, than decreases the NAXIS2 value to the
+actual smaller value just before closing the table.
+
+
+\section{CFITSIO Size Limitations}
+
+CFITSIO places very few restrictions on the size of FITS files that it
+reads or writes.  There are a few limits, however, that may affect
+some extreme cases:
+
+1.  The maximum number of FITS files that may be simultaneously opened
+by CFITSIO is set by NMAXFILES as defined in fitsio2.h.  It is currently
+set = 300 by default.  CFITSIO will allocate about 80 * NMAXFILES bytes
+of memory for internal use.  Note that the underlying C compiler or
+operating system, may have a smaller limit on the number of opened files.
+The C symbolic constant FOPEN\_MAX is intended to define the maximum
+number of files that may open at once (including any other text or
+binary files that may be open, not just FITS files).  On some systems it
+has been found that gcc supports a maximum of 255 opened files.
+
+Note that opening and operating on many FITS files simultaneously in
+parallel may be less efficient than operating on smaller groups of files
+in series.  CFITSIO only has NIOBUF number of internal buffers (set = 40
+by default) that are used for temporary storage of the most recent data
+records that have been read or written in the FITS files.  If the number
+of opened files is greater than NIOBUF, then CFITSIO may waste more time
+flushing and re-reading or re-writing the same records in the FITS files.
+
+2.  By default, CFITSIO can handle FITS files up to 2.1 GB in size
+(2**31 bytes).  This file size limit is often imposed by 32-bit operating
+systems.  More recently, as 64-bit operating systems become more common,
+an industry-wide standard (at least on Unix systems) has been developed to
+support larger sized files (see http://ftp.sas.com/standards/large.file/).
+Starting with version 2.1 of CFITSIO, larger FITS files up to 6
+terabytes in size may be read and written on certain supported platforms.
+In order to support these larger files, CFITSIO must be compiled with
+the `-D\_FILE\_OFFSET\_BITS=64' compiler flag.  Some platforms may
+also require the `-D\_LARGE\_FILES' compiler flag.  All programs that
+link to the CFITSIO library must also be compiled with this flag or must
+include this preprocessor definition at the start of the source code file.
+This causes the compiler to allocate 8-bytes instead of 4-bytes for the
+`off\_t' data type that is used to store file offset positions.
+
+If CFITSIO is compiled with the -D\_FILE\_OFFSET\_BITS=64 flag on a
+platform that supports large files, then it can read and write FITS
+files that contain up to 2**31 2880-byte FITS records, or approximately
+6 terabytes in size.  It is still required that the value of the NAXISn
+and PCOUNT keywords in each extension be within the range of a signed
+4-byte integer (max value = 2,147,483,648).  Thus, each dimension of an
+image (given by the NAXISn keywords), the total width of a table
+(NAXIS1 keyword), the number of rows in a table (NAXIS2 keyword), and
+the total size of the variable-length array heap in binary tables
+(PCOUNT keyword) must be less than this limit.
+
+Currently, support for large files within CFITSIO has been tested
+on the Solaris 2.6 operating system using the Sun cc compiler or gcc
+and on IBM AIX POWER3 and POWER4 systems.
+
+\chapter{Basic CFITSIO Interface Routines }
+
+This chapter describes the basic routines in the CFITSIO user interface
+that provide all the functions normally needed to read and write most
+FITS files.  It is recommended that these routines be used for most
+applications and that the more advanced routines described in the
+next chapter only be used in special circumstances when necessary.
+
+The following conventions are used in this chapter in the description
+of each function:
+
+1. Most functions have 2 names: a long descriptive name and a short
+concise name.  Both names are listed on the first line of the following
+descriptions, separated by a slash (/) character.  Programmers may use
+either name in their programs but the long names are recommended to
+help document the code and make it easier to read.
+
+2. A right arrow symbol ($>$) is used in the function descriptions to
+separate the input parameters from the output parameters in the
+definition of each routine.  This symbol is not actually part of the C
+calling sequence.
+
+3. The function parameters are defined in more detail in the
+alphabetical listing in Appendix B.
+
+4.  The first argument in almost all the functions is a pointer to a
+structure of type `fitsfile'.  Memory for this structure is allocated
+by CFITSIO when the FITS file is first opened or created and is freed
+when the FITS file is closed.
+
+5.  The last argument in almost all the functions is the error status
+parameter.  It must be equal to 0 on input, otherwise the function will
+immediately exit without doing anything.  A non-zero output value
+indicates that an error occurred in the function.  In most cases the
+status value is also returned as the value of the function itself.
+
+
+\section{CFITSIO Error Status Routines}
+
+
+\begin{description}
+\item[1 ] Return a descriptive text string (30 char max.) corresponding to
+   a CFITSIO error status code.\label{ffgerr}
+\end{description}
 
-If a template keyword name ends with a "\#" character, it is said to be
-'auto-indexed'.   Each "\#" character will be replaced by the current
-integer index value, which gets reset = 1 at the start of each new HDU
-in the file (or 7 in the special case of a GROUP definition).  The
-FIRST indexed keyword in each template HDU definition is used as the
-'incrementor';  each subsequent occurence of this SAME keyword will
-cause the index value to be incremented.  This behavior can be rather
-subtle, as illustrated in the following examples in which the TTYPE
-keyword is the incrementor in both cases:
- 
 \begin{verbatim}
-  TTYPE# = TIME
-  TFORM# = 1D
-  TTYPE# = RATE
-  TFORM# = 1E
+  void fits_get_errstatus / ffgerr (int status, > char *err_text)
 \end{verbatim}
-will create TTYPE1, TFORM1, TTYPE2, and TFORM2 keywords.  But if the
-template looks like,
- 
+
+\begin{description}
+\item[2 ] Return the top (oldest) 80-character error message from the
+    internal CFITSIO stack of error messages and shift any remaining
+    messages on the stack up one level.  Call this routine
+    repeatedly to get each message in sequence.  The function returns
+   a value = 0 and a null error message when the error stack is empty.
+\label{ffgmsg}
+\end{description}
+
 \begin{verbatim}
-  TTYPE# = TIME
-  TTYPE# = RATE
-  TFORM# = 1D
-  TFORM# = 1E
+  int fits_read_errmsg / ffgmsg (char *err_msg)
 \end{verbatim}
-this results in a FITS files with  TTYPE1, TTYPE2, TFORM2, and TFORM2,
-which is probably not what was intended!
 
- 
-\subsubsection{Template Parser Directives}
+\begin{description}
+\item[3 ] Print out the error message corresponding to the input status
+    value and all the error messages on the CFITSIO stack to the specified
+    file stream  (normally to stdout or stderr).  If the input
+    status value = 0 then this routine does nothing.
+\label{ffrprt}
+\end{description}
 
-In addition to the template lines which define individual keywords, the
-template parser recognizes 3 special directives which are each preceded
-by the backslash character:  \verb+ \include, \group+, and \verb+ \end+.
+\begin{verbatim}
+  void fits_report_error / ffrprt (FILE *stream, > status)
+\end{verbatim}
 
-The 'include' directive must be followed by a filename. It forces the
-parser to temporarily stop reading the current template file and begin
-reading the include file. Once the parser reaches the end of the
-include file it continues parsing the current template file.  Include
-files can be nested, and HDU definitions can span multiple template
-files.
+\begin{description}
+\item[4 ]The fits\_write\_errmark routine puts an invisible marker on the
+   CFITSIO error stack.  The fits\_clear\_errmark routine can then be
+   used to delete any more recent error messages on the stack, back to
+   the position of the marker.  This preserves any older error messages
+   on the stack.  The fits\_clear\_errmsg routine simply clears all the
+   messages (and marks) from the stack.  These routines are called
+   without any arguments.
+\label{ffpmrk}  \label{ffcmsg}
+\end{description}
 
-The start of a GROUP definition is denoted with the 'group' directive,
-and the end of a GROUP definition is denoted with the 'end' directive.
-Each GROUP contains 0 or more member blocks (HDUs or GROUPs). Member
-blocks of type GROUP can contain their own member blocks. The GROUP
-definition itself occupies one FITS file HDU of special type (GROUP
-HDU), so if a template specifies 1 group with 1 member HDU like:
- 
 \begin{verbatim}
-\group
-grpdescr = 'demo'
-xtension bintable
-# this bintable has 0 cols, 0 rows
-\end
+  void fits_write_errmark / ffpmrk (void)
+  void fits_clear_errmark / ffcmrk (void)
+  void fits_clear_errmsg / ffcmsg (void)
 \end{verbatim}
-then the parser creates a FITS file with 3 HDUs :
- 
-\begin{verbatim}
-1) dummy PHDU
-2) GROUP HDU (has 1 member, which is bintable in HDU number 3)
-3) bintable (member of GROUP in HDU number 2)
+
+
+\section{FITS File Access Routines}
+
+
+\begin{description}
+\item[1 ] Open an existing data file. \label{ffopen}
+
+
+\begin{verbatim}
+int fits_open_file / ffopen
+    (fitsfile **fptr, char *filename, int iomode, > int *status)
+
+int fits_open_data / ffdopn
+    (fitsfile **fptr, char *filename, int iomode, > int *status)
+
+int fits_open_table / fftopn
+    (fitsfile **fptr, char *filename, int iomode, > int *status)
+
+int fits_open_image / ffiopn
+    (fitsfile **fptr, char *filename, int iomode, > int *status)
 \end{verbatim}
-Technically speaking, the GROUP HDU is a BINTABLE with 6 columns. Applications
-can define additional columns in a GROUP HDU using TFORMn and TTYPEn
-(where n is 7, 8, ....) keywords or their auto-indexing equivalents.
 
-For a more complicated example of a template file using the group directives,
-look at the sample.tpl file that is included in the CFITSIO distribution.
+The iomode parameter determines the read/write access allowed in the
+file and can have values of READONLY (0) or READWRITE (1). The filename
+parameter gives the name of the file to be opened, followed by an
+optional argument giving the name or index number of the extension
+within the FITS file that should be moved to and opened (e.g.,
+\verb-myfile.fits+3- or \verb-myfile.fits[3]- moves to the 3rd extension within
+the file, and \verb-myfile.fits[events]- moves to the extension with the
+keyword EXTNAME = 'EVENTS').
 
- 
-\subsubsection{Formal Template Syntax}
+The fits\_open\_data routine is similar to the fits\_open\_file routine
+except that it will move to the first HDU containing significant data,
+if a HDU name or number to open was not explicitly specified as
+part of the filename.  In this case, it will look for the first
+IMAGE HDU with NAXIS > 0, or the first table that does not contain the
+strings `GTI' (Good Time Interval extension) or `OBSTABLE' in the
+EXTNAME keyword value.
 
-The template syntax can formally be defined as follows:
- 
-\begin{verbatim}
-    TEMPLATE = BLOCK [ BLOCK ... ]
+The fits\_open\_table and fits\_open\_image routines are similar to
+fits\_open\_data except they will move to the first significant table
+HDU or image HDU in the file, respectively, if a HDU name or
+number is not specified as part of the filename.
 
-       BLOCK = { HDU | GROUP }
+IRAF images (.imh format files) and raw binary data arrays may also be
+opened with READONLY access.  CFITSIO will automatically test if the
+input file is an IRAF image, and if, so will convert it on the fly into
+a virtual FITS image before it is opened by the application program.
+If the input file is a raw binary data array of numbers, then the data type
+and dimensions of the array must be specified in square brackets
+following the name of the file (e.g.  'rawfile.dat[i512,512]' opens a
+512 x 512 short integer image).  See the `Extended File Name Syntax'
+chapter for more details on how to specify the raw file name.  The raw
+file is converted on the fly into a virtual FITS image in memory that
+is then opened by the application program with READONLY access.
 
-       GROUP = \GROUP [ BLOCK ... ] \END
+Programs can read the input file from the 'stdin' file stream if a dash
+character ('-') is given as the filename. Files can also be opened over
+the network using FTP or HTTP protocols by supplying the appropriate URL
+as the filename.
 
-         HDU = XTENSION [ LINE ... ] { XTENSION | \GROUP | \END | EOF }
+The input file can be modified in various ways to create a virtual file
+(usually stored in memory) that is then opened by the application
+program by supplying a filtering or binning specifier in square brackets
+following the filename. Some of the more common filtering methods are
+illustrated in the following paragraphs, but users should refer to the
+'Extended File Name Syntax' chapter for a complete description of
+the full file filtering syntax.
 
-        LINE = [ KEYWORD [ = ] ] [ VALUE ] [ / COMMENT ]
+When opening an image, a rectangular subset of the physical image may be
+opened by listing the first and last pixel in each dimension (and
+optional pixel skipping factor):
 
-    X ...     - X can be present 1 or more times
-    { X | Y } - X or Y
-    [ X ]     - X is optional
+\begin{verbatim}
+myimage.fits[101:200,301:400]
 \end{verbatim}
+will create and open a 100x100 pixel virtual image of that section of
+the physical image, and \verb+myimage.fits[*,-*]+ opens a virtual image
+that is the same size as the physical image but has been flipped in
+the vertical direction.
 
-At the topmost level, the template defines 1 or more template blocks. Blocks
-can be either HDU (Header Data Unit) or a GROUP. For each block the parser
-creates 1 (or more for GROUPs) FITS file HDUs.
+When opening a table, the filtering syntax can be used to add or delete
+columns or keywords in the virtual table:
+\verb-myfile.fits[events][col !time; PI = PHA*1.2]- opens a virtual table in which the TIME column
+has been deleted and a new PI column has been added with a value 1.2
+times that of the PHA column. Similarly, one can filter a table to keep
+only those rows that satisfy a selection criterion:
+\verb-myfile.fits[events][pha > 50]- creates and opens a virtual table
+containing only those rows with a PHA value greater than 50. A large
+number of boolean and mathematical operators can be used in the
+selection expression. One can also filter table rows using 'Good Time
+Interval' extensions, and spatial region filters as in
+\verb-myfile.fits[events][gtifilter()]- and
+\verb-myfile.fits[events][regfilter( "stars.rng")]-.
 
+Finally, table columns may be binned or histogrammed to generate a
+virtual image. For example, \verb-myfile.fits[events][bin (X,Y)=4]- will
+result in a 2-dimensional image calculated by binning the X and Y
+columns in the event table with a bin size of 4 in each dimension. The
+TLMINn and TLMAXn keywords will be used by default to determine the
+range of the image.
 
- 
-\subsubsection{Errors}
+A single program can open the same FITS file more than once and then
+treat the resulting fitsfile pointers as though they were completely
+independent FITS files. Using this facility, a program can open a FITS
+file twice, move to 2 different extensions within the file, and then
+ read and write data in those extensions in any order.
+\end{description}
 
-In general the fits\_execute\_template() function tries to be as atomic
-as possible, so either everything is done or nothing is done. If an
-error occurs during parsing of the template, fits\_execute\_template()
-will (try to) delete the top level BLOCK (with all its children if any)
-in which the error occured, then it will stop reading the template file
-and it will return with an error.
 
- 
-\subsubsection{Examples}
+\begin{description}
+\item[2 ]  Create and open a new empty output FITS file. \label{ffinit}
+
 
-1. This template file will create a 200 x 300 pixel image, with 4-byte
-integer pixel values, in the primary HDU:
- 
 \begin{verbatim}
-  SIMPLE = T
-  BITPIX = 32
-  NAXIS = 2     / number of dimensions
-  NAXIS1 = 100  / length of first axis
-  NAXIS2 = 200  / length of second axis
-  OBJECT = NGC 253 / name of observed object
+int fits_create_file / ffinit
+    (fitsfile **fptr, char *filename, > int *status)
 \end{verbatim}
-The allowed values of BITPIX are 8, 16, 32, -32, or -64,
-representing, respectively, 8-bit integer, 16-bit integer, 32-bit
-integer, 32-bit floating point, or 64 bit floating point pixels.
-
-2.  To create a FITS  table, the template first needs to include
-XTENSION = TABLE or BINTABLE to define whether it is an ASCII or binary
-table, and NAXIS2 to define the number of rows in the table.  Two
-template lines are then needed to define the name (TTYPEn) and FITS data
-format (TFORMn) of the columns, as in this example:
- 
-\begin{verbatim}
-  xtension = bintable
-  naxis2 = 40
-  ttype# = Name
-  tform# = 10a
-  ttype# = Npoints
-  tform# = j
-  ttype# = Rate
-  tunit# = counts/s
-  tform# = e
-\end{verbatim}
-The above example defines a null primary array followed by a 40-row
-binary table extension with 3 columns called 'Name', 'Npoints', and
-'Rate', with data formats of '10A' (ASCII character string), '1J'
-(integer) and '1E' (floating point), respectively.  Note that the other
-required FITS keywords (BITPIX, NAXIS, NAXIS1, PCOUNT, GCOUNT, TFIELDS,
-and END) do not need to be explicitly defined in the template because
-their values can be inferred from the other keywords in the template.
-This example also illustrates that the templates are generally
-case-insensitive (the keyword names and TFORMn values are converted to
-upper-case in the FITS file) and that string keyword values generally
-do not need to be enclosed in quotes.
-
- 
-\subsection{HDU Location Specification}
 
-The optional HDU location specifier defines which HDU (Header-Data
-Unit, also known as an `extension') within the FITS file to initially
-open.  It must immediately follow the base file name (or the output
-file name if present).  If it is not specified then the first HDU (the
-primary array) is opened.  The HDU location specifier is required if
-the colFilter, rowFilter, or binSpec specifiers are present, because
-the primary array is not a valid HDU for these operations. The HDU may
-be specified either by absolute position number, starting with 0 for
-the primary array, or by reference to the HDU name, and optionally, the
-version number and the HDU type of the desired extension.  The location
-of an image within a single cell of a binary table may also be
-specified, as described below.
+An error will be returned if the specified file already exists, unless
+the filename is prefixed with an exclamation point (!). In that case
+CFITSIO will overwrite (delete) any existing file with the same name.
+Note that the exclamation point is a special UNIX character so if
+it is used on the command line it must be preceded by a backslash to
+force the UNIX shell to accept the character as part of the filename.
+
+The output file will be written to the 'stdout' file stream if a dash
+character ('-') or the string 'stdout' is given as the filename. Similarly,
+'-.gz' or 'stdout.gz' will cause the file to be gzip compressed before
+it is written out to the stdout stream.
+
+Optionally, the name of a template file that is used to define the
+structure of the new file may be specified in parentheses following the
+output file name. The template file may be another FITS file, in which
+case the new file, at the time it is opened, will be an exact copy of
+the template file except that the data structures (images and tables)
+will be filled with zeros. Alternatively, the template file may be an
+ASCII format text file containing directives that define the keywords to be
+created in each HDU of the file. See the 'Extended File Name Syntax'
+ section for a complete description of the template file syntax.
+\end{description}
 
-The absolute position of the extension is specified either by enclosed
-the number in square brackets (e.g., `[1]' = the first extension
-following the primary array) or by preceded the number with a plus sign
-(`+1').  To specify the HDU by name, give the name of the desired HDU
-(the value of the EXTNAME or HDUNAME keyword) and optionally the
-extension version number (value of the EXTVER keyword) and the
-extension type (value of the XTENSION keyword: IMAGE, ASCII or TABLE,
-or BINTABLE), separated by commas and all enclosed in square brackets.
-If the value of EXTVER and XTENSION are not specified, then the first
-extension with the correct value of EXTNAME is opened. The extension
-name and type are not case sensitive, and the extension type may be
-abbreviated to a single letter (e.g., I = IMAGE extension or primary
-array, A or T = ASCII table extension, and B = binary table BINTABLE
-extension).   If the HDU location specifier is equal to `[PRIMARY]' or
-`[P]', then the primary array (the first HDU) will be opened.
 
-FITS images are most commonly stored in the primary array or an image
-extension, but images can also be stored as a vector in a single cell
-of a binary table (i.e. each row of the vector column contains a
-different image).  Such an image can be opened with CFITSIO by
-specifying the desired column  name and the row number after the binary
-table HDU specifier as shown in the following examples. The column name
-is separated from the HDU specifier by a semicolon and the row number
-is enclosed in parentheses.  In this case CFITSIO copies the image from
-the table cell into a temporary primary array before it is opened.  The
-application program then just sees the image in the primary array,
-without any extensions.  The particular row to be opened may be
-specified either by giving an absolute integer row number (starting
-with 1 for the first row), or by specifying a boolean expression that
-evaluates to TRUE for the desired row.  The first row that satisfies
-the expression will be used.  The row selection expression has the same
-syntax as described in the Row Filter Specifier section, below.
+\begin{description}
+\item[3 ] Close a previously opened FITS file.  The first routine simply
+closes the file, whereas the second one also DELETES THE FILE, which
+can be useful in cases where a FITS file has been partially created,
+but then an error occurs which prevents it from being completed.
+ \label{ffclos} \label{ffdelt}
+\end{description}
 
- Examples:
- 
 \begin{verbatim}
-   myfile.fits[3] - open the 3rd HDU following the primary array
-   myfile.fits+3  - same as above, but using the FTOOLS-style notation
-   myfile.fits[EVENTS] - open the extension that has EXTNAME = 'EVENTS'
-   myfile.fits[EVENTS, 2]  - same as above, but also requires EXTVER = 2
-   myfile.fits[events,2,b] - same, but also requires XTENSION = 'BINTABLE'
-   myfile.fits[3; images(17)] - opens the image in row 17 of the 'images'
-                                column in the 3rd extension of the file.
-   myfile.fits[3; images(exposure > 100)] - as above, but opens the image
-                   in the first row that has an 'exposure' column value
-                   greater than 100.
-\end{verbatim}
+  int fits_close_file / ffclos (fitsfile *fptr, > int *status)
 
- 
-\subsection{Image Section}
+  int fits_delete_file / ffdelt (fitsfile *fptr, > int *status)
+\end{verbatim}
 
-A virtual file containing a rectangular subsection of an image can be
-extracted and opened by specifying the range of pixels (start:end)
-along each axis to be extracted from the original image.  One can also
-specify an optional pixel increment (start:end:step) for each axis of
-the input image.  A pixel step = 1 will be assumed if it is not
-specified.  If the start pixel is larger then the end pixel, then the
-image will be flipped (producing a mirror image) along that dimension.
-An asterisk, '*', may be used to specify the entire range of an axis,
-and '-*' will flip the entire axis. The input image can be in the
-primary array, in an image extension, or contained in a vector cell of
-a binary table. In the later 2 cases the extension name or number must
-be specified before the image section specifier.
+\begin{description}
+\item[4 ]Return the name, I/O mode (READONLY or READWRITE), and/or the file
+type (e.g. 'file://', 'ftp://') of the opened FITS file. \label{ffflnm}
+ \label{ffflmd} \label{ffurlt}
+\end{description}
 
- Examples:
- 
 \begin{verbatim}
-  myfile.fits[1:512:2, 2:512:2] -  open a 256x256 pixel image
-              consisting of the odd numbered columns (1st axis) and
-              the even numbered rows (2nd axis) of the image in the
-              primary array of the file.
+  int fits_file_name / ffflnm (fitsfile *fptr, > char *filename, int *status)
 
-  myfile.fits[*, 512:256] - open an image consisting of all the columns
-              in the input image, but only rows 256 through 512.
-              The image will be flipped along the 2nd axis since
-              the starting pixel is greater than the ending pixel.
+  int fits_file_mode / ffflmd (fitsfile *fptr, > int *iomode, int *status)
 
-  myfile.fits[*:2, 512:256:2] - same as above but keeping only
-              every other row and column in the input image.
+  int fits_url_type / ffurlt (fitsfile *fptr, > char *urltype, int *status)
+\end{verbatim}
 
-  myfile.fits[-*, *] - copy the entire image, flipping it along
-              the first axis.
+\section{HDU Access Routines}
 
-  myfile.fits[3][1:256,1:256] - opens a subsection of the image that
-              is in the 3rd extension of the file.
+The following functions perform operations on Header-Data Units (HDUs)
+as a whole.
+
+
+\begin{description}
+\item[1 ] Move to a different HDU in the file.  The first routine moves to a
+    specified absolute HDU number (starting with 1 for the primary
+    array) in the FITS file, and the second routine moves a relative
+    number HDUs forward or backward from the current HDU.  A null
+    pointer may be given for the hdutype parameter if it's value is not
+    needed.  The third routine moves to the (first) HDU which has the
+    specified extension type and EXTNAME and EXTVER keyword values (or
+    HDUNAME and HDUVER keywords).  The hdutype parameter may have a
+    value of IMAGE\_HDU, ASCII\_TBL, BINARY\_TBL, or ANY\_HDU where
+    ANY\_HDU means that only the extname and extver values will be used
+    to locate the correct extension.  If the input value of extver is 0
+    then the EXTVER keyword is ignored and the first HDU with a
+    matching EXTNAME (or HDUNAME) keyword will be found.  If no
+    matching HDU is found in the file then the current HDU will remain
+    unchanged and a status = BAD\_HDU\_NUM will be returned.
+  \label{ffmahd} \label{ffmrhd} \label{ffmnhd}
+\end{description}
 
-  myfile.fits[4; images(12)][1:10,1:10] - open an image consisting
-	      of the first 10 pixels in both dimensions. The original
-	      image resides in the 12th row of the 'images' vector
-	      column in the table in the 4th extension of the file.
-\end{verbatim}
+\begin{verbatim}
+  int fits_movabs_hdu / ffmahd
+      (fitsfile *fptr, int hdunum, > int *hdutype, int *status)
 
-When CFITSIO opens an image section it first creates a temporary file
-containing the image section plus a copy of any other HDUs in the
-file.  This temporary file is then opened by the application program,
-so it is not possible to write to or modify the input file when
-specifying an image section.  Note that CFITSIO automatically updates
-the world coordinate system keywords in the header of the image
-section, if they exist, so that the coordinate associated with each
-pixel in the image section will be computed correctly.
+  int fits_movrel_hdu / ffmrhd
+      (fitsfile *fptr, int nmove, > int *hdutype, int *status)
 
- 
-\subsection{Column and Keyword Filtering Specification}
+  int fits_movnam_hdu / ffmnhd
+      (fitsfile *fptr, int hdutype, char *extname, int extver, > int *status)
+\end{verbatim}
 
-The optional column/keyword filtering specifier is used to modify the
-column structure and/or the header keywords in the HDU that was
-selected with the previous HDU location specifier. This filtering
-specifier must be enclosed in square brackets and can be distinguished
-from a general row filter specifier (described below) by the fact that
-it begins with the string 'col ' and is not immediately followed by an
-equals sign.  The original file is not changed by this filtering
-operation, and instead the modifications are made on a copy of the
-input FITS file (usually in memory), which also contains a copy of all
-the other HDUs in the file.  This temporary file is passed to the
-application program and will persist only until the file is closed or
-until the program exits, unless the outfile specifier (see above) is
-also supplied.
+\begin{description}
+\item[2 ] Return the total number of HDUs in the FITS file.
+   The current HDU remains unchanged. \label{ffthdu}
+\end{description}
 
-The column/keyword filter can be used to perform the following
-operations.  More than one operation may be specified by separating
-them with semi-colons.
+\begin{verbatim}
+  int fits_get_num_hdus / ffthdu
+      (fitsfile *fptr, > int *hdunum, int *status)
+\end{verbatim}
 
-\begin{itemize}
-\item
-Delete a column or keyword by listing the name preceeded by an
-exclamation mark (!), e.g., '!TIME' will delete the TIME column if it
-exists, otherwise the TIME keyword.  An error is returned if neither a
-column nor keyword with this name exists.  Note  that the exclamation
-point,  '!', is a special UNIX character, so if it is used  on the
-command line rather than entered at a task prompt, it must be  preceded
-by a backslash to force the UNIX shell to ignore it.
+\begin{description}
+\item[3 ] Return the number of the current HDU (CHDU) in the FITS file (where
+    the primary array = 1).  This function returns the HDU number
+   rather than a status value.  \label{ffghdn}
+\end{description}
 
-\item
-Rename an existing column or keyword with the syntax 'NewName ==
-OldName'.  An error is returned if neither a column nor keyword with
-this name exists.
+\begin{verbatim}
+  int fits_get_hdu_num / ffghdn
+      (fitsfile *fptr, > int *hdunum)
+\end{verbatim}
 
-\item
-Append a new column or keyword to the table.  To create a column,
-give the new name, optionally followed by the datatype in parentheses,
-followed by a single equals sign and an  expression to be used to
-compute the value (e.g., 'newcol(1J) = 0' will create a new 32-bit
-integer column called 'newcol' filled with zeros).  The datatype is
-specified using the same syntax that is allowed for the value of the
-FITS TFORMn keyword (e.g., 'I', 'J', 'E', 'D', etc. for binary tables,
-and 'I8', F12.3', 'E20.12', etc. for ASCII tables).  If the datatype is
-not specified then an appropriate datatype will be chosen depending on
-the form of the expression (may be a character string, logical, bit, long
-integer, or double column). An appropriate vector count (in the case
-of binary tables) will also be added if not explicitly specified.
+\begin{description}
+\item[4 ] Return the type of the current HDU in the FITS file.  The possible
+   values for hdutype are: IMAGE\_HDU, ASCII\_TBL, or BINARY\_TBL.  \label{ffghdt}
+\end{description}
 
-When creating a new keyword, the keyword name must be preceeded by a
-pound sign '\#', and the expression must evaluate to a scalar
-(i.e., cannot have a column name in the expression).  The comment
-string for the keyword may be specified in parentheses immediately
-following the keyword name (instead of supplying a datatype as in
-the case of creating a new column).
+\begin{verbatim}
+  int fits_get_hdu_type / ffghdt
+      (fitsfile *fptr, > int *hdutype, int *status)
+\end{verbatim}
 
-\item
-Recompute (overwrite) the values in an existing column or keyword by
-giving the name followed by an equals sign and an arithmetic
-expression.
-\end{itemize}
+\begin{description}
+\item[5 ] Copy all or part of the HDUs in the FITS file associated with infptr
+    and append them to the end of the FITS file associated with
+    outfptr.  If 'previous' is true (not 0), then any HDUs preceding
+    the current HDU in the input file will be copied to the output
+    file.  Similarly, 'current' and 'following' determine whether the
+    current HDU, and/or any following HDUs in the input file will be
+    copied to the output file. Thus, if all 3 parameters are true, then the
+    entire input file will be copied.  On exit, the current HDU in
+    the input file will be unchanged, and the last HDU in the output
+   file will be the current HDU.  \label{ffcpfl}
+\end{description}
 
-The expression that is used when appending or recomuting columns or
-keywords can be arbitrarily complex and may be a function of other
-header keyword values and other columns (in the same row).  The full
-syntax and available functions for the expression are described below
-in the row filter specification section.
+\begin{verbatim}
+  int fits_copy_file / ffcpfl
+      (fitsfile *infptr, fitsfile *outfptr, int previous, int current,
+          int following, > int *status)
+\end{verbatim}
 
-For  complex  or commonly used operations,  one  can also  place the
-operations into a text  file and  import it  into the  column filter
-using  the syntax '[col @filename.txt]'.   The operations can extend
-over multiple lines of the  file, but multiple operations must still
-be separated by semicolons.
+\begin{description}
+\item[6 ] Copy the current HDU from the FITS file associated with infptr and append it
+    to the end of the FITS file associated with outfptr.  Space may be
+   reserved for MOREKEYS additional keywords in the output header. \label{ffcopy}
+\end{description}
 
-Examples:
- 
 \begin{verbatim}
-   [col !TIME; Good == STATUS]   - deletes the TIME column and
-                                   renames the status column to 'Good'
+  int fits_copy_hdu / ffcopy
+      (fitsfile *infptr, fitsfile *outfptr, int morekeys, > int *status)
+\end{verbatim}
 
-   [col PI=PHA * 1.1 + 0.2]      - creates new PI column from PHA values
+\begin{description}
+\item[7 ]  Copy the header (and not the data) from the CHDU associated with infptr
+    to the CHDU associated with outfptr.  If the current output HDU
+    is not completely empty, then the CHDU will be closed and a new
+    HDU will be appended to the output file.   An empty output data unit
+   will be created with all values initially = 0). \label{ffcphd}
+\end{description}
 
-   [col rate = rate/exposure]   - recomputes the rate column by dividing
-                                   it by the EXPOSURE keyword value.
+\begin{verbatim}
+  int fits_copy_header / ffcphd
+      (fitsfile *infptr, fitsfile *outfptr, > int *status)
 \end{verbatim}
 
- 
-\subsection{Row Filtering Specification}
+\begin{description}
+\item[8 ]  Delete the CHDU in the FITS file.  Any following HDUs will be shifted
+    forward in the file, to fill in the gap created by the deleted
+    HDU.  In the case of deleting the primary array (the first HDU in
+    the file) then the current primary array will be replace by a null
+    primary array containing the minimum set of required keywords and
+    no data.  If there are more extensions in the file following the
+    one that is deleted, then the the CHDU will be redefined to point
+    to the following extension.  If there are no following extensions
+    then the CHDU will be redefined to point to the previous HDU.  The
+    output hdutype parameter returns the type of the new CHDU.  A null
+    pointer may be given for
+   hdutype if the returned value is not needed. \label{ffdhdu}
+\end{description}
 
-    The  optional row filter is a  boolean expression enclosed in square
-    brackets for filtering or selecting rows from  the input FITS table.
-    A new FITS file is then created  which contains only those
-    rows for  which  the boolean   expression evaluates  to true.   (The
-    primary array and any  other extensions in the  input file  are also
-    copied to the new file).  The original FITS file is closed and
-    the new  file  is opened  and  passed to  the  application
-    program.  The new file will persist only until the file is closed
-    or until the program exits, unless the output file specifier (see
-    above) is also supplied.
+\begin{verbatim}
+  int fits_delete_hdu / ffdhdu
+      (fitsfile *fptr, > int *hdutype, int *status)
+\end{verbatim}
 
-    The expression can  be an arbitrarily  complex  series of operations
-    performed on constants, keyword values,  and column data taken  from
-    the specified FITS TABLE extension.
+\section{Header Keyword Read/Write Routines}
 
-    Keyword and   column data  are referenced by   name.  Any  string of
-    characters not surrounded by    quotes (ie, a constant  string)   or
-    followed by   an open parentheses (ie,   a  function name)   will be
-    initially interpretted   as a column  name and  its contents for the
-    current row inserted into the expression.  If no such column exists,
-    a keyword of that  name will be searched for  and its value used, if
-    found.  To force the  name to be  interpretted as a keyword (in case
-    there is both a column and keyword with the  same name), precede the
-    keyword name with a single pound sign, '\#', as in '\#NAXIS2'.  Due to
-    the generalities of FITS column and  keyword names, if the column or
-    keyword name  contains a space or a  character which might appear as
-    an arithmetic  term then inclose  the  name in '\$'  characters as in
-    \$MAX PHA\$ or \#\$MAX-PHA\$.  Names are case insensitive.
+These routines read or write keywords in the Current Header Unit
+(CHU).  Wild card characters (*, ?, or \#) may be used when specifying
+the name of the keyword to be read: a '?' will match any single
+character at that position in the keyword name and a '*' will match any
+length (including zero) string of characters.  The '\#' character will
+match any consecutive string of decimal digits (0 - 9).  When a wild
+card is used the routine will only search for a match from the current
+header position to the end of the header and will not resume the search
+from the top of the header back to the original header position as is
+done when no wildcards are included in the keyword name.  The
+fits\_read\_record routine may be used to set the starting position
+when doing wild card searchs.  A status value of KEY\_NO\_EXIST is
+returned if the specified keyword to be read is not found in the
+header.
 
-    To access a table entry in a row other  than the current one, follow
-    the  column's name  with  a row  offset  within  curly  braces.  For
-    example, 'PHA{-3}' will evaluate to the value  of column PHA, 3 rows
-    above  the  row currently  being processed.   One  cannot specify an
-    absolute row number, only a relative offset.  Rows that fall outside
-    the table will be treated as undefined, or NULLs.
 
-    Boolean   operators can be  used in  the expression  in either their
-    Fortran or C forms.  The following boolean operators are available:
- 
-\begin{verbatim}
-    "equal"         .eq. .EQ. ==  "not equal"          .ne.  .NE.  !=
-    "less than"     .lt. .LT. <   "less than/equal"    .le.  .LE.  <= =<
-    "greater than"  .gt. .GT. >   "greater than/equal" .ge.  .GE.  >= =>
-    "or"            .or. .OR. ||  "and"                .and. .AND. &&
-    "negation"     .not. .NOT. !  "approx. equal(1e-7)"  ~
-\end{verbatim}
+\subsection{Keyword Reading Routines}
 
-Note  that the exclamation
-point,  '!', is a special UNIX character, so if it is used  on the
-command line rather than entered at a task prompt, it must be  preceded
-by a backslash to force the UNIX shell to ignore it.
 
-    The expression may  also include arithmetic operators and functions.
-    Trigonometric  functions use  radians,  not degrees.  The  following
-    arithmetic  operators and  functions  can be  used in the expression
-    (function names are case insensitive):
+\begin{description}
+\item[1 ] Return the number of existing keywords (not counting the
+    END keyword) and the amount of space currently available for more
+    keywords.  It returns morekeys = -1 if the header has not yet been
+    closed.  Note that CFITSIO will dynamically add space if required
+    when writing new keywords to a header so in practice there is no
+    limit to the number of keywords that can be added to a header.  A
+    null pointer may be entered for the morekeys parameter if it's
+   value is not needed. \label{ffghsp}
+\end{description}
 
- 
 \begin{verbatim}
-    "addition"           +          "subtraction"          -
-    "multiplication"     *          "division"             /
-    "negation"           -          "exponentiation"       **   ^
-    "absolute value"     abs(x)     "cosine"               cos(x)
-    "sine"               sin(x)     "tangent"              tan(x)
-    "arc cosine"         arccos(x)  "arc sine"             arcsin(x)
-    "arc tangent"        arctan(x)  "arc tangent"          arctan2(x,y)
-    "exponential"        exp(x)     "square root"          sqrt(x)
-    "natural log"        log(x)     "common log"           log10(x)
-    "modulus"            i % j      "random # [0.0,1.0)"   random()
-    "minimum"            min(x,y)   "maximum"              max(x,y)
-    "if-then-else"       b?x:y
+  int fits_get_hdrspace / ffghsp
+      (fitsfile *fptr, > int *keysexist, int *morekeys, int *status)
 \end{verbatim}
 
-    An alternate syntax for the min and max functions  has only a single
-    argument which  should be  a  vector value (see  below).  The result
-    will be the minimum/maximum element contained within the vector.
+\begin{description}
+\item[2 ] Return the specified keyword.  In the first routine,
+    the datatype parameter specifies the desired returned data type of the
+    keyword value and can have one of the following symbolic constant
+    values:  TSTRING, TLOGICAL (== int), TBYTE, TSHORT, TUSHORT, TINT,
+    TUINT, TLONG, TULONG, TFLOAT, TDOUBLE, TCOMPLEX, and TDBLCOMPLEX.
+    Within the context of this routine, TSTRING corresponds to a
+    'char*' data type, i.e., a pointer to a character array.  Data type
+    conversion will be performed for numeric values if the keyword
+    value does not have the same data type.  If the value of the keyword
+    is undefined (i.e., the value field is blank) then an error status
+    = VALUE\_UNDEFINED will be returned.
 
-    There are three functions that are primarily for use with SAO region
-    files and the  FSAOI  task, but they  can  be  used  directly.  They
-    return  a  boolean true   or  false  depending   on  whether a   two
-    dimensional point is in the region or not:
- 
-\begin{verbatim}
-    "point in a circular region"
-          circle(xcntr,ycntr,radius,Xcolumn,Ycolumn)
+    The second routine returns the keyword value as a character string
+    (a literal copy of what is in the value field) regardless of the
+    intrinsic data type of the keyword.  The third routine returns
+    the entire 80-character header record of the keyword.
 
-    "point in an elliptical region"
-         ellipse(xcntr,ycntr,xhlf_wdth,yhlf_wdth,rotation,Xcolumn,Ycolumn)
+    If a NULL comment pointer is supplied then the comment string
+   will not be returned. \label{ffgky} \label{ffgkey} \label{ffgcrd}
+\end{description}
 
-    "point in a rectangular region"
-             box(xcntr,ycntr,xfll_wdth,yfll_wdth,rotation,Xcolumn,Ycolumn)
+\begin{verbatim}
+  int fits_read_key / ffgky
+      (fitsfile *fptr, int datatype, char *keyname, > DTYPE *value,
+       char *comment, int *status)
 
-    where
-       (xcntr,ycntr) are the (x,y) position of the center of the region
-       (xhlf_wdth,yhlf_wdth) are the (x,y) half widths of the region
-       (xfll_wdth,yfll_wdth) are the (x,y) full widths of the region
-       (radius) is half the diameter of the circle
-       (rotation) is the angle(degrees) that the region is rotated with
-             respect to (xcntr,ycntr)
-       (Xcoord,Ycoord) are the (x,y) coordinates to test, usually column
-             names
-       NOTE: each parameter can itself be an expression, not merely a
-             column name or constant.
-\end{verbatim}
+  int fits_read_keyword / ffgkey
+      (fitsfile *fptr, char *keyname, > char *value, char *comment,
+       int *status)
 
-    There is also a function for testing if  two  values  are  close  to
-    each  other,  i.e.,  if  they are "near" each other to within a user
-    specified tolerance. The  arguments,  value\_1  and  value\_2  can  be
-    integer  or  real  and  represent  the two values who's proximity is
-    being tested to be within the specified tolerance, also  an  integer
-    or real:
- 
-\begin{verbatim}
-                    near(value_1, value_2, tolerance)
+  int fits_read_card / ffgcrd
+      (fitsfile *fptr, char *keyname, > char *card, int *status)
 \end{verbatim}
-    When  a  NULL, or undefined, value is encountered in the FITS table,
-    the expression will evaluate to NULL unless the undefined  value  is
-    not   actually   required  for  evaluation,  eg.  "TRUE  .or.  NULL"
-    evaluates to TRUE. The  following  two  functions  allow  some  NULL
-    detection  and  handling:  ISNULL(x)  and  DEFNULL(x,y).  The former
-    returns a boolean value of TRUE if the  argument  x  is  NULL.   The
-    later  "defines"  a  value  to  be  substituted  for NULL values; it
-    returns the value of x if x is not NULL, otherwise  it  returns  the
-    value of y.
 
-    The  following  type  casting  operators  are  available,  where the
-    inclosing parentheses are required and taken  from  the  C  language
-    usage. Also, the integer to real casts values to double precision:
- 
+\begin{description}
+\item[3 ] Return the nth header record in the CHU.  The first keyword
+   in the header is at keynum = 1;  if keynum = 0 then these routines
+   simply reset the internal CFITSIO pointer to the beginning of the header
+   so that subsequent keyword operations will start at the top of the
+   header (e.g., prior to searching for keywords using wild cards in
+   the keyword name).   The first routine returns the entire
+   80-character header record, while the second routine parses the
+   record and returns the name, value, and comment fields as separate
+   character strings.  If a NULL comment pointer is given on input,
+   then the comment string will not be
+  returned. \label{ffgrec} \label{ffgkyn}
+\end{description}
+
 \begin{verbatim}
-                "real to integer"    (int) x     (INT) x
-                "integer to real"    (float) i   (FLOAT) i
+  int fits_read_record / ffgrec
+      (fitsfile *fptr, int keynum, > char *card, int *status)
+
+  int fits_read_keyn / ffgkyn
+      (fitsfile *fptr, int keynum, > char *keyname, char *value,
+       char *comment, int *status)
 \end{verbatim}
 
-    Bit  masks can be used to select out rows from bit columns (TFORMn =
-    \#X) in FITS files. To represent the mask,  binary,  octal,  and  hex
-    formats are allowed:
+\begin{description}
+\item[4 ] Return the next keyword whose name matches one of the strings in
+    'inclist' but does not match any of the strings in 'exclist'.
+    The strings in inclist and exclist may contain wild card characters
+    (*, ?, and \#) as described at the beginning of this section.
+    This routine searches from the current header position to the
+    end of the header, only, and does not continue the search from
+    the top of the header back to the original position.  The current
+    header position may be reset with the ffgrec routine.  Note
+    that nexc may be set = 0 if there are no keywords to be excluded.
+    This routine returns status = KEY\_NO\_EXIST if a matching
+   keyword is not found. \label{ffgnxk}
+\end{description}
 
- 
 \begin{verbatim}
-                 binary:   b0110xx1010000101xxxx0001
-                 octal:    o720x1 -> (b111010000xxx001)
-                 hex:      h0FxD  -> (b00001111xxxx1101)
+  int fits_find_nextkey / ffgnxk
+      (fitsfile *fptr, char **inclist, int ninc, char **exclist,
+       int nexc, > char *card, int  *status)
 \end{verbatim}
 
-    In  all  the  representations, an x or X is allowed in the mask as a
-    wild card. Note that the x represents a  different  number  of  wild
-    card  bits  in  each  representation.  All  representations are case
-    insensitive.
-
-    To construct the boolean expression using the mask  as  the  boolean
-    equal  operator  discribed above on a bit table column. For example,
-    if you had a 7 bit column named flags in a  FITS  table  and  wanted
-    all  rows  having  the bit pattern 0010011, the selection expression
-    would be:
+\begin{description}
+\item[5 ] Return the physical units string from an existing keyword.  This
+    routine uses a local convention, shown in the following example,
+    in which the keyword units are enclosed in square brackets in the
+    beginning of the keyword comment field.  A null string is returned
+   if no units are defined for the keyword.  \label{ffgunt}
+\end{description}
 
- 
 \begin{verbatim}
-                            flags == b0010011
-    or
-                            flags .eq. b10011
+     VELOCITY=                 12.3 / [km/s] orbital speed
+
+  int fits_read_key_unit / ffgunt
+      (fitsfile *fptr, char *keyname, > char *unit, int *status)
 \end{verbatim}
 
-    It is also possible to test if a range of bits is  less  than,  less
-    than  equal,  greater  than  and  greater than equal to a particular
-    boolean value:
+\begin{description}
+\item[6 ] Concatenate the header keywords in the CHDU into a single long
+    string of characters.  This provides a convenient way of passing
+    all or part of the header information in a FITS HDU to other subroutines.
+    Each 80-character fixed-length keyword record is appended to the
+    output character string, in order, with no intervening separator or
+    terminating characters. The last header record is terminated with
+    a NULL character.  This routine allocates memory for the returned
+    character array, so the calling program must free the memory when
+    finished.
+
+    Selected keywords may be excluded from the returned character string.
+    If the second parameter (nocomments) is TRUE (nonzero) then any
+    COMMENT, HISTORY, or blank keywords in the header will not be copied
+    to the output string.
+
+    The 'exclist' parameter may be used to supply a list of keywords
+    that are to be excluded from the output character string. Wild card
+    characters (*, ?, and \#) may be used in the excluded keyword names.
+    If no additional keywords are to be excluded, then set nexc = 0 and
+   specify NULL for the the **header  parameter.  \label{ffhdr2str}
+\end{description}
 
- 
 \begin{verbatim}
-                            flags <= bxxx010xx
-                            flags .gt. bxxx100xx
-                            flags .le. b1xxxxxxx
+  int fits_hdr2str
+      (fitsfile *fptr, int nocomments, char **exclist, int nexc,
+      > char **header, int *nkeys, int *status)
 \end{verbatim}
 
-    Notice the use of the x bit value to limit the range of  bits  being
-    compared.
 
-    It  is  not necessary to specify the leading (most significant) zero
-    (0) bits in the mask, as shown in the second expression above.
+\subsection{Keyword Writing Routines}
 
-    Bit wise AND, OR and NOT operations are  also  possible  on  two  or
-    more  bit  fields  using  the  '\&'(AND),  '$|$'(OR),  and the '!'(NOT)
-    operators. All of these operators result in a bit  field  which  can
-    then be used with the equal operator. For example:
 
- 
+\begin{description}
+\item[1 ] Write a keyword of the appropriate data type into the
+    CHU.  The first routine simply appends a new keyword whereas the
+    second routine will update the value and comment fields of the
+    keyword if it already exists, otherwise it appends a new
+    keyword.  Note that the address to the value, and not the value
+    itself, must be entered.    The datatype parameter specifies the
+    data type of the keyword value with one of the following values:
+    TSTRING, TLOGICAL (== int), TBYTE, TSHORT, TUSHORT, TINT, TUINT,
+    TLONG, TULONG, TFLOAT, TDOUBLE.  Within the context of this
+    routine, TSTRING corresponds to a 'char*' data type, i.e., a pointer
+    to a character array.  A null pointer may be entered for the
+    comment parameter in which case the  keyword comment
+   field will be unmodified or left blank.  \label{ffpky} \label{ffuky}
+\end{description}
+
 \begin{verbatim}
-                          (!flags) == b1101100
-                          (flags & b1000001) == bx000001
-\end{verbatim}
+  int fits_write_key / ffpky
+      (fitsfile *fptr, int datatype, char *keyname, DTYPE *value,
+          char *comment, > int *status)
 
-    Bit  fields can be appended as well using the '+' operator.  Strings
-    can be concatenated this way, too.
+  int fits_update_key / ffuky
+      (fitsfile *fptr, int datatype, char *keyname, DTYPE *value,
+          char *comment, > int *status)
+\end{verbatim}
 
-    In addition, several constants are built in  for  use  in  numerical
-    expressions:
+\begin{description}
+\item[2 ] Write a keyword with a null or undefined value (i.e., the
+    value field in the keyword is left blank).  The first routine
+    simply appends a new keyword whereas the second routine will update
+    the value and comment fields of the keyword if it already exists,
+    otherwise it appends a new keyword.  A null pointer may be
+    entered for the comment parameter in which case the  keyword
+    comment
+   field will be unmodified or left blank. \label{ffpkyu} \label{ffukyu}
+\end{description}
 
- 
 \begin{verbatim}
-        #pi              3.1415...      #e             2.7182...
-        #deg             #pi/180        #row           current row number
-        #null         undefined value   #snull         undefined string
+  int fits_write_key_null / ffpkyu
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+
+  int fits_update_key_null / ffukyu
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
 \end{verbatim}
 
-    A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
-    "null" constants  are useful for conditionally  setting table values
-    to a NULL, or undefined, value (eg., "col1==-99 ? \#NULL : col1").
+\begin{description}
+\item[3 ] Write (append) a COMMENT or HISTORY keyword to the CHU.  The comment or
+    history string will be continued over multiple keywords if it is longer
+   than 70 characters. \label{ffpcom} \label{ffphis}
+\end{description}
+
+\begin{verbatim}
+  int fits_write_comment / ffpcom
+      (fitsfile *fptr, char *comment, > int *status)
 
-  Vector Columns
+  int fits_write_history / ffphis
+      (fitsfile *fptr, char *history, > int *status)
+\end{verbatim}
 
-    Vector columns can also be used  in  building  the  expression.   No
-    special  syntax  is required if one wants to operate on all elements
-    of the vector.  Simply use the column name as for a  scalar  column.
-    Vector  columns  can  be  freely  intermixed  with scalar columns or
-    constants in virtually all expressions.  The result will be  of  the
-    same dimension as the vector.  Two vectors in an expression, though,
-    need to  have  the  same  number  of  elements  and  have  the  same
-    dimensions.   The  only  places  a vector column cannot be used (for
-    now, anyway) are the SAO  region  functions  and  the  NEAR  boolean
-    function.
+\begin{description}
+\item[4 ] Write the DATE keyword to the CHU. The keyword value will contain
+    the current system date as a character string in 'yyyy-mm-ddThh:mm:ss'
+    format. If a DATE keyword already exists in the header, then this
+    routine will simply update the keyword value with the current date.
+   \label{ffpdat}
+\end{description}
 
-    Arithmetic and logical operations are all performed on an element by
-    element basis.  Comparing two vector columns,  eg  "COL1  ==  COL2",
-    thus  results  in  another vector of boolean values indicating which
-    elements of the two vectors are equal.  Two functions are  available
-    which   operate   on  vectors:  SUM(x)  and  NELEM(x).   The  former
-    literally sums all the elements in x, returning a scalar value.   If
-    x  is  a  boolean  vector,  SUM returns the number of TRUE elements.
-    The latter, NELEM, returns the  number  of  elements  in  vector  x.
-    (NELEM  also  operates  on  bit  and string columns, returning their
-    column widths.)  As an example, to test whether all elements of  two
-    vectors  satisfy  a  given  logical  comparison,  one  can  use  the
-    expression
-
- 
 \begin{verbatim}
-              SUM( COL1 > COL2 ) == NELEM( COL1 )
+  int fits_write_date / ffpdat
+      (fitsfile *fptr, > int *status)
 \end{verbatim}
 
-    which will return TRUE if all elements  of  COL1  are  greater  than
-    their corresponding elements in COL2.
-
-    To  specify  a  single  element  of  a  vector, give the column name
-    followed by  a  comma-separated  list  of  coordinates  enclosed  in
-    square  brackets.  For example, if a vector column named PHAS exists
-    in the table as a one dimensional, 256  component  list  of  numbers
-    from  which  you  wanted to select the 57th component for use in the
-    expression, then PHAS[57] would do the  trick.   Higher  dimensional
-    arrays  of  data  may appear in a column.  But in order to interpret
-    them, the TDIMn keyword must appear in the header.  Assuming that  a
-    (4,4,4,4)  array  is packed into each row of a column named ARRAY4D,
-    the  (1,2,3,4)  component  element  of  each  row  is  accessed   by
-    ARRAY4D[1,2,3,4].    Arrays   up   to   dimension  5  are  currently
-    supported.  Each vector index can itself be an expression,  although
-    it  must  evaluate  to  an  integer  value  within the bounds of the
-    vector.  Vector columns which contain spaces or arithmetic operators
-    must   have   their   names  enclosed  in  "\$"  characters  as  with
-    \$ARRAY-4D\$[1,2,3,4].
+\begin{description}
+\item[5 ]Write a user specified keyword record into the CHU.  This is
+   a low--level routine which can be used to write any arbitrary
+   record into the header.  The record must conform to the all
+  the FITS format requirements. \label{ffprec}
+\end{description}
 
-    A  more  C-like  syntax  for  specifying  vector  indices  is   also
-    available.   The element used in the preceding example alternatively
-    could be specified with the syntax  ARRAY4D[4][3][2][1].   Note  the
-    reverse  order  of  indices  (as in C), as well as the fact that the
-    values are still ones-based (as  in  Fortran  --  adopted  to  avoid
-    ambiguity  for  1D vectors).  With this syntax, one does not need to
-    specify all of the indices.  To  extract  a  3D  slice  of  this  4D
-    array, use ARRAY4D[4].
+\begin{verbatim}
+  int fits_write_record / ffprec
+      (fitsfile *fptr, char *card, > int *status)
+\end{verbatim}
 
-    Variable-length vector columns are not supported.
+\begin{description}
+\item[6 ]Update an 80-character record in the CHU.  If a keyword with the input
+   name already exists, then it is overwritten by the value of card.  This
+   could modify the keyword name as well as the value and comment fields.
+   If the keyword doesn't already exist then a new keyword card is appended
+  to the header. \label{ffucrd}
+\end{description}
+
+\begin{verbatim}
+  int fits_update_card / ffucrd
+      (fitsfile *fptr, char *keyname, char *card, > int *status)
+\end{verbatim}
 
-    Vectors can  be manually constructed  within the expression  using a
-    comma-separated list of  elements surrounded by curly braces ('{}').
-    For example, '{1,3,6,1}' is a 4-element vector containing the values
-    1, 3, 6, and 1.  The  vector can contain  only boolean, integer, and
-    real values (or expressions).  The elements will  be promoted to the
-    highest  datatype   present.  Any   elements   which  are themselves
-    vectors, will be expanded out with  each of its elements becoming an
-    element in the constructed vector.
 
-    A common filtering method  applied to  FITS  files is a time  filter
-    using a Good Time Interval (GTI)  extension.  A high-level function,
-    gtifilter(a,b,c,d),  is  available   which  performs this    special
-    evaluation, returning a boolean result for each time element tested.
-    Its syntax is
+\begin{description}
+\item[7 ] Modify (overwrite) the comment field of an existing keyword. \label{ffmcom}
+\end{description}
 
- 
 \begin{verbatim}
-       gtifilter( [ "filename" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
+  int fits_modify_comment / ffmcom
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
 \end{verbatim}
 
-    where  each  "[]" demarks   optional parameters.   The  filename, if
-    specified,  can be  blank  ("") which will    mean to use  the first
-    extension  with   the name "*GTI*"  in   the current  file,  a plain
-    extension  specifier (eg, "+2",  "[2]", or "[STDGTI]") which will be
-    used  to  select  an extension  in  the current  file, or  a regular
-    filename with or without an extension  specifier which in the latter
-    case  will mean to  use the first  extension  with an extension name
-    "*GTI*".  Expr can be   any arithmetic expression, including  simply
-    the time  column  name.  A  vector  time expression  will  produce a
-    vector boolean  result.  STARTCOL and  STOPCOL are the  names of the
-    START/STOP   columns in the    GTI extension.  If   one  of them  is
-    specified, they both  must be. Note that  the quotes surrounding the
-    filename and START/STOP column names are required.
 
-    In  its  simplest form, no parameters need to be provided -- default
-    values will be used.  The expression "gtifilter()" is equivalent to
+\begin{description}
+\item[8 ] Write the physical units string into an existing keyword.  This
+    routine uses a local convention, shown in the following example,
+    in which the keyword units are enclosed in square brackets in the
+   beginning of the keyword comment field.  \label{ffpunt}
+\end{description}
 
- 
 \begin{verbatim}
-       gtifilter( "", TIME, "*START*", "*STOP*" )
-\end{verbatim}
+     VELOCITY=                 12.3 / [km/s] orbital speed
 
-    This will search the current file for a GTI  extension,  filter  the
-    TIME  column in the current table, using START/STOP times taken from
-    columns in the GTI  extension  with  names  containing  the  strings
-    "START"  and "STOP".  The wildcards ('*') allow slight variations in
-    naming conventions  such  as  "TSTART"  or  "STARTTIME".   The  same
-    default  values  apply for unspecified parameters when the first one
-    or  two  parameters  are  specified.   The  function   automatically
-    searches   for   TIMEZERO/I/F   keywords  in  the  current  and  GTI
-    extensions, applying a relative time offset, if necessary.
+  int fits_write_key_unit / ffpunt
+      (fitsfile *fptr, char *keyname, char *unit, > int *status)
+\end{verbatim}
 
-    Another common  filtering method is  a  spatial filter using  a SAO-
-    style region file.  The syntax for this high-level filter is
+\begin{description}
+\item[9 ] Rename an existing keyword, preserving the current value
+   and comment fields. \label{ffmnam}
+\end{description}
 
- 
 \begin{verbatim}
-       regfilter( "regfilename" [ , Xexpr, Yexpr [ , "wcs cols" ] ] )
+  int fits_modify_name / ffmnam
+      (fitsfile *fptr, char *oldname, char *newname, > int *status)
 \end{verbatim}
 
-    The region file name is required, but the rest is optional.  Without
-    any explicit expression for the X and Y coordinates (in pixels), the
-    filter will search for  and operate on columns "X"  and "Y".  If the
-    region file is   in "degrees" format  instead  of "pixels" ("hhmmss"
-    format is not supported, yet), the  filter will need WCS information
-    to convert the region coordinates to pixels.  If supplied, the final
-    parameter string contains the names of the 2 columns (space or comma
-    separated) which contain   the   desired WCS information.    If  not
-    supplied, the filter  will scan the X  and Y expressions for  column
-    names.  If only one is found in each  expression, those columns will
-    be used.  Otherwise, an error will be returned.
+\begin{description}
+\item[10]  Delete a keyword record.  The space occupied by
+    the keyword is reclaimed by moving all the following header records up
+    one row in the header.  The first routine deletes a keyword at a
+    specified position in the header (the first keyword is at position 1),
+    whereas the second routine deletes a specifically named keyword.
+    Wild card characters may be used when specifying the name of the keyword
+   to be deleted. \label{ffdrec} \label{ffdkey}
+\end{description}
 
-    The region shapes supported are (names are case insensitive):
- 
 \begin{verbatim}
-       Point         ( X1, Y1 )               <- One pixel square region
-       Line          ( X1, Y1, X2, Y2 )       <- One pixel wide region
-       Polygon       ( X1, Y1, X2, Y2, ... )  <- Rest are interiors with
-       Rectangle     ( X1, Y1, X2, Y2, A )       | boundaries considered
-       Box           ( Xc, Yc, Wdth, Hght, A )   V within the region
-       Diamond       ( Xc, Yc, Wdth, Hght, A )
-       Circle        ( Xc, Yc, R )
-       Annulus       ( Xc, Yc, Rin, Rout )
-       Ellipse       ( Xc, Yc, Rx, Ry, A )
-       Elliptannulus ( Xc, Yc, Rinx, Riny, Routx, Routy, Ain, Aout )
-       Sector        ( Xc, Yc, Amin, Amax )
+  int fits_delete_record / ffdrec
+      (fitsfile *fptr, int   keynum,  > int *status)
+
+  int fits_delete_key / ffdkey
+      (fitsfile *fptr, char *keyname, > int *status)
 \end{verbatim}
 
-    where (Xc,Yc) is  the coordinate of  the shape's center; (X\#,Y\#) are
-    the coordinates  of the shape's edges;  Rxxx are the shapes' various
-    Radii or semimajor/minor  axes; and Axxx  are the angles of rotation
-    (or bounding angles for Sector) in degrees.  For rotated shapes, the
-    rotation angle  can  be left  off, indicating  no rotation.   Common
-    alternate  names for the regions  can also be  used: rotbox == box;
-    rotrectangle == rectangle;  (rot)rhombus == (rot)diamond;  and pie
-    == sector.  When a  shape's name is  preceded by a minus sign, '-',
-    the defined region  is instead the area  *outside* its boundary (ie,
-    the region is inverted).  All the shapes within a single region file
-    are AND'd together to create the region.
+\section{Primary Array or IMAGE Extension I/O Routines}
 
-    For  complex  or commonly  used filters,  one   can also  place  the
-    expression into a text file and import it  into the row filter using
-    the syntax  '[@filename.txt]'.  The   expression can be  arbitrarily
-    complex and extend over multiple lines of the file.
+These routines read or write data values in the primary data array (i.e.,
+the first HDU in a FITS file) or an IMAGE extension.   There are also
+routines to get information about the data type and size of the image.
+Users should also read the following chapter on the CFITSIO iterator
+function which provides a more `object oriented' method of reading and
+writing images.  The iterator function is a little more complicated to
+use, but the advantages are that it usually takes less code to perform
+the same operation, and the resulting program oftens runs faster because
+the FITS files are read and written using the most efficient block size.
+
+C programmers should note that the ordering of arrays in FITS files, and
+hence in all the CFITSIO calls, is more similar to the dimensionality
+of arrays in Fortran rather than C.  For instance if a FITS image has
+NAXIS1 = 100 and NAXIS2 = 50, then a 2-D array just large enough to hold
+the image should be declared as array[50][100] and not as array[100][50].
+
+The `datatype'  parameter specifies the data type of the `nulval'  and
+`array' pointers and can have one of the following  values:  TBYTE,
+TSBYTE, TSHORT, TUSHORT, TINT, TUINT, TLONG, TLONGLONG, TULONG, TFLOAT,
+TDOUBLE.  Automatic data type conversion is performed if the data type
+of the FITS array (as defined by the BITPIX keyword) differs from that
+specified by 'datatype'.  The data values are also automatically scaled
+by the BSCALE and BZERO keyword values as they are being read or written
+in the FITS array.
 
 
-EXAMPLES:
- 
-\begin{verbatim}
-    [ binary && mag <= 5.0]        - Extract all binary stars brighter
-                                     than  fifth magnitude (note that
-                                     the initial space is necessary to
-                                     prevent it from being treated as a
-                                     binning specification)
+\begin{description}
+\item[1 ] Get the data type or equivalent data type of the image.  The
+    first routine returns the physical data type of the FITS image, as
+    given by the BITPIX keyword, with allowed values of BYTE\_IMG (8),
+    SHORT\_IMG (16), LONG\_IMG (32), FLOAT\_IMG (-32), and DOUBLE\_IMG
+    (-64).  The second routine is similar, except that if the image pixel
+    values are scaled, with non-default values for the BZERO and BSCALE
+    keywords, then the routine will return the 'equivalent' data type
+    that is needed to store the scaled values.  For example, if BITPIX
+    = 16 and BSCALE = 0.1 then the equivalent data type is FLOAT\_IMG.
+    Similarly if BITPIX = 16, BSCALE = 1, and BZERO = 32768, then the
+    the pixel values span the range of an unsigned short integer and
+   the returned data type will be USHORT\_IMG. \label{ffgidt}
+\end{description}
 
-    [#row >= 125 && #row <= 175]   - Extract row numbers 125 through 175
+\begin{verbatim}
+  int fits_get_img_type / ffgidt
+      (fitsfile *fptr, > int *bitpix, int *status)
 
-    [IMAGE[4,5] .gt. 100]          - Extract all rows that have the
-                                     (4,5) component of the IMAGE column
-                                     greater than 100
+  int fits_get_img_equivtype / ffgiet
+      (fitsfile *fptr, > int *bitpix, int *status)
+\end{verbatim}
 
-    [abs(sin(theta * #deg)) < 0.5] - Extract all rows having the
-                                     absolute value of the sine of theta
-                                     less  than a half where the angles
-                                     are tabulated in degrees
+\begin{description}
+\item[2 ] Get the number of dimensions, and/or the size of
+    each dimension in the image .  The number of axes in the image is
+    given by naxis, and the size of each dimension is given by the
+    naxes array (a maximum of maxdim dimensions will be returned).
+   \label{ffgidm} \label{ffgisz} \label{ffgipr}
+\end{description}
 
-    [SUM( SPEC > 3*BACKGRND )>=1]  - Extract all rows containing a
-                                     spectrum, held in vector column
-                                     SPEC, with at least one value 3
-                                     times greater than the background
-                                     level held in a keyword, BACKGRND
+\begin{verbatim}
+  int fits_get_img_dim / ffgidm
+      (fitsfile *fptr, > int *naxis, int *status)
 
-    [VCOL=={1,4,2}]                - Extract all rows whose vector column
-                                     VCOL contains the 3-elements 1, 4, and
-                                     2.
+  int fits_get_img_size / ffgisz
+      (fitsfile *fptr, int maxdim, > long *naxes, int *status)
 
-    [@rowFilter.txt]               - Extract rows using the expression
-                                     contained within the text file
-                                     rowFilter.txt
+  int fits_get_img_param / ffgipr
+      (fitsfile *fptr, int maxdim, > int *bitpix, int *naxis, long *naxes,
+       int *status)
 \end{verbatim}
 
- 
-\subsection{Binning or Histogramming Specification}
+\begin{description}
+\item[3 ]Create a new primary array or IMAGE extension with a specified
+   data type and size.  If the FITS file is currently empty then a
+   primary array is created, otherwise a new IMAGE extension is
+  appended to the file. \label{ffcrim}
+\end{description}
 
-The optional binning specifier is enclosed in square brackets and can
-be distinguished from a general row filter specification by the fact
-that it begins with the keyword 'bin'  not immediately followed by an
-equals sign.  When binning is specfied, a temporary N-dimensional FITS
-primary array is created by computing the histogram of the values in
-the specified columns of a FITS table extension.  After the histogram
-is computed the input FITS file containing the table is then closed and
-the temporary FITS primary array is opened and passed to the
-application program.  Thus, the application program never sees the
-original FITS table and only sees the image in the new temporary file
-(which has no additional extensions).  Obviously, the application
-program must be expecting to open a FITS image and not a FITS table in
-this case.
+\begin{verbatim}
+  int fits_create_img / ffcrim
+      ( fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
+\end{verbatim}
 
-The data type of the FITS histogram image may be specified by appending
-'b' (for 8-bit byte), 'i' (for 16-bit integers), 'j' (for 32-bit
-integer), 'r' (for 32-bit floating points), or 'd' (for 64-bit double
-precision floating point)  to the 'bin' keyword (e.g. '[binr X]'
-creates a real floating point image).  If the datatype is not
-explicitly specified then a 32-bit integer image will be created by
-default, unless the weighting option is also specified in which case
-the image will have a 32-bit floating point data type by default.
+\begin{description}
+\item[4 ] Write a rectangular subimage (or the whole image) to the FITS data
+    array.  The fpixel and lpixel arrays give the coordinates of the
+    first (lower left corner) and last (upper right corner) pixels in
+   FITS image to be written to.  \label{ffpss}
+\end{description}
 
-The histogram image may have from 1 to 4 dimensions (axes), depending
-on the number of columns that are specified.  The general form of the
-binning specification is:
- 
 \begin{verbatim}
- [bin{bijrd}  Xcol=min:max:binsize, Ycol= ..., Zcol=..., Tcol=...; weight]
+  int fits_write_subset / ffpss
+      (fitsfile *fptr, int datatype, long *fpixel, long *lpixel,
+       DTYPE *array, > int *status)
 \end{verbatim}
-in which up to 4 columns, each corresponding to an axis of the image,
-are listed. The column names are case insensitive, and the column
-number may be given instead of the name, preceded by a pound sign
-(e.g., [bin \#4=1:512]).  If the column name is not specified, then
-CFITSIO will first try to use the 'preferred column' as specified by
-the CPREF keyword if it exists (e.g., 'CPREF = 'DETX,DETY'), otherwise
-column names 'X', 'Y', 'Z', and 'T' will be assumed for each of the 4
-axes, respectively.
 
-Each column name may be followed by an equals sign and then the lower
-and upper range of the histogram, and the size of the histogram bins,
-separated by colons.  Spaces are allowed before and after the equals
-sign but not within the 'min:max:binsize' string.  The min, max and
-binsize values may be integer or floating point numbers, or they may be
-the names of keywords in the header of the table.  If the latter, then
-the value of that keyword is substituted into the expression.
+\begin{description}
+\item[5 ] Write pixels into the FITS data array.  'fpixel' is an array of
+   length NAXIS which gives the coordinate of the starting pixel to be
+   written to, such that fpixel[0] is in the range 1 to NAXIS1,
+   fpixel[1] is in the range 1 to NAXIS2, etc.  The first routine
+   simply writes the array of pixels to the FITS file (doing data type
+   conversion if necessary) whereas the second routine will substitute
+   the  appropriate FITS null value for any elements which are equal to
+   the input value of nulval (note that this parameter gives the
+   address of the null value, not the null value itself).  For integer
+   FITS arrays, the FITS null value is defined by the BLANK keyword (an
+   error is returned if the BLANK keyword doesn't exist).  For floating
+   point FITS arrays  the special IEEE NaN (Not-a-Number) value will be
+   written into the FITS file.  If a null pointer is entered for
+   nulval, then the null value is ignored and this routine behaves
+  the same as fits\_write\_pix.   \label{ffppx} \label{ffppxn}
+\end{description}
 
-Default values for the min, max and binsize quantities will be
-used if not explicitly given in the binning expression as shown
-in these examples:
- 
 \begin{verbatim}
-    [bin x = :512:2]  - use default minimum value
-    [bin x = 1::2]    - use default maximum value
-    [bin x = 1:512]   - use default bin size
-    [bin x = 1:]      - use default maximum value and bin size
-    [bin x = :512]    - use default minimum value and bin size
-    [bin x = 2]       - use default minimum and maximum values
-    [bin x]           - use default minimum, maximum and bin size
-    [bin 4]           - default 2-D image, bin size = 4 in both axes
-    [bin]             - default 2-D image
+  int fits_write_pix / ffppx
+      (fitsfile *fptr, int datatype, long *fpixel, long nelements,
+       DTYPE *array, int *status);
+
+  int fits_write_pixnull / ffppxn
+      (fitsfile *fptr, int datatype, long *fpixel, long nelements,
+       DTYPE *array, DTYPE *nulval, > int *status);
 \end{verbatim}
-CFITSIO  will use the value of the TLMINn, TLMAXn, and TDBINn keywords,
-if they exist, for the default min, max, and binsize, respectively.  If
-they do not exist then CFITSIO will use the actual minimum and maximum
-values in the column for the histogram min and max values.  The default
-binsize will be set to 1, or (max - min) / 10., whichever is smaller,
-so that the histogram will have at least 10 bins along each axis.
 
-A shortcut notation is allowed if all the columns/axes have the same
-binning specification.  In this case all the column names may be listed
-within parentheses, followed by the (single) binning specification, as
-in:
- 
+\begin{description}
+\item[6 ] Set FITS data array elements equal to the appropriate null pixel
+    value. For integer FITS arrays, the FITS null value is defined by
+    the BLANK keyword  (an error is returned if the BLANK keyword
+    doesn't exist). For floating point FITS arrays the special IEEE NaN
+    (Not-a-Number) value will be written into the FITS file.  Note that
+    'firstelem' is a scalar giving the  offset to the first pixel to be
+    written in the equivalent 1-dimensional array of image pixels. \label{ffpprn}
+\end{description}
+
 \begin{verbatim}
-    [bin (X,Y)=1:512:2]
-    [bin (X,Y) = 5]
+  int fits_write_null_img / ffpprn
+      (fitsfile *fptr, long firstelem, long nelements, > int *status)
 \end{verbatim}
 
-The optional weighting factor is the last item in the binning specifier
-and, if present, is separated from the list of columns by a
-semi-colon.  As the histogram is accumulated, this weight is used to
-incremented the value of the appropriated bin in the histogram.  If the
-weighting factor is not specified, then the default weight = 1 is
-assumed.  The weighting factor may be a constant integer or floating
-point number, or the name of a keyword containing the weighting value.
-Or the weighting factor may be the name of a table column in which case
-the value in that column, on a row by row basis, will be used.
-
-In some cases, the column or keyword may give the reciprocal of the
-actual weight value that is needed.  In this case, precede the weight
-keyword or column name by a slash '/' to tell CFITSIO to use the
-reciprocal of the value when constructing the histogram.
-
-For  complex or commonly  used  histograms, one  can also  place its
-description  into  a  text  file and  import   it  into  the binning
-specification  using the  syntax [bin  @filename.txt].  The
-file's contents  can extend over   multiple lines, although  it must
-still conform to the  no-spaces rule  for the min:max:binsize syntax
-and each axis specification must still be comma-separated.
-
- Examples:
+\begin{description}
+\item[7 ] Read a rectangular subimage (or the whole image) from the FITS
+    data array.  The fpixel and lpixel arrays give the coordinates of
+    the first (lower left corner) and last (upper right corner) pixels
+    to be read from the FITS image. Undefined FITS array elements will
+    be returned with a value = *nullval, (note that this parameter
+    gives the address of the null value, not the null value itself)
+    unless nulval = 0 or *nulval = 0, in which case no checks for
+   undefined pixels will be performed.  \label{ffgsv}
+\end{description}
 
- 
 \begin{verbatim}
-    [bini detx, dety]                - 2-D, 16-bit integer histogram
-                                       of DETX and DETY columns, using
-                                       default values for the histogram
-                                       range and binsize
-
-    [bin (detx, dety)=16; /exposure] - 2-D, 32-bit real histogram of DETX
-                                       and DETY columns with a bin size = 16
-                                       in both axes. The histogram values
-                                       are divided by the EXPOSURE keyword
-                                       value.
+  int fits_read_subset / ffgsv
+      (fitsfile *fptr, int  datatype, long *fpixel, long *lpixel, long *inc,
+       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
+\end{verbatim}
 
-    [bin time=TSTART:TSTOP:0.1]      - 1-D lightcurve, range determined by
-                                       the TSTART and TSTOP keywords,
-                                       with 0.1 unit size bins.
+\begin{description}
+\item[8 ] Read pixels from the FITS data array.  'fpixel' is the starting
+    pixel location and is an array of length NAXIS such that fpixel[0]
+    is in the range 1 to NAXIS1, fpixel[1] is in the range 1 to NAXIS2,
+    etc. The nelements parameter specifies the number of pixels to
+    read.  If fpixel is set to the first pixel, and nelements is set
+    equal to the NAXIS1 value, then this routine would read the first
+    row of the image.  Alternatively, if nelements is set equal to
+    NAXIS1 * NAXIS2 then it would read an entire 2D image, or the first
+    plane of a 3-D datacube.
 
-    [bin pha, time=8000.:8100.:0.1]  - 2-D image using default binning
-                                       of the PHA column for the X axis,
-                                       and 1000 bins in the range
-                                       8000. to 8100. for the Y axis.
+    The first routine will return any undefined pixels in the FITS array
+    equal to the value of *nullval (note that this parameter gives the
+    address of the null value, not the null value itself) unless nulval
+    = 0 or *nulval = 0, in which case no checks for undefined pixels
+    will be performed.  The second routine is similar except that any
+    undefined pixels will have the corresponding nullarray element set
+   equal to TRUE (= 1).  \label{ffgpxv}  \label{ffgpxf}
+\end{description}
 
-    [bin @binFilter.txt]             - Use the contents of the text file
-                                       binFilter.txt for the binning
-                                       specifications.
+\begin{verbatim}
+  int fits_read_pix / ffgpxv
+      (fitsfile *fptr, int  datatype, long *fpixel, long nelements,
+       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
 
+  int fits_read_pixnull / ffgpxf
+      (fitsfile *fptr, int  datatype, long *fpixel, long nelements,
+       > DTYPE *array, char *nullarray, int *anynul, int *status)
 \end{verbatim}
 
-
-\chapter{CFITSIO Conventions and Guidelines }
+\section{Image Compression}
+
+CFITSIO now transparently supports 2 types of image compression:
+
+1)  The entire FITS file may be externally compressed with the gzip or
+Unix compress algorithm, producing a *.gz or *.Z file, respectively.
+When reading compressed files of this type, CFITSIO first uncompresses
+the entire file into memory before performing the requested read
+operations.  Output files can be directly written in the gzip
+compressed format if the user-specified filename ends with `.gz'.  In
+this case, CFITSIO initially writes the uncompressed file in memory and
+then compresses it and writes it to disk when the FITS file is closed,
+thus saving user disk space. Read and write access to these compressed
+FITS files is generally quite fast; the main limitation is that there
+must be enough available memory (or swap space) to hold the entire
+uncompressed FITS file.
+
+2) CFITSIO also supports a newer image compression format in which the
+image is divided into a grid of rectangular tiles, and each tile of
+pixels is individually compressed.  The compressed tiles are stored in
+rows of a variable length array column in a FITS binary table, but
+CFITSIO recognizes that the binary table extension contains an image
+and treats it as if it were an IMAGE extension.  This tile-compressed
+format is especially well suited for compressing very large images
+because a) the FITS header keywords remain uncompressed for rapid read
+access, and because b) it is possible to extract and uncompress
+sections of the image without having to uncompress the entire image.
+This format is also much more effective in compressing floating point
+images (using a lossy compression algorithm) than simply compressing
+the image using gzip or compress.
+
+A detailed description of this format is available at:
+
+\begin{verbatim}
+http://heasarc.gsfc.nasa.gov/docs/software/fitsio/
+       compression/compress_image.html
+\end{verbatim}
+
+The N-dimensional FITS image can be divided into any
+desired rectangular grid of compression tiles.  By default the tiles
+are chosen to correspond to the rows of the image, each containing
+NAXIS1 pixels.  For example, a 800 x 800 x 4 pixel data cube would be
+divided in to 3200 tiles containing 800 pixels each by default.
+Alternatively, this data cube could be divided into 256 tiles that are each
+100 X 100 X 1 pixels in size, or 4 tiles containing 800 x 800 X 1
+pixels, or a single tile containing the entire data cube.  Note that
+the image dimensions are not required to be an integer multiple of the
+tile dimensions, so, for example, this data cube could also be divided
+into 250 X 200 pixel tiles, in which case the last tile in each row
+would only contain 50 X 200 pixels.
+
+Currently, 3 image compression algorithms are supported:  Rice, GZIP,
+and PLIO.  Rice and GZIP are general purpose algorithms that can be
+used to compress almost any image.  The PLIO  algorithm, on the other
+hand, is more specialized and was developed for use in IRAF to store
+pixel data quality masks. It is designed to only work on images
+containing positive integers with values up to about 2**24.  Other
+image compression algorithms may be supported in the future.
+
+The 3 supported image compression algorithms are all 'loss-less' when
+applied to integer FITS images;  the pixel values are preserved exactly
+with no loss of information during the compression and uncompression
+process. Floating point FITS images (which have BITPIX = -32 or -64)
+are first quantized into scaled integer pixel values before being
+compressed.  This technique produces much higher compression factors
+than simply using GZIP to compress the image, but it also means that
+the original floating value pixel values may not be precisely returned
+when the image is uncompressed.  When done properly, this only discards
+the 'noise' from the floating point values without losing any
+significant information.  The amount of noise that is discarded can be
+controlled by the 'noise\_bits' compression parameter.
+
+No special action is required to read tile-compressed images because
+all the CFITSIO routines that read normal uncompressed FITS images can
+also read images in the tile-compressed format;  CFITSIO essentially
+treats the binary table that contains the compressed tiles as if
+it were an IMAGE extension.
+
+When creating (writing) a new image with CFITSIO, a normal uncompressed
+FITS primary array or IMAGE extension will be written unless the
+tile-compressed format has been specified in 1 of 2 possible ways:
 
- 
-\section{CFITSIO Definitions}
+1)  At run time, when specifying the name of the output FITS file to be
+created at run time, the user can indicate that images should be
+written in tile-compressed format by enclosing the compression
+parameters in square brackets following the root disk file name.   The
+`imcopy' example program that included with the CFITSIO distribution
+can be used for this purpose to compress or uncompress images.  Here
+are some examples of the extended file name syntax for specifying
+tile-compressed output images:
 
-Any program that uses the CFITSIO interface must include the fitsio.h
-header file with the statement
- 
 \begin{verbatim}
-  #include "fitsio.h"
-\end{verbatim}
-This header file contains the prototypes for all the CFITSIO user
-interface routines as well as the definitions of various constants used
-in the interface.  It also defines a C structure of type `fitsfile'
-that is used by CFITSIO to store the relevant parameters that define
-the format of a particular FITS file.  Application programs must define
-a pointer to this structure for each FITS file that is to be opened.
-This structure is initialized (i.e., memory is allocated for the
-structure) when the FITS file is first opened or created with the
-fits\_open\_file or fits\_create\_file routines.  This fitsfile pointer
-is then passed as the first argument to every other CFITSIO routine
-that operates on the FITS file.  Application programs must not directly
-read or write elements in this fitsfile structure because the
-definition of the structure may change in future versions of CFITSIO.
+    myfile.fit[compress]    - use the default compression algorithm (Rice)
+                              and the default tile size (row by row)
+
+    myfile.fit[compress GZIP] - use the specified compression algorithm;
+    myfile.fit[compress Rice]     only the first letter of the algorithm
+    myfile.fit[compress PLIO]     name is required.
+
+    myfile.fit[compress R 100,100]   - use Rice compression and
+                                       100 x 100 pixel tile size
+
+    myfile.fit[compress R 100,100;2] - as above, and also use noisebits = 2
+\end{verbatim}
+
+2)  Before calling the CFITSIO routine to write the image header
+keywords (e.g., fits\_create\_image) the programmer can call the
+routines described below to specify the compression algorithm and the
+tiling pattern that is to be used.  There are 3 routines for specifying
+the various compression parameters and 3 corresponding routines to
+return the current values of the parameters:
+\label{ffsetcomp}  \label{ffgetcomp}
 
-A number of symbolic constants are also defined in fitsio.h for the
-convenience of application programmers.  Use of these symbolic
-constants rather than the actual numeric value will help to make the
-source code more readable and easier for others to understand.
- 
 \begin{verbatim}
-String Lengths, for use when allocating character arrays:
+  int fits_set_compression_type(fitsfile *fptr, int comptype, int *status)
+  int fits_set_tile_dim(fitsfile *fptr, int ndim, long *tilesize, int *status)
+  int fits_set_noise_bits(fitsfile *fptr, int noisebits, int *status)
 
-  #define FLEN_FILENAME 1025 /* max length of a filename                  */
-  #define FLEN_KEYWORD   72  /* max length of a keyword                   */
-  #define FLEN_CARD      81  /* max length of a FITS header card          */
-  #define FLEN_VALUE     71  /* max length of a keyword value string      */
-  #define FLEN_COMMENT   73  /* max length of a keyword comment string    */
-  #define FLEN_ERRMSG    81  /* max length of a CFITSIO error message     */
-  #define FLEN_STATUS    31  /* max length of a CFITSIO status text string */
+  int fits_get_compression_type(fitsfile *fptr, int *comptype, int *status)
+  int fits_get_tile_dim(fitsfile *fptr, int ndim, long *tilesize, int *status)
+  int fits_get_noise_bits(fitsfile *fptr, int *noisebits, int *status)
+\end{verbatim}
+3 symbolic constants are defined for use as the value of the
+`comptype' parameter:  GZIP\_1, RICE\_1, or PLIO\_1.  Entering NULL for
+comptype will turn off the tile-compression and cause normal FITS
+images to be written.
 
-  Note that FLEN_KEYWORD is longer than the nominal 8-character keyword
-  name length because the HIERARCH convention supports longer keyword names.
+The 'noisebits' parameter is only used when compressing floating point
+images.   The default value is 4.  Decreasing the value of noisebits
+will improve the overall compression efficiency at the expense of
+losing more information.
 
-Access modes when opening a FITS file:
+A small example program called 'imcopy' is included with CFITSIO that
+can be used to compress (or uncompress) any FITS image.  This
+program can be used to experiment with the various compression options
+on existing FITS images as shown in these examples:
 
-  #define READONLY  0
-  #define READWRITE 1
+\begin{verbatim}
+1)  imcopy infile.fit 'outfile.fit[compress]'
 
-BITPIX data type code values for FITS images:
+       This will use the default compression algorithm (Rice) and the
+       default tile size (row by row)
 
-  #define BYTE_IMG      8  /*  8-bit unsigned integers */
-  #define SHORT_IMG    16  /* 16-bit   signed integers */
-  #define LONG_IMG     32  /* 32-bit   signed integers */
-  #define FLOAT_IMG   -32  /* 32-bit single precision floating point */
-  #define DOUBLE_IMG  -64  /* 64-bit double precision floating point */
+2)  imcopy infile.fit 'outfile.fit[compress GZIP]'
 
-  The following 2 data type codes are also supported by CFITSIO:
-  #define USHORT_IMG  20  /* 16-bit unsigned integers, equivalent to */
-                          /*  BITPIX = 16, BSCALE = 1, BZERO = 32768 */
-  #define ULONG_IMG   40  /* 32-bit unsigned integers, equivalent to */
-                          /*  BITPIX = 32, BSCALE = 1, BZERO = 2147483648 */
+       This will use the GZIP compression algorithm and the default
+       tile size (row by row).  The allowed compression algorithms are
+       Rice, GZIP, and PLIO.  Only the first letter of the algorithm
+       name needs to be specified.
 
-Codes for the datatype of binary table columns and/or for the
-datatype of variables when reading or writing keywords or data:
+3)  imcopy infile.fit 'outfile.fit[compress G 100,100]'
 
-                              DATATYPE               TFORM CODE
-  #define TBIT          1  /*                            'X' */
-  #define TBYTE        11  /* 8-bit unsigned byte,       'B' */
-  #define TLOGICAL     14  /* logicals (int for keywords     */
-                           /*  and char for table cols   'L' */
-  #define TSTRING      16  /* ASCII string,              'A' */
-  #define TSHORT       21  /* signed short,              'I' */
-  #define TINT32BIT    41  /* signed 32-bit int,         'J' */
-  #define TLONG        41  /* signed long,                   */
-  #define TFLOAT       42  /* single precision float,    'E' */
-  #define TDOUBLE      82  /* double precision float,    'D' */
-  #define TCOMPLEX     83  /* complex (pair of floats)   'C' */
-  #define TDBLCOMPLEX 163  /* double complex (2 doubles) 'M' */
+       This will use the GZIP compression algorithm and 100 X 100 pixel
+       tiles.
 
-  The following data type codes are also supported by CFITSIO:
-  #define TINT         31  /* int                            */
-  #define TUINT        30  /* unsigned int                   */
-  #define TUSHORT      20  /* unsigned short                 */
-  #define TULONG       40  /* unsigned long                  */
+4)  imcopy infile.fit 'outfile.fit[compress R 100,100; 4]'
 
-HDU type code values (value returned when moving to new HDU):
+       This will use the Rice compression algorithm, 100 X 100 pixel
+       tiles, and noise_bits = 4 (assuming the input image has a
+       floating point data type).  Decreasing the value of noisebits
+       will improve the overall compression efficiency at the expense
+       of losing more information.
 
-  #define IMAGE_HDU  0  /* Primary Array or IMAGE HDU */
-  #define ASCII_TBL  1  /* ASCII  table HDU */
-  #define BINARY_TBL 2  /* Binary table HDU */
-  #define ANY_HDU   -1  /* matches any type of HDU */
+5)  imcopy infile.fit outfile.fit
 
-Column name and string matching case-sensitivity:
+       If the input file is in tile-compressed format, then it will be
+       uncompressed to the output file.  Otherwise, it simply copies
+       the input image to the output image.
 
-  #define CASESEN   1   /* do case-sensitive string match */
-  #define CASEINSEN 0   /* do case-insensitive string match */
+6)  imcopy 'infile.fit[1001:1500,2001:2500]'  outfile.fit
 
-Logical states (if TRUE and FALSE are not already defined):
+       This extracts a 500 X 500 pixel section of the much larger
+       input image (which may be in tile-compressed format).  The
+       output is a normal uncompressed FITS image.
 
-  #define TRUE 1
-  #define FALSE 0
+7)  imcopy 'infile.fit[1001:1500,2001:2500]'  outfile.fit.gz
 
-Values to represent undefined floating point numbers:
+       Same as above, except the output file is externally compressed
+       using the gzip algorithm.
 
-  #define FLOATNULLVALUE -9.11912E-36F
-  #define DOUBLENULLVALUE -9.1191291391491E-36
 \end{verbatim}
- 
-\section{CFITSIO Size Limitations}
-
-CFITSIO places few restrictions on the size of FITS files that it
-reads or writes.  There are a few limits, however, which may affect
-some extreme cases:
 
-1.  The maximum number of files that may be simultaneously opened is
-limited to the number of internal IO buffers allocated in CFITSIO
-(currently 25, as defined by NIOBUF in the file fitsio2.h), or by the
-limit of the underlying C compiler or machine operating system, which
-ever is smaller.  The C symbolic constant FOPEN\_MAX usually defines
-the total number of files that may open at once (this includes any
-other text or binary files which may be open, not just FITS files).
-
-2.  The maximum number of extensions (HDUs) that can be read or written
-in a single FITS file is currently set to 1000 as defined by MAXHDU in
-the fitsio.h file.  This value may be increased if necessary, but the
-access times to the later extensions in such files may become excessively
-long.
-
-3.  By default, CFITSIO can handle FITS files up to 2.1 GB in size
-(2**31 bytes).  This file size limit is often imposed by 32-bit
-operating systems.  More recently, as 64-bit operating systems become
-more common, an industry-wide standard (at least on Unix systems) has
-been developed to support larger sized files (see
-http://ftp.sas.com/standards/large.file/).  Starting with version 2.1
-of CFITSIO, larger FITS files up to 6 terabytes in size may be read and
-written on certain supported platforms.  In order to support these
-larger files, CFITSIO must be compiled with the
-`-D\_FILE\_OFFSET\_BITS=64' compiler flag.  All programs which link to
-the CFITSIO library must also be compiled with this flag or must
-include this preprocessor definition at the start of the source code
-file.  This causes the compiler to allocate 8-bytes instead of 4-bytes
-for the `off\_t' datatype which is used to store file offset
-positions.
+\section{ASCII and Binary Table Routines}
 
-If CFITSIO is compiled with the -D\_FILE\_OFFSET\_BITS=64 flag on a
-platform that supports large files, then it can read and write FITS
-files that contain up to 2**31 2880-byte FITS records, or approximately
-6 terabytes in size.  It is still required that the value of the NAXISn
-and PCOUNT keywords in each extension be within the range of a signed
-4-byte integer (max value = 2,147,483,648).  Thus, each dimension of an
-image (given by the NAXISn keywords), the total width of a table
-(NAXIS1 keyword), the number of rows in a table (NAXIS2 keyword), and
-the total size of the variable-length array heap in binary tables
-(PCOUNT keyword) must be less than this limit.
+These routines perform read and write operations on columns of data in
+FITS ASCII or Binary tables.  Note that in the following discussions,
+the first row and column in a table is at position 1 not 0.
 
-Currently, support for large files within CFITSIO has only been tested
-on the Solaris 2.6 operating system using the Sun cc compiler or gcc
-2.95.2.
+Users should also read the following chapter on the CFITSIO iterator
+function which provides a more `object oriented' method of reading and
+writing table columns.  The iterator function is a little more
+complicated to use, but the advantages are that it usually takes less
+code to perform the same operation, and the resulting program oftens
+runs faster because the FITS files are read and written using the most
+efficient block size.
 
- 
-\section{Multiple Access to the Same FITS File}
 
-CFITSIO supports simultaneous read and write access to multiple HDUs in
-the same FITS file.  Thus, one can open the same FITS file twice within
-a single program and move to 2 different HDUs in the file, and then
-read and write data or keywords to the 2 extensions just as if one were
-accessing 2 completely separate FITS files.   Since in general it is
-not possible to physically open the same file twice and then expect to
-be able to simultaneously (or in alternating succession) write to 2
-different locations in the file, CFITSIO recognizes when the file to be
-opened (in the call to fits\_open\_file) has already been opened and
-instead of actually opening the file again, just logically links the
-new file to the old file.  (This only applies if the file is opened
-more than once within the same program, and does not prevent the same
-file from being simultaneously opened by more than one program).  Then
-before CFITSIO reads or writes to either (logical) file, it makes sure
-that any modifications made to the other file have been completely
-flushed from the internal buffers to the file.  Thus, in principle, one
-could open a file twice, in one case pointing to the first extension
-and in the other pointing to the 2nd extension and then write data to
-both extensions, in any order, without danger of corrupting the file,
-There may be some efficiency penalties in doing this however, since
-CFITSIO has to flush all the internal buffers related to one file
-before switching to the  other, so it would still be prudent to
-minimize the number of times one switches back and forth between doing
-I/O to different HDUs in the same file.
+\subsection{Create New Table}
 
- 
-\section{Current Header Data Unit (CHDU)}
 
-In general, a FITS file can contain multiple Header Data Units, also
-called extensions.  CFITSIO only operates within one HDU at any given
-time, and the currently selected HDU is called the Current Header Data
-Unit (CHDU).  When a FITS file is first created or opened the CHDU is
-automatically defined to be the first HDU (i.e., the primary array).
-CFITSIO routines are provided to move to and open any other existing
-HDU within the FITS file or to append or insert a new HDU in the FITS
-file which then becomes the CHDU.
-
- 
-\section{Function Names and Datatypes}
-
-All the CFITSIO functions have both a short name as well as a longer
-descriptive name.  The short name is only 5 or 6 characters long and is
-similar to the subroutine name in the Fortran-77 version of FITSIO.
-The longer name is more descriptive and it is recommended that it be
-used instead of the short name to more clearly document the source
-code.
+\begin{description}
+\item[1 ]Create a new ASCII or bintable table extension. If
+   the FITS file is currently empty then a dummy primary array will be
+   created before appending the table extension to it.  The tbltype
+   parameter defines the type of table and can have values of
+   ASCII\_TBL or BINARY\_TBL.  The naxis2 parameter gives the initial
+   number of rows to be created in the table, and should normally be
+   set = 0.  CFITSIO will automatically increase the size of the table
+   as additional rows are written.  A non-zero number of rows may be
+   specified to reserve space for that many rows, even if a fewer
+   number of rows will be written.  The tunit and extname parameters
+   are optional and a null pointer may be given if they are not
+   defined.  The FITS Standard recommends that only letters, digits,
+   and the underscore character be used in column names (the ttype
+   parameter) with no embedded spaces.  Trailing blank characters are
+   not significant.  It is recommended that all the column names in a
+   given table be unique within the first 8 characters, and strongly
+   recommended that the names be
+  unique within the first 16 characters. \label{ffcrtb}
+\end{description}
 
-Many of the CFITSIO routines come in families which differ only in the
-datatype of the associated parameter(s).  The datatype of these
-routines is indicated by the suffix of the routine name.  The short
-routine names have a 1 or 2 character suffix (e.g., 'j' in 'ffpkyj')
-while the long routine names have a 4 character or longer suffix
-as shown in the following table:
- 
 \begin{verbatim}
-    Long      Short  Data
-    Names     Names  Type
-    -----     -----  ----
-    _bit        x    bit
-    _byt        b    unsigned byte
-    _sht        i    short integer
-    _lng        j    long integer
-    _usht       ui   unsigned short integer
-    _ulng       uj   unsigned long integer
-    _uint       uk   unsigned int integer
-    _int        k    int integer
-    _flt        e    real exponential floating point (float)
-    _fixflt     f    real fixed-decimal format floating point (float)
-    _dbl        d    double precision real floating-point (double)
-    _fixdbl     g    double precision fixed-format floating point (double)
-    _cmp        c    complex reals (pairs of float values)
-    _fixcmp     fc   complex reals, fixed-format floating point
-    _dblcmp     m    double precision complex (pairs of double values)
-    _fixdblcmp  fm   double precision complex, fixed-format floating point
-    _log        l    logical (int)
-    _str        s    character string
+  int fits_create_tbl / ffcrtb
+      (fitsfile *fptr, int tbltype, long naxis2, int tfields, char *ttype[],
+       char *tform[], char *tunit[], char *extname, int *status)
 \end{verbatim}
 
-The logical datatype corresponds to `int' for logical keyword values,
-and `byte' for logical binary table columns.  In otherwords, the value
-when writing a logical keyword must be stored in an `int' variable, and
-must be stored in a `char' array when reading or writing to `L' columns
-in a binary table.  Inplicit data type conversion is not supported for
-logical table columns, but is for keywords, so a logical keyword may be
-read and cast to any numerical data type; a returned value = 0
-indicates false, and any other value = true.
+\subsection{Column Information Routines}
 
-The `int' datatype may be 2 bytes long on some IBM PC compatible
-systems and is usually 4 bytes long on most other systems.  Some 64-bit
-machines, however, like the Dec Alpha/OSF, define the `short', `int',
-and `long' integer datatypes to be 2, 4, and 8 bytes long,
-respectively.  The FITS standard only supports 2 and 4 byte integer
-data types, so CFITSIO internally converts between 4 and 8 bytes when
-reading or writing `long' integers on Alpha/OSF systems.
 
-When dealing with the FITS byte datatype it is important to remember
-that the raw values (before any scaling by the BSCALE and BZERO, or
-TSCALn and TZEROn keyword values) in byte arrays (BITPIX = 8) or byte
-columns (TFORMn = 'B') are interpreted as unsigned bytes with values
-ranging from 0 to 255.  Some C compilers define a 'char' variable as
-signed, so it is important to explicitly declare a numeric char
-variable as 'unsigned char' to avoid any ambiguity
+\begin{description}
+\item[1 ]  Get the number of rows or columns in the current FITS table.
+     The number of rows is given by the NAXIS2 keyword and the
+     number of columns is given by the TFIELDS keyword in the header
+    of the table. \label{ffgnrw}
+\end{description}
 
-One feature of the CFITSIO routines is that they can operate on a `X'
-(bit) column in a binary table as though it were a `B' (byte) column.
-For example a `11X' datatype column can be interpreted the same as a
-`2B' column (i.e., 2 unsigned 8-bit bytes).  In some instances, it can
-be more efficient to read and write whole bytes at a time, rather than
-reading or writing each individual bit.
+\begin{verbatim}
+  int fits_get_num_rows / ffgnrw
+      (fitsfile *fptr, > long *nrows, int *status);
 
-The complex and double precision complex datatypes are not directly
-supported in ANSI C so these datatypes should be interpreted as pairs
-of float or double values, respectively, where the first  value in each
-pair is the real part, and the second is the imaginary part.
+  int fits_get_num_cols / ffgncl
+      (fitsfile *fptr, > int *ncols, int *status);
+\end{verbatim}
 
- 
-\section{Unsigned Integers}
 
-Although FITS does not directly support unsigned integers as one of its
-fundamental datatypes, FITS can still be used to efficiently store
-unsigned integer data values in images and binary tables.  The
-convention used in FITS files is to store the unsigned integers as
-signed integers with an associated offset (specified by the BZERO or
-TZEROn keyword).  For example, to store unsigned 16-bit integer values
-in a FITS image the image would be defined as a signed 16-bit integer
-(with BITPIX keyword = SHORT\_IMG = 16) with the keywords BSCALE = 1.0
-and BZERO = 32768.  Thus the unsigned values of 0, 32768, and 65535,
-for example, are physically stored in the FITS image as -32768, 0, and
-32767, respectively;  CFITSIO automatically adds the BZERO offset to
-these values when they are read.  Similarly, in the case of unsigned
-32-bit integers the BITPIX keyword would be equal to LONG\_IMG = 32 and
-BZERO would be equal to 2147483648 (i.e. 2 raised to the 31st power).
+\begin{description}
+\item[2 ] Get the table column number (and name) of the column whose name
+matches an input template name.   If casesen  = CASESEN then the column
+name match will be case-sensitive, whereas if casesen = CASEINSEN then
+the case will be ignored.  As a general rule, the column names should
+be treated as case INsensitive.
 
-The CFITSIO interface routines will efficiently and transparently apply
-the appropriate offset in these cases so in general application
-programs do not need to be concerned with how the unsigned values are
-actually stored in the FITS file.  As a convenience for users, CFITSIO
-has several predefined constants for the value of BITPIX  (USHORT\_IMG,
-ULONG\_IMG) and for the TFORMn value in the case of binary tables (`U'
-and `V') which programmers can use when creating FITS files containing
-unsigned integer values.  The following code fragment illustrates how
-to write a FITS 1-D primary array of unsigned 16-bit integers:
- 
-\begin{verbatim}
-      unsigned short uarray[100];
-      int naxis, status;
-      long naxes[10], group, firstelem, nelements;
-       ...
-      status = 0;
-      naxis = 1;
-      naxes[0] = 100;
-      fits_create_img(fptr, USHORT_IMG, naxis, naxes, &status);
+The input column name template may be either the exact name of the
+column to be searched for, or it may contain wild card characters (*,
+?, or \#), or it may contain the integer number of the desired column
+(with the first column = 1).  The `*' wild card character matches any
+sequence of characters (including zero characters) and the `?'
+character matches any single character.  The \# wildcard will match any
+consecutive string of decimal digits (0-9).  If more than one column
+name in the table matches the template string, then the first match is
+returned and the status value will be set to COL\_NOT\_UNIQUE  as a
+warning that a unique match was not found.  To find the other cases
+that match the template, call the routine again leaving the input
+status value equal to COL\_NOT\_UNIQUE and the next matching name will
+then be returned.  Repeat this process until a status =
+COL\_NOT\_FOUND  is returned.
 
-      firstelem = 1;
-      nelements = 100;
-      fits_write_img(fptr, TUSHORT, firstelem, nelements,
-                          uarray, &status);
-       ...
-\end{verbatim}
-In the above example, the 2nd parameter in fits\_create\_img tells
-CFITSIO to write the header keywords appropriate for an array of 16-bit
-unsigned integers (i.e., BITPIX = 16 and BZERO = 32768).  Then the
-fits\_write\_img routine writes the array of unsigned short integers
-(uarray) into the primary array of the FITS file.  Similarly, a 32-bit
-unsigned integer image may be created by setting the second parameter
-in fits\_create\_img equal to `ULONG\_IMG' and by calling the
-fits\_write\_img routine with the second parameter = TULONG to write
-the array of unsigned long image pixel values.
+The FITS Standard recommends that only letters, digits, and the
+underscore character be used in column names (with no embedded
+spaces).  Trailing blank characters are not significant.  It is
+recommended that all the column names in a given table be unique within
+the first 8 characters, and strongly recommended that the names be
+ unique within the first 16 characters. \label{ffgcno} \label{ffgcnn}
+\end{description}
 
-An analogous set of routines are available for reading or writing
-unsigned integer values in a FITS binary table extension.  When
-specifying the TFORMn keyword value which defines the format of a
-column, CFITSIO recognized 2 additional datatype codes besides those
-already defined in the FITS standard: `U' meaning a 16-bit unsigned
-integer column, and `V' for a 32-bit unsigned integer column.  These
-non-standard datatype codes are not actually written into the FITS file
-but instead are just used internally within CFITSIO.  The following
-code fragment illustrates how to use these features:
- 
 \begin{verbatim}
-      unsigned short uarray[100];
-      unsigned int  varray[100];
-
-      int colnum, tfields, status;
-      long nrows, firstrow, firstelem, nelements, pcount;
+  int fits_get_colnum / ffgcno
+      (fitsfile *fptr, int casesen, char *templt, > int *colnum,
+       int *status)
 
-      char extname[] = "Test_table";           /* extension name */
+  int fits_get_colname / ffgcnn
+      (fitsfile *fptr, int casesen, char *templt, > char *colname,
+       int *colnum, int *status)
+\end{verbatim}
 
-      /* define the name, datatype, and physical units for the 2 columns */
-      char *ttype[] = { "Col_1", "Col_2" };
-      char *tform[] = { "1U",      "1V"   };  /* special CFITSIO codes */
-      char *tunit[] = { " ",        " "   };
-       ...
+\begin{description}
+\item[3 ] Return the data type, vector repeat value, and the width in bytes
+    of a column in an ASCII or binary table.  Allowed values for the
+    data type in ASCII tables are:  TSTRING, TSHORT, TLONG, TFLOAT, and
+    TDOUBLE.  Binary tables also support these types: TLOGICAL, TBIT,
+    TBYTE, TCOMPLEX and TDBLCOMPLEX.  The negative of the data type code
+    value is returned if it is a variable length array column.  Note
+    that in the case of a 'J' 32-bit integer binary table column, this
+    routine will return data type = TINT32BIT (which in fact is
+    equivalent to TLONG).  With most current C compilers, a value in a
+    'J' column has the same size as an 'int' variable, and may not be
+    equivalent to a 'long' variable, which is 64-bits long on an
+    increasing number of compilers.
 
-           /* write the header keywords */
-      status  = 0;
-      nrows   = 1;
-      tfields = 2
-      pcount  = 0;
-      fits_create_tbl(fptr, BINARY_TBL, nrows, tfields, ttype, tform,
-                tunit, extname, &status);
+    The 'repeat' parameter returns the vector repeat count on the binary
+    table TFORMn keyword value. (ASCII table columns always have repeat
+    = 1).  The 'width' parameter returns the width in bytes of a single
+    column element (e.g., a '10D' binary table column will have width =
+    8, an ASCII table 'F12.2' column will have width = 12, and a binary
+    table'60A' character string  column will have width = 60);  Note that
+    this routine supports the local convention for specifying arrays of
+    fixed length strings within a binary table character column using
+    the syntax TFORM = 'rAw' where 'r' is the total number of characters
+    (= the width of the column) and 'w' is the width of a unit string
+    within the column.  Thus if the column has TFORM = '60A12' then this
+    means that each row of the table contains 5 12-character substrings
+    within the 60-character field, and thus in this case this routine will
+    return typecode = TSTRING, repeat = 60, and width = 12.  The number
+    of substings in any binary table character string field can be
+    calculated by (repeat/width).  A null pointer may be given for any of
+    the output parameters that are not needed.
+
+   The second routine, fit\_get\_eqcoltype is similar except that in
+   the case of scaled integer columns it returns the 'equivalent' data
+   type that is needed to store the scaled values, and not necessarily
+   the physical data type of the unscaled values as stored in the FITS
+   table.  For example if a '1I' column in a binary table has TSCALn =
+   1 and TZEROn = 32768, then this column effectively contains unsigned
+   short integer values, and thus the returned value of typecode will
+   be TUSHORT, not TSHORT.  Similarly, if a column has TTYPEn = '1I'
+   and TSCALn = 0.12, then the returned typecode
+  will be TFLOAT. \label{ffgtcl}
+\end{description}
 
-           /* write the unsigned shorts to the 1st column */
-      colnum    = 1;
-      firstrow  = 1;
-      firstelem = 1;
-      nelements = 100;
-      fits_write_col(fptr, TUSHORT, colnum, firstrow, firstelem,
-              nelements, uarray, &status);
+\begin{verbatim}
+  int fits_get_coltype / ffgtcl
+      (fitsfile *fptr, int colnum, > int *typecode, long *repeat,
+       long *width, int *status)
 
-           /* now write the unsigned longs to the 2nd column */
-      colnum    = 2;
-      fits_write_col(fptr, TUINT, colnum, firstrow, firstelem,
-              nelements, varray, &status);
-       ...
+  int fits_get_eqcoltype / ffeqty
+      (fitsfile *fptr, int colnum, > int *typecode, long *repeat,
+       long *width, int *status)
 \end{verbatim}
-Note that the non-standard TFORM values for the 2 columns, `U' and `V',
-tell CFITSIO to write the keywords appropriate for unsigned 16-bit and
-unsigned 32-bit integers, respectively (i.e., TFORMn = '1I' and TZEROn
-= 32678 for unsigned 16-bit integers, and TFORMn = '1J' and TZEROn =
-2147483648 for unsigned 32-bit integers).  The calls to
-fits\_write\_col then write the arrays of unsigned integer values to
-the columns.
-
- 
-\section{Character Strings}
-
-The character string values in a FITS header or in an ASCII column in a
-FITS table extension are generally padded out with non-significant
-space characters (ASCII 32) to fill up the header record or the column
-width.  When reading a FITS string value, the CFITSIO routines will
-strip off these non-significant trailing spaces and will return a
-null-terminated string value containing only the significant
-characters.  Leading spaces in a FITS string are considered
-significant.  If the string contains all blanks, then CFITSIO will
-return a single blank character, i.e, the first blank is considered to
-be significant, since it distinquishes the string from a null or
-undefined string, but the remaining trailing spaces are not
-significant.
 
-Similarly, when writing string values to a FITS file the
-CFITSIO routines expect to get a null-terminated string as input;
-CFITSIO will pad the string with blanks if necessary when writing it
-to the FITS file.
+\begin{description}
+\item[4 ] Return the display width of a column.  This is the length
+    of the string that will be returned by the fits\_read\_col routine
+    when reading the column as a formatted string.  The display width is
+    determined by the TDISPn keyword, if present, otherwise by the data
+   type of the column. \label{ffgcdw}
+\end{description}
 
-When calling CFITSIO routines that return a character string it is
-vital that the size of the char array be large enough to hold the
-entire string of characters, otherwise CFITSIO will overwrite whatever
-memory locations follow the char array, possibly causing the program to
-execute incorrectly.  This type of error can be difficult to debug, so
-programmers should always ensure that the char arrays are allocated
-enough space to hold the longest possible string, {\bf including} the
-terminating NULL character.  The fitsio.h file contains the following
-defined constants which programmers are strongly encouraged to use
-whenever they are allocating space for char arrays:
- 
-\begin{verbatim}
-#define FLEN_FILENAME 1025  /* max length of a filename */
-#define FLEN_KEYWORD   72  /* max length of a keyword  */
-#define FLEN_CARD      81  /* length of a FITS header card */
-#define FLEN_VALUE     71  /* max length of a keyword value string */
-#define FLEN_COMMENT   73  /* max length of a keyword comment string */
-#define FLEN_ERRMSG    81  /* max length of a CFITSIO error message */
-#define FLEN_STATUS    31  /* max length of a CFITSIO status text string */
-\end{verbatim}
-For example, when declaring a char array to hold the value string
-of FITS keyword, use the following statement:
- 
 \begin{verbatim}
-    char value[FLEN_VALUE];
+  int fits_get_col_display_width / ffgcdw
+      (fitsfile *fptr, int colnum, > int *dispwidth, int *status)
 \end{verbatim}
-Note that FLEN\_KEYWORD is longer than needed for the nominal 8-character
-keyword name because the HIERARCH convention supports longer keyword names.
 
- 
-\section{Implicit Data Type Conversion}
 
-The CFITSIO routines that read and write numerical data can perform
-implicit data type conversion.  This means that the data type of the
-variable or array in the program does not need to be the same as the
-data type of the value in the FITS file.  Data type conversion is
-supported for numerical data types when reading a FITS header keyword
-value and when reading or writing values in the primary array or a
-table column.  CFITSIO returns status = NUM\_OVERFLOW  if the converted
-data value exceeds the range of the output data type.  Implicit data type
-conversion is not supported for string, logical, complex, or double
-complex data types.
-
- 
-\section{Data Scaling}
+\begin{description}
+\item[5 ] Return the number of and size of the dimensions of a table column in
+    a binary table. Normally this information is given by the TDIMn keyword,
+    but if this keyword is not present then this routine returns naxis = 1
+   and naxes[0] equal to the repeat count in the TFORM keyword. \label{ffgtdm}
+\end{description}
 
-When reading numerical data values in the primary array or a
-table column, the values will be scaled automatically by the BSCALE and
-BZERO (or TSCALn and TZEROn) header values if they are
-present in the header.  The scaled data that is returned to the reading
-program will have
- 
 \begin{verbatim}
-        output value = (FITS value) * BSCALE + BZERO
+  int fits_read_tdim / ffgtdm
+      (fitsfile *fptr, int colnum, int maxdim, > int *naxis,
+       long *naxes, int *status)
 \end{verbatim}
-(a corresponding formula using TSCALn and TZEROn is used when reading
-from table columns).  In the case of integer output values the floating
-point scaled value is truncated to an integer (not rounded to the
-nearest integer).  The fits\_set\_bscale and fits\_set\_tscale routines
-(described in the `Advanced' chapter) may be used to override the
-scaling parameters defined in the header (e.g., to turn off the scaling
-so that the program can read the raw unscaled values from the FITS
-file).
 
-When writing numerical data to the primary array or to a table column
-the data values will generally be automatically inversely scaled by the
-value of the BSCALE and BZERO (or TSCALn and TZEROn) keyword values if
-they they exist in the header.  These keywords must have been written
-to the header before any data is written for them to have any immediate
-effect.  One may also use the fits\_set\_bscale and fits\_set\_tscale
-routines to define or override the scaling keywords in the header
-(e.g., to turn off the scaling so that the program can write the raw
-unscaled values into the FITS file). If scaling is performed, the
-inverse scaled output value that is written into the FITS file will
-have
- 
+\begin{description}
+\item[6 ] Decode the input TDIMn keyword string (e.g. '(100,200)') and return the
+    number of and size of the dimensions of a binary table column. If the input
+    tdimstr character string is null, then this routine returns naxis = 1
+    and naxes[0] equal to the repeat count in the TFORM keyword. This routine
+   is called by fits\_read\_tdim.  \label{ffdtdm}
+\end{description}
+
 \begin{verbatim}
-         FITS value = ((input value) - BZERO) / BSCALE
+  int fits_decode_tdim / ffdtdm
+      (fitsfile *fptr, char *tdimstr, int colnum, int maxdim, > int *naxis,
+       long *naxes, int *status)
 \end{verbatim}
-(a corresponding formula using TSCALn and TZEROn is used when
-writing to table columns).  Rounding to the nearest integer, rather
-than truncation, is performed when writing integer datatypes to the
-FITS file.
 
- 
-\section{Error Status Values and the Error Message Stack}
+\begin{description}
+\item[7 ] Write a TDIMn keyword whose value has the form '(l,m,n...)'
+    where l, m, n... are the dimensions of a multidimension array
+   column in a binary table. \label{ffptdm}
+\end{description}
 
-Nearly all the CFITSIO routines return an error status value
-in 2 ways: as the value of the last parameter in the function call,
-and as the returned value of the function itself.  This provides
-some flexibility in the way programmers can test if an error
-occurred, as illustrated in the following 2 code fragments:
- 
 \begin{verbatim}
-    if ( fits_write_record(fptr, card, &status) )
-         printf(" Error occurred while writing keyword.");
+  int fits_write_tdim / ffptdm
+      (fitsfile *fptr, int colnum, int naxis, long *naxes, > int *status)
 \end{verbatim}
-or,
- 
+
+
+\subsection{Routines to Edit Rows or Columns}
+
+
+\begin{description}
+\item[1 ] Insert or delete rows in an ASCII or binary table. When inserting rows
+    all the rows following row FROW are shifted down by NROWS rows;  if
+    FROW = 0 then the blank rows are inserted at the beginning of the
+    table.  The first delete routine deletes NROWS consecutive rows
+    starting with row FIRSTROW.  The second delete routine takes an
+    input string that lists the rows or row ranges (e.g.,
+    '5-10,12,20-30'), whereas the third delete routine takes an input
+    integer array that specifies each individual row to be deleted. In
+    both latter cases, the input list of rows to delete must be sorted
+    in ascending order.  These routines update the NAXIS2 keyword to
+    reflect the new number of rows in the
+   table. \label{ffirow} \label{ffdrow} \label{ffdrws} \label{ffdrrg}
+\end{description}
+
 \begin{verbatim}
-    fits_write_record(fptr, card, &status);
-    if ( status )
-         printf(" Error occurred while writing keyword.");
-\end{verbatim}
-A listing of all the CFITSIO status code values is given at the end of
-this document.  Programmers are encouraged to use the symbolic
-mnemonics (defined in fitsio.h) rather than the actual integer status
-values to improve the readability of their code.
+  int fits_insert_rows / ffirow
+      (fitsfile *fptr, long firstrow, long nrows, > int *status)
 
-The CFITSIO library uses an `inherited status' convention for the
-status parameter which means that if a routine is called with a
-positive input value of the status parameter as input, then the routine
-will exit immediately without changing the value of the status
-parameter.  Thus, if one passes the status value returned from each
-CFITSIO routine as input to the next CFITSIO routine, then whenever an
-error is detected all further CFITSIO processing will cease.  This
-convention can simplify the error checking in application programs
-because it is not necessary to check the value of the status parameter
-after every single CFITSIO routine call.  If a program contains a
-sequence of several CFITSIO calls, one can just check the status value
-after the last call.  Since the returned status values are generally
-distinctive, it should be possible to determine which routine
-originally returned the error status.
+  int fits_delete_rows / ffdrow
+      (fitsfile *fptr, long firstrow, long nrows, > int *status)
 
-CFITSIO also maintains an internal stack of error messages
-(80-character maximum length)  which in many cases provide a more
-detailed explanation of the cause of the error than is provided by the
-error status number alone.  It is recommended that the error message
-stack be printed out whenever a program detects a CFITSIO error.  The
-function fits\_report\_error will print out the entire error message
-stack, or alternatively one may call fits\_read\_errmsg to get the
-error messages one at a time.
+  int fits_delete_rowrange / ffdrrg
+      (fitsfile *fptr, char *rangelist, > int *status)
 
- 
-\section{Variable-Length Arrays in Binary Tables}
+  int fits_delete_rowlist / ffdrws
+      (fitsfile *fptr, long *rowlist, long nrows, > int *status)
+\end{verbatim}
 
-CFITSIO provides easy-to-use support for reading and writing data in
-variable length fields of a binary table. The variable length columns
-have TFORMn keyword values of the form `1Pt(len)' where `t' is the
-datatype code (e.g., I, J, E, D, etc.) and `len' is an integer
-specifying the maximum length of the vector in the table.  If the value
-of `len' is not specified when the table is created (e.g., if the TFORM
-keyword value is simply specified as '1PE' instead of '1PE(400) ), then
-CFITSIO will automatically scan the table when it is closed to
-determine the maximum length of the vector and will append this value
-to the TFORMn value.
+\begin{description}
+\item[2 ] Insert or delete column(s) in an ASCII or binary
+    table.  When inserting, COLNUM specifies the column number that the
+    (first) new column should occupy in the table.  NCOLS specifies how
+    many columns are to be inserted. Any existing columns from this
+    position and higher are shifted over to allow room for the new
+    column(s).  The index number on all the following keywords will be
+    incremented or decremented if necessary to reflect the new position
+    of the column(s) in the table:  TBCOLn, TFORMn, TTYPEn, TUNITn,
+    TNULLn, TSCALn, TZEROn, TDISPn, TDIMn, TLMINn, TLMAXn, TDMINn,
+    TDMAXn, TCTYPn, TCRPXn, TCRVLn, TCDLTn, TCROTn,
+   and TCUNIn. \label{fficol} \label{fficls} \label{ffdcol}
+\end{description}
 
-The same routines which read and write data in an ordinary fixed length
-binary table extension are also used for variable length fields,
-however, the routine parameters take on a slightly different
-interpretation as described below.
+\begin{verbatim}
+  int fits_insert_col / fficol
+      (fitsfile *fptr, int colnum, char *ttype, char *tform,
+       > int *status)
 
-All the data in a variable length field is written into an area called
-the `heap' which follows the main fixed-length FITS binary table. The
-size of the heap, in bytes, is specified by the PCOUNT keyword in the
-FITS header. When creating a new binary table, the initial value of
-PCOUNT should usually be set to zero. CFITSIO will recompute the size
-of the heap as the data is written and will automatically update the
-PCOUNT keyword value when the table is closed.  When writing variable
-length data to a table, CFITSIO will automatically extend the size
-of the heap area if necessary, so that any following HDUs do not
-get overwritten.
+  int fits_insert_cols / fficls
+      (fitsfile *fptr, int colnum, int ncols, char **ttype,
+       char **tform, > int *status)
 
-By default the heap data area starts immediately after the last row of
-the fixed-length table.  This default starting location may be
-overridden by the THEAP keyword, but this is not recommended.
-If addtional rows of data are added to the table, CFITSIO will
-automatically shift the the heap down to make room for the new
-rows, but it is obviously be more efficient to initially
-create the table with the necessary number of blank rows, so that
-the heap does not needed to be constantly moved.
+  int fits_delete_col / ffdcol(fitsfile *fptr, int colnum, > int *status)
+\end{verbatim}
 
-When writing to a variable length field the entire array of values for
-a given row of the table must be written with a single call to
-fits\_write\_col.  The total length of the array is given by nelements
-+ firstelem - 1.  Additional elements cannot be appended to an existing
-vector at a later time since any attempt to do so will simply overwrite
-all the previously written data.  Note also that the new data will be
-written to a new area of the heap and the heap space used by the
-previous write cannot be reclaimed.  For this reason each row of a
-variable length field should only be written once.  An exception to
-this general rule occurs when setting elements of an array as
-undefined.  One must first write a dummy value into the array with
-fits\_write\_col, and then call fits\_write\_col\_nul to flag the
-desired elements as undefined.  (Do not use the fits\_write\_colnull
-routines with variable length fields).  Note that the rows of a table,
-whether fixed or variable length, do not have to be written
-consecutively and may be written in any order.
+\begin{description}
+\item[3 ] Copy a column from one HDU to another (or to the same HDU).  If
+    create\_col = TRUE, then a new column will be inserted in the output
+    table, at position `outcolumn', otherwise the existing output column will
+    be overwritten (in which case it must have a compatible data type).
+    If outcolnum is greater than the number of column in the table, then
+    the new column will be appended to the end of the table.
+    Note that the first column in a table is at colnum = 1.
+    The standard indexed keywords that related to the column (e.g., TDISPn,
+   TUNITn, TCRPXn, TCDLTn, etc.) will also be copied. \label{ffcpcl}
+\end{description}
 
-When writing to a variable length ASCII character field (e.g., TFORM =
-'1PA') only a single character string can be written.  The `firstelem'
-and `nelements' parameter values in the fits\_write\_col routine are
-ignored and the number of characters to write is simply determined by
-the length of the input null-terminated character string.
+\begin{verbatim}
+  int fits_copy_col / ffcpcl
+      (fitsfile *infptr, fitsfile *outfptr, int incolnum, int outcolnum,
+       int create_col, > int *status);
+\end{verbatim}
 
-The fits\_write\_descript routine is useful in situations where
-multiple rows of a variable length column have the identical array of
-values.  One can simply write the array once for the first row, and
-then use fits\_write\_descript to write the same descriptor values into
-the other rows;  all the rows will then point to the same storage
-location thus saving disk space.
+\begin{description}
+\item[4 ] Modify the vector length of a binary table column (e.g.,
+    change a column from TFORMn = '1E' to '20E').  The vector
+   length may be increased or decreased from the current value. \label{ffmvec}
+\end{description}
 
-When reading from a variable length array field one can only read as
-many elements as actually exist in that row of the table; reading does
-not automatically continue with the next row of the table as occurs
-when reading an ordinary fixed length table field.  Attempts to read
-more than this will cause an error status to be returned.  One can
-determine the number of elements in each row of a variable column with
-the fits\_read\_descript routine.
+\begin{verbatim}
+  int fits_modify_vector_len / ffmvec
+      (fitsfile *fptr, int colnum, long newveclen, > int *status)
+\end{verbatim}
 
- 
-\section{Support for IEEE Special Values}
+\subsection{Read and Write Column Data Routines}
 
-The ANSI/IEEE-754 floating-point number standard defines certain
-special values that are used to represent such quantities as
-Not-a-Number (NaN), denormalized, underflow, overflow, and infinity.
-(See the Appendix in the NOST FITS standard or the NOST FITS User's
-Guide for a list of these values).  The CFITSIO routines that read
-floating point data in FITS files recognize these IEEE special values
-and by default interpret the overflow and infinity values as being
-equivalent to a NaN, and convert the underflow and denormalized values
-into zeros.  In some cases programmers may want access to the raw IEEE
-values, without any modification by CFITSIO.  This can be done by
-calling the fits\_read\_img or fits\_read\_col routines while
-specifying 0.0 as the value of the NULLVAL parameter.  This will force
-CFITSIO to simply pass the IEEE values through to the application
-program without any modification.  This is not fully supported on
-VAX/VMS machines, however, where there is no easy way to bypass the
-default interpretation of the IEEE special values.
+The following routines write or read data values in the current ASCII
+or binary table extension.  If a write operation extends beyond the
+current size of the table, then the number of rows in the table will
+automatically be increased and the NAXIS2 keyword value will be
+updated.  Attempts to read beyond the end of the table will result in
+an error.
 
- 
-\section{When the Final Size of the FITS HDU is Unknown}
+Automatic data type conversion is performed for numerical data types
+(only) if the data type of the column (defined by the TFORMn keyword)
+differs from the data type of the calling routine.  ASCII and binary
+tables support the following data type values:  TSTRING, TBYTE, TSBYTE, TSHORT,
+TUSHORT, TINT, TUINT, TLONG, TLONGLONG, TULONG, TFLOAT, or TDOUBLE.
+Binary tables also support TLOGICAL (internally mapped to the `char'
+data type), TCOMPLEX, and TDBLCOMPLEX.
+
+Note that within the context of these routines, the TSTRING data type
+corresponds to a C 'char**' data type, i.e., a pointer to an array of
+pointers to an array of characters.  This is different from the keyword
+reading and writing routines where TSTRING corresponds to a C 'char*'
+data type, i.e., a single pointer to an array of characters.  When
+reading strings from a table, the char arrays obviously must have been
+allocated long enough to hold the whole FITS table string.
 
-It is not required to know the total size of a FITS data array or table
-before beginning to write the data to the FITS file.  In the case of
-the primary array or an image extension, one should initially create
-the array with the size of the highest dimension (largest NAXISn
-keyword) set to a dummy value, such as 1.  Then after all the data have
-been written and the true dimensions are known, then the NAXISn value
-should be updated using the fits\_update\_key routine before moving to
-another extension or closing the FITS file.
+Numerical data values are automatically scaled by the TSCALn and TZEROn
+keyword values (if they exist).
 
-When writing to FITS tables, CFITSIO automatically keeps track of the
-highest row number that is written to, and will increase the size of
-the table if necessary.  CFITSIO will also automatically insert space
-in the FITS file if necessary, to ensure that the data 'heap', if it
-exists, and/or any additional HDUs that follow the table do not get
-overwritten as new rows are written to the table.
+In the case of binary tables with vector elements, the 'felem'
+parameter defines the starting element (beginning with 1, not 0) within
+the cell (a cell is defined as the intersection of a row and a column
+and may contain a single value or a vector of values).  The felem
+parameter is ignored when dealing with ASCII tables. Similarly, in the
+case of binary tables the 'nelements' parameter specifies the total
+number of vector values to be read or written (continuing on subsequent
+rows if required) and not the number of table cells.
 
-As a general rule it is best to specify the initial number of rows = 0
-when the table is created, then let CFITSIO keep track of the number of
-rows that are actually written.  The application program should not
-manually update the number of rows in the table (as given by the NAXIS2
-keyword) since CFITSIO does this automatically.  If a table is
-initially created with more than zero rows, then this will ususally be
-considered as the minimum size of the table, even if fewer rows are
-actually written to the table.  Thus, if a table is initially created
-with NAXIS2 = 20, and CFITSIO only writes 10 rows of data before
-closing the table, then NAXIS2 will remain equal to 20.  If however, 30
-rows of data are written to this table, then NAXIS2 will be increased
-from 20 to 30.  The one exception to this automatic updating of the
-NAXIS2 keyword is if the application program directly modifies the
-value of NAXIS2 (up or down) itself just before closing the table.  In this
-case, CFITSIO does not update NAXIS2 again, since it assumes that the
-application program must have had a good reason for changing the value
-directly.  This is not recommended, however, and is only provided for
-backward compatibility with software that initially creates a table
-with a large number of rows, than decreases the NAXIS2 value to the
-actual smaller value just before closing the table.
 
- 
-\section{Local FITS Conventions supported by CFITSIO}
+\begin{description}
+\item[1 ] Write elements into an ASCII or binary table column.
+\end{description}
+   The first routine simply writes the array of values to the FITS file
+   (doing data type conversion if necessary) whereas the second routine
+   will substitute the  appropriate FITS null value for all elements
+   which are equal to the input value of nulval (note that this
+   parameter gives the address of nulval, not the null value
+   itself).  For integer columns the FITS null value is defined by the
+   TNULLn keyword (an error is returned if the keyword doesn't exist).
+   For floating point columns  the special IEEE NaN (Not-a-Number)
+   value will be written into the FITS file.  If a null pointer is
+   entered for nulval, then the null value is ignored and this routine
+   behaves the same as the first routine. The second routine must not
+   be used to write to variable length array columns.  The third routine
+   simply writes undefined pixel values to the column.
+   \label{ffpcl} \label{ffpcn} \label{ffpclu}
 
-CFITSIO supports several local FITS conventions which are not
-defined in the official NOST FITS standard and which are not
-necessarily recognized or supported by other FITS software packages.
-Programmers should be cautious about using these features, especially
-if the FITS files that are produced are expected to be processed by
-other software systems which do not use the CFITSIO interface.
+\begin{verbatim}
+  int fits_write_col / ffpcl
+      (fitsfile *fptr, int datatype, int colnum, long firstrow,
+       long firstelem, long nelements, DTYPE *array, > int *status)
 
- 
-\subsection{Long String Keyword Values.}
+  int fits_write_colnull / ffpcn
+      (fitsfile *fptr, int datatype, int colnum, long firstrow,
+      long firstelem, long nelements, DTYPE *array, DTYPE *nulval,
+      > int *status)
 
-The length of a standard FITS string keyword is limited to 68
-characters because it must fit entirely within a single FITS header
-keyword record.  In some instances it is necessary to encode strings
-longer than this limit, so CFITSIO supports a local convention in which
-the string value is continued over multiple keywords.  This
-continuation convention uses an ampersand character at the end of each
-substring to indicate that it is continued on the next keyword, and the
-continuation keywords all have the name CONTINUE without an equal sign
-in column 9. The string value may be continued in this way over as many
-additional CONTINUE keywords as is required.  The following lines
-illustrate this continuation convention which is used in the value of
-the STRKEY keyword:
- 
-\begin{verbatim}
-LONGSTRN= 'OGIP 1.0'    / The OGIP Long String Convention may be used.
-STRKEY  = 'This is a very long string keyword&'  / Optional Comment
-CONTINUE  ' value that is continued over 3 keywords in the &  '
-CONTINUE  'FITS header.' / This is another optional comment.
+   int fits_write_col_null / ffpclu
+       (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+        long nelements, > int *status)
 \end{verbatim}
-It is recommended that the LONGSTRN keyword, as shown here, always be
-included in any HDU that uses this longstring convention as a warning
-to any software that must read the keywords.  A routine called fits\_write\_key\_longwarn
-has been provided in CFITSIO to write this keyword if it does not
-already exist.
 
-This long string convention is supported by the following CFITSIO
-routines:
- 
+\begin{description}
+\item[2 ] Read elements from an ASCII or binary table column.  The data type
+    parameter specifies the data type of the `nulval' and `array'  pointers;
+    Undefined array elements will be returned with a value = *nullval,
+    (note that this parameter gives the address of the null value, not the
+    null value itself) unless nulval = 0 or *nulval = 0, in which case
+    no checking for undefined pixels will be performed.  The second
+    routine is similar except that any undefined pixels will have the
+    corresponding nullarray element set equal to TRUE (= 1).
+
+    Any column, regardless of it's intrinsic data type, may be read as a
+    string.  It should be noted however that reading a numeric column
+    as a string is 10 - 100 times slower than reading the same column
+    as a number due to the large overhead in constructing the formatted
+    strings.  The display format of the returned strings will be
+    determined by the TDISPn keyword, if it exists, otherwise by the
+    data type of the column.  The length of the returned strings (not
+    including the null terminating character) can be determined with
+    the fits\_get\_col\_display\_width routine.  The following TDISPn
+    display formats are currently supported:
+
 \begin{verbatim}
-    fits_write_key_longstr  - write a long string keyword value
-    fits_insert_key_longstr - insert a long string keyword value
-    fits_modify_key_longstr - modify a long string keyword value
-    fits_update_key_longstr - modify a long string keyword value
-    fits_read_key_longstr   - read  a long string keyword value
-    fits_delete_key         - delete a keyword
+    Iw.m   Integer
+    Ow.m   Octal integer
+    Zw.m   Hexadecimal integer
+    Fw.d   Fixed floating point
+    Ew.d   Exponential floating point
+    Dw.d   Exponential floating point
+    Gw.d   General; uses Fw.d if significance not lost, else Ew.d
 \end{verbatim}
-The fits\_read\_key\_longstr routine is unique among all the CFITSIO
-routines in that it internally allocates memory for the long string
-value;  all the other CFITSIO routines that deal with arrays require
-that the calling program pre-allocate adequate space to hold the array
-of data.  Consequently, programs which use the fits\_read\_key\_longstr
-routine must be careful to free the allocated memory for the string
-when it is no longer needed.
+    where w is the width in characters of the displayed values, m is the minimum
+    number of digits displayed, and d is the number of digits to the right of the
+    decimal.  The .m field is optional.
+   \label{ffgcv} \label{ffgcf}
+\end{description}
 
-The following 2 routines also have limited support for this long string
-convention,
- 
 \begin{verbatim}
-      fits_modify_key_str - modify an existing string keyword value
-      fits_update_key_str - update a string keyword value
+  int fits_read_col / ffgcv
+      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
+       long nelements, DTYPE *nulval, DTYPE *array, int *anynul, int *status)
+
+  int fits_read_colnull / ffgcf
+      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
+      long nelements, DTYPE *array, char *nullarray, int *anynul, int *status)
 \end{verbatim}
-in that they will correctly overwrite an existing long string value,
-but the new string value is limited to a maximum of 68 characters in
-length.
 
-The more commonly used CFITSIO routines to write string valued keywords
-(fits\_update\_key and fits\_write\_key) do not support this long
-string convention and only support strings up to 68 characters in
-length.  This has been done deliberately to prevent programs from
-inadvertently writing keywords using this non-standard convention
-without the explicit intent of the programmer or user.   The
-fits\_write\_key\_longstr routine must be called instead to write long
-strings.  This routine can also be used to write ordinary string values
-less than 68 characters in length.
 
- 
-\subsection{Arrays of Fixed-Length Strings in Binary Tables}
+\subsection{Row Selection and Calculator Routines}
 
-The definition of the FITS binary table extension format does not
-provide a simple way to specify that a character column contains an
-array of fixed-length strings.  To support this feature, CFITSIO uses a
-local convention for the format of the TFORMn keyword value of the form
-'rAw' where 'r' is an integer specifying the total width in characters
-of the column, and 'w' is an integer specifying the (fixed) length of
-an individual unit string within the vector.  For example, TFORM1 =
-'120A10' would indicate that the binary table column is 120 characters
-wide and consists of 12 10-character length strings.  This convention
-is recognized by the CFITSIO routines that read or write strings in
-binary tables.   The Binary Table definition document specifies that
-other optional characters may follow the datatype code in the TFORM
-keyword, so this local convention is in compliance with the
-FITS standard although other FITS readers may not
-recognize this convention.
+These routines all parse and evaluate an input string containing a user
+defined arithmetic expression.  The first 3 routines select rows in a
+FITS table, based on whether the expression evaluates to true (not
+equal to zero) or false (zero).  The other routines evaluate the
+expression and calculate a value for each row of the table.  The
+allowed expression syntax is described in the row filter section in the
+`Extended File Name Syntax' chapter of this document.  The expression
+may also be written to a text file, and the name of the file, prepended
+with a '@' character may be supplied for the 'expr' parameter (e.g.
+'@filename.txt'). The  expression  in  the  file can be arbitrarily
+complex and extend over multiple lines of the file.  Lines  that begin
+with 2 slash characters ('//') will  be ignored and may be used to add
+comments to the file.
 
-The Binary Table definition document that was approved by the IAU in
-1994 contains an appendix describing an alternate convention for
-specifying arrays of fixed or variable length strings in a binary table
-character column (with the form 'rA:SSTRw/nnn)'.  This appendix was not
-officially voted on by the IAU and hence is still provisional.  CFITSIO
-does not currently support this proposal.
 
- 
-\subsection{Keyword Units Strings}
+\begin{description}
+\item[1 ] Evaluate a boolean expression over the indicated rows, returning an
+ array of flags indicating which rows evaluated to TRUE/FALSE  \label{fffrow}
+\end{description}
 
-One deficiency of the current FITS Standard is that it does not define
-a specific convention for recording the physical units of a keyword
-value.  The TUNITn keyword can be used to specify the physical units of
-the values in a table column, but there is no analogous convention for
-keyword values.  The comment field of the keyword is often used for
-this purpose, but the units are usually not specified in a well defined
-format that FITS readers can easily recognize and extract.
+\begin{verbatim}
+  int fits_find_rows / fffrow
+      (fitsfile *fptr,  char *expr, long firstrow, long nrows,
+      > long *n_good_rows, char *row_status,  int *status)
+\end{verbatim}
 
-To solve this deficiency, CFITSIO uses a local convention in which the
-keyword units are enclosed in square brackets as the first token in the
-keyword comment field; more specifically, the opening square bracket
-immediately follows the slash '/' comment field delimiter and a single
-space character.  The following examples illustrate keywords that use
-this convention:
+\begin{description}
+\item[2 ] Find the first row which satisfies the input boolean expression \label{ffffrw}
+\end{description}
 
- 
 \begin{verbatim}
-EXPOSURE=               1800.0 / [s] elapsed exposure time
-V_HELIO =                16.23 / [km s**(-1)] heliocentric velocity
-LAMBDA  =                5400. / [angstrom] central wavelength
-FLUX    = 4.9033487787637465E-30 / [J/cm**2/s] average flux
+  int fits_find_first_row / ffffrw
+      (fitsfile *fptr,  char *expr, > long *rownum, int *status)
 \end{verbatim}
 
-In general, the units named in the IAU(1988) Style Guide are
-recommended, with the main exception that the preferred unit for angle
-is 'deg' for degrees.
+\begin{description}
+\item[3 ]Evaluate an expression on all rows of a table.  If the input and output
+files are not the same, copy the TRUE rows to the output file.  If the
+files are the same, delete the FALSE rows (preserve the TRUE rows). \label{ffsrow}
+\end{description}
 
-The fits\_read\_key\_unit and fits\_write\_key\_unit routines in
-CFITSIO read and write, respectively, the keyword unit strings in an
-existing keyword.
+\begin{verbatim}
+  int fits_select_rows / ffsrow
+      (fitsfile *infptr, fitsfile *outfptr,  char *expr,  > int *status )
+\end{verbatim}
 
- 
-\subsection{HIERARCH Convention for Extended Keyword Names}
+\begin{description}
+\item[4 ] Calculate an expression for the indicated rows of a table, returning
+the results, cast as datatype (TSHORT, TDOUBLE, etc), in array.  If
+nulval==NULL, UNDEFs will be zeroed out.  For vector results, the number
+of elements returned may be less than nelements if nelements is not an
+even multiple of the result dimension.  Call fits\_test\_expr to obtain
+the dimensions of the results.  \label{ffcrow}
+\end{description}
 
-CFITSIO supports the HIERARCH keyword convention which allows keyword
-names that are longer then 8 characters and may contain the full range
-of printable ASCII text characters.  This convention
-was developed at the European Southern Observatory (ESO)  to support
-hierarchical FITS keyword such as:
- 
 \begin{verbatim}
-HIERARCH ESO INS FOCU POS = -0.00002500 / Focus position
+  int fits_calc_rows / ffcrow
+      (fitsfile *fptr,  int datatype, char *expr, long firstrow,
+       long nelements, void *nulval, > void *array,  int *anynul, int *status)
 \end{verbatim}
-Basically, this convention uses the FITS keyword 'HIERARCH' to indicate
-that this convention is being used, then the actual keyword name
-({\tt'ESO INS FOCU POS'} in this example) begins in column 10 and can
-contain any printable ASCII text characters, including spaces.  The
-equals sign marks the end of the keyword name and is followed by the
-usual value and comment fields just as in standard FITS keywords.
-Further details of this convention are described at
-http://arcdev.hq.eso.org/dicb/dicd/dic-1-1.4.html (search for
-HIERARCH).
 
-This convention allows a much broader range of keyword names
-than is allowed by the FITS Standard.  Here are more examples
-of such keywords:
- 
+\begin{description}
+\item[5 ]Evaluate an expression and write the result either to a column (if
+the expression is a function of other columns in the table) or to a
+keyword (if the expression evaluates to a constant and is not a
+function of other columns in the table).  In the former case, the
+parName parameter is the name of the column (which may or may not already
+exist) into which to write the results, and parInfo contains an
+optional TFORM keyword value if a new column is being created.  If a
+TFORM value is not specified then a default format will be used,
+depending on the expression.  If the expression evaluates to a constant,
+then the result will be written to the keyword name given by the
+parName parameter, and the parInfo parameter may be used to supply an
+optional comment for the keyword.  If the keyword does not already
+exist, then the name of the keyword must be preceded with a '\#' character,
+otherwise the result will be written to a column with that name.
+ \label{ffcalc}
+\end{description}
+
 \begin{verbatim}
-HIERARCH LongKeyword = 47.5 / Keyword has > 8 characters, and mixed case
-HIERARCH XTE$TEMP = 98.6 / Keyword contains the '$' character
-HIERARCH Earth is a star = F / Keyword contains embedded spaces
+  int fits_calculator / ffcalc
+      (fitsfile *infptr, char *expr, fitsfile *outfptr, char *parName,
+       char *parInfo, >  int *status)
 \end{verbatim}
-CFITSIO will transparently read and write these keywords, so application
-programs do not in general need to know anything about the specific
-implementation details of the HIERARCH convention.  In particular,
-application programs do not need to specify the `HIERARCH' part of the
-keyword name when reading or writing keywords (although it
-may be included if desired).  When writing a keyword, CFITSIO first
-checks to see if the keyword name is legal as a standard FITS keyword
-(no more than 8 characters long and containing only letters, digits, or
-a minus sign or underscore). If so it writes it as a standard FITS
-keyword, otherwise it uses the hierarch convention to write the
-keyword.   The maximum keyword name length is 67 characters, which
-leaves only 1 space for the value field.  A more practical limit is
-about 40 characters, which leaves enough room for most keyword values.
-CFITSIO returns an error if there is not enough room for both the
-keyword name and the keyword value on the 80-character card, except for
-string-valued keywords which are simply truncated so that the closing
-quote character falls in column 80.  In the current implementation,
-CFITSIO preserves the case of the letters when writing the keyword
-name, but it is case-insensitive when reading or searching for a
-keyword.  The current implementation allows any ASCII text character
-(ASCII 32 to ASCII 126) in the keyword name except for the '='
-character.  A space is also required on either side of the equal sign.
 
- 
-\section{Optimizing Code for Maximum Processing Speed}
+\begin{description}
+\item[6 ] This calculator routine is similar to the previous routine, except
+that the expression is only evaluated over the specified
+row ranges.  nranges specifies the number of row ranges, and firstrow
+and lastrow give the starting and ending row number of each range.
+ \label{ffcalcrng}
+\end{description}
 
-CFITSIO has been carefully designed to obtain the highest possible
-speed when reading and writing FITS files.  In order to achieve the
-best performance, however, application programmers must be careful to
-call the CFITSIO routines appropriately and in an efficient sequence;
-inappropriate usage of CFITSIO routines can greatly slow down the
-execution speed of a program.
+\begin{verbatim}
+  int fits_calculator_rng / ffcalc_rng
+      (fitsfile *infptr, char *expr, fitsfile *outfptr, char *parName,
+       char *parInfo, int nranges, long *firstrow, long *lastrow
+       >  int *status)
+\end{verbatim}
 
-The maximum possible I/O speed of CFITSIO depends of course on the type
-of computer system that it is running on.  As a rough guide, the
-current generation of workstations can achieve speeds of 2 -- 10 MB/s
-when reading or writing FITS images and similar, or slightly slower
-speeds with FITS binary tables.  Reading of FITS files can occur at
-even higher rates (30MB/s or more) if the FITS file is still cached in
-system memory following a previous read or write operation on the same
-file.  To more accurately predict the best performance that is possible
-on any particular system, a diagnostic program called ``speed.c'' is
-included with the CFITSIO distribution which can be run to
-approximately measure the maximum possible speed of writing and reading
-a test FITS file.
 
-The following 2 sections provide some background on how CFITSIO
-internally manages the data I/O and describes some strategies that may
-be used to optimize the processing speed of software that uses
-CFITSIO.
+\begin{description}
+\item[7 ]Evaluate the given expression and return information on the result. \label{fftexp}
+\end{description}
 
- 
-\subsection{Background Information: How CFITSIO Manages Data I/O}
+\begin{verbatim}
+  int fits_test_expr / fftexp
+      (fitsfile *fptr, char *expr, > int *datatype, long *nelem, int *naxis,
+       long *naxes, int *status)
+\end{verbatim}
 
-Many CFITSIO operations involve transferring only a small number of
-bytes to or from the FITS file (e.g, reading a keyword, or writing a
-row in a table); it would be very inefficient to physically read or
-write such small blocks of data directly in the FITS file on disk,
-therefore CFITSIO maintains a set of internal Input--Output (IO)
-buffers in RAM memory that each contain one FITS block (2880 bytes) of
-data.  Whenever CFITSIO needs to access data in the FITS file, it first
-transfers the FITS block containing those bytes into one of the IO
-buffers in memory.  The next time CFITSIO needs to access bytes in the
-same block it can then go to the fast IO buffer rather than using a
-much slower system disk access routine.  The number of available IO
-buffers is determined by the NIOBUF parameter (in fitsio2.h) and is
-currently set to 25.
 
-Whenever CFITSIO reads or writes data it first checks to see if that
-block of the FITS file is already loaded into one of the IO buffers.
-If not, and if there is an empty IO buffer available, then it will load
-that block into the IO buffer (when reading a FITS file) or will
-initialize a new block (when writing to a FITS file).  If all the IO
-buffers are already full, it must decide which one to reuse (generally
-the one that has been accessed least recently), and flush the contents
-back to disk if it has been modified before loading the new block.
 
-The one major exception to the above process occurs whenever a large
-contiguous set of bytes are accessed, as might occur when reading or
-writing a FITS image.  In this case CFITSIO bypasses the internal IO
-buffers and simply reads or writes the desired bytes directly in the
-disk file with a single call to a low-level file read or write
-routine.  The minimum threshold for the number of bytes to read or
-write this way is set by the MINDIRECT parameter and is currently set
-to 3 FITS blocks = 8640 bytes.  This is the most efficient way to read
-or write large chunks of data and can achieve IO transfer rates of
-5 -- 10MB/s or greater.  Note that this fast direct IO process is not
-applicable when accessing columns of data in a FITS table because the
-bytes are generally not contiguous since they are interleaved by the
-other columns of data in the table.  This explains why the speed for
-accessing FITS tables is generally slower than accessing
-FITS images.
+\section{Utility Routines}
 
-Given this background information, the general strategy for efficiently
-accessing FITS files should now be apparent:  when dealing with FITS
-images, read or write large chunks of data at a time so that the direct
-IO mechanism will be invoked;  when accessing FITS headers or FITS
-tables, on the other hand, once a particular FITS block has been
-loading into one of the IO buffers, try to access all the needed
-information in that block before it gets flushed out of the IO buffer.
-It is important to avoid the situation where the same FITS block is
-being read then flushed from a IO buffer multiple times.
 
-The following section gives more specific suggestions for optimizing
-the use of CFITSIO.
+\subsection{File Checksum Routines}
 
- 
-\subsection{Optimization Strategies}
+The following routines either compute or validate the checksums for the
+CHDU.  The DATASUM keyword is used to store the numerical value of the
+32-bit, 1's complement checksum for the data unit alone.  If there is
+no data unit then the value is set to zero. The numerical value is
+stored as an ASCII string of digits, enclosed in quotes, because the
+value may be too large to represent as a 32-bit signed integer.  The
+CHECKSUM keyword is used to store the ASCII encoded COMPLEMENT of the
+checksum for the entire HDU.  Storing the complement, rather than the
+actual checksum, forces the checksum for the whole HDU to equal zero.
+If the file has been modified since the checksums were computed, then
+the HDU checksum will usually not equal zero.  These checksum keyword
+conventions are based on a paper by Rob Seaman published in the
+proceedings of the ADASS IV conference in Baltimore in November 1994
+and a later revision in June 1995.  See Appendix B for the definition
+of the parameters used in these routines.
 
-1.  When dealing with a FITS primary array or IMAGE extension, it is
-more efficient to read or write large chunks of the  image at a time
-(at least 3 FITS blocks = 8640 bytes) so that the direct IO mechanism
-will be used as described in the previous section.  Smaller chunks of
-data are read or written via the IO buffers, which is somewhat less
-efficient because of the extra copy operation and additional
-bookkeeping steps that are required.  In principle it is more efficient
-to read or write as big an array of image pixels at one time as
-possible, however, if the array becomes so large that the operating
-system cannot store it all in RAM, then the performance may be degraded
-because of the increased swapping of virtual memory to disk.
 
-2.  When dealing with FITS tables, the most important efficiency factor
-in the software design is to read or write the data in the FITS file in
-a single pass through the file.  An example of poor program design
-would be to read a large, 3-column table by sequentially reading the
-entire first column, then going back to read the 2nd column, and
-finally the 3rd column; this obviously requires 3 passes through the
-file which could triple the execution time of an IO limited program.
-For small tables this is not important, but when reading multi-megabyte
-sized tables these inefficiencies can become significant.  The more
-efficient procedure in this case is to read or write only as many rows
-of the table as will fit into the available internal IO buffers, then
-access all the necessary columns of data within that range of rows.
-Then after the program is completely finished with the data in those
-rows it can move on to the next range of rows that will fit in the
-buffers, continuing in this way until the entire file has been
-processed.  By using this procedure of accessing all the columns of a
-table in parallel rather than sequentially, each block of the FITS file
-will only be read or written once.
+\begin{description}
+\item[1 ] Compute and write the DATASUM and CHECKSUM keyword values for the CHDU
+    into the current header.  If the keywords already exist, their values
+    will be updated only if necessary (i.e., if the file
+    has been modified since the original keyword
+   values were computed). \label{ffpcks}
+\end{description}
 
-The optimal number of rows to read or write at one time in a given
-table depends on the width of the table row, on the number of IO
-buffers that have been allocated in CFITSIO, and also on the number of
-other FITS files that are open at the same time (since one IO buffer is
-always reserved for each open FITS file).  Fortunately, a CFITSIO
-routine is available that will return the optimal number of rows for a
-given table:  fits\_get\_rowsize.  It is not critical to use exactly
-the value of nrows returned by this routine, as long as one does not
-exceed it.  Using a very small value however can also lead to poor
-performance because of the overhead from the larger number of
-subroutine calls.
+\begin{verbatim}
+  int fits_write_chksum / ffpcks
+      (fitsfile *fptr, > int *status)
+\end{verbatim}
 
-The optimal number of rows returned by fits\_get\_rowsize is valid only
-as long as the application program is only reading or writing data in
-the specified table.  Any other calls to access data in the table
-header or in any other FITS file would  cause additional blocks of data
-to be loaded into the IO buffers displacing data from the original
-table, and should be avoided during the critical period while the table
-is being read or written.
+\begin{description}
+\item[2 ] Update the CHECKSUM keyword value in the CHDU, assuming that the
+    DATASUM keyword exists and already has the correct value.  This routine
+    calculates the new checksum for the current header unit, adds it to the
+    data unit checksum, encodes the value into an ASCII string, and writes
+   the string to the CHECKSUM keyword. \label{ffupck}
+\end{description}
 
-Occasionally it is necessary to simultaneously access more than one
-FITS table, for example when transferring values from an input table to
-an output table.  In cases like this, one should call
-fits\_get\_rowsize to get the optimal number of rows for each table
-separately, than reduce the number of rows proportionally.  For
-example, if the optimal number of rows in the input table is 3600 and
-is 1400 in the output table, then these values should be cut in half to
-1800 and 700, respectively, if both tables are going to be accessed at
-the same time.
+\begin{verbatim}
+  int fits_update_chksum / ffupck
+      (fitsfile *fptr, > int *status)
+\end{verbatim}
 
-3.  Use binary table extensions rather than ASCII table
-extensions for better efficiency  when dealing with tabular data.  The
-I/O to ASCII tables is slower because of the overhead in formatting or
-parsing the ASCII data fields and because ASCII tables are about twice
-as large as binary tables with the same information content.
+\begin{description}
+\item[3 ] Verify the CHDU by computing the checksums and comparing
+    them with the keywords.  The data unit is verified correctly
+    if the computed checksum equals the value of the DATASUM
+    keyword.  The checksum for the entire HDU (header plus data unit) is
+    correct if it equals zero.  The output DATAOK and HDUOK parameters
+    in this routine are integers which will have a value = 1
+    if the data or HDU is verified correctly, a value = 0
+    if the DATASUM or CHECKSUM keyword is not present, or value = -1
+   if the computed checksum is not correct. \label{ffvcks}
+\end{description}
 
-4. Design software so that it reads the FITS header keywords in the
-same order in which they occur in the file.  When reading keywords,
-CFITSIO searches forward starting from the position of the last keyword
-that was read.  If it reaches the end of the header without finding the
-keyword, it then goes back to the start of the header and continues the
-search down to the position where it started.  In practice, as long as
-the entire FITS header can fit at one time in the available internal IO
-buffers, then the header keyword access will be very fast and it makes
-little difference which order they are accessed.
+\begin{verbatim}
+  int fits_verify_chksum / ffvcks
+      (fitsfile *fptr, > int *dataok, int *hduok, int *status)
+\end{verbatim}
 
-5. Avoid the use of scaling (by using the BSCALE and BZERO or TSCAL and
-TZERO keywords) in FITS files since the scaling operations add to the
-processing time needed to read or write the data.  In some cases it may
-be more efficient to temporarily turn off the scaling (using fits\_set\_bscale or
-fits\_set\_tscale) and then read or write the raw unscaled values in the FITS
-file.
+\begin{description}
+\item[4 ] Compute and return the checksum values for the CHDU
+    without creating or modifying the
+    CHECKSUM and DATASUM keywords.  This routine is used internally by
+   ffvcks, but may be useful in other situations as well. \label{ffgcks}
+\end{description}
 
-6. Avoid using the `implicit datatype conversion' capability in
-CFITSIO.  For instance, when reading a FITS image with BITPIX = -32
-(32-bit floating point pixels), read the data into a single precision
-floating point data array in the program.  Forcing CFITSIO to convert
-the data to a different datatype can slow the program.
+\begin{verbatim}
+  int fits_get_chksum/ /ffgcks
+      (fitsfile *fptr, > unsigned long *datasum, unsigned long *hdusum,
+       int *status)
+\end{verbatim}
 
-7. Where feasible, design FITS binary tables using vector column
-elements so that the data are written as a contiguous set of bytes,
-rather than as single elements in multiple rows.  For example, it is
-faster to access the data in a table that contains a single row
-and 2 columns with TFORM keywords equal to  '10000E' and '10000J', than
-it is to access the same amount of data in a table with 10000 rows
-which has columns with the TFORM keywords equal to '1E' and '1J'.  In
-the former case the 10000 floating point values in the first column are
-all written in a contiguous block of the file which can be read or
-written quickly, whereas in the second case each floating point value
-in the first column is interleaved with the integer value in the second
-column of the same row so CFITSIO has to explicitly move to the
-position of each element to be read or written.
+\begin{description}
+\item[5 ] Encode a checksum value
+    into a 16-character string.  If complm is non-zero (true) then the 32-bit
+   sum value will be complemented before encoding. \label{ffesum}
+\end{description}
 
-8. Avoid the use of variable length vector columns in binary tables,
-since any reading or writing of these data requires that CFITSIO first
-look up or compute the starting address of each row of data in the
-heap.
+\begin{verbatim}
+  int fits_encode_chksum / ffesum
+      (unsigned long sum, int complm, > char *ascii);
+\end{verbatim}
 
-9. When copying data from one FITS table to another, it is faster to
-transfer the raw bytes instead of reading then writing each column of
-the table.  The CFITSIO routines fits\_read\_tblbytes and
-fits\_write\_tblbytes will perform low-level reads or writes of any
-contiguous range of bytes in a table extension.  These routines can be
-used to read or write a whole row (or multiple rows  for even greater
-efficiency) of a table with a single function call.   These routines
-are fast because they bypass all the usual data scaling, error checking
-and machine dependent data conversion that is normally done by CFITSIO,
-and they allow the program to write the data to the output file in
-exactly the same byte order.  For these same reasons, these routines
-can corrupt the FITS data file if used incorrectly because no
-validation or machine dependent conversion is performed by these
-routines.  These routines are only recommended for optimizing critical
-pieces of code and should only be used by programmers who thoroughly
-understand the internal format of the FITS tables they are reading or
-writing.
+\begin{description}
+\item[6 ] Decode a 16-character checksum string into a unsigned long value.
+    If is non-zero (true). then the 32-bit sum value will be complemented
+    after decoding.  The checksum value is also returned as the
+   value of the function. \label{ffdsum}
+\end{description}
 
-10. Another strategy for improving the speed of writing a FITS table,
-similar to the previous one, is to directly construct the entire byte
-stream for a whole table row (or multiple rows) within the application
-program and then write it to the FITS file with
-fits\_write\_tblbytes.  This avoids all the overhead normally present
-in the column-oriented CFITSIO write routines.  This technique should
-only be used for critical applications, because it makes the code more
-difficult to understand and maintain, and it makes the code more system
-dependent (e.g., do the bytes need to be swapped before writing to the
-FITS file?).
+\begin{verbatim}
+  unsigned long fits_decode_chksum / ffdsum
+           (char *ascii, int complm, > unsigned long *sum);
+\end{verbatim}
 
-11.  Finally, external factors such as the type of magnetic disk
-controller (SCSI or IDE), the size of the disk cache, the average seek
-speed of the disk, the amount of disk fragmentation, and the amount of
-RAM available on the system can all have a significant impact on
-overall I/O efficiency.  For critical applications, a system
-administrator should review the proposed system hardware to identify any
-potential I/O bottlenecks.
 
-
-\chapter{ The CFITSIO Iterator Function }
+\subsection{Date and Time Utility Routines}
 
-The fits\_iterate\_data function in CFITSIO provides a unique method of
-executing an arbitrary user-supplied `work' function that operates on
-rows of data in  FITS tables or on pixels in FITS images.  Rather than
-explicitly reading and writing the FITS images or columns of data, one
-instead calls the CFITSIO iterator routine, passing to it the name of
-the user's work function that is to be executed along with a list of
-all the table columns or image arrays that are to be passed to the work
-function.  The CFITSIO iterator function then does all the work of
-allocating memory for the arrays, reading the input data from the FITS
-file, passing them to the work function, and then writing any output
-data back to the FITS file after the work function exits.  Because
-it is often more efficient to process only a subset of the total table
-rows at one time, the iterator function can determine the optimum
-amount of data to pass in each iteration and repeatly call the work
-function until the entire table been processed.
+The following routines help to construct or parse the FITS date/time
+strings.   Starting in the year 2000, the FITS DATE keyword values (and
+the values of other `DATE-' keywords) must have the form 'YYYY-MM-DD'
+(date only) or 'YYYY-MM-DDThh:mm:ss.ddd...' (date and time) where the
+number of decimal places in the seconds value is optional.  These times
+are in UTC.  The older 'dd/mm/yy' date format may not be used for dates
+after 01 January 2000.  See Appendix B for the definition of the
+parameters used in these routines.
 
-For many applications this single CFITSIO iterator function can
-effectively replace all the other CFITSIO routines for reading or
-writing data in FITS images or tables.  Using the iterator has several
-important advantages over the traditional method of reading and writing
-FITS data files:
 
-\begin{itemize}
-\item
-It cleanly separates the data I/O from the routine that operates on
-the data.  This leads to a more modular and `object oriented'
-programming style.
+\begin{description}
+\item[1 ] Get the current system date.  C already provides standard
+    library routines for getting the current date and time,
+    but this routine is provided for compatibility with
+    the Fortran FITSIO library.  The returned year has 4 digits
+    (1999, 2000, etc.) \label{ffgsdt}
+\end{description}
 
-\item
-It simplifies the application program by eliminating the need to allocate
-memory for the data arrays and eliminates most of the calls to the CFITSIO
-routines that explicitly read and write the data.
+\begin{verbatim}
+  int fits_get_system_date/ffgsdt
+      ( > int *day, int *month, int *year, int *status )
+\end{verbatim}
 
-\item
-It ensures that the data are processed as efficiently as possible.
-This is especially important when processing tabular data since
-the iterator function will calculate the most efficient number
-of rows in the table to be passed at one time to the user's work
-function on each iteration.
 
-\item
-Makes it possible for larger projects to develop a library of work
-functions that all have a uniform calling sequence and are all
-independent of the details of the FITS file format.
+\begin{description}
+\item[2 ] Get the current system date and time string ('YYYY-MM-DDThh:mm:ss').
+The time will be in UTC/GMT if available, as indicated by a returned timeref
+value = 0.  If the returned value of timeref = 1 then this indicates that
+it was not possible to convert the local time to UTC, and thus the local
+time was returned.
+\end{description}
 
-\end{itemize}
+\begin{verbatim}
+  int fits_get_system_time/ffgstm
+      (> char *datestr, int  *timeref, int *status)
+\end{verbatim}
 
-There are basically 2 steps in using the CFITSIO iterator function.
-The first step is to design the work function itself which must have a
-prescribed set of input parameters.  One of these parameters is a
-structure containing pointers to the arrays of data; the work function
-can perform any desired operations on these arrays and does not need to
-worry about how the input data were read from the file or how the
-output data get written back to the file.
 
-The second step is to design the driver routine that opens all the
-necessary FITS files and initializes  the input parameters to the
-iterator function.  The driver program calls the CFITSIO iterator
-function which then reads the data and passes it to the user's work
-function.
+\begin{description}
+\item[3 ] Construct a date string from the input date values.  If the year
+is between 1900 and 1998, inclusive, then the returned date string will
+have the old FITS format ('dd/mm/yy'), otherwise the date string will
+have the new FITS format ('YYYY-MM-DD').  Use fits\_time2str instead
+ to always return a date string using the new FITS format. \label{ffdt2s}
+\end{description}
 
-The following 2 sections describe these steps in more detail.  There
-are also several example programs included with the CFITSIO
-distribution which illustrate how to use the iterator function.
+\begin{verbatim}
+  int fits_date2str/ffdt2s
+      (int year, int month, int day, > char *datestr, int *status)
+\end{verbatim}
 
- 
-\section{The Iterator Work Function}
 
-The user-supplied iterator work function must have the following set of
-input parameters (the function can be given any desired name):
+\begin{description}
+\item[4 ] Construct a new-format date + time string ('YYYY-MM-DDThh:mm:ss.ddd...').
+  If the year, month, and day values all = 0 then only the time is encoded
+  with format 'hh:mm:ss.ddd...'.  The decimals parameter specifies how many
+  decimal places of fractional seconds to include in the string.  If `decimals'
+ is negative, then only the date will be return ('YYYY-MM-DD').
+\end{description}
 
- 
 \begin{verbatim}
-  int user_fn( long totaln, long offset, long firstn, long nvalues,
-               int narrays, iteratorCol *data,  void *userPointer )
+  int fits_time2str/fftm2s
+      (int year, int month, int day, int hour, int minute, double second,
+      int decimals, > char *datestr, int *status)
 \end{verbatim}
 
-\begin{itemize}
 
-\item
-  totaln -- the total number of table rows or image pixels
-            that will be passed to the work function
-            during 1 or more iterations.
+\begin{description}
+\item[5 ] Return the date as read from the input string, where the string may be
+in either the old ('dd/mm/yy')  or new ('YYYY-MM-DDThh:mm:ss' or
+'YYYY-MM-DD') FITS format.  Null pointers may be supplied for any
+  unwanted output date parameters.
+\end{description}
 
-\item
-  offset     -- the offset applied to the first table row or image
-                pixel to be passed to the work function.  In other
-                words, this is the number of rows or pixels that
-                are skipped over before starting the iterations. If
-                offset = 0, then all the table rows or image pixels
-                will be passed to the work function.
+\begin{verbatim}
+  int fits_str2date/ffs2dt
+      (char *datestr, > int *year, int *month, int *day, int *status)
+\end{verbatim}
 
-\item
-  firstn     -- the number of the first table row or image pixel
-                (starting with 1)  that is being passed in this
-                particular call to the work function.
 
-\item
-  nvalues    -- the number of table rows or image pixels that are
-                being passed in this particular call to the work
-                function.  nvalues will always be less than or
-                equal to totaln and will have the same value on
-                each iteration, except possibly on the last
-                call which may have a smaller value.
+\begin{description}
+\item[6 ] Return the date and time as read from the input string, where the
+string may be in either the old  or new FITS format.  The returned hours,
+minutes, and seconds values will be set to zero if the input string
+does not include the time ('dd/mm/yy' or 'YYYY-MM-DD') .  Similarly,
+the returned year, month, and date values will be set to zero if the
+date is not included in the input string ('hh:mm:ss.ddd...').  Null
+pointers may be supplied for any unwanted output date and time
+parameters.
+\end{description}
 
-\item
-  narrays     -- the number of arrays of data that are being passed
-                 to the work function.  There is one array for each
-                 image or table column.
+\begin{verbatim}
+  int fits_str2time/ffs2tm
+      (char *datestr, > int *year, int *month, int *day, int *hour,
+      int *minute, double *second, int *status)
+\end{verbatim}
 
-\item
-  *data   -- array of structures, one for each
-             column or image.  Each structure contains a pointer
-             to the array of data as well as other descriptive
-             parameters about that array.
 
-\item
-  *userPointer -- a user supplied pointer that can be used
-                 to pass ancillary information from the driver function
-                 to the work function.
-                 This pointer is passed to the CFITSIO iterator function
-                 which then passes it on to the
-                 work function without any modification.
-                 It may point to a single number, to an array of values,
-                 to a structure containing an arbitrary set of parameters
-                 of different types,
-                 or it may be a null pointer if it is not needed.
-                 The work function must cast this pointer to the
-                 appropriate data type before using it it.
-\end{itemize}
+\subsection{General Utility Routines}
 
-The totaln, offset, narrays, data, and userPointer parameters are
-guaranteed to have the same value on each iteration.  Only firstn,
-nvalues, and the arrays of data pointed to by the data structures may
-change on each iterative call to the work function.
+The following utility routines may be useful for certain applications.
 
-Note that the iterator treats an image as a long 1-D array of pixels
-regardless of it's intrinsic dimensionality.  The total number of
-pixels is just the product of the size of each dimension, and the order
-of the pixels is the same as the order that they are stored in the FITS
-file. If the work function needs to know the number and size of the
-image dimensions then these parameters can be passed via the
-userPointer structure.
 
-The iteratorCol structure is currently defined as follows:
- 
+\begin{description}
+\item[1 ] Return the revision number of the CFITSIO library.
+    The revision number will be incremented with each new
+   release of CFITSIO. \label{ffvers}
+\end{description}
+
 \begin{verbatim}
-typedef struct  /* structure for the iterator function column information */
-{
-   /* structure elements required as input to fits_iterate_data: */
+  float fits_get_version / ffvers ( > float *version)
+\end{verbatim}
 
-  fitsfile *fptr;       /* pointer to the HDU containing the column or image */
-  int      colnum;      /* column number in the table; ignored for images    */
-  char     colname[70]; /* name (TTYPEn) of the column; null for images      */
-  int      datatype;    /* output datatype (converted if necessary) */
-  int      iotype;      /* type: InputCol, InputOutputCol, or OutputCol */
+\begin{description}
+\item[2 ] Write an 80-character message to the CFITSIO error stack.  Application
+    programs should not normally write to the stack, but there may be
+   some situations where this is desirable. \label{ffpmsg}
+\end{description}
 
-  /* output structure elements that may be useful for the work function: */
+\begin{verbatim}
+  void fits_write_errmsg / ffpmsg (char *err_msg)
+\end{verbatim}
 
-  void     *array;    /* pointer to the array (and the null value) */
-  long     repeat;    /* binary table vector repeat value; set     */
-                      /*     equal to 1 for images                 */
-  long     tlmin;     /* legal minimum data value, if any          */
-  long     tlmax;     /* legal maximum data value, if any          */
-  char     unit[70];  /* physical unit string (BUNIT or TUNITn)    */
-  char     tdisp[70]; /* suggested display format; null if none    */
+\begin{description}
+\item[3 ] Convert a character string to uppercase (operates in place). \label{ffupch}
+\end{description}
 
-} iteratorCol;
+\begin{verbatim}
+  void fits_uppercase / ffupch (char *string)
 \end{verbatim}
 
-Instead of directly reading or writing the elements in this structure,
-it is recommended that programmers use the access functions that are
-provided for this purpose.
+\begin{description}
+\item[4 ]  Compare the input template string against the reference string
+    to see if they match.  The template string may contain wildcard
+    characters: '*' will match any sequence of characters (including
+    zero characters) and '\%' will match any single character in the
+    reference string.  If casesen = CASESEN = TRUE then the match will be
+    case sensitive, otherwise the case of the letters will be ignored
+    if casesen = CASEINSEN = FALSE.  The returned MATCH parameter will be
+    TRUE if the 2 strings match, and EXACT will be TRUE if the match is
+    exact (i.e., if no wildcard characters were used in the match).
+   Both strings must be 68 characters or less in length. \label{ffcmps}
+\end{description}
 
-The first five elements in this structure must be initially defined by
-the driver routine before calling the iterator routine.  The CFITSIO
-iterator routine uses this information to determine what column or
-array to pass to the work function, and whether the array is to be
-input to the work function, output from the work function, or both.
-The CFITSIO iterator function fills in the values of the remaining
-structure elements before passing it to the work function.
+\begin{verbatim}
+  void fits_compare_str / ffcmps
+       (char *templt, char *string, int casesen, > int *match, int *exact)
+\end{verbatim}
 
-The array structure element is a pointer to the actual data array and
-it must be cast to the correct data type before it is used.  The
-`repeat' structure element give the number of data values in each row
-of the table, so that the total number of data values in the array is
-given by repeat * nvalues.  In the case of image arrays and ASCII
-tables, repeat will always be equal to 1.  When the datatype is a
-character string, the array pointer is actually a pointer to an array
-of string pointers (i.e., char **array).  The other output structure
-elements are provided for convenience in case that information is
-needed within the work function.  Any other information may be passed
-from the driver routine to the work function via the userPointer
-parameter.
+\begin{description}
+\item[5 ]Split a string containing a list of names (typically file names or column
+   names) into individual name tokens by a sequence of calls to
+   fits\_split\_names.  The names in the list must be delimited by a comma
+   and/or spaces.  This routine ignores spaces and commas that occur
+   within parentheses, brackets, or curly brackets.  It also strips any
+   leading and trailing blanks from the returned name.
 
-Upon completion, the work routine must return an integer status value,
-with 0 indicating success and any other value indicating an error which
-will cause the iterator function to immediately exit at that point.  Return status
-values in the range 1 -- 1000 should be avoided since these are
-reserved for use by CFITSIO.  A return status value of -1 may be used to
-force the CFITSIO iterator function to stop at that point and return
-control to the driver routine after writing any output arrays to the
-FITS file.  CFITSIO does not considered this to be an error condition,
-so any further processing by the application program will continue normally.
+   This routine is similar to the ANSI C 'strtok' function:
 
- 
-\section{The Iterator Driver Function}
+   The first call to fits\_split\_names has a non-null input string.
+   It finds the first name in the string and terminates it by overwriting
+   the next character of the string with a null terminator and returns a
+   pointer to the name.  Each subsequent call, indicated by a NULL value
+   of the input string, returns the next name, searching from just past
+   the end of the previous name.  It returns NULL when no further names
+  are found.  \label{splitnames}
+\end{description}
 
-The iterator driver function must open the necessary FITS files and
-position them to the correct HDU.  It must also initialize the following
-parameters in the iteratorCol structure (defined above) for each
-column or image before calling the CFITSIO iterator function.
-Several `constructor' routines are provided in CFITSIO for this
-purpose.
+\begin{verbatim}
+   char *fits_split_names(char *namelist)
+\end{verbatim}
+   The following example shows how a string would be split into 3 names:
 
-\begin{itemize}
-\item
-  *fptr --  The fitsfile pointer to the table or image.
-\item
-colnum -- the number of the column in the table.  This value is ignored
-          in the case of images.  If colnum equals 0, then the column name
-          will be used to identify the column to be passed to the
-          work function.
+\begin{verbatim}
+    myfile[1][bin (x,y)=4], file2.fits  file3.fits
+    ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^  ^^^^^^^^^^
+        1st name             2nd name    3rd name
+\end{verbatim}
 
-\item
-colname -- the name (TTYPEn keyword) of the column.  This is
-           only required if colnum = 0 and is ignored for images.
-\item
-datatype -- The desired datatype of the array to be passed to the
-            work function.  For numerical data the datatype does
-            not need to be the same as the actual datatype in the
-            FITS file, in which case CFITSIO will do the conversion.
-            Allowed values are: TSTRING, TLOGICAL, TBYTE, TSHORT, TUSHORT,
-            TINT, TLONG, TULONG, TFLOAT, TDOUBLE.  If the input
-            value of datatype equals 0, then the  existing
-            datatype of the column or image will be used without
-            any conversion.
+\begin{description}
+\item[6 ] Test that the keyword name contains only legal characters (A-Z,0-9,
+    hyphen, and underscore) or that the keyword record contains only legal
+   printable ASCII characters  \label{fftkey} \label{fftrec}
+\end{description}
 
-\item
-iotype -- defines whether the data array is to be input to the
-          work function (i.e, read from the FITS file), or output
-          from the work function (i.e., written to the FITS file) or
-          both.  Allowed values are InputCol, OutputCol, or InputOutputCol.
-\end{itemize}
-
-After the driver routine has initialized all these parameters, it
-can then call the CFITSIO iterator function:
-
- 
 \begin{verbatim}
-  int fits_iterate_data(int narrays, iteratorCol *data, long offset,
-      long nPerLoop, int (*workFn)( ), void *userPointer, int *status);
-\end{verbatim}
-
-\begin{itemize}
-\item
-
-   narrays    -- the number of columns or images that are to be passed
-                 to the work function.
-\item
-   *data --     pointer to array of structures containing information
-                about each column or image.
-
-\item
-   offset      -- if positive, this number of rows at the
-                      beginning of the table (or pixels in the image)
-                      will be skipped and will not be passed to the work
-                      function.
-
-\item
-   nPerLoop   - specifies the number of table rows (or number of
-                    image pixels) that are to be passed to the work
-                    function on each iteration.  If nPerLoop = 0
-                    then CFITSIO will calculate the optimum number
-                    for greatest efficiency.
-                    If nPerLoop is negative, then all the rows
-                    or pixels will be passed at one time, and the work
-                    function will only be called once.
-
-\item
-   *workFn     - the name (actually the address) of the work function
-                 that is to be called by fits\_iterate\_data.
-
-\item
-   *userPointer - this is a user supplied pointer that can be used
-                  to pass ancillary information from the driver routine
-                  to the work function.  It may point to a single number,
-                  an array, or to a structure containing an arbitrary set
-                  of parameters.
-
-\item
-   *status      - The CFITSIO error status.  Should = 0 on input;
-                  a non-zero output value indicates an error.
-\end{itemize}
-
-When fits\_iterate\_data is called it first allocates memory to hold
-all the requested columns of data or image pixel arrays.  It then reads
-the input data from the FITS tables or images into the arrays then
-passes the structure with pointers to these data arrays to the work
-function.  After the work function returns, the iterator function
-writes any output columns of data or images back to the FITS files.  It
-then repeats this process for any remaining sets of rows or image
-pixels until it has processed the entire table or image or until the
-work function returns a non-zero status value.  The iterator then frees
-the memory that it initially allocated and returns control to the
-driver routine that called it.
-
- 
-\section{Guidelines for Using the Iterator Function}
-
-The totaln, offset, firstn, and nvalues parameters that are passed to
-the work function are useful for determining how much of the data has
-been processed and how much remains left to do.  On the very first call
-to the work function firstn will be equal to offset + 1;  the work
-function may need to perform various initialization tasks before
-starting to  process the data. Similarly, firstn + nvalues - 1 will be
-equal to totaln on the last iteration, at which point the work function
-may need to perform some clean up operations before exiting for the
-last time.  The work function can also force an early termination of
-the iterations by returning a status value = -1.
-
-The narrays and iteratorCol.datatype arguments allow the work function
-to double check that the number of input arrays and their datatypes
-have the expected values.  The iteratorCol.fptr and iteratorCol.colnum
-structure elements can be used if the work function needs to read or
-write the values of other keywords in the FITS file associated with
-the array.  This should generally only be done during the
-initialization step or during the clean up step after the last set of
-data has been processed.  Extra FITS file I/O during the main
-processing loop of the work function can seriously degrade the speed of
-the program.
-
-One important feature of the iterator is that the first element in each
-array that is passed to the work function gives the value that is used
-to represent null or undefined values in the array.  The real data then
-begins with the second element of the array (i.e., array[1], not
-array[0]).  If the first array element is equal to zero, then this
-indicates that all the array elements have defined values and there are
-no undefined values.  If array[0] is not equal to zero, then this
-indicates that some of the data values are undefined and this value
-(array[0]) is used to represent them.  In the case of output arrays
-(i.e., those arrays that will be written back to the FITS file by the
-iterator function after the work function exits) the work function must
-set the first array element to the desired null value if necessary,
-otherwise the first element should be set to zero to indicate that
-there are no null values in the output array.  CFITSIO defines 2
-values, FLOATNULLVALUE and DOUBLENULLVALUE, that can be used as default
-null values for float and double datatypes, respectively.  In the case
-of character string datatypes, a null string is always used to
-represent undefined strings.
+  int fits_test_keyword / fftkey (char *keyname, > int *status)
 
-In some applications it may be necessary to recursively call the iterator
-function.  An example of this is given by one of the example programs
-that is distributed with CFITSIO: it first calls a work function that
-writes out a 2D histogram image.  That work function in turn calls
-another work function that reads the  `X' and `Y' columns in a table to
-calculate the value of each 2D histogram image pixel. Graphically, the
-program structure can be described as:
- 
-\begin{verbatim}
- driver --> iterator --> work1_fn --> iterator --> work2_fn
+  int fits_test_record / fftrec (char *card, > int *status)
 \end{verbatim}
 
-Finally, it should be noted that the table columns or image arrays that
-are passed to the work function do not all have to come from the same
-FITS file and instead may come from any combination of sources as long
-as they have the same length.   The length of the first table column or
-image array is used by the iterator if they do not all have the same
-length.
-
-
-
-\chapter{  Basic CFITSIO Interface Routines }
-
-This chapter describes the basic routines in the CFITSIO user interface
-that provide all the functions normally needed to read and write most
-FITS files.  It is recommended that these routines be used for most
-applications and that the more advanced routines described in the
-next chapter only be used in special circumstances when necessary.
-
-The following conventions are used in this chapter in the description
-of each function:
-
-1. Most functions have 2 names: a long descriptive name and a short
-concise name.  Both names are listed on the first line of the following
-descriptions, separated by a slash (/) character.  Programmers may use
-either name in their programs but the long names are recommended to
-help document the code and make it easier to read.
-
-2. A right arrow symbol ($>$) is used in the function descriptions to
-separate the input parameters from the output parameters in the
-definition of each routine.  This symbol is not actually part of the C
-calling sequence.
-
-3. The function parameters are defined in more detail in the
-alphabetical listing in Appendix B.
-
-4.  The first argument in almost all the functions is a pointer to a
-structure of type `fitsfile'.  Memory for this structure is allocated
-by CFITSIO when the FITS file is first opened or created and is freed
-when the FITS file is closed.
-
-5.  The last argument in almost all the functions is the error status
-parameter.  It must be equal to 0 on input, otherwise the function will
-immediately exit without doing anything.  A non-zero output value
-indicates that an error occurred in the function.  In most cases the
-status value is also returned as the value of the function itself.
-
- 
-\section{CFITSIO Error Status Routines}
-
- 
-\begin{description}
-\item[1 ] Return the revision number of the CFITSIO library.
-    The revision number will be incremented with each new
-   release of CFITSIO. \label{ffvers}
-\end{description}
- 
-\begin{verbatim}
-  float fits_get_version / ffvers ( > float *version)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Return a descriptive text string (30 char max.) corresponding to
-   a CFITSIO error status code. \label{ffgerr}
-\end{description}
- 
-\begin{verbatim}
-  void fits_get_errstatus / ffgerr (int status, > char *err_text)
-\end{verbatim}
- 
 \begin{description}
-\item[3 ] Return the top (oldest) 80-character error message from the
-    internal CFITSIO stack of error messages and shift any remaining
-    messages on the stack up one level.  Call this routine
-    repeatedly to get each message in sequence.  The function returns
-   a value = 0 and a null error message when the error stack is empty.
-\label{ffgmsg}
+\item[7 ] Test whether the current header contains any NULL (ASCII 0) characters.
+    These characters are illegal in the header, but they will go undetected
+    by most of the CFITSIO keyword header routines, because the null is
+    interpreted as the normal end-of-string terminator.  This routine returns
+    the position of the first null character in the header, or zero if there
+    are no nulls.  For example a returned value of 110 would indicate that
+    the first NULL is located in the 30th character of the second keyword
+    in the header (recall that each header record is 80 characters long).
+    Note that this is one of the few CFITSIO routines in which the returned
+    value is not necessarily equal to the status value).
+   \label{ffnchk}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_errmsg / ffgmsg (char *err_msg)
+  int fits_null_check / ffnchk (char *card, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[4 ] Print out the error message corresponding to the input status
-    value and all the error messages on the CFITSIO stack to the specified
-    file stream  (normally to stdout or stderr).  If the input
-    status value = 0 then this routine does nothing.
-\label{ffrprt}
+\item[8 ] Parse a header keyword record and return the name of the keyword,
+    and the length of the name.
+    The keyword name normally occupies the first 8 characters of the
+    record, except under the HIERARCH convention where the name can
+   be up to 70 characters in length. \label{ffgknm}
 \end{description}
- 
+
 \begin{verbatim}
-  void fits_report_error / ffrprt (FILE *stream, > status)
+  int fits_get_keyname / ffgknm
+      (char *card, > char *keyname, int *keylength, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[5 ] Write an 80-character message to the CFITSIO error stack.  Application
-    programs should not normally write to the stack, but there may be
-   some situations where this is desirable. \label{ffpmsg}
+\item[9 ] Parse a header keyword record, returning the value (as
+    a literal character string) and comment strings.  If the keyword has no
+    value (columns 9-10 not equal to '= '), then a null value string is
+    returned and the comment string is set equal to column 9 - 80 of the
+   input string. \label{ffpsvc}
 \end{description}
- 
+
 \begin{verbatim}
-  void fits_write_errmsg / ffpmsg (char *err_msg)
+  int fits_parse_value / ffpsvc
+      (char *card, > char *value, char *comment, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[6 ]  Clear the entire error message stack.  This routine is useful
-     to clear any error message that may have been generated by
-     a non-fatal CFITSIO error. This routine is called without
-    any arguments. \label{ffcmsg}
+\item[10] Construct an array indexed keyword name (ROOT + nnn).
+    This routine appends the sequence number to the root string to create
+   a keyword name (e.g., 'NAXIS' + 2 = 'NAXIS2') \label{ffkeyn}
 \end{description}
- 
+
 \begin{verbatim}
-  void fits_clear_errmsg / ffcmsg (void)
+  int fits_make_keyn / ffkeyn
+      (char *keyroot, int value, > char *keyname, int *status)
 \end{verbatim}
-
- 
-\section{FITS File Access Routines}
-
-These routines will open or close a new or existing FITS file or return
-information about the opened FITS file.  These routines support the
-extended file name syntax that is described in a previous chapter.
-See Appendix B for the definition of the parameters used in these routines.
 
-The same FITS file may be opened more than once simultaneously and the
-resulting pointers to the files may be treated as though they were
-completely independent FITS files.  Thus, one could open a FITS file
-twice, move to different extensions within the file, and then read or
-write data to the 2 extensions in any order.
-
- 
 \begin{description}
-\item[1 ] Open an existing FITS file with a specified access mode.
-    The iomode parameter may have a value of READONLY or READWRITE.
-\label{ffopen}
+\item[11]  Construct a sequence keyword name (n + ROOT).
+    This routine concatenates the sequence number to the front of the
+   root string to create a keyword name (e.g., 1 + 'CTYP' = '1CTYP') \label{ffnkey}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_open_file / ffopen
-      (fitsfile **fptr, char *filename, int iomode, > int *status)
+  int fits_make_nkey / ffnkey
+      (int value, char *keyroot, > char *keyname, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[2 ] Reopen a FITS file that was previously opened with
-    fits\_open\_file or fits\_create\_file.  The new fitsfile
-    pointer may then be treated as a separate file, and one may
-    simultaneously read or write to 2 (or more)  different extensions in
-    the same file.   The fits\_open\_file routine (above) automatically
-    detects cases where a previously opened file is being opened again,
-    and then internally call fits\_reopen\_file, so programs should rarely
-    need to explicitly call this routine.
-\label{ffreopen}
+\item[12] Determine the data type of a keyword value string. This routine
+    parses the keyword value string  to determine its data type.
+    Returns 'C', 'L', 'I', 'F' or 'X', for character string, logical,
+   integer, floating point, or complex, respectively. \label{ffdtyp}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_reopen_file / ffreopen
-      (fitsfile *openfptr, fitsfile **newfptr, > int *status)
+  int fits_get_keytype / ffdtyp
+      (char *value, > char *dtype, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[3 ]  Create a new empty FITS file.  A template file may also be
-   specified to define the structure of the new file (see secion 4.2.4).
-   An error will be returned if
-   the specified file already exists unless the filename is
-   prefixed with an exclamation point (!).  In that case CFITSIO
-   will overwrite the existing file. Note  that the exclamation point,
-   '!', is a special UNIX character, so if it is used  on the command
-   line rather than entered at a task prompt, it must be  preceded by a
-  backslash to force the UNIX shell to ignore it. \label{ffinit}
+\item[13] Return the class of an input header record.  The record is classified
+    into one of the following categories (the class values are
+    defined in fitsio.h).  Note that this is one of the few CFITSIO
+   routines that does not return a status value. \label{ffgkcl}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_create_file / ffinit
-      (fitsfile **fptr, char *filename, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[4 ]  Create a new FITS file, using a template file to define its
-  initial size and structure.  The template may be another FITS HDU
-  or an ASCII template file.  If the input template file name pointer
-  is null, then this routine behaves the same as fits\_create\_file.
-  The currently supported format of the ASCII template file is described
-  under the fits\_parse\_template routine (in the general Utilities
-  section)
-\label{fftplt}
-\end{description}
- 
-\begin{verbatim}
-  int fits_create_template / fftplt
-      (fitsfile **fptr, char *filename, char *tpltfile > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[5 ] Close a previously opened FITS file. \label{ffclos}
-\end{description}
- 
-\begin{verbatim}
-  int fits_close_file / ffclos (fitsfile *fptr, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[6 ] Close and DELETE a FITS disk file previously opened with ffopen or ffinit.
-    This routine may be  useful in cases where a FITS file is created but
-    then an error occurs which prevents the file from being completed.
-  \label{ffdelt}
-\end{description}
- 
-\begin{verbatim}
-  int fits_delete_file / ffdelt
-      (fitsfile *fptr, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[7 ]Return the name of the opened FITS file. \label{ffflnm}
-\end{description}
- 
-\begin{verbatim}
-  int fits_file_name / ffflnm
-      (fitsfile *fptr, > char *filename, int *status)
+       Class  Value             Keywords
+  TYP_STRUC_KEY  10  SIMPLE, BITPIX, NAXIS, NAXISn, EXTEND, BLOCKED,
+                     GROUPS, PCOUNT, GCOUNT, END
+                     XTENSION, TFIELDS, TTYPEn, TBCOLn, TFORMn, THEAP,
+                     and the first 4 COMMENT keywords in the primary array
+                     that define the FITS format.
+  TYP_CMPRS_KEY  20  The experimental keywords used in the compressed
+                     image format ZIMAGE, ZCMPTYPE, ZNAMEn, ZVALn,
+                     ZTILEn, ZBITPIX, ZNAXISn, ZSCALE, ZZERO, ZBLANK
+  TYP_SCAL_KEY   30  BSCALE, BZERO, TSCALn, TZEROn
+  TYP_NULL_KEY   40  BLANK, TNULLn
+  TYP_DIM_KEY    50  TDIMn
+  TYP_RANG_KEY   60  TLMINn, TLMAXn, TDMINn, TDMAXn, DATAMIN, DATAMAX
+  TYP_UNIT_KEY   70  BUNIT, TUNITn
+  TYP_DISP_KEY   80  TDISPn
+  TYP_HDUID_KEY  90  EXTNAME, EXTVER, EXTLEVEL, HDUNAME, HDUVER, HDULEVEL
+  TYP_CKSUM_KEY 100  CHECKSUM, DATASUM
+  TYP_WCS_KEY   110  CTYPEn, CUNITn, CRVALn, CRPIXn, CROTAn, CDELTn
+                     CDj_is, PVj_ms, LONPOLEs, LATPOLEs
+                     TCTYPn, TCTYns, TCUNIn, TCUNns, TCRVLn, TCRVns, TCRPXn,
+                     TCRPks, TCDn_k, TCn_ks, TPVn_m, TPn_ms, TCDLTn, TCROTn
+                     jCTYPn, jCTYns, jCUNIn, jCUNns, jCRVLn, jCRVns, iCRPXn,
+                     iCRPns, jiCDn,  jiCDns, jPVn_m, jPn_ms, jCDLTn, jCROTn
+                     (i,j,m,n are integers, s is any letter)
+  TYP_REFSYS_KEY 120 EQUINOXs, EPOCH, MJD-OBSs, RADECSYS, RADESYSs
+  TYP_COMM_KEY   130 COMMENT, HISTORY, (blank keyword)
+  TYP_CONT_KEY   140 CONTINUE
+  TYP_USER_KEY   150 all other keywords
+
+  int fits_get_keyclass / ffgkcl (char *card)
 \end{verbatim}
- 
+
 \begin{description}
-\item[8 ]Return the I/O mode of the open FITS file (READONLY or READWRITE).
-\label{ffflmd}
+\item[14] Parse the 'TFORM' binary table column format string.
+    This routine parses the input TFORM character string and returns the
+    integer data type code, the repeat count of the field, and, in the case
+    of character string fields, the length of the unit string.  See Appendix
+    B for the allowed values for the returned typecode parameter.  A
+   null pointer may be given for any output parameters that are not needed. \label{ffbnfm}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_file_mode / ffflmd
-      (fitsfile *fptr, > int *iomode, int *status)
+   int fits_binary_tform / ffbnfm
+       (char *tform, > int *typecode, long *repeat, long *width,
+        int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[9 ]Return the file type of the opened FITS file (e.g. 'file://', 'ftp://',
-   etc.).
-\label{ffurlt}
+\item[15] Parse the 'TFORM' keyword value that defines the column format in
+    an ASCII table.  This routine parses the input TFORM character
+    string and returns the data type code, the width of the column,
+    and (if it is a floating point column) the number of decimal places
+    to the right of the decimal point.  The returned data type codes are
+    the same as for the binary table, with the following
+    additional rules:  integer columns that are between 1 and 4 characters
+    wide are defined to be short integers (code = TSHORT).  Wider integer
+    columns are defined to be regular integers (code = TLONG).  Similarly,
+    Fixed decimal point columns (with TFORM = 'Fw.d') are defined to
+    be single precision reals (code = TFLOAT) if w is between 1 and 7 characters
+    wide, inclusive.  Wider 'F' columns will return a double precision
+    data code (= TDOUBLE).  'Ew.d' format columns will have datacode = TFLOAT,
+    and 'Dw.d' format columns will have datacode = TDOUBLE. A null
+   pointer may be given for any output parameters that are not needed. \label{ffasfm}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_url_type / ffurlt
-      (fitsfile *fptr, > char *urltype, int *status)
+  int fits_ascii_tform / ffasfm
+      (char *tform, > int *typecode, long *width, int *decimals,
+       int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[10]  Parse the input filename or URL into its component parts: the file
-type (file://, ftp://, http://, etc), the base input file name, the
-name of the output file that the input file is to be copied to prior
-to opening, the HDU or extension specification, the filtering
-specifier, the binning specifier, and the column specifier.  Null
-strings will be returned for any components that are not present
-in the input file name.
- \label{ffiurl}
+\item[16] Calculate the starting column positions and total ASCII table width
+    based on the input array of ASCII table TFORM values.  The SPACE input
+    parameter defines how many blank spaces to leave between each column
+    (it is recommended to have one space between columns for better human
+   readability). \label{ffgabc}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_parse_input_url / ffiurl
-      (char *filename, > char *filetype, char *infile, char *outfile, char
-       *extspec, char *filter, char *binspec, char *colspec, int *status)
+  int fits_get_tbcol / ffgabc
+      (int tfields, char **tform, int space, > long *rowlen,
+       long *tbcol, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[11]  Parse the input filename and return the HDU number that would be
-moved to if the file were opened with fits\_open\_file.  The returned
-HDU number begins with 1 for the primary array, so for example, if the
-input filename = `myfile.fits[2]' then hdunum = 3 will be returned.
-CFITSIO does not open the file to check if the extension actually
-exists if an extension number is specified. If an extension *name* is
-included in the file name specification (e.g.  `myfile.fits[EVENTS]'
-then this routine will have to open the FITS file and look for the
-position of the named extension, then close file again.  This is not
-possible if the file is being read from the stdin stream, and an error
-will be returned in this case.  If the filename does not specify an
-explicit extension (e.g. 'myfile.fits') then hdunum = -99 will be
-returned, which is functionally equivalent to hdunum = 1. This routine
-is mainly used for backward compatibility in the ftools software
-package and is not recommended for general use.  It is generally better
-and more efficient to first open the FITS file with fits\_open\_file,
-then use fits\_get\_hdu\_num to determine which HDU in the file has
-been opened, rather than calling fits\_parse\_input\_url followed by a
-call to fits\_open\_file.
- \label{ffextn}
+\item[17] Parse a template header record and return a formatted 80-character string
+    suitable for appending to (or deleting from) a FITS header file.
+    This routine is useful for parsing lines from an ASCII template file
+    and reformatting them into legal FITS header records.  The formatted
+    string may then be passed to the fits\_write\_record, ffmcrd, or
+    fits\_delete\_key routines
+   to append or modify a FITS header record. \label{ffgthd}
 \end{description}
- 
+
 \begin{verbatim}
-   int fits_parse_extnum / ffextn
-       (char *filename, > int *hdunum, int *status)
+  int fits_parse_template / ffgthd
+      (char *templt, > char *card, int *keytype, int *status)
 \end{verbatim}
- 
+    The input templt character string generally should contain 3 tokens:
+    (1) the KEYNAME, (2) the VALUE, and (3) the COMMENT string.  The
+    TEMPLATE string must adhere to the following format:
+
+
 \begin{description}
-\item[12] Parse the input file name and return the root file name.  The root
-name includes the file type if specified, (e.g.  'ftp://' or 'http://')
-and the full path name, to the extent that it is specified in the input
-filename.  It does not enclude the HDU name or number, or any filtering
-specifications.
- \label{ffrtnm}
+\item[- ]     The KEYNAME token must begin in columns 1-8 and be a maximum  of 8
+        characters long.  A legal FITS keyword name may only
+        contain the characters A-Z, 0-9, and '-' (minus sign) and
+        underscore.  This routine will automatically convert any lowercase
+        characters to uppercase in the output string.  If the first 8 characters
+        of the template line are
+        blank then the remainder of the line is considered to be a FITS comment
+       (with a blank keyword name).
 \end{description}
- 
-\begin{verbatim}
-   int fits_parse_rootname / ffrtnm
-       (char *filename, > char *rootname, int *status);
-\end{verbatim}
-
-
- 
-\section{HDU Access Routines\label{FFMAHD}}
 
-The following functions perform operations on Header-Data Units (HDUs)
-as a whole.  See Appendix B for the definition of the parameters used in
-these routines.
 
- 
 \begin{description}
-\item[1 ] Move to a specified absolute HDU number in the FITS file.  A
-    null pointer may be given for the hdutype parameter if it's value is
-   not needed. \label{ffmahd}
+\item[- ]     The VALUE token must be separated from the KEYNAME token by one or more
+        spaces and/or an '=' character.  The data type of the VALUE token
+        (numeric, logical, or character string) is automatically determined
+        and  the output CARD string is formatted accordingly.  The value
+        token may be forced to be interpreted as a string (e.g. if it is a
+       string of numeric digits) by enclosing it in single quotes.
 \end{description}
- 
-\begin{verbatim}
-  int fits_movabs_hdu / ffmahd
-      (fitsfile *fptr, int hdunum, > int *hdutype, int *status)
-\end{verbatim}
- 
+
+
 \begin{description}
-\item[2 ] Move a relative number of HDUs forward or backwards in the FITS file
-    from the current position. A null pointer may be given for the hdutype
-   parameter if it's value is not needed.   \label{ffmrhd}
+\item[- ]     The COMMENT token is optional, but if present must be separated from
+       the VALUE token by at least one blank space and a  '/' character.
 \end{description}
- 
-\begin{verbatim}
-  int fits_movrel_hdu / ffmrhd
-      (fitsfile *fptr, int nmove, > int *hdutype, int *status)
-\end{verbatim}
- 
+
+
 \begin{description}
-\item[3 ] Move to the (first) HDU which has the specified extension type and
-    EXTNAME (or HDUNAME) and EXTVER keyword values.  The hdutype parameter
-    may have
-    a value of IMAGE\_HDU, ASCII\_TBL, BINARY\_TBL, or ANY\_HDU where
-    ANY\_HDU means that only the extname and extver values will be
-    used to locate the correct extension.  If the input value of
-    extver is 0 then the EXTVER keyword is ignored and the first HDU
-    with a matching EXTNAME (or HDUNAME) keyword will be found.  If no
-    matching HDU is found in the file then the current HDU will remain
-    unchanged
-   and a status = BAD\_HDU\_NUM will be returned. \label{ffmnhd}
+\item[- ]     One exception to the above rules is that if the first non-blank
+        character in the first 8 characters of the template string is a
+        minus sign ('-') followed
+        by a single token, or a single token followed by an equal sign,
+        then it is interpreted as the name of a keyword which is to be
+       deleted from the FITS header.
 \end{description}
- 
-\begin{verbatim}
-  int fits_movnam_hdu / ffmnhd
-      (fitsfile *fptr, int hdutype, char *extname, int extver, > int *status)
-\end{verbatim}
- 
+
+
 \begin{description}
-\item[4 ] Return the number of the current HDU in the FITS file (primary array = 1).
-   This function returns the HDU number rather than a status value.  \label{ffghdn}
+\item[- ]     The second exception is that if the template string starts with
+        a minus sign and is followed by 2 tokens (without an equals sign between
+        them) then the second token
+        is interpreted as the new name for the keyword specified by
+        first token.  In this case the old keyword name (first token)
+        is returned in characters 1-8 of the returned CARD string, and
+        the new keyword name (the second token) is returned in characters
+        41-48 of the returned CARD string.  These old and new names
+        may then be passed to the ffmnam routine which will change
+       the keyword name.
 \end{description}
- 
+
+    The keytype output parameter indicates how the returned CARD string
+    should be interpreted:
+
 \begin{verbatim}
-  int fits_get_hdu_num / ffghdn
-      (fitsfile *fptr, > int *hdunum)
+        keytype                  interpretation
+        -------          -------------------------------------------------
+           -2            Rename the keyword with name = the first 8 characters of CARD
+                         to the new name given in characters 41 - 48 of CARD.
+
+           -1            delete the keyword with this name from the FITS header.
+
+            0            append the CARD string to the FITS header if the
+                         keyword does not already exist, otherwise update
+                         the keyword value and/or comment field if is already exists.
+
+            1            This is a HISTORY or COMMENT keyword; append it to the header
+
+            2            END record; do not explicitly write it to the FITS file.
 \end{verbatim}
- 
-\begin{description}
-\item[5 ] Return the type of the current HDU in the FITS file.  The possible
-   values for hdutype are: IMAGE\_HDU, ASCII\_TBL, or BINARY\_TBL.  \label{ffghdt}
-\end{description}
- 
+     EXAMPLES:  The following lines illustrate valid input template strings:
+
 \begin{verbatim}
-  int fits_get_hdu_type / ffghdt
-      (fitsfile *fptr, > int *hdutype, int *status)
+      INTVAL 7 / This is an integer keyword
+      RVAL           34.6   /     This is a floating point keyword
+      EVAL=-12.45E-03  / This is a floating point keyword in exponential notation
+      lval F / This is a boolean keyword
+                  This is a comment keyword with a blank keyword name
+      SVAL1 = 'Hello world'   /  this is a string keyword
+      SVAL2  '123.5'  this is also a string keyword
+      sval3  123+  /  this is also a string keyword with the value '123+    '
+      # the following template line deletes the DATE keyword
+      - DATE
+      # the following template line modifies the NAME keyword to OBJECT
+      - NAME OBJECT
 \end{verbatim}
- 
+
 \begin{description}
-\item[6 ] Return the total number of HDUs in the FITS file.
-   The CHDU remains unchanged. \label{ffthdu}
+\item[18]  Parse the input string containing a list of rows or row ranges, and
+     return integer arrays containing the first and last row in each
+     range.  For example, if rowlist = "3-5, 6, 8-9" then it will
+     return numranges = 3, rangemin = 3, 6, 8 and rangemax = 5, 6, 9.
+     At most, 'maxranges' number of ranges will be returned.  'maxrows'
+     is the maximum number of rows in the table; any rows or ranges
+     larger than this will be ignored.  The rows must be specified in
+     increasing order, and the ranges must not overlap. A minus sign
+     may be use to specify all the rows to the upper or lower bound, so
+     "50-" means all the rows from 50 to the end of the table, and "-"
+     means all the rows in the table, from 1 - maxrows.
+   \label{ffrwrg}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_get_num_hdus / ffthdu
-      (fitsfile *fptr, > int *hdunum, int *status)
+    int fits_parse_range / ffrwrg(char *rowlist, long maxrows, int maxranges, >
+       int *numranges, long *rangemin, long *rangemax, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[7 ]Create a new primary array or IMAGE extension.
-   If the FITS file is currently empty then a primary array
-   is created, otherwise a new IMAGE extension is appended to the file.
-\label{ffcrim}
+\item[19]  Check that the Header fill bytes (if any) are all blank.  These are the bytes
+     that may follow END keyword and before the beginning of data unit,
+     or the end of the HDU if there is no data unit.
+   \label{ffchfl}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_create_img / ffcrim
-      ( fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
+    int ffchfl(fitsfile *fptr, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[8 ]Create a new ASCII or bintable table extension. If
-   the FITS file is currently empty then a dummy primary array will be
-   created before appending the table extension to it.
-   The tbltype parameter defines the type of table and can have
-   values of ASCII\_TBL or BINARY\_TBL.  The naxis2 parameter gives the
-   initial number of rows to be created in the table, and should normally
-   be set = 0.  CFITSIO
-   will automatically increase the size of the table as
-   additional rows are written.  A non-zero number of rows may be specified
-   to reserve space for that many rows, even if a fewer number of rows will
-   be written.  The tunit and extname parameters
-   are optional and a null pointer may be given if they are not defined.
-   The FITS Standard recommends that only letters, digits, and the
-   underscore character be used in column names (the ttype parameter) with no
-   embedded spaces).  Trailing blank characters are not significant.  It is
-   recommended that all the column names in a given table be unique within
-   the first 8 characters, and strongly recommended that the names be
-  unique within the first 16 characters. \label{ffcrtb}
+\item[20]  Check that the Data fill bytes (if any) are all zero (for IMAGE or
+     BINARY Table HDU) or all blanks (for ASCII table HDU).  These file
+     bytes may be located after the last valid data byte in the HDU and
+     before the physical end of the HDU.
+     \label{ffcdfl}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_create_tbl / ffcrtb
-      (fitsfile *fptr, int tbltype, long naxis2, int tfields, char *ttype[],
-       char *tform[], char *tunit[], char *extname, int *status)
+    int ffcdfl(fitsfile *fptr, > int *status)
 \end{verbatim}
- 
-\begin{description}
-\item[9 ] Copy the CHDU from the FITS file associated with infptr and append it
-    to the end of the FITS file associated with outfptr.  Space may be
-   reserved for MOREKEYS additional keywords in the output header. \label{ffcopy}
-\end{description}
- 
-\begin{verbatim}
-  int fits_copy_hdu / ffcopy
-      (fitsfile *infptr, fitsfile *outfptr, int morekeys, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[10] Delete the CHDU in the FITS file.  Any following HDUs will be shifted
-    forward in the file, to fill in the gap created by the deleted
-    HDU.  In the case of deleting the primary array (the first HDU in
-    the file) then the current primary array will be replace by a null
-    primary array containing the minimum set of required keywords and
-    no data.  If there are more extensions in the file following the
-    one that is deleted, then the the CHDU will be redefined to point
-    to the following extension.  If there are no following extensions
-    then the CHDU will be redefined to point to the previous HDU.  The
-    output hdutype parameter returns the type of the new CHDU.  A null
-    pointer may be given for
-   hdutype if the returned value is not needed. \label{ffdhdu}
-\end{description}
- 
-\begin{verbatim}
-  int fits_delete_hdu / ffdhdu
-      (fitsfile *fptr, > int *hdutype, int *status)
-\end{verbatim}
-
-
- 
-\section{Header Keyword Read/Write Routines}
 
-These routines read or write keywords in the Current Header Unit
-(CHU).  Wild card characters (*, ?, or \#) may be used when specifying
-the name of the keyword to be read: a '?' will match any single
-character at that position in the keyword name and a '*' will match any
-length (including zero) string of characters.  The '\#' character will
-match any consecutive string of decimal digits (0 - 9).  When a wild
-card is used the routine will only search for a match from the current
-header position to the end of the header and will not resume the search
-from the top of the header back to the original header position as is
-done when no wildcards are included in the keyword name.  The
-fits\_read\_record routine may be used to set the starting position
-when doing wild card searchs.  A status value of KEY\_NO\_EXIST is
-returned if the specified keyword to be read is not found in the
-header.  See Appendix B for the definition of the parameters used in
-these routines.
+\chapter{  The CFITSIO Iterator Function }
 
+The fits\_iterate\_data function in CFITSIO provides a unique method of
+executing an arbitrary user-supplied `work' function that operates on
+rows of data in  FITS tables or on pixels in FITS images.  Rather than
+explicitly reading and writing the FITS images or columns of data, one
+instead calls the CFITSIO iterator routine, passing to it the name of
+the user's work function that is to be executed along with a list of
+all the table columns or image arrays that are to be passed to the work
+function.  The CFITSIO iterator function then does all the work of
+allocating memory for the arrays, reading the input data from the FITS
+file, passing them to the work function, and then writing any output
+data back to the FITS file after the work function exits.  Because
+it is often more efficient to process only a subset of the total table
+rows at one time, the iterator function can determine the optimum
+amount of data to pass in each iteration and repeatly call the work
+function until the entire table been processed.
 
- 
-\begin{description}
-\item[1 ] Return the number of existing keywords (not counting the
-    END keyword) and the amount of space currently available
-    for more keywords.
-    It returns morekeys = -1 if the header has not yet been closed.
-    Note that CFITSIO will dynamically add space if required when
-    writing new keywords to a header so in practice there is no
-    limit to the number of keywords that can be added to a header.
-    A null pointer may be entered for the morekeys parameter if it's
-   value is not needed. \label{ffghsp}
-\end{description}
- 
-\begin{verbatim}
-  int fits_get_hdrspace / ffghsp
-      (fitsfile *fptr, > int *keysexist, int *morekeys, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Write (append) a new keyword of the appropriate datatype into the
-    CHU.  Note that the address to the value, and not the value itself, must
-    be entered.    The datatype parameter specifies the datatype of the
-    keyword value with one of the following values:  TSTRING, TLOGICAL (== int),
-    TBYTE, TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG, TFLOAT, TDOUBLE.
-    Within the context of this routine, TSTRING corresponds to a 'char*'
-    datatype, i.e., a pointer to a character array.  A null
-    pointer may be entered for the comment parameter which will cause the
-   comment field to be left blank.  \label{ffpky}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_key / ffpky
-      (fitsfile *fptr, int datatype, char *keyname, DTYPE *value,
-          char *comment, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[3 ] Write (update) a keyword of the appropriate datatype into the CHU.
-    This routine will modify the value and comment field if the keyword
-    already exists in the header, otherwise it will append a new
-    keyword at the end of the header. Note that the address to the
-    value, and not the value itself, must be entered. The datatype
-    parameter specifies the datatype of the keyword value and can have
-    one of the following values:  TSTRING, TLOGICAL (== int), TBYTE,
-    TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG, TFLOAT, TDOUBLE,
-    TCOMPLEX, and TDBLCOMPLEX. Within the context of this routine,
-    TSTRING corresponds to a 'char*' datatype, i.e., a pointer to a
-    character array. A null pointer may be entered for the comment
-    parameter which will leave the comment field blank (or
-    unmodified).
- \label{ffuky}
-\end{description}
- 
-\begin{verbatim}
-  int fits_update_key / ffuky
-      (fitsfile *fptr, int datatype, char *keyname, DTYPE *value,
-          char *comment, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[4 ] Write a keyword with a null or undefined value (i.e., the value
-    field in the keyword is left blank).
-    This routine will modify the value and comment field if the
-    keyword already exists in the header, otherwise it will append
-    a new null-valued keyword at the end of the header.
-    A null pointer may be entered for the comment parameter which will leave
-   the comment field blank (or unmodified). \label{ffukyu}
-\end{description}
- 
-\begin{verbatim}
-  int fits_update_key_null / ffukyu
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[5 ] Write (append) a COMMENT keyword to the CHU.  The comment string will
-    be split over multiple COMMENT keywords if it is longer than 70 characters.
- \label{ffpcom}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_comment / ffpcom
-      (fitsfile *fptr, char *comment, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[6 ]Write (append) a HISTORY keyword to the CHU.  The comment string will
-   be split over multiple HISTORY keywords if it is longer than 70 characters.
- \label{ffphis}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_history / ffphis
-      (fitsfile *fptr, char *history, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[7 ] Write the DATE keyword to the CHU. The keyword value will contain
-    the current system date as a character string in 'yyyy-mm-ddThh:mm:ss'
-    format. If a DATE keyword already exists in the header, then this
-    routine will simply update the keyword value with the current date.
-   \label{ffpdat}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_date / ffpdat
-      (fitsfile *fptr, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[8 ]Write a user specified keyword record into the CHU.  This is
-   a low--level routine which can be used to write any arbitrary
-   record into the header.  The record must conform to the all
-  the FITS format requirements. \label{ffprec}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_record / ffprec
-      (fitsfile *fptr, char *card, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[9 ]Update an 80-character record in the CHU.  If a keyword with the input
-   name already exists, then it is overwritten by the value of card.  This
-   could modify the keyword name as well as the value and comment fields.
-   If the keyword doesn't already exist then a new keyword card is appended
-   to the header. \label{ffucrd}
-\end{description}
- 
-\begin{verbatim}
-  int fits_update_card / ffucrd
-      (fitsfile *fptr, char *keyname, char *card, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[10]  Write the physical units string into an existing keyword.  This
-    routine uses a local convention, shown in the following example,
-    in which the keyword units are enclosed in square brackets in the
-   beginning of the keyword comment field.  \label{ffpunt}
-\end{description}
- 
-\begin{verbatim}
-  VELOCITY=                 12.3 / [km/s] orbital speed
+For many applications this single CFITSIO iterator function can
+effectively replace all the other CFITSIO routines for reading or
+writing data in FITS images or tables.  Using the iterator has several
+important advantages over the traditional method of reading and writing
+FITS data files:
 
-  int fits_write_key_unit / ffpunt
-      (fitsfile *fptr, char *keyname, char *unit, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[11]  Rename an existing keyword preserving the current value
-   and comment fields. \label{ffmnam}
-\end{description}
- 
-\begin{verbatim}
-  int fits_modify_name / ffmnam
-      (fitsfile *fptr, char *oldname, char *newname, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[12]  Modify (overwrite) the comment field of an existing keyword. \label{ffmcom}
-\end{description}
- 
-\begin{verbatim}
-  int fits_modify_comment / ffmcom
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[13] Read the nth header record in the CHU.  The first keyword
-   in the header is at keynum = 1;  if keynum = 0 then this routine
-   simply moves the internal CFITSIO pointer to the beginning of the header
-   so that subsequent keyword operations will start at the top of
-   the header (e.g., prior to searching for keywords using wild
-  cards in the keyword name). \label{ffgrec}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_record / ffgrec
-      (fitsfile *fptr, int keynum, > char *card, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[14]  Read the header record having the specified keyword name. \label{ffgcrd}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_card / ffgcrd
-      (fitsfile *fptr, char *keyname, > char *card, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[15] Read a specified keyword value and comment.
-    The datatype parameter specifies the returned datatype of the
-    keyword value and can have one of the following symbolic constant
-    values:  TSTRING, TLOGICAL (== int), TBYTE, TSHORT, TUSHORT, TINT,
-    TUINT, TLONG, TULONG, TFLOAT, TDOUBLE, TCOMPLEX, and TDBLCOMPLEX.
-    Within the context of this routine, TSTRING corresponds to a
-    'char*' datatype, i.e., a pointer to a character array.  Data type
-    conversion will be performed for numeric values if the keyword
-    value does not have the same datatype.  If the value of the keyword
-    is undefined (i.e., the value field is blank) then an error status
-    = VALUE\_UNDEFINED will be returned. If a NULL comment pointer is
-    given on input
-   then the comment string   will not be returned.   \label{ffgky}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_key / ffgky
-      (fitsfile *fptr, int datatype, char *keyname, > DTYPE *value,
-       char *comment, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[16] Read the physical units string in an existing keyword.  This
-    routine uses a local convention, shown in the following example,
-    in which the keyword units are enclosed in square brackets in the
-    beginning of the keyword comment field.  A null string is returned
-   if no units are defined for the keyword.  \label{ffgunt}
-\end{description}
- 
-\begin{verbatim}
-  VELOCITY=                 12.3 / [km/s] orbital speed
+\begin{itemize}
+\item
+It cleanly separates the data I/O from the routine that operates on
+the data.  This leads to a more modular and `object oriented'
+programming style.
 
-  int fits_read_key_unit / ffgunt
-      (fitsfile *fptr, char *keyname, > char *unit, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[17] Delete a keyword record.  The space previously occupied by
-    the keyword is reclaimed by moving all the following header records up
-    one row in the header.  The first routine deletes a keyword at a
-    specified position in the header (the first keyword is at position 1),
-    whereas the second routine deletes a specifically named keyword.
-    Wild card characters may be used when specifying the name of the keyword
-   to be deleted. \label{ffdrec} \label{ffdkey}
-\end{description}
- 
-\begin{verbatim}
-  int fits_delete_record / ffdrec
-      (fitsfile *fptr, int   keynum,  > int *status)
+\item
+It simplifies the application program by eliminating the need to allocate
+memory for the data arrays and eliminates most of the calls to the CFITSIO
+routines that explicitly read and write the data.
 
-  int fits_delete_key / ffdkey
-      (fitsfile *fptr, char *keyname, > int *status)
-\end{verbatim}
-
+\item
+It ensures that the data are processed as efficiently as possible.
+This is especially important when processing tabular data since
+the iterator function will calculate the most efficient number
+of rows in the table to be passed at one time to the user's work
+function on each iteration.
 
- 
-\section{Iterator Routines}
+\item
+Makes it possible for larger projects to develop a library of work
+functions that all have a uniform calling sequence and are all
+independent of the details of the FITS file format.
 
-The use of these routines is described in the previous chapter.
-Most of these routines do not have a corresponding short function
-name.
+\end{itemize}
 
- 
-\begin{description}
-\item[1 ]  Iterator `constructor' functions that set
-   the value of elements in the iteratorCol structure
-   that define the columns or arrays. These set the fitsfile
-    pointer, column name, column number, datatype, and iotype,
-    respectively.  The last 2 routines allow all the parameters
-    to be set with one function call (one supplies the column
-   name, the other the column number). \label{ffiterset}
-\end{description}
+There are basically 2 steps in using the CFITSIO iterator function.
+The first step is to design the work function itself which must have a
+prescribed set of input parameters.  One of these parameters is a
+structure containing pointers to the arrays of data; the work function
+can perform any desired operations on these arrays and does not need to
+worry about how the input data were read from the file or how the
+output data get written back to the file.
 
- 
-\begin{verbatim}
-  int fits_iter_set_file(iteratorCol *col, fitsfile *fptr);
+The second step is to design the driver routine that opens all the
+necessary FITS files and initializes  the input parameters to the
+iterator function.  The driver program calls the CFITSIO iterator
+function which then reads the data and passes it to the user's work
+function.
 
-  int fits_iter_set_colname(iteratorCol *col, char *colname);
+The following 2 sections describe these steps in more detail.  There
+are also several example programs included with the CFITSIO
+distribution which illustrate how to use the iterator function.
 
-  int fits_iter_set_colnum(iteratorCol *col, int colnum);
 
-  int fits_iter_set_datatype(iteratorCol *col, int datatype);
+\section{The Iterator Work Function}
 
-  int fits_iter_set_iotype(iteratorCol *col, int iotype);
+The user-supplied iterator work function must have the following set of
+input parameters (the function can be given any desired name):
 
-  int fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr,
-          char *colname, int datatype,  int iotype);
 
-  int fits_iter_set_by_num(iteratorCol *col, fitsfile *fptr,
-          int colnum, int datatype,  int iotype);
-\end{verbatim}
- 
-\begin{description}
-\item[2 ]  Iterator `accessor' functions that return the value of the
-     element in the iteratorCol structure
-    that describes a particular data column or array \label{ffiterget}
-\end{description}
- 
 \begin{verbatim}
-  fitsfile * fits_iter_get_file(iteratorCol *col);
+  int user_fn( long totaln, long offset, long firstn, long nvalues,
+               int narrays, iteratorCol *data,  void *userPointer )
+\end{verbatim}
 
-  char * fits_iter_get_colname(iteratorCol *col);
+\begin{itemize}
 
-  int fits_iter_get_colnum(iteratorCol *col);
+\item
+  totaln -- the total number of table rows or image pixels
+            that will be passed to the work function
+            during 1 or more iterations.
 
-  int fits_iter_get_datatype(iteratorCol *col);
+\item
+  offset     -- the offset applied to the first table row or image
+                pixel to be passed to the work function.  In other
+                words, this is the number of rows or pixels that
+                are skipped over before starting the iterations. If
+                offset = 0, then all the table rows or image pixels
+                will be passed to the work function.
 
-  int fits_iter_get_iotype(iteratorCol *col);
+\item
+  firstn     -- the number of the first table row or image pixel
+                (starting with 1)  that is being passed in this
+                particular call to the work function.
 
-  void * fits_iter_get_array(iteratorCol *col);
+\item
+  nvalues    -- the number of table rows or image pixels that are
+                being passed in this particular call to the work
+                function.  nvalues will always be less than or
+                equal to totaln and will have the same value on
+                each iteration, except possibly on the last
+                call which may have a smaller value.
 
-  long fits_iter_get_tlmin(iteratorCol *col);
+\item
+  narrays     -- the number of arrays of data that are being passed
+                 to the work function.  There is one array for each
+                 image or table column.
 
-  long fits_iter_get_tlmax(iteratorCol *col);
+\item
+  *data   -- array of structures, one for each
+             column or image.  Each structure contains a pointer
+             to the array of data as well as other descriptive
+             parameters about that array.
 
-  long fits_iter_get_repeat(iteratorCol *col);
+\item
+  *userPointer -- a user supplied pointer that can be used
+                 to pass ancillary information from the driver function
+                 to the work function.
+                 This pointer is passed to the CFITSIO iterator function
+                 which then passes it on to the
+                 work function without any modification.
+                 It may point to a single number, to an array of values,
+                 to a structure containing an arbitrary set of parameters
+                 of different types,
+                 or it may be a null pointer if it is not needed.
+                 The work function must cast this pointer to the
+                 appropriate data type before using it it.
+\end{itemize}
 
-  char * fits_iter_get_tunit(iteratorCol *col);
+The totaln, offset, narrays, data, and userPointer parameters are
+guaranteed to have the same value on each iteration.  Only firstn,
+nvalues, and the arrays of data pointed to by the data structures may
+change on each iterative call to the work function.
+
+Note that the iterator treats an image as a long 1-D array of pixels
+regardless of it's intrinsic dimensionality.  The total number of
+pixels is just the product of the size of each dimension, and the order
+of the pixels is the same as the order that they are stored in the FITS
+file. If the work function needs to know the number and size of the
+image dimensions then these parameters can be passed via the
+userPointer structure.
+
+The iteratorCol structure is currently defined as follows:
 
-  char * fits_iter_get_tdisp(iteratorCol *col);
-\end{verbatim}
- 
-\begin{description}
-\item[3 ]  The CFITSIO iterator function \label{ffiter}
-\end{description}
- 
 \begin{verbatim}
-  int fits_iterate_data(int narrays,  iteratorCol *data, long offset,
-            long nPerLoop,
-            int (*workFn)( long totaln, long offset, long firstn,
-                           long nvalues, int narrays, iteratorCol *data,
-                           void *userPointer),
-            void *userPointer,
-            int *status);
-\end{verbatim}
-
+typedef struct  /* structure for the iterator function column information */
+{
+   /* structure elements required as input to fits_iterate_data: */
 
- 
-\section{Primary Array or IMAGE Extension I/O Routines}
+  fitsfile *fptr;       /* pointer to the HDU containing the column or image */
+  int      colnum;      /* column number in the table; ignored for images    */
+  char     colname[70]; /* name (TTYPEn) of the column; null for images      */
+  int      datatype;    /* output data type (converted if necessary) */
+  int      iotype;      /* type: InputCol, InputOutputCol, or OutputCol */
 
-These routines read or write data values in the primary data array
-(i.e., the first HDU in a FITS file) or an IMAGE extension.   There are
-also routines to get information about the data type and size of the
-image.  C programmers should note that the ordering of arrays in FITS
-files, and hence in all the CFITSIO calls, is more similar to the
-dimensionality of arrays in Fortran rather than C.  For instance if a
-FITS image has NAXIS1 = 100 and NAXIS2 = 50, then a 2-D array just
-large enough to hold the image should be declared as array[50][100] and
-not as array[100][50].
+  /* output structure elements that may be useful for the work function: */
 
-The `datatype'  parameter specifies the datatype of the `nulval'  and
-`array' pointers and can have one of the following  values:  TBYTE,
-TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG, TFLOAT, TDOUBLE.
-Automatic data type conversion is performed if the data type of the
-FITS array (as defined by the BITPIX keyword) differs from that
-specified by 'datatype'.  The data values are also automatically scaled
-by the BSCALE and BZERO keyword values as they are being read or
-written in the FITS array.  See Appendix B for further information
-about the parameters used in these routines.
+  void     *array;    /* pointer to the array (and the null value) */
+  long     repeat;    /* binary table vector repeat value; set     */
+                      /*     equal to 1 for images                 */
+  long     tlmin;     /* legal minimum data value, if any          */
+  long     tlmax;     /* legal maximum data value, if any          */
+  char     unit[70];  /* physical unit string (BUNIT or TUNITn)    */
+  char     tdisp[70]; /* suggested display format; null if none    */
 
- 
-\begin{description}
-\item[1 ] Get the data type of the image (= BITPIX value).  Possible returned
- values are: BYTE\_IMG (8), SHORT\_IMG (16), LONG\_IMG (32),
-  FLOAT\_IMG (-32), or DOUBLE\_IMG (-64). \label{ffgidt}
-\end{description}
- 
-\begin{verbatim}
-  int fits_get_img_type / ffgidt
-      (fitsfile *fptr, > int *bitpix, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Get the dimension (number of axes = NAXIS) of the image \label{ffgidm}
-\end{description}
- 
-\begin{verbatim}
-  int fits_get_img_dim / ffgidm
-      (fitsfile *fptr, > int *naxis, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[3 ] Get the size of all the dimensions (up to maxdim dimensions) of
-  the image \label{ffgisz}
-\end{description}
- 
-\begin{verbatim}
-  int fits_get_img_size / ffgisz
-      (fitsfile *fptr, int maxdim, > long *naxes, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[4 ]  Get the parameters that define the type and size of the image.  This
-    routine simply combines calls to the above 3 routines. \label{ffgipr}
-\end{description}
- 
-\begin{verbatim}
-  int fits_get_img_param / ffgipr
-      (fitsfile *fptr, int maxdim, > int *bitpix, int *naxis, long *naxes,
-       int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[5 ] Write pixels into the FITS data array.  'fpixel' is an array of
-   length NAXIS which gives the coordinate of the starting pixel to be
-   written to, such that fpixel[0] is in the range 1 to NAXIS1,
-  fpixel[1] is in the range 1 to NAXIS2, etc. \label{ffppx}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_pix / ffppx
-      (fitsfile *fptr, int datatype, long *fpixel, long nelements,
-       DTYPE *array, int *status);
-\end{verbatim}
- 
-\begin{description}
-\item[6 ]Write pixels into the FITS data array, substituting the appropriate
-   FITS null value for all elements which are equal to the input value
-   of nulval (note that this parameter gives the address of the null
-   value, not the null value itself).  For integer FITS arrays, the
-   FITS null value is defined by the BLANK keyword (an error is
-   returned if the BLANK keyword doesn't exist).  For floating point
-   FITS arrays  the special IEEE NaN (Not-a-Number) value will be
-   written into the FITS file.  If a null pointer is entered for
-   nulval, then the null value is  ignored and this routine behaves
-  the same as fits\_write\_pix.   \label{ffppxn}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_pixnull / ffppxn
-      (fitsfile *fptr, int datatype, long *fpixel, long nelements,
-       DTYPE *array, DTYPE *nulval, > int *status);
-\end{verbatim}
- 
-\begin{description}
-\item[7 ] Set FITS data array elements equal to the appropriate null pixel
-    value. For integer FITS arrays, the FITS null value is defined by
-    the BLANK keyword  (an error is returned if the BLANK keyword
-    doesn't exist). For floating point FITS arrays the special IEEE NaN
-    (Not-a-Number) value will be written into the FITS file.  Note that
-    'firstelem' is a scalar giving the  offset to the first pixel to be
-   written in the equivalent 1-dimensional array of image pixels. \label{ffpprn}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_null_img / ffpprn
-      (fitsfile *fptr, long firstelem, long nelements, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[8 ] Read a rectangular subset from the FITS data array.   Undefined FITS array
-    elements will be returned with a value = *nullval, (note that this
-    parameter gives the address of the null value, not the null value
-    itself) unless nulval = 0 or *nulval = 0, in which case no checks for
-   undefined pixels will be performed.  \label{ffgsv}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_subset / ffgsv
-      (fitsfile *fptr, int  datatype, long *fpixel, long *lpixel, long *inc,
-       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[9 ] Read pixels from the FITS data array.   Undefined FITS array
-    pixels will be returned with a value = *nullval, (note that this
-    parameter gives the address of the null value, not the null value
-    itself) unless nulval = 0 or *nulval = 0, in which case no checks for
-    undefined pixels will be performed. 'fpixel' is an array of
-    length NAXIS which gives the coordinate of the starting pixel to be
-    read, such that fpixel[0] is in the range 1 to NAXIS1,
-   fpixel[1] is in the range 1 to NAXIS2, etc. \label{ffgpxv}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_pix / ffgpxv
-      (fitsfile *fptr, int  datatype, long *fpixel, long nelements,
-       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[10]  Read pixels from the FITS data array.   Any undefined FITS array
-    elements will have the corresponding nullarray element set
-   to TRUE.  \label{ffgpxf}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_pixnull / ffgpxf
-      (fitsfile *fptr, int  datatype, long *fpixel, long nelements,
-       > DTYPE *array, char *nullarray, int *anynul, int *status)
+} iteratorCol;
 \end{verbatim}
-
- 
-\section{ASCII and Binary Table Routines}
 
-These routines perform read and write operations on columns of data in
-FITS ASCII or Binary tables.  Note that in the following discussions,
-the first row and column in a table is at position 1 not 0.  See
-Appendix B for the definition of the parameters used in these
-routines.
+Instead of directly reading or writing the elements in this structure,
+it is recommended that programmers use the access functions that are
+provided for this purpose.
 
- 
-\subsection{Column Information Routines \label{FFGCNO}}
+The first five elements in this structure must be initially defined by
+the driver routine before calling the iterator routine.  The CFITSIO
+iterator routine uses this information to determine what column or
+array to pass to the work function, and whether the array is to be
+input to the work function, output from the work function, or both.
+The CFITSIO iterator function fills in the values of the remaining
+structure elements before passing it to the work function.
 
- 
-\begin{description}
-\item[1 ]  Get the number of rows or columns in the current FITS table.
-     The number of rows is given by the NAXIS2 keyword and the
-     number of columns is given by the TFIELDS keyword in the header
-    of the table. \label{ffgnrw}
-\end{description}
- 
-\begin{verbatim}
-  int fits_get_num_rows / ffgnrw
-      (fitsfile *fptr, > long *nrows, int *status);
+The array structure element is a pointer to the actual data array and
+it must be cast to the correct data type before it is used.  The
+`repeat' structure element give the number of data values in each row
+of the table, so that the total number of data values in the array is
+given by repeat * nvalues.  In the case of image arrays and ASCII
+tables, repeat will always be equal to 1.  When the data type is a
+character string, the array pointer is actually a pointer to an array
+of string pointers (i.e., char **array).  The other output structure
+elements are provided for convenience in case that information is
+needed within the work function.  Any other information may be passed
+from the driver routine to the work function via the userPointer
+parameter.
 
-  int fits_get_num_cols / ffgncl
-      (fitsfile *fptr, > int *ncols, int *status);
-\end{verbatim}
+Upon completion, the work routine must return an integer status value,
+with 0 indicating success and any other value indicating an error which
+will cause the iterator function to immediately exit at that point.  Return status
+values in the range 1 -- 1000 should be avoided since these are
+reserved for use by CFITSIO.  A return status value of -1 may be used to
+force the CFITSIO iterator function to stop at that point and return
+control to the driver routine after writing any output arrays to the
+FITS file.  CFITSIO does not considered this to be an error condition,
+so any further processing by the application program will continue normally.
 
- 
-\begin{description}
-\item[2 ] Get the table column number (and name) of the column whose name
-matches an input template name.   If casesen  = CASESEN then the column
-name match will be case-sensitive, whereas if casesen = CASEINSEN then
-the case will be ignored.  As a general rule, the column names should
-be treated as case INsensitive.
 
-The input column name template may be either the exact name of the
-column to be searched for, or it may contain wild card characters (*,
-?, or \#), or it may contain the integer number of the desired column
-(with the first column = 1).  The `*' wild card character matches any
-sequence of characters (including zero characters) and the `?'
-character matches any single character.  The \# wildcard will match any
-consecutive string of decimal digits (0-9).  If more than one column
-name in the table matches the template string, then the first match is
-returned and the status value will be set to COL\_NOT\_UNIQUE  as a
-warning that a unique match was not found.  To find the other cases
-that match the template, call the routine again leaving the input
-status value equal to COL\_NOT\_UNIQUE and the next matching name will
-then be returned.  Repeat this process until a status =
-COL\_NOT\_FOUND  is returned.
+\section{The Iterator Driver Function}
 
-The FITS Standard recommends that only letters, digits, and the
-underscore character be used in column names (with no embedded
-spaces).  Trailing blank characters are not significant.  It is
-recommended that all the column names in a given table be unique within
-the first 8 characters, and strongly recommended that the names be
- unique within the first 16 characters. \label{ffgcno} \label{ffgcnn}
-\end{description}
- 
-\begin{verbatim}
-  int fits_get_colnum / ffgcno
-      (fitsfile *fptr, int casesen, char *templt, > int *colnum,
-       int *status)
+The iterator driver function must open the necessary FITS files and
+position them to the correct HDU.  It must also initialize the following
+parameters in the iteratorCol structure (defined above) for each
+column or image before calling the CFITSIO iterator function.
+Several `constructor' routines are provided in CFITSIO for this
+purpose.
+
+\begin{itemize}
+\item
+  *fptr --  The fitsfile pointer to the table or image.
+\item
+colnum -- the number of the column in the table.  This value is ignored
+          in the case of images.  If colnum equals 0, then the column name
+          will be used to identify the column to be passed to the
+          work function.
+
+\item
+colname -- the name (TTYPEn keyword) of the column.  This is
+           only required if colnum = 0 and is ignored for images.
+\item
+datatype -- The desired data type of the array to be passed to the
+            work function.  For numerical data the data type does
+            not need to be the same as the actual data type in the
+            FITS file, in which case CFITSIO will do the conversion.
+            Allowed values are: TSTRING, TLOGICAL, TBYTE, TSBYTE, TSHORT, TUSHORT,
+            TINT, TLONG, TULONG, TFLOAT, TDOUBLE.  If the input
+            value of data type equals 0, then the  existing
+            data type of the column or image will be used without
+            any conversion.
+
+\item
+iotype -- defines whether the data array is to be input to the
+          work function (i.e, read from the FITS file), or output
+          from the work function (i.e., written to the FITS file) or
+          both.  Allowed values are InputCol, OutputCol, or InputOutputCol.
+	  Variable-length array columns are supported as InputCol or
+	  InputOutputCol types, but may not be used for an OutputCol type.
+\end{itemize}
+
+After the driver routine has initialized all these parameters, it
+can then call the CFITSIO iterator function:
 
-  int fits_get_colname / ffgcnn
-      (fitsfile *fptr, int casesen, char *templt, > char *colname,
-       int *colnum, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[3 ] Return the datatype, vector repeat value, and the width in bytes
-    of a column in an ASCII or binary table.  Allowed values for the
-    datatype in ASCII tables are:  TSTRING, TSHORT, TLONG, TFLOAT, and
-    TDOUBLE.  Binary tables also support these types: TLOGICAL, TBIT,
-    TBYTE, TCOMPLEX and TDBLCOMPLEX.  The negative of the datatype code
-    value is returned if it is a variable length array column.  Note
-    that in the case of a 'J' 32-bit integer binary table column, this
-    routine will return datatype = TINT32BIT (which in fact is
-    equivalent to TLONG).  With most current C compilers, a value in a
-    'J' column has the same size as an 'int' variable, and may not be
-    equivalent to a 'long' variable, which is 64-bits long on an
-    increasing number of compilers.
 
-    The 'repeat' parameter returns the vector repeat count on the binary
-    table TFORMn keyword value; ASCII table columns always have repeat
-    = 1.  The 'width' parameter returns the width in bytes of a single
-    column value (e.g., a '10D' binary table column will have width =
-    8; an ASCII table 'F12.2' column will have width = 12);  Note that
-    this routine supports the local convention for specifying arrays of
-    fixed length strings within a binary table character column using
-    the syntax TFORM = 'rAw' where 'r' is the total number of
-    characters (= the width of the column) and 'w' is the width of a
-    unit string within the column.  Thus if the column has TFORM =
-    '60A12' then this routine will return typecode = TSTRING, repeat =
-    60, and width = 12.  A null pointer may be given for any of
-   the output parameters that are not needed. \label{ffgtcl}
-\end{description}
- 
 \begin{verbatim}
-  int fits_get_coltype / ffgtcl
-      (fitsfile *fptr, int colnum, > int *typecode, long *repeat,
-       long *width, int *status)
+  int fits_iterate_data(int narrays, iteratorCol *data, long offset,
+      long nPerLoop, int (*workFn)( ), void *userPointer, int *status);
 \end{verbatim}
- 
-\begin{description}
-\item[4 ] Return the display width of a column.  This is the length
-    of the string that will be returned by the fits\_read\_col routine
-    when reading the column as a formatted string.  The display width is
-    determined by the TDISPn keyword, if present, otherwise by the data
-   type of the column. \label{ffgcdw}
-\end{description}
- 
+
+\begin{itemize}
+\item
+
+   narrays    -- the number of columns or images that are to be passed
+                 to the work function.
+\item
+   *data --     pointer to array of structures containing information
+                about each column or image.
+
+\item
+   offset      -- if positive, this number of rows at the
+                      beginning of the table (or pixels in the image)
+                      will be skipped and will not be passed to the work
+                      function.
+
+\item
+   nPerLoop   - specifies the number of table rows (or number of
+                    image pixels) that are to be passed to the work
+                    function on each iteration.  If nPerLoop = 0
+                    then CFITSIO will calculate the optimum number
+                    for greatest efficiency.
+                    If nPerLoop is negative, then all the rows
+                    or pixels will be passed at one time, and the work
+                    function will only be called once.  If any variable
+		    length arrays are being processed, then the nPerLoop
+		    value is ignored, and the iterator will always process
+		    one row of the table at a time.
+
+\item
+   *workFn     - the name (actually the address) of the work function
+                 that is to be called by fits\_iterate\_data.
+
+\item
+   *userPointer - this is a user supplied pointer that can be used
+                  to pass ancillary information from the driver routine
+                  to the work function.  It may point to a single number,
+                  an array, or to a structure containing an arbitrary set
+                  of parameters.
+
+\item
+   *status      - The CFITSIO error status.  Should = 0 on input;
+                  a non-zero output value indicates an error.
+\end{itemize}
+
+When fits\_iterate\_data is called it first allocates memory to hold
+all the requested columns of data or image pixel arrays.  It then reads
+the input data from the FITS tables or images into the arrays then
+passes the structure with pointers to these data arrays to the work
+function.  After the work function returns, the iterator function
+writes any output columns of data or images back to the FITS files.  It
+then repeats this process for any remaining sets of rows or image
+pixels until it has processed the entire table or image or until the
+work function returns a non-zero status value.  The iterator then frees
+the memory that it initially allocated and returns control to the
+driver routine that called it.
+
+
+\section{Guidelines for Using the Iterator Function}
+
+The totaln, offset, firstn, and nvalues parameters that are passed to
+the work function are useful for determining how much of the data has
+been processed and how much remains left to do.  On the very first call
+to the work function firstn will be equal to offset + 1;  the work
+function may need to perform various initialization tasks before
+starting to  process the data. Similarly, firstn + nvalues - 1 will be
+equal to totaln on the last iteration, at which point the work function
+may need to perform some clean up operations before exiting for the
+last time.  The work function can also force an early termination of
+the iterations by returning a status value = -1.
+
+The narrays and iteratorCol.datatype arguments allow the work function
+to double check that the number of input arrays and their data types
+have the expected values.  The iteratorCol.fptr and iteratorCol.colnum
+structure elements can be used if the work function needs to read or
+write the values of other keywords in the FITS file associated with
+the array.  This should generally only be done during the
+initialization step or during the clean up step after the last set of
+data has been processed.  Extra FITS file I/O during the main
+processing loop of the work function can seriously degrade the speed of
+the program.
+
+If variable-length array columns are being processed, then the iterator
+will operate on one row of the table at a time.  In this case the
+the repeat element in the interatorCol structure will be set equal to
+the number of elements in the current row that is being processed.
+
+One important feature of the iterator is that the first element in each
+array that is passed to the work function gives the value that is used
+to represent null or undefined values in the array.  The real data then
+begins with the second element of the array (i.e., array[1], not
+array[0]).  If the first array element is equal to zero, then this
+indicates that all the array elements have defined values and there are
+no undefined values.  If array[0] is not equal to zero, then this
+indicates that some of the data values are undefined and this value
+(array[0]) is used to represent them.  In the case of output arrays
+(i.e., those arrays that will be written back to the FITS file by the
+iterator function after the work function exits) the work function must
+set the first array element to the desired null value if necessary,
+otherwise the first element should be set to zero to indicate that
+there are no null values in the output array.  CFITSIO defines 2
+values, FLOATNULLVALUE and DOUBLENULLVALUE, that can be used as default
+null values for float and double data types, respectively.  In the case
+of character string data types, a null string is always used to
+represent undefined strings.
+
+In some applications it may be necessary to recursively call the iterator
+function.  An example of this is given by one of the example programs
+that is distributed with CFITSIO: it first calls a work function that
+writes out a 2D histogram image.  That work function in turn calls
+another work function that reads the  `X' and `Y' columns in a table to
+calculate the value of each 2D histogram image pixel. Graphically, the
+program structure can be described as:
+
 \begin{verbatim}
-  int fits_get_col_display_width / ffgcdw
-      (fitsfile *fptr, int colnum, > int *dispwidth, int *status)
+ driver --> iterator --> work1_fn --> iterator --> work2_fn
 \end{verbatim}
 
- 
+Finally, it should be noted that the table columns or image arrays that
+are passed to the work function do not all have to come from the same
+FITS file and instead may come from any combination of sources as long
+as they have the same length.   The length of the first table column or
+image array is used by the iterator if they do not all have the same
+length.
+
+
+\section{Complete List of Iterator Routines}
+
+All of the iterator routines are listed below.  Most of these routines
+do not have a corresponding short function name.
+
+
 \begin{description}
-\item[5 ] Write (append) a TDIMn keyword whose value has the form '(l,m,n...)'
-    where l, m, n... are the dimensions of a multidimension array
-   column in a binary table. \label{ffptdm}
+\item[1 ]  Iterator `constructor' functions that set
+   the value of elements in the iteratorCol structure
+   that define the columns or arrays. These set the fitsfile
+    pointer, column name, column number, datatype, and iotype,
+    respectively.  The last 2 routines allow all the parameters
+    to be set with one function call (one supplies the column
+   name, the other the column number). \label{ffiterset}
 \end{description}
- 
+
+
 \begin{verbatim}
-  int fits_write_tdim / ffptdm
-      (fitsfile *fptr, int colnum, int naxis, long *naxes, > int *status)
+  int fits_iter_set_file(iteratorCol *col, fitsfile *fptr);
+
+  int fits_iter_set_colname(iteratorCol *col, char *colname);
+
+  int fits_iter_set_colnum(iteratorCol *col, int colnum);
+
+  int fits_iter_set_datatype(iteratorCol *col, int datatype);
+
+  int fits_iter_set_iotype(iteratorCol *col, int iotype);
+
+  int fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr,
+          char *colname, int datatype,  int iotype);
+
+  int fits_iter_set_by_num(iteratorCol *col, fitsfile *fptr,
+          int colnum, int datatype,  int iotype);
 \end{verbatim}
- 
+
 \begin{description}
-\item[6 ] Return the number of and size of the dimensions of a table column in
-    a binary table. Normally this information is given by the TDIMn keyword,
-    but if this keyword is not present then this routine returns naxis = 1
-   and naxes[0] equal to the repeat count in the TFORM keyword. \label{ffgtdm}
+\item[2 ]  Iterator `accessor' functions that return the value of the
+     element in the iteratorCol structure
+    that describes a particular data column or array \label{ffiterget}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_tdim / ffgtdm
-      (fitsfile *fptr, int colnum, int maxdim, > int *naxis,
-       long *naxes, int *status)
+  fitsfile * fits_iter_get_file(iteratorCol *col);
+
+  char * fits_iter_get_colname(iteratorCol *col);
+
+  int fits_iter_get_colnum(iteratorCol *col);
+
+  int fits_iter_get_datatype(iteratorCol *col);
+
+  int fits_iter_get_iotype(iteratorCol *col);
+
+  void * fits_iter_get_array(iteratorCol *col);
+
+  long fits_iter_get_tlmin(iteratorCol *col);
+
+  long fits_iter_get_tlmax(iteratorCol *col);
+
+  long fits_iter_get_repeat(iteratorCol *col);
+
+  char * fits_iter_get_tunit(iteratorCol *col);
+
+  char * fits_iter_get_tdisp(iteratorCol *col);
 \end{verbatim}
- 
+
 \begin{description}
-\item[7 ] Decode the input TDIMn keyword string (e.g. '(100,200)') and return the
-    number of and size of the dimensions of a binary table column. If the input
-    tdimstr character string is null, then this routine returns naxis = 1
-    and naxes[0] equal to the repeat count in the TFORM keyword. This routine
-   is called by fits\_read\_tdim.  \label{ffdtdm}
+\item[3 ]  The CFITSIO iterator function \label{ffiter}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_decode_tdim / ffdtdm
-      (fitsfile *fptr, char *tdimstr, int colnum, int maxdim, > int *naxis,
-       long *naxes, int *status)
+  int fits_iterate_data(int narrays,  iteratorCol *data, long offset,
+            long nPerLoop,
+            int (*workFn)( long totaln, long offset, long firstn,
+                           long nvalues, int narrays, iteratorCol *data,
+                           void *userPointer),
+            void *userPointer,
+            int *status);
 \end{verbatim}
 
- 
-\subsection{Routines to Edit Rows or Columns \label{FFIROW}}
+\chapter{ Celestial Coordinate System Routines }
+
+The FITS community has adopted a set of keyword conventions that define
+the transformations needed to convert between pixel locations in an
+image and the corresponding celestial coordinates on the sky, or more
+generally, that define world coordinates that are to be associated with
+any pixel location in an n-dimensional FITS array. CFITSIO is distributed
+with a couple of self-contained World Coordinate System (WCS) routines,
+however, these routines DO NOT support all the latest WCS conventions,
+so it is STRONGLY RECOMMENDED that software developers use a more robust
+external WCS library.  Several recommended libraries are:
 
- 
-\begin{description}
-\item[1 ] Insert blank rows into an ASCII or binary table. All the rows following
-    row FROW are shifted down by NROWS rows.  If FROW = 0 then the blank rows
-    are inserted at the beginning of the table.  This routine updates the
-    NAXIS2 keyword to reflect the new
-   number of rows in the table. \label{ffirow}
-\end{description}
- 
-\begin{verbatim}
-  int fits_insert_rows / ffirow
-      (fitsfile *fptr, long firstrow, long nrows, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Delete rows from an ASCII or binary table (in the CDU).
-    The NROWS number of rows are deleted, starting with row FROW.
-    Any remaining rows in the table are shifted up to fill in the space.
-    This routine modifies the NAXIS2 keyword to reflect the new number
-   of rows in the table.   \label{ffdrow}
-\end{description}
- 
-\begin{verbatim}
-  int fits_delete_rows / ffdrow
-      (fitsfile *fptr, long firstrow, long nrows, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[3 ] Delete a list of rows from an ASCII or binary table (in the CDU).
-    rowlist is an array of row numbers to be deleted from the table.
-    (The first row in the table is 1 not 0).  The list of
-    row numbers must be sorted in ascending order.  nrows is the
-   number of row numbers in the list. \label{ffdrws}
-\end{description}
- 
-\begin{verbatim}
-  int fits_delete_rowlist / ffdrws
-      (fitsfile *fptr, long *rowlist, long nrows, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[4 ] Insert a blank column (or columns) into an ASCII or binary
-    table.  COLNUM specifies the column number that the (first)
-    new column should occupy in the table.  NCOLS specifies how many
-    columns are to be inserted. Any existing columns from this position and
-    higher are shifted over to allow room for the new column(s).
-    The index number on all the following keywords will be incremented
-    if necessary to reflect the new position of the column(s) in the table:
-    TBCOLn, TFORMn, TTYPEn, TUNITn, TNULLn, TSCALn, TZEROn, TDISPn, TDIMn,
-    TLMINn, TLMAXn, TDMINn, TDMAXn, TCTYPn, TCRPXn, TCRVLn, TCDLTn, TCROTn,
-   and TCUNIn. \label{fficol} \label{fficls}
-\end{description}
- 
-\begin{verbatim}
-  int fits_insert_col / fficol
-      (fitsfile *fptr, int colnum, char *ttype, char *tform,
-       > int *status)
 
-  int fits_insert_cols / fficls
-      (fitsfile *fptr, int colnum, int ncols, char **ttype,
-       char **tform, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[5 ] Modify the vector length of a binary table column (e.g.,
-    change a column from TFORMn = '1E' to '20E').  The vector
-   length may be increased or decreased from the current value. \label{ffmvec}
-\end{description}
- 
-\begin{verbatim}
-  int fits_modify_vector_len / ffmvec
-      (fitsfile *fptr, int colnum, long newveclen, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[6 ] Delete a column from an  ASCII or binary table (in the CDU).
-    The index number of all the keywords listed above will be
-    decremented if necessary to reflect the new position of the column(s) in
-    the table.    The physical size of the FITS file may
-    not be reduced by this operation, and the empty FITS blocks if any
-   at the end of the file will be padded with zeros. \label{ffdcol}
-\end{description}
- 
-\begin{verbatim}
-  int fits_delete_col / ffdcol(fitsfile *fptr, int colnum, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[7 ] Copy a column from one HDU to another (or to the same HDU).  If
-    create\_col = TRUE, then a new column will be inserted in the output
-    table, at position `outcolumn', otherwise the existing output column will
-    be overwritten (in which case it must have a compatible datatype).
-   Note that the first column in a table is at colnum = 1. \label{ffcpcl}
-\end{description}
- 
 \begin{verbatim}
-int fits_copy_col / ffcpcl
-    (fitsfile *infptr, fitsfile *outfptr, int incolnum, int outcolnum,
-     int create_col, > int *status);
+  WCSLIB -  supported by Mark Calabretta
+  WCSTools - supported by Doug Mink
+  AST library - developed by the U.K. Starlink project
 \end{verbatim}
- 
-\subsection{Read and Write Column Data Routines \label{FFPCLS}}
-
-The following routines write or read data values in the current ASCII
-or binary table extension.  If a write operation extends beyond the
-current size of the table, then the number of rows in the table will
-automatically be increased and the NAXIS2 keyword value will be
-updated.  Attempts to read beyond the end of the table will result in
-an error.
 
-Automatic data type conversion is performed for numerical data types
-(only) if the data type of the column (defined by the TFORMn keyword)
-differs from the data type of the calling routine.  ASCII tables
-support the following datatype values:  TSTRING, TBYTE, TSHORT,
-TUSHORT, TINT, TUINT, TLONG, TULONG, TFLOAT, or TDOUBLE.  Binary tables
-also support TLOGICAL (internally mapped to the `char' datatype),
-TCOMPLEX, and TDBLCOMPLEX.
-
-Note that within the context of these routines, the TSTRING datatype
-corresponds to a C 'char**' datatype, i.e., a pointer to an array of
-pointers to an array of characters.  This is different from the keyword
-reading and writing routines where TSTRING corresponds to a C 'char*'
-datatype, i.e., a single pointer to an array of characters.  When
-reading strings from a table, the char arrays obviously must have been
-allocated long enough to hold the whole FITS table string.
+More information about the WCS keyword conventions and links to all of
+these WCS libraries can be found on the FITS Support Office web site at
+http://fits.gsfc.nasa.gov under the WCS link.
 
-Numerical data values are automatically scaled by the TSCALn and TZEROn
-keyword values (if they exist).
+The functions provided in these external WCS libraries will need
+access to the  WCS information contained in the FITS file headers.
+One convenient way to pass this information to the extermal library is
+to use the fits\_hdr2str routine in CFITSIO (defined below) to copy the
+header keywords into one long string, and then pass this string to an
+interface routine in the external library that will extract
+the necessary WCS information (e.g., see the astFitsChan and astPutCards
+routines in the Starlink AST library).
 
-In the case of binary tables with vector elements, the 'felem'
-parameter defines the starting element (beginning with 1, not 0) within
-the cell (a cell is defined as the intersection of a row and a column
-and may contain a single value or a vector of values).  The felem
-parameter is ignored when dealing with ASCII tables. Similarly, in the
-case of binary tables the 'nelements' parameter specifies the total
-number of vector values to be read or written (continuing on subsequent
-rows if required) and not the number of table cells.  See Appendix B
-for the further definitions of the parameters used in these routines.
 
- 
-\begin{description}
-\item[1 ] Write elements into an ASCII or binary table column. \label{ffpcl}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_col / ffpcl
-      (fitsfile *fptr, int datatype, int colnum, long firstrow,
-       long firstelem, long nelements, DTYPE *array, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Write elements into an ASCII or binary table column,
-    substituting the appropriate FITS null value for any elements that
-    are equal to the nulval parameter (note that this parameter gives the
-    address of the null value, not the null value itself).  For all ASCII
-    table columns and for integer columns in binary tables, the null value
-    to be used in the FITS file is defined  by the TNULLn keyword
-    and an error is returned if the TNULLn keyword doesn't exist.
-    For floating point columns in binary tables the special IEEE NaN
-    (Not-a-Number) value will be written into the FITS column.
-    If a null pointer is entered for nulval, then the null value is
-    ignored and this routine behaves the same as fits\_write\_col.
-   This routine must not be used to write to variable length array columns.  \label{ffpcn}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_colnull / ffpcn
-      (fitsfile *fptr, int datatype, int colnum, long firstrow,
-      long firstelem, long nelements, DTYPE *array, DTYPE *nulval,
-      > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[3 ] Set elements in a table column as undefined.  For all ASCII
-    table columns and for integer columns in binary tables, the null value
-    to be used in the FITS file is defined by the TNULLn keyword
-    and an error is returned if the TNULLn keyword doesn't exist.
-    For floating point columns in binary tables the special IEEE NaN
-   (Not-a-Number) value will be written into the FITS column.   \label{ffpclu}
-\end{description}
- 
-\begin{verbatim}
-   int fits_write_col_null / ffpclu
-       (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-        long nelements, > int *status)
-\end{verbatim}
- 
 \begin{description}
-\item[4 ] Read elements from an ASCII or binary table column.  The datatype
-    parameter specifies the datatype of the `nulval' and `array'  pointers;
-    Undefined array elements will be returned with a value = *nullval,
-    (note that this parameter gives the address of the null value, not the
-    null value itself) unless nulval = 0 or *nulval = 0, in which case no
-    checking for undefined pixels will be performed.
+\item[1 ] Concatenate the header keywords in the CHDU into a single long
+    string of characters. Each 80-character fixed-length keyword
+    record is appended to the output character string, in order, with
+    no intervening separator or terminating characters. The last header
+    record is terminated with a NULL character.  This routine allocates
+    memory for the returned character array, so the calling program must
+    free the memory when finished.
 
-    Any column, regardless of it's intrinsic datatype, may be read as a
-    string.  It should be noted however that reading a numeric column
-    as a string is 10 - 100 times slower than reading the same column
-    as a number due to the large overhead in constructing the formatted
-    strings.  The display format of the returned strings will be
-    determined by the TDISPn keyword, if it exists, otherwise by the
-    datatype of the column.  The length of the returned strings (not
-    including the null terminating character) can be determined with
-    the fits\_get\_col\_display\_width routine.  The following TDISPn
-    display formats are currently supported:
- 
-\begin{verbatim}
+    Selected keywords may be excluded from the returned character string.
+    If the second parameter (nocomments) is TRUE (nonzero) then any
+    COMMENT, HISTORY, or blank keywords in the header will not be copied
+    to the output string.
 
-    Iw.m   Integer
-    Ow.m   Octal integer
-    Zw.m   Hexadecimal integer
-    Fw.d   Fixed floating point
-    Ew.d   Exponential floating point
-    Dw.d   Exponential floating point
-    Gw.d   General; uses Fw.d if significance not lost, else Ew.d
-\end{verbatim}
-    where w is the width in characters of the displayed values, m is the minimum
-    number of digits displayed, and d is the number of digits to the right of the
-    decimal.  The .m field is optional.
-   \label{ffgcv}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_col / ffgcv
-      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
-       long nelements, DTYPE *nulval, DTYPE *array, int *anynul, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[5 ] Read elements from an ASCII or binary table column.  The datatype
-    parameter specifies the datatype of the and `array'  pointer;
-    Any undefined elements will have the corresponding nullarray element set
-   to TRUE. \label{ffgcf}
+    The 'exclist' parameter may be used to supply a list of keywords
+    that are to be excluded from the output character string. Wild card
+    characters (*, ?, and \#) may be used in the excluded keyword names.
+    If no additional keywords are to be excluded, then set nexc = 0 and
+   specify NULL for the the **header  parameter.  \label{hdr2str}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_colnull / ffgcf
-      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
-      long nelements, DTYPE *array, char *nullarray, int *anynul, int *status)
+  int fits_hdr2str
+      (fitsfile *fptr, int nocomments, char **exclist, int nexc,
+      > char **header, int *nkeys, int *status)
 \end{verbatim}
 
- 
-\section{Celestial Coordinate System Routines \label{FFGICS}}
 
-Two complimentary sets of routines are provided for calculating the
-transformation between pixel location in an image and the the
-corresponding celestial coordinates on the sky.  These routines rely on
-a set of standard World Coordinate System (WCS) keywords in the header
-of the HDU which define the parameters to be used when calculating the
-coordinate transformation.
+\section{ Self-contained WCS Routines}
 
-Both sets of routines require that a 2 step procedure be followed:
-first an initialization routine must be called to read the relevent WCS
-keywords in the header.  These parameters are then passed to a pair of
-routines that convert from pixel to sky coordinates, or from sky to
-pixel coordinates.  See Appendix B for the definition of the
-parameters used in these routines.
+The following routines DO NOT support the more recent WCS conventions
+that have been approved as part of the FITS standard.  Consequently,
+the following routines ARE NOW DEPRECATED.  It is STRONGLY RECOMMENDED
+that software developers not use these routines, and instead use an
+external WCS library, as described in the previous section.
+
+These routines are included mainly for backward compatibility with
+existing software.  They support the following standard map
+projections: -SIN, -TAN, -ARC, -NCP, -GLS, -MER, and -AIT (these are the
+legal values for the coordtype parameter).  These routines are based
+on similar functions in Classic AIPS.  All the angular quantities are
+given in units of degrees.
 
-The first set of routines described below have the advantage that they
-are completely self-contained within the CFITSIO library and thus are
-guaranteed to be available on the system.  These routines  only support
-the most common types of map projections and WCS keyword conventions
-however.
-
-The second set of routines are available in a WCS library written by
-Doug Mink at SAO.  These routines are more powerful than the ones
-contained in CFITSIO itself because they support all the defined WCS
-map projections and they  support a number of non-standard keyword
-conventions that have been adopted over the years by various different
-observatories.  To use these routines, however, requires that a
-separate WCS library be built and installed on the system in addition
-to CFITSIO.
-
- 
-\subsection{ Self-contained WCS Routines}
-
-The following routines are included in the CFITSIO library to help
-calculate the transformation between pixel location in an image and the
-corresponding celestial coordinates on the sky.  These support the
-following standard map projections:  -SIN, -TAN, -ARC, -NCP, -GLS,
-  -MER, and -AIT (these are the legal values for the coordtype
-parameter).  These routines are based on similar functions in Classic
-AIPS.  All the angular quantities are given in units of degrees.
-
- 
-\begin{description}
-\item[1 ] Get the values of all the standard FITS celestial coordinate system
-    keywords from the header of a FITS image (i.e., the primary array or
-    an image extension).  These values may then be passed to the routines
-    that perform the coordinate transformations.  If any or all of the WCS
+
+\begin{description}
+\item[1 ] Get the values of the basic set of standard FITS celestial coordinate
+    system keywords from the header of a FITS image (i.e., the primary
+    array or an IMAGE extension).  These values may then be passed to
+    the fits\_pix\_to\_world and fits\_world\_to\_pix routines that
+    perform the coordinate transformations.  If any or all of the WCS
     keywords are not present, then default values will be returned. If
     the first coordinate axis is the declination-like coordinate, then
     this routine will swap them so that the longitudinal-like coordinate
@@ -5088,34 +4225,36 @@ AIPS.  All the angular quantities are given in units of degrees.
     particular application, or whether more precise WCS transformations
    must be performed using new-style WCS keywords directly. \label{ffgics}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_read_img_coord / ffgics
       (fitsfile *fptr, > double *xrefval, double *yrefval,
        double *xrefpix, double *yrefpix, double *xinc, double *yinc,
        double *rot, char *coordtype, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[2 ] Get the values of all the standard FITS celestial coordinate system
-    keywords from the header of a FITS table where the X and Y (or RA and
-    DEC coordinates are stored in 2 separate columns of the table.
-    These values may then be passed to the routines that perform the
-   coordinate transformations. \label{ffgtcs}
+\item[2 ] Get the values of the standard FITS celestial coordinate system
+    keywords from the header of a FITS table where the X and Y (or RA
+    and DEC) coordinates are stored in 2 separate columns of the table
+    (as in the Event List table format that is often used by high energy
+    astrophysics missions).  These values may then be passed to the
+    fits\_pix\_to\_world and fits\_world\_to\_pix routines that perform
+   the coordinate transformations. \label{ffgtcs}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_read_tbl_coord / ffgtcs
       (fitsfile *fptr, int xcol, int ycol, > double *xrefval,
        double *yrefval, double *xrefpix, double *yrefpix, double *xinc,
        double *yinc, double *rot, char *coordtype, int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[3 ]  Calculate the celestial coordinate corresponding to the input
     X and Y pixel location in the image. \label{ffwldp}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_pix_to_world / ffwldp
       (double xpix, double ypix, double xrefval, double yrefval,
@@ -5123,186 +4262,42 @@ AIPS.  All the angular quantities are given in units of degrees.
        double rot, char *coordtype, > double *xpos, double *ypos,
        int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[4 ]  Calculate the X and Y pixel location corresponding to the input
     celestial coordinate in the image. \label{ffxypx}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_world_to_pix / ffxypx
       (double xpos, double ypos, double xrefval, double yrefval,
        double xrefpix, double yrefpix, double xinc, double yinc,
-       double rot, char *coordtype, double *xpix, double *ypix,
+       double rot, char *coordtype, > double *xpix, double *ypix,
        int *status)
 \end{verbatim}
 
- 
-\subsection{WCS Routines that require the WCS library}
-
-The routines described in this section use the WCS library written
-by Doug Mink at SAO.  This library is available at
-
- 
-\begin{verbatim}
-http://tdc-www.harvard.edu/software/wcstools/    and
-http://tdc-www.harvard.edu/software/wcstools/wcs.html
-\end{verbatim}
-
-You do not need the entire WCSTools package to use the routines
-described here.  Instead, you only need to install the World Coordinate
-System Subroutine library.  It is available from the
-ftp site as a gzipped .tar file (e.g., wcssubs-2.5.tar.gz) or as a
-zipped file (e.g., wcssub25.zip).  Any questions about using this
-library should be sent to the author at dmink@cfa.harvard.edu.
-
-The advantage of using the WCS library instead of the self-contained WCS
-routines decribed in the previous section is that they provide support
-for all currently defined projection geometries, and they also support
-most standard as well as many non-standard WCS keyword conventions that
-have been used by different observatories in the past.  This library is
-also actively maintained so it is likely that it will support
-any new FITS WCS keyword conventions that are adopted in the
-future.
-
-The first 3 routines described below are CFITSIO routines that create a
-character string array containing all the WCS keywords that are needed
-as input to the WCS library 'wcsinit' routine.  These 3 routines
-provide a convenient interface for calling the WCS library routines
-from CFITSIO, but do not actually call any routines in the WCS library
-themselves.
-
- 
-\begin{description}
-\item[1 ]  Copy all the WCS-related keywords from the header of the primary
-array or an image extension into a single long character string array.  The
-80-char header keywords are simply concatinated one after the other in
-the returned string.  The character array is dynamically allocated and must be
-freed by the calling program when it is no longer needed.  In the current
-implementation, all the header keywords are copied into the array.
-\end{description}
-
- 
-\begin{verbatim}
-  int fits_get_image_wcs_keys / ffgiwcs
-      (fitsfile *fptr, char **header, int *status)
-\end{verbatim}
-
- 
-\begin{description}
-\item[2 ]   Copy all the WCS-related keywords for a given pair of columns in
-a table extension into a single long character string array. The pair
-of columns must contain a list of the X and Y coordinates of each event
-in the image (i.e., this is an image in pixel-list or event-list
-format).  The names of the WCS keywords in the table header are
-translated into the keywords that would correspond to an image HDU
-(e.g., TCRPXn for the X column becomes the CRPIX1 keyword).  The
-80-char header keywords are simply concatinated one after the other in
-the string. The character array is dynamically allocated and must be
- freed by the calling program when it is no longer needed.
-\end{description}
-
- 
-\begin{verbatim}
-  int fits_get_table_wcs_keys / ffgtwcs
-      (fitsfile *fptr, int xcol, int ycol, char **header, int *status)
-\end{verbatim}
-
- 
-\begin{description}
-\item[3 ]   Copy all the WCS-related keywords for an image that is contained
-in a single vector cell of a binary table extension into a single long
-character string array. In this type of image format, the table column
-is a 2-dimensional vector and each row of the table contains an image.
-The names of the WCS keywords in the table header are translated into
-the keywords corresponding to an image (e.g., 1CRPn becomes the CRPIX1
-keyword).  The 80-char header keywords are simply concatinated one
-after the other in the string. The character array is dynamically
-allocated and must be freed by the calling program when it is no longer
- needed.
-\end{description}
-
- 
-\begin{verbatim}
-  int fits_get_imagecell_wcs_keys / ffgicwcs
-      (fitsfile *fptr, int column, long row, char **header, int *status)
-\end{verbatim}
-
- 
-\begin{description}
-\item[4 ]  This WCS library routine returns a pointer to a structure that
-contains all the WCS parameters extracted from the input header
-keywords.  The input  header keyword string can be produced by any of
-the 3 previous routines.  The returned WorldCoor structure is used as
-input to the next 2 WCS library routines that convert between sky
-coordinates and pixel coordinates.  This routine dynamically allocates
-the WorldCoor structure, so it must be freed by calling the wcsfree
- routine when it is no longer needed.
-\end{description}
-
- 
-\begin{verbatim}
-  struct WorldCoor *wcsinit (char *header)
-\end{verbatim}
-
- 
-\begin{description}
-\item[5 ]  Calculate the sky coordinate corresponding to the input pixel
-coordinate using the conversion parameters defined in the wcs
-structure.  This is a WCS library routine.
-\end{description}
-
- 
-\begin{verbatim}
-  void pix2wcs (struct WorldCoor *wcs, double xpix, double ypix,
-        > double *xpos, double *ypos)
-\end{verbatim}
-
- 
-\begin{description}
-\item[6 ] Calculate the pixel coordinate corresponding to the input sky coordinate
-using the conversion parameters defined in the wcs structure.  The returned
-offscale parameter equals 0 if the coordinate is within bounds of the image.
- This is a WCS library routine.
-\end{description}
-
- 
-\begin{verbatim}
-  void wcs2pix (struct WorldCoor *wcs, double xpos, double ypos,
-       > double *xpix, double *ypix, int *offscale)
-\end{verbatim}
-
- 
-\begin{description}
-\item[7 ]  Free the WCS structure that was created by wcsinit.  This is a WCS
-    library routine.
-\end{description}
- 
-\begin{verbatim}
-  void wcsfree(struct WorldCoor *wcs)
-\end{verbatim}
 
- 
-\section{Hierarchical Grouping Convention Support Routines}
+\chapter{  Hierarchical Grouping Routines }
 
-These functions allow for the creation and manipulation of FITS HDU Groups,
-as defined in "A Hierarchical Grouping Convention for FITS" by Jennings,
-Pence, Folk and Schlesinger
-( http: //adfwww.gsfc.nasa.gov/other/convert/group.html ). A group is a
-collection of HDUs whose association is defined by a {\it grouping table}.
-HDUs which are part of a group are referred to as {\it member HDUs} or
-simply as {\it members}. Grouping table member HDUs may themselves be
-grouping tables, thus allowing for the construction of open-ended
-hierarchies of HDUs.
+These functions allow for the creation and manipulation of FITS HDU
+Groups, as defined in "A Hierarchical Grouping Convention for FITS" by
+Jennings, Pence, Folk and Schlesinger ( http:
+//adfwww.gsfc.nasa.gov/other/convert/group.html ). A group is a
+collection of HDUs whose association is defined by a {\it grouping
+table}.  HDUs which are part of a group are referred to as {\it member
+HDUs} or simply as {\it members}. Grouping table member HDUs may
+themselves be grouping tables, thus allowing for the construction of
+open-ended hierarchies of HDUs.
 
-Grouping tables contain one row for each member HDU. The grouping table columns
-provide identification information that allows applications to reference or
-"point to" the member HDUs. Member HDUs are expected, but not required, to
-contain a set of GRPIDn/GRPLCn keywords in their headers for each grouping
-table that they are referenced by. In this sense, the GRPIDn/GRPLCn keywords
-"link" the member HDU back to its Grouping table. Note that a member HDU need
-not reside in the same FITS file as its grouping table, and that a given
-HDU may be referenced by up to 999 grouping tables simultaneously.
+Grouping tables contain one row for each member HDU. The grouping table
+columns provide identification information that allows applications to
+reference or "point to" the member HDUs. Member HDUs are expected, but
+not required, to contain a set of GRPIDn/GRPLCn keywords in their
+headers for each grouping table that they are referenced by. In this
+sense, the GRPIDn/GRPLCn keywords "link" the member HDU back to its
+Grouping table. Note that a member HDU need not reside in the same FITS
+file as its grouping table, and that a given HDU may be referenced by
+up to 999 grouping tables simultaneously.
 
 Grouping tables are implemented as FITS binary tables with up to six
 pre-defined column TTYPEn values: 'MEMBER\_XTENSION', 'MEMBER\_NAME',
@@ -5336,7 +4331,10 @@ indirectly referencing itself (thus creating an infinite loop) is protected
 against; in fact, neither function will attempt to copy or delete an HDU
 twice.
 
- 
+
+\section{Grouping Table Routines}
+
+
 \begin{description}
 \item[1 ]Create (append) a grouping table at the end of the current FITS file
    pointed to by fptr. The grpname parameter provides the grouping table
@@ -5348,12 +4346,12 @@ twice.
    position columns), GT\_ID\_REF\_URI (ID by reference and FITS file URI
   columns), and GT\_ID\_POS\_URI (ID by position and FITS file URI columns). \label{ffgtcr}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_create_group / ffgtcr
       (fitsfile *fptr, char *grpname, int grouptype, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[2 ]Create (insert) a grouping table just after the CHDU of the current FITS
    file pointed to by fptr. All HDUs below the the insertion point will be
@@ -5366,12 +4364,12 @@ twice.
    position columns), GT\_ID\_REF\_URI (ID by reference and FITS file URI
   columns), and GT\_ID\_POS\_URI (ID by position and FITS file URI columns) \label{ffgtis}.
 \end{description}
- 
+
 \begin{verbatim}
   int fits_insert_group / ffgtis
       (fitsfile *fptr, char *grpname, int grouptype, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[3 ]Change the structure of an existing grouping table pointed to by
    gfptr. The grouptype parameter (see fits\_create\_group() for valid
@@ -5384,12 +4382,12 @@ twice.
    existing members will be filled with the null values appropriate to the
   column type. \label{ffgtch}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_change_group / ffgtch
       (fitsfile *gfptr, int grouptype, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[4 ]Remove the group defined by the grouping table pointed to by gfptr, and
    optionally all the group member HDUs. The rmopt parameter specifies the
@@ -5402,12 +4400,12 @@ twice.
    If rmopt == OPT\_RM\_ALL, then other groups that contain the deleted members
   of gfptr are updated to reflect the deletion accordingly. \label{ffgtrm}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_remove_group / ffgtrm
       (fitsfile *gfptr, int rmopt, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[5 ]Copy (append) the group defined by the grouping table pointed to by infptr,
    and optionally all group member HDUs, to the FITS file pointed to by
@@ -5424,12 +4422,12 @@ twice.
    copied to a single FITS file pointed to by outfptr regardless of their
   file distribution in the original group.  \label{ffgtcp}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_copy_group / ffgtcp
       (fitsfile *infptr, fitsfile *outfptr, int cpopt, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[6 ] Merge the two groups defined by the grouping table HDUs infptr and outfptr
     by combining their members into a single grouping table. All member HDUs
@@ -5438,12 +4436,12 @@ twice.
     OPT\_MRG\_MOV then infptr is deleted after the merge. In both cases,
    the GRPIDn and GRPLCn keywords of the member HDUs are updated accordingly. \label{ffgtmg}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_merge_groups / ffgtmg
       (fitsfile *infptr, fitsfile *outfptr, int mgopt, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[7 ]"Compact" the group defined by grouping table pointed to by gfptr. The
    compaction is achieved by merging (via fits\_merge\_groups()) all direct
@@ -5455,12 +4453,12 @@ twice.
    does nothing. Note that this function is not recursive, i.e., only the
   direct member HDUs of gfptr are considered for merging. \label{ffgtcm}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_compact_group / ffgtcm
       (fitsfile *gfptr, int cmopt, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[8 ]Verify the integrity of the grouping table pointed to by gfptr to make
    sure that all group members are accessible and that all links to other
@@ -5469,12 +4467,12 @@ twice.
    value) or the first group link to fail (if negative value). If gfptr is
   successfully verified then firstfailed contains a return value of 0. \label{ffgtvf}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_verify_group / ffgtvf
       (fitsfile *gfptr, > long *firstfailed, int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[9 ] Open a grouping table that contains the member HDU pointed to by mfptr.
     The grouping table to open is defined by the grpid parameter, which
@@ -5491,12 +4489,12 @@ twice.
     In the above example, if grpid == 3, then the group specified by GRPID5
    would be opened. \label{ffgtop}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_open_group / ffgtop
       (fitsfile *mfptr, int group, > fitsfile **gfptr, int *status)
 \end{verbatim}
- 
+
 \begin{description}
 \item[10]  Add a member HDU to an existing grouping table pointed to by gfptr.
    The member HDU may either be pointed to mfptr (which must be positioned
@@ -5507,53 +4505,57 @@ twice.
    Note that if the member HDU is already a member of the group then it will
   not be added a second time. \label{ffgtam}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_add_group_member / ffgtam
       (fitsfile *gfptr, fitsfile *mfptr, int hdupos, > int *status)
 \end{verbatim}
- 
+
+
+\section{Group Member Routines}
+
+
 \begin{description}
-\item[11] Return the number of member HDUs in a grouping table gfptr. The number
+\item[1 ] Return the number of member HDUs in a grouping table gfptr. The number
     member HDUs is just the NAXIS2 value (number of rows) of the grouping
    table. \label{ffgtnm}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_get_num_members / ffgtnm
       (fitsfile *gfptr, > long *nmembers, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[12]  Return the number of groups to which the HDU pointed to by mfptr is
+\item[2 ]  Return the number of groups to which the HDU pointed to by mfptr is
      linked, as defined by the number of GRPIDn/GRPLCn keyword records that
      appear in its header. Note that each time this function is called, the
      indices of the GRPIDn/GRPLCn keywords are checked to make sure they
      are continuous (ie no gaps) and are re-enumerated to eliminate gaps if
     found.  \label{ffgmng}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_get_num_groups / ffgmng
       (fitsfile *mfptr, > long *nmembers, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[13] Open a member of the grouping table pointed to by gfptr. The member to
+\item[3 ] Open a member of the grouping table pointed to by gfptr. The member to
     open is identified by its row number within the grouping table as given
     by the parameter 'member' (first member == 1) . A fitsfile pointer to
     the opened member HDU is returned as mfptr. Note that if the member HDU
     resides in a FITS file different from the grouping table HDU then the
    member file is first opened readwrite and, failing this, opened readonly. \label{ffgmop}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_open_member / ffgmop
       (fitsfile *gfptr, long member, > fitsfile **mfptr, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[14] Copy (append) a member HDU of the grouping table pointed to by gfptr.
+\item[4 ]Copy (append) a member HDU of the grouping table pointed to by gfptr.
    The member HDU is identified by its row number within the grouping table
    as given by the parameter 'member' (first member == 1). The copy of the
    group member HDU will be appended to the FITS file pointed to by mfptr,
@@ -5563,14 +4565,14 @@ twice.
    an entry in gfptr for the copied member, and OPT\_MCP\_REPL which replaces
   the original member entry with the copied member entry. \label{ffgmcp}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_copy_member / ffgmcp
       (fitsfile *gfptr, fitsfile *mfptr, long member, int cpopt, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[15] Transfer a group member HDU from the grouping table pointed to by
+\item[5 ]Transfer a group member HDU from the grouping table pointed to by
    infptr to the grouping table pointed to by outfptr. The member HDU to
    transfer is identified by its row number within infptr as specified by
    the parameter 'member' (first member == 1). If tfopt == OPT\_MCP\_ADD then
@@ -5578,15 +4580,15 @@ twice.
    a member of outfptr and remains a member of infptr. If tfopt == OPT\_MCP\_MOV
   then the member HDU is deleted from infptr after the transfer to outfptr. \label{ffgmtf}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_transfer_member / ffgmtf
       (fitsfile *infptr, fitsfile *outfptr, long member, int tfopt,
        > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[16] Remove a member HDU from the grouping table pointed to by gfptr. The
+\item[6 ]Remove a member HDU from the grouping table pointed to by gfptr. The
    member HDU to be deleted is identified by its row number in the grouping
    table as specified by the parameter 'member' (first member == 1). The rmopt
    parameter may take on the following values: OPT\_RM\_ENTRY which
@@ -5594,2267 +4596,3857 @@ twice.
    member's GRPIDn/GRPLCn keywords, and OPT\_RM\_MBR which removes the member
   HDU entry from the grouping table and deletes the member HDU itself. \label{ffgmrm}
 \end{description}
- 
+
 \begin{verbatim}
   int fits_remove_member / ffgmrm
       (fitsfile *fptr, long member, int rmopt, > int *status)
 \end{verbatim}
-
- 
-\section{Row Selection and Calculator Routines}
 
-These routines all parse and evaluate an input string containing a user
-defined arithmetic expression.  The first 3 routines select rows in a
-FITS table, based on whether the expression evaluates to true (not
-equal to zero) or false (zero).  The other routines evaluate the
-expression and calculate a value for each row of the table.  The
-allowed expression syntax is described in the row filter section in the
-earlier `Extended File Name Syntax' chapter of this document.  See
-Appendix B for the definition of the parameters used in these
-routines.
+\chapter{ Specialized CFITSIO Interface Routines }
+
+The basic interface routines described previously are recommended
+for most uses, but the routines described in this chapter
+are also available if necessary.  Some of these routines perform more
+specialized function that cannot easily be done with the basic
+interface routines while others duplicate the functionality of the
+basic routines but have a slightly different calling sequence.
+See Appendix B for the definition of each function parameter.
+
+
+\section{FITS File Access Routines}
+
 
- 
-\begin{description}
-\item[1 ] Evaluate a boolean expression over the indicated rows, returning an
- array of flags indicating which rows evaluated to TRUE/FALSE  \label{fffrow}
-\end{description}
- 
-\begin{verbatim}
-  int fits_find_rows / fffrow
-      (fitsfile *fptr,  char *expr, long firstrow, long nrows,
-      > long *n_good_rows, char *row_status,  int *status)
-\end{verbatim}
- 
 \begin{description}
-\item[2 ] Find the first row which satisfies the input boolean expression \label{ffffrw}
+\item[1 ] Open an existing FITS file residing in core computer memory.  This
+routine is analogous to fits\_open\_file.   The 'filename'  is
+currently ignored by this routine and may be any arbitrary string. In
+general, the application must have preallocated an initial block of
+memory to hold the FITS file prior to calling this routine:  'memptr'
+points to the starting address and 'memsize' gives the initial size of
+the block of memory.  'mem\_realloc' is a pointer to an optional
+function that CFITSIO can call to allocate additional memory, if needed
+(only if mode = READWRITE), and is modeled after the standard C
+'realloc' function;  a null pointer may be given if the initial
+allocation of memory is all that will be required (e.g., if the file is
+opened with mode = READONLY).  The 'deltasize' parameter may be used to
+suggest a minimum amount of additional memory that should be allocated
+during each call to the memory reallocation function.  By default,
+CFITSIO will reallocate enough additional space to hold the entire
+currently defined FITS file (as given by the NAXISn keywords) or 1 FITS
+block (= 2880 bytes), which ever is larger.  Values of deltasize less
+than 2880 will be ignored.  Since the memory reallocation operation can
+be computationally expensive, allocating a larger initial block of
+memory, and/or specifying a larger deltasize value may help to reduce
+the number of reallocation calls and make the application program run
+ faster. \label{ffomem}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_find_first_row / ffffrw
-      (fitsfile *fptr,  char *expr, > long *rownum, int *status)
+  int fits_open_memfile / ffomem
+      (fitsfile **fptr, const char *filename, int mode, void **memptr,
+       size_t *memsize, size_t deltasize,
+       void *(*mem_realloc)(void *p, size_t newsize), int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[3 ]Evaluate an expression on all rows of a table.  If the input and output
-files are not the same, copy the TRUE rows to the output file.  If the
-files are the same, delete the FALSE rows (preserve the TRUE rows). \label{ffsrow}
+\item[2 ] Create a new FITS file residing in core computer memory.  This
+routine is analogous to fits\_create\_file.    In general, the
+application must have preallocated an initial block of memory to hold
+the FITS file prior to calling this routine:  'memptr' points to the
+starting address and 'memsize' gives the initial size of the block of
+memory.  'mem\_realloc' is a pointer to an optional function that
+CFITSIO can call to allocate additional memory, if needed, and is
+modeled after the standard C 'realloc' function;  a null pointer may be
+given if the initial allocation of memory is all that will be
+required.  The 'deltasize' parameter may be used to suggest a minimum
+amount of additional memory that should be allocated during each call
+to the memory reallocation function.  By default, CFITSIO will
+reallocate enough additional space to hold 1 FITS block (= 2880 bytes)
+and  values of deltasize less than 2880 will be ignored.  Since the
+memory reallocation operation can be computationally expensive,
+allocating a larger initial block of memory, and/or specifying a larger
+deltasize value may help to reduce the number of reallocation calls
+and make the application program run
+ faster. \label{ffimem}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_select_rows / ffsrow
-      (fitsfile *infptr, fitsfile *outfptr,  char *expr,  > int *status )
+  int fits_create_memfile / ffimem
+      (fitsfile **fptr, void **memptr,
+       size_t *memsize, size_t deltasize,
+       void *(*mem_realloc)(void *p, size_t newsize), int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[4 ] Calculate an expression for the indicated rows of a table, returning
-the results, cast as datatype (TSHORT, TDOUBLE, etc), in array.  If
-nulval==NULL, UNDEFs will be zeroed out.  For vector results, the number
-of elements returned may be less than nelements if nelements is not an
-even multiple of the result dimension.  Call fits\_test\_expr to obtain
-the dimensions of the results.  \label{ffcrow}
+\item[3 ] Reopen a FITS file that was previously opened with
+    fits\_open\_file or fits\_create\_file.  The new fitsfile
+    pointer may then be treated as a separate file, and one may
+    simultaneously read or write to 2 (or more)  different extensions in
+    the same file.   The fits\_open\_file routine (above) automatically
+    detects cases where a previously opened file is being opened again,
+    and then internally call fits\_reopen\_file, so programs should rarely
+    need to explicitly call this routine.
+\label{ffreopen}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_calc_rows / ffcrow
-      (fitsfile *fptr,  int datatype, char *expr, long firstrow,
-       long nelements, void *nulval, > void *array,  int *anynul, int *status)
+  int fits_reopen_file / ffreopen
+      (fitsfile *openfptr, fitsfile **newfptr, > int *status)
 \end{verbatim}
- 
+
+
 \begin{description}
-\item[5 ]Evaluate an expression and write the result either to a column (if
-the expression is a function of other columns in the table) or to a
-keyword (if the expression evaluates to a constant and is not a
-function of other columns in the table).  In the former case, the
-parName parameter is the name of the column (which may or may not already
-exist) into which to write the results, and parInfo contains an
-optional TFORM keyword value if a new column is being created.  If a
-TFORM value is not specified then a default format will be used,
-depending on the expression.  If the expression evalutes to a constant,
-then the result will be written to the keyword name given by the
-parName parameter, and the parInfo parameter may be used to supply an
-optional comment for the keyword.  If the keyword does not already
-exist, then the name of the keyword must be preceeded with a '\#' character,
-otherwise the result will be written to a column with that name.
- \label{ffcalc}
+\item[4 ]  Create a new FITS file, using a template file to define its
+  initial size and structure.  The template may be another FITS HDU
+  or an ASCII template file.  If the input template file name pointer
+  is null, then this routine behaves the same as fits\_create\_file.
+  The currently supported format of the ASCII template file is described
+  under the fits\_parse\_template routine (in the general Utilities
+  section)
+\label{fftplt}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_calculator / ffcalc
-      (fitsfile *infptr, char *expr, fitsfile *outfptr, char *parName,
-       char *parInfo, >  int *status)
+  int fits_create_template / fftplt
+      (fitsfile **fptr, char *filename, char *tpltfile > int *status)
 \end{verbatim}
- 
+
+
 \begin{description}
-\item[6 ] This calculator routine is similar to the previous routine, except
-that the expression is only evaluated over the specified
-row ranges.  nranges specifies the number of row ranges, and firstrow
-and lastrow give the starting and ending row number of each range.
- \label{ffcalcrng}
+\item[5 ] Parse the input filename or URL into its component parts: the file
+type (file://, ftp://, http://, etc), the base input file name, the
+name of the output file that the input file is to be copied to prior
+to opening, the HDU or extension specification, the filtering
+specifier, the binning specifier, and the column specifier.  Null
+strings will be returned for any components that are not present
+ in the input file name. \label{ffiurl}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_calculator_rng / ffcalc_rng
-      (fitsfile *infptr, char *expr, fitsfile *outfptr, char *parName,
-       char *parInfo, int nranges, long *firstrow, long *lastrow
-       >  int *status)
+  int fits_parse_input_url / ffiurl
+      (char *filename, > char *filetype, char *infile, char *outfile, char
+       *extspec, char *filter, char *binspec, char *colspec, int *status)
 \end{verbatim}
 
- 
 \begin{description}
-\item[7 ]Evaluate the given expression and return information on the result. \label{fftexp}
+\item[6 ] Parse the input filename and return the HDU number that would be
+moved to if the file were opened with fits\_open\_file.  The returned
+HDU number begins with 1 for the primary array, so for example, if the
+input filename = `myfile.fits[2]' then hdunum = 3 will be returned.
+CFITSIO does not open the file to check if the extension actually
+exists if an extension number is specified. If an extension name is
+included in the file name specification (e.g.  `myfile.fits[EVENTS]'
+then this routine will have to open the FITS file and look for the
+position of the named extension, then close file again.  This is not
+possible if the file is being read from the stdin stream, and an error
+will be returned in this case.  If the filename does not specify an
+explicit extension (e.g. 'myfile.fits') then hdunum = -99 will be
+returned, which is functionally equivalent to hdunum = 1. This routine
+is mainly used for backward compatibility in the ftools software
+package and is not recommended for general use.  It is generally better
+and more efficient to first open the FITS file with fits\_open\_file,
+then use fits\_get\_hdu\_num to determine which HDU in the file has
+been opened, rather than calling fits\_parse\_input\_url followed by a
+call to fits\_open\_file.
+ \label{ffextn}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_test_expr / fftexp
-      (fitsfile *fptr, char *expr, > int *datatype, long *nelem, int *naxis,
-       long *naxes, int *status)
+   int fits_parse_extnum / ffextn
+       (char *filename, > int *hdunum, int *status)
 \end{verbatim}
-
- 
-\section{File Checksum Routines \label{FFPCKS}}
-
-The following routines either compute or validate the checksums for the
-CHDU.  The DATASUM keyword is used to store the numerical value of the
-32-bit, 1's complement checksum for the data unit alone.  If there is
-no data unit then the value is set to zero. The numerical value is
-stored as an ASCII string of digits, enclosed in quotes, because the
-value may be too large to represent as a 32-bit signed integer.  The
-CHECKSUM keyword is used to store the ASCII encoded COMPLEMENT of the
-checksum for the entire HDU.  Storing the complement, rather than the
-actual checksum, forces the checksum for the whole HDU to equal zero.
-If the file has been modified since the checksums were computed, then
-the HDU checksum will usually not equal zero.  These checksum keyword
-conventions are based on a paper by Rob Seaman published in the
-proceedings of the ADASS IV conference in Baltimore in November 1994
-and a later revision in June 1995.  See Appendix B for the definition
-of the parameters used in these routines.
 
- 
 \begin{description}
-\item[1 ] Compute and write the DATASUM and CHECKSUM keyword values for the CHDU
-    into the current header.  If the keywords already exist, their values
-    will be updated only if necessary (i.e., if the file
-    has been modified since the original keyword
-   values were computed). \label{ffpcks}
+\item[7 ]Parse the input file name and return the root file name.  The root
+name includes the file type if specified, (e.g.  'ftp://' or 'http://')
+and the full path name, to the extent that it is specified in the input
+filename.  It does not include the HDU name or number, or any filtering
+specifications.
+ \label{ffrtnm}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_write_chksum / ffpcks
-      (fitsfile *fptr, > int *status)
+   int fits_parse_rootname / ffrtnm
+       (char *filename, > char *rootname, int *status);
 \end{verbatim}
- 
+
 \begin{description}
-\item[2 ] Update the CHECKSUM keyword value in the CHDU, assuming that the
-    DATASUM keyword exists and already has the correct value.  This routine
-    calculates the new checksum for the current header unit, adds it to the
-    data unit checksum, encodes the value into an ASCII string, and writes
-   the string to the CHECKSUM keyword. \label{ffupck}
-\end{description}
- 
+\item[8 ]Test if the input file or a compressed version of the file (with
+a .gz, .Z, .z, or .zip extension) exists on disk.  The returned value of
+the 'exists' parameter will have 1 of the 4 following values:
+
 \begin{verbatim}
-  int fits_update_chksum / ffupck
-      (fitsfile *fptr, > int *status)
+   2:  the file does not exist, but a compressed version does exist
+   1:  the disk file does exist
+   0:  neither the file nor a compressed version of the file exist
+  -1:  the input file name is not a disk file (could be a ftp, http,
+       smem, or mem file, or a file piped in on the STDIN stream)
 \end{verbatim}
- 
-\begin{description}
-\item[3 ] Verify the CHDU by computing the checksums and comparing
-    them with the keywords.  The data unit is verified correctly
-    if the computed checksum equals the value of the DATASUM
-    keyword.  The checksum for the entire HDU (header plus data unit) is
-    correct if it equals zero.  The output DATAOK and HDUOK parameters
-    in this routine are integers which will have a value = 1
-    if the data or HDU is verified correctly, a value = 0
-    if the DATASUM or CHECKSUM keyword is not present, or value = -1
-   if the computed checksum is not correct. \label{ffvcks}
+
+ \label{ffexist}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_verify_chksum / ffvcks
-      (fitsfile *fptr, > int *dataok, int *hduok, int *status)
+   int fits_file_exists / ffexist
+       (char *filename, > int *exists, int *status);
 \end{verbatim}
- 
+
 \begin{description}
-\item[4 ] Compute and return the checksum values for the CHDU
-    without creating or modifying the
-    CHECKSUM and DATASUM keywords.  This routine is used internally by
-   ffvcks, but may be useful in other situations as well. \label{ffgcks}
+\item[9 ]Flush any internal buffers of data to the output FITS file. These
+   routines rarely need to be called, but can be useful in cases where
+   other processes need to access the same FITS file in real time,
+   either on disk or in memory.  These routines also help to ensure
+   that if the application program subsequently aborts then the FITS
+   file will have been closed properly.  The first routine,
+   fits\_flush\_file is more rigorous and completely closes, then
+   reopens, the current HDU, before flushing the internal buffers, thus
+   ensuring that the output FITS file is identical to what would be
+   produced if the FITS was closed at that point (i.e., with a call to
+   fits\_close\_file).  The second routine, fits\_flush\_buffer simply
+   flushes the internal CFITSIO buffers of data to the output FITS
+   file, without updating and closing the current HDU.  This is much
+   faster, but there may be circumstances where the flushed file does
+   not completely reflect the final state of the file as it will exist
+   when the file is actually closed.
+
+   A typical use of these routines would be to flush the state of a
+   FITS table to disk after each row of the table is written.  It is
+   recommend that fits\_flush\_file be called after the first row is
+   written, then fits\_flush\_buffer may be called after each
+   subsequent row is written.  Note that this latter routine will not
+   automatically update the NAXIS2 keyword which records the number of
+   rows of data in the table, so this keyword must be explicitly
+   updated by the application program after each row is written.
+  \label{ffflus}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_get_chksum/ /ffgcks
-      (fitsfile *fptr, > unsigned long *datasum, unsigned long *hdusum,
-       int *status)
+  int fits_flush_file / ffflus
+      (fitsfile *fptr, > int *status)
+
+  int fits_flush_buffer / ffflsh
+      (fitsfile *fptr, 0, > int *status)
+
+      (Note:  The second argument must be 0).
 \end{verbatim}
- 
+
+
+\section{HDU Access Routines}
+
+
 \begin{description}
-\item[5 ] Encode a checksum value
-    into a 16-character string.  If complm is non-zero (true) then the 32-bit
-   sum value will be complemented before encoding. \label{ffesum}
+\item[1 ] Get the byte offsets in the FITS file to the start of the header
+    and the start and end of the data in the CHDU. The difference
+    between headstart and dataend equals the size of the CHDU.  If the
+    CHDU is the last HDU in the file, then dataend is also equal to the
+    size of the entire FITS file.  Null pointers may be input for any
+    of the address parameters if their values are not needed.  The
+    fits\_get\_hduaddr routine is obsolete and should no longer be
+    used.  The newer fits\_get\_hduoff routine uses the 'off\_t'
+    data type which can support offsets in large files greater than
+   2.1GB in size. \label{ffghad}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_encode_chksum / ffesum
-      (unsigned long sum, int complm, > char *ascii);
+  int fits_get_hduoff / ffghof
+       (fitsfile *fptr, > off_t *headstart, off_t *datastart, off_t *dataend,
+        int *status)
+
+  int fits_get_hduaddr / ffghad  (OBSOLETE routine)
+       (fitsfile *fptr, > long *headstart, long *datastart, long *dataend,
+        int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[6 ] Decode a 16-character checksum string into a unsigned long value.
-    If is non-zero (true). then the 32-bit sum value will be complemented
-    after decoding.  The checksum value is also returned as the
-   value of the function. \label{ffdsum}
-\end{description}
- 
+\item[2 ] Create (append) a new empty HDU at the end of the FITS file.
+    This is now  the CHDU but it is completely empty and has
+    no header keywords.  It is recommended that fits\_create\_img or
+ fits\_create\_tbl be used instead of this routine. \label{ffcrhd}
+\end{description}
+
 \begin{verbatim}
-  unsigned long fits_decode_chksum / ffdsum
-           (char *ascii, int complm, > unsigned long *sum);
+  int fits_create_hdu / ffcrhd
+      (fitsfile *fptr, > int *status)
 \end{verbatim}
- 
-\section{  Date and Time Utility Routines}
-
-The following routines help to construct or parse the FITS date/time
-strings.   Starting in the year 2000, the FITS DATE keyword values (and
-the values of other `DATE-' keywords) must have the form 'YYYY-MM-DD'
-(date only) or 'YYYY-MM-DDThh:mm:ss.ddd...' (date and time) where the
-number of decimal places in the seconds value is optional.  These times
-are in UTC.  The older 'dd/mm/yy' date format may not be used for dates
-after 01 January 2000.  See Appendix B for the definition of the
-parameters used in these routines.
 
- 
 \begin{description}
-\item[1 ] Get the current system date.  C already provides standard
-    library routines for getting the current date and time,
-    but this routine is provided for compatibility with
-    the Fortran FITSIO library.  The returned year has 4 digits
-    (1999, 2000, etc.) \label{ffgsdt}
+\item[3 ] Insert a new IMAGE extension immediately following the CHDU, or
+    insert a new Primary Array at the beginning of the file.  Any
+    following extensions in the file will be shifted down to make room
+    for the new extension.  If the CHDU is the last HDU in the file
+    then the new image extension will simply be appended to the end of
+    the file.   One can force a new primary array to be inserted at the
+    beginning of the FITS file by setting status = PREPEND\_PRIMARY prior
+    to calling the routine.  In this case the old primary array will be
+    converted to an IMAGE extension. The new extension (or primary
+    array) will become the CHDU.  Refer to Chapter 9 for a list of
+   pre-defined bitpix values.  \label{ffiimg}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_get_system_date/ffgsdt
-      ( > int *day, int *month, int *year, int *status )
+  int fits_insert_img / ffiimg
+      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
 \end{verbatim}
 
- 
 \begin{description}
-\item[2 ] Get the current system date and time string ('YYYY-MM-DDThh:mm:ss').
-The time will be in UTC/GMT if available, as indicated by a returned timeref
-value = 0.  If the returned value of timeref = 1 then this indicates that
-it was not possible to convert the local time to UTC, and thus the local
-time was returned.
+\item[4 ] Insert a new ASCII or binary table extension immediately following the CHDU.
+    Any following extensions will be shifted down to make room for the
+    new extension.  If there are no other following extensions then the
+    new table extension will simply be appended to the end of the
+    file.   If the FITS file is currently empty then this routine will
+    create a dummy primary array before appending the table to it. The
+    new extension will become the CHDU.  The tunit and extname
+    parameters are optional and a null pointer may be given if they are
+    not defined.  When inserting an ASCII table with
+    fits\_insert\_atbl, a null pointer  may given for the *tbcol
+    parameter in which case each column of the table will be separated
+    by a single space character. Similarly, if the input value of
+    rowlen is  0, then CFITSIO will calculate the default rowlength
+    based on the tbcol and ttype values.  When inserting a binary table
+    with fits\_insert\_btbl, if there are following extensions in the
+    file and if the table contains variable length array columns then
+    pcount must specify the expected final size of the data heap,
+   otherwise pcount must = 0. \label{ffitab} \label{ffibin}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_get_system_time/ffgstm
-      (> char *datestr, int  *timeref, int *status)
+  int fits_insert_atbl / ffitab
+      (fitsfile *fptr, long rowlen, long nrows, int tfields, char *ttype[],
+       long *tbcol, char *tform[], char *tunit[], char *extname, > int *status)
+
+  int fits_insert_btbl / ffibin
+      (fitsfile *fptr, long nrows, int tfields, char **ttype,
+      char **tform, char **tunit, char *extname, long pcount, > int *status)
 \end{verbatim}
 
- 
 \begin{description}
-\item[3 ] Construct a date string from the input date values.  If the year
-is between 1900 and 1998, inclusive, then the returned date string will
-have the old FITS format ('dd/mm/yy'), otherwise the date string will
-have the new FITS format ('YYYY-MM-DD').  Use fits\_time2str instead
- to always return a date string using the new FITS format. \label{ffdt2s}
+\item[5 ] Modify the size, dimensions, and/or data type of the current
+    primary array or image extension. If the new image, as specified
+    by the input arguments, is larger than the current existing image
+    in the FITS file then zero fill data will be inserted at the end
+    of the current image and any following extensions will be moved
+    further back in the file.  Similarly, if the new image is
+    smaller than the current image then any following extensions
+    will be shifted up towards the beginning of the FITS file
+    and the image data will be truncated to the new size.
+    This routine rewrites the BITPIX, NAXIS, and NAXISn keywords
+   with the appropriate values for the new image. \label{ffrsim}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_date2str/ffdt2s
-      (int year, int month, int day, > char *datestr, int *status)
+  int fits_resize_img / ffrsim
+      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
 \end{verbatim}
 
- 
 \begin{description}
-\item[4 ] Construct a new-format date + time string ('YYYY-MM-DDThh:mm:ss.ddd...').
-  If the year, month, and day values all = 0 then only the time is encoded
-  with format 'hh:mm:ss.ddd...'.  The decimals parameter specifies how many
-  decimal places of fractional seconds to include in the string.  If `decimals'
- is negative, then only the date will be return ('YYYY-MM-DD').
+\item[6 ] Copy the data (and not the header) from the CHDU associated with infptr
+    to the CHDU associated with outfptr. This will overwrite any data
+    previously in the output CHDU.  This low level routine is used by
+    fits\_copy\_hdu, but it may also be useful in certain application programs
+    that want to copy the data from one FITS file to another but also
+    want to modify the header keywords. The required FITS header keywords
+    which define the structure of the HDU must be written to the
+   output CHDU before calling this routine. \label{ffcpdt}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_time2str/fftm2s
-      (int year, int month, int day, int hour, int minute, double second,
-      int decimals, > char *datestr, int *status)
+  int fits_copy_data / ffcpdt
+      (fitsfile *infptr, fitsfile *outfptr, > int *status)
 \end{verbatim}
 
- 
 \begin{description}
-\item[5 ] Return the date as read from the input string, where the string may be
-in either the old ('dd/mm/yy')  or new ('YYYY-MM-DDThh:mm:ss' or
-'YYYY-MM-DD') FITS format.  Null pointers may be supplied for any
-  unwanted output date parameters.
+\item[7 ] This routine forces CFITSIO to rescan the current header keywords that
+    define the structure of the HDU (such as the NAXIS and BITPIX
+    keywords) so that it reinitializes the internal buffers that
+    describe the HDU structure.  This routine is useful for
+    reinitializing the structure of an HDU if any of the required
+    keywords (e.g., NAXISn) have been modified.  In practice it should
+    rarely be necessary to call this routine because CFITSIO
+   internally calls it in most situations. \label{ffrdef}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_str2date/ffs2dt
-      (char *datestr, > int *year, int *month, int *day, int *status)
+  int fits_set_hdustruc / ffrdef
+      (fitsfile *fptr, > int *status)   (DEPRECATED)
 \end{verbatim}
 
- 
+\section{Specialized Header Keyword Routines}
+
+
+\subsection{Header Information Routines}
+
+
 \begin{description}
-\item[6 ] Return the date and time as read from the input string, where the
-string may be in either the old  or new FITS format.  The returned hours,
-minutes, and seconds values will be set to zero if the input string
-does not include the time ('dd/mm/yy' or 'YYYY-MM-DD') .  Similarly,
-the returned year, month, and date values will be set to zero if the
-date is not included in the input string ('hh:mm:ss.ddd...').  Null
-pointers may be supplied for any unwanted output date and time
-parameters.
+\item[1 ] Reserve space in the CHU for MOREKEYS more header keywords.
+    This routine may be called to allocate space for additional keywords
+    at the time the header is created (prior to writing any data).
+    CFITSIO can dynamically add more space to the header when needed,
+    however it is more efficient to preallocate the required space
+   if the size is known in advance. \label{ffhdef}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_str2time/ffs2tm
-      (char *datestr, > int *year, int *month, int *day, int *hour,
-      int *minute, double *second, int *status)
+  int fits_set_hdrsize / ffhdef
+      (fitsfile *fptr, int morekeys, > int *status)
 \end{verbatim}
- 
-\section{ General Utility Routines}
-
-The following utility routines may be useful for certain applications.
-See Appendix B for the definition of the parameters used in these
-routines.
 
- 
 \begin{description}
-\item[1 ] Convert a character string to uppercase (operates in place). \label{ffupch}
+\item[2 ] Return the number of keywords in the header (not counting the END
+    keyword) and the current position
+    in the header.  The position is the number of the keyword record that
+    will be read next (or one greater than the position of the last keyword
+    that was read). A value of 1 is returned if the pointer is
+   positioned at the beginning of the header. \label{ffghps}
 \end{description}
- 
+
 \begin{verbatim}
-  void fits_uppercase / ffupch (char *string)
+  int fits_get_hdrpos / ffghps
+      (fitsfile *fptr, > int *keysexist, int *keynum, int *status)
 \end{verbatim}
- 
+
+
+\subsection{Read and Write the Required Keywords}
+
+
 \begin{description}
-\item[2 ]  Compare the input template string against the reference string
-    to see if they match.  The template string may contain wildcard
-    characters: '*' will match any sequence of characters (including
-    zero characters) and '\%' will match any single character in the
-    reference string.  If casesen = CASESEN = TRUE then the match will be
-    case sensitive, otherwise the case of the letters will be ignored
-    if casesen = CASEINSEN = FALSE.  The returned MATCH parameter will be
-    TRUE if the 2 strings match, and EXACT will be TRUE if the match is
-    exact (i.e., if no wildcard characters were used in the match).
-   Both strings must be 68 characters or less in length. \label{ffcmps}
+\item[1 ] Write the primary header or IMAGE extension keywords into the CHU.
+  The simpler fits\_write\_imghdr routine is equivalent to calling
+  fits\_write\_grphdr with the default values of simple = TRUE, pcount
+  = 0, gcount = 1, and extend = TRUE.  The PCOUNT, GCOUNT and EXTEND
+  keywords are not required in the primary header and are only written
+  if pcount is not equal to zero, gcount is not equal to zero or one,
+  and if extend is TRUE, respectively.  When writing to an IMAGE
+  extension, the SIMPLE and EXTEND parameters are ignored.  It is
+  recommended that fits\_create\_image or fits\_create\_tbl be used
+  instead of these routines to write the
+ required header keywords. \label{ffphpr} \label{ffphps}
 \end{description}
- 
+
 \begin{verbatim}
-  void fits_compare_str / ffcmps
-       (char *templt, char *string, int casesen, > int *match, int *exact)
+  int fits_write_imghdr / ffphps
+      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
+
+  int fits_write_grphdr / ffphpr
+      (fitsfile *fptr, int simple, int bitpix, int naxis, long *naxes,
+       long pcount, long gcount, int extend, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[3 ] Test that the keyword name contains only legal characters: A-Z,0-9,
-   hyphen, and underscore. \label{fftkey}
+\item[2 ] Write the ASCII table header keywords into the CHU.  The optional
+    TUNITn and EXTNAME keywords are written only if the input pointers
+    are not null.  A null pointer may given for the
+    *tbcol parameter in which case a single space will be inserted
+    between each column of the table.  Similarly, if rowlen is
+    given = 0, then CFITSIO will calculate the default rowlength based on
+   the tbcol and ttype values. \label{ffphtb}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_test_keyword / fftkey (char *keyname, > int *status)
+  int fits_write_atblhdr / ffphtb
+      (fitsfile *fptr, long rowlen, long nrows, int tfields, char **ttype,
+       long *tbcol, char **tform, char **tunit, char *extname, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[4 ] Test that the keyword record contains only legal printable ASCII characters
-   \label{fftrec}
+\item[3 ] Write the binary table header keywords into the CHU.   The optional
+   TUNITn and EXTNAME keywords are written only if the input pointers
+   are not null.  The pcount parameter, which specifies the
+   size of the variable length array heap, should initially = 0;
+   CFITSIO will automatically update the PCOUNT keyword value if any
+   variable length array data is written to the heap.  The TFORM keyword
+   value for variable length vector columns should have the form 'Pt(len)'
+   or '1Pt(len)' where `t' is the data type code letter (A,I,J,E,D, etc.)
+   and  `len' is an integer specifying the maximum length of the vectors
+   in that column (len must be greater than or equal to the longest
+   vector in the column).  If `len' is not specified when the table is
+   created (e.g., the input TFORMn value is just '1Pt') then CFITSIO will
+   scan the column when the table is first closed and will append the
+   maximum length to the TFORM keyword value.  Note that if the table
+   is subsequently modified to increase the maximum length of the vectors
+   then the modifying program is responsible for also updating the TFORM
+  keyword value.  \label{ffphbn}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_test_record / fftrec (char *card, > int *status)
+  int fits_write_btblhdr / ffphbn
+      (fitsfile *fptr, long nrows, int tfields, char **ttype,
+       char **tform, char **tunit, char *extname, long pcount, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[5 ] Test whether the current header contains any NULL (ASCII 0) characters.
-    These characters are illegal in the header, but they will go undetected
-    by most of the CFITSIO keyword header routines, because the null is
-    interpreted as the normal end-of-string terminator.  This routine returns
-    the position of the first null character in the header, or zero if there
-    are no nulls.  For example a returned value of 110 would indicate that
-    the first NULL is located in the 30th character of the second keyword
-    in the header (recall that each header record is 80 characters long).
-    Note that this is one of the few CFITSIO routines in which the returned
-    value is not necessarily equal to the status value).
-   \label{ffnchk}
+\item[4 ] Read the required keywords from the CHDU (image or table).  When
+    reading from an IMAGE extension the SIMPLE and EXTEND parameters are
+    ignored.  A null pointer may be supplied for any of the returned
+   parameters that are not needed. \label{ffghpr} \label{ffghtb} \label{ffghbn}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_null_check / ffnchk (char *card, > int *status)
+  int fits_read_imghdr / ffghpr
+      (fitsfile *fptr, int maxdim, > int *simple, int *bitpix, int *naxis,
+       long *naxes, long *pcount, long *gcount, int *extend, int *status)
+
+  int fits_read_atblhdr / ffghtb
+      (fitsfile *fptr,int maxdim, > long *rowlen, long *nrows,
+       int *tfields, char **ttype, long *tbcol, char **tform, char **tunit,
+       char *extname,  int *status)
+
+  int fits_read_btblhdr / ffghbn
+      (fitsfile *fptr, int maxdim, > long *nrows, int *tfields,
+       char **ttype, char **tform, char **tunit, char *extname,
+       long *pcount, int *status)
 \end{verbatim}
- 
+
+\subsection{Write Keyword Routines}
+
+These routines simply append a new keyword to the header and do not
+check to see if a keyword with the same name already exists.  In
+general it is preferable to use the fits\_update\_key routine to ensure
+that the same keyword is not written more than once to the header.  See
+Appendix B for the definition of the parameters used in these
+routines.
+
+
+
 \begin{description}
-\item[6 ] Parse a header keyword record and return the name of the keyword,
-    and the length of the name.
-    The keyword name normally occupies the first 8 characters of the
-    record, except under the HIERARCH convention where the name can
-   be up to 70 characters in length. \label{ffgknm}
+\item[1 ]  Write (append) a new keyword of the appropriate data type into the CHU.
+     A null pointer may be entered for the comment parameter, which
+     will cause the comment field of the keyword to be left blank.  The
+     flt, dbl, cmp, and dblcmp versions of this routine have the added
+     feature that if the 'decimals' parameter is negative, then the 'G'
+     display format rather then the 'E' format will be used when
+     constructing the keyword value, taking the absolute value of
+     'decimals' for the precision.  This will suppress trailing zeros,
+     and will use a fixed format rather than an exponential format,
+    depending on the magnitude of the value. \label{ffpkyx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_get_keyname / ffgknm
-      (char *card, > char *keyname, int *keylength, int *status)
+  int fits_write_key_str / ffpkys
+      (fitsfile *fptr, char *keyname, char *value, char *comment,
+       > int *status)
+
+  int fits_write_key_[log, lng] /  ffpky[lj]
+      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
+       > int *status)
+
+  int fits_write_key_[flt, dbl, fixflg, fixdbl] / ffpky[edfg]
+      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
+      char *comment, > int *status)
+
+  int fits_write_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffpk[yc,ym,fc,fm]
+      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
+      char *comment, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[7 ] Parse a header keyword record, returning the value (as
-    a literal character string) and comment strings.  If the keyword has no
-    value (columns 9-10 not equal to '= '), then a null value string is
-    returned and the comment string is set equal to column 9 - 80 of the
-   input string. \label{ffpsvc}
+\item[2 ] Write (append) a string valued keyword into the CHU which may be longer
+    than 68 characters in length.  This uses the Long String Keyword
+    convention that is described in the`Local FITS Conventions' section
+    in Chapter 4.  Since this uses a non-standard FITS convention to
+    encode the long keyword string, programs which use this routine
+    should also call the fits\_write\_key\_longwarn routine to add some
+    COMMENT keywords to warn users of the FITS file that this
+    convention is being used.  The fits\_write\_key\_longwarn routine
+    also writes a keyword called LONGSTRN to record the version of the
+    longstring convention that has been used, in case a new convention
+    is adopted at some point in the future.   If the LONGSTRN keyword
+    is already present in the header, then fits\_write\_key\_longwarn
+    will
+   simply return without doing anything. \label{ffpkls} \label{ffplsw}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_parse_value / ffpsvc
-      (char *card, > char *value, char *comment, int *status)
+  int fits_write_key_longstr / ffpkls
+      (fitsfile *fptr, char *keyname, char *longstr, char *comment,
+       > int *status)
+
+  int fits_write_key_longwarn / ffplsw
+      (fitsfile *fptr, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[8 ] Construct an array indexed keyword name (ROOT + nnn).
-    This routine appends the sequence number to the root string to create
-   a keyword name (e.g., 'NAXIS' + 2 = 'NAXIS2') \label{ffkeyn}
+\item[3 ] Write (append) a numbered sequence of keywords into the CHU.  The
+    starting index number (nstart) must be greater than 0. One may
+    append the same comment to every keyword (and eliminate the need
+    to have an array of identical comment strings, one for each keyword) by
+    including the ampersand character as the last non-blank character in the
+    (first) COMMENTS string parameter.  This same string
+    will then be used for the comment field in all the keywords.
+    One may also enter a null pointer for the comment parameter to
+   leave the comment field of the keyword blank. \label{ffpknx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_make_keyn / ffkeyn
-      (char *keyroot, int value, > char *keyname, int *status)
+  int fits_write_keys_str / ffpkns
+      (fitsfile *fptr, char *keyroot, int nstart, int nkeys,
+       char **value, char **comment, > int *status)
+
+  int fits_write_keys_[log, lng] / ffpkn[lj]
+      (fitsfile *fptr, char *keyroot, int nstart, int nkeys,
+       DTYPE *numval, char **comment, int *status)
+
+  int fits_write_keys_[flt, dbl, fixflg, fixdbl] / ffpkne[edfg]
+      (fitsfile *fptr, char *keyroot, int nstart, int nkey,
+       DTYPE *numval, int decimals, char **comment, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[9 ] Construct a sequence keyword name (n + ROOT).
-    This routine concatenates the sequence number to the front of the
-   root string to create a keyword name (e.g., 1 + 'CTYP' = '1CTYP') \label{ffnkey}
+\item[4 ]Copy an indexed keyword from one HDU to another, modifying
+    the index number of the keyword name in the process.  For example,
+    this routine could read the TLMIN3 keyword from the input HDU
+    (by giving keyroot = `TLMIN' and innum = 3) and write it to the
+    output HDU with the keyword name TLMIN4 (by setting outnum = 4).
+    If the input keyword does not exist, then this routine simply
+   returns without indicating an error. \label{ffcpky}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_make_nkey / ffnkey
-      (int value, char *keyroot, > char *keyname, int *status)
+  int fits_copy_key / ffcpky
+      (fitsfile *infptr, fitsfile *outfptr, int innum, int outnum,
+       char *keyroot, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[10] Determine the datatype of a keyword value string. This routine
-    parses the keyword value string  to determine its datatype.
-    Returns 'C', 'L', 'I', 'F' or 'X', for character string, logical,
-   integer, floating point, or complex, respectively. \label{ffdtyp}
+\item[5 ]Write (append) a `triple precision' keyword into the CHU in F28.16 format.
+    The floating point keyword value is constructed by concatenating the
+    input integer value with the input double precision fraction value
+    (which must have a value between 0.0 and 1.0). The ffgkyt routine should
+    be used to read this keyword value, because the other keyword reading
+   routines will not preserve the full precision of the value. \label{ffpkyt}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_get_keytype / ffdtyp
-      (char *value, > char *dtype, int *status)
+  int fits_write_key_triple / ffpkyt
+      (fitsfile *fptr, char *keyname, long intval, double frac,
+       char *comment, > int *status)
 \end{verbatim}
- 
-\begin{description}
-\item[11] Return the class of input header record.  The record is classified
-    into one of the following catagories (the class values are
-    defined in fitsio.h).  Note that this is one of the few CFITSIO
-   routines that does not return a status value. \label{ffgkcl}
-\end{description}
- 
-\begin{verbatim}
-       Class  Value             Keywords
-  TYP_STRUC_KEY  10  SIMPLE, BITPIX, NAXIS, NAXISn, EXTEND, BLOCKED,
-                     GROUPS, PCOUNT, GCOUNT, END
-                     XTENSION, TFIELDS, TTYPEn, TBCOLn, TFORMn, THEAP,
-                     and the first 4 COMMENT keywords in the primary array
-                     that define the FITS format.
-  TYP_CMPRS_KEY  20  The experimental keywords used in the compressed
-                     image format ZIMAGE, ZCMPTYPE, ZNAMEn, ZVALn,
-                     ZTILEn, ZBITPIX, ZNAXISn, ZSCALE, ZZERO, ZBLANK
-  TYP_SCAL_KEY   30  BSCALE, BZERO, TSCALn, TZEROn
-  TYP_NULL_KEY   40  BLANK, TNULLn
-  TYP_DIM_KEY    50  TDIMn
-  TYP_RANG_KEY   60  TLMINn, TLMAXn, TDMINn, TDMAXn, DATAMIN, DATAMAX
-  TYP_UNIT_KEY   70  BUNIT, TUNITn
-  TYP_DISP_KEY   80  TDISPn
-  TYP_HDUID_KEY  90  EXTNAME, EXTVER, EXTLEVEL, HDUNAME, HDUVER, HDULEVEL
-  TYP_CKSUM_KEY 100  CHECKSUM, DATASUM
-  TYP_WCS_KEY   110  CTYPEn, CUNITn, CRVALn, CRPIXn, CROTAn, CDELTn
-                     CDj_is, PVj_ms, LONPOLEs, LATPOLEs
-                     TCTYPn, TCTYns, TCUNIn, TCUNns, TCRVLn, TCRVns, TCRPXn,
-                     TCRPks, TCDn_k, TCn_ks, TPVn_m, TPn_ms, TCDLTn, TCROTn
-                     jCTYPn, jCTYns, jCUNIn, jCUNns, jCRVLn, jCRVns, iCRPXn,
-                     iCRPns, jiCDn,  jiCDns, jPVn_m, jPn_ms, jCDLTn, jCROTn
-                     (i,j,m,n are integers, s is any letter)
-  TYP_REFSYS_KEY 120 EQUINOXs, EPOCH, MJD-OBSs, RADECSYS, RADESYSs
-  TYP_COMM_KEY   130 COMMENT, HISTORY, (blank keyword)
-  TYP_CONT_KEY   140 CONTINUE
-  TYP_USER_KEY   150 all other keywords
 
-  int fits_get_keyclass / ffgkcl (char *card)
-\end{verbatim}
- 
 \begin{description}
-\item[12] Parse the 'TFORM' binary table column format string.
-    This routine parses the input TFORM character string and returns the
-    integer datatype code, the repeat count of the field, and, in the case
-    of character string fields, the length of the unit string.  See Appendix
-    B for the allowed values for the returned typecode parameter.  A
-   null pointer may be given for any output parameters that are not needed. \label{ffbnfm}
+\item[6 ]Write keywords to the CHDU that are defined in an ASCII template file.
+   The format of the template file is described under the fits\_parse\_template
+  routine. \label{ffpktp}
 \end{description}
- 
+
 \begin{verbatim}
-   int fits_binary_tform / ffbnfm
-       (char *tform, > int *typecode, long *repeat, long *width,
-        int *status)
+  int fits_write_key_template / ffpktp
+      (fitsfile *fptr, const char *filename, > int *status)
 \end{verbatim}
- 
+
+\subsection{Insert Keyword Routines}
+
+These insert routines are somewhat less efficient than the `update' or
+`write' keyword routines  because the following keywords in the header
+must be shifted down to make room for the inserted keyword.  See
+Appendix B for the definition of the parameters used in these
+routines.
+
+
 \begin{description}
-\item[13] Parse the 'TFORM' keyword value that defines the column format in
-    an ASCII table.  This routine parses the input TFORM character
-    string and returns the datatype code, the width of the column,
-    and (if it is a floating point column) the number of decimal places
-    to the right of the decimal point.  The returned datatype codes are
-    the same as for the binary table, with the following
-    additional rules:  integer columns that are between 1 and 4 characters
-    wide are defined to be short integers (code = TSHORT).  Wider integer
-    columns are defined to be regular integers (code = TLONG).  Similarly,
-    Fixed decimal point columns (with TFORM = 'Fw.d') are defined to
-    be single precision reals (code = TFLOAT) if w is between 1 and 7 characters
-    wide, inclusive.  Wider 'F' columns will return a double precision
-    data code (= TDOUBLE).  'Ew.d' format columns will have datacode = TFLOAT,
-    and 'Dw.d' format columns will have datacode = TDOUBLE. A null
-   pointer may be given for any output parameters that are not needed. \label{ffasfm}
+\item[1 ] Insert a new keyword record into the CHU at the specified position
+    (i.e., immediately preceding the (keynum)th keyword in the header.)
+  \label{ffirec}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_ascii_tform / ffasfm
-      (char *tform, > int *typecode, long *width, int *decimals,
-       int *status)
+  int fits_insert_record / ffirec
+      (fitsfile *fptr, int keynum, char *card, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[14] Calculate the starting column positions and total ASCII table width
-    based on the input array of ASCII table TFORM values.  The SPACE input
-    parameter defines how many blank spaces to leave between each column
-    (it is recommended to have one space between columns for better human
-   readability). \label{ffgabc}
+\item[2 ] Insert a new keyword into the CHU.  The new keyword is inserted
+    immediately following the last keyword that has been read from the
+    header.  The `longstr' version has the same functionality as the
+    `str' version except that it also supports the local long string
+    keyword convention for strings longer than 68 characters.  A null
+    pointer may be entered for the comment parameter which will cause
+    the comment field to be left blank.  The flt, dbl, cmp, and dblcmp
+    versions of this routine have the added
+     feature that if the 'decimals' parameter is negative, then the 'G'
+     display format rather then the 'E' format will be used when
+     constructing the keyword value, taking the absolute value of
+     'decimals' for the precision.  This will suppress trailing zeros,
+     and will use a fixed format rather than an exponential format,
+    depending on the magnitude of the value. \label{ffikyx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_get_tbcol / ffgabc
-      (int tfields, char **tform, int space, > long *rowlen,
-       long *tbcol, int *status)
+  int fits_insert_card / ffikey
+      (fitsfile *fptr, char *card, > &status)
+
+  int fits_insert_key_[str, longstr] / ffi[kys, kls]
+      (fitsfile *fptr, char *keyname, char *value, char *comment,
+       > int *status)
+
+  int fits_insert_key_[log, lng] / ffiky[lj]
+      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
+       > int *status)
+
+  int fits_insert_key_[flt, fixflt, dbl, fixdbl] / ffiky[edfg]
+      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
+       char *comment, > int *status)
+
+  int fits_insert_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffik[yc,ym,fc,fm]
+      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
+       char *comment, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[15] Parse a template header record and return a formatted 80-character string
-    suitable for appending to (or deleting from) a FITS header file.
-    This routine is useful for parsing lines from an ASCII template file
-    and reformatting them into legal FITS header records.  The formatted
-    string may then be passed to the fits\_write\_record, ffmcrd, or
-    fits\_delete\_key routines
-   to append or modify a FITS header record. \label{ffgthd}
+\item[3 ] Insert a new keyword with an undefined, or null, value into the CHU.
+   The value string of the keyword is left blank in this case. \label{ffikyu}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_parse_template / ffgthd
-      (char *templt, > char *card, int *keytype, int *status)
+  int fits_insert_key_null / ffikyu
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
 \end{verbatim}
-    The input templt character string generally should contain 3 tokens:
-    (1) the KEYNAME, (2) the VALUE, and (3) the COMMENT string.  The
-    TEMPLATE string must adhere to the following format:
 
- 
-\begin{description}
-\item[- ]     The KEYNAME token must begin in columns 1-8 and be a maximum  of 8
-        characters long.  A legal FITS keyword name may only
-        contain the characters A-Z, 0-9, and '-' (minus sign) and
-        underscore.  This routine will automatically convert any lowercase
-        characters to uppercase in the output string.  If the first 8 characters
-        of the template line are
-        blank then the remainder of the line is considered to be a FITS comment
-       (with a blank keyword name).
-\end{description}
 
- 
-\begin{description}
-\item[- ]     The VALUE token must be separated from the KEYNAME token by one or more
-        spaces and/or an '=' character.  The datatype of the VALUE token
-        (numeric, logical, or character string) is automatically determined
-        and  the output CARD string is formatted accordingly.  The value
-        token may be forced to be interpreted as a string (e.g. if it is a
-       string of numeric digits) by enclosing it in single quotes.
-\end{description}
+\subsection{Read Keyword Routines}
+
+Wild card characters may be used when specifying the name of the
+keyword to be read.
+
 
- 
 \begin{description}
-\item[- ]     The COMMENT token is optional, but if present must be separated from
-       the VALUE token by at least one blank space and a  '/' character.
+\item[1 ] Read a keyword value (with the appropriate data type) and comment from
+    the CHU.  If a NULL comment pointer is given on input, then the comment
+    string will not be returned.  If the value of the keyword is not defined
+    (i.e., the value field is blank) then an error status = VALUE\_UNDEFINED
+    will be returned and the input value will not be changed (except that
+    ffgkys will reset the value to a null string).
+  \label{ffgkyx} \label{ffgkls}
 \end{description}
 
- 
-\begin{description}
-\item[- ]     One exception to the above rules is that if the first non-blank
-        character in the first 8 characters of the template string is a
-        minus sign ('-') followed
-        by a single token, or a single token followed by an equal sign,
-        then it is interpreted as the name of a keyword which is to be
-       deleted from the FITS header.
-\end{description}
-
- 
-\begin{description}
-\item[- ]     The second exception is that if the template string starts with
-        a minus sign and is followed by 2 tokens (without an equals sign between
-        them) then the second token
-        is interpreted as the new name for the keyword specified by
-        first token.  In this case the old keyword name (first token)
-        is returned in characters 1-8 of the returned CARD string, and
-        the new keyword name (the second token) is returned in characters
-        41-48 of the returned CARD string.  These old and new names
-        may then be passed to the ffmnam routine which will change
-       the keyword name.
-\end{description}
-
-    The keytype output parameter indicates how the returned CARD string
-    should be interpreted:
- 
 \begin{verbatim}
-        keytype                  interpretation
-        -------          -------------------------------------------------
-           -2            Rename the keyword with name = the first 8 characters of CARD
-                         to the new name given in characters 41 - 48 of CARD.
+  int fits_read_key_str / ffgkys
+      (fitsfile *fptr, char *keyname, > char *value, char *comment,
+       int *status);
 
-           -1            delete the keyword with this name from the FITS header.
+  NOTE: after calling the following routine, programs must explicitly free
+        the memory allocated for 'longstr' after it is no longer needed.
 
-            0            append the CARD string to the FITS header if the
-                         keyword does not already exist, otherwise update
-                         the keyword value and/or comment field if is already exists.
+  int fits_read_key_longstr / ffgkls
+      (fitsfile *fptr, char *keyname, > char **longstr, char *comment,
+             int *status)
 
-            1            This is a HISTORY or COMMENT keyword; append it to the header
+  int fits_read_key_[log, lng, flt, dbl, cmp, dblcmp] / ffgky[ljedcm]
+      (fitsfile *fptr, char *keyname, > DTYPE *numval, char *comment,
+       int *status)
 
-            2            END record; do not explicitly write it to the FITS file.
-\end{verbatim}
-     EXAMPLES:  The following lines illustrate valid input template strings:
- 
-\begin{verbatim}
-      INTVAL 7 / This is an integer keyword
-      RVAL           34.6   /     This is a floating point keyword
-      EVAL=-12.45E-03  / This is a floating point keyword in exponential notation
-      lval F / This is a boolean keyword
-                  This is a comment keyword with a blank keyword name
-      SVAL1 = 'Hello world'   /  this is a string keyword
-      SVAL2  '123.5'  this is also a string keyword
-      sval3  123+  /  this is also a string keyword with the value '123+    '
-      # the following template line deletes the DATE keyword
-      - DATE
-      # the following template line modifies the NAME keyword to OBJECT
-      - NAME OBJECT
 \end{verbatim}
- 
+
 \begin{description}
-\item[16]  Check that the Header fill bytes (if any) are all blank.  These are the bytes
-     that may follow END keyword and before the beginning of data unit, or the end of
-     the HDU if there is no data unit.
-   \label{ffchfl}
+\item[2 ] Read a sequence of indexed keyword values (e.g., NAXIS1, NAXIS2, ...).
+    The input starting index number (nstart) must be greater than 0.
+    If the value of any of the keywords is not defined (i.e., the value
+    field is blank) then an error status = VALUE\_UNDEFINED will be
+    returned and the input value for the undefined keyword(s) will not
+    be changed.  These routines do not support wild card characters in
+    the root name.  If there are no indexed keywords in the header with
+    the input root name then these routines do not return a non-zero
+   status value and instead simply return nfound = 0. \label{ffgknx}
 \end{description}
- 
+
 \begin{verbatim}
-    int ffchfl(fitsfile *fptr, > int *status)
+  int fits_read_keys_str / ffgkns
+      (fitsfile *fptr, char *keyname, int nstart, int nkeys,
+       > char **value, int *nfound,  int *status)
+
+  int fits_read_keys_[log, lng, flt, dbl] / ffgkn[ljed]
+      (fitsfile *fptr, char *keyname, int nstart, int nkeys,
+       > DTYPE *numval, int *nfound, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[17]  Check that the Data fill bytes (if any) are all zero (for IMAGE or BINARY Table HDU)
-    or all blanks (for ASCII table HDU).  These file bytes may be
-   located after the last valid data byte in the HDU and before the physcal end of the HDU.
-     \label{ffcdfl}
+\item[3 ] Read the value of a floating point keyword, returning the integer and
+    fractional parts of the value in separate routine arguments.
+    This routine may be used to read any keyword but is especially
+    useful for reading the 'triple precision' keywords written by ffpkyt.
+  \label{ffgkyt}
 \end{description}
- 
+
 \begin{verbatim}
-    int ffcdfl(fitsfile *fptr, > int *status)
+  int fits_read_key_triple / ffgkyt
+      (fitsfile *fptr, char *keyname, > long *intval, double *frac,
+       char *comment, int *status)
 \end{verbatim}
 
-
-\chapter{   Specialized CFITSIO Interface Routines }
+\subsection{Modify Keyword Routines}
 
-The basic interface routines described in the previous chapter should
-be used  whenever possible, but the routines described in this chapter
-are also available if necessary.  Some of these routines perform more
-specialized function that cannot easily be done with the basic
-interface routines while others duplicate the functionality of the
-basic routines but have a slightly different calling sequence.  See
+These routines modify the value of an existing keyword.  An error is
+returned if the keyword does not exist.  Wild card characters may be
+used when specifying the name of the keyword to be modified.  See
 Appendix B for the definition of the parameters used in these
 routines.
 
- 
-\section{Specialized FITS File Access Routines}
 
- 
-\begin{description}
-\item[1 ] Open an existing FITS file residing in core computer memory.  This
-routine is analogous to fits\_open\_file.   The 'filename'  is
-currently ignored by this routine and may be any arbitrary string. In
-general, the application must have preallocated an initial block of
-memory to hold the FITS file prior to calling this routine:  'memptr'
-points to the starting address and 'memsize' gives the initial size of
-the block of memory.  'mem\_realloc' is a pointer to an optional
-function that CFITSIO can call to allocate additional memory, if needed
-(only if mode = READWRITE), and is modeled after the standard C
-'realloc' function;  a null pointer may be given if the initial
-allocation of memory is all that will be required (e.g., if the file is
-opened with mode = READONLY).  The 'deltasize' parameter may be used to
-suggest a minimum amount of additional memory that should be allocated
-during each call to the memory reallocation function.  By default,
-CFITSIO will reallocate enough additional space to hold the entire
-currently defined FITS file (as given by the NAXISn keywords) or 1 FITS
-block (= 2880 bytes), which ever is larger.  Values of deltasize less
-than 2880 will be ignored.  Since the memory reallocation operation can
-be computationally expensive, allocating a larger initial block of
-memory, and/or specifying a larger deltasize value may help to reduce
-the number of reallocation calls and make the application program run
- faster. \label{ffomem}
-\end{description}
- 
-\begin{verbatim}
-  int fits_open_memfile / ffomem
-      (fitsfile **fptr, const char *filename, int mode, void **memptr,
-       size_t *memsize, size_t deltasize,
-       void *(*mem_realloc)(void *p, size_t newsize), int *status)
-\end{verbatim}
- 
 \begin{description}
-\item[2 ] Create a new FITS file residing in core computer memory.  This
-routine is analogous to fits\_create\_file.    In general, the
-application must have preallocated an initial block of memory to hold
-the FITS file prior to calling this routine:  'memptr' points to the
-starting address and 'memsize' gives the initial size of the block of
-memory.  'mem\_realloc' is a pointer to an optional function that
-CFITSIO can call to allocate additional memory, if needed, and is
-modeled after the standard C 'realloc' function;  a null pointer may be
-given if the initial allocation of memory is all that will be
-required.  The 'deltasize' parameter may be used to suggest a minimum
-amount of additional memory that should be allocated during each call
-to the memory reallocation function.  By default, CFITSIO will
-reallocate enough additional space to hold 1 FITS block (= 2880 bytes)
-and  values of deltasize less than 2880 will be ignored.  Since the
-memory reallocation operation can be computationally expensive,
-allocating a larger initial block of memory, and/or specifying a larger
-deltasize value may help to reduce the number of reallocation calls
-and make the application program run
- faster. \label{ffimem}
+\item[1 ] Modify (overwrite) the nth 80-character header record in the CHU. \label{ffmrec}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_create_memfile / ffimem
-      (fitsfile **fptr, void **memptr,
-       size_t *memsize, size_t deltasize,
-       void *(*mem_realloc)(void *p, size_t newsize), int *status)
+  int fits_modify_record / ffmrec
+      (fitsfile *fptr, int keynum, char *card, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[3 ]Flush any internal buffers of data to the output FITS file. This
-   routine rarely needs to be called, but can be useful when writing to
-   the FITS files in memory, and will ensure
-   that if the program subsequently aborts then the FITS file will
-  have been closed properly. \label{ffflus}
+\item[2 ] Modify (overwrite) the 80-character header record for the named keyword
+    in the CHU.  This can be used to overwrite the name of the keyword as
+   well as its value and comment fields. \label{ffmcrd}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_flush_file / ffflus
-      (fitsfile *fptr, > int *status)
+  int fits_modify_card / ffmcrd
+      (fitsfile *fptr, char *keyname, char *card, > int *status)
 \end{verbatim}
-
- 
-\section{Specialized HDU Access Routines}
 
- 
 \begin{description}
-\item[1 ] Get the byte offsets in the FITS file to the start of the header
-    and the start and end of the data in the CHDU. The difference
-    between headstart and dataend equals the size of the CHDU.  If the
-    CHDU is the last HDU in the file, then dataend is also equal to the
-    size of the entire FITS file.  Null pointers may be input for any
-    of the address parameters if their values are not needed.  The
-    fits\_get\_hduaddr routine is obsolete and should no longer be
-    used.  The newer fits\_get\_hduoff routine uses the 'off\_t'
-    datatype which can support offsets in large files greater than
-   2.1GB in size. \label{ffghad}
+\item[5 ] Modify the value and comment fields of an existing keyword in the CHU.
+    The `longstr' version has the same functionality as the `str'
+    version except that it also supports the local long string keyword
+    convention for strings longer than 68 characters.  Optionally, one
+    may modify only the value field and leave the comment field
+    unchanged by setting the input COMMENT parameter equal to the
+    ampersand character (\&) or by entering a null pointer for the
+    comment parameter.  The flt, dbl, cmp, and dblcmp versions of this
+    routine have the added feature that if the 'decimals' parameter is
+    negative, then the 'G' display format rather then the 'E' format
+    will be used when constructing the keyword value, taking the
+    absolute value of 'decimals' for the precision.  This will suppress
+    trailing zeros, and will use a fixed format rather than an
+    exponential format,
+   depending on the magnitude of the value. \label{ffmkyx}
 \end{description}
- 
-\begin{verbatim}
-  int fits_get_hduoff / ffghof
-       (fitsfile *fptr, > off_t *headstart, off_t *datastart, off_t *dataend,
-        int *status)
 
-  int fits_get_hduaddr / ffghad  (OBSOLETE routine)
-       (fitsfile *fptr, > long *headstart, long *datastart, long *dataend,
-        int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Create (append) a new empty HDU at the end of the FITS file.
-    This is now  the CHDU but it is completely empty and has
-    no header keywords.  It is recommended that fits\_create\_img or
- fits\_create\_tbl be used instead of this routine. \label{ffcrhd}
-\end{description}
- 
 \begin{verbatim}
-  int fits_create_hdu / ffcrhd
-      (fitsfile *fptr, > int *status)
+  int fits_modify_key_[str, longstr] / ffm[kys, kls]
+      (fitsfile *fptr, char *keyname, char *value, char *comment,
+       > int *status);
+
+  int fits_modify_key_[log, lng] / ffmky[lj]
+      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
+       > int *status)
+
+  int fits_modify_key_[flt, dbl, fixflt, fixdbl] / ffmky[edfg]
+      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
+       char *comment, > int *status)
+
+  int fits_modify_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffmk[yc,ym,fc,fm]
+      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
+       char *comment, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[3 ] Insert a new IMAGE extension immediately following the CHDU.
-    Any following extensions will be shifted down to make room for
-    the new extension.  If there are no other following extensions
-    then the new image extension will simply be appended to the
-    end of the file.  The new extension will become the CHDU.
-   Refer to Chapter 9 for a list of pre-defined bitpix values. \label{ffiimg}
+\item[6 ] Modify the value of an existing keyword to be undefined, or null.
+    The value string of the keyword is set to blank.
+    Optionally, one may leave the comment field unchanged by setting the
+    input COMMENT parameter equal to
+   the ampersand character (\&) or by entering a null pointer.  \label{ffmkyu}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_insert_img / ffiimg
-      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
+  int fits_modify_key_null / ffmkyu
+      (fitsfile *fptr, char *keyname, char *comment, > int *status)
 \end{verbatim}
- 
+
+\subsection{Update Keyword Routines}
+
+
 \begin{description}
-\item[4 ] Insert a new ASCII or binary table extension immediately following the CHDU.
-    Any following extensions will be shifted down to make room for
-    the new extension.  If there are no other following extensions
-    then the new table extension will simply be appended to the
-    end of the file.   If the FITS file is currently empty
-    then this routine will create a dummy primary array before
-    appending the table to it. The new extension will become the CHDU.
-    The tunit and
-    extname parameters are optional and a null pointer may be given
-    if they are not defined.  When inserting an ASCII table with
-    fits\_insert\_atbl, a null pointer  may given for the
-    *tbcol parameter in which case each column of the table
-    will be separated by a single space character. Similarly, if the
-    input value of rowlen is  0, then CFITSIO will calculate
-    the default rowlength based on the tbcol and ttype values.
-    When inserting a binary table with fits\_insert\_btbl,
-    if there are following extensions in the file and if
-    the table contains variable length array columns
-    then pcount must specify the expected final size of the data heap,
-   otherwise pcount must = 0. \label{ffitab} \label{ffibin}
+\item[1 ] These update routines modify the value, and optionally the comment field,
+    of the keyword if it already exists, otherwise the new keyword is
+    appended to the header.  A separate routine is provided for each
+    keyword data type.  The `longstr' version has the same functionality
+    as the `str' version except that it also supports the local long
+    string keyword convention for strings longer than 68 characters.  A
+    null pointer may be entered for the comment parameter which will
+    leave the comment field unchanged or blank.  The flt, dbl, cmp, and
+    dblcmp versions of this routine have the added feature that if the
+    'decimals' parameter is negative, then the 'G' display format
+    rather then the 'E' format will be used when constructing the
+    keyword value, taking the absolute value of 'decimals' for the
+    precision.  This will suppress trailing zeros, and will use a fixed
+    format rather than an exponential format,
+   depending on the magnitude of the value. \label{ffukyx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_insert_atbl / ffitab
-      (fitsfile *fptr, long rowlen, long nrows, int tfields, char *ttype[],
-       long *tbcol, char *tform[], char *tunit[], char *extname, > int *status)
+  int fits_update_key_[str, longstr] / ffu[kys, kls]
+      (fitsfile *fptr, char *keyname, char *value, char *comment,
+       > int *status)
 
-  int fits_insert_btbl / ffibin
-      (fitsfile *fptr, long nrows, int tfields, char **ttype,
-      char **tform, char **tunit, char *extname, long pcount, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[5 ] Modify the size, dimensions, and/or datatype of the current
-    primary array or image extension. If the new image, as specified
-    by the input arguments, is larger than the current existing image
-    in the FITS file then zero fill data will be inserted at the end
-    of the current image and any following extensions will be moved
-    further back in the file.  Similarly, if the new image is
-    smaller than the current image then any following extensions
-    will be shifted up towards the beginning of the FITS file
-    and the image data will be truncated to the new size.
-    This routine rewrites the BITPIX, NAXIS, and NAXISn keywords
-   with the appropriate values for the new image. \label{ffrsim}
-\end{description}
- 
-\begin{verbatim}
-  int fits_resize_img / ffrsim
-      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
+  int fits_update_key_[log, lng] / ffuky[lj]
+      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
+       > int *status)
+
+  int fits_update_key_[flt, dbl, fixflt, fixdbl] / ffuky[edfg]
+      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
+       char *comment, > int *status)
+
+  int fits_update_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffuk[yc,ym,fc,fm]
+      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
+       char *comment, > int *status)
 \end{verbatim}
- 
+
+
+\section{Define Data Scaling and Undefined Pixel Parameters}
+
+These routines set or modify the internal parameters used by CFITSIO
+to either scale the data or to represent undefined pixels.  Generally
+CFITSIO will scale the data according to the values of the BSCALE and
+BZERO (or TSCALn and TZEROn) keywords, however these routines may be
+used to override the keyword values.  This may be useful when one wants
+to read or write the raw unscaled values in the FITS file.  Similarly,
+CFITSIO generally uses the value of the BLANK or TNULLn keyword to
+signify an undefined pixel, but these routines may be used to override
+this value.  These routines do not create or modify the corresponding
+header keyword values.  See Appendix B for the definition of the
+parameters used in these routines.
+
+
 \begin{description}
-\item[6 ] Copy the header (and not the data) from the CHDU associated with infptr
-    to the CHDU associated with outfptr.  If the current output HDU
-    is not completely empty, then the CHDU will be closed and a new
-    HDU will be appended to the output file.  This routine will automatically
-    transform the necessary keywords when copying a primary array to
-    and image extension, or an image extension to a primary array.
-   An empty output data unit will be created (all values = 0). \label{ffcphd}
+\item[1 ] Reset the scaling factors in the primary array or image extension; does
+    not change the BSCALE and BZERO keyword values and only affects the
+    automatic scaling performed when the data elements are written/read
+    to/from the FITS file.   When reading from a FITS file the returned
+    data value = (the value given in the FITS array) * BSCALE + BZERO.
+    The inverse formula is used when writing data values to the FITS
+   file. \label{ffpscl}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_copy_header / ffcphd
-      (fitsfile *infptr, fitsfile *outfptr, > int *status)
+  int fits_set_bscale / ffpscl
+      (fitsfile *fptr, double scale, double zero, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[7 ] Copy the data (and not the header) from the CHDU associated with infptr
-    to the CHDU associated with outfptr. This will overwrite any data
-    previously in the output CHDU.  This low level routine is used by
-    fits\_copy\_hdu, but it may also be useful in certain application programs
-    that want to copy the data from one FITS file to another but also
-    want to modify the header keywords. The required FITS header keywords
-    which define the structure of the HDU must be written to the
-   output CHDU before calling this routine. \label{ffcpdt}
+\item[2 ] Reset the scaling parameters for a table column; does not change
+    the TSCALn or TZEROn keyword values and only affects the automatic
+    scaling performed when the data elements are written/read to/from
+    the FITS file.  When reading from a FITS file the returned data
+    value = (the value given in the FITS array) * TSCAL + TZERO.  The
+    inverse formula is used when writing data values to the FITS file.
+   \label{fftscl}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_copy_data / ffcpdt
-      (fitsfile *infptr, fitsfile *outfptr, > int *status)
+  int fits_set_tscale / fftscl
+      (fitsfile *fptr, int colnum, double scale, double zero,
+       > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[8 ] This routine forces CFITSIO to rescan the current header keywords that
-    define the structure of the HDU (such as the NAXIS and BITPIX
-    keywords) so that it reinitializes the internal buffers that
-    describe the HDU structure.  This routine is useful for
-    reinitializing the structure of an HDU if any of the required
-    keywords (e.g., NAXISn) have been modified.  In practice it should
-    rarely be necessary to call this routine because CFITSIO
-   internally calls it in most situations. \label{ffrdef}
+\item[3 ] Define the integer value to be used to signify undefined pixels in the
+    primary array or image extension.  This is only used if BITPIX = 8, 16,
+    or 32.  This does not create or change the value of the BLANK keyword in
+   the header. \label{ffpnul}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_set_hdustruc / ffrdef
-      (fitsfile *fptr, > int *status)   (DEPRECATED)
+  int fits_set_imgnul / ffpnul
+      (fitsfile *fptr, long nulval, > int *status)
 \end{verbatim}
-
- 
-\section{Specialized Header Keyword Routines}
-
- 
-\subsection{Header Information Routines}
 
- 
 \begin{description}
-\item[1 ] Reserve space in the CHU for MOREKEYS more header keywords.
-    This routine may be called to allocate space for additional keywords
-    at the time the header is created (prior to writing any data).
-    CFITSIO can dynamically add more space to the header when needed,
-    however it is more efficient to preallocate the required space
-   if the size is known in advance. \label{ffhdef}
+\item[4 ] Define the string to be used to signify undefined pixels in
+    a column in an ASCII table.  This does not create or change the value
+   of the TNULLn keyword. \label{ffsnul}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_set_hdrsize / ffhdef
-      (fitsfile *fptr, int morekeys, > int *status)
+  int fits_set_atblnull / ffsnul
+      (fitsfile *fptr, int colnum, char *nulstr, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[2 ] Return the number of keywords in the header (not counting the END
-    keyword) and the current position
-    in the header.  The position is the number of the keyword record that
-    will be read next (or one greater than the position of the last keyword
-    that was read). A value of 1 is returned if the pointer is
-   positioned at the beginning of the header. \label{ffghps}
+\item[5 ] Define the value to be used to signify undefined pixels in
+    an integer column in a binary table (where TFORMn = 'B', 'I', or 'J').
+    This does not create or  change the value of the TNULLn keyword.
+   \label{fftnul}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_get_hdrpos / ffghps
-      (fitsfile *fptr, > int *keysexist, int *keynum, int *status)
+  int fits_set_btblnull / fftnul
+      (fitsfile *fptr, int colnum, long nulval, > int *status)
 \end{verbatim}
+
+
+\section{Specialized FITS Primary Array or IMAGE Extension I/O Routines}
+
+These routines read or write data values in the primary data array
+(i.e., the first HDU in the FITS file) or an IMAGE extension.
+Automatic data type conversion is performed for if the data type of the
+FITS array (as defined by the BITPIX keyword) differs from the data
+type of the array in the calling routine.  The data values are
+automatically scaled by the BSCALE and BZERO header values as they are
+being written or read from the FITS array.  Unlike the basic routines
+described in the previous chapter, most of these routines specifically
+support the FITS random groups format.  See Appendix B for the
+definition of the parameters used in these routines.
+
+The more primitive reading and writing routines (i. e., ffppr\_,
+ffppn\_, ffppn, ffgpv\_, or ffgpf\_) simply treat the primary array as
+a long 1-dimensional array of pixels, ignoring the intrinsic
+dimensionality of the array.  When dealing with a 2D image, for
+example, the application program must calculate the pixel offset in the
+1-D array that corresponds to any particular X, Y coordinate in the
+image.  C programmers should note that the ordering of arrays in FITS
+files, and hence in all the CFITSIO calls, is more similar to the
+dimensionality of arrays in Fortran rather than C.  For instance if a
+FITS image has NAXIS1 = 100 and NAXIS2 = 50, then a 2-D array just
+large enough to hold the image should be declared as array[50][100] and
+not as array[100][50].
+
+For convenience, higher-level routines are also provided to specificly
+deal with 2D images (ffp2d\_ and ffg2d\_) and 3D data cubes (ffp3d\_
+and ffg3d\_).  The dimensionality of the FITS image is passed by the
+naxis1, naxis2, and naxis3 parameters and the declared dimensions of
+the program array are passed in the dim1 and dim2 parameters.  Note
+that the dimensions of the program array may be larger than the
+dimensions of the FITS array.  For example if a FITS image with NAXIS1
+= NAXIS2 = 400 is read into a program array which is dimensioned as 512
+x 512 pixels, then the image will just fill the lower left corner of
+the array with pixels in the range 1 - 400 in the X an Y directions.
+This has the effect of taking a contiguous set of pixel value in the
+FITS array and writing them to a non-contiguous array in program memory
+(i.e., there are now some blank pixels around the edge of the image in
+the program array).
+
+The most general set of routines (ffpss\_, ffgsv\_, and ffgsf\_) may be
+used to transfer a rectangular subset of the pixels in a FITS
+N-dimensional image to or from an array which has been declared in the
+calling program.  The fpixel and lpixel parameters are integer arrays
+which specify the starting and ending pixel coordinate in each dimension
+(starting with 1, not 0) of the FITS image that is to be read or
+written.  It is important to note that these are the starting and
+ending pixels in the FITS image, not in the declared array in the
+program. The array parameter in these routines is treated simply as a
+large one-dimensional array of the appropriate data type containing the
+pixel values; The pixel values in the FITS array are read/written
+from/to this program array in strict sequence without any gaps;  it is
+up to the calling routine to correctly interpret the dimensionality of
+this array.  The two FITS reading routines (ffgsv\_ and ffgsf\_ ) also
+have an `inc' parameter which defines the data sampling interval in
+each dimension of the FITS array.  For example, if inc[0]=2 and
+inc[1]=3 when reading a 2-dimensional FITS image, then only every other
+pixel in the first dimension and every 3rd pixel in the second
+dimension will be returned to the 'array' parameter.
+
+Two types of routines are provided to read the data array which differ in
+the way undefined pixels are handled.  The first type of routines (e.g.,
+ffgpv\_) simply return an array of data elements in which undefined
+pixels are set equal to a value specified by the user in the `nulval'
+parameter.  An additional feature of these routines is that if the user
+sets nulval = 0, then no checks for undefined pixels will be performed,
+thus reducing the amount of CPU processing.  The second type of routines
+(e.g., ffgpf\_) returns the data element array and, in addition, a char
+array that indicates whether the value of the corresponding data pixel
+is undefined (= 1) or defined (= 0).  The latter type of routines may
+be more convenient to use in some circumstances, however, it requires
+an additional array of logical values which can be unwieldy when working
+with large data arrays.
 
- 
-\subsection{Read and Write the Required Keywords}
 
- 
 \begin{description}
-\item[1 ] Write the primary header or IMAGE extension keywords into the CHU.
-  The simpler fits\_write\_imghdr routine is equivalent to calling
-  fits\_write\_grphdr with the default values of simple = TRUE, pcount = 0,
-  gcount = 1, and extend =
-  TRUE.  The PCOUNT, GCOUNT and EXTEND keywords are not required in the
-  primary header and are only written if pcount is not equal to zero,
-  gcount is not equal to zero or one, and if extend is TRUE,
-  respectively.  When writing to an IMAGE extension, the SIMPLE and
-  EXTEND parameters are ignored.  It is recommended that fits\_create\_image
-  or fits\_create\_tbl be used instead of these routines to write the
- required header keywords. \label{ffphpr} \label{ffphps}
+\item[1 ] Write elements into the FITS data array.
+ \label{ffppr} \label{ffpprx} \label{ffppn} \label{ffppnx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_write_imghdr / ffphps
-      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
+  int fits_write_img / ffppr
+      (fitsfile *fptr, int datatype, long firstelem, long nelements,
+       DTYPE *array, int *status);
 
-  int fits_write_grphdr / ffphpr
-      (fitsfile *fptr, int simple, int bitpix, int naxis, long *naxes,
-       long pcount, long gcount, int extend, > int *status)
+  int fits_write_img_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffppr[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long firstelem, long nelements,
+       DTYPE *array, > int *status);
+
+  int fits_write_imgnull / ffppn
+      (fitsfile *fptr, int datatype, long firstelem, long nelements,
+       DTYPE *array, DTYPE *nulval, > int *status);
+
+  int fits_write_imgnull_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffppn[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long firstelem,
+           long nelements, DTYPE *array, DTYPE nulval, > int *status);
 \end{verbatim}
- 
+
 \begin{description}
-\item[2 ] Write the ASCII table header keywords into the CHU.  The optional
-    TUNITn and EXTNAME keywords are written only if the input pointers
-    are not null.  A null pointer may given for the
-    *tbcol parameter in which case a single space will be inserted
-    between each column of the table.  Similarly, if rowlen is
-    given = 0, then CFITSIO will calculate the default rowlength based on
-   the tbcol and ttype values. \label{ffphtb}
+\item[2 ]Set data array elements as undefined. \label{ffppru}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_write_atblhdr / ffphtb
-      (fitsfile *fptr, long rowlen, long nrows, int tfields, char **ttype,
-       long *tbcol, char **tform, char **tunit, char *extname, > int *status)
+  int fits_write_img_null / ffppru
+      (fitsfile *fptr, long group, long firstelem, long nelements,
+       > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[3 ] Write the binary table header keywords into the CHU.   The optional
-   TUNITn and EXTNAME keywords are written only if the input pointers
-   are not null.  The pcount parameter, which specifies the
-   size of the variable length array heap, should initially = 0;
-   CFITSIO will automatically update the PCOUNT keyword value if any
-   variable length array data is written to the heap.  The TFORM keyword
-   value for variable length vector columns should have the form 'Pt(len)'
-   or '1Pt(len)' where `t' is the data type code letter (A,I,J,E,D, etc.)
-   and  `len' is an integer specifying the maximum length of the vectors
-   in that column (len must be greater than or equal to the longest
-   vector in the column).  If `len' is not specified when the table is
-   created (e.g., the input TFORMn value is just '1Pt') then CFITSIO will
-   scan the column when the table is first closed and will append the
-   maximum length to the TFORM keyword value.  Note that if the table
-   is subsequently modified to increase the maximum length of the vectors
-   then the modifying program is responsible for also updating the TFORM
-  keyword value.  \label{ffphbn}
+\item[3 ] Write values into group parameters.  This routine only applies
+    to the `Random Grouped' FITS format which has been used for
+    applications in radio interferometry, but is officially deprecated
+   for future use.  \label{ffpgpx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_write_btblhdr / ffphbn
-      (fitsfile *fptr, long nrows, int tfields, char **ttype,
-       char **tform, char **tunit, char *extname, long pcount, > int *status)
+  int fits_write_grppar_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffpgp[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long firstelem, long nelements,
+       > DTYPE *array, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[4 ] Read the primary header or IMAGE extension keywords in the CHU.  When
-    reading from an IMAGE extension the SIMPLE and EXTEND parameters are
-    ignored.  A null pointer may be supplied for any of the returned
-   parameters that are not needed. \label{ffghpr}
+\item[4 ] Write a 2-D or 3-D image into the data array. \label{ffp2dx} \label{ffp3dx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_imghdr / ffghpr
-      (fitsfile *fptr, int maxdim, > int *simple, int *bitpix, int *naxis,
-       long *naxes, long *pcount, long *gcount, int *extend, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[5 ] Read the ASCII table header keywords in the CHU.
-    A null pointer may be supplied for any of the returned
-   parameters that are not needed. \label{ffghtb}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_atblhdr / ffghtb
-      (fitsfile *fptr,int maxdim, > long *rowlen, long *nrows,
-       int *tfields, char **ttype, long *tbcol, char **tform, char **tunit,
-       char *extname,  int *status)
+  int fits_write_2d_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffp2d[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long dim1, long naxis1,
+       long naxis2, DTYPE *array, > int *status)
+
+  int fits_write_3d_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffp3d[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long dim1, long dim2,
+       long naxis1, long naxis2, long naxis3, DTYPE *array, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[6 ]Read the binary table header keywords from the CHU.
-    A null pointer may be supplied for any of the returned
-   parameters that are not needed. \label{ffghbn}
+\item[5 ]  Write an arbitrary data subsection into the data array. \label{ffpssx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_btblhdr / ffghbn
-      (fitsfile *fptr, int maxdim, > long *nrows, int *tfields,
-       char **ttype, char **tform, char **tunit, char *extname,
-       long *pcount, int *status)
+  int fits_write_subset_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffpss[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long naxis, long *naxes,
+       long *fpixel, long *lpixel, DTYPE *array, > int *status)
 \end{verbatim}
- 
-\subsection{Specialized Write Keyword Routines}
-
-These routines simply append a new keyword to the header and do not
-check to see if a keyword with the same name already exists.  In
-general it is preferable to use the fits\_update\_key routine to ensure
-that the same keyword is not written more than once to the header.  See
-Appendix B for the definition of the parameters used in these
-routines.
 
- 
 \begin{description}
-\item[1 ] Write (append) a new keyword with an undefined, or null, value into the CHU.
-    The value string of the keyword is left blank in this case.  A null
-   pointer may be entered for the comment parameter. \label{ffpkyu}
+\item[6 ] Read elements from the FITS data array.
+    \label{ffgpv} \label{ffgpvx} \label{ffgpf} \label{ffgpfx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_write_key_null / ffpkyu
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+  int fits_read_img / ffgpv
+      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
+       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
+
+  int fits_read_img_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffgpv[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, long group, long firstelem, long nelements,
+       DTYPE nulval, > DTYPE *array, int *anynul, int *status)
+
+  int fits_read_imgnull / ffgpf
+      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
+       > DTYPE *array, char *nullarray, int *anynul, int *status)
+
+  int  fits_read_imgnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
+       ffgpf[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, long group, long firstelem, long nelements,
+       > DTYPE *array, char *nullarray, int *anynul, int *status)
 \end{verbatim}
 
- 
 \begin{description}
-\item[2 ]  Write (append) a new keyword of the appropriate datatype into the CHU.
-     A null pointer may be entered for the comment parameter, which
-     will cause the comment field of the keyword to be left blank.  The
-     flt, dbl, cmp, and dblcmp versions of this routine have the added
-     feature that if the 'decimals' parameter is negative, then the 'G'
-     display format rather then the 'E' format will be used when
-     constructing the keyword value, taking the absolute value of
-     'decimals' for the precision.  This will suppress trailing zeros,
-     and will use a fixed format rather than an exponential format,
-    depending on the magnitude of the value. \label{ffpkyx}
+\item[7 ] Read values from group parameters.  This routine only applies
+    to the `Random Grouped' FITS format which has been used for
+    applications in radio interferometry, but is officially deprecated
+   for future use. \label{ffggpx}
 \end{description}
- 
-\begin{verbatim}
-  int fits_write_key_str / ffpkys
-      (fitsfile *fptr, char *keyname, char *value, char *comment,
-       > int *status)
-
-  int fits_write_key_[log, lng] /  ffpky[lj]
-      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
-       > int *status)
-
-  int fits_write_key_[flt, dbl, fixflg, fixdbl] / ffpky[edfg]
-      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
-      char *comment, > int *status)
 
-  int fits_write_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffpk[yc,ym,fc,fm]
-      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
-      char *comment, > int *status)
+\begin{verbatim}
+  int  fits_read_grppar_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffggp[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, long group, long firstelem, long nelements,
+       > DTYPE *array, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[3 ] Write (append) a string valued keyword into the CHU which may be longer
-    than 68 characters in length.  This uses the Long String Keyword
-    convention that is described in the`Local FITS Conventions' section
-    in Chapter 4.  Since this uses a non-standard FITS convention to
-    encode the long keyword string, programs which use this routine
-    should also call the fits\_write\_key\_longwarn routine to add some
-    COMMENT keywords to warn users of the FITS file that this
-    convention is being used.  The fits\_write\_key\_longwarn routine
-    also writes a keyword called LONGSTRN to record the version of the
-    longstring convention that has been used, in case a new convention
-    is adopted at some point in the future.   If the LONGSTRN keyword
-    is already present in the header, then fits\_write\_key\_longwarn
-    will
-   simply return without doing anything. \label{ffpkls} \label{ffplsw}
+\item[8 ]  Read 2-D or 3-D image from the data array.  Undefined
+     pixels in the array will be set equal to the value of 'nulval',
+     unless nulval=0 in which case no testing for undefined pixels will
+    be performed. \label{ffg2dx} \label{ffg3dx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_write_key_longstr / ffpkls
-      (fitsfile *fptr, char *keyname, char *longstr, char *comment,
-       > int *status)
+  int  fits_read_2d_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffg2d[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, long group, DTYPE nulval, long dim1, long naxis1,
+       long naxis2, > DTYPE *array, int *anynul, int *status)
 
-  int fits_write_key_longwarn / ffplsw
-      (fitsfile *fptr, > int *status)
+  int  fits_read_3d_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffg3d[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, long group, DTYPE nulval, long dim1,
+       long dim2, long naxis1, long naxis2, long naxis3,
+       > DTYPE *array, int *anynul, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[4 ] Write (append) a numbered sequence of keywords into the CHU.  The
-    starting index number (nstart) must be greater than 0. One may
-    append the same comment to every keyword (and eliminate the need
-    to have an array of identical comment strings, one for each keyword) by
-    including the ampersand character as the last non-blank character in the
-    (first) COMMENTS string parameter.  This same string
-    will then be used for the comment field in all the keywords.
-    One may also enter a null pointer for the comment parameter to
-   leave the comment field of the keyword blank. \label{ffpknx}
+\item[9 ]   Read an arbitrary data subsection from the data array.
+      \label{ffgsvx} \label{ffgsfx}
 \end{description}
- 
-\begin{verbatim}
-  int fits_write_keys_str / ffpkns
-      (fitsfile *fptr, char *keyroot, int nstart, int nkeys,
-       char **value, char **comment, > int *status)
 
-  int fits_write_keys_[log, lng] / ffpkn[lj]
-      (fitsfile *fptr, char *keyroot, int nstart, int nkeys,
-       DTYPE *numval, char **comment, int *status)
+\begin{verbatim}
+  int  fits_read_subset_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffgsv[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, int group, int naxis, long *naxes,
+       long *fpixel, long *lpixel, long *inc, DTYPE nulval,
+       > DTYPE *array, int *anynul, int *status)
 
-  int fits_write_keys_[flt, dbl, fixflg, fixdbl] / ffpkne[edfg]
-      (fitsfile *fptr, char *keyroot, int nstart, int nkey,
-       DTYPE *numval, int decimals, char **comment, > int *status)
+  int  fits_read_subsetnull_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+       ffgsf[b,i,ui,k,uk,j,uj,jj,e,d]
+       (fitsfile *fptr, int group, int naxis, long *naxes,
+       long *fpixel, long *lpixel, long *inc, > DTYPE *array,
+       char *nullarray, int *anynul, int *status)
 \end{verbatim}
- 
+
+
+\section{Specialized FITS ASCII and Binary Table Routines}
+
+
+\subsection{General Column Routines}
+
+
 \begin{description}
-\item[5 ]Copy an indexed keyword from one HDU to another, modifying
-    the index number of the keyword name in the process.  For example,
-    this routine could read the TLMIN3 keyword from the input HDU
-    (by giving keyroot = "TLMIN" and innum = 3) and write it to the
-    output HDU with the keyword name TLMIN4 (by setting outnum = 4).
-    If the input keyword does not exist, then this routine simply
-   returns without indicating an error. \label{ffcpky}
+\item[1 ] Get information about an existing ASCII or binary table column.   A null
+    pointer may be given for any of the output parameters that are not
+    needed.  DATATYPE is a character string which returns the data type
+    of the column as defined by the TFORMn keyword (e.g., 'I', 'J','E',
+    'D', etc.).  In the case of an ASCII character column, typecode
+    will have a value of the form 'An' where 'n' is an integer
+    expressing the width of the field in characters.  For example, if
+    TFORM = '160A8' then ffgbcl will return typechar='A8' and
+    repeat=20.   All the returned parameters are scalar quantities.
+   \label{ffgacl} \label{ffgbcl}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_copy_key / ffcpky
-      (fitsfile *infptr, fitsfile *outfptr, int innum, int outnum,
-       char *keyroot, > int *status)
+  int fits_get_acolparms / ffgacl
+    (fitsfile *fptr, int colnum, > char *ttype, long *tbcol,
+     char *tunit, char *tform, double *scale, double *zero,
+     char *nulstr, char *tdisp, int *status)
+
+  int fits_get_bcolparms / ffgbcl
+      (fitsfile *fptr, int colnum, > char *ttype, char *tunit,
+       char *typechar, long *repeat, double *scale, double *zero,
+       long *nulval, char *tdisp, int  *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[6 ]Write (append) a `triple precision' keyword into the CHU in F28.16 format.
-    The floating point keyword value is constructed by concatenating the
-    input integer value with the input double precision fraction value
-    (which must have a value between 0.0 and 1.0). The ffgkyt routine should
-    be used to read this keyword value, because the other keyword reading
-   routines will not preserve the full precision of the value. \label{ffpkyt}
+\item[2 ] Return optimal number of rows to read or write at one time for
+    maximum I/O efficiency.  Refer to the
+    ``Optimizing Code'' section in Chapter 5 for more discussion on how
+   to use this routine. \label{ffgrsz}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_write_key_triple / ffpkyt
-      (fitsfile *fptr, char *keyname, long intval, double frac,
-       char *comment, > int *status)
+  int fits_get_rowsize / ffgrsz
+      (fitsfile *fptr, long *nrows, *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[7 ]Write keywords to the CHDU that are defined in an ASCII template file.
-   The format of the template file is described under the fits\_parse\_template
-  routine below. \label{ffpktp}
+\item[3 ] Define the zero indexed byte offset of the 'heap' measured from
+    the start of the binary table data.  By default the heap is assumed
+    to start immediately following the regular table data, i.e., at
+    location NAXIS1 x NAXIS2.  This routine is only relevant for
+    binary tables which contain variable length array columns (with
+    TFORMn = 'Pt').  This routine also automatically writes
+    the value of theap to a keyword in the extension header.  This
+    routine must be called after the required keywords have been
+    written (with ffphbn)
+   but before any data is written to the table. \label{ffpthp}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_write_key_template / ffpktp
-      (fitsfile *fptr, const char *filename, > int *status)
+  int fits_write_theap / ffpthp
+      (fitsfile *fptr, long theap, > int *status)
 \end{verbatim}
- 
-\subsection{ Insert Keyword Routines}
 
-These insert routines are somewhat less efficient than the `update' or
-`write' keyword routines  because the following keywords in the header
-must be shifted down to make room for the inserted keyword.  See
-Appendix B for the definition of the parameters used in these
-routines.
-
- 
 \begin{description}
-\item[1 ] Insert a new keyword record into the CHU at the specified position
-    (i.e., immediately preceding the (keynum)th keyword in the header.)
-  \label{ffirec}
+\item[4 ] Test the contents of the binary table variable array heap, returning
+    the size of the heap, the number of unused bytes that are not currently
+    pointed to by any of the descriptors, and the number of bytes which are
+    pointed to by multiple descriptors.  It also returns valid = FALSE if
+    any of the descriptors point to invalid addresses  out of range of the
+    heap. \label{fftheap}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_insert_record / ffirec
-      (fitsfile *fptr, int keynum, char *card, > int *status)
+  int fits_test_heap / fftheap
+      (fitsfile *fptr, > long *heapsize, long *unused, long *overlap,
+       int *validheap, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[2 ] Insert a new keyword into the CHU.  The new keyword is inserted
-    immediately following the last keyword that has been read from the
-    header.  The `longstr' version has the same functionality as the
-    `str' version except that it also supports the local long string
-    keyword convention for strings longer than 68 characters.  A null
-    pointer may be entered for the comment parameter which will cause
-    the comment field to be left blank.  The flt, dbl, cmp, and dblcmp
-    versions of this routine have the added
-     feature that if the 'decimals' parameter is negative, then the 'G'
-     display format rather then the 'E' format will be used when
-     constructing the keyword value, taking the absolute value of
-     'decimals' for the precision.  This will suppress trailing zeros,
-     and will use a fixed format rather than an exponential format,
-    depending on the magnitude of the value. \label{ffikyx}
+\item[5 ] Re-pack the vectors in the binary table variable array heap to recover
+    any unused space.  Normally, when a vector in a variable length
+    array column is rewritten the previously written array remains in
+    the heap as wasted unused space.  This routine will repack the
+    arrays that are still in use, thus eliminating any bytes in the
+    heap that are no longer in use.  Note that if several vectors point
+    to the same bytes in the heap, then this routine will make
+    duplicate copies of the bytes for each vector, which will actually
+   expand the size of the heap. \label{ffcmph}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_insert_key_[str, longstr] / ffi[kys, kls]
-      (fitsfile *fptr, char *keyname, char *value, char *comment,
-       > int *status)
+  int fits_compress_heap / ffcmph
+      (fitsfile *fptr, > int *status)
+\end{verbatim}
 
-  int fits_insert_key_[log, lng] / ffiky[lj]
-      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
-       > int *status)
 
-  int fits_insert_key_[flt, fixflt, dbl, fixdbl] / ffiky[edfg]
-      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
-       char *comment, > int *status)
+\subsection{Low-Level Table Access Routines}
+
+The following 2 routines provide low-level access to the data in ASCII
+or binary tables and are mainly useful as an efficient way to copy all
+or part of a table from one location to another.  These routines simply
+read or write the specified number of consecutive bytes in an ASCII or
+binary table, without regard for column boundaries or the row length in
+the table.  These routines do not perform any machine dependent data
+conversion or byte swapping.  See Appendix B for the definition of the
+parameters used in these routines.
+
 
-  int fits_insert_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffik[yc,ym,fc,fm]
-      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
-       char *comment, > int *status)
-\end{verbatim}
- 
 \begin{description}
-\item[3 ] Insert a new keyword with an undefined, or null, value into the CHU.
-   The value string of the keyword is left blank in this case. \label{ffikyu}
+\item[1 ] Read or write a consecutive array of bytes from an ASCII or binary
+   table \label{ffgtbb}  \label{ffptbb}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_insert_key_null / ffikyu
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+  int fits_read_tblbytes / ffgtbb
+      (fitsfile *fptr, long firstrow, long firstchar, long nchars,
+       > unsigned char *values, int *status)
+
+  int fits_write_tblbytes / ffptbb
+      (fitsfile *fptr, long firstrow, long firstchar, long nchars,
+       unsigned char *values, > int *status)
 \end{verbatim}
 
- 
-\subsection{ Specialized Read Keyword Routines}
 
-Wild card characters may be used when specifying the name of the
-keyword to be read.  See Appendix B for the definition of the
-parameters used in these routines.
+\subsection{Write Column Data Routines}
+
 
- 
 \begin{description}
-\item[1 ] Read the name, value (as a string), and comment of the nth keyword in CHU.
-    If a NULL comment pointer is given on input,
-    then the comment string will not be returned.  A null value string
-    will be returned if the keyword has no defined value (i.e., if the
-   value field in the keyword is blank). \label{ffgkyn}
+\item[1 ] Write elements into an ASCII or binary table column (in the CDU).
+    The data type of the array is implied by the suffix of the
+   routine name. \label{ffpcls}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_keyn / ffgkyn
-      (fitsfile *fptr, int keynum, > char *keyname, char *value,
-       char *comment, int *status)
+  int fits_write_col_str / ffpcls
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, char **array, > int *status)
+
+  int fits_write_col_[log,byt,sht,usht,int,uint,lng,ulng,lnglng,flt,dbl,cmp,dblcmp] /
+      ffpcl[l,b,i,ui,k,uk,j,uj,jj,e,d,c,m]
+      (fitsfile *fptr, int colnum, long firstrow,
+           long firstelem, long nelements, DTYPE *array, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[2 ] Read the next keyword whose name matches one of the strings in
-    'inclist' but does not match any of the strings in 'exclist'.
-    The strings in inclist and exclist may contain wild card characters
-    (*, ?, and \#) as described at the beginning of this section.
-    This routine searches from the current header position to the
-    end of the header, only, and does not continue the search from
-    the top of the header back to the original position.  The current
-    header position may be reset with the ffgrec routine.  Note
-    that nexc may be set = 0 if there are no keywords to be excluded.
-    This routine returns status = KEY\_NO\_EXIST if a matching
-   keyword is not found. \label{ffgnxk}
+\item[2 ] Write elements into an ASCII or binary table column
+    substituting the appropriate FITS null value for any elements that
+    are equal to the nulval parameter.  This routines must not be used to
+   write to  variable length array columns.  \label{ffpcnx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_find_nextkey / ffgnxk
-      (fitsfile *fptr, char **inclist, int ninc, char **exclist,
-       int nexc, > char *card, int  *status)
+  int fits_write_colnull_[log, byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffpcn[l,b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, DTYPE *array, DTYPE nulval, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[3 ] Read the literal keyword value as a character string.  Regardless
-    of the datatype of the keyword, this routine simply returns the
-    string of characters in the value field of the keyword along with
-    the comment field.   If a NULL comment pointer is given on input,
-   then the comment string will not be returned. \label{ffgkey}
+\item[3 ] Write string elements into a binary table column (in the CDU)
+    substituting the FITS null value for any elements that
+    are equal to the nulstr string.  This routine must NOT be
+   used to write to  variable length array columns. \label{ffpcns}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_keyword / ffgkey
-      (fitsfile *fptr, char *keyname, > char *value, char *comment,
-       int *status)
+  int fits_write_colnull_str / ffpcns
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, char **array, char *nulstr, > int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[4 ] Read a keyword value (with the appropriate datatype) and comment from
-    the CHU.  If a NULL comment pointer is given on input, then the comment
-    string will not be returned.  If the value of the keyword is not defined
-    (i.e., the value field is blank) then an error status = VALUE\_UNDEFINED
-    will be returned and the input value will not be changed.
-  \label{ffgkyx} \label{ffgkls}
+\item[4 ] Write bit values into a binary byte ('B') or bit ('X') table column (in
+    the CDU).  Larray is an array of characters corresponding to the
+    sequence of bits to be written.  If an element of larray is true
+    (not equal to zero) then the corresponding bit in the FITS table is
+    set to 1, otherwise the bit is set to 0.  The 'X' column in a FITS
+    table is always padded out to a multiple of 8 bits where the bit
+    array starts with the most significant bit of the byte and works
+    down towards the 1's bit.  For example, a '4X' array, with the
+    first bit = 1 and the remaining 3 bits = 0 is equivalent to the 8-bit
+    unsigned byte decimal value of 128  ('1000 0000B').  In the case of
+    'X' columns, CFITSIO can write to all 8 bits of each byte whether
+    they are formally valid or not.  Thus if the column is defined as
+    '4X', and one calls ffpclx with firstbit=1 and nbits=8, then all
+    8 bits will be written into the first byte (as opposed to writing
+    the first 4 bits into the first row and then the next 4 bits into
+    the next row), even though the last 4 bits of each byte are formally
+    not defined and should all be set = 0.  It should also be noted that
+    it is more efficient to write 'X' columns an entire byte at a time,
+    instead of bit by bit.  Any of the CFITSIO routines that write to
+    columns (e.g. fits\_write\_col\_byt) may be used for this purpose.
+    These routines will interpret 'X' columns as though they were 'B'
+    columns (e.g.,  '1X' through '8X' is equivalent
+   to '1B', and '9X' through '16X' is equivalent to '2B').  \label{ffpclx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_key_str / ffgkys
-      (fitsfile *fptr, char *keyname, > char *value, char *comment,
-       int *status);
+  int fits_write_col_bit / ffpclx
+      (fitsfile *fptr, int colnum, long firstrow, long firstbit,
+       long nbits, char *larray, > int *status)
+\end{verbatim}
 
-  NOTE: after calling the following routine, programs must explicitly free
-        the memory allocated for 'longstr' after it is no longer needed.
+\begin{description}
+\item[5 ] Write the descriptor for a variable length column in a binary table.
+    This routine can be used in conjunction with ffgdes to enable
+    2 or more arrays to point to the same storage location to save
+   storage space if the arrays are identical. \label{ffpdes}
+\end{description}
 
-  int fits_read_key_longstr / ffgkls
-      (fitsfile *fptr, char *keyname, > char **longstr, char *comment,
-             int *status)
+\begin{verbatim}
+    int fits_write_descript / ffpdes
+        (fitsfile *fptr, int colnum, long rownum, long repeat,
+         long offset, > int *status)
+\end{verbatim}
 
-  int fits_read_key_[log, lng, flt, dbl, cmp, dblcmp] / ffgky[ljedcm]
-      (fitsfile *fptr, char *keyname, > DTYPE *numval, char *comment,
-       int *status)
+\subsection{Read Column Data Routines}
+
+Two types of routines are provided to get the column data which differ
+in the way undefined pixels are handled.  The first set of routines
+(ffgcv) simply return an array of data elements in which undefined
+pixels are set equal to a value specified by the user in the 'nullval'
+parameter.  If nullval = 0, then no checks for undefined pixels will be
+performed, thus increasing the speed of the program.  The second set of
+routines (ffgcf) returns the data element array and in addition a
+logical array of flags which defines whether the corresponding data
+pixel is undefined.  See Appendix B for the definition of the
+parameters used in these routines.
+
+    Any column, regardless of it's intrinsic data type, may be read as a
+    string.  It should be noted however that reading a numeric column as
+    a string is 10 - 100 times slower than reading the same column as a number
+    due to the large overhead in constructing the formatted strings.
+    The display format of the returned strings will be
+    determined by the TDISPn keyword, if it exists, otherwise by the
+    data type of the column.  The length of the returned strings (not
+    including the null terminating character) can be determined with
+    the fits\_get\_col\_display\_width routine.  The following TDISPn
+    display formats are currently supported:
 
+\begin{verbatim}
+    Iw.m   Integer
+    Ow.m   Octal integer
+    Zw.m   Hexadecimal integer
+    Fw.d   Fixed floating point
+    Ew.d   Exponential floating point
+    Dw.d   Exponential floating point
+    Gw.d   General; uses Fw.d if significance not lost, else Ew.d
 \end{verbatim}
- 
+    where w is the width in characters of the displayed values, m is
+    the minimum number of digits displayed, and d is the number of
+    digits to the right of the decimal.  The .m field is optional.
+
+
 \begin{description}
-\item[5 ] Read a sequence of indexed keyword values.   The starting index number
-    (nstart) must be greater than 0.   If the value of any of
-    the keywords is not defined (i.e., the value field is blank) then an
-    error status = VALUE\_UNDEFINED will be returned and the input
-    value for the undefined keyword(s) will not be changed.  These
-   routines do not support wild card characters in the root name.\label{ffgknx}
+\item[1 ] Read elements from an ASCII or binary table column (in the CDU).  These
+    routines return the values of the table column array elements.  Undefined
+    array elements will be returned with a value = nulval, unless nulval = 0
+    (or = ' ' for ffgcvs) in which case no checking for undefined values will
+    be performed. The ANYF parameter is set to true if any of the returned
+   elements are undefined. \label{ffgcvx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_keys_str / ffgkns
-      (fitsfile *fptr, char *keyname, int nstart, int nkeys,
-       > char **value, int *nfound,  int *status)
+  int fits_read_col_str / ffgcvs
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, char *nulstr, > char **array, int *anynul,
+       int *status)
 
-  int fits_read_keys_[log, lng, flt, dbl] / ffgkn[ljed]
-      (fitsfile *fptr, char *keyname, int nstart, int nkeys,
-       > DTYPE *numval, int *nfound, int *status)
+  int fits_read_col_[log,byt,sht,usht,int,uint,lng,ulng, lnglng, flt, dbl, cmp, dblcmp] /
+      ffgcv[l,b,i,ui,k,uk,j,uj,jj,e,d,c,m]
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, DTYPE nulval, > DTYPE *array, int *anynul,
+       int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[6 ] Read the value of a floating point keyword, returning the integer and
-    fractional parts of the value in separate routine arguments.
-    This routine may be used to read any keyword but is especially
-    useful for reading the 'triple precision' keywords written by ffpkyt.
-  \label{ffgkyt}
+\item[2 ] Read elements and null flags from an ASCII or binary table column (in the
+    CHDU).  These routines return the values of the table column array elements.
+    Any undefined array elements will have the corresponding nullarray element
+    set equal to TRUE.  The anynul parameter is set to true if any of the
+   returned elements are undefined. \label{ffgcfx}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_read_key_triple / ffgkyt
-      (fitsfile *fptr, char *keyname, > long *intval, double *frac,
-       char *comment, int *status)
-\end{verbatim}
- 
-\subsection{ Modify Keyword Routines}
+  int fits_read_colnull_str / ffgcfs
+      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
+       long nelements, > char **array, char *nullarray, int *anynul,
+       int *status)
 
-These routines modify the value of an existing keyword.  An error is
-returned if the keyword does not exist.  Wild card characters may be
-used when specifying the name of the keyword to be modified.  See
-Appendix B for the definition of the parameters used in these
-routines.
+  int fits_read_colnull_[log,byt,sht,usht,int,uint,lng,ulng,lnglng,flt,dbl,cmp,dblcmp] /
+      ffgcf[l,b,i,ui,k,uk,j,uj,jj,e,d,c,m]
+      (fitsfile *fptr, int colnum, long firstrow,
+       long firstelem, long nelements, > DTYPE *array,
+       char *nullarray, int *anynul, int *status)
+\end{verbatim}
 
- 
 \begin{description}
-\item[1 ] Modify (overwrite) the nth 80-character header record in the CHU. \label{ffmrec}
+\item[3 ] Read an arbitrary data subsection from an N-dimensional array
+    in a binary table vector column.  Undefined pixels
+    in the array will be set equal to the value of 'nulval',
+    unless nulval=0 in which case no testing for undefined pixels will
+    be performed.  The first and last rows in the table to be read
+    are specified by fpixel(naxis+1) and lpixel(naxis+1), and hence
+    are treated as the next higher dimension of the FITS N-dimensional
+    array.  The INC parameter specifies the sampling interval in
+   each dimension between the data elements that will be returned. \label{ffgsvx2}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_modify_record / ffmrec
-      (fitsfile *fptr, int keynum, char *card, > int *status)
+  int fits_read_subset_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffgsv[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, int colnum, int naxis, long *naxes, long *fpixel,
+       long *lpixel, long *inc, DTYPE nulval, > DTYPE *array, int *anynul,
+       int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[2 ] Modify (overwrite) the 80-character header record for the named keyword
-    in the CHU.  This can be used to overwrite the name of the keyword as
-   well as its value and comment fields. \label{ffmcrd}
+\item[4 ] Read an arbitrary data subsection from an N-dimensional array
+    in a binary table vector column.  Any Undefined
+    pixels in the array will have the corresponding 'nullarray'
+    element set equal to TRUE.  The first and last rows in the table
+    to be read are specified by fpixel(naxis+1) and lpixel(naxis+1),
+    and hence are treated as the next higher dimension of the FITS
+    N-dimensional array.  The INC parameter specifies the sampling
+    interval in each dimension between the data elements that will be
+   returned. \label{ffgsfx2}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_modify_card / ffmcrd
-      (fitsfile *fptr, char *keyname, char *card, > int *status)
+  int fits_read_subsetnull_[byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
+      ffgsf[b,i,ui,k,uk,j,uj,jj,e,d]
+      (fitsfile *fptr, int colnum, int naxis, long *naxes,
+       long *fpixel, long *lpixel, long *inc, > DTYPE *array,
+       char *nullarray, int *anynul, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[5 ] Modify the value and comment fields of an existing keyword in the CHU.
-    The `longstr' version has the same functionality as the `str'
-    version except that it also supports the local long string keyword
-    convention for strings longer than 68 characters.  Optionally, one
-    may modify only the value field and leave the comment field
-    unchanged by setting the input COMMENT parameter equal to the
-    ampersand character (\&) or by entering a null pointer for the
-    comment parameter.  The flt, dbl, cmp, and dblcmp versions of this
-    routine have the added feature that if the 'decimals' parameter is
-    negative, then the 'G' display format rather then the 'E' format
-    will be used when constructing the keyword value, taking the
-    absolute value of 'decimals' for the precision.  This will suppress
-    trailing zeros, and will use a fixed format rather than an
-    exponential format,
-   depending on the magnitude of the value. \label{ffmkyx}
+\item[5 ] Read bit values from a byte ('B') or bit (`X`) table column (in the
+    CDU).  Larray is an array of logical values corresponding to the
+    sequence of bits to be read.  If larray is true then the
+    corresponding bit was set to 1, otherwise the bit was set to 0.
+    The 'X' column in a FITS table is always padded out to a multiple
+    of 8 bits where the bit array starts with the most significant bit
+    of the byte and works down towards the 1's bit.  For example, a
+    '4X' array, with the first bit = 1 and the remaining 3 bits = 0 is
+    equivalent to the 8-bit unsigned byte value of 128.
+    Note that in the case of 'X' columns, CFITSIO can read  all 8 bits
+    of each byte whether they are formally valid or not.  Thus if the
+    column is defined as '4X', and one calls ffgcx with  firstbit=1 and
+    nbits=8, then all 8 bits will be read from the first byte (as
+    opposed to reading the first 4 bits from the first row and then the
+    first 4 bits from the next row), even though the last 4 bits of
+    each byte are formally not defined.  It should also be noted that
+    it is more efficient to read 'X' columns an entire byte at a time,
+    instead of bit by bit.  Any of the CFITSIO routines that read
+    columns (e.g. fits\_read\_col\_byt) may be used for this
+    purpose.  These routines will interpret 'X' columns as though they
+    were 'B' columns (e.g.,  '8X' is equivalent to '1B', and '16X' is
+   equivalent to '2B').  \label{ffgcx}
 \end{description}
- 
-\begin{verbatim}
-  int fits_modify_key_[str, longstr] / ffm[kys, kls]
-      (fitsfile *fptr, char *keyname, char *value, char *comment,
-       > int *status);
-
-  int fits_modify_key_[log, lng] / ffmky[lj]
-      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
-       > int *status)
-
-  int fits_modify_key_[flt, dbl, fixflt, fixdbl] / ffmky[edfg]
-      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
-       char *comment, > int *status)
 
-  int fits_modify_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffmk[yc,ym,fc,fm]
-      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
-       char *comment, > int *status)
+\begin{verbatim}
+  int fits_read_col_bit / ffgcx
+      (fitsfile *fptr, int colnum, long firstrow, long firstbit,
+       long nbits, > char *larray, int *status)
 \end{verbatim}
- 
+
 \begin{description}
-\item[6 ] Modify the value of an existing keyword to be undefined, or null.
-    The value string of the keyword is set to blank.
-    Optionally, one may leave the comment field unchanged by setting the
-    input COMMENT parameter equal to
-   the ampersand character (\&) or by entering a null pointer.  \label{ffmkyu}
+\item[6 ] Read any consecutive set of bits from an 'X' or 'B' column and
+    interpret them as an unsigned n-bit integer.  nbits must be less
+    than 16 or 32 in ffgcxui and ffgcxuk, respectively.  If nrows
+    is greater than 1, then the same set of bits will be read from
+    each row, starting with firstrow. The bits are numbered with
+    1 = the most significant bit of the first element of the column.
+   \label{ffgcxui}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_modify_key_null / ffmkyu
-      (fitsfile *fptr, char *keyname, char *comment, > int *status)
+  int fits_read_col_bit_[usht, uint] / ffgcx[ui,uk]
+      (fitsfile *fptr, int colnum, long firstrow, long, nrows,
+       long firstbit, long nbits, > DTYPE *array, int *status)
 \end{verbatim}
- 
-\subsection{ Specialized Update Keyword Routines \label{FFUCRD}}
 
- 
 \begin{description}
-\item[1 ] These update routines modify the value, and optionally the comment field,
-    of the keyword if it already exists, otherwise the new keyword is
-    appended to the header.  A separate routine is provided for each
-    keyword datatype.  The `longstr' version has the same functionality
-    as the `str' version except that it also supports the local long
-    string keyword convention for strings longer than 68 characters.  A
-    null pointer may be entered for the comment parameter which will
-    leave the comment field unchanged or blank.  The flt, dbl, cmp, and
-    dblcmp versions of this routine have the added feature that if the
-    'decimals' parameter is negative, then the 'G' display format
-    rather then the 'E' format will be used when constructing the
-    keyword value, taking the absolute value of 'decimals' for the
-    precision.  This will suppress trailing zeros, and will use a fixed
-    format rather than an exponential format,
-   depending on the magnitude of the value. \label{ffukyx}
+\item[7 ] Return the descriptor for a variable length column in a binary table.
+    The descriptor consists of 2 integer parameters: the number of elements
+    in the array and the starting offset relative to the start of the heap.
+    The first routine returns a single descriptor whereas the second routine
+    returns the descriptors for a range of rows in the table.
+   \label{ffgdes}
 \end{description}
- 
+
 \begin{verbatim}
-  int fits_update_key_[str, longstr] / ffu[kys, kls]
-      (fitsfile *fptr, char *keyname, char *value, char *comment,
-       > int *status)
+  int fits_read_descript / ffgdes
+      (fitsfile *fptr, int colnum, long rownum, > long *repeat,
+           long *offset, int *status)
 
-  int fits_update_key_[log, lng] / ffuky[lj]
-      (fitsfile *fptr, char *keyname, DTYPE numval, char *comment,
-       > int *status)
+  int fits_read_descripts / ffgdess
+      (fitsfile *fptr, int colnum, long firstrow, long nrows > long *repeat,
+           long *offset, int *status)
+\end{verbatim}
 
-  int fits_update_key_[flt, dbl, fixflt, fixdbl] / ffuky[edfg]
-      (fitsfile *fptr, char *keyname, DTYPE numval, int decimals,
-       char *comment, > int *status)
+\chapter{ Extended File Name Syntax }
 
-  int fits_update_key_[cmp, dblcmp, fixcmp, fixdblcmp] / ffuk[yc,ym,fc,fm]
-      (fitsfile *fptr, char *keyname, DTYPE *numval, int decimals,
-       char *comment, > int *status)
-\end{verbatim}
-
- 
-\section{Define Data Scaling and Undefined Pixel Parameters}
 
-These routines define or modify the internal parameters used by CFITSIO
-to either scale the data or to represent undefined pixels.  Generally
-CFITSIO will scale the data according to the values of the BSCALE and
-BZERO (or TSCALn and TZEROn) keywords, however these routines may be
-used to override the keyword values.  This may be useful when one wants
-to read or write the raw unscaled values in the FITS file.  Similarly,
-CFITSIO generally uses the value of the BLANK or TNULLn keyword to
-signify an undefined pixel, but these routines may be used to override
-this value.  These routines do not create or modify the corresponding
-header keyword values.  See Appendix B for the definition of the
-parameters used in these routines.
+\section{Overview}
+
+CFITSIO supports an extended syntax when specifying the name of the
+data file to be opened or created  that includes the following
+features:
+
+\begin{itemize}
+\item
+CFITSIO can read IRAF format images which have header file names that
+end with the '.imh' extension, as well as reading and writing FITS
+files,   This feature is implemented in CFITSIO by first converting the
+IRAF image into a temporary FITS format file in memory, then opening
+the FITS file.  Any of the usual CFITSIO routines then may be used to
+read the image header or data.  Similarly, raw binary data arrays can
+be read by converting them on the fly into virtual FITS images.
+
+\item
+FITS files on the internet can be read (and sometimes written) using the FTP,
+HTTP, or ROOT protocols.
+
+\item
+FITS files can be piped between tasks on the stdin and stdout streams.
+
+\item
+FITS files can be read and written in shared memory.  This can
+potentially achieve better data I/O performance compared to reading and
+writing the same FITS files on magnetic disk.
+
+\item
+Compressed FITS files in gzip or Unix COMPRESS format can be directly read.
+
+\item
+Output FITS files can be written directly in compressed gzip format,
+thus saving disk space.
+
+\item
+FITS table columns can be created, modified, or deleted 'on-the-fly' as
+the table is opened by CFITSIO.  This creates a virtual FITS file containing
+the modifications that is then opened by the application program.
+
+\item
+Table rows may be selected, or filtered out, on the fly when the table
+is opened by CFITSIO, based on an user-specified expression.
+Only rows for which the expression evaluates to 'TRUE' are retained
+in the copy of the table that is opened by the application program.
+
+\item
+Histogram images may be created on the fly by binning the values in
+table columns, resulting in a virtual N-dimensional FITS image.  The
+application program then only sees the FITS image (in the primary
+array) instead of the original FITS table.
+\end{itemize}
+
+The latter 3 table filtering features in particular add very powerful
+data processing capabilities directly into CFITSIO, and hence into
+every task that uses CFITSIO to read or write FITS files.  For example,
+these features transform a very simple program that just copies an
+input FITS file to a new output file (like the `fitscopy' program that
+is distributed with CFITSIO) into a multipurpose FITS file processing
+tool.  By appending fairly simple qualifiers onto the name of the input
+FITS file, the user can perform quite complex table editing operations
+(e.g., create new columns, or filter out rows in a table) or create
+FITS images by binning or histogramming the values in table columns.
+In addition, these functions have been coded using new state-of-the art
+algorithms that are, in some cases, 10 - 100 times faster than previous
+widely used implementations.
+
+Before describing the complete syntax for the extended FITS file names
+in the next section, here are a few examples of FITS file names that
+give a quick overview of the allowed syntax:
+
+\begin{itemize}
+\item
+{\tt myfile.fits}: the simplest case of a FITS file on disk in the current
+directory.
+
+\item
+{\tt myfile.imh}: opens an IRAF format image file and converts it on the
+fly into a temporary FITS format image in memory which can then be read with
+any other CFITSIO routine.
+
+\item
+{\tt rawfile.dat[i512,512]}: opens a raw binary data array (a 512 x 512
+short integer array in this case) and converts it on the fly into a
+temporary FITS format image in memory which can then be read with any
+other CFITSIO routine.
+
+\item
+{\tt myfile.fits.gz}: if this is the name of a new output file, the '.gz'
+suffix will cause it to be compressed in gzip format when it is written to
+disk.
+
+\item
+{\tt myfile.fits.gz[events, 2]}:  opens and uncompresses the gzipped file
+myfile.fits then moves to the extension with the keywords EXTNAME
+= 'EVENTS' and EXTVER = 2.
+
+\item
+{\tt -}:  a dash (minus sign) signifies that the input file is to be read
+from the stdin file stream, or that the output file is to be written to
+the stdout stream.
+
+\item
+{\tt ftp://legacy.gsfc.nasa.gov/test/vela.fits}:  FITS files in any ftp
+archive site on the internet may be directly opened with read-only
+access.
+
+\item
+{\tt http://legacy.gsfc.nasa.gov/software/test.fits}: any valid URL to a
+FITS file on the Web may be opened with read-only access.
+
+\item
+{\tt root://legacy.gsfc.nasa.gov/test/vela.fits}: similar to ftp access
+except that it provides write as well as read access to the files
+across the network. This uses the root protocol developed at CERN.
+
+\item
+{\tt shmem://h2[events]}: opens the FITS file in a shared memory segment and
+moves to the EVENTS extension.
+
+\item
+{\tt mem://}:  creates a scratch output file in core computer memory.  The
+resulting 'file' will disappear when the program exits, so this
+is mainly useful for testing purposes when one does not want a
+permanent copy of the output file.
+
+\item
+{\tt myfile.fits[3; Images(10)]}: opens a copy of the image contained in the
+10th row of the 'Images' column in the binary table in the 3th extension
+of the FITS file.  The virtual file that is opened by the application just
+contains this single image in the primary array.
+
+\item
+{\tt myfile.fits[1:512:2, 1:512:2]}: opens a section of the input image
+ranging from the 1st to the 512th pixel in  X and Y, and selects every
+second pixel in both dimensions, resulting in a 256 x 256 pixel input image
+in this case.
+
+\item
+{\tt myfile.fits[EVENTS][col Rad = sqrt(X**2 + Y**2)]}:  creates and opens
+a virtual file on the fly that is identical to
+myfile.fits except that it will contain a new column in the EVENTS
+extension called 'Rad' whose value is computed using the indicated
+expression which is a function of the values in the X and Y columns.
+
+\item
+{\tt myfile.fits[EVENTS][PHA > 5]}:  creates and opens a virtual FITS
+files that is identical to 'myfile.fits' except that the EVENTS table
+will only contain the rows that have values of the PHA column greater
+than 5.  In general, any arbitrary boolean expression using a C or
+Fortran-like syntax, which may combine AND and OR operators,
+may be used to select rows from a table.
+
+\item
+{\tt myfile.fits[EVENTS][bin (X,Y)=1,2048,4]}:  creates a temporary FITS
+primary array image which is computed on the fly by binning (i.e,
+computing the 2-dimensional histogram) of the values in the X and Y
+columns of the EVENTS extension.  In this case the X and Y coordinates
+range from 1 to 2048 and the image pixel size is 4 units in both
+dimensions, so the resulting image is 512 x 512 pixels in size.
+
+\item
+The final example combines many of these feature into one complex
+expression (it is broken into several lines for clarity):
 
- 
-\begin{description}
-\item[1 ] Reset the scaling factors in the primary array or image extension; does
-    not change the BSCALE and BZERO keyword values and only affects the
-    automatic scaling performed when the data elements are written/read
-    to/from the FITS file.   When reading from a FITS file the returned
-    data value = (the value given in the FITS array) * BSCALE + BZERO.
-    The inverse formula is used when writing data values to the FITS
-   file. \label{ffpscl}
-\end{description}
- 
 \begin{verbatim}
-  int fits_set_bscale / ffpscl
-      (fitsfile *fptr, double scale, double zero, > int *status)
+   ftp://legacy.gsfc.nasa.gov/data/sample.fits.gz[EVENTS]
+   [col phacorr = pha * 1.1 - 0.3][phacorr >= 5.0 && phacorr <= 14.0]
+   [bin (X,Y)=32]
 \end{verbatim}
- 
-\begin{description}
-\item[2 ] Reset the scaling parameters for a table column; does not change
-    the TSCALn or TZEROn keyword values and only affects the automatic
-    scaling performed when the data elements are written/read to/from
-    the FITS file.  When reading from a FITS file the returned data
-    value = (the value given in the FITS array) * TSCAL + TZERO.  The
-    inverse formula is used when writing data values to the FITS file.
-   \label{fftscl}
-\end{description}
- 
+In this case, CFITSIO (1) copies and uncompresses the FITS file from
+the ftp site on the legacy machine, (2) moves to the 'EVENTS'
+extension, (3) calculates a new column called 'phacorr', (4) selects
+the rows in the table that have phacorr in the range 5 to 14, and
+finally (5) bins the remaining rows on the X and Y column coordinates,
+using a pixel size = 32 to create a 2D image.  All this processing is
+completely transparent to the application program, which simply sees
+the final 2-D image in the primary array of the opened file.
+\end{itemize}
+
+The full extended CFITSIO FITS file name can contain several different
+components depending on the context.  These components are described in
+the following sections:
+
 \begin{verbatim}
-  int fits_set_tscale / fftscl
-      (fitsfile *fptr, int colnum, double scale, double zero,
-       > int *status)
+When creating a new file:
+   filetype://BaseFilename(templateName)[compress]
+
+When opening an existing primary array or image HDU:
+   filetype://BaseFilename(outName)[HDUlocation][ImageSection]
+
+When opening an existing table HDU:
+   filetype://BaseFilename(outName)[HDUlocation][colFilter][rowFilter][binSpec]
 \end{verbatim}
- 
-\begin{description}
-\item[3 ] Define the integer value to be used to signify undefined pixels in the
-    primary array or image extension.  This is only used if BITPIX = 8, 16,
-    or 32.  This does not create or change the value of the BLANK keyword in
-   the header. \label{ffpnul}
-\end{description}
- 
+The filetype, BaseFilename, outName, HDUlocation, and ImageSection
+components, if present, must be given in that order, but the colFilter,
+rowFilter, and binSpec specifiers may follow in any order.  Regardless
+of the order, however, the colFilter specifier, if present, will be
+processed first by CFITSIO, followed by the rowFilter specifier, and
+finally by the binSpec specifier.
+
+
+\section{Filetype}
+
+The type of file determines the medium on which the file is located
+(e.g., disk or network) and, hence, which internal device driver is used by
+CFITSIO to read and/or write the file.  Currently supported types are
+
 \begin{verbatim}
-  int fits_set_imgnul / ffpnul
-      (fitsfile *fptr, long nulval, > int *status)
+        file://  - file on local magnetic disk (default)
+        ftp://   - a readonly file accessed with the anonymous FTP protocol.
+                   It also supports  ftp://username:password@hostname/...
+                   for accessing password-protected ftp sites.
+        http://  - a readonly file accessed with the HTTP protocol.  It
+                   does not  support username:password like the ftp driver.
+                   Proxy HTTP survers are supported using the http_proxy
+                   environment variable.
+        root://  - uses the CERN root protocol for writing as well as
+                   reading files over the network.
+        shmem:// - opens or creates a file which persists in the computer's
+                   shared memory.
+        mem://   - opens a temporary file in core memory.  The file
+                   disappears when the program exits so this is mainly
+                   useful for test purposes when a permanent output file
+                   is not desired.
 \end{verbatim}
- 
-\begin{description}
-\item[4 ] Define the string to be used to signify undefined pixels in
-    a column in an ASCII table.  This does not create or change the value
-   of the TNULLn keyword. \label{ffsnul}
-\end{description}
- 
+If the filetype is not specified, then type file:// is assumed.
+The double slashes '//' are optional and may be omitted in most cases.
+
+
+\subsection{Notes about HTTP proxy servers}
+
+A proxy HTTP server may be used by defining the address (URL) and port
+number of the proxy server with the http\_proxy environment variable.
+For example
+
 \begin{verbatim}
-  int fits_set_atblnull / ffsnul
-      (fitsfile *fptr, int colnum, char *nulstr, > int *status)
+    setenv http_proxy http://heasarc.gsfc.nasa.gov:3128
 \end{verbatim}
- 
-\begin{description}
-\item[5 ] Define the value to be used to signify undefined pixels in
-    an integer column in a binary table (where TFORMn = 'B', 'I', or 'J').
-    This does not create or  change the value of the TNULLn keyword.
-   \label{fftnul}
-\end{description}
- 
-\begin{verbatim}
-  int fits_set_btblnul / fftnul
-      (fitsfile *fptr, int colnum, long nulval, > int *status)
-\end{verbatim}
-
- 
-\section{Specialized FITS Primary Array or IMAGE Extension I/O Routines}
-
-These routines read or write data values in the primary data array
-(i.e., the first HDU in the FITS file) or an IMAGE extension.
-Automatic data type conversion is performed for if the data type of the
-FITS array (as defined by the BITPIX keyword) differs from the data
-type of the array in the calling routine.  The data values are
-automatically scaled by the BSCALE and BZERO header values as they are
-being written or read from the FITS array.  Unlike the basic routines
-described in the previous chapter, most of these routines specifically
-support the FITS random groups format.  See Appendix B for the
-definition of the parameters used in these routines.
-
-The more primitive reading and writing routines (i. e., ffppr\_,
-ffppn\_, ffppn, ffgpv\_, or ffgpf\_) simply treat the primary array as
-a long 1-dimensional array of pixels, ignoring the intrinsic
-dimensionality of the array.  When dealing with a 2D image, for
-example, the application program must calculate the pixel offset in the
-1-D array that corresponds to any particular X, Y coordinate in the
-image.  C programmers should note that the ordering of arrays in FITS
-files, and hence in all the CFITSIO calls, is more similar to the
-dimensionality of arrays in Fortran rather than C.  For instance if a
-FITS image has NAXIS1 = 100 and NAXIS2 = 50, then a 2-D array just
-large enough to hold the image should be declared as array[50][100] and
-not as array[100][50].
+will cause CFITSIO to use port 3128 on the heasarc proxy server whenever
+reading a FITS file with HTTP.
 
-For convenience, higher-level routines are also provided to specificly
-deal with 2D images (ffp2d\_ and ffg2d\_) and 3D data cubes (ffp3d\_
-and ffg3d\_).  The dimensionality of the FITS image is passed by the
-naxis1, naxis2, and naxis3 parameters and the declared dimensions of
-the program array are passed in the dim1 and dim2 parameters.  Note
-that the dimensions of the program array may be larger than the
-dimensions of the FITS array.  For example if a FITS image with NAXIS1
-= NAXIS2 = 400 is read into a program array which is dimensioned as 512
-x 512 pixels, then the image will just fill the lower left corner of
-the array with pixels in the range 1 - 400 in the X an Y directions.
-This has the effect of taking a contiguous set of pixel value in the
-FITS array and writing them to a non-contiguous array in program memory
-(i.e., there are now some blank pixels around the edge of the image in
-the program array).
 
-The most general set of routines (ffpss\_, ffgsv\_, and ffgsf\_) may be
-used to transfer a rectangular subset of the pixels in a FITS
-N-dimensional image to or from an array which has been declared in the
-calling program.  The fpixel and lpixel parameters are integer arrays
-which specify the starting and ending pixel coordinate in each dimension
-(starting with 1, not 0) of the FITS image that is to be read or
-written.  It is important to note that these are the starting and
-ending pixels in the FITS image, not in the declared array in the
-program. The array parameter in these routines is treated simply as a
-large one-dimensional array of the appropriate datatype containing the
-pixel values; The pixel values in the FITS array are read/written
-from/to this program array in strict sequence without any gaps;  it is
-up to the calling routine to correctly interpret the dimensionality of
-this array.  The two FITS reading routines (ffgsv\_ and ffgsf\_ ) also
-have an `inc' parameter which defines the data sampling interval in
-each dimension of the FITS array.  For example, if inc[0]=2 and
-inc[1]=3 when reading a 2-dimensional FITS image, then only every other
-pixel in the first dimension and every 3rd pixel in the second
-dimension will be returned to the 'array' parameter.
+\subsection{Notes about the root filetype}
 
-Two types of routines are provided to read the data array which differ
-in the way undefined pixels are handled.  The first type of routines
-(e.g., ffgpv\_) simply return an array of data elements in which
-undefined pixels are set equal to a value specified by the user in the
-`nulval' parameter.  An additional feature of these routines is that if
-the user sets nulval = 0, then no checks for undefined pixels will be
-performed, thus reducing the amount of CPU processing.  The second type
-of routines (e.g., ffgpf\_) returns the data element array and, in
-addition, a char array which defines whether the corresponding data
-pixel is defined (= 1) or not (= 0).  The latter type of routines may
-be more convenient to use in some circumstances, however, it requires
-an additional array of logical values which can be unwieldy when
-working with large data arrays.
+The original rootd server can be obtained from:
+\verb-ftp://root.cern.ch/root/rootd.tar.gz-
+but, for it to work correctly with CFITSIO one has to use a modified
+version which supports a command to return the length of the file.
+This modified version is available in rootd subdirectory
+in the CFITSIO ftp area at
 
- 
-\begin{description}
-\item[1 ] Write elements into the FITS data array.  \label{ffppr}
-\end{description}
- 
 \begin{verbatim}
-  int fits_write_img / ffppr
-      (fitsfile *fptr, int datatype, long firstelem, long nelements,
-       DTYPE *array, int *status);
+      ftp://legacy.gsfc.nasa.gov/software/fitsio/c/root/rootd.tar.gz.
 \end{verbatim}
- 
-\begin{description}
-\item[2 ] Write elements into the data array.  The datatype is specified
-   by the suffix of the name of the routine. \label{ffpprx}
-\end{description}
- 
+
+This small server is started either by inetd when a client requests a
+connection to a rootd server or by hand (i.e. from the command line).
+The rootd server works with the ROOT TNetFile class. It allows remote
+access to ROOT database files in either read or write mode. By default
+TNetFile assumes port 432 (which requires rootd to be started as root).
+To run rootd via inetd add the following line to /etc/services:
+
 \begin{verbatim}
-  int fits_write_img_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffppr[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long firstelem, long nelements,
-       DTYPE *array, > int *status);
+  rootd     432/tcp
 \end{verbatim}
- 
-\begin{description}
-\item[3 ] Write elements into the FITS data array, substituting the appropriate
-   FITS null value for all elements which are equal to the input value
-   of nulval (note that this parameter gives the address of the null
-   value, not the null value itself).  For integer FITS arrays, the
-   FITS null value is defined by the BLANK keyword (an error is
-   returned if the BLANK keyword doesn't exist).  For floating point
-   FITS arrays  the special IEEE NaN (Not-a-Number) value will be
-   written into the FITS file.  If a null pointer is entered for
-   nulval, then the null value is
-  ignored and this routine behaves the same as fits\_write\_img. \label{ffppn}
-\end{description}
- 
+and to /etc/inetd.conf, add the following line:
+
 \begin{verbatim}
-  int fits_write_imgnull / ffppn
-      (fitsfile *fptr, int datatype, long firstelem, long nelements,
-       DTYPE *array, DTYPE *nulval, > int *status);
+  rootd stream tcp nowait root /user/rdm/root/bin/rootd rootd -i
 \end{verbatim}
- 
-\begin{description}
-\item[4 ]Write elements into the data array, substituting the appropriate FITS null
-   value for all elements which are equal to the value of NULLVAL.  For
-   integer FITS arrays, the null value defined by the BLANK keyword or
-   a previous call to ffpnul
-   will be substituted;  for floating point FITS arrays (BITPIX = -32
-   or -64) then the special IEEE NaN (Not-a-Number) value will be
-  substituted.  \label{ffppnx}
-\end{description}
- 
+Force inetd to reread its conf file with \verb+kill -HUP <pid inetd>+.
+You can also start rootd by hand running directly under your private
+account (no root system privileges needed). For example to start
+rootd listening on port 5151 just type:   \verb+rootd -p 5151+
+Notice that no \& is needed. Rootd will go into background by itself.
+
 \begin{verbatim}
-  int fits_write_imgnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffppn[b,i,ui,k,uk,j,uje,d]
-      (fitsfile *fptr, long group, long firstelem,
-           long nelements, DTYPE *array, DTYPE nulval, > int *status);
+  Rootd arguments:
+    -i                says we were started by inetd
+    -p port#          specifies a different port to listen on
+    -d level          level of debug info written to syslog
+                      0 = no debug (default)
+                      1 = minimum
+                      2 = medium
+                      3 = maximum
 \end{verbatim}
- 
-\begin{description}
-\item[5 ]Set data array elements as undefined. \label{ffppru}
-\end{description}
- 
+Rootd can also be configured for anonymous usage (like anonymous ftp).
+To setup rootd to accept anonymous logins do the following (while being
+logged in as root):
+
 \begin{verbatim}
-  int fits_write_img_null / ffppru
-      (fitsfile *fptr, long group, long firstelem, long nelements,
-       > int *status)
+   - Add the following line to /etc/passwd:
+
+     rootd:*:71:72:Anonymous rootd:/var/spool/rootd:/bin/false
+
+     where you may modify the uid, gid (71, 72) and the home directory
+     to suite your system.
+
+   - Add the following line to /etc/group:
+
+     rootd:*:72:rootd
+
+     where the gid must match the gid in /etc/passwd.
+
+   - Create the directories:
+
+     mkdir /var/spool/rootd
+     mkdir /var/spool/rootd/tmp
+     chmod 777 /var/spool/rootd/tmp
+
+     Where /var/spool/rootd must match the rootd home directory as
+     specified in the rootd /etc/passwd entry.
+
+   - To make writeable directories for anonymous do, for example:
+
+     mkdir /var/spool/rootd/pub
+     chown rootd:rootd /var/spool/rootd/pub
 \end{verbatim}
- 
-\begin{description}
-\item[6 ] Write values into group parameters.  This routine only applies
-    to the `Random Grouped' FITS format which has been used for
-    applications in radio interferometry, but is offically deprecated
-   for future use.  \label{ffpgpx}
-\end{description}
- 
+That's all.  Several additional remarks:  you can login to an anonymous
+server either with the names "anonymous" or "rootd".  The password should
+be of type user@host.do.main. Only the @ is enforced for the time
+being.  In anonymous mode the top of the file tree is set to the rootd
+home directory, therefore only files below the home directory can be
+accessed.  Anonymous mode only works when the server is started via
+inetd.
+
+
+\subsection{Notes about the shmem filetype:}
+
+Shared memory files are currently supported on most Unix platforms,
+where the shared memory segments are managed by the operating system
+kernel and `live' independently of processes. They are not deleted (by
+default) when the process which created them terminates, although they
+will disappear if the system is rebooted.  Applications can create
+shared memory files in CFITSIO by calling:
+
 \begin{verbatim}
-  int fits_write_grppar_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffpgp[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long firstelem, long nelements,
-       > DTYPE *array, int *status)
+   fit_create_file(&fitsfileptr, "shmem://h2", &status);
 \end{verbatim}
- 
-\begin{description}
-\item[7 ] Write a 2-D image into the data array. \label{ffp2dx}
-\end{description}
- 
+where the root `file' names are currently restricted to be 'h0', 'h1',
+'h2', 'h3', etc., up to a maximum number defined by the the value of
+SHARED\_MAXSEG (equal to 16 by default).  This is a prototype
+implementation of the shared memory interface and a more robust
+interface, which will have fewer restrictions on the number of files
+and on their names, may be developed in the future.
+
+When opening an already existing FITS file in shared memory one calls
+the usual CFITSIO routine:
+
 \begin{verbatim}
-  int fits_write_2d_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffp2d[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long dim1, long naxis1,
-       long naxis2, DTYPE *array, > int *status)
+   fits_open_file(&fitsfileptr, "shmem://h7", mode, &status)
 \end{verbatim}
- 
-\begin{description}
-\item[8 ] Write a 3-D cube into the data array. \label{ffp3dx}
-\end{description}
- 
+The file mode can be READWRITE or READONLY just as with disk files.
+More than one process can operate on READONLY mode files at the same
+time.  CFITSIO supports proper file locking (both in READONLY and
+READWRITE modes), so calls to fits\_open\_file may be locked out until
+another other process closes the file.
+
+When an application is finished accessing a FITS file in a shared
+memory segment, it may close it  (and the file will remain in the
+system) with fits\_close\_file, or delete it with fits\_delete\_file.
+Physical deletion is postponed until the last process calls
+ffclos/ffdelt.  fits\_delete\_file tries to obtain a READWRITE lock on
+the file to be deleted, thus it can be blocked if the object was not
+opened in READWRITE mode.
+
+A shared memory management utility program called `smem', is included
+with the CFITSIO distribution.  It can be built by typing `make smem';
+then type `smem -h' to get a list of valid options.  Executing smem
+without any options causes it to list all the shared memory segments
+currently residing in the system and managed by the shared memory
+driver. To get a list of all the shared memory objects, run the system
+utility program `ipcs  [-a]'.
+
+
+\section{Base Filename}
+
+The base filename is the name of the file optionally including the
+director/subdirectory path, and in the case of `ftp', `http', and `root'
+filetypes, the machine identifier.  Examples:
+
 \begin{verbatim}
-  int fits_write_3d_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffp3d[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long dim1, long dim2,
-       long naxis1, long naxis2, long naxis3, DTYPE *array, > int *status)
+    myfile.fits
+    !data.fits
+    /data/myfile.fits
+    fits.gsfc.nasa.gov/ftp/sampledata/myfile.fits.gz
 \end{verbatim}
- 
-\begin{description}
-\item[9 ]  Write an arbitrary data subsection into the data array. \label{ffpssx}
-\end{description}
- 
+
+When creating a new output file on magnetic disk (of type file://) if
+the base filename begins with an exclamation point (!) then any
+existing file with that same basename will be deleted prior to creating
+the new FITS file.  Otherwise if the file to be created already exists,
+then CFITSIO will return an error and will not overwrite the existing
+file.  Note  that the exclamation point,  '!', is a special UNIX
+character, so if it is used  on the command line rather than entered at
+a task prompt, it must be  preceded by a backslash to force the UNIX
+shell to pass it verbatim to the application program.
+
+If the output disk file name ends with the suffix '.gz', then CFITSIO
+will compress the file using the gzip compression algorithm before
+writing it to disk.  This can reduce the amount of disk space used by
+the file.  Note that this feature requires that the uncompressed file
+be constructed in memory before it is compressed and written to disk,
+so it can fail if there is insufficient available memory.
+
+An input FITS file may be compressed with the gzip or Unix compress
+algorithms, in which case CFITSIO will uncompress the file on the fly
+into a temporary file (in memory or on disk).  Compressed files may
+only be opened with read-only permission.  When specifying the name of
+a compressed FITS file it is not necessary to append the file suffix
+(e.g., `.gz' or `.Z').  If CFITSIO cannot find the input file name
+without the suffix, then it will automatically search for a compressed
+file with the same root name.  In the case of reading ftp and http type
+files, CFITSIO generally looks for a compressed version of the file
+first, before trying to open the uncompressed file.  By default,
+CFITSIO copies (and uncompressed if necessary) the ftp or http FITS
+file into memory on the local machine before opening it.  This will
+fail if the local machine does not have enough memory to hold the whole
+FITS file, so in this case, the output filename specifier (see the next
+section) can be used to further control how CFITSIO reads ftp and http
+files.
+
+If the input file is an IRAF image file (*.imh file) then CFITSIO will
+automatically convert it on the fly into a virtual FITS image before it
+is opened by the application program.  IRAF images can only be opened
+with READONLY file access.
+
+Similarly, if the input file is a raw binary data array, then CFITSIO
+will convert it on the fly into a virtual FITS image with the basic set
+of required header keywords before it is opened by the application
+program (with READONLY access).  In this case the data type and
+dimensions of the image must be specified in square brackets following
+the filename (e.g. rawfile.dat[ib512,512]). The first character (case
+insensitive) defines the data type of the array:
+
+\begin{verbatim}
+     b         8-bit unsigned byte
+     i        16-bit signed integer
+     u        16-bit unsigned integer
+     j        32-bit signed integer
+     r or f   32-bit floating point
+     d        64-bit floating point
+\end{verbatim}
+An optional second character specifies the byte order of the array
+values: b or B indicates big endian (as in FITS files and the native
+format of SUN UNIX workstations and Mac PCs) and l or L indicates
+little endian (native format of DEC OSF workstations and IBM PCs).  If
+this character is omitted then the array is assumed to have the native
+byte order of the local machine.  These data type characters are then
+followed by a series of one or more integer values separated by commas
+which define the size of each dimension of the raw array.  Arrays with
+up to 5 dimensions are currently supported.  Finally, a byte offset to
+the position of the first pixel in the data file may be specified by
+separating it with a ':' from the last dimension value.  If omitted, it
+is assumed that the offset = 0.  This parameter may be used to skip
+over any header information in the file that precedes the binary data.
+Further examples:
+
+\begin{verbatim}
+  raw.dat[b10000]           1-dimensional 10000 pixel byte array
+  raw.dat[rb400,400,12]     3-dimensional floating point big-endian array
+  img.fits[ib512,512:2880]  reads the 512 x 512 short integer array in
+                            a FITS file, skipping over the 2880 byte header
+\end{verbatim}
+
+One special case of input file is where the filename = `-' (a dash or
+minus sign) or 'stdin' or 'stdout', which signifies that the input file
+is to be read from the stdin stream, or written to the stdout stream if
+a new output file is being created.  In the case of reading from stdin,
+CFITSIO first copies the whole stream into a temporary FITS file (in
+memory or on disk), and subsequent reading of the FITS file occurs in
+this copy.  When writing to stdout, CFITSIO first constructs the whole
+file in memory (since random access is required), then flushes it out
+to the stdout stream when the file is closed.  In addition, if the
+output filename = '-.gz' or 'stdout.gz' then it will be gzip compressed
+before being written to stdout.
+
+This ability to read and write on the stdin and stdout steams allows
+FITS files to be piped between tasks in memory rather than having to
+create temporary intermediate FITS files on disk.  For example if task1
+creates an output FITS file, and task2 reads an input FITS file, the
+FITS file may be piped between the 2 tasks by specifying
+
 \begin{verbatim}
-  int fits_write_subset_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffpss[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long naxis, long *naxes,
-       long *fpixel, long *lpixel, DTYPE *array, > int *status)
+   task1 - | task2 -
 \end{verbatim}
- 
-\begin{description}
-\item[10]  Read elements from the FITS data array.   Undefined FITS array
-    elements will be returned with a value = *nullval, (note that this
-    parameter gives the address of the null value, not the null value
-    itself) unless nulval = 0 or *nulval = 0, in which case no checks for
-   undefined pixels will be performed. \label{ffgpv}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_img / ffgpv
-      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
-       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)
+where the vertical bar is the Unix piping symbol.  This assumes that the 2
+tasks read the name of the FITS file off of the command line.
+
+
+\section{Output File Name when Opening an Existing File}
+
+An optional output filename may be specified in parentheses immediately
+following the base file name to be opened.  This is mainly useful in
+those cases where CFITSIO creates a temporary copy of the input FITS
+file before it is opened and passed to the application program.  This
+happens by default when opening a network FTP or HTTP-type file, when
+reading a compressed FITS file on a local disk, when reading from the
+stdin stream, or when a column filter, row filter, or binning specifier
+is included as part of the input file specification.  By default this
+temporary file is created in memory.  If there is not enough memory to
+create the file copy, then CFITSIO will exit with an error.   In these
+cases one can force a permanent file to be created on disk, instead of
+a temporary file in memory, by supplying the name in parentheses
+immediately following the base file name.  The output filename can
+include the '!' clobber flag.
+
+Thus, if the input filename to CFITSIO is:
+\verb+file1.fits.gz(file2.fits)+
+then CFITSIO will uncompress `file1.fits.gz' into the local disk file
+`file2.fits' before opening it.  CFITSIO does not automatically delete
+the output file, so it will still exist after the application program
+exits.
+
+The output filename "mem://" is also allowed, which will write the
+output file into memory, and also allow write access to the file.  This
+'file' will disappear when it is closed, but this may be useful for
+some applications which only need to modify a temporary copy of the file.
+
+In some cases, several different temporary FITS files will be created
+in sequence, for instance, if one opens a remote file using FTP, then
+filters rows in a binary table extension, then create an image by
+binning a pair of columns.  In this case, the remote file will be
+copied to a temporary local file, then a second temporary file will be
+created containing the filtered rows of the table, and finally a third
+temporary file containing the binned image will be created.  In cases
+like this where multiple files are created, the outfile specifier will
+be interpreted the name of the final file as described below, in descending
+priority:
+
+\begin{itemize}
+\item
+as the name of the final image file if an image within a single binary
+table cell is opened or if an image is created by binning a table column.
+\item
+as the name of the file containing the filtered table if a column filter
+and/or a row filter are specified.
+\item
+as the name of the local copy of the remote FTP or HTTP file.
+\item
+as the name of the uncompressed version of the FITS file, if a
+compressed FITS file on local disk has been opened.
+\item
+otherwise, the output filename is ignored.
+\end{itemize}
+
+The output file specifier is useful when reading FTP or HTTP-type
+FITS files since it can be used to create a local disk copy of the file
+that can be reused in the future.  If the output file name = `*' then a
+local file with the same name as the network file will be created.
+Note that CFITSIO will behave differently depending on whether the
+remote file is compressed or not as shown by the following examples:
+\begin{itemize}
+\item
+\verb+ftp://remote.machine/tmp/myfile.fits.gz(*)+ - the remote compressed
+file is copied to the local compressed file `myfile.fits.gz', which
+is then uncompressed in local memory before being opened and passed
+to the application program.
+
+\item
+\verb+ftp://remote.machine/tmp/myfile.fits.gz(myfile.fits)+ - the
+remote compressed file is copied and uncompressed into the local file
+`myfile.fits'.  This example requires less local memory than the
+previous example since the file is uncompressed on disk instead of in
+memory.
+
+\item
+\verb+ftp://remote.machine/tmp/myfile.fits(myfile.fits.gz)+ - this will
+usually produce an error since CFITSIO itself cannot compress files.
+\end{itemize}
+
+The exact behavior of CFITSIO in the latter case depends on the type of
+ftp server running on the remote machine and how it is configured.  In
+some cases, if the file `myfile.fits.gz' exists on the remote machine,
+then the server will copy it to the local machine.  In other cases the
+ftp server will automatically create and transmit a compressed version
+of the file if only the uncompressed version exists.  This can get
+rather confusing, so users should use a certain amount of caution when
+using the output file specifier with FTP or HTTP file types, to make
+sure they get the behavior that they expect.
+
+
+\section{Template File Name when Creating a New File}
+
+When a new FITS file is created with a call to fits\_create\_file, the
+name of a template file may be supplied in parentheses immediately
+following the name of the new file to be created.  This template is
+used to define the structure of one or more HDUs in the new file.  The
+template file may be another FITS file, in which case the newly created
+file will have exactly the same keywords in each HDU as in the template
+FITS file, but all the data units will be filled with zeros.  The
+template file may also be an ASCII text file, where each line (in
+general) describes one FITS keyword record.  The format of the ASCII
+template file is described in the following Template Files chapter.
+
+
+\section{Image Tile-Compression Specification}
+
+When specifying the name of the output FITS file to be created, the
+user can indicate that images should be written in tile-compressed
+format (see section 5.5, ``Primary Array or IMAGE Extension I/O
+Routines'') by enclosing the compression parameters in square brackets
+following the root disk file name.  Here are some examples of the
+syntax for specifying tile-compressed output images:
+
+\begin{verbatim}
+    myfile.fit[compress]    - use Rice algorithm and default tile size
+
+    myfile.fit[compress GZIP] - use the specified compression algorithm;
+    myfile.fit[compress Rice]     only the first letter of the algorithm
+    myfile.fit[compress PLIO]     name is required.
+
+    myfile.fit[compress Rice 100,100]   - use 100 x 100 pixel tile size
+    myfile.fit[compress Rice 100,100;2] - as above, and use noisebits = 2
+\end{verbatim}
+
+
+\section{HDU Location Specification}
+
+The optional HDU location specifier defines which HDU (Header-Data
+Unit, also known as an `extension') within the FITS file to initially
+open.  It must immediately follow the base file name (or the output
+file name if present).  If it is not specified then the first HDU (the
+primary array) is opened.  The HDU location specifier is required if
+the colFilter, rowFilter, or binSpec specifiers are present, because
+the primary array is not a valid HDU for these operations. The HDU may
+be specified either by absolute position number, starting with 0 for
+the primary array, or by reference to the HDU name, and optionally, the
+version number and the HDU type of the desired extension.  The location
+of an image within a single cell of a binary table may also be
+specified, as described below.
+
+The absolute position of the extension is specified either by enclosed
+the number in square brackets (e.g., `[1]' = the first extension
+following the primary array) or by preceded the number with a plus sign
+(`+1').  To specify the HDU by name, give the name of the desired HDU
+(the value of the EXTNAME or HDUNAME keyword) and optionally the
+extension version number (value of the EXTVER keyword) and the
+extension type (value of the XTENSION keyword: IMAGE, ASCII or TABLE,
+or BINTABLE), separated by commas and all enclosed in square brackets.
+If the value of EXTVER and XTENSION are not specified, then the first
+extension with the correct value of EXTNAME is opened. The extension
+name and type are not case sensitive, and the extension type may be
+abbreviated to a single letter (e.g., I = IMAGE extension or primary
+array, A or T = ASCII table extension, and B = binary table BINTABLE
+extension).   If the HDU location specifier is equal to `[PRIMARY]' or
+`[P]', then the primary array (the first HDU) will be opened.
+
+FITS images are most commonly stored in the primary array or an image
+extension, but images can also be stored as a vector in a single cell
+of a binary table (i.e. each row of the vector column contains a
+different image).  Such an image can be opened with CFITSIO by
+specifying the desired column  name and the row number after the binary
+table HDU specifier as shown in the following examples. The column name
+is separated from the HDU specifier by a semicolon and the row number
+is enclosed in parentheses.  In this case CFITSIO copies the image from
+the table cell into a temporary primary array before it is opened.  The
+application program then just sees the image in the primary array,
+without any extensions.  The particular row to be opened may be
+specified either by giving an absolute integer row number (starting
+with 1 for the first row), or by specifying a boolean expression that
+evaluates to TRUE for the desired row.  The first row that satisfies
+the expression will be used.  The row selection expression has the same
+syntax as described in the Row Filter Specifier section, below.
+
+ Examples:
+
+\begin{verbatim}
+   myfile.fits[3] - open the 3rd HDU following the primary array
+   myfile.fits+3  - same as above, but using the FTOOLS-style notation
+   myfile.fits[EVENTS] - open the extension that has EXTNAME = 'EVENTS'
+   myfile.fits[EVENTS, 2]  - same as above, but also requires EXTVER = 2
+   myfile.fits[events,2,b] - same, but also requires XTENSION = 'BINTABLE'
+   myfile.fits[3; images(17)] - opens the image in row 17 of the 'images'
+                                column in the 3rd extension of the file.
+   myfile.fits[3; images(exposure > 100)] - as above, but opens the image
+                   in the first row that has an 'exposure' column value
+                   greater than 100.
+\end{verbatim}
+
+
+\section{Image Section}
+
+A virtual file containing a rectangular subsection of an image can be
+extracted and opened by specifying the range of pixels (start:end)
+along each axis to be extracted from the original image.  One can also
+specify an optional pixel increment (start:end:step) for each axis of
+the input image.  A pixel step = 1 will be assumed if it is not
+specified.  If the start pixel is larger then the end pixel, then the
+image will be flipped (producing a mirror image) along that dimension.
+An asterisk, '*', may be used to specify the entire range of an axis,
+and '-*' will flip the entire axis. The input image can be in the
+primary array, in an image extension, or contained in a vector cell of
+a binary table. In the later 2 cases the extension name or number must
+be specified before the image section specifier.
+
+ Examples:
+
+\begin{verbatim}
+  myfile.fits[1:512:2, 2:512:2] -  open a 256x256 pixel image
+              consisting of the odd numbered columns (1st axis) and
+              the even numbered rows (2nd axis) of the image in the
+              primary array of the file.
+
+  myfile.fits[*, 512:256] - open an image consisting of all the columns
+              in the input image, but only rows 256 through 512.
+              The image will be flipped along the 2nd axis since
+              the starting pixel is greater than the ending pixel.
+
+  myfile.fits[*:2, 512:256:2] - same as above but keeping only
+              every other row and column in the input image.
+
+  myfile.fits[-*, *] - copy the entire image, flipping it along
+              the first axis.
+
+  myfile.fits[3][1:256,1:256] - opens a subsection of the image that
+              is in the 3rd extension of the file.
+
+  myfile.fits[4; images(12)][1:10,1:10] - open an image consisting
+	      of the first 10 pixels in both dimensions. The original
+	      image resides in the 12th row of the 'images' vector
+	      column in the table in the 4th extension of the file.
+\end{verbatim}
+
+When CFITSIO opens an image section it first creates a temporary file
+containing the image section plus a copy of any other HDUs in the
+file.  This temporary file is then opened by the application program,
+so it is not possible to write to or modify the input file when
+specifying an image section.  Note that CFITSIO automatically updates
+the world coordinate system keywords in the header of the image
+section, if they exist, so that the coordinate associated with each
+pixel in the image section will be computed correctly.
+
+
+\section{Column and Keyword Filtering Specification}
+
+The optional column/keyword filtering specifier is used to modify the
+column structure and/or the header keywords in the HDU that was
+selected with the previous HDU location specifier. This filtering
+specifier must be enclosed in square brackets and can be distinguished
+from a general row filter specifier (described below) by the fact that
+it begins with the string 'col ' and is not immediately followed by an
+equals sign.  The original file is not changed by this filtering
+operation, and instead the modifications are made on a copy of the
+input FITS file (usually in memory), which also contains a copy of all
+the other HDUs in the file.  This temporary file is passed to the
+application program and will persist only until the file is closed or
+until the program exits, unless the outfile specifier (see above) is
+also supplied.
+
+The column/keyword filter can be used to perform the following
+operations.  More than one operation may be specified by separating
+them with semi-colons.
+
+\begin{itemize}
+
+\item
+Copy only a specified list of columns columns to the filtered input file.
+The list of column name should be separated by semi-colons.  Wild card
+characters may be used in the column names to match multiple columns.
+If the expression contains both a list of columns to be included and
+columns to be deleted, then all the columns in the original table
+except the explicitly deleted columns will appear in the filtered
+table (i.e., there is no need to explicitly list the columns to
+be included if any columns are being deleted).
+
+\item
+Delete a column or keyword by listing the name preceded by a minus sign
+or an exclamation mark (!), e.g., '-TIME' will delete the TIME column
+if it exists, otherwise the TIME keyword.  An error is returned if
+neither a column nor keyword with this name exists.  Note  that the
+exclamation point,  '!', is a special UNIX character, so if it is used
+on the command line rather than entered at a task prompt, it must be
+preceded by a backslash to force the UNIX shell to ignore it.
+
+\item
+Rename an existing column or keyword with the syntax 'NewName ==
+OldName'.  An error is returned if neither a column nor keyword with
+this name exists.
+
+\item
+Append a new column or keyword to the table.  To create a column,
+give the new name, optionally followed by the data type in parentheses,
+followed by a single equals sign and an  expression to be used to
+compute the value (e.g., 'newcol(1J) = 0' will create a new 32-bit
+integer column called 'newcol' filled with zeros).  The data type is
+specified using the same syntax that is allowed for the value of the
+FITS TFORMn keyword (e.g., 'I', 'J', 'E', 'D', etc. for binary tables,
+and 'I8', F12.3', 'E20.12', etc. for ASCII tables).  If the data type is
+not specified then an appropriate data type will be chosen depending on
+the form of the expression (may be a character string, logical, bit, long
+integer, or double column). An appropriate vector count (in the case
+of binary tables) will also be added if not explicitly specified.
+
+When creating a new keyword, the keyword name must be preceded by a
+pound sign '\#', and the expression must evaluate to a scalar
+(i.e., cannot have a column name in the expression).  The comment
+string for the keyword may be specified in parentheses immediately
+following the keyword name (instead of supplying a data type as in
+the case of creating a new column).
+
+\item
+Recompute (overwrite) the values in an existing column or keyword by
+giving the name followed by an equals sign and an arithmetic
+expression.
+\end{itemize}
+
+The expression that is used when appending or recomputing columns or
+keywords can be arbitrarily complex and may be a function of other
+header keyword values and other columns (in the same row).  The full
+syntax and available functions for the expression are described below
+in the row filter specification section.
+
+
+For  complex  or commonly used operations,  one  can also  place the
+operations into an external text  file and import it  into the  column
+filter using  the syntax '[col @filename.txt]'.   The operations can
+extend over multiple lines of the  file, but multiple operations must
+still be separated by semicolons.   Any lines in the external text file
+that begin with 2 slash characters ('//') will be ignored and may be
+used to add comments into the file.
+
+Examples:
+
+\begin{verbatim}
+   [col Time;rate]               - only the Time and rate columns will
+                                   appear in the filtered input file.
+
+   [col Time;*raw]               - include the Time column and any other
+                                   columns whose name ends with 'raw'.
+
+   [col -TIME; Good == STATUS]   - deletes the TIME column and
+                                   renames the status column to 'Good'
+
+   [col PI=PHA * 1.1 + 0.2]      - creates new PI column from PHA values
+
+   [col rate = rate/exposure]   - recomputes the rate column by dividing
+                                   it by the EXPOSURE keyword value.
+\end{verbatim}
+
+
+\section{Row Filtering Specification}
+
+    When entering the name of a FITS table that is to be opened by a
+    program, an optional row filter may be specified to select a subset
+    of the rows in the table.  A temporary new FITS file is created on
+    the fly which contains only those rows for which the row filter
+    expression evaluates to true.  (The primary array and any other
+    extensions in the input file are also copied to the temporary
+    file).  The original FITS file is closed and the new virtual file
+    is opened by the application program.  The row filter expression is
+    enclosed in square brackets following the file name and extension
+    name (e.g., 'file.fits[events][GRADE==50]'  selects only those rows
+    where the GRADE column value equals 50).   When dealing with tables
+    where each row has an associated time and/or 2D spatial position,
+    the row filter expression can also be used to select rows based on
+    the times in a Good Time Intervals (GTI) extension, or on spatial
+    position as given in a SAO-style region file.
+
+
+\subsection{General Syntax}
+
+    The row filtering  expression can be an arbitrarily  complex series
+    of operations performed  on constants,  keyword values,  and column
+    data taken from the specified FITS TABLE extension.  The expression
+    must evaluate to a boolean  value for each row  of the table, where
+    a value of FALSE means that the row will be excluded.
+
+    For complex or commonly  used filters, one can place the expression
+    into a text file and import it into the row filter using the syntax
+    '[@filename.txt]'.  The expression can be  arbitrarily complex and
+    extend over multiple lines of the file.  Any lines in the external
+    text file that begin with 2 slash characters ('//') will be ignored
+    and may be used to add comments into the file.
+
+    Keyword and   column data  are referenced by   name.  Any  string of
+    characters not surrounded by    quotes (ie, a constant  string)   or
+    followed by   an open parentheses (ie,   a  function name)   will be
+    initially interpreted   as a column  name and  its contents for the
+    current row inserted into the expression.  If no such column exists,
+    a keyword of that  name will be searched for  and its value used, if
+    found.  To force the  name to be  interpreted as a keyword (in case
+    there is both a column and keyword with the  same name), precede the
+    keyword name with a single pound sign, '\#', as in '\#NAXIS2'.  Due to
+    the generalities of FITS column and  keyword names, if the column or
+    keyword name  contains a space or a  character which might appear as
+    an arithmetic  term then inclose  the  name in '\$'  characters as in
+    \$MAX PHA\$ or \#\$MAX-PHA\$.  Names are case insensitive.
+
+    To access a table entry in a row other  than the current one, follow
+    the  column's name  with  a row  offset  within  curly  braces.  For
+    example, 'PHA\{-3\}' will evaluate to the value  of column PHA, 3 rows
+    above  the  row currently  being processed.   One  cannot specify an
+    absolute row number, only a relative offset.  Rows that fall outside
+    the table will be treated as undefined, or NULLs.
+
+    Boolean   operators can be  used in  the expression  in either their
+    Fortran or C forms.  The following boolean operators are available:
+
+\begin{verbatim}
+    "equal"         .eq. .EQ. ==  "not equal"          .ne.  .NE.  !=
+    "less than"     .lt. .LT. <   "less than/equal"    .le.  .LE.  <= =<
+    "greater than"  .gt. .GT. >   "greater than/equal" .ge.  .GE.  >= =>
+    "or"            .or. .OR. ||  "and"                .and. .AND. &&
+    "negation"     .not. .NOT. !  "approx. equal(1e-7)"  ~
+\end{verbatim}
+
+Note  that the exclamation
+point,  '!', is a special UNIX character, so if it is used  on the
+command line rather than entered at a task prompt, it must be  preceded
+by a backslash to force the UNIX shell to ignore it.
+
+    The expression may  also include arithmetic operators and functions.
+    Trigonometric  functions use  radians,  not degrees.  The  following
+    arithmetic  operators and  functions  can be  used in the expression
+    (function names are case insensitive). A null value will be returned
+    in case of illegal operations such as divide by zero, sqrt(negative)
+    log(negative), log10(negative), arccos(.gt. 1), arcsin(.gt. 1).
+
+
+\begin{verbatim}
+    "addition"           +          "subtraction"          -
+    "multiplication"     *          "division"             /
+    "negation"           -          "exponentiation"       **   ^
+    "absolute value"     abs(x)     "cosine"               cos(x)
+    "sine"               sin(x)     "tangent"              tan(x)
+    "arc cosine"         arccos(x)  "arc sine"             arcsin(x)
+    "arc tangent"        arctan(x)  "arc tangent"          arctan2(x,y)
+    "hyperbolic cos"     cosh(x)    "hyperbolic sin"       sinh(x)
+    "hyperbolic tan"     tanh(x)    "round to nearest int" round(x)
+    "round down to int"  floor(x)   "round up to int"      ceil(x)
+    "exponential"        exp(x)     "square root"          sqrt(x)
+    "natural log"        log(x)     "common log"           log10(x)
+    "modulus"            i % j      "random # [0.0,1.0)"   random()
+    "minimum"            min(x,y)   "maximum"              max(x,y)
+    "if-then-else"       b?x:y
+\end{verbatim}
+
+    An alternate syntax for the min and max functions  has only a single
+    argument which  should be  a  vector value (see  below).  The result
+    will be the minimum/maximum element contained within the vector.
+
+    The  following  type  casting  operators  are  available,  where the
+    inclosing parentheses are required and taken  from  the  C  language
+    usage. Also, the integer to real casts values to double precision:
+
+\begin{verbatim}
+                "real to integer"    (int) x     (INT) x
+                "integer to real"    (float) i   (FLOAT) i
+\end{verbatim}
+
+    In addition, several constants are built in  for  use  in  numerical
+    expressions:
+
+
+\begin{verbatim}
+        #pi              3.1415...      #e             2.7182...
+        #deg             #pi/180        #row           current row number
+        #null         undefined value   #snull         undefined string
+\end{verbatim}
+
+    A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
+    "null" constants  are useful for conditionally  setting table values
+    to a NULL, or undefined, value (eg., "col1==-99 ? \#NULL : col1").
+
+    There is also a function for testing if  two  values  are  close  to
+    each  other,  i.e.,  if  they are "near" each other to within a user
+    specified tolerance. The  arguments,  value\_1  and  value\_2  can  be
+    integer  or  real  and  represent  the two values who's proximity is
+    being tested to be within the specified tolerance, also  an  integer
+    or real:
+
+\begin{verbatim}
+                    near(value_1, value_2, tolerance)
+\end{verbatim}
+    When  a  NULL, or undefined, value is encountered in the FITS table,
+    the expression will evaluate to NULL unless the undefined  value  is
+    not   actually   required  for  evaluation,  e.g. "TRUE  .or.  NULL"
+    evaluates to TRUE. The  following  two  functions  allow  some  NULL
+    detection  and  handling:
+
+\begin{verbatim}
+         "a null value?"              ISNULL(x)
+         "define a value for null"    DEFNULL(x,y)
+\end{verbatim}
+    The former
+    returns a boolean value of TRUE if the  argument  x  is  NULL.   The
+    later  "defines"  a  value  to  be  substituted  for NULL values; it
+    returns the value of x if x is not NULL, otherwise  it  returns  the
+    value of y.
+
+
+\subsection{Bit Masks}
+
+    Bit  masks can be used to select out rows from bit columns (TFORMn =
+    \#X) in FITS files. To represent the mask,  binary,  octal,  and  hex
+    formats are allowed:
+
+
+\begin{verbatim}
+                 binary:   b0110xx1010000101xxxx0001
+                 octal:    o720x1 -> (b111010000xxx001)
+                 hex:      h0FxD  -> (b00001111xxxx1101)
+\end{verbatim}
+
+    In  all  the  representations, an x or X is allowed in the mask as a
+    wild card. Note that the x represents a  different  number  of  wild
+    card  bits  in  each  representation.  All  representations are case
+    insensitive.
+
+    To construct the boolean expression using the mask  as  the  boolean
+    equal  operator  described above on a bit table column. For example,
+    if you had a 7 bit column named flags in a  FITS  table  and  wanted
+    all  rows  having  the bit pattern 0010011, the selection expression
+    would be:
+
+
+\begin{verbatim}
+                            flags == b0010011
+    or
+                            flags .eq. b10011
+\end{verbatim}
+
+    It is also possible to test if a range of bits is  less  than,  less
+    than  equal,  greater  than  and  greater than equal to a particular
+    boolean value:
+
+
+\begin{verbatim}
+                            flags <= bxxx010xx
+                            flags .gt. bxxx100xx
+                            flags .le. b1xxxxxxx
+\end{verbatim}
+
+    Notice the use of the x bit value to limit the range of  bits  being
+    compared.
+
+    It  is  not necessary to specify the leading (most significant) zero
+    (0) bits in the mask, as shown in the second expression above.
+
+    Bit wise AND, OR and NOT operations are  also  possible  on  two  or
+    more  bit  fields  using  the  '\&'(AND),  '$|$'(OR),  and the '!'(NOT)
+    operators. All of these operators result in a bit  field  which  can
+    then be used with the equal operator. For example:
+
+
+\begin{verbatim}
+                          (!flags) == b1101100
+                          (flags & b1000001) == bx000001
+\end{verbatim}
+
+    Bit  fields can be appended as well using the '+' operator.  Strings
+    can be concatenated this way, too.
+
+
+\subsection{Vector Columns}
+
+    Vector columns can also be used  in  building  the  expression.   No
+    special  syntax  is required if one wants to operate on all elements
+    of the vector.  Simply use the column name as for a  scalar  column.
+    Vector  columns  can  be  freely  intermixed  with scalar columns or
+    constants in virtually all expressions.  The result will be  of  the
+    same dimension as the vector.  Two vectors in an expression, though,
+    need to  have  the  same  number  of  elements  and  have  the  same
+    dimensions.   The  only  places  a vector column cannot be used (for
+    now, anyway) are the SAO  region  functions  and  the  NEAR  boolean
+    function.
+
+    Arithmetic and logical operations are all performed on an element by
+    element basis.  Comparing two vector columns,  eg  "COL1  ==  COL2",
+    thus  results  in  another vector of boolean values indicating which
+    elements of the two vectors are equal.
+
+    Eight functions are available that operate on a vector and return a
+    scalar result:
+
+\begin{verbatim}
+    "minimum"      MIN(V)          "maximum"               MAX(V)
+    "average"      AVERAGE(V)      "median"                MEDIAN(V)
+    "sumation"     SUM(V)          "standard deviation"    STDDEV(V)
+    "# of values"  NELEM(V)        "# of non-null values"  NVALID(V)
+\end{verbatim}
+    where V represents the name of a vector column or a manually
+    constructed vector using curly brackets as described below.  The
+    first 6 of these functions ignore any null values in the vector when
+    computing the result.
+
+    The SUM function literally sums all  the elements in x,  returning a
+    scalar value.   If V  is  a  boolean  vector, SUM returns the number
+    of TRUE elements. The NELEM function  returns the number of elements
+    in vector V whereas NVALID return the number of non-null elements in
+    the  vector.   (NELEM  also  operates  on  bit  and string  columns,
+    returning their column widths.)  As an example, to  test whether all
+    elements of two vectors satisfy a  given logical comparison, one can
+    use the expression
+
+\begin{verbatim}
+              SUM( COL1 > COL2 ) == NELEM( COL1 )
+\end{verbatim}
+
+    which will return TRUE if all elements  of  COL1  are  greater  than
+    their corresponding elements in COL2.
+
+    To  specify  a  single  element  of  a  vector, give the column name
+    followed by  a  comma-separated  list  of  coordinates  enclosed  in
+    square  brackets.  For example, if a vector column named PHAS exists
+    in the table as a one dimensional, 256  component  list  of  numbers
+    from  which  you  wanted to select the 57th component for use in the
+    expression, then PHAS[57] would do the  trick.   Higher  dimensional
+    arrays  of  data  may appear in a column.  But in order to interpret
+    them, the TDIMn keyword must appear in the header.  Assuming that  a
+    (4,4,4,4)  array  is packed into each row of a column named ARRAY4D,
+    the  (1,2,3,4)  component  element  of  each  row  is  accessed   by
+    ARRAY4D[1,2,3,4].    Arrays   up   to   dimension  5  are  currently
+    supported.  Each vector index can itself be an expression,  although
+    it  must  evaluate  to  an  integer  value  within the bounds of the
+    vector.  Vector columns which contain spaces or arithmetic operators
+    must   have   their   names  enclosed  in  "\$"  characters  as  with
+    \$ARRAY-4D\$[1,2,3,4].
+
+    A  more  C-like  syntax  for  specifying  vector  indices  is   also
+    available.   The element used in the preceding example alternatively
+    could be specified with the syntax  ARRAY4D[4][3][2][1].   Note  the
+    reverse  order  of  indices  (as in C), as well as the fact that the
+    values are still ones-based (as  in  Fortran  --  adopted  to  avoid
+    ambiguity  for  1D vectors).  With this syntax, one does not need to
+    specify all of the indices.  To  extract  a  3D  slice  of  this  4D
+    array, use ARRAY4D[4].
+
+    Variable-length vector columns are not supported.
+
+    Vectors can  be manually constructed  within the expression  using a
+    comma-separated list of  elements surrounded by curly braces ('\{\}').
+    For example, '\{1,3,6,1\}' is a 4-element vector containing the values
+    1, 3, 6, and 1.  The  vector can contain  only boolean, integer, and
+    real values (or expressions).  The elements will  be promoted to the
+    highest  data type   present.  Any   elements   which  are themselves
+    vectors, will be expanded out with  each of its elements becoming an
+    element in the constructed vector.
+
+
+\subsection{Good Time Interval Filtering}
+
+    A common filtering method involves selecting rows which have a time
+    value which lies within what is called a Good Time Interval or GTI.
+    The time intervals are defined in a separate FITS table extension
+    which contains 2 columns giving the start and stop time of each
+    good interval.  The filtering operation accepts only those rows of
+    the input table which have an associated time which falls within
+    one of the time intervals defined in the GTI extension. A high
+    level function, gtifilter(a,b,c,d), is available which evaluates
+    each row of the input table  and returns TRUE  or FALSE depending
+    whether the row is inside or outside the  good time interval.  The
+    syntax is
+
+\begin{verbatim}
+      gtifilter( [ "gtifile" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
+\end{verbatim}
+    where  each "[]" demarks optional parameters.  Note that  the quotes
+    around the gtifile and START/STOP column are required.  Either single
+    or double quotes may be used. The gtifile,
+    if specified,  can be blank  ("") which will  mean to use  the first
+    extension  with   the name "*GTI*"  in   the current  file,  a plain
+    extension  specifier (eg, "+2",  "[2]", or "[STDGTI]") which will be
+    used  to  select  an extension  in  the current  file, or  a regular
+    filename with or without an extension  specifier which in the latter
+    case  will mean to  use the first  extension  with an extension name
+    "*GTI*".  Expr can be   any arithmetic expression, including  simply
+    the time  column  name.  A  vector  time expression  will  produce a
+    vector boolean  result.  STARTCOL and  STOPCOL are the  names of the
+    START/STOP   columns in the    GTI extension.  If   one  of them  is
+    specified, they both  must be.
+
+    In  its  simplest form, no parameters need to be provided -- default
+    values will be used.  The expression "gtifilter()" is equivalent to
+
+\begin{verbatim}
+       gtifilter( "", TIME, "*START*", "*STOP*" )
+\end{verbatim}
+    This will search the current file for a GTI  extension,  filter  the
+    TIME  column in the current table, using START/STOP times taken from
+    columns in the GTI  extension  with  names  containing  the  strings
+    "START"  and "STOP".  The wildcards ('*') allow slight variations in
+    naming conventions  such  as  "TSTART"  or  "STARTTIME".   The  same
+    default  values  apply for unspecified parameters when the first one
+    or  two  parameters  are  specified.   The  function   automatically
+    searches   for   TIMEZERO/I/F   keywords  in  the  current  and  GTI
+    extensions, applying a relative time offset, if necessary.
+
+
+\subsection{Spatial Region Filtering}
+
+    Another common  filtering method selects rows based on whether the
+    spatial position associated with each row is located within a given
+    2-dimensional region.  The syntax for this high-level filter is
+
+\begin{verbatim}
+       regfilter( "regfilename" [ , Xexpr, Yexpr [ , "wcs cols" ] ] )
+\end{verbatim}
+    where each "[]" demarks optional parameters. The region file name
+    is required and must be  enclosed in quotes.  The remaining
+    parameters are optional.  The region file is an ASCII text file
+    which contains a list of one or more geometric shapes (circle,
+    ellipse, box, etc.) which defines a region on the celestial sphere
+    or an area within a particular 2D image.  The region file is
+    typically generated using an image display program such as fv/POW
+    (distribute by the HEASARC), or ds9 (distributed by the Smithsonian
+    Astrophysical Observatory).  Users should refer to the documentation
+    provided with these programs for more details on the syntax used in
+    the region files.
+
+    In its simpliest form, (e.g., regfilter("region.reg") ) the
+    coordinates in the default 'X' and 'Y' columns will be used to
+    determine if each row is inside or outside the area specified in
+    the region file.  Alternate position column names, or expressions,
+    may be entered if needed, as in
+
+\begin{verbatim}
+        regfilter("region.reg", XPOS, YPOS)
+\end{verbatim}
+    Region filtering can be applied most unambiguously if the positions
+    in the region file and in the table to be filtered are both give in
+    terms of absolute celestial coordinate units.  In this case the
+    locations and sizes of the geometric shapes in the region file are
+    specified in angular units on the sky (e.g., positions given in
+    R.A. and Dec.  and sizes in arcseconds or arcminutes).  Similarly,
+    each row of the filtered table will have a celestial coordinate
+    associated with it.  This association is usually implemented using
+    a set of so-called 'World Coordinate System' (or WCS) FITS keywords
+    that define the coordinate transformation that must be applied to
+    the values in the 'X' and 'Y' columns to calculate the coordinate.
+
+    Alternatively, one can perform spatial filtering using unitless
+    'pixel' coordinates for the regions and row positions.  In this
+    case the user must be careful to ensure that the positions in the 2
+    files are self-consistent.  A typical problem is that the region
+    file may be generated using a binned image, but the unbinned
+    coordinates are given in the event table.  The ROSAT events files,
+    for example, have X and Y pixel coordinates that range from 1 -
+    15360.  These coordinates are typically binned by a factor of 32 to
+    produce a 480x480 pixel image.  If one then uses a region file
+    generated from this image (in image pixel units) to filter the
+    ROSAT events file, then the X and Y column values must be converted
+    to corresponding pixel units as in:
+
+\begin{verbatim}
+        regfilter("rosat.reg", X/32.+.5, Y/32.+.5)
+\end{verbatim}
+    Note that this binning conversion is not necessary if the region
+    file is specified using celestial coordinate units instead of pixel
+    units because CFITSIO is then able to directly compare the
+    celestial coordinate of each row in the table with the celestial
+    coordinates in the region file without having to know anything
+    about how the image may have been binned.
+
+    The last "wcs cols" parameter should rarely be needed. If supplied,
+    this  string contains the names of the 2 columns (space or comma
+    separated) which have the associated WCS keywords. If not supplied,
+    the filter  will scan the X  and Y expressions for column names.
+    If only one is found in each  expression, those columns will be
+    used, otherwise an error will be returned.
+
+    These region shapes are supported (names are case insensitive):
+
+\begin{verbatim}
+       Point         ( X1, Y1 )               <- One pixel square region
+       Line          ( X1, Y1, X2, Y2 )       <- One pixel wide region
+       Polygon       ( X1, Y1, X2, Y2, ... )  <- Rest are interiors with
+       Rectangle     ( X1, Y1, X2, Y2, A )       | boundaries considered
+       Box           ( Xc, Yc, Wdth, Hght, A )   V within the region
+       Diamond       ( Xc, Yc, Wdth, Hght, A )
+       Circle        ( Xc, Yc, R )
+       Annulus       ( Xc, Yc, Rin, Rout )
+       Ellipse       ( Xc, Yc, Rx, Ry, A )
+       Elliptannulus ( Xc, Yc, Rinx, Riny, Routx, Routy, Ain, Aout )
+       Sector        ( Xc, Yc, Amin, Amax )
+\end{verbatim}
+    where (Xc,Yc) is  the coordinate of  the shape's center; (X\#,Y\#) are
+    the coordinates  of the shape's edges;  Rxxx are the shapes' various
+    Radii or semimajor/minor  axes; and Axxx  are the angles of rotation
+    (or bounding angles for Sector) in degrees.  For rotated shapes, the
+    rotation angle  can  be left  off, indicating  no rotation.   Common
+    alternate  names for the regions  can also be  used: rotbox = box;
+    rotrectangle = rectangle;  (rot)rhombus = (rot)diamond;  and pie
+    = sector.  When a  shape's name is  preceded by a minus sign, '-',
+    the defined region  is instead the area  *outside* its boundary (ie,
+    the region is inverted).  All the shapes within a single region
+    file are OR'd together to create the region, and the order is
+    significant. The overall way of looking at region files is that if
+    the first region is an excluded region then a dummy included region
+    of the whole detector is inserted in the front. Then each region
+    specification as it is processed overrides any selections inside of
+    that region specified by previous regions. Another way of thinking
+    about this is that if a previous excluded region is completely
+    inside of a subsequent included region the excluded region is
+    ignored.
+
+    The positional coordinates may be given either in pixel units,
+    decimal degrees or hh:mm:ss.s, dd:mm:ss.s units.  The shape sizes
+    may be given in pixels, degrees, arcminutes, or arcseconds.  Look
+    at examples of region file produced by fv/POW or ds9 for further
+    details of the region file format.
+
+    There are three functions that are primarily for use with SAO region
+    files and the  FSAOI  task, but they  can  be  used  directly.  They
+    return  a  boolean true   or  false  depending   on  whether a   two
+    dimensional point is in the region or not:
+
+\begin{verbatim}
+    "point in a circular region"
+          circle(xcntr,ycntr,radius,Xcolumn,Ycolumn)
+
+    "point in an elliptical region"
+         ellipse(xcntr,ycntr,xhlf_wdth,yhlf_wdth,rotation,Xcolumn,Ycolumn)
+
+    "point in a rectangular region"
+             box(xcntr,ycntr,xfll_wdth,yfll_wdth,rotation,Xcolumn,Ycolumn)
+
+    where
+       (xcntr,ycntr) are the (x,y) position of the center of the region
+       (xhlf_wdth,yhlf_wdth) are the (x,y) half widths of the region
+       (xfll_wdth,yfll_wdth) are the (x,y) full widths of the region
+       (radius) is half the diameter of the circle
+       (rotation) is the angle(degrees) that the region is rotated with
+             respect to (xcntr,ycntr)
+       (Xcoord,Ycoord) are the (x,y) coordinates to test, usually column
+             names
+       NOTE: each parameter can itself be an expression, not merely a
+             column name or constant.
+\end{verbatim}
+
+
+\subsection{Example Row Filters}
+
+\begin{verbatim}
+    [ binary && mag <= 5.0]        - Extract all binary stars brighter
+                                     than  fifth magnitude (note that
+                                     the initial space is necessary to
+                                     prevent it from being treated as a
+                                     binning specification)
+
+    [#row >= 125 && #row <= 175]   - Extract row numbers 125 through 175
+
+    [IMAGE[4,5] .gt. 100]          - Extract all rows that have the
+                                     (4,5) component of the IMAGE column
+                                     greater than 100
+
+    [abs(sin(theta * #deg)) < 0.5] - Extract all rows having the
+                                     absolute value of the sine of theta
+                                     less  than a half where the angles
+                                     are tabulated in degrees
+
+    [SUM( SPEC > 3*BACKGRND )>=1]  - Extract all rows containing a
+                                     spectrum, held in vector column
+                                     SPEC, with at least one value 3
+                                     times greater than the background
+                                     level held in a keyword, BACKGRND
+
+    [VCOL=={1,4,2}]                - Extract all rows whose vector column
+                                     VCOL contains the 3-elements 1, 4, and
+                                     2.
+
+    [@rowFilter.txt]               - Extract rows using the expression
+                                     contained within the text file
+                                     rowFilter.txt
+
+    [gtifilter()]                  - Search the current file for a GTI
+				     extension,  filter  the TIME
+				     column in the current table, using
+				     START/STOP times taken from
+				     columns in the GTI  extension
+
+    [regfilter("pow.reg")]         - Extract rows which have a coordinate
+                                     (as given in the X and Y columns)
+                                     within the spatial region specified
+                                     in the pow.reg region file.
+
+    [regfilter("pow.reg", Xs, Ys)] - Same as above, except that the
+                                     Xs and Ys columns will be used to
+                                     determine the coordinate of each
+                                     row in the table.
+\end{verbatim}
+
+
+\section{ Binning or Histogramming Specification}
+
+The optional binning specifier is enclosed in square brackets and can
+be distinguished from a general row filter specification by the fact
+that it begins with the keyword 'bin'  not immediately followed by an
+equals sign.  When binning is specified, a temporary N-dimensional FITS
+primary array is created by computing the histogram of the values in
+the specified columns of a FITS table extension.  After the histogram
+is computed the input FITS file containing the table is then closed and
+the temporary FITS primary array is opened and passed to the
+application program.  Thus, the application program never sees the
+original FITS table and only sees the image in the new temporary file
+(which has no additional extensions).  Obviously, the application
+program must be expecting to open a FITS image and not a FITS table in
+this case.
+
+The data type of the FITS histogram image may be specified by appending
+'b' (for 8-bit byte), 'i' (for 16-bit integers), 'j' (for 32-bit
+integer), 'r' (for 32-bit floating points), or 'd' (for 64-bit double
+precision floating point)  to the 'bin' keyword (e.g. '[binr X]'
+creates a real floating point image).  If the data type is not
+explicitly specified then a 32-bit integer image will be created by
+default, unless the weighting option is also specified in which case
+the image will have a 32-bit floating point data type by default.
+
+The histogram image may have from 1 to 4 dimensions (axes), depending
+on the number of columns that are specified.  The general form of the
+binning specification is:
+
+\begin{verbatim}
+ [bin{bijrd}  Xcol=min:max:binsize, Ycol= ..., Zcol=..., Tcol=...; weight]
 \end{verbatim}
- 
-\begin{description}
-\item[11]  Read elements from the data array.  Undefined array elements will be
-    returned with a value = nullval, unless nullval = 0 in which case no
-   checks for undefined pixels will be performed. \label{ffgpvx}
-\end{description}
- 
+in which up to 4 columns, each corresponding to an axis of the image,
+are listed. The column names are case insensitive, and the column
+number may be given instead of the name, preceded by a pound sign
+(e.g., [bin \#4=1:512]).  If the column name is not specified, then
+CFITSIO will first try to use the 'preferred column' as specified by
+the CPREF keyword if it exists (e.g., 'CPREF = 'DETX,DETY'), otherwise
+column names 'X', 'Y', 'Z', and 'T' will be assumed for each of the 4
+axes, respectively.  In cases where the column name could be confused
+with an arithmetic expression, enclose the column name in parentheses to
+force the name to be interpreted literally.
+
+Each column name may be followed by an equals sign and then the lower
+and upper range of the histogram, and the size of the histogram bins,
+separated by colons.  Spaces are allowed before and after the equals
+sign but not within the 'min:max:binsize' string.  The min, max and
+binsize values may be integer or floating point numbers, or they may be
+the names of keywords in the header of the table.  If the latter, then
+the value of that keyword is substituted into the expression.
+
+Default values for the min, max and binsize quantities will be
+used if not explicitly given in the binning expression as shown
+in these examples:
+
 \begin{verbatim}
-  int fits_read_img_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffgpv[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, long group, long firstelem, long nelements,
-       DTYPE nulval, > DTYPE *array, int *anynul, int *status)
+    [bin x = :512:2]  - use default minimum value
+    [bin x = 1::2]    - use default maximum value
+    [bin x = 1:512]   - use default bin size
+    [bin x = 1:]      - use default maximum value and bin size
+    [bin x = :512]    - use default minimum value and bin size
+    [bin x = 2]       - use default minimum and maximum values
+    [bin x]           - use default minimum, maximum and bin size
+    [bin 4]           - default 2-D image, bin size = 4 in both axes
+    [bin]             - default 2-D image
 \end{verbatim}
- 
-\begin{description}
-\item[12]  Read elements from the FITS data array.   Any undefined FITS array
-    elements will have the corresponding nullarray element set
-   to TRUE.  \label{ffgpf}
-\end{description}
- 
+CFITSIO  will use the value of the TLMINn, TLMAXn, and TDBINn keywords,
+if they exist, for the default min, max, and binsize, respectively.  If
+they do not exist then CFITSIO will use the actual minimum and maximum
+values in the column for the histogram min and max values.  The default
+binsize will be set to 1, or (max - min) / 10., whichever is smaller,
+so that the histogram will have at least 10 bins along each axis.
+
+A shortcut notation is allowed if all the columns/axes have the same
+binning specification.  In this case all the column names may be listed
+within parentheses, followed by the (single) binning specification, as
+in:
+
 \begin{verbatim}
-  int fits_read_imgnull / ffgpf
-      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
-       > DTYPE *array, char *nullarray, int *anynul, int *status)
+    [bin (X,Y)=1:512:2]
+    [bin (X,Y) = 5]
 \end{verbatim}
- 
-\begin{description}
-\item[13]  Read elements and nullflags from data array.
-    Any undefined array elements will have the corresponding nularray element
-   set equal to 1, else 0. \label{ffgpfx}
-\end{description}
- 
+
+The optional weighting factor is the last item in the binning specifier
+and, if present, is separated from the list of columns by a
+semi-colon.  As the histogram is accumulated, this weight is used to
+incremented the value of the appropriated bin in the histogram.  If the
+weighting factor is not specified, then the default weight = 1 is
+assumed.  The weighting factor may be a constant integer or floating
+point number, or the name of a keyword containing the weighting value.
+Or the weighting factor may be the name of a table column in which case
+the value in that column, on a row by row basis, will be used.
+
+In some cases, the column or keyword may give the reciprocal of the
+actual weight value that is needed.  In this case, precede the weight
+keyword or column name by a slash '/' to tell CFITSIO to use the
+reciprocal of the value when constructing the histogram.
+
+For  complex or commonly  used  histograms, one  can also  place its
+description  into  a  text  file and  import   it  into  the binning
+specification  using the  syntax [bin  @filename.txt].  The file's
+contents  can extend over   multiple lines, although  it must still
+conform to the  no-spaces rule  for the min:max:binsize syntax and each
+axis specification must still be comma-separated.  Any lines in the
+external text file that begin with 2 slash characters ('//') will be
+ignored and may be used to add comments into the file.
+
+ Examples:
+
+
 \begin{verbatim}
-  int  fits_read_imgnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffgpf[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, long group, long firstelem, long nelements,
-       > DTYPE *array, char *nularray, int *anynul, int *status)
+    [bini detx, dety]                - 2-D, 16-bit integer histogram
+                                       of DETX and DETY columns, using
+                                       default values for the histogram
+                                       range and binsize
+
+    [bin (detx, dety)=16; /exposure] - 2-D, 32-bit real histogram of DETX
+                                       and DETY columns with a bin size = 16
+                                       in both axes. The histogram values
+                                       are divided by the EXPOSURE keyword
+                                       value.
+
+    [bin time=TSTART:TSTOP:0.1]      - 1-D lightcurve, range determined by
+                                       the TSTART and TSTOP keywords,
+                                       with 0.1 unit size bins.
+
+    [bin pha, time=8000.:8100.:0.1]  - 2-D image using default binning
+                                       of the PHA column for the X axis,
+                                       and 1000 bins in the range
+                                       8000. to 8100. for the Y axis.
+
+    [bin @binFilter.txt]             - Use the contents of the text file
+                                       binFilter.txt for the binning
+                                       specifications.
+
 \end{verbatim}
- 
-\begin{description}
-\item[14]  Read values from group parameters.  This routine only applies
-    to the `Random Grouped' FITS format which has been used for
-    applications in radio interferometry, but is offically deprecated
-   for future use. \label{ffggpx}
-\end{description}
- 
+\chapter{Template Files }
+
+When a new FITS file is created with a call to fits\_create\_file, the
+name of a template file may be supplied in parentheses immediately
+following the name of the new file to be created.  This template is
+used to define the structure of one or more HDUs in the new file.  The
+template file may be another FITS file, in which case the newly created
+file will have exactly the same keywords in each HDU as in the template
+FITS file, but all the data units will be filled with zeros.  The
+template file may also be an ASCII text file, where each line (in
+general) describes one FITS keyword record.  The format of the ASCII
+template file is described in the following sections.
+
+
+\section{Detailed Template Line Format}
+
+The format of each ASCII template line closely follows the format of a
+FITS keyword record:
+
 \begin{verbatim}
-  int  fits_read_grppar_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffggp[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, long group, long firstelem, long nelements,
-       > DTYPE *array, int *status)
+  KEYWORD = KEYVALUE / COMMENT
 \end{verbatim}
- 
-\begin{description}
-\item[15]   Read 2-D image from the data array.  Undefined
-     pixels in the array will be set equal to the value of 'nulval',
-     unless nulval=0 in which case no testing for undefined pixels will
-    be performed. \label{ffg2dx}
-\end{description}
- 
+except that free format may be used (e.g., the equals sign may appear
+at any position in the line) and TAB characters are allowed and are
+treated the same as space characters.  The KEYVALUE and COMMENT fields
+are optional.  The equals sign character is also optional, but it is
+recommended that it be included for clarity.  Any template line that
+begins with the pound '\#' character is ignored by the template parser
+and may be use to insert comments into the template file itself.
+
+The KEYWORD name field is limited to 8 characters in length and only
+the letters A-Z, digits 0-9, and the hyphen and underscore characters
+may be used, without any embedded spaces. Lowercase letters in the
+template keyword name will be converted to uppercase.  Leading spaces
+in the template line preceding the keyword name are generally ignored,
+except if the first 8 characters of a template line are all blank, then
+the entire line is treated as a FITS comment keyword (with a blank
+keyword name) and is copied verbatim into the FITS header.
+
+The KEYVALUE field may have any allowed  FITS  data type: character
+string, logical, integer, real, complex integer, or complex real.  The
+character string values need not be enclosed in single quote characters
+unless they are necessary to distinguish the string from a different
+data type (e.g.  2.0 is a real but '2.0' is a string).  The keyword has
+an undefined (null) value if the template record only contains blanks
+following the "=" or between the "=" and the "/" comment field
+delimiter.
+
+String keyword values longer than 68 characters (the maximum length
+that will fit in a single FITS keyword record) are permitted using the
+CFITSIO long string convention. They can either be specified as a
+single long line in the template, or by using multiple lines where the
+continuing lines contain the 'CONTINUE' keyword, as in this example:
+
+\begin{verbatim}
+  LONGKEY = 'This is a long string value that is contin&'
+  CONTINUE  'ued over 2 records' / comment field goes here
+\end{verbatim}
+The format of template lines with CONTINUE keyword is very strict:  3
+spaces must follow CONTINUE and the rest of the line is copied verbatim
+to the FITS file.
+
+The start of the optional COMMENT field must be preceded by "/", which
+is used to separate it from the keyword value field. Exceptions are if
+the KEYWORD name field contains COMMENT, HISTORY, CONTINUE, or if the
+first 8 characters of the template line are blanks.
+
+More than one Header-Data Unit (HDU) may be defined in the template
+file.  The start of an HDU definition is denoted with a SIMPLE or
+XTENSION template line:
+
+1) SIMPLE begins a Primary HDU definition. SIMPLE may only appear as
+the  first keyword in the template file. If the template file begins
+with XTENSION instead of SIMPLE, then a default empty Primary HDU is
+created, and the template is then assumed to define the keywords
+starting with the first extension following the Primary HDU.
+
+2) XTENSION marks the beginning of a new extension HDU definition.  The
+previous HDU will be closed at this point and processing of the next
+extension begins.
+
+
+\section{Auto-indexing of Keywords}
+
+If a template keyword name ends with a "\#" character, it is said to be
+'auto-indexed'.   Each "\#" character will be replaced by the current
+integer index value, which gets reset = 1 at the start of each new HDU
+in the file (or 7 in the special case of a GROUP definition).  The
+FIRST indexed keyword in each template HDU definition is used as the
+'incrementor';  each subsequent occurrence of this SAME keyword will
+cause the index value to be incremented.  This behavior can be rather
+subtle, as illustrated in the following examples in which the TTYPE
+keyword is the incrementor in both cases:
+
+\begin{verbatim}
+  TTYPE# = TIME
+  TFORM# = 1D
+  TTYPE# = RATE
+  TFORM# = 1E
+\end{verbatim}
+will create TTYPE1, TFORM1, TTYPE2, and TFORM2 keywords.  But if the
+template looks like,
+
+\begin{verbatim}
+  TTYPE# = TIME
+  TTYPE# = RATE
+  TFORM# = 1D
+  TFORM# = 1E
+\end{verbatim}
+this results in a FITS files with  TTYPE1, TTYPE2, TFORM2, and TFORM2,
+which is probably not what was intended!
+
+
+\section{Template Parser Directives}
+
+In addition to the template lines which define individual keywords, the
+template parser recognizes 3 special directives which are each preceded
+by the backslash character:  \verb+ \include, \group+, and \verb+ \end+.
+
+The 'include' directive must be followed by a filename. It forces the
+parser to temporarily stop reading the current template file and begin
+reading the include file. Once the parser reaches the end of the
+include file it continues parsing the current template file.  Include
+files can be nested, and HDU definitions can span multiple template
+files.
+
+The start of a GROUP definition is denoted with the 'group' directive,
+and the end of a GROUP definition is denoted with the 'end' directive.
+Each GROUP contains 0 or more member blocks (HDUs or GROUPs). Member
+blocks of type GROUP can contain their own member blocks. The GROUP
+definition itself occupies one FITS file HDU of special type (GROUP
+HDU), so if a template specifies 1 group with 1 member HDU like:
+
 \begin{verbatim}
-  int  fits_read_2d_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffg2d[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, long group, DTYPE nulval, long dim1, long naxis1,
-       long naxis2, > DTYPE *array, int *anynul, int *status)
+\group
+grpdescr = 'demo'
+xtension bintable
+# this bintable has 0 cols, 0 rows
+\end
 \end{verbatim}
- 
-\begin{description}
-\item[16]  Read 3-D cube from the data array.   Undefined
-    pixels in the array will be set equal to the value of 'nulval',
-    unless nulval=0 in which case no testing for undefined pixels will
-   be performed. \label{ffg3dx}
-\end{description}
- 
+then the parser creates a FITS file with 3 HDUs :
+
 \begin{verbatim}
-  int  fits_read_3d_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffg3d[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, long group, DTYPE nulval, long dim1,
-       long dim2, long naxis1, long naxis2, long naxis3,
-       > DTYPE *array, int *anynul, int *status)
+1) dummy PHDU
+2) GROUP HDU (has 1 member, which is bintable in HDU number 3)
+3) bintable (member of GROUP in HDU number 2)
 \end{verbatim}
- 
-\begin{description}
-\item[17]    Read an arbitrary data subsection from the data array.  Undefined
-       pixels in the array will be set equal to the value of 'nulval',
-       unless nullval=0 in which case no testing for undefined pixels will
-      be performed. \label{ffgsvx}
-\end{description}
- 
+Technically speaking, the GROUP HDU is a BINTABLE with 6 columns. Applications
+can define additional columns in a GROUP HDU using TFORMn and TTYPEn
+(where n is 7, 8, ....) keywords or their auto-indexing equivalents.
+
+For a more complicated example of a template file using the group directives,
+look at the sample.tpl file that is included in the CFITSIO distribution.
+
+
+\section{Formal Template Syntax}
+
+The template syntax can formally be defined as follows:
+
 \begin{verbatim}
-  int  fits_read_subset_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffgsv[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, int group, int naxis, long *naxes,
-       long *fpixel, long *lpixel, long *inc, DTYPE nulval,
-       > DTYPE *array, int *anynul, int *status)
+    TEMPLATE = BLOCK [ BLOCK ... ]
+
+       BLOCK = { HDU | GROUP }
+
+       GROUP = \GROUP [ BLOCK ... ] \END
+
+         HDU = XTENSION [ LINE ... ] { XTENSION | \GROUP | \END | EOF }
+
+        LINE = [ KEYWORD [ = ] ] [ VALUE ] [ / COMMENT ]
+
+    X ...     - X can be present 1 or more times
+    { X | Y } - X or Y
+    [ X ]     - X is optional
 \end{verbatim}
- 
-\begin{description}
-\item[18]    Read an arbitrary data subsection from the data array.  Any Undefined
-       pixels in the array will have the corresponding 'nularray'
-      element set equal to TRUE. \label{ffgsfx}
-\end{description}
- 
+
+At the topmost level, the template defines 1 or more template blocks. Blocks
+can be either HDU (Header Data Unit) or a GROUP. For each block the parser
+creates 1 (or more for GROUPs) FITS file HDUs.
+
+
+
+\section{Errors}
+
+In general the fits\_execute\_template() function tries to be as atomic
+as possible, so either everything is done or nothing is done. If an
+error occurs during parsing of the template, fits\_execute\_template()
+will (try to) delete the top level BLOCK (with all its children if any)
+in which the error occurred, then it will stop reading the template file
+and it will return with an error.
+
+
+\section{Examples}
+
+1. This template file will create a 200 x 300 pixel image, with 4-byte
+integer pixel values, in the primary HDU:
+
 \begin{verbatim}
-  int  fits_read_subsetnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-       ffgsf[b,i,ui,k,uk,j,uj,e,d]
-       (fitsfile *fptr, int group, int naxis, long *naxes,
-       long *fpixel, long *lpixel, long *inc, > DTYPE *array,
-       char *nularray, int *anynul, int *status)
+  SIMPLE = T
+  BITPIX = 32
+  NAXIS = 2     / number of dimensions
+  NAXIS1 = 100  / length of first axis
+  NAXIS2 = 200  / length of second axis
+  OBJECT = NGC 253 / name of observed object
 \end{verbatim}
-
- 
-\section{Specialized FITS ASCII and Binary Table Routines}
+The allowed values of BITPIX are 8, 16, 32, -32, or -64,
+representing, respectively, 8-bit integer, 16-bit integer, 32-bit
+integer, 32-bit floating point, or 64 bit floating point pixels.
 
- 
-\subsection{Column Information Routines}
+2.  To create a FITS  table, the template first needs to include
+XTENSION = TABLE or BINTABLE to define whether it is an ASCII or binary
+table, and NAXIS2 to define the number of rows in the table.  Two
+template lines are then needed to define the name (TTYPEn) and FITS data
+format (TFORMn) of the columns, as in this example:
 
- 
-\begin{description}
-\item[1 ] Get information about an existing ASCII table column.   A null pointer may
-   be given for any of the output parameters that are not needed. \label{ffgacl}
-\end{description}
- 
 \begin{verbatim}
-int fits_get_acolparms / ffgacl
-    (fitsfile *fptr, int colnum, > char *ttype, long *tbcol,
-     char *tunit, char *tform, double *scale, double *zero,
-     char *nulstr, char *tdisp, int *status)
+  xtension = bintable
+  naxis2 = 40
+  ttype# = Name
+  tform# = 10a
+  ttype# = Npoints
+  tform# = j
+  ttype# = Rate
+  tunit# = counts/s
+  tform# = e
 \end{verbatim}
- 
-\begin{description}
-\item[2 ] Get information about an existing binary table column. DATATYPE is a
-    character string which returns the datatype of the column as defined
-    by the TFORMn keyword (e.g., 'I', 'J','E', 'D', etc.).  In the case
-    of an ASCII character column, typecode will have a value of the
-    form 'An' where 'n' is an integer expressing the width of the field
-    in characters.  For example, if TFORM = '160A8' then ffgbcl will return
-    typechar='A8' and repeat=20.   All the returned parameters are scalar
-    quantities.   A null pointer may be given for any of the output
-   parameters that are not needed. \label{ffgbcl}
-\end{description}
- 
+The above example defines a null primary array followed by a 40-row
+binary table extension with 3 columns called 'Name', 'Npoints', and
+'Rate', with data formats of '10A' (ASCII character string), '1J'
+(integer) and '1E' (floating point), respectively.  Note that the other
+required FITS keywords (BITPIX, NAXIS, NAXIS1, PCOUNT, GCOUNT, TFIELDS,
+and END) do not need to be explicitly defined in the template because
+their values can be inferred from the other keywords in the template.
+This example also illustrates that the templates are generally
+case-insensitive (the keyword names and TFORMn values are converted to
+upper-case in the FITS file) and that string keyword values generally
+do not need to be enclosed in quotes.
+
+\chapter{  Local FITS Conventions }
+
+CFITSIO supports several local FITS conventions which are not
+defined in the official NOST FITS standard and which are not
+necessarily recognized or supported by other FITS software packages.
+Programmers should be cautious about using these features, especially
+if the FITS files that are produced are expected to be processed by
+other software systems which do not use the CFITSIO interface.
+
+
+\section{64-Bit Long Integers}
+
+CFITSIO can read and write FITS images or table columns containing
+64-bit integer data values.  This data type is not recognized in the
+official FITS Standard definition document, but it is likely that FITS
+will eventually support this data type, especially as computers that
+run 64-bit operating systems become more common.  Support for reading
+and writing 64-bit integers in CFITSIO can be controlled with the
+\#define statement at the beginning of the fitsio2.h file by setting
+SUPPORT\_64BIT\_INTEGERS to 1 (enable) or 0 (disable).
+
+Under the convention used by CFITSIO, FITS 64-bit images have BITPIX =
+64, and the 64-bit binary table columns have TFORMn = 'K'.  The use of
+these data types on platforms where the size of a 'long' (or 'longlong')
+integer = 8 bytes is rather intuitive.  CFITSIO will write 64-bit
+'long' variable values to the FITS file and read them back into 'long'
+variables just as one would expect.  CFITSIO also supports implicit
+data type conversion between 64-bit integer images and columns and any
+other supported data type, although some loss of numerical precision or
+numerical overflow is likely in this case.
+
+The situation is more difficult on 32-bit computing platforms that do
+not support an intrinsic 64-bit integer data type.  In this case it is
+not possible to return the full 64 precision of the FITS data values when
+reading the values into a program variable.  CFITSIO will still
+convert the 64-bit integer values into any other supported data type;
+the 64-bit double data type is probably the most useful in this case.
+It only provides about 52-bits of precision in the mantissa, however,
+so some lose of precision is possible.
+
+
+\section{Long String Keyword Values.}
+
+The length of a standard FITS string keyword is limited to 68
+characters because it must fit entirely within a single FITS header
+keyword record.  In some instances it is necessary to encode strings
+longer than this limit, so CFITSIO supports a local convention in which
+the string value is continued over multiple keywords.  This
+continuation convention uses an ampersand character at the end of each
+substring to indicate that it is continued on the next keyword, and the
+continuation keywords all have the name CONTINUE without an equal sign
+in column 9. The string value may be continued in this way over as many
+additional CONTINUE keywords as is required.  The following lines
+illustrate this continuation convention which is used in the value of
+the STRKEY keyword:
+
 \begin{verbatim}
-  int fits_get_bcolparms / ffgbcl
-      (fitsfile *fptr, int colnum, > char *ttype, char *tunit,
-       char *typechar, long *repeat, double *scale, double *zero,
-       long *nulval, char *tdisp, int  *status)
+LONGSTRN= 'OGIP 1.0'    / The OGIP Long String Convention may be used.
+STRKEY  = 'This is a very long string keyword&'  / Optional Comment
+CONTINUE  ' value that is continued over 3 keywords in the &  '
+CONTINUE  'FITS header.' / This is another optional comment.
 \end{verbatim}
- 
-\begin{description}
-\item[3 ] Return optimal number of rows to read or write at one time for
-    maximum I/O efficiency.  Refer to the
-    ``Optimizing Code'' section in Chapter 5 for more discussion on how
-   to use this routine. \label{ffgrsz}
-\end{description}
- 
+It is recommended that the LONGSTRN keyword, as shown here, always be
+included in any HDU that uses this longstring convention as a warning
+to any software that must read the keywords.  A routine called fits\_write\_key\_longwarn
+has been provided in CFITSIO to write this keyword if it does not
+already exist.
+
+This long string convention is supported by the following CFITSIO
+routines:
+
 \begin{verbatim}
-  int fits_get_rowsize / ffgrsz
-      (fitsfile *fptr, long *nrows, *status)
+    fits_write_key_longstr  - write a long string keyword value
+    fits_insert_key_longstr - insert a long string keyword value
+    fits_modify_key_longstr - modify a long string keyword value
+    fits_update_key_longstr - modify a long string keyword value
+    fits_read_key_longstr   - read  a long string keyword value
+    fits_delete_key         - delete a keyword
 \end{verbatim}
- 
-\begin{description}
-\item[4 ] Define the zero indexed byte offset of the 'heap' measured from
-    the start of the binary table data.  By default the heap is assumed
-    to start immediately following the regular table data, i.e., at
-    location NAXIS1 x NAXIS2.  This routine is only relevant for
-    binary tables which contain variable length array columns (with
-    TFORMn = 'Pt').  This routine also automatically writes
-    the value of theap to a keyword in the extension header.  This
-    routine must be called after the required keywords have been
-    written (with ffphbn) and after the table structure has been defined
-   (with ffbdef) but before any data is written to the table. \label{ffpthp}
-\end{description}
- 
+The fits\_read\_key\_longstr routine is unique among all the CFITSIO
+routines in that it internally allocates memory for the long string
+value;  all the other CFITSIO routines that deal with arrays require
+that the calling program pre-allocate adequate space to hold the array
+of data.  Consequently, programs which use the fits\_read\_key\_longstr
+routine must be careful to free the allocated memory for the string
+when it is no longer needed.
+
+The following 2 routines also have limited support for this long string
+convention,
+
 \begin{verbatim}
-  int fits_write_theap / ffpthp
-      (fitsfile *fptr, long theap, > int *status)
+      fits_modify_key_str - modify an existing string keyword value
+      fits_update_key_str - update a string keyword value
 \end{verbatim}
+in that they will correctly overwrite an existing long string value,
+but the new string value is limited to a maximum of 68 characters in
+length.
+
+The more commonly used CFITSIO routines to write string valued keywords
+(fits\_update\_key and fits\_write\_key) do not support this long
+string convention and only support strings up to 68 characters in
+length.  This has been done deliberately to prevent programs from
+inadvertently writing keywords using this non-standard convention
+without the explicit intent of the programmer or user.   The
+fits\_write\_key\_longstr routine must be called instead to write long
+strings.  This routine can also be used to write ordinary string values
+less than 68 characters in length.
 
- 
-\subsection{Low-Level Table Access Routines \label{FFGTBB}}
 
-The following 2 routines provide low-level access to the data in ASCII
-or binary tables and are mainly useful as an efficient way to copy all
-or part of a table from one location to another.  These routines simply
-read or write the specified number of consecutive bytes in an ASCII or
-binary table, without regard for column boundaries or the row length in
-the table.  These routines do not perform any machine dependent data
-conversion or byte swapping.  See Appendix B for the definition of the
-parameters used in these routines.
+\section{Arrays of Fixed-Length Strings in Binary Tables}
+
+The definition of the FITS binary table extension format does not
+provide a simple way to specify that a character column contains an
+array of fixed-length strings.  To support this feature, CFITSIO uses a
+local convention for the format of the TFORMn keyword value of the form
+'rAw' where 'r' is an integer specifying the total width in characters
+of the column, and 'w' is an integer specifying the (fixed) length of
+an individual unit string within the vector.  For example, TFORM1 =
+'120A10' would indicate that the binary table column is 120 characters
+wide and consists of 12 10-character length strings.  This convention
+is recognized by the CFITSIO routines that read or write strings in
+binary tables.   The Binary Table definition document specifies that
+other optional characters may follow the data type code in the TFORM
+keyword, so this local convention is in compliance with the
+FITS standard although other FITS readers may not
+recognize this convention.
+
+The Binary Table definition document that was approved by the IAU in
+1994 contains an appendix describing an alternate convention for
+specifying arrays of fixed or variable length strings in a binary table
+character column (with the form 'rA:SSTRw/nnn)'.  This appendix was not
+officially voted on by the IAU and hence is still provisional.  CFITSIO
+does not currently support this proposal.
+
+
+\section{Keyword Units Strings}
+
+One limitation of the current FITS Standard is that it does not define
+a specific convention for recording the physical units of a keyword
+value.  The TUNITn keyword can be used to specify the physical units of
+the values in a table column, but there is no analogous convention for
+keyword values.  The comment field of the keyword is often used for
+this purpose, but the units are usually not specified in a well defined
+format that FITS readers can easily recognize and extract.
+
+To solve this problem, CFITSIO uses a local convention in which the
+keyword units are enclosed in square brackets as the first token in the
+keyword comment field; more specifically, the opening square bracket
+immediately follows the slash '/' comment field delimiter and a single
+space character.  The following examples illustrate keywords that use
+this convention:
+
 
- 
-\begin{description}
-\item[1 ] Read a consecutive array of bytes from an ASCII or binary table \label{ffgtbb}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_tblbytes / ffgtbb
-      (fitsfile *fptr, long firstrow, long firstchar, long nchars,
-       > unsigned char *values, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Write a consecutive array of bytes to an ASCII or binary table \label{ffptbb}
-\end{description}
- 
 \begin{verbatim}
-  int fits_write_tblbytes / ffptbb
-      (fitsfile *fptr, long firstrow, long firstchar, long nchars,
-       unsigned char *values, > int *status)
+EXPOSURE=               1800.0 / [s] elapsed exposure time
+V_HELIO =                16.23 / [km s**(-1)] heliocentric velocity
+LAMBDA  =                5400. / [angstrom] central wavelength
+FLUX    = 4.9033487787637465E-30 / [J/cm**2/s] average flux
 \end{verbatim}
 
- 
-\subsection{Specialized Write Column Data Routines}
+In general, the units named in the IAU(1988) Style Guide are
+recommended, with the main exception that the preferred unit for angle
+is 'deg' for degrees.
 
- 
-\begin{description}
-\item[1 ] Write elements into an ASCII or binary table column (in the CDU).
-    The datatype of the array is implied by the suffix of the
-   routine name. \label{ffpcls}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_col_str / ffpcls
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, char **array, > int *status)
+The fits\_read\_key\_unit and fits\_write\_key\_unit routines in
+CFITSIO read and write, respectively, the keyword unit strings in an
+existing keyword.
+
+
+\section{HIERARCH Convention for Extended Keyword Names}
+
+CFITSIO supports the HIERARCH keyword convention which allows keyword
+names that are longer then 8 characters and may contain the full range
+of printable ASCII text characters.  This convention
+was developed at the European Southern Observatory (ESO)  to support
+hierarchical FITS keyword such as:
 
-  int fits_write_col_[log,byt,sht,usht,int,uint,lng,ulng,flt,dbl,cmp,dblcmp] /
-      ffpcl[l,b,i,ui,k,uk,j,uj,e,d,c,m]
-      (fitsfile *fptr, int colnum, long firstrow,
-           long firstelem, long nelements, DTYPE *array, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Write elements into an ASCII or binary table column
-    substituting the appropriate FITS null value for any elements that
-    are equal to the nulval parameter.  This routines must not be used to
-   write to  variable length array columns.  \label{ffpcnx}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_colnull_[log, byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffpcn[l,b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, DTYPE *array, DTYPE nulval, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[3 ] Write string elements into a binary table column (in the CDU)
-    substituting the FITS null value for any elements that
-    are equal to the nulstr string.  This routine must NOT be
-   used to write to  variable length array columns. \label{ffpcns}
-\end{description}
- 
-\begin{verbatim}
-  int fits_write_colnull_str / ffpcns
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, char **array, char *nulstr, > int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[4 ] Write bit values into a binary byte ('B') or bit ('X') table column (in
-    the CDU).  Larray is an array of logical values corresponding to the
-    sequence of bits to be written.  If larray is true then the
-    corresponding bit is set to 1, otherwise the bit is set to 0.  Note
-    that in the case of 'X' columns, CFITSIO can write to all 8 bits of
-    each byte whether they are formally valid or not.  Thus if the
-    column is defined as '4X', and one calls ffpclx with  firstbit=1
-    and nbits=8, then all 8 bits will be written into the first byte
-    (as opposed to writing the first 4 bits into the first row and then
-    the next 4 bits into the next row), even though the last 4 bits of
-    each byte are formally not defined.  It should also be noted that
-    it is more efficient to write 'X' columns an entire byte at a time,
-    instead of bit by bit.  Any of the CFITSIO routines that write to
-    columns (e.g. fits\_write\_col\_byt) may be used for this
-    purpose.  These routines will interpret 'X' columns as though they
-    were 'B' columns (e.g.,  '8X' is equivalent to '1B', and '16X' is
-   equivalent to '2B'). \label{ffpclx}
-\end{description}
- 
 \begin{verbatim}
-  int fits_write_col_bit / ffpclx
-      (fitsfile *fptr, int colnum, long firstrow, long firstbit,
-       long nbits, char *larray, > int *status)
+HIERARCH ESO INS FOCU POS = -0.00002500 / Focus position
 \end{verbatim}
- 
-\begin{description}
-\item[5 ] Write the descriptor for a variable length column in a binary table.
-    This routine can be used in conjunction with FFGDES to enable
-    2 or more arrays to point to the same storage location to save
-   storage space if the arrays are identical. \label{ffpdes}
-\end{description}
- 
+Basically, this convention uses the FITS keyword 'HIERARCH' to indicate
+that this convention is being used, then the actual keyword name
+({\tt'ESO INS FOCU POS'} in this example) begins in column 10 and can
+contain any printable ASCII text characters, including spaces.  The
+equals sign marks the end of the keyword name and is followed by the
+usual value and comment fields just as in standard FITS keywords.
+Further details of this convention are described at
+http://arcdev.hq.eso.org/dicb/dicd/dic-1-1.4.html (search for
+HIERARCH).
+
+This convention allows a much broader range of keyword names
+than is allowed by the FITS Standard.  Here are more examples
+of such keywords:
+
 \begin{verbatim}
-    int fits_write_descript / ffpdes
-        (fitsfile *fptr, int colnum, long rownum, long repeat,
-         long offset, > int *status)
+HIERARCH LongKeyword = 47.5 / Keyword has > 8 characters, and mixed case
+HIERARCH XTE$TEMP = 98.6 / Keyword contains the '$' character
+HIERARCH Earth is a star = F / Keyword contains embedded spaces
 \end{verbatim}
- 
-\subsection{Specialized Read Column Data Routines}
+CFITSIO will transparently read and write these keywords, so application
+programs do not in general need to know anything about the specific
+implementation details of the HIERARCH convention.  In particular,
+application programs do not need to specify the `HIERARCH' part of the
+keyword name when reading or writing keywords (although it
+may be included if desired).  When writing a keyword, CFITSIO first
+checks to see if the keyword name is legal as a standard FITS keyword
+(no more than 8 characters long and containing only letters, digits, or
+a minus sign or underscore). If so it writes it as a standard FITS
+keyword, otherwise it uses the hierarch convention to write the
+keyword.   The maximum keyword name length is 67 characters, which
+leaves only 1 space for the value field.  A more practical limit is
+about 40 characters, which leaves enough room for most keyword values.
+CFITSIO returns an error if there is not enough room for both the
+keyword name and the keyword value on the 80-character card, except for
+string-valued keywords which are simply truncated so that the closing
+quote character falls in column 80.  In the current implementation,
+CFITSIO preserves the case of the letters when writing the keyword
+name, but it is case-insensitive when reading or searching for a
+keyword.  The current implementation allows any ASCII text character
+(ASCII 32 to ASCII 126) in the keyword name except for the '='
+character.  A space is also required on either side of the equal sign.
+
+
+\section{Tile-Compressed Image Format}
+
+CFITSIO supports a convention for compressing n-dimensional images and
+storing the resulting byte stream in a variable-length column in a FITS
+binary table.  The general principle used in this convention is to
+first divide the n-dimensional image into a rectangular grid of
+subimages or `tiles'.  Each tile is then compressed as a continuous
+block of data, and the resulting compressed byte stream is stored in a
+row of a variable length column in a FITS binary table. By dividing the
+image into tiles it is generally possible to extract and uncompress
+subsections of the image without having to uncompress the whole image.
+The default tiling pattern treats each row of a 2-dimensional image (or
+higher dimensional cube) as a tile, such that each tile contains NAXIS1
+pixels. Any other rectangular tiling pattern may also be defined. In
+the case of relatively small images it may be sufficient to compress
+the entire image as a single tile, resulting in an output binary table
+with 1 row.  In the case of 3-dimensional data cubes, it may be
+advantageous to treat each plane of the cube as a separate tile if
+application software typically needs to access the cube on a plane by
+plane basis.
+
+See section 5.6 ``Image Compression''
+for more information on using this tile-compressed image format.
+
+\chapter{  Optimizing Programs }
+
+CFITSIO has been carefully designed to obtain the highest possible
+speed when reading and writing FITS files.  In order to achieve the
+best performance, however, application programmers must be careful to
+call the CFITSIO routines appropriately and in an efficient sequence;
+inappropriate usage of CFITSIO routines can greatly slow down the
+execution speed of a program.
+
+The maximum possible I/O speed of CFITSIO depends of course on the type
+of computer system that it is running on.  As a rough guide, the
+current generation of workstations can achieve speeds of 2 -- 10 MB/s
+when reading or writing FITS images and similar, or slightly slower
+speeds with FITS binary tables.  Reading of FITS files can occur at
+even higher rates (30MB/s or more) if the FITS file is still cached in
+system memory following a previous read or write operation on the same
+file.  To more accurately predict the best performance that is possible
+on any particular system, a diagnostic program called ``speed.c'' is
+included with the CFITSIO distribution which can be run to
+approximately measure the maximum possible speed of writing and reading
+a test FITS file.
+
+The following 2 sections provide some background on how CFITSIO
+internally manages the data I/O and describes some strategies that may
+be used to optimize the processing speed of software that uses
+CFITSIO.
+
+
+\section{How CFITSIO Manages Data I/O}
+
+Many CFITSIO operations involve transferring only a small number of
+bytes to or from the FITS file (e.g, reading a keyword, or writing a
+row in a table); it would be very inefficient to physically read or
+write such small blocks of data directly in the FITS file on disk,
+therefore CFITSIO maintains a set of internal Input--Output (IO)
+buffers in RAM memory that each contain one FITS block (2880 bytes) of
+data.  Whenever CFITSIO needs to access data in the FITS file, it first
+transfers the FITS block containing those bytes into one of the IO
+buffers in memory.  The next time CFITSIO needs to access bytes in the
+same block it can then go to the fast IO buffer rather than using a
+much slower system disk access routine.  The number of available IO
+buffers is determined by the NIOBUF parameter (in fitsio2.h) and is
+currently set to 40 by default.
+
+Whenever CFITSIO reads or writes data it first checks to see if that
+block of the FITS file is already loaded into one of the IO buffers.
+If not, and if there is an empty IO buffer available, then it will load
+that block into the IO buffer (when reading a FITS file) or will
+initialize a new block (when writing to a FITS file).  If all the IO
+buffers are already full, it must decide which one to reuse (generally
+the one that has been accessed least recently), and flush the contents
+back to disk if it has been modified before loading the new block.
+
+The one major exception to the above process occurs whenever a large
+contiguous set of bytes are accessed, as might occur when reading or
+writing a FITS image.  In this case CFITSIO bypasses the internal IO
+buffers and simply reads or writes the desired bytes directly in the
+disk file with a single call to a low-level file read or write
+routine.  The minimum threshold for the number of bytes to read or
+write this way is set by the MINDIRECT parameter and is currently set
+to 3 FITS blocks = 8640 bytes.  This is the most efficient way to read
+or write large chunks of data and can achieve IO transfer rates of
+5 -- 10MB/s or greater.  Note that this fast direct IO process is not
+applicable when accessing columns of data in a FITS table because the
+bytes are generally not contiguous since they are interleaved by the
+other columns of data in the table.  This explains why the speed for
+accessing FITS tables is generally slower than accessing
+FITS images.
+
+Given this background information, the general strategy for efficiently
+accessing FITS files should be apparent:  when dealing with FITS
+images, read or write large chunks of data at a time so that the direct
+IO mechanism will be invoked;  when accessing FITS headers or FITS
+tables, on the other hand, once a particular FITS block has been
+loading into one of the IO buffers, try to access all the needed
+information in that block before it gets flushed out of the IO buffer.
+It is important to avoid the situation where the same FITS block is
+being read then flushed from a IO buffer multiple times.
+
+The following section gives more specific suggestions for optimizing
+the use of CFITSIO.
+
+
+\section{Optimization Strategies}
+
+1.  When dealing with a FITS primary array or IMAGE extension, it is
+more efficient to read or write large chunks of the  image at a time
+(at least 3 FITS blocks = 8640 bytes) so that the direct IO mechanism
+will be used as described in the previous section.  Smaller chunks of
+data are read or written via the IO buffers, which is somewhat less
+efficient because of the extra copy operation and additional
+bookkeeping steps that are required.  In principle it is more efficient
+to read or write as big an array of image pixels at one time as
+possible, however, if the array becomes so large that the operating
+system cannot store it all in RAM, then the performance may be degraded
+because of the increased swapping of virtual memory to disk.
+
+2.  When dealing with FITS tables, the most important efficiency factor
+in the software design is to read or write the data in the FITS file in
+a single pass through the file.  An example of poor program design
+would be to read a large, 3-column table by sequentially reading the
+entire first column, then going back to read the 2nd column, and
+finally the 3rd column; this obviously requires 3 passes through the
+file which could triple the execution time of an IO limited program.
+For small tables this is not important, but when reading multi-megabyte
+sized tables these inefficiencies can become significant.  The more
+efficient procedure in this case is to read or write only as many rows
+of the table as will fit into the available internal IO buffers, then
+access all the necessary columns of data within that range of rows.
+Then after the program is completely finished with the data in those
+rows it can move on to the next range of rows that will fit in the
+buffers, continuing in this way until the entire file has been
+processed.  By using this procedure of accessing all the columns of a
+table in parallel rather than sequentially, each block of the FITS file
+will only be read or written once.
+
+The optimal number of rows to read or write at one time in a given
+table depends on the width of the table row, on the number of IO
+buffers that have been allocated in CFITSIO, and also on the number of
+other FITS files that are open at the same time (since one IO buffer is
+always reserved for each open FITS file).  The CFITSIO Iterator routine
+will automatically use the optimal-sized buffer, but there is also a
+CFITSIO routine that will return the optimal number of rows for a given
+table:  fits\_get\_rowsize.  It is not critical to use exactly the
+value of nrows returned by this routine, as long as one does not exceed
+it.  Using a very small value however can also lead to poor performance
+because of the overhead from the larger number of subroutine calls.
+
+The optimal number of rows returned by fits\_get\_rowsize is valid only
+as long as the application program is only reading or writing data in
+the specified table.  Any other calls to access data in the table
+header or in any other FITS file would  cause additional blocks of data
+to be loaded into the IO buffers displacing data from the original
+table, and should be avoided during the critical period while the table
+is being read or written.
+
+Occasionally it is necessary to simultaneously access more than one
+FITS table, for example when transferring values from an input table to
+an output table.  In cases like this, one should call
+fits\_get\_rowsize to get the optimal number of rows for each table
+separately, than reduce the number of rows proportionally.  For
+example, if the optimal number of rows in the input table is 3600 and
+is 1400 in the output table, then these values should be cut in half to
+1800 and 700, respectively, if both tables are going to be accessed at
+the same time.
 
-Two types of routines are provided to get the column data which differ
-in the way undefined pixels are handled.  The first set of routines
-(ffgcv) simply return an array of data elements in which undefined
-pixels are set equal to a value specified by the user in the 'nullval'
-parameter.  If nullval = 0, then no checks for undefined pixels will be
-performed, thus increasing the speed of the program.  The second set of
-routines (ffgcf) returns the data element array and in addition a
-logical array of flags which defines whether the corresponding data
-pixel is undefined.  See Appendix B for the definition of the
-parameters used in these routines.
+3.  Use the CFITSIO Iterator routine.  This routine provides a
+more `object oriented' way of reading and writing FITS files
+which automatically uses the most appropriate data buffer size
+to achieve the maximum I/O throughput.
 
-    Any column, regardless of it's intrinsic datatype, may be read as a
-    string.  It should be noted however that reading a numeric column as
-    a string is 10 - 100 times slower than reading the same column as a number
-    due to the large overhead in constructing the formatted strings.
-    The display format of the returned strings will be
-    determined by the TDISPn keyword, if it exists, otherwise by the
-    datatype of the column.  The length of the returned strings (not
-    including the null terminating character) can be determined with
-    the fits\_get\_col\_display\_width routine.  The following TDISPn
-    display formats are currently supported:
- 
-\begin{verbatim}
-    Iw.m   Integer
-    Ow.m   Octal integer
-    Zw.m   Hexadecimal integer
-    Fw.d   Fixed floating point
-    Ew.d   Exponential floating point
-    Dw.d   Exponential floating point
-    Gw.d   General; uses Fw.d if significance not lost, else Ew.d
-\end{verbatim}
-    where w is the width in characters of the displayed values, m is
-    the minimum number of digits displayed, and d is the number of
-    digits to the right of the decimal.  The .m field is optional.
+4.  Use binary table extensions rather than ASCII table
+extensions for better efficiency  when dealing with tabular data.  The
+I/O to ASCII tables is slower because of the overhead in formatting or
+parsing the ASCII data fields and because ASCII tables are about twice
+as large as binary tables with the same information content.
 
- 
-\begin{description}
-\item[1 ] Read elements from an ASCII or binary table column (in the CDU).  These
-    routines return the values of the table column array elements.  Undefined
-    array elements will be returned with a value = nulval, unless nulval = 0
-    (or = ' ' for ffgcvs) in which case no checking for undefined values will
-    be performed. The ANYF parameter is set to true if any of the returned
-   elements are undefined. \label{ffgcvx}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_col_str / ffgcvs
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, char *nulstr, > char **array, int *anynul,
-       int *status)
+5. Design software so that it reads the FITS header keywords in the
+same order in which they occur in the file.  When reading keywords,
+CFITSIO searches forward starting from the position of the last keyword
+that was read.  If it reaches the end of the header without finding the
+keyword, it then goes back to the start of the header and continues the
+search down to the position where it started.  In practice, as long as
+the entire FITS header can fit at one time in the available internal IO
+buffers, then the header keyword access will be very fast and it makes
+little difference which order they are accessed.
 
-  int fits_read_col_[log,byt,sht,usht,int,uint,lng,ulng, flt, dbl, cmp, dblcmp] /
-      ffgcv[l,b,i,ui,k,uk,j,uj,e,d,c,m]
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, DTYPE nulval, > DTYPE *array, int *anynul,
-       int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[2 ] Read elements and null flags from an ASCII or binary table column (in the
-    CHDU).  These routines return the values of the table column array elements.
-    Any undefined array elements will have the corresponding nularray element
-    set equal to TRUE.  The anynul parameter is set to true if any of the
-   returned elements are undefined. \label{ffgcfx}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_colnull_str / ffgcfs
-      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
-       long nelements, > char **array, char *nularray, int *anynul,
-       int *status)
+6. Avoid the use of scaling (by using the BSCALE and BZERO or TSCAL and
+TZERO keywords) in FITS files since the scaling operations add to the
+processing time needed to read or write the data.  In some cases it may
+be more efficient to temporarily turn off the scaling (using fits\_set\_bscale or
+fits\_set\_tscale) and then read or write the raw unscaled values in the FITS
+file.
 
-  int fits_read_colnull_[log,byt,sht,usht,int,uint,lng,ulng,flt,dbl,cmp,dblcmp] /
-      ffgcf[l,b,i,ui,k,uk,j,uj,e,d,c,m]
-      (fitsfile *fptr, int colnum, long firstrow,
-       long firstelem, long nelements, > DTYPE *array,
-       char *nularray, int *anynul, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[3 ] Read an arbitrary data subsection from an N-dimensional array
-    in a binary table vector column.  Undefined pixels
-    in the array will be set equal to the value of 'nulval',
-    unless nulval=0 in which case no testing for undefined pixels will
-    be performed.  The first and last rows in the table to be read
-    are specified by fpixel(naxis+1) and lpixel(naxis+1), and hence
-    are treated as the next higher dimension of the FITS N-dimensional
-    array.  The INC parameter specifies the sampling interval in
-   each dimension between the data elements that will be returned. \label{ffgsvx2}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_subset_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffgsv[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, int colnum, int naxis, long *naxes, long *fpixel,
-       long *lpixel, long *inc, DTYPE nulval, > DTYPE *array, int *anynul,
-       int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[4 ] Read an arbitrary data subsection from an N-dimensional array
-    in a binary table vector column.  Any Undefined
-    pixels in the array will have the corresponding 'nularray'
-    element set equal to TRUE.  The first and last rows in the table
-    to be read are specified by fpixel(naxis+1) and lpixel(naxis+1),
-    and hence are treated as the next higher dimension of the FITS
-    N-dimensional array.  The INC parameter specifies the sampling
-    interval in each dimension between the data elements that will be
-   returned. \label{ffgsfx2}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_subsetnull_[byt, sht, usht, int, uint, lng, ulng, flt, dbl] /
-      ffgsf[b,i,ui,k,uk,j,uj,e,d]
-      (fitsfile *fptr, int colnum, int naxis, long *naxes,
-       long *fpixel, long *lpixel, long *inc, > DTYPE *array,
-       char *nularray, int *anynul, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[5 ] Read bit values from a byte ('B') or bit (`X`) table column (in the
-    CDU).  Larray is an array of logical values corresponding to the
-    sequence of bits to be read.  If larray is true then the
-    corresponding bit was set to 1, otherwise the bit was set to 0.
-    Note that in the case of 'X' columns, CFITSIO can read  all 8 bits
-    of each byte whether they are formally valid or not.  Thus if the
-    column is defined as '4X', and one calls ffgcx with  firstbit=1 and
-    nbits=8, then all 8 bits will be read from the first byte (as
-    opposed to reading the first 4 bits from the first row and then the
-    first 4 bits from the next row), even though the last 4 bits of
-    each byte are formally not defined.  It should also be noted that
-    it is more efficient to read 'X' columns an entire byte at a time,
-    instead of bit by bit.  Any of the CFITSIO routines that read
-    columns (e.g. fits\_read\_col\_byt) may be used for this
-    purpose.  These routines will interpret 'X' columns as though they
-    were 'B' columns (e.g.,  '8X' is equivalent to '1B', and '16X' is
-   equivalent to '2B').  \label{ffgcx}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_col_bit / ffgcx
-      (fitsfile *fptr, int colnum, long firstrow, long firstbit,
-       long nbits, > char *larray, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[6 ] Read any consecutive set of bits from an 'X' or 'B' column and
-    interpret them as an unsigned n-bit integer.  nbits must be less
-    than 16 or 32 in ffgcxui and ffgcxuk, respectively.  If nrows
-    is greater than 1, then the same set of bits will be read from
-    each row, starting with firstrow. The bits are numbered with
-    1 = the most significant bit of the first element of the column.
-   \label{ffgcxui}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_col_bit_[usht, uint] / ffgcx[ui,uk]
-      (fitsfile *fptr, int colnum, long firstrow, long, nrows,
-       long firstbit, long nbits, > DTYPE *array, int *status)
-\end{verbatim}
- 
-\begin{description}
-\item[7 ] Return the descriptor for a variable length column in a binary table.
-    The descriptor consists of 2 integer parameters: the number of elements
-    in the array and the starting offset relative to the start of the heap.
-    The first routine returns a single descriptor whereas the second routine
-    returns the descriptors for a range of rows in the table.
-   \label{ffgdes}
-\end{description}
- 
-\begin{verbatim}
-  int fits_read_descript / ffgdes
-      (fitsfile *fptr, int colnum, long rownum, > long *repeat,
-           long *offset, int *status)
+7. Avoid using the `implicit data type conversion' capability in
+CFITSIO.  For instance, when reading a FITS image with BITPIX = -32
+(32-bit floating point pixels), read the data into a single precision
+floating point data array in the program.  Forcing CFITSIO to convert
+the data to a different data type can slow the program.
+
+8. Where feasible, design FITS binary tables using vector column
+elements so that the data are written as a contiguous set of bytes,
+rather than as single elements in multiple rows.  For example, it is
+faster to access the data in a table that contains a single row
+and 2 columns with TFORM keywords equal to  '10000E' and '10000J', than
+it is to access the same amount of data in a table with 10000 rows
+which has columns with the TFORM keywords equal to '1E' and '1J'.  In
+the former case the 10000 floating point values in the first column are
+all written in a contiguous block of the file which can be read or
+written quickly, whereas in the second case each floating point value
+in the first column is interleaved with the integer value in the second
+column of the same row so CFITSIO has to explicitly move to the
+position of each element to be read or written.
+
+9. Avoid the use of variable length vector columns in binary tables,
+since any reading or writing of these data requires that CFITSIO first
+look up or compute the starting address of each row of data in the
+heap.
+
+10. When copying data from one FITS table to another, it is faster to
+transfer the raw bytes instead of reading then writing each column of
+the table.  The CFITSIO routines fits\_read\_tblbytes and
+fits\_write\_tblbytes will perform low-level reads or writes of any
+contiguous range of bytes in a table extension.  These routines can be
+used to read or write a whole row (or multiple rows  for even greater
+efficiency) of a table with a single function call.   These routines
+are fast because they bypass all the usual data scaling, error checking
+and machine dependent data conversion that is normally done by CFITSIO,
+and they allow the program to write the data to the output file in
+exactly the same byte order.  For these same reasons, these routines
+can corrupt the FITS data file if used incorrectly because no
+validation or machine dependent conversion is performed by these
+routines.  These routines are only recommended for optimizing critical
+pieces of code and should only be used by programmers who thoroughly
+understand the internal format of the FITS tables they are reading or
+writing.
+
+11. Another strategy for improving the speed of writing a FITS table,
+similar to the previous one, is to directly construct the entire byte
+stream for a whole table row (or multiple rows) within the application
+program and then write it to the FITS file with
+fits\_write\_tblbytes.  This avoids all the overhead normally present
+in the column-oriented CFITSIO write routines.  This technique should
+only be used for critical applications because it makes the code more
+difficult to understand and maintain, and it makes the code more system
+dependent (e.g., do the bytes need to be swapped before writing to the
+FITS file?).
+
+12.  Finally, external factors such as the type of magnetic disk
+controller (SCSI or IDE), the size of the disk cache, the average seek
+speed of the disk, the amount of disk fragmentation, and the amount of
+RAM available on the system can all have a significant impact on
+overall I/O efficiency.  For critical applications, a system
+administrator should review the proposed system hardware to identify any
+potential I/O bottlenecks.
 
-  int fits_read_descripts / ffgdess
-      (fitsfile *fptr, int colnum, long firstrow, long nrows > long *repeat,
-           long *offset, int *status)
-\end{verbatim}
 
 \appendix
 \chapter{Index of Routines }
@@ -7866,12 +8458,15 @@ fits\_calculator     & \pageref{ffcalc} \\
 fits\_calculator\_rng     & \pageref{ffcalcrng} \\
 fits\_calc\_rows    & \pageref{ffcrow} \\
 fits\_change\_group  & \pageref{ffgtch} \\
+fits\_clear\_errmark  & \pageref{ffpmrk} \\
 fits\_clear\_errmsg   & \pageref{ffcmsg} \\
 fits\_close\_file     & \pageref{ffclos} \\
 fits\_compact\_group & \pageref{ffgtcm} \\
 fits\_compare\_str    & \pageref{ffcmps} \\
+fits\_compress\_heap & \pageref{ffcmph} \\
 fits\_copy\_col     & \pageref{ffcpcl} \\
 fits\_copy\_data      & \pageref{ffcpdt} \\
+fits\_copy\_file      & \pageref{ffcpfl} \\
 fits\_copy\_group    & \pageref{ffgtcp} \\
 fits\_copy\_hdu       & \pageref{ffcopy} \\
 fits\_copy\_header    & \pageref{ffcphd} \\
@@ -7888,20 +8483,23 @@ fits\_date2str  & \pageref{ffdt2s} \\
 fits\_decode\_chksum  & \pageref{ffdsum} \\
 fits\_decode\_tdim    & \pageref{ffdtdm} \\
 fits\_delete\_col   & \pageref{ffdcol} \\
+\end{tabular}
+\begin{tabular}{lr}
 fits\_delete\_file    & \pageref{ffdelt} \\
 fits\_delete\_hdu     & \pageref{ffdhdu} \\
 fits\_delete\_key     & \pageref{ffdkey} \\
-\end{tabular}
-\begin{tabular}{lr}
 fits\_delete\_record  & \pageref{ffdrec} \\
 fits\_delete\_rowlist & \pageref{ffdrws} \\
+fits\_delete\_rowrange & \pageref{ffdrrg} \\
 fits\_delete\_rows  & \pageref{ffdrow} \\
 fits\_encode\_chksum  & \pageref{ffesum} \\
+fits\_file\_exists    & \pageref{ffexist} \\
 fits\_file\_mode      & \pageref{ffflmd} \\
 fits\_file\_name      & \pageref{ffflnm} \\
 fits\_find\_first\_row    & \pageref{ffffrw} \\
 fits\_find\_nextkey      & \pageref{ffgnxk} \\
 fits\_find\_rows    & \pageref{fffrow} \\
+fits\_flush\_buffer     & \pageref{ffflus} \\
 fits\_flush\_file     & \pageref{ffflus} \\
 fits\_get\_acolparms  & \pageref{ffgacl} \\
 fits\_get\_bcolparms  & \pageref{ffgbcl} \\
@@ -7910,6 +8508,8 @@ fits\_get\_col\_display\_width    & \pageref{ffgcdw} \\
 fits\_get\_colname    & \pageref{ffgcnn} \\
 fits\_get\_colnum     & \pageref{ffgcno} \\
 fits\_get\_coltype    & \pageref{ffgtcl} \\
+fits\_get\_compression\_type & \pageref{ffgetcomp} \\
+fits\_get\_eqcoltype    & \pageref{ffgtcl} \\
 fits\_get\_errstatus  & \pageref{ffgerr} \\
 fits\_get\_hdrpos        & \pageref{ffghps} \\
 fits\_get\_hdrspace      & \pageref{ffghsp} \\
@@ -7917,24 +8517,28 @@ fits\_get\_hdu\_num    & \pageref{ffghdn} \\
 fits\_get\_hdu\_type   & \pageref{ffghdt} \\
 fits\_get\_hduaddr    & \pageref{ffghad} \\
 fits\_get\_hduoff    & \pageref{ffghad} \\
+\end{tabular}
+\begin{tabular}{lr}
 fits\_get\_img\_dim & \pageref{ffgidm} \\
+fits\_get\_img\_equivtype & \pageref{ffgidt} \\
 fits\_get\_img\_param & \pageref{ffgipr} \\
 fits\_get\_img\_size & \pageref{ffgisz} \\
 fits\_get\_img\_type & \pageref{ffgidt} \\
 fits\_get\_keyclass    & \pageref{ffgkcl} \\
 fits\_get\_keyname    & \pageref{ffgknm} \\
 fits\_get\_keytype    & \pageref{ffdtyp} \\
+fits\_get\_noise\_bits   & \pageref{ffgetcomp} \\
 fits\_get\_num\_cols     & \pageref{ffgnrw} \\
-\end{tabular}
-\begin{tabular}{lr}
 fits\_get\_num\_groups  & \pageref{ffgmng} \\
 fits\_get\_num\_hdus   & \pageref{ffthdu} \\
 fits\_get\_num\_members  & \pageref{ffgtnm} \\
 fits\_get\_num\_rows     & \pageref{ffgnrw} \\
 fits\_get\_rowsize    & \pageref{ffgrsz} \\
 fits\_get\_system\_time  & \pageref{ffdt2s} \\
+fits\_get\_tile\_dim     & \pageref{ffgetcomp} \\
 fits\_get\_tbcol      & \pageref{ffgabc} \\
 fits\_get\_version    & \pageref{ffvers} \\
+fits\_hdr2str         & \pageref{ffhdr2str}, \pageref{hdr2str} \\
 fits\_insert\_atbl    & \pageref{ffitab} \\
 fits\_insert\_btbl    & \pageref{ffibin} \\
 fits\_insert\_col   & \pageref{fficol} \\
@@ -7947,6 +8551,9 @@ fits\_insert\_record     & \pageref{ffirec} \\
 fits\_insert\_rows  & \pageref{ffirow} \\
 fits\_iterate\_data   & \pageref{ffiter} \\
 fits\_make\_keyn      & \pageref{ffkeyn} \\
+\end{tabular}
+\newpage
+\begin{tabular}{lr}
 fits\_make\_nkey      & \pageref{ffnkey} \\
 fits\_merge\_groups  & \pageref{ffgtmg} \\
 fits\_modify\_card       & \pageref{ffmcrd} \\
@@ -7959,16 +8566,17 @@ fits\_modify\_vector\_len  & \pageref{ffmvec} \\
 fits\_movabs\_hdu     & \pageref{ffmahd} \\
 fits\_movnam\_hdu     & \pageref{ffmnhd} \\
 fits\_movrel\_hdu     & \pageref{ffmrhd} \\
-\end{tabular}
-\newpage
-\begin{tabular}{lr}
 fits\_null\_check     & \pageref{ffnchk} \\
+fits\_open\_data      & \pageref{ffopen} \\
 fits\_open\_file      & \pageref{ffopen} \\
+fits\_open\_image      & \pageref{ffopen} \\
+fits\_open\_table      & \pageref{ffopen} \\
 fits\_open\_group    & \pageref{ffgtop} \\
 fits\_open\_member    & \pageref{ffgmop} \\
 fits\_open\_memfile   & \pageref{ffomem} \\
 fits\_parse\_extnum   & \pageref{ffextn} \\
 fits\_parse\_input\_url & \pageref{ffiurl} \\
+fits\_parse\_range    & \pageref{ffrwrg} \\
 fits\_parse\_rootname & \pageref{ffrtnm} \\
 fits\_parse\_template & \pageref{ffgthd} \\
 fits\_parse\_value    & \pageref{ffpsvc} \\
@@ -7993,6 +8601,8 @@ fits\_read\_img\_TYP     & \pageref{ffgpvx} \\
 fits\_read\_imghdr       & \pageref{ffghpr} \\
 fits\_read\_imgnull & \pageref{ffgpf} \\
 fits\_read\_imgnull\_TYP & \pageref{ffgpfx} \\
+\end{tabular}
+\begin{tabular}{lr}
 fits\_read\_key          & \pageref{ffgky} \\
 fits\_read\_key\_longstr  & \pageref{ffgkls} \\
 fits\_read\_key\_triple   & \pageref{ffgkyt} \\
@@ -8008,8 +8618,6 @@ fits\_read\_subset\_TYP  & \pageref{ffgsvx} \pageref{ffgsvx2}\\
 fits\_read\_subsetnull\_TYP & \pageref{ffgsfx} \pageref{ffgsfx2} \\
 fits\_read\_tbl\_coord & \pageref{ffgtcs} \\
 fits\_read\_tblbytes    & \pageref{ffgtbb} \\
-\end{tabular}
-\begin{tabular}{lr}
 fits\_read\_tdim         & \pageref{ffgtdm} \\
 fits\_remove\_group  & \pageref{ffgtrm} \\
 fits\_remove\_member   & \pageref{ffgmrm} \\
@@ -8020,13 +8628,18 @@ fits\_select\_rows  & \pageref{ffsrow} \\
 fits\_set\_atblnull   & \pageref{ffsnul} \\
 fits\_set\_bscale     & \pageref{ffpscl} \\
 fits\_set\_btblnull   & \pageref{fftnul} \\
+fits\_set\_compression\_type  & \pageref{ffsetcomp} \\
 fits\_set\_hdrsize    & \pageref{ffhdef} \\
 fits\_set\_hdustruc   & \pageref{ffrdef} \\
 fits\_set\_imgnull    & \pageref{ffpnul} \\
+fits\_set\_noise\_bits  & \pageref{ffsetcomp} \\
+fits\_set\_tile\_dim  & \pageref{ffsetcomp} \\
 fits\_set\_tscale     & \pageref{fftscl} \\
+fits\_split\_names    & \pageref{splitnames} \\
 fits\_str2date        & \pageref{ffdt2s} \\
 fits\_str2time        & \pageref{ffdt2s} \\
-fits\_test\_expr    & \pageref{fftexp} \\
+fits\_test\_expr      & \pageref{fftexp} \\
+fits\_test\_heap      & \pageref{fftheap} \\
 fits\_test\_keyword   & \pageref{fftkey} \\
 fits\_test\_record    & \pageref{fftrec} \\
 fits\_time2str  & \pageref{ffdt2s} \\
@@ -8037,6 +8650,8 @@ fits\_update\_key        & \pageref{ffuky} \\
 fits\_update\_key\_null   & \pageref{ffukyu} \\
 fits\_update\_key\_TYP    & \pageref{ffukyx} \\
 fits\_uppercase      & \pageref{ffupch} \\
+\end{tabular}
+\begin{tabular}{lr}
 fits\_url\_type      & \pageref{ffurlt} \\
 fits\_verify\_chksum  & \pageref{ffvcks} \\
 fits\_verify\_group  & \pageref{ffgtvf} \\
@@ -8049,15 +8664,15 @@ fits\_write\_chksum   & \pageref{ffpcks} \\
 fits\_write\_col         & \pageref{ffpcl} \\
 fits\_write\_col\_bit     & \pageref{ffpclx} \\
 fits\_write\_col\_TYP     & \pageref{ffpcls} \\
+fits\_write\_col\_null      & \pageref{ffpclu} \\
 fits\_write\_colnull      & \pageref{ffpcn} \\
 fits\_write\_colnull\_TYP & \pageref{ffpcnx} \\
 fits\_write\_comment      & \pageref{ffpcom} \\
 fits\_write\_date         & \pageref{ffpdat} \\
 fits\_write\_descript  & \pageref{ffpdes} \\
+fits\_write\_errmark   & \pageref{ffpmrk} \\
 fits\_write\_errmsg   & \pageref{ffpmsg} \\
 fits\_write\_grphdr       & \pageref{ffphpr} \\
-\end{tabular}
-\begin{tabular}{lr}
 fits\_write\_grppar\_TYP & \pageref{ffpgpx} \\
 fits\_write\_history      & \pageref{ffphis} \\
 fits\_write\_img        & \pageref{ffppr} \\
@@ -8079,6 +8694,7 @@ fits\_write\_null\_img    & \pageref{ffpprn} \\
 fits\_write\_pix          & \pageref{ffppx} \\
 fits\_write\_pixnull      & \pageref{ffppxn} \\
 fits\_write\_record       & \pageref{ffprec} \\
+fits\_write\_subset       & \pageref{ffpss} \\
 fits\_write\_subset\_TYP  & \pageref{ffpssx} \\
 fits\_write\_tblbytes  & \pageref{ffptbb} \\
 fits\_write\_tdim         & \pageref{ffptdm} \\
@@ -8092,11 +8708,14 @@ ffbnfm   & \pageref{ffbnfm} \\
 ffcalc     & \pageref{ffcalc} \\
 ffcalc\_rng     & \pageref{ffcalcrng} \\
 ffclos     & \pageref{ffclos} \\
+ffcmph & \pageref{ffcmph} \\
 ffcmps    & \pageref{ffcmps} \\
+ffcmrk  & \pageref{ffpmrk} \\
 ffcmsg  & \pageref{ffcmsg} \\
 ffcopy     & \pageref{ffcopy} \\
 ffcpcl     & \pageref{ffcpcl} \\
 ffcpdt      & \pageref{ffcpdt} \\
+ffcpfl      & \pageref{ffcpfl} \\
 ffcphd   & \pageref{ffcphd} \\
 ffcpky       & \pageref{ffcpky} \\
 ffcrhd     & \pageref{ffcrhd} \\
@@ -8107,18 +8726,23 @@ ffdcol   & \pageref{ffdcol} \\
 ffdelt    & \pageref{ffdelt} \\
 ffdhdu     & \pageref{ffdhdu} \\
 ffdkey     & \pageref{ffdkey} \\
+ffdopn      & \pageref{ffopen} \\
 ffdrec  & \pageref{ffdrec} \\
 ffdrow  & \pageref{ffdrow} \\
+ffdrrg  & \pageref{ffdrrg} \\
 ffdrws & \pageref{ffdrws} \\
 ffdsum  & \pageref{ffdsum} \\
 ffdt2s  & \pageref{ffdt2s} \\
 ffdtdm   & \pageref{ffdtdm} \\
 ffdtyp    & \pageref{ffdtyp} \\
+ffeqty    & \pageref{ffgtcl} \\
 ffesum  & \pageref{ffesum} \\
+ffexest  & \pageref{ffexist} \\
 ffextn   & \pageref{ffextn} \\
 ffffrw    & \pageref{ffffrw} \\
 ffflmd      & \pageref{ffflmd} \\
 ffflnm      & \pageref{ffflnm} \\
+ffflsh     & \pageref{ffflus} \\
 ffflus     & \pageref{ffflus} \\
 fffrow    & \pageref{fffrow} \\
 ffg2d\_      & \pageref{ffg2dx} \\
@@ -8126,6 +8750,8 @@ ffg3d\_      & \pageref{ffg3dx} \\
 ffgabc      & \pageref{ffgabc} \\
 ffgacl  & \pageref{ffgacl} \\
 ffgbcl  & \pageref{ffgbcl} \\
+\end{tabular}
+\begin{tabular}{lr}
 ffgcdw  & \pageref{ffgcdw} \\
 ffgcf    & \pageref{ffgcf} \\
 ffgcf\_    & \pageref{ffgcfx} \\
@@ -8133,8 +8759,6 @@ ffgcks     & \pageref{ffgcks} \\
 ffgcnn    & \pageref{ffgcnn} \\
 ffgcno     & \pageref{ffgcno} \\
 ffgcrd         & \pageref{ffgcrd} \\
-\end{tabular}
-\begin{tabular}{lr}
 ffgcv        & \pageref{ffgcv} \\
 ffgcv\_    & \pageref{ffgcvx} \\
 ffgcx     & \pageref{ffgcx} \\
@@ -8154,6 +8778,7 @@ ffghtb      & \pageref{ffghtb} \\
 ffgics & \pageref{ffgics} \\
 ffgidm & \pageref{ffgidm} \\
 ffgidt & \pageref{ffgidt} \\
+ffgiet & \pageref{ffgidt} \\
 ffgipr & \pageref{ffgipr} \\
 ffgisz & \pageref{ffgisz} \\
 ffgkcl      & \pageref{ffgkcl} \\
@@ -8174,6 +8799,9 @@ ffgmtf  & \pageref{ffgmtf} \\
 ffgncl     & \pageref{ffgnrw} \\
 ffgnrw     & \pageref{ffgnrw} \\
 ffgnxk      & \pageref{ffgnxk} \\
+
+\end{tabular}
+\begin{tabular}{lr}
 ffgpf & \pageref{ffgpf} \\
 ffgpf\_ & \pageref{ffgpfx} \\
 ffgpv         & \pageref{ffgpv} \\
@@ -8181,8 +8809,6 @@ ffgpv\_     & \pageref{ffgpvx} \\
 ffgpxv   & \pageref{ffgpxv} \\
 ffgpxf  & \pageref{ffgpxf} \\
 ffgrec       & \pageref{ffgrec} \\
-\end{tabular}
-\begin{tabular}{lr}
 ffgrsz    & \pageref{ffgrsz} \\
 ffgsdt        & \pageref{ffdt2s} \\
 ffgsf\_ & \pageref{ffgsfx} \pageref{ffgsfx2} \\
@@ -8215,6 +8841,7 @@ ffikyu   & \pageref{ffikyu} \\
 ffiky\_    & \pageref{ffikyx} \\
 ffimem  & \pageref{ffimem} \\
 ffinit  & \pageref{ffinit} \\
+ffiopn & \pageref{ffopen} \\
 ffirec     & \pageref{ffirec} \\
 ffirow  & \pageref{ffirow} \\
 ffitab    & \pageref{ffitab} \\
@@ -8222,6 +8849,9 @@ ffiter   & \pageref{ffiter} \\
 ffiurl & \pageref{ffiurl} \\
 ffkeyn      & \pageref{ffkeyn} \\
 ffmahd     & \pageref{ffmahd} \\
+
+\end{tabular}
+\begin{tabular}{lr}
 ffmcom    & \pageref{ffmcom} \\
 ffmcrd       & \pageref{ffmcrd} \\
 ffmkls    & \pageref{ffmkyx} \\
@@ -8229,8 +8859,6 @@ ffmkyu   & \pageref{ffmkyu} \\
 ffmky\_    & \pageref{ffmkyx} \\
 ffmnam       & \pageref{ffmnam} \\
 ffmnhd     & \pageref{ffmnhd} \\
-\end{tabular}
-\begin{tabular}{lr}
 ffmrec     & \pageref{ffmrec} \\
 ffmrhd     & \pageref{ffmrhd} \\
 ffmvec  & \pageref{ffmvec} \\
@@ -8244,6 +8872,7 @@ ffpcks   & \pageref{ffpcks} \\
 ffpcl         & \pageref{ffpcl} \\
 ffpcls     & \pageref{ffpcls} \\
 ffpcl\_     & \pageref{ffpclx} \\
+ffpclu      & \pageref{ffpclu} \\
 ffpcn    & \pageref{ffpcn} \\
 ffpcn\_ & \pageref{ffpcnx} \\
 ffpcom      & \pageref{ffpcom} \\
@@ -8263,22 +8892,24 @@ ffpkyt   & \pageref{ffpkyt} \\
 ffpkyu     & \pageref{ffpkyu} \\
 ffpky\_      & \pageref{ffpkyx} \\
 ffplsw & \pageref{ffplsw} \\
+ffpmrk   & \pageref{ffpmrk} \\
 ffpmsg   & \pageref{ffpmsg} \\
 ffpnul    & \pageref{ffpnul} \\
 ffppn     & \pageref{ffppn} \\
 ffppn\_ & \pageref{ffppnx} \\
 ffppr        & \pageref{ffppr} \\
 ffpprn & \pageref{ffpprn} \\
+\end{tabular}
+\begin{tabular}{lr}
 ffppru & \pageref{ffppru} \\
 ffppr\_    & \pageref{ffpprx} \\
 ffppx & \pageref{ffppx} \\
 ffppxn & \pageref{ffppxn} \\
 ffprec       & \pageref{ffprec} \\
 ffpscl     & \pageref{ffpscl} \\
+ffpss    & \pageref{ffpss} \\
 ffpss\_  & \pageref{ffpssx} \\
 ffpsvc    & \pageref{ffpsvc} \\
-\end{tabular}
-\begin{tabular}{lr}
 ffptbb  & \pageref{ffptbb} \\
 ffptdm         & \pageref{ffptdm} \\
 ffpthp    & \pageref{ffpthp} \\
@@ -8288,15 +8919,18 @@ ffreopen      & \pageref{ffreopen} \\
 ffrprt   & \pageref{ffrprt} \\
 ffrsim     & \pageref{ffrsim} \\
 ffrtnm & \pageref{ffrtnm} \\
+ffrwrg    & \pageref{ffrwrg} \\
 ffs2dt  & \pageref{ffdt2s} \\
 ffs2tm  & \pageref{ffdt2s} \\
 ffsnul   & \pageref{ffsnul} \\
 ffsrow  & \pageref{ffsrow} \\
 fftexp    & \pageref{fftexp} \\
 ffthdu   & \pageref{ffthdu} \\
+fftheap  & \pageref{fftheap} \\
 fftkey   & \pageref{fftkey} \\
 fftm2s  & \pageref{ffdt2s} \\
 fftnul   & \pageref{fftnul} \\
+fftopn & \pageref{ffopen} \\
 fftplt & \pageref{fftplt} \\
 fftrec    & \pageref{fftrec} \\
 fftscl     & \pageref{fftscl} \\
@@ -8317,7 +8951,7 @@ ffxypx & \pageref{ffxypx} \\
 
 
 \chapter{Parameter Definitions }
- 
+
 \begin{verbatim}
 anynul   - set to TRUE (=1) if any returned values are undefined, else FALSE
 array    - array of numerical data values to read or write
@@ -8326,9 +8960,12 @@ binspec  - the input table binning specifier
 bitpix   - bits per pixel. The following symbolic mnemonics are predefined:
                BYTE_IMG   =   8 (unsigned char)
                SHORT_IMG  =  16 (signed short integer)
-               LONG_IMG   = �32 (signed long integer)
+               LONG_IMG   =  32 (signed long integer)
+               LONGLONG_IMG =  64 (signed long 64-bit integer)
                FLOAT_IMG  = -32 (float)
                DOUBLE_IMG = -64 (double).
+           The LONGLONG_IMG type is experimental and is not officially
+           recognized in the FITS Standard document.
            Two additional values, USHORT_IMG and ULONG_IMG are also available
            for creating unsigned integer images.  These are equivalent to
            creating a signed integer image with BZERO offset keyword values
@@ -8344,6 +8981,7 @@ colspec  - the input file column specification; used to delete, create, or renam
            table columns
 comment  - the keyword comment field (72 char max, null-terminated)
 complm   - should the checksum be complemented?
+comptype - compression algorithm to use: GZIP_1, RICE_1, or PLIO_1
 coordtype- type of coordinate projection (-SIN, -TAN, -ARC, -NCP,
            -GLS, -MER, or -AIT)
 cpopt    - grouping table copy option parameter. Allowed values are:
@@ -8351,13 +8989,14 @@ cpopt    - grouping table copy option parameter. Allowed values are:
            OPT_MCP_REPL, amd OPT_MCP_MOV.
 create_col- If TRUE, then insert a new column in the table, otherwise
            overwrite the existing column.
+current  - if TRUE, then the current HDU will be copied
 dataok   - was the data unit verification successful (=1) or
            not (= -1).  Equals zero if the DATASUM keyword is not present.
 datasum  - 32-bit 1's complement checksum for the data unit
 dataend  - address (in bytes) of the end of the HDU
 datastart- address (in bytes) of the start of the data unit
-datatype - specifies the datatype of the value.  Allowed value are:
-           TSTRING, TLOGICAL, TBYTE, TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG,
+datatype - specifies the data type of the value.  Allowed value are:  TSTRING,
+           TLOGICAL, TBYTE, TSBYTE, TSHORT, TUSHORT, TINT, TUINT, TLONG, TULONG,
            TFLOAT, TDOUBLE, TCOMPLEX, and TDBLCOMPLEX
 datestr  - FITS date/time string: 'YYYY-MM-DDThh:mm:ss.ddd', 'YYYY-MM-dd',
            or 'dd/mm/yy'
@@ -8367,7 +9006,7 @@ deltasize - increment for allocating more memory
 dim1     - declared size of the first dimension of the image or cube array
 dim2     - declared size of the second dimension of the data cube array
 dispwidth - display width of a column = length of string that will be read
-dtype    - datatype of the keyword ('C', 'L', 'I', 'F' or 'X')
+dtype    - data type of the keyword ('C', 'L', 'I', 'F' or 'X')
                 C = character string
                 L = logical
                 I = integer
@@ -8378,6 +9017,7 @@ err_text - error message string corresponding to error number (30 chars max)
 exact    - TRUE (=1) if the strings match exactly;
            FALSE (=0) if wildcards are used
 exclist  - array of pointers to keyword names to be excluded from search
+exists   - flag indicating whether the file or compressed file exists on disk
 expr     - boolean or arithmetic expression
 extend   - TRUE (=1) if FITS file may have extensions, else FALSE (=0)
 extname  - value of the EXTNAME keyword (null-terminated)
@@ -8391,6 +9031,7 @@ firstfailed - member HDU ID (if positive) or grouping table GRPIDn index
            value (if negative) that failed grouping table verification.
 firstelem- first element in a vector (ignored for ASCII tables)
 firstrow - starting row number (first row of table = 1)
+following- if TRUE, any HDUs following the current HDU will be copied
 fpixel   - coordinate of the first pixel to be read or written in the
            FITS array.  The array must be of length NAXIS and have values such
            that fpixel[0] is in the range 1 to NAXIS1, fpixel[1] is in the
@@ -8402,7 +9043,7 @@ gfptr    - fitsfile* pointer to a grouping table HDU.
 group    - GRPIDn/GRPLCn index value identifying a grouping table HDU, or
            data group number (=0 for non-grouped data)
 grouptype - Grouping table parameter that specifies the columns to be
-           created in a grouing table HDU. Allowed values are: GT_ID_ALL_URI,
+           created in a grouping table HDU. Allowed values are: GT_ID_ALL_URI,
            GT_ID_REF, GT_ID_POS, GT_ID_ALL, GT_ID_REF_URI, and GT_ID_POS_URI.
 grpname  - value to use for the GRPNAME keyword value.
 hdunum   - sequence number of the HDU (Primary array = 1)
@@ -8410,7 +9051,9 @@ hduok    - was the HDU verification successful (=1) or
            not (= -1).  Equals zero if the CHECKSUM keyword is not present.
 hdusum   - 32 bit 1's complement checksum for the entire CHDU
 hdutype  - type of HDU: IMAGE_HDU (=0), ASCII_TBL (=1), or BINARY_TBL (=2)
+header   - returned character string containing all the keyword records
 headstart- starting address (in bytes) of the CHDU
+heapsize - size of the binary table heap, in bytes
 history  - the HISTORY keyword comment string (70 char max, null-terminated)
 hour     - hour within day (UTC) (0 - 23)
 inc      - sampling interval for pixels in each FITS dimension
@@ -8444,6 +9087,7 @@ minute   - minute within hour (UTC) (0 - 59)
 month    - calendar month (UTC) (1 - 12)
 morekeys - space in the header for this many more keywords
 n_good_rows - number of rows evaluating to TRUE
+namelist - string containing a comma or space delimited list of names
 naxes    - size of each dimension in the FITS array
 naxis    - number of dimensions in the FITS array
 naxis1   - length of the X/first axis of the FITS array
@@ -8459,19 +9103,24 @@ nkeys    - number of keywords in the sequence
 ninc     - number of names in the inclusion list
 nmembers - Number of grouping table members (NAXIS2 value).
 nmove    - number of HDUs to move (+ or -), relative to current position
+nocomments - if equal to TRUE, then no commentary keywords will be copied
+noisebits- number of bits to ignore when compressing floating point images
 nrows    - number of rows in the table
 nstart   - first integer value
-nularray - set to TRUE (=1) if corresponding data element is undefined
+nullarray- set to TRUE (=1) if corresponding data element is undefined
 nulval   - numerical value to represent undefined pixels
 nulstr   - character string used to represent undefined values in ASCII table
-numval   - numerical data value, of the appropriate datatype
+numval   - numerical data value, of the appropriate data type
 offset   -  byte offset in the heap to the first element of the vector
 openfptr - pointer to a currently open FITS file
+overlap  - number of bytes in the binary table heap pointed to by more than 1
+           descriptor
 outcolnum- output column number; range = 1 to TFIELDS + 1
 outfile  - and optional output filename; the input file will be copied to this prior
            to opening the file
 outfptr  - pointer to a 'fitsfile' structure describing the output FITS file.
 pcount   - value of the PCOUNT keyword = size of binary table heap
+previous - if TRUE, any previous HDUs in the input file will be copied.
 repeat   - length of column vector (e.g. 12J); == 1 for ASCII table
 rmopt    - grouping table remove option parameter. Allowed values are:
            OPT_RM_GPT, OPT_RM_ENTRY, OPT_RM_MBR, and OPT_RM_ALL.
@@ -8480,9 +9129,10 @@ rot      - celestial coordinate rotation angle (degrees)
 rowlen   - length of a table row, in characters or bytes
 rowlist  - sorted list of row numbers to be deleted from the table
 rownum   - number of the row (first row = 1)
+rowrange - list of rows or row ranges: '3,6-8,12,56-80' or '500-'
 row_status - array of True/False results for each row that was evaluated
 scale    - linear scaling factor; true value = (FITS value) * scale + zero
-second   - second within minute (0 - 60.9999999999) (leapsecond!)
+second   - second within minute (0 - 60.9999999999) (leap second!)
 simple   - TRUE (=1) if FITS file conforms to the Standard, else FALSE (=0)
 space    - number of blank spaces to leave between ASCII table columns
 status   - returned error status code (0 = OK)
@@ -8498,17 +9148,19 @@ tform    - format of the column (null-terminated); allowed values are:
            ASCII tables:  Iw, Aw, Fww.dd, Eww.dd, or Dww.dd
            Binary tables: rL, rX, rB, rI, rJ, rA, rAw, rE, rD, rC, rM
            where 'w'=width of the field, 'd'=no. of decimals, 'r'=repeat count.
-           Variable length array columns are denoted by a '1P' before the datatype
+           Variable length array columns are denoted by a '1P' before the data type
            character (e.g., '1PJ').  When creating a binary table, 2 addition tform
-           datatype codes are recognized by CFITSIO: 'rU' and 'rV' for unsigned
+           data type codes are recognized by CFITSIO: 'rU' and 'rV' for unsigned
            16-bit and unsigned 32-bit integer, respectively.
 
 theap    - zero indexed byte offset of starting address of the heap
            relative to the beginning of the binary table data
+tilesize - array of length NAXIS that specifies the dimensions of
+           the image compression tiles
 ttype    - label or name for table column (null-terminated)
 tunit    - physical unit for table column (null-terminated)
-typechar - symbolic code of the table column datatype
-typecode - datatype code of the table column.  The negative of
+typechar - symbolic code of the table column data type
+typecode - data type code of the table column.  The negative of
            the value indicates a variable length array column.
                 Datatype             typecode    Mnemonic
                 bit, X                   1        TBIT
@@ -8517,12 +9169,18 @@ typecode - datatype code of the table column.  The negative of
                 ASCII character, A      16        TSTRING
                 short integer, I        21        TSHORT
                 integer, J              41        TINT32BIT
+                long long integer, K    81        TLONGLONG
                 real, E                 42        TFLOAT
                 double precision, D     82        TDOUBLE
                 complex, C              83        TCOMPLEX
                 double complex, M      163        TDBLCOMPLEX
+             The TLONGLONG column type is experimental and is not
+             recognized in the official FITS Standard document
 unit     - the physical unit string (e.g., 'km/s') for a keyword
+unused   - number of unused bytes in the binary table heap
 urltype  - the file type of the FITS file (file://, ftp://, mem://, etc.)
+validheap- returned value = FALSE if any of the variable length array
+           address are outside the valid range of addresses in the heap
 value    - the keyword value string (70 char max, null-terminated)
 version  - current version number of the CFITSIO library
 width    - width of the character string field
@@ -8548,7 +9206,7 @@ The following table lists all the error status codes used by CFITSIO.
 Programmers are encouraged to use the symbolic mnemonics (defined in
 the file fitsio.h) rather than the actual integer status values to
 improve the readability of their code.
- 
+
 \begin{verbatim}
  Symbolic Const    Value     Meaning
  --------------    -----  -----------------------------------------
@@ -8573,6 +9231,7 @@ improve the readability of their code.
  DRIVER_INIT_FAILED 123   driver initialization failed
  NO_MATCHING_DRIVER 124   matching driver is not registered
  URL_PARSE_ERROR    125   failed to parse input file URL
+ RANGE_PARSE_ERROR  126   parse error in range list
 
  SHARED_BADARG     151    bad argument in shared memory driver
  SHARED_NULPTR     152    null pointer passed as an argument
@@ -8627,17 +9286,18 @@ improve the readability of their code.
  BAD_HEADER_FILL   254    Header fill area contains non-blank chars
  BAD_DATA_FILL     255    Illegal data fill bytes (not zero or blank)
  BAD_TFORM         261    illegal TFORM format code
- BAD_TFORM_DTYPE   262    unrecognizable TFORM datatype code
+ BAD_TFORM_DTYPE   262    unrecognizable TFORM data type code
  BAD_TDIM          263    illegal TDIMn keyword value
+ BAD_HEAP_PTR      264    invalid BINTABLE heap pointer is out of range
 
- BAD_HDU_NUM       301    HDU number < 1 or > MAXHDU
+ BAD_HDU_NUM       301    HDU number < 1
  BAD_COL_NUM       302    column number < 1 or > tfields
  NEG_FILE_POS      304    tried to move to negative byte location in file
  NEG_BYTES         306    tried to read or write negative number of bytes
  BAD_ROW_NUM       307    illegal starting row number in table
  BAD_ELEM_NUM      308    illegal starting element number in vector
  NOT_ASCII_COL     309    this is not an ASCII string column
- NOT_LOGICAL_COL   310    this is not a logical datatype column
+ NOT_LOGICAL_COL   310    this is not a logical data type column
  BAD_ATABLE_FORMAT 311    ASCII table column has wrong format
  BAD_BTABLE_FORMAT 312    Binary table column has wrong format
  NO_NULL           314    null value has not been defined
@@ -8656,6 +9316,8 @@ improve the readability of their code.
  HDU_ALREADY_TRACKED   346
  BAD_OPTION            347
  IDENTICAL_POINTERS    348
+ BAD_GROUP_ATTACH      349
+ BAD_GROUP_DETACH      350
 
  NGP_NO_MEMORY         360     malloc failed
  NGP_READ_ERR          361     read error from file
@@ -8685,7 +9347,7 @@ improve the readability of their code.
  BAD_C2D           409    bad formatted string to double conversion
  BAD_DATATYPE      410    illegal datatype code value
  BAD_DECIM         411    bad number of decimal places specified
- NUM_OVERFLOW      412    overflow during datatype conversion
+ NUM_OVERFLOW      412    overflow during data type conversion
  DATA_COMPRESSION_ERR   413  error compressing image
  DATA_DECOMPRESSION_ERR 414  error uncompressing image
 
diff --git a/cfitsio.toc b/cfitsio.toc
index e970158..3ef096a 100644
--- a/cfitsio.toc
+++ b/cfitsio.toc
@@ -1,101 +1,118 @@
 \contentsline {chapter}{\numberline {1}Introduction }{1}
-\contentsline {chapter}{\numberline {2} Creating the CFITSIO Library }{3}
-\contentsline {section}{\numberline {2.1}Building the Library}{3}
-\contentsline {subsection}{\numberline {2.1.1} Unix Systems}{4}
-\contentsline {subsection}{\numberline {2.1.2}VMS}{5}
-\contentsline {subsection}{\numberline {2.1.3}Windows PCs}{5}
-\contentsline {subsection}{\numberline {2.1.4}OS/2}{5}
-\contentsline {subsection}{\numberline {2.1.5}Macintosh PCs}{6}
-\contentsline {section}{\numberline {2.2}Testing the Library}{6}
-\contentsline {section}{\numberline {2.3}Linking Programs with CFITSIO}{7}
-\contentsline {section}{\numberline {2.4}Getting Started with CFITSIO}{7}
-\contentsline {section}{\numberline {2.5}Example Program}{8}
-\contentsline {section}{\numberline {2.6}Legal Stuff}{9}
-\contentsline {section}{\numberline {2.7}Acknowledgements}{10}
+\contentsline {section}{\numberline {1.1} A Brief Overview}{1}
+\contentsline {section}{\numberline {1.2}Sources of FITS Software and Information}{1}
+\contentsline {section}{\numberline {1.3}Acknowledgements}{2}
+\contentsline {section}{\numberline {1.4}Legal Stuff}{3}
+\contentsline {chapter}{\numberline {2} Creating the CFITSIO Library }{5}
+\contentsline {section}{\numberline {2.1}Building the Library}{5}
+\contentsline {subsection}{\numberline {2.1.1}Unix Systems}{5}
+\contentsline {subsection}{\numberline {2.1.2}VMS}{7}
+\contentsline {subsection}{\numberline {2.1.3}Windows PCs}{7}
+\contentsline {subsection}{\numberline {2.1.4}Macintosh PCs}{7}
+\contentsline {section}{\numberline {2.2}Testing the Library}{8}
+\contentsline {section}{\numberline {2.3}Linking Programs with CFITSIO}{9}
+\contentsline {section}{\numberline {2.4}Getting Started with CFITSIO}{9}
+\contentsline {section}{\numberline {2.5}Example Program}{10}
 \contentsline {chapter}{\numberline {3} A FITS Primer }{13}
-\contentsline {chapter}{\numberline {4} Extended File Name Syntax }{15}
-\contentsline {section}{\numberline {4.1}Overview}{15}
-\contentsline {section}{\numberline {4.2}Detailed Filename Syntax}{17}
-\contentsline {subsection}{\numberline {4.2.1}Filetype}{18}
-\contentsline {subsubsection}{Notes about the root filetype}{18}
-\contentsline {subsubsection}{Notes about the shmem filetype:}{20}
-\contentsline {subsection}{\numberline {4.2.2}Base Filename}{21}
-\contentsline {subsection}{\numberline {4.2.3}Output File Name when Opening an Existing File}{22}
-\contentsline {subsection}{\numberline {4.2.4}Template File Name when Creating a New File}{23}
-\contentsline {subsubsection}{Detailed Template Line Format}{23}
-\contentsline {subsubsection}{Auto-indexing of Keywords}{24}
-\contentsline {subsubsection}{Template Parser Directives}{25}
-\contentsline {subsubsection}{Formal Template Syntax}{26}
-\contentsline {subsubsection}{Errors}{26}
-\contentsline {subsubsection}{Examples}{26}
-\contentsline {subsection}{\numberline {4.2.5}HDU Location Specification}{27}
-\contentsline {subsection}{\numberline {4.2.6}Image Section}{28}
-\contentsline {subsection}{\numberline {4.2.7}Column and Keyword Filtering Specification}{29}
-\contentsline {subsection}{\numberline {4.2.8}Row Filtering Specification}{30}
-\contentsline {subsection}{\numberline {4.2.9}Binning or Histogramming Specification}{37}
-\contentsline {chapter}{\numberline {5}CFITSIO Conventions and Guidelines }{41}
-\contentsline {section}{\numberline {5.1}CFITSIO Definitions}{41}
-\contentsline {section}{\numberline {5.2}CFITSIO Size Limitations}{43}
-\contentsline {section}{\numberline {5.3}Multiple Access to the Same FITS File}{44}
-\contentsline {section}{\numberline {5.4}Current Header Data Unit (CHDU)}{44}
-\contentsline {section}{\numberline {5.5}Function Names and Datatypes}{44}
-\contentsline {section}{\numberline {5.6}Unsigned Integers}{46}
-\contentsline {section}{\numberline {5.7}Character Strings}{48}
-\contentsline {section}{\numberline {5.8}Implicit Data Type Conversion}{49}
-\contentsline {section}{\numberline {5.9}Data Scaling}{49}
-\contentsline {section}{\numberline {5.10}Error Status Values and the Error Message Stack}{50}
-\contentsline {section}{\numberline {5.11}Variable-Length Arrays in Binary Tables}{50}
-\contentsline {section}{\numberline {5.12}Support for IEEE Special Values}{52}
-\contentsline {section}{\numberline {5.13}When the Final Size of the FITS HDU is Unknown}{52}
-\contentsline {section}{\numberline {5.14}Local FITS Conventions supported by CFITSIO}{53}
-\contentsline {subsection}{\numberline {5.14.1}Long String Keyword Values.}{53}
-\contentsline {subsection}{\numberline {5.14.2}Arrays of Fixed-Length Strings in Binary Tables}{54}
-\contentsline {subsection}{\numberline {5.14.3}Keyword Units Strings}{54}
-\contentsline {subsection}{\numberline {5.14.4}HIERARCH Convention for Extended Keyword Names}{55}
-\contentsline {section}{\numberline {5.15}Optimizing Code for Maximum Processing Speed}{56}
-\contentsline {subsection}{\numberline {5.15.1}Background Information: How CFITSIO Manages Data I/O}{56}
-\contentsline {subsection}{\numberline {5.15.2}Optimization Strategies}{57}
-\contentsline {chapter}{\numberline {6} The CFITSIO Iterator Function }{61}
-\contentsline {section}{\numberline {6.1}The Iterator Work Function}{62}
-\contentsline {section}{\numberline {6.2}The Iterator Driver Function}{64}
-\contentsline {section}{\numberline {6.3}Guidelines for Using the Iterator Function}{65}
-\contentsline {chapter}{\numberline {7} Basic CFITSIO Interface Routines }{67}
-\contentsline {section}{\numberline {7.1}CFITSIO Error Status Routines}{67}
-\contentsline {section}{\numberline {7.2}FITS File Access Routines}{68}
-\contentsline {section}{\numberline {7.3}HDU Access Routines}{71}
-\contentsline {section}{\numberline {7.4}Header Keyword Read/Write Routines}{73}
-\contentsline {section}{\numberline {7.5}Iterator Routines}{76}
-\contentsline {section}{\numberline {7.6}Primary Array or IMAGE Extension I/O Routines}{78}
-\contentsline {section}{\numberline {7.7}ASCII and Binary Table Routines}{80}
-\contentsline {subsection}{\numberline {7.7.1}Column Information Routines }{80}
-\contentsline {subsection}{\numberline {7.7.2}Routines to Edit Rows or Columns }{82}
-\contentsline {subsection}{\numberline {7.7.3}Read and Write Column Data Routines }{83}
-\contentsline {section}{\numberline {7.8}Celestial Coordinate System Routines }{85}
-\contentsline {subsection}{\numberline {7.8.1} Self-contained WCS Routines}{86}
-\contentsline {subsection}{\numberline {7.8.2}WCS Routines that require the WCS library}{87}
-\contentsline {section}{\numberline {7.9}Hierarchical Grouping Convention Support Routines}{89}
-\contentsline {section}{\numberline {7.10}Row Selection and Calculator Routines}{94}
-\contentsline {section}{\numberline {7.11}File Checksum Routines }{95}
-\contentsline {section}{\numberline {7.12} Date and Time Utility Routines}{97}
-\contentsline {section}{\numberline {7.13} General Utility Routines}{98}
-\contentsline {chapter}{\numberline {8} Specialized CFITSIO Interface Routines }{105}
-\contentsline {section}{\numberline {8.1}Specialized FITS File Access Routines}{105}
-\contentsline {section}{\numberline {8.2}Specialized HDU Access Routines}{106}
-\contentsline {section}{\numberline {8.3}Specialized Header Keyword Routines}{108}
-\contentsline {subsection}{\numberline {8.3.1}Header Information Routines}{108}
-\contentsline {subsection}{\numberline {8.3.2}Read and Write the Required Keywords}{109}
-\contentsline {subsection}{\numberline {8.3.3}Specialized Write Keyword Routines}{110}
-\contentsline {subsection}{\numberline {8.3.4} Insert Keyword Routines}{113}
-\contentsline {subsection}{\numberline {8.3.5} Specialized Read Keyword Routines}{114}
-\contentsline {subsection}{\numberline {8.3.6} Modify Keyword Routines}{115}
-\contentsline {subsection}{\numberline {8.3.7} Specialized Update Keyword Routines }{116}
-\contentsline {section}{\numberline {8.4}Define Data Scaling and Undefined Pixel Parameters}{117}
-\contentsline {section}{\numberline {8.5}Specialized FITS Primary Array or IMAGE Extension I/O Routines}{118}
-\contentsline {section}{\numberline {8.6}Specialized FITS ASCII and Binary Table Routines}{123}
-\contentsline {subsection}{\numberline {8.6.1}Column Information Routines}{123}
-\contentsline {subsection}{\numberline {8.6.2}Low-Level Table Access Routines }{124}
-\contentsline {subsection}{\numberline {8.6.3}Specialized Write Column Data Routines}{124}
-\contentsline {subsection}{\numberline {8.6.4}Specialized Read Column Data Routines}{125}
-\contentsline {chapter}{\numberline {A}Index of Routines }{129}
-\contentsline {chapter}{\numberline {B}Parameter Definitions }{133}
-\contentsline {chapter}{\numberline {C}CFITSIO Error Status Codes }{139}
+\contentsline {chapter}{\numberline {4} Programming Guidelines }{15}
+\contentsline {section}{\numberline {4.1}CFITSIO Definitions}{15}
+\contentsline {section}{\numberline {4.2}Current Header Data Unit (CHDU)}{17}
+\contentsline {section}{\numberline {4.3}Function Names and Variable Datatypes}{18}
+\contentsline {section}{\numberline {4.4}Support for Unsigned Integers and Signed Bytes}{19}
+\contentsline {section}{\numberline {4.5}Dealing with Character Strings}{21}
+\contentsline {section}{\numberline {4.6}Implicit Data Type Conversion}{22}
+\contentsline {section}{\numberline {4.7}Data Scaling}{22}
+\contentsline {section}{\numberline {4.8}Support for IEEE Special Values}{23}
+\contentsline {section}{\numberline {4.9}Error Status Values and the Error Message Stack}{23}
+\contentsline {section}{\numberline {4.10}Variable-Length Arrays in Binary Tables}{24}
+\contentsline {section}{\numberline {4.11}Multiple Access to the Same FITS File}{25}
+\contentsline {section}{\numberline {4.12}When the Final Size of the FITS HDU is Unknown}{26}
+\contentsline {section}{\numberline {4.13}CFITSIO Size Limitations}{26}
+\contentsline {chapter}{\numberline {5}Basic CFITSIO Interface Routines }{29}
+\contentsline {section}{\numberline {5.1}CFITSIO Error Status Routines}{29}
+\contentsline {section}{\numberline {5.2}FITS File Access Routines}{30}
+\contentsline {section}{\numberline {5.3}HDU Access Routines}{33}
+\contentsline {section}{\numberline {5.4}Header Keyword Read/Write Routines}{34}
+\contentsline {subsection}{\numberline {5.4.1}Keyword Reading Routines}{35}
+\contentsline {subsection}{\numberline {5.4.2}Keyword Writing Routines}{37}
+\contentsline {section}{\numberline {5.5}Primary Array or IMAGE Extension I/O Routines}{39}
+\contentsline {section}{\numberline {5.6}Image Compression}{42}
+\contentsline {section}{\numberline {5.7}ASCII and Binary Table Routines}{45}
+\contentsline {subsection}{\numberline {5.7.1}Create New Table}{45}
+\contentsline {subsection}{\numberline {5.7.2}Column Information Routines}{45}
+\contentsline {subsection}{\numberline {5.7.3}Routines to Edit Rows or Columns}{48}
+\contentsline {subsection}{\numberline {5.7.4}Read and Write Column Data Routines}{49}
+\contentsline {subsection}{\numberline {5.7.5}Row Selection and Calculator Routines}{51}
+\contentsline {section}{\numberline {5.8}Utility Routines}{53}
+\contentsline {subsection}{\numberline {5.8.1}File Checksum Routines}{53}
+\contentsline {subsection}{\numberline {5.8.2}Date and Time Utility Routines}{54}
+\contentsline {subsection}{\numberline {5.8.3}General Utility Routines}{55}
+\contentsline {chapter}{\numberline {6} The CFITSIO Iterator Function }{63}
+\contentsline {section}{\numberline {6.1}The Iterator Work Function}{64}
+\contentsline {section}{\numberline {6.2}The Iterator Driver Function}{66}
+\contentsline {section}{\numberline {6.3}Guidelines for Using the Iterator Function}{67}
+\contentsline {section}{\numberline {6.4}Complete List of Iterator Routines}{68}
+\contentsline {chapter}{\numberline {7} Celestial Coordinate System Routines }{71}
+\contentsline {section}{\numberline {7.1} Self-contained WCS Routines}{72}
+\contentsline {chapter}{\numberline {8} Hierarchical Grouping Routines }{75}
+\contentsline {section}{\numberline {8.1}Grouping Table Routines}{76}
+\contentsline {section}{\numberline {8.2}Group Member Routines}{78}
+\contentsline {chapter}{\numberline {9} Specialized CFITSIO Interface Routines }{81}
+\contentsline {section}{\numberline {9.1}FITS File Access Routines}{81}
+\contentsline {section}{\numberline {9.2}HDU Access Routines}{84}
+\contentsline {section}{\numberline {9.3}Specialized Header Keyword Routines}{86}
+\contentsline {subsection}{\numberline {9.3.1}Header Information Routines}{86}
+\contentsline {subsection}{\numberline {9.3.2}Read and Write the Required Keywords}{86}
+\contentsline {subsection}{\numberline {9.3.3}Write Keyword Routines}{88}
+\contentsline {subsection}{\numberline {9.3.4}Insert Keyword Routines}{90}
+\contentsline {subsection}{\numberline {9.3.5}Read Keyword Routines}{91}
+\contentsline {subsection}{\numberline {9.3.6}Modify Keyword Routines}{92}
+\contentsline {subsection}{\numberline {9.3.7}Update Keyword Routines}{93}
+\contentsline {section}{\numberline {9.4}Define Data Scaling and Undefined Pixel Parameters}{94}
+\contentsline {section}{\numberline {9.5}Specialized FITS Primary Array or IMAGE Extension I/O Routines}{95}
+\contentsline {section}{\numberline {9.6}Specialized FITS ASCII and Binary Table Routines}{99}
+\contentsline {subsection}{\numberline {9.6.1}General Column Routines}{99}
+\contentsline {subsection}{\numberline {9.6.2}Low-Level Table Access Routines}{100}
+\contentsline {subsection}{\numberline {9.6.3}Write Column Data Routines}{100}
+\contentsline {subsection}{\numberline {9.6.4}Read Column Data Routines}{102}
+\contentsline {chapter}{\numberline {10} Extended File Name Syntax }{105}
+\contentsline {section}{\numberline {10.1}Overview}{105}
+\contentsline {section}{\numberline {10.2}Filetype}{108}
+\contentsline {subsection}{\numberline {10.2.1}Notes about HTTP proxy servers}{108}
+\contentsline {subsection}{\numberline {10.2.2}Notes about the root filetype}{108}
+\contentsline {subsection}{\numberline {10.2.3}Notes about the shmem filetype:}{110}
+\contentsline {section}{\numberline {10.3}Base Filename}{111}
+\contentsline {section}{\numberline {10.4}Output File Name when Opening an Existing File}{113}
+\contentsline {section}{\numberline {10.5}Template File Name when Creating a New File}{114}
+\contentsline {section}{\numberline {10.6}Image Tile-Compression Specification}{114}
+\contentsline {section}{\numberline {10.7}HDU Location Specification}{115}
+\contentsline {section}{\numberline {10.8}Image Section}{116}
+\contentsline {section}{\numberline {10.9}Column and Keyword Filtering Specification}{117}
+\contentsline {section}{\numberline {10.10}Row Filtering Specification}{118}
+\contentsline {subsection}{\numberline {10.10.1}General Syntax}{119}
+\contentsline {subsection}{\numberline {10.10.2}Bit Masks}{121}
+\contentsline {subsection}{\numberline {10.10.3}Vector Columns}{122}
+\contentsline {subsection}{\numberline {10.10.4}Good Time Interval Filtering}{123}
+\contentsline {subsection}{\numberline {10.10.5}Spatial Region Filtering}{124}
+\contentsline {subsection}{\numberline {10.10.6}Example Row Filters}{126}
+\contentsline {section}{\numberline {10.11} Binning or Histogramming Specification}{127}
+\contentsline {chapter}{\numberline {11}Template Files }{131}
+\contentsline {section}{\numberline {11.1}Detailed Template Line Format}{131}
+\contentsline {section}{\numberline {11.2}Auto-indexing of Keywords}{132}
+\contentsline {section}{\numberline {11.3}Template Parser Directives}{133}
+\contentsline {section}{\numberline {11.4}Formal Template Syntax}{133}
+\contentsline {section}{\numberline {11.5}Errors}{134}
+\contentsline {section}{\numberline {11.6}Examples}{134}
+\contentsline {chapter}{\numberline {12} Local FITS Conventions }{137}
+\contentsline {section}{\numberline {12.1}64-Bit Long Integers}{137}
+\contentsline {section}{\numberline {12.2}Long String Keyword Values.}{138}
+\contentsline {section}{\numberline {12.3}Arrays of Fixed-Length Strings in Binary Tables}{139}
+\contentsline {section}{\numberline {12.4}Keyword Units Strings}{139}
+\contentsline {section}{\numberline {12.5}HIERARCH Convention for Extended Keyword Names}{140}
+\contentsline {section}{\numberline {12.6}Tile-Compressed Image Format}{140}
+\contentsline {chapter}{\numberline {13} Optimizing Programs }{143}
+\contentsline {section}{\numberline {13.1}How CFITSIO Manages Data I/O}{143}
+\contentsline {section}{\numberline {13.2}Optimization Strategies}{144}
+\contentsline {chapter}{\numberline {A}Index of Routines }{147}
+\contentsline {chapter}{\numberline {B}Parameter Definitions }{151}
+\contentsline {chapter}{\numberline {C}CFITSIO Error Status Codes }{157}
diff --git a/cfitsiohtml.tar.gz b/cfitsiohtml.tar.gz
deleted file mode 100644
index 20356174ab4ce70241a06b326bf0010a128f72cd..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 144428
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%0D#<Orw5
znRom(vdg^muLT-Ne=@u)v&&<{(h9BZJ-eFNFPd`vNr<fviINQ2dEaO8=VKKaD{PFq
zY_cX@o-AGT?DnQ95_&sy!wf&%oi#7BGhm{Xn&g?ani1`{r5!?ENw~h+;&HzG@lN$H
zC!u@?_BNgHGX>FQ!ApAsm-x<(`Q2~ru!_g9i|6Hp<m19;+I~F}>Ck=ME&8HpPgsAH
zvuf|eNy{S7e)8Vf_3UJ*n#mN66EO)XJ2K_6R(vtMC24W?g8z>rA7vW%-IC*-YV4-Y
zoFsYS!cS)Aqjx&j_-1G&OMT@ztMGiIwB?MRlHA$tiehaNU)m+!rL^uaYcUHkGR<JS
ztFYIC<3Qh&DbdM2qG2hCt7Inf+a?_M&vpn+GmT)or4pa)KTTL-!qXoL27bP;bru+{
zPE6@gE8!HERQ#1xYV-89le_b3O({tpgX}ccX}o#-mXf>vSxHQF=uKn0%r;Fw<~W-&
zXYs>XbHBI;{#@4>!g<BO_(Y$J)Ge_cA4+@$mkTYPDBOH4)#oUWMVIrZ?x)8(UtSD-
zlK%XGjgp<~wA%g4M5ikDGC6B7u=9m&bx*%D+iB8WUZ&TYDt+yO4BB>qpVw)-gx)eK
zx)tEo_A%)p`vgVDeD=R}@oxMxDxZ8_;~4t#@|l;;3;!LO!f;mM+9OrX#8smIo4*{a
zJivMIq`}QN;|AZU9%tuxY*ADb3V$Tp9IP?lW6he?q9;#rTn$-yHKjF8!DH^vMHd7Y
zTF;eVQn@O7*SbloGery|t-2DXtUp(7=f`fIc+%S~JT-oEV9xOqzq%FG?)V&97Iw+J
zJA=2#>P39{`s(GZ&D`ftW=+{*DcElIl*@POyt8xWZQ<<9W(oYmzh!5{ltXFf*1kVy
zGcUQbBhhl^n;#X2Kg`nVoXslqSf+&M&K$P7H;Ef&cYG0=_gdMq)zW%y*g0MP3Yk+Y
z3|FkxEcBgv`fS-o!)bP5lNenYpOgi=n_kUoo~bo?w&rBt6~gYVTNg00#Aq`$r+z-9
z#=SDd?6stU=mE(GYvu2xugLCM@aftTNx9&UeoS}NZnFh0U2)RLW$}!z1=H`eyj*nB
z*gEHvN3iPJnUl7)wpxT__RYO*5pBA!ZC1f-n-d{3v&@V>*zgA}n<7%t8yd1})>)oO
zPb<A<9m!!_zV_Hm$vKKn->y06PAyE+X3kpD=`W?Z?qTj*vjU}kyz9L5HqU)%_W9sF
zCby>(Z=Ou>*%;AW7|xR6vyT1w-TYd~hexceH`LEo3vt`}DpFYYlI%A&=82jj$$Qv#
zRk4OY4eNe(;)TbiDVi*sa;;WRT78sjg3kB+6HUL9Jr1oa%oN>j>Jt6BAk=DW57RnD
zx3~z$zPd}rf{9o4)<4VkUK*mkJY@El9o?^&Pf+?&Q(&@Ti^k$Y+p6r~)nBrne#v^w
z^?kzb$;x+LZI(GRCBOP`ZqC}GHK}3-Gn*I{&vbbl_%CVADE^VhzO<YB;A-8=*QOmW
zW-D6|!?KL!+nIxZUP_;-;kG=T7F;z;B(HAPHm?(5ejX?KH@;w%K6xvqr{sLm+Z%T$
zEzO;}bnTp_A?w7PN)NvMZE)>)vF40Z$IH&Sdo*!Y$%@;`SOz@0>(bYKs#iB5)M#6=
zk&~FuzCwPTx9bi>8&_z_-`14BZNa-#((1{T$Khw(a;MJDRnBhK(tTslyCpPio3x}!
z@Pc@grCUPvw#}AYv9KxY^64_4{MBo6W?Nd_P(D}_8Sr)mPtJC(2|oOFC*EbB{PIyu
zdy;JK>s7G_!p<r_oF1L5xyfr++46=v3JFaUoD(V-=bhT^x3}SXNNwbdC#)y5zFKW*
z$Pp@f*FX2<W$zCmmr5fT*Dw9{#m!@TSi<^crS3~()R)IN>opXnhC1yy&O0Sk*l=%*
z<J=dIgp8+zUA)CQv+vY?zjOPa6=zMK^1dXbs;sDL*7@5tu}oJ2ciuX=Gwa<fhKswr
zuKBHQIC)~`e-74P%roN4N?tE;eXSK}{g&yS(V}&JP16o%|GqGnsphfePP3&E+1o5%
z|FSFfdcwygb?lF|UTQ}1`67kf`Mc(Qns#mV&T?__mg|c$qpy7RNq1a*x?3y8CxU<F
z+raC=v&tr)wO3bJ$uluzb!gC*gmp8cR=S*gqIGxj<k$ZSek^r*@b1mo<x*LUAD4?H
z?R)=U*(30Ou6Rj7YF5wn*ZWQX?!QoPoHpYN`!BIaU+N40mR~%wlV|lEGqV@}c`Ix$
z|2L0#9Q*%2+xqgq|L3p%fBs6}?RrLqP?!43|7-_7=QAt`&iptl=G?j_+x<dczsz12
zdH2z}`<4qzb}lL1f8VO&Ubl_#)%p95<ZG;X@4R=bul%V$R?VMeo9w@OvxIm*3e%V^
zyhlGkXFW^SnhlF4xgS~^-l-YJc=dKPWA4whZ7wbKr#}5Dz45-6ZMt}=kKmT;j9t&V
zqdrL8S&?~h@_E)DuY|m>Z_Qh4vV7KpuTP_jSDlPF9W*=G_vSCJy_Q#1)>><xTe&Q!
zw)0s`@P>CvR@c9*)(@VW?H#gy!d&CMr|w3UuUi@9t!ZP*n<Y7QxtjUiz^ZjCy~{7m
z%TBs<z4N@O=*zrU#j7&iy(i5N_6_>w^w;w0lqIPg7gjD)ja}^!&$qyHL;0n`U|;QB
z>Wb!9zbsxKTBILedTGky_1Av~#p>^x{9yX4q>G<K_lE>en5Ou1>8z5H{#o&>IK57b
z{tfbt*|q!C^sHZ(!cWz$TxYBs_}#noV5a7w_*LBj@$3IA-Sw!%{iXiZtxK)5>Q^pP
z({=viZTj&A->djloX+1>{x6*swk74S{#BJls+<ig*NNWkW}5Lz>7uP?!%96NU1w&W
zQo|SfTn>bUx9#&|^)a=5QI~okB)I#XFT0Pa;LEz!10lkbr>$aHHfzQf8%=|&rc2jf
zWeScB{Z(aXaP{lb-+|1*v3XIeWM;h5x+3)DK*;2|`@#f#OgFxK*Ojm;)5m)<OR#Us
zuGMNYvZ5~4b~LTj)6n%7^(l?b<lL07s@voACD!0rv#4DLGhRKqIBDv^kjs;&De*3w
zHLE24R>G>6-rrUEmd!f0C8X5gYRIznli7n~<Dw?n&3JX_QW49c5b^2noE3dar)G8v
zC9Zny<9(4M*f%$7lgEs#Ntca64uwpfJ55V?*{nxfT;>{Fby>Dvj4L?SF=}4Wj8|P3
zuY0x5)Dzc@*FID7^u@j-hkUM2*w-30BeUpI?Wxw8%Pe%A_0O2x&5W!{T-NFDeT{qb
zu4O#;XUEOBx>a^h?AJqU*1f&G*GvD*mf*v2E5zg0e$;*UVSm7b-~0aUKl*F`y8kKp
z>;AJ82Y%l9?{bCx|G&C%?|+@Q5B>i$#&gS7zL5Q2WBGUa%$=E5{`$)T*T5UuR~J-P
zThDh`>$$t=$o7zCqg_*liq~faxNW!eud<K2kh=F}&c)gP`<F)>`^rWL80uX%$P-&(
zv}^9VlEn^FFFt*~^?lW+Z<?`6zNx2|tURr{z?5M^yZZ8(GnjwM&W!%XQ)FFe^@z#*
zQ$m&JG?9(^j<eQ2-o_<SGH1%%sqPxCAHEx2<E&6wc4OC>ZB_O)r9aErjZ;_Nm1LbJ
z-lgiY^VzS-J2oo4UazIdJmZQ^e?;Dk?z9sRcKx1uqQ6sFAw}6h^>$I7e_NSf&HARd
zehG)%3{`AIOc-(>DtDYyG2l=rJN4k;W%ri&kDduG5AJz=PqI+3HMG`a`hW1C)&V8%
z{}b6K-%$0pY08XP!8SK1m6td9=F4d++rlT>*3Pk<5Mg7r&b#SGbKInz@{jJ=&i^g<
z#q`(`hI_h6I@eqm8))Ba@0_)CR&Vg8&AihYrc?wKypee3rj&l)`haK7dw&Jz1FrA7
zPd{8?bS@}2Roc#w-K@im|I*WC?t!t(dT#{ndSn-R=_~6(eMgmfVgDW~n&j->_<<{O
zqkGczSv3-+{pWv8kUaTn@1%d<KR$4(Q;M3x&1pGjTmMYU`Hx$7xScs_p}#5ls_Qf7
zGzak#R{1lG{(6&CKQipQFrlNy+s<egj}7lBj?nz0jMgf~66pmx70Wydlz9|SN}LWY
zm(Y<=&fww+nW?6|V`jnT3bz~)hPMeNDf`ryDD1dC-;DY3stExVHJdUU&av%m+abp$
zqruGlWY?kxH9TvMGRawP?krf(Rns$R^OIMuT02>jZ@hGPb#2WfKi2a;DU}I7Prcu-
zZ&~&KxO{8*<Eh>;nwiEu?}eUlnRPk~eyTqfu}S5zWZGW-gEz(2S(M7py?S)%WfAvn
z@t&QUH<=GV_<7{(Ud@=9nl?hhVzH@-H@|1Ra_4rxcCc4&!3~M)$$wg}v?NSEx%2yz
z!z+#FPPF5B{AJ~(R>RNYo0nhM=xnq__KnrcM`b6N*X?PG3E}v}QS%|%@|-w>%aqNZ
zv`<C;OyWpcpu`{6Ak1n}wdkSC^$$Okzg*b#^ibZ>Lw*(iVsZ|4EZ~|aaH?V1X0d<S
zLhLj49gaR-`>XkMM%K;~sXa|cqZ0%IF3)7;EipUZeKg)~2eY~C;tJ+Ef1k+4-LcvX
z(RvG#6p||!Min-2H&jO?JwDHr->!GtX*pxf8jn>fag%zyopKcQoS!WT6I<=md2qp9
z#R=c}<#v3S&^|RJ?CbZ>pQGw6UVXo?_y57S9P3@SaQCSl=yslQY(b^msiQg@vKL0J
zT2bq7c2Qx0i&37_)-O}au4_wq#dOwXKV&#Km48i?xVHVJAXf7u4_G$ZUR=I3Ba%Vf
zwa4IMqUzdMmnrrlk539~R=LG<A3o09qPg>$it^R9@;e?cjy9-yI_>_#m+~^)@4oL{
zZdr9*C2Gl1g)gtAxJ)PQx%Mp8==jNXb343a?Y6#Af9qvixmj_gz}u384F`T0ObR{}
zYvVfa@s!ezyF8CyirBGa7w4xP+`v88I_!axnR?afD}RI3+KuhYj=xx__)O(wXm^V4
zt**s0<!$P(OkU8Xy6$yEagl0_Pkrx#5AkPe`kh(-9b9pFK1cR!_ujPSlN(h6A5B<N
zFZo!~<9`O<;?EO1rp}zN%qQq$8rIfYxM<tE{H!J7dOtTywY&WD<gIa<xK*UN*vLMW
zulIMr45bqS3h7#t&V)?8aoAtEVA~Uh9NlG$#h)36o5eq^6!wXZpFH8QNZ8q@d%|~E
zh#03o+jUY!TW$K1@1mAlQ&ye4Zx}jJ!1;~BjhDv{tNdAQBe1zvs#-gfW9N}6?q4kT
z#y$&D&O2{&|Lb!9%oA-M;twYM5qY$Wy^qy6eQVJh=UocCOrJx%{N^?#otAoJ?3Ui4
zm+3#Jfk9Mz;p7|<dvz6)x2+E&lw-4|-%{EqoU^Lu=*Ne3A3{{QW>1T>NN?Mt{WyTt
zms3%->KwPpO~sq{(r)%nVrmOaZQr?i-;ued`F{5M_wM~WgH3HqgIM;a*Fno3n%dj%
zH`uMW+$fuQs%qvX2A$<gc79d4ymq%r{d7l7Ul#Z2)6);@Ok}vd<lzn_iMEwScQiJY
z8JM4uI_IRa^ia`Dn>{V&&ChEl`l@#Pi&c{FeEet9gSd(NzFfK>_j8~0KAkPy(OD;7
zWh5PYqyKh~zR+F>`l)oWZM|Op_NPDU^Z$n5|8IP+=0E?x?rmJZ>rHO{ueSgHR5$MZ
z@A~>z|L%9ah_GNwc>VW)Z@~NC&EEf$*6e)B_Ha{kYS~SNoIQ0-7xulp_oKMTep^;m
z-Qhd_)`dwg4_f9=|NSyu;?L_Rb+-yRZ_jnxWcE{gj@HLrPyGMiu2`v)`*NYx`r8^N
z({e@fDld8OE8g+me)p*@!J2WEB|Mk?7T<XJLSorm&yP)ulV_BDIl||D+~Dnp&gn9;
zhqoxJ#}$_F7?-%FwS7GVlCE%(1WAAC5bEnoycH<4TUPe)mdi?UbtOEPw=9g7mks{6
za7+HY|F6HsKYsh#e)G{Ys$b(@@BLTZe7*YbclGP_tJUuQPkn#?_N^0}Y7#%Z?@YHl
zk{3RI(iGK{*qt}t*6|;+@D*j_f8dk;{NoKp%?1x|u27c~4yE5~zC~`Y<z`hlAXa)S
zsN9m#_08*B+3R2D-*tSiou9Py{nS_0XIa1Q-E<&u_50ZGE*p2>JG^yo(#n0uFMg|f
zdhM?2tE!`Gx{hD{%C*DFe!{x&H7{SB{QddSzuu@g#-|y9^AF})#T&Y&EliVN@%t>}
zj7jgxCwrxa+L@o|N~(F}b5rJf#BP(_zFQYRj<NW&@mFy2fxx=wBC`c%*w4Q%^{QY|
z-OYa=M6Re${WxufnVX5r<9{!*dYe0c{9ON7r|*GQZqMN<O8!szHUBL<R##Q>%I|@s
zu+%d58o4yH34vdgkEkcDUvClZFU+&xu&G0gP05wCb(6n-xclznx0Ck{o`3aY`{T)X
zxBGFNIQQ^&dG+tz?l0nO=lME_&+ZmFc>ZR>fr-<YL*JUr>J9VVUofZVkVx3)TjDPc
zR)`!fT0Q@AK~>+!%xd>)d9k{Jz1{r#?pBxg^zZ3n%c?f9<xgC*e*U&~@4sAq*XOdZ
zX_8Ho_Lobw8!m`&EZ@=nEP0lJbj@Ry`+K6R|1T_gS`uHae}C26y_eFTa0X<iO;5c)
zTm4?$&Tlir-DPW>vL8q9T^>E#pWknedYqa_%CfS5pTxg<Z@;+v>BsFK6?`Xbx4nDt
z!>RqN;~()TKl$)={a&}t>-McPpS9g&Q*kL<$jbKqs=A+lGEDz3D!X5|AhV5G!THEP
zkD$`FKPp~dS1htQYVk~eCX?l3{Z<CfuAq6#6vPjH{CsGtr&r3oOh1m9y@ysS%=TS;
zr9a`=St;gxi=#5W=DRFQmAbB~oNP`qd0xI<SG4={z0(pQ4WYZc4OcMCEt5|UU=)Ar
zcWeREwVO@H792NG7Ww-BUh<RrvQvNdYyYj6oImy7{~N#l&$&_~es=$dPhQXUgAa+9
zek{um{ds!cj(yv!SO0Mp*>^nfC$~q((!6KySASZs|KLU3yi@!C9d7$3`cUdL>n3T_
zzf3=#9+G=>JLK=z>dJZI*T0_5npzU&nmWJqZ;{~iQ`63@{OOmMB7bb=Vm*iVS-!H9
zSFRIKI@j&~?{nn87}I%73+Eh5-)v%3FWnwrqO#HDk$P}T#*z?2w+GBulWmUrs5(`Z
zNj(f%>GDZ$ebf18v$@<75BHiY>)2%8*mr#TB))fIR}Z({eEcNftl?Sai=FEZJ4fw4
zAk&>xJ?FT{4f|v>b<NERt5qNWke|{ocrf+1s?+b*lk*S9tdeMaSMs~`OzM<395D;J
za=E58`N&W4doe5IL-d`AinYswpSsjr&1um4D^ikqbE(x{dEb4<GL07Qni|g<B4t)p
z|ND8e{$Vx#1k>x=lz;HH$vnIz@S<m~=32A8|5Pqb*gr%6_YoDJlMZo7_wHs|9QK)(
zWcT>i*PlHHM49@|sn0sRvnX#R??rt9jb*&AkML&d70h1To4R?zs$;z?0`;?7OXIJ2
zBr3WsxLQzSuh#nVic3b7ih;G&+Uc9Lee2epYdDjY7QSBNF2mv9$7jUZY`LkurTH7r
zO0GQnWp~&43O#F|sxa?>TwBSHnIHDHYg={CoZP+mp^uT4vBH4`6Ka+%pBXson8)PP
z(IM}w-)^m&b6(cnvt+4GD)(yMNms=ckK7cQ#&Pr1dHv9>e=qyb6+5He{_?TkLj{B5
zCj6G}vzLU=m25wAKJCI)=Go$>J=-gy4snXd$SQ8xzbYs_D^_vM>Mu$&g{_J$FKFJm
z&}bNR!tLY_)un+sU4f5zIvjZlOk>Wf2s~OguXWMuG{NHqdp5dT&UT)hDpM0z{q^P7
zd;i`oKYV?Cf4RTi-WKt=HRamBE{4qQJ7oMKX|}G8&~=Ao=d8o6I=A&+1*WeS*?m;e
zX?4cagU^{PHU99P;0-=@qHX<M8U48ndNSuasraQO9eDZC%Jj$Q(oiw2f+dpS4Bx7r
z+ss+iyRyAU?}F#bNlCg>woShrc;GNc@XV$@=N$|imZzl1FigDYbmK{?=MJ;%Nj^-E
z&X?t{j>t(Z2|X@*z3fU^^4?{aLoKHpAFru0RcU#tv*Obt@1*@zwV(QC@T_8*bYQ*D
zI^9X0y@{L!u5V{BTdk?}k>bAkfvZh$v#Ifvn=#XwwSITqoLIS_-7UQ3%i5b0wtE;e
zr@Y;MPUZBRmY|<0Di^xLY#WM9bVCy@W(ri#z4T*dKMV7PMs?AoZedZyIqS<S6{ThP
zuHJfSePMUwjBEee>_aX-;n>g1W;(ZAO`NN##WOiGg*{zTcg?KCg!UO7WmC^+X)e2a
zu=`xeredF+U*on+Vzb%&ZFAJ`b|+rnwW_V2|F3xXoKo5J$YrkU&dn`Oc_laInmb>X
z_O0zOXE@2c=kb=HQd8j#u3yuBPrvKWUU09!yua?|?VGmO_*m05JM>Z%r3!eo4p^ug
zDg{4TaU_0D@INCx)jVq*RzchKW~X>JJ*|0sI&qN@H(%%vZddbvsU|Z7?=*e9p76Oj
zMe4FImkCeo(qB6iqZ8~}6t>sA{&e?og6;~zYo7%trU)tSRa(*fZrZPdDj@<ZHq5m8
zGNbQg)1>)_uU3?;I}!2wQ^xNX+x_2f^S>7mWgzpi!F8SC8W*D}Djy4eh)!!~_?}oa
zuj6Ku`?rr9F2qg={FPYa<$e5!v0sGLoE6jLtoL2N_P%$qA!q&abCVsacUYxt<~-Ze
zoxNuB3z>%zr#)tETy%7Hm|)yhaii|-9}3Lawyl=#RNJC)g6aH8qrTb6MbEfrztYKJ
zmOfw=|9*yJjAp>rq?iK&!cyupVs!VmPdOcz;Py0l;%$-dvfq62Buic`<@oK+SSjW0
z^g4eR=h;=pN6xHhlXNs)5s(tDEWWZ+GelWJa2F%9DC69RDi2zC5`xbyO6*nZetLpW
zD5k+Q>XxQY(UfL^<UWf_ht8^e7Tf;I=FFyv%Yvf3m)0@wQuJg`y*)$Y;wOd4e>Is+
zFEBam`Vus8N#G^lz++h)Cl5YYkSxgTEO_9_Kh}k9%Y>d6s2Y6YOHK2ipu6OV#MIby
z-aWx?vcmtDOq$_&e8xG~Rb}@QFN$V*q;b9#^k7PAS9unG;r9MxC*&qiuvt0juK&52
zyHgw1^|)v&Up(dU<!_J6eHFzo8}C|guj~4^|LfD^|I4mhuNC?qU;Xrd^r7^p|Eo*>
z&o4M`z4Pyjxl^~VKl6Xv#s%BgfA`%}E6xA?n`rhon?8l@fpy>Y0w-usd8@@+5;sp_
z`_IE_#bVkvcV(PQ7dwQnnEUlC%PuF=ZPCdS<X^qlb~@0t|NO-4lc%4v+)?^`|6cv~
zwA<YKkM3Nw^7ZALni>t2$qZFX$~-4}@`yy1Ox#f0Iaeht`kIb`<k!$k>Qn62E{yW-
z+R@rH|N08<u3f&5IIR?XEKepHIbWXoEi}_3K<eg&KAyGzzL@i{F5AB$Gk#01Q>Iay
zPWgg)hC;d1a~ic|1xo5BJn5_csB?;4e1pucHA=ONr?!?HKcDb(%`u1G$q#$N&uZRe
z?Uyz-U*Elr|NF)H?&s8*6TGUwtWQd=VB5XDxMb6Pi#zo%Ee>qi8K=OqlGn`cRKbMf
zQr)&Q8y}rHFz0M*+`r&VKG&c1j|HFn?=7ot{r|~h{?tGJUwo>67_@h?+=IQlFR`Ce
z`Er)^YvU%3gS%fd&*s0*-X;1+&Rzb7j`-baEBHmU8mCF^n7*7pN0-U?hkcN|#<jXV
zYKo8CTo(j{eV(n!)Ou*$b;-H%TK~l-#=88|4{Xoba^H-tbH;*6;lF>cTYN#6KXGIE
z#y9s*Z_j>THs#p&WgA52O1HA!D!n&(_J<{l6L{{~b-vuS<$8h1uPgiZ?D=!$d79M!
zj^%Gub!z^X8XS24>WwV7){o;{O+JVJIuz{nn=pUpE%nWX_FlYfwp-7xcqi$4jfJf&
zzJx(IrG1w3sTbCgzn+|%%zZ`ag6;cbB?k_PHhnmCNF(+}WM8iF!UVq`y`hsm)-Oz$
zV|O%iMtq{+l!jAUVig8VZm)AMJ1*8=u(_pR4(r1s3f+gdZQ^^fO2+MCf$*JuWzx2r
zvl;oj8h^#h%4N42M0Y(3nDXCT-tpi2E!Nt<|0~yqefq!n^#5N%dnZ3QufJC1pOIuu
zwqxi1Gr<Mro%OE|3e_)<*z!G4<)7c?7`Ny}N8&Y@<6dz_&N^~GbJ}6I|L3Rwus(X|
z-1eo0_f>wC&wBdNl3(mE_t(4m#lbcqtS_dmW?09TlKTHJ=V8tnCW6iH4kk9}EE2mc
ze9dod#H^Iu$&CyCugJZl)A@hT=H$osKdy7EVG?Gn&CTUsb)?y}=@MsX)M@2r(<bGE
ziR`l$z0#VUs68`Y=%LB{bq9Y)O)fOcb~!8=dZWSKM%FEUzT4x|%j0MF>Iy7A*|^|-
z!)cpLm6wvXJ&)VWU#R}D-gm-O@WI>ta~kCy9X<NDIO^R0^qQ_u|F0>Z_`kPz(x3nD
zetG?iKa{Te-+tF0`|_ptJOwrO?7hUXZt}O&e;CTAf0O-lpt}3_(JGa*?vuXD-#&Cd
z^IP8c5*`10@hc`=`0r7<|Ei|?3F*e=`69of?;pQ+KXaY_v+jx&TkdO5|90AO&K{Qf
zHul|?j)i`_E4F22vDJ5}KfkCd`gD%35zE?ZZomAKcd$OZls)JF-%aaQy`44dTv5if
zeKp_nmK)0X_{!}InQc<}BZgt~t(Ae-PX39Gm@Xpr`MQDcV-?pUxmOp52Yk$6S<-xC
zO2yrMXP+J}Utp+u(t=Ib;CRV{Ij5r7r=0D~59alsEUw;Zdeh`kg8Fmq+}GRr7~>*N
z86P_$8{_0N=g!274>%HBUN}9NB4fR{Azfvvujb8@Y%)hBpC>4HE$oh6;mEom_EIuW
z!EINgl}|!krS^)wo*iG1a@z1(eY=0)zv-L*`~Kd+`k#A-tLLBd$GrZ<9|MKura$#(
zd8^rF7i?*rDi@%&ce_{#?;SqYZ5+S0U%tC{YOB-VSz#+9e*K-=>e?k#7oWN?G;d0s
zO6tPDhppIe-7RX`vu)cMrdNk-v)k`2)7?^4{w3K)fO*dhwF6m)d96Y$S#~%I8{G(0
zntUiUlgWqUd(%NdCf)GGZ|+D)yo^$Mu6txMr`yEtosE55;-x)}-ha4G{O`WPaCzS!
z-~XpxBrp3sG3DTYebXMt>cand^`2=vZA>Km-_G|Jlydz)>8bNaMuDE4XBVzu57j#5
zcOa5^j-2ZQWxbZLZEK=koHDagKmQ7^xw~%GpWZ~PC+kbszP4%AWz^+5xZ{6l+4Gy%
zKNL-Pru@h2o+=CHULP^*gE~|1iQl}g87l95g{isS`2_EV!1;GwSF)rjw;vGLV6&_3
z{?9k-!jEPy-|=*VZq<3q>&X)B>62BQ-%K`C>Qz|N-0(eSfslFc@?}pfO(iR;HCL%!
z>^owARi<jLw8oxhbqDw6n?8KU4isuQ9}9Q<^^obC=mMeUJJVP%oMu&gRNq_D-?4X+
z+Y+fo<=pYDmI9Ajr3Kl2!#!PjRhnBF`Wq%WT%G*sp+m^I+sFQ^zTlT&Z&$s0S>es;
z{^eOJI|ToCTw=M`u+8eiF-d{q5=&n-5li;P4;(BN;(K$CRVZxW)O=VVp|^nXB1>*>
zoS8tRO<p4VGmFRXmrF}Gs%=o3reGIgbLE50qhBXh|JvUhymj0CfNbTpPuBOU-Q@Up
zR%pV!k2lm--ahbBDfhtgt_5~0t?KF*@XeRI{_K`!?vv|*do5-ZCOWM0s;Jp|Akq6q
z*F&!xA)LXJ>}St^9x2r8Xd(13M^fm+;zA1xbru_5e`Vp-v+o*9dR$*TEA(2!0ab18
zKF)v#3YS(!N?1uvW<9Br8Q3Kn71ofpW80x;Qchc0|FVdQTL{@6+%v07&p_gVfm9F2
znImQ`&Wus&Ee={&+D>FTiuEVA_?esuZc{T+-<SSshO=etieJ|gZ5B!Eao&h)P80q8
zPvJ_KOtHCY)`Yf#pNE8<?y!Xk+>CYDQCu)XpzPhU)QOWf`##m|iETfy<JiRh%N%bP
zU-hY&xKFREo&ES}n*#@a-b@H;mwNErP>=D&#ElP`7z-Jhdn|kfjXL!5PM*GeqkqmS
z^N!;Olr3f79a`kKmv4sb%bhDPzi<+hoyPGoN2fM1+-|#g+C%w@Z5!4yZsr#}8@ya8
z?%3m-5zHPBAB8mD-c!3$z|^R_A(}s1%GJYe`6hKYHo<St8+djt&iHWhi0N@5RRg9!
zhQ<l*G22}-|4!+etDv<cuQ&eqXa5g@*;2<&R(pghbIY<!DYKGJbT;^7uhPB2fb)mM
zGfn2TDW@FrjtR$b<;;B2^@dAt?de%QsS{M<e|@l*@b0Jxxg7Y!JLYo7$Il;*d8vsx
z6xMOL++yO<47|{1pz!yg@yq2K&i#LTx}N=l^`)e+Ee4ObC(e^N<8MCUQH$OokspEK
zam~(_?g2%{l69@Kbs{ILB^*^<`+w<-mmbXX3r@b{&)#yWJp9)?uluo+_We$FkXdVI
zUi0ja{o2&u^|SW+<=g#ReLd=Fz5e6PpZ?oy`v3e|)1C4UEO#$mJEb1-YDuR43t=r?
z*=qjf0ly#mE%b9#%e3#CaHsOkq78G)@*4woJ@q^}SAMHj&hpFJ%TJUoUR~E$B$T-_
zs_~8(H^<4j?}KEvU5?xDzu`8st@BZqqHjERPyMcy7koHLdP~OkxVC%eEmya-9yzbH
z!|ZUNLdMNM<y)4VG3b|h?dsNKE^5g4IWtFl$E0u<oev!KB7)m$E|#{4sjjJLoNz6s
zUS-cAvGzc@rO8LUcR8G%_g2b1=S`R4O?};heIL0th%0nIi#vb1>tcdTxP?njYMIJ{
zgG{o5@3Ixc*bO!>U7o3v5x;IzqK^G_@8e%fZ@xKW->JJtE7f14hUaWj+*ao0Zye4p
zIo^LrM%!}B+l(eB-l;8fV{i1FOEfCGX4NxIcjfxOd;)UaAD;Vu^p6f~DKj`Z=MY~~
z=oZI<oXR;&j72eNhYmb5xL|aI>5~iRMV6*u|Jyki_+Gs*+}Yu#{73)s?CZ8W-tT-R
z{MF&SkHVQH^Vn`On-(_(Cj1p_)BC^Q^xnJqZ;hA#-#UH$|6G&jpZ`~{edYyfFfaXY
zyXjxJp4?sUzq@y?ocb+%Rqxc5IZJQFN4|JqyJi2m!&~>~IbPGdx_jULZ`XCFpP#<s
zZ|ODh52CvMzh9TthrC_CJI-(7TQ~o=TsD(dSa569-91+x_{U26d+`&SfUnw2>>FN{
zOW*!(y5CmdVDOj8$%1n)2fNJrE46X`Zj=2SPx3CTVvBeCvUpud7=J{Cx?}B`b$OGH
zZ0r(L?whNoye9ncy2J~wm)$g$V+?Dxx+J>#ho;P*^iN^?y&o4&37g;_ywobBZNm%U
zm@DzgJh2Mt#Rn?lSFBFl=q0SbAd&CEe_8W=Yah0*{rE!fobaXTX_GG($TUxy8Pz)d
z*5gSrEqZ2r=as&_NN+JZbD2TPsw>0i2Orx+hJy!IHT8M0u6GC%n31@0*YuToTdyal
z7B+m{^2}O(fr?3@XCv3u#I;Kp(*!+lo@<(IcVNSWFD5b>w#%GPSD&&zqgyn^F*(5e
zpzsf4W!GYp7T&KSOUvxUT9^vANVIWl9;`A^(0{<@Y!_h5^JS68k0#zt8ydNGwdJIq
z`{>V_?8?hi@}yzHWXWtr8{cURs{{Ue2?{D+fBdDX^-qC<dCDcH`29SaD+J!WT)Oph
za^uSPxod7ssH^VyV6&iVMvPnUTZzmirvs1vZxH{x^-yb>G;hh`+0%Tk*v!oE$=32r
z6<EK%Wap9US6ldZ{eS*t|G7(F_xI*)_xT_F^Z&GukuU4}*ZiN#;ZYv&^Vz+)%*v%v
z;gNRXE2o7&<Jr?b?RxEwY1g$+Tv_^q=YIU@*HgJ4dtdpqOPbrldiwIGU#sj_O}l<u
zWBG})WLb%ikrqs`X=PQr8rrVEt`p~7zq?Xj{Ry+^9;GlA?TYIf`|6HO4_#6cV3oFg
z0pG(#T+@}6+1*r*&dA)FJVE%zd(owu*ZS?+qtA1e`6~yw8`LtqmOF1G@XdYmi6nWI
z<TW4j4)PmKdH*ofN3lVA`+_AbVV;o+&wXC6cz4zDf`H78b<bCCWtlAKeD&JSkBma>
zzj!^9O|=~EvThK*+VI8xO!f?x`Q`R|tZnM*w?tn|d}iSgdoJ#aZlCk?L$`jghbcHt
z;#ldX^HTO%=IUAxi~k8zButNRKDd^6ss7T@$MatV|8QBk+&=QTI)~$n`FlTIpV;;9
zRcWxjE$@b^{H<btmUDJ3H~dp#b@uXep%A{cL3WLys%I<aZBFmKs_;0pIZg9S%_Q!?
zE1@#iugcfkJU>yZW46X``Nvd~ApMZl>(m~quDQ>BwN2jffb&a+dk0h0&*&7~Yhqvg
z=KDAIif{Iz%Wtk(UAB4Uzu%Vqlf)&Wn({?V`@_T|lq0xn^o}+wG&ct~?u^Zpiu=oV
zzxI#py`MkkJbqkx;ez|;ot<lrKfBoMacXv*Q@*IU`!v=KU2{uX>;D~T`Nk=}_E-9X
z)6aJtD*f7W$-W@{<4W~X*ZYN^O=pVj_hLCU`}34`&iJ<<!rySVzFfSJZMlkfVD8%W
zUmwS)bw^jUMVjp~QeE7AJUvwI`p4Oa7f<#t_<!QrmCBdgkBuK+h}t%%?fIO=CcMUF
zE4vr1jAYx)@iP9sQ4rIIy~m2JwZwMYJ1#a_HTmyhW{Hc!wST@;y)=7eru^un=cL15
zH?EGh?>rt@Sb6rt_c!NeeVplHALo^1rFb=i>96#;%U7;VzNF2mv+mb%c^~r+_wD;X
zJ$Kr;w*SZU{eO-w+jrq`;TitJ^>f=B`5x-OJNzRt=<nnH{{6=dFWK+;EN&I_Ws0TQ
zhu%EbzfZor6Eafgdz8nad0=Cjc87D+o~1h&d;&jg5eQgzlVN?2xBHbYXE${h_fpF@
z_g+5xX<|R^9jCBrfrF*tov4pFJBk;z=l)whkHhpx=bZU3{;f*0EJ)2bv#t4$?$S?*
z#^=60={~2j@f6F?MXO(J=6C*^KY7ZgF3An^Er0u$zx-i;wl{43k$;z?Zq`rx5P7p+
z?&iPXfVuAyet*0dbF<d#twE}5o%dV2)UdhLH)^Z+xBp%vzU9p&s~z|6zuO$QZjt`Q
zcb9L+D4a>GESvxJtNhh>oA*WfO?-Q-?Ur24Ocn9P85PGCJz_dG|LeVS!+&44y_0JG
z;IR9A)yliekBFq@+F76cqUGwt7+PyT^W3k+7S{c3*)w?j>)qmW#g@h^voNUE+wW}p
z>b>~GAraQ*Y61P7k7aa~3at0#%a~s||DtIA1Gj<~Yp1-MbS3x7+qUF@p2qg%z6u4Y
zdyXgkJh#d&{Scq<j=3yZ-v46nt3Ay9f;G#GmsxPLEf)B)bs;lXvb)-6i_YSRf7jZ2
zgb!LCJ@A>&`S50+=7c2^kC<Lr*>5%NN3TEYp(}UnnhX|t&b2w~@NC&Lz4r=nFIT9}
zaZ5>ecp@Ibroa$0ao4w9e7Zsz3Cm3zl`T3-*4sD-9nuRBoz?KA@r91!;mr^J8R|9q
zyt;bt<GFv|?%lqt%sJnpa`Wmw{`mQScGYfK{jKln?!|}Wzs0@X7c}*4@{hetJWrmS
zefV2=Ywd^GP3?W#`2FgF+t<JRzW=T4o>lC-KOA{CkttW|>Xf_TrCYy$yZcY>UqQu^
zKL2h0_vXvU{bj4SyK%Gre-?k~`{@@R9emh%>wfj_a;Cj=Wv(%=Z=Y;_Tm6*uo%Pkf
ze^>bKx3j6@KEL{L`EKj#_20|3O?=h=+G2r&)wQ#4-pV}=NZe+f|KR%D>D9lh)eQtJ
z4zOo<G%UNat!jI1$)@d}>*{}NRDA#U;_kzbdS>6e_S)ULTU+`=>>v04H?n)|nkK&A
z$Ew)4Ur#oV!Rd8%O`Dskd0M&C7OSVdKZ@&it}g5Edypt25b*OJqt4u0e_5*nkLPcD
z*xCH{ac)gceg5yK|MdL1!yaG#cKhx8^8WnjimzGkIV#xgmenuXdiP$tAe+Ij<Owqt
z82@R`Ec%`CUP3CwL#lnfW7S>Ty8ZP{^#`9W+Ii5TvTA>#GW!LCcRT{zX9P9Qt~<Ow
zzpS(Afvn7})42*tU;oLjo3G<58*O2E>)1v{-MJdC9thn3Rr<bSU+3QD{rl_>ty?(z
zyF+6&`-MlR?>Ck2c0X<)U&F&8Tjw10P3q8GU6XC~97`UViq5dilV{v{Lg~W0PgXLQ
zXC3(d{$uoyi;Ghtu0FoIIR0B%+1$@;vhViUH$?CFc*O9q@Ru+nx3Zb0Y`5m{?CNlA
zP&5;9KRhekf5M_Xnb@?30!0?F;&1&GyRKy|c;3i3|B;We`RSuFdh&m2KE(Z%@ilOF
z-+Op=B16_OhN(eYl7x+~h*{Q@9J#-9**6ES72lO5&K;5XyEJYgpWaSsspDP}v7C#w
z6H7P`y)bWlw4?o>efs~`x_AFwf4lY6qy1rD?Wcc?y!l`5=D+Y`Ti+$H%&D(U<=k`a
z#P{BSz1QXQp4`^BbARd4xBK_UZ2kD+VC?H?ZkL_9{_Af2NNnD1W_C(*(`AOYhfjWr
za9DQhhuy_k>9f0A=G$J_u{|*B&ThXWUl#9byLdfgiqA<N_PaqxeFN_<JLx(_$!4i1
zPvM1HeWx{FEqj>eZb%LiVmp~3@=dr`*t1;J)Vf!QOUV1-|MQ1D|MXvo3wNBMWTf+z
zJN$r$veJwNo2|<1j%sHcNVjIj&TWrZmTH{bAskb!-j(Tn<c8r={>(WcK8GxvL%&rB
zOrH0Pi+N?)1+mVLS_X~vE-yPy2_@b-@nV(SpVGGQm#0<!PKrs1f3&M=rjpgS#HR{}
z5?E@!iN2AEIk4jPqLae!T#g-@Dl*5><Seu7E;HG)=dLBxRr~W_HBg=Dc!AF;=F6Oe
z+y8FSzM5xJIg#V2*ta*E_e2Gzd+h31)38#Lr|;keiIYcfahS_gUn&j1C}icW&bU_f
z`1U}DfRoF@7axmUypB;?<C06X(gN-pjf9X;rh^6ZZdu=|)7@}Y=(gket5+lpS2va(
z5n&Pw(Bi$MbY{(lW3QBaRdSyEnB&lN-|ex=-bt*FU6<!_R7lSe|1v9Ro%q54k${AY
zB4=;B3GBN%iD~wV&%d6;&UIma_wdDs4=igpRx*{$vkbUVeSCe{jww@;SNHOK(7U9!
zH8W|)DyvoeEnc&-6P`sGA6<4XF)=_+HDZEsMR`@Ov_nCoqJ^cM$%^pXzgKyg>^;jN
z^ZQ}wlxsQKGZak@?H6QmpP(Kr?&2(d{Ss$Zys|3G@s&Zd0#bDE#k*W!l;8NOeS7}=
zcXIiM|NE7dzcN|U%;Cw?FPyW#TC3^vk2f{GM!OA^eR~&q&)OchtDuB!Q$<~#vU$3s
z@?xIJ3NzO@DrYb6$QSB=@S-d5<g;5dpV;2!6MCnTevdI_kJ`-yndr94nrx4w$~F#?
zFW6<Kh{g&XecT_?ucLA*?e{E(OUoXb$n_cc8OfY=l3gm*>hLDBi1BenyMeJrb@~Ob
zuP=T)ah~h5&A;BRZf`KR#-_`c-pjnbuqW~SSGli;dmaX-Jk@4guVbZltd?uB%Dscf
zt^3)YPyX><qVrkOG4aI8(hGV&t<p5z_xYX6%zhD~=*hV8_2-m{Gru~yFYkCGdtv1Z
z_sK6pl*%T4Zu|9Sxw6flqkGM2xutoYEP7P=pLhN0>5B_KEahM09s2f?=`-&Ti5ZE)
zVeHP*s-A6Zew&M=f@J*GU7!8zqQj}IcLI|8FZk|$nWJ*)I)@xv)}hyC0xaK5dp@U#
zDDf`wU*lD<{Hx2CZ{n8aUBZH27SFxj?yl~Bo1NqLJhfBNTc>aS!oA^~;y;FvjPNeU
z#m`r89e*%qsYv#}iEF1BE|>i$ncf)b5#?aIzu~t01HKF4I``M@S&;AOAmzCKVEklH
zj^DO{`Rwb3jyzepI@cmW;ct)ASF5?H%s2LM{FgYGeZ0`b?Wl}p+KD^%a=i;Cu3oXQ
zPx-;z?Ox038-zO3nm!oWJe~DM<jLC3yBCwU`nXKqusBcT&8Nd2_uGH)&AhwP$(8R<
z@uD3k7II(gn^qp`DsA~Ez<9&Ed+Yw1GBHUqJ`cBVH<VIbvu>SjMZudZ(N20+_w3gE
z7N77?vL<@6D9iT?J0~&knq>SeZO>}GCBNlF^;LQn@8am_S$Y1`9MK~kH@}{=eK<>5
zg<-!!X4aWfUh}1k&#ji>xAt{A8F^+Z%Mk;|H3>3ttXGn4INMV$D)MNWD=$zxbgz)l
zcGcU98cl`o8RiGxj(_mX)9>{G`wf$GZ~VErfiJrA?27$M6ZiMe+*!c9@Vw|upM)7c
zv443EotW@LJ1Xs1f$~0=zc0L*RCd}k-wLsQZYX!(roU9&+LLY0^DS~Rs<k3ZCT)>_
zTKe_+lNzR!FQSL%Uk$Wb5d3pi*#`#m=g$Rx-DYhoSz70pm=$Q-@c$X}9<dkvH(Zw7
zOE`PtWMrT8X6E~I8|6a7-=BLd_=h3L-bS?Fai6U<|M9O6wyRk8Hwrm#Ww%dJJhgWH
zqYeBb(~e1a{WtU3-%$3+^q6zmB%bzH`H5WTn_Zk9OE!s_^ZawW^y8z#$>OiuQwsQu
zZ%DQ}+&Un1S^p!8_;UVS-$TY#+P&;QZVRv`&nf?4cINYwN!wHom)1+iKAd!@q_JcD
zgB-`#l_gy@4727R_;uLf{;>`B*g2J$R~#1XDn6KK@72Cz#|3*Y)%Q+wK9+GkmOrHL
zaPY#b_=kK=x5cW?uYV=6ns>j${>~eR)ei2C{3RNx<^O_%O-kwUO-uiW(=5CUv?QhH
zswfNm6Y9}tV`AL+xuSq?4*xZ#V|u%}7r#4P|MBNZ16IjjKjg!cC%kwh@J;l^hpa_@
z4i3yum*_Da@HBaSIjt#fqN4P{B(V+J6$=uX6OJ5zZn)v&_lqhELmM;yN%dtM-X5rP
zBt9{R`IW*Pmi=v(XWxphxwrng;R(GBD*F$ud03x3i>v&PbVhW#hn(Ux*#P-8ox5@_
z6|JoQ8E?<Kf0=vxCb6|^T(z?=mTwXJyTjo}@xT3Fm;U~5_Mrarzx~fv{d;d@r~Uu_
z;$Q!}{si4U_|yFRyHlUTU#+_xVZi?2nMgxpd8XcthkO4v&u;x)`nXVKpKrCf`1AcH
zGxHzMYMAdn>8Dx!jT5WSo-La7#_Y<vb#uN+>6)=G%>1TyFn@D7Z{gj@E4OzQd)zp@
zr@44S-3wV4j_sCdaV3077k16qbN+#xvqp2Bl>2hmH8!QPVR0YkP57|nL*^@|V?PhR
ze|X&>?f3GHJ+d-#^A*g>A3R(bn784_;Tv+TVY*BX(r%R=rVk!<UU7F_eb;4A&=>Js
z{l$ulvU|DDL}t(a;_z?QwQFvhCoRmiIdUXsO_Zg|Wb?-l4L5E7micw@A12)ZseZi{
zRZq2(Gkk7&%3oHwz$81F|B(gT%U<6<CPHpo6eP^ze3u*FZ9MAnK3=e(_Ce{v3;YU;
zV^aNAHO^{l*3Y<Uyj61UqrD0mM}j8n&zulGZQ4iP>lS~wr7aC@nU>5kUw>~g|L3Mx
z7oRONlK&&=`!a}K;{U&&a}!t(gp01y&;GZmH}a<F$B17OnABP<=d5VnsyIRUp~9g(
zK1~+OC*PLZzA$U;Uakutxwn|JIR(Dm8vZ6~NuKl7#`~F(Y@6-cRQJ0HPh2;Bc6LBB
zgS=y4)82%%nez``IcmDq(}6u=ugI_bwUbv|$u$1OXe;>Q&DUKu?*Aj-Us7JaxaF&p
z-W<-TM;%!c9=T13Z^>d{5t}kmL#ns!$E5prefUo<IUT<7QiIw}lMBa1qff0g+dT8=
zygfmh^CZ5A&a=?q-%uP<G=oh&<d93#vh-NyU<Yos%@<GHcaiz3!g<5oW%jbp{Gz7^
zm@}G<-WUpriyCdMm}mFoNO747+tKnvSFS8r_ViDVph@ewOC9n?OWCX#-<$Rvu*;d?
zrt-c+>hkh{oRj~*)y;phqMrZTiQ2uZ?=L$wYrDW(j@;=iHIL7B-@a{k@8<1b^&@}p
zgaseFCYfY&G{<J4;pJ6M&VTq$Eqv%;;B&FZ|LtCuP}Zs)(ap7WCsh&!zqj0ONIR>?
zP!z}K)aZ0z@%v2^0{Fdtup9B+42X+piJ1H89c$ax2aXI`EwkBP%1TPk>DO`O)+$x+
zRehu}D{=8IH$x4li>f~I{|rtgJIZI}=b7DQ_P(LlvZk0de{#L{VjDx2R|})07z2$q
z9GMvFZxL=Y^Pk3?nv)yqwWh9~+r9hTjf_SAymplAyBV|j_7cHbfy-hga~W<vX0WvV
z9k2E1n(}wHDxY&IN13)?UpwLV_Ph5#ObXX$dH-Z(Qcn!aQO}i+R$5i;-_PHFP`N32
zp?u}Bd6BjvPwXbQ+%7zI;PraLd#aa1r=|z**=v5cROyAxBF#JTPXrFJHA(I=?2K^}
zye2qtmUc*vP4L;Ry8r(E$*SsOE0BHfV5ugl<1aEJZ-)I&=R<E-dqws~O+2$`|Ka<_
zkIsgiGMl2i{dYj^!mOC$>HLSp=JbVKKIHfC-Icv*h2|A&pDNl)-7}0-`0~T0MNNlC
z>b>fJCXN{<AGodM?wN-6s<oIp6>(IFH7xsY=WUTX>D`vPNj*vmHF8{`^$)Lxs{c6f
zTB^IWs-Ue`*p+j;Tf?Ky0-H>YWtK~~ta0GkwurC(?BT^uno0_VTT^+PL!UE!zb0zM
zbo0oea9^1-TCNwx#UF~g%hcSntq9dzqZ+&<?(LNcW;_`tXQcR|)x%S)od188d^#!X
zv-U^Ui9cU>i22RiYZiDarLJD*k6iJxC3!ycr<o}@#FuT5zIet#DLS%y#-49;gf|qN
zx)-<ScBIp>mj}!x9tl*2sPH&0RXm=)fZxV{shpsJ&tnTShSbc8hgDgdUt0)24Nv{G
zi_OwR%p#TdS!!40=U4oTH8tEDS%d=`l`Eun?EQH8-2Rha4wa|3dAL`+dh_bJT-lt{
zzx{P$d)BfXEL-7lUu>Iv6mJ;Y5oXy*3>gfo+n-pMI7Kx{o?NdHaPVo<U1J8}u$Dz^
zWqkLO($wreroER44$3Xxv9hA7DR_?2Y5thHlb!7st9p1l3O`*hs7sSdd&Fg1cvymE
z+r(*=MiU=Cxbc8@TU)t!jNQox+>cBz*JghgG3B@->cJ)zq*z&dAXh%+yl|b4(483T
zM|aEl{?AywS6KhKb)4UN=J@H^7c8frSyF0p^+R^~%tZ?8vJbZzcWb@tzU<o=IFtSE
z3i+0~+KQJVrs(=JDPPi9wEpoi`(l=T)2r3rf3rIvdeFz%IC`zW`?`s1=B@O-BJfIK
z{q?I-e>dM-s&M}19-~J8OZv~&325&BP`zRM?%mNlTwkqgbG*+#IdVP&=R=K2d%`Oe
zJv6<hE&L&Ev$6RtfAw(#eZCqKrEbAg-rdVjUiJOBHBENn*Mu_JUDI~u6>DUKCH@Vx
zoF;HvY@Yb9P0w@{H*$#_nV3G)PrC2Q%a(VFuYHS8|2KL5r(jccK~LsY{VUIf&y=iN
zp`~YWGM{mO^x?o={QK@$7t9xZ7;fL=o$X?9dPm1P6U&`n3O`llm;V>lTN3NMZ_STi
zNs`XfCRr6;Tm5#go6@g8lht2*J}}kPvE@$IORv)fSxK7@dQLc@(sC;Q)kJx@y+_MV
zYuu{-@b}=o&borCx~UV_=$*M*E91B3!|qv|`>)S#eDUvVuA}Q$k=Aa>kJl6ag>>JL
z2wo$@nSJO%^Z)O$kHx~m-b@v(PCfcBFYJxHc~;`rpJDTN{^;+0di{S!;*BF(|9=PC
zt^U#P-uqu;Z|N1o=X`e*#hx513oBGiO_ZAJ`q*hs!EJW7wj4VfgOt?@`*Q61Joc8(
zy|US5VpVZ=<BAtgJFi4b+pqH2yEW8r@?AG?S+AJGOq0G``(-|9$@W?0Tz+*CIwxYj
z^7pVFj4CrXDzn!+qBQBSz>U)#H*KDO%-GR3Rnxd%{LP-5x9h)h-aPYha{d3$^P^s$
zeST+w+59tWJ+|MBDQQ0ypZ{}x{><yQUrp^3JQ(TsMkQZ%QoQZ9yIXP(E!beVr!+73
zsJ~~%_B&w<WOa((&#(@erNYymCas@;o!={e``)tK#c$J|KhDUJs#BA$IlSZVnZ~l?
znfrTNd6YNLGw;20{n72%<x~5t<~*Gel(FJH)7dla3NL~ly=UPF={om7*}U{|@wT$_
zFPE+MD={lus4To!p6T<Bf?qolL;sv!yZ2og%kIpKvtM@h|6H^Fq<+z5mKwIJ_deXp
zUHvw4-kPHYVfv~Ef95MG-Mx@@+CJ#5@A|WSvX88%Bm{l!`s15nzh`CO{{>sO?{V90
zb9rL!ZQHD;ykc1<=6l(yv&6gA?^rByI_G~nJ0Z4tX6p8!n$;7YJ)E~f&eG!BWX8>R
zlFO!j$~W&_+i>@p+@jK>j;hCH_7w+f|5JRmqdmj<?FL@4)JjFJB`KcwV=ET?V|=xP
zJwtd)d-v}xFXvC~s}9?C#k-eb<|=auPA3l8>n8oP)vVL=4`k;rv=%!b@v{E^onQCo
z{7o;u`E7pL@~gLJZ2!L{{Hy)6kC8X)<$nIz&GbXIZ+C5O>RrvPTXS@??rIt{|6I_p
zwExb9hqb-dcfY0WoVPXRvETN)+T{~<&u_b&o2zTkvh-%zuD9}6w_VQ7zZ?E_|H*5Y
zbJtIQ|Nd;;jc6YGyJer>t+l)G>$29?e<EwO{8$BUvYzak5VYRN>>!WQ*GMIX(mzXu
z^Mz*2u;BT5;DGIfSOIm7sgEYN__Qa)@%*3k^I=mXoA_+*!`G7!A4tx~u;4eGzVqP~
zp)?QXhYQl0UN^10F=LUJvfTXe92E)IJxV-+*VQ@OH?mkOznH}~A^E`WT|!5+CG{Qe
zX6sn<y)X@k4WDHDIN{?1r;9(9p3_*|rC1U(DJf%;@XM3I4d0Hn)Tw{0;FR`a(hu{0
zbWhcxebM%33zqySm3?qFBa3ludfq96d9yWY?)da_HO+pY^kU|dH5zkWc3yJGxDhh-
z0mDO$=Z5R{BwV{Xg@2Q{!3nvN;I56~Zvw1l9AlZR@-w`0My+A;$xn%AZW;V(Ii@eb
zr4+sP`z*H1BURG{=dm?!lq{GqJ*Ii~!_Svh%zqRr9@?lNB6Mti(HjHz7Nu2-xwG2^
z0<Xxqib-$cGKsu+<0Hq<)7;gJ+|v9T)DDZ6^I6-mEN*);%V1ZC)5giuC0=<QjWCft
zS>l^v*q4%*TGUwlNW!erl`rq^m6;2CrQJAk%tA!DkAxrmV=H{RE#1j)|4|9!?#xxH
z^}Uy6G_QJxPClcQ)l)6YQL(~}$>jKfXCGTS?x?3p#pd6dsSwSp@x<@Ne8qn$c04t0
zYqF+YH}zE9^`Mon;VH-7O_5i1*U0EZ&iM9t&N)M6u2~<dxK(a&@EJx-XKQ9GIJ47Y
z+T8=4nFfwsE$imU?7hD>U_wz>xb*Xdo*MIX_aD?=FaFZ+b#jj3thuMOGWWgJ;WSyX
z@ZkslWv6l<T=bXac1zsEr+C6L`t5T6O4W^qksDIxY`VK6EmCEATdjX+s%pt3dDaa{
zr`)GKemQOH#j3f?f-l|X7pXDJKJII8%L>del#40U%;}vP&EU$z_R!?bab=5}A2wO$
z9C^sQG2n=1xW~c$#f7;ksi#7&@y$8I^eDhXCB*&u$?Z>bv?foTSp8uRBNK00ONivB
z8Jx0apH^4=H(WfM^R#oJTsQld_UX*mjs0)L`PZ)rdd2*-cmYrQlkl0VH@*{_bWl3n
zf5ozVYrn^{mIklcmR())QFU?(OL5J~r)$)lC-EP$ke#_Q;TgZ&S`o=*Ei-l<T;KZg
z3hx>9hh<#-ZD9qmlB+%j`30Dy+~ZOAV3y{VShseetb~>Mn`W;6uU6cfaC=qc!{ZBY
z@-Pbgz9v-lF4Adl@YCYdHUFM4d|}=6nyGZ=#vjffDmdINrg)2g7dXx9o_+GA)bWbv
zV&bAZ%Q{TYC^y9(TRl7IzX9Vm&yzvEN6UX^&Uk8-e3a!wa%#yA0na%GK?3V%8O)d-
zb1&wS<rf}ZE49<pq%1F;m@`esqwO+J|0O<^?_1aT)CruJYv66kH*@;zcc&U8)OpVz
zT9>Tnq_{P<UG#Iuvn3bmtu23kKlS6(l*sjeZU_H3ZQPl^ysp@9))Ety+x12Zvt!t+
zz1vo){8}*Kp+VAi;VA)2`BR>ic$_{sRrTuRlrucWvu4DzFQ4@{Mm-@*GUSNt&h8Hl
z0++8U3CSjLvqcK%te3Xe3wr!Ue!qMC&am>|i|6&t<QJP|wBpjt#*-=<ff-5#Q9>_G
ze@e|f_0X-V{L;xeEsZ{J>nt4iYE&%L3ekVN!>RVr{Q8@=LHZ%pc`vflIutj2e-jh>
z(C3`R;SI~q7C8Cx%}#W*72eB!UB}=Bo6f9D!a7rg&KvOVxN~*Of~SEG4qj@Rn)&=#
zjn}R38dluw;jB-kSvvl_yq+OaB@!(lTbR7Cw_(Hb{Yr+<FV5-FXKLJe)n$)DE7$Yg
zZQ>;d8g3UWi!eLB6zI)lIR1)P_&95if!wO^?!R{!BtDSUlDWS=FrI&HiOZ{5f(!Tm
z&Ffxf*leh%Gv8~sV@c<OcSWC{O7)sf{=I8K@G0+EHJQvzE$_}6J<MhCxR+p9xy+yC
zC|ic;NyiNhdgW#Pe9xY_+0}13zUAqQ+AlXdmRo#EeX41DAnyE*5Ooc$dyS8sQ_kQ0
zb8>kf@7zdF`HK1(hXuc`kX^rW%K9eBdpdpRS~(S>>ef8CEP5j%!ZTq>%>7GU&!T>H
z=p{cflH@Zz7Z7&bL{9IP=TzPgS6pQx6gIgZTbsai$Dq^5YyEBq>1v4sclo7aT)vfQ
zCs`lf-}(CQy~=ZW_txCXy2f={zDn1KU2N;|1Cv<Rrult%_-o^-c}se|-}T;6&9j>P
zFPi<HiS-iimAl%SCO6qR6fNku)}e9e<_Q~vlWV^iz08|a`8sm_)w*kJ4;$-e%-(Zs
z?S~^KuXGOlQM)61*ecq<K+!gX=b5Vpw?*LBMvI^MIsu!Frf)Qn^*FYvavT5lX_H@?
zEuXce`t_?x|E7j#7;Krf<X5`+dsF$Y{{4?1+B7-;b4soE|NN?beqGk;{VVQ2u%E{C
zrqiKYZk@-2xU+ichj;JJ%1>Lf<Y1A@*%LPpWU5&%O+RS+Fm5XAIu~{K^gEk;-cJ_v
zSKRP@r9*B=f?Y>QL(;A#{pr7U@X1d0<6-*6AbQjxB%)X~nQzC@r0KThOQL`HmR&lr
zqkGNQ-R8GnolpN+e06tX=JO?Tnh}B9YEDglvxl`rLOz-?!!nkE<>4jqOD3KVjofD%
z_JvQI^Qtsqm1WmO+i5RY|19(ipJ%Gb!P1Z|{=k&~DxW}$;}rF|Jxj0cY7SC(%CKUY
zrrxQC6IYmc&brEcpHIWxV~tSHP5r1(Ot%{wPF&^xdOu4)>TB8N-I4F7<#-nw*Tg8K
znYU%|Oq?1mx2jNi75kqFYKOL^M;cg#zI9v0Ez>aNl62p<;|5Jk2b(5v@<^n)uhA|t
zGA<P5xxjk9cP4l0A*bwE&y^zoM0WhqOrG|9gQnPJ<0nlAR(*&+Haqc4M}5Wa5~oG1
z>l#-$&k``&{-}Se*oL--@&zjnHah2rHoALE)}J`#z=;W`on9+<oA4I}&WXPob7#`*
zB|%$e+nmkFaq|=iYBCosy!5iNV+Gd%--qg7Cm&jH()4OhiQT_-`<>W6F!col|CPK|
z<@bNa_kT8r^rP>(O}@QF<yND$=L7#cYuDaBWxjTnY4?;2jj*ysS#B=#6a;rA8T(7W
zHku=RplWOE=TPyr{VaX#i*Bt{eC(PnEHBX>nBAsxdG&$IcW3SU&UCo`PEAs~<V)9!
zYq~nNwkKznzUFzT;K+Y9j+cKX$GnRX0rOUTT+$Q2d-(#njBiga{NiRg>D0rst?5AN
z?^6+fwyk`@`sj1SY5q{_^xF(Q?L3hgj`Jlv7aVa}u~Tm4!yGk{7e+R0Y`Q+@??1PR
z+LHXW(bYOza!+*H$5X-kK22F~^YrxBDfN?c9*6!pZ!Z}>yZis0D64<fn{U6d{5U`N
z<o~y89@$U-5P7uTuISHm-|2^CA33hiPZO1|(tUmZkJ+00PuAHsd@VOSb@|~moeO2V
z`t>f9tveZ7qtdwT^J1l^CDyZ_szgp(Sh<+v_D(nNsu>)&GpAnm^t|?wIoam+Qp0)M
zJ-=Q*urGUuYv(DK9~YATEdO>f+u8Hr(R&741y}liQOagsxlJ<CC-2Hf;V<h`nw&j1
z3RtbkY&vso*5o=@{j&$2<p!Nidcm%5H~Y@7FPhJmzp@N3HI2KoC+a}1irGn%OP<SE
zvm4krYd*jF+j~}h^PH%EvT`z>Z4Zv$Kk2KyvsOO;#S~qW@2`_5^jPS=fBZhPXkq=E
z<HBba{(hnG`&HWOQ@LB$ExEa?XjZCwm-U|md4aMQC0O-#<ps<%oZ%G1(eZC4pWulN
z`klwqCVV}>GwJt)MyVG!uQ;=a*PCp;7Vt{Liu>|Ij@Y$ole&Ld`s*oavA!)$lm6Q7
zqxReG*Txg)T*~BnPM043!6k9v6wmG4D_f_YEH3_>siRrBZ}V0Q`91rl<|)Sih)!Kq
z&aHX)zE$wv=o6Rs$1kheK4JO)xkguaw{H3Se%i`=x=-HMulD(xr?~ikbjqr7?nO_{
zPlmh~YiVXrUse7$xa_;n*Ln2^-pyZm@3a4v?I%Lsi(dNhe)`IL+D{(UxBGmJQ}hPu
z`_7g5i~n@Ue>u-r{kbibNBl4TQ{R5u{Ox10Kl{J(uK8+_{{Qv5H}&2>*1W0j&;9>7
z<;3oYKXb&x&GrTDj)`<V9^{-bbMuM>4xQ?hb%(DV=52hvx5zf}WZQwS-<Z~|c%RMj
zX05(K%Tr0F>$~k&DHhcJ^;`9tN$lWPzn|Cio@nnsYjETCj`GLd(p<NfwjD|`vykR`
zzJ|sBVQF-%b2x_r_k9DVmsL4jRtYEjZ$`|t@RvQ`cQ7d>sH?3}#W(OBx5q`HyMC_X
zujVi>e_Up9T4Bk9Zxsx4msU*I;%hq2U96|dcdH`n(xZ~+yi3b`ews(SUYzo$_|WAa
z&SpoJ`-@JCo^T;r=Ff@q`$MlLmPnm*t312U<H$OZ(3ZoDffgFeAMqSHlu~r|u&2>Z
zspL&pUQaGpo3KAos@SgDQoPV8^2a6NXKNKhZDzMcwuQg=Z|A>B=KrTH7d3J@bGO=v
zY$`mJoqfal>E2lrww~FimtL_k@?mb4db6{>bQ|aD>%l?A!GUT^1=^29=O0(;l(JBp
zEYKLq-@2wFSdnehv>9u<HwnJf$vL_8pVZR0cdeDK>46T%Wqfmterha{6mRV;?+S{a
zHv56~+;ah%Z}0i*oBMmjpZa1ZF1Bv7>KzqMze!rrWpmXg#!gmWcv)qN=VXoSWfLp|
zJ!W%E^_^58q<l)MYbJ+7%8^-eys~wbS$%pRr7BOU_`YUx`7zgSl|;b2R0S5kn|BqC
z7HkTfG57ERE&usNi?*yh+Hz^#IRUBUFwv(G36Y_G#WB;imeoG~eIxR^`Tm)6zs^6|
zV7UDM_GxneFTXUk{`|}S7R$bu8tZ<p`SO42zyBwG{eK(tGB2(1_O0khZm+4|zcpQB
zQa5{UmF@Ua*}SA8Kl|V@)9sfgt!0(oTO|HcXf5mO>lK;uC!;oeJbdh+_^XJ!Y8tu;
zx;G-??=bFfs7+X0+5SvyJ4eYWU8c1~-3O8;y$H^@y0UuJ!O{<&XO8&>t`=fhxkP{F
z*`nZ|S{AFf|A<Rws7g#O@Y{dE{xF+|L+|GLj%^p*bJRjyle}1+a?gt0dzu{-&1o>R
z_ke;>NTNW2+lAFkyB76cJ=AnJ@MYqu>(0#1cHX6O*Prm*@?Ep&(t{P6cNbjZT@?4p
zw8z~_IC@&rHFE=bse>;3lLA;A7KS9oMNE|rdfs(B$zXp>)b1juJ;xL-yvXfbx=$@B
zsF3%yT~mw8&w%XG=D;2;+0a9-d(DolIws61tZX2dKVLZOp^P~HWg}^`+UWI~X<XML
zVn5$IqI+hIYvY0kete7O98zFga50s4TStKJO%aj%He5PwOt$?yTR0A+KGaDGvnvvM
zBi{4o=~SU$zl2|jxkkY$b6%9)T6JoRBCCe6q|xJ|7gM=^p106kFn#8|ck2r^ygL&D
zU5u73)6iqu_Q~WFyMH0$BSt6LTXUbQePCW(F^hlMrhccXU*t^hHN3T08-Mv|O?Qvf
zq6Ll@*6AOzc+Tu=wsiT+f-@pl`qh10KV6H`xx3#lh-r0Kk)_O*4H-@c5<3)GwtqM&
z&a)}1`tv_o)p)<hiu+qLXZcGV%s<%^!E}53ibLApmvpjEn<(>+Eve<z;nms#Zw=hu
zXP=lo|4f6~>d7tX6Jt{?S8V=KYttndmB}=z++>YuOpT6L!7)ANcSS5h3dcVr@G0ii
ztiPIVD8Q6?w77eR*;4lu-v;MH?`#k6Ix?qJ>UEv8Lh<9zA_ZmB3XbL2%hXtUCq6KV
zjM$Y?a;sq1gYZLNdX`-6abikje&*vIapVV6n6zWRiR!Dvr{DWzn$;KG6O88CWFcMS
z8Qj+R(dvNGhua$rIP{Y4Ka1b!S8!#%V$`9`M-G=CJnEmc*{GVoX4Wg#b^QA+^Buq1
z>sD0A_&@rXQ*%~0x2CD*+;y7^2iXsKXEl{~PQQ8~W<Ha*|KrV)QV&kpW$|p@+_T`x
z38BpYTs1TNEj+$$UYW{rqG{RA&kAdpo}J;Fe5lbS%*e?_uSLJP{oIWoOLn%GORrn`
zc6KG(P4D*eO!Mq{pWXC7Zx(gl?AG~hX9Iq`_ut?4@^a2BmBq_HvD@5VzJYJzo_fa%
zkp(+WSh!u6Y&Sla6wr45!G|#OsM4($*UdEfR@}n2`MRWObBKdLR*BC~6SJn)XU*zK
zR_1fR8UMN{t$NVuV28$s5+4hrU;Z0roqP0RUb)3}3HeKpdpX0WNy*kX+OK*fboa~M
z%QZGn-?Km85R#Rgy!ek~-HULk(vOXgKK$(ew@7OCR@Od~4?;h-7>Bd6&)jf0<Cw#e
z#~-+v-Cb3hErj(2ej6lOdd+xz_VlL`tJkkrs*4w0w4Ho$itXyd{fGBVdU&;0^^NMU
zXy)q+mq_$F@AxxcQ_0b0aY@^Y65lrw%o9bP_?a(aa^7WYc;5El?0=lRk2+@@>#c6g
z4rH%&V{?f%x>xhWA(Lk^ThxB(E(ObtPyhGsv0-v!-+u3c%N}KhIEUjA3O~*yElN1p
zuM!;Y7gF$glB;w@`?;8OtIy?ga_(q4Kani=X47GAUijR9uE*8JZ^s4Rtv46Ta#7LF
z{WV|wuR{=L#0-vilb`JidLRDkuh-uHb+7)eYWg<k|MI;h|NVF0ys6RoKWE(^d+#4>
z{@DL#`8S_+&++mv40mrmI>lbHwtD&3-aFQF+jp0naUbNFdwk-5v)%oA|8wIe+kN-=
zbpILuY|(u?BmE{_f5v=I<9BY{;>bI}-)`sJRS)`l&~Dy0Q@eSti<^3;KfiI9Jxx?}
z@ftSOhtoP;!UI)>d^S0+`M5?dBHB;$mVr6P_V9|d;sVyD`XaSuOCNAA3M>w|{#-C-
zhv*TxrGE<L+=^Che6qpq(8<aY*Rw?*B*k@Cep}C!+xKPB;}h!@I9>#OXWA#J%~zw^
zU@hAB>2pe%TUf{H1q_}tn}6w>y_AR*s}1-W>AihLX-rJ(ZjMcprhe7tQ2ZjlrXgLY
z<?*LZ=^riYLr!w_rgPNKewG<)yHVqU|Erv($D|lGulW|^V^U^+V$#2vfzxhodh}lR
z&f0>=peq`?9krgH^^*OU8~V!e=^kJE@(1@d<V{{FJl`<gW6efk)0w@$BNWuFdgo43
zVVf*$rfX5RxpvF%SC?<U<v+gLesxyMRauVt1+wzjZ!gt8A+Sp4Xr0nlwz|8Fxvd|=
zr#bcbA7)H`y4YP{^-7gmfz8aH=k~cTt5tn+<noKA8qYlpTPm4?6edsl@j^#oW!Jv0
z;JBl^7=6tr+)X-TJy-F=vKet*5{wTyY<0rLv=1D9^)20X#ast@p7MyOZ!0~_Z>qm}
zUAF0Fg_CQ&()<dp7fd-tLjLasIfVDiy`B3eC|3Q)(+>&%&C6D`JbJdcAWJVnXpe8l
zAE#sYuRZ6#{V3S~;f-aIuRJ9BH|Rt>X5cNB_!he+j_s`PQnni!k~NCSHV+++`^}zl
zCZE06HpSE_eyOVJlJfk$U+R*&V{|;us#V%F?R|cT<Inn;r!+1Kp5{xi$TiQ~%$(eL
z^vEO6Idk2e)ibPh+%x%W_C>naTO9nGRQ`ke`U9gj52duWPgh<%I<qiqkGhF_)lXq@
zFGJRO64p`nhw6VH39c-!n<`jh^f&aG0qeH@4ngNQv2P37Bj4rdO?vfG^V_#CUqtSm
zmCjmMI(70zDaXv;Op&?eoY&=K!>*m1^+8biS>LrQlA#9#X1zHb$C>T-t6t&MM^}%D
z#~KsrxO^jwCak@sH^*$>91bb@zH1zzwz46*Ki14Qt`Lz>{G_2*WX{ubF-myl>gs?8
zdnDiJ$O)>k7MQ9uoKLy5Tx~wPnaC`w!0hLubACs%Ebo@7JkhlyhUvIn^41x5PiGw9
zIQfH*mv!Yd0kdVl^cL;-b;E+?Vn+R8Q`w5|PBtPErOzKd?#O;G_k9+Z$}#!5V*fsz
zu72k0eCOND+x`J}n$LeMnV|XgchrxKMfRJ&d996HX{x>Tne}SZ`$x9zo%H{I`|1D1
z-~ONb^x1ybYt<k8Z>NF}@c8@x;@khl*H6#Q`P;fZyzFmKbj|i73H9gi^c|g`u#4aP
zU%sfzq<4=!PDZnSIp^-sbYqX&vj-EGJXtGm_9Hoa^&FMciGRcdrfgq#@W&4|2Z89b
zzgt$>h%hhe5YxWb5TtsDy~*I?SCg9-#)=hj2WFq!v251jjNccozAOE3E7)Ax$@lP|
zIgE~__x4Qj`&%>1-*MWXo|2G<>UN7;qByryD<xm?U%5`XbPq>mu%wBt{pBN?QLg*{
zbBAs>-(Tdq=#g{GtP{%d60=0~wDu)_4p}pGeM7|SYj!%<D#Al$=V)}kGrgd8;>1(^
zI{QT)$wFKl{$&PS$Ah@lI}MHg#b?bimG@i6l<c%E@K?)KFVW{46SIO31ok$W_&!!K
zRjn@3ESu99?fOALwWC|Yw=eHX@}p_I-+gXI&drU8+A6qP<>{>lAp-6b%VzI$=;b{q
zsdK1(o{s|af#5|`G%uQM7b#t;_5aYe9TOgB9-dfLzu|kM-j@Q08(Siq4nJ24Z!t|W
z?8trB<>hSjX3|EhSp_RA*39&2-7OeWW+Q67#^JHjr#B3r83Vd_G#MKNxK1qd;S{~W
z&c`O=aAZ}({^SE%+ZZRmJ8W{y{EBtfjm<Bw%)e@SyL77-`x@r%SBqk&*A)F~JaDaH
z*`@Qle&mb&tWM!hux!6OC6)Ub7tdwpr%SmnhUB*&zoo}xy<oxB?Cc#%XI$oZTAEo!
z%E;9&_1@2^&*fD9sqdrB^$S7@*@vfx7#UAI^{CA6=9@1j`>t#-o&V4!yx`4z>HmQT
z8{f~JmC9&Y<78R5>%i>0EHYgiH%~Hch!WM{j_om=^OW<_tA-n?ViTpD0&kt;Vfub$
z)Bfhr(l^fH%Qn|sW|*B2CmA-A{hy~!>uI@LztVzo1+3&$PfpKS7eD#(vx4spA11xt
z;4ZRq&hkCqINwS<=k;OxcdqDX*~Tqbc$@k|!d8oUt)AF<FUSAvgM$f`C38Af-anyf
zdhGvEKQ_j<4}UuxTM?U8xbAM-jxQ0ebxR_r{hxPmmE!q$6GiL(5|-F`>dN=ta{tiW
zw6x=7@{=&`r?*c&{N^%`O)e^Qvxd-_nWt?8{(PNP#`L18XZhwSGx%0kpX6X%zc!nH
zo7HDCD}m)wA6pN5rbx&Iy3etkDU#-*f93gBt{fKeU2UypUa^aJ&(mI|8}l*hr|5d-
z<u|rYHdeWRyXe{u@z39tugNS~Be~NnPoezH)T%8a=N{a1%G7AOFl{E^Y3)Vv=eJ6H
zlU_2NCs;|-bkc7<vFo8H6AZkKy?IZ5@!G88sLrJ!%KO~j{thQkf!Twg=RT>&eyTUG
zN>hjmTzE%u+KVS49!4fXn;vaYt9e#pqHHl|#)L|*>$V2V{P#Y1!YuRZ@S@euUf-4m
z8_n5XBjvArX4MIOr5tv>LuVvcR3{%Q6iQPxWjK3k^K;qDyEy*dDpS<vPcGd2<HHpv
zd)?(%vK3q&&v7fNJCvMjsrJyt<67mh`=)yuzw}I*DQI(PTIE62ynLDP4No4fS^0mG
z-1TQUt1~*3+%xTcw!Szs(eUGx$5F>>51n7+di~^zXB)OM%Q4DsSajp<g}X0T{#&fQ
z<IZ{RZI|AM|N85-KYm-?ey^V&?27-*e|PDx{odZV?5F=Lmz+QK|MQD~^LJmj-#NMY
z#k#ZWZ9JCp&AqosZi&%_kH0G>RPldP_&Tfg^`7q<LTT%Fa!mMMKGmT5>@z08bnnRq
z)o0Jjha7sdb=Fgr%GlOrw^Pr=eg0Q*fBUH!d(&R8D@^47Dqni)ulx7alTu}UZVPu`
zjovb|)Acs<;TdfbQ%mFmFT9G#VPCxZz@natIN`7vH&YH?OI7b|nAmT6rm!dQsD!ic
zjsr=C#%bQne{<ftW!$@%wcXTk!_=Uj2{~0_o6X|(WIRo0zF)enRxYl<@7c>Up7jq(
zO=mJmZJHHubfcGGoaeFDkmbvnb64&<W;8FMz%<(N;=M!qKbM(yiMxNERm5A>Byw!&
zT)(Be;%CLom@g>mqopBvI{iV5YqHk?5yu64z9w7miB34VS!r^pt_D+b`my^dZ~SxC
zsi*Mf{?fly+}z08xv;Fj{AkUyo%RCyx2^76@Mc}xZEDobq$cKfWJX8vao1ydh25Q{
z+;jCJ{R~oH?3!`>_p^=HPW~}r_WJl&_Fp8&oXrdJthkx_gKV-4emHz<i(B=_o0Yez
zmgkPOY-{?lrzVfHCj6WC(s`M<p5Bl6k29xzn;iCWyV>7mpFN+2-z~JN{dRBNhQHTl
zz4!I={BYAOM)NDv433)Im*4*yykX$wx>mjIefMLw9}<&Uj-8zUj7cuOsE4^Ja(XCp
z(#c614W?CjnqCo#E=l{d$;piIYM?8#iJF$6fYJnikNpSR6j-xfRJ5IXY&$<tkMje^
zvbPQV8ceRSDRaV@o=>q!Vv%++jW^cfm?bS==HeEzitYM-t}i>;wD^-xH6+<h$W-3@
zoW1b)qSFPFQs*t)GH2!IGAU-=)IBZ=`aIq4hfS29d#*Z@RrOrb&3WFU58|_ArQ1vY
zo)c)F#n=63$pxu%Vv*cu_ia$MNxXH{VU>hL_-TnBp*FHJmn^-qC-slB-gf1Z#TPl=
zUPuvPzciiUiPMs!F4s6DSFF2fow7&a)1ycCcg)Fi=&K3vnBOTG(R`UbF_MGb?9Aqr
zf5lnmvODF|6&yD&_RvsE=#pIU|5jX)=c~Q13eppjr<FX3Rhn~*ck!(I0-N{VVcFTg
zr(0vfBZY;<iWh%LTR!^5H<RsdckGMnJ5y9=zuu*0vpntK)K@zc3ho>%oxbVtO@ZTE
z<WC;WZ=3hxMR!rUa@>~m$u3#C7xrbZ2|Io=&9i^8d;rHMmWD+sf);l=Z36w4P5l;~
z)%Nh*!C3!CSDxITAbz<c?rX5}*S~Lj!>e`cS8>#H=$zL0aq?y0UP~qQoqG<?dC+jk
zBg5w2-^=|cxN{;*V)^~%W<{ufEO2c+{piH&bTiS@_f)3*n;}>=t7YHq-<C!Xy}p&y
zi3P-DZB@LN*)m=Gh;(TEs?aO5yq6rk!C2;aEbQKuCvPoZT}|JAw`<8kwm0i$iQM_J
z%#F`GsObEp?PYNnc=LFZcHW*cH=cVkf7j+sljrlBeo*BQlbf?lJIejSJa=Zc?x`#O
z{+!$`ywc(I&1b51itF01O1F44t`o?3dVTjg->dQJk<zlC9XbyxpPC|lPJ=b-(AtU)
zw=Ct9AlbV~PxLu;Km6qIDVp$E^I*otBW%Y{II@*ms*AkPnKU^$X!+6&Ar7h?60`i8
z_n#7WI&Wpvyhvt)Ma8+@s{(Ca{^O0gc&gV`d(zgHg;T#P9?U%Az%p0jCPU#mi|^<A
z_Z-@8|NPG;v4)ffKC4u&9PbD&P`O+%srT_7lW%GT`VN!cvCQA_rR-s6<|5a9Rbo#Y
ze>^DM>A|7mD7KN`_@IkO!5haZMYG<{*iafckNf1GlUgd=6I|oobm<<b=)S)AQsJx~
zZ^;znZ|(7c$J9@T&MMimUivW0!i#_6{9aG>EKCiGnJF?oC+N>Sz1Noi^Yedxoo~JL
zXZ_r%|I0b&PyPS>;@|zLHeFv2%g(-0(2&VkUjFai%C}RWZ$Be=J939!NaUo4wKn@-
z^MC)djl2BOug4vkYqQ^7RPD-KdyOe@+G*j-QPK9RW?ajgI$34oO1IOeLfewxHh<dQ
zu;JRRKYfRyR@e4-oM_+Gu=}ar1M4`EegCI_-0<g%(e<n|^UR$N8g#_)ePO+6&zxJI
zTF%sa#J5xF{mr?5j<0hRZ#R2?^zyB3FAdHy<ua!(;qKgdd_vuoI^mBOm-N_ve|EJx
z*eK%rfqgp{l<-L<pD|Uewv4_s!O&>NAI08OcQt84<p~o*;+KS&YPOUm_++e}68JK4
z$4b4wGmo|(67evdouH|Z8`|3LR(1ZL;8M@Bw>>4E(+U=C>o5QIO(bsCwPIdw7v)7?
zc4yges${NAtC4$CymaA78;2WG2kJ{QpQy;TAKU9wE7B%--ZEfX2=|WbdH36&Cg`#F
zy!;h)V8QGkZ}TeNZoB$T$N!pu!SkR^;s4Y`3W8^|8mxk?)+q`4+GSMZD7J6oMJB$B
z)2?SsPq*5XyZg+>J&yO^UCOND{dPrfmUX_&M18@Ms5s`=YU_XezUCcw^8c>4mVfJO
zUw*uQH!Q#P|L2JLQ~&+{@%;a{*)Q_a|84sgR#mt1*4~XP=EaL~#c2oxd^^D_doTL@
z`<yA>O5WE#Ti<2f<8(j#e15*3LCe#ZKj+GedTzdcvt~j;&Ei$}U*5fZwRrZd`}>Zq
zt@J+3zgFgg?s~qx3-TU?w{Po`$SjGvJ$bt4!Nq5ag|}-NC_me3pmFijogbI>zy0@3
z`@)i{M*F{;_WrL6w`JA)`%SkXlhdGAZ)J-5&sqK(jpm!^pEA{a$MmOhuJAt_XT=TM
zycp&?p15%GvP!q)=O`!H4f_mZSF7LF*WJa#{x|U79uI~O)f1vK0<Rr1w8-c>@a3Cp
zVB*=F53w`(SFF3p;nHoewZr?<4(p7|Vh8UpShrR_O?IA=CR5C*j}ixi+xM6lF1$WN
zBA3TVw#TVQafwrNcx&z9awhRf9O|Y^owiT45B=llVKd9|{}o<e&s-h}lc;<)slWw+
z0*^%c4bJCW@N?{*UbL(2o{8xM&h{|w-SS5tM=<!9-_<=-pr-ffEW^LW+Fk!;T`g<(
z?)@fTYRWQGfbBxe?NzsvR)hz;MM@RTeU#JSCVRW!K|omS&I7kE?vUp#EX};0xc+;i
zU69ek7jdl1?)rpG-p793#2`p-nk75aQnQ5l-&CvmZ}W3qleuSkO#RX|z4f(AbhrhT
zZ-?<eVVTJw-LmFG*d_D*f%;DWSJ`u^$E*CC(RW>?Ke&?3H$zHK>++26n_i|Rgl=RC
za&EMau`4&bc6x!jWYI#lhszp$Kdo#zFBZ)4PE7J-LHn19Ps4AXb4?9=QzCe`#VKn;
z&PxV=QMb4A0>xZf_9sm_r?G2G{jtR=^@r7u7^L-cn4jp_5#u|{iT(GEsGc*9PvtEb
zzP~r-`o8&!+3X&c`JN2@u?rR}F28@~(VLjtD!x_i!D3bh!l_{^LUvzF`Jp3Y__3Gk
z&q}2UQCGZtXY}8j{8_*|@xsi6E%#rgm`Pn_c^SUqcmU_;qQ1OI2KRf+Ewv?5=I>b`
zwO-GP{hz1&adrRs5{nkf^0o=eSMGgz+$Pi3FY<Yyk>zCz)z@;C;Tt0x4aCF_Cax~|
z=Qpv@O7Nnpc}TBW(}vYWOY(%>Qx{CwP`p>NWS07zk3~(pI|5^ZzFqTfJmf6ovHl9f
ze5L;rivOLR`X$rp;>SRCE{y}K{p!ZCvn(%HACOd7@%)YKp8IQGbYAT(ywT>i>-&d)
z4-cL%Soc6~-3=q%cPcYEek^-<?h&VBaQK7VyK{r4O18NtvBXASGg^J1_ubp|R)=Ny
z=5$6+I&!Nf)=p*m<d+Wbg?kvSb_Vt2@p@INC(Ju(k>}I!&D1xWqdoW0(biVc9sUnK
z$?=Js&uRDi@antotJ&pyrDZI|-S|B2aGtrku1%+j+vG`<EL+1#<)XYz3(GniCtqaX
z41U1so#$OFkm^(VHSPV6Cm&vH-xb-ttL10#f#jE=2K7%9me*`aHT=V5kl*3Fey@|<
zmpZ1+EB94?-IwP5!oXZ}m)e@^N7iYZboB95sb1Ua*>+K-@Q&y4>iqj}lNZi<!2IG<
zfdv1bi(aQ(Rxg_`qN&c(X)C83|8;l9i{}M<j+|o=wtI5PrYKSB)a*0fM!d40-kmnT
zV;C-In7q~S@TK)9XIz|Fbiu9eDX-WQ+sO@!JZ~1pc`~y&gp?#@diywJ_o(0WsJ79c
zY#QQWTl{OfZ~pZ+IxARqur$x}O!HWD@j%Yxqf?i4Uv`OpyxmRZQMJ(%7e~h<OA<=l
zzLy*9=BPgV?cnN~{TD7zU7MWxI^w34-05o@5BdI*|2gyX|6Cp0f8zf_g8uK`yYJI~
z-G`e${r@Zc<A2^Bjdw48?_Rie>izXsc(?CdaX<gB^v}O$^6$RC&YR}Wts5!!E>3x|
zPN3Mk99@Bzdu$?i{9c^Y{%uz@KX=0JK#6zj>eUl>RQoRY;}m$3zwG~1alUwm;tlKe
z+n$$wP${7y9>HVi|L@C@mB$q%_eDy0uiUvnXcpgM#b>FjW4|a>t(W|3-@9OYW2uoR
z=Wd6d4<XtgCaq1{b>(y96y;q;9}2!YZS~1b%=K29t~yKk-kz%UwwgU6^Oj^C7O^Wm
zc<p4<$IllZ{x0vk>U8GG!Pk2iKNeQKTzJ;;%EZWZmA^%A{+76)u;R#MN3YV1$y+|f
zeB8}vW4Um`;u|N9@m2hmD7*2+P4i*Mx6pu^GmAW0HfP>*vz(n1%X`aV=h2SNdBSVF
zmMsVrhz#yM9Ku(e;5_Z)Z{aELnT|`HK5STgc=^f<<J9oo)6%Lw`)^2Aug)+3`2Bjj
zd;Z7o*R;RiUi?=0|Lxe`^S(Rp&gu5`-~Q^4$UpJ={LQ^R|E`&R(`Q*cD^q?(>G?uQ
zR+fg9_f3vvyMJ9((zB(|VdmyQJqKGkGXb4$*<Cy{+h6m=KK^k$L}<7CH^&XG+b^+J
z8l9LkfAatD@m&kgcWa)z|MuVf%m2-$%l*HZl~?lo>;7wA|D%tkFa7^l_(i=rw|jXA
zLw;7yQpRaoDXEb&mr5l>cD$%HIk2`pyJ7FzPgnX>vm5qivwT*~YS{aXsczxZ%!a-4
zVjanQEC1&#mfpJm-m&sa|Ekuu|IC+L!%(&^kRd;Ox-73i%C(0ROlKs$nAhjxcr!%i
ztijwL**0?y`epo!|Nb<GPjtxyfgODR8F@>3UYVL4o)G3d*J(wv22&tcuA$vxheNf0
z@|h!^*N6XiPm+KA>i?XjCv$$~`@ejz6ZAUWAz|8n>qJ@6%FRjbNrx;V1TS4>F!hRe
ze*2V1;&j$rAO7iH0-DJ>eACr~nNK{|*xG8qC?jvVk@<UM?~79(S=*)h&*-SE;V<vA
z+PUKx^LJIIACEN_b}&?LmTq^P5b?!KT;=jBrJQY@)*niv>r`eRvRCst+5PUsDW~*j
zqHlIe@N*?DvMniFBKP71`^@)?cn?1IGwyBZ5%{x;b9&~iJNF7*Sl|C%%;M3@6lwIQ
zZ{GPV-mla4@jt1K{TV!~d1}F-4FU;YlOApN5KQ`0@qlm6!`lJBmmf-3v!7-rG+nmp
z((~5Ce|GTlY)PCFeLih*@;RfcL0cy5k<+!6$Pt_xw|d6snVjb?X>vA6aG3QR^HkkX
zD7GL!X<f<(bu*tA_c@<!>a>_w@M3n$9jOPF#UC4GPi@V(Q`Tg%gYS9hZN;rwSr*d$
z>#taEd9WpW(<zH@THjWtFMjLzZbnj{?aVV7yXHn+Sb0-_^(L+j%kC`sUlQ#sJ>RAI
zbEn=Hi{3-}B4)E*^G>-SGvnmxz0H%~PXE2zW@0J#s@=I8g*P*tbe33_wyx!c$N5b&
z4{SUAus((JK|rdJh)<JNJA=^L{3}<}Voe_eZ{~c+a=LAcc$GNsB856$_lo1ESJwDi
ztakY#a<}VoOY>qy0q>wsx^rYMPf5M=m4R3D7>m2E$)}YMs$Z>e6rQ8!rq=xO&53W{
zyB|k-uG2nQs=Cu|-IHBi&mwDI7^nZg8&&tme|6-f|NA%n*L%8o)Bk_MH|p2#Pk5K{
zd+)l1Q}1pUxw(Glio4r&TwchP#V<cxeY@7YCh%xx(aKAof0;I&6<YfI>oq333r{`I
zzqZ%ebl(j$w(GDkZ_2dm>rZA^Y}m5rUR^@YrDoo}ce8o+n!gsSYumq7;-c~{fon6?
z2hQFjnr3zQ{(8RBO~1e0{rBzUx~he7@8sY8@%^j!Ki5R+RkFkR1MUC6IsH|?Y4*?i
zjm-bteb4X5ulRr1zM^-<|IO7OPT8zn(JF2x{IZ<&Okud(U;p3V|6l6;D{jj0|E6ut
z+me&(_cnYlmAm`?!)^B;`|pb`7k})}*5ly+jQMNJeA6G1IZHTR^|M`_W~lt^qs6Hg
ztP(<B{?7iDU&XlZfA7CP)_*=-+~RCnaYI36o4VeH<KL#(%<P-26TbLGw#lmB*DCHU
zIP*5DeyMJs{>%N1J)uIuC%cYyR-aONcU9zOOU7L(57(Tw<!v(3aSL)Qbi0-=it}GP
z@yhm?wBi#r+P)v^zb#+!pY!v-Wwmz}{V(0UchisgqW^vy*=hfMKi}d1W~EEAUv2+B
z^4hN*x;?7<Re36-!}p8tqxi4CH{(83vQqBj-><uSU4we|udmyFG46o>7Ms6$n}05T
zRX+P|(IlPYZ}tWrzP&^K+^x4#_uQT{%FSWVF5jEI#XA1`SEn+TU!F#?36~e2&M-K=
z*gr~j#kDIhbBrErm?v_W*&>^vG4oT34F3j=XCir<cjzB2c8xx;YI}Hu$CsWY9Tpzh
z#Itkl1-aN_YGUU18A(3qmOOa;#fQmEdp!Q`Dr6IR7JrtLb*0+V+O0-Mx+c8nXwq+O
z_4&*bQEwx)>|zV|%($ye`q>91XI?3qYw@&^`=Hgl_p_V)zbww2a{iL%!VO=%PG6jF
z`E&nQj*tJ(p4;>1e#}FA{l}Xp{r}JTr2aeC-o<PQ@v$!%u6KT4S~u@^$M?7G-QS~G
zzx)0!Jo5YO@$&mQWnu*>x`BKCC*C!WURyNDh3&HP?ay^es!RJVL#Eb8JKVYdCysCK
z*>|!re*9wZudf$;|NPWc3C8_bH9~YZnKt=6{8qMkrCuoezq!YzD<~a*{6Qy)C;Dpa
z>-eV=Jy$$qm+;=aPT6R=*q5_kKXW+T<1S^|zvqs1<@WE4buYI(+z#Hk^TB&|jii4m
zkM5e|26Dwu3YN)dC-&*|@X854h^y!cd~xXX4V!Dno^|!73SRgXU|;^@)A|k5KHNEY
z-g?#D*9pgizG=P;=1jja>7V>Xg>nToQ?oS>+7E3u5<O#ngT*juFJJMh)uw;gzqD-q
znrG{wT=*{Fjs72tRQ-D|R;@F;{;Ne*%V6W$(*NK6r0e;)_OHGict|vY<8fbA)caLG
z^DEl7{9e-g@=oX7%wyY^Ry?Z;j6KNeDsro5;|$9c_braaY4nA*)%o7pbd+b0MZd@6
z$2oPuk2noI9d~%GXL>25DtJ>@zTkoogIkmI4woA4<pmR2T74!>5cE|yd1Cp;>DDzZ
zc6;LlgR?Rp^Oz6vtSy>S;;TJfD6m%g$x6<g`b6j3qF>lW+C*;T9?G}mGMI6zcMePa
zaXrneyCtjQFZZRs6RzKJUp~=`<xijL_7C3~r@dx7_IlrgMGM>hwydrT)Y$gzV=EV9
z<yl4E%O-oYR92MC&ff5b@xAE!UChTd3cp!Bkx{<=@F<txx}f&|pLDdg>~>^jj}?68
z_~X!?dnH9$YoC?5hR(F;@;IRo5gt{)mL*iN_TF}{Z1H;^GWR@_*HoC$tkUljTR5%s
zA<w^BF=d9G+*i4SY~}A;U0(QSd1(0iGQRuDUtXU7bbs>o>fOKB_gOZke18z?%PV|p
ziTaYXZ4EBdB^czBd$(qP@Or4p6vtt)D{e-IMd;&`nNuEd@b+nk*A$=Lva{E;Nw{50
z^6A}01}SBXU$|%Xzm-*3b4cpY8h?TFav4jbSeVc2OgZ4vZ{}0`=3~Q#<JUQUJGo`l
zY&Uh3YHdte`r~w&f$Hg(58{L$e6{^(8NTSP*Ou7MZQi1};fa4%pFeC@{O$g?Pp|*y
zns|S(kCxW{{a(mU`}h0Bx9juwb-YXA-?wt*)Y=_amfikY7WzLbHBrU9q#|DVQ`KgL
zYbA2-m+tLa_TiV1>f5#1PQr5Tm*VpOtuR!2eYVWfQz<+uygK7n$nlE_jt{G{SI^mG
zu=%P&(LS-7{v@+^xlG@}p8Gx2>5lHdz4Y2+r<{&$a`)HO*|f6de%QY<!MQ--muau;
zM5*1v>;V>nk3(Lm9_aXJbz5(rkHAYMmF9=($@#0Uyx`J_61$-#`P@*FUueQ4fohfX
z6H_Z}`q~U*wk=z>Kw*DM(ucHWg~c)}Ql|N*S0?Q5@Gmv6J5=^=ZkMd^S>bJblN*;L
z1Z(>C1jNJ~j_PgxwAgdW=}YmOy;#0#uxYJ4W9;GP;MvkOOHKTj`?iIT*4@~CQ%%`<
z-EOmGO*8$~1Q&f(O;ec`9LI7*cdnaevyaIckK+$RAB4`oB)W3J(Yk3pX&t8)uU6c2
zaof5-N`}5~lInDJIfY6Ee%$D|M6rp(nYpZS?crIwE(G<h_Ewtq^7NIB2d8sfbXl`q
zq4PqJl-8uH*R|yfW-5Hj$@pZnbr0Lcj3XyR=dn(C<)Ae8+u{Q{95>q|-@RO%A<nqg
zvcdFow+i!?XCW=SbtB_)|8U6^TU@LE{k!Lt#!^L&-pXa!VRirZe%-hzZc6AA%`1W0
z6V&sYG>xB@sQuV;`C^Z^7u(hI^_ihrZyX;8#?Rc^ZdP&r+=ZSDpLeZy9azMS42^EA
zsoDMeAxot&AFG^2!Gx@ARv`th4cg%gTC+A@jW6r}GwsiHNyg*VCwG`X*_xj9{_VH(
zyGvj1SMYbYEx04sF-O^S$BCN0&{Iy^W+&Oq4BvD9{vJ04*7;{7QZD>hC&?B1x!BTw
z?}4hOrp$Sj?p>Wpai_Oz;<L6YJZbRYQvVK*9Xh*$jb2Ip-mq3WG{RNyl4#3cyST!I
zSC*Ktcb$&Pin_~ewKTOfs`0DHA)XfNoXc5<7YFHID|h<f5x433QMtgq>Sdl2;!0!J
zzK+xn^*gFq|L^Zz!JfA-%q@HmY<+OOUo?GhZC=#Z9rb4y1e|8#cHoPPIFdfYJD5-G
z5{D?~>7rGgQqxWQBSQ`?VoHA$vUloj=lzWZDtCpZUiiZmeg4HsIe+eFl~Ja7F1+W?
zH(9&MGgr>HwGq3o#pAQmLyl4J-N&4QyvUUmMis0}Ud`*s{j2?OR`@K@%xwyPHN2Z5
zQux~z&-{}q_tE!l6@RAnTfHRFyTw!F*Bzag);0ay27R5y>HX^pcl~%f$yulSnBkro
zK3;9@Yj?EE+-hb$ByFl}Vp1l1$?=l6<54Eox3i}4{^sjxpRBL2Dqc!TW5;Ty(l3jH
z&&)_Zd1R_V(}hE>iqAerO7+cb`tNX2qkGT1(;DmLDxPMUzI?grNbsJ!?3)8;T+-UG
z-mNS~!trJ+n>q74wn=ODiIj>oZoVF>Ys1oHs`jaKj&a4NWvcA$vl>=SP7z6zc&pmw
zcxL7Xi^3L}340Sett<~!t-rKjnO#PZTG}pwc2S+gwh!qso35FyIdAE->GbL!L1MiT
z{RQ)F(@&JG`Xb{|wMO0W1e=T_v(BT;PHEYNcjE2}Yi|*Iu=GOTdX8HDt4r@&%U_jx
z%WitdbL*V)wITr-5A<by)UPgGd9w3N%yFgiy>^y1ckJU%e_AbgS6C-l^w`GVr{5hs
zxzSwW`K<$@$BteUzsw!_P+aTj+bf~JADcc_64SU;yzKo2@l~-o8i$xxNA8V%Uq7Yo
z)V*>i8LeM-Go^!{@BHu}D|_*><q;O)9>QyR&jxG%sX4k#A^x)<o9OMg#p^s{Yb3e5
z;;dB^_N&ZhEdKF1@}Ep{YDUYyS)#|H%~n-BlDFBNUT{up*W@lagHEZ`w{rrwbY8j9
zdeP+0lP9}(7KO7do7$L}nh-Uq@nvD{j^cm&&t3Xk|Mp!K=fCjkssA_joImyd`-^}3
zE#H-@Pmh22cIx!?S6*I=y>R+D%Uatrr?1!Un7%%A$H!g$N-b;6*YDJtuHLfN+?v}(
zOwXSqduv^Y;+m_P>Ygbs(pl}MB2TKD%&K>*Y`d3LXYZM__hxOtpZm_S^{=0<+aFYT
zwd(h_tJf{gUJUYDXS9)f(_hxLXCFT4S>qJanYUoCEbDEBSw@=Ysx^+)Zj%1_OvY$~
zV|L2UXDn=nJht6xhoc1ggtok1cvXn`t?!quc{h&vpUyp}oS{)_(b;n~WVUi)%dt*P
zN&Q`Hb1%Q$tkb{D)JXp3JmIpdM<=h`cFIZp_9d=;4z8?Q4{Dq-+Ohe<!F1cMYhl+6
z+OqVD6`W6sta&LZ?V!G_gt0bL_j2R6ltTCA$^tA47QZs_ZQIP4f6-#uk<x8<wBnqD
zUi$X=D&KJXudVUA@Y~XLTK1u@k}f{})V%ZkkApSSuH4j&36Buro49_>-;jqNA0*s)
z{!wz<QLEEw$q%m15uPg4%_C{KtYA~1u;3=evl07_HjDqb_Kqz&S=m&n+GX}>E-{|q
zH`~3o+6vu0xsN@BXZ^J+i!<-u=*c&@vXgE0wasy>|E`G*&;7^PYm%eI9lCpa9q0dI
z;SF5NL}yg6ZR%rgpTN^@l$9LZo_u-I9*s{8qPG^ztnXF(W_oJd%5AFdr&JE_*!IXt
znst6__5!Ul-<R)NRQc^%ukVFVZ24v{%!`W(xNN&(Pbtb7W-fGYRcp|mK7aYiH*aKi
z=ZHvI7#eHM6R*`!S~{KKuX^*NIcFu8iip(u*ji7Y6a4wWpR5PxPFH=nS3S*l*2U=>
zvo1|KaE8lSL5KGwzvFEgIm`P+FFq|vdY-*O+&*!BbIPl^sgZtB{7g?zRQh^}9awhf
ztm*xq97lLRuiAd+uG{%3^`;S*l%i`BXK!ZBS<u?I`<l+}bq^Jy&RYE|7Cy-OU;o|t
zE!~&1Ouz13>^<R@i_5dvUs)H|7jIs$_Q>HAJ$tU6vpqh`jEQ^xrT4$2)3f>?=*MO}
zn6=Y7>`MGcsSEd1BVT(q+9qZxoIQKZZ{t2yC-p+TFO~1y3K<lIc|KP8)`sM}Ml?@h
zFp^xht#IW#t3th+H;a#ihw>Zro@BX`p&+@ZM(>iva(NE@q80BImzDUXwCcr}Cl`wD
zxnr<5A>wfgPx1pP-8D-$UuJhXDmYJjf<)qa&IclS$3MonU9)sf*rg&X@tilj+tpo4
zK<44Y8Ao)Mr%vFV#JKyM=VNzC<qMZQPS#~yYYh!gvn;GB`q{tk-BgvWL9fER?s~1P
z_F4LF_Ke&ApHDb7=kNaACBN(WXDmwo|9;J@dYzA(H~qKY^>=^Iajywnr^5J8vhVV~
ztbN{brQ&{_x67{-2Tb!Qkw5SF{^7jlvWIT^zK#F?Ii>xU(oE=dN?X0#LE-eLmNR9)
z>-(M*m@96+tE=w$Bxtr@L>%Yw-J!Q~w(ncK<>srqrth9CjBD;KT7U5Fx=v}KjvG9m
zLX=zP%u?GEk(=AOjjh4qjrxK8>CH0C_Y+k7RnG*6d|q_Sk5hR?TYO98fr+#8_Quzi
zt?QH&7tl36bf7O_dd)t?ck_EobKc8s63h}ye}2(G;kavtLdC_RBefRZ0lF!(uWZqM
zY9jL_$D_Mgk9F=%PR?Imtkb+gGZ>QMXZlYS5?SEs5cqM<AH~FV$L25cwVI+_(8tGM
z__AVkl2MmMj6B<v!+94fGQO7tM)UQw*9J)>=H~c3xvp@#@9eKt=Qc@trW;;$@w>Eo
z*19|1iF3>%?#^1}rfl@=%*@qS&OTd}IfHZM)9WswkC&X_Gj=_wFD(2eXVP)y%XZsT
zrc7AU_}6c{U@Q~&>cifPHBOgUN$q`+Qz^zdOZeGjR+Ec4ZOlfQY-U^b7Sx$6e3{Jb
z?8>5M?`Bs}yx)OC^*`ILqiTLpGs;*k*G<rtweQb$=uVy(wzzPQ+s99A8=wER;}rid
zw<k&9S%9>yaIx9Oof9n>eb@w3)dI67U3l^|L8R|%#U=e!zw{j#=0pVjoIZK)_T7(4
ziw?~Dxc=C&u65fRd<r+bauE_&SaAD!iouIx!U1XL&N^>ME4%Bfvds2MP5PrVj(jq5
zyfSv>OV;*X`|#XHS%Ae{qHgKAsS8Sb-+gDVme<jnw(i2&ZGpG^r~0%o_8s@=>1bV+
zV0~_@G*e#8r`IhrzD#ewDZXU)N0D9K#fMk<{0etC$yfUz=%&V*a}#4$*x2&UWMhuW
za_KZWAZ+p1A>ZKL+dvgf8Jqk&Cw|6m)9GCNP@DZC>!S-R#PypFU!0I|L@ctl^z1A4
z;??ha3aYJK-)C~1jhWKp8zjJcZVvO*<NVi|XFp)mEjTxO@`7hY0bWKNpC=eC`Ez7K
z)dS{ro|F0x7g*NkEZWo3cEs{TqeR_Y7Ne8vR~<N!u;uEt`0Q7$Sz%l+`YiI~LoTTN
z;+Q18Ki-ke=+g8@_KQqTW)<<?h)nfc)$Yr$;6E*Az25D$g~Fx3T4$FZ_Y7(>TK3)P
zd>X&w(|=w6-#oHk|6sm`yvYj1>$_L~Jy$*Z!;#lvyDu&*zjfAa_1k@qpG;0QeO+As
zJY>>~?tO1H=giHN3O=awcZ=cS`OMwNPrV8L`0L=oG%@Zy*PhhOTDyizpZ9sf`&SBi
za~5hZ>dWZ+A-y52`5(t)c{Srxf{SdMIdgt18}E!Z?unbw%_n<z#^0xFr>m@a$+D@y
zVv6vzCwi0S_WE<IS>L&$^Dx(hc`4^5oG%^iH?}$U{PBU$X&b^_UQD$Qy|c$@v&)xd
ze)lJqI7Lh|;MK@n+b1r~_toals~Gh;`)xH%mT`*zRGD+oVTqz|ch!+%@j3Nbv5_k$
zguXtza}}$si_FpNsG=!67X_B2EHG!2*Iu*yUQGY?SIqIOmI|uj5ohNu@kvt2OW5;w
zwL{T{GjCsU*QEYYZ>c+XJW!6GY4@BL)l0ZzS^AwWP2D+9@5K|JvlBfGeKaJ`&tXi{
z5S4rwlQPwS^%8rej$EMC+Y*u3OBH7p8h%w5SS7l?`GELm-jIdcN^VwgEaXiJoZ-8y
zcz>FL>Z?CGbAE+iICnyD_3u+WJ1s7|9^9(X&wlCfo)7D`aum9H)oGYysht$moh0q$
zox!?!mr~&wwc1rLHJ<FgDR@8U)`Qe_5e!FPGQ4amnf-X}dH)9-roA6Dn4jIhclD3;
zD(?TkLrku?)y=FwvU_GJ<L&1S9Q;>)CpK*1bT6NBoWt|vjWvh<WthmUN|Y;*TKJi7
z3-|Aa^b5W#&0bEw>1$bF5+TGmfA##yDI83#R(3b-D(ibxg|53Ooq6VR=;w|Zm;9v+
z6_&BoKUpB-#k^sT=$j2fGZOdQuKxJ$?6zN?TcvcrieJsyveQSoEvDnQ?D?O&Z8x*8
z`1w%VXXiH67?vH!KHB@2o)bN<epN<sa>LF$DccXt;(fT{@yh6wtQGp3_H6q7@b1Hp
zzZb{;SFlw{&QARlJ@ZeP+J1MVpMT?d4qHC||5o?*|J$$gzIgrF|5o(hV<S85|L+(7
zuFrqiT3+<y-i>Rg4oAN#h>gE;IC`2(nLPjdUx#h?%sq5>*FTF#anEOES9Cs#+r8bv
z;pwL%d;Olfi+;D-TQtdK+m@wq$0m15sNZ9#S6F^V;@^gbHP<ui-6Q!sKHDAa=l}XK
zZ`$t)ae?mI<?Ft_vMLiO%A4Z&^^CQ*XRaw<@RmIh<pq<n*2w;76|(cFE=xLia^9J+
znyif3TXJ8!UOD(;O*jA43W46w6W-`s&MJ9X`i_~`^pDKfCCeYqe4%?s;HS_f$z6gW
zUtKPx{YjBD+Zd~97#O)gHTOV?^6isXTr#ug7#j5U=1)>{ziQT%7nOf((~(<u7RFC`
z#@jU|sd?hpx=#Tz|Cjr;_H}((;a<RAuCbLVd)ET*D>^Oj#g>NkWQW8)mnz-H(HolL
zI;Wz{ExY-&l2%stGS}p}k2E*G7Fk==(#6JP^@vlnr?2#>+T(zevu*w`9XX~EU-feB
z#F=yDLmW>Y3jK7U)P(hI$90v7%?Hn^XiGA$nE0BfPEfeK=+u`*dwH6Yth|G_9C$6h
zbWhi+V;vvUpDl}CdC@P>dEL>7!e=Q@q))EoZDqe3ky#jXqs_v5g<|tvFO3Av9DhIc
ziGpvQDLmYvxBia7EuquF%{vp8seO`Mlj>Zwe`BGQTXxY`p9wZERs^#@;z-jnlJ;af
zZ7}`a)^7FgfJgyxF?N#!0XO<vw?&=#GQqTIY3lcdrSprT-yHh9+(+0fZhgg}dr}K0
zPx0ePRcP%ySafgpDY4wBm%GYd%rgCSN0{l2rk(ri&XwKTZ8!X%`o~P?KD&2)nni*0
zPNBI>w~sGxd2wBGR=k79^ZgO+NB(r&S<#!*<(7NIu4F~nk9QV!*5^+y6i|8~|9;l%
z#SM&ZD;L~7TC-du{cB;||EQ0C%)65|EUd5H{g+X9!~d?i|2gZU58uB~e!g`=P~mk8
z*2yOAo*@<z3Y)o11D>*U`vrSxEv*-9-afN&R@!7vwc8gb8lBeW4i%I)%b&i5`E)JU
zt+q=Ow%!o<q_;<dGw;Jzo%IQFho&8pxn}i<xomIdHFocR>i1+ScC521xgU8<>+qp}
zsduiVy6o)DZ2G+HNvhYnYjKvdqjh;XpUiLlwfghdhLw*OPgv#u@yUXv%6sx(vdl};
z(kQ4uv&vZei1(WQRK0SGH!4LYTDx8QE;WDu{rgtphf6Wn&Rm{+#bWl2^G)56AKpH=
zuX01-cvkEcdmV#25>LW!D?VT6=DOvdgRaDlc`sgF<5NAKzHr`z^KUy1kD4#qZyu8T
z{r_c$_pMb<`y&2xUOk}na#i65?*IQzbLY9{ohmqV-qdYFPw(H!ZNENi)W5U+aK-HU
z0)_Ttc4jT-_Xg;Hu)nit_E|1}^K%=H&fj>{IPYSugZZrmf4(0(f8~+n_KIcEK0)b1
zA3`QMb+^0oevSXndY|d}hkeW3ot`Z2ecK#<L08~Q@vrvi*)BSlPqid2d~mYaS>nO|
zgzOiB`*S|r3XQ&a%Z*p=&;OluJ^x<{TC#3ruU#Ib)R%3!E9bIesKn-v6`MZPFkMP9
zVw}pI(%4w^XQA<vb(t1D&Y%30*77MUbbHL_R6o!&qv7!KzjAZkp7$-S*IK!7m3riq
z&ChNb7tXuASd6cIqpIY;KS%%lP?`Oe)A3M!N^iW_^rhP(E{5A%>M!1}t8KFG%4MUZ
zsbzDgU)*SZP$cL5%K01q{$Jk{YaH<C<{y?nYpWt3i?MOuc^>$Y<zW0n&b)<hs(;MR
zWPE6SA?=wxW4)<v!;i&Xe-GT>A^fv$pZE{$@?>evGS>RXb?bh{*<V~2cWwO=+1)AA
z%n#i^Q=;<B%vWgp+&Awt^V*C!KTEdV?3-l#nd8r!HJVkA_OAcg8FqP#p<ml(L8+8E
z{%ihC|J7Vy!&H7$pyaas%KNi>)AnA?P?8V&bA44FbIQYyId8Ta9#d^TdFlJZr+2=8
zaH)8y<6g6?E$Dod$*D8HzW<+pIz3$P^x*)-kVUFfXV(0&T9GK@uX60sCEH$(@0#CD
zxO<8woj-A4)z^n_Y-aYhmE<_)Ocqe#^g4Vav@_&d!p=ap_D(6I=@$JA%YTL}TkUXk
zxt-3D_F(p=-y7EG^)6x2*&v_(=g7UC7ED?93|n6;J+jkdoz*?NmWOjPk2P_nr8P~w
zlKrE~UvT=f9jvDwn@KGx_>-tpdELaCE$cyt>(g1*7bF&VJa%2l7P*{PY;pGCkh87R
zL+TDPZEuuy$dS@|kzFWQ@qi_4(i7H=PV<%)ys{A8l2-MvQ&_MezIV~9rwm7~{u2G$
z{ikNyReO&;kMo7PL_}t{&dxD$3jWWKYjbqk%iU-4e}1Yd`Smhs#{BE+&-kxQV84HF
ze!GE*y|BvnCzsy8FEN?)?~MQUFXfFbOQK7qSHEOB+~uFTan9j}b)|o2I|p7l_vc9W
z+qvzFgBN)GP}{w3;?J8R(g!7$&6a+6R@IyHt4CwM;hlx&9?VpGqrEA~)Nt0pbIjr^
zPPxW!W||V9-1hpBc2Ue<-AP7!HP%(E&aV3H(7~}oJ7&wl+4Eh!6;7!C;P>#gl5hBa
z@qOPC=D+F_c+2M-mI$|reVp@AqghP;VAL1Yf=F+vQlX4v4gx3s{%O0L;LN6|RNX1A
zUc6{(xzMgTGfW@t5Ojap_@To+_GN?Vtc{ntv^O(I8Lgh6kXragd4I<pj(CQjN-Pg&
z$)$t}A2ccn6@C!3X19gn+5?jw@JYG!q$d5a>?$;w<gaVU{3$>8@RuWHhYJrMIpe@9
zaq{r8Gdo{o8W_&JezcN_OZU{1j}o>^4D-3QC+?6~_G10v$KJ=Zr#5LAMY%0}+hM^s
zpHs|!hgay#xY+Y+@}$?F{Pu9O$kVPl5?fDL-PY_aI%zKb_+Rpz+$UEGHY|I-D=?z_
z#>aJXeQ$R!^Sj)8>DA6PqCv_%854~6YDepL@CIGd2wc~7?txjAQ^of+8G-g^44x}|
zlx9tg^|&;VNuxrVL&LF|W!sT*VHriW%zJeK`E3i{&#?{8dM`0w$+K%;)z;s${xdwk
zp>gJAL|K3S=`)QV%`ZMQVcn<@xzRax(!p76N*_C}2rySS8k{p-K5v7?q0=4Ha`tQy
zY|`j2KIF4->SEahtJ=Pkitjr1czpGiIkD8QTIkS;QZ~+`VXwaTJUzRo=IM&mdqK$#
z23h(?_+|EXL^c{qUwK+)q`SGcyT_pK>(sM{oFr6EMBLsiQB+ni_kq&Y8A+Ra5?*h6
zm~i!I`=R63{yz#HKQOAD^sry3vCm3trOoyEyVSqfg}z#(=4o`a>7D5v$3K<tAF$NT
ztKVqARyXm~zQe99_WSSI-)Rd^p8j;-5nYMqEz?9d&$|)dGEL=p;+6hlX>pyK>^c5F
zFSkq0OMh(VcxL&L#C(-?lR`8Uze>#Eesprhx_+k;&1DICW#`XHZ<=%d<<fiYv#Z<e
zO{3R7dz#AKJZ07g|JOoxKQ90AzVg-hSLWiodvaEq8eIzcy>{9jzxCU)KCeIIF#n|g
z+3VBSPpO=0)yn^^YweXgt@maN_+OajxL40AK=Rr@p~z?K<{zDZDC<ej+_Uvh|H=t7
z@>2_Ee%R=JTg#F+_o-y>nfCUsd+GWNTN+oh`%l*G*Y~YYc_DSsQT$l;8TO(zUTb!j
z984}+`TS?`ja_GJ7yf+6QknZCGHp*t>Is>`IaB&%(w((a?Uh2kBqbJ|WxFNQ>p1;5
z#~YQIjQfxJEaPqO^Hh>tbvdx&7$;*_W`tDAtvw8$u6Odcw3jFt^d4%dPj0>}kZtBG
zGD%K=skm*EkounfMgQ;m+&S0Y{^Jqr1j}-T>pz(ECw6W*ufNk|rgY-zqdd+JnZ$Lr
zSWI<Mt*E`Q)H`jb)qf>(v!}5S)2`-z<@#y7c0v1>^ep#Qzf_rNd3R2~>C-;^?S|dF
z=qF6wI^0niA6vtU4~k#-b9*^6-~6Ub6EW$>I>tvY>UHY<aB6<p7cgn^iQ>oz%X*co
zowKWYrceHM<lWPn+{a%nJ1-PE-1M+prJ*DF@<`~aDNkAUUDe?1<!v}S>&>Gh504%d
z3W#KRUiM;X_5;JqdW;gbv3G8>uYdJw!s>O6lO8-%`5=1cq}Z%w9--=to-0aw(!!&p
zcW5uVXb^nLb7_F6QB?S<3%<O$r~Zeol#{#qWYGb2t^YwQo%WxZbN26jg}9^M`CZ0~
zVh&srw!6D6Sa_C!K$^3iK`pbCzM}BzyfewV+(H>&<2$OdO3FSaF%<27S*VyE!)&#s
zV(o|1)Bl{l!>ZT4qPS6`w&Sn0c*d)3Yqouw-eoLW>a*{a&$?#L=EuHl1wraD6Zt+n
z=?nOo`3w0@6kfXaP{gtK+Dq?BU$=W(UoZB#X!8tTxBNf6>lSLbzHYa;V=^&yDfiFi
znQ!!cmS23et*Y0}d0+pY{M)^~*V3f-ZRKq^_STk3*Dg2L?Ckm{@+R`vwe?C*otZ4W
zMfgSkRdW}=u=-Q$DjS*^ZJHN#8XG7wKRNV)L7-r(%07oVr&n#7-1gV&FxNZ(4X4%5
zow|JKaMb*BZd=|}OiG@d#vMJic%H@G>`BJWyn^!k;?h^U%?SR*l6U%Aw|I7R^sE1Y
z^-4egOWs?sR^969J8`qbcN`3Bf1B$X?mGHCt!kc&u5<N|y&sqb3fIW>O=_5tz<o4c
z^X%)UFvf*?od+V#9Ij66U1SrvK1P0Cg9M+EYTr(|@0|}$&D#__ce2J--eyjpWoggS
zeCI6BZ289D7a?(cx`>Xe;K@5ZlaIQmq?-wdIbS$*v8G9RyZVvM%+k^ZcNL;`FU(*|
z{u2`9diKm07GLf!-M%$j+N5>j%FE7ex}-8mL+zAssgtUWWsv^riz$24YrS)p89%sT
za4xgrN7}|brRqbbl_CDAy=o^}yH13QN7RQ#@3<ha);D9`v);oC8)e?)$^ZPcq|PU!
z?DnqfCqAFZJaY84&XXTH(kEP|#cbR1{bogO9j~#=tG3{V?H01;o8MGDK6#DddHM5#
z{Yy`z^V)BnpK<%RPVlC)O4Hkg%>q2NHF|dj3B7wZp(ZE7P9oo=+~wGsnbx=aCojtO
zJ#k2H-g<}b#_4*V#jAdpO<(39XjS+Bnv^bI+4u5~;hXRGolFvWUJ;&9_a$eJ<dH1n
zfElk-W6v<oxvtILCj3f-O*zmx>12TntI-^*-ea3xIF4p*?s(^OXUlVz9KXCwsmi<6
z-=&KBed`TG@>Y1|XYX_m(|SBrsgYUy_=ehrOxD5D+KSH`bT9EnTz%W)zv{@cjF)$Q
z*vkAncE(|jLe=V}Dvw2V#hDC!rYIIqG=1FjCSEOg+WYLYp)zZqMkTU)ItW@$R_l4P
z#v>uI=)roM+!>u+H)i~(-E#HRY(d}7^PGXpmPcmH)b*1*VLn^!jZ~2)*YTvOLCU7W
z;m<Slipy4RzHn($<JyAP^M!;9nSVJQecF9J=a;VIrh?*ifA8+TH#2$j;j3ZhVe=lH
zvYK&TF*3ULd)n^^rjIVn<%?=GEcnVV7q(pGd@$E+PRxOK5;ITjRNPj1a-w@{WJvsR
zg%;VbW}k|e8@`n<x$y4qZq-E=D<9vlmX>#YFY9Gz%H~mXaPwa^yTuLq=@%ZE`ySR_
z$inw{$)ZOx7ml5?y7=?zX-Uqx8y@Ab8Y?!>3OcrC()>NQiXDtSer<aDka><||2F<L
zc7m@L@h3H`EPMT>-c)i<(i7zyj+~21vYFfe9m|!M&HaC^HudeDRkv1ce=VDJ_NHvV
z+EIh%Ls}pAG9K@D<SzQ{v3kFEu)L?ky=kq%n>D#B&)w3xdbv(mcHS`-%h^fitdA~x
zo3wtJ&L@Lidv1Pi&MTUvI78v$DvzYKhIcLt$f&n$G_rozZRZyDO8fM~WM1X`%!ent
z?VfX-=y6i;Rw{{jy5wTV45b|BJF)*xw#@z+Kfi*pKV_EDyq)z+ug1OJ_bYt&y<IoD
zHMUu2FaF`3(i(cHNv5N;xc0)?UgiU}TNl21#&qra3N?1~1MQFJ&dEBf7Qpyp+MDMN
z$0Z{62MBtf5b*!5ET))I|7Y*liLCGM>|_nP^7%v5gTt;VnQZZ?qN&Tn%%zrd%x8-~
zYyNKY9LEE!Csu4S6__1xhx=*SRl#P755jztH4Q_R=CAkEN!w9qZ#R2kd{6lHuU_$$
z8r6TY6qZ&@D}C1PIi*vv^<zU%TH&cr+t?OA?<};~v~HsFoPD3U;v^O>bXUp0v;Cd+
z=@qYzu)m#@b(iCW(D&k85#Mv4J~ugJyuLd7@$*&wGXr&xJ#?wgJGx_4Y4^?r`nds|
zTLVw-UfA)oI;dCv-Z{ffGD@pgP4((MD)YW*)s}{D*I%#YYX4n&-DKjdla)&aWm-3f
zhR@v<mCiAH8eh%j^{vZlc4crYJ-Iry@yo@Z5>K=QyH;Jg(X($!Y+72AO18loKO?`Q
z?x1$wxsRVV|2g>JY=DiT)Sl9!2IVO)eg}$7G%Pr>-pF*}!Ce<GBzP#U)%q1^p*OSk
z+;S1Fe5tp}My%80KZtPkx;@F+A%1+b?gMqdb^HbUKc{HCR9|#*qv!18(v01oD$aaR
z+UfD!NsouQsOkQ@hhI5YuU=(8|IO7YlQSD{I_^kuICmhc=huPlw<6_=H(%XwZ$1Aj
zXOlY@_ojYGJj2x$Hua>ZQPsZJB};D~y~?%ag8r@zEA?E1FTFm-SEP1(Z_H=L5}xzk
z8_SNoD*x)@yxk^n|MkvAANKqA`ETp@bC^-%WG}z(u>4i`U;CR9y7}C9Zkqq+-^WfV
zH;!G?HP!c@W(khi8}U8MNQvk8y4yd_fleT2to!}M)7MhS<X)bL-c*T;b6-#EP+8`^
zkmK*hxRzgkCeKeuudh1fbG>_$_yb9k3;j+L!{)ZlX<77wC+vy-f_;xlZp+V~Ao%j+
z`{U~C7rgEN=kWVh^{SscJEnLwKb)cPY16>~E>5jK$D$XA_o}nqe_a1@!OyohFMf(h
z3clneZ0~yLlf+jqsmTK24Kt(N)^jhGI?=W0N6VDO=6yxiWG)^Nonx_W#*wC;o<KLV
zC&sUyeZ6qf_!6`5p2MGJO6_QfR9O=*XEw`dzSNc)PS?$k^h|Plw3Q?+CrQ};7nvV?
z?bXuF@1`_WR?8&459#zfncL$V(&l_qq|bS#l~v#E(yXA%No-fYPmWRl_w6yyoQIY|
z+uz^aE|!zDZ_m9G-zRb=ewb8j)GOMvzGuCmQK5^A6>q7^GQKN<VfK&b^a=l$t4rGH
z{g#vUz=4PdzDYqR&)#{#IY+G}wn_M#@Y(mv)&D$xXl=38)V@S(+Qfo$Q_CAPI49)J
z+~J#NYcV%HOKfVwJg%oxORQxUD~Gpke&EqDv&DBt&t9g^AF|nTDxbD1Yj<#7Ec7vW
zUwg<+Bx#?2%FK&Xd*gDZ1lFy(qVkN5#pF!ouP&qMY(J8;lPtt`{|@hIQcG4$-8Qk|
z{}Y$*&FS6NM~_w{RczUsZ6s)+n9&h&JnO@eu3LPDu`irj&iFovc_E?mt=qDHQ{1y@
z7E`31*bi&&|0OhE({Ib+=(Zz?w~qb4VQW>h>-(3jL1L$G8ib#Yefj6`w;w)o$wE4O
z^F1w;<{gf7FFhtEI)BMDcQq-Sz9o|?H@fJQFW8tUvrEnX<G<F7D^K4v>g<=A$>G^-
z71MF>*a9DSzKfcdRhM%~87=Rszczi(s@41zaj##Q?|b`@-(Qc7C3KqY%>57j&+Se0
zoHeJ^ea43Ll&zNPoS*mVcX7r9tTFIe$CI(-v|&lbPxf0g@7qWVJ+msBx;5(V)8;83
zp3kY9od5EN)0f7YPmc4K-k&F7;6HKs+bte)&G+Vc+;}C-c_xr;vXta+VYxHH6FkqI
zKmJ&!`q7aOFE;2ezINqm=#<X~{ss!K|6BT8;?}e9(g`l}J{0=yZMf+aqTS!Pe39_X
z*G0FsNS-{lKI*;nbN{T&6A`Cwn;klt5;loRRo!>Wil~EZipRM&@}ATVoxyiA<wMXB
zre#+G5|^B5s}yFR^yP;mC$GgU-uG*TcY8NKzd3nd%XGb@uHb1}YELHWL=}8XnP|FH
zp-#ap<^2X{*+uS+o;+G>)?4=KykU8Ma$Cythf~&N-OPKGa#i|sFIQl}dyTT#`c<!(
zS9I;)8shs?zUNEC;ya!zrL;S><DPu8TQ>3RR@U~ty#I4&n|0^L9&nA%co}Q7%S!oJ
z^tGVah3>nSMOz(m?q96<I=Sc7Zs{wvM-+c9elcs?wzCKRb+1iSOuZKT_NXG;*;j3G
zYSYhkIXE+CF#P+jeQft?^8)5q$Lb1oS^k}gJNnRKq03Kc>5KjE1Lpj$neYB>;@guf
zldGS}cdB<>XPI-+X4h#>{?Gk!hyJhI)Auqk!aVPG_SZ@O_C7kM|I_}5(YNhyzn1GH
z6>r@C*3h;)(nfVvjHul2T!)2!7In`4)%>U?b=UfoNf$rJ#QhBZyWM``;!7t!%~N)e
z=&jS2nwKb}>+|Q+C5{I*GqhBWsTfad={uAtV?6D+g<N~R%FAF0>y5v>a~La+nwcd<
zDF!K@TQ*tfMvJdhW5?xBJex%0l(?R3$?VMddhsWxjaK#77hzK`Y}pplyC~QwZvM5{
z_bOgDe(^qOw^mX4keV@RO^f8~=n0%=!EqlLKCVo^5hmZq=yptH`uVR7LB&TNaDP5s
z?006x(&s04*e|xQ`c-?v{eflit;{o@oAQlwE0^sk6NyaO{iQYE$WL;DOj**j%#eny
zU8WyjM+m%KwJb*^`WoXlE~)>XM%(I@&bs*h6IFDc(U!BzLnk5EwDbHHmgHiIBYU6T
zd6~3q$%nOEuguclxSZil+x_-w*oxR|kAB`Va@bw$v0L?@0)O811#hP{zO^#2P?4Y2
zdSTh?Q|~`J>{ihhKj^J-`kd1A84lLHlg@bTdBvs@w{otx$1eG8_xIhtZ~HBO{e9D*
z9cOoiJ^tXcNT|B^nfuwwYgg9Im~!!%PQGH1;+yKORo*4V9?O3gR6NbB;hH5<V%k}J
zCUBkK7N)%!+7sQx1XVaiZqErgd~}v$g04}-Ga=1$m0Dt%3NdTu?rZR_WVkRX`<u0E
zPT{ng)pv`h&)UCmYhLabiMQeUn|WWHdSM#-TuN?A+4p;S|M&c^-p;2V<dd;FbNlKY
zi7OqW6yk&I!tec_<u5vGy``O<qRy*bCZex*^^1FTFKn@4_sKoBCNaZ=|Ej;p->}t&
zvm7^H{2gJ&+nEqo!B^+Cb?5PbOONJ%W-Y(jCdjP*z{hUxO2zLNo0z>$zP6Qa<w;z;
zUN=&h%g3T_`|iVyoO9>L<-Py&_W9!G@KtUhSAIq8+TCZFbns_DU!0Zn^{bX{(~?xC
zzkU?CMo=arc1^b>+t*D?9mIBTeo&|ueI_Qc^oX;CGWV@T(k)V3=lNuu7JVT)Mf6|l
z^Me0JyZ`50-Tn1jeZ9`MpiSGvmsH<LF5RFWpZ$7`<abVw3$d@ocYVE_cjCi;^PWz{
zTQ8V)mi;g(k#>vbc)I^<@T~q^y#q&YeQ^85Q1Vgq&J(V@B3ARC83mK?v&8SQ`Ipc4
zzq<D3kNa=U=DeQt>%8`#_o+2uKkoPU{jas%UL_#%W6{}l0SDK!{?S|gw?_WJ``&iu
zx^nKXv1W4aOt0<gYNwz3#WXc<ntEet{f%FGck?Vgze#1eOWi5F^Xveh_=J7C?r+|}
zJ*S^NbV;SgtM6f!uf9JLKfoJ0m)p#sjWK?KRZ+m2zBPGk`*c{Z&8a%UczyBg_3dkz
zpJ^NH>Dm>onzCu(>&(Omy)Wk!9To<={YW@_^qtc#?wTL@E{DXrljgs^bJpkW?c%*R
z)Q<b7y9eHMke-(K>Aiu~{iO3hKK3rpu`Qg%yP<fUoSDetmGS921wNeWmAX;Vt#WSH
z{&~iG?ajRpimFdPl50Bk<O|#6<vm)fciJ3$kUP~i=Bv(!h38b$S^ODhef=7|VQYkx
zr;lhy=)3T0zEyAjx^39)nPk*-c%ral)4k5ac5@$Hyn5#YldVngzu!e#3}5FQw!C=z
zu=7DhrL&dQZnL|knHQ~mJRyyvu;;O8)PiuG)`ITTqceS99$j#0eE`#<TSpG9{}9_}
zaB*tHzgtnu?Y(`B+LA;5O<4aYXyXsxSG9{drnDwxT)5x+{!sbUg*IF6Ep3-DQZtxf
z*t$K-%US4i<(I4jt4_WDa6F{;M+9fd$2}7cFZ~-<p?WHNSI`ot$k5<rF9OcHJum*S
zXx6KB&*rcR={-GoIo{>PO9ea6nDa^(cTaUuJ;c=LrsEsLA9QF-iR0Y2$5++e+3hTw
zTH^3laC^?fU1f9cgoe7l*UFj1D9<y=Q*md&XA$OkFOKCW&Y#6>eKfZ@D4boV<#EKJ
z+&|~*{<vHH$zLka@SZhB_587iPmO;lb^jM!$SwV^%aEh=tNah;za>icw$oexX|OqO
zUbb1&|8k0Q(3Fn(?(KP2H=duqQE@P1?<+<>fnbh;GWEKqn93#XYs0j~;v+3B8|O@a
zF{R<Eq2<@6{;Nvs*@Iq7h<p59`FqjVHP^H1OE_+7=V=#u#65Vaa$yp$pa}c3r#$Nx
zCf92RuM(dyD|)e0ha}%&g<W?Vm)7R`DJ+&QE}N%$@=X7pfT`iT)#YD(IG;at7IUj;
zg?GfyhSC}JhwJ}2YyA!L(|VTCI%BHZf?rlM8QL%MP6&7{Wi;VZ!<O?#TNwVuq|6Ba
zH!W-1PQK_P?Ux!%KWXO7IjH|}oyYF89<z$$7c)$_%Dmoh<rR%k1=+w&oz1^k9$OzR
z(OUI0@m;c9l7sUR2kSc#$5+H@&gt(uQhm~JNkG4$_!{0Pg1Q<fCS{bheGRVJrex>x
z=$gpRGx;oWEHgW|d@17e72B3l$~p1XlVl}#<;^paxY`yO@i(nq6U3bVS)0>ms-&gE
z*0gJ0=cTR*E~#AQv7q_0<=&iibGF*ed*dOr?5Wccj*gxwAI~byRhc3h^Q0n7|DnKx
z$l7aa_oe5V$ogq#Y_qBQ-+OIydJNyT4{Z<bP21PVllYGJkJR$`nj2SU?cG+nw?cLO
z>vegv&hxH+?X>;+9zB7>+g6^byjvPMbzhwM`)T|OUT<G;KX3hBp}hQijT6fza_!i3
zY^gEN{rs>?9e3<zJv2I)srLHkB>!*s-^ns;JygHl-e<<bIeV%&>y6b{%Ngu=DEj%v
zF2&;XXC|+AdB11f=8?d3<%EG?)$utNNfr0@E^t4oF)4Mn(2cA|=Z-FBPu)46Tm0;L
zj^Im{tiMujz0zd)eM_k=_~`X(8z#=GS{3EHBjkme`b{~>BN8{%K1@>Zp3>N|d9Jn7
z<TBmuv$mKW$P>0XU*Y^9HecxU1E1wT8zOTuQcW6{S(`HODLL7=PBJhQl+lUTdida$
z{}jR7+;2J5Mbpj%xhe46bIe^+9WK5v?rFpFs7e;jWy_fAwGutRhh6K~GxTfzk<Hlm
zeWS$R+%F~CM;1Mrvqb8BdCO_(=0hPVv)mRQUp?i~bJf!mvea&LPh<(q@)R=NTGM&G
zq~T(Hc1dASS5@Nj!pUsSH)kX(z1nlZCMdW_(LX`g!O8vhx{S^DG?zpP1fQATF(duO
zX`k;&kB^<cw!r1aC%zRuY(MnaUUyq8F1G4=JCo}hoBqltZG3m6qv9_xnbo|y!lm`%
z#WrKjTeUO9{=MTrlz*jFM(1J}%crtK#{&;+mfRrl)?mZbFY+!uD}Q^ssQGqYNZ#mp
z@tv=uLU)`%T;u|-5Ydf$d{zX{WPTX6=>d~Vx!%H`f?U^HFTW6Vn)ID1_{quUg$Wbq
zbmxT33zL}5lD6>X@~MlPcQ&33(9k{hWZSvOqEk%*&yxk-evZ7mXvU7fj>37YeZ{U$
zJci3ACmH03EaGzxF%!6GyT5V$N=rsXE0u{B?VlD4v2N!6A6Cd!bW!8(0q0N-+cnZ2
ztV_A)vdl5&&z&HrnWQjhyQ!mtN4hfG-HS!@wYg6#c=njT*|(r}l3`o5qJf2eevG!T
z+b-=VHy^x7K4P)YCDn4jRwp~t#07C1=31z2Yh_B*sFS*?amy%V=^C-@$1dVOcup^U
zYR%t1Rnh$#$DHUR>)2w9UZ1}jyynovvzJ~hj^o{!IHB~Iand6haard=&61Nw?iJZ<
z^>5A4ezLJG|M*jn1>HQ_uH7c;{-<pB!j`a{JtUUvWw9kTs;8v-pl9`YKLgzlk()0X
z71eO3_<OO)oCz{<_@Jivugq$hht5I2$Oq0vnqLn;(s*hUm05ByEW<gWCCjX{_@1ze
zc)8o<&l}ENJ~V4lZ~AQAKhx8<rY+5UXx-;!yp#DVH*?+hwA~u3>J-{Gd}!g=%XsW$
z(2{fd2UFv=u+CB~GMu$S@_2p}pDFj}{SW8AKJ?|<m1^dD>T5!^Z<lj#SbQV-cDLj?
z+3VLIFOPi8II&9G{^KeCJ)eZ_*UkSiyXCd+$^X{k|F>^^^JD+BV^+uhh(7*rbvE?R
zeIdKmKlZ!#{@*>1ebxMQ1;%2#o3cv(#j*=TKZlDgzpl;wOq-i0C-;togvEz<XQY*x
z&E@4JZ)nG?pWUzg@#~w`m^uG1x$JvqYRTBI^66{cjVC>E>*uIdFF2L;?F(1%98Cs|
zXoq{Rx2{*z&&*4_xo-ErhCLIHGBZT0GB&(E`-r_G@uGBt>;7pSbrxKUCFf1>l{~ho
zSgyY<`}fBu-p@XE%{8z7z1~hy+N$o;`}%*u*?WJ^k*?YA|K{a=?`ze6<*Xy_1v$>R
zXQaE;*ZX+J%^SzP)E}-rn_G3ZboR2HeO0S-7v7Fhi_4jNd<9d0iMSSv`PRKpx8F6&
zEx+35Aip>9{vT}~@v8o?nXk^x4u79*zGc_D*N5(I%iOv=F1ukFb6>M#_Z*ktyIVM3
z@B4Q7?F_Z+i2)i%8~$uoPfRo4`dEAE-F2Di%pINwa!QZ(&%X81GIo3Vt(zg$$&K2J
zR1bI0<+MH9;}v{wS^fIb>%Oz2?_Bw)ATx7u<h_>jZM(ug=a^pAQ@kQ`IH|ejN4LWn
zFAc8x?_!s4o>!_#`|xyG-k;5vO3!(DOG;d?Z7US*NSz=QUnFKf_nx%)b$f@{>V~M?
z(lZAvQz~xVzI!*dSMZDDyo<hPf3dGj=MP$ac;j{v7SF)>$Ne(+WK|R@ujt?R-{&)_
zTe|$BeUNSSlBn3N{`X|FE<CLj<KZY_?%yAOe!bZr=WE&4e;H2SaxXW%ywPv%WYMfU
z20wWJ&-iMUw>Wq2)D3#;Hzu{;OSIH0zxjywzs$E?dG4~tNl(mgG952GY~Qzc-tCz1
zy*F>$-m<$@`B=y5;(0yGX-bo8PWX7Pn<qW(p8X2j>VRn5QVy<D7XR4S{pPFj{JUrB
zgGuF?O*v6-WG;TVX8Wzb_`K!03f;XXFJB$_#nX1pSRhvKjO%B!IR`q=&1igMYr7{?
z@Ne+l+a=Z6uRA}U<&S34dLH>^-87w<Q$^P8U3NBh-;C53vtRu${x<(?>h1a{>9uj5
z|I&Bw-Sl7Q;pR>MZ8rUVE>-x8k8S=Xu`scDLDi=hiOoBAR%~9j{LY1ktEDT<uAdfN
zp(<TrCjL>UF8=qqW5<}BBj(knZ~ngcR=L^xwU_T_Jh{1N|MCxJo6jG6W;?rX!O7*J
zS)X<uY)i_uiEwgyzB};GU7g7`)_;u-w$4l1BGsB;sI|v!!E;+amFW$KuI9*!yQI04
zy=&R_&vXAjm;Jw89tm)$-^o4h9MYutj8jraLN7+C_^U+Xh0FwYu1}SIVr!kQPG1<y
z9+Tv_p@d5|>Bc-2?i-cK3Q6Y@tAo1ZTC>~>Gal%q&K1?=n_uWB;w%0lz^#jU3zu5x
z>Qj?L++F(?t=C|+P`Ld?soZ(vET#yb#JSs4Hu}Ch;&A)tnNvOAy>4+@`nE8N?)=ds
zx!d#V#+Qq#-tZWn=bX=btZ@5#!E4HipAT}%tjfC6AysPHcg(YD>EVs+GDc@EYBg4F
zPjft;yS#(@49Al>30)VbOj@y=Q|rLfzb*Ic7lj*~68nGX{KxxW&IM;EZ#`+fC|uz}
z=K4u{R-I-Hyq;KP_E<``^U#a0+SAsYdFJ_e&(3Aj;(}(J>a}iSJaJfJqrH2$qnBsu
z%3U6h@93M)s7~I#`d&ZVLcZ9oM{*v#J5wxC!!2~KML5+z{fqm?Ho=#tr}%j6^_4iY
z?$}=zxA+xvUQe*M{Pp#t>Fv`Gz8Y#-xUBu`ZSZW9(tBUgS2{*}S+|)-TrCz?@Kb7C
z>axD?{L(dz87?QA9)IB0=k%UxP?TU0@_{S-#uCB9cUuLyEfOZqFchd@;$g2oHc98u
zvLh{rr%hXvx9Wu8O|C@YpzVfnMY=oEB_zJ7$Ekd+s{j7r@@v~4;xo2pnclYj`bFJq
z<AfmZk|n-NJ9eJ;_wVlgoBMrx{6n?&_hz?Ntud74-RqHTefx^gv0Yoeq#qwid3HSF
z)PrTm>Tcev-|u}tcZ&Hk_hYlw9iCtBee>aM^n`00H=gV5P2@3{7k2wjP4aGc_x%3)
zeTlPv<rq)-5z({pX|L@3ocVj~kG;1tH=nj~@AN}|Qc5mFEtn&ubg%DF;_(pi>95oy
zN;pr{6`u{7+3T%3Y2rNDc?rFF+orUbmCVxn^2yMuTA)KZnWx?Dl%qoT(^p(=D=U}O
zvREB^c<^7omnnDs->(_(SvqVv;@-{ObNly$C)Sr|mOPr7`)^NuPTaq;O}{x^qnG(c
zrFoXj&z#@vm-~JDiyvnnUhJ&fy45e=%Vv9!`M#a?6(2Ug+<Z9QJ86D?<>#;e9&USA
ze6~I~pl|)@N#Ac*mj3wnbl;ik+`Zm!D{g)>-zHqp#PwYEq50cGhpct>oO$#2jO5Ac
zbjjPk<$}+r?SB{E^H4JO`@vk1MF$$*@2aZYvw83S?)?YOM+mUgz1d=Z&HV4w%J(^b
z+h6K^FqiRP9&0zRZ1wJoci*fj&kQ)or@Pei)#V13i0?CeKjhux?fmXP`AW=$cc0^r
z#w)Y)t=BB%Sgg}vKPxBphxERmIy+R)e7|Z|pl-79=lsc_Q#h`kd$>9_J<vbl**C#w
zspd6W@>>6v&3T|{y8iR;R^zS}BBg)-oqqKDcf0-jgGHZz`@9SKJzcAF!}62U+5%ra
zJG<m#@CwBbUU3C`g@2T#?!WQ><H?Kn8b3%RirzkMU0r=>?d!VNQ{V3V{&B*I?YZ;z
zpP5}G-2MK&=>7ZF7B9D?3h%o2TWr@Mv!I`^|NMG+QT)EUTKtQ9>*iO^|1qs@zwZ0#
zAGNbqZHj&~|EK8w{U_f~|EyW}KlEemj>q@kzOQ@m{pYmnnITs*B_=C)y-$x&U$n{i
z`v23lcU`jgKK_<JEAw>xg4R>Fy)<X<F`s<oud%lFriN(wC)d8#zc;y%xbE4e&A0ED
zb8LvMn6L3++jm)}S7P^;FS)(xJM)+0=VG6QPJ3DMQ8X>%@srgLN)#OU+w>}?+c<XD
zA9^NI{?9L=?ZnMao&JNzKXT?jDDkkLyXVgJm~Q{IGT(O|kAEkdBmdX!yz#_+B|pE^
zyk_73alw^Y)7}@Yifv_`X!3g6_9j{N`xi79`K_N&B#?G-)-lP>&)WHnW!w78`^))7
ze4AHZuUGtZ>vMaj{(IR6uYLcgvR_Ym_cb9tYxU$%ww-H4<{jU-|K2_Od!|R@4h!CM
z50AS2d3)cz%$-UCdvEhFb>=nL`YU_NslDwAJyvw2tLYev&&vmY|Jkh;&W`R4%U*r;
zUhL~N`{zxb`fUE~tkP{!ch`#9>6<OJUbb~j&I4`fAE(&<d6<33pLG7yjlOqRmwz!9
z|G#nTmmmFpo3Cmg{2v#8v|i`o=C1!0Pk!{z*6X%rX^gplMoVakj=|w0z4xU!H~q|2
za-75WUY2uHXa`H4U7yIF(%z0uE}9ja6;4f2v(@$Ix)=37aOs1!)=QIh6#nOZ-8cKs
z?wz52Cg$m?wgwDKVx<_0W_KklcKA}<;>Gekpv2L1(d7z-gF?dmHkWs_s>CUtJ2`!>
zWcoIS6H5heUs-Wbux$R-tCdBK=Sm$rmBULbs-$>7H8?D7;1T%OeQ+tuiRDWjjZ~N2
zu3A0UG2_A$iGy7U2RZIUwhJGLboeX1Cu=z`7mq`{w2nhPo3rQL53M&2ykiYr>BDz+
zTXo0nG?_;lac^Yz)%=fI+*^=Xt@Nkt@tndbl4)(n7sh^jQui$CnRUwUmhT+)IWmhR
zH76M`pW3<q)Ta!c(_$hQzNR#mJ-hq;)z^o+?>77AZ?|6&X{Ma$u_!{~z4ghPJLC2(
z=qc;HdXG&ZF)*UZ<->$fod*n@MJ11TZtgjjd*kg?jY(FK)BhbX;P7@Z<#f!5-+feU
zTXg9CJyr9svTW;FoxaOZ<U`DZFo~~=yx-i*{Nm)&@$tKWSZ9%+#HTB57B7_EU*L(h
z=2g-@HZLP5D0b$hE0O$8iJl=p{a)m`JbgdMQ!(pMPJ!O)W4io5R019`EplSZm@;+h
zs{;XXQeR%|vV6Ql;rW4;cRJIVmfvA}_W85-QbV)VZ|B#&+H%6(IpT$omhmLvb0S_3
zPFX%$-M756#gMb1Vxq>!9s8eFbTh6sl;tZ-IA^Q#nOnoDS@H6US>-m8Ou0+KvqN6a
zN-{Edx8T(j8JB~9g0=@c_k3R<?-~&!7{+O}=(6s$>WG&jfA31NYJAKJ*{s3!gw6Ww
z@?M=YQU*=ScWr*7x%bL}<?|n%l6kI@Gk@a~JwcNla~gRUt$aQ2*|b_&KR2mMMz6PC
zU*cTS9kJhOhs93D7nX@Og?IQ5^cVLqoR;9>cgf;=bSZd=!Yqef%jfCZW_+o7sO2Yf
z_4(Ftk(r-fe)#(O@!iS(`VU*hU*GLYby&XmgOApaSwB?m&M&U`#2P4d_r>nOJL*4b
zUj>Fc>6LYhu&ou!cRpYt?ap!E=VFRarPYgfTN-_v#JX;6PMqmC!T-TLpRT48Ecu?#
z8XX=UI(gAiQ#$d&p51?zJM1p8S6{w-{->_ex1Z+dS}bLGU-;wZOU;5w4CmZ*8oYS=
zDzcQ-H~%~u{xn-Zo7tG}%RJ-Rn=eZ5I9b)N*`k}KwnEeM(1{fmt%r}Q_5>L-S^ao>
z_N<!kTu(7SUB<SD_XG~8ZAj3XD>y~Kz}-1WN8wn)(ig@4oU4M(P9J`4bK~EJavQ~j
z{pHr}@A>^~B(k_{Ox6gjJf_RBe&QbIkGX7nV%g@d&-##cF*H8E)cn=mvwpREcSjme
zRbRp0Ji~wOL0QL$)KIs6u@B~QD<ork6Lo)<vD7V5t~pUG67urpw7Mv{ZQ){~PnXQ@
zu=V{@bG!21l-mpVVgia}r8cNNw2i4`KJr#`;eAWKH99MPWk(sO$E}iV5%ToliG5M*
ze!sc&u<L|BvY#%^UT{)EJ5ykl>c%JqR+fFDogXY3#TT}hCD-;{wAPq%-1tErv;P50
zX`Tm{?lWnIvX!}~pY`&MUAa=*v~*|IEAx*R*YI8AFW=DhPu^1U{*~he-T#+geY0-*
zkNU75`KLiQ9Q42WA1Sf*8Q-}DthZw-+q`5=*Sgv|r=C3W{Ugs-xi^xxGQ^(Dz9ju(
zclRCXv)M})sd}+RM{~P$>G~So$jJM1UrW*^;K{v=d%Qlc%Vt(D-uZ8D%DdjQ&-V_-
z@PFYi_4?~ve#mHcxtQeTDX)t(XDxQRykVtcqgzezpDSNdd@7AKr!{WVEwVpjzx-2o
z#e!Z}$Bg9bmi;rcBvm7-R1SvBkchQ%;kdK0@WPB$1(O#TWOebB2MeSm-dgu?o{eN;
z+qQa{_pBvKV)f?^J`5<)a$L<FYN3`iLp#T8S7?IEE)M0HcbQ8j`#3grTr6X;^*_Jf
zsOPR|`LtMpbX}i78@;eDwWu||%DN(Rl0w(CHLvV>@*`>T*&g?KK3SXCc2qRR+MKKM
zQEL@7*}3te0^`PK@>WZaS{&5qwh%Cn37x)Z5z9N5pOSl1E|@<&o|3!iX&UqKywjQs
zH_6;Oc4TYNIj1!nU89vHRX<2bt=)M<r)}};#E0G|GgfG>_X<lfDhd3Q<zk&3Wwtf{
zX1?Pw(@$NNYTma*7CNb|OB5=+s+jV8%Je1L0UO%|PHTQuzSR)4U-iV=yz*tG+X~zw
zB4&CC-pc)OXTy|}GL!q)X`K$7+<W+t?!)OEjTeGEGmja3FErX>%JiUfVXRhGTbu9J
zEgAJXz3j^u&s_T^N9YBoY0R8emnM{7+PK4o>o|iY^W5JF6V4<AFFCVrX+hPLpH6Bo
z?@UTc5Z-b2p-S`S9IpP|Kb)k6n|hz#oFn)A$79YzQOe(rTox#pc!EE8`CR|Bh^teD
zv{y=n%{sSir}w0<4YCh!+4|1g8yu13Gj(5(fv-iI;qB|~oclXHIBt2*Q|#x6iPo7X
z9h2SMWU&3h0-@GNua1c>_7Zl|kmQ*qEK<@d7bX8f-Eq>61xL+O%a*;&IdQXu@#^%$
zr%#%fZq663emL#n^g4|y&JvHGD}S>7d{Izz@Ln*Jqel9vwv~5JtL&NNAO7j3mtC#M
z&l1r+`+wc}Fmv<&ZPViZFW%i)AN|nY?o@i}|Jsz_@0m_KD&O$u-mP1wo<(Oh<?3gA
z*7cR%(SLUP--6lss}&Axk#}E~7pweL$A8(q3{!Cqi^zFCcW?a(Onvoju9vKiLeTbg
zC(Hh^DV44+?Vm7#U8;Kb(qs2nyS*cf-_JAjz80&ZvFY@y1y0$Qb+>q$Hf>gM_#OQu
zBI?4MmDi{E<g&T>pUKGZJRp%{=pNV;*WkvMyymOYPWOup`H3q<6!r$@y!w;EoW99`
zXO*46G)IA~2aYUV$;L8UPt0X`sN*m2wf4c0OZ==l7iTT{kjUto^2dv9$AXM~QHO67
z>jb5GZL`($=)P98G5+#jzik^j+mw6s9^P|~=KA(9LjJ9fP+!elzm+Y<x2lW<7A9<J
zI<|0*`3-@Sjq6gF9=~{V=FHAO9k$}~+&sU3`TDm17GKw!`ak@m{OKQSp8R*8_CJ3$
zV+s4i|Ie0%O{!n1a4$0ClRh{1&i*I&D|bA(uh|hf_xQv=x4RuK*2JIOe>dvD`VBTG
z_wW6>*z4ci-Qg;`13%>77hnIk?BM>p`}!aLZ=6)WKIBvU5{5a<9Ptfd_EXD^KmJ<e
zZ6Y$klFfdz#Os9#XV{*7YB2wx==rYX-lcWl<W4PrE#@^dF)On}Av^t}h1-tekD+Os
z_i>!L)X}l=LY9=@H8V4xws|U=%7;wLbS`Y)m0q-Rck+^V8ml=UO9+HjtO%Z!<g<b^
zE$03$7lkMPay$}_=eP;D23_HLa;r$_8k0|iaO5vt&d<y5SxNgg6xj<VTDR;xt~PO+
z?Xo=?Hu?O4QzmTMtRs0uWtxP`&s8cFzbcl_G0)hwWX-)q8-Y%@Yrnpj?7QN-`}DiK
zv<G#HDnhHo^0ICpJU;E%s=&uQB8yJRi_UR+`laO8(^vgox($+j5tWP1>gR5LZPNbJ
zYtQ041q@r*5AU2Y<AzA{M~|67=jU*-be-OE@%fB}LY|gK?*FW?uwS^v;r^P3?w0ls
z_kTI7-p0A?yz0MZ&P{)gPW`#4|9{1e6@NU+^5i-{%ByL57Cd%$6YKrR|EE3dM0HYH
z^vt7q_Nr^o<`i$Xzmx7gYpcVQ&HC>a|0sX&$-eOux9`#)2VS1Aakz17L43bK0Oypy
zoYMp}7BPpt{61@sO#G|w{%21w58=+2;B{Cl_fm<|e5=u${x1R?r)v1tO_@Da?Aj96
zx>I~E+l#_(vGBi|b+E#h_gJv)EXKdeE0$Vx^e6@xH#cf|%q|o8_4cyk$E&}5lMT2R
z-j|<#?htd*(!dkSM-yL6^E+;CviU%VTj#<Lg25Kbp-KW9zOY@|SJ!fG`Qb>8=RqIj
zI(HiFf3C)J{_uf08q7_PBlexYP}2HY?x`pLLc7($3>VXFR{Tp&bvQq1cCXhB*5?;z
zncR5b#4c($uWF<D-1VNBN1gffCmnog6L3ycw=$siSm+9mrWd6amn?4n?UK_vth{6L
zf`i^~L&W*RulpU{&G`6wj-Qo|`-0~W*D^nrJ2I2~o=>Bzs_^m*4e2t=1App_%41)8
z@o%a%S@8Tqi{p%|n)}Z>#7A9F71%$6W9>p8`x(oPYd<R$e)uJIX~KauW``9GlwEGr
z>}mTRw=eX)#0=&WV!`#MZH(L+Y(a~oE2`%x#4+|Ba#E2=p4`(Vz_G8ryWOa3XHRRD
zDDRbT8C7z2wl;OK;=;=6D}=q*U#aACT6!b>Xo~CW%9p=%-|l+#=}?YU@*4IEnMIC%
zAB2h)PiDOMKySj5#H5<rS6KWn8<cOh-*YzZsKU1028vH-b~3%La^87i<960nU!S}D
zFivwk)AXrtl4Q9=;MBO;ss6zWH_oa}`^k4uC+Lu?;(}X+EsZ&io^k$%xtVix1dBcV
zCBqr7ZJL;H^sx_zmYnhPX5l}|?LzY&$g8u?3tIdqS4JqDJ214_et%?g%?z2PE^Phl
zg$jPN>|3*E&6N{2KBu{O%%1Nuoo6wT(}DG?NWv={zUfYevqetcex1p*#ll$XHw#~Q
zYh`De)rGnPYhNEY@aWRPx4u5jJ`b7&5C3@~rF$dd!Iq_3X&dhF&-=38^Gv&`%=gEe
zBj?0_Y?Dhmk|Z+glvk=z(HzM=joPvrejl%L8Xn`Hx`3;FjoKW~vxT<neosDg?wsa}
zi49#>o=+FOQ4-<vH%_^t_v%DF=RGGsG={x)KDsw}MIqy&!t&!sj28Kc)a32I!V|HZ
z<yP5u3G@378{cp~@8sN@-k{!HC}%Kdb_tKHjh4upqif^ms2c>SaeP^z@okQUYUwFI
z=|&X={l8ND=_Mzh^6kFziJ{#%URft%-QvI{zEhQ}iw~IP$jiJ}^a@n^TK}f{z)gcM
zTkPGRtF*DWNjNnKgv+heo<3R8CTPm8K8c;IEV)VwC6#(iN0sEou5Q}5l;?{5vo|6U
z)_mt@WPMoqn|0~BGa1^(w@&qJ3o*W>CG~aw8{_By-`Y6+egDkO^WXntr~dD5Ie+T^
z?-T#-2kon4U!H&Rx3+)&%Ew!GuUNiaN8*d!ynF8s+wQ&FWOJcbMsRC!uf#?d!L66$
z6mFGPDrIf|xwvb^-7?Vf1L>^e67@R+UMneOrN7?Yxnk})+e3l!FJ8pzmwt)U-n;u=
ztYP(p#xp7E*{OFOn9g0l#bbF|_~WF{Iu>(%+Y~otA3wpj%3^C5o8V-}RgK2ISDCCG
zmCFL&G_Bp6RMV{<Br`?Ng8%D;-l>hj4@2f`*88V5ef_qj+fF|d7Wwb8-I(Xz$Hhh`
zmakgW%J?qlwcJyoi5cHM=hS8#D(rD9wdOKr(p<hWT~}@QjU$VUtd^SDyG)vNyWeMp
zrsXYfY3@}ftQ)nnK0oGOZlZPV-kM0`l?Tl?T-BF8d*Fs?si)t`Yv00y%D6ZdMLs`%
zqi55-*QHgZheAwOJ6v2VcJx4%Vb9uW&$)u5Coh}z=Es5iW;N31i>0039DmeyIPqB?
z-+S5St7*#;=C-NtSQNO>l1F#3OhyBn3UlCr(p6t;n4@P-T-j>%Dg0JW=$G;>ix1wL
z{c7osNhXSNxBpD`TN`L3v}&8zVT;WTPv?fUZ4eL-j4EDJJnyXR>Z{SpnpaPhotKr|
zd8uHMuQTTYw*}4GOpg@qT+fu6EI3uXPh3e@qihp%^b)S+`^pm(n%X%FCwrzaEn?@G
zc%YPV;<Iy;yMvUtIIWx=WW826Uk`OZRnFb(o%-&|AvyLLit`sbv*uP`=#!C(j*n^n
zD>WzTrc3D7t@*DTS6WA3Uis$Bq==`zz89B@^n0&-_58c&xAT93R(kTZ2XoBbu|!kL
zPw;t0S82qIBR3Y87x#sJ+GN_rs=HF}ai-L~z&D&Z_Kz|r*Yk+kHOLD3h`n33_1md_
z@A8v-4@4T-w<PJENO0r*!)Nv5`14OJQ-5;nCx77$w9Wa;`t!tt*&5By?XO*x40yBU
z+_R_)Pmh%<DE#2>QvD@*HN)hI`^vR{olL(@zrwjm?>Ya4vd_x@)@I5nuMy;X`(LF0
z{Ho=bZPr?U?R#Cd<x5rUU&)H=#qZXBvoYvBp|JPgmjZ9AC8FiOCSRKS^zz#K0gtDJ
z@37EGue`y!@3@KNH^ce^_new45)U<L95@j#z`9s6Rn7Qd0QWxa(g$Zt9~N=jNL6HJ
zaU~s^x%j5fZ@W2K7qZ?hySPJ5<o*-=1)SWME~q^Z<h)sBs2>^dG}Zb3><t$!yY!7D
zpKEcLKKOfw@yTninB!LQOZ>O8^89N5A#`RIyJ~jcjsNL~3$%1T#RQslZz+8n^rCyu
z4e>S0MJliUmYA|${P^DsIm<q#np|4rdc^fhdfVbBJQL@B@KY$rR!>#^BXuZgp*h>h
zgnQddWM2n`-TU~bNG;GqsDw#u&$=(Oxc+~&S#9Oew>rw>kGSh>g^&pqA>I?Z+Fo3d
z<KujAtzY!uE3v;C-R)OmCLMhG<hsjOJ@vPS^=z{v0v~J4DcIn?Ft2JsxC6h39=n~x
z^-$C6>pZN)3?_IQMH=h<IyAwTF}!y2t6NNMKX~V|i>y-o*z-e9QLR%Uch7e_fr^j2
zIP>=8P5AJkE?Lk?X4m%}Zhv;2h`-A|r<*M-(}+22R&$S?R9x{>1)bdnaX&sviLF`I
zoMLv;_jO2+%n6}p!TRIcPfvPIc{;x%X1-0i#FxwSWgHZ{xSr0s{AsT6(Z={|XP+4=
zX1tVmCT;EHbvtCTIqQW?2m7Z#w0fW0U!6QR<;%*iOU~JEnZM$H-8=j4<Bs;XtNy#Z
zYPQe(`-$b>=lkb({xg>|d2xS=u;L`GZ(WNo>#kH^cERG0kM7Rz6RW2?{=Ocswv2!0
zt-ZVFF8DIF`t~U?<!Af<w3eT#KL2!cWxdMu^=sK<uU|>vP<y_2!PZ&(+cO`P`m$f=
zVE-Ka_2g}ZgoP^ljErTColR5i!+lqOuHUnphe=i>RiHNORG&*C=N#rBy-ty92~5p;
zk?b}dV!r&$`|~2&zUgkhVZGzK%sxFeUs)9sMozv@75aBwewod-URSz{yXEk8W|6fa
zD^p6>dW4D`2`o3M*M6~RU)>s3U1`TFw^myedNQ7hdM!PB>D?P@FIjINiNC9MrTf6e
z@V#YR&X+Gf*EsXw82i7tT`RKP98TJBE>*Dbcq=JeUAcZn&(wp}sUPAb_e{_H5Z9XW
z=fwP-Kl<NYdTf7dZrpB_e~Y(w{f{`5F8crDiI4J2%TLHYviG_df3$u|Tk;pN-v1iS
zEIa)FxW9k+QGRdJn~T*lg*&QyPi%52+;KZnA)>nSQNjAJi@Of*^#j!*v$OJberC0p
zwH~iwtlV+^Pu{13?bY84Ua=pm&zW+pK4!J%jUW6$N4ZZ<{;XEH@q*{nhR$1d_io-U
zo}9^4wI*Scy7i_X?d~&-43DT(v3M-c?q8$+?G^VX&8pRNkNnpvznpn}hsl8q7gz7K
zM<=|VqP21BhXN+8b1NV2*}|-JWm={6{;EnfL93I@HF;fm`5VK;+q(Qd&xkQJN$d06
z`QX*^8Iw6)8_w)?%QomXJRz+iw!_wXUX0%=<@VmqLS?)Oa=(pOU!KbAGLa0r_=M9+
z{ZfX6#oL5$6BL9$EWV^4Y8?JI(BkJJ@8hph7u<a9`NBx*%aXe@c6CW_s+tpc_<nF<
zv@MUO`9mJJhS!FbnH~kH_4AM3+_@t?rDn>!w#a0IJu18##H^~re^dv%OMm{7^7mO;
zQ>@%QBZH;Zc{ci-*OyoNxD>zcn&bZYLe8>9Yy#zak9BWmuVFEodG6Em#@)Lrc<xwU
z4t%ipLs#4H=AO?BUTiG9EW0(mAa6y=DwE%q<rjADIdNTL@wT4O%er>nVRdCfNurUf
zIHi3x5_pak_gytA=$zoaEX^z8`+<OhSfPcE0pC{ms44`!Rxyn*`=Kl0{+J~#PrG|V
z_DX|EyVkW9xvI|FsvaO-&3LL?Z}GvNOF^1vrI~M*1ZMD72rkv!!0UO{S);eYK>Ff5
zzQzCE@NAZ0Hn(!#bn(zd)>+Dp`_Bd)7sz2(j|*67Xv>qbamIE_?_(9BGlQ?YUbeVn
z5W^*1x0stvJR(@!@7sgF|MtZuylpAYzI?m+U1B`T=Z*TG6EzgyEBEkS6W<a%;p|~!
zzWXy%=j`vRPGw$}vhEqrq_5W_1ztb=J$c8TxcBen0?uadIU2J1=DUgQ46Dt(dy}=+
z_84ExGk$*+d^?ASp~9q`E#CL9+<UOoynNeB(;qq8Uig03{k}|kf$RPs-}G<)eqa9b
zZSS?-zedxiUp6prJG?#Lk?~-dmHD<qJB)vpzI`JnyVv&L&6(aCWovKExN`hN*tuuo
zpMRwMe)8AQ?DEc?l7+_>-g?5*c~>c}<uR*zLNcF0{9ZocLjQ){UX2evzc_h)>*^bv
zX@?jm>^}BgGWhkCYwydZ+u6-8zEQD6I9<x1jq7DXLsUxhE;UZMZ4+<B7$4WUu-i%G
zX8(#EHnxA#^1o;N&UoHi#1xP_vFzQE+Mo0Ex~BSVyL2+l>ZVcYru;{XB3{;~{<=Ts
z@BZyye#!3*Tdwkd^WCVM|EGV5y!l`L=D+x33ubN?I&pb!4deDLTR(A6nf3Cz_*d>J
zsuS)V*Wd83VE=)thlk?pWh6`fN*N}08fC2C?Qr12r<4m{zx8W1uPZ<8x#{|iq`Z<d
z9<kgW^IxxhuU7l5s+|8><pP%-ky?WHPJMsA^ziGPF1d3djEnf+W?j}edf}#m-2Dc%
z6=#biRPq(~%yGZTm$~t<P_E~MhU(m}#xqy@t()1sYw5$nyJ3IV=$b!$9BTO?@j;{9
zw1+}zcJCJH+nv5DUa);j#q|c0D8@Z1&a7by1%+aBxwLX#p3U*Qa`5-|`F!;^ZL9Xy
z|5$zLX*YXR6IV`~uE$&EDOoIE@`}>LIJebW6_@ev<tmPry2B)pxn_3L?}+UM3)uE+
z7i>ISVY=UO<;1Jc=YKF>{(r5$?Z4GmZ)sfqZ>9Y=pL71yf8S61iVw8d)x7KZ{#}>e
zc}-nw)Vn5Rw>CHb?*6jv9}C{*EmrWFzAE&7{O;R3+<4*_m2JNlec<{go40w3KQGQI
zm)=`6>5XZW?^f@+v&mwm^@^R9jJo-Y|K8oQ=j+$%AI@?sp5;zmRhhbL{nb}{PONAW
zDpo&xm~oqUiD1vq#%&+`zD$UCR<Mcn+Y+waa}QIlZ#lGty*O(TFO!A2q^h|890!Bg
zhL-BIuZ><?Q^Zu_4yC8uvf9?{-Ye?LRe8eewXKx#KCf9af5U?9U(Wo~dXekM%^2Rf
zyO=~SuyB3I5z*=kn#s<he&EN6>&(nuO`jURu(IDeDt6Jc;GKr*9cL{qmY8%WG1rj0
zJR9Gu$6Rl{@YUBj^vX?#<MVmWCb3TDm}X<Vv)WYs+7sbBbLRiLV)1z4i~UdknCI$p
ztkQA+lH2#^`P+x#E}P`SK5)%@c3}gX--QPO64FzSIrr_q6!Dtvw1RfpUGAM8rjjx?
z$E-bn%sZCF&ygI(!&CM9Vu0hao|p~y(uK<pMlcyaW7O)6EM{K6<xrdn>l7#N0ztq0
zZ06**1^yGi&OA8l2fL=4sq|#4)HyYqn3&@p%Nv(IHvIhY#ltzQCFfqqYiUK5oiS2(
zpSmibKyrmgnDX&YYdUx9^5xi_73m0gEZ}kA=!{2BE7tJai1Z)7C~!Hh`NbC#sRRjS
zrvu8J37nDAl10{%x4PU!Zny^OM;y7TsL%W~U+w8x%N;XUTq$))HI8Up)ua@9_Obqf
zo42e@*B%n;{K>=ky|6y@{?~QYXFNaedVNvWV%_E`XEje>pKv-<GbQlzPSa)cXH{vL
zeAShReK197W^%FniN-I}CAuDOR^W}554h3y!DxrZ>wA+#lhjXhB|exX=B)W%V&djW
z)5AY~@`{VwwC9g+Q&HHj|H_{?TmF83?9=D^+k59F|9`vg&3^AcYu@bd&-t&rpU>y2
z^uKp&TY3%~H|v*g61>0n=TzC9Q`Y9|RrOD46~6mi?q<yo+f9)IPG<7%diVCY6+|wI
z*|Tw<!=5Xjo;*7Hu3t+$f8F%SDg~>=4AlE{BX2)nGd=g*<1Te>kK?oFzE_jY&$*+y
z>1AWtldy|@XWE|pz9YPE<Ie`}g!WdgN5>2nPZn06v|MGOc8soQ-qvl0dUmG^9bRl>
zeVwDbrAlC1iuk1o&KZV}C(T&6?)|e+o~dDHK0Bmcd=b*F;(PgtHd7s2NZtDqk=SE@
zD_VpazA!(Y#awXiWLRO=GGUcw#;~PKf-ILEd6kwK#@_m}Y+L`e7>8pmW~=qy$S$|z
z{v?~W`sanxRcX97mrdq9S$<W0Q*@O}S9eafcITZPz3QfOt)?z1&FAR;{_hT7<hIY!
zJn7NB8u>Fmd3QfixqE>tOFDYlIfsnd8XM2KmS{A|d=K+x-*Ejs*UtW8&HkKsyQRJh
z2Y57pRFP7jT)`l;IJxDT%&KQ$VJUyCn&M2&H006~CigxzycC&IBfRi}#O1U(TFbrm
zNcWm|{nnf{EnQO9ea(NazsKg(_0)#ksWI8OnQfELw-W{bmJ8RmZ^^#UVz^W~EUNof
zqJggiOPgzG-_!v4#XGl^{@c7{#$}$J4;v=F&^P=WAzjTHJ8hHmxur2L?=((-YFz6f
z+hoNj-5uz2SjSlN>9qbE&Hm47R{f4ha7o*8?L);(@tsr89C>n}iQ~Kvw<p&z;{{w(
z4Ypp6^h#N9zuorOmb`P{+upOUSirHkkUKnJDG%2So7DE1OEl*<iyd6%Bc2{#JYVO+
z&yJYsQx7YY%2}RizqdcnRMzIz2a)f*%gdG)|L;EC^5wt|riEL}r6U>@y8qcJE7ZMk
zYJMlp5b090=Ca*G8_t9qeP<s3wh=h|XzAr-CV>wUJAa2gdoIn&W9%R?BgFWsn24$6
z^(Uea?qu~!t@XTeQFJZ;#Wx(^wVz)SneXtPg-Q5CmJd&fksbeMlgj6ldS<g;J-h6z
z;n6F%D{Q2_f93j~oRDz+_zQ`Lo4AYg5B^I2dY$2z{ILp`jSTq~iH9!S{Ouz0iTk@x
z&&hjv$LgQN?wc$r=GgZ0K-|N$ZuP0clTO;Nh?Ton!Za_{K1pu<M!Pea8xQU(3EPy^
zw@IYP@VjBGMP^IjlKDH7*#Zt6TbY^mn#DH2NPtV1*L@2!Q_HLl`AmoQDYN<8Z~U;Z
zzTCi9X8FbJV)e3`cYpV=YOl>$D!O*dBGqhH?I{=Q&z+z1x4!u0xBp+mcE=|DkAM1K
z?=k40&TW7Hv$3s@D`K1`yehiXeE0uDXV<;?yY$)jwXSdfrXKtA`^N9>a(VCXYjp@l
z_bcDbi&ZYs3EXt|PQ-!ceKse{R)1gYwJlousS2mes<nMfmuN~I{Z>|9E-sL<eb;^8
z1$Xc42|sbp`Rw1~Z*^wh?>~(CaQ08%((X0SxVHVy()GV~foY<pc3x1jYPm%HvkezI
z&wdj9W2pJY*&rn^bOT$fqWJu28ctlrI%~P7Np{yy>bv^<+U`AE>#u2LEb>tPYPmk3
zVM_|vY^x}%brtK^{fi3UUHWy^x<xe?9ym>yzmT)){IMYM>?uFfWGC0i@P0aCp_>vX
zwPEtvgbzzH=LKc?UW|<09Kxh=F+kh&dCG=Kue?tS{Mb?Q!QiIE`Z?bY`GiKjFVkMe
zB2m&?zoKmR*;%VLKD>N<<Cn*iHaouH>o|7&+KGc24_CZ9FzZ%ctSIveDZk}{ma~&`
zrA2<PiLSW3u|Ig<cGlw5$@Au~*1OUs&DMP=rBo_D$xunkD<H1H?*N}A!_3LEPQTnL
zH%DDO<KwE`X8Gndw*32Dv=m#e2G*4IwT25e868qu6C$d|YBv9KAm7C;Ym{I7zNoSD
z!qOi{Sd*3o+s)Z|AVKS_L~GK`<qTiWADFXTG*b7QN9rc`CwCgQMou<+uJz?&Bu~tl
zfSjIH&%UiMS~I)zOW2xefAXGx_<OL^a$XGwlX~R7gFp5z<I7s1cCq!k;rcuqMlqqj
zo<!>j(~jP-KAmROH_!Y3s(P2qOCKhBoZMtN*K?1VpK8IfMRVJa-YE56bk8xtwqaTD
zj3w)QEy{~tHe?)0;$}QBTk^!A*L#`*&i`vW>|tWPC(UffcfAWacaLmX+<Wtv^8Gzk
z>$!ihWr$s^SbJehzyoisdI_PtReAH;JZl%U%}$@!ygcFBajUc^6T54qF7KIeXTvV`
zEWYDQFD9y{t4v7vmuPbFNGa2#H`d)MCl?$nT()yX@`*f_7bhh6mOfIxI<5KWrO5$3
z5o$8aQ|>l13ETAhSL(j0QV|!<N$7F6^PRMjb!Lwqlb)sfQt{4kwc1IdGZHTD$v<s6
zdGmzM+7eNN?d6i|^!{YZ+9w@7?sSCZ!kM`z)7Z~($UfoO?q}?H<WRt|4TlbIS|Yya
zSkbb_5zl-(1EZyMIgXm17J1;)EadfTqGigP@+;>wjBcNw$}@S*5*tU6<o{-ZD+Jzh
zvi&kpz2CIoqV)5%5bo8Uw{Oi~Rv{OYy~FIUN1oDTbJw4SGs2eS>y+^KI4OOokm0;#
zDz{P~&1jy{wt}YD{_0`t5}KQ2GNx~v_F-<(T#tSOyF*4xrB8${U|!~NMeAmHV_oYv
zw*5;tzc6HY$n%9;`P-#dwLXQrdt;`R{nJ$1b?8i6(8YOuA|~?=2D<dGx_4$nOwVPR
znGEOW${wqFu;ZJslY-)8rs*YzV<+Ew^pa;{yg`7&htQJH*v-BtSL#~Iq={L^Jm*u4
zG>q7}uEKUs@9}UpMz=l-^9Gmj1siw8ZR>n&ZFIkG)|nM)?_X*>d9|k?`MAX8gk$XG
z9oEZUY3ud8TWU1(nSj4d0mI8g&eN*Bv(&hp`DZo1jAr^c>!k2mrgMAF1YI}1<(c(t
z^ZLs>Ca^0^F#CP3fKkQw{3&6V2M1Cg9*Udd$WgYWu*#^k<Hjjhk$4t`>b&qQADwSM
z#0#}p_eJ0LI>T-^J6ZSXwX+k~TO8!9o0q+iZDA*;$6^J$*#TcGYjbqMOSMF2aP@_4
zGdrX=Pv_A#yX;2^%}OOTg<X9quX_S#-@oI)tFZL4B-^Y544-B`SUx#PxaZ-&p5@BZ
ztxlDyD>BL471(M1%sA_t><ppL?T-#j?-a{2z0_znU1q-JszaTg`%4-oyg04)c<MnF
z%eeZf7Qa=W%AGvoDO|PA$3)<4zlCDy5zY-oTUH+AndS6<!$ieT#cPszyNt6I7Jh4$
zOj@ksAC)C6BHs7>jL8~h>5i<(mnWD$-Pv7pKqR@$Nat|PJFS|$s$<+%3yjXq+t9de
zdWF&Fb^lKPEZg9nHn)-Ax3u@0a{k4h3HqO(x~lZ8XH%K#Q4y@O`fMTFQ31O&HLHq4
zLVk|?Ti8#n35wYf_+}ONT%mR|_USc0jv5!*>;FA9ZRe)cbvZLnZ%th{=ZpQF^mG6B
zZ!P)rzPI<<uRZ_wZ$1UO^XuvV`kep&|6E<zchQ4eX#cab<sX0Fzjf!-{rG2f?@h(O
zexI(&bno!}_azna_5af@i+jvbo35#xZ?=A7@-z+Q{9HYO%eze^D>v`_*L>>4?6YT!
zCb68mlDM7g;6sJ?`(vH%<$T*WyJgSTuMHD!xBvQc`>EZ3)^$ylAs^m0Ki<3i$D3Pj
z>$44xU%T-{Nz2wspe@3qmv{b5sRMguj|qS4&t5)PMQ-74*TeNoC$?3de$W+MKmXua
ziRXrC6)6WDC#`SIX20Y5Rl%mgyGp`$Qi)98qxytpvQbgN5|>=(o_YO8_+IzNCnB*L
z;k^s0WHx?HoW17P$EDj?<YeULzxXuEsLC+)X8yhOz^Ic=^V4UvHD-$iWzCuqYc#iU
z*~3fg*aP^#?CM<UwY!MdKrlVFq2xoq$E;;<KVI)&GpF`-w=rLe)V4Urd`6!`KFfXy
zS{W|de?IBQ>>o3o7OZBDGdjq%eA$^@m(1VIdOdN1qO9#2N#$#Sua<a58&;NOxb1Vu
zRF_$>`BcK^R&f)1L(^-%P7<>&96LE7MP*UxjJ0c4l?lJ{>dR<;9nZQ;VOhR%*YTE3
zdH)|sR2%y_lq8$a>P^eMr74#1C$&2MXJ*DN2{snP4X)0KSxM?g@0e80-F9I@-Ky@)
zNvv1Z$}KrspLQ>>7G3}BWsl7Swi4N>AF00&Uyi>gcesfETwz;jDwD9qBh}^gD;c}4
zFPsu)ay$0rLAGL-r>YWD10L^vlczm1Ni}#)N|*ZtO}Ufb!nXWB@u)6X`f%<K|G9ph
zf0tj4zF9x*L*&hRx!eDOQxad@=zO63^Yhu&-!-K6%&(cLB3{0lqx|``@M{Z$l6|uS
zUk60qI#IjEd2M@idsJ)o=8&Wx|0cz}p7pz|a?+i&;%vtFPoGqFUOU#Wb#m*rQ=UQ+
zq2X`UC7wFjoD@7DHsM9o>-*k|Zs(Z3fA^_&Md6CzJegg;Z6Dt5`c@=e_WQde>(R!h
z&i<kfF4o*vFA6oMt3BK<WjuG$0#=tj@&{S%Cf+cT)_u~nZg=UOnhSp#4r_O-@~UzD
zD|+Vg%h;{+i1w@*(I+=>{IPHpPRUKudAzxprBUiw@=56xeTTmA{4d$?H}QSNqRoa`
zR!VofUDs?rseML6=_||id5f1ho8Or~VNdLdQsH^imTx}s?d$}NErxtt{Qb_CG<CGP
zrX@%mz8&HB<NW-DD{6Oq%#!ESJe|vNi1T>z%@j_TwUVmKmMUE-GxWJIt^Zt3%U1dK
zUsSu6MeK8E2)SUf@VeCFmLtz1jyRp4ysP(0zxs~$$R~MG4~{&t4*cjBXv??Z_=ej`
zBK2+447((_yIfhg6~7s{M$CwO)sl6|EllHc)1}f!HVZm7^sxPzqVbta`9i6W5$lu7
zuVt3JKT_ez^E`42yWb4EAi*|<;0PI^CSjSJ;y#txEEgm8R7CfAynp;_kzn`Pq_}gf
zy>}ML#jQvy$c>vc;l9SE1ztNA-mAOCrfG2RR;%xcIr1+fnOc|l>#FHCtg+Evk|NUn
zMlF72){7&Zvx_g4ozreDdHpc>j?K{nl_?7kPW-~e;>xB})!n<;xq2nb^V5P?mmP^T
zJFQaN+En;Baf%z;**qTIWTvU7YgOD84@ENg&UF(PQuW-p=4j~`&VvUpZ8|*vasA<j
zw)5G{)%Wr~F<w6Hbg=)(%*IyJzf-uLNjILB$k96QvR%{Ca!NHzxtqtrt8dlx*KABE
zn{_Z|SDU%6&(qz@KGvl~9Gq}^?Uva;f|hGeY5jAb*IoaOaqtv}i;BvVj`><mUKbhc
zwa9q~EBl;?#%nRhv^TTbELr<1=hRX|eKk`@wUiS&iTjGXSFE>o5ozwcTI;klqu7r9
zl4AuMcZ~R=w!?C1k}rI=abyRWl|_GeEOR*eYUCuIQlSHyic>`w-e$7B+qC!A$wP&2
zE<IUtVnzp#i)dQUmqy>11?FtQTN8YkCLjN`*`w#sA8wY}nOS@)Gh5a@W>R1AIZ(#U
zM|5WKztV}k>m(H`>TXJGey*bPb6V}r>5er^-PT@NF;!}7iD{N-_pT}D=ltEj^~;a*
z_o_B8`RAOSoccfhP<rbB`kdeYOJ#0%Dr|5RD>wdkf91=mPxoIDhz~or@XV)pDTgZg
z)Ahd}PWxZxXqRE%cjDGQw*?W4PTb1V6F9rcX5!YpKNokcnVV+msWd%nOM`#oqOvnP
zkJKlh+uU&E*1aEjLfN}Zug{p=KI`x9r)mGK<M^LO1boU#n{dE=+u6p;YLCw?VCqlX
z?UZ}Hg~8y#)=4LPjNVk~XHU-dk=!9<<*7L5-hrD@XL~arA2gAvaoq6S?ZGsb4bMJ0
zc5G+A^D0sP@W-C1GMi^EHkiLOV^^PwL|%#Lk-q+xWXoRL;#q2kZ!)m5yZqQO$Ed*O
z`Dv~Yo8`TqEzSyTUaixAtm<H!U0Xw3Y1b9&t&wLu<c|Gtco6HMV*UJM#*S_B{`*qo
z%<orj-v0lUaGc0-|9^ka*JrIYpa1#WzWd9$pWOH6i+sJV-RDu4^qr#0#ddzB>mQrl
zx|Zl;F!6eejPga_J7-HXQlHBHT)A!Uy4!)rdn8yK6jCz(FMIZf<51lB+;yw(y?HB_
zEB|&+;W?4a1-n~rFwb81+nVFJ+J{-w?#+9j{ry7D7yG@ltd{@ZI$iGn)!eP8zU+VJ
z^*{Ph`qKZlyZ)6+r|+A5th_i`TXucO(^opH9#3s;{Am^UQrWzuB42j>ZQcFTrmuNi
z8qHndzHfcs^_RK^El*!o+?C(@>}%Tga(>T3M$`4T_wC>P*vxkQ=DPda#IJw9_4HSq
z;E(VxdtF(+F2AtsEW?(9u!UDoxY&Eo70P>YUiRqYh>$s7&mLerSHu<0=@zZGqcMoT
zr@@!?|LI0{(+S&RI?tUn>*m~E&=3(QQ}s;j(4j|phdtP4uqw~ksC#YMaZicPVyhgD
zTdRZDYR}uC=BDUkl*znt^~0HMQyQ1^uub3hch0N$A2RRfU*4hjMyzl7hJYzu=^GC2
z=_-pkr!)I&Docy7rOWZXWgX93Kl<oIO<_Da<%eOtMb#RSnzRiE)jF26PJepu;O|&<
zTi+(rfLR9%G#ayRC2dH{uVisM$ESHMP+w75DXD{-DV^2t$K;n6`?MbK3XuudSST%a
zprpkzzj5u(6R|Pd?*(OPKUN7bw37&l{PXn3lNb5B_rH9XTY2p7;pX`dcQ=c#D*EyH
zp7qr%6YYo>A2fU0|2>h@b^koM^njdnqsjUOlCtW8T3ScjQlczELUK1Y)ynvN{S{#0
zDmSAvNK|&0f?*-+q&GLFPI(!$`op~2ZQUoM7h0aYq4Grk;@@Hm_j?nHdd)?6FLOT&
zke7_oQ{xgAdU##%+MgpUmRA@_oNe2qD8bi$aM_h}I+rho@34~Mzo4hfw3g9wsf4za
zK+^M2MZcCGybHHHoG~YP=UdU;hkpojhq3q99^%{h^ue4<>5DsiLmC6EI_F#2iLzx@
zC?5Mcvty2e%tHniu5$^0PcFIgXU(G~M!oMGal6beOgz6%`~J#wMp=!mX$pqkFMN_J
z&it17{K9m@GG;~btcIj{>$rG7$ctwmXj^=5Go#m^uVD;Q3RV$s{wl7RF2ujuKD+Bb
z2k!~*A`YIs$1%(GiXN-{vz~LQpr=-xYj%`GK(DaG^JS|PreAf{aQ;yz(<|KaX>v|!
zx{^%PvjZxh4(j@Q%exg!u?*;9RZm>sXt~#FYgBtn<CI;?+7~wX9#CblH`t&f)AZTp
zLBq<u4u`%P>=C=@x-lxnZr7^WLDLSk+a_Fj^ysClVa7pbiz~~S4$ksQ+Anu$!w#cO
z8hlQFRRWbb4OljD?|M1qxhc2n#sej?Sv!yE7EBO7w?6p(<@L+0>y>Jfwn-em9{l9b
z!Utw5SM+u2CwB%1i|Cx1`oKbMWs90rL{h%QyO$3#zAmue>~O?Y@WjMlPR!r=SvKr@
znY8?vaHB=}w7E^mAD=C7aM(5R`N>e@i0!u*CO&c8DzUdusqZ{X_N}&c-_O5^4Jcad
z!?GvBUMEOpjp^yFPbW`W;a(gr;KaD0dx!keo-RK9#mm}na6c1S@Q__^e}Ts`y{3nH
zA#Ue-*qbyeHl?K$SU+>%PFK;5OR`wLp}*5@bwPpT1#c$r-VC;w_RW6|&9JX2@qBei
zFfDpc>Xk$5iZ}ZG5c#V6f_;Cgf#=;=R?oQ!N&$ZQ>o$Mtc-|K{O}qHmsW}^s(rxBh
zCX43%Os;$Or+)6z-~VUr4cmO=|Mi%k|EGP3{P|z*{{QlRg|6K{S>E3{c*;NG)wb7q
zuhetumF*M1Kdd_xx87z|+R3KU_fiYfJDW<&Ya3VGc*=Qgul&|qf79~+?rV%QKXrBQ
zx$l!#@0R|~6JNVw`UVcsReM{$_w4y>+b;4@a<@fOaVV>-3Zu?7Nh`Br!)=qJ3wq>C
z8FjZvz6$9&U3L11U~7rwF_8(<GiIg4-L*U(G4Y3*BIk!KmRsM<<$e~^wCo)(zg6L?
z0<o@%yS92Xd+n-SczQzEB`3?kP!07{GbF`73bggqnI-dHEd5t;=*{KTF?TLSO`WzN
z?e0!STkD?0i5KUZH_yFvOrr3_r1YLu^E@>-yf8X4cfu!M-BtIm<mGLjWuVS@u|Rgx
zkA2&3ZgMv8t2jIN0&A|x;R$ISy$!3cWvvb?KKt(dpLd<}{i6>)I@8N4w*BPS6>Bos
zi*>tG&K4h^-Pw9(amn;mTOTC8iYt2UcriKcZNv-Ck^tF1zcz1r5~mxk`NaL%sYTJV
z{1l&g_9uO5k)AVYfq<>8)8hv>cS`flowT_Bcys&N*7;w>t{Psuw~K4bCh->&XFqzl
zwR*$$zjD{bT0XC<wpn^5u4bk7e6PJq5(d9)KdmTu6m#a<g$>JJYt6IV9i^cybLL~u
zs>X_ilMWX6%$Jp)FB5As*GFw@mzt?@%pB!)v-%?0Z69YJN?7x5%ESfdmA!VKPcX@-
zR9`ktFf!uF!~-es_|q~^g(dXs9*n-M(j5LS^-s*n3~k9=)y1~cdcOJk%>TdrRekZd
z{qK}-{GXNjWBqIG-}gcHGv0rE`~SMs<>i|{#a=#hYFhZIsOs)ppH59;es}nEHUIOc
zuU|ja%=Mloe0}}SBhxk1znO_~h)2wuv*X|5Ye(+H+}BV)IeW8?_ym#byYKr4y~(|I
zfAjx@<~YH7q0(RSL{_c6`L5v5s=o?sjZeL9uXE9Ts%m+ytkuGJVwYRv(<Sc|u82)^
zyqIyU@Xsv`Q``NgR{Z+X!{%zqX0>V3nslKzwV(baygwp!Z3#zDpGJ|P_VXwnpPKCv
zOfkVBv7RxrHT#8{ZcLby_^bTjw+E76jU=ZZaeBS$!t%Th!-u!$K8xX)eei9>%=t?f
zoN-^4Evb3kHR*;MSE%r0p>~(m-5Dm6uFA3{l`gsZ{fy-fg95v~Ybqv*Jm^_?)H%91
z;q0V~;fCLC{MEZ<yWYQ5!Fck#6>}L(jJ#CV+5P^_^Z$zbgYzBUNza!BRm`h-xa(7%
z^}Q^+=MNlw-FN7f_GPg~&Pr0<`>k2xp6oH1%;REa@ARcxZ|+=WvsT26+xfFWj^Wa;
z7k8>N9^Wj*d@*KI;|zz!X*v5EJFi?8eC>F!<D1VLGZCR((DM=Qil6$w#cXy&$BUJ}
zY=5s<6lig@v`4QojKj}N&i$bN{CjWS9eyVgAG-Fd+wSJ|b&{*!ET6wBd+javQa)oJ
zHo;RfnZKGg?Pb|$cH@5C?@w2^&B|YVz4hP5-U*NXPx|QYs=t`ms^xm8FYEg6_v;TV
zk6)3Oy!z(L5_5AiGxKZK(s#e!dl%Jy?Em%U%^&^kx6VIg<HXWp(ab7yR!>!C>cd6q
zQZ3uw&0#!aVQ48?ef$0DwQJ9wl`5E{ZLu+?jr*amt%qmw&SaTD?q@4?FBDv!=cf5+
z<)qHpuPQEv9Tp31yBOK}kHvn;#Fbel^5=cupL3t~>HgdYxy)S$OCJjEV4A=7@OzI_
zmMg?(O}P8`v81+oW9N~n>F?5iM01vCH|D8cuwCWwy_wza+|B=0-rN6|-g<lP)W7c@
z^QZoO|M6{oIlJ<%*@++4y<M-<c3q13v=YPnWS*G%9fk#qAKZwnm$_N^_~YDTuV-`b
zI6qz8I`7X0zsJ2_izcz?U0M9)N8ulSzdg^3&T@P7O5eYjxMyE!zWn#*wGFOY+;ds?
zs2j{R<UhACb%9*=tSx18m~J_pcqWm1)7kXCqo>IWnTsx!p7j++6B{PA@NE2<(dO#x
z(AaOlmB+RE*tb1zAJ5%u+q&mg=0X)W9_R8l!6@ft6$>|aCX`P*wEm%sY_k%7_$wFL
zZ<{s#N<Etq5OdeoZjGjq$)_#NpDnxspLOsyzF6rUs6KmQz8JeyU^V;kS6?5VtN!}#
zL&V;I?6Yine!H)`Y(Dv##kDhYQeenb3GcYJnOkcsjW3?ym}uY7^=`u>rj{3L^7gkz
ztZJIvcxk1y>Q?=d$va{lzux!r`?oh}jtgr`>*RX#4RT2`s|$bXar!T2SRFR`@NWl+
zOS?Ngc(=cak2Ta|nfd#IfqL2X1_2Kvp%o2Im-J_LPkwYOjN`CNSMLVF^DawSQ*x&&
z`1aYBylIvc|ILvpWcQ}GaRNu&`5>;9(ryNe1CP!9o!!HtcQMx`zp=niL0;kTv7h&)
z6|R{~`tnBeO^Ez|$w&6tYqy3qTehuA6Xe{H;dpI#bg`q#op(Q$v}X0R-0&CP!u`4O
z;KiM%C$UaRmrnmPsrTCFHGeid$iHAEw`|hdwY&=|{&d{>S~TT?4cpO-x=&7}=2Er`
zivO~oney**<i9)CpJmQiEt_DsCNKH+uYyg#*Q@W&zwhX*@PEBE@5~M-nVP5Z+S@Fj
ze`$PCb1p!8#Y9Kt^{1mcj&1Nh!8-HS6M-t$Lq!ojKf(@usnMQ);K(b{g*VPl3VJ`&
z&%M7_bcz6{&rur-DT#(^HGwTD$Hc5F95!C?SY9JpvE=!OB=x4r29uYqu;xiyY_N8^
z=pRGpOOFd`wdU*kA51GTRC(Vcc!p^mTd23!^UXI_tMQl~n-m)!G{-X_-tXfCg<bx<
zZLdXpxpk|0?y(msvNRV5?BtMB=vIntKPfHDcGfL@!;VC=_SmKG7rjy`^eU;m&c9H>
zBfw}9`&phwMz_FoTdY`2g<tPDc#vnK&vl;&A+;O+7Zi;frX{*nFZbXqT=zOPP;}X&
z2{}jfSC)z!9!`}sTdyzseaG&jf?t1IWkfO?R(LBd+_=H$we-D>$qm{8EB3nuO<SpY
zL(b~TTuD_!cc$|TLuV&3m+($9XMMfE@NC)a&u6tW?PdwcF7Y&4cI~+5wBL@O4@9q(
zwVl6IMo(s`rp;OFwX$VDW3vCM*w0_?A8Wo*VD@?Od&{KL>^KVfZ%jN8cwA-nTG0Y^
z8HcP>{yPp$>JfHRS~ww>ck!XpMNRw9Pr6g6voiR>u6MjUZ<f4@=-PkP{&neQwFUYM
zDwJ9jL-i&3+B_%sFJ8Gj<GJr9@!fK)dOUG)&I$85PszqV=QoPC`@vo5C!=M(vuw#T
zsV41xZ<6>|{kiTZtvRDUZ|n8!TVEf)opYBn?SsBn<Li01#f*Ac*B_lC-<s%R_&96v
zV-K+tNz?D1U%u&5cX-uDFa0{1y+3AK1c&{)FZ6Z4<^S`)F8#G%8@4<8(f^lg|JZwj
zclEvfueq0Tf$BBhdxe5Rf8JGaP2M~E{qwxs^?&U68S3KK?6`jH@L#*xtrlIERz=;9
z-*@-R#7lCEcU(Vax=^cM<$m734IY`ZL6<V|UCCHE{o#Ytk+aS;$iMToFcNdtTR6F!
zRpsv4GRuXv%}Vjov-vwpt1|Ykk2}b$qPJjo9Q#w&{X8d@GHg0z+x=|!X3pDullK)~
zpL0C@dEm6g5wnlhcCB}1UYwqC;aTvXn_(A|vN`SuypZy8P-9&<yYXbR-ByXETW%_Z
z?<_s~+;?`!y=*y0GYJue3fVj1KJoLH3HkWkYv#N;-_J6@Dx4?7x?`Sl+45Q`mX{NF
z-xlX4rF@gTrg{8Mp3nc|P47)+zc7-zkh`=ZSA!$&*gL1Cr{rEv4XO6$e=EI=t)@lu
zRSKWnfweOwg~j9MG5#&JnY-|BXLgS!yQSS+-y_F5(?qxUFH4EEK71fLh@UC<UE=Dk
zZr>WJ|9BspCO>b*Jsl}I-eqgAU10z6?dfHm9p^%Ps^$APnn~+cv6Xav%i84B+c4qF
zE!Rv1-N_NA>{?A*ikIBBFV)`s@WCX;GfcLI97j*Fbjb;AIUQ#0E3;5(b_!RO&&F-D
zeV@o5kkJgYoX~3W;;>baO~|ah;uq8$u3pJLUOjnXQ|nn{B~HmOXBkyt1rz3|IR`RD
zJmNFYlouZm`nX22djA`fIlQJlhc|mN2}?+Xq&t@W{WCLci{T1|o{rXJ^NUy84#<4;
z@>wvcm+?vS@vc7R30nQNJmRda>!$~9SQwZ5dOnY7BFn;4h3nE@u4l|XXRu7_rQhMB
z0fim=_6jG=I3UY&rKx!(FSo~*WsMduTpkK+*{}Ebn8m68K8vdtcv}^0@)t^5G12Yj
zRhcVi&b2Rg-x_OtDK+%n?U?=Vd9%L#U8{3VJ934z*W+9<mgT<Nw{P3m@PkEW_SU`0
zynA*>=7tBo^;#9{xwT*K>c0mUKiJ<(Klg9<#y>y)_x4`f^LP8^L;qusfi~}z{C>ap
z>2B-DruR2bpHhp-I(}Ej@Y^)0zU%p>GSlsfoZG*f$>hf>f7OpXa_^O%!2FN3u5Zqs
zWo_GFBUqjN*IjhucC+{EJML-3<;M!Mlw=<{ntSN$vuk^$>N55@tltyy;&2YLS@r{6
zsU=?yAN$pMFh5?hmB~5F(EYwkM4OiM;>t23>F<J`Urk=bKaJtm@_e~X=f=}jfsfbZ
z>7Fu6yRuQg&5^5ln}ovF=OU9l4{ZJ0;cakCIQz-bD&HoxMas34O$3fa^n89`_|2X3
z*g~&^#-=?>w@iyT@K(Yw%KY5EE6iN+Hm=(9<3x_=350~OPUkXP#v8if&E?2_WfrF&
z+OOJG9>M)<^W|X8u97W(!=mL*?rJf0^4-T0wjk-T247(4?b)+^UAZF<t4{ruBaz#E
ztk`%4=ghE^&-%9M%nK_tD~++{J972*bC<;h?S6N1>gF{pIX0Wa*gGRfXwvrb7w0<C
zl^?c->=s$5zfN{e-lQ{^Gd!m5ODtht^-aq6N@SCMz&DQ>PcO`W^zXu}>UFOV6-`}h
zu;4)DHlu85%XhQh`Sbj$s+naM`opxxJ!MVN^5%_h8+wynaxXso%3j^Be}BIlvu=-=
z?#ECGTjSkjkN2qE<Z5JQl@`?9R-L3b=eB{$*)un$e{DPYZN(&umj?V5Qzr@i-nK5(
z^3a{e#FKd^U#0dYycba}uuQwpd)hVrWCfSeme{P#c0%bb>ilnC+~9UsKe^90W%ZlY
zq4%Rx+@lv;I%_jJ3brdd?OrHU>h!TrBInWG9=>J4!P*yZnwngF<?8S}>~4szoEx)=
z;pUst*Hw;J1g}Yqm}>FwqUb~3i{%!Yk2RA&HGXxO%ldIS`<9)iaeFRb)Ug)#$=~PA
zY?7G#+odMP?}~}rRAxb`73XtU!~@xX&AMsLRxESQ;!m@{9$q^x{o)(``=mCT{&usd
znxUZ+ve>|Oa@N6g<1eWk)sKqBH!W{UbGsUQ{KYasaqolYg>Q7!y?%Mo@VroGj>oQg
zQ(j})2WgQDH+#NOn8lS|c5?okpL2W_4(oh)(r|6ci@DkfuMS;)Bjm&J<3&<#OJdWX
z8P5-J*2pom&%Pt|(=tOfgf+NbEBakRp8kI^!>tpN<H8>b<bUUjdn<eJ>l*{klZl^p
zFkRdI)`G`8SpUkis_=?Ees$fIt{Nxq#pN+A>wnDIlip<}EpaU8QB209?WuFBB0h&%
z?Avknf!@oB_5Rl9Ph9l8c$2-8wfVS+&XU@Dysm|Be9AV4oJ@VLYZSOhcA1Xe`3}QR
zWj-aHmycLh`%D*Cf4^a&PqCV0^zDTYXT+vQ=opFqT6BkHvh=Zlm#TLs>5Klpa=QDe
z*vn`C{%`*NKDJl+<S&C?`>*|0{BkbtIct`*)a>f->u$C)t(t9n<!MNu@!iYWV!F4P
zOj5n?O^XpJzV`E-`nt-ADaz8PzWlj$W|rQDr6F3zMn*=DI@RChy*CYZf3Yv;e{T58
z)ZF7Kix<kCh>^3H7!Y~XUM)T;Qr#~{d!v|SFjuD8#FjNXBv#EV3GiF0R~RC)L@Za~
zj17}DM_S{i+57k_#Wn=35o3MeBKj_JwaB$K;&M6{9i(^67CtB>u;8KaVM{CDPm1r^
zrU-vg{Vnsop5wI91CbSKii_8Mn6b@d(y7aAx{IE+7t8Ey3^;BQ7%H{m)tr5251uFr
ztlY>@a{PhRrbc7-Wo7#I&Qpq;9)40vm+cok=owhak+W3fC~NDq-tLax^Dn%o6<qR~
zClYjGj<<Wpg&VcX29gqIRxe!_{MlvGbmeq+Q`c98X`gPLSal@y@NAaLJ~mor26g!f
z|Be<<?KNfc65WxnY4FNHNX&b4M5S=py_Tuw4<q+*`b#cZeWadmy6pd#Z{C+#UH##o
ze)RvAp827Fp8tGoZya*DMseOs-nEM?f|*T9H~e*FGI8(cyC9Q0-66sKd{U5X?t7cv
zo~0#M7<jjtOn#N|yZ;nh)t1@-{Yk&0pF{?xU#M(UY*y=B?S4C$=iBjHLGHJ2_qSx*
zTDb+sulktivXt}imZ?#PtuJ=Vr<$|{|NUV%rK|Jthd*aO_NQ;NN$z%h#8`Y_hvB4~
zaSS#Bo3s!AVrnY=G4=0)%Xh=2P34*|e3f8%WvHN_xAd#l*}fl{JpZEjHh=ghZ<x|N
zPxfuXfxNDb?;kr~`=;+1@{wi3bMwT64|jF<y3J!Rv$-O;G>6$^H(&MN7xx@%h3{AF
zpI=aVV8QIv`S!;@cKF?OwJDmhamr~2jhJJew-zT`KmPi6C5KjUqh4PN_p3}vpLrdD
zpG@VRSjazF?)Khi3Om>7vQ3&S|ITeMpIAEE;G)sVw4x_hAN<f~6y8wKacG~wfA(EI
z77<TVBzJ3+J#2Oq%Hy$OS(@1LU2gHp>-?X0XP5}Z{GXoUQ+Z12e^UI;AJSG^554>G
zFzT9i)?PiUS$ltfusU>TdSl0=g9XL&xGh6ZKh7<9GWA6KB(`J6d+Kt(hz4h|9$g~w
zqkc}-FOz+@Iea{tFFsFaQwv(@FZRAh`_4@fA;FJr_q?0DCeFC9w1u7NPr(|UKT#}>
zi&83j+hnhFx1?>2&M?^_c35ivZOPZ=_8anzUSDcjoIdHrvkixO)$i{qKCrL+oZN!#
zOo#ja1a3()k#AEGPR`cUb6WQL{p~9fYdlUVMtoc&_UN5jmg?MKHS3Q_f=~Y4k~wBB
zm^DjbdC|gUyeS2n5+B4VWh(3ZTgSWpU%fz)JM#qp-S(2l)wJg^NtZGmUYMtIXy&1Y
z)beE;wEdH(Y!3b+HGOy6(VRIKJG(5_c~zWW@My&m`@o&k|K417PCLvcw9nwp39%|>
z$NU&^pEKz$6FFD{Ja(RQV(R*F%~yEir}<AMG<Kdg6|z2JF}c?|Fy(r+TKVD1<ZsVj
z&z|_(ZtjNl*WCQnK4|V=HZey+`tiM~9Ly^(gnt)$a&^`$BY%y=W2e_NKjR5K5|>t^
zb1XUGzeL5v<npy!EtulvW1q@)r|pftn|~qx?Xfon!TmBEEj&T4r>&#r98!9*(Rb--
zHQ63hq3c55T6m;P?-l>nP`{v-ct(HY5kvL};Uy1z!+1>k5`}*I?Ob|brRC{^Y@2r`
z%JQo|P)Il1d&uf|+J~uY_De-BWh?jCq<6$!CVBC~Wodg>=)Gu7niTX;P|Y^;S-;C$
z4ZB>iiBm0~&7AaiP1%c?|6jBz8&-V(t{C3DqqAFk57QTpcUM|pEs$fgnW)5~##?TD
z;k`ub7SYTNFQ?pkwmkcfrlAEh*D52yNWbQ!Q_0CH;^~Z6FQ|*fwr$wp_2gTs`tu*M
z=gv1=sdD@6{ovh!rLy8;uO*Uo#j>5F&)%4Mv*yxO#iKhi|801)OFvT1LdN(-@ulTo
z1ugP@qt?&5=J~WVD80ORg59Flrb9x{SGFym`z?;i^~!rq5Ak&(XFjUsL`!IUf71D|
za02`Js8ZDs0jc!6H=09!EK{AOx7hKD@m}-C>-OoyUEFg;C87PGRga+K<OL^07!sE7
zEi*r9aNTU;+^O*=H|(1tGU3eq-Ewcjzwk-ur$?Geb2NDf-LZSP<IwLtJ#&^`U{>T^
zGxO@BR;@PPw}<3zd2<;Tws0|La1<q-ZQ0qP>2~^zdk)*<GOkM#Yo7h6?4H)z!{L_^
zAgKG|t8a|WmMxyMKL|WE)cWP5wbdoV@{78Rq27JZr8AGW@<?RQKXAoUoVn^$u<NBe
z)7viIyLn%2Q^=eZ-}L_IP2Z`Uc=p8|k?otDF3!I2tx}qIU7^Uv4Fa8K4}L4#$;VqV
z;pe9tzZR~jR7;q-?r2%Ut~JY-yGE3G{G76C&uru5ce#_DSlpT4#5hf<Jreai>b~j1
z^c|BI?O=*#wiQk|v`lfr=7*)6tNepAIa5^*a_$vK;PNS3x4QlIBh?c&8!U=$P5G|E
zwBNw-dF-Wb&-9B2JNV-KtTvhUXZ*R-v9Tg8#iD%sp<uiC8K2wankG9H=p9=ma5d!z
zM=X!b^0T{-?s~^MWwFVrnioH2XNyVS3iAH!bEn?W_mb?VkR+34x3eqMpRP7yX_@%6
zh{wmVqK4)1+8?$n0?lsmq^{q?-zVDl(zGc2<iev1EGIji*DB2G(=yr6s;YK%+LT?w
zYuxIh6kK-Asha=u@ADH@p-Ei^uNI`|J=*@|+rtAJ&F;=T;47wkeUhu$)hvFS)py_S
zG|KNR3Uz1Ceb2H`(L^9kslM-X0>dlm+`TN(i;F%p1th;?aozbMN-XmBZLWUa0}j(X
z?>+vy?cUa9MKb$-RTR|}x}C52`h7G1`-1a3j-2=Kj=kirW$p6tg_E~PX7a7F5BoR7
zo-$$ayJylX-K@QA{>I8O4cpn@n~yw64Yv((?P))l(Ubb|#EH}E*6+1j`}y>xV-pV_
zyLeQ;K$P{_;wHOW0dg0&EQ^2qg0D}xB=-JFixu2v1)FYsFa7XV<9}O%*^6Sw_w9m$
z%d(^w&x&c@F5`MPrJ+$XI;Cg3^bdy4lt7Qy6DGa+tSI{B)t^s)f1W>Kv;8vXwQ{T3
zu`ZoWp-$OVEM5Bro?mb~UBz%jODSfKmEp03ki_Fnm+n6Db*`USc<5u{++AMZdb7kc
zCfuL!U2NA>xkZ!S@UhO@Ji+X6?xf?N61cBQ%=@$9lVWb)qa`baoKIBLcV67CoW4gP
z?b)R}<rb@=1NzflZdkLj-{iW}t9Pn&hR^Aa?65PubJtfsS~J&SUuev&Q)N!v_iY2S
zA9}r7sJO<=m}xDW#%$T*qNS4iYyQ4FEWO*^;J2oYLX7f>|2L&LP5yth&(3+vlJoWF
z-37U-QfUSEz6Dm?(XNu%dZ>@*nnMN8_g&4pzOOGu-Tv~d{#r)u<cJ4xo~Nchto<}$
z(v6?1&z9x|9(1q~cxe-~d~W5JzE|twy&`mF4yfJxw}0}I?~=OexAc`hpRs8(o4I+8
z?#W$pY^Ab3Mf?pJ$2jee2#e2uvgbHU(dsX=p0O26J2b?0$w`E`s4og~+{ImTV8yP|
zvfNi|Jyy-A{i@!4c$VyA?u<|&2E}RL!o+y{w*QM_%;$LWVb#3bKWd8vs~$V4O#FUw
zKYQdi%Q-zxRbqy>B8(eK;`iIDIc(k|-`Cgw=*Z%`9{1j4bn7aXT=}hTFxhEgy3h+N
zS;o|}ZE0s`nQ&|t&&Xnm5tumj@sC7Ztym+o6g%c(KjHUDtsW<)E!Ek@d~nyK=xbA!
zn#`YkSE0Rz{bI~9@5$|7?;Wj>-aqH$x{g!ZY|HigYugs<g@vxTy<Is%Uvl-z0$b_d
zw+x<q7XKB>VkvWD@c}krCCjX1FZR6lJf+}j^NsWE&dZA#uA0yE=Ck<`x8Uiqi^oG1
zGL9XU$>6+bq3S0f%6nDOQ7Gr@ikJ7E<Xl{6^l?eX9br{5F8}K(c3YV?%D$T^cl-0|
zT`up^)JyzorQ8I>C&hlVaL##oa^4~Cj!>o->KiskeVQpLK4)c|nVi2{tF7OOiRliS
zO2X?Nc8ePp#JL-sW%_i9qyFNKw3s=Hj^^6k^Bu#Uv)RoLckQ^-v{FQW8rOQ&mX(G1
zEQ?w03Y{sr+8?{WqblO1?ym20f)X8yR?9U-40rI)Shhc)tRi`?cWdhP=4@t`?`m-`
z(#<-|GV_}krRY9n-gxkk^CTt1AFJNDpDPXs6#6~Ya(RZ1vGa0;{PSvS8QWy!Oa%Kh
zEN2zuEN;j%(%+}&`1t!;y(7HRf*r59!XsW!Z#C82Qr+jw6Sd;9Ti0~;{;9Eb&qDI1
z@lL$Gy!GAGHB#oA4Wm9ABrKC)|9W7us?5|K<+IiPTL<<BJUGe3*Id|d`JUa|g*C=M
z^wXPtN6Ig#xQbZr-Joo;M#`dc{ZrY~f7n!}>TEd8Vl1{jDx!>8KgD(RQS$}+MP6)?
zwDaQ=eixgz<9{^w!7YZn{?AG-)(yI>b6n);nW@uf-EGJSXuflBr$X;UZl1%-mi#*|
z$$I>{{k$3*b)Ew+Z?YZtJlU_dx^Yu_$Nx2|?a}K#&N=?^`2mluahlg7PERb#f4~-f
z{eVciK{)G->lyrKPfbo+bXvtuWJ-rki0m4Jio_ju4m%HZUvNz^7rr<#I7Q)7WY@15
zSDdrOlY7>L7BC)j%kE!sX6Kg|W>Vj0KGfzGo)f!fPE++O4Q&e}m%lI4DgxY>B<vH=
zs$+c^<+vkEU|o81!P*<EpZ#0;;D7(LbN{#Ot`2Dae?N2mhyUI`A|L*rFZ$o!m9u^Q
z*9SK4TnCzS*KT5XHR1PfYu=r6vLyfIu5vhkdsVt!;qQ+-nR4sH%V))`T6lBYGKZgk
zr>ADh<@$U6u2%Ej{MY^Lew!@$Yp0*s-N;)pv&ZdMwAsHq2hQcZ_Z8F&EIj-6)M9s)
zHoLy({}-J3)E~+CTlIS3+*{u(|LSY1F$T}Ou=Jy-HS^b^?k~a9a(QfgZ=5&k>AubL
zd#%g2l@8~2bMAR9!F=*#g|K!yuRzOJ=}AY|-`sXG`;=j#md(i-fyYDNTi(AQIzy{2
zR{5;c6oEGR909!oCi&7*wx07|Kb~#oy2<>oi|Ok<?w~W0S6$q%Dtx`LR>w~2m}bFW
zr@~i{4c0t8GBv)cy6jo0=+B-qHbveeH*Fhu`K1H<C4ay7$v-|Tw$U-1J?^Bh(6^|?
zZ@zqRkdK=r^x4kuxj<912Y0PW>Ac-d3IT_LwBOnux7{JGYko!XhnoD=G^R)AHrzet
zynXR9W!?L4PXt%$&nrB4zhI%lHPOt6r~j=u9`ATfP~eQ6eP?;oA*HOjMpXw29&;Gp
zT%x@&epb(#4wm|JlU_I2-}oFV8~!C;GD@SHe>P8ZP>ra3-$E{dk}jdb;8{*aeeN-S
zi=O-S&%CE)6tyzwk;#?~8DR|TPfq4<er0vUiD{A7n$%r05`6O|4317o+|L#<;c`Vq
zW?<Okh#e)Xo;d7!<K2DvO6iXj2H|Du60goAfBMd9HdXmmePjKPfBH&n3nuV5Tz;|E
z>aV~L#fg8a3$JS)wYyaM<-wPULW2Cwtlq6GJu9?5wk>)oqr?4k9edAvCl(gZhX${O
zAMpPE8h!1rx|+jE=^EeIPtJbQyUZ^Ly_K7&toWhSs!8men_*h$l8F~PUp0o!C=ZCb
zFLwXn0gJu!Eu4xr>+o#2c5#N<yTi(XK^N)-bLGVUw?4=)F}#?-zbJ8ur0pHP+r0l)
zM*2oKPEr*7H&Hlw%@%=zW2}mn3C?VWtY5o-_H{S%Oh|P56_*s1bRj)}sdiSyrqD}z
zc|L9DZkoI~bneuv1F|d3MXEh=j>^umV$46xy-1|+Lq~VQCAP~;d!w{=&R~C;mK6JT
z!_#0L$>q~MlXmd%J^tTm#=G-I&IISj40RKWRxiAHcG=(OkN9)?Jx=~ycWwWXAo(dW
z)0gmNWUUIjB{Z9@P^@CU+ZhRokh?+&&K>O6nf@xQGp~EfusCp1Xhw%*p|$aum=#m*
zN#0vvQ?_qmNOOa7@r;Z|9~6Z&S}tiDrQZ)Z``>wMyU3QS5q4QwsTRc_N@glG&1GHn
zlWEr`<_yuxHk{k5v;#BJ+xK;wieAz%P+Kqa`f6j#l9xqCLbXkf-EHv}jb@Pzwio_u
z_$x-M%E+|LJ%RBB-<AoljWplK%UR_=@@Zr_vx@1^wSJr1YukeJpWS?#uCR4w^9fU*
z%t>$3loywJ|5zAhHtXc7gEgWxx5O$83;zq=b~&wgzJ%K(p}JCiPobCL`~}Nq@UPg+
z$-cI7pJnmVu<yDntIh`g&gg5NZ~4SWKcM)^M`p&~xt9};=YN>8bg}2;y42}^`!b8v
z{|LTL=k2+etUKe>!8g&@4n+Pe3A39!)jwU*Zf@wD3xB3Ot~Wa9|Eq`n$9}8bw@p9p
z|EBeCJ80nJ{mjSpn{}61Hq~#IigNvz^|+ukbZ@rjp}sV?f6L;G9yfBc|0}!ob=k*B
zy+_U^GB3EjeXF4LT(;PVdA&O}|8?IgSZ-B3_nK5h=iJ3d4YK(qd*{w|y;YmSvLR+y
zt8xSX{GPur=F2ZJcCWqfnf5p7=-Tt5zKpB7-lxvhD?TiDcg9Ok8-6jjlV(>A|NF<B
z<Dtm(aixFw^_N!9?*=Vl{pRvZdH24y_EYjto?gxm@?*_*l)lGrHY2OV>;8Kc=@xy9
z8{$D}m$_@6Rew9%DsA9#MfUZtaDDA^wL2wA4rbf$GrXDmLZ)43uV3V=iMK4~e*Lr4
zob$YMw0B6fdcnJ@#>$!(eD4<52%Kb*)|dU|p6k?5w%w-U&fk@auGd$#nclvrwbJC^
z%BP7Br>JOLR8)8@>Rz_e$#W;;skZ-f1hnQUSuypRTgG4WbUiFMFFyR%gv1KTJnu_e
z<wI%<&b@Gzn`cz66=5}ZWdTd-F_90KwfW=C^G{1omtNSZXuPuhi<icvRl=D!KWx2m
z^vu1}MXTQay`pIB_~O*#*S{=Q`%h()@w~k5Vhx9_K+&3lV_HG&A*~lwW}jkOwjg*B
zW1rLHRV{PW*WP=7G&U;8&ox>1`>YiWDjZX*U*1(YAaHl~8&*Y?CGJ(q`hI_QE&RTi
z)$G}OzWk>@FNeKZ8us?!1L5U)+Ol3-dFQ3^p5Wp-_||M?@T*OVvL=iI53^S0#|A4L
zUuJMdlCMm)s_BAo=e!@hJ0^-m*E2m)cKdlkl`r?4dA!%9mv5q-UL9P_wYKv8^LGNX
zC4^5Kp7k#GdntKe$NFB%t(*e6q+864JuAM=c*<&cP@FU1N*>$g^sQBruJ&8Yx4ejX
zYiimTmV1J;{zgRm!_w6|?-?sjxy$^$eqGX)?qy$o%#n~)slBBt|Dg23qm&ry`@v@a
z0^Y6dK2&L;%K1Lha>X{6m)@s*8``h!I=+xa{8WadW4<A0IQzdS&8aF%?HoO`c51b&
zpZxSHQ7il5xyM@!+jHyY^d94MD~xbXI5qvvbQ#;Dc_PtuXRh9e$cmF}?#xvws<(Lb
zUQaUMo4N20>3s<sS6yH6^n~d#zfO+{J{EWL=JXiEU;fx#+;?X$@196rXB7nxf$HGO
zTho6W)IGm8><P;rgZ51eR;4j*J+;zF<W}PB<zWm*<0OuoU)*6o;mzkI5sUxS8Qd=N
z+A3Z2ucReJPN+pkazf*y+n+wnpS<Tn&t|)4<ypt}FL`|N_e`_58v>m+Z1TMI>`aM=
z+5)2^AGnL7v?p$p;)?Z-X?kLNb;nN4<KHc(Mr_){cKx}LXLF44i89l4-k{DI-KRv}
zs)+1q)GkR|H&<a*_W9eb@1~x9b^Llri~gyn4<^<3^HpqmUs!tJdr`JT-S<P8t`qf5
z52!!PFSzop`+d`YeLeT}tcRHvmF!cz=q4~TJnU#}UH@7ZA6<`y-^H&lPWscVlbdlf
z{_jKo<@5h|br)9ZA7%T=;$r_n*XI)dGTWU|YUhqF|0AGguGx8b>o!+5&aLh1j4#Wb
zxxb$M_WvJ@x0SCv{-wIB_A+lXhtRBup!T}##Fh14zdkj8Ie$=kf?V`_$@2y;f}447
zXqZk;Stgjp_W#$s)tOCmw)`;HTkTozJpW9*5$m^yrkg!ayIry2c=0tQA?0Yaveo>O
z15386_Abm1pXGZ^?e(q+nL9i*PraUa>!5tw|4eN;#@Q1JK8V(Q=U+IFedW|$@)@l4
zJ)L*f`Aq)&`1?``p2=U>b5j|(3KC8|n%K0=PT;mo-k;0So%^OmckVOGKI-vU#g|LW
zRVr5VftUPa9ih9ISNrFm*Y7;WRnMrnc1w_g{NjljniZ`!-7c3a^be>CrcZG)$=Nye
z!T;y47R$$|AKLkp$#CayQxlDrn<XonCE8aC-4NQd>hwg1O)oCVXk<7`)SQ~I&d@Ng
z)^kdH<Jzv15}Rkm7I4Y>tuK5%=bpTo--@DWrIyR9a(167jbi%IA-hPy$baXrrJ|zC
zgZ@dy`@ftg`__Ad($TB;4E-l*9BQ~eRqF2L#AD^#3k#*K6VjN^^Yxrsw=*=;>Pn7&
zy{+0TSGT3U?U$N%$xE~>kjZzg?|ZDM{bPZf=*bSPNmeW0FE!ryCvEC9jtyZKJ@y_l
zSn{FP#V>M3W%_OtVN?Ge#n9E0Q_BwdoVn2Yz&y-9+jOskc;d?=+1K~CIx9b&dOG#a
zCyqU*;&ujczx%_rJpX%K=rit8y^PABw3(ZEe(@dX(@^x4b;?}uWby{9P)qTvB})~R
zW+<$ZlgQdu(9wFV?4srNk2wNDcW0{Gva{CQ`6kfz`efLit4UYCHGQAQ8yR1tqL*Jd
zO~CiS)-eAI=Vq(5{PYP@ed_doax|+Uf6Kn}iNc!IvO1jWt5@eNe{@hozKPdqgWC?@
zoovU$czO~w7yZw4Nt6CKT|LTp@~n%?JeRd{&H9lsvst@+=By{17+IfGImcbAQ;HP$
z>7sGHQ^@7M&&=ItQX|A?u4sKBAj?r!p>?3o$kSo|ci~5imhNFqJL8ty|GvXh|4!t)
z#0T6KpDnhoG<*H6j5l|~!gQ4j88Q`LZcV<kRR56W<%xyu%;HDWZX336q;h@de*d`V
z&m<mxY32XDDq9)l7f(^Ky05DF;7wnaTgS;3&A_DxxHIB;G{icK6BLeZX`N*wW9-Wj
zwX~)&Y(n~%j@Kt=EW6g&b=q+YU&47|9g!t%57P|a^@paEiO!65O`9$`vsOrEzU{I<
zf`9*u{)w-C`A7cu?YX(^|F^6E*nf`e|Mr&oqW|8{{8-PgYI3HLVb0wvT+9*NCtsT!
zVX(R>(SMksOs=2t&f6=`H|gBGbZ2G~x6Z{&cW!1*FxqV6UA+CT`&N_k@@L-bvl6o2
z<<(0E7pIs1n=;MaiQ)8AM@gm|D$~!hGtN@3;w(83C#bc>wd}=|9G}x#aTXzbuLS?R
z{30xVe9<wD<cn$fzZwo5@LlL@d%r{eVYGSR-n?(B_coMeTQY<_E}A#d>QA7NX1(#A
zT{kPvrfZtT8MaHi%D!xT@3DOeqsR&7(-tZBceQ-?dKYH4hL@-9{gVl?x(#Ps6yM(U
z(op!fJZ5o4pXK~36{f}OE-0N>nxC52P;_pw!M^7vPp2l9at6$e&YIAi$9?%ix=`em
z?`4m=qU;xl#9uN0J~7`(Q}^KYBYPg5p72`freKj%oYALap1V)}Jk%6vDxaR$dFAH%
z$hyF1i(31RBy$Cxj67G!vv~fg>;s-p_;&N{aXP&uGThdB+GQ{CGm~;}esWM@Z3~xN
zzIlCi_{u%CQ%)J`g+xDL5j*nz;nU-%`Jd<4=d?~2e_v-~Z@I7Ge%#-pO1A$se_q~g
z_x|x+`2Qo*(#n6|CcRr2ZGUqAdi{H{kB={Z|KLc$u_Dhb24{nNe~+<e#_e(|xL7<(
zczt_yb|v3wufxJQjCz&43!E>=DrxVKsb-s*$U3z;QFXgp*Djg6H!f|N>NxLDn5O0Z
zFuNrhlP5g7A@)i+NJ`|wmA^)%=i2z^Ex8eTcZ>DI68lN-*ssUVxwujBspik(d`{7Y
z)=u#YcgoqZEWCZB#UVJmBY)YePf{V3toa-N37Fh*opXAD!IeL?Hv3L&3hcfWTi>Ys
z$Lekbf1;LFM$x_(tkvht>sC0O4$S$WfBb!L*!R?P%QbWSeGQxX_NPtOD`xfz{jiMN
zs4&SabdK3V^}U<K(u`NTt~h*oa<=A?uc~4l6`a!N9QSITXwBnU{`ZQQz(m`UyG*C9
zb{&Yz@yT?ZzB}m*ubITuJlm;Zwa!~DvL=dFMeBM-x*fFcc=h#+?$*ffBH{&m1NAxh
zzm>8r<yjeXIs1lYw)BG37jI?kMEeAyHQD`g<sbO&eC7V`+WmEnu5ESmR~S6?U1IdO
z;pa-Gz`Jk56ucDb`nP&-H0S4^9e!SXtKc%V8%F!~9Ei}p(7R4HnQ7;i!s4A$$!C51
z873x{XFh&%Fe>Eg)m-BVr)PC+v}mgI<JkP-=dZF?GMD)o8?vJ=Sy;SvJX^TmRJYP2
zAzwoEho<nWd7_pXC+<7{w=dcuy7r8Z*X(}**V9?}bN^|}rAr<7^5|H}wnxkE=1vJ<
z2|eegW$yQ=Vd`CueTzflb{2hAv@n<c!n;r*>R3;n)^+yppRH8h954=+_&582M4G8g
zJzwGCoXBmHb_$6l&CJskl(!akv%4%581yc9g6~69n|V%uju$?y;WCU@_&Q-uz^5&Y
zCtpjlSLQHD&K6wQmb>v|jF(67TW!bB3%)$fV-tBE-#IObYyT33+b1^75wtt=^o#N5
zmcZ(zf4Q^n-xW1C@6qoN=&n@zDRtcN{Q9oGDN0)d^rQLju)Vt(vSH%y1$_@scDzh_
z_+jegqNht@EH$UUSW+`7<40EJ-;LA4RR7(tZ2KjD`|YeB|KDl-+ut%j^w0m9kN<z(
z$bYVpZN~D4qGkzMH}>}_XH4Ai|J>ul|Eg6RUY`3Lab@>;euKMra~ZbA-rKhSdpqll
zccrgfKP70_v>v%|jloU+VCj|a**C7-=SbeQdpn2Jw}}h?&%JfwKhvDeasmtHu&?8>
z-tk=HZQJRMYtE%VF5_FZZ+ga?rJh-f#J+KNwzWqr2zhzv;?*MQr;YKe8|3oWrHXTH
zdKN#qe8c=eBg^G}M;}+~Zt9!zWGkn#)0su{5+*NJp4j=H=eB)I=zF1^DyA%}Ywkp_
z%4UC_^<nCh#jZcoea~^}`1*=T)lb;>Htfg5(|?mbhP}K|KWpJVp4+$1E;y6$$e?e>
z5tSLuE*oP%&I_wKRl0uS;YUw4v4uq473$`$VfyU<fmh|M>4Nq}=WAB?ZEiTd<yqv3
zoeD3G9Qn>&d2eaMm#xmL&-d>VR~HI*`DWxB*ETy>z0+4YHKz1>%iC=}G3HYDeN-l%
z6uI-wz41w!lSi7)x7^Lga{}6IXP;aA;B`t))A7oL4!%e07w-t4@gw8p;x=35Kkhqs
z^SG_>eqFrhy@cZGt_>&mO;38=sJkFxGrOg@XRn_5#`slBo>X4*Rx;hf{CIY#LF*FU
zyGJyqUfF9d$gfqP*At?_uliAaTY1c@XI$DbU*@ho?=(rpBx%>L(^I_;eRz{?*f(ch
z@=V_4g;&@cC(kfGpb;4B(8^}kpLsTD+pDt{uefJ9of5yS;UU%EAv5XE?IywNg)Wm-
z-%9V#d?d0Wfj6Z{+w$15nJa`2%{-{&S~+3oT;F2;*5r(9OT)~TD^C6#E*NM!vrlP)
zg0@)pBsLM7v%2Pc0={Oix2@@3!1kg){`UWj#EdETpI?7lpA#{ojYaN-och))FZ90H
zNmsZ{VmG^zsO5K~eb!S4?zLa)HYx0ka+#1eRq%mdru@{ZrJ4R7%DZ+?Vy@lb|Hx0{
zfmVdM@}kM2Rg+nJc~^HXjr$a(pd5QAZKtqiA;;raU3xdB9<<E7x{7_Xw^Htvn#PR1
z4B^kVR9<~zqx#vng;mbdSzE!hWV*+?#rsWil9X&am$z<6F_QiAu5o6@4Cm*LZl~@l
zmTdmZ(tMe7N^IK$*L?ffm_J{CJi07-R$jUHO!``{Kf;D#7lKSAMH+wS+~HZz9vR}X
zllPYInRg8ZvOM35b5-iE8AfiO^Y!&T%{z{tSlhBJ7e*B8taXVDe9~>2z{#)7`E8X|
zWRVj06P2HDe2-a9FEBbV%j+xmsXL~sY8j~o5;vCwq%RZmS}Nqafa}bhD_3_a2Y=n$
z8&#y*w_;h`thSdOZdz~Vv|VU!`m8(E^39~MuJ{M6dB?7VW|?;c-4o4TwejXGxrh1o
z>kB_FjlbrjB5<qI=i|Hs?$#1IQi+<YY#$rE3j6WcLh5c&r1T}*sM9BT!!|$o>ico#
ziHEB%cKmww?0<3apM>vnKc(YW)t1gZ_iG>X{oN8vuD{W9{xf;ARN|B=F^3LirG?Jp
z-V^N5YxOdHNxiSH;*J&VLRn46IMR7!9=CMuG00}~TDy0~!SciFOjVt~i9OvBB)CA-
zK<m>!7gy7c%hFAoFXo-7zq-*d>K(^((_XjfYvOmmkN><`OMk_CmHt?b8#{~6u8A?$
zzJ6v>tnq3ix&HqvkNhv2CjbBT%QxYV>*vl5{gcmWzxv1h&By*P(@xHrvU%pSj$fvk
zd7`gZcb}IvJIh?RK+I!j(ygA32k#y$H~n5}Tlc;4%sJa^QJd(aJN9bcSeL%Z`uqR4
z6CC_g%iq1fa{9@^u-hw^8XromUvj~bd3AApbyv;VXp_ABaz%y*kDVIYpK>U)G4Ow=
zxb5(Dx^q2;{Qh3IRz<J(UCgsyeYhnOQMe=X_7uknFPNE97a!q?e0*lB$dpsfsw_9u
z>Jqgbl3AZFXj!#x>7Epq9WSTtdbMt)72B4Fmiun_YVYIGn&)VGsJfsz^Pp9XO1aR~
zDU!mxH9kvf8bc=WRddc@bT;^UN$&ZtrPsEHMZca}`DICT^6i9&=Nfo6Z5C&L6|MDj
z`_}CTo;fV@Gd}jD`bEGh&wqP2g<9YFKBvX0r1ZsmNpX*D*PP$$)G;#u<I3UQH`mI-
zL&MQwQSTcy$4s+6;mNz-mYC<yeDvapL8CkGqCaLa|ML!8**%PWFZ(E{<kNu+mO>{!
zt5<6LE=Jo_b9W2Rb3J$1c<+}d%G`O64{C%kH{D$qIsbl@M6H^iS3oRh`ksXxr(#OC
zO?aiZbEj&2QJMI&?}ziuIIdr;O`H46$o|^)r+X~z;_lmS;S}<_aHnF=k?h!$mHa1`
z&t6gNt)Z`LtL64=N4(G#14-A20B7}QDjMRir%k`}(0J?1z5dVg9_iFwO?(?=B5~L4
z?v4d}o-#ha_Ne^0@|r($Yk1>N2A6F&xjk2zU1ox+{;P&pOTw=@&uqT3c0sRx>%_bF
zO{(j7Z`D7Zw&MGY%*l72sk2NwH6eV3ykVpF&VG;LhDmmO)l;TkyDn1b)AoY>>-KMK
zl5HA4=YD@OS98V9FH=v(zk9-Od1vZ0(}S&=H<m04i|AUr<7K8}t3!~t!58C)zAk;|
zq!*R1@pW0{@_dS{;cLOYRjG;vQ<~#M56gVXYZO1Ryz-=R=a=G~qs0rV*B{(^b9!iQ
zReiY~^WmK3#;cs)Pygdzz3eRC>5JJ@7AHRw$h|Z#-k_rX{+8{|B_E2nglKWqCPdw8
z{hZzMl=0so_Z=UY|NOjrKchbHQo+hi?-yoPoZoeO)|Ozcf3+#MZnoDdOD27JHDmJB
z;}3t%ek^}pK<$7l8;8P$2a@dj#J?xpwt3v}veuJzPf}OuG|T;0UtTJCApMFx_qNF?
z;dY60bJv_yyZg02m0foE*}kps9Ng!8P25{Q;fzt;jWcbvw|^xZ&#Y*FHlM92)!|oN
zS771(%lFSp@YNT}-Z)w+G4DviE5$mNS!|VuclgQF?P1@Ye4}Q^-`27O@mq>K<v#?!
zoLKgxvFX~++b55^J$}1>TXXI5i+$HS+ypu^Tc$|VS$pi7k@4%pgCE%+53D=7_=Ea}
zpbMv6rQh`@u=NB~&X+JY`ePxfXtMO;?;qZu59po!X6D7s7pzmjIOCmgXQ5g2diH-+
zwi{k=y_;rQ-sG{mCTQN3Ti5vhPOZ!cPutC`J||d2@Xg~?rnE=Pl@2b_>b>=K`qPE6
z)85WC_%m^$U$E2@$t~$ySI)jrW4LeX=G3P-k(SZ>wr)-py%PP(U-jSi-CushSLbh6
z`_FILIDd<Ha9!BP{h@!}TRyJmpBMR@<Dcz?Yg(VerQ2^CKRd*{vccL^{MX8ct<%p`
zJUG<2e{tE~{YfXcy+}OS9>87wd)u-X4@G8NHlDf2y*^^k&A{b5xz{#IR#k-9ujhS`
z%`dsE-J09%?+J^9-DZ3@PGn{}H~cT{ntkHs)A|2jKYrR?o?ri`*!s`<_fNuq{P}V|
zC~w6A7oi)Xn!G2Kmt1|`dAm7#-qiJ1P1;o6_G+>_Y_H@hUh+{^DD@><e|omAQ%c;Q
zUsC2-*H{0Jzwh{**DcE7r_01rVe#-omn7@NKh1qu<&lxG?@epXUd073HdqPG{WY;;
z&jzVHtz~B(oHGl*E9Dly-E0PjrF^2N;wdJcMNy9ox&kZTS2D++ukc?q%Va(0bua55
ziz>1`Sf>9;?7lxUyYXOo_>KFL@Anwje%n}dxyr0zy1v<=!*6|OpFEIneB{IPUe_{q
zkqe#|_p0af#xhy6IY+<am05l^fAZ@?%TFo2GAW+uqO_CuOqh@0>A$QGzrNTgRiJU=
z>6~Pzbvx`Al(0)^Pcwb1-d1etB=&2eVd7S<jy1l)g4<QAyey^uY0s9JI5Yf(@-us0
zch)uR<yq}N&-Sb|tywBD=g7*|)0J@_r<Ypyet6y!c}Mr`qu+*Rb3A#jzORn-n)_gB
zbW%@z98=`dpQmdI820bmvgFEiA9at1n`KUG^E+=iBP#CDdhpi`d#Sy4Ti&ZokK}t0
zRP<uo*~dm9$x$!6onqdd=y!j-=;9)#jVF(7S+~I0;#)=fj(@-YJmPs7v+@0=RV}wm
zf7!g5`m9m*W#B7)`MI4znPu+N48qbIc^f;sydSYmba@@&<(82a?(Mz!dBm>CLX8Cm
zn*JQ;Y=s%U?_B&o>#p<7SRdVYJr6UseYs`0#BawZ>sj7)-@PA~G2LcT-^j^5PydjW
z+w^q`1sDERIh}l9o5irTyMDRmOYaYyr|h4u3Ag*e$`}8*G{j<6&r3;de~~`x>DE&6
zS)V5Dz4*pd*7wz3>shu^zIz<l3;phYK6Nkt=5Oul`jg-OP2RDn{`vF&UH{ATZ~nXQ
z_x!<vW&fg|Cp`Thd+7YB|G&@tyFc^CBFmcn#<wDW)@I+`@Z0zAzTN&$zTd6ia*y3L
z>Q?FZ`NsupW^IbrzbIfcOXydfoU=gMvwkk8hVc6<#ZS%5I39UTp~`FjOv?%r^|~*a
zbM}|2K9E}AZF|eyd~%a^biz?{7AO9WR<^sFek>OYE>gJgVda&aa&3nKRf$78j91)R
zdo->pLGOp@7m;He4_tWcxB6-_{H%>~iRWdWG<}(1>#j*ArA*#Cj`B&wN}hI-5Av7s
z7yI_E;n&=GmOrIk<P+ngB0`?r<xu7S>%EeR<IUH@Cl@qiCiiJR)Z|LI+}yv?YjgY!
zhf^;+XSX_?7Yv%=o0m5;=8>M<aYudUAkjm`>IPmv`a1N#UrN=>zj(dd?xNhzmJBu7
zS8EpR@UBW&#AE#I!3*{4*Dsiv2y0hN(_AQW%a`@=6V*#XcO{BFKSr0_VJpbnFzwKe
z{@_bG`#$tl&AP@Zc{5;QsbZU8_ZI=#XE6s14&Q$}XIJYs-fe%FbNb%ji~G~$)V=@z
z+rvMf&U`L?<YLyNsYhS0Tao>u_2B*`dyenYeD}R6>)+NRkNe~oS`-^<yjyF*fA>|u
z=OYTIjJ0(FL-d=(S%tQ3>=4=;z4G~qI2S+FNjtQ6TV!s1U45ZC)9=`X7pEU>QCTt3
z^IPE&R#$;_>E&zptGINmY2V}=+Fu}>+wxUt<_898E%BFYS1y0CXL{AcYfDX1Of-!`
zypQa1UaP>I+8^=lQ^eo7foE4__OXkHPv>7eTf;N@(Z$K33mN%T1BAYBd>O2LX7h$O
zYh(|{Y03s!9s8mEt8DTiA;ZY^i{2mZo9(sgGWWN{<6kdz&EIsuN{FZF!2Gj{E1n*>
z$a%8!jiLzqN3-U~8yfi8wX9W=rYK(OW!`-+FfcG`lEvn`YZR0>MEub1?>x?T_0PMo
z^z8EHRi3ihkGk08eSdj6sczfzqvZlWZ-CePNa;k|X^or8UIk4Hnyg@U{bac9>Pi1z
z@haV9pV?ge_y4_sf9qF#$kIz<-t+L#&C5X+QlclCznC?j&t*z}%Ba$t{r`JZxA6)S
z^N*Krf1aPaP4;9$k*{e?%JIt;yvxodiiT&j8vRaCEk5d0BQ27<ZnCK0TFq02XOup=
zW@ZWTIrSS^8D8hV<(Ox6?uYgiRuOp@+f(_E8J`*!KJ{J0{MhPn;q*ME8-2Hw4j%h0
zrTx(I$xa!k&rfcyTxof7=JqS%>DoIks4hLpQu{-{Z?UAO*xBqnv22H%r(Reld}Iqb
z$+N6=a`2w?sgF{Y_Dwj_C3igWjAqSC0R^eOH+u{3pIN)E_tPsk!Gd~CULDt3)i9am
z5BQWPw?<qJJm1sYHsNrdjyJcQ@uA5-r|vwwqS(+Q&!(f!DK)6rFX~1?Xo{iK8D;lp
zl^Wg^`N@%w_J0)HmBV*Y%bnH#$gOqnT>6fcJa#LnT^xR-?5)>9`@7#~MIQ}cTy!P>
zNs!HMi`_QCtC!4g*!95c_*Svb8Gb397k=I4+G8<Ghe@^H@6x5dx9Uk<wwI<BNONwR
zzj21PvC)^d3fIuN#vzT{D@`~3)_8m_;rrvXPb}Auu8TYLd(|eB?=$3mjwfHZH0`Nb
zaNIifmm5xMKj;m=qP36Vp6O@SS2}mv<6ji~;!gY|H}ms3Z_CMh<Fb$ESFm0Bns6ik
z&#Et=*5?0*JA+>Dy;&{iTkn5QagNoIr#HE;KVCa~Z2@on|9`vRCp5?JRx>{nrQOke
zZ`%KJlM9VGTVJnxvGT{Mis0s(M^8VPwoL!-J-vs10n4qcCvRM6;Qsh9>vT4s3o7kb
z+11;pY<krFr`p($@oPn_8`GK)srE39x|LxZk2hWnI>z<gQqfyA&}xTvtMJ^nCr`eg
z8=PV+-N|VsrC#vGby39(^$VhZEJ|D^=DQU8AD#4uQ*rkm#y7h;QiF_(b!w-6+IsGI
zR7*&N##!?X`}eo%S_>??zDjqsD%)8Jt3Q7_cm&VgaPWTgOZiD>5Yy+oE>kMjFPj#y
z=7vCXe8{4#w|c)7yG8!bU6SMeG2X!Xo4@YdpG?Oj+7I7sKDpuP{sfJ?`iVb&oNp7l
zou{#J+l_@YYaPu#{fw3fVJ_J);fl)jvW<(SkKbq9yLt7)m(L`5=NyaO^lsb7tX>uV
zD6jcOPxozlzwOCI$CtcuZTorOzbyRmCEogf#N)G{w%IqfAG~fYdh-?+&(ci?Rz+w=
z>rUhBuUo`&V3*XC*-8^8i^MpztNe|-$A44$3(GdwBX{4q>Th_g@3iRUJ6^Tg_NoI`
zTz6B|XI-wpym|k;y?g)s=-;{^>&qo>ZT+>Crt^EtCZx{yWo6Ne%H7*}qjlfgjS|=1
z*gqA!kiX!D%Colz+&-}sd&Ei_^0Du~Qyuq3aD~POW2T3lg~B2JTTiJo&${q5O`Or7
z_=Izt-6@Ay{&NdXKYQHs;Fg<bkXe79Pc2t%mG>GQm2(0zs+DdA=D)m61fCUKcDc>&
z&+6${@~^qt`$hBele;tSsGnuKeEaE>n5hj)%}eF7eke*Dyn5u;=_j&3=IL4UgwCC2
ze59ql-S5b@6OQJ3A11h@7>4|D@(K>#uN&&&>6A6CxSKV1(s8k+-0y2!_5IkL^*RJk
zH$2QLUwZ3`V`A&YPv@SVdK<L5ZRTY6{>N{;PMz9y?CN)emz(!^rndG^KWx2V+wu5N
z`|GQ#FYULv+dH-Jd19)}wamwb({@JBS`qxiK)^~dNUrape;Df;yT#Q}t1PcvI<&Xe
zcTLaMUWfAM*)0E?4DPL}oEW(`yk%L`y2V$W%J1`*Oo;e*rmJUXds()ivL{!3`=+De
zZ#WZoeVW^H)TemA%}NWOV=s<Zr~7NyuQ2~<{JYuPz)oJNP_#47by4`l7wMfY_MAF_
z>f4+C-;THXmtQTvu}=HX{mp;Ye5gO)^MCfD>CYVgUEQ|f(4VVLANXb^{d+a(kodtr
zvNnv**2mtu!Z+{erKUQco1D|rvktm#y3O!opG)-WyFU-#ih6suYU7-fJ~xg$%JSD-
z_PL^)`$;<AqT|aM|6LVnC_PtI_4oDl{JwgtubKuQ7Y1Lc-YK_6Rd3szrBNnVG=;hT
zKAm|}CCuT5H}{Q#g|!w>g&khJGgJQlO!-2kqpsC^$B3KKjJqm7Y|NX-tJeB_uWtBp
zmmIF?)x{V6??$|un|VI}x9}&$h$oVXI@fd_YRWCvG@NX)es9AagI&2IOQq7{7o2`!
zz38yzJu}_3=I<*uA1&U0MtGlQ^Vtj@Ws}`X%O;p*{<k=4A@*cmaZKseti_EVQ@An|
zLd3O-^vvZln(p|>X6G;1`{8ZDor)C?P2UFer}LL~<^6N-DUsA&dZ{aakKevyyh1_W
z1nzM~ubZ0kdhOF)+cWJge*YATpQTV*p#5*3qnUEe$LpK<qxi3_4~-T~KDSd`Ky~q5
zoe7g}gsorjQS7nxI=%SVEr-IN=l9$HIkf-q=KlNtijKy*ztP&ZU_Q@djj1<8KCbG1
ze8%F-gL0iB^;EH|`+IaVJbly3rWr_j1fTyHJ-yK2R(6)dEH+O=%g2S42^Z}BFD%*D
zd359T>5LW&4+XXdUOfEf(}uDmTTM&P#ivi+a=zBvSTc6!e3|{0@eeB-eECaHUZ_ZF
zKGS<3c~Vp2?0W@Cdq3<duKIKO!_|+PeLt?=_Rn8sD4Sooq<1>I&*WISm(8<I^nN_4
z^10kbwEs}jP6dws&Lgtxy>31()z4~E?BHdbH>Fbkl%U;p#`obX?tPka_H6EcL5s`0
z90EI;?|e7-*KqZ>%nqgLyAL}`pOI1t<d#~%HD}WDRaysL{I2U#YgoO;Xa$e2@`NV7
zUPi44y}ifM<i19`8CB}2&v+Jp>!sFV7q?5CeG9^tnxDQH9nV^_=4JL_<BwNo9%s$Z
z(Gv2#zpF>}lS1#mM+R4Jh3#cq6kGdcDkGE8k?9x1>ykx^4IFf*@18e5rb?hO@?^*s
zRafoC)p9lod{g3$MDDTd@O3v`6C87QiG*r=YJdMewaRX7zda51k81RmhO${zE<XFg
z!(`3^!*#me|4Yj@7wdW6OWE;z^1~1NOq$Pq%Ty@(XnNHl(K;q;#q@dJCt8~>TxRik
z%jcE0?poNlEnHh0s|CU~hMqnsw!~a((IQ2Sw+zR3KDId&;`ls6G&%ikmyGh>oe3pR
z&Zg7`*+)64tDMm|)77Nwx$))nhud^Ta~p2NZDW`m;wn_Fa%J5Mzsle=wpZVU`-+OE
z3*;-i?)rO+Yw5b~nXd&O2Ut$Bk*hy=eq##%?ENl&O;bDy;<a7AC_U6T^!kUM-1OT^
zAMyX0w@uolQ&_@z>jnvd9KXmfN-Ta8!wW6?vfdWyR<C}cq$!=G()Q$QGUM3?7Z12R
zh~1s<&{$Tnu&#(X`+~##rT~Y7mHbby2tBc2tzeNoDw=RD)2oK@Zh~=d?pg`975!B$
zY^LrO|DIZSX*AuFb$OZod%~SP6CZC0ox)H&d8(J7rsSmSs;B%OPfUtDxNrH%|9(j)
z*InAfY^KXUmv4)R6dzanrqoqS`=2OoS+h56uG;P2ezWcJDq>2WH@cOxFEZ(Vr<3eo
z;^LkC`9apSe1|>kfA1tL{kSRq|HVrTn`^rKSbv24cS+n@U$yM<pB1Mk=Nx&?b8Ge4
zz$=VDzytomB_0~mZQ+bBJukF1vi-anX}p`!WrHL4i_Z&Mb2z7`G#ZOMJ-eGfz25To
z)5WV@udIw)l~?aACswcaaI4f=m6-INvOkNh`aM<uy5DPPmzijAVg1i-`;2(LOxbX;
zOzu^UUPqpRpSsbmFAto~6f97?diO!9hS0v$1*u(!W@n^q-(CIDP;kxcdos7K_RN_f
zT$Et<lIbqrU*D3u)-1bjX8icl`^s@`8NZv-F2++#p+}sqp1N6jZ)?yJr{9Jx@$CgR
z2V}WLZNg`~h?bmqMD{|&l)g;A{mGjyupWGpnih3sw`6+Yt|?p6jdL^iM16aDX3x#<
z7n1@z`i{mn9e3?9y<GD(M{lq9=3T3cxF6(y@Ti^R$@=W%-Yemgjs}0cyffYAdqhjx
zP0sCwZ+tF^+!v`^nakaE{=kQ<y+L_ij)$Eamx#Rh_14^0$j6rRZ+!QaMe#?w!#*ww
z-Sgt-BiH|NtU6jh<~OH4t}nY)eY^Cl{4MQ2=Y{IRe#}ol_TOanBXf3{6`sx7B>}n-
z&o^jVt?0AL5iGgzP<TPJ)zaLrA7-xEdu~c>#msAQ)$1A6YCEsRr9bD-ep~wO)zKoi
z%8NI{;?lW3z7LM5eCv8@tDTs{mgv(Q*Y>P>9g<}*fBW(`ORX*zDA}_aIvo6U(trMi
zn_SZ3$5;$nPydR%9>3+#|78ge>vLZ0oONgSkwyADGiN+r#OH6jFgs&z?f)CvIwkwQ
z-Oqlbx?qRZ(vu3R#})Y2Fk4Q#A~SifdhK<wxwl?q>z_Ky+HA46@odf9%N-X|8}t71
zuKmTZw^(-F6V~|O{iet3edkr)wv9-xyfa&1$+2x0+rP`XF&B2VzrOu2t-_`Ggri)>
z68Q@eTK(MVc9xwzPh!s}8}(^uN5n1SImmfqX-50vR}ZFW7x=8m^jm&9G5pyK4%;J1
z)f>!O>eH{UWL$79GNLZ8MRTH~z4y`<r&$-Xzj1iB^erm7wcI-K(VLA=g)Sub8M4oJ
zbK0o<!t-&9m(i*`AN?JN%*BuIGiExSKV!1_32keJ^*^U?j$e0g-)^hlKmR;d-Pho(
z9dhVph-=tiC%sq70pjnCA3Vw0DALw(Lg!oQn_~W7Yvx^g@aFBxy1j`E#uo+j52{)8
zq%u#tI9)?B!KLN31IPR6l?+Gw4Q?!YXIW~Kye%`DJ?shl$ABC2fA2^*SGV?9U#>v5
z(Au)#KeDVl>iLb7AMRbDFQ}MveMeXzkHmB4D!%(dwoPda99|md-QAX&$UJ=IH{(%;
z&Of_d^%Ho6AJ5y;oHaYiN@G!Q_b;Jm*N**EeKoPr>(r8@#A7R(dW=6_m&`jc`*zJ0
znMsDv7?VBR?5b`EcFHPS3WYD}RncK{d!m~?cd?PQko)zos;imy$)qnfY)d|&eeT`O
zDa(}_d^1l^<=?gVzP#{Z@$+K6lI)KPuAFfXnzYaLO8A#|WmW=(9$xotF8Z}+F_oFm
z=H9XUN+0{_$pS%H+iYH|KF_e4<Dj1yaPI!U8(jMO_x@JY71ao?+h5bEzw=<@*3;qp
zW9A*)E?-~u{h`pmzf1Pd*}v5O=lt&SD@W9Se*b!Ock-VfUu0!&oR47ppQhZMB3dU}
zq&|Dg-Am^zTvJk(u6g+Gds1)Z_a|EupKX7%R_u|p%et3A>9db{obdTyUCCO|v8BLm
zj^N}iPpU7rIR9X2nxL(zqWP;rAYNRC{o6sW#pin$Wyd^WQJbJWr)FK}x|<HOWLfxf
z4&}<+uu;uF$vw@6w|CZy6(zp|Luxh^-RN)BPM;Sl{Akt3pEGaRociUVm=Ml!(0-4j
zpUvjpgG=o8&g&4*wiB0R`87FFQl`0gi^GhUyNVu7)t$C>=IhzBGPWGs`}M6}-n3I`
z+<Ug{IL$EgsQ50OqPX|{5ic$sI=S2Yz5cnnXNEg%YD*R6b4)KXUh2GA^?*@UV8wyz
zss%UIG>pP$iM#XiBt80Gu!Xf-o!Q}<<uq}>ph+19w<cI$S{k0UjHjYhGS}ee-Hc|V
zim<EzONUe^)5`&eCnzzrGq2Uz^4caoZ7R#AZMD@hPY!AYtKH|3UugVi>Anf)1m0Ll
zasJ4f{pG;F!@rXGK4(9B<{Y#<VZLV5bIw@LXHu>mYcIqGw!3~>*4F8LXxol}tKw$G
zJ;oOl^3UCi+r_SM*QdoPsLh4%K#7Z5$Q_1ff|-HNPx$=YF8mCN-nrD+^~gk~&HUT$
zChyqZ;{IX7GwEI5ddy0HB!5fLGpb7cQJDIruBrLyZvOo?Ctpmx6_xNMLDpQ}cE^qr
z$C8BZ8kOYzdU5h<|00(^vmc(fwcTg4T6Xj4Q*me5l#=t9#1Brs|J>Eag;m!0_}07A
zQZ_g;uDyHs{Ih}`H{ZwKyH{r~Q#b#4cGU)1H&)}wpMPhrJ;t?k*`hF;wKLTZ3tm#X
z7`5I|+oN&!`iAQh<%-n>?Q-loYg1j0-k#TRbW>03HCv81p9_1pyU1A1<IIxS(!{~?
zJ#VsC{jEl&quS|NUw_>3-0IpAQ979^`?A)A%ei+g;`KO>ILA-o<ap%B*<Tdv;x5D;
zle{mwP(Eb!Z$<N>&w|sRUz&0FJ^zb28F%Jq|2e(kgujmWQ>Q6uDRTnV9lzzU{^>i}
zb0hcF$*mqn+7hYT^(I)|yZilOD%X33$)}DRw`5zhHNBs8_ONwI|1_H&n#Y)}C!VXl
zEUh{1($+)o)yglGE3U{6E#_yL_SUOoxAXU7y+X@V+Ls;6EPvO#Jk9Uw`*WYql}grR
zUVZ%Ho1Htqgj2gCvt((TSVh#wpD&-h5Sp#Pn(v}nvBYws*K~>ZpKiZ7S8*jaLVmO0
zrQ3(L?{T@i@?qYB+2SwP8#z`y|8IS;f0x4K`N@klByZFyZ<)FD@l<uzrHlWl%w78Z
zUsc)1cTfI&nm#@8=kmKZZ#7E({`&dD?mzMg63tAGZ0`ekCI!A`*`YMWR`-FYRcPk5
zbB6aU@5^jI?HALT5Rx|Wrv34Fk?>X3EVn<IdY?GY*CTb)cTbLPslh$-YKBdY_hlI(
z+KYv^Oh5VP-iCJ(=2L!2n=UIai`9Si&fDBX?CH|j?7|-lw*FvQR$jf_=DXnUd%+jZ
zK3cFY_{ns(Q)~Dn&$B3Ab-&MP|CnDfs_WVNSy88dtV)`bU{#`L?Y#2E_TqEL-)ncz
zkoV6`eY5?fdaT}=*a-irPh}Ejb2M92bv%ABdEVA1r5)$iAHB0z=HI~zK0~Pk?8hY1
ze${oYZB0CXHlf^H;eScl<%0C`=Ab9$^EYl(U)i_!_~zrc_Ag9$<0r@yuaT#`m}k{A
z@#9zTl;`d^e{uJ$*mui*>TQ2<`rXw%IU%3jM57yv&E>ybojv2;VZZ9@>%-q)KK;J^
zZq9@+8egJaHrbwe_;U86r^)u-%KrCx^zSd;`}c~2v44E;_W3KEd$OnMbQ>;J()t$P
z;eO;Zledc8;Q+6y#NNp>(~lNp-&^&&e^pe*cb(V<L(kK16Xx8lIDD$k;A{BPN1ufz
z8*NR!?bxt#=Jbd0{rYxuV{5CbtG@mE^Y&(@ua{lqP0+%Gh~<-bX3gQS{MayoTX|hc
zz>GV>_r(QnHSGP)VK2LTX7J>&t-DO}#Y!?SajpNFJ<aT3n|6JD*R0uT_x@E&Y(Kj;
zy3p^{@2AtuZI<X-pPkdb`p2sCm-g+~=DmN*Bg}G>*(cv(>6^Ol4sAuwmX<4gow~i^
z*f#c9?0S1m`{h@)5QYWS@>6W?7Cct)YMYb9HjQ7DVNyzfw$i<I+_O?roa`RIIamI_
z;@ZqEmGu8l{MrqlPm$WVJ4W)tl4JgXX5WtNF}}WCHOfav*Gr!{*7vumtU=0Qj(G{k
zil-{yw9ZP1GoBEevo366Y|)c<vzFM}=dMaAtGw^XUA!d3(k=2o<6<3?w8-9xahJDb
zdB3@6!}PD@Wt29<d#(e!nLgMtH+=Ur+WPP8$M~s#)*nuNUcYsF`S$YgpYi9vY(DkB
z>e-+5QK?q$yTZ@@UHxX=t(4V^m)(plRk_%mQZ8%jSa#hnQ{1jf?Quc+sb_nA9&gxu
zzu|g9=dp+9-pOCHxN~#8`03`gwFcK_s6UOE@p9IUHf!tq=gi*7=$y0ua6)AL-diH;
zSAN@k{-w>yuY2CAmG5+|yxN_h5$aIe$Hj7V@5xV#o;|Bevt2Xsv6$NY@404rJX_Na
zY-OAMbjghCKYRZ?jnKA~UT+z4MMkZw`@rY>O{ES7Jhi<pvn)@tZF^+2+i&q9U7d40
zah9QxPKu{F4W}GeOZQkCBR=U~QRn_Q@<AI;RynVfi*(y>yiMKBokOjj_ubKt#vKVI
z)@2dOUlb*$Px8N}#wYY<rl**}pQRz6vSsZL?K;EUn_6)HLte1(WL?hZ(Jyz(zdR(^
zq8{qUY18|(nJKQ8b$amJjiu#ZHfk;QHf&9A?Uir3HTz-Eo7A&^mmN@UeUf&^PV(BF
zxf6KX;{A4qKF>LI_Se@fw<{+tzjG$uZ}-;I2S2kPU&AM8v*Axh*b6DU&1DOg*<a#&
z_~yCkxtANcZ5J_@p4BQ}wP$DJEC;dQ&DpWy)~hYPq$Rc9Tw*SH;KM`i6@Oko(m(y*
zxA)KO;7zhR=@t3Q)-ulHp11ST*ULxt<^9TAcKYX*)5}kN+akTp!#Mt*s`sy{<_j*)
zE@BR3{xw~^IdRgt(#kJee?EO&A>w}2M%dv<bMajU_Gy84d3%M61HP|TT=X^~HEz;j
zwRKW?EgxoIv?{)FsjiLt%3Jk1{hHpJUrjTZ%cq{MSoZ$$N7re+f7Wlf_*FdNPEFn1
zyfvSvy3CyO>+Q=qJ)f1nMr-{2u-Rh9>OH$JJ<pn+ZhFM1v*XhDJ&yT5ribrazb|5E
z-$JVg2a}T3|Ge+Xd0GA=_~U<B-M#;!tNH8ofB!GD(*A#6s4nc^{`7DEL(iXf+EACK
zvG4r;>g_Y~3(jo|uRCmIe(zve@cu;E+AB<T&d(dWfAf~tviDwoR`j=Rcd(50=`Ygn
zWK1|V=wHm=vHN@bSLt_hSGu1byw-Rn!eQ-Cu5E1}YlZheeD`kqXX$q`=j0jcm+UXt
ze=XkPyO<%nwaDBRqO(@sbE%W4Ju2!bW3cq}I^Oo;!<_pLnx5BA^>8YhY1m&P!29XU
zw<RZ>ET${AS}#o#JQyIp&t&D#Wf9Y&FDo|OyQ?7cg{5lN-JZn{1-3^7I~+<CZg{I5
zwolD&X~O!A=R<D9YW&H+_+{~RLH>DMyt|%%h&lYmtYfbK1#ZPVEPqo@yqDlTB2_3i
zvA5f>r!Bhk1<Nm<`G>D_Xr>v>)>y!}BwT6MobAW$=hx>b&#SMVZRIXs@}PO|+iA-j
zOU?X`e*fsd#Jth&uEGt4*>~<FJ<r?BsI0RyQc}_>^Xr2slgUN<{$Jnww*C*7|1b87
zlNV>-sA-=6=z8=u#lN$yRIkl4*7`Hek4+&iJLHqrkKS8x!P9f@F?79Mux_UF!$KF$
z<5A{E1P#~^&3VFC6}jNlHzz@dSw@O;`iq!vPU+bh{(SoT^Yz<8y#GG=B^4jKWBVed
z4FwK6QqS_dnwGlsqG)GFK$LOa&dD<WI)69XeRzEG<55ZNbNlDlR)nvTQTMEfVO%2p
zct#f&hspKxPrrvxDd*jM^=pdHr8hb^4(Q#`IvlF`>w?Lw56Lmt7?ebG&b`(z?Rfcj
zLgCxJQ}%B<5oKL>zg@#De8<*x@`p5=TH5~Sygz(jL;cTlzjhk|6~jL#)#_TRdY8J}
z-MO#3bh^q}?^M;p(#u1_E-eX}7X2urPE5^s#;P?BYEmWEZEzFH5DPMt{-^Q#{dJ9l
zUibOsmaaE9-F<4`ypY_e9!>ZAe%skYA3Vz~UUJcKu0_wjr2TKif9yLr<@?$HrsscO
zI{dTsbN$(-WkvE&p6)dY?KW(FaobvZy^QAS+YZim9c*3ps<eIGlsMfi{nl?Ety1yV
zvF~myebaw^#l+3Q$GdlFGn+}7%WZg-v_kWT=#>ig=cz{<*pD>dc{Y1;)RtocJa=xH
z#%^{~cpKuqAy)gN%35_#LxZgw6H*-2n-imFRBkxac0-Dt>mzH3u6U&O8TBd488)9f
z|3~!Ot0ObAlGh}NZ~GW#CR4!h<j}V@+}3Li^s4Iq{eF@C`Ac~P%kp!5`^-)oKJ<LF
zF7v5k@Bdkmla~lfoex{vzTMFBIP>Hii<TT!(o|bEsps&jqt-TxR;uM3xzRsPyR4}!
z(u{smuYS?tdS~!Sk^7v_W}cN_lx$L#IqABnzwwpusQWG&S6lvhtz17R&hY=$Hbd=h
ziI<LV^v<39d&BK#?W9##iwggI(?3=eVO|*+<$YTH%$N1orqp`fy7(@Jf0IXs_0oGi
zmp5KmW_;+uocVL-9yENJyW^jkw%Ovd+huN+&9wj1`tba!5S2w!bog7j^Is|yXwLE5
z{BX*tkH?pU_+MM-{OVZ7!e@unCvqQe+^^uJ8NI<oN>tqRyR@6ap3k$_YW?(fUo`2o
zLGse6oiTQY{sl*cm$g>BK9suVvF0H;_Ml0n)4rS&i{+G<&U$I`{hNopb*HfI(Aq!m
z!?lxoTaCTz(z(|w9(;Vo$13G<z$Y<hwtAOcPFtrQd7E?4*Ji5!P4^UjheyIMgxDV5
zo_+4&)i?1;TpM5MyybmtnIf5fddi0*(aSkE_gX&M9mev*u*Y;#e2?n##MjCn7?!RS
zU%II1-affHqnC@z_A#&i;+?s`>*%r1e<q2Eu3t52SGq)y@l^ZR`^E2+UjHeW#P`AN
zW}LxYd+FD!j@d_>ou2q=+0w`xyL+qW7l*c*1&3`r<@GI3^SQzQOBT$bZnJ#${5gFl
zXYI^gZ;l@Lt?gNzy7bw~jZ&W#z1}~Z<hojLlEBFiXLQY$CjPZ|%8>FrYw}v+eZ3O*
zOdAPq$>ZHo$ITb7Kl?O(ZStPX!k6=RO}1ZqVfxSZSzNYZ4RdVP=;!OsT;6Tw%K24?
zt*O0@W%`~!A6~9mQsWlC{<&mrve(02e@kXlXT2VaUv~WG5AON7aCN{vtts2Np6Xgp
z`TjoiSpLKLM*qB*ee|4fDE)uy-s>-O!av5p75$ejX|Mg~y7A-vt4<m1S>p7CTXCOU
zPHyYRRjn~^&5l-FRh_8U^fAkx@mTiyEzH-W<h>1ezAt-o=d=k=IluIilX@2o?%e)=
zSgNhM{c95Et<2T3^9sJ5+sXWEX1hyD{`=dJox9zO)wkLSy)O;u{+_i#^^8kJr+!<a
zT!>(wQxc!L`ZBpJzNe=1Ur(O0IPOn|LHpB_tag^)Um1knxax5Gu$p(`*RX`U7f;MS
z>e6TOv_*XJGp#3KPj=i&yW+Va!PeAmHcRT3&XcT-l8*vg#QgFmJJx?z^0a?GFVFVp
z%Ri64a9#c8e*Lb%pX<xHgPzx~n|xxiduMg+;@`LH7RxTb*q6yTS2g|bk_P^F8q(9|
zo9#}W|MX?T@ytr~KMRx&2Zp?~HME=7((iV}>+h9?bB)E*m;Rr=`oH$`{og))uIDSe
z`)7Xb!~d2MbN^5Ku-WRr?f0MW7y2g6yL|u6wy^a5w-!e%e|U4fncxZg-&aAKb-U;P
z<-7Hj?a-$4b-&wrn}qNGc(eU}=7o0EcYoP$|Cg)&Z*K8hw&dBy=-DzqzV(Z77~51_
zxqW};?yJw-_ximJTpw%s>T2NQeRY2ypS)fE?;-R2Uki%dQ!oAeJV&6Kn^pcar&E8c
zm#+R(_ZJx+>E_EG>)+*gZmDJ?Zn98it%Op_I<vEmA=RrZ!(P5Sef@d5_;Pt&(M_kP
zo>_CIhT{oeW#glgn(HFnJhD3%-3wkIkvE4kOni#ry@0l5*GzfdFXR2r#vAaVqSp4w
z);hQ45C8nEc^k;0DCKu5>BWJQ-^;g0o;z|b=B=ID0k-Cd?g|Sjfw+F}?aKRv92G6k
z1phFyvHVx@?c<xZu0dSsf*W0mMXOue9>mVJTy%DV%gR)ZHNv+QwwM14i+;kDpJA1y
z+;qmps+8r(-6NSceQXaaj0Eab+V6NyKDgmf9Am$h#pBLf*7ey{n^J{l|LC17_U5+s
z<m{vu(;ux5Twic=1M|+n&UqKErJm4y+NZ*5s<id>oUX5Y-@pCp4*PJw<ZFG-mAgl7
zB)NIq`g(ZY#5r9HPk&fHyDR=p)5LXqd2UNjiu-cAd+RQ{mN15Q%<G<Adb}&%PhWV#
zQ_h3t|3v$ZpKC`4{M-INjyp@5cVhu}*Rndzzd!k3@s_q__f2|}pg+M|=bdlCswp<|
zb3+UDB@dnX{*WQiVg5Grelv-`-j-EUGTS>-*4dom_;l-n-9>e)vv>9}^E`X__*}xY
zmPOmY*j7%QrZA7`giU36;n#0>pI%+Q{rUg-{^^QOudr^oxQyqXOH@V5pLWA*Q-us)
zzArWN?0jI?{QPwDjPKoIUJl<s>E^wUKBMgBp>|N)-CV;g;&KS%;+XbBueUY6m}a%+
zeTSQZeV>4}#iWoOlh{tK5B=EqqMGHl-MNmO%1L4;84j-gb7p#@-LtQ|{qy~u#b>=%
zk-X&hd1Hf}%b}nBS4DnJx;1HOL6Xc7R<2m@lm)5Z#9NemKg*qJoa*>=i+@nO`-dRU
z%?52>uN-G8Ix=I<WhY7ZlML~*y!TsWGbsMI2tDU1xO9Dj;>2@Fmd>-%W{SSw`GoE1
z-#%6$>l2p>+)ZO;_+KsjoKfd15OSj<K|qUNyJfMxde5Bei<B?Et=*otBHmKt?6Qkr
z5103T*gx%s*D0>0H+8;DT~U8DV4_X+(XB0e)|jnc{%&W~1)kr#Uo_XwGkbqgZ~Co2
zC$r>rjAyydt?itsZJ6>)d;1m3xU%VA99@J>dblF~&3N$4>T>YwHSev?Rozj(Xe>XQ
zC!lb#@wK~RJ=1UBJbZrVB)?4Mv+KSJXDY9}vW9c(LV5KEIiV`XE=Hc`{vTQX^#1H9
z&j_WLG2V)v8&y{3gse^Xi*}J(Jn`?*1x{zRzZ@u8Ugne4(EauKtZ5xvWYxD^V5vE^
z!CB6|Gdtpu<<@FtwfjAXw*HUg2A#H)<6D+czG3Oyu!wl>up1wI`s0JPeez>>V-OK|
z82_;IdPd-hw|rjm3ny6oS}}3M9pN_xJC=5P)-~;{QWnSw;<aK~8CKqu*S+FS)=q&K
z*(vN26X$Mcd%ro&t$it9FW)+skjs)1JX@OXRzDH_R8TM8t|9JcDB|ZPx7>EiSBa0A
zZ|h!eU;OQQ1?w8ij&wQel?tzPC(FH=yhHp#xQ(<;vx)Nb_4jKlCjW}OV83Hi9-rLB
z2YjC`IToGr4K_~D?R>KKBG;U2n)Q{Nc5ImHeD=f#@5nN}e0Jv>_v~U<3oEkgo#x%Y
zB#f_q1NU70`0Bgwa!Ri)yC=5ITH1a}u-Bd(waEE@#GXodEzzBGOMlWAC5CsepJ=bq
zi}cJfeY)$k%hKyc(Hp)@$@)HX%G^J4Ik(r_L|=Hh_2b98QuBEqlr!~D?rn}K4J)fi
zke&Qxsj=|Ahi$%>wpw4Fv{Ow;rTWp7$7NY7JEL~&nL8sX^_<hBcb}wg-?z&<>>~2i
zsr%lo<E8ywT-Wz$g-=Y*ORJxKecs%CYcp9@Z{#e<ITB*{HATgb%jVz|;l`^GE49@E
zzpxd*d102mcShZu(wA;;<<`Al&yihMzIo%P_Al?cpE>T9&YsllS@Yg!oAu(5{#mW_
zSS$=O*^-lIg?}<VqWLhy_Y7N}tFPX)miseit<}*B>765MTEX<RUE^f)b^pM>wR3hY
zoISO&vg+T*y@9E^Q`}eacVE5!BB5aV0XtRk$7;?@4+GR*oUYy$vwveZOWyuT>*5N-
zZ|-{K|8?q>(+t}TYr9_C%6vU}^L5NS$uM)izQxaOPCs}mtlY-Qam`x(sKa5qwr<_J
zQEWq<<QAtFa&<1=OFl?4dt|jucAOY-iRE0*2Cuz~-u@}sxkxgZY58eUuNe*7O(nzC
z?yh;V@BC!FaKBk)(<V6c2R`D}=%2W~`ryu`HcI({-wcnq@4C43=gNvdcUGocy}(*K
z&BM`qxti1}<47jcs_^o3DcO*vH$<xUC$t#Yp78emdWQ2RL&U-BqEh=ZEmkj4IkV*6
z8N-#K`<UmY#fP6eDj9h0rtQ<cC)8H|UhQF`7^%IX=+^DqYtMcAc1-I1vT3(1GxStV
zmz|q7?UTt-LuVQNiXF)&H>x^!2ydHp?%U&Kzc+>GStcs+Ts!ga%`Zu>zio#uF8{dw
z(Z%_Sazz$TCstNvMy`mstMzV2m-V_wecnCRcAj#VzMNe5V8503`v2RWU#}1Tb6x9y
zI=FGP`SJc)4=SHCHQL^Jz{MHHeP-3^J1bqAw$A6^-1eEpW5Z!T+XdA(#cm#)!dpC3
z?B+qg=AIR*Q7P?j?bo=L?YL}nenF>g*^a-uZ#FjHJ^ob7R!rntCI^@G{}1o-zb@F&
zKJ{<Ri4C7k+I3?e-RpVlv~ShRjmMIkZFZc_^$KX%X}^Bq<tGWJ^CxHDnfUvr?9Q5d
zhs5Py^10<*X!USUejxtsXU#JC#p@N)lbw_9-j&el2nkT+lR9I4xZ7~T><{UjGuhUg
z^{r<w^ndjHW9$RRD=93?7MvCOu`6(<{HtB8vme&-7bhKbJ>`68#b(Pt)u|OXG(~q$
z_jC%Ho+;d=AYXNR@@0SNp0AH@YV~rS^O!H?Dkrz}rJ}Oe@;I&J<sG3CZk)cMsW!Gh
z6INZz{&L{7Da*+RZF@3h(`rv!{(UgV>v`*>jcI<h;eLlBpI+a-`PTnuo1@%BPONcz
zsPM3;zxcfV9f$9~LVQhHZPIogxRtU_S9wB%<I7zAy;JP-s}?4nd>70x>q}_T({Gl}
z7M+3}T8l&b<i70@H;xwgxa08Om5Y2+Evua}qbBh^Xx{dxbMNWrvm;(<pI@7?D6{yt
z)4I5dywi@lfk!4fO{mb0+AeUnH*=O{z(Tvq@{ivx&lYmr&ChFkVqxj5{k&D~F@{Am
z3y!Dny_ZrFA7_&PkWqf_v;0K9wvIcSFXo4d=s2x9u-!vl;JVVewQ(AgS{aPaa))j>
znOoGXU=bdg5}%~>==r7Dk9po*O$ogH_iK%FDZAZ1`Fc~K<dgq$rB=%|>%0)T$X&6n
zbEo`CQ<J_MW>J2jrpZ?CT<>4YT=nKet^NgZiM?A?GgyC!^FRFYe);z2(|^3b?Jxet
zcGK?1`#s+F{SWfkaI~)4@nXy#%ldBl*gcm2X6~D`-~Va8&4bJP<?nsIFaOWWcix=1
zm{0fL>+RHKdN9X9{LhR;rhFq_>1kisdc&sXG)dSlwH2t#6cQIyw^+RN3BSql8n1OL
zPZ<0TxmmSvdv9_M&#7naUgBR?{!%PWomU#im%Z=c+&A}FcXI4Viu&NPK&4}o>ou!p
zj>TV<Z%m*5FzR;>uWQNL&9&Q>t(q?1uwLQ3Kt$t$lB8AKm-@f*FMcgrq*Al?+!OwV
zC)FnV|Ni<{wEO|rJip0}<>oVa6q9#1pJwm4Rqe9ia?Z?mD;oK7b9jGd9SJ%o{j_m6
zL)1!_neQfue?G9uta6H)A%|4*o(oU<^4=G(;eW{bnCG~TpQ(1aQ~5#W-;?Jt@j5)0
zDq`ri>uF#7XkPRSKBJVzBTcGn?xkMu_<7>+kB&xGr+y`tE1N7k0t)3bZ|P@FX8)FW
zRiYx=dC$Q+i5DmHY%`D75OC>B&CBRd6)}6aPsm%v;I6-hXhjoe)s!@c*jmp&t;@o?
zH_yD4>*{Bu6w`BWBgeLB?tLGmYtHhn*|~t<&vk-r$Orp##TIRHm+e;C9C&TFTm6~D
zg0rcs8u{H77&X2wD>8aJFMsbOtGGDF)=Q2D_O~o3PTONXtI^Ep^WA1ogU!9$SyazX
zSYq??n{Y*;HoNDmtb92$Zh19N!^<YkKdbIdcyWqxd(nZlG6m-!H~eniU{bexzSp1f
z^p}6+=YFe87yVzmY<}pU?>8Us=Z&2HjEm7ct5}qEp45Z2k69vB4($HT!gz17(38CH
zGvAy(e4p{jyMpbEe+oLkJ-sL|UQ~W%C1?=(@COzV`#C;~8DGc-Uw-(wHtxt_w`I@F
z58jh~r`sS{lhaVXJh9>X-;+m=|6<5j4t;m5Lf>}zw!~Hup%aFeovvN^8>%ngTM+QA
zWv6KE$}3@=A(Ql9B!Bx@tM>E8twpaV3h}!qY8UwSZr!AOSikmFrS{d}P%egFrH7Bm
z9GJ6;Nw~Iqj%;4w{g<m=pWJl5ZS|*<3l`jA)6`Ja?EXAu;?W%}ds1!G-p|=-$A8Um
zc5QOh%*e;@bVIW~UzRp+3aY)it1aP)OyCW!y+`gJIC-tq($+Nf>b3i(D-TZEdRp?(
z!I;*HM4e?z_}JrKZAjx@e0f#J@f<Ba!=KC7>+QIIfg@t`Ijt9+Pk6U$bsn+FzBc)3
z>Yt?<5hoHXZC0JpR?5$n6TV@kW~qL3UQ70k$>RFg=IqJSn;|=s#jfwl%qWXx44eM%
zoIX2W=vqZvq2f%-Yp+sgl`Yd*|F3I#ih6D1%D-{ktL}<z>ic!?_ufC!pSEV$n<!7Y
z`|4cM^M=l6lgd1UANNSHr<k{;8O*w_{CIB6KU3AU?;mWxu~7Na7OR;F^)q*dPRZud
zm@Vq6Xf{o<YZL2Iu2Zk~xV+!$AY=dLj=$*ps>%-~b0#$O>1MQDUmqKsxc$I0k<U!i
zRdQQ{G9u@cb{8)+yRFN)e0PrEUWqAJtB(A)68)sY-<Qg3r7YNbBH;6?)7BTB<fqOt
zR61}<#Mtj^=>kSMabE3<+?MZ~gS1;kG|e~3yE9*|5C59eD!+5duZC04KFkZWo?}w5
zOy>NpE1w=u(R-t!?m0bG&XP~}>U!VGJ*73zRpzS9+39!m^o0M*I4azm=5l_1@UYZ^
z`;^#CBNrQ)dCdpUYfs(G%<G-~HRp6{j#q_k<jWj00UyR?GcT;&b>~84-Y>6vi>h9^
zZ#Hg{eHz5~QqrMk`X-ab3Jc;ZUkX;NU}ak+dPYk!dS&oR&s)zV)kOCPnTBy~h@6=h
zpgS#k)^eekl`%TUbZ=fVE>!Qn>2WhF@DO*q$hqigYcDD9Sb1jYosZ2E`m&5pO)ub!
zv-At{G3KiHwf)CcYsvS4!3T<OS#z9ulewz$)TBkX<yX1?b})=$n`0Buf2~dFZ`PIz
z{I6R2XCB@gc4)te?S*2qM-Qh*s%Y+<|H|Uk*+A|o*LGjq`qoq@`}cxHGyMI3q<(J7
z+%WOj2J1D|uUGUHsg+E*y{lsC(QSWPzg5Slck6H7pfaubB+t$@f@iedjo5|nHp{s!
zno=+)jBjh_agj}HCq*}GO<Iy`w(au5T^k(#B+Ocy;#aY$_Rlfyl-?(g%%iNc7iz8l
z!(L?>{c=mlyPbtIgTvN#Pj%MM&Fe{DnNz?$#ZokC=8o@@tdij=%}&c7ae9RMDy=>3
zYx0hN$#u_-Zqr!j_!kw5Y^V~xB0Bx~iPrvO7n<jYckOy3RLx!T&}?`2evPQhGC!}Z
zT%cy7o4HCX*Xa4}+Yi<Lq+9C<EjsEFW{`DEU1y=}k~>{9w*U29Q^qCn%DhLzQ7cUC
ziuc3B$@4aL@Z9bE>{r?Oxn=#uN>irflPxhPLYUpAxP%17J$3mgdERS|Mvt3W!tPt=
z7A(-3I5i+%D)Gs>jqi-rAMpyToWgi{+3Ou5JQ>+++q=G=|Dk77mtH5H&+{`wJI>7J
z+NRGc@9O0(y7X=K-<Eo0zvtuy_xC>*m)oX<d(F}RcP{>qNPX{=%*%g&eZ3nd|6fr|
zBmVQ{@9BU3-n<?-O=+&kow(wwnTuD~Jy~6svg*2g!Sd5PnGIf=1zk_>TkP2OAUk5E
zVX2d7jzpLAlXK4-ogQvA32NKb<aS-)`N5#8yA#wVKTOfka_6sea>{y_d^|Wle^ty1
z7m<@^*Xl8}vONkoedaJv!z8%?V@cQVN@mY(#O6PH+VOP(+jpC5|7LA_>}z=7%8}ZV
ziI0r3$|`p!-A((^d@^U_?IXgWw%?ZRs63l|{Y=~MeHTs6n{9rs*Rn@|@uZg2uCBIq
zix!?2=8awW_Fw<+l@I=xO+WYl(!IO35m*0LErT8%W4yin=!5#Rvtkzh&l0R=_Ydb?
z6RG-Q?{R0A+qYF;C%>QB^JsAp>)q!oSZYmF-#?t$^XS_*c{A3fd-n$GPg}5P+pUMk
zD+=~%Rxk%#uebhb;jfypL33ZM>Wjs9cNVA1MRNYy5XD*LRk`8w<fsJ+#!KIa_U=2a
z@iM=mWi9J3Z-?d2dX5OcmcQG*xbU0mOYbwA#CfYGJ1+TmZ-In+X5QrDU4@0>$2EVS
z>5QEBvTkLBt5Hv0Qu9saHSN!3Ue5gY-RFOC>d*7`_cya2*Dc}w#u~xsVbe3Ue8J<L
z*Lr_Oo5_92K9(rEB<Jw6SHGqnJ@UBObH0ph!hJu<MGueM<+v9lCw%+&1$ntni9M$-
zT+-m*n&9KKlK)C$d8d1f_i}s5;HeVdI2M;rpKP!)EWAm1+MjOrTijpElAo>%-J`sF
z2fLxs-^W$luh<XqZ25fY&}80V>8C>0eGk63c>Fx;9q?R|T{FRS8p{qTwF`5@otQ3(
z{&1bhTC=d&mDSUDuT;ea5r^VTp$OLmpYu1Ty;^irLV0mZ;RDyd`U$*?o@8;osdb1e
zkFosVQL_7Y*O`N2tGJ|8?i%VDi2dW_O)oHRjBCz&bg|`T*FKk%4X-o0FHF7=_H^E9
zh0g8s84_Y7Riych^(-7Vnf7=z{5yF-zt3#(w5tv4*8ZHpE|gSsOtZh5qfeJ#r17PX
zyXLRn+*i_B2ewtq&q<p+`-AVKx?@Kk^dEn}>V0Ew;MH}4$Cj>BXXf(_^fS@YwqEu@
zM%KIU)4__bi#VS<&R%G6^2e(wu9EAeS$Cbh_tfImWu3bwQ7+9-&pB)qkvO8%;cm96
zM&-kc-x4{&HdhoDF@2NhzQ?mEPp*Hz3#&|>#~%I70rw6#&pj2gB}6sDuw9`)@SNk?
z9n5@1m*=W9H{H|rT=;&=6I;$jnXkTQo@9x5-`yS*n7YixIwv;x^^VtkC7&+;Jo-}f
z*5;+T9bAX5Uz?Mk|Nh)2W;rvKWm}>?CA_s>Tec_6q+pfQHR*$vuWz1zzAi5EnfB?L
z)S33HQ}-1`o&UA+NB#F{=l}2ByE*pp|GRNN>!*L%{OP~l_W$1%YpweqmzPCr_vf!=
zF5AEIc=>n7{`|M9#&SD$9N%tx^hfNb*qeF&oz?mm*X88DH-B+h=<TU*@8qwo%Xxpk
zR4qHncU!q!`<jXqOLFq%ZJsgq`v}<Qg#X#+cscoFv*vxD*}VrsXDbJkc_tR6+DNdz
zI{M`E$3t~@U2Avw2^A&WKT?t8<tKCFhPnN`{kg5Pryu`u|1rP%hx^;r-#^@MA6MhD
z=hm~?oB4T;-?2HCwEIo!#iIJ=A8JxlPAM0Q*A_f*+k1J{>6Dq85<FA(OT_sH73wcs
zo+a?K;0$Nq`TO-xlFl@#?3wvs>wjy;&q|s?ncdtE59UTpG<h!c-Td*6%1ihA4VPD)
zylpXOO4<*L>_usMM;udR52_uW5qofsuGjX@ChLpa40awl{z1^n)Ka%X$5ORu;Y02X
z&Kj~VKdKc~pR6^XS#w!xX~G7RO$tW0?)mx8jgO6ZvQkCs`K=Ch`MdQurc_$%c4T#B
zh|QT_C7U>F|CjZ1PBmP8CG*4Vviz)d0dFl2{{Hs(UW35H$X%8mcDrMrxqBKv_1gGT
zw!^%}p6BzK9Wyy|XNquG^|L*FCNcTlk~bMgz4>??=9_rlOnk1wP<oJOvBB1C_2vKf
zcwO_@IOUr4A7j6LzmnVcxt^M{m(NhrTL0Zfv5zNT-aMLm%2GM|gmTTDNaOEkYBE<B
z{JGTBC-XRd8;j{y=Kgz6++RCyJH<1VkH2|hT1E1{v-Ro|t#7X|N_t`-ynsO?yJ^nb
zp!2hg?DnfUFZ61CIVnc-J@=mZlT=l%H!+!>N>XUZFAEUguFyH<PG6v;FI$N0*+YRl
zj<%S7zHFoSE#_BO^zm0SOUx%~oj6-_M3H0N6gj)P|Njo}p1*!U>+1b;{$5(tb0A|)
z<=Zn-jQqP8b2a=jzMEFgjf(#vV8W)p;X{>2>xKQ>w)Qx@uMKt*=l8lg@rmke{|P%R
zAF8ykxITM=_?@*`_J^9o`>$x<vG=Gla-8u@H@A2}A`k!B$5JzwPrtZhrt13{1#gQ)
z<;yo*+{%B}aemE>vP;=V+I@GtO{pk$T|H~!?Sj`PFU*!s__~>M*V6bJ+2hw))?DX*
z_muhQ<K5zimc5OCQTsuZhvj+ppVfCxSZIsf&E0ll*@3@BkG@Va(|%a6@C^T+2kAjZ
z`vsccw<kO6)K`@~l2lX4VO@IXP}?0&-y^P@rS=9Xd+FMrzZQ1$+J=dd*0bX`@7|dr
zdbd$K@@UD)L%;V4sp|bJ%RgCo`cl}m?%$h4%%*JfvYy9b=XUGV%w6j90;9Eq_wCi%
ze6%z(G-Fkmer$7EpSgW`^S>1*|2R~KyOx!@OR&z7-4mGZ-u7^{b<X#9@=v$gr@oy2
ze36aly<O|0zkU7ufcu!n>A5G5?cXx-=%m=cKW7>JGfrDm*0%iI_3OVcUU!@M#v;%n
z`GVjq{XH9v;?D)#*<Ek*zUJo2PuEocnI^9iJ9#E@=aMkJl~cW6l|PtNHL2lw*2cev
zV$rJqcJD9w_x`Ql?sfl)t3^Rul(qi-e)IAE&J9_`uFcOgDn+H|NqxIpy=cSxgTgJf
z)~Y`)A2hysW3F1{kNXw3^W{w%!t@Gnzkl=Rcg}DBoaFLvua167c&+hAv-9|hf1T65
z9xpVLe7N!N5r<W?CGO01PrGiPQLvp~zP-IBM`TA7yHy0wu{W(P*_)(KNH#s>O>7or
zsFH27Z<xDN>~Q}@-kl<=>t?1jteDWDx>LYKpt~;r^SgI>+*7_x&$x5H>$k9WWBJ}a
zCpJ0$lWphw{rN7-{tG5M{kr2fdEPj$abkK<8f)7GhjYiibWN{_x9F;xuetE>gZH^l
zF7}E1>NA{mFmZiY1;1{vhQ`z$UdG#>KTQ49%XHHGm&MDh3*K#KSUleBSSfA2L(eUt
zNyJdN;O-x7#a*x0GBKZdvEk{de#JfJK@;=Jwtf4sd+qG{+<*tdD~~*x_v-1~y}Cd6
znm3+^{=8o}##ki&rPF_vGmVo3UtEb2GUA!KYQF9)k?lX$D81o#)cJRR@9PtDRn_Z{
zsGU2Ibm3dAW3f}02;&N!%?BnXgg0nTaMr%XQ8ei`i|pA*V@;#$LgL#(BHQksZQwdI
zTf(_+#_WrmJeBk`D;*-u)chD9*S6Q34)hDn|9fSkW~JGc;|JQ#Xhd^fo4NGIw@EH%
zZo5UC+Og-$3`5(dd-a{2vbGl&9^RqCDcRP`{@uo?vxVhr?uzptW!ZhwzD_T$Q@QAx
zF>Ag0QI>1&mTR-ptK3A*7B!v?IwTSLl=-1)PmEXMa-Ah#;=VMlGdJf+|J9*w{Ej{F
z+`ELSk>O9SC733Bx-skgHnyw-WwrqyJ5w|aKAjMZVOgE6^kjkG5?|>pE1uR`%4uhD
z#uYfR%jYyXaHpB1Y@7SdU}rYR>qp+j797(zZF#(fbGd;P|5>itmKA*tA7xA<_!Pau
z@(La`ubOWnckMwz_2igKpH%oeCaNF4*pMbJ`&;v?V0WI|_12cAov)S^%$dI9XUqB1
zc5`?49$Ef9(?n!ZxwnQt%X67~tvfq)7bjR6`C881Q+25)PEacS<f69?`AM!q53~iO
zr(N@#TDZRYew>+C2IEStrG;D?uO7Ua?e~B&lPQyJokQ081sh`y9Vx%OxH4$Q3~Pht
zveye8a+wX4f-2hdJ=Inm{wL+~^pN6bj`OOTds~W%w))PpJ?+2V^!;6riR?zZ`5vz*
zmk!#N{eZ1er=xSBwc9yi#~ryvx0Clx|HoyawtC8Ug+#GMk2ICnH*|I|rd0<eOn1NF
z(XjsDyNvx?FY2z`bs+Zl%P+wSzb&VKG+VKC{?zgv(%&~NRH%6{>GS;C%REk8Uhfv$
zayq`5Uspov=cOjiG@Ti{K73!)y+WuyZ(B#nq{`XnoRgVZ<5bz!r8=0(tvY%zU3asl
z^lPzf<1KSqK1|qsaM8V@ClNam3)i;HJ!>b#_Qb_|<=jIvmtJjaRo!D{^+~U6YN6!Y
zo#FuzQ4WpU8?+1)jhAi8xV1s))ijR>`V$KpRfR&Pdsy5T;>?=vVewsvQ%X-zN^;8L
zPx~%aC(PBjX!tTusVk;r=@jMvDYvdk1Z{fzd})xC;$=Sn76Zi%LC+*Q__P_;@JZD#
zUtv4D!|CsX22TC6<*JGowkosiHxOLbV&&++-czOg&BY@V_zM;vYgl+#X`blZ?H(;V
z6;3gqFLUjWxv|pJ(78X?QSsK#=f4j$n=ExojC~aL!HfCI%GWjq?9uzz>srQz9J#W!
z({aLw&j%dro?m|P$Kd%({Udq&*CQWQWTl;sm}zp&efp0U5#s<=n;N~f?Y3vFB7)s-
zeJRlFVi2DyX}f$~aESTZ(#0QDy)%TYF9hv~vo;e`4`Sq#4Ex2t!Fn@$as9J|X{tHb
z3Vt!mpRu2@(0)c)YU9=l-=%Y9oGMpsnbdxp>q=>(<IbYelFgjcj!t@eA}6@pNBGP7
zW{ZXF%UAY@bG=Gm$#gqWc6Gj0^(8*9$={@=EeY)3$Hn{p!HqNOg;8fV-8=P2>Po+J
zgd|JM->=CZG$vfsV%Wshu!c!t|89m8lN0*FKK_4t{J%DITTl77@~j{A<>7z$PydK~
zSU<1wul*kT7I{_kGDW`*)?4w3jaeV9+x?FVU+j_m@qv@U*;@7RlMgfBJe9rQP|5di
zV_7<v(4U=ep3bdTp7TNY_G#<iUy~{~T)oF;ThcDJyydB5ui3^4<z=r}-*9>yzcshn
zHHbs*Bu7n1Dhr?39X$!jE89*iuql(^zVNU--BaKKtHR^H9c?Ktceb6`>J`BF<oMF(
z&vbdVTK}7AFKd6tx`xl}v-+JMiRMQ)*qMBhJG(yYhn4h)V?Q^Rb1$FOvgg)o#giF7
z?v@Asmr8Wp*K<kk_uL<j`*$Bqzx1a?I{IOuNB!jAN-t8I8+Ds_*EgzOGEQkd@p;Yk
z8CP<b7o~~(yZ&>2{ufgXwU6=l=l-wMp0InO>I{!biI1Nz;IZeomp*>|V}(x4PD?YB
zp3XFp_eaAf7&|6$z5D*<?lf7Oz7~t`S+iC$FdNKzRz6Yay}HrnsEYwMIYI0Dk1H^*
zE;sfQG$~vyd^}OIrcZ(IPv49eBChPml`KVmZ;XAip#8pP?_;SF)<5ztkE{$cr%tPH
z5R|>~`_9?t=VqRqF~P`I$4l-{XLq02&G|3>&T+iOb>BkS&2;+yz9b$-11aW(5>eNs
zh3_*<M~a=gEpNZa-rjeAbG@G5rJ@?Givodp_v7z}ckPL?m^6{?joGQGy?dS}_#0Us
znev>qUP|TV^G~l^?{et)uq+g<^bFc2W7TqEFYDg7jQh*{9_uG+>HN#kKCV>3cI(S?
zKgPf-Dz1MD8E-gEJGa{N-2aOg16TISJWikN$XLZ+^7cVpSBYSH?;@=kH=3-Ti%(X~
zo;!bvdc5P3N4~LJg?RTLarV{fym`MpJOA9hJyyR9z8cTy*}%OgHhX4&z{ho4nf`uW
zpDynuzNh~C$3K_;zqs7~S-Yk|ApXR1@%MgxFAwRm3$=>y`yGuB+V(Cf?Ol2-k4;<H
zG0O{_mzK%qx2D_2Cry8O@`Lr4?JoZ}sD4%6_+XEwmru85#fyU$s~78}7v*}V%<Wm*
z@?kfxQjKZS1o0#6+YcY~S}w3LEK2vJ{%Hk`e@|{P?w|P}#<SFd|M{ZTPH8;VXH<?W
zEj9XH-=!8m*|F&-kC>SdXV?1I6BG+eZ++Rf#A5rQ{fTq5wCv|6eQLRPa)QUA^N&?6
zj?9^Qu{1$0kDXQhkKV5KgMD_{l8;whKdts*lh6&*exn4}yEE%Igj^^Uw~Drqi6~6e
zmUlI1SuVJ3s*==>rLL|il8IXH)tw%_s})uaE_`fJ#>5;RoBY9OYsIyu;}=$*nQf_}
zxwx>2&+CogLq37f2@OIr(IpGNwXaIZ%X}DQyz2GR(wkg=mhN`+a=GuqCFpIKeR+QU
z(Z@P5_t~T$9y#*tWu@a!!?LHAT!;TGoOPgPfmebu!{_V?f3&wv)y#C!5oxdpSRu5D
zM=bpB5<ROErzAi3o$%sZe=z9Hq`BQ2Z%aG%*YPLMd@7{K{`bSo<BLqbFX6r>sPg&I
z(Y6<rd$qTeTh3BGu)4j#R70v_%}c*-LADJ+@7BLie0^u$gdm>H`Wx%+8L|9k47YeX
zcdxnRbDp%LZu?#zKe1u`kKA3NQ*Lu68uD1p3>P~#y;<U0@0++oo%4EUFWFWab70H)
z-c31g92$4lR(xV<Z8-5%U31O*x=W8IHnlSRp1vY{LduVv7ZSB)9;LF2S|=@erhoNS
z$efvxZ?2#8OP(#AXqm#6c!#&q`ep|6bTONi3WrrY@&q0`EIs0EaZp6}#%1BAIWJ~&
zz4Q+}5FpUTa9nWeG#*tO2J!sD>0cflYY1w4zRo?QGjZ{+U59pyEN45Z`@v)Nc4oHx
zf~C#B1q4;Il=}p@p0MN`wK<dhjge>KrK_(KR4&TB$gPnsO52%!!D_Glx+<Q(%VtJA
ztEfNlByta9*3awvlD7!SWo5NS+}L$2=HacjfTu@KD=YtXlnlLQz0u>tH+lW_=ls|A
z>FWh_A7EHqCh$~wVnl>Sji8L(;jf>A?^{ghHjmn7c%idu?#<(8Q@=G{-PR(M{>t|P
z<Ga+ez31xqr?V_9Hm=LAdS;d&7qavIomjQ~lIDu9A2cT0F1}*^_+~=nM9020vww=O
zn|w5*ujK59V_}=q{&hZ(<d(5^oV_CLBg>WByN))mX<D*NGS+{BWmCihW=<zZb>-!=
zs_JIPBy0bDqqn!a<zJ6ZYav_O^m&4Yss}6&O`WEG^28TWtLLANT+0f7k#u^pmga5I
zT~YJymsI{*ZTxY?O05k7o9!YU_I{md!;n_r^fi+4**&+HzH1D8wN*CQAB&$n$L#T>
z4Hex6I|{dNSmm+qd11^|_XPfjTFipp6=r9@>Xb?^oy#`;5wp=A*AFr|XJ#;*3BTcP
zbJ-$g^Xi&;*DZ4tRo2fxYMH+5%gXR;Q4c(Y)=zOfyIGfI`AOcCV{2l=nU^RiFFSl&
zWBw+Ums1$J?WB(;x4%9g^nT(?4Sm;N-La`$9HP7Bd@2ljs`px)pL%=4bVdG!CA_sZ
zg>gIj)lQj;G0dAg$F1s?K%o2F;LgKR+**v%#!8Ewmx?S>IL&O^bfIOIa^O4JHVOIk
zFtxeer*_}ZU3|Ac?)3e?d8=2yKIT*<9_^p{;~l$@u{QTQ{;h5fe|UYXnzj1)nY)}z
zZ+*6@Zuu#FXzS%1lbXjXmOtkz_Slg&DJmy2{ZwqoX6wD8|3t5^ow={jXZDfZ-=~Mm
z-;4SC<DXH?^i*f=4YwHH*B9ApRz5$_?7OmeowfDc19Oz;ZR@Ce`{mxeaG$a{dnz+G
zWL8)%4RI5^KGWr7C3nNy>Bm1m^?u%ZDtW2<wiKOxUia*7#AnJbk*asMXFoJC@4|I)
zA=mt$iUwSp_DNXkuU~Q??bGp1-wsTCneD&8bcT7Q{%^fUvTpMG_jZ3XSg!tWl@$MM
zL9JVxSFc(1vEbRNMdEX_T|*C?swgl{Uw2eYY>w(icSc3QKT|^^Lv=+Bci;SNE%%OR
z@}a!yy%&2}EmFU(JhUdZ_Rj5Dscx4(Jw90-mr}FHxANqfsMHGg%9$T4CG3w{pVd0N
zEK6*b^^H5$yPtl1-K~-RoNJ-=wsU?}?)%EW{aUFbzpXE}a#^n1oZe%08k`M2f!vqt
ztAb?p&%RrwpYd*~`Kmp=Jb|mOUwa{1DYDvna)V-|R9kf9pJnTQcNG6U`DDQo$%9Ol
zafQZNein<5#>w5;o4xCH){^U~T62;omRvYHbJix7Gt&K!r7i4vFFbkhTxG}l3%q(O
zT=&j=#+tgvTe@2LT)^v)%el27p$?nwIsfhyWIuIJ^6cs<rxyG-{}{0*?TdNWws~tO
zW|*a3@#HV;pAfTXI`8hZ$4#yai=V4+m|Fhu@xcW;z8j8Qlqubuqd7^Tzx7(rGp0!S
zdlrX2KRetXuKxbs|D<W_?zJ$@U9zI-L0MGgi^p;e8IP}}@x61F5nL>?B{R!ocKzpf
z>-S7qlKN@W=en?5_F_SUEa9hy%UN!mNLaf~z*2r%(%jPO4f<t=XR9T--`zE-Gwq=C
zy)(KMCOXBOah8P-{nc+4uvDL#|0?|J;b*FEBOUvrC(dwfx%f{14%0pjvkm`LJ6EmW
zw{N54t=8C`W$ebgx^e}bT^_JJ_jU}pX?@Y=gMY&xvz_j(ez7mEuhTH_)QG6nwUfO3
ze_nRd+&zqfHD4QFI9mLF8keNJ?$61+H+<f{4PTxv9(=ya?c?FVb#)a|JzaUG2Ac0W
z{r#71pW^;<(;sW`BCp8AzrPiVO9DcTWuhMSUG<mJ?iD#aF?nT?E_0Awqv<A5*CREt
zwznhRoXypdn>Ouu{Ns&nae<%mk1_S<mVF7bPna+}Wx=LSjnev;Gv=;%eI}-pgZ0wn
zl%wIktovr)krSGI?8J}KDGwgr&||c{8Qto3ye&BBebC}^=lJgC*M2UNa{an(@dY{}
zA)EMu&aYdezvX7Pa!}0NJ8b*a_cdoS=X)o+WYr4xE1dq{t5I+!AZ7mHuPnM*b!zP`
z!SCPZB&`ZdG!Q)Tc2Z64&OD{~FB<nneiYe;?(tZ5;!X9#FRL`?{tEOwbFcSR)8luU
zy83V3R12jiX?<Hf>k@}$)2R>I)9wd8^6>2b$nxdbJ?E>}=PddAW3_zwI@fD!o=YG5
zHvQ)J-F8>D20rIr5!!ZTih}eG6Ej~oHLh5%=-p8r`<_=+W*sVf#4pO(|EsJdB12O|
z^6SK9-V-b>*5<eewz*$%zstT%==!k@m6ua`ot(GM?h5y3t2+N%jh%DtyQea75y4B?
zFTBvp+kEn@ZiKs&nTy1qDKd3EvPImbKJ1~D5vnKmJbSDxq}^#b&G*3qFUh~#ww87O
ze|uto^{4lCGlMtyU7b^O<fNcb)(IEMD{1Dtxi@}!vi(Oq|D#QQytxf)-S{uBur*VY
zF$@%sP5OA9<D!r5o%)|QH|%_85$76ravQV4w?9%huFZAZS$WM%N;$iv<Uq7-?Zm4x
zvTdsU3s&$|H||cfU1NFc_P%Ep@4o-#OzUcM+gB!f<n*OaJ@1@5>&o|9SKM7^{N_YR
z$;1k_<GHDtH?9?UFVK86JF&|^=c?Ai#UJL~{>O6b6LZq*M?M<@h3~D2dRV>QP0Zx>
zy#vc9^v18ZZ>e0<HFeeT*B|S;+AE*4359>#*ByMV)a<;4Z^pm;NkSYG!WB8UE@n8T
z&gW)1@%a678_WOcsr;1pzk5L<Dmyks#92k`kZ$#nvdKKB?cT4Lc$D?+hKl%;n<Gyx
ze(4sz_QvNU=Th6Y-cHrup_z1)sp0U0Rlk>{{Vq}RteMPysd?kl0K;uRzx{arxnK6?
zt!r<Ee|(5G`tEV2a{Z@cCb=fdP6#pa?+AL`-)=J3Zb{$5iKl#fOI?>A)L4~nQT(7K
z_)Yf&51z~CpWInDLwMWCTWdM`1=}Wd-WRLgaB;^LwK=SgH{z$<d$p6roWDu@^t<-o
zewQ{MF%K?twwiP&X<yX+BQK7c^}k;lT$44?R*>h~45k+sHPYENocqj^D`I)p7dn4b
zkSwY)h~v<n`Ibk;UZZkpTc+~&hOW-n3KGjq`I;U+UYfG}n%LSvbN=6qU)CvcUwQFG
z)Yfl{ZLx*J4X-7};ua?R)_csby|CtE@wEb#IhVQenP<#NU^{Uu<I1Gu<v**gt^IDU
zv(tU`tesi?QRkl>UJ!k2*-@{;b6<E~pFL_bHBPEpq;>t%8;d!8HWc&TUOI2d*~B9|
ze$_^#AMG$w;(Xk_y6jAWo^@JzSje%>8MC?*Zcd7f_;VsofOC%juOqy!3#Vl3=e;QN
zIeg>KzHKvZn*6umUmIn(VeYc37pX_jq-|N2bETbq&Vxzs6||X4bEZZd{W1BlXfxyT
z<+ElrYjk)#7B@KJVx@h&Vzx-|E2q<2zFad4b@N>C_11#D(>UD|tL4w#i}$F0Tw&5t
z)e^aiyQ$zdo5h3g6Zh%pF19?xanEQ~x3Z7%<UOTZBU~2l4S)1^QC0cJ8!3L4kIa1y
ze-?Vaeo|lXv+|?&djqFylggGpth%zm?VaqsE9v)3WEUwvyv6I$!4U4;xk~$jvV+iz
zoI0tQkAhY?f3&#y-gH{n_buk{|DAG*DD&Sjk;{Bu(qgf+6L$o<)u*{CFQ2yUad%qa
z<Lk2oGgo-1?_GI*^_2jR@7Wi1FWx!y@|fJ8!}-^(9?A=CpY+PStv2%0v#|e<vqTon
zob>m@vsZ84K5dU*qwSZNrplP4YnHo0C(`-dZHerkBByseb;`K6=T|~W=FgWG!Zttu
ztP)~%?!%u+I_Fu%KC0~G(=~F<kay@ib9(yLQ~%?i{$Ky;|9s{D|2;J}?z8;2{LufB
z9XbD&f2*s`-@WYL?SozaGdb<G|1D2{R=?_U`NB!7leT_x^_V})Y*$j%D%CivtW#e~
zKDhY!yZaybvL*UfQ2)G>mu}D9B&dJ+(rwF(146r9yz|T7^Jl+&D|e+^Rb!>u8;yib
za}t&)&*wR9dNplU_3qvG&)vCgSz|KuwersSw^HA!tJP=i3%_D$*L&4XRb3~`U+;E<
z`tOe7!>tRVE8flB<n6LqFhfIE>TsH654Xg#AKFF<3hCPm3d3JHJiQXl6%@pyr0{;@
zg;OPq=X7aQY;eE5?4``%lgCBApXqAw*!xjArBK1*dZ~$nbMwDx^9<e``*L`X`Yx$C
z?hhos@XV}Kc^K;aDp)T=acM}0KkKe{CR6SouBc629{Da@TY1)!6o*WqsP#RMwF*t-
z8a!I}&rSTx_hsYdSry%m|N5^ykjg7v?9?1{W6zsS7pC?X%E(MExBDrz&qyz0)(V%%
zc{ckeT#<Zm{CV4g{e_h)jg|Eh%}*cL=Y7}k#J&?UK?^3IF_`mX+7ZSXj~%pqV%x7b
zzfilL{n7j5^95^O)J)WV`|0rV&F|yn<7;d_Kbn#-^{(m1lLs=stX~oO<@kfx%YO_f
z6?LswIVUNUv8vRue%Tkh#>c@^DxO{So%Ye$Bww^{f6{wj?HGf88J~Cim_uDGA1R(n
z+*33;_weg&X?Axu?vgW?*RGP;$HOmi=T^pnIUgIUFQ43yIcM#h`PI)fRKxdloalJk
z++kkg$tBZ&-0>36gK)3;&ntGN&3-b)(`TaoA7R$++rbqwcQtNEWnRxbW~O+vN`zne
z;F7RwodOv;8>BDqI-fehTqHVdZdk$RsDpDK3Vl~w{wSE|xyOesPv!nd2KGK)U!Gnx
zXQ_Vboer0!tuyvCeUKC^VcWd?y1xCtFYgYgYVWbBWj}slbC`tq-d?d>si2^Df2=&z
znJ4s4*O#3C_2t`_H?wEwcfYb<cCx)YK6#btbaf;CtsDYtbi|BL&kzn1FJtn0t9T$S
zYn`IUhM&$!jhPLqhn$|6db=?{p7HQ`>#_i$FV9qzn&f%Pj%?Ucz@eFS>8R~Aw_`DL
zf1iC~XSVoyKt+N7=0%rhFa7*MZf@H(9^MrTMZ#LFBy`vP{Lqx{Hie<y<@2&r`d;rJ
zPFg0la1OtvtMY@W^aqW`@0hrk=qR0B5$C_droUKw>Xr?WpRXqw+z=`&yPST+!en`C
z6NjSR>9Ecj*@Cj1Qxdd437OQ)TWjKR@<X!I2BSWXvQOLXlKqr&7=NrR>NpY2%`xe<
z<s<tm+@9yv>mRW#kLFyZwVG$yk(dXW&tH~4oA%l0<gJHKUzf|@`;j8QBSz!HyMpf0
zWFu|K<P)b%xqig$Y<EA&wpBv1_nA-2=Tkk&X<HX7US?W6<&1nrWK!5X&#E|k->H#V
ztZEEePD}hJW}Vn&|04QQ#_ki{ua3+x+LZR?kHhReOcN#i++3Jn@nq>s^Ks5omI{;0
zx$jw>G?DY&9xIOIaDy*u&E2xcZC4#yQp1(~e`A{FsVK&iFJdPh=jZ8-%wURa$UJmB
zk9FNMrrs+d#V0%4Ld5@A)?P2(8hV!RMEvP160B)<M<WG$w<dV0gdQ)f()ng`s%Re1
zWXF^RoKJTpY}jA>_UK}zfJGN36)pOsn$0SG`Ib&U!`sb<LUs?tCVt9K<q{NE)e`qU
z*N{<qiqGB3eGdccEcu`b+MnC{JNE3GGh>U`^(AcDlWp?a<hCp>V=bSt^O*g<w>8Q9
zL9*QH*2kiL>Zdr^d~o>us_f~PqsGtQXnHN)($493DmC;>OzD%G{j7KHaD*l5@XAE*
z$)3d-VEE`|=vrTebeTJ!QknggFBt7}ZJ2-bYs0z9!`HOapPibyvncJK-JF^JLMQ6p
zSv-HW{NHk+|MpQ;f9lsa@1OqozxD3bKmH5Vg?;@0yzjsNeT!$DKm4;(MIWx`-XWi7
z-uvOYXl<0jq4zcgA36Td%dfS_)w`~7Z+6l;oy!{cY;zj2V;2SP+5W%XwCg+H>!U(j
zg4AtNr{~)5@o6g*j;_dmfBWX4-R|5A{N$xitv~YV?&RHXpT55S-v8gHi+}s%t(~_|
zclyH@ai49k@JB;_cj1&}BA+5lUB4_jd8fc+P5_tK(ewWO`u+BGo9be91N+~dQkong
z@pSs7p9fR#aFkiizPqI1Zk_J(_Tm)>Y|gW-+Q@Z;<@GN2W}U5q<~mH1**!E<^bFql
zJk}QLD(Cq%<4@*#W6o=_=a0?N%Uor^u}AUnA!Tz;s~rcwNT&#i{=e@Twm^8XbTKDG
zjdY%G%r@6)t<4=37bfIQ;%*Q*v;O3I-!zu3Zl&5Rh6SH4OZt3peta^vg)jBRWZTN`
z&;B00DSbn-G(lTg<EUW8EjuUcZL@aqRcp(*w|YAYx$I?P6uBi4Sn}maazy2!ySdA5
zE|8oa{9KX$+|*9?eQxva=k+W!SlgGxaH4O@-J_2qS|?s!Wcj7FclPs1<&~5CPguF^
z-}c!@>eQW=OL)>Q7`KP@U6xAl6zN+eSmbi&@Giz|{k{W5-0qX#DV)sb6=3QPS|~5m
zJ#ppgKR>?wczpcBpY<7>TC>e!{%T2yoD_J@{jXwn?L!-WgY5E?lcicERAo22YB}`(
zpSi>^ZsYNe-U78G<qC$4g6Fz#SWG<nzWr25sc_2*omqTG4dbd0vBsOE2LE_zD!fmm
ze?y9Z8Q(;W!=^vEegC-elopi)SBOeZouKEuVwtdZLdjztMPtq>T7roy)<5)|E8i*K
zC}R3?$)z2!U-LYlU6|Qr?pM6bZc*NW<r6QS{W^J3;vwNv!M#N<`W62<TIy-%&T5{c
z$(Rx~WzuY~-(R>A*Ku}w#I$z5oNDqc|K<tpQwPP_E?v>}+wE&|eEO|TRd=*xuNCcF
zeI@u=YoTcAX|8pOKg31#m?Gsg^V`%7f_>9wv|gN>wC6MDvK>6Rg*$Goc*QK7*r(PS
zc*iYP$b|RjlVeTuByRO2#O7{_y#2A&)1)ND=;)cLt517|H_i14+VIY%gG(rJ(d^tG
zA2;Pq-f%l$hu$UwDW9U->v@-M4cgdzPo>rFmR33Ig9n@M|7~q!kZQfZ#!h6GAKT%~
zJ-x4veQaCZD(QJ%fVFSYuei3{a+MXuGf$ST<%>SOv-tMj;OUZgVz#e;yiT>v(Yr@4
zD|xb<eW~0Nzsf!8$Ks{5v=+7(ANk>}?Az)*v3A;xv$^$2b@OL)-MgE2Y}%=#ds6P+
zYYO81oWZS_Inz}4nTvjco78MQ&0Twz9Ox-^-6QoX^H5ra%MOkuy@%rc*))Q9PM#1p
z=sz;;z}sYl55|tt=U6u_{@_w0UUz)^**P7aT5ZbimkYc+{HNKq-#plF`emEKoVF7E
zwzqpLIa{i?@7<sIddkLaPkZOB@tSz0WODZkMZNOFx1Q&)B!BnWoOXJ<o2J!^N7*Ke
zGo&>x=N>D_pKSQd_Q=%oJ;Cia<#)z>?D!*O^h)Me&!@OaIe#wLysMWw%~0i>>K0t4
zA?deY-bs{wair|AwVy2P3_89nn=|2lf2mBZXzn@h5Y~&S6DGDkeObe*QMvizd|T;%
zuP^QiNZ(WW@^<CJlZ9;i(xSYa_|0eEoM}E|&!^dI|D<W}zd7k|+UgY__aF7Q{HGoC
zW6Ajng@3!NFW414+RrZZ|8Cq-(7LLw|90hnwl8^o*gwK_$BuXdzCQukt1Aj}E4JM=
zk&Brwwa>$5$6uC@5B^SK49vFCJ-F`f{G=+K%j@o1XE8{`E{fe<|Dk<r_V@l*M}@Xr
z_WO}M=h)+nfW=Sc%nHAM-#@o=_x`;an?7&+_|UI*RXO{!j|+PjPI?+E&a|(WU3neL
zydqYgl68f@%%AEdnVIFyxUbk+c%Y8^%d%E^Q&tBjzV9cRdiLhtl=kn}KYuE4ajDLe
zjGB`>&zAh+U4JjeSZ_D)IVVGvryRBX*XtVRpEb`n^Y_2rRNB>+P}5<wVa|KK{QUj$
zeEZLTUR$?+|JJQr#XfDFXwaFT;AVL|gn9Pn3;oq61(x)$H0NDxB{<>vwZKJ|7HW4o
zbe}Qqo^jZJy85eCatr2Huf6|2&*IO!e|5db0yj@Fx$U*N=E6hIm~zJ5+1qYE{O|IT
z<#4RU3SXyYDVDlT7asH%K6EYo^m|W7`xRfGNE1cn;E$5UOMhM5A<r}Eoy6|EBRtjB
z!s2FKioR8w5BYh2*(0VJzt*O)y)#M9^-^l3`{^?ql=h!H<{>6|%4>Swi5iLfVx3yY
zc9y9g^Z&lS`EBJDA;G@xd(+|%S-cnb-Mh=iFMLbR55KP#ReE2mKQ82V484Eq{SDLe
zTjkFAscO1&r2EX2O#5oL?z--bt-NXq%eb#DJ(2YHZhyX>X5oA9DLfXH=0-1no-vfX
z>3EFo*vHZYCKWT0oOK)5x$cutHhA^WC+D)$_C8f6rOtUCje-|rD$XsK#x8ltdPc78
zVY}=}cU89EXaAEo(f7^Vxc*x+{q}S(+ibv>a@^S`JACHi!{VQuwgyi6HFM3C1!i29
zk6uoWG%lGs=d54+My;*PJwYM?Ua5ucj32*U{AR|>BDa2n|K5Ww*@>2!y+-QqHm^`>
z4m_~ne9P^bp*MDg<`(?>6wJ7MdsAW3eo^<O$!V{b$7CfxmMAMqdDA|T!Bu#{=9&WW
zyRVN-bxWJHx=hpdaCw;cT(^gkIg<1L$=+WS+;{)B>nokusPmUu7ENRcaZU|mdeCc@
zdf>&>|DPXDT@!u3t?^O8{-x(#^0{VD2n%YR%GW)G_0SZJW$g_LoR2g(ek$nLMrzx8
zEk3)a|Jl~3@%fvrZ~O`3**5iCbjlxz;=i^(0=CD_D47(#{79#8!7tzWTg3u)xU4GL
z>h<0+dD$(WmgOoH!J!RZiX2XcIa(YcMl5|tKIKmG+aM8aKYPKYN8y(RWbZ2HfArwg
zYX3MVN^%eL6PL~L*A%;!7?@2wCCcu=EKz=Trnu<?y;?2Ke(iO2_Ko?>`AhyzmE1R1
z<E6Efj!@Ckmgg?tszs)GR*46O1U&lx#p>FHnReA5)MRgVeD1s3;jNsrJvE)V?0f3&
zX!DuvMJ5}J_;(4L&z*2!_Jj>qidO9ZZd8TwcO~EBiV#yheSLGTZeSbp+z^YV+Zzu&
znezIS$*x0!J(E25wVCQ3>Yww)W=B4&>rEBym1>*UpM4SLFkLk+ooDSN_wcQ8fnm~0
zH3yv!iC^QIe=hMt2-nfN6V})2B4W5aw_9*MarHd9M?m(o$jxoq?w3wY+)|`syIJ|A
zC)2WG|7g{J*W=3m<Zs_wz9F{vf9bdIkNZ{sta(&_UiSa&rKg^C{_)LE7yUe2?A+?J
z%&{tSu2(h{+;ikycCAuP`^|%LhG6R(c?>tB7m1dAINrKaR_0pw(}!U{1Z(XsD*O~*
zw#wIZW|~A2`+b2eWf$fN$9=!yaL=z+Az!`bK-gTdgR@UuRXg%%@m0+LrrY@~e`Zw7
zdphZRfm^PWdzDpC!bTPjzjup|eYD_T{<h+dva^D8plJ}--ig5li|4E<wmw|yy=2m)
zwTpedmYrKWZ|l#E#Y<x51~mD;u@Kq7_4`1fwY&L=iii&J*kHz^!A&=37wX*Ws-CfU
zQMq>C%pz-x`a|<O<ofIMADNh1XZ-yB@K(2JS$lx@les4z|DT(2Q@mQ!O5>uelIp=5
znMwPf8Ewe^zdkFw;IKlOnwFucop!$ZjQTb6<d#1?{o%=v$2X5}-u^+_@b;`5OxyM1
zWKPPSzBqSsl5NhHYrhUM{|aj<5D@=jr6y83IqB58wA(-U?dwnXs~@|&>Hq7qAD^D|
z@AJO(mj7$GO{{F??m55DzFV<*e!st-ulk+SKcA{pYyRVEe)dFt+02<<<#`%UFGL34
zIl(sdQeErO{l5Gy?S=m@?3E4E3A}LVY_r8)&Ah##m!$jBSS{XYJ-o9~Vs7x6b?oL^
zEb-I0Pi8D+DR?za#l(((&+9Fd9xl3{sqoCBdUsDIE9d2f#}{Q<xSpJC-;u9jdQ-3S
z@!9>`x0&}x9en%ug;=#qSlz95{b~g*J5#wWcV<ZWS3AC`_|VSB^=FpQ@y{}ubx&{j
z{rz23`tp{!+`$XQyz1xbwkSWiq%C&A>GAi;%P+n@`2JUw#+u^2(Uz|q-aj+?Hhq(W
z?4$^bJGHxZa9sa6cboZ~>$kW}rr$nctEj_fBe$tw$H{38Y>%qr7MV+OItYF@VP`vi
zJ}qLx4Dq#6d{!SW8Q;CJ=g&Wbqa3b_DqAlIZ{X#gti+sM)8nXf!{2=KYu~%q9~oY~
zbne*GGsf54cQ)$uY`Sy1bmpnK^CH6zJ<D}uwD9|2_}XBZ;d1NZhuhmiJ9awcMciw-
zbNlVv4|=nCeyN?2o3-fKHhB}<3)MVx#KYp><}^>*ba(Q)&F63WZv18~x2}0c;)07}
zZr2;r16$Z-^L88e-LzdJHrMG|5AT7iiI*omvNm3ROyN-Nm5}D^j0?8e*d?CT_MhM%
zs_kAN(8C~6Vpx7CGBfl2w!lXQe#b>sqc1ugzAYA)@pQwb>UEbEHb-1iTFP@;YS#U*
z1w2Rg^v*a`=yKNkcT%L}<_(8EQup3VSz@wDNBf^#>MJ+z`YGq9g&N=ecKPSc_Q(7i
zG^4B7)Y(p+viI6)Av>efLZ5wJ#g+U9^ZA$EPBwPD6^K38YVpv{-stg}0MD<NTMowm
z`LXQehSW#bX9~XvJGx=#_1A%NE{YNVN>Vg#UzVOF;#Z?3wl@4x%RW_!-pwM{rl$SL
z5WdosdbL3?zFJag&*Fr2xtF|a`kxs*GdelTLPP0kxf5rk&*nqywIX?sCT+j;i0y5S
zUfUn<#cO*vbcf$@U6j=DTW&_^u83Zlm*tl=ZRhaansA6^Mf~ISh4<q<Ud!LxyPM~~
zvCrix0^xb<tYps>1+GlG!|fFqa@pcE*K>}eOJ2r&y;<+Ir<8fxi(9uJ&p&U!?%-pq
z1liB=b4~g0w@td6Qqg|#`HV1LUcG;h`1NX<=01KnxpD5U2059#izO#W7@Pc)UjAX4
z#kQw`tg_9~5m_AC%Xr>?l{h2pu8`ecb;@G<!<*SJ^y3dF=3UOer?H&(t-n<2o*Cx6
zKaRG}t@xD1R`W41FMs;v={IW(1N7D%a16Ds*(DgeT+WhX?SVVN7W0lBNPIKfJ;5@&
zmL=b+XWEHGmFo^A`XB6{|CoQBNApMJ+N1Y+C%to)dL_N2Jc~7H#oYyKOKeZfFljjS
zC&jw3?Mrybh7RvT$}b-5V-eb&@3K%gnuC`=)$nlszp52_jdsOp=5uC!3sLdR7kFwJ
zp6@>OWn|E^H>=Y`W6x~)Fs0<(Ex%(+SzaseI(clz>h-tPH5`1-_^kcJTD^W3Kd0x#
z3pS5cpH4Zvm6eNU#d*^`Ue?w52FXz`p0`-Z{+p_D?(ffT7PALV5!1sBR?YWY_pj)i
zx5S}o;&nFedTYaey!!L$@6YpVCzLGt!<>F<^L+jD_vRhCF8<!{Ur|}s3(-IG<?Z+U
z{v!9Ts{Yfv%ePO5{aE~md;7Kf4QmfA*pu5jef|0KdVUY@dGl;PD6AhpchBwv^&6Sk
z{{6mu^W$&L^H*)Bzuge4!loQ%aCoOmnuUx~JICo|wJY~&&J&uI-2GVGVPemnle53e
z+kHAwx-Ig;qxFj`dRVi#yf;3n<jp**xOi{GgQ@Z_ZuBx9|Nr;T*^m7OlJ)KG4+{?D
zYcLsb)&GBO$m3NjT)*FD|AOoizW?hsfB)XEe%xYb{r}%L+si8s9{qTG{|cD{;eU(@
zR&gE<FM6rH?~Bm?BNva`2k&I%cP%=tcdu#fLDe4{<BF>Oxvk^)UeNO(|L?2AA8*S)
z-Cg_V)uXdNqiYTwo&9+J$NRxQe^2@ErY8KurOxtSWYo_u-~I$eSst)^aKAwKU-It{
zANR%-ov8isBX0limtQXb)U2;$x!+jvm|^mq|6kuQ|E(_kc71cV*rxj*!as1=vi`pm
zuEl#|r<3m1?b~&^y-zP>KXm$EnUaz-`}q$pOa8Q2@%*n_(Aip_`0T~~^6AHaya%o5
zkFviHUitrE&A)%^|L>7Hv|s%Fy?yoNg>Cy~<1giZ{T}=1aAC{C`zFWh7Yb|sKV4t{
zL;I}dAMN`6|0`!*csPCj%SD&JyfXgB{r|!J_y1?b@qWBN#ftrYd`!{e_sjNPuwR<|
ze@frqV5@KbFK<9Ns++Ca;xGAfepw^>Y5$MyC2!_m+F0*({Ga9G<kz0B=dVrF{+cl*
zN^xan$)gRE%bZ#Ny!m=OzGB<$1queUet)}rzTof8-{tD|TMwE4FW&X@-BtG=4-S8P
zd6P5d^!|hTtL6kYuH128l}Ihyrt*IuKizGQk9t^DF0gcd=+&GVx9`1Ll<__<_{5Jt
zZ<ia#8p)rxd$E0k#znz{Gu>BhXqvTl?so?}xo>Rm1e30<ySvi*`9i4}<<fm(Ws^lj
z4XeLA(NQ_&pQClZsx(LI-n*R!L8|kT`2V);cU3<lRn+k`uQNP_<(W>6fuWiHo?4q1
zlf}2DPAQ*K9Gus2P(|gz*C3m--<1U(&fpZ?QK+7E=GeR~F=?HDPClFDu)fp(c*XmL
zdy{iiN-rFiVtmY{#dS~Q%rfCKi*)_E|1Ax<cVe^Au9shR{x^yW&O5TY$>?%`%ZGED
z*k$*Z?6vu&7iHSI+~NN&?_WpP#$M#@Ju<ib$l2|O=i0{Y{1?OMbLqf@H#Zk8E9Oux
z-5;m$x@E$>oBF=TlpDUUGZvHyPyXyvxwFK%X3JO4nm6aBI2RWcXD_)E)8;$X*)>jm
z?Mv_F$2t;kYb}1~lo$EWHaX;T_m|(DOH6yzn=Ss|)AK6bBeBrL()!D<-Rl<1&u%)H
zWM;kf@WZD9n`>tGa-S~P?zj4B>IqZfi+2B`FR9xb#VYtz|9O&?{P;&&)6|u#&K?x|
z{kV<)@v&ub>M!npXuD#v-!J))5L5f3>*dk47Q(;zQ^jl79CTk}b?nWGf*W!c{q?mU
z-~A|JzI(5H;p}@Z&ZPn7A%2@COS0H_WWCpjN!Z*eVUs)WJiFWy#wBuV_Fs84*@7)Q
z{fE}Bj6H0cH#y&bw#sX*db{Q4+CK-@ewa}rYxeQTE4@?ctE?Bl?dUokSXME={#tFo
z^^Il1I=h$cIdeSZ`n|bfl_4?T=1kF%@@>}knHHH+VN)m~y?Wk(4UEyfX;}ih!>x~U
zOpW;b`1j+<#{1gu9d4T*x<6}Q@Ch+*yG1eT5gE-A%cD|fEK<Caea<a)X}fyG7x!<K
zg_BAi9Go@F(0nz^LV=Q#V%+)a&Si6x>pYL_++;WFk=iS>q7{o2LrNYB=CB@&U8le5
z!rS?-4yg?L7uii){jaGtK#SWg*Zf=io2%6qcxN2q*RV94;4w|wZ6n`y?LV!KcAgc}
zGF5xGWU27{vRamwY#HynpXKY(=Sh_kq0G}NJX@244qEKUOk!p}*M6);e)s9D_q@{$
z%VVl^1RE4TvljiiTx+*~P1ll2-*RcUSVz4YomUc1opjDUo2O`SZO7rSUpKV>Pumm7
zkt~1B*sc4<j(nzjQI%_S)YCHyt|&hBiYvUG|L&A|v-2bN?bD|8If%&cOI!aibuqqs
zSL{=R<%W5SvhLk8u*xpzuhwbv7G1oVS^vMK-{<$L)pK|SE#f~ER_;A4e_-dg%aYAP
z*UEn=m!6ln{3A%`>*>wr@AW4bJErqKln<QmoD_L7`uOKRe?@q%r7aa$`cnFP^hQ;4
z&WRINb7khs1;y{)v8wIj^%M)qNq6fdraan|(X{)}3(F%bm*rS(@KcjD-SjcXnd2UZ
z;NFA3A3clO(Kpk_GI6cutkkFiMcIE&i+hb{iAYX!dvh@+Gst4D-@_b3Gk1wsJ#QP>
z9VY)fDfg;r&a1_9mN^<~^{(J+DZUYN;MD#NH?JMmSZJ~0&>WXU1zvV3&0}JdkE#S}
z7Vnr)wC0}X47WJp$l2bkoGbK&6XhPewXM38qW0_1<-O_u_4KMLd~aS&*tJjDS|z6X
z<(1A-j}@j90)FtDJ>H_{Dz(Pgeof)m{0o%_W)}ztY+z~@dV22p$&c;9>N1(zn^&}J
zapn3i?Mm1do$GO|?X2#q)&-k`o0?tJZVNniTxh#1BY4}6mOaY_0&*TS6wT#)B|Ga=
z7H{#%&YjCcr}C8FTd143f#-{FcJLMds(@Kai^?@FWI0Okp4ppx-k{ND#*zCwH{1F5
z-(R}%0rQ17;<4hT#s=jtjvNVHv-r@Yf5KjB-sUT%!^~ew&ExW1@j&nHPtLWUIIlZO
z=XUHXUD6eymy(r{;NkSQ|4eL2sa9Zq&Q-a$p5hxSt~7SBtW9Lj<4N@_nr4&Rwmmg{
zrd9O&J4(twWUcv^I_me!MBcVE-r(}?f~RkBxro)K=uNMj%<^T$ce>|9me;iL<!<?M
z_PSW`F};0{KWbk+R;JZn{`T0BCa1Sqk)>KU=R{xPw!iZF&W4BIj#Tg$m~Rbgm(B`%
zWLszwc>4C^Ex-Q>pMJmJ@NeO=rFXwQdv}Ii`kPXX^Be<Nv)jjb7Jsbbn0|}*hR`eL
z@JrIl^HL3#Yfoy@eI&cEB&&2q{D(g#Z)I;BO5J?s`my`$OE)a240(F|jw?fD@n5z7
zH(r}P|65r5a<=UEiSkLaBFalLoR|B@pSuwM<K0)iDyg?;rq_St`SEDSZ9a47X*@YO
z+8?TJmd#GS8}wFHS0FB7Yt-@A54Qbomk~X|R%Vv`a(i`_hfd9!Z|PB`)oZnq8K2I1
zZ=QTX%Yb!blE?uU_Ly6zy|-q6y0p5gxm+{wgGaJh2+yJZ)BhGQCv`16@%s1Mszt@$
zzJ>IK*dI7;9P(OwS-A>pgk#Ks<7US%MqAChWz64n)9}XMkJYvYuO>E~U$&v=pppbP
zqw}Tp=c`Yg_I~r{t?CT!hm3PBpE<q!*!h=DPKk^UrhZFLFVB|$_j8>|k!t<=`$r^A
zJ{E1hd-K*^>)Utkao#=dw{voZ@xHzT6`tKJW+@Uj<!AZ#JqSFOy?l0R!iObG-LIeD
ze5!kU*ejos%%{qG9He6x*&j9dr&weAV*N)Ak!69AivK=;^b_dXT9%%koqu+xjO3r?
zcP1Y`eNf?`?*Etei{8n-KK@K}<FV}rm6vY)uQAv4Z!^C(-@Tq#E{C0!lkIY@ObRJ_
zwCu%?g|;k=_1|CBpYzl6UHoNhjoID$E%8P2LPpmaKGqxY&1Jm7@q<sIzQI|gdW~U<
z$LCBle_!53-OO3+<-T?DQEP4`+J(ettD0L?ERV|cJN;mSZfE>t_or3{Qe9aWZrmzg
z82x)4kMFy?ap&DmPH1k`tM+-i=-a_F3vG_RJ1ga(m)&S4wb1s%+4#BpZP|P)J?ktg
zQqQn#Z=U!0>N<C^^@hcc?+@||KT?Xh!W5Gp=4zGon6XV%npg4O!sTo-&n~(2=Dq(c
z_xShKIft^UY)s#+_&&S0s=hBU{c^3}u4$o*K4=A2Ox5_4(|PE>d+4?mANH3_i~FCr
zdvkE`|Am`3KdO&BbiV8V)5xFka+iABv=rtv^DL`eterN)%1k^UocFZjl}U#q{>_-T
zef2q&2{$X5m}VZn#1@m?uX|9>X3Ol-N|tFE5`K#P)q00NeCR*@xV$1nfBFW`imtAj
zNRNrvk0{yPnXi<x=-sT__3gL2FZ0;-89!TbMxuF&VSDrw#;jf1A(AP(QUuhWB~9)*
zyxaBqvYZtRi;ZLhKTNfG+c-_<K+Ii}e@$C!TKn!kdFY>OYPgp54ZFkp$)8SEhwc+h
zoiTGt>hdZ_i>7(X9KK5D%T%^ls9Gx~%vO7^vFCk*()PbS8<-y5TvW)Bb?o6gG5=?q
zOuwu9%vDy^c*1zmfrsZy;OB-}w+mU8tSYc`IHJk6d~$Y@-$6fKHW91IPn?grviqMt
z&a9L^hwY8GW4`^KFvvNV_t**{8>Qdb%Ex|p{SZH2FT?*=@!44xx8@a}Y&&i{=h~%T
zGcHxUJg_xe>U~A;;`M3s(yZ$?S1-FMyFapw(Q8}8%9oMJn;vi9pMSeOaAMf`U^m$Z
zYs_A4dGBm#Qy}%WMSg;n)Y}vLC*GD%eZqVqwCRQ5*|OO;ch%?E*_1?mXK$4cuvZJd
z_03kc-QDl@Zi)1>g7b{SyZ?z*Zh5<9$Me-LQZshm`j)$R@wUs~>|}%`ZkUC4|65mf
zr7+6oL-p@YKb7F9|9QJkly3W*T9GpSVP3^4&6+2ze>tMuH~yF()Ec|rf8R0Y8!aI#
z&s5Alw{5>#|C?ENR_p!vJ}I^0j6~Ge_w#CXCw$;k`Tu8kx$m(Jo8Ri+RNkHPeYJn;
zc7uJ7wA-F+ewMwf&ieMhU$&cGm&;#!&-u9XdCdN~x%GeLWG#Bj4t2lD`^;o^q4CSs
zoo26detUm^aUpX@-b=6lo-$Hf-|OFBti1g1-B(ew@7bJM&#}?8X<43E+VfxEizfe-
z{~i4C|685A|F>_y`|iq*|6yO_r+?i1>A&sf|LZr}+P42*pEz6lef(POyzL7=pYPo5
zr`*48Z^|)d@o#@iZ~gw7zDo7?KdZNM**3n+fBoxqj(KOl{`s%hGvEIWjIE#h?cg5w
zzij*V`&ECRIPqC~P1D@B$B%B3e<_x8eHZKVPkSP!KWKh(_Pv|OpJ_%<1pOzn1$TV$
z^o;j9kQB!^agUFNsi|CAP`UBRtM*4b4rENYyC8Vu35%23&EM8@ERryiDdhd{Fz1fc
zp;gR^{H(zaE9x(*e0bIT$WQB}<cxR1y}LafueyuAsF}w$>F80;=X~<pf|JWyP99^^
zYdLYWC7>zx#~b6OjX#!Z@CqAVmfI(^vef92KrsLO+pZf-u041cXc+f6D|qK&!;_q=
z1NZlTv6#cgdi|L}Z+6Rrt1i{=c<cJ+DvB@ra)!_RUZv{$jmJ2g&WauL*?UE$k!9cd
z5LHp1*%KtKHV3dDJ{$L(-Ega6su26@BZ1uY{Fd=QnR5c`e;3qMZo7ENgyB!x1IG<p
z{BkOU*37(@)nCUkHGPBG#hX`@7k}hfGX0U-R86lP^Az{aTKh|Vp5enR<4%<q<>#11
zoJ~XLhF5<7_DI}uMr-y5Dc2*y$rE2qE1PR{^Yh8Gyr1p|*|DgecXdv^zJf>P`vs;O
zy?<E$ay~S))Q(VN*{%IuGVtj4YmLo$`wqFRc%5OS5!HBZ<&qt<U-n$iDJp(l)>d2*
zv(v5NjYZkDc~-q^4y<?IdB)>=+=H1O+n!9xZ~J;-nKYBwm9NtipMNNrtym?kds1ov
z1C!Aix5v_6qQ6(K<jy@d`^7rJ*qKG#szwD$Dh_J<GnJ3*`Se5jQ)gLdpzEK1Cw~7b
zZP}-}MCtnN0$;D?%T_i`b2@6d@yWg2$IIp!ZqZPW%8~wM^YUn;f6T+L63=bK&wjI9
zm$CMu#cs)Drei9+>lV)`dLyHw^yW}+&@a#Lhqjt5oDtV;o>jG$Rg=qWqF0M|*V<PZ
zYwJ2K{~gi!_lQ;7YVwN~=YrNZ57u0c`qd~YU#xn6|Gz^Q6Qy7Od3fT^v}5HzZo6G>
z`N%bY|0nZXS)KmdrW%?rxp~H5=83!IO-H}Yy>K5w-7ar({XX}?-SVcN-(~IH#C7((
zfALJ{%&nM1&t`iEY~R`9Yd+n<e7a>>*M?2OEZuKJ5-XQ;JiDjqRKA?!*$vHz-R-5f
z=FV6;_58|3rw+TVvZ)A|+HM?LdBJ6BJOAoW4-!M=?3SErb`7n(6fm{>UE$P9Bk!62
z^`@5Y)H?F|pvv=2DqF$=nRW~FEPbw)?X)CTh$DC3<n`+wS_m}fEO<A8C2E$~6=jL_
z;(<cj_*zT@)I^^zW1ZBLcuUR7*F7hq&GCiWoDc7poq6@<*<`);KNn|o?UH<UcGjJ+
z)n_wV+xF;}blyyzuy9vHn!`J9m95tetbARV*YDnIl+;)sb~LF>>ChZY4(<BOr|xh0
zWd1kqkFWovi5sH&>yLbm==}dq&-&l(mv62ft1l1#cpo%ZvH!fx|6GR3Im(}YCuFal
zk)O*^wm$PrdD$WN&okcN6FyR7&HlCFdg|>5b2Xn`H2VIhZ1SDys_%Zzwa<|&SY8~V
zKW%g24c|8(&fVL-?eJ~xWvgtA9^78Z`@_uT@Oi;ke+~6`X0m?yD0O9}rfgEJNZykm
z+e1##i%UIzSpPYl=&MlPyQQp2gv*CZW2NBU2#*CbFN#TTS^Hq^jY%I`FDlE_n`~Dz
z>AiA>^JD6hY402Vg{AFq)cJa5OYBp}!qfj*U-4gFUf^@4)UY*Q)_s%afipRlhmNmV
z^Yh79;qcv)j~|R%l=4R8=Esa#yv8dMAMJhXzd?3-irMRDl7^-a13J4c&UP#|meUTG
zshWG#dhW6EBZW!PEj!J4{ifWi<+a<Zb&ZGJY-4)i8NR=%KT}Ljc`)_NnXo$~CdK?o
zzs%(2;<I1mY^|?3x~A>Fmgv`=y;2(wTGgtm-H3kbKJ(e}MgQ9Mdo;Fw5w4m2N?m~?
zxZ`_vm1FUNyB)tSG?uTo+qc_dx6S3mJ2UQ@rrDKM9h0|^-7N3({`wxr^`*;Z-<t43
zd{^E3nV*&vc%+{?5_qa$N?Q5C$h<R(kp`)nVVAWo>_4TuNaCK`n`9QtFWu5XriZk)
zn(p$6wJ$T;qxdWF`{qT~1|Nmj?C3pE{AwL<#n09W$IoW8Ev=jps@H6@P2_O@g5#RM
zH>o~uZJ%eXlr&jz;sJ**lRMZhK6DDYD<-r2-ScO5(PGy7eb;G9O}Q&rtJW%YEYi%y
zHKj}Z!kX7--IDu~*UFxL8t_VPiSLqSvU)dC;v1_bsVi{z98nB3?rAL9uN=R~LI3pJ
zOX9Cm5A~NXO0kyT@WWzTnbOS;_ch6f9S@b(9%Q&3GQ-JS)9qxq^VN69f*m%^;&64k
z>{{fpQRGMJtbhl$e;oeV_U=oHREj(Jf&H3roy*D${{oBCteN-jG8z59))Z3L+REZ-
zIcx3ArdcNsgnJn7?AP1uK6_K&-;)Iu@5Q}@%`~2+Za?zDqr)q<y-)S%HJeR7*Tq8Q
z+;7@H)LRr%(!(s{Eo`3Nc6a3ljkFny40o7^wX9*&sc}r%tl}|;BWzVuz?~><XBB&<
z(%V}0ljdb|`@N_!Xy5OCKU1gGrYu`pLMX0gL&!^kgT`+T>mAl(pChZ58C`kgX-CTJ
z(^s}Vvtrg@dbn*ym7LV7<*v#-4&FL3?~X{h#RYQI*&F4b<PkdRw0-*VYw@$5SQH)K
z+Wq*I&vczxw_IOFtm!G=VJ3U+RA7+TUvCq?7s4-Xxz|nD6@5^?aH%@ee2*ow%m1xc
zUNx1k-^)9J-{^KCzkJ|w-Sx|EUpZZHJABgx>+q9R_YZzJv#=qMCz9ED_GJ@;l~I~{
z2kV!72tW5~N65k^wGY?puZS-!cs1jI>MwP@kl)MKT(O!PclrOim-c(UpZVwi-spQ|
z^&9b97xvGv-EhS@Yr1;YI^B%*TUb5+t)90#svt|ct4HdA%gnp6Q}Q3I4%)FH#Uf|r
zD>FA&?#?;9;l}dZ?^&lG-Wr*AVr573(jAU&Q!LJJtw_xZ-s198qdU8)f}?ZA1ed!E
zK^gxpWajiFe>Yg(|8TqF+dmhsS)JK;;&qJwu`P~ei|?hEPpqCgRm3TwS66fE++@~o
zyTYHXez9~}>9O#go300Ee%+m+W4hcn%PaqYPo~f;o~l{qX-6w28EKtdsI-iE{+p_E
z+pPOK*G!X-T(zsKU*n)B^Q-Lz<_Gj_&N*yoS#)i!WV+kwV2|Vt>a#RtTNwXon}x~W
z+orNQe}B-+s*?9R!XCV76S*6iSn{bYHGUa$<do-;`kg*|R6RG&?_yiMmnDs9{YFu}
zkO?fl%-=ukO6+?2$#H$^TZ^o?r49z#NgI!pUumm$Jh|lZ@tMX4&s>t*GqZQGiMo)$
zyyAyE8<(bY9=_ac_(b<+xKmI;PgzL3q~Y}XD9bwvIv4X>RDM}ZRbIcRabe2VWXG~p
z`DOh7!~$FIURr<TinOWCibKC+I&Cg^mWGrEJ?+eI{U$u~`OYUF6K2_5vaY&x!nVq*
zQbllqBFj|Ew4m%O89#EW5=*xwziJHM>>AT}g~8|ppT^#M>rbS-_&?Y2t$)<3OAf-*
z_cV$Lwk=4w!Ly;xm$$_Kt@e@Tqzr+BJMLv%JfQHi=ebL7ke%wo<d2nWW-V=8c(+jd
zpRkS1j2yP<CU>t+O{%w^I;Z%;xxGn7X4WQtjo1DiFw}c=#WKZ`c~!}dQh~>l6ux&K
zYw~eEoODNj-&6_tuv0M>r&_&sK6#emka2EL_^lA{<kLHzwzrkq&Oh+L{ZurswWM+I
z1vB^eS(jBl`3N*eFvdPuxq(yj&#sp0CC8JQz1F16%d`r*wlGfCXxH`1KDpGr*BcZC
z4rOX-u5eX}c(UhRwi)mHYtnp0fh%_ZjtNO_dA@y#`<*XN%C54BF=^MYK5R<;&i}HY
ztM7s89j#ARCJ}EtH>vK(I%jZrvu}`3M(?k4^9|2L3;#TG^Q3q3p*Ds)H*TnRh|itp
zI9vVr^z`N3P8#74Z-@RU6W#aMwk3Z)i~Y~{nhv6W?%&(=vHo_ob@lJiKljgZ{omdL
zJtvKKC+G763}#t{t;}nhpUPf6_&ckxp;X1N`vJrE`3&qkf^Tj7KL6x|J2N-!*S|dB
zjg09D@2EwJJ3qHCt$p`K=4yAU^S&!Lw>>%cZ~HdY@@?Wis#Pjt1<S>_E!bPvHnab^
zW^-`v-M8*%KTdJ;{&T?pROjuRx))jO71i_7w@>-|CByH|xxCK!FPxTz*1J`^F1i;#
zDl79|vZ(*@k=To!b-(AI`k7z<^7;P1Z}*n@{=5F~)t~Jx^RNDVzw>-O|J%u*=ln_A
zzSZjURk?$Fv*!JLHR*^~`o3M>X*LBPjql&9+uOV4jq&|^e$5KU%<VqEHRD{O^YP5~
z@7CwO|2vkxZ*TLnW!00D@7;U1xJi&-?o*k(@SBXf3$L%peK}<^zve=AQQj}UsGJ#}
zzACmE9~VD*bJm+R{w>R^KEFGBGyYuNPmif(S{5w_xQ)0aW=59UNa^Rz+VE?d$Ejv5
zjzjA_Sk%{=J}Bm%Z)lQ!>h$7*3A}C7cDf|}{cR#;6u}{Xa<BQB&~wZjDk?QeS5D=Y
z9WQBN{Tz0v_M>Ue56?3zc-mK;<?bwg-FWbeQG?j5A9Iv?<Pw$t>I+W&UAXAt_F~t?
z$FHcdEzVD8Sv<3se@)+yI=erSmZ>kCV|<Qfc3wZ_^4B#$WcINa8$6>lW<7ZGHd8@7
zU*f<5B`vqec{4V>j`N-*xJW#MZT?$^e@j`n8rEmr+1|k6{e?4&rF=z!tP5MBd7hq>
zX`-BhZ&25Q=p``+Y%EQ;Z4{M@&Z(STJiVaAfZsD?9*g{W4&U5+P43zgylUh1`SY%H
zoa;2caO{JCr-QWVf?}si1(%%De|Q&1ojx7<iFa+^x%vn5PyPI#@batux9_*DSO0i#
z{CCZ{|L5!e<-fW#@3i2BH5aG4FZk9_cjJokhW{>djfd4gaJ-Sfa@=&<TfrOii&CPO
zxhJgmbgAi-Yy4X;Y;waKB&{csm;FfQ#{J*h&Nc3JXWJnET3%!Gp^o~5c>*tF`j~D{
zTXyio!}C|lx7;*3XLxZ*b<M3suMSVSzV?mslpBpF!?xQk<SY|A7hUvX+L~sClKfqg
z{U6jO3oiS)ds^YF`6Byx^zCb`vNLzRI$a>$|I7SW`0UANSG@oGLA9oJ`f1BAe^2iA
z&)1KB*#AX8w&I&{j_LAmyrx%gRWSXqk#2dKxF|=%<$Cf?p0nE;E-(J#9khmrkylOC
zN_OpUt0$M&8Z3-|ZGB+rmt%~F{up*|V(8|W*=!kj^OKbFsr@F!F>+5I|D63@Jbltk
zJ^dIj@9jBvdw1AaFd9pnFaG?Y%eMP;JLkc-2H}&E<}`nKQD!o4TCGi1#ffh&!u>ZF
zOCEo7G>CC^zwp9o$9vOl`<Cv$xOlHix-Z)@`@ARpEtgUQtK^;<ZPGfVDz5STe1%ox
z^_iMp#Xn!Z{h7LooA>#d_{?2-Tb}it<qQ*2`=+kdeJRDD!CfXiQ~2330}Vl;DU(}l
z->u3lVW0XY&N<j&d-41@y8{s)7@`{|P4!pQ`7qt-V(vZ>1OEG5=^s^A{-}$qj#aB$
ztn=M{!l#IdUp=JdCfv+d+@d;D)m-Cso${n8L-*jv#iDW3*DajK(ey)linLGB{sra=
zIrc1l-}lVQ)jpn@HEX-`<NDNojprSS%3uA{u5I5lCBZ{>()B$xf8QOJzW)0Z@8d^0
z=091>jDJLA=zgiyc-|BA!cei|ZS6+B>G=YMk}-R(UE{xSpMUY6=#9(zQr9Uoyk6X{
zI-jkuQM>-{j?#O-=3k3^y+!nxYkv2RJuBuN&A-4m-P}|2FHa}?oF>5=PXt5^!fGeU
zy<QV={Ii4Xy}*TBOuN%I8Q8j;e!2T}akAa^IW>2U_#Rn5pJry!d%Hxi_2dMNf)$59
zwQV?Mcv1A+!_7^e!INI`Jb!4vvEE`rwsh!S7om(zYCqR%^)rVW9ed<xW;!Re*XUqq
zpLeqQ`?n|AzjLnqZZyd&I`g2xsRM`iWO2{x@UXGf+*d4TK3i+@y>mBrSR9Qy-<UJ6
zW=iAD7JZM4x@RPpJzccP!IuA!*L_>nJGn>N4tec(t@-fX<qw@Y%>hf!WV*Uf*~u^5
z$K@6+=6zK_RQPFl_}ZJ345RZ;6$zZ0vDtJRlTfOU!E5Q4g)^>RTy~^LqNB-fTcprw
zqp6GKUrL%MFYfrYj<@P_Lm&s!UH`UwM=a7FabNeVIoP&n|JSaSr|K)FJ>tF|QnPT|
zqofq0w0G&zo!{>4SYnx(#(Qzjj$;?jmL#t*Qn#5luk=gP^p$=ryqSNCa&zQ=zP`2Q
zE^DX9nUb?xCdj;Ne|k2;_^PMzwXbP8yPnN4O6}7#-5eY?-^TOo)Rp_cxxHhmj`=uu
z>gw{RuVQyr)w{2|r|zjxKkY}p>c9FOUw-Mo{kwP9kN@|y{_Ss>ANuG2&By=GPCECj
z>z{dMk?8OByhr6td;eZv%Bv&v+rFyl#{Ywfwf7!w;yu)?dHahI@1eho*=7oQn{e>|
z+adXY-F@?=#Pqbo=gipozwKXZS+T*kT<UOg^WUdi@;SempZD0d@SnH+0WF``k2+JQ
zRhCBlDyUp_WYWVzn-_Nvm3g|ZN#<jm5$)q*=WbTK$fTdGf@OcYTimMu6WD^pV<&vu
zkhJchzhdzGj{0eS@At&UJAP(UWSH);F}6r>Mti3Ck)LY?*_%FYcDL1C&XC}t*Vmk!
zR{CFRpOMX`BOjhO9+AD?a%7EV*jm@N&ue!s5LucebMJ>^y!y%w+l5s%cLhhi>R;cW
z^`rQXhwgzpl0A+!u`PEUr*K_2coy1lH+9ckp2+VpriT9%=Sh{lPA<9M>H2fxk@Mdt
zKl96ZaZ_|>`-yJe?S7w+ZrIH-@zs<4kL;JKU*3EEYjJ@5>Ul=&QR|N<N}9d7_V2}Y
z>s@j(ww+Htc6--^FOAbz(+{pR+gY-8ZoqP<fQsIwcYb@^x-Z=)A<9&L@V#Q>k&I>2
zRxQ18BJ#?6ZvpE)eaed(OOmy-YXgi9XH3}r^iAQ+qbm;VJHjXY;Z}c)p$5z8Jd=)h
z&UPa0k2_BIy)8}8{xy~Da%O1alMd;I+HOxx(>ae?10PJhnEqGo5SNFrYBS$fg9(>&
z=W<;z+3V637BMaIi%(GIvLqQ*m%=Uv>C%rgGp@EYFkC+wJ}>(HR;3;W<^H;9NefqG
zD1>imSrdHP%_Aa7;$YyS8DHk^&^_ArC-iISzEIY~OS`kQ!j_f=p6vLg?ellC?*#21
zU*g$s`fAH8G5_D-SD;@f`{%PfuXT~v@-rnye}s7D?h5Y~N!YZG-TaIGpTGRF^Wq=>
z`+7Dh_VDwSF+ZpLF%G#rrS6i`Q&+FpEA>B>-@aY{eebou8%pnH$MQda{khw{w8~GU
zb+J#Xw$jE|x7VHsoXeCd(0X#|DW)jb-|gG(u!oB-{;+0Uc<{V8On0Bj|8%S`4BB4x
zqRfN4@4stGoJQ!ncQ^OPrr1U-aQR%3q{ps1Q90_I+Oo{03uB$$P579wi^1A$THc|6
zrGGPYrc8Xdc;-1vKhB5+537wuY#ekCE9f3RSltkM!RPyV4R$VlZo|BoX(~A~Yd&Au
zI?>>(A$#|n&&v1rRu-onl<rx5So*=l$9tT<$akfxUQl^{bV2c5iQ{)PHNHEfOH6LP
zD}Jm#Ti0vX3)T)Hjw{j25~gk07x7*9W$c23LKD}0a=GtjY0RH|KI+KLvnO=#+<JTT
zREGT5%@e1T9|(M8dq*UB2FJurMvrI9?TTy)F`JMZea9}T+CF;vCS5;Cxyf5j2*_<Z
zWGUk2me5x7Y37n$hkTZpFTI;M!JpNV@6+y|Wqguhffmg_%lLQx+!%GcgSV6^ZlU4B
zqT)M_SKlnY5_IN)>K+e$y`?*+ZR}#4`h4*wrGy3bSFc?8I>qk(3inSr`K|9QTxU&h
zV%+;-r>m}=&Gm*8v$fdHY?9}nlsHL?jr;L}ISXfP{MuH=9v-%nZ?avN#VWJhNz=XV
zEi#GN(#SD8!>G8GT|VS?LQ+?h>tVq))-_u$9zK=gSGj4$_a7#S`^{IR&stZ=r>rRT
zd~qJzxr>damV2%1Ge4JS9$cXtv2FfMm18+s7n{t)Wu+$=P79isGGY3ua9`6CuJQay
zrXA@~50k2@R~ybfA9h+cS+}-gXYXd8q{Az(v@f}@d3v`<`?s8(J98)9F@L<Gx_8YE
zHCr7?)u(!9ukJc8i<L6p@^)EyMO3}5@~VRj=59v<a(SCXn!E~m)Pl{KJXvy&c1%0E
zn6>9-u}Pq3$Vo=!*+LT1C!9H6zc<ZlS}&N`taAUZrRcX4_awC6J^u9Q?9bb>`-8=_
zR+uJT+ugFt@5YIP2YKV$>K9f2KO)Jc`9;9)cA^sl+gJ70=xgVv&E1%%^4@jD&e*Cj
zIq@ZJ59RX8!)GX*i)~qZ@9z1elM5cm{8$vkI>9_4r}6uPJ2{68_Jn+Be*Ns|<3ck%
z(Y-%v?(cZP`fKBkXGfp^Ue$4KMdiU`ohNTTzpl5oR{3iG3hR)YiuKIAy`3h{p6m(B
zztB8k?>m{it>2$MIK6J=YsX{G$Df6ATF<%dY<K-{v;D*vWm5^SoAcdF_<43bt?q63
zF#T`NrBZ9oB&mtI=cjM(I5m@bd&WKMrMj%|^7C^i=WN@)!GXW@|F37CYZF_Kgsr<^
z+ocm0rRnkgVYSAV4A!#A*?S}2aXINt+Obl3+Bf?tftys1cV#a7dwS0`oqWf|m$a|l
zn^ZYfxX_n%TGZtJKEn%AnJ$v0GOs6T=q(aEt=b+Ta#xu9w3L?f(YDNk*HucpqK<8t
zaxvl3ucI5QvQ4B9?>%6zu;_Maj(>!5k4oIjuZ}OSC`+c4FXhy5EB0$BYhJ!U!gnrH
zjEd2QA3xu0X|H^kwED#ZEvp?}e0J$2AHH|<uYRz<Z`!&4mu|YB377o8b@%2&^|}w!
zTmM&;{khH)YcBpGJIh*oNqFws{<q6K)>~Q4V4V<mj#=EjO7_?6WtX27<?cMJS^dT+
zcjw`^Y?%VyTb}aq|KG6f&c(955k)hbGDEp$NffsSpQxRGYKC==y;|nOjVspQt-5mE
zd8^W?2>mq84fEJ+ERxT>=JUVEe8kp5XZfj#Kc(}hWG9;O)h%{jUHWInG#l~uwdQf>
zg{3kITweEmpC}{Reb;Ti;Dl+sz0LPT;-^oW$GTiK`Au@Oip|TN`$SsOHm&77{IY73
zX#UniDHc7yJCvmYmTVB8op9PpxG+y-dtdlj))k4Lc0Nw^c<@dwj!o`>_DfwWi4W%@
zBlAyjX#Ja=@yEhw!mWd=AO8EW@0{+!HtUqI4L$;=7#8h0p<nsvileXo>yM}YsZBg(
zDjd0Q>H)E%i`J=U_FKwcsOjO^>-1xGx&NQ7;{9C#+24Y;a5B2w+%Z8zav}GLz-KMn
zeNNnNTN~J>>ZC5vv4N}cLqb)t@>!OM1jDpP@ATbwylPCnY?ylG3|IKK_Z`~aQjbo#
zv<d`hhKDi!XjRTVxqkk{#9yBk^0_>#Os<@HJ3)Sl&omy>;%X=FmZXV(371$@CaWKx
zb(Y<%xcU}L?z9^1EjNV^oz2=lE%ni|zelfd{Caby`JkQpeU9HY%m3Gxrp3&a3{O9H
z|Mbj{o=J@UY5%AH{cptW|0=nz<9{t^1AY1Pgs1=G51l{t|NonR|6lIPyXfK2EEaCq
z7$si2JJV-@o^Q>>84kZc8aB>-d&w;-+ePQ#KI^QY_P5fv%iZ6yMNC({RqpOyAM!gd
zeRr(>w3xVxw9<z+pWVHf+_lZr;C-J}H*>I@w7`wk{2V6wUvr$9H*hEZJA0$?=kr%#
zCUTpNc55yyP?bG?-qZEEcJ<4{YH`03W=*%7bKN`t$IBl}&ZPhPs$rg)A^m21Nd59T
zpM&o|_Ooj&_DQM#{qoVFUxB`{`U}&K@o2Ej(aN#%vrS+1Lx^X}=Ionqb#^X!UAAE+
z|GA~F<gWf(INj<j&$Ym~KqqcBbFYkIQ};zr&M4R)Yx7_5{pUW*MmahD8MgfIvWof?
z<d5=*KM>h}VbRrBAsidt&Hl)FH*M#MHwIc&+an|tOy>oD-J_nlp-s{tp?ghh>>(lU
zh&g#hGr8XCK8*S^H9zsn&!zv@Zc*RL`lCE1dPT2tirD(dnx4SAi(LO_vwpKTGhj<x
zxbo}LCk7MSHj8al)>~ogcG{}!h2&PY`2kiloGSRZ?EQQXbuZhfSh}_1e`(GK-$^Bh
z^6KjNY>yrh@5*^%E?lPktVh9OOT>?5>_P<-{#kC6zU?09*U_h^^G{ku$Zy-PQ-^qT
z_I6CL_>_HKAmCUCgVVJ$7Gh<d{7F5IQ`gVnW7XbfwP2R?0Vb~Azfa#xU%mbPx^s1Q
z|0_<qNT`@>+T`6Ma{Z=?Zehf-czg56rVSr{hilxPW#3?a?wjmB0m&(Q#D1KvQ5JeR
zvG0*ZW%o2&h96g%^rAM)v3ok&$lHCGzh(1TxyP-{!QU14H7-wbu@bmwxQBaR^|sLI
zdlJ*!Rc}_6{q0E-7GLTAzDuK|oheLSXY!T{JGXWHEaUR`Jl?y>JH+$;%Khy5IWJ<%
z(rVKxo(aaB5A<ZZcJ|lW<eN7>l;s3zn`POYzYu=x?$mD0-CuSJTdeNndceC$c=NGm
zwL5fz(@sCt%Xl{7s!YA@z8@uJ;63-RKW|T8{<W=Pn%`3u@v}7>@3vKX<wpenl>U7^
zbLT<xrF$N>KRNkC^PY+N)CiY(bq6+Fy<I*%{eJsJQ@>?X{%R_EryRAO`I$wlbAKP3
zr@rH^@2?AGUNc*$Nbzs}xOb)dnS-B9nOPq!R}D&bfBfN)xy%*5&e^)Pmu;eNNlt4o
zT9$n+I@jMvW=kmF)!mMJrMdc#{f&FvAXmE8EVkHiZop|qxk}ILPoKE2jaalT)c02D
zhlE?DrKX!r(?xc>YE^3Q{<tcwJM-D8x`a^UNr$HFIdI;WCwTYvdHGlLs->ill}LDq
z8JB1(ExmT>itU6=CWVK#+pu2LnHrgDP;TPV?2|Ta{msfl@0<i#56$_S;xKjQnb+2#
zn~h2gmu!)krPs<9yOy(l_CC8wC3jD~of2|tTF2B?US}sAc@;a0Su!wovC?+~MGcn9
zp5q@5$?Q6)uusuGH!k`2u6>MWtBzbv+4M+#iSx>55>uxyRD1C0HD_a($;*j}R>7OS
za#zlHw|9wJ*!JyiEBoBMt!DO_pEZ`1{q;R)-{bB`&i?-MC!#BJ!sTvHJ^t<c!;Q6*
z3jXZR|Fd4`f4;u$zx|u{?@oXGpZ&HF=l~Gi$LXT~>%aZ@&vVx5`l|W2&S_nXm#%tm
z()0DY8ke5X>-RQ}Yxc+9T4a4b+45bE|ILfjGc4cbluJE`nx1a?Zp-%n8>S`i4%VNx
zVmhBq_7mah(z$)l?%cHdwd~mAbKlM>7p&;-{r>*?@!#JM-+cBhWK+2spLX?;8KS2>
z?;MWUYPDvv%?z>W-y*ke(0W|r<9LB3IN;IFYp3R(pY&IqdC$B?TgR9E(ro4hJN9Na
zhYKw=scbacf3`4^M|#=YkAHS-xcji^^0#GszV?`3TX`VUgzxkL?Q4}MR|>CuZD+(k
zLyK9^Quuw6j_~aE53i(bN}QcTy3WhLy0^prc);W>mmI#gT-{n|c5F{_Y+2KOP5oo9
zX8T6YUpIr5JI$;pZ1L>l+a1ytySMLlNPBFpxv2L;lh2H%!1#`NizeMnmAC1;B(liw
zo5iw6a{RKh9Hd=>)ly~`ya<b2CiY4q;QD|0A79#eeYBd=G~Z8>V9e%pOSRB46;68|
z681@R<;-7mPE}q4(Nj)6yE!GU=F+QA&rVLU+4QvK)X!o~%aX^>gU?O$I>|WuSIH^Y
zO`7ezn>AhU`kY)Qqo+FiQ+q;G|DTdm4<}vLygP5ok63Q|xkW$DyquEfKYK|qUw!+_
zDNiGUQ>ABZdcMIo?CkoSDc+qIv~wDYPQR4(S~dU5Ka+n?Gqr3VaD2(xs`p{`(XG4U
zH`d-Tczjt<bn-{bnom9FE1kWy*$<v_+)yO&Cr^fDfBZA|e=CpFTb=IvpCezwSC;k2
ze)sAh=Rs!`%unzCe<rBD`&g6I)}3A4zPvxLJZ;ny`gF6hX@dW97O`8EYTfJp{z+Ik
z_nRN{gDXb5yX^HMR$N{ue){m*yC0_bO?a3Y;_~o#Tua{^wYHeww-2?H-P+y#c($DM
z3(FNORj(fWULRj?^|Rnr-Esfax%XUF?%ueN-C04#<`Hjk6;J2h{F#>L!q2~7yWow$
zj<o-qqQ!R{-Tg3jQub2q=@Jw6wu>-y{hlhd?|7(+cBtsNeJZt#f07?+_qY2O`-(ka
zdveYq?u)C<i#)Yc$vYTt?%wSo8r3d6L8|h`@20#-Gv74$c$tS^y=modW@;>NnQ(IQ
z*>#^ScQ9(t%khtp3Shogv1#VULcO#DQT}FIjl~TgD9wB0>FmF4?TOguC+F$R7r*d!
z!uu2RbZ$<3`z>Xga`mS(eL35g`^wy${JbpXvfJ@{=h_zBp8EHD#qafx{@;wW`d41Q
zyEx$S|C@0?>!*P(n6TOWfBCl!F5l~nJe%GhbdxwB>D=gFY}qVUdEk_B$m_E=b5HSw
zJ(t$n+5hUoanOwuzcZGX_}#Bn`yRNwWXF15pStAlf$3f%uXdhkpKG7zP_R5$e_H#}
z2~weJ>h0Mk7uDQ9(tgEqmH6hvy6bNWzx--BZ{hmIad+-?U%6QsqOp0W^2*rf9$Mi%
ziAO#p?dDMKy#3W9X&<jGQ=fguAO1;sZx$9LiceSM-EgYXDgB1bFG1;P;yGQHx>o+t
ze6zufyRIeHIsJHlVONe(^KS?B4*tt^&Vl@mD@y{-zlpq_V!!`aMNv(m+r6&vdi&oW
z^kUl8;~%wa@}5+!n~^u8=1Ew^?7NAHWo$y$eFp3|bULmTUg}?Mup_4bpINI^@uHJ&
z8!m_&7<SoQn3MIQm-SfRVrvPGD#u)(gY#8>g*-Chu~$2sBGAkJUDw#i+$!wHjy+zP
zpI$wZFcYgOeG=p;JH!7#*}1*$%g;@|ut?|qtwN5|j|C=NcK^eZ7+Eu8=>qo}URBMe
zo6Ld|sZS1Yu;j)_UU;4`OIbvC7fUK@W15E1>E#AVwjyqi4S6_|p0{7*{p8u$=gNP9
zzhwshi=!tOhfO*@;pxTtP%{xh4(ZtV<9iQXl6IY}B;6GEV&=adhse~&3wLcf)5YLC
zd(*GZ4_=pE?{`j2Hc-vTdCFegs`cmg+AARo%a3|1RWo)kPhs0|pI`o{(Kn-*?M%n#
z*sQy9i6OT||I6L~lkeXNTB%x5a$;xR`xJqNx6fC-`oOxu{afWS3xjQay&t4^T&?_k
zZ$W1<ciN9tr+>Aq`gADwa*eDLn}hi5{TI5wYcSM>o{;(Js@Q)>>5%%@O$SpnltiN@
zDlJmEn6_hw=S)*UO>Mt7Gvh**gv{YN+NB+IR<&#1qk_dIQ#Gne1vIJ(uUR(<#l$RH
zGNI(fLxyfkl~o&rLeETC(Q<Ao^Qq@E^kOf^PV9Yo^N3WzPp66m*2kK&V!k(i^3ze4
zw^{PO<hFOwG_$b%*B`F_eER!y`@>V@4mH-#kLP%I@8t{Luw`feJ<vEaEBDMZSB+c2
z$<FKeJk)#BbtLZ{xVnb<!SqaHx0M1PY<HSJpE1G6eU`DJkWiM5u%pVV1M3_6tdja3
z9uc1+`1LJgKFeoIHv_F*%*-`s(|Z<be|^K#)~&hWL&qJdbcg3t-Y9sTT~xqk_C`(f
zl$G}Vuhx(H!GqwlMOZ4|UX9X@v5r>`_;Tz2np}%NmZppCLuYv>$A?)K^VCmopI_>C
z_+q}w+0ROS;e2gVn-iZV{J3i&QTM*%@zwM1UoIE=e>=A9PyX|S`u%MG_ijE^uMetf
ztDpV2|K+TP&9&g`KW9IdKYz&BwzT#6{k_pV68~<ruYJ_CHF4Ljf_U9EHP1UAHC6iy
zh~Lq@>Atn#o$8FY*1>O9rp|h6ZOyCj&D-R5`R)3M&9&vr<8=79e_MU3J4VsB=iA-4
z`MF!(ztLlAuTL@95To1C+}M9VD2<Knuf(+1fx51q7GdrFJTlwfzD}7V{?LE<e62*i
zQ<wUJUd}ExVmq$J=j0o-lfx;<SWSB3gJYe&a$k;2o5nHsmQZ7<O7LHWuRNueTB?5D
zH?No-sw=AXwX5WvJK^xHwV?-nPiAY(-McopsPZ*Gzs{5cKOUU?HgUuJvIR2glTOUI
z=NI><I%}D9a4qx0K(SX(FYtc~c)vh;{w2pxGh+kqYWVx8PPN&vH2ut(jZ+@yS!!)C
zIAd^n>!L~8%x69v$rscR-dXucB95`Dh<SQ{k)y6Z?+ezmn)6OE+R8joj3`nm<a9db
z`=T-6+M_S#d)YL30(sW2cVGN5RQo{vW$k~~N9*(4;@6!x+`d09J~!j;L?+p4Q^5lo
z{7Pl3wwnJwIpL|P)QbIoqUQ9i6?k(h=Z!(d;r9l@jm7;ETin)|OuN)?>2vt$`orfm
ze?N$}sB!#b+VsybKyI=+n}M>)gdm&7%+HC_swO+CFs8o}vUw$SIN;Iq{QP-d^Ensi
zKi({&>d05HMBIPF)WRRd+J9K}7IN5_Y2^lNUvORh*9XOO@pZF(*=oP^as89u&9MEL
zm$GBO>Q%>uwpW;$ChcE(i1EcNS)Lg@o?DE)WcxDDO`czz5%aTlRq`tvrXwOPmk-~V
z?=U}p@g)boiYlc$2Uj&MmYt#Y=^N;%!nYq%Iou;($<$tG<o~u!)tB+vv7Sfvi8q*E
z2p{vhlv7mPJ$Lt6wjj}lSyLyzOmf-He*Mu))#tzK@814*eEo+d^#W~-wx^#-{}I_g
zO|(Jw`J72C?yE)bshNLBo8A0_+h>zt4bQ{CRb3}%IEwFFlNfPOBSj}sD}F;nLTJga
z@Gsjo$UF$wyS1tKl-FAGm#0Fl|E_je*A#Ca^7-niZN}?XY+Gz&{!8Cu@p{jDd97da
z+glsz?iZRiT?;c<oF>=8Frh(Q(|f;8P>8@Eg}~wh_t}{<CnX-wjL!C!bo@GtZ?!MC
zK~q}Pk(0s)?^Nf;Ubo2HRJ3!^6k`n&PMzF?-rA|V70Nnu_J%yO)B4(CTx%e)@O)b3
zt?crq^*`blclm7Uu@eXrKc$^_kl8bFSMzqsBiEO32K|UV7An^o`{hx~iVq7{mhCtx
z`;@=_*xo<lFD}eDJ^kqkWoFweTUO6-x@_V!r&PG`?8e!g?;KXl4Qaep#kMr|&ecyJ
zu1?q@sxiCda^}f5m)tai_DURAGi*Kd?vTuyP`}1Y;XTJ9o;OzC*>70A|3pEQ=nmfe
z@}@@71%3M_-R%>on{fGG@#M$Hl)E*K&t2YP>$G)heDY29B~O`MOPzOF%r99Qy7*Rc
zU)n^o+ShNr?xeDO=utJ9Uv;Tj_;PRN`H4$amDern-Lp)s{o@^hXzBm2)?L~dyt3&_
z{sDf$Jde&6ue0K-79D@-b7#{2y$M<KMc*Xcz2m;9Ly9@%$v3y&zK2tc*Zx+UmaR}G
zJgsR_e&XczUdFk0uFvvAExp}#Zf?9CDZgHIxA8ZRt-XQo`*upq*to}p`?P11wzSO`
zK9Sfrt9_fIo8B01xbgZdzah8Q)9qV)7N#AtT&?rJvFb@((9y&T3m#<DsXI$9u&H&o
zHh7+DwTkofgocC6-giTo4^=jsE1!O(CUwwwr(Ljtq^8c|6u-yEQ>J~{z#?)`;9!Jq
zX6D^Yi5bgYiN!D9ar%gf=<f@$Ejxb9*(#oQAx<(tOj&2*{YhK4hk34ga@aYKU&>Oe
zL@$9Qy!PPNX>9wR*lm#x*yvwzYyIv26*m<v58L1RU$OJBhFJ2Qrj-xRZP%_~P3B9S
zAaJqbyqw3(gqiMkjW^>izFOQ}eoRRHy7y-Zm8JRSTe4Ov&s=9(C7V7Yg!9mW#Ydjb
zd$w5jrlISxDBk08lBF|V3M|W6TpsA_A}`%Mcf0+CD$h?%RYAtb=YFkto#uV^5AXhE
z3$C^nwD;E^%9?j$`hssKSJd(DU$W@&ku96ttpgtKTGf2tf?@x&k8X0yXXwoKFqA(#
zW3Akt0R950+=N@LdQXI|9)C4miCI%;#_b*7XF8@%-FMoB?b(x_?Y<X|yzsA5V=v>V
zme18!e{cV==j$Vz=U#o&-K;VeFy|+4X6}ui8NBtPbky$7?Htn--`}5fY2rSa6GhFX
z3d^cF-A*kp7L2Rj7SBF;?jNod6CU>Gn)*MqaVb6G<<#^$@50pNr5o2|CLgGYy^@-t
z_+?UIzR?rr=A-=E1G;-1r4BqfDVX-iXQkje$Fk<<X;;_&sX8@x_Ps=>Z??MMALvQf
zo9&j#uG(!U)g1NTEl<jQR_vYGx#yoBXtrI<$=4d=z_Bz*=4yrwcgv#L{RaXvCMInc
znYJj_<cGPZ-qLqJQ>WKu@NJ*-?bp58tCzPeQ9Swf7jMenXOmyQezICq_w58p>GFR2
zs$QYBXFtULy|q_Asz9aXzt4;PoXbx6z1Sb}C?`m-M6KC{|M%A0UQv^meBEjK^UkmI
z>`&*z?#zn&*W)(3#+dt@3-8;E<b)*W%$$j-(JDued^l%S#v{)-C+IfI?AHB0yZ5XL
zu-|=W|H9zZ;130h%&y0-?&n*!>$b8`=!4CF?Nq<47Vw!7>iFqa;QklKtKu|2RTS(^
z{KK8Yd;9Es{^T2OKWitgD!%0GxXzug()yFalpnYMt`?j>Z5?Ol?y}?hX6aUn`-H@*
zzA3doPft&Oc>6`}4!-4&&t`nqy_$BXVD;3pm!?<bU!Gs3(7bZhYWL*Etxt4XS<Mz)
zFe!HXdW>Z{->-{4jjruQi=-FteD<NTq4Lf8jhDD`LnQ9r$tmb7cx-;9P;G7<ms9>R
zCv9dw`D@jiug{ozGGU)-+JnB1l0UCMvYw81;CTB>^uf7LJ{zB>DINFqU3c)z!4Ioy
zv*L8${dc$`_4HNOx-ILa_k4Qhr=GCp)3bl?+NK_^oZj^L$ERbr*8EteUfF+J?$W7m
z8y>t{VAO4|TDWfNW7i`)cs~D?5P!GufST%)YfE(B@9n)&{r2ALHE%zLe7eVKcGlg%
z?DHej<@pl|s<yme^(CvkXcM~|Lz0(?^TNMxnU5#d9jSi&Z`O+BhsQt0+C51Z(tYD5
z^x}tcTXOob=TR0tjenzi-bY9Ane3isAy9Pbz)zW4ktqwCv-6yeOJwZX!j<P%yryaP
zM~=8Zf!z<%zMRcf*&dM7d(x`*6MvTa{KK5DQr8$p-F^7x%X5iye*XiVZ@#oI(zy70
z-Qp8+^|DUCBbToUd=}x;9(=5r{g`mG7(f5>b2f)}e%|r$PUWG8M+)4|CR8oHTloJ*
z<q-q<tNg~h0(W^DnlUgG1qL%bc-VOUvnAWS+WY-de{AZXJh-fJ>b?Ghev9wN{~z6&
za`jU@^Uv&uj`{i5r%W`Py-5E5cfTEeayz!xFlC>fdbdg_@7fg`6VFOx{kc<SFs{9s
znfWWQQ~1Y^9W1|pG30OI(=|CBx8tAg*AtC@ryt+9m^*sbv)7w61pQy-xy4I~&khS`
zzhnGbV#5c^1I9D6%qDB>ZTFt_PUmfza^^>tqo+JiJ_>qVHmgH|bK~c9wGB3jKd$l4
znS5D&O(o-R_p0y*k=~!y*?hcGE*2_seC6xp`KxsDbf+$P-Fh_gI}7{X%TqSZY@IG|
zH}_}RgR?KH=5?A(v%2$r%jxxL7krmJdLX!YgK@SP$9;yk@%)RVX9}llG1V)*3VZy;
z^254g)4v=NNf0=o)qVKwrA@o)G9p8lCx6^}^s+^9VXgM=J3eof)5^A|r9D01X8iMg
zeL}J8<A<MTDNFU+u5bNvAbny_+vNS>#y`L9_;%o!)Q=U6tXDhkpNd^R&pOxlP}`;2
z^Ilbvcash)J$vOBY#x!7{!8umhnbgVemXu!Q!@5j$IEZu&sUzC;lJhjyXzgzmburw
z4-0o6zU*<hB(dU$%Nvfv$$m$8l>V?CdT`cWc8c`83G$c3icg(#>|Jxl#zfzBc8luj
z+QL>N@2*emZ_C`f<f`|ihuobrsijuH@ld?D&Ard@p0~6+9}9P1dU&}*=+;c$Bbi+r
zcP>l2GHcJ=<nPfplP}+&+*;Y=JFWHj?b$!~e0w(ev~%gJ+F5U&xxL(DBD=a~f9SsZ
zTKC^qe*QbJW%gswkM*Me+V?KK{{Ob^jrUhR?3Z8jLw?$a&5!CU(*Ct)M)h5Gm^taq
zB#o0|Ni{R}{}erbIOJEG)xYnqFQmWCZ`hZ({>ZLv|9zg_dH24dG`D;^BlBIMvpe_N
z>%G1ew>(bAQ8;(&Vc})bHvTu4_Zr1%Z8pEX>i4rN*}JQ`Cm*w&bSiQGv{Q)_?;cdo
z-w--=L41wovf?{x&HtXcPO3X+`?m<POKjD;{yM=!{^Cn6{fjYwYTZBUlV<O<X<r&I
zXQ=Nv@y<+N<LJ!$FLtzdYMzzSJNseb<qh$vlNfa`)o*$#y><Wl?e$N#?2pzJv)lXg
zea4Bk2EKE5Tb@q)`7QqFzx(l3f0v)Tcd(B4e{_24fBlE)ssHV_|NTFqZ_e=>^Y30e
zwQ2p<WBge@-=aSMf4ItT>+~}f4<0@H|F7=vza2TB>+8FI=goZf|DI#BozBHS_wWBc
zJnR2&_Rq6(eRcl-z1zC?2>-1=)$QEd{+^ih;P>08?){x-ZQMKG%XdCKX(m!Sv!Zb`
zqhZtYE5ZVHHBF3RUVh0@CfA=X2-$GOz{jC^M%c>@^%J^hX@+(gwA${H;p|JBa?N1F
zerX*e2HU2#cFV{Alvb`aocwfNQjUzDwv5Pw?nT_;9(#QE&0FHRuwnxf`^k_;6%WOq
zRXhxN_90v1#My|syE30_o3r@O2bs#PoF$X|`t|!ymN;+fJ|Mz-ok>_`ufF>I-G54h
z{vHT=XsFT={C>%oMo-J9bLzAjH+-|tUc1%!&r^|q!s2^%&uH0(%k7!-@y>}oORs9>
zJpVCM*K5!FgGI$nrzeJMHQqX4$a%f*^41Bj4c8pZ|FLablk=acr*g8{9>-o{xAwc&
zziPI3p~U_bRWnPP<HSzeG`PsguPbC>eX{npbOC#%#Lg$Y-(;k!ceaHunrhzXUKq0H
zP0r;*f?}%8ll3+}S`g#PbNlywPKjBb69aaxo+T=NF0Sy#F`Mpnx7W<$)!V&p|C?QB
zy>5kw&)a?GkHhx9MS6a6ht*E|C%^6bxKif;>#L_V2|^Qia$Y5x95A{QyJ#=h@td)E
z5?(wnRe4ONl{R;4>YGWp#ZP{i;-NFk@R0VzUfzwO@<~r}gwm|u{L0_I_i(z(f2T%U
z#-H)g+__aebKZ8A8{SzgsV>A-p>J`}pw_3$N4RO3n-!Ni>#g~(3;(TOR@}RuLt5s%
z$sKdyoBx!Ko{sKc-OxOlv-ZXD_?I)<RD);q1stj7?U{Bl%7W!`s?*Jf5xJ)d3|@xL
z^K-e%_V_QC<J#*NQw~U~-QauKZPPxvOU!w4+9buAmX+rUIQE`nYkuQ5^@K%QneJ^9
z4zY=?u3KItXtbmURxs}83XYb1vbuEQ2ZcYZ{8PDZl>W}MaF{WfbIJpYh3x!~zOV)B
za5NvT67D-*5%Bbu@iMcszmswo|H)YN`}0jV&oay8<A<9>O?+J9lTYgyKAicm{c4u?
z7lAA%c^8q%v1&PognyJOe$jDixny1{7I|8^YNk}cHijzYGskwlUFKt$ar=Q}18?pn
z<%CVnfoWzsd-rqC&lNbaQ#$_fDaTe%4|NH#+8GZXEUB6_yE^Pn->m2JK28X{WN^p4
z_~?bDn@`<aENZSkExq(t^xS`8%lD_-{{1T-l(ziQfBOilf9d-#-&}j}|C(3(bsncb
z{a;`9zrMNPS&U%=`|aqXj9GU-wfjD1`0X#kZc)=@ap0h1twr_CX%7xg(XE;}?ZLl9
zW{)dEx(A#8+OJWqDA>VqYEh?d#fI;1a}NGpe7teGoV37;5GJN?Hd()a|N7cLeSO@|
z4>C1b%6H!%<Ll76ZeeFNjX88h<wTA+El!s^UEcR6b>xeG`!vbAx$i^4KRLHfk=A|l
zcskZwncmyjw4<i;N@Yp^o}wFPJoZ>eG0y!o^}@xpKe{2kO=h8KZ@*+s5}2R=p!yY0
zrS!&+QTyfA%&~dryCRLFYQYTC*t=J6S`@^uOyyX8{G+eQGbQ6kHt&_JYfStmJdF4w
zcXRHpycW58*RsA@-BI6E=sQih{HVdJyNiOC$|uj95+T9Ly!-}lpIOzJPrEZrlC<vq
z+NG7abe-3QE$dD-JF5DberCJ);r6Ett^IrYmcL(HY&+F;`|TObi(c^UsQeUqXs)rX
z{uD;O%@6;*+%YHENbS#(J)T`^3Ou~lQ!N+PU)<0q<bPH|ZPN30_RK2<6OLFu?Ys0M
z(>?PP!`W|nwp<Ih{rWl0e(LA{4=;VJ-@W1e+H?QUf7xvH-~RW{{g$sP^voSDr-k2Z
zxOMnvU~s;JY)ye+{(+0a70i76uMa*y{f$k=&vJ?GW$A)~D++GgT=EY*JScxnx}ai<
zgP)6V`hkc4wimO><mt<tsahkSuv|{UBEIUBjKo2!bw5@f7qa}mj@#wIlP{N#g%w0L
z>rH;;9}<`S;L4$oS(z++lNe5C{V@D_Pa(hVO=Dl|LAk@r<#uf5Ov-%4c|zGnfAZYV
zH`A?Zvup3y$)=d=rszA~5_+WPcu6Qp&+(MdBVET^lj_PZyyA8Lq5tRc$E)Ai_VY!R
z@~Ewi%eI(0spuDXxWwJ%lb7k9i@d!==``~tF_YCH55kx|WjDFF95eKf+ZoZgL2bv>
z88ITh=U#|?xm5BvAnPM*Q|!W7DVr}^sb2eh&*sj5lVoPW*&hT|j_)n$x}c+A;2VA-
z<|)IowQ|Zou1#XGU9ohP(-(__j<JVhHIvtSWZc`gd&(w_sKXmKUie{TJfBNt=Ef|8
z*jZ9v0xuT(6xBYRlowRNDsbk{r0>PGZ?E2B)9z;a_e1iZ#`)@mvgHDO%XW$HOugqd
zbw^E{Hv8txQ(}v5>uGM8wItZ}la<U2b&<!OIb7`*{?;9iT~*@oCBo;ZSNf6ND$|AT
z-n)J~YSJ{v>WP|Ko=b90JpT51)+yi9niJ+kB_0;iY`^oqC$e~@h9d9cVBg+stDp>K
z|EC6Op7F1iO{_SqXtlE}uCwjt%3zVF4{yCYpB-~Vr1o3L(wXLK*VpVyo7gmOPtNB>
zPXD6c+&JyLc45x%RU&0mXF0{(;op6JCc}pZIVPv(m@Yd#d;OiK-@Lvro*bvextvX~
z^ZD#kU%x2E?7MhKsng<D%!Qd*CvJYzPJYd+{!U?86la+1)K}+QF1-;-k^a5@Ra<Jq
zgZ*X+NhTe}&qabfyHjLNJ9G2QQ#rgtbwhc?p}=?+abANT?i%-xcm>Ziw3hRn>D6z1
zGw9m-oT~?tw??dexTJK(L-pi2v$EbaFEckxwb>hfYOdkF^c5P3|Kr#GjLmF)c<bT$
zDFO`v!2*$z%eH>g7Cf@`n_X<f+9~T^?s2-XCO`MwcH8)eGrG3^{2G|G?e&4jk*62=
ztn`yTlV3db^ou`dSq@)GY)RR_<8J6TrPy1Unch=ho!xaj^Qcp&^1+**=TDwe_-4zE
z`2GJretDzZS2E|(+b>mf0|MU$RdVioR^+qk#)^_~zPZkFvF5L)yT`BK{HrJL8nf!|
z9Frx_4A{;Fto|K*yFdNyqNyjZIzGDj_V}(&vzhTTqMq}g%i2(8R(mSr`%7UfeVK}<
z-y(O`hULwFUiSM>v{IAy$Nh^_kN>x-X1`tfasS`YKlz;YtAE_zeEh%EW~Q^E|FUnq
z()wj?x*@!sJx*Z*`>FSwO4aVF#)mRXcADM0_@3cK^_IH~U-r02zkkus{l(U5j?#4Z
z=!ceRKNd}!*Z%nZ3+YGI{kQrZRPD`HY>$?|GP_^+TvGXaBPFF1mY%VDv?`dyKIl~*
z&U<u7wMyZRp1Sn+$**5m$aI(sZrmZ-_M+oc?&W_CHDS|_m8x~#`gI}U@2_9WzNb2W
z*nX(`fo0UooqfCGei>+r%PLf{Y|m*ha*AMCe?*}3dz96FHB;?tOy)hsb#KEK%<dMp
zHh8N2!K|ca*<QmnT3@xD@*nN{bv|K7{)3f9PL({`TlJkqW>hXz+;wlogu)p~oHijD
zh70a5y`O#~Ph>^+EgseDT$3%A+<U%GeEXAZwGRe+WvoulX*%iOFX=XYQBk#lSCzt3
z`N>JWcUC@DIXih?@NC~bZ7et3N-V5zn=VS4yX2UC)$F?mZ)Ts-^V-9EU$FZW|6{`~
zIWK%}>|Rr-RPp&+*$&SCH`T6Z$US4u=$Pf{Ykcf?if5qG!S3MVzn*LSRymsN>paX;
z)fD;h(cechrH`wYi7>t~E@yJ%lwN31IjNuR;@)Xrg$#{y6pQu-d&|u0eQaOydQtqm
zdG$5<Cn7rzsc6p7Q!7{Is<AW=^8Tk(q`hx{=G=pe=08$@&8wESN2BCe?Bh$X+LBY9
z|2F$w=PhKce%M;e^mm1kO1RIxq#rs?_KuDBXWl<5?Hnevm(!yzs)6m4`r^R0=ab$u
zUq4=6x83we{S1pXyQ<^zdtZxQbdXGa(Y^n(xc$-i#da&^CBA$OI-Tl|x+4?!{tY&@
z^~dhduWfDZ_~)@>@3U2x-NOH#2>&aw{G$caX7RAZbFvMd+u5hdecs2jY0rdLbvHP_
z3M}TI%Te-9!zHz&$R<u^Zk^=a2<}@4y+p;WYI!$%rl_0ET*TjQIfJ!W{`bA#zch*$
zp1Iq5<bubQNwcFjbEK?DeU`}9aiBfI<V6Q_{MpG19!%dohx>xkN3PWeQ^Sq-NTzMr
zWA;a>H*Tg{pVIZvkhxJM;mpsbHtmr4(e%ASa^1oID+=V_9sGH0%B3AwH~D@N3VwCq
z;RpHsf1hp*zIpwaispftF}rJAezA$989vqBIAOuvqC0c?@5!*n#76M%d%V3by;?BG
z{>a;DPcFJGW2*OgKKnr(PZ4vKq0Gg6)i?ZmeqBzgf7V=Nvc@mkTB~=W<JYHw&dcqx
z4!g?C`SWDWqYs6vXWV<~*}d`F)nkiHk1xJaa8<CxFVuZ;==X$^y8Z>WDx7!z@P@~o
zjhY?GxBBC)%?zvDAHI9=bU*LAcZz53UJm8XKGJw?MV(B{$Fj}*WhR2oFK?=>IMRJs
zzhL^w$zQa(KNos;{?rNkQn@N_+BduBOS+{x4CIb5smDH@p3EU|YUaWA%JvXFmhFD5
zkN<5xyCsbIzwx$7d4}&2ZfPty+H}!`t-6R?O=ty^@sm}XPcT37Z8bG|VtVfWJd0B<
z)-zrwrkgDIEV#&E--K50-{mgv7;7WU_1-118Baa;kw--Hroq&v{<+7ro^NE8mtXhY
zqPW#><@@L2-#$xn$gleTW6SPTN%ik*udj|57yAA4#H|U&TFz!sC0_T_YuLJVteR~W
zw{E|%Xt7$>v64R5<qL#kE4tTOU1wSma(zzuL)&$`o*h1FDjr$$uP8dH@GRQ|t*AOa
zuc_kEvNm70&#zy7DEOw&-?k4Sb8fkASXq8Cr(o6Rzh<|OaRkiepW}7<x?^>aalzrD
zi7U<bY8i;?FDjE`S$4^KM%ON}sa+i*b@JU_rE`1aw6>P)@Afjy52-)=o^zU)^G24C
zRfgNM1Xe!V@i(8(<Ewwp=bfG+{aoK`g)LSU`+OF8*}SWG|Gko(-&Yu_tV=m6vxH+g
z<FfO8CTsnzeGL?y6Q>!T5qYVW_~K^lZdL7@7p^?&biDW_^Txg7&&sV<?98~M#_22k
z|DU9@<c`MV|7_odLY;QEJhkA@KT$Fvz-f1?*gA&Dx#p`@@b1>j{L(pjM#k;Vvteni
zv4vL{467%rU;Vmt`{C(trkph}dVV0hfQN_IN=sntzMAj$W{<q@sLTw1wyrKUn(=H)
z{R)PETxAEId|p(yQjEX&tfOS=X00ivX5X5fDg(|l{>zxKrQDj!f-SY+hIQMPdu&(t
zeYbsb?A&U(zSQ^)O-gfaKCTeB_$!cO>*<NTcMh9<Su&ePd55V4r#o9l-h<NFO{_`$
z-af&3i;wNGShiDp`avo8m%ceCF2{23Q_9<1cyr&D$^~zvxliTsom30__~MzaL3FRr
z(X{j5bTi|NF3)V;o2>GpyS(@4@BduSo=u2T><a5xB)aH@q@e45?mZQf|JNS=D{>?0
z@668s?@GRvm6gl<DWCoEKD)K{pYK9-VL#rdAFaRsa!Uc<lJd8IwSCHM`F6)PUt8x~
zcU`P-`-%7Swx2YueRAl+`@3&HwMAs})>J#^mfy}>^3*V5(NZ(jm2YP1Y`y!|KBw;f
zyKfgo4(8<NH@alAJh_tKHG4+(?%ThEm-y5)_4aPQ`}Xb8&;0V?XZOb3ocQow@RYqP
zum6jmetf;&xkHmTcXxkJ_%L_>-;YoE>V7>u|DW~t29C2wZ@xZl|97U}qQL$2rOd~R
zA}kDl@h9A0F!yN8Z${U5{`F=-O^XW-aQ6Oh{Im0-z&;ntxoQ)0C!UCp|Kr?R$n#r$
zPUHI1mo)hQzx#CfjNbFTDmxc>b@x_P-?(<q?dR7^)u-ppZQXU-cl!OiaV9T(*#ak;
zPHAy|t8?#1&D_0G%gwn<B;Hl^*#+<1Q@NY_yUyPA+h4RM|25d2^y04G-rWU367feL
ze>BKf<N3Wit>odfr{(6SA8VI<HhukO-b<Z3JHDJtI~;gLTWo6U)7OS?-dni6c{nF(
zySa?*;TL`H423S`Bv>z7t-R*gFP>Oe3(w7oTeWkp=+9fap4;oqi%6^L+w)C=*?y<R
zJlyvDrB>+YIni8szt3N~eg0$Z=5@Dt%fI}rWGgdtuKB?u<lXq%wamcgv~6&{cnJIB
z^jCSotq*iIel*rGe3xUClTjY|*3@rWzEnYa;!M+NcMi)c?<}}&T)N|h*=GJb7j<`?
zzk0L6qG|HYJzWbWc&DwCxN!M?W{!GZcKC1C^p|Bx_U|0!AH;mKoNw}3O-5$szeBp`
zuiRfW-{ej1?Y_MKl2z6nGp82%S?}TBZWEj?exv5$xu@$5-@X0wELT3Sa@jdEQ_1hW
zb1$?<?+Z-due|@={O6_bPp$4rl<oWdc^~hcuRhN9=iae-#+}*CbG-cgf{9xX^U7BF
z<xhWqq5JaD@BKd{zwuwmD@d=86D_xu(7VgFY+usP&Yiz!*&W`o?63AAfkjWwz3kk#
zPfkC!VC7+nl)P0_`g`V<O|JX<N9S(rfs^%rd8{5*8Jx_YeOvIGMvJ-L?#(B@2{mpt
z?K*Zit+_hIr*n43&wD{{^2;y&E1SQ3KlfWc^S$TKEAfcFns0et(tPi~OW||A?EV<{
z@SB<M{MFliT@Ss@`Q|g%^~23Qdv)ifZ$0|h@bHJ{JrVZ~^q#+X|F)gle$(4pYqWO9
z*7^8ad8_;{o>!BX_j#%H<(<1HuU_^#=f32ff15Q}-{d}SeO6lj@*Vrjyesd|OK;e<
zvv*qEqzU)Zu3!JJHrKb!Jlr?7=J&M}k7@58UA`Ce>CT<MvbNpFj{bXga=+9%<K?@5
z?w_}M_t~pW+Pvo%i9K+*DeY2uSoZ8J?)meN$27b%+a`VYp5FcA3VU;PxZ3;P|Nj@c
zE&fK;#fqGYjP1>{>x}D9G{wc&N_Lf+*T}MaZm0=ZQYKNhx2<f0p?X(3hd@TT<VwTu
z4C3cEOKd!Twl?Ur!26kZkFGPj`&DN7$sd(vd;i$!KYA!CG{xj{*?B4VV{+nmmo@sO
z%XjYb=I2a|*NoQper}`mIQI0r+)2+q?%2^atI2fD$9W<bFCCP+bo(9C-nVMr_9b5V
z&->4-pBI?FeePUygBbxwKc&BXoAhAElbyS6i{wA+(7p4?XD(~>53ZjdXMMdfr+d=*
z@7~+<=g7tX`&9RjufBE}-+9L3f?vOR4A|ek|Ffd;iKJ4Cr(nO}<?9k(_t$5bZ>@M~
zH#zak%mdbE&#-3Sd7yj#()BHd7I(jx{w?!Z{Ia(9_$(f?{}a=HW|hzQI{EeQ)p1t>
zlx1cfl>K(hyL@q0{$|BZDrY3uOB~8Qf92uMGSl>q`HA7hRd-6lKU?kj66<SqM<zIh
zRVlVEYTK8xKHD3Tchhe)FWrA8qSmxycCL7tx?EjlpIv?DuAfW>w-UGfSt9U4r{kg0
zT;KUiH$Se};E}#Rc2{pjeRJjA{YMV@npQvCs#Ue!yZuz^VvAUoqkZ3Pz2n8LmD9cZ
zGXm1Z&#2byyQkOSd}f}aYIciAaQMgTiwt89bLidsVsqE`(#0h^X7xxfn|L$FcgNGp
zDw}hgk{CU{{*YACx$|)6rF$~_t2X|T?YH)6WqkJLt;YXNC8yJ;)a=#Tw0d`rO-5Rb
zoJ8gh=`YjQo$Gk8{c?WYg$)w({OVt_^S*j}&S~%6%4PSG8lG;`oOPP<o36d$v|YDj
zH|)N<G+)%`)V(X2j}p}8AIx0D^69L|p}x1TraynB8F<$`I+<_FzshM6W!pEp6;%Cx
zdUMz98-h<y9r{}Qt!yFVzPfpgVc%|4{`UU!=lqTPZI$Nd?>}svaXN2a<IbL{YGb)Z
z&Yc}+3yiDe81tm`%63^*&6~?)xMlB}mGW0-?K1a#U+E%ly{AE?XI|#|hIe{Ny}I)M
z*Y3@gODbghURh@L@~zXO4?fnn|M>8mpMK7Ed0t$i;`C)DrhZaio<CjO<ujf8M!WQ{
zuXp6`i~q0xw60`luZ-vSd^=XRdL7>n({xX^SA{Rj=(fJHQOGp+{js)15v-H8u3G(i
z!jZaJwO7uvyt?v`O``0O@nVkIYm|h3FsK*_J1}MP6pHQGwR^*99fS7p$}LxCU%!zN
zd^<Zk!PHogZOuuyTxp5y+tp9sUYClg$`@iZFOt8)7MVK7oj=XTsA1Kb7U_bs84r8&
z{zOXMXj|X@_TGUMkA2HoPsYs>JSFkum{eMDwbsvh->#hQ-E45h;^m#&In$;{%~EAd
z=t*6@Lm}|C?Y#dhLSOUp&p3JO#r;>?O$t`WpZWVC?{al~a&Uq9ogL<l<-z=Xo}T^Y
zT*-xR+mbrEvsUW%B{8$v$u-@6u*7-Jh5Kt}7xdq@%6q$XenrxOwX(W=cickaqczKU
zg%%hxme0E}?Ul_g7HQQl?pIlFoV{gcdSzQhc+acK%dgUAPd$8+x2Ds~`;x`x(xpv`
zJEFX2h(4D}YAu<ZIBk|hTBc3Ol)Jq>a+Yo@{wpkBe9(!V`Jv(^-o~j+y@G43R@+UL
z4$n%s>VDv=<+AXFrW?!}|NP=FGOm$|cHH#f<1*p)DKWYy1a{BfA(hG&)62DG_MP6D
zu4X%<Yx~0M)3q1hzqx9|DtXmx1~q%HFy}RUbj;T<s@<14v8dztwy7_6{bG7Osr}>W
zB>%@u8;dL%Pn<}9UT!0{+{}C;S2<hWnX@1BwuzOwuTyH-ZoaE_^*iCv>^=P1RqBg>
z-(X$1VdC}jlmoA$58XZS*4pU7H{FMM&%Vn_e)v7D!o2uTACE<y_a5oaO(z;OPCv}D
zu9xPR8R_KuK7Z@PvVi97j3t>n>#u*DmE6kvXTS38D-M@S8P=N`?k)CgtekvXQ;B(d
zu*aTL-pQsL9FjTKOslRv%FDLrs_KK@J6DyN-@OugXVhmFc*Oq9^YX)Mzi%>{ZF%3F
zZO(huCsSuHNnEpAMsV$m{OOY`zWQ^!eEIiKHKf<O;#I}Ta6hdB(jW3fq#xbwJ;&|B
z))Y6Tz&wfFdD(?$>TC>~6#Fj3N0<uu?P*z6nzn$eQBKmr_`;Ez{G(mhe}pdB+j3{>
z5~j6vhtt<ieJQ>{`#_a>*cFH6PpapdUU>D~Q|fKbi7od(IC!Q!aPVY}`1$O574z)L
z$6g&bdDY;%l7Hd*5ZyDcEEppk+Df+k^Xxrw#U*+3WGRO00hjYiLX?dj@F_mbs|i!~
z5^|Q=xbS}Mm&bqJ{pZ=RFS|D7z*al<-H)c-%1aVmrtB4Nf2u|!&o`%bhl9hb)!N+J
zkt?=VZME-HnX-1@4E9?R6I(<U=T>Ibt(^K=X3~V@J)O*^tapw`UOwg?bz@%Ap0lUK
znLINLe|42Nh39mt9Ff=>zB>2O)mN>uZe6drmTI^PMfFTvE8TEZ?OtgslkC=;VNa#{
zRgOr6clm8F?b-6(#i?<7*FsJ$LC-xGwr)uNTlS}Ly4n7gKvSD6({;(Wm}3GGD%P*&
z>+H{UY<wBBTQ;+{UaYUKL95-u;p(A>^B!e|WCkm6>bm_seM9z9!US&jdiev2c4Zq2
zlGdg5T{jR~ujkOXYSVHl<13qvcWzy5s>rG9R{PvmW#Q2oe4@{}j`>}2XzY8()Z@H|
zLHUqM_PL!al(qGD*x46l)g9sfX<DlIRrcQp@z=M~Je;~OeijYic)H9*D5<A0Zx5S_
z;;|JHEW5cH8&$SQe0|QvomIP6#;PkkS9*7i{QL9Qk9pL5b7HBzcE$Kg;i82OM@?5o
zEh*@(@XfNke%xaDu?*|3$Gcu-D<~e@5zw6RYErq5|Nlw#w|3_*JP>{KrVp?3TSIvb
zgMgk>;g63sTr+BBa<1)BG(0w6bIx(LzV{NLPSs~7-xKb7`m(?B*6Z_zlRC^?l3My!
zO>f&+z`N+ce0i1r()HV&g`#>+d))q^YPWAw#5$e3XH``ck6DD5OfnOT<l-t35s%b*
zEbg(wP%E$Nis7ZaE}ig&v%Y3ekr!Qm&PY6(nL8vVW#w1XjfYPaO<ke;;o2E91;t}4
zb|_}+am?@NTAXGp#l3`?RV&Zp%DZXho#rwN99(}!9QV+Xk9EBneB48~`py&n+@6#2
zTO{&D#aCx_*KNPj9lC1v`)5kA9UH7~No4xpP23{nYJDf7L0Bi?`g=*w4#R&>5|_Bh
z$iAJojCZf{A-k8!D%Xs*Xa5y+uC~bA_$BwP^}U7`iN&kf>v)wn{{DN3|LbkTC3(jq
zE}lIUv4%r%MM$}8*R8*D?+;$hbHBB^Sp2lZ)xY~LwJ>hf<`DbwIk{%X)u|61oVpEz
zlHHR7?Kj%IHH~>>Fkd1qOj_yVv%n?0DpPdI)^+SzZk?^lcTN4!+n32Ia)!U&-LN;%
zyYDu8<Hkq7T+dEaT^6_BBZR+UX0cJ6+OJKY=Nm7PpE5(s@4au?^nDZlJ?HV?8L@2I
zw;E=T4#RU-%hWuWboaGfjLY1v{I>T`#DZ@%%1h%o{c>yTwygXaSZ}MgG_Kz>_w5Bk
z2dCb^YV&@J2dg`ZSJ|emDE}OEHTkk>&ynNHrmtLm<GN|xlD!6ETp@dot?s+19(UbK
zwA}xd#L9C2pueTprc})}y&9jc+NY?)v^67nN$=ZD5ox!!pV05rcNUpwd-ciUjR_05
z%in2L{hJyrq_Xg6hW5LL@Z-y3A1Me0EciB+SMTdo-gR|687d2pu6XsfAiys!_El}5
zM!?&sPByn&*{U&D|E5lU`=a=$>g-QGY?Ce|h3qTYK1Umr{jPp}5EUOBfBxaC`122g
z<iD2&dtVgZI;r2msVC6T<n=wr)`^$Tt-q@iw#RzAl(B<T*T-qvzYIf*!&MZIzKHJn
z{Q8v%<D?5oTby0jKfc8Gy>qdpV`Epl_<cUDo-K?`;`=sDPj8(V75{rxnLo4g+Pjan
ze_xf%Iqp#Sez92^)1$ro_7|qx9^{{FJNu2{?^R)ey}~QjD#d?&bTUdiINs*vea&sj
zsXG-pHIE&LTUnVDdP~ML!*JC+(-nzJ?6L)3oj>99N-|QS@b2kt6Iw))m(&*ul>SNU
zIk2X8;;%;wJpOkHzVbN4{dD&lUseGz!P2W$w;}}MbOI(y_p+KD+pzPNt*=gb&eh_G
zV@ZtN3HxSU(=YuKFL*dyT)FT@yx_L*?dw;*7wG)*{`mqv{oNg3-tX&J@qXU{iEX?7
zc*uMUW3jrH=l-bp^2ASbd5<M+aB95uUD4&rcSV;|yGxEKH6~@)9hEgmzWB$5$0xUE
zOQNy(s*lz^M^}m_T5gS=_+wB0l0E4;I;*tBR@f(XT=z3HTd(K#s9;~W$NxE5F13E9
zTt-J%r>s87GvPu~kH~r{1JMSV)0em9cQW@S9|_OxI1(1QL}JnH7>Q_|fWr5y@AVw{
zWZm_3r{S_^$L8B`ZQyvknt$R9>976`LG8a|T{>T-KAqa;xgy-HF{u2Az;T5(ruQZK
z=iMjCw-ipEd&A?ujBM$H6v00cxrNsw_M`}YidZYFxkzPyL*RXV`$gYQ_fP%%>2#oc
z@b9O`Ynp5QJYBktyF`EQ&hl1RcyxwF+qpGg%bjGbjKgf>Ltp2<`W$-l!}I-uijx2S
zTxU@ERs6oC>fPKI?de`C{%#Hax1i$Q`Xe2nlGk~{vMY)n!L{d?Ou1#O`L+Jvg#MNP
zcKEG4UMiK@{uWdLoq8UrRkvi`-DSTv-=0!cHv1*}+mkE)-ZM_!|NYW#lg0OnPi!ea
zVDw0KgHLJsO2&y{r&CVN`^i>q6|~29`6L?;r{2J`*LQyEbP<Z`*|=?*qfk&!`LBIT
z%dhNPT5c2e<+o<~IuEC=kN1j2)_&NueqxKr<HJ#fw-+AjP_ZxL-TL(*)4#b7X74Yt
zO20OD_m&`Yo*S*A1?w+2es_QK=0!=(4%W-l6dy_Lc_*K<HLHTXR<mQ9f}zvj+#(xm
z%R9I3-cM3bUUUE9wGUsfd5gYyF3R!4dDeA?{dPM|-$g3qdntT7<ST4m!*`;<pW8$1
zslg@>)+6t3Z|}W!LVrtjOJaUFx3kD+Yx6UcWIR8vxTf*@?7d2{bJDsNWfDtlJh&~6
zJ{GoEv+H*L)MXcU$K@Ygd!*~_JEO=OcNzATPk$JDp7ZUJ=`Gz~?sZlAe~Vdvv2niI
z=G7-HtvPG^EVtX$xQPAzp>554uj2c{?}0JOKbE}8k54$`xSv}_Hrmd=@=V`O3wi#W
zc~55kKecZ0^y0hKji=p&QfD4_z2~d{{7U`2P`+K&cdx(EdbBOO@}2yh#OZg6ZfJZl
zvY&AC@CzAsK5p?hKOL)TYApBd`n8o+=c2Ye!||UV!~fXKoa<MgyK?=4|J=X+KdtTd
ztS)``^QrZ}uk3&S-MjZX{?~`^YX9H7e|Pfyzjw3En;+``{d@4=yLb2g{rksokN@7D
zgXiCKK3ck8$8)VjS5HO4=lms~69VeB<pZZ*|GOvX_kGEy{J(#HnEv?l#W$~y&Ul!R
zD1Kdj`DDS{ufA06f7@5JH#x!R<KevW6LvcrpMI@+yjj=M#66M0%%6+-`#s<AoUF4y
zrZ4pP`)z@B2b<0_IS;3E+x#7+*4;2DxRvwa+uMVF+C6twpFLZ9v*zr%JGTuIk8f<1
zzs+d(cem~LU2@O;E^U32SGN0d+T#Apug!Mz#h7flQ_`E1*rgd&pQ_O;#E{gu<-`XE
zhMM{7?;EzMrgK_9bUg4j`d->}gKsx7C60ag+j6|PtTdl>Lh}lzM|#ZV4{wD{Fq-mx
zqxJcgBPrb$U+!;}_|4D9A8g)Lqs?(^hVA}V8{_KK%14H!%-?3ezPX*rd&W8j9pOt}
zUW@tFA1fPHsT*%_i4(cV!?x4o;;#a$d7@5NA9l*_7F>2CY4PXHH-GS`oIX7>$Mj_W
z&tG;ubC<Zy?*H%3nLMv0GUv13uD%Lg(-j-eJl~OdqvfeuYVg${{k;Wwm8rKT-+Z&k
z_}}^0C-3ubcMF<XmUi}!W9AZD5&QR&CK+=+e7WFz=-k1Bv$xM>Of#7~=WlOp-}3h8
z@XhNlf4q9K!sd3>l4WmHGS#NKg~dAad4FEu6&fl3b;{rLphauH?D@MiEKNV1F(laM
zG@GnV*jHy~vlkCkUpHJ}tF?V$pVhlBQMshxgMM}kpZs^%gEN~Qr$1FwmOfr6v3d0s
zFJo2dk`4d&=3F@VfHkc0cIxB<5BXR4IP^4sdFHwI*7W+U)+QJEKT%?prgCT1o~I`q
z;`!D8zd?AP>ihnd3<-|xZ;ymj_KU7*KGVGJt-*vA9p0O7K2@FB#?NkjCbpq2viY9(
zW($VY^7Kkce~A*U(+lh-=(DGuw!N@#e&4e2$J0cQUz^o==1KSpKZZj#Y`M=3FU$y=
z$Ua4Qu_9k=sr+uu{K(F?yC#YBsASl&FEP%ztnyis>tDjnS-TyX+HBMqdyn5yIK{BR
z^t(m#d?t@WAIdMRwP`z&`NXc{&x7nkN*P=g2lwjDX8fr1WzUDW32XjVzSwE@nfYCN
zWA<sTLo?1~cS!C0`2FMSoEl}F*fNg)d^gI(76ge;SX=SD@Ym|epHI(JY53A?yKU}r
zzp%tPPPRe&p7@_!_B?(5>7;-8<q?xA6%W*PzPkM7&kCJ2%^}?STP~@;>^pyuYx32G
zlIrz0w+W|Rm|}gm>eS8J6FSEQ-!R*1So6PGyvi%1A!d5O#-}>^jEk&Kf8CJ%YNzgk
z?YS?$iQL|svw4r&nXhYA{de*FX1Czl{Aho=-W1M591_ds1<&k0I`6crRFwSx?3zkG
zogEIx&YhjKhwJN}2KVyz-_`6Vx(^?G{r5Wi?&|gYw+_rd;j0<ZbZ^($cj0;w)AN)f
z&buu(5pXt%jm)$)7m?EOR_RvH)HvoPoO~(wrkKOTJA6u481EQv7nBn?TbZ2EppkZ)
zz4l<#neB473>Mj}XLi2L{#Y#Mg6s+2Q_U$8ZohbuRby&5`EmFb^FP-b<qytio%O_-
z^ONUW(VCO)`a!<uRAS{neLk!)^~JQp8Ll3R$0c8|*>B1Tc)HL)ATs2{Og-yEf>$R9
z^-e6VGu$mX_gtQzeH_=amA3a~`j=l&TPW@j7qRL`OWnlW-r&*=H|AfFy3|~7;7g@c
z#T@70JpDTsp54>ia}+MwiOO<c*WP@dwO#kgyXrR%7sdH}^nwf?vF<;Z-XYui;+5%S
zUu9#j1sd{euP<8B^uFu5!W^6S-1q$ZZ!WxWYTg>D6CFGpF5V)a3i_5ha`jmjJ-@GD
zE7F)|GKKSh^5xEOC3}I?hyRt7oy&8}*QurFUYjZV@W1<X<sbiZN-nMoU;eqWigmsJ
z@#%~9&0TzwN5EBoV~ecY>$5u^etz-j+2^BcV(l2TL-^e<udJ~++Wz?QtA{-E<<i^i
zWBT+Pj(wW@>Fmp&_Zv65JiqI}UV0-%@k_L{v<ZWqM?xN_lgfkdtm-=&GjalVZkrQ*
z_wbhWiiQbA8e67$oRm*UYkI3_{9;?c`PS`=*1pr#G-!Es+JV<tLHB2m>df5FDv=FL
zV$5beuaB}Ma;=X{-@xot_@|n!Y3kpDj|ILOrB&6KSnt|pryI%BB0Q<#S<}aPUNR^2
z8j{OzFzTLQTR%zac?eHy(;~*;3q=x3SDch(FKV$g-g2g9?x&RH60>5Ybbfq&@*`^6
z^h0mHM4Ko%e!QULzaek=m4~6HMQwV|H_cyQEA{7V%igr`&8JV^d~P<|_q@HooBIJV
z<B;1Q6hp*o;>6?C(jNuZEl@kG{_*CCK#i~;o?3oCjI8YU&gk2}rPXA%Z2g>P`Wy6Q
zp6G0wdx7o89q-uv6ZXBov3mW7>z1}}W#rF?tuEj9U(a(_-{U=5;r0)Mn_nh<J5^Y<
z?|$_9ct^?CHCvim*jZmT=o~D+eSPyqzT0voWsa{bFHEp2@?9>_d!gf}w^-#g-K`=W
z!ZTtHf1YLS@Yqp*SABy24n`hX&8-VcxTEe&i@NT<^;z>yk@eAiulb8qCTwN5Wo+ZU
z^juc0)o_WEEQ`(j{nM(XL_^G;Uy3@irtSVIEk;?++`lUN2i<yWCcU^<dVuAHh-vaC
zNscvMh7P-RpPr7<U1ZcgWnQ?(!)X&%SuSy(6T!3lZMgEA?VA705B|5?D>V1()2qUZ
zyL%UeO!>XQX`y-1?r(*QG@ZDoXBgZ6%w^jDH0{Xb`*sKO58XJt%0*G-^zOf&r}R0T
zPcUAv+q3)4wwu?!EwH}By7T|8-)Z^jtB*eZam;_(AvtklE%{@cUu;qcUl_o=g)`CN
z_V%T%lNPw$7QC|K+@}_+{EQ8y7xpyW6FDpQY$X@#zT0QsFwXM+=9rwPbd>YibdTn?
z&MEhP)gD$jJhO8{_5?Po>yD4L=O1mD)&3@zU!@}Xl2R1E_*I6ei|1E->;BkeB6%*b
z;3VG<q3Lppi#5*OESGDO+s^canOo#2*A%5Q1_q2<m<#ll__kKm#;7YAv?M-ao;0<z
zJ$31%yOV##ct>S@h)y*2be!?|*^kpa%ezGT?F<bYHsuLUZB<AScy`t2mF=qIF;zzv
z3EuM2>1%5gskKluu&y{ckNMO0kExxDQ|>8sH#u)SwMb2t?be0th=$bJTLP6FcPpRw
z=w|-Ge^80XgW;>TT4U!4!|NJHSBSpd)%$<{>#w(R6sH;7(uqIaaLxDaJ3sHVBl9+j
z&UQUfxlADc#2VR^w?2elsc4lIZ2#Wss1?V|Q=_^j=wlV5uxi2*zEi<DDQnI@kuXs&
zTDaxbMT3f*vf6!nX2>kw`shQu)$Y^R++Q_3)?y0c-Z*XgXN}prEH6!MIPm1F_0Aj5
zb}nU@+PKnMVj@F|w3@MES6T>{d-&p$F3+Yu5k2(ksuZ*Q>^94N2iJ)*q&RoX+<7H!
z>fKub3PwjiUsk?(#Xl`E$>j9U6uV7-d3HNKnREKz=EeGxwGY}St$BJ)>qhG8wpM+q
z0EZv%|NUREF!akh(S`tN1-*%v7sRSaUzv1ubCr+blpJ>731Wwo#qDMsNm^gv%eC{p
z=&4<2{ER0=7j@R@g@)xeIG8Pn`jjI!Z7%=B6=_AL&kn9#Dw}2zo*BW><a$cW&2Yu5
zin-e#lub)Xa(Df5dy_-&AEm^9TRHy=?q)15kA5_F$)uP&&HXPm(x1&~j%8QB(Y<xf
z6Z^Bv{+@^sGix}r^TD>m`w}iH@K`-!Pl)u{s?7Lg)5Bup=S6JFzxQNzKMS@w+3G({
z`3Q^s@mp&?7Ef0ER#|3jc`WkW*{@HRB)&WuuXlX@t)JJsKd&yEx-V8$U`bQ;>6RZ{
zvn{e-u{Q9WT4(ZQ;X&zNj!{?FPMs_o{Ho>uyoY(Iz4}Gg^K;`(BAg1C0=hK)bI&z<
z?th$<UScHo_iglL*@g*E9+bEHr0!~#5lcR2P|28;`6~1kQ{4XK$(I+Oe=HrC8?Yl+
z^Fv;m{PIP7No{`$i^@uVn%0}QY-9L1<$SZ3=8sP;9@E}E3c9%Kf~ET8)i-}Wy{_KP
zzVqvrz5mZXT@X4$bdgKV(W3?$+stfV9QHqacdpoq;AzW!bTZV<<0E<+<z2KnBh_3O
zw;$Ly>GI4&f80LhNBJGq3clRpWVEy7^2w>$$v>af>M8LroiL|%R?qU|;SMSxAA;BF
z=uSFi(4iyn`hfA#3#Ai6x>oYKtkzksme43C-Ol;p(v-@`J-ZglTiHzSZ@4GK-0<*p
zdC%@0+Yaa*cR&6-{qp)tF1$~>@9U`>XNqk55ckXdbW&LAb=jJ3!3ievf|sUD2wqmi
zz<Tu2<8KO{*=DnJO!=HIZhd6@d{5GoE7ntT_x}_Y=!{TWxq3#?*(E1D^y;U1rI!@-
zwjAxK+2Y2Pf4^~o#gx^>?<HT$M+K^cDH}|jadTh2(aXmDj`QBxO3NLZ;nDT=&c~bo
zw}01ln3Qrfk=x>nrljI*e~y;JNAKxb7n|R{{Qu{hvxT2u&YZjZr{U$|-PPBZ@B9~1
zE`B-oZg{BeeCcBgxD^{qnU1qsITmn9JN`Jp=n~;}Epf?##E-m8+AbCh%1#y&YCIGU
z9pk9sP<nHw=Ka;>yVG~Cu8Mmv>+|-U&-c}*YWAP0nfdcms&2<LjTf=cuT|e;(M)P$
z;(sk`dH1Kr54D}$d9k}^S_PlBSKl%-s{WRb?i{njXAHNlJ}LHHI(M!c?*+jV5=?FV
zRk9v8mdd>UCz$808IzkfW!L-4P0rZ`qHj2yN+)vO*t6$2TQgs=KKq}Wjh#;79=jzp
zxAQ!U(G~tW_kmiY{gYD;fv*cQH|)-0Oekw@Z(V)O?yTQR_Ry_0d)Ll+vUhE^+O02%
zcebyd?QQ+}wY2#$nR2^n6OM~oEKD`tdEEY!X~#9?^GZ`@HNDJ}Fk3EqeCp9tEympM
zjy(FYVC6y+MR~;yI~1bzWN*xP=@E8JQMy{Ndy$0oRJX-jm{}f`w*@w~%}p^rw%uM-
zxt?Kf*xt>q+zVb;Ju2P3rqjTx{bR*#mWEOxmmY<fa1p!W+BuT8Ef=#{s~<dyeUR5v
zEPnGWgK#Xvd-?W>#{O-|_ay4C%h-oazZ=sm-8U^?C%{$QeAmG@#!~y=ytCN;QO%lh
z{Zt8W28J0+E=)ZAWPkdlhyuRrnmf*Nbu(qW&}(FV)3{;s9X2C={`u-fA1{PV?lTTj
z4;4Q$IgoAk$}4PI8osIK?yIVnuBsFZ{iebo%s8Lr%xbY++mkq0-yR8@bno$&AVZ1k
z$`jZBe7m#kAj2w+$v1NDxG6K-zH#}MHuJ}WA(ng0i`a8HdLP}(=&j+dSbf9DH^i^C
zYoWxE(A<s{XLfI2B$1=t;Ayg??6|4RF5xw+a%R4koAKbgLX{_XxR$yN<3*0zv%M|_
zIZ6w-)9iK##5{L(=w2`IRxUcddV{pZ^cfdI`}0{gT(zG4kj<rsa~bpBBRLHxd%2nm
zEVOI5r5js?JGo+hUKf#hRDQd|Ryc`?wX)q}O)leO;fTYzHW%#gm@dD#Y38!J$kzVa
ztXHpOvv?F|?y8&Vs=<{m>#qFeoAz5dvxn9CX0xoMlP0||P^e25%u9%Fou(J1{lq=N
zbpH0!i=Ugvp6@unaHrw^eS4>U)i|A0%Mg<xY%F(JGjPX+kKWPyW279PTkGU~?}-ac
zFOa!ilhsxEC~VJ4LI1X>UFP9;d&7Usi9DTmuVCLry)_Y+9{zrF%FD%3x#4&ENx1@D
z{g?;3UBaJ!POz?7dWJKBQ7!t$9M=WG2Fwk5Hd#h@(%&&H&@H(>ZA;h6g~fs@9=y#m
zHHT-4FTQxgUHQUp4M*h@m((2cmPPS$sV-Z8NBDHc&6^y`lbe2jjg4gG=kh-Fp8w;H
za@p;AH8(bD{5z8^k$!fX*}fU>vEnIitJ9)QZY~K^(70WF%K8<@2|ezwie@1Rv$7Y6
zCvx6QtW=Rtkasxsve->l@l)!fn7y&77s@9HyFRR9{QTyE`?`sRe|xrUEHN>98nd9{
zYD3q}%j+dWb!25V=W6X;t$Von!s1=3DHo^Bbx&P)W#vQTuWNHHxVP@vc-q9;iE%4)
zt++{b{N<WMS2(vmXnu29;)a{h{^r7z8(Sqy|HiGDnilZYqQj;z`i|+5YjV38LN};;
z-m|)9%p-9&^zhx|VjndP#fq4wiEo+rpi?5}PD9EHvBn<`NlY&i&)zI@Ra)^p*FFE^
zH-X02cf?A+?PGnKDn2co_juOUgY#AzMmoz+oV=%7bQ4?KyBWK#z7X?C4vy)1I$to(
z?9lP*EBotiKb_pmb*N$P)>9o?Qz{h?*~z?iI#PVYBIS-qQuB4?kQZE$Vdg8(@9s8S
zyXv%pciO}B!g~84rcY-->^E@b{&JDq`uW7)3_0r>%1UJGo;^sHtb5luKk^S_OB!3<
z0`F%wf7VoOd=qXOF;(wv{H#K=RW}c@85=B%(~6yCC?$CQ+g{ezXG<mb9k~$ol>5$Z
z{<K-on!3Hz+FF>c{k0cdOi-67=<UgkVG7e;eDO)|t`C+wWpy)JawVBB*iOF?UCo=E
zX`@(qZ)pL~n_5A~6_?Izt$us*Wb>R;w_5$?bve3kU65(RQ7%=rySCHg;iSs@s*l7D
z?uo0}XmWJt1y0_Bw{5<)W>5dOV_(Oj8%yj2O%2P9^PB>nu3O|P$do%T#?E=mrRt~$
zS9?CzIj;V2BZTk4W#J9~yWSp?xblg0t=hN9nLZy*H0RZLJG!#mULzN^BrGV<enWt+
z<vYFIjvG`AE4^zU@VN?z*p=S2ufDrr$8N7TE{Bxs?57B18a!JeufXbX^5hihmj$nM
zJJc%lmv<Jd{j}m9pT~ku!>?7<nwKX0m@qf`Tv?NBlFWk`^(pLc+{`XB9%r^Xc4eyB
zjwQ^;ou^tk%q%Io!Ji_`?rXh3=gvyzOX3MO%k;WG?YJG$)%1#?#Npk?>FTiuo^H)i
zx|iE>ftAf@^WF&GW3mxlOJ6ahFrL`4F!)Mj#X+X2{<|7<eyn1?)R{W-`*eRb84tlZ
zrA|xv+Csx*ymv2{cR}x9ZjIx&&2w(deR!#GyIo#vlH-oP!*K^~IFe>}O6#pMUvc8<
zGONcT36Wo0G!4!b&U*CS^ZWKdl_Y}z(dTY^>~#*`T>L0qJFDs-%fqD`OuJrv(+!tx
zGg=#eit+j~t1anz(H{<Y#+9$x`8uw+;dr+Ej(HPapYeWLd8{|MdFzEM4o?@%^?sJ(
z&YTotnb6K?^Wlx&=c{Hs6$=u#hF&;pRrqbcdAd7m){2Q6tS7wnO;9?smh0VQ;|0<2
z6*h~{{*Ar+tH|O<f!rd)g8>$H;aZQ`G++GRP~g5eaFN-HOS1o@6Wjh@ko|Xf-QoHd
zeE$>e5AUBaQ~YuLi@yK8`;Ps;Ap8H^xi5zQmZ)vm##P<(l9TbxM(g7*zwplcn`o)@
z%R24fpF98G+WeQ5|Mc^H1sB)uIsg6U&HXQTsI=_g?`!k^+dV8<V&(4^KEe5c`SFr6
zp*_D>zHzy)elU4?nUGB(m-<2Bx6gBhx4%%S__M@#*I^q@xqSP3xBtHQ`oXX1`0~0e
z|0eZY&z%CE<t%J$Zz{a(;lXbz)cK`Yz{ajJiv8f@j}uN#Vzc3udtW8BXZn}&zLwx)
zM*kmXJUip4dfrK1>$XJx_YKi!j=rgSt#qpG<_ZV%*E{qsI>s&L5VDI;tge#i^!j~g
zuKRlTBWA1eH2NBK(vm|=KZ_WrhkrgJ%zI4j2J^XdhWS&3m6yEux~y||iqFjR(?7B9
zJr-W7amhEU{)i>d`n*oDgI$Rem)6fW*nBlqH~&K6+|&EIucUu_ShPQU`wf%O-bd@d
zRy!_!{ycGkt-)dI?$g@q%vn1)|8KAjj{197H`MH!$)*w))7|^_ZMNE7)@+btm{F8{
z;M2*pCbOEiZp}x}Se#?$=3T(%rm%uz*XC{W?nd4}u_jfFgMH_kt`a>_<pN2eFP|OP
z+L#?~oqhkznKVHIG2fpLBd(ONs~oj^mttmq-F&Xy<mKIha%|ln0%XgVODX>-yC%NZ
zS+v{l$1bnkOMQ9vJw7fbso)m<ON;q{=XNs{siKqzbqki;ZLijT9i0=AbaC6et5S2$
zNuGG~?Ae=M**TMUK2;49E|xO7eNtF+iL8ieUCf-mh^t?A<!SpZS#kSxL{Cie=LKp`
zt$#eUx>sjPEcmvmE8KYX>)GZ7^5wO4Vy>(Q1SQW{=Za2DSBmnT+Z=c>%WTs*6$AgJ
zc?{(*Rn<9sC2G2MZQHwP)8;+fHqO2KFkqv^S&MrQSYF?pVIHZ(v*4r8vwPblJ1U>u
zzO*H_Y{A*P&5P?cy5;4sd&BTvPtQ0!uP0{qqKO5<cRN%6GW4$vEatUO*U8blKmFz%
zr4u`*$M~#e3hJMAYA5rP^ph&P9RejKzLZ(+-fY4BcniY^i)C*(r#`V#o0B|g_T0UV
ziie^$e-591eOkp?hPK16T)em|#BS?JHEy_a@#a}w{_G=<EcX3L;NP;d(`t?R9HxYX
z8Qa#K%S#h0OW2ZTZuxL&#|N%TgS0bV-ZCFIt}1yl>A1?KWfl(%x|<}DG?lDNY%Gkq
z=D2PXY-6(UkbUsx%^js6Mn>VclDuMz!p%(Au1yknw^Zs`hJfk%^uh&_27-y(+qw*k
z+vM1LlOyiUXm@;^t3InmsQvKIbB4Jsk?jWeN=v$~+I(eZFFfV5)b(-X-MwzPWtnA_
zz6T~b2p#K-V$xf>;e2h<VYiJpKJ|Rtb^3|sB=<^b^RisUt;ctMQQ^s%`o!f~!i_UI
zy7%WR@&wOae9XzO+ovQzVw3CaygOe*^DnS8$uS49d&s87rj;sJJBL2b;e3=h{ijsd
zZ0CoiTkb6I{(A2WZ^P}AG4c0KZ8Gd|?<|_L!lFlIVS}Z**j&f8%>px{@5e>oNDAQ8
z7vX1qzR#a0BIlx5ETf_0*6(N6<)oJ}NGxHB-t;Kv<fq>!BGuR!mLFhFI(I#PeY&l*
zc;U9B!gw>cX|JZK-dUw_@8jpgYunZuMzZM6Z$DVRAamc>DBsl!#4msBecfhXH*ZtP
z4Ar(~ks^O?HOaF!cP<sao8#elFZGAdB5^hL^Z#_#r^+5!c}}jF@1!+5_ua)uEPS)M
zS3U2lzGnPbh)ZOKTK)nX)ABsa-5YD}wsuzTK9m3Jyo-PYcS!lcM{x#ao2^5RaZi2G
zV6?08;{;uHotLcH-OoQY=x%LXx+lR~y{Xf{f^pinrq0>91=%x~${O9UnXCM$u*`3+
zhI*HIvcT-u*Y8|p=<t+xnSQ~0T7P<7ZR?Io!JpmDej8UVd&^uDG?CTy%FD-reN4Z1
zZtaOq@_YMn#rFArOStM!EtFhfY_H%TboR&jDO06pwYnT%l(WK>r^nz&C!c}9&zy}r
z)Yj)D@(cCMf5gz%q3#`cK2D&@&mpBoz{UKtU7dj0#Q8sTn)c5-yC!$xHq{564Ifk@
zr{A;WuXfYgZG8IP;pYhoQ9|v<WXis=yITfU@Enbi?&@5p@h6beP9*mYvxb`F#){(y
z&%3g0yTWI7m2=w_&S&ZJrt@AXwcgs%aqui-Y;~Hp;A^J#^AfpN*XFOQI{4`Bs^)Z_
z|7R|2bl{J8)G{;id?niymzMQwKe7l;+g~`RIWBth`i58z?IYRRA39qd!ro|Qx8!Fr
z`mg$Zr|O5?*Ej(aNydq3ds92}buN{D|0*OYn0oh}lF7E~)8hBfO+4V@RVrr065DHe
z@t}s8$6{CIIqr)$&TBsLiDQ=qxB7t{*5(uX%%((MPXA%35>R*jU2OFJZEUMrHXkq)
z-Im%>p|~h!(}g=0A!3JA8qAG9^A*ftd@t2o+pH}T9`at(V$FPSEs5HL^Uhq@!){QO
z(Wbd&-qJuG+i;x?k7K%-mgcoOWSm<6saad%3(u;^dsi2JIAhe^u5#SuaO2N97Pcb?
zMI!YIHK)xn2)wY`s)={OT(6#H*O0|YwV#4&Y~Dt1yy+_!+P+Va|I9h2+=mK2drn_4
z4v6;<V2_LVRupk-d)Dto5<iPhxaTBF=kPJkOt4bFWEy{?!!(I6d(FAH<IP)GypFtL
z?5$q0$J&IyKIOI6&2J0*I16TJ@0Vx%XT`0{+SPeB^|+O)j|ArvJw?uE$3D!MG4HYd
zU9mi|eQyl<wtL%M-4wl!^?%ab$dhY!ec)UcTGr5=%&f;%SJa^ER`My*V;xJd!BI`G
z`%X_(Di<n*F+JPpD`Ru8#9Mwt$AnLl1e%ZYZJ1iXo|$9D{lSHIuHiwE+THnPHv+F(
zEqkV{yOnnq$06w*l|~j?Om~Vzo6n1QY^s|%#Z4p4HM32NZ(hLm_p|TD+>1Q9hVw+{
zxxDSicUM;Po>5E?yt6)eZpn!r*_%nT-hV39ziQxndbWS_;}sKhPySu?jxp5rC{LGl
zv_YZdc0s$?+P=FiTIU|AA1*dfI#qFCeYxr*yKl>1aNjFDHi=7m$I`Q3-}2sPn(mSG
zer^fxxs~4UG+he~cQ@&6lD1A*civE0YhusD|Ji-f8`hoU-u|fT)T+$g%-e<Tuq?QJ
zT5h+-M4zfX?g1~a`IQxy{fjd&7Ct#;zvLq}r=>efw@)lJb?Pf{3QTm3J1tb7v!<E%
zxJ*z%wvc-=r}U1)b1L*AW@Ru=i?o{b%3{Ve18%v`8C9<moaS-LJo~CpuO=Q6aq!!z
zzSpmk4Rl_u+dg@@vBu`dw@w)EzS+*Ru|xUo-aw1Mw@+Rhe70J8!^Q6rOT%3S_M_+i
ze0#<v@o$f`P9Ohy{|*15XN8qtvbZ|i?5W8|cfs=gE!Nx0EKX(Jj$6Ettu{kCg`2C>
zWtMAk(R!|R69SaOCz^yzTp_Fc;@Xvu72fZoI1k*r-YvDhv@*9YU3c@;*tqCN{VJC<
z&0KhWB37DK8nM`gv>o%i)t|t|%FG}2ZQbUJ8GSpI&s}UR*r>ZUEG+(bG?NKi&gO?x
z12V-XMY-``J)xm~+R#ugXYm2+i82>|B}H=!WlowB7jApo+319{m$ZCGp!I=(Jjb6~
z0&?_zez@TE{BudvoF3&@X8dZavnvn3n$Iv}{?(Kg@xbk?`lR=Iy=09@-t_u=+O-+C
z-~4h*v+M4i`RMZ&?#B;u_jO(TAM-x4uev#6a^Ugc)xlyh`wSE(Y(67plQntw+uH(1
zSeZ`oUKi(@;P^c)Z-+)ldxDVu#)PEJncLE@xaO73@$6{Q{~_Z$>AmDvr-w`SF78X1
zvf*-{%6+?6txZ)Yr~7w_iAhZI`TMG~!Ih=h*XZ35AK^C6be-Gn7xFH!Z0&ziQ**IB
z;ZqvN4VKbH5g!)L*d@uOKIdjXvoHI)y~=$v{3m{B|5zOp$vv~O|JA%6%Ow>_W}fCR
zySS>3pZiri(|5+vY$nEuN@@PB^WLpqI!*K3yHBs~x=mi&9C%%Vozq(_{=%depOdvE
z+;W1=Y)j528F})t^yV>pFFJIr!6EYnL$TY5$3K0ILc19Q-z@R1i#qk_W#;lln{;Qc
zmCn9-^YxmEp3kZ_@Ex3HT@c8z@ZmFtCmT|fKkoE2`rrIp;6+)?rH{dlI@%ju?<J(&
zGt$wX?QQ+NaYp2FF@eKY>GwZwQC!Qn)h4aFpeVg!i)$Opm!7Y0-yAEOHp@xJyG%9T
z`hMo2XBQTx`xLy8;rdqQF2U*fY?8yIMD;DL9LGy;>D-?7bgM`V&mu|BXNw}r&3E3M
zRxG($D%r1GirIB;Y%~+={oOlfB~7}_tDN@S^KRmTA7SdIMvI%WKSwXv%$;lh^wha^
z7f&cTgni&~`fX;!=zPfCJ@#V50qt#BmG#<YX4l^fT4X3iwO!3JyZJLz{p9B6bGHR&
zxE^^h@qwnE_3o?hax^Xa;v~-UuK2f0+`Eg@-)deRLrt@$ZP&E;il&!KE;8zETPS9B
z>}Qz!>UputYfF#StGCJgm-SutDE;I8?XRr5|L<G+@xJ;I7dFm6cAQ5ek9<G5@y^|Q
z|4WN>%J&D}S}s$uH`p*TBL6za<0Hind1E@iW!zf#URgTnPU$1{U%WBqofG`#+*-X!
zsIwsdlazsj)kR&0s8D~g2})*Bp&?>2Z);g5Zw)bVHqKPd=scmYw6^Qp_wV}CFFXuc
zEonMSu4|)g{w9UY>^-S3*dM<TPCjhRm$aX?Tj9*lu(IOX+?RS$U*E|*zyGNG*0)%V
z7w=`-`CY`PWHB2YsJMIF|HHQ!xsA@Bd!H$;nG_mb`!;vumn))srY>Ng^u^kB|K%^$
zNoy9T=e~Y!v3AwtglUm8-gf%0EPr_PSl`NkT-h_08}2>(v}3`#jLOM<s}JqUE|0BM
z_RFzacIc>U|DQ$cy!mzeGpA-ai!OfFx5BtYi|=mg#6ymu`j7X;=DO=Y`c!?h%;Wv0
zi#HPAFAma=4n6byaL;PliMk#a?5{X%eqa{h!+P$ZUFA^&xrynw8eDfTd;a<ro2*u=
zx<ShSBA$Q#|5$E&#{HeY|0(yew<WK4?EEM1z4Wp0x_|xYj)DLERnC3+uNbqFiLE)|
zTC%G8lJt$!wy$AN+PLiRgTRFsZ`g(vef_g;+V<>Oy$_#QawXe2&FYN!rg-OA|AC!m
z9b$?fFQ(T|SuCRMo>nJ6-(uQUr)MUMpM)@-&79&jE$-4Qh31lEHK|UwQs<MI)jNc5
z2liB{vu-=HL|HR1;A+69b3SfrD>x<_OV0ROrxvy5a(H%lK2w)PU2bHQar_<DXO#=K
zEH_`v-rv<5b=c+@yS7wq9YfgU!|eS^!pFNV+0A-VzPnnDed@C=18D<s{-<Rj=bz8?
z3_U4%YhT)%muZI&SXv2vDo($D#=O7(!F>LvWYN-zvWuQ9@Y2|@nm74b)AQ(^J@H>Z
zIp$rPcUUs|!ITNb#p+3aV-Cn~wJ-bQ@aEv+$1#!1!^EW6Eqhv8_IvSNso2(DGiCLr
z$v=*}UtCuEX79%5dlx?Gm~h0l+^Da==&9S`V~yV(ty^smzIB^?b}#=u-M5_#hZp=5
zk3W9r(Y^qNoh1j7CE34i^S$uwW1y0yYk6XWriN<x=E7f*b=S<g4s{+4(Pw+-bfrKq
zt>|64>hT`qH<l9%?_@E3&VDMh>ej8pZp_bu7VMa9W|vm<X8o%v%*Q*U&$+j?)Y>gl
zf4}WhwUnIlf#j?L_nIO@d1D3k;}hj~XJ{!F3szo~+x>U%?huXZ8#aEKZYmZym22y{
zZ9-l}=E00hXU;yE*tdfDp5UQN?(Q!v?@g?E$-80Ej^<jIrT5;SC=BENlKx<=<cz|t
zxvNC3YUj-=(~Hk|lWC(WD{LJQaUrYs@3uq9{<g=(BdaB*F3{w!`jWd*`I>A%e(r@?
zMLES<%dfu<VAOEh$#=<Wmu^{2&xx3C&$q8WaR0{in~VGWlsT)H9Pr_re^yjOG&Ve@
znz7*R&K-JMIen!9feT)rKhSQJTKFc4bN%Cgi|^dcNO}I^`rR3^?8}8zG-hjQxK3O$
zovU0v;r!J(WfzX*bf!L7D--6|aO>pWgHZ)X0=25t7`q*tE_akMuQt{CabjZqxxTEA
zuf(1i?p@*YThRA%SK!v87koB11#MoNuwR8siLbpp-!XFi7N6W{w`zq~iQoR1d-rJH
z*7MJOSMB`2A~){O;R%PQhg-ewSh116@WNWRa~gZnA4Z)mJR`_=R$b4%V9wU|=p{dT
zl+Lcm72O=Q;VJ_|8`orG^VQ3*f7p<JK<39<ZKb;o&OKHopX;pW@SMG896d!@eERAL
zm8G&97Q{~pHeb2qK3857)34JJr;g`U?Obx*R;5<ltmWAC-ywqcw`T47%j)}N$;Bjo
z+506s+OCMqvRFT*Y*x7o)8`I<HeUyoWmk)<HzdhVWUyJ(Rc?BDfplD)<-1!!-y?l~
zoZ6?lK%&IV;fTVjAAe%yDi=Omb){+2wJoa+tA731vG=4;8f%V0U5D!<P0<NP7qVF6
zi$!K<yyn$@-Y+L_&Ab1F+3zKN(@L*KpFcW5Hh2ET#od-%uX@f_r072qTe^qu`MtUG
z#8%BapQCo?`Hz?<-qn=`u9mwFC91SqHKnIad?(TTDLrEIQSqbE$9eR>hCCKA6kJlV
zeDah9w#$~6lr`u5SW(Nr_*N(D2JL;;(^{J=F0P-o%JTLZ@sF&^W%sseSX<t5KI0|w
zOnv)o4bk_4t&DQdFEHMS<JfUK%<K5dEr$+;t@io4G&M-W)z;x#%!IvmjyqxxzkayQ
zN8YsZ;J06F#b-p>UPS5FHcncl!EiF`)#CcT%EP-~%(DK=*qr;=Y0<*V(moM4SdQ)g
z!uZVm59f{WD}MbMU+(3;H~-KXx8wF5_Le*GZ8tgvof1Bo3r9Rpn*B2GX4GW&7c!!&
zf2#eleYbo{wfk-F=+@|p$Cd%Fc&-U%F=<2<9i27J{Nv<HD;<8`)wO<e&V?)OkJGxo
z*VkKP7KSn}+Eq~VFiHK-U$1pti#9o**)?^M0-x>dgX(H;_6G0yShKVIblw~$&N)->
zWv%=+XXe-EvZl7*mpv2H4Ltv_v9>OQds5WNxQLbVE#c?p1hsD45W}63@w-0uTm9#?
z3*Y^JBvx=`^MC7u-|82y-2C^xV$2!t1$O;PV&~Rf-m~jN{n|jwyH-^n{<|2>dU5Fg
zOXGj?ho(Mdzqk3;S3`9>UBOOOL&KXVOxFs`4_8+TFj&>M!8zCX$@vA}1zeUrI2ah(
z>$~dp=SZ#@LCGgyrbO-h`>jKLj)&yO+T_MZv#QkDcK05C^!Vb9*dKWxl0w&JR!8~v
zY8HRlG}rpO(8MnXW8bVj*?x9a+LNERS6!$~-mrbk)0^7Ty@qGP(;s+uYfEhr-Y0#I
zed$9+`QYr{8c%Ikk<=r+#v7$fYna3TB<x9@xv`MTPI|j(#!Cy;^yc&IUyc5yJ#2W~
zx@T!`a)r;5h|MB`Tno=7e>k(H%RHlJLGj~@oTd6=p3ml9U$-%$(mZCOQl8&J)7={-
zwk%ty^XRu{$j7be);GL;Z`>Br+*1=G8CrC7_s6#{Z6>88adGe1cj&a*;)r8k6$8Z<
z8@c-m9W4yJQ>cD0`&9Uun$22XlmGnelh)jGuuQ-;P^w!ayhUSXz>Rg4hW>XG*SY+e
z+oPHDde3LREgKs0=Ps!&f2Z7kEKz}NrkMYe6&%xpB>t|x9+B{LOV#3wN$**XhZN0f
zeb`|$$D{VerHJ1*pF4G{GK%yk2*t|!H`up`#xO0qmr%YeRA+%i;FFCNGSBVWYFg6G
z_;Li-o!oIEcZF3`;fkxZ**>Octu8vAb>^5nIpmTXr;DuV|1*BBk%_;1{EyE0)E8YC
zI5+>&av`QgkNGZo`o7uQb!p1-Ha-D`>C1AJ&Ys^;(cZ#zD7V2=?M>B1spSFsGm@WP
zn9HK|SVls=e`%rEqAF|lbC-jaxurihUzFbWJaGMoHj&d)11}2P>q}jHXGWNKM3`Sy
z_e3wn?1_`Y!Zcm^<~?1)a4*6}RC0yxxeXSk1v{Tydm%fGg^xS?=F>@S(?sVTN?gQw
zEHx+l@z>dlnKv!o@9DNrPE+$=T43akX^g8aqH{iI&l9UlP%`q%_Dnrux|xCLvz|#*
zna|un`J#LUY2!l?IS!#Y*B;DrKW->{=Gv*s=eA2<uhxEiw5oQG-MZVklPzX;l(@Di
ze(8;^(e;V%FJEsi-JIpS;+jO-+Sl7x+`6i};+mCA-QMd9;}+aiyuQ1(s=4OSz8ob>
z(N43s=Wgflmnlu_TC#lEqt3kk4%_Q5I3@DxZr^pb{mCfzz<Zh3b+H}07pW@<M$cEj
zBNjd9#_0^ByKg7<Sv<?*FKshD9DFxTqc~x+jAp7%9Y?2@*xn;k6K553*~>Vt2;6_E
zFkMG#rq|u8`<#wkx|^9eVU}8ZkoT@^U8O5|yME{0|Kh@O=E}*C%k$<fOPn{)&vlaU
z2irw90>L6r9j|KNxf&R{vupXggL_t)eY;w<+9UsQ^Sqc%E~}n92mCWQesRkpKVOxK
zZ361;1v*xuy_z$;?F7q(4pqc0K09w#$MGOeS6|ghFFB_^SJ3O``eFRBM5$|qP;kQa
ztBt2i<t92FkC8UL>h$#T0T)HTy9IXzL$8!1C7p8hZeDv><^soY;Sh#hO6^{getLfw
zXl&BI_+?h!4Ey<+_wH4Rn95x~9&{`sXO*Sc>>lxBk4|cGZ@w>DKKIQhK9(;o^2`Rw
zI;>^Z|GM0`lOr}S)v%Fe)!Vl1Sc~{<p@@4|C(h`qUYneyG%-!{kDIdn-F5o=|1TFh
z%-p*?mVMvfl%%9bDgX1g9R5Gs@A%~Bk4%b<qMq!mJN4K8-cS8myr*v&ZrxP9?Q6)Z
z7f=7Q-@HBVf1;9M;j{nJ$F^?SV_`Y9{^L&Z`M=-oES~@4i2A;tXY<XZcz1l9CI4@+
z_ygwTAKdTfS3k6`e<Ld|^K<6(J==fHTL15D`@R1s%<u2}d%o`FTXD5{625;EpRmuL
zSAB4&_Vz8>>ERuxkN=l-zwN)gFYeELk7G7}<kkQ6tE->;QO_a%`2Wq~{cj%sXTSAB
z9%QyW!~gn!*7}wAC$HZB=h^=c)9e2%o<5_0-=FLAD{trjx%&Rk@&1}Oo&UE6{mlEd
z{`vk7%l@jzeTn~mtp303`+m`TmO=Nbyx#@>zPvwu&!@>x#cN)^uY2x3|JTRM(Tl&w
z`tE<;Z@2UN(eO3z_FvwxzrOPC>6z{Nwx4caH>&?}C3ya?GmrQGytLf@gS7qcb^Xic
z?Wp?Nd|s#a=S}bVzrXBW_xHoi?S1<mt@PKe`M+}M`4{nZN6)YL|99#B4~MMfe*Adz
zuDb5EEq~3Q&-*`VcYZEk_arO7=FQ3DaewpoeJi*BSNQJEOpjNEKR?-TT`p(2)T-)Z
zz0K4&5B_KTdh_SIf!?wI;<tbNzvwRi_2YlnNB@%_{rCU#i`(wk)%(Bhoqk;ZdD5Zl
zao>(y|Nrdn{a=^9b=Q5EcxbQwzwhOHG9I11|6}6EtMB(G{`wrRasL~C|9<2Dcjf<8
ze34zh!lrCSRP~Ri<$vziNB+9@TfXM1`~9!2+yC8M|L^tx&lNvy_lH#+w*LR<q<!t>
zukUU4e){oyU*W@FcfQUyzW=N7yPa+1pY#7yO0s^o{X5lu@9)9#`xeQmn&IXD>|<wZ
zv;1E!ES&zwzGt=d|LyDlr~mmsxvKK#e&fs6US7Ev{NKN1-T#lBFC_o-KTP`bf0x{!
z|5lIw^K<{LpZWTKzQW)C@eTjvE2X~t7q^}B@3ni~@1ylKU-!Rwrhd-;^V0nl-!@*4
zt;qP&`(38?PxJmS@Be)fxBqeSc-$}koqPH7Yb$<VUERO$`)m1GRjIFP>%TgDiBJ9a
zNjm=b{b$$jPpNwLwEq8<t<7iN+g1C{uD|~N-vj3V-=6c?{r35q&VO3|#~p3))A_&8
zN-sWN_vX^&?X|zO^Z%ZypZ)L6_I<zBPQUx{?dtjda<(5f9TDIEcX52h*Bf)S*VlbL
zmh4~mVx#fZ{rgX!{(o;t{qjin^Iz@nCH`N&IQ{4Rwj#rS^`ZR#>P0`+GyeR4xYgYL
z=f&Sw+volJXdGX8TKxZu-1Rf7J_`5md6=L7|8ITO`}y`i`}cp^yZhh2RQaEO#Mdpq
zIyF81>&Cs)#b32X{aI<h|I3g1s!!ql>({=i{Z_y4ssEMh`FDOCz5n~p(f76K-}(O?
zH$QVV{ocRy`~Tjp|9kSk^nHuuTZ!@N>;Er*&djm-pZ}8c*ZwEQ+`az4?DzkizyCe=
z?pphQ`Rl*j+y5<pl>Yj^!Mb;^>#hIKU;E#F<@D+QvnyU4>N4^F`jr29)yI0Rm-qjx
z|MOQBN`L;pt?;hci><udS8kqmRU>JY!_>fTt$R-vT$;&L)$O#oD&yj7C(Y?)E`d|H
zci&oQwb;%kPA@#?uGIcTF&8Sn+~Yf3+|n;|*!a1APX4-{`Qgg14(A{F^H^AT%IB}W
z;UQ0(E*hAg`TDH#Mn=NHpW6GZqIS1CuJUMKu_!|8deap{N$xoJrICC=M?;KU%vXKd
zeX(acU&{BzN#b0MuQ&{!p7jc@vtPxke4(c01-n`S{}DOGUkhjV{&k3v<BwzKn3J}^
zO0D^N;JT~cjmNY^lg@Q7O-L4PW1rnta%=5-xou2W1sBPGT_l-dcj(H*?Wam_8VMfL
zx>3`z;_#IZ1rtkNZ9T>Q(IIvwSDYuO-Kn^X+GlNV%3R_)p_sVqBG(DUg>6~e#WGlD
zcC|^ZPLL5wVqN*d*Z4w2tHRx`&`r#qlLeAPH$^q7Tyt4b_vYmD&qZrRJ2t2ZD~8;w
zS(_mxdUKZZQM2Z=o)XGSF7l{}T~;*NIZg6}6UXMZDQydN*<zdyt$C$dY(FDcdXfB$
zMG67-PHTc$o%gY&h^*dy>G|R)u5I_)9`tv`uJQVwK4Ysxwugk=mF`}L8o9Qz*UQ4D
zto>?M&fmOtyJAZ9Nj=udZy){=>?k|@g*n6g#+>$zCEuFPR!Zz@s`H4?p3V66qQU3D
zb&`$01W(1C7H2x^u5o;6EYGu<oXO2MjymkBUSY-biYM{SoTRmaXQai`&b>`C*sJ0r
z8>)R_PWwjdkF~v*t~)x&uILk}$>Vp_*PMPf!K$>Q?#kz@3H#av{$_+V-+Ym1^C-aG
zV6(B0Y?-M*y-%ye>LlYEH7y%?XK~)#ZQ0%JeRHSf&E1w$vovSqn|!Fz(bLOc7e9IJ
z?<s8yw%_*s`OST47W=J(+=rW|E)vW*clhlV8J5MX4fgF=baBGH{%L|a=MH~N*kI*!
z!ew(N+iK-A>vA{B_^7qb_?)JxUu!pu@$Kh;M&UFAJO1aBC+5!&FKfP;b@1(qqetKV
zJj;5sTH$P(LZPVE3P<DSl~*1{7+mOSzhRLfR^A*Ln7HE(*RzQ;xi0r7aFwo*Tz~rh
zpNz0()=8~`VZXNq8MwP?wEG;;<WF{C?T+DEI$46f@z2l18dZhj=Czv>Uu|Go_jF;)
z)p<3w2QxgUt6bo}>9jq_CgbI%<6K%3<6J$t#f$`(@x|_&?SK7s<F<2$cSvZJ{(P6b
zcO7f+{X;rioH?Ey*}!x2(JIT92e&4fv4}VS+3>;ZF4qyc#E`qoQh62USxL-pzZJWY
zX{}u1lu2R6H=fnZIJ+*9CDN>$k@=mI#plE|OqvA?&&*EJy>QIk!g#G%kF8VBR5jZN
zd4+|g-?9`Q+h2L+b->|VfFs+kuN^sd`R{HunzR}GW!N0KFFBn5*$%GY_Q*?2JG~BN
z6jWV!Fje61hPH$UFC3fgoId=#^yk*DFA6fr9MW5Tjc<JHH^}OgD>$ssqmw!7Q~#+M
zpPnxc+TOg=g?V*BcenKC?|CP$Np^j0nEm;oU(~7amF-15MmLtZXl$+JIIi%$?LpT1
z8`YD3GQZL|@%^ow4BPDf0J|*Z1cSgCyw4jpu27s-d_ebZ$mO>+8!Xxk<QkGT7_=EI
zPigXVpRt&Sar^AU8J$y?<@}e(C^-H3VAw%};JD39g$WYe%k!QzN6IUzB<;O1A<jKn
zV_)pehh8gU*Md^d-wE%9Su<7dR$i5HI>KJV_3Rvfpu6dcLOCrjlN)o|i+;UflU{9L
zz11Q7l5DN$ZpB*dRT5vmBuo6;@NLQbUm7<*CbUJ(n0(H;BVaX)jiZ>>sRWMYU(Plh
zOOVLjE^%R^px13)iLZh|aVPtA44W+v9hPVowSG|3QaJ4j^SpWdj=Qf3q%4vv2-fZC
z49;OY^G~47zNu|mi{(a<D<RxZ87AaQg|rpSS|RksByh$Wo`zkESU<P63wB@KQ}Qt`
zQ;sF5^6-x@ZxvgvhAolrVG@&cs_5LPZ6DZ{`SPI77lFST{E3_^c^*#S*|f`)B}~34
zEp`)sbMEDKtLcJ0R}WuF<X7Idty00(W|h&D+-V7ZM+3yZ2pmbe$fLIDP|nSyEUlMH
ztMyJU7Hpos`N#g}(SPQ@|NEZpaNRA<1JzId_Z<tmc<%fE2gS>8c1&Kk`OkgD&-K<<
zgsfOC_GQj{SM9NR$?WIK55t+}{oKv|%u%TByMwL6y!Uc5*gfCtF1)C;dV5P)cgnrJ
z0sIpVN4u^5nb{wgZ0m6BU0jN-!=iU_dn_F4-o>q8_c(nw+kx%GvAe6UGOIkC=1`;b
zy-fcK^O8H$8lqBeO;ecX(v-`&w(N7(X$AX<e!IgDv!7U`n^^kf<Yv`?veovd<Wxep
z^?ZE5u3g1@f}wL`^+GuX`Lgwlk_x<K`eE`4zf1KyZ9Oh!bKcP?iv2D%@nBGlcSMbA
zS~lma-5wctyBXL|B<nh+O;>pp@VE1g<D^jUjIAdEL5^9nY?^_BlJeG`jn6pcRWEEk
zVXu35#<R@jsvCMvnCUkDaG8|JIcxq2-MigRY#y4rhu^&LZ<bPN+|m-(z2~BkhRc%f
zX$OqX{+qJdagy_C1FH(Z49R`E^SGi8MRfCAFbep-{SDuw_mRg;KAD`~%a+pc=A4j^
z>clIN$F!2OYi}AeFDaO|VNv&)vqB-|6E{RUt#+N4#`(^F;=D+<ta(#+iZAA$&=c7t
zq*G)tf7kA#zI$~Je%CY7n{V}TXXi9k4Q|!SS*tu&>m+MFI6hfrLyyNIouiI*7sOk6
zCKyG!t*#W9!DF7ZRe$|Wh02MlZ!|kgP6*9OQ{vv#vN7*lx;fvZ&k<ce_0Q&sNcQ>P
z)hZB{_WqFgx#pOWSw*E(vZc)B^D2B3wnQ`)$2`$`XL{vfu*m5dM|PP!-|FF^<Jiz)
zbHqqzcTN3f3A@)Ddalk<m!6g|zgy<8Q9$(HwcX4qBGWcL`IL~(nRD(lySG5K->n2r
z=0lrVPainrUv$!8t@mf%&M60kcw#4VMl@{^<7`mP*>CpLwW+gYzmSVZaNL!-9`Cdd
zUzjTPK{M#5SHO1{ws_5rlWPqhGyJSl)p@Su6MyJm^N|2u!72B%#n?|A)ppK)u3544
zhSb)5C#o7+b}zS6$eR}{Y4`Epq62IvS7|p&yBfuEt`)N^Nu9w`72h|((de01K*1Ng
z@6Xsz^lLljU;lmQshooJx}FXu=X=k@&(~@vJ6``?%*a3CWth`y*QRJmIsbXrzg;nv
zF`v7(B{e){<5a<<i&LJ5O{hGvT>t$i1<5ScEmi*WtV5qHo@%JTnrUY@u{NwN{n874
zKBby<k(^c=JPfr}XQ|%5J}>V_%O;^?i*Gy+;GbX@*7Qzg)3H+=8y=iYs^&exV40+<
z@lMHf4U2vE2@Y+>Qs-s;{y`0`v%iJ5wd$RXR-3fPYs25!pSJBNuk;G%jEdaqzqqi0
zWu4I-uHCh~Clp>rsRneMxTNJ+s`agMTYAHsH9{T!OOoEURyFXfF|v90S9ZOG%KcR>
zVYB~A8a1bcPhI%&>-Mv@9(tjYmovUS{VJnUyo!f;@4fqxXBa;%@e=T_s=qDWoZ>pw
z@p^6ELjDQNp-inNPhTDott|XG)$Z{p_S5;dvVGV*vbB_x8q<xZK3KQ)>CxMvDY6;`
z!PC5MxQWm7QZ-oO5unxRbn25!nQNTNE_LpeJZ)2!hjh(ZY;^7G-F*^86L=OIRm@cv
zo4S!*`?B@D>C9OZ-YgVSnc^X(l_>4=glnpz+pFc-e#vPUHviavIdG?+^}qAe|8JhR
zK4baZKc8dP|Cv9-)cEea|He~2j-2~c&-YMD;lFyI_kkz#-FF3E=6$;(E<;8nYU`}D
z?nzhI9-UdCQkq(3R?VupXNG>*)=Pb9Z{EK6+U2~5fB(mGPp_)FhNg#4n|>|r-1)WX
zn_sVfes$;9v#n>Io%#8q()I4GIrA;~9X5Kn>L31obLyKjKe;W}e17577h3)B$DyCQ
zC)j&f-F+3gqjdW8|39C5T-@ZhwNLJky!VkuvVZ2!^O*nfzkpuqpR&?8<2TbPSLBJV
z?sZ#xA>+-er)`O=cP)LF8Njz~Lfq-utL_Fom;Rc@?Za3q8YX!;ApCP#X_W4@*So5I
z?+}Wddp0igp_LNL^wX6LHgm$xmtQNW^Vw<=tRElPZ+WB0z@Vxq{<3yxb(F42ma2=%
z_I;ZiPOu$qIlSolY}2)T4FMcMYuCtUEImE#U&pd%y+T|k_pE)NsWmO)#_zRPZ%&<h
z;_I7Fw|eLQue`@lRTE`vu_Nc|=dDr+Y5t|P9rllHwwUhUxo6_tsD1XAzp2==Pkvyt
zbH~1UvC-$#{HnyBA34~ye`B7;%;>nTHD~hlQf=<9w`PqqG59aqyKrIqF8k7gnfAx$
z?b=n#q;%Q!%G;UDjqScJD+6;L+Qe*|6&0xe+V$!t{>0S4?%rL?q;|YJ@Zo-zpVjVj
W>o&iBQ&kuHU!FzCsF`67F9QH=o-mRC

diff --git a/cfortran.doc b/cfortran.doc
index b392167..6c6f4b3 100644
--- a/cfortran.doc
+++ b/cfortran.doc
@@ -1,12 +1,14 @@
-/* cfortran.doc 3.9 */         /* anonymous ftp@zebra.desy.de */
-/* Burkhard Burow  burow@desy.de                 1990 - 1997. */
+/* cfortran.doc 4.3 */
+/* www-zeus.desy.de/~burow   OR   anonymous ftp@zebra.desy.de */
+/* Burkhard Burow  burow@desy.de                 1990 - 1998. */
 
 
               cfortran.h :  Interfacing C or C++ and FORTRAN
 
 Supports: Alpha and VAX VMS, Alpha OSF, DECstation and VAX Ultrix, IBM RS/6000, 
           Silicon Graphics, Sun, CRAY, Apollo, HP9000, LynxOS, Convex, Absoft,
-          f2c, g77, NAG f90, PowerStation Fortran with Visual C++, NEC SX-4.
+          f2c, g77, NAG f90, PowerStation Fortran with Visual C++, NEC SX-4,
+          Portland Group.
 
 C and C++ are generally equivalent as far as cfortran.h is concerned.
 Unless explicitly noted otherwise, mention of C implicitly includes C++.
@@ -95,7 +97,8 @@ cfortran.doc, the engine cfortran.h, examples in cfortest.c and
 cfortex.f/or. [cfortex.for under VMS, cfortex.f on other machines.]
 
 The cfortran.h package continues to be developed. The most recent version is
-available via anonymous ftp at zebra.desy.de (131.169.2.244).
+available via www at http://www-zeus.desy.de/~burow
+or via anonymous ftp at zebra.desy.de (131.169.2.244).
 
 The examples may be run using one of the following sets of instructions:
 
@@ -122,6 +125,7 @@ N.B. If using a C main(), i.e. Fortran PROGRAM is not entry of the executable,
      
 
 RS/6000> # Users are strongly urged to use f77 -qextname and cc -Dextname
+RS/6000> # Use -Dextname=extname if extname is a symbol used in the C code.
 RS/6000> xlf -c -qextname cfortex.f
 RS/6000> cc  -c -Dextname cfortest.c
 RS/6000> xlf -o cfortest cfortest.o cfortex.o && cfortest 
@@ -184,6 +188,7 @@ HP9000> #    Depending on the compiler version, you may need to include the
 HP9000> #    option '-tp,/lib/cpp' or worse, you'll have to stick to the K&R C.
 HP9000> #    [See Section II o) Notes: HP9000]
 HP9000> # Users are strongly urged to use f77 +ppu and cc -Dextname
+HP9000> # Use -Dextname=extname if extname is a symbol used in the C code.
 HP9000> CC  -Dextname -c cfortest.c
 HP9000> f77 +ppu         cfortex.f  -o cfortest cfortest.o && cfortest
 HP9000> # Older f77 may need
@@ -193,12 +198,16 @@ HP9000> CC -o cfortest cfortest.c cfortex.o -lI77 -lF77 && cfortest
 HP0000> # If old-style f77 +800 compiled objects are required:
 HP9000> # #define hpuxFortran800
 HP9000> cc -c -Aa -DhpuxFortran800 cfortest.c
-HP9000> f77 +800 -o cfortest cfortex.f
+HP9000> f77 +800 -o cfortest cfortest.o cfortex.f
 
 f2c> # In the following, 'CC' is any C compiler.
 f2c> f2c -R cfortex.f
 f2c> CC -o cfortest -Df2cFortran cfortest.c cfortex.c -lf2c  &&  cfortest
 
+Portland Group $ # Presumably other C compilers also work.
+Portland Group $ pgcc -DpgiFortran -c cfortest.c
+Portland Group $ pgf77 -o cfortest cfortex.f cfortest.o && cfortest
+
 NAGf90> # cfortex.f is distributed with Fortran 77 style comments.
 NAGf90> # To convert to f90 style comments do the following once to cfortex.f: 
 NAGf90> mv cfortex.f cf_temp.f && sed 's/^C/\!/g' cf_temp.f > cfortex.f
@@ -221,6 +230,9 @@ AbsoftUNIX> # Absoft f77 -k allows Fortran routines to be safely called from C.
 AbsoftUNIX> gcc -ansi -Wall -O -c -DAbsoftUNIXFortran cfortest.c
 AbsoftUNIX> f77 -k -o cfortest cfortest.o cfortex.f && cfortest
 
+AbsoftPro> # Absoft Pro Fortran for MacOS
+AbsoftPro> # Use #define AbsoftProFortran
+
 CLIPPER> # INTERGRAPH CLIX using CLIPPER C and Fortran compilers.
 CLIPPER> # N.B. - User, not cfortran.h, is responsible for
 CLIPPER> #        f77initio() and f77uninitio() if required.
@@ -397,16 +409,16 @@ o) Notes:
 o Specifying the Fortran compiler
   cfortran.h generates interfaces for the default Fortran compiler. The default
 can be overridden by defining, 
-     . in the code, e.g.           #define    NAGf90Fortran
+     . in the code,              e.g.: #define    NAGf90Fortran
   OR . in the compile directive, e.g.: unix> cc -DNAGf90Fortran
 one of the following before including cfortran.h:
  NAGf90Fortran   f2cFortran  hpuxFortran  apolloFortran  sunFortran
   IBMR2Fortran  CRAYFortran  mipsFortran     DECFortran  vmsFortran
  CONVEXFortran       PowerStationFortran          AbsoftUNIXFortran
-     SXFortran
+     SXFortran   pgiFortran                        AbsoftProFortran
 This also allows crosscompilation.
-If wanted, NAGf90Fortran, f2cFortran, DECFortran and AbsoftUNIXFortran
-must be requested by the user.
+If wanted, NAGf90Fortran, f2cFortran, DECFortran, AbsoftUNIXFortran,
+AbsoftProFortran and pgiFortran must be requested by the user.
 
 o /**/
   cfortran.h (ab)uses the comment kludge /**/ when the ANSI C preprocessor
@@ -580,6 +592,7 @@ o RS/6000
   Using "xlf -qextname ...", which appends an underscore, '_', to all FORTRAN
 external references, requires "cc -Dextname ..." so that cfortran.h also
 generates these underscores.
+Use -Dextname=extname if extname is a symbol used in the C code.
 The use of "xlf -qextname" is STRONGLY ENCOURAGED, since it allows for
 transparent naming schemes when mixing C and Fortran.
 
@@ -587,6 +600,7 @@ o HP9000
   Using "f77 +ppu      ...", which appends an underscore, '_', to all FORTRAN
 external references, requires "cc -Dextname ..." so that cfortran.h also
 generates these underscores.
+Use -Dextname=extname if extname is a symbol used in the C code.
 The use of "f77 +ppu"      is STRONGLY ENCOURAGED, since it allows for
 transparent naming schemes when mixing C and Fortran.
 
@@ -607,7 +621,7 @@ cfortran.h has to be informed that K&R C is to being used, e.g.
 HP9000> cc -D__CF__KnR -c source.c
 
 o AbsoftUNIXFortran
-By default, cfortran.h follows the default AbsoftUNIXFortran and prepends _C
+By default, cfortran.h follows the default AbsoftUNIX/ProFortran and prepends _C
 to each COMMON BLOCK name. To override the cfortran.h behavior
 #define COMMON_BLOCK(UN,LN) before #including cfortran.h.
 [Search for COMMON_BLOCK in cfortran.h for examples.]
@@ -757,7 +771,7 @@ CCALLSFFUNn(ROUTINE_NAME,routine_name,argtype_1,...,argtype_n, \
                          argname_1,..,argname_n) 
 
 Where:
-'n' = 0->14 [SUBROUTINE's ->20] (easily expanded in cfortran.h to > 14 [20]) is 
+'n' = 0->14 [SUBROUTINE's ->27] (easily expanded in cfortran.h to > 14 [27]) is 
     the number of arguments to the routine.
 Routine_name = C       name of the routine (IN UPPER CASE LETTERS).[see 2.below]
 ROUTINE_NAME = FORTRAN name of the routine (IN UPPER CASE LETTERS).
@@ -991,7 +1005,7 @@ See ii) 4. of this section for when and how to redefine fcallsc.
 ROUTINE was introduced with cfortran.h version 2.6. Earlier versions of
 cfortran.h used PVOID to pass external procedures as arguments. Using PVOID for
 this purpose is no longer recommended since it won't work 'as is' for
-apolloFortran, hpuxFortran800, AbsoftUNIXFortran.
+apolloFortran, hpuxFortran800, AbsoftUNIXFortran, AbsoftProFortran.
 
 7. CRAY only: 
 In a given piece of source code, where FFUNC is any FORTRAN routine,
@@ -1019,7 +1033,7 @@ for all other C functions:
 FCALLSCFUNn(routine_type,Routine_name,ROUTINE_NAME,routine_name,argtype_1,...,argtype_n)
 
 Where:
-'n' = 0->14 (easily expanded to > 14) stands for the number of arguments to the 
+'n' = 0->27 (easily expanded to > 27) stands for the number of arguments to the 
     routine.
 Routine_name = the C       name of the routine. [see 9. below]
 ROUTINE_NAME = the FORTRAN name of the routine (IN UPPER CASE LETTERS).
@@ -1218,7 +1232,7 @@ e.g. To create a Fortran wrapper for qsort(3C):
 FCALLSCSUB4(qsort,FQSORT,fqsort,PVOID,INT,INT,ROUTINE)
 
 In order to maintain backward compatibility, cfortran.h defines a generic cast
-for ROUTINE_1, ROUTINE_2, ..., ROUTINE_14. The user's definition is therefore
+for ROUTINE_1, ROUTINE_2, ..., ROUTINE_27. The user's definition is therefore
 strictly required only for DEC C, which at the moment is the only compiler
 which insists on the correct cast for pointers to functions.
 
@@ -1292,7 +1306,7 @@ element beginning with 2 blank, ' ', characters.
                 -------------     
    ROUTINE NAMES WHICH ARE UNDISTINGUISHABLE FROM C ROUTINE NAMES
    i.e. VAX VMS
-        AbsoftUNIXFortran
+        AbsoftUNIXFortran (AbsoftProFortran ok, since it uses Uppercase names.)
         HP9000      if not using the +ppu      option of f77
         IBM RS/6000 if not using the -qextname option of xlf
    Call them the same_namespace compilers.
@@ -1883,7 +1897,6 @@ Aside: The Visual C++ compiler is happy with UN, but barfs on (UN),
        so either (UN) causes nonstandard C/C++ or Visual C++ is broken.
 
 
-
 VII History and Acknowledgements
 --------------------------------
 
@@ -1969,6 +1982,17 @@ VII History and Acknowledgements
     - CRAY: Avoid bug of some versions of the C preprocessor.
     - CRAY T3E: FORTRAN_REAL introduced.
 
+4.0 - new/delete now used for C++. malloc/free still used for C.       Jan. '98
+    - FALSE no longer is defined by cfortran.h .
+    - Absoft Pro Fortran for MacOS supported.
+4.1 - COMMA and COLON no longer are defined by cfortran.h .            April'98
+    - Bug fixed when 10th arg. or beyond is a string.
+      [Rob Lucchesi of NASA-Goddard pointed out this bug.]
+    - CCALLSFSUB/FUN extended from 14 to 27 arguments.
+    - Workaround SunOS CC 4.2 cast bug. [Thanks to Savrak SAR of CERN.]
+4.2 - Portland Group needs -DpgiFortran . [Thank George Lai of NASA.]  June '98
+4.3 - (PROTO)CCALLSFSUB extended from 20 to 27 arguments.              July '98
+
 
 ['Support' implies these and more recent releases of the respective
  OS/compilers/linkers can be used with cfortran.h. 
@@ -1985,7 +2009,7 @@ Acknowledgements:
   to have C++ call Fortran. This was the starting point for full C++ in 3.4.
 - Glenn P.Davis of University Corp. for Atmospheric Research (UCAR) / Unidata
   supported the NEC SX-4 port and helped understand the CRAY.
-- Tony Goelz of Absoft Corporation ported cfortran.h to Absoft UNIX Fortran.
+- Tony Goelz of Absoft Corporation ported cfortran.h to Absoft.
 - Though cfortran.h has been created in my 'copious' free time, I thank 
   NSERC for their generous support of my grad. student and postdoc years.
 - Univ.Toronto, DESY, CERN and others have provided time on their computers.
diff --git a/cfortran.h b/cfortran.h
index 77b1b82..abdeb43 100644
--- a/cfortran.h
+++ b/cfortran.h
@@ -1,5 +1,6 @@
-/* cfortran.h  3.9 */          /* anonymous ftp@zebra.desy.de */
-/* Burkhard Burow  burow@desy.de                 1990 - 1997. */
+/* cfortran.h  4.4_cernlib2002 */
+/* http://www-zeus.desy.de/~burow/cfortran/                   */
+/* Burkhard Burow  burow@desy.de                 1990 - 2002. */
 
 #ifndef __CFORTRAN_LOADED
 #define __CFORTRAN_LOADED
@@ -15,13 +16,16 @@
       Oct 1997: Changed symbol name extname to appendus (PDW/HSTX)
                 (Conflicted with a common variable name in FTOOLS)
       Nov 1997: If g77Fortran defined, also define f2cFortran (PDW/HSTX)
-      Nov 1997: Define MIN(A,B) as _cfMIN(A,B)
       Feb 1998: Let VMS see the NUM_ELEMS code. Lets programs treat
                 single strings as vectors with single elements
-      Jun 2000: Add linux/gcc environment detection
+      Nov 1999: If macintoxh defined, also define f2cfortran (for Mac OS-X)
+      Apr 2000: If WIN32 defined, also define PowerStationFortran and
+                VISUAL_CPLUSPLUS (Visual C++)
+      Jun 2000: If __GNUC__ and linux defined, also define f2cFortran
+                (linux/gcc environment detection)
+      Apr 2002: If __CYGWIN__ is defined, also define f2cFortran
+      Nov 2002: If __APPLE__ defined, also define f2cfortran (for Mac OS-X)
  *******/
-#define MIN(A,B) _cfMIN(A,B)
-
 /* 
   Avoid symbols already used by compilers and system *.h:
   __ - OSF1 zukal06 V3.0 347 alpha, cc -c -std1 cfortest.c
@@ -86,15 +90,14 @@ only C calling FORTRAN subroutines will work using K&R style.*/
 
 /* Remainder of cfortran.h depends on the Fortran compiler. */
 
-#if defined(CLIPPERFortran) || defined(g77Fortran) || defined(pgiFortran)
-                               /* 11/03/97 PDW */      /* 04/13/00 DM */
+#if defined(CLIPPERFortran) || defined(pgiFortran)
 #define f2cFortran
 #endif
 
 /* VAX/VMS does not let us \-split long #if lines. */ 
 /* Split #if into 2 because some HP-UX can't handle long #if */
 #if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran))
-#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(SXFortran))
+#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran))
 /* If no Fortran compiler is given, we choose one for the machines we know.   */
 #if defined(lynx) || defined(VAXUltrix)
 #define f2cFortran    /* Lynx:      Only support f2c at the moment.
@@ -102,14 +105,23 @@ only C calling FORTRAN subroutines will work using K&R style.*/
                            Support f2c or f77 with gcc, vcc with f2c. 
                            f77 with vcc works, missing link magic for f77 I/O.*/
 #endif
-#if defined(WIN32)            /*  04/13/00 DM: Add these lines for NT with */
-#define PowerStationFortran   /*    PowerStationFortran and and Visual C++ */
+#if defined(WIN32) && !defined(__CYGWIN__) /* 04/13/00 DM: Add these lines for NT */
+#define PowerStationFortran   /*    with PowerStationFortran and and Visual C++ */
 #define VISUAL_CPLUSPLUS
 #endif
+#if defined(g77Fortran)   /* 11/03/97 PDW */
+#define f2cFortran
+#endif
+#if        defined(__CYGWIN__) /* 04/11/02 LEB */
+#define       f2cFortran 
+#endif
 #if        defined(__GNUC__) && defined(linux) /* 06/21/00 PDW */
 #define       f2cFortran 
 #endif
-#if defined(macintosh)
+#if defined(macintosh)     /* 11/1999 */
+#define f2cFortran
+#endif
+#if defined(__APPLE__)     /* 11/2002 */
 #define f2cFortran
 #endif
 #if defined(__hpux)             /* 921107: Use __hpux instead of __hp9000s300 */
@@ -150,7 +162,7 @@ only C calling FORTRAN subroutines will work using K&R style.*/
 
 /* Split #if into 2 because some HP-UX can't handle long #if */
 #if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran))
-#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(SXFortran))
+#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran))
 /* If your compiler barfs on ' #error', replace # with the trigraph for #     */
  #error "cfortran.h:  Can't find your environment among:\
     - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...)     \
@@ -171,8 +183,9 @@ only C calling FORTRAN subroutines will work using K&R style.*/
     -            NO fort. None of gcc, cc or vcc generate required names.\
     - f2c    : Use #define    f2cFortran, or cc -Df2cFortran             \
     - NAG f90: Use #define NAGf90Fortran, or cc -DNAGf90Fortran          \
-    - g77 v0.5.18 for linux                                              \
-    - Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc -DAbsoftUNIXFortran"
+    - Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc -DAbsoftUNIXFortran \
+    - Absoft Pro Fortran: Use #define AbsoftProFortran \
+    - Portland Group Fortran: Use #define pgiFortran"
 /* Compiler must throw us out at this point! */
 #endif
 #endif
@@ -185,11 +198,11 @@ only C calling FORTRAN subroutines will work using K&R style.*/
 
 /* Throughout cfortran.h we use: UN = Uppercase Name.  LN = Lowercase Name.   */
 
-#if defined(f2cFortran) || defined(NAGf90Fortran) || defined(DECFortran) || defined(mipsFortran) || defined(apolloFortran) || defined(sunFortran) || defined(CONVEXFortran) || defined(SXFortran) || defined(appendus)  /* 10/31/97 PDW */
+#if defined(f2cFortran) || defined(NAGf90Fortran) || defined(DECFortran) || defined(mipsFortran) || defined(apolloFortran) || defined(sunFortran) || defined(CONVEXFortran) || defined(SXFortran) || defined(appendus)
 #define CFC_(UN,LN)            _(LN,_)      /* Lowercase FORTRAN symbols.     */
 #define orig_fcallsc(UN,LN)    CFC_(UN,LN)
 #else 
-#if defined(CRAYFortran) || defined(PowerStationFortran)
+#if defined(CRAYFortran) || defined(PowerStationFortran) || defined(AbsoftProFortran)
 #ifdef _CRAY          /* (UN), not UN, circumvents CRAY preprocessor bug.     */
 #define CFC_(UN,LN)            (UN)         /* Uppercase FORTRAN symbols.     */
 #else                 /* At least VISUAL_CPLUSPLUS barfs on (UN), so need UN. */
@@ -220,18 +233,18 @@ only C calling FORTRAN subroutines will work using K&R style.*/
 #ifndef COMMON_BLOCK
 #ifndef CONVEXFortran
 #ifndef CLIPPERFortran
-#ifndef AbsoftUNIXFortran
+#if     !(defined(AbsoftUNIXFortran)||defined(AbsoftProFortran))
 #define COMMON_BLOCK(UN,LN)          CFC_(UN,LN)
 #else
 #define COMMON_BLOCK(UN,LN)          _(_C,LN)
-#endif
+#endif  /* AbsoftUNIXFortran or AbsoftProFortran */
 #else
 #define COMMON_BLOCK(UN,LN)          _(LN,__)
-#endif
+#endif  /* CLIPPERFortran */
 #else
 #define COMMON_BLOCK(UN,LN)          _3(_,LN,_)
-#endif
-#endif
+#endif  /* CONVEXFortran */
+#endif  /* COMMON_BLOCK */
 
 #ifndef DOUBLE_PRECISION
 #if defined(CRAYFortran) && !defined(_CRAYT3E)
@@ -289,7 +302,7 @@ only C calling FORTRAN subroutines will work using K&R style.*/
 #endif
 
 #ifndef apolloFortran
-#define COMMON_BLOCK_DEF(DEFINITION, NAME) extern DEFINITION NAME
+#define COMMON_BLOCK_DEF(DEFINITION, NAME) DEFINITION NAME
 #define CF_NULL_PROTO
 #else                                         /* HP doesn't understand #elif. */
 /* Without ANSI prototyping, Apollo promotes float functions to double.    */
@@ -309,6 +322,22 @@ only C calling FORTRAN subroutines will work using K&R style.*/
 #define CF_NULL_PROTO  ...
 #endif
 
+
+#ifndef USE_NEW_DELETE
+#ifdef __cplusplus
+#define USE_NEW_DELETE 1
+#else
+#define USE_NEW_DELETE 0
+#endif
+#endif
+#if USE_NEW_DELETE
+#define _cf_malloc(N) new char[N]
+#define _cf_free(P)   delete[] P
+#else
+#define _cf_malloc(N) (char *)malloc(N)
+#define _cf_free(P)   free(P)
+#endif
+
 #ifdef mipsFortran
 #define CF_DECLARE_GETARG         int f77argc; char **f77argv
 #define CF_SET_GETARG(ARGC,ARGV)  f77argc = ARGC; f77argv = ARGV
@@ -321,17 +350,14 @@ only C calling FORTRAN subroutines will work using K&R style.*/
 #pragma standard                         
 #endif
 
-#define ACOMMA ,
-#define ACOLON ;
+#define AcfCOMMA ,
+#define AcfCOLON ;
 
 /*-------------------------------------------------------------------------*/
 
 /*               UTILITIES USED WITHIN CFORTRAN.H                          */
 
 #define _cfMIN(A,B) (A<B?A:B)
-#ifndef FALSE
-#define FALSE (1==0)
-#endif
 
 /* 970211 - XIX.145:
    firstindexlength  - better name is all_but_last_index_lengths
@@ -351,16 +377,16 @@ Apollo                                           : neg.   = TRUE, else FALSE.
 [DECFortran for Ultrix RISC is also called f77 but is the same as VAX/VMS.]   
 [MIPS f77 treats .eqv./.neqv. as .eq./.ne. and hence requires LOGICAL_STRICT.]*/
 
-#if defined(NAGf90Fortran) || defined(f2cFortran) || defined(mipsFortran) || defined(PowerStationFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) || defined(SXFortran)
+#if defined(NAGf90Fortran) || defined(f2cFortran) || defined(mipsFortran) || defined(PowerStationFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran) || defined(SXFortran)
 /* SX/PowerStationFortran have 0 and 1 defined, others are neither T nor F.   */
 /* hpuxFortran800 has 0 and 0x01000000 defined. Others are unknown.           */
 #define LOGICAL_STRICT      /* Other Fortran have .eqv./.neqv. == .eq./.ne.   */
 #endif
 
 #define C2FLOGICALV(A,I) \
- do {int __i; for(__i=0;__i<I;__i++) A[__i]=C2FLOGICAL(A[__i]); } while (FALSE)
+ do {int __i; for(__i=0;__i<I;__i++) A[__i]=C2FLOGICAL(A[__i]); } while (0)
 #define F2CLOGICALV(A,I) \
- do {int __i; for(__i=0;__i<I;__i++) A[__i]=F2CLOGICAL(A[__i]); } while (FALSE)
+ do {int __i; for(__i=0;__i<I;__i++) A[__i]=F2CLOGICAL(A[__i]); } while (0)
 
 #if defined(apolloFortran)
 #define C2FLOGICAL(L) ((L)?-1:(L)&~((unsigned)1<<sizeof(int)*8-1))
@@ -371,6 +397,7 @@ Apollo                                           : neg.   = TRUE, else FALSE.
 #define F2CLOGICAL(L) _ltob(&(L))     /* Strangely _ltob() expects a pointer. */
 #else
 #if defined(IBMR2Fortran) || defined(vmsFortran) || defined(DECFortran) || defined(AbsoftUNIXFortran)
+/* How come no AbsoftProFortran ? */
 #define C2FLOGICAL(L) ((L)?(L)|1:(L)&~(int)1)
 #define F2CLOGICAL(L) ((L)&1?(L):0)
 #else
@@ -511,7 +538,6 @@ struct {                                                                       \
     long dsc$l_l;                         long dsc$l_u;                        \
   } dsc$bounds [DIMCT];                                                        \
 }
-
 typedef DSC$DESCRIPTOR_A(1) fstringvector;
 /*typedef DSC$DESCRIPTOR_A(2) fstringarrarr;
   typedef DSC$DESCRIPTOR_A(3) fstringarrarrarr;*/
@@ -625,6 +651,13 @@ return (int)num;
 #define     LONG_cfVCF(A,B)
 #define    SHORT_cfVCF(A,B)
 
+/* 980416
+   Cast (void (*)(CF_NULL_PROTO)) causes SunOS CC 4.2 occasionally to barf,
+   while the following equivalent typedef is fine.
+   For consistency use the typedef on all machines.
+ */
+typedef void (*cfCAST_FUNCTION)(CF_NULL_PROTO);
+
 #define VCF(TN,I)       _Icf4(4,V,TN,_(A,I),_(B,I),F)
 #define VVCF(TN,AI,BI)  _Icf4(4,V,TN,AI,BI,S)
 #define        INT_cfV(T,A,B,F) _(VCF_INT_,F)(T,A,B)
@@ -637,8 +670,8 @@ return (int)num;
 #define INTVVVVVVV_cfV(T,A,B,F)
 #define PINT_cfV(      T,A,B,F) _(T,_cfVP)(A,B)
 #define PVOID_cfV(     T,A,B,F)
-#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
-#define    ROUTINE_cfV(T,A,B,F) void (*B)(CF_NULL_PROTO) = (void (*)(CF_NULL_PROTO))A;
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+#define    ROUTINE_cfV(T,A,B,F) void (*B)(CF_NULL_PROTO) = (cfCAST_FUNCTION)A;
 #else
 #define    ROUTINE_cfV(T,A,B,F)
 #endif
@@ -652,8 +685,8 @@ return (int)num;
 #define   PSTRINGV_cfV(T,A,B,F) static fstringvector B =                       \
           {0,DSC$K_DTYPE_T,DSC$K_CLASS_A,NULL,0,0,{0,0,1,1,1},1,0,NULL,0,{1,0}};
 #else
-#define     STRING_cfV(T,A,B,F) struct {unsigned int clen, flen;} B;
-#define    STRINGV_cfV(T,A,B,F) struct {char *s, *fs; unsigned flen;} B;
+#define     STRING_cfV(T,A,B,F) struct {unsigned int clen, flen; char *nombre;} B;
+#define    STRINGV_cfV(T,A,B,F) struct {char *s, *fs; unsigned flen; char *nombre;} B;
 #define    PSTRING_cfV(T,A,B,F) int     B;
 #define   PSTRINGV_cfV(T,A,B,F) struct{char *fs; unsigned int sizeofA,flen;}B;
 #endif
@@ -671,13 +704,13 @@ return (int)num;
 #define   PSTRING_cfA(M,I,A,B) PSTRING_cfC(M,I,A,B,sizeof(A))
 #ifdef vmsFortran
 #define  AATRINGV_cfA(    A,B, sA,filA,silA)                                   \
- initfstr(B,(char *)malloc((sA)-(filA)),(filA),(silA)-1),                      \
+ initfstr(B,_cf_malloc((sA)-(filA)),(filA),(silA)-1),                          \
           c2fstrv(A,B.dsc$a_pointer,(silA),(sA));
 #define APATRINGV_cfA(    A,B, sA,filA,silA)                                   \
  initfstr(B,A,(filA),(silA)-1),c2fstrv(A,A,(silA),(sA));
 #else
 #define  AATRINGV_cfA(    A,B, sA,filA,silA)                                   \
- (B.s=(char *)malloc((sA)-(filA)),B.fs=c2fstrv(A,B.s,(B.flen=(silA)-1)+1,(sA)));
+     (B.s=_cf_malloc((sA)-(filA)),B.fs=c2fstrv(A,B.s,(B.flen=(silA)-1)+1,(sA)));
 #define APATRINGV_cfA(    A,B, sA,filA,silA)                                   \
  B.fs=c2fstrv(A,A,(B.flen=(silA)-1)+1,B.sizeofA=(sA));
 #endif
@@ -700,7 +733,7 @@ return (int)num;
 #define    PLONG_cfAAP(A,B) &A
 #define   PSHORT_cfAAP(A,B) &A
 
-#define AACF(TN,AI,I,C) _SEP_(TN,C,COMMA) _Icf(3,AA,TN,AI,_(B,I))
+#define AACF(TN,AI,I,C) _SEP_(TN,C,cfCOMMA) _Icf(3,AA,TN,AI,_(B,I))
 #define        INT_cfAA(T,A,B) &B
 #define       INTV_cfAA(T,A,B) _(T,VVVVVV_cfPP) A
 #define      INTVV_cfAA(T,A,B) _(T,VVVVV_cfPP)  A[0]
@@ -714,7 +747,7 @@ return (int)num;
 #if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
 #define    ROUTINE_cfAA(T,A,B) &B
 #else
-#define    ROUTINE_cfAA(T,A,B) (void(*)(CF_NULL_PROTO))A
+#define    ROUTINE_cfAA(T,A,B) (cfCAST_FUNCTION)A
 #endif
 #define     STRING_cfAA(T,A,B)  STRING_cfCC(T,A,B)
 #define    PSTRING_cfAA(T,A,B) PSTRING_cfCC(T,A,B)
@@ -771,25 +804,25 @@ return (int)num;
 #define  DEFAULT_cfW(A,B)
 #define  LOGICAL_cfW(A,B)
 #define PLOGICAL_cfW(A,B) *B=F2CLOGICAL(*B);
-#define   STRING_cfW(A,B) (A[B.clen]!='\0'?A[B.clen]='\0':0); /* A?="constnt"*/
+#define   STRING_cfW(A,B) (B.nombre=A,B.nombre[B.clen]!='\0'?B.nombre[B.clen]='\0':0); /* A?="constnt"*/
 #define  PSTRING_cfW(A,B) kill_trailing(A,' ');
 #ifdef vmsFortran
-#define  STRINGV_cfW(A,B) free(B.dsc$a_pointer);
+#define  STRINGV_cfW(A,B) _cf_free(B.dsc$a_pointer);
 #define PSTRINGV_cfW(A,B)                                                      \
   vkill_trailing(f2cstrv((char*)A, (char*)A,                                   \
                            B.dsc$w_length+1, B.dsc$l_arsize+B.dsc$l_m[0]),     \
                    B.dsc$w_length+1, B.dsc$l_arsize+B.dsc$l_m[0], ' ');
 #else
-#define  STRINGV_cfW(A,B) free(B.s);
+#define  STRINGV_cfW(A,B) _cf_free(B.s);
 #define PSTRINGV_cfW(A,B) vkill_trailing(                                      \
          f2cstrv((char*)A,(char*)A,B.flen+1,B.sizeofA), B.flen+1,B.sizeofA,' ');
 #endif
 #define  ZTRINGV_cfW(A,B)      STRINGV_cfW(A,B)
 #define PZTRINGV_cfW(A,B)     PSTRINGV_cfW(A,B)
 
-#define   NCF(TN,I,C)       _SEP_(TN,C,COMMA) _Icf(2,N,TN,_(A,I),0) 
+#define   NCF(TN,I,C)       _SEP_(TN,C,cfCOMMA) _Icf(2,N,TN,_(A,I),0) 
 #define  NNCF(TN,I,C)        UUCF(TN,I,C)
-#define NNNCF(TN,I,C)       _SEP_(TN,C,COLON) _Icf(2,N,TN,_(A,I),0) 
+#define NNNCF(TN,I,C)       _SEP_(TN,C,cfCOLON) _Icf(2,N,TN,_(A,I),0) 
 #define        INT_cfN(T,A) _(T,VVVVVVV_cfTYPE) * A
 #define       INTV_cfN(T,A) _(T,VVVVVV_cfTYPE)  * A
 #define      INTVV_cfN(T,A) _(T,VVVVV_cfTYPE)   * A
@@ -842,7 +875,7 @@ return (int)num;
 #endif
 #endif
 
-#if defined(AbsoftUNIXFortran)
+#if defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
 /* In addition to explicit Absoft stuff, only Absoft requires:
    - DEFAULT coming from _cfSTR.
      DEFAULT could have been called e.g. INT, but keep it for clarity.
@@ -872,12 +905,24 @@ return (int)num;
 #define _Z
 
 #define  CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)                \
- S(T1,1)   S(T2,2)   S(T3,3)   S(T4,4)   S(T5,5)   S(T6,6)   S(T7,7)           \
- S(T8,8)   S(T9,9)   S(TA,A)   S(TB,B)   S(TC,C)   S(TD,D)   S(TE,E)
+ S(T1,1)   S(T2,2)   S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)       \
+ S(T8,8)   S(T9,9)   S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)
+#define  CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ S(T1,1)   S(T2,2)   S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)       \
+ S(T8,8)   S(T9,9)   S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)      \
+ S(TF,15)  S(TG,16)  S(TH,17)   S(TI,18)   S(TJ,19)   S(TK,20)   S(TL,21)      \
+ S(TM,22)  S(TN,23)  S(TO,24)   S(TP,25)   S(TQ,26)   S(TR,27)
+
 #define  CFARGT14FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)           \
- F(T1,1,0) F(T2,2,1) F(T3,3,1) F(T4,4,1) F(T5,5,1) F(T6,6,1) F(T7,7,1)         \
- F(T8,8,1) F(T9,9,1) F(TA,A,1) F(TB,B,1) F(TC,C,1) F(TD,D,1) F(TE,E,1)         \
+ F(T1,1,0) F(T2,2,1) F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)     \
+ F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)    \
  M       CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define  CFARGT27FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) F(TL,21,1)  \
+ F(TM,22,1) F(TN,23,1) F(TO,24,1) F(TP,25,1) F(TQ,26,1) F(TR,27,1)             \
+ M       CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
 
 #if !(defined(PowerStationFortran)||defined(hpuxFortran800))
 /*  Old CFARGT14 -> CFARGT14FS as seen below, for Absoft cross-compile yields:
@@ -894,63 +939,95 @@ return (int)num;
        CFARGT14FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
 */
 #define  CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)             \
- F(T1,1,0) F(T2,2,1) F(T3,3,1) F(T4,4,1) F(T5,5,1) F(T6,6,1) F(T7,7,1)         \
- F(T8,8,1) F(T9,9,1) F(TA,A,1) F(TB,B,1) F(TC,C,1) F(TD,D,1) F(TE,E,1)         \
+ F(T1,1,0) F(T2,2,1) F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)     \
+ F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)    \
  M       CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
-/* F changed to Z for arg 15. Watch out if ever extend to S or Z arguments. */
-#define  CFARGT20(Z,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
- Z(T1,1,0) Z(T2,2,1) Z(T3,3,1) Z(T4,4,1) Z(T5,5,1) Z(T6,6,1) Z(T7,7,1)         \
- Z(T8,8,1) Z(T9,9,1) Z(TA,A,1) Z(TB,B,1) Z(TC,C,1) Z(TD,D,1) Z(TE,E,1)         \
- Z(TF,F,1) Z(TG,G,1) Z(TH,H,1) Z(TI,I,1) Z(TJ,J,1) Z(TK,K,1)                   \
- S(T1,1)   S(T2,2)   S(T3,3)   S(T4,4)   S(T5,5)   S(T6,6)   S(T7,7)           \
- S(T8,8)   S(T9,9)   S(TA,A)   S(TB,B)   S(TC,C)   S(TD,D)   S(TE,E)           \
- S(TF,F)   S(TG,G)   S(TH,H)   S(TI,I)   S(TJ,J)   S(TK,K)
+#define  CFARGT27(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) F(TL,21,1)  \
+ F(TM,22,1) F(TN,23,1) F(TO,24,1) F(TP,25,1) F(TQ,26,1) F(TR,27,1)             \
+ M       CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+
+#define  CFARGT20(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1)             \
+ S(T1,1)    S(T2,2)    S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)     \
+ S(T8,8)    S(T9,9)    S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)    \
+ S(TF,15)   S(TG,16)   S(TH,17)   S(TI,18)   S(TJ,19)   S(TK,20)
 #define CFARGTA14(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) \
- F(T1,A1,1,0) F(T2,A2,2,1) F(T3,A3,3,1) F(T4,A4,4,1) F(T5,A5,5,1) F(T6,A6,6,1) \
- F(T7,A7,7,1) F(T8,A8,8,1) F(T9,A9,9,1) F(TA,AA,A,1) F(TB,AB,B,1) F(TC,AC,C,1) \
- F(TD,AD,D,1) F(TE,AE,E,1) S(T1,1)      S(T2,2)      S(T3,3)      S(T4,4)      \
- S(T5,5)      S(T6,6)      S(T7,7)      S(T8,8)      S(T9,9)      S(TA,A)      \
- S(TB,B)      S(TC,C)      S(TD,D)      S(TE,E) 
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1) F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1) F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) S(T1,1)      S(T2,2)       S(T3,3)       S(T4,4)       \
+ S(T5,5)       S(T6,6)       S(T7,7)      S(T8,8)       S(T9,9)       S(TA,10)      \
+ S(TB,11)      S(TC,12)      S(TD,13)     S(TE,14)
 #if MAX_PREPRO_ARGS>31
-/* F changed to Z for arg 15. Watch out if ever extend to S or Z arguments. */
-#define CFARGTA20(Z,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
- Z(T1,A1,1,0) Z(T2,A2,2,1) Z(T3,A3,3,1) Z(T4,A4,4,1) Z(T5,A5,5,1) Z(T6,A6,6,1) \
- Z(T7,A7,7,1) Z(T8,A8,8,1) Z(T9,A9,9,1) Z(TA,AA,A,1) Z(TB,AB,B,1) Z(TC,AC,C,1) \
- Z(TD,AD,D,1) Z(TE,AE,E,1) Z(TF,AF,F,1) Z(TG,AG,G,1) Z(TH,AH,H,1) Z(TI,AI,I,1) \
- Z(TJ,AJ,J,1) Z(TK,AK,K,1) S(T1,1)      S(T2,2)      S(T3,3)      S(T4,4)      \
- S(T5,5)      S(T6,6)      S(T7,7)      S(T8,8)      S(T9,9)      S(TA,A)      \
- S(TB,B)      S(TC,C)      S(TD,D)      S(TE,E)      S(TF,F)      S(TG,G)      \
- S(TH,H)      S(TI,I)      S(TJ,J)      S(TK,K)
+#define CFARGTA20(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1)  F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1)  F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) F(TF,AF,15,1) F(TG,AG,16,1) F(TH,AH,17,1) F(TI,AI,18,1) \
+ F(TJ,AJ,19,1) F(TK,AK,20,1) S(T1,1)       S(T2,2)       S(T3,3)       S(T4,4)       \
+ S(T5,5)       S(T6,6)       S(T7,7)       S(T8,8)       S(T9,9)       S(TA,10)      \
+ S(TB,11)      S(TC,12)      S(TD,13)      S(TE,14)      S(TF,15)      S(TG,16)      \
+ S(TH,17)      S(TI,18)      S(TJ,19)      S(TK,20)
+#define CFARGTA27(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1)  F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1)  F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) F(TF,AF,15,1) F(TG,AG,16,1) F(TH,AH,17,1) F(TI,AI,18,1) \
+ F(TJ,AJ,19,1) F(TK,AK,20,1) F(TL,AL,21,1) F(TM,AM,22,1) F(TN,AN,23,1) F(TO,AO,24,1) \
+ F(TP,AP,25,1) F(TQ,AQ,26,1) F(TR,AR,27,1) S(T1,1)       S(T2,2)       S(T3,3)       \
+ S(T4,4)       S(T5,5)       S(T6,6)       S(T7,7)       S(T8,8)       S(T9,9)       \
+ S(TA,10)      S(TB,11)      S(TC,12)      S(TD,13)      S(TE,14)      S(TF,15)      \
+ S(TG,16)      S(TH,17)      S(TI,18)      S(TJ,19)      S(TK,20)      S(TL,21)      \
+ S(TM,22)      S(TN,23)      S(TO,24)      S(TP,25)      S(TQ,26)      S(TR,27)
 #endif
 #else
 #define  CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)             \
- F(T1,1,0) S(T1,1) F(T2,2,1) S(T2,2) F(T3,3,1) S(T3,3) F(T4,4,1) S(T4,4)       \
- F(T5,5,1) S(T5,5) F(T6,6,1) S(T6,6) F(T7,7,1) S(T7,7) F(T8,8,1) S(T8,8)       \
- F(T9,9,1) S(T9,9) F(TA,A,1) S(TA,A) F(TB,B,1) S(TB,B) F(TC,C,1) S(TC,C)       \
- F(TD,D,1) S(TD,D) F(TE,E,1) S(TE,E)
-/* F changed to Z for arg 15. Watch out if ever extend to S or Z arguments. */
-#define  CFARGT20(Z,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
- Z(T1,1,0) S(T1,1) Z(T2,2,1) S(T2,2) Z(T3,3,1) S(T3,3) Z(T4,4,1) S(T4,4)       \
- Z(T5,5,1) S(T5,5) Z(T6,6,1) S(T6,6) Z(T7,7,1) S(T7,7) Z(T8,8,1) S(T8,8)       \
- Z(T9,9,1) S(T9,9) Z(TA,A,1) S(TA,A) Z(TB,B,1) S(TB,B) Z(TC,C,1) S(TC,C)       \
- Z(TD,D,1) S(TD,D) Z(TE,E,1) S(TE,E) Z(TF,F,1) S(TF,F) Z(TG,G,1) S(TG,G)       \
- Z(TH,H,1) S(TH,H) Z(TI,I,1) S(TI,I) Z(TJ,J,1) S(TJ,J) Z(TK,K,1) S(TK,K)
+ F(T1,1,0) S(T1,1) F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1) S(T5,5) F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1) S(T9,9) F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14)
+#define  CFARGT27(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  S(T1,1)  F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1)  S(T5,5)  F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1)  S(T9,9)  F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) F(TF,15,1) S(TF,15) F(TG,16,1) S(TG,16) \
+ F(TH,17,1) S(TH,17) F(TI,18,1) S(TI,18) F(TJ,19,1) S(TJ,19) F(TK,20,1) S(TK,20) \
+ F(TL,21,1) S(TL,21) F(TM,22,1) S(TM,22) F(TN,23,1) S(TN,23) F(TO,24,1) S(TO,24) \
+ F(TP,25,1) S(TP,25) F(TQ,26,1) S(TQ,26) F(TR,27,1) S(TR,27)
+
+#define  CFARGT20(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+ F(T1,1,0)  S(T1,1)  F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1)  S(T5,5)  F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1)  S(T9,9)  F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) F(TF,15,1) S(TF,15) F(TG,16,1) S(TG,16) \
+ F(TH,17,1) S(TH,17) F(TI,18,1) S(TI,18) F(TJ,19,1) S(TJ,19) F(TK,20,1) S(TK,20)
 #define CFARGTA14(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) \
- F(T1,A1,1,0) S(T1,1) F(T2,A2,2,1) S(T2,2) F(T3,A3,3,1) S(T3,3)                \
- F(T4,A4,4,1) S(T4,4) F(T5,A5,5,1) S(T5,5) F(T6,A6,6,1) S(T6,6)                \
- F(T7,A7,7,1) S(T7,7) F(T8,A8,8,1) S(T8,8) F(T9,A9,9,1) S(T9,9)                \
- F(TA,AA,A,1) S(TA,A) F(TB,AB,B,1) S(TB,B) F(TC,AC,C,1) S(TC,C)                \
- F(TD,AD,D,1) S(TD,D) F(TE,AE,E,1) S(TE,E)
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14)
 #if MAX_PREPRO_ARGS>31
-/* F changed to Z for arg 15. Watch out if ever extend to S or Z arguments. */
-#define CFARGTA20(Z,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
- Z(T1,A1,1,0) S(T1,1) Z(T2,A2,2,1) S(T2,2) Z(T3,A3,3,1) S(T3,3)                \
- Z(T4,A4,4,1) S(T4,4) Z(T5,A5,5,1) S(T5,5) Z(T6,A6,6,1) S(T6,6)                \
- Z(T7,A7,7,1) S(T7,7) Z(T8,A8,8,1) S(T8,8) Z(T9,A9,9,1) S(T9,9)                \
- Z(TA,AA,A,1) S(TA,A) Z(TB,AB,B,1) S(TB,B) Z(TC,AC,C,1) S(TC,C)                \
- Z(TD,AD,D,1) S(TD,D) Z(TE,AE,E,1) S(TE,E) Z(TF,AF,F,1) S(TF,F)                \
- Z(TG,AG,G,1) S(TG,G) Z(TH,AH,H,1) S(TH,H) Z(TI,AI,I,1) S(TI,I)                \
- Z(TJ,AJ,J,1) S(TJ,J) Z(TK,AK,K,1) S(TK,K)                
+#define CFARGTA20(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) F(TF,AF,15,1) S(TF,15)          \
+ F(TG,AG,16,1) S(TG,16) F(TH,AH,17,1) S(TH,17) F(TI,AI,18,1) S(TI,18)          \
+ F(TJ,AJ,19,1) S(TJ,19) F(TK,AK,20,1) S(TK,20)                
+#define CFARGTA27(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) F(TF,AF,15,1) S(TF,15)          \
+ F(TG,AG,16,1) S(TG,16) F(TH,AH,17,1) S(TH,17) F(TI,AI,18,1) S(TI,18)          \
+ F(TJ,AJ,19,1) S(TJ,19) F(TK,AK,20,1) S(TK,20) F(TL,AL,21,1) S(TL,21)          \
+ F(TM,AM,22,1) S(TM,22) F(TN,AN,23,1) S(TN,23) F(TO,AO,24,1) S(TO,24)          \
+ F(TP,AP,25,1) S(TP,25) F(TQ,AQ,26,1) S(TQ,26) F(TR,AR,27,1) S(TR,27)
 #endif
 #endif
 
@@ -994,6 +1071,19 @@ return (int)num;
 #define PROTOCCALLSFSUB19(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
         PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0)
 
+#define PROTOCCALLSFSUB21(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB22(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB23(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB24(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB25(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0)
+#define PROTOCCALLSFSUB26(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0)
+
 
 #ifndef FCALLSC_QUALIFIER
 #ifdef VISUAL_CPLUSPLUS
@@ -1017,21 +1107,27 @@ return (int)num;
    PROTOCCALLSFFUN14(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
 #define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)\
    PROTOCCALLSFFUN20(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)\
+   PROTOCCALLSFFUN27(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
 #else
 /* Note: Prevent compiler warnings, null #define PROTOCCALLSFSUB14/20 after 
    #include-ing cfortran.h if calling the FORTRAN wrapper within the same 
    source code where the wrapper is created. */
-#define PROTOCCALLSFSUB0(UN,LN)     CFextern void FCALLSC_QUALIFIER CFC_(UN,LN)();
+#define PROTOCCALLSFSUB0(UN,LN)     _(VOID,_cfPU)(CFC_(UN,LN))();
 #ifndef __CF__KnR
 #define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
- CFextern void FCALLSC_QUALIFIER CFC_(UN,LN)( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) );
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) );
 #define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)\
- CFextern void FCALLSC_QUALIFIER CFC_(UN,LN)( CFARGT20(NCF,KCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) );
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT20(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) );
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)\
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT27(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) );
 #else
 #define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)     \
          PROTOCCALLSFSUB0(UN,LN)
 #define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
          PROTOCCALLSFSUB0(UN,LN)
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+         PROTOCCALLSFSUB0(UN,LN)
 #endif
 #endif
 
@@ -1072,6 +1168,7 @@ return (int)num;
 #define CPPPROTOCLSFSUB0( UN,LN)
 #define CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
 #define CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
 #else
 #define CPPPROTOCLSFSUB0(UN,LN) \
         PROTOCCALLSFSUB0(UN,LN)
@@ -1079,6 +1176,8 @@ return (int)num;
         PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
 #define CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
         PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
 #endif
 
 #ifdef CFSUBASFUN
@@ -1086,21 +1185,21 @@ return (int)num;
 #define CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\
         CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)
 #else
-/* do{...}while(FALSE) allows if(a==b) FORT(); else BORT(); */
-#define CCALLSFSUB0( UN,LN) do{CPPPROTOCLSFSUB0(UN,LN) CFC_(UN,LN)();}while(FALSE)
+/* do{...}while(0) allows if(a==b) FORT(); else BORT(); */
+#define CCALLSFSUB0( UN,LN) do{CPPPROTOCLSFSUB0(UN,LN) CFC_(UN,LN)();}while(0)
 #define CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\
 do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
-   VVCF(T6,A6,B6) VVCF(T7,A7,B7) VVCF(T8,A8,B8) VVCF(T9,A9,B9) VVCF(TA,AA,BA)  \
-   VVCF(TB,AB,BB) VVCF(TC,AC,BC) VVCF(TD,AD,BD) VVCF(TE,AE,BE)                 \
+   VVCF(T6,A6,B6) VVCF(T7,A7,B7) VVCF(T8,A8,B8) VVCF(T9,A9,B9) VVCF(TA,AA,B10) \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14)             \
    CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)          \
-   ACF(LN,T1,A1,1) ACF(LN,T2,A2,2) ACF(LN,T3,A3,3)                             \
-   ACF(LN,T4,A4,4) ACF(LN,T5,A5,5) ACF(LN,T6,A6,6) ACF(LN,T7,A7,7)             \
-   ACF(LN,T8,A8,8) ACF(LN,T9,A9,9) ACF(LN,TA,AA,A) ACF(LN,TB,AB,B)             \
-   ACF(LN,TC,AC,C) ACF(LN,TD,AD,D) ACF(LN,TE,AE,E)                             \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)                           \
+   ACF(LN,T4,A4,4)  ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)          \
+   ACF(LN,T8,A8,8)  ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11)         \
+   ACF(LN,TC,AC,12) ACF(LN,TD,AD,13) ACF(LN,TE,AE,14)                          \
    CFC_(UN,LN)( CFARGTA14(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) );\
-   WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5)            \
-   WCF(T6,A6,6) WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,AA,A)            \
-   WCF(TB,AB,B) WCF(TC,AC,C) WCF(TD,AD,D) WCF(TE,AE,E)             }while(FALSE)
+   WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)        \
+   WCF(T6,A6,6)  WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10)       \
+   WCF(TB,AB,11) WCF(TC,AC,12) WCF(TD,AD,13) WCF(TE,AE,14)      }while(0)
 #endif
 
 
@@ -1124,21 +1223,67 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 #else
 #define CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \
         TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
-do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
-   VVCF(T6,A6,B6) VVCF(T7,A7,B7) VVCF(T8,A8,B8) VVCF(T9,A9,B9) VVCF(TA,AA,BA)  \
-   VVCF(TB,AB,BB) VVCF(TC,AC,BC) VVCF(TD,AD,BD) VVCF(TE,AE,BE) VVCF(TF,AF,BF)  \
-   VVCF(TG,AG,BG) VVCF(TH,AH,BH) VVCF(TI,AI,BI) VVCF(TJ,AJ,BJ) VVCF(TK,AK,BK)  \
+do{VVCF(T1,A1,B1)  VVCF(T2,A2,B2)  VVCF(T3,A3,B3)  VVCF(T4,A4,B4)  VVCF(T5,A5,B5)   \
+   VVCF(T6,A6,B6)  VVCF(T7,A7,B7)  VVCF(T8,A8,B8)  VVCF(T9,A9,B9)  VVCF(TA,AA,B10)  \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) VVCF(TF,AF,B15)  \
+   VVCF(TG,AG,B16) VVCF(TH,AH,B17) VVCF(TI,AI,B18) VVCF(TJ,AJ,B19) VVCF(TK,AK,B20)  \
    CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)  \
-   ACF(LN,T1,A1,1) ACF(LN,T2,A2,2) ACF(LN,T3,A3,3) ACF(LN,T4,A4,4)             \
-   ACF(LN,T5,A5,5) ACF(LN,T6,A6,6) ACF(LN,T7,A7,7) ACF(LN,T8,A8,8)             \
-   ACF(LN,T9,A9,9) ACF(LN,TA,AA,A) ACF(LN,TB,AB,B) ACF(LN,TC,AC,C)             \
-   ACF(LN,TD,AD,D) ACF(LN,TE,AE,E) ACF(LN,TF,AF,F) ACF(LN,TG,AG,G)             \
-   ACF(LN,TH,AH,H) ACF(LN,TI,AI,I) ACF(LN,TJ,AJ,J) ACF(LN,TK,AK,K)             \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)  ACF(LN,T4,A4,4)          \
+   ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)  ACF(LN,T8,A8,8)          \
+   ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) ACF(LN,TC,AC,12)         \
+   ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) ACF(LN,TF,AF,15) ACF(LN,TG,AG,16)         \
+   ACF(LN,TH,AH,17) ACF(LN,TI,AI,18) ACF(LN,TJ,AJ,19) ACF(LN,TK,AK,20)         \
    CFC_(UN,LN)( CFARGTA20(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) ); \
- WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5) WCF(T6,A6,6) \
- WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,AA,A) WCF(TB,AB,B) WCF(TC,AC,C) \
- WCF(TD,AD,D) WCF(TE,AE,E) WCF(TF,AF,F) WCF(TG,AG,G) WCF(TH,AH,H) WCF(TI,AI,I) \
- WCF(TJ,AJ,J) WCF(TK,AK,K) }while(FALSE)
+ WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)  WCF(T6,A6,6)  \
+ WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10) WCF(TB,AB,11) WCF(TC,AC,12) \
+ WCF(TD,AD,13) WCF(TE,AE,14) WCF(TF,AF,15) WCF(TG,AG,16) WCF(TH,AH,17) WCF(TI,AI,18) \
+ WCF(TJ,AJ,19) WCF(TK,AK,20) }while(0)
+#endif
+#endif         /* MAX_PREPRO_ARGS */
+
+#if MAX_PREPRO_ARGS>31
+#define CCALLSFSUB21(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,0,0,0,0,0,0)
+#define CCALLSFSUB22(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,0,0,0,0,0)
+#define CCALLSFSUB23(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,0,0,0,0)
+#define CCALLSFSUB24(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,0,0,0)
+#define CCALLSFSUB25(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,0,0)
+#define CCALLSFSUB26(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,0)
+
+#ifdef CFSUBASFUN
+#define CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+        CCALLSFFUN27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR)
+#else
+#define CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+do{VVCF(T1,A1,B1)  VVCF(T2,A2,B2)  VVCF(T3,A3,B3)  VVCF(T4,A4,B4)  VVCF(T5,A5,B5)   \
+   VVCF(T6,A6,B6)  VVCF(T7,A7,B7)  VVCF(T8,A8,B8)  VVCF(T9,A9,B9)  VVCF(TA,AA,B10)  \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) VVCF(TF,AF,B15)  \
+   VVCF(TG,AG,B16) VVCF(TH,AH,B17) VVCF(TI,AI,B18) VVCF(TJ,AJ,B19) VVCF(TK,AK,B20)  \
+   VVCF(TL,AL,B21) VVCF(TM,AM,B22) VVCF(TN,AN,B23) VVCF(TO,AO,B24) VVCF(TP,AP,B25)  \
+   VVCF(TQ,AQ,B26) VVCF(TR,AR,B27)                                                  \
+   CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)  ACF(LN,T4,A4,4)          \
+   ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)  ACF(LN,T8,A8,8)          \
+   ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) ACF(LN,TC,AC,12)         \
+   ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) ACF(LN,TF,AF,15) ACF(LN,TG,AG,16)         \
+   ACF(LN,TH,AH,17) ACF(LN,TI,AI,18) ACF(LN,TJ,AJ,19) ACF(LN,TK,AK,20)         \
+   ACF(LN,TL,AL,21) ACF(LN,TM,AM,22) ACF(LN,TN,AN,23) ACF(LN,TO,AO,24)         \
+   ACF(LN,TP,AP,25) ACF(LN,TQ,AQ,26) ACF(LN,TR,AR,27)                          \
+   CFC_(UN,LN)( CFARGTA27(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,\
+                                   A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) ); \
+ WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)  WCF(T6,A6,6)  \
+ WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10) WCF(TB,AB,11) WCF(TC,AC,12) \
+ WCF(TD,AD,13) WCF(TE,AE,14) WCF(TF,AF,15) WCF(TG,AG,16) WCF(TH,AH,17) WCF(TI,AI,18) \
+ WCF(TJ,AJ,19) WCF(TK,AK,20) WCF(TL,AL,21) WCF(TM,AM,22) WCF(TN,AN,23) WCF(TO,AO,24) \
+ WCF(TP,AP,25) WCF(TQ,AQ,26) WCF(TR,AR,27) }while(0)
 #endif
 #endif         /* MAX_PREPRO_ARGS */
 
@@ -1167,9 +1312,9 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 #pragma nostandard
 #endif
 
-#define _SEP_(TN,C,COMMA)     _(__SEP_,C)(TN,COMMA)
-#define __SEP_0(TN,COMMA)  
-#define __SEP_1(TN,COMMA)     _Icf(2,SEP,TN,COMMA,0)
+#define _SEP_(TN,C,cfCOMMA)     _(__SEP_,C)(TN,cfCOMMA)
+#define __SEP_0(TN,cfCOMMA)  
+#define __SEP_1(TN,cfCOMMA)     _Icf(2,SEP,TN,cfCOMMA,0)
 #define        INT_cfSEP(T,B) _(A,B)
 #define       INTV_cfSEP(T,B) INT_cfSEP(T,B)
 #define      INTVV_cfSEP(T,B) INT_cfSEP(T,B)
@@ -1309,9 +1454,9 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 #define           CF_0_cfINT(N,A,B,X,Y,Z)
                          
 
-#define   UCF(TN,I,C)  _SEP_(TN,C,COMMA) _Icf(2,U,TN,_(A,I),0)
-#define  UUCF(TN,I,C)  _SEP_(TN,C,COMMA) _SEP_(TN,1,I) 
-#define UUUCF(TN,I,C)  _SEP_(TN,C,COLON) _Icf(2,U,TN,_(A,I),0)
+#define   UCF(TN,I,C)  _SEP_(TN,C,cfCOMMA) _Icf(2,U,TN,_(A,I),0)
+#define  UUCF(TN,I,C)  _SEP_(TN,C,cfCOMMA) _SEP_(TN,1,I) 
+#define UUUCF(TN,I,C)  _SEP_(TN,C,cfCOLON) _Icf(2,U,TN,_(A,I),0)
 #define        INT_cfU(T,A) _(T,VVVVVVV_cfTYPE)   A
 #define       INTV_cfU(T,A) _(T,VVVVVV_cfTYPE)  * A
 #define      INTVV_cfU(T,A) _(T,VVVVV_cfTYPE)   * A
@@ -1396,7 +1541,7 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 #ifdef vmsFortran
 #define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)(&A0
 #else
-#if defined(CRAYFortran) || defined(AbsoftUNIXFortran)
+#if defined(CRAYFortran) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
 #define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)( A0
 #else
 #define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)( A0,MAX_LEN_FORTRAN_FUNCTION_STRING
@@ -1421,7 +1566,7 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 #define         PSHORT_cfPP
 #define         PFLOAT_cfPP FLOATVVVVVVV_cfPP
 
-#define BCF(TN,AN,C)        _SEP_(TN,C,COMMA) _Icf(2,B,TN,AN,0)
+#define BCF(TN,AN,C)        _SEP_(TN,C,cfCOMMA) _Icf(2,B,TN,AN,0)
 #define        INT_cfB(T,A) (_(T,VVVVVVV_cfTYPE)) A
 #define       INTV_cfB(T,A)            A
 #define      INTVV_cfB(T,A)           (A)[0]
@@ -1436,7 +1581,7 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 #define    PSTRING_cfB(T,A) (char *)   A
 #define   PSTRINGV_cfB(T,A) (char *)   A
 #define      PVOID_cfB(T,A) (void *)   A
-#define    ROUTINE_cfB(T,A) (void(*)(CF_NULL_PROTO))A
+#define    ROUTINE_cfB(T,A) (cfCAST_FUNCTION)A
 #define    ZTRINGV_cfB(T,A) (char *)   A
 #define   PZTRINGV_cfB(T,A) (char *)   A
                                                               	
@@ -1452,9 +1597,9 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 #define  ZTRINGV_cfS(M,I,A)
 #define PZTRINGV_cfS(M,I,A)
 
-#define   HCF(TN,I)         _(TN,_cfSTR)(3,H,COMMA, H,_(C,I),0,0)
-#define  HHCF(TN,I)         _(TN,_cfSTR)(3,H,COMMA,HH,_(C,I),0,0)
-#define HHHCF(TN,I)         _(TN,_cfSTR)(3,H,COLON, H,_(C,I),0,0)
+#define   HCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOMMA, H,_(C,I),0,0)
+#define  HHCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOMMA,HH,_(C,I),0,0)
+#define HHHCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOLON, H,_(C,I),0,0)
 #define  H_CF_SPECIAL       unsigned
 #define HH_CF_SPECIAL
 #define  DEFAULT_cfH(M,I,A)
@@ -1562,9 +1707,9 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
              B.dsc$w_length=strlen(A):  (A[C-1]='\0',B.dsc$w_length=strlen(A), \
        memset((A)+B.dsc$w_length,' ',C-B.dsc$w_length-1), B.dsc$w_length=C-1));
 #else
-#define   STRING_cfC(M,I,A,B,C) (B.clen=strlen(A),                             \
+#define   STRING_cfC(M,I,A,B,C) (B.nombre=A,B.clen=strlen(A),                             \
                 C==sizeof(char*)||C==(unsigned)(B.clen+1)?B.flen=B.clen:       \
-                        (memset((A)+B.clen,' ',C-B.clen-1),A[B.flen=C-1]='\0'));
+                        (memset(B.nombre+B.clen,' ',C-B.clen-1),B.nombre[B.flen=C-1]='\0'));
 #define  PSTRING_cfC(M,I,A,B,C) (C==sizeof(char*)? B=strlen(A):                \
                     (A[C-1]='\0',B=strlen(A),memset((A)+B,' ',C-B-1),B=C-1));
 #endif
@@ -1600,7 +1745,7 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 #define    PLONG_cfCCC(A,B)  A
 #define   PSHORT_cfCCC(A,B)  A
 
-#define CCCF(TN,I,M)           _SEP_(TN,M,COMMA) _Icf(3,CC,TN,_(A,I),_(B,I))
+#define CCCF(TN,I,M)           _SEP_(TN,M,cfCOMMA) _Icf(3,CC,TN,_(A,I),_(B,I))
 #define        INT_cfCC(T,A,B) _(T,_cfCCC)(A,B) 
 #define       INTV_cfCC(T,A,B)  A
 #define      INTVV_cfCC(T,A,B)  A
@@ -1698,10 +1843,10 @@ do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
 ((CFFUN(UN)(  BCF(T1,A1,0) BCF(T2,A2,1) BCF(T3,A3,1) BCF(T4,A4,1) BCF(T5,A5,1) \
               BCF(T6,A6,1) BCF(T7,A7,1) BCF(T8,A8,1) BCF(T9,A9,1) BCF(TA,AA,1) \
               BCF(TB,AB,1) BCF(TC,AC,1) BCF(TD,AD,1) BCF(TE,AE,1)              \
-           SCF(T1,LN,1,A1) SCF(T2,LN,2,A2) SCF(T3,LN,3,A3) SCF(T4,LN,4,A4)     \
-           SCF(T5,LN,5,A5) SCF(T6,LN,6,A6) SCF(T7,LN,7,A7) SCF(T8,LN,8,A8)     \
-           SCF(T9,LN,9,A9) SCF(TA,LN,A,AA) SCF(TB,LN,B,AB) SCF(TC,LN,C,AC)     \
-           SCF(TD,LN,D,AD))))
+           SCF(T1,LN,1,A1)  SCF(T2,LN,2,A2)  SCF(T3,LN,3,A3)  SCF(T4,LN,4,A4)  \
+           SCF(T5,LN,5,A5)  SCF(T6,LN,6,A6)  SCF(T7,LN,7,A7)  SCF(T8,LN,8,A8)  \
+           SCF(T9,LN,9,A9)  SCF(TA,LN,10,AA) SCF(TB,LN,11,AB) SCF(TC,LN,12,AC) \
+           SCF(TD,LN,13,AD) SCF(TE,LN,14,AE))))
 
 /*  N.B. Create a separate function instead of using (call function, function
 value here) because in order to create the variables needed for the input
@@ -1754,26 +1899,26 @@ static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(
  _(T0,_cfPU)(CFC_(UN,LN))(CF_NULL_PROTO); static _Icf(2,U,T0,CFFUN(UN),0)(     \
    CFARGT14FS(UCF,HCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )          \
 {       CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    _(T0,_cfE) \
- CCF(LN,T1,1) CCF(LN,T2,2) CCF(LN,T3,3) CCF(LN,T4,4) CCF(LN,T5,5)              \
- CCF(LN,T6,6) CCF(LN,T7,7) CCF(LN,T8,8) CCF(LN,T9,9) CCF(LN,TA,A)              \
- CCF(LN,TB,B) CCF(LN,TC,C) CCF(LN,TD,D) CCF(LN,TE,E)        _Icf(3,G,T0,UN,LN) \
+ CCF(LN,T1,1)  CCF(LN,T2,2)  CCF(LN,T3,3)  CCF(LN,T4,4)  CCF(LN,T5,5)          \
+ CCF(LN,T6,6)  CCF(LN,T7,7)  CCF(LN,T8,8)  CCF(LN,T9,9)  CCF(LN,TA,10)         \
+ CCF(LN,TB,11) CCF(LN,TC,12) CCF(LN,TD,13) CCF(LN,TE,14)    _Icf(3,G,T0,UN,LN) \
  CFARGT14(CCCF,JCF,ABSOFT_cf1(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)); \
- WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5)              \
- WCF(T6,A6,6) WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,AA,A)              \
- WCF(TB,AB,B) WCF(TC,AC,C) WCF(TD,AD,D) WCF(TE,AE,E) _(T0,_cfX)}
+ WCF(T1,A1,1)   WCF(T2,A2,2)   WCF(T3,A3,3)   WCF(T4,A4,4)  WCF(T5,A5,5)       \
+ WCF(T6,A6,6)   WCF(T7,A7,7)   WCF(T8,A8,8)   WCF(T9,A9,9)  WCF(TA,A10,10)     \
+ WCF(TB,A11,11) WCF(TC,A12,12) WCF(TD,A13,13) WCF(TE,A14,14) _(T0,_cfX)}
 #else
 #define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  \
  _(T0,_cfPU)(CFC_(UN,LN))(CF_NULL_PROTO); static _Icf(2,U,T0,CFFUN(UN),0)(     \
    CFARGT14FS(UUCF,HHCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )        \
  CFARGT14FS(UUUCF,HHHCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ;        \
 {       CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    _(T0,_cfE) \
- CCF(LN,T1,1) CCF(LN,T2,2) CCF(LN,T3,3) CCF(LN,T4,4) CCF(LN,T5,5)              \
- CCF(LN,T6,6) CCF(LN,T7,7) CCF(LN,T8,8) CCF(LN,T9,9) CCF(LN,TA,A)              \
- CCF(LN,TB,B) CCF(LN,TC,C) CCF(LN,TD,D) CCF(LN,TE,E)        _Icf(3,G,T0,UN,LN) \
+ CCF(LN,T1,1)  CCF(LN,T2,2)  CCF(LN,T3,3)  CCF(LN,T4,4)  CCF(LN,T5,5)          \
+ CCF(LN,T6,6)  CCF(LN,T7,7)  CCF(LN,T8,8)  CCF(LN,T9,9)  CCF(LN,TA,10)         \
+ CCF(LN,TB,11) CCF(LN,TC,12) CCF(LN,TD,13) CCF(LN,TE,14)    _Icf(3,G,T0,UN,LN) \
  CFARGT14(CCCF,JCF,ABSOFT_cf1(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)); \
- WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5)              \
- WCF(T6,A6,6) WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,AA,A)              \
- WCF(TB,AB,B) WCF(TC,AC,C) WCF(TD,AD,D) WCF(TE,AE,E) _(T0,_cfX)}
+ WCF(T1,A1,1)   WCF(T2,A2,2)   WCF(T3,A3,3)   WCF(T4,A4,4)   WCF(T5,A5,5)      \
+ WCF(T6,A6,6)   WCF(T7,A7,7)   WCF(T8,A8,8)   WCF(T9,A9,9)   WCF(TA,A10,10)    \
+ WCF(TB,A11,11) WCF(TC,A12,12) WCF(TD,A13,13) WCF(TE,A14,14) _(T0,_cfX)}
 #endif
 
 /*-------------------------------------------------------------------------*/
@@ -1825,8 +1970,21 @@ static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(
 #define ROUTINE_12    ROUTINE_orig   
 #define ROUTINE_13    ROUTINE_orig   
 #define ROUTINE_14    ROUTINE_orig   
-
-#define TCF(NAME,TN,I,M)              _SEP_(TN,M,COMMA) _(TN,_cfT)(NAME,I,_(A,I),_(B,I),_(C,I))
+#define ROUTINE_15    ROUTINE_orig   
+#define ROUTINE_16    ROUTINE_orig   
+#define ROUTINE_17    ROUTINE_orig   
+#define ROUTINE_18    ROUTINE_orig   
+#define ROUTINE_19    ROUTINE_orig   
+#define ROUTINE_20    ROUTINE_orig   
+#define ROUTINE_21    ROUTINE_orig   
+#define ROUTINE_22    ROUTINE_orig   
+#define ROUTINE_23    ROUTINE_orig   
+#define ROUTINE_24    ROUTINE_orig   
+#define ROUTINE_25    ROUTINE_orig   
+#define ROUTINE_26    ROUTINE_orig   
+#define ROUTINE_27    ROUTINE_orig   
+
+#define TCF(NAME,TN,I,M)              _SEP_(TN,M,cfCOMMA) _(TN,_cfT)(NAME,I,_(A,I),_(B,I),_(C,I))
 #define           BYTE_cfT(M,I,A,B,D) *A
 #define         DOUBLE_cfT(M,I,A,B,D) *A
 #define          FLOAT_cfT(M,I,A,B,D) *A
@@ -1900,10 +2058,10 @@ static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(
    D == length of the string, or of an element in an array of strings
    E == number of elements in an array of strings                             */
 #define TTSTR(    A,B,D)                                                       \
-           ((B=(char*)malloc(D+1))[D]='\0', memcpy(B,A,D), kill_trailing(B,' '))
+           ((B=_cf_malloc(D+1))[D]='\0', memcpy(B,A,D), kill_trailing(B,' '))
 #define TTTTSTR(  A,B,D)   (!(D<4||A[0]||A[1]||A[2]||A[3]))?NULL:              \
                             memchr(A,'\0',D)                 ?A   : TTSTR(A,B,D)
-#define TTTTSTRV( A,B,D,E) (_(B,N)=E,B=(char*)malloc(_(B,N)*(D+1)), (void *)   \
+#define TTTTSTRV( A,B,D,E) (_(B,N)=E,B=_cf_malloc(_(B,N)*(D+1)), (void *)      \
   vkill_trailing(f2cstrv(A,B,D+1, _(B,N)*(D+1)), D+1,_(B,N)*(D+1),' '))
 #ifdef vmsFortran
 #define         STRING_cfT(M,I,A,B,D)  TTTTSTR( A->dsc$a_pointer,B,A->dsc$w_length)
@@ -1933,12 +2091,12 @@ static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(
 #define  DEFAULT_cfR(A,B,D)
 #define  LOGICAL_cfR(A,B,D)
 #define PLOGICAL_cfR(A,B,D) *A=C2FLOGICAL(*A);
-#define   STRING_cfR(A,B,D) if (B) free(B);
-#define  STRINGV_cfR(A,B,D) free(B);
+#define   STRING_cfR(A,B,D) if (B) _cf_free(B);
+#define  STRINGV_cfR(A,B,D) _cf_free(B);
 /* A and D as defined above for TSTRING(V) */
 #define RRRRPSTR( A,B,D)    if (B) memcpy(A,B, _cfMIN(strlen(B),D)),           \
-                  (D>strlen(B)?memset(A+strlen(B),' ', D-strlen(B)):0), free(B);
-#define RRRRPSTRV(A,B,D)    c2fstrv(B,A,D+1,(D+1)*_(B,N)), free(B);
+                  (D>strlen(B)?memset(A+strlen(B),' ', D-strlen(B)):0), _cf_free(B);
+#define RRRRPSTRV(A,B,D)    c2fstrv(B,A,D+1,(D+1)*_(B,N)), _cf_free(B);
 #ifdef vmsFortran
 #define  PSTRING_cfR(A,B,D) RRRRPSTR( A->dsc$a_pointer,B,A->dsc$w_length)
 #define PSTRINGV_cfR(A,B,D) RRRRPSTRV(A->dsc$a_pointer,B,A->dsc$w_length)
@@ -1971,7 +2129,7 @@ static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(
 #ifdef CRAYFortran
 #define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(_fcd     AS
 #else
-#if  defined(AbsoftUNIXFortran)
+#if  defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
 #define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(char    *AS
 #else
 #define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(char    *AS, unsigned D0
@@ -2097,6 +2255,33 @@ string. */
    FCALLSCFUN13(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD)
 #define FCALLSCSUB14(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
    FCALLSCFUN14(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define FCALLSCSUB15(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \
+   FCALLSCFUN15(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF)
+#define FCALLSCSUB16(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \
+   FCALLSCFUN16(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG)
+#define FCALLSCSUB17(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \
+   FCALLSCFUN17(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH)
+#define FCALLSCSUB18(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \
+   FCALLSCFUN18(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI)
+#define FCALLSCSUB19(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
+   FCALLSCFUN19(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ)
+#define FCALLSCSUB20(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+   FCALLSCFUN20(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define FCALLSCSUB21(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+   FCALLSCFUN21(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL)
+#define FCALLSCSUB22(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+   FCALLSCFUN22(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM)
+#define FCALLSCSUB23(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+   FCALLSCFUN23(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN)
+#define FCALLSCSUB24(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+   FCALLSCFUN24(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO)
+#define FCALLSCSUB25(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+   FCALLSCFUN25(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP)
+#define FCALLSCSUB26(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+   FCALLSCFUN26(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ)
+#define FCALLSCSUB27(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+   FCALLSCFUN27(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+
 
 #define FCALLSCFUN1( T0,CN,UN,LN,T1) \
         FCALLSCFUN5 (T0,CN,UN,LN,T1,CF_0,CF_0,CF_0,CF_0)
@@ -2125,19 +2310,59 @@ string. */
 #define FCALLSCFUN13(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \
         FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0)
 
+
+#define FCALLSCFUN15(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN16(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN17(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0)
+#define FCALLSCFUN18(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0)
+#define FCALLSCFUN19(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0)
+#define FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN21(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN22(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN23(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN24(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0)
+#define FCALLSCFUN25(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0)
+#define FCALLSCFUN26(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0)
+
+
 #ifndef __CF__KnR
 #define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf2(T0))   \
         {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)}
 
 #define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
                                  CFextern _(T0,_cfF)(UN,LN)                    \
-   CFARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)) \
+ CFARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )  \
  {                 CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
-  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(  TCF(LN,T1,1,0) TCF(LN,T2,2,1) \
-    TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \
-    TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,A,1) TCF(LN,TB,B,1) TCF(LN,TC,C,1) \
-    TCF(LN,TD,D,1) TCF(LN,TE,E,1) );                          _Icf(0,K,T0,0,0) \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(    TCF(LN,T1,1,0)  TCF(LN,T2,2,1) \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1) TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1) \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) );                          _Icf(0,K,T0,0,0) \
                    CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  _(T0,_cfI) }
+
+#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)   \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT27(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) ) \
+ {                 CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)   \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(     TCF(LN,T1,1,0)  TCF(LN,T2,2,1)  \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1)  TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1)  \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1)  TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) TCF(LN,TF,15,1) TCF(LN,TG,16,1) TCF(LN,TH,17,1) \
+    TCF(LN,TI,18,1) TCF(LN,TJ,19,1) TCF(LN,TK,20,1) TCF(LN,TL,21,1) TCF(LN,TM,22,1) \
+    TCF(LN,TN,23,1) TCF(LN,TO,24,1) TCF(LN,TP,25,1) TCF(LN,TQ,26,1) TCF(LN,TR,27,1) ); _Icf(0,K,T0,0,0) \
+                   CFARGT27S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  _(T0,_cfI) }
+
 #else
 #define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf3(T0)) _Icf(0,FF,T0,0,0)\
         {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)}
@@ -2149,9 +2374,23 @@ string. */
  {                 CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
   _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(  TCF(LN,T1,1,0) TCF(LN,T2,2,1) \
     TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \
-    TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,A,1) TCF(LN,TB,B,1) TCF(LN,TC,C,1) \
-    TCF(LN,TD,D,1) TCF(LN,TE,E,1) );                          _Icf(0,K,T0,0,0) \
+    TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) );                          _Icf(0,K,T0,0,0) \
                    CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  _(T0,_cfI)}
+
+#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT27(NNCF,DDCF,ABSOFT_cf3(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)) _Icf(0,FF,T0,0,0) \
+       CFARGT27FS(NNNCF,DDDCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR); \
+ {                 CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(     TCF(LN,T1,1,0)  TCF(LN,T2,2,1)  \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1)  TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1)  \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1)  TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) TCF(LN,TF,15,1) TCF(LN,TG,16,1) TCF(LN,TH,17,1) \
+    TCF(LN,TI,18,1) TCF(LN,TJ,19,1) TCF(LN,TK,20,1) TCF(LN,TL,21,1) TCF(LN,TM,22,1) \
+    TCF(LN,TN,23,1) TCF(LN,TO,24,1) TCF(LN,TP,25,1) TCF(LN,TQ,26,1) TCF(LN,TR,27,1) ); _Icf(0,K,T0,0,0) \
+                   CFARGT27S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  _(T0,_cfI)}
+
 #endif
 
 
diff --git a/changes.txt b/changes.txt
index 2996708..ffc5c2e 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,5 +1,1055 @@
+
                    Log of Changes Made to CFITSIO
 
+Version 2.500 - 28 & 30 July 2004
+
+  New Routine:  
+  
+   - fits_file_exists tests whether the specified input file, or a 
+     compressed version of the file, exists on disk.
+
+  Enhancements:
+
+   - modified the way CFITSIO reads and writes data in COMPLEX ('C') and
+     DBLCOMPLEX 'M' column.  Now, in all cases, when refering to the
+     number of elements in the vector, or the value of the offset to a 
+     particular element within the vector, CFITSIO considers each pair of
+     numbers (the imaginary and real parts) as a single element instead of
+     treating each single number as an element. In particular, this changes
+     the behavior of fits_write_col_null when writing to complex columns.  
+     It also changes the length of the 'nullarray' vector in the
+     fits_read_colnull routine;  it is now only 1/2 as long as before.
+     Each element of the nullarray is set = 1 if either the real or 
+     imaginary parts of the corresponding complex value have a null
+     value.(this change was added to version 2.500 on 30 July).
+
+   - Craig Markwardt, at GSFC, provided a number of significant enhancements
+     to the CFITSIO lexical parser that is used to evaluate expressions:
+     
+       - the parser now can operate on bit columns ('X') in a similar
+         way as for other numeric coluns (e.g., 'B' or 'I' columns)
+	 
+       - range checking has been implemented, so that the following 
+         conditions return a Null value, rather than returning an error:
+	 divide by zero, sqrt(negative),  arccos(>1), arcsin(>1),
+	 log(negative), log10(negative)
+	 
+       - new vector functions:  MEDIAN, AVERAGE, STDDEV, and 
+         NVALID (returns the number of non-null values in the vector)
+
+       - all the new functions (and SUM, MIN and MAX) ignore null values
+       
+   - modified the iterator to support variable-length array columns
+
+   - modified configure to support AIX systems that have flock in a non-
+     standard location.
+     
+   - modified configure to remove the -D_FILE_OFFSET_BITS flag when running
+     on Mac Darwin systems.  This caused conflicts with the Fortran
+     wrappers, and should only be needed in any case when using CFITSIO
+     to read/write FITS files greater than 2.1 GB in size.
+
+   - modified fitsio2.h to support compilers that define LONG_LONG_MAX.
+
+   - modified ffrsim (resize an existing image) so that it supports changing
+     the datatype to an unsigned integer image using the USHORT_IMG and
+     ULONG_IMG definitions.
+
+   - modified the disk file driver (drvrfile.c) so that if an output
+     file is specified when opening an ordinary file (e.g. with the syntax
+     'myfile.fits(outputfile.fits)' then it will make a copy of the file,
+     close the original file and open the copy.  Previously, the
+     specified output file would be ignored unless the file was compressed.
+
+   - modified f77_wrap.h and f77_wrap3.c to support the Fortran wrappers
+     on 64-bit AMD Opteron machines
+
+  Bug fixes:
+
+   - made small change to ffsrow in eval_f.c to avoid potential array 
+     bounds overflow.
+     
+   - made small change to group.c to fix problem where an 'int' was
+     incorrectly being cast to a 'long'.
+
+   - corrected a memory allocation error in the new fits_hdr2str routine
+     that was added in version 2.48
+
+   - The on-the-fly row-selection filtering would fail with a segfault
+     if the length of a table row (NAXIS1 value) was greater than
+     500000 bytes.  A small change to eval_f.c was required to fix this.
+
+Version 2.490 - 11 February 2004
+
+  Bug fixes:
+
+  - fixed a bug that was introduced in the previous release, which caused
+    the CFITSIO parser to no longer move to a named extension when opening
+    a FITS file, e.g., when opening myfile.fit[events] CFITSIO would just
+    open the primary array instead of moving to the EVENTS extension.
+
+  - new group.c file from the INTEGRAL Science Data Center.  It fixes
+    a problem when you attach a child to a parent and they are both
+    is the same file, but, that parent contains groups in other files.
+    In certain cases the attach would not happen because it seemed that
+    the new child was already in the parent group.
+
+  - fixed bug in fits_calculator_rng when performing a calculation
+    on a range of rows in a table, so that it does not reset the
+    value in all the other rows that are not in the range = 0.
+
+  - modified fits_write_chksum so that it updates the TFORMn 
+    keywords for any variable length vector table columns BEFORE 
+    calculating the CHECKSUM values.  Otherwise the CHECKSUM
+    value is invalidated when the HDU is subsequently closed.
+
+Version 2.480 - 28 January 2004
+
+  New Routines:
+
+  - fits_get_img_equivtype - just like fits_get_img_type, except in
+    the case of scaled integer images, it returns the 'equivalent' 
+    data type that is necessary to store the scaled data values.  
+
+  - fits_hdr2str copies all the header keywords in the current HDU
+    into a single long character string.  This is a convenient method
+    of passing the header information to other subroutines.
+    The user may exclude any specified keywords from the list.
+
+  Enhancements:
+
+  - modified the filename parser so that it accepts extension
+    names that begin with digits, as in 'myfile.fits[123TEST]'.
+    In this case CFITSIO will try to open the extension with
+    EXTNAME = '123TEST' instead of trying to move to the 123rd
+    extension in the file.
+
+  - the template keyword parser now preserves the comments on the
+    the mandatory FITS keywords if present, otherwise a standard
+    default comment is provided.
+
+  - modified the ftp driver file (drvrnet.c) to overcome a timeout
+    or hangup problem caused by some firewall software at the user's
+    end (Thanks to Bruce O'Neel for this fix).
+
+  - modified iraffits.c to incorporate Doug Mink's latest changes to
+    his wcstools library routines.  The biggest change is that now
+    the actual image dimensions, rather than the physically stored
+    dimensions, are used when converting an IRAF file to FITS.
+
+  Bug fixes:
+
+  - when writing to ASCII FITS tables, the 'elemnum' parameter was
+    supposed to be ignored if it did not have the default value of 1.
+    In some cases however setting elemnum to a value other than 1 
+    could cause the wrong number of rows to be produced in the output
+    table.
+
+  - If a cfitsio calculator expression was imported from a text file
+    (e.g. using the extended filename syntax 'file.fits[col @file.calc]')
+    and if any individual lines in that text file were greater than 
+    255 characters long, then a space character would be inserted
+    after the 255th character.  This could corrupt the line if the space
+    was inserted within a column name or keyword name token.
+
+Version 2.480beta  (used in the FTOOLS 5.3 release, 1 Nov 2003)
+
+  New Routines:
+
+  - fits_get_eqcoltype - just like fits_get_coltype, except in the
+    case of scaled integer columns, it returns the 'equivalent' 
+    data type that is necessary to store the scaled data values.  
+
+  - fits_split_names - splits an input string containing a comma or
+    space delimited list of names (typically file names or column
+    names) into individual name tokens.
+
+  Enhancements:
+
+  - changed fhist in histo.c so that it can make histograms of ASCII
+    table columns as well as binary table columns (as long as they
+    contain numeric data).
+
+  Bug fixes:
+
+  - removed an erroneous reference to listhead.c in makefile.vcc, that is
+    used to build the cfitsio dll under Windows.  This caused a 'main'
+    routine to be added to the library, which causes problems when linking
+    fortran programs to cfitsio under windows.
+
+  - if an error occurs when opening for a 2nd time (with ffopen) a file that
+    is already open (e.g., the specified extension doesn't exist), and
+    if the file had been modified before attempting to reopen it, then
+    the modified buffers may not get written to disk and the internal
+    state of the file may become corrupted.  ffclos was modified to
+    always set status=0 before calling ffflsh if the file has been 
+    concurrently opened more than once.
+
+Version 2.470 - 18 August 2003
+
+  Enhancements:
+
+  - defined 'TSBYTE' to represent the 'signed char' datatype (similar to
+    'TBYTE' that represents the 'unsigned char' datatype) and added
+    support for this datatype to all the routines that read or write
+    data to a FITS image or table.   This was implemented by adding 2
+    new C source code files to the package: getcolsb.c and putcolsb.c.
+
+  - Defined a new '1S' shorthand data code for a signed byted column in
+    a binary table.  CFITSIO will write TFORMn = '1B' and
+    TZEROn = -128 in this case, which is the convention used to
+    store signed byte values in a 'B' type column.
+
+  - in fitsio2.h, added test of whether  `__x86_64__` is defined, to 
+    support the new AMD Opteron 64-bit processor
+
+  - modified configure to not use the -fast compiler flag on Solaris
+    platforms when using the proprietary Solaris cc compilar.  This
+    flag causes compilation problems in eval_y.c (compiler just
+    hangs forever).
+
+  Bug fixes:
+
+  - In the special case of writing 0 elements to a vector table colum
+    that contains 0 rows, ffgcpr no longer adds a blank row to the table.
+    
+  - added error checking code for cases where a ASCII string column
+    in a binary table is greater than 28800 characters wide, to avoid
+    going into an infinite loop.
+
+  - the fits_get_col_display_width routine was incorrectly returning
+    width = 0 for a 'A' binary table column that did not have an 
+    explicit vector length character.
+
+Version 2.460 - 20 May 2003
+
+  Enhancements:
+
+  - modified the HTTP driver in drvrnet.c so that CFITSIO can read
+    FITS files via a proxy HTTP server.  (This code was contributed by
+    Philippe Prugniel, Obs. de Lyon).  To use this feature, the 
+    'http_proxy' environment variable must be defined with the
+    address (URL) and port number of the proxy server, i.e.,
+      > setenv http_proxy http://heasarc.gsfc.nasa.gov:3128
+    will use port 3128 on heasarc.gsfc.nasa.gov
+
+  - suppressed some compiler warnings by casting a variable of 
+    type 'size_t' to type 'int' in fftkey (in fitscore.c) and
+    iraftofits and irafrdimge (in iraffits.c).
+
+Version 2.450 - 30 April 2003
+
+  Enhancements:
+
+  - modified the WCS keyword reading routine (ffgics) to support cases
+    where some of the CDi_j keywords are omitted (with an assumed 
+    value = 0).
+
+  - Made a change to http_open_network in drvrnet.c to add a 'Host: '
+    string to the open request.  This is required by newer HTTP 1.1
+    servers (so-called virtual servers).
+
+  - modified ffgcll (read logical table column) to return the illegal
+    character value itself if the FITS file contains a logical value that is
+    not equal to T, F or zero.  Previously it treated this case the
+    same as if the FITS file value was = 0.
+
+  - modified fits_movnam_hdu (ffmnhd) so that it will move to a tile-
+    compressed image (that is stored in a binary table) if the input
+    desired HDU type is BINARY_TBL as well as if the HDU type = IMAGE_HDU.
+
+  Bug fixes:
+
+  - in the routine that checks the data fill bytes (ffcdfl), the call
+    to ffmbyt should not ignore an EOF error when trying to read the bytes.
+    This is a little-used routine that is not called by any other CFITSIO
+    routine.
+
+  - fits_copy_file was not reporting an error if it hit the End Of File
+    while copying the last extension in the input file to the output file.
+
+  - fixed inconsistencies in the virtual file column filter parser
+    (ffedit_columns) to properly support expressions which create or
+    modify a keyword, instead of a column.  Previously it was only possible
+    to modify keywords in a table extension (not an image), and the 
+    keyword filtering could cause some of the table columns to not
+    get propogated into the virtual file.  Also, spaces are now
+    allowed within the specified keyword comment field.
+
+  - ffdtyp was incorrectly returning the data type of FITS keyword
+    values of the form '1E-09' (i.e., an exponential value without
+    a decimal point) as integer rather than floating point.
+
+  - The enhancement in the previous 2.440 release to allow more files to be
+    opened at one time introduced a bug: if ffclos is called with
+    a non-zero status value, then any subsequent call to ffopen will likely
+    cause a segmentation fault.  The fits_clear_Fptr routine was modified
+    to fix this.
+
+  - rearranged the order of some computations in fits_resize_img so as
+    to not exceed the range of a 32-bit integer when dealing with 
+    large images.
+
+  - the template parser routine, ngp_read_xtension, was testing for
+    "ASCIITABLE" instead of "TABLE" as the XTENSION value of an ASCII
+    table, and it did not allow for optional trailing spaces in the IMAGE"
+    or "TABLE" string value.
+
+Version 2.440 - 8 January 2003
+
+  Enhancements:
+
+  - modified the iterator function, ffiter, to operate on random
+    groups files.
+
+  - decoupled the NIOBUF (= 40) parameter from the limit on the number
+    FITS files that can be opened, so that more files may be opened
+    without the overhead of having to increase the number of NIOBUF
+    buffers.  A new NMAXFILES parameter is defined in fitsio2.h which sets
+    the maximum number of opened FITS files.  It is set = 300 by default.
+    Note however, that the underlying compiler or operating system may
+    not allow this many files to be opened at one time.
+
+  - updated the version of cfortran.h that is distributed with CFITSIO from 
+    version 3.9 to version 4.4.  This required changes to f77_wrap.h
+    and f77_wrap3.c.  The original cfortran.h v4.4 file was modified
+    slightly to support CFITSIO and ftools (see comments in the header
+    of cfortran.h).
+
+  - modified ffhist so that it copies all the non-structural keywords from
+    the original binary table header to the binned image header.
+
+  - modified fits_get_keyclass so that it recognizes EXTNAME =
+    COMPRESSED_IMAGE as a special tile compression keyword.
+
+  - modified Makefile.in to support the standard --prefix convention
+    for specifying the install target directory.
+
+  Bug fixes:
+
+  - in fits_decompress_img, needed to add a call to ffpscl to turn
+    off the BZERO and BSCALE scaline when reading the compressed image.
+
+Version 2.430 - 4 November 2002
+
+  Enhancements:
+
+  - modified fits_create_hdu/ffcrhd so that it returns without doing
+    anything and does not generate an error if the current HDU is 
+    already an empty HDU.  There is no need in this case to append
+    a new empty HDU to the file.
+
+  - new version of group.c (supplied by B. O'Neel at the ISDC) fixes 2
+    limitations:  1 - Groups now have 256 characters rather than 160
+    for the path lengths in the group tables. - ISDC SPR 1720.  2 -
+    Groups now can have backpointers longer than 68 chars using the long
+    string convention. - ISDC SPR 1738.
+
+  - small change to f77_wrap.h and f77_wrap3.c to support the fortran
+    wrappers on SUN solaris 64-bit sparc systems (see also change to v2.033)
+
+  - small change to find_column in  eval_f.c to support unsigned long
+    columns in binary tables (with TZEROn = 2147483648.0)
+
+  - small modification to cfortran.h to support Mac OS-X, (Darwin)
+
+  Bug fixes:
+
+  - When reading tile-compress images, the BSCALE and BZERO scaling
+    keywords were not being applied, if present.
+
+  - Previous changes to the error message stack code caused the
+    tile compressed image routines to not clean up spurious error
+    messages properly.
+
+  - fits_open_image was not skipping over null primary arrays.
+
+Version 2.420 - 19 July 2002
+
+  Enhancements:
+
+  - modified the virtual filename parser to support exponential notation
+    when specifing the min, max or binsize in a binning specifier, as in:
+    myfile.fits[binr X=1:10:1.0E-01, Y=1:10:1.0E-01]
+
+  - removed the limitation on the maximum number of HDUs in a FITS file 
+    (limit used to be 1000 HDUs per file).  Now any number of HDUs
+    can be written/read in a FITS file. (BUT files that have huge numbers
+    of HDUs can be difficult to manage and are not recommended);
+
+  - modified grparser.c to support HIERARCH keywords, based on 
+    code supplied by Richard Mathar (Max-Planck)
+
+  - moved the ffflsh (fits_flush_buffer) from the private to the
+    public interface, since this routine may be useful for some  
+    applications.  It is much faster than ffflus.
+
+  - small change to the definition of OFF_T in fitsio.h to support
+    large files on IBM AIX operating systems.
+
+  Bug fixes:
+
+  - fixed potential problem reading beyond array bounds in ffpkls.  This
+    would not have affected the content of any previously generated FITS
+    files.
+
+  - in the net driver code in drvrnet.c, the requested protocol string
+    was changed from "http/1.0" to "HTTP/1.0" to support apache 1.3.26.
+
+  - When using the virtual file syntax to open a vector cell in a binary
+    table as if it were a primary array image, there was a bug
+    in fits_copy_image_cell which garbled the data if the vector
+    was more than 30000 bytes long.
+
+  - fixed problem that caused fits_report_error to crash under Visual
+    C++ on Windows systems.  The fix is to use the '/MD' switch
+    on the cl command line, or, in Visual Studio, under project
+    settings / C++ select use runtime library multithreaded DLL
+
+  - modified ffpscl so it does not attempt to reset the scaling values
+    in the internal structure if the image is tile-compressed.
+
+  - fixed multiple bugs in mem_rawfile_open which affected the case
+    where a raw binary file is read and converted on the fly into
+    a FITS file.
+
+  - several small changes to group.c to suppress compiler warnings.
+
+Version 2.410 - 22 April 2002 (used in the FTOOLS 5.2 release)
+
+  New Routines:
+
+  - fits_open_data behaves similarly to fits_open_file except that it
+    also will move to the first HDU containing significant data if
+    and an explicit HDU name or number to open was not specified.
+    This is useful for automatically skipping over a null primary
+    array when opening the file.
+
+  - fits_open_table and fits_open_image behaves similarly to 
+    fits_open_data, except they move to the first table or image
+    HDU in the file, respectively.
+
+  - fits_write_errmark and fits_clear_errmark routines can be use
+    to write an invisible marker to the CFITSIO error stack, and
+    then clear any more recent messages on the stack, back to 
+    that mark.  This preserves any older messages on the stack.
+
+  - fits_parse_range utility routine parses a row list string
+    and returns integer arrays giving the min and max row in each
+    range.
+
+  - fits_delete_rowrange deletes a specified list of rows or row
+    ranges.
+
+  - fits_copy_file copies all or part of the HDUs in the input file
+    to the output file.
+
+  - added fits_insert_card/ffikey to the publicly defined set
+    of routines (previously, it was a private routine).
+
+  Enhancements:
+
+  - changed the default numeric display format in ffgkys from 'E' format
+    to 'G' format, and changed the format for 'X' columns to a 
+    string of 8 1s or 0s representing each bit value.
+
+  - modified ffflsh so the system 'fflush' call is not made in cases
+    where the file was opened with 'READONLY' access.
+
+  - modified the output filename parser so the "-.gz", and "stdout.gz"
+    now cause the output file to be initially created in memory,
+    and then compressed and written out to the stdout stream when
+    the file is closed.
+
+  - modified the routines that delete rows from a table to also 
+    update the variable length array heap, to remove any orphaned
+    data from the heap.
+
+  - modified ffedit_columns so that wild card characters may be
+    used when specifying column names in the 'col' file filter
+    specifier (e.g.,  file.fits[col TIME; *RAW] will create a
+    virtual table contain only the TIME column and any other columns
+    whose name ends with 'RAW').
+
+  - modified the keyword classifier utility, fits_get_keyclass, to
+    support cases where the input string is just the keyword name,
+    not the entire 80-character card.
+
+  - modified configure.in and configure to see if a proprietary
+    C compiler is available (e.g. 'cc'), and only use 'gcc' if not.
+
+  - modified ffcpcl (copy columns from one table to another) so that
+    it also copies any WCS keywords related to that column.
+
+  - included an alternate source file that can be used to replace
+    compress.c, which is distributed under the GNU General Public
+    Licence.  The alternate file contains non-functional stubs for
+    the compression routines, which can be used to make a version of
+    CFITSIO that does not have the GPL restrictions (and is also less
+    functional since it cannot read or write compressed FITS files).
+
+  - modifications to the iterator routine (ffiter) to support writing
+    tile compressed output images.
+
+  - modified ffourl to support the [compress] qualifier when specifying
+    the optional output file name. E.g., file.fit(out.file[compress])[3]
+
+  - modified imcomp_compress_tile to fully support implicit data type
+    conversion when writing to tile-compressed images.  Previously,
+    one could not write a floating point array to an integer compressed
+    image.
+
+  - increased the number of internal 2880-byte I/O buffers allocated
+    by CFITSIO from 25 to 40, in recognition of the larger amount
+    of memory available on typical machines today compared with
+    a few years ago.  The number of buffers can be set by the user
+    with the NIOBUF parameter in fitsio2.h.  (Setting this too large
+    can actually hurt performace).
+
+  - modified the #if statments in fitsio2.h, f77_wrap.h and f77_wrap1.c
+    to support the new Itanium 64-bit Intel PC.
+
+  - a couple minor modifications to fitsio.h needed to support the off_t
+    datatype on debian linux systems.
+
+  - increased internal buffer sizes in ffshft and ffsrow to improve
+    the I/O performance.
+
+  Bug fixes:
+
+  - fits_get_keyclass could sometimes try to append to an unterminated 
+    string, causing an overflow of a string array.   
+
+  - fits_create_template no longer worked because of improvements made
+    to other routines.  Had to modify ffghdt to not try to rescan
+    the header keywords if the file is still empty and contains no
+    keywords yet.
+
+  - ffrtnm, which returns the root filename, sometimes did not work 
+    properly when testing if the 'filename+n' convention was used for
+    specifying an extension number.
+
+  - fixed minor problem in the keyword template parsing routine, ffgthd
+    which in rare cases could cause an improperly terminated string to
+    be returned.
+
+  - the routine to compare 2 strings, ffcmps, failed to find a match 
+    in comparing strings like "*R" and "ERROR" where the match occurs
+    on the last character, but where the same matching character occurs
+    previously in the 2nd string.
+
+  - the region file reading routine (ffrrgn) did not work correctly if
+    the region file (created by POW and perhaps other programs) had an
+    'exclude' region (beginning with a '-' sign) as the first region 
+    in the file.  In this case all points outside the excluded region
+    should be accepted, but in fact no points were being accepted
+    in this case.
+
+Version 2.401 - 28 Jan 2002
+
+  - added the imcopy example program to the release (and Makefile)
+
+  Bug fixes:
+
+  - fixed typo in the imcompress code which affected compression
+    of 3D datacubes.
+
+  - made small change to fficls (insert column) to allow colums with
+    TFORMn = '1PU' and '1PV' to be inserted in a binary table.  The
+    'U' and 'V' are codes only used within CFITSIO to represent unsigned
+    16-bit and 32-bit integers; They get replaced by '1PI' and '1PJ'
+    respectively in the FITS table header, along with the appropriate
+    TZEROn keyword.
+
+Version 2.400 - 18 Jan 2002
+
+  (N.B.: Application programs must be recompiled, not just relinked 
+     with the new CFITSIO library because of changes made to fitsio.h)
+
+  New Routines:
+
+  - fits_write_subset/ffpss writes a rectangular subset (or the whole
+    image) to a FITS image.
+
+  - added a whole new family of routines to read and write arrays of 
+    'long long' integers (64-bit) to FITS images or table columns.  The
+    new routine names all end in 'jj':  ffpprjj, ffppnjj, ffp2djj,
+    ffp3djj, ffppssjj, ffpgpjj, ffpcljj, ffpcnjj. ffgpvjj, ffgpfjj,
+    ffg2djj, ffg3djj, ffgsvjj, ffgsfjj, ffggpjj, ffgcvjj, and ffgcfjj.
+
+  - added a set of helper routines that are used in conjunction with
+    the new support for tiled image compression.  3 routines set the
+    parameters that should be used when CFITSIO compresses an image:
+        fits_set_compression_type
+        fits_set_tile_dim
+        fits_set_noise_bits
+
+      3 corresponding routines report back the current settings:
+        fits_get_compression_type
+        fits_get_tile_dim
+        fits_get_noise_bits
+
+  Enhancements:
+
+  - major enhancement was made to support writing to tile-compressed
+    images.  In this format, the image is divided up into a rectangular
+    grid of tiles, and each tile of pixels is compressed individually
+    and stored in a row of a variable-length array columm in a binary
+    table.  CFITSIO has been able to transparently read this compressed
+    image format ever since version 2.1.  Now all the CFITSIO image
+    writing routines also transparently support this format.  There are
+    2 ways to force CFITSIO to write compressed images: 1) call the
+    fits_set_compression_type routine before writing the image header
+    keywords, or 2), specify that the image should be compressed when
+    entering the name of the output FITS file, using a new extended
+    filename syntax.  (examples: "myfile.fits[compress]" will use the
+    default compression parameters, and "myfile.fits[compress GZIP
+    100,100] will use the GZIP compression algorithm with 100 x 100
+    pixel tiles.
+
+  - added new driver to support creating output .gz compressed fits
+    files.  If the name of the output FITS file to be created ends with
+    '.gz' then CFITSIO will initially write the FITS file in memory and
+    then, when the FITS file is closed, CFITSIO will gzip the entire
+    file before writing it out to disk.
+
+  - when over-writing vectors in a variable length array in a binary
+    table, if the new vector to be written is less than or equal to
+    the length of the previously written vector, then CFITSIO will now
+    reuse the existing space in the heap, rather than always appending
+    the new array to the end of the heap.
+
+  - modified configure.in to support building cfitsio as a dynamic 
+    library on Mac OS X. Use 'make shared' like on other UNIX platforms,
+    but a .dylib file will be created instead of .so.  If installed in a 
+    nonstandard location, add its location to the DYLD_LIBRARY_PATH 
+    environment variable so that the library can be found at run time.
+
+  - made various modifications to better support the  8-byte long integer
+    datatype on more platforms.  The 'LONGLONG' datatype is typedef'ed
+    to equal 'long long' on most Unix platforms and MacOS, and equal
+    to '__int64' on Windows machines.
+
+  - modified configure.in and makefile.in to better support cases 
+    where the system has no Fortran compiler and thus the f77 wrapper
+    routines should not be compiled.
+
+  - made small modification to eval.y and eval_y.f to get rid of warning
+    on some platforms about redefinition of the 'alloca'.
+
+  Bug fixes:
+
+  - other recent bug fixes in ffdblk (delete blocks) caused ffdhdu (delete
+    HDU) to fail when trying to replace the primary array with a null
+    primary array.
+
+  - fixed bug that prevented inserting a new variable length column
+    into a table that already contained variable length data.
+
+  - modified fits_delete_file so that it will delete the file even if
+    the input status value is not equal to zero.
+
+  - in fits_resize_image, it was sometimes necessary to call ffrdef to
+    force the image structure to be defined.
+
+  - modified the filename parser to support input files with names like:
+    "myfile.fits.gz(mem://tmp)" in which the url type is specified for
+    the output file but not for the input file itself.  This required
+    modifications to ffiurl and ffrtnm.
+
+Version 2.301 -   7 Dec 2001
+
+  Enhancements:
+
+   - modified the http file driver so that if the filename to be opened
+     contains a '?' character (most likely a cgi related string) then it
+     will not attempt to append a .gz or .Z as it would normally do.
+
+   - added support for the '!' clobber character when specifying
+     the output disk file name in CFITSIO's extended filename syntax, e.g.,
+     'http://a.b.c.d/myfile.fits.gz(!outfile.fits)'
+
+   - added new device driver which is used when opening a compressed FITS
+     file on disk by uncompressing it into memory with READWRITE
+     access.  This happens when specifying an output filename
+     'mem://'.
+
+   - added 2 other device drivers to open http and ftp files in memory
+     with write access.
+
+   - improved the error trapping and reporting in cases where program
+     attempts to write to a READONLY file (especially in cases where the
+    'file' resides in memory, as is the case when opening an ftp or http
+     file.
+
+   - modified the extended filename parser so that it is does not confuse
+     the bracket character '[' which is sometimes used in the root name
+     of files of type 'http://', as the start of an extname or row filter
+     expression.  If the file is of type 'http://', the parser now
+     checks to see if the last character in the extended file name is
+     a ')' or ']'.  If not, it does not try to parse the file name
+     any further.
+
+   - improved the efficiency when writing FITS files in memory, by
+     initially allocating enough memory for the entire HDU when it is
+     created, rather than incrementally reallocing memory 2880 bytes
+     at a time (modified ffrhdu and mem_truncate).  This change also
+     means that the program will fail much sooner if it cannot allocate
+     enough memory to hold the entire FITS HDU.
+
+  Bug fixes:
+
+   - There was an error in the definition of the Fortran ftphtb wrapper
+     routine (writes required ASCII table header keywords) that caused
+     it to fail on DEC OSF and other platforms where sizeof(long) = 8.
+
+Version 2.300 - 23 Oct 2001
+
+  New Routines:
+
+   - fits_comp_img and fits_decomp_img are now fully supported and
+     documented.  These routine compress and decompress, respective,
+     a FITS image using a new algorithm in which the image is first
+     divided into a grid of rectangular tiles, then the compressed byte
+     stream from each tile is stored in a row of a binary table.
+     CFITSIO can transparently read FITS images stored in this
+     compressed format.  Compression ratios of 3 - 6 are typically
+     achieved.  Large compression ratios are achieved for floating
+     point images by throwing away non-significant noise bits in the
+     pixel values.
+
+   - fits_test_heap tests the integrity of the binary table heap and
+     returns statistics on the amount of unused space in the heap and
+     the amount of space that is pointed to by more than 1 descriptor.
+
+   - fits_compress_heap which will reorder the arrays in the binary
+     table heap, recovering any unused space.
+
+  Enhancements:
+
+   - made substantial internal changes to the code to support FITS
+     files containing 64-bit integer data values.  These files have
+     BITPIX = 64 or TFORMn = 'K'.  This new feature in CFITSIO is
+     currently only enabled if SUPPORT_64BIT_INTEGERS is defined = 1 in
+     the beginning of the fitsio2.h file.  By default support for
+     64-bit integers is not enabled.
+
+   - improved the ability to read and return a table column value as a
+     formatted string by supporting quasi-legal TDISPn values which
+     have a lowercase format code letter, and by completely ignoring
+     other unrecognizable TDISPn values.  Previously, unrecognized
+     TDISPn values could cause zero length strings to be returned.
+
+   - made fits_write_key_longstr more efficient when writing keywords
+     using the long string CONTINUE convention.  It previously did not
+     use all the available space on each card when the string to be
+     written contained many single quote characters.
+
+   - added a new "CFITSIO Quick Start Guide" which provides all the
+     basic information needed to write C programs using CFITSIO.
+
+   - updated the standard COMMENT keywords that are written at the 
+     beginning of every primary array to refer to the newly published
+     FITS Standard document in Astronomy and Astrophysics.
+     Note: because of this change, any FITS file created with this
+     version of CFITSIO will not be identical to the same file written
+     with a previous version of CFITSIO.
+
+   - replaced the 2 routines in pliocomp.c with new versions provided by
+     D Tody and N Zarate.  These routines compress/uncompress image pixels
+     using the IRAF pixel list compression algorithm.
+
+   - modified fits_copy_hdu so that when copying a Primary Array
+     to an Image extension, the COMMENT cards which give the reference
+     to the A&A journal article about FITS are not copied.  In the
+     inverse case the COMMENT keywords are inserted in the header.
+     
+   - modified configure and Makefile.in to add capability to build a
+     shared version of the CFITSIO library.  Type 'make shared' or 
+     'make libcfitsio.so' to invoke this option.
+
+   - disabled some uninformative error messages on the error stack:
+       1) when calling ffclos (and then ffchdu) with input status > 0
+       2) when ffmahd tries to move beyond the end of file.
+     The returned status value remains the same as before, but the
+     annoying error messages no longer get written to the error stack.
+
+   - The syntax for column filtering has been modified so that
+     if one only specifies a list of column names, then only those
+     columns will be copied into the output file.  This provides a simple
+     way to make a copy of a table containing only a specified list of
+     columns.  If the column specifier explicitly deletes a column, however,
+     than all the other columns will be copied to the filtered input
+     file, regardless of whether the columns were listed or not.
+     Similarly, if the expression specifies only a column to be modified
+     or created, then all the other columns in the table will be
+     copied.
+
+      mytable.fit[1][col Time;Rate]  - only the Time and Rate
+        columns will be copied to the filtered input file.
+
+      mytable.fit[1][col -Time ] - all but the Time column are copied
+        to the filtered input file.
+
+      mytable.fit[1][col Rate;-Time] - same as above.
+
+   - changed a '#if defined' statement in f77_wrap.h and f77_wrap1.c 
+     to support the fortran wrappers on 64-bit IBM/RS6000 systems
+
+   - modified group.c so that when attaching one group (the child) to 
+     another (the parent), check in each file for the existence of a 
+     pointer to the other before adding the link. This is to prevent
+     multiple links from forming under all circumstances.
+
+   - modified the filename parser to accept 'STDIN', 'stdin', 
+     'STDOUT' and 'stdout' in addition to '-' to mean read the
+     file from standard input or write to standard output.
+
+   - Added support for reversing an axis when reading a subsection
+     of a compressed image using the extended filename syntax, as in
+     myfile.fits+1[-*, *] or myfile.fits+1[600:501,501:600]
+
+   - When copying a compressed image to a uncompressed image, the
+     EXTNAME keyword is no longer copied if the value is equal to
+     'COMPRESSED_IMAGE'.
+
+   - slight change to the comment field of the DATE keyword to reflect
+     the fact that the Unix system date and time is not true UTC time.
+
+  Bug fixes:
+
+   - fits_write_key_longstr was not writing the keyword if a null
+     input string value was given.
+
+   - writing data to a variable length column, if that binary table is not
+     the last HDU in the FITS file, might overwrite the following HDU.
+     Fixed this by changing the order of a couple operations in ffgcpr.
+
+   - deleting a column from a table containing variable length columns
+     could cause the last few FITS blocks of the file to be reset = 0.
+     This bug occurred as a result of modifications to ffdblk in v2.202.
+     This mainly affects users of the 'compress_fits' utility
+     program.
+
+   - fixed obscure problem when writing bits to a variable length 'B' 
+     column.
+
+   - when reading a subsection of an image, the BSCALE and BZERO pixel
+     scaling may not have been applied when reading image pixel values
+     (even though the scaling keywords were properly written in the
+     header).
+
+   - fits_get_keyclass was not returning 'TYP_STRUCT_KEY' for the
+     END keyword.
+
+Version 2.204 - 26 July 2001 
+
+  Bug fixes:
+
+   - Re-write of fits_clean_url in group.c to solve various problems
+     with invalid bounds checking.
+
+Version 2.203 -  19 July 2001 (version in FTOOLS v5.1)
+
+  Enhancements:
+
+   - When a row selection or calculator expression is written in
+     an external file (and read by CFITSIO with the '@filename' syntax)
+     the file can now contain comment lines.  The comment line must
+     begin with 2 slash characters as the first 2 characters on the
+     line.  CFITSIO will ignore the entire line when reading the
+     expression.
+
+  Bug fixes:
+
+   - With previous versions of CFITSIO, the pixel values in a FITS
+     image could be read incorrectly in the following case: when
+     opening a subset of a FITS image (using the
+     'filename.fits[Xmin:Xmax,Ymin:Ymax]' notation) on a PC linux, PC
+     Windows, or DEC OSF machine (but not on a SUN or Mac).  This
+     problem only occurs when reading more than 8640 bytes of data
+     (2160 4-byte integers) at a time, and usually only occurs if the
+     reading program reads the pixel data immediately after opening the
+     file, without first reading any header keywords.  This error would
+     cause strips of zero valued pixels to appear at semi-random
+     positions in the image, where each strip usually would be 2880
+     bytes long.  This problem does not affect cases where the input
+     subsetted image is simply copied to a new output FITS file.
+
+
+Version 2.202 -  22 May 2001
+
+  Enhancements:
+
+   - revised the logic in the routine that tests if a point is
+     within a region:  if the first region is an excluded region,
+     then it implicitly assumes a prior include region covering
+     the entire detector.  It also now supports cases where a 
+     smaller include region is within a prior exclude region.
+
+   - made enhancement to ffgclb (read bytes) so that it can
+     also read values from a logical column, returning an array
+     of 1s and 0s.  
+
+   - defined 2 new grouping error status values (349, 350) in 
+     cfitsio.h and made minor changes to group.c to use these new
+     status values.
+
+   - modified fits_open_file so that if it encounters an error while
+     trying to move to a user-specified extension (or select a subset
+     of the rows in an input table, or make a histogram of the
+     column values) it will close the input file instead of leaving
+     it open.
+
+   - when using the extended filename syntax to filter the rows in
+     an input table, or create a histogram image from the values in
+     a table column, CFITSIO now writes HISTORY keywords in the 
+     output file to document the filtering expression that was used.
+
+  Bug fixes:
+
+   - ffdblk (called by ffdrow) could overwrite the last FITS block(s) in 
+     the file in some cases where one writes data to a variable length
+     column and then calls ffdrow to delete rows in the table.  This
+     bug was similar to the ffiblk bug that was fixed in v2.033.
+
+   - modified fits_write_col_null to fix a problem which under unusual
+     circumstances would cause a End-of-File error when trying to
+     read back the value in an ASCII string column, after initializing
+     if by writing a null value to it. 
+
+   - fixed obscure bug in the calculator function that caused an
+     error when trying to modify the value of a keyword in a HDU
+     that does not have a NAXIS2 keyword (e.g., a null primary array).
+
+   - the iterator function (in putcol.c) had a bug when calculating
+     the optimum number rows to process in the case where the table
+     has very wide rows (>33120 bytes) and the calculator expression
+     involves columns from more than one FITS table.  This could
+     cause an infinite loop in calls to the ffcalc calculator function.
+
+   - fixed bug in ffmvec, which modifies the length of an 
+     existing vector column in a binary table.  If the vector
+     was reduced in length, the FITS file could sometimes be left
+     in a corrupted state, and in all cases the values in the remaining
+     vector elements of that column would be altered.
+
+   - in drvrfile.c, replaced calls to fsetpos and fgetpos with
+     fseek and ftell (or fseeko and ftello) because the fpos_t
+     filetype used in fsetpos is incompatible with the off_t
+     filetype used in fseek, at least on some platforms (Linux 7.0).
+     (This fix was inserted into the V2.201 release on April 4).
+
+   - added "#define fits_write_pixnull ffppxn" to longnam.h
+
+Version 2.201 - 15 March 2001
+
+  Enhancements
+
+   - enhanced the keyword reading routines so that they will do
+     implicit datatype conversion from a string keyword value
+     to a numeric keyword value, if the string consist of a
+     valid number enclosed in quotes.  For example, the keyword
+     mykey = '37.5' can be read by ffgkye.
+
+   - modified ffiimg so that it is possible to insert a new
+     primary array at the beginning of the file.  The original
+     primary array is then converted into an IMAGE extension.
+
+   - modified ffcpdt (copy data unit) to support the case where 
+     the data unit is being copied between 2 HDUs in the same file.
+
+   - enhanced the fits_read_pix and fits_read_pixnull routines so
+     that they support the tiled image compression format that the
+     other image reading routines also support.
+
+   - modified the Extended File Name syntax to also accept a 
+     minus sign (-) as well as an exclamation point (!) as
+     the leading character when specifying a column or or keyword
+     to be deleted, as in [col -time] will delete the TIME column.
+
+   - now completely support reading subimages, including pixel
+     increments in each dimension, for tile-compressed images
+     (where the compressed image tiles are stored in a binary
+      table).
+
+  Bug fixes:
+
+   - fixed confusion in the use of the fpos_t and off_t datatypes
+     in the fgetpos and fsetpos routines in drvrfile.c which caused
+     problems with the Windows VC++ compiler.  (fpos_t is not 
+     necessarily identical to off_t)
+
+   - fixed a typo in the fits_get_url function in group.c which 
+     caused problems when determining the relative URL to a compressed
+     FITS file.
+
+   - included fitsio.h in the shared memory utility program,
+     smem.c, in order to define OFF_T. 
+
+   - fixed typo in the datatype of 'nullvalue' in ffgsvi, which caused
+     attempts to read subsections of a short integer tiled compressed
+     image to fail with a bus error.    
+
+   - fixed bug in ffdkey which sometimes worked incorrectly if one 
+     tried to delete a nonexistent keyword beyond the end of the header.
+
+   - fixed problem in fits_select_image_section when it writes a dummy
+     value to the last pixel of the section.  If the image contains
+     scaled integer pixels, then in some cases the pixel value could end
+     up out of range.
+
+   - fixed obscure bug in the ffpcn_ family of routines which gave
+     a floating exception when trying to write zero number of pixels to
+     a zero length array  (why would anyone do this?)
+
+Version 2.200 - 26 Jan 2001
+
+  Enhancements
+
+   - updated the region filtering code to support the latest region
+     file formats that are generated by the POW, SAOtng and ds9
+     programs.  Region positions may now be given in HH:MM:SS.s,
+     DD:MM:SS.s format, and region sizes may be given arcsec or arcmin
+     instead of only in pixel units.  Also changed the logic so that if
+     multiple 'include' regions are specified in the region file, they
+     are ORed together, instead of ANDed, so that the filtering keeps
+     points that are located within any of the 'include' regions, not
+     just the intersection of the regions.
+
+   - added support for reading raw binary data arrays by converting
+     them on the fly into virtual FITS files.
+
+   - modified ffpmsg, which writes error messages to CFITSIO's internal
+     error stack, so that messages > 80 characters long will be wrapped
+     around into multiple 80 character messages, instead of just
+     being truncated at 80 characters.
+
+   - modified the CFITSIO parser so that expression which involve
+     scaled integer columns get cast to double rather than int.
+
+   - Modified the keyword template parsing routine, ffgthd, to
+     support the HIERARCH keyword.
+
+   - modified ffainit and ffbinit so that they don't unnecessarily
+     allocate 0 bytes of memory if there are no columns (TFIELDS = 0)
+     in the table that is being opened.
+
+   - modified fitsio2.h to support NetBSD on Alpha OSF platforms
+     (NetBSD does not define the '__unix__' symbol).
+
+   - changed the way OFF_T is defined in fitsio.h for greater
+     portability.
+
+   - changed drvrsmem.c so it is compiled only when HAVE_SHMEM_SERVICES
+     is defined in order to removed the conditional logic from the Makefile
+
+   - reorganized the CFITSIO User's guide to make it
+     clearer and easier for new users to learn the basic routines.
+
+   - fixed ffhdef (which reserves space for more header keywords) so
+     that is also updates the start position of the next HDU.  This
+     affected the offset values returned by ffghof.
 
 Version 2.100 - 18 Oct 2000
 
@@ -258,7 +1308,7 @@ Version 2.036 - 1 Feb 2000
      by setting CFLAGS = -Df2cFortran instead of -Dg77Fortran. Then
      regenerated configure with autoconf 2.13 instead of 2.12.     
 
-Version 2.035 - 7 Dec 1999 (internal release only)
+Version 2.035 - 7 Dec 1999 (internal release only, FTOOLS 5.0.2)
 
    - added new routine called fits_get_keyclass/ffgkcl that returns
      the general class of the keyword, e.g., required structural 
@@ -325,13 +1375,13 @@ Version 2.034 - 23 Nov 1999
      reading routines to sometimes not find a matching keyword if the
      input name template used the '*' wildcard as the last character.
      (e.g., if input name = 'COMMENT*' then it would not find the
-     'COMMMENT' keywords.  (It would have found longer keywords like
+     'COMMENT' keywords.  (It would have found longer keywords like
      'COMMENTX' correctly). The fix required a minor change to ffgcrd
      in getkey.c
 
    - modified the routine (ffswap8) that does byteswapping of
      double precision numbers.  Some linux systems have reported floating
-     point exceptions because they were trying to interprete the bytes
+     point exceptions because they were trying to interpret the bytes
      as a double before the bytes had been swapped.
 
    - fixed bug in the calculation of the position of the last byte
@@ -359,12 +1409,12 @@ Version 2.033 - 17 Sept 1999
 
    - New Feature: enhanced the row selection parser so that comparisons
      between values in different rows of the table are allowed, and the
-     string comparisions with <, >, <=, and >= are supported.
+     string comparisons with <, >, <=, and >= are supported.
 
    - added new routine the returns the name of the keyword in the
      input keyword record string.  The name is usually the first
      8 characters of the record, except if the HIERARCH convention
-     is being used in which case the name may be up to 67 charcters
+     is being used in which case the name may be up to 67 characters
      long.
 
    - added new routine called fits_null_check/ffnchk that checks to
@@ -410,7 +1460,7 @@ Version 2.033 - 17 Sept 1999
    - fixed bug in ffiblk that could sometimes cause it to insert a
      new block in a file somewhere in the middle of the data, instead
      of at the end of the HDU.  This fortunately is a rare problem,
-     mainly only occuring in certain cases when  inserting rows in a binary 
+     mainly only occurring in certain cases when  inserting rows in a binary 
      table that contains variable length array data (i.e., has a heap).
 
    - modified fits_write_tdim so that it double checks the TFORMn
@@ -489,7 +1539,7 @@ Version 2.031 - 31 Mar 1999
      keyword (number of rows in the table) to not be updated.
 
    - fixed bug (introduced in version 2.030) when writing null values
-     to a primary array or image extention.  If trying to set more
+     to a primary array or image extension.  If trying to set more
      than 1 pixel to null at a time, then typically only 1 null would
      be written.  Also fixed related bug when writing null values to
      rows in a table that are beyond the currently defined size of the
@@ -503,7 +1553,7 @@ Version 2.031 - 31 Mar 1999
      odd numbered rows and columns.
 
    - modified fitscore.c to set the initial max size of the header, when
-     first reading it, to the curent size of the file, rather than to 
+     first reading it, to the current size of the file, rather than to 
      2 x 10**9 to avoid rare cases where CFITSIO ends up writing a huge 
      file to disk.
 
@@ -521,12 +1571,12 @@ Version 2.030 - 24 Feb 1999
    - major new feature:  enhanced the routines that read ASCII string
      columns in tables so that they can read any table column, including
      logical and numeric valued columns.  The column values are returned
-     as a formated string.  The format is determined by the TDISPn
+     as a formatted string.  The format is determined by the TDISPn
      keyword if present, otherwise a default format based on the
      datatype of the column is used.
 
   -  new routine:  fits_get_col_display_width/ffgcdw returns the length
-     of the formated strings that will be returned by the routines that
+     of the formatted strings that will be returned by the routines that
      read table columns as strings. 
 
    - major new feature:  added support for specifying an 'image section'
@@ -723,7 +1773,7 @@ Version 2.026 - 23 Dec 1998
 
    - modified grparser.c to compile correctly on Alpha/OSF machines
 
-   - modifed drvrnet.c to eliminate compiler warnings
+   - modified drvrnet.c to eliminate compiler warnings
 
    - Modified Makefile.in to include targets for building all the sample
      programs that are included with CFITSIO.
@@ -763,10 +1813,10 @@ Version 2.024 - 9 Nov 1998
 
 Version 2.023 - 1 Nov 1998 - first full release of CFITSIO 2.0
 
-   - slightly modified the way real keyword values are formated, to ensure
+   - slightly modified the way real keyword values are formatted, to ensure
      that it includes a decimal point.  E.g.,  '1.0E-09' instead of '1E-09'
 
-   - added new funtion to support template files when creating new FITS files.
+   - added new function to support template files when creating new FITS files.
 
    - support the TCROTn WCS keyword in tables, when reading the WCS keywords.
 
@@ -825,7 +1875,7 @@ Version 2.023 - 1 Nov 1998 - first full release of CFITSIO 2.0
 
    - major modification to support opening the same FITS file more
      than once.  Now one can open the same file multiple times and
-     read and write simulataneously to different HDUs within the file.
+     read and write simultaneously to different HDUs within the file.
      fits_open_file automatically detects if the file is already opened.
 
    - added the ability to clobber/overwrite an existing file
@@ -1086,7 +2136,7 @@ Version 1.30 - 11 September 1997
 
    - major overhaul to support reading and writing FITS files
      in memory.   The new routines fits_set_mem_buff and 
-     fits_write_mem_buff have been added to intialize and
+     fits_write_mem_buff have been added to initialize and
      copy out the memory buffer, respectively.
 
    - added support for reading FITS files piped in on 'stdin'
@@ -1126,7 +2176,7 @@ Version 1.30 - 11 September 1997
      in the ffgphd routine.
 
    - check status value in ffgkls to make sure the keyword exists
-     before allocating memeory for the value string.
+     before allocating memory for the value string.
 
    - fixed the support for writing and reading unsigned long integer
      keyword values in ffpky and ffgky by internally treating
@@ -1389,7 +2439,7 @@ Version 1.04 - 17 Sept 1996
      to support the Mac platforms.
 
    - fixed bug in ffpdfl that caused an EOF error (107) when a program
-     creats a new extention that is an exact multiple of 2880 bytes long,
+     creates a new extension that is an exact multiple of 2880 bytes long,
      AND the program does not write a value to the last element
      in the table or image.
 
diff --git a/checksum.c b/checksum.c
index 0ba6728..3cde995 100644
--- a/checksum.c
+++ b/checksum.c
@@ -242,6 +242,9 @@ int ffpcks(fitsfile *fptr,      /* I - FITS file pointer                  */
     if (ffrdef(fptr, status) > 0)
         return(*status);
 
+    if ((fptr->Fptr)->heapsize > 0)
+         ffuptf(fptr, status);  /* update the variable length TFORM values */
+
     /* write the correct data fill values, if they are not already correct */
     if (ffpdfl(fptr, status) > 0)
         return(*status);
diff --git a/compress.c b/compress.c
index 8d47664..26724e0 100644
--- a/compress.c
+++ b/compress.c
@@ -395,6 +395,13 @@ int compress2mem_from_mem(
              void *(*mem_realloc)(void *p, size_t newsize), 
              size_t *filesize,  
              int *status);
+
+int compress2file_from_mem(                                                
+             char *inmemptr,     
+             size_t inmemsize, 
+             FILE *outdiskfile, 
+             size_t *filesize,   /* O - size of file, in bytes              */
+             int *status);
 /*--------------------------------------------------------------------------*/
 int uncompress2mem(char *filename,  /* name of input file                 */
              FILE *diskfile,     /* I - file pointer                        */
@@ -653,7 +660,82 @@ int compress2mem_from_mem(
     *filesize = bytes_out;
     return(*status);
 }
+/*--------------------------------------------------------------------------*/
+int compress2file_from_mem(                                                
+             char *inmemptr,     /* I - memory pointer to uncompressed bytes */
+             size_t inmemsize,   /* I - size of input uncompressed file      */
+             FILE *outdiskfile, 
+             size_t *filesize,   /* O - size of file, in bytes              */
+             int *status)
+/*
+  Compress the memory file into disk file. 
+*/
+{
+    uch  flags = 0;         /* general purpose bit flags */
+    ush  attr = 0;          /* ascii/binary flag */
+    ush  deflate_flags = 0; /* pkzip -es, -en or -ex equivalent */
+
+    if (*status > 0)
+        return(*status);
 
+    /*  save input parameters into global variables */
+    in_memptr =  inmemptr;
+    in_memsize = inmemsize;
+
+    ofd = outdiskfile;
+
+    realloc_fn = NULL; /* a null reallocation fn signals that the file is */
+                       /* to be compressed to a file on disk, not memory */
+
+
+    /* clear input and output buffers */
+
+    outcnt = 0;
+    insize = inptr = 0;
+    bytes_in = bytes_out = 0L;
+
+    part_nb = 0;
+
+    method = DEFLATED; 
+
+    /* write gzip header bytes */
+
+    put_byte(GZIP_MAGIC[0]); /* magic header */
+    put_byte(GZIP_MAGIC[1]);
+    put_byte(DEFLATED);      /* compression method */
+    put_byte(flags);         
+
+/* 
+ just write zero as dummy value for the timestamp
+    put_long(time_stamp);
+*/
+    put_long(0); /* dummy time stamp */
+
+    /* Write deflated file to zip file */
+    crc_value = updcrc(0, 0);
+
+    bi_init(NO_FILE);
+    ct_init(&attr, &method);
+    lm_init(level, &deflate_flags);
+
+    put_byte((uch)deflate_flags); /* extra flags */
+    put_byte(0);            /* OS identifier; 0 = default */
+
+    header_bytes = (long)outcnt;
+
+    (void)deflate();
+
+    /* Write the crc and uncompressed size */
+    put_long(crc_value);
+    put_long(isize);
+    header_bytes += 2*sizeof(long);
+
+    flush_outbuf();
+
+    *filesize = bytes_out;
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 /*   ******************************  */
 /*   The following came from gzip.c  */
 /*   ******************************  */
@@ -687,13 +769,13 @@ local int get_method(in)
     if (memcmp(magic, GZIP_MAGIC, 2) == 0
         || memcmp(magic, OLD_GZIP_MAGIC, 2) == 0) {
 
-
 	method = (int)get_byte();
 	if (method != DEFLATED) {
 	    error("unknown compression method -- get newer version of gzip");
 	    exit_code = ERROR;
 	    return -1;
 	}
+
 	work = unzip;
 	flags  = (uch)get_byte();
 
@@ -4443,6 +4525,7 @@ local void build_tree(desc)
     int n, m;          /* iterate over heap elements */
     int max_code = -1; /* largest code with non zero frequency */
     int node = elems;  /* next internal node of the tree */
+    int new;    /* WDP added this, instead of declaring it below */
 
     /* Construct the initial heap, with least frequent element in
      * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
@@ -4465,7 +4548,8 @@ local void build_tree(desc)
      * two codes of non zero frequency.
      */
     while (heap_len < 2) {
-        int new = heap[++heap_len] = (max_code < 2 ? ++max_code : 0);
+/*      int new = heap[++heap_len] = (max_code < 2 ? ++max_code : 0); */
+            new = heap[++heap_len] = (max_code < 2 ? ++max_code : 0);
         tree[new].Freq = 1;
         depth[new] = 0;
         opt_len--; if (stree) static_len -= stree[new].Len;
diff --git a/compress_alternate.c b/compress_alternate.c
new file mode 100644
index 0000000..7ae5a91
--- /dev/null
+++ b/compress_alternate.c
@@ -0,0 +1,155 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+/* ======================================================================
+
+This file contains stubs for the compression and uncompression routines
+that are contained in the source file compress.c.  Those routines (in
+compress.c) can only be used by software which adheres to the terms of
+the GNU General Public License.  Users who want to use CFITSIO but are
+unwilling to release their code under the terms of the GNU General
+Public License should replace the compress.c file with this current
+file before building the CFITSIO library.   This alternative version of
+CFITSIO will behave the same as the standard version, except that it
+will not support reading or writing of FITS files in compressed format.
+
+======================================================================== */
+/* prototype for the following functions */
+
+void ffpmsg(const char *err_message);
+
+int uncompress2mem(char *filename, 
+             FILE *diskfile, 
+             char **buffptr, 
+             size_t *buffsize, 
+             void *(*mem_realloc)(void *p, size_t newsize),
+             size_t *filesize,
+             int *status);
+
+int uncompress2mem_from_mem(                                                
+             char *inmemptr,     
+             size_t inmemsize, 
+             char **buffptr,  
+             size_t *buffsize,  
+             void *(*mem_realloc)(void *p, size_t newsize), 
+             size_t *filesize,  
+             int *status);
+
+int uncompress2file(char *filename, 
+             FILE *indiskfile, 
+             FILE *outdiskfile, 
+             int *status);
+
+int compress2mem_from_mem(                                                
+             char *inmemptr,     
+             size_t inmemsize, 
+             char **buffptr,  
+             size_t *buffsize,  
+             void *(*mem_realloc)(void *p, size_t newsize), 
+             size_t *filesize,  
+             int *status);
+
+int compress2file_from_mem(                                                
+             char *inmemptr,     
+             size_t inmemsize, 
+             FILE *outdiskfile, 
+             size_t *filesize,   /* O - size of file, in bytes              */
+             int *status);
+/*--------------------------------------------------------------------------*/
+int uncompress2mem(char *filename,  /* name of input file                 */
+             FILE *diskfile,     /* I - file pointer                        */
+             char **buffptr,   /* IO - memory pointer                     */
+             size_t *buffsize,   /* IO - size of buffer, in bytes           */
+             void *(*mem_realloc)(void *p, size_t newsize), /* function     */
+             size_t *filesize,   /* O - size of file, in bytes              */
+             int *status)        /* IO - error status                       */
+
+/*
+  Uncompress the file into memory.  Fill whatever amount of memory has
+  already been allocated, then realloc more memory, using the supplied
+  input function, if necessary.
+*/
+{
+    if (*status > 0)
+        return(*status);
+
+    ffpmsg("This non-GNU version of CFITSIO does not support compressed files");
+    return(*status = 414);
+}
+/*--------------------------------------------------------------------------*/
+int uncompress2mem_from_mem(                                                
+             char *inmemptr,     /* I - memory pointer to compressed bytes */
+             size_t inmemsize,   /* I - size of input compressed file      */
+             char **buffptr,   /* IO - memory pointer                      */
+             size_t *buffsize,   /* IO - size of buffer, in bytes           */
+             void *(*mem_realloc)(void *p, size_t newsize), /* function     */
+             size_t *filesize,   /* O - size of file, in bytes              */
+             int *status)        /* IO - error status                       */
+
+/*
+  Uncompress the file into memory.  Fill whatever amount of memory has
+  already been allocated, then realloc more memory, using the supplied
+  input function, if necessary.
+*/
+{
+    if (*status > 0)
+        return(*status);
+
+    ffpmsg("This non-GNU version of CFITSIO does not support compressed files");
+    return(*status = 414);
+}
+/*--------------------------------------------------------------------------*/
+int uncompress2file(char *filename,  /* name of input file                  */
+             FILE *indiskfile,     /* I - input file pointer                */
+             FILE *outdiskfile,    /* I - output file pointer               */
+             int *status)        /* IO - error status                       */
+
+/*
+  Uncompress the file into file. 
+*/
+{
+    if (*status > 0)
+        return(*status);
+
+    ffpmsg("This non-GNU version of CFITSIO does not support compressed files");
+    return(*status = 414);
+}
+/*--------------------------------------------------------------------------*/
+int compress2mem_from_mem(                                                
+             char *inmemptr,     /* I - memory pointer to uncompressed bytes */
+             size_t inmemsize,   /* I - size of input uncompressed file      */
+             char **buffptr,   /* IO - memory pointer for compressed file    */
+             size_t *buffsize,   /* IO - size of buffer, in bytes           */
+             void *(*mem_realloc)(void *p, size_t newsize), /* function     */
+             size_t *filesize,   /* O - size of file, in bytes              */
+             int *status)        /* IO - error status                       */
+
+/*
+  Compress the file into memory.  Fill whatever amount of memory has
+  already been allocated, then realloc more memory, using the supplied
+  input function, if necessary.
+*/
+{
+    if (*status > 0)
+        return(*status);
+
+    ffpmsg("This non-GNU version of CFITSIO does not support compressed files");
+    return(*status = 413);
+}
+/*--------------------------------------------------------------------------*/
+int compress2file_from_mem(                                                
+             char *inmemptr,     /* I - memory pointer to uncompressed bytes */
+             size_t inmemsize,   /* I - size of input uncompressed file      */
+             FILE *outdiskfile, 
+             size_t *filesize,   /* O - size of file, in bytes              */
+             int *status)
+/*
+  Compress the memory file into disk file. 
+*/
+{
+    if (*status > 0)
+        return(*status);
+
+    ffpmsg("This non-GNU version of CFITSIO does not support compressed files");
+    return(*status = 413);
+}
diff --git a/compress_fits.c b/compress_fits.c
deleted file mode 100644
index d1f0cb1..0000000
--- a/compress_fits.c
+++ /dev/null
@@ -1,160 +0,0 @@
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "fitsio.h"
-
-void printerror( int status);
-int main(int argc, char *argv[])
-{
-    fitsfile *infptr, *outfptr;  /* pointer to the FITS files */
-
-    int status, imgtype, compress_type = 0, blocksize, nbits;
-    char infile[FLEN_FILENAME];     
-    char outfile[FLEN_FILENAME];
-    long tilesize[2], origsize, outsize;
-
-    status = 0;
-
-    if (argc != 6 && argc != 4 && argc != 3 )
-    {
-        printf("Usage:\n\n");
-        printf("   compress_fits infile outfile compress_type xtilesize ytilesize\n\n");
-        printf(" where,\n");
-        printf("   infile  = name of input FITS image file to be compressed\n");
-        printf("   outfile = name of output compressed FITS image file \n");
-        printf("   compress_type = r (RICE, default), g (GZIP), or p (PLIO) \n");
-        printf("   xtilesize = x dimension of tiles   (default = NAXIS1)\n");
-        printf("   ytilesize = y dimension of tiles   (default = 1)\n\n");
-        printf(" Example 1: compress infile using RICE algorithm and default tile size:\n\n");
-        printf("        compress_fits infile.fits outfile.fits\n\n");
-        printf(" Example 2: compress infile using GZIP algorithm and 64x64 pixel tile size:\n\n");
-        printf("        compress_fits infile.fits outfile.fits g 64 64\n\n");
-        exit(0);
-    }
-
-    strcpy(infile, argv[1] );   /* name of file to compress */
-    strcpy(outfile, argv[2] );   /* name of output file */
-
-    /*  open input image  */
-    if ( fits_open_file(&infptr, infile, READONLY, &status) ) 
-         printerror( status );
-
-    /*  get image dimensions */
-    fits_get_img_size(infptr, 2, tilesize, &status);
-    printf("image dimensions = %ld x %ld\n", tilesize[0], tilesize[1]);
-
-    fits_get_img_type(infptr, &imgtype, &status);
-    printf("imgtype = %d\n", imgtype);
-
-    origsize = tilesize[0] * tilesize[1] * abs(imgtype) / 8;
-
-    /*  parse command-line arguments */
-    if (argc == 3)
-    {
-        tilesize[1] = 1;
-        compress_type = RICE_1;
-    }
-    else if (argc == 4)
-    {
-         tilesize[1] = 1;
-         if (*argv[3] == 'r')
-             compress_type = RICE_1;
-         else if (*argv[3] == 'g')
-             compress_type = GZIP_1;
-
-         else if (*argv[3] == 'p')
-             compress_type = PLIO_1;
-         else
-         {
-             printf("unknown compression type: %s\n", argv[3]);
-             exit(1);
-         }
-    }
-    else if (argc == 5)
-    {
-          tilesize[0] = atoi(argv[3]);
-          tilesize[1] = atoi(argv[4]);
-    }
-    else 
-    {
-         if (*argv[3] == 'r')
-             compress_type = RICE_1;
-         else if (*argv[3] == 'g')
-             compress_type = GZIP_1;
-
-         else if (*argv[3] == 'p')
-             compress_type = PLIO_1;
-         else
-         {
-             printf("unknown compression type: %s\n", argv[3]);
-             exit(1);
-         }
-
-          tilesize[0] = atoi(argv[4]);
-          tilesize[1] = atoi(argv[5]);
-    }
-
-    printf("tile dimensions  = %ld x %ld\n", tilesize[0], tilesize[1]);
-
-    if (compress_type == RICE_1)
-          printf("using RICE compression algorithm\n");
-    else if (compress_type == GZIP_1)
-          printf("using GZIP compression algorithm\n");
-    else if (compress_type == PLIO_1)
-          printf("using PLIO compression algorithm\n");
-
-    /* create output file */
-    if ( fits_create_file(&outfptr, outfile, &status) ) 
-         printerror( status );
-
-    /* compress the image */
-    blocksize = 32; /* RICE compression parameter */
-    nbits = 4;      /* compression parameter, used for float images */
-    
-    if ( fits_comp_img(infptr, outfptr, compress_type, tilesize,
-         blocksize, nbits, &status) ) 
-         printerror( status );
-
-    ffgkyj(outfptr, "PCOUNT", &outsize, NULL, &status);
-
-    printf("  insize = %ld\n outsize = %ld\n",
-            origsize, outsize);
-
-    if (outsize)
-       printf("   ratio = %.2f\n", (double) origsize / outsize);
-
-    /* close the files */
-    fits_close_file(infptr, &status);
-
-    if ( fits_close_file(outfptr, &status) )
-         printerror( status );
-
-    exit(0);
-}
-/*--------------------------------------------------------------------------*/
-void printerror( int status)
-{
-    /*****************************************************/
-    /* Print out cfitsio error messages and exit program */
-    /*****************************************************/
-
-    char status_str[FLEN_STATUS], errmsg[FLEN_ERRMSG];
-  
-    if (status)
-      fprintf(stderr, "\n*** Error occurred during program execution ***\n");
-
-    fits_get_errstatus(status, status_str);   /* get the error description */
-    fprintf(stderr, "\nstatus = %d: %s\n", status, status_str);
-
-    /* get first message; null if stack is empty */
-    if ( fits_read_errmsg(errmsg) ) 
-    {
-         fprintf(stderr, "\nError message stack:\n");
-         fprintf(stderr, " %s\n", errmsg);
-
-         while ( fits_read_errmsg(errmsg) )  /* get remaining messages */
-             fprintf(stderr, " %s\n", errmsg);
-    }
-
-    exit( status );       /* terminate the program, returning error status */
-}
diff --git a/configure b/configure
index aa81739..5670c31 100755
--- a/configure
+++ b/configure
@@ -11,6 +11,9 @@
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
+ac_help="$ac_help
+ --enable-hera Build for HERA project (for LHEA use only) "
+ac_default_prefix=`pwd`
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -522,13 +525,43 @@ fi
 
 
 
+#--------------------------------------------------------------------
+# Command options
+#--------------------------------------------------------------------
+
+# Check whether --enable-hera or --disable-hera was given.
+if test "${enable_hera+set}" = set; then
+  enableval="$enable_hera"
+   if test $enableval = yes; then BUILD_HERA=yes; fi 
+
+fi
+
+if test "x$BUILD_HERA" = xyes; then
+  cat >> confdefs.h <<\EOF
+#define BUILD_HERA 1
+EOF
+
+fi
+
+#--------------------------------------------------------------------
+# Check for install location prefix
+#--------------------------------------------------------------------
+
+
+if test $prefix = NONE; then
+  CFITSIO_PREFIX=$ac_default_prefix
+else
+  CFITSIO_PREFIX=$prefix
+fi
+
+
 #--------------------------------------------------------------------
 # Check "uname" to determine system type
 #--------------------------------------------------------------------
 # Extract the first word of "uname", so it can be a program name with args.
 set dummy uname; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:532: checking for $ac_word" >&5
+echo "configure:565: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_uname_found'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -563,10 +596,48 @@ else
 fi
 
 
+
+# Try first to find a proprietary C compiler, then gcc
+if test "x$CC" = x; then
+  for ac_prog in cc
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:608: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CC" && break
+done
+
+fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:570: checking for $ac_word" >&5
+echo "configure:641: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -596,7 +667,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:600: checking for $ac_word" >&5
+echo "configure:671: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -647,7 +718,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:651: checking for $ac_word" >&5
+echo "configure:722: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -679,7 +750,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:683: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:754: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -690,12 +761,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 694 "configure"
+#line 765 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -721,12 +792,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:725: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:796: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:730: checking whether we are using GNU C" >&5
+echo "configure:801: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -735,7 +806,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -754,7 +825,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:758: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:829: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -791,7 +862,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:795: checking for $ac_word" >&5
+echo "configure:866: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_FC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -825,8 +896,10 @@ if test $FC = 'nope' ; then
    echo "configure: warning: cfitsio: == No acceptable f77 found in \$PATH" 1>&2
    echo "configure: warning: cfitsio: == Cfitsio will be built without Fortran wrapper support" 1>&2
    FC=
+   F77_WRAPPERS=
 else
   CFORTRANFLAGS=
+  F77_WRAPPERS="\${FITSIO_SRC}"
   echo $ac_n "checking whether we are using GNU Fortran""... $ac_c" 1>&6
   if test `$FC --version -c < /dev/null 2> /dev/null | grep -c GNU` -gt 0 -o \
           `$FC --version -c < /dev/null 2> /dev/null | grep -ic egcs` -gt 0
@@ -848,7 +921,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:852: checking for $ac_word" >&5
+echo "configure:925: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -877,7 +950,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:881: checking how to run the C preprocessor" >&5
+echo "configure:954: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -892,13 +965,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 896 "configure"
+#line 969 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -909,13 +982,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 913 "configure"
+#line 986 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:919: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -926,13 +999,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 930 "configure"
+#line 1003 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -960,17 +1033,17 @@ for ac_hdr in stdlib.h string.h math.h limits.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:964: checking for $ac_hdr" >&5
+echo "configure:1037: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 969 "configure"
+#line 1042 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -998,14 +1071,14 @@ fi
 done
 
 cat > conftest.$ac_ext <<EOF
-#line 1002 "configure"
+#line 1075 "configure"
 #include "confdefs.h"
 
 int main() {
 void d( int , double) 
 ; return 0; }
 EOF
-if { (eval echo configure:1009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   PROTO=yes
 else
@@ -1034,11 +1107,23 @@ CFLAGS="$CFLAGS"
 LIBPRE=""
 
 case $system in
+    Darwin-*)
+	# Darwin can be powerpc or i386
+	ARCH=`uname -p`
+	EXT="darwin"
+	# the -D_FILE_OFFSET_BITS compiler flag is only
+	# needed to support Large FITS files greater than 2.1 GB.
+	# Using this flag caused the Fortran wrappers to break
+	# for at least one combination of C and Fortran compilers.
+	# CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+	;;
     SunOS-4*)
 	ARCH="sun"
+	EXT="sun"
 	;;
     HP-UX-*)
 	ARCH="hp"
+	EXT="hpu"
 	if test "x$CFORTRANFLAGS" = x ; then
 		CFORTRANFLAGS="-Dappendus"
 	fi
@@ -1047,29 +1132,36 @@ case $system in
 	;;
     SunOS-5*)
 	ARCH="solaris"
+	EXT="sol"
 	if test "x$CFORTRANFLAGS" = x ; then
 		CFORTRANFLAGS="-Dsolaris"
 	fi
 	;;
     OSF1*)
 	ARCH="alpha"
+	EXT="osf"
 	;;
     IRIX*)
 	ARCH="sgi"
+	EXT="sgi"
 	CFLAGS="$CFLAGS -DHAVE_POSIX_SIGNALS"
 	RANLIB="touch"
 	;;
     ULTRIX*)
 	ARCH="dec"
+	EXT="dec"
 	;;
     Linux*)
 	ARCH="linux"
+	EXT="lnx"
 	;;
     FREEBSD*|FreeBSD*)
 	ARCH="linux"
+	EXT="lnx"
 	;;
     CYGWIN*)
 	ARCH="cygwin"
+	EXT="cygwin"
 	CFLAGS="$CFLAGS -DHAVE_POSIX_SIGNALS"
 	;;
     *)
@@ -1081,11 +1173,11 @@ CFLAGS="$CFLAGS $CFORTRANFLAGS"
 
 case $CC in
 	gcc)
-		GCCVERSION="`gcc -v 2>&1 | grep version`"
-		echo "cfitsio: == Using $GCCVERSION"
+		GCCVERSION="`gcc -dumpversion 2>&1`"
+		echo "cfitsio: == Using gcc version $GCCVERSION"
 		
                 
-		if test `echo $GCCVERSION | grep -c 'version 2\.[45678]\.'` -gt 0
+		if test `echo $GCCVERSION | grep -c '2\.[45678]'` -gt 0
 		then
 		    CFLAGS=`echo $CFLAGS | sed 's:-O[^ ]* *::'`
 		    echo "configure: warning: This gcc is pretty old. Disabling optimization to be safe." 1>&2
@@ -1097,6 +1189,13 @@ case $CC in
 		CFLAGS=`echo $CFLAGS | sed -e "s/-g/-O/"`
 		case $system in
 		    SunOS-5*)
+			
+			if test `echo $CFLAGS | grep -c fast` -gt 0
+			then
+			   echo "cfitsio: Replacing -fast with -O3"
+			   CFLAGS=`echo $CFLAGS | sed 's:-fast:-O3:'`
+			fi
+			
          		CFLAGS="$CFLAGS -DHAVE_ALLOCA_H -DHAVE_POSIX_SIGNALS"
 			;;
 		    *)
@@ -1110,14 +1209,61 @@ case $CC in
 		;;
 esac
 		
+# Shared library section
+#-------------------------------------------------------------------------------
+SHLIB_LD=:
+SHLIB_SUFFIX=".so"
+lhea_shlib_cflags=
+case $EXT in
+  cygwin)
+    SHLIB_LD="$CC -shared"
+    SHLIB_SUFFIX=".dll"
+    ;;
+  darwin)
+    SHLIB_LD="cc -dynamiclib"
+    SHLIB_SUFFIX=".dylib"
+    lhea_shlib_cflags="-fPIC -fno-common"
+    ;;
+  hpu)
+    SHLIB_LD="ld -b" 
+    SHLIB_SUFFIX=".sl"
+    ;;
+  lnx)
+    SHLIB_LD=":"
+    ;;
+  osf)
+    SHLIB_LD="ld -shared -expect_unresolved '*'"
+    LD_FLAGS="-taso"
+    ;;
+  sol)
+    SHLIB_LD="/usr/ccs/bin/ld -G"
+    lhea_shlib_cflags="-KPIC"
+    ;;
+  sgi)
+    SHLIB_LD="ld -shared -rdata_shared"
+    ;;
+  *)
+    echo "configure: warning: Unable to determine how to make a shared library" 1>&2
+    ;;
+esac
+# Darwin uses gcc (=cc), but needs different flags (see above)
+# if test "x$GCC" = xyes; then
+if test "x$GCC" = xyes && test "x$EXT" != xdarwin && test "x$EXT" != xcygwin; then
+  SHLIB_LD="$CC -shared"
+  lhea_shlib_cflags='-fPIC'
+fi
+if test "x$lhea_shlib_cflags" != x; then
+  CFLAGS="$CFLAGS $lhea_shlib_cflags"
+fi
+
 
 
 # ================= test for the unix ftruncate function ================
 
 echo $ac_n "checking "whether ftruncate works"""... $ac_c" 1>&6
-echo "configure:1119: checking "whether ftruncate works"" >&5
+echo "configure:1265: checking "whether ftruncate works"" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1121 "configure"
+#line 1267 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 
@@ -1127,7 +1273,7 @@ ftruncate(0, 0);
 
 ; return 0; }
 EOF
-if { (eval echo configure:1131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 cat >> confdefs.h <<\EOF
@@ -1144,6 +1290,40 @@ else
 fi
 rm -f conftest*
 
+# ---------------------------------------------------------
+# some systems define long long for 64-bit ints
+# ---------------------------------------------------------
+ 
+echo $ac_n "checking "whether long long is defined"""... $ac_c" 1>&6
+echo "configure:1299: checking "whether long long is defined"" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1301 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+int main() {
+
+long long filler;
+
+; return 0; }
+EOF
+if { (eval echo configure:1311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  
+cat >> confdefs.h <<\EOF
+#define HAVE_LONGLONG 1
+EOF
+
+echo "$ac_t"""yes"" 1>&6
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t"""no"" 1>&6 
+fi
+rm -f conftest*
+
 # ==================== SHARED MEMORY DRIVER SECTION =======================
 #
 # 09-Mar-98 : modified by JB/ISDC
@@ -1157,9 +1337,9 @@ rm -f conftest*
 # -------------------------------------------------------------------------
 
 echo $ac_n "checking "whether system V style IPC services are supported"""... $ac_c" 1>&6
-echo "configure:1161: checking "whether system V style IPC services are supported"" >&5
+echo "configure:1341: checking "whether system V style IPC services are supported"" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1163 "configure"
+#line 1343 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 #include <sys/shm.h>
@@ -1174,7 +1354,7 @@ semget(0, 0, 0);
 
 ; return 0; }
 EOF
-if { (eval echo configure:1178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 cat >> confdefs.h <<\EOF
@@ -1198,10 +1378,10 @@ rm -f conftest*
 # some systems define flock_t, for others we have to define it ourselves
 # -------------------------------------------------------------------------
 
-echo $ac_n "checking "do we have flock_t defined"""... $ac_c" 1>&6
-echo "configure:1203: checking "do we have flock_t defined"" >&5
+echo $ac_n "checking "do we have flock_t defined in sys/fcntl.h"""... $ac_c" 1>&6
+echo "configure:1383: checking "do we have flock_t defined in sys/fcntl.h"" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1205 "configure"
+#line 1385 "configure"
 #include "confdefs.h"
 #include <sys/fcntl.h>
 
@@ -1211,7 +1391,7 @@ flock_t filler;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 cat >> confdefs.h <<\EOF
@@ -1228,6 +1408,37 @@ else
 fi
 rm -f conftest*
 
+if test "$HAVE_FLOCK_T" != 1; then
+   echo $ac_n "checking "do we have flock_t defined in sys/flock.h"""... $ac_c" 1>&6
+echo "configure:1414: checking "do we have flock_t defined in sys/flock.h"" >&5
+   cat > conftest.$ac_ext <<EOF
+#line 1416 "configure"
+#include "confdefs.h"
+#include <sys/flock.h>
+   
+int main() {
+
+   flock_t filler;
+   
+; return 0; }
+EOF
+if { (eval echo configure:1426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  
+   cat >> confdefs.h <<\EOF
+#define HAVE_FLOCK_T 1
+EOF
+
+   echo "$ac_t"""yes"" 1>&6 
+   
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t"""no"" 1>&6 
+fi
+rm -f conftest*
+fi
 
 # -------------------------------------------------------------------------
 # there are some idiosyncrasies with semun defs (used in semxxx). Solaris
@@ -1235,9 +1446,9 @@ rm -f conftest*
 # -------------------------------------------------------------------------
 
 echo $ac_n "checking "do we have union semun defined"""... $ac_c" 1>&6
-echo "configure:1239: checking "do we have union semun defined"" >&5
+echo "configure:1450: checking "do we have union semun defined"" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1241 "configure"
+#line 1452 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 #include <sys/shm.h>
@@ -1249,7 +1460,7 @@ union semun filler;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 cat >> confdefs.h <<\EOF
@@ -1288,12 +1499,12 @@ rm -f conftest*
 #--------------------------------------------------------------------
 cfitsio_checkBoth=0
 echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:1292: checking for connect" >&5
+echo "configure:1503: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1297 "configure"
+#line 1508 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -1316,7 +1527,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -1338,7 +1549,7 @@ fi
 
 if test "$cfitsio_checkSocket" = 1; then
     echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:1342: checking for main in -lsocket" >&5
+echo "configure:1553: checking for main in -lsocket" >&5
 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1346,14 +1557,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1350 "configure"
+#line 1561 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1379,12 +1590,12 @@ if test "$cfitsio_checkBoth" = 1; then
     tk_oldLibs=$LIBS
     LIBS="$LIBS -lsocket -lnsl"
     echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:1383: checking for accept" >&5
+echo "configure:1594: checking for accept" >&5
 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1388 "configure"
+#line 1599 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char accept(); below.  */
@@ -1407,7 +1618,7 @@ accept();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_accept=yes"
 else
@@ -1429,12 +1640,12 @@ fi
 
 fi
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1433: checking for gethostbyname" >&5
+echo "configure:1644: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1438 "configure"
+#line 1649 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -1457,7 +1668,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -1475,7 +1686,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:1479: checking for main in -lnsl" >&5
+echo "configure:1690: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1483,14 +1694,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1487 "configure"
+#line 1698 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1665,6 +1876,7 @@ s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
+s%@CFITSIO_PREFIX@%$CFITSIO_PREFIX%g
 s%@uname_found@%$uname_found%g
 s%@CC@%$CC%g
 s%@FC@%$FC%g
@@ -1673,6 +1885,9 @@ s%@CPP@%$CPP%g
 s%@GCCVERSION@%$GCCVERSION%g
 s%@ARCH@%$ARCH%g
 s%@LIBPRE@%$LIBPRE%g
+s%@SHLIB_LD@%$SHLIB_LD%g
+s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
+s%@F77_WRAPPERS@%$F77_WRAPPERS%g
 s%@my_shmem@%$my_shmem%g
 
 CEOF
diff --git a/configure.in b/configure.in
index f187626..e8c1936 100644
--- a/configure.in
+++ b/configure.in
@@ -9,6 +9,31 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(fitscore.c)
 
+#--------------------------------------------------------------------
+# Command options
+#--------------------------------------------------------------------
+
+AC_ARG_ENABLE(
+  hera,
+  [ --enable-hera Build for HERA project (for LHEA use only) ],
+  [ if test $enableval = yes; then BUILD_HERA=yes; fi ]
+)
+if test "x$BUILD_HERA" = xyes; then
+  AC_DEFINE(BUILD_HERA)
+fi
+
+#--------------------------------------------------------------------
+# Check for install location prefix
+#--------------------------------------------------------------------
+
+AC_PREFIX_DEFAULT(`pwd`)
+if test $prefix = NONE; then
+  CFITSIO_PREFIX=$ac_default_prefix
+else
+  CFITSIO_PREFIX=$prefix
+fi
+AC_SUBST(CFITSIO_PREFIX)
+
 #--------------------------------------------------------------------
 # Check "uname" to determine system type
 #--------------------------------------------------------------------
@@ -22,6 +47,11 @@ fi
 
 
 dnl Checks for programs.
+
+# Try first to find a proprietary C compiler, then gcc
+if test "x$CC" = x; then
+  AC_CHECK_PROGS(CC, cc)
+fi
 AC_PROG_CC
 
 AC_CHECK_PROGS(FC, f77 xlf cf77 gf77 g77 af77 ncf f2c , nope)
@@ -29,8 +59,10 @@ if test $FC = 'nope' ; then
    AC_MSG_WARN(cfitsio: == No acceptable f77 found in \$PATH)
    AC_MSG_WARN(cfitsio: == Cfitsio will be built without Fortran wrapper support)
    FC=
+   F77_WRAPPERS=
 else
   CFORTRANFLAGS=
+  F77_WRAPPERS="\${FITSIO_SRC}"
   echo $ac_n "checking whether we are using GNU Fortran""... $ac_c" 1>&6
   if test `$FC --version -c < /dev/null 2> /dev/null | grep -c GNU` -gt 0 -o \
           `$FC --version -c < /dev/null 2> /dev/null | grep -ic egcs` -gt 0
@@ -76,11 +108,23 @@ CFLAGS="$CFLAGS"
 LIBPRE=""
 
 case $system in
+    Darwin-*)
+	# Darwin can be powerpc or i386
+	ARCH=`uname -p`
+	EXT="darwin"
+	# the -D_FILE_OFFSET_BITS compiler flag is only
+	# needed to support Large FITS files greater than 2.1 GB.
+	# Using this flag caused the Fortran wrappers to break
+	# for at least one combination of C and Fortran compilers.
+	# CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+	;;
     SunOS-4*)
 	ARCH="sun"
+	EXT="sun"
 	;;
     HP-UX-*)
 	ARCH="hp"
+	EXT="hpu"
 	if test "x$CFORTRANFLAGS" = x ; then
 		CFORTRANFLAGS="-Dappendus"
 	fi
@@ -89,29 +133,36 @@ case $system in
 	;;
     SunOS-5*)
 	ARCH="solaris"
+	EXT="sol"
 	if test "x$CFORTRANFLAGS" = x ; then
 		CFORTRANFLAGS="-Dsolaris"
 	fi
 	;;
     OSF1*)
 	ARCH="alpha"
+	EXT="osf"
 	;;
     IRIX*)
 	ARCH="sgi"
+	EXT="sgi"
 	CFLAGS="$CFLAGS -DHAVE_POSIX_SIGNALS"
 	RANLIB="touch"
 	;;
     ULTRIX*)
 	ARCH="dec"
+	EXT="dec"
 	;;
     Linux*)
 	ARCH="linux"
+	EXT="lnx"
 	;;
     FREEBSD*|FreeBSD*)
 	ARCH="linux"
+	EXT="lnx"
 	;;
     CYGWIN*)
 	ARCH="cygwin"
+	EXT="cygwin"
 	CFLAGS="$CFLAGS -DHAVE_POSIX_SIGNALS"
 	;;
     *)
@@ -123,11 +174,11 @@ CFLAGS="$CFLAGS $CFORTRANFLAGS"
 
 case $CC in
 	gcc)
-		GCCVERSION="`gcc -v 2>&1 | grep version`"
-		echo "cfitsio: == Using $GCCVERSION"
+		GCCVERSION="`gcc -dumpversion 2>&1`"
+		echo "cfitsio: == Using gcc version $GCCVERSION"
 		AC_SUBST(GCCVERSION)
                 changequote(,)
-		if test `echo $GCCVERSION | grep -c 'version 2\.[45678]\.'` -gt 0
+		if test `echo $GCCVERSION | grep -c '2\.[45678]'` -gt 0
 		then
 		    CFLAGS=`echo $CFLAGS | sed 's:-O[^ ]* *::'`
 		    AC_MSG_WARN(This gcc is pretty old. Disabling optimization to be safe.)
@@ -139,6 +190,13 @@ case $CC in
 		CFLAGS=`echo $CFLAGS | sed -e "s/-g/-O/"`
 		case $system in
 		    SunOS-5*)
+			changequote(,)
+			if test `echo $CFLAGS | grep -c fast` -gt 0
+			then
+			   echo "cfitsio: Replacing -fast with -O3"
+			   CFLAGS=`echo $CFLAGS | sed 's:-fast:-O3:'`
+			fi
+			changequote([,])
          		CFLAGS="$CFLAGS -DHAVE_ALLOCA_H -DHAVE_POSIX_SIGNALS"
 			;;
 		    *)
@@ -152,12 +210,61 @@ case $CC in
 		;;
 esac
 		
+# Shared library section
+#-------------------------------------------------------------------------------
+SHLIB_LD=:
+SHLIB_SUFFIX=".so"
+lhea_shlib_cflags=
+case $EXT in
+  cygwin)
+    SHLIB_LD="$CC -shared"
+    SHLIB_SUFFIX=".dll"
+    ;;
+  darwin)
+    SHLIB_LD="cc -dynamiclib"
+    SHLIB_SUFFIX=".dylib"
+    lhea_shlib_cflags="-fPIC -fno-common"
+    ;;
+  hpu)
+    SHLIB_LD="ld -b" 
+    SHLIB_SUFFIX=".sl"
+    ;;
+  lnx)
+    SHLIB_LD=":"
+    ;;
+  osf)
+    SHLIB_LD="ld -shared -expect_unresolved '*'"
+    LD_FLAGS="-taso"
+    ;;
+  sol)
+    SHLIB_LD="/usr/ccs/bin/ld -G"
+    lhea_shlib_cflags="-KPIC"
+    ;;
+  sgi)
+    SHLIB_LD="ld -shared -rdata_shared"
+    ;;
+  *)
+    AC_MSG_WARN(Unable to determine how to make a shared library)
+    ;;
+esac
+# Darwin uses gcc (=cc), but needs different flags (see above)
+# if test "x$GCC" = xyes; then
+if test "x$GCC" = xyes && test "x$EXT" != xdarwin && test "x$EXT" != xcygwin; then
+  SHLIB_LD="$CC -shared"
+  lhea_shlib_cflags='-fPIC'
+fi
+if test "x$lhea_shlib_cflags" != x; then
+  CFLAGS="$CFLAGS $lhea_shlib_cflags"
+fi
 
 AC_SUBST(ARCH)dnl
 AC_SUBST(CFLAGS)dnl
 AC_SUBST(CC)dnl
 AC_SUBST(FC)dnl
 AC_SUBST(LIBPRE)dnl
+AC_SUBST(SHLIB_LD)dnl
+AC_SUBST(SHLIB_SUFFIX)dnl
+AC_SUBST(F77_WRAPPERS)
 
 # ================= test for the unix ftruncate function ================
 
@@ -170,6 +277,19 @@ AC_DEFINE(HAVE_FTRUNCATE)
 AC_MSG_RESULT("yes")
 ], AC_MSG_RESULT("no") )
 
+# ---------------------------------------------------------
+# some systems define long long for 64-bit ints
+# ---------------------------------------------------------
+ 
+AC_MSG_CHECKING("whether long long is defined")
+AC_TRY_COMPILE([#include <stdlib.h>
+], [
+long long filler;
+], [
+AC_DEFINE(HAVE_LONGLONG)
+AC_MSG_RESULT("yes")
+], AC_MSG_RESULT("no") )
+
 # ==================== SHARED MEMORY DRIVER SECTION =======================
 #
 # 09-Mar-98 : modified by JB/ISDC
@@ -203,7 +323,7 @@ AC_SUBST(my_shmem)
 # some systems define flock_t, for others we have to define it ourselves
 # -------------------------------------------------------------------------
 
-AC_MSG_CHECKING("do we have flock_t defined")
+AC_MSG_CHECKING("do we have flock_t defined in sys/fcntl.h")
 AC_TRY_COMPILE([#include <sys/fcntl.h>
 ], [
 flock_t filler;
@@ -212,6 +332,16 @@ AC_DEFINE(HAVE_FLOCK_T)
 AC_MSG_RESULT("yes") 
 ], AC_MSG_RESULT("no") )
 
+if test "$HAVE_FLOCK_T" != 1; then
+   AC_MSG_CHECKING("do we have flock_t defined in sys/flock.h")
+   AC_TRY_COMPILE([#include <sys/flock.h>
+   ], [
+   flock_t filler;
+   ], [
+   AC_DEFINE(HAVE_FLOCK_T)
+   AC_MSG_RESULT("yes") 
+   ], AC_MSG_RESULT("no") )
+fi
 
 # -------------------------------------------------------------------------
 # there are some idiosyncrasies with semun defs (used in semxxx). Solaris
diff --git a/drvrfile.c b/drvrfile.c
index 2b43381..516db58 100644
--- a/drvrfile.c
+++ b/drvrfile.c
@@ -10,6 +10,12 @@
 
 #if defined(unix) || defined(__unix__)  || defined(__unix)
 #include <pwd.h>         /* needed in file_openfile */
+
+#ifdef REPLACE_LINKS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+
 #endif
 
 #ifdef HAVE_FTRUNCATE
@@ -29,14 +35,14 @@ typedef struct    /* structure containing disk file structure */
     int last_io_op;
 } diskdriver;
 
-static diskdriver handleTable[NIOBUF];  /* allocate diskfile handle tables */
+static diskdriver handleTable[NMAXFILES]; /* allocate diskfile handle tables */
 
 /*--------------------------------------------------------------------------*/
 int file_init(void)
 {
     int ii;
 
-    for (ii = 0; ii < NIOBUF; ii++)  /* initialize all empty slots in table */
+    for (ii = 0; ii < NMAXFILES; ii++) /* initialize all empty slots in table */
     {
        handleTable[ii].fileptr = 0;
     }
@@ -118,7 +124,7 @@ int file_open(char *filename, int rwmode, int *handle)
     else
     {
       *handle = -1;
-      for (ii = 0; ii < NIOBUF; ii++)  /* find empty slot in table */
+      for (ii = 0; ii < NMAXFILES; ii++)  /* find empty slot in table */
       {
         if (handleTable[ii].fileptr == 0)
         {
@@ -152,6 +158,15 @@ int file_openfile(char *filename, int rwmode, FILE **diskfile)
     char tempname[512], *cptr, user[80];
     struct passwd *pwd;
     int ii = 0;
+
+#if defined(REPLACE_LINKS)
+    struct stat stbuf;
+    int success = 0;
+    size_t n;
+    FILE *f1, *f2;
+    char buf[BUFSIZ];
+#endif
+
 #endif
 
     if (rwmode == READWRITE)
@@ -213,6 +228,54 @@ int file_openfile(char *filename, int rwmode, FILE **diskfile)
     {
         /* don't need to expand the input file name */
         *diskfile = fopen(filename, mode); 
+
+#if defined(REPLACE_LINKS)
+
+        if (!(*diskfile) && (rwmode == READWRITE))  
+        {
+           /* failed to open file with READWRITE privilege.  Test if  */
+           /* the file we are trying to open is a soft link to a file that */
+           /* doesn't have write privilege.  */
+
+           lstat(filename, &stbuf);
+           if ((stbuf.st_mode & S_IFMT) == S_IFLNK) /* is this a soft link? */
+           {
+              if ((f1 = fopen(filename, "rb")) != 0) /* try opening READONLY */
+              {
+                 strcpy(tempname, filename);
+                 strcat(tempname, ".TmxFil");
+                 if ((f2 = fopen(tempname, "wb")) != 0) /* create temp file */
+                 {
+                    success = 1;
+                    while ((n = fread(buf, 1, BUFSIZ, f1)) > 0)
+                    {
+                       /* copy linked file to local temporary file */
+                       if (fwrite(buf, 1, n, f2) != n) 
+                       {
+                          success = 0;
+                          break;
+                       } 
+                    }
+                    fclose(f2);
+                 }
+                 fclose(f1);
+  
+                 if (success)
+                 {
+                    /* delete link and rename temp file to previous link name */
+                    remove(filename);
+                    rename(tempname, filename);
+
+                    /* try once again to open the file with write access */
+                    *diskfile = fopen(filename, mode); 
+                 }
+                 else
+                    remove(tempname);  /* clean up the failed copy */
+              }
+           }
+        }
+#endif
+
     }
 
 #else
@@ -236,7 +299,7 @@ int file_create(char *filename, int *handle)
     char mode[4];
 
     *handle = -1;
-    for (ii = 0; ii < NIOBUF; ii++)  /* find empty slot in table */
+    for (ii = 0; ii < NMAXFILES; ii++)  /* find empty slot in table */
     {
         if (handleTable[ii].fileptr == 0)
         {
@@ -247,7 +310,7 @@ int file_create(char *filename, int *handle)
     if (*handle == -1)
        return(TOO_MANY_FILES);    /* too many files opened */
 
-    strcpy(mode, "w+b");    /* open existing file with read-write */
+    strcpy(mode, "w+b");    /* create new file with read-write */
 
     diskfile = fopen(filename, "r"); /* does file already exist? */
 
@@ -302,33 +365,48 @@ int file_size(int handle, OFF_T *filesize)
   return the size of the file in bytes
 */
 {
-    OFF_T position;
+    OFF_T position1;
     FILE *diskfile;
 
     diskfile = handleTable[handle].fileptr;
 
-    if (fgetpos(diskfile, &position) != 0)      /* save current postion */
+#if _FILE_OFFSET_BITS - 0 == 64
+
+/* call the newer ftello and fseeko routines , which support */
+/*  Large Files (> 2GB) if they are supported.  */
+
+    position1 = ftello(diskfile);   /* save current postion */
+    if (position1 < 0)
         return(SEEK_ERROR);
 
-/* move to end of the existing file */
+    if (fseeko(diskfile, 0, 2) != 0)  /* seek to end of file */
+        return(SEEK_ERROR);
 
-/* call the newer fseeko routine, which supports Large Files (> 2GB) */
-/* if it is supported.  */
+    *filesize = ftello(diskfile);     /* get file size */
+    if (*filesize < 0)
+        return(SEEK_ERROR);
 
-#if _FILE_OFFSET_BITS - 0 == 64
-    if (fseeko(diskfile, 0, 2) != 0)
+    if (fseeko(diskfile, position1, 0) != 0)  /* seek back to original pos */
         return(SEEK_ERROR);
+
 #else
-    if (fseek(diskfile, 0, 2) != 0)
+
+    position1 = ftell(diskfile);   /* save current postion */
+    if (position1 < 0)
         return(SEEK_ERROR);
-#endif
 
-    if (fgetpos(diskfile, filesize) != 0)      /* position = size of file */
+    if (fseek(diskfile, 0, 2) != 0)  /* seek to end of file */
         return(SEEK_ERROR);
 
-    if (fsetpos(diskfile, &position) != 0) /* move back to orig. position */
+    *filesize = ftell(diskfile);     /* get file size */
+    if (*filesize < 0)
         return(SEEK_ERROR);
 
+    if (fseek(diskfile, position1, 0) != 0)  /* seek back to original pos */
+        return(SEEK_ERROR);
+
+#endif
+
     return(0);
 }
 /*--------------------------------------------------------------------------*/
@@ -369,9 +447,9 @@ int file_flush(int handle)
 
 #if MACHINE == IBMPC
 
-    if (fsetpos(handleTable[handle].fileptr,
-        &(handleTable[handle].currentpos)) )
-        return(SEEK_ERROR);
+    if (file_seek(handle, handleTable[handle].currentpos))
+            return(SEEK_ERROR);
+
 #endif
 
     return(0);
@@ -382,12 +460,19 @@ int file_seek(int handle, OFF_T offset)
   seek to position relative to start of the file
 */
 {
-    OFF_T toff;
 
-    toff = offset;
-    if (fsetpos(handleTable[handle].fileptr, &toff) )
+#if _FILE_OFFSET_BITS - 0 == 64
+
+    if (fseeko(handleTable[handle].fileptr, offset, 0) != 0)
+        return(SEEK_ERROR);
+
+#else
+
+    if (fseek(handleTable[handle].fileptr, offset, 0) != 0)
         return(SEEK_ERROR);
 
+#endif
+
     handleTable[handle].currentpos = offset;
     return(0);
 }
@@ -402,8 +487,8 @@ int file_read(int hdl, void *buffer, long nbytes)
 
     if (handleTable[hdl].last_io_op == IO_WRITE)
     {
-      if (fsetpos(handleTable[hdl].fileptr, &(handleTable[hdl].currentpos) ))
-        return(READ_ERROR);
+        if (file_seek(hdl, handleTable[hdl].currentpos))
+            return(SEEK_ERROR);
     }
   
     nread = (long) fread(buffer, 1, nbytes, handleTable[hdl].fileptr);
@@ -436,10 +521,10 @@ int file_write(int hdl, void *buffer, long nbytes)
 {
     if (handleTable[hdl].last_io_op == IO_READ) 
     {
-      if (fsetpos(handleTable[hdl].fileptr, &(handleTable[hdl].currentpos) ))
-         return(WRITE_ERROR);
+        if (file_seek(hdl, handleTable[hdl].currentpos))
+            return(SEEK_ERROR);
     }
-  
+
     if((long) fwrite(buffer, 1, nbytes, handleTable[hdl].fileptr) != nbytes)
         return(WRITE_ERROR);
 
@@ -603,8 +688,22 @@ int file_checkfile (char *urltype, char *infile, char *outfile)
       /* This is the name of the uncompressed file to be created on disk. */
       if (strlen(outfile))
       {
-        strcpy(urltype, "compressfile://");  /* use special driver */
-        strcpy(file_outfile, outfile); /* an output file is specified */
+        if (!strncmp(outfile, "mem:", 4) )
+        {
+           /* uncompress the file in memory, with READ and WRITE access */
+           strcpy(urltype, "compressmem://");  /* use special driver */
+           *file_outfile = '\0';  
+        }
+        else
+        {
+          strcpy(urltype, "compressfile://");  /* use special driver */
+
+          /* don't copy the "file://" prefix, if present.  */
+          if (!strncmp(outfile, "file://", 7) )
+             strcpy(file_outfile,outfile+7);
+          else
+             strcpy(file_outfile,outfile);
+        }
       }
       else
       {
@@ -613,6 +712,16 @@ int file_checkfile (char *urltype, char *infile, char *outfile)
         *file_outfile = '\0';  /* no output file was specified */
       }
     }
+    else  /* an ordinary, uncompressed FITS file on disk */
+    {
+        /* save the output file name for later use when opening the file. */
+        /* In this case, the file to be opened will be opened READONLY,   */
+        /* and copied to this newly created output file.  The original file */
+        /* will be closed, and the copy will be opened by CFITSIO for     */
+        /* subsequent processing (possibly with READWRITE access).        */
+        if (strlen(outfile))
+            strcpy(file_outfile,outfile);
+    }
 
     return 0;
 }
diff --git a/drvrmem.c b/drvrmem.c
index 32c8cbe..2eb017e 100644
--- a/drvrmem.c
+++ b/drvrmem.c
@@ -10,6 +10,7 @@
 #include "fitsio2.h"
 
 #define RECBUFLEN 1000
+
 static char stdin_outfile[FLEN_FILENAME];
 
 typedef struct    /* structure containing mem file structure */ 
@@ -26,16 +27,17 @@ typedef struct    /* structure containing mem file structure */
     void *(*mem_realloc)(void *p, size_t newsize);  /* realloc function */
     OFF_T currentpos;   /* current file position, relative to start */
     OFF_T fitsfilesize; /* size of the FITS file (always <= *memsizeptr) */
+    FILE *fileptr;      /* pointer to compressed output disk file */
 } memdriver;
 
-static memdriver memTable[NIOBUF];  /* allocate mem file handle tables */
+static memdriver memTable[NMAXFILES];  /* allocate mem file handle tables */
 
 /*--------------------------------------------------------------------------*/
 int mem_init(void)
 {
     int ii;
 
-    for (ii = 0; ii < NIOBUF; ii++)  /* initialize all empty slots in table */
+    for (ii = 0; ii < NMAXFILES; ii++) /* initialize all empty slots in table */
     {
        memTable[ii].memaddrptr = 0;
        memTable[ii].memaddr = 0;
@@ -87,6 +89,72 @@ int mem_create(char *filename, int *handle)
     return(0);
 }
 /*--------------------------------------------------------------------------*/
+int mem_create_comp(char *filename, int *handle)
+/*
+  Create a new empty memory file for subsequent writes.
+  Also create an empty compressed .gz file.  The memory file
+  will be compressed and written to the disk file when the file is closed.
+*/
+{
+    FILE *diskfile;
+    char mode[4];
+    int  status;
+
+    /* first, create disk file for the compressed output */
+
+
+    if ( !strcmp(filename, "-.gz") || !strcmp(filename, "stdout.gz") ||
+         !strcmp(filename, "STDOUT.gz") )
+    {
+       /* special case: create uncompressed FITS file in memory, then
+          compress it an write it out to 'stdout' when it is closed.  */
+
+       diskfile = stdout;
+    }
+    else
+    {
+        /* normal case: create disk file for the compressed output */
+
+        strcpy(mode, "w+b");    /* create file with read-write */
+
+        diskfile = fopen(filename, "r"); /* does file already exist? */
+
+        if (diskfile)
+        {
+            fclose(diskfile);         /* close file and exit with error */
+            return(FILE_NOT_CREATED); 
+        }
+
+#if MACHINE == ALPHAVMS || MACHINE == VAXVMS
+        /* specify VMS record structure: fixed format, 2880 byte records */
+        /* but force stream mode access to enable random I/O access      */
+        diskfile = fopen(filename, mode, "rfm=fix", "mrs=2880", "ctx=stm"); 
+#else
+        diskfile = fopen(filename, mode); 
+#endif
+
+        if (!(diskfile))           /* couldn't create file */
+        {
+            return(FILE_NOT_CREATED); 
+        }
+    }
+
+    /* now create temporary memory file */
+
+    /* initially allocate 1 FITS block = 2880 bytes */
+    status = mem_createmem(2880L, handle);
+
+    if (status)
+    {
+        ffpmsg("failed to create empty memory file (mem_create_comp)");
+        return(status);
+    }
+
+    memTable[*handle].fileptr = diskfile;
+
+    return(0);
+}
+/*--------------------------------------------------------------------------*/
 int mem_openmem(void **buffptr,   /* I - address of memory pointer          */
                 size_t *buffsize, /* I - size of buffer, in bytes           */
                 size_t deltasize, /* I - increment for future realloc's     */
@@ -99,7 +167,7 @@ int mem_openmem(void **buffptr,   /* I - address of memory pointer          */
     int ii;
 
     *handle = -1;
-    for (ii = 0; ii < NIOBUF; ii++)  /* find empty slot in handle table */
+    for (ii = 0; ii < NMAXFILES; ii++)  /* find empty slot in handle table */
     {
         if (memTable[ii].memaddrptr == 0)
         {
@@ -127,7 +195,7 @@ int mem_createmem(size_t msize, int *handle)
     int ii;
 
     *handle = -1;
-    for (ii = 0; ii < NIOBUF; ii++)  /* find empty slot in handle table */
+    for (ii = 0; ii < NMAXFILES; ii++)  /* find empty slot in handle table */
     {
         if (memTable[ii].memaddrptr == 0)
         {
@@ -164,7 +232,7 @@ int mem_createmem(size_t msize, int *handle)
 /*--------------------------------------------------------------------------*/
 int mem_truncate(int handle, OFF_T filesize)
 /*
-  truncate the file to a new smaller size
+  truncate the file to a new size
 */
 {
     char *ptr;
@@ -181,6 +249,14 @@ int mem_truncate(int handle, OFF_T filesize)
             return(MEMORY_ALLOCATION);
         }
 
+        /* if allocated more memory, initialize it to zero */
+        if ( (size_t) filesize > *(memTable[handle].memsizeptr) )
+        {
+             memset(ptr + *(memTable[handle].memsizeptr),
+                    0,
+                    filesize - *(memTable[handle].memsizeptr) );
+        }
+
         *(memTable[handle].memaddrptr) = ptr;
         *(memTable[handle].memsizeptr) = filesize;
     }
@@ -422,7 +498,7 @@ int stdout_close(int handle)
     /* copy from memory to standard out */
     if(fwrite(memTable[handle].memaddr, 1,
               memTable[handle].fitsfilesize, stdout) !=
-              memTable[handle].fitsfilesize )
+              (size_t) memTable[handle].fitsfilesize )
     {
                 ffpmsg("failed to copy memory file to stdout (stdout_close)");
                 status = WRITE_ERROR;
@@ -434,6 +510,16 @@ int stdout_close(int handle)
     return(status);
 }
 /*--------------------------------------------------------------------------*/
+int mem_compress_openrw(char *filename, int rwmode, int *hdl)
+/*
+  This routine opens the compressed diskfile and creates an empty memory
+  buffer with an appropriate size, then calls mem_uncompress2mem. It allows
+  the memory 'file' to be opened with READWRITE access.
+*/
+{
+   return(mem_compress_open(filename, READONLY, hdl));  
+}
+/*--------------------------------------------------------------------------*/
 int mem_compress_open(char *filename, int rwmode, int *hdl)
 /*
   This routine opens the compressed diskfile and creates an empty memory
@@ -552,7 +638,8 @@ int mem_compress_open(char *filename, int rwmode, int *hdl)
     }
 
     /* if we allocated too much memory initially, then free it */
-    if (*(memTable[*hdl].memsizeptr) > (memTable[*hdl].fitsfilesize + 256L) ) 
+    if (*(memTable[*hdl].memsizeptr) > 
+       (( (size_t) memTable[*hdl].fitsfilesize) + 256L) ) 
     {
         ptr = realloc(*(memTable[*hdl].memaddrptr), 
                        memTable[*hdl].fitsfilesize);
@@ -603,6 +690,241 @@ int mem_iraf_open(char *filename, int rwmode, int *hdl)
     return(0);
 }
 /*--------------------------------------------------------------------------*/
+int mem_rawfile_open(char *filename, int rwmode, int *hdl)
+/*
+  This routine creates an empty memory buffer, writes a minimal
+  image header, then copies the image data from the raw file into
+  memory.  It will byteswap the pixel values if the raw array
+  is in little endian byte order.
+*/
+{
+    FILE *diskfile;
+    fitsfile *fptr;
+    short *sptr;
+    int status, endian, datatype, bytePerPix, naxis;
+    long dim[5] = {1,1,1,1,1}, ii, nvals, offset = 0;
+    size_t filesize = 0, datasize;
+    char rootfile[FLEN_FILENAME], *cptr = 0, *cptr2 = 0;
+    void *ptr;
+
+    if (rwmode != READONLY)
+    {
+        ffpmsg(
+  "cannot open raw binary file with WRITE access (mem_rawfile_open)");
+        ffpmsg(filename);
+        return(READONLY_FILE);
+    }
+
+    cptr = strchr(filename, '[');   /* search for opening bracket [ */
+
+    if (!cptr)
+    {
+        ffpmsg("binary file name missing '[' character (mem_rawfile_open)");
+        ffpmsg(filename);
+        return(URL_PARSE_ERROR);
+    }
+
+    *rootfile = '\0';
+    strncat(rootfile, filename, cptr - filename);  /* store the rootname */
+
+    cptr++;
+
+    while (*cptr == ' ')
+       cptr++;    /* skip leading blanks */
+
+    /* Get the Data Type of the Image */
+
+    if (*cptr == 'b' || *cptr == 'B')
+    {
+      datatype = BYTE_IMG;
+      bytePerPix = 1;
+    }
+    else if (*cptr == 'i' || *cptr == 'I')
+    {
+      datatype = SHORT_IMG;
+      bytePerPix = 2;
+    }
+    else if (*cptr == 'u' || *cptr == 'U')
+    {
+      datatype = USHORT_IMG;
+      bytePerPix = 2;
+
+    }
+    else if (*cptr == 'j' || *cptr == 'J')
+    {
+      datatype = LONG_IMG;
+      bytePerPix = 4;
+    }  
+    else if (*cptr == 'r' || *cptr == 'R' || *cptr == 'f' || *cptr == 'F')
+    {
+      datatype = FLOAT_IMG;
+      bytePerPix = 4;
+    }    
+    else if (*cptr == 'd' || *cptr == 'D')
+    {
+      datatype = DOUBLE_IMG;
+      bytePerPix = 8;
+    }
+    else
+    {
+        ffpmsg("error in raw binary file datatype (mem_rawfile_open)");
+        ffpmsg(filename);
+        return(URL_PARSE_ERROR);
+    }
+
+    cptr++;
+
+    /* get Endian: Big or Little; default is same as the local machine */
+    
+    if (*cptr == 'b' || *cptr == 'B')
+    {
+        endian = 0;
+        cptr++;
+    }
+    else if (*cptr == 'l' || *cptr == 'L')
+    {
+        endian = 1;
+        cptr++;
+    }
+    else
+        endian = BYTESWAPPED; /* byteswapped machines are little endian */
+
+    /* read each dimension (up to 5) */
+
+    naxis = 1;
+    dim[0] = strtol(cptr, &cptr2, 10);
+    
+    if (cptr2 && *cptr2 == ',')
+    {
+      naxis = 2;
+      dim[1] = strtol(cptr2+1, &cptr, 10);
+
+      if (cptr && *cptr == ',')
+      {
+        naxis = 3;
+        dim[2] = strtol(cptr+1, &cptr2, 10);
+
+        if (cptr2 && *cptr2 == ',')
+        {
+          naxis = 4;
+          dim[3] = strtol(cptr2+1, &cptr, 10);
+
+          if (cptr && *cptr == ',')
+            naxis = 5;
+            dim[4] = strtol(cptr+1, &cptr2, 10);
+        }
+      }
+    }
+
+    cptr = maxvalue(cptr, cptr2);
+
+    if (*cptr == ':')   /* read starting offset value */
+        offset = strtol(cptr+1, 0, 10);
+
+    nvals = dim[0] * dim[1] * dim[2] * dim[3] * dim[4];
+    datasize = nvals * bytePerPix;
+    filesize = nvals * bytePerPix + 2880;
+    filesize = ((filesize - 1) / 2880 + 1) * 2880; 
+
+    /* open the raw binary disk file */
+    status = file_openfile(rootfile, READONLY, &diskfile);
+    if (status)
+    {
+        ffpmsg("failed to open raw  binary file (mem_rawfile_open)");
+        ffpmsg(rootfile);
+        return(status);
+    }
+
+    /* create a memory file with corrct size for the FITS converted raw file */
+    status = mem_createmem(filesize, hdl);
+    if (status)
+    {
+        ffpmsg("failed to create memory file (mem_rawfile_open)");
+        fclose(diskfile);
+        return(status);
+    }
+
+    /* open this piece of memory as a new FITS file */
+    ffimem(&fptr, (void **) memTable[*hdl].memaddrptr, &filesize, 0, 0, &status);
+
+    /* write the required header keywords */
+    ffcrim(fptr, datatype, naxis, dim, &status);
+
+    /* close the FITS file, but keep the memory allocated */
+    ffclos(fptr, &status);
+
+    if (status > 0)
+    {
+        ffpmsg("failed to write basic image header (mem_rawfile_open)");
+        fclose(diskfile);
+        mem_close_free(*hdl);   /* free up the memory */
+        return(status);
+    }
+
+    if (offset > 0)
+       fseek(diskfile, offset, 0);   /* offset to start of the data */
+
+    /* read the raw data into memory */
+    ptr = *memTable[*hdl].memaddrptr + 2880;
+
+    if (fread((char *) ptr, 1, datasize, diskfile) != datasize)
+      status = READ_ERROR;
+
+    fclose(diskfile);  /* close the raw binary disk file */
+
+    if (status)
+    {
+        mem_close_free(*hdl);   /* free up the memory */
+        ffpmsg("failed to copy raw file data into memory (mem_rawfile_open)");
+        return(status);
+    }
+
+    if (datatype == USHORT_IMG)  /* have to subtract 32768 from each unsigned */
+    {                            /* value to conform to FITS convention. More */
+                                 /* efficient way to do this is to just flip  */
+                                 /* the most significant bit.                 */
+
+      sptr = (short *) ptr;
+
+      if (endian == BYTESWAPPED)  /* working with native format */
+      {
+        for (ii = 0; ii < nvals; ii++, sptr++)
+        {
+          *sptr =  ( *sptr ) ^ 0x8000;
+        }
+      }
+      else  /* pixels are byteswapped WRT the native format */
+      {
+        for (ii = 0; ii < nvals; ii++, sptr++)
+        {
+          *sptr =  ( *sptr ) ^ 0x80;
+        }
+      }
+    }
+
+    if (endian)  /* swap the bytes if array is in little endian byte order */
+    {
+      if (datatype == SHORT_IMG || datatype == USHORT_IMG)
+      {
+        ffswap2( (short *) ptr, nvals);
+      }
+      else if (datatype == LONG_IMG || datatype == FLOAT_IMG)
+      {
+        ffswap4( (INT32BIT *) ptr, nvals);
+      }
+
+      else if (datatype == DOUBLE_IMG)
+      {
+        ffswap8( (double *) ptr, nvals);
+      }
+    }
+
+    memTable[*hdl].currentpos = 0;           /* save starting position */
+    memTable[*hdl].fitsfilesize=filesize;    /* and initial file size  */
+
+    return(0);
+}
+/*--------------------------------------------------------------------------*/
 int mem_uncompress2mem(char *filename, FILE *diskfile, int hdl)
 {
 /*
@@ -630,7 +952,6 @@ int mem_size(int handle, OFF_T *filesize)
 */
 {
     *filesize = memTable[handle].fitsfilesize;
-
     return(0);
 }
 /*--------------------------------------------------------------------------*/
@@ -656,6 +977,37 @@ int mem_close_keep(int handle)
     return(0);
 }
 /*--------------------------------------------------------------------------*/
+int mem_close_comp(int handle)
+/*
+  compress the memory file, writing it out to the fileptr (which might
+  be stdout)
+*/
+{
+    int status = 0;
+    size_t compsize;
+
+    /* compress file in  memory to a .gz disk file */
+
+    if(compress2file_from_mem(memTable[handle].memaddr,
+              memTable[handle].fitsfilesize, 
+              memTable[handle].fileptr,
+              &compsize, &status ) )
+    {
+            ffpmsg("failed to copy memory file to file (mem_close_comp)");
+            status = WRITE_ERROR;
+    }
+
+    free( memTable[handle].memaddr );   /* free the memory */
+    memTable[handle].memaddrptr = 0;
+    memTable[handle].memaddr = 0;
+
+    /* close the compressed disk file (except if it is 'stdout' */
+    if (memTable[handle].fileptr != stdout)
+        fclose(memTable[handle].fileptr);
+
+    return(status);
+}
+/*--------------------------------------------------------------------------*/
 int mem_seek(int handle, OFF_T offset)
 /*
   seek to position relative to start of the file.
@@ -692,7 +1044,8 @@ int mem_write(int hdl, void *buffer, long nbytes)
     size_t newsize;
     char *ptr;
 
-    if (memTable[hdl].currentpos + nbytes > *(memTable[hdl].memsizeptr))
+    if ((size_t) (memTable[hdl].currentpos + nbytes) > 
+         *(memTable[hdl].memsizeptr) )
     {
                
         if (!(memTable[hdl].mem_realloc))
@@ -708,7 +1061,7 @@ int mem_write(int hdl, void *buffer, long nbytes)
              the defined 'deltasize' parameter
          */
 
-        newsize = maxvalue(
+        newsize = maxvalue( (size_t)
             (((memTable[hdl].currentpos + nbytes - 1) / 2880) + 1) * 2880,
             *(memTable[hdl].memsizeptr) + memTable[hdl].deltasize);
 
diff --git a/drvrnet.c b/drvrnet.c
index cc12185..7cd9ab9 100644
--- a/drvrnet.c
+++ b/drvrnet.c
@@ -122,11 +122,8 @@
 $Id$
 
 $Log$
-Revision 1.1  22-Apr-2003 13:39:04+10  tjf
-Version marked 2100 - base used for 6dF
-
-Revision 1.0  22-Apr-2003 13:39:04+10  tjf
-cfitsio1.0
+Revision 1.2  15-Nov-2004 13:59:20+11  tjf
+CFITSIO with version tag 2500
 
 Revision 1.56  2000/01/04 11:58:31  oneel
 Updates so that compressed network files are dealt with regardless of
@@ -177,7 +174,6 @@ Baltimore MD 21218 USA              
 static jmp_buf env; /* holds the jump buffer for setjmp/longjmp pairs */
 static void signal_handler(int sig);
 
-
 /* Network routine error codes */
 #define NET_OK 0
 #define NOT_INET_ADDRESS -1000
@@ -216,7 +212,7 @@ typedef struct    /* structure containing disk file structure */
   OFF_T currentpos;
 } rootdriver;
 
-static rootdriver handleTable[NIOBUF];  /* allocate diskfile handle tables */
+static rootdriver handleTable[NMAXFILES];  /* allocate diskfile handle tables */
 
 /* static prototypes */
 
@@ -273,7 +269,8 @@ int http_open(char *filename, int rwmode, int *handle)
 
   /* don't do r/w files */
   if (rwmode != 0) {
-    ffpmsg("Specify an outfile for r/w access (http_open)");
+    ffpmsg("Can't open http:// type file with READWRITE access");
+    ffpmsg("  Specify an outfile for r/w access (http_open)");
     goto error;
   }
 
@@ -287,17 +284,18 @@ int http_open(char *filename, int rwmode, int *handle)
 
   (void) signal(SIGALRM, signal_handler);
   
-
   /* Open the network connection */
 
   /* Does the file have a .Z or .gz in it */
-  if (strstr(filename,".Z") || strstr(filename,".gz")) {
+  /* Also, if file has a '?' in it (probably cgi script) */
+  if (strstr(filename,".Z") || strstr(filename,".gz") || 
+      strstr(filename,"?")) {
     alarm(NETTIMEOUT);
     if (http_open_network(filename,&httpfile,contentencoding,
 			       &contentlength)) {
       alarm(0);
-      sprintf(errorstr,"Unable to open http file %s (http_opens)",filename);
-      ffpmsg(errorstr);
+      ffpmsg("Unable to open http file (http_open):");
+      ffpmsg(filename);
       goto error;
     } 
   } else {
@@ -321,13 +319,13 @@ int http_open(char *filename, int rwmode, int *handle)
 			      &contentlength)) { 
 	  alarm(0);
 	  ffpmsg("Unable to open http file (http_open)");
+          ffpmsg(filename);
 	  goto error;
 	}
       }
     }
   }
 
-
   closehttpfile++;
 
   /* Create the memory file */
@@ -360,10 +358,10 @@ int http_open(char *filename, int rwmode, int *handle)
     alarm(0);
     if (status) {
       ffpmsg("Error writing compressed memory file (http_open)");
+      ffpmsg(filename);
       goto error;
     }
     
-    
   } else {
     /* It's not compressed, bad choice, but we'll copy it anyway */
     if (contentlength % 2880) {
@@ -378,6 +376,8 @@ int http_open(char *filename, int rwmode, int *handle)
       alarm(0); /* cancel alarm */
       status = mem_write(*handle,recbuf,len);
       if (status) {
+        ffpmsg("Error copying http file into memory (http_open)");
+        ffpmsg(filename);
 	goto error;
       }
       alarm(NETTIMEOUT); /* rearm the alarm */
@@ -390,7 +390,6 @@ int http_open(char *filename, int rwmode, int *handle)
   alarm(0);
   return mem_seek(*handle,0);
 
-
  error:
   alarm(0); /* clear it */
   if (closehttpfile) {
@@ -402,12 +401,12 @@ int http_open(char *filename, int rwmode, int *handle)
   
   signal(SIGALRM, SIG_DFL);
   return (FILE_NOT_OPENED);
-
 }
-
 /*--------------------------------------------------------------------------*/
 /* This creates a memory file handle with a copy of the URL in filename.  The
-   file must be compressed and is copied to disk first. */
+   file must be compressed and is copied (still compressed) to disk first. 
+   The compressed disk file is then uncompressed into memory (READONLY).
+*/
 
 int http_compress_open(char *url, int rwmode, int *handle)
 {
@@ -416,7 +415,7 @@ int http_compress_open(char *url, int rwmode, int *handle)
   char recbuf[MAXLEN];
   long len;
   int contentlength;
-  int status;
+  int ii, flen, status;
   char firstchar;
 
   closehttpfile = 0;
@@ -424,19 +423,19 @@ int http_compress_open(char *url, int rwmode, int *handle)
   closefdiskfile = 0;
   closememfile = 0;
 
-
   /* cfileio made a mistake, should set the netoufile first otherwise 
      we don't know where to write the output file */
 
-  if (!strlen(netoutfile)) 
-    {
+  flen = strlen(netoutfile);
+  if (!flen)  {
       ffpmsg
 	("Output file not set, shouldn't have happened (http_compress_open)");
       goto error;
-    }
+  }
 
   if (rwmode != 0) {
-    ffpmsg("Only R/O files for http compressed files(http_compress_open");
+    ffpmsg("Can't open compressed http:// type file with READWRITE access");
+    ffpmsg("  Specify an UNCOMPRESSED outfile (http_compress_open)");
     goto error;
   }
   /* do the signal handler bits */
@@ -455,6 +454,7 @@ int http_compress_open(char *url, int rwmode, int *handle)
 			       &contentlength))) {
     alarm(0);
     ffpmsg("Unable to open http file (http_compress_open)");
+    ffpmsg(url);
     goto error;
   }
 
@@ -468,10 +468,19 @@ int http_compress_open(char *url, int rwmode, int *handle)
       !strcmp(contentencoding,"x-compress") ||
       ('\037' == firstchar)) {
 
+    if (*netoutfile == '!')
+    {
+       /* user wants to clobber file, if it already exists */
+       for (ii = 0; ii < flen; ii++)
+           netoutfile[ii] = netoutfile[ii + 1];  /* remove '!' */
+
+       status = file_remove(netoutfile);
+    }
 
     /* Create the new file */
     if ((status =  file_create(netoutfile,handle))) {
-      ffpmsg("Unable to create output file (http_compress_open)");
+      ffpmsg("Unable to create output disk file (http_compress_open):");
+      ffpmsg(netoutfile);
       goto error;
     }
     
@@ -483,7 +492,8 @@ int http_compress_open(char *url, int rwmode, int *handle)
       alarm(0);
       status = file_write(*handle,recbuf,len);
       if (status) {
-	ffpmsg("Error writing file (http_compres_open)");
+	ffpmsg("Error writing disk file (http_compres_open)");
+        ffpmsg(netoutfile);
 	goto error;
       }
       alarm(NETTIMEOUT);
@@ -497,6 +507,7 @@ int http_compress_open(char *url, int rwmode, int *handle)
 
     if (NULL == (diskfile = fopen(netoutfile,"r"))) {
       ffpmsg("Unable to reopen disk file (http_compress_open)");
+      ffpmsg(netoutfile);
       goto error;
     }
     closefdiskfile++;
@@ -514,17 +525,17 @@ int http_compress_open(char *url, int rwmode, int *handle)
     fclose(diskfile);
     closefdiskfile--;
     if (status) {
-      ffpmsg("Error writing compressed memory file (http_compress_open)");
+      ffpmsg("Error uncompressing disk file to memory (http_compress_open)");
+      ffpmsg(netoutfile);
       goto error;
     }
       
   } else {
     /* Opps, this should not have happened */
-    ffpmsg("Can only compressed files here (http_compress_open)");
+    ffpmsg("Can only have compressed files here (http_compress_open)");
     goto error;
   }    
     
-
   signal(SIGALRM, SIG_DFL);
   alarm(0);
   return mem_seek(*handle,0);
@@ -549,9 +560,9 @@ int http_compress_open(char *url, int rwmode, int *handle)
 }
 
 /*--------------------------------------------------------------------------*/
-/* This creates a file handle with a copy of the URL in filename.  The
-   file may be compressed and is copied to disk first.  If it's compressed 
-   then it is uncompressed when copying to the disk */
+/* This creates a file handle with a copy of the URL in filename.  The http
+   file is copied to disk first.  If it's compressed then it is
+   uncompressed when copying to the disk */
 
 int http_file_open(char *url, int rwmode, int *handle)
 {
@@ -561,20 +572,26 @@ int http_file_open(char *url, int rwmode, int *handle)
   char recbuf[MAXLEN];
   long len;
   int contentlength;
-  int status;
+  int ii, flen, status;
   char firstchar;
 
+  /* Check if output file is actually a memory file */
+  if (!strncmp(netoutfile, "mem:", 4) )
+  {
+     /* allow the memory file to be opened with write access */
+     return( http_open(url, READONLY, handle) );
+  }     
+
   closehttpfile = 0;
   closefile = 0;
   closeoutfile = 0;
 
-
   /* cfileio made a mistake, we need to know where to write the file */
-  if (!strlen(netoutfile)) 
-    {
+  flen = strlen(netoutfile);
+  if (!flen) {
       ffpmsg("Output file not set, shouldn't have happened (http_file_open)");
       return (FILE_NOT_OPENED);
-    }
+  }
 
   /* do the signal handler bits */
   if (setjmp(env) != 0) {
@@ -592,11 +609,21 @@ int http_file_open(char *url, int rwmode, int *handle)
 			       &contentlength))) {
     alarm(0);
     ffpmsg("Unable to open http file (http_file_open)");
+    ffpmsg(url);
     goto error;
   }
 
   closehttpfile++;
 
+  if (*netoutfile == '!')
+  {
+     /* user wants to clobber disk file, if it already exists */
+     for (ii = 0; ii < flen; ii++)
+         netoutfile[ii] = netoutfile[ii + 1];  /* remove '!' */
+
+     status = file_remove(netoutfile);
+  }
+
   firstchar = fgetc(httpfile);
   ungetc(firstchar,httpfile);
   if (!strcmp(contentencoding,"x-gzip") || 
@@ -604,16 +631,19 @@ int http_file_open(char *url, int rwmode, int *handle)
       ('\037' == firstchar)) {
 
     /* to make this more cfitsioish we use the file driver calls to create
-       the file */
+       the disk file */
+
     /* Create the output file */
     if ((status =  file_create(netoutfile,handle))) {
       ffpmsg("Unable to create output file (http_file_open)");
+      ffpmsg(netoutfile);
       goto error;
-      
     }
+
     file_close(*handle);
     if (NULL == (outfile = fopen(netoutfile,"w"))) {
       ffpmsg("Unable to reopen the output file (http_file_open)");
+      ffpmsg(netoutfile);
       goto error;
     }
     closeoutfile++;
@@ -627,7 +657,9 @@ int http_file_open(char *url, int rwmode, int *handle)
     status = uncompress2file(url,httpfile,outfile,&status);
     alarm(0);
     if (status) {
-      ffpmsg("Unable to uncompress the output file (http_file_open)");
+      ffpmsg("Error uncompressing http file to disk file (http_file_open)");
+      ffpmsg(url);
+      ffpmsg(netoutfile);
       goto error;
     }
     fclose(outfile);
@@ -637,8 +669,8 @@ int http_file_open(char *url, int rwmode, int *handle)
     /* Create the output file */
     if ((status =  file_create(netoutfile,handle))) {
       ffpmsg("Unable to create output file (http_file_open)");
+      ffpmsg(netoutfile);
       goto error;
-      
     }
     
     /* Give a warning message.  This could just be bad padding at the end
@@ -658,7 +690,9 @@ int http_file_open(char *url, int rwmode, int *handle)
       alarm(0);
       status = file_write(*handle,recbuf,len);
       if (status) {
-	ffpmsg("Error writing file (http_file_open)");
+	ffpmsg("Error copying http file to disk file (http_file_open)");
+        ffpmsg(url);
+        ffpmsg(netoutfile);
 	goto error;
       }
     }
@@ -674,7 +708,6 @@ int http_file_open(char *url, int rwmode, int *handle)
 
   return file_open(netoutfile,rwmode,handle); 
 
-
  error:
   alarm(0); /* clear it */
   if (closehttpfile) {
@@ -720,6 +753,11 @@ static int http_open_network(char *url, FILE **httpfile, char *contentencoding,
   int port;
   float version;
 
+  char pproto[SHORTLEN];
+  char phost[SHORTLEN]; /* address of the proxy server */
+  int  pport;  /* port number of the proxy server */
+  char pfn[MAXLEN];
+  char *proxy; /* URL of the proxy server */
 
   /* Parse the URL apart again */
   strcpy(turl,"http://");
@@ -730,10 +768,32 @@ static int http_open_network(char *url, FILE **httpfile, char *contentencoding,
     return (FILE_NOT_OPENED);
   }
 
+  /* Ph. Prugniel 2003/04/03
+     Are we using a proxy?
+     
+     We use a proxy if the environment variable "http_proxy" is set to an
+     address, eg. http://wwwcache.nottingham.ac.uk:3128
+     ("http_proxy" is also used by wget)
+  */
+  proxy = getenv("http_proxy");
+
   /* Connect to the remote host */
-  sock = NET_TcpConnect(host,port);
+  if (proxy) {
+    if (NET_ParseUrl(proxy,pproto,phost,&pport,pfn)) {
+      sprintf(errorstr,"URL Parse Error (http_open) %s",proxy);
+      ffpmsg(errorstr);
+      return (FILE_NOT_OPENED);
+    }
+    sock = NET_TcpConnect(phost,pport);
+  }
+  else
+    sock = NET_TcpConnect(host,port); 
+
   if (sock < 0) {
-    ffpmsg("Couldn't connect to host (http_open_network)");
+    if (proxy) {
+      ffpmsg("Couldn't connect to host via proxy server (http_open_network)");
+      ffpmsg(proxy);
+    }
     return (FILE_NOT_OPENED);
   }
 
@@ -745,11 +805,22 @@ static int http_open_network(char *url, FILE **httpfile, char *contentencoding,
   }
 
   /* Send the GET request to the remote server */
-  strcpy(tmpstr,"GET ");
-  strcat(tmpstr,fn);
-  strcat(tmpstr," http/1.0\n");
-  sprintf(tmpstr1,"User-Agent: HEASARC/CFITSIO/%-8.3f\n\n",ffvers(&version));
+  /* Ph. Prugniel 2003/04/03 
+     One must add the Host: command because of HTTP 1.1 servers (ie. virtual
+     hosts) */
+
+  if (proxy)
+    sprintf(tmpstr,"GET http://%s:%-d%s HTTP/1.0\n",host,port,fn);
+  else
+    sprintf(tmpstr,"GET %s HTTP/1.0\n",fn);
+
+  sprintf(tmpstr1,"User-Agent: HEASARC/CFITSIO/%-8.3f\n",ffvers(&version));
+  strcat(tmpstr,tmpstr1);
+
+  /* HTTP 1.1 servers require the following 'Host: ' string */
+  sprintf(tmpstr1,"Host: %s:%-d\n\n",host,port);
   strcat(tmpstr,tmpstr1);
+
   status = NET_SendRaw(sock,tmpstr,strlen(tmpstr),NET_DEFAULT);
 
   /* read the header */
@@ -792,10 +863,11 @@ static int http_open_network(char *url, FILE **httpfile, char *contentencoding,
       /* if we get here then we couldnt' decide the redirect */
       ffpmsg("but we were unable to find the redirected url in the servers response");
     }
-    sprintf(errorstr, 
+/*    sprintf(errorstr, 
 	    "(http_open_network) Status not 200, was %d\nLine was %s\n",
-	    status,recbuf);
+	    status,recbuf); 
     ffpmsg(errorstr);
+*/
     fclose(*httpfile);
     return (FILE_NOT_OPENED);
   }
@@ -842,7 +914,6 @@ int ftp_open(char *filename, int rwmode, int *handle)
   int sock;
   char newfilename[MAXLEN];
   char recbuf[MAXLEN];
-  char errorstr[MAXLEN];
   long len;
   int status;
   char firstchar;
@@ -853,6 +924,7 @@ int ftp_open(char *filename, int rwmode, int *handle)
 
   /* don't do r/w files */
   if (rwmode != 0) {
+    ffpmsg("Can't open ftp:// type file with READWRITE access");
     ffpmsg("Specify an outfile for r/w access (ftp_open)");
     return (FILE_NOT_OPENED);
   }
@@ -878,8 +950,8 @@ int ftp_open(char *filename, int rwmode, int *handle)
     if (ftp_open_network(filename,&ftpfile,&command,&sock)) {
 
       alarm(0);
-      sprintf(errorstr,"Unable to open ftp file %s (http_opens)",filename);
-      ffpmsg(errorstr);
+      ffpmsg("Unable to open ftp file (ftp_open)");
+      ffpmsg(filename);
       goto error;
     } 
   } else {
@@ -902,6 +974,7 @@ int ftp_open(char *filename, int rwmode, int *handle)
 	if (ftp_open_network(newfilename,&ftpfile,&command,&sock)) {
 	  alarm(0);
 	  ffpmsg("Unable to open ftp file (ftp_open)");
+          ffpmsg(newfilename);
 	  goto error;
 	}
       }
@@ -913,7 +986,8 @@ int ftp_open(char *filename, int rwmode, int *handle)
 
   /* create the memory file */
   if ((status = mem_create(filename,handle))) {
-    ffpmsg ("Could not create filename to passive port (ftp_open)");
+    ffpmsg ("Could not create memory file to passive port (ftp_open)");
+    ffpmsg(filename);
     goto error;
   }
   closememfile++;
@@ -935,6 +1009,7 @@ int ftp_open(char *filename, int rwmode, int *handle)
     alarm(0);
     if (status) {
       ffpmsg("Error writing compressed memory file (ftp_open)");
+      ffpmsg(filename);
       goto error;
     }
   } else {
@@ -945,6 +1020,7 @@ int ftp_open(char *filename, int rwmode, int *handle)
       status = mem_write(*handle,recbuf,len);
       if (status) {
 	ffpmsg("Error writing memory file (http_open)");
+        ffpmsg(filename);
 	goto error;
       }
       alarm(NETTIMEOUT);
@@ -979,9 +1055,6 @@ int ftp_open(char *filename, int rwmode, int *handle)
   signal(SIGALRM, SIG_DFL);
   return (FILE_NOT_OPENED);
 }
-
-
-
 /*--------------------------------------------------------------------------*/
 /* This creates a file handle with a copy of the URL in filename. The 
    file must be  uncompressed and is copied to disk first */
@@ -993,23 +1066,29 @@ int ftp_file_open(char *url, int rwmode, int *handle)
   char recbuf[MAXLEN];
   long len;
   int sock;
-  int status;
+  int ii, flen, status;
   char firstchar;
 
+  /* Check if output file is actually a memory file */
+  if (!strncmp(netoutfile, "mem:", 4) )
+  {
+     /* allow the memory file to be opened with write access */
+     return( ftp_open(url, READONLY, handle) );
+  }     
+
   closeftpfile = 0;
   closecommandfile = 0;
   closefile = 0;
   closeoutfile = 0;
   
-
   /* cfileio made a mistake, need to know where to write the output file */
-  if (!strlen(netoutfile)) 
+  flen = strlen(netoutfile);
+  if (!flen) 
     {
       ffpmsg("Output file not set, shouldn't have happened (ftp_file_open)");
       return (FILE_NOT_OPENED);
     }
 
-
   /* do the signal handler bits */
   if (setjmp(env) != 0) {
     /* feels like the second time */
@@ -1028,11 +1107,21 @@ int ftp_file_open(char *url, int rwmode, int *handle)
   if ((status = ftp_open_network(url,&ftpfile,&command,&sock))) {
     alarm(0);
     ffpmsg("Unable to open http file (ftp_file_open)");
+    ffpmsg(url);
     goto error;
   }
   closeftpfile++;
   closecommandfile++;
 
+  if (*netoutfile == '!')
+  {
+     /* user wants to clobber file, if it already exists */
+     for (ii = 0; ii < flen; ii++)
+         netoutfile[ii] = netoutfile[ii + 1];  /* remove '!' */
+
+     status = file_remove(netoutfile);
+  }
+
   /* Now, what do we do with the file */
   firstchar = fgetc(ftpfile);
   ungetc(firstchar,ftpfile);
@@ -1046,12 +1135,14 @@ int ftp_file_open(char *url, int rwmode, int *handle)
     /* Create the output file */
     if ((status =  file_create(netoutfile,handle))) {
       ffpmsg("Unable to create output file (ftp_file_open)");
+      ffpmsg(netoutfile);
       goto error;
-      
     }
+
     file_close(*handle);
     if (NULL == (outfile = fopen(netoutfile,"w"))) {
       ffpmsg("Unable to reopen the output file (ftp_file_open)");
+      ffpmsg(netoutfile);
       goto error;
     }
     closeoutfile++;
@@ -1066,6 +1157,8 @@ int ftp_file_open(char *url, int rwmode, int *handle)
     alarm(0);
     if (status) {
       ffpmsg("Unable to uncompress the output file (ftp_file_open)");
+      ffpmsg(url);
+      ffpmsg(netoutfile);
       goto error;
     }
     fclose(outfile);
@@ -1073,15 +1166,14 @@ int ftp_file_open(char *url, int rwmode, int *handle)
 
   } else {
     
-
     /* Create the output file */
     if ((status =  file_create(netoutfile,handle))) {
       ffpmsg("Unable to create output file (ftp_file_open)");
+      ffpmsg(netoutfile);
       goto error;
     }
     closefile++;
     
-    
     /* write a file */
     alarm(NETTIMEOUT);
     while(0 != (len = fread(recbuf,1,MAXLEN,ftpfile))) {
@@ -1089,6 +1181,8 @@ int ftp_file_open(char *url, int rwmode, int *handle)
       status = file_write(*handle,recbuf,len);
       if (status) {
 	ffpmsg("Error writing file (ftp_file_open)");
+        ffpmsg(url);
+        ffpmsg(netoutfile);
 	goto error;
       }
       alarm(NETTIMEOUT);
@@ -1126,7 +1220,6 @@ int ftp_file_open(char *url, int rwmode, int *handle)
   return (FILE_NOT_OPENED);
 }
 
-
 /*--------------------------------------------------------------------------*/
 /* This creates a memory  handle with a copy of the URL in filename. The 
    file must be compressed and is copied to disk first */
@@ -1137,7 +1230,7 @@ int ftp_compress_open(char *url, int rwmode, int *handle)
   FILE *command;
   char recbuf[MAXLEN];
   long len;
-  int status;
+  int ii, flen, status;
   int sock;
   char firstchar;
 
@@ -1154,10 +1247,11 @@ int ftp_compress_open(char *url, int rwmode, int *handle)
   }
   
   /* Need to know where to write the output file */
-  if (!strlen(netoutfile)) 
+  flen = strlen(netoutfile);
+  if (!flen) 
     {
       ffpmsg(
-	     "Output file not set, shouldn't have happened (ftp_compress_open)");
+	"Output file not set, shouldn't have happened (ftp_compress_open)");
       return (FILE_NOT_OPENED);
     }
   
@@ -1174,9 +1268,11 @@ int ftp_compress_open(char *url, int rwmode, int *handle)
   /* Open the network connection to url, ftpfile is connected to the file 
      port, command is connected to port 21.  sock is for writing to port 21 */
   alarm(NETTIMEOUT);
+
   if ((status = ftp_open_network(url,&ftpfile,&command,&sock))) {
     alarm(0);
     ffpmsg("Unable to open ftp file (ftp_compress_open)");
+    ffpmsg(url);
     goto error;
   }
   closeftpfile++;
@@ -1189,10 +1285,20 @@ int ftp_compress_open(char *url, int rwmode, int *handle)
   if (strstr(url,".gz") || 
       strstr(url,".Z") ||
       ('\037' == firstchar)) {
-    
+  
+    if (*netoutfile == '!')
+    {
+       /* user wants to clobber file, if it already exists */
+       for (ii = 0; ii < flen; ii++)
+          netoutfile[ii] = netoutfile[ii + 1];  /* remove '!' */
+
+       status = file_remove(netoutfile);
+    }
+
     /* Create the output file */
     if ((status =  file_create(netoutfile,handle))) {
       ffpmsg("Unable to create output file (ftp_compress_open)");
+      ffpmsg(netoutfile);
       goto error;
     }
     closediskfile++;
@@ -1204,6 +1310,8 @@ int ftp_compress_open(char *url, int rwmode, int *handle)
       status = file_write(*handle,recbuf,len);
       if (status) {
 	ffpmsg("Error writing file (ftp_compres_open)");
+        ffpmsg(url);
+        ffpmsg(netoutfile);
 	goto error;
       }
       alarm(NETTIMEOUT);
@@ -1222,12 +1330,14 @@ int ftp_compress_open(char *url, int rwmode, int *handle)
 
     if (NULL == (diskfile = fopen(netoutfile,"r"))) {
       ffpmsg("Unable to reopen disk file (ftp_compress_open)");
+      ffpmsg(netoutfile);
       return (FILE_NOT_OPENED);
     }
     closefdiskfile++;
   
     if ((status =  mem_create(url,handle))) {
       ffpmsg("Unable to create memory file (ftp_compress_open)");
+      ffpmsg(url);
       goto error;
     }
     closememfile++;
@@ -1275,7 +1385,6 @@ int ftp_compress_open(char *url, int rwmode, int *handle)
   return (FILE_NOT_OPENED);
 }
 
-
 /*--------------------------------------------------------------------------*/
 /* Open a ftp connection to filename (really a URL), return ftpfile set to 
    the file connection, and command set to the control connection, with sock
@@ -1413,22 +1522,17 @@ int ftp_open_network(char *filename, FILE **ftpfile, FILE **command, int *sock)
     return (FILE_NOT_OPENED);
   }
   
-  /* Send the retrieve command to see if the file exists*/
-  sprintf(tmpstr,"RETR %s\n",newfn);
-#ifdef DEBUG
-  printf ("Checking to see if %s, exists %d\n",tmpstr,strlen(newfn));
-#endif
+ 
+  /* Always use binary mode */
+  sprintf(tmpstr,"TYPE I\n");
   status = NET_SendRaw(*sock,tmpstr,strlen(tmpstr),NET_DEFAULT);
-  /* We better get a 425 here, we haven't sent a PORT or PASV command
-     yet.  If we don't get a 425 then we're hosed and the file
-     doesn't exist */
-  if (ftp_status(*command,"425 ")) {
-    ffpmsg("File doesn't exist on remote server (ftp_open)");
+  
+  if (ftp_status(*command,"200 ")) {
+    ffpmsg ("TYPE I error, 200 not seen (ftp_open)");
     fclose(*command);
     return (FILE_NOT_OPENED);
   }
-  /* we're going to use passive mode here */
-  
+ 
   status = NET_SendRaw(*sock,"PASV\n",5,NET_DEFAULT);
   if (!(fgets(recbuf,MAXLEN,*command))) {
     ffpmsg ("PASV error (ftp_open)");
@@ -1501,15 +1605,6 @@ int ftp_open_network(char *filename, FILE **ftpfile, FILE **command, int *sock)
     sscanf(tstr,"%d",&tmpint);
     port += tmpint;
     
-    /* Always use binary mode */
-    sprintf(tmpstr,"TYPE I\n");
-    status = NET_SendRaw(*sock,tmpstr,strlen(tmpstr),NET_DEFAULT);
-    
-    if (ftp_status(*command,"200 ")) {
-      ffpmsg ("TYPE I error, 200 not seen (ftp_open)");
-      fclose(*command);
-      return (FILE_NOT_OPENED);
-    }
     
     if (!strlen(newfn)) {
       ffpmsg("Null file name (ftp_open)");
@@ -1517,13 +1612,10 @@ int ftp_open_network(char *filename, FILE **ftpfile, FILE **command, int *sock)
       return (FILE_NOT_OPENED);
     }
     
-    /* Send the retrieve command */
-    sprintf(tmpstr,"RETR %s\n",newfn);
+
 #ifdef DEBUG
-    printf ("Retrieving file %s, %d\n",tmpstr,strlen(newfn));
+    puts("connection to passive port");
 #endif
-    status = NET_SendRaw(*sock,tmpstr,strlen(tmpstr),NET_DEFAULT);
-
     /* COnnect to the data port */
     sock1 = NET_TcpConnect(ip,port);
     if (NULL == (*ftpfile = fdopen(sock1,"r"))) {
@@ -1534,6 +1626,21 @@ int ftp_open_network(char *filename, FILE **ftpfile, FILE **command, int *sock)
 
     /* now we return */
 
+    /* Send the retrieve command */
+    sprintf(tmpstr,"RETR %s\n",newfn);
+    status = NET_SendRaw(*sock,tmpstr,strlen(tmpstr),NET_DEFAULT);
+
+#ifdef DEBUG
+    puts("Sent RETR command");
+#endif
+    if (ftp_status(*command,"150 ")) {
+      ffpmsg ("RETR error, most likely file is not there (ftp_open)");
+      fclose(*command);
+#ifdef DEBUG
+      puts("File not there");
+#endif
+      return (FILE_NOT_OPENED);
+    }
     return 0;
   }
   
@@ -1566,8 +1673,10 @@ static int NET_TcpConnect(char *hostname, int port)
 		       sizeof(sockaddr))) 
        < 0) {
      close(sock);
+/*
      perror("NET_Tcpconnect - Connection error");
      ffpmsg("Can't connect to host, connection error");
+*/
      return CONNECTION_ERROR;
    }
    setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&val, sizeof(val));
@@ -1617,7 +1726,9 @@ static int NET_SendRaw(int sock, const void *buffer, int length, int opt)
 #endif
    return n;
 }
- 
+
+/*--------------------------------------------------------------------------*/
+
 static int NET_RecvRaw(int sock, void *buffer, int length)
 {
   /* Receive exactly length bytes into buffer. Returns number of bytes */
@@ -1637,12 +1748,9 @@ static int NET_RecvRaw(int sock, void *buffer, int length)
 	break;        /*/ EOF */
    }
 
-
    return n;
 }
  
-
-
 /*--------------------------------------------------------------------------*/
 /* Yet Another URL Parser 
    url - input url
@@ -1725,8 +1833,7 @@ static int NET_ParseUrl(const char *url, char *proto, char *host, int *port,
       thost++;
       urlcopy++;
     }
-    /* Now, we should either be at the end of the string, have a /, or have a
-       : */
+    /* we should either be at the end of the string, have a /, or have a : */
     *thost = '\0';
     if (*urlcopy == ':') {
       /* follows a port number */
@@ -1758,25 +1865,42 @@ static int NET_ParseUrl(const char *url, char *proto, char *host, int *port,
 /*--------------------------------------------------------------------------*/
 
 /* Small helper functions to set the netoutfile static string */
-/* Called by cfileio after parsing the output file off of the input file
-   url */
+/* Called by cfileio after parsing the output file off of the input file url */
 
 int http_checkfile (char *urltype, char *infile, char *outfile1)
-
 {
   char newinfile[MAXLEN];
   FILE *httpfile;
   char contentencoding[MAXLEN];
   int contentlength;
   
-  /* default to http://
-   */
+  /* default to http:// if there is no output file */
     
   strcpy(urltype,"http://");
 
   if (strlen(outfile1)) {
     /* there is an output file */
-    strcpy(netoutfile,outfile1);
+
+    /* don't copy the "file://" prefix, if present.  */
+    if (!strncmp(outfile1, "file://", 7) )
+       strcpy(netoutfile,outfile1+7);
+    else
+       strcpy(netoutfile,outfile1);
+
+    if (!strncmp(outfile1, "mem:", 4) )  {
+       /* copy the file to memory, with READ and WRITE access 
+          In this case, it makes no difference whether the http file
+          and or the output file are compressed or not.   */
+
+       strcpy(urltype, "httpmem://");  /* use special driver */
+       return 0;
+    }
+
+    if (strstr(infile, "?")) {
+      /* file name contains a '?' so probably a cgi string; don't open it */
+      strcpy(urltype,"httpfile://");
+      return 0;
+    }
 
     if (!http_open_network(infile,&httpfile,contentencoding,&contentlength)) {
       fclose(httpfile);
@@ -1827,29 +1951,39 @@ int http_checkfile (char *urltype, char *infile, char *outfile1)
       return 0;
     }
     
-
   } 
   return 0;
 }
 /*--------------------------------------------------------------------------*/
 int ftp_checkfile (char *urltype, char *infile, char *outfile1)
-
 {
-  
   char newinfile[MAXLEN];
   FILE *ftpfile;
   FILE *command;
   int sock;
 
   
-  /* default to ftp://
-   */
+  /* default to ftp://   */
     
   strcpy(urltype,"ftp://");
 
   if (strlen(outfile1)) {
     /* there is an output file */
-    strcpy(netoutfile,outfile1);
+
+    /* don't copy the "file://" prefix, if present.  */
+    if (!strncmp(outfile1, "file://", 7) )
+       strcpy(netoutfile,outfile1+7);
+    else
+       strcpy(netoutfile,outfile1);
+
+    if (!strncmp(outfile1, "mem:", 4) )  {
+       /* copy the file to memory, with READ and WRITE access 
+          In this case, it makes no difference whether the ftp file
+          and or the output file are compressed or not.   */
+
+       strcpy(urltype, "ftpmem://");  /* use special driver */
+       return 0;
+    }
 
     if (!ftp_open_network(infile,&ftpfile,&command,&sock)) {
       fclose(ftpfile);
@@ -1899,11 +2033,9 @@ int ftp_checkfile (char *urltype, char *infile, char *outfile1)
       return 0;
     }
     
-
   } 
   return 0;
 }
-
 /*--------------------------------------------------------------------------*/
 /* A small helper function to wait for a particular status on the ftp 
    connectino */
@@ -1918,11 +2050,16 @@ static int ftp_status(FILE *ftp, char *statusstr)
   len = strlen(statusstr);
   while (1) {
     if (!(fgets(recbuf,MAXLEN,ftp))) {
+#ifdef DEBUG
+      puts("error reading response in ftp_status");
+#endif
       return 1; /* error reading */
     }
+    
 #ifdef DEBUG
-    printf ("%s",recbuf); 
+    printf("ftp_status, return string was %s\n",recbuf);
 #endif
+
     recbuf[len] = '\0'; /* make it short */
     if (!strcmp(recbuf,statusstr)) {
       return 0; /* we're ok */
@@ -1934,6 +2071,7 @@ static int ftp_status(FILE *ftp, char *statusstr)
   }
 }
 
+
 /*
  *----------------------------------------------------------------------
  *
@@ -2015,20 +2153,16 @@ static void signal_handler(int sig) {
   }
 }
 
-
 /**************************************************************/
 
 /* Root driver */
 
-
-
-
 /*--------------------------------------------------------------------------*/
 int root_init(void)
 {
     int ii;
 
-    for (ii = 0; ii < NIOBUF; ii++)  /* initialize all empty slots in table */
+    for (ii = 0; ii < NMAXFILES; ii++) /* initialize all empty slots in table */
     {
        handleTable[ii].sock = 0;
        handleTable[ii].currentpos = 0;
@@ -2066,7 +2200,7 @@ int root_open(char *url, int rwmode, int *handle)
     int sock;
 
     *handle = -1;
-    for (ii = 0; ii < NIOBUF; ii++)  /* find empty slot in table */
+    for (ii = 0; ii < NMAXFILES; ii++)  /* find empty slot in table */
     {
         if (handleTable[ii].sock == 0)
         {
@@ -2099,7 +2233,7 @@ int root_create(char *filename, int *handle)
     int sock;
 
     *handle = -1;
-    for (ii = 0; ii < NIOBUF; ii++)  /* find empty slot in table */
+    for (ii = 0; ii < NMAXFILES; ii++)  /* find empty slot in table */
     {
         if (handleTable[ii].sock == 0)
         {
diff --git a/drvrsmem.c b/drvrsmem.c
index fae0b26..968d9fe 100644
--- a/drvrsmem.c
+++ b/drvrsmem.c
@@ -12,6 +12,7 @@
             no shmem segments remain, and last process terminates
 */
 
+#ifdef HAVE_SHMEM_SERVICES
 #include "fitsio2.h"                         /* drvrsmem.h is included by it */
 
 #include <stdio.h>
@@ -734,6 +735,23 @@ int     shared_list(int id)
    return(r);                                           /* table full */
  }
 
+int     shared_getaddr(int id, char **address)
+ { int i, r;
+   char segname[10];
+
+   if (NULL == shared_gt) return(SHARED_NOTINIT);       /* not initialized */
+   if (NULL == shared_lt) return(SHARED_NOTINIT);       /* not initialized */
+ 
+   strcpy(segname,"h");
+   sprintf(segname+1,"%d", id);
+ 
+   if (smem_open(segname,0,&i)) return(SHARED_BADARG);
+ 
+   *address = ((char *)(((DAL_SHM_SEGHEAD *)(shared_lt[i].p + 1)) + 1));
+ /*  smem_close(i); */
+   return(SHARED_OK);
+ }
+
 
 int     shared_uncond_delete(int id)
  { int i, r;
@@ -949,3 +967,4 @@ int     smem_write(int driverhandle, void *buffer, long nbytes)
    shared_lt[driverhandle].seekpos += nbytes;
    return(0);
  }
+#endif
diff --git a/drvrsmem.h b/drvrsmem.h
index 0e3953b..9b87601 100644
--- a/drvrsmem.h
+++ b/drvrsmem.h
@@ -157,6 +157,7 @@ int	shared_set_debug(int debug_msgs);	/* set/reset debug mode */
 int	shared_set_createmode(int mode);	/* set/reset debug mode */
 int	shared_list(int id);			/* list segment(s) */
 int	shared_uncond_delete(int id);		/* uncondintionally delete (NOWAIT operation) segment(s) */
+int	shared_getaddr(int id, char **address);	/* get starting address of FITS file in segment */
 
 int	smem_init(void);
 int	smem_shutdown(void);
diff --git a/editcol.c b/editcol.c
index 83e8fff..57e7622 100644
--- a/editcol.c
+++ b/editcol.c
@@ -6,6 +6,7 @@
 /*  Goddard Space Flight Center.                                           */
 
 #include <string.h>
+#include <ctype.h>
 #include <stdlib.h>
 #include "fitsio2.h"
 /*--------------------------------------------------------------------------*/
@@ -20,22 +21,41 @@ int ffrsim(fitsfile *fptr,      /* I - FITS file pointer           */
 {
     int ii, simple, obitpix, onaxis, extend, nmodify;
     long onaxes[99], pcount, gcount, nblocks, longval;
+    long longbitpix;
     OFF_T newsize, oldsize;
-    char comment[25], keyname[FLEN_KEYWORD], message[FLEN_ERRMSG];
+    char comment[FLEN_COMMENT], keyname[FLEN_KEYWORD], message[FLEN_ERRMSG];
 
     if (*status > 0)
         return(*status);
 
+    /* reset position to the correct HDU if necessary */
+    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+    {
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+    }
+         /* rescan header if data structure is undefined */
+    else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
+        if ( ffrdef(fptr, status) > 0)               
+            return(*status);
+
     /* get current image size parameters */
     if (ffghpr(fptr, 99, &simple, &obitpix, &onaxis, onaxes, &pcount,
                &gcount, &extend, status) > 0)
         return(*status);
 
+    longbitpix = bitpix;
+
+    /* test for the 2 special cases that represent unsigned integers */
+    if (longbitpix == USHORT_IMG)
+        longbitpix = SHORT_IMG;
+    else if (longbitpix == ULONG_IMG)
+        longbitpix = LONG_IMG;
+
     /* test that the new values are legal */
 
-    if (bitpix != BYTE_IMG && bitpix != SHORT_IMG && 
-        bitpix != LONG_IMG &&
-        bitpix != FLOAT_IMG && bitpix != DOUBLE_IMG)
+    if (longbitpix != BYTE_IMG && longbitpix != SHORT_IMG && 
+        longbitpix != LONG_IMG && longbitpix != LONGLONG_IMG &&
+        longbitpix != FLOAT_IMG && longbitpix != DOUBLE_IMG)
     {
         sprintf(message,
         "Illegal value for BITPIX keyword: %d", bitpix);
@@ -78,12 +98,12 @@ int ffrsim(fitsfile *fptr,      /* I - FITS file pointer           */
         oldsize = 1;
         for (ii = 0; ii < onaxis; ii++)
             oldsize *= onaxes[ii];  
-        oldsize = (oldsize + pcount) * gcount * abs(obitpix) / 8;
+        oldsize = (oldsize + pcount) * gcount * (abs(obitpix) / 8);
     }
 
     oldsize = (oldsize + 2879) / 2880; /* old size, in blocks */
 
-    newsize = (newsize + pcount) * gcount * abs(bitpix) / 8;
+    newsize = (newsize + pcount) * gcount * (abs(longbitpix) / 8);
     newsize = (newsize + 2879) / 2880; /* new size, in blocks */
 
     if (newsize > oldsize)   /* have to insert new blocks for image */
@@ -103,10 +123,9 @@ int ffrsim(fitsfile *fptr,      /* I - FITS file pointer           */
 
     strcpy(comment,"&");  /* special value to leave comments unchanged */
 
-    if (bitpix != obitpix)
+    if (longbitpix != obitpix)
     {                         /* update BITPIX value */
-        longval = bitpix;
-        ffmkyj(fptr, "BITPIX", longval, comment, status);
+        ffmkyj(fptr, "BITPIX", longbitpix, comment, status);
     }
 
     if (naxis != onaxis)
@@ -141,6 +160,22 @@ int ffrsim(fitsfile *fptr,      /* I - FITS file pointer           */
         }
     }
 
+    /* Update the BSCALE and BZERO keywords, if an unsigned integer image */
+    if (bitpix == USHORT_IMG)
+    {
+        strcpy(comment, "offset data range to that of unsigned short");
+        ffukyg(fptr, "BZERO", 32768., 0, comment, status);
+        strcpy(comment, "default scaling factor");
+        ffukyg(fptr, "BSCALE", 1.0, 0, comment, status);
+    }
+    else if (bitpix == ULONG_IMG)
+    {
+        strcpy(comment, "offset data range to that of unsigned long");
+        ffukyg(fptr, "BZERO", 2147483648., 0, comment, status);
+        strcpy(comment, "default scaling factor");
+        ffukyg(fptr, "BSCALE", 1.0, 0, comment, status);
+    }
+
     /* re-read the header, to make sure structures are updated */
     ffrdef(fptr, status);
     return(*status);
@@ -202,9 +237,10 @@ int ffirow(fitsfile *fptr,  /* I - FITS file pointer                        */
         return(*status = BAD_ROW_NUM);
     }
 
-    datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize; /* current data size */
+    /* current data size */
+    datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize;
     freespace = ( ( (datasize + 2879) / 2880) * 2880) - datasize;
-    nshift = (OFF_T)naxis1 * nrows;              /* no. of bytes to add to table */
+    nshift = (OFF_T)naxis1 * nrows;          /* no. of bytes to add to table */
 
     if ( (freespace - nshift) < 0)   /* not enough existing space? */
     {
@@ -294,18 +330,22 @@ int ffdrow(fitsfile *fptr,  /* I - FITS file pointer                        */
         return(*status = BAD_ROW_NUM);
     }
 
-    nshift = (OFF_T)naxis1 * nrows;           /* no. of bytes to delete from table */
-    datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize;    /* current size of data */
-    firstbyte = (OFF_T)naxis1 * (firstrow + nrows - 1); /* relative delete position */
+    nshift = (OFF_T)naxis1 * nrows;   /* no. of bytes to delete from table */
+    /* cur size of data */
+    datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize;
+
+    firstbyte = (OFF_T)naxis1 * (firstrow + nrows - 1); /* relative del pos */
     nbytes = datasize - firstbyte;    /* no. of bytes to shift up */
     firstbyte += ((fptr->Fptr)->datastart);   /* absolute delete position */
+
     ffshft(fptr, firstbyte, nbytes,  nshift * (-1), status); /* shift data */
 
     freespace = ( ( (datasize + 2879) / 2880) * 2880) - datasize;
     nblock = (nshift + freespace) / 2880;   /* number of blocks */
 
+    /* delete integral number blocks */
     if (nblock > 0) 
-        ffdblk(fptr, nblock, status);  /* delete integral number blocks */
+        ffdblk(fptr, nblock, status);
 
     /* update the heap starting address */
     (fptr->Fptr)->heapstart -= nshift;
@@ -319,6 +359,98 @@ int ffdrow(fitsfile *fptr,  /* I - FITS file pointer                        */
     ((fptr->Fptr)->numrows) -= nrows;
     ((fptr->Fptr)->origrows) -= nrows;
 
+    /* Update the heap data, if any.  This will remove any orphaned data */
+    /* that was only pointed to by the rows that have been deleted */
+    ffcmph(fptr, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffdrrg(fitsfile *fptr,  /* I - FITS file pointer to table               */
+           char *ranges,    /* I - ranges of rows to delete (1 = first)     */
+           int *status)     /* IO - error status                            */
+/*
+ delete the ranges of rows from the table (1 = first row of table).
+
+The 'ranges' parameter typically looks like:
+    '10-20, 30 - 40, 55' or '50-'
+and gives a list of rows or row ranges separated by commas.
+*/
+{
+    char *cptr;
+    int nranges, nranges2, ii;
+    long *minrow, *maxrow, naxis2, nrows, *rowarray, jj, kk;
+
+    if (*status > 0)
+        return(*status);
+
+    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+    {
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+    }
+        /* rescan header if data structure is undefined */
+    else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
+        if ( ffrdef(fptr, status) > 0)               
+            return(*status);
+
+    if ((fptr->Fptr)->hdutype == IMAGE_HDU)
+    {
+        ffpmsg("Can only delete rows in TABLE or BINTABLE extension (ffdrrg)");
+        return(*status = NOT_TABLE);
+    }
+
+    /* the NAXIS2 keyword may not be up to date, so use the structure value */
+    naxis2 = (fptr->Fptr)->numrows;
+
+    /* find how many ranges were specified ( = no. of commas in string + 1) */
+    cptr = ranges;
+    for (nranges = 1; (cptr = strchr(cptr, ',')); nranges++)
+        cptr++;
+ 
+    minrow = calloc(nranges, sizeof(long));
+    maxrow = calloc(nranges, sizeof(long));
+
+    if (!minrow || !maxrow) {
+        *status = MEMORY_ALLOCATION;
+        ffpmsg("failed to allocate memory for row ranges (ffdrrg)");
+        if (maxrow) free(maxrow);
+        if (minrow) free(minrow);
+        return(*status);
+    }
+
+    /* parse range list into array of range min and max values */
+    ffrwrg(ranges, naxis2, nranges, &nranges2, minrow, maxrow, status);
+    if (*status > 0 || nranges2 == 0) {
+        free(maxrow);
+        free(minrow);
+        return(*status);
+    }
+
+    /* determine total number or rows to delete */
+    nrows = 0;
+    for (ii = 0; ii < nranges2; ii++) {
+       nrows = nrows + maxrow[ii] - minrow[ii] + 1;
+    }
+
+    rowarray = calloc(nrows, sizeof(long));
+    if (!rowarray) {
+        *status = MEMORY_ALLOCATION;
+        ffpmsg("failed to allocate memory for row array (ffdrrg)");
+        return(*status);
+    }
+
+    for (kk = 0, ii = 0; ii < nranges2; ii++) {
+       for (jj = minrow[ii]; jj <= maxrow[ii]; jj++) {
+           rowarray[kk] = jj;
+           kk++;
+       }
+    }
+
+    /* delete the rows */
+    ffdrws(fptr, rowarray, nrows, status);
+    
+    free(rowarray);
+    free(maxrow);
+    free(minrow);
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -443,10 +575,152 @@ int ffdrws(fitsfile *fptr,  /* I - FITS file pointer                        */
     
     /* now delete the empty rows at the end of the table */
     ffdrow(fptr, naxis2 - nrows + 1, nrows, status);
+
+    /* Update the heap data, if any.  This will remove any orphaned data */
+    /* that was only pointed to by the rows that have been deleted */
+    ffcmph(fptr, status);
     
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffrwrg(
+      char *rowlist,      /* I - list of rows and row ranges */
+      long maxrows,       /* I - number of rows in the table */
+      int maxranges,     /* I - max number of ranges to be returned */
+      int *numranges,    /* O - number ranges returned */
+      long *minrow,       /* O - first row in each range */
+      long *maxrow,       /* O - last row in each range */
+      int *status)        /* IO - status value */
+{
+/*
+   parse the input list of row ranges, returning the number of ranges,
+   and the min and max row value in each range. 
+
+   The only characters allowed in the input rowlist are 
+       decimal digits, minus sign, and comma (and non-significant spaces) 
+
+   Example:  
+
+     list = "10-20, 30-35,50"
+
+   would return numranges = 3, minrow[] = {10, 30, 50}, maxrow[] = {20, 35, 50}
+
+   error is returned if min value of range is > max value of range or if the
+   ranges are not monotonically increasing.
+*/
+    char *next;
+    long minval, maxval;
+
+    if (*status > 0)
+        return(*status);
+
+    if (maxrows <= 0 ) {
+        *status = RANGE_PARSE_ERROR;
+        ffpmsg("Input maximum range value is <= 0 (fits_parse_ranges)");
+        return(*status);
+    }
+
+    next = rowlist;
+    *numranges = 0;
+
+    while (*next == ' ')next++;   /* skip spaces */
+   
+    while (*next != '\0') {
+
+      /* find min value of next range; *next must be '-' or a digit */
+      if (*next == '-') {
+          minval = 1;    /* implied minrow value = 1 */
+      } else if ( isdigit((int) *next) ) {
+          minval = strtol(next, &next, 10);
+      } else {
+          *status = RANGE_PARSE_ERROR;
+          ffpmsg("Syntax error in this row range list:");
+          ffpmsg(rowlist);
+          return(*status);
+      }
+
+      while (*next == ' ')next++;   /* skip spaces */
+
+      /* find max value of next range; *next must be '-', or ',' */
+      if (*next == '-') {
+          next++;
+          while (*next == ' ')next++;   /* skip spaces */
+
+          if ( isdigit((int) *next) ) {
+              maxval = strtol(next, &next, 10);
+          } else if (*next == ',' || *next == '\0') {
+              maxval = maxrows;  /* implied max value */
+          } else {
+              *status = RANGE_PARSE_ERROR;
+              ffpmsg("Syntax error in this row range list:");
+              ffpmsg(rowlist);
+              return(*status);
+          }
+      } else if (*next == ',' || *next == '\0') {
+          maxval = minval;  /* only a single integer in this range */
+      } else {
+          *status = RANGE_PARSE_ERROR;
+          ffpmsg("Syntax error in this row range list:");
+          ffpmsg(rowlist);
+          return(*status);
+      }
+
+      if (*numranges + 1 > maxranges) {
+          *status = RANGE_PARSE_ERROR;
+          ffpmsg("Overflowed maximum number of ranges (fits_parse_ranges)");
+          return(*status);
+      }
+
+      if (minval < 1 ) {
+          *status = RANGE_PARSE_ERROR;
+          ffpmsg("Syntax error in this row range list: row number < 1");
+          ffpmsg(rowlist);
+          return(*status);
+      }
+
+      if (maxval < minval) {
+          *status = RANGE_PARSE_ERROR;
+          ffpmsg("Syntax error in this row range list: min > max");
+          ffpmsg(rowlist);
+          return(*status);
+      }
+
+      if (*numranges > 0) {
+          if (minval <= maxrow[(*numranges) - 1]) {
+             *status = RANGE_PARSE_ERROR;
+             ffpmsg("Syntax error in this row range list.  Range minimum is");
+             ffpmsg("  less than or equal to previous range maximum");
+             ffpmsg(rowlist);
+             return(*status);
+         }
+      }
+
+      if (minval <= maxrows) {   /* ignore range if greater than maxrows */
+          if (maxval > maxrows)
+              maxval = maxrows;
+
+           minrow[*numranges] = minval;
+           maxrow[*numranges] = maxval;
+
+           (*numranges)++;
+      }
+
+      while (*next == ' ')next++;   /* skip spaces */
+      if (*next == ',') {
+           next++;
+           while (*next == ' ')next++;   /* skip more spaces */
+      }
+    }
+
+    if (*numranges == 0) {  /* a null string was entered */
+         minrow[0] = 1;
+         maxrow[0] = maxrows;
+         *numranges = 1;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fficol(fitsfile *fptr,  /* I - FITS file pointer                        */
            int numcol,      /* I - position for new col. (1 = 1st)          */
            char *ttype,     /* I - name of column (TTYPE keyword)           */
@@ -551,7 +825,7 @@ int fficls(fitsfile *fptr,  /* I - FITS file pointer                        */
     /* current size of data */
     datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize;
     freespace = ( ( (datasize + 2879) / 2880) * 2880) - datasize;
-    nadd = (OFF_T)delbyte * naxis2;                /* no. of bytes to add to table */
+    nadd = (OFF_T)delbyte * naxis2;   /* no. of bytes to add to table */
 
     if ( (freespace - nadd) < 0)   /* not enough existing space? */
     {
@@ -570,14 +844,14 @@ int fficls(fitsfile *fptr,  /* I - FITS file pointer                        */
 
         if (ffshft(fptr, firstbyte, nbytes, nadd, status) > 0) /* move heap */
             return(*status);
+    }
 
-        /* update the heap starting address */
-        (fptr->Fptr)->heapstart += nadd;
+    /* update the heap starting address */
+    (fptr->Fptr)->heapstart += nadd;
 
-        /* update the THEAP keyword if it exists */
-        tstatus = 0;
-        ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus);
-    }
+    /* update the THEAP keyword if it exists */
+    tstatus = 0;
+    ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus);
 
     /* calculate byte position in the row where to insert the new column */
     if (colnum > tfields)
@@ -627,7 +901,27 @@ int fficls(fitsfile *fptr,  /* I - FITS file pointer                        */
         ffupch(tfm);         /* make sure format is in upper case */
         ffkeyn("TFORM", colnum, keyname, status);
 
-        if (datacode == TUSHORT) 
+        if (abs(datacode) == TSBYTE) 
+        {
+           /* Replace the 'S' with an 'B' in the TFORMn code */
+           cptr = tfm;
+           while (*cptr != 'S') 
+              cptr++;
+
+           *cptr = 'B';
+           ffpkys(fptr, keyname, tfm, comm, status);
+
+           /* write the TZEROn and TSCALn keywords */
+           ffkeyn("TZERO", colnum, keyname, status);
+           strcpy(comm, "offset for signed bytes");
+
+           ffpkyg(fptr, keyname, -128., 0, comm, status);
+
+           ffkeyn("TSCAL", colnum, keyname, status);
+           strcpy(comm, "data are not scaled");
+           ffpkyg(fptr, keyname, 1., 0, comm, status);
+        }
+        else if (abs(datacode) == TUSHORT) 
         {
            /* Replace the 'U' with an 'I' in the TFORMn code */
            cptr = tfm;
@@ -647,7 +941,7 @@ int fficls(fitsfile *fptr,  /* I - FITS file pointer                        */
            strcpy(comm, "data are not scaled");
            ffpkyg(fptr, keyname, 1., 0, comm, status);
         }
-        else if (datacode == TULONG) 
+        else if (abs(datacode) == TULONG) 
         {
            /* Replace the 'V' with an 'J' in the TFORMn code */
            cptr = tfm;
@@ -688,7 +982,6 @@ int fficls(fitsfile *fptr,  /* I - FITS file pointer                        */
             firstcol += width + 1;  /*  add one space between the columns */
         }
     }
-
     ffrdef(fptr, status); /* initialize the new table structure */
     return(*status);
 }
@@ -768,7 +1061,7 @@ int ffmvec(fitsfile *fptr,  /* I - FITS file pointer                        */
       datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize;
       freespace = ( ( (datasize + 2879) / 2880) * 2880) - datasize;
 
-      nadd = (OFF_T)delbyte * naxis2;             /* no. of bytes to add to table */
+      nadd = (OFF_T)delbyte * naxis2;   /* no. of bytes to add to table */
 
       if ( (freespace - nadd) < 0)   /* not enough existing space? */
       {
@@ -787,14 +1080,14 @@ int ffmvec(fitsfile *fptr,  /* I - FITS file pointer                        */
 
         if (ffshft(fptr, firstbyte, nbytes, nadd, status) > 0) /* move heap */
             return(*status);
+      }
 
-        /* update the heap starting address */
-        (fptr->Fptr)->heapstart += nadd;
+      /* update the heap starting address */
+      (fptr->Fptr)->heapstart += nadd;
 
-        /* update the THEAP keyword if it exists */
-        tstatus = 0;
-        ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus);
-      }
+      /* update the THEAP keyword if it exists */
+      tstatus = 0;
+      ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus);
 
       firstcol = colptr->tbcol + (repeat * width);  /* insert position */
 
@@ -807,33 +1100,33 @@ int ffmvec(fitsfile *fptr,  /* I - FITS file pointer                        */
       size = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize;
       freespace = ((size + 2879) / 2880) * 2880 - size - ((OFF_T)delbyte * naxis2);
       nblock = freespace / 2880;   /* number of empty blocks to delete */
-      firstcol = colptr->tbcol + (repeat * width);  /* delete position */
+      firstcol = colptr->tbcol + (newveclen * width);  /* delete position */
 
       /* delete elements from the vector */
       ffcdel(fptr, naxis1, naxis2, -delbyte, firstcol, status);
  
+      /* abs heap pos */
+      firstbyte = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart;
+      ndelete = (OFF_T)delbyte * naxis2; /* size of shift (negative) */
+
       /* shift heap up (if it exists) */
       if ((fptr->Fptr)->heapsize > 0)
       {
         nbytes = (fptr->Fptr)->heapsize;    /* no. of bytes to shift up */
-        /* abs heap pos */
-        firstbyte = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart;
-        ndelete = (OFF_T)delbyte * naxis2; /* size of shift (negative) */
-
         if (ffshft(fptr, firstbyte, nbytes, ndelete, status) > 0)
           return(*status);
-
-        /* update the heap starting address */
-        (fptr->Fptr)->heapstart += ndelete;  /* ndelete is negative */
-
-        /* update the THEAP keyword if it exists */
-        tstatus = 0;
-        ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus);
       }
 
       /* delete the empty  blocks at the end of the HDU */
       if (nblock > 0)
         ffdblk(fptr, nblock, status);
+
+      /* update the heap starting address */
+      (fptr->Fptr)->heapstart += ndelete;  /* ndelete is negative */
+
+      /* update the THEAP keyword if it exists */
+      tstatus = 0;
+      ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus);
     }
 
     /* construct the new TFORM keyword for the column */
@@ -999,6 +1292,14 @@ int ffcpcl(fitsfile *infptr,    /* I - FITS file pointer to input file  */
         ffcpky(infptr, outfptr, incol, colnum, "TLMAX", status);
         ffcpky(infptr, outfptr, incol, colnum, "TDIM", status);
 
+        /*  WCS keywords */
+        ffcpky(infptr, outfptr, incol, colnum, "TCTYP", status);
+        ffcpky(infptr, outfptr, incol, colnum, "TCUNI", status);
+        ffcpky(infptr, outfptr, incol, colnum, "TCRVL", status);
+        ffcpky(infptr, outfptr, incol, colnum, "TCRPX", status);
+        ffcpky(infptr, outfptr, incol, colnum, "TCDLT", status);
+        ffcpky(infptr, outfptr, incol, colnum, "TCROT", status);
+
         if ((infptr->Fptr)->hdutype == ASCII_TBL && (outfptr->Fptr)->hdutype == BINARY_TBL)
         {
             /* binary tables only have TNULLn keyword for integer columns */
@@ -1319,30 +1620,30 @@ int ffdcol(fitsfile *fptr,  /* I - FITS file pointer                        */
 
     ffcdel(fptr, naxis1, naxis2, delbyte, firstcol, status); /* delete col */
 
+    /* absolute heap position */
+    firstbyte = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart;
+    ndelete = (OFF_T)delbyte * naxis2; /* size of shift */
+
     /* shift heap up (if it exists) */
     if ((fptr->Fptr)->heapsize > 0)
     {
       nbytes = (fptr->Fptr)->heapsize;    /* no. of bytes to shift up */
 
-      /* absolute heap pos */
-      firstbyte = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart;
-      ndelete = (OFF_T)delbyte * naxis2; /* size of shift */
-
       if (ffshft(fptr, firstbyte, nbytes, -ndelete, status) > 0) /* mv heap */
           return(*status);
-
-      /* update the heap starting address */
-      (fptr->Fptr)->heapstart -= ndelete;
-
-      /* update the THEAP keyword if it exists */
-      tstatus = 0;
-      ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus);
     }
 
     /* delete the empty  blocks at the end of the HDU */
     if (nblock > 0)
         ffdblk(fptr, nblock, status);
 
+    /* update the heap starting address */
+    (fptr->Fptr)->heapstart -= ndelete;
+
+    /* update the THEAP keyword if it exists */
+    tstatus = 0;
+    ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus);
+
     if ((fptr->Fptr)->hdutype == ASCII_TBL)
     {
       /* adjust the TBCOL values of the remaining columns */
@@ -1693,9 +1994,10 @@ int ffshft(fitsfile *fptr,  /* I - FITS file pointer                        */
     negative value shifts the block towards the beginning of the file.
 */
 {
+#define shftbuffsize 100000
     long ntomov;
     OFF_T ptr, ntodo;
-    char buffer[10000];
+    char buffer[shftbuffsize];
 
     if (*status > 0)
         return(*status);
@@ -1712,7 +2014,7 @@ int ffshft(fitsfile *fptr,  /* I - FITS file pointer                        */
     while (ntodo)
     {
         /* number of bytes to move at one time */
-        ntomov = minvalue(ntodo, 10000);
+        ntomov = minvalue(ntodo, shftbuffsize);
 
         if (nshift > 0)     /* if moving block down ... */
             ptr -= ntomov;
@@ -1736,9 +2038,9 @@ int ffshft(fitsfile *fptr,  /* I - FITS file pointer                        */
 
     /* now overwrite the old data with fill */
     if ((fptr->Fptr)->hdutype == ASCII_TBL)
-       memset(buffer, 32, 10000); /* fill ASCII tables with spaces */
+       memset(buffer, 32, shftbuffsize); /* fill ASCII tables with spaces */
     else
-       memset(buffer,  0, 10000); /* fill other HDUs with zeros */
+       memset(buffer,  0, shftbuffsize); /* fill other HDUs with zeros */
 
 
     if (nshift < 0)
@@ -1758,7 +2060,7 @@ int ffshft(fitsfile *fptr,  /* I - FITS file pointer                        */
 
     while (ntodo)
     {
-        ntomov = minvalue(ntodo, 10000);
+        ntomov = minvalue(ntodo, shftbuffsize);
         ffpbyt(fptr, ntomov, buffer, status);
         ntodo -= ntomov;
     }
diff --git a/edithdu.c b/edithdu.c
index 024a898..5baac07 100644
--- a/edithdu.c
+++ b/edithdu.c
@@ -35,6 +35,60 @@ int ffcopy(fitsfile *infptr,    /* I - FITS file pointer to input file  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffcpfl(fitsfile *infptr,    /* I - FITS file pointer to input file  */
+           fitsfile *outfptr,   /* I - FITS file pointer to output file */
+           int previous,        /* I - copy any previous HDUs?   */
+           int current,         /* I - copy the current HDU?     */
+           int following,       /* I - copy any following HDUs?   */
+           int *status)         /* IO - error status     */
+/*
+  copy all or part of the input file to the output file.
+*/
+{
+    int hdunum, ii;
+
+    if (*status > 0)
+        return(*status);
+
+    if (infptr == outfptr)
+        return(*status = SAME_FILE);
+
+    ffghdn(infptr, &hdunum);
+
+    if (previous) {   /* copy any previous HDUs */
+        for (ii=1; ii < hdunum; ii++) {
+            ffmahd(infptr, ii, NULL, status);
+            ffcopy(infptr, outfptr, 0, status);
+        }
+    }
+
+    if (current && (*status <= 0) ) {  /* copy current HDU */
+        ffmahd(infptr, hdunum, NULL, status);
+        ffcopy(infptr, outfptr, 0, status);
+    }
+
+    if (following && (*status <= 0) ) { /* copy any remaining HDUs */
+        ii = hdunum + 1;
+        while (1)
+        { 
+            if (ffmahd(infptr, ii, NULL, status) ) {
+                 /* reset expected end of file status */
+                 if (*status == END_OF_FILE)
+                    *status = 0;
+                 break;
+            }
+
+            if (ffcopy(infptr, outfptr, 0, status))
+                 break;  /* quit on unexpected error */
+
+            ii++;
+        }
+    }
+
+    ffmahd(infptr, hdunum, NULL, status);  /* restore initial position */
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffcphd(fitsfile *infptr,    /* I - FITS file pointer to input file  */
            fitsfile *outfptr,   /* I - FITS file pointer to output file */
            int *status)         /* IO - error status     */
@@ -107,7 +161,6 @@ int ffcphd(fitsfile *infptr,    /* I - FITS file pointer to input file  */
         free(tmpbuff);
         return(*status);
     }
-
     if ( inPrim == 1 && outPrim == 0 )
     {
         /* copying from primary array to image extension */
@@ -128,11 +181,13 @@ int ffcphd(fitsfile *infptr,    /* I - FITS file pointer to input file  */
         ffpkyj(outfptr, "GCOUNT", 1, comm, status);
 
 
-        /* copy remaining keywords, excluding EXTEND */
+        /* copy remaining keywords, excluding EXTEND, and reference COMMENT keywords */
         for (ii = 3 + naxis ; ii < nkeys; ii++)
         {
             card = tmpbuff+(ii * FLEN_CARD);
-            if (FSTRNCMP(card, "EXTEND  ", 8))
+            if (FSTRNCMP(card, "EXTEND  ", 8) &&
+                FSTRNCMP(card, "COMMENT   FITS (Flexible Image Transport System) format is", 58) && 
+                FSTRNCMP(card, "COMMENT   and Astrophysics', volume 376, page 3", 47) )
             {
                  ffprec(outfptr, card, status);
             }
@@ -155,6 +210,14 @@ int ffcphd(fitsfile *infptr,    /* I - FITS file pointer to input file  */
         strcpy(comm, "FITS dataset may contain extensions");
         ffpkyl(outfptr, "EXTEND", TRUE, comm, status);
 
+      /* write standard block of self-documentating comments */
+      ffprec(outfptr,
+      "COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy",
+      status);
+      ffprec(outfptr,
+      "COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H",
+      status);
+
         /* copy remaining keywords, excluding pcount, gcount */
         for (ii = 3 + naxis; ii < nkeys; ii++)
         {
@@ -205,7 +268,25 @@ int ffcpdt(fitsfile *infptr,    /* I - FITS file pointer to input file  */
 
     if (nb > 0)
     {
-        /* move the initial copy position in each of the files */
+      if (infptr->Fptr == outfptr->Fptr)
+      {
+        /* copying between 2 HDUs in the SAME file */
+        for (ii = 0; ii < nb; ii++)
+        {
+            ffmbyt(infptr,  indatastart,  REPORT_EOF, status);
+            ffgbyt(infptr,  2880L, buffer, status); /* read input block */
+
+            ffmbyt(outfptr, outdatastart, IGNORE_EOF, status);
+            ffpbyt(outfptr, 2880L, buffer, status); /* write output block */
+
+            indatastart  += 2880; /* move address */
+            outdatastart += 2880; /* move address */
+        }
+      }
+      else
+      {
+        /* copying between HDUs in separate files */
+        /* move to the initial copy position in each of the files */
         ffmbyt(infptr,  indatastart,  REPORT_EOF, status);
         ffmbyt(outfptr, outdatastart, IGNORE_EOF, status);
 
@@ -214,6 +295,7 @@ int ffcpdt(fitsfile *infptr,    /* I - FITS file pointer to input file  */
             ffgbyt(infptr,  2880L, buffer, status); /* read input block */
             ffpbyt(outfptr, 2880L, buffer, status); /* write output block */
         }
+      }
     }
     return(*status);
 }
@@ -227,10 +309,10 @@ int ffiimg(fitsfile *fptr,      /* I - FITS file pointer           */
   insert an IMAGE extension following the current HDU 
 */
 {
-    int bytlen, nexthdu, maxhdu, ii;
+    int bytlen, nexthdu, maxhdu, ii, onaxis;
     long nblocks;
     OFF_T npixels, newstart, datasize;
-    char errmsg[81];
+    char errmsg[FLEN_ERRMSG], card[FLEN_CARD], naxiskey[FLEN_KEYWORD];
 
     if (*status > 0)
         return(*status);
@@ -240,15 +322,18 @@ int ffiimg(fitsfile *fptr,      /* I - FITS file pointer           */
 
     maxhdu = (fptr->Fptr)->maxhdu;
 
-    /* if the current header is completely empty ...  */
-    if (( (fptr->Fptr)->headend == (fptr->Fptr)->headstart[(fptr->Fptr)->curhdu] )
+    if (*status != PREPEND_PRIMARY)
+    {
+      /* if the current header is completely empty ...  */
+      if (( (fptr->Fptr)->headend == (fptr->Fptr)->headstart[(fptr->Fptr)->curhdu])
         /* or, if we are at the end of the file, ... */
-    ||  ( (((fptr->Fptr)->curhdu) == maxhdu ) &&
+      ||  ( (((fptr->Fptr)->curhdu) == maxhdu ) &&
        ((fptr->Fptr)->headstart[maxhdu + 1] >= (fptr->Fptr)->logfilesize ) ) )
-    {
+      {
         /* then simply append new image extension */
         ffcrim(fptr, bitpix, naxis, naxes, status);
         return(*status);
+      }
     }
 
     if (bitpix == 8)
@@ -305,18 +390,60 @@ int ffiimg(fitsfile *fptr,      /* I - FITS file pointer           */
     else
         return(*status = READONLY_FILE);
 
-    nexthdu = ((fptr->Fptr)->curhdu) + 1; /* number of the next (new) hdu */
-    newstart = (fptr->Fptr)->headstart[nexthdu]; /* save starting addr of HDU */
+    if (*status == PREPEND_PRIMARY)
+    {
+        /* inserting a new primary array; the current primary */
+        /* array must be transformed into an image extension. */
 
-    (fptr->Fptr)->hdutype = IMAGE_HDU;  /* so that correct fill value is used */
-    /* ffiblk also increments headstart for all following HDUs */
-    if (ffiblk(fptr, nblocks, 1, status) > 0)  /* insert the blocks */
-        return(*status);
+        *status = 0;   
+        ffmahd(fptr, 1, NULL, status);  /* move to the primary array */
+
+        ffgidm(fptr, &onaxis, status);
+        if (onaxis > 0)
+            ffkeyn("NAXIS",onaxis, naxiskey, status);
+        else
+            strcpy(naxiskey, "NAXIS");
+
+        ffgcrd(fptr, naxiskey, card, status);  /* read last NAXIS keyword */
+        
+        ffikyj(fptr, "PCOUNT", 0L, "required keyword", status); /* add PCOUNT and */
+        ffikyj(fptr, "GCOUNT", 1L, "required keyword", status); /* GCOUNT keywords */
+
+        if (*status > 0)
+            return(*status);
+
+        if (ffdkey(fptr, "EXTEND", status) ) /* delete the EXTEND keyword */
+            *status = 0;
+
+        /* redefine internal structure for this HDU */
+        ffrdef(fptr, status);
+
+
+        /* insert space for the primary array */
+        if (ffiblk(fptr, nblocks, -1, status) > 0)  /* insert the blocks */
+            return(*status);
+
+        nexthdu = 0;  /* number of the new hdu */
+        newstart = 0; /* starting addr of HDU */
+    }
+    else
+    {
+        nexthdu = ((fptr->Fptr)->curhdu) + 1; /* number of the next (new) hdu */
+        newstart = (fptr->Fptr)->headstart[nexthdu]; /* save starting addr of HDU */
+
+        (fptr->Fptr)->hdutype = IMAGE_HDU;  /* so that correct fill value is used */
+        /* ffiblk also increments headstart for all following HDUs */
+        if (ffiblk(fptr, nblocks, 1, status) > 0)  /* insert the blocks */
+            return(*status);
+    }
 
     ((fptr->Fptr)->maxhdu)++;      /* increment known number of HDUs in the file */
     for (ii = (fptr->Fptr)->maxhdu; ii > (fptr->Fptr)->curhdu; ii--)
         (fptr->Fptr)->headstart[ii + 1] = (fptr->Fptr)->headstart[ii]; /* incre start addr */
 
+    if (nexthdu == 0)
+       (fptr->Fptr)->headstart[1] = nblocks * 2880; /* start of the old Primary array */
+
     (fptr->Fptr)->headstart[nexthdu] = newstart; /* set starting addr of HDU */
 
     /* set default parameters for this new empty HDU */
@@ -332,7 +459,6 @@ int ffiimg(fitsfile *fptr,      /* I - FITS file pointer           */
 
     /* redefine internal structure for this HDU */
     ffrdef(fptr, status);
-
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -607,17 +733,16 @@ int ffdhdu(fitsfile *fptr,      /* I - FITS file pointer                   */
     if (fptr->HDUposition != (fptr->Fptr)->curhdu)
         ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
 
-    if ((fptr->Fptr)->curhdu == 0)
+    if ((fptr->Fptr)->curhdu == 0) /* replace primary array with null image */
     {
         /* ignore any existing keywords */
         (fptr->Fptr)->headend = 0;
         (fptr->Fptr)->nextkey = 0;
-        (fptr->Fptr)->datastart = DATA_UNDEFINED;
 
         /* write default primary array header */
         ffphpr(fptr,1,8,0,naxes,0,1,1,status);
 
-        /* calc number of blocks to delete */
+        /* calc number of blocks to delete (leave just 1 block) */
         nblocks = ( (fptr->Fptr)->headstart[(fptr->Fptr)->curhdu + 1] - 
                 2880 ) / 2880;
 
@@ -628,6 +753,9 @@ int ffdhdu(fitsfile *fptr,      /* I - FITS file pointer                   */
                 return(*status);
         }
 
+        /* this might not be necessary, but is doesn't hurt */
+        (fptr->Fptr)->datastart = DATA_UNDEFINED;
+
         ffrdef(fptr, status);  /* reinitialize the primary array */
     }
     else
diff --git a/eval.y b/eval.y
index e266208..25b6e57 100644
--- a/eval.y
+++ b/eval.y
@@ -46,6 +46,14 @@
 /*   Peter D Wilson   Aug 1998  regfilter(a,b,c,d) function added       */
 /*   Peter D Wilson   Jul 1999  Make parser fitsfile-independent,       */
 /*                              allowing a purely vector-based usage    */
+/*  Craig B Markwardt Jun 2004  Add MEDIAN() function                   */
+/*  Craig B Markwardt Jun 2004  Add SUM(), and MIN/MAX() for bit arrays */
+/*  Craig B Markwardt Jun 2004  Allow subscripting of nX bit arrays     */
+/*  Craig B Markwardt Jun 2004  Implement statistical functions         */
+/*                              NVALID(), AVERAGE(), and STDDEV()       */
+/*                              for integer and floating point vectors  */
+/*  Craig B Markwardt Jun 2004  Use NULL values for range errors instead*/
+/*                              of throwing a parse error               */
 /*                                                                      */
 /************************************************************************/
 
@@ -55,7 +63,10 @@
 #include <time.h>
 
 #include <stdlib.h>
+
+#ifndef alloca
 #define alloca malloc
+#endif
 
    /*  Shrink the initial stack depth to keep local data <32K (mac limit)  */
    /*  yacc will allocate more space if needed, though.                    */
@@ -329,6 +340,16 @@ bits:	 BITSTR
        | bits '+' bits
                 { $$ = New_BinOp( BITSTR, $1, '+', $3 ); TEST($$);
                   SIZE($$) = SIZE($1) + SIZE($3);                          }
+       | bits '[' expr ']'
+                { $$ = New_Deref( $1, 1, $3,  0,  0,  0,   0 ); TEST($$); }
+       | bits '[' expr ',' expr ']'
+                { $$ = New_Deref( $1, 2, $3, $5,  0,  0,   0 ); TEST($$); }
+       | bits '[' expr ',' expr ',' expr ']'
+                { $$ = New_Deref( $1, 3, $3, $5, $7,  0,   0 ); TEST($$); }
+       | bits '[' expr ',' expr ',' expr ',' expr ']'
+                { $$ = New_Deref( $1, 4, $3, $5, $7, $9,   0 ); TEST($$); }
+       | bits '[' expr ',' expr ',' expr ',' expr ',' expr ']'
+                { $$ = New_Deref( $1, 5, $3, $5, $7, $9, $11 ); TEST($$); }
        | NOT bits
                 { $$ = New_Unary( BITSTR, NOT, $2 ); TEST($$);     }
 
@@ -468,6 +489,9 @@ expr:    LONG
        | FUNCTION sexpr ')'
                 { if (FSTRCMP($1,"NELEM(") == 0) {
                      $$ = New_Const( LONG, &( SIZE($2) ), sizeof(long) );
+		  } else if (FSTRCMP($1,"NVALID(") == 0) {
+		     $$ = New_Func( LONG, nonnull_fct, 1, $2,
+				    0, 0, 0, 0, 0, 0 );
 		  } else {
                      yyerror("Function(str) not supported");
 		     YYERROR;
@@ -477,7 +501,20 @@ expr:    LONG
        | FUNCTION bits ')'
                 { if (FSTRCMP($1,"NELEM(") == 0) {
                      $$ = New_Const( LONG, &( SIZE($2) ), sizeof(long) );
-		  } else {
+		} else if (FSTRCMP($1,"NVALID(") == 0) { /* Bit arrays do not have NULL */
+                     $$ = New_Const( LONG, &( SIZE($2) ), sizeof(long) );
+		} else if (FSTRCMP($1,"SUM(") == 0) {
+		     $$ = New_Func( LONG, sum_fct, 1, $2,
+				    0, 0, 0, 0, 0, 0 );
+		} else if (FSTRCMP($1,"MIN(") == 0) {
+		     $$ = New_Func( TYPE($2),  /* Force 1D result */
+				    min1_fct, 1, $2, 0, 0, 0, 0, 0, 0 );
+		     SIZE($$) = 1;
+		} else if (FSTRCMP($1,"MAX(") == 0) {
+		     $$ = New_Func( TYPE($2),  /* Force 1D result */
+				    max1_fct, 1, $2, 0, 0, 0, 0, 0, 0 );
+		     SIZE($$) = 1;
+		} else {
                      yyerror("Function(bits) not supported");
 		     YYERROR;
 		  }
@@ -487,8 +524,20 @@ expr:    LONG
                 { if (FSTRCMP($1,"SUM(") == 0)
 		     $$ = New_Func( TYPE($2), sum_fct, 1, $2,
 				    0, 0, 0, 0, 0, 0 );
+		  else if (FSTRCMP($1,"AVERAGE(") == 0)
+		     $$ = New_Func( DOUBLE, average_fct, 1, $2,
+				    0, 0, 0, 0, 0, 0 );
+		  else if (FSTRCMP($1,"STDDEV(") == 0)
+		     $$ = New_Func( DOUBLE, stddev_fct, 1, $2,
+				    0, 0, 0, 0, 0, 0 );
+		  else if (FSTRCMP($1,"MEDIAN(") == 0)
+		     $$ = New_Func( TYPE($2), median_fct, 1, $2,
+				    0, 0, 0, 0, 0, 0 );
 		  else if (FSTRCMP($1,"NELEM(") == 0)
                      $$ = New_Const( LONG, &( SIZE($2) ), sizeof(long) );
+		  else if (FSTRCMP($1,"NVALID(") == 0)
+		     $$ = New_Func( LONG, nonnull_fct, 1, $2,
+				    0, 0, 0, 0, 0, 0 );
 		  else if (FSTRCMP($1,"ABS(") == 0)
 		     $$ = New_Func( 0, abs_fct, 1, $2, 0, 0, 0, 0, 0, 0 );
  		  else if (FSTRCMP($1,"MIN(") == 0)
@@ -2566,15 +2615,15 @@ static void Do_BinOp_lng( Node *this )
 	    case '%':   
 	       if( val2 ) this->value.data.lngptr[elem] = (val1 % val2);
 	       else {
-		  yyerror("Divide by Zero");
-		  free( this->value.data.ptr );
+		 this->value.data.lngptr[elem] = 0;
+		 this->value.undef[elem] = 1;
 	       }
 	       break;
 	    case '/': 
 	       if( val2 ) this->value.data.lngptr[elem] = (val1 / val2); 
 	       else {
-		  yyerror("Divide by Zero");
-		  free( this->value.data.ptr );
+		 this->value.data.lngptr[elem] = 0;
+		 this->value.undef[elem] = 1;
 	       }
 	       break;
 	    case POWER:
@@ -2695,15 +2744,15 @@ static void Do_BinOp_dbl( Node *this )
 	       if( val2 ) this->value.data.dblptr[elem] =
                                 val1 - val2*((int)(val1/val2));
 	       else {
-		  yyerror("Divide by Zero");
-		  free( this->value.data.ptr );
+		 this->value.data.dblptr[elem] = 0.0;
+		 this->value.undef[elem] = 1;
 	       }
 	       break;
 	    case '/': 
 	       if( val2 ) this->value.data.dblptr[elem] = (val1 / val2); 
 	       else {
-		  yyerror("Divide by Zero");
-		  free( this->value.data.ptr );
+		 this->value.data.dblptr[elem] = 0.0;
+		 this->value.undef[elem] = 1;
 	       }
 	       break;
 	    case POWER:
@@ -2723,6 +2772,157 @@ static void Do_BinOp_dbl( Node *this )
    }
 }
 
+/*
+ *  This Quickselect routine is based on the algorithm described in
+ *  "Numerical recipes in C", Second Edition,
+ *  Cambridge University Press, 1992, Section 8.5, ISBN 0-521-43108-5
+ *  This code by Nicolas Devillard - 1998. Public domain.
+ * http://ndevilla.free.fr/median/median/src/quickselect.c
+ */
+
+#define ELEM_SWAP(a,b) { register long t=(a);(a)=(b);(b)=t; }
+
+/* 
+ * qselect_median_lng - select the median value of a long array
+ *
+ * This routine selects the median value of the long integer array
+ * arr[].  If there are an even number of elements, the "lower median"
+ * is selected.
+ *
+ * The array arr[] is scrambled, so users must operate on a scratch
+ * array if they wish the values to be preserved.
+ *
+ * long arr[] - array of values
+ * int n - number of elements in arr
+ *
+ * RETURNS: the lower median value of arr[]
+ *
+ */
+long qselect_median_lng(long arr[], int n)
+{
+    int low, high ;
+    int median;
+    int middle, ll, hh;
+
+    low = 0 ; high = n-1 ; median = (low + high) / 2;
+    for (;;) {
+
+        if (high <= low) { /* One element only */
+	  return arr[median];	  
+	}
+
+        if (high == low + 1) {  /* Two elements only */
+            if (arr[low] > arr[high])
+                ELEM_SWAP(arr[low], arr[high]) ;
+	    return arr[median];
+        }
+
+    /* Find median of low, middle and high items; swap into position low */
+    middle = (low + high) / 2;
+    if (arr[middle] > arr[high])    ELEM_SWAP(arr[middle], arr[high]) ;
+    if (arr[low] > arr[high])       ELEM_SWAP(arr[low], arr[high]) ;
+    if (arr[middle] > arr[low])     ELEM_SWAP(arr[middle], arr[low]) ;
+
+    /* Swap low item (now in position middle) into position (low+1) */
+    ELEM_SWAP(arr[middle], arr[low+1]) ;
+
+    /* Nibble from each end towards middle, swapping items when stuck */
+    ll = low + 1;
+    hh = high;
+    for (;;) {
+        do ll++; while (arr[low] > arr[ll]) ;
+        do hh--; while (arr[hh]  > arr[low]) ;
+
+        if (hh < ll)
+        break;
+
+        ELEM_SWAP(arr[ll], arr[hh]) ;
+    }
+
+    /* Swap middle item (in position low) back into correct position */
+    ELEM_SWAP(arr[low], arr[hh]) ;
+
+    /* Re-set active partition */
+    if (hh <= median)
+        low = ll;
+        if (hh >= median)
+        high = hh - 1;
+    }
+}
+
+#undef ELEM_SWAP
+
+#define ELEM_SWAP(a,b) { register double t=(a);(a)=(b);(b)=t; }
+
+/* 
+ * qselect_median_dbl - select the median value of a double array
+ *
+ * This routine selects the median value of the double array
+ * arr[].  If there are an even number of elements, the "lower median"
+ * is selected.
+ *
+ * The array arr[] is scrambled, so users must operate on a scratch
+ * array if they wish the values to be preserved.
+ *
+ * double arr[] - array of values
+ * int n - number of elements in arr
+ *
+ * RETURNS: the lower median value of arr[]
+ *
+ */
+double qselect_median_dbl(double arr[], int n)
+{
+    int low, high ;
+    int median;
+    int middle, ll, hh;
+
+    low = 0 ; high = n-1 ; median = (low + high) / 2;
+    for (;;) {
+        if (high <= low) { /* One element only */
+            return arr[median] ;
+	}
+
+        if (high == low + 1) {  /* Two elements only */
+            if (arr[low] > arr[high])
+                ELEM_SWAP(arr[low], arr[high]) ;
+            return arr[median] ;
+        }
+
+    /* Find median of low, middle and high items; swap into position low */
+    middle = (low + high) / 2;
+    if (arr[middle] > arr[high])    ELEM_SWAP(arr[middle], arr[high]) ;
+    if (arr[low] > arr[high])       ELEM_SWAP(arr[low], arr[high]) ;
+    if (arr[middle] > arr[low])     ELEM_SWAP(arr[middle], arr[low]) ;
+
+    /* Swap low item (now in position middle) into position (low+1) */
+    ELEM_SWAP(arr[middle], arr[low+1]) ;
+
+    /* Nibble from each end towards middle, swapping items when stuck */
+    ll = low + 1;
+    hh = high;
+    for (;;) {
+        do ll++; while (arr[low] > arr[ll]) ;
+        do hh--; while (arr[hh]  > arr[low]) ;
+
+        if (hh < ll)
+        break;
+
+        ELEM_SWAP(arr[ll], arr[hh]) ;
+    }
+
+    /* Swap middle item (in position low) back into correct position */
+    ELEM_SWAP(arr[low], arr[hh]) ;
+
+    /* Re-set active partition */
+    if (hh <= median)
+        low = ll;
+        if (hh >= median)
+        high = hh - 1;
+    }
+}
+
+#undef ELEM_SWAP
+
 static void Do_Func( Node *this )
 {
    Node *theParams[MAXSUBS];
@@ -2765,6 +2965,25 @@ static void Do_Func( Node *this )
 	    /* Non-Trig single-argument functions */
 
 	 case sum_fct:
+	    if( theParams[0]->type==BOOLEAN )
+	       this->value.data.lng = ( pVals[0].data.log ? 1 : 0 );
+	    else if( theParams[0]->type==LONG )
+	       this->value.data.lng = pVals[0].data.lng;
+	    else if( theParams[0]->type==DOUBLE )
+	       this->value.data.dbl = pVals[0].data.dbl;
+	    else if( theParams[0]->type==BITSTR )
+	      strcpy(this->value.data.str, pVals[0].data.str);
+	    break;
+         case average_fct:
+	    if( theParams[0]->type==LONG )
+	       this->value.data.dbl = pVals[0].data.lng;
+	    else if( theParams[0]->type==DOUBLE )
+	       this->value.data.dbl = pVals[0].data.dbl;
+	    break;
+         case stddev_fct:
+	    this->value.data.dbl = 0;  /* Standard deviation of a constant = 0 */
+	    break;
+	 case median_fct:
 	    if( theParams[0]->type==BOOLEAN )
 	       this->value.data.lng = ( pVals[0].data.log ? 1 : 0 );
 	    else if( theParams[0]->type==LONG )
@@ -2784,6 +3003,9 @@ static void Do_Func( Node *this )
 
             /* Special Null-Handling Functions */
 
+         case nonnull_fct:
+	    this->value.data.lng = 1; /* Constants are always 1-element and defined */
+	    break;
          case isnull_fct:  /* Constants are always defined */
 	    this->value.data.log = 0;
 	    break;
@@ -2884,6 +3106,8 @@ static void Do_Func( Node *this )
 	       this->value.data.dbl = pVals[0].data.dbl;
 	    else if( this->type == LONG )
 	       this->value.data.lng = pVals[0].data.lng;
+	    else if( this->type == BITSTR )
+	      strcpy(this->value.data.str, pVals[0].data.str);
 	    break;
          case min2_fct:
 	    if( this->type == DOUBLE )
@@ -2899,6 +3123,8 @@ static void Do_Func( Node *this )
 	       this->value.data.dbl = pVals[0].data.dbl;
 	    else if( this->type == LONG )
 	       this->value.data.lng = pVals[0].data.lng;
+	    else if( this->type == BITSTR )
+	      strcpy(this->value.data.str, pVals[0].data.str);
 	    break;
          case max2_fct:
 	    if( this->type == DOUBLE )
@@ -3012,42 +3238,266 @@ static void Do_Func( Node *this )
 	    if( theParams[0]->type==BOOLEAN ) {
 	       while( row-- ) {
 		  this->value.data.lngptr[row] = 0;
-		  this->value.undef[row] = 0;
+		  /* Default is UNDEF until a defined value is found */
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     this->value.data.lngptr[row] +=
-			( theParams[0]->value.data.logptr[elem] ? 1 : 0 );
-		     this->value.undef[row] |=
-			  theParams[0]->value.undef[elem];
+		     if ( ! theParams[0]->value.undef[elem] ) {
+		       this->value.data.lngptr[row] +=
+			 ( theParams[0]->value.data.logptr[elem] ? 1 : 0 );
+		       this->value.undef[row] = 0;
+		     }
 		  }
-	       }		  
+	       }
 	    } else if( theParams[0]->type==LONG ) {
 	       while( row-- ) {
 		  this->value.data.lngptr[row] = 0;
-		  this->value.undef[row] = 0;
+		  /* Default is UNDEF until a defined value is found */
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     this->value.data.lngptr[row] +=
-			theParams[0]->value.data.lngptr[elem];
-		     this->value.undef[row] |=
-			  theParams[0]->value.undef[elem];
+		     if ( ! theParams[0]->value.undef[elem] ) {
+		       this->value.data.lngptr[row] +=
+			 theParams[0]->value.data.lngptr[elem];
+		       this->value.undef[row] = 0;
+		     }
 		  }
 	       }		  
-	    } else {
+	    } else if( theParams[0]->type==DOUBLE ){
 	       while( row-- ) {
 		  this->value.data.dblptr[row] = 0.0;
+		  /* Default is UNDEF until a defined value is found */
+		  this->value.undef[row] = 1;
+		  nelem = theParams[0]->value.nelem;
+		  while( nelem-- ) {
+		     elem--;
+		     if ( ! theParams[0]->value.undef[elem] ) {
+		       this->value.data.dblptr[row] +=
+			 theParams[0]->value.data.dblptr[elem];
+		       this->value.undef[row] = 0;
+		     }
+		  }
+	       }		  
+	    } else { /* BITSTR */
+	       nelem = theParams[0]->value.nelem;
+	       while( row-- ) {
+		  char *sptr1 = theParams[0]->value.data.strptr[row];
+		  this->value.data.lngptr[row] = 0;
 		  this->value.undef[row] = 0;
+		  while (*sptr1) {
+		    if (*sptr1 == '1') this->value.data.lngptr[row] ++;
+		    sptr1++;
+		  }
+	       }		  
+	    }
+	    break;
+
+	 case average_fct:
+	    elem = row * theParams[0]->value.nelem;
+	    if( theParams[0]->type==LONG ) {
+	       while( row-- ) {
+		  int count = 0;
+		  this->value.data.dblptr[row] = 0;
+		  nelem = theParams[0]->value.nelem;
+		  while( nelem-- ) {
+		     elem--;
+		     if (theParams[0]->value.undef[elem] == 0) {
+		       this->value.data.dblptr[row] +=
+			 theParams[0]->value.data.lngptr[elem];
+		       count ++;
+		     }
+		  }
+		  if (count == 0) {
+		    this->value.undef[row] = 1;
+		  } else {
+		    this->value.undef[row] = 0;
+		    this->value.data.dblptr[row] /= count;
+		  }
+	       }		  
+	    } else if( theParams[0]->type==DOUBLE ){
+	       while( row-- ) {
+		  int count = 0;
+		  this->value.data.dblptr[row] = 0;
+		  nelem = theParams[0]->value.nelem;
+		  while( nelem-- ) {
+		     elem--;
+		     if (theParams[0]->value.undef[elem] == 0) {
+		       this->value.data.dblptr[row] +=
+			 theParams[0]->value.data.dblptr[elem];
+		       count ++;
+		     }
+		  }
+		  if (count == 0) {
+		    this->value.undef[row] = 1;
+		  } else {
+		    this->value.undef[row] = 0;
+		    this->value.data.dblptr[row] /= count;
+		  }
+	       }		  
+	    }
+	    break;
+	 case stddev_fct:
+	    elem = row * theParams[0]->value.nelem;
+	    if( theParams[0]->type==LONG ) {
+
+	       /* Compute the mean value */
+	       while( row-- ) {
+		  int count = 0;
+		  double sum = 0, sum2 = 0;
+
+		  nelem = theParams[0]->value.nelem;
+		  while( nelem-- ) {
+		     elem--;
+		     if (theParams[0]->value.undef[elem] == 0) {
+		       sum += theParams[0]->value.data.lngptr[elem];
+		       count ++;
+		     }
+		  }
+		  if (count > 1) {
+		    sum /= count;
+
+		    /* Compute the sum of squared deviations */
+		    nelem = theParams[0]->value.nelem;
+		    elem += nelem;  /* Reset elem for second pass */
+		    while( nelem-- ) {
+		      elem--;
+		      if (theParams[0]->value.undef[elem] == 0) {
+			double dx = (theParams[0]->value.data.lngptr[elem] - sum);
+			sum2 += (dx*dx);
+		      }
+		    }
+
+		    sum2 /= (double)count-1;
+
+		    this->value.undef[row] = 0;
+		    this->value.data.dblptr[row] = sqrt(sum2);
+		  } else {
+		    this->value.undef[row] = 0;       /* STDDEV => 0 */
+		    this->value.data.dblptr[row] = 0;
+		  }
+	       }
+	    } else if( theParams[0]->type==DOUBLE ){
+
+	       /* Compute the mean value */
+	       while( row-- ) {
+		  int count = 0;
+		  double sum = 0, sum2 = 0;
+
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     this->value.data.dblptr[row] +=
-			theParams[0]->value.data.dblptr[elem];
-		     this->value.undef[row] |=
-			  theParams[0]->value.undef[elem];
+		     if (theParams[0]->value.undef[elem] == 0) {
+		       sum += theParams[0]->value.data.dblptr[elem];
+		       count ++;
+		     }
+		  }
+		  if (count > 1) {
+		    sum /= count;
+
+		    /* Compute the sum of squared deviations */
+		    nelem = theParams[0]->value.nelem;
+		    elem += nelem;  /* Reset elem for second pass */
+		    while( nelem-- ) {
+		      elem--;
+		      if (theParams[0]->value.undef[elem] == 0) {
+			double dx = (theParams[0]->value.data.dblptr[elem] - sum);
+			sum2 += (dx*dx);
+		      }
+		    }
+
+		    sum2 /= (double)count-1;
+
+		    this->value.undef[row] = 0;
+		    this->value.data.dblptr[row] = sqrt(sum2);
+		  } else {
+		    this->value.undef[row] = 0;       /* STDDEV => 0 */
+		    this->value.data.dblptr[row] = 0;
 		  }
+	       }
+	    }
+	    break;
+
+	 case median_fct:
+	   elem = row * theParams[0]->value.nelem;
+	   nelem = theParams[0]->value.nelem;
+	   if( theParams[0]->type==LONG ) {
+	       long *dptr = theParams[0]->value.data.lngptr;
+	       char *uptr = theParams[0]->value.undef;
+	       long *mptr = (long *) malloc(sizeof(long)*nelem);
+	       int irow;
+
+	       /* Allocate temporary storage for this row, since the
+                  quickselect function will scramble the contents */
+	       if (mptr == 0) {
+		 yyerror("Could not allocate temporary memory in median function");
+		 free( this->value.data.ptr );
+		 break;
+	       }
+
+	       for (irow=0; irow<row; irow++) {
+		  long *p = mptr;
+		  int nelem1 = nelem;
+		  int count = 0;
+
+		  while ( nelem1-- ) { 
+		    if (*uptr == 0) {
+		      *p++ = *dptr;   /* Only advance the dest pointer if we copied */
+		    }
+		    dptr ++;  /* Advance the source pointer ... */
+		    uptr ++;  /* ... and source "undef" pointer */
+		  }
+		  
+		  nelem1 = (p - mptr);  /* Number of accepted data points */
+		  if (nelem1 > 0) {
+		    this->value.undef[irow] = 0;
+		    this->value.data.lngptr[irow] = qselect_median_lng(mptr, nelem1);
+		  } else {
+		    this->value.undef[irow] = 1;
+		    this->value.data.lngptr[irow] = 0;
+		  }
+		    
 	       }		  
+
+	       free(mptr);
+	    } else {
+	       double *dptr = theParams[0]->value.data.dblptr;
+	       char   *uptr = theParams[0]->value.undef;
+	       double *mptr = (double *) malloc(sizeof(double)*nelem);
+	       int irow;
+
+	       /* Allocate temporary storage for this row, since the
+                  quickselect function will scramble the contents */
+	       if (mptr == 0) {
+		 yyerror("Could not allocate temporary memory in median function");
+		 free( this->value.data.ptr );
+		 break;
+	       }
+
+	       for (irow=0; irow<row; irow++) {
+		  double *p = mptr;
+		  int nelem1 = nelem;
+
+		  while ( nelem1-- ) { 
+		    if (*uptr == 0) {
+		      *p++ = *dptr;   /* Only advance the dest pointer if we copied */
+		    }
+		    dptr ++;  /* Advance the source pointer ... */
+		    uptr ++;  /* ... and source "undef" pointer */
+		  }
+
+		  nelem1 = (p - mptr);  /* Number of accepted data points */
+		  if (nelem1 > 0) {
+		    this->value.undef[irow] = 0;
+		    this->value.data.dblptr[irow] = qselect_median_dbl(mptr, nelem1);
+		  } else {
+		    this->value.undef[irow] = 1;
+		    this->value.data.dblptr[irow] = 0;
+		  }
+
+	       }
+	       free(mptr);
 	    }
 	    break;
 	 case abs_fct:
@@ -3067,6 +3517,21 @@ static void Do_Func( Node *this )
 
             /* Special Null-Handling Functions */
 
+	 case nonnull_fct:
+	   nelem = theParams[0]->value.nelem;
+	   if ( theParams[0]->type==STRING ) nelem = 1;
+	   elem = row * nelem;
+	   while( row-- ) {
+	     int nelem1 = nelem;
+
+	     this->value.undef[row] = 0;        /* Initialize to 0 (defined) */
+	     this->value.data.lngptr[row] = 0;
+	     while( nelem1-- ) {	
+	       elem --;
+	       if ( theParams[0]->value.undef[elem] == 0 ) this->value.data.lngptr[row] ++;
+	     }
+	   }
+	   break;
 	 case isnull_fct:
 	    if( theParams[0]->type==STRING ) elem = row;
 	    while( elem-- ) {
@@ -3198,9 +3663,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<-1.0 || dval>1.0 ) {
-		     yyerror("Out of range argument to arcsin");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = asin( dval );
 	       }
@@ -3210,9 +3674,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<-1.0 || dval>1.0 ) {
-		     yyerror("Out of range argument to arccos");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = acos( dval );
 	       }
@@ -3257,9 +3720,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<=0.0 ) {
-		     yyerror("Out of range argument to log");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = log( dval );
 	       }
@@ -3269,9 +3731,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<=0.0 ) {
-		     yyerror("Out of range argument to log10");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = log10( dval );
 	       }
@@ -3281,9 +3742,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<0.0 ) {
-		     yyerror("Out of range argument to sqrt");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = sqrt( dval );
 	       }
@@ -3342,42 +3802,56 @@ static void Do_Func( Node *this )
 	       long minVal=0;
 	       while( row-- ) {
 		  valInit = 1;
-		  this->value.undef[row] = 0;
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     if( valInit && !theParams[0]->value.undef[elem] ) {
-			valInit = 0;
-			minVal  = theParams[0]->value.data.lngptr[elem];
-		     } else {
-			minVal  = minvalue( minVal,
-					    theParams[0]->value.data.lngptr[elem] );
+		     if ( !theParams[0]->value.undef[elem] ) {
+		       if ( valInit ) {
+			 valInit = 0;
+			 minVal  = theParams[0]->value.data.lngptr[elem];
+		       } else {
+			 minVal  = minvalue( minVal,
+					     theParams[0]->value.data.lngptr[elem] );
+		       }
+		       this->value.undef[row] = 0;
 		     }
-		     this->value.undef[row] |=
-			theParams[0]->value.undef[elem];
-		  }
+		  }  
 		  this->value.data.lngptr[row] = minVal;
 	       }		  
 	    } else if( this->type==DOUBLE ) {
 	       double minVal=0.0;
 	       while( row-- ) {
 		  valInit = 1;
-		  this->value.undef[row] = 0;
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     if( valInit && !theParams[0]->value.undef[elem] ) {
-			valInit = 0;
-			minVal  = theParams[0]->value.data.dblptr[elem];
-		     } else {
-			minVal  = minvalue( minVal,
-					    theParams[0]->value.data.dblptr[elem] );
+		     if ( !theParams[0]->value.undef[elem] ) {
+		       if ( valInit ) {
+			 valInit = 0;
+			 minVal  = theParams[0]->value.data.dblptr[elem];
+		       } else {
+			 minVal  = minvalue( minVal,
+					     theParams[0]->value.data.dblptr[elem] );
+		       }
+		       this->value.undef[row] = 0;
 		     }
-		     this->value.undef[row] |=
-			theParams[0]->value.undef[elem];
-		  }
+		  }  
 		  this->value.data.dblptr[row] = minVal;
 	       }		  
+	    } else if( this->type==BITSTR ) {
+	       char minVal;
+	       while( row-- ) {
+		  char *sptr1 = theParams[0]->value.data.strptr[row];
+		  minVal = '1';
+		  while (*sptr1) {
+		    if (*sptr1 == '0') minVal = '0';
+		    sptr1++;
+		  }
+		  this->value.data.strptr[row][0] = minVal;
+		  this->value.data.strptr[row][1] = 0;     /* Null terminate */
+	       }		  
 	    }
 	    break;
          case min2_fct:
@@ -3396,9 +3870,20 @@ static void Do_Func( Node *this )
 			      theParams[i]->value.data.lngptr[row];
 			   pNull[i] = theParams[i]->value.undef[row];
 			}
-		     if( !(this->value.undef[elem] = (pNull[0] || pNull[1]) ) )
-			this->value.data.lngptr[elem] =
-			   minvalue( pVals[0].data.lng, pVals[1].data.lng );
+		     if( pNull[0] && pNull[1] ) {
+		       this->value.undef[elem] = 1;
+		       this->value.data.lngptr[elem] = 0;
+		     } else if (pNull[0]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] = pVals[1].data.lng;
+		     } else if (pNull[1]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] = pVals[0].data.lng;
+		     } else {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] =
+			 minvalue( pVals[0].data.lng, pVals[1].data.lng );
+		     }
 		  }
 	       }
 	    } else if( this->type==DOUBLE ) {
@@ -3416,11 +3901,22 @@ static void Do_Func( Node *this )
 			      theParams[i]->value.data.dblptr[row];
 			   pNull[i] = theParams[i]->value.undef[row];
 			}
-		     if( !(this->value.undef[elem] = (pNull[0] || pNull[1]) ) )
-			this->value.data.dblptr[elem] =
-			   minvalue( pVals[0].data.dbl, pVals[1].data.dbl );
+		     if( pNull[0] && pNull[1] ) {
+		       this->value.undef[elem] = 1;
+		       this->value.data.dblptr[elem] = 0;
+		     } else if (pNull[0]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] = pVals[1].data.dbl;
+		     } else if (pNull[1]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] = pVals[0].data.dbl;
+		     } else {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] =
+			 minvalue( pVals[0].data.dbl, pVals[1].data.dbl );
+		     }
 		  }
-	       }
+ 	       }
 	    }
 	    break;
 
@@ -3430,19 +3926,20 @@ static void Do_Func( Node *this )
 	       long maxVal=0;
 	       while( row-- ) {
 		  valInit = 1;
-		  this->value.undef[row] = 0;
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     if( valInit && !theParams[0]->value.undef[elem] ) {
-			valInit = 0;
-			maxVal  = theParams[0]->value.data.lngptr[elem];
-		     } else {
-			maxVal  = maxvalue( maxVal,
-					    theParams[0]->value.data.lngptr[elem] );
+		     if ( !theParams[0]->value.undef[elem] ) {
+		       if ( valInit ) {
+			 valInit = 0;
+			 maxVal  = theParams[0]->value.data.lngptr[elem];
+		       } else {
+			 maxVal  = maxvalue( maxVal,
+					     theParams[0]->value.data.lngptr[elem] );
+		       }
+		       this->value.undef[row] = 0;
 		     }
-		     this->value.undef[row] |=
-			theParams[0]->value.undef[elem];
 		  }
 		  this->value.data.lngptr[row] = maxVal;
 	       }		  
@@ -3450,22 +3947,35 @@ static void Do_Func( Node *this )
 	       double maxVal=0.0;
 	       while( row-- ) {
 		  valInit = 1;
-		  this->value.undef[row] = 0;
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     if( valInit && !theParams[0]->value.undef[elem] ) {
-			valInit = 0;
-			maxVal  = theParams[0]->value.data.dblptr[elem];
-		     } else {
-			maxVal  = maxvalue( maxVal,
-					    theParams[0]->value.data.dblptr[elem] );
+		     if ( !theParams[0]->value.undef[elem] ) {
+		       if ( valInit ) {
+			 valInit = 0;
+			 maxVal  = theParams[0]->value.data.dblptr[elem];
+		       } else {
+			 maxVal  = maxvalue( maxVal,
+					     theParams[0]->value.data.dblptr[elem] );
+		       }
+		       this->value.undef[row] = 0;
 		     }
-		     this->value.undef[row] |=
-			theParams[0]->value.undef[elem];
 		  }
 		  this->value.data.dblptr[row] = maxVal;
 	       }		  
+	    } else if( this->type==BITSTR ) {
+	       char maxVal;
+	       while( row-- ) {
+		  char *sptr1 = theParams[0]->value.data.strptr[row];
+		  maxVal = '0';
+		  while (*sptr1) {
+		    if (*sptr1 == '1') maxVal = '1';
+		    sptr1++;
+		  }
+		  this->value.data.strptr[row][0] = maxVal;
+		  this->value.data.strptr[row][1] = 0;     /* Null terminate */
+	       }		  
 	    }
 	    break;
          case max2_fct:
@@ -3484,9 +3994,20 @@ static void Do_Func( Node *this )
 			      theParams[i]->value.data.lngptr[row];
 			   pNull[i] = theParams[i]->value.undef[row];
 			}
-		     if( !(this->value.undef[elem] = (pNull[0] || pNull[1]) ) )
-			this->value.data.lngptr[elem] =
-			   maxvalue( pVals[0].data.lng, pVals[1].data.lng );
+		     if( pNull[0] && pNull[1] ) {
+		       this->value.undef[elem] = 1;
+		       this->value.data.lngptr[elem] = 0;
+		     } else if (pNull[0]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] = pVals[1].data.lng;
+		     } else if (pNull[1]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] = pVals[0].data.lng;
+		     } else {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] =
+			 maxvalue( pVals[0].data.lng, pVals[1].data.lng );
+		     }
 		  }
 	       }
 	    } else if( this->type==DOUBLE ) {
@@ -3504,9 +4025,20 @@ static void Do_Func( Node *this )
 			      theParams[i]->value.data.dblptr[row];
 			   pNull[i] = theParams[i]->value.undef[row];
 			}
-		     if( !(this->value.undef[elem] = (pNull[0] || pNull[1]) ) )
-			this->value.data.dblptr[elem] =
-			   maxvalue( pVals[0].data.dbl, pVals[1].data.dbl );
+		     if( pNull[0] && pNull[1] ) {
+		       this->value.undef[elem] = 1;
+		       this->value.data.dblptr[elem] = 0;
+		     } else if (pNull[0]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] = pVals[1].data.dbl;
+		     } else if (pNull[1]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] = pVals[0].data.dbl;
+		     } else {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] =
+			 maxvalue( pVals[0].data.dbl, pVals[1].data.dbl );
+		     }
 		  }
 	       }
 	    }
@@ -3778,16 +4310,31 @@ static void Do_Deref( Node *this )
 	 }
 	 if( i<0 ) {
 	    for( row=0; row<gParse.nRows; row++ ) {
-	       this->value.undef[row] = theVar->value.undef[elem];
+	       if( this->type==STRING )
+		 this->value.undef[row] = theVar->value.undef[row];
+	       else if( this->type==BITSTR ) 
+		 this->value.undef;  /* Dummy - BITSTRs do not have undefs */
+	       else 
+		 this->value.undef[row] = theVar->value.undef[elem];
+
 	       if( this->type==DOUBLE )
 		  this->value.data.dblptr[row] = 
 		     theVar->value.data.dblptr[elem];
 	       else if( this->type==LONG )
 		  this->value.data.lngptr[row] = 
 		     theVar->value.data.lngptr[elem];
-	       else
+	       else if( this->type==BOOLEAN )
 		  this->value.data.logptr[row] = 
 		     theVar->value.data.logptr[elem];
+	       else {
+		 /* XXX Note, the below expression uses knowledge of
+                    the layout of the string format, namely (nelem+1)
+                    characters per string, followed by (nelem+1)
+                    "undef" values. */
+		  this->value.data.strptr[row][0] = 
+		     theVar->value.data.strptr[0][elem+row];
+		  this->value.data.strptr[row][1] = 0;  /* Null terminate */
+	       }
 	       elem += theVar->value.nelem;
 	    }
 	 } else {
@@ -3803,6 +4350,19 @@ static void Do_Deref( Node *this )
 	     dimVals[0] > theVar->value.naxes[ theVar->value.naxis-1 ] ) {
 	    yyerror("Index out of range");
 	    free( this->value.data.ptr );
+	 } else if ( this->type == BITSTR || this->type == STRING ) {
+	    elem = this->value.nelem * (dimVals[0]-1);
+	    for( row=0; row<gParse.nRows; row++ ) {
+	      if (this->value.undef) 
+		this->value.undef[row] = theVar->value.undef[row];
+	      memcpy( (char*)this->value.data.strptr[0]
+		      + row*sizeof(char)*(this->value.nelem+1),
+		      (char*)theVar->value.data.strptr[0] + elem*sizeof(char),
+		      this->value.nelem * sizeof(char) );
+	      /* Null terminate */
+	      this->value.data.strptr[row][this->value.nelem] = 0;
+	      elem += theVar->value.nelem+1;
+	    }	       
 	 } else {
 	    elem = this->value.nelem * (dimVals[0]-1);
 	    for( row=0; row<gParse.nRows; row++ ) {
@@ -3843,16 +4403,32 @@ static void Do_Deref( Node *this )
 	    }
 	    if( i<0 ) {
 	       elem += row*theVar->value.nelem;
-	       this->value.undef[row] = theVar->value.undef[elem];
+
+	       if( this->type==STRING )
+		 this->value.undef[row] = theVar->value.undef[row];
+	       else if( this->type==BITSTR ) 
+		 this->value.undef;  /* Dummy - BITSTRs do not have undefs */
+	       else 
+		 this->value.undef[row] = theVar->value.undef[elem];
+
 	       if( this->type==DOUBLE )
 		  this->value.data.dblptr[row] = 
 		     theVar->value.data.dblptr[elem];
 	       else if( this->type==LONG )
 		  this->value.data.lngptr[row] = 
 		     theVar->value.data.lngptr[elem];
-	       else
+	       else if( this->type==BOOLEAN )
 		  this->value.data.logptr[row] = 
 		     theVar->value.data.logptr[elem];
+	       else {
+		 /* XXX Note, the below expression uses knowledge of
+                    the layout of the string format, namely (nelem+1)
+                    characters per string, followed by (nelem+1)
+                    "undef" values. */
+		  this->value.data.strptr[row][0] = 
+		     theVar->value.data.strptr[0][elem+row];
+		  this->value.data.strptr[row][1] = 0;  /* Null terminate */
+	       }
 	    } else {
 	       yyerror("Index out of range");
 	       free( this->value.data.ptr );
@@ -3878,6 +4454,17 @@ static void Do_Deref( Node *this )
 		dimVals[0] > theVar->value.naxes[ theVar->value.naxis-1 ] ) {
 	       yyerror("Index out of range");
 	       free( this->value.data.ptr );
+	    } else if ( this->type == BITSTR || this->type == STRING ) {
+	      elem = this->value.nelem * (dimVals[0]-1);
+	      elem += row*(theVar->value.nelem+1);
+	      if (this->value.undef) 
+		this->value.undef[row] = theVar->value.undef[row];
+	      memcpy( (char*)this->value.data.strptr[0]
+		      + row*sizeof(char)*(this->value.nelem+1),
+		      (char*)theVar->value.data.strptr[0] + elem*sizeof(char),
+		      this->value.nelem * sizeof(char) );
+	      /* Null terminate */
+	      this->value.data.strptr[row][this->value.nelem] = 0;
 	    } else {
 	       elem  = this->value.nelem * (dimVals[0]-1);
 	       elem += row*theVar->value.nelem;
@@ -3894,7 +4481,10 @@ static void Do_Deref( Node *this )
    }
 
    if( theVar->operation>0 ) {
-      free( theVar->value.data.ptr );
+     if (theVar->type == STRING || theVar->type == BITSTR) 
+       free(theVar->value.data.strptr[0] );
+     else 
+       free( theVar->value.data.ptr );
    }
    for( i=0; i<nDims; i++ )
       if( theDims[i]->operation>0 ) {
diff --git a/eval_defs.h b/eval_defs.h
index a7d2e4e..d991fc1 100644
--- a/eval_defs.h
+++ b/eval_defs.h
@@ -129,7 +129,11 @@ typedef enum {
                   regfilt_fct,
                   ifthenelse_fct,
                   row_fct,
-                  null_fct
+                  null_fct,
+		  median_fct,
+		  average_fct,
+		  stddev_fct,
+		  nonnull_fct
                                 } funcOp;
 
 extern ParseData gParse;
diff --git a/eval_f.c b/eval_f.c
index 0b9522d..2044181 100644
--- a/eval_f.c
+++ b/eval_f.c
@@ -196,7 +196,6 @@ int ffsrow( fitsfile *infptr,   /* I - Input FITS file                      */
       return( *status = PARSE_BAD_TYPE );
    }
 
-
    /***********************************************************/
    /*  Extract various table information from each extension  */
    /***********************************************************/
@@ -239,7 +238,7 @@ int ffsrow( fitsfile *infptr,   /* I - Input FITS file                      */
    /*  Fill out Info data for parser  */
    /***********************************/
 
-   Info.dataPtr = (char *)malloc( inExt.numRows * sizeof(char) );
+   Info.dataPtr = (char *)malloc( (inExt.numRows + 1) * sizeof(char) );
    Info.nullPtr = NULL;
    Info.maxRows = inExt.numRows;
    if( !Info.dataPtr ) {
@@ -248,6 +247,9 @@ int ffsrow( fitsfile *infptr,   /* I - Input FITS file                      */
       return( *status = MEMORY_ALLOCATION );
    }
    
+   /* make sure array is zero terminated */
+   ((char*)Info.dataPtr)[inExt.numRows] = 0;
+
    if( constant ) { /*  Set all rows to the same value from constant result  */
 
       result = gParse.Nodes[gParse.resultNode].value.data.log;
@@ -269,12 +271,12 @@ int ffsrow( fitsfile *infptr,   /* I - Input FITS file                      */
       /* Error... Do nothing */
    } else {
       rdlen  = inExt.rowLength;
-      buffer = (unsigned char *)malloc( maxvalue(100000,rdlen) * sizeof(char) );
+      buffer = (unsigned char *)malloc(maxvalue(500000,rdlen) * sizeof(char) );
       if( buffer==NULL ) {
          ffcprs();
          return( *status=MEMORY_ALLOCATION );
       }
-      maxrows = 100000L/rdlen;
+      maxrows = maxvalue( (500000L/rdlen), 1);
       nbuff = 0;
       inloc = 1;
       if( infptr==outfptr ) { /* Skip initial good rows if input==output file */
@@ -282,7 +284,8 @@ int ffsrow( fitsfile *infptr,   /* I - Input FITS file                      */
 	 outloc = inloc;
       } else {
 	 outloc = outExt.numRows + 1;
-	 ffirow( outfptr, outExt.numRows, nGood, status );
+	 if (outloc > 1) 
+            ffirow( outfptr, outExt.numRows, nGood, status );
       }
 
       do {
@@ -354,7 +357,7 @@ int ffsrow( fitsfile *infptr,   /* I - Input FITS file                      */
          outbyteloc = outExt.heapStart + outExt.dataStart + outExt.heapSize;
 
          while ( ntodo && !*status ) {
-            rdlen = minvalue(ntodo,100000);
+            rdlen = minvalue(ntodo,500000);
             ffmbyt( infptr,  inbyteloc,  REPORT_EOF, status );
             ffgbyt( infptr,  rdlen,  buffer,     status );
             ffmbyt( outfptr, outbyteloc, IGNORE_EOF, status );
@@ -390,6 +393,8 @@ int ffsrow( fitsfile *infptr,   /* I - Input FITS file                      */
 
    free(Info.dataPtr);
    ffcprs();
+
+   ffcmph(outfptr, status);  /* compress heap, deleting any orphaned data */
    return(*status);
 }
 
@@ -654,6 +659,9 @@ int ffcalc_rng( fitsfile *infptr,   /* I - Input FITS file                  */
 
       int anyNull = 0;
       int nPerLp, i;
+      long totaln;
+
+      ffgkyj(infptr, "NAXIS2", &totaln, 0, status);
 
       /*************************************/
       /* Create new iterator Output Column */
@@ -672,10 +680,20 @@ int ffcalc_rng( fitsfile *infptr,   /* I - Input FITS file                  */
       for( i=0; i<nRngs; i++ ) {
          Info.dataPtr = NULL;
          Info.maxRows = end[i]-start[i]+1;
-         if( Info.maxRows < 10 )
-            nPerLp = Info.maxRows;
+
+          /*
+            If there is only 1 range, and it includes all the rows,
+            and there are 10 or more rows, then set nPerLp = 0 so
+            that the iterator function will dynamically choose the
+            most efficient number of rows to process in each loop.
+            Otherwise, set nPerLp to the number of rows in this range.
+         */
+
+         if( (Info.maxRows >= 10) && (nRngs == 1) &&
+             (start[0] == 1) && (end[0] == totaln))
+              nPerLp = 0;
          else
-            nPerLp = 0;
+              nPerLp = Info.maxRows;
 
          if( ffiter( gParse.nCols, gParse.colData, start[i]-1,
                      nPerLp, parse_data, (void*)&Info, status ) == -1 )
@@ -752,7 +770,7 @@ int ffiprs( fitsfile *fptr,      /* I - Input FITS file                     */
 /*--------------------------------------------------------------------------*/
 {
    Node *result;
-   int  i,lexpr;
+   int  i,lexpr, tstatus = 0;
    static iteratorCol dmyCol;
 
    if( *status ) return( *status );
@@ -771,8 +789,11 @@ int ffiprs( fitsfile *fptr,      /* I - Input FITS file                     */
    gParse.nNodes     = 0;
    gParse.status     = 0;
 
-   if( ffgkyj(fptr, "NAXIS2", &gParse.totalRows, 0, status) ) return( *status );
-   
+   if( ffgkyj(fptr, "NAXIS2", &gParse.totalRows, 0, &tstatus) )
+   {
+      /* this might be a 1D or null image with no NAXIS2 keyword */
+      gParse.totalRows = 0;
+   }   
    /*  Copy expression into parser... read from file if necessary  */
 
    if( expr[0]=='@' ) {
@@ -791,9 +812,9 @@ int ffiprs( fitsfile *fptr,      /* I - Input FITS file                     */
    /*  which columns are neded and what data type is returned  */
 
    ffrestart(NULL);
-   if( ffparse() )
+   if( ffparse() ) {
       return( *status = PARSE_SYNTAX_ERR );
-
+   }
    /*  Check results  */
 
    *status = gParse.status;
@@ -2012,6 +2033,9 @@ static int find_column( char *colName, void *itslval )
    int colnum, typecode, type, hdutype;
    long repeat, width;
    fitsfile *fptr;
+   char temp[80];
+   double tzero,tscale;
+   int istatus;
 
    if( *colName == '#' )
       return( find_keywd( colName + 1, itslval ) );
@@ -2054,8 +2078,29 @@ static int find_column( char *colName, void *itslval )
    case TBYTE:
    case TSHORT:
    case TLONG:
-      gParse.varData[col_cnt].type     = LONG;
-      gParse.colData[col_cnt].datatype = TLONG;
+      /* The datatype of column with TZERO and TSCALE keywords might be 
+         float or double. 
+      */
+      sprintf(temp,"TZERO%d",colnum);
+      istatus = 0;
+      if(fits_read_key(fptr,TDOUBLE,temp,&tzero,NULL,&istatus)) {
+          tzero = 0.0;
+      } 
+      sprintf(temp,"TSCAL%d",colnum);
+      istatus = 0;
+      if(fits_read_key(fptr,TDOUBLE,temp,&tscale,NULL,&istatus)) {
+          tscale = 1.0;
+      } 
+      if (tscale == 1.0 && (tzero == 0.0 || tzero == 32768.0 )) {
+          gParse.varData[col_cnt].type     = LONG;
+          gParse.colData[col_cnt].datatype = TLONG;
+      } else if (tscale == 1.0 &&  tzero == 2147483648.0 ) {
+          gParse.varData[col_cnt].type     = LONG;
+          gParse.colData[col_cnt].datatype = TULONG;
+      } else {
+          gParse.varData[col_cnt].type     = DOUBLE;
+          gParse.colData[col_cnt].datatype = TDOUBLE;
+      }
       type = COLUMN;
       break;
    case TFLOAT:
diff --git a/eval_tab.h b/eval_tab.h
index d7fe57c..2f07071 100644
--- a/eval_tab.h
+++ b/eval_tab.h
@@ -5,35 +5,35 @@ typedef union {
     char   log;         /* logical value */
     char   str[256];    /* string value  */
 } FFSTYPE;
-#define	BOOLEAN	257
-#define	LONG	258
-#define	DOUBLE	259
-#define	STRING	260
-#define	BITSTR	261
-#define	FUNCTION	262
-#define	BFUNCTION	263
-#define	GTIFILTER	264
-#define	REGFILTER	265
-#define	COLUMN	266
-#define	BCOLUMN	267
-#define	SCOLUMN	268
-#define	BITCOL	269
-#define	ROWREF	270
-#define	NULLREF	271
-#define	SNULLREF	272
-#define	OR	273
-#define	AND	274
-#define	EQ	275
-#define	NE	276
-#define	GT	277
-#define	LT	278
-#define	LTE	279
-#define	GTE	280
-#define	POWER	281
-#define	NOT	282
-#define	INTCAST	283
-#define	FLTCAST	284
-#define	UMINUS	285
+#define	BOOLEAN	258
+#define	LONG	259
+#define	DOUBLE	260
+#define	STRING	261
+#define	BITSTR	262
+#define	FUNCTION	263
+#define	BFUNCTION	264
+#define	GTIFILTER	265
+#define	REGFILTER	266
+#define	COLUMN	267
+#define	BCOLUMN	268
+#define	SCOLUMN	269
+#define	BITCOL	270
+#define	ROWREF	271
+#define	NULLREF	272
+#define	SNULLREF	273
+#define	OR	274
+#define	AND	275
+#define	EQ	276
+#define	NE	277
+#define	GT	278
+#define	LT	279
+#define	LTE	280
+#define	GTE	281
+#define	POWER	282
+#define	NOT	283
+#define	INTCAST	284
+#define	FLTCAST	285
+#define	UMINUS	286
 
 
 extern FFSTYPE fflval;
diff --git a/eval_y.c b/eval_y.c
index e464ef1..2cca17f 100644
--- a/eval_y.c
+++ b/eval_y.c
@@ -1,39 +1,39 @@
 
 /*  A Bison parser, made from eval.y
- by  GNU Bison version 1.27
+ by  GNU Bison version 1.25
   */
 
 #define FFBISON 1  /* Identify Bison output.  */
 
-#define	BOOLEAN	257
-#define	LONG	258
-#define	DOUBLE	259
-#define	STRING	260
-#define	BITSTR	261
-#define	FUNCTION	262
-#define	BFUNCTION	263
-#define	GTIFILTER	264
-#define	REGFILTER	265
-#define	COLUMN	266
-#define	BCOLUMN	267
-#define	SCOLUMN	268
-#define	BITCOL	269
-#define	ROWREF	270
-#define	NULLREF	271
-#define	SNULLREF	272
-#define	OR	273
-#define	AND	274
-#define	EQ	275
-#define	NE	276
-#define	GT	277
-#define	LT	278
-#define	LTE	279
-#define	GTE	280
-#define	POWER	281
-#define	NOT	282
-#define	INTCAST	283
-#define	FLTCAST	284
-#define	UMINUS	285
+#define	BOOLEAN	258
+#define	LONG	259
+#define	DOUBLE	260
+#define	STRING	261
+#define	BITSTR	262
+#define	FUNCTION	263
+#define	BFUNCTION	264
+#define	GTIFILTER	265
+#define	REGFILTER	266
+#define	COLUMN	267
+#define	BCOLUMN	268
+#define	SCOLUMN	269
+#define	BITCOL	270
+#define	ROWREF	271
+#define	NULLREF	272
+#define	SNULLREF	273
+#define	OR	274
+#define	AND	275
+#define	EQ	276
+#define	NE	277
+#define	GT	278
+#define	LT	279
+#define	LTE	280
+#define	GTE	281
+#define	POWER	282
+#define	NOT	283
+#define	INTCAST	284
+#define	FLTCAST	285
+#define	UMINUS	286
 
 #line 1 "eval.y"
 
@@ -84,6 +84,14 @@
 /*   Peter D Wilson   Aug 1998  regfilter(a,b,c,d) function added       */
 /*   Peter D Wilson   Jul 1999  Make parser fitsfile-independent,       */
 /*                              allowing a purely vector-based usage    */
+/*  Craig B Markwardt Jun 2004  Add MEDIAN() function                   */
+/*  Craig B Markwardt Jun 2004  Add SUM(), and MIN/MAX() for bit arrays */
+/*  Craig B Markwardt Jun 2004  Allow subscripting of nX bit arrays     */
+/*  Craig B Markwardt Jun 2004  Implement statistical functions         */
+/*                              NVALID(), AVERAGE(), and STDDEV()       */
+/*                              for integer and floating point vectors  */
+/*  Craig B Markwardt Jun 2004  Use NULL values for range errors instead*/
+/*                              of throwing a parse error               */
 /*                                                                      */
 /************************************************************************/
 
@@ -93,7 +101,10 @@
 #include <time.h>
 
 #include <stdlib.h>
+
+#ifndef alloca
 #define alloca malloc
+#endif
 
    /*  Shrink the initial stack depth to keep local data <32K (mac limit)  */
    /*  yacc will allocate more space if needed, though.                    */
@@ -197,7 +208,7 @@ static void  fferror(char *msg);
 #endif
 
 
-#line 163 "eval.y"
+#line 174 "eval.y"
 typedef union {
     int    Node;        /* Index of Node */
     double dbl;         /* real value    */
@@ -215,23 +226,23 @@ typedef union {
 
 
 
-#define	FFFINAL		261
+#define	FFFINAL		276
 #define	FFFLAG		-32768
 #define	FFNTBASE	51
 
-#define FFTRANSLATE(x) ((unsigned)(x) <= 285 ? fftranslate[x] : 59)
+#define FFTRANSLATE(x) ((unsigned)(x) <= 286 ? fftranslate[x] : 59)
 
 static const char fftranslate[] = {     0,
      2,     2,     2,     2,     2,     2,     2,     2,     2,    47,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,    36,    40,     2,    48,
-    49,    37,    34,    19,    35,     2,    38,     2,     2,     2,
+     2,     2,     2,     2,     2,     2,    36,    40,     2,    49,
+    50,    37,    34,    19,    35,     2,    38,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,    21,     2,     2,
     20,     2,    24,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-    46,     2,    50,     2,     2,     2,     2,     2,     2,     2,
+    46,     2,    48,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,    22,    39,    23,    29,     2,     2,     2,     2,
@@ -247,26 +258,27 @@ static const char fftranslate[] = {     0,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    25,    26,    27,    28,    30,    31,    32,    33,
-    41,    42,    43,    44,    45
+     2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
+     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
+    16,    17,    18,    25,    26,    27,    28,    30,    31,    32,
+    33,    41,    42,    43,    44,    45
 };
 
 #if FFDEBUG != 0
 static const short ffprhs[] = {     0,
      0,     1,     4,     6,     9,    12,    15,    18,    21,    24,
     28,    31,    35,    39,    43,    46,    49,    51,    53,    58,
-    62,    66,    70,    73,    77,    79,    81,    83,    88,    90,
-    92,    96,   100,   104,   108,   112,   116,   119,   122,   126,
-   130,   134,   140,   146,   152,   155,   159,   163,   167,   171,
-   177,   182,   189,   198,   209,   222,   225,   228,   231,   234,
-   236,   238,   243,   247,   251,   255,   259,   263,   267,   271,
-   275,   279,   283,   287,   291,   295,   299,   303,   307,   311,
-   315,   319,   323,   327,   331,   335,   341,   347,   351,   355,
-   359,   365,   373,   385,   401,   404,   408,   414,   424,   428,
-   436,   446,   451,   458,   467,   478,   491,   494,   498,   500,
-   502,   507,   509,   513,   517,   523
+    62,    66,    70,    75,    82,    91,   102,   115,   118,   122,
+   124,   126,   128,   133,   135,   137,   141,   145,   149,   153,
+   157,   161,   164,   167,   171,   175,   179,   185,   191,   197,
+   200,   204,   208,   212,   216,   222,   227,   234,   243,   254,
+   267,   270,   273,   276,   279,   281,   283,   288,   292,   296,
+   300,   304,   308,   312,   316,   320,   324,   328,   332,   336,
+   340,   344,   348,   352,   356,   360,   364,   368,   372,   376,
+   380,   386,   392,   396,   400,   404,   410,   418,   430,   446,
+   449,   453,   459,   469,   473,   481,   491,   496,   503,   512,
+   523,   536,   539,   543,   545,   547,   552,   554,   558,   562,
+   568
 };
 
 static const short ffrhs[] = {    -1,
@@ -276,71 +288,77 @@ static const short ffrhs[] = {    -1,
     54,    19,    55,     0,    54,    19,    56,     0,    53,    19,
     55,     0,    54,    23,     0,    53,    23,     0,     7,     0,
     15,     0,    15,    22,    55,    23,     0,    57,    40,    57,
-     0,    57,    39,    57,     0,    57,    34,    57,     0,    42,
-    57,     0,    48,    57,    49,     0,     4,     0,     5,     0,
-    12,     0,    12,    22,    55,    23,     0,    16,     0,    17,
-     0,    55,    36,    55,     0,    55,    34,    55,     0,    55,
-    35,    55,     0,    55,    37,    55,     0,    55,    38,    55,
-     0,    55,    41,    55,     0,    34,    55,     0,    35,    55,
-     0,    48,    55,    49,     0,    55,    37,    56,     0,    56,
-    37,    55,     0,    56,    24,    55,    21,    55,     0,    56,
-    24,    56,    21,    55,     0,    56,    24,    55,    21,    56,
-     0,     8,    49,     0,     8,    56,    49,     0,     8,    58,
-    49,     0,     8,    57,    49,     0,     8,    55,    49,     0,
-     8,    55,    19,    55,    49,     0,    55,    46,    55,    50,
-     0,    55,    46,    55,    19,    55,    50,     0,    55,    46,
-    55,    19,    55,    19,    55,    50,     0,    55,    46,    55,
-    19,    55,    19,    55,    19,    55,    50,     0,    55,    46,
-    55,    19,    55,    19,    55,    19,    55,    19,    55,    50,
-     0,    43,    55,     0,    43,    56,     0,    44,    55,     0,
-    44,    56,     0,     3,     0,    13,     0,    13,    22,    55,
-    23,     0,    57,    27,    57,     0,    57,    28,    57,     0,
-    57,    31,    57,     0,    57,    32,    57,     0,    57,    30,
-    57,     0,    57,    33,    57,     0,    55,    30,    55,     0,
-    55,    31,    55,     0,    55,    33,    55,     0,    55,    32,
-    55,     0,    55,    29,    55,     0,    55,    27,    55,     0,
-    55,    28,    55,     0,    58,    27,    58,     0,    58,    28,
-    58,     0,    58,    30,    58,     0,    58,    33,    58,     0,
-    58,    31,    58,     0,    58,    32,    58,     0,    56,    26,
-    56,     0,    56,    25,    56,     0,    56,    27,    56,     0,
-    56,    28,    56,     0,    55,    20,    55,    21,    55,     0,
-    56,    24,    56,    21,    56,     0,     9,    55,    49,     0,
-     9,    56,    49,     0,     9,    58,    49,     0,     8,    56,
-    19,    56,    49,     0,     9,    55,    19,    55,    19,    55,
-    49,     0,     9,    55,    19,    55,    19,    55,    19,    55,
-    19,    55,    49,     0,     9,    55,    19,    55,    19,    55,
-    19,    55,    19,    55,    19,    55,    19,    55,    49,     0,
-    10,    49,     0,    10,     6,    49,     0,    10,     6,    19,
-    55,    49,     0,    10,     6,    19,    55,    19,     6,    19,
-     6,    49,     0,    11,     6,    49,     0,    11,     6,    19,
-    55,    19,    55,    49,     0,    11,     6,    19,    55,    19,
-    55,    19,     6,    49,     0,    56,    46,    55,    50,     0,
-    56,    46,    55,    19,    55,    50,     0,    56,    46,    55,
-    19,    55,    19,    55,    50,     0,    56,    46,    55,    19,
-    55,    19,    55,    19,    55,    50,     0,    56,    46,    55,
-    19,    55,    19,    55,    19,    55,    19,    55,    50,     0,
-    42,    56,     0,    48,    56,    49,     0,     6,     0,    14,
-     0,    14,    22,    55,    23,     0,    18,     0,    48,    58,
-    49,     0,    58,    34,    58,     0,    56,    24,    58,    21,
-    58,     0,     8,    58,    19,    58,    49,     0
+     0,    57,    39,    57,     0,    57,    34,    57,     0,    57,
+    46,    55,    48,     0,    57,    46,    55,    19,    55,    48,
+     0,    57,    46,    55,    19,    55,    19,    55,    48,     0,
+    57,    46,    55,    19,    55,    19,    55,    19,    55,    48,
+     0,    57,    46,    55,    19,    55,    19,    55,    19,    55,
+    19,    55,    48,     0,    42,    57,     0,    49,    57,    50,
+     0,     4,     0,     5,     0,    12,     0,    12,    22,    55,
+    23,     0,    16,     0,    17,     0,    55,    36,    55,     0,
+    55,    34,    55,     0,    55,    35,    55,     0,    55,    37,
+    55,     0,    55,    38,    55,     0,    55,    41,    55,     0,
+    34,    55,     0,    35,    55,     0,    49,    55,    50,     0,
+    55,    37,    56,     0,    56,    37,    55,     0,    56,    24,
+    55,    21,    55,     0,    56,    24,    56,    21,    55,     0,
+    56,    24,    55,    21,    56,     0,     8,    50,     0,     8,
+    56,    50,     0,     8,    58,    50,     0,     8,    57,    50,
+     0,     8,    55,    50,     0,     8,    55,    19,    55,    50,
+     0,    55,    46,    55,    48,     0,    55,    46,    55,    19,
+    55,    48,     0,    55,    46,    55,    19,    55,    19,    55,
+    48,     0,    55,    46,    55,    19,    55,    19,    55,    19,
+    55,    48,     0,    55,    46,    55,    19,    55,    19,    55,
+    19,    55,    19,    55,    48,     0,    43,    55,     0,    43,
+    56,     0,    44,    55,     0,    44,    56,     0,     3,     0,
+    13,     0,    13,    22,    55,    23,     0,    57,    27,    57,
+     0,    57,    28,    57,     0,    57,    31,    57,     0,    57,
+    32,    57,     0,    57,    30,    57,     0,    57,    33,    57,
+     0,    55,    30,    55,     0,    55,    31,    55,     0,    55,
+    33,    55,     0,    55,    32,    55,     0,    55,    29,    55,
+     0,    55,    27,    55,     0,    55,    28,    55,     0,    58,
+    27,    58,     0,    58,    28,    58,     0,    58,    30,    58,
+     0,    58,    33,    58,     0,    58,    31,    58,     0,    58,
+    32,    58,     0,    56,    26,    56,     0,    56,    25,    56,
+     0,    56,    27,    56,     0,    56,    28,    56,     0,    55,
+    20,    55,    21,    55,     0,    56,    24,    56,    21,    56,
+     0,     9,    55,    50,     0,     9,    56,    50,     0,     9,
+    58,    50,     0,     8,    56,    19,    56,    50,     0,     9,
+    55,    19,    55,    19,    55,    50,     0,     9,    55,    19,
+    55,    19,    55,    19,    55,    19,    55,    50,     0,     9,
+    55,    19,    55,    19,    55,    19,    55,    19,    55,    19,
+    55,    19,    55,    50,     0,    10,    50,     0,    10,     6,
+    50,     0,    10,     6,    19,    55,    50,     0,    10,     6,
+    19,    55,    19,     6,    19,     6,    50,     0,    11,     6,
+    50,     0,    11,     6,    19,    55,    19,    55,    50,     0,
+    11,     6,    19,    55,    19,    55,    19,     6,    50,     0,
+    56,    46,    55,    48,     0,    56,    46,    55,    19,    55,
+    48,     0,    56,    46,    55,    19,    55,    19,    55,    48,
+     0,    56,    46,    55,    19,    55,    19,    55,    19,    55,
+    48,     0,    56,    46,    55,    19,    55,    19,    55,    19,
+    55,    19,    55,    48,     0,    42,    56,     0,    49,    56,
+    50,     0,     6,     0,    14,     0,    14,    22,    55,    23,
+     0,    18,     0,    49,    58,    50,     0,    58,    34,    58,
+     0,    56,    24,    58,    21,    58,     0,     8,    58,    19,
+    58,    50,     0
 };
 
 #endif
 
 #if FFDEBUG != 0
 static const short ffrline[] = { 0,
-   212,   213,   216,   217,   223,   229,   235,   241,   244,   246,
-   259,   261,   274,   285,   299,   303,   307,   312,   314,   323,
-   326,   329,   332,   335,   339,   341,   343,   345,   354,   356,
-   358,   361,   364,   367,   370,   373,   376,   378,   380,   382,
-   386,   390,   409,   428,   447,   457,   468,   477,   486,   542,
-   594,   596,   598,   600,   602,   604,   606,   608,   610,   614,
-   616,   618,   627,   630,   633,   636,   639,   642,   645,   648,
-   651,   654,   657,   660,   663,   666,   669,   672,   675,   678,
-   681,   684,   686,   688,   690,   693,   700,   717,   730,   743,
-   754,   770,   788,   809,   836,   840,   844,   847,   851,   855,
-   858,   862,   864,   866,   868,   870,   872,   874,   878,   881,
-   883,   892,   894,   896,   899,   911
+   223,   224,   227,   228,   234,   240,   246,   252,   255,   257,
+   270,   272,   285,   296,   310,   314,   318,   323,   325,   334,
+   337,   340,   343,   345,   347,   349,   351,   353,   356,   360,
+   362,   364,   366,   375,   377,   379,   382,   385,   388,   391,
+   394,   397,   399,   401,   403,   407,   411,   430,   449,   468,
+   478,   489,   501,   523,   591,   643,   645,   647,   649,   651,
+   653,   655,   657,   659,   663,   665,   667,   676,   679,   682,
+   685,   688,   691,   694,   697,   700,   703,   706,   709,   712,
+   715,   718,   721,   724,   727,   730,   733,   735,   737,   739,
+   742,   749,   766,   779,   792,   803,   819,   837,   858,   885,
+   889,   893,   896,   900,   904,   907,   911,   913,   915,   917,
+   919,   921,   923,   927,   930,   932,   941,   943,   945,   948,
+   960
 };
 #endif
 
@@ -352,7 +370,7 @@ static const char * const fftname[] = {   "$","error","$undefined.","BOOLEAN",
 "COLUMN","BCOLUMN","SCOLUMN","BITCOL","ROWREF","NULLREF","SNULLREF","','","'='",
 "':'","'{'","'}'","'?'","OR","AND","EQ","NE","'~'","GT","LT","LTE","GTE","'+'",
 "'-'","'%'","'*'","'/'","'|'","'&'","POWER","NOT","INTCAST","FLTCAST","UMINUS",
-"'['","'\\n'","'('","')'","']'","lines","line","bvector","vector","expr","bexpr",
+"'['","'\\n'","']'","'('","')'","lines","line","bvector","vector","expr","bexpr",
 "bits","sexpr", NULL
 };
 #endif
@@ -360,61 +378,64 @@ static const char * const fftname[] = {   "$","error","$undefined.","BOOLEAN",
 static const short ffr1[] = {     0,
     51,    51,    52,    52,    52,    52,    52,    52,    53,    53,
     54,    54,    54,    54,    55,    56,    57,    57,    57,    57,
-    57,    57,    57,    57,    55,    55,    55,    55,    55,    55,
+    57,    57,    57,    57,    57,    57,    57,    57,    57,    55,
+    55,    55,    55,    55,    55,    55,    55,    55,    55,    55,
     55,    55,    55,    55,    55,    55,    55,    55,    55,    55,
     55,    55,    55,    55,    55,    55,    55,    55,    55,    55,
-    55,    55,    55,    55,    55,    55,    55,    55,    55,    56,
+    55,    55,    55,    55,    56,    56,    56,    56,    56,    56,
     56,    56,    56,    56,    56,    56,    56,    56,    56,    56,
     56,    56,    56,    56,    56,    56,    56,    56,    56,    56,
     56,    56,    56,    56,    56,    56,    56,    56,    56,    56,
     56,    56,    56,    56,    56,    56,    56,    56,    56,    56,
-    56,    56,    56,    56,    56,    56,    56,    56,    58,    58,
-    58,    58,    58,    58,    58,    58
+    56,    56,    56,    58,    58,    58,    58,    58,    58,    58,
+    58
 };
 
 static const short ffr2[] = {     0,
      0,     2,     1,     2,     2,     2,     2,     2,     2,     3,
      2,     3,     3,     3,     2,     2,     1,     1,     4,     3,
-     3,     3,     2,     3,     1,     1,     1,     4,     1,     1,
-     3,     3,     3,     3,     3,     3,     2,     2,     3,     3,
-     3,     5,     5,     5,     2,     3,     3,     3,     3,     5,
-     4,     6,     8,    10,    12,     2,     2,     2,     2,     1,
-     1,     4,     3,     3,     3,     3,     3,     3,     3,     3,
+     3,     3,     4,     6,     8,    10,    12,     2,     3,     1,
+     1,     1,     4,     1,     1,     3,     3,     3,     3,     3,
+     3,     2,     2,     3,     3,     3,     5,     5,     5,     2,
+     3,     3,     3,     3,     5,     4,     6,     8,    10,    12,
+     2,     2,     2,     2,     1,     1,     4,     3,     3,     3,
      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
-     3,     3,     3,     3,     3,     5,     5,     3,     3,     3,
-     5,     7,    11,    15,     2,     3,     5,     9,     3,     7,
-     9,     4,     6,     8,    10,    12,     2,     3,     1,     1,
-     4,     1,     3,     3,     5,     5
+     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
+     5,     5,     3,     3,     3,     5,     7,    11,    15,     2,
+     3,     5,     9,     3,     7,     9,     4,     6,     8,    10,
+    12,     2,     3,     1,     1,     4,     1,     3,     3,     5,
+     5
 };
 
 static const short ffdefact[] = {     1,
-     0,     0,    60,    25,    26,   109,    17,     0,     0,     0,
-     0,    27,    61,   110,    18,    29,    30,   112,     0,     0,
+     0,     0,    65,    30,    31,   114,    17,     0,     0,     0,
+     0,    32,    66,   115,    18,    34,    35,   117,     0,     0,
      0,     0,     0,     0,     3,     0,     2,     0,     0,     0,
-     0,     0,     0,     8,    45,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,    95,     0,     0,     0,     0,     0,
-    11,     9,     0,    37,     0,    38,     0,   107,    23,    56,
-    57,    58,    59,     0,     0,     0,     0,     0,    16,     0,
+     0,     0,     0,     8,    50,     0,     0,     0,     0,     0,
+     0,     0,     0,     0,   100,     0,     0,     0,     0,     0,
+    11,     9,     0,    42,     0,    43,     0,   112,    28,    61,
+    62,    63,    64,     0,     0,     0,     0,     0,    16,     0,
     15,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      0,     0,     0,     0,     0,     0,     4,     0,     0,     0,
      0,     0,     0,     0,     5,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     7,     0,     0,     0,     0,     0,
-     0,     0,     6,     0,    49,     0,    46,    48,     0,    47,
-     0,    88,    89,    90,     0,    96,     0,    99,     0,     0,
-     0,     0,    39,   108,    24,   113,    14,    10,    12,    13,
-     0,    74,    75,    73,    69,    70,    72,    71,    32,    33,
-    31,    34,    40,    35,    36,     0,     0,     0,     0,    83,
-    82,    84,    85,    41,     0,     0,     0,    63,    64,    67,
-    65,    66,    68,    22,    21,    20,    76,    77,    78,    80,
-    81,    79,   114,     0,     0,     0,     0,     0,     0,    28,
-    62,   111,    19,     0,     0,    51,     0,     0,     0,     0,
-   102,    23,     0,    50,    91,   116,     0,     0,    97,     0,
-    86,     0,    42,    44,    43,    87,   115,     0,     0,     0,
-     0,     0,    52,     0,   103,     0,    92,     0,     0,   100,
-     0,     0,     0,     0,     0,     0,    53,     0,   104,     0,
-    98,   101,     0,     0,     0,     0,    54,     0,   105,     0,
-    93,     0,     0,     0,    55,   106,     0,     0,    94,     0,
-     0
+     0,     0,     0,     0,     0,     7,     0,     0,     0,     0,
+     0,     0,     0,     6,     0,    54,     0,    51,    53,     0,
+    52,     0,    93,    94,    95,     0,   101,     0,   104,     0,
+     0,     0,     0,    44,   113,    29,   118,    14,    10,    12,
+    13,     0,    79,    80,    78,    74,    75,    77,    76,    37,
+    38,    36,    39,    45,    40,    41,     0,     0,     0,     0,
+    88,    87,    89,    90,    46,     0,     0,     0,    68,    69,
+    72,    70,    71,    73,    22,    21,    20,     0,    81,    82,
+    83,    85,    86,    84,   119,     0,     0,     0,     0,     0,
+     0,    33,    67,   116,    19,     0,     0,    56,     0,     0,
+     0,     0,   107,    28,     0,     0,    23,    55,    96,   121,
+     0,     0,   102,     0,    91,     0,    47,    49,    48,    92,
+   120,     0,     0,     0,     0,     0,     0,    57,     0,   108,
+     0,    24,     0,    97,     0,     0,   105,     0,     0,     0,
+     0,     0,     0,     0,    58,     0,   109,     0,    25,     0,
+   103,   106,     0,     0,     0,     0,     0,    59,     0,   110,
+     0,    26,     0,    98,     0,     0,     0,     0,    60,   111,
+    27,     0,     0,    99,     0,     0
 };
 
 static const short ffdefgoto[] = {     1,
@@ -422,222 +443,232 @@ static const short ffdefgoto[] = {     1,
 };
 
 static const short ffpact[] = {-32768,
-   266,   -34,-32768,-32768,-32768,-32768,-32768,   326,   373,    -5,
-     9,    21,    37,    46,    64,-32768,-32768,-32768,   373,   373,
-   373,   373,   373,   373,-32768,   373,-32768,    15,    47,   846,
-   204,  1126,  1144,-32768,-32768,   591,     5,   263,    72,   614,
-   103,  1186,   371,    -9,-32768,    -8,   373,   373,   373,   373,
-  1073,  1109,    30,   -19,  1109,   -19,  1073,     6,-32768,   -19,
-     6,   -19,     6,   777,   117,   323,  1090,   373,-32768,   373,
--32768,   373,   373,   373,   373,   373,   373,   373,   373,   373,
-   373,   373,   373,   373,   373,   373,-32768,   373,   373,   373,
-   373,   373,   373,   373,-32768,    -3,    -3,    -3,    -3,    -3,
-    -3,    -3,    -3,    -3,-32768,   373,   373,   373,   373,   373,
-   373,   373,-32768,   373,-32768,   373,-32768,-32768,   373,-32768,
-   373,-32768,-32768,-32768,   373,-32768,   373,-32768,   949,   969,
-   989,  1009,-32768,-32768,-32768,-32768,  1073,  1109,  1073,  1109,
-  1031,  1169,  1169,  1169,  1201,  1201,  1201,  1201,   -32,   -32,
-   -32,   -25,     6,   -25,   -25,   399,  1053,   164,  1200,   278,
-  1115,   -20,   -20,   -25,   423,    -3,    -3,    83,    83,    83,
-    83,    83,    83,   -37,-32768,-32768,   186,   186,     3,     3,
-     3,     3,-32768,   800,   187,  1098,   869,   637,   889,-32768,
--32768,-32768,-32768,   373,   373,-32768,   373,   373,   373,   373,
--32768,-32768,    16,-32768,-32768,-32768,   373,    82,-32768,   373,
-  1152,   447,  1152,  1109,  1152,  1109,    30,   471,   660,    71,
-   683,   373,-32768,   373,-32768,   373,-32768,    89,    92,-32768,
-   495,   519,   909,    45,    52,   373,-32768,   373,-32768,   373,
--32768,-32768,   543,   567,   706,   373,-32768,   373,-32768,   373,
--32768,   729,   753,   929,-32768,-32768,   373,   823,-32768,   108,
--32768
+   290,   -44,-32768,-32768,-32768,-32768,-32768,   337,   385,    -5,
+     7,    -6,     5,     6,    31,-32768,-32768,-32768,   385,   385,
+   385,   385,   385,   385,-32768,   385,-32768,    71,    89,   968,
+   160,  1267,  1288,-32768,-32768,   411,    15,  1212,   131,   435,
+   165,  1313,   333,   -17,-32768,   -15,   385,   385,   385,   385,
+  1195,  1265,  1360,   -32,  1265,   -32,  1195,    24,    51,   -32,
+    24,   -32,    24,   555,   209,  1233,   382,   385,-32768,   385,
+-32768,   385,   385,   385,   385,   385,   385,   385,   385,   385,
+   385,   385,   385,   385,   385,   385,-32768,   385,   385,   385,
+   385,   385,   385,   385,-32768,     2,     2,     2,     2,     2,
+     2,     2,     2,     2,   385,-32768,   385,   385,   385,   385,
+   385,   385,   385,-32768,   385,-32768,   385,-32768,-32768,   385,
+-32768,   385,-32768,-32768,-32768,   385,-32768,   385,-32768,  1071,
+  1091,  1111,  1131,-32768,-32768,-32768,-32768,  1195,  1265,  1195,
+  1265,  1153,  1330,  1330,  1330,  1343,  1343,  1343,  1343,    22,
+    22,    22,    45,    24,    45,    45,   627,  1175,   289,   247,
+   -16,   -22,    52,    52,    45,   650,     2,     2,    -8,    -8,
+    -8,    -8,    -8,    -8,    18,    51,    51,   673,    69,    69,
+    73,    73,    73,    73,-32768,   579,   226,  1254,   991,   459,
+  1011,-32768,-32768,-32768,-32768,   385,   385,-32768,   385,   385,
+   385,   385,-32768,    51,    16,   385,-32768,-32768,-32768,-32768,
+   385,    99,-32768,   385,  1296,   696,  1296,  1265,  1296,  1265,
+  1360,   719,   742,   483,    96,   507,   385,-32768,   385,-32768,
+   385,-32768,   385,-32768,   111,   112,-32768,   765,   788,   811,
+  1031,    70,    74,   385,-32768,   385,-32768,   385,-32768,   385,
+-32768,-32768,   834,   857,   880,   531,   385,-32768,   385,-32768,
+   385,-32768,   385,-32768,   902,   924,   946,  1051,-32768,-32768,
+-32768,   385,   603,-32768,   119,-32768
 };
 
 static const short ffpgoto[] = {-32768,
--32768,-32768,-32768,    -1,    88,   161,    27
+-32768,-32768,-32768,    -1,    87,   121,    28
 };
 
 
-#define	FFLAST		1247
+#define	FFLAST		1394
 
 
 static const short fftable[] = {    30,
-    44,   103,   104,     7,    83,    84,    36,    40,    85,   125,
-   127,    15,    34,    86,    46,    85,    93,    51,    54,    56,
-    86,    60,    62,   116,    64,    94,    86,    33,    88,    89,
-    90,    91,    92,    68,    39,    43,   112,    69,   166,   126,
-   128,    93,    47,    45,   167,   129,   130,   131,   132,   102,
-    94,    94,    67,   117,   103,   104,   106,   107,    48,   108,
-   109,   110,   111,   112,   135,    70,   137,    49,   139,    71,
-   141,   142,   143,   144,   145,   146,   147,   148,   149,   150,
-   151,   152,   154,   155,   156,    50,   157,   220,    31,   228,
-   119,   164,   165,   241,   234,    37,    41,   235,   106,   107,
-   242,   108,   109,   110,   111,   112,    52,   261,     0,    58,
-    61,    63,   184,    65,   159,     0,   102,     0,     0,   187,
-   120,   103,   104,   188,     0,   189,    88,    89,    90,    91,
-    92,     0,   177,   178,   179,   180,   181,   182,   183,    93,
-    88,    89,    90,    91,    92,   186,     0,     0,    94,     0,
-     0,   123,     0,    93,     0,   138,     0,   140,     0,     0,
-     0,    32,    94,     0,     0,   134,     0,     0,    38,     0,
-   153,     0,     0,     0,     0,   158,   160,   161,   162,   163,
-     0,     0,    59,     0,   198,     0,    66,    88,    89,    90,
-    91,    92,   211,   212,     0,   213,   215,     0,   218,     0,
-    93,     0,     0,   185,     0,   219,     0,     0,   221,    94,
-    88,    89,    90,    91,    92,   108,   109,   110,   111,   112,
-   231,     0,   232,    93,   233,   217,     0,    88,    89,    90,
-    91,    92,    94,     0,   243,   205,   244,     0,   245,     0,
-    93,     0,     0,     0,   252,     0,   253,     0,   254,    94,
-    95,     0,     0,     0,     0,   258,   168,   169,   170,   171,
-   172,   173,   174,   175,   176,   260,     2,     0,     3,     4,
-     5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-    15,    16,    17,    18,   214,   216,     0,    19,     0,    96,
-    97,     0,    98,    99,   100,   101,   102,     0,     0,    20,
-    21,   103,   104,    90,    91,    92,     0,    22,    23,    24,
-     0,   118,    25,    26,    93,     0,     0,     0,     0,     0,
-     0,     0,     0,    94,     0,     0,   202,   203,     3,     4,
-     5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-    15,    16,    17,    18,     0,     0,     0,    19,     0,    96,
-    97,     0,    98,    99,   100,   101,   102,     0,     0,    20,
-    21,   103,   104,     0,     0,     0,     0,    22,    23,    24,
-     0,   135,     0,    26,    35,     3,     4,     5,     6,     7,
-     8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
-    18,     0,     0,     0,    19,     0,     0,   106,   107,     0,
-   108,   109,   110,   111,   112,     0,    20,    21,     0,     0,
-     0,     0,     0,     0,    22,    23,    24,   195,    72,   124,
-    26,     0,     0,     0,     0,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,     0,     0,    85,
-     0,   200,    72,     0,    86,     0,     0,     0,   196,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,     0,     0,    85,     0,   222,    72,     0,    86,     0,
-     0,     0,   201,    73,    74,    75,    76,    77,    78,    79,
-    80,    81,    82,    83,    84,     0,     0,    85,     0,   224,
-    72,     0,    86,     0,     0,     0,   223,    73,    74,    75,
+    44,   126,    34,   128,    91,    92,    36,    40,     7,    90,
+    91,    92,    46,    86,    93,    47,    15,    51,    54,    56,
+    93,    60,    62,    94,    64,   102,    48,    49,    33,    94,
+   103,   104,   127,   117,   129,    39,    43,   105,    88,    89,
+    90,    91,    92,   167,    45,   130,   131,   132,   133,   102,
+   168,    93,    50,    67,   103,   104,   103,   104,    83,    84,
+    94,   105,    85,   105,   118,   136,   138,    86,   140,    94,
+   142,   143,   144,   145,   146,   147,   148,   149,   150,   151,
+   152,   153,   155,   156,   157,    85,   158,    31,    93,    68,
+    86,   165,   166,    69,    37,    41,   105,    94,   109,   110,
+   111,   112,   113,   178,   225,    52,   113,    70,    58,    61,
+    63,    71,    65,   186,   235,   160,   242,   243,   276,   251,
+   189,    32,     0,   252,   190,     0,   191,     0,    38,     0,
+     0,     0,     0,     0,   179,   180,   181,   182,   183,   184,
+   185,     0,    59,     0,     0,     0,    66,   188,     0,   120,
+     0,     0,     0,     0,   139,     0,   141,   107,   108,     0,
+   109,   110,   111,   112,   113,     0,     0,     0,     0,   154,
+     0,     0,     0,     0,   159,   161,   162,   163,   164,     0,
+   121,     0,     0,    88,    89,    90,    91,    92,    88,    89,
+    90,    91,    92,     0,   215,   216,    93,   217,   219,     0,
+   222,    93,     0,   187,   223,    94,    95,     0,     0,   224,
+    94,     0,   226,     0,   124,     0,   169,   170,   171,   172,
+   173,   174,   175,   176,   177,   238,     0,   239,   221,   240,
+     0,   241,    88,    89,    90,    91,    92,     0,     0,     0,
+     0,     0,   253,     0,   254,    93,   255,     0,   256,    88,
+    89,    90,    91,    92,    94,   265,     0,   266,   135,   267,
+     0,   268,    93,     0,     0,     0,     0,   201,     0,     0,
+   273,    94,     0,   107,   108,   209,   109,   110,   111,   112,
+   113,     0,     0,     0,     0,   218,   220,   204,   205,   275,
+     2,     0,     3,     4,     5,     6,     7,     8,     9,    10,
+    11,    12,    13,    14,    15,    16,    17,    18,     0,   200,
+     0,    19,    88,    89,    90,    91,    92,     0,     0,     0,
+     0,     0,     0,    20,    21,    93,     0,     0,     0,     0,
+     0,    22,    23,    24,    94,     0,    25,     0,    26,     3,
+     4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+    14,    15,    16,    17,    18,     0,     0,     0,    19,   107,
+   108,     0,   109,   110,   111,   112,   113,     0,     0,     0,
+    20,    21,     0,     0,     0,     0,     0,     0,    22,    23,
+    24,     0,   125,     0,     0,    26,    35,     3,     4,     5,
+     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
+    16,    17,    18,     0,     0,     0,    19,     0,   107,   108,
+     0,   109,   110,   111,   112,   113,     0,     0,    20,    21,
+     0,     0,     0,     0,     0,     0,    22,    23,    24,   115,
+    72,   137,     0,    26,     0,     0,     0,    73,    74,    75,
     76,    77,    78,    79,    80,    81,    82,    83,    84,     0,
-     0,    85,     0,   236,    72,     0,    86,     0,     0,     0,
-   225,    73,    74,    75,    76,    77,    78,    79,    80,    81,
-    82,    83,    84,     0,     0,    85,     0,   238,    72,     0,
-    86,     0,     0,     0,   237,    73,    74,    75,    76,    77,
+     0,    85,     0,   122,    72,     0,    86,     0,     0,     0,
+   116,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+    82,    83,    84,     0,     0,    85,     0,   212,    72,     0,
+    86,     0,     0,     0,   123,    73,    74,    75,    76,    77,
     78,    79,    80,    81,    82,    83,    84,     0,     0,    85,
-     0,   246,    72,     0,    86,     0,     0,     0,   239,    73,
+     0,   233,    72,     0,    86,     0,     0,     0,   213,    73,
     74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,     0,     0,    85,     0,   248,    72,     0,    86,     0,
-     0,     0,   247,    73,    74,    75,    76,    77,    78,    79,
-    80,    81,    82,    83,    84,     0,     0,    85,     0,   114,
-    72,     0,    86,     0,     0,     0,   249,    73,    74,    75,
+    84,     0,     0,    85,     0,   236,    72,     0,    86,     0,
+     0,     0,   234,    73,    74,    75,    76,    77,    78,    79,
+    80,    81,    82,    83,    84,     0,     0,    85,     0,   263,
+    72,     0,    86,     0,     0,     0,   237,    73,    74,    75,
     76,    77,    78,    79,    80,    81,    82,    83,    84,     0,
-     0,    85,   121,    72,     0,     0,    86,     0,     0,   115,
-    73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
-    83,    84,     0,     0,    85,   208,    72,     0,     0,    86,
-     0,     0,   122,    73,    74,    75,    76,    77,    78,    79,
-    80,    81,    82,    83,    84,     0,     0,    85,   226,    72,
-     0,     0,    86,     0,     0,   209,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,     0,     0,
-    85,   229,    72,     0,     0,    86,     0,     0,   227,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,     0,     0,    85,   250,    72,     0,     0,    86,     0,
-     0,   230,    73,    74,    75,    76,    77,    78,    79,    80,
-    81,    82,    83,    84,     0,     0,    85,     0,    72,     0,
-     0,    86,     0,     0,   251,    73,    74,    75,    76,    77,
+     0,    85,     0,     0,    72,     0,    86,     0,     0,     0,
+   264,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+    82,    83,    84,     0,     0,    85,     0,     0,    72,     0,
+    86,     0,     0,     0,   134,    73,    74,    75,    76,    77,
     78,    79,    80,    81,    82,    83,    84,     0,     0,    85,
-     0,     0,    72,     0,    86,     0,     0,     0,   255,    73,
+     0,     0,    72,     0,    86,     0,     0,     0,   208,    73,
     74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,     0,     0,    85,     0,     0,    72,     0,    86,     0,
-     0,     0,   256,    73,    74,    75,    76,    77,    78,    79,
-    80,    81,    82,    83,    84,     0,     0,    85,     0,    72,
-     0,     0,    86,     0,     0,   133,    73,    74,    75,    76,
+    84,     0,     0,    85,     0,   197,    72,     0,    86,     0,
+     0,     0,   274,    73,    74,    75,    76,    77,    78,    79,
+    80,    81,    82,    83,    84,     0,     0,    85,   202,    72,
+     0,     0,    86,     0,   198,     0,    73,    74,    75,    76,
     77,    78,    79,    80,    81,    82,    83,    84,     0,     0,
-    85,     0,    72,     0,     0,    86,     0,     0,   204,    73,
+    85,   206,    72,     0,     0,    86,     0,   203,     0,    73,
     74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,     0,     0,    85,     0,    72,     0,     0,    86,     0,
-     0,   259,    73,    74,    75,    76,    77,    78,    79,    80,
-    81,    82,    83,    84,     0,     0,    85,   207,    72,     0,
-     0,    86,    87,     0,     0,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,   210,    72,    85,
-     0,     0,     0,     0,    86,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,   240,    72,    85,
-     0,     0,     0,     0,    86,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,   257,    72,    85,
-     0,     0,     0,     0,    86,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,     0,    72,    85,
-     0,   190,     0,     0,    86,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,     0,    72,    85,
-     0,   191,     0,     0,    86,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,     0,    72,    85,
-     0,   192,     0,     0,    86,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,     0,    72,    85,
-     0,   193,     0,     0,    86,    73,    74,    75,    76,    77,
+    84,     0,     0,    85,   227,    72,     0,     0,    86,     0,
+   207,     0,    73,    74,    75,    76,    77,    78,    79,    80,
+    81,    82,    83,    84,     0,     0,    85,   229,    72,     0,
+     0,    86,     0,   228,     0,    73,    74,    75,    76,    77,
     78,    79,    80,    81,    82,    83,    84,     0,     0,    85,
-    72,   194,     0,     0,    86,     0,     0,    73,    74,    75,
+   231,    72,     0,     0,    86,     0,   230,     0,    73,    74,
+    75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
+     0,     0,    85,   244,    72,     0,     0,    86,     0,   232,
+     0,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+    82,    83,    84,     0,     0,    85,   246,    72,     0,     0,
+    86,     0,   245,     0,    73,    74,    75,    76,    77,    78,
+    79,    80,    81,    82,    83,    84,     0,     0,    85,   248,
+    72,     0,     0,    86,     0,   247,     0,    73,    74,    75,
     76,    77,    78,    79,    80,    81,    82,    83,    84,     0,
-     0,    85,    72,   197,     0,     0,    86,     0,     0,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,     0,    72,    85,     0,     0,     0,     0,    86,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,     0,     0,    85,     0,     0,   106,   107,    86,   108,
-   109,   110,   111,   112,   106,   107,     0,   108,   109,   110,
-   111,   112,    88,    89,    90,    91,    92,     0,   136,     0,
-     0,    91,    92,     0,     0,    93,   206,     0,     0,     0,
-     0,    93,    96,    97,    94,    98,    99,   100,   101,   102,
-    94,     0,     0,     0,   103,   104,     0,     0,     0,     0,
-   106,   107,   105,   108,   109,   110,   111,   112,    73,    74,
+     0,    85,   257,    72,     0,     0,    86,     0,   249,     0,
+    73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
+    83,    84,     0,     0,    85,   259,    72,     0,     0,    86,
+     0,   258,     0,    73,    74,    75,    76,    77,    78,    79,
+    80,    81,    82,    83,    84,     0,     0,    85,   261,    72,
+     0,     0,    86,     0,   260,     0,    73,    74,    75,    76,
+    77,    78,    79,    80,    81,    82,    83,    84,     0,     0,
+    85,    72,     0,     0,     0,    86,     0,   262,    73,    74,
     75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
-   113,     0,    85,     0,     0,     0,     0,    86,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,     0,     0,    85,
-     0,     0,    96,    97,    86,    98,    99,   100,   101,   102,
-   199,     0,     0,     0,   103,   104,   106,   107,     0,   108,
-   109,   110,   111,   112,    80,    81,    82,    83,    84,     0,
-     0,    85,     0,     0,     0,     0,    86
+     0,     0,    85,    72,     0,     0,     0,    86,     0,   269,
+    73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
+    83,    84,     0,     0,    85,    72,     0,     0,     0,    86,
+     0,   270,    73,    74,    75,    76,    77,    78,    79,    80,
+    81,    82,    83,    84,     0,     0,    85,    72,     0,     0,
+     0,    86,     0,   271,    73,    74,    75,    76,    77,    78,
+    79,    80,    81,    82,    83,    84,     0,     0,    85,   211,
+    72,     0,     0,    86,    87,     0,     0,    73,    74,    75,
+    76,    77,    78,    79,    80,    81,    82,    83,    84,   214,
+    72,    85,     0,     0,     0,     0,    86,    73,    74,    75,
+    76,    77,    78,    79,    80,    81,    82,    83,    84,   250,
+    72,    85,     0,     0,     0,     0,    86,    73,    74,    75,
+    76,    77,    78,    79,    80,    81,    82,    83,    84,   272,
+    72,    85,     0,     0,     0,     0,    86,    73,    74,    75,
+    76,    77,    78,    79,    80,    81,    82,    83,    84,     0,
+    72,    85,     0,   192,     0,     0,    86,    73,    74,    75,
+    76,    77,    78,    79,    80,    81,    82,    83,    84,     0,
+    72,    85,     0,   193,     0,     0,    86,    73,    74,    75,
+    76,    77,    78,    79,    80,    81,    82,    83,    84,     0,
+    72,    85,     0,   194,     0,     0,    86,    73,    74,    75,
+    76,    77,    78,    79,    80,    81,    82,    83,    84,     0,
+    72,    85,     0,   195,     0,     0,    86,    73,    74,    75,
+    76,    77,    78,    79,    80,    81,    82,    83,    84,     0,
+     0,    85,    72,   196,     0,     0,    86,     0,     0,    73,
+    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
+    84,     0,     0,    85,    72,   199,     0,     0,    86,     0,
+     0,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+    82,    83,    84,     0,    72,    85,     0,     0,     0,     0,
+    86,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+    82,    83,    84,     0,     0,    85,     0,     0,    96,    97,
+    86,    98,    99,   100,   101,   102,     0,     0,     0,     0,
+   103,   104,     0,     0,     0,     0,     0,   105,     0,    96,
+    97,   119,    98,    99,   100,   101,   102,     0,     0,     0,
+     0,   103,   104,     0,     0,     0,     0,     0,   105,     0,
+   107,   108,   136,   109,   110,   111,   112,   113,    88,    89,
+    90,    91,    92,    96,    97,     0,    98,    99,   100,   101,
+   102,    93,     0,   210,     0,   103,   104,     0,     0,     0,
+    94,     0,   105,   106,   107,   108,     0,   109,   110,   111,
+   112,   113,    73,    74,    75,    76,    77,    78,    79,    80,
+    81,    82,    83,    84,   114,     0,    85,     0,     0,    96,
+    97,    86,    98,    99,   100,   101,   102,     0,     0,     0,
+     0,   103,   104,     0,     0,     0,     0,     0,   105,    76,
+    77,    78,    79,    80,    81,    82,    83,    84,     0,     0,
+    85,     0,     0,     0,     0,    86,    80,    81,    82,    83,
+    84,     0,     0,    85,     0,     0,   107,   108,    86,   109,
+   110,   111,   112,   113
 };
 
 static const short ffcheck[] = {     1,
-     6,    39,    40,     7,    37,    38,     8,     9,    41,    19,
-    19,    15,    47,    46,     6,    41,    37,    19,    20,    21,
-    46,    23,    24,    19,    26,    46,    46,     1,    24,    25,
-    26,    27,    28,    19,     8,     9,    34,    23,    42,    49,
-    49,    37,    22,    49,    48,    47,    48,    49,    50,    34,
-    46,    46,    26,    49,    39,    40,    27,    28,    22,    30,
-    31,    32,    33,    34,    49,    19,    68,    22,    70,    23,
+     6,    19,    47,    19,    27,    28,     8,     9,     7,    26,
+    27,    28,     6,    46,    37,    22,    15,    19,    20,    21,
+    37,    23,    24,    46,    26,    34,    22,    22,     1,    46,
+    39,    40,    50,    19,    50,     8,     9,    46,    24,    25,
+    26,    27,    28,    42,    50,    47,    48,    49,    50,    34,
+    49,    37,    22,    26,    39,    40,    39,    40,    37,    38,
+    46,    46,    41,    46,    50,    50,    68,    46,    70,    46,
     72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
-    82,    83,    84,    85,    86,    22,    88,     6,     1,    19,
-    19,    93,    94,    49,     6,     8,     9,     6,    27,    28,
-    49,    30,    31,    32,    33,    34,    19,     0,    -1,    22,
-    23,    24,   114,    26,    88,    -1,    34,    -1,    -1,   121,
-    49,    39,    40,   125,    -1,   127,    24,    25,    26,    27,
-    28,    -1,   106,   107,   108,   109,   110,   111,   112,    37,
-    24,    25,    26,    27,    28,   119,    -1,    -1,    46,    -1,
-    -1,    49,    -1,    37,    -1,    68,    -1,    70,    -1,    -1,
-    -1,     1,    46,    -1,    -1,    49,    -1,    -1,     8,    -1,
-    83,    -1,    -1,    -1,    -1,    88,    89,    90,    91,    92,
-    -1,    -1,    22,    -1,    21,    -1,    26,    24,    25,    26,
-    27,    28,   194,   195,    -1,   197,   198,    -1,   200,    -1,
-    37,    -1,    -1,   116,    -1,   207,    -1,    -1,   210,    46,
-    24,    25,    26,    27,    28,    30,    31,    32,    33,    34,
-   222,    -1,   224,    37,   226,   199,    -1,    24,    25,    26,
-    27,    28,    46,    -1,   236,    49,   238,    -1,   240,    -1,
-    37,    -1,    -1,    -1,   246,    -1,   248,    -1,   250,    46,
-    47,    -1,    -1,    -1,    -1,   257,    96,    97,    98,    99,
-   100,   101,   102,   103,   104,     0,     1,    -1,     3,     4,
-     5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-    15,    16,    17,    18,   197,   198,    -1,    22,    -1,    27,
-    28,    -1,    30,    31,    32,    33,    34,    -1,    -1,    34,
-    35,    39,    40,    26,    27,    28,    -1,    42,    43,    44,
-    -1,    49,    47,    48,    37,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    46,    -1,    -1,   166,   167,     3,     4,
-     5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-    15,    16,    17,    18,    -1,    -1,    -1,    22,    -1,    27,
-    28,    -1,    30,    31,    32,    33,    34,    -1,    -1,    34,
-    35,    39,    40,    -1,    -1,    -1,    -1,    42,    43,    44,
-    -1,    49,    -1,    48,    49,     3,     4,     5,     6,     7,
-     8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
-    18,    -1,    -1,    -1,    22,    -1,    -1,    27,    28,    -1,
-    30,    31,    32,    33,    34,    -1,    34,    35,    -1,    -1,
-    -1,    -1,    -1,    -1,    42,    43,    44,    19,    20,    49,
-    48,    -1,    -1,    -1,    -1,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    -1,    -1,    41,
-    -1,    19,    20,    -1,    46,    -1,    -1,    -1,    50,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    -1,    -1,    41,    -1,    19,    20,    -1,    46,    -1,
-    -1,    -1,    50,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    -1,    -1,    41,    -1,    19,
-    20,    -1,    46,    -1,    -1,    -1,    50,    27,    28,    29,
+    82,    83,    84,    85,    86,    41,    88,     1,    37,    19,
+    46,    93,    94,    23,     8,     9,    46,    46,    30,    31,
+    32,    33,    34,   105,     6,    19,    34,    19,    22,    23,
+    24,    23,    26,   115,    19,    88,     6,     6,     0,    50,
+   122,     1,    -1,    50,   126,    -1,   128,    -1,     8,    -1,
+    -1,    -1,    -1,    -1,   107,   108,   109,   110,   111,   112,
+   113,    -1,    22,    -1,    -1,    -1,    26,   120,    -1,    19,
+    -1,    -1,    -1,    -1,    68,    -1,    70,    27,    28,    -1,
+    30,    31,    32,    33,    34,    -1,    -1,    -1,    -1,    83,
+    -1,    -1,    -1,    -1,    88,    89,    90,    91,    92,    -1,
+    50,    -1,    -1,    24,    25,    26,    27,    28,    24,    25,
+    26,    27,    28,    -1,   196,   197,    37,   199,   200,    -1,
+   202,    37,    -1,   117,   206,    46,    47,    -1,    -1,   211,
+    46,    -1,   214,    -1,    50,    -1,    96,    97,    98,    99,
+   100,   101,   102,   103,   104,   227,    -1,   229,   201,   231,
+    -1,   233,    24,    25,    26,    27,    28,    -1,    -1,    -1,
+    -1,    -1,   244,    -1,   246,    37,   248,    -1,   250,    24,
+    25,    26,    27,    28,    46,   257,    -1,   259,    50,   261,
+    -1,   263,    37,    -1,    -1,    -1,    -1,    21,    -1,    -1,
+   272,    46,    -1,    27,    28,    50,    30,    31,    32,    33,
+    34,    -1,    -1,    -1,    -1,   199,   200,   167,   168,     0,
+     1,    -1,     3,     4,     5,     6,     7,     8,     9,    10,
+    11,    12,    13,    14,    15,    16,    17,    18,    -1,    21,
+    -1,    22,    24,    25,    26,    27,    28,    -1,    -1,    -1,
+    -1,    -1,    -1,    34,    35,    37,    -1,    -1,    -1,    -1,
+    -1,    42,    43,    44,    46,    -1,    47,    -1,    49,     3,
+     4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+    14,    15,    16,    17,    18,    -1,    -1,    -1,    22,    27,
+    28,    -1,    30,    31,    32,    33,    34,    -1,    -1,    -1,
+    34,    35,    -1,    -1,    -1,    -1,    -1,    -1,    42,    43,
+    44,    -1,    50,    -1,    -1,    49,    50,     3,     4,     5,
+     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
+    16,    17,    18,    -1,    -1,    -1,    22,    -1,    27,    28,
+    -1,    30,    31,    32,    33,    34,    -1,    -1,    34,    35,
+    -1,    -1,    -1,    -1,    -1,    -1,    42,    43,    44,    19,
+    20,    50,    -1,    49,    -1,    -1,    -1,    27,    28,    29,
     30,    31,    32,    33,    34,    35,    36,    37,    38,    -1,
     -1,    41,    -1,    19,    20,    -1,    46,    -1,    -1,    -1,
     50,    27,    28,    29,    30,    31,    32,    33,    34,    35,
@@ -651,72 +682,92 @@ static const short ffcheck[] = {     1,
     34,    35,    36,    37,    38,    -1,    -1,    41,    -1,    19,
     20,    -1,    46,    -1,    -1,    -1,    50,    27,    28,    29,
     30,    31,    32,    33,    34,    35,    36,    37,    38,    -1,
-    -1,    41,    19,    20,    -1,    -1,    46,    -1,    -1,    49,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    -1,    -1,    41,    19,    20,    -1,    -1,    46,
-    -1,    -1,    49,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    -1,    -1,    41,    19,    20,
-    -1,    -1,    46,    -1,    -1,    49,    27,    28,    29,    30,
-    31,    32,    33,    34,    35,    36,    37,    38,    -1,    -1,
-    41,    19,    20,    -1,    -1,    46,    -1,    -1,    49,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    -1,    -1,    41,    19,    20,    -1,    -1,    46,    -1,
-    -1,    49,    27,    28,    29,    30,    31,    32,    33,    34,
-    35,    36,    37,    38,    -1,    -1,    41,    -1,    20,    -1,
-    -1,    46,    -1,    -1,    49,    27,    28,    29,    30,    31,
+    -1,    41,    -1,    -1,    20,    -1,    46,    -1,    -1,    -1,
+    50,    27,    28,    29,    30,    31,    32,    33,    34,    35,
+    36,    37,    38,    -1,    -1,    41,    -1,    -1,    20,    -1,
+    46,    -1,    -1,    -1,    50,    27,    28,    29,    30,    31,
     32,    33,    34,    35,    36,    37,    38,    -1,    -1,    41,
     -1,    -1,    20,    -1,    46,    -1,    -1,    -1,    50,    27,
     28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    -1,    -1,    41,    -1,    -1,    20,    -1,    46,    -1,
+    38,    -1,    -1,    41,    -1,    19,    20,    -1,    46,    -1,
     -1,    -1,    50,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    -1,    -1,    41,    -1,    20,
-    -1,    -1,    46,    -1,    -1,    49,    27,    28,    29,    30,
+    34,    35,    36,    37,    38,    -1,    -1,    41,    19,    20,
+    -1,    -1,    46,    -1,    48,    -1,    27,    28,    29,    30,
     31,    32,    33,    34,    35,    36,    37,    38,    -1,    -1,
-    41,    -1,    20,    -1,    -1,    46,    -1,    -1,    49,    27,
+    41,    19,    20,    -1,    -1,    46,    -1,    48,    -1,    27,
     28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    -1,    -1,    41,    -1,    20,    -1,    -1,    46,    -1,
-    -1,    49,    27,    28,    29,    30,    31,    32,    33,    34,
+    38,    -1,    -1,    41,    19,    20,    -1,    -1,    46,    -1,
+    48,    -1,    27,    28,    29,    30,    31,    32,    33,    34,
     35,    36,    37,    38,    -1,    -1,    41,    19,    20,    -1,
-    -1,    46,    47,    -1,    -1,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    19,    20,    41,
-    -1,    -1,    -1,    -1,    46,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    19,    20,    41,
-    -1,    -1,    -1,    -1,    46,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    19,    20,    41,
-    -1,    -1,    -1,    -1,    46,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    -1,    20,    41,
-    -1,    23,    -1,    -1,    46,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    -1,    20,    41,
-    -1,    23,    -1,    -1,    46,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    -1,    20,    41,
-    -1,    23,    -1,    -1,    46,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    -1,    20,    41,
-    -1,    23,    -1,    -1,    46,    27,    28,    29,    30,    31,
+    -1,    46,    -1,    48,    -1,    27,    28,    29,    30,    31,
     32,    33,    34,    35,    36,    37,    38,    -1,    -1,    41,
-    20,    21,    -1,    -1,    46,    -1,    -1,    27,    28,    29,
+    19,    20,    -1,    -1,    46,    -1,    48,    -1,    27,    28,
+    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
+    -1,    -1,    41,    19,    20,    -1,    -1,    46,    -1,    48,
+    -1,    27,    28,    29,    30,    31,    32,    33,    34,    35,
+    36,    37,    38,    -1,    -1,    41,    19,    20,    -1,    -1,
+    46,    -1,    48,    -1,    27,    28,    29,    30,    31,    32,
+    33,    34,    35,    36,    37,    38,    -1,    -1,    41,    19,
+    20,    -1,    -1,    46,    -1,    48,    -1,    27,    28,    29,
+    30,    31,    32,    33,    34,    35,    36,    37,    38,    -1,
+    -1,    41,    19,    20,    -1,    -1,    46,    -1,    48,    -1,
+    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
+    37,    38,    -1,    -1,    41,    19,    20,    -1,    -1,    46,
+    -1,    48,    -1,    27,    28,    29,    30,    31,    32,    33,
+    34,    35,    36,    37,    38,    -1,    -1,    41,    19,    20,
+    -1,    -1,    46,    -1,    48,    -1,    27,    28,    29,    30,
+    31,    32,    33,    34,    35,    36,    37,    38,    -1,    -1,
+    41,    20,    -1,    -1,    -1,    46,    -1,    48,    27,    28,
+    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
+    -1,    -1,    41,    20,    -1,    -1,    -1,    46,    -1,    48,
+    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
+    37,    38,    -1,    -1,    41,    20,    -1,    -1,    -1,    46,
+    -1,    48,    27,    28,    29,    30,    31,    32,    33,    34,
+    35,    36,    37,    38,    -1,    -1,    41,    20,    -1,    -1,
+    -1,    46,    -1,    48,    27,    28,    29,    30,    31,    32,
+    33,    34,    35,    36,    37,    38,    -1,    -1,    41,    19,
+    20,    -1,    -1,    46,    47,    -1,    -1,    27,    28,    29,
+    30,    31,    32,    33,    34,    35,    36,    37,    38,    19,
+    20,    41,    -1,    -1,    -1,    -1,    46,    27,    28,    29,
+    30,    31,    32,    33,    34,    35,    36,    37,    38,    19,
+    20,    41,    -1,    -1,    -1,    -1,    46,    27,    28,    29,
+    30,    31,    32,    33,    34,    35,    36,    37,    38,    19,
+    20,    41,    -1,    -1,    -1,    -1,    46,    27,    28,    29,
+    30,    31,    32,    33,    34,    35,    36,    37,    38,    -1,
+    20,    41,    -1,    23,    -1,    -1,    46,    27,    28,    29,
+    30,    31,    32,    33,    34,    35,    36,    37,    38,    -1,
+    20,    41,    -1,    23,    -1,    -1,    46,    27,    28,    29,
+    30,    31,    32,    33,    34,    35,    36,    37,    38,    -1,
+    20,    41,    -1,    23,    -1,    -1,    46,    27,    28,    29,
+    30,    31,    32,    33,    34,    35,    36,    37,    38,    -1,
+    20,    41,    -1,    23,    -1,    -1,    46,    27,    28,    29,
     30,    31,    32,    33,    34,    35,    36,    37,    38,    -1,
     -1,    41,    20,    21,    -1,    -1,    46,    -1,    -1,    27,
     28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    -1,    20,    41,    -1,    -1,    -1,    -1,    46,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
+    38,    -1,    -1,    41,    20,    21,    -1,    -1,    46,    -1,
+    -1,    27,    28,    29,    30,    31,    32,    33,    34,    35,
+    36,    37,    38,    -1,    20,    41,    -1,    -1,    -1,    -1,
+    46,    27,    28,    29,    30,    31,    32,    33,    34,    35,
+    36,    37,    38,    -1,    -1,    41,    -1,    -1,    27,    28,
+    46,    30,    31,    32,    33,    34,    -1,    -1,    -1,    -1,
+    39,    40,    -1,    -1,    -1,    -1,    -1,    46,    -1,    27,
+    28,    50,    30,    31,    32,    33,    34,    -1,    -1,    -1,
+    -1,    39,    40,    -1,    -1,    -1,    -1,    -1,    46,    -1,
+    27,    28,    50,    30,    31,    32,    33,    34,    24,    25,
+    26,    27,    28,    27,    28,    -1,    30,    31,    32,    33,
+    34,    37,    -1,    50,    -1,    39,    40,    -1,    -1,    -1,
+    46,    -1,    46,    47,    27,    28,    -1,    30,    31,    32,
+    33,    34,    27,    28,    29,    30,    31,    32,    33,    34,
+    35,    36,    37,    38,    47,    -1,    41,    -1,    -1,    27,
+    28,    46,    30,    31,    32,    33,    34,    -1,    -1,    -1,
+    -1,    39,    40,    -1,    -1,    -1,    -1,    -1,    46,    30,
+    31,    32,    33,    34,    35,    36,    37,    38,    -1,    -1,
+    41,    -1,    -1,    -1,    -1,    46,    34,    35,    36,    37,
     38,    -1,    -1,    41,    -1,    -1,    27,    28,    46,    30,
-    31,    32,    33,    34,    27,    28,    -1,    30,    31,    32,
-    33,    34,    24,    25,    26,    27,    28,    -1,    49,    -1,
-    -1,    27,    28,    -1,    -1,    37,    49,    -1,    -1,    -1,
-    -1,    37,    27,    28,    46,    30,    31,    32,    33,    34,
-    46,    -1,    -1,    -1,    39,    40,    -1,    -1,    -1,    -1,
-    27,    28,    47,    30,    31,    32,    33,    34,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    47,    -1,    41,    -1,    -1,    -1,    -1,    46,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    -1,    -1,    41,
-    -1,    -1,    27,    28,    46,    30,    31,    32,    33,    34,
-    21,    -1,    -1,    -1,    39,    40,    27,    28,    -1,    30,
-    31,    32,    33,    34,    34,    35,    36,    37,    38,    -1,
-    -1,    41,    -1,    -1,    -1,    -1,    46
+    31,    32,    33,    34
 };
 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/usr/lib/bison.simple"
-/* This file comes from bison-1.27.  */
+#line 3 "/usr1/local/share/bison.simple"
 
 /* Skeleton output parser for bison,
    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -733,66 +784,46 @@ static const short ffcheck[] = {     1,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* As a special exception, when this file is copied by Bison into a
    Bison output file, you may use that output file without restriction.
    This special exception was added by the Free Software Foundation
    in version 1.24 of Bison.  */
 
-/* This is the parser code that is written into each bison parser
-  when the %semantic_parser declaration is not specified in the grammar.
-  It was written by Richard Stallman by simplifying the hairy parser
-  used when %semantic_parser is specified.  */
-
-#ifndef FFSTACK_USE_ALLOCA
-#ifdef alloca
-#define FFSTACK_USE_ALLOCA
-#else /* alloca not defined */
+#ifndef alloca
 #ifdef __GNUC__
-#define FFSTACK_USE_ALLOCA
 #define alloca __builtin_alloca
 #else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define FFSTACK_USE_ALLOCA
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
 #include <alloca.h>
 #else /* not sparc */
-/* We think this test detects Watcom and Microsoft C.  */
-/* This used to test MSDOS, but that is a bad idea
-   since that symbol is in the user namespace.  */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
-	 instead, just don't use alloca.  */
+#if defined (MSDOS) && !defined (__TURBOC__)
 #include <malloc.h>
-#endif
 #else /* not MSDOS, or __TURBOC__ */
 #if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
-   So I turned it off.   rms, 2 May 1997.  */
-/* #include <malloc.h>  */
+#include <malloc.h>
  #pragma alloca
-#define FFSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
-		 and on HPUX 10.  Eventually we can turn this on.  */
-#define FFSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
+#else /* not MSDOS, __TURBOC__, or _AIX */
+#ifdef __hpux
+#ifdef __cplusplus
+extern "C" {
+void *alloca (unsigned int);
+};
+#else /* not __cplusplus */
+void *alloca ();
+#endif /* not __cplusplus */
 #endif /* __hpux */
-#endif
 #endif /* not _AIX */
 #endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* FFSTACK_USE_ALLOCA not defined */
+#endif /* not sparc.  */
+#endif /* not GNU C.  */
+#endif /* alloca not defined.  */
 
-#ifdef FFSTACK_USE_ALLOCA
-#define FFSTACK_ALLOC alloca
-#else
-#define FFSTACK_ALLOC malloc
-#endif
+/* This is the parser code that is written into each bison parser
+  when the %semantic_parser declaration is not specified in the grammar.
+  It was written by Richard Stallman by simplifying the hairy parser
+  used when %semantic_parser is specified.  */
 
 /* Note: there must be only one dollar sign in this file.
    It is replaced by the list of actions, each action
@@ -802,8 +833,8 @@ static const short ffcheck[] = {     1,
 #define ffclearin	(ffchar = FFEMPTY)
 #define FFEMPTY		-2
 #define FFEOF		0
-#define FFACCEPT	goto ffacceptlab
-#define FFABORT 	goto ffabortlab
+#define FFACCEPT	return(0)
+#define FFABORT 	return(1)
 #define FFERROR		goto fferrlab1
 /* Like FFERROR except do call fferror.
    This remains here temporarily to ease the
@@ -884,12 +915,12 @@ int ffdebug;			/*  nonzero means print parse trace	*/
 #ifndef FFMAXDEPTH
 #define FFMAXDEPTH 10000
 #endif
-
-/* Define __ff_memcpy.  Note that the size argument
-   should be passed with type unsigned int, because that is what the non-GCC
-   definitions require.  With GCC, __builtin_memcpy takes an arg
-   of type size_t, but it can handle unsigned int.  */
 
+/* Prevent warning if -Wstrict-prototypes.  */
+#ifdef __GNUC__
+int ffparse (void);
+#endif
+
 #if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
 #define __ff_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
 #else				/* not GNU C or C++ */
@@ -901,7 +932,7 @@ static void
 __ff_memcpy (to, from, count)
      char *to;
      char *from;
-     unsigned int count;
+     int count;
 {
   register char *f = from;
   register char *t = to;
@@ -916,10 +947,10 @@ __ff_memcpy (to, from, count)
 /* This is the most reliable way to avoid incompatibilities
    in available built-in functions on various systems.  */
 static void
-__ff_memcpy (char *to, char *from, unsigned int count)
+__ff_memcpy (char *to, char *from, int count)
 {
-  register char *t = to;
   register char *f = from;
+  register char *t = to;
   register int i = count;
 
   while (i-- > 0)
@@ -929,7 +960,7 @@ __ff_memcpy (char *to, char *from, unsigned int count)
 #endif
 #endif
 
-#line 216 "/usr/lib/bison.simple"
+#line 196 "/usr1/local/share/bison.simple"
 
 /* The user can define FFPARSE_PARAM as the name of an argument to be passed
    into ffparse.  The argument should have type void *.
@@ -950,15 +981,6 @@ __ff_memcpy (char *to, char *from, unsigned int count)
 #define FFPARSE_PARAM_DECL
 #endif /* not FFPARSE_PARAM */
 
-/* Prevent warning if -Wstrict-prototypes.  */
-#ifdef __GNUC__
-#ifdef FFPARSE_PARAM
-int ffparse (void *);
-#else
-int ffparse (void);
-#endif
-#endif
-
 int
 ffparse(FFPARSE_PARAM_ARG)
      FFPARSE_PARAM_DECL
@@ -987,7 +1009,6 @@ ffparse(FFPARSE_PARAM_ARG)
 #endif
 
   int ffstacksize = FFINITDEPTH;
-  int fffree_stacks = 0;
 
 #ifdef FFPURE
   int ffchar;
@@ -1072,32 +1093,18 @@ ffnewstate:
       if (ffstacksize >= FFMAXDEPTH)
 	{
 	  fferror("parser stack overflow");
-	  if (fffree_stacks)
-	    {
-	      free (ffss);
-	      free (ffvs);
-#ifdef FFLSP_NEEDED
-	      free (ffls);
-#endif
-	    }
 	  return 2;
 	}
       ffstacksize *= 2;
       if (ffstacksize > FFMAXDEPTH)
 	ffstacksize = FFMAXDEPTH;
-#ifndef FFSTACK_USE_ALLOCA
-      fffree_stacks = 1;
-#endif
-      ffss = (short *) FFSTACK_ALLOC (ffstacksize * sizeof (*ffssp));
-      __ff_memcpy ((char *)ffss, (char *)ffss1,
-		   size * (unsigned int) sizeof (*ffssp));
-      ffvs = (FFSTYPE *) FFSTACK_ALLOC (ffstacksize * sizeof (*ffvsp));
-      __ff_memcpy ((char *)ffvs, (char *)ffvs1,
-		   size * (unsigned int) sizeof (*ffvsp));
+      ffss = (short *) alloca (ffstacksize * sizeof (*ffssp));
+      __ff_memcpy ((char *)ffss, (char *)ffss1, size * sizeof (*ffssp));
+      ffvs = (FFSTYPE *) alloca (ffstacksize * sizeof (*ffvsp));
+      __ff_memcpy ((char *)ffvs, (char *)ffvs1, size * sizeof (*ffvsp));
 #ifdef FFLSP_NEEDED
-      ffls = (FFLTYPE *) FFSTACK_ALLOC (ffstacksize * sizeof (*fflsp));
-      __ff_memcpy ((char *)ffls, (char *)ffls1,
-		   size * (unsigned int) sizeof (*fflsp));
+      ffls = (FFLTYPE *) alloca (ffstacksize * sizeof (*fflsp));
+      __ff_memcpy ((char *)ffls, (char *)ffls1, size * sizeof (*fflsp));
 #endif
 #endif /* no ffoverflow */
 
@@ -1258,11 +1265,11 @@ ffreduce:
   switch (ffn) {
 
 case 3:
-#line 216 "eval.y"
+#line 227 "eval.y"
 {;
     break;}
 case 4:
-#line 218 "eval.y"
+#line 229 "eval.y"
 { if( ffvsp[-1].Node<0 ) {
 		     fferror("Couldn't build node structure: out of memory?");
 		     FFERROR;  }
@@ -1270,7 +1277,7 @@ case 4:
 		;
     break;}
 case 5:
-#line 224 "eval.y"
+#line 235 "eval.y"
 { if( ffvsp[-1].Node<0 ) {
 		     fferror("Couldn't build node structure: out of memory?");
 		     FFERROR;  }
@@ -1278,7 +1285,7 @@ case 5:
 		;
     break;}
 case 6:
-#line 230 "eval.y"
+#line 241 "eval.y"
 { if( ffvsp[-1].Node<0 ) {
 		     fferror("Couldn't build node structure: out of memory?");
 		     FFERROR;  } 
@@ -1286,7 +1293,7 @@ case 6:
 		;
     break;}
 case 7:
-#line 236 "eval.y"
+#line 247 "eval.y"
 { if( ffvsp[-1].Node<0 ) {
 		     fferror("Couldn't build node structure: out of memory?");
 		     FFERROR;  }
@@ -1294,15 +1301,15 @@ case 7:
 		;
     break;}
 case 8:
-#line 241 "eval.y"
+#line 252 "eval.y"
 {  fferrok;  ;
     break;}
 case 9:
-#line 245 "eval.y"
+#line 256 "eval.y"
 { ffval.Node = New_Vector( ffvsp[0].Node ); TEST(ffval.Node); ;
     break;}
 case 10:
-#line 247 "eval.y"
+#line 258 "eval.y"
 {
                   if( gParse.Nodes[ffvsp[-2].Node].nSubNodes >= MAXSUBS ) {
 		     ffvsp[-2].Node = Close_Vec( ffvsp[-2].Node ); TEST(ffvsp[-2].Node);
@@ -1315,11 +1322,11 @@ case 10:
                 ;
     break;}
 case 11:
-#line 260 "eval.y"
+#line 271 "eval.y"
 { ffval.Node = New_Vector( ffvsp[0].Node ); TEST(ffval.Node); ;
     break;}
 case 12:
-#line 262 "eval.y"
+#line 273 "eval.y"
 {
                   if( TYPE(ffvsp[-2].Node) < TYPE(ffvsp[0].Node) )
                      TYPE(ffvsp[-2].Node) = TYPE(ffvsp[0].Node);
@@ -1334,7 +1341,7 @@ case 12:
                 ;
     break;}
 case 13:
-#line 275 "eval.y"
+#line 286 "eval.y"
 {
                   if( gParse.Nodes[ffvsp[-2].Node].nSubNodes >= MAXSUBS ) {
 		     ffvsp[-2].Node = Close_Vec( ffvsp[-2].Node ); TEST(ffvsp[-2].Node);
@@ -1347,7 +1354,7 @@ case 13:
                 ;
     break;}
 case 14:
-#line 286 "eval.y"
+#line 297 "eval.y"
 {
                   TYPE(ffvsp[-2].Node) = TYPE(ffvsp[0].Node);
                   if( gParse.Nodes[ffvsp[-2].Node].nSubNodes >= MAXSUBS ) {
@@ -1361,26 +1368,26 @@ case 14:
                 ;
     break;}
 case 15:
-#line 300 "eval.y"
+#line 311 "eval.y"
 { ffval.Node = Close_Vec( ffvsp[-1].Node ); TEST(ffval.Node); ;
     break;}
 case 16:
-#line 304 "eval.y"
+#line 315 "eval.y"
 { ffval.Node = Close_Vec( ffvsp[-1].Node ); TEST(ffval.Node); ;
     break;}
 case 17:
-#line 308 "eval.y"
+#line 319 "eval.y"
 {
                   ffval.Node = New_Const( BITSTR, ffvsp[0].str, strlen(ffvsp[0].str)+1 ); TEST(ffval.Node);
 		  SIZE(ffval.Node) = strlen(ffvsp[0].str);
 		;
     break;}
 case 18:
-#line 313 "eval.y"
+#line 324 "eval.y"
 { ffval.Node = New_Column( ffvsp[0].lng ); TEST(ffval.Node); ;
     break;}
 case 19:
-#line 315 "eval.y"
+#line 326 "eval.y"
 {
                   if( TYPE(ffvsp[-1].Node) != LONG
 		      || gParse.Nodes[ffvsp[-1].Node].operation != CONST_OP ) {
@@ -1391,42 +1398,62 @@ case 19:
                 ;
     break;}
 case 20:
-#line 324 "eval.y"
+#line 335 "eval.y"
 { ffval.Node = New_BinOp( BITSTR, ffvsp[-2].Node, '&', ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = ( SIZE(ffvsp[-2].Node)>SIZE(ffvsp[0].Node) ? SIZE(ffvsp[-2].Node) : SIZE(ffvsp[0].Node) );  ;
     break;}
 case 21:
-#line 327 "eval.y"
+#line 338 "eval.y"
 { ffval.Node = New_BinOp( BITSTR, ffvsp[-2].Node, '|', ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = ( SIZE(ffvsp[-2].Node)>SIZE(ffvsp[0].Node) ? SIZE(ffvsp[-2].Node) : SIZE(ffvsp[0].Node) );  ;
     break;}
 case 22:
-#line 330 "eval.y"
+#line 341 "eval.y"
 { ffval.Node = New_BinOp( BITSTR, ffvsp[-2].Node, '+', ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = SIZE(ffvsp[-2].Node) + SIZE(ffvsp[0].Node);                          ;
     break;}
 case 23:
-#line 333 "eval.y"
-{ ffval.Node = New_Unary( BITSTR, NOT, ffvsp[0].Node ); TEST(ffval.Node);     ;
+#line 344 "eval.y"
+{ ffval.Node = New_Deref( ffvsp[-3].Node, 1, ffvsp[-1].Node,  0,  0,  0,   0 ); TEST(ffval.Node); ;
     break;}
 case 24:
-#line 336 "eval.y"
-{ ffval.Node = ffvsp[-1].Node; ;
+#line 346 "eval.y"
+{ ffval.Node = New_Deref( ffvsp[-5].Node, 2, ffvsp[-3].Node, ffvsp[-1].Node,  0,  0,   0 ); TEST(ffval.Node); ;
     break;}
 case 25:
-#line 340 "eval.y"
-{ ffval.Node = New_Const( LONG,   &(ffvsp[0].lng), sizeof(long)   ); TEST(ffval.Node); ;
+#line 348 "eval.y"
+{ ffval.Node = New_Deref( ffvsp[-7].Node, 3, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node,  0,   0 ); TEST(ffval.Node); ;
     break;}
 case 26:
-#line 342 "eval.y"
-{ ffval.Node = New_Const( DOUBLE, &(ffvsp[0].dbl), sizeof(double) ); TEST(ffval.Node); ;
+#line 350 "eval.y"
+{ ffval.Node = New_Deref( ffvsp[-9].Node, 4, ffvsp[-7].Node, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node,   0 ); TEST(ffval.Node); ;
     break;}
 case 27:
-#line 344 "eval.y"
-{ ffval.Node = New_Column( ffvsp[0].lng ); TEST(ffval.Node); ;
+#line 352 "eval.y"
+{ ffval.Node = New_Deref( ffvsp[-11].Node, 5, ffvsp[-9].Node, ffvsp[-7].Node, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node ); TEST(ffval.Node); ;
     break;}
 case 28:
-#line 346 "eval.y"
+#line 354 "eval.y"
+{ ffval.Node = New_Unary( BITSTR, NOT, ffvsp[0].Node ); TEST(ffval.Node);     ;
+    break;}
+case 29:
+#line 357 "eval.y"
+{ ffval.Node = ffvsp[-1].Node; ;
+    break;}
+case 30:
+#line 361 "eval.y"
+{ ffval.Node = New_Const( LONG,   &(ffvsp[0].lng), sizeof(long)   ); TEST(ffval.Node); ;
+    break;}
+case 31:
+#line 363 "eval.y"
+{ ffval.Node = New_Const( DOUBLE, &(ffvsp[0].dbl), sizeof(double) ); TEST(ffval.Node); ;
+    break;}
+case 32:
+#line 365 "eval.y"
+{ ffval.Node = New_Column( ffvsp[0].lng ); TEST(ffval.Node); ;
+    break;}
+case 33:
+#line 367 "eval.y"
 {
                   if( TYPE(ffvsp[-1].Node) != LONG
 		      || gParse.Nodes[ffvsp[-1].Node].operation != CONST_OP ) {
@@ -1436,70 +1463,70 @@ case 28:
                   ffval.Node = New_Offset( ffvsp[-3].lng, ffvsp[-1].Node ); TEST(ffval.Node);
                 ;
     break;}
-case 29:
-#line 355 "eval.y"
+case 34:
+#line 376 "eval.y"
 { ffval.Node = New_Func( LONG, row_fct,  0, 0, 0, 0, 0, 0, 0, 0 ); ;
     break;}
-case 30:
-#line 357 "eval.y"
+case 35:
+#line 378 "eval.y"
 { ffval.Node = New_Func( LONG, null_fct, 0, 0, 0, 0, 0, 0, 0, 0 ); ;
     break;}
-case 31:
-#line 359 "eval.y"
+case 36:
+#line 380 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( TYPE(ffvsp[-2].Node), ffvsp[-2].Node, '%', ffvsp[0].Node );
 		  TEST(ffval.Node);                                                ;
     break;}
-case 32:
-#line 362 "eval.y"
+case 37:
+#line 383 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( TYPE(ffvsp[-2].Node), ffvsp[-2].Node, '+', ffvsp[0].Node );
 		  TEST(ffval.Node);                                                ;
     break;}
-case 33:
-#line 365 "eval.y"
+case 38:
+#line 386 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( TYPE(ffvsp[-2].Node), ffvsp[-2].Node, '-', ffvsp[0].Node ); 
 		  TEST(ffval.Node);                                                ;
     break;}
-case 34:
-#line 368 "eval.y"
+case 39:
+#line 389 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( TYPE(ffvsp[-2].Node), ffvsp[-2].Node, '*', ffvsp[0].Node ); 
 		  TEST(ffval.Node);                                                ;
     break;}
-case 35:
-#line 371 "eval.y"
+case 40:
+#line 392 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( TYPE(ffvsp[-2].Node), ffvsp[-2].Node, '/', ffvsp[0].Node ); 
 		  TEST(ffval.Node);                                                ;
     break;}
-case 36:
-#line 374 "eval.y"
+case 41:
+#line 395 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( TYPE(ffvsp[-2].Node), ffvsp[-2].Node, POWER, ffvsp[0].Node );
 		  TEST(ffval.Node);                                                ;
     break;}
-case 37:
-#line 377 "eval.y"
+case 42:
+#line 398 "eval.y"
 { ffval.Node = ffvsp[0].Node; ;
     break;}
-case 38:
-#line 379 "eval.y"
+case 43:
+#line 400 "eval.y"
 { ffval.Node = New_Unary( TYPE(ffvsp[0].Node), UMINUS, ffvsp[0].Node ); TEST(ffval.Node); ;
     break;}
-case 39:
-#line 381 "eval.y"
+case 44:
+#line 402 "eval.y"
 { ffval.Node = ffvsp[-1].Node; ;
     break;}
-case 40:
-#line 383 "eval.y"
+case 45:
+#line 404 "eval.y"
 { ffvsp[0].Node = New_Unary( TYPE(ffvsp[-2].Node), 0, ffvsp[0].Node );
                   ffval.Node = New_BinOp( TYPE(ffvsp[-2].Node), ffvsp[-2].Node, '*', ffvsp[0].Node ); 
 		  TEST(ffval.Node);                                ;
     break;}
-case 41:
-#line 387 "eval.y"
+case 46:
+#line 408 "eval.y"
 { ffvsp[-2].Node = New_Unary( TYPE(ffvsp[0].Node), 0, ffvsp[-2].Node );
                   ffval.Node = New_BinOp( TYPE(ffvsp[0].Node), ffvsp[-2].Node, '*', ffvsp[0].Node );
                   TEST(ffval.Node);                                ;
     break;}
-case 42:
-#line 391 "eval.y"
+case 47:
+#line 412 "eval.y"
 {
                   PROMOTE(ffvsp[-2].Node,ffvsp[0].Node);
                   if( ! Test_Dims(ffvsp[-2].Node,ffvsp[0].Node) ) {
@@ -1519,8 +1546,8 @@ case 42:
                   if( SIZE(ffval.Node)<SIZE(ffvsp[-4].Node) )  Copy_Dims(ffval.Node, ffvsp[-4].Node);
                 ;
     break;}
-case 43:
-#line 410 "eval.y"
+case 48:
+#line 431 "eval.y"
 {
                   PROMOTE(ffvsp[-2].Node,ffvsp[0].Node);
                   if( ! Test_Dims(ffvsp[-2].Node,ffvsp[0].Node) ) {
@@ -1540,8 +1567,8 @@ case 43:
                   if( SIZE(ffval.Node)<SIZE(ffvsp[-4].Node) )  Copy_Dims(ffval.Node, ffvsp[-4].Node);
                 ;
     break;}
-case 44:
-#line 429 "eval.y"
+case 49:
+#line 450 "eval.y"
 {
                   PROMOTE(ffvsp[-2].Node,ffvsp[0].Node);
                   if( ! Test_Dims(ffvsp[-2].Node,ffvsp[0].Node) ) {
@@ -1561,8 +1588,8 @@ case 44:
                   if( SIZE(ffval.Node)<SIZE(ffvsp[-4].Node) )  Copy_Dims(ffval.Node, ffvsp[-4].Node);
                 ;
     break;}
-case 45:
-#line 448 "eval.y"
+case 50:
+#line 469 "eval.y"
 { if (FSTRCMP(ffvsp[-1].str,"RANDOM(") == 0) {
                      srand( (unsigned int) time(NULL) );
                      ffval.Node = New_Func( DOUBLE, rnd_fct, 0, 0, 0, 0, 0, 0, 0, 0 );
@@ -1573,8 +1600,8 @@ case 45:
                   TEST(ffval.Node); 
                 ;
     break;}
-case 46:
-#line 458 "eval.y"
+case 51:
+#line 479 "eval.y"
 { if (FSTRCMP(ffvsp[-2].str,"SUM(") == 0) {
 		     ffval.Node = New_Func( LONG, sum_fct, 1, ffvsp[-1].Node, 0, 0, 0, 0, 0, 0 );
                   } else if (FSTRCMP(ffvsp[-2].str,"NELEM(") == 0) {
@@ -1586,10 +1613,13 @@ case 46:
                   TEST(ffval.Node); 
 		;
     break;}
-case 47:
-#line 469 "eval.y"
+case 52:
+#line 490 "eval.y"
 { if (FSTRCMP(ffvsp[-2].str,"NELEM(") == 0) {
                      ffval.Node = New_Const( LONG, &( SIZE(ffvsp[-1].Node) ), sizeof(long) );
+		  } else if (FSTRCMP(ffvsp[-2].str,"NVALID(") == 0) {
+		     ffval.Node = New_Func( LONG, nonnull_fct, 1, ffvsp[-1].Node,
+				    0, 0, 0, 0, 0, 0 );
 		  } else {
                      fferror("Function(str) not supported");
 		     FFERROR;
@@ -1597,24 +1627,49 @@ case 47:
                   TEST(ffval.Node); 
 		;
     break;}
-case 48:
-#line 478 "eval.y"
+case 53:
+#line 502 "eval.y"
 { if (FSTRCMP(ffvsp[-2].str,"NELEM(") == 0) {
                      ffval.Node = New_Const( LONG, &( SIZE(ffvsp[-1].Node) ), sizeof(long) );
-		  } else {
+		} else if (FSTRCMP(ffvsp[-2].str,"NVALID(") == 0) { /* Bit arrays do not have NULL */
+                     ffval.Node = New_Const( LONG, &( SIZE(ffvsp[-1].Node) ), sizeof(long) );
+		} else if (FSTRCMP(ffvsp[-2].str,"SUM(") == 0) {
+		     ffval.Node = New_Func( LONG, sum_fct, 1, ffvsp[-1].Node,
+				    0, 0, 0, 0, 0, 0 );
+		} else if (FSTRCMP(ffvsp[-2].str,"MIN(") == 0) {
+		     ffval.Node = New_Func( TYPE(ffvsp[-1].Node),  /* Force 1D result */
+				    min1_fct, 1, ffvsp[-1].Node, 0, 0, 0, 0, 0, 0 );
+		     SIZE(ffval.Node) = 1;
+		} else if (FSTRCMP(ffvsp[-2].str,"MAX(") == 0) {
+		     ffval.Node = New_Func( TYPE(ffvsp[-1].Node),  /* Force 1D result */
+				    max1_fct, 1, ffvsp[-1].Node, 0, 0, 0, 0, 0, 0 );
+		     SIZE(ffval.Node) = 1;
+		} else {
                      fferror("Function(bits) not supported");
 		     FFERROR;
 		  }
                   TEST(ffval.Node); 
 		;
     break;}
-case 49:
-#line 487 "eval.y"
+case 54:
+#line 524 "eval.y"
 { if (FSTRCMP(ffvsp[-2].str,"SUM(") == 0)
 		     ffval.Node = New_Func( TYPE(ffvsp[-1].Node), sum_fct, 1, ffvsp[-1].Node,
 				    0, 0, 0, 0, 0, 0 );
+		  else if (FSTRCMP(ffvsp[-2].str,"AVERAGE(") == 0)
+		     ffval.Node = New_Func( DOUBLE, average_fct, 1, ffvsp[-1].Node,
+				    0, 0, 0, 0, 0, 0 );
+		  else if (FSTRCMP(ffvsp[-2].str,"STDDEV(") == 0)
+		     ffval.Node = New_Func( DOUBLE, stddev_fct, 1, ffvsp[-1].Node,
+				    0, 0, 0, 0, 0, 0 );
+		  else if (FSTRCMP(ffvsp[-2].str,"MEDIAN(") == 0)
+		     ffval.Node = New_Func( TYPE(ffvsp[-1].Node), median_fct, 1, ffvsp[-1].Node,
+				    0, 0, 0, 0, 0, 0 );
 		  else if (FSTRCMP(ffvsp[-2].str,"NELEM(") == 0)
                      ffval.Node = New_Const( LONG, &( SIZE(ffvsp[-1].Node) ), sizeof(long) );
+		  else if (FSTRCMP(ffvsp[-2].str,"NVALID(") == 0)
+		     ffval.Node = New_Func( LONG, nonnull_fct, 1, ffvsp[-1].Node,
+				    0, 0, 0, 0, 0, 0 );
 		  else if (FSTRCMP(ffvsp[-2].str,"ABS(") == 0)
 		     ffval.Node = New_Func( 0, abs_fct, 1, ffvsp[-1].Node, 0, 0, 0, 0, 0, 0 );
  		  else if (FSTRCMP(ffvsp[-2].str,"MIN(") == 0)
@@ -1666,8 +1721,8 @@ case 49:
                   TEST(ffval.Node); 
                 ;
     break;}
-case 50:
-#line 543 "eval.y"
+case 55:
+#line 592 "eval.y"
 { 
 		   if (FSTRCMP(ffvsp[-4].str,"DEFNULL(") == 0) {
 		      if( SIZE(ffvsp[-3].Node)>=SIZE(ffvsp[-1].Node) && Test_Dims( ffvsp[-3].Node, ffvsp[-1].Node ) ) {
@@ -1720,52 +1775,52 @@ case 50:
 		   }
                 ;
     break;}
-case 51:
-#line 595 "eval.y"
+case 56:
+#line 644 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-3].Node, 1, ffvsp[-1].Node,  0,  0,  0,   0 ); TEST(ffval.Node); ;
     break;}
-case 52:
-#line 597 "eval.y"
+case 57:
+#line 646 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-5].Node, 2, ffvsp[-3].Node, ffvsp[-1].Node,  0,  0,   0 ); TEST(ffval.Node); ;
     break;}
-case 53:
-#line 599 "eval.y"
+case 58:
+#line 648 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-7].Node, 3, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node,  0,   0 ); TEST(ffval.Node); ;
     break;}
-case 54:
-#line 601 "eval.y"
+case 59:
+#line 650 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-9].Node, 4, ffvsp[-7].Node, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node,   0 ); TEST(ffval.Node); ;
     break;}
-case 55:
-#line 603 "eval.y"
+case 60:
+#line 652 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-11].Node, 5, ffvsp[-9].Node, ffvsp[-7].Node, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node ); TEST(ffval.Node); ;
     break;}
-case 56:
-#line 605 "eval.y"
+case 61:
+#line 654 "eval.y"
 { ffval.Node = New_Unary( LONG,   INTCAST, ffvsp[0].Node );  TEST(ffval.Node);  ;
     break;}
-case 57:
-#line 607 "eval.y"
+case 62:
+#line 656 "eval.y"
 { ffval.Node = New_Unary( LONG,   INTCAST, ffvsp[0].Node );  TEST(ffval.Node);  ;
     break;}
-case 58:
-#line 609 "eval.y"
+case 63:
+#line 658 "eval.y"
 { ffval.Node = New_Unary( DOUBLE, FLTCAST, ffvsp[0].Node );  TEST(ffval.Node);  ;
     break;}
-case 59:
-#line 611 "eval.y"
+case 64:
+#line 660 "eval.y"
 { ffval.Node = New_Unary( DOUBLE, FLTCAST, ffvsp[0].Node );  TEST(ffval.Node);  ;
     break;}
-case 60:
-#line 615 "eval.y"
+case 65:
+#line 664 "eval.y"
 { ffval.Node = New_Const( BOOLEAN, &(ffvsp[0].log), sizeof(char) ); TEST(ffval.Node); ;
     break;}
-case 61:
-#line 617 "eval.y"
+case 66:
+#line 666 "eval.y"
 { ffval.Node = New_Column( ffvsp[0].lng ); TEST(ffval.Node); ;
     break;}
-case 62:
-#line 619 "eval.y"
+case 67:
+#line 668 "eval.y"
 {
                   if( TYPE(ffvsp[-1].Node) != LONG
 		      || gParse.Nodes[ffvsp[-1].Node].operation != CONST_OP ) {
@@ -1775,127 +1830,127 @@ case 62:
                   ffval.Node = New_Offset( ffvsp[-3].lng, ffvsp[-1].Node ); TEST(ffval.Node);
                 ;
     break;}
-case 63:
-#line 628 "eval.y"
+case 68:
+#line 677 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, EQ,  ffvsp[0].Node ); TEST(ffval.Node);
 		  SIZE(ffval.Node) = 1;                                     ;
     break;}
-case 64:
-#line 631 "eval.y"
+case 69:
+#line 680 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, NE,  ffvsp[0].Node ); TEST(ffval.Node); 
 		  SIZE(ffval.Node) = 1;                                     ;
     break;}
-case 65:
-#line 634 "eval.y"
+case 70:
+#line 683 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, LT,  ffvsp[0].Node ); TEST(ffval.Node); 
 		  SIZE(ffval.Node) = 1;                                     ;
     break;}
-case 66:
-#line 637 "eval.y"
+case 71:
+#line 686 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, LTE, ffvsp[0].Node ); TEST(ffval.Node); 
 		  SIZE(ffval.Node) = 1;                                     ;
     break;}
-case 67:
-#line 640 "eval.y"
+case 72:
+#line 689 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, GT,  ffvsp[0].Node ); TEST(ffval.Node); 
 		  SIZE(ffval.Node) = 1;                                     ;
     break;}
-case 68:
-#line 643 "eval.y"
+case 73:
+#line 692 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, GTE, ffvsp[0].Node ); TEST(ffval.Node); 
 		  SIZE(ffval.Node) = 1;                                     ;
     break;}
-case 69:
-#line 646 "eval.y"
+case 74:
+#line 695 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, GT,  ffvsp[0].Node );
                   TEST(ffval.Node);                                               ;
     break;}
-case 70:
-#line 649 "eval.y"
+case 75:
+#line 698 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, LT,  ffvsp[0].Node );
                   TEST(ffval.Node);                                               ;
     break;}
-case 71:
-#line 652 "eval.y"
+case 76:
+#line 701 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, GTE, ffvsp[0].Node );
                   TEST(ffval.Node);                                               ;
     break;}
-case 72:
-#line 655 "eval.y"
+case 77:
+#line 704 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, LTE, ffvsp[0].Node );
                   TEST(ffval.Node);                                               ;
     break;}
-case 73:
-#line 658 "eval.y"
+case 78:
+#line 707 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, '~', ffvsp[0].Node );
                   TEST(ffval.Node);                                               ;
     break;}
-case 74:
-#line 661 "eval.y"
+case 79:
+#line 710 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, EQ,  ffvsp[0].Node );
                   TEST(ffval.Node);                                               ;
     break;}
-case 75:
-#line 664 "eval.y"
+case 80:
+#line 713 "eval.y"
 { PROMOTE(ffvsp[-2].Node,ffvsp[0].Node); ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, NE,  ffvsp[0].Node );
                   TEST(ffval.Node);                                               ;
     break;}
-case 76:
-#line 667 "eval.y"
+case 81:
+#line 716 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, EQ,  ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = 1; ;
     break;}
-case 77:
-#line 670 "eval.y"
+case 82:
+#line 719 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, NE,  ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = 1; ;
     break;}
-case 78:
-#line 673 "eval.y"
+case 83:
+#line 722 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, GT,  ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = 1; ;
     break;}
-case 79:
-#line 676 "eval.y"
+case 84:
+#line 725 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, GTE, ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = 1; ;
     break;}
-case 80:
-#line 679 "eval.y"
+case 85:
+#line 728 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, LT,  ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = 1; ;
     break;}
-case 81:
-#line 682 "eval.y"
+case 86:
+#line 731 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, LTE, ffvsp[0].Node ); TEST(ffval.Node);
                   SIZE(ffval.Node) = 1; ;
     break;}
-case 82:
-#line 685 "eval.y"
+case 87:
+#line 734 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, AND, ffvsp[0].Node ); TEST(ffval.Node); ;
     break;}
-case 83:
-#line 687 "eval.y"
+case 88:
+#line 736 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, OR,  ffvsp[0].Node ); TEST(ffval.Node); ;
     break;}
-case 84:
-#line 689 "eval.y"
+case 89:
+#line 738 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, EQ,  ffvsp[0].Node ); TEST(ffval.Node); ;
     break;}
-case 85:
-#line 691 "eval.y"
+case 90:
+#line 740 "eval.y"
 { ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, NE,  ffvsp[0].Node ); TEST(ffval.Node); ;
     break;}
-case 86:
-#line 694 "eval.y"
+case 91:
+#line 743 "eval.y"
 { PROMOTE(ffvsp[-4].Node,ffvsp[-2].Node); PROMOTE(ffvsp[-4].Node,ffvsp[0].Node); PROMOTE(ffvsp[-2].Node,ffvsp[0].Node);
 		  ffvsp[-2].Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, LTE, ffvsp[-4].Node );
                   ffvsp[0].Node = New_BinOp( BOOLEAN, ffvsp[-4].Node, LTE, ffvsp[0].Node );
                   ffval.Node = New_BinOp( BOOLEAN, ffvsp[-2].Node, AND, ffvsp[0].Node );
                   TEST(ffval.Node);                                         ;
     break;}
-case 87:
-#line 701 "eval.y"
+case 92:
+#line 750 "eval.y"
 {
                   if( ! Test_Dims(ffvsp[-2].Node,ffvsp[0].Node) ) {
                      fferror("Incompatible dimensions in '?:' arguments");
@@ -1912,8 +1967,8 @@ case 87:
                   if( SIZE(ffval.Node)<SIZE(ffvsp[-4].Node) )  Copy_Dims(ffval.Node, ffvsp[-4].Node);
                 ;
     break;}
-case 88:
-#line 718 "eval.y"
+case 93:
+#line 767 "eval.y"
 {
 		   if (FSTRCMP(ffvsp[-2].str,"ISNULL(") == 0) {
 		      ffval.Node = New_Func( 0, isnull_fct, 1, ffvsp[-1].Node, 0, 0,
@@ -1927,8 +1982,8 @@ case 88:
 		   }
 		;
     break;}
-case 89:
-#line 731 "eval.y"
+case 94:
+#line 780 "eval.y"
 {
 		   if (FSTRCMP(ffvsp[-2].str,"ISNULL(") == 0) {
 		      ffval.Node = New_Func( 0, isnull_fct, 1, ffvsp[-1].Node, 0, 0,
@@ -1942,8 +1997,8 @@ case 89:
 		   }
 		;
     break;}
-case 90:
-#line 744 "eval.y"
+case 95:
+#line 793 "eval.y"
 {
 		   if (FSTRCMP(ffvsp[-2].str,"ISNULL(") == 0) {
 		      ffval.Node = New_Func( BOOLEAN, isnull_fct, 1, ffvsp[-1].Node, 0, 0,
@@ -1955,8 +2010,8 @@ case 90:
 		   }
 		;
     break;}
-case 91:
-#line 755 "eval.y"
+case 96:
+#line 804 "eval.y"
 {
 		   if (FSTRCMP(ffvsp[-4].str,"DEFNULL(") == 0) {
 		      if( SIZE(ffvsp[-3].Node)>=SIZE(ffvsp[-1].Node) && Test_Dims( ffvsp[-3].Node, ffvsp[-1].Node ) ) {
@@ -1973,8 +2028,8 @@ case 91:
 		   }
 		;
     break;}
-case 92:
-#line 771 "eval.y"
+case 97:
+#line 820 "eval.y"
 {
 		   if( SIZE(ffvsp[-5].Node)>1 || SIZE(ffvsp[-3].Node)>1 || SIZE(ffvsp[-1].Node)>1 ) {
 		      fferror("Cannot use array as function argument");
@@ -1993,8 +2048,8 @@ case 92:
                    TEST(ffval.Node); 
 		;
     break;}
-case 93:
-#line 789 "eval.y"
+case 98:
+#line 838 "eval.y"
 {
 		   if( SIZE(ffvsp[-9].Node)>1 || SIZE(ffvsp[-7].Node)>1 || SIZE(ffvsp[-5].Node)>1 || SIZE(ffvsp[-3].Node)>1
 		       || SIZE(ffvsp[-1].Node)>1 ) {
@@ -2016,8 +2071,8 @@ case 93:
                    TEST(ffval.Node); 
 		;
     break;}
-case 94:
-#line 810 "eval.y"
+case 99:
+#line 859 "eval.y"
 {
 		   if( SIZE(ffvsp[-13].Node)>1 || SIZE(ffvsp[-11].Node)>1 || SIZE(ffvsp[-9].Node)>1 || SIZE(ffvsp[-7].Node)>1
 		       || SIZE(ffvsp[-5].Node)>1 || SIZE(ffvsp[-3].Node)>1 || SIZE(ffvsp[-1].Node)>1 ) {
@@ -2044,83 +2099,83 @@ case 94:
                    TEST(ffval.Node); 
 		;
     break;}
-case 95:
-#line 837 "eval.y"
+case 100:
+#line 886 "eval.y"
 { /* Use defaults for all elements */
                    ffval.Node = New_GTI( "", -99, "*START*", "*STOP*" );
                    TEST(ffval.Node);                                        ;
     break;}
-case 96:
-#line 841 "eval.y"
+case 101:
+#line 890 "eval.y"
 { /* Use defaults for all except filename */
                    ffval.Node = New_GTI( ffvsp[-1].str, -99, "*START*", "*STOP*" );
                    TEST(ffval.Node);                                        ;
     break;}
-case 97:
-#line 845 "eval.y"
+case 102:
+#line 894 "eval.y"
 {  ffval.Node = New_GTI( ffvsp[-3].str, ffvsp[-1].Node, "*START*", "*STOP*" );
                    TEST(ffval.Node);                                        ;
     break;}
-case 98:
-#line 848 "eval.y"
+case 103:
+#line 897 "eval.y"
 {  ffval.Node = New_GTI( ffvsp[-7].str, ffvsp[-5].Node, ffvsp[-3].str, ffvsp[-1].str );
                    TEST(ffval.Node);                                        ;
     break;}
-case 99:
-#line 852 "eval.y"
+case 104:
+#line 901 "eval.y"
 { /* Use defaults for all except filename */
                    ffval.Node = New_REG( ffvsp[-1].str, -99, -99, "" );
                    TEST(ffval.Node);                                        ;
     break;}
-case 100:
-#line 856 "eval.y"
+case 105:
+#line 905 "eval.y"
 {  ffval.Node = New_REG( ffvsp[-5].str, ffvsp[-3].Node, ffvsp[-1].Node, "" );
                    TEST(ffval.Node);                                        ;
     break;}
-case 101:
-#line 859 "eval.y"
+case 106:
+#line 908 "eval.y"
 {  ffval.Node = New_REG( ffvsp[-7].str, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].str );
                    TEST(ffval.Node);                                        ;
     break;}
-case 102:
-#line 863 "eval.y"
+case 107:
+#line 912 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-3].Node, 1, ffvsp[-1].Node,  0,  0,  0,   0 ); TEST(ffval.Node); ;
     break;}
-case 103:
-#line 865 "eval.y"
+case 108:
+#line 914 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-5].Node, 2, ffvsp[-3].Node, ffvsp[-1].Node,  0,  0,   0 ); TEST(ffval.Node); ;
     break;}
-case 104:
-#line 867 "eval.y"
+case 109:
+#line 916 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-7].Node, 3, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node,  0,   0 ); TEST(ffval.Node); ;
     break;}
-case 105:
-#line 869 "eval.y"
+case 110:
+#line 918 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-9].Node, 4, ffvsp[-7].Node, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node,   0 ); TEST(ffval.Node); ;
     break;}
-case 106:
-#line 871 "eval.y"
+case 111:
+#line 920 "eval.y"
 { ffval.Node = New_Deref( ffvsp[-11].Node, 5, ffvsp[-9].Node, ffvsp[-7].Node, ffvsp[-5].Node, ffvsp[-3].Node, ffvsp[-1].Node ); TEST(ffval.Node); ;
     break;}
-case 107:
-#line 873 "eval.y"
+case 112:
+#line 922 "eval.y"
 { ffval.Node = New_Unary( BOOLEAN, NOT, ffvsp[0].Node ); TEST(ffval.Node); ;
     break;}
-case 108:
-#line 875 "eval.y"
+case 113:
+#line 924 "eval.y"
 { ffval.Node = ffvsp[-1].Node; ;
     break;}
-case 109:
-#line 879 "eval.y"
+case 114:
+#line 928 "eval.y"
 { ffval.Node = New_Const( STRING, ffvsp[0].str, strlen(ffvsp[0].str)+1 ); TEST(ffval.Node);
                   SIZE(ffval.Node) = strlen(ffvsp[0].str);                            ;
     break;}
-case 110:
-#line 882 "eval.y"
+case 115:
+#line 931 "eval.y"
 { ffval.Node = New_Column( ffvsp[0].lng ); TEST(ffval.Node); ;
     break;}
-case 111:
-#line 884 "eval.y"
+case 116:
+#line 933 "eval.y"
 {
                   if( TYPE(ffvsp[-1].Node) != LONG
 		      || gParse.Nodes[ffvsp[-1].Node].operation != CONST_OP ) {
@@ -2130,21 +2185,21 @@ case 111:
                   ffval.Node = New_Offset( ffvsp[-3].lng, ffvsp[-1].Node ); TEST(ffval.Node);
                 ;
     break;}
-case 112:
-#line 893 "eval.y"
+case 117:
+#line 942 "eval.y"
 { ffval.Node = New_Func( STRING, null_fct, 0, 0, 0, 0, 0, 0, 0, 0 ); ;
     break;}
-case 113:
-#line 895 "eval.y"
+case 118:
+#line 944 "eval.y"
 { ffval.Node = ffvsp[-1].Node; ;
     break;}
-case 114:
-#line 897 "eval.y"
+case 119:
+#line 946 "eval.y"
 { ffval.Node = New_BinOp( STRING, ffvsp[-2].Node, '+', ffvsp[0].Node );  TEST(ffval.Node);
 		  SIZE(ffval.Node) = SIZE(ffvsp[-2].Node) + SIZE(ffvsp[0].Node);                   ;
     break;}
-case 115:
-#line 900 "eval.y"
+case 120:
+#line 949 "eval.y"
 {
                   if( SIZE(ffvsp[-4].Node)!=1 ) {
                      fferror("Cannot have a vector string column");
@@ -2156,8 +2211,8 @@ case 115:
                   if( SIZE(ffvsp[-2].Node)<SIZE(ffvsp[0].Node) )  Copy_Dims(ffval.Node, ffvsp[0].Node);
                 ;
     break;}
-case 116:
-#line 912 "eval.y"
+case 121:
+#line 961 "eval.y"
 { 
 		  if (FSTRCMP(ffvsp[-4].str,"DEFNULL(") == 0) {
 		     ffval.Node = New_Func( 0, defnull_fct, 2, ffvsp[-3].Node, ffvsp[-1].Node, 0,
@@ -2169,7 +2224,7 @@ case 116:
     break;}
 }
    /* the action file gets copied in in place of this dollarsign */
-#line 542 "/usr/lib/bison.simple"
+#line 498 "/usr1/local/share/bison.simple"
 
   ffvsp -= fflen;
   ffssp -= fflen;
@@ -2364,32 +2419,8 @@ fferrhandle:
 
   ffstate = ffn;
   goto ffnewstate;
-
- ffacceptlab:
-  /* FFACCEPT comes here.  */
-  if (fffree_stacks)
-    {
-      free (ffss);
-      free (ffvs);
-#ifdef FFLSP_NEEDED
-      free (ffls);
-#endif
-    }
-  return 0;
-
- ffabortlab:
-  /* FFABORT comes here.  */
-  if (fffree_stacks)
-    {
-      free (ffss);
-      free (ffvs);
-#ifdef FFLSP_NEEDED
-      free (ffls);
-#endif
-    }
-  return 1;
 }
-#line 922 "eval.y"
+#line 971 "eval.y"
 
 
 /*************************************************************************/
@@ -4037,15 +4068,15 @@ static void Do_BinOp_lng( Node *this )
 	    case '%':   
 	       if( val2 ) this->value.data.lngptr[elem] = (val1 % val2);
 	       else {
-		  fferror("Divide by Zero");
-		  free( this->value.data.ptr );
+		 this->value.data.lngptr[elem] = 0;
+		 this->value.undef[elem] = 1;
 	       }
 	       break;
 	    case '/': 
 	       if( val2 ) this->value.data.lngptr[elem] = (val1 / val2); 
 	       else {
-		  fferror("Divide by Zero");
-		  free( this->value.data.ptr );
+		 this->value.data.lngptr[elem] = 0;
+		 this->value.undef[elem] = 1;
 	       }
 	       break;
 	    case POWER:
@@ -4166,15 +4197,15 @@ static void Do_BinOp_dbl( Node *this )
 	       if( val2 ) this->value.data.dblptr[elem] =
                                 val1 - val2*((int)(val1/val2));
 	       else {
-		  fferror("Divide by Zero");
-		  free( this->value.data.ptr );
+		 this->value.data.dblptr[elem] = 0.0;
+		 this->value.undef[elem] = 1;
 	       }
 	       break;
 	    case '/': 
 	       if( val2 ) this->value.data.dblptr[elem] = (val1 / val2); 
 	       else {
-		  fferror("Divide by Zero");
-		  free( this->value.data.ptr );
+		 this->value.data.dblptr[elem] = 0.0;
+		 this->value.undef[elem] = 1;
 	       }
 	       break;
 	    case POWER:
@@ -4194,6 +4225,157 @@ static void Do_BinOp_dbl( Node *this )
    }
 }
 
+/*
+ *  This Quickselect routine is based on the algorithm described in
+ *  "Numerical recipes in C", Second Edition,
+ *  Cambridge University Press, 1992, Section 8.5, ISBN 0-521-43108-5
+ *  This code by Nicolas Devillard - 1998. Public domain.
+ * http://ndevilla.free.fr/median/median/src/quickselect.c
+ */
+
+#define ELEM_SWAP(a,b) { register long t=(a);(a)=(b);(b)=t; }
+
+/* 
+ * qselect_median_lng - select the median value of a long array
+ *
+ * This routine selects the median value of the long integer array
+ * arr[].  If there are an even number of elements, the "lower median"
+ * is selected.
+ *
+ * The array arr[] is scrambled, so users must operate on a scratch
+ * array if they wish the values to be preserved.
+ *
+ * long arr[] - array of values
+ * int n - number of elements in arr
+ *
+ * RETURNS: the lower median value of arr[]
+ *
+ */
+long qselect_median_lng(long arr[], int n)
+{
+    int low, high ;
+    int median;
+    int middle, ll, hh;
+
+    low = 0 ; high = n-1 ; median = (low + high) / 2;
+    for (;;) {
+
+        if (high <= low) { /* One element only */
+	  return arr[median];	  
+	}
+
+        if (high == low + 1) {  /* Two elements only */
+            if (arr[low] > arr[high])
+                ELEM_SWAP(arr[low], arr[high]) ;
+	    return arr[median];
+        }
+
+    /* Find median of low, middle and high items; swap into position low */
+    middle = (low + high) / 2;
+    if (arr[middle] > arr[high])    ELEM_SWAP(arr[middle], arr[high]) ;
+    if (arr[low] > arr[high])       ELEM_SWAP(arr[low], arr[high]) ;
+    if (arr[middle] > arr[low])     ELEM_SWAP(arr[middle], arr[low]) ;
+
+    /* Swap low item (now in position middle) into position (low+1) */
+    ELEM_SWAP(arr[middle], arr[low+1]) ;
+
+    /* Nibble from each end towards middle, swapping items when stuck */
+    ll = low + 1;
+    hh = high;
+    for (;;) {
+        do ll++; while (arr[low] > arr[ll]) ;
+        do hh--; while (arr[hh]  > arr[low]) ;
+
+        if (hh < ll)
+        break;
+
+        ELEM_SWAP(arr[ll], arr[hh]) ;
+    }
+
+    /* Swap middle item (in position low) back into correct position */
+    ELEM_SWAP(arr[low], arr[hh]) ;
+
+    /* Re-set active partition */
+    if (hh <= median)
+        low = ll;
+        if (hh >= median)
+        high = hh - 1;
+    }
+}
+
+#undef ELEM_SWAP
+
+#define ELEM_SWAP(a,b) { register double t=(a);(a)=(b);(b)=t; }
+
+/* 
+ * qselect_median_dbl - select the median value of a double array
+ *
+ * This routine selects the median value of the double array
+ * arr[].  If there are an even number of elements, the "lower median"
+ * is selected.
+ *
+ * The array arr[] is scrambled, so users must operate on a scratch
+ * array if they wish the values to be preserved.
+ *
+ * double arr[] - array of values
+ * int n - number of elements in arr
+ *
+ * RETURNS: the lower median value of arr[]
+ *
+ */
+double qselect_median_dbl(double arr[], int n)
+{
+    int low, high ;
+    int median;
+    int middle, ll, hh;
+
+    low = 0 ; high = n-1 ; median = (low + high) / 2;
+    for (;;) {
+        if (high <= low) { /* One element only */
+            return arr[median] ;
+	}
+
+        if (high == low + 1) {  /* Two elements only */
+            if (arr[low] > arr[high])
+                ELEM_SWAP(arr[low], arr[high]) ;
+            return arr[median] ;
+        }
+
+    /* Find median of low, middle and high items; swap into position low */
+    middle = (low + high) / 2;
+    if (arr[middle] > arr[high])    ELEM_SWAP(arr[middle], arr[high]) ;
+    if (arr[low] > arr[high])       ELEM_SWAP(arr[low], arr[high]) ;
+    if (arr[middle] > arr[low])     ELEM_SWAP(arr[middle], arr[low]) ;
+
+    /* Swap low item (now in position middle) into position (low+1) */
+    ELEM_SWAP(arr[middle], arr[low+1]) ;
+
+    /* Nibble from each end towards middle, swapping items when stuck */
+    ll = low + 1;
+    hh = high;
+    for (;;) {
+        do ll++; while (arr[low] > arr[ll]) ;
+        do hh--; while (arr[hh]  > arr[low]) ;
+
+        if (hh < ll)
+        break;
+
+        ELEM_SWAP(arr[ll], arr[hh]) ;
+    }
+
+    /* Swap middle item (in position low) back into correct position */
+    ELEM_SWAP(arr[low], arr[hh]) ;
+
+    /* Re-set active partition */
+    if (hh <= median)
+        low = ll;
+        if (hh >= median)
+        high = hh - 1;
+    }
+}
+
+#undef ELEM_SWAP
+
 static void Do_Func( Node *this )
 {
    Node *theParams[MAXSUBS];
@@ -4236,6 +4418,25 @@ static void Do_Func( Node *this )
 	    /* Non-Trig single-argument functions */
 
 	 case sum_fct:
+	    if( theParams[0]->type==BOOLEAN )
+	       this->value.data.lng = ( pVals[0].data.log ? 1 : 0 );
+	    else if( theParams[0]->type==LONG )
+	       this->value.data.lng = pVals[0].data.lng;
+	    else if( theParams[0]->type==DOUBLE )
+	       this->value.data.dbl = pVals[0].data.dbl;
+	    else if( theParams[0]->type==BITSTR )
+	      strcpy(this->value.data.str, pVals[0].data.str);
+	    break;
+         case average_fct:
+	    if( theParams[0]->type==LONG )
+	       this->value.data.dbl = pVals[0].data.lng;
+	    else if( theParams[0]->type==DOUBLE )
+	       this->value.data.dbl = pVals[0].data.dbl;
+	    break;
+         case stddev_fct:
+	    this->value.data.dbl = 0;  /* Standard deviation of a constant = 0 */
+	    break;
+	 case median_fct:
 	    if( theParams[0]->type==BOOLEAN )
 	       this->value.data.lng = ( pVals[0].data.log ? 1 : 0 );
 	    else if( theParams[0]->type==LONG )
@@ -4255,6 +4456,9 @@ static void Do_Func( Node *this )
 
             /* Special Null-Handling Functions */
 
+         case nonnull_fct:
+	    this->value.data.lng = 1; /* Constants are always 1-element and defined */
+	    break;
          case isnull_fct:  /* Constants are always defined */
 	    this->value.data.log = 0;
 	    break;
@@ -4355,6 +4559,8 @@ static void Do_Func( Node *this )
 	       this->value.data.dbl = pVals[0].data.dbl;
 	    else if( this->type == LONG )
 	       this->value.data.lng = pVals[0].data.lng;
+	    else if( this->type == BITSTR )
+	      strcpy(this->value.data.str, pVals[0].data.str);
 	    break;
          case min2_fct:
 	    if( this->type == DOUBLE )
@@ -4370,6 +4576,8 @@ static void Do_Func( Node *this )
 	       this->value.data.dbl = pVals[0].data.dbl;
 	    else if( this->type == LONG )
 	       this->value.data.lng = pVals[0].data.lng;
+	    else if( this->type == BITSTR )
+	      strcpy(this->value.data.str, pVals[0].data.str);
 	    break;
          case max2_fct:
 	    if( this->type == DOUBLE )
@@ -4483,42 +4691,266 @@ static void Do_Func( Node *this )
 	    if( theParams[0]->type==BOOLEAN ) {
 	       while( row-- ) {
 		  this->value.data.lngptr[row] = 0;
-		  this->value.undef[row] = 0;
+		  /* Default is UNDEF until a defined value is found */
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     this->value.data.lngptr[row] +=
-			( theParams[0]->value.data.logptr[elem] ? 1 : 0 );
-		     this->value.undef[row] |=
-			  theParams[0]->value.undef[elem];
+		     if ( ! theParams[0]->value.undef[elem] ) {
+		       this->value.data.lngptr[row] +=
+			 ( theParams[0]->value.data.logptr[elem] ? 1 : 0 );
+		       this->value.undef[row] = 0;
+		     }
 		  }
-	       }		  
+	       }
 	    } else if( theParams[0]->type==LONG ) {
 	       while( row-- ) {
 		  this->value.data.lngptr[row] = 0;
-		  this->value.undef[row] = 0;
+		  /* Default is UNDEF until a defined value is found */
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     this->value.data.lngptr[row] +=
-			theParams[0]->value.data.lngptr[elem];
-		     this->value.undef[row] |=
-			  theParams[0]->value.undef[elem];
+		     if ( ! theParams[0]->value.undef[elem] ) {
+		       this->value.data.lngptr[row] +=
+			 theParams[0]->value.data.lngptr[elem];
+		       this->value.undef[row] = 0;
+		     }
 		  }
 	       }		  
-	    } else {
+	    } else if( theParams[0]->type==DOUBLE ){
 	       while( row-- ) {
 		  this->value.data.dblptr[row] = 0.0;
+		  /* Default is UNDEF until a defined value is found */
+		  this->value.undef[row] = 1;
+		  nelem = theParams[0]->value.nelem;
+		  while( nelem-- ) {
+		     elem--;
+		     if ( ! theParams[0]->value.undef[elem] ) {
+		       this->value.data.dblptr[row] +=
+			 theParams[0]->value.data.dblptr[elem];
+		       this->value.undef[row] = 0;
+		     }
+		  }
+	       }		  
+	    } else { /* BITSTR */
+	       nelem = theParams[0]->value.nelem;
+	       while( row-- ) {
+		  char *sptr1 = theParams[0]->value.data.strptr[row];
+		  this->value.data.lngptr[row] = 0;
 		  this->value.undef[row] = 0;
+		  while (*sptr1) {
+		    if (*sptr1 == '1') this->value.data.lngptr[row] ++;
+		    sptr1++;
+		  }
+	       }		  
+	    }
+	    break;
+
+	 case average_fct:
+	    elem = row * theParams[0]->value.nelem;
+	    if( theParams[0]->type==LONG ) {
+	       while( row-- ) {
+		  int count = 0;
+		  this->value.data.dblptr[row] = 0;
+		  nelem = theParams[0]->value.nelem;
+		  while( nelem-- ) {
+		     elem--;
+		     if (theParams[0]->value.undef[elem] == 0) {
+		       this->value.data.dblptr[row] +=
+			 theParams[0]->value.data.lngptr[elem];
+		       count ++;
+		     }
+		  }
+		  if (count == 0) {
+		    this->value.undef[row] = 1;
+		  } else {
+		    this->value.undef[row] = 0;
+		    this->value.data.dblptr[row] /= count;
+		  }
+	       }		  
+	    } else if( theParams[0]->type==DOUBLE ){
+	       while( row-- ) {
+		  int count = 0;
+		  this->value.data.dblptr[row] = 0;
+		  nelem = theParams[0]->value.nelem;
+		  while( nelem-- ) {
+		     elem--;
+		     if (theParams[0]->value.undef[elem] == 0) {
+		       this->value.data.dblptr[row] +=
+			 theParams[0]->value.data.dblptr[elem];
+		       count ++;
+		     }
+		  }
+		  if (count == 0) {
+		    this->value.undef[row] = 1;
+		  } else {
+		    this->value.undef[row] = 0;
+		    this->value.data.dblptr[row] /= count;
+		  }
+	       }		  
+	    }
+	    break;
+	 case stddev_fct:
+	    elem = row * theParams[0]->value.nelem;
+	    if( theParams[0]->type==LONG ) {
+
+	       /* Compute the mean value */
+	       while( row-- ) {
+		  int count = 0;
+		  double sum = 0, sum2 = 0;
+
+		  nelem = theParams[0]->value.nelem;
+		  while( nelem-- ) {
+		     elem--;
+		     if (theParams[0]->value.undef[elem] == 0) {
+		       sum += theParams[0]->value.data.lngptr[elem];
+		       count ++;
+		     }
+		  }
+		  if (count > 1) {
+		    sum /= count;
+
+		    /* Compute the sum of squared deviations */
+		    nelem = theParams[0]->value.nelem;
+		    elem += nelem;  /* Reset elem for second pass */
+		    while( nelem-- ) {
+		      elem--;
+		      if (theParams[0]->value.undef[elem] == 0) {
+			double dx = (theParams[0]->value.data.lngptr[elem] - sum);
+			sum2 += (dx*dx);
+		      }
+		    }
+
+		    sum2 /= (double)count-1;
+
+		    this->value.undef[row] = 0;
+		    this->value.data.dblptr[row] = sqrt(sum2);
+		  } else {
+		    this->value.undef[row] = 0;       /* STDDEV => 0 */
+		    this->value.data.dblptr[row] = 0;
+		  }
+	       }
+	    } else if( theParams[0]->type==DOUBLE ){
+
+	       /* Compute the mean value */
+	       while( row-- ) {
+		  int count = 0;
+		  double sum = 0, sum2 = 0;
+
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     this->value.data.dblptr[row] +=
-			theParams[0]->value.data.dblptr[elem];
-		     this->value.undef[row] |=
-			  theParams[0]->value.undef[elem];
+		     if (theParams[0]->value.undef[elem] == 0) {
+		       sum += theParams[0]->value.data.dblptr[elem];
+		       count ++;
+		     }
+		  }
+		  if (count > 1) {
+		    sum /= count;
+
+		    /* Compute the sum of squared deviations */
+		    nelem = theParams[0]->value.nelem;
+		    elem += nelem;  /* Reset elem for second pass */
+		    while( nelem-- ) {
+		      elem--;
+		      if (theParams[0]->value.undef[elem] == 0) {
+			double dx = (theParams[0]->value.data.dblptr[elem] - sum);
+			sum2 += (dx*dx);
+		      }
+		    }
+
+		    sum2 /= (double)count-1;
+
+		    this->value.undef[row] = 0;
+		    this->value.data.dblptr[row] = sqrt(sum2);
+		  } else {
+		    this->value.undef[row] = 0;       /* STDDEV => 0 */
+		    this->value.data.dblptr[row] = 0;
+		  }
+	       }
+	    }
+	    break;
+
+	 case median_fct:
+	   elem = row * theParams[0]->value.nelem;
+	   nelem = theParams[0]->value.nelem;
+	   if( theParams[0]->type==LONG ) {
+	       long *dptr = theParams[0]->value.data.lngptr;
+	       char *uptr = theParams[0]->value.undef;
+	       long *mptr = (long *) malloc(sizeof(long)*nelem);
+	       int irow;
+
+	       /* Allocate temporary storage for this row, since the
+                  quickselect function will scramble the contents */
+	       if (mptr == 0) {
+		 fferror("Could not allocate temporary memory in median function");
+		 free( this->value.data.ptr );
+		 break;
+	       }
+
+	       for (irow=0; irow<row; irow++) {
+		  long *p = mptr;
+		  int nelem1 = nelem;
+		  int count = 0;
+
+		  while ( nelem1-- ) { 
+		    if (*uptr == 0) {
+		      *p++ = *dptr;   /* Only advance the dest pointer if we copied */
+		    }
+		    dptr ++;  /* Advance the source pointer ... */
+		    uptr ++;  /* ... and source "undef" pointer */
+		  }
+		  
+		  nelem1 = (p - mptr);  /* Number of accepted data points */
+		  if (nelem1 > 0) {
+		    this->value.undef[irow] = 0;
+		    this->value.data.lngptr[irow] = qselect_median_lng(mptr, nelem1);
+		  } else {
+		    this->value.undef[irow] = 1;
+		    this->value.data.lngptr[irow] = 0;
 		  }
+		    
 	       }		  
+
+	       free(mptr);
+	    } else {
+	       double *dptr = theParams[0]->value.data.dblptr;
+	       char   *uptr = theParams[0]->value.undef;
+	       double *mptr = (double *) malloc(sizeof(double)*nelem);
+	       int irow;
+
+	       /* Allocate temporary storage for this row, since the
+                  quickselect function will scramble the contents */
+	       if (mptr == 0) {
+		 fferror("Could not allocate temporary memory in median function");
+		 free( this->value.data.ptr );
+		 break;
+	       }
+
+	       for (irow=0; irow<row; irow++) {
+		  double *p = mptr;
+		  int nelem1 = nelem;
+
+		  while ( nelem1-- ) { 
+		    if (*uptr == 0) {
+		      *p++ = *dptr;   /* Only advance the dest pointer if we copied */
+		    }
+		    dptr ++;  /* Advance the source pointer ... */
+		    uptr ++;  /* ... and source "undef" pointer */
+		  }
+
+		  nelem1 = (p - mptr);  /* Number of accepted data points */
+		  if (nelem1 > 0) {
+		    this->value.undef[irow] = 0;
+		    this->value.data.dblptr[irow] = qselect_median_dbl(mptr, nelem1);
+		  } else {
+		    this->value.undef[irow] = 1;
+		    this->value.data.dblptr[irow] = 0;
+		  }
+
+	       }
+	       free(mptr);
 	    }
 	    break;
 	 case abs_fct:
@@ -4538,6 +4970,21 @@ static void Do_Func( Node *this )
 
             /* Special Null-Handling Functions */
 
+	 case nonnull_fct:
+	   nelem = theParams[0]->value.nelem;
+	   if ( theParams[0]->type==STRING ) nelem = 1;
+	   elem = row * nelem;
+	   while( row-- ) {
+	     int nelem1 = nelem;
+
+	     this->value.undef[row] = 0;        /* Initialize to 0 (defined) */
+	     this->value.data.lngptr[row] = 0;
+	     while( nelem1-- ) {	
+	       elem --;
+	       if ( theParams[0]->value.undef[elem] == 0 ) this->value.data.lngptr[row] ++;
+	     }
+	   }
+	   break;
 	 case isnull_fct:
 	    if( theParams[0]->type==STRING ) elem = row;
 	    while( elem-- ) {
@@ -4669,9 +5116,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<-1.0 || dval>1.0 ) {
-		     fferror("Out of range argument to arcsin");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = asin( dval );
 	       }
@@ -4681,9 +5127,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<-1.0 || dval>1.0 ) {
-		     fferror("Out of range argument to arccos");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = acos( dval );
 	       }
@@ -4728,9 +5173,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<=0.0 ) {
-		     fferror("Out of range argument to log");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = log( dval );
 	       }
@@ -4740,9 +5184,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<=0.0 ) {
-		     fferror("Out of range argument to log10");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = log10( dval );
 	       }
@@ -4752,9 +5195,8 @@ static void Do_Func( Node *this )
 	       if( !(this->value.undef[elem] = theParams[0]->value.undef[elem]) ) {
 		  dval = theParams[0]->value.data.dblptr[elem];
 		  if( dval<0.0 ) {
-		     fferror("Out of range argument to sqrt");
-		     free( this->value.data.ptr );
-		     break;
+		     this->value.data.dblptr[elem] = 0.0;
+		     this->value.undef[elem] = 1;
 		  } else
 		     this->value.data.dblptr[elem] = sqrt( dval );
 	       }
@@ -4813,42 +5255,56 @@ static void Do_Func( Node *this )
 	       long minVal=0;
 	       while( row-- ) {
 		  valInit = 1;
-		  this->value.undef[row] = 0;
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     if( valInit && !theParams[0]->value.undef[elem] ) {
-			valInit = 0;
-			minVal  = theParams[0]->value.data.lngptr[elem];
-		     } else {
-			minVal  = minvalue( minVal,
-					    theParams[0]->value.data.lngptr[elem] );
+		     if ( !theParams[0]->value.undef[elem] ) {
+		       if ( valInit ) {
+			 valInit = 0;
+			 minVal  = theParams[0]->value.data.lngptr[elem];
+		       } else {
+			 minVal  = minvalue( minVal,
+					     theParams[0]->value.data.lngptr[elem] );
+		       }
+		       this->value.undef[row] = 0;
 		     }
-		     this->value.undef[row] |=
-			theParams[0]->value.undef[elem];
-		  }
+		  }  
 		  this->value.data.lngptr[row] = minVal;
 	       }		  
 	    } else if( this->type==DOUBLE ) {
 	       double minVal=0.0;
 	       while( row-- ) {
 		  valInit = 1;
-		  this->value.undef[row] = 0;
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     if( valInit && !theParams[0]->value.undef[elem] ) {
-			valInit = 0;
-			minVal  = theParams[0]->value.data.dblptr[elem];
-		     } else {
-			minVal  = minvalue( minVal,
-					    theParams[0]->value.data.dblptr[elem] );
+		     if ( !theParams[0]->value.undef[elem] ) {
+		       if ( valInit ) {
+			 valInit = 0;
+			 minVal  = theParams[0]->value.data.dblptr[elem];
+		       } else {
+			 minVal  = minvalue( minVal,
+					     theParams[0]->value.data.dblptr[elem] );
+		       }
+		       this->value.undef[row] = 0;
 		     }
-		     this->value.undef[row] |=
-			theParams[0]->value.undef[elem];
-		  }
+		  }  
 		  this->value.data.dblptr[row] = minVal;
 	       }		  
+	    } else if( this->type==BITSTR ) {
+	       char minVal;
+	       while( row-- ) {
+		  char *sptr1 = theParams[0]->value.data.strptr[row];
+		  minVal = '1';
+		  while (*sptr1) {
+		    if (*sptr1 == '0') minVal = '0';
+		    sptr1++;
+		  }
+		  this->value.data.strptr[row][0] = minVal;
+		  this->value.data.strptr[row][1] = 0;     /* Null terminate */
+	       }		  
 	    }
 	    break;
          case min2_fct:
@@ -4867,9 +5323,20 @@ static void Do_Func( Node *this )
 			      theParams[i]->value.data.lngptr[row];
 			   pNull[i] = theParams[i]->value.undef[row];
 			}
-		     if( !(this->value.undef[elem] = (pNull[0] || pNull[1]) ) )
-			this->value.data.lngptr[elem] =
-			   minvalue( pVals[0].data.lng, pVals[1].data.lng );
+		     if( pNull[0] && pNull[1] ) {
+		       this->value.undef[elem] = 1;
+		       this->value.data.lngptr[elem] = 0;
+		     } else if (pNull[0]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] = pVals[1].data.lng;
+		     } else if (pNull[1]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] = pVals[0].data.lng;
+		     } else {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] =
+			 minvalue( pVals[0].data.lng, pVals[1].data.lng );
+		     }
 		  }
 	       }
 	    } else if( this->type==DOUBLE ) {
@@ -4887,11 +5354,22 @@ static void Do_Func( Node *this )
 			      theParams[i]->value.data.dblptr[row];
 			   pNull[i] = theParams[i]->value.undef[row];
 			}
-		     if( !(this->value.undef[elem] = (pNull[0] || pNull[1]) ) )
-			this->value.data.dblptr[elem] =
-			   minvalue( pVals[0].data.dbl, pVals[1].data.dbl );
+		     if( pNull[0] && pNull[1] ) {
+		       this->value.undef[elem] = 1;
+		       this->value.data.dblptr[elem] = 0;
+		     } else if (pNull[0]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] = pVals[1].data.dbl;
+		     } else if (pNull[1]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] = pVals[0].data.dbl;
+		     } else {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] =
+			 minvalue( pVals[0].data.dbl, pVals[1].data.dbl );
+		     }
 		  }
-	       }
+ 	       }
 	    }
 	    break;
 
@@ -4901,19 +5379,20 @@ static void Do_Func( Node *this )
 	       long maxVal=0;
 	       while( row-- ) {
 		  valInit = 1;
-		  this->value.undef[row] = 0;
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     if( valInit && !theParams[0]->value.undef[elem] ) {
-			valInit = 0;
-			maxVal  = theParams[0]->value.data.lngptr[elem];
-		     } else {
-			maxVal  = maxvalue( maxVal,
-					    theParams[0]->value.data.lngptr[elem] );
+		     if ( !theParams[0]->value.undef[elem] ) {
+		       if ( valInit ) {
+			 valInit = 0;
+			 maxVal  = theParams[0]->value.data.lngptr[elem];
+		       } else {
+			 maxVal  = maxvalue( maxVal,
+					     theParams[0]->value.data.lngptr[elem] );
+		       }
+		       this->value.undef[row] = 0;
 		     }
-		     this->value.undef[row] |=
-			theParams[0]->value.undef[elem];
 		  }
 		  this->value.data.lngptr[row] = maxVal;
 	       }		  
@@ -4921,22 +5400,35 @@ static void Do_Func( Node *this )
 	       double maxVal=0.0;
 	       while( row-- ) {
 		  valInit = 1;
-		  this->value.undef[row] = 0;
+		  this->value.undef[row] = 1;
 		  nelem = theParams[0]->value.nelem;
 		  while( nelem-- ) {
 		     elem--;
-		     if( valInit && !theParams[0]->value.undef[elem] ) {
-			valInit = 0;
-			maxVal  = theParams[0]->value.data.dblptr[elem];
-		     } else {
-			maxVal  = maxvalue( maxVal,
-					    theParams[0]->value.data.dblptr[elem] );
+		     if ( !theParams[0]->value.undef[elem] ) {
+		       if ( valInit ) {
+			 valInit = 0;
+			 maxVal  = theParams[0]->value.data.dblptr[elem];
+		       } else {
+			 maxVal  = maxvalue( maxVal,
+					     theParams[0]->value.data.dblptr[elem] );
+		       }
+		       this->value.undef[row] = 0;
 		     }
-		     this->value.undef[row] |=
-			theParams[0]->value.undef[elem];
 		  }
 		  this->value.data.dblptr[row] = maxVal;
 	       }		  
+	    } else if( this->type==BITSTR ) {
+	       char maxVal;
+	       while( row-- ) {
+		  char *sptr1 = theParams[0]->value.data.strptr[row];
+		  maxVal = '0';
+		  while (*sptr1) {
+		    if (*sptr1 == '1') maxVal = '1';
+		    sptr1++;
+		  }
+		  this->value.data.strptr[row][0] = maxVal;
+		  this->value.data.strptr[row][1] = 0;     /* Null terminate */
+	       }		  
 	    }
 	    break;
          case max2_fct:
@@ -4955,9 +5447,20 @@ static void Do_Func( Node *this )
 			      theParams[i]->value.data.lngptr[row];
 			   pNull[i] = theParams[i]->value.undef[row];
 			}
-		     if( !(this->value.undef[elem] = (pNull[0] || pNull[1]) ) )
-			this->value.data.lngptr[elem] =
-			   maxvalue( pVals[0].data.lng, pVals[1].data.lng );
+		     if( pNull[0] && pNull[1] ) {
+		       this->value.undef[elem] = 1;
+		       this->value.data.lngptr[elem] = 0;
+		     } else if (pNull[0]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] = pVals[1].data.lng;
+		     } else if (pNull[1]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] = pVals[0].data.lng;
+		     } else {
+		       this->value.undef[elem] = 0;
+		       this->value.data.lngptr[elem] =
+			 maxvalue( pVals[0].data.lng, pVals[1].data.lng );
+		     }
 		  }
 	       }
 	    } else if( this->type==DOUBLE ) {
@@ -4975,9 +5478,20 @@ static void Do_Func( Node *this )
 			      theParams[i]->value.data.dblptr[row];
 			   pNull[i] = theParams[i]->value.undef[row];
 			}
-		     if( !(this->value.undef[elem] = (pNull[0] || pNull[1]) ) )
-			this->value.data.dblptr[elem] =
-			   maxvalue( pVals[0].data.dbl, pVals[1].data.dbl );
+		     if( pNull[0] && pNull[1] ) {
+		       this->value.undef[elem] = 1;
+		       this->value.data.dblptr[elem] = 0;
+		     } else if (pNull[0]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] = pVals[1].data.dbl;
+		     } else if (pNull[1]) {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] = pVals[0].data.dbl;
+		     } else {
+		       this->value.undef[elem] = 0;
+		       this->value.data.dblptr[elem] =
+			 maxvalue( pVals[0].data.dbl, pVals[1].data.dbl );
+		     }
 		  }
 	       }
 	    }
@@ -5249,16 +5763,31 @@ static void Do_Deref( Node *this )
 	 }
 	 if( i<0 ) {
 	    for( row=0; row<gParse.nRows; row++ ) {
-	       this->value.undef[row] = theVar->value.undef[elem];
+	       if( this->type==STRING )
+		 this->value.undef[row] = theVar->value.undef[row];
+	       else if( this->type==BITSTR ) 
+		 this->value.undef;  /* Dummy - BITSTRs do not have undefs */
+	       else 
+		 this->value.undef[row] = theVar->value.undef[elem];
+
 	       if( this->type==DOUBLE )
 		  this->value.data.dblptr[row] = 
 		     theVar->value.data.dblptr[elem];
 	       else if( this->type==LONG )
 		  this->value.data.lngptr[row] = 
 		     theVar->value.data.lngptr[elem];
-	       else
+	       else if( this->type==BOOLEAN )
 		  this->value.data.logptr[row] = 
 		     theVar->value.data.logptr[elem];
+	       else {
+		 /* XXX Note, the below expression uses knowledge of
+                    the layout of the string format, namely (nelem+1)
+                    characters per string, followed by (nelem+1)
+                    "undef" values. */
+		  this->value.data.strptr[row][0] = 
+		     theVar->value.data.strptr[0][elem+row];
+		  this->value.data.strptr[row][1] = 0;  /* Null terminate */
+	       }
 	       elem += theVar->value.nelem;
 	    }
 	 } else {
@@ -5274,6 +5803,19 @@ static void Do_Deref( Node *this )
 	     dimVals[0] > theVar->value.naxes[ theVar->value.naxis-1 ] ) {
 	    fferror("Index out of range");
 	    free( this->value.data.ptr );
+	 } else if ( this->type == BITSTR || this->type == STRING ) {
+	    elem = this->value.nelem * (dimVals[0]-1);
+	    for( row=0; row<gParse.nRows; row++ ) {
+	      if (this->value.undef) 
+		this->value.undef[row] = theVar->value.undef[row];
+	      memcpy( (char*)this->value.data.strptr[0]
+		      + row*sizeof(char)*(this->value.nelem+1),
+		      (char*)theVar->value.data.strptr[0] + elem*sizeof(char),
+		      this->value.nelem * sizeof(char) );
+	      /* Null terminate */
+	      this->value.data.strptr[row][this->value.nelem] = 0;
+	      elem += theVar->value.nelem+1;
+	    }	       
 	 } else {
 	    elem = this->value.nelem * (dimVals[0]-1);
 	    for( row=0; row<gParse.nRows; row++ ) {
@@ -5314,16 +5856,32 @@ static void Do_Deref( Node *this )
 	    }
 	    if( i<0 ) {
 	       elem += row*theVar->value.nelem;
-	       this->value.undef[row] = theVar->value.undef[elem];
+
+	       if( this->type==STRING )
+		 this->value.undef[row] = theVar->value.undef[row];
+	       else if( this->type==BITSTR ) 
+		 this->value.undef;  /* Dummy - BITSTRs do not have undefs */
+	       else 
+		 this->value.undef[row] = theVar->value.undef[elem];
+
 	       if( this->type==DOUBLE )
 		  this->value.data.dblptr[row] = 
 		     theVar->value.data.dblptr[elem];
 	       else if( this->type==LONG )
 		  this->value.data.lngptr[row] = 
 		     theVar->value.data.lngptr[elem];
-	       else
+	       else if( this->type==BOOLEAN )
 		  this->value.data.logptr[row] = 
 		     theVar->value.data.logptr[elem];
+	       else {
+		 /* XXX Note, the below expression uses knowledge of
+                    the layout of the string format, namely (nelem+1)
+                    characters per string, followed by (nelem+1)
+                    "undef" values. */
+		  this->value.data.strptr[row][0] = 
+		     theVar->value.data.strptr[0][elem+row];
+		  this->value.data.strptr[row][1] = 0;  /* Null terminate */
+	       }
 	    } else {
 	       fferror("Index out of range");
 	       free( this->value.data.ptr );
@@ -5349,6 +5907,17 @@ static void Do_Deref( Node *this )
 		dimVals[0] > theVar->value.naxes[ theVar->value.naxis-1 ] ) {
 	       fferror("Index out of range");
 	       free( this->value.data.ptr );
+	    } else if ( this->type == BITSTR || this->type == STRING ) {
+	      elem = this->value.nelem * (dimVals[0]-1);
+	      elem += row*(theVar->value.nelem+1);
+	      if (this->value.undef) 
+		this->value.undef[row] = theVar->value.undef[row];
+	      memcpy( (char*)this->value.data.strptr[0]
+		      + row*sizeof(char)*(this->value.nelem+1),
+		      (char*)theVar->value.data.strptr[0] + elem*sizeof(char),
+		      this->value.nelem * sizeof(char) );
+	      /* Null terminate */
+	      this->value.data.strptr[row][this->value.nelem] = 0;
 	    } else {
 	       elem  = this->value.nelem * (dimVals[0]-1);
 	       elem += row*theVar->value.nelem;
@@ -5365,7 +5934,10 @@ static void Do_Deref( Node *this )
    }
 
    if( theVar->operation>0 ) {
-      free( theVar->value.data.ptr );
+     if (theVar->type == STRING || theVar->type == BITSTR) 
+       free(theVar->value.data.strptr[0] );
+     else 
+       free( theVar->value.data.ptr );
    }
    for( i=0; i<nDims; i++ )
       if( theDims[i]->operation>0 ) {
diff --git a/f77_wrap.h b/f77_wrap.h
index 2a8987e..fc496e5 100644
--- a/f77_wrap.h
+++ b/f77_wrap.h
@@ -2,15 +2,21 @@
 #include "cfortran.h"
 
 /************************************************************************
-   DEC C creates longs as 8-byte integers.  On most other machines, ints
+   Some platforms creates longs as 8-byte integers.  On other machines, ints
    and longs are both 4-bytes, so both are compatible with Fortrans
-   default integer which is 4-bytes.  To support DECs, we must redefine
+   default integer which is 4-bytes.  To support 8-byte longs, we must redefine
    LONGs and convert them to 8-bytes when going to C, and restore them
    to 4-bytes when returning to Fortran.  Ugh!!!
 *************************************************************************/
 
 #if defined(DECFortran) || (defined(__alpha) && defined(g77Fortran)) \
-    || (defined(mipsFortran) && _MIPS_SZLONG==64)
+    || (defined(mipsFortran)  && _MIPS_SZLONG==64) \
+    || (defined(IBMR2Fortran) && defined(__64BIT__)) \
+    || (defined (g77Fortran)  && defined(__ia64__)) \
+    ||  defined (__sparcv9) \
+    ||  defined (__x86_64__)
+
+#define   LONG8BYTES_INT4BYTES
 
 #undef LONGV_cfSTR
 #undef PLONG_cfSTR
@@ -271,8 +277,8 @@ extern fitsfile *gFitsFiles[];       /*    by Fortran unit numbers       */
   {                 CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)   \
   _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(  TCF(LN,T1,1,0) TCF(LN,T2,2,1) \
     TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \
-    TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,A,1) TCF(LN,TB,B,1) TCF(LN,TC,C,1) \
-    TCF(LN,TD,D,1) TCF(LN,TE,E,1) );                          _Icf(0,K,T0,0,0) \
+    TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) );                          _Icf(0,K,T0,0,0) \
     CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)        _(T0,_cfI) \
   }
 
diff --git a/f77_wrap1.c b/f77_wrap1.c
index 6a3ca3e..03f8a3f 100644
--- a/f77_wrap1.c
+++ b/f77_wrap1.c
@@ -1,4 +1,22 @@
 /************************************************************************
+
+     f77_wrap1.c and f77_wrap2.c have now been split into 4 files to
+     prevent compile-time memory errors (from expansion of compiler commands).
+     f77_wrap1.c was split into f77_wrap1.c and f77_wrap3.c, and
+     f77_wrap2.c was split into f77_wrap2.c and f77_wrap4.c:
+       
+       f77_wrap1.c contains routines operating on whole files and some 
+       utility routines.
+     
+       f77_wrap2.c contains routines operating on primary array, image, 
+       or column elements.
+
+       f77_wrap3.c contains routines operating on headers & keywords.
+
+       f77_wrap4.c contains miscellaneous routines.
+
+     Peter's original comments:
+
      Together, f77_wrap1.c and f77_wrap2.c contain C wrappers for all
      the CFITSIO routines prototyped in fitsio.h, except for the
      generic datatype routines and features not supported in fortran
@@ -105,7 +123,9 @@ int CFits2Unit( fitsfile *fptr )
 
 FCALLSCSUB9(ffiurl,FTIURL,ftiurl,STRING,PSTRING,PSTRING,PSTRING,PSTRING,PSTRING,PSTRING,PSTRING,PINT)
 FCALLSCSUB3(ffrtnm,FTRTNM,ftrtnm,STRING,PSTRING,PINT)
+FCALLSCSUB3(ffexist,FTEXIST,ftexest,STRING,PINT,PINT)
 FCALLSCSUB3(ffextn,FTEXTN,ftextn,STRING,PINT,PINT)
+FCALLSCSUB7(ffrwrg,FTRWRG,ftrwrg,STRING,LONG,INT,PINT,PLONG,PLONG,PINT)
 
 /*---------------- FITS file I/O routines ---------------*/
 
@@ -137,6 +157,42 @@ void Cffnopn( fitsfile **fptr, const char *filename, int iomode, int *status )
 }
 FCALLSCSUB4(Cffnopn,FTNOPN,ftnopn,PFITSUNIT,STRING,INT,PINT)
 
+void Cffdopn( fitsfile **fptr, const char *filename, int iomode, int *status );
+void Cffdopn( fitsfile **fptr, const char *filename, int iomode, int *status )
+{
+   if( *fptr==NULL || *fptr==(fitsfile*)1 ) {
+      ffdopn( fptr, filename, iomode, status );
+   } else {
+      *status = FILE_NOT_OPENED;
+      ffpmsg("Cffdopn tried to use an already opened unit.");
+   }
+}
+FCALLSCSUB4(Cffdopn,FTDOPN,ftdopn,PFITSUNIT,STRING,INT,PINT)
+
+void Cfftopn( fitsfile **fptr, const char *filename, int iomode, int *status );
+void Cfftopn( fitsfile **fptr, const char *filename, int iomode, int *status )
+{
+   if( *fptr==NULL || *fptr==(fitsfile*)1 ) {
+      fftopn( fptr, filename, iomode, status );
+   } else {
+      *status = FILE_NOT_OPENED;
+      ffpmsg("Cfftopn tried to use an already opened unit.");
+   }
+}
+FCALLSCSUB4(Cfftopn,FTTOPN,fttopn,PFITSUNIT,STRING,INT,PINT)
+
+void Cffiopn( fitsfile **fptr, const char *filename, int iomode, int *status );
+void Cffiopn( fitsfile **fptr, const char *filename, int iomode, int *status )
+{
+   if( *fptr==NULL || *fptr==(fitsfile*)1 ) {
+      ffiopn( fptr, filename, iomode, status );
+   } else {
+      *status = FILE_NOT_OPENED;
+      ffpmsg("Cffiopn tried to use an already opened unit.");
+   }
+}
+FCALLSCSUB4(Cffiopn,FTIOPN,ftiopn,PFITSUNIT,STRING,INT,PINT)
+
 void Cffreopen( fitsfile *openfptr, fitsfile **newfptr, int *status );
 void Cffreopen( fitsfile *openfptr, fitsfile **newfptr, int *status )
 {
@@ -176,6 +232,7 @@ void Cfftplt( fitsfile **fptr, const char *filename, const char *tempname,
 FCALLSCSUB4(Cfftplt,FTTPLT,fttplt,PFITSUNIT,STRING,STRING,PINT)
 
 FCALLSCSUB2(ffflus,FTFLUS,ftflus,FITSUNIT,PINT)
+FCALLSCSUB3(ffflsh,FTFLSH,ftflsh,FITSUNIT, INT, PINT)
 
 void Cffclos( int unit, int *status );
 void Cffclos( int unit, int *status )
@@ -207,6 +264,8 @@ FCALLSCSUB2(ffgerr,FTGERR,ftgerr,INT,PSTRING)
 FCALLSCSUB1(ffpmsg,FTPMSG,ftpmsg,STRING)
 FCALLSCSUB1(ffgmsg,FTGMSG,ftgmsg,PSTRING)
 FCALLSCSUB0(ffcmsg,FTCMSG,ftcmsg)
+FCALLSCSUB0(ffpmrk,FTPMRK,ftpmrk)
+FCALLSCSUB0(ffcmrk,FTCMRK,ftcmrk)
 
 void Cffrprt( char *fname, int status );
 void Cffrprt( char *fname, int status )
@@ -247,712 +306,3 @@ FCALLSCSUB5(ffbnfm,FTBNFM,ftbnfm,STRING,PINT,PLONG,PLONG,PINT)
 #define ftgabc_LONGV_A5 A1
 FCALLSCSUB6(ffgabc,FTGABC,ftgabc,INT,STRINGV,INT,PLONG,LONGV,PINT)
 
-/*----------------- write single keywords --------------*/
-FCALLSCSUB3(ffprec,FTPREC,ftprec,FITSUNIT,STRING,PINT)
-FCALLSCSUB3(ffpcom,FTPCOM,ftpcom,FITSUNIT,STRING,PINT)
-FCALLSCSUB4(ffpunt,FTPUNT,ftpunt,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB3(ffphis,FTPHIS,ftphis,FITSUNIT,STRING,PINT)
-FCALLSCSUB2(ffpdat,FTPDAT,ftpdat,FITSUNIT,PINT)
-FCALLSCSUB3(ffgstm,FTGSTM,ftgstm,PSTRING,PINT,PINT)
-FCALLSCSUB4(ffgsdt,FTGSDT,ftgsdt,PINT,PINT,PINT,PINT)
-FCALLSCSUB5(ffdt2s,FTDT2S,ftdt2s,INT,INT,INT,PSTRING,PINT)
-FCALLSCSUB9(fftm2s,FTTM2S,fttm2s,INT,INT,INT,INT,INT,DOUBLE,INT,PSTRING,PINT)
-FCALLSCSUB5(ffs2dt,FTS2DT,fts2dt,STRING,PINT,PINT,PINT,PINT)
-FCALLSCSUB8(ffs2tm,FTS2TM,fts2tm,STRING,PINT,PINT,PINT,PINT,PINT,PDOUBLE,PINT)
-FCALLSCSUB4(ffpkyu,FTPKYU,ftpkyu,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB5(ffpkys,FTPKYS,ftpkys,FITSUNIT,STRING,STRING,STRING,PINT)
-FCALLSCSUB5(ffpkls,FTPKLS,ftpkls,FITSUNIT,STRING,STRING,STRING,PINT)
-FCALLSCSUB2(ffplsw,FTPLSW,ftplsw,FITSUNIT,PINT)
-FCALLSCSUB5(ffpkyl,FTPKYL,ftpkyl,FITSUNIT,STRING,INT,STRING,PINT)
-FCALLSCSUB5(ffpkyj,FTPKYJ,ftpkyj,FITSUNIT,STRING,LONG,STRING,PINT)
-FCALLSCSUB6(ffpkyf,FTPKYF,ftpkyf,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
-FCALLSCSUB6(ffpkye,FTPKYE,ftpkye,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
-FCALLSCSUB6(ffpkyg,FTPKYG,ftpkyg,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
-FCALLSCSUB6(ffpkyd,FTPKYD,ftpkyd,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
-FCALLSCSUB6(ffpkyc,FTPKYC,ftpkyc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
-FCALLSCSUB6(ffpkym,FTPKYM,ftpkym,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
-FCALLSCSUB6(ffpkfc,FTPKFC,ftpkfc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
-FCALLSCSUB6(ffpkfm,FTPKFM,ftpkfm,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
-FCALLSCSUB6(ffpkyt,FTPKYT,ftpkyt,FITSUNIT,STRING,LONG,DOUBLE,STRING,PINT)
-
-#define ftptdm_LONGV_A4 A3
-FCALLSCSUB5(ffptdm,FTPTDM,ftptdm,FITSUNIT,INT,INT,LONGV,PINT)
-
-/*----------------- write array of keywords --------------*/
-#define ftpkns_STRV_A5 NUM_ELEM_ARG(4)
-#define ftpkns_STRV_A6 NUM_ELEM_ARG(4)
-FCALLSCSUB7(ffpkns,FTPKNS,ftpkns,FITSUNIT,STRING,INT,INT,STRINGV,STRINGV,PINT)
-
-/*   Must handle LOGICALV conversion manually... ffpknl uses ints   */
-void Cffpknl( fitsfile *fptr, char *keyroot, int nstart, int nkeys,
-              int *numval, char **comment, int *status );
-void Cffpknl( fitsfile *fptr, char *keyroot, int nstart, int nkeys,
-              int *numval, char **comment, int *status )
-{
-   int i;
- 
-   for( i=0; i<nkeys; i++ )
-      numval[i] = F2CLOGICAL(numval[i]);
-   ffpknl( fptr, keyroot, nstart, nkeys, numval, comment, status );
-   for( i=0; i<nkeys; i++ )
-      numval[i] = C2FLOGICAL(numval[i]);
-}
-#define ftpknl_STRV_A6 NUM_ELEM_ARG(4)
-FCALLSCSUB7(Cffpknl,FTPKNL,ftpknl,FITSUNIT,STRING,INT,INT,INTV,STRINGV,PINT)
-
-#define ftpknj_STRV_A6 NUM_ELEM_ARG(4)
-#define ftpknj_LONGV_A5 A4
-FCALLSCSUB7(ffpknj,FTPKNJ,ftpknj,FITSUNIT,STRING,INT,INT,LONGV,STRINGV,PINT)
-
-#define ftpknf_STRV_A7 NUM_ELEM_ARG(4)
-FCALLSCSUB8(ffpknf,FTPKNF,ftpknf,FITSUNIT,STRING,INT,INT,FLOATV,INT,STRINGV,PINT)
-
-#define ftpkne_STRV_A7 NUM_ELEM_ARG(4)
-FCALLSCSUB8(ffpkne,FTPKNE,ftpkne,FITSUNIT,STRING,INT,INT,FLOATV,INT,STRINGV,PINT)
-
-#define ftpkng_STRV_A7 NUM_ELEM_ARG(4)
-FCALLSCSUB8(ffpkng,FTPKNG,ftpkng,FITSUNIT,STRING,INT,INT,DOUBLEV,INT,STRINGV,PINT)
-
-#define ftpknd_STRV_A7 NUM_ELEM_ARG(4)
-FCALLSCSUB8(ffpknd,FTPKND,ftpknd,FITSUNIT,STRING,INT,INT,DOUBLEV,INT,STRINGV,PINT)
-
-FCALLSCSUB6(ffcpky,FTCPKY,ftcpky,FITSUNIT,FITSUNIT,INT,INT,STRING,PINT)
-
-/*----------------- write required header keywords --------------*/
-#define ftphps_LONGV_A4 A3
-FCALLSCSUB5(ffphps,FTPHPS,ftphps,FITSUNIT,INT,INT,LONGV,PINT)
-
-void Cffphpr( fitsfile *fptr, int simple, int bitpix, int naxis, long naxes[], long pcount, long gcount, int extend, int *status );
-void Cffphpr( fitsfile *fptr, int simple, int bitpix, int naxis, long naxes[], long pcount, long gcount, int extend, int *status )
-{
-   if( gcount==0 ) gcount=1;
-   ffphpr( fptr, simple, bitpix, naxis, naxes, pcount,
-           gcount, extend, status );
-}
-#define ftphpr_LONGV_A5 A4
-FCALLSCSUB9(Cffphpr,FTPHPR,ftphpr,FITSUNIT,LOGICAL,INT,INT,LONGV,LONG,LONG,LOGICAL,PINT)
-
-
-#define ftphtb_STRV_A5 NUM_ELEM_ARG(4)
-#define ftphtb_STRV_A7 NUM_ELEM_ARG(4)
-#define ftphtb_STRV_A8 NUM_ELEM_ARG(4)
-FCALLSCSUB10(ffphtb,FTPHTB,ftphtb,FITSUNIT,LONG,LONG,INT,STRINGV,PLONG,STRINGV,STRINGV,STRING,PINT)
-
-#define ftphbn_STRV_A4 NUM_ELEM_ARG(3)
-#define ftphbn_STRV_A5 NUM_ELEM_ARG(3)
-#define ftphbn_STRV_A6 NUM_ELEM_ARG(3)
-FCALLSCSUB9(ffphbn,FTPHBN,ftphbn,FITSUNIT,LONG,INT,STRINGV,STRINGV,STRINGV,STRING,LONG,PINT)
-
-/*  Archaic names exist for preceding 3 functions...
-    continue supporting them.                           */
-
-#define ftpprh_LONGV_A5 A4
-FCALLSCSUB9(Cffphpr,FTPPRH,ftpprh,FITSUNIT,LOGICAL,INT,INT,LONGV,LONG,LONG,LOGICAL,PINT)
-
-#define ftpbnh_STRV_A4 NUM_ELEM_ARG(3)
-#define ftpbnh_STRV_A5 NUM_ELEM_ARG(3)
-#define ftpbnh_STRV_A6 NUM_ELEM_ARG(3)
-FCALLSCSUB9(ffphbn,FTPBNH,ftpbnh,FITSUNIT,LONG,INT,STRINGV,STRINGV,STRINGV,STRING,LONG,PINT)
-
-#define ftptbh_STRV_A5 NUM_ELEM_ARG(4)
-#define ftptbh_STRV_A7 NUM_ELEM_ARG(4)
-#define ftptbh_STRV_A8 NUM_ELEM_ARG(4)
-#define ftptbh_LONGV_A6 A4
-FCALLSCSUB10(ffphtb,FTPTBH,ftptbh,FITSUNIT,LONG,LONG,INT,STRINGV,LONGV,STRINGV,STRINGV,STRING,PINT)
-
-/*----------------- write template keywords --------------*/
-FCALLSCSUB3(ffpktp,FTPKTP,ftpktp,FITSUNIT,STRING,PINT)
-
-/*------------------ get header information --------------*/
-FCALLSCSUB4(ffghsp,FTGHSP,ftghsp,FITSUNIT,PINT,PINT,PINT)
-FCALLSCSUB4(ffghps,FTGHPS,ftghps,FITSUNIT,PINT,PINT,PINT)
-
-/*------------------ move position in header -------------*/
-FCALLSCSUB3(ffmaky,FTMAKY,ftmaky,FITSUNIT,INT,PINT)
-FCALLSCSUB3(ffmrky,FTMRKY,ftmrky,FITSUNIT,INT,PINT)
-
-/*------------------ read single keywords ----------------*/
-#define ftgnxk_STRV_A2 NUM_ELEM_ARG(3)
-#define ftgnxk_STRV_A4 NUM_ELEM_ARG(5)
-FCALLSCSUB7(ffgnxk,FTGNXK,ftgnxk,FITSUNIT,STRINGV,INT,STRINGV,INT,PSTRING,PINT)
-FCALLSCSUB4(ffgrec,FTGREC,ftgrec,FITSUNIT,INT,PSTRING,PINT)
-FCALLSCSUB4(ffgcrd,FTGCRD,ftgcrd,FITSUNIT,STRING,PSTRING,PINT)
-FCALLSCSUB4(ffgunt,FTGUNT,ftgunt,FITSUNIT,STRING,PSTRING,PINT)
-FCALLSCSUB6(ffgkyn,FTGKYN,ftgkyn,FITSUNIT,INT,PSTRING,PSTRING,PSTRING,PINT)
-FCALLSCSUB5(ffgkey,FTGKEY,ftgkey,FITSUNIT,STRING,PSTRING,PSTRING,PINT)
-
-/*   FTGKYS supported the long string convention but FFGKYS does not,
-     so redirect to FFGKLS.  To handle the pointer to a pointer,
-     manually expand the FCALLSC macro and modify function call.       */
-
-CFextern VOID_cfF(FTGKYS,ftgkys)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTGKYS,ftgkys)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(FITSUNIT,1)
-   QCF(STRING,2)
-   QCF(PSTRING,3)   /*  Defines a character pointer  */
-   QCF(PSTRING,4)
-   QCF(PINT,5)
-
-   ffgkls( TCF(ftgkys,FITSUNIT,1,0)
-           TCF(ftgkys,STRING,2,1)
-           , &B3                        /*  Pass address of pointer  */
-           TCF(ftgkys,PSTRING,4,1)
-           TCF(ftgkys,PINT,5,1)     );
-
-   RCF(FITSUNIT,1)
-   RCF(STRING,2)
-   RCF(PSTRING,3)      /*  Copies as much of pointer as will fit   */
-   RCF(PSTRING,4)      /*     into fortran string and frees space  */
-   RCF(PINT,5)
-}
-
-/*   This is the *real* wrapper to FFGKLS, although it is exactly the
-     same as the one for FFGKYS.  To handle the pointer to a pointer,
-     manually expand the FCALLSC macro and modify function call.       */
-
-CFextern VOID_cfF(FTGKLS,ftgkls)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTGKLS,ftgkls)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(FITSUNIT,1)
-   QCF(STRING,2)
-   QCF(PSTRING,3)   /*  Defines a character pointer  */
-   QCF(PSTRING,4)
-   QCF(PINT,5)
-
-   ffgkls( TCF(ftgkls,FITSUNIT,1,0)
-           TCF(ftgkls,STRING,2,1)
-           , &B3                        /*  Pass address of pointer  */
-           TCF(ftgkls,PSTRING,4,1)
-           TCF(ftgkls,PINT,5,1)     );
-
-   RCF(FITSUNIT,1)
-   RCF(STRING,2)
-   RCF(PSTRING,3)      /*  Copies as much of pointer as will fit   */
-   RCF(PSTRING,4)      /*     into fortran string and frees space  */
-   RCF(PINT,5)
-}
-
-FCALLSCSUB5(ffgkyl,FTGKYL,ftgkyl,FITSUNIT,STRING,PINT,PSTRING,PINT)
-FCALLSCSUB5(ffgkyj,FTGKYJ,ftgkyj,FITSUNIT,STRING,PLONG,PSTRING,PINT)
-FCALLSCSUB5(ffgkye,FTGKYE,ftgkye,FITSUNIT,STRING,PFLOAT,PSTRING,PINT)
-FCALLSCSUB5(ffgkyd,FTGKYD,ftgkyd,FITSUNIT,STRING,PDOUBLE,PSTRING,PINT)
-FCALLSCSUB5(ffgkyc,FTGKYC,ftgkyc,FITSUNIT,STRING,PFLOAT,PSTRING,PINT)
-FCALLSCSUB5(ffgkym,FTGKYM,ftgkym,FITSUNIT,STRING,PDOUBLE,PSTRING,PINT)
-FCALLSCSUB6(ffgkyt,FTGKYT,ftgkyt,FITSUNIT,STRING,PLONG,PDOUBLE,PSTRING,PINT)
-
-#define ftgtdm_LONGV_A5 A3
-FCALLSCSUB6(ffgtdm,FTGTDM,ftgtdm,FITSUNIT,INT,INT,PINT,LONGV,PINT)
-
-/*------------------ read array of keywords -----------------*/
-
-     /*    Handle array of strings such that only the number of     */
-     /*    keywords actually found get copied back to the Fortran   */
-     /*    array.  Faster as well as won't cause array overflows    */
-     /*    if the the array is smaller than nkeys, but larger than  */
-     /*    nfound.                                                  */
-
-#define ftgkns_STRV_A5 NUM_ELEM_ARG(4)
-CFextern VOID_cfF(FTGKNS,ftgkns)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,INT,INT,PSTRINGV,PINT,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTGKNS,ftgkns)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,INT,INT,PSTRINGV,PINT,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(FITSUNIT,1)
-   QCF(STRING,2)
-   QCF(INT,3)
-   QCF(INT,4)
-   QCF(PSTRINGV,5)
-   QCF(PINT,6)
-   QCF(PINT,7)
-
-   ffgkns( TCF(ftgkns,FITSUNIT,1,0)
-           TCF(ftgkns,STRING,2,1)
-           TCF(ftgkns,INT,3,1)
-           TCF(ftgkns,INT,4,1)
-           TCF(ftgkns,PSTRINGV,5,1)   /*  Defines the number of strings  */
-                                      /*  in array, B5N                  */
-           TCF(ftgkns,PINT,6,1)
-           TCF(ftgkns,PINT,7,1)     );
-
-   if ( *A7 )       /*  Redefine number of array elements to  */
-      B5N = 0;      /*  number found, or none if error.       */
-   else
-      B5N = *A6;
-		      
-   RCF(FITSUNIT,1)
-   RCF(STRING,2)
-   RCF(INT,3)
-   RCF(INT,4)
-   RCF(PSTRINGV,5)     /*  Copies only found keywords back to Fortran    */
-   RCF(PINT,6)
-   RCF(PINT,7)
-}
-
-/*   Must handle LOGICALV conversion manually... ffgknl uses ints   */
-void Cffgknl( fitsfile *fptr, char *keyroot, int nstart, int nkeys,
-              int *numval, int *nfound, int *status );
-void Cffgknl( fitsfile *fptr, char *keyroot, int nstart, int nkeys,
-              int *numval, int *nfound, int *status )
-{
-   int i;
- 
-   for( i=0; i<nkeys; i++ )  /*  This preserves array elements across call  */
-      numval[i] = F2CLOGICAL(numval[i]);
-   ffgknl( fptr, keyroot, nstart, nkeys, numval, nfound, status );
-   for( i=0; i<nkeys; i++ )
-      numval[i] = C2FLOGICAL(numval[i]);
-}
-FCALLSCSUB7(Cffgknl,FTGKNL,ftgknl,FITSUNIT,STRING,INT,INT,INTV,PINT,PINT)
-
-#define ftgknj_LONGV_A5 A4
-FCALLSCSUB7(ffgknj,FTGKNJ,ftgknj,FITSUNIT,STRING,INT,INT,LONGV,PINT,PINT)
-FCALLSCSUB7(ffgkne,FTGKNE,ftgkne,FITSUNIT,STRING,INT,INT,FLOATV,PINT,PINT)
-FCALLSCSUB7(ffgknd,FTGKND,ftgknd,FITSUNIT,STRING,INT,INT,DOUBLEV,PINT,PINT)
-
-/*----------------- read required header keywords --------------*/
-#define ftghpr_LONGV_A6 A2
-FCALLSCSUB10(ffghpr,FTGHPR,ftghpr,FITSUNIT,INT,PLOGICAL,PINT,PINT,LONGV,PLONG,PLONG,PLOGICAL,PINT)
-
-
-    /*  The following 2 routines contain 3 string vector parameters,  */
-    /*  intended to hold column information.  Normally the vectors    */
-    /*  are defined with 500-999 elements, but very rarely do tables  */
-    /*  have that many columns.  So, to prevent the allocation of     */
-    /*  240K of memory to hold all these empty strings and the waste  */
-    /*  of CPU time converting Fortran strings to C, *and* back       */
-    /*  again, get the number of columns in the table and only        */
-    /*  process that many strings (or maxdim, if it is smaller).      */
-
-#define ftghtb_STRV_A6 NUM_ELEMS(maxdim)
-#define ftghtb_STRV_A8 NUM_ELEMS(maxdim)
-#define ftghtb_STRV_A9 NUM_ELEMS(maxdim)
-#define ftghtb_LONGV_A7 A2
-CFextern VOID_cfF(FTGHTB,ftghtb)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,INT,PLONG,PLONG,PINT,PSTRINGV,LONGV,PSTRINGV,PSTRINGV,PSTRING,PINT,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTGHTB,ftghtb)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,INT,PLONG,PLONG,PINT,PSTRINGV,LONGV,PSTRINGV,PSTRINGV,PSTRING,PINT,CF_0,CF_0,CF_0))
-{
-   QCF(FITSUNIT,1)
-   QCF(INT,2)
-   QCF(PLONG,3)
-   QCF(PLONG,4)
-   QCF(PINT,5)
-   QCF(PSTRINGV,6)
-   QCF(LONGV,7)
-   QCF(PSTRINGV,8)
-   QCF(PSTRINGV,9)
-   QCF(PSTRING,A)
-   QCF(PINT,B)
-
-   fitsfile *fptr;
-   long tfields;
-   int maxdim,*status;
-
-   fptr = TCF(ftghtb,FITSUNIT,1,0);
-   status =  TCF(ftghtb,PINT,B,0);
-   maxdim =  TCF(ftghtb,INT,2,0);
-   ffgkyj( fptr, "TFIELDS", &tfields, 0, status );
-   maxdim = (maxdim<0) ? tfields : _cfMIN(tfields,maxdim);
-
-   ffghtb(   fptr, maxdim
-             TCF(ftghtb,PLONG,3,1)
-             TCF(ftghtb,PLONG,4,1)
-             TCF(ftghtb,PINT,5,1)
-             TCF(ftghtb,PSTRINGV,6,1)
-             TCF(ftghtb,LONGV,7,1)
-             TCF(ftghtb,PSTRINGV,8,1)
-             TCF(ftghtb,PSTRINGV,9,1)
-             TCF(ftghtb,PSTRING,A,1)
-             , status );
-
-   RCF(FITSUNIT,1)
-   RCF(INT,2)
-   RCF(PLONG,3)
-   RCF(PLONG,4)
-   RCF(PINT,5)
-   RCF(PSTRINGV,6)
-   RCF(LONGV,7)
-   RCF(PSTRINGV,8)
-   RCF(PSTRINGV,9)
-   RCF(PSTRING,A)
-   RCF(PINT,B)
-}
-
-#define ftghbn_STRV_A5 NUM_ELEMS(maxdim)
-#define ftghbn_STRV_A6 NUM_ELEMS(maxdim)
-#define ftghbn_STRV_A7 NUM_ELEMS(maxdim)
-CFextern VOID_cfF(FTGHBN,ftghbn)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,INT,PLONG,PINT,PSTRINGV,PSTRINGV,PSTRINGV,PSTRING,PLONG,PINT,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTGHBN,ftghbn)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,INT,PLONG,PINT,PSTRINGV,PSTRINGV,PSTRINGV,PSTRING,PLONG,PINT,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(FITSUNIT,1)
-   QCF(INT,2)
-   QCF(PLONG,3)
-   QCF(PINT,4)
-   QCF(PSTRINGV,5)
-   QCF(PSTRINGV,6)
-   QCF(PSTRINGV,7)
-   QCF(PSTRING,8)
-   QCF(PLONG,9)
-   QCF(PINT,A)
-
-   fitsfile *fptr;
-   long tfields;
-   int maxdim,*status;
-
-   fptr = TCF(ftghbn,FITSUNIT,1,0);
-   status =  TCF(ftghbn,PINT,A,0);
-   maxdim =  TCF(ftghbn,INT,2,0);
-   ffgkyj( fptr, "TFIELDS", &tfields, 0, status );
-   maxdim = (maxdim<0) ? tfields : _cfMIN(tfields,maxdim);
-
-   ffghbn(   fptr, maxdim
-             TCF(ftghbn,PLONG,3,1)
-             TCF(ftghbn,PINT,4,1)
-             TCF(ftghbn,PSTRINGV,5,1)
-             TCF(ftghbn,PSTRINGV,6,1)
-             TCF(ftghbn,PSTRINGV,7,1)
-             TCF(ftghbn,PSTRING,8,1)
-             TCF(ftghbn,PLONG,9,1)
-             , status );
-
-   RCF(FITSUNIT,1)
-   RCF(INT,2)
-   RCF(PLONG,3)
-   RCF(PINT,4)
-   RCF(PSTRINGV,5)
-   RCF(PSTRINGV,6)
-   RCF(PSTRINGV,7)
-   RCF(PSTRING,8)
-   RCF(PLONG,9)
-   RCF(PINT,A)
-}
-
-    /*   The following 3 routines are obsolete and dangerous to use as       */
-    /*   there is no bounds checking with the arrays.  Call ftghxx instead.  */
-    /*   To get cfortran to work, ftgtbh and ftgbnh require information      */
-    /*   on the array size of the string vectors.  The "TFIELDS" key word    */
-    /*   is read and used as the vector size.  This *will* cause a           */
-    /*   problem if ttype, tform, and tunit are declared with fewer          */
-    /*   elements than the actual number of columns.                         */
-
-#if defined(DECFortran) || (defined(__alpha) && defined(g77Fortran)) \
-    || (defined(mipsFortran) && _MIPS_SZLONG==64)
-    /*   If running under DECFortran, we also need to worry about the length */
-    /*   of the long naxes array.  So read NAXIS manually. :(                */
-
-void Cffgprh( fitsfile *fptr, int *simple, int *bitpix, int *naxis, int naxes[],
-             long *pcount, long *gcount, int *extend, int *status );
-void Cffgprh( fitsfile *fptr, int *simple, int *bitpix, int *naxis, int naxes[],
-             long *pcount, long *gcount, int *extend, int *status )
-{
-   long *LONGnaxes, size;
-
-   ffgkyj( fptr, "NAXIS", &size, 0, status );
-   LONGnaxes = F2Clongv(size,naxes);
-   ffghpr( fptr, (int)size, simple, bitpix, naxis, LONGnaxes,
-           pcount, gcount, extend, status );
-   C2Flongv(size,naxes,LONGnaxes);
-}
-FCALLSCSUB9(Cffgprh,FTGPRH,ftgprh,FITSUNIT,PLOGICAL,PINT,PINT,INTV,PLONG,PLONG,PLOGICAL,PINT)
-
-#else
-
-void Cffgprh( fitsfile *fptr, int *simple, int *bitpix, int *naxis, long naxes[],
-             long *pcount, long *gcount, int *extend, int *status );
-void Cffgprh( fitsfile *fptr, int *simple, int *bitpix, int *naxis, long naxes[],
-             long *pcount, long *gcount, int *extend, int *status )
-{
-   ffghpr( fptr, -1, simple, bitpix, naxis, naxes,
-           pcount, gcount, extend, status );
-}
-#define ftghpr_LONGV_A5 NONE
-FCALLSCSUB9(Cffgprh,FTGPRH,ftgprh,FITSUNIT,PLOGICAL,PINT,PINT,LONGV,PLONG,PLONG,PLOGICAL,PINT)
-
-#endif
-
-#define ftgtbh_STRV_A5 NUM_ELEMS(tfields)
-#define ftgtbh_STRV_A7 NUM_ELEMS(tfields)
-#define ftgtbh_STRV_A8 NUM_ELEMS(tfields)
-CFextern VOID_cfF(FTGTBH,ftgtbh)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,PLONG,PLONG,PINT,PSTRINGV,PLONG,PSTRINGV,PSTRINGV,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTGTBH,ftgtbh)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,PLONG,PLONG,PINT,PSTRINGV,PLONG,PSTRINGV,PSTRINGV,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(FITSUNIT,1)
-   QCF(PLONG,2)
-   QCF(PLONG,3)
-   QCF(PINT,4)
-   QCF(PSTRINGV,5)
-   QCF(PLONG,6)
-   QCF(PSTRINGV,7)
-   QCF(PSTRINGV,8)
-   QCF(PSTRING,9)
-   QCF(PINT,A)
-
-   fitsfile *fptr;
-   long tfields;
-   int *status;
-
-   fptr = TCF(ftgtbh,FITSUNIT,1,0);
-   status =  TCF(ftgtbh,PINT,A,0);
-   ffgkyj( fptr, "TFIELDS", &tfields, 0, status );
-
-   ffghtb(   fptr, (int)tfields
-             TCF(ftgtbh,PLONG,2,1)
-             TCF(ftgtbh,PLONG,3,1)
-             TCF(ftgtbh,PINT,4,1)
-             TCF(ftgtbh,PSTRINGV,5,1)
-             TCF(ftgtbh,PLONG,6,1)
-             TCF(ftgtbh,PSTRINGV,7,1)
-             TCF(ftgtbh,PSTRINGV,8,1)
-             TCF(ftgtbh,PSTRING,9,1)
-             , status );
-
-   RCF(FITSUNIT,1)
-   RCF(PLONG,2)
-   RCF(PLONG,3)
-   RCF(PINT,4)
-   RCF(PSTRINGV,5)
-   RCF(PLONG,6)
-   RCF(PSTRINGV,7)
-   RCF(PSTRINGV,8)
-   RCF(PSTRING,9)
-   RCF(PINT,A)
-}
-
-#define ftgbnh_STRV_A4 NUM_ELEMS(tfields)
-#define ftgbnh_STRV_A5 NUM_ELEMS(tfields)
-#define ftgbnh_STRV_A6 NUM_ELEMS(tfields)
-CFextern VOID_cfF(FTGBNH,ftgbnh)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,PLONG,PINT,PSTRINGV,PSTRINGV,PSTRINGV,PSTRING,PLONG,PINT,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTGBNH,ftgbnh)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,PLONG,PINT,PSTRINGV,PSTRINGV,PSTRINGV,PSTRING,PLONG,PINT,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(FITSUNIT,1)
-   QCF(PLONG,2)
-   QCF(PINT,3)
-   QCF(PSTRINGV,4)
-   QCF(PSTRINGV,5)
-   QCF(PSTRINGV,6)
-   QCF(PSTRING,7)
-   QCF(PLONG,8)
-   QCF(PINT,9)
-
-   fitsfile *fptr;
-   long tfields;
-   int *status;
-
-   fptr = TCF(ftgbnh,FITSUNIT,1,0);
-   status =  TCF(ftgbnh,PINT,9,0);
-   ffgkyj( fptr, "TFIELDS", &tfields, 0, status );
-
-   ffghbn(   fptr, (int)tfields
-             TCF(ftgbnh,PLONG,2,1)
-             TCF(ftgbnh,PINT,3,1)
-             TCF(ftgbnh,PSTRINGV,4,1)
-             TCF(ftgbnh,PSTRINGV,5,1)
-             TCF(ftgbnh,PSTRINGV,6,1)
-             TCF(ftgbnh,PSTRING,7,1)
-             TCF(ftgbnh,PLONG,8,1)
-             , status );
-
-   RCF(FITSUNIT,1)
-   RCF(PLONG,2)
-   RCF(PINT,3)
-   RCF(PSTRINGV,4)
-   RCF(PSTRINGV,5)
-   RCF(PSTRINGV,6)
-   RCF(PSTRING,7)
-   RCF(PLONG,8)
-   RCF(PINT,9)
-}
-
-
-/*--------------------- update keywords ---------------*/
-FCALLSCSUB4(ffucrd,FTUCRD,ftucrd,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB4(ffukyu,FTUKYU,ftukyu,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB5(ffukys,FTUKYS,ftukys,FITSUNIT,STRING,STRING,STRING,PINT)
-FCALLSCSUB5(ffukls,FTUKLS,ftukls,FITSUNIT,STRING,STRING,STRING,PINT)
-FCALLSCSUB5(ffukyl,FTUKYL,ftukyl,FITSUNIT,STRING,INT,STRING,PINT)
-FCALLSCSUB5(ffukyj,FTUKYJ,ftukyj,FITSUNIT,STRING,LONG,STRING,PINT)
-FCALLSCSUB6(ffukyf,FTUKYF,ftukyf,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
-FCALLSCSUB6(ffukye,FTUKYE,ftukye,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
-FCALLSCSUB6(ffukyg,FTUKYG,ftukyg,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
-FCALLSCSUB6(ffukyd,FTUKYD,ftukyd,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
-FCALLSCSUB6(ffukyc,FTUKYC,ftukyc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
-FCALLSCSUB6(ffukym,FTUKYM,ftukym,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
-FCALLSCSUB6(ffukfc,FTUKFC,ftukfc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
-FCALLSCSUB6(ffukfm,FTUKFM,ftukfm,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
-
-/*--------------------- modify keywords ---------------*/
-FCALLSCSUB4(ffmrec,FTMREC,ftmrec,FITSUNIT,INT,STRING,PINT)
-FCALLSCSUB4(ffmcrd,FTMCRD,ftmcrd,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB4(ffmnam,FTMNAM,ftmnam,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB4(ffmcom,FTMCOM,ftmcom,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB4(ffmkyu,FTMKYU,ftmkyu,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB5(ffmkys,FTMKYS,ftmkys,FITSUNIT,STRING,STRING,STRING,PINT)
-FCALLSCSUB5(ffmkls,FTMKLS,ftmkls,FITSUNIT,STRING,STRING,STRING,PINT)
-FCALLSCSUB5(ffmkyl,FTMKYL,ftmkyl,FITSUNIT,STRING,INT,STRING,PINT)
-FCALLSCSUB5(ffmkyj,FTMKYJ,ftmkyj,FITSUNIT,STRING,LONG,STRING,PINT)
-FCALLSCSUB6(ffmkyf,FTMKYF,ftmkyf,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
-FCALLSCSUB6(ffmkye,FTMKYE,ftmkye,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
-FCALLSCSUB6(ffmkyg,FTMKYG,ftmkyg,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
-FCALLSCSUB6(ffmkyd,FTMKYD,ftmkyd,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
-FCALLSCSUB6(ffmkyc,FTMKYC,ftmkyc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
-FCALLSCSUB6(ffmkym,FTMKYM,ftmkym,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
-FCALLSCSUB6(ffmkfc,FTMKFC,ftmkfc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
-FCALLSCSUB6(ffmkfm,FTMKFM,ftmkfm,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
-
-/*--------------------- insert keywords ---------------*/
-FCALLSCSUB4(ffirec,FTIREC,ftirec,FITSUNIT,INT,STRING,PINT)
-FCALLSCSUB4(ffikyu,FTIKYU,ftikyu,FITSUNIT,STRING,STRING,PINT)
-FCALLSCSUB5(ffikys,FTIKYS,ftikys,FITSUNIT,STRING,STRING,STRING,PINT)
-FCALLSCSUB5(ffikls,FTIKLS,ftikls,FITSUNIT,STRING,STRING,STRING,PINT)
-FCALLSCSUB5(ffikyl,FTIKYL,ftikyl,FITSUNIT,STRING,INT,STRING,PINT)
-FCALLSCSUB5(ffikyj,FTIKYJ,ftikyj,FITSUNIT,STRING,LONG,STRING,PINT)
-FCALLSCSUB6(ffikyf,FTIKYF,ftikyf,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
-FCALLSCSUB6(ffikye,FTIKYE,ftikye,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
-FCALLSCSUB6(ffikyg,FTIKYG,ftikyg,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
-FCALLSCSUB6(ffikyd,FTIKYD,ftikyd,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
-FCALLSCSUB6(ffikyc,FTIKYC,ftikyc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
-FCALLSCSUB6(ffikym,FTIKYM,ftikym,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
-FCALLSCSUB6(ffikfc,FTIKFC,ftikfc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
-FCALLSCSUB6(ffikfm,FTIKFM,ftikfm,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
-
-/*--------------------- delete keywords ---------------*/
-FCALLSCSUB3(ffdkey,FTDKEY,ftdkey,FITSUNIT,STRING,PINT)
-FCALLSCSUB3(ffdrec,FTDREC,ftdrec,FITSUNIT,INT,PINT)
-
-/*--------------------- get HDU information -------------*/
-FCALLSCSUB2(ffghdn,FTGHDN,ftghdn,FITSUNIT,PINT)
-FCALLSCSUB3(ffghdt,FTGHDT,ftghdt,FITSUNIT,PINT,PINT)
-
-FCALLSCSUB5(ffghad,FTGHAD,ftghad,FITSUNIT,PLONG,PLONG,PLONG,PINT)
-
-FCALLSCSUB3(ffgidt,FTGIDT,ftgidt,FITSUNIT,PINT,PINT)
-FCALLSCSUB3(ffgidm,FTGIDM,ftgidm,FITSUNIT,PINT,PINT)
-
-#define ftgisz_LONGV_A3 A2
-FCALLSCSUB4(ffgisz,FTGISZ,ftgisz,FITSUNIT,INT,LONGV,PINT)
-
-#define ftgipr_LONGV_A5 A2
-FCALLSCSUB6(ffgipr,FTGIPR,ftgipr,FITSUNIT,INT,PINT,PINT,LONGV,PINT)
-
-/*--------------------- HDU operations -------------*/
-FCALLSCSUB4(ffmahd,FTMAHD,ftmahd,FITSUNIT,INT,PINT,PINT)
-FCALLSCSUB4(ffmrhd,FTMRHD,ftmrhd,FITSUNIT,INT,PINT,PINT)
-FCALLSCSUB5(ffmnhd,FTMNHD,ftmnhd,FITSUNIT,INT,STRING,INT,PINT)
-FCALLSCSUB3(ffthdu,FTTHDU,ftthdu,FITSUNIT,PINT,PINT)
-FCALLSCSUB2(ffcrhd,FTCRHD,ftcrhd,FITSUNIT,PINT)
-
-#define ftcrim_LONGV_A4 A3
-FCALLSCSUB5(ffcrim,FTCRIM,ftcrim,FITSUNIT,INT,INT,LONGV,PINT)
-
-#define ftcrtb_STRV_A5 NUM_ELEM_ARG(4)
-#define ftcrtb_STRV_A6 NUM_ELEM_ARG(4)
-#define ftcrtb_STRV_A7 NUM_ELEM_ARG(4)
-FCALLSCSUB9(ffcrtb,FTCRTB,ftcrtb,FITSUNIT,INT,LONG,INT,STRINGV,STRINGV,STRINGV,STRING,PINT)
-
-#define ftiimg_LONGV_A4 A3
-FCALLSCSUB5(ffiimg,FTIIMG,ftiimg,FITSUNIT,INT,INT,LONGV,PINT)
-
-#define ftitab_STRV_A5 NUM_ELEM_ARG(4)
-#define ftitab_LONGV_A6 A4
-#define ftitab_STRV_A7 NUM_ELEM_ARG(4)
-#define ftitab_STRV_A8 NUM_ELEM_ARG(4)
-FCALLSCSUB10(ffitab,FTITAB,ftitab,FITSUNIT,LONG,LONG,INT,STRINGV,LONGV,STRINGV,STRINGV,STRING,PINT)
-
-#define ftibin_STRV_A4 NUM_ELEM_ARG(3)
-#define ftibin_STRV_A5 NUM_ELEM_ARG(3)
-#define ftibin_STRV_A6 NUM_ELEM_ARG(3)
-FCALLSCSUB9(ffibin,FTIBIN,ftibin,FITSUNIT,LONG,INT,STRINGV,STRINGV,STRINGV,STRING,LONG,PINT)
-
-#define ftrsim_LONGV_A4 A3
-FCALLSCSUB5(ffrsim,FTRSIM,ftrsim,FITSUNIT,INT,INT,LONGV,PINT)
-FCALLSCSUB3(ffdhdu,FTDHDU,ftdhdu,FITSUNIT,PINT,PINT)
-FCALLSCSUB4(ffcopy,FTCOPY,ftcopy,FITSUNIT,FITSUNIT,INT,PINT)
-FCALLSCSUB3(ffcphd,FTCPHD,ftcphd,FITSUNIT,FITSUNIT,PINT)
-FCALLSCSUB3(ffcpdt,FTCPDT,ftcpdt,FITSUNIT,FITSUNIT,PINT)
-FCALLSCSUB2(ffchfl,FTCHFL,ftchfl,FITSUNIT,PINT)
-FCALLSCSUB2(ffcdfl,FTCDFL,ftcdfl,FITSUNIT,PINT)
-
-FCALLSCSUB2(ffrdef,FTRDEF,ftrdef,FITSUNIT,PINT)
-FCALLSCSUB3(ffhdef,FTHDEF,fthdef,FITSUNIT,INT,PINT)
-FCALLSCSUB3(ffpthp,FTPTHP,ftpthp,FITSUNIT,LONG,PINT)
-
-FCALLSCSUB2(ffpcks,FTPCKS,ftpcks,FITSUNIT,PINT)
-FCALLSCSUB4(ffvcks,FTVCKS,ftvcks,FITSUNIT,PINT,PINT,PINT)
-
-     /*  Checksum changed from double to long  */
-
-void Cffgcks( fitsfile *fptr, double *datasum, double *hdusum, int *status );
-void Cffgcks( fitsfile *fptr, double *datasum, double *hdusum, int *status )
-{
-   unsigned long data, hdu;
-
-   ffgcks( fptr, &data, &hdu, status );
-   *datasum = data;
-   *hdusum  = hdu;
-}
-FCALLSCSUB4(Cffgcks,FTGCKS,ftgcks,FITSUNIT,PDOUBLE,PDOUBLE,PINT)
-
-void Cffcsum( fitsfile *fptr, long nrec, double *dsum, int *status );
-void Cffcsum( fitsfile *fptr, long nrec, double *dsum, int *status )
-{
-   unsigned long sum;
-
-   ffcsum( fptr, nrec, &sum, status );
-   *dsum = sum;
-}
-FCALLSCSUB4(Cffcsum,FTCSUM,ftcsum,FITSUNIT,LONG,PDOUBLE,PINT)
-
-void Cffesum( double dsum, int complm, char *ascii );
-void Cffesum( double dsum, int complm, char *ascii )
-{
-   unsigned long sum=(unsigned long)dsum;
-
-   ffesum( sum, complm, ascii );
-}
-FCALLSCSUB3(Cffesum,FTESUM,ftesum,DOUBLE,LOGICAL,PSTRING)
-
-void Cffdsum( char *ascii, int complm, double *dsum );
-void Cffdsum( char *ascii, int complm, double *dsum )
-{
-   unsigned long sum;
-
-   ffdsum( ascii, complm, &sum );
-   *dsum = sum;
-}
-FCALLSCSUB3(Cffdsum,FTDSUM,ftdsum,PSTRING,LOGICAL,PDOUBLE)
-
-     /*   Name changed, so support both versions   */
-FCALLSCSUB2(ffupck,FTUPCK,ftupck,FITSUNIT,PINT)
-FCALLSCSUB2(ffupck,FTUCKS,ftucks,FITSUNIT,PINT)
-
-/*--------------- define scaling or null values -------------*/
-FCALLSCSUB4(ffpscl,FTPSCL,ftpscl,FITSUNIT,DOUBLE,DOUBLE,PINT)
-FCALLSCSUB3(ffpnul,FTPNUL,ftpnul,FITSUNIT,LONG,PINT)
-FCALLSCSUB5(fftscl,FTTSCL,fttscl,FITSUNIT,INT,DOUBLE,DOUBLE,PINT)
-FCALLSCSUB4(fftnul,FTTNUL,fttnul,FITSUNIT,INT,LONG,PINT)
-FCALLSCSUB4(ffsnul,FTSNUL,ftsnul,FITSUNIT,INT,STRING,PINT)
-
-/*--------------------- get column information -------------*/
-FCALLSCSUB5(ffgcno,FTGCNO,ftgcno,FITSUNIT,LOGICAL,STRING,PINT,PINT)
-FCALLSCSUB6(ffgcnn,FTGCNN,ftgcnn,FITSUNIT,LOGICAL,STRING,PSTRING,PINT,PINT)
-FCALLSCSUB3(ffgnrw,FTGNRW,ftgnrw,FITSUNIT,PLONG,PINT)
-FCALLSCSUB3(ffgncl,FTGNCL,ftgncl,FITSUNIT,PINT,PINT)
-FCALLSCSUB4(ffgcdw,FTGCDW,ftgcdw,FITSUNIT,INT,PINT,PINT)
-
-FCALLSCSUB6(ffgtcl,FTGTCL,ftgtcl,FITSUNIT,INT,PINT,PLONG,PLONG,PINT)
-FCALLSCSUB11(ffgacl,FTGACL,ftgacl,FITSUNIT,INT,PSTRING,PLONG,PSTRING,PSTRING,PDOUBLE,PDOUBLE,PSTRING,PSTRING,PINT)
-FCALLSCSUB11(ffgbcl,FTGBCL,ftgbcl,FITSUNIT,INT,PSTRING,PSTRING,PSTRING,PLONG,PDOUBLE,PDOUBLE,PLONG,PSTRING,PINT)
-FCALLSCSUB3(ffgrsz,FTGRSZ,ftgrsz,FITSUNIT,PLONG,PINT)
-
-
diff --git a/f77_wrap2.c b/f77_wrap2.c
index 3c148cc..42dd727 100644
--- a/f77_wrap2.c
+++ b/f77_wrap2.c
@@ -1,4 +1,22 @@
 /************************************************************************
+
+     f77_wrap1.c and f77_wrap2.c have now been split into 4 files to
+     prevent compile-time memory errors (from expansion of compiler commands).
+     f77_wrap1.c was split into f77_wrap1.c and f77_wrap3.c, and
+     f77_wrap2.c was split into f77_wrap2.c and f77_wrap4.c:
+       
+       f77_wrap1.c contains routines operating on whole files and some 
+       utility routines.
+     
+       f77_wrap2.c contains routines operating on primary array, image, 
+       or column elements.
+
+       f77_wrap3.c contains routines operating on headers & keywords.
+
+       f77_wrap4.c contains miscellaneous routines.
+
+     Peter's original comments:
+
      Together, f77_wrap1.c and f77_wrap2.c contain C wrappers for all
      the CFITSIO routines prototyped in fitsio.h, except for the
      generic datatype routines and features not supported in fortran
@@ -542,6 +560,7 @@ FCALLSCSUB6(ffptbb,FTPTBS,ftptbs,FITSUNIT,LONG,LONG,LONG,BYTEV,PINT)
 
 FCALLSCSUB4(ffirow,FTIROW,ftirow,FITSUNIT,LONG,LONG,PINT)
 FCALLSCSUB4(ffdrow,FTDROW,ftdrow,FITSUNIT,LONG,LONG,PINT)
+FCALLSCSUB3(ffdrrg,FTDRRG,ftdrrg,FITSUNIT,STRING,PINT)
 #define ftdrws_LONGV_A2 A3
 FCALLSCSUB4(ffdrws,FTDRWS,ftdrws,FITSUNIT,LONGV,LONG,PINT)
 FCALLSCSUB5(fficol,FTICOL,fticol,FITSUNIT,INT,STRING,STRING,PINT)
@@ -552,530 +571,3 @@ FCALLSCSUB6(fficls,FTICLS,fticls,FITSUNIT,INT,INT,STRINGV,STRINGV,PINT)
 FCALLSCSUB4(ffmvec,FTMVEC,ftmvec,FITSUNIT,INT,LONG,PINT)
 FCALLSCSUB3(ffdcol,FTDCOL,ftdcol,FITSUNIT,INT,PINT)
 FCALLSCSUB6(ffcpcl,FTCPCL,ftcpcl,FITSUNIT,FITSUNIT,INT,INT,INT,PINT)
-
-/*********************************************************************/
-/*                     Iterator Functions                            */
-/*********************************************************************/
-
-/* Use a simple ellipse prototype for Fwork_fn to satisfy finicky compilers */
-typedef struct {
-   void *userData;
-   void (*Fwork_fn)(PLONG_cfTYPE *total_n, ...);
-} FtnUserData;
-
-/*        Declare protoypes to make C++ happy       */
-int Cwork_fn(long, long, long, long, int, iteratorCol *, void *);
-void Cffiter( int n_cols, int *units, int *colnum, char *colname[], 
-	      int *datatype, int *iotype,
-              long offset, long n_per_loop, void *Fwork_fn,
-	      void *userData, int *status);
-
-/******************************************************************/
-/*  Cffiter is the wrapper for CFITSIO's ffiter which takes most  */
-/*  of its arguments via a structure, iteratorCol.  This routine  */
-/*  takes a list of arrays and converts them into a single array  */
-/*  of type iteratorCol and passes it to CFITSIO.  Because ffiter */
-/*  will be passing control to a Fortran work function, the C     */
-/*  wrapper, Cwork_fn, must be passed in its place which then     */
-/*  calls the Fortran routine after the necessary data            */
-/*  manipulation.  The Fortran routine is passed via the user-    */
-/*  supplied parameter pointer.                                   */
-/******************************************************************/
-
-void Cffiter( int n_cols, int *units, int *colnum, char *colname[], 
-	      int *datatype, int *iotype,
-              long offset, long n_per_loop, void *Fwork_fn,
-	      void *userData, int *status)
-{
-   iteratorCol *cols;
-   int i;
-   FtnUserData FuserData;
-
-   FuserData.Fwork_fn = (void(*)(PLONG_cfTYPE *,...))Fwork_fn;
-   FuserData.userData = userData;
-
-   cols = (iteratorCol *)malloc( n_cols*sizeof(iteratorCol) );
-   if( cols==NULL ) {
-      *status = MEMORY_ALLOCATION;
-      return;
-   }
-   for(i=0;i<n_cols;i++) {
-      cols[i].fptr     = gFitsFiles[ units[i] ];
-      cols[i].colnum   = colnum[i];
-      strncpy(cols[i].colname,colname[i],70);
-      cols[i].datatype = datatype[i];
-      cols[i].iotype   = iotype[i];
-   }
-
-   ffiter( n_cols, cols, offset, n_per_loop, Cwork_fn, 
-	   (void*)&FuserData, status );
-   free(cols);
-}
-#define ftiter_STRV_A4 NUM_ELEM_ARG(1)
-FCALLSCSUB11(Cffiter,FTITER,ftiter,INT,INTV,INTV,STRINGV,INTV,INTV,LONG,LONG,PVOID,PVOID,PINT)
-
-/*-----------------------------------------------------------------*/
-/*  This function is called by CFITSIO's ffiter and serves as the  */
-/*  wrapper for the Fortran work function which is passed in the   */
-/*  extra user-supplied pointer.  It breaks up C's iteratorCol     */
-/*  into several separate arrays.  Because we cannot send an       */
-/*  array of pointers for the column data, we instead send *many*  */
-/*  arrays as final parameters.                                    */
-/*-----------------------------------------------------------------*/
-
-int Cwork_fn( long total_n, long offset,       long first_n,    long n_values,
-	      int n_cols,   iteratorCol *cols, void *FuserData )
-{
-   int  *units, *colnum, *datatype, *iotype, *repeat;
-   char **sptr;
-   void **ptrs;
-   int  i,j,k,nstr,status=0;
-   long *slen;
-
-#ifdef vmsFortran
-   /*  Passing strings under VMS require a special structure  */
-   fstringvector *vmsStrs;
-#endif
-
-   /*  Allocate memory for all the arrays.  Grab all the int's  */
-   /*  at once and divide up among parameters                   */
-
-   ptrs  = (void**)malloc(2*n_cols*sizeof(void*));
-   if( ptrs==NULL )
-      return( MEMORY_ALLOCATION );
-   units = (int*)malloc(5*n_cols*sizeof(int));
-   if( units==NULL ) {
-      free(ptrs);
-      return( MEMORY_ALLOCATION );
-   }
-   colnum   = units + 1 * n_cols;
-   datatype = units + 2 * n_cols;
-   iotype   = units + 3 * n_cols;
-   repeat   = units + 4 * n_cols;
-
-   nstr = 0;
-   slen = (long*)(ptrs+n_cols);
-#ifdef vmsFortran
-   vmsStrs = (fstringvector *)calloc(sizeof(fstringvector),n_cols);
-   if( vmsStrs==NULL ) {
-      free(ptrs);
-      free(units);
-      return( MEMORY_ALLOCATION );
-   }
-#endif
-
-   for(i=0;i<n_cols;i++) {
-      for(j=0;j<MAXFITSFILES;j++)
-	 if( cols[i].fptr==gFitsFiles[j] )
-	    units[i] = j;
-      colnum[i]   = cols[i].colnum;
-      datatype[i] = cols[i].datatype;
-      iotype[i]   = cols[i].iotype;
-      repeat[i]   = cols[i].repeat;
-
-      if( datatype[i]==TLOGICAL ) {
-	 /*  Don't forget first element is null value  */
-	 ptrs[i] = (void *)malloc( (n_values*repeat[i]+1)*4 );
-	 if( ptrs[i]==NULL ) {
-	    free(ptrs);
-	    free(units);
-	    return( MEMORY_ALLOCATION );
-	 }
-	 for( j=0;j<=n_values*repeat[i]; j++ )
-	    ((int*)ptrs[i])[j] = C2FLOGICAL( ((char*)cols[i].array)[j]);
-      } else if ( datatype[i]==TSTRING ) {
-	 sptr = (char**)cols[i].array;
-	 slen[nstr] = sptr[1] - sptr[0];
-	 for(j=0;j<=n_values;j++)
-	    for(k=strlen( sptr[j] );k<slen[nstr];k++)
-	       sptr[j][k] = ' ';
-#ifdef vmsFortran
-	 vmsStrs[nstr].dsc$a_pointer         = sptr[0];
-	 vmsStrs[nstr].dsc$w_length          = slen[nstr];
-	 vmsStrs[nstr].dsc$l_m[0]            = n_values+1;
-	 vmsStrs[nstr].dsc$l_arsize          = slen[nstr] * (n_values+1);
-	 vmsStrs[nstr].dsc$bounds[0].dsc$l_u = n_values+1;
-	 vmsStrs[nstr].dsc$a_a0              = sptr[0] - slen[nstr];
-	 ptrs[i] = (void *)(vmsStrs+nstr);
-#else
-	 ptrs[i] = (void *)sptr[0];
-#endif
-	 nstr++;
-      } else
-	 ptrs[i] = (void *)cols[i].array;
-   }
-
-   if(!status) {
-              /*  Handle Fortran function call manually...  */
-	      /*  cfortran.h cannot handle all the desired  */
-              /*  'ptrs' nor the indirect function call.    */
-
-      PLONG_cfTYPE a1,a2,a3,a4;    /* Do this in case longs are */ 
-      FtnUserData *f;              /* not the same size as ints */
-
-      a1 = total_n;
-      a2 = offset;
-      a3 = first_n;
-      a4 = n_values;
-      f  = (FtnUserData *)FuserData;
-
-      f->Fwork_fn(&a1,&a2,&a3,&a4,&n_cols,units,colnum,datatype,
-		  iotype,repeat,&status,f->userData,
-		  ptrs[ 0], ptrs[ 1], ptrs[ 2], ptrs[ 3], ptrs[ 4],
-		  ptrs[ 5], ptrs[ 6], ptrs[ 7], ptrs[ 8], ptrs[ 9],
-		  ptrs[10], ptrs[11], ptrs[12], ptrs[13], ptrs[14],
-		  ptrs[15], ptrs[16], ptrs[17], ptrs[18], ptrs[19],
-		  ptrs[20], ptrs[21], ptrs[22], ptrs[23], ptrs[24] );
-   }
-
-   /*  Check whether there are any LOGICAL or STRING columns being outputted  */
-   nstr=0;
-   for( i=0;i<n_cols;i++ ) {
-      if( iotype[i]!=InputCol ) {
-	 if( datatype[i]==TLOGICAL ) {
-	    for( j=0;j<=n_values*repeat[i];j++ )
-	       ((char*)cols[i].array)[j] = F2CLOGICAL( ((int*)ptrs[i])[j] );
-	    free(ptrs[i]);
-	 } else if( datatype[i]==TSTRING ) {
-	    for( j=0;j<=n_values;j++ )
-	       ((char**)cols[i].array)[j][slen[nstr]-1] = '\0';
-	 }
-      }
-      if( datatype[i]==TSTRING ) nstr++;
-   }
-
-   free(ptrs);
-   free(units);
-#ifdef vmsFortran
-   free(vmsStrs);
-#endif
-   return(status);
-}
-
-
-/*--------------------- WCS Utilities ----------------------------*/
-FCALLSCSUB10(ffgics,FTGICS,ftgics,FITSUNIT,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PSTRING,PINT)
-FCALLSCSUB12(ffgtcs,FTGTCS,ftgtcs,FITSUNIT,INT,INT,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PSTRING,PINT)
-FCALLSCSUB13(ffwldp,FTWLDP,ftwldp,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,STRING,PDOUBLE,PDOUBLE,PINT)
-FCALLSCSUB13(ffxypx,FTXYPX,ftxypx,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,STRING,PDOUBLE,PDOUBLE,PINT)
-
-/*------------------- Conversion Utilities -----------------*/
-/*                 (prototyped in fitsio2.h)                */
-/*----------------------------------------------------------*/
-
-CFextern VOID_cfF(FTI2C,fti2c)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LONG,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTI2C,fti2c)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LONG,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(LONG,1)
-   QCF(PSTRING,2)
-   QCF(PINT,3)
-   char str[21];
-
-   ffi2c( TCF(fti2c,LONG,1,0) 
-          TCF(fti2c,PSTRING,2,1) 
-          TCF(fti2c,PINT,3,1) );
-
-   sprintf(str,"%20s",B2);
-   strcpy(B2,str);
-
-   RCF(LONG,1)
-   RCF(PSTRING,2)
-   RCF(PINT,3)
-}
-
-CFextern VOID_cfF(FTL2C,ftl2c)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LOGICAL,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTL2C,ftl2c)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LOGICAL,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(LOGICAL,1)
-   QCF(PSTRING,2)
-   QCF(PINT,3)
-   char str[21];
-
-   ffl2c( TCF(ftl2c,LOGICAL,1,0) 
-          TCF(ftl2c,PSTRING,2,1) 
-          TCF(ftl2c,PINT,3,1) );
-
-   sprintf(str,"%20s",B2);
-   strcpy(B2,str);
-
-   RCF(LOGICAL,1)
-   RCF(PSTRING,2)
-   RCF(PINT,3)
-}
-
-FCALLSCSUB3(ffs2c,FTS2C,fts2c,STRING,PSTRING,PINT)
-
-CFextern VOID_cfF(FTR2F,ftr2f)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FLOAT,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTR2F,ftr2f)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FLOAT,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(FLOAT,1)
-   QCF(INT,2)
-   QCF(PSTRING,3)
-   QCF(PINT,4)
-   char str[21];
-
-   ffr2f( TCF(ftr2f,FLOAT,1,0) 
-          TCF(ftr2f,INT,2,1) 
-          TCF(ftr2f,PSTRING,3,1) 
-          TCF(ftr2f,PINT,4,1) );
-
-   sprintf(str,"%20s",B3);
-   strcpy(B3,str);
-
-   RCF(FLOAT,1)
-   RCF(INT,2)
-   RCF(PSTRING,3)
-   RCF(PINT,4)
-}
-
-CFextern VOID_cfF(FTR2E,ftr2e)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FLOAT,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTR2E,ftr2e)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FLOAT,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(FLOAT,1)
-   QCF(INT,2)
-   QCF(PSTRING,3)
-   QCF(PINT,4)
-   char str[21];
-
-   ffr2e( TCF(ftr2e,FLOAT,1,0) 
-          TCF(ftr2e,INT,2,1) 
-          TCF(ftr2e,PSTRING,3,1) 
-          TCF(ftr2e,PINT,4,1) );
-
-   sprintf(str,"%20s",B3);
-   strcpy(B3,str);
-
-   RCF(FLOAT,1)
-   RCF(INT,2)
-   RCF(PSTRING,3)
-   RCF(PINT,4)
-}
-
-CFextern VOID_cfF(FTD2F,ftd2f)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),DOUBLE,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTD2F,ftd2f)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),DOUBLE,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(DOUBLE,1)
-   QCF(INT,2)
-   QCF(PSTRING,3)
-   QCF(PINT,4)
-   char str[21];
-
-   ffd2f( TCF(ftd2f,DOUBLE,1,0) 
-          TCF(ftd2f,INT,2,1) 
-          TCF(ftd2f,PSTRING,3,1) 
-          TCF(ftd2f,PINT,4,1) );
-
-   sprintf(str,"%20s",B3);
-   strcpy(B3,str);
-
-   RCF(DOUBLE,1)
-   RCF(INT,2)
-   RCF(PSTRING,3)
-   RCF(PINT,4)
-}
-
-CFextern VOID_cfF(FTD2E,ftd2e)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),DOUBLE,INT,PSTRING,PINT,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
-CFextern VOID_cfF(FTD2E,ftd2e)
-CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),DOUBLE,INT,PSTRING,PINT,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
-{
-   QCF(DOUBLE,1)
-   QCF(INT,2)
-   QCF(PSTRING,3)
-   QCF(PINT,4)
-   QCF(PINT,5)
-   char str[21];
-   int *vlen;
-
-   vlen = TCF(ftd2e,PINT,4,0);
-
-   /*  C version of routine doesn't use the 4th parameter, vlen  */
-   ffd2e( TCF(ftd2e,DOUBLE,1,0) 
-          TCF(ftd2e,INT,2,1) 
-          TCF(ftd2e,PSTRING,3,1) 
-          TCF(ftd2e,PINT,5,1) );
-
-   *vlen = strlen(B3);
-   if ( *vlen<20 ) {
-      sprintf(str,"%20s",B3);  /* right justify if vlen<20 characters */
-      strcpy(B3,str);
-      *vlen = 20;
-   }
-
-   RCF(DOUBLE,1)
-   RCF(INT,2)
-   RCF(PSTRING,3)
-   RCF(PINT,4)
-   RCF(PINT,5)
-}
-
-FCALLSCSUB3(ffc2ii,FTC2II,ftc2ii,STRING,PLONG,PINT)
-FCALLSCSUB3(ffc2ll,FTC2LL,ftc2ll,STRING,PINT,PINT)
-FCALLSCSUB3(ffc2rr,FTC2RR,ftc2rr,STRING,PFLOAT,PINT)
-FCALLSCSUB3(ffc2dd,FTC2DD,ftc2dd,STRING,PDOUBLE,PINT)
-FCALLSCSUB7(ffc2x,FTC2X,ftc2x,STRING,PSTRING,PLONG,PINT,PSTRING,PDOUBLE,PINT)
-FCALLSCSUB3(ffc2s,FTC2S,ftc2s,STRING,PSTRING,PINT)
-FCALLSCSUB3(ffc2i,FTC2I,ftc2i,STRING,PLONG,PINT)
-FCALLSCSUB3(ffc2r,FTC2R,ftc2r,STRING,PFLOAT,PINT)
-FCALLSCSUB3(ffc2d,FTC2D,ftc2d,STRING,PDOUBLE,PINT)
-FCALLSCSUB3(ffc2l,FTC2L,ftc2l,STRING,PINT,PINT)
-
-/*------------------ Byte-level read/seek/write -----------------*/
-/*                   (prototyped in fitsio2.h)                   */
-/*---------------------------------------------------------------*/
-
-/*
-  ffmbyt should not be called by any application programs, so
-  the wrapper should not need to be defined.  If it is needed then
-  the second parameter (LONG) will need to be changed to the
-  equivalent of the C 'off_t' type, which may be 32 or 64 bits long
-  depending on the compiler.
-  -W.Pence (7/21/00)
-  
-FCALLSCSUB4(ffmbyt,FTMBYT,ftmbyt,FITSUNIT,LONG,LOGICAL,PINT)
-*/
-
-FCALLSCSUB4(ffgbyt,FTGCBF,ftgcbf,FITSUNIT,LONG,PVOID,PINT)
-FCALLSCSUB4(ffgbyt,FTGBYT,ftgbyt,FITSUNIT,LONG,PVOID,PINT)
-
-FCALLSCSUB4(ffpbyt,FTPCBF,ftpcbf,FITSUNIT,LONG,PVOID,PINT)
-FCALLSCSUB4(ffpbyt,FTPBYT,ftpbyt,FITSUNIT,LONG,PVOID,PINT)
-
-
-/*-------------- Additional missing FITSIO routines -------------*/
-/*                   (abandoned in CFITSIO)                      */
-/*---------------------------------------------------------------*/
-
-void Cffcrep( char *comm, char *comm1, int *repeat );
-void Cffcrep( char *comm, char *comm1, int *repeat )
-{
-/*
-   check if the first comment string is to be repeated for all keywords
-   (if the last non-blank character is '&', then it is to be repeated)
-
-   comm    input comment string
-   OUTPUT PARAMETERS:
-   comm1   output comment string, = COMM minus the last '&' character
-   repeat  TRUE if the last character of COMM was the '&' character
-
-   written by Wm Pence, HEASARC/GSFC, June 1991
-   translated to C by Peter Wilson, HSTX/GSFC, Oct 1997
-*/
-
-   int len;
-
-   *repeat=FALSE;
-   len=strlen(comm);
-       /* cfortran strips trailing spaces so only check last character  */
-   if( len && comm[ len-1 ]=='&' ) {
-      strncpy(comm1,comm,len-1);  /*  Don't copy '&'  */
-      comm1[len-1]='\0';
-      *repeat=TRUE;
-   }
-   return;
-}
-FCALLSCSUB3(Cffcrep,FTCREP,ftcrep,STRING,PSTRING,PLOGICAL)
-
-
-/*------------------ Test floats for NAN values -----------------*/
-/*                     (defined in fitsio2.h)                    */
-/*---------------------------------------------------------------*/
-
-int Cfnan( float *val );
-int Cfnan( float *val )
-{
-   int code;
-
-#if BYTESWAPPED
-   short *sptr = (short*)val + 1;
-#else
-   short *sptr = (short*)val;
-#endif
-
-   code = fnan(*sptr);
-   if( code==2 ) *val = 0.0;   /* Underflow */
-
-   return( code!=0 );
-}
-FCALLSCFUN1(LOGICAL,Cfnan,FTTRNN,fttrnn,PFLOAT)
-
-
-int Cdnan( double *val );
-int Cdnan( double *val )
-{
-   int code;
-
-#if BYTESWAPPED
-   short *sptr = (short*)val + 3;
-#else
-   short *sptr = (short*)val;
-#endif
-
-   code = dnan(*sptr);
-   if( code==2 ) *val = 0.0;   /* Underflow */
-
-   return( code!=0 );
-}
-FCALLSCFUN1(LOGICAL,Cdnan,FTTDNN,fttdnn,PDOUBLE)
-
-/*-------- Functions no longer supported... normally redundant -----------*/
-/*                Included only to support older code                     */
-/*------------------------------------------------------------------------*/
-
-void Cffempty(void);
-void Cffempty(void)
-{ return; }
-FCALLSCSUB0(Cffempty,FTPDEF,ftpdef)
-FCALLSCSUB0(Cffempty,FTBDEF,ftbdef)
-FCALLSCSUB0(Cffempty,FTADEF,ftadef)
-FCALLSCSUB0(Cffempty,FTDDEF,ftddef)
-
-
-/*-------- Functions which use the lex and yacc/bison parser code -----------*/
-/*---------------------------------------------------------------------------*/
-
-#define fttexp_LONGV_A7 A3
-FCALLSCSUB8(fftexp,FTTEXP,fttexp,FITSUNIT,STRING,INT,PINT,PLONG,PINT,LONGV,PINT)
-
-#define ftfrow_LOGV_A6 A4
-FCALLSCSUB7(fffrow,FTFROW,ftfrow,FITSUNIT,STRING,LONG,LONG,PLONG,LOGICALV,PINT)
-
-#define ftfrwc_LOGV_A8 A6
-FCALLSCSUB9(fffrwc,FTFRWC,ftfrwc,FITSUNIT,STRING,STRING,STRING,STRING,LONG,DOUBLEV,LOGICALV,PINT)
-
-FCALLSCSUB4(ffsrow,FTSROW,ftsrow,FITSUNIT,FITSUNIT,STRING,PINT)
-FCALLSCSUB9(ffcrow,FTCROW,ftcrow,FITSUNIT,INT,STRING,LONG,LONG,PVOID,PVOID,PLOGICAL,PINT)
-FCALLSCSUB6(ffcalc,FTCALC,ftcalc,FITSUNIT,STRING,FITSUNIT,STRING,STRING,PINT)
-
-#define ftcalc_rng_LONGV_A7 A6
-#define ftcalc_rng_LONGV_A8 A6
-FCALLSCSUB9(ffcalc_rng,FTCALC_RNG,ftcalc_rng,FITSUNIT,STRING,FITSUNIT,STRING,STRING,INT,LONGV,LONGV,PINT)
-
-/*--------------------- grouping routines ------------------*/
-
-FCALLSCSUB4(ffgtcr,FTGTCR,ftgtcr,FITSUNIT,STRING,INT,PINT)
-FCALLSCSUB4(ffgtis,FTGTIS,ftgtis,FITSUNIT,STRING,INT,PINT)
-FCALLSCSUB3(ffgtch,FTGTCH,ftgtch,FITSUNIT,INT,PINT)
-FCALLSCSUB3(ffgtrm,FTGTRM,ftgtrm,FITSUNIT,INT,PINT)
-FCALLSCSUB4(ffgtcp,FTGTCP,ftgtcp,FITSUNIT,FITSUNIT,INT,PINT)
-FCALLSCSUB4(ffgtmg,FTGTMG,ftgtmg,FITSUNIT,FITSUNIT,INT,PINT)
-FCALLSCSUB3(ffgtcm,FTGTCM,ftgtcm,FITSUNIT,INT,PINT)
-FCALLSCSUB3(ffgtvf,FTGTVF,ftgtvf,FITSUNIT,PLONG,PINT)
-FCALLSCSUB4(ffgtop,FTGTOP,ftgtop,FITSUNIT,INT,PFITSUNIT,PINT)
-FCALLSCSUB4(ffgtam,FTGTAM,ftgtam,FITSUNIT,FITSUNIT,INT,PINT)
-FCALLSCSUB3(ffgtnm,FTGTNM,ftgtnm,FITSUNIT,PLONG,PINT)
-FCALLSCSUB3(ffgmng,FTGMNG,ftgmng,FITSUNIT,PLONG,PINT)
-FCALLSCSUB4(ffgmop,FTGMOP,ftgmop,FITSUNIT,LONG,PFITSUNIT,PINT)
-FCALLSCSUB5(ffgmcp,FTGMCP,ftgmcp,FITSUNIT,FITSUNIT,LONG,INT,PINT)
-FCALLSCSUB5(ffgmtf,FTGMTF,ftgmtf,FITSUNIT,FITSUNIT,LONG,INT,PINT)
-FCALLSCSUB4(ffgmrm,FTGMRM,ftgmrm,FITSUNIT,LONG,INT,PINT)
diff --git a/f77_wrap3.c b/f77_wrap3.c
new file mode 100644
index 0000000..013251e
--- /dev/null
+++ b/f77_wrap3.c
@@ -0,0 +1,758 @@
+/************************************************************************
+
+     f77_wrap1.c and f77_wrap2.c have now been split into 4 files to
+     prevent compile-time memory errors (from expansion of compiler commands).
+     f77_wrap1.c was split into f77_wrap1.c and f77_wrap3.c, and
+     f77_wrap2.c was split into f77_wrap2.c and f77_wrap4.c:
+
+       f77_wrap1.c contains routines operating on whole files and some
+       utility routines.
+
+       f77_wrap2.c contains routines operating on primary array, image,
+       or column elements.
+
+       f77_wrap3.c contains routines operating on headers & keywords.
+
+       f77_wrap4.c contains miscellaneous routines.
+
+     Peter's original comments:
+
+     Together, f77_wrap1.c and f77_wrap2.c contain C wrappers for all
+     the CFITSIO routines prototyped in fitsio.h, except for the
+     generic datatype routines and features not supported in fortran
+     (eg, unsigned integers), a few routines prototyped in fitsio2.h,
+     which only a handful of FTOOLS use, plus a few obsolete FITSIO
+     routines not present in CFITSIO.  This file allows Fortran code
+     to use the CFITSIO library instead of the FITSIO library without
+     modification.  It also gives access to new routines not present
+     in FITSIO.  Fortran FTOOLS must continue using the old routine
+     names from FITSIO (ie, ftxxxx), but most of the C-wrappers simply
+     redirect those calls to the corresponding CFITSIO routines (ie,
+     ffxxxx), with appropriate parameter massaging where necessary.
+     The main exception are read/write routines ending in j (ie, long
+     data) which get redirected to C routines ending in k (ie, int
+     data). This is more consistent with the default integer type in
+     Fortran. f77_wrap1.c primarily holds routines operating on whole
+     files and extension headers.  f77_wrap2.c handle routines which
+     read and write the data portion, plus miscellaneous extra routines.
+     
+        File created by Peter Wilson (HSTX), Oct-Dec. 1997
+************************************************************************/
+
+#include "fitsio2.h"
+#include "f77_wrap.h"
+
+/*----------------- write single keywords --------------*/
+FCALLSCSUB3(ffprec,FTPREC,ftprec,FITSUNIT,STRING,PINT)
+FCALLSCSUB3(ffpcom,FTPCOM,ftpcom,FITSUNIT,STRING,PINT)
+FCALLSCSUB4(ffpunt,FTPUNT,ftpunt,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB3(ffphis,FTPHIS,ftphis,FITSUNIT,STRING,PINT)
+FCALLSCSUB2(ffpdat,FTPDAT,ftpdat,FITSUNIT,PINT)
+FCALLSCSUB3(ffgstm,FTGSTM,ftgstm,PSTRING,PINT,PINT)
+FCALLSCSUB4(ffgsdt,FTGSDT,ftgsdt,PINT,PINT,PINT,PINT)
+FCALLSCSUB5(ffdt2s,FTDT2S,ftdt2s,INT,INT,INT,PSTRING,PINT)
+FCALLSCSUB9(fftm2s,FTTM2S,fttm2s,INT,INT,INT,INT,INT,DOUBLE,INT,PSTRING,PINT)
+FCALLSCSUB5(ffs2dt,FTS2DT,fts2dt,STRING,PINT,PINT,PINT,PINT)
+FCALLSCSUB8(ffs2tm,FTS2TM,fts2tm,STRING,PINT,PINT,PINT,PINT,PINT,PDOUBLE,PINT)
+FCALLSCSUB4(ffpkyu,FTPKYU,ftpkyu,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB5(ffpkys,FTPKYS,ftpkys,FITSUNIT,STRING,STRING,STRING,PINT)
+FCALLSCSUB5(ffpkls,FTPKLS,ftpkls,FITSUNIT,STRING,STRING,STRING,PINT)
+FCALLSCSUB2(ffplsw,FTPLSW,ftplsw,FITSUNIT,PINT)
+FCALLSCSUB5(ffpkyl,FTPKYL,ftpkyl,FITSUNIT,STRING,INT,STRING,PINT)
+FCALLSCSUB5(ffpkyj,FTPKYJ,ftpkyj,FITSUNIT,STRING,LONG,STRING,PINT)
+FCALLSCSUB6(ffpkyf,FTPKYF,ftpkyf,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
+FCALLSCSUB6(ffpkye,FTPKYE,ftpkye,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
+FCALLSCSUB6(ffpkyg,FTPKYG,ftpkyg,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
+FCALLSCSUB6(ffpkyd,FTPKYD,ftpkyd,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
+FCALLSCSUB6(ffpkyc,FTPKYC,ftpkyc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
+FCALLSCSUB6(ffpkym,FTPKYM,ftpkym,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
+FCALLSCSUB6(ffpkfc,FTPKFC,ftpkfc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
+FCALLSCSUB6(ffpkfm,FTPKFM,ftpkfm,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
+FCALLSCSUB6(ffpkyt,FTPKYT,ftpkyt,FITSUNIT,STRING,LONG,DOUBLE,STRING,PINT)
+
+#define ftptdm_LONGV_A4 A3
+FCALLSCSUB5(ffptdm,FTPTDM,ftptdm,FITSUNIT,INT,INT,LONGV,PINT)
+
+/*----------------- write array of keywords --------------*/
+#define ftpkns_STRV_A5 NUM_ELEM_ARG(4)
+#define ftpkns_STRV_A6 NUM_ELEM_ARG(4)
+FCALLSCSUB7(ffpkns,FTPKNS,ftpkns,FITSUNIT,STRING,INT,INT,STRINGV,STRINGV,PINT)
+
+/*   Must handle LOGICALV conversion manually... ffpknl uses ints   */
+void Cffpknl( fitsfile *fptr, char *keyroot, int nstart, int nkeys,
+              int *numval, char **comment, int *status );
+void Cffpknl( fitsfile *fptr, char *keyroot, int nstart, int nkeys,
+              int *numval, char **comment, int *status )
+{
+   int i;
+ 
+   for( i=0; i<nkeys; i++ )
+      numval[i] = F2CLOGICAL(numval[i]);
+   ffpknl( fptr, keyroot, nstart, nkeys, numval, comment, status );
+   for( i=0; i<nkeys; i++ )
+      numval[i] = C2FLOGICAL(numval[i]);
+}
+#define ftpknl_STRV_A6 NUM_ELEM_ARG(4)
+FCALLSCSUB7(Cffpknl,FTPKNL,ftpknl,FITSUNIT,STRING,INT,INT,INTV,STRINGV,PINT)
+
+#define ftpknj_STRV_A6 NUM_ELEM_ARG(4)
+#define ftpknj_LONGV_A5 A4
+FCALLSCSUB7(ffpknj,FTPKNJ,ftpknj,FITSUNIT,STRING,INT,INT,LONGV,STRINGV,PINT)
+
+#define ftpknf_STRV_A7 NUM_ELEM_ARG(4)
+FCALLSCSUB8(ffpknf,FTPKNF,ftpknf,FITSUNIT,STRING,INT,INT,FLOATV,INT,STRINGV,PINT)
+
+#define ftpkne_STRV_A7 NUM_ELEM_ARG(4)
+FCALLSCSUB8(ffpkne,FTPKNE,ftpkne,FITSUNIT,STRING,INT,INT,FLOATV,INT,STRINGV,PINT)
+
+#define ftpkng_STRV_A7 NUM_ELEM_ARG(4)
+FCALLSCSUB8(ffpkng,FTPKNG,ftpkng,FITSUNIT,STRING,INT,INT,DOUBLEV,INT,STRINGV,PINT)
+
+#define ftpknd_STRV_A7 NUM_ELEM_ARG(4)
+FCALLSCSUB8(ffpknd,FTPKND,ftpknd,FITSUNIT,STRING,INT,INT,DOUBLEV,INT,STRINGV,PINT)
+
+FCALLSCSUB6(ffcpky,FTCPKY,ftcpky,FITSUNIT,FITSUNIT,INT,INT,STRING,PINT)
+
+/*----------------- write required header keywords --------------*/
+#define ftphps_LONGV_A4 A3
+FCALLSCSUB5(ffphps,FTPHPS,ftphps,FITSUNIT,INT,INT,LONGV,PINT)
+
+void Cffphpr( fitsfile *fptr, int simple, int bitpix, int naxis, long naxes[], long pcount, long gcount, int extend, int *status );
+void Cffphpr( fitsfile *fptr, int simple, int bitpix, int naxis, long naxes[], long pcount, long gcount, int extend, int *status )
+{
+   if( gcount==0 ) gcount=1;
+   ffphpr( fptr, simple, bitpix, naxis, naxes, pcount,
+           gcount, extend, status );
+}
+#define ftphpr_LONGV_A5 A4
+FCALLSCSUB9(Cffphpr,FTPHPR,ftphpr,FITSUNIT,LOGICAL,INT,INT,LONGV,LONG,LONG,LOGICAL,PINT)
+
+
+#define ftphtb_STRV_A5 NUM_ELEM_ARG(4)
+#define ftphtb_STRV_A7 NUM_ELEM_ARG(4)
+#define ftphtb_STRV_A8 NUM_ELEM_ARG(4)
+#define ftphtb_LONGV_A6 A4
+FCALLSCSUB10(ffphtb,FTPHTB,ftphtb,FITSUNIT,LONG,LONG,INT,STRINGV,LONGV,STRINGV,STRINGV,STRING,PINT)
+
+#define ftphbn_STRV_A4 NUM_ELEM_ARG(3)
+#define ftphbn_STRV_A5 NUM_ELEM_ARG(3)
+#define ftphbn_STRV_A6 NUM_ELEM_ARG(3)
+FCALLSCSUB9(ffphbn,FTPHBN,ftphbn,FITSUNIT,LONG,INT,STRINGV,STRINGV,STRINGV,STRING,LONG,PINT)
+
+/*  Archaic names exist for preceding 3 functions...
+    continue supporting them.                           */
+
+#define ftpprh_LONGV_A5 A4
+FCALLSCSUB9(Cffphpr,FTPPRH,ftpprh,FITSUNIT,LOGICAL,INT,INT,LONGV,LONG,LONG,LOGICAL,PINT)
+
+#define ftpbnh_STRV_A4 NUM_ELEM_ARG(3)
+#define ftpbnh_STRV_A5 NUM_ELEM_ARG(3)
+#define ftpbnh_STRV_A6 NUM_ELEM_ARG(3)
+FCALLSCSUB9(ffphbn,FTPBNH,ftpbnh,FITSUNIT,LONG,INT,STRINGV,STRINGV,STRINGV,STRING,LONG,PINT)
+
+#define ftptbh_STRV_A5 NUM_ELEM_ARG(4)
+#define ftptbh_STRV_A7 NUM_ELEM_ARG(4)
+#define ftptbh_STRV_A8 NUM_ELEM_ARG(4)
+#define ftptbh_LONGV_A6 A4
+FCALLSCSUB10(ffphtb,FTPTBH,ftptbh,FITSUNIT,LONG,LONG,INT,STRINGV,LONGV,STRINGV,STRINGV,STRING,PINT)
+
+/*----------------- write template keywords --------------*/
+FCALLSCSUB3(ffpktp,FTPKTP,ftpktp,FITSUNIT,STRING,PINT)
+
+/*------------------ get header information --------------*/
+FCALLSCSUB4(ffghsp,FTGHSP,ftghsp,FITSUNIT,PINT,PINT,PINT)
+FCALLSCSUB4(ffghps,FTGHPS,ftghps,FITSUNIT,PINT,PINT,PINT)
+
+/*------------------ move position in header -------------*/
+FCALLSCSUB3(ffmaky,FTMAKY,ftmaky,FITSUNIT,INT,PINT)
+FCALLSCSUB3(ffmrky,FTMRKY,ftmrky,FITSUNIT,INT,PINT)
+
+/*------------------ read single keywords ----------------*/
+#define ftgnxk_STRV_A2 NUM_ELEM_ARG(3)
+#define ftgnxk_STRV_A4 NUM_ELEM_ARG(5)
+FCALLSCSUB7(ffgnxk,FTGNXK,ftgnxk,FITSUNIT,STRINGV,INT,STRINGV,INT,PSTRING,PINT)
+FCALLSCSUB4(ffgrec,FTGREC,ftgrec,FITSUNIT,INT,PSTRING,PINT)
+FCALLSCSUB4(ffgcrd,FTGCRD,ftgcrd,FITSUNIT,STRING,PSTRING,PINT)
+FCALLSCSUB4(ffgunt,FTGUNT,ftgunt,FITSUNIT,STRING,PSTRING,PINT)
+FCALLSCSUB6(ffgkyn,FTGKYN,ftgkyn,FITSUNIT,INT,PSTRING,PSTRING,PSTRING,PINT)
+FCALLSCSUB5(ffgkey,FTGKEY,ftgkey,FITSUNIT,STRING,PSTRING,PSTRING,PINT)
+
+/*   FTGKYS supported the long string convention but FFGKYS does not,
+     so redirect to FFGKLS.  To handle the pointer to a pointer,
+     manually expand the FCALLSC macro and modify function call.       */
+
+CFextern VOID_cfF(FTGKYS,ftgkys)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTGKYS,ftgkys)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(FITSUNIT,1)
+   QCF(STRING,2)
+   QCF(PSTRING,3)   /*  Defines a character pointer  */
+   QCF(PSTRING,4)
+   QCF(PINT,5)
+
+   ffgkls( TCF(ftgkys,FITSUNIT,1,0)
+           TCF(ftgkys,STRING,2,1)
+           , &B3                        /*  Pass address of pointer  */
+           TCF(ftgkys,PSTRING,4,1)
+           TCF(ftgkys,PINT,5,1)     );
+
+   RCF(FITSUNIT,1)
+   RCF(STRING,2)
+   RCF(PSTRING,3)      /*  Copies as much of pointer as will fit   */
+   RCF(PSTRING,4)      /*     into fortran string and frees space  */
+   RCF(PINT,5)
+}
+
+/*   This is the *real* wrapper to FFGKLS, although it is exactly the
+     same as the one for FFGKYS.  To handle the pointer to a pointer,
+     manually expand the FCALLSC macro and modify function call.       */
+
+CFextern VOID_cfF(FTGKLS,ftgkls)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTGKLS,ftgkls)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(FITSUNIT,1)
+   QCF(STRING,2)
+   QCF(PSTRING,3)   /*  Defines a character pointer  */
+   QCF(PSTRING,4)
+   QCF(PINT,5)
+
+   ffgkls( TCF(ftgkls,FITSUNIT,1,0)
+           TCF(ftgkls,STRING,2,1)
+           , &B3                        /*  Pass address of pointer  */
+           TCF(ftgkls,PSTRING,4,1)
+           TCF(ftgkls,PINT,5,1)     );
+
+   RCF(FITSUNIT,1)
+   RCF(STRING,2)
+   RCF(PSTRING,3)      /*  Copies as much of pointer as will fit   */
+   RCF(PSTRING,4)      /*     into fortran string and frees space  */
+   RCF(PINT,5)
+}
+
+FCALLSCSUB5(ffgkyl,FTGKYL,ftgkyl,FITSUNIT,STRING,PINT,PSTRING,PINT)
+FCALLSCSUB5(ffgkyj,FTGKYJ,ftgkyj,FITSUNIT,STRING,PLONG,PSTRING,PINT)
+FCALLSCSUB5(ffgkye,FTGKYE,ftgkye,FITSUNIT,STRING,PFLOAT,PSTRING,PINT)
+FCALLSCSUB5(ffgkyd,FTGKYD,ftgkyd,FITSUNIT,STRING,PDOUBLE,PSTRING,PINT)
+FCALLSCSUB5(ffgkyc,FTGKYC,ftgkyc,FITSUNIT,STRING,PFLOAT,PSTRING,PINT)
+FCALLSCSUB5(ffgkym,FTGKYM,ftgkym,FITSUNIT,STRING,PDOUBLE,PSTRING,PINT)
+FCALLSCSUB6(ffgkyt,FTGKYT,ftgkyt,FITSUNIT,STRING,PLONG,PDOUBLE,PSTRING,PINT)
+
+#define ftgtdm_LONGV_A5 A3
+FCALLSCSUB6(ffgtdm,FTGTDM,ftgtdm,FITSUNIT,INT,INT,PINT,LONGV,PINT)
+
+/*------------------ read array of keywords -----------------*/
+
+     /*    Handle array of strings such that only the number of     */
+     /*    keywords actually found get copied back to the Fortran   */
+     /*    array.  Faster as well as won't cause array overflows    */
+     /*    if the the array is smaller than nkeys, but larger than  */
+     /*    nfound.                                                  */
+
+#define ftgkns_STRV_A5 NUM_ELEM_ARG(4)
+CFextern VOID_cfF(FTGKNS,ftgkns)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,INT,INT,PSTRINGV,PINT,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTGKNS,ftgkns)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,INT,INT,PSTRINGV,PINT,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(FITSUNIT,1)
+   QCF(STRING,2)
+   QCF(INT,3)
+   QCF(INT,4)
+   QCF(PSTRINGV,5)
+   QCF(PINT,6)
+   QCF(PINT,7)
+
+   ffgkns( TCF(ftgkns,FITSUNIT,1,0)
+           TCF(ftgkns,STRING,2,1)
+           TCF(ftgkns,INT,3,1)
+           TCF(ftgkns,INT,4,1)
+           TCF(ftgkns,PSTRINGV,5,1)   /*  Defines the number of strings  */
+                                      /*  in array, B5N                  */
+           TCF(ftgkns,PINT,6,1)
+           TCF(ftgkns,PINT,7,1)     );
+
+   if ( *A7 )       /*  Redefine number of array elements to  */
+      B5N = 0;      /*  number found, or none if error.       */
+   else
+      B5N = *A6;
+		      
+   RCF(FITSUNIT,1)
+   RCF(STRING,2)
+   RCF(INT,3)
+   RCF(INT,4)
+   RCF(PSTRINGV,5)     /*  Copies only found keywords back to Fortran    */
+   RCF(PINT,6)
+   RCF(PINT,7)
+}
+
+/*   Must handle LOGICALV conversion manually... ffgknl uses ints   */
+void Cffgknl( fitsfile *fptr, char *keyroot, int nstart, int nkeys,
+              int *numval, int *nfound, int *status );
+void Cffgknl( fitsfile *fptr, char *keyroot, int nstart, int nkeys,
+              int *numval, int *nfound, int *status )
+{
+   int i;
+ 
+   for( i=0; i<nkeys; i++ )  /*  This preserves array elements across call  */
+      numval[i] = F2CLOGICAL(numval[i]);
+   ffgknl( fptr, keyroot, nstart, nkeys, numval, nfound, status );
+   for( i=0; i<nkeys; i++ )
+      numval[i] = C2FLOGICAL(numval[i]);
+}
+FCALLSCSUB7(Cffgknl,FTGKNL,ftgknl,FITSUNIT,STRING,INT,INT,INTV,PINT,PINT)
+
+#define ftgknj_LONGV_A5 A4
+FCALLSCSUB7(ffgknj,FTGKNJ,ftgknj,FITSUNIT,STRING,INT,INT,LONGV,PINT,PINT)
+FCALLSCSUB7(ffgkne,FTGKNE,ftgkne,FITSUNIT,STRING,INT,INT,FLOATV,PINT,PINT)
+FCALLSCSUB7(ffgknd,FTGKND,ftgknd,FITSUNIT,STRING,INT,INT,DOUBLEV,PINT,PINT)
+
+/*----------------- read required header keywords --------------*/
+#define ftghpr_LONGV_A6 A2
+FCALLSCSUB10(ffghpr,FTGHPR,ftghpr,FITSUNIT,INT,PLOGICAL,PINT,PINT,LONGV,PLONG,PLONG,PLOGICAL,PINT)
+
+
+    /*  The following 2 routines contain 3 string vector parameters,  */
+    /*  intended to hold column information.  Normally the vectors    */
+    /*  are defined with 500-999 elements, but very rarely do tables  */
+    /*  have that many columns.  So, to prevent the allocation of     */
+    /*  240K of memory to hold all these empty strings and the waste  */
+    /*  of CPU time converting Fortran strings to C, *and* back       */
+    /*  again, get the number of columns in the table and only        */
+    /*  process that many strings (or maxdim, if it is smaller).      */
+
+#define ftghtb_STRV_A6 NUM_ELEMS(maxdim)
+#define ftghtb_STRV_A8 NUM_ELEMS(maxdim)
+#define ftghtb_STRV_A9 NUM_ELEMS(maxdim)
+#define ftghtb_LONGV_A7 A2
+CFextern VOID_cfF(FTGHTB,ftghtb)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,INT,PLONG,PLONG,PINT,PSTRINGV,LONGV,PSTRINGV,PSTRINGV,PSTRING,PINT,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTGHTB,ftghtb)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,INT,PLONG,PLONG,PINT,PSTRINGV,LONGV,PSTRINGV,PSTRINGV,PSTRING,PINT,CF_0,CF_0,CF_0))
+{
+   QCF(FITSUNIT,1)
+   QCF(INT,2)
+   QCF(PLONG,3)
+   QCF(PLONG,4)
+   QCF(PINT,5)
+   QCF(PSTRINGV,6)
+   QCF(LONGV,7)
+   QCF(PSTRINGV,8)
+   QCF(PSTRINGV,9)
+   QCF(PSTRING,10)
+   QCF(PINT,11)
+
+   fitsfile *fptr;
+   long tfields;
+   int maxdim,*status;
+
+   fptr = TCF(ftghtb,FITSUNIT,1,0);
+   status =  TCF(ftghtb,PINT,11,0);
+   maxdim =  TCF(ftghtb,INT,2,0);
+   ffgkyj( fptr, "TFIELDS", &tfields, 0, status );
+   maxdim = (maxdim<0) ? tfields : _cfMIN(tfields,maxdim);
+
+   ffghtb(   fptr, maxdim
+             TCF(ftghtb,PLONG,3,1)
+             TCF(ftghtb,PLONG,4,1)
+             TCF(ftghtb,PINT,5,1)
+             TCF(ftghtb,PSTRINGV,6,1)
+             TCF(ftghtb,LONGV,7,1)
+             TCF(ftghtb,PSTRINGV,8,1)
+             TCF(ftghtb,PSTRINGV,9,1)
+             TCF(ftghtb,PSTRING,10,1)
+             , status );
+
+   RCF(FITSUNIT,1)
+   RCF(INT,2)
+   RCF(PLONG,3)
+   RCF(PLONG,4)
+   RCF(PINT,5)
+   RCF(PSTRINGV,6)
+   RCF(LONGV,7)
+   RCF(PSTRINGV,8)
+   RCF(PSTRINGV,9)
+   RCF(PSTRING,10)
+   RCF(PINT,11)
+}
+
+#define ftghbn_STRV_A5 NUM_ELEMS(maxdim)
+#define ftghbn_STRV_A6 NUM_ELEMS(maxdim)
+#define ftghbn_STRV_A7 NUM_ELEMS(maxdim)
+CFextern VOID_cfF(FTGHBN,ftghbn)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,INT,PLONG,PINT,PSTRINGV,PSTRINGV,PSTRINGV,PSTRING,PLONG,PINT,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTGHBN,ftghbn)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,INT,PLONG,PINT,PSTRINGV,PSTRINGV,PSTRINGV,PSTRING,PLONG,PINT,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(FITSUNIT,1)
+   QCF(INT,2)
+   QCF(PLONG,3)
+   QCF(PINT,4)
+   QCF(PSTRINGV,5)
+   QCF(PSTRINGV,6)
+   QCF(PSTRINGV,7)
+   QCF(PSTRING,8)
+   QCF(PLONG,9)
+   QCF(PINT,10)
+
+   fitsfile *fptr;
+   long tfields;
+   int maxdim,*status;
+
+   fptr = TCF(ftghbn,FITSUNIT,1,0);
+   status =  TCF(ftghbn,PINT,10,0);
+   maxdim =  TCF(ftghbn,INT,2,0);
+   ffgkyj( fptr, "TFIELDS", &tfields, 0, status );
+   maxdim = (maxdim<0) ? tfields : _cfMIN(tfields,maxdim);
+
+   ffghbn(   fptr, maxdim
+             TCF(ftghbn,PLONG,3,1)
+             TCF(ftghbn,PINT,4,1)
+             TCF(ftghbn,PSTRINGV,5,1)
+             TCF(ftghbn,PSTRINGV,6,1)
+             TCF(ftghbn,PSTRINGV,7,1)
+             TCF(ftghbn,PSTRING,8,1)
+             TCF(ftghbn,PLONG,9,1)
+             , status );
+
+   RCF(FITSUNIT,1)
+   RCF(INT,2)
+   RCF(PLONG,3)
+   RCF(PINT,4)
+   RCF(PSTRINGV,5)
+   RCF(PSTRINGV,6)
+   RCF(PSTRINGV,7)
+   RCF(PSTRING,8)
+   RCF(PLONG,9)
+   RCF(PINT,10)
+}
+
+    /*   The following 3 routines are obsolete and dangerous to use as       */
+    /*   there is no bounds checking with the arrays.  Call ftghxx instead.  */
+    /*   To get cfortran to work, ftgtbh and ftgbnh require information      */
+    /*   on the array size of the string vectors.  The "TFIELDS" key word    */
+    /*   is read and used as the vector size.  This *will* cause a           */
+    /*   problem if ttype, tform, and tunit are declared with fewer          */
+    /*   elements than the actual number of columns.                         */
+
+#if defined(LONG8BYTES_INT4BYTES)
+
+    /*  On platforms with 8-byte longs, we also need to worry about the */
+    /*  length of the long naxes array.  So read NAXIS manually. :(     */
+
+void Cffgprh( fitsfile *fptr, int *simple, int *bitpix, int *naxis, int naxes[],
+             long *pcount, long *gcount, int *extend, int *status );
+void Cffgprh( fitsfile *fptr, int *simple, int *bitpix, int *naxis, int naxes[],
+             long *pcount, long *gcount, int *extend, int *status )
+{
+   long *LONGnaxes, size;
+
+   ffgkyj( fptr, "NAXIS", &size, 0, status );
+   LONGnaxes = F2Clongv(size,naxes);
+   ffghpr( fptr, (int)size, simple, bitpix, naxis, LONGnaxes,
+           pcount, gcount, extend, status );
+   C2Flongv(size,naxes,LONGnaxes);
+}
+FCALLSCSUB9(Cffgprh,FTGPRH,ftgprh,FITSUNIT,PLOGICAL,PINT,PINT,INTV,PLONG,PLONG,PLOGICAL,PINT)
+
+#else
+
+void Cffgprh( fitsfile *fptr, int *simple, int *bitpix, int *naxis, long naxes[],
+             long *pcount, long *gcount, int *extend, int *status );
+void Cffgprh( fitsfile *fptr, int *simple, int *bitpix, int *naxis, long naxes[],
+             long *pcount, long *gcount, int *extend, int *status )
+{
+   ffghpr( fptr, -1, simple, bitpix, naxis, naxes,
+           pcount, gcount, extend, status );
+}
+#define ftghpr_LONGV_A5 NONE
+FCALLSCSUB9(Cffgprh,FTGPRH,ftgprh,FITSUNIT,PLOGICAL,PINT,PINT,LONGV,PLONG,PLONG,PLOGICAL,PINT)
+
+#endif
+
+#define ftgtbh_STRV_A5 NUM_ELEMS(tfields)
+#define ftgtbh_STRV_A7 NUM_ELEMS(tfields)
+#define ftgtbh_STRV_A8 NUM_ELEMS(tfields)
+CFextern VOID_cfF(FTGTBH,ftgtbh)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,PLONG,PLONG,PINT,PSTRINGV,PLONG,PSTRINGV,PSTRINGV,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTGTBH,ftgtbh)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,PLONG,PLONG,PINT,PSTRINGV,PLONG,PSTRINGV,PSTRINGV,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(FITSUNIT,1)
+   QCF(PLONG,2)
+   QCF(PLONG,3)
+   QCF(PINT,4)
+   QCF(PSTRINGV,5)
+   QCF(PLONG,6)
+   QCF(PSTRINGV,7)
+   QCF(PSTRINGV,8)
+   QCF(PSTRING,9)
+   QCF(PINT,10)
+
+   fitsfile *fptr;
+   long tfields;
+   int *status;
+
+   fptr = TCF(ftgtbh,FITSUNIT,1,0);
+   status =  TCF(ftgtbh,PINT,10,0);
+   ffgkyj( fptr, "TFIELDS", &tfields, 0, status );
+
+   ffghtb(   fptr, (int)tfields
+             TCF(ftgtbh,PLONG,2,1)
+             TCF(ftgtbh,PLONG,3,1)
+             TCF(ftgtbh,PINT,4,1)
+             TCF(ftgtbh,PSTRINGV,5,1)
+             TCF(ftgtbh,PLONG,6,1)
+             TCF(ftgtbh,PSTRINGV,7,1)
+             TCF(ftgtbh,PSTRINGV,8,1)
+             TCF(ftgtbh,PSTRING,9,1)
+             , status );
+
+   RCF(FITSUNIT,1)
+   RCF(PLONG,2)
+   RCF(PLONG,3)
+   RCF(PINT,4)
+   RCF(PSTRINGV,5)
+   RCF(PLONG,6)
+   RCF(PSTRINGV,7)
+   RCF(PSTRINGV,8)
+   RCF(PSTRING,9)
+   RCF(PINT,10)
+}
+
+#define ftgbnh_STRV_A4 NUM_ELEMS(tfields)
+#define ftgbnh_STRV_A5 NUM_ELEMS(tfields)
+#define ftgbnh_STRV_A6 NUM_ELEMS(tfields)
+CFextern VOID_cfF(FTGBNH,ftgbnh)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,PLONG,PINT,PSTRINGV,PSTRINGV,PSTRINGV,PSTRING,PLONG,PINT,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTGBNH,ftgbnh)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,PLONG,PINT,PSTRINGV,PSTRINGV,PSTRINGV,PSTRING,PLONG,PINT,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(FITSUNIT,1)
+   QCF(PLONG,2)
+   QCF(PINT,3)
+   QCF(PSTRINGV,4)
+   QCF(PSTRINGV,5)
+   QCF(PSTRINGV,6)
+   QCF(PSTRING,7)
+   QCF(PLONG,8)
+   QCF(PINT,9)
+
+   fitsfile *fptr;
+   long tfields;
+   int *status;
+
+   fptr = TCF(ftgbnh,FITSUNIT,1,0);
+   status =  TCF(ftgbnh,PINT,9,0);
+   ffgkyj( fptr, "TFIELDS", &tfields, 0, status );
+
+   ffghbn(   fptr, (int)tfields
+             TCF(ftgbnh,PLONG,2,1)
+             TCF(ftgbnh,PINT,3,1)
+             TCF(ftgbnh,PSTRINGV,4,1)
+             TCF(ftgbnh,PSTRINGV,5,1)
+             TCF(ftgbnh,PSTRINGV,6,1)
+             TCF(ftgbnh,PSTRING,7,1)
+             TCF(ftgbnh,PLONG,8,1)
+             , status );
+
+   RCF(FITSUNIT,1)
+   RCF(PLONG,2)
+   RCF(PINT,3)
+   RCF(PSTRINGV,4)
+   RCF(PSTRINGV,5)
+   RCF(PSTRINGV,6)
+   RCF(PSTRING,7)
+   RCF(PLONG,8)
+   RCF(PINT,9)
+}
+
+
+/*--------------------- update keywords ---------------*/
+FCALLSCSUB4(ffucrd,FTUCRD,ftucrd,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB4(ffukyu,FTUKYU,ftukyu,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB5(ffukys,FTUKYS,ftukys,FITSUNIT,STRING,STRING,STRING,PINT)
+FCALLSCSUB5(ffukls,FTUKLS,ftukls,FITSUNIT,STRING,STRING,STRING,PINT)
+FCALLSCSUB5(ffukyl,FTUKYL,ftukyl,FITSUNIT,STRING,INT,STRING,PINT)
+FCALLSCSUB5(ffukyj,FTUKYJ,ftukyj,FITSUNIT,STRING,LONG,STRING,PINT)
+FCALLSCSUB6(ffukyf,FTUKYF,ftukyf,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
+FCALLSCSUB6(ffukye,FTUKYE,ftukye,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
+FCALLSCSUB6(ffukyg,FTUKYG,ftukyg,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
+FCALLSCSUB6(ffukyd,FTUKYD,ftukyd,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
+FCALLSCSUB6(ffukyc,FTUKYC,ftukyc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
+FCALLSCSUB6(ffukym,FTUKYM,ftukym,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
+FCALLSCSUB6(ffukfc,FTUKFC,ftukfc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
+FCALLSCSUB6(ffukfm,FTUKFM,ftukfm,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
+
+/*--------------------- modify keywords ---------------*/
+FCALLSCSUB4(ffmrec,FTMREC,ftmrec,FITSUNIT,INT,STRING,PINT)
+FCALLSCSUB4(ffmcrd,FTMCRD,ftmcrd,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB4(ffmnam,FTMNAM,ftmnam,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB4(ffmcom,FTMCOM,ftmcom,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB4(ffmkyu,FTMKYU,ftmkyu,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB5(ffmkys,FTMKYS,ftmkys,FITSUNIT,STRING,STRING,STRING,PINT)
+FCALLSCSUB5(ffmkls,FTMKLS,ftmkls,FITSUNIT,STRING,STRING,STRING,PINT)
+FCALLSCSUB5(ffmkyl,FTMKYL,ftmkyl,FITSUNIT,STRING,INT,STRING,PINT)
+FCALLSCSUB5(ffmkyj,FTMKYJ,ftmkyj,FITSUNIT,STRING,LONG,STRING,PINT)
+FCALLSCSUB6(ffmkyf,FTMKYF,ftmkyf,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
+FCALLSCSUB6(ffmkye,FTMKYE,ftmkye,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
+FCALLSCSUB6(ffmkyg,FTMKYG,ftmkyg,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
+FCALLSCSUB6(ffmkyd,FTMKYD,ftmkyd,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
+FCALLSCSUB6(ffmkyc,FTMKYC,ftmkyc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
+FCALLSCSUB6(ffmkym,FTMKYM,ftmkym,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
+FCALLSCSUB6(ffmkfc,FTMKFC,ftmkfc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
+FCALLSCSUB6(ffmkfm,FTMKFM,ftmkfm,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
+
+/*--------------------- insert keywords ---------------*/
+FCALLSCSUB4(ffirec,FTIREC,ftirec,FITSUNIT,INT,STRING,PINT)
+FCALLSCSUB3(ffikey,FTIKEY,ftkey,FITSUNIT,STRING,PINT)
+FCALLSCSUB4(ffikyu,FTIKYU,ftikyu,FITSUNIT,STRING,STRING,PINT)
+FCALLSCSUB5(ffikys,FTIKYS,ftikys,FITSUNIT,STRING,STRING,STRING,PINT)
+FCALLSCSUB5(ffikls,FTIKLS,ftikls,FITSUNIT,STRING,STRING,STRING,PINT)
+FCALLSCSUB5(ffikyl,FTIKYL,ftikyl,FITSUNIT,STRING,INT,STRING,PINT)
+FCALLSCSUB5(ffikyj,FTIKYJ,ftikyj,FITSUNIT,STRING,LONG,STRING,PINT)
+FCALLSCSUB6(ffikyf,FTIKYF,ftikyf,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
+FCALLSCSUB6(ffikye,FTIKYE,ftikye,FITSUNIT,STRING,FLOAT,INT,STRING,PINT)
+FCALLSCSUB6(ffikyg,FTIKYG,ftikyg,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
+FCALLSCSUB6(ffikyd,FTIKYD,ftikyd,FITSUNIT,STRING,DOUBLE,INT,STRING,PINT)
+FCALLSCSUB6(ffikyc,FTIKYC,ftikyc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
+FCALLSCSUB6(ffikym,FTIKYM,ftikym,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
+FCALLSCSUB6(ffikfc,FTIKFC,ftikfc,FITSUNIT,STRING,FLOATV,INT,STRING,PINT)
+FCALLSCSUB6(ffikfm,FTIKFM,ftikfm,FITSUNIT,STRING,DOUBLEV,INT,STRING,PINT)
+
+/*--------------------- delete keywords ---------------*/
+FCALLSCSUB3(ffdkey,FTDKEY,ftdkey,FITSUNIT,STRING,PINT)
+FCALLSCSUB3(ffdrec,FTDREC,ftdrec,FITSUNIT,INT,PINT)
+
+/*--------------------- get HDU information -------------*/
+FCALLSCSUB2(ffghdn,FTGHDN,ftghdn,FITSUNIT,PINT)
+FCALLSCSUB3(ffghdt,FTGHDT,ftghdt,FITSUNIT,PINT,PINT)
+
+FCALLSCSUB5(ffghad,FTGHAD,ftghad,FITSUNIT,PLONG,PLONG,PLONG,PINT)
+
+FCALLSCSUB3(ffgidt,FTGIDT,ftgidt,FITSUNIT,PINT,PINT)
+FCALLSCSUB3(ffgiet,FTGIET,ftgiet,FITSUNIT,PINT,PINT)
+FCALLSCSUB3(ffgidm,FTGIDM,ftgidm,FITSUNIT,PINT,PINT)
+
+#define ftgisz_LONGV_A3 A2
+FCALLSCSUB4(ffgisz,FTGISZ,ftgisz,FITSUNIT,INT,LONGV,PINT)
+
+#define ftgipr_LONGV_A5 A2
+FCALLSCSUB6(ffgipr,FTGIPR,ftgipr,FITSUNIT,INT,PINT,PINT,LONGV,PINT)
+
+/*--------------------- HDU operations -------------*/
+FCALLSCSUB4(ffmahd,FTMAHD,ftmahd,FITSUNIT,INT,PINT,PINT)
+FCALLSCSUB4(ffmrhd,FTMRHD,ftmrhd,FITSUNIT,INT,PINT,PINT)
+FCALLSCSUB5(ffmnhd,FTMNHD,ftmnhd,FITSUNIT,INT,STRING,INT,PINT)
+FCALLSCSUB3(ffthdu,FTTHDU,ftthdu,FITSUNIT,PINT,PINT)
+FCALLSCSUB2(ffcrhd,FTCRHD,ftcrhd,FITSUNIT,PINT)
+
+#define ftcrim_LONGV_A4 A3
+FCALLSCSUB5(ffcrim,FTCRIM,ftcrim,FITSUNIT,INT,INT,LONGV,PINT)
+
+#define ftcrtb_STRV_A5 NUM_ELEM_ARG(4)
+#define ftcrtb_STRV_A6 NUM_ELEM_ARG(4)
+#define ftcrtb_STRV_A7 NUM_ELEM_ARG(4)
+FCALLSCSUB9(ffcrtb,FTCRTB,ftcrtb,FITSUNIT,INT,LONG,INT,STRINGV,STRINGV,STRINGV,STRING,PINT)
+
+#define ftiimg_LONGV_A4 A3
+FCALLSCSUB5(ffiimg,FTIIMG,ftiimg,FITSUNIT,INT,INT,LONGV,PINT)
+
+#define ftitab_STRV_A5 NUM_ELEM_ARG(4)
+#define ftitab_LONGV_A6 A4
+#define ftitab_STRV_A7 NUM_ELEM_ARG(4)
+#define ftitab_STRV_A8 NUM_ELEM_ARG(4)
+FCALLSCSUB10(ffitab,FTITAB,ftitab,FITSUNIT,LONG,LONG,INT,STRINGV,LONGV,STRINGV,STRINGV,STRING,PINT)
+
+#define ftibin_STRV_A4 NUM_ELEM_ARG(3)
+#define ftibin_STRV_A5 NUM_ELEM_ARG(3)
+#define ftibin_STRV_A6 NUM_ELEM_ARG(3)
+FCALLSCSUB9(ffibin,FTIBIN,ftibin,FITSUNIT,LONG,INT,STRINGV,STRINGV,STRINGV,STRING,LONG,PINT)
+
+#define ftrsim_LONGV_A4 A3
+FCALLSCSUB5(ffrsim,FTRSIM,ftrsim,FITSUNIT,INT,INT,LONGV,PINT)
+FCALLSCSUB3(ffdhdu,FTDHDU,ftdhdu,FITSUNIT,PINT,PINT)
+FCALLSCSUB4(ffcopy,FTCOPY,ftcopy,FITSUNIT,FITSUNIT,INT,PINT)
+FCALLSCSUB6(ffcpfl,FTCPFL,ftcpfl,FITSUNIT,FITSUNIT,INT,INT,INT,PINT)
+FCALLSCSUB3(ffcphd,FTCPHD,ftcphd,FITSUNIT,FITSUNIT,PINT)
+FCALLSCSUB3(ffcpdt,FTCPDT,ftcpdt,FITSUNIT,FITSUNIT,PINT)
+FCALLSCSUB2(ffchfl,FTCHFL,ftchfl,FITSUNIT,PINT)
+FCALLSCSUB2(ffcdfl,FTCDFL,ftcdfl,FITSUNIT,PINT)
+
+FCALLSCSUB2(ffrdef,FTRDEF,ftrdef,FITSUNIT,PINT)
+FCALLSCSUB3(ffhdef,FTHDEF,fthdef,FITSUNIT,INT,PINT)
+FCALLSCSUB3(ffpthp,FTPTHP,ftpthp,FITSUNIT,LONG,PINT)
+
+FCALLSCSUB2(ffpcks,FTPCKS,ftpcks,FITSUNIT,PINT)
+FCALLSCSUB4(ffvcks,FTVCKS,ftvcks,FITSUNIT,PINT,PINT,PINT)
+
+     /*  Checksum changed from double to long  */
+
+void Cffgcks( fitsfile *fptr, double *datasum, double *hdusum, int *status );
+void Cffgcks( fitsfile *fptr, double *datasum, double *hdusum, int *status )
+{
+   unsigned long data, hdu;
+
+   ffgcks( fptr, &data, &hdu, status );
+   *datasum = data;
+   *hdusum  = hdu;
+}
+FCALLSCSUB4(Cffgcks,FTGCKS,ftgcks,FITSUNIT,PDOUBLE,PDOUBLE,PINT)
+
+void Cffcsum( fitsfile *fptr, long nrec, double *dsum, int *status );
+void Cffcsum( fitsfile *fptr, long nrec, double *dsum, int *status )
+{
+   unsigned long sum;
+
+   ffcsum( fptr, nrec, &sum, status );
+   *dsum = sum;
+}
+FCALLSCSUB4(Cffcsum,FTCSUM,ftcsum,FITSUNIT,LONG,PDOUBLE,PINT)
+
+void Cffesum( double dsum, int complm, char *ascii );
+void Cffesum( double dsum, int complm, char *ascii )
+{
+   unsigned long sum=(unsigned long)dsum;
+
+   ffesum( sum, complm, ascii );
+}
+FCALLSCSUB3(Cffesum,FTESUM,ftesum,DOUBLE,LOGICAL,PSTRING)
+
+void Cffdsum( char *ascii, int complm, double *dsum );
+void Cffdsum( char *ascii, int complm, double *dsum )
+{
+   unsigned long sum;
+
+   ffdsum( ascii, complm, &sum );
+   *dsum = sum;
+}
+FCALLSCSUB3(Cffdsum,FTDSUM,ftdsum,PSTRING,LOGICAL,PDOUBLE)
+
+     /*   Name changed, so support both versions   */
+FCALLSCSUB2(ffupck,FTUPCK,ftupck,FITSUNIT,PINT)
+FCALLSCSUB2(ffupck,FTUCKS,ftucks,FITSUNIT,PINT)
+
+/*--------------- define scaling or null values -------------*/
+FCALLSCSUB4(ffpscl,FTPSCL,ftpscl,FITSUNIT,DOUBLE,DOUBLE,PINT)
+FCALLSCSUB3(ffpnul,FTPNUL,ftpnul,FITSUNIT,LONG,PINT)
+FCALLSCSUB5(fftscl,FTTSCL,fttscl,FITSUNIT,INT,DOUBLE,DOUBLE,PINT)
+FCALLSCSUB4(fftnul,FTTNUL,fttnul,FITSUNIT,INT,LONG,PINT)
+FCALLSCSUB4(ffsnul,FTSNUL,ftsnul,FITSUNIT,INT,STRING,PINT)
+
+/*--------------------- get column information -------------*/
+FCALLSCSUB5(ffgcno,FTGCNO,ftgcno,FITSUNIT,LOGICAL,STRING,PINT,PINT)
+FCALLSCSUB6(ffgcnn,FTGCNN,ftgcnn,FITSUNIT,LOGICAL,STRING,PSTRING,PINT,PINT)
+FCALLSCSUB3(ffgnrw,FTGNRW,ftgnrw,FITSUNIT,PLONG,PINT)
+FCALLSCSUB3(ffgncl,FTGNCL,ftgncl,FITSUNIT,PINT,PINT)
+FCALLSCSUB4(ffgcdw,FTGCDW,ftgcdw,FITSUNIT,INT,PINT,PINT)
+
+FCALLSCSUB6(ffgtcl,FTGTCL,ftgtcl,FITSUNIT,INT,PINT,PLONG,PLONG,PINT)
+FCALLSCSUB6(ffeqty,FTEQTY,fteqty,FITSUNIT,INT,PINT,PLONG,PLONG,PINT)
+FCALLSCSUB11(ffgacl,FTGACL,ftgacl,FITSUNIT,INT,PSTRING,PLONG,PSTRING,PSTRING,PDOUBLE,PDOUBLE,PSTRING,PSTRING,PINT)
+FCALLSCSUB11(ffgbcl,FTGBCL,ftgbcl,FITSUNIT,INT,PSTRING,PSTRING,PSTRING,PLONG,PDOUBLE,PDOUBLE,PLONG,PSTRING,PINT)
+FCALLSCSUB3(ffgrsz,FTGRSZ,ftgrsz,FITSUNIT,PLONG,PINT)
+
+
diff --git a/f77_wrap4.c b/f77_wrap4.c
new file mode 100644
index 0000000..a3a99b4
--- /dev/null
+++ b/f77_wrap4.c
@@ -0,0 +1,570 @@
+/************************************************************************
+
+     f77_wrap1.c and f77_wrap2.c have now been split into 4 files to
+     prevent compile-time memory errors (from expansion of compiler commands).
+     f77_wrap1.c was split into f77_wrap1.c and f77_wrap3.c, and
+     f77_wrap2.c was split into f77_wrap2.c and f77_wrap4.c:
+       
+       f77_wrap1.c contains routines operating on whole files and some 
+       utility routines.
+     
+       f77_wrap2.c contains routines operating on primary array, image, 
+       or column elements.
+
+       f77_wrap3.c contains routines operating on headers & keywords.
+
+       f77_wrap4.c contains miscellaneous routines.
+
+     Peter's original comments:
+
+     Together, f77_wrap1.c and f77_wrap2.c contain C wrappers for all
+     the CFITSIO routines prototyped in fitsio.h, except for the
+     generic datatype routines and features not supported in fortran
+     (eg, unsigned integers), a few routines prototyped in fitsio2.h,
+     which only a handful of FTOOLS use, plus a few obsolete FITSIO
+     routines not present in CFITSIO.  This file allows Fortran code
+     to use the CFITSIO library instead of the FITSIO library without
+     modification.  It also gives access to new routines not present
+     in FITSIO.  Fortran FTOOLS must continue using the old routine
+     names from FITSIO (ie, ftxxxx), but most of the C-wrappers simply
+     redirect those calls to the corresponding CFITSIO routines (ie,
+     ffxxxx), with appropriate parameter massaging where necessary.
+     The main exception are read/write routines ending in j (ie, long
+     data) which get redirected to C routines ending in k (ie, int
+     data). This is more consistent with the default integer type in
+     Fortran. f77_wrap1.c primarily holds routines operating on whole
+     files and extension headers.  f77_wrap2.c handle routines which
+     read and write the data portion, plus miscellaneous extra routines.
+     
+        File created by Peter Wilson (HSTX), Oct-Dec. 1997
+************************************************************************/
+
+#include "fitsio2.h"
+#include "f77_wrap.h"
+
+/*********************************************************************/
+/*                     Iterator Functions                            */
+/*********************************************************************/
+
+/* Use a simple ellipse prototype for Fwork_fn to satisfy finicky compilers */
+typedef struct {
+   void *userData;
+   void (*Fwork_fn)(PLONG_cfTYPE *total_n, ...);
+} FtnUserData;
+
+/*        Declare protoypes to make C++ happy       */
+int Cwork_fn(long, long, long, long, int, iteratorCol *, void *);
+void Cffiter( int n_cols, int *units, int *colnum, char *colname[], 
+	      int *datatype, int *iotype,
+              long offset, long n_per_loop, void *Fwork_fn,
+	      void *userData, int *status);
+
+/******************************************************************/
+/*  Cffiter is the wrapper for CFITSIO's ffiter which takes most  */
+/*  of its arguments via a structure, iteratorCol.  This routine  */
+/*  takes a list of arrays and converts them into a single array  */
+/*  of type iteratorCol and passes it to CFITSIO.  Because ffiter */
+/*  will be passing control to a Fortran work function, the C     */
+/*  wrapper, Cwork_fn, must be passed in its place which then     */
+/*  calls the Fortran routine after the necessary data            */
+/*  manipulation.  The Fortran routine is passed via the user-    */
+/*  supplied parameter pointer.                                   */
+/******************************************************************/
+
+void Cffiter( int n_cols, int *units, int *colnum, char *colname[], 
+	      int *datatype, int *iotype,
+              long offset, long n_per_loop, void *Fwork_fn,
+	      void *userData, int *status)
+{
+   iteratorCol *cols;
+   int i;
+   FtnUserData FuserData;
+
+   FuserData.Fwork_fn = (void(*)(PLONG_cfTYPE *,...))Fwork_fn;
+   FuserData.userData = userData;
+
+   cols = (iteratorCol *)malloc( n_cols*sizeof(iteratorCol) );
+   if( cols==NULL ) {
+      *status = MEMORY_ALLOCATION;
+      return;
+   }
+   for(i=0;i<n_cols;i++) {
+      cols[i].fptr     = gFitsFiles[ units[i] ];
+      cols[i].colnum   = colnum[i];
+      strncpy(cols[i].colname,colname[i],70);
+      cols[i].datatype = datatype[i];
+      cols[i].iotype   = iotype[i];
+   }
+
+   ffiter( n_cols, cols, offset, n_per_loop, Cwork_fn, 
+	   (void*)&FuserData, status );
+   free(cols);
+}
+#define ftiter_STRV_A4 NUM_ELEM_ARG(1)
+FCALLSCSUB11(Cffiter,FTITER,ftiter,INT,INTV,INTV,STRINGV,INTV,INTV,LONG,LONG,PVOID,PVOID,PINT)
+
+/*-----------------------------------------------------------------*/
+/*  This function is called by CFITSIO's ffiter and serves as the  */
+/*  wrapper for the Fortran work function which is passed in the   */
+/*  extra user-supplied pointer.  It breaks up C's iteratorCol     */
+/*  into several separate arrays.  Because we cannot send an       */
+/*  array of pointers for the column data, we instead send *many*  */
+/*  arrays as final parameters.                                    */
+/*-----------------------------------------------------------------*/
+
+int Cwork_fn( long total_n, long offset,       long first_n,    long n_values,
+	      int n_cols,   iteratorCol *cols, void *FuserData )
+{
+   int  *units, *colnum, *datatype, *iotype, *repeat;
+   char **sptr;
+   void **ptrs;
+   int  i,j,k,nstr,status=0;
+   long *slen;
+
+#ifdef vmsFortran
+   /*  Passing strings under VMS require a special structure  */
+   fstringvector *vmsStrs;
+#endif
+
+   /*  Allocate memory for all the arrays.  Grab all the int's  */
+   /*  at once and divide up among parameters                   */
+
+   ptrs  = (void**)malloc(2*n_cols*sizeof(void*));
+   if( ptrs==NULL )
+      return( MEMORY_ALLOCATION );
+   units = (int*)malloc(5*n_cols*sizeof(int));
+   if( units==NULL ) {
+      free(ptrs);
+      return( MEMORY_ALLOCATION );
+   }
+   colnum   = units + 1 * n_cols;
+   datatype = units + 2 * n_cols;
+   iotype   = units + 3 * n_cols;
+   repeat   = units + 4 * n_cols;
+
+   nstr = 0;
+   slen = (long*)(ptrs+n_cols);
+#ifdef vmsFortran
+   vmsStrs = (fstringvector *)calloc(sizeof(fstringvector),n_cols);
+   if( vmsStrs==NULL ) {
+      free(ptrs);
+      free(units);
+      return( MEMORY_ALLOCATION );
+   }
+#endif
+
+   for(i=0;i<n_cols;i++) {
+      for(j=0;j<MAXFITSFILES;j++)
+	 if( cols[i].fptr==gFitsFiles[j] )
+	    units[i] = j;
+      colnum[i]   = cols[i].colnum;
+      datatype[i] = cols[i].datatype;
+      iotype[i]   = cols[i].iotype;
+      repeat[i]   = cols[i].repeat;
+
+      if( datatype[i]==TLOGICAL ) {
+	 /*  Don't forget first element is null value  */
+	 ptrs[i] = (void *)malloc( (n_values*repeat[i]+1)*4 );
+	 if( ptrs[i]==NULL ) {
+	    free(ptrs);
+	    free(units);
+	    return( MEMORY_ALLOCATION );
+	 }
+	 for( j=0;j<=n_values*repeat[i]; j++ )
+	    ((int*)ptrs[i])[j] = C2FLOGICAL( ((char*)cols[i].array)[j]);
+      } else if ( datatype[i]==TSTRING ) {
+	 sptr = (char**)cols[i].array;
+	 slen[nstr] = sptr[1] - sptr[0];
+	 for(j=0;j<=n_values;j++)
+	    for(k=strlen( sptr[j] );k<slen[nstr];k++)
+	       sptr[j][k] = ' ';
+#ifdef vmsFortran
+	 vmsStrs[nstr].dsc$a_pointer         = sptr[0];
+	 vmsStrs[nstr].dsc$w_length          = slen[nstr];
+	 vmsStrs[nstr].dsc$l_m[0]            = n_values+1;
+	 vmsStrs[nstr].dsc$l_arsize          = slen[nstr] * (n_values+1);
+	 vmsStrs[nstr].dsc$bounds[0].dsc$l_u = n_values+1;
+	 vmsStrs[nstr].dsc$a_a0              = sptr[0] - slen[nstr];
+	 ptrs[i] = (void *)(vmsStrs+nstr);
+#else
+	 ptrs[i] = (void *)sptr[0];
+#endif
+	 nstr++;
+      } else
+	 ptrs[i] = (void *)cols[i].array;
+   }
+
+   if(!status) {
+              /*  Handle Fortran function call manually...  */
+	      /*  cfortran.h cannot handle all the desired  */
+              /*  'ptrs' nor the indirect function call.    */
+
+      PLONG_cfTYPE a1,a2,a3,a4;    /* Do this in case longs are */ 
+      FtnUserData *f;              /* not the same size as ints */
+
+      a1 = total_n;
+      a2 = offset;
+      a3 = first_n;
+      a4 = n_values;
+      f  = (FtnUserData *)FuserData;
+
+      f->Fwork_fn(&a1,&a2,&a3,&a4,&n_cols,units,colnum,datatype,
+		  iotype,repeat,&status,f->userData,
+		  ptrs[ 0], ptrs[ 1], ptrs[ 2], ptrs[ 3], ptrs[ 4],
+		  ptrs[ 5], ptrs[ 6], ptrs[ 7], ptrs[ 8], ptrs[ 9],
+		  ptrs[10], ptrs[11], ptrs[12], ptrs[13], ptrs[14],
+		  ptrs[15], ptrs[16], ptrs[17], ptrs[18], ptrs[19],
+		  ptrs[20], ptrs[21], ptrs[22], ptrs[23], ptrs[24] );
+   }
+
+   /*  Check whether there are any LOGICAL or STRING columns being outputted  */
+   nstr=0;
+   for( i=0;i<n_cols;i++ ) {
+      if( iotype[i]!=InputCol ) {
+	 if( datatype[i]==TLOGICAL ) {
+	    for( j=0;j<=n_values*repeat[i];j++ )
+	       ((char*)cols[i].array)[j] = F2CLOGICAL( ((int*)ptrs[i])[j] );
+	    free(ptrs[i]);
+	 } else if( datatype[i]==TSTRING ) {
+	    for( j=0;j<=n_values;j++ )
+	       ((char**)cols[i].array)[j][slen[nstr]-1] = '\0';
+	 }
+      }
+      if( datatype[i]==TSTRING ) nstr++;
+   }
+
+   free(ptrs);
+   free(units);
+#ifdef vmsFortran
+   free(vmsStrs);
+#endif
+   return(status);
+}
+
+
+/*--------------------- WCS Utilities ----------------------------*/
+FCALLSCSUB10(ffgics,FTGICS,ftgics,FITSUNIT,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PSTRING,PINT)
+FCALLSCSUB12(ffgtcs,FTGTCS,ftgtcs,FITSUNIT,INT,INT,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PDOUBLE,PSTRING,PINT)
+FCALLSCSUB13(ffwldp,FTWLDP,ftwldp,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,STRING,PDOUBLE,PDOUBLE,PINT)
+FCALLSCSUB13(ffxypx,FTXYPX,ftxypx,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,STRING,PDOUBLE,PDOUBLE,PINT)
+
+/*------------------- Conversion Utilities -----------------*/
+/*                 (prototyped in fitsio2.h)                */
+/*----------------------------------------------------------*/
+
+CFextern VOID_cfF(FTI2C,fti2c)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LONG,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTI2C,fti2c)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LONG,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(LONG,1)
+   QCF(PSTRING,2)
+   QCF(PINT,3)
+   char str[21];
+
+   ffi2c( TCF(fti2c,LONG,1,0) 
+          TCF(fti2c,PSTRING,2,1) 
+          TCF(fti2c,PINT,3,1) );
+
+   sprintf(str,"%20s",B2);
+   strcpy(B2,str);
+
+   RCF(LONG,1)
+   RCF(PSTRING,2)
+   RCF(PINT,3)
+}
+
+CFextern VOID_cfF(FTL2C,ftl2c)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LOGICAL,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTL2C,ftl2c)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LOGICAL,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(LOGICAL,1)
+   QCF(PSTRING,2)
+   QCF(PINT,3)
+   char str[21];
+
+   ffl2c( TCF(ftl2c,LOGICAL,1,0) 
+          TCF(ftl2c,PSTRING,2,1) 
+          TCF(ftl2c,PINT,3,1) );
+
+   sprintf(str,"%20s",B2);
+   strcpy(B2,str);
+
+   RCF(LOGICAL,1)
+   RCF(PSTRING,2)
+   RCF(PINT,3)
+}
+
+FCALLSCSUB3(ffs2c,FTS2C,fts2c,STRING,PSTRING,PINT)
+
+CFextern VOID_cfF(FTR2F,ftr2f)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FLOAT,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTR2F,ftr2f)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FLOAT,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(FLOAT,1)
+   QCF(INT,2)
+   QCF(PSTRING,3)
+   QCF(PINT,4)
+   char str[21];
+
+   ffr2f( TCF(ftr2f,FLOAT,1,0) 
+          TCF(ftr2f,INT,2,1) 
+          TCF(ftr2f,PSTRING,3,1) 
+          TCF(ftr2f,PINT,4,1) );
+
+   sprintf(str,"%20s",B3);
+   strcpy(B3,str);
+
+   RCF(FLOAT,1)
+   RCF(INT,2)
+   RCF(PSTRING,3)
+   RCF(PINT,4)
+}
+
+CFextern VOID_cfF(FTR2E,ftr2e)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FLOAT,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTR2E,ftr2e)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FLOAT,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(FLOAT,1)
+   QCF(INT,2)
+   QCF(PSTRING,3)
+   QCF(PINT,4)
+   char str[21];
+
+   ffr2e( TCF(ftr2e,FLOAT,1,0) 
+          TCF(ftr2e,INT,2,1) 
+          TCF(ftr2e,PSTRING,3,1) 
+          TCF(ftr2e,PINT,4,1) );
+
+   sprintf(str,"%20s",B3);
+   strcpy(B3,str);
+
+   RCF(FLOAT,1)
+   RCF(INT,2)
+   RCF(PSTRING,3)
+   RCF(PINT,4)
+}
+
+CFextern VOID_cfF(FTD2F,ftd2f)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),DOUBLE,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTD2F,ftd2f)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),DOUBLE,INT,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(DOUBLE,1)
+   QCF(INT,2)
+   QCF(PSTRING,3)
+   QCF(PINT,4)
+   char str[21];
+
+   ffd2f( TCF(ftd2f,DOUBLE,1,0) 
+          TCF(ftd2f,INT,2,1) 
+          TCF(ftd2f,PSTRING,3,1) 
+          TCF(ftd2f,PINT,4,1) );
+
+   sprintf(str,"%20s",B3);
+   strcpy(B3,str);
+
+   RCF(DOUBLE,1)
+   RCF(INT,2)
+   RCF(PSTRING,3)
+   RCF(PINT,4)
+}
+
+CFextern VOID_cfF(FTD2E,ftd2e)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),DOUBLE,INT,PSTRING,PINT,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0));
+CFextern VOID_cfF(FTD2E,ftd2e)
+CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),DOUBLE,INT,PSTRING,PINT,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
+{
+   QCF(DOUBLE,1)
+   QCF(INT,2)
+   QCF(PSTRING,3)
+   QCF(PINT,4)
+   QCF(PINT,5)
+   char str[21];
+   int *vlen;
+
+   vlen = TCF(ftd2e,PINT,4,0);
+
+   /*  C version of routine doesn't use the 4th parameter, vlen  */
+   ffd2e( TCF(ftd2e,DOUBLE,1,0) 
+          TCF(ftd2e,INT,2,1) 
+          TCF(ftd2e,PSTRING,3,1) 
+          TCF(ftd2e,PINT,5,1) );
+
+   *vlen = strlen(B3);
+   if ( *vlen<20 ) {
+      sprintf(str,"%20s",B3);  /* right justify if vlen<20 characters */
+      strcpy(B3,str);
+      *vlen = 20;
+   }
+
+   RCF(DOUBLE,1)
+   RCF(INT,2)
+   RCF(PSTRING,3)
+   RCF(PINT,4)
+   RCF(PINT,5)
+}
+
+FCALLSCSUB3(ffc2ii,FTC2II,ftc2ii,STRING,PLONG,PINT)
+FCALLSCSUB3(ffc2ll,FTC2LL,ftc2ll,STRING,PINT,PINT)
+FCALLSCSUB3(ffc2rr,FTC2RR,ftc2rr,STRING,PFLOAT,PINT)
+FCALLSCSUB3(ffc2dd,FTC2DD,ftc2dd,STRING,PDOUBLE,PINT)
+FCALLSCSUB7(ffc2x,FTC2X,ftc2x,STRING,PSTRING,PLONG,PINT,PSTRING,PDOUBLE,PINT)
+FCALLSCSUB3(ffc2s,FTC2S,ftc2s,STRING,PSTRING,PINT)
+FCALLSCSUB3(ffc2i,FTC2I,ftc2i,STRING,PLONG,PINT)
+FCALLSCSUB3(ffc2r,FTC2R,ftc2r,STRING,PFLOAT,PINT)
+FCALLSCSUB3(ffc2d,FTC2D,ftc2d,STRING,PDOUBLE,PINT)
+FCALLSCSUB3(ffc2l,FTC2L,ftc2l,STRING,PINT,PINT)
+
+/*------------------ Byte-level read/seek/write -----------------*/
+/*                   (prototyped in fitsio2.h)                   */
+/*---------------------------------------------------------------*/
+
+/*
+  ffmbyt should not be called by any application programs, so
+  the wrapper should not need to be defined.  If it is needed then
+  the second parameter (LONG) will need to be changed to the
+  equivalent of the C 'off_t' type, which may be 32 or 64 bits long
+  depending on the compiler.
+  -W.Pence (7/21/00)
+  
+FCALLSCSUB4(ffmbyt,FTMBYT,ftmbyt,FITSUNIT,LONG,LOGICAL,PINT)
+*/
+
+FCALLSCSUB4(ffgbyt,FTGCBF,ftgcbf,FITSUNIT,LONG,PVOID,PINT)
+FCALLSCSUB4(ffgbyt,FTGBYT,ftgbyt,FITSUNIT,LONG,PVOID,PINT)
+
+FCALLSCSUB4(ffpbyt,FTPCBF,ftpcbf,FITSUNIT,LONG,PVOID,PINT)
+FCALLSCSUB4(ffpbyt,FTPBYT,ftpbyt,FITSUNIT,LONG,PVOID,PINT)
+
+
+/*-------------- Additional missing FITSIO routines -------------*/
+/*                   (abandoned in CFITSIO)                      */
+/*---------------------------------------------------------------*/
+
+void Cffcrep( char *comm, char *comm1, int *repeat );
+void Cffcrep( char *comm, char *comm1, int *repeat )
+{
+/*
+   check if the first comment string is to be repeated for all keywords
+   (if the last non-blank character is '&', then it is to be repeated)
+
+   comm    input comment string
+   OUTPUT PARAMETERS:
+   comm1   output comment string, = COMM minus the last '&' character
+   repeat  TRUE if the last character of COMM was the '&' character
+
+   written by Wm Pence, HEASARC/GSFC, June 1991
+   translated to C by Peter Wilson, HSTX/GSFC, Oct 1997
+*/
+
+   int len;
+
+   *repeat=FALSE;
+   len=strlen(comm);
+       /* cfortran strips trailing spaces so only check last character  */
+   if( len && comm[ len-1 ]=='&' ) {
+      strncpy(comm1,comm,len-1);  /*  Don't copy '&'  */
+      comm1[len-1]='\0';
+      *repeat=TRUE;
+   }
+   return;
+}
+FCALLSCSUB3(Cffcrep,FTCREP,ftcrep,STRING,PSTRING,PLOGICAL)
+
+
+/*------------------ Test floats for NAN values -----------------*/
+/*                     (defined in fitsio2.h)                    */
+/*---------------------------------------------------------------*/
+
+int Cfnan( float *val );
+int Cfnan( float *val )
+{
+   int code;
+
+#if BYTESWAPPED
+   short *sptr = (short*)val + 1;
+#else
+   short *sptr = (short*)val;
+#endif
+
+   code = fnan(*sptr);
+   if( code==2 ) *val = 0.0;   /* Underflow */
+
+   return( code!=0 );
+}
+FCALLSCFUN1(LOGICAL,Cfnan,FTTRNN,fttrnn,PFLOAT)
+
+
+int Cdnan( double *val );
+int Cdnan( double *val )
+{
+   int code;
+
+#if BYTESWAPPED
+   short *sptr = (short*)val + 3;
+#else
+   short *sptr = (short*)val;
+#endif
+
+   code = dnan(*sptr);
+   if( code==2 ) *val = 0.0;   /* Underflow */
+
+   return( code!=0 );
+}
+FCALLSCFUN1(LOGICAL,Cdnan,FTTDNN,fttdnn,PDOUBLE)
+
+/*-------- Functions no longer supported... normally redundant -----------*/
+/*                Included only to support older code                     */
+/*------------------------------------------------------------------------*/
+
+void Cffempty(void);
+void Cffempty(void)
+{ return; }
+FCALLSCSUB0(Cffempty,FTPDEF,ftpdef)
+FCALLSCSUB0(Cffempty,FTBDEF,ftbdef)
+FCALLSCSUB0(Cffempty,FTADEF,ftadef)
+FCALLSCSUB0(Cffempty,FTDDEF,ftddef)
+
+
+/*-------- Functions which use the lex and yacc/bison parser code -----------*/
+/*---------------------------------------------------------------------------*/
+
+#define fttexp_LONGV_A7 A3
+FCALLSCSUB8(fftexp,FTTEXP,fttexp,FITSUNIT,STRING,INT,PINT,PLONG,PINT,LONGV,PINT)
+
+#define ftfrow_LOGV_A6 A4
+FCALLSCSUB7(fffrow,FTFROW,ftfrow,FITSUNIT,STRING,LONG,LONG,PLONG,LOGICALV,PINT)
+
+#define ftfrwc_LOGV_A8 A6
+FCALLSCSUB9(fffrwc,FTFRWC,ftfrwc,FITSUNIT,STRING,STRING,STRING,STRING,LONG,DOUBLEV,LOGICALV,PINT)
+
+FCALLSCSUB4(ffsrow,FTSROW,ftsrow,FITSUNIT,FITSUNIT,STRING,PINT)
+FCALLSCSUB9(ffcrow,FTCROW,ftcrow,FITSUNIT,INT,STRING,LONG,LONG,PVOID,PVOID,PLOGICAL,PINT)
+FCALLSCSUB6(ffcalc,FTCALC,ftcalc,FITSUNIT,STRING,FITSUNIT,STRING,STRING,PINT)
+
+#define ftcalc_rng_LONGV_A7 A6
+#define ftcalc_rng_LONGV_A8 A6
+FCALLSCSUB9(ffcalc_rng,FTCALC_RNG,ftcalc_rng,FITSUNIT,STRING,FITSUNIT,STRING,STRING,INT,LONGV,LONGV,PINT)
+
+/*--------------------- grouping routines ------------------*/
+
+FCALLSCSUB4(ffgtcr,FTGTCR,ftgtcr,FITSUNIT,STRING,INT,PINT)
+FCALLSCSUB4(ffgtis,FTGTIS,ftgtis,FITSUNIT,STRING,INT,PINT)
+FCALLSCSUB3(ffgtch,FTGTCH,ftgtch,FITSUNIT,INT,PINT)
+FCALLSCSUB3(ffgtrm,FTGTRM,ftgtrm,FITSUNIT,INT,PINT)
+FCALLSCSUB4(ffgtcp,FTGTCP,ftgtcp,FITSUNIT,FITSUNIT,INT,PINT)
+FCALLSCSUB4(ffgtmg,FTGTMG,ftgtmg,FITSUNIT,FITSUNIT,INT,PINT)
+FCALLSCSUB3(ffgtcm,FTGTCM,ftgtcm,FITSUNIT,INT,PINT)
+FCALLSCSUB3(ffgtvf,FTGTVF,ftgtvf,FITSUNIT,PLONG,PINT)
+FCALLSCSUB4(ffgtop,FTGTOP,ftgtop,FITSUNIT,INT,PFITSUNIT,PINT)
+FCALLSCSUB4(ffgtam,FTGTAM,ftgtam,FITSUNIT,FITSUNIT,INT,PINT)
+FCALLSCSUB3(ffgtnm,FTGTNM,ftgtnm,FITSUNIT,PLONG,PINT)
+FCALLSCSUB3(ffgmng,FTGMNG,ftgmng,FITSUNIT,PLONG,PINT)
+FCALLSCSUB4(ffgmop,FTGMOP,ftgmop,FITSUNIT,LONG,PFITSUNIT,PINT)
+FCALLSCSUB5(ffgmcp,FTGMCP,ftgmcp,FITSUNIT,FITSUNIT,LONG,INT,PINT)
+FCALLSCSUB5(ffgmtf,FTGMTF,ftgmtf,FITSUNIT,FITSUNIT,LONG,INT,PINT)
+FCALLSCSUB4(ffgmrm,FTGMRM,ftgmrm,FITSUNIT,LONG,INT,PINT)
diff --git a/fitscopy.c b/fitscopy.c
index f8791e8..ad683d0 100644
--- a/fitscopy.c
+++ b/fitscopy.c
@@ -3,50 +3,59 @@
 
 int main(int argc, char *argv[])
 {
-    fitsfile *infptr, *outfptr;
-    int status = 0, hdutype, ii;
-    char infile[FLEN_FILENAME],outfile[FLEN_FILENAME]; 
+    fitsfile *infptr, *outfptr;   /* FITS file pointers defined in fitsio.h */
+    int status = 0;       /* status must always be initialized = 0  */
 
     if (argc != 3)
     {
-        printf("Usage: fitscopy inputfile outputfile\n");
-        return(1);
+ printf("Usage:  fitscopy inputfile outputfile\n");
+ printf("\n");
+ printf("Copy an input file to an output file, optionally filtering\n");
+ printf("the file in the process.  This seemingly simple program can\n");
+ printf("apply powerful filters which transform the input file as\n");
+ printf("it is being copied.  Filters may be used to extract a\n");
+ printf("subimage from a larger image, select rows from a table,\n");
+ printf("filter a table with a GTI time extension or a SAO region file,\n");
+ printf("create or delete columns in a table, create an image by\n");
+ printf("binning (histogramming) 2 table columns, and convert IRAF\n");
+ printf("format *.imh or raw binary data files into FITS images.\n");
+ printf("See the CFITSIO User's Guide for a complete description of\n");
+ printf("the Extended File Name filtering syntax.\n");
+ printf("\n");
+ printf("Examples:\n");
+ printf("\n");
+ printf("fitscopy in.fit out.fit                   (simple file copy)\n");
+ printf("fitscopy - -                              (stdin to stdout)\n");
+ printf("fitscopy in.fit[11:50,21:60] out.fit      (copy a subimage)\n");
+ printf("fitscopy iniraf.imh out.fit               (IRAF image to FITS)\n");
+ printf("fitscopy in.dat[i512,512] out.fit         (raw array to FITS)\n");
+ printf("fitscopy in.fit[events][pi>35] out.fit    (copy rows with pi>35)\n");
+ printf("fitscopy in.fit[events][bin X,Y] out.fit  (bin an image) \n");
+ printf("fitscopy in.fit[events][col x=.9*y] out.fit        (new x column)\n");
+ printf("fitscopy in.fit[events][gtifilter()] out.fit       (time filter)\n");
+ printf("fitscopy in.fit[2][regfilter(\"pow.reg\")] out.fit (spatial filter)\n");
+ printf("\n");
+ printf("Note that it may be necessary to enclose the input file name\n");
+ printf("in single quote characters on the Unix command line.\n");
+      return(0);
     }
 
-    strcpy(infile,  argv[1] );  
-    strcpy(outfile, argv[2] );  
-
-    if ( fits_open_file(&infptr, infile, READONLY, &status) )
-    {
-         fits_report_error(stderr, status);
-         return(status);
-    }
-
-    if ( fits_create_file(&outfptr, outfile, &status) )
-    {
-         fits_close_file(infptr, &status);
-         fits_report_error(stderr, status);
-         return(status);
-    }
-
-    /* attempt to move to next HDU, until we get an EOF error */
-    for (ii = 1; !(fits_movabs_hdu(infptr, ii, &hdutype, &status) ); ii++) 
+    /* Open the input file */
+    if ( !fits_open_file(&infptr, argv[1], READONLY, &status) )
     {
-        if ( fits_copy_hdu(infptr, outfptr, 0, &status) )
-        {
-            fits_report_error(stderr, status);
-            break;
-        }
+      /* Create the output file */
+      if ( !fits_create_file(&outfptr, argv[2], &status) )
+      {
+ 
+        /* copy the previous, current, and following HDUs */
+        fits_copy_file(infptr, outfptr, 1, 1, 1, &status);
+
+        fits_close_file(outfptr,  &status);
+      }
+      fits_close_file(infptr, &status);
     }
 
-    if (status == END_OF_FILE)   
-        status = 0;              /* got the expected EOF error; reset = 0  */
-
-    fits_close_file(infptr,  &status);
-    fits_close_file(outfptr, &status);
-
-    if (status)
-        fits_report_error(stderr, status);
-
-    return(0);
+    /* if error occured, print out error message */
+    if (status) fits_report_error(stderr, status);
+    return(status);
 }
diff --git a/fitscore.c b/fitscore.c
index 3f35b72..ce9e366 100644
--- a/fitscore.c
+++ b/fitscore.c
@@ -40,19 +40,52 @@ SERVICES PROVIDED HEREUNDER."
 #include <math.h>
 #include <ctype.h>
 #include <errno.h>
-/* stddef.h is apparently needed to define size_t */
+/* stddef.h is apparently needed to define size_t with some compilers ?? */
 #include <stddef.h>
 #include "fitsio2.h"
+
+#define errmsgsiz 25
+#define ESMARKER 27  /* Escape character is used as error stack marker */
+
+#define DelAll     1 /* delete all messages on the error stack */
+#define DelMark    2 /* delete newest messages back to and including marker */
+#define DelNewest  3 /* delete the newest message from the stack */
+#define GetMesg    4 /* pop and return oldest message, ignoring marks */
+#define PutMesg    5 /* add a new message to the stack */
+#define PutMark    6 /* add a marker to the stack */
+
 /*--------------------------------------------------------------------------*/
 float ffvers(float *version)  /* IO - version number */
 /*
   return the current version number of the FITSIO software
 */
 {
-      *version = 2.100;
-
-/*  26 Sep 2000
-      *version = 2.037    6 July 2000
+      *version = 2.50;
+
+/*     28 July 2004
+
+
+   Previous releases:
+      *version = 2.49    11 Feb 2004
+      *version = 2.48    28 Jan 2004
+      *version = 2.470   18 Aug 2003
+      *version = 2.460   20 May 2003
+      *version = 2.450   30 Apr 2003  (internal release only)
+      *version = 2.440    8 Jan 2003
+      *version = 2.430;   4 Nov 2002
+      *version = 2.420;  19 Jul 2002
+      *version = 2.410;  22 Apr 2002 used in ftools v5.2
+      *version = 2.401;  28 Jan 2002
+      *version = 2.400;  18 Jan 2002
+      *version = 2.301;   7 Dec 2001
+      *version = 2.300;  23 Oct 2001
+      *version = 2.204;  26 Jul 2001
+      *version = 2.203;  19 Jul 2001 used in ftools v5.1
+      *version = 2.202;  22 May 2001
+      *version = 2.201;  15 Mar 2001
+      *version = 2.200;  26 Jan 2001
+      *version = 2.100;  26 Sep 2000
+      *version = 2.037;   6 Jul 2000
       *version = 2.036;   1 Feb 2000
       *version = 2.035;   7 Dec 1999 (internal release only)
       *version = 2.034;  23 Nov 1999
@@ -191,6 +224,9 @@ void ffgerr(int status,     /* I - error status value */
     case 125:
        strcpy(errtext, "parse error in input file URL");
        break;
+    case 126:
+       strcpy(errtext, "parse error in range list");
+       break;
     case 151:
        strcpy(errtext, "bad argument (shared mem drvr)");
        break;
@@ -356,6 +392,9 @@ void ffgerr(int status,     /* I - error status value */
     case 263:
        strcpy(errtext, "illegal TDIMn keyword value");
        break;
+    case 264:
+       strcpy(errtext, "invalid BINTABLE heap pointer");
+       break;
     default:
        strcpy(errtext, "unknown error status");
        break;
@@ -565,19 +604,31 @@ void ffpmsg(const char *err_message)
   put message on to error stack
 */
 {
-    ffxmsg(1, (char *)err_message);
+    ffxmsg(PutMesg, (char *)err_message);
+    return;
+}
+/*--------------------------------------------------------------------------*/
+void ffpmrk(void)
+/*
+  write a marker to the stack.  It is then possible to pop only those
+  messages following the marker off of the stack, leaving the previous
+  messages unaffected.
 
-/* printf("%s\n", err_message); */
+  The marker is ignored by the ffgmsg routine.
+*/
+{
+    char *dummy = 0;
 
+    ffxmsg(PutMark, dummy);
     return;
 }
 /*--------------------------------------------------------------------------*/
 int ffgmsg(char *err_message)
 /*
-  get oldest message from error stack
+  get oldest message from error stack, ignoring markers
 */
 {
-    ffxmsg(-1, err_message);
+    ffxmsg(GetMesg, err_message);
     return(*err_message);
 }
 /*--------------------------------------------------------------------------*/
@@ -588,7 +639,19 @@ void ffcmsg(void)
 {
     char *dummy = 0;
 
-    ffxmsg(0, dummy);
+    ffxmsg(DelAll, dummy);
+    return;
+}
+/*--------------------------------------------------------------------------*/
+void ffcmrk(void)
+/*
+  erase newest messages in the error stack, stopping if a marker is found.
+  The marker is also erased in this case.
+*/
+{
+    char *dummy = 0;
+
+    ffxmsg(DelMark, dummy);
     return;
 }
 /*--------------------------------------------------------------------------*/
@@ -598,48 +661,72 @@ void ffxmsg( int action,
   general routine to get, put, or clear the error message stack.
   Use a static array rather than allocating memory as needed for
   the error messages because it is likely to be more efficient
-  and because it is trick ensuring that the allocated memory
-  is always freed correctly.
+  and simpler to implement.
 
   Action Code:
-       -2  - delete the newest message from the stack
-       -1  - return the oldest message and delete it from the stack
-        0  - delete all the messages on the stack
-        1  - add a new message to the stack (this overwrites the
-             oldest message if the stack is full)
+DelAll     1  delete all messages on the error stack 
+DelMark    2  delete messages back to and including the 1st marker 
+DelNewest  3  delete the newest message from the stack 
+GetMesg    4  pop and return oldest message, ignoring marks 
+PutMesg    5  add a new message to the stack 
+PutMark    6  add a marker to the stack 
+
 */
 {
     int ii;
-#define errmsgsiz 25
-    static char *txtbuff[errmsgsiz], *tmpbuff;
+    char markflag;
+    static char *txtbuff[errmsgsiz], *tmpbuff, *msgptr;
     static char errbuff[errmsgsiz][81];  /* initialize all = \0 */
     static int nummsg = 0;
 
-    if (action == -2)  /* remove newest message from stack */ 
+    if (action == DelAll)  /* clear the whole message stack */
     {
-      if (nummsg > 0)
-      {
+      for (ii = 0; ii < nummsg; ii ++)
+        *txtbuff[ii] = '\0';
+
+      nummsg = 0;
+    }
+    else if (action == DelMark)  /* clear up to and including first marker */
+    {
+      while (nummsg > 0) {
         nummsg--;  
+        markflag = *txtbuff[nummsg]; /* store possible marker character */
         *txtbuff[nummsg] = '\0';  /* clear the buffer for this msg */
+
+        if (markflag == ESMARKER)
+           break;   /* found a marker, so quit */
       }
     }
-    else if (action == -1)  /* return and remove oldest message from stack */ 
+    else if (action == DelNewest)  /* remove newest message from stack */ 
     {
       if (nummsg > 0)
       {
-        strcpy(errmsg, txtbuff[0]);   /* copy oldest message to output */
+        nummsg--;  
+        *txtbuff[nummsg] = '\0';  /* clear the buffer for this msg */
+      }
+    }
+    else if (action == GetMesg)  /* pop and return oldest message from stack */ 
+    {                            /* ignoring markers */
+      while (nummsg > 0)
+      {
+         strcpy(errmsg, txtbuff[0]);   /* copy oldest message to output */
 
-        *txtbuff[0] = '\0';  /* clear the buffer for this msg */
+         *txtbuff[0] = '\0';  /* clear the buffer for this msg */
            
-        nummsg--;  
-        for (ii = 0; ii < nummsg; ii++)
+         nummsg--;  
+         for (ii = 0; ii < nummsg; ii++)
              txtbuff[ii] = txtbuff[ii + 1]; /* shift remaining pointers */
-      }
-      else
-        errmsg[0] = '\0';  /*  no messages in the stack */
+
+         if (errmsg[0] != ESMARKER)   /* quit if this is not a marker */
+            return;
+       }
+       errmsg[0] = '\0';  /*  no messages in the stack */
     }
-    else if (action == 1)  /* add new message to stack */
+    else if (action == PutMesg)  /* add new message to stack */
     {
+     msgptr = errmsg;
+     while (strlen(msgptr))
+     {
       if (nummsg == errmsgsiz)
       {
         tmpbuff = txtbuff[0];  /* buffers full; reuse oldest buffer */
@@ -663,15 +750,41 @@ void ffxmsg( int action,
         }
       }
 
-      strncat(txtbuff[nummsg], errmsg, 80);
+      strncat(txtbuff[nummsg], msgptr, 80);
       nummsg++;
+
+      msgptr += minvalue(80, strlen(msgptr));
+     }
     }
-    else if (action == 0)  /* clear the whole message stack */
+    else if (action == PutMark)  /* put a marker on the stack */
     {
-      for (ii = 0; ii < nummsg; ii ++)
-        *txtbuff[ii] = '\0';
+      if (nummsg == errmsgsiz)
+      {
+        tmpbuff = txtbuff[0];  /* buffers full; reuse oldest buffer */
+        *txtbuff[0] = '\0';  /* clear the buffer for this msg */
+
+        nummsg--;
+        for (ii = 0; ii < nummsg; ii++)
+             txtbuff[ii] = txtbuff[ii + 1];   /* shift remaining pointers */
+
+        txtbuff[nummsg] = tmpbuff;  /* set pointer for the new message */
+      }
+      else
+      {
+        for (ii = 0; ii < errmsgsiz; ii++)
+        {
+          if (*errbuff[ii] == '\0') /* find first empty buffer */
+          {
+            txtbuff[nummsg] = errbuff[ii];
+            break;
+          }
+        }
+      }
+
+      *txtbuff[nummsg] = ESMARKER;      /* write the marker */
+      *(txtbuff[nummsg] + 1) = '\0';
+      nummsg++;
 
-      nummsg = 0;
     }
     return;
 }
@@ -759,7 +872,7 @@ int fftkey(char *keyword,    /* I -  keyword name */
           {
             /* don't print error message if status < 0  */
             sprintf(msg, "Character %d in this keyword is illegal: %.8s",
-                    ii+1, keyword);
+                    (int) (ii+1), keyword);
             ffpmsg(msg);
 
             /* explicitly flag the 2 most common cases */
@@ -1357,7 +1470,7 @@ int ffgthd(char *tmplt, /* I - input header template string */
         /* copy the new name to card + 40;  This is awkward, */
         /* but is consistent with the way the Fortran FITSIO works */
 	strcat(card,"                                        ");
-        strncpy(&card[40], tok, len);
+        strncpy(&card[40], tok, len+1); /* copy len+1 to get terminator */
 
         /*
             The HIERARCH convention supports non-standard characters
@@ -1415,7 +1528,8 @@ int ffgthd(char *tmplt, /* I - input header template string */
 
       tok += len; /* move token pointer to end of the keyword */
 
-      if (!FSTRCMP(keyname, "COMMENT") || !FSTRCMP(keyname, "HISTORY") )
+      if (!FSTRCMP(keyname, "COMMENT") || !FSTRCMP(keyname, "HISTORY")
+         || !FSTRCMP(keyname, "HIERARCH") )
       {
         *hdtype = 1;   /* simply append COMMENT and HISTORY keywords */
         strcpy(card, keyname);
@@ -1778,6 +1892,11 @@ int ffbnfm(char *tform,     /* I - format code from the TFORMn keyword */
         datacode = TLONG;
         width = 4;
     }
+    else if (form[0] == 'K')
+    {
+        datacode = TLONGLONG;
+        width = 8;
+    }
     else if (form[0] == 'E')
     {
         datacode = TFLOAT;
@@ -1825,6 +1944,11 @@ int ffbnfm(char *tform,     /* I - format code from the TFORMn keyword */
         datacode = TBYTE;
         width = 1;
     }
+    else if (form[0] == 'S') /* internal code to signify signed byte */
+    {
+        datacode = TSBYTE;
+        width = 1;
+    }
     else if (form[0] == 'C')
     {
         datacode = TCOMPLEX;
@@ -1910,29 +2034,33 @@ void ffcdsp(char *tform,    /* value of an ASCII table TFORMn keyword */
          ii++;
 
     if (tform[ii] == 0)
+    {
+        cform[0] = '\0';
         return;    /* input format string was blank */
+    }
 
     cform[0] = '%';  /* start the format string */
 
     strcpy(&cform[1], &tform[ii + 1]); /* append the width and decimal code */
 
-
-    if (tform[ii] == 'A')
+    if      (tform[ii] == 'A' || tform[ii] == 'a')
         strcat(cform, "s");
-    else if (tform[ii] == 'I')
+    else if (tform[ii] == 'I' || tform[ii] == 'i')
         strcat(cform, "d");
-    else if (tform[ii] == 'O')
+    else if (tform[ii] == 'O' || tform[ii] == 'o')
         strcat(cform, "o");
-    else if (tform[ii] == 'Z')
+    else if (tform[ii] == 'Z' || tform[ii] == 'z')
         strcat(cform, "X");
-    else if (tform[ii] == 'F')
+    else if (tform[ii] == 'F' || tform[ii] == 'f')
         strcat(cform, "f");
-    else if (tform[ii] == 'E')
+    else if (tform[ii] == 'E' || tform[ii] == 'e')
         strcat(cform, "E");
-    else if (tform[ii] == 'D')
+    else if (tform[ii] == 'D' || tform[ii] == 'd')
         strcat(cform, "E");
-    else if (tform[ii] == 'G')
+    else if (tform[ii] == 'G' || tform[ii] == 'g')
         strcat(cform, "G");
+    else
+        cform[0] = '\0';  /* unrecognized tform code */
 
     return;
 }
@@ -2153,8 +2281,21 @@ void ffcmps(char *templt,   /* I - input template (may have wildcards)      */
       }
       else if (temp[t1] == '\0')
       { 
-         /* reached end of template string so they don't match */
-         return;
+        if (wildsearch)
+        {
+            /* 
+               the previous wildcard search may have been going down
+               a blind alley.  Backtrack, and resume the wildcard
+               search with the next character in the string.
+            */
+            t1 = tsave;
+            s1 = ssave + 1;
+        }
+        else
+        {
+            /* reached end of template string so they don't match */
+            return;
+        }
       }
       else if (col[s1] == '\0')
       { 
@@ -2297,6 +2438,161 @@ int ffgtcl( fitsfile *fptr,  /* I - FITS file pointer                       */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffeqty( fitsfile *fptr,  /* I - FITS file pointer                       */
+            int  colnum,     /* I - column number                           */
+            int *typecode,   /* O - datatype code (21 = short, etc)         */
+            long *repeat,    /* O - repeat count of field                   */
+            long *width,     /* O - if ASCII, width of field or unit string */
+            int  *status)    /* IO - error status                           */
+/*
+  Get the 'equivalent' table column type. 
+
+  This routine is similar to the ffgtcl routine (which returns the physical
+  datatype of the column, as stored in the FITS file) except that if the
+  TSCALn and TZEROn keywords are defined for the column, then it returns
+  the 'equivalent' datatype.  Thus, if the column is defined as '1I'  (short
+  integer) this routine may return the type as 'TUSHORT' or as 'TFLOAT'
+  depending on the TSCALn and TZEROn values.
+  
+  Returns the datatype code of the column, as well as the vector
+  repeat count and (if it is an ASCII character column) the
+  width of the field or a unit string within the field.  This supports the
+  TFORMn = 'rAw' syntax for specifying arrays of substrings, so
+  if TFORMn = '60A12' then repeat = 60 and width = 12.
+*/
+{
+    tcolumn *colptr;
+    int hdutype, decims, tcode, effcode;
+    double tscale, tzero, min_val, max_val;
+    long lngscale = 1, lngzero = 0;
+
+    if (*status > 0)
+        return(*status);
+
+    /* reset position to the correct HDU if necessary */
+    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+    else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
+        if ( ffrdef(fptr, status) > 0)               /* rescan header */
+            return(*status);
+
+    if (colnum < 1 || colnum > (fptr->Fptr)->tfield)
+        return(*status = BAD_COL_NUM);
+
+    colptr = (fptr->Fptr)->tableptr;   /* pointer to first column */
+    colptr += (colnum - 1);    /* offset to correct column */
+
+    if (ffghdt(fptr, &hdutype, status) > 0)
+        return(*status);
+
+    if (hdutype == ASCII_TBL)
+    {
+      ffasfm(colptr->tform, typecode, width, &decims, status);
+
+      if (repeat)
+           *repeat = 1;
+    }
+    else
+    {
+      if (typecode)
+          *typecode = colptr->tdatatype;
+
+      if (width)
+          *width = colptr->twidth;
+
+      if (repeat)
+          *repeat = (long) colptr->trepeat;
+    }
+
+    /* return if caller is not interested in the typecode value */
+    if (!typecode)
+        return(*status);
+
+    /* check if the tscale and tzero keywords are defined, which might
+       change the effective datatype of the column  */
+
+    tscale = colptr->tscale;
+    tzero = colptr->tzero;
+
+    if (tscale == 1.0 && tzero == 0.0)  /* no scaling */
+        return(*status);
+ 
+    tcode = abs(*typecode);
+
+    switch (tcode)
+    {
+      case TBYTE:   /* binary table 'rB' column */
+        min_val = 0.;
+        max_val = 255.0;
+        break;
+
+      case TSHORT:
+        min_val = -32768.0;
+        max_val =  32767.0;
+        break;
+        
+      case TLONG:
+
+        min_val = -2147483648.0;
+        max_val =  2147483647.0;
+        break;
+        
+      default:  /* don't have to deal with other data types */
+        return(*status);
+    }
+
+    if (tscale >= 0.) {
+        min_val = tzero + tscale * min_val;
+        max_val = tzero + tscale * max_val;
+    } else {
+        max_val = tzero + tscale * min_val;
+        min_val = tzero + tscale * max_val;
+    }
+    if (tzero < 2147483648.)  /* don't exceed range of 32-bit integer */
+       lngzero = tzero;
+    lngscale = tscale;
+
+    if ((tzero != 2147483648.) && /* special value that exceeds integer range */
+       (lngzero != tzero || lngscale != tscale)) { /* not integers? */
+       /* floating point scaled values; just decide on required precision */
+       if (tcode == TBYTE || tcode == TSHORT)
+          effcode = TFLOAT;
+       else
+          effcode = TDOUBLE;
+
+    /*
+       In all the remaining cases, TSCALn and TZEROn are integers,
+       and not equal to 1 and 0, respectively.  
+    */
+
+    } else if ((min_val == -128.) && (max_val == 127.)) {
+        effcode = TSBYTE;
+ 
+    } else if ((min_val >= -32768.0) && (max_val <= 32767.0)) {
+        effcode = TSHORT;
+
+    } else if ((min_val >= 0.0) && (max_val <= 65535.0)) {
+        effcode = TUSHORT;
+
+    } else if ((min_val >= -2147483648.0) && (max_val <= 2147483647.0)) {
+        effcode = TLONG;
+
+    } else if ((min_val >= 0.0) && (max_val < 4294967296.0)) {
+        effcode = TULONG;
+
+    } else {  /* exceeds the range of a 32-bit integer */
+        effcode = TDOUBLE;
+    }   
+
+    /* return the effective datatype code (negative if variable length col.) */
+    if (*typecode < 0)  /* variable length array column */
+        *typecode = -effcode;
+    else
+        *typecode = effcode;
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffgncl( fitsfile *fptr,  /* I - FITS file pointer                       */
             int  *ncols,     /* O - number of columns in the table          */
             int  *status)    /* IO - error status                           */
@@ -2630,7 +2926,7 @@ int ffrhdu(fitsfile *fptr,    /* I - FITS file pointer */
     int ii, tstatus;
     char card[FLEN_CARD];
     char name[FLEN_KEYWORD], value[FLEN_VALUE], comm[FLEN_COMMENT];
-    char xname[FLEN_VALUE], *xtension;
+    char xname[FLEN_VALUE], *xtension, urltype[20];
 
     if (*status > 0)
         return(*status);
@@ -2640,7 +2936,6 @@ int ffrhdu(fitsfile *fptr,    /* I - FITS file pointer */
         ffpmsg("Cannot read first keyword in header (ffrhdu).");
         return(*status);
     }
-
     strncpy(name,card,8);  /* first 8 characters = the keyword name */
     name[8] = '\0';
 
@@ -2661,7 +2956,9 @@ int ffrhdu(fitsfile *fptr,    /* I - FITS file pointer */
 
     if (!strcmp(name, "SIMPLE"))        /* this is the primary array */
     {
+
        ffpinit(fptr, status);           /* initialize the primary array */
+
        if (hdutype != NULL)
            *hdutype = 0;
     }
@@ -2738,8 +3035,20 @@ int ffrhdu(fitsfile *fptr,    /* I - FITS file pointer */
     else
     {
         (fptr->Fptr)->lasthdu = 1;  /* yes, this is the last HDU */
-    }
 
+        /* special code for mem:// type files (FITS file in memory) */
+        /* Allocate enough memory to hold the entire HDU. */
+        /* Without this code, CFITSIO would repeatedly realloc  memory */
+        /* to incrementally increase the size of the file by 2880 bytes */
+        /* at a time, until it reached the final size */
+ 
+        ffurlt(fptr, urltype, status);
+        if (!strcmp(urltype,"mem://") || !strcmp(urltype,"memkeep://"))
+        {
+            fftrun(fptr, (fptr->Fptr)->headstart[ (fptr->Fptr)->curhdu + 1],
+               status);
+        }
+    }
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -2812,6 +3121,11 @@ int ffpinit(fitsfile *fptr,      /* I - FITS file pointer */
         ttype=TLONG;
         bytlen=4;
     }
+    else if (bitpix == LONGLONG_IMG)
+    {
+        ttype=TLONGLONG;
+        bytlen=8;
+    }
     else if (bitpix == FLOAT_IMG)
     {
         ttype=TFLOAT;
@@ -2943,7 +3257,7 @@ int ffainit(fitsfile *fptr,      /* I - FITS file pointer */
 */
     int  ii, nspace, tbcoln;
     long nrows, rowlen, pcount, tfield;
-    tcolumn *colptr;
+    tcolumn *colptr = 0;
     char name[FLEN_KEYWORD], value[FLEN_VALUE], comm[FLEN_COMMENT];
     char message[FLEN_ERRMSG], errmsg[81];
 
@@ -2975,14 +3289,17 @@ int ffainit(fitsfile *fptr,      /* I - FITS file pointer */
     if ((fptr->Fptr)->tableptr)
        free((fptr->Fptr)->tableptr); /* free memory for the old CHDU */
 
-    /* mem for column structures ; space is initialized = 0  */
-    colptr = (tcolumn *) calloc(tfield, sizeof(tcolumn) );
-    if (!colptr && tfield > 0)
+    /* mem for column structures ; space is initialized = 0 */
+    if (tfield > 0)
     {
+      colptr = (tcolumn *) calloc(tfield, sizeof(tcolumn) );
+      if (!colptr)
+      {
         ffpmsg
         ("malloc failed to get memory for FITS table descriptors (ffainit)");
         (fptr->Fptr)->tableptr = 0;  /* set a null table structure pointer */
         return(*status = ARRAY_TOO_BIG);
+      }
     }
 
     /* copy the table structure address to the fitsfile structure */
@@ -3125,7 +3442,7 @@ int ffbinit(fitsfile *fptr,     /* I - FITS file pointer */
 */
     int  ii, nspace;
     long nrows, rowlen, tfield, pcount, totalwidth;
-    tcolumn *colptr;
+    tcolumn *colptr = 0;
     char name[FLEN_KEYWORD], value[FLEN_VALUE], comm[FLEN_COMMENT];
     char message[FLEN_ERRMSG];
 
@@ -3150,13 +3467,16 @@ int ffbinit(fitsfile *fptr,     /* I - FITS file pointer */
        free((fptr->Fptr)->tableptr); /* free memory for the old CHDU */
 
     /* mem for column structures ; space is initialized = 0  */
-    colptr = (tcolumn *) calloc(tfield, sizeof(tcolumn) );
-    if (!colptr && tfield > 0)
+    if (tfield > 0)
     {
+      colptr = (tcolumn *) calloc(tfield, sizeof(tcolumn) );
+      if (!colptr)
+      {
         ffpmsg
         ("malloc failed to get memory for FITS table descriptors (ffbinit)");
         (fptr->Fptr)->tableptr = 0;  /* set a null table structure pointer */
         return(*status = ARRAY_TOO_BIG);
+      }
     }
 
     /* copy the table structure address to the fitsfile structure */
@@ -3279,7 +3599,6 @@ int ffbinit(fitsfile *fptr,     /* I - FITS file pointer */
     if ( (fptr->Fptr)->compressimg == 1) /*  Is this a compressed image */
         imcomp_get_compressed_image_par(fptr, status);
 
-
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -3584,7 +3903,7 @@ int ffgtbp(fitsfile *fptr,     /* I - FITS file pointer   */
 int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
         int colnum,     /* I - column number (1 = 1st column of table)      */
         long firstrow,  /* I - first row (1 = 1st row of table)             */
-        OFF_T firstelem, /* I - first element within vector (1 = 1st)        */
+        OFF_T firstelem, /* I - first element within vector (1 = 1st)       */
         long nelem,     /* I - number of elements to read or write          */
         int writemode,  /* I - = 1 if writing data, = 0 if reading data     */
                         /*     If = 2, then writing data, but don't modify  */
@@ -3612,7 +3931,7 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
   other routine that reads or writes to FITS files.
 */
 {
-    int nulpos, rangecheck = 1;
+    int nulpos, rangecheck = 1, tstatus = 0;
     OFF_T datastart, endpos;
     long tbcol, endrow, nrows, nblock, heapoffset, lrepeat;
     char message[81];
@@ -3689,6 +4008,17 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
     *tcode    = colptr->tdatatype;
     *repeat   = colptr->trepeat;
 
+#if (!SUPPORT_64BIT_INTEGERS)
+    if (*tcode == TLONGLONG)
+    {
+       /* experimental 64-bit integer data type */
+       sprintf(message,
+       "BITPIX=64 or TTYPE = 'K' is not supported in this version of CFITSIO");
+       ffpmsg(message);
+       return(*status = BAD_BITPIX);
+    }
+#endif
+
     strcpy(tform, colptr->tform);    /* value of TFORMn keyword            */
     strcpy(snull, colptr->strnull);  /* null value for ASCII table columns */
 
@@ -3745,7 +4075,16 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
     else if (abs(*tcode) == TDOUBLE)
        *maxelem = DBUFFSIZE / sizeof(double);
     else if (abs(*tcode) == TSTRING)
+    {
        *maxelem = (DBUFFSIZE - 1)/ *twidth; /* leave room for final \0 */
+       if (*maxelem == 0) {
+            sprintf(message,
+        "ASCII string column is too wide: %ld; max supported width is %d",
+                   *twidth,  DBUFFSIZE - 1);
+            ffpmsg(message);
+            return(*status = COL_TOO_WIDE);
+        }
+    }
     else
        *maxelem = DBUFFSIZE / *twidth; 
 
@@ -3769,20 +4108,20 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
         {
             sprintf(message,
         "First element to write is too large: %ld; max allowed value is %ld",
-                   (long) firstelem, (long) *repeat);
+                   (long) ((*elemnum) + 1), (long) *repeat);
             ffpmsg(message);
             return(*status = BAD_ELEM_NUM);
         }
 
         /* last row number to be read or written */
-        endrow = ((firstelem + nelem - 2) / *repeat) + firstrow;
+        endrow = ((*elemnum + nelem - 1) / *repeat) + firstrow;
 
         if (writemode)
         {
             /* check if we are writing beyond the current end of table */
-            if (endrow > (fptr->Fptr)->numrows)
+            if ((endrow > (fptr->Fptr)->numrows) && (nelem > 0) )
             {
-               /* if there are more HDUs following the current one, or */
+                /* if there are more HDUs following the current one, or */
                 /* if there is a data heap, then we must insert space */
                 /* for the new rows.  */
                 if ( !((fptr->Fptr)->lasthdu) || (fptr->Fptr)->heapsize > 0)
@@ -3848,7 +4187,7 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
 
               sprintf(message, 
               "  Tried to read %ld elements starting at row %ld, element %ld.",
-              nelem, firstrow, (long) firstelem);
+              nelem, firstrow, (long) ((*elemnum) + 1));
               ffpmsg(message);
 
             }
@@ -3877,6 +4216,43 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
 
       if (writemode)    /* return next empty heap address for writing */
       {
+
+        *repeat = nelem + *elemnum; /* total no. of elements in the field */
+
+        /* first, check if we are overwriting an existing row, and */
+        /* if so, if the existing space is big enough for the new vector */
+
+        if ( firstrow <= (fptr->Fptr)->numrows )
+        {
+          ffgdes(fptr, colnum, firstrow, &lrepeat, &heapoffset, &tstatus);
+          if (!tstatus)
+          {
+            if (colptr->tdatatype <= -TCOMPLEX)
+              lrepeat = lrepeat * 2;  /* no. of float or double values */
+            else if (colptr->tdatatype == -TBIT)
+              lrepeat = (lrepeat + 7) / 8;  /* convert from bits to bytes */
+
+            if (lrepeat >= *repeat)  /* enough existing space? */
+            {
+              *startpos = datastart + heapoffset + (fptr->Fptr)->heapstart;
+
+              /*  write the descriptor into the fixed length part of table */
+              if (colptr->tdatatype <= -TCOMPLEX)
+              {
+                /* divide repeat count by 2 to get no. of complex values */
+                ffpdes(fptr, colnum, firstrow, (long) *repeat / 2, 
+                      heapoffset, status);
+              }
+              else
+              {
+                ffpdes(fptr, colnum, firstrow, (long) *repeat,
+                      heapoffset, status);
+              }
+              return(*status);
+            }
+          }
+        }
+
         /* Add more rows to the table, if writing beyond the end. */
         /* It is necessary to shift the heap down in this case */
         if ( firstrow > (fptr->Fptr)->numrows)
@@ -3892,8 +4268,6 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
             }
         }
 
-        *repeat = nelem + *elemnum; /* total no. of elements in the field */
-
         /*  calculate starting position (for writing new data) in the heap */
         *startpos = datastart + (fptr->Fptr)->heapstart + 
                     (fptr->Fptr)->heapsize;
@@ -3902,8 +4276,8 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
         if (colptr->tdatatype <= -TCOMPLEX)
         {
           /* divide repeat count by 2 to get no. of complex values */
-          ffpdes(fptr, colnum, firstrow, (long) *repeat / 2, (fptr->Fptr)->heapsize,
-                 status);
+          ffpdes(fptr, colnum, firstrow, (long) *repeat / 2, 
+                (fptr->Fptr)->heapsize, status);
         }
         else
         {
@@ -3911,16 +4285,13 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
                  status);
         }
 
-        /* increment the address to the next empty heap position */
-        (fptr->Fptr)->heapsize += ((long) *repeat * (*incre)); 
-
         /* If this is not the last HDU in the file, then check if */
         /* extending the heap would overwrite the following header. */
         /* If so, then have to insert more blocks. */
         if ( !((fptr->Fptr)->lasthdu) )
         {
             endpos = datastart + (fptr->Fptr)->heapstart + 
-                     (fptr->Fptr)->heapsize;
+                     (fptr->Fptr)->heapsize + ((long) *repeat * (*incre));
 
             if (endpos > (fptr->Fptr)->headstart[ (fptr->Fptr)->curhdu + 1])
             {
@@ -3938,7 +4309,10 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
                    return(*status);
                 }
             }
-         }
+        }
+
+        /* increment the address to the next empty heap position */
+        (fptr->Fptr)->heapsize += ((long) *repeat * (*incre)); 
       }
       else    /*  get the read start position in the heap */
       {
@@ -3978,19 +4352,284 @@ int ffgcpr( fitsfile *fptr, /* I - FITS file pointer                        */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
-int ffgdes(fitsfile *fptr, /* I - FITS file pointer                         */
-           int colnum,     /* I - column number (1 = 1st column of table)   */
-           long rownum,    /* I - row number (1 = 1st row of table)         */
-           long *length,   /* O - number of elements in the row             */
-           long *heapaddr, /* O - heap pointer to the data                  */
-           int *status)    /* IO - error status                             */
+int fftheap(fitsfile *fptr,  /* I - FITS file pointer                       */
+           long *heapsz,     /* O - current size of the heap                */
+           long *unused,     /* O - no. of unused bytes in the heap         */
+           long *overlap,    /* O - no. of bytes shared by > 1 descriptors  */
+           int  *valid,      /* O - are all the heap addresses valid?       */
+           int *status)     /* IO - error status                            */
 /*
-  get (read) the variable length vector descriptor from the table.
+  Tests the contents of the binary table variable length array heap.
+  Returns the number of bytes that are currently not pointed to by any
+  of the descriptors, and also the number of bytes that are pointed to
+  by more than one descriptor.  It returns valid = FALSE if any of the
+  descriptors point to addresses that are out of the bounds of the
+  heap.
 */
 {
-    OFF_T bytepos;
-    INT32BIT descript[2];
-    tcolumn *colptr;
+    int jj, typecode, pixsize;
+    long ii, kk, repeat, offset, nbytes, theapsz, tunused = 0, toverlap = 0;
+    char *buffer, message[81];
+
+    if (*status > 0)
+        return(*status);
+
+    /* reset position to the correct HDU if necessary */
+    if ( fptr->HDUposition != (fptr->Fptr)->curhdu)
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+
+    /* rescan header to make sure everything is up to date */
+    else if ( ffrdef(fptr, status) > 0)               
+        return(*status);
+
+    if (valid) *valid = TRUE;
+    if (heapsz) *heapsz = (fptr->Fptr)->heapsize;
+    if (unused) *unused = 0;
+    if (overlap) *overlap = 0;
+    
+    /* return if this is not a binary table HDU or if the heap is empty */
+    if ( (fptr->Fptr)->hdutype != BINARY_TBL || (fptr->Fptr)->heapsize == 0 )
+        return(*status);
+
+    theapsz = (fptr->Fptr)->heapsize;
+    buffer = calloc(1, theapsz);     /* allocate temp space */
+    if (!buffer)
+    {
+        sprintf(message,"Failed to allocate buffer to test the heap");
+        ffpmsg(message);
+        return(*status = MEMORY_ALLOCATION);
+    }
+
+    /* loop over all cols */
+    for (jj = 1; jj <= (fptr->Fptr)->tfield && *status <= 0; jj++)
+    {
+        ffgtcl(fptr, jj, &typecode, NULL, NULL, status);
+        if (typecode > 0)
+           continue;        /* ignore fixed length columns */
+
+        pixsize = -typecode / 10;
+
+        /* copy heap data, row by row */
+        for (ii = 1; ii <= (fptr->Fptr)->numrows; ii++)
+        {
+            ffgdes(fptr, jj, ii, &repeat, &offset, status);
+            if (typecode == -TBIT)
+                nbytes = (repeat + 7) / 8;
+            else
+                nbytes = repeat * pixsize;
+
+            if (offset < 0 || offset + nbytes > theapsz)
+            {
+                if (valid) *valid = FALSE;  /* address out of bounds */
+                sprintf(message,
+                "Descriptor in row %ld, column %d has invalid heap address",
+                ii, jj);
+                ffpmsg(message);
+            }
+            else
+            {
+                for (kk = 0; kk < nbytes; kk++)
+                    buffer[kk + offset]++;   /* increment every used byte */
+            }
+        }
+    }
+
+    for (kk = 0; kk < theapsz; kk++)
+    {
+        if (buffer[kk] == 0)
+            tunused++;
+        else if (buffer[kk] > 1)
+            toverlap++;
+    }
+
+    if (heapsz) *heapsz = theapsz;
+    if (unused) *unused = tunused;
+    if (overlap) *overlap = toverlap;
+
+    free(buffer);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffcmph(fitsfile *fptr,  /* I -FITS file pointer                         */
+           int *status)     /* IO - error status                            */
+/*
+  compress the binary table heap by reordering the contents heap and
+  recovering any unused space
+*/
+{
+    fitsfile *tptr;
+    int jj, typecode, pixsize, valid;
+    long ii, repeat, offset, buffsize = 10000, nblock, pcount, nbytes;
+    long unused, overlap;
+    char *buffer, *tbuff = 0, comm[FLEN_COMMENT], valstring[FLEN_CARD];
+    char message[81], card[FLEN_CARD];
+    OFF_T readheapstart, writeheapstart, endpos, t1heapsize, t2heapsize;
+
+    if (*status > 0)
+        return(*status);
+
+    /* get information about the current heap */
+    fftheap(fptr, NULL, &unused, &overlap, &valid, status);
+
+    if (!valid)
+       return(*status = BAD_HEAP_PTR);  /* bad heap pointers */
+
+    /* return if this is not a binary table HDU or if the heap is OK as is */
+    if ( (fptr->Fptr)->hdutype != BINARY_TBL || (fptr->Fptr)->heapsize == 0 ||
+         (unused == 0 && overlap == 0) || *status > 0 )
+        return(*status);
+
+    /* copy the current HDU to a temporary file in memory */
+    if (ffinit( &tptr, "mem://tempheapfile", status) )
+    {
+        sprintf(message,"Failed to create temporary file for the heap");
+        ffpmsg(message);
+        return(*status);
+    }
+    if ( ffcopy(fptr, tptr, 0, status) )
+    {
+        sprintf(message,"Failed to create copy of the heap");
+        ffpmsg(message);
+        ffclos(tptr, status);
+        return(*status);
+    }
+
+    buffer = malloc(buffsize);  /* allocate initial buffer */
+    if (!buffer)
+    {
+        sprintf(message,"Failed to allocate buffer to copy the heap");
+        ffpmsg(message);
+        ffclos(tptr, status);
+        return(*status = MEMORY_ALLOCATION);
+    }
+    
+    readheapstart  = (tptr->Fptr)->datastart + (tptr->Fptr)->heapstart;
+    writeheapstart = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart;
+
+    t1heapsize = (fptr->Fptr)->heapsize;  /* save original heap size */
+    (fptr->Fptr)->heapsize = 0;  /* reset heap to zero */
+
+    /* loop over all cols */
+    for (jj = 1; jj <= (fptr->Fptr)->tfield && *status <= 0; jj++)
+    {
+        ffgtcl(tptr, jj, &typecode, NULL, NULL, status);
+        if (typecode > 0)
+           continue;        /* ignore fixed length columns */
+
+        pixsize = -typecode / 10;
+
+        /* copy heap data, row by row */
+        for (ii = 1; ii <= (fptr->Fptr)->numrows; ii++)
+        {
+            ffgdes(tptr, jj, ii, &repeat, &offset, status);
+            if (typecode == -TBIT)
+                nbytes = (repeat + 7) / 8;
+            else
+                nbytes = repeat * pixsize;
+
+            /* increase size of buffer if necessary to read whole array */
+            if (nbytes > buffsize)
+            {
+                tbuff = realloc(buffer, nbytes);
+
+                if (tbuff)
+                {
+                    buffer = tbuff;
+                    buffsize = nbytes;
+                }
+                else
+                    *status = MEMORY_ALLOCATION;
+            }
+
+            /* If this is not the last HDU in the file, then check if */
+            /* extending the heap would overwrite the following header. */
+            /* If so, then have to insert more blocks. */
+            if ( !((fptr->Fptr)->lasthdu) )
+            {
+              endpos = writeheapstart + (fptr->Fptr)->heapsize + nbytes;
+
+              if (endpos > (fptr->Fptr)->headstart[ (fptr->Fptr)->curhdu + 1])
+              {
+                /* calc the number of blocks that need to be added */
+                nblock = ((endpos - 1 - 
+                         (fptr->Fptr)->headstart[ (fptr->Fptr)->curhdu + 1] ) 
+                         / 2880) + 1;
+
+                if (ffiblk(fptr, nblock, 1, status) > 0) /* insert blocks */
+                {
+                  sprintf(message,
+       "Failed to extend the size of the variable length heap by %ld blocks.",
+                   nblock);
+                   ffpmsg(message);
+                }
+              }
+            }
+
+            /* read arrray of bytes from temporary copy */
+            ffmbyt(tptr, readheapstart + offset, REPORT_EOF, status);
+            ffgbyt(tptr, nbytes, buffer, status);
+
+            /* write arrray of bytes back to original file */
+            ffmbyt(fptr, writeheapstart + (fptr->Fptr)->heapsize, 
+                    IGNORE_EOF, status);
+            ffpbyt(fptr, nbytes, buffer, status);
+
+            /* write descriptor */
+            ffpdes(fptr, jj, ii, repeat, 
+                   (fptr->Fptr)->heapsize, status);
+
+            (fptr->Fptr)->heapsize += nbytes; /* update heapsize */
+
+            if (*status > 0)
+            {
+               free(buffer);
+               ffclos(tptr, status);
+               return(*status);
+            }
+        }
+    }
+
+    free(buffer);
+    ffclos(tptr, status);
+
+    /* delete any empty blocks at the end of the HDU */
+    nblock = ( (fptr->Fptr)->headstart[ (fptr->Fptr)->curhdu + 1] -
+             (writeheapstart + (fptr->Fptr)->heapsize) ) / 2880;
+
+    if (nblock > 0)
+    {
+       t2heapsize = (fptr->Fptr)->heapsize;  /* save new heap size */
+       (fptr->Fptr)->heapsize = t1heapsize;  /* restore  original heap size */
+
+       ffdblk(fptr, nblock, status);
+       (fptr->Fptr)->heapsize = t2heapsize;  /* reset correct heap size */
+    }
+
+    /* update the PCOUNT value (size of heap) */
+    ffgkyj(fptr, "PCOUNT", &pcount, comm, status);
+    if ((fptr->Fptr)->heapsize != pcount)
+    {
+        sprintf(valstring, "%ld", (fptr->Fptr)->heapsize);
+        ffmkky("PCOUNT", valstring, comm, card, status);
+        ffmkey(fptr, card, status);
+    }
+    ffrdef(fptr, status);  /* rescan new HDU structure */
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgdes(fitsfile *fptr, /* I - FITS file pointer                         */
+           int colnum,     /* I - column number (1 = 1st column of table)   */
+           long rownum,    /* I - row number (1 = 1st row of table)         */
+           long *length,   /* O - number of elements in the row             */
+           long *heapaddr, /* O - heap pointer to the data                  */
+           int *status)    /* IO - error status                             */
+/*
+  get (read) the variable length vector descriptor from the table.
+*/
+{
+    OFF_T bytepos;
+    INT32BIT descript[2] = {0,0};
+    tcolumn *colptr;
 
     /* reset position to the correct HDU if necessary */
     if (fptr->HDUposition != (fptr->Fptr)->curhdu)
@@ -4011,15 +4650,19 @@ int ffgdes(fitsfile *fptr, /* I - FITS file pointer                         */
                   ((fptr->Fptr)->rowlength * (rownum - 1)) +
                    colptr->tbcol;
 
-        ffgi4b(fptr, bytepos, 2, 4, descript, status); /* read descriptor */
-
-        *length = (long) descript[0];   /* 1st word is the length  */
-        *heapaddr = (long) descript[1]; /* 2nd word is the address */
+        /* read descriptor */
+        if (ffgi4b(fptr, bytepos, 2, 4, descript, status) <= 0) 
+        {
+           if (length)
+             *length = (long) descript[0];   /* 1st word is the length  */
+           if (heapaddr)
+             *heapaddr = (long) descript[1]; /* 2nd word is the address */
+        }
      }
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
-int ffgdess(fitsfile *fptr, /* I - FITS file pointer                         */
+int ffgdess(fitsfile *fptr, /* I - FITS file pointer                        */
            int colnum,     /* I - column number (1 = 1st column of table)   */
            long firstrow,  /* I - first row  (1 = 1st row of table)         */
            long nrows,     /* I - number or rows to read                    */
@@ -4135,6 +4778,8 @@ int ffchdu(fitsfile *fptr,      /* I - FITS file pointer */
     else if ((fptr->Fptr)->writemode == 1)
     {
         ffrdef(fptr, status);  /* scan header to redefine structure */
+        if ((fptr->Fptr)->heapsize > 0)
+          ffuptf(fptr, status);  /* update the variable length TFORM values */
         ffpdfl(fptr, status);  /* insure correct data file values */
     }
 
@@ -4148,7 +4793,7 @@ int ffchdu(fitsfile *fptr,      /* I - FITS file pointer */
         }
     }
 
-    if (*status > 0)
+    if (*status > 0 && *status != NO_CLOSE_ERROR)
     {
         sprintf(message,
         "Error while closing HDU number %d (ffchdu).", (fptr->Fptr)->curhdu);
@@ -4279,8 +4924,6 @@ int ffrdef(fitsfile *fptr,      /* I - FITS file pointer */
               ffmkky("PCOUNT", valstring, comm, card, status);
               ffmkey(fptr, card, status);
             }
-
-            ffuptf(fptr, status);  /* update the variable length TFORM values */
           }
         }
 
@@ -4308,6 +4951,8 @@ int ffhdef(fitsfile *fptr,      /* I - FITS file pointer                    */
   the space in advance.
 */
 {
+    OFF_T delta;
+
     if (*status > 0 || morekeys < 1)
         return(*status);
 
@@ -4319,8 +4964,19 @@ int ffhdef(fitsfile *fptr,      /* I - FITS file pointer                    */
     else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
     {
       ffrdef(fptr, status);
-      (fptr->Fptr)->datastart = (((fptr->Fptr)->headend + (morekeys * 80)) /
-                                2880 + 1) * 2880;
+
+      /* ffrdef defines the offset to datastart and the start of */
+      /* the next HDU based on the number of existing keywords. */
+      /* We need to increment both of these values based on */
+      /* the number of new keywords to be added.  */
+
+      delta = (((fptr->Fptr)->headend + (morekeys * 80)) / 2880 + 1)
+                                * 2880 - (fptr->Fptr)->datastart; 
+              
+      (fptr->Fptr)->datastart += delta;
+
+      (fptr->Fptr)->headstart[ (fptr->Fptr)->curhdu + 1] += delta;
+
     }
     return(*status);
 }
@@ -4349,6 +5005,7 @@ int ffwend(fitsfile *fptr,       /* I - FITS file pointer */
 
     /* calculate the number of blank keyword slots in the header */
     nspace = ( (fptr->Fptr)->datastart - endpos ) / 80;
+
     /* construct a blank and END keyword (80 spaces )  */
     strcpy(blankkey, "                                        ");
     strcat(blankkey, "                                        ");
@@ -4583,7 +5240,7 @@ int ffcdfl( fitsfile *fptr, int *status)
    if( nfill == 0 ) return( *status );
 
    /*   move to the beginning of the fill bytes   */
-   ffmbyt(fptr, filpos, TRUE, status);
+   ffmbyt(fptr, filpos, FALSE, status);
 
    if( ffgbyt(fptr, nfill, chbuff, status) > 0)
    {
@@ -4619,19 +5276,33 @@ int ffcrhd(fitsfile *fptr,      /* I - FITS file pointer */
 */
 {
     int  tstatus = 0;
-    OFF_T bytepos;
+    OFF_T bytepos, *ptr;
 
     if (*status > 0)
         return(*status);
-    else if ((fptr->Fptr)->maxhdu == MAXHDU)
-    {
-        *status = BAD_HDU_NUM;       /* too many HDUs in file */
+
+    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+
+    /* If the current header is empty, we don't have to do anything */
+    if ((fptr->Fptr)->headend == (fptr->Fptr)->headstart[(fptr->Fptr)->curhdu] )
         return(*status);
-    }
 
     while (ffmrhd(fptr, 1, 0, &tstatus) == 0);  /* move to end of file */
 
-    ffxmsg(-2, NULL);  /* clear the end of file error message */
+    if ((fptr->Fptr)->maxhdu == (fptr->Fptr)->MAXHDU)
+    {
+        /* allocate more space for the headstart array */
+        ptr = (OFF_T*) realloc( (fptr->Fptr)->headstart,
+                        ((fptr->Fptr)->MAXHDU + 1001) * sizeof(OFF_T) );
+
+        if (ptr == NULL)
+           return (*status = MEMORY_ALLOCATION);
+        else {
+          (fptr->Fptr)->MAXHDU = (fptr->Fptr)->MAXHDU + 1000;
+          (fptr->Fptr)->headstart = ptr;
+        }
+    }
 
     if (ffchdu(fptr, status) <= 0)  /* close the current HDU */
     {
@@ -4644,6 +5315,7 @@ int ffcrhd(fitsfile *fptr,      /* I - FITS file pointer */
       (fptr->Fptr)->headend = bytepos;          /* end of header */
       (fptr->Fptr)->datastart = DATA_UNDEFINED; /* start data unit undefined */
     }
+
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -4665,7 +5337,18 @@ int ffdblk(fitsfile *fptr,      /* I - FITS file pointer                    */
 
     tstatus = 0;
     /* pointers to the read and write positions */
+
+    readpos = (fptr->Fptr)->datastart + 
+                   (fptr->Fptr)->heapstart + 
+                   (fptr->Fptr)->heapsize;
+    readpos = ((readpos + 2879) / 2880) * 2880; /* start of block */
+
+/*  the following formula is wrong because the current data unit
+    may have been extended without updating the headstart value
+    of the following HDU.
+    
     readpos = (fptr->Fptr)->headstart[((fptr->Fptr)->curhdu) + 1];
+*/
     writepos = readpos - ((OFF_T)nblocks * 2880);
 
     while ( !ffmbyt(fptr, readpos, REPORT_EOF, &tstatus) &&
@@ -4718,24 +5401,30 @@ int ffghdt(fitsfile *fptr,      /* I - FITS file pointer             */
     if (*status > 0)
         return(*status);
 
-    /* reset position to the correct HDU if necessary */
-    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
-    {
-        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
-    }
-    else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
-    {
-        /* rescan header if data structure is undefined */
-        if ( ffrdef(fptr, status) > 0)               
-            return(*status);
+    if (fptr->HDUposition == 0 && (fptr->Fptr)->headend == 0) { 
+         /* empty primary array is alway an IMAGE_HDU */
+         *exttype = IMAGE_HDU;
     }
+    else {
+ 
+        /* reset position to the correct HDU if necessary */
+        if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+        {
+            ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+        }
+        else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
+        {
+            /* rescan header if data structure is undefined */
+            if ( ffrdef(fptr, status) > 0)               
+                return(*status);
+        }
 
-    *exttype = (fptr->Fptr)->hdutype; /* return the type of HDU */
-
-    /*  check if this is a compressed image */
-    if ((fptr->Fptr)->compressimg)
-         *exttype = IMAGE_HDU;
+        *exttype = (fptr->Fptr)->hdutype; /* return the type of HDU */
 
+        /*  check if this is a compressed image */
+        if ((fptr->Fptr)->compressimg)
+            *exttype = IMAGE_HDU;
+    }
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -4831,6 +5520,137 @@ int ffgidt( fitsfile *fptr,  /* I - FITS file pointer                       */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffgiet( fitsfile *fptr,  /* I - FITS file pointer                       */
+            int  *imgtype,   /* O - image data type                         */
+            int  *status)    /* IO - error status                           */
+/*
+  Get the effective datatype of the image (= BITPIX keyword for normal image,
+  or ZBITPIX for a compressed image)
+*/
+{
+    int tstatus;
+    long lngscale = 1, lngzero = 0;
+    double bscale, bzero, min_val, max_val;
+
+    if (*status > 0)
+        return(*status);
+
+    /* reset position to the correct HDU if necessary */
+    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+    else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
+        if ( ffrdef(fptr, status) > 0)               /* rescan header */
+            return(*status);
+
+    if ((fptr->Fptr)->hdutype == IMAGE_HDU)
+    {
+        ffgky(fptr, TINT, "BITPIX", imgtype, NULL, status);
+        tstatus = 0;
+        ffgky(fptr, TDOUBLE, "BSCALE", &bscale, NULL, &tstatus);
+        if (tstatus)
+           bscale = 1.0;
+
+        tstatus = 0;
+        ffgky(fptr, TDOUBLE, "BZERO", &bzero, NULL, &tstatus);
+        if (tstatus)
+           bzero = 0.0;
+
+    }
+    else if ((fptr->Fptr)->compressimg)
+    {
+        /* this is a binary table containing a compressed image */
+        ffgky(fptr, TINT, "ZBITPIX", imgtype, NULL, status);
+    }
+    else
+    {
+        *status = NOT_IMAGE;
+        return(*status);
+
+    }
+
+    /* check if the BSCALE and BZERO keywords are defined, which might
+       change the effective datatype of the image  */
+        tstatus = 0;
+        ffgky(fptr, TDOUBLE, "BSCALE", &bscale, NULL, &tstatus);
+        if (tstatus)
+           bscale = 1.0;
+
+        tstatus = 0;
+        ffgky(fptr, TDOUBLE, "BZERO", &bzero, NULL, &tstatus);
+        if (tstatus)
+           bzero = 0.0;
+
+    if (bscale == 1.0 && bzero == 0.0)  /* no scaling */
+        return(*status);
+
+    switch (*imgtype)
+    {
+      case BYTE_IMG:   /* 8-bit image */
+        min_val = 0.;
+        max_val = 255.0;
+        break;
+
+      case SHORT_IMG:
+        min_val = -32768.0;
+        max_val =  32767.0;
+        break;
+        
+      case LONG_IMG:
+
+        min_val = -2147483648.0;
+        max_val =  2147483647.0;
+        break;
+        
+      default:  /* don't have to deal with other data types */
+        return(*status);
+    }
+
+    if (bscale >= 0.) {
+        min_val = bzero + bscale * min_val;
+        max_val = bzero + bscale * max_val;
+    } else {
+        max_val = bzero + bscale * min_val;
+        min_val = bzero + bscale * max_val;
+    }
+    if (bzero < 2147483648.)  /* don't exceed range of 32-bit integer */
+       lngzero = bzero;
+    lngscale = bscale;
+
+    if ((bzero != 2147483648.) && /* special value that exceeds integer range */
+       (lngzero != bzero || lngscale != bscale)) { /* not integers? */
+       /* floating point scaled values; just decide on required precision */
+       if (*imgtype == BYTE_IMG || *imgtype == SHORT_IMG)
+          *imgtype = FLOAT_IMG;
+       else
+         *imgtype = DOUBLE_IMG;
+
+    /*
+       In all the remaining cases, BSCALE and BZERO are integers,
+       and not equal to 1 and 0, respectively.  
+    */
+
+    } else if ((min_val == -128.) && (max_val == 127.)) {
+       *imgtype = SBYTE_IMG;
+
+    } else if ((min_val >= -32768.0) && (max_val <= 32767.0)) {
+       *imgtype = SHORT_IMG;
+
+    } else if ((min_val >= 0.0) && (max_val <= 65535.0)) {
+       *imgtype = USHORT_IMG;
+
+    } else if ((min_val >= -2147483648.0) && (max_val <= 2147483647.0)) {
+       *imgtype = LONG_IMG;
+
+    } else if ((min_val >= 0.0) && (max_val < 4294967296.0)) {
+       *imgtype = ULONG_IMG;
+
+    } else {  /* exceeds the range of a 32-bit integer */
+       *imgtype = DOUBLE_IMG;
+    }   
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffgidm( fitsfile *fptr,  /* I - FITS file pointer                       */
             int  *naxis  ,   /* O - image dimension (NAXIS value)           */
             int  *status)    /* IO - error status                           */
@@ -4931,11 +5751,25 @@ int ffmahd(fitsfile *fptr,      /* I - FITS file pointer             */
 {
     int moveto, tstatus;
     char message[FLEN_ERRMSG];
+    OFF_T *ptr;
 
     if (*status > 0)
         return(*status);
-    else if (hdunum < 1 || hdunum >= MAXHDU )
+    else if (hdunum < 1 )
         return(*status = BAD_HDU_NUM);
+    else if (hdunum >= (fptr->Fptr)->MAXHDU )
+    {
+        /* allocate more space for the headstart array */
+        ptr = (OFF_T*) realloc( (fptr->Fptr)->headstart,
+                        (hdunum + 1001) * sizeof(OFF_T) ); 
+
+        if (ptr == NULL)
+           return (*status = MEMORY_ALLOCATION);
+        else {
+          (fptr->Fptr)->MAXHDU = hdunum + 1000; 
+          (fptr->Fptr)->headstart = ptr;
+        }
+    }
 
     /* set logical HDU position to the actual position, in case they differ */
     fptr->HDUposition = (fptr->Fptr)->curhdu;
@@ -4965,15 +5799,23 @@ int ffmahd(fitsfile *fptr,      /* I - FITS file pointer             */
 
         if (*status > 0)
         {
-            sprintf(message,
-            "Failed to move to HDU number %d (ffmahd).", hdunum);
-            ffpmsg(message);
+            if (*status != END_OF_FILE)
+            {
+                /* don't clutter up the message stack in the common case of */
+                /* simply hitting the end of file (often an expected error) */
+
+                sprintf(message,
+                "Failed to move to HDU number %d (ffmahd).", hdunum);
+                ffpmsg(message);
+            }
             return(*status);
         }
     }
 
+    /* return the type of HDU; tile compressed images which are stored */
+    /* in a binary table will return exttype = IMAGE_HDU, not BINARY_TBL */
     if (exttype != NULL)
-        *exttype = (fptr->Fptr)->hdutype; /* return the type of HDU */
+        ffghdt(fptr, exttype, status);
 
     return(*status);
 }
@@ -5001,17 +5843,18 @@ int ffmrhd(fitsfile *fptr,      /* I - FITS file pointer                    */
 int ffmnhd(fitsfile *fptr,      /* I - FITS file pointer                    */
            int exttype,         /* I - desired extension type               */
            char *hduname,       /* I - desired EXTNAME value for the HDU    */
-           int hduver,         /* I - desired EXTVERS value for the HDU    */
+           int hduver,          /* I - desired EXTVERS value for the HDU    */
            int *status)         /* IO - error status                        */
 /*
-  Move to the HDU with a given EXTNAME (or HDUNAME) and EXTVERS keyword 
-  values.  If hduvers = 0, then move to the first HDU with the given
-  name regardless of EXTVERS value.  If no matching HDU is found in the
-  file, then the current open HDU will remain unchanged.
+  Move to the next HDU with a given extension type (IMAGE_HDU, ASCII_TBL,
+  BINARY_TBL, or ANY_HDU), extension name (EXTNAME or HDUNAME keyword),
+  and EXTVERS keyword values.  If hduvers = 0, then move to the first HDU
+  with the given type and name regardless of EXTVERS value.  If no matching
+  HDU is found in the file, then the current open HDU will remain unchanged.
 */
 {
     char extname[FLEN_VALUE];
-    int ii, hdutype, extnum, tstatus, match, exact;
+    int ii, hdutype, alttype, extnum, tstatus, match, exact;
     long extver;
 
     if (*status > 0)
@@ -5025,11 +5868,15 @@ int ffmnhd(fitsfile *fptr,      /* I - FITS file pointer                    */
         if (ffmahd(fptr, ii, &hdutype, &tstatus))  /* move to next HDU */
         {
            ffmahd(fptr, extnum, 0, status); /* restore file position */
-           ffxmsg(-2, extname);  /* clear the end of file error message */
-           return(*status = BAD_HDU_NUM);      /* couldn't find desired HDU */
+           return(*status = BAD_HDU_NUM);   /* couldn't find desired HDU */
         }
+
+        alttype = -1; 
+        if (fits_is_compressed_image(fptr, status))
+            alttype = BINARY_TBL;
         
-        if (exttype == ANY_HDU || hdutype == exttype)  /* matching type? */
+        /* matching type? */
+        if (exttype == ANY_HDU || hdutype == exttype || hdutype == alttype)
         {
           if (ffgkys(fptr, "EXTNAME", extname, 0, &tstatus) > 0) /* name */
           {
@@ -5079,7 +5926,6 @@ int ffthdu(fitsfile *fptr,      /* I - FITS file pointer                    */
 */
 {
     int ii, extnum, tstatus;
-    char *errmsg = 0;
 
     if (*status > 0)
         return(*status);
@@ -5100,7 +5946,6 @@ int ffthdu(fitsfile *fptr,      /* I - FITS file pointer                    */
     }
 
     ffmahd(fptr, extnum, 0, status);       /* restore orig file position */
-    ffxmsg(-2, errmsg); /* clear the end of file error message */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -5145,7 +5990,8 @@ int ffgext(fitsfile *fptr,      /* I - FITS file pointer                */
 /*--------------------------------------------------------------------------*/
 int ffiblk(fitsfile *fptr,      /* I - FITS file pointer               */
            long nblock,         /* I - no. of blocks to insert         */ 
-           int headdata,        /* O - insert where? 0=header, 1=data  */
+           int headdata,        /* I - insert where? 0=header, 1=data  */
+                                /*     -1=beginning of file            */
            int *status)         /* IO - error status                   */
 /*
    insert 2880-byte blocks at the end of the current header or data unit
@@ -5157,7 +6003,7 @@ int ffiblk(fitsfile *fptr,      /* I - FITS file pointer               */
     char charfill;
     char buff1[2880], buff2[2880];
     char *inbuff, *outbuff, *tmpbuff;
-    char errmsg[FLEN_ERRMSG];
+    char card[FLEN_CARD];
 
     if (*status > 0 || nblock <= 0)
         return(*status);
@@ -5171,6 +6017,11 @@ int ffiblk(fitsfile *fptr,      /* I - FITS file pointer               */
 
     if (headdata == 0)  
         insertpt = (fptr->Fptr)->datastart;  /* insert just before data, or */
+    else if (headdata == -1)
+    {
+        insertpt = 0;
+        strcpy(card, "XTENSION= 'IMAGE   '          / IMAGE extension");
+    }
     else                                     /* at end of data, */
     {
         insertpt = (fptr->Fptr)->datastart + 
@@ -5192,6 +6043,9 @@ int ffiblk(fitsfile *fptr,      /* I - FITS file pointer               */
 
     if (nblock == 1)  /* insert one block */
     {
+      if (headdata == -1)
+        ffmrec(fptr, 1, card, status);    /* change SIMPLE -> XTENSION */
+
       ffmbyt(fptr, insertpt, REPORT_EOF, status);  /* move to 1st point */
       ffgbyt(fptr, 2880, inbuff, status);  /* read first block of bytes */
 
@@ -5228,10 +6082,11 @@ int ffiblk(fitsfile *fptr,      /* I - FITS file pointer               */
         if (*status == END_OF_FILE)
         {
             *status = tstatus;
-            ffxmsg(-2, errmsg); /* clear the end of file error message */
         }
 
         ffmahd(fptr, savehdu + 1, &typhdu, status);  /* move back to CHDU */
+        if (headdata == -1)
+          ffmrec(fptr, 1, card, status); /* NOW change SIMPLE -> XTENSION */
 
         /* number of 2880-byte blocks that have to be shifted down */
         nshift = ((fptr->Fptr)->headstart[(fptr->Fptr)->maxhdu + 1] - insertpt)
@@ -5273,7 +6128,7 @@ int ffiblk(fitsfile *fptr,      /* I - FITS file pointer               */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
-int ffgkcl(char *card)
+int ffgkcl(char *tcard)
 
 /*
    Return the type classification of the input header record
@@ -5287,7 +6142,8 @@ int ffgkcl(char *card)
    TYP_CMPRS_KEY:
             The experimental keywords used in the compressed image format
                   ZIMAGE, ZCMPTYPE, ZNAMEn, ZVALn, ZTILEn, 
-                  ZBITPIX, ZNAXISn, ZSCALE, ZZERO, ZBLANK
+                  ZBITPIX, ZNAXISn, ZSCALE, ZZERO, ZBLANK,
+                  EXTNAME = 'COMPRESSED_IMAGE'
 
    TYP_SCAL_KEY:  BSCALE, BZERO, TSCALn, TZEROn
 
@@ -5329,7 +6185,12 @@ int ffgkcl(char *card)
 
 */ 
 {
-    char *card1, *card5;
+    char card[20], *card1, *card5;
+
+    card[0] = '\0';
+    strncat(card, tcard, 8);   /* copy the keyword name */
+    strcat(card, "        "); /* append blanks to make at least 8 chars long */
+    ffupch(card);  /* make sure it is in upper case */
 
     card1 = card + 1;  /* pointer to 2nd character */
     card5 = card + 5;  /* pointer to 6th character */
@@ -5401,6 +6262,12 @@ int ffgkcl(char *card)
     {
 	if (FSTRNCMP (card1, "OMMENT",6) == 0)
 	{
+          /* new comment string starting Oct 2001 */
+	    if (FSTRNCMP (card1, "OMMENT   and Astrophysics', volume 376, page 3",
+              46) == 0)
+	        return (TYP_STRUC_KEY);
+
+         /* original COMMENT strings from 1993 - 2001 */
 	    if (FSTRNCMP (card1, "OMMENT   FITS (Flexible Image Transport System",
               46) == 0)
 	        return (TYP_STRUC_KEY);
@@ -5475,8 +6342,16 @@ int ffgkcl(char *card)
     {
 	if (FSTRNCMP (card1, "XTEND  ", 7) == 0)
 	    return (TYP_STRUC_KEY);
+	if (FSTRNCMP (card1, "ND     ", 7) == 0)
+	    return (TYP_STRUC_KEY);
 	if (FSTRNCMP (card1, "XTNAME ", 7) == 0)
-	    return (TYP_HDUID_KEY);
+	{
+            /* check for special compressed image value */
+            if (FSTRNCMP(tcard, "EXTNAME = 'COMPRESSED_IMAGE'", 28) == 0)
+	      return (TYP_CMPRS_KEY);
+            else
+	      return (TYP_HDUID_KEY);
+	}
 	if (FSTRNCMP (card1, "XTVER  ", 7) == 0)
 	    return (TYP_HDUID_KEY);
 	if (FSTRNCMP (card1, "XTLEVEL", 7) == 0)
@@ -5687,16 +6562,18 @@ int ffdtyp(char *cval,  /* I - formatted string representation of the value */
 
     if (cval[0] == '\0')
         return(*status = VALUE_UNDEFINED);
-    if (cval[0] == '\'')
+    else if (cval[0] == '\'')
         *dtype = 'C';          /* character string starts with a quote */
     else if (cval[0] == 'T' || cval[0] == 'F')
         *dtype = 'L';          /* logical = T or F character */
     else if (cval[0] == '(')
         *dtype = 'X';          /* complex datatype "(1.2, -3.4)" */
     else if (strchr(cval,'.'))
-        *dtype = 'F';          /* float contains a decimal point */
+        *dtype = 'F';          /* float usualy contains a decimal point */
+    else if (strchr(cval,'E') || strchr(cval,'D') )
+        *dtype = 'F';          /* exponential contains a E or D */
     else
-        *dtype = 'I';          /* if none of the above must be an integer */
+        *dtype = 'I';          /* if none of the above assume it is integer */
 
     return(*status);
 }
@@ -5751,10 +6628,21 @@ int ffc2i(char *cval,   /* I - string representation of the value */
     /* convert the keyword to its native datatype */
     ffc2x(cval, &dtype, ival, &lval, sval, &dval, status);
 
-    if (dtype == 'C' || dtype == 'X' )
+    if (dtype == 'X' )
     {
             *status = BAD_INTKEY;
     }
+    else if (dtype == 'C')
+    {
+            /* try reading the string as a number */
+            if (ffc2dd(sval, &dval, status) <= 0)
+            {
+              if (dval > (double) LONG_MAX || dval < (double) LONG_MIN)
+                *status = NUM_OVERFLOW;
+              else
+                *ival = (long) dval;
+            }
+    }
     else if (dtype == 'F')
     {
             if (dval > (double) LONG_MAX || dval < (double) LONG_MIN)
@@ -5839,7 +6727,7 @@ int ffc2r(char *cval,   /* I - string representation of the value */
   datatype conversion if necessary
 */
 {
-    char dtype, msg[81];
+    char dtype, sval[81], msg[81];
     int lval;
     
     if (*status > 0)           /* inherit input status value if > 0 */
@@ -5857,6 +6745,12 @@ int ffc2r(char *cval,   /* I - string representation of the value */
         ffc2ll(cval, &lval, status);
         *fval = (float) lval;
     }
+    else if (dtype == 'C')
+    {
+        /* try reading the string as a number */
+        ffc2s(cval, sval, status); 
+        ffc2rr(sval, fval, status);
+    }
     else 
         *status = BAD_FLOATKEY;
 
@@ -5880,7 +6774,7 @@ int ffc2d(char *cval,   /* I - string representation of the value */
   datatype conversion if necessary
 */
 {
-    char dtype, msg[81];
+    char dtype, sval[81], msg[81];
     int lval;
     
     if (*status > 0)           /* inherit input status value if > 0 */
@@ -5898,6 +6792,12 @@ int ffc2d(char *cval,   /* I - string representation of the value */
         ffc2ll(cval, &lval, status);
         *dval = (double) lval;
     }
+    else if (dtype == 'C')
+    {
+        /* try reading the string as a number */
+        ffc2s(cval, sval, status); 
+        ffc2dd(sval, dval, status);
+    }
     else 
         *status = BAD_DOUBLEKEY;
 
diff --git a/fitsio.doc b/fitsio.doc
index a02dc68..72a7a6e 100644
--- a/fitsio.doc
+++ b/fitsio.doc
@@ -1,8 +1,7 @@
         FITSIO - An Interface to FITS Format Files for Fortran Programmers
 
                     William D Pence, HEASARC, NASA/GSFC
-                              Version 2.0 
-                             December 1998
+                              Version 2.4
 
 
 [Note: This file contains various formatting command symbols in the first 
@@ -15,11 +14,13 @@ is provided as part of the CFITSIO library (which is written in ANSI
 C).  This is a companion document to the CFITSIO User's Guide which
 should be consulted for further information about the underlying
 CFITSIO library.  In the remainder of this document, the terms FITSIO
-and CFITSIO are interchangable and refer to the same library.
+and CFITSIO are interchangeable and refer to the same library.
 
 FITSIO/CFITSIO is a machine-independent library of routines for reading
 and writing data files in the FITS (Flexible Image Transport System)
-data format. This library was written to provide a powerful yet simple
+data format.  It can also read IRAF format image files and raw binary
+data arrays by converting them on the fly into a virtual FITS format
+file.  This library was written to provide a powerful yet simple
 interface for accessing FITS files which will run on most commonly used
 computers and workstations. FITSIO supports all the features described
 in the official NOST definition of the FITS format and can read and
@@ -59,22 +60,12 @@ package should be sent to the primary author:
 -
 This User's Guide assumes that readers already have a general
 understanding of the definition and structure of FITS format files.
-Further information about FITS formats is available in the `FITS User's
-Guide' and the `NOST FITS Standard', which are available from the NASA
-Science Office of Standards and Technology at the address given below.
-Both of these documents are available electronically from their Web
-site and via anonymous ftp at nssdc.gsfc.nasa.gov in the /pub/fits
-directory. Any questions about FITS formats should be directed to the
-NOST, at:
--
-        NASA, Science Office of Standards and Technology
-        Code 633.2,
-        Goddard Space Flight Center
-        Greenbelt MD 20771, USA
-        WWW: http://fits.gsfc.nasa.gov/
-        E-mail: fits@fits.gsfc.nasa.gov
-        (301) 286-2899
--
+Further information about FITS formats is available from the FITS Support
+Office at {\tt http://fits.gsfc.nasa.gov}.  In particular, the
+'NOST FITS Standard' gives the authoritative definition of the FITS data
+format, and the  `FITS User's Guide' provides additional historical background
+and practical advice on using FITS files.
+
 CFITSIO users may also be interested in the FTOOLS package of programs
 that can be used to manipulate and analyze FITS format files.
 Information about FTOOLS can be obtained on the Web or via anonymous
@@ -95,52 +86,79 @@ source files (*.c) and header files (*.h). On VAX/VMS systems 2
 assembly-code files (vmsieeed.mar and vmsieeer.mar) are also needed.
 
 The Fortran interface subroutines to the C CFITSIO routines are located
-in the f77\_wrap1.c and f77\_wrap2.c files.  These are relatively simple
+in the f77\_wrap1.c, through f77\_wrap4.c files.  These are relatively simple
 'wrappers' that translate the arguments in the Fortran subroutine into
 the appropriate format for the corresponding C routine.  This
 translation is performed transparently to the user by a set of C macros
 located in the cfortran.h file.  Unfortunately cfortran.h does not
 support every combination of C and Fortran compilers so the Fortran
 interface is not supported on all platforms.  This is especially true
-for PC and Mac users (see further notes below).
+for PC and Mac users (see further notes below).  
+
+A standard combination of C and Fortran compilers will be assumed by
+default, but one may also specify a particular Fortran compiler by
+doing:
+-
+ >  setenv CFLAGS -DcompilerName=1
+-
+(where 'compilerName' is the name of the compiler) before running 
+the configure command.  The currently recognized compiler
+names are: 
+-
+ g77Fortran
+ IBMR2Fortran
+ CLIPPERFortran
+ pgiFortran
+ NAGf90Fortran
+ f2cFortran
+ hpuxFortran
+ apolloFortran
+ sunFortran
+ CRAYFortran
+ mipsFortran
+ DECFortran
+ vmsFortran
+ CONVEXFortran
+ PowerStationFortran
+ AbsoftUNIXFortran
+ AbsoftProFortran
+ SXFortran
+-
+Alternatively, one may edit the CFLAGS line in the Makefile to add the
+'-DcompilerName' flag after running the './configure' command.
 
 The CFITSIO library is built on Unix systems by typing:
 -
-   > ./configure
-   > make
+ >  ./configure [--prefix=/target/installation/path]
+ >  make          (or  'make shared')
+ >  make install  (this step is optional)
 -
-at the operating system prompt.  Type ./configure and not simply
-`configure' to ensure that the configure script in the current
-directory and not some other system-wide configure script.  The
-configure command customizes the Makefile for the particular system,
-then the `make' command compiles the source files and builds the
-library. By default this also builds the set of Fortran-callable
-wrapper routines whose calling sequences are described later in this
-document.
-
-On HP/UX systems, the environment variable CFLAGS should be set
-to -Ae before running configure to enable "extended ANSI" features.
-
-It may not be possible to staticly link programs that use CFITSIO on
-some platforms (namely, on Solaris 2.6) due to the network drivers
-(which provide FTP and HTTP access to FITS files).  It is possible to
-make both a dynamic and a static version of the CFITSIO library, but
-network file access will not be possible using the static version.  To
-build the dynamic libcfitsio.so library (on solaris), type 'make
-clean', then edit the Makefile to add -fPIC or -KPIC (gcc or cc) to the
-CFLAGS line, then rebuild the library with 'make'.  Once you're done,
-build the shared library with 
+at the operating system prompt.  The configure command customizes the
+Makefile for the particular system, then the `make' command compiles the
+source files and builds the library.  Type `./configure' and not simply
+`configure' to ensure that the configure script in the current directory
+is run and not some other system-wide configure script.  The optional
+'prefix' argument to configure gives the path to the directory where
+the CFITSIO library and include files should be installed via the later
+'make install' command. For example,
 -
- ld -G -z text -o libcfitsio.so *.o
+   > ./configure --prefix=/usr1/local
 -
-Then to get the staticly linkable libcfitsio.a library file do another
-make clean, undefine HAVE\_NET\_SERVICES on the CFLAGS line and rebuild.
-It's unimportant whether or not you use -fPIC for static builds.
+will cause the 'make install' command to copy the CFITSIO libcfitsio file 
+to /usr1/local/lib and the necessary include file to /usr1/local/include
+(assuming of course that the process has permission to write to these 
+directories).
 
-When using the shared library the executable code is not copied into
-your program at link time and instead the program locates the necessary
-library code at run time, normally through LD\_LIBRARY\_PATH or some
-other method.  The advantages are:
+By default this also builds the set of Fortran-callable
+wrapper routines whose calling sequences are described later in this
+document.
+
+The 'make shared' option builds a shared or dynamic version of the
+CFITSIO library.  When using the shared library the executable code is
+not copied into your program at link time and instead the program
+locates the necessary library code at run time, normally through
+LD\_LIBRARY\_PATH or some other method. The advantages of using a shared
+library are:
 -
    1.  Less disk space if you build more than 1 program
    2.  Less memory if more than one copy of a program using the shared
@@ -156,11 +174,20 @@ The disadvantages are:
 -
    1. More hassle at runtime.  You have to either build the programs
       specially or have LD_LIBRARY_PATH set right.
-   2. There may be a slight start up penality, depending on where you are
+   2. There may be a slight start up penalty, depending on where you are
       reading the shared library and the program from and if your CPU is
       either really slow or really heavily loaded.
 -
 
+On HP/UX systems, the environment variable CFLAGS should be set
+to -Ae before running configure to enable "extended ANSI" features.
+
+It may not be possible to staticly link programs that use CFITSIO on
+some platforms (namely, on Solaris 2.6) due to the network drivers
+(which provide FTP and HTTP access to FITS files).  It is possible to
+make both a dynamic and a static version of the CFITSIO library, but
+network file access will not be possible using the static version. 
+
 On VAX/VMS and ALPHA/VMS systems the make\_gfloat.com command file may
 be executed to build the cfitsio.olb object library using the default
 G-floating point option for double variables.  The make\_dfloat.com and
@@ -209,14 +236,13 @@ CFITSIO has currently been tested on the following platforms:
    Linux                      gcc
    MkLinux                    DR3
    Windows 95/98/NT           Borland C++ V4.5
-   Windows 95/98/NT           Microsoft/Compaq Visual C++ v5.0, v6.0
+   Windows 95/98/NT/ME/XP     Microsoft/Compaq Visual C++ v5.0, v6.0
    Windows 95/98/NT           Cygwin gcc
    OS/2                       gcc + EMX
    MacOS 7.1 or greater       Metrowerks 10.+
 -
 CFITSIO will probably run on most other Unix platforms.  Cray
-supercomputers and IBM mainframe computers are currently not
-supported.
+supercomputers are currently not supported.
 
 **B.  Testing the Library
  
@@ -242,22 +268,25 @@ release.  The diagnostic messages (which were piped to the file
 testprog.lis in the Unix example) should be identical to the listing
 contained in the file testprog.out.  The 'diff' and 'cmp' commands
 shown above should not report any differences in the files.  (There
-may be some minor formating differences, such as the presence or
+may be some minor formatting differences, such as the presence or
 absence of leading zeros, or 3 digit exponents in numbers,
 which can be ignored).
 
 The Fortran wrappers in CFITSIO may be tested with the testf77
-program on Unix systems with:
+program.  On Unix systems the fortran compilation and link command
+may be called 'f77' or 'g77', depending on the system.
 -
-    % f77 -o testf77 testf77.f -L. -lcfitsio -lnsl -lsocket  
-  or
-    % f77 -f -o testf77 testf77.f -L. -lcfitsio    (under SUN O/S)
-  or
-    % f77 -o testf77 testf77.f -Wl,-L. -lcfitsio -lm -lnsl -lsocket (HP/UX)
+   % f77 -o testf77 testf77.f -L. -lcfitsio -lnsl -lsocket  
+ or
+   % f77 -f -o testf77 testf77.f -L. -lcfitsio    (under SUN O/S)
+ or
+   % f77 -o testf77 testf77.f -Wl,-L. -lcfitsio -lm -lnsl -lsocket (HP/UX)
+ or
+   % g77 -o testf77 -s testf77.f -lcfitsio -lcc_dynamic -lncurses (Mac OS-X)
 
-    % testf77 > testf77.lis
-    % diff testf77.lis testf77.out
-    % cmp testf77.fit testf77.std
+   % testf77 > testf77.lis
+   % diff testf77.lis testf77.out
+   % cmp testf77.fit testf77.std
 -
 On machines running SUN O/S, Fortran programs must be compiled with the
 '-f' option to force double precision variables to be aligned on 8-byte
@@ -284,7 +313,7 @@ A few other utility  programs are included with CFITSIO:
     cookbook - a sample program that peforms common read and
                  write operations on a FITS file.
 
-    iter_a, iter_b, iter_c - tests of the CFITSIO iterator routine
+    iter_a, iter_b, iter_c - examples of the CFITSIO iterator routine
 -
 
 The first 4 of these utility programs can be compiled and linked by typing
@@ -400,6 +429,8 @@ claimed in the United States under Title 17, U.S. Code.
 Permission to freely use, copy, modify, and distribute this software
 and its documentation without fee is hereby granted, provided that this
 copyright notice and disclaimer of warranty appears in all copies.
+(However, see the restriction on the use of the gzip compression code,
+below).
 
 DISCLAIMER:
 
@@ -419,9 +450,23 @@ FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
 SERVICES PROVIDED HEREUNDER."
 
 The file compress.c contains (slightly modified) source code that
-originally came from gzip-1.2.4 which is freely distributed under the
-GNU General Public Licence.  A copy of the GNU licence is included
-at the beginning of that file.
+originally came from gzip-1.2.4, copyright (C) 1992-1993 by Jean-loup
+Gailly.  This gzip code is distributed under the GNU General Public
+License and thus requires that any software that uses the CFITSIO
+library (which in turn uses the gzip code) must conform to the
+provisions in the GNU General Public License.  A copy of the GNU
+license is included at the beginning of compress.c file.
+
+An alternate version of the compress.c file (called
+compress\_alternate.c) is provided for users who want to use the CFITSIO
+library but are unwilling or unable to publicly release their software
+under the terms of the GNU General Public License.   This alternate
+version contains non-functional stubs for the file compression and
+uncompression routines used by CFITSIO.  Replace the file `compress.c'
+with `compress\_alternate.c' before compiling the CFITSIO library.  This
+will produce a version of CFITSIO which does not support reading or
+writing compressed FITS files but is otherwise identical to the
+standard version.  
 
 **G.  Acknowledgements
 
@@ -453,8 +498,10 @@ can be rapidly evaluated for each row.  Peter Wilson (RSTX, NASA/GSFC)
 then wrote the parsing routines used by CFITSIO based on Lammers'
 design, combined with other techniques such as the CFITSIO iterator
 routine to further enhance the data processing throughput.  This effort
-also benefitted from a much earlier lexical parsing routine that was
-developed by Kent Blackburn (NASA/GSFC).
+also benefited from a much earlier lexical parsing routine that was
+developed by Kent Blackburn (NASA/GSFC). More recently, Craig Markwardt
+(NASA/GSFC) implemented additional functions (median, average, stddev)
+and other enhancements to the lexical parser.
 
 The CFITSIO iterator function is loosely based on similar ideas
 developed for the XMM Data Access Layer.
@@ -535,7 +582,7 @@ exact multiple of 2880 8-bit bytes long.  Any unused space is padded
 with fill characters (ASCII blanks or zeros).
 
 Each Header Unit consists of any number of 80-character keyword records
-or `card images' which have thegeneral form:
+or `card images' which have the general form:
 -
   KEYNAME = value / comment string
   NULLKEY =       / comment: This keyword has no value
@@ -574,10 +621,10 @@ previous Data Unit (or Header Unit if there is no Data Unit).
 The main required keywords in FITS primary arrays or image extensions are:
 \begin{itemize}
 \item
-BITPIX -- defines the datatype of the array: 8, 16, 32, -32, -64
-for unsigned 8--bit byte, 16--bit integer, 32--bit integer, 32--bit
-IEEE floating point, and 64--bit IEEE double precision floating point,
-respectively.
+BITPIX -- defines the datatype of the array: 8, 16, 32, -32, -64 for
+unsigned 8--bit byte, 16--bit signed integer, 32--bit signed integer,
+32--bit IEEE floating point, and 64--bit IEEE double precision floating
+point, respectively.
 \item
 NAXIS --  the number of dimensions in the array, usually 0, 1, 2, 3, or 4.
 \item
@@ -601,8 +648,9 @@ TFORMn -- the datatype of the column
 TUNITn -- the physical units of the column (optional)
 \end{itemize}
 
-Users should refer to the NOST documentation for more details about the
-required keywords and their allowed values.
+Users should refer to the FITS Support Office at {\tt http://fits.gsfc.nasa.gov}
+for futher information about the FITS format and related software 
+packages.
 
 
 *IV.   Extended File Name Syntax
@@ -620,7 +668,8 @@ end with the '.imh' extension, as well as reading and writing FITS
 files,   This feature is implemented in CFITSIO by first converting the
 IRAF image into a temporary FITS format file in memory, then opening
 the FITS file.  Any of the usual CFITSIO routines then may be used to
-read the image header or data.
+read the image header or data.  Similarly, raw binary data arrays can
+be read by converting them on the fly into virtual FITS images.
 
 \item
 FITS files on the internet can be read (and sometimes written) using the FTP,
@@ -637,6 +686,10 @@ writing the same FITS files on magnetic disk.
 \item
 Compressed FITS files in gzip or Unix COMPRESS format can be directly read.
 
+\item
+Output FITS files can be written directly in compressed gzip format,
+thus saving disk space.
+
 \item
 FITS table columns can be created, modified, or deleted 'on-the-fly' as
 the table is opened by CFITSIO.  This creates a virtual FITS file containing
@@ -683,6 +736,17 @@ directory.
 fly into a temporary FITS format image in memory which can then be read with
 any other CFITSIO routine.
 
+\item
+{\tt rawfile.dat[i512,512]}: opens a raw binary data array (a 512 x 512
+short integer array in this case) and converts it on the fly into a
+temporary FITS format image in memory which can then be read with any
+other CFITSIO routine.
+
+\item
+{\tt myfile.fits.gz}: if this is the name of a new output file, the '.gz'
+suffix will cause it to be compressed in gzip format when it is written to 
+disk.
+
 \item
 {\tt 'myfile.fits.gz[events, 2]'}:  opens and uncompresses the gzipped file
 myfile.fits then moves to the extension which has the keywords EXTNAME
@@ -770,10 +834,9 @@ completely transparent to the application program, which simply sees
 the final 2-D image in the primary array of the opened file.
 \end{itemize}
 
-**B.  Detailed Filename Syntax
-
-This section describes the full extended syntax for the FITSIO FITS file names.
-The filename can contain several different components depending on the context:
+The full extended CFITSIO FITS file name can contain several different
+components depending on the context.  These components are described in
+the following sections:
 -
 When creating a new file:
    filetype://BaseFilename(templateName)
@@ -791,7 +854,7 @@ of the order, however, the colFilter specifier, if present, will be
 processed first by CFITSIO, followed by the rowFilter specifier, and
 finally by the binSpec specifier.
 
-***1.  Filetype
+**A.  Filetype
 
 The type of file determines the medium on which the file is located
 (e.g., disk or network) and, hence, which internal device driver is used by
@@ -803,6 +866,8 @@ CFITSIO to read and/or write the file.  Currently supported types are
                    for accessing password-protected ftp sites.
         http://  - a readonly file accessed with the HTTP protocol.  It
                    does not  support username:password like the ftp driver.
+                   Proxy HTTP servers are supported using the http_proxy
+                   environment variable.
         root://  - uses the CERN root protocol for writing as well as
                    reading files over the network.
         shmem:// - opens or creates a file which persists in the computer's
@@ -815,13 +880,21 @@ CFITSIO to read and/or write the file.  Currently supported types are
 If the filetype is not specified, then type file:// is assumed.
 The double slashes '//' are optional and may be omitted in most cases.
 
-****1.  Notes about the root filetype
-
+***1.  Notes about HTTP proxy servers
 
-The original rootd server can be obtained from:
+A proxy HTTP server may be used by defining the address (URL) and port 
+number of the proxy server with the http\_proxy environment variable.
+For example
 -
-       ftp://root.cern.ch/root/rootd.tar.gz
+    setenv http_proxy http://heasarc.gsfc.nasa.gov:3128
 -
+will cause CFITSIO to use port 3128 on the heasarc proxy server whenever
+reading a FITS file with HTTP.
+
+***2.  Notes about the root filetype
+
+The original rootd server can be obtained from:
+\verb-ftp://root.cern.ch/root/rootd.tar.gz-
 but, for it to work correctly with CFITSIO one has to use a modified
 version which supports a command to return the length of the file. 
 This modified version is available in rootd subdirectory
@@ -845,11 +918,8 @@ and to /etc/inetd.conf, add the following line:
 -                                                                    
 Force inetd to reread its conf file with "kill -HUP <pid inetd>".    
 You can also start rootd by hand running directly under your private 
-account (no root system priviliges needed). For example to start     
-rootd listening on port 5151 just type:                              
--
-  rootd -p 5151                                                        
--
+account (no root system privileges needed). For example to start     
+rootd listening on port 5151 just type:   \verb+rootd -p 5151+  
 Notice: no \& is needed. Rootd will go into background by itself.       
 -
   Rootd arguments:                                                     
@@ -900,8 +970,7 @@ home directory, therefore only files below the home directory can be
 accessed.  Anonymous mode only works when the server is started via
 inetd.
 
-                                                        
-****2.  Notes about the shmem filetype:
+***3.  Notes about the shmem filetype:
 
 Shared memory files are currently supported on most Unix platforms,
 where the shared memory segments are managed by the operating system
@@ -926,7 +995,7 @@ the usual CFITSIO routine:
 -
 The file mode can be READWRITE or READONLY just as with disk files.
 More than one process can operate on READONLY mode files at the same
-time.  CFITSIO supports proper filelocking (both in READONLY and
+time.  CFITSIO supports proper file locking (both in READONLY and
 READWRITE modes), so calls to fits\_open\_file may be locked out until
 another other process closes the file.
 
@@ -946,7 +1015,7 @@ currently residing in the system and managed by the shared memory
 driver. To get a list of all the shared memory objects, run the system
 utility program `ipcs  [-a]'.
 
-***2.  Base Filename
+**B.  Base Filename
 
 The base filename is the name of the file optionally including the
 director/subdirectory path, and in the case of `ftp', `http', and `root'
@@ -968,7 +1037,14 @@ so if it is used  on the command line rather than entered at a task
 prompt, it must be  preceded by a backslash to force the UNIX
 shell to pass it verbatim to the application program.
 
-The input file may be compressed with the gzip or Unix compress
+If the output disk file name ends with the suffix '.gz', then CFITSIO
+will compress the file using the gzip compression algorithm before
+writing it to disk.  This can reduce the amount of disk space used by
+the file.  Note that this feature requires that the uncompressed file
+be constructed in memory before it is compressed and written to disk,
+so it can fail if there is insufficient available memory.
+
+An input FITS file may be compressed with the gzip or Unix compress
 algorithms, in which case CFITSIO will uncompress the file on the fly
 into a temporary file (in memory or on disk).  Compressed files may
 only be opened with read-only permission.  When specifying the name of
@@ -985,27 +1061,71 @@ FITS file, so in this case, the output filename specifier (see the next
 section) can be used to further control how CFITSIO reads ftp and http
 files.
 
-One special case is where the filename = `-' (a dash or minus sign),
-which signifies that the input file is to be read from the stdin
-stream, or written to the stdout stream if a new output file is being
-created.  In the case of reading from stdin, CFITSIO first copies the
-whole stream into a temporary FITS file (in memory or on disk), and
-subsequent reading of the FITS file occurs in this copy.  When writing
-to stdout, CFITSIO first constructs the whole file in memory (since
-random access is required), then flushes it out to the stdout stream
-when the file is closed.  This feature allows FITS files to be piped
-between tasks in memory rather than having to create temporary
-intermediate FITS files on disk.  For example if task1 creates an
-output FITS file, and task2 reads an input FITS file, the FITS file may
-be piped between the 2 tasks by specifying
+If the input file is an IRAF image file (*.imh file) then CFITSIO will
+automatically convert it on the fly into a virtual FITS image before it
+is opened by the application program.  IRAF images can only be opened
+with READONLY file access.
+
+Similarly, if the input file is a raw binary data array, then CFITSIO
+will convert it on the fly into a virtual FITS image with the basic set
+of required header keywords before it is opened by the application
+program (with READONLY access).  In this case the data type and
+dimensions of the image must be specified in square brackets following
+the filename (e.g. rawfile.dat[ib512,512]). The first character (case
+insensitive) defines the datatype of the array:
+-
+     b         8-bit unsigned byte
+     i        16-bit signed integer
+     u        16-bit unsigned integer
+     j        32-bit signed integer
+     r or f   32-bit floating point
+     d        64-bit floating point
+-
+An optional second character specifies the byte order of the array
+values: b or B indicates big endian (as in FITS files and the native
+format of SUN UNIX workstations and Mac PCs) and l or L indicates
+little endian (native format of DEC OSF workstations and IBM PCs).  If
+this character is omitted then the array is assumed to have the native
+byte order of the local machine.  These datatype characters are then
+followed by a series of one or more integer values separated by commas
+which define the size of each dimension of the raw array.  Arrays with
+up to 5 dimensions are currently supported.  Finally, a byte offset to
+the position of the first pixel in the data file may be specified by
+separating it with a ':' from the last dimension value.  If omitted, it
+is assumed that the offset = 0.  This parameter may be used to skip
+over any header information in the file that precedes the binary data.
+Further examples:
+-
+  raw.dat[b10000]           1-dimensional 10000 pixel byte array
+  raw.dat[rb400,400,12]     3-dimensional floating point big-endian array
+  img.fits[ib512,512:2880]  reads the 512 x 512 short integer array in 
+                            a FITS file, skipping over the 2880 byte header
+-
+
+One special case of input file is where the filename = `-' (a dash or
+minus sign) or 'stdin' or 'stdout', which signifies that the input file
+is to be read from the stdin stream, or written to the stdout stream if
+a new output file is being created.  In the case of reading from stdin,
+CFITSIO first copies the whole stream into a temporary FITS file (in
+memory or on disk), and subsequent reading of the FITS file occurs in
+this copy.  When writing to stdout, CFITSIO first constructs the whole
+file in memory (since random access is required), then flushes it out
+to the stdout stream when the file is closed.   In addition, if the
+output filename = '-.gz' or 'stdout.gz' then it will be gzip compressed
+before being written to stdout.
+
+This ability to read and write on the stdin and stdout steams allows
+FITS files to be piped between tasks in memory rather than having to
+create temporary intermediate FITS files on disk.  For example if task1
+creates an output FITS file, and task2 reads an input FITS file, the
+FITS file may be piped between the 2 tasks by specifying
 -
    task1 - | task2 - 
 -
 where the vertical bar is the Unix piping symbol.  This assumes that the 2
 tasks read the name of the FITS file off of the command line.
 
-
-***3.  Output File Name when Opening an Existing File
+**C.  Output File Name when Opening an Existing File
 
 An optional output filename may be specified in parentheses immediately
 following the base file name to be opened.  This is mainly useful in
@@ -1023,9 +1143,7 @@ immediately following the base file name.  The output filename can
 include the '!' clobber flag.
 
 Thus, if the input filename to CFITSIO is:
--
-    file1.fits.gz(file2.fits)
--
+\verb+file1.fits.gz(file2.fits)+
 then CFITSIO will uncompress `file1.fits.gz' into the local disk file
 `file2.fits' before opening it.  CFITSIO does not automatically delete
 the output file, so it will still exist after the application program
@@ -1094,7 +1212,7 @@ rather confusing, so users should use a certain amount of caution when
 using the output file specifier with FTP or HTTP file types, to make
 sure they get the behavior that they expect.
 
-***4.  Template File Name when Creating a New File
+**D.  Template File Name when Creating a New File
 
 When a new FITS file is created with a call to fits\_create\_file, the
 name of a template file may be supplied in parentheses immediately
@@ -1107,218 +1225,7 @@ template file may also be an ASCII text file, where each line (in
 general) describes one FITS keyword record.  The format of the ASCII
 template file is described below.
 
-
-****1   Detailed Template Line Format
-
-The format of each ASCII template line closely follows the format of a
-FITS keyword record:
--
-  KEYWORD = KEYVALUE / COMMENT
--
-except that free format may be used (e.g., the equals sign may appear
-at any position in the line) and TAB characters are allowed and are
-treated the same as space characters.  The KEYVALUE and COMMENT fields
-are optional.  The equals sign character is also optional, but it is
-recommended that it be included for clarity.  Any template line that
-begins with the pound '\#' character is ignored by the template parser
-and may be use to insert comments into the template file itself.
-
-The KEYWORD name field is limited to 8 characters in length and only
-the letters A-Z, digits 0-9, and the hyphen and underscore characters
-may be used, without any embedded spaces. Lowercase letters in the
-template keyword name will be converted to uppercase.  Leading spaces
-in the template line preceding the keyword name are generally ignored,
-except if the first 8 characters of a template line are all blank, then
-the entire line is treated as a FITS comment keyword (with a blank
-keyword name) and is copied verbatim into the FITS header.
-
-The KEYVALUE field may have any allowed  FITS  data type: character
-string, logical, integer, real, complex integer, or complex real.  The
-character string values need not be enclosed in single quote characters
-unless they are necessary to distinguish the string from a different
-data type (e.g.  2.0 is a real but '2.0' is a string).  The keyword has
-an undefined (null) value if the template record only contains blanks
-following the "=" or between the "=" and the "/" comment field
-delimiter.
-
-String keyword values longer than 68 characters (the maximum length
-that will fit in a single FITS keyword record) are permitted using the
-CFITSIO long string convention. They can either be specified as a
-single long line in the template, or by using multiple lines where the
-continuing lines contain the 'CONTINUE' keyword, as in this example:
-- 
-  LONGKEY = 'This is a long string value that is contin&'
-  CONTINUE  'ued over 2 records' / comment field goes here
--
-The format of template lines with CONTINUE keyword is very strict:  3
-spaces must follow CONTINUE and the rest of the line is copied verbatim
-to the FITS file.
-
-The start of the optional COMMENT field must be preceded by "/", which
-is used to separate it from the keyword value field. Exceptions are if
-the KEYWORD name field contains COMMENT, HISTORY, CONTINUE, or if the
-first 8 characters of the template line are blanks.
-
-More than one Header-Data Unit (HDU) may be defined in the template
-file.  The start of an HDU definition is denoted with a SIMPLE or
-XTENSION template line:
-
-1) SIMPLE begins a Primary HDU definition. SIMPLE may only appear as
-the  first keyword in the template file. If the template file begins
-with XTENSION instead of SIMPLE, then a default empty Primary HDU is
-created, and the template is then assumed to define the keywords
-starting with the first extension following the Primary HDU.
-
-2) XTENSION marks the beginning of a new extension HDU definition.  The
-previous HDU will be closed at this point and processing of the next
-extension begins.
-
-****2   Auto-indexing of Keywords
-
-If a template keyword name ends with a "\#" character, it is said to be
-'auto-indexed'.   Each "\#" character will be replaced by the current
-integer index value, which gets reset = 1 at the start of each new HDU
-in the file (or 7 in the special case of a GROUP definition).  The
-FIRST indexed keyword in each template HDU definition is used as the
-'incrementor';  each subsequent occurence of this SAME keyword will
-cause the index value to be incremented.  This behavior can be rather
-subtle, as illustrated in the following examples in which the TTYPE
-keyword is the incrementor in both cases:
--
-  TTYPE# = TIME
-  TFORM# = 1D
-  TTYPE# = RATE
-  TFORM# = 1E
--
-will create TTYPE1, TFORM1, TTYPE2, and TFORM2 keywords.  But if the
-template looks like,
--
-  TTYPE# = TIME
-  TTYPE# = RATE
-  TFORM# = 1D
-  TFORM# = 1E
--
-this results in a FITS files with  TTYPE1, TTYPE2, TFORM2, and TFORM2,
-which is probably not what was intended!
-
-****3   Template Parser Directives
-
-In addition to the template lines which define individual keywords, the
-template parser recognizes 3 special directives which are each preceded
-by the backslash character:  \verb+ \include, \group+, and \verb+ \end+.
-
-The 'include' directive must be followed by a filename. It forces the
-parser to temporarily stop reading the current template file and begin
-reading the include file. Once the parser reaches the end of the
-include file it continues parsing the current template file.  Include
-files can be nested, and HDU definitions can span multiple template
-files.
-
-The start of a GROUP definition is denoted with the 'group' directive,
-and the end of a GROUP definition is denoted with the 'end' directive.
-Each GROUP contains 0 or more member blocks (HDUs or GROUPs). Member
-blocks of type GROUP can contain their own member blocks. The GROUP
-definition itself occupies one FITS file HDU of special type (GROUP
-HDU), so if a template specifies 1 group with 1 member HDU like:
--
-\group
-grpdescr = 'demo'
-xtension bintable
-# this bintable has 0 cols, 0 rows
-\end
--
-then the parser creates a FITS file with 3 HDUs :
--
-1) dummy PHDU
-2) GROUP HDU (has 1 member, which is bintable in HDU number 3)
-3) bintable (member of GROUP in HDU number 2)
--
-Technically speaking, the GROUP HDU is a BINTABLE with 6 columns. Applications
-can define additional columns in a GROUP HDU using TFORMn and TTYPEn
-(where n is 7, 8, ....) keywords or their auto-indexing equivalents.
-
-For a more complicated example of a template file using the group directives,
-look at the sample.tpl file that is included in the CFITSIO distribution.
-
-****4   Formal Template Syntax
-
-The template syntax can formally be defined as follows:
--
-    TEMPLATE = BLOCK [ BLOCK ... ]
-
-       BLOCK = { HDU | GROUP }
-
-       GROUP = \GROUP [ BLOCK ... ] \END
-
-         HDU = XTENSION [ LINE ... ] { XTENSION | \GROUP | \END | EOF }
-
-        LINE = [ KEYWORD [ = ] ] [ VALUE ] [ / COMMENT ]
-
-    X ...     - X can be present 1 or more times
-    { X | Y } - X or Y
-    [ X ]     - X is optional
--
-
-At the topmost level, the template defines 1 or more template blocks. Blocks
-can be either HDU (Header Data Unit) or a GROUP. For each block the parser
-creates 1 (or more for GROUPs) FITS file HDUs.
-
-
-****5   Errors
-
-In general the fits\_execute\_template() function tries to be as atomic
-as possible, so either everything is done or nothing is done. If an
-error occurs during parsing of the template, fits\_execute\_template()
-will (try to) delete the top level BLOCK (with all its children if any)
-in which the error occured, then it will stop reading the template file
-and it will return with an error.
-
-****6   Examples
-
-1. This template file will create a 200 x 300 pixel image, with 4-byte
-integer pixel values, in the primary HDU:
--
-  SIMPLE = T 
-  BITPIX = 32
-  NAXIS = 2     / number of dimensions
-  NAXIS1 = 100  / length of first axis
-  NAXIS2 = 200  / length of second axis
-  OBJECT = NGC 253 / name of observed object
--
-The allowed values of BITPIX are 8, 16, 32, -32, or -64,
-representing, respectively, 8-bit integer, 16-bit integer, 32-bit
-integer, 32-bit floating point, or 64 bit floating point pixels.
-
-2.  To create a FITS  table, the template first needs to include
-XTENSION = TABLE or BINTABLE to define whether it is an ASCII or binary
-table, and NAXIS2 to define the number of rows in the table.  Two
-template lines are then needed to define the name (TTYPEn) and FITS data
-format (TFORMn) of the columns, as in this example:
--
-  xtension = bintable
-  naxis2 = 40
-  ttype# = Name
-  tform# = 10a
-  ttype# = Npoints
-  tform# = j
-  ttype# = Rate
-  tunit# = counts/s
-  tform# = e
--
-The above example defines a null primary array followed by a 40-row
-binary table extension with 3 columns called 'Name', 'Npoints', and
-'Rate', with data formats of '10A' (ASCII character string), '1J'
-(integer) and '1E' (floating point), respectively.  Note that the other
-required FITS keywords (BITPIX, NAXIS, NAXIS1, PCOUNT, GCOUNT, TFIELDS,
-and END) do not need to be explicitly defined in the template because
-their values can be inferred from the other keywords in the template.
-This example also illustrates that the templates are generally
-case-insensitive (the keyword names and TFORMn values are converted to
-upper-case in the FITS file) and that string keyword values generally
-do not need to be enclosed in quotes.
-
-
-***5.  HDU Location Specification
+**E.  HDU Location Specification
 
 The optional HDU location specifier defines which HDU (Header-Data
 Unit, also known as an `extension') within the FITS file to initially
@@ -1380,7 +1287,7 @@ syntax as described in the Row Filter Specifier section, below.
                    greater than 100.
 -
 
-***6 Image Section
+**F.  Image Section
 
 A virtual file containing a rectangular subsection of an image can be
 extracted and opened by specifying the range of pixels (start:end)
@@ -1431,7 +1338,7 @@ the world coordinate system keywords in the header of the image
 section, if they exist, so that the coordinate associated with each
 pixel in the image section will be computed correctly.
 
-***7.  Column and Keyword Filtering Specification
+**G.  Column and Keyword Filtering Specification
 
 The optional column/keyword filtering specifier is used to modify the
 column structure and/or the header keywords in the HDU that was
@@ -1452,14 +1359,25 @@ operations.  More than one operation may be specified by separating
 them with semi-colons.
 
 \begin{itemize}
+
 \item
-Delete a column or keyword by listing the name preceeded by an
-exclamation mark (!), e.g., '!TIME' will delete the TIME column if it
-exists, otherwise the TIME keyword.  An error is returned if neither a
-column nor keyword with this name exists.  Note  that the exclamation
-point,  '!', is a special UNIX character, so if it is used  on the
-command line rather than entered at a task prompt, it must be  preceded
-by a backslash to force the UNIX shell to ignore it.
+Copy only a specified list of columns columns to the filtered input file.
+The list of column name should be separated by semi-colons.  Wild card
+characters may be used in the column names to match multiple columns.
+If the expression contains both a list of columns to be included and
+columns to be deleted, then all the columns in the original table 
+except the explicitly deleted columns will appear in the filtered
+table (i.e., there is no need to explicitly list the columns to
+be included if any columns are being deleted).
+
+\item
+Delete a column or keyword by listing the name preceded by a minus
+sign or an exclamation mark (!), e.g., '-TIME' will delete the TIME
+column if it exists, otherwise the TIME keyword.  An error is returned
+if neither a column nor keyword with this name exists.  Note  that the
+exclamation point,  '!', is a special UNIX character, so if it is used
+on the command line rather than entered at a task prompt, it must be
+preceded by a backslash to force the UNIX shell to ignore it.
 
 \item
 Rename an existing column or keyword with the syntax 'NewName ==
@@ -1480,7 +1398,7 @@ the form of the expression (may be a character string, logical, bit, long
 integer, or double column). An appropriate vector count (in the case
 of binary tables) will also be added if not explicitly specified.
 
-When creating a new keyword, the keyword name must be preceeded by a 
+When creating a new keyword, the keyword name must be preceded by a 
 pound sign '\#', and the expression must evaluate to a scalar
 (i.e., cannot have a column name in the expression).  The comment
 string for the keyword may be specified in parentheses immediately
@@ -1493,21 +1411,34 @@ giving the name followed by an equals sign and an arithmetic
 expression.
 \end{itemize}
 
-The expression that is used when appending or recomuting columns or
+The expression that is used when appending or recomputing columns or
 keywords can be arbitrarily complex and may be a function of other
 header keyword values and other columns (in the same row).  The full
 syntax and available functions for the expression are described below
 in the row filter specification section.
 
+If the expression contains both a list of columns to be included and
+columns to be deleted, then all the columns in the original table 
+except the explicitly deleted columns will appear in the filtered
+table.
+
 For  complex  or commonly used operations,  one  can also  place the
-operations into a text  file and  import it  into the  column filter
-using  the syntax '[col @filename.txt]'.   The operations can extend
-over multiple lines of the  file, but multiple operations must still
-be separated by semicolons.
+operations into an external text  file and import it  into the  column
+filter using  the syntax '[col @filename.txt]'.   The operations can
+extend over multiple lines of the  file, but multiple operations must
+still be separated by semicolons.   Any lines in the external text file
+that begin with 2 slash characters ('//') will be ignored and may be
+used to add comments into the file.
 
 Examples:
 -
-   [col !TIME; Good == STATUS]   - deletes the TIME column and
+   [col Time;rate]               - only the Time and rate columns will
+                                   appear in the filtered input file.
+
+   [col Time;*raw]               - include the Time column and any other
+                                   columns whose name ends with 'raw'.
+
+   [col -TIME; Good == STATUS]   - deletes the TIME column and
                                    renames the status column to 'Good'
 
    [col PI=PHA * 1.1 + 0.2]      - creates new PI column from PHA values
@@ -1516,30 +1447,46 @@ Examples:
                                    it by the EXPOSURE keyword value.
 -
 
-***8.  Row Filtering Specification
-
-    The  optional row filter is a  boolean expression enclosed in square
-    brackets for filtering or selecting rows from  the input FITS table.
-    A new FITS file is then created  which contains only those
-    rows for  which  the boolean   expression evaluates  to true.   (The
-    primary array and any  other extensions in the  input file  are also
-    copied to the new file).  The original FITS file is closed and
-    the new  file  is opened  and  passed to  the  application
-    program.  The new file will persist only until the file is closed
-    or until the program exits, unless the output file specifier (see 
-    above) is also supplied.
-
-    The expression can  be an arbitrarily  complex  series of operations
-    performed on constants, keyword values,  and column data taken  from
-    the specified FITS TABLE extension.
+**H.  Row Filtering Specification
+
+    When entering the name of a FITS table that is to be opened by a
+    program, an optional row filter may be specified to select a subset
+    of the rows in the table.  A temporary new FITS file is created on
+    the fly which contains only those rows for which the row filter
+    expression evaluates to true.  (The primary array and any other
+    extensions in the input file are also copied to the temporary
+    file).  The original FITS file is closed and the new virtual file
+    is opened by the application program.  The row filter expression is
+    enclosed in square brackets following the file name and extension
+    name (e.g., 'file.fits[events][GRADE==50]'  selects only those rows
+    where the GRADE column value equals 50).   When dealing with tables
+    where each row has an associated time and/or 2D spatial position,
+    the row filter expression can also be used to select rows based on
+    the times in a Good Time Intervals (GTI) extension, or on spatial
+    position as given in a SAO-style region file.
+
+***1.  General Syntax
+
+    The row filtering  expression can be an arbitrarily  complex series
+    of operations performed  on constants,  keyword values,  and column
+    data taken from the specified FITS TABLE extension.  The expression
+    must evaluate to a boolean  value for each row  of the table, where
+    a value of FALSE means that the row will be excluded.
+
+    For complex or commonly  used filters, one can place the expression
+    into a text file and import it into the row filter using the syntax
+    '[@filename.txt]'.  The expression can be  arbitrarily complex and
+    extend over multiple lines of the file.  Any lines in the external
+    text file that begin with 2 slash characters ('//') will be ignored
+    and may be used to add comments into the file.
 
     Keyword and   column data  are referenced by   name.  Any  string of
     characters not surrounded by    quotes (ie, a constant  string)   or
     followed by   an open parentheses (ie,   a  function name)   will be
-    initially interpretted   as a column  name and  its contents for the
+    initially interpreted   as a column  name and  its contents for the
     current row inserted into the expression.  If no such column exists,
     a keyword of that  name will be searched for  and its value used, if
-    found.  To force the  name to be  interpretted as a keyword (in case
+    found.  To force the  name to be  interpreted as a keyword (in case
     there is both a column and keyword with the  same name), precede the
     keyword name with a single pound sign, '\#', as in '\#NAXIS2'.  Due to
     the generalities of FITS column and  keyword names, if the column or
@@ -1549,7 +1496,7 @@ Examples:
 
     To access a table entry in a row other  than the current one, follow
     the  column's name  with  a row  offset  within  curly  braces.  For
-    example, 'PHA{-3}' will evaluate to the value  of column PHA, 3 rows
+    example, 'PHA\{-3\}' will evaluate to the value  of column PHA, 3 rows
     above  the  row currently  being processed.   One  cannot specify an
     absolute row number, only a relative offset.  Rows that fall outside
     the table will be treated as undefined, or NULLs.
@@ -1572,7 +1519,9 @@ by a backslash to force the UNIX shell to ignore it.
     The expression may  also include arithmetic operators and functions.
     Trigonometric  functions use  radians,  not degrees.  The  following
     arithmetic  operators and  functions  can be  used in the expression
-    (function names are case insensitive):
+    (function names are case insensitive). A null value will be returned
+    in case of illegal operations such as divide by zero, sqrt(negative)
+    log(negative), log10(negative), arccos(.gt. 1), arcsin(.gt. 1).
 
 -
     "addition"           +          "subtraction"          -
@@ -1582,6 +1531,9 @@ by a backslash to force the UNIX shell to ignore it.
     "sine"               sin(x)     "tangent"              tan(x)
     "arc cosine"         arccos(x)  "arc sine"             arcsin(x)
     "arc tangent"        arctan(x)  "arc tangent"          arctan2(x,y)
+    "hyperbolic cos"     cosh(x)    "hyperbolic sin"       sinh(x)
+    "hyperbolic tan"     tanh(x)    "round to nearest int" round(x)
+    "round down to int"  floor(x)   "round up to int"      ceil(x)
     "exponential"        exp(x)     "square root"          sqrt(x)
     "natural log"        log(x)     "common log"           log10(x)
     "modulus"            i % j      "random # [0.0,1.0)"   random()
@@ -1593,33 +1545,27 @@ by a backslash to force the UNIX shell to ignore it.
     argument which  should be  a  vector value (see  below).  The result
     will be the minimum/maximum element contained within the vector.
 
-    There are three functions that are primarily for use with SAO region
-    files and the  FSAOI  task, but they  can  be  used  directly.  They
-    return  a  boolean true   or  false  depending   on  whether a   two
-    dimensional point is in the region or not:
+    The  following  type  casting  operators  are  available,  where the
+    inclosing parentheses are required and taken  from  the  C  language
+    usage. Also, the integer to real casts values to double precision:
 -
-    "point in a circular region"
-          circle(xcntr,ycntr,radius,Xcolumn,Ycolumn)
-    
-    "point in an elliptical region"
-         ellipse(xcntr,ycntr,xhlf_wdth,yhlf_wdth,rotation,Xcolumn,Ycolumn)
-    
-    "point in a rectangular region"
-             box(xcntr,ycntr,xfll_wdth,yfll_wdth,rotation,Xcolumn,Ycolumn)
-    
-    where 
-       (xcntr,ycntr) are the (x,y) position of the center of the region
-       (xhlf_wdth,yhlf_wdth) are the (x,y) half widths of the region
-       (xfll_wdth,yfll_wdth) are the (x,y) full widths of the region
-       (radius) is half the diameter of the circle
-       (rotation) is the angle(degrees) that the region is rotated with
-             respect to (xcntr,ycntr)
-       (Xcoord,Ycoord) are the (x,y) coordinates to test, usually column
-             names
-       NOTE: each parameter can itself be an expression, not merely a
-             column name or constant.
+                "real to integer"    (int) x     (INT) x
+                "integer to real"    (float) i   (FLOAT) i
+-
+
+    In addition, several constants are built in  for  use  in  numerical
+    expressions:
+
+-
+        #pi              3.1415...      #e             2.7182...
+        #deg             #pi/180        #row           current row number
+        #null         undefined value   #snull         undefined string
 -
 
+    A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
+    "null" constants  are useful for conditionally  setting table values
+    to a NULL, or undefined, value (eg., "col1==-99 ? \#NULL : col1").
+
     There is also a function for testing if  two  values  are  close  to
     each  other,  i.e.,  if  they are "near" each other to within a user
     specified tolerance. The  arguments,  value\_1  and  value\_2  can  be
@@ -1631,21 +1577,20 @@ by a backslash to force the UNIX shell to ignore it.
 -
     When  a  NULL, or undefined, value is encountered in the FITS table,
     the expression will evaluate to NULL unless the undefined  value  is
-    not   actually   required  for  evaluation,  eg.  "TRUE  .or.  NULL" 
+    not   actually   required  for  evaluation,  e.g. "TRUE  .or.  NULL" 
     evaluates to TRUE. The  following  two  functions  allow  some  NULL
-    detection  and  handling:  ISNULL(x)  and  DEFNULL(x,y).  The former
+    detection  and  handling:
+-
+         "a null value?"              ISNULL(x)
+         "define a value for null"    DEFNULL(x,y)
+-
+    The former
     returns a boolean value of TRUE if the  argument  x  is  NULL.   The
     later  "defines"  a  value  to  be  substituted  for NULL values; it
     returns the value of x if x is not NULL, otherwise  it  returns  the
     value of y.
     
-    The  following  type  casting  operators  are  available,  where the
-    inclosing parentheses are required and taken  from  the  C  language
-    usage. Also, the integer to real casts values to double precision:
--
-                "real to integer"    (int) x     (INT) x
-                "integer to real"    (float) i   (FLOAT) i
--
+***2.  Bit Masks
 
     Bit  masks can be used to select out rows from bit columns (TFORMn =
     \#X) in FITS files. To represent the mask,  binary,  octal,  and  hex
@@ -1663,7 +1608,7 @@ by a backslash to force the UNIX shell to ignore it.
     insensitive.
     
     To construct the boolean expression using the mask  as  the  boolean
-    equal  operator  discribed above on a bit table column. For example,
+    equal  operator  described above on a bit table column. For example,
     if you had a 7 bit column named flags in a  FITS  table  and  wanted
     all  rows  having  the bit pattern 0010011, the selection expression
     would be:
@@ -1703,20 +1648,7 @@ by a backslash to force the UNIX shell to ignore it.
     Bit  fields can be appended as well using the '+' operator.  Strings
     can be concatenated this way, too.
     
-    In addition, several constants are built in  for  use  in  numerical
-    expressions:
-
--
-        #pi              3.1415...      #e             2.7182...
-        #deg             #pi/180        #row           current row number
-        #null         undefined value   #snull         undefined string
--
-
-    A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
-    "null" constants  are useful for conditionally  setting table values
-    to a NULL, or undefined, value (eg., "col1==-99 ? \#NULL : col1").
-
-  Vector Columns
+***3.  Vector Columns
 
     Vector columns can also be used  in  building  the  expression.   No
     special  syntax  is required if one wants to operate on all elements
@@ -1732,16 +1664,29 @@ by a backslash to force the UNIX shell to ignore it.
     Arithmetic and logical operations are all performed on an element by
     element basis.  Comparing two vector columns,  eg  "COL1  ==  COL2",
     thus  results  in  another vector of boolean values indicating which
-    elements of the two vectors are equal.  Two functions are  available
-    which   operate   on  vectors:  SUM(x)  and  NELEM(x).   The  former 
-    literally sums all the elements in x, returning a scalar value.   If
-    x  is  a  boolean  vector,  SUM returns the number of TRUE elements.
-    The latter, NELEM, returns the  number  of  elements  in  vector  x.
-    (NELEM  also  operates  on  bit  and string columns, returning their
-    column widths.)  As an example, to test whether all elements of  two
-    vectors  satisfy  a  given  logical  comparison,  one  can  use  the 
-    expression
+    elements of the two vectors are equal.  
 
+    Eight functions are available that operate on a vector and return a
+    scalar result:
+-
+    "minimum"      MIN(V)          "maximum"               MAX(V)
+    "average"      AVERAGE(V)      "median"                MEDIAN(V)
+    "sumation"     SUM(V)          "standard deviation"    STDDEV(V)
+    "# of values"  NELEM(V)        "# of non-null values"  NVALID(V)
+-
+    where V represents the name of a vector column or a manually 
+    constructed vector using curly brackets as described below.  The
+    first 6 of these functions ignore any null values in the vector when
+    computing the result.
+    
+    The SUM function literally sums all  the elements in x,  returning a 
+    scalar value.   If x  is  a  boolean  vector, SUM returns the number
+    of TRUE elements. The NELEM function  returns the number of elements
+    in vector x whereas NVALID return the number of non-null elements in
+    the  vector.   (NELEM  also  operates  on  bit  and string  columns, 
+    returning their column widths.)  As an example, to  test whether all 
+    elements of two vectors satisfy a  given logical comparison, one can
+    use the expression
 -
               SUM( COL1 > COL2 ) == NELEM( COL1 )
 -
@@ -1778,26 +1723,34 @@ by a backslash to force the UNIX shell to ignore it.
     Variable-length vector columns are not supported.
     
     Vectors can  be manually constructed  within the expression  using a
-    comma-separated list of  elements surrounded by curly braces ('{}').
-    For example, '{1,3,6,1}' is a 4-element vector containing the values
+    comma-separated list of  elements surrounded by curly braces ('\{\}').
+    For example, '\{1,3,6,1\}' is a 4-element vector containing the values
     1, 3, 6, and 1.  The  vector can contain  only boolean, integer, and
     real values (or expressions).  The elements will  be promoted to the
     highest  datatype   present.  Any   elements   which  are themselves
     vectors, will be expanded out with  each of its elements becoming an
     element in the constructed vector.
 
-    A common filtering method  applied to  FITS  files is a time  filter
-    using a Good Time Interval (GTI)  extension.  A high-level function,
-    gtifilter(a,b,c,d),  is  available   which  performs this    special
-    evaluation, returning a boolean result for each time element tested.
-    Its syntax is
-
--
-       gtifilter( [ "filename" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
--
-
-    where  each  "[]" demarks   optional parameters.   The  filename, if
-    specified,  can be  blank  ("") which will    mean to use  the first
+***4.  Good Time Interval Filtering
+
+    A common filtering method involves selecting rows which have a time
+    value which lies within what is called a Good Time Interval or GTI.
+    The time intervals are defined in a separate FITS table extension
+    which contains 2 columns giving the start and stop time of each
+    good interval.  The filtering operation accepts only those rows of
+    the input table which have an associated time which falls within
+    one of the time intervals defined in the GTI extension. A high
+    level function, gtifilter(a,b,c,d), is available which evaluates
+    each row of the input table  and returns TRUE  or FALSE depending
+    whether the row is inside or outside the  good time interval.  The
+    syntax is
+-
+      gtifilter( [ "gtifile" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
+-
+    where  each "[]" demarks optional parameters.  Note that  the quotes
+    around the gtifile and START/STOP column are required.  Either single
+    or double quotes may be used. The gtifile,
+    if specified,  can be blank  ("") which will  mean to use  the first
     extension  with   the name "*GTI*"  in   the current  file,  a plain
     extension  specifier (eg, "+2",  "[2]", or "[STDGTI]") which will be
     used  to  select  an extension  in  the current  file, or  a regular
@@ -1807,16 +1760,13 @@ by a backslash to force the UNIX shell to ignore it.
     the time  column  name.  A  vector  time expression  will  produce a
     vector boolean  result.  STARTCOL and  STOPCOL are the  names of the
     START/STOP   columns in the    GTI extension.  If   one  of them  is
-    specified, they both  must be. Note that  the quotes surrounding the
-    filename and START/STOP column names are required.
+    specified, they both  must be.
 
     In  its  simplest form, no parameters need to be provided -- default
     values will be used.  The expression "gtifilter()" is equivalent to
-
--
+-   
        gtifilter( "", TIME, "*START*", "*STOP*" )
--
-
+-    
     This will search the current file for a GTI  extension,  filter  the
     TIME  column in the current table, using START/STOP times taken from
     columns in the GTI  extension  with  names  containing  the  strings
@@ -1827,26 +1777,76 @@ by a backslash to force the UNIX shell to ignore it.
     searches   for   TIMEZERO/I/F   keywords  in  the  current  and  GTI 
     extensions, applying a relative time offset, if necessary.
 
-    Another common  filtering method is  a  spatial filter using  a SAO-
-    style region file.  The syntax for this high-level filter is
+***5.  Spatial Region Filtering
 
+    Another common  filtering method selects rows based on whether the
+    spatial position associated with each row is located within a given 
+    2-dimensional region.  The syntax for this high-level filter is
 -
        regfilter( "regfilename" [ , Xexpr, Yexpr [ , "wcs cols" ] ] )
 -
-
-    The region file name is required, but the rest is optional.  Without
-    any explicit expression for the X and Y coordinates (in pixels), the
-    filter will search for  and operate on columns "X"  and "Y".  If the
-    region file is   in "degrees" format  instead  of "pixels" ("hhmmss"
-    format is not supported, yet), the  filter will need WCS information
-    to convert the region coordinates to pixels.  If supplied, the final
-    parameter string contains the names of the 2 columns (space or comma
-    separated) which contain   the   desired WCS information.    If  not
-    supplied, the filter  will scan the X  and Y expressions for  column
-    names.  If only one is found in each  expression, those columns will
-    be used.  Otherwise, an error will be returned.
-
-    The region shapes supported are (names are case insensitive):
+    where each "[]" demarks optional parameters. The region file name
+    is required and must be  enclosed in quotes.  The remaining
+    parameters are optional.  The region file is an ASCII text file
+    which contains a list of one or more geometric shapes (circle,
+    ellipse, box, etc.) which defines a region on the celestial sphere
+    or an area within a particular 2D image.  The region file is
+    typically generated using an image display program such as fv/POW
+    (distribute by the HEASARC), or ds9 (distributed by the Smithsonian
+    Astrophysical Observatory).  Users should refer to the documentation
+    provided with these programs for more details on the syntax used in
+    the region files.
+
+    In its simpliest form, (e.g., regfilter("region.reg") ) the
+    coordinates in the default 'X' and 'Y' columns will be used to
+    determine if each row is inside or outside the area specified in
+    the region file.  Alternate position column names, or expressions,
+    may be entered if needed, as in
+-
+        regfilter("region.reg", XPOS, YPOS)
+-
+    Region filtering can be applied most unambiguously if the positions
+    in the region file and in the table to be filtered are both give in
+    terms of absolute celestial coordinate units.  In this case the
+    locations and sizes of the geometric shapes in the region file are
+    specified in angular units on the sky (e.g., positions given in
+    R.A. and Dec.  and sizes in arcseconds or arcminutes).  Similarly,
+    each row of the filtered table will have a celestial coordinate
+    associated with it.  This association is usually implemented using
+    a set of so-called 'World Coordinate System' (or WCS) FITS keywords
+    that define the coordinate transformation that must be applied to
+    the values in the 'X' and 'Y' columns to calculate the coordinate.
+
+    Alternatively, one can perform spatial filtering using unitless
+    'pixel' coordinates for the regions and row positions.  In this
+    case the user must be careful to ensure that the positions in the 2
+    files are self-consistent.  A typical problem is that the region
+    file may be generated using a binned image, but the unbinned
+    coordinates are given in the event table.  The ROSAT events files,
+    for example, have X and Y pixel coordinates that range from 1 -
+    15360.  These coordinates are typically binned by a factor of 32 to
+    produce a 480x480 pixel image.  If one then uses a region file
+    generated from this image (in image pixel units) to filter the
+    ROSAT events file, then the X and Y column values must be converted
+    to corresponding pixel units as in:
+-
+        regfilter("rosat.reg", X/32.+.5, Y/32.+.5)
+-
+    Note that this binning conversion is not necessary if the region
+    file is specified using celestial coordinate units instead of pixel
+    units because CFITSIO is then able to directly compare the
+    celestial coordinate of each row in the table with the celestial
+    coordinates in the region file without having to know anything
+    about how the image may have been binned.
+
+    The last "wcs cols" parameter should rarely be needed. If supplied,
+    this  string contains the names of the 2 columns (space or comma
+    separated) which have the associated WCS keywords. If not supplied,
+    the filter  will scan the X  and Y expressions for column names.
+    If only one is found in each  expression, those columns will be
+    used, otherwise an error will be returned.
+
+    These region shapes are supported (names are case insensitive):
 -
        Point         ( X1, Y1 )               <- One pixel square region
        Line          ( X1, Y1, X2, Y2 )       <- One pixel wide region
@@ -1860,26 +1860,60 @@ by a backslash to force the UNIX shell to ignore it.
        Elliptannulus ( Xc, Yc, Rinx, Riny, Routx, Routy, Ain, Aout )
        Sector        ( Xc, Yc, Amin, Amax )
 -
+    where (Xc,Yc) is  the coordinate of  the shape's center; (X\#,Y\#) are
+    the coordinates  of the shape's edges;  Rxxx are the shapes' various
+    Radii or semimajor/minor  axes; and Axxx  are the angles of rotation
+    (or bounding angles for Sector) in degrees.  For rotated shapes, the
+    rotation angle  can  be left  off, indicating  no rotation.   Common
+    alternate  names for the regions  can also be  used: rotbox = box;
+    rotrectangle = rectangle;  (rot)rhombus = (rot)diamond;  and pie
+    = sector.  When a  shape's name is  preceded by a minus sign, '-',
+    the defined region  is instead the area  *outside* its boundary (ie,
+    the region is inverted).  All the shapes within a single region
+    file are OR'd together to create the region, and the order is
+    significant. The overall way of looking at region files is that if
+    the first region is an excluded region then a dummy included region
+    of the whole detector is inserted in the front. Then each region
+    specification as it is processed overrides any selections inside of
+    that region specified by previous regions. Another way of thinking
+    about this is that if a previous excluded region is completely
+    inside of a subsequent included region the excluded region is
+    ignored.
+
+    The positional coordinates may be given either in pixel units,
+    decimal degrees or hh:mm:ss.s, dd:mm:ss.s units.  The shape sizes
+    may be given in pixels, degrees, arcminutes, or arcseconds.  Look
+    at examples of region file produced by fv/POW or ds9 for further
+    details of the region file format.
+
+    There are three functions that are primarily for use with SAO region
+    files and the  FSAOI  task, but they  can  be  used  directly.  They
+    return  a  boolean true   or  false  depending   on  whether a   two
+    dimensional point is in the region or not:
+-
+    "point in a circular region"
+          circle(xcntr,ycntr,radius,Xcolumn,Ycolumn)
+    
+    "point in an elliptical region"
+         ellipse(xcntr,ycntr,xhlf_wdth,yhlf_wdth,rotation,Xcolumn,Ycolumn)
+    
+    "point in a rectangular region"
+             box(xcntr,ycntr,xfll_wdth,yfll_wdth,rotation,Xcolumn,Ycolumn)
+    
+    where 
+       (xcntr,ycntr) are the (x,y) position of the center of the region
+       (xhlf_wdth,yhlf_wdth) are the (x,y) half widths of the region
+       (xfll_wdth,yfll_wdth) are the (x,y) full widths of the region
+       (radius) is half the diameter of the circle
+       (rotation) is the angle(degrees) that the region is rotated with
+             respect to (xcntr,ycntr)
+       (Xcoord,Ycoord) are the (x,y) coordinates to test, usually column
+             names
+       NOTE: each parameter can itself be an expression, not merely a
+             column name or constant.
+-
 
-    where (Xc,Yc) is  the coordinate of  the shape's center; (X\#,Y\#) are
-    the coordinates  of the shape's edges;  Rxxx are the shapes' various
-    Radii or semimajor/minor  axes; and Axxx  are the angles of rotation
-    (or bounding angles for Sector) in degrees.  For rotated shapes, the
-    rotation angle  can  be left  off, indicating  no rotation.   Common
-    alternate  names for the regions  can also be  used: rotbox == box;
-    rotrectangle == rectangle;  (rot)rhombus == (rot)diamond;  and pie
-    == sector.  When a  shape's name is  preceded by a minus sign, '-',
-    the defined region  is instead the area  *outside* its boundary (ie,
-    the region is inverted).  All the shapes within a single region file
-    are AND'd together to create the region.
-
-    For  complex  or commonly  used filters,  one   can also  place  the
-    expression into a text file and import it  into the row filter using
-    the syntax  '[@filename.txt]'.  The   expression can be  arbitrarily
-    complex and extend over multiple lines of the file.
-
-
-EXAMPLES:
+***5.  Example Row Filters
 -
     [ binary && mag <= 5.0]        - Extract all binary stars brighter
                                      than  fifth magnitude (note that
@@ -1911,14 +1945,30 @@ EXAMPLES:
     [@rowFilter.txt]               - Extract rows using the expression
                                      contained within the text file
                                      rowFilter.txt
+
+    [gtifilter()]                  - Search the current file for a GTI
+				     extension,  filter  the TIME
+				     column in the current table, using
+				     START/STOP times taken from
+				     columns in the GTI  extension
+
+    [regfilter("pow.reg")]         - Extract rows which have a coordinate
+                                     (as given in the X and Y columns) 
+                                     within the spatial region specified
+                                     in the pow.reg region file. 
+
+    [regfilter("pow.reg", Xs, Ys)] - Same as above, except that the
+                                     Xs and Ys columns will be used to 
+                                     determine the coordinate of each
+                                     row in the table.
 -
 
-***9.  Binning or Histogramming Specification
+**I.   Binning or Histogramming Specification
 
 The optional binning specifier is enclosed in square brackets and can
 be distinguished from a general row filter specification by the fact
 that it begins with the keyword 'bin'  not immediately followed by an
-equals sign.  When binning is specfied, a temporary N-dimensional FITS
+equals sign.  When binning is specified, a temporary N-dimensional FITS
 primary array is created by computing the histogram of the values in
 the specified columns of a FITS table extension.  After the histogram
 is computed the input FITS file containing the table is then closed and
@@ -1951,7 +2001,9 @@ number may be given instead of the name, preceded by a pound sign
 CFITSIO will first try to use the 'preferred column' as specified by
 the CPREF keyword if it exists (e.g., 'CPREF = 'DETX,DETY'), otherwise
 column names 'X', 'Y', 'Z', and 'T' will be assumed for each of the 4
-axes, respectively.
+axes, respectively.  In cases where the column name could be confused
+with an arithmetic expression, enclose the column name in parentheses to
+force the name to be interpreted literally.
 
 Each column name may be followed by an equals sign and then the lower
 and upper range of the histogram, and the size of the histogram bins,
@@ -2008,10 +2060,12 @@ reciprocal of the value when constructing the histogram.
 
 For  complex or commonly  used  histograms, one  can also  place its
 description  into  a  text  file and  import   it  into  the binning
-specification  using the  syntax '[bin  @filename.txt]'.  The
-file's contents  can extend over   multiple lines, although  it must
-still conform to the  no-spaces rule  for the min:max:binsize syntax
-and each axis specification must still be comma-separated.
+specification  using the  syntax '[bin  @filename.txt]'.  The file's
+contents  can extend over   multiple lines, although  it must still
+conform to the  no-spaces rule  for the min:max:binsize syntax and each
+axis specification must still be comma-separated.  Any lines in the
+external text file that begin with 2 slash characters ('//') will be
+ignored and may be used to add comments into the file.
 
  Examples:
 
@@ -2043,6 +2097,228 @@ and each axis specification must still be comma-separated.
 -
 
 
+*V.  Template Files
+
+When a new FITS file is created with a call to fits\_create\_file, the
+name of a template file may be supplied in parentheses immediately
+following the name of the new file to be created.  This template is
+used to define the structure of one or more HDUs in the new file.  The
+template file may be another FITS file, in which case the newly created
+file will have exactly the same keywords in each HDU as in the template
+FITS file, but all the data units will be filled with zeros.  The
+template file may also be an ASCII text file, where each line (in
+general) describes one FITS keyword record.  The format of the ASCII
+template file is described in the following sections.
+
+**A   Detailed Template Line Format
+
+The format of each ASCII template line closely follows the format of a
+FITS keyword record:
+-
+  KEYWORD = KEYVALUE / COMMENT
+-
+except that free format may be used (e.g., the equals sign may appear
+at any position in the line) and TAB characters are allowed and are
+treated the same as space characters.  The KEYVALUE and COMMENT fields
+are optional.  The equals sign character is also optional, but it is
+recommended that it be included for clarity.  Any template line that
+begins with the pound '\#' character is ignored by the template parser
+and may be use to insert comments into the template file itself.
+
+The KEYWORD name field is limited to 8 characters in length and only
+the letters A-Z, digits 0-9, and the hyphen and underscore characters
+may be used, without any embedded spaces. Lowercase letters in the
+template keyword name will be converted to uppercase.  Leading spaces
+in the template line preceding the keyword name are generally ignored,
+except if the first 8 characters of a template line are all blank, then
+the entire line is treated as a FITS comment keyword (with a blank
+keyword name) and is copied verbatim into the FITS header.
+
+The KEYVALUE field may have any allowed  FITS  data type: character
+string, logical, integer, real, complex integer, or complex real.  The
+character string values need not be enclosed in single quote characters
+unless they are necessary to distinguish the string from a different
+data type (e.g.  2.0 is a real but '2.0' is a string).  The keyword has
+an undefined (null) value if the template record only contains blanks
+following the "=" or between the "=" and the "/" comment field
+delimiter.
+
+String keyword values longer than 68 characters (the maximum length
+that will fit in a single FITS keyword record) are permitted using the
+CFITSIO long string convention. They can either be specified as a
+single long line in the template, or by using multiple lines where the
+continuing lines contain the 'CONTINUE' keyword, as in this example:
+- 
+  LONGKEY = 'This is a long string value that is contin&'
+  CONTINUE  'ued over 2 records' / comment field goes here
+-
+The format of template lines with CONTINUE keyword is very strict:  3
+spaces must follow CONTINUE and the rest of the line is copied verbatim
+to the FITS file.
+
+The start of the optional COMMENT field must be preceded by "/", which
+is used to separate it from the keyword value field. Exceptions are if
+the KEYWORD name field contains COMMENT, HISTORY, CONTINUE, or if the
+first 8 characters of the template line are blanks.
+
+More than one Header-Data Unit (HDU) may be defined in the template
+file.  The start of an HDU definition is denoted with a SIMPLE or
+XTENSION template line:
+
+1) SIMPLE begins a Primary HDU definition. SIMPLE may only appear as
+the  first keyword in the template file. If the template file begins
+with XTENSION instead of SIMPLE, then a default empty Primary HDU is
+created, and the template is then assumed to define the keywords
+starting with the first extension following the Primary HDU.
+
+2) XTENSION marks the beginning of a new extension HDU definition.  The
+previous HDU will be closed at this point and processing of the next
+extension begins.
+
+**B   Auto-indexing of Keywords
+
+If a template keyword name ends with a "\#" character, it is said to be
+'auto-indexed'.   Each "\#" character will be replaced by the current
+integer index value, which gets reset = 1 at the start of each new HDU
+in the file (or 7 in the special case of a GROUP definition).  The
+FIRST indexed keyword in each template HDU definition is used as the
+'incrementor';  each subsequent occurrence of this SAME keyword will
+cause the index value to be incremented.  This behavior can be rather
+subtle, as illustrated in the following examples in which the TTYPE
+keyword is the incrementor in both cases:
+-
+  TTYPE# = TIME
+  TFORM# = 1D
+  TTYPE# = RATE
+  TFORM# = 1E
+-
+will create TTYPE1, TFORM1, TTYPE2, and TFORM2 keywords.  But if the
+template looks like,
+-
+  TTYPE# = TIME
+  TTYPE# = RATE
+  TFORM# = 1D
+  TFORM# = 1E
+-
+this results in a FITS files with  TTYPE1, TTYPE2, TFORM2, and TFORM2,
+which is probably not what was intended!
+
+**C   Template Parser Directives
+
+In addition to the template lines which define individual keywords, the
+template parser recognizes 3 special directives which are each preceded
+by the backslash character:  \verb+ \include, \group+, and \verb+ \end+.
+
+The 'include' directive must be followed by a filename. It forces the
+parser to temporarily stop reading the current template file and begin
+reading the include file. Once the parser reaches the end of the
+include file it continues parsing the current template file.  Include
+files can be nested, and HDU definitions can span multiple template
+files.
+
+The start of a GROUP definition is denoted with the 'group' directive,
+and the end of a GROUP definition is denoted with the 'end' directive.
+Each GROUP contains 0 or more member blocks (HDUs or GROUPs). Member
+blocks of type GROUP can contain their own member blocks. The GROUP
+definition itself occupies one FITS file HDU of special type (GROUP
+HDU), so if a template specifies 1 group with 1 member HDU like:
+-
+\group
+grpdescr = 'demo'
+xtension bintable
+# this bintable has 0 cols, 0 rows
+\end
+-
+then the parser creates a FITS file with 3 HDUs :
+-
+1) dummy PHDU
+2) GROUP HDU (has 1 member, which is bintable in HDU number 3)
+3) bintable (member of GROUP in HDU number 2)
+-
+Technically speaking, the GROUP HDU is a BINTABLE with 6 columns. Applications
+can define additional columns in a GROUP HDU using TFORMn and TTYPEn
+(where n is 7, 8, ....) keywords or their auto-indexing equivalents.
+
+For a more complicated example of a template file using the group directives,
+look at the sample.tpl file that is included in the CFITSIO distribution.
+
+**D   Formal Template Syntax
+
+The template syntax can formally be defined as follows:
+-
+    TEMPLATE = BLOCK [ BLOCK ... ]
+
+       BLOCK = { HDU | GROUP }
+
+       GROUP = \GROUP [ BLOCK ... ] \END
+
+         HDU = XTENSION [ LINE ... ] { XTENSION | \GROUP | \END | EOF }
+
+        LINE = [ KEYWORD [ = ] ] [ VALUE ] [ / COMMENT ]
+
+    X ...     - X can be present 1 or more times
+    { X | Y } - X or Y
+    [ X ]     - X is optional
+-
+
+At the topmost level, the template defines 1 or more template blocks. Blocks
+can be either HDU (Header Data Unit) or a GROUP. For each block the parser
+creates 1 (or more for GROUPs) FITS file HDUs.
+
+
+**E   Errors
+
+In general the fits\_execute\_template() function tries to be as atomic
+as possible, so either everything is done or nothing is done. If an
+error occurs during parsing of the template, fits\_execute\_template()
+will (try to) delete the top level BLOCK (with all its children if any)
+in which the error occurred, then it will stop reading the template file
+and it will return with an error.
+
+**F   Examples
+
+1. This template file will create a 200 x 300 pixel image, with 4-byte
+integer pixel values, in the primary HDU:
+-
+  SIMPLE = T 
+  BITPIX = 32
+  NAXIS = 2     / number of dimensions
+  NAXIS1 = 100  / length of first axis
+  NAXIS2 = 200  / length of second axis
+  OBJECT = NGC 253 / name of observed object
+-
+The allowed values of BITPIX are 8, 16, 32, -32, or -64,
+representing, respectively, 8-bit integer, 16-bit integer, 32-bit
+integer, 32-bit floating point, or 64 bit floating point pixels.
+
+2.  To create a FITS  table, the template first needs to include
+XTENSION = TABLE or BINTABLE to define whether it is an ASCII or binary
+table, and NAXIS2 to define the number of rows in the table.  Two
+template lines are then needed to define the name (TTYPEn) and FITS data
+format (TFORMn) of the columns, as in this example:
+-
+  xtension = bintable
+  naxis2 = 40
+  ttype# = Name
+  tform# = 10a
+  ttype# = Npoints
+  tform# = j
+  ttype# = Rate
+  tunit# = counts/s
+  tform# = e
+-
+The above example defines a null primary array followed by a 40-row
+binary table extension with 3 columns called 'Name', 'Npoints', and
+'Rate', with data formats of '10A' (ASCII character string), '1J'
+(integer) and '1E' (floating point), respectively.  Note that the other
+required FITS keywords (BITPIX, NAXIS, NAXIS1, PCOUNT, GCOUNT, TFIELDS,
+and END) do not need to be explicitly defined in the template because
+their values can be inferred from the other keywords in the template.
+This example also illustrates that the templates are generally
+case-insensitive (the keyword names and TFORMn values are converted to
+upper-case in the FITS file) and that string keyword values generally
+do not need to be enclosed in quotes.
+
 *V.  FITSIO Conventions and Guidelines
 
 **A.  CFITSIO Size Limitations
@@ -2051,21 +2327,25 @@ CFITSIO places few restrictions on the size of FITS files that it
 reads or writes.  There are a few limits, however, which may affect
 some extreme cases:
 
-1.  The maximum number of files that may be simultaneously opened is
-limited to the number of internal IO buffers allocated in CFITSIO
-(currently 25, as defined by NIOBUF in the file fitsio2.h), or by the
-limit of the underlying C compiler or machine operating system, which
-ever is smaller.  The C symbolic constant FOPEN\_MAX usually defines
-the total number of files that may open at once (this includes any
-other text or binary files which may be open, not just FITS files).
-
-2.  The maximum number of extensions (HDUs) that can be read or written
-in a single FITS file is currently set to 1000 as defined by MAXHDU in
-the fitsio.h file.  This value may be increased if necessary, but the
-access times to the later extensions in such files may become excessively
-long.
-
-3.  By default, CFITSIO can handle FITS files up to 2.1 GB in size
+1.  The maximum number of FITS files that may be simultaneously opened
+by CFITSIO is set by NMAXFILES as defined in fitsio2.h.  It is currently
+set = 300 by default.  CFITSIO will allocate about 80 * NMAXFILES bytes
+of memory for internal use.  Note that the underlying C compiler or
+operating system, may have a smaller limit on the number of opened files.
+The C symbolic constant FOPEN\_MAX is intended to define the maximum
+number of files that may open at once (including any other text or
+binary files that may be open, not just FITS files).  On some systems it
+has been found that gcc supports a maximum of 255 opened files.
+
+Note that opening and operating on many FITS files simultaneously in
+parallel may be less efficient than operating on smaller groups of files
+in series.  CFITSIO only has NIOBUF number of internal buffers (set = 40
+by default) that are used for temporary storage of the most recent data
+records that have been read or written in the FITS files.  If the number
+of opened files is greater than NIOBUF, then CFITSIO may waste more time
+flushing and re-reading or re-writing the same records in the FITS files.
+
+2.  By default, CFITSIO can handle FITS files up to 2.1 GB in size
 (2**31 bytes).  This file size limit is often imposed by 32-bit
 operating systems.  More recently, as 64-bit operating systems become
 more common, an industry-wide standard (at least on Unix systems) has
@@ -2192,16 +2472,22 @@ is the real part, and the second is the imaginary part.
 
 **F.  Implicit Data Type Conversion
 
-Many of the data I/O subroutines have the ability to perform implicit
-data type conversion. This means that the data type of the subroutine
-parameter does not need to be the same as the data type of the value in
-the FITS file. More specifically, the implicit data type conversion will
-be performed for numerical data types when reading a FITS header keyword
-value and when reading or writing values to or from the primary array or
-a table column. FITSIO returns status = 412 if the converted data value
-exceeds the range of the output data type. Data type conversion is not
-allowed when reading or writing string (s), logical (l), complex (c), or
-double complex (m) data types.
+The FITSIO routines that read and write numerical data can perform
+implicit data type conversion.  This means that the data type of the
+variable or array in the program does not need to be the same as the
+data type of the value in the FITS file.  Data type conversion is
+supported for numerical and string data types (if the string contains a
+valid number enclosed in quotes) when reading a FITS header keyword
+value and for numeric values when reading or writing values in the
+primary array or a table column.  CFITSIO returns status =
+NUM\_OVERFLOW  if the converted data value exceeds the range of the
+output data type.  Implicit data type conversion is not supported
+within binary tables for string, logical, complex, or double complex
+data types.
+
+In addition, any table column may be read as if it contained string values.
+In the case of numeric columns the returned string will be formatted
+using the TDISPn display format if it exists.
 
 **G.  Data Scaling
 
@@ -2305,7 +2591,7 @@ get overwritten.
 By default the heap data area starts immediately after the last row of
 the fixed-length table.  This default starting location may be
 overridden by the THEAP keyword, but this is not recommended.  
-If addtional rows of data are added to the table, CFITSIO will
+If additional rows of data are added to the table, CFITSIO will
 automatically shift the the heap down to make room for the new
 rows, but it is obviously be more efficient to initially
 create the table with the necessary number of blank rows, so that
@@ -2393,7 +2679,7 @@ when the table is created, then let CFITSIO keep track of the number of
 rows that are actually written.  The application program should not
 manually update the number of rows in the table (as given by the NAXIS2
 keyword) since CFITSIO does this automatically.  If a table is
-initially created with more than zero rows, then this will ususally be
+initially created with more than zero rows, then this will usually be
 considered as the minimum size of the table, even if fewer rows are
 actually written to the table.  Thus, if a table is initially created
 with NAXIS2 = 20, and CFITSIO only writes 10 rows of data before
@@ -2619,7 +2905,7 @@ buffers in memory.  The next time CFITSIO needs to access bytes in the
 same block it can then go to the fast IO buffer rather than using a
 much slower system disk access routine.  The number of available IO
 buffers is determined by the NIOBUF parameter (in fitsio2.h) and is
-currently set to 25.
+currently set to 40.
 
 Whenever CFITSIO reads or writes data it first checks to see if that
 block of the FITS file is already loaded into one of the IO buffers.
@@ -2699,7 +2985,7 @@ routine is available that will return the optimal number of rows for a
 given table:  call ftgrsz(unit, nrows, status).  It is not critical to
 use exactly the value of nrows returned by this routine, as long as one
 does not exceed it.  Using a very small value however can also lead to
-poor preformance because of the overhead from the larger number of
+poor performance because of the overhead from the larger number of
 subroutine calls.
 
 The optimal number of rows returned by ftgrsz is valid only as long as
@@ -2711,7 +2997,7 @@ and should be avoided during the critical period while the table is
 being read or written.
 
 Occasionally it is necessary to simultaneously access more than one
-FITS table, for example when transfering values from an input table to
+FITS table, for example when transferring values from an input table to
 an output table.  In cases like this, one should call ftgrsz to get the
 optimal number of rows for each table separately, than reduce the
 number of rows proportionally.  For example, if the optimal number of
@@ -2801,7 +3087,7 @@ controller (SCSI or IDE), the size of the disk cache, the average seek
 speed of the disk, the amount of disk fragmentation, and the amount of
 RAM available on the system can all have a significant impact on
 overall I/O efficiency.  For critical applications, a system
-adminstrator should review the proposed system hardware to identify any
+administrator should review the proposed system hardware to identify any
 potential I/O bottlenecks.
 
 
@@ -2914,26 +3200,31 @@ used by these interface routines.
 -
         FTGMSG( > errmsg)
 -
->4  Print out the error message corresponding to the input status
+>4 The FTPMRK routine puts an invisible marker on the 
+   CFITSIO error stack.  The FTCMRK routine can then be
+   used to delete any more recent error messages on the stack, back to
+   the position of the marker.  This preserves any older error messages
+   on the stack.  FTCMSG simply clears the entire error message stack.
+>  These routines are called without any arguments.
+-
+        FTPMRK
+        FTCMRK
+        FTCMSG
+-
+
+>5  Print out the error message corresponding to the input status
     value and all the error messages on the FITSIO stack  to the specified
     file stream  (stream can be either the string 'STDOUT' or 'STDERR').
 >   If the input status value = 0 then this routine does nothing.
 -
        FTRPRT (stream, > status)
 -
->5  Write an 80-character message to the FITSIO error stack.  Application
+>6  Write an 80-character message to the FITSIO error stack.  Application
     programs should not normally write to the stack, but there may be
 >   some situations where this is desirable.
 -
         FTPMSG(errmsg)
 -
->6   Clear the entire error message stack.  This routine is useful
-     to clear any error message that may have been generated by
-     a non-fatal FITSIO error (such as failing to find an optional
->    header keyword).  This routine is called without any arguments.
--
-        FTCMSG
--
 
 **B.  File I/O Routines
 
@@ -2941,7 +3232,11 @@ used by these interface routines.
    This routine always opens the primary array (the first HDU) of 
    the file, and does not move to a following extension, if one was
    specified as part of the filename.   Use the FTNOPN routine to
->  automatically move to the extension.
+   automatically move to the extension.  This routine will also
+   open IRAF images (.imh format files) and raw binary data arrays
+   with READONLY access by first converting them on the fly into
+   virtual FITS images.  See the `Extended File Name Syntax' chapter
+>  for more details.
 -
         FTOPEN(unit,filename,rwmode, > blocksize,status)
 -
@@ -2954,30 +3249,51 @@ used by these interface routines.
 -
         FTNOPN(unit,filename,rwmode, > status)
 -
->3 Open and initialize a new empty FITS file.   A template file may also be
->   specified to define the structure of the new file (see secion 4.2.4).
+>3 Open an existing FITS file with readonly or readwrite access
+   and then move to the first HDU containing significant data, if a) an HDU
+   name or number to open was not explicitly specified as part of the
+   filename, and b) if the FITS file contains a null primary array (i.e.,
+   NAXIS = 0).  In this case, it will look for the first IMAGE HDU with
+   NAXIS > 0, or the first table that does not contain the strings `GTI'
+   (Good Time Interval) or `OBSTABLE' in the EXTNAME keyword value.  FTTOPN
+   is similar, except it will move to the first significant table HDU
+   (skipping over any image HDUs) in the file if a specific HDU name
+   or number is not specified.  FTIOPN will move to the first non-null
+>  image HDU, skipping over any tables.
+-
+        FTDOPN(unit,filename,rwmode, > status)
+        FTTOPN(unit,filename,rwmode, > status)
+        FTIOPN(unit,filename,rwmode, > status)
+-
+>4 Open and initialize a new empty FITS file.   A template file may also be
+>   specified to define the structure of the new file (see section 4.2.4).
 -
         FTINIT(unit,filename,blocksize, > status)
 -
->>4 Close a FITS file previously opened with ftopen or ftinit
+>>5 Close a FITS file previously opened with ftopen or ftinit
 -
         FTCLOS(unit, > status)
 -
->5  Move to a specified (absolute) HDU in the FITS file (nhdu = 1 for the
+>6  Move to a specified (absolute) HDU in the FITS file (nhdu = 1 for the
 >   FITS primary array)
 -
         FTMAHD(unit,nhdu, > hdutype,status)
 -
->6  Create a primary array (if none already exists), or insert a 
-    new IMAGE extension immediately following the CHDU.
-    Any following extensions will be shifted down to make room for
-    the new extension.  If there are no other following extensions
-    then the new image extension will simply be appended to the
->   end of the file.  The new extension will become the CHDU.
+>7  Create a primary array (if none already exists), or insert a 
+    new IMAGE extension immediately following the CHDU, or
+    insert a new Primary Array at the beginning of the file.  Any
+    following extensions in the file will be shifted down to make room
+    for the new extension.  If the CHDU is the last HDU in the file
+    then the new image extension will simply be appended to the end of
+    the file.   One can force a new primary array to be inserted at the
+    beginning of the FITS file by setting status = -9 prior
+    to calling the routine.  In this case the old primary array will be
+    converted to an IMAGE extension. The new extension (or primary
+>   array) will become the CHDU.
 -
         FTIIMG(unit,bitpix,naxis,naxes, > status) 
 -
->7  Insert a new ASCII TABLE extension immediately following the CHDU.
+>8  Insert a new ASCII TABLE extension immediately following the CHDU.
     Any following extensions will be shifted down to make room for
     the new extension.  If there are no other following extensions
     then the new table extension will simply be appended to the
@@ -2986,7 +3302,7 @@ used by these interface routines.
         FTITAB(unit,rowlen,nrows,tfields,ttype,tbcol,tform,tunit,extname, >
                status)
 -
->8  Insert a new binary table extension immediately following the CHDU.
+>9  Insert a new binary table extension immediately following the CHDU.
     Any following extensions will be shifted down to make room for
     the new extension.  If there are no other following extensions
     then the new bintable extension will simply be appended to the
@@ -3104,16 +3420,22 @@ previous chapter are also repeated here. A right arrow symbol is used
 here to separate the input parameters from the output parameters in the
 definition of each subroutine. This symbol is not actually part of the
 calling sequence. An alphabetical list and definition of all the
-parameters is given at the end of this section. The SPP interface
-subroutines have the same arguments but have names that begin with 'fs'
-rather than 'ft'. 
+parameters is given at the end of this section. 
 
 **A.  FITS File Open and Close Subroutines: \label{FTOPEN}
 
->>1 Open an existing FITS file with readonly or readwrite access
+>1 Open an existing FITS file with readonly or readwrite access. FTDOPN
+also moves to the first HDU containing significant data, if no specific
+HDU is specified as part of the filename.  FTTOPN and FTIOPN are similar
+except that they will move to the first table HDU or image HDU, respectively,
+>if a HDU name or number is not specified as part of the filename.
 -
         FTOPEN(unit,filename,rwmode, > blocksize,status)
+        FTDOPN(unit,filename,rwmode, > status)
+        FTTOPN(unit,filename,rwmode, > status)
+        FTIOPN(unit,filename,rwmode, > status)
 -
+
 >2 Open an existing FITS file with readonly or readwrite access
    and move to a following extension, if one was specified as
    part of the filename.  (e.g.,  'filename.fits+2' or
@@ -3234,12 +3556,26 @@ strings will be returned for any components that are not present
 >16 Parse the input file name and return the root file name.  The root
 name includes the file type if specified, (e.g.  'ftp://' or 'http://')
 and the full path name, to the extent that it is specified in the input
-filename.  It does not enclude the HDU name or number, or any filtering
+filename.  It does not include the HDU name or number, or any filtering
 >specifications.
 -
        FTRTNM(filename, > rootname, status)
 -
 
+>16 Test if the input file or a compressed version of the file (with
+a .gz, .Z, .z, or .zip extension) exists on disk.  The returned value of 
+the 'exists' parameter will have 1 of the 4 following values:
+-
+   2:  the file does not exist, but a compressed version does exist
+   1:  the disk file does exist
+   0:  neither the file nor a compressed version of the file exist
+  -1:  the input file name is not a disk file (could be a ftp, http,
+       smem, or mem file, or a file piped in on the STDIN stream)
+-
+> 
+-
+      FTEXIST(filename, > exists, status);
+-
 **B.  HDU-Level Operations \label{FTMAHD}
 
 When a FITS file is first opened or created, the internal buffers in
@@ -3351,7 +3687,21 @@ and so on.
 -
         FTDHDU(unit, > hdutype,status)
 -
->13 Copy the entire CHDU from the FITS file associated with IUNIT to the CHDU 
+>13  Copy all or part of the input FITS file and append it
+    to the end of the output FITS file.  If 'previous' is
+    true (not 0), then any HDUs preceding the current HDU in the input file
+    will be copied to the output file.  Similarly, 'current' and 'following'
+    determine whether the current HDU, and/or any following HDUs in the
+    input file will be copied to the output file. If all 3 parameters are
+    true, then the entire input file will be copied.  On return, the current
+    HDU in the input file will be unchanged, and the last HDU will be the 
+>   current HDU in the output file.     
+-
+  int fits_copy_file / ffcpfl
+      (fitsfile *infptr, fitsfile *outfptr, int previous, int current,
+          int following, > int *status)
+-
+>14 Copy the entire CHDU from the FITS file associated with IUNIT to the CHDU 
     of the FITS file associated with OUNIT. The output HDU must be empty and
     not already contain any keywords.  Space will be reserved for MOREKEYS
     additional  keywords in the output header if there is not already enough 
@@ -3359,7 +3709,7 @@ and so on.
 -
         FTCOPY(iunit,ounit,morekeys, > status)
 -
->14 Copy the header (and not the data) from the CHDU associated with inunit
+>15 Copy the header (and not the data) from the CHDU associated with inunit
     to the CHDU associated with outunit.  If the current output HDU
     is not completely empty, then the CHDU will be closed and a new
     HDU will be appended to the output file.  This routine will automatically
@@ -3369,7 +3719,7 @@ and so on.
 -
         FTCPHD(inunit, outunit, > status)
 -
->15 Copy just the data from the CHDU associated with IUNIT 
+>16 Copy just the data from the CHDU associated with IUNIT 
     to the CHDU associated with OUNIT. This will overwrite 
     any data previously in the OUNIT CHDU.  This low level routine is used
     by FTCOPY, but it may also be useful in certain application programs
@@ -3553,12 +3903,12 @@ TUNITn and EXTNAME keywords are written only if the input string
         FTPREC(unit,card, > status)
 -
 >2  Put (append) a COMMENT keyword into the CHU.  Multiple COMMENT keywords
->   will be written if the input comment string is longer than 70 characters. 
+>   will be written if the input comment string is longer than 72 characters. 
 -
         FTPCOM(unit,comment, > status)
 -
 >3 Put (append) a HISTORY keyword into the CHU.  Multiple HISTORY keywords
->   will be written if the input history string is longer than 70 characters.
+>   will be written if the input history string is longer than 72 characters.
 -
         FTPHIS(unit,history, > status)
 -
@@ -3671,6 +4021,7 @@ TUNITn and EXTNAME keywords are written only if the input string
     the 'append keyword' subroutines described above because the remaining
 >   keywords in the header have to be shifted down one slot.
 -
+        FTIKEY(unit, card, > status)
         FTIKY[JLS](unit,keyword,keyval,comment, > status)
         FTIKLS(unit,keyword,keyval,comment, > status)
         FTIKY[EDFG](unit,keyword,keyval,decimals,comment, > status)  
@@ -3953,9 +4304,24 @@ been provided, as well as a set of subroutines to read or write any
 contiguous rectangular subset of pixels within the n-dimensional array.
 
 >1  Get the data type of the image (= BITPIX value).  Possible returned 
->   values are: 8, 16, 32, -32, or -64. 
+    values are: 8, 16, 32, -32, or -64 corresponding to unsigned byte,
+    signed 2-byte integer, signed 4-byte integer, real, and double.
+
+    The second subroutine is similar to FTGIDT, except that if the image
+    pixel values are scaled, with non-default values for the BZERO and
+    BSCALE keywords, then this routine will return the 'equivalent'
+    data type that is needed to store the scaled values.  For example,
+    if BITPIX = 16 and BSCALE = 0.1 then the equivalent data type is
+    floating point, and -32 will be returned.  There are 2 special cases:
+    if the image contains unsigned 2-byte integer values, with BITPIX =
+    16, BSCALE = 1, and BZERO = 32768, then this routine will return
+    a non-standard value of 20 for the bitpix value.  Similarly if the
+    image contains unsigned 4-byte integers, then bitpix will
+>   be returned with a value of 40. 
+
 -
         FTGIDT(unit, > bitpix,status)
+        FTGIET(unit, > bitpix,status)
 -
 >>2  Get the dimension (number of axes = NAXIS) of the image 
 -
@@ -4151,9 +4517,22 @@ It is recommended that the column names in a given table be unique
     TFORM = 'rAw' where 'r' is the total number of characters (= the width 
     of the column) and 'w' is the width of a unit string within the column.  
     Thus if the column has TFORM = '60A12' then this routine will return 
->   datacode = 16, repeat = 60, and width = 12.
+    datacode = 16, repeat = 60, and width = 12.
+
+   The second routine, FTEQTY is similar except that in
+   the case of scaled integer columns it returns the 'equivalent' data
+   type that is needed to store the scaled values, and not necessarily
+   the physical data type of the unscaled values as stored in the FITS
+   table.  For example if a '1I' column in a binary table has TSCALn =
+   1 and TZEROn = 32768, then this column effectively contains unsigned
+   short integer values, and thus the returned value of typecode will
+   be the code for an unsigned short integer, not a signed short integer.
+   Similarly, if a column has TTYPEn = '1I'
+   and TSCALn = 0.12, then the returned typecode
+>  will be the code for a 'real' column.
 -
         FTGTCL(unit,colnum, > datacode,repeat,width,status)
+        FTEQTY(unit,colnum, > datacode,repeat,width,status)
 -
 >4  Return the display width of a column.  This is the length
     of the string that will be returned  
@@ -4279,11 +4658,14 @@ do not use ASCII character codes in the internal data representations
         FTDROW(unit,frow,nrows, > status)
 -
 >3  Delete a list of rows from an ASCII or binary table (in the CDU).
-    rowlist is an array of row numbers to be deleted from the table.
-    (The first row in the table is 1 not 0).  The list of
-    row numbers must be sorted in ascending order.  nrows is the
->   number of row numbers in the list.
--
+    In the first routine, 'rowrange' is a character string listing the
+    rows or row ranges to delete (e.g., '2-4, 5, 8-9'). In the second
+    routine, 'rowlist' is an integer array of row numbers to be deleted
+    from the table.  nrows is the number of row numbers in the list.
+    The first row in the table is 1 not 0.  The list of row numbers
+>   must be sorted in ascending order.
+-
+        FTDRRG(unit,rowrange, > status)
         FTDRWS(unit,rowlist,nrows, > status)
 -
 >4  Insert a blank column (or columns) into an existing ASCII or binary 
@@ -4520,7 +4902,13 @@ FITS table, based on whether the expression evaluates to true (not
 equal to zero) or false (zero).  The other routines evaluate the
 expression and calculate a value for each row of the table.  The
 allowed expression syntax is described in the row filter section in the
-earlier `Extended File Name Syntax' chapter of this document.
+earlier `Extended File Name Syntax' chapter of this document.  The
+expression may also be written to a text file, and the name of the
+file, prepended with a '@' character may be supplied for the 'expr'
+parameter (e.g.  '@filename.txt'). The  expression  in  the  file can
+be arbitrarily complex and extend over multiple lines of the file.
+Lines  that begin with 2 slash characters ('//') will  be ignored and
+may be used to add comments to the file.
 
 >1  Evaluate a boolean expression over the indicated rows, returning an     
 > array of flags indicating which rows evaluated to TRUE/FALSE 
@@ -4555,11 +4943,11 @@ parName parameter is the name of the column (which may or may not already
 exist) into which to write the results, and parInfo contains an
 optional TFORM keyword value if a new column is being created.  If a
 TFORM value is not specified then a default format will be used,
-depending on the expression.  If the expression evalutes to a constant,
+depending on the expression.  If the expression evaluates to a constant,
 then the result will be written to the keyword name given by the
 parName parameter, and the parInfo parameter may be used to supply an
 optional comment for the keyword.  If the keyword does not already
-exist, then the name of the keyword must be preceeded with a '\#' character,
+exist, then the name of the keyword must be preceded with a '\#' character,
 >otherwise the result will be written to a column with that name.
         
 -
@@ -4581,13 +4969,45 @@ row ranges.  nranges specifies the number of row ranges, and firstrow
 
 **J.  Celestial Coordinate System Subroutines \label{FTGICS}
 
-The following subroutines are provided to help calculate the
-transformation between pixel location in an image and the corresponding
-celestial coordinates on the sky.  These support the following standard
-map projections:  -SIN, -TAN, -ARC, -NCP, -GLS, -MER, and -AIT (these
-are the legal values for the coordtype parameter).  These routines are
-based on similar functions in Classic AIPS.  All the angular quantities
-are given in units of degrees.  
+The FITS community has adopted a set of keyword conventions that define
+the transformations needed to convert between pixel locations in an
+image and the corresponding celestial coordinates on the sky, or more
+generally, that define world coordinates that are to be associated with
+any pixel location in an n-dimensional FITS array. CFITSIO is distributed
+with a couple of self-contained World Coordinate System (WCS) routines,
+however, these routines DO NOT support all the latest WCS conventions,
+so it is STRONGLY RECOMMENDED that software developers use a more robust
+external WCS library.  Several recommended libraries are:
+-
+  WCSLIB -  supported by Mark Calabretta
+  WCSTools - supported by Doug Mink
+  AST library - developed by the U.K. Starlink project
+-
+
+More information about the WCS keyword conventions and links to all of
+these WCS libraries can be found on the FITS Support Office web site at
+http://fits.gsfc.nasa.gov under the WCS link.
+
+The functions provided in these external WCS libraries will need access to
+the  WCS information contained in the FITS file headers.  One convenient
+way to pass this information to the extermal library is to use  FITSIO
+to copy the header keywords into one long character string, and then
+pass this string to an interface routine in the external library that
+will extract the necessary WCS information (e.g., see the astFitsChan
+and astPutCards routines in the Starlink AST library).
+
+The following FITSIO routines DO NOT support the more recent WCS conventions
+that have been approved as part of the FITS standard.  Consequently,
+the following routines ARE NOW DEPRECATED.  It is STRONGLY RECOMMENDED
+that software developers not use these routines, and instead use an
+external WCS library, as described above.
+
+These routines are included mainly for backward compatibility with
+existing software.  They support the following standard map 
+projections: -SIN, -TAN, -ARC, -NCP, -GLS, -MER, and -AIT (these are the
+legal values for the coordtype parameter).  These routines are based
+on similar functions in Classic AIPS.  All the angular quantities are
+given in units of degrees.
 
 >1  Get the values of all the standard FITS celestial coordinate system
     keywords from the header of a FITS image (i.e., the primary array or
@@ -4849,7 +5269,7 @@ The following utility subroutines may be useful for certain applications:
         FTDTYP(value, > dtype,status)
 -
 >11 Return the class of input header record.  The record is classified
-    into one of the following catagories (the class values are
+    into one of the following categories (the class values are
     defined in fitsio.h).  Note that this is one of the few FITSIO
 >   routines that does not return a status value. 
 -
@@ -5020,6 +5440,22 @@ The following utility subroutines may be useful for certain applications:
       # the following template line modifies the NAME keyword to OBJECT
       - NAME OBJECT
 -                
+>16  Parse the input string containing a list of rows or row ranges, and
+     return integer arrays containing the first and last row in each
+     range.  For example, if rowlist = "3-5, 6, 8-9" then it will
+     return numranges = 3, rangemin = 3, 6, 8 and rangemax = 5, 6, 9.
+     At most, 'maxranges' number of ranges will be returned.  'maxrows'
+     is the maximum number of rows in the table; any rows or ranges
+     larger than this will be ignored.  The rows must be specified in
+     increasing order, and the ranges must not overlap. A minus sign
+     may be use to specify all the rows to the upper or lower bound, so
+     "50-" means all the rows from 50 to the end of the table, and "-"
+>    means all the rows in the table, from 1 - maxrows.
+-
+    FTRWRG(rowlist, maxrows, maxranges, >  
+           numranges, rangemin, rangemax, status)
+-
+
 
 *IX    Summary of all FITSIO User-Interface Subroutines 
 
@@ -5030,12 +5466,17 @@ The following utility subroutines may be useful for certain applications:
         FTGMSG( > errmsg)
         FTRPRT (stream, > status)
         FTPMSG(errmsg)
+        FTPMRK
         FTCMSG
+        FTCMRK
 -
  FITS File Open and Close Subroutines: page~\pageref{FTOPEN}
 -
         FTOPEN(unit,filename,rwmode, > blocksize,status)
         FTNOPN(unit,filename,rwmode, > status)
+        FTDOPN(unit,filename,rwmode, > status)
+        FTTOPN(unit,filename,rwmode, > status)
+        FTIOPN(unit,filename,rwmode, > status)
         FTREOPEN(unit, > newunit, status)
         FTINIT(unit,filename,blocksize, > status)
         FTTPLT(unit, filename, tplfilename, > status)
@@ -5051,6 +5492,7 @@ The following utility subroutines may be useful for certain applications:
         FTIURL(filename, > filetype, infile, outfile, extspec, filter, 
                binspec, colspec, status)
         FTRTNM(filename, > rootname, status)
+        FTEXIST(filename, > exist, status)
 -
  HDU-Level Operations: page~\pageref{FTMAHD}
 -
@@ -5067,6 +5509,7 @@ The following utility subroutines may be useful for certain applications:
         FTIBIN(unit,nrows,tfields,ttype,tform,tunit,extname,varidat > status)
         FTRSIM(unit,bitpix,naxis,naxes,status)
         FTDHDU(unit, > hdutype,status)
+        FTCPFL(iunit,ounit,previous, current, following, > status)
         FTCOPY(iunit,ounit,morekeys, > status)
         FTCPHD(inunit, outunit, > status)
         FTCPDT(iunit,ounit, > status)
@@ -5174,6 +5617,7 @@ The following utility subroutines may be useful for certain applications:
  FITS Primary Array or IMAGE Extension I/O Subroutines: page~\pageref{FTPPR}
 -
         FTGIDT(unit, > bitpix,status)
+        FTGIET(unit, > bitpix,status)
         FTGIDM(unit, > naxis,status)
         FTGISZ(unit, maxdim, > naxes,status)
         FTGIPR(unit, maxdim, > bitpix,naxis,naxes,status)
@@ -5202,6 +5646,7 @@ The following utility subroutines may be useful for certain applications:
         FTGCNO(unit,casesen,coltemplate, > colnum,status)
         FTGCNN(unit,casesen,coltemplate, > colnam,colnum,status)
         FTGTCL(unit,colnum, > datacode,repeat,width,status)
+        FTEQTY(unit,colnum, > datacode,repeat,width,status)
         FTGCDW(unit,colnum, > dispwidth,status)
         FTGACL(unit,colnum, >
                ttype,tbcol,tunit,tform,tscal,tzero,snull,tdisp,status)
@@ -5223,6 +5668,7 @@ The following utility subroutines may be useful for certain applications:
 -
         FTIROW(unit,frow,nrows, > status)
         FTDROW(unit,frow,nrows, > status)
+        FTDRRG(unit,rowrange, > status)
         FTDRWS(unit,rowlist,nrows, > status)
         FTICOL(unit,colnum,ttype,tform, > status)
         FTICLS(unit,colnum,ncols,ttype,tform, > status)
@@ -5310,6 +5756,8 @@ The following utility subroutines may be useful for certain applications:
         FTBNFM(tform, > datacode,repeat,width,status)
         FTGABC(tfields,tform,space, > rowlen,tbcol,status)
         FTGTHD(template, > card,hdtype,status)
+        FTRWRG(rowlist, maxrows, maxranges, > numranges, rangemin, 
+               rangemax, status)
 -
 
 *X.   Parameter Definitions
@@ -5362,6 +5810,7 @@ errtext - (character*30) descriptive error message corresponding to error number
 casesen - (logical) true if column name matching is case sensitive
 exact - (logical) do the strings match exactly, or were wildcards used?
 exclist  (character array) list of names to be excluded from search
+exists   - flag indicating whether the file or compressed file exists on disk
 extend - (logical) true if there may be extensions following the primary data
 extname - (character) value of the EXTNAME keyword (if not blank)
 fbit - (integer) first bit in the field to be read or written
@@ -5378,7 +5827,7 @@ hdtype - (integer) header record type: -1=delete;  0=append or replace;
                    1=append; 2=this is the END keyword
 hduok - (integer) was the HDU verification successful (=1) or 
          not (= -1).  Equals zero if the CHECKSUM keyword is not present.      
-hdusum - (double precsion) 32 bit 1's complement checksum for the entire CHDU
+hdusum - (double precision) 32 bit 1's complement checksum for the entire CHDU
 hdutype - (integer) type of HDU: 0 = primary array or IMAGE, 1 = ASCII table,
                    2 = binary table, -1 = unknown
 history - (character) the HISTORY keyword comment string
@@ -5433,8 +5882,9 @@ rot - (double precision) celestial coordinate rotation angle (degrees)
 rowlen - (integer) length of a table row, in characters or bytes
 rowlist - (integer array) list of row numbers to be deleted in increasing order
 rownum - (integer) number of the row (first row = 1)
+rowrange- (string) list of rows or row ranges to be deleted
 rwmode - (integer) file access mode: 0 = readonly, 1 = readwrite 
-second   (double)- second within minute (0 - 60.9999999999) (leapsecond!)
+second   (double)- second within minute (0 - 60.9999999999) (leap second!)
 seq_no - (integer) the sequence number to append to the keyword root name
 simple - (logical) does the FITS file conform to all the FITS standards
 snull - (character) value used to represent undefined values in ASCII table
@@ -5513,6 +5963,7 @@ FITSIO use.
 123  driver initialization failed 
 124  matching driver is not registered 
 125  failed to parse input file URL
+126  parse error in range list
 
 151  bad argument in shared memory driver
 152  null pointer passed as an argument
@@ -5597,6 +6048,8 @@ FITSIO use.
 346 HDU_ALREADY_TRACKED   
 347 BAD_OPTION            
 348 IDENTICAL_POINTERS    
+349 BAD_GROUP_ATTACH
+350 BAD_GROUP_DETACH
 
 360 NGP_NO_MEMORY              malloc failed
 361 NGP_READ_ERR               read error from file
diff --git a/fitsio.h b/fitsio.h
index 2bd8908..83f0b4f 100644
--- a/fitsio.h
+++ b/fitsio.h
@@ -1,3 +1,5 @@
+/*  Version Info: This file is distributed with version 2.500 of CFITSIO   */
+
 /*  The FITSIO software was written by William Pence at the High Energy    */
 /*  Astrophysic Science Archive Research Center (HEASARC) at the NASA      */
 /*  Goddard Space Flight Center.                                           */
@@ -33,10 +35,46 @@ SERVICES PROVIDED HEREUNDER."
 
 #ifndef _FITSIO_H
 #define _FITSIO_H
- 
+
 #include <stdio.h>
-/* stddef.h is apparently needed to define size_t */
-#include <stddef.h>
+
+#if defined(linux) || defined(__APPLE__)
+#  include <sys/types.h>  /* apparently needed on debian linux systems */
+#endif                    /* to define off_t                           */
+
+#include <stdlib.h>  /* apparently needed to define size_t with gcc 2.8.1 */
+#include <limits.h>  /* needed for LLONG_MAX and INT64_MAX definitions */
+
+/* Define the datatype for variables which store file offset values. */
+/* The new 'off_t' datatype should be used for this purpose, but some */
+/* older compilers do not recognize this type, in which case we use 'long' */
+/* instead.  Note that _OFF_T is defined (or not) in stdio.h depending */
+/* on whether _LARGEFILE_SOURCE is defined in sys/feature_tests.h  */
+/* (at least on Solaris platforms using cc)  */
+
+/*  Debian systems require the 2nd test, below,         */
+/*  i.e, "(defined(linux) && defined(__off_t_defined))" */
+#if defined(_OFF_T) || (defined(linux) && defined(__off_t_defined)) || defined(_MIPS_SZLONG) || defined(__APPLE__) || defined(_AIX)
+#    define OFF_T off_t
+#else
+#    define OFF_T long
+#endif
+
+/* typedef the 'LONGLONG' data type to the intrinsice 8-byte integer type */
+
+#if defined(HAVE_LONGLONG) || defined(__APPLE__)
+    typedef long long LONGLONG;
+#   ifndef HAVE_LONGLONG
+#      define HAVE_LONGLONG 1
+#   endif
+#elif defined(_MSC_VER)   /* Windows PCs; Visual C++, but not Borland C++ */
+    typedef __int64 LONGLONG;
+#   ifndef HAVE_LONGLONG
+#      define HAVE_LONGLONG 1
+#   endif
+#else
+    typedef long LONGLONG;  /* intrinsic 8-byte integer not supported */
+#endif
 
 /*  The following exclusion if __CINT__ is defined is needed for ROOT */
 #ifndef __CINT__
@@ -55,6 +93,7 @@ SERVICES PROVIDED HEREUNDER."
  
 #define TBIT          1  /* codes for FITS table data types */
 #define TBYTE        11
+#define TSBYTE       12
 #define TLOGICAL     14
 #define TSTRING      16
 #define TUSHORT      20
@@ -65,6 +104,7 @@ SERVICES PROVIDED HEREUNDER."
 #define TLONG        41
 #define TINT32BIT    41  /* used when returning datatype of a column */
 #define TFLOAT       42
+#define TLONGLONG    81
 #define TDOUBLE      82
 #define TCOMPLEX     83
 #define TDBLCOMPLEX 163
@@ -85,17 +125,6 @@ SERVICES PROVIDED HEREUNDER."
 #define TYP_CONT_KEY  140
 #define TYP_USER_KEY  150
 
-/* Define the datatype for variables which store file offset values. */
-/* The new 'off_t' datatype should be used for this purpose, but */
-/* some older compilers do not recognize this type, in which case we */
-/* use 'long' instead. */
-
-#if defined(_FILE_OFFSET_BITS) || defined(_MIPS_SZLONG)
-#    define OFF_T off_t
-#else
-#    define OFF_T long
-#endif
- 
 
 #define INT32BIT int  /* 32-bit integer datatype.  Currently this       */
                       /* datatype is an 'int' on all useful platforms   */
@@ -106,12 +135,14 @@ SERVICES PROVIDED HEREUNDER."
 #define BYTE_IMG      8  /* BITPIX code values for FITS image types */
 #define SHORT_IMG    16
 #define LONG_IMG     32
+#define LONGLONG_IMG 64
 #define FLOAT_IMG   -32
 #define DOUBLE_IMG  -64
                          /* The following 2 codes are not true FITS         */
                          /* datatypes; these codes are only used internally */
                          /* within cfitsio to make it easier for users      */
                          /* to deal with unsigned integers.                 */
+#define SBYTE_IMG    10
 #define USHORT_IMG   20
 #define ULONG_IMG    40
 
@@ -146,8 +177,6 @@ SERVICES PROVIDED HEREUNDER."
 #define CASESEN   1   /* do case-sensitive string match */
 #define CASEINSEN 0   /* do case-insensitive string match */
  
-#define MAXHDU 1000    /* maximum number of extensions allowed in a FITS file */
-
 #define GT_ID_ALL_URI  0   /* hierarchical grouping parameters */
 #define GT_ID_REF      1
 #define GT_ID_POS      2
@@ -208,7 +237,8 @@ typedef struct      /* structure used to store basic FITS file information */
     int hdutype;    /* 0 = primary array, 1 = ASCII table, 2 = binary table */
     int writemode;  /* 0 = readonly, 1 = readwrite */
     int maxhdu;     /* highest numbered HDU known to exist in the file */
-    OFF_T headstart[MAXHDU + 1]; /* byte offset in file to start of each HDU */
+    int MAXHDU;     /* dynamically allocated dimension of headstart array */
+    OFF_T *headstart; /* byte offset in file to start of each HDU */
     OFF_T headend;  /* byte offest in file to end of the current HDU header */
     OFF_T nextkey;  /* byte offset in file to beginning of next keyword */
     OFF_T datastart;/* byte offset in file to start of the current data unit */
@@ -221,6 +251,10 @@ typedef struct      /* structure used to store basic FITS file information */
     long heapsize;   /* size of the heap, in bytes */
 
          /* the following elements are related to compressed images */
+    int request_compress_type;  /* requested image compression algorithm */
+    long request_tilesize[MAX_COMPRESS_DIM]; /* requested tiling size */
+    int request_rice_nbits;     /* requested noise bit parameter value */
+
     int compressimg; /* 1 if HDU contains a compressed image, else 0 */
     char zcmptype[12];      /* compression type string */
     int compress_type;      /* type of compression algorithm */
@@ -239,6 +273,8 @@ typedef struct      /* structure used to store basic FITS file information */
 
     double zscale;          /* scaling value, if same for all tiles */
     double zzero;           /* zero pt, if same for all tiles */
+    double cn_bscale;       /* value of the BSCALE keyword in header */
+    double cn_bzero;        /* value of the BZERO keyword in header */
     int zblank;             /* value for null pixels, if not a column */
 
     int rice_blocksize;     /* first compression parameter */
@@ -277,9 +313,13 @@ typedef struct  /* structure for the iterator function column information */
 #define OutputCol        2  /* flag for output only iterator column      */
 
 /* error status codes */
- 
+
+#define SKIP_TABLE       -104 /* move to 1st image when opening file */
+#define SKIP_IMAGE       -103 /* move to 1st table when opening file */
+#define SKIP_NULL_PRIMARY -102 /* skip null primary array when opening file */
 #define USE_MEM_BUFF     -101  /* use memory buffer when opening file */
 #define OVERFLOW_ERR      -11  /* overflow during datatype conversion */
+#define PREPEND_PRIMARY    -9  /* used in ffiimg to insert new primary array */
 #define SAME_FILE         101  /* input and output files are the same */
 #define TOO_MANY_FILES    103  /* tried to open too many FITS files */
 #define FILE_NOT_OPENED   104  /* could not open the named file */
@@ -300,6 +340,7 @@ typedef struct  /* structure for the iterator function column information */
 #define DRIVER_INIT_FAILED 123  /* driver initialization failed */
 #define NO_MATCHING_DRIVER 124  /* matching driver is not registered */
 #define URL_PARSE_ERROR    125  /* failed to parse input file URL */
+#define RANGE_PARSE_ERROR  126  /* failed to parse input file URL */
 
 #define	SHARED_ERRBASE	(150)
 #define	SHARED_BADARG	(SHARED_ERRBASE + 1)
@@ -357,6 +398,7 @@ typedef struct  /* structure for the iterator function column information */
 #define BAD_TFORM         261  /* illegal TFORM format code */
 #define BAD_TFORM_DTYPE   262  /* unrecognizable TFORM datatype code */
 #define BAD_TDIM          263  /* illegal TDIMn keyword value */
+#define BAD_HEAP_PTR      264  /* invalid BINTABLE heap address */
  
 #define BAD_HDU_NUM       301  /* HDU number < 1 or > MAXHDU */
 #define BAD_COL_NUM       302  /* column number < 1 or > tfields */
@@ -384,6 +426,8 @@ typedef struct  /* structure for the iterator function column information */
 #define HDU_ALREADY_TRACKED     346
 #define BAD_OPTION              347
 #define IDENTICAL_POINTERS      348
+#define BAD_GROUP_ATTACH        349
+#define BAD_GROUP_DETACH        350
 
 #define BAD_I2C           401  /* bad int to formatted string conversion */
 #define BAD_F2C           402  /* bad float to formatted string conversion */
@@ -400,6 +444,7 @@ typedef struct  /* structure for the iterator function column information */
 
 # define DATA_COMPRESSION_ERR 413  /* error in imcompress routines */
 # define DATA_DECOMPRESSION_ERR 414 /* error in imcompress routines */
+# define NO_COMPRESSED_TILE  415 /* compressed tile doesn't exist */
 
 #define BAD_DATE          420  /* error in date or time conversion */
 
@@ -417,6 +462,9 @@ typedef struct  /* structure for the iterator function column information */
 #define NO_WCS_KEY        505  /* celestial coordinate keywords not found */
 #define APPROX_WCS_KEY    506  /* approximate WCS keywords were calculated */
 
+#define NO_CLOSE_ERROR    999  /* special value used internally to switch off */
+                               /* the error message from ffclos and ffchdu */
+
 /*------- following error codes are used in the grparser.c file -----------*/
 #define	NGP_ERRBASE		(360)			/* base chosen so not to interfere with CFITSIO */
 #define	NGP_OK			(0)
@@ -441,12 +489,12 @@ extern "C" {
 
 /*----------------  FITS file URL parsing routines -------------*/
 int fits_get_token(char **ptr, char *delimiter, char *token, int *isanumber);
+char *fits_split_names(char *list);
 int ffiurl(char *url,  char *urltype, char *infile,
                     char *outfile, char *extspec, char *rowfilter,
                     char *binspec, char *colspec, int *status);
 int ffrtnm(char *url, char *rootname, int *status);
-int ffourl(char *url, char *urltype, char *outfile, char *tmplfile,
-            int *status);
+int ffexist(const char *infile, int *exists, int *status);
 int ffexts(char *extspec, int *extnum,  char *extname, int *extvers,
           int *hdutype, char *colname, char *rowexpress, int *status);
 int ffextn(char *url, int *extension_num, int *status);
@@ -461,6 +509,8 @@ int ffbinr(char **binspec, char *colname, double *minin,
                         double *maxin, double *binsizein, char *minname,
                         char *maxname, char *binname, int *status);
 int ffimport_file( char *filename, char **contents, int *status );
+int ffrwrg( char *rowlist, long maxrows, int maxranges, int *numranges,
+      long *minrow, long *maxrow, int *status);
 
 /*----------------  FITS file I/O routines -------------*/
 int ffomem(fitsfile **fptr, const char *name, int mode, void **buffptr,
@@ -468,6 +518,9 @@ int ffomem(fitsfile **fptr, const char *name, int mode, void **buffptr,
            void *(*mem_realloc)(void *p, size_t newsize),
            int *status);
 int ffopen(fitsfile **fptr, const char *filename, int iomode, int *status);
+int ffdopn(fitsfile **fptr, const char *filename, int iomode, int *status);
+int fftopn(fitsfile **fptr, const char *filename, int iomode, int *status);
+int ffiopn(fitsfile **fptr, const char *filename, int iomode, int *status);
 int ffreopen(fitsfile *openfptr, fitsfile **newfptr, int *status); 
 int ffinit(fitsfile **fptr, const char *filename, int *status);
 int ffimem(fitsfile **fptr,  void **buffptr,
@@ -477,6 +530,7 @@ int ffimem(fitsfile **fptr,  void **buffptr,
 int fftplt(fitsfile **fptr, const char *filename, const char *tempname,
            int *status);
 int ffflus(fitsfile *fptr, int *status);
+int ffflsh(fitsfile *fptr, int clearbuf, int *status);
 int ffclos(fitsfile *fptr, int *status);
 int ffdelt(fitsfile *fptr, int *status);
 int ffflnm(fitsfile *fptr, char *filename, int *status);
@@ -487,8 +541,10 @@ float ffvers(float *version);
 void ffupch(char *string);
 void ffgerr(int status, char *errtext);
 void ffpmsg(const char *err_message);
+void ffpmrk(void);
 int  ffgmsg(char *err_message);
 void ffcmsg(void);
+void ffcmrk(void);
 void ffrprt(FILE *stream, int status);
 void ffcmps(char *templt, char *colname, int  casesen, int *match,
            int *exact);
@@ -506,6 +562,8 @@ int ffasfm(char *tform, int *datacode, long *width, int *decim, int *status);
 int ffbnfm(char *tform, int *datacode, long *repeat, long *width, int *status);
 int ffgabc(int tfields, char **tform, int space, long *rowlen, long *tbcol,
            int *status);
+int fits_get_section_range(char **ptr,long *secmin,long *secmax,long *incre,
+              int *status);
  
 /*----------------- write single keywords --------------*/
 int ffpky(fitsfile *fptr, int datatype, char *keyname, void *value,
@@ -628,7 +686,9 @@ int ffgkne(fitsfile *fptr, char *keyname, int nstart, int nmax, float *value,
 int ffgknd(fitsfile *fptr, char *keyname, int nstart, int nmax, double *value,
            int *nfound, int *status);
 int ffh2st(fitsfile *fptr, char **header, int  *status);
- 
+int ffhdr2str( fitsfile *fptr,  int exclude_comm, char **exclist,
+   int nexc, char **header, int *nkeys, int  *status);
+
 /*----------------- read required header keywords --------------*/
 int ffghpr(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis,
           long naxes[], long *pcount, long *gcount, int *extend, int *status);
@@ -696,6 +756,7 @@ int ffmkfm(fitsfile *fptr, char *keyname, double *value, int decim, char *comm,
  
 /*--------------------- insert keywords ---------------*/
 int ffirec(fitsfile *fptr, int nkey, char *card, int *status);
+int ffikey(fitsfile *fptr, char *card, int *status);
 int ffikyu(fitsfile *fptr, char *keyname, char *comm, int *status);
 int ffikys(fitsfile *fptr, char *keyname, char *value, char *comm,int *status);
 int ffikls(fitsfile *fptr, char *keyname, char *value, char *comm,int *status);
@@ -732,6 +793,7 @@ int ffghof(fitsfile *fptr, OFF_T *headstart, OFF_T *datastart, OFF_T *dataend,
 int ffgipr(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis,
            long *naxes, int *status);
 int ffgidt(fitsfile *fptr, int *imgtype, int *status);
+int ffgiet(fitsfile *fptr, int *imgtype, int *status);
 int ffgidm(fitsfile *fptr, int *naxis,  int *status);
 int ffgisz(fitsfile *fptr, int nlen, long *naxes, int *status);
 
@@ -753,6 +815,8 @@ int ffibin(fitsfile *fptr,long naxis2, int tfields, char **ttype, char **tform,
 int ffrsim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status);
 int ffdhdu(fitsfile *fptr, int *hdutype, int *status);
 int ffcopy(fitsfile *infptr, fitsfile *outfptr, int morekeys, int *status);
+int ffcpfl(fitsfile *infptr, fitsfile *outfptr, int prev, int cur, int follow,
+            int *status);
 int ffcphd(fitsfile *infptr, fitsfile *outfptr, int *status);
 int ffcpdt(fitsfile *infptr, fitsfile *outfptr, int *status);
 int ffchfl(fitsfile *fptr, int *status);
@@ -786,6 +850,8 @@ int ffgcnn(fitsfile *fptr, int casesen, char *templt, char *colname,
  
 int ffgtcl(fitsfile *fptr, int colnum, int *typecode, long *repeat,
            long *width, int *status);
+int ffeqty(fitsfile *fptr, int colnum, int *typecode, long *repeat,
+           long *width, int *status);
 int ffgncl(fitsfile *fptr, int  *ncols, int *status);
 int ffgnrw(fitsfile *fptr, long *nrows, int *status);
 int ffgacl(fitsfile *fptr, int colnum, char *ttype, long *tbcol,
@@ -810,6 +876,8 @@ int ffgpf(fitsfile *fptr, int  datatype, long firstelem, long nelem,
           void *array, char *nullarray, int  *anynul, int  *status);
 int ffgpvb(fitsfile *fptr, long group, long firstelem, long nelem, unsigned
            char nulval, unsigned char *array, int *anynul, int *status);
+int ffgpvsb(fitsfile *fptr, long group, long firstelem, long nelem, signed
+           char nulval, signed char *array, int *anynul, int *status);
 int ffgpvui(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned short nulval, unsigned short *array, int *anynul, 
            int *status);
@@ -820,6 +888,8 @@ int ffgpvuj(fitsfile *fptr, long group, long firstelem, long nelem,
            int *status);
 int ffgpvj(fitsfile *fptr, long group, long firstelem, long nelem,
            long nulval, long *array, int *anynul, int *status);
+int ffgpvjj(fitsfile *fptr, long group, long firstelem, long nelem,
+           LONGLONG nulval, LONGLONG *array, int *anynul, int *status);
 int ffgpvuk(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned int nulval, unsigned int *array, int *anynul, int *status);
 int ffgpvk(fitsfile *fptr, long group, long firstelem, long nelem,
@@ -831,6 +901,8 @@ int ffgpvd(fitsfile *fptr, long group, long firstelem, long nelem,
  
 int ffgpfb(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned char *array, char *nularray, int *anynul, int *status);
+int ffgpfsb(fitsfile *fptr, long group, long firstelem, long nelem,
+           signed char *array, char *nularray, int *anynul, int *status);
 int ffgpfui(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned short *array, char *nularray, int *anynul, int *status);
 int ffgpfi(fitsfile *fptr, long group, long firstelem, long nelem,
@@ -839,6 +911,8 @@ int ffgpfuj(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned long *array, char *nularray, int *anynul, int *status);
 int ffgpfj(fitsfile *fptr, long group, long firstelem, long nelem,
            long *array, char *nularray, int *anynul, int *status);
+int ffgpfjj(fitsfile *fptr, long group, long firstelem, long nelem,
+           LONGLONG *array, char *nularray, int *anynul, int *status);
 int ffgpfuk(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned int *array, char *nularray, int *anynul, int *status);
 int ffgpfk(fitsfile *fptr, long group, long firstelem, long nelem,
@@ -851,6 +925,9 @@ int ffgpfd(fitsfile *fptr, long group, long firstelem, long nelem,
 int ffg2db(fitsfile *fptr, long group, unsigned char nulval, long ncols,
            long naxis1, long naxis2, unsigned char *array,
            int *anynul, int *status);
+int ffg2dsb(fitsfile *fptr, long group, signed char nulval, long ncols,
+           long naxis1, long naxis2, signed char *array,
+           int *anynul, int *status);
 int ffg2dui(fitsfile *fptr, long group, unsigned short nulval, long ncols,
            long naxis1, long naxis2, unsigned short *array,
            int *anynul, int *status);
@@ -863,6 +940,9 @@ int ffg2duj(fitsfile *fptr, long group, unsigned long nulval, long ncols,
 int ffg2dj(fitsfile *fptr, long group, long nulval, long ncols,
            long naxis1, long naxis2, long *array,
            int *anynul, int *status);
+int ffg2djj(fitsfile *fptr, long group, LONGLONG nulval, long ncols,
+           long naxis1, long naxis2, LONGLONG *array,
+           int *anynul, int *status);
 int ffg2duk(fitsfile *fptr, long group, unsigned int nulval, long ncols,
            long naxis1, long naxis2, unsigned int *array,
            int *anynul, int *status);
@@ -879,6 +959,9 @@ int ffg2dd(fitsfile *fptr, long group, double nulval, long ncols,
 int ffg3db(fitsfile *fptr, long group, unsigned char nulval, long ncols,
            long nrows, long naxis1, long naxis2, long naxis3,
            unsigned char *array, int *anynul, int *status);
+int ffg3dsb(fitsfile *fptr, long group, signed char nulval, long ncols,
+           long nrows, long naxis1, long naxis2, long naxis3,
+           signed char *array, int *anynul, int *status);
 int ffg3dui(fitsfile *fptr, long group, unsigned short nulval, long ncols,
            long nrows, long naxis1, long naxis2, long naxis3,
            unsigned short *array, int *anynul, int *status);
@@ -891,6 +974,9 @@ int ffg3duj(fitsfile *fptr, long group, unsigned long nulval, long ncols,
 int ffg3dj(fitsfile *fptr, long group, long nulval, long ncols,
            long nrows, long naxis1, long naxis2, long naxis3,
            long *array, int *anynul, int *status);
+int ffg3djj(fitsfile *fptr, long group, LONGLONG nulval, long ncols,
+           long nrows, long naxis1, long naxis2, long naxis3,
+           LONGLONG *array, int *anynul, int *status);
 int ffg3duk(fitsfile *fptr, long group, unsigned int nulval, long ncols,
            long nrows, long naxis1, long naxis2, long naxis3,
            unsigned int *array, int *anynul, int *status);
@@ -907,6 +993,9 @@ int ffg3dd(fitsfile *fptr, long group, double nulval, long ncols,
 int ffgsvb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   long *trc, long *inc, unsigned char nulval, unsigned char *array,
   int *anynul, int *status);
+int ffgsvsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+  long *trc, long *inc, signed char nulval, signed char *array,
+  int *anynul, int *status);
 int ffgsvui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   long *trc, long *inc, unsigned short nulval, unsigned short *array, 
   int *anynul, int *status);
@@ -917,6 +1006,9 @@ int ffgsvuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   int *anynul, int *status);
 int ffgsvj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   long *trc, long *inc, long nulval, long *array, int *anynul, int *status);
+int ffgsvjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+  long *trc, long *inc, LONGLONG nulval, LONGLONG *array, int *anynul,
+  int *status);
 int ffgsvuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   long *trc, long *inc, unsigned int nulval, unsigned int *array,
   int *anynul, int *status);
@@ -931,6 +1023,9 @@ int ffgsvd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
 int ffgsfb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   long *trc, long *inc, unsigned char *array, char *flagval,
   int *anynul, int *status);
+int ffgsfsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+  long *trc, long *inc, signed char *array, char *flagval,
+  int *anynul, int *status);
 int ffgsfui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   long *trc, long *inc, unsigned short *array, char *flagval, int *anynul, 
   int *status);
@@ -941,6 +1036,9 @@ int ffgsfuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   int *status);
 int ffgsfj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   long  *trc, long *inc, long *array, char *flagval, int *anynul, int *status);
+int ffgsfjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+  long  *trc, long *inc, LONGLONG *array, char *flagval, int *anynul,
+  int *status);
 int ffgsfuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
   long  *trc, long *inc, unsigned int *array, char *flagval, int *anynul,
   int *status);
@@ -954,6 +1052,8 @@ int ffgsfd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
  
 int ffggpb(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned char *array, int *status);
+int ffggpsb(fitsfile *fptr, long group, long firstelem, long nelem,
+           signed char *array, int *status);
 int ffggpui(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned short *array, int *status);
 int ffggpi(fitsfile *fptr, long group, long firstelem, long nelem,
@@ -962,6 +1062,8 @@ int ffggpuj(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned long *array, int *status);
 int ffggpj(fitsfile *fptr, long group, long firstelem, long nelem,
            long *array, int *status);
+int ffggpjj(fitsfile *fptr, long group, long firstelem, long nelem,
+           LONGLONG *array, int *status);
 int ffggpuk(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned int *array, int *status);
 int ffggpk(fitsfile *fptr, long group, long firstelem, long nelem,
@@ -987,6 +1089,9 @@ int ffgcvl (fitsfile *fptr, int colnum, long firstrow, long firstelem,
 int ffgcvb(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, unsigned char nulval, unsigned char *array,
            int *anynul, int *status);
+int ffgcvsb(fitsfile *fptr, int colnum, long firstrow, long firstelem,
+           long nelem, signed char nulval, signed char *array,
+           int *anynul, int *status);
 int ffgcvui(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, unsigned short nulval, unsigned short *array, 
            int *anynul, int *status);
@@ -997,6 +1102,9 @@ int ffgcvuj(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            int *status);
 int ffgcvj(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, long nulval, long *array, int *anynul, int *status);
+int ffgcvjj(fitsfile *fptr, int colnum, long firstrow, long firstelem,
+           long nelem, LONGLONG nulval, LONGLONG *array, int *anynul,
+           int *status);
 int ffgcvuk(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, unsigned int nulval, unsigned int *array, int *anynul,
            int *status);
@@ -1023,6 +1131,8 @@ int ffgcfl(fitsfile *fptr, int colnum, long firstrow, long firstelem, long
           nelem, char *array, char *nularray, int *anynul, int *status);
 int ffgcfb(fitsfile *fptr, int colnum, long firstrow, long firstelem, long
       nelem, unsigned char *array, char *nularray, int *anynul, int *status);
+int ffgcfsb(fitsfile *fptr, int colnum, long firstrow, long firstelem, long
+      nelem, signed char *array, char *nularray, int *anynul, int *status);
 int ffgcfui(fitsfile *fptr, int colnum, long firstrow, long firstelem,
       long nelem, unsigned short *array, char *nularray, int *anynul, 
       int *status);
@@ -1033,6 +1143,8 @@ int ffgcfuj(fitsfile *fptr, int colnum, long firstrow, long firstelem,
       int *status);
 int ffgcfj(fitsfile *fptr, int colnum, long firstrow, long firstelem,
       long nelem, long *array, char *nularray, int *anynul, int *status);
+int ffgcfjj(fitsfile *fptr, int colnum, long firstrow, long firstelem,
+      long nelem, LONGLONG *array, char *nularray, int *anynul, int *status);
 int ffgcfuk(fitsfile *fptr, int colnum, long firstrow, long firstelem,
       long nelem, unsigned int *array, char *nularray, int *anynul,
       int *status);
@@ -1053,6 +1165,10 @@ int ffgdes(fitsfile *fptr, int colnum, long rownum, long *length,
 int ffgdess(fitsfile *fptr, int colnum, long firstrow, long nrows, long *length,
            long *heapaddr, int *status);
  
+int fftheap(fitsfile *fptr, long *heapsize, long *unused, long *overlap,
+            int *valid, int *status);
+int ffcmph(fitsfile *fptr, int *status);
+
 int ffgtbb(fitsfile *fptr, long firstrow, long firstchar, long nchars,
            unsigned char *values, int *status);
  
@@ -1065,6 +1181,8 @@ int ffppr(fitsfile *fptr, int datatype, long  firstelem, long nelem,
           void *array, int *status);
 int ffpprb(fitsfile *fptr, long group, long firstelem,
            long nelem, unsigned char *array, int *status);
+int ffpprsb(fitsfile *fptr, long group, long firstelem,
+           long nelem, signed char *array, int *status);
 int ffpprui(fitsfile *fptr, long group, long firstelem,
            long nelem, unsigned short *array, int *status);
 int ffppri(fitsfile *fptr, long group, long firstelem,
@@ -1081,6 +1199,8 @@ int ffppre(fitsfile *fptr, long group, long firstelem,
            long nelem, float *array, int *status);
 int ffpprd(fitsfile *fptr, long group, long firstelem,
            long nelem, double *array, int *status);
+int ffpprjj(fitsfile *fptr, long group, long firstelem,
+           long nelem, LONGLONG *array, int *status);
 
 int ffppru(fitsfile *fptr, long group, long firstelem, long nelem,
            int *status);
@@ -1090,6 +1210,8 @@ int ffppn(fitsfile *fptr, int datatype, long  firstelem, long  nelem,
           void  *array, void *nulval, int  *status);
 int ffppnb(fitsfile *fptr, long group, long firstelem, long nelem,
            unsigned char *array, unsigned char nulval, int *status);
+int ffppnsb(fitsfile *fptr, long group, long firstelem, long nelem,
+           signed char *array, signed char nulval, int *status);
 int ffppnui(fitsfile *fptr, long group, long firstelem,
            long nelem, unsigned short *array, unsigned short nulval,
            int *status);
@@ -1107,9 +1229,13 @@ int ffppne(fitsfile *fptr, long group, long firstelem,
            long nelem, float *array, float nulval, int *status);
 int ffppnd(fitsfile *fptr, long group, long firstelem,
            long nelem, double *array, double nulval, int *status);
- 
+int ffppnjj(fitsfile *fptr, long group, long firstelem,
+           long nelem, LONGLONG *array, long nulval, int *status);
+
 int ffp2db(fitsfile *fptr, long group, long ncols, long naxis1,
            long naxis2, unsigned char *array, int *status);
+int ffp2dsb(fitsfile *fptr, long group, long ncols, long naxis1,
+           long naxis2, signed char *array, int *status);
 int ffp2dui(fitsfile *fptr, long group, long ncols, long naxis1,
            long naxis2, unsigned short *array, int *status);
 int ffp2di(fitsfile *fptr, long group, long ncols, long naxis1,
@@ -1126,9 +1252,13 @@ int ffp2de(fitsfile *fptr, long group, long ncols, long naxis1,
            long naxis2, float *array, int *status);
 int ffp2dd(fitsfile *fptr, long group, long ncols, long naxis1,
            long naxis2, double *array, int *status);
- 
+int ffp2djj(fitsfile *fptr, long group, long ncols, long naxis1,
+           long naxis2, LONGLONG *array, int *status);
+
 int ffp3db(fitsfile *fptr, long group, long ncols, long nrows, long naxis1,
            long naxis2, long naxis3, unsigned char *array, int *status);
+int ffp3dsb(fitsfile *fptr, long group, long ncols, long nrows, long naxis1,
+           long naxis2, long naxis3, signed char *array, int *status);
 int ffp3dui(fitsfile *fptr, long group, long ncols, long nrows, long naxis1,
            long naxis2, long naxis3, unsigned short *array, int *status);
 int ffp3di(fitsfile *fptr, long group, long ncols, long nrows, long naxis1,
@@ -1145,9 +1275,15 @@ int ffp3de(fitsfile *fptr, long group, long ncols, long nrows, long naxis1,
            long naxis2, long naxis3, float *array, int *status);
 int ffp3dd(fitsfile *fptr, long group, long ncols, long nrows, long naxis1,
            long naxis2, long naxis3, double *array, int *status);
- 
+int ffp3djj(fitsfile *fptr, long group, long ncols, long nrows, long naxis1,
+           long naxis2, long naxis3, LONGLONG *array, int *status);
+
+int ffpss(fitsfile *fptr, int datatype,
+           long *fpixel, long *lpixel, void *array, int *status);
 int ffpssb(fitsfile *fptr, long group, long naxis, long *naxes,
            long *fpixel, long *lpixel, unsigned char *array, int *status);
+int ffpsssb(fitsfile *fptr, long group, long naxis, long *naxes,
+           long *fpixel, long *lpixel, signed char *array, int *status);
 int ffpssui(fitsfile *fptr, long group, long naxis, long *naxes,
            long *fpixel, long *lpixel, unsigned short *array, int *status);
 int ffpssi(fitsfile *fptr, long group, long naxis, long *naxes,
@@ -1164,9 +1300,13 @@ int ffpsse(fitsfile *fptr, long group, long naxis, long *naxes,
            long *fpixel, long *lpixel, float *array, int *status);
 int ffpssd(fitsfile *fptr, long group, long naxis, long *naxes,
            long *fpixel, long *lpixel, double *array, int *status);
- 
+int ffpssjj(fitsfile *fptr, long group, long naxis, long *naxes,
+           long *fpixel, long *lpixel, LONGLONG *array, int *status);
+
 int ffpgpb(fitsfile *fptr, long group, long firstelem,
            long nelem, unsigned char *array, int *status);
+int ffpgpsb(fitsfile *fptr, long group, long firstelem,
+           long nelem, signed char *array, int *status);
 int ffpgpui(fitsfile *fptr, long group, long firstelem,
            long nelem, unsigned short *array, int *status);
 int ffpgpi(fitsfile *fptr, long group, long firstelem,
@@ -1183,7 +1323,9 @@ int ffpgpe(fitsfile *fptr, long group, long firstelem,
            long nelem, float *array, int *status);
 int ffpgpd(fitsfile *fptr, long group, long firstelem,
            long nelem, double *array, int *status);
- 
+int ffpgpjj(fitsfile *fptr, long group, long firstelem,
+           long nelem, LONGLONG *array, int *status);
+
 /*--------------------- iterator functions -------------*/
 int fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr, char *colname,
           int datatype,  int iotype);
@@ -1221,6 +1363,8 @@ int ffpcll(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, char *array, int *status);
 int ffpclb(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, unsigned char *array, int *status);
+int ffpclsb(fitsfile *fptr, int colnum, long firstrow, long firstelem,
+           long nelem, signed char *array, int *status);
 int ffpclui(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, unsigned short *array, int *status);
 int ffpcli(fitsfile *fptr, int colnum, long firstrow, long firstelem,
@@ -1245,6 +1389,8 @@ int ffpclu(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, int *status);
 int ffpclx(fitsfile *fptr, int colnum, long frow, long fbit, long nbit,
             char *larray, int *status);
+int ffpcljj(fitsfile *fptr, int colnum, long firstrow, long firstelem,
+           long nelem, LONGLONG *array, int *status);
 
 int ffpcn(fitsfile *fptr, int datatype, int colnum, long firstrow,
           long firstelem, long nelem, void *array, void *nulval, int *status);
@@ -1255,6 +1401,9 @@ int ffpcnl( fitsfile *fptr, int  colnum, long  firstrow, long  firstelem,
 int ffpcnb(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, unsigned char *array, unsigned char nulvalue,
            int *status);
+int ffpcnsb(fitsfile *fptr, int colnum, long firstrow, long firstelem,
+           long nelem, signed char *array, signed char nulvalue,
+           int *status);
 int ffpcnui(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, unsigned short *array, unsigned short nulvalue,
            int *status);
@@ -1274,7 +1423,9 @@ int ffpcne(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, float *array, float nulvalue, int *status);
 int ffpcnd(fitsfile *fptr, int colnum, long firstrow, long firstelem,
            long nelem, double *array, double nulvalue, int *status);
- 
+int ffpcnjj(fitsfile *fptr, int colnum, long firstrow, long firstelem,
+           long nelem, LONGLONG *array, LONGLONG nulvalue, int *status);
+
 int ffpdes(fitsfile *fptr, int colnum, long rownum, long length,
            long heapaddr, int *status);
  
@@ -1283,6 +1434,7 @@ int ffptbb(fitsfile *fptr, long firstrow, long firstchar, long nchars,
  
 int ffirow(fitsfile *fptr, long firstrow, long nrows, int *status);
 int ffdrow(fitsfile *fptr, long firstrow, long nrows, int *status);
+int ffdrrg(fitsfile *fptr, char *ranges, int *status);
 int ffdrws(fitsfile *fptr, long *rownum,  long nrows, int *status);
 int fficol(fitsfile *fptr, int numcol, char *ttype, char *tform, int *status);
 int fficls(fitsfile *fptr, int firstcol, int ncols, char **ttype,
@@ -1382,29 +1534,18 @@ int	fits_execute_template(fitsfile *ff, char *ngp_template, int *status);
 
 /*--------------------- image compression routines ------------------*/
 
-int fits_comp_img(fitsfile *infptr, fitsfile *outfptr, int compress_type,
+int fits_set_compression_type(fitsfile *fptr, int ctype, int *status);
+int fits_set_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status);
+int fits_set_noise_bits(fitsfile *fptr, int noisebits, int *status);
+
+int fits_get_compression_type(fitsfile *fptr, int *ctype, int *status);
+int fits_get_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status);
+int fits_get_noise_bits(fitsfile *fptr, int *noisebits, int *status);
+
+int fits_compress_img(fitsfile *infptr, fitsfile *outfptr, int compress_type,
          long *tilesize, int parm1, int parm2, int *status);
 int fits_is_compressed_image(fitsfile *fptr, int *status);
-int fits_decomp_img (fitsfile *infptr, fitsfile *outfptr, int *status);
-int fits_read_compressed_img(fitsfile *fptr, 
-            int  datatype, long  *fpixel,long  *lpixel,long *inc,   
-            int nullcheck, void *nulval,  void *array, char *nullarray,
-            int  *anynul, int  *status);
-
-int fits_read_compressed_pixels(fitsfile *fptr, 
-            int  datatype, long  fpixel, long npixels,   
-            int nullcheck, void *nulval,  void *array, char *nullarray,
-            int  *anynul, int  *status);
-
-int fits_quantize_float (float fdata[], int nx, float in_null_value,
-           int noise_bits, int idata[], double *bscale, double *bzero,
-           int *iminval, int *imaxval);
-int fits_quantize_double (double fdata[], int nx, double in_null_value,
-           int noise_bits, int idata[], double *bscale, double *bzero,
-           int *iminval, int *imaxval);
-int fits_rcomp(int a[], int nx, unsigned char *c, int clen,int nblock);
-int fits_rdecomp (unsigned char *c, int clen, unsigned int array[], int nx,
-             int nblock);
+int fits_decompress_img (fitsfile *infptr, fitsfile *outfptr, int *status);
 
 /*  The following exclusion if __CINT__ is defined is needed for ROOT */
 #ifndef __CINT__
diff --git a/fitsio.ps b/fitsio.ps
index ac59d67..c5bec0a 100644
--- a/fitsio.ps
+++ b/fitsio.ps
@@ -1,14 +1,14 @@
 %!PS-Adobe-2.0
 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software
 %%Title: fitsio.dvi
-%%Pages: 122
+%%Pages: 132
 %%PageOrder: Ascend
-%%BoundingBox: 0 0 596 842
+%%BoundingBox: 0 0 612 792
 %%EndComments
 %DVIPSWebPage: (www.radicaleye.com)
 %DVIPSCommandLine: dvips -N0 fitsio
 %DVIPSParameters: dpi=600, compressed
-%DVIPSSource:  TeX output 2000.10.18:1437
+%DVIPSSource:  TeX output 2004.07.28:1249
 %%BeginProcSet: texc.pro
 %!
 /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -67,7 +67,7 @@ p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
 rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
 
 %%EndProcSet
-TeXDict begin 39158280 55380996 1000 600 600 (fitsio.dvi)
+TeXDict begin 40258431 52099146 1000 600 600 (fitsio.dvi)
 @start
 %DVIPSBitmapFont: Fa cmmi10 10.95 1
 /Fa 1 63 df<126012F8B4FCEA7FC0EA1FF0EA07FCEA01FF38007FC0EB1FF0EB07FCEB01
@@ -77,8 +77,8 @@ EE07FCEE1FF0EE7FC04B48C7FCED07FCED1FF0ED7FC04A48C8FCEC07FCEC1FF0EC7FC049
 48C9FCEB07FCEB1FF0EB7FC04848CAFCEA07FCEA1FF0EA7FC048CBFC12FC1270363678B1
 47>62 D E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fb cmbx12 12 57
-/Fb 57 122 df<ED0FFF4AB512C0020F14F0027F80903A01FFF803FC499038C000FE010F
+%DVIPSBitmapFont: Fb cmbx12 12 58
+/Fb 58 122 df<ED0FFF4AB512C0020F14F0027F80903A01FFF803FC499038C000FE010F
 EB00034948497E49485B5C495A4C138001FF6E13005CA3705AEE01F893C8FCA74BB51280
 B9FCA5C69038E00003B3B0007FD9FFC1B6FCA538467EC53E>12 D<B612F8A91D097F9A25
 >45 D<EA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7FFCEA3FF8EA1FF0EA07C00F0F788E1F
@@ -148,135 +148,146 @@ F095C9FC4B447CC356>I<BA12F8A485D8001F90C71201EF003F180F180318011800A219
 00A2F101E01778A2F103C0A494C7FC1907A21A80A2190FA2191FA2193FF17F0061601807
 181F4DB5FCBBFC61A443447DC34A>I<BA1280A419C026003FFEC7121F1701EF007F183F
 181F180F180719E01803A31801A3EE01E0F000F0A419001603A31607160F167F91B6FCA5
-9138FE007F160F16071603A31601A693C9FCAFB712F0A53C447CC346>I<B7D88003B612
-FEA526003FFEC9EBF800B3A791B9FCA54AC9FCB3AAB7D88003B612FEA54F447CC358>72
-D<B712E0A5D8001F90C7FCB3B3B3A4B712E0A523447DC32A>I<B76C0103B512F8A52600
-3FFEC93807E0004F5A4F5A077EC7FC614E5A4E5A4E5AF01F804EC8FC187E604D5AEF07F0
-EF0FC04D5A4DC9FC177E4C5AEE03F04C5A4C5A4C7EEE7FF04C7E5D4B7F4B7F4B7FED3F3F
-DB7E1F7F03FC806E486C7F4B7E4B6C7F0380804B6C7F4A7F717E84717F83717F85717F83
-717F85717F187F727E86727F84727F86727F84B76C90B612FCA54E447CC358>75
-D<B712F0A526003FFECAFCB3B1F00780A4180F1900A460A360A2187EA218FE1701170317
-07171F177FEE03FFB95AA539447CC343>I<B500FE067FB512806E95B6FCA26F5EA2D800
-3F50C7FC013D6DEE03DFA2013C6DEE079FA26E6CEE0F1FA26E6C161EA26E6C163CA36E6C
-1678A26E6C16F0A26E6DEC01E0A26E6DEC03C0A36E6DEC0780A26F6CEC0F00A26F6C141E
-A26F6C5CA36F6C5CA26F6C5CA26F6D485AA26F6D485AA26F6D485AA3706C48C7FCA29338
-3FF81EA2706C5AA2706C5AA3706C5AA2705BA2705BA2705BA2B6057FB6128071C7FCA217
-3E171C61447CC36A>I<B64BB512FE8181A281D8003F6D91C7EA780081013D7F81133C6E
-7E6E7F6E7F6E7F6E7F82806E7F6E7F6F7E6F7F83816F7F6F7F6F7F6F7F6F7F8382707F70
-7F707F707F8482707F707F717E7113807113C019E0837113F07113F87113FC7113FE19FF
-847213F884848484A28484197F193F191FA2190F1907B61603190119001A78A24F447CC3
-58>I<923807FFC092B512FE0207ECFFC0021F15F091267FFE0013FC902601FFF0EB1FFF
-01070180010313C04990C76C7FD91FFC6E6C7E49486F7E49486F7E01FF8348496F7E4849
-6F1380A248496F13C0A24890C96C13E0A24819F04982003F19F8A3007F19FC49177FA400
-FF19FEAD007F19FC6D17FFA3003F19F8A26D5E6C19F0A26E5D6C19E0A26C6D4B13C06C19
-806E5D6C6D4B13006C6D4B5A6D6C4B5A6D6C4B5A6D6C4A5B6D01C001075B6D01F0011F5B
-010101FE90B5C7FC6D90B65A023F15F8020715C002004AC8FC030713C047467AC454>I<
-B9FC18F018FE727E19E0D8001F90C7000F7F05017F716C7E727E727E721380A21AC084A2
-1AE0A91AC0A24E1380A21A00604E5A4E5A4D485A050F5B92B712C096C7FC18FC18C092CB
-FCB3A7B712E0A543447DC34D>I<B812F8EFFFC018F818FE727ED8001F90C7003F13E005
-037F05007F727E727E727EA28684A286A762A24E90C7FCA24E5A61187F943801FFF00507
-5B053F138092B7C8FC18F818E018F892C77FEF3FFF050F7F717F717FA2717FA2717FA785
-A61B0F85A2187F73131F72141EB700E06DEB803E72EBE0FC72EBFFF8060114F0726C13E0
-CC0007138050457DC354>82 D<DAFFE0131C010701FE133C013F9038FF807C90B6EAE0FC
-4815F9489038801FFF3907FC00014848EB007F4848143F4848140F491407007F15035B16
-01160012FF177CA27FA26D153C7F7F6D92C7FC6C7EEBFFE014FE6CEBFFF015FF6C15E016
-FC6C816C6F7E6C826C826C6C81011F810107811300020F80140003077FED007F82040F13
-80828212F082A282A27EA218007EA26C5D6C5E6D14036D5D6D140701F84A5A01FFEC3FF0
-02F8EBFFE0486CB65AD8FC1F92C7FCD8F80714FC48C614F0480107138031467AC43E>I<
-003FBA12E0A59026FE000FEB8003D87FE09338003FF049171F90C71607A2007E1803007C
-1801A300781800A400F819F8481978A5C81700B3B3A20107B8FCA545437CC24E>I<B76C
-010FB512F8A526003FFEC93803E000B3B3A9011F17076280190F6D606F151F6D95C7FC6D
-6D5D197E6D6D5D6D6D1403DA7FFC4A5A6EB4EC3FF0020F9039F003FFE06E90B612800201
-93C8FC6E6C14FC030F14E09226007FFEC9FC4D457CC356>I<B792B6FCA526003FFECAEA
-FC00806D606F15016D608119036D606F15076D606F150F6D6081191F6D6D93C7FC61027F
-163E6F157E023F167C8119FC6E6D5C18016E5E7013036E5E8218076E6D5C180F6E5E7013
-1F6E93C8FC705B037F143E82187E033F147C7013FC6F5C17816F5C17C117C36F5C17E76F
-5C17FF6F5CA36F91C9FCA2705AA2705AA3705AA2705AA2705AA250457EC355>I<B600FE
-017FB691B512FEA526007FFCC8D83FFEC9EA7C006E82013F701778807415F86D705F6F70
-14016D705FA26F7014036D64814E6D14076D646F70140F6D041E94C7FCA26F023E6D5C6D
-DC3C7F151E81027F037C6D5CF0783F6F70147C023F4B6C1578A26F01016F13F86E4B6C5D
-16806E02036F485A4E7E04C0EEE0036E4A486C5DA2DCE00FEDF0076E4B6C5D16F06E4A6F
-48C8FC051E7F04F8705A6E4A027F131EA2DCFC7CEDFE3E037F0178023F133C04FE16FF03
-3F01F85E4D8004FF17F86F496E5BA36F496E5BA26F604D80A26F90C86C5BA36F486F90C9
-FCA26F48167EA30478163C6F457EC374>I<903801FFE0011F13FE017F6D7E48B612E03A
-03FE007FF84848EB1FFC6D6D7E486C6D7EA26F7FA36F7F6C5A6C5AEA00F090C7FCA40203
-B5FC91B6FC1307013F13F19038FFFC01000313E0000F1380381FFE00485A5B127F5B12FF
-5BA35DA26D5B6C6C5B4B13F0D83FFE013EEBFFC03A1FFF80FC7F0007EBFFF86CECE01FC6
-6CEB8007D90FFCC9FC322F7DAD36>97 D<EB7FC0B5FCA512037EB1ED0FF892B57E02C314
-E002CF14F89139DFC03FFC9139FF000FFE02FCEB03FF4A6D13804A15C04A6D13E05CEF7F
-F0A218F8173FA318FCAC18F8A2177F18F0A3EFFFE06E15C06E5B6E491380027C49130049
-6C495A903AFC1FC07FFC496CB512F0D9F00314C049C691C7FCC8EA1FF036467DC43E>I<
-EC3FFC49B512C0010F14F0013F14FC90397FF003FE9039FFC001FF0003495A4849481380
-5B120F485AA2485A6F1300007F6E5AED00784991C7FCA212FFAC6C7EA3123F6DEC03C0A2
-6C6C1407000F16806D140F6C6DEB1F006C6D133E6C01F05B3A007FFC03F86DB55A010F14
-C0010391C7FC9038003FF82A2F7CAD32>I<EE03FEED07FFA5ED001F160FB1EC3FE09038
-03FFFC010FEBFF8F013F14CF9039FFF807FF48EBC00148903880007F4890C7123F484814
-1F49140F121F485AA3127F5BA212FFAC127FA37F123FA26C6C141FA26C6C143F0007157F
-6C6C91B5FC6CD9C00314FC6C9038F01FEF6DB5128F011FEBFE0F010713F89026007FC0EB
-F80036467CC43E>I<EC3FF80103B57E010F14E0013F8090397FF83FF89039FFC007FC48
-496C7E48496C7E48486D1380485A001FED7FC05B003FED3FE0A2127F5B17F0161F12FFA2
-90B7FCA401F0C9FCA5127FA27FA2123F17F06C7E16016C6C15E06C6C14036C6DEB07C06C
-6DEB0F806C01F0EB3F0090397FFE01FE011FB55A010714F0010114C09026001FFEC7FC2C
-2F7DAD33>I<EDFF80020F13E0027F13F049B512F849EB8FFC90390FFE0FFE90381FFC1F
-14F8133FEB7FF0A2ED0FFCEBFFE0ED03F0ED00C01600ABB612F8A5C601E0C7FCB3B0007F
-EBFFE0A527467DC522>I<DAFFE0137E010F9039FE03FF80013FEBFF8F90B812C048D9C0
-7F133F489038001FF84848EB0FFC4848903907FE1F80001F9238FF0F00496D90C7FCA200
-3F82A8001F93C7FCA26D5B000F5D6C6C495A6C6C495A6C9038C07FF04890B55A1680D807
-8F49C8FC018013E0000F90CAFCA47F7F7F90B612C016FC6CEDFF8017E06C826C16FC7E00
-0382000F82D81FF0C77ED83FC014074848020113808248C9FC177FA46D15FF007F17006D
-5C6C6C4A5A6C6C4A5AD80FFEEC3FF83B07FFC001FFF0000190B612C06C6C92C7FC010F14
-F8D9007F90C8FC32427DAC38>I<EB7FC0B5FCA512037EB1ED07FE92383FFF8092B512E0
-02C114F89139C7F03FFC9138CF801F9139DF000FFE14DE14FC4A6D7E5CA25CA35CB3A7B6
-0083B512FEA537457CC43E>I<137C48B4FC4813804813C0A24813E0A56C13C0A26C1380
-6C1300EA007C90C7FCAAEB7FC0EA7FFFA512037EB3AFB6FCA518467CC520>I<EB7FC0B5
-FCA512037EB293387FFFE0A593380FE0004C5A4CC7FC167E5EED03F8ED07E04B5A4B5A03
-7FC8FC15FEECC1FCECC3FE14C7ECDFFF91B57E82A202F97F02E17F02C07FEC807F6F7E82
-6F7E816F7F836F7F816F7F83707E163FB60003B512F8A535457DC43B>107
-D<EB7FC0B5FCA512037EB3B3B3A3B61280A519457CC420>I<90277F8007FEEC0FFCB590
-263FFFC090387FFF8092B5D8F001B512E002816E4880913D87F01FFC0FE03FF8913D8FC0
-0FFE1F801FFC0003D99F009026FF3E007F6C019E6D013C130F02BC5D02F86D496D7EA24A
-5D4A5DA34A5DB3A7B60081B60003B512FEA5572D7CAC5E>I<90397F8007FEB590383FFF
-8092B512E0028114F8913987F03FFC91388F801F000390399F000FFE6C139E14BC02F86D
-7E5CA25CA35CB3A7B60083B512FEA5372D7CAC3E>I<EC1FFC49B512C0010714F0011F14
-FC90397FF80FFF9026FFC0017F48496C7F4848C7EA3FE000078248486E7E49140F001F82
-A2003F82491407007F82A400FF1780AA007F1700A46C6C4A5AA2001F5E6D141F000F5E6C
-6C4A5AA26C6C6CEBFFE06C6D485B27007FF80F90C7FC6DB55A010F14F8010114C0902600
-1FFCC8FC312F7DAD38>I<90397FC00FF8B590B57E02C314E002CF14F89139DFC03FFC91
-39FF001FFE000301FCEB07FF6C496D13804A15C04A6D13E05C7013F0A2EF7FF8A4EF3FFC
-ACEF7FF8A318F017FFA24C13E06E15C06E5B6E4913806E4913006E495A9139DFC07FFC02
-CFB512F002C314C002C091C7FCED1FF092C9FCADB67EA536407DAC3E>I<90387F807FB5
-3881FFE0028313F0028F13F8ED8FFC91389F1FFE000313BE6C13BC14F8A214F0ED0FFC91
-38E007F8ED01E092C7FCA35CB3A5B612E0A5272D7DAC2E>114 D<90391FFC038090B512
-87000314FF120F381FF003383FC00049133F48C7121F127E00FE140FA215077EA27F01E0
-90C7FC13FE387FFFF014FF6C14C015F06C14FC6C800003806C15806C7E010F14C0EB003F
-020313E0140000F0143FA26C141F150FA27EA26C15C06C141FA26DEB3F8001E0EB7F0090
-38F803FE90B55A00FC5CD8F03F13E026E007FEC7FC232F7CAD2C>I<EB01E0A51303A413
-07A2130FA2131FA2133F137F13FF1203000F90B51280B7FCA4C601E0C7FCB3A3ED01E0A9
-150302F013C0137F150790393FF80F8090391FFC1F006DB5FC6D13FC01015B9038003FE0
-23407EBE2C>I<D97FC049B4FCB50103B5FCA50003EC000F6C81B3A85EA25EA25E7E6E49
-1380017FD901F713FE9138F807E76DB512C7010F1407010313FE9026007FF0EBFC00372E
-7CAC3E>I<B6903803FFFCA5000101E09038003E006C163C80017F5D8017F8013F5D6E13
-01011F5D6E1303010F5D6E13076D5DED800F6D92C7FC15C05E6DEBE01E163E6D143CEDF0
-7C027F1378EDF8F8023F5B15FD021F5B15FF6E5BA36E5BA26E90C8FCA26E5AA26E5AA215
-78362C7EAB3B>I<B5D8FE1FB539801FFFF0A500019027C0003FE0C7EA7C007114786E17
-F86C6F6C5C6E1601017F6E6C5CA26E011F1403013F6F5C6E013F1407011F6F5CA26E0179
-140F010F048090C7FC6E01F95C6D02F0EBC01E15806D902681E07F5B18E003C3157C6D91
-39C03FF07815E76DDA801F5B18F803FF14F96E9039000FFDE018FF6E486D5BA36E486D5B
-A26E486D90C8FCA24B7F02075DA26E48147C4B143C4C2C7EAB51>I<B500FE90383FFFF0
-A5C601F0903803E0006D6C495A013F4A5A6D6C49C7FC6E5B6D6C137E6DEB807C6D6D5A6D
-EBC1F0EDE3E06DEBF7C06EB45A806E90C8FC5D6E7E6E7F6E7FA24A7F4A7F8291381F3FFC
-EC3E1F027C7F4A6C7E49486C7F01036D7F49487E02C08049486C7F49C76C7E013E6E7E01
-7E141FB500E090B512FCA5362C7EAB3B>I<B6903803FFFCA5000101E09038003E006C16
-3C80017F5D8017F8013F5D6E1301011F5D6E1303010F5D6E13076D5DED800F6D92C7FC15
-C05E6DEBE01E163E6D143CEDF07C027F1378EDF8F8023F5B15FD021F5B15FF6E5BA36E5B
-A26E90C8FCA26E5AA26E5AA21578A215F85D14015D001F1303D83F805B387FC007D8FFE0
-5B140F92C9FC5C143E495A387FC1F8EB07F06CB45A6C5B000790CAFCEA01FC36407EAB3B
->I E
+9138FE007F160F16071603A31601A693C9FCAFB712F0A53C447CC346>I<DCFFF0147003
+1F01FF14F04AB6EAE0010207EDF803023FEDFE0791B539E001FF0F4949C7EA3F9F010701
+F0EC0FFF4901C0804990C87E4948814948814948167F4849163F4849161F5A4A160F485B
+19074890CAFC19035A5BA2007F1801A34994C8FC12FFAD057FB612F0127F7FA3003FDC00
+01EBF000A27F7EA26C7FA26C7F807E6C7F6C7F6D7E6D6C5D6D6C7E6D6D5C6D01F05C0101
+01FE143F6D903AFFF001FF9F023F90B6120F0207EDFC030201EDF000DA001F02C0133003
+0001FCC9FC4C467AC458>I<B7D88003B612FEA526003FFEC9EBF800B3A791B9FCA54AC9
+FCB3AAB7D88003B612FEA54F447CC358>I<B712E0A5D8001F90C7FCB3B3B3A4B712E0A5
+23447DC32A>I<B76C0103B512F8A526003FFEC93807E0004F5A4F5A077EC7FC614E5A4E
+5A4E5AF01F804EC8FC187E604D5AEF07F0EF0FC04D5A4DC9FC177E4C5AEE03F04C5A4C5A
+4C7EEE7FF04C7E5D4B7F4B7F4B7FED3F3FDB7E1F7F03FC806E486C7F4B7E4B6C7F038080
+4B6C7F4A7F717E84717F83717F85717F83717F85717F187F727E86727F84727F86727F84
+B76C90B612FCA54E447CC358>75 D<B712F0A526003FFECAFCB3B1F00780A4180F1900A4
+60A360A2187EA218FE170117031707171F177FEE03FFB95AA539447CC343>I<B500FE06
+7FB512806E95B6FCA26F5EA2D8003F50C7FC013D6DEE03DFA2013C6DEE079FA26E6CEE0F
+1FA26E6C161EA26E6C163CA36E6C1678A26E6C16F0A26E6DEC01E0A26E6DEC03C0A36E6D
+EC0780A26F6CEC0F00A26F6C141EA26F6C5CA36F6C5CA26F6C5CA26F6D485AA26F6D485A
+A26F6D485AA3706C48C7FCA293383FF81EA2706C5AA2706C5AA3706C5AA2705BA2705BA2
+705BA2B6057FB6128071C7FCA2173E171C61447CC36A>I<B64BB512FE8181A281D8003F
+6D91C7EA780081013D7F81133C6E7E6E7F6E7F6E7F6E7F82806E7F6E7F6F7E6F7F83816F
+7F6F7F6F7F6F7F6F7F8382707F707F707F707F8482707F707F717E7113807113C019E083
+7113F07113F87113FC7113FE19FF847213F884848484A28484197F193F191FA2190F1907
+B61603190119001A78A24F447CC358>I<923807FFC092B512FE0207ECFFC0021F15F091
+267FFE0013FC902601FFF0EB1FFF01070180010313C04990C76C7FD91FFC6E6C7E49486F
+7E49486F7E01FF8348496F7E48496F1380A248496F13C0A24890C96C13E0A24819F04982
+003F19F8A3007F19FC49177FA400FF19FEAD007F19FC6D17FFA3003F19F8A26D5E6C19F0
+A26E5D6C19E0A26C6D4B13C06C19806E5D6C6D4B13006C6D4B5A6D6C4B5A6D6C4B5A6D6C
+4A5B6D01C001075B6D01F0011F5B010101FE90B5C7FC6D90B65A023F15F8020715C00200
+4AC8FC030713C047467AC454>I<B9FC18F018FE727E19E0D8001F90C7000F7F05017F71
+6C7E727E727E721380A21AC084A21AE0A91AC0A24E1380A21A00604E5A4E5A4D485A050F
+5B92B712C096C7FC18FC18C092CBFCB3A7B712E0A543447DC34D>I<B812F8EFFFC018F8
+18FE727ED8001F90C7003F13E005037F05007F727E727E727EA28684A286A762A24E90C7
+FCA24E5A61187F943801FFF005075B053F138092B7C8FC18F818E018F892C77FEF3FFF05
+0F7F717F717FA2717FA2717FA785A61B0F85A2187F73131F72141EB700E06DEB803E72EB
+E0FC72EBFFF8060114F0726C13E0CC0007138050457DC354>82 D<DAFFE0131C010701FE
+133C013F9038FF807C90B6EAE0FC4815F9489038801FFF3907FC00014848EB007F484814
+3F4848140F491407007F15035B1601160012FF177CA27FA26D153C7F7F6D92C7FC6C7EEB
+FFE014FE6CEBFFF015FF6C15E016FC6C816C6F7E6C826C826C6C81011F81010781130002
+0F80140003077FED007F82040F1380828212F082A282A27EA218007EA26C5D6C5E6D1403
+6D5D6D140701F84A5A01FFEC3FF002F8EBFFE0486CB65AD8FC1F92C7FCD8F80714FC48C6
+14F0480107138031467AC43E>I<003FBA12E0A59026FE000FEB8003D87FE09338003FF0
+49171F90C71607A2007E1803007C1801A300781800A400F819F8481978A5C81700B3B3A2
+0107B8FCA545437CC24E>I<B76C010FB512F8A526003FFEC93803E000B3B3A9011F1707
+6280190F6D606F151F6D95C7FC6D6D5D197E6D6D5D6D6D1403DA7FFC4A5A6EB4EC3FF002
+0F9039F003FFE06E90B61280020193C8FC6E6C14FC030F14E09226007FFEC9FC4D457CC3
+56>I<B792B6FCA526003FFECAEAFC00806D606F15016D608119036D606F15076D606F15
+0F6D6081191F6D6D93C7FC61027F163E6F157E023F167C8119FC6E6D5C18016E5E701303
+6E5E8218076E6D5C180F6E5E70131F6E93C8FC705B037F143E82187E033F147C7013FC6F
+5C17816F5C17C117C36F5C17E76F5C17FF6F5CA36F91C9FCA2705AA2705AA3705AA2705A
+A2705AA250457EC355>I<B600FE017FB691B512FEA526007FFCC8D83FFEC9EA7C006E82
+013F701778807415F86D705F6F7014016D705FA26F7014036D64814E6D14076D646F7014
+0F6D041E94C7FCA26F023E6D5C6DDC3C7F151E81027F037C6D5CF0783F6F70147C023F4B
+6C1578A26F01016F13F86E4B6C5D16806E02036F485A4E7E04C0EEE0036E4A486C5DA2DC
+E00FEDF0076E4B6C5D16F06E4A6F48C8FC051E7F04F8705A6E4A027F131EA2DCFC7CEDFE
+3E037F0178023F133C04FE16FF033F01F85E4D8004FF17F86F496E5BA36F496E5BA26F60
+4D80A26F90C86C5BA36F486F90C9FCA26F48167EA30478163C6F457EC374>I<903801FF
+E0011F13FE017F6D7E48B612E03A03FE007FF84848EB1FFC6D6D7E486C6D7EA26F7FA36F
+7F6C5A6C5AEA00F090C7FCA40203B5FC91B6FC1307013F13F19038FFFC01000313E0000F
+1380381FFE00485A5B127F5B12FF5BA35DA26D5B6C6C5B4B13F0D83FFE013EEBFFC03A1F
+FF80FC7F0007EBFFF86CECE01FC66CEB8007D90FFCC9FC322F7DAD36>97
+D<EB7FC0B5FCA512037EB1ED0FF892B57E02C314E002CF14F89139DFC03FFC9139FF000F
+FE02FCEB03FF4A6D13804A15C04A6D13E05CEF7FF0A218F8173FA318FCAC18F8A2177F18
+F0A3EFFFE06E15C06E5B6E491380027C491300496C495A903AFC1FC07FFC496CB512F0D9
+F00314C049C691C7FCC8EA1FF036467DC43E>I<EC3FFC49B512C0010F14F0013F14FC90
+397FF003FE9039FFC001FF0003495A48494813805B120F485AA2485A6F1300007F6E5AED
+00784991C7FCA212FFAC6C7EA3123F6DEC03C0A26C6C1407000F16806D140F6C6DEB1F00
+6C6D133E6C01F05B3A007FFC03F86DB55A010F14C0010391C7FC9038003FF82A2F7CAD32
+>I<EE03FEED07FFA5ED001F160FB1EC3FE0903803FFFC010FEBFF8F013F14CF9039FFF8
+07FF48EBC00148903880007F4890C7123F4848141F49140F121F485AA3127F5BA212FFAC
+127FA37F123FA26C6C141FA26C6C143F0007157F6C6C91B5FC6CD9C00314FC6C9038F01F
+EF6DB5128F011FEBFE0F010713F89026007FC0EBF80036467CC43E>I<EC3FF80103B57E
+010F14E0013F8090397FF83FF89039FFC007FC48496C7E48496C7E48486D1380485A001F
+ED7FC05B003FED3FE0A2127F5B17F0161F12FFA290B7FCA401F0C9FCA5127FA27FA2123F
+17F06C7E16016C6C15E06C6C14036C6DEB07C06C6DEB0F806C01F0EB3F0090397FFE01FE
+011FB55A010714F0010114C09026001FFEC7FC2C2F7DAD33>I<EDFF80020F13E0027F13
+F049B512F849EB8FFC90390FFE0FFE90381FFC1F14F8133FEB7FF0A2ED0FFCEBFFE0ED03
+F0ED00C01600ABB612F8A5C601E0C7FCB3B0007FEBFFE0A527467DC522>I<DAFFE0137E
+010F9039FE03FF80013FEBFF8F90B812C048D9C07F133F489038001FF84848EB0FFC4848
+903907FE1F80001F9238FF0F00496D90C7FCA2003F82A8001F93C7FCA26D5B000F5D6C6C
+495A6C6C495A6C9038C07FF04890B55A1680D8078F49C8FC018013E0000F90CAFCA47F7F
+7F90B612C016FC6CEDFF8017E06C826C16FC7E000382000F82D81FF0C77ED83FC0140748
+48020113808248C9FC177FA46D15FF007F17006D5C6C6C4A5A6C6C4A5AD80FFEEC3FF83B
+07FFC001FFF0000190B612C06C6C92C7FC010F14F8D9007F90C8FC32427DAC38>I<EB7F
+C0B5FCA512037EB1ED07FE92383FFF8092B512E002C114F89139C7F03FFC9138CF801F91
+39DF000FFE14DE14FC4A6D7E5CA25CA35CB3A7B60083B512FEA537457CC43E>I<137C48
+B4FC4813804813C0A24813E0A56C13C0A26C13806C1300EA007C90C7FCAAEB7FC0EA7FFF
+A512037EB3AFB6FCA518467CC520>I<EB7FC0B5FCA512037EB293387FFFE0A593380FE0
+004C5A4CC7FC167E5EED03F8ED07E04B5A4B5A037FC8FC15FEECC1FCECC3FE14C7ECDFFF
+91B57E82A202F97F02E17F02C07FEC807F6F7E826F7E816F7F836F7F816F7F83707E163F
+B60003B512F8A535457DC43B>107 D<EB7FC0B5FCA512037EB3B3B3A3B61280A519457C
+C420>I<90277F8007FEEC0FFCB590263FFFC090387FFF8092B5D8F001B512E002816E48
+80913D87F01FFC0FE03FF8913D8FC00FFE1F801FFC0003D99F009026FF3E007F6C019E6D
+013C130F02BC5D02F86D496D7EA24A5D4A5DA34A5DB3A7B60081B60003B512FEA5572D7C
+AC5E>I<90397F8007FEB590383FFF8092B512E0028114F8913987F03FFC91388F801F00
+0390399F000FFE6C139E14BC02F86D7E5CA25CA35CB3A7B60083B512FEA5372D7CAC3E>
+I<EC1FFC49B512C0010714F0011F14FC90397FF80FFF9026FFC0017F48496C7F4848C7EA
+3FE000078248486E7E49140F001F82A2003F82491407007F82A400FF1780AA007F1700A4
+6C6C4A5AA2001F5E6D141F000F5E6C6C4A5AA26C6C6CEBFFE06C6D485B27007FF80F90C7
+FC6DB55A010F14F8010114C09026001FFCC8FC312F7DAD38>I<90397FC00FF8B590B57E
+02C314E002CF14F89139DFC03FFC9139FF001FFE000301FCEB07FF6C496D13804A15C04A
+6D13E05C7013F0A2EF7FF8A4EF3FFCACEF7FF8A318F017FFA24C13E06E15C06E5B6E4913
+806E4913006E495A9139DFC07FFC02CFB512F002C314C002C091C7FCED1FF092C9FCADB6
+7EA536407DAC3E>I<90387F807FB53881FFE0028313F0028F13F8ED8FFC91389F1FFE00
+0313BE6C13BC14F8A214F0ED0FFC9138E007F8ED01E092C7FCA35CB3A5B612E0A5272D7D
+AC2E>114 D<90391FFC038090B51287000314FF120F381FF003383FC00049133F48C712
+1F127E00FE140FA215077EA27F01E090C7FC13FE387FFFF014FF6C14C015F06C14FC6C80
+0003806C15806C7E010F14C0EB003F020313E0140000F0143FA26C141F150FA27EA26C15
+C06C141FA26DEB3F8001E0EB7F009038F803FE90B55A00FC5CD8F03F13E026E007FEC7FC
+232F7CAD2C>I<EB01E0A51303A41307A2130FA2131FA2133F137F13FF1203000F90B512
+80B7FCA4C601E0C7FCB3A3ED01E0A9150302F013C0137F150790393FF80F8090391FFC1F
+006DB5FC6D13FC01015B9038003FE023407EBE2C>I<D97FC049B4FCB50103B5FCA50003
+EC000F6C81B3A85EA25EA25E7E6E491380017FD901F713FE9138F807E76DB512C7010F14
+07010313FE9026007FF0EBFC00372E7CAC3E>I<B6903803FFFCA5000101E09038003E00
+6C163C80017F5D8017F8013F5D6E1301011F5D6E1303010F5D6E13076D5DED800F6D92C7
+FC15C05E6DEBE01E163E6D143CEDF07C027F1378EDF8F8023F5B15FD021F5B15FF6E5BA3
+6E5BA26E90C8FCA26E5AA26E5AA21578362C7EAB3B>I<B5D8FE1FB539801FFFF0A50001
+9027C0003FE0C7EA7C007114786E17F86C6F6C5C6E1601017F6E6C5CA26E011F1403013F
+6F5C6E013F1407011F6F5CA26E0179140F010F048090C7FC6E01F95C6D02F0EBC01E1580
+6D902681E07F5B18E003C3157C6D9139C03FF07815E76DDA801F5B18F803FF14F96E9039
+000FFDE018FF6E486D5BA36E486D5BA26E486D90C8FCA24B7F02075DA26E48147C4B143C
+4C2C7EAB51>I<B500FE90383FFFF0A5C601F0903803E0006D6C495A013F4A5A6D6C49C7
+FC6E5B6D6C137E6DEB807C6D6D5A6DEBC1F0EDE3E06DEBF7C06EB45A806E90C8FC5D6E7E
+6E7F6E7FA24A7F4A7F8291381F3FFCEC3E1F027C7F4A6C7E49486C7F01036D7F49487E02
+C08049486C7F49C76C7E013E6E7E017E141FB500E090B512FCA5362C7EAB3B>I<B69038
+03FFFCA5000101E09038003E006C163C80017F5D8017F8013F5D6E1301011F5D6E130301
+0F5D6E13076D5DED800F6D92C7FC15C05E6DEBE01E163E6D143CEDF07C027F1378EDF8F8
+023F5B15FD021F5B15FF6E5BA36E5BA26E90C8FCA26E5AA26E5AA21578A215F85D14015D
+001F1303D83F805B387FC007D8FFE05B140F92C9FC5C143E495A387FC1F8EB07F06CB45A
+6C5B000790CAFCEA01FC36407EAB3B>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fc cmsy10 10.95 2
-/Fc 2 107 df<EB0FFCEB3FFF90B512C0000314F04880488048804880A2481580A3B712
+%DVIPSBitmapFont: Fc cmsy10 10.95 4
+/Fc 4 107 df<EB0FFCEB3FFF90B512C0000314F04880488048804880A2481580A3B712
 C0AA6C1580A36C1500A26C5C6C5C6C5C6C5CC614C0013F90C7FCEB0FFC22227BA72D>15
-D<126012F0B3B3B3B3B11260045B76C319>106 D E
+D<153FEC03FFEC0FE0EC3F80EC7E00495A5C495AA2495AB3AA130F5C131F495A91C7FC13
+FEEA03F8EA7FE048C8FCEA7FE0EA03F8EA00FE133F806D7E130F801307B3AA6D7EA26D7E
+80EB007EEC3F80EC0FE0EC03FFEC003F205B7AC32D>102 D<12FCEAFFC0EA07F0EA01FC
+EA007E6D7E131F6D7EA26D7EB3AA801303806D7E1300147FEC1FC0EC07FEEC00FFEC07FE
+EC1FC0EC7F0014FC1301495A5C13075CB3AA495AA2495A133F017EC7FC485AEA07F0EAFF
+C000FCC8FC205B7AC32D>I<126012F0B3B3B3B3B11260045B76C319>106
+D E
 %EndDVIPSBitmapFont
 %DVIPSBitmapFont: Fd cmbx12 14.4 63
 /Fd 63 123 df<922601FFFC903801FFE0033F9026FF801F13F84AB6D8E07F13FE020F03
@@ -1079,8 +1090,8 @@ F8785E6E6C5AEDFDC015FF6E5B93CAFC6E5AA35DA21403A45DA21407A45DA2140FA4141F
 485C495A495A171E4890C8123E485A4848157E484815FE4C5A484814074848141F4848EB
 01FFB8FC5FA2373E7BBD38>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fh cmbx10 10.95 53
-/Fh 53 122 df<EDFFF8020F13FF027F8049B612E001079038C01FF090390FFE0007D91F
+%DVIPSBitmapFont: Fh cmbx10 10.95 49
+/Fh 49 122 df<EDFFF8020F13FF027F8049B612E001079038C01FF090390FFE0007D91F
 F8497ED93FE0131F4948497E13FF5C5A91C7FCA2705A705AEE03C093C8FCA6EE03FCB8FC
 A50001903880001F160FB3AB007FD9FE03B512F0A534407EBF3A>12
 D<B612E0A91B097F9823>45 D<161C163E167EA216FE16FC150116F8A2150316F0A21507
@@ -1124,130 +1135,119 @@ FC6C816D14E0011F80498090B67E48812607FE3F7F48486C1480381FF807D9F00114C048
 7E000F6E7E485A6F7E123F48488081178012FFA217C0A517E0A4007F5CA4003F5C6C7E5D
 6C7E00075C3903FF80FB6C13FF6C6C13F36D13C3010F018313C090380008031400A24B13
 80EA03F0487E486C1500487E4B5AA25E151F4B5A495C6C48EBFFE049485B2607FC0F5B6C
-B6C7FC6C14FC6C14F06D13C0D90FFEC8FC2B3D7CBB34>I<EA0FC0EA1FE0EA3FF0EA7FF8
-EAFFFCA6EA7FF8EA3FF0EA1FE0EA0FC0C7FCACEA0FC0EA1FE0EA3FF0EA7FF8EAFFFCA6EA
-7FF8EA3FF0EA1FE0EA0FC00E2879A71D>I<16FCA24B7EA24B7EA34B7FA24B7FA34B7FA2
-4B7FA34B7F157C03FC7FEDF87FA2020180EDF03F0203804B7E02078115C082020F814B7E
-021F811500824A81023E7F027E81027C7FA202FC814A147F49B77EA34982A2D907E0C700
-1F7F4A80010F835C83011F8391C87E4983133E83017E83017C81B500FC91B612FCA5463F
-7CBE4F>65 D<B812F8EFFF8018F018FC8426003FFCC7EA3FFF050F13807113C07113E083
-19F0A27113F8A719F05FA24D13E019C04D13804D1300EF3FFE933801FFF891B712E01880
-18F818FE02FCC7380FFF80050313C07113E07113F019F8F07FFCA2F03FFEA219FFA38460
-A419FE187FA2F0FFFC4D13F85F4D13F0053F13E0BA12C0190018FC18F095C7FC403E7DBD
-4A>I<922607FFC0130E92B500FC131E020702FF133E023FEDC07E91B7EAE1FE01039138
-803FFB499039F80003FF4901C01300013F90C8127F4948151FD9FFF8150F48491507485B
-4A1503481701485B18004890CAFC197E5A5B193E127FA349170012FFAC127F7F193EA212
-3FA27F6C187E197C6C7F19FC6C6D16F86C6D150119F06C6D15036C6DED07E0D97FFEED0F
-C06D6CED3F80010F01C0ECFF006D01F8EB03FE6D9039FF801FFC010091B55A023F15E002
-071580020002FCC7FC030713C03F407ABE4C>I<B812F8EFFF8018F018FC18FF26003FFC
-C76C13C005077F05017F716C7E727E727E727E721380A27213C0A27213E0A21AF084A21A
-F8A41AFCA5197FA319FFA51AF8A41AF0A2601AE0A24E13C0A24E13804E1300604E5A4E5A
-4D485A050713E0057F5BBA5A4EC7FC18F818C005F8C8FC463E7DBD50>I<BAFCA4198026
-003FFEC7123F1707170183183FA2181FF00FC0A31807EE07C0A3F003E0A3160F95C7FC16
-1F163F16FF91B6FCA54AC6FC163F161F040F147CA2160719F8A593C71201A219F01803A2
-1807A2180FF01FE0183F18FF1703173FBAFCA219C0A33E3D7DBC45>I<B912FEA4842600
-3FFEC77E170F1703170084A284F01F80A3180FA2EE07C0A2F007C0A4040F90C7FCA2161F
-163F16FF91B6FCA54AC6FC163F161F160FA21607A693C9FCACB712E0A53A3D7DBC42>I<
-922607FFC0130E92B500FC131E020702FF133E023FEDC07E91B7EAE1FE01039138803FFB
-499039F80003FF4901C01300013F90C8127F4948151FD9FFF8150F48491507485B4A1503
-481701485B18004890CAFC197E5A5B193E127FA34994C7FC12FFAB0407B612FC127F7FA3
-003F92C7383FFE00A27F7EA26C7FA26C7F6C7FA26C7F6C7FD97FFE157F6D6C7E010F01E0
-14FF6D01F813036D9038FF801F010091B512F3023F15C00207ED803E02009138FE000E03
-0701E090C7FC46407ABE52>I<B71280A526003FFEC7FCB3B3B0B71280A5213E7DBD28>
-73 D<B76C90B6FCA526003FFEC8D801FCC7FCF007F84E5A4E5AF03F804EC8FC18FEEF03
-FC4D5A4D5AEF1FC04D5A4DC9FCEE01FE4C5A4C5AEE0FE04C5A4C5A16FF4B7F4B7F5D4B7F
-4B7F037F7F92B5FC6E486C7E9238F83FFF03F0804B7E4B6C7F4B6C7F0300804A7F707F70
-7F84717E83717F85717F83717F85717F83727E85727F84B7D88007B612C0A54A3E7DBD52
->75 D<B712E0A526003FFEC9FCB3AD183EA4187E187CA418FCA21701A2EF03F8A2170717
-0F171F177FEE01FF160FB9FC18F0A4373E7DBD3F>I<B6037FB512E0A2818181D8003F6D
-9139001F800081A281816E7E6E7F6E7F80826E7F6E7F6E7F6E7F157F826F7F6F7F6F7F6F
-7F81836F7F6F7F707E701380A27013C07013E07013F07013F87013FCA27013FEEF7FFF71
-139F7113DF8319FF8383838384A28484848484A284B600C080197F193F191FA24B3E7DBD
-52>78 D<ED3FFF0203B512F0021F14FE027F6E7E902701FFF80713E00107D9C00013F849
-90C7EA3FFCD93FFCEC0FFF49486E7F49486E7F48496E7F4A80488448496F7EA24890C96C
-7E4884A249161F003F84A34848701380A400FF19C0AD007F19806D5EA3003F1900A26D5E
-6C60A26C6D4B5AA26C6D4B5A6C6D4A5BA26C6D4A5B6C6D4A5B6D6C4A5B6DB4023F90C7FC
-6D01C0EBFFFE0107D9F80713F8010190B612E06D5E021F4AC8FC020314F0DA003F90C9FC
-42407ABE4F>I<B812F017FF18C018F018FC26003FFCC77FEF1FFF7113807113C07113E0
-A27113F0A319F8A819F0A34D13E019C05F4D1380053F1300EFFFFE91B712F860188005FC
-C7FC4ACAFCB3A4B77EA53D3E7DBD47>I<B87E17FCEFFF8018F08428003FFC000113FE93
-38003FFF050F7F717F717FA2858385A761A25F61614D5B4D90C8FCEF3FFE4CB45A91B712
-F018C04DC9FC717E9126FC000F7F040113F0707F717EA2717EA2717EA685A6F207C019C0
-A271140F07E01380B76DEBF01F719038FC3F007190B5FC716C5B061F13F8CB000113E04A
-3F7DBD4E>82 D<903A03FFC001C0011FEBF803017FEBFE0748B6128F4815DF48010013FF
-D80FF8130F48481303497F4848EB007F127F49143F161F12FF160FA27F1607A27F7F01FC
-91C7FCEBFF806C13F8ECFFC06C14FCEDFF806C15E016F86C816C816C816C16806C6C15C0
-7F010715E0EB007F020714F0EC003F1503030013F8167F163F127800F8151FA2160FA27E
-A217F07E161F6C16E06D143F01E015C001F8EC7F8001FEEB01FF9026FFE00713004890B5
-5A486C14F8D8F81F5CD8F00314C027E0003FFEC7FC2D407ABE3A>I<003FB912FCA5903B
-FE003FFE003FD87FF0EE0FFE01C0160349160190C71500197E127EA2007C183EA400FC18
-3F48181FA5C81600B3AF010FB712F8A5403D7CBC49>I<B76C90B61280A526003FFEC900
-3EC7FCB3B3A4197E011F177C80A26D17FC616D6D14014E5A6D6D4A5A6D6D140F6D01F8EC
-3FC0DA7FFEECFF8091273FFFC00F90C8FC020F90B512FC02035D020015E0031F14800301
-01F8C9FC493F7DBD50>I<903807FFC0013F13F848B6FC48812607FE037F260FF8007F6D
-EB3FF0486C806F7EA36F7EA26C5A6C5AEA01E0C8FC153F91B5FC130F137F3901FFFE0F48
-13E0000F1380381FFE00485A5B485A12FF5BA4151F7F007F143F6D90387BFF806C6C01FB
-13FE391FFF07F36CEBFFE100031480C6EC003FD91FF890C7FC2F2B7DA933>97
-D<13FFB5FCA512077EAFEDFFE0020713FC021FEBFF80027F80DAFF8113F09139FC003FF8
-02F06D7E4A6D7E4A13074A80701380A218C082A318E0AA18C0A25E1880A218005E6E5C6E
-495A6E495A02FCEB7FF0903AFCFF01FFE0496CB55AD9F01F91C7FCD9E00713FCC7000113
-C033407DBE3A>I<EC7FF00107B5FC011F14C0017F14E09039FFF01FF0489038800FF848
-EB001F4848EB3FFC120F485AA2485AA2007FEC1FF849EB0FF0ED03C000FF91C7FCAB127F
-7FA3003F153E7F001F157E6C6C147C6C6C14FC91388001F86C9038C003F0C69038F81FE0
-6DB512C0011F14800107EBFE009038007FF0272B7DA92E>I<EE07F8ED07FFA5ED003F16
-1FAFEC7FF0903807FFFE011FEBFF9F017F14DF9039FFF01FFF48EBC00348EB00014848EB
-007F485A001F153F5B123FA2127F5BA212FFAA127FA37F123FA26C6C147F120F6D14FF6C
-6C01037F6C6D48EBFFE06CEBF03F6C6CB512BF6D143F010713FC010001E0EBE00033407D
-BE3A>I<ECFFF0010713FE011F6D7E017F809039FFE07FE0489038801FF048496C7E4848
-6D7E48486D7E121F491301003F81A2485A6F1380A212FFA290B7FCA401F0C9FCA5127FA2
-7F123FEE0F806C7E161F6C6C15006C6C5C6C6D137E6C9038E001FC6C9038F80FF8013FB5
-5A6D14C0010391C7FC9038007FF8292B7DA930>I<EC07FE91387FFF8049B512C0010714
-E090390FFE3FF0EB1FF090393FE07FF8EB7FC013FF1480A2489038003FF0ED1FE0ED0FC0
-92C7FCAAB612E0A500010180C7FCB3AC007FEBFF80A525407DBF20>I<903A03FF8007F0
-013F9038F83FF8499038FCFFFC48B712FE48018313F93A07FC007FC34848EB3FE1001FED
-F1FC4990381FF0F81700003F81A7001F5DA26D133F000F5D6C6C495A3A03FF83FF8091B5
-C7FC4814FC01BF5BD80F03138090CAFCA2487EA27F13F06CB6FC16F016FC6C15FF17806C
-16C06C16E01207001F16F0393FE000034848EB003F49EC1FF800FF150F90C81207A56C6C
-EC0FF06D141F003F16E001F0147FD81FFC903801FFC02707FF800F13006C90B55AC615F8
-013F14E0010101FCC7FC2F3D7DA834>I<13FFB5FCA512077EAFED1FF8EDFFFE02036D7E
-4A80DA0FE07F91381F007F023C805C4A6D7E5CA25CA35CB3A4B5D8FE0FB512E0A5333F7C
-BE3A>I<EA01F8487E487E487E481380A66C13006C5A6C5A6C5AC8FCA913FFB5FCA51207
-7EB3ABB512F8A515407CBF1D>I<13FFB5FCA512077EB3B3AFB512FCA5163F7CBE1D>108
-D<01FFD91FF8ECFFC0B590B5010713F80203DAC01F13FE4A6E487FDA0FE09026F07F077F
-91261F003FEBF8010007013EDAF9F0806C0178ECFBC04A6DB4486C7FA24A92C7FC4A5CA3
-4A5CB3A4B5D8FE07B5D8F03FEBFF80A551297CA858>I<01FFEB1FF8B5EBFFFE02036D7E
-4A80DA0FE07F91381F007F0007013C806C5B4A6D7E5CA25CA35CB3A4B5D8FE0FB512E0A5
-33297CA83A>I<EC7FF0903803FFFE011FEBFFC0017F14F09039FFE03FF8489038800FFC
-3A03FE0003FE48486D7E000F168048486D13C0A2003F16E049147F007F16F0A400FF16F8
-AA007F16F0A46C6CECFFE0A2001F16C06C6C491380A26C6C4913003A03FF800FFE6C9038
-E03FFC6C6CB512F0011F14C0010791C7FC9038007FF02D2B7DA934>I<01FFEBFFE0B500
-0713FC021FEBFF80027F80DAFF8113F09139FC007FF8000701F06D7E6C496D7E4A130F4A
-6D7E1880A27013C0A38218E0AA4C13C0A318805E18005E6E5C6E495A6E495A02FCEBFFF0
-DAFF035B92B55A029F91C7FC028713FC028113C00280C9FCACB512FEA5333B7DA83A>I<
-3901FE01FE00FF903807FF804A13E04A13F0EC3F1F91387C3FF8000713F8000313F0EBFF
-E0A29138C01FF0ED0FE091388007C092C7FCA391C8FCB3A2B6FCA525297DA82B>114
-D<90383FFC1E48B512BE000714FE5A381FF00F383F800148C7FC007E147EA200FE143EA2
-7E7F6D90C7FC13F8EBFFE06C13FF15C06C14F06C806C806C806C80C61580131F13000207
-13C014000078147F00F8143F151F7EA27E16806C143F6D140001E013FF9038F803FE90B5
-5A15F0D8F87F13C026E00FFEC7FC222B7DA929>I<EB07C0A5130FA4131FA3133F137FA2
-13FF5A1207001FEBFFFEB6FCA40001EBC000B3151FA96CEBE03EA2017F137EECF8FC9038
-3FFFF86D13F0010713E001001380203B7EB929>I<D9FF80EB0FF8B5EB0FFFA50007EC00
-7F6C153FB3A5167FA316FF6C5C4B7F6C903AC007DFFFE09138F01F9F6DB5121F6D13FE01
-0F13F8010101E0EBE000332A7CA83A>I<B500FC90383FFFC0A5000101C0903803E0006E
-1307A26C5E6E130F017F5D6E131F013F92C7FC6E5B011F143E6E137E010F147C6E13FCA2
-6D5C15816D5C15C36D5C15E76D5C15FF6E5BA36E90C8FCA26E5AA26E5AA26E5AA26E5AA2
-32287EA737>I<B53CFC3FFFFC03FFFEA50003D980009039C0000F806E161F6C037F1500
-6E496C5B6C183E836E48157E017F177C6E486D13FC013F02EF5C83DAFC071401011F02C7
-5CDAFE0FEBFE03010F02835C17FFDAFF1F14076D02015C03BF148F6DD9BE005C18CF03FE
-14DF6D49017F90C7FC18FF6D496D5AA36E486D5AA26E486D5AA36E486D5AA26E486D5A47
-287EA74C>I<B5D8FC03B51280A5C69026E0007FC7FC6E13FE6D6C5B6D6C485A6D6C485A
-010F13076D6C485AED9FC06DEBFF806D91C8FC6D5B6E5AA2143F6E7E140F814A7F4A7F4A
-7F02FE7F903801FC7F49486C7E02F07F49486C7E49486C7E011F7F49486C7FD97F008001
-FE6D7FB5D8C007EBFFC0A532287EA737>I<B500FC90383FFFC0A5000101C0903803E000
-6E1307A26C5E6E130F017F5D6E131F013F92C7FC6E5B011F143E6E137E010F147C6E13FC
-A26D5C15816D5C15C36D5C15E76D5C15FF6E5BA36E90C8FCA26E5AA26E5AA26E5AA26E5A
-A35D14075D000E130FD83F805B387FC01FD8FFE090C9FC5C143E147E5CEBC1F8387FC3F0
-387E0FE06CB45A6C5B6C48CAFCEA03F8323B7EA737>I E
+B6C7FC6C14FC6C14F06D13C0D90FFEC8FC2B3D7CBB34>I<16FCA24B7EA24B7EA34B7FA2
+4B7FA34B7FA24B7FA34B7F157C03FC7FEDF87FA2020180EDF03F0203804B7E02078115C0
+82020F814B7E021F811500824A81023E7F027E81027C7FA202FC814A147F49B77EA34982
+A2D907E0C7001F7F4A80010F835C83011F8391C87E4983133E83017E83017C81B500FC91
+B612FCA5463F7CBE4F>65 D<B812F8EFFF8018F018FC8426003FFCC7EA3FFF050F138071
+13C07113E08319F0A27113F8A719F05FA24D13E019C04D13804D1300EF3FFE933801FFF8
+91B712E0188018F818FE02FCC7380FFF80050313C07113E07113F019F8F07FFCA2F03FFE
+A219FFA38460A419FE187FA2F0FFFC4D13F85F4D13F0053F13E0BA12C0190018FC18F095
+C7FC403E7DBD4A>I<922607FFC0130E92B500FC131E020702FF133E023FEDC07E91B7EA
+E1FE01039138803FFB499039F80003FF4901C01300013F90C8127F4948151FD9FFF8150F
+48491507485B4A1503481701485B18004890CAFC197E5A5B193E127FA349170012FFAC12
+7F7F193EA2123FA27F6C187E197C6C7F19FC6C6D16F86C6D150119F06C6D15036C6DED07
+E0D97FFEED0FC06D6CED3F80010F01C0ECFF006D01F8EB03FE6D9039FF801FFC010091B5
+5A023F15E002071580020002FCC7FC030713C03F407ABE4C>I<B812F8EFFF8018F018FC
+18FF26003FFCC76C13C005077F05017F716C7E727E727E727E721380A27213C0A27213E0
+A21AF084A21AF8A41AFCA5197FA319FFA51AF8A41AF0A2601AE0A24E13C0A24E13804E13
+00604E5A4E5A4D485A050713E0057F5BBA5A4EC7FC18F818C005F8C8FC463E7DBD50>I<
+BAFCA4198026003FFEC7123F1707170183183FA2181FF00FC0A31807EE07C0A3F003E0A3
+160F95C7FC161F163F16FF91B6FCA54AC6FC163F161F040F147CA2160719F8A593C71201
+A219F01803A21807A2180FF01FE0183F18FF1703173FBAFCA219C0A33E3D7DBC45>I<B9
+12FEA48426003FFEC77E170F1703170084A284F01F80A3180FA2EE07C0A2F007C0A4040F
+90C7FCA2161F163F16FF91B6FCA54AC6FC163F161F160FA21607A693C9FCACB712E0A53A
+3D7DBC42>I<922607FFC0130E92B500FC131E020702FF133E023FEDC07E91B7EAE1FE01
+039138803FFB499039F80003FF4901C01300013F90C8127F4948151FD9FFF8150F484915
+07485B4A1503481701485B18004890CAFC197E5A5B193E127FA34994C7FC12FFAB0407B6
+12FC127F7FA3003F92C7383FFE00A27F7EA26C7FA26C7F6C7FA26C7F6C7FD97FFE157F6D
+6C7E010F01E014FF6D01F813036D9038FF801F010091B512F3023F15C00207ED803E0200
+9138FE000E030701E090C7FC46407ABE52>I<B71280A526003FFEC7FCB3B3B0B71280A5
+213E7DBD28>73 D<B6037FB512E0A2818181D8003F6D9139001F800081A281816E7E6E7F
+6E7F80826E7F6E7F6E7F6E7F157F826F7F6F7F6F7F6F7F81836F7F6F7F707E701380A270
+13C07013E07013F07013F87013FCA27013FEEF7FFF71139F7113DF8319FF8383838384A2
+8484848484A284B600C080197F193F191FA24B3E7DBD52>78 D<ED3FFF0203B512F0021F
+14FE027F6E7E902701FFF80713E00107D9C00013F84990C7EA3FFCD93FFCEC0FFF49486E
+7F49486E7F48496E7F4A80488448496F7EA24890C96C7E4884A249161F003F84A3484870
+1380A400FF19C0AD007F19806D5EA3003F1900A26D5E6C60A26C6D4B5AA26C6D4B5A6C6D
+4A5BA26C6D4A5B6C6D4A5B6D6C4A5B6DB4023F90C7FC6D01C0EBFFFE0107D9F80713F801
+0190B612E06D5E021F4AC8FC020314F0DA003F90C9FC42407ABE4F>I<B812F017FF18C0
+18F018FC26003FFCC77FEF1FFF7113807113C07113E0A27113F0A319F8A819F0A34D13E0
+19C05F4D1380053F1300EFFFFE91B712F860188005FCC7FC4ACAFCB3A4B77EA53D3E7DBD
+47>I<B87E17FCEFFF8018F08428003FFC000113FE9338003FFF050F7F717F717FA28583
+85A761A25F61614D5B4D90C8FCEF3FFE4CB45A91B712F018C04DC9FC717E9126FC000F7F
+040113F0707F717EA2717EA2717EA685A6F207C019C0A271140F07E01380B76DEBF01F71
+9038FC3F007190B5FC716C5B061F13F8CB000113E04A3F7DBD4E>82
+D<903A03FFC001C0011FEBF803017FEBFE0748B6128F4815DF48010013FFD80FF8130F48
+481303497F4848EB007F127F49143F161F12FF160FA27F1607A27F7F01FC91C7FCEBFF80
+6C13F8ECFFC06C14FCEDFF806C15E016F86C816C816C816C16806C6C15C07F010715E0EB
+007F020714F0EC003F1503030013F8167F163F127800F8151FA2160FA27EA217F07E161F
+6C16E06D143F01E015C001F8EC7F8001FEEB01FF9026FFE00713004890B55A486C14F8D8
+F81F5CD8F00314C027E0003FFEC7FC2D407ABE3A>I<003FB912FCA5903BFE003FFE003F
+D87FF0EE0FFE01C0160349160190C71500197E127EA2007C183EA400FC183F48181FA5C8
+1600B3AF010FB712F8A5403D7CBC49>I<B76C90B61280A526003FFEC9003EC7FCB3B3A4
+197E011F177C80A26D17FC616D6D14014E5A6D6D4A5A6D6D140F6D01F8EC3FC0DA7FFEEC
+FF8091273FFFC00F90C8FC020F90B512FC02035D020015E0031F1480030101F8C9FC493F
+7DBD50>I<903807FFC0013F13F848B6FC48812607FE037F260FF8007F6DEB3FF0486C80
+6F7EA36F7EA26C5A6C5AEA01E0C8FC153F91B5FC130F137F3901FFFE0F4813E0000F1380
+381FFE00485A5B485A12FF5BA4151F7F007F143F6D90387BFF806C6C01FB13FE391FFF07
+F36CEBFFE100031480C6EC003FD91FF890C7FC2F2B7DA933>97 D<13FFB5FCA512077EAF
+EDFFE0020713FC021FEBFF80027F80DAFF8113F09139FC003FF802F06D7E4A6D7E4A1307
+4A80701380A218C082A318E0AA18C0A25E1880A218005E6E5C6E495A6E495A02FCEB7FF0
+903AFCFF01FFE0496CB55AD9F01F91C7FCD9E00713FCC7000113C033407DBE3A>I<EC7F
+F00107B5FC011F14C0017F14E09039FFF01FF0489038800FF848EB001F4848EB3FFC120F
+485AA2485AA2007FEC1FF849EB0FF0ED03C000FF91C7FCAB127F7FA3003F153E7F001F15
+7E6C6C147C6C6C14FC91388001F86C9038C003F0C69038F81FE06DB512C0011F14800107
+EBFE009038007FF0272B7DA92E>I<EE07F8ED07FFA5ED003F161FAFEC7FF0903807FFFE
+011FEBFF9F017F14DF9039FFF01FFF48EBC00348EB00014848EB007F485A001F153F5B12
+3FA2127F5BA212FFAA127FA37F123FA26C6C147F120F6D14FF6C6C01037F6C6D48EBFFE0
+6CEBF03F6C6CB512BF6D143F010713FC010001E0EBE00033407DBE3A>I<ECFFF0010713
+FE011F6D7E017F809039FFE07FE0489038801FF048496C7E48486D7E48486D7E121F4913
+01003F81A2485A6F1380A212FFA290B7FCA401F0C9FCA5127FA27F123FEE0F806C7E161F
+6C6C15006C6C5C6C6D137E6C9038E001FC6C9038F80FF8013FB55A6D14C0010391C7FC90
+38007FF8292B7DA930>I<EC07FE91387FFF8049B512C0010714E090390FFE3FF0EB1FF0
+90393FE07FF8EB7FC013FF1480A2489038003FF0ED1FE0ED0FC092C7FCAAB612E0A50001
+0180C7FCB3AC007FEBFF80A525407DBF20>I<903A03FF8007F0013F9038F83FF8499038
+FCFFFC48B712FE48018313F93A07FC007FC34848EB3FE1001FEDF1FC4990381FF0F81700
+003F81A7001F5DA26D133F000F5D6C6C495A3A03FF83FF8091B5C7FC4814FC01BF5BD80F
+03138090CAFCA2487EA27F13F06CB6FC16F016FC6C15FF17806C16C06C16E01207001F16
+F0393FE000034848EB003F49EC1FF800FF150F90C81207A56C6CEC0FF06D141F003F16E0
+01F0147FD81FFC903801FFC02707FF800F13006C90B55AC615F8013F14E0010101FCC7FC
+2F3D7DA834>I<13FFB5FCA512077EAFED1FF8EDFFFE02036D7E4A80DA0FE07F91381F00
+7F023C805C4A6D7E5CA25CA35CB3A4B5D8FE0FB512E0A5333F7CBE3A>I<EA01F8487E48
+7E487E481380A66C13006C5A6C5A6C5AC8FCA913FFB5FCA512077EB3ABB512F8A515407C
+BF1D>I<13FFB5FCA512077EB3B3AFB512FCA5163F7CBE1D>108 D<01FFD91FF8ECFFC0B5
+90B5010713F80203DAC01F13FE4A6E487FDA0FE09026F07F077F91261F003FEBF8010007
+013EDAF9F0806C0178ECFBC04A6DB4486C7FA24A92C7FC4A5CA34A5CB3A4B5D8FE07B5D8
+F03FEBFF80A551297CA858>I<01FFEB1FF8B5EBFFFE02036D7E4A80DA0FE07F91381F00
+7F0007013C806C5B4A6D7E5CA25CA35CB3A4B5D8FE0FB512E0A533297CA83A>I<EC7FF0
+903803FFFE011FEBFFC0017F14F09039FFE03FF8489038800FFC3A03FE0003FE48486D7E
+000F168048486D13C0A2003F16E049147F007F16F0A400FF16F8AA007F16F0A46C6CECFF
+E0A2001F16C06C6C491380A26C6C4913003A03FF800FFE6C9038E03FFC6C6CB512F0011F
+14C0010791C7FC9038007FF02D2B7DA934>I<01FFEBFFE0B5000713FC021FEBFF80027F
+80DAFF8113F09139FC007FF8000701F06D7E6C496D7E4A130F4A6D7E1880A27013C0A382
+18E0AA4C13C0A318805E18005E6E5C6E495A6E495A02FCEBFFF0DAFF035B92B55A029F91
+C7FC028713FC028113C00280C9FCACB512FEA5333B7DA83A>I<3901FE01FE00FF903807
+FF804A13E04A13F0EC3F1F91387C3FF8000713F8000313F0EBFFE0A29138C01FF0ED0FE0
+91388007C092C7FCA391C8FCB3A2B6FCA525297DA82B>114 D<90383FFC1E48B512BE00
+0714FE5A381FF00F383F800148C7FC007E147EA200FE143EA27E7F6D90C7FC13F8EBFFE0
+6C13FF15C06C14F06C806C806C806C80C61580131F1300020713C014000078147F00F814
+3F151F7EA27E16806C143F6D140001E013FF9038F803FE90B55A15F0D8F87F13C026E00F
+FEC7FC222B7DA929>I<EB07C0A5130FA4131FA3133F137FA213FF5A1207001FEBFFFEB6
+FCA40001EBC000B3151FA96CEBE03EA2017F137EECF8FC90383FFFF86D13F0010713E001
+001380203B7EB929>I<D9FF80EB0FF8B5EB0FFFA50007EC007F6C153FB3A5167FA316FF
+6C5C4B7F6C903AC007DFFFE09138F01F9F6DB5121F6D13FE010F13F8010101E0EBE00033
+2A7CA83A>I<B500FC90383FFFC0A5000101C0903803E0006E1307A26C5E6E130F017F5D
+6E131F013F92C7FC6E5B011F143E6E137E010F147C6E13FCA26D5C15816D5C15C36D5C15
+E76D5C15FF6E5BA36E90C8FCA26E5AA26E5AA26E5AA26E5AA232287EA737>I<B5D8FC03
+B51280A5C69026E0007FC7FC6E13FE6D6C5B6D6C485A6D6C485A010F13076D6C485AED9F
+C06DEBFF806D91C8FC6D5B6E5AA2143F6E7E140F814A7F4A7F4A7F02FE7F903801FC7F49
+486C7E02F07F49486C7E49486C7E011F7F49486C7FD97F008001FE6D7FB5D8C007EBFFC0
+A532287EA737>120 D<B500FC90383FFFC0A5000101C0903803E0006E1307A26C5E6E13
+0F017F5D6E131F013F92C7FC6E5B011F143E6E137E010F147C6E13FCA26D5C15816D5C15
+C36D5C15E76D5C15FF6E5BA36E90C8FCA26E5AA26E5AA26E5AA26E5AA35D14075D000E13
+0FD83F805B387FC01FD8FFE090C9FC5C143E147E5CEBC1F8387FC3F0387E0FE06CB45A6C
+5B6C48CAFCEA03F8323B7EA737>I E
 %EndDVIPSBitmapFont
 %DVIPSBitmapFont: Fi cmr10 10.95 93
 /Fi 93 124 df<4AB4EB0FE0021F9038E03FFC913A7F00F8FC1ED901FC90383FF03FD907
@@ -1547,64 +1547,64 @@ FFF8A32D277FA630>I<B539E00FFFE0A32707FE000313006C48EB01FC6F5A00015D7F00
 FF005A5B484813071207491400485A48485BA248485B4848137F00FF495A90B6FCA22127
 7EA628>I<B812F0A22C0280982D>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fj cmr12 14.4 15
-/Fj 15 117 df<120FEA3FC0EA7FE0EAFFF0A6EA7FE0EA3FC0EA0F000C0C768B21>46
+%DVIPSBitmapFont: Fj cmr12 14.4 16
+/Fj 16 122 df<120FEA3FC0EA7FE0EAFFF0A6EA7FE0EA3FC0EA0F000C0C768B21>46
 D<EC1FF891B5FC010314C090390FF81FF090391FC003F849486C7E017EC7127E49800001
 168049141F4848EC0FC0000716E0491407000F16F0A34848EC03F8A2003F16FCA44848EC
 01FEA700FF16FFB3A5007F16FEA56D1403A2003F16FCA4001F16F8A26D1407000F16F0A2
 6C6CEC0FE0A26C6CEC1FC0A26C6CEC3F806C6CEC7F00017F14FE6D6C485A6D6C485A9039
-0FF81FF00103B512C0010091C7FCEC1FF830517BCE3B>48 D<14075C5C147F5C1307133F
-000FB5FCB6FC13F913C1EAF0011200B3B3B3A7497F010F13E0B712FEA4274F75CE3B>I<
-EC7FE0903803FFFE010F6D7E013F14E0D9FF0013F8D801F8EB1FFCD803E06D7E4848EB03
-FF48486D138090C813C0001E16E0001C157F003CED3FF012380078ED1FF81270A2B4ED0F
-FC13C07FA66C5A6C5A000EC8FCC9EA1FF8A317F0163FA2EE7FE017C016FF17804B1300A2
-4B5A4B5A5E4B5A4B5A4B5A5E4BC7FC15FE4A5A4A5A4A5A4A5A5D4A5A4AC8FC147E5C4948
-141CEB03E0495A4948143891C8FC131E5B5B491578485A48481570484815F048B7FCA25A
-5A5AB812E0A42E4F7ACE3B>I<EE7FF80307B57E033F14F09239FFC00FFC913A03FE0001
-FFDA0FF89038007FC0DA3FE0EC1FF0DA7F80EC07F84AC86C7E49486F7E49486F7E494870
-7E4948707E4948707E4948707E017F844948707E91CA120348854848717EA24848711380
-A2000F1AC049187F001F1AE0A34848F03FF0A3007F1AF8A249181FA300FF1AFCAE6C6CF0
-3FF8A5003F1AF06D187FA2001F1AE0A26D18FF000F1AC0A26C6C4D1380A200031A006D5F
-6C616C6D4C5A6E160F017F606D6C4C5A6D6C4C5AA26D6C4C5A6D6C4C5A6D6C4B90C7FCD9
-00FFED03FCDA7FC0EC0FF86E6C4A5ADA0FF8EC7FC0DA03FE4948C8FC913A00FFC00FFC03
-3FB512F0030714809226007FF8C9FC4E567AD35B>79 D<B600FC030FB512E0A4C691CAEB
-FC00D97FFCEF3FF06D48EF1FC0011F616E71C7FC130F1A0E6E171E0107181CA26E173C6D
-1838816D60A26F16F06D6081027F4C5AA281023F4C5AA26F1507021F94C8FC81020F160E
-A26F151E0207161CA26F153C6E1638826E5EA27014F06E5E821801037F5D82033F4A5AA2
-701307031F92C9FC82030F140EA270131E0307141CA270133C6F143817806F5CA2EFC0F0
-6F5C17E017E1047F5B17F193383FF380A217FF7090CAFCA2705AA3705AA3705AA2705AA3
-705A53547ED158>86 D<EB7F80B5FCA41203C6FC137FB3A6ED07FC92387FFF800281B512
-E0913987F00FF891398F8001FC029EC7B4FC02BC6E7E02F86E7E4A6E7E4A6E7E4A140784
-4A6E7EA2841701A284A283A21980AB19005FA360A24D5AA24D5A804D5A6E5D6E4A5AD97E
-784A5A6E4AC7FCD97C1EEB01FE6E495A903A7807E01FF00201B512C0902670007F90C8FC
-90C7EA0FF839547DD241>98 D<EC0FFE91387FFFE049B512F8903907F801FE90391FE000
-1FD93F80EB078049C7EA0FC001FE143F484815E00003157F485A485AA2485AEE3FC0003F
-ED0F004991C7FCA2127FA35B12FFAB127F7FA3123F6D1570121F6D15F0000F16E06D1401
-12076C6CEC03C06D15806C6C14076C6DEB0F00D93FC0131E6D6C137C903907FC03F06DB5
-5AD9007F1380DA0FF8C7FC2C367CB434>I<EC0FF891B5FC010314C090390FF80FF09039
-1FC003FC90397F8001FE49C77E4848EC7F804848143F49EC1FC0485A000FED0FE05B001F
-16F01607485AA2007F16F8A25B160312FF90B7FCA30180C9FCA8127F7FA2123FA26D1538
-121F17786C6C1570000716F06D15E06C6C14016C6CEC03C06C6C15806D6C130F6D6CEB1F
-00D90FF0133C903907FE01F80101B512E06D6C1380DA07FCC7FC2D367DB434>101
-D<1378EA01FE487E487FA66C90C7FC6C5AEA007890C8FCB0EB7F80B5FCA41203C6FC137F
-B3B3A43801FFE0B61280A419507CCF21>105 D<01FFEB07FCB590383FFF8092B512E091
-3901F00FF8913903C007FC000349C66C7EC6010E13016D486D7E5C143002706E7E146014
-E05CA35CB3AD2601FFE0903801FFE0B600C0B612C0A43A347CB341>110
-D<EC0FFC91387FFF8049B512E0903907F807F890391FE001FE90393F80007F017EC7EA1F
-80496E7E48486E7E00038248486E7EA248486E7EA248486E7EA2003F82A24848ED7F80A4
-00FF17C0AB007F1780A26D15FFA2003F1700A2001F5E6D1401000F5E6D140300075E6C6C
-4A5A6C6C4A5AA2D8007FEC3F806D6C49C7FC90391FE001FE903907F807F86DB55AD9007F
-1380DA0FFCC8FC32367CB43B>I<01FFEB1F80B5EB7FF0913801FFF8913803E1FC913807
-83FE0003EB0F07C6131EEB7F1C1438143091387003FC91386000F0160014E05CA45CB3AA
-8048487EB612F0A427347DB32E>114 D<D907FE13C090387FFF8148B512E33907F803FF
-390FC0007F4848133F48C7121F003E140F007E1407127C00FC1403A315017EA27E7F6C6C
-90C7FC13F013FF6C13F86CEBFF806C14E06C14F86C14FEC680013F1480010714C0D9003F
-13E014039138007FF0151F00E0140FED07F8A26C1403A215017EA36C15F0A26C14036C15
-E015076DEB0FC06DEB1F80D8FDF0EB3F0039F8FC01FE39F07FFFF8D8E01F13E0D8C00390
-C7FC25367CB42E>I<EB01C0A71303A41307A3130FA2131FA2133F137F13FF5A5A001F90
-B512E0B7FCA326003FC0C7FCB3A71638AC6E1378011F1470A26D6C13F016E0903807F801
-903903FC03C0903901FE07806DB51200EC3FFCEC07F0254B7EC92E>I
-E
+0FF81FF00103B512C0010091C7FCEC1FF830517BCE3B>48 D<EC7FE0903803FFFE010F6D
+7E013F14E0D9FF0013F8D801F8EB1FFCD803E06D7E4848EB03FF48486D138090C813C000
+1E16E0001C157F003CED3FF012380078ED1FF81270A2B4ED0FFC13C07FA66C5A6C5A000E
+C8FCC9EA1FF8A317F0163FA2EE7FE017C016FF17804B1300A24B5A4B5A5E4B5A4B5A4B5A
+5E4BC7FC15FE4A5A4A5A4A5A4A5A5D4A5A4AC8FC147E5C4948141CEB03E0495A49481438
+91C8FC131E5B5B491578485A48481570484815F048B7FCA25A5A5AB812E0A42E4F7ACE3B
+>50 D<160F5EA25E5EA25E5DA25D5DA25D151E151C153C5D157015F04A5A5D14035D4A5A
+5C140E5C143C14385C14F05C495A13035C130749C7FC130E131E5B133813785B5B120148
+5A5B120748C8FC120E121E5A123812785AB912F0A4C8000190C7FCAF4B7F4B7F020FB612
+E0A434507DCF3B>52 D<000316C001C0140301F8141F903AFFC003FF8091B612005E5E5E
+16E016804BC7FC019F13F8018113800180C9FCB0EC0FF0ECFFFE01836D7E903987F01FE0
+90399F0007F801BE6D7E01F86D7E496D7E49EC7F805BEE3FC04915E0C9121F17F0A317F8
+160FA317FCA5120EEA3F80487E12FF7FA217F85B161F5B48C813F012700078ED3FE0A26C
+16C0167F6CEDFF80001F16006C6C495A6C6C13036C6CEB07F8D801F8EB1FF06CB4EB7FE0
+6DB51280011F49C7FC010713F8010013C02E517ACE3B>I<49B612FEA490C7003F138092
+380FFE001507B3B3B3A21206EA3FC0487E487EA44B5AA25B007F5D0180131F0078C75B6C
+143F003E4A5A6C5D6C6C495A2707E003FEC7FC3901FC07FC6CB512F0013F13C0D907FCC8
+FC2F547BD13C>74 D<B600FC030FB512E0A4C691CAEBFC00D97FFCEF3FF06D48EF1FC001
+1F616E71C7FC130F1A0E6E171E0107181CA26E173C6D1838816D60A26F16F06D6081027F
+4C5AA281023F4C5AA26F1507021F94C8FC81020F160EA26F151E0207161CA26F153C6E16
+38826E5EA27014F06E5E821801037F5D82033F4A5AA2701307031F92C9FC82030F140EA2
+70131E0307141CA270133C6F143817806F5CA2EFC0F06F5C17E017E1047F5B17F193383F
+F380A217FF7090CAFCA2705AA3705AA3705AA2705AA3705A53547ED158>86
+D<EC0FF891B5FC010314C090390FF80FF090391FC003FC90397F8001FE49C77E4848EC7F
+804848143F49EC1FC0485A000FED0FE05B001F16F01607485AA2007F16F8A25B160312FF
+90B7FCA30180C9FCA8127F7FA2123FA26D1538121F17786C6C1570000716F06D15E06C6C
+14016C6CEC03C06C6C15806D6C130F6D6CEB1F00D90FF0133C903907FE01F80101B512E0
+6D6C1380DA07FCC7FC2D367DB434>101 D<1378EA01FE487E487FA66C90C7FC6C5AEA00
+7890C8FCB0EB7F80B5FCA41203C6FC137FB3B3A43801FFE0B61280A419507CCF21>105
+D<EB7F80B5FCA41203C6FC137FB3B3B3B13801FFE0B612C0A41A537CD221>108
+D<01FFEB07FCB590383FFF8092B512E0913901F00FF8913903C007FC000349C66C7EC601
+0E13016D486D7E5C143002706E7E146014E05CA35CB3AD2601FFE0903801FFE0B600C0B6
+12C0A43A347CB341>110 D<EC0FFC91387FFF8049B512E0903907F807F890391FE001FE
+90393F80007F017EC7EA1F80496E7E48486E7E00038248486E7EA248486E7EA248486E7E
+A2003F82A24848ED7F80A400FF17C0AB007F1780A26D15FFA2003F1700A2001F5E6D1401
+000F5E6D140300075E6C6C4A5A6C6C4A5AA2D8007FEC3F806D6C49C7FC90391FE001FE90
+3907F807F86DB55AD9007F1380DA0FFCC8FC32367CB43B>I<01FFEB1F80B5EB7FF09138
+01FFF8913803E1FC91380783FE0003EB0F07C6131EEB7F1C1438143091387003FC913860
+00F0160014E05CA45CB3AA8048487EB612F0A427347DB32E>114
+D<D907FE13C090387FFF8148B512E33907F803FF390FC0007F4848133F48C7121F003E14
+0F007E1407127C00FC1403A315017EA27E7F6C6C90C7FC13F013FF6C13F86CEBFF806C14
+E06C14F86C14FEC680013F1480010714C0D9003F13E014039138007FF0151F00E0140FED
+07F8A26C1403A215017EA36C15F0A26C14036C15E015076DEB0FC06DEB1F80D8FDF0EB3F
+0039F8FC01FE39F07FFFF8D8E01F13E0D8C00390C7FC25367CB42E>I<D97F80EC7F80B5
+91B5FCA400031503C61500017F157FB3AC17FFA35EA3013F5C6EEB077FA2011F020E7F6D
+6C011C13F06E0178EBFFC0903903FC01F06DB512E06D6C1380912607FC00EB80003A357C
+B341>117 D<B60103B51280A4000301F09039007FF800C601C0EC3FE0017FED1F8095C7
+FC133F6E141E131F171C6E143C010F15388001075DA26E14F001035D8001014A5AA26E13
+036D5D1580027F49C8FCA26F5A023F130E15E0021F5BA2EDF03C020F133815F802075BA2
+EDFCF002035B15FE6E6C5AA36E5BA26FC9FCA3153EA2151CA2153C153815781570A215F0
+5D14015DA2003E495A127F486C48CAFCA2140E141E495A6C5B007C5B383F03E06CB45A00
+075BD801FCCBFC394B7EB23E>121 D E
 %EndDVIPSBitmapFont
 %DVIPSBitmapFont: Fk cmbx12 17.28 21
 /Fk 21 118 df<F00FE04E7EA24E7EA34E7EA24E7EA34D7FA24D80A24D80A34D80A24D80
@@ -1694,8 +1694,8 @@ ED3FFEB60207B5FCA6C6EE00076D826D82B3B3A260A360A2607F60183E6D6D147E4E7F6D
 6D4948806D6DD907F0ECFF806D01FFEB3FE06D91B55A6E1500021F5C020314F8DA003F01
 8002F0C7FC51427BC05A>I E
 %EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fl cmbx12 24.88 39
-/Fl 39 122 df[<96380FFFFE060FB612E04DB712FC051F16FF94B912C0040784041F18
+%DVIPSBitmapFont: Fl cmbx12 24.88 40
+/Fl 40 122 df[<96380FFFFE060FB612E04DB712FC051F16FF94B912C0040784041F18
 F8047F9126FC001F7F4BB6008001017F030702F8C8EA3FFF4B02E0030F7F033F02804B7F
 4B49C9127F92B54893B57E4A02F05D4A4A4B804A4A5D4A4A84634A91C9FC4A5BA24A5B51
 80755C91B5FC5EA3755CA2755C755C755CE23FFEC8FCF40FF899CAFCAF083FB612FCBFFC
@@ -1900,276 +1900,329 @@ FCA25EA35EA45EB3B3AFB9D8E001B912C0A9725D77DC81>I<94381FFFF00407B612C004
 6E4D1480A26C1D006F5F6C646D6D4D5B6F94B5FC6D636D6D4C5C6D6E4B5C6D6E4B5C6D02
 F0031F5C6D6E4B91C7FC6D6C01FE92B512FC6ED9FFC001075C6E02FC017F5C020791B812
 C0020196C8FC6E6C17FC031F17F003031780DB007F03FCC9FC040715C0DC001F01F0CAFC
-675F7ADD74>I<DB7FC049B47E90B6021F13F8B7027F13FE4DB67E4D15E04D814D814D01
-077F94263FF00F7F94387FC01F4D48487FD8003F16000107DAC1FE491480EEC3FC6D5DEE
-C7F05F16CF5F16DF4D6D1400A204FFC76C5BA2735B4C6E5B735B070013C04C92C8FCA45E
-A65EB3B3AAB912FCA9515D79DC5F>114 D<92261FFFF814F80203B638C001FC023FEDFC
-0791B8121F010317FF130F013F9038F8001F4990C8FCD9FFF8153F4801E0150F48491503
-4849814890CAFC197F4848173F191F485AA2007F180FA31907487EA27FA28002E0705A6E
-93C8FC14FC14FF15F06CECFF8016FCEEFFF06CEEFF8018F06C17FE727E6C18E0856C18FC
-6C846C727E6C856D84011F846D841303010084023F83140F020183EC001FDB007F168016
-03DC000F15C01700183F060F14E0007F1703486C82727E857F85857FA2857F1BC07FA27F
-1B806D5F7F1B006E5E6E5F6E163F6E4C5A02FC4C5A6E03035B6E6C4A5B03F0023F5B03FF
-0107B55A01F991B7C7FCD9F07F16FCD9E01F16F0D9800716C0D9000193C8FC48D9003F14
-F8007C020349C9FC4B5F78DD5C>I[<ED03FEA81507A5150FA4151FA3153FA2157FA215FF
-A25CA25C5CA25C5C5C5C91B5FC13035B131F017F91B712F00007BAFCBBFCA7C74AC9FCB3
-B3AAF101FFB1616E17FE82A219076E17FC836EEE0FF871131F6E6EEB3FF071137F6E6EEB
-FFE06EDAFF0313C06E92B512806E1700033F5D6F5D03075D030015E0041F1480040001FC
-C7FC>72 132 124 258 90 I<DB0FF8F01FF0017FB594B6FCB74BB7FCA9D8003F94C77E
-0107190FA26D85B3B3B063A463A263A27F6398B6FCA26DF001FB7015036EEF07F3E00FE3
-806E6D151FE07FC314FF6E6D6CDAFF83EDFFC06E6E010313036E02FCEB3FFE6E91B612FC
-020017F86F16E0031F16800303EDFE00DB007F14F8040102C093C8FC725E77DC81>I<B9
-0303B7FCA9D8000702F8CA000FEBFE006D6E050013E0666D6E6164826D5090C7FC836E4F
-5AA26E6E4C5AA26E6E4C5AA26E6E5F1C3F836E4F5A836E4F5AA26E6E4B5BA26E6E4B90C8
-FCA26F6E5D1B07846F4D5A846F4D5AA26F6E4A5AA26F6E4A5AA26F6E5D1BFF846F4C5B84
-6F4C90C9FCA2706E485AA27002C05B1A0F7002E05B1A1F19F0704B5A19F8704B5AA2706E
-485AA2706E5B96B5FC7093CAFCA3715CA2715CA2715CA2715CA3715CA2715CA2715CA271
-91CBFCA2725AA3725A725A725A705D7BDB7B>I<007FB86C49B712FEA9C792C9000F02C0
-C7FC6E6E030101F0C8FC715F6E6E4B5B6E6E4B5B6E4E90C9FC6E6E5E71151F6E6E4B5A6E
-6E4B5A6E4E5A6F6E495B72495B6F6E495B6F806F6E4990CAFC6F4C5A72495A6F6E495A6F
-6E495A6F03815B705E7014C307E75B7091B5CBFC705D705D705D6282705D715C83867180
-71807180837180864D814D815F4D81874D814D81DDFFF3804C13E14C01C1804C0180814E
-6C804C6E804C487F4C48824C486D804C486D804B496D804B497F73804B49834B90C86C80
-4B486F804B48814B486F804B48844C6F804A71804A496F804A49814A90CA814A48718002
-3F7280010FB500E07080B8031FB812E0A9735C7CDB7B>120 D<007FB800C04AB71280A9
-D800034ACA000791C7FC6D080013F0775A6D6E4E5AA26E6E6064836E4F90C8FC836E4F5A
-836E4F5AA26E6E4C5AA26E6E5F1C3F6E6E5F1C7F836E4F5A846F4D5B846F4D90C9FCA26F
-6E4A5AA26F6E5D1B0F846F4D5A846F4D5A846F4D5AA26F6E4A5AA2706E5C627002C091CA
-FC6219E0704B5A19F0704B5AA2706E485AA2706E485AA27002FE5B1A7F19FF704B5AA271
-5DA27192CBFCA2715CA2715CA3715CA2715CA2715CA2715CA2725BA27290CCFCA3725AA2
-725AA24E5AA24E5AA261187FA24E5AA24D5B13FE2603FF804A90CDFC000F13E0486D4A5A
-487F486D4A5AA260B56C141F4D5AA24D5A17FF604C5B4A4990CEFC6C5D4C5A6C49EB3FFC
-4A495A6C4948485A9026FE80075B270FFFC03F5B6C90B6CFFC6C5D6C15F86C6C5C011F14
-C0010749D0FC9038007FE071857CDB7B>I E
+675F7ADD74>I<DB1FF091381FFFC0017FB50203B6FCB7021F15E095B712FC050316FF05
+0F17C0053F17F094B912FC04F1DAC01F8004F79026FC00018093B500E06D6C14C0D8003F
+93C86C8001074B030F8005F86F806D03E06F804D6F804D8194CA6C7F4C864C71805E7680
+A27680A27680A28B88A28BA288A28BA4882080B0200064A467A26467A3525CA267646764
+67647062704D91C7FC7094B55AA2714B5C714B5C714B5C05F84B5C71033F5C05FF4B91C8
+FC06C049B55A04FB01F001075C04F801FF017F14F07190B712C0051F94C9FC7116FC0503
+16F0DD007F1580060F02F8CAFC060049CBFC96CDFCB3ACB912E0A9718579DC81>I<DB7F
+C049B47E90B6021F13F8B7027F13FE4DB67E4D15E04D814D814D01077F94263FF00F7F94
+387FC01F4D48487FD8003F16000107DAC1FE491480EEC3FC6D5DEEC7F05F16CF5F16DF4D
+6D1400A204FFC76C5BA2735B4C6E5B735B070013C04C92C8FCA45EA65EB3B3AAB912FCA9
+515D79DC5F>114 D<92261FFFF814F80203B638C001FC023FEDFC0791B8121F010317FF
+130F013F9038F8001F4990C8FCD9FFF8153F4801E0150F484915034849814890CAFC197F
+4848173F191F485AA2007F180FA31907487EA27FA28002E0705A6E93C8FC14FC14FF15F0
+6CECFF8016FCEEFFF06CEEFF8018F06C17FE727E6C18E0856C18FC6C846C727E6C856D84
+011F846D841303010084023F83140F020183EC001FDB007F16801603DC000F15C0170018
+3F060F14E0007F1703486C82727E857F85857FA2857F1BC07FA27F1B806D5F7F1B006E5E
+6E5F6E163F6E4C5A02FC4C5A6E03035B6E6C4A5B03F0023F5B03FF0107B55A01F991B7C7
+FCD9F07F16FCD9E01F16F0D9800716C0D9000193C8FC48D9003F14F8007C020349C9FC4B
+5F78DD5C>I[<ED03FEA81507A5150FA4151FA3153FA2157FA215FFA25CA25C5CA25C5C5C
+5C91B5FC13035B131F017F91B712F00007BAFCBBFCA7C74AC9FCB3B3AAF101FFB1616E17
+FE82A219076E17FC836EEE0FF871131F6E6EEB3FF071137F6E6EEBFFE06EDAFF0313C06E
+92B512806E1700033F5D6F5D03075D030015E0041F1480040001FCC7FC>72
+132 124 258 90 I<DB0FF8F01FF0017FB594B6FCB74BB7FCA9D8003F94C77E0107190F
+A26D85B3B3B063A463A263A27F6398B6FCA26DF001FB7015036EEF07F3E00FE3806E6D15
+1FE07FC314FF6E6D6CDAFF83EDFFC06E6E010313036E02FCEB3FFE6E91B612FC020017F8
+6F16E0031F16800303EDFE00DB007F14F8040102C093C8FC725E77DC81>I<B90303B7FC
+A9D8000702F8CA000FEBFE006D6E050013E0666D6E6164826D5090C7FC836E4F5AA26E6E
+4C5AA26E6E4C5AA26E6E5F1C3F836E4F5A836E4F5AA26E6E4B5BA26E6E4B90C8FCA26F6E
+5D1B07846F4D5A846F4D5AA26F6E4A5AA26F6E4A5AA26F6E5D1BFF846F4C5B846F4C90C9
+FCA2706E485AA27002C05B1A0F7002E05B1A1F19F0704B5A19F8704B5AA2706E485AA270
+6E5B96B5FC7093CAFCA3715CA2715CA2715CA2715CA3715CA2715CA2715CA27191CBFCA2
+725AA3725A725A725A705D7BDB7B>I<007FB86C49B712FEA9C792C9000F02C0C7FC6E6E
+030101F0C8FC715F6E6E4B5B6E6E4B5B6E4E90C9FC6E6E5E71151F6E6E4B5A6E6E4B5A6E
+4E5A6F6E495B72495B6F6E495B6F806F6E4990CAFC6F4C5A72495A6F6E495A6F6E495A6F
+03815B705E7014C307E75B7091B5CBFC705D705D705D6282705D715C8386718071807180
+837180864D814D815F4D81874D814D81DDFFF3804C13E14C01C1804C0180814E6C804C6E
+804C487F4C48824C486D804C486D804B496D804B497F73804B49834B90C86C804B486F80
+4B48814B486F804B48844C6F804A71804A496F804A49814A90CA814A487180023F728001
+0FB500E07080B8031FB812E0A9735C7CDB7B>120 D<007FB800C04AB71280A9D800034A
+CA000791C7FC6D080013F0775A6D6E4E5AA26E6E6064836E4F90C8FC836E4F5A836E4F5A
+A26E6E4C5AA26E6E5F1C3F6E6E5F1C7F836E4F5A846F4D5B846F4D90C9FCA26F6E4A5AA2
+6F6E5D1B0F846F4D5A846F4D5A846F4D5AA26F6E4A5AA2706E5C627002C091CAFC6219E0
+704B5A19F0704B5AA2706E485AA2706E485AA27002FE5B1A7F19FF704B5AA2715DA27192
+CBFCA2715CA2715CA3715CA2715CA2715CA2715CA2725BA27290CCFCA3725AA2725AA24E
+5AA24E5AA261187FA24E5AA24D5B13FE2603FF804A90CDFC000F13E0486D4A5A487F486D
+4A5AA260B56C141F4D5AA24D5A17FF604C5B4A4990CEFC6C5D4C5A6C49EB3FFC4A495A6C
+4948485A9026FE80075B270FFFC03F5B6C90B6CFFC6C5D6C15F86C6C5C011F14C0010749
+D0FC9038007FE071857CDB7B>I E
 %EndDVIPSBitmapFont
 end
 %%EndProlog
 %%BeginSetup
 %%Feature: *Resolution 600dpi
 TeXDict begin
-%%PaperSize: A4
 
 %%EndSetup
 %%Page: 1 1
 1 0 bop 861 1940 a Fl(FITSIO)76 b(User's)g(Guide)356
 2399 y Fk(A)54 b(Subroutine)e(In)l(terface)h(to)g(FITS)h(F)-13
 b(ormat)53 b(Files)1055 2659 y(for)h(F)-13 b(ortran)53
-b(Programmers)1667 3155 y Fj(V)-10 b(ersion)38 b(2.1)1727
+b(Programmers)1667 3155 y Fj(V)-10 b(ersion)38 b(2.5)1727
 4058 y Fi(HEASAR)m(C)1764 4170 y(Co)s(de)30 b(662)1363
 4283 y(Go)s(ddard)f(Space)i(Fligh)m(t)f(Cen)m(ter)1522
-4396 y(Green)m(b)s(elt,)g(MD)i(20771)1857 4509 y(USA)1607
-5309 y Fj(Octob)s(er)38 b(2000)p eop
+4396 y(Green)m(b)s(elt,)g(MD)i(20771)1857 4509 y(USA)1704
+5298 y Fj(July)38 b(2004)p eop
 %%Page: 2 2
 2 1 bop 0 299 a Fi(ii)p eop
 %%Page: 3 3
-3 2 bop 0 1267 a Fl(Con)-6 b(ten)g(ts)0 1880 y Fh(1)84
-b(In)m(tro)s(duction)3136 b(1)0 2161 y(2)119 b(Creating)34
-b(FITSIO/CFITSIO)2405 b(3)136 2327 y Fi(2.1)94 b(Building)28
+3 2 bop 0 1267 a Fl(Con)-6 b(ten)g(ts)0 1858 y Fh(1)84
+b(In)m(tro)s(duction)3136 b(1)0 2118 y(2)119 b(Creating)34
+b(FITSIO/CFITSIO)2405 b(3)136 2280 y Fi(2.1)94 b(Building)28
 b(the)i(Library)57 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h
 (.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)f(.)131 b(3)136 2493 y(2.2)94 b(T)-8
+h(.)g(.)f(.)h(.)g(.)f(.)131 b(3)136 2442 y(2.2)94 b(T)-8
 b(esting)31 b(the)f(Library)i(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
 h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(5)136 2659
+(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(6)136 2604
 y(2.3)94 b(Linking)29 b(Programs)h(with)f(FITSIO)40 b(.)46
 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
 (.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(7)136
-2826 y(2.4)94 b(Getting)31 b(Started)g(with)e(FITSIO)55
+2766 y(2.4)94 b(Getting)31 b(Started)g(with)e(FITSIO)55
 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)
 f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131
-b(7)136 2992 y(2.5)94 b(Example)30 b(Program)86 b(.)46
+b(8)136 2928 y(2.5)94 b(Example)30 b(Program)86 b(.)46
 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
 (.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-f(.)131 b(7)136 3158 y(2.6)94 b(Legal)31 b(Stu\013)92
+f(.)131 b(8)136 3090 y(2.6)94 b(Legal)31 b(Stu\013)92
 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)
 h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(9)136 3324 y(2.7)94
+(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(9)136 3252 y(2.7)94
 b(Ac)m(kno)m(wledgemen)m(ts)60 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
 (.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)131 b(9)0 3605
-y Fh(3)119 b(A)35 b(FITS)f(Primer)2917 b(11)0 3886 y(4)119
-b(Extended)35 b(File)f(Name)g(Syn)m(tax)2330 b(13)136
-4052 y Fi(4.1)94 b(Ov)m(erview)83 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(10)0 3511
+y Fh(3)119 b(A)35 b(FITS)f(Primer)2917 b(13)0 3771 y(4)119
+b(Extended)35 b(File)f(Name)g(Syn)m(tax)2330 b(15)136
+3933 y Fi(4.1)94 b(Ov)m(erview)83 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h
 (.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
 g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(13)136 4218 y(4.2)94 b(Detailed)31 b(Filename)f(Syn)m(tax)61
-b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(15)345 4385 y(4.2.1)106 b(Filet)m(yp)s(e)52 b(.)45
+b(15)136 4095 y(4.2)94 b(Filet)m(yp)s(e)60 b(.)45 b(.)h(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)85 b(18)345 4257 y(4.2.1)106 b(Notes)32 b(ab)s(out)e(HTTP)g(pro)
+m(xy)g(serv)m(ers)k(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(18)345 4419 y(4.2.2)106 b(Notes)32 b(ab)s(out)e(the)h(ro)s(ot)f
+(\014let)m(yp)s(e)67 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(18)345 4581 y(4.2.3)106 b(Notes)32 b(ab)s(out)e(the)h(shmem)e
+(\014let)m(yp)s(e:)69 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(20)136 4742 y(4.3)94 b(Base)32 b(Filename)88 b(.)45
 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
 (.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)f(.)85 b(16)345 4551 y(4.2.2)106 b(Base)32 b(Filename)79
-b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
-(.)85 b(19)345 4717 y(4.2.3)106 b(Output)30 b(File)f(Name)i(when)f(Op)s
-(ening)e(an)i(Existing)f(File)71 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(20)345 4883 y(4.2.4)106
-b(T)-8 b(emplate)31 b(File)e(Name)j(when)d(Creating)h(a)h(New)f(File)47
-b(.)f(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(21)345 5049 y(4.2.5)106 b(HDU)31 b(Lo)s(cation)g(Sp)s(eci\014cation)
-36 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(25)345
-5215 y(4.2.6)106 b(age)32 b(Section)68 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(26)345
-5382 y(4.2.7)106 b(Column)29 b(and)h(Keyw)m(ord)g(Filtering)e(Sp)s
-(eci\014cation)80 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)f(.)85 b(27)345 5548 y(4.2.8)106 b(Ro)m(w)31
-b(Filtering)e(Sp)s(eci\014cation)71 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)f(.)85 b(28)345 5714 y(4.2.9)106 b(Binning)29
-b(or)h(Histogramming)g(Sp)s(eci\014cation)51 b(.)46 b(.)g(.)f(.)h(.)g
-(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(35)1912 5942 y(iii)p eop
+h(.)g(.)f(.)85 b(21)136 4904 y(4.4)94 b(Output)30 b(File)f(Name)i(when)
+f(Op)s(ening)e(an)i(Existing)f(File)79 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(23)136
+5066 y(4.5)94 b(T)-8 b(emplate)31 b(File)f(Name)h(when)e(Creating)h(a)h
+(New)f(File)55 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(24)136 5228 y(4.6)94
+b(HDU)32 b(Lo)s(cation)e(Sp)s(eci\014cation)45 b(.)g(.)h(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(24)136 5390 y(4.7)94
+b(Image)32 b(Section)38 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(25)136
+5552 y(4.8)94 b(Column)29 b(and)h(Keyw)m(ord)g(Filtering)e(Sp)s
+(eci\014cation)89 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(26)136 5714
+y(4.9)94 b(Ro)m(w)31 b(Filtering)e(Sp)s(eci\014cation)80
+b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(28)1912 5942 y(iii)p eop
 %%Page: 4 4
-4 3 bop 0 299 a Fi(iv)3310 b Fg(CONTENTS)0 555 y Fh(5)84
-b(FITSIO)34 b(Con)m(v)m(en)m(tions)h(and)g(Guidelines)1993
-b(39)136 717 y Fi(5.1)94 b(CFITSIO)29 b(Size)h(Limitations)39
+4 3 bop 0 299 a Fi(iv)3310 b Fg(CONTENTS)345 555 y Fi(4.9.1)106
+b(General)31 b(Syn)m(tax)44 b(.)i(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)
+f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(28)345 716 y(4.9.2)106
+b(Bit)31 b(Masks)43 b(.)j(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(30)345 876 y(4.9.3)106
+b(V)-8 b(ector)32 b(Columns)91 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)
+f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(31)345 1037 y(4.9.4)106
+b(Go)s(o)s(d)30 b(Time)g(In)m(terv)-5 b(al)30 b(Filtering)59
+b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(32)345 1197
+y(4.9.5)106 b(Spatial)29 b(Region)i(Filtering)56 b(.)46
+b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(33)345
+1358 y(4.9.6)106 b(Example)30 b(Ro)m(w)h(Filters)f(.)45
+b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(36)136 1518 y(4.10)80 b(Binning)28 b(or)i(Histogramming)g(Sp)s
+(eci\014cation)f(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(37)0
+1771 y Fh(5)f(T)-9 b(emplate)34 b(Files)2985 b(41)136
+1931 y Fi(5.1)94 b(Detailed)31 b(T)-8 b(emplate)30 b(Line)g(F)-8
+b(ormat)48 b(.)e(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(41)136 2092 y(5.2)94 b(Auto-indexing)29 b(of)i(Keyw)m(ords)73
+b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(42)136 2252 y(5.3)94 b(T)-8 b(emplate)31 b(P)m(arser)g(Directiv)m(es)
+85 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(43)136 2412 y(5.4)94 b(F)-8 b(ormal)31 b(T)-8 b(emplate)31
+b(Syn)m(tax)j(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
+h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
+(.)g(.)f(.)85 b(43)136 2573 y(5.5)94 b(Errors)63 b(.)46
+b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(44)136 2733 y(5.6)94
+b(Examples)71 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(44)0
+2986 y Fh(6)f(FITSIO)34 b(Con)m(v)m(en)m(tions)h(and)g(Guidelines)1993
+b(47)136 3146 y Fi(6.1)94 b(CFITSIO)29 b(Size)h(Limitations)39
 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
 g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(39)136 879 y(5.2)94 b(Multiple)29 b(Access)i(to)g(the)g(Same)f(FITS)g
-(File)f(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(40)136
-1041 y(5.3)94 b(Curren)m(t)30 b(Header)h(Data)h(Unit)d(\(CHDU\))87
+b(47)136 3307 y(6.2)94 b(Multiple)29 b(Access)i(to)g(the)g(Same)f(FITS)
+g(File)f(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(48)136
+3467 y(6.3)94 b(Curren)m(t)30 b(Header)h(Data)h(Unit)d(\(CHDU\))87
 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(40)136 1204
-y(5.4)94 b(Subroutine)28 b(Names)79 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(48)136 3628
+y(6.4)94 b(Subroutine)28 b(Names)79 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)
 g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
-(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(40)136
-1366 y(5.5)94 b(Subroutine)28 b(F)-8 b(amilies)30 b(and)f(Datat)m(yp)s
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(48)136
+3788 y(6.5)94 b(Subroutine)28 b(F)-8 b(amilies)30 b(and)f(Datat)m(yp)s
 (es)44 b(.)i(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(41)136
-1528 y(5.6)94 b(Implicit)28 b(Data)k(T)m(yp)s(e)e(Con)m(v)m(ersion)64
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(49)136
+3949 y(6.6)94 b(Implicit)28 b(Data)k(T)m(yp)s(e)e(Con)m(v)m(ersion)64
 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
 h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(41)136 1690 y(5.7)94 b(Data)32 b(Scaling)87 b(.)46
+b(49)136 4109 y(6.7)94 b(Data)32 b(Scaling)87 b(.)46
 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
 (.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)f(.)85 b(42)136 1852 y(5.8)94 b(Error)30
+f(.)h(.)g(.)f(.)85 b(50)136 4270 y(6.8)94 b(Error)30
 b(Status)g(V)-8 b(alues)31 b(and)e(the)i(Error)e(Message)j(Stac)m(k)44
 b(.)i(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)f(.)85 b(42)136 2014 y(5.9)94 b(V)-8 b(ariable-Length)31
+(.)g(.)f(.)85 b(50)136 4430 y(6.9)94 b(V)-8 b(ariable-Length)31
 b(Arra)m(y)f(F)-8 b(acilit)m(y)31 b(in)e(Binary)g(T)-8
 b(ables)25 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(43)136 2176 y(5.10)49
+(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(51)136 4591 y(6.10)49
 b(Supp)s(ort)29 b(for)h(IEEE)g(Sp)s(ecial)e(V)-8 b(alues)67
 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(44)136
-2338 y(5.11)49 b(When)31 b(the)f(Final)f(Size)h(of)h(the)f(FITS)g(HDU)h
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(52)136
+4751 y(6.11)49 b(When)31 b(the)f(Final)f(Size)h(of)h(the)f(FITS)g(HDU)h
 (is)e(Unkno)m(wn)34 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)
-f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(44)136 2500 y(5.12)49
+f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(53)136 4912 y(6.12)49
 b(Lo)s(cal)31 b(FITS)e(Con)m(v)m(en)m(tions)i(supp)s(orted)d(b)m(y)j
 (FITSIO)72 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(45)345 2662 y(5.12.1)61
+(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(53)345 5072 y(6.12.1)61
 b(Supp)s(ort)29 b(for)h(Long)g(String)f(Keyw)m(ord)h(V)-8
 b(alues.)61 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)f(.)85 b(45)345 2824 y(5.12.2)61
+h(.)g(.)f(.)h(.)g(.)f(.)85 b(53)345 5232 y(6.12.2)61
 b(Arra)m(ys)31 b(of)f(Fixed-Length)g(Strings)f(in)g(Binary)h(T)-8
 b(ables)69 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
-(.)f(.)85 b(46)345 2987 y(5.12.3)61 b(Keyw)m(ord)30 b(Units)g(Strings)i
+(.)f(.)85 b(54)345 5393 y(6.12.3)61 b(Keyw)m(ord)30 b(Units)g(Strings)i
 (.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
 (.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(47)345 3149 y(5.12.4)61 b(HIERAR)m(CH)31 b(Con)m(v)m(en)m(tion)g(for)
+b(55)345 5553 y(6.12.4)61 b(HIERAR)m(CH)31 b(Con)m(v)m(en)m(tion)g(for)
 f(Extended)g(Keyw)m(ord)g(Names)83 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)f(.)85 b(47)136 3311 y(5.13)49 b(Optimizing)28
+(.)h(.)g(.)f(.)85 b(55)136 5714 y(6.13)49 b(Optimizing)28
 b(Co)s(de)i(for)g(Maxim)m(um)g(Pro)s(cessing)g(Sp)s(eed)44
 b(.)i(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)f(.)85 b(48)345 3473 y(5.13.1)61 b(Bac)m(kground)31
-b(Information:)40 b(Ho)m(w)31 b(CFITSIO)e(Manages)j(Data)g(I/O)91
-b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(48)0 3734
-y Fh(6)119 b(The)35 b(CFITSIO)e(Iterator)g(F)-9 b(unction)2154
-b(53)0 3994 y(7)119 b(Basic)36 b(In)m(terface)e(Routines)2504
-b(55)136 4156 y Fi(7.1)94 b(FITSIO)30 b(Error)f(Status)h(Routines)83
-b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(55)136 4318 y(7.2)94 b(File)30 b(I/O)g(Routines)d(.)46
+(.)g(.)f(.)85 b(56)p eop
+%%Page: 5 5
+5 4 bop 0 299 a Fg(CONTENTS)3334 b Fi(v)345 555 y(6.13.1)61
+b(Bac)m(kground)31 b(Information:)40 b(Ho)m(w)31 b(CFITSIO)e(Manages)j
+(Data)g(I/O)91 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
+b(56)0 816 y Fh(7)119 b(The)35 b(CFITSIO)e(Iterator)g(F)-9
+b(unction)2154 b(61)0 1077 y(8)119 b(Basic)36 b(In)m(terface)e
+(Routines)2504 b(63)136 1239 y Fi(8.1)94 b(FITSIO)30
+b(Error)f(Status)h(Routines)83 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
+h(.)g(.)f(.)85 b(63)136 1401 y(8.2)94 b(File)30 b(I/O)g(Routines)d(.)46
 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
 (.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)f(.)85 b(56)136 4481 y(7.3)94 b(Keyw)m(ord)31 b(I/O)f(Routines)35
+g(.)f(.)85 b(64)136 1563 y(8.3)94 b(Keyw)m(ord)31 b(I/O)f(Routines)35
 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
 f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
-(.)85 b(57)136 4643 y(7.4)94 b(Data)32 b(I/O)f(Routines)52
+(.)85 b(66)136 1725 y(8.4)94 b(Data)32 b(I/O)f(Routines)52
 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
 h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)f(.)85 b(58)0 4903 y Fh(8)119 b(Adv)-6 b(anced)36
-b(In)m(terface)e(Subroutines)2159 b(61)136 5066 y Fi(8.1)94
+(.)g(.)f(.)85 b(66)0 1986 y Fh(9)119 b(Adv)-6 b(anced)36
+b(In)m(terface)e(Subroutines)2159 b(69)136 2148 y Fi(9.1)94
 b(FITS)30 b(File)g(Op)s(en)f(and)g(Close)h(Subroutines:)75
 b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(61)136 5228 y(8.2)94
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(69)136 2310 y(9.2)94
 b(HDU-Lev)m(el)32 b(Op)s(erations)107 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h
 (.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(64)136 5390
-y(8.3)94 b(De\014ne)31 b(or)f(Rede\014ne)g(the)h(structure)f(of)g(the)h
+g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(72)136 2472
+y(9.3)94 b(De\014ne)31 b(or)f(Rede\014ne)g(the)h(structure)f(of)g(the)h
 (CHDU)99 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
-(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(66)136 5552 y(8.4)94
+(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(75)136 2634 y(9.4)94
 b(FITS)30 b(Header)h(I/O)f(Subroutines)h(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h
 (.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)f(.)85 b(67)345 5714 y(8.4.1)106
+h(.)g(.)f(.)h(.)g(.)f(.)85 b(76)345 2796 y(9.4.1)106
 b(Header)31 b(Space)g(and)f(P)m(osition)f(Routines)59
 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)f(.)85 b(67)p eop
-%%Page: 5 5
-5 4 bop 0 299 a Fg(CONTENTS)3334 b Fi(v)345 555 y(8.4.2)106
+h(.)g(.)f(.)h(.)g(.)f(.)85 b(76)345 2958 y(9.4.2)106
 b(Read)31 b(or)f(W)-8 b(rite)31 b(Standard)e(Header)i(Routines)66
 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)f(.)85 b(68)345 715 y(8.4.3)106 b(W)-8 b(rite)31
+h(.)g(.)f(.)85 b(77)345 3120 y(9.4.3)106 b(W)-8 b(rite)31
 b(Keyw)m(ord)f(Subroutines)115 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f
 (.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)
-85 b(69)345 876 y(8.4.4)106 b(Insert)30 b(Keyw)m(ord)g(Subroutines)107
+85 b(78)345 3283 y(9.4.4)106 b(Insert)30 b(Keyw)m(ord)g(Subroutines)107
 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(71)345 1036
-y(8.4.5)106 b(Read)31 b(Keyw)m(ord)f(Subroutines)63 b(.)46
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(80)345 3445
+y(9.4.5)106 b(Read)31 b(Keyw)m(ord)f(Subroutines)63 b(.)46
 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h
-(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(72)345 1196
-y(8.4.6)106 b(Mo)s(dify)29 b(Keyw)m(ord)i(Subroutines)54
+(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(81)345 3607
+y(9.4.6)106 b(Mo)s(dify)29 b(Keyw)m(ord)i(Subroutines)54
 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(74)345 1356
-y(8.4.7)106 b(Up)s(date)31 b(Keyw)m(ord)f(Subroutines)115
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(82)345 3769
+y(9.4.7)106 b(Up)s(date)31 b(Keyw)m(ord)f(Subroutines)115
 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(75)345 1516
-y(8.4.8)106 b(Delete)32 b(Keyw)m(ord)e(Subroutines)86
+g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(83)345 3931
+y(9.4.8)106 b(Delete)32 b(Keyw)m(ord)e(Subroutines)86
 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)
-h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(75)136 1676
-y(8.5)94 b(Data)32 b(Scaling)e(and)f(Unde\014ned)g(Pixel)g(P)m
+h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(84)136 4093
+y(9.5)94 b(Data)32 b(Scaling)e(and)f(Unde\014ned)g(Pixel)g(P)m
 (arameters)113 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g
-(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(75)136 1836 y(8.6)94
+(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(84)136 4255 y(9.6)94
 b(FITS)30 b(Primary)f(Arra)m(y)i(or)f(IMA)m(GE)h(Extension)f(I/O)g
 (Subroutines)116 b(.)46 b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f
-(.)85 b(77)136 1997 y(8.7)94 b(FITS)30 b(ASCI)s(I)f(and)h(Binary)f(T)-8
+(.)85 b(85)136 4417 y(9.7)94 b(FITS)30 b(ASCI)s(I)f(and)h(Binary)f(T)-8
 b(able)30 b(Data)i(I/O)e(Subroutines)c(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f
-(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(80)345
-2157 y(8.7.1)106 b(Column)29 b(Information)g(Subroutines)120
+(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(88)345
+4579 y(9.7.1)106 b(Column)29 b(Information)g(Subroutines)120
 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)
-f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(80)345 2317 y(8.7.2)106
+f(.)h(.)g(.)f(.)h(.)g(.)f(.)85 b(88)345 4741 y(9.7.2)106
 b(Lo)m(w-Lev)m(el)32 b(T)-8 b(able)30 b(Access)h(Subroutines)59
 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
-h(.)g(.)f(.)h(.)g(.)f(.)85 b(82)345 2477 y(8.7.3)106
+h(.)g(.)f(.)h(.)g(.)f(.)85 b(91)345 4903 y(9.7.3)106
 b(Edit)30 b(Ro)m(ws)g(or)h(Columns)105 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g
 (.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
-g(.)f(.)h(.)g(.)f(.)85 b(83)345 2637 y(8.7.4)106 b(Read)31
+g(.)f(.)h(.)g(.)f(.)85 b(92)345 5066 y(9.7.4)106 b(Read)31
 b(and)f(W)-8 b(rite)30 b(Column)f(Data)j(Routines)65
 b(.)46 b(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
-f(.)h(.)g(.)f(.)85 b(84)136 2797 y(8.8)94 b(Ro)m(w)31
+f(.)h(.)g(.)f(.)85 b(93)136 5228 y(9.8)94 b(Ro)m(w)31
 b(Selection)f(and)g(Calculator)g(Routines)94 b(.)46 b(.)g(.)g(.)f(.)h
 (.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)
-g(.)f(.)85 b(87)136 2957 y(8.9)94 b(Celestial)30 b(Co)s(ordinate)f
+g(.)f(.)85 b(96)136 5390 y(9.9)94 b(Celestial)30 b(Co)s(ordinate)f
 (System)h(Subroutines)97 b(.)46 b(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
 (.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(89)136 3118 y(8.10)49 b(File)30 b(Chec)m(ksum)g(Subroutines)74
+b(98)136 5552 y(9.10)49 b(File)30 b(Chec)m(ksum)g(Subroutines)74
 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
 g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(90)136 3278 y(8.11)80 b(Date)32 b(and)d(Time)h(Utilit)m(y)f(Routines)
+b(99)136 5714 y(9.11)80 b(Date)32 b(and)d(Time)h(Utilit)m(y)f(Routines)
 68 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
-(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(91)136 3438 y(8.12)49 b(General)31 b(Utilit)m(y)e(Subroutines)60
-b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
-g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)85
-b(92)0 3689 y Fh(9)119 b(Summary)34 b(of)h(all)f(FITSIO)g(User-In)m
-(terface)h(Subroutines)1267 b(99)0 3940 y(10)67 b(P)m(arameter)34
-b(De\014nitions)2563 b(107)0 4191 y(11)67 b(FITSIO)33
-b(Error)i(Status)g(Co)s(des)2295 b(113)p eop
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40
+b(101)p eop
 %%Page: 6 6
-6 5 bop 0 299 a Fi(vi)3310 b Fg(CONTENTS)p eop
+6 5 bop 0 299 a Fi(vi)3310 b Fg(CONTENTS)136 555 y Fi(9.12)49
+b(General)31 b(Utilit)m(y)e(Subroutines)60 b(.)45 b(.)h(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)40 b(102)0 806 y Fh(10)67
+b(Summary)34 b(of)h(all)f(FITSIO)g(User-In)m(terface)h(Subroutines)1215
+b(109)0 1057 y(11)67 b(P)m(arameter)34 b(De\014nitions)2563
+b(117)0 1308 y(12)67 b(FITSIO)33 b(Error)i(Status)g(Co)s(des)2295
+b(123)p eop
 %%Page: 1 7
 1 6 bop 0 1225 a Ff(Chapter)65 b(1)0 1687 y Fl(In)-6
 b(tro)6 b(duction)0 2180 y Fi(This)32 b(do)s(cumen)m(t)j(describ)s(es)d
@@ -2179,50 +2232,54 @@ b(tro)6 b(duction)0 2180 y Fi(This)32 b(do)s(cumen)m(t)j(describ)s(es)d
 (companion)f(do)s(cumen)m(t)g(to)i(the)e(CFITSIO)0 2406
 y(User's)k(Guide)e(whic)m(h)h(should)e(b)s(e)i(consulted)g(for)g
 (further)g(information)f(ab)s(out)h(the)h(underlying)c(CFITSIO)0
-2518 y(library)-8 b(.)56 b(In)35 b(the)h(remainder)f(of)h(this)f(do)s
-(cumen)m(t,)j(the)e(terms)g(FITSIO)f(and)g(CFITSIO)g(are)h(in)m(terc)m
-(hangable)0 2631 y(and)30 b(refer)g(to)h(the)g(same)f(library)-8
+2518 y(library)-8 b(.)48 b(In)32 b(the)i(remainder)e(of)h(this)g(do)s
+(cumen)m(t,)h(the)g(terms)f(FITSIO)f(and)h(CFITSIO)f(are)i(in)m(terc)m
+(hangeable)0 2631 y(and)c(refer)g(to)h(the)g(same)f(library)-8
 b(.)0 2791 y(FITSIO/CFITSIO)31 b(is)i(a)g(mac)m(hine-indep)s(enden)m(t)
 e(library)g(of)j(routines)e(for)h(reading)g(and)g(writing)e(data)j
-(\014les)0 2904 y(in)26 b(the)i(FITS)e(\(Flexible)g(Image)i(T)-8
-b(ransp)s(ort)27 b(System\))g(data)h(format.)40 b(This)26
-b(library)f(w)m(as)j(written)e(to)i(pro)m(vide)f(a)0
-3017 y(p)s(o)m(w)m(erful)h(y)m(et)k(simple)27 b(in)m(terface)k(for)f
-(accessing)g(FITS)f(\014les)g(whic)m(h)g(will)e(run)h(on)i(most)h
-(commonly)e(used)g(com-)0 3130 y(puters)24 b(and)f(w)m(orkstations.)39
-b(FITSIO)24 b(supp)s(orts)e(all)h(the)i(features)g(describ)s(ed)d(in)h
-(the)i(o\016cial)f(NOST)f(de\014nition)0 3243 y(of)30
-b(the)g(FITS)g(format)g(and)f(can)i(read)f(and)f(write)g(all)g(the)h
-(curren)m(tly)f(de\014ned)g(t)m(yp)s(es)h(of)h(extensions,)e(including)
-0 3356 y(ASCI)s(I)36 b(tables)h(\(T)-8 b(ABLE\),)38 b(Binary)e(tables)h
-(\(BINT)-8 b(ABLE\))39 b(and)d(IMA)m(GE)j(extensions.)60
-b(The)37 b(FITSIO)f(sub-)0 3469 y(routines)d(insulate)f(the)i
-(programmer)f(from)g(ha)m(ving)g(to)i(deal)e(with)g(the)h(complicated)f
-(formatting)h(details)e(in)0 3582 y(the)e(FITS)g(\014le,)f(ho)m(w)m(ev)
-m(er,)j(it)d(is)h(assumed)f(that)i(users)e(ha)m(v)m(e)i(a)g(general)f
-(kno)m(wledge)g(ab)s(out)g(the)g(structure)g(and)0 3695
-y(usage)h(of)g(FITS)e(\014les.)0 3855 y(The)20 b(CFITSIO)f(pac)m(k)-5
-b(age)23 b(w)m(as)e(initially)d(dev)m(elop)s(ed)i(b)m(y)g(the)h(HEASAR)
-m(C)g(\(High)g(Energy)f(Astroph)m(ysics)g(Science)0 3968
-y(Arc)m(hiv)m(e)34 b(Researc)m(h)h(Cen)m(ter\))f(at)h(the)f(NASA)g(Go)s
-(ddard)e(Space)j(Fligh)m(t)e(Cen)m(ter)h(to)h(con)m(v)m(ert)g(v)-5
-b(arious)33 b(existing)0 4081 y(and)25 b(newly)g(acquired)g
-(astronomical)h(data)g(sets)h(in)m(to)f(FITS)f(format)h(and)f(to)i
-(further)e(analyze)h(data)h(already)e(in)0 4194 y(FITS)i(format.)41
-b(New)28 b(features)g(con)m(tin)m(ue)g(to)h(b)s(e)e(added)h(to)g
-(CFITSIO)f(in)f(large)i(part)g(due)g(to)g(con)m(tributions)f(of)0
-4307 y(ideas)32 b(or)h(actual)g(co)s(de)g(from)f(users)g(of)h(the)g
-(pac)m(k)-5 b(age.)49 b(The)33 b(In)m(tegral)g(Science)f(Data)i(Cen)m
-(ter)f(in)f(Switzerland,)0 4419 y(and)h(the)g(XMM/ESTEC)h(pro)5
-b(ject)34 b(in)e(The)h(Netherlands)f(made)h(esp)s(ecially)f
-(signi\014can)m(t)g(con)m(tributions)g(that)0 4532 y(resulted)d(in)g
-(man)m(y)i(of)f(the)h(new)f(features)g(that)h(app)s(eared)f(in)f(v2.0)j
-(of)e(CFITSIO.)0 4693 y(The)22 b(latest)h(v)m(ersion)f(of)h(the)f
-(CFITSIO)f(source)i(co)s(de,)h(do)s(cumen)m(tation,)h(and)c(example)i
-(programs)f(are)h(a)m(v)-5 b(ailable)0 4805 y(on)30 b(the)h(W)-8
-b(orld-Wide)30 b(W)-8 b(eb)31 b(or)f(via)g(anon)m(ymous)g(ftp)g(from:)
-382 5065 y Fe(http://heasarc.gsfc.nasa)o(.go)o(v/fi)o(tsio)382
-5178 y(ftp://legacy.gsfc.nasa.g)o(ov/)o(soft)o(ware)o(/fi)o(tsio)o(/c)
+(\014les)0 2904 y(in)29 b(the)h(FITS)g(\(Flexible)f(Image)i(T)-8
+b(ransp)s(ort)29 b(System\))h(data)h(format.)41 b(It)31
+b(can)f(also)g(read)h(IRAF)f(format)h(image)0 3017 y(\014les)39
+b(and)f(ra)m(w)i(binary)e(data)i(arra)m(ys)g(b)m(y)g(con)m(v)m(erting)g
+(them)f(on)h(the)g(\015y)f(in)m(to)g(a)h(virtual)e(FITS)h(format)h
+(\014le.)0 3130 y(This)31 b(library)g(w)m(as)i(written)f(to)i(pro)m
+(vide)e(a)i(p)s(o)m(w)m(erful)e(y)m(et)i(simple)d(in)m(terface)i(for)g
+(accessing)h(FITS)e(\014les)g(whic)m(h)0 3243 y(will)h(run)h(on)h(most)
+h(commonly)f(used)f(computers)h(and)g(w)m(orkstations.)56
+b(FITSIO)34 b(supp)s(orts)g(all)g(the)i(features)0 3356
+y(describ)s(ed)20 b(in)i(the)g(o\016cial)g(NOST)g(de\014nition)e(of)j
+(the)f(FITS)g(format)h(and)f(can)h(read)f(and)g(write)g(all)f(the)i
+(curren)m(tly)0 3469 y(de\014ned)40 b(t)m(yp)s(es)h(of)g(extensions,)i
+(including)38 b(ASCI)s(I)h(tables)i(\(T)-8 b(ABLE\),)42
+b(Binary)e(tables)h(\(BINT)-8 b(ABLE\))43 b(and)0 3582
+y(IMA)m(GE)36 b(extensions.)55 b(The)34 b(FITSIO)g(subroutines)f
+(insulate)h(the)h(programmer)g(from)g(ha)m(ving)g(to)h(deal)e(with)0
+3695 y(the)25 b(complicated)f(formatting)h(details)e(in)g(the)i(FITS)f
+(\014le,)h(ho)m(w)m(ev)m(er,)j(it)c(is)f(assumed)h(that)h(users)f(ha)m
+(v)m(e)i(a)f(general)0 3808 y(kno)m(wledge)30 b(ab)s(out)g(the)h
+(structure)f(and)g(usage)h(of)f(FITS)g(\014les.)0 3968
+y(The)20 b(CFITSIO)f(pac)m(k)-5 b(age)23 b(w)m(as)e(initially)d(dev)m
+(elop)s(ed)i(b)m(y)g(the)h(HEASAR)m(C)g(\(High)g(Energy)f(Astroph)m
+(ysics)g(Science)0 4081 y(Arc)m(hiv)m(e)34 b(Researc)m(h)h(Cen)m(ter\))
+f(at)h(the)f(NASA)g(Go)s(ddard)e(Space)j(Fligh)m(t)e(Cen)m(ter)h(to)h
+(con)m(v)m(ert)g(v)-5 b(arious)33 b(existing)0 4194 y(and)25
+b(newly)g(acquired)g(astronomical)h(data)g(sets)h(in)m(to)f(FITS)f
+(format)h(and)f(to)i(further)e(analyze)h(data)h(already)e(in)0
+4307 y(FITS)i(format.)41 b(New)28 b(features)g(con)m(tin)m(ue)g(to)h(b)
+s(e)e(added)h(to)g(CFITSIO)f(in)f(large)i(part)g(due)g(to)g(con)m
+(tributions)f(of)0 4419 y(ideas)32 b(or)h(actual)g(co)s(de)g(from)f
+(users)g(of)h(the)g(pac)m(k)-5 b(age.)49 b(The)33 b(In)m(tegral)g
+(Science)f(Data)i(Cen)m(ter)f(in)f(Switzerland,)0 4532
+y(and)h(the)g(XMM/ESTEC)h(pro)5 b(ject)34 b(in)e(The)h(Netherlands)f
+(made)h(esp)s(ecially)f(signi\014can)m(t)g(con)m(tributions)g(that)0
+4645 y(resulted)d(in)g(man)m(y)i(of)f(the)h(new)f(features)g(that)h
+(app)s(eared)f(in)f(v2.0)j(of)e(CFITSIO.)0 4805 y(The)22
+b(latest)h(v)m(ersion)f(of)h(the)f(CFITSIO)f(source)i(co)s(de,)h(do)s
+(cumen)m(tation,)h(and)c(example)i(programs)f(are)h(a)m(v)-5
+b(ailable)0 4918 y(on)30 b(the)h(W)-8 b(orld-Wide)30
+b(W)-8 b(eb)31 b(or)f(via)g(anon)m(ymous)g(ftp)g(from:)382
+5178 y Fe(http://heasarc.gsfc.nasa)o(.go)o(v/fi)o(tsio)382
+5291 y(ftp://legacy.gsfc.nasa.g)o(ov/)o(soft)o(ware)o(/fi)o(tsio)o(/c)
 1927 5942 y Fi(1)p eop
 %%Page: 2 8
 2 7 bop 0 299 a Fi(2)2452 b Fg(CHAPTER)30 b(1.)71 b(INTR)m(ODUCTION)0
@@ -2233,410 +2290,453 @@ b(age)30 b(should)c(b)s(e)0 668 y(sen)m(t)31 b(to)g(the)g(primary)d
 b(\(301\))47 b(286-4599)382 1041 y(HEASARC,)e(Code)i(662)811
 b(E-mail:)45 b(pence@tetra.gsfc.nasa.gov)382 1154 y(NASA/Goddard)f
 (Space)j(Flight)f(Center)382 1267 y(Greenbelt,)f(MD)i(20771,)f(USA)0
-1526 y Fi(This)26 b(User's)i(Guide)f(assumes)g(that)i(readers)e
-(already)h(ha)m(v)m(e)h(a)f(general)g(understanding)d(of)j(the)g
-(de\014nition)e(and)0 1639 y(structure)32 b(of)h(FITS)g(format)g
-(\014les.)47 b(F)-8 b(urther)33 b(information)e(ab)s(out)h(FITS)h
-(formats)g(is)f(a)m(v)-5 b(ailable)32 b(in)f(the)i(`FITS)0
-1752 y(User's)f(Guide')f(and)g(the)h(`NOST)f(FITS)g(Standard',)g(whic)m
-(h)g(are)h(a)m(v)-5 b(ailable)31 b(from)g(the)h(NASA)g(Science)g
-(O\016ce)0 1865 y(of)j(Standards)f(and)h(T)-8 b(ec)m(hnology)36
-b(at)g(the)f(address)g(giv)m(en)g(b)s(elo)m(w.)54 b(Both)36
-b(of)f(these)h(do)s(cumen)m(ts)f(are)h(a)m(v)-5 b(ailable)0
-1978 y(electronically)35 b(from)h(their)f(W)-8 b(eb)37
-b(site)f(and)f(via)h(anon)m(ymous)g(ftp)g(at)h(nssdc.gsfc.nasa.go)m(v)h
-(in)d(the)h(/pub/\014ts)0 2091 y(directory)-8 b(.)41
-b(An)m(y)30 b(questions)g(ab)s(out)g(FITS)f(formats)i(should)d(b)s(e)i
-(directed)g(to)h(the)f(NOST,)g(at:)382 2351 y Fe(NASA,)46
-b(Science)g(Office)g(of)h(Standards)f(and)g(Technology)382
-2464 y(Code)g(633.2,)382 2577 y(Goddard)g(Space)g(Flight)g(Center)382
-2689 y(Greenbelt)f(MD)i(20771,)f(USA)382 2802 y(WWW:)g
-(http://fits.gsfc.nasa.gov/)382 2915 y(E-mail:)g
-(fits@fits.gsfc.nasa.gov)382 3028 y(\(301\))g(286-2899)0
-3288 y Fi(CFITSIO)33 b(users)g(ma)m(y)h(also)g(b)s(e)g(in)m(terested)g
-(in)f(the)h(FTOOLS)f(pac)m(k)-5 b(age)36 b(of)e(programs)g(that)g(can)h
-(b)s(e)e(used)g(to)0 3401 y(manipulate)i(and)g(analyze)i(FITS)f(format)
-g(\014les.)58 b(Information)35 b(ab)s(out)h(FTOOLS)f(can)i(b)s(e)f
-(obtained)f(on)i(the)0 3514 y(W)-8 b(eb)31 b(or)f(via)g(anon)m(ymous)h
-(ftp)f(at:)382 3774 y Fe(http://heasarc.gsfc.nasa)o(.go)o(v/ft)o(ools)
-382 3886 y(ftp://legacy.gsfc.nasa.g)o(ov/)o(soft)o(ware)o(/ft)o(ools)o
+1526 y Fi(This)39 b(User's)j(Guide)e(assumes)h(that)h(readers)f
+(already)f(ha)m(v)m(e)j(a)f(general)f(understanding)d(of)k(the)f
+(de\014nition)0 1639 y(and)31 b(structure)g(of)h(FITS)e(format)i
+(\014les.)43 b(F)-8 b(urther)32 b(information)d(ab)s(out)j(FITS)f
+(formats)g(is)g(a)m(v)-5 b(ailable)31 b(from)g(the)0
+1752 y(FITS)h(Supp)s(ort)f(O\016ce)i(at)g Fe(http://fits.gsfc.nasa.gov)
+o Fi(.)42 b(In)32 b(particular,)g(the)h('NOST)f(FITS)g(Standard')0
+1865 y(giv)m(es)i(the)h(authoritativ)m(e)f(de\014nition)e(of)i(the)g
+(FITS)g(data)h(format,)g(and)f(the)g(`FITS)g(User's)g(Guide')f(pro)m
+(vides)0 1978 y(additional)28 b(historical)h(bac)m(kground)h(and)g
+(practical)g(advice)g(on)g(using)f(FITS)h(\014les.)0
+2138 y(CFITSIO)j(users)g(ma)m(y)h(also)g(b)s(e)g(in)m(terested)g(in)f
+(the)h(FTOOLS)f(pac)m(k)-5 b(age)36 b(of)e(programs)g(that)g(can)h(b)s
+(e)e(used)g(to)0 2251 y(manipulate)i(and)g(analyze)i(FITS)f(format)g
+(\014les.)58 b(Information)35 b(ab)s(out)h(FTOOLS)f(can)i(b)s(e)f
+(obtained)f(on)i(the)0 2364 y(W)-8 b(eb)31 b(or)f(via)g(anon)m(ymous)h
+(ftp)f(at:)382 2624 y Fe(http://heasarc.gsfc.nasa)o(.go)o(v/ft)o(ools)
+382 2737 y(ftp://legacy.gsfc.nasa.g)o(ov/)o(soft)o(ware)o(/ft)o(ools)o
 (/rel)o(eas)o(e)p eop
 %%Page: 3 9
 3 8 bop 0 1225 a Ff(Chapter)65 b(2)0 1687 y Fl(Creating)77
 b(FITSIO/CFITSIO)0 2216 y Fd(2.1)135 b(Building)45 b(the)h(Library)0
-2466 y Fi(T)-8 b(o)43 b(use)g(the)g(FITSIO)f(subroutines)e(one)k(m)m
+2467 y Fi(T)-8 b(o)43 b(use)g(the)g(FITSIO)f(subroutines)e(one)k(m)m
 (ust)e(\014rst)g(build)e(the)j(CFITSIO)f(library)-8 b(,)44
-b(whic)m(h)e(requires)f(a)i(C)0 2579 y(compiler.)71 b(gcc)43
+b(whic)m(h)e(requires)f(a)i(C)0 2580 y(compiler.)71 b(gcc)43
 b(is)d(ideal,)i(or)f(most)h(other)f(ANSI-C)g(compilers)e(will)g(also)i
 (w)m(ork.)73 b(The)40 b(CFITSIO)g(co)s(de)h(is)0 2692
 y(con)m(tained)24 b(in)f(ab)s(out)g(40)i(C)f(source)g(\014les)e
 (\(*.c\))k(and)d(header)h(\014les)f(\(*.h\).)39 b(On)23
 b(V)-10 b(AX/VMS)25 b(systems)f(2)g(assem)m(bly-)0 2805
 y(co)s(de)31 b(\014les)e(\(vmsieeed.mar)h(and)g(vmsieeer.mar\))g(are)h
-(also)f(needed.)0 2965 y(The)j(F)-8 b(ortran)34 b(in)m(terface)g
-(subroutines)d(to)j(the)f(C)g(CFITSIO)f(routines)g(are)i(lo)s(cated)f
-(in)f(the)i(f77)p 3384 2965 28 4 v 33 w(wrap1.c)g(and)0
-3078 y(f77)p 123 3078 V 33 w(wrap2.c)24 b(\014les.)38
-b(These)23 b(are)h(relativ)m(ely)f(simple)e('wrapp)s(ers')i(that)h
-(translate)g(the)f(argumen)m(ts)h(in)e(the)i(F)-8 b(ortran)0
-3191 y(subroutine)34 b(in)m(to)h(the)h(appropriate)f(format)h(for)f
-(the)h(corresp)s(onding)e(C)h(routine.)55 b(This)34 b(translation)h(is)
-g(p)s(er-)0 3304 y(formed)28 b(transparen)m(tly)h(to)g(the)h(user)e(b)m
-(y)h(a)g(set)h(of)f(C)g(macros)g(lo)s(cated)h(in)d(the)i(cfortran.h)g
-(\014le.)40 b(Unfortunately)0 3417 y(cfortran.h)28 b(do)s(es)g(not)g
+(also)f(needed.)0 2965 y(The)45 b(F)-8 b(ortran)46 b(in)m(terface)f
+(subroutines)e(to)j(the)f(C)g(CFITSIO)f(routines)g(are)h(lo)s(cated)h
+(in)e(the)h(f77)p 3538 2965 28 4 v 33 w(wrap1.c,)0 3078
+y(through)22 b(f77)p 459 3078 V 33 w(wrap4.c)h(\014les.)37
+b(These)22 b(are)h(relativ)m(ely)f(simple)e('wrapp)s(ers')h(that)i
+(translate)g(the)g(argumen)m(ts)g(in)e(the)0 3191 y(F)-8
+b(ortran)26 b(subroutine)d(in)m(to)j(the)f(appropriate)g(format)h(for)f
+(the)g(corresp)s(onding)f(C)h(routine.)38 b(This)23 b(translation)i(is)
+0 3304 y(p)s(erformed)19 b(transparen)m(tly)h(to)h(the)g(user)f(b)m(y)g
+(a)h(set)h(of)e(C)h(macros)g(lo)s(cated)g(in)e(the)i(cfortran.h)f
+(\014le.)37 b(Unfortunately)0 3417 y(cfortran.h)28 b(do)s(es)g(not)g
 (supp)s(ort)f(ev)m(ery)h(com)m(bination)g(of)g(C)g(and)f(F)-8
 b(ortran)29 b(compilers)e(so)h(the)h(F)-8 b(ortran)28
 b(in)m(terface)0 3530 y(is)j(not)h(supp)s(orted)e(on)h(all)g
 (platforms.)44 b(This)30 b(is)g(esp)s(ecially)g(true)i(for)f(PC)g(and)h
 (Mac)g(users)f(\(see)i(further)d(notes)0 3643 y(b)s(elo)m(w\).)0
-3803 y(The)g(CFITSIO)f(library)f(is)h(built)f(on)j(Unix)e(systems)h(b)m
-(y)g(t)m(yping:)143 4034 y Fe(>)48 b(./configure)143
-4147 y(>)g(make)0 4377 y Fi(at)36 b(the)g(op)s(erating)f(system)h
-(prompt.)55 b(T)m(yp)s(e)35 b(./con\014gure)i(and)e(not)g(simply)f
-(`con\014gure')h(to)i(ensure)e(that)h(the)0 4490 y(con\014gure)j
-(script)g(in)g(the)g(curren)m(t)h(directory)f(and)g(not)h(some)g(other)
-g(system-wide)f(con\014gure)h(script.)67 b(The)0 4603
-y(con\014gure)34 b(command)g(customizes)g(the)g(Mak)m(e\014le)h(for)f
-(the)g(particular)f(system,)i(then)f(the)h(`mak)m(e')g(command)0
-4716 y(compiles)22 b(the)g(source)h(\014les)f(and)g(builds)d(the)k
-(library)-8 b(.)36 b(By)23 b(default)f(this)g(also)h(builds)c(the)k
-(set)g(of)g(F)-8 b(ortran-callable)0 4829 y(wrapp)s(er)29
-b(routines)g(whose)h(calling)f(sequences)h(are)h(describ)s(ed)e(later)h
-(in)f(this)g(do)s(cumen)m(t.)0 4989 y(On)h(HP/UX)i(systems,)g(the)f(en)
-m(vironmen)m(t)g(v)-5 b(ariable)30 b(CFLA)m(GS)h(should)e(b)s(e)i(set)g
-(to)h(-Ae)g(b)s(efore)f(running)d(con-)0 5102 y(\014gure)i(to)h(enable)
-f("extended)h(ANSI")f(features.)0 5262 y(It)37 b(ma)m(y)h(not)g(b)s(e)f
-(p)s(ossible)d(to)k(staticly)g(link)d(programs)i(that)h(use)f(CFITSIO)e
-(on)j(some)f(platforms)g(\(namely)-8 b(,)0 5375 y(on)35
-b(Solaris)f(2.6\))i(due)f(to)h(the)f(net)m(w)m(ork)i(driv)m(ers)c
-(\(whic)m(h)i(pro)m(vide)f(FTP)h(and)g(HTTP)f(access)j(to)f(FITS)e
-(\014les\).)0 5488 y(It)i(is)e(p)s(ossible)f(to)k(mak)m(e)f(b)s(oth)f
-(a)h(dynamic)e(and)h(a)h(static)h(v)m(ersion)e(of)g(the)h(CFITSIO)e
-(library)-8 b(,)35 b(but)g(net)m(w)m(ork)0 5601 y(\014le)f(access)i
-(will)31 b(not)k(b)s(e)f(p)s(ossible)e(using)h(the)i(static)g(v)m
-(ersion.)53 b(T)-8 b(o)35 b(build)d(the)j(dynamic)e(lib)s(c\014tsio.so)
-f(library)0 5714 y(\(on)37 b(solaris\),)g(t)m(yp)s(e)g('mak)m(e)h
-(clean',)h(then)d(edit)g(the)h(Mak)m(e\014le)g(to)g(add)f(-fPIC)g(or)h
-(-KPIC)f(\(gcc)i(or)f(cc\))g(to)h(the)1927 5942 y(3)p
-eop
+3803 y(A)g(standard)f(com)m(bination)h(of)g(C)f(and)h(F)-8
+b(ortran)30 b(compilers)f(will)e(b)s(e)i(assumed)h(b)m(y)f(default,)h
+(but)f(one)h(ma)m(y)h(also)0 3916 y(sp)s(ecify)e(a)i(particular)d(F)-8
+b(ortran)32 b(compiler)c(b)m(y)j(doing:)48 4177 y Fe(>)95
+b(setenv)46 b(CFLAGS)g(-DcompilerName=1)0 4437 y Fi(\(where)33
+b('compilerName')f(is)g(the)h(name)f(of)h(the)g(compiler\))f(b)s(efore)
+g(running)e(the)j(con\014gure)f(command.)47 b(The)0 4550
+y(curren)m(tly)29 b(recognized)i(compiler)e(names)h(are:)48
+4811 y Fe(g77Fortran)48 4924 y(IBMR2Fortran)48 5036 y(CLIPPERFortran)48
+5149 y(pgiFortran)48 5262 y(NAGf90Fortran)48 5375 y(f2cFortran)48
+5488 y(hpuxFortran)48 5601 y(apolloFortran)48 5714 y(sunFortran)1927
+5942 y Fi(3)p eop
 %%Page: 4 10
 4 9 bop 0 299 a Fi(4)1896 b Fg(CHAPTER)30 b(2.)111 b(CREA)-8
-b(TING)31 b(FITSIO/CFITSIO)0 555 y Fi(CFLA)m(GS)38 b(line,)f(then)g
-(rebuild)d(the)k(library)d(with)h('mak)m(e'.)63 b(Once)37
-b(y)m(ou're)h(done,)h(build)34 b(the)k(shared)e(library)0
-668 y(with)48 929 y Fe(ld)47 b(-G)g(-z)g(text)g(-o)g(libcfitsio.so)d
-(*.o)0 1189 y Fi(Then)19 b(to)i(get)h(the)e(staticly)g(link)-5
-b(able)18 b(lib)s(c\014tsio.a)g(library)g(\014le)i(do)g(another)g(mak)m
-(e)h(clean,)i(unde\014ne)18 b(HA)-10 b(VE)p 3633 1189
-28 4 v 34 w(NET)p 3863 1189 V 32 w(SER)g(VICES)0 1302
-y(on)29 b(the)h(CFLA)m(GS)g(line)d(and)i(rebuild.)38
-b(It's)29 b(unimp)s(ortan)m(t)f(whether)h(or)g(not)h(y)m(ou)g(use)f
-(-fPIC)g(for)g(static)h(builds.)0 1462 y(When)25 b(using)e(the)i
-(shared)f(library)f(the)i(executable)g(co)s(de)h(is)e(not)h(copied)f
-(in)m(to)h(y)m(our)g(program)f(at)i(link)d(time)i(and)0
-1575 y(instead)20 b(the)g(program)g(lo)s(cates)h(the)f(necessary)h
-(library)d(co)s(de)i(at)h(run)e(time,)k(normally)18 b(through)i(LD)p
-3438 1575 V 33 w(LIBRAR)-8 b(Y)p 3887 1575 V 33 w(P)g(A)g(TH)0
-1688 y(or)30 b(some)h(other)g(metho)s(d.)40 b(The)30
-b(adv)-5 b(an)m(tages)32 b(are:)143 1949 y Fe(1.)95 b(Less)47
-b(disk)f(space)h(if)g(you)g(build)f(more)h(than)f(1)i(program)143
-2062 y(2.)95 b(Less)47 b(memory)f(if)h(more)g(than)f(one)h(copy)g(of)g
-(a)g(program)f(using)h(the)g(shared)334 2175 y(library)f(is)h(running)f
-(at)h(the)g(same)g(time)f(since)h(the)g(system)f(is)h(smart)334
-2288 y(enough)f(to)h(share)g(copies)f(of)h(the)g(shared)f(library)g(at)
-h(run)g(time.)143 2401 y(3.)95 b(Possibly)46 b(easier)g(maintenance)e
-(since)j(a)g(new)g(version)f(of)h(the)g(shared)334 2514
-y(library)f(can)h(be)g(installed)e(without)h(relinking)f(all)i(the)g
-(software)334 2626 y(that)g(uses)f(it)i(\(as)e(long)h(as)g(the)g
-(subroutine)e(names)i(and)f(calling)334 2739 y(sequences)f(remain)h
-(unchanged\).)143 2852 y(4.)95 b(No)47 b(run-time)f(penalty.)0
-3113 y Fi(The)30 b(disadv)-5 b(an)m(tages)31 b(are:)143
-3374 y Fe(1.)47 b(More)g(hassle)f(at)h(runtime.)94 b(You)46
-b(have)h(to)g(either)f(build)h(the)g(programs)286 3486
-y(specially)f(or)h(have)f(LD_LIBRARY_PATH)e(set)j(right.)143
-3599 y(2.)g(There)g(may)g(be)g(a)g(slight)f(start)h(up)g(penality,)e
-(depending)g(on)j(where)e(you)h(are)286 3712 y(reading)f(the)h(shared)f
-(library)g(and)h(the)g(program)f(from)g(and)h(if)g(your)g(CPU)g(is)286
-3825 y(either)f(really)h(slow)f(or)h(really)f(heavily)g(loaded.)0
-4086 y Fi(On)28 b(V)-10 b(AX/VMS)31 b(and)d(ALPHA/VMS)i(systems)f(the)h
-(mak)m(e)p 2100 4086 V 34 w(g\015oat.com)h(command)e(\014le)f(ma)m(y)i
-(b)s(e)f(executed)h(to)0 4199 y(build)j(the)k(c\014tsio.olb)e(ob)5
+b(TING)31 b(FITSIO/CFITSIO)48 555 y Fe(CRAYFortran)48
+668 y(mipsFortran)48 781 y(DECFortran)48 894 y(vmsFortran)48
+1007 y(CONVEXFortran)48 1120 y(PowerStationFortran)48
+1233 y(AbsoftUNIXFortran)48 1346 y(AbsoftProFortran)48
+1458 y(SXFortran)0 1711 y Fi(Alternativ)m(ely)-8 b(,)39
+b(one)f(ma)m(y)g(edit)f(the)g(CFLA)m(GS)h(line)d(in)i(the)g(Mak)m
+(e\014le)h(to)g(add)f(the)h('-DcompilerName')g(\015ag)0
+1824 y(after)31 b(running)d(the)i('./con\014gure')h(command.)0
+1984 y(The)f(CFITSIO)f(library)f(is)h(built)f(on)j(Unix)e(systems)h(b)m
+(y)g(t)m(yping:)48 2237 y Fe(>)95 b(./configure)45 b
+([--prefix=/target/insta)o(llat)o(ion)o(/pat)o(h])48
+2350 y(>)95 b(make)476 b(\(or)95 b('make)46 b(shared'\))48
+2463 y(>)95 b(make)47 b(install)93 b(\(this)46 b(step)h(is)g
+(optional\))0 2716 y Fi(at)24 b(the)g(op)s(erating)f(system)h(prompt.)
+38 b(The)23 b(con\014gure)g(command)g(customizes)h(the)g(Mak)m(e\014le)
+g(for)g(the)g(particular)0 2829 y(system,)g(then)d(the)g(`mak)m(e')i
+(command)e(compiles)f(the)h(source)h(\014les)e(and)h(builds)d(the)j
+(library)-8 b(.)36 b(T)m(yp)s(e)21 b(`./con\014gure')0
+2942 y(and)34 b(not)h(simply)d(`con\014gure')j(to)h(ensure)e(that)h
+(the)g(con\014gure)g(script)e(in)h(the)h(curren)m(t)f(directory)g(is)g
+(run)g(and)0 3054 y(not)29 b(some)g(other)g(system-wide)f(con\014gure)g
+(script.)39 b(The)29 b(optional)f('pre\014x')g(argumen)m(t)h(to)g
+(con\014gure)g(giv)m(es)g(the)0 3167 y(path)f(to)i(the)f(directory)f
+(where)g(the)h(CFITSIO)f(library)e(and)i(include)f(\014les)g(should)g
+(b)s(e)h(installed)f(via)h(the)h(later)0 3280 y('mak)m(e)j(install')c
+(command.)41 b(F)-8 b(or)31 b(example,)143 3533 y Fe(>)48
+b(./configure)c(--prefix=/usr1/local)0 3786 y Fi(will)22
+b(cause)k(the)f('mak)m(e)h(install')d(command)i(to)h(cop)m(y)g(the)f
+(CFITSIO)e(lib)s(c\014tsio)f(\014le)j(to)g(/usr1/lo)s(cal/lib)e(and)i
+(the)0 3899 y(necessary)36 b(include)c(\014le)j(to)h(/usr1/lo)s
+(cal/include)d(\(assuming)h(of)h(course)g(that)h(the)f(pro)s(cess)g
+(has)g(p)s(ermission)0 4012 y(to)c(write)f(to)h(these)g(directories\).)
+0 4172 y(By)d(default)g(this)f(also)h(builds)c(the)29
+b(set)f(of)h(F)-8 b(ortran-callable)28 b(wrapp)s(er)e(routines)h(whose)
+h(calling)e(sequences)j(are)0 4285 y(describ)s(ed)f(later)j(in)e(this)g
+(do)s(cumen)m(t.)0 4445 y(The)f('mak)m(e)h(shared')f(option)g(builds)d
+(a)k(shared)e(or)i(dynamic)e(v)m(ersion)h(of)g(the)h(CFITSIO)d(library)
+-8 b(.)38 b(When)28 b(using)0 4558 y(the)f(shared)f(library)f(the)i
+(executable)g(co)s(de)g(is)f(not)h(copied)f(in)m(to)h(y)m(our)g
+(program)g(at)g(link)e(time)h(and)h(instead)f(the)0 4671
+y(program)h(lo)s(cates)h(the)g(necessary)g(library)d(co)s(de)j(at)g
+(run)e(time,)i(normally)e(through)g(LD)p 3065 4671 28
+4 v 33 w(LIBRAR)-8 b(Y)p 3514 4671 V 34 w(P)g(A)g(TH)28
+b(or)0 4784 y(some)j(other)f(metho)s(d.)41 b(The)29 b(adv)-5
+b(an)m(tages)33 b(of)d(using)f(a)i(shared)e(library)f(are:)143
+5036 y Fe(1.)95 b(Less)47 b(disk)f(space)h(if)g(you)g(build)f(more)h
+(than)f(1)i(program)143 5149 y(2.)95 b(Less)47 b(memory)f(if)h(more)g
+(than)f(one)h(copy)g(of)g(a)g(program)f(using)h(the)g(shared)334
+5262 y(library)f(is)h(running)f(at)h(the)g(same)g(time)f(since)h(the)g
+(system)f(is)h(smart)334 5375 y(enough)f(to)h(share)g(copies)f(of)h
+(the)g(shared)f(library)g(at)h(run)g(time.)143 5488 y(3.)95
+b(Possibly)46 b(easier)g(maintenance)e(since)j(a)g(new)g(version)f(of)h
+(the)g(shared)334 5601 y(library)f(can)h(be)g(installed)e(without)h
+(relinking)f(all)i(the)g(software)334 5714 y(that)g(uses)f(it)i(\(as)e
+(long)h(as)g(the)g(subroutine)e(names)i(and)f(calling)p
+eop
+%%Page: 5 11
+5 10 bop 0 299 a Fg(2.1.)72 b(BUILDING)31 b(THE)f(LIBRAR)-8
+b(Y)2507 b Fi(5)334 555 y Fe(sequences)45 b(remain)h(unchanged\).)143
+668 y(4.)95 b(No)47 b(run-time)f(penalty.)0 923 y Fi(The)30
+b(disadv)-5 b(an)m(tages)31 b(are:)143 1177 y Fe(1.)47
+b(More)g(hassle)f(at)h(runtime.)94 b(You)46 b(have)h(to)g(either)f
+(build)h(the)g(programs)286 1290 y(specially)f(or)h(have)f
+(LD_LIBRARY_PATH)e(set)j(right.)143 1403 y(2.)g(There)g(may)g(be)g(a)g
+(slight)f(start)h(up)g(penalty,)e(depending)h(on)h(where)f(you)h(are)
+286 1516 y(reading)f(the)h(shared)f(library)g(and)h(the)g(program)f
+(from)g(and)h(if)g(your)g(CPU)g(is)286 1629 y(either)f(really)h(slow)f
+(or)h(really)f(heavily)g(loaded.)0 1883 y Fi(On)30 b(HP/UX)i(systems,)g
+(the)f(en)m(vironmen)m(t)g(v)-5 b(ariable)30 b(CFLA)m(GS)h(should)e(b)s
+(e)i(set)g(to)h(-Ae)g(b)s(efore)f(running)d(con-)0 1996
+y(\014gure)i(to)h(enable)f("extended)h(ANSI")f(features.)0
+2156 y(It)f(ma)m(y)h(not)f(b)s(e)f(p)s(ossible)f(to)i(staticly)g(link)e
+(programs)i(that)g(use)g(CFITSIO)e(on)i(some)h(platforms)d(\(namely)-8
+b(,)30 b(on)0 2269 y(Solaris)k(2.6\))j(due)e(to)i(the)e(net)m(w)m(ork)i
+(driv)m(ers)d(\(whic)m(h)h(pro)m(vide)g(FTP)g(and)g(HTTP)g(access)i(to)
+g(FITS)e(\014les\).)56 b(It)0 2382 y(is)32 b(p)s(ossible)e(to)k(mak)m
+(e)f(b)s(oth)g(a)g(dynamic)e(and)h(a)i(static)f(v)m(ersion)f(of)h(the)g
+(CFITSIO)e(library)-8 b(,)32 b(but)g(net)m(w)m(ork)i(\014le)0
+2495 y(access)e(will)27 b(not)k(b)s(e)f(p)s(ossible)e(using)h(the)h
+(static)h(v)m(ersion.)0 2655 y(On)d(V)-10 b(AX/VMS)31
+b(and)d(ALPHA/VMS)i(systems)f(the)h(mak)m(e)p 2100 2655
+28 4 v 34 w(g\015oat.com)h(command)e(\014le)f(ma)m(y)i(b)s(e)f
+(executed)h(to)0 2768 y(build)j(the)k(c\014tsio.olb)e(ob)5
 b(ject)37 b(library)d(using)h(the)h(default)g(G-\015oating)g(p)s(oin)m
-(t)g(option)f(for)h(double)f(v)-5 b(ariables.)0 4312
-y(The)37 b(mak)m(e)p 405 4312 V 33 w(d\015oat.com)i(and)d(mak)m(e)p
-1279 4312 V 34 w(ieee.com)i(\014les)f(ma)m(y)g(b)s(e)g(used)f(instead)h
-(to)h(build)c(the)j(library)e(with)h(the)0 4425 y(other)26
+(t)g(option)f(for)h(double)f(v)-5 b(ariables.)0 2881
+y(The)37 b(mak)m(e)p 405 2881 V 33 w(d\015oat.com)i(and)d(mak)m(e)p
+1279 2881 V 34 w(ieee.com)i(\014les)f(ma)m(y)g(b)s(e)g(used)f(instead)h
+(to)h(build)c(the)j(library)e(with)h(the)0 2994 y(other)26
 b(\015oating)h(p)s(oin)m(t)e(options.)38 b(Note)28 b(that)f(the)f
 (getcwd)h(function)e(that)i(is)e(used)g(in)g(the)i(group.c)f(mo)s(dule)
-e(ma)m(y)0 4538 y(require)43 b(that)j(programs)e(using)f(CFITSIO)g(b)s
+e(ma)m(y)0 3107 y(require)43 b(that)j(programs)e(using)f(CFITSIO)g(b)s
 (e)h(link)m(ed)g(with)f(the)i(ALPHA$LIBRAR)-8 b(Y:V)e(AX)m(CR)i(TL.OLB)
-0 4650 y(library)g(.)39 b(See)30 b(the)h(example)f(link)e(line)h(in)g
+0 3220 y(library)g(.)39 b(See)30 b(the)h(example)f(link)e(line)h(in)g
 (the)i(next)f(section)h(of)f(this)g(do)s(cumen)m(t.)0
-4811 y(On)25 b(Windo)m(ws)g(IBM-PC)h(t)m(yp)s(e)g(platforms)e(the)i
+3380 y(On)25 b(Windo)m(ws)g(IBM-PC)h(t)m(yp)s(e)g(platforms)e(the)i
 (situation)f(is)f(more)i(complicated)g(b)s(ecause)f(of)h(the)g(wide)f
-(v)-5 b(ariet)m(y)0 4924 y(of)43 b(F)-8 b(ortran)43 b(compilers)f(that)
+(v)-5 b(ariet)m(y)0 3493 y(of)43 b(F)-8 b(ortran)43 b(compilers)f(that)
 h(are)g(a)m(v)-5 b(ailable)42 b(and)g(b)s(ecause)h(of)g(the)g(inheren)m
-(t)f(complexities)g(of)g(calling)g(the)0 5036 y(CFITSIO)25
+(t)f(complexities)g(of)g(calling)g(the)0 3606 y(CFITSIO)25
 b(C)g(routines)g(from)h(F)-8 b(ortran.)40 b(Tw)m(o)26
 b(di\013eren)m(t)g(v)m(ersions)f(of)h(the)h(CFITSIO)d(dll)g(library)g
-(are)i(a)m(v)-5 b(ailable,)0 5149 y(compiled)26 b(with)f(the)j(Borland)
+(are)i(a)m(v)-5 b(ailable,)0 3719 y(compiled)26 b(with)f(the)j(Borland)
 e(C++)g(compiler)g(and)g(the)i(Microsoft)f(Visual)f(C++)g(compiler,)g
-(resp)s(ectiv)m(ely)-8 b(,)28 b(in)0 5262 y(the)i(\014les)f(c\014tsio)s
-(dll)p 682 5262 V 30 w(2xxx)p 901 5262 V 34 w(b)s(orland.zip)e(and)i
-(c\014tsio)s(dll)p 1927 5262 V 30 w(2xxx)p 2146 5262
+(resp)s(ectiv)m(ely)-8 b(,)28 b(in)0 3831 y(the)i(\014les)f(c\014tsio)s
+(dll)p 682 3831 V 30 w(2xxx)p 901 3831 V 34 w(b)s(orland.zip)e(and)i
+(c\014tsio)s(dll)p 1927 3831 V 30 w(2xxx)p 2146 3831
 V 33 w(v)m(cc.zip,)i(where)f('2xxx')h(represen)m(ts)f(the)g(curren)m(t)
-0 5375 y(release)43 b(n)m(um)m(b)s(er.)76 b(Both)43 b(these)g(dll)e
+0 3944 y(release)43 b(n)m(um)m(b)s(er.)76 b(Both)43 b(these)g(dll)e
 (libraries)f(con)m(tain)j(a)g(set)g(of)f(F)-8 b(ortran)44
-b(wrapp)s(er)d(routines)g(whic)m(h)g(ma)m(y)0 5488 y(b)s(e)c
+b(wrapp)s(er)d(routines)g(whic)m(h)g(ma)m(y)0 4057 y(b)s(e)c
 (compatible)g(with)f(some,)k(but)d(probably)f(not)h(all,)i(a)m(v)-5
 b(ailable)37 b(F)-8 b(ortran)38 b(compilers.)61 b(T)-8
-b(o)38 b(test)g(if)f(they)h(are)0 5601 y(compatible,)27
+b(o)38 b(test)g(if)f(they)h(are)0 4170 y(compatible,)27
 b(compile)f(the)h(program)g(testf77.f)h(and)f(try)f(linking)f(to)i
 (these)h(dll)c(libraries.)37 b(If)27 b(these)g(libraries)d(do)0
-5714 y(not)29 b(w)m(ork)g(with)e(a)i(particular)e(F)-8
+4283 y(not)29 b(w)m(ork)g(with)e(a)i(particular)e(F)-8
 b(ortran)30 b(compiler,)e(then)g(there)h(are)g(2)g(p)s(ossible)e
-(solutions.)38 b(The)28 b(\014rst)g(solution)p eop
-%%Page: 5 11
-5 10 bop 0 299 a Fg(2.2.)72 b(TESTING)29 b(THE)h(LIBRAR)-8
-b(Y)2555 b Fi(5)0 555 y(w)m(ould)28 b(b)s(e)i(to)g(mo)s(dify)e(the)i
-(\014le)e(cfortran.h)i(for)f(that)i(particular)d(com)m(bination)h(of)h
-(C)f(and)g(F)-8 b(ortran)30 b(compilers,)0 668 y(and)i(then)g(rebuild)e
-(the)i(CFITSIO)f(dll)g(library)-8 b(.)45 b(This)31 b(will)e(require,)j
-(ho)m(w)m(ev)m(er,)j(a)e(great)h(deal)e(of)h(exp)s(ertise)e(in)0
-781 y(mixed)d(language)h(programming)f(whic)m(h)f(the)j(author)e(of)h
-(CFITSIO)f(cannot)h(pro)m(vide.)40 b(The)28 b(other)h(solution)f(is)0
-894 y(to)f(use)f(the)h(older)e(v5.03)j(F)-8 b(ortran-77)28
-b(implemen)m(tation)d(of)i(FITSIO)e(that)i(is)e(still)f(a)m(v)-5
-b(ailable)26 b(from)g(the)g(FITSIO)0 1007 y(w)m(eb-site.)51
-b(This)32 b(v)m(ersion)h(is)g(no)h(longer)f(supp)s(orted,)g(but)g(it)h
-(do)s(es)f(pro)m(vide)g(the)h(basic)f(functions)f(for)i(reading)0
-1120 y(and)c(writing)e(FITS)i(\014les)f(and)h(should)e(b)s(e)i
-(compatible)g(with)f(most)h(F)-8 b(ortran)31 b(compilers.)0
-1280 y(CFITSIO)e(has)h(curren)m(tly)f(b)s(een)h(tested)h(on)f(the)h
-(follo)m(wing)e(platforms:)95 1509 y Fe(OPERATING)46
-b(SYSTEM)523 b(COMPILER)143 1622 y(Sun)47 b(OS)1002 b(gcc)47
-b(and)g(cc)g(\(3.0.1\))143 1735 y(Sun)g(Solaris)762 b(gcc)47
-b(and)g(cc)143 1848 y(Silicon)f(Graphics)g(IRIX)285 b(gcc)47
-b(and)g(cc)143 1961 y(Silicon)f(Graphics)g(IRIX64)189
-b(MIPS)143 2073 y(Dec)47 b(Alpha)f(OSF/1)572 b(gcc)47
-b(and)g(cc)143 2186 y(DECstation)93 b(Ultrix)428 b(gcc)143
-2299 y(Dec)47 b(Alpha)f(OpenVMS)476 b(cc)143 2412 y(DEC)47
-b(VAX/VMS)762 b(gcc)47 b(and)g(cc)143 2525 y(HP-UX)1049
-b(gcc)143 2638 y(IBM)47 b(AIX)954 b(gcc)143 2751 y(Linux)1049
-b(gcc)143 2864 y(MkLinux)953 b(DR3)143 2977 y(Windows)46
-b(95/98/NT)523 b(Borland)46 b(C++)h(V4.5)143 3090 y(Windows)f(95/98/NT)
-523 b(Microsoft/Compaq)43 b(Visual)j(C++)h(v5.0,)g(v6.0)143
-3203 y(Windows)f(95/98/NT)523 b(Cygwin)46 b(gcc)143 3315
-y(OS/2)1097 b(gcc)47 b(+)g(EMX)143 3428 y(MacOS)g(7.1)f(or)i(greater)
-332 b(Metrowerks)45 b(10.+)0 3657 y Fi(CFITSIO)31 b(will)e(probably)i
-(run)f(on)i(most)h(other)f(Unix)g(platforms.)45 b(Cra)m(y)32
-b(sup)s(ercomputers)e(and)i(IBM)h(main-)0 3770 y(frame)d(computers)g
-(are)h(curren)m(tly)f(not)g(supp)s(orted.)0 4099 y Fd(2.2)135
-b(T)-11 b(esting)46 b(the)f(Library)0 4349 y Fi(The)40
-b(CFITSIO)e(library)g(should)g(b)s(e)h(tested)i(b)m(y)f(building)c(and)
-j(running)f(the)i(testprog.c)h(program)f(that)h(is)0
-4462 y(included)28 b(with)h(the)h(release.)41 b(On)30
-b(Unix)f(systems)h(t)m(yp)s(e:)191 4691 y Fe(\045)47
-b(make)g(testprog)191 4804 y(\045)g(testprog)f(>)h(testprog.lis)191
-4917 y(\045)g(diff)g(testprog.lis)d(testprog.out)191
-5030 y(\045)j(cmp)g(testprog.fit)e(testprog.std)0 5259
-y Fi(On)30 b(VMS)g(systems,)g(\(assuming)g(cc)h(is)e(the)i(name)f(of)h
-(the)f(C)g(compiler)f(command\),)i(t)m(yp)s(e:)191 5488
-y Fe($)47 b(cc)h(testprog.c)191 5601 y($)f(link)g(testprog,)e
-(cfitsio/lib,)g(alpha$library:vaxcrtl/l)o(ib)191 5714
-y($)i(run)g(testprog)p eop
+(solutions.)38 b(The)28 b(\014rst)g(solution)0 4396 y(w)m(ould)g(b)s(e)
+i(to)g(mo)s(dify)e(the)i(\014le)e(cfortran.h)i(for)f(that)i(particular)
+d(com)m(bination)h(of)h(C)f(and)g(F)-8 b(ortran)30 b(compilers,)0
+4509 y(and)i(then)g(rebuild)e(the)i(CFITSIO)f(dll)g(library)-8
+b(.)45 b(This)31 b(will)e(require,)j(ho)m(w)m(ev)m(er,)j(a)e(great)h
+(deal)e(of)h(exp)s(ertise)e(in)0 4622 y(mixed)d(language)h(programming)
+f(whic)m(h)f(the)j(author)e(of)h(CFITSIO)f(cannot)h(pro)m(vide.)40
+b(The)28 b(other)h(solution)f(is)0 4735 y(to)f(use)f(the)h(older)e
+(v5.03)j(F)-8 b(ortran-77)28 b(implemen)m(tation)d(of)i(FITSIO)e(that)i
+(is)e(still)f(a)m(v)-5 b(ailable)26 b(from)g(the)g(FITSIO)0
+4848 y(w)m(eb-site.)51 b(This)32 b(v)m(ersion)h(is)g(no)h(longer)f
+(supp)s(orted,)g(but)g(it)h(do)s(es)f(pro)m(vide)g(the)h(basic)f
+(functions)f(for)i(reading)0 4961 y(and)c(writing)e(FITS)i(\014les)f
+(and)h(should)e(b)s(e)i(compatible)g(with)f(most)h(F)-8
+b(ortran)31 b(compilers.)0 5121 y(CFITSIO)e(has)h(curren)m(tly)f(b)s
+(een)h(tested)h(on)f(the)h(follo)m(wing)e(platforms:)95
+5375 y Fe(OPERATING)46 b(SYSTEM)523 b(COMPILER)143 5488
+y(Sun)47 b(OS)1002 b(gcc)47 b(and)g(cc)g(\(3.0.1\))143
+5601 y(Sun)g(Solaris)762 b(gcc)47 b(and)g(cc)143 5714
+y(Silicon)f(Graphics)g(IRIX)285 b(gcc)47 b(and)g(cc)p
+eop
 %%Page: 6 12
 6 11 bop 0 299 a Fi(6)1896 b Fg(CHAPTER)30 b(2.)111 b(CREA)-8
-b(TING)31 b(FITSIO/CFITSIO)0 555 y Fi(The)f(testprog)h(program)g
-(should)d(pro)s(duce)h(a)i(FITS)f(\014le)f(called)h(`testprog.\014t')i
-(that)f(is)e(iden)m(tical)h(to)h(the)f(`test-)0 668 y(prog.std')25
+b(TING)31 b(FITSIO/CFITSIO)143 555 y Fe(Silicon)46 b(Graphics)g(IRIX64)
+189 b(MIPS)143 668 y(Dec)47 b(Alpha)f(OSF/1)572 b(gcc)47
+b(and)g(cc)143 781 y(DECstation)93 b(Ultrix)428 b(gcc)143
+894 y(Dec)47 b(Alpha)f(OpenVMS)476 b(cc)143 1007 y(DEC)47
+b(VAX/VMS)762 b(gcc)47 b(and)g(cc)143 1120 y(HP-UX)1049
+b(gcc)143 1233 y(IBM)47 b(AIX)954 b(gcc)143 1346 y(Linux)1049
+b(gcc)143 1458 y(MkLinux)953 b(DR3)143 1571 y(Windows)46
+b(95/98/NT)523 b(Borland)46 b(C++)h(V4.5)143 1684 y(Windows)f
+(95/98/NT/ME/XP)235 b(Microsoft/Compaq)43 b(Visual)j(C++)h(v5.0,)g
+(v6.0)143 1797 y(Windows)f(95/98/NT)523 b(Cygwin)46 b(gcc)143
+1910 y(OS/2)1097 b(gcc)47 b(+)g(EMX)143 2023 y(MacOS)g(7.1)f(or)i
+(greater)332 b(Metrowerks)45 b(10.+)0 2270 y Fi(CFITSIO)26
+b(will)g(probably)g(run)g(on)i(most)g(other)h(Unix)d(platforms.)39
+b(Cra)m(y)28 b(sup)s(ercomputers)e(are)j(curren)m(tly)e(not)0
+2383 y(supp)s(orted.)0 2714 y Fd(2.2)135 b(T)-11 b(esting)46
+b(the)f(Library)0 2965 y Fi(The)40 b(CFITSIO)e(library)g(should)g(b)s
+(e)h(tested)i(b)m(y)f(building)c(and)j(running)f(the)i(testprog.c)h
+(program)f(that)h(is)0 3078 y(included)28 b(with)h(the)h(release.)41
+b(On)30 b(Unix)f(systems)h(t)m(yp)s(e:)191 3324 y Fe(\045)47
+b(make)g(testprog)191 3437 y(\045)g(testprog)f(>)h(testprog.lis)191
+3550 y(\045)g(diff)g(testprog.lis)d(testprog.out)191
+3663 y(\045)j(cmp)g(testprog.fit)e(testprog.std)0 3910
+y Fi(On)30 b(VMS)g(systems,)g(\(assuming)g(cc)h(is)e(the)i(name)f(of)h
+(the)f(C)g(compiler)f(command\),)i(t)m(yp)s(e:)191 4157
+y Fe($)47 b(cc)h(testprog.c)191 4270 y($)f(link)g(testprog,)e
+(cfitsio/lib,)g(alpha$library:vaxcrtl/l)o(ib)191 4383
+y($)i(run)g(testprog)0 4629 y Fi(The)30 b(testprog)h(program)g(should)d
+(pro)s(duce)h(a)i(FITS)f(\014le)f(called)h(`testprog.\014t')i(that)f
+(is)e(iden)m(tical)h(to)h(the)f(`test-)0 4742 y(prog.std')25
 b(FITS)f(\014le)f(included)f(with)h(this)h(release.)39
 b(The)24 b(diagnostic)g(messages)i(\(whic)m(h)d(w)m(ere)i(pip)s(ed)e
-(to)i(the)g(\014le)0 781 y(testprog.lis)f(in)f(the)i(Unix)e(example\))i
-(should)d(b)s(e)i(iden)m(tical)g(to)h(the)g(listing)d(con)m(tained)j
-(in)e(the)i(\014le)e(testprog.out.)0 894 y(The)30 b('di\013)7
+(to)i(the)g(\014le)0 4855 y(testprog.lis)f(in)f(the)i(Unix)e(example\))
+i(should)d(b)s(e)i(iden)m(tical)g(to)h(the)g(listing)d(con)m(tained)j
+(in)e(the)i(\014le)e(testprog.out.)0 4968 y(The)30 b('di\013)7
 b(')30 b(and)f('cmp')i(commands)f(sho)m(wn)g(ab)s(o)m(v)m(e)h(should)e
 (not)h(rep)s(ort)g(an)m(y)h(di\013erences)f(in)f(the)h(\014les.)40
-b(\(There)0 1007 y(ma)m(y)d(b)s(e)e(some)i(minor)d(formating)i
-(di\013erences,)h(suc)m(h)f(as)g(the)g(presence)g(or)g(absence)h(of)f
-(leading)f(zeros,)j(or)f(3)0 1120 y(digit)29 b(exp)s(onen)m(ts)h(in)f
+b(\(There)0 5081 y(ma)m(y)35 b(b)s(e)e(some)h(minor)f(formatting)g
+(di\013erences,)i(suc)m(h)e(as)i(the)f(presence)g(or)g(absence)g(of)g
+(leading)f(zeros,)j(or)e(3)0 5194 y(digit)29 b(exp)s(onen)m(ts)h(in)f
 (n)m(um)m(b)s(ers,)h(whic)m(h)f(can)h(b)s(e)g(ignored\).)0
-1280 y(The)e(F)-8 b(ortran)30 b(wrapp)s(ers)d(in)g(CFITSIO)g(ma)m(y)j
-(b)s(e)e(tested)h(with)f(the)h(testf77)h(program)f(on)g(Unix)e(systems)
-i(with:)191 1534 y Fe(\045)47 b(f77)g(-o)g(testf77)f(testf77.f)g(-L.)g
-(-lcfitsio)g(-lnsl)g(-lsocket)95 1647 y(or)191 1760 y(\045)h(f77)g(-f)g
-(-o)h(testf77)d(testf77.f)h(-L.)h(-lcfitsio)188 b(\(under)46
-b(SUN)h(O/S\))95 1873 y(or)191 1986 y(\045)g(f77)g(-o)g(testf77)f
-(testf77.f)g(-Wl,-L.)f(-lcfitsio)h(-lm)h(-lnsl)f(-lsocket)f(\(HP/UX\))
-191 2212 y(\045)i(testf77)f(>)i(testf77.lis)191 2324
-y(\045)f(diff)g(testf77.lis)e(testf77.out)191 2437 y(\045)i(cmp)g
-(testf77.fit)e(testf77.std)0 2691 y Fi(On)31 b(mac)m(hines)g(running)f
-(SUN)h(O/S,)h(F)-8 b(ortran)33 b(programs)e(m)m(ust)h(b)s(e)f(compiled)
-f(with)h(the)h('-f)7 b(')32 b(option)g(to)g(force)0 2804
-y(double)24 b(precision)g(v)-5 b(ariables)24 b(to)i(b)s(e)f(aligned)f
-(on)i(8-b)m(yte)h(b)s(oundarys)c(to)j(mak)m(e)h(the)e(fortran-declared)
-g(v)-5 b(ariables)0 2917 y(compatible)32 b(with)f(C.)h(A)h(similar)d
-(compiler)h(option)h(ma)m(y)h(b)s(e)f(required)f(on)h(other)h
-(platforms.)47 b(F)-8 b(ailing)31 b(to)i(use)0 3030 y(this)25
-b(option)g(ma)m(y)h(cause)h(the)f(program)f(to)i(crash)e(on)h(FITSIO)f
-(routines)f(that)j(read)f(or)f(write)g(double)g(precision)0
-3143 y(v)-5 b(ariables.)0 3303 y(Also)30 b(note)h(that)f(on)g(some)h
-(systems,)f(the)h(output)e(listing)f(of)j(the)f(testf77)i(program)d(ma)
-m(y)i(di\013er)e(sligh)m(tly)f(from)0 3416 y(the)j(testf77.std)h
-(template,)f(if)f(leading)f(zeros)i(are)g(not)g(prin)m(ted)e(b)m(y)i
-(default)f(b)s(efore)g(the)h(decimal)e(p)s(oin)m(t)h(when)0
-3529 y(using)f(F)i(format.)0 3689 y(A)f(few)h(other)f(utilit)m(y)f
-(programs)h(are)h(included)c(with)i(CFITSIO:)191 3943
-y Fe(speed)46 b(-)i(measures)d(the)i(maximum)f(throughput)f(\(in)i(MB)g
-(per)g(second\))668 4056 y(for)g(writing)f(and)h(reading)f(FITS)g
-(files)h(with)f(CFITSIO)191 4282 y(listhead)f(-)j(lists)e(all)h(the)g
-(header)f(keywords)g(in)h(any)g(FITS)f(file)191 4508
-y(fitscopy)f(-)j(copies)e(any)h(FITS)g(file)f(\(especially)f(useful)h
-(in)h(conjunction)811 4621 y(with)g(the)g(CFITSIO's)e(extended)h(input)
-g(filename)g(syntax\))191 4847 y(cookbook)f(-)j(a)f(sample)f(program)g
-(that)h(peforms)f(common)g(read)g(and)811 4960 y(write)h(operations)e
-(on)i(a)g(FITS)g(file.)191 5185 y(iter_a,)f(iter_b,)g(iter_c)g(-)h
-(tests)f(of)i(the)f(CFITSIO)e(iterator)h(routine)0 5440
-y Fi(The)30 b(\014rst)f(4)i(of)g(these)g(utilit)m(y)d(programs)i(can)h
-(b)s(e)f(compiled)f(and)g(link)m(ed)g(b)m(y)h(t)m(yping)143
-5694 y Fe(\045)95 b(make)47 b(program_name)p eop
+5354 y(The)f(F)-8 b(ortran)31 b(wrapp)s(ers)d(in)g(CFITSIO)g(ma)m(y)j
+(b)s(e)e(tested)h(with)f(the)h(testf77)h(program.)40
+b(On)29 b(Unix)g(systems)h(the)0 5467 y(fortran)g(compilation)f(and)h
+(link)e(command)i(ma)m(y)h(b)s(e)f(called)f('f77')j(or)e('g77',)j(dep)s
+(ending)28 b(on)i(the)g(system.)143 5714 y Fe(\045)48
+b(f77)f(-o)g(testf77)f(testf77.f)f(-L.)i(-lcfitsio)e(-lnsl)h(-lsocket)p
+eop
 %%Page: 7 13
 7 12 bop 0 299 a Fg(2.3.)72 b(LINKING)30 b(PR)m(OGRAMS)h(WITH)f(FITSIO)
-2041 b Fi(7)0 555 y Fd(2.3)135 b(Linking)45 b(Programs)h(with)f(FITSIO)
-0 807 y Fi(When)31 b(linking)d(applications)i(soft)m(w)m(are)i(with)e
-(the)h(FITSIO)f(library)-8 b(,)30 b(sev)m(eral)i(system)f(libraries)d
-(usually)h(need)0 920 y(to)d(b)s(e)f(sp)s(eci\014ed)f(on)h(the)h(link)e
-(comman)h(Unix)g(systems,)i(the)e(most)h(reliable)e(w)m(a)m(y)i(to)h
-(determine)d(what)i(libraries)0 1033 y(are)32 b(required)e(is)g(to)j(t)
-m(yp)s(e)e('mak)m(e)i(testprog')g(and)e(see)h(what)f(libraries)e(the)j
-(con\014gure)f(script)g(has)g(added.)43 b(The)0 1146
-y(t)m(ypical)23 b(libraries)e(that)j(ma)m(y)g(need)f(to)h(b)s(e)f
-(added)g(are)g(-lm)g(\(the)h(math)f(library\))f(and)h(-lnsl)e(and)i
-(-lso)s(c)m(k)m(et)i(\(needed)0 1259 y(only)h(for)g(FTP)g(and)g(HTTP)g
-(\014le)g(access\).)41 b(These)26 b(latter)h(2)g(libraries)d(are)j(not)
-g(needed)f(on)g(VMS)h(and)f(Windo)m(ws)0 1372 y(platforms,)k(b)s
+2041 b Fi(7)48 555 y Fe(or)143 668 y(\045)48 b(f77)f(-f)g(-o)g(testf77)
+f(testf77.f)f(-L.)i(-lcfitsio)188 b(\(under)46 b(SUN)h(O/S\))48
+781 y(or)143 894 y(\045)h(f77)f(-o)g(testf77)f(testf77.f)f(-Wl,-L.)h
+(-lcfitsio)f(-lm)i(-lnsl)f(-lsocket)g(\(HP/UX\))48 1007
+y(or)143 1120 y(\045)i(g77)f(-o)g(testf77)f(-s)h(testf77.f)e(-lcfitsio)
+g(-lcc_dynamic)g(-lncurses)g(\(Mac)i(OS-X\))143 1346
+y(\045)h(testf77)d(>)j(testf77.lis)143 1458 y(\045)g(diff)e
+(testf77.lis)f(testf77.out)143 1571 y(\045)j(cmp)f(testf77.fit)d
+(testf77.std)0 1817 y Fi(On)31 b(mac)m(hines)g(running)f(SUN)h(O/S,)h
+(F)-8 b(ortran)33 b(programs)e(m)m(ust)h(b)s(e)f(compiled)f(with)h(the)
+h('-f)7 b(')32 b(option)g(to)g(force)0 1930 y(double)24
+b(precision)g(v)-5 b(ariables)24 b(to)i(b)s(e)f(aligned)f(on)i(8-b)m
+(yte)h(b)s(oundarys)c(to)j(mak)m(e)h(the)e(fortran-declared)g(v)-5
+b(ariables)0 2043 y(compatible)32 b(with)f(C.)h(A)h(similar)d(compiler)
+h(option)h(ma)m(y)h(b)s(e)f(required)f(on)h(other)h(platforms.)47
+b(F)-8 b(ailing)31 b(to)i(use)0 2156 y(this)25 b(option)g(ma)m(y)h
+(cause)h(the)f(program)f(to)i(crash)e(on)h(FITSIO)f(routines)f(that)j
+(read)f(or)f(write)g(double)g(precision)0 2269 y(v)-5
+b(ariables.)0 2429 y(Also)30 b(note)h(that)f(on)g(some)h(systems,)f
+(the)h(output)e(listing)f(of)j(the)f(testf77)i(program)d(ma)m(y)i
+(di\013er)e(sligh)m(tly)f(from)0 2542 y(the)j(testf77.std)h(template,)f
+(if)f(leading)f(zeros)i(are)g(not)g(prin)m(ted)e(b)m(y)i(default)f(b)s
+(efore)g(the)h(decimal)e(p)s(oin)m(t)h(when)0 2655 y(using)f(F)i
+(format.)0 2815 y(A)f(few)h(other)f(utilit)m(y)f(programs)h(are)h
+(included)c(with)i(CFITSIO:)191 3060 y Fe(speed)46 b(-)i(measures)d
+(the)i(maximum)f(throughput)f(\(in)i(MB)g(per)g(second\))668
+3173 y(for)g(writing)f(and)h(reading)f(FITS)g(files)h(with)f(CFITSIO)
+191 3399 y(listhead)f(-)j(lists)e(all)h(the)g(header)f(keywords)g(in)h
+(any)g(FITS)f(file)191 3625 y(fitscopy)f(-)j(copies)e(any)h(FITS)g
+(file)f(\(especially)f(useful)h(in)h(conjunction)811
+3738 y(with)g(the)g(CFITSIO's)e(extended)h(input)g(filename)g(syntax\))
+191 3964 y(cookbook)f(-)j(a)f(sample)f(program)g(that)h(peforms)f
+(common)g(read)g(and)811 4077 y(write)h(operations)e(on)i(a)g(FITS)g
+(file.)191 4302 y(iter_a,)f(iter_b,)g(iter_c)g(-)h(examples)f(of)h(the)
+g(CFITSIO)f(iterator)f(routine)0 4548 y Fi(The)30 b(\014rst)f(4)i(of)g
+(these)g(utilit)m(y)d(programs)i(can)h(b)s(e)f(compiled)f(and)g(link)m
+(ed)g(b)m(y)h(t)m(yping)143 4794 y Fe(\045)95 b(make)47
+b(program_name)0 5125 y Fd(2.3)135 b(Linking)45 b(Programs)h(with)f
+(FITSIO)0 5375 y Fi(When)31 b(linking)d(applications)i(soft)m(w)m(are)i
+(with)e(the)h(FITSIO)f(library)-8 b(,)30 b(sev)m(eral)i(system)f
+(libraries)d(usually)h(need)0 5488 y(to)d(b)s(e)f(sp)s(eci\014ed)f(on)h
+(the)h(link)e(comman)h(Unix)g(systems,)i(the)e(most)h(reliable)e(w)m(a)
+m(y)i(to)h(determine)d(what)i(libraries)0 5601 y(are)32
+b(required)e(is)g(to)j(t)m(yp)s(e)e('mak)m(e)i(testprog')g(and)e(see)h
+(what)f(libraries)e(the)j(con\014gure)f(script)g(has)g(added.)43
+b(The)0 5714 y(t)m(ypical)23 b(libraries)e(that)j(ma)m(y)g(need)f(to)h
+(b)s(e)f(added)g(are)g(-lm)g(\(the)h(math)f(library\))f(and)h(-lnsl)e
+(and)i(-lso)s(c)m(k)m(et)i(\(needed)p eop
+%%Page: 8 14
+8 13 bop 0 299 a Fi(8)1896 b Fg(CHAPTER)30 b(2.)111 b(CREA)-8
+b(TING)31 b(FITSIO/CFITSIO)0 555 y Fi(only)26 b(for)g(FTP)g(and)g(HTTP)
+g(\014le)g(access\).)41 b(These)26 b(latter)h(2)g(libraries)d(are)j
+(not)g(needed)f(on)g(VMS)h(and)f(Windo)m(ws)0 668 y(platforms,)k(b)s
 (ecause)g(FTP)g(\014le)g(access)h(is)f(not)g(curren)m(tly)g(supp)s
-(orted)e(on)i(those)h(platforms.)0 1532 y(Note)36 b(that)f(when)e
+(orted)e(on)i(those)h(platforms.)0 828 y(Note)36 b(that)f(when)e
 (upgrading)f(to)j(a)g(new)m(er)f(v)m(ersion)g(of)h(CFITSIO)d(it)i(is)g
-(usually)e(necessa)m(y)j(to)g(recompile,)g(as)0 1645
-y(w)m(ell)29 b(as)i(relink,)e(the)h(programs)g(that)h(use)f(CFITSIO,)f
-(b)s(ecause)i(the)f(de\014nitions)e(in)h(\014tsio.h)h(often)g(c)m
-(hange.)0 1989 y Fd(2.4)135 b(Getting)46 b(Started)g(with)f(FITSIO)0
-2241 y Fi(In)32 b(order)h(to)h(e\013ectiv)m(ely)g(use)f(the)g(FITSIO)f
+(usually)e(necessa)m(y)j(to)g(recompile,)g(as)0 941 y(w)m(ell)29
+b(as)i(relink,)e(the)h(programs)g(that)h(use)f(CFITSIO,)f(b)s(ecause)i
+(the)f(de\014nitions)e(in)h(\014tsio.h)h(often)g(c)m(hange.)0
+1293 y Fd(2.4)135 b(Getting)46 b(Started)g(with)f(FITSIO)0
+1547 y Fi(In)32 b(order)h(to)h(e\013ectiv)m(ely)g(use)f(the)g(FITSIO)f
 (library)f(as)j(quic)m(kly)e(as)h(p)s(ossible,)f(it)h(is)f(recommended)
-h(that)g(new)0 2354 y(users)d(follo)m(w)f(these)i(steps:)0
-2515 y(1.)62 b(Read)38 b(the)f(follo)m(wing)f(`FITS)h(Primer')f(c)m
+h(that)g(new)0 1660 y(users)d(follo)m(w)f(these)i(steps:)0
+1820 y(1.)62 b(Read)38 b(the)f(follo)m(wing)f(`FITS)h(Primer')f(c)m
 (hapter)i(for)g(a)f(brief)f(o)m(v)m(erview)i(of)g(the)g(structure)e(of)
-i(FITS)f(\014les.)0 2627 y(This)24 b(is)h(esp)s(ecially)f(imp)s(ortan)m
+i(FITS)f(\014les.)0 1933 y(This)24 b(is)h(esp)s(ecially)f(imp)s(ortan)m
 (t)i(for)f(users)h(who)f(ha)m(v)m(e)i(not)g(previously)c(dealt)j(with)f
-(the)h(FITS)f(table)h(and)g(image)0 2740 y(extensions.)0
-2901 y(2.)41 b(W)-8 b(rite)31 b(a)g(simple)d(program)i(to)h(read)g(or)f
+(the)h(FITS)f(table)h(and)g(image)0 2046 y(extensions.)0
+2206 y(2.)41 b(W)-8 b(rite)31 b(a)g(simple)d(program)i(to)h(read)g(or)f
 (write)f(a)i(FITS)f(\014le)f(using)g(the)i(Basic)f(In)m(terface)i
-(routines.)0 3061 y(3.)41 b(Refer)28 b(to)i(the)f(co)s(okb)s(o)s(ok.f)g
+(routines.)0 2367 y(3.)41 b(Refer)28 b(to)i(the)f(co)s(okb)s(o)s(ok.f)g
 (program)f(that)i(is)e(included)e(with)h(this)h(release)h(for)f
-(examples)h(of)g(routines)e(that)0 3174 y(p)s(erform)i(v)-5
+(examples)h(of)g(routines)e(that)0 2479 y(p)s(erform)i(v)-5
 b(arious)29 b(common)i(FITS)f(\014le)f(op)s(erations.)0
-3334 y(4.)52 b(Read)34 b(Chapters)g(4)g(and)f(5)i(to)g(b)s(ecome)f
+2640 y(4.)52 b(Read)34 b(Chapters)g(4)g(and)f(5)i(to)g(b)s(ecome)f
 (familiar)e(with)g(the)j(con)m(v)m(en)m(tions)g(and)e(adv)-5
-b(anced)34 b(features)h(of)f(the)0 3447 y(FITSIO)29 b(in)m(terface.)0
-3607 y(5.)47 b(Scan)32 b(through)f(the)h(more)h(extensiv)m(e)f(set)h
+b(anced)34 b(features)h(of)f(the)0 2753 y(FITSIO)29 b(in)m(terface.)0
+2913 y(5.)47 b(Scan)32 b(through)f(the)h(more)h(extensiv)m(e)f(set)h
 (of)g(routines)e(that)h(are)h(pro)m(vided)e(in)g(the)h(`Adv)-5
-b(anced)32 b(In)m(terface'.)0 3720 y(These)22 b(routines)e(p)s(erform)h
+b(anced)32 b(In)m(terface'.)0 3026 y(These)22 b(routines)e(p)s(erform)h
 (more)h(sp)s(ecialized)e(functions)g(than)h(are)i(pro)m(vided)d(b)m(y)i
-(the)g(Basic)g(In)m(terface)h(routines.)0 4064 y Fd(2.5)135
-b(Example)46 b(Program)0 4316 y Fi(The)32 b(follo)m(wing)f(listing)f
+(the)g(Basic)g(In)m(terface)h(routines.)0 3378 y Fd(2.5)135
+b(Example)46 b(Program)0 3632 y Fi(The)32 b(follo)m(wing)f(listing)f
 (sho)m(ws)i(an)g(example)h(of)f(ho)m(w)h(to)g(use)f(the)g(FITSIO)g
-(routines)f(in)g(a)i(F)-8 b(ortran)33 b(program.)0 4429
+(routines)f(in)g(a)i(F)-8 b(ortran)33 b(program.)0 3745
 y(Refer)38 b(to)h(the)g(co)s(okb)s(o)s(ok.f)f(program)g(that)h(is)e
 (included)e(with)i(the)i(FITSIO)e(distribution)d(for)k(examples)g(of)0
-4542 y(other)31 b(FITS)e(programs.)286 4811 y Fe(program)46
-b(writeimage)0 5036 y(C)238 b(Create)46 b(a)i(FITS)f(primary)e(array)i
-(containing)e(a)i(2-D)g(image)286 5262 y(integer)f
+3858 y(other)31 b(FITS)e(programs.)286 4133 y Fe(program)46
+b(writeimage)0 4359 y(C)238 b(Create)46 b(a)i(FITS)f(primary)e(array)i
+(containing)e(a)i(2-D)g(image)286 4585 y(integer)f
 (status,unit,blocksize,bit)o(pix,)o(nax)o(is,n)o(axes)o(\(2\))286
-5375 y(integer)g(i,j,group,fpixel,nelement)o(s,ar)o(ray)o(\(300)o(,200)
-o(\))286 5488 y(character)g(filename*80)286 5601 y(logical)g
-(simple,extend)p eop
-%%Page: 8 14
-8 13 bop 0 299 a Fi(8)1896 b Fg(CHAPTER)30 b(2.)111 b(CREA)-8
-b(TING)31 b(FITSIO/CFITSIO)286 555 y Fe(status=0)0 668
-y(C)238 b(Name)47 b(of)g(the)g(FITS)g(file)f(to)i(be)f(created:)286
-781 y(filename='ATESTFILE.FITS')0 1007 y(C)238 b(Get)47
-b(an)g(unused)g(Logical)e(Unit)i(Number)f(to)h(use)g(to)g(create)f(the)
-h(FITS)g(file)286 1120 y(call)g(ftgiou\(unit,status\))0
-1346 y(C)238 b(create)46 b(the)h(new)g(empty)g(FITS)f(file)286
-1458 y(blocksize=1)286 1571 y(call)h(ftinit\(unit,filename,blo)o(cksi)o
-(ze,s)o(tat)o(us\))0 1797 y(C)238 b(initialize)45 b(parameters)g(about)
+4698 y(integer)g(i,j,group,fpixel,nelement)o(s,ar)o(ray)o(\(300)o(,200)
+o(\))286 4811 y(character)g(filename*80)286 4924 y(logical)g
+(simple,extend)286 5149 y(status=0)0 5262 y(C)238 b(Name)47
+b(of)g(the)g(FITS)g(file)f(to)i(be)f(created:)286 5375
+y(filename='ATESTFILE.FITS')0 5601 y(C)238 b(Get)47 b(an)g(unused)g
+(Logical)e(Unit)i(Number)f(to)h(use)g(to)g(create)f(the)h(FITS)g(file)
+286 5714 y(call)g(ftgiou\(unit,status\))p eop
+%%Page: 9 15
+9 14 bop 0 299 a Fg(2.6.)72 b(LEGAL)30 b(STUFF)2995 b
+Fi(9)0 668 y Fe(C)238 b(create)46 b(the)h(new)g(empty)g(FITS)f(file)286
+781 y(blocksize=1)286 894 y(call)h(ftinit\(unit,filename,blo)o(cksi)o
+(ze,s)o(tat)o(us\))0 1120 y(C)238 b(initialize)45 b(parameters)g(about)
 i(the)g(FITS)f(image)h(\(300)f(x)i(200)f(16-bit)f(integers\))286
-1910 y(simple=.true.)286 2023 y(bitpix=16)286 2136 y(naxis=2)286
-2249 y(naxes\(1\)=300)286 2362 y(naxes\(2\)=200)286 2475
-y(extend=.true.)0 2700 y(C)238 b(write)47 b(the)g(required)e(header)h
-(keywords)286 2813 y(call)h(ftphpr\(unit,simple,bitpi)o(x,na)o(xis,)o
-(nax)o(es,0)o(,1,e)o(xte)o(nd,s)o(tatu)o(s\))0 3039 y(C)238
+1233 y(simple=.true.)286 1346 y(bitpix=16)286 1458 y(naxis=2)286
+1571 y(naxes\(1\)=300)286 1684 y(naxes\(2\)=200)286 1797
+y(extend=.true.)0 2023 y(C)238 b(write)47 b(the)g(required)e(header)h
+(keywords)286 2136 y(call)h(ftphpr\(unit,simple,bitpi)o(x,na)o(xis,)o
+(nax)o(es,0)o(,1,e)o(xte)o(nd,s)o(tatu)o(s\))0 2362 y(C)238
 b(initialize)45 b(the)i(values)f(in)i(the)e(image)h(with)f(a)i(linear)e
-(ramp)h(function)286 3152 y(do)h(j=1,naxes\(2\))477 3265
-y(do)f(i=1,naxes\(1\))668 3378 y(array\(i,j\)=i+j)477
-3491 y(end)g(do)286 3604 y(end)g(do)0 3830 y(C)238 b(write)47
-b(the)g(array)f(to)h(the)g(FITS)g(file)286 3942 y(group=1)286
-4055 y(fpixel=1)286 4168 y(nelements=naxes\(1\)*naxes\(2)o(\))286
-4281 y(call)g(ftpprj\(unit,group,fpixel)o(,nel)o(emen)o(ts,)o(arra)o
-(y,st)o(atu)o(s\))0 4507 y(C)238 b(write)47 b(another)f(optional)f
-(keyword)h(to)h(the)g(header)286 4620 y(call)g
+(ramp)h(function)286 2475 y(do)h(j=1,naxes\(2\))477 2588
+y(do)f(i=1,naxes\(1\))668 2700 y(array\(i,j\)=i+j)477
+2813 y(end)g(do)286 2926 y(end)g(do)0 3152 y(C)238 b(write)47
+b(the)g(array)f(to)h(the)g(FITS)g(file)286 3265 y(group=1)286
+3378 y(fpixel=1)286 3491 y(nelements=naxes\(1\)*naxes\(2)o(\))286
+3604 y(call)g(ftpprj\(unit,group,fpixel)o(,nel)o(emen)o(ts,)o(arra)o
+(y,st)o(atu)o(s\))0 3830 y(C)238 b(write)47 b(another)f(optional)f
+(keyword)h(to)h(the)g(header)286 3942 y(call)g
 (ftpkyj\(unit,'EXPOSURE',1)o(500,)o('Tot)o(al)41 b(Exposure)46
-b(Time',status\))0 4846 y(C)238 b(close)47 b(the)g(file)f(and)h(free)g
-(the)g(unit)f(number)286 4959 y(call)h(ftclos\(unit,)d(status\))286
-5072 y(call)j(ftfiou\(unit,)d(status\))286 5185 y(end)p
-eop
-%%Page: 9 15
-9 14 bop 0 299 a Fg(2.6.)72 b(LEGAL)30 b(STUFF)2995 b
-Fi(9)0 555 y Fd(2.6)135 b(Legal)46 b(Stu\013)0 818 y
-Fi(Cop)m(yrigh)m(t)36 b(\(Unpublished{all)d(righ)m(ts)j(reserv)m(ed)h
-(under)e(the)i(cop)m(yrigh)m(t)g(la)m(ws)f(of)h(the)g(United)f
-(States\),)k(U.S.)0 931 y(Go)m(v)m(ernmen)m(t)30 b(as)g(represen)m(ted)
-e(b)m(y)h(the)g(Administrator)e(of)i(the)g(National)f(Aeronautics)h
-(and)f(Space)h(Adminis-)0 1044 y(tration.)41 b(No)31
-b(cop)m(yrigh)m(t)f(is)g(claimed)f(in)g(the)i(United)e(States)i(under)e
-(Title)h(17,)h(U.S.)f(Co)s(de.)0 1204 y(P)m(ermission)e(to)i(freely)e
-(use,)i(cop)m(y)-8 b(,)31 b(mo)s(dify)-8 b(,)28 b(and)h(distribute)e
-(this)h(soft)m(w)m(are)j(and)e(its)g(do)s(cumen)m(tation)g(without)0
-1317 y(fee)g(is)e(hereb)m(y)h(gran)m(ted,)i(pro)m(vided)d(that)i(this)e
-(cop)m(yrigh)m(t)i(notice)f(and)g(disclaimer)e(of)i(w)m(arran)m(t)m(y)i
-(app)s(ears)d(in)g(all)0 1430 y(copies.)0 1590 y(DISCLAIMER:)0
-1750 y(THE)33 b(SOFTW)-10 b(ARE)32 b(IS)g(PR)m(O)m(VIDED)i('AS)f(IS')g
+b(Time',status\))0 4168 y(C)238 b(close)47 b(the)g(file)f(and)h(free)g
+(the)g(unit)f(number)286 4281 y(call)h(ftclos\(unit,)d(status\))286
+4394 y(call)j(ftfiou\(unit,)d(status\))286 4507 y(end)0
+4850 y Fd(2.6)135 b(Legal)46 b(Stu\013)0 5102 y Fi(Cop)m(yrigh)m(t)36
+b(\(Unpublished{all)d(righ)m(ts)j(reserv)m(ed)h(under)e(the)i(cop)m
+(yrigh)m(t)g(la)m(ws)f(of)h(the)g(United)f(States\),)k(U.S.)0
+5215 y(Go)m(v)m(ernmen)m(t)30 b(as)g(represen)m(ted)e(b)m(y)h(the)g
+(Administrator)e(of)i(the)g(National)f(Aeronautics)h(and)f(Space)h
+(Adminis-)0 5328 y(tration.)41 b(No)31 b(cop)m(yrigh)m(t)f(is)g
+(claimed)f(in)g(the)i(United)e(States)i(under)e(Title)h(17,)h(U.S.)f
+(Co)s(de.)0 5488 y(P)m(ermission)e(to)i(freely)e(use,)i(cop)m(y)-8
+b(,)31 b(mo)s(dify)-8 b(,)28 b(and)h(distribute)e(this)h(soft)m(w)m
+(are)j(and)e(its)g(do)s(cumen)m(tation)g(without)0 5601
+y(fee)g(is)e(hereb)m(y)h(gran)m(ted,)i(pro)m(vided)d(that)i(this)e(cop)
+m(yrigh)m(t)i(notice)f(and)g(disclaimer)e(of)i(w)m(arran)m(t)m(y)i(app)
+s(ears)d(in)g(all)0 5714 y(copies.)41 b(\(Ho)m(w)m(ev)m(er,)33
+b(see)e(the)f(restriction)f(on)i(the)f(use)g(of)h(the)f(gzip)g
+(compression)g(co)s(de,)h(b)s(elo)m(w\).)p eop
+%%Page: 10 16
+10 15 bop 0 299 a Fi(10)1851 b Fg(CHAPTER)30 b(2.)111
+b(CREA)-8 b(TING)31 b(FITSIO/CFITSIO)0 555 y Fi(DISCLAIMER:)0
+715 y(THE)i(SOFTW)-10 b(ARE)32 b(IS)g(PR)m(O)m(VIDED)i('AS)f(IS')g
 (WITHOUT)f(ANY)i(W)-10 b(ARRANTY)33 b(OF)g(ANY)h(KIND,)f(EI-)0
-1863 y(THER)42 b(EXPRESSED,)f(IMPLIED,)i(OR)e(ST)-8 b(A)g(TUTOR)g(Y,)43
-b(INCLUDING,)f(BUT)h(NOT)e(LIMITED)h(TO,)0 1976 y(ANY)33
+828 y(THER)42 b(EXPRESSED,)f(IMPLIED,)i(OR)e(ST)-8 b(A)g(TUTOR)g(Y,)43
+b(INCLUDING,)f(BUT)h(NOT)e(LIMITED)h(TO,)0 941 y(ANY)33
 b(W)-10 b(ARRANTY)33 b(THA)-8 b(T)32 b(THE)g(SOFTW)-10
 b(ARE)32 b(WILL)g(CONF)m(ORM)g(TO)g(SPECIFICA)-8 b(TIONS,)30
-b(ANY)0 2089 y(IMPLIED)38 b(W)-10 b(ARRANTIES)37 b(OF)h(MER)m(CHANT)-8
+b(ANY)0 1054 y(IMPLIED)38 b(W)-10 b(ARRANTIES)37 b(OF)h(MER)m(CHANT)-8
 b(ABILITY,)38 b(FITNESS)f(F)m(OR)h(A)g(P)-8 b(AR)g(TICULAR)38
-b(PUR-)0 2202 y(POSE,)24 b(AND)i(FREEDOM)f(FR)m(OM)h(INFRINGEMENT,)g
+b(PUR-)0 1167 y(POSE,)24 b(AND)i(FREEDOM)f(FR)m(OM)h(INFRINGEMENT,)g
 (AND)f(ANY)h(W)-10 b(ARRANTY)25 b(THA)-8 b(T)25 b(THE)g(DOC-)0
-2315 y(UMENT)-8 b(A)g(TION)31 b(WILL)f(CONF)m(ORM)h(TO)e(THE)h(SOFTW)
+1280 y(UMENT)-8 b(A)g(TION)31 b(WILL)f(CONF)m(ORM)h(TO)e(THE)h(SOFTW)
 -10 b(ARE,)30 b(OR)g(ANY)h(W)-10 b(ARRANTY)31 b(THA)-8
-b(T)30 b(THE)0 2428 y(SOFTW)-10 b(ARE)31 b(WILL)h(BE)g(ERR)m(OR)g
+b(T)30 b(THE)0 1393 y(SOFTW)-10 b(ARE)31 b(WILL)h(BE)g(ERR)m(OR)g
 (FREE.)g(IN)g(NO)f(EVENT)h(SHALL)f(NASA)h(BE)g(LIABLE)g(F)m(OR)g(ANY)0
-2541 y(D)m(AMA)m(GES,)26 b(INCLUDING,)e(BUT)f(NOT)g(LIMITED)h(TO,)f
-(DIRECT,)g(INDIRECT,)g(SPECIAL)f(OR)h(CON-)0 2654 y(SEQUENTIAL)28
+1506 y(D)m(AMA)m(GES,)26 b(INCLUDING,)e(BUT)f(NOT)g(LIMITED)h(TO,)f
+(DIRECT,)g(INDIRECT,)g(SPECIAL)f(OR)h(CON-)0 1619 y(SEQUENTIAL)28
 b(D)m(AMA)m(GES,)k(ARISING)d(OUT)g(OF,)h(RESUL)-8 b(TING)29
 b(FR)m(OM,)h(OR)f(IN)h(ANY)g(W)-10 b(A)i(Y)30 b(CON-)0
-2766 y(NECTED)25 b(WITH)g(THIS)f(SOFTW)-10 b(ARE,)25
+1732 y(NECTED)25 b(WITH)g(THIS)f(SOFTW)-10 b(ARE,)25
 b(WHETHER)g(OR)g(NOT)g(BASED)g(UPON)g(W)-10 b(ARRANTY,)26
-b(CON-)0 2879 y(TRA)m(CT,)d(TOR)-8 b(T)23 b(,)g(OR)g(OTHER)-10
+b(CON-)0 1844 y(TRA)m(CT,)d(TOR)-8 b(T)23 b(,)g(OR)g(OTHER)-10
 b(WISE,)22 b(WHETHER)i(OR)f(NOT)f(INJUR)-8 b(Y)24 b(W)-10
-b(AS)23 b(SUST)-8 b(AINED)23 b(BY)h(PER-)0 2992 y(SONS)h(OR)i(PR)m
+b(AS)23 b(SUST)-8 b(AINED)23 b(BY)h(PER-)0 1957 y(SONS)h(OR)i(PR)m
 (OPER)-8 b(TY)26 b(OR)g(OTHER)-10 b(WISE,)26 b(AND)h(WHETHER)g(OR)f
-(NOT)g(LOSS)f(W)-10 b(AS)26 b(SUST)-8 b(AINED)0 3105
+(NOT)g(LOSS)f(W)-10 b(AS)26 b(SUST)-8 b(AINED)0 2070
 y(FR)m(OM,)37 b(OR)e(AR)m(OSE)h(OUT)f(OF)h(THE)g(RESUL)-8
 b(TS)35 b(OF,)h(OR)f(USE)h(OF,)g(THE)g(SOFTW)-10 b(ARE)35
-b(OR)g(SER-)0 3218 y(VICES)29 b(PR)m(O)m(VIDED)j(HEREUNDER.")0
-3378 y(The)37 b(\014le)f(compress.c)h(con)m(tains)h(\(sligh)m(tly)d(mo)
-s(di\014ed\))h(source)h(co)s(de)g(that)h(originally)d(came)j(from)e
-(gzip-1.2.4)0 3491 y(whic)m(h)31 b(is)h(freely)f(distributed)f(under)h
-(the)h(GNU)h(General)g(Public)d(Licence.)47 b(A)32 b(cop)m(y)i(of)e
-(the)h(GNU)g(licence)f(is)0 3604 y(included)c(at)j(the)f(b)s(eginning)e
-(of)j(that)f(\014le.)0 4002 y Fd(2.7)135 b(Ac)l(kno)l(wledgemen)l(ts)0
-4264 y Fi(The)29 b(dev)m(elopmen)m(t)g(of)h(man)m(y)f(of)h(the)f(p)s(o)
-m(w)m(erful)f(features)h(in)f(CFITSIO)g(w)m(as)i(made)f(p)s(ossible)e
+b(OR)g(SER-)0 2183 y(VICES)29 b(PR)m(O)m(VIDED)j(HEREUNDER.")0
+2343 y(The)i(\014le)h(compress.c)g(con)m(tains)g(\(sligh)m(tly)f(mo)s
+(di\014ed\))f(source)i(co)s(de)g(that)h(originally)c(came)k(from)f
+(gzip-1.2.4,)0 2456 y(cop)m(yrigh)m(t)26 b(\(C\))g(1992-1993)k(b)m(y)c
+(Jean-loup)f(Gailly)-8 b(.)38 b(This)24 b(gzip)h(co)s(de)h(is)f
+(distributed)e(under)i(the)h(GNU)g(General)0 2569 y(Public)k(License)i
+(and)f(th)m(us)h(requires)f(that)i(an)m(y)f(soft)m(w)m(are)i(that)f
+(uses)f(the)g(CFITSIO)f(library)f(\(whic)m(h)h(in)g(turn)0
+2682 y(uses)e(the)g(gzip)g(co)s(de\))h(m)m(ust)f(conform)g(to)h(the)f
+(pro)m(visions)e(in)h(the)i(GNU)g(General)f(Public)e(License.)40
+b(A)29 b(cop)m(y)h(of)0 2795 y(the)h(GNU)g(license)e(is)g(included)f
+(at)j(the)g(b)s(eginning)c(of)k(compress.c)g(\014le.)0
+2955 y(An)h(alternate)i(v)m(ersion)e(of)h(the)g(compress.c)g(\014le)f
+(\(called)g(compress)p 2381 2955 28 4 v 33 w(alternate.c\))i(is)e(pro)m
+(vided)f(for)i(users)e(who)0 3068 y(w)m(an)m(t)24 b(to)g(use)e(the)i
+(CFITSIO)d(library)g(but)h(are)h(un)m(willing)d(or)j(unable)e(to)j
+(publicly)c(release)j(their)f(soft)m(w)m(are)i(under)0
+3181 y(the)i(terms)g(of)g(the)g(GNU)h(General)e(Public)f(License.)39
+b(This)24 b(alternate)i(v)m(ersion)g(con)m(tains)g(non-functional)e
+(stubs)0 3294 y(for)g(the)h(\014le)e(compression)h(and)f(uncompression)
+g(routines)g(used)h(b)m(y)g(CFITSIO.)f(Replace)i(the)f(\014le)g
+(`compress.c')0 3407 y(with)32 b(`compress)p 600 3407
+V 33 w(alternate.c')j(b)s(efore)e(compiling)e(the)i(CFITSIO)f(library)
+-8 b(.)48 b(This)31 b(will)g(pro)s(duce)h(a)i(v)m(ersion)f(of)0
+3520 y(CFITSIO)20 b(whic)m(h)h(do)s(es)g(not)h(supp)s(ort)e(reading)h
+(or)h(writing)e(compressed)h(FITS)g(\014les)g(but)g(is)g(otherwise)g
+(iden)m(tical)0 3633 y(to)31 b(the)g(standard)e(v)m(ersion.)0
+4006 y Fd(2.7)135 b(Ac)l(kno)l(wledgemen)l(ts)0 4264
+y Fi(The)29 b(dev)m(elopmen)m(t)g(of)h(man)m(y)f(of)h(the)f(p)s(o)m(w)m
+(erful)f(features)h(in)f(CFITSIO)g(w)m(as)i(made)f(p)s(ossible)e
 (through)h(collab-)0 4377 y(orations)34 b(with)f(man)m(y)i(p)s(eople)e
 (or)i(organizations)f(from)g(around)f(the)i(w)m(orld.)51
 b(The)34 b(follo)m(wing,)g(in)f(particular,)0 4490 y(ha)m(v)m(e)f(made)
@@ -2663,73 +2763,79 @@ y(The)45 b(ISDC)g(also)g(pro)m(vided)f(the)i(template)g(parsing)e
 (y)m(er\))0 5714 y(routines)29 b(are)i(la)m(y)m(ered)g(on)f(top)h(of)f
 (CFITSIO)f(and)h(mak)m(e)h(extensiv)m(e)g(use)f(of)h(these)g(features.)
 p eop
-%%Page: 10 16
-10 15 bop 0 299 a Fi(10)1851 b Fg(CHAPTER)30 b(2.)111
-b(CREA)-8 b(TING)31 b(FITSIO/CFITSIO)0 555 y Fi(Uw)m(e)25
-b(Lammers)e(\(XMM/ESA/ESTEC,)h(The)g(Netherlands\))f(designed)g(the)h
-(high-p)s(erformance)e(lexical)h(pars-)0 668 y(ing)41
-b(algorithm)g(that)h(is)f(used)g(to)i(do)e(on-the-\015y)h(\014ltering)e
-(of)i(FITS)f(tables.)75 b(This)40 b(algorithm)h(essen)m(tially)0
-781 y(pre-compiles)34 b(the)i(user-supplied)c(selection)k(expression)e
-(in)m(to)i(a)g(form)g(that)g(can)g(b)s(e)f(rapidly)e(ev)-5
-b(aluated)36 b(for)0 894 y(eac)m(h)31 b(ro)m(w.)40 b(P)m(eter)31
-b(Wilson)d(\(RSTX,)h(NASA/GSF)m(C\))i(then)e(wrote)h(the)g(parsing)e
-(routines)g(used)h(b)m(y)g(CFITSIO)0 1007 y(based)i(on)f(Lammers')h
-(design,)f(com)m(bined)g(with)g(other)h(tec)m(hniques)f(suc)m(h)h(as)g
-(the)g(CFITSIO)f(iterator)h(routine)0 1120 y(to)f(further)d(enhance)i
-(the)g(data)h(pro)s(cessing)d(throughput.)39 b(This)27
-b(e\013ort)j(also)e(b)s(ene\014tted)h(from)f(a)h(m)m(uc)m(h)g(earlier)0
-1233 y(lexical)g(parsing)g(routine)h(that)h(w)m(as)f(dev)m(elop)s(ed)g
-(b)m(y)g(Ken)m(t)h(Blac)m(kburn)e(\(NASA/GSF)m(C\).)0
-1393 y(The)40 b(CFITSIO)g(iterator)h(function)e(is)h(lo)s(osely)g
+%%Page: 11 17
+11 16 bop 0 299 a Fg(2.7.)72 b(A)m(CKNO)m(WLEDGEMENTS)2515
+b Fi(11)0 555 y(Uw)m(e)25 b(Lammers)e(\(XMM/ESA/ESTEC,)h(The)g
+(Netherlands\))f(designed)g(the)h(high-p)s(erformance)e(lexical)h
+(pars-)0 668 y(ing)41 b(algorithm)g(that)h(is)f(used)g(to)i(do)e
+(on-the-\015y)h(\014ltering)e(of)i(FITS)f(tables.)75
+b(This)40 b(algorithm)h(essen)m(tially)0 781 y(pre-compiles)34
+b(the)i(user-supplied)c(selection)k(expression)e(in)m(to)i(a)g(form)g
+(that)g(can)g(b)s(e)f(rapidly)e(ev)-5 b(aluated)36 b(for)0
+894 y(eac)m(h)31 b(ro)m(w.)40 b(P)m(eter)31 b(Wilson)d(\(RSTX,)h
+(NASA/GSF)m(C\))i(then)e(wrote)h(the)g(parsing)e(routines)g(used)h(b)m
+(y)g(CFITSIO)0 1007 y(based)i(on)f(Lammers')h(design,)f(com)m(bined)g
+(with)g(other)h(tec)m(hniques)f(suc)m(h)h(as)g(the)g(CFITSIO)f
+(iterator)h(routine)0 1120 y(to)h(further)e(enhance)h(the)h(data)g(pro)
+s(cessing)e(throughput.)42 b(This)30 b(e\013ort)i(also)f(b)s
+(ene\014ted)f(from)h(a)h(m)m(uc)m(h)f(earlier)0 1233
+y(lexical)22 b(parsing)h(routine)f(that)i(w)m(as)g(dev)m(elop)s(ed)f(b)
+m(y)h(Ken)m(t)g(Blac)m(kburn)e(\(NASA/GSF)m(C\).)j(More)g(recen)m(tly)
+-8 b(,)26 b(Craig)0 1346 y(Markw)m(ardt)j(\(NASA/GSF)m(C\))g(implemen)m
+(ted)e(additional)f(functions)h(\(median,)h(a)m(v)m(erage,)k(stddev\))c
+(and)g(other)0 1458 y(enhancemen)m(ts)j(to)g(the)g(lexical)e(parser.)0
+1619 y(The)40 b(CFITSIO)g(iterator)h(function)e(is)h(lo)s(osely)g
 (based)h(on)f(similar)f(ideas)h(dev)m(elop)s(ed)g(for)h(the)g(XMM)g
-(Data)0 1506 y(Access)31 b(La)m(y)m(er.)0 1666 y(P)m(eter)25
+(Data)0 1732 y(Access)31 b(La)m(y)m(er.)0 1892 y(P)m(eter)25
 b(Wilson)e(\(RSTX,)h(NASA/GSF)m(C\))h(wrote)g(the)f(complete)h(set)f
 (of)h(F)-8 b(ortran-callable)24 b(wrapp)s(ers)e(for)i(all)f(the)0
-1779 y(CFITSIO)29 b(routines,)g(whic)m(h)g(in)g(turn)h(rely)f(on)i(the)
+2005 y(CFITSIO)29 b(routines,)g(whic)m(h)g(in)g(turn)h(rely)f(on)i(the)
 f(CF)m(OR)-8 b(TRAN)31 b(macro)g(dev)m(elop)s(ed)f(b)m(y)g(Burkhard)f
-(Buro)m(w.)0 1939 y(The)h(syn)m(tax)i(used)e(b)m(y)h(CFITSIO)f(for)g
+(Buro)m(w.)0 2165 y(The)h(syn)m(tax)i(used)e(b)m(y)h(CFITSIO)f(for)g
 (\014ltering)g(or)h(binning)c(input)i(FITS)i(\014les)f(is)g(based)g(on)
-h(ideas)g(dev)m(elop)s(ed)0 2052 y(for)41 b(the)g(AXAF)h(Science)f(Cen)
+h(ideas)g(dev)m(elop)s(ed)0 2278 y(for)41 b(the)g(AXAF)h(Science)f(Cen)
 m(ter)h(Data)h(Mo)s(del)d(b)m(y)h(Jonathan)g(McDo)m(w)m(ell,)k(An)m
-(tonella)c(F)-8 b(ruscione,)44 b(Aneta)0 2165 y(Siemigino)m(wsk)-5
+(tonella)c(F)-8 b(ruscione,)44 b(Aneta)0 2391 y(Siemigino)m(wsk)-5
 b(a)24 b(and)h(Bill)f(Jo)m(y)m(e.)41 b(See)26 b(h)m
 (ttp://heasarc.gsfc.nasa.go)m(v/do)s(cs/journal/axaf7.h)m(t)q(ml)31
-b(for)25 b(further)0 2278 y(description)j(of)j(the)g(AXAF)g(Data)h(Mo)s
-(del.)0 2438 y(The)j(\014le)f(decompression)g(co)s(de)h(w)m(ere)h(tak)m
+b(for)25 b(further)0 2503 y(description)j(of)j(the)g(AXAF)g(Data)h(Mo)s
+(del.)0 2664 y(The)j(\014le)f(decompression)g(co)s(de)h(w)m(ere)h(tak)m
 (en)g(directly)e(from)g(the)i(gzip)e(\(GNU)i(zip\))f(program)g(dev)m
-(elop)s(ed)f(b)m(y)0 2551 y(Jean-loup)29 b(Gailly)g(and)h(others.)0
-2711 y(Doug)h(Mink,)f(SA)m(O,)g(pro)m(vided)f(the)i(routines)e(for)h
+(elop)s(ed)f(b)m(y)0 2777 y(Jean-loup)29 b(Gailly)g(and)h(others.)0
+2937 y(Doug)h(Mink,)f(SA)m(O,)g(pro)m(vided)f(the)i(routines)e(for)h
 (con)m(v)m(erting)h(IRAF)g(format)g(images)f(in)m(to)g(FITS)g(format.)0
-2871 y(In)d(addition,)g(man)m(y)h(other)g(p)s(eople)f(ha)m(v)m(e)i
+3097 y(In)d(addition,)g(man)m(y)h(other)g(p)s(eople)f(ha)m(v)m(e)i
 (made)f(v)-5 b(aluable)27 b(con)m(tributions)f(to)j(the)f(dev)m
-(elopmen)m(t)g(of)g(CFITSIO.)0 2984 y(These)i(include)e(\(with)i(ap)s
+(elopmen)m(t)g(of)g(CFITSIO.)0 3210 y(These)i(include)e(\(with)i(ap)s
 (ologies)g(to)h(others)f(that)h(ma)m(y)g(ha)m(v)m(e)h(inadv)m(erten)m
-(tly)e(b)s(een)f(omitted\):)0 3144 y(Stev)m(e)g(Allen,)e(Carl)g(Ak)m
+(tly)e(b)s(een)f(omitted\):)0 3370 y(Stev)m(e)g(Allen,)e(Carl)g(Ak)m
 (erlof,)h(Keith)f(Arnaud,)h(Morten)g(Krabb)s(e)e(Barfo)s(ed,)j(Ken)m(t)
-f(Blac)m(kburn,)g(G)g(Bo)s(dammer,)0 3257 y(Romk)m(e)h(Bon)m(tek)m(o)s
+f(Blac)m(kburn,)g(G)g(Bo)s(dammer,)0 3483 y(Romk)m(e)h(Bon)m(tek)m(o)s
 (e,)i(Lucio)c(Chiapp)s(etti,)f(Keith)h(Costorf,)h(Robin)f(Corb)s(et,)h
-(John)e(Da)m(vis,)j(Ric)m(hard)e(Fink,)h(Ning)0 3370
+(John)e(Da)m(vis,)j(Ric)m(hard)e(Fink,)h(Ning)0 3596
 y(Gan,)h(Emily)c(Greene,)k(Jo)s(e)f(Harrington,)g(Cheng)f(Ho,)i(Phil)c
 (Ho)s(dge,)k(Jim)e(Ingham,)h(Y)-8 b(oshitak)j(a)28 b(Ishisaki,)e(Diab)0
-3483 y(Jerius,)k(Mark)i(Levine,)f(T)-8 b(o)s(dd)30 b(Karak)-5
+3709 y(Jerius,)k(Mark)i(Levine,)f(T)-8 b(o)s(dd)30 b(Karak)-5
 b(askian,)31 b(Edw)m(ard)g(King,)f(Scott)j(Ko)s(c)m(h,)e(Claire)f
-(Larkin,)g(Rob)i(Managan,)0 3596 y(Eric)37 b(Mandel,)i(John)e(Matto)m
+(Larkin,)g(Rob)i(Managan,)0 3822 y(Eric)37 b(Mandel,)i(John)e(Matto)m
 (x,)43 b(Carsten)37 b(Mey)m(er,)42 b(Emi)36 b(Miy)m(ata,)42
 b(Stefan)c(Mo)s(c)m(hnac)m(ki,)i(Mik)m(e)f(Noble,)g(Oliv)m(er)0
-3709 y(Ob)s(erdorf,)d(Cliv)m(e)g(P)m(age,)k(Arvind)34
+3934 y(Ob)s(erdorf,)d(Cliv)m(e)g(P)m(age,)k(Arvind)34
 b(P)m(armar,)k(Je\013)f(P)m(edelt)m(y)-8 b(,)39 b(Tim)c(P)m(earson,)k
-(Maren)e(Purv)m(es,)h(Scott)f(Randall,)0 3822 y(Chris)c(Rogers,)k
+(Maren)e(Purv)m(es,)h(Scott)f(Randall,)0 4047 y(Chris)c(Rogers,)k
 (Arnold)d(Rots,)j(Barry)f(Sc)m(hlesinger,)f(Robin)f(Stebbins,)g(Andrew)
-g(Szymk)m(o)m(wiak,)j(Allyn)d(T)-8 b(en-)0 3934 y(nan)m(t,)31
+g(Szymk)m(o)m(wiak,)j(Allyn)d(T)-8 b(en-)0 4160 y(nan)m(t,)31
 b(P)m(eter)g(T)-8 b(eub)s(en,)30 b(James)g(Theiler,)f(Doug)i(T)-8
 b(o)s(dy)g(,)31 b(Shiro)d(Ueno,)k(Stev)m(e)f(W)-8 b(alton,)32
-b(Arc)m(hie)e(W)-8 b(arno)s(c)m(k,)32 b(Alan)0 4047 y(W)-8
+b(Arc)m(hie)e(W)-8 b(arno)s(c)m(k,)32 b(Alan)0 4273 y(W)-8
 b(atson,)32 b(Dan)f(Whipple,)d(Wim)i(Wimmers,)g(P)m(eter)h(Y)-8
 b(oung,)31 b(Jianjun)d(Xu,)i(and)g(Nelson)g(Zarate.)p
 eop
-%%Page: 11 17
-11 16 bop 0 1225 a Ff(Chapter)65 b(3)0 1687 y Fl(A)78
+%%Page: 12 18
+12 17 bop 0 299 a Fi(12)1851 b Fg(CHAPTER)30 b(2.)111
+b(CREA)-8 b(TING)31 b(FITSIO/CFITSIO)p eop
+%%Page: 13 19
+13 18 bop 0 1225 a Ff(Chapter)65 b(3)0 1687 y Fl(A)78
 b(FITS)f(Primer)0 2180 y Fi(This)22 b(section)j(giv)m(es)f(a)h(brief)d
 (o)m(v)m(erview)j(of)f(the)h(structure)e(of)i(FITS)e(\014les.)37
 b(Users)24 b(should)f(refer)g(to)i(the)g(do)s(cumen-)0
@@ -2778,12 +2884,12 @@ y(An)m(y)30 b(un)m(used)g(space)g(is)g(padded)f(with)g(\014ll)f(c)m
 (haracters)k(\(ASCI)s(I)d(blanks)g(or)i(zeros\).)0 5219
 y(Eac)m(h)i(Header)f(Unit)g(consists)g(of)g(an)m(y)g(n)m(um)m(b)s(er)f
 (of)i(80-c)m(haracter)i(k)m(eyw)m(ord)d(records)g(or)g(`card)h(images')
-f(whic)m(h)0 5332 y(ha)m(v)m(e)g(thegeneral)e(form:)95
+f(whic)m(h)0 5332 y(ha)m(v)m(e)g(the)e(general)h(form:)95
 5601 y Fe(KEYNAME)46 b(=)i(value)e(/)i(comment)d(string)95
 5714 y(NULLKEY)h(=)334 b(/)48 b(comment:)d(This)i(keyword)f(has)g(no)i
-(value)1905 5942 y Fi(11)p eop
-%%Page: 12 18
-12 17 bop 0 299 a Fi(12)2398 b Fg(CHAPTER)30 b(3.)112
+(value)1905 5942 y Fi(13)p eop
+%%Page: 14 20
+14 19 bop 0 299 a Fi(14)2398 b Fg(CHAPTER)30 b(3.)112
 b(A)30 b(FITS)g(PRIMER)0 555 y Fi(The)35 b(k)m(eyw)m(ord)i(names)f(ma)m
 (y)g(b)s(e)g(up)f(to)h(8)h(c)m(haracters)g(long)f(and)f(can)h(only)g
 (con)m(tain)g(upp)s(ercase)f(letters,)j(the)0 668 y(digits)23
@@ -2833,70 +2939,77 @@ m(k)d(of)h(the)f(previous)f(Data)k(Unit)c(\(or)i(Header)g(Unit)f(if)f
 (extensions)g(are:)136 3172 y Fc(\017)46 b Fi(BITPIX)25
 b({)h(de\014nes)f(the)g(datat)m(yp)s(e)i(of)e(the)h(arra)m(y:)39
 b(8,)27 b(16,)g(32,)h(-32,)g(-64)e(for)f(unsigned)f(8{bit)h(b)m(yte,)j
-(16{bit)227 3284 y(in)m(teger,)g(32{bit)e(in)m(teger,)i(32{bit)f(IEEE)e
-(\015oating)h(p)s(oin)m(t,)g(and)g(64{bit)h(IEEE)e(double)g(precision)f
-(\015oating)227 3397 y(p)s(oin)m(t,)30 b(resp)s(ectiv)m(ely)-8
-b(.)136 3585 y Fc(\017)46 b Fi(NAXIS)30 b({)h(the)g(n)m(um)m(b)s(er)e
-(of)h(dimensions)e(in)h(the)i(arra)m(y)-8 b(,)31 b(usually)d(0,)j(1,)g
-(2,)g(3,)g(or)g(4.)136 3773 y Fc(\017)46 b Fi(NAXISn)30
-b({)h(\(n)f(ranges)g(from)g(1)h(to)g(NAXIS\))g(de\014nes)e(the)i(size)f
-(of)h(eac)m(h)g(dimension.)0 4008 y(FITS)e(tables)h(start)h(with)e(the)
-h(k)m(eyw)m(ord)g(XTENSION)g(=)f(`T)-8 b(ABLE')31 b(\(for)f(ASCI)s(I)f
-(tables\))h(or)g(XTENSION)f(=)0 4120 y(`BINT)-8 b(ABLE')32
-b(\(for)e(binary)f(tables\))h(and)g(ha)m(v)m(e)i(the)e(follo)m(wing)f
-(main)g(k)m(eyw)m(ords:)136 4355 y Fc(\017)46 b Fi(TFIELDS)30
-b({)h(n)m(um)m(b)s(er)e(of)h(\014elds)f(or)i(columns)e(in)g(the)h
-(table)136 4543 y Fc(\017)46 b Fi(NAXIS2)31 b({)g(n)m(um)m(b)s(er)e(of)
-h(ro)m(ws)h(in)e(the)h(table)136 4731 y Fc(\017)46 b
-Fi(TTYPEn)29 b({)i(for)f(eac)m(h)i(column)d(\(n)h(ranges)h(from)f(1)g
-(to)h(TFIELDS\))g(giv)m(es)f(the)h(name)f(of)h(the)f(column)136
-4918 y Fc(\017)46 b Fi(TF)m(ORMn)31 b({)f(the)h(datat)m(yp)s(e)g(of)g
-(the)f(column)136 5106 y Fc(\017)46 b Fi(TUNITn)30 b({)g(the)h(ph)m
-(ysical)e(units)g(of)h(the)h(column)e(\(optional\))0
-5341 y(Users)i(should)e(refer)i(to)h(the)g(NOST)e(do)s(cumen)m(tation)h
-(for)g(more)g(details)f(ab)s(out)h(the)h(required)d(k)m(eyw)m(ords)j
-(and)0 5454 y(their)d(allo)m(w)m(ed)i(v)-5 b(alues.)p
-eop
-%%Page: 13 19
-13 18 bop 0 1225 a Ff(Chapter)65 b(4)0 1687 y Fl(Extended)77
+(16{bit)227 3284 y(signed)38 b(in)m(teger,)j(32{bit)e(signed)e(in)m
+(teger,)k(32{bit)e(IEEE)f(\015oating)g(p)s(oin)m(t,)i(and)e(64{bit)h
+(IEEE)e(double)227 3397 y(precision)29 b(\015oating)h(p)s(oin)m(t,)g
+(resp)s(ectiv)m(ely)-8 b(.)136 3585 y Fc(\017)46 b Fi(NAXIS)30
+b({)h(the)g(n)m(um)m(b)s(er)e(of)h(dimensions)e(in)h(the)i(arra)m(y)-8
+b(,)31 b(usually)d(0,)j(1,)g(2,)g(3,)g(or)g(4.)136 3773
+y Fc(\017)46 b Fi(NAXISn)30 b({)h(\(n)f(ranges)g(from)g(1)h(to)g
+(NAXIS\))g(de\014nes)e(the)i(size)f(of)h(eac)m(h)g(dimension.)0
+4008 y(FITS)e(tables)h(start)h(with)e(the)h(k)m(eyw)m(ord)g(XTENSION)g
+(=)f(`T)-8 b(ABLE')31 b(\(for)f(ASCI)s(I)f(tables\))h(or)g(XTENSION)f
+(=)0 4120 y(`BINT)-8 b(ABLE')32 b(\(for)e(binary)f(tables\))h(and)g(ha)
+m(v)m(e)i(the)e(follo)m(wing)f(main)g(k)m(eyw)m(ords:)136
+4355 y Fc(\017)46 b Fi(TFIELDS)30 b({)h(n)m(um)m(b)s(er)e(of)h
+(\014elds)f(or)i(columns)e(in)g(the)h(table)136 4543
+y Fc(\017)46 b Fi(NAXIS2)31 b({)g(n)m(um)m(b)s(er)e(of)h(ro)m(ws)h(in)e
+(the)h(table)136 4731 y Fc(\017)46 b Fi(TTYPEn)29 b({)i(for)f(eac)m(h)i
+(column)d(\(n)h(ranges)h(from)f(1)g(to)h(TFIELDS\))g(giv)m(es)f(the)h
+(name)f(of)h(the)f(column)136 4918 y Fc(\017)46 b Fi(TF)m(ORMn)31
+b({)f(the)h(datat)m(yp)s(e)g(of)g(the)f(column)136 5106
+y Fc(\017)46 b Fi(TUNITn)30 b({)g(the)h(ph)m(ysical)e(units)g(of)h(the)
+h(column)e(\(optional\))0 5341 y(Users)e(should)e(refer)i(to)g(the)h
+(FITS)e(Supp)s(ort)f(O\016ce)i(at)h Fe(http://fits.gsfc.nasa.go)o(v)21
+b Fi(for)27 b(futher)f(informa-)0 5454 y(tion)k(ab)s(out)g(the)h(FITS)e
+(format)i(and)f(related)g(soft)m(w)m(are)i(pac)m(k)-5
+b(ages.)p eop
+%%Page: 15 21
+15 20 bop 0 1225 a Ff(Chapter)65 b(4)0 1687 y Fl(Extended)77
 b(File)g(Name)g(Syn)-6 b(tax)0 2216 y Fd(4.1)135 b(Ov)l(erview)0
-2472 y Fi(CFITSIO)30 b(supp)s(orts)f(an)j(extended)f(syn)m(tax)h(when)f
+2466 y Fi(CFITSIO)30 b(supp)s(orts)f(an)j(extended)f(syn)m(tax)h(when)f
 (sp)s(ecifying)e(the)j(name)f(of)h(the)g(data)g(\014le)e(to)i(b)s(e)f
-(op)s(ened)g(or)0 2585 y(created)g(that)g(includes)d(the)j(follo)m
-(wing)e(features:)136 2870 y Fc(\017)46 b Fi(CFITSIO)40
+(op)s(ened)g(or)0 2579 y(created)g(that)g(includes)d(the)j(follo)m
+(wing)e(features:)136 2813 y Fc(\017)46 b Fi(CFITSIO)40
 b(can)i(read)f(IRAF)h(format)g(images)f(whic)m(h)f(ha)m(v)m(e)j(header)
-e(\014le)g(names)g(that)h(end)f(with)f(the)227 2983 y('.imh')d
+e(\014le)g(names)g(that)h(end)f(with)f(the)227 2926 y('.imh')d
 (extension,)i(as)f(w)m(ell)e(as)i(reading)e(and)h(writing)e(FITS)i
 (\014les,)h(This)e(feature)i(is)e(implemen)m(ted)g(in)227
-3096 y(CFITSIO)29 b(b)m(y)i(\014rst)e(con)m(v)m(erting)j(the)e(IRAF)h
+3039 y(CFITSIO)29 b(b)m(y)i(\014rst)e(con)m(v)m(erting)j(the)e(IRAF)h
 (image)g(in)m(to)f(a)h(temp)s(orary)f(FITS)g(format)h(\014le)e(in)g
-(memory)-8 b(,)227 3209 y(then)35 b(op)s(ening)e(the)i(FITS)f(\014le.)
+(memory)-8 b(,)227 3152 y(then)35 b(op)s(ening)e(the)i(FITS)f(\014le.)
 53 b(An)m(y)35 b(of)g(the)g(usual)e(CFITSIO)h(routines)f(then)i(ma)m(y)
-g(b)s(e)f(used)g(to)i(read)227 3322 y(the)31 b(image)f(header)h(or)f
-(data.)136 3534 y Fc(\017)46 b Fi(FITS)37 b(\014les)g(on)g(the)h(in)m
-(ternet)g(can)g(b)s(e)f(read)g(\(and)g(sometimes)h(written\))f(using)f
-(the)i(FTP)-8 b(,)38 b(HTTP)-8 b(,)38 b(or)227 3647 y(R)m(OOT)30
-b(proto)s(cols.)136 3860 y Fc(\017)46 b Fi(FITS)30 b(\014les)f(can)i(b)
+g(b)s(e)f(used)g(to)i(read)227 3265 y(the)31 b(image)f(header)g(or)h
+(data.)41 b(Similarly)-8 b(,)27 b(ra)m(w)j(binary)f(data)i(arra)m(ys)f
+(can)h(b)s(e)f(read)g(b)m(y)g(con)m(v)m(erting)h(them)227
+3378 y(on)g(the)f(\015y)g(in)m(to)g(virtual)f(FITS)h(images.)136
+3557 y Fc(\017)46 b Fi(FITS)37 b(\014les)g(on)g(the)h(in)m(ternet)g
+(can)g(b)s(e)f(read)g(\(and)g(sometimes)h(written\))f(using)f(the)i
+(FTP)-8 b(,)38 b(HTTP)-8 b(,)38 b(or)227 3670 y(R)m(OOT)30
+b(proto)s(cols.)136 3849 y Fc(\017)46 b Fi(FITS)30 b(\014les)f(can)i(b)
 s(e)f(pip)s(ed)e(b)s(et)m(w)m(een)j(tasks)f(on)h(the)f(stdin)f(and)h
-(stdout)g(streams.)136 4073 y Fc(\017)46 b Fi(FITS)20
+(stdout)g(streams.)136 4028 y Fc(\017)46 b Fi(FITS)20
 b(\014les)g(can)h(b)s(e)f(read)g(and)g(written)g(in)f(shared)h(memory)
 -8 b(.)38 b(This)19 b(can)i(p)s(oten)m(tially)e(ac)m(hiev)m(e)j(m)m(uc)
-m(h)f(b)s(etter)227 4186 y(data)26 b(I/O)e(p)s(erformance)g(compared)h
+m(h)f(b)s(etter)227 4141 y(data)26 b(I/O)e(p)s(erformance)g(compared)h
 (to)h(reading)e(and)g(writing)e(the)j(same)h(FITS)e(\014les)f(on)i
-(magnetic)g(disk.)136 4398 y Fc(\017)46 b Fi(Compressed)30
+(magnetic)g(disk.)136 4320 y Fc(\017)46 b Fi(Compressed)30
 b(FITS)f(\014les)h(in)f(gzip)h(or)g(Unix)f(COMPRESS)g(format)h(can)h(b)
-s(e)f(directly)f(read.)136 4611 y Fc(\017)46 b Fi(FITS)26
-b(table)g(columns)f(can)i(b)s(e)f(created,)i(mo)s(di\014ed,)e(or)g
-(deleted)g('on-the-\015y')h(as)g(the)g(table)f(is)f(op)s(ened)h(b)m(y)
-227 4724 y(CFITSIO.)32 b(This)g(creates)j(a)e(virtual)f(FITS)h(\014le)f
-(con)m(taining)h(the)h(mo)s(di\014cations)d(that)j(is)f(then)g(op)s
-(ened)227 4837 y(b)m(y)e(the)f(application)f(program.)136
-5050 y Fc(\017)46 b Fi(T)-8 b(able)28 b(ro)m(ws)f(ma)m(y)i(b)s(e)e
+s(e)f(directly)f(read.)136 4499 y Fc(\017)46 b Fi(Output)28
+b(FITS)h(\014les)f(can)h(b)s(e)g(written)f(directly)g(in)f(compressed)i
+(gzip)g(format,)h(th)m(us)e(sa)m(ving)h(disk)f(space.)136
+4678 y Fc(\017)46 b Fi(FITS)26 b(table)g(columns)f(can)i(b)s(e)f
+(created,)i(mo)s(di\014ed,)e(or)g(deleted)g('on-the-\015y')h(as)g(the)g
+(table)f(is)f(op)s(ened)h(b)m(y)227 4791 y(CFITSIO.)32
+b(This)g(creates)j(a)e(virtual)f(FITS)h(\014le)f(con)m(taining)h(the)h
+(mo)s(di\014cations)d(that)j(is)f(then)g(op)s(ened)227
+4904 y(b)m(y)e(the)f(application)f(program.)136 5083
+y Fc(\017)46 b Fi(T)-8 b(able)28 b(ro)m(ws)f(ma)m(y)i(b)s(e)e
 (selected,)i(or)f(\014ltered)f(out,)h(on)g(the)g(\015y)f(when)g(the)h
-(table)g(is)f(op)s(ened)g(b)m(y)g(CFITSIO,)227 5162 y(based)f(on)h(an)f
+(table)g(is)f(op)s(ened)g(b)m(y)g(CFITSIO,)227 5196 y(based)f(on)h(an)f
 (arbitrary)g(user-sp)s(eci\014ed)e(expression.)38 b(Only)25
 b(ro)m(ws)i(for)f(whic)m(h)f(the)i(expression)e(ev)-5
-b(aluates)227 5275 y(to)31 b('TR)m(UE')g(are)g(retained)f(in)f(the)h
+b(aluates)227 5309 y(to)31 b('TR)m(UE')g(are)g(retained)f(in)f(the)h
 (cop)m(y)i(of)e(the)h(table)f(that)h(is)e(op)s(ened)h(b)m(y)g(the)h
 (application)d(program.)136 5488 y Fc(\017)46 b Fi(Histogram)27
 b(images)g(ma)m(y)g(b)s(e)f(created)h(on)f(the)h(\015y)f(b)m(y)g
@@ -2904,9 +3017,9 @@ b(images)g(ma)m(y)g(b)s(e)f(created)h(on)f(the)h(\015y)f(b)m(y)g
 227 5601 y(in)35 b(a)h(virtual)f(N-dimensional)e(FITS)j(image.)58
 b(The)35 b(application)f(program)i(then)g(only)f(sees)h(the)h(FITS)227
 5714 y(image)31 b(\(in)e(the)i(primary)d(arra)m(y\))k(instead)d(of)i
-(the)f(original)f(FITS)g(table.)1905 5942 y(13)p eop
-%%Page: 14 20
-14 19 bop 0 299 a Fi(14)1618 b Fg(CHAPTER)30 b(4.)112
+(the)f(original)f(FITS)g(table.)1905 5942 y(15)p eop
+%%Page: 16 22
+16 21 bop 0 299 a Fi(16)1618 b Fg(CHAPTER)30 b(4.)112
 b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(The)43
 b(latter)h(3)g(features)g(in)e(particular)g(add)h(v)m(ery)h(p)s(o)m(w)m
 (erful)e(data)i(pro)s(cessing)e(capabilities)g(directly)g(in)m(to)0
@@ -2933,116 +3046,125 @@ b(these)i(functions)d(ha)m(v)m(e)k(b)s(een)d(co)s(ded)h(using)e(new)i
 (names)h(in)f(the)i(next)g(section,)g(here)0 1732 y(are)d(a)g(few)f
 (examples)g(of)g(FITS)g(\014le)f(names)i(that)f(giv)m(e)h(a)g(quic)m(k)
 f(o)m(v)m(erview)h(of)g(the)f(allo)m(w)m(ed)g(syn)m(tax:)136
-2005 y Fc(\017)46 b Fe('myfile.fits')p Fi(:)37 b(the)31
+1960 y Fc(\017)46 b Fe('myfile.fits')p Fi(:)37 b(the)31
 b(simplest)d(case)k(of)e(a)h(FITS)f(\014le)f(on)i(disk)d(in)i(the)g
-(curren)m(t)g(directory)-8 b(.)136 2207 y Fc(\017)46
+(curren)m(t)g(directory)-8 b(.)136 2137 y Fc(\017)46
 b Fe('myfile.imh')p Fi(:)37 b(op)s(ens)28 b(an)h(IRAF)g(format)g(image)
 h(\014le)e(and)g(con)m(v)m(erts)i(it)f(on)g(the)g(\015y)f(in)m(to)h(a)g
-(temp)s(orary)227 2320 y(FITS)h(format)h(image)f(in)f(memory)i(whic)m
+(temp)s(orary)227 2250 y(FITS)h(format)h(image)f(in)f(memory)i(whic)m
 (h)e(can)h(then)g(b)s(e)g(read)g(with)f(an)m(y)i(other)g(CFITSIO)e
-(routine.)136 2521 y Fc(\017)46 b Fe('myfile.fits.gz[events,)c(2]')p
+(routine.)136 2427 y Fc(\017)46 b Fe(rawfile.dat[i512,512])p
+Fi(:)35 b(op)s(ens)30 b(a)g(ra)m(w)h(binary)d(data)j(arra)m(y)g(\(a)g
+(512)g(x)f(512)i(short)e(in)m(teger)g(arra)m(y)h(in)227
+2540 y(this)h(case\))j(and)d(con)m(v)m(erts)j(it)d(on)h(the)g(\015y)g
+(in)m(to)g(a)g(temp)s(orary)g(FITS)f(format)h(image)h(in)d(memory)i
+(whic)m(h)227 2652 y(can)e(then)f(b)s(e)g(read)g(with)f(an)m(y)i(other)
+f(CFITSIO)f(routine.)136 2830 y Fc(\017)46 b Fe(myfile.fits.gz)p
+Fi(:)d(if)32 b(this)g(is)g(the)h(name)g(of)h(a)f(new)g(output)g
+(\014le,)g(the)g('.gz')i(su\016x)d(will)e(cause)k(it)f(to)h(b)s(e)227
+2942 y(compressed)c(in)f(gzip)h(format)h(when)e(it)h(is)g(written)f(to)
+i(disk.)136 3120 y Fc(\017)46 b Fe('myfile.fits.gz[events,)c(2]')p
 Fi(:)59 b(op)s(ens)40 b(and)f(uncompresses)g(the)i(gzipp)s(ed)d(\014le)
-i(m)m(y\014le.\014ts)f(then)227 2634 y(mo)m(v)m(es)34
+i(m)m(y\014le.\014ts)f(then)227 3232 y(mo)m(v)m(es)34
 b(to)f(the)f(extension)g(whic)m(h)f(has)g(the)i(k)m(eyw)m(ords)f
-(EXTNAME)g(=)g('EVENTS')g(and)g(EXTVER)f(=)227 2747 y(2.)136
-2948 y Fc(\017)46 b Fe('-')p Fi(:)40 b(a)31 b(dash)f(\(min)m(us)f
+(EXTNAME)g(=)g('EVENTS')g(and)g(EXTVER)f(=)227 3345 y(2.)136
+3522 y Fc(\017)46 b Fe('-')p Fi(:)40 b(a)31 b(dash)f(\(min)m(us)f
 (sign\))h(signi\014es)e(that)j(the)g(input)e(\014le)g(is)h(to)h(b)s(e)f
-(read)g(from)g(the)h(stdin)e(\014le)g(stream,)227 3061
+(read)g(from)g(the)h(stdin)e(\014le)g(stream,)227 3635
 y(or)i(that)g(the)f(output)g(\014le)g(is)f(to)i(b)s(e)f(written)f(to)i
-(the)g(stdout)f(stream.)136 3263 y Fc(\017)46 b Fe
+(the)g(stdout)f(stream.)136 3812 y Fc(\017)46 b Fe
 ('ftp://legacy.gsfc.nasa.g)o(ov/t)o(est/)o(vel)o(a.fi)o(ts')p
 Fi(:)33 b(FITS)28 b(\014les)f(in)g(an)m(y)h(ftp)g(arc)m(hiv)m(e)h(site)
-f(on)g(the)227 3376 y(in)m(ternet)i(ma)m(y)h(b)s(e)f(directly)f(op)s
-(ened)h(with)f(read-only)h(access.)136 3577 y Fc(\017)46
+f(on)g(the)227 3925 y(in)m(ternet)i(ma)m(y)h(b)s(e)f(directly)f(op)s
+(ened)h(with)f(read-only)h(access.)136 4102 y Fc(\017)46
 b Fe('http://legacy.gsfc.nasa.)o(gov/)o(soft)o(war)o(e/te)o(st.f)o(its)
 o(')p Fi(:)d(an)m(y)34 b(v)-5 b(alid)33 b(URL)h(to)h(a)f(FITS)g(\014le)
-f(on)227 3690 y(the)e(W)-8 b(eb)31 b(ma)m(y)g(b)s(e)f(op)s(ened)f(with)
-g(read-only)h(access.)136 3892 y Fc(\017)46 b Fe
+f(on)227 4215 y(the)e(W)-8 b(eb)31 b(ma)m(y)g(b)s(e)f(op)s(ened)f(with)
+g(read-only)h(access.)136 4392 y Fc(\017)46 b Fe
 ('root://legacy.gsfc.nasa.)o(gov/)o(test)o(/ve)o(la.f)o(its')o
 Fi(:)32 b(similar)21 b(to)j(ftp)f(access)i(except)g(that)f(it)f(pro-)
-227 4005 y(vides)29 b(write)h(as)g(w)m(ell)f(as)i(read)f(access)h(to)g
+227 4505 y(vides)29 b(write)h(as)g(w)m(ell)f(as)i(read)f(access)h(to)g
 (the)f(\014les)g(across)g(the)h(net)m(w)m(ork.)41 b(This)28
-b(uses)i(the)h(ro)s(ot)f(proto)s(col)227 4117 y(dev)m(elop)s(ed)g(at)h
-(CERN.)136 4319 y Fc(\017)46 b Fe('shmem://h2[events]')p
+b(uses)i(the)h(ro)s(ot)f(proto)s(col)227 4618 y(dev)m(elop)s(ed)g(at)h
+(CERN.)136 4795 y Fc(\017)46 b Fe('shmem://h2[events]')p
 Fi(:)35 b(op)s(ens)30 b(the)g(FITS)f(\014le)h(in)f(a)h(shared)f(memory)
-i(segmen)m(t)g(and)e(mo)m(v)m(es)j(to)f(the)227 4432
-y(EVENTS)f(extension.)136 4633 y Fc(\017)46 b Fe('mem://')p
+i(segmen)m(t)g(and)e(mo)m(v)m(es)j(to)f(the)227 4908
+y(EVENTS)f(extension.)136 5085 y Fc(\017)46 b Fe('mem://')p
 Fi(:)52 b(creates)39 b(a)e(scratc)m(h)i(output)d(\014le)h(in)e(core)j
 (computer)f(memory)-8 b(.)62 b(The)37 b(resulting)e('\014le')i(will)227
-4746 y(disapp)s(ear)24 b(when)g(the)i(program)f(exits,)h(so)g(this)e
+5198 y(disapp)s(ear)24 b(when)g(the)i(program)f(exits,)h(so)g(this)e
 (is)h(mainly)e(useful)h(for)h(testing)h(purp)s(oses)d(when)i(one)g(do)s
-(es)227 4859 y(not)31 b(w)m(an)m(t)g(a)g(p)s(ermanen)m(t)f(cop)m(y)h
-(of)f(the)h(output)f(\014le.)136 5061 y Fc(\017)46 b
+(es)227 5311 y(not)31 b(w)m(an)m(t)g(a)g(p)s(ermanen)m(t)f(cop)m(y)h
+(of)f(the)h(output)f(\014le.)136 5488 y Fc(\017)46 b
 Fe('myfile.fits[3;)e(Images\(10\)]')p Fi(:)49 b(op)s(ens)35
 b(a)i(cop)m(y)g(of)f(the)g(image)h(con)m(tained)f(in)f(the)i(10th)f(ro)
-m(w)h(of)227 5174 y(the)26 b('Images')i(column)c(in)h(the)h(binary)f
+m(w)h(of)227 5601 y(the)26 b('Images')i(column)c(in)h(the)h(binary)f
 (table)g(in)g(the)h(3th)h(extension)e(of)h(the)h(FITS)e(\014le.)38
-b(The)26 b(application)227 5287 y(just)k(sees)h(this)e(single)g(image)i
-(as)f(the)h(primary)d(arra)m(y)-8 b(.)136 5488 y Fc(\017)46
-b Fe('myfile.fits[1:512:2,)c(1:512:2]')p Fi(:)49 b(op)s(ens)35
-b(a)h(section)g(of)f(the)h(input)e(image)i(ranging)f(from)g(the)227
-5601 y(1st)26 b(to)g(the)f(512th)h(pixel)e(in)f(X)j(and)e(Y,)i(and)e
-(selects)i(ev)m(ery)f(second)h(pixel)d(in)h(b)s(oth)g(dimensions,)g
-(resulting)227 5714 y(in)29 b(a)i(256)h(x)e(256)i(pixel)c(image)j(in)e
-(this)g(case.)p eop
-%%Page: 15 21
-15 20 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(15)136 555 y Fc(\017)46 b Fe('myfile.fits[EVENTS][col)41
-b(Rad)47 b(=)h(sqrt\(X**2)d(+)j(Y**2\)]')p Fi(:)38 b(creates)30
-b(and)f(op)s(ens)f(a)h(temp)s(orary)227 668 y(\014le)e(on)g(the)g
-(\015y)g(\(in)f(memory)h(or)g(on)h(disk\))e(that)h(is)g(iden)m(tical)f
-(to)i(m)m(y\014le.\014ts)e(except)i(that)g(it)f(will)e(con)m(tain)227
-781 y(a)41 b(new)f(column)f(in)h(the)g(EVENTS)g(extension)g(called)g
-('Rad')h(whose)f(v)-5 b(alue)40 b(is)f(computed)i(using)e(the)227
-894 y(indicated)29 b(expresson)h(whic)m(h)f(is)h(a)g(function)f(of)i
-(the)g(v)-5 b(alues)29 b(in)g(the)i(X)f(and)g(Y)h(columns.)136
-1106 y Fc(\017)46 b Fe('myfile.fits[EVENTS][PHA)41 b(>)48
+b(The)26 b(application)227 5714 y(just)k(sees)h(this)e(single)g(image)i
+(as)f(the)h(primary)d(arra)m(y)-8 b(.)p eop
+%%Page: 17 23
+17 22 bop 0 299 a Fg(4.1.)72 b(O)m(VER)-10 b(VIEW)3086
+b Fi(17)136 555 y Fc(\017)46 b Fe('myfile.fits[1:512:2,)c(1:512:2]')p
+Fi(:)49 b(op)s(ens)35 b(a)h(section)g(of)f(the)h(input)e(image)i
+(ranging)f(from)g(the)227 668 y(1st)26 b(to)g(the)f(512th)h(pixel)e(in)
+f(X)j(and)e(Y,)i(and)e(selects)i(ev)m(ery)f(second)h(pixel)d(in)h(b)s
+(oth)g(dimensions,)g(resulting)227 781 y(in)29 b(a)i(256)h(x)e(256)i
+(pixel)c(image)j(in)e(this)g(case.)136 981 y Fc(\017)46
+b Fe('myfile.fits[EVENTS][col)41 b(Rad)47 b(=)h(sqrt\(X**2)d(+)j
+(Y**2\)]')p Fi(:)38 b(creates)30 b(and)f(op)s(ens)f(a)h(temp)s(orary)
+227 1094 y(\014le)e(on)g(the)g(\015y)g(\(in)f(memory)h(or)g(on)h
+(disk\))e(that)h(is)g(iden)m(tical)f(to)i(m)m(y\014le.\014ts)e(except)i
+(that)g(it)f(will)e(con)m(tain)227 1207 y(a)41 b(new)f(column)f(in)h
+(the)g(EVENTS)g(extension)g(called)g('Rad')h(whose)f(v)-5
+b(alue)40 b(is)f(computed)i(using)e(the)227 1320 y(indicated)29
+b(expresson)h(whic)m(h)f(is)h(a)g(function)f(of)i(the)g(v)-5
+b(alues)29 b(in)g(the)i(X)f(and)g(Y)h(columns.)136 1520
+y Fc(\017)46 b Fe('myfile.fits[EVENTS][PHA)41 b(>)48
 b(5]')p Fi(:)37 b(creates)27 b(and)e(op)s(ens)g(a)h(temp)s(orary)f
-(FITS)g(\014les)f(that)i(is)f(iden)m(ti-)227 1219 y(cal)k(to)h('m)m
+(FITS)g(\014les)f(that)i(is)f(iden)m(ti-)227 1633 y(cal)k(to)h('m)m
 (y\014le.\014ts')e(except)i(that)f(the)g(EVENTS)f(table)h(will)d(only)i
 (con)m(tain)h(the)g(ro)m(ws)g(that)h(ha)m(v)m(e)g(v)-5
-b(alues)227 1332 y(of)28 b(the)g(PHA)f(column)f(greater)j(than)e(5.)40
+b(alues)227 1746 y(of)28 b(the)g(PHA)f(column)f(greater)j(than)e(5.)40
 b(In)27 b(general,)h(an)m(y)g(arbitrary)e(b)s(o)s(olean)h(expression)f
-(using)g(a)i(C)f(or)227 1445 y(F)-8 b(ortran-lik)m(e)29
+(using)g(a)i(C)f(or)227 1859 y(F)-8 b(ortran-lik)m(e)29
 b(syn)m(tax,)g(whic)m(h)e(ma)m(y)i(com)m(bine)f(AND)h(and)f(OR)f(op)s
 (erators,)i(ma)m(y)g(b)s(e)f(used)f(to)i(select)g(ro)m(ws)227
-1557 y(from)h(a)h(table.)136 1769 y Fc(\017)46 b Fe
+1972 y(from)h(a)h(table.)136 2172 y Fc(\017)46 b Fe
 ('myfile.fits[EVENTS][bin)41 b(\(X,Y\)=1,2048,4]')p Fi(:)46
 b(creates)37 b(a)e(temp)s(orary)g(FITS)f(primary)f(arra)m(y)227
-1882 y(image)c(whic)m(h)f(is)g(computed)g(on)h(the)g(\015y)f(b)m(y)g
+2285 y(image)c(whic)m(h)f(is)g(computed)g(on)h(the)g(\015y)f(b)m(y)g
 (binning)e(\(i.e,)k(computing)d(the)i(2-dimensional)e(histogram\))227
-1995 y(of)34 b(the)f(v)-5 b(alues)33 b(in)f(the)i(X)g(and)e(Y)i
+2398 y(of)34 b(the)f(v)-5 b(alues)33 b(in)f(the)i(X)g(and)e(Y)i
 (columns)e(of)i(the)f(EVENTS)g(extension.)49 b(In)33
-b(this)f(case)j(the)e(X)h(and)f(Y)227 2108 y(co)s(ordinates)g(range)h
+b(this)f(case)j(the)e(X)h(and)f(Y)227 2511 y(co)s(ordinates)g(range)h
 (from)f(1)h(to)g(2048)h(and)e(the)h(image)f(pixel)f(size)h(is)g(4)g
-(units)f(in)g(b)s(oth)h(dimensions,)f(so)227 2221 y(the)f(resulting)d
+(units)f(in)g(b)s(oth)h(dimensions,)f(so)227 2624 y(the)f(resulting)d
 (image)j(is)e(512)j(x)e(512)i(pixels)d(in)g(size.)136
-2433 y Fc(\017)46 b Fi(The)31 b(\014nal)f(example)i(com)m(bines)f(man)m
+2824 y Fc(\017)46 b Fi(The)31 b(\014nal)f(example)i(com)m(bines)f(man)m
 (y)g(of)h(these)g(feature)g(in)m(to)f(one)h(complex)f(expression)f
-(\(it)i(is)e(brok)m(en)227 2546 y(in)m(to)h(sev)m(eral)f(lines)f(for)h
-(clarit)m(y\):)323 2832 y Fe('ftp://legacy.gsfc.nasa)o(.gov)o(/dat)o
-(a/s)o(ampl)o(e.fi)o(ts.)o(gz[E)o(VENT)o(S])370 2945
+(\(it)i(is)e(brok)m(en)227 2937 y(in)m(to)h(sev)m(eral)f(lines)f(for)h
+(clarit)m(y\):)323 3206 y Fe('ftp://legacy.gsfc.nasa)o(.gov)o(/dat)o
+(a/s)o(ampl)o(e.fi)o(ts.)o(gz[E)o(VENT)o(S])370 3319
 y([col)47 b(phacorr)f(=)h(pha)g(*)h(1.1)f(-)g(0.3][phacorr)e(>=)i(5.0)g
-(&&)g(phacorr)f(<=)h(14.0])370 3058 y([bin)g(\(X,Y\)=32]')227
-3344 y Fi(In)37 b(this)g(case,)k(CFITSIO)36 b(\(1\))j(copies)f(and)f
+(&&)g(phacorr)f(<=)h(14.0])370 3432 y([bin)g(\(X,Y\)=32]')227
+3701 y Fi(In)37 b(this)g(case,)k(CFITSIO)36 b(\(1\))j(copies)f(and)f
 (uncompresses)g(the)h(FITS)f(\014le)g(from)g(the)h(ftp)f(site)h(on)g
-(the)227 3457 y(legacy)f(mac)m(hine,)h(\(2\))f(mo)m(v)m(es)g(to)g(the)g
+(the)227 3814 y(legacy)f(mac)m(hine,)h(\(2\))f(mo)m(v)m(es)g(to)g(the)g
 ('EVENTS')f(extension,)h(\(3\))g(calculates)g(a)f(new)g(column)f
-(called)227 3570 y('phacorr',)30 b(\(4\))f(selects)g(the)g(ro)m(ws)g
+(called)227 3927 y('phacorr',)30 b(\(4\))f(selects)g(the)g(ro)m(ws)g
 (in)e(the)i(table)g(that)g(ha)m(v)m(e)h(phacorr)e(in)f(the)i(range)g(5)
-g(to)h(14,)g(and)e(\014nally)227 3683 y(\(5\))35 b(bins)c(the)i
+g(to)h(14,)g(and)e(\014nally)227 4040 y(\(5\))35 b(bins)c(the)i
 (remaining)e(ro)m(ws)i(on)h(the)f(X)g(and)g(Y)g(column)f(co)s
 (ordinates,)i(using)d(a)j(pixel)d(size)i(=)g(32)h(to)227
-3796 y(create)d(a)f(2D)g(image.)41 b(All)28 b(this)g(pro)s(cessing)g
+4153 y(create)d(a)f(2D)g(image.)41 b(All)28 b(this)g(pro)s(cessing)g
 (is)h(completely)g(transparen)m(t)g(to)i(the)e(application)f(program,)
-227 3908 y(whic)m(h)h(simply)f(sees)j(the)g(\014nal)e(2-D)i(image)g(in)
+227 4266 y(whic)m(h)h(simply)f(sees)j(the)g(\014nal)e(2-D)i(image)g(in)
 e(the)h(primary)f(arra)m(y)i(of)f(the)h(op)s(ened)f(\014le.)0
-4271 y Fd(4.2)135 b(Detailed)47 b(Filename)f(Syn)l(tax)0
-4527 y Fi(This)28 b(section)i(describ)s(es)e(the)h(full)f(extended)i
-(syn)m(tax)g(for)f(the)h(FITSIO)e(FITS)h(\014le)g(names.)41
-b(The)29 b(\014lename)g(can)0 4640 y(con)m(tain)i(sev)m(eral)f
-(di\013eren)m(t)g(comp)s(onen)m(ts)h(dep)s(ending)d(on)i(the)g(con)m
-(text:)0 4924 y Fe(When)47 b(creating)e(a)j(new)f(file:)143
+4538 y(The)c(full)f(extended)i(CFITSIO)e(FITS)h(\014le)g(name)h(can)g
+(con)m(tain)g(sev)m(eral)g(di\013eren)m(t)g(comp)s(onen)m(ts)g(dep)s
+(ending)d(on)0 4651 y(the)31 b(con)m(text.)42 b(These)30
+b(comp)s(onen)m(ts)h(are)g(describ)s(ed)d(in)h(the)h(follo)m(wing)f
+(sections:)0 4924 y Fe(When)47 b(creating)e(a)j(new)f(file:)143
 5036 y(filetype://BaseFilename\(t)o(empl)o(ate)o(Name)o(\))0
 5262 y(When)g(opening)e(an)j(existing)d(primary)h(array)g(or)i(image)e
 (HDU:)143 5375 y(filetype://BaseFilename\(o)o(utNa)o(me\))o([HDU)o
@@ -3050,8 +3172,8 @@ b(The)29 b(\014lename)g(can)0 4640 y(con)m(tain)i(sev)m(eral)f
 (an)j(existing)d(table)i(HDU:)143 5714 y(filetype://BaseFilename\(o)o
 (utNa)o(me\))o([HDU)o(loca)o(tio)o(n][c)o(olFi)o(lte)o(r][r)o(owFi)o
 (lte)o(r][b)o(inSp)o(ec])p eop
-%%Page: 16 22
-16 21 bop 0 299 a Fi(16)1618 b Fg(CHAPTER)30 b(4.)112
+%%Page: 18 24
+18 23 bop 0 299 a Fi(18)1618 b Fg(CHAPTER)30 b(4.)112
 b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(The)41
 b(\014let)m(yp)s(e,)j(BaseFilename,)h(outName,)g(HDUlo)s(cation,)g(and)
 c(ImageSection)h(comp)s(onen)m(ts,)j(if)c(presen)m(t,)0
@@ -3062,2584 +3184,2910 @@ b(of)h(the)f(order,)g(ho)m(w)m(ev)m(er,)i(the)f(colFilter)e(sp)s
 (eci\014er,)g(if)g(presen)m(t,)i(will)d(b)s(e)h(pro)s(cessed)h(\014rst)
 f(b)m(y)0 894 y(CFITSIO,)i(follo)m(w)m(ed)h(b)m(y)g(the)h(ro)m(wFilter)
 f(sp)s(eci\014er,)f(and)g(\014nally)g(b)m(y)h(the)g(binSp)s(ec)e(sp)s
-(eci\014er.)0 1179 y Fb(4.2.1)112 b(Filet)m(yp)s(e)0
-1398 y Fi(The)37 b(t)m(yp)s(e)g(of)g(\014le)f(determines)g(the)h
-(medium)e(on)i(whic)m(h)f(the)h(\014le)f(is)h(lo)s(cated)g(\(e.g.,)j
-(disk)c(or)h(net)m(w)m(ork\))h(and,)0 1510 y(hence,)f(whic)m(h)d(in)m
-(ternal)g(device)h(driv)m(er)f(is)g(used)g(b)m(y)h(CFITSIO)f(to)i(read)
-f(and/or)g(write)f(the)h(\014le.)55 b(Curren)m(tly)0
-1623 y(supp)s(orted)29 b(t)m(yp)s(es)h(are)382 1845 y
-Fe(file://)93 b(-)48 b(file)e(on)i(local)e(magnetic)g(disk)g
-(\(default\))382 1958 y(ftp://)141 b(-)48 b(a)f(readonly)f(file)g
-(accessed)g(with)h(the)g(anonymous)e(FTP)i(protocol.)907
-2071 y(It)g(also)g(supports)93 b(ftp://username:password@)o(host)o(nam)
-o(e/..)o(.)907 2184 y(for)47 b(accessing)e(password-protected)e(ftp)k
-(sites.)382 2297 y(http://)93 b(-)48 b(a)f(readonly)f(file)g(accessed)g
-(with)h(the)g(HTTP)f(protocol.)93 b(It)907 2410 y(does)46
-b(not)95 b(support)46 b(username:password)d(like)k(the)g(ftp)f(driver.)
-382 2523 y(root://)93 b(-)48 b(uses)e(the)h(CERN)g(root)g(protocol)e
-(for)i(writing)f(as)h(well)g(as)907 2636 y(reading)f(files)g(over)h
-(the)g(network.)382 2749 y(shmem://)e(-)j(opens)e(or)h(creates)f(a)i
-(file)e(which)h(persists)e(in)i(the)g(computer's)907
-2862 y(shared)f(memory.)382 2974 y(mem://)141 b(-)48
-b(opens)e(a)i(temporary)d(file)i(in)g(core)f(memory.)94
-b(The)47 b(file)907 3087 y(disappears)e(when)h(the)h(program)f(exits)h
-(so)g(this)f(is)i(mainly)907 3200 y(useful)e(for)h(test)f(purposes)g
-(when)h(a)g(permanent)e(output)h(file)907 3313 y(is)h(not)g(desired.)0
-3535 y Fi(If)35 b(the)h(\014let)m(yp)s(e)f(is)f(not)i(sp)s(eci\014ed,)g
-(then)f(t)m(yp)s(e)h(\014le://)g(is)e(assumed.)56 b(The)35
-b(double)f(slashes)h('//')i(are)f(optional)0 3648 y(and)30
-b(ma)m(y)h(b)s(e)e(omitted)i(in)e(most)i(cases.)0 3930
-y Fh(Notes)k(ab)s(out)f(the)h(ro)s(ot)g(\014let)m(yp)s(e)0
-4148 y Fi(The)30 b(original)e(ro)s(otd)j(serv)m(er)f(can)h(b)s(e)f
-(obtained)f(from:)334 4370 y Fe(ftp://root.cern.ch/root/r)o(oot)o(d.ta)
-o(r.gz)0 4592 y Fi(but,)39 b(for)e(it)g(to)h(w)m(ork)g(correctly)g
-(with)e(CFITSIO)g(one)h(has)g(to)i(use)e(a)h(mo)s(di\014ed)d(v)m
-(ersion)i(whic)m(h)f(supp)s(orts)g(a)0 4705 y(command)31
-b(to)i(return)d(the)i(length)f(of)h(the)f(\014le.)44
-b(This)29 b(mo)s(di\014ed)h(v)m(ersion)h(is)f(a)m(v)-5
-b(ailable)31 b(in)g(ro)s(otd)g(sub)s(directory)0 4818
-y(in)e(the)i(CFITSIO)d(ftp)i(area)i(at)286 5040 y Fe
+(eci\014er.)0 1221 y Fd(4.2)135 b(Filet)l(yp)t(e)0 1471
+y Fi(The)37 b(t)m(yp)s(e)g(of)g(\014le)f(determines)g(the)h(medium)e
+(on)i(whic)m(h)f(the)h(\014le)f(is)h(lo)s(cated)g(\(e.g.,)j(disk)c(or)h
+(net)m(w)m(ork\))h(and,)0 1584 y(hence,)f(whic)m(h)d(in)m(ternal)g
+(device)h(driv)m(er)f(is)g(used)g(b)m(y)h(CFITSIO)f(to)i(read)f(and/or)
+g(write)f(the)h(\014le.)55 b(Curren)m(tly)0 1697 y(supp)s(orted)29
+b(t)m(yp)s(es)h(are)382 1913 y Fe(file://)93 b(-)48 b(file)e(on)i
+(local)e(magnetic)g(disk)g(\(default\))382 2026 y(ftp://)141
+b(-)48 b(a)f(readonly)f(file)g(accessed)g(with)h(the)g(anonymous)e(FTP)
+i(protocol.)907 2139 y(It)g(also)g(supports)93 b
+(ftp://username:password@)o(host)o(nam)o(e/..)o(.)907
+2252 y(for)47 b(accessing)e(password-protected)e(ftp)k(sites.)382
+2365 y(http://)93 b(-)48 b(a)f(readonly)f(file)g(accessed)g(with)h(the)
+g(HTTP)f(protocol.)93 b(It)907 2478 y(does)46 b(not)95
+b(support)46 b(username:password)d(like)k(the)g(ftp)f(driver.)907
+2591 y(Proxy)g(HTTP)h(servers)f(are)h(supported)e(using)h(the)h
+(http_proxy)907 2704 y(environment)e(variable.)382 2817
+y(root://)93 b(-)48 b(uses)e(the)h(CERN)g(root)g(protocol)e(for)i
+(writing)f(as)h(well)g(as)907 2930 y(reading)f(files)g(over)h(the)g
+(network.)382 3042 y(shmem://)e(-)j(opens)e(or)h(creates)f(a)i(file)e
+(which)h(persists)e(in)i(the)g(computer's)907 3155 y(shared)f(memory.)
+382 3268 y(mem://)141 b(-)48 b(opens)e(a)i(temporary)d(file)i(in)g
+(core)f(memory.)94 b(The)47 b(file)907 3381 y(disappears)e(when)h(the)h
+(program)f(exits)h(so)g(this)f(is)i(mainly)907 3494 y(useful)e(for)h
+(test)f(purposes)g(when)h(a)g(permanent)e(output)h(file)907
+3607 y(is)h(not)g(desired.)0 3824 y Fi(If)35 b(the)h(\014let)m(yp)s(e)f
+(is)f(not)i(sp)s(eci\014ed,)g(then)f(t)m(yp)s(e)h(\014le://)g(is)e
+(assumed.)56 b(The)35 b(double)f(slashes)h('//')i(are)f(optional)0
+3937 y(and)30 b(ma)m(y)h(b)s(e)e(omitted)i(in)e(most)i(cases.)0
+4220 y Fb(4.2.1)112 b(Notes)37 b(ab)s(out)i(HTTP)d(pro)m(xy)i(serv)m
+(ers)0 4439 y Fi(A)32 b(pro)m(xy)g(HTTP)f(serv)m(er)h(ma)m(y)h(b)s(e)e
+(used)g(b)m(y)h(de\014ning)e(the)i(address)f(\(URL\))i(and)e(p)s(ort)g
+(n)m(um)m(b)s(er)g(of)h(the)g(pro)m(xy)0 4552 y(serv)m(er)f(with)e(the)
+h(h)m(ttp)p 801 4552 28 4 v 33 w(pro)m(xy)g(en)m(vironmen)m(t)g(v)-5
+b(ariable.)40 b(F)-8 b(or)31 b(example)191 4769 y Fe(setenv)46
+b(http_proxy)f(http://heasarc.gsfc.nasa)o(.gov)o(:312)o(8)0
+4985 y Fi(will)35 b(cause)j(CFITSIO)f(to)h(use)g(p)s(ort)f(3128)i(on)f
+(the)g(heasarc)g(pro)m(xy)g(serv)m(er)g(whenev)m(er)g(reading)f(a)h
+(FITS)f(\014le)0 5098 y(with)29 b(HTTP)-8 b(.)0 5382
+y Fb(4.2.2)112 b(Notes)37 b(ab)s(out)i(the)e(ro)s(ot)g(\014let)m(yp)s
+(e)0 5601 y Fi(The)20 b(original)g(ro)s(otd)g(serv)m(er)h(can)h(b)s(e)e
+(obtained)g(from:)36 b Fe(ftp://root.cern.ch/root)o(/roo)o(td.t)o(ar.)o
+(gz)15 b Fi(but,)22 b(for)0 5714 y(it)32 b(to)i(w)m(ork)f(correctly)g
+(with)e(CFITSIO)h(one)h(has)f(to)i(use)e(a)i(mo)s(di\014ed)c(v)m
+(ersion)j(whic)m(h)e(supp)s(orts)g(a)i(command)p eop
+%%Page: 19 25
+19 24 bop 0 299 a Fg(4.2.)72 b(FILETYPE)3128 b Fi(19)0
+555 y(to)41 b(return)d(the)j(length)e(of)h(the)g(\014le.)69
+b(This)38 b(mo)s(di\014ed)f(v)m(ersion)j(is)f(a)m(v)-5
+b(ailable)39 b(in)g(ro)s(otd)g(sub)s(directory)f(in)h(the)0
+668 y(CFITSIO)29 b(ftp)h(area)h(at)286 928 y Fe
 (ftp://legacy.gsfc.nasa.gov)o(/so)o(ftwa)o(re/f)o(its)o(io/c)o(/roo)o
-(t/r)o(ootd)o(.tar)o(.gz)o(.)0 5262 y Fi(This)h(small)f(serv)m(er)j(is)
+(t/r)o(ootd)o(.tar)o(.gz)o(.)0 1187 y Fi(This)i(small)f(serv)m(er)j(is)
 f(started)g(either)g(b)m(y)h(inetd)e(when)g(a)i(clien)m(t)f(requests)g
-(a)h(connection)g(to)g(a)f(ro)s(otd)h(serv)m(er)0 5375
+(a)h(connection)g(to)g(a)f(ro)s(otd)h(serv)m(er)0 1300
 y(or)30 b(b)m(y)g(hand)f(\(i.e.)41 b(from)30 b(the)g(command)g(line\).)
 40 b(The)29 b(ro)s(otd)h(serv)m(er)h(w)m(orks)f(with)f(the)h(R)m(OOT)g
-(TNetFile)g(class.)0 5488 y(It)g(allo)m(ws)e(remote)j(access)f(to)h(R)m
+(TNetFile)g(class.)0 1413 y(It)g(allo)m(ws)e(remote)j(access)f(to)h(R)m
 (OOT)e(database)h(\014les)e(in)g(either)h(read)h(or)f(write)g(mo)s(de.)
-40 b(By)30 b(default)e(TNetFile)0 5601 y(assumes)38 b(p)s(ort)g(432)h
+40 b(By)30 b(default)e(TNetFile)0 1526 y(assumes)38 b(p)s(ort)g(432)h
 (\(whic)m(h)e(requires)g(ro)s(otd)h(to)h(b)s(e)f(started)h(as)f(ro)s
 (ot\).)65 b(T)-8 b(o)39 b(run)e(ro)s(otd)h(via)g(inetd)f(add)h(the)0
-5714 y(follo)m(wing)29 b(line)g(to)i(/etc/services:)p
-eop
-%%Page: 17 23
-17 22 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(17)95 555 y Fe(rootd)238 b(432/tcp)0 819
-y Fi(and)30 b(to)h(/etc/inetd.conf,)h(add)e(the)g(follo)m(wing)f(line:)
-95 1083 y Fe(rootd)47 b(stream)f(tcp)h(nowait)f(root)h
-(/user/rdm/root/bin/root)o(d)42 b(rootd)k(-i)0 1346 y
+1639 y(follo)m(wing)29 b(line)g(to)i(/etc/services:)95
+1898 y Fe(rootd)238 b(432/tcp)0 2158 y Fi(and)30 b(to)h
+(/etc/inetd.conf,)h(add)e(the)g(follo)m(wing)f(line:)95
+2417 y Fe(rootd)47 b(stream)f(tcp)h(nowait)f(root)h
+(/user/rdm/root/bin/root)o(d)42 b(rootd)k(-i)0 2677 y
 Fi(F)-8 b(orce)34 b(inetd)d(to)j(reread)e(its)g(conf)g(\014le)g(with)f
 ("kill)f(-HUP)j(<pid)e(inetd>".)46 b(Y)-8 b(ou)33 b(can)g(also)f(start)
-h(ro)s(otd)g(b)m(y)f(hand)0 1459 y(running)j(directly)h(under)f(y)m
-(our)j(priv)-5 b(ate)37 b(accoun)m(t)h(\(no)g(ro)s(ot)g(system)f
-(priviliges)d(needed\).)62 b(F)-8 b(or)38 b(example)f(to)0
-1572 y(start)31 b(ro)s(otd)f(listening)e(on)j(p)s(ort)e(5151)j(just)e
-(t)m(yp)s(e:)95 1836 y Fe(rootd)47 b(-p)g(5151)0 2100
-y Fi(Notice:)42 b(no)30 b(&)g(is)f(needed.)41 b(Ro)s(otd)30
-b(will)e(go)j(in)m(to)g(bac)m(kground)f(b)m(y)g(itself.)95
-2364 y Fe(Rootd)47 b(arguments:)191 2477 y(-i)763 b(says)47
-b(we)g(were)f(started)g(by)h(inetd)191 2589 y(-p)g(port#)476
+h(ro)s(otd)g(b)m(y)f(hand)0 2790 y(running)i(directly)h(under)f(y)m
+(our)j(priv)-5 b(ate)36 b(accoun)m(t)h(\(no)g(ro)s(ot)g(system)f
+(privileges)e(needed\).)59 b(F)-8 b(or)37 b(example)f(to)0
+2903 y(start)f(ro)s(otd)e(listening)f(on)i(p)s(ort)f(5151)j(just)d(t)m
+(yp)s(e:)49 b Fe(rootd)d(-p)h(5151)33 b Fi(Notice:)49
+b(no)34 b(&)f(is)g(needed.)51 b(Ro)s(otd)35 b(will)0
+3016 y(go)c(in)m(to)g(bac)m(kground)f(b)m(y)g(itself.)95
+3275 y Fe(Rootd)47 b(arguments:)191 3388 y(-i)763 b(says)47
+b(we)g(were)f(started)g(by)h(inetd)191 3501 y(-p)g(port#)476
 b(specifies)45 b(a)j(different)d(port)i(to)g(listen)f(on)191
-2702 y(-d)h(level)476 b(level)46 b(of)i(debug)e(info)h(written)e(to)j
-(syslog)1050 2815 y(0)f(=)h(no)f(debug)f(\(default\))1050
-2928 y(1)h(=)h(minimum)1050 3041 y(2)f(=)h(medium)1050
-3154 y(3)f(=)h(maximum)0 3418 y Fi(Ro)s(otd)29 b(can)f(also)g(b)s(e)g
+3614 y(-d)h(level)476 b(level)46 b(of)i(debug)e(info)h(written)e(to)j
+(syslog)1050 3727 y(0)f(=)h(no)f(debug)f(\(default\))1050
+3840 y(1)h(=)h(minimum)1050 3953 y(2)f(=)h(medium)1050
+4066 y(3)f(=)h(maximum)0 4325 y Fi(Ro)s(otd)29 b(can)f(also)g(b)s(e)g
 (con\014gured)g(for)g(anon)m(ymous)g(usage)h(\(lik)m(e)f(anon)m(ymous)g
 (ftp\).)40 b(T)-8 b(o)29 b(setup)f(ro)s(otd)g(to)h(accept)0
-3531 y(anon)m(ymous)h(logins)f(do)i(the)f(follo)m(wing)f(\(while)g(b)s
-(eing)g(logged)i(in)e(as)h(ro)s(ot\):)143 3794 y Fe(-)48
+4438 y(anon)m(ymous)h(logins)f(do)i(the)f(follo)m(wing)f(\(while)g(b)s
+(eing)g(logged)i(in)e(as)h(ro)s(ot\):)143 4698 y Fe(-)48
 b(Add)f(the)f(following)g(line)g(to)i(/etc/passwd:)239
-4020 y(rootd:*:71:72:Anonymous)41 b(rootd:/var/spool/rootd:/b)o(in/)o
-(fals)o(e)239 4246 y(where)46 b(you)h(may)g(modify)f(the)h(uid,)f(gid)h
-(\(71,)g(72\))g(and)g(the)g(home)f(directory)239 4359
-y(to)h(suite)f(your)h(system.)143 4585 y(-)h(Add)f(the)f(following)g
-(line)g(to)i(/etc/group:)239 4811 y(rootd:*:72:rootd)239
-5036 y(where)e(the)h(gid)g(must)f(match)h(the)g(gid)g(in)g
-(/etc/passwd.)143 5262 y(-)h(Create)e(the)h(directories:)239
-5488 y(mkdir)f(/var/spool/rootd)239 5601 y(mkdir)g
-(/var/spool/rootd/tmp)239 5714 y(chmod)g(777)h(/var/spool/rootd/tmp)p
+4924 y(rootd:*:71:72:Anonymous)41 b(rootd:/var/spool/rootd:/b)o(in/)o
+(fals)o(e)239 5149 y(where)46 b(you)h(may)g(modify)f(the)h(uid,)f(gid)h
+(\(71,)g(72\))g(and)g(the)g(home)f(directory)239 5262
+y(to)h(suite)f(your)h(system.)143 5488 y(-)h(Add)f(the)f(following)g
+(line)g(to)i(/etc/group:)239 5714 y(rootd:*:72:rootd)p
 eop
-%%Page: 18 24
-18 23 bop 0 299 a Fi(18)1618 b Fg(CHAPTER)30 b(4.)112
+%%Page: 20 26
+20 25 bop 0 299 a Fi(20)1618 b Fg(CHAPTER)30 b(4.)112
 b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)239 668 y
-Fe(Where)46 b(/var/spool/rootd)d(must)k(match)f(the)h(rootd)g(home)f
-(directory)g(as)239 781 y(specified)f(in)i(the)g(rootd)f(/etc/passwd)f
-(entry.)143 1007 y(-)j(To)f(make)f(writeable)g(directories)e(for)j
-(anonymous)f(do,)h(for)f(example:)239 1233 y(mkdir)g
-(/var/spool/rootd/pub)239 1346 y(chown)g(rootd:rootd)f
-(/var/spool/rootd/pub)0 1593 y Fi(That's)d(all.)74 b(Sev)m(eral)42
-b(additional)e(remarks:)64 b(y)m(ou)42 b(can)g(login)f(to)i(an)f(anon)m
-(ymous)f(serv)m(er)i(either)e(with)g(the)0 1706 y(names)31
-b("anon)m(ymous")h(or)f("ro)s(otd".)43 b(The)31 b(passw)m(ord)f(should)
-f(b)s(e)i(of)g(t)m(yp)s(e)g(user@host.do.main.)42 b(Only)29
-b(the)i(@)0 1819 y(is)d(enforced)g(for)h(the)f(time)h(b)s(eing.)38
-b(In)28 b(anon)m(ymous)h(mo)s(de)f(the)g(top)h(of)g(the)g(\014le)e
-(tree)j(is)d(set)i(to)h(the)e(ro)s(otd)h(home)0 1932
-y(directory)-8 b(,)38 b(therefore)f(only)e(\014les)h(b)s(elo)m(w)f(the)
-i(home)f(directory)g(can)g(b)s(e)g(accessed.)60 b(Anon)m(ymous)36
-b(mo)s(de)g(only)0 2045 y(w)m(orks)30 b(when)g(the)g(serv)m(er)h(is)e
-(started)i(via)f(inetd.)0 2330 y Fh(Notes)35 b(ab)s(out)f(the)h(shmem)e
-(\014let)m(yp)s(e:)0 2549 y Fi(Shared)h(memory)h(\014les)f(are)h
-(curren)m(tly)f(supp)s(orted)f(on)i(most)h(Unix)e(platforms,)h(where)g
-(the)g(shared)f(memory)0 2662 y(segmen)m(ts)d(are)g(managed)g(b)m(y)f
-(the)g(op)s(erating)g(system)h(k)m(ernel)e(and)h(`liv)m(e')g(indep)s
-(enden)m(tly)d(of)k(pro)s(cesses.)40 b(They)0 2775 y(are)34
-b(not)g(deleted)g(\(b)m(y)g(default\))f(when)g(the)h(pro)s(cess)f(whic)
-m(h)g(created)i(them)f(terminates,)g(although)g(they)g(will)0
-2888 y(disapp)s(ear)d(if)h(the)i(system)f(is)f(reb)s(o)s(oted.)49
-b(Applications)31 b(can)j(create)h(shared)d(memory)h(\014les)f(in)g
-(CFITSIO)g(b)m(y)0 3001 y(calling:)143 3248 y Fe
-(fit_create_file\(&fitsfile)o(ptr,)41 b("shmem://h2",)j(&status\);)0
-3496 y Fi(where)22 b(the)g(ro)s(ot)h(`\014le')f(names)g(are)g(curren)m
-(tly)g(restricted)g(to)h(b)s(e)e('h0',)k('h1',)f('h2',)h('h3',)f(etc.,)
-i(up)21 b(to)i(a)g(maxim)m(umn)0 3609 y(n)m(um)m(b)s(er)d(de\014ned)f
-(b)m(y)i(the)g(the)g(v)-5 b(alue)21 b(of)g(SHARED)p 1746
-3609 28 4 v 33 w(MAXSEG)g(\(equal)g(to)g(16)h(b)m(y)f(default\).)37
-b(This)19 b(is)h(a)h(protot)m(yp)s(e)0 3722 y(implemen)m(tation)27
-b(of)i(the)g(shared)f(memory)g(in)m(terface)h(and)f(a)h(more)g(robust)f
-(in)m(terface,)i(whic)m(h)d(will)f(ha)m(v)m(e)k(few)m(er)0
-3835 y(restrictions)f(on)h(the)h(n)m(um)m(b)s(er)e(of)i(\014les)e(and)h
-(on)g(their)f(names,)i(ma)m(y)g(b)s(e)f(dev)m(elop)s(ed)f(in)g(the)i
-(future.)0 3995 y(When)23 b(op)s(ening)g(an)g(already)g(existing)g
-(FITS)g(\014le)g(in)f(shared)h(memory)h(one)g(calls)e(the)i(usual)f
-(CFITSIO)f(routine:)143 4243 y Fe(fits_open_file\(&fitsfilep)o(tr,)41
-b("shmem://h7",)j(mode,)j(&status\))0 4490 y Fi(The)26
-b(\014le)g(mo)s(de)h(can)g(b)s(e)f(READ)m(WRITE)h(or)g(READONL)-8
-b(Y)28 b(just)e(as)h(with)e(disk)h(\014les.)38 b(More)28
-b(than)e(one)h(pro)s(cess)0 4603 y(can)37 b(op)s(erate)g(on)g(READONL)
--8 b(Y)37 b(mo)s(de)g(\014les)e(at)j(the)f(same)g(time.)59
-b(CFITSIO)35 b(supp)s(orts)g(prop)s(er)h(\014lelo)s(c)m(king)0
-4716 y(\(b)s(oth)27 b(in)g(READONL)-8 b(Y)29 b(and)e(READ)m(WRITE)h(mo)
-s(des\),)h(so)f(calls)f(to)h(\014ts)p 2572 4716 V 33
-w(op)s(en)p 2795 4716 V 32 w(\014le)f(ma)m(y)h(b)s(e)f(lo)s(c)m(k)m(ed)
-i(out)f(un)m(til)0 4829 y(another)j(other)f(pro)s(cess)g(closes)h(the)f
-(\014le.)0 4989 y(When)g(an)g(application)f(is)g(\014nished)f
+Fe(where)46 b(the)h(gid)g(must)f(match)h(the)g(gid)g(in)g(/etc/passwd.)
+143 894 y(-)h(Create)e(the)h(directories:)239 1120 y(mkdir)f
+(/var/spool/rootd)239 1233 y(mkdir)g(/var/spool/rootd/tmp)239
+1346 y(chmod)g(777)h(/var/spool/rootd/tmp)239 1571 y(Where)f
+(/var/spool/rootd)d(must)k(match)f(the)h(rootd)g(home)f(directory)g(as)
+239 1684 y(specified)f(in)i(the)g(rootd)f(/etc/passwd)f(entry.)143
+1910 y(-)j(To)f(make)f(writeable)g(directories)e(for)j(anonymous)f(do,)
+h(for)f(example:)239 2136 y(mkdir)g(/var/spool/rootd/pub)239
+2249 y(chown)g(rootd:rootd)f(/var/spool/rootd/pub)0 2492
+y Fi(That's)d(all.)74 b(Sev)m(eral)42 b(additional)e(remarks:)64
+b(y)m(ou)42 b(can)g(login)f(to)i(an)f(anon)m(ymous)f(serv)m(er)i
+(either)e(with)g(the)0 2605 y(names)31 b("anon)m(ymous")h(or)f("ro)s
+(otd".)43 b(The)31 b(passw)m(ord)f(should)f(b)s(e)i(of)g(t)m(yp)s(e)g
+(user@host.do.main.)42 b(Only)29 b(the)i(@)0 2718 y(is)d(enforced)g
+(for)h(the)f(time)h(b)s(eing.)38 b(In)28 b(anon)m(ymous)h(mo)s(de)f
+(the)g(top)h(of)g(the)g(\014le)e(tree)j(is)d(set)i(to)h(the)e(ro)s(otd)
+h(home)0 2831 y(directory)-8 b(,)38 b(therefore)f(only)e(\014les)h(b)s
+(elo)m(w)f(the)i(home)f(directory)g(can)g(b)s(e)g(accessed.)60
+b(Anon)m(ymous)36 b(mo)s(de)g(only)0 2944 y(w)m(orks)30
+b(when)g(the)g(serv)m(er)h(is)e(started)i(via)f(inetd.)0
+3232 y Fb(4.2.3)112 b(Notes)37 b(ab)s(out)i(the)e(shmem)g(\014let)m(yp)
+s(e:)0 3451 y Fi(Shared)d(memory)h(\014les)f(are)h(curren)m(tly)f(supp)
+s(orted)f(on)i(most)h(Unix)e(platforms,)h(where)g(the)g(shared)f
+(memory)0 3564 y(segmen)m(ts)d(are)g(managed)g(b)m(y)f(the)g(op)s
+(erating)g(system)h(k)m(ernel)e(and)h(`liv)m(e')g(indep)s(enden)m(tly)d
+(of)k(pro)s(cesses.)40 b(They)0 3677 y(are)34 b(not)g(deleted)g(\(b)m
+(y)g(default\))f(when)g(the)h(pro)s(cess)f(whic)m(h)g(created)i(them)f
+(terminates,)g(although)g(they)g(will)0 3790 y(disapp)s(ear)d(if)h(the)
+i(system)f(is)f(reb)s(o)s(oted.)49 b(Applications)31
+b(can)j(create)h(shared)d(memory)h(\014les)f(in)g(CFITSIO)g(b)m(y)0
+3903 y(calling:)143 4146 y Fe(fit_create_file\(&fitsfile)o(ptr,)41
+b("shmem://h2",)j(&status\);)0 4389 y Fi(where)22 b(the)g(ro)s(ot)h
+(`\014le')f(names)g(are)g(curren)m(tly)g(restricted)g(to)h(b)s(e)e
+('h0',)k('h1',)f('h2',)h('h3',)f(etc.,)i(up)21 b(to)i(a)g(maxim)m(umn)0
+4502 y(n)m(um)m(b)s(er)d(de\014ned)f(b)m(y)i(the)g(the)g(v)-5
+b(alue)21 b(of)g(SHARED)p 1746 4502 28 4 v 33 w(MAXSEG)g(\(equal)g(to)g
+(16)h(b)m(y)f(default\).)37 b(This)19 b(is)h(a)h(protot)m(yp)s(e)0
+4615 y(implemen)m(tation)27 b(of)i(the)g(shared)f(memory)g(in)m
+(terface)h(and)f(a)h(more)g(robust)f(in)m(terface,)i(whic)m(h)d(will)f
+(ha)m(v)m(e)k(few)m(er)0 4728 y(restrictions)f(on)h(the)h(n)m(um)m(b)s
+(er)e(of)i(\014les)e(and)h(on)g(their)f(names,)i(ma)m(y)g(b)s(e)f(dev)m
+(elop)s(ed)f(in)g(the)i(future.)0 4888 y(When)23 b(op)s(ening)g(an)g
+(already)g(existing)g(FITS)g(\014le)g(in)f(shared)h(memory)h(one)g
+(calls)e(the)i(usual)f(CFITSIO)f(routine:)143 5132 y
+Fe(fits_open_file\(&fitsfilep)o(tr,)41 b("shmem://h7",)j(mode,)j
+(&status\))0 5375 y Fi(The)26 b(\014le)g(mo)s(de)h(can)g(b)s(e)f(READ)m
+(WRITE)h(or)g(READONL)-8 b(Y)28 b(just)e(as)h(with)e(disk)h(\014les.)38
+b(More)28 b(than)e(one)h(pro)s(cess)0 5488 y(can)35 b(op)s(erate)g(on)f
+(READONL)-8 b(Y)35 b(mo)s(de)f(\014les)g(at)h(the)f(same)h(time.)53
+b(CFITSIO)33 b(supp)s(orts)f(prop)s(er)h(\014le)h(lo)s(c)m(king)0
+5601 y(\(b)s(oth)27 b(in)g(READONL)-8 b(Y)29 b(and)e(READ)m(WRITE)h(mo)
+s(des\),)h(so)f(calls)f(to)h(\014ts)p 2572 5601 V 33
+w(op)s(en)p 2795 5601 V 32 w(\014le)f(ma)m(y)h(b)s(e)f(lo)s(c)m(k)m(ed)
+i(out)f(un)m(til)0 5714 y(another)j(other)f(pro)s(cess)g(closes)h(the)f
+(\014le.)p eop
+%%Page: 21 27
+21 26 bop 0 299 a Fg(4.3.)72 b(BASE)30 b(FILENAME)2830
+b Fi(21)0 555 y(When)30 b(an)g(application)f(is)g(\014nished)f
 (accessing)j(a)f(FITS)g(\014le)f(in)g(a)i(shared)e(memory)h(segmen)m
-(t,)i(it)e(ma)m(y)h(close)f(it)0 5102 y(\(and)k(the)g(\014le)f(will)e
+(t,)i(it)e(ma)m(y)h(close)f(it)0 668 y(\(and)k(the)g(\014le)f(will)e
 (remain)h(in)h(the)h(system\))g(with)f(\014ts)p 1955
-5102 V 32 w(close)p 2174 5102 V 33 w(\014le,)h(or)g(delete)g(it)g(with)
-e(\014ts)p 3191 5102 V 33 w(delete)p 3456 5102 V 33 w(\014le.)50
-b(Ph)m(ys-)0 5215 y(ical)34 b(deletion)g(is)g(p)s(ostp)s(oned)f(un)m
-(til)h(the)h(last)f(pro)s(cess)h(calls)f(\013clos/\013delt.)54
-b(\014ts)p 2801 5215 V 32 w(delete)p 3065 5215 V 33 w(\014le)34
-b(tries)h(to)g(obtain)g(a)0 5328 y(READ)m(WRITE)f(lo)s(c)m(k)f(on)g
-(the)g(\014le)g(to)h(b)s(e)e(deleted,)i(th)m(us)f(it)g(can)g(b)s(e)g
-(blo)s(c)m(k)m(ed)g(if)f(the)i(ob)5 b(ject)34 b(w)m(as)f(not)h(op)s
-(ened)0 5441 y(in)29 b(READ)m(WRITE)i(mo)s(de.)0 5601
-y(A)i(shared)f(memory)h(managemen)m(t)h(utilit)m(y)d(program)i(called)f
-(`smem',)h(is)f(included)e(with)i(the)h(CFITSIO)e(dis-)0
-5714 y(tribution.)37 b(It)27 b(can)g(b)s(e)f(built)f(b)m(y)i(t)m(yping)
-f(`mak)m(e)i(smem';)g(then)f(t)m(yp)s(e)g(`smem)f(-h')h(to)h(get)g(a)f
-(list)e(of)i(v)-5 b(alid)25 b(options.)p eop
-%%Page: 19 25
-19 24 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(19)0 555 y(Executing)36 b(smem)g(without)f(an)m(y)i
-(options)f(causes)g(it)g(to)h(list)e(all)g(the)i(shared)e(memory)i
-(segmen)m(ts)g(curren)m(tly)0 668 y(residing)31 b(in)h(the)h(system)h
-(and)e(managed)i(b)m(y)f(the)h(shared)e(memory)h(driv)m(er.)48
-b(T)-8 b(o)34 b(get)g(a)g(list)e(of)h(all)f(the)i(shared)0
-781 y(memory)c(ob)5 b(jects,)32 b(run)d(the)h(system)h(utilit)m(y)d
-(program)i(`ip)s(cs)g([-a]'.)0 1115 y Fb(4.2.2)112 b(Base)38
-b(Filename)0 1343 y Fi(The)31 b(base)g(\014lename)g(is)f(the)i(name)f
-(of)h(the)f(\014le)g(optionally)e(including)f(the)k(director/sub)s
-(directory)d(path,)j(and)0 1455 y(in)d(the)i(case)g(of)g(`ftp',)f(`h)m
-(ttp',)i(and)d(`ro)s(ot')j(\014let)m(yp)s(es,)d(the)i(mac)m(hine)f
-(iden)m(ti\014er.)39 b(Examples:)191 1752 y Fe(myfile.fits)191
-1865 y(!data.fits)191 1978 y(/data/myfile.fits)191 2091
-y(fits.gsfc.nasa.gov/ftp/s)o(ampl)o(eda)o(ta/m)o(yfil)o(e.f)o(its.)o
-(gz)0 2387 y Fi(When)29 b(creating)g(a)g(new)f(output)h(\014le)f(on)h
-(magnetic)g(disk)e(\(of)j(t)m(yp)s(e)f(\014le://\))g(if)f(the)h(base)g
-(\014lename)f(b)s(egins)f(with)0 2500 y(an)34 b(exclamation)h(p)s(oin)m
-(t)e(\(!\))54 b(then)34 b(an)m(y)g(existing)g(\014le)f(with)g(that)i
-(same)g(basename)g(will)d(b)s(e)h(deleted)h(prior)f(to)0
-2613 y(creating)h(the)g(new)g(FITS)f(\014le.)50 b(Otherwise)33
-b(if)g(the)h(\014le)f(to)h(b)s(e)g(created)h(already)e(exists,)i(then)e
-(CFITSIO)g(will)0 2726 y(return)g(an)h(error)f(and)g(will)f(not)i(o)m
-(v)m(erwrite)g(the)g(existing)f(\014le.)51 b(Note)35
-b(that)g(the)f(exclamation)g(p)s(oin)m(t,)g(')10 b(!',)36
-b(is)d(a)0 2839 y(sp)s(ecial)26 b(UNIX)i(c)m(haracter,)j(so)d(if)e(it)i
-(is)f(used)g(on)g(the)h(command)g(line)e(rather)i(than)f(en)m(tered)h
-(at)h(a)f(task)h(prompt,)0 2952 y(it)i(m)m(ust)g(b)s(e)g(preceded)g(b)m
-(y)h(a)g(bac)m(kslash)f(to)h(force)g(the)g(UNIX)g(shell)d(to)j(pass)f
-(it)h(v)m(erbatim)f(to)h(the)g(application)0 3065 y(program.)0
-3225 y(The)27 b(input)f(\014le)g(ma)m(y)i(b)s(e)f(compressed)h(with)e
-(the)i(gzip)f(or)g(Unix)g(compress)g(algorithms,)g(in)f(whic)m(h)h
-(case)h(CFIT-)0 3338 y(SIO)i(will)f(uncompress)h(the)i(\014le)e(on)i
-(the)f(\015y)g(in)m(to)h(a)f(temp)s(orary)g(\014le)g(\(in)f(memory)i
-(or)f(on)g(disk\).)43 b(Compressed)0 3451 y(\014les)34
-b(ma)m(y)h(only)f(b)s(e)h(op)s(ened)f(with)g(read-only)g(p)s
-(ermission.)51 b(When)35 b(sp)s(ecifying)e(the)i(name)g(of)g(a)g
-(compressed)0 3564 y(FITS)g(\014le)f(it)h(is)g(not)g(necessary)h(to)g
-(app)s(end)e(the)i(\014le)e(su\016x)g(\(e.g.,)39 b(`.gz')e(or)e
-(`.Z'\).)i(If)e(CFITSIO)e(cannot)j(\014nd)0 3676 y(the)31
-b(input)f(\014le)g(name)h(without)f(the)i(su\016x,)e(then)h(it)g(will)e
-(automatically)i(searc)m(h)h(for)e(a)i(compressed)f(\014le)f(with)0
-3789 y(the)35 b(same)g(ro)s(ot)g(name.)54 b(In)34 b(the)h(case)h(of)f
-(reading)f(ftp)g(and)h(h)m(ttp)g(t)m(yp)s(e)g(\014les,)g(CFITSIO)e
-(generally)h(lo)s(oks)g(for)0 3902 y(a)41 b(compressed)f(v)m(ersion)g
-(of)h(the)g(\014le)f(\014rst,)j(b)s(efore)d(trying)f(to)j(op)s(en)e
-(the)h(uncompressed)e(\014le.)71 b(By)40 b(default,)0
-4015 y(CFITSIO)d(copies)i(\(and)f(uncompressed)f(if)h(necessary\))h
-(the)g(ftp)f(or)h(h)m(ttp)g(FITS)e(\014le)h(in)m(to)h(memory)f(on)h
-(the)0 4128 y(lo)s(cal)32 b(mac)m(hine)g(b)s(efore)f(op)s(ening)g(it.)
-46 b(This)31 b(will)f(fail)h(if)g(the)h(lo)s(cal)g(mac)m(hine)g(do)s
-(es)g(not)g(ha)m(v)m(e)i(enough)e(memory)0 4241 y(to)d(hold)e(the)i
-(whole)f(FITS)f(\014le,)h(so)h(in)e(this)h(case,)i(the)e(output)g
-(\014lename)g(sp)s(eci\014er)f(\(see)i(the)g(next)g(section\))g(can)0
-4354 y(b)s(e)h(used)f(to)i(further)e(con)m(trol)i(ho)m(w)g(CFITSIO)e
-(reads)h(ftp)g(and)f(h)m(ttp)i(\014les.)0 4514 y(One)g(sp)s(ecial)g
-(case)h(is)f(where)g(the)h(\014lename)f(=)g(`-')i(\(a)f(dash)f(or)h
-(min)m(us)e(sign\),)i(whic)m(h)e(signi\014es)g(that)i(the)g(input)0
-4627 y(\014le)38 b(is)g(to)h(b)s(e)f(read)h(from)f(the)h(stdin)f
-(stream,)j(or)e(written)f(to)h(the)g(stdout)g(stream)g(if)f(a)h(new)g
-(output)f(\014le)g(is)0 4740 y(b)s(eing)e(created.)65
-b(In)37 b(the)h(case)h(of)f(reading)f(from)h(stdin,)g(CFITSIO)e
-(\014rst)i(copies)f(the)h(whole)f(stream)i(in)m(to)f(a)0
-4853 y(temp)s(orary)27 b(FITS)f(\014le)g(\(in)g(memory)h(or)g(on)g
-(disk\),)g(and)f(subsequen)m(t)h(reading)f(of)h(the)g(FITS)f(\014le)h
-(o)s(ccurs)f(in)g(this)0 4966 y(cop)m(y)-8 b(.)51 b(When)34
-b(writing)d(to)k(stdout,)f(CFITSIO)e(\014rst)h(constructs)h(the)f
-(whole)g(\014le)g(in)f(memory)h(\(since)h(random)0 5079
-y(access)j(is)e(required\),)g(then)h(\015ushes)e(it)h(out)h(to)g(the)g
-(stdout)g(stream)g(when)e(the)i(\014le)f(is)f(closed.)57
-b(This)33 b(feature)0 5192 y(allo)m(ws)k(FITS)g(\014les)g(to)i(b)s(e)e
-(pip)s(ed)e(b)s(et)m(w)m(een)k(tasks)f(in)f(memory)h(rather)f(than)h
-(ha)m(ving)f(to)i(create)g(temp)s(orary)0 5304 y(in)m(termediate)30
-b(FITS)f(\014les)g(on)g(disk.)40 b(F)-8 b(or)30 b(example)g(if)f(task1)
-i(creates)g(an)f(output)f(FITS)h(\014le,)f(and)g(task2)i(reads)0
-5417 y(an)f(input)f(FITS)g(\014le,)h(the)h(FITS)e(\014le)h(ma)m(y)h(b)s
-(e)e(pip)s(ed)f(b)s(et)m(w)m(een)j(the)g(2)g(tasks)g(b)m(y)f(sp)s
-(ecifying)143 5714 y Fe(task1)47 b(-)g(|)g(task2)g(-)p
+668 28 4 v 32 w(close)p 2174 668 V 33 w(\014le,)h(or)g(delete)g(it)g
+(with)e(\014ts)p 3191 668 V 33 w(delete)p 3456 668 V
+33 w(\014le.)50 b(Ph)m(ys-)0 781 y(ical)34 b(deletion)g(is)g(p)s(ostp)s
+(oned)f(un)m(til)h(the)h(last)f(pro)s(cess)h(calls)f
+(\013clos/\013delt.)54 b(\014ts)p 2801 781 V 32 w(delete)p
+3065 781 V 33 w(\014le)34 b(tries)h(to)g(obtain)g(a)0
+894 y(READ)m(WRITE)f(lo)s(c)m(k)f(on)g(the)g(\014le)g(to)h(b)s(e)e
+(deleted,)i(th)m(us)f(it)g(can)g(b)s(e)g(blo)s(c)m(k)m(ed)g(if)f(the)i
+(ob)5 b(ject)34 b(w)m(as)f(not)h(op)s(ened)0 1007 y(in)29
+b(READ)m(WRITE)i(mo)s(de.)0 1167 y(A)i(shared)f(memory)h(managemen)m(t)
+h(utilit)m(y)d(program)i(called)f(`smem',)h(is)f(included)e(with)i(the)
+h(CFITSIO)e(dis-)0 1280 y(tribution.)37 b(It)27 b(can)g(b)s(e)f(built)f
+(b)m(y)i(t)m(yping)f(`mak)m(e)i(smem';)g(then)f(t)m(yp)s(e)g(`smem)f
+(-h')h(to)h(get)g(a)f(list)e(of)i(v)-5 b(alid)25 b(options.)0
+1393 y(Executing)36 b(smem)g(without)f(an)m(y)i(options)f(causes)g(it)g
+(to)h(list)e(all)g(the)i(shared)e(memory)i(segmen)m(ts)g(curren)m(tly)0
+1506 y(residing)31 b(in)h(the)h(system)h(and)e(managed)i(b)m(y)f(the)h
+(shared)e(memory)h(driv)m(er.)48 b(T)-8 b(o)34 b(get)g(a)g(list)e(of)h
+(all)f(the)i(shared)0 1619 y(memory)c(ob)5 b(jects,)32
+b(run)d(the)h(system)h(utilit)m(y)d(program)i(`ip)s(cs)g([-a]'.)0
+1978 y Fd(4.3)135 b(Base)46 b(Filename)0 2233 y Fi(The)31
+b(base)g(\014lename)g(is)f(the)i(name)f(of)h(the)f(\014le)g(optionally)
+e(including)f(the)k(director/sub)s(directory)d(path,)j(and)0
+2346 y(in)d(the)i(case)g(of)g(`ftp',)f(`h)m(ttp',)i(and)d(`ro)s(ot')j
+(\014let)m(yp)s(es,)d(the)i(mac)m(hine)f(iden)m(ti\014er.)39
+b(Examples:)191 2628 y Fe(myfile.fits)191 2741 y(!data.fits)191
+2854 y(/data/myfile.fits)191 2967 y(fits.gsfc.nasa.gov/ftp/s)o(ampl)o
+(eda)o(ta/m)o(yfil)o(e.f)o(its.)o(gz)0 3248 y Fi(When)29
+b(creating)g(a)g(new)f(output)h(\014le)f(on)h(magnetic)g(disk)e(\(of)j
+(t)m(yp)s(e)f(\014le://\))g(if)f(the)h(base)g(\014lename)f(b)s(egins)f
+(with)0 3361 y(an)34 b(exclamation)h(p)s(oin)m(t)e(\(!\))54
+b(then)34 b(an)m(y)g(existing)g(\014le)f(with)g(that)i(same)g(basename)
+g(will)d(b)s(e)h(deleted)h(prior)f(to)0 3474 y(creating)h(the)g(new)g
+(FITS)f(\014le.)50 b(Otherwise)33 b(if)g(the)h(\014le)f(to)h(b)s(e)g
+(created)h(already)e(exists,)i(then)e(CFITSIO)g(will)0
+3587 y(return)g(an)h(error)f(and)g(will)f(not)i(o)m(v)m(erwrite)g(the)g
+(existing)f(\014le.)51 b(Note)35 b(that)g(the)f(exclamation)g(p)s(oin)m
+(t,)g(')10 b(!',)36 b(is)d(a)0 3700 y(sp)s(ecial)26 b(UNIX)i(c)m
+(haracter,)j(so)d(if)e(it)i(is)f(used)g(on)g(the)h(command)g(line)e
+(rather)i(than)f(en)m(tered)h(at)h(a)f(task)h(prompt,)0
+3813 y(it)i(m)m(ust)g(b)s(e)g(preceded)g(b)m(y)h(a)g(bac)m(kslash)f(to)
+h(force)g(the)g(UNIX)g(shell)d(to)j(pass)f(it)h(v)m(erbatim)f(to)h(the)
+g(application)0 3926 y(program.)0 4086 y(If)24 b(the)i(output)e(disk)g
+(\014le)g(name)h(ends)f(with)f(the)i(su\016x)f('.gz',)k(then)d(CFITSIO)
+e(will)f(compress)j(the)g(\014le)f(using)g(the)0 4199
+y(gzip)g(compression)f(algorithm)g(b)s(efore)h(writing)e(it)i(to)h
+(disk.)37 b(This)22 b(can)j(reduce)f(the)g(amoun)m(t)h(of)f(disk)f
+(space)i(used)0 4312 y(b)m(y)34 b(the)h(\014le.)52 b(Note)36
+b(that)f(this)f(feature)h(requires)e(that)i(the)f(uncompressed)g
+(\014le)f(b)s(e)h(constructed)h(in)e(memory)0 4425 y(b)s(efore)d(it)g
+(is)f(compressed)h(and)g(written)g(to)h(disk,)e(so)h(it)g(can)h(fail)e
+(if)g(there)i(is)e(insu\016cien)m(t)g(a)m(v)-5 b(ailable)30
+b(memory)-8 b(.)0 4585 y(An)45 b(input)f(FITS)g(\014le)h(ma)m(y)h(b)s
+(e)f(compressed)g(with)g(the)g(gzip)g(or)h(Unix)e(compress)i
+(algorithms,)i(in)c(whic)m(h)0 4698 y(case)38 b(CFITSIO)e(will)f
+(uncompress)h(the)i(\014le)f(on)g(the)h(\015y)e(in)m(to)i(a)g(temp)s
+(orary)f(\014le)f(\(in)h(memory)g(or)g(on)h(disk\).)0
+4811 y(Compressed)32 b(\014les)h(ma)m(y)h(only)e(b)s(e)h(op)s(ened)f
+(with)g(read-only)h(p)s(ermission.)47 b(When)33 b(sp)s(ecifying)e(the)j
+(name)f(of)h(a)0 4924 y(compressed)h(FITS)g(\014le)g(it)g(is)g(not)h
+(necessary)g(to)g(app)s(end)e(the)i(\014le)f(su\016x)f(\(e.g.,)39
+b(`.gz')e(or)f(`.Z'\).)g(If)f(CFITSIO)0 5036 y(cannot)24
+b(\014nd)e(the)h(input)e(\014le)i(name)g(without)f(the)h(su\016x,)h
+(then)f(it)g(will)e(automatically)i(searc)m(h)h(for)f(a)g(compressed)0
+5149 y(\014le)35 b(with)f(the)i(same)g(ro)s(ot)g(name.)57
+b(In)35 b(the)h(case)h(of)f(reading)f(ftp)g(and)g(h)m(ttp)h(t)m(yp)s(e)
+g(\014les,)g(CFITSIO)f(generally)0 5262 y(lo)s(oks)i(for)h(a)g
+(compressed)g(v)m(ersion)f(of)h(the)g(\014le)f(\014rst,)i(b)s(efore)e
+(trying)g(to)i(op)s(en)e(the)h(uncompressed)e(\014le.)63
+b(By)0 5375 y(default,)36 b(CFITSIO)f(copies)g(\(and)h(uncompressed)e
+(if)h(necessary\))h(the)g(ftp)f(or)h(h)m(ttp)g(FITS)f(\014le)f(in)m(to)
+i(memory)0 5488 y(on)g(the)g(lo)s(cal)f(mac)m(hine)g(b)s(efore)h(op)s
+(ening)e(it.)57 b(This)34 b(will)f(fail)h(if)h(the)h(lo)s(cal)f(mac)m
+(hine)h(do)s(es)f(not)h(ha)m(v)m(e)h(enough)0 5601 y(memory)g(to)h
+(hold)e(the)h(whole)g(FITS)f(\014le,)j(so)e(in)f(this)g(case,)41
+b(the)c(output)g(\014lename)f(sp)s(eci\014er)g(\(see)i(the)g(next)0
+5714 y(section\))31 b(can)g(b)s(e)e(used)h(to)h(further)e(con)m(trol)i
+(ho)m(w)f(CFITSIO)f(reads)h(ftp)g(and)g(h)m(ttp)g(\014les.)p
 eop
-%%Page: 20 26
-20 25 bop 0 299 a Fi(20)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(where)30
-b(the)h(v)m(ertical)g(bar)g(is)e(the)i(Unix)f(piping)e(sym)m(b)s(ol.)41
+%%Page: 22 28
+22 27 bop 0 299 a Fi(22)1618 b Fg(CHAPTER)30 b(4.)112
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(If)32
+b(the)h(input)e(\014le)h(is)g(an)h(IRAF)g(image)g(\014le)f(\(*.imh)g
+(\014le\))h(then)f(CFITSIO)f(will)g(automatically)h(con)m(v)m(ert)j(it)
+d(on)0 668 y(the)27 b(\015y)g(in)m(to)g(a)h(virtual)d(FITS)h(image)i(b)
+s(efore)f(it)f(is)g(op)s(ened)h(b)m(y)g(the)g(application)f(program.)39
+b(IRAF)27 b(images)h(can)0 781 y(only)h(b)s(e)h(op)s(ened)g(with)f
+(READONL)-8 b(Y)31 b(\014le)e(access.)0 941 y(Similarly)-8
+b(,)28 b(if)i(the)h(input)e(\014le)i(is)f(a)h(ra)m(w)g(binary)e(data)j
+(arra)m(y)-8 b(,)33 b(then)d(CFITSIO)g(will)e(con)m(v)m(ert)33
+b(it)d(on)h(the)h(\015y)e(in)m(to)0 1054 y(a)38 b(virtual)e(FITS)i
+(image)g(with)e(the)i(basic)g(set)g(of)g(required)e(header)i(k)m(eyw)m
+(ords)g(b)s(efore)g(it)f(is)g(op)s(ened)g(b)m(y)h(the)0
+1167 y(application)29 b(program)i(\(with)f(READONL)-8
+b(Y)31 b(access\).)44 b(In)30 b(this)g(case)i(the)f(data)g(t)m(yp)s(e)g
+(and)g(dimensions)d(of)j(the)0 1280 y(image)c(m)m(ust)g(b)s(e)f(sp)s
+(eci\014ed)f(in)h(square)h(brac)m(k)m(ets)h(follo)m(wing)d(the)i
+(\014lename)f(\(e.g.)41 b(ra)m(w\014le.dat[ib512,512]\).)h(The)0
+1393 y(\014rst)30 b(c)m(haracter)i(\(case)f(insensitiv)m(e\))e
+(de\014nes)h(the)g(datat)m(yp)s(e)h(of)g(the)g(arra)m(y:)239
+1671 y Fe(b)429 b(8-bit)46 b(unsigned)g(byte)239 1784
+y(i)381 b(16-bit)46 b(signed)g(integer)239 1897 y(u)381
+b(16-bit)46 b(unsigned)g(integer)239 2010 y(j)381 b(32-bit)46
+b(signed)g(integer)239 2123 y(r)h(or)g(f)143 b(32-bit)46
+b(floating)g(point)239 2235 y(d)381 b(64-bit)46 b(floating)g(point)0
+2514 y Fi(An)40 b(optional)f(second)h(c)m(haracter)i(sp)s(eci\014es)d
+(the)i(b)m(yte)f(order)g(of)g(the)h(arra)m(y)g(v)-5 b(alues:)59
+b(b)40 b(or)g(B)h(indicates)e(big)0 2626 y(endian)g(\(as)i(in)e(FITS)g
+(\014les)h(and)g(the)g(nativ)m(e)h(format)f(of)h(SUN)f(UNIX)h(w)m
+(orkstations)f(and)g(Mac)i(PCs\))e(and)0 2739 y(l)g(or)h(L)g(indicates)
+e(little)h(endian)g(\(nativ)m(e)h(format)h(of)f(DEC)f(OSF)h(w)m
+(orkstations)g(and)f(IBM)i(PCs\).)72 b(If)40 b(this)0
+2852 y(c)m(haracter)32 b(is)d(omitted)i(then)f(the)g(arra)m(y)h(is)f
+(assumed)f(to)i(ha)m(v)m(e)h(the)f(nativ)m(e)f(b)m(yte)h(order)f(of)h
+(the)f(lo)s(cal)g(mac)m(hine.)0 2965 y(These)f(datat)m(yp)s(e)h(c)m
+(haracters)h(are)e(then)g(follo)m(w)m(ed)g(b)m(y)g(a)h(series)e(of)h
+(one)h(or)f(more)g(in)m(teger)h(v)-5 b(alues)28 b(separated)i(b)m(y)0
+3078 y(commas)h(whic)m(h)f(de\014ne)f(the)i(size)g(of)f(eac)m(h)i
+(dimension)c(of)j(the)g(ra)m(w)f(arra)m(y)-8 b(.)43 b(Arra)m(ys)30
+b(with)g(up)f(to)j(5)f(dimensions)0 3191 y(are)f(curren)m(tly)f(supp)s
+(orted.)38 b(Finally)-8 b(,)29 b(a)h(b)m(yte)g(o\013set)g(to)h(the)e(p)
+s(osition)f(of)i(the)g(\014rst)e(pixel)g(in)h(the)g(data)i(\014le)d(ma)
+m(y)0 3304 y(b)s(e)e(sp)s(eci\014ed)f(b)m(y)i(separating)g(it)f(with)g
+(a)h(':')39 b(from)27 b(the)g(last)f(dimension)f(v)-5
+b(alue.)39 b(If)26 b(omitted,)i(it)e(is)g(assumed)g(that)0
+3417 y(the)35 b(o\013set)h(=)f(0.)54 b(This)34 b(parameter)h(ma)m(y)h
+(b)s(e)e(used)g(to)i(skip)d(o)m(v)m(er)j(an)m(y)g(header)e(information)
+g(in)f(the)i(\014le)f(that)0 3530 y(precedes)c(the)h(binary)e(data.)41
+b(F)-8 b(urther)30 b(examples:)95 3808 y Fe(raw.dat[b10000])521
+b(1-dimensional)45 b(10000)h(pixel)g(byte)h(array)95
+3921 y(raw.dat[rb400,400,12])233 b(3-dimensional)45 b(floating)g(point)
+h(big-endian)f(array)95 4034 y(img.fits[ib512,512:2880])89
+b(reads)47 b(the)g(512)g(x)g(512)g(short)f(integer)g(array)g(in)1336
+4147 y(a)i(FITS)e(file,)h(skipping)e(over)i(the)g(2880)g(byte)f(header)
+0 4425 y Fi(One)25 b(sp)s(ecial)e(case)j(of)f(input)e(\014le)h(is)g
+(where)h(the)g(\014lename)f(=)h(`-')h(\(a)f(dash)g(or)g(min)m(us)e
+(sign\))h(or)h('stdin')f(or)h('stdout',)0 4538 y(whic)m(h)c
+(signi\014es)g(that)j(the)f(input)d(\014le)i(is)g(to)i(b)s(e)e(read)g
+(from)h(the)g(stdin)e(stream,)k(or)e(written)e(to)j(the)f(stdout)g
+(stream)0 4650 y(if)33 b(a)h(new)g(output)f(\014le)g(is)g(b)s(eing)g
+(created.)52 b(In)33 b(the)h(case)h(of)f(reading)g(from)f(stdin,)g
+(CFITSIO)g(\014rst)g(copies)h(the)0 4763 y(whole)g(stream)i(in)m(to)f
+(a)g(temp)s(orary)g(FITS)f(\014le)h(\(in)f(memory)h(or)g(on)g(disk\),)g
+(and)g(subsequen)m(t)f(reading)g(of)i(the)0 4876 y(FITS)c(\014le)g(o)s
+(ccurs)h(in)e(this)h(cop)m(y)-8 b(.)49 b(When)33 b(writing)e(to)i
+(stdout,)h(CFITSIO)d(\014rst)h(constructs)h(the)g(whole)f(\014le)g(in)0
+4989 y(memory)i(\(since)h(random)e(access)j(is)d(required\),)i(then)f
+(\015ushes)f(it)h(out)h(to)g(the)f(stdout)h(stream)g(when)e(the)i
+(\014le)0 5102 y(is)29 b(closed.)41 b(In)29 b(addition,)g(if)g(the)h
+(output)g(\014lename)f(=)h('-.gz')i(or)e('stdout.gz')h(then)f(it)g
+(will)d(b)s(e)j(gzip)f(compressed)0 5215 y(b)s(efore)h(b)s(eing)f
+(written)g(to)i(stdout.)0 5375 y(This)24 b(abilit)m(y)h(to)h(read)g
+(and)f(write)g(on)h(the)g(stdin)f(and)g(stdout)h(steams)g(allo)m(ws)g
+(FITS)f(\014les)g(to)h(b)s(e)g(pip)s(ed)d(b)s(et)m(w)m(een)0
+5488 y(tasks)42 b(in)e(memory)h(rather)g(than)h(ha)m(ving)f(to)h
+(create)h(temp)s(orary)e(in)m(termediate)g(FITS)f(\014les)h(on)g(disk.)
+72 b(F)-8 b(or)0 5601 y(example)27 b(if)e(task1)j(creates)h(an)e
+(output)f(FITS)g(\014le,)h(and)g(task2)g(reads)g(an)g(input)e(FITS)h
+(\014le,)h(the)g(FITS)f(\014le)g(ma)m(y)0 5714 y(b)s(e)k(pip)s(ed)e(b)s
+(et)m(w)m(een)j(the)f(2)h(tasks)g(b)m(y)f(sp)s(ecifying)p
+eop
+%%Page: 23 29
+23 28 bop 0 299 a Fg(4.4.)72 b(OUTPUT)30 b(FILE)g(NAME)h(WHEN)g
+(OPENING)f(AN)h(EXISTING)e(FILE)967 b Fi(23)143 555 y
+Fe(task1)47 b(-)g(|)g(task2)g(-)0 793 y Fi(where)30 b(the)h(v)m
+(ertical)g(bar)g(is)e(the)i(Unix)f(piping)e(sym)m(b)s(ol.)41
 b(This)29 b(assumes)h(that)i(the)f(2)g(tasks)g(read)g(the)g(name)g(of)0
-668 y(the)g(FITS)e(\014le)h(o\013)g(of)h(the)g(command)f(line.)0
-957 y Fb(4.2.3)112 b(Output)38 b(File)e(Name)h(when)h(Op)s(ening)g(an)g
-(Existing)e(File)0 1176 y Fi(An)g(optional)g(output)g(\014lename)g(ma)m
-(y)i(b)s(e)e(sp)s(eci\014ed)f(in)g(paren)m(theses)i(immediately)e
-(follo)m(wing)g(the)i(base)g(\014le)0 1289 y(name)28
+906 y(the)g(FITS)e(\014le)h(o\013)g(of)h(the)g(command)f(line.)0
+1236 y Fd(4.4)135 b(Output)45 b(File)g(Name)h(when)f(Op)t(ening)g(an)g
+(Existing)h(File)0 1486 y Fi(An)36 b(optional)g(output)g(\014lename)g
+(ma)m(y)i(b)s(e)e(sp)s(eci\014ed)f(in)g(paren)m(theses)i(immediately)e
+(follo)m(wing)g(the)i(base)g(\014le)0 1599 y(name)28
 b(to)h(b)s(e)f(op)s(ened.)39 b(This)27 b(is)g(mainly)f(useful)h(in)g
 (those)h(cases)i(where)d(CFITSIO)g(creates)j(a)e(temp)s(orary)g(cop)m
-(y)0 1402 y(of)i(the)f(input)f(FITS)g(\014le)h(b)s(efore)g(it)g(is)f
+(y)0 1712 y(of)i(the)f(input)f(FITS)g(\014le)h(b)s(efore)g(it)g(is)f
 (op)s(ened)h(and)f(passed)h(to)h(the)g(application)e(program.)40
-b(This)27 b(happ)s(ens)h(b)m(y)0 1515 y(default)h(when)h(op)s(ening)f
+b(This)27 b(happ)s(ens)h(b)m(y)0 1825 y(default)h(when)h(op)s(ening)f
 (a)h(net)m(w)m(ork)h(FTP)g(or)f(HTTP-t)m(yp)s(e)g(\014le,)g(when)f
-(reading)g(a)i(compressed)f(FITS)g(\014le)f(on)0 1628
+(reading)g(a)i(compressed)f(FITS)g(\014le)f(on)0 1938
 y(a)36 b(lo)s(cal)f(disk,)h(when)f(reading)g(from)h(the)g(stdin)e
 (stream,)k(or)d(when)g(a)i(column)d(\014lter,)j(ro)m(w)f(\014lter,)g
-(or)g(binning)0 1741 y(sp)s(eci\014er)28 b(is)g(included)f(as)j(part)f
+(or)g(binning)0 2051 y(sp)s(eci\014er)28 b(is)g(included)f(as)j(part)f
 (of)g(the)h(input)e(\014le)g(sp)s(eci\014cation.)39 b(By)30
 b(default)f(this)f(temp)s(orary)h(\014le)f(is)h(created)0
-1853 y(in)g(memory)-8 b(.)41 b(If)29 b(there)h(is)f(not)h(enough)g
+2164 y(in)g(memory)-8 b(.)41 b(If)29 b(there)h(is)f(not)h(enough)g
 (memory)g(to)h(create)g(the)g(\014le)e(cop)m(y)-8 b(,)31
-b(then)f(CFITSIO)e(will)f(exit)j(with)f(an)0 1966 y(error.)45
+b(then)f(CFITSIO)e(will)f(exit)j(with)f(an)0 2277 y(error.)45
 b(In)32 b(these)g(cases)h(one)g(can)f(force)h(a)f(p)s(ermanen)m(t)g
 (\014le)f(to)i(b)s(e)e(created)i(on)f(disk,)f(instead)h(of)g(a)g(temp)s
-(orary)0 2079 y(\014le)37 b(in)f(memory)-8 b(,)40 b(b)m(y)d(supplying)d
+(orary)0 2390 y(\014le)37 b(in)f(memory)-8 b(,)40 b(b)m(y)d(supplying)d
 (the)k(name)g(in)e(paren)m(theses)i(immediately)e(follo)m(wing)g(the)h
-(base)h(\014le)f(name.)0 2192 y(The)30 b(output)g(\014lename)f(can)i
+(base)h(\014le)f(name.)0 2503 y(The)30 b(output)g(\014lename)f(can)i
 (include)d(the)j(')10 b(!')41 b(clobb)s(er)29 b(\015ag.)0
-2352 y(Th)m(us,)h(if)f(the)h(input)f(\014lename)g(to)j(CFITSIO)c(is:)
-191 2602 y Fe(file1.fits.gz\(file2.fits)o(\))0 2851 y
-Fi(then)41 b(CFITSIO)f(will)e(uncompress)i(`\014le1.\014ts.gz')i(in)m
-(to)g(the)f(lo)s(cal)f(disk)g(\014le)g(`\014le2.\014ts')i(b)s(efore)e
-(op)s(ening)g(it.)0 2964 y(CFITSIO)34 b(do)s(es)i(not)g(automatically)g
-(delete)h(the)f(output)f(\014le,)i(so)f(it)g(will)d(still)h(exist)i
-(after)g(the)h(application)0 3077 y(program)30 b(exits.)0
-3237 y(In)35 b(some)i(cases,)h(sev)m(eral)e(di\013eren)m(t)g(temp)s
+2663 y(Th)m(us,)48 b(if)c(the)h(input)e(\014lename)h(to)h(CFITSIO)f
+(is:)69 b Fe(file1.fits.gz\(file2.fit)o(s\))39 b Fi(then)44
+b(CFITSIO)g(will)0 2776 y(uncompress)39 b(`\014le1.\014ts.gz')i(in)m
+(to)f(the)g(lo)s(cal)f(disk)f(\014le)h(`\014le2.\014ts')h(b)s(efore)g
+(op)s(ening)e(it.)69 b(CFITSIO)38 b(do)s(es)i(not)0 2889
+y(automatically)30 b(delete)h(the)f(output)g(\014le,)g(so)h(it)f(will)d
+(still)i(exist)h(after)h(the)f(application)f(program)h(exits.)0
+3049 y(In)35 b(some)i(cases,)h(sev)m(eral)e(di\013eren)m(t)g(temp)s
 (orary)f(FITS)h(\014les)f(will)e(b)s(e)i(created)i(in)e(sequence,)j
-(for)e(instance,)h(if)0 3350 y(one)g(op)s(ens)g(a)g(remote)h(\014le)e
+(for)e(instance,)h(if)0 3162 y(one)g(op)s(ens)g(a)g(remote)h(\014le)e
 (using)g(FTP)-8 b(,)37 b(then)g(\014lters)f(ro)m(ws)h(in)f(a)i(binary)d
-(table)i(extension,)i(then)d(create)j(an)0 3463 y(image)e(b)m(y)g
+(table)i(extension,)i(then)d(create)j(an)0 3275 y(image)e(b)m(y)g
 (binning)d(a)j(pair)f(of)h(columns.)59 b(In)36 b(this)g(case,)k(the)d
 (remote)h(\014le)e(will)e(b)s(e)i(copied)g(to)i(a)f(temp)s(orary)0
-3576 y(lo)s(cal)h(\014le,)i(then)e(a)h(second)f(temp)s(orary)h(\014le)e
+3388 y(lo)s(cal)h(\014le,)i(then)e(a)h(second)f(temp)s(orary)h(\014le)e
 (will)f(b)s(e)i(created)i(con)m(taining)e(the)g(\014ltered)g(ro)m(ws)g
-(of)h(the)g(table,)0 3688 y(and)c(\014nally)e(a)j(third)d(temp)s(orary)
+(of)h(the)g(table,)0 3500 y(and)c(\014nally)e(a)j(third)d(temp)s(orary)
 i(\014le)g(con)m(taining)f(the)i(binned)d(image)i(will)e(b)s(e)i
-(created.)57 b(In)34 b(cases)i(lik)m(e)f(this)0 3801
+(created.)57 b(In)34 b(cases)i(lik)m(e)f(this)0 3613
 y(where)28 b(m)m(ultiple)e(\014les)h(are)i(created,)h(the)e(out\014le)g
 (sp)s(eci\014er)f(will)e(b)s(e)j(in)m(terpreted)g(the)g(name)g(of)h
-(the)f(\014nal)f(\014le)h(as)0 3914 y(describ)s(ed)g(b)s(elo)m(w,)i(in)
-f(descending)g(priorit)m(y:)136 4164 y Fc(\017)46 b Fi(as)29
+(the)f(\014nal)f(\014le)h(as)0 3726 y(describ)s(ed)g(b)s(elo)m(w,)i(in)
+f(descending)g(priorit)m(y:)136 3964 y Fc(\017)46 b Fi(as)29
 b(the)g(name)g(of)g(the)g(\014nal)e(image)i(\014le)f(if)f(an)i(image)g
 (within)d(a)j(single)e(binary)g(table)i(cell)f(is)f(op)s(ened)h(or)h
-(if)227 4276 y(an)i(image)f(is)g(created)h(b)m(y)f(binning)e(a)i(table)
-h(column.)136 4461 y Fc(\017)46 b Fi(as)33 b(the)f(name)h(of)f(the)h
+(if)227 4077 y(an)i(image)f(is)g(created)h(b)m(y)f(binning)e(a)i(table)
+h(column.)136 4257 y Fc(\017)46 b Fi(as)33 b(the)f(name)h(of)f(the)h
 (\014le)e(con)m(taining)h(the)g(\014ltered)f(table)i(if)e(a)i(column)e
 (\014lter)g(and/or)h(a)h(ro)m(w)f(\014lter)g(are)227
-4574 y(sp)s(eci\014ed.)136 4758 y Fc(\017)46 b Fi(as)31
+4370 y(sp)s(eci\014ed.)136 4551 y Fc(\017)46 b Fi(as)31
 b(the)f(name)h(of)f(the)h(lo)s(cal)f(cop)m(y)h(of)f(the)h(remote)g(FTP)
-f(or)h(HTTP)e(\014le.)136 4942 y Fc(\017)46 b Fi(as)31
+f(or)h(HTTP)e(\014le.)136 4731 y Fc(\017)46 b Fi(as)31
 b(the)g(name)g(of)g(the)f(uncompressed)g(v)m(ersion)g(of)h(the)f(FITS)g
 (\014le,)g(if)g(a)h(compressed)f(FITS)g(\014le)g(on)h(lo)s(cal)227
-5055 y(disk)e(has)h(b)s(een)g(op)s(ened.)136 5239 y Fc(\017)46
+4844 y(disk)e(has)h(b)s(een)g(op)s(ened.)136 5024 y Fc(\017)46
 b Fi(otherwise,)30 b(the)h(output)f(\014lename)f(is)h(ignored.)0
-5488 y(The)f(output)f(\014le)g(sp)s(eci\014er)g(is)g(useful)f(when)h
+5262 y(The)f(output)f(\014le)g(sp)s(eci\014er)g(is)g(useful)f(when)h
 (reading)g(FTP)h(or)g(HTTP-t)m(yp)s(e)g(FITS)f(\014les)g(since)g(it)h
-(can)g(b)s(e)g(used)0 5601 y(to)34 b(create)i(a)e(lo)s(cal)f(disk)f
+(can)g(b)s(e)g(used)0 5375 y(to)34 b(create)i(a)e(lo)s(cal)f(disk)f
 (cop)m(y)j(of)f(the)g(\014le)e(that)j(can)f(b)s(e)f(reused)g(in)f(the)i
 (future.)50 b(If)33 b(the)h(output)g(\014le)e(name)i(=)0
-5714 y(`*')i(then)f(a)g(lo)s(cal)f(\014le)g(with)g(the)h(same)g(name)g
+5488 y(`*')i(then)f(a)g(lo)s(cal)f(\014le)g(with)g(the)h(same)g(name)g
 (as)g(the)h(net)m(w)m(ork)f(\014le)f(will)f(b)s(e)h(created.)56
-b(Note)36 b(that)f(CFITSIO)p eop
-%%Page: 21 27
-21 26 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(21)0 555 y(will)27 b(b)s(eha)m(v)m(e)j(di\013eren)m(tly)
-f(dep)s(ending)e(on)j(whether)f(the)h(remote)g(\014le)f(is)g
-(compressed)g(or)h(not)g(as)g(sho)m(wn)f(b)m(y)h(the)0
-668 y(follo)m(wing)f(examples:)136 905 y Fc(\017)46 b
-Fi(`ftp://remote.mac)m(hine/tmp/m)m(y\014le.\014ts.gz\(*\)')i(-)43
-b(the)g(remote)h(compressed)f(\014le)f(is)g(copied)h(to)h(the)227
-1018 y(lo)s(cal)24 b(compressed)g(\014le)f(`m)m(y\014le.\014ts.gz',)k
-(whic)m(h)c(is)g(then)i(uncompressed)e(in)g(lo)s(cal)g(memory)h(b)s
-(efore)g(b)s(eing)227 1131 y(op)s(ened)30 b(and)g(passed)g(to)h(the)f
-(application)f(program.)136 1321 y Fc(\017)46 b Fi(`ftp://remote.mac)m
-(hine/tmp/m)m(y\014le.\014ts.gz\(m)m(y\014le.\014ts\)')40
-b(-)d(the)g(remote)g(compressed)f(\014le)g(is)f(copied)227
-1434 y(and)i(uncompressed)g(in)m(to)g(the)h(lo)s(cal)f(\014le)g(`m)m
-(y\014le.\014ts'.)63 b(This)35 b(example)j(requires)e(less)h(lo)s(cal)g
-(memory)227 1547 y(than)30 b(the)h(previous)e(example)h(since)g(the)g
-(\014le)g(is)f(uncompressed)g(on)h(disk)f(instead)h(of)g(in)g(memory)-8
-b(.)136 1737 y Fc(\017)46 b Fi(`ftp://remote.mac)m(hine/tmp/m)m
+b(Note)36 b(that)f(CFITSIO)0 5601 y(will)27 b(b)s(eha)m(v)m(e)j
+(di\013eren)m(tly)f(dep)s(ending)e(on)j(whether)f(the)h(remote)g
+(\014le)f(is)g(compressed)g(or)h(not)g(as)g(sho)m(wn)f(b)m(y)h(the)0
+5714 y(follo)m(wing)f(examples:)p eop
+%%Page: 24 30
+24 29 bop 0 299 a Fi(24)1618 b Fg(CHAPTER)30 b(4.)112
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)136 555 y
+Fc(\017)46 b Fi(`ftp://remote.mac)m(hine/tmp/m)m
+(y\014le.\014ts.gz\(*\)')i(-)43 b(the)g(remote)h(compressed)f(\014le)f
+(is)g(copied)h(to)h(the)227 668 y(lo)s(cal)24 b(compressed)g(\014le)f
+(`m)m(y\014le.\014ts.gz',)k(whic)m(h)c(is)g(then)i(uncompressed)e(in)g
+(lo)s(cal)g(memory)h(b)s(efore)g(b)s(eing)227 781 y(op)s(ened)30
+b(and)g(passed)g(to)h(the)f(application)f(program.)136
+979 y Fc(\017)46 b Fi(`ftp://remote.mac)m(hine/tmp/m)m
+(y\014le.\014ts.gz\(m)m(y\014le.\014ts\)')40 b(-)d(the)g(remote)g
+(compressed)f(\014le)g(is)f(copied)227 1092 y(and)i(uncompressed)g(in)m
+(to)g(the)h(lo)s(cal)f(\014le)g(`m)m(y\014le.\014ts'.)63
+b(This)35 b(example)j(requires)e(less)h(lo)s(cal)g(memory)227
+1205 y(than)30 b(the)h(previous)e(example)h(since)g(the)g(\014le)g(is)f
+(uncompressed)g(on)h(disk)f(instead)h(of)g(in)g(memory)-8
+b(.)136 1403 y Fc(\017)46 b Fi(`ftp://remote.mac)m(hine/tmp/m)m
 (y\014le.\014ts\(m)m(y\014le.\014ts.gz\)')25 b(-)c(this)f(will)f
-(usually)g(pro)s(duce)h(an)h(error)g(since)227 1850 y(CFITSIO)29
-b(itself)g(cannot)i(compress)f(\014les.)0 2087 y(The)36
+(usually)g(pro)s(duce)h(an)h(error)g(since)227 1516 y(CFITSIO)29
+b(itself)g(cannot)i(compress)f(\014les.)0 1759 y(The)36
 b(exact)i(b)s(eha)m(vior)d(of)i(CFITSIO)e(in)g(the)i(latter)f(case)i
 (dep)s(ends)c(on)j(the)f(t)m(yp)s(e)h(of)g(ftp)f(serv)m(er)g(running)e
-(on)0 2200 y(the)d(remote)g(mac)m(hine)f(and)g(ho)m(w)g(it)g(is)f
+(on)0 1872 y(the)d(remote)g(mac)m(hine)f(and)g(ho)m(w)g(it)g(is)f
 (con\014gured.)40 b(In)30 b(some)h(cases,)g(if)e(the)i(\014le)e(`m)m
-(y\014le.\014ts.gz')j(exists)e(on)g(the)0 2312 y(remote)38
+(y\014le.\014ts.gz')j(exists)e(on)g(the)0 1985 y(remote)38
 b(mac)m(hine,)g(then)f(the)g(serv)m(er)g(will)e(cop)m(y)i(it)g(to)g
 (the)h(lo)s(cal)e(mac)m(hine.)60 b(In)36 b(other)h(cases)h(the)f(ftp)g
-(serv)m(er)0 2425 y(will)c(automatically)j(create)h(and)f(transmit)f(a)
+(serv)m(er)0 2098 y(will)c(automatically)j(create)h(and)f(transmit)f(a)
 h(compressed)g(v)m(ersion)f(of)h(the)g(\014le)f(if)g(only)g(the)h
-(uncompressed)0 2538 y(v)m(ersion)26 b(exists.)40 b(This)25
+(uncompressed)0 2211 y(v)m(ersion)26 b(exists.)40 b(This)25
 b(can)i(get)h(rather)f(confusing,)g(so)g(users)f(should)f(use)i(a)g
-(certain)g(amoun)m(t)h(of)f(caution)g(when)0 2651 y(using)33
+(certain)g(amoun)m(t)h(of)f(caution)g(when)0 2324 y(using)33
 b(the)i(output)f(\014le)g(sp)s(eci\014er)f(with)h(FTP)g(or)h(HTTP)f
 (\014le)g(t)m(yp)s(es,)i(to)f(mak)m(e)h(sure)e(they)h(get)h(the)f(b)s
-(eha)m(vior)0 2764 y(that)c(they)g(exp)s(ect.)0 3058
-y Fb(4.2.4)112 b(T)-9 b(emplate)37 b(File)f(Name)h(when)h(Creating)f(a)
-g(New)g(File)0 3277 y Fi(When)h(a)h(new)f(FITS)g(\014le)g(is)g(created)
-h(with)f(a)g(call)g(to)i(\014ts)p 2101 3277 28 4 v 32
-w(create)p 2369 3277 V 35 w(\014le,)f(the)g(name)g(of)g(a)g(template)g
-(\014le)e(ma)m(y)0 3390 y(b)s(e)i(supplied)e(in)i(paren)m(theses)h
-(immediately)e(follo)m(wing)g(the)j(name)f(of)g(the)g(new)f(\014le)g
-(to)i(b)s(e)e(created.)71 b(This)0 3503 y(template)26
+(eha)m(vior)0 2437 y(that)c(they)g(exp)s(ect.)0 2783
+y Fd(4.5)135 b(T)-11 b(emplate)46 b(File)g(Name)f(when)g(Creating)h(a)g
+(New)f(File)0 3035 y Fi(When)38 b(a)h(new)f(FITS)g(\014le)g(is)g
+(created)h(with)f(a)g(call)g(to)i(\014ts)p 2101 3035
+28 4 v 32 w(create)p 2369 3035 V 35 w(\014le,)f(the)g(name)g(of)g(a)g
+(template)g(\014le)e(ma)m(y)0 3148 y(b)s(e)i(supplied)e(in)i(paren)m
+(theses)h(immediately)e(follo)m(wing)g(the)j(name)f(of)g(the)g(new)f
+(\014le)g(to)i(b)s(e)e(created.)71 b(This)0 3261 y(template)26
 b(is)e(used)h(to)h(de\014ne)f(the)h(structure)f(of)h(one)f(or)h(more)g
 (HDUs)g(in)e(the)i(new)f(\014le.)38 b(The)25 b(template)h(\014le)e(ma)m
-(y)0 3616 y(b)s(e)32 b(another)h(FITS)f(\014le,)h(in)f(whic)m(h)f(case)
+(y)0 3374 y(b)s(e)32 b(another)h(FITS)f(\014le,)h(in)f(whic)m(h)f(case)
 j(the)f(newly)f(created)i(\014le)e(will)e(ha)m(v)m(e)k(exactly)g(the)f
-(same)g(k)m(eyw)m(ords)g(in)0 3729 y(eac)m(h)25 b(HDU)g(as)g(in)e(the)h
+(same)g(k)m(eyw)m(ords)g(in)0 3487 y(eac)m(h)25 b(HDU)g(as)g(in)e(the)h
 (template)h(FITS)e(\014le,)i(but)e(all)h(the)g(data)h(units)d(will)g(b)
 s(e)i(\014lled)e(with)g(zeros.)40 b(The)24 b(template)0
-3842 y(\014le)h(ma)m(y)i(also)f(b)s(e)f(an)h(ASCI)s(I)e(text)j(\014le,)
+3600 y(\014le)h(ma)m(y)i(also)f(b)s(e)f(an)h(ASCI)s(I)e(text)j(\014le,)
 f(where)g(eac)m(h)h(line)d(\(in)h(general\))i(describ)s(es)d(one)i
-(FITS)f(k)m(eyw)m(ord)i(record.)0 3955 y(The)j(format)h(of)f(the)h
+(FITS)f(k)m(eyw)m(ord)i(record.)0 3713 y(The)j(format)h(of)f(the)h
 (ASCI)s(I)e(template)h(\014le)g(is)f(describ)s(ed)f(b)s(elo)m(w.)0
-4245 y Fh(Detailed)34 b(T)-9 b(emplate)34 b(Line)h(F)-9
-b(ormat)0 4465 y Fi(The)30 b(format)h(of)f(eac)m(h)i(ASCI)s(I)c
-(template)j(line)e(closely)h(follo)m(ws)f(the)i(format)g(of)f(a)h(FITS)
-f(k)m(eyw)m(ord)g(record:)95 4727 y Fe(KEYWORD)46 b(=)i(KEYVALUE)d(/)j
-(COMMENT)0 4989 y Fi(except)22 b(that)g(free)g(format)f(ma)m(y)h(b)s(e)
-f(used)f(\(e.g.,)25 b(the)d(equals)e(sign)h(ma)m(y)g(app)s(ear)g(at)h
-(an)m(y)g(p)s(osition)d(in)h(the)i(line\))e(and)0 5102
-y(T)-8 b(AB)34 b(c)m(haracters)g(are)g(allo)m(w)m(ed)f(and)g(are)g
-(treated)h(the)g(same)f(as)h(space)f(c)m(haracters.)51
-b(The)33 b(KEYV)-10 b(ALUE)33 b(and)0 5215 y(COMMENT)d(\014elds)f(are)i
-(optional.)41 b(The)30 b(equals)g(sign)f(c)m(haracter)k(is)c(also)i
-(optional,)f(but)g(it)g(is)f(recommended)0 5328 y(that)42
-b(it)e(b)s(e)h(included)d(for)j(clarit)m(y)-8 b(.)73
-b(An)m(y)41 b(template)h(line)d(that)j(b)s(egins)e(with)f(the)j(p)s
-(ound)d('#')i(c)m(haracter)i(is)0 5441 y(ignored)29 b(b)m(y)i(the)f
-(template)h(parser)f(and)g(ma)m(y)h(b)s(e)e(use)h(to)h(insert)f(commen)
-m(ts)h(in)m(to)f(the)h(template)g(\014le)e(itself.)0
-5601 y(The)d(KEYW)m(ORD)g(name)g(\014eld)f(is)g(limited)f(to)j(8)f(c)m
-(haracters)h(in)e(length)h(and)f(only)g(the)h(letters)h(A-Z,)f(digits)f
-(0-9,)0 5714 y(and)j(the)g(h)m(yphen)f(and)h(underscore)g(c)m
-(haracters)h(ma)m(y)g(b)s(e)f(used,)g(without)g(an)m(y)g(em)m(b)s
-(edded)g(spaces.)40 b(Lo)m(w)m(ercase)p eop
-%%Page: 22 28
-22 27 bop 0 299 a Fi(22)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(letters)21
-b(in)f(the)i(template)f(k)m(eyw)m(ord)h(name)f(will)d(b)s(e)j(con)m(v)m
-(erted)i(to)f(upp)s(ercase.)36 b(Leading)21 b(spaces)g(in)f(the)i
-(template)0 668 y(line)i(preceding)h(the)g(k)m(eyw)m(ord)h(name)g(are)g
-(generally)f(ignored,)h(except)g(if)f(the)h(\014rst)f(8)h(c)m
-(haracters)h(of)f(a)g(template)0 781 y(line)d(are)j(all)e(blank,)h
-(then)g(the)g(en)m(tire)g(line)f(is)g(treated)i(as)f(a)h(FITS)e(commen)
-m(t)i(k)m(eyw)m(ord)g(\(with)e(a)i(blank)d(k)m(eyw)m(ord)0
-894 y(name\))31 b(and)f(is)f(copied)h(v)m(erbatim)g(in)m(to)g(the)h
-(FITS)e(header.)0 1054 y(The)37 b(KEYV)-10 b(ALUE)37
-b(\014eld)f(ma)m(y)i(ha)m(v)m(e)g(an)m(y)g(allo)m(w)m(ed)f(FITS)g(data)
-h(t)m(yp)s(e:)54 b(c)m(haracter)39 b(string,)g(logical,)f(in)m(teger,)0
-1167 y(real,)33 b(complex)f(in)m(teger,)i(or)e(complex)h(real.)46
-b(The)32 b(c)m(haracter)j(string)c(v)-5 b(alues)32 b(need)g(not)h(b)s
-(e)f(enclosed)g(in)f(single)0 1280 y(quote)e(c)m(haracters)h(unless)d
-(they)h(are)h(necessary)g(to)g(distinguish)24 b(the)29
-b(string)e(from)h(a)h(di\013eren)m(t)f(data)h(t)m(yp)s(e)f(\(e.g.)0
-1393 y(2.0)h(is)d(a)i(real)g(but)f('2.0')i(is)e(a)h(string\).)39
-b(The)27 b(k)m(eyw)m(ord)h(has)f(an)h(unde\014ned)d(\(n)m(ull\))h(v)-5
-b(alue)28 b(if)e(the)i(template)g(record)0 1506 y(only)h(con)m(tains)i
-(blanks)e(follo)m(wing)g(the)h("=")h(or)g(b)s(et)m(w)m(een)g(the)f("=")
-h(and)f(the)g("/")i(commen)m(t)g(\014eld)c(delimiter.)0
-1666 y(String)d(k)m(eyw)m(ord)i(v)-5 b(alues)26 b(longer)g(than)g(68)h
-(c)m(haracters)h(\(the)f(maxim)m(um)e(length)h(that)h(will)d(\014t)i
-(in)f(a)i(single)e(FITS)0 1779 y(k)m(eyw)m(ord)41 b(record\))g(are)g(p)
-s(ermitted)e(using)g(the)i(CFITSIO)e(long)h(string)g(con)m(v)m(en)m
-(tion.)73 b(They)40 b(can)h(either)f(b)s(e)0 1892 y(sp)s(eci\014ed)27
-b(as)j(a)f(single)f(long)g(line)g(in)f(the)j(template,)g(or)f(b)m(y)f
-(using)g(m)m(ultiple)f(lines)g(where)h(the)i(con)m(tin)m(uing)e(lines)0
-2005 y(con)m(tain)j(the)f('CONTINUE')g(k)m(eyw)m(ord,)h(as)g(in)e(this)
-g(example:)95 2257 y Fe(LONGKEY)46 b(=)i('This)e(is)h(a)h(long)e
-(string)g(value)h(that)f(is)i(contin&')95 2370 y(CONTINUE)94
-b('ued)46 b(over)h(2)g(records')f(/)h(comment)f(field)h(goes)f(here)0
-2622 y Fi(The)29 b(format)h(of)g(template)g(lines)d(with)i(CONTINUE)f
-(k)m(eyw)m(ord)i(is)f(v)m(ery)h(strict:)40 b(3)30 b(spaces)g(m)m(ust)f
-(follo)m(w)g(CON-)0 2735 y(TINUE)h(and)g(the)g(rest)h(of)f(the)h(line)e
-(is)g(copied)h(v)m(erbatim)g(to)h(the)g(FITS)e(\014le.)0
-2895 y(The)i(start)h(of)g(the)f(optional)g(COMMENT)g(\014eld)f(m)m(ust)
-i(b)s(e)e(preceded)i(b)m(y)f("/",)i(whic)m(h)d(is)h(used)g(to)h
-(separate)g(it)0 3008 y(from)e(the)g(k)m(eyw)m(ord)h(v)-5
-b(alue)29 b(\014eld.)40 b(Exceptions)29 b(are)i(if)e(the)i(KEYW)m(ORD)g
-(name)f(\014eld)f(con)m(tains)h(COMMENT,)0 3121 y(HISTOR)-8
-b(Y,)30 b(CONTINUE,)g(or)g(if)f(the)i(\014rst)f(8)g(c)m(haracters)i(of)
-f(the)f(template)h(line)e(are)i(blanks.)0 3281 y(More)c(than)f(one)h
-(Header-Data)i(Unit)d(\(HDU\))h(ma)m(y)g(b)s(e)f(de\014ned)f(in)g(the)i
-(template)g(\014le.)38 b(The)26 b(start)h(of)g(an)f(HDU)0
-3394 y(de\014nition)i(is)h(denoted)i(with)e(a)i(SIMPLE)e(or)i(XTENSION)
-e(template)i(line:)0 3554 y(1\))j(SIMPLE)f(b)s(egins)f(a)i(Primary)f
-(HDU)h(de\014nition.)48 b(SIMPLE)33 b(ma)m(y)h(only)f(app)s(ear)g(as)h
-(the)g(\014rst)f(k)m(eyw)m(ord)h(in)0 3667 y(the)e(template)h(\014le.)
-44 b(If)32 b(the)g(template)h(\014le)e(b)s(egins)f(with)h(XTENSION)g
-(instead)g(of)h(SIMPLE,)g(then)f(a)i(default)0 3780 y(empt)m(y)d
-(Primary)d(HDU)j(is)f(created,)i(and)d(the)i(template)g(is)e(then)h
-(assumed)f(to)i(de\014ne)f(the)h(k)m(eyw)m(ords)f(starting)0
-3893 y(with)g(the)i(\014rst)e(extension)h(follo)m(wing)f(the)i(Primary)
-e(HDU.)0 4053 y(2\))35 b(XTENSION)e(marks)g(the)i(b)s(eginning)c(of)j
-(a)h(new)e(extension)h(HDU)g(de\014nition.)50 b(The)33
-b(previous)g(HDU)i(will)0 4166 y(b)s(e)30 b(closed)g(at)h(this)e(p)s
-(oin)m(t)h(and)f(pro)s(cessing)h(of)g(the)h(next)f(extension)g(b)s
-(egins.)0 4452 y Fh(Auto-indexing)35 b(of)g(Keyw)m(ords)0
-4671 y Fi(If)c(a)h(template)f(k)m(eyw)m(ord)h(name)f(ends)g(with)f(a)h
-("#")h(c)m(haracter,)i(it)d(is)f(said)g(to)i(b)s(e)f('auto-indexed'.)43
-b(Eac)m(h)32 b("#")0 4784 y(c)m(haracter)i(will)c(b)s(e)i(replaced)h(b)
-m(y)f(the)h(curren)m(t)g(in)m(teger)g(index)e(v)-5 b(alue,)33
-b(whic)m(h)f(gets)h(reset)h(=)e(1)h(at)h(the)e(start)i(of)0
-4897 y(eac)m(h)h(new)f(HDU)g(in)f(the)h(\014le)f(\(or)h(7)h(in)d(the)i
-(sp)s(ecial)f(case)i(of)f(a)g(GR)m(OUP)h(de\014nition\).)49
-b(The)33 b(FIRST)g(indexed)0 5010 y(k)m(eyw)m(ord)e(in)f(eac)m(h)i
-(template)g(HDU)g(de\014nition)c(is)i(used)h(as)g(the)g('incremen)m
-(tor';)h(eac)m(h)g(subsequen)m(t)e(o)s(ccurence)0 5123
-y(of)i(this)e(SAME)h(k)m(eyw)m(ord)h(will)d(cause)j(the)g(index)e(v)-5
-b(alue)31 b(to)h(b)s(e)f(incremen)m(ted.)43 b(This)30
-b(b)s(eha)m(vior)g(can)i(b)s(e)f(rather)0 5236 y(subtle,)c(as)h
-(illustrated)e(in)g(the)i(follo)m(wing)e(examples)h(in)f(whic)m(h)h
-(the)h(TTYPE)e(k)m(eyw)m(ord)i(is)f(the)h(incremen)m(tor)f(in)0
-5349 y(b)s(oth)j(cases:)95 5601 y Fe(TTYPE#)47 b(=)g(TIME)95
-5714 y(TFORM#)g(=)g(1D)p eop
-%%Page: 23 29
-23 28 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(23)95 555 y Fe(TTYPE#)47 b(=)g(RATE)95
-668 y(TFORM#)g(=)g(1E)0 894 y Fi(will)23 b(create)28
-b(TTYPE1,)e(TF)m(ORM1,)i(TTYPE2,)f(and)e(TF)m(ORM2)i(k)m(eyw)m(ords.)40
-b(But)26 b(if)f(the)h(template)g(lo)s(oks)f(lik)m(e,)95
-1120 y Fe(TTYPE#)47 b(=)g(TIME)95 1233 y(TTYPE#)g(=)g(RATE)95
-1345 y(TFORM#)g(=)g(1D)95 1458 y(TFORM#)g(=)g(1E)0 1684
-y Fi(this)30 b(results)f(in)h(a)h(FITS)f(\014les)g(with)f(TTYPE1,)i
-(TTYPE2,)g(TF)m(ORM2,)h(and)e(TF)m(ORM2,)i(whic)m(h)e(is)g(probably)0
-1797 y(not)h(what)f(w)m(as)h(in)m(tended!)0 2079 y Fh(T)-9
-b(emplate)33 b(P)m(arser)j(Directiv)m(es)0 2298 y Fi(In)29
-b(addition)g(to)h(the)g(template)h(lines)d(whic)m(h)h(de\014ne)g
-(individual)d(k)m(eyw)m(ords,)k(the)g(template)h(parser)e(recognizes)0
-2411 y(3)h(sp)s(ecial)f(directiv)m(es)g(whic)m(h)g(are)h(eac)m(h)h
-(preceded)f(b)m(y)f(the)h(bac)m(kslash)g(c)m(haracter:)90
-b Fe(\\include,)45 b(\\group)p Fi(,)29 b(and)48 2524
-y Fe(\\end)p Fi(.)0 2684 y(The)37 b('include')f(directiv)m(e)i(m)m(ust)
-f(b)s(e)h(follo)m(w)m(ed)f(b)m(y)h(a)g(\014lename.)62
-b(It)38 b(forces)g(the)g(parser)f(to)i(temp)s(orarily)d(stop)0
-2797 y(reading)e(the)h(curren)m(t)g(template)g(\014le)f(and)g(b)s(egin)
-g(reading)g(the)h(include)d(\014le.)54 b(Once)35 b(the)g(parser)f(reac)
-m(hes)i(the)0 2910 y(end)f(of)h(the)g(include)d(\014le)i(it)g(con)m
-(tin)m(ues)g(parsing)g(the)g(curren)m(t)h(template)g(\014le.)55
-b(Include)34 b(\014les)h(can)h(b)s(e)f(nested,)0 3023
-y(and)30 b(HDU)h(de\014nitions)d(can)i(span)g(m)m(ultiple)e(template)j
-(\014les.)0 3183 y(The)g(start)h(of)g(a)g(GR)m(OUP)h(de\014nition)c(is)
-i(denoted)h(with)e(the)i('group')g(directiv)m(e,)f(and)h(the)f(end)h
-(of)f(a)i(GR)m(OUP)0 3296 y(de\014nition)i(is)i(denoted)g(with)f(the)i
-('end')f(directiv)m(e.)61 b(Eac)m(h)39 b(GR)m(OUP)e(con)m(tains)h(0)g
-(or)f(more)h(mem)m(b)s(er)f(blo)s(c)m(ks)0 3409 y(\(HDUs)44
-b(or)f(GR)m(OUPs\).)79 b(Mem)m(b)s(er)42 b(blo)s(c)m(ks)h(of)g(t)m(yp)s
-(e)g(GR)m(OUP)g(can)g(con)m(tain)g(their)f(o)m(wn)h(mem)m(b)s(er)f(blo)
-s(c)m(ks.)0 3522 y(The)32 b(GR)m(OUP)g(de\014nition)e(itself)h(o)s
-(ccupies)h(one)g(FITS)g(\014le)f(HDU)i(of)f(sp)s(ecial)f(t)m(yp)s(e)h
-(\(GR)m(OUP)h(HDU\),)h(so)e(if)g(a)0 3634 y(template)f(sp)s(eci\014es)e
-(1)i(group)e(with)g(1)i(mem)m(b)s(er)f(HDU)h(lik)m(e:)0
-3860 y Fe(\\group)0 3973 y(grpdescr)46 b(=)h('demo')0
-4086 y(xtension)f(bintable)0 4199 y(#)h(this)g(bintable)f(has)h(0)g
-(cols,)f(0)i(rows)0 4312 y(\\end)0 4538 y Fi(then)30
-b(the)h(parser)e(creates)j(a)f(FITS)f(\014le)f(with)g(3)i(HDUs)g(:)0
-4763 y Fe(1\))47 b(dummy)g(PHDU)0 4876 y(2\))g(GROUP)g(HDU)f(\(has)h(1)
-h(member,)d(which)i(is)g(bintable)e(in)j(HDU)f(number)f(3\))0
-4989 y(3\))h(bintable)f(\(member)g(of)h(GROUP)f(in)h(HDU)g(number)f
-(2\))0 5215 y Fi(T)-8 b(ec)m(hnically)29 b(sp)s(eaking,)g(the)g(GR)m
-(OUP)i(HDU)f(is)f(a)h(BINT)-8 b(ABLE)30 b(with)f(6)h(columns.)39
-b(Applications)28 b(can)i(de\014ne)0 5328 y(additional)20
-b(columns)h(in)f(a)j(GR)m(OUP)f(HDU)h(using)e(TF)m(ORMn)g(and)h(TTYPEn)
-f(\(where)g(n)h(is)f(7,)j(8,)h(....\))39 b(k)m(eyw)m(ords)0
-5441 y(or)30 b(their)g(auto-indexing)f(equiv)-5 b(alen)m(ts.)0
-5601 y(F)d(or)26 b(a)f(more)g(complicated)f(example)g(of)h(a)h
-(template)f(\014le)f(using)f(the)i(group)f(directiv)m(es,)i(lo)s(ok)e
-(at)h(the)g(sample.tpl)0 5714 y(\014le)k(that)i(is)f(included)d(in)j
-(the)g(CFITSIO)f(distribution.)p eop
-%%Page: 24 30
-24 29 bop 0 299 a Fi(24)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fh(F)f(ormal)34
-b(T)-9 b(emplate)34 b(Syn)m(tax)0 774 y Fi(The)c(template)h(syn)m(tax)g
-(can)f(formally)f(b)s(e)h(de\014ned)f(as)i(follo)m(ws:)191
-1012 y Fe(TEMPLATE)45 b(=)j(BLOCK)e([)i(BLOCK)e(...)h(])334
-1238 y(BLOCK)f(=)i({)f(HDU)g(|)h(GROUP)e(})334 1464 y(GROUP)g(=)i
-(\\GROUP)e([)h(BLOCK)g(...)g(])g(\\END)430 1689 y(HDU)f(=)i(XTENSION)d
-([)j(LINE)f(...)f(])i({)f(XTENSION)f(|)h(\\GROUP)f(|)i(\\END)f(|)g(EOF)
-g(})382 1915 y(LINE)f(=)i([)f(KEYWORD)f([)i(=)f(])h(])f([)g(VALUE)g(])g
-([)h(/)f(COMMENT)f(])191 2141 y(X)h(...)238 b(-)48 b(X)f(can)g(be)g
-(present)f(1)h(or)h(more)e(times)191 2254 y({)h(X)h(|)f(Y)h(})f(-)h(X)f
-(or)g(Y)191 2367 y([)g(X)h(])238 b(-)48 b(X)f(is)g(optional)0
-2605 y Fi(A)m(t)34 b(the)f(topmost)g(lev)m(el,)g(the)g(template)h
-(de\014nes)d(1)j(or)e(more)h(template)g(blo)s(c)m(ks.)48
-b(Blo)s(c)m(ks)33 b(can)g(b)s(e)f(either)g(HDU)0 2718
-y(\(Header)27 b(Data)h(Unit\))f(or)f(a)h(GR)m(OUP)-8
-b(.)28 b(F)-8 b(or)27 b(eac)m(h)g(blo)s(c)m(k)f(the)h(parser)f(creates)
-i(1)f(\(or)g(more)f(for)h(GR)m(OUPs\))g(FITS)0 2830 y(\014le)i(HDUs.)0
-3114 y Fh(Errors)0 3333 y Fi(In)24 b(general)g(the)g(\014ts)p
-692 3333 28 4 v 33 w(execute)p 1019 3333 V 34 w(template\(\))h
-(function)e(tries)h(to)h(b)s(e)f(as)g(atomic)h(as)g(p)s(ossible,)e(so)h
-(either)g(ev)m(erything)0 3446 y(is)f(done)h(or)g(nothing)e(is)h(done.)
-39 b(If)23 b(an)h(error)f(o)s(ccurs)h(during)e(parsing)g(of)i(the)g
-(template,)i(\014ts)p 3125 3446 V 33 w(execute)p 3452
-3446 V 34 w(template\(\))0 3559 y(will)k(\(try)j(to\))h(delete)f(the)g
-(top)g(lev)m(el)f(BLOCK)g(\(with)g(all)f(its)h(c)m(hildren)f(if)h(an)m
-(y\))h(in)e(whic)m(h)h(the)h(error)f(o)s(ccured,)0 3672
-y(then)e(it)g(will)e(stop)i(reading)g(the)g(template)h(\014le)e(and)h
-(it)g(will)e(return)h(with)g(an)h(error.)0 3956 y Fh(Examples)0
-4175 y Fi(1.)54 b(This)33 b(template)i(\014le)f(will)e(create)k(a)f
-(200)h(x)e(300)i(pixel)d(image,)k(with)c(4-b)m(yte)j(in)m(teger)f
-(pixel)e(v)-5 b(alues,)35 b(in)f(the)0 4288 y(primary)28
-b(HDU:)95 4526 y Fe(SIMPLE)47 b(=)g(T)95 4638 y(BITPIX)g(=)g(32)95
-4751 y(NAXIS)g(=)g(2)239 b(/)47 b(number)f(of)h(dimensions)95
-4864 y(NAXIS1)g(=)g(100)95 b(/)47 b(length)f(of)h(first)g(axis)95
-4977 y(NAXIS2)g(=)g(200)95 b(/)47 b(length)f(of)h(second)f(axis)95
-5090 y(OBJECT)h(=)g(NGC)g(253)g(/)g(name)g(of)g(observed)f(object)0
-5328 y Fi(The)35 b(allo)m(w)m(ed)g(v)-5 b(alues)35 b(of)g(BITPIX)g(are)
-h(8,)h(16,)h(32,)g(-32,)g(or)d(-64,)j(represen)m(ting,)e(resp)s(ectiv)m
-(ely)-8 b(,)37 b(8-bit)e(in)m(teger,)0 5441 y(16-bit)c(in)m(teger,)g
-(32-bit)f(in)m(teger,)h(32-bit)g(\015oating)f(p)s(oin)m(t,)g(or)g(64)h
-(bit)f(\015oating)g(p)s(oin)m(t)f(pixels.)0 5601 y(2.)39
-b(T)-8 b(o)23 b(create)h(a)f(FITS)e(table,)k(the)d(template)h(\014rst)f
-(needs)g(to)i(include)c(XTENSION)i(=)g(T)-8 b(ABLE)23
-b(or)f(BINT)-8 b(ABLE)0 5714 y(to)31 b(de\014ne)e(whether)g(it)g(is)g
-(an)g(ASCI)s(I)g(or)g(binary)f(table,)i(and)g(NAXIS2)g(to)g(de\014ne)f
-(the)h(n)m(um)m(b)s(er)f(of)h(ro)m(ws)f(in)g(the)p eop
-%%Page: 25 31
-25 30 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(25)0 555 y(table.)49 b(Tw)m(o)34 b(template)f(lines)f
-(are)i(then)f(needed)f(to)i(de\014ne)f(the)g(name)h(\(TTYPEn\))e(and)h
-(FITS)g(data)h(format)0 668 y(\(TF)m(ORMn\))d(of)f(the)h(columns,)e(as)
-i(in)e(this)g(example:)95 966 y Fe(xtension)46 b(=)h(bintable)95
-1079 y(naxis2)g(=)g(40)95 1192 y(ttype#)g(=)g(Name)95
-1305 y(tform#)g(=)g(10a)95 1418 y(ttype#)g(=)g(Npoints)95
-1531 y(tform#)g(=)g(j)95 1644 y(ttype#)g(=)g(Rate)95
-1756 y(tunit#)g(=)g(counts/s)95 1869 y(tform#)g(=)g(e)0
-2167 y Fi(The)26 b(ab)s(o)m(v)m(e)j(example)d(de\014nes)g(a)i(n)m(ull)d
-(primary)g(arra)m(y)i(follo)m(w)m(ed)g(b)m(y)g(a)g(40-ro)m(w)h(binary)d
-(table)i(extension)g(with)f(3)0 2280 y(columns)h(called)g('Name',)j
-('Np)s(oin)m(ts',)e(and)g('Rate',)i(with)d(data)i(formats)f(of)g('10A')
-i(\(ASCI)s(I)d(c)m(haracter)i(string\),)0 2393 y('1J')k(\(in)m(teger\))
-h(and)e('1E')i(\(\015oating)e(p)s(oin)m(t\),)h(resp)s(ectiv)m(ely)-8
-b(.)48 b(Note)34 b(that)f(the)g(other)g(required)e(FITS)h(k)m(eyw)m
-(ords)0 2506 y(\(BITPIX,)37 b(NAXIS,)g(NAXIS1,)h(PCOUNT,)e(GCOUNT,)h
-(TFIELDS,)f(and)g(END\))h(do)g(not)g(need)f(to)h(b)s(e)f(ex-)0
-2619 y(plicitly)f(de\014ned)h(in)h(the)g(template)h(b)s(ecause)g(their)
-f(v)-5 b(alues)37 b(can)h(b)s(e)f(inferred)e(from)j(the)f(other)h(k)m
-(eyw)m(ords)g(in)0 2732 y(the)d(template.)54 b(This)33
-b(example)i(also)g(illustrates)d(that)k(the)f(templates)g(are)g
-(generally)f(case-insensitiv)m(e)g(\(the)0 2845 y(k)m(eyw)m(ord)29
-b(names)g(and)g(TF)m(ORMn)f(v)-5 b(alues)29 b(are)g(con)m(v)m(erted)i
-(to)e(upp)s(er-case)g(in)e(the)i(FITS)g(\014le\))f(and)g(that)i(string)
-0 2958 y(k)m(eyw)m(ord)h(v)-5 b(alues)30 b(generally)f(do)h(not)h(need)
-f(to)h(b)s(e)f(enclosed)g(in)f(quotes.)0 3293 y Fb(4.2.5)112
-b(HDU)38 b(Lo)s(cation)f(Sp)s(eci\014cation)0 3521 y
-Fi(The)k(optional)f(HDU)j(lo)s(cation)e(sp)s(eci\014er)e(de\014nes)i
-(whic)m(h)f(HDU)i(\(Header-Data)i(Unit,)g(also)d(kno)m(wn)g(as)h(an)0
-3634 y(`extension'\))35 b(within)c(the)k(FITS)e(\014le)g(to)i
-(initially)c(op)s(en.)51 b(It)34 b(m)m(ust)g(immediately)f(follo)m(w)g
-(the)h(base)h(\014le)e(name)0 3747 y(\(or)h(the)g(output)g(\014le)f
+4059 y Fd(4.6)135 b(HDU)46 b(Lo)t(cation)f(Sp)t(eci\014cation)0
+4312 y Fi(The)c(optional)f(HDU)j(lo)s(cation)e(sp)s(eci\014er)e
+(de\014nes)i(whic)m(h)f(HDU)i(\(Header-Data)i(Unit,)g(also)d(kno)m(wn)g
+(as)h(an)0 4425 y(`extension'\))35 b(within)c(the)k(FITS)e(\014le)g(to)
+i(initially)c(op)s(en.)51 b(It)34 b(m)m(ust)g(immediately)f(follo)m(w)g
+(the)h(base)h(\014le)e(name)0 4538 y(\(or)h(the)g(output)g(\014le)f
 (name)g(if)g(presen)m(t\).)52 b(If)33 b(it)g(is)g(not)h(sp)s(eci\014ed)
 f(then)g(the)h(\014rst)f(HDU)i(\(the)f(primary)e(arra)m(y\))0
-3860 y(is)g(op)s(ened.)46 b(The)32 b(HDU)h(lo)s(cation)f(sp)s
+4650 y(is)g(op)s(ened.)46 b(The)32 b(HDU)h(lo)s(cation)f(sp)s
 (eci\014er)f(is)h(required)f(if)g(the)i(colFilter,)f(ro)m(wFilter,)h
-(or)g(binSp)s(ec)d(sp)s(eci\014ers)0 3973 y(are)g(presen)m(t,)f(b)s
+(or)g(binSp)s(ec)d(sp)s(eci\014ers)0 4763 y(are)g(presen)m(t,)f(b)s
 (ecause)h(the)f(primary)e(arra)m(y)j(is)e(not)i(a)f(v)-5
 b(alid)28 b(HDU)i(for)f(these)g(op)s(erations.)40 b(The)29
-b(HDU)h(ma)m(y)g(b)s(e)0 4086 y(sp)s(eci\014ed)d(either)i(b)m(y)f
+b(HDU)h(ma)m(y)g(b)s(e)0 4876 y(sp)s(eci\014ed)d(either)i(b)m(y)f
 (absolute)h(p)s(osition)e(n)m(um)m(b)s(er,)h(starting)h(with)e(0)j(for)
 e(the)h(primary)e(arra)m(y)-8 b(,)31 b(or)e(b)m(y)f(reference)0
-4199 y(to)h(the)g(HDU)g(name,)g(and)f(optionally)-8 b(,)28
+4989 y(to)h(the)g(HDU)g(name,)g(and)f(optionally)-8 b(,)28
 b(the)h(v)m(ersion)f(n)m(um)m(b)s(er)f(and)h(the)h(HDU)g(t)m(yp)s(e)g
-(of)f(the)h(desired)e(extension.)0 4312 y(The)32 b(lo)s(cation)f(of)h
+(of)f(the)h(desired)e(extension.)0 5102 y(The)32 b(lo)s(cation)f(of)h
 (an)g(image)h(within)c(a)k(single)d(cell)i(of)g(a)g(binary)f(table)h
 (ma)m(y)g(also)g(b)s(e)g(sp)s(eci\014ed,)f(as)h(describ)s(ed)0
-4425 y(b)s(elo)m(w.)0 4585 y(The)26 b(absolute)g(p)s(osition)e(of)i
+5215 y(b)s(elo)m(w.)0 5375 y(The)26 b(absolute)g(p)s(osition)e(of)i
 (the)h(extension)f(is)f(sp)s(eci\014ed)f(either)i(b)m(y)g(enclosed)g
 (the)h(n)m(um)m(b)s(er)e(in)g(square)g(brac)m(k)m(ets)0
-4698 y(\(e.g.,)k(`[1]')g(=)d(the)h(\014rst)f(extension)g(follo)m(wing)g
+5488 y(\(e.g.,)k(`[1]')g(=)d(the)h(\014rst)f(extension)g(follo)m(wing)g
 (the)h(primary)d(arra)m(y\))k(or)f(b)m(y)f(preceded)h(the)g(n)m(um)m(b)
-s(er)e(with)h(a)h(plus)0 4811 y(sign)36 b(\(`+1'\).)63
+s(er)e(with)h(a)h(plus)0 5601 y(sign)36 b(\(`+1'\).)63
 b(T)-8 b(o)38 b(sp)s(ecify)e(the)h(HDU)h(b)m(y)g(name,)h(giv)m(e)f(the)
 f(name)h(of)f(the)h(desired)e(HDU)i(\(the)f(v)-5 b(alue)37
-b(of)h(the)0 4924 y(EXTNAME)e(or)g(HDUNAME)h(k)m(eyw)m(ord\))g(and)f
+b(of)h(the)0 5714 y(EXTNAME)e(or)g(HDUNAME)h(k)m(eyw)m(ord\))g(and)f
 (optionally)e(the)i(extension)g(v)m(ersion)f(n)m(um)m(b)s(er)g(\(v)-5
-b(alue)36 b(of)g(the)0 5036 y(EXTVER)27 b(k)m(eyw)m(ord\))i(and)e(the)h
-(extension)g(t)m(yp)s(e)f(\(v)-5 b(alue)28 b(of)g(the)g(XTENSION)f(k)m
-(eyw)m(ord:)40 b(IMA)m(GE,)29 b(ASCI)s(I)d(or)0 5149
-y(T)-8 b(ABLE,)36 b(or)f(BINT)-8 b(ABLE\),)36 b(separated)f(b)m(y)g
-(commas)h(and)e(all)g(enclosed)h(in)f(square)h(brac)m(k)m(ets.)56
-b(If)34 b(the)h(v)-5 b(alue)0 5262 y(of)34 b(EXTVER)f(and)f(XTENSION)h
-(are)h(not)f(sp)s(eci\014ed,)g(then)g(the)h(\014rst)e(extension)i(with)
-e(the)h(correct)i(v)-5 b(alue)33 b(of)0 5375 y(EXTNAME)39
-b(is)f(op)s(ened.)67 b(The)38 b(extension)h(name)g(and)f(t)m(yp)s(e)i
-(are)f(not)h(case)g(sensitiv)m(e,)h(and)d(the)h(extension)0
-5488 y(t)m(yp)s(e)29 b(ma)m(y)g(b)s(e)f(abbreviated)g(to)h(a)g(single)e
-(letter)i(\(e.g.,)i(I)d(=)g(IMA)m(GE)i(extension)e(or)g(primary)f(arra)
-m(y)-8 b(,)30 b(A)f(or)f(T)g(=)0 5601 y(ASCI)s(I)d(table)h(extension,)h
-(and)f(B)h(=)f(binary)f(table)h(BINT)-8 b(ABLE)27 b(extension\).)40
+b(alue)36 b(of)g(the)p eop
+%%Page: 25 31
+25 30 bop 0 299 a Fg(4.7.)72 b(IMA)m(GE)31 b(SECTION)2835
+b Fi(25)0 555 y(EXTVER)27 b(k)m(eyw)m(ord\))i(and)e(the)h(extension)g
+(t)m(yp)s(e)f(\(v)-5 b(alue)28 b(of)g(the)g(XTENSION)f(k)m(eyw)m(ord:)
+40 b(IMA)m(GE,)29 b(ASCI)s(I)d(or)0 668 y(T)-8 b(ABLE,)36
+b(or)f(BINT)-8 b(ABLE\),)36 b(separated)f(b)m(y)g(commas)h(and)e(all)g
+(enclosed)h(in)f(square)h(brac)m(k)m(ets.)56 b(If)34
+b(the)h(v)-5 b(alue)0 781 y(of)34 b(EXTVER)f(and)f(XTENSION)h(are)h
+(not)f(sp)s(eci\014ed,)g(then)g(the)h(\014rst)e(extension)i(with)e(the)
+h(correct)i(v)-5 b(alue)33 b(of)0 894 y(EXTNAME)39 b(is)f(op)s(ened.)67
+b(The)38 b(extension)h(name)g(and)f(t)m(yp)s(e)i(are)f(not)h(case)g
+(sensitiv)m(e,)h(and)d(the)h(extension)0 1007 y(t)m(yp)s(e)29
+b(ma)m(y)g(b)s(e)f(abbreviated)g(to)h(a)g(single)e(letter)i(\(e.g.,)i
+(I)d(=)g(IMA)m(GE)i(extension)e(or)g(primary)f(arra)m(y)-8
+b(,)30 b(A)f(or)f(T)g(=)0 1120 y(ASCI)s(I)d(table)h(extension,)h(and)f
+(B)h(=)f(binary)f(table)h(BINT)-8 b(ABLE)27 b(extension\).)40
 b(If)26 b(the)g(HDU)h(lo)s(cation)g(sp)s(eci\014er)0
-5714 y(is)i(equal)h(to)h(`[PRIMAR)-8 b(Y]')32 b(or)f(`[P]',)g(then)f
+1233 y(is)i(equal)h(to)h(`[PRIMAR)-8 b(Y]')32 b(or)f(`[P]',)g(then)f
 (the)h(primary)d(arra)m(y)j(\(the)g(\014rst)f(HDU\))h(will)d(b)s(e)i
-(op)s(ened.)p eop
+(op)s(ened.)0 1393 y(FITS)k(images)h(are)g(most)h(commonly)e(stored)h
+(in)f(the)h(primary)e(arra)m(y)i(or)g(an)g(image)g(extension,)h(but)e
+(images)0 1506 y(can)d(also)g(b)s(e)f(stored)h(as)h(a)f(v)m(ector)h(in)
+e(a)h(single)f(cell)g(of)h(a)h(binary)d(table)i(\(i.e.)42
+b(eac)m(h)32 b(ro)m(w)f(of)g(the)h(v)m(ector)g(column)0
+1619 y(con)m(tains)c(a)h(di\013eren)m(t)e(image\).)41
+b(Suc)m(h)27 b(an)h(image)h(can)f(b)s(e)g(op)s(ened)f(with)g(CFITSIO)f
+(b)m(y)i(sp)s(ecifying)e(the)i(desired)0 1732 y(column)j(name)h(and)f
+(the)h(ro)m(w)g(n)m(um)m(b)s(er)f(after)h(the)g(binary)e(table)i(HDU)h
+(sp)s(eci\014er)d(as)i(sho)m(wn)g(in)e(the)i(follo)m(wing)0
+1844 y(examples.)70 b(The)40 b(column)f(name)i(is)e(separated)i(from)f
+(the)h(HDU)g(sp)s(eci\014er)e(b)m(y)h(a)h(semicolon)e(and)h(the)h(ro)m
+(w)0 1957 y(n)m(um)m(b)s(er)29 b(is)g(enclosed)h(in)e(paren)m(theses.)
+41 b(In)30 b(this)f(case)i(CFITSIO)d(copies)i(the)g(image)h(from)e(the)
+i(table)f(cell)f(in)m(to)0 2070 y(a)j(temp)s(orary)e(primary)g(arra)m
+(y)h(b)s(efore)g(it)g(is)f(op)s(ened.)43 b(The)30 b(application)g
+(program)h(then)g(just)g(sees)g(the)h(image)0 2183 y(in)h(the)i
+(primary)d(arra)m(y)-8 b(,)37 b(without)c(an)m(y)i(extensions.)52
+b(The)34 b(particular)e(ro)m(w)j(to)g(b)s(e)e(op)s(ened)h(ma)m(y)h(b)s
+(e)f(sp)s(eci\014ed)0 2296 y(either)27 b(b)m(y)g(giving)f(an)h
+(absolute)g(in)m(teger)h(ro)m(w)g(n)m(um)m(b)s(er)e(\(starting)h(with)f
+(1)i(for)f(the)g(\014rst)g(ro)m(w\),)i(or)e(b)m(y)g(sp)s(ecifying)0
+2409 y(a)33 b(b)s(o)s(olean)e(expression)g(that)i(ev)-5
+b(aluates)33 b(to)g(TR)m(UE)g(for)f(the)g(desired)f(ro)m(w.)47
+b(The)32 b(\014rst)f(ro)m(w)i(that)g(satis\014es)f(the)0
+2522 y(expression)27 b(will)e(b)s(e)j(used.)39 b(The)28
+b(ro)m(w)g(selection)g(expression)f(has)h(the)g(same)g(syn)m(tax)h(as)f
+(describ)s(ed)e(in)h(the)h(Ro)m(w)0 2635 y(Filter)i(Sp)s(eci\014er)e
+(section,)j(b)s(elo)m(w.)0 2795 y(Examples:)143 3051
+y Fe(myfile.fits[3])44 b(-)k(open)e(the)h(3rd)g(HDU)g(following)e(the)i
+(primary)f(array)143 3164 y(myfile.fits+3)92 b(-)48 b(same)e(as)h
+(above,)f(but)h(using)g(the)g(FTOOLS-style)d(notation)143
+3277 y(myfile.fits[EVENTS])f(-)k(open)g(the)g(extension)e(that)i(has)g
+(EXTNAME)e(=)j('EVENTS')143 3390 y(myfile.fits[EVENTS,)43
+b(2])95 b(-)47 b(same)g(as)g(above,)f(but)h(also)g(requires)e(EXTVER)h
+(=)i(2)143 3503 y(myfile.fits[events,2,b])42 b(-)47 b(same,)f(but)h
+(also)g(requires)f(XTENSION)f(=)j('BINTABLE')143 3616
+y(myfile.fits[3;)c(images\(17\)])h(-)i(opens)g(the)g(image)f(in)h(row)g
+(17)g(of)g(the)g('images')1527 3728 y(column)f(in)i(the)e(3rd)h
+(extension)f(of)h(the)g(file.)143 3841 y(myfile.fits[3;)d
+(images\(exposure)g(>)j(100\)])g(-)g(as)g(above,)f(but)h(opens)g(the)f
+(image)907 3954 y(in)h(the)g(first)f(row)h(that)g(has)g(an)g
+('exposure')e(column)h(value)907 4067 y(greater)g(than)g(100.)0
+4400 y Fd(4.7)135 b(Image)46 b(Section)0 4650 y Fi(A)41
+b(virtual)e(\014le)g(con)m(taining)h(a)h(rectangular)g(subsection)e(of)
+i(an)g(image)f(can)h(b)s(e)f(extracted)i(and)e(op)s(ened)g(b)m(y)0
+4763 y(sp)s(ecifying)30 b(the)j(range)g(of)g(pixels)e(\(start:end\))i
+(along)g(eac)m(h)h(axis)e(to)h(b)s(e)f(extracted)i(from)e(the)h
+(original)d(image.)0 4876 y(One)g(can)h(also)g(sp)s(ecify)e(an)i
+(optional)f(pixel)f(incremen)m(t)h(\(start:end:step\))i(for)f(eac)m(h)h
+(axis)e(of)h(the)g(input)d(image.)0 4989 y(A)g(pixel)d(step)j(=)f(1)h
+(will)d(b)s(e)i(assumed)f(if)h(it)g(is)f(not)i(sp)s(eci\014ed.)38
+b(If)27 b(the)h(start)g(pixel)e(is)g(larger)i(then)f(the)h(end)e
+(pixel,)0 5102 y(then)32 b(the)g(image)g(will)d(b)s(e)i(\015ipp)s(ed)e
+(\(pro)s(ducing)h(a)i(mirror)f(image\))h(along)g(that)g(dimension.)43
+b(An)32 b(asterisk,)g('*',)0 5215 y(ma)m(y)39 b(b)s(e)e(used)h(to)h(sp)
+s(ecify)e(the)h(en)m(tire)g(range)h(of)f(an)h(axis,)h(and)d('-*')j
+(will)35 b(\015ip)i(the)h(en)m(tire)g(axis.)64 b(The)38
+b(input)0 5328 y(image)30 b(can)g(b)s(e)f(in)f(the)i(primary)e(arra)m
+(y)-8 b(,)31 b(in)d(an)h(image)h(extension,)g(or)g(con)m(tained)f(in)g
+(a)h(v)m(ector)h(cell)e(of)h(a)g(binary)0 5441 y(table.)39
+b(In)25 b(the)h(later)g(2)g(cases)h(the)f(extension)g(name)g(or)f(n)m
+(um)m(b)s(er)g(m)m(ust)h(b)s(e)f(sp)s(eci\014ed)f(b)s(efore)i(the)g
+(image)g(section)0 5554 y(sp)s(eci\014er.)0 5714 y(Examples:)p
+eop
 %%Page: 26 32
 26 31 bop 0 299 a Fi(26)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(FITS)34
-b(images)h(are)g(most)h(commonly)e(stored)h(in)f(the)h(primary)e(arra)m
-(y)i(or)g(an)g(image)g(extension,)h(but)e(images)0 668
-y(can)d(also)g(b)s(e)f(stored)h(as)h(a)f(v)m(ector)h(in)e(a)h(single)f
-(cell)g(of)h(a)h(binary)d(table)i(\(i.e.)42 b(eac)m(h)32
-b(ro)m(w)f(of)g(the)h(v)m(ector)g(column)0 781 y(con)m(tains)c(a)h
-(di\013eren)m(t)e(image\).)41 b(Suc)m(h)27 b(an)h(image)h(can)f(b)s(e)g
-(op)s(ened)f(with)g(CFITSIO)f(b)m(y)i(sp)s(ecifying)e(the)i(desired)0
-894 y(column)j(name)h(and)f(the)h(ro)m(w)g(n)m(um)m(b)s(er)f(after)h
-(the)g(binary)e(table)i(HDU)h(sp)s(eci\014er)d(as)i(sho)m(wn)g(in)e
-(the)i(follo)m(wing)0 1007 y(examples.)70 b(The)40 b(column)f(name)i
-(is)e(separated)i(from)f(the)h(HDU)g(sp)s(eci\014er)e(b)m(y)h(a)h
-(semicolon)e(and)h(the)h(ro)m(w)0 1120 y(n)m(um)m(b)s(er)29
-b(is)g(enclosed)h(in)e(paren)m(theses.)41 b(In)30 b(this)f(case)i
-(CFITSIO)d(copies)i(the)g(image)h(from)e(the)i(table)f(cell)f(in)m(to)0
-1233 y(a)j(temp)s(orary)e(primary)g(arra)m(y)h(b)s(efore)g(it)g(is)f
-(op)s(ened.)43 b(The)30 b(application)g(program)h(then)g(just)g(sees)g
-(the)h(image)0 1346 y(in)h(the)i(primary)d(arra)m(y)-8
-b(,)37 b(without)c(an)m(y)i(extensions.)52 b(The)34 b(particular)e(ro)m
-(w)j(to)g(b)s(e)e(op)s(ened)h(ma)m(y)h(b)s(e)f(sp)s(eci\014ed)0
-1458 y(either)27 b(b)m(y)g(giving)f(an)h(absolute)g(in)m(teger)h(ro)m
-(w)g(n)m(um)m(b)s(er)e(\(starting)h(with)f(1)i(for)f(the)g(\014rst)g
-(ro)m(w\),)i(or)e(b)m(y)g(sp)s(ecifying)0 1571 y(a)33
-b(b)s(o)s(olean)e(expression)g(that)i(ev)-5 b(aluates)33
-b(to)g(TR)m(UE)g(for)f(the)g(desired)f(ro)m(w.)47 b(The)32
-b(\014rst)f(ro)m(w)i(that)g(satis\014es)f(the)0 1684
-y(expression)27 b(will)e(b)s(e)j(used.)39 b(The)28 b(ro)m(w)g
-(selection)g(expression)f(has)h(the)g(same)g(syn)m(tax)h(as)f(describ)s
-(ed)e(in)h(the)h(Ro)m(w)0 1797 y(Filter)i(Sp)s(eci\014er)e(section,)j
-(b)s(elo)m(w.)0 1957 y(Examples:)143 2203 y Fe(myfile.fits[3])44
-b(-)k(open)e(the)h(3rd)g(HDU)g(following)e(the)i(primary)f(array)143
-2316 y(myfile.fits+3)92 b(-)48 b(same)e(as)h(above,)f(but)h(using)g
-(the)g(FTOOLS-style)d(notation)143 2429 y(myfile.fits[EVENTS])f(-)k
-(open)g(the)g(extension)e(that)i(has)g(EXTNAME)e(=)j('EVENTS')143
-2542 y(myfile.fits[EVENTS,)43 b(2])95 b(-)47 b(same)g(as)g(above,)f
-(but)h(also)g(requires)e(EXTVER)h(=)i(2)143 2655 y
-(myfile.fits[events,2,b])42 b(-)47 b(same,)f(but)h(also)g(requires)f
-(XTENSION)f(=)j('BINTABLE')143 2768 y(myfile.fits[3;)c(images\(17\)])h
-(-)i(opens)g(the)g(image)f(in)h(row)g(17)g(of)g(the)g('images')1527
-2881 y(column)f(in)i(the)e(3rd)h(extension)f(of)h(the)g(file.)143
-2994 y(myfile.fits[3;)d(images\(exposure)g(>)j(100\)])g(-)g(as)g
-(above,)f(but)h(opens)g(the)f(image)907 3107 y(in)h(the)g(first)f(row)h
-(that)g(has)g(an)g('exposure')e(column)h(value)907 3220
-y(greater)g(than)g(100.)0 3508 y Fb(4.2.6)112 b(age)38
-b(Section)0 3727 y Fi(A)j(virtual)e(\014le)g(con)m(taining)h(a)h
-(rectangular)g(subsection)e(of)i(an)g(image)f(can)h(b)s(e)f(extracted)i
-(and)e(op)s(ened)g(b)m(y)0 3840 y(sp)s(ecifying)30 b(the)j(range)g(of)g
-(pixels)e(\(start:end\))i(along)g(eac)m(h)h(axis)e(to)h(b)s(e)f
-(extracted)i(from)e(the)h(original)d(image.)0 3953 y(One)g(can)h(also)g
-(sp)s(ecify)e(an)i(optional)f(pixel)f(incremen)m(t)h
-(\(start:end:step\))i(for)f(eac)m(h)h(axis)e(of)h(the)g(input)d(image.)
-0 4066 y(A)g(pixel)d(step)j(=)f(1)h(will)d(b)s(e)i(assumed)f(if)h(it)g
-(is)f(not)i(sp)s(eci\014ed.)38 b(If)27 b(the)h(start)g(pixel)e(is)g
-(larger)i(then)f(the)h(end)e(pixel,)0 4179 y(then)32
-b(the)g(image)g(will)d(b)s(e)i(\015ipp)s(ed)e(\(pro)s(ducing)h(a)i
-(mirror)f(image\))h(along)g(that)g(dimension.)43 b(An)32
-b(asterisk,)g('*',)0 4292 y(ma)m(y)39 b(b)s(e)e(used)h(to)h(sp)s(ecify)
-e(the)h(en)m(tire)g(range)h(of)f(an)h(axis,)h(and)d('-*')j(will)35
-b(\015ip)i(the)h(en)m(tire)g(axis.)64 b(The)38 b(input)0
-4404 y(image)30 b(can)g(b)s(e)f(in)f(the)i(primary)e(arra)m(y)-8
-b(,)31 b(in)d(an)h(image)h(extension,)g(or)g(con)m(tained)f(in)g(a)h(v)
-m(ector)h(cell)e(of)h(a)g(binary)0 4517 y(table.)39 b(In)25
-b(the)h(later)g(2)g(cases)h(the)f(extension)g(name)g(or)f(n)m(um)m(b)s
-(er)g(m)m(ust)h(b)s(e)f(sp)s(eci\014ed)f(b)s(efore)i(the)g(image)g
-(section)0 4630 y(sp)s(eci\014er.)0 4790 y(Examples:)95
-5036 y Fe(myfile.fits[1:512:2,)43 b(2:512:2])i(-)95 b(open)47
-b(a)h(256x256)d(pixel)i(image)668 5149 y(consisting)e(of)i(the)g(odd)g
-(numbered)f(columns)g(\(1st)g(axis\))h(and)668 5262 y(the)g(even)g
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)95 555 y Fe
+(myfile.fits[1:512:2,)43 b(2:512:2])i(-)95 b(open)47
+b(a)h(256x256)d(pixel)i(image)668 668 y(consisting)e(of)i(the)g(odd)g
+(numbered)f(columns)g(\(1st)g(axis\))h(and)668 781 y(the)g(even)g
 (numbered)e(rows)i(\(2nd)g(axis\))f(of)h(the)g(image)f(in)i(the)668
-5375 y(primary)e(array)g(of)i(the)e(file.)95 5601 y(myfile.fits[*,)e
+894 y(primary)e(array)g(of)i(the)e(file.)95 1120 y(myfile.fits[*,)e
 (512:256])i(-)h(open)g(an)g(image)g(consisting)e(of)i(all)g(the)g
-(columns)668 5714 y(in)g(the)g(input)g(image,)f(but)h(only)f(rows)h
-(256)g(through)f(512.)p eop
-%%Page: 27 33
-27 32 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(27)668 555 y Fe(The)47 b(image)f(will)h(be)g(flipped)f
-(along)g(the)h(2nd)g(axis)g(since)668 668 y(the)g(starting)f(pixel)g
-(is)h(greater)f(than)h(the)g(ending)f(pixel.)95 894 y(myfile.fits[*:2,)
-e(512:256:2])h(-)i(same)g(as)g(above)f(but)h(keeping)f(only)668
-1007 y(every)h(other)f(row)h(and)g(column)f(in)h(the)g(input)f(image.)
-95 1233 y(myfile.fits[-*,)e(*])j(-)h(copy)e(the)h(entire)f(image,)g
-(flipping)g(it)h(along)668 1346 y(the)g(first)f(axis.)95
-1571 y(myfile.fits[3][1:256,1:256)o(])c(-)47 b(opens)g(a)g(subsection)e
-(of)i(the)g(image)g(that)668 1684 y(is)g(in)h(the)e(3rd)h(extension)f
-(of)h(the)g(file.)95 1910 y(myfile.fits[4;)d(images\(12\)][1:10,1:10])e
-(-)48 b(open)e(an)h(image)g(consisting)286 2023 y(of)h(the)e(first)h
-(10)g(pixels)f(in)h(both)g(dimensions.)e(The)i(original)286
-2136 y(image)g(resides)f(in)h(the)g(12th)f(row)h(of)g(the)g('images')f
-(vector)286 2249 y(column)g(in)i(the)f(table)f(in)h(the)g(4th)g
-(extension)e(of)i(the)g(file.)0 2486 y Fi(When)23 b(CFITSIO)f(op)s(ens)
+(columns)668 1233 y(in)g(the)g(input)g(image,)f(but)h(only)f(rows)h
+(256)g(through)f(512.)668 1346 y(The)h(image)f(will)h(be)g(flipped)f
+(along)g(the)h(2nd)g(axis)g(since)668 1458 y(the)g(starting)f(pixel)g
+(is)h(greater)f(than)h(the)g(ending)f(pixel.)95 1684
+y(myfile.fits[*:2,)e(512:256:2])h(-)i(same)g(as)g(above)f(but)h
+(keeping)f(only)668 1797 y(every)h(other)f(row)h(and)g(column)f(in)h
+(the)g(input)f(image.)95 2023 y(myfile.fits[-*,)e(*])j(-)h(copy)e(the)h
+(entire)f(image,)g(flipping)g(it)h(along)668 2136 y(the)g(first)f
+(axis.)95 2362 y(myfile.fits[3][1:256,1:256)o(])c(-)47
+b(opens)g(a)g(subsection)e(of)i(the)g(image)g(that)668
+2475 y(is)g(in)h(the)e(3rd)h(extension)f(of)h(the)g(file.)95
+2700 y(myfile.fits[4;)d(images\(12\)][1:10,1:10])e(-)48
+b(open)e(an)h(image)g(consisting)286 2813 y(of)h(the)e(first)h(10)g
+(pixels)f(in)h(both)g(dimensions.)e(The)i(original)286
+2926 y(image)g(resides)f(in)h(the)g(12th)f(row)h(of)g(the)g('images')f
+(vector)286 3039 y(column)g(in)i(the)f(table)f(in)h(the)g(4th)g
+(extension)e(of)i(the)g(file.)0 3336 y Fi(When)23 b(CFITSIO)f(op)s(ens)
 h(an)g(image)g(section)h(it)f(\014rst)g(creates)h(a)g(temp)s(orary)f
-(\014le)g(con)m(taining)g(the)g(image)h(section)0 2599
+(\014le)g(con)m(taining)g(the)g(image)h(section)0 3449
 y(plus)31 b(a)j(cop)m(y)g(of)g(an)m(y)g(other)f(HDUs)h(in)e(the)i
 (\014le.)49 b(This)31 b(temp)s(orary)i(\014le)g(is)f(then)h(op)s(ened)g
-(b)m(y)g(the)h(application)0 2711 y(program,)28 b(so)g(it)f(is)f(not)i
+(b)m(y)g(the)h(application)0 3562 y(program,)28 b(so)g(it)f(is)f(not)i
 (p)s(ossible)d(to)j(write)f(to)h(or)g(mo)s(dify)e(the)h(input)f(\014le)
-g(when)h(sp)s(ecifying)e(an)j(image)g(section.)0 2824
+g(when)h(sp)s(ecifying)e(an)j(image)g(section.)0 3675
 y(Note)39 b(that)f(CFITSIO)e(automatically)h(up)s(dates)g(the)g(w)m
 (orld)g(co)s(ordinate)g(system)h(k)m(eyw)m(ords)f(in)f(the)i(header)0
-2937 y(of)33 b(the)h(image)f(section,)h(if)e(they)i(exist,)g(so)f(that)
+3788 y(of)33 b(the)h(image)f(section,)h(if)e(they)i(exist,)g(so)f(that)
 h(the)f(co)s(ordinate)g(asso)s(ciated)h(with)e(eac)m(h)i(pixel)d(in)h
-(the)i(image)0 3050 y(section)d(will)c(b)s(e)j(computed)g(correctly)-8
-b(.)0 3337 y Fb(4.2.7)112 b(Column)37 b(and)h(Keyw)m(ord)g(Filtering)d
-(Sp)s(eci\014cation)0 3556 y Fi(The)27 b(optional)g(column/k)m(eyw)m
+(the)i(image)0 3901 y(section)d(will)c(b)s(e)j(computed)g(correctly)-8
+b(.)0 4279 y Fd(4.8)135 b(Column)45 b(and)g(Keyw)l(ord)h(Filtering)g
+(Sp)t(eci\014cation)0 4538 y Fi(The)27 b(optional)g(column/k)m(eyw)m
 (ord)h(\014ltering)e(sp)s(eci\014er)g(is)h(used)g(to)i(mo)s(dify)d(the)
-i(column)f(structure)g(and/or)h(the)0 3669 y(header)38
+i(column)f(structure)g(and/or)h(the)0 4650 y(header)38
 b(k)m(eyw)m(ords)h(in)e(the)i(HDU)g(that)h(w)m(as)f(selected)g(with)e
 (the)i(previous)e(HDU)i(lo)s(cation)f(sp)s(eci\014er.)64
-b(This)0 3782 y(\014ltering)40 b(sp)s(eci\014er)g(m)m(ust)i(b)s(e)f
+b(This)0 4763 y(\014ltering)40 b(sp)s(eci\014er)g(m)m(ust)i(b)s(e)f
 (enclosed)h(in)e(square)i(brac)m(k)m(ets)h(and)e(can)h(b)s(e)f
-(distinguished)d(from)k(a)g(general)0 3895 y(ro)m(w)d(\014lter)f(sp)s
+(distinguished)d(from)k(a)g(general)0 4876 y(ro)m(w)d(\014lter)f(sp)s
 (eci\014er)f(\(describ)s(ed)g(b)s(elo)m(w\))h(b)m(y)h(the)g(fact)h
 (that)f(it)f(b)s(egins)f(with)h(the)h(string)f('col)h(')g(and)f(is)g
-(not)0 4008 y(immediately)27 b(follo)m(w)m(ed)h(b)m(y)g(an)g(equals)g
+(not)0 4989 y(immediately)27 b(follo)m(w)m(ed)h(b)m(y)g(an)g(equals)g
 (sign.)39 b(The)28 b(original)e(\014le)h(is)h(not)g(c)m(hanged)h(b)m(y)
-f(this)g(\014ltering)e(op)s(eration,)0 4121 y(and)40
+f(this)g(\014ltering)e(op)s(eration,)0 5102 y(and)40
 b(instead)g(the)h(mo)s(di\014cations)e(are)i(made)f(on)h(a)g(cop)m(y)g
 (of)g(the)g(input)e(FITS)h(\014le)f(\(usually)g(in)g(memory\),)0
-4234 y(whic)m(h)32 b(also)h(con)m(tains)g(a)g(cop)m(y)h(of)f(all)f(the)
+5215 y(whic)m(h)32 b(also)h(con)m(tains)g(a)g(cop)m(y)h(of)f(all)f(the)
 i(other)f(HDUs)h(in)d(the)i(\014le.)48 b(This)32 b(temp)s(orary)g
-(\014le)g(is)g(passed)h(to)h(the)0 4347 y(application)c(program)i(and)f
+(\014le)g(is)g(passed)h(to)h(the)0 5328 y(application)c(program)i(and)f
 (will)e(p)s(ersist)h(only)h(un)m(til)f(the)i(\014le)f(is)g(closed)h(or)
-g(un)m(til)e(the)i(program)f(exits,)i(unless)0 4459 y(the)e(out\014le)e
+g(un)m(til)e(the)i(program)f(exits,)i(unless)0 5441 y(the)e(out\014le)e
 (sp)s(eci\014er)g(\(see)i(ab)s(o)m(v)m(e\))h(is)e(also)g(supplied.)0
-4620 y(The)h(column/k)m(eyw)m(ord)g(\014lter)f(can)h(b)s(e)g(used)f(to)
+5601 y(The)h(column/k)m(eyw)m(ord)g(\014lter)f(can)h(b)s(e)g(used)f(to)
 i(p)s(erform)e(the)i(follo)m(wing)d(op)s(erations.)43
-b(More)32 b(than)f(one)g(op)s(er-)0 4733 y(ation)f(ma)m(y)h(b)s(e)f(sp)
-s(eci\014ed)f(b)m(y)h(separating)g(them)g(with)g(semi-colons.)136
-4969 y Fc(\017)46 b Fi(Delete)32 b(a)f(column)e(or)h(k)m(eyw)m(ord)h(b)
-m(y)g(listing)d(the)i(name)h(preceeded)f(b)m(y)h(an)f(exclamation)h
-(mark)f(\(!\),)h(e.g.,)227 5082 y(')10 b(!TIME')32 b(will)d(delete)i
-(the)h(TIME)f(column)f(if)g(it)h(exists,)h(otherwise)e(the)i(TIME)f(k)m
-(eyw)m(ord.)44 b(An)31 b(error)g(is)227 5195 y(returned)h(if)f(neither)
-g(a)i(column)f(nor)g(k)m(eyw)m(ord)g(with)g(this)f(name)i(exists.)46
-b(Note)34 b(that)f(the)g(exclamation)227 5308 y(p)s(oin)m(t,)25
-b(')10 b(!',)26 b(is)d(a)h(sp)s(ecial)e(UNIX)i(c)m(haracter,)j(so)e(if)
-d(it)i(is)f(used)g(on)g(the)h(command)g(line)e(rather)i(than)f(en)m
-(tered)227 5421 y(at)31 b(a)g(task)g(prompt,)f(it)g(m)m(ust)g(b)s(e)g
-(preceded)g(b)m(y)g(a)h(bac)m(kslash)f(to)h(force)g(the)f(UNIX)h(shell)
-e(to)i(ignore)f(it.)136 5601 y Fc(\017)46 b Fi(Rename)29
-b(an)g(existing)e(column)g(or)i(k)m(eyw)m(ord)g(with)e(the)i(syn)m(tax)
-g('NewName)h(==)e(OldName'.)39 b(An)28 b(error)227 5714
-y(is)i(returned)f(if)g(neither)h(a)g(column)f(nor)h(k)m(eyw)m(ord)h
-(with)e(this)h(name)g(exists.)p eop
-%%Page: 28 34
-28 33 bop 0 299 a Fi(28)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)136 555 y
-Fc(\017)46 b Fi(App)s(end)37 b(a)j(new)f(column)e(or)j(k)m(eyw)m(ord)f
-(to)h(the)f(table.)67 b(T)-8 b(o)40 b(create)g(a)g(column,)g(giv)m(e)g
-(the)f(new)g(name,)227 668 y(optionally)34 b(follo)m(w)m(ed)h(b)m(y)g
-(the)g(datat)m(yp)s(e)h(in)e(paren)m(theses,)j(follo)m(w)m(ed)e(b)m(y)g
-(a)h(single)e(equals)g(sign)g(and)h(an)227 781 y(expression)f(to)i(b)s
-(e)e(used)g(to)i(compute)f(the)g(v)-5 b(alue)34 b(\(e.g.,)k('new)m
+b(More)32 b(than)f(one)g(op)s(er-)0 5714 y(ation)f(ma)m(y)h(b)s(e)f(sp)
+s(eci\014ed)f(b)m(y)h(separating)g(them)g(with)g(semi-colons.)p
+eop
+%%Page: 27 33
+27 32 bop 0 299 a Fg(4.8.)72 b(COLUMN)30 b(AND)h(KEYW)m(ORD)g(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)1120 b Fi(27)136 555
+y Fc(\017)46 b Fi(Cop)m(y)36 b(only)f(a)h(sp)s(eci\014ed)f(list)f(of)i
+(columns)f(columns)f(to)j(the)f(\014ltered)f(input)f(\014le.)56
+b(The)36 b(list)e(of)i(column)227 668 y(name)c(should)e(b)s(e)i
+(separated)g(b)m(y)g(semi-colons.)46 b(Wild)30 b(card)i(c)m(haracters)i
+(ma)m(y)e(b)s(e)g(used)f(in)g(the)h(column)227 781 y(names)37
+b(to)h(matc)m(h)g(m)m(ultiple)d(columns.)60 b(If)37 b(the)g(expression)
+f(con)m(tains)i(b)s(oth)e(a)i(list)d(of)j(columns)e(to)i(b)s(e)227
+894 y(included)f(and)h(columns)g(to)h(b)s(e)g(deleted,)i(then)d(all)g
+(the)h(columns)f(in)g(the)h(original)e(table)i(except)h(the)227
+1007 y(explicitly)28 b(deleted)i(columns)f(will)e(app)s(ear)j(in)f(the)
+h(\014ltered)f(table)h(\(i.e.,)h(there)f(is)g(no)g(need)f(to)i
+(explicitly)227 1120 y(list)e(the)i(columns)e(to)i(b)s(e)f(included)d
+(if)j(an)m(y)g(columns)f(are)i(b)s(eing)e(deleted\).)136
+1295 y Fc(\017)46 b Fi(Delete)31 b(a)e(column)f(or)h(k)m(eyw)m(ord)h(b)
+m(y)f(listing)e(the)i(name)g(preceded)g(b)m(y)g(a)g(min)m(us)f(sign)g
+(or)h(an)g(exclamation)227 1408 y(mark)c(\(!\),)h(e.g.,)i('-TIME')d
+(will)d(delete)j(the)f(TIME)h(column)e(if)g(it)i(exists,)g(otherwise)f
+(the)h(TIME)f(k)m(eyw)m(ord.)227 1520 y(An)35 b(error)f(is)g(returned)f
+(if)h(neither)f(a)j(column)d(nor)h(k)m(eyw)m(ord)h(with)f(this)f(name)i
+(exists.)53 b(Note)36 b(that)g(the)227 1633 y(exclamation)25
+b(p)s(oin)m(t,)h(')10 b(!',)27 b(is)d(a)h(sp)s(ecial)f(UNIX)h(c)m
+(haracter,)j(so)d(if)f(it)h(is)f(used)g(on)h(the)g(command)g(line)e
+(rather)227 1746 y(than)33 b(en)m(tered)h(at)g(a)g(task)g(prompt,)f(it)
+g(m)m(ust)g(b)s(e)g(preceded)g(b)m(y)g(a)h(bac)m(kslash)f(to)h(force)g
+(the)f(UNIX)h(shell)227 1859 y(to)d(ignore)f(it.)136
+2034 y Fc(\017)46 b Fi(Rename)29 b(an)g(existing)e(column)g(or)i(k)m
+(eyw)m(ord)g(with)e(the)i(syn)m(tax)g('NewName)h(==)e(OldName'.)39
+b(An)28 b(error)227 2147 y(is)i(returned)f(if)g(neither)h(a)g(column)f
+(nor)h(k)m(eyw)m(ord)h(with)e(this)h(name)g(exists.)136
+2322 y Fc(\017)46 b Fi(App)s(end)37 b(a)j(new)f(column)e(or)j(k)m(eyw)m
+(ord)f(to)h(the)f(table.)67 b(T)-8 b(o)40 b(create)g(a)g(column,)g(giv)
+m(e)g(the)f(new)g(name,)227 2435 y(optionally)34 b(follo)m(w)m(ed)h(b)m
+(y)g(the)g(datat)m(yp)s(e)h(in)e(paren)m(theses,)j(follo)m(w)m(ed)e(b)m
+(y)g(a)h(single)e(equals)g(sign)g(and)h(an)227 2548 y(expression)f(to)i
+(b)s(e)e(used)g(to)i(compute)f(the)g(v)-5 b(alue)34 b(\(e.g.,)k('new)m
 (col\(1J\))e(=)f(0')g(will)e(create)j(a)f(new)g(32-bit)227
-894 y(in)m(teger)j(column)e(called)h('new)m(col')g(\014lled)f(with)g
+2661 y(in)m(teger)j(column)e(called)h('new)m(col')g(\014lled)f(with)g
 (zeros\).)62 b(The)37 b(datat)m(yp)s(e)h(is)f(sp)s(eci\014ed)e(using)h
-(the)i(same)227 1007 y(syn)m(tax)28 b(that)h(is)d(allo)m(w)m(ed)i(for)f
+(the)i(same)227 2774 y(syn)m(tax)28 b(that)h(is)d(allo)m(w)m(ed)i(for)f
 (the)h(v)-5 b(alue)27 b(of)h(the)g(FITS)f(TF)m(ORMn)g(k)m(eyw)m(ord)h
-(\(e.g.,)i('I',)f('J',)f('E',)g('D',)h(etc.)227 1120
+(\(e.g.,)i('I',)f('J',)f('E',)g('D',)h(etc.)227 2886
 y(for)37 b(binary)e(tables,)k(and)d('I8',)k(F12.3',)h('E20.12',)g(etc.)
 62 b(for)37 b(ASCI)s(I)e(tables\).)61 b(If)37 b(the)g(datat)m(yp)s(e)h
-(is)e(not)227 1233 y(sp)s(eci\014ed)23 b(then)g(an)h(appropriate)g
+(is)e(not)227 2999 y(sp)s(eci\014ed)23 b(then)g(an)h(appropriate)g
 (datat)m(yp)s(e)h(will)c(b)s(e)j(c)m(hosen)g(dep)s(ending)e(on)i(the)g
-(form)g(of)g(the)g(expression)227 1346 y(\(ma)m(y)f(b)s(e)d(a)i(c)m
+(form)g(of)g(the)g(expression)227 3112 y(\(ma)m(y)f(b)s(e)d(a)i(c)m
 (haracter)h(string,)g(logical,)f(bit,)h(long)e(in)m(teger,)j(or)d
 (double)f(column\).)37 b(An)21 b(appropriate)f(v)m(ector)227
-1458 y(coun)m(t)31 b(\(in)f(the)g(case)i(of)e(binary)f(tables\))h(will)
+3225 y(coun)m(t)31 b(\(in)f(the)g(case)i(of)e(binary)f(tables\))h(will)
 e(also)i(b)s(e)g(added)g(if)f(not)i(explicitly)d(sp)s(eci\014ed.)227
-1612 y(When)23 b(creating)h(a)f(new)g(k)m(eyw)m(ord,)i(the)f(k)m(eyw)m
-(ord)f(name)h(m)m(ust)f(b)s(e)f(preceeded)i(b)m(y)f(a)g(p)s(ound)e
-(sign)h('#',)k(and)227 1725 y(the)j(expression)e(m)m(ust)h(ev)-5
+3369 y(When)e(creating)g(a)g(new)f(k)m(eyw)m(ord,)j(the)e(k)m(eyw)m
+(ord)g(name)g(m)m(ust)g(b)s(e)f(preceded)g(b)m(y)h(a)g(p)s(ound)e(sign)
+g('#',)k(and)227 3482 y(the)h(expression)e(m)m(ust)h(ev)-5
 b(aluate)29 b(to)g(a)g(scalar)f(\(i.e.,)h(cannot)g(ha)m(v)m(e)h(a)f
-(column)e(name)h(in)f(the)i(expression\).)227 1838 y(The)j(commen)m(t)i
+(column)e(name)h(in)f(the)i(expression\).)227 3595 y(The)j(commen)m(t)i
 (string)e(for)g(the)h(k)m(eyw)m(ord)h(ma)m(y)f(b)s(e)f(sp)s(eci\014ed)f
 (in)g(paren)m(theses)i(immediately)e(follo)m(wing)227
-1951 y(the)e(k)m(eyw)m(ord)f(name)g(\(instead)g(of)g(supplying)d(a)j
+3708 y(the)e(k)m(eyw)m(ord)f(name)g(\(instead)g(of)g(supplying)d(a)j
 (datat)m(yp)s(e)h(as)g(in)d(the)j(case)g(of)f(creating)g(a)h(new)f
-(column\).)136 2146 y Fc(\017)46 b Fi(Recompute)f(\(o)m(v)m(erwrite\))h
+(column\).)136 3883 y Fc(\017)46 b Fi(Recompute)f(\(o)m(v)m(erwrite\))h
 (the)e(v)-5 b(alues)43 b(in)g(an)h(existing)g(column)f(or)h(k)m(eyw)m
-(ord)g(b)m(y)g(giving)g(the)g(name)227 2259 y(follo)m(w)m(ed)30
+(ord)g(b)m(y)g(giving)g(the)g(name)227 3996 y(follo)m(w)m(ed)30
 b(b)m(y)h(an)f(equals)g(sign)f(and)h(an)g(arithmetic)g(expression.)0
-2527 y(The)d(expression)f(that)i(is)e(used)h(when)f(app)s(ending)f(or)j
-(recom)m(uting)f(columns)f(or)i(k)m(eyw)m(ords)f(can)h(b)s(e)f
-(arbitrarily)0 2639 y(complex)35 b(and)h(ma)m(y)g(b)s(e)f(a)h(function)
+4217 y(The)23 b(expression)f(that)j(is)d(used)h(when)g(app)s(ending)e
+(or)i(recomputing)g(columns)f(or)i(k)m(eyw)m(ords)g(can)g(b)s(e)f
+(arbitrarily)0 4330 y(complex)35 b(and)h(ma)m(y)g(b)s(e)f(a)h(function)
 f(of)h(other)g(header)g(k)m(eyw)m(ord)g(v)-5 b(alues)35
-b(and)g(other)h(columns)f(\(in)g(the)h(same)0 2752 y(ro)m(w\).)63
+b(and)g(other)h(columns)f(\(in)g(the)h(same)0 4443 y(ro)m(w\).)63
 b(The)37 b(full)e(syn)m(tax)k(and)e(a)m(v)-5 b(ailable)37
 b(functions)f(for)h(the)h(expression)e(are)i(describ)s(ed)e(b)s(elo)m
-(w)h(in)f(the)i(ro)m(w)0 2865 y(\014lter)29 b(sp)s(eci\014cation)h
-(section.)0 3025 y(F)-8 b(or)35 b(complex)f(or)h(commonly)f(used)g(op)s
-(erations,)h(one)g(can)f(also)h(place)f(the)h(op)s(erations)f(in)m(to)g
-(a)h(text)h(\014le)e(and)0 3138 y(imp)s(ort)d(it)h(in)m(to)g(the)h
-(column)e(\014lter)h(using)f(the)i(syn)m(tax)g('[col)g
-(@\014lename.txt]'.)47 b(The)32 b(op)s(erations)g(can)h(extend)0
-3251 y(o)m(v)m(er)f(m)m(ultiple)c(lines)g(of)j(the)f(\014le,)g(but)g(m)
-m(ultiple)e(op)s(erations)i(m)m(ust)g(still)e(b)s(e)i(separated)h(b)m
-(y)f(semicolons.)0 3411 y(Examples:)143 3679 y Fe([col)47
-b(!TIME;)f(Good)h(==)g(STATUS])141 b(-)47 b(deletes)f(the)h(TIME)g
-(column)f(and)1670 3792 y(renames)g(the)h(status)f(column)g(to)i
-('Good')143 4017 y([col)f(PI=PHA)f(*)h(1.1)g(+)h(0.2])285
-b(-)47 b(creates)f(new)h(PI)g(column)f(from)h(PHA)g(values)143
-4243 y([col)g(rate)f(=)i(rate/exposure])139 b(-)48 b(recomputes)d(the)i
-(rate)f(column)g(by)i(dividing)1670 4356 y(it)g(by)f(the)g(EXPOSURE)e
-(keyword)h(value.)0 4656 y Fb(4.2.8)112 b(Ro)m(w)37 b(Filtering)e(Sp)s
-(eci\014cation)0 4876 y Fi(The)29 b(optional)g(ro)m(w)g(\014lter)g(is)g
-(a)h(b)s(o)s(olean)e(expression)h(enclosed)g(in)f(square)h(brac)m(k)m
-(ets)i(for)f(\014ltering)e(or)h(selecting)0 4989 y(ro)m(ws)k(from)g
-(the)g(input)e(FITS)i(table.)49 b(A)33 b(new)g(FITS)f(\014le)g(is)h
-(then)g(created)h(whic)m(h)e(con)m(tains)h(only)f(those)i(ro)m(ws)0
-5102 y(for)e(whic)m(h)g(the)h(b)s(o)s(olean)e(expression)h(ev)-5
-b(aluates)33 b(to)g(true.)48 b(\(The)32 b(primary)f(arra)m(y)i(and)f
-(an)m(y)h(other)g(extensions)0 5215 y(in)28 b(the)h(input)e(\014le)h
-(are)h(also)g(copied)g(to)h(the)f(new)f(\014le\).)40
-b(The)28 b(original)g(FITS)g(\014le)g(is)g(closed)h(and)f(the)h(new)g
-(\014le)f(is)0 5328 y(op)s(ened)f(and)g(passed)g(to)i(the)f
-(application)e(program.)39 b(The)28 b(new)f(\014le)g(will)e(p)s(ersist)
-h(only)h(un)m(til)f(the)i(\014le)e(is)h(closed)0 5441
-y(or)j(un)m(til)f(the)i(program)f(exits,)g(unless)f(the)h(output)g
-(\014le)g(sp)s(eci\014er)f(\(see)i(ab)s(o)m(v)m(e\))h(is)d(also)i
-(supplied.)0 5601 y(The)c(expression)e(can)j(b)s(e)e(an)h(arbitrarily)d
-(complex)j(series)f(of)i(op)s(erations)e(p)s(erformed)f(on)i(constan)m
-(ts,)i(k)m(eyw)m(ord)0 5714 y(v)-5 b(alues,)30 b(and)g(column)f(data)i
-(tak)m(en)g(from)f(the)h(sp)s(eci\014ed)e(FITS)g(T)-8
-b(ABLE)31 b(extension.)p eop
-%%Page: 29 35
-29 34 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(29)0 555 y(Keyw)m(ord)37 b(and)f(column)f(data)j(are)f
+(w)h(in)f(the)i(ro)m(w)0 4556 y(\014lter)29 b(sp)s(eci\014cation)h
+(section.)0 4716 y(If)d(the)h(expression)f(con)m(tains)g(b)s(oth)g(a)h
+(list)f(of)h(columns)e(to)i(b)s(e)g(included)c(and)k(columns)e(to)i(b)s
+(e)f(deleted,)i(then)e(all)0 4829 y(the)34 b(columns)f(in)g(the)h
+(original)e(table)i(except)h(the)f(explicitly)e(deleted)i(columns)e
+(will)g(app)s(ear)h(in)g(the)h(\014ltered)0 4942 y(table.)0
+5102 y(F)-8 b(or)30 b(complex)g(or)f(commonly)g(used)g(op)s(erations,)h
+(one)f(can)h(also)g(place)g(the)f(op)s(erations)g(in)m(to)h(an)f
+(external)h(text)0 5215 y(\014le)g(and)g(imp)s(ort)f(it)h(in)m(to)h
+(the)g(column)f(\014lter)f(using)h(the)h(syn)m(tax)g('[col)g
+(@\014lename.txt]'.)42 b(The)31 b(op)s(erations)f(can)0
+5328 y(extend)c(o)m(v)m(er)i(m)m(ultiple)c(lines)h(of)h(the)h(\014le,)g
+(but)e(m)m(ultiple)f(op)s(erations)i(m)m(ust)g(still)f(b)s(e)g
+(separated)i(b)m(y)g(semicolons.)0 5441 y(An)m(y)h(lines)f(in)g(the)h
+(external)h(text)g(\014le)e(that)i(b)s(egin)e(with)g(2)i(slash)e(c)m
+(haracters)j(\('//'\))g(will)c(b)s(e)h(ignored)h(and)f(ma)m(y)0
+5554 y(b)s(e)j(used)f(to)i(add)f(commen)m(ts)h(in)m(to)g(the)f(\014le.)
+0 5714 y(Examples:)p eop
+%%Page: 28 34
+28 33 bop 0 299 a Fi(28)1618 b Fg(CHAPTER)30 b(4.)112
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)143 555 y
+Fe([col)47 b(Time;rate])713 b(-)47 b(only)g(the)g(Time)g(and)g(rate)f
+(columns)g(will)1670 668 y(appear)h(in)g(the)g(filtered)e(input)i
+(file.)143 894 y([col)g(Time;*raw])713 b(-)47 b(include)f(the)h(Time)g
+(column)f(and)h(any)g(other)1670 1007 y(columns)f(whose)h(name)f(ends)h
+(with)g('raw'.)143 1233 y([col)g(-TIME;)f(Good)h(==)g(STATUS])141
+b(-)47 b(deletes)f(the)h(TIME)g(column)f(and)1670 1346
+y(renames)g(the)h(status)f(column)g(to)i('Good')143 1571
+y([col)f(PI=PHA)f(*)h(1.1)g(+)h(0.2])285 b(-)47 b(creates)f(new)h(PI)g
+(column)f(from)h(PHA)g(values)143 1797 y([col)g(rate)f(=)i
+(rate/exposure])139 b(-)48 b(recomputes)d(the)i(rate)f(column)g(by)i
+(dividing)1670 1910 y(it)g(by)f(the)g(EXPOSURE)e(keyword)h(value.)0
+2252 y Fd(4.9)135 b(Ro)l(w)46 b(Filtering)g(Sp)t(eci\014cation)0
+2503 y Fi(When)29 b(en)m(tering)g(the)g(name)g(of)g(a)g(FITS)f(table)h
+(that)h(is)d(to)j(b)s(e)e(op)s(ened)h(b)m(y)f(a)i(program,)f(an)g
+(optional)f(ro)m(w)h(\014lter)0 2616 y(ma)m(y)i(b)s(e)g(sp)s(eci\014ed)
+e(to)i(select)g(a)h(subset)e(of)h(the)g(ro)m(ws)f(in)g(the)h(table.)42
+b(A)31 b(temp)s(orary)f(new)g(FITS)g(\014le)g(is)g(created)0
+2729 y(on)25 b(the)h(\015y)e(whic)m(h)g(con)m(tains)h(only)g(those)h
+(ro)m(ws)f(for)g(whic)m(h)f(the)h(ro)m(w)g(\014lter)g(expression)f(ev)
+-5 b(aluates)25 b(to)h(true.)39 b(\(The)0 2842 y(primary)25
+b(arra)m(y)i(and)f(an)m(y)g(other)h(extensions)f(in)f(the)i(input)e
+(\014le)g(are)i(also)g(copied)f(to)h(the)f(temp)s(orary)h(\014le\).)38
+b(The)0 2955 y(original)27 b(FITS)i(\014le)f(is)g(closed)h(and)f(the)i
+(new)e(virtual)g(\014le)g(is)g(op)s(ened)g(b)m(y)h(the)h(application)d
+(program.)40 b(The)29 b(ro)m(w)0 3068 y(\014lter)36 b(expression)g(is)h
+(enclosed)g(in)f(square)h(brac)m(k)m(ets)i(follo)m(wing)d(the)h(\014le)
+g(name)g(and)g(extension)g(name)g(\(e.g.,)0 3181 y('\014le.\014ts[ev)m
+(en)m(ts][GRADE==50]')28 b(selects)d(only)f(those)i(ro)m(ws)f(where)f
+(the)h(GRADE)h(column)e(v)-5 b(alue)24 b(equals)g(50\).)0
+3294 y(When)33 b(dealing)f(with)g(tables)g(where)h(eac)m(h)h(ro)m(w)f
+(has)g(an)g(asso)s(ciated)h(time)f(and/or)g(2D)g(spatial)g(p)s
+(osition,)f(the)0 3407 y(ro)m(w)g(\014lter)g(expression)e(can)j(also)f
+(b)s(e)g(used)f(to)i(select)g(ro)m(ws)f(based)g(on)g(the)g(times)g(in)f
+(a)h(Go)s(o)s(d)g(Time)f(In)m(terv)-5 b(als)0 3520 y(\(GTI\))31
+b(extension,)f(or)g(on)h(spatial)e(p)s(osition)g(as)h(giv)m(en)h(in)e
+(a)h(SA)m(O-st)m(yle)h(region)f(\014le.)0 3818 y Fb(4.9.1)112
+b(General)38 b(Syn)m(tax)0 4039 y Fi(The)32 b(ro)m(w)h(\014ltering)e
+(expression)h(can)h(b)s(e)f(an)h(arbitrarily)d(complex)i(series)g(of)h
+(op)s(erations)f(p)s(erformed)g(on)g(con-)0 4152 y(stan)m(ts,)39
+b(k)m(eyw)m(ord)e(v)-5 b(alues,)37 b(and)f(column)f(data)j(tak)m(en)f
+(from)f(the)h(sp)s(eci\014ed)d(FITS)i(T)-8 b(ABLE)37
+b(extension.)58 b(The)0 4264 y(expression)36 b(m)m(ust)i(ev)-5
+b(aluate)38 b(to)h(a)f(b)s(o)s(olean)f(v)-5 b(alue)37
+b(for)g(eac)m(h)i(ro)m(w)f(of)g(the)f(table,)j(where)d(a)h(v)-5
+b(alue)38 b(of)f(F)-10 b(ALSE)0 4377 y(means)30 b(that)h(the)g(ro)m(w)f
+(will)e(b)s(e)i(excluded.)0 4538 y(F)-8 b(or)34 b(complex)f(or)h
+(commonly)e(used)h(\014lters,)g(one)h(can)g(place)f(the)h(expression)e
+(in)m(to)h(a)h(text)g(\014le)f(and)g(imp)s(ort)e(it)0
+4650 y(in)m(to)37 b(the)f(ro)m(w)h(\014lter)f(using)f(the)i(syn)m(tax)g
+('[@\014lename.txt]'.)60 b(The)36 b(expression)g(can)g(b)s(e)g
+(arbitrarily)e(complex)0 4763 y(and)27 b(extend)i(o)m(v)m(er)g(m)m
+(ultiple)d(lines)g(of)i(the)h(\014le.)39 b(An)m(y)28
+b(lines)e(in)h(the)h(external)g(text)h(\014le)e(that)i(b)s(egin)e(with)
+g(2)h(slash)0 4876 y(c)m(haracters)k(\('//'\))g(will)c(b)s(e)i(ignored)
+f(and)h(ma)m(y)h(b)s(e)f(used)f(to)i(add)f(commen)m(ts)h(in)m(to)g(the)
+f(\014le.)0 5036 y(Keyw)m(ord)37 b(and)f(column)f(data)j(are)f
 (referenced)g(b)m(y)g(name.)60 b(An)m(y)37 b(string)e(of)i(c)m
-(haracters)i(not)e(surrounded)d(b)m(y)0 668 y(quotes)41
+(haracters)i(not)e(surrounded)d(b)m(y)0 5149 y(quotes)41
 b(\(ie,)i(a)e(constan)m(t)h(string\))e(or)g(follo)m(w)m(ed)g(b)m(y)h
 (an)f(op)s(en)g(paren)m(theses)h(\(ie,)i(a)e(function)e(name\))i(will)d
-(b)s(e)0 781 y(initially)j(in)m(terpretted)j(as)g(a)h(column)e(name)i
-(and)e(its)h(con)m(ten)m(ts)i(for)e(the)h(curren)m(t)f(ro)m(w)g
-(inserted)f(in)m(to)i(the)0 894 y(expression.)59 b(If)36
-b(no)h(suc)m(h)f(column)g(exists,)i(a)f(k)m(eyw)m(ord)g(of)g(that)g
-(name)g(will)d(b)s(e)i(searc)m(hed)i(for)e(and)g(its)g(v)-5
-b(alue)0 1007 y(used,)31 b(if)f(found.)43 b(T)-8 b(o)31
-b(force)h(the)g(name)f(to)h(b)s(e)f(in)m(terpretted)g(as)h(a)f(k)m(eyw)
-m(ord)h(\(in)e(case)j(there)e(is)g(b)s(oth)f(a)i(column)0
-1120 y(and)d(k)m(eyw)m(ord)h(with)e(the)i(same)g(name\),)g(precede)g
-(the)f(k)m(eyw)m(ord)h(name)g(with)e(a)i(single)e(p)s(ound)f(sign,)i
-('#',)i(as)e(in)0 1233 y('#NAXIS2'.)40 b(Due)27 b(to)g(the)f
-(generalities)g(of)g(FITS)g(column)f(and)h(k)m(eyw)m(ord)h(names,)g(if)
-e(the)i(column)e(or)h(k)m(eyw)m(ord)0 1346 y(name)34
-b(con)m(tains)g(a)g(space)h(or)e(a)i(c)m(haracter)g(whic)m(h)e(migh)m
-(t)g(app)s(ear)g(as)i(an)e(arithmetic)g(term)h(then)g(inclose)f(the)0
-1458 y(name)d(in)f('$')j(c)m(haracters)g(as)e(in)f($MAX)j(PHA$)f(or)f
-(#$MAX-PHA$.)43 b(Names)31 b(are)f(case)i(insensitiv)m(e.)0
-1619 y(T)-8 b(o)41 b(access)i(a)e(table)g(en)m(try)g(in)f(a)h(ro)m(w)g
-(other)g(than)g(the)g(curren)m(t)g(one,)j(follo)m(w)c(the)h(column's)f
-(name)h(with)f(a)0 1732 y(ro)m(w)31 b(o\013set)h(within)c(curly)h
-(braces.)43 b(F)-8 b(or)31 b(example,)g('PHA-3')h(will)c(ev)-5
-b(aluate)32 b(to)f(the)g(v)-5 b(alue)31 b(of)g(column)e(PHA,)j(3)0
-1844 y(ro)m(ws)c(ab)s(o)m(v)m(e)i(the)e(ro)m(w)h(curren)m(tly)e(b)s
-(eing)g(pro)s(cessed.)40 b(One)28 b(cannot)h(sp)s(ecify)e(an)h
-(absolute)g(ro)m(w)g(n)m(um)m(b)s(er,)g(only)g(a)0 1957
-y(relativ)m(e)i(o\013set.)42 b(Ro)m(ws)31 b(that)g(fall)e(outside)h
-(the)g(table)g(will)e(b)s(e)i(treated)h(as)g(unde\014ned,)d(or)j
-(NULLs.)0 2118 y(Bo)s(olean)g(op)s(erators)g(can)g(b)s(e)f(used)f(in)h
-(the)g(expression)g(in)f(either)h(their)g(F)-8 b(ortran)31
-b(or)f(C)h(forms.)40 b(The)30 b(follo)m(wing)0 2230 y(b)s(o)s(olean)f
-(op)s(erators)i(are)g(a)m(v)-5 b(ailable:)191 2468 y
-Fe("equal")428 b(.eq.)46 b(.EQ.)h(==)95 b("not)46 b(equal")476
-b(.ne.)94 b(.NE.)h(!=)191 2581 y("less)46 b(than")238
-b(.lt.)46 b(.LT.)h(<)143 b("less)46 b(than/equal")188
-b(.le.)94 b(.LE.)h(<=)47 b(=<)191 2694 y("greater)e(than")95
-b(.gt.)46 b(.GT.)h(>)143 b("greater)45 b(than/equal")g(.ge.)94
-b(.GE.)h(>=)47 b(=>)191 2807 y("or")572 b(.or.)46 b(.OR.)h(||)95
-b("and")762 b(.and.)46 b(.AND.)h(&&)191 2920 y("negation")236
-b(.not.)46 b(.NOT.)h(!)95 b("approx.)45 b(equal\(1e-7\)")92
-b(~)0 3158 y Fi(Note)32 b(that)g(the)f(exclamation)g(p)s(oin)m(t,)f(')
-10 b(!',)33 b(is)d(a)h(sp)s(ecial)e(UNIX)j(c)m(haracter,)h(so)e(if)f
-(it)g(is)g(used)g(on)h(the)g(command)0 3271 y(line)g(rather)h(than)h
-(en)m(tered)g(at)g(a)g(task)g(prompt,)g(it)f(m)m(ust)g(b)s(e)g
-(preceded)h(b)m(y)f(a)h(bac)m(kslash)f(to)i(force)f(the)g(UNIX)0
-3384 y(shell)c(to)i(ignore)f(it.)0 3544 y(The)i(expression)f(ma)m(y)j
-(also)e(include)e(arithmetic)i(op)s(erators)h(and)f(functions.)46
-b(T)-8 b(rigonometric)32 b(functions)f(use)0 3657 y(radians,)22
-b(not)h(degrees.)38 b(The)22 b(follo)m(wing)e(arithmetic)h(op)s
-(erators)i(and)e(functions)f(can)j(b)s(e)e(used)g(in)g(the)h
-(expression)0 3770 y(\(function)29 b(names)i(are)f(case)i(insensitiv)m
-(e\):)191 4008 y Fe("addition")522 b(+)477 b("subtraction")d(-)191
-4121 y("multiplication")234 b(*)477 b("division")618
-b(/)191 4234 y("negation")522 b(-)477 b("exponentiation")330
-b(**)143 b(^)191 4347 y("absolute)45 b(value")237 b(abs\(x\))g
-("cosine")714 b(cos\(x\))191 4460 y("sine")g(sin\(x\))237
-b("tangent")666 b(tan\(x\))191 4573 y("arc)47 b(cosine")427
+(b)s(e)0 5262 y(initially)33 b(in)m(terpreted)i(as)i(a)g(column)e(name)
+h(and)g(its)g(con)m(ten)m(ts)i(for)e(the)h(curren)m(t)f(ro)m(w)g
+(inserted)f(in)m(to)i(the)f(ex-)0 5375 y(pression.)j(If)28
+b(no)h(suc)m(h)g(column)f(exists,)h(a)h(k)m(eyw)m(ord)f(of)h(that)f
+(name)g(will)e(b)s(e)h(searc)m(hed)i(for)f(and)f(its)h(v)-5
+b(alue)28 b(used,)0 5488 y(if)35 b(found.)55 b(T)-8 b(o)36
+b(force)g(the)g(name)g(to)h(b)s(e)e(in)m(terpreted)g(as)h(a)g(k)m(eyw)m
+(ord)g(\(in)f(case)h(there)g(is)f(b)s(oth)g(a)h(column)f(and)0
+5601 y(k)m(eyw)m(ord)41 b(with)d(the)j(same)f(name\),)j(precede)d(the)h
+(k)m(eyw)m(ord)f(name)g(with)f(a)i(single)d(p)s(ound)g(sign,)k('#',)h
+(as)d(in)0 5714 y('#NAXIS2'.)g(Due)27 b(to)g(the)f(generalities)g(of)g
+(FITS)g(column)f(and)h(k)m(eyw)m(ord)h(names,)g(if)e(the)i(column)e(or)
+h(k)m(eyw)m(ord)p eop
+%%Page: 29 35
+29 34 bop 0 299 a Fg(4.9.)72 b(R)m(O)m(W)31 b(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)2072 b Fi(29)0 555
+y(name)34 b(con)m(tains)g(a)g(space)h(or)e(a)i(c)m(haracter)g(whic)m(h)
+e(migh)m(t)g(app)s(ear)g(as)i(an)e(arithmetic)g(term)h(then)g(inclose)f
+(the)0 668 y(name)d(in)f('$')j(c)m(haracters)g(as)e(in)f($MAX)j(PHA$)f
+(or)f(#$MAX-PHA$.)43 b(Names)31 b(are)f(case)i(insensitiv)m(e.)0
+828 y(T)-8 b(o)32 b(access)g(a)g(table)f(en)m(try)h(in)e(a)i(ro)m(w)f
+(other)h(than)f(the)g(curren)m(t)g(one,)h(follo)m(w)f(the)g(column's)g
+(name)g(with)f(a)i(ro)m(w)0 941 y(o\013set)37 b(within)c(curly)h
+(braces.)57 b(F)-8 b(or)36 b(example,)h('PHA)p Fc(f)p
+Fi(-3)p Fc(g)p Fi(')h(will)33 b(ev)-5 b(aluate)37 b(to)f(the)g(v)-5
+b(alue)35 b(of)h(column)e(PHA,)j(3)0 1054 y(ro)m(ws)28
+b(ab)s(o)m(v)m(e)i(the)e(ro)m(w)h(curren)m(tly)e(b)s(eing)g(pro)s
+(cessed.)40 b(One)28 b(cannot)h(sp)s(ecify)e(an)h(absolute)g(ro)m(w)g
+(n)m(um)m(b)s(er,)g(only)g(a)0 1167 y(relativ)m(e)i(o\013set.)42
+b(Ro)m(ws)31 b(that)g(fall)e(outside)h(the)g(table)g(will)e(b)s(e)i
+(treated)h(as)g(unde\014ned,)d(or)j(NULLs.)0 1327 y(Bo)s(olean)g(op)s
+(erators)g(can)g(b)s(e)f(used)f(in)h(the)g(expression)g(in)f(either)h
+(their)g(F)-8 b(ortran)31 b(or)f(C)h(forms.)40 b(The)30
+b(follo)m(wing)0 1440 y(b)s(o)s(olean)f(op)s(erators)i(are)g(a)m(v)-5
+b(ailable:)191 1695 y Fe("equal")428 b(.eq.)46 b(.EQ.)h(==)95
+b("not)46 b(equal")476 b(.ne.)94 b(.NE.)h(!=)191 1807
+y("less)46 b(than")238 b(.lt.)46 b(.LT.)h(<)143 b("less)46
+b(than/equal")188 b(.le.)94 b(.LE.)h(<=)47 b(=<)191 1920
+y("greater)e(than")95 b(.gt.)46 b(.GT.)h(>)143 b("greater)45
+b(than/equal")g(.ge.)94 b(.GE.)h(>=)47 b(=>)191 2033
+y("or")572 b(.or.)46 b(.OR.)h(||)95 b("and")762 b(.and.)46
+b(.AND.)h(&&)191 2146 y("negation")236 b(.not.)46 b(.NOT.)h(!)95
+b("approx.)45 b(equal\(1e-7\)")92 b(~)0 2401 y Fi(Note)32
+b(that)g(the)f(exclamation)g(p)s(oin)m(t,)f(')10 b(!',)33
+b(is)d(a)h(sp)s(ecial)e(UNIX)j(c)m(haracter,)h(so)e(if)f(it)g(is)g
+(used)g(on)h(the)g(command)0 2514 y(line)g(rather)h(than)h(en)m(tered)g
+(at)g(a)g(task)g(prompt,)g(it)f(m)m(ust)g(b)s(e)g(preceded)h(b)m(y)f(a)
+h(bac)m(kslash)f(to)i(force)f(the)g(UNIX)0 2626 y(shell)c(to)i(ignore)f
+(it.)0 2787 y(The)i(expression)f(ma)m(y)j(also)e(include)e(arithmetic)i
+(op)s(erators)h(and)f(functions.)46 b(T)-8 b(rigonometric)32
+b(functions)f(use)0 2900 y(radians,)22 b(not)h(degrees.)38
+b(The)22 b(follo)m(wing)e(arithmetic)h(op)s(erators)i(and)e(functions)f
+(can)j(b)s(e)e(used)g(in)g(the)h(expression)0 3012 y(\(function)37
+b(names)g(are)h(case)g(insensitiv)m(e\).)61 b(A)37 b(n)m(ull)f(v)-5
+b(alue)37 b(will)d(b)s(e)j(returned)g(in)f(case)i(of)g(illegal)e(op)s
+(erations)0 3125 y(suc)m(h)30 b(as)h(divide)d(b)m(y)i(zero,)i
+(sqrt\(negativ)m(e\))g(log\(negativ)m(e\),)g(log10\(negativ)m(e\),)i
+(arccos\(.gt.)43 b(1\),)32 b(arcsin\(.gt.)41 b(1\).)191
+3380 y Fe("addition")522 b(+)477 b("subtraction")d(-)191
+3493 y("multiplication")234 b(*)477 b("division")618
+b(/)191 3606 y("negation")522 b(-)477 b("exponentiation")330
+b(**)143 b(^)191 3719 y("absolute)45 b(value")237 b(abs\(x\))g
+("cosine")714 b(cos\(x\))191 3831 y("sine")g(sin\(x\))237
+b("tangent")666 b(tan\(x\))191 3944 y("arc)47 b(cosine")427
 b(arccos\(x\))93 b("arc)47 b(sine")619 b(arcsin\(x\))191
-4685 y("arc)47 b(tangent")379 b(arctan\(x\))93 b("arc)47
-b(tangent")475 b(arctan2\(x,y\))191 4798 y("exponential")378
+4057 y("arc)47 b(tangent")379 b(arctan\(x\))93 b("arc)47
+b(tangent")475 b(arctan2\(x,y\))191 4170 y("hyperbolic)45
+b(cos")237 b(cosh\(x\))189 b("hyperbolic)45 b(sin")333
+b(sinh\(x\))191 4283 y("hyperbolic)45 b(tan")237 b(tanh\(x\))189
+b("round)46 b(to)h(nearest)f(int")h(round\(x\))191 4396
+y("round)f(down)h(to)g(int")94 b(floor\(x\))141 b("round)46
+b(up)h(to)h(int")285 b(ceil\(x\))191 4509 y("exponential")378
 b(exp\(x\))237 b("square)46 b(root")476 b(sqrt\(x\))191
-4911 y("natural)45 b(log")381 b(log\(x\))237 b("common)46
-b(log")524 b(log10\(x\))191 5024 y("modulus")570 b(i)48
+4622 y("natural)45 b(log")381 b(log\(x\))237 b("common)46
+b(log")524 b(log10\(x\))191 4735 y("modulus")570 b(i)48
 b(\045)f(j)286 b("random)46 b(#)h([0.0,1.0\)")141 b(random\(\))191
-5137 y("minimum")570 b(min\(x,y\))141 b("maximum")666
-b(max\(x,y\))191 5250 y("if-then-else")330 b(b?x:y)0
-5488 y Fi(An)31 b(alternate)h(syn)m(tax)g(for)f(the)g(min)f(and)h(max)g
+4848 y("minimum")570 b(min\(x,y\))141 b("maximum")666
+b(max\(x,y\))191 4961 y("if-then-else")330 b(b?x:y)0
+5215 y Fi(An)31 b(alternate)h(syn)m(tax)g(for)f(the)g(min)f(and)h(max)g
 (functions)f(has)h(only)f(a)i(single)e(argumen)m(t)i(whic)m(h)e(should)
-f(b)s(e)i(a)0 5601 y(v)m(ector)g(v)-5 b(alue)29 b(\(see)h(b)s(elo)m
+f(b)s(e)i(a)0 5328 y(v)m(ector)g(v)-5 b(alue)29 b(\(see)h(b)s(elo)m
 (w\).)40 b(The)29 b(result)f(will)f(b)s(e)h(the)i(minim)m(um/maxim)m
-(um)c(elemen)m(t)j(con)m(tained)h(within)d(the)0 5714
-y(v)m(ector.)p eop
+(um)c(elemen)m(t)j(con)m(tained)h(within)d(the)0 5441
+y(v)m(ector.)0 5601 y(The)38 b(follo)m(wing)f(t)m(yp)s(e)i(casting)g
+(op)s(erators)g(are)g(a)m(v)-5 b(ailable,)41 b(where)d(the)h(inclosing)
+e(paren)m(theses)i(are)g(required)0 5714 y(and)30 b(tak)m(en)h(from)f
+(the)h(C)f(language)g(usage.)42 b(Also,)30 b(the)h(in)m(teger)f(to)i
+(real)e(casts)h(v)-5 b(alues)29 b(to)j(double)d(precision:)p
+eop
 %%Page: 30 36
 30 35 bop 0 299 a Fi(30)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(There)37
-b(are)g(three)g(functions)f(that)h(are)h(primarily)c(for)i(use)h(with)f
-(SA)m(O)h(region)f(\014les)g(and)h(the)g(FSA)m(OI)g(task,)0
-668 y(but)e(they)h(can)h(b)s(e)e(used)g(directly)-8 b(.)57
-b(They)36 b(return)f(a)h(b)s(o)s(olean)f(true)h(or)g(false)f(dep)s
-(ending)f(on)i(whether)f(a)i(t)m(w)m(o)0 781 y(dimensional)28
-b(p)s(oin)m(t)h(is)g(in)g(the)i(region)f(or)g(not:)191
-1012 y Fe("point)46 b(in)h(a)h(circular)d(region")477
-1125 y(circle\(xcntr,ycntr,radius)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191
-1351 y("point)h(in)h(an)g(elliptical)e(region")430 1464
-y(ellipse\(xcntr,ycntr,xhl)o(f_w)o(dth,)o(yhlf)o(_wd)o(th,r)o(otat)o
-(ion)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191 1689 y("point)h(in)h(a)h
-(rectangular)c(region")620 1802 y(box\(xcntr,ycntr,xfll_wdth,)o(yfll)o
-(_wd)o(th,r)o(otat)o(ion)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191
-2028 y(where)334 2141 y(\(xcntr,ycntr\))g(are)j(the)g(\(x,y\))f
-(position)g(of)h(the)g(center)f(of)h(the)g(region)334
-2254 y(\(xhlf_wdth,yhlf_wdth\))42 b(are)47 b(the)g(\(x,y\))f(half)h
-(widths)f(of)h(the)g(region)334 2367 y(\(xfll_wdth,yfll_wdth\))42
-b(are)47 b(the)g(\(x,y\))f(full)h(widths)f(of)h(the)g(region)334
-2480 y(\(radius\))f(is)h(half)f(the)h(diameter)f(of)h(the)g(circle)334
-2593 y(\(rotation\))e(is)i(the)g(angle\(degrees\))d(that)j(the)g
-(region)f(is)h(rotated)f(with)620 2706 y(respect)g(to)h
-(\(xcntr,ycntr\))334 2818 y(\(Xcoord,Ycoord\))d(are)j(the)g(\(x,y\))f
-(coordinates)f(to)i(test,)f(usually)g(column)620 2931
-y(names)334 3044 y(NOTE:)g(each)h(parameter)e(can)i(itself)f(be)i(an)f
-(expression,)d(not)j(merely)f(a)620 3157 y(column)h(name)f(or)h
-(constant.)0 3388 y Fi(There)27 b(is)f(also)i(a)f(function)f(for)i
-(testing)f(if)f(t)m(w)m(o)j(v)-5 b(alues)27 b(are)h(close)f(to)i(eac)m
-(h)f(other,)h(i.e.,)f(if)e(they)i(are)g("near")g(eac)m(h)0
-3501 y(other)c(to)h(within)c(a)j(user)g(sp)s(eci\014ed)e(tolerance.)39
-b(The)24 b(argumen)m(ts,)h(v)-5 b(alue)p 2503 3501 28
-4 v 33 w(1)24 b(and)f(v)-5 b(alue)p 2980 3501 V 32 w(2)25
-b(can)f(b)s(e)f(in)m(teger)h(or)g(real)0 3614 y(and)32
-b(represen)m(t)h(the)g(t)m(w)m(o)h(v)-5 b(alues)32 b(who's)g(pro)m
-(ximit)m(y)g(is)g(b)s(eing)f(tested)i(to)h(b)s(e)e(within)e(the)j(sp)s
-(eci\014ed)e(tolerance,)0 3727 y(also)f(an)h(in)m(teger)f(or)h(real:)
-955 3958 y Fe(near\(value_1,)44 b(value_2,)h(tolerance\))0
-4189 y Fi(When)37 b(a)i(NULL,)e(or)h(unde\014ned,)g(v)-5
-b(alue)37 b(is)g(encoun)m(tered)h(in)e(the)i(FITS)f(table,)j(the)e
-(expression)e(will)f(ev)-5 b(alu-)0 4302 y(ate)38 b(to)f(NULL)g(unless)
-d(the)j(unde\014ned)e(v)-5 b(alue)36 b(is)f(not)i(actually)f(required)f
-(for)h(ev)-5 b(aluation,)38 b(eg.)60 b("TR)m(UE)37 b(.or.)0
-4414 y(NULL")26 b(ev)-5 b(aluates)26 b(to)h(TR)m(UE.)f(The)f(follo)m
-(wing)f(t)m(w)m(o)j(functions)d(allo)m(w)h(some)h(NULL)g(detection)g
-(and)f(handling:)0 4527 y(ISNULL\(x\))31 b(and)g(DEFNULL\(x,y\).)44
-b(The)31 b(former)g(returns)f(a)h(b)s(o)s(olean)g(v)-5
-b(alue)30 b(of)i(TR)m(UE)f(if)f(the)h(argumen)m(t)h(x)0
-4640 y(is)f(NULL.)h(The)g(later)g("de\014nes")g(a)g(v)-5
-b(alue)31 b(to)i(b)s(e)f(substituted)e(for)i(NULL)g(v)-5
-b(alues;)32 b(it)f(returns)g(the)h(v)-5 b(alue)32 b(of)g(x)0
-4753 y(if)d(x)i(is)e(not)i(NULL,)f(otherwise)g(it)g(returns)f(the)i(v)
--5 b(alue)29 b(of)i(y)-8 b(.)0 4913 y(The)38 b(follo)m(wing)f(t)m(yp)s
-(e)i(casting)g(op)s(erators)g(are)g(a)m(v)-5 b(ailable,)41
-b(where)d(the)h(inclosing)e(paren)m(theses)i(are)g(required)0
-5026 y(and)30 b(tak)m(en)h(from)f(the)h(C)f(language)g(usage.)42
-b(Also,)30 b(the)h(in)m(teger)f(to)i(real)e(casts)h(v)-5
-b(alues)29 b(to)j(double)d(precision:)764 5257 y Fe("real)46
-b(to)h(integer")189 b(\(int\))46 b(x)239 b(\(INT\))46
-b(x)764 5370 y("integer)f(to)i(real")190 b(\(float\))46
-b(i)143 b(\(FLOAT\))45 b(i)0 5601 y Fi(Bit)35 b(masks)g(can)h(b)s(e)f
-(used)f(to)i(select)g(out)f(ro)m(ws)h(from)e(bit)h(columns)f(\(TF)m
-(ORMn)h(=)g(#X\))h(in)e(FITS)g(\014les.)54 b(T)-8 b(o)0
-5714 y(represen)m(t)30 b(the)h(mask,)g(binary)-8 b(,)29
-b(o)s(ctal,)i(and)f(hex)g(formats)g(are)h(allo)m(w)m(ed:)p
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)764 555 y
+Fe("real)46 b(to)h(integer")189 b(\(int\))46 b(x)239
+b(\(INT\))46 b(x)764 668 y("integer)f(to)i(real")190
+b(\(float\))46 b(i)143 b(\(FLOAT\))45 b(i)0 911 y Fi(In)30
+b(addition,)e(sev)m(eral)j(constan)m(ts)h(are)f(built)d(in)h(for)h(use)
+g(in)f(n)m(umerical)g(expressions:)382 1154 y Fe(#pi)667
+b(3.1415...)284 b(#e)620 b(2.7182...)382 1267 y(#deg)f(#pi/180)380
+b(#row)524 b(current)46 b(row)h(number)382 1380 y(#null)428
+b(undefined)45 b(value)142 b(#snull)428 b(undefined)45
+b(string)0 1623 y Fi(A)40 b(string)e(constan)m(t)j(m)m(ust)e(b)s(e)g
+(enclosed)g(in)g(quotes)h(as)f(in)g('Crab'.)67 b(The)39
+b("n)m(ull")g(constan)m(ts)h(are)g(useful)e(for)0 1736
+y(conditionally)d(setting)j(table)g(v)-5 b(alues)37 b(to)h(a)g(NULL,)g
+(or)g(unde\014ned,)f(v)-5 b(alue)38 b(\(eg.,)j("col1==-99)e(?)62
+b(#NULL)38 b(:)0 1848 y(col1"\).)0 2009 y(There)27 b(is)f(also)i(a)f
+(function)f(for)i(testing)f(if)f(t)m(w)m(o)j(v)-5 b(alues)27
+b(are)h(close)f(to)i(eac)m(h)f(other,)h(i.e.,)f(if)e(they)i(are)g
+("near")g(eac)m(h)0 2122 y(other)c(to)h(within)c(a)j(user)g(sp)s
+(eci\014ed)e(tolerance.)39 b(The)24 b(argumen)m(ts,)h(v)-5
+b(alue)p 2503 2122 28 4 v 33 w(1)24 b(and)f(v)-5 b(alue)p
+2980 2122 V 32 w(2)25 b(can)f(b)s(e)f(in)m(teger)h(or)g(real)0
+2234 y(and)32 b(represen)m(t)h(the)g(t)m(w)m(o)h(v)-5
+b(alues)32 b(who's)g(pro)m(ximit)m(y)g(is)g(b)s(eing)f(tested)i(to)h(b)
+s(e)e(within)e(the)j(sp)s(eci\014ed)e(tolerance,)0 2347
+y(also)f(an)h(in)m(teger)f(or)h(real:)955 2590 y Fe(near\(value_1,)44
+b(value_2,)h(tolerance\))0 2833 y Fi(When)24 b(a)i(NULL,)e(or)h
+(unde\014ned,)f(v)-5 b(alue)24 b(is)g(encoun)m(tered)h(in)f(the)g(FITS)
+g(table,)i(the)f(expression)f(will)e(ev)-5 b(aluate)25
+b(to)0 2946 y(NULL)31 b(unless)e(the)i(unde\014ned)e(v)-5
+b(alue)30 b(is)g(not)h(actually)f(required)f(for)i(ev)-5
+b(aluation,)31 b(e.g.)43 b("TR)m(UE)31 b(.or.)43 b(NULL")0
+3059 y(ev)-5 b(aluates)31 b(to)g(TR)m(UE.)g(The)f(follo)m(wing)e(t)m(w)
+m(o)k(functions)d(allo)m(w)h(some)h(NULL)f(detection)h(and)f(handling:)
+430 3302 y Fe("a)47 b(null)f(value?")667 b(ISNULL\(x\))430
+3415 y("define)45 b(a)j(value)e(for)h(null")190 b(DEFNULL\(x,y\))0
+3658 y Fi(The)36 b(former)h(returns)e(a)i(b)s(o)s(olean)f(v)-5
+b(alue)36 b(of)h(TR)m(UE)g(if)f(the)h(argumen)m(t)g(x)g(is)f(NULL.)h
+(The)f(later)h("de\014nes")g(a)0 3771 y(v)-5 b(alue)34
+b(to)h(b)s(e)e(substituted)g(for)h(NULL)g(v)-5 b(alues;)36
+b(it)e(returns)f(the)h(v)-5 b(alue)34 b(of)g(x)g(if)f(x)i(is)e(not)h
+(NULL,)h(otherwise)e(it)0 3884 y(returns)c(the)i(v)-5
+b(alue)30 b(of)g(y)-8 b(.)0 4172 y Fb(4.9.2)112 b(Bit)36
+b(Masks)0 4390 y Fi(Bit)f(masks)g(can)h(b)s(e)f(used)f(to)i(select)g
+(out)f(ro)m(ws)h(from)e(bit)h(columns)f(\(TF)m(ORMn)h(=)g(#X\))h(in)e
+(FITS)g(\014les.)54 b(T)-8 b(o)0 4503 y(represen)m(t)30
+b(the)h(mask,)g(binary)-8 b(,)29 b(o)s(ctal,)i(and)f(hex)g(formats)g
+(are)h(allo)m(w)m(ed:)811 4746 y Fe(binary:)142 b
+(b0110xx1010000101xxxx00)o(01)811 4859 y(octal:)190 b(o720x1)46
+b(->)h(\(b111010000xxx001\))811 4972 y(hex:)286 b(h0FxD)94
+b(->)47 b(\(b00001111xxxx1101\))0 5215 y Fi(In)22 b(all)g(the)h
+(represen)m(tations,)i(an)d(x)h(or)g(X)g(is)f(allo)m(w)m(ed)h(in)e(the)
+i(mask)g(as)g(a)h(wild)c(card.)38 b(Note)25 b(that)e(the)g(x)g
+(represen)m(ts)0 5328 y(a)k(di\013eren)m(t)g(n)m(um)m(b)s(er)f(of)h
+(wild)d(card)j(bits)f(in)g(eac)m(h)i(represen)m(tation.)40
+b(All)25 b(represen)m(tations)i(are)h(case)g(insensitiv)m(e.)0
+5488 y(T)-8 b(o)28 b(construct)g(the)g(b)s(o)s(olean)e(expression)h
+(using)f(the)i(mask)f(as)h(the)g(b)s(o)s(olean)e(equal)h(op)s(erator)h
+(describ)s(ed)e(ab)s(o)m(v)m(e)0 5601 y(on)34 b(a)h(bit)f(table)h
+(column.)52 b(F)-8 b(or)35 b(example,)h(if)d(y)m(ou)i(had)f(a)h(7)g
+(bit)f(column)f(named)h(\015ags)h(in)e(a)i(FITS)f(table)h(and)0
+5714 y(w)m(an)m(ted)c(all)e(ro)m(ws)i(ha)m(ving)f(the)g(bit)g(pattern)g
+(0010011,)k(the)c(selection)h(expression)e(w)m(ould)g(b)s(e:)p
 eop
 %%Page: 31 37
-31 36 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(31)811 555 y Fe(binary:)142 b(b0110xx1010000101xxxx00)o
-(01)811 668 y(octal:)190 b(o720x1)46 b(->)h(\(b111010000xxx001\))811
-781 y(hex:)286 b(h0FxD)94 b(->)47 b(\(b00001111xxxx1101\))0
-1045 y Fi(In)22 b(all)g(the)h(represen)m(tations,)i(an)d(x)h(or)g(X)g
-(is)f(allo)m(w)m(ed)h(in)e(the)i(mask)g(as)g(a)h(wild)c(card.)38
-b(Note)25 b(that)e(the)g(x)g(represen)m(ts)0 1158 y(a)k(di\013eren)m(t)
-g(n)m(um)m(b)s(er)f(of)h(wild)d(card)j(bits)f(in)g(eac)m(h)i(represen)m
-(tation.)40 b(All)25 b(represen)m(tations)i(are)h(case)g(insensitiv)m
-(e.)0 1318 y(T)-8 b(o)29 b(construct)g(the)g(b)s(o)s(olean)f
-(expression)f(using)g(the)i(mask)g(as)g(the)g(b)s(o)s(olean)e(equal)h
-(op)s(erator)h(discrib)s(ed)d(ab)s(o)m(v)m(e)0 1431 y(on)34
-b(a)h(bit)f(table)h(column.)52 b(F)-8 b(or)35 b(example,)h(if)d(y)m(ou)
-i(had)f(a)h(7)g(bit)f(column)f(named)h(\015ags)h(in)e(a)i(FITS)f(table)
-h(and)0 1544 y(w)m(an)m(ted)c(all)e(ro)m(ws)i(ha)m(ving)f(the)g(bit)g
-(pattern)g(0010011,)k(the)c(selection)h(expression)e(w)m(ould)g(b)s(e:)
-1336 1807 y Fe(flags)47 b(==)g(b0010011)191 1920 y(or)1336
-2033 y(flags)g(.eq.)f(b10011)0 2297 y Fi(It)35 b(is)f(also)h(p)s
-(ossible)d(to)k(test)g(if)e(a)h(range)g(of)g(bits)f(is)g(less)g(than,)i
-(less)e(than)h(equal,)h(greater)g(than)e(and)h(greater)0
-2410 y(than)30 b(equal)g(to)h(a)g(particular)e(b)s(o)s(olean)g(v)-5
-b(alue:)1336 2673 y Fe(flags)47 b(<=)g(bxxx010xx)1336
-2786 y(flags)g(.gt.)f(bxxx100xx)1336 2899 y(flags)h(.le.)f(b1xxxxxxx)0
-3163 y Fi(Notice)31 b(the)g(use)f(of)h(the)f(x)g(bit)g(v)-5
-b(alue)30 b(to)h(limit)d(the)i(range)h(of)g(bits)e(b)s(eing)g
-(compared.)0 3323 y(It)j(is)g(not)g(necessary)h(to)g(sp)s(ecify)e(the)i
-(leading)e(\(most)i(signi\014can)m(t\))f(zero)h(\(0\))g(bits)e(in)g
-(the)i(mask,)g(as)g(sho)m(wn)e(in)0 3436 y(the)g(second)f(expression)f
-(ab)s(o)m(v)m(e.)0 3596 y(Bit)43 b(wise)f(AND,)i(OR)e(and)g(NOT)h(op)s
-(erations)f(are)h(also)g(p)s(ossible)d(on)j(t)m(w)m(o)h(or)f(more)g
-(bit)f(\014elds)f(using)h(the)0 3709 y('&'\(AND\),)35
-b(')p Fc(j)p Fi('\(OR\),)g(and)e(the)h(')10 b(!'\(NOT\))34
-b(op)s(erators.)51 b(All)32 b(of)h(these)h(op)s(erators)g(result)e(in)h
-(a)h(bit)e(\014eld)g(whic)m(h)0 3822 y(can)f(then)f(b)s(e)f(used)h
-(with)f(the)i(equal)f(op)s(erator.)41 b(F)-8 b(or)31
-b(example:)1241 4085 y Fe(\(!flags\))45 b(==)j(b1101100)1241
-4198 y(\(flags)e(&)h(b1000001\))f(==)h(bx000001)0 4462
-y Fi(Bit)34 b(\014elds)f(can)h(b)s(e)f(app)s(ended)g(as)h(w)m(ell)f
-(using)g(the)h('+')g(op)s(erator.)53 b(Strings)32 b(can)j(b)s(e)e
-(concatenated)j(this)d(w)m(a)m(y)-8 b(,)0 4575 y(to)s(o.)0
-4735 y(In)30 b(addition,)e(sev)m(eral)j(constan)m(ts)h(are)f(built)d
-(in)h(for)h(use)g(in)f(n)m(umerical)g(expressions:)382
-4999 y Fe(#pi)667 b(3.1415...)284 b(#e)620 b(2.7182...)382
-5112 y(#deg)f(#pi/180)380 b(#row)524 b(current)46 b(row)h(number)382
-5224 y(#null)428 b(undefined)45 b(value)142 b(#snull)428
-b(undefined)45 b(string)0 5488 y Fi(A)40 b(string)e(constan)m(t)j(m)m
-(ust)e(b)s(e)g(enclosed)g(in)g(quotes)h(as)f(in)g('Crab'.)67
-b(The)39 b("n)m(ull")g(constan)m(ts)h(are)g(useful)e(for)0
-5601 y(conditionally)d(setting)j(table)g(v)-5 b(alues)37
-b(to)h(a)g(NULL,)g(or)g(unde\014ned,)f(v)-5 b(alue)38
-b(\(eg.,)j("col1==-99)e(?)62 b(#NULL)38 b(:)0 5714 y(col1"\).)p
-eop
-%%Page: 32 38
-32 37 bop 0 299 a Fi(32)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(V)g(ector)32
-b(Columns)0 715 y(V)-8 b(ector)37 b(columns)d(can)i(also)f(b)s(e)g
-(used)f(in)g(building)e(the)j(expression.)55 b(No)36
-b(sp)s(ecial)e(syn)m(tax)h(is)g(required)e(if)i(one)0
-828 y(w)m(an)m(ts)46 b(to)f(op)s(erate)h(on)f(all)f(elemen)m(ts)h(of)g
-(the)h(v)m(ector.)86 b(Simply)42 b(use)j(the)g(column)f(name)h(as)g
-(for)g(a)g(scalar)0 941 y(column.)c(V)-8 b(ector)32 b(columns)e(can)h
-(b)s(e)f(freely)g(in)m(termixed)g(with)f(scalar)i(columns)e(or)i
-(constan)m(ts)h(in)e(virtually)e(all)0 1054 y(expressions.)39
-b(The)29 b(result)f(will)e(b)s(e)j(of)g(the)g(same)h(dimension)c(as)k
-(the)f(v)m(ector.)42 b(Tw)m(o)29 b(v)m(ectors)i(in)d(an)h(expression,)0
-1167 y(though,)f(need)e(to)i(ha)m(v)m(e)g(the)f(same)g(n)m(um)m(b)s(er)
-f(of)h(elemen)m(ts)g(and)f(ha)m(v)m(e)j(the)e(same)g(dimensions.)37
-b(The)26 b(only)g(places)0 1280 y(a)35 b(v)m(ector)h(column)d(cannot)i
+31 36 bop 0 299 a Fg(4.9.)72 b(R)m(O)m(W)31 b(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)2072 b Fi(31)1336 555
+y Fe(flags)47 b(==)g(b0010011)191 668 y(or)1336 781 y(flags)g(.eq.)f
+(b10011)0 1051 y Fi(It)35 b(is)f(also)h(p)s(ossible)d(to)k(test)g(if)e
+(a)h(range)g(of)g(bits)f(is)g(less)g(than,)i(less)e(than)h(equal,)h
+(greater)g(than)e(and)h(greater)0 1164 y(than)30 b(equal)g(to)h(a)g
+(particular)e(b)s(o)s(olean)g(v)-5 b(alue:)1336 1435
+y Fe(flags)47 b(<=)g(bxxx010xx)1336 1548 y(flags)g(.gt.)f(bxxx100xx)
+1336 1661 y(flags)h(.le.)f(b1xxxxxxx)0 1931 y Fi(Notice)31
+b(the)g(use)f(of)h(the)f(x)g(bit)g(v)-5 b(alue)30 b(to)h(limit)d(the)i
+(range)h(of)g(bits)e(b)s(eing)g(compared.)0 2091 y(It)j(is)g(not)g
+(necessary)h(to)g(sp)s(ecify)e(the)i(leading)e(\(most)i(signi\014can)m
+(t\))f(zero)h(\(0\))g(bits)e(in)g(the)i(mask,)g(as)g(sho)m(wn)e(in)0
+2204 y(the)g(second)f(expression)f(ab)s(o)m(v)m(e.)0
+2364 y(Bit)43 b(wise)f(AND,)i(OR)e(and)g(NOT)h(op)s(erations)f(are)h
+(also)g(p)s(ossible)d(on)j(t)m(w)m(o)h(or)f(more)g(bit)f(\014elds)f
+(using)h(the)0 2477 y('&'\(AND\),)35 b(')p Fc(j)p Fi('\(OR\),)g(and)e
+(the)h(')10 b(!'\(NOT\))34 b(op)s(erators.)51 b(All)32
+b(of)h(these)h(op)s(erators)g(result)e(in)h(a)h(bit)e(\014eld)g(whic)m
+(h)0 2590 y(can)f(then)f(b)s(e)f(used)h(with)f(the)i(equal)f(op)s
+(erator.)41 b(F)-8 b(or)31 b(example:)1241 2860 y Fe(\(!flags\))45
+b(==)j(b1101100)1241 2973 y(\(flags)e(&)h(b1000001\))f(==)h(bx000001)0
+3244 y Fi(Bit)34 b(\014elds)f(can)h(b)s(e)f(app)s(ended)g(as)h(w)m(ell)
+f(using)g(the)h('+')g(op)s(erator.)53 b(Strings)32 b(can)j(b)s(e)e
+(concatenated)j(this)d(w)m(a)m(y)-8 b(,)0 3357 y(to)s(o.)0
+3660 y Fb(4.9.3)112 b(V)-9 b(ector)36 b(Columns)0 3881
+y Fi(V)-8 b(ector)37 b(columns)d(can)i(also)f(b)s(e)g(used)f(in)g
+(building)e(the)j(expression.)55 b(No)36 b(sp)s(ecial)e(syn)m(tax)h(is)
+g(required)e(if)i(one)0 3994 y(w)m(an)m(ts)46 b(to)f(op)s(erate)h(on)f
+(all)f(elemen)m(ts)h(of)g(the)h(v)m(ector.)86 b(Simply)42
+b(use)j(the)g(column)f(name)h(as)g(for)g(a)g(scalar)0
+4107 y(column.)c(V)-8 b(ector)32 b(columns)e(can)h(b)s(e)f(freely)g(in)
+m(termixed)g(with)f(scalar)i(columns)e(or)i(constan)m(ts)h(in)e
+(virtually)e(all)0 4220 y(expressions.)39 b(The)29 b(result)f(will)e(b)
+s(e)j(of)g(the)g(same)h(dimension)c(as)k(the)f(v)m(ector.)42
+b(Tw)m(o)29 b(v)m(ectors)i(in)d(an)h(expression,)0 4333
+y(though,)f(need)e(to)i(ha)m(v)m(e)g(the)f(same)g(n)m(um)m(b)s(er)f(of)
+h(elemen)m(ts)g(and)f(ha)m(v)m(e)j(the)e(same)g(dimensions.)37
+b(The)26 b(only)g(places)0 4446 y(a)35 b(v)m(ector)h(column)d(cannot)i
 (b)s(e)f(used)f(\(for)i(no)m(w,)g(an)m(yw)m(a)m(y\))h(are)f(the)g(SA)m
-(O)f(region)g(functions)f(and)g(the)i(NEAR)0 1393 y(b)s(o)s(olean)29
-b(function.)0 1553 y(Arithmetic)22 b(and)g(logical)h(op)s(erations)f
+(O)f(region)g(functions)f(and)g(the)i(NEAR)0 4559 y(b)s(o)s(olean)29
+b(function.)0 4719 y(Arithmetic)22 b(and)g(logical)h(op)s(erations)f
 (are)i(all)e(p)s(erformed)f(on)i(an)g(elemen)m(t)g(b)m(y)g(elemen)m(t)h
-(basis.)37 b(Comparing)22 b(t)m(w)m(o)0 1666 y(v)m(ector)32
+(basis.)37 b(Comparing)22 b(t)m(w)m(o)0 4832 y(v)m(ector)32
 b(columns,)d(eg)i("COL1)f(==)g(COL2",)g(th)m(us)g(results)f(in)g
 (another)h(v)m(ector)i(of)e(b)s(o)s(olean)g(v)-5 b(alues)29
-b(indicating)0 1779 y(whic)m(h)d(elemen)m(ts)j(of)e(the)h(t)m(w)m(o)i
-(v)m(ectors)f(are)f(equal.)39 b(Tw)m(o)28 b(functions)e(are)j(a)m(v)-5
-b(ailable)27 b(whic)m(h)f(op)s(erate)j(on)e(v)m(ectors:)0
-1892 y(SUM\(x\))j(and)f(NELEM\(x\).)41 b(The)29 b(former)g(literally)e
-(sums)h(all)g(the)i(elemen)m(ts)g(in)e(x,)i(returning)d(a)j(scalar)f(v)
--5 b(alue.)0 2005 y(If)27 b(x)h(is)f(a)h(b)s(o)s(olean)f(v)m(ector,)j
-(SUM)d(returns)g(the)h(n)m(um)m(b)s(er)e(of)i(TR)m(UE)g(elemen)m(ts.)40
-b(The)27 b(latter,)i(NELEM,)f(returns)0 2118 y(the)34
-b(n)m(um)m(b)s(er)e(of)h(elemen)m(ts)h(in)e(v)m(ector)j(x.)49
-b(\(NELEM)34 b(also)f(op)s(erates)h(on)f(bit)g(and)f(string)h(columns,)
-g(returning)0 2230 y(their)g(column)h(widths.\))51 b(As)34
-b(an)g(example,)h(to)h(test)f(whether)e(all)h(elemen)m(ts)g(of)h(t)m(w)
-m(o)h(v)m(ectors)f(satisfy)f(a)h(giv)m(en)0 2343 y(logical)30
-b(comparison,)g(one)g(can)h(use)f(the)h(expression)668
-2579 y Fe(SUM\()47 b(COL1)f(>)i(COL2)f(\))g(==)g(NELEM\()f(COL1)h(\))0
-2815 y Fi(whic)m(h)31 b(will)e(return)i(TR)m(UE)h(if)f(all)g(elemen)m
-(ts)h(of)g(COL1)g(are)g(greater)h(than)f(their)f(corresp)s(onding)f
-(elemen)m(ts)i(in)0 2928 y(COL2.)0 3088 y(T)-8 b(o)32
-b(sp)s(ecify)e(a)j(single)d(elemen)m(t)i(of)g(a)g(v)m(ector,)i(giv)m(e)
-e(the)g(column)e(name)i(follo)m(w)m(ed)f(b)m(y)h(a)g(comma-separated)h
-(list)0 3201 y(of)c(co)s(ordinates)f(enclosed)h(in)e(square)i(brac)m(k)
-m(ets.)41 b(F)-8 b(or)30 b(example,)f(if)e(a)i(v)m(ector)i(column)c
-(named)i(PHAS)f(exists)g(in)0 3314 y(the)f(table)f(as)h(a)g(one)g
-(dimensional,)e(256)j(comp)s(onen)m(t)f(list)e(of)i(n)m(um)m(b)s(ers)e
-(from)h(whic)m(h)g(y)m(ou)h(w)m(an)m(ted)g(to)g(select)h(the)0
-3427 y(57th)k(comp)s(onen)m(t)g(for)f(use)g(in)f(the)i(expression,)e
-(then)i(PHAS[57])g(w)m(ould)e(do)i(the)f(tric)m(k.)44
-b(Higher)31 b(dimensional)0 3540 y(arra)m(ys)41 b(of)h(data)f(ma)m(y)h
-(app)s(ear)f(in)e(a)j(column.)72 b(But)41 b(in)f(order)g(to)i(in)m
-(terpret)e(them,)k(the)e(TDIMn)e(k)m(eyw)m(ord)0 3653
-y(m)m(ust)34 b(app)s(ear)g(in)f(the)h(header.)52 b(Assuming)33
-b(that)i(a)f(\(4,4,4,4\))k(arra)m(y)c(is)g(pac)m(k)m(ed)h(in)m(to)f
-(eac)m(h)i(ro)m(w)e(of)g(a)h(column)0 3766 y(named)26
-b(ARRA)-8 b(Y4D,)28 b(the)f(\(1,2,3,4\))i(comp)s(onen)m(t)e(elemen)m(t)
-f(of)h(eac)m(h)g(ro)m(w)g(is)e(accessed)j(b)m(y)e(ARRA)-8
-b(Y4D[1,2,3,4].)0 3878 y(Arra)m(ys)33 b(up)e(to)j(dimension)c(5)j(are)f
-(curren)m(tly)g(supp)s(orted.)46 b(Eac)m(h)33 b(v)m(ector)h(index)d
-(can)i(itself)e(b)s(e)h(an)h(expression,)0 3991 y(although)38
-b(it)g(m)m(ust)h(ev)-5 b(aluate)39 b(to)g(an)g(in)m(teger)g(v)-5
-b(alue)38 b(within)e(the)j(b)s(ounds)d(of)j(the)g(v)m(ector.)67
-b(V)-8 b(ector)40 b(columns)0 4104 y(whic)m(h)30 b(con)m(tain)h(spaces)
-h(or)f(arithmetic)f(op)s(erators)i(m)m(ust)f(ha)m(v)m(e)h(their)e
-(names)h(enclosed)g(in)f("$")i(c)m(haracters)h(as)0 4217
-y(with)c($ARRA)-8 b(Y-4D$[1,2,3,4].)0 4377 y(A)45 b(more)f(C-lik)m(e)g
-(syn)m(tax)i(for)e(sp)s(ecifying)e(v)m(ector)47 b(indices)42
-b(is)i(also)h(a)m(v)-5 b(ailable.)82 b(The)45 b(elemen)m(t)g(used)e(in)
-h(the)0 4490 y(preceding)27 b(example)h(alternativ)m(ely)g(could)f(b)s
-(e)h(sp)s(eci\014ed)f(with)f(the)j(syn)m(tax)g(ARRA)-8
-b(Y4D[4][3][2][1].)45 b(Note)30 b(the)0 4603 y(rev)m(erse)40
-b(order)f(of)h(indices)d(\(as)j(in)e(C\),)i(as)f(w)m(ell)g(as)g(the)h
-(fact)g(that)g(the)g(v)-5 b(alues)39 b(are)g(still)f(ones-based)h(\(as)
-h(in)0 4716 y(F)-8 b(ortran)39 b({)g(adopted)g(to)g(a)m(v)m(oid)g(am)m
-(biguit)m(y)f(for)h(1D)g(v)m(ectors\).)67 b(With)38 b(this)g(syn)m
-(tax,)j(one)e(do)s(es)f(not)h(need)f(to)0 4829 y(sp)s(ecify)29
-b(all)g(of)i(the)f(indices.)39 b(T)-8 b(o)31 b(extract)h(a)f(3D)g
-(slice)e(of)i(this)e(4D)i(arra)m(y)-8 b(,)32 b(use)e(ARRA)-8
-b(Y4D[4].)0 4989 y(V)g(ariable-length)30 b(v)m(ector)i(columns)d(are)h
-(not)h(supp)s(orted.)0 5149 y(V)-8 b(ectors)24 b(can)e(b)s(e)f(man)m
-(ually)f(constructed)j(within)c(the)j(expression)f(using)f(a)i
-(comma-separated)i(list)d(of)h(elemen)m(ts)0 5262 y(surrounded)30
-b(b)m(y)i(curly)e(braces)j(\(''\).)47 b(F)-8 b(or)33
-b(example,)f('1,3,6,1')k(is)31 b(a)h(4-elemen)m(t)i(v)m(ector)g(con)m
-(taining)d(the)i(v)-5 b(alues)0 5375 y(1,)31 b(3,)g(6,)g(and)f(1.)41
-b(The)30 b(v)m(ector)i(can)f(con)m(tain)f(only)g(b)s(o)s(olean,)f(in)m
-(teger,)i(and)f(real)g(v)-5 b(alues)30 b(\(or)h(expressions\).)39
-b(The)0 5488 y(elemen)m(ts)f(will)d(b)s(e)h(promoted)i(to)g(the)g
-(highest)e(datat)m(yp)s(e)j(presen)m(t.)62 b(An)m(y)37
-b(elemen)m(ts)h(whic)m(h)e(are)i(themselv)m(es)0 5601
-y(v)m(ectors,)i(will)34 b(b)s(e)i(expanded)g(out)h(with)f(eac)m(h)h(of)
-g(its)f(elemen)m(ts)i(b)s(ecoming)d(an)i(elemen)m(t)g(in)f(the)h
-(constructed)0 5714 y(v)m(ector.)p eop
+b(indicating)0 4945 y(whic)m(h)g(elemen)m(ts)i(of)f(the)h(t)m(w)m(o)h
+(v)m(ectors)f(are)g(equal.)0 5105 y(Eigh)m(t)f(functions)f(are)i(a)m(v)
+-5 b(ailable)30 b(that)h(op)s(erate)g(on)f(a)h(v)m(ector)h(and)d
+(return)h(a)g(scalar)h(result:)191 5375 y Fe("minimum")284
+b(MIN\(V\))475 b("maximum")714 b(MAX\(V\))191 5488 y("average")284
+b(AVERAGE\(V\))f("median")762 b(MEDIAN\(V\))191 5601
+y("sumation")236 b(SUM\(V\))475 b("standard)46 b(deviation")188
+b(STDDEV\(V\))191 5714 y("#)47 b(of)g(values")94 b(NELEM\(V\))379
+b("#)48 b(of)f(non-null)e(values")94 b(NVALID\(V\))p
+eop
+%%Page: 32 38
+32 37 bop 0 299 a Fi(32)1618 b Fg(CHAPTER)30 b(4.)112
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(where)40
+b(V)h(represen)m(ts)g(the)g(name)g(of)h(a)f(v)m(ector)h(column)e(or)h
+(a)h(man)m(ually)d(constructed)i(v)m(ector)i(using)c(curly)0
+668 y(brac)m(k)m(ets)27 b(as)f(describ)s(ed)d(b)s(elo)m(w.)38
+b(The)25 b(\014rst)g(6)h(of)g(these)g(functions)e(ignore)h(an)m(y)h(n)m
+(ull)d(v)-5 b(alues)25 b(in)f(the)i(v)m(ector)h(when)0
+781 y(computing)i(the)i(result.)0 941 y(The)h(SUM)h(function)e
+(literally)g(sums)g(all)h(the)h(elemen)m(ts)g(in)f(x,)h(returning)e(a)i
+(scalar)g(v)-5 b(alue.)47 b(If)32 b(x)h(is)f(a)h(b)s(o)s(olean)0
+1054 y(v)m(ector,)40 b(SUM)c(returns)f(the)h(n)m(um)m(b)s(er)f(of)i(TR)
+m(UE)f(elemen)m(ts.)59 b(The)36 b(NELEM)g(function)f(returns)g(the)h(n)
+m(um)m(b)s(er)0 1167 y(of)i(elemen)m(ts)g(in)f(v)m(ector)i(x)f(whereas)
+f(NV)-10 b(ALID)39 b(return)d(the)i(n)m(um)m(b)s(er)f(of)h(non-n)m(ull)
+d(elemen)m(ts)k(in)d(the)i(v)m(ector.)0 1280 y(\(NELEM)28
+b(also)g(op)s(erates)g(on)g(bit)e(and)h(string)g(columns,)g(returning)f
+(their)h(column)f(widths.\))39 b(As)27 b(an)h(example,)0
+1393 y(to)42 b(test)g(whether)f(all)f(elemen)m(ts)i(of)g(t)m(w)m(o)g(v)
+m(ectors)h(satisfy)e(a)h(giv)m(en)f(logical)g(comparison,)i(one)f(can)g
+(use)f(the)0 1506 y(expression)668 1781 y Fe(SUM\()47
+b(COL1)f(>)i(COL2)f(\))g(==)g(NELEM\()f(COL1)h(\))0 2057
+y Fi(whic)m(h)31 b(will)e(return)i(TR)m(UE)h(if)f(all)g(elemen)m(ts)h
+(of)g(COL1)g(are)g(greater)h(than)f(their)f(corresp)s(onding)f(elemen)m
+(ts)i(in)0 2170 y(COL2.)0 2330 y(T)-8 b(o)32 b(sp)s(ecify)e(a)j(single)
+d(elemen)m(t)i(of)g(a)g(v)m(ector,)i(giv)m(e)e(the)g(column)e(name)i
+(follo)m(w)m(ed)f(b)m(y)h(a)g(comma-separated)h(list)0
+2443 y(of)c(co)s(ordinates)f(enclosed)h(in)e(square)i(brac)m(k)m(ets.)
+41 b(F)-8 b(or)30 b(example,)f(if)e(a)i(v)m(ector)i(column)c(named)i
+(PHAS)f(exists)g(in)0 2556 y(the)f(table)f(as)h(a)g(one)g(dimensional,)
+e(256)j(comp)s(onen)m(t)f(list)e(of)i(n)m(um)m(b)s(ers)e(from)h(whic)m
+(h)g(y)m(ou)h(w)m(an)m(ted)g(to)g(select)h(the)0 2669
+y(57th)k(comp)s(onen)m(t)g(for)f(use)g(in)f(the)i(expression,)e(then)i
+(PHAS[57])g(w)m(ould)e(do)i(the)f(tric)m(k.)44 b(Higher)31
+b(dimensional)0 2782 y(arra)m(ys)41 b(of)h(data)f(ma)m(y)h(app)s(ear)f
+(in)e(a)j(column.)72 b(But)41 b(in)f(order)g(to)i(in)m(terpret)e(them,)
+k(the)e(TDIMn)e(k)m(eyw)m(ord)0 2895 y(m)m(ust)34 b(app)s(ear)g(in)f
+(the)h(header.)52 b(Assuming)33 b(that)i(a)f(\(4,4,4,4\))k(arra)m(y)c
+(is)g(pac)m(k)m(ed)h(in)m(to)f(eac)m(h)i(ro)m(w)e(of)g(a)h(column)0
+3008 y(named)26 b(ARRA)-8 b(Y4D,)28 b(the)f(\(1,2,3,4\))i(comp)s(onen)m
+(t)e(elemen)m(t)f(of)h(eac)m(h)g(ro)m(w)g(is)e(accessed)j(b)m(y)e(ARRA)
+-8 b(Y4D[1,2,3,4].)0 3121 y(Arra)m(ys)33 b(up)e(to)j(dimension)c(5)j
+(are)f(curren)m(tly)g(supp)s(orted.)46 b(Eac)m(h)33 b(v)m(ector)h
+(index)d(can)i(itself)e(b)s(e)h(an)h(expression,)0 3233
+y(although)38 b(it)g(m)m(ust)h(ev)-5 b(aluate)39 b(to)g(an)g(in)m
+(teger)g(v)-5 b(alue)38 b(within)e(the)j(b)s(ounds)d(of)j(the)g(v)m
+(ector.)67 b(V)-8 b(ector)40 b(columns)0 3346 y(whic)m(h)30
+b(con)m(tain)h(spaces)h(or)f(arithmetic)f(op)s(erators)i(m)m(ust)f(ha)m
+(v)m(e)h(their)e(names)h(enclosed)g(in)f("$")i(c)m(haracters)h(as)0
+3459 y(with)c($ARRA)-8 b(Y-4D$[1,2,3,4].)0 3619 y(A)45
+b(more)f(C-lik)m(e)g(syn)m(tax)i(for)e(sp)s(ecifying)e(v)m(ector)47
+b(indices)42 b(is)i(also)h(a)m(v)-5 b(ailable.)82 b(The)45
+b(elemen)m(t)g(used)e(in)h(the)0 3732 y(preceding)27
+b(example)h(alternativ)m(ely)g(could)f(b)s(e)h(sp)s(eci\014ed)f(with)f
+(the)j(syn)m(tax)g(ARRA)-8 b(Y4D[4][3][2][1].)45 b(Note)30
+b(the)0 3845 y(rev)m(erse)40 b(order)f(of)h(indices)d(\(as)j(in)e(C\),)
+i(as)f(w)m(ell)g(as)g(the)h(fact)g(that)g(the)g(v)-5
+b(alues)39 b(are)g(still)f(ones-based)h(\(as)h(in)0 3958
+y(F)-8 b(ortran)39 b({)g(adopted)g(to)g(a)m(v)m(oid)g(am)m(biguit)m(y)f
+(for)h(1D)g(v)m(ectors\).)67 b(With)38 b(this)g(syn)m(tax,)j(one)e(do)s
+(es)f(not)h(need)f(to)0 4071 y(sp)s(ecify)29 b(all)g(of)i(the)f
+(indices.)39 b(T)-8 b(o)31 b(extract)h(a)f(3D)g(slice)e(of)i(this)e(4D)
+i(arra)m(y)-8 b(,)32 b(use)e(ARRA)-8 b(Y4D[4].)0 4231
+y(V)g(ariable-length)30 b(v)m(ector)i(columns)d(are)h(not)h(supp)s
+(orted.)0 4391 y(V)-8 b(ectors)24 b(can)e(b)s(e)f(man)m(ually)f
+(constructed)j(within)c(the)j(expression)f(using)f(a)i(comma-separated)
+i(list)d(of)h(elemen)m(ts)0 4504 y(surrounded)35 b(b)m(y)j(curly)f
+(braces)i(\(')p Fc(fg)p Fi('\).)66 b(F)-8 b(or)38 b(example,)i(')p
+Fc(f)p Fi(1,3,6,1)p Fc(g)p Fi(')i(is)c(a)g(4-elemen)m(t)h(v)m(ector)h
+(con)m(taining)e(the)0 4617 y(v)-5 b(alues)25 b(1,)i(3,)g(6,)g(and)e
+(1.)40 b(The)25 b(v)m(ector)i(can)f(con)m(tain)g(only)f(b)s(o)s(olean,)
+g(in)m(teger,)j(and)d(real)g(v)-5 b(alues)25 b(\(or)h(expressions\).)0
+4730 y(The)e(elemen)m(ts)g(will)e(b)s(e)i(promoted)g(to)h(the)g
+(highest)e(datat)m(yp)s(e)i(presen)m(t.)39 b(An)m(y)24
+b(elemen)m(ts)h(whic)m(h)e(are)i(themselv)m(es)0 4843
+y(v)m(ectors,)40 b(will)34 b(b)s(e)i(expanded)g(out)h(with)f(eac)m(h)h
+(of)g(its)f(elemen)m(ts)i(b)s(ecoming)d(an)i(elemen)m(t)g(in)f(the)h
+(constructed)0 4956 y(v)m(ector.)0 5265 y Fb(4.9.4)112
+b(Go)s(o)s(d)38 b(Time)e(In)m(terv)-6 b(al)37 b(Filtering)0
+5488 y Fi(A)44 b(common)g(\014ltering)f(metho)s(d)g(in)m(v)m(olv)m(es)h
+(selecting)g(ro)m(ws)g(whic)m(h)e(ha)m(v)m(e)k(a)e(time)g(v)-5
+b(alue)43 b(whic)m(h)g(lies)f(within)0 5601 y(what)37
+b(is)f(called)h(a)h(Go)s(o)s(d)f(Time)f(In)m(terv)-5
+b(al)37 b(or)g(GTI.)g(The)g(time)g(in)m(terv)-5 b(als)36
+b(are)i(de\014ned)e(in)g(a)h(separate)i(FITS)0 5714 y(table)h
+(extension)g(whic)m(h)e(con)m(tains)i(2)h(columns)e(giving)f(the)j
+(start)f(and)g(stop)g(time)f(of)h(eac)m(h)i(go)s(o)s(d)e(in)m(terv)-5
+b(al.)p eop
 %%Page: 33 39
-33 38 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(33)0 555 y(A)44 b(common)h(\014ltering)d(metho)s(d)i
-(applied)e(to)j(FITS)e(\014les)h(is)f(a)h(time)g(\014lter)g(using)e(a)j
-(Go)s(o)s(d)f(Time)f(In)m(terv)-5 b(al)0 668 y(\(GTI\))36
-b(extension.)57 b(A)36 b(high-lev)m(el)e(function,)i
-(gti\014lter\(a,b,c,d\),)i(is)d(a)m(v)-5 b(ailable)35
-b(whic)m(h)f(p)s(erforms)h(this)f(sp)s(ecial)0 781 y(ev)-5
-b(aluation,)30 b(returning)f(a)h(b)s(o)s(olean)g(result)f(for)h(eac)m
-(h)i(time)e(elemen)m(t)h(tested.)41 b(Its)31 b(syn)m(tax)f(is)334
-1046 y Fe(gtifilter\()45 b([)j("filename")d([,)i(expr)f([,)i
-("STARTCOL",)c("STOPCOL")i(])h(])g(])h(\))0 1311 y Fi(where)32
-b(eac)m(h)h("[]")h(demarks)e(optional)f(parameters.)47
-b(The)32 b(\014lename,)g(if)f(sp)s(eci\014ed,)g(can)i(b)s(e)e(blank)g
-(\(""\))j(whic)m(h)0 1424 y(will)d(mean)j(to)g(use)g(the)g(\014rst)f
-(extension)g(with)g(the)h(name)f("*GTI*")j(in)c(the)i(curren)m(t)g
-(\014le,)g(a)g(plain)d(extension)0 1537 y(sp)s(eci\014er)d(\(eg,)k
-("+2",)f("[2]",)h(or)e("[STDGTI]"\))h(whic)m(h)e(will)e(b)s(e)i(used)h
-(to)g(select)h(an)f(extension)f(in)g(the)h(curren)m(t)0
-1650 y(\014le,)f(or)h(a)g(regular)f(\014lename)g(with)g(or)h(without)e
-(an)i(extension)g(sp)s(eci\014er)e(whic)m(h)g(in)h(the)h(latter)g(case)
-h(will)c(mean)0 1763 y(to)f(use)f(the)h(\014rst)f(extension)g(with)f
-(an)h(extension)g(name)h("*GTI*".)41 b(Expr)24 b(can)i(b)s(e)e(an)m(y)i
-(arithmetic)f(expression,)0 1876 y(including)31 b(simply)h(the)i(time)h
-(column)e(name.)53 b(A)34 b(v)m(ector)i(time)e(expression)f(will)f(pro)
-s(duce)h(a)i(v)m(ector)h(b)s(o)s(olean)0 1989 y(result.)75
-b(ST)-8 b(AR)g(TCOL)41 b(and)h(STOPCOL)e(are)j(the)f(names)g(of)g(the)h
-(ST)-8 b(AR)g(T/STOP)41 b(columns)g(in)g(the)h(GTI)0
-2102 y(extension.)54 b(If)34 b(one)h(of)g(them)g(is)f(sp)s(eci\014ed,)h
-(they)g(b)s(oth)f(m)m(ust)h(b)s(e.)53 b(Note)36 b(that)g(the)f(quotes)g
-(surrounding)d(the)0 2214 y(\014lename)e(and)f(ST)-8
-b(AR)g(T/STOP)30 b(column)f(names)h(are)h(required.)0
-2375 y(In)21 b(its)g(simplest)f(form,)k(no)d(parameters)h(need)g(to)h
-(b)s(e)e(pro)m(vided)f({)i(default)f(v)-5 b(alues)21
-b(will)f(b)s(e)h(used.)37 b(The)21 b(expression)0 2487
-y("gti\014lter\(\)")31 b(is)f(equiv)-5 b(alen)m(t)29
-b(to)334 2753 y Fe(gtifilter\()45 b("",)i(TIME,)f("*START*",)f
-("*STOP*")h(\))0 3018 y Fi(This)30 b(will)e(searc)m(h)k(the)g(curren)m
+33 38 bop 0 299 a Fg(4.9.)72 b(R)m(O)m(W)31 b(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)2072 b Fi(33)0 555
+y(The)34 b(\014ltering)f(op)s(eration)i(accepts)h(only)d(those)j(ro)m
+(ws)e(of)h(the)g(input)e(table)i(whic)m(h)e(ha)m(v)m(e)j(an)f(asso)s
+(ciated)g(time)0 668 y(whic)m(h)f(falls)h(within)e(one)j(of)g(the)g
+(time)f(in)m(terv)-5 b(als)35 b(de\014ned)g(in)f(the)i(GTI)g
+(extension.)56 b(A)36 b(high)f(lev)m(el)g(function,)0
+781 y(gti\014lter\(a,b,c,d\),)42 b(is)d(a)m(v)-5 b(ailable)39
+b(whic)m(h)f(ev)-5 b(aluates)40 b(eac)m(h)h(ro)m(w)e(of)h(the)f(input)f
+(table)h(and)g(returns)f(TR)m(UE)i(or)0 894 y(F)-10 b(ALSE)30
+b(dep)s(ending)e(whether)i(the)g(ro)m(w)h(is)e(inside)f(or)i(outside)g
+(the)h(go)s(o)s(d)f(time)g(in)m(terv)-5 b(al.)40 b(The)30
+b(syn)m(tax)h(is)286 1153 y Fe(gtifilter\()45 b([)j("gtifile")d([,)i
+(expr)g([,)g("STARTCOL",)e("STOPCOL")g(])j(])f(])g(\))0
+1412 y Fi(where)20 b(eac)m(h)h("[]")h(demarks)e(optional)f(parameters.)
+38 b(Note)21 b(that)g(the)g(quotes)f(around)g(the)g(gti\014le)g(and)f
+(ST)-8 b(AR)g(T/STOP)0 1525 y(column)32 b(are)h(required.)47
+b(Either)31 b(single)h(or)h(double)e(quotes)j(ma)m(y)f(b)s(e)g(used.)47
+b(The)32 b(gti\014le,)h(if)f(sp)s(eci\014ed,)g(can)i(b)s(e)0
+1638 y(blank)28 b(\(""\))j(whic)m(h)e(will)d(mean)k(to)g(use)g(the)f
+(\014rst)g(extension)g(with)g(the)g(name)h("*GTI*")h(in)d(the)i(curren)
+m(t)f(\014le,)h(a)0 1750 y(plain)24 b(extension)i(sp)s(eci\014er)f
+(\(eg,)k("+2",)f("[2]",)i(or)c("[STDGTI]"\))h(whic)m(h)f(will)d(b)s(e)j
+(used)g(to)h(select)g(an)f(extension)0 1863 y(in)k(the)i(curren)m(t)f
+(\014le,)g(or)g(a)h(regular)f(\014lename)f(with)h(or)g(without)f(an)i
+(extension)f(sp)s(eci\014er)f(whic)m(h)g(in)g(the)i(latter)0
+1976 y(case)e(will)c(mean)j(to)g(use)g(the)f(\014rst)g(extension)h
+(with)e(an)i(extension)f(name)h("*GTI*".)42 b(Expr)27
+b(can)i(b)s(e)f(an)m(y)i(arith-)0 2089 y(metic)e(expression,)f
+(including)d(simply)h(the)j(time)g(column)e(name.)40
+b(A)28 b(v)m(ector)h(time)f(expression)e(will)f(pro)s(duce)i(a)0
+2202 y(v)m(ector)34 b(b)s(o)s(olean)e(result.)45 b(ST)-8
+b(AR)g(TCOL)32 b(and)g(STOPCOL)e(are)j(the)f(names)h(of)f(the)h(ST)-8
+b(AR)g(T/STOP)31 b(columns)0 2315 y(in)e(the)i(GTI)f(extension.)40
+b(If)30 b(one)h(of)f(them)h(is)e(sp)s(eci\014ed,)g(they)h(b)s(oth)g(m)m
+(ust)g(b)s(e.)0 2475 y(In)21 b(its)g(simplest)f(form,)k(no)d
+(parameters)h(need)g(to)h(b)s(e)e(pro)m(vided)f({)i(default)f(v)-5
+b(alues)21 b(will)f(b)s(e)h(used.)37 b(The)21 b(expression)0
+2588 y("gti\014lter\(\)")31 b(is)f(equiv)-5 b(alen)m(t)29
+b(to)334 2847 y Fe(gtifilter\()45 b("",)i(TIME,)f("*START*",)f
+("*STOP*")h(\))0 3106 y Fi(This)30 b(will)e(searc)m(h)k(the)g(curren)m
 (t)f(\014le)f(for)h(a)h(GTI)f(extension,)g(\014lter)g(the)g(TIME)g
-(column)f(in)g(the)i(curren)m(t)f(table,)0 3131 y(using)i(ST)-8
+(column)f(in)g(the)i(curren)m(t)f(table,)0 3219 y(using)i(ST)-8
 b(AR)g(T/STOP)34 b(times)h(tak)m(en)g(from)g(columns)e(in)h(the)h(GTI)g
-(extension)f(with)g(names)g(con)m(taining)h(the)0 3243
+(extension)f(with)g(names)g(con)m(taining)h(the)0 3332
 y(strings)c("ST)-8 b(AR)g(T")33 b(and)e("STOP".)46 b(The)32
 b(wildcards)d(\('*'\))34 b(allo)m(w)e(sligh)m(t)f(v)-5
 b(ariations)31 b(in)g(naming)g(con)m(v)m(en)m(tions)0
-3356 y(suc)m(h)38 b(as)g("TST)-8 b(AR)g(T")39 b(or)f("ST)-8
+3445 y(suc)m(h)38 b(as)g("TST)-8 b(AR)g(T")39 b(or)f("ST)-8
 b(AR)g(TTIME".)65 b(The)37 b(same)i(default)f(v)-5 b(alues)37
-b(apply)g(for)h(unsp)s(eci\014ed)e(parame-)0 3469 y(ters)g(when)f(the)h
+b(apply)g(for)h(unsp)s(eci\014ed)e(parame-)0 3558 y(ters)g(when)f(the)h
 (\014rst)f(one)i(or)f(t)m(w)m(o)h(parameters)f(are)h(sp)s(eci\014ed.)55
 b(The)36 b(function)e(automatically)i(searc)m(hes)h(for)0
-3582 y(TIMEZER)m(O/I/F)g(k)m(eyw)m(ords)f(in)f(the)i(curren)m(t)f(and)g
+3670 y(TIMEZER)m(O/I/F)g(k)m(eyw)m(ords)f(in)f(the)i(curren)m(t)f(and)g
 (GTI)g(extensions,)h(applying)e(a)h(relativ)m(e)h(time)f(o\013set,)j
-(if)0 3695 y(necessary)-8 b(.)0 3855 y(Another)31 b(common)h
-(\014ltering)d(metho)s(d)i(is)g(a)g(spatial)g(\014lter)f(using)g(a)i
-(SA)m(O-)f(st)m(yle)h(region)f(\014le.)42 b(The)31 b(syn)m(tax)h(for)0
-3968 y(this)d(high-lev)m(el)g(\014lter)h(is)334 4233
-y Fe(regfilter\()45 b("regfilename")f([)k(,)f(Xexpr,)f(Yexpr)h([)g(,)h
-("wcs)e(cols")h(])g(])g(\))0 4498 y Fi(The)32 b(region)g(\014le)f(name)
-h(is)g(required,)f(but)g(the)i(rest)f(is)g(optional.)45
-b(Without)32 b(an)m(y)h(explicit)e(expression)g(for)h(the)0
-4611 y(X)k(and)f(Y)h(co)s(ordinates)f(\(in)g(pixels\),)g(the)h
-(\014lter)f(will)e(searc)m(h)j(for)g(and)f(op)s(erate)h(on)g(columns)e
-("X")j(and)e("Y".)0 4724 y(If)j(the)g(region)f(\014le)g(is)g(in)g
-("degrees")j(format)e(instead)f(of)h("pixels")f(\("hhmmss")h(format)g
-(is)f(not)i(supp)s(orted,)0 4837 y(y)m(et\),)33 b(the)e(\014lter)f
-(will)e(need)i(W)m(CS)h(information)f(to)h(con)m(v)m(ert)i(the)e
-(region)f(co)s(ordinates)h(to)g(pixels.)41 b(If)30 b(supplied,)0
-4950 y(the)g(\014nal)e(parameter)i(string)f(con)m(tains)h(the)g(names)f
-(of)h(the)g(2)g(columns)e(\(space)j(or)e(comma)i(separated\))f(whic)m
-(h)0 5063 y(con)m(tain)g(the)g(desired)e(W)m(CS)i(information.)38
-b(If)30 b(not)g(supplied,)c(the)k(\014lter)f(will)e(scan)j(the)g(X)f
-(and)h(Y)f(expressions)0 5176 y(for)h(column)f(names.)40
-b(If)30 b(only)f(one)i(is)e(found)g(in)f(eac)m(h)k(expression,)d(those)
-h(columns)f(will)f(b)s(e)h(used.)40 b(Otherwise,)0 5289
-y(an)30 b(error)g(will)e(b)s(e)i(returned.)0 5449 y(The)g(region)g
-(shap)s(es)f(supp)s(orted)g(are)i(\(names)f(are)h(case)g(insensitiv)m
-(e\):)334 5714 y Fe(Point)428 b(\()48 b(X1,)f(Y1)g(\))715
-b(<-)48 b(One)f(pixel)f(square)g(region)p eop
+(if)0 3783 y(necessary)-8 b(.)0 4074 y Fb(4.9.5)112 b(Spatial)37
+b(Region)g(Filtering)0 4293 y Fi(Another)h(common)g(\014ltering)e
+(metho)s(d)h(selects)h(ro)m(ws)g(based)g(on)f(whether)h(the)g(spatial)f
+(p)s(osition)e(asso)s(ciated)0 4406 y(with)c(eac)m(h)j(ro)m(w)e(is)g
+(lo)s(cated)h(within)d(a)j(giv)m(en)f(2-dimensional)e(region.)47
+b(The)32 b(syn)m(tax)h(for)f(this)g(high-lev)m(el)f(\014lter)0
+4519 y(is)334 4778 y Fe(regfilter\()45 b("regfilename")f([)k(,)f
+(Xexpr,)f(Yexpr)h([)g(,)h("wcs)e(cols")h(])g(])g(\))0
+5036 y Fi(where)22 b(eac)m(h)i("[]")g(demarks)e(optional)g(parameters.)
+38 b(The)22 b(region)g(\014le)g(name)g(is)g(required)f(and)h(m)m(ust)g
+(b)s(e)g(enclosed)0 5149 y(in)38 b(quotes.)70 b(The)39
+b(remaining)f(parameters)i(are)g(optional.)68 b(The)39
+b(region)g(\014le)g(is)g(an)g(ASCI)s(I)g(text)h(\014le)f(whic)m(h)0
+5262 y(con)m(tains)30 b(a)f(list)f(of)i(one)f(or)h(more)f(geometric)i
+(shap)s(es)d(\(circle,)i(ellipse,)d(b)s(o)m(x,)j(etc.\))42
+b(whic)m(h)28 b(de\014nes)g(a)i(region)f(on)0 5375 y(the)i(celestial)f
+(sphere)g(or)h(an)g(area)g(within)d(a)j(particular)f(2D)h(image.)42
+b(The)30 b(region)h(\014le)f(is)f(t)m(ypically)h(generated)0
+5488 y(using)21 b(an)i(image)g(displa)m(y)e(program)i(suc)m(h)f(as)h
+(fv/PO)m(W)h(\(distribute)c(b)m(y)j(the)g(HEASAR)m(C\),)g(or)g(ds9)g
+(\(distributed)0 5601 y(b)m(y)k(the)g(Smithsonian)d(Astroph)m(ysical)i
+(Observ)-5 b(atory\).)39 b(Users)27 b(should)e(refer)h(to)i(the)f(do)s
+(cumen)m(tation)f(pro)m(vided)0 5714 y(with)j(these)i(programs)f(for)g
+(more)h(details)e(on)h(the)h(syn)m(tax)g(used)e(in)g(the)i(region)f
+(\014les.)p eop
 %%Page: 34 40
 34 39 bop 0 299 a Fi(34)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)334 555 y
-Fe(Line)476 b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2)i(\))333 b(<-)48
-b(One)f(pixel)f(wide)h(region)334 668 y(Polygon)332 b(\()48
-b(X1,)f(Y1,)g(X2,)f(Y2,)h(...)g(\))95 b(<-)48 b(Rest)e(are)h(interiors)
-e(with)334 781 y(Rectangle)236 b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2,)h(A)h
-(\))334 b(|)47 b(boundaries)e(considered)334 894 y(Box)524
-b(\()48 b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)i(\))143 b(V)47
-b(within)f(the)h(region)334 1007 y(Diamond)332 b(\()48
-b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)i(\))334 1120 y(Circle)380
-b(\()48 b(Xc,)f(Yc,)g(R)g(\))334 1233 y(Annulus)332 b(\()48
-b(Xc,)f(Yc,)g(Rin,)f(Rout)h(\))334 1346 y(Ellipse)332
-b(\()48 b(Xc,)f(Yc,)g(Rx,)f(Ry,)h(A)h(\))334 1458 y(Elliptannulus)c(\()
-k(Xc,)f(Yc,)g(Rinx,)f(Riny,)g(Routx,)g(Routy,)g(Ain,)h(Aout)g(\))334
-1571 y(Sector)380 b(\()48 b(Xc,)f(Yc,)g(Amin,)f(Amax)h(\))0
-1845 y Fi(where)28 b(\(Xc,Yc\))j(is)c(the)i(co)s(ordinate)g(of)f(the)h
-(shap)s(e's)f(cen)m(ter;)j(\(X#,Y#\))e(are)g(the)g(co)s(ordinates)f(of)
-h(the)g(shap)s(e's)0 1958 y(edges;)39 b(Rxxx)c(are)g(the)h(shap)s(es')f
-(v)-5 b(arious)34 b(Radii)g(or)h(semima)5 b(jor/minor)34
-b(axes;)k(and)d(Axxx)g(are)h(the)g(angles)f(of)0 2071
-y(rotation)d(\(or)f(b)s(ounding)e(angles)i(for)g(Sector\))h(in)e
-(degrees.)44 b(F)-8 b(or)32 b(rotated)h(shap)s(es,)e(the)g(rotation)h
-(angle)f(can)h(b)s(e)0 2184 y(left)f(o\013,)i(indicating)c(no)i
-(rotation.)45 b(Common)31 b(alternate)h(names)f(for)h(the)f(regions)g
-(can)h(also)g(b)s(e)e(used:)43 b(rotb)s(o)m(x)0 2297
-y(==)31 b(b)s(o)m(x;)h(rotrectangle)g(==)f(rectangle;)i(\(rot\)rhom)m
-(bus)e(==)f(\(rot\)diamond;)i(and)f(pie)f(==)h(sector.)44
-b(When)32 b(a)0 2410 y(shap)s(e's)h(name)g(is)f(preceded)h(b)m(y)g(a)h
-(min)m(us)e(sign,)h('-',)i(the)f(de\014ned)e(region)h(is)f(instead)g
-(the)i(area)g(*outside*)g(its)0 2523 y(b)s(oundary)26
-b(\(ie,)j(the)g(region)f(is)g(in)m(v)m(erted\).)40 b(All)27
-b(the)i(shap)s(es)e(within)f(a)j(single)e(region)h(\014le)g(are)h
-(AND'd)f(together)0 2636 y(to)j(create)h(the)f(region.)0
-2796 y(F)-8 b(or)29 b(complex)f(or)g(commonly)f(used)g(\014lters,)h
-(one)g(can)h(also)f(place)g(the)g(expression)f(in)m(to)h(a)g(text)h
-(\014le)e(and)h(imp)s(ort)0 2909 y(it)i(in)m(to)h(the)f(ro)m(w)h
-(\014lter)f(using)f(the)h(syn)m(tax)h('[@\014lename.txt]'.)42
-b(The)30 b(expression)g(can)h(b)s(e)e(arbitrarily)f(complex)0
-3022 y(and)i(extend)g(o)m(v)m(er)i(m)m(ultiple)c(lines)h(of)h(the)h
-(\014le.)0 3182 y(EXAMPLES:)191 3456 y Fe([)47 b(binary)f(&&)i(mag)f
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(In)44
+b(its)g(simpliest)e(form,)47 b(\(e.g.,)j(reg\014lter\("region.reg"\))c
+(\))f(the)g(co)s(ordinates)f(in)f(the)i(default)e('X')i(and)f('Y')0
+668 y(columns)32 b(will)e(b)s(e)i(used)g(to)i(determine)e(if)f(eac)m(h)
+j(ro)m(w)f(is)f(inside)f(or)i(outside)f(the)h(area)h(sp)s(eci\014ed)d
+(in)g(the)i(region)0 781 y(\014le.)40 b(Alternate)31
+b(p)s(osition)d(column)h(names,)i(or)f(expressions,)f(ma)m(y)i(b)s(e)f
+(en)m(tered)h(if)e(needed,)i(as)f(in)382 1039 y Fe
+(regfilter\("region.reg",)41 b(XPOS,)47 b(YPOS\))0 1297
+y Fi(Region)36 b(\014ltering)e(can)i(b)s(e)f(applied)e(most)j(unam)m
+(biguously)d(if)i(the)h(p)s(ositions)e(in)g(the)i(region)f(\014le)g
+(and)g(in)g(the)0 1410 y(table)g(to)h(b)s(e)e(\014ltered)g(are)i(b)s
+(oth)e(giv)m(e)i(in)e(terms)h(of)g(absolute)g(celestial)g(co)s
+(ordinate)g(units.)53 b(In)35 b(this)f(case)i(the)0 1523
+y(lo)s(cations)24 b(and)f(sizes)h(of)h(the)f(geometric)h(shap)s(es)f
+(in)f(the)h(region)g(\014le)f(are)i(sp)s(eci\014ed)e(in)g(angular)g
+(units)g(on)h(the)g(sky)0 1636 y(\(e.g.,)32 b(p)s(ositions)c(giv)m(en)j
+(in)e(R.A.)h(and)g(Dec.)42 b(and)30 b(sizes)g(in)f(arcseconds)h(or)h
+(arcmin)m(utes\).)40 b(Similarly)-8 b(,)27 b(eac)m(h)32
+b(ro)m(w)0 1749 y(of)h(the)h(\014ltered)e(table)h(will)d(ha)m(v)m(e)35
+b(a)e(celestial)g(co)s(ordinate)g(asso)s(ciated)g(with)f(it.)49
+b(This)31 b(asso)s(ciation)i(is)f(usually)0 1862 y(implemen)m(ted)37
+b(using)f(a)j(set)g(of)f(so-called)g('W)-8 b(orld)38
+b(Co)s(ordinate)g(System')g(\(or)h(W)m(CS\))f(FITS)g(k)m(eyw)m(ords)g
+(that)0 1975 y(de\014ne)27 b(the)g(co)s(ordinate)g(transformation)g
+(that)h(m)m(ust)f(b)s(e)f(applied)f(to)j(the)g(v)-5 b(alues)26
+b(in)g(the)i('X')g(and)e('Y')i(columns)0 2088 y(to)j(calculate)g(the)f
+(co)s(ordinate.)0 2248 y(Alternativ)m(ely)-8 b(,)27 b(one)g(can)g(p)s
+(erform)e(spatial)h(\014ltering)e(using)h(unitless)g('pixel')g(co)s
+(ordinates)i(for)f(the)h(regions)f(and)0 2361 y(ro)m(w)33
+b(p)s(ositions.)47 b(In)33 b(this)f(case)i(the)f(user)g(m)m(ust)g(b)s
+(e)f(careful)g(to)i(ensure)f(that)g(the)h(p)s(ositions)d(in)h(the)h(2)g
+(\014les)g(are)0 2474 y(self-consisten)m(t.)52 b(A)34
+b(t)m(ypical)g(problem)e(is)h(that)i(the)f(region)g(\014le)f(ma)m(y)i
+(b)s(e)e(generated)j(using)c(a)j(binned)c(image,)0 2587
+y(but)h(the)h(un)m(binned)d(co)s(ordinates)i(are)h(giv)m(en)g(in)e(the)
+i(ev)m(en)m(t)i(table.)47 b(The)32 b(R)m(OSA)-8 b(T)33
+b(ev)m(en)m(ts)h(\014les,)f(for)f(example,)0 2700 y(ha)m(v)m(e)f(X)f
+(and)f(Y)g(pixel)f(co)s(ordinates)h(that)i(range)f(from)f(1)h(-)g
+(15360.)42 b(These)30 b(co)s(ordinates)f(are)h(t)m(ypically)e(binned)0
+2812 y(b)m(y)33 b(a)h(factor)g(of)f(32)h(to)g(pro)s(duce)e(a)i(480x480)
+i(pixel)31 b(image.)50 b(If)32 b(one)i(then)f(uses)g(a)g(region)g
+(\014le)f(generated)i(from)0 2925 y(this)29 b(image)i(\(in)f(image)g
+(pixel)f(units\))h(to)h(\014lter)e(the)i(R)m(OSA)-8 b(T)30
+b(ev)m(en)m(ts)i(\014le,)e(then)g(the)h(X)g(and)f(Y)g(column)g(v)-5
+b(alues)0 3038 y(m)m(ust)30 b(b)s(e)g(con)m(v)m(erted)i(to)f(corresp)s
+(onding)d(pixel)h(units)g(as)h(in:)382 3296 y Fe
+(regfilter\("rosat.reg",)42 b(X/32.+.5,)j(Y/32.+.5\))0
+3555 y Fi(Note)h(that)f(this)e(binning)e(con)m(v)m(ersion)k(is)e(not)i
+(necessary)g(if)e(the)i(region)f(\014le)f(is)h(sp)s(eci\014ed)e(using)h
+(celestial)0 3668 y(co)s(ordinate)h(units)f(instead)g(of)h(pixel)f
+(units)g(b)s(ecause)h(CFITSIO)e(is)i(then)f(able)h(to)h(directly)e
+(compare)i(the)0 3780 y(celestial)27 b(co)s(ordinate)h(of)f(eac)m(h)i
+(ro)m(w)f(in)e(the)i(table)f(with)g(the)g(celestial)h(co)s(ordinates)f
+(in)f(the)i(region)f(\014le)g(without)0 3893 y(ha)m(ving)j(to)h(kno)m
+(w)f(an)m(ything)g(ab)s(out)g(ho)m(w)h(the)f(image)h(ma)m(y)g(ha)m(v)m
+(e)g(b)s(een)f(binned.)0 4054 y(The)f(last)g("w)m(cs)h(cols")g
+(parameter)g(should)d(rarely)h(b)s(e)h(needed.)40 b(If)29
+b(supplied,)d(this)j(string)f(con)m(tains)i(the)f(names)0
+4166 y(of)37 b(the)g(2)h(columns)e(\(space)i(or)f(comma)g(separated\))h
+(whic)m(h)e(ha)m(v)m(e)i(the)g(asso)s(ciated)f(W)m(CS)g(k)m(eyw)m
+(ords.)61 b(If)37 b(not)0 4279 y(supplied,)d(the)i(\014lter)f(will)f
+(scan)i(the)g(X)g(and)f(Y)h(expressions)f(for)h(column)e(names.)58
+b(If)35 b(only)g(one)i(is)e(found)f(in)0 4392 y(eac)m(h)e(expression,)d
+(those)i(columns)e(will)f(b)s(e)h(used,)h(otherwise)g(an)g(error)g
+(will)e(b)s(e)i(returned.)0 4552 y(These)g(region)g(shap)s(es)g(are)g
+(supp)s(orted)f(\(names)h(are)h(case)h(insensitiv)m(e\):)334
+4811 y Fe(Point)428 b(\()48 b(X1,)f(Y1)g(\))715 b(<-)48
+b(One)f(pixel)f(square)g(region)334 4924 y(Line)476 b(\()48
+b(X1,)f(Y1,)g(X2,)f(Y2)i(\))333 b(<-)48 b(One)f(pixel)f(wide)h(region)
+334 5036 y(Polygon)332 b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2,)h(...)g(\))95
+b(<-)48 b(Rest)e(are)h(interiors)e(with)334 5149 y(Rectangle)236
+b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2,)h(A)h(\))334 b(|)47 b(boundaries)e
+(considered)334 5262 y(Box)524 b(\()48 b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)
+i(\))143 b(V)47 b(within)f(the)h(region)334 5375 y(Diamond)332
+b(\()48 b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)i(\))334 5488
+y(Circle)380 b(\()48 b(Xc,)f(Yc,)g(R)g(\))334 5601 y(Annulus)332
+b(\()48 b(Xc,)f(Yc,)g(Rin,)f(Rout)h(\))334 5714 y(Ellipse)332
+b(\()48 b(Xc,)f(Yc,)g(Rx,)f(Ry,)h(A)h(\))p eop
+%%Page: 35 41
+35 40 bop 0 299 a Fg(4.9.)72 b(R)m(O)m(W)31 b(FIL)-8
+b(TERING)31 b(SPECIFICA)-8 b(TION)2072 b Fi(35)334 555
+y Fe(Elliptannulus)44 b(\()k(Xc,)f(Yc,)g(Rinx,)f(Riny,)g(Routx,)g
+(Routy,)g(Ain,)h(Aout)g(\))334 668 y(Sector)380 b(\()48
+b(Xc,)f(Yc,)g(Amin,)f(Amax)h(\))0 1111 y Fi(where)28
+b(\(Xc,Yc\))j(is)c(the)i(co)s(ordinate)g(of)f(the)h(shap)s(e's)f(cen)m
+(ter;)j(\(X#,Y#\))e(are)g(the)g(co)s(ordinates)f(of)h(the)g(shap)s(e's)
+0 1224 y(edges;)39 b(Rxxx)c(are)g(the)h(shap)s(es')f(v)-5
+b(arious)34 b(Radii)g(or)h(semima)5 b(jor/minor)34 b(axes;)k(and)d
+(Axxx)g(are)h(the)g(angles)f(of)0 1337 y(rotation)d(\(or)f(b)s(ounding)
+e(angles)i(for)g(Sector\))h(in)e(degrees.)44 b(F)-8 b(or)32
+b(rotated)h(shap)s(es,)e(the)g(rotation)h(angle)f(can)h(b)s(e)0
+1450 y(left)f(o\013,)i(indicating)c(no)i(rotation.)45
+b(Common)31 b(alternate)h(names)f(for)h(the)f(regions)g(can)h(also)g(b)
+s(e)e(used:)43 b(rotb)s(o)m(x)0 1563 y(=)29 b(b)s(o)m(x;)g
+(rotrectangle)h(=)f(rectangle;)h(\(rot\)rhom)m(bus)f(=)f
+(\(rot\)diamond;)i(and)e(pie)g(=)g(sector.)42 b(When)28
+b(a)i(shap)s(e's)0 1676 y(name)e(is)f(preceded)g(b)m(y)h(a)g(min)m(us)f
+(sign,)g('-',)j(the)e(de\014ned)e(region)i(is)f(instead)g(the)h(area)h
+(*outside*)f(its)f(b)s(oundary)0 1789 y(\(ie,)35 b(the)f(region)g(is)f
+(in)m(v)m(erted\).)52 b(All)32 b(the)i(shap)s(es)f(within)f(a)i(single)
+f(region)g(\014le)h(are)g(OR'd)f(together)j(to)e(create)0
+1902 y(the)29 b(region,)h(and)e(the)i(order)f(is)f(signi\014can)m(t.)39
+b(The)29 b(o)m(v)m(erall)g(w)m(a)m(y)i(of)e(lo)s(oking)f(at)i(region)f
+(\014les)f(is)g(that)i(if)e(the)i(\014rst)0 2015 y(region)e(is)g(an)h
+(excluded)f(region)g(then)g(a)i(dumm)m(y)d(included)f(region)j(of)g
+(the)g(whole)f(detector)i(is)e(inserted)f(in)h(the)0
+2128 y(fron)m(t.)40 b(Then)25 b(eac)m(h)j(region)e(sp)s(eci\014cation)g
+(as)h(it)f(is)g(pro)s(cessed)g(o)m(v)m(errides)g(an)m(y)h(selections)g
+(inside)d(of)j(that)g(region)0 2240 y(sp)s(eci\014ed)35
+b(b)m(y)h(previous)f(regions.)58 b(Another)37 b(w)m(a)m(y)g(of)g
+(thinking)d(ab)s(out)i(this)f(is)h(that)h(if)e(a)i(previous)e(excluded)
+0 2353 y(region)30 b(is)f(completely)h(inside)f(of)h(a)h(subsequen)m(t)
+e(included)f(region)i(the)h(excluded)e(region)h(is)f(ignored.)0
+2514 y(The)44 b(p)s(ositional)f(co)s(ordinates)i(ma)m(y)g(b)s(e)g(giv)m
+(en)g(either)f(in)g(pixel)f(units,)k(decimal)d(degrees)i(or)f
+(hh:mm:ss.s,)0 2626 y(dd:mm:ss.s)25 b(units.)37 b(The)26
+b(shap)s(e)f(sizes)h(ma)m(y)g(b)s(e)g(giv)m(en)g(in)e(pixels,)i
+(degrees,)h(arcmin)m(utes,)g(or)f(arcseconds.)40 b(Lo)s(ok)0
+2739 y(at)31 b(examples)f(of)g(region)g(\014le)g(pro)s(duced)e(b)m(y)i
+(fv/PO)m(W)h(or)g(ds9)f(for)g(further)f(details)g(of)i(the)f(region)g
+(\014le)f(format.)0 2900 y(There)37 b(are)g(three)g(functions)f(that)h
+(are)h(primarily)c(for)i(use)h(with)f(SA)m(O)h(region)f(\014les)g(and)h
+(the)g(FSA)m(OI)g(task,)0 3012 y(but)e(they)h(can)h(b)s(e)e(used)g
+(directly)-8 b(.)57 b(They)36 b(return)f(a)h(b)s(o)s(olean)f(true)h(or)
+g(false)f(dep)s(ending)f(on)i(whether)f(a)i(t)m(w)m(o)0
+3125 y(dimensional)28 b(p)s(oin)m(t)h(is)g(in)g(the)i(region)f(or)g
+(not:)191 3569 y Fe("point)46 b(in)h(a)h(circular)d(region")477
+3681 y(circle\(xcntr,ycntr,radius)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191
+3907 y("point)h(in)h(an)g(elliptical)e(region")430 4020
+y(ellipse\(xcntr,ycntr,xhl)o(f_w)o(dth,)o(yhlf)o(_wd)o(th,r)o(otat)o
+(ion)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191 4246 y("point)h(in)h(a)h
+(rectangular)c(region")620 4359 y(box\(xcntr,ycntr,xfll_wdth,)o(yfll)o
+(_wd)o(th,r)o(otat)o(ion)o(,Xco)o(lumn)o(,Yc)o(olum)o(n\))191
+4585 y(where)334 4698 y(\(xcntr,ycntr\))g(are)j(the)g(\(x,y\))f
+(position)g(of)h(the)g(center)f(of)h(the)g(region)334
+4811 y(\(xhlf_wdth,yhlf_wdth\))42 b(are)47 b(the)g(\(x,y\))f(half)h
+(widths)f(of)h(the)g(region)334 4924 y(\(xfll_wdth,yfll_wdth\))42
+b(are)47 b(the)g(\(x,y\))f(full)h(widths)f(of)h(the)g(region)334
+5036 y(\(radius\))f(is)h(half)f(the)h(diameter)f(of)h(the)g(circle)334
+5149 y(\(rotation\))e(is)i(the)g(angle\(degrees\))d(that)j(the)g
+(region)f(is)h(rotated)f(with)620 5262 y(respect)g(to)h
+(\(xcntr,ycntr\))334 5375 y(\(Xcoord,Ycoord\))d(are)j(the)g(\(x,y\))f
+(coordinates)f(to)i(test,)f(usually)g(column)620 5488
+y(names)334 5601 y(NOTE:)g(each)h(parameter)e(can)i(itself)f(be)i(an)f
+(expression,)d(not)j(merely)f(a)620 5714 y(column)h(name)f(or)h
+(constant.)p eop
+%%Page: 36 42
+36 41 bop 0 299 a Fi(36)1618 b Fg(CHAPTER)30 b(4.)112
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fb(4.9.6)112
+b(Example)37 b(Ro)m(w)g(Filters)191 859 y Fe([)47 b(binary)f(&&)i(mag)f
 (<=)g(5.0])380 b(-)48 b(Extract)e(all)h(binary)f(stars)g(brighter)1766
-3569 y(than)94 b(fifth)47 b(magnitude)e(\(note)h(that)1766
-3681 y(the)h(initial)f(space)g(is)h(necessary)e(to)1766
-3794 y(prevent)h(it)h(from)g(being)f(treated)g(as)h(a)1766
-3907 y(binning)f(specification\))191 4133 y([#row)g(>=)h(125)g(&&)h
+972 y(than)94 b(fifth)47 b(magnitude)e(\(note)h(that)1766
+1085 y(the)h(initial)f(space)g(is)h(necessary)e(to)1766
+1197 y(prevent)h(it)h(from)g(being)f(treated)g(as)h(a)1766
+1310 y(binning)f(specification\))191 1536 y([#row)g(>=)h(125)g(&&)h
 (#row)e(<=)h(175])142 b(-)48 b(Extract)e(row)h(numbers)e(125)i(through)
-f(175)191 4359 y([IMAGE[4,5])f(.gt.)h(100])476 b(-)48
-b(Extract)e(all)h(rows)f(that)h(have)g(the)1766 4472
+f(175)191 1762 y([IMAGE[4,5])f(.gt.)h(100])476 b(-)48
+b(Extract)e(all)h(rows)f(that)h(have)g(the)1766 1875
 y(\(4,5\))f(component)g(of)h(the)g(IMAGE)f(column)1766
-4585 y(greater)g(than)g(100)191 4811 y([abs\(sin\(theta)e(*)j(#deg\)\))
+1988 y(greater)g(than)g(100)191 2214 y([abs\(sin\(theta)e(*)j(#deg\)\))
 f(<)i(0.5])e(-)i(Extract)e(all)h(rows)f(having)g(the)1766
-4924 y(absolute)f(value)i(of)g(the)g(sine)g(of)g(theta)1766
-5036 y(less)94 b(than)47 b(a)g(half)g(where)f(the)h(angles)1766
-5149 y(are)g(tabulated)e(in)i(degrees)191 5375 y([SUM\()f(SPEC)h(>)g
+2327 y(absolute)f(value)i(of)g(the)g(sine)g(of)g(theta)1766
+2439 y(less)94 b(than)47 b(a)g(half)g(where)f(the)h(angles)1766
+2552 y(are)g(tabulated)e(in)i(degrees)191 2778 y([SUM\()f(SPEC)h(>)g
 (3*BACKGRND)e(\)>=1])94 b(-)48 b(Extract)e(all)h(rows)f(containing)f(a)
-1766 5488 y(spectrum,)g(held)i(in)g(vector)f(column)1766
-5601 y(SPEC,)g(with)h(at)g(least)f(one)h(value)g(3)1766
-5714 y(times)f(greater)g(than)h(the)g(background)p eop
-%%Page: 35 41
-35 40 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(35)1766 555 y Fe(level)46 b(held)h(in)g(a)h(keyword,)d
-(BACKGRND)191 781 y([VCOL=={1,4,2}])759 b(-)48 b(Extract)e(all)h(rows)f
-(whose)h(vector)f(column)1766 894 y(VCOL)h(contains)e(the)i(3-elements)
-e(1,)i(4,)g(and)1766 1007 y(2.)191 1233 y([@rowFilter.txt])711
+1766 2891 y(spectrum,)g(held)i(in)g(vector)f(column)1766
+3004 y(SPEC,)g(with)h(at)g(least)f(one)h(value)g(3)1766
+3117 y(times)f(greater)g(than)h(the)g(background)1766
+3230 y(level)f(held)h(in)g(a)h(keyword,)d(BACKGRND)191
+3456 y([VCOL=={1,4,2}])759 b(-)48 b(Extract)e(all)h(rows)f(whose)h
+(vector)f(column)1766 3569 y(VCOL)h(contains)e(the)i(3-elements)e(1,)i
+(4,)g(and)1766 3681 y(2.)191 3907 y([@rowFilter.txt])711
 b(-)48 b(Extract)e(rows)g(using)h(the)g(expression)1766
-1346 y(contained)e(within)h(the)h(text)g(file)1766 1458
-y(rowFilter.txt)0 1801 y Fb(4.2.9)112 b(Binning)37 b(or)g
-(Histogramming)d(Sp)s(eci\014cation)0 2030 y Fi(The)44
-b(optional)g(binning)e(sp)s(eci\014er)h(is)h(enclosed)g(in)g(square)g
-(brac)m(k)m(ets)i(and)e(can)h(b)s(e)f(distinguished)d(from)k(a)0
-2143 y(general)35 b(ro)m(w)g(\014lter)f(sp)s(eci\014cation)f(b)m(y)i
-(the)g(fact)h(that)f(it)g(b)s(egins)e(with)h(the)h(k)m(eyw)m(ord)g
-('bin')f(not)h(immediately)0 2256 y(follo)m(w)m(ed)g(b)m(y)g(an)g
-(equals)f(sign.)54 b(When)35 b(binning)d(is)i(sp)s(ec\014ed,)i(a)f
-(temp)s(orary)g(N-dimensional)d(FITS)j(primary)0 2368
-y(arra)m(y)29 b(is)e(created)j(b)m(y)e(computing)f(the)i(histogram)f
-(of)h(the)f(v)-5 b(alues)28 b(in)f(the)h(sp)s(eci\014ed)f(columns)g(of)
-i(a)f(FITS)g(table)0 2481 y(extension.)40 b(After)30
-b(the)f(histogram)g(is)g(computed)g(the)h(input)d(FITS)i(\014le)g(con)m
-(taining)g(the)g(table)h(is)e(then)h(closed)0 2594 y(and)34
-b(the)h(temp)s(orary)f(FITS)g(primary)f(arra)m(y)i(is)f(op)s(ened)g
-(and)g(passed)g(to)h(the)g(application)e(program.)54
-b(Th)m(us,)0 2707 y(the)39 b(application)e(program)i(nev)m(er)g(sees)g
-(the)g(original)e(FITS)h(table)h(and)f(only)g(sees)i(the)f(image)g(in)e
-(the)i(new)0 2820 y(temp)s(orary)32 b(\014le)g(\(whic)m(h)g(has)g(no)h
-(additional)d(extensions\).)48 b(Ob)m(viously)-8 b(,)32
-b(the)h(application)e(program)h(m)m(ust)h(b)s(e)0 2933
-y(exp)s(ecting)d(to)h(op)s(en)f(a)h(FITS)e(image)i(and)f(not)g(a)h
-(FITS)f(table)g(in)f(this)g(case.)0 3093 y(The)h(data)h(t)m(yp)s(e)f
+4020 y(contained)e(within)h(the)h(text)g(file)1766 4133
+y(rowFilter.txt)191 4359 y([gtifilter\(\)])855 b(-)48
+b(Search)e(the)h(current)f(file)g(for)h(a)h(GTI)239 4472
+y(extension,)92 b(filter)i(the)47 b(TIME)239 4585 y(column)f(in)h(the)g
+(current)f(table,)g(using)239 4698 y(START/STOP)f(times)h(taken)g(from)
+239 4811 y(columns)f(in)j(the)f(GTI)94 b(extension)191
+5036 y([regfilter\("pow.reg"\)])423 b(-)48 b(Extract)e(rows)g(which)h
+(have)f(a)i(coordinate)1766 5149 y(\(as)f(given)f(in)h(the)g(X)h(and)f
+(Y)g(columns\))1766 5262 y(within)f(the)h(spatial)f(region)g(specified)
+1766 5375 y(in)h(the)g(pow.reg)f(region)g(file.)191 5601
+y([regfilter\("pow.reg",)c(Xs,)47 b(Ys\)])f(-)i(Same)f(as)g(above,)f
+(except)g(that)h(the)1766 5714 y(Xs)g(and)g(Ys)g(columns)f(will)h(be)g
+(used)f(to)p eop
+%%Page: 37 43
+37 42 bop 0 299 a Fg(4.10.)113 b(BINNING)31 b(OR)f(HISTOGRAMMING)h
+(SPECIFICA)-8 b(TION)1313 b Fi(37)1766 555 y Fe(determine)45
+b(the)i(coordinate)e(of)i(each)1766 668 y(row)g(in)g(the)g(table.)0
+1001 y Fd(4.10)180 b(Binning)45 b(or)g(Histogramming)i(Sp)t
+(eci\014cation)0 1252 y Fi(The)22 b(optional)g(binning)e(sp)s
+(eci\014er)h(is)h(enclosed)h(in)f(square)g(brac)m(k)m(ets)j(and)d(can)h
+(b)s(e)f(distinguished)d(from)k(a)g(general)0 1365 y(ro)m(w)32
+b(\014lter)g(sp)s(eci\014cation)f(b)m(y)h(the)h(fact)g(that)g(it)f(b)s
+(egins)f(with)g(the)h(k)m(eyw)m(ord)h('bin')e(not)i(immediately)d
+(follo)m(w)m(ed)0 1477 y(b)m(y)41 b(an)f(equals)h(sign.)71
+b(When)41 b(binning)c(is)j(sp)s(eci\014ed,)i(a)f(temp)s(orary)g
+(N-dimensional)d(FITS)i(primary)f(arra)m(y)0 1590 y(is)j(created)i(b)m
+(y)f(computing)g(the)g(histogram)g(of)g(the)g(v)-5 b(alues)43
+b(in)e(the)j(sp)s(eci\014ed)d(columns)h(of)h(a)h(FITS)e(table)0
+1703 y(extension.)e(After)30 b(the)f(histogram)g(is)g(computed)g(the)h
+(input)d(FITS)i(\014le)g(con)m(taining)g(the)g(table)h(is)e(then)h
+(closed)0 1816 y(and)34 b(the)h(temp)s(orary)f(FITS)g(primary)f(arra)m
+(y)i(is)f(op)s(ened)g(and)g(passed)g(to)h(the)g(application)e(program.)
+54 b(Th)m(us,)0 1929 y(the)39 b(application)e(program)i(nev)m(er)g
+(sees)g(the)g(original)e(FITS)h(table)h(and)f(only)g(sees)i(the)f
+(image)g(in)e(the)i(new)0 2042 y(temp)s(orary)32 b(\014le)g(\(whic)m(h)
+g(has)g(no)h(additional)d(extensions\).)48 b(Ob)m(viously)-8
+b(,)32 b(the)h(application)e(program)h(m)m(ust)h(b)s(e)0
+2155 y(exp)s(ecting)d(to)h(op)s(en)f(a)h(FITS)e(image)i(and)f(not)g(a)h
+(FITS)f(table)g(in)f(this)g(case.)0 2315 y(The)h(data)h(t)m(yp)s(e)f
 (of)h(the)f(FITS)g(histogram)f(image)i(ma)m(y)g(b)s(e)f(sp)s(eci\014ed)
 e(b)m(y)i(app)s(ending)e('b')i(\(for)h(8-bit)f(b)m(yte\),)h('i')0
-3206 y(\(for)g(16-bit)f(in)m(tegers\),)h('j')g(\(for)g(32-bit)f(in)m
+2428 y(\(for)g(16-bit)f(in)m(tegers\),)h('j')g(\(for)g(32-bit)f(in)m
 (teger\),)i('r')e(\(for)h(32-bit)f(\015oating)h(p)s(oin)m(ts\),)e(or)i
-('d')f(\(for)h(64-bit)f(double)0 3319 y(precision)c(\015oating)i(p)s
+('d')f(\(for)h(64-bit)f(double)0 2541 y(precision)c(\015oating)i(p)s
 (oin)m(t\))g(to)g(the)h('bin')d(k)m(eyw)m(ord)j(\(e.g.)41
 b('[binr)27 b(X]')h(creates)i(a)e(real)g(\015oating)g(p)s(oin)m(t)f
-(image\).)40 b(If)0 3432 y(the)26 b(datat)m(yp)s(e)h(is)e(not)h
+(image\).)40 b(If)0 2654 y(the)26 b(datat)m(yp)s(e)h(is)e(not)h
 (explicitly)e(sp)s(eci\014ed)g(then)i(a)g(32-bit)g(in)m(teger)h(image)f
 (will)d(b)s(e)i(created)i(b)m(y)f(default,)h(unless)0
-3545 y(the)i(w)m(eigh)m(ting)f(option)g(is)g(also)h(sp)s(eci\014ed)e
+2767 y(the)i(w)m(eigh)m(ting)f(option)g(is)g(also)h(sp)s(eci\014ed)e
 (in)g(whic)m(h)h(case)h(the)g(image)g(will)d(ha)m(v)m(e)k(a)f(32-bit)g
-(\015oating)g(p)s(oin)m(t)e(data)0 3658 y(t)m(yp)s(e)k(b)m(y)f
-(default.)0 3818 y(The)24 b(histogram)f(image)i(ma)m(y)g(ha)m(v)m(e)g
+(\015oating)g(p)s(oin)m(t)e(data)0 2880 y(t)m(yp)s(e)k(b)m(y)f
+(default.)0 3040 y(The)24 b(histogram)f(image)i(ma)m(y)g(ha)m(v)m(e)g
 (from)f(1)g(to)h(4)g(dimensions)c(\(axes\),)27 b(dep)s(ending)22
-b(on)i(the)g(n)m(um)m(b)s(er)f(of)h(columns)0 3931 y(that)31
+b(on)i(the)g(n)m(um)m(b)s(er)f(of)h(columns)0 3153 y(that)31
 b(are)g(sp)s(eci\014ed.)39 b(The)30 b(general)g(form)g(of)g(the)h
-(binning)c(sp)s(eci\014cation)i(is:)48 4234 y Fe([bin{bijrd})92
+(binning)c(sp)s(eci\014cation)i(is:)48 3410 y Fe([bin{bijrd})92
 b(Xcol=min:max:binsize,)42 b(Ycol=)47 b(...,)f(Zcol=...,)f(Tcol=...;)h
-(weight])0 4538 y Fi(in)38 b(whic)m(h)g(up)g(to)i(4)g(columns,)g(eac)m
+(weight])0 3668 y Fi(in)38 b(whic)m(h)g(up)g(to)i(4)g(columns,)g(eac)m
 (h)g(corresp)s(onding)d(to)j(an)g(axis)e(of)i(the)f(image,)j(are)e
-(listed.)65 b(The)39 b(column)0 4650 y(names)27 b(are)h(case)h
+(listed.)65 b(The)39 b(column)0 3781 y(names)27 b(are)h(case)h
 (insensitiv)m(e,)d(and)h(the)h(column)e(n)m(um)m(b)s(er)g(ma)m(y)i(b)s
 (e)f(giv)m(en)g(instead)g(of)h(the)g(name,)g(preceded)f(b)m(y)0
-4763 y(a)32 b(p)s(ound)e(sign)h(\(e.g.,)j([bin)c(#4=1:512]\).)47
+3894 y(a)32 b(p)s(ound)e(sign)h(\(e.g.,)j([bin)c(#4=1:512]\).)47
 b(If)31 b(the)h(column)f(name)h(is)e(not)i(sp)s(eci\014ed,)f(then)g
-(CFITSIO)g(will)e(\014rst)0 4876 y(try)i(to)g(use)g(the)g('preferred)f
-(column')g(as)h(sp)s(eci\014ed)f(b)m(y)g(the)i(CPREF)e(k)m(eyw)m(ord)i
-(if)d(it)i(exists)g(\(e.g.,)i('CPREF)d(=)0 4989 y('DETX,DETY'\),)36
-b(otherwise)d(column)g(names)h('X',)h('Y',)g('Z',)f(and)g('T')g(will)d
-(b)s(e)j(assumed)f(for)h(eac)m(h)h(of)f(the)h(4)0 5102
-y(axes,)c(resp)s(ectiv)m(ely)-8 b(.)0 5262 y(Eac)m(h)33
-b(column)e(name)h(ma)m(y)h(b)s(e)f(follo)m(w)m(ed)f(b)m(y)i(an)f
-(equals)f(sign)h(and)f(then)h(the)g(lo)m(w)m(er)h(and)f(upp)s(er)e
-(range)i(of)h(the)0 5375 y(histogram,)e(and)f(the)h(size)g(of)g(the)g
-(histogram)g(bins,)e(separated)i(b)m(y)g(colons.)42 b(Spaces)31
-b(are)g(allo)m(w)m(ed)g(b)s(efore)g(and)0 5488 y(after)e(the)g(equals)f
-(sign)f(but)h(not)h(within)d(the)j('min:max:binsize')d(string.)39
-b(The)29 b(min,)e(max)i(and)f(binsize)f(v)-5 b(alues)0
-5601 y(ma)m(y)32 b(b)s(e)e(in)m(teger)h(or)g(\015oating)g(p)s(oin)m(t)f
-(n)m(um)m(b)s(ers,)g(or)h(they)g(ma)m(y)g(b)s(e)g(the)g(names)g(of)g(k)
-m(eyw)m(ords)g(in)f(the)h(header)g(of)0 5714 y(the)g(table.)40
-b(If)30 b(the)h(latter,)g(then)f(the)g(v)-5 b(alue)30
-b(of)h(that)g(k)m(eyw)m(ord)f(is)g(substituted)f(in)m(to)h(the)h
-(expression.)p eop
-%%Page: 36 42
-36 41 bop 0 299 a Fi(36)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)0 555 y Fi(Default)36
-b(v)-5 b(alues)35 b(for)h(the)g(min,)g(max)g(and)g(binsize)e(quan)m
-(tities)h(will)e(b)s(e)i(used)h(if)e(not)j(explicitly)c(giv)m(en)j(in)f
-(the)0 668 y(binning)27 b(expression)i(as)i(sho)m(wn)f(in)f(these)i
-(examples:)191 917 y Fe([bin)47 b(x)g(=)g(:512:2])94
-b(-)47 b(use)g(default)f(minimum)g(value)191 1030 y([bin)h(x)g(=)g
+(CFITSIO)g(will)e(\014rst)0 4007 y(try)37 b(to)h(use)f(the)g
+('preferred)f(column')h(as)g(sp)s(eci\014ed)f(b)m(y)h(the)g(CPREF)g(k)m
+(eyw)m(ord)h(if)e(it)g(exists)h(\(e.g.,)k('CPREF)0 4120
+y(=)i('DETX,DETY'\),)h(otherwise)f(column)f(names)h('X',)h('Y',)g('Z',)
+f(and)f('T')i(will)c(b)s(e)i(assumed)h(for)g(eac)m(h)h(of)0
+4233 y(the)37 b(4)h(axes,)i(resp)s(ectiv)m(ely)-8 b(.)60
+b(In)37 b(cases)h(where)e(the)i(column)e(name)h(could)f(b)s(e)g
+(confused)h(with)f(an)h(arithmetic)0 4346 y(expression,)29
+b(enclose)i(the)g(column)e(name)h(in)f(paren)m(theses)i(to)g(force)g
+(the)f(name)h(to)g(b)s(e)f(in)m(terpreted)f(literally)-8
+b(.)0 4506 y(Eac)m(h)33 b(column)e(name)h(ma)m(y)h(b)s(e)f(follo)m(w)m
+(ed)f(b)m(y)i(an)f(equals)f(sign)h(and)f(then)h(the)g(lo)m(w)m(er)h
+(and)f(upp)s(er)e(range)i(of)h(the)0 4619 y(histogram,)e(and)f(the)h
+(size)g(of)g(the)g(histogram)g(bins,)e(separated)i(b)m(y)g(colons.)42
+b(Spaces)31 b(are)g(allo)m(w)m(ed)g(b)s(efore)g(and)0
+4731 y(after)e(the)g(equals)f(sign)f(but)h(not)h(within)d(the)j
+('min:max:binsize')d(string.)39 b(The)29 b(min,)e(max)i(and)f(binsize)f
+(v)-5 b(alues)0 4844 y(ma)m(y)32 b(b)s(e)e(in)m(teger)h(or)g
+(\015oating)g(p)s(oin)m(t)f(n)m(um)m(b)s(ers,)g(or)h(they)g(ma)m(y)g(b)
+s(e)g(the)g(names)g(of)g(k)m(eyw)m(ords)g(in)f(the)h(header)g(of)0
+4957 y(the)g(table.)40 b(If)30 b(the)h(latter,)g(then)f(the)g(v)-5
+b(alue)30 b(of)h(that)g(k)m(eyw)m(ord)f(is)g(substituted)f(in)m(to)h
+(the)h(expression.)0 5117 y(Default)36 b(v)-5 b(alues)35
+b(for)h(the)g(min,)g(max)g(and)g(binsize)e(quan)m(tities)h(will)e(b)s
+(e)i(used)h(if)e(not)j(explicitly)c(giv)m(en)j(in)f(the)0
+5230 y(binning)27 b(expression)i(as)i(sho)m(wn)f(in)f(these)i
+(examples:)191 5488 y Fe([bin)47 b(x)g(=)g(:512:2])94
+b(-)47 b(use)g(default)f(minimum)g(value)191 5601 y([bin)h(x)g(=)g
 (1::2])190 b(-)47 b(use)g(default)f(maximum)g(value)191
-1143 y([bin)h(x)g(=)g(1:512])142 b(-)47 b(use)g(default)f(bin)h(size)
-191 1256 y([bin)g(x)g(=)g(1:])286 b(-)47 b(use)g(default)f(maximum)g
-(value)g(and)h(bin)g(size)191 1368 y([bin)g(x)g(=)g(:512])190
+5714 y([bin)h(x)g(=)g(1:512])142 b(-)47 b(use)g(default)f(bin)h(size)p
+eop
+%%Page: 38 44
+38 43 bop 0 299 a Fi(38)1618 b Fg(CHAPTER)30 b(4.)112
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)191 555 y
+Fe([bin)47 b(x)g(=)g(1:])286 b(-)47 b(use)g(default)f(maximum)g(value)g
+(and)h(bin)g(size)191 668 y([bin)g(x)g(=)g(:512])190
 b(-)47 b(use)g(default)f(minimum)g(value)g(and)h(bin)g(size)191
-1481 y([bin)g(x)g(=)g(2])334 b(-)47 b(use)g(default)f(minimum)g(and)h
-(maximum)f(values)191 1594 y([bin)h(x])524 b(-)47 b(use)g(default)f
-(minimum,)g(maximum)g(and)g(bin)h(size)191 1707 y([bin)g(4])524
+781 y([bin)g(x)g(=)g(2])334 b(-)47 b(use)g(default)f(minimum)g(and)h
+(maximum)f(values)191 894 y([bin)h(x])524 b(-)47 b(use)g(default)f
+(minimum,)g(maximum)g(and)g(bin)h(size)191 1007 y([bin)g(4])524
 b(-)47 b(default)f(2-D)h(image,)f(bin)h(size)g(=)g(4)h(in)f(both)g
-(axes)191 1820 y([bin])619 b(-)47 b(default)f(2-D)h(image)0
-2069 y Fi(CFITSIO)31 b(will)f(use)i(the)h(v)-5 b(alue)32
+(axes)191 1120 y([bin])619 b(-)47 b(default)f(2-D)h(image)0
+1374 y Fi(CFITSIO)31 b(will)f(use)i(the)h(v)-5 b(alue)32
 b(of)h(the)g(TLMINn,)f(TLMAXn,)h(and)f(TDBINn)h(k)m(eyw)m(ords,)h(if)d
-(they)i(exist,)g(for)0 2182 y(the)k(default)e(min,)i(max,)h(and)e
+(they)i(exist,)g(for)0 1487 y(the)k(default)e(min,)i(max,)h(and)e
 (binsize,)g(resp)s(ectiv)m(ely)-8 b(.)59 b(If)36 b(they)h(do)f(not)h
-(exist)f(then)g(CFITSIO)f(will)f(use)i(the)0 2295 y(actual)c(minim)m
+(exist)f(then)g(CFITSIO)f(will)f(use)i(the)0 1600 y(actual)c(minim)m
 (um)d(and)j(maxim)m(um)f(v)-5 b(alues)31 b(in)g(the)h(column)e(for)i
 (the)g(histogram)g(min)e(and)i(max)g(v)-5 b(alues.)44
-b(The)0 2408 y(default)33 b(binsize)e(will)g(b)s(e)i(set)h(to)h(1,)g
+b(The)0 1713 y(default)33 b(binsize)e(will)g(b)s(e)i(set)h(to)h(1,)g
 (or)e(\(max)h(-)g(min\))e(/)i(10.,)i(whic)m(hev)m(er)d(is)g(smaller,)g
-(so)g(that)i(the)e(histogram)0 2520 y(will)28 b(ha)m(v)m(e)j(at)g
-(least)g(10)g(bins)e(along)h(eac)m(h)i(axis.)0 2681 y(A)41
+(so)g(that)i(the)e(histogram)0 1826 y(will)28 b(ha)m(v)m(e)j(at)g
+(least)g(10)g(bins)e(along)h(eac)m(h)i(axis.)0 1986 y(A)41
 b(shortcut)g(notation)g(is)f(allo)m(w)m(ed)h(if)f(all)g(the)h
 (columns/axes)g(ha)m(v)m(e)h(the)f(same)g(binning)d(sp)s
-(eci\014cation.)72 b(In)0 2794 y(this)32 b(case)h(all)f(the)h(column)e
+(eci\014cation.)72 b(In)0 2099 y(this)32 b(case)h(all)f(the)h(column)e
 (names)i(ma)m(y)g(b)s(e)f(listed)f(within)f(paren)m(theses,)k(follo)m
-(w)m(ed)f(b)m(y)f(the)h(\(single\))f(binning)0 2906 y(sp)s
-(eci\014cation,)d(as)i(in:)191 3155 y Fe([bin)47 b(\(X,Y\)=1:512:2])191
-3268 y([bin)g(\(X,Y\))f(=)h(5])0 3517 y Fi(The)31 b(optional)g(w)m
+(w)m(ed)f(b)m(y)f(the)h(\(single\))f(binning)0 2212 y(sp)s
+(eci\014cation,)d(as)i(in:)191 2466 y Fe([bin)47 b(\(X,Y\)=1:512:2])191
+2579 y([bin)g(\(X,Y\))f(=)h(5])0 2834 y Fi(The)31 b(optional)g(w)m
 (eigh)m(ting)h(factor)g(is)f(the)h(last)f(item)h(in)e(the)i(binning)d
 (sp)s(eci\014er)h(and,)i(if)e(presen)m(t,)j(is)d(separated)0
-3630 y(from)38 b(the)g(list)f(of)h(columns)f(b)m(y)h(a)h(semi-colon.)63
+2947 y(from)38 b(the)g(list)f(of)h(columns)f(b)m(y)h(a)h(semi-colon.)63
 b(As)39 b(the)f(histogram)g(is)f(accum)m(ulated,)k(this)c(w)m(eigh)m(t)
-i(is)e(used)0 3743 y(to)e(incremen)m(ted)e(the)h(v)-5
+i(is)e(used)0 3059 y(to)e(incremen)m(ted)e(the)h(v)-5
 b(alue)34 b(of)g(the)g(appropriated)e(bin)h(in)f(the)i(histogram.)51
 b(If)34 b(the)g(w)m(eigh)m(ting)g(factor)h(is)e(not)0
-3856 y(sp)s(eci\014ed,)23 b(then)g(the)g(default)f(w)m(eigh)m(t)i(=)e
+3172 y(sp)s(eci\014ed,)23 b(then)g(the)g(default)f(w)m(eigh)m(t)i(=)e
 (1)i(is)e(assumed.)37 b(The)23 b(w)m(eigh)m(ting)g(factor)h(ma)m(y)f(b)
-s(e)g(a)g(constan)m(t)i(in)m(teger)e(or)0 3968 y(\015oating)29
+s(e)g(a)g(constan)m(t)i(in)m(teger)e(or)0 3285 y(\015oating)29
 b(p)s(oin)m(t)f(n)m(um)m(b)s(er,)g(or)h(the)g(name)g(of)g(a)g(k)m(eyw)m
 (ord)h(con)m(taining)e(the)i(w)m(eigh)m(ting)e(v)-5 b(alue.)40
-b(Or)28 b(the)h(w)m(eigh)m(ting)0 4081 y(factor)g(ma)m(y)g(b)s(e)e(the)
+b(Or)28 b(the)h(w)m(eigh)m(ting)0 3398 y(factor)g(ma)m(y)g(b)s(e)e(the)
 h(name)g(of)h(a)f(table)g(column)f(in)g(whic)m(h)f(case)k(the)e(v)-5
 b(alue)27 b(in)g(that)i(column,)e(on)h(a)h(ro)m(w)f(b)m(y)g(ro)m(w)0
-4194 y(basis,)h(will)f(b)s(e)i(used.)0 4354 y(In)35 b(some)h(cases,)i
+3511 y(basis,)h(will)f(b)s(e)i(used.)0 3671 y(In)35 b(some)h(cases,)i
 (the)d(column)g(or)g(k)m(eyw)m(ord)h(ma)m(y)g(giv)m(e)g(the)g(recipro)s
 (cal)e(of)i(the)g(actual)g(w)m(eigh)m(t)g(v)-5 b(alue)35
-b(that)h(is)0 4467 y(needed.)49 b(In)32 b(this)g(case,)j(precede)e(the)
+b(that)h(is)0 3784 y(needed.)49 b(In)32 b(this)g(case,)j(precede)e(the)
 h(w)m(eigh)m(t)f(k)m(eyw)m(ord)h(or)f(column)f(name)h(b)m(y)g(a)g
-(slash)f('/')i(to)g(tell)e(CFITSIO)0 4580 y(to)f(use)f(the)h(recipro)s
+(slash)f('/')i(to)g(tell)e(CFITSIO)0 3897 y(to)f(use)f(the)h(recipro)s
 (cal)e(of)h(the)h(v)-5 b(alue)30 b(when)f(constructing)h(the)h
-(histogram.)0 4740 y(F)-8 b(or)35 b(complex)e(or)h(commonly)f(used)g
+(histogram.)0 4057 y(F)-8 b(or)35 b(complex)e(or)h(commonly)f(used)g
 (histograms,)i(one)f(can)g(also)g(place)g(its)f(description)f(in)m(to)i
-(a)g(text)h(\014le)e(and)0 4853 y(imp)s(ort)43 b(it)g(in)m(to)i(the)f
+(a)g(text)h(\014le)e(and)0 4170 y(imp)s(ort)43 b(it)g(in)m(to)i(the)f
 (binning)d(sp)s(eci\014cation)i(using)g(the)i(syn)m(tax)f('[bin)f
-(@\014lename.txt]'.)83 b(The)44 b(\014le's)f(con-)0 4966
+(@\014lename.txt]'.)83 b(The)44 b(\014le's)f(con-)0 4283
 y(ten)m(ts)37 b(can)e(extend)h(o)m(v)m(er)h(m)m(ultiple)c(lines,)j
 (although)f(it)g(m)m(ust)g(still)f(conform)i(to)g(the)g(no-spaces)g
-(rule)e(for)i(the)0 5079 y(min:max:binsize)28 b(syn)m(tax)j(and)e(eac)m
-(h)j(axis)e(sp)s(eci\014cation)f(m)m(ust)h(still)e(b)s(e)i
-(comma-separated.)0 5239 y(Examples:)191 5488 y Fe([bini)46
-b(detx,)h(dety])762 b(-)47 b(2-D,)g(16-bit)f(integer)g(histogram)1861
-5601 y(of)i(DETX)e(and)h(DETY)g(columns,)e(using)1861
-5714 y(default)h(values)g(for)h(the)g(histogram)p eop
-%%Page: 37 43
-37 42 bop 0 299 a Fg(4.2.)72 b(DET)-8 b(AILED)31 b(FILENAME)g(SYNT)-8
-b(AX)2184 b Fi(37)1861 555 y Fe(range)47 b(and)g(binsize)191
-781 y([bin)g(\(detx,)f(dety\)=16;)f(/exposure])g(-)i(2-D,)g(32-bit)f
-(real)h(histogram)e(of)i(DETX)1861 894 y(and)g(DETY)g(columns)f(with)g
-(a)i(bin)f(size)f(=)i(16)1861 1007 y(in)g(both)e(axes.)h(The)f
-(histogram)g(values)1861 1120 y(are)h(divided)f(by)h(the)g(EXPOSURE)f
-(keyword)1861 1233 y(value.)191 1458 y([bin)h(time=TSTART:TSTOP:0.1])
-280 b(-)47 b(1-D)g(lightcurve,)e(range)h(determined)f(by)1861
-1571 y(the)i(TSTART)f(and)h(TSTOP)g(keywords,)1861 1684
-y(with)g(0.1)g(unit)g(size)f(bins.)191 1910 y([bin)h(pha,)f
-(time=8000.:8100.:0.1])90 b(-)47 b(2-D)g(image)g(using)f(default)g
-(binning)1861 2023 y(of)i(the)e(PHA)h(column)f(for)h(the)g(X)h(axis,)
-1861 2136 y(and)f(1000)g(bins)g(in)g(the)g(range)1861
-2249 y(8000.)g(to)g(8100.)f(for)h(the)g(Y)h(axis.)191
-2475 y([bin)f(@binFilter.txt])616 b(-)47 b(Use)g(the)g(contents)f(of)h
-(the)g(text)f(file)1861 2588 y(binFilter.txt)f(for)h(the)h(binning)1861
-2700 y(specifications.)p eop
-%%Page: 38 44
-38 43 bop 0 299 a Fi(38)1618 b Fg(CHAPTER)30 b(4.)112
-b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)p eop
+(rule)e(for)i(the)0 4396 y(min:max:binsize)e(syn)m(tax)k(and)e(eac)m(h)
+i(axis)f(sp)s(eci\014cation)f(m)m(ust)h(still)d(b)s(e)j
+(comma-separated.)62 b(An)m(y)37 b(lines)e(in)0 4509
+y(the)d(external)g(text)h(\014le)e(that)i(b)s(egin)d(with)h(2)h(slash)f
+(c)m(haracters)i(\('//'\))h(will)29 b(b)s(e)j(ignored)f(and)g(ma)m(y)i
+(b)s(e)e(used)g(to)0 4622 y(add)f(commen)m(ts)h(in)m(to)f(the)h
+(\014le.)0 4782 y(Examples:)191 5036 y Fe([bini)46 b(detx,)h(dety])762
+b(-)47 b(2-D,)g(16-bit)f(integer)g(histogram)1861 5149
+y(of)i(DETX)e(and)h(DETY)g(columns,)e(using)1861 5262
+y(default)h(values)g(for)h(the)g(histogram)1861 5375
+y(range)g(and)g(binsize)191 5601 y([bin)g(\(detx,)f(dety\)=16;)f
+(/exposure])g(-)i(2-D,)g(32-bit)f(real)h(histogram)e(of)i(DETX)1861
+5714 y(and)g(DETY)g(columns)f(with)g(a)i(bin)f(size)f(=)i(16)p
+eop
 %%Page: 39 45
-39 44 bop 0 1225 a Ff(Chapter)65 b(5)0 1687 y Fl(FITSIO)76
+39 44 bop 0 299 a Fg(4.10.)113 b(BINNING)31 b(OR)f(HISTOGRAMMING)h
+(SPECIFICA)-8 b(TION)1313 b Fi(39)1861 555 y Fe(in)48
+b(both)e(axes.)h(The)f(histogram)g(values)1861 668 y(are)h(divided)f
+(by)h(the)g(EXPOSURE)f(keyword)1861 781 y(value.)191
+1007 y([bin)h(time=TSTART:TSTOP:0.1])280 b(-)47 b(1-D)g(lightcurve,)e
+(range)h(determined)f(by)1861 1120 y(the)i(TSTART)f(and)h(TSTOP)g
+(keywords,)1861 1233 y(with)g(0.1)g(unit)g(size)f(bins.)191
+1458 y([bin)h(pha,)f(time=8000.:8100.:0.1])90 b(-)47
+b(2-D)g(image)g(using)f(default)g(binning)1861 1571 y(of)i(the)e(PHA)h
+(column)f(for)h(the)g(X)h(axis,)1861 1684 y(and)f(1000)g(bins)g(in)g
+(the)g(range)1861 1797 y(8000.)g(to)g(8100.)f(for)h(the)g(Y)h(axis.)191
+2023 y([bin)f(@binFilter.txt])616 b(-)47 b(Use)g(the)g(contents)f(of)h
+(the)g(text)f(file)1861 2136 y(binFilter.txt)f(for)h(the)h(binning)1861
+2249 y(specifications.)p eop
+%%Page: 40 46
+40 45 bop 0 299 a Fi(40)1618 b Fg(CHAPTER)30 b(4.)112
+b(EXTENDED)30 b(FILE)h(NAME)f(SYNT)-8 b(AX)p eop
+%%Page: 41 47
+41 46 bop 0 1225 a Ff(Chapter)65 b(5)0 1687 y Fl(T)-19
+b(emplate)76 b(Files)0 2180 y Fi(When)38 b(a)h(new)f(FITS)g(\014le)g
+(is)g(created)h(with)f(a)g(call)g(to)i(\014ts)p 2101
+2180 28 4 v 32 w(create)p 2369 2180 V 35 w(\014le,)f(the)g(name)g(of)g
+(a)g(template)g(\014le)e(ma)m(y)0 2293 y(b)s(e)i(supplied)e(in)i(paren)
+m(theses)h(immediately)e(follo)m(wing)g(the)j(name)f(of)g(the)g(new)f
+(\014le)g(to)i(b)s(e)e(created.)71 b(This)0 2406 y(template)26
+b(is)e(used)h(to)h(de\014ne)f(the)h(structure)f(of)h(one)f(or)h(more)g
+(HDUs)g(in)e(the)i(new)f(\014le.)38 b(The)25 b(template)h(\014le)e(ma)m
+(y)0 2518 y(b)s(e)32 b(another)h(FITS)f(\014le,)h(in)f(whic)m(h)f(case)
+j(the)f(newly)f(created)i(\014le)e(will)e(ha)m(v)m(e)k(exactly)g(the)f
+(same)g(k)m(eyw)m(ords)g(in)0 2631 y(eac)m(h)25 b(HDU)g(as)g(in)e(the)h
+(template)h(FITS)e(\014le,)i(but)e(all)h(the)g(data)h(units)d(will)g(b)
+s(e)i(\014lled)e(with)g(zeros.)40 b(The)24 b(template)0
+2744 y(\014le)h(ma)m(y)i(also)f(b)s(e)f(an)h(ASCI)s(I)e(text)j(\014le,)
+f(where)g(eac)m(h)h(line)d(\(in)h(general\))i(describ)s(es)d(one)i
+(FITS)f(k)m(eyw)m(ord)i(record.)0 2857 y(The)j(format)h(of)f(the)h
+(ASCI)s(I)e(template)h(\014le)g(is)f(describ)s(ed)f(in)i(the)g(follo)m
+(wing)f(sections.)0 3188 y Fd(5.1)135 b(Detailed)47 b(T)-11
+b(emplate)46 b(Line)f(F)-11 b(ormat)0 3438 y Fi(The)30
+b(format)h(of)f(eac)m(h)i(ASCI)s(I)c(template)j(line)e(closely)h(follo)
+m(ws)f(the)i(format)g(of)f(a)h(FITS)f(k)m(eyw)m(ord)g(record:)95
+3682 y Fe(KEYWORD)46 b(=)i(KEYVALUE)d(/)j(COMMENT)0 3926
+y Fi(except)22 b(that)g(free)g(format)f(ma)m(y)h(b)s(e)f(used)f
+(\(e.g.,)25 b(the)d(equals)e(sign)h(ma)m(y)g(app)s(ear)g(at)h(an)m(y)g
+(p)s(osition)d(in)h(the)i(line\))e(and)0 4039 y(T)-8
+b(AB)34 b(c)m(haracters)g(are)g(allo)m(w)m(ed)f(and)g(are)g(treated)h
+(the)g(same)f(as)h(space)f(c)m(haracters.)51 b(The)33
+b(KEYV)-10 b(ALUE)33 b(and)0 4152 y(COMMENT)d(\014elds)f(are)i
+(optional.)41 b(The)30 b(equals)g(sign)f(c)m(haracter)k(is)c(also)i
+(optional,)f(but)g(it)g(is)f(recommended)0 4264 y(that)42
+b(it)e(b)s(e)h(included)d(for)j(clarit)m(y)-8 b(.)73
+b(An)m(y)41 b(template)h(line)d(that)j(b)s(egins)e(with)f(the)j(p)s
+(ound)d('#')i(c)m(haracter)i(is)0 4377 y(ignored)29 b(b)m(y)i(the)f
+(template)h(parser)f(and)g(ma)m(y)h(b)s(e)e(use)h(to)h(insert)f(commen)
+m(ts)h(in)m(to)f(the)h(template)g(\014le)e(itself.)0
+4538 y(The)d(KEYW)m(ORD)g(name)g(\014eld)f(is)g(limited)f(to)j(8)f(c)m
+(haracters)h(in)e(length)h(and)f(only)g(the)h(letters)h(A-Z,)f(digits)f
+(0-9,)0 4650 y(and)j(the)g(h)m(yphen)f(and)h(underscore)g(c)m
+(haracters)h(ma)m(y)g(b)s(e)f(used,)g(without)g(an)m(y)g(em)m(b)s
+(edded)g(spaces.)40 b(Lo)m(w)m(ercase)0 4763 y(letters)21
+b(in)f(the)i(template)f(k)m(eyw)m(ord)h(name)f(will)d(b)s(e)j(con)m(v)m
+(erted)i(to)f(upp)s(ercase.)36 b(Leading)21 b(spaces)g(in)f(the)i
+(template)0 4876 y(line)i(preceding)h(the)g(k)m(eyw)m(ord)h(name)g(are)
+g(generally)f(ignored,)h(except)g(if)f(the)h(\014rst)f(8)h(c)m
+(haracters)h(of)f(a)g(template)0 4989 y(line)d(are)j(all)e(blank,)h
+(then)g(the)g(en)m(tire)g(line)f(is)g(treated)i(as)f(a)h(FITS)e(commen)
+m(t)i(k)m(eyw)m(ord)g(\(with)e(a)i(blank)d(k)m(eyw)m(ord)0
+5102 y(name\))31 b(and)f(is)f(copied)h(v)m(erbatim)g(in)m(to)g(the)h
+(FITS)e(header.)0 5262 y(The)37 b(KEYV)-10 b(ALUE)37
+b(\014eld)f(ma)m(y)i(ha)m(v)m(e)g(an)m(y)g(allo)m(w)m(ed)f(FITS)g(data)
+h(t)m(yp)s(e:)54 b(c)m(haracter)39 b(string,)g(logical,)f(in)m(teger,)0
+5375 y(real,)33 b(complex)f(in)m(teger,)i(or)e(complex)h(real.)46
+b(The)32 b(c)m(haracter)j(string)c(v)-5 b(alues)32 b(need)g(not)h(b)s
+(e)f(enclosed)g(in)f(single)0 5488 y(quote)e(c)m(haracters)h(unless)d
+(they)h(are)h(necessary)g(to)g(distinguish)24 b(the)29
+b(string)e(from)h(a)h(di\013eren)m(t)f(data)h(t)m(yp)s(e)f(\(e.g.)0
+5601 y(2.0)h(is)d(a)i(real)g(but)f('2.0')i(is)e(a)h(string\).)39
+b(The)27 b(k)m(eyw)m(ord)h(has)f(an)h(unde\014ned)d(\(n)m(ull\))h(v)-5
+b(alue)28 b(if)e(the)i(template)g(record)0 5714 y(only)h(con)m(tains)i
+(blanks)e(follo)m(wing)g(the)h("=")h(or)g(b)s(et)m(w)m(een)g(the)f("=")
+h(and)f(the)g("/")i(commen)m(t)g(\014eld)c(delimiter.)1905
+5942 y(41)p eop
+%%Page: 42 48
+42 47 bop 0 299 a Fi(42)2340 b Fg(CHAPTER)30 b(5.)71
+b(TEMPLA)-8 b(TE)30 b(FILES)0 555 y Fi(String)25 b(k)m(eyw)m(ord)i(v)-5
+b(alues)26 b(longer)g(than)g(68)h(c)m(haracters)h(\(the)f(maxim)m(um)e
+(length)h(that)h(will)d(\014t)i(in)f(a)i(single)e(FITS)0
+668 y(k)m(eyw)m(ord)41 b(record\))g(are)g(p)s(ermitted)e(using)g(the)i
+(CFITSIO)e(long)h(string)g(con)m(v)m(en)m(tion.)73 b(They)40
+b(can)h(either)f(b)s(e)0 781 y(sp)s(eci\014ed)27 b(as)j(a)f(single)f
+(long)g(line)g(in)f(the)j(template,)g(or)f(b)m(y)f(using)g(m)m(ultiple)
+f(lines)g(where)h(the)i(con)m(tin)m(uing)e(lines)0 894
+y(con)m(tain)j(the)f('CONTINUE')g(k)m(eyw)m(ord,)h(as)g(in)e(this)g
+(example:)95 1139 y Fe(LONGKEY)46 b(=)i('This)e(is)h(a)h(long)e(string)
+g(value)h(that)f(is)i(contin&')95 1252 y(CONTINUE)94
+b('ued)46 b(over)h(2)g(records')f(/)h(comment)f(field)h(goes)f(here)0
+1497 y Fi(The)29 b(format)h(of)g(template)g(lines)d(with)i(CONTINUE)f
+(k)m(eyw)m(ord)i(is)f(v)m(ery)h(strict:)40 b(3)30 b(spaces)g(m)m(ust)f
+(follo)m(w)g(CON-)0 1610 y(TINUE)h(and)g(the)g(rest)h(of)f(the)h(line)e
+(is)g(copied)h(v)m(erbatim)g(to)h(the)g(FITS)e(\014le.)0
+1771 y(The)i(start)h(of)g(the)f(optional)g(COMMENT)g(\014eld)f(m)m(ust)
+i(b)s(e)e(preceded)i(b)m(y)f("/",)i(whic)m(h)d(is)h(used)g(to)h
+(separate)g(it)0 1883 y(from)e(the)g(k)m(eyw)m(ord)h(v)-5
+b(alue)29 b(\014eld.)40 b(Exceptions)29 b(are)i(if)e(the)i(KEYW)m(ORD)g
+(name)f(\014eld)f(con)m(tains)h(COMMENT,)0 1996 y(HISTOR)-8
+b(Y,)30 b(CONTINUE,)g(or)g(if)f(the)i(\014rst)f(8)g(c)m(haracters)i(of)
+f(the)f(template)h(line)e(are)i(blanks.)0 2157 y(More)c(than)f(one)h
+(Header-Data)i(Unit)d(\(HDU\))h(ma)m(y)g(b)s(e)f(de\014ned)f(in)g(the)i
+(template)g(\014le.)38 b(The)26 b(start)h(of)g(an)f(HDU)0
+2269 y(de\014nition)i(is)h(denoted)i(with)e(a)i(SIMPLE)e(or)i(XTENSION)
+e(template)i(line:)0 2430 y(1\))j(SIMPLE)f(b)s(egins)f(a)i(Primary)f
+(HDU)h(de\014nition.)48 b(SIMPLE)33 b(ma)m(y)h(only)f(app)s(ear)g(as)h
+(the)g(\014rst)f(k)m(eyw)m(ord)h(in)0 2543 y(the)e(template)h(\014le.)
+44 b(If)32 b(the)g(template)h(\014le)e(b)s(egins)f(with)h(XTENSION)g
+(instead)g(of)h(SIMPLE,)g(then)f(a)i(default)0 2655 y(empt)m(y)d
+(Primary)d(HDU)j(is)f(created,)i(and)d(the)i(template)g(is)e(then)h
+(assumed)f(to)i(de\014ne)f(the)h(k)m(eyw)m(ords)f(starting)0
+2768 y(with)g(the)i(\014rst)e(extension)h(follo)m(wing)f(the)i(Primary)
+e(HDU.)0 2928 y(2\))35 b(XTENSION)e(marks)g(the)i(b)s(eginning)c(of)j
+(a)h(new)e(extension)h(HDU)g(de\014nition.)50 b(The)33
+b(previous)g(HDU)i(will)0 3041 y(b)s(e)30 b(closed)g(at)h(this)e(p)s
+(oin)m(t)h(and)f(pro)s(cessing)h(of)g(the)h(next)f(extension)g(b)s
+(egins.)0 3373 y Fd(5.2)135 b(Auto-indexing)45 b(of)h(Keyw)l(ords)0
+3623 y Fi(If)31 b(a)h(template)f(k)m(eyw)m(ord)h(name)f(ends)g(with)f
+(a)h("#")h(c)m(haracter,)i(it)d(is)f(said)g(to)i(b)s(e)f
+('auto-indexed'.)43 b(Eac)m(h)32 b("#")0 3736 y(c)m(haracter)i(will)c
+(b)s(e)i(replaced)h(b)m(y)f(the)h(curren)m(t)g(in)m(teger)g(index)e(v)
+-5 b(alue,)33 b(whic)m(h)f(gets)h(reset)h(=)e(1)h(at)h(the)e(start)i
+(of)0 3849 y(eac)m(h)h(new)f(HDU)g(in)f(the)h(\014le)f(\(or)h(7)h(in)d
+(the)i(sp)s(ecial)f(case)i(of)f(a)g(GR)m(OUP)h(de\014nition\).)49
+b(The)33 b(FIRST)g(indexed)0 3962 y(k)m(eyw)m(ord)c(in)e(eac)m(h)i
+(template)g(HDU)g(de\014nition)d(is)h(used)g(as)i(the)f('incremen)m
+(tor';)i(eac)m(h)f(subsequen)m(t)f(o)s(ccurrence)0 4075
+y(of)k(this)e(SAME)h(k)m(eyw)m(ord)h(will)d(cause)j(the)g(index)e(v)-5
+b(alue)31 b(to)h(b)s(e)f(incremen)m(ted.)43 b(This)30
+b(b)s(eha)m(vior)g(can)i(b)s(e)f(rather)0 4188 y(subtle,)c(as)h
+(illustrated)e(in)g(the)i(follo)m(wing)e(examples)h(in)f(whic)m(h)h
+(the)h(TTYPE)e(k)m(eyw)m(ord)i(is)f(the)h(incremen)m(tor)f(in)0
+4300 y(b)s(oth)j(cases:)95 4546 y Fe(TTYPE#)47 b(=)g(TIME)95
+4659 y(TFORM#)g(=)g(1D)95 4772 y(TTYPE#)g(=)g(RATE)95
+4884 y(TFORM#)g(=)g(1E)0 5130 y Fi(will)23 b(create)28
+b(TTYPE1,)e(TF)m(ORM1,)i(TTYPE2,)f(and)e(TF)m(ORM2)i(k)m(eyw)m(ords.)40
+b(But)26 b(if)f(the)h(template)g(lo)s(oks)f(lik)m(e,)95
+5375 y Fe(TTYPE#)47 b(=)g(TIME)95 5488 y(TTYPE#)g(=)g(RATE)95
+5601 y(TFORM#)g(=)g(1D)95 5714 y(TFORM#)g(=)g(1E)p eop
+%%Page: 43 49
+43 48 bop 0 299 a Fg(5.3.)72 b(TEMPLA)-8 b(TE)30 b(P)-8
+b(ARSER)30 b(DIRECTIVES)2073 b Fi(43)0 555 y(this)30
+b(results)f(in)h(a)h(FITS)f(\014les)g(with)f(TTYPE1,)i(TTYPE2,)g(TF)m
+(ORM2,)h(and)e(TF)m(ORM2,)i(whic)m(h)e(is)g(probably)0
+668 y(not)h(what)f(w)m(as)h(in)m(tended!)0 1000 y Fd(5.3)135
+b(T)-11 b(emplate)46 b(P)l(arser)g(Directiv)l(es)0 1251
+y Fi(In)29 b(addition)g(to)h(the)g(template)h(lines)d(whic)m(h)h
+(de\014ne)g(individual)d(k)m(eyw)m(ords,)k(the)g(template)h(parser)e
+(recognizes)0 1363 y(3)h(sp)s(ecial)f(directiv)m(es)g(whic)m(h)g(are)h
+(eac)m(h)h(preceded)f(b)m(y)f(the)h(bac)m(kslash)g(c)m(haracter:)90
+b Fe(\\include,)45 b(\\group)p Fi(,)29 b(and)48 1476
+y Fe(\\end)p Fi(.)0 1637 y(The)37 b('include')f(directiv)m(e)i(m)m(ust)
+f(b)s(e)h(follo)m(w)m(ed)f(b)m(y)h(a)g(\014lename.)62
+b(It)38 b(forces)g(the)g(parser)f(to)i(temp)s(orarily)d(stop)0
+1749 y(reading)e(the)h(curren)m(t)g(template)g(\014le)f(and)g(b)s(egin)
+g(reading)g(the)h(include)d(\014le.)54 b(Once)35 b(the)g(parser)f(reac)
+m(hes)i(the)0 1862 y(end)f(of)h(the)g(include)d(\014le)i(it)g(con)m
+(tin)m(ues)g(parsing)g(the)g(curren)m(t)h(template)g(\014le.)55
+b(Include)34 b(\014les)h(can)h(b)s(e)f(nested,)0 1975
+y(and)30 b(HDU)h(de\014nitions)d(can)i(span)g(m)m(ultiple)e(template)j
+(\014les.)0 2135 y(The)g(start)h(of)g(a)g(GR)m(OUP)h(de\014nition)c(is)
+i(denoted)h(with)e(the)i('group')g(directiv)m(e,)f(and)h(the)f(end)h
+(of)f(a)i(GR)m(OUP)0 2248 y(de\014nition)i(is)i(denoted)g(with)f(the)i
+('end')f(directiv)m(e.)61 b(Eac)m(h)39 b(GR)m(OUP)e(con)m(tains)h(0)g
+(or)f(more)h(mem)m(b)s(er)f(blo)s(c)m(ks)0 2361 y(\(HDUs)44
+b(or)f(GR)m(OUPs\).)79 b(Mem)m(b)s(er)42 b(blo)s(c)m(ks)h(of)g(t)m(yp)s
+(e)g(GR)m(OUP)g(can)g(con)m(tain)g(their)f(o)m(wn)h(mem)m(b)s(er)f(blo)
+s(c)m(ks.)0 2474 y(The)32 b(GR)m(OUP)g(de\014nition)e(itself)h(o)s
+(ccupies)h(one)g(FITS)g(\014le)f(HDU)i(of)f(sp)s(ecial)f(t)m(yp)s(e)h
+(\(GR)m(OUP)h(HDU\),)h(so)e(if)g(a)0 2587 y(template)f(sp)s(eci\014es)e
+(1)i(group)e(with)g(1)i(mem)m(b)s(er)f(HDU)h(lik)m(e:)0
+2838 y Fe(\\group)0 2951 y(grpdescr)46 b(=)h('demo')0
+3064 y(xtension)f(bintable)0 3177 y(#)h(this)g(bintable)f(has)h(0)g
+(cols,)f(0)i(rows)0 3290 y(\\end)0 3541 y Fi(then)30
+b(the)h(parser)e(creates)j(a)f(FITS)f(\014le)f(with)g(3)i(HDUs)g(:)0
+3792 y Fe(1\))47 b(dummy)g(PHDU)0 3905 y(2\))g(GROUP)g(HDU)f(\(has)h(1)
+h(member,)d(which)i(is)g(bintable)e(in)j(HDU)f(number)f(3\))0
+4018 y(3\))h(bintable)f(\(member)g(of)h(GROUP)f(in)h(HDU)g(number)f
+(2\))0 4269 y Fi(T)-8 b(ec)m(hnically)29 b(sp)s(eaking,)g(the)g(GR)m
+(OUP)i(HDU)f(is)f(a)h(BINT)-8 b(ABLE)30 b(with)f(6)h(columns.)39
+b(Applications)28 b(can)i(de\014ne)0 4382 y(additional)20
+b(columns)h(in)f(a)j(GR)m(OUP)f(HDU)h(using)e(TF)m(ORMn)g(and)h(TTYPEn)
+f(\(where)g(n)h(is)f(7,)j(8,)h(....\))39 b(k)m(eyw)m(ords)0
+4494 y(or)30 b(their)g(auto-indexing)f(equiv)-5 b(alen)m(ts.)0
+4655 y(F)d(or)26 b(a)f(more)g(complicated)f(example)g(of)h(a)h
+(template)f(\014le)f(using)f(the)i(group)f(directiv)m(es,)i(lo)s(ok)e
+(at)h(the)g(sample.tpl)0 4767 y(\014le)k(that)i(is)f(included)d(in)j
+(the)g(CFITSIO)f(distribution.)0 5100 y Fd(5.4)135 b(F)-11
+b(ormal)46 b(T)-11 b(emplate)45 b(Syn)l(tax)0 5350 y
+Fi(The)30 b(template)h(syn)m(tax)g(can)f(formally)f(b)s(e)h(de\014ned)f
+(as)i(follo)m(ws:)191 5601 y Fe(TEMPLATE)45 b(=)j(BLOCK)e([)i(BLOCK)e
+(...)h(])p eop
+%%Page: 44 50
+44 49 bop 0 299 a Fi(44)2340 b Fg(CHAPTER)30 b(5.)71
+b(TEMPLA)-8 b(TE)30 b(FILES)334 555 y Fe(BLOCK)46 b(=)i({)f(HDU)g(|)h
+(GROUP)e(})334 781 y(GROUP)g(=)i(\\GROUP)e([)h(BLOCK)g(...)g(])g(\\END)
+430 1007 y(HDU)f(=)i(XTENSION)d([)j(LINE)f(...)f(])i({)f(XTENSION)f(|)h
+(\\GROUP)f(|)i(\\END)f(|)g(EOF)g(})382 1233 y(LINE)f(=)i([)f(KEYWORD)f
+([)i(=)f(])h(])f([)g(VALUE)g(])g([)h(/)f(COMMENT)f(])191
+1458 y(X)h(...)238 b(-)48 b(X)f(can)g(be)g(present)f(1)h(or)h(more)e
+(times)191 1571 y({)h(X)h(|)f(Y)h(})f(-)h(X)f(or)g(Y)191
+1684 y([)g(X)h(])238 b(-)48 b(X)f(is)g(optional)0 1937
+y Fi(A)m(t)34 b(the)f(topmost)g(lev)m(el,)g(the)g(template)h(de\014nes)
+d(1)j(or)e(more)h(template)g(blo)s(c)m(ks.)48 b(Blo)s(c)m(ks)33
+b(can)g(b)s(e)f(either)g(HDU)0 2050 y(\(Header)27 b(Data)h(Unit\))f(or)
+f(a)h(GR)m(OUP)-8 b(.)28 b(F)-8 b(or)27 b(eac)m(h)g(blo)s(c)m(k)f(the)h
+(parser)f(creates)i(1)f(\(or)g(more)f(for)h(GR)m(OUPs\))g(FITS)0
+2163 y(\014le)i(HDUs.)0 2495 y Fd(5.5)135 b(Errors)0
+2745 y Fi(In)24 b(general)g(the)g(\014ts)p 692 2745 28
+4 v 33 w(execute)p 1019 2745 V 34 w(template\(\))h(function)e(tries)h
+(to)h(b)s(e)f(as)g(atomic)h(as)g(p)s(ossible,)e(so)h(either)g(ev)m
+(erything)0 2858 y(is)f(done)h(or)g(nothing)e(is)h(done.)39
+b(If)23 b(an)h(error)f(o)s(ccurs)h(during)e(parsing)g(of)i(the)g
+(template,)i(\014ts)p 3125 2858 V 33 w(execute)p 3452
+2858 V 34 w(template\(\))0 2971 y(will)i(\(try)j(to\))h(delete)f(the)g
+(top)g(lev)m(el)f(BLOCK)g(\(with)g(all)f(its)i(c)m(hildren)d(if)i(an)m
+(y\))h(in)f(whic)m(h)f(the)i(error)f(o)s(ccurred,)0 3084
+y(then)g(it)g(will)e(stop)i(reading)g(the)g(template)h(\014le)e(and)h
+(it)g(will)e(return)h(with)g(an)h(error.)0 3417 y Fd(5.6)135
+b(Examples)0 3667 y Fi(1.)54 b(This)33 b(template)i(\014le)f(will)e
+(create)k(a)f(200)h(x)e(300)i(pixel)d(image,)k(with)c(4-b)m(yte)j(in)m
+(teger)f(pixel)e(v)-5 b(alues,)35 b(in)f(the)0 3780 y(primary)28
+b(HDU:)95 4032 y Fe(SIMPLE)47 b(=)g(T)95 4145 y(BITPIX)g(=)g(32)95
+4258 y(NAXIS)g(=)g(2)239 b(/)47 b(number)f(of)h(dimensions)95
+4371 y(NAXIS1)g(=)g(100)95 b(/)47 b(length)f(of)h(first)g(axis)95
+4484 y(NAXIS2)g(=)g(200)95 b(/)47 b(length)f(of)h(second)f(axis)95
+4597 y(OBJECT)h(=)g(NGC)g(253)g(/)g(name)g(of)g(observed)f(object)0
+4850 y Fi(The)35 b(allo)m(w)m(ed)g(v)-5 b(alues)35 b(of)g(BITPIX)g(are)
+h(8,)h(16,)h(32,)g(-32,)g(or)d(-64,)j(represen)m(ting,)e(resp)s(ectiv)m
+(ely)-8 b(,)37 b(8-bit)e(in)m(teger,)0 4962 y(16-bit)c(in)m(teger,)g
+(32-bit)f(in)m(teger,)h(32-bit)g(\015oating)f(p)s(oin)m(t,)g(or)g(64)h
+(bit)f(\015oating)g(p)s(oin)m(t)f(pixels.)0 5123 y(2.)39
+b(T)-8 b(o)23 b(create)h(a)f(FITS)e(table,)k(the)d(template)h(\014rst)f
+(needs)g(to)i(include)c(XTENSION)i(=)g(T)-8 b(ABLE)23
+b(or)f(BINT)-8 b(ABLE)0 5235 y(to)31 b(de\014ne)e(whether)g(it)g(is)g
+(an)g(ASCI)s(I)g(or)g(binary)f(table,)i(and)g(NAXIS2)g(to)g(de\014ne)f
+(the)h(n)m(um)m(b)s(er)f(of)h(ro)m(ws)f(in)g(the)0 5348
+y(table.)49 b(Tw)m(o)34 b(template)f(lines)f(are)i(then)f(needed)f(to)i
+(de\014ne)f(the)g(name)h(\(TTYPEn\))e(and)h(FITS)g(data)h(format)0
+5461 y(\(TF)m(ORMn\))d(of)f(the)h(columns,)e(as)i(in)e(this)g(example:)
+95 5714 y Fe(xtension)46 b(=)h(bintable)p eop
+%%Page: 45 51
+45 50 bop 0 299 a Fg(5.6.)72 b(EXAMPLES)3084 b Fi(45)95
+555 y Fe(naxis2)47 b(=)g(40)95 668 y(ttype#)g(=)g(Name)95
+781 y(tform#)g(=)g(10a)95 894 y(ttype#)g(=)g(Npoints)95
+1007 y(tform#)g(=)g(j)95 1120 y(ttype#)g(=)g(Rate)95
+1233 y(tunit#)g(=)g(counts/s)95 1346 y(tform#)g(=)g(e)0
+1605 y Fi(The)26 b(ab)s(o)m(v)m(e)j(example)d(de\014nes)g(a)i(n)m(ull)d
+(primary)g(arra)m(y)i(follo)m(w)m(ed)g(b)m(y)g(a)g(40-ro)m(w)h(binary)d
+(table)i(extension)g(with)f(3)0 1718 y(columns)h(called)g('Name',)j
+('Np)s(oin)m(ts',)e(and)g('Rate',)i(with)d(data)i(formats)f(of)g('10A')
+i(\(ASCI)s(I)d(c)m(haracter)i(string\),)0 1831 y('1J')k(\(in)m(teger\))
+h(and)e('1E')i(\(\015oating)e(p)s(oin)m(t\),)h(resp)s(ectiv)m(ely)-8
+b(.)48 b(Note)34 b(that)f(the)g(other)g(required)e(FITS)h(k)m(eyw)m
+(ords)0 1944 y(\(BITPIX,)37 b(NAXIS,)g(NAXIS1,)h(PCOUNT,)e(GCOUNT,)h
+(TFIELDS,)f(and)g(END\))h(do)g(not)g(need)f(to)h(b)s(e)f(ex-)0
+2057 y(plicitly)f(de\014ned)h(in)h(the)g(template)h(b)s(ecause)g(their)
+f(v)-5 b(alues)37 b(can)h(b)s(e)f(inferred)e(from)j(the)f(other)h(k)m
+(eyw)m(ords)g(in)0 2170 y(the)d(template.)54 b(This)33
+b(example)i(also)g(illustrates)d(that)k(the)f(templates)g(are)g
+(generally)f(case-insensitiv)m(e)g(\(the)0 2283 y(k)m(eyw)m(ord)29
+b(names)g(and)g(TF)m(ORMn)f(v)-5 b(alues)29 b(are)g(con)m(v)m(erted)i
+(to)e(upp)s(er-case)g(in)e(the)i(FITS)g(\014le\))f(and)g(that)i(string)
+0 2396 y(k)m(eyw)m(ord)h(v)-5 b(alues)30 b(generally)f(do)h(not)h(need)
+f(to)h(b)s(e)f(enclosed)g(in)f(quotes.)p eop
+%%Page: 46 52
+46 51 bop 0 299 a Fi(46)2340 b Fg(CHAPTER)30 b(5.)71
+b(TEMPLA)-8 b(TE)30 b(FILES)p eop
+%%Page: 47 53
+47 52 bop 0 1225 a Ff(Chapter)65 b(6)0 1687 y Fl(FITSIO)76
 b(Con)-6 b(v)g(en)g(tions)76 b(and)h(Guidelines)0 2216
-y Fd(5.1)135 b(CFITSIO)44 b(Size)h(Limitations)0 2589
+y Fd(6.1)135 b(CFITSIO)44 b(Size)h(Limitations)0 2476
 y Fi(CFITSIO)31 b(places)h(few)h(restrictions)e(on)i(the)f(size)h(of)f
 (FITS)g(\014les)g(that)h(it)f(reads)g(or)h(writes.)46
-b(There)32 b(are)h(a)g(few)0 2702 y(limits,)28 b(ho)m(w)m(ev)m(er,)k
+b(There)32 b(are)h(a)g(few)0 2589 y(limits,)28 b(ho)m(w)m(ev)m(er,)k
 (whic)m(h)d(ma)m(y)i(a\013ect)h(some)f(extreme)g(cases:)0
-2862 y(1.)48 b(The)33 b(maxim)m(um)e(n)m(um)m(b)s(er)h(of)h(\014les)f
-(that)h(ma)m(y)g(b)s(e)g(sim)m(ultaneously)d(op)s(ened)i(is)g(limited)f
-(to)i(the)g(n)m(um)m(b)s(er)f(of)0 2975 y(in)m(ternal)25
-b(IO)g(bu\013ers)g(allo)s(cated)h(in)e(CFITSIO)h(\(curren)m(tly)g(25,)j
-(as)e(de\014ned)f(b)m(y)h(NIOBUF)g(in)f(the)h(\014le)f(\014tsio2.h\),)0
-3088 y(or)34 b(b)m(y)g(the)g(limit)e(of)i(the)g(underlying)d(C)i
-(compiler)g(or)h(mac)m(hine)f(op)s(erating)h(system,)h(whic)m(h)d(ev)m
-(er)j(is)e(smaller.)0 3201 y(The)28 b(C)h(sym)m(b)s(olic)e(constan)m(t)
-j(F)m(OPEN)p 1344 3201 28 4 v 33 w(MAX)g(usually)c(de\014nes)i(the)h
-(total)h(n)m(um)m(b)s(er)d(of)i(\014les)f(that)i(ma)m(y)f(op)s(en)f(at)
-0 3314 y(once)j(\(this)f(includes)e(an)m(y)i(other)h(text)g(or)g
-(binary)d(\014les)i(whic)m(h)f(ma)m(y)i(b)s(e)f(op)s(en,)f(not)i(just)f
-(FITS)g(\014les\).)0 3474 y(2.)50 b(The)32 b(maxim)m(um)g(n)m(um)m(b)s
-(er)g(of)i(extensions)e(\(HDUs\))j(that)f(can)f(b)s(e)g(read)g(or)g
-(written)f(in)g(a)i(single)d(FITS)i(\014le)0 3587 y(is)c(curren)m(tly)g
-(set)i(to)f(1000)i(as)e(de\014ned)f(b)m(y)h(MAXHDU)h(in)e(the)h
-(\014tsio.h)f(\014le.)40 b(This)28 b(v)-5 b(alue)30 b(ma)m(y)g(b)s(e)g
-(increased)f(if)0 3700 y(necessary)-8 b(,)31 b(but)f(the)h(access)g
-(times)f(to)h(the)g(later)f(extensions)g(in)f(suc)m(h)h(\014les)g(ma)m
-(y)h(b)s(ecome)f(excessiv)m(ely)h(long.)0 3860 y(3.)54
-b(By)35 b(default,)g(CFITSIO)e(can)i(handle)f(FITS)g(\014les)f(up)h(to)
-h(2.1)h(GB)g(in)d(size)i(\(2**31)i(b)m(ytes\).)54 b(This)33
-b(\014le)h(size)0 3973 y(limit)k(is)i(often)g(imp)s(osed)f(b)m(y)h
-(32-bit)h(op)s(erating)e(systems.)71 b(More)41 b(recen)m(tly)-8
-b(,)44 b(as)d(64-bit)f(op)s(erating)g(systems)0 4086
-y(b)s(ecome)33 b(more)g(common,)g(an)g(industry-wide)c(standard)j(\(at)
-i(least)e(on)h(Unix)e(systems\))i(has)g(b)s(een)f(dev)m(elop)s(ed)0
-4199 y(to)39 b(supp)s(ort)d(larger)h(sized)h(\014les)f(\(see)h(h)m
-(ttp://ftp.sas.com/standards/large.\014le/\).)66 b(Starting)38
-b(with)e(v)m(ersion)0 4312 y(2.1)j(of)e(CFITSIO,)g(larger)g(FITS)g
-(\014les)f(up)h(to)h(6)g(terab)m(ytes)h(in)d(size)h(ma)m(y)i(b)s(e)e
-(read)g(and)g(written)g(on)g(certain)0 4425 y(supp)s(orted)32
-b(platforms.)50 b(In)34 b(order)f(to)i(supp)s(ort)d(these)i(larger)g
-(\014les,)g(CFITSIO)f(m)m(ust)g(b)s(e)h(compiled)e(with)h(the)0
-4538 y(`-D)p 129 4538 V 34 w(FILE)p 374 4538 V 32 w(OFFSET)p
-774 4538 V 32 w(BITS=64')25 b(compiler)e(\015ag.)39 b(All)23
-b(programs)h(whic)m(h)f(link)f(to)j(the)f(CFITSIO)f(library)f(m)m(ust)0
-4650 y(also)j(b)s(e)f(compiled)f(with)h(this)f(\015ag)i(or)g(m)m(ust)g
-(include)d(this)i(prepro)s(cessor)g(de\014nition)e(at)k(the)f(start)g
-(of)g(the)g(source)0 4763 y(co)s(de)37 b(\014le.)60 b(This)35
-b(causes)i(the)g(compiler)f(to)h(allo)s(cate)h(8-b)m(ytes)g(instead)e
-(of)h(4-b)m(ytes)h(for)f(the)g(`o\013)p 3423 4763 V 34
-w(t')g(datat)m(yp)s(e)0 4876 y(whic)m(h)29 b(is)h(used)f(to)i(store)g
-(\014le)f(o\013set)h(p)s(ositions.)0 5036 y(If)20 b(CFITSIO)f(is)h
-(compiled)f(with)h(the)g(-D)p 1383 5036 V 34 w(FILE)p
-1628 5036 V 33 w(OFFSET)p 2029 5036 V 32 w(BITS=64)g(\015ag)h(on)g(a)g
-(platform)f(that)h(supp)s(orts)e(large)0 5149 y(\014les,)27
-b(then)g(it)g(can)h(read)f(and)g(write)g(FITS)f(\014les)h(that)h(con)m
-(tain)f(up)g(to)h(2**31)h(2880-b)m(yte)i(FITS)26 b(records,)i(or)g(ap-)
-0 5262 y(pro)m(ximately)c(6)g(terab)m(ytes)i(in)d(size.)39
-b(It)24 b(is)f(still)f(required)h(that)i(the)f(v)-5 b(alue)24
-b(of)h(the)f(NAXISn)g(and)f(PCOUNT)h(k)m(ey-)0 5375 y(w)m(ords)h(in)f
-(eac)m(h)i(extension)f(b)s(e)g(within)d(the)k(range)f(of)h(a)f(signed)f
-(4-b)m(yte)j(in)m(teger)f(\(max)f(v)-5 b(alue)25 b(=)g
-(2,147,483,648\).)0 5488 y(Th)m(us,)39 b(eac)m(h)h(dimension)c(of)i(an)
-g(image)h(\(giv)m(en)f(b)m(y)h(the)f(NAXISn)g(k)m(eyw)m(ords\),)j(the)d
-(total)h(width)e(of)h(a)h(table)0 5601 y(\(NAXIS1)e(k)m(eyw)m(ord\),)i
-(the)e(n)m(um)m(b)s(er)e(of)h(ro)m(ws)h(in)e(a)i(table)f(\(NAXIS2)h(k)m
-(eyw)m(ord\),)i(and)d(the)h(total)g(size)f(of)h(the)0
-5714 y(v)-5 b(ariable-length)29 b(arra)m(y)i(heap)f(in)f(binary)g
-(tables)h(\(PCOUNT)g(k)m(eyw)m(ord\))h(m)m(ust)f(b)s(e)g(less)g(than)g
-(this)f(limit.)1905 5942 y(39)p eop
-%%Page: 40 46
-40 45 bop 0 299 a Fi(40)1277 b Fg(CHAPTER)29 b(5.)72
+2749 y(1.)43 b(The)31 b(maxim)m(um)f(n)m(um)m(b)s(er)g(of)h(FITS)f
+(\014les)g(that)i(ma)m(y)g(b)s(e)e(sim)m(ultaneously)f(op)s(ened)i(b)m
+(y)g(CFITSIO)e(is)h(set)i(b)m(y)0 2862 y(NMAXFILES)i(as)g(de\014ned)f
+(in)g(\014tsio2.h.)51 b(It)34 b(is)f(curren)m(tly)g(set)i(=)f(300)h(b)m
+(y)f(default.)51 b(CFITSIO)32 b(will)f(allo)s(cate)0
+2975 y(ab)s(out)i(80)g(*)h(NMAXFILES)f(b)m(ytes)g(of)g(memory)g(for)g
+(in)m(ternal)e(use.)48 b(Note)34 b(that)g(the)f(underlying)d(C)i
+(compiler)0 3088 y(or)39 b(op)s(erating)g(system,)k(ma)m(y)d(ha)m(v)m
+(e)g(a)g(smaller)e(limit)g(on)h(the)h(n)m(um)m(b)s(er)e(of)i(op)s(ened)
+e(\014les.)67 b(The)39 b(C)h(sym)m(b)s(olic)0 3201 y(constan)m(t)31
+b(F)m(OPEN)p 690 3201 28 4 v 34 w(MAX)f(is)f(in)m(tended)g(to)i
+(de\014ne)e(the)i(maxim)m(um)e(n)m(um)m(b)s(er)f(of)j(\014les)e(that)h
+(ma)m(y)h(op)s(en)e(at)i(once)0 3314 y(\(including)d(an)m(y)j(other)g
+(text)h(or)f(binary)e(\014les)h(that)i(ma)m(y)f(b)s(e)g(op)s(en,)f(not)
+h(just)g(FITS)f(\014les\).)42 b(On)30 b(some)h(systems)0
+3427 y(it)f(has)g(b)s(een)g(found)f(that)i(gcc)g(supp)s(orts)e(a)h
+(maxim)m(um)g(of)g(255)i(op)s(ened)e(\014les.)0 3587
+y(Note)d(that)e(op)s(ening)f(and)h(op)s(erating)g(on)g(man)m(y)g(FITS)g
+(\014les)f(sim)m(ultaneously)f(in)h(parallel)f(ma)m(y)j(b)s(e)f(less)f
+(e\016cien)m(t)0 3700 y(than)k(op)s(erating)g(on)g(smaller)f(groups)h
+(of)h(\014les)e(in)g(series.)40 b(CFITSIO)27 b(only)g(has)h(NIOBUF)h(n)
+m(um)m(b)s(er)f(of)g(in)m(ternal)0 3813 y(bu\013ers)j(\(set)j(=)e(40)i
+(b)m(y)e(default\))h(that)g(are)g(used)f(for)g(temp)s(orary)g(storage)i
+(of)f(the)g(most)g(recen)m(t)h(data)f(records)0 3926
+y(that)40 b(ha)m(v)m(e)g(b)s(een)e(read)h(or)g(written)f(in)f(the)i
+(FITS)f(\014les.)66 b(If)38 b(the)h(n)m(um)m(b)s(er)f(of)h(op)s(ened)f
+(\014les)g(is)g(greater)i(than)0 4039 y(NIOBUF,)j(then)f(CFITSIO)e(ma)m
+(y)j(w)m(aste)h(more)e(time)g(\015ushing)d(and)j(re-reading)g(or)g
+(re-writing)e(the)j(same)0 4152 y(records)30 b(in)f(the)i(FITS)e
+(\014les.)0 4312 y(2.)54 b(By)35 b(default,)g(CFITSIO)e(can)i(handle)f
+(FITS)g(\014les)f(up)h(to)h(2.1)h(GB)g(in)d(size)i(\(2**31)i(b)m
+(ytes\).)54 b(This)33 b(\014le)h(size)0 4425 y(limit)k(is)i(often)g
+(imp)s(osed)f(b)m(y)h(32-bit)h(op)s(erating)e(systems.)71
+b(More)41 b(recen)m(tly)-8 b(,)44 b(as)d(64-bit)f(op)s(erating)g
+(systems)0 4538 y(b)s(ecome)33 b(more)g(common,)g(an)g(industry-wide)c
+(standard)j(\(at)i(least)e(on)h(Unix)e(systems\))i(has)g(b)s(een)f(dev)
+m(elop)s(ed)0 4650 y(to)39 b(supp)s(ort)d(larger)h(sized)h(\014les)f
+(\(see)h(h)m(ttp://ftp.sas.com/standards/large.\014le/\).)66
+b(Starting)38 b(with)e(v)m(ersion)0 4763 y(2.1)j(of)e(CFITSIO,)g
+(larger)g(FITS)g(\014les)f(up)h(to)h(6)g(terab)m(ytes)h(in)d(size)h(ma)
+m(y)i(b)s(e)e(read)g(and)g(written)g(on)g(certain)0 4876
+y(supp)s(orted)32 b(platforms.)50 b(In)34 b(order)f(to)i(supp)s(ort)d
+(these)i(larger)g(\014les,)g(CFITSIO)f(m)m(ust)g(b)s(e)h(compiled)e
+(with)h(the)0 4989 y(`-D)p 129 4989 V 34 w(FILE)p 374
+4989 V 32 w(OFFSET)p 774 4989 V 32 w(BITS=64')25 b(compiler)e(\015ag.)
+39 b(All)23 b(programs)h(whic)m(h)f(link)f(to)j(the)f(CFITSIO)f
+(library)f(m)m(ust)0 5102 y(also)j(b)s(e)f(compiled)f(with)h(this)f
+(\015ag)i(or)g(m)m(ust)g(include)d(this)i(prepro)s(cessor)g
+(de\014nition)e(at)k(the)f(start)g(of)g(the)g(source)0
+5215 y(co)s(de)37 b(\014le.)60 b(This)35 b(causes)i(the)g(compiler)f
+(to)h(allo)s(cate)h(8-b)m(ytes)g(instead)e(of)h(4-b)m(ytes)h(for)f(the)
+g(`o\013)p 3423 5215 V 34 w(t')g(datat)m(yp)s(e)0 5328
+y(whic)m(h)29 b(is)h(used)f(to)i(store)g(\014le)f(o\013set)h(p)s
+(ositions.)0 5488 y(If)20 b(CFITSIO)f(is)h(compiled)f(with)h(the)g(-D)p
+1383 5488 V 34 w(FILE)p 1628 5488 V 33 w(OFFSET)p 2029
+5488 V 32 w(BITS=64)g(\015ag)h(on)g(a)g(platform)f(that)h(supp)s(orts)e
+(large)0 5601 y(\014les,)27 b(then)g(it)g(can)h(read)f(and)g(write)g
+(FITS)f(\014les)h(that)h(con)m(tain)f(up)g(to)h(2**31)h(2880-b)m(yte)i
+(FITS)26 b(records,)i(or)g(ap-)0 5714 y(pro)m(ximately)c(6)g(terab)m
+(ytes)i(in)d(size.)39 b(It)24 b(is)f(still)f(required)h(that)i(the)f(v)
+-5 b(alue)24 b(of)h(the)f(NAXISn)g(and)f(PCOUNT)h(k)m(ey-)1905
+5942 y(47)p eop
+%%Page: 48 54
+48 53 bop 0 299 a Fi(48)1277 b Fg(CHAPTER)29 b(6.)72
 b(FITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fi(Curren)m(tly)-8 b(,)27 b(supp)s(ort)e(for)i(large)g(\014les)f
-(within)f(CFITSIO)h(has)h(only)f(b)s(een)g(tested)i(on)f(the)h(Solaris)
-d(2.6)j(op)s(erating)0 668 y(system)j(using)d(the)j(Sun)e(cc)i
-(compiler)e(or)h(gcc)i(2.95.2.)0 1133 y Fd(5.2)135 b(Multiple)46
-b(Access)e(to)i(the)f(Same)g(FITS)f(File)0 1409 y Fi(CFITSIO)35
-b(supp)s(orts)g(sim)m(ultaneous)g(read)h(and)g(write)g(access)h(to)h(m)
-m(ultiple)c(HDUs)j(in)e(the)i(same)g(FITS)f(\014le.)0
-1522 y(Th)m(us,)43 b(one)e(can)h(op)s(en)e(the)h(same)h(FITS)e(\014le)g
-(t)m(wice)i(within)c(a)k(single)d(program)i(and)g(mo)m(v)m(e)h(to)g(2)f
-(di\013eren)m(t)0 1635 y(HDUs)30 b(in)e(the)i(\014le,)f(and)g(then)g
-(read)h(and)e(write)h(data)h(or)g(k)m(eyw)m(ords)g(to)g(the)g(2)f
-(extensions)h(just)e(as)i(if)f(one)g(w)m(ere)0 1748 y(accessing)e(2)g
-(completely)f(separate)h(FITS)f(\014les.)38 b(Since)26
-b(in)f(general)h(it)g(is)g(not)h(p)s(ossible)d(to)j(ph)m(ysically)d(op)
-s(en)i(the)0 1861 y(same)36 b(\014le)f(t)m(wice)h(and)f(then)g(exp)s
-(ect)h(to)g(b)s(e)f(able)g(to)i(sim)m(ultaneously)c(\(or)j(in)e
-(alternating)h(succession\))h(write)0 1974 y(to)f(2)f(di\013eren)m(t)g
-(lo)s(cations)g(in)e(the)j(\014le,)f(CFITSIO)f(recognizes)i(when)e(the)
-h(\014le)f(to)i(b)s(e)f(op)s(ened)f(\(in)g(the)i(call)e(to)0
-2087 y(\014ts)p 127 2087 28 4 v 32 w(op)s(en)p 349 2087
+Fi(w)m(ords)25 b(in)f(eac)m(h)i(extension)f(b)s(e)g(within)d(the)k
+(range)f(of)h(a)f(signed)f(4-b)m(yte)j(in)m(teger)f(\(max)f(v)-5
+b(alue)25 b(=)g(2,147,483,648\).)0 668 y(Th)m(us,)39
+b(eac)m(h)h(dimension)c(of)i(an)g(image)h(\(giv)m(en)f(b)m(y)h(the)f
+(NAXISn)g(k)m(eyw)m(ords\),)j(the)d(total)h(width)e(of)h(a)h(table)0
+781 y(\(NAXIS1)e(k)m(eyw)m(ord\),)i(the)e(n)m(um)m(b)s(er)e(of)h(ro)m
+(ws)h(in)e(a)i(table)f(\(NAXIS2)h(k)m(eyw)m(ord\),)i(and)d(the)h(total)
+g(size)f(of)h(the)0 894 y(v)-5 b(ariable-length)29 b(arra)m(y)i(heap)f
+(in)f(binary)g(tables)h(\(PCOUNT)g(k)m(eyw)m(ord\))h(m)m(ust)f(b)s(e)g
+(less)g(than)g(this)f(limit.)0 1054 y(Curren)m(tly)-8
+b(,)27 b(supp)s(ort)e(for)i(large)g(\014les)f(within)f(CFITSIO)h(has)h
+(only)f(b)s(een)g(tested)i(on)f(the)h(Solaris)d(2.6)j(op)s(erating)0
+1167 y(system)j(using)d(the)j(Sun)e(cc)i(compiler)e(or)h(gcc)i(2.95.2.)
+0 1524 y Fd(6.2)135 b(Multiple)46 b(Access)e(to)i(the)f(Same)g(FITS)f
+(File)0 1779 y Fi(CFITSIO)35 b(supp)s(orts)g(sim)m(ultaneous)g(read)h
+(and)g(write)g(access)h(to)h(m)m(ultiple)c(HDUs)j(in)e(the)i(same)g
+(FITS)f(\014le.)0 1892 y(Th)m(us,)43 b(one)e(can)h(op)s(en)e(the)h
+(same)h(FITS)e(\014le)g(t)m(wice)i(within)c(a)k(single)d(program)i(and)
+g(mo)m(v)m(e)h(to)g(2)f(di\013eren)m(t)0 2005 y(HDUs)30
+b(in)e(the)i(\014le,)f(and)g(then)g(read)h(and)e(write)h(data)h(or)g(k)
+m(eyw)m(ords)g(to)g(the)g(2)f(extensions)h(just)e(as)i(if)f(one)g(w)m
+(ere)0 2118 y(accessing)e(2)g(completely)f(separate)h(FITS)f(\014les.)
+38 b(Since)26 b(in)f(general)h(it)g(is)g(not)h(p)s(ossible)d(to)j(ph)m
+(ysically)d(op)s(en)i(the)0 2231 y(same)36 b(\014le)f(t)m(wice)h(and)f
+(then)g(exp)s(ect)h(to)g(b)s(e)f(able)g(to)i(sim)m(ultaneously)c(\(or)j
+(in)e(alternating)h(succession\))h(write)0 2344 y(to)f(2)f(di\013eren)m
+(t)g(lo)s(cations)g(in)e(the)j(\014le,)f(CFITSIO)f(recognizes)i(when)e
+(the)h(\014le)f(to)i(b)s(e)f(op)s(ened)f(\(in)g(the)i(call)e(to)0
+2457 y(\014ts)p 127 2457 28 4 v 32 w(op)s(en)p 349 2457
 V 33 w(\014le\))28 b(has)g(already)g(b)s(een)g(op)s(ened)g(and)g
 (instead)g(of)h(actually)f(op)s(ening)f(the)i(\014le)f(again,)h(just)f
-(logically)0 2199 y(links)g(the)j(new)f(\014le)g(to)h(the)g(old)e
+(logically)0 2570 y(links)g(the)j(new)f(\014le)g(to)h(the)g(old)e
 (\014le.)41 b(\(This)29 b(only)h(applies)e(if)i(the)h(\014le)e(is)h(op)
-s(ened)g(more)g(than)g(once)i(within)c(the)0 2312 y(same)g(program,)g
+s(ened)g(more)g(than)g(once)i(within)c(the)0 2683 y(same)g(program,)g
 (and)f(do)s(es)h(not)f(prev)m(en)m(t)i(the)f(same)g(\014le)e(from)h(b)s
 (eing)g(sim)m(ultaneously)e(op)s(ened)i(b)m(y)g(more)h(than)0
-2425 y(one)h(program\).)40 b(Then)28 b(b)s(efore)g(CFITSIO)f(reads)h
+2796 y(one)h(program\).)40 b(Then)28 b(b)s(efore)g(CFITSIO)f(reads)h
 (or)h(writes)f(to)h(either)f(\(logical\))h(\014le,)f(it)g(mak)m(es)i
-(sure)d(that)j(an)m(y)0 2538 y(mo)s(di\014cations)g(made)h(to)h(the)g
+(sure)d(that)j(an)m(y)0 2908 y(mo)s(di\014cations)g(made)h(to)h(the)g
 (other)g(\014le)e(ha)m(v)m(e)j(b)s(een)e(completely)g(\015ushed)e(from)
-i(the)h(in)m(ternal)e(bu\013ers)h(to)h(the)0 2651 y(\014le.)43
+i(the)h(in)m(ternal)e(bu\013ers)h(to)h(the)0 3021 y(\014le.)43
 b(Th)m(us,)30 b(in)g(principle,)f(one)i(could)f(op)s(en)h(a)h(\014le)e
 (t)m(wice,)i(in)e(one)i(case)g(p)s(oin)m(ting)e(to)i(the)f(\014rst)g
-(extension)g(and)0 2764 y(in)i(the)i(other)g(p)s(oin)m(ting)d(to)k(the)
+(extension)g(and)0 3134 y(in)i(the)i(other)g(p)s(oin)m(ting)d(to)k(the)
 e(2nd)g(extension)h(and)e(then)i(write)e(data)j(to)f(b)s(oth)f
-(extensions,)h(in)e(an)m(y)i(order,)0 2877 y(without)24
+(extensions,)h(in)e(an)m(y)i(order,)0 3247 y(without)24
 b(danger)i(of)f(corrupting)g(the)g(\014le,)h(There)f(ma)m(y)h(b)s(e)f
 (some)h(e\016ciency)f(p)s(enalties)f(in)g(doing)h(this)f(ho)m(w)m(ev)m
-(er,)0 2990 y(since)j(CFITSIO)g(has)h(to)h(\015ush)d(all)h(the)h(in)m
+(er,)0 3360 y(since)j(CFITSIO)g(has)h(to)h(\015ush)d(all)h(the)h(in)m
 (ternal)f(bu\013ers)g(related)h(to)h(one)f(\014le)f(b)s(efore)h(switc)m
-(hing)e(to)j(the)f(other,)0 3103 y(so)i(it)g(w)m(ould)f(still)f(b)s(e)i
+(hing)e(to)j(the)f(other,)0 3473 y(so)i(it)g(w)m(ould)f(still)f(b)s(e)i
 (pruden)m(t)f(to)i(minimize)d(the)i(n)m(um)m(b)s(er)f(of)i(times)e(one)
 i(switc)m(hes)f(bac)m(k)h(and)e(forth)h(b)s(et)m(w)m(een)0
-3216 y(doing)f(I/O)i(to)g(di\013eren)m(t)f(HDUs)h(in)e(the)h(same)h
-(\014le.)0 3680 y Fd(5.3)135 b(Curren)l(t)46 b(Header)f(Data)h(Unit)g
-(\(CHDU\))0 3957 y Fi(In)32 b(general,)i(a)g(FITS)e(\014le)h(can)g(con)
+3586 y(doing)f(I/O)i(to)g(di\013eren)m(t)f(HDUs)h(in)e(the)h(same)h
+(\014le.)0 3943 y Fd(6.3)135 b(Curren)l(t)46 b(Header)f(Data)h(Unit)g
+(\(CHDU\))0 4198 y Fi(In)32 b(general,)i(a)g(FITS)e(\014le)h(can)g(con)
 m(tain)g(m)m(ultiple)e(Header)j(Data)h(Units,)e(also)g(called)f
-(extensions.)48 b(CFITSIO)0 4070 y(only)37 b(op)s(erates)i(within)d
+(extensions.)48 b(CFITSIO)0 4311 y(only)37 b(op)s(erates)i(within)d
 (one)i(HDU)h(at)g(an)m(y)g(giv)m(en)f(time,)i(and)e(the)g(curren)m(tly)
-f(selected)i(HDU)g(is)e(called)h(the)0 4183 y(Curren)m(t)h(Header)h
+f(selected)i(HDU)g(is)e(called)h(the)0 4424 y(Curren)m(t)h(Header)h
 (Data)h(Unit)e(\(CHDU\).)i(When)f(a)g(FITS)f(\014le)g(is)f(\014rst)h
-(created)i(or)f(op)s(ened)f(the)h(CHDU)g(is)0 4295 y(automatically)25
+(created)i(or)f(op)s(ened)f(the)h(CHDU)g(is)0 4537 y(automatically)25
 b(de\014ned)e(to)j(b)s(e)e(the)h(\014rst)f(HDU)i(\(i.e.,)g(the)f
 (primary)e(arra)m(y\).)40 b(CFITSIO)23 b(routines)h(are)h(pro)m(vided)0
-4408 y(to)36 b(mo)m(v)m(e)h(to)g(and)e(op)s(en)g(an)m(y)h(other)g
+4650 y(to)36 b(mo)m(v)m(e)h(to)g(and)e(op)s(en)g(an)m(y)h(other)g
 (existing)e(HDU)j(within)c(the)j(FITS)f(\014le)f(or)i(to)g(app)s(end)e
-(or)i(insert)e(a)i(new)0 4521 y(HDU)31 b(in)e(the)i(FITS)e(\014le)h
-(whic)m(h)f(then)h(b)s(ecomes)h(the)f(CHDU.)0 4986 y
-Fd(5.4)135 b(Subroutine)45 b(Names)0 5262 y Fi(All)24
+(or)i(insert)e(a)i(new)0 4763 y(HDU)31 b(in)e(the)i(FITS)e(\014le)h
+(whic)m(h)f(then)h(b)s(ecomes)h(the)f(CHDU.)0 5120 y
+Fd(6.4)135 b(Subroutine)45 b(Names)0 5375 y Fi(All)24
 b(FITSIO)h(subroutine)f(names)i(b)s(egin)e(with)h(the)h(letters)g('ft')
 g(to)h(distinguish)22 b(them)k(from)f(other)h(subroutines)0
-5375 y(and)34 b(are)h(5)g(or)f(6)h(c)m(haracters)h(long.)53
+5488 y(and)34 b(are)h(5)g(or)f(6)h(c)m(haracters)h(long.)53
 b(Users)34 b(should)f(not)h(name)h(their)f(o)m(wn)g(subroutines)e(b)s
-(eginning)g(with)h('ft')0 5488 y(to)f(a)m(v)m(oid)h(con\015icts.)44
+(eginning)g(with)h('ft')0 5601 y(to)f(a)m(v)m(oid)h(con\015icts.)44
 b(\(The)32 b(SPP)f(in)m(terface)h(routines)e(all)h(b)s(egin)f(with)h
 ('fs'\).)45 b(Subroutines)29 b(whic)m(h)h(read)i(or)g(get)0
-5601 y(information)c(from)i(the)h(FITS)e(\014le)g(ha)m(v)m(e)j(names)e
+5714 y(information)c(from)i(the)h(FITS)e(\014le)g(ha)m(v)m(e)j(names)e
 (b)s(eginning)d(with)i('ftg...'.)43 b(Subroutines)27
-b(whic)m(h)i(write)g(or)i(put)0 5714 y(information)e(in)m(to)h(the)h
-(FITS)e(\014le)h(ha)m(v)m(e)h(names)g(b)s(eginning)c(with)i('ftp...'.)p
-eop
-%%Page: 41 47
-41 46 bop 0 299 a Fg(5.5.)72 b(SUBR)m(OUTINE)30 b(F)-10
+b(whic)m(h)i(write)g(or)i(put)p eop
+%%Page: 49 55
+49 54 bop 0 299 a Fg(6.5.)72 b(SUBR)m(OUTINE)30 b(F)-10
 b(AMILIES)30 b(AND)h(D)m(A)-8 b(T)g(A)g(TYPES)1697 b
-Fi(41)0 555 y Fd(5.5)135 b(Subroutine)45 b(F)-11 b(amilies)46
-b(and)f(Datat)l(yp)t(es)0 805 y Fi(Man)m(y)h(of)g(the)g(subroutines)d
-(come)k(in)d(families)f(whic)m(h)i(di\013er)f(only)h(in)f(the)i(datat)m
-(yp)s(e)g(of)g(the)f(asso)s(ciated)0 918 y(parameter\(s\))34
+Fi(49)0 555 y(information)29 b(in)m(to)h(the)h(FITS)e(\014le)h(ha)m(v)m
+(e)h(names)g(b)s(eginning)c(with)i('ftp...'.)0 888 y
+Fd(6.5)135 b(Subroutine)45 b(F)-11 b(amilies)46 b(and)f(Datat)l(yp)t
+(es)0 1138 y Fi(Man)m(y)h(of)g(the)g(subroutines)d(come)k(in)d
+(families)f(whic)m(h)i(di\013er)f(only)h(in)f(the)i(datat)m(yp)s(e)g
+(of)g(the)f(asso)s(ciated)0 1251 y(parameter\(s\))34
 b(.)47 b(The)32 b(datat)m(yp)s(e)i(of)f(these)g(subroutines)d(is)i
 (indicated)f(b)m(y)i(the)g(last)f(letter)h(of)g(the)g(subroutine)0
-1031 y(name)d(\(e.g.,)j('j')d(in)f('ftpkyj'\))i(as)f(follo)m(ws:)382
-1284 y Fe(x)47 b(-)h(bit)382 1397 y(b)f(-)h(character*1)c(\(unsigned)i
-(byte\))382 1510 y(i)h(-)h(short)e(integer)g(\(I*2\))382
-1623 y(j)h(-)h(integer)e(\(I*4\))382 1735 y(e)h(-)h(real)e(exponential)
-f(floating)h(point)g(\(R*4\))382 1848 y(f)h(-)h(real)e(fixed-format)f
-(floating)g(point)i(\(R*4\))382 1961 y(d)g(-)h(double)e(precision)f
-(real)i(floating-point)d(\(R*8\))382 2074 y(g)j(-)h(double)e(precision)
-f(fixed-format)g(floating)g(point)h(\(R*8\))382 2187
+1364 y(name)d(\(e.g.,)j('j')d(in)f('ftpkyj'\))i(as)f(follo)m(ws:)382
+1619 y Fe(x)47 b(-)h(bit)382 1732 y(b)f(-)h(character*1)c(\(unsigned)i
+(byte\))382 1845 y(i)h(-)h(short)e(integer)g(\(I*2\))382
+1958 y(j)h(-)h(integer)e(\(I*4\))382 2071 y(e)h(-)h(real)e(exponential)
+f(floating)h(point)g(\(R*4\))382 2184 y(f)h(-)h(real)e(fixed-format)f
+(floating)g(point)i(\(R*4\))382 2297 y(d)g(-)h(double)e(precision)f
+(real)i(floating-point)d(\(R*8\))382 2410 y(g)j(-)h(double)e(precision)
+f(fixed-format)g(floating)g(point)h(\(R*8\))382 2523
 y(c)h(-)h(complex)e(reals)g(\(pairs)g(of)h(R*4)g(values\))382
-2300 y(m)g(-)h(double)e(precision)f(complex)h(\(pairs)g(of)h(R*8)g
-(values\))382 2413 y(l)g(-)h(logical)e(\(L*4\))382 2526
-y(s)h(-)h(character)d(string)0 2778 y Fi(When)23 b(dealing)f(with)g
+2636 y(m)g(-)h(double)e(precision)f(complex)h(\(pairs)g(of)h(R*8)g
+(values\))382 2749 y(l)g(-)h(logical)e(\(L*4\))382 2861
+y(s)h(-)h(character)d(string)0 3117 y Fi(When)23 b(dealing)f(with)g
 (the)h(FITS)g(b)m(yte)g(datat)m(yp)s(e,)j(it)d(is)f(imp)s(ortan)m(t)h
 (to)g(remem)m(b)s(er)g(that)h(the)f(ra)m(w)g(v)-5 b(alues)23
-b(\(b)s(efore)0 2891 y(an)m(y)i(scaling)e(b)m(y)h(the)h(BSCALE)e(and)h
+b(\(b)s(efore)0 3230 y(an)m(y)i(scaling)e(b)m(y)h(the)h(BSCALE)e(and)h
 (BZER)m(O,)g(or)h(TSCALn)d(and)i(TZER)m(On)f(k)m(eyw)m(ord)i(v)-5
-b(alues\))24 b(in)f(b)m(yte)i(arra)m(ys)0 3004 y(\(BITPIX)37
+b(alues\))24 b(in)f(b)m(yte)i(arra)m(ys)0 3343 y(\(BITPIX)37
 b(=)f(8\))h(or)f(b)m(yte)i(columns)d(\(TF)m(ORMn)i(=)f('B'\))h(are)g
 (in)m(terpreted)f(as)h(unsigned)d(b)m(ytes)j(with)f(v)-5
-b(alues)0 3117 y(ranging)39 b(from)g(0)i(to)f(255.)71
+b(alues)0 3455 y(ranging)39 b(from)g(0)i(to)f(255.)71
 b(Some)40 b(F)-8 b(ortran)40 b(compilers)f(supp)s(ort)f(a)i
 (non-standard)f(b)m(yte)h(datat)m(yp)s(e)h(suc)m(h)f(as)0
-3230 y(INTEGER*1,)34 b(LOGICAL*1,)g(or)f(BYTE,)g(whic)m(h)e(can)i
+3568 y(INTEGER*1,)34 b(LOGICAL*1,)g(or)f(BYTE,)g(whic)m(h)e(can)i
 (sometimes)g(b)s(e)f(used)g(instead)g(of)h(CHARA)m(CTER*1)0
-3343 y(v)-5 b(ariables.)37 b(Man)m(y)23 b(mac)m(hines)f(p)s(ermit)g
+3681 y(v)-5 b(ariables.)37 b(Man)m(y)23 b(mac)m(hines)f(p)s(ermit)g
 (passing)f(a)i(n)m(umeric)f(datat)m(yp)s(e)h(\(suc)m(h)g(as)g
-(INTEGER*1\))h(to)f(the)g(FITSIO)0 3456 y(subroutines)40
+(INTEGER*1\))h(to)f(the)g(FITSIO)0 3794 y(subroutines)40
 b(whic)m(h)i(are)h(exp)s(ecting)f(a)h(CHARA)m(CTER*1)h(datat)m(yp)s(e,)
-j(but)42 b(this)f(tec)m(hnically)h(violates)h(the)0 3569
+j(but)42 b(this)f(tec)m(hnically)h(violates)h(the)0 3907
 y(F)-8 b(ortran-77)29 b(standard)d(and)g(is)g(not)h(supp)s(orted)e(on)i
 (all)f(mac)m(hines)g(\(e.g.,)k(on)c(a)i(V)-10 b(AX/VMS)27
-b(mac)m(hine)g(one)g(m)m(ust)0 3682 y(use)j(the)h(V)-10
-b(AX-sp)s(eci\014c)30 b(\045DESCR)f(function\).)0 3842
+b(mac)m(hine)g(one)g(m)m(ust)0 4020 y(use)j(the)h(V)-10
+b(AX-sp)s(eci\014c)30 b(\045DESCR)f(function\).)0 4180
 y(One)22 b(feature)h(of)g(the)g(CFITSIO)e(routines)h(is)f(that)j(they)f
 (can)g(op)s(erate)g(on)f(a)h(`X')h(\(bit\))e(column)g(in)f(a)i(binary)e
-(table)0 3955 y(as)35 b(though)e(it)h(w)m(ere)h(a)g(`B')g(\(b)m(yte\))g
+(table)0 4293 y(as)35 b(though)e(it)h(w)m(ere)h(a)g(`B')g(\(b)m(yte\))g
 (column.)52 b(F)-8 b(or)35 b(example)f(a)g(`11X')i(datat)m(yp)s(e)f
-(column)e(can)i(b)s(e)f(in)m(terpreted)0 4068 y(the)28
+(column)e(can)i(b)s(e)f(in)m(terpreted)0 4406 y(the)28
 b(same)h(as)f(a)g(`2B')i(column)d(\(i.e.,)i(2)f(unsigned)e(8-bit)i(b)m
 (ytes\).)41 b(In)27 b(some)i(instances,)f(it)f(can)i(b)s(e)e(more)h
-(e\016cien)m(t)0 4181 y(to)j(read)f(and)g(write)g(whole)f(b)m(ytes)i
+(e\016cien)m(t)0 4519 y(to)j(read)f(and)g(write)g(whole)f(b)m(ytes)i
 (at)g(a)g(time,)f(rather)h(than)f(reading)f(or)i(writing)d(eac)m(h)k
-(individual)25 b(bit.)0 4341 y(The)41 b(double)g(precision)f(complex)h
+(individual)25 b(bit.)0 4679 y(The)41 b(double)g(precision)f(complex)h
 (datat)m(yp)s(e)i(is)e(not)h(a)g(standard)f(F)-8 b(ortran-77)43
-b(datat)m(yp)s(e.)76 b(If)41 b(a)i(particular)0 4454
+b(datat)m(yp)s(e.)76 b(If)41 b(a)i(particular)0 4792
 y(F)-8 b(ortran)35 b(compiler)e(do)s(es)h(not)h(directly)e(supp)s(ort)g
 (this)h(datat)m(yp)s(e,)i(then)f(one)f(ma)m(y)h(instead)f(pass)g(an)h
-(arra)m(y)g(of)0 4567 y(pairs)c(of)i(double)e(precision)g(v)-5
+(arra)m(y)g(of)0 4905 y(pairs)c(of)i(double)e(precision)g(v)-5
 b(alues)31 b(to)j(these)f(subroutines.)44 b(The)33 b(\014rst)e(v)-5
 b(alue)32 b(in)f(eac)m(h)j(pair)d(is)h(the)h(real)f(part,)0
-4680 y(and)e(the)g(second)h(is)e(the)i(imaginary)e(part.)0
-5012 y Fd(5.6)135 b(Implicit)46 b(Data)g(T)l(yp)t(e)f(Con)l(v)l(ersion)
-0 5262 y Fi(Man)m(y)32 b(of)f(the)g(data)g(I/O)g(subroutines)d(ha)m(v)m
-(e)33 b(the)e(abilit)m(y)e(to)i(p)s(erform)f(implicit)e(data)j(t)m(yp)s
-(e)g(con)m(v)m(ersion.)43 b(This)0 5375 y(means)34 b(that)h(the)f(data)
-h(t)m(yp)s(e)f(of)h(the)f(subroutine)e(parameter)j(do)s(es)f(not)g
-(need)g(to)h(b)s(e)e(the)i(same)f(as)h(the)f(data)0 5488
-y(t)m(yp)s(e)41 b(of)g(the)h(v)-5 b(alue)40 b(in)g(the)h(FITS)g
-(\014le.)72 b(More)41 b(sp)s(eci\014cally)-8 b(,)42 b(the)g(implicit)c
-(data)k(t)m(yp)s(e)f(con)m(v)m(ersion)g(will)e(b)s(e)0
-5601 y(p)s(erformed)28 b(for)i(n)m(umerical)e(data)j(t)m(yp)s(es)f
-(when)e(reading)h(a)i(FITS)e(header)g(k)m(eyw)m(ord)i(v)-5
-b(alue)29 b(and)g(when)g(reading)0 5714 y(or)i(writing)e(v)-5
-b(alues)30 b(to)i(or)f(from)g(the)g(primary)e(arra)m(y)i(or)g(a)h
-(table)f(column.)41 b(FITSIO)30 b(returns)g(status)h(=)g(412)h(if)p
-eop
-%%Page: 42 48
-42 47 bop 0 299 a Fi(42)1277 b Fg(CHAPTER)29 b(5.)72
+5018 y(and)e(the)g(second)h(is)e(the)i(imaginary)e(part.)0
+5351 y Fd(6.6)135 b(Implicit)46 b(Data)g(T)l(yp)t(e)f(Con)l(v)l(ersion)
+0 5601 y Fi(The)22 b(FITSIO)g(routines)g(that)i(read)e(and)h(write)f(n)
+m(umerical)f(data)j(can)f(p)s(erform)f(implicit)e(data)j(t)m(yp)s(e)g
+(con)m(v)m(ersion.)0 5714 y(This)h(means)h(that)h(the)g(data)g(t)m(yp)s
+(e)g(of)g(the)g(v)-5 b(ariable)24 b(or)i(arra)m(y)g(in)e(the)i(program)
+f(do)s(es)g(not)h(need)g(to)g(b)s(e)f(the)h(same)p eop
+%%Page: 50 56
+50 55 bop 0 299 a Fi(50)1277 b Fg(CHAPTER)29 b(6.)72
 b(FITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fi(the)j(con)m(v)m(erted)h(data)f(v)-5 b(alue)33 b(exceeds)i(the)f
-(range)f(of)h(the)g(output)f(data)i(t)m(yp)s(e.)50 b(Data)35
-b(t)m(yp)s(e)f(con)m(v)m(ersion)g(is)f(not)0 668 y(allo)m(w)m(ed)k
-(when)e(reading)h(or)h(writing)e(string)g(\(s\),)k(logical)d(\(l\),)j
-(complex)d(\(c\),)k(or)c(double)g(complex)g(\(m\))h(data)0
-781 y(t)m(yp)s(es.)0 1121 y Fd(5.7)135 b(Data)46 b(Scaling)0
-1372 y Fi(When)38 b(reading)e(n)m(umerical)h(data)h(v)-5
-b(alues)37 b(in)f(the)i(primary)e(arra)m(y)i(or)g(a)g(table)g(column,)h
-(the)e(v)-5 b(alues)37 b(will)f(b)s(e)0 1485 y(scaled)h(automatically)h
-(b)m(y)f(the)h(BSCALE)f(and)g(BZER)m(O)h(\(or)g(TSCALn)d(and)i(TZER)m
-(On\))g(header)g(k)m(eyw)m(ord)0 1598 y(v)-5 b(alues)32
-b(if)f(they)h(are)h(presen)m(t)g(in)e(the)h(header.)47
-b(The)31 b(scaled)i(data)g(that)g(is)e(returned)g(to)i(the)g(reading)e
-(program)0 1711 y(will)d(ha)m(v)m(e)382 1976 y Fe(output)46
-b(value)g(=)i(\(FITS)e(value\))g(*)i(BSCALE)e(+)h(BZERO)0
-2240 y Fi(\(a)30 b(corresp)s(onding)d(form)m(ula)h(using)g(TSCALn)f
+Fi(as)d(the)f(data)h(t)m(yp)s(e)g(of)f(the)h(v)-5 b(alue)27
+b(in)f(the)h(FITS)g(\014le.)39 b(Data)28 b(t)m(yp)s(e)g(con)m(v)m
+(ersion)g(is)e(supp)s(orted)g(for)h(n)m(umerical)f(and)0
+668 y(string)32 b(data)i(t)m(yp)s(es)f(\(if)g(the)h(string)e(con)m
+(tains)h(a)h(v)-5 b(alid)31 b(n)m(um)m(b)s(er)h(enclosed)h(in)f
+(quotes\))i(when)f(reading)f(a)i(FITS)0 781 y(header)d(k)m(eyw)m(ord)g
+(v)-5 b(alue)30 b(and)h(for)f(n)m(umeric)g(v)-5 b(alues)30
+b(when)g(reading)g(or)h(writing)e(v)-5 b(alues)30 b(in)f(the)i(primary)
+e(arra)m(y)0 894 y(or)40 b(a)h(table)g(column.)69 b(CFITSIO)39
+b(returns)h(status)g(=)h(NUM)p 2185 894 28 4 v 33 w(O)m(VERFLO)m(W)g
+(if)f(the)g(con)m(v)m(erted)i(data)f(v)-5 b(alue)0 1007
+y(exceeds)33 b(the)g(range)g(of)g(the)f(output)g(data)i(t)m(yp)s(e.)47
+b(Implicit)30 b(data)j(t)m(yp)s(e)g(con)m(v)m(ersion)g(is)e(not)i(supp)
+s(orted)d(within)0 1120 y(binary)f(tables)h(for)g(string,)f(logical,)i
+(complex,)f(or)g(double)f(complex)h(data)h(t)m(yp)s(es.)0
+1280 y(In)g(addition,)f(an)m(y)h(table)g(column)f(ma)m(y)i(b)s(e)f
+(read)g(as)h(if)e(it)h(con)m(tained)g(string)f(v)-5 b(alues.)43
+b(In)31 b(the)g(case)i(of)e(n)m(umeric)0 1393 y(columns)e(the)i
+(returned)e(string)g(will)f(b)s(e)i(formatted)h(using)d(the)j(TDISPn)e
+(displa)m(y)g(format)h(if)g(it)g(exists.)0 1724 y Fd(6.7)135
+b(Data)46 b(Scaling)0 1974 y Fi(When)38 b(reading)e(n)m(umerical)h
+(data)h(v)-5 b(alues)37 b(in)f(the)i(primary)e(arra)m(y)i(or)g(a)g
+(table)g(column,)h(the)e(v)-5 b(alues)37 b(will)f(b)s(e)0
+2087 y(scaled)h(automatically)h(b)m(y)f(the)h(BSCALE)f(and)g(BZER)m(O)h
+(\(or)g(TSCALn)d(and)i(TZER)m(On\))g(header)g(k)m(eyw)m(ord)0
+2200 y(v)-5 b(alues)32 b(if)f(they)h(are)h(presen)m(t)g(in)e(the)h
+(header.)47 b(The)31 b(scaled)i(data)g(that)g(is)e(returned)g(to)i(the)
+g(reading)e(program)0 2313 y(will)d(ha)m(v)m(e)382 2554
+y Fe(output)46 b(value)g(=)i(\(FITS)e(value\))g(*)i(BSCALE)e(+)h(BZERO)
+0 2796 y Fi(\(a)30 b(corresp)s(onding)d(form)m(ula)h(using)g(TSCALn)f
 (and)i(TZER)m(On)e(is)h(used)h(when)f(reading)g(from)h(table)g
-(columns\).)0 2353 y(In)i(the)i(case)g(of)f(in)m(teger)g(output)g(v)-5
+(columns\).)0 2909 y(In)i(the)i(case)g(of)f(in)m(teger)g(output)g(v)-5
 b(alues)31 b(the)i(\015oating)f(p)s(oin)m(t)f(scaled)g(v)-5
 b(alue)32 b(is)f(truncated)h(to)h(an)f(in)m(teger)g(\(not)0
-2466 y(rounded)38 b(to)i(the)g(nearest)g(in)m(teger\).)69
+3022 y(rounded)38 b(to)i(the)g(nearest)g(in)m(teger\).)69
 b(The)39 b(ftpscl)f(and)h(fttscl)h(subroutines)d(ma)m(y)j(b)s(e)f(used)
-g(to)h(o)m(v)m(erride)g(the)0 2579 y(scaling)28 b(parameters)h
+g(to)h(o)m(v)m(erride)g(the)0 3135 y(scaling)28 b(parameters)h
 (de\014ned)e(in)g(the)i(header)f(\(e.g.,)j(to)e(turn)f(o\013)h(the)f
-(scaling)g(so)h(that)g(the)g(program)f(can)h(read)0 2692
+(scaling)g(so)h(that)g(the)g(program)f(can)h(read)0 3247
 y(the)i(ra)m(w)f(unscaled)f(v)-5 b(alues)30 b(from)g(the)g(FITS)g
-(\014le\).)0 2852 y(When)44 b(writing)f(n)m(umerical)g(data)i(to)g(the)
+(\014le\).)0 3408 y(When)44 b(writing)f(n)m(umerical)g(data)i(to)g(the)
 g(primary)e(arra)m(y)i(or)f(to)h(a)g(table)g(column)e(the)i(data)g(v)-5
-b(alues)44 b(will)0 2965 y(generally)27 b(b)s(e)h(automatically)g(in)m
+b(alues)44 b(will)0 3521 y(generally)27 b(b)s(e)h(automatically)g(in)m
 (v)m(ersely)g(scaled)g(b)m(y)g(the)g(v)-5 b(alue)28 b(of)g(the)h
-(BSCALE)e(and)h(BZER)m(O)g(\(or)h(TSCALn)0 3078 y(and)h(TZER)m(On\))g
+(BSCALE)e(and)h(BZER)m(O)g(\(or)h(TSCALn)0 3633 y(and)h(TZER)m(On\))g
 (header)g(k)m(eyw)m(ord)h(v)-5 b(alues)30 b(if)g(they)h(they)g(exist)f
 (in)f(the)i(header.)42 b(These)30 b(k)m(eyw)m(ords)h(m)m(ust)g(ha)m(v)m
-(e)0 3191 y(b)s(een)f(written)g(to)i(the)g(header)e(b)s(efore)h(an)m(y)
+(e)0 3746 y(b)s(een)f(written)g(to)i(the)g(header)e(b)s(efore)h(an)m(y)
 h(data)f(is)f(written)h(for)f(them)i(to)f(ha)m(v)m(e)i(an)m(y)e
-(e\013ect.)44 b(Otherwise,)31 b(one)0 3304 y(ma)m(y)j(use)f(the)g
+(e\013ect.)44 b(Otherwise,)31 b(one)0 3859 y(ma)m(y)j(use)f(the)g
 (ftpscl)f(and)h(fttscl)g(subroutines)d(to)k(de\014ne)f(or)g(o)m(v)m
 (erride)g(the)g(scaling)g(k)m(eyw)m(ords)g(in)f(the)h(header)0
-3417 y(\(e.g.,)h(to)f(turn)d(o\013)j(the)f(scaling)f(so)h(that)g(the)g
+3972 y(\(e.g.,)h(to)f(turn)d(o\013)j(the)f(scaling)f(so)h(that)g(the)g
 (program)g(can)g(write)f(the)h(ra)m(w)g(unscaled)f(v)-5
-b(alues)31 b(in)m(to)h(the)g(FITS)0 3530 y(\014le\).)42
+b(alues)31 b(in)m(to)h(the)g(FITS)0 4085 y(\014le\).)42
 b(If)30 b(scaling)g(is)g(p)s(erformed,)f(the)i(in)m(v)m(erse)g(scaled)g
 (output)f(v)-5 b(alue)31 b(that)g(is)f(written)g(in)m(to)h(the)g(FITS)f
-(\014le)g(will)0 3643 y(ha)m(v)m(e)430 3907 y Fe(FITS)46
+(\014le)g(will)0 4198 y(ha)m(v)m(e)430 4440 y Fe(FITS)46
 b(value)h(=)g(\(\(input)f(value\))g(-)h(BZERO\))f(/)i(BSCALE)0
-4172 y Fi(\(a)39 b(corresp)s(onding)c(form)m(ula)i(using)g(TSCALn)f
+4681 y Fi(\(a)39 b(corresp)s(onding)c(form)m(ula)i(using)g(TSCALn)f
 (and)h(TZER)m(On)g(is)g(used)g(when)f(writing)g(to)j(table)f
-(columns\).)0 4285 y(Rounding)18 b(to)j(the)g(nearest)g(in)m(teger,)h
+(columns\).)0 4794 y(Rounding)18 b(to)j(the)g(nearest)g(in)m(teger,)h
 (rather)f(than)f(truncation,)i(is)d(p)s(erformed)g(when)g(writing)f(in)
-m(teger)j(datat)m(yp)s(es)0 4398 y(to)31 b(the)g(FITS)e(\014le.)0
-4738 y Fd(5.8)135 b(Error)46 b(Status)f(V)-11 b(alues)45
-b(and)g(the)g(Error)g(Message)h(Stac)l(k)0 4989 y Fi(The)33
+m(teger)j(datat)m(yp)s(es)0 4907 y(to)31 b(the)g(FITS)e(\014le.)0
+5238 y Fd(6.8)135 b(Error)46 b(Status)f(V)-11 b(alues)45
+b(and)g(the)g(Error)g(Message)h(Stac)l(k)0 5488 y Fi(The)33
 b(last)h(parameter)g(in)f(nearly)g(ev)m(ery)h(FITSIO)f(subroutine)f(is)
 h(the)h(error)f(status)h(v)-5 b(alue)34 b(whic)m(h)e(is)h(b)s(oth)g(an)
-0 5102 y(input)i(and)g(an)i(output)f(parameter.)60 b(A)36
+0 5601 y(input)i(and)g(an)i(output)f(parameter.)60 b(A)36
 b(returned)f(p)s(ositiv)m(e)h(v)-5 b(alue)36 b(for)g(this)g(parameter)h
-(indicates)e(an)h(error)0 5215 y(w)m(as)31 b(detected.)42
+(indicates)e(an)h(error)0 5714 y(w)m(as)31 b(detected.)42
 b(A)30 b(listing)e(of)j(all)e(the)i(FITSIO)e(status)i(co)s(de)f(v)-5
 b(alues)30 b(is)f(giv)m(en)i(at)g(the)f(end)g(of)h(this)e(do)s(cumen)m
-(t.)0 5375 y(The)22 b(FITSIO)g(library)e(uses)j(an)f(`inherited)f
-(status')i(con)m(v)m(en)m(tion)h(for)f(the)g(status)g(parameter)g(whic)
-m(h)f(means)g(that)0 5488 y(if)h(a)i(subroutine)e(is)g(called)h(with)f
-(a)i(p)s(ositiv)m(e)e(input)g(v)-5 b(alue)24 b(of)h(the)f(status)h
-(parameter,)h(then)f(the)f(subroutine)f(will)0 5601 y(exit)i
-(immediately)d(without)i(c)m(hanging)h(the)f(v)-5 b(alue)24
-b(of)h(the)g(status)g(parameter.)39 b(Th)m(us,)25 b(if)f(one)g(passes)h
-(the)g(status)0 5714 y(v)-5 b(alue)30 b(returned)f(from)h(eac)m(h)i
-(FITSIO)d(routine)g(as)i(input)e(to)i(the)f(next)h(FITSIO)e
-(subroutine,)g(then)h(whenev)m(er)p eop
-%%Page: 43 49
-43 48 bop 0 299 a Fg(5.9.)72 b(V)-10 b(ARIABLE-LENGTH)31
+(t.)p eop
+%%Page: 51 57
+51 56 bop 0 299 a Fg(6.9.)72 b(V)-10 b(ARIABLE-LENGTH)31
 b(ARRA)-8 b(Y)31 b(F)-10 b(A)m(CILITY)30 b(IN)h(BINAR)-8
-b(Y)31 b(T)-8 b(ABLES)956 b Fi(43)0 555 y(an)39 b(error)g(is)g
-(detected)h(all)f(further)f(FITSIO)g(pro)s(cessing)g(will)f(cease.)69
-b(This)38 b(con)m(v)m(en)m(tion)i(can)g(simplify)c(the)0
-668 y(error)30 b(c)m(hec)m(king)i(in)d(application)g(programs)i(b)s
-(ecause)g(it)f(is)g(not)h(necessary)g(to)g(c)m(hec)m(k)i(the)e(v)-5
-b(alue)30 b(of)h(the)g(status)0 781 y(parameter)j(after)g(ev)m(ery)g
-(single)f(FITSIO)f(subroutine)f(call.)50 b(If)33 b(a)h(program)f(con)m
-(tains)h(a)g(sequence)g(of)g(sev)m(eral)0 894 y(FITSIO)23
-b(calls,)h(one)g(can)g(just)g(c)m(hec)m(k)h(the)f(status)g(v)-5
-b(alue)23 b(after)i(the)f(last)f(call.)38 b(Since)23
-b(the)h(returned)e(status)j(v)-5 b(alues)0 1007 y(are)36
-b(generally)f(distinctiv)m(e,)h(it)f(should)f(b)s(e)h(p)s(ossible)e(to)
-j(determine)f(whic)m(h)f(subroutine)g(originally)f(returned)0
-1120 y(the)e(error)f(status.)0 1280 y(FITSIO)i(also)h(main)m(tains)e
-(an)i(in)m(ternal)f(stac)m(k)i(of)f(error)g(messages)h(\(80-c)m
-(haracter)i(maxim)m(um)c(length\))g(whic)m(h)0 1393 y(in)j(man)m(y)h
-(cases)h(pro)m(vide)e(a)h(more)g(detailed)g(explanation)f(of)h(the)g
-(cause)h(of)f(the)g(error)g(than)f(is)g(pro)m(vided)g(b)m(y)0
-1506 y(the)40 b(error)e(status)i(n)m(um)m(b)s(er)e(alone.)68
-b(It)39 b(is)g(recommended)g(that)g(the)h(error)f(message)h(stac)m(k)h
-(b)s(e)e(prin)m(ted)f(out)0 1619 y(whenev)m(er)31 b(a)h(program)g
-(detects)g(a)g(FITSIO)e(error.)44 b(T)-8 b(o)32 b(do)f(this,)g(call)g
-(the)h(FTGMSG)g(routine)e(rep)s(eatedly)h(to)0 1732 y(get)i(the)g
-(successiv)m(e)f(messages)i(on)e(the)g(stac)m(k.)48 b(When)32
-b(the)h(stac)m(k)g(is)f(empt)m(y)g(FTGMSG)h(will)d(return)h(a)h(blank)0
-1844 y(string.)40 b(Note)31 b(that)g(this)e(is)g(a)h(`First)g(In)f({)i
-(First)e(Out')h(stac)m(k,)i(so)e(the)h(oldest)f(error)f(message)j(is)d
-(returned)g(\014rst)0 1957 y(b)m(y)h(ftgmsg.)0 2331 y
-Fd(5.9)135 b(V)-11 b(ariable-Length)46 b(Arra)l(y)f(F)-11
-b(acilit)l(y)46 b(in)f(Binary)g(T)-11 b(ables)0 2589
+b(Y)31 b(T)-8 b(ABLES)956 b Fi(51)0 555 y(The)22 b(FITSIO)g(library)e
+(uses)j(an)f(`inherited)f(status')i(con)m(v)m(en)m(tion)h(for)f(the)g
+(status)g(parameter)g(whic)m(h)f(means)g(that)0 668 y(if)h(a)i
+(subroutine)e(is)g(called)h(with)f(a)i(p)s(ositiv)m(e)e(input)g(v)-5
+b(alue)24 b(of)h(the)f(status)h(parameter,)h(then)f(the)f(subroutine)f
+(will)0 781 y(exit)i(immediately)d(without)i(c)m(hanging)h(the)f(v)-5
+b(alue)24 b(of)h(the)g(status)g(parameter.)39 b(Th)m(us,)25
+b(if)f(one)g(passes)h(the)g(status)0 894 y(v)-5 b(alue)30
+b(returned)f(from)h(eac)m(h)i(FITSIO)d(routine)g(as)i(input)e(to)i(the)
+f(next)h(FITSIO)e(subroutine,)g(then)h(whenev)m(er)0
+1007 y(an)39 b(error)g(is)g(detected)h(all)f(further)f(FITSIO)g(pro)s
+(cessing)g(will)f(cease.)69 b(This)38 b(con)m(v)m(en)m(tion)i(can)g
+(simplify)c(the)0 1120 y(error)30 b(c)m(hec)m(king)i(in)d(application)g
+(programs)i(b)s(ecause)g(it)f(is)g(not)h(necessary)g(to)g(c)m(hec)m(k)i
+(the)e(v)-5 b(alue)30 b(of)h(the)g(status)0 1233 y(parameter)j(after)g
+(ev)m(ery)g(single)f(FITSIO)f(subroutine)f(call.)50 b(If)33
+b(a)h(program)f(con)m(tains)h(a)g(sequence)g(of)g(sev)m(eral)0
+1346 y(FITSIO)23 b(calls,)h(one)g(can)g(just)g(c)m(hec)m(k)h(the)f
+(status)g(v)-5 b(alue)23 b(after)i(the)f(last)f(call.)38
+b(Since)23 b(the)h(returned)e(status)j(v)-5 b(alues)0
+1458 y(are)36 b(generally)f(distinctiv)m(e,)h(it)f(should)f(b)s(e)h(p)s
+(ossible)e(to)j(determine)f(whic)m(h)f(subroutine)g(originally)f
+(returned)0 1571 y(the)e(error)f(status.)0 1732 y(FITSIO)i(also)h(main)
+m(tains)e(an)i(in)m(ternal)f(stac)m(k)i(of)f(error)g(messages)h(\(80-c)
+m(haracter)i(maxim)m(um)c(length\))g(whic)m(h)0 1844
+y(in)j(man)m(y)h(cases)h(pro)m(vide)e(a)h(more)g(detailed)g
+(explanation)f(of)h(the)g(cause)h(of)f(the)g(error)g(than)f(is)g(pro)m
+(vided)g(b)m(y)0 1957 y(the)40 b(error)e(status)i(n)m(um)m(b)s(er)e
+(alone.)68 b(It)39 b(is)g(recommended)g(that)g(the)h(error)f(message)h
+(stac)m(k)h(b)s(e)e(prin)m(ted)f(out)0 2070 y(whenev)m(er)31
+b(a)h(program)g(detects)g(a)g(FITSIO)e(error.)44 b(T)-8
+b(o)32 b(do)f(this,)g(call)g(the)h(FTGMSG)g(routine)e(rep)s(eatedly)h
+(to)0 2183 y(get)i(the)g(successiv)m(e)f(messages)i(on)e(the)g(stac)m
+(k.)48 b(When)32 b(the)h(stac)m(k)g(is)f(empt)m(y)g(FTGMSG)h(will)d
+(return)h(a)h(blank)0 2296 y(string.)40 b(Note)31 b(that)g(this)e(is)g
+(a)h(`First)g(In)f({)i(First)e(Out')h(stac)m(k,)i(so)e(the)h(oldest)f
+(error)f(message)j(is)d(returned)g(\014rst)0 2409 y(b)m(y)h(ftgmsg.)0
+2822 y Fd(6.9)135 b(V)-11 b(ariable-Length)46 b(Arra)l(y)f(F)-11
+b(acilit)l(y)46 b(in)f(Binary)g(T)-11 b(ables)0 3088
 y Fi(FITSIO)38 b(pro)m(vides)h(easy-to-use)i(supp)s(ort)d(for)h
 (reading)f(and)h(writing)f(data)i(in)e(v)-5 b(ariable)38
-b(length)h(\014elds)f(of)i(a)0 2702 y(binary)34 b(table.)55
+b(length)h(\014elds)f(of)i(a)0 3201 y(binary)34 b(table.)55
 b(The)35 b(v)-5 b(ariable)34 b(length)g(columns)g(ha)m(v)m(e)j(TF)m
 (ORMn)e(k)m(eyw)m(ord)h(v)-5 b(alues)34 b(of)i(the)f(form)g
-(`1Pt\(len\)')0 2815 y(where)27 b(`t')g(is)f(the)i(datat)m(yp)s(e)g(co)
+(`1Pt\(len\)')0 3314 y(where)27 b(`t')g(is)f(the)i(datat)m(yp)s(e)g(co)
 s(de)f(\(e.g.,)j(I,)d(J,)g(E,)g(D,)g(etc.\))41 b(and)27
 b(`len')f(is)h(an)f(in)m(teger)i(sp)s(ecifying)d(the)i(maxim)m(um)0
-2928 y(length)f(of)h(the)h(v)m(ector)g(in)e(the)h(table.)39
+3427 y(length)f(of)h(the)h(v)m(ector)g(in)e(the)h(table.)39
 b(If)27 b(the)g(v)-5 b(alue)26 b(of)h(`len')g(is)f(not)h(sp)s
 (eci\014ed)e(when)h(the)h(table)g(is)f(created)i(\(e.g.,)0
-3041 y(if)e(the)i(TF)m(ORM)f(k)m(eyw)m(ord)h(v)-5 b(alue)27
+3540 y(if)e(the)i(TF)m(ORM)f(k)m(eyw)m(ord)h(v)-5 b(alue)27
 b(is)f(simply)f(sp)s(eci\014ed)h(as)h('1PE')h(instead)f(of)g
-('1PE\(400\))j(\),)e(then)f(FITSIO)g(will)0 3154 y(automatically)i
+('1PE\(400\))j(\),)e(then)f(FITSIO)g(will)0 3653 y(automatically)i
 (scan)g(the)g(table)g(when)f(it)h(is)f(closed)h(to)h(determine)e(the)h
-(maxim)m(um)f(length)g(of)i(the)f(v)m(ector)i(and)0 3267
+(maxim)m(um)f(length)g(of)i(the)f(v)m(ector)i(and)0 3766
 y(will)d(app)s(end)g(this)i(v)-5 b(alue)30 b(to)h(the)f(TF)m(ORMn)g(v)
--5 b(alue.)0 3427 y(The)25 b(same)h(routines)f(whic)m(h)f(read)i(and)f
+-5 b(alue.)0 3926 y(The)25 b(same)h(routines)f(whic)m(h)f(read)i(and)f
 (write)g(data)h(in)e(an)i(ordinary)e(\014xed)h(length)g(binary)f(table)
-h(extension)h(are)0 3540 y(also)k(used)f(for)h(v)-5 b(ariable)29
+h(extension)h(are)0 4039 y(also)k(used)f(for)h(v)-5 b(ariable)29
 b(length)h(\014elds,)e(ho)m(w)m(ev)m(er,)k(the)e(subroutine)e
 (parameters)j(tak)m(e)h(on)e(a)g(sligh)m(tly)e(di\013eren)m(t)0
-3653 y(in)m(terpretation)i(as)g(describ)s(ed)f(b)s(elo)m(w.)0
-3813 y(All)35 b(the)h(data)h(in)e(a)i(v)-5 b(ariable)35
+4152 y(in)m(terpretation)i(as)g(describ)s(ed)f(b)s(elo)m(w.)0
+4312 y(All)35 b(the)h(data)h(in)e(a)i(v)-5 b(ariable)35
 b(length)g(\014eld)g(is)g(written)h(in)m(to)g(an)g(area)h(called)f(the)
-g(`heap')g(whic)m(h)f(follo)m(ws)h(the)0 3926 y(main)25
+g(`heap')g(whic)m(h)f(follo)m(ws)h(the)0 4425 y(main)25
 b(\014xed-length)g(FITS)g(binary)g(table.)39 b(The)25
 b(size)h(of)h(the)f(heap,)h(in)e(b)m(ytes,)i(is)e(sp)s(eci\014ed)g
-(with)f(the)j(PCOUNT)0 4039 y(k)m(eyw)m(ord)21 b(in)e(the)i(FITS)f
+(with)f(the)j(PCOUNT)0 4538 y(k)m(eyw)m(ord)21 b(in)e(the)i(FITS)f
 (header.)37 b(When)20 b(creating)h(a)g(new)f(binary)f(table,)j(the)f
-(initial)d(v)-5 b(alue)20 b(of)g(PCOUNT)g(should)0 4152
+(initial)d(v)-5 b(alue)20 b(of)g(PCOUNT)g(should)0 4650
 y(usually)29 b(b)s(e)h(set)i(to)g(zero.)44 b(FITSIO)30
 b(will)e(recompute)k(the)f(size)g(of)h(the)f(heap)g(as)g(the)h(data)g
-(is)e(written)g(and)h(will)0 4264 y(automatically)25
+(is)e(written)g(and)h(will)0 4763 y(automatically)25
 b(up)s(date)f(the)i(PCOUNT)e(k)m(eyw)m(ord)h(v)-5 b(alue)25
 b(when)f(the)h(table)g(is)f(closed.)39 b(When)25 b(writing)e(v)-5
-b(ariable)0 4377 y(length)33 b(data)h(to)g(a)g(table,)h(CFITSIO)d(will)
+b(ariable)0 4876 y(length)33 b(data)h(to)g(a)g(table,)h(CFITSIO)d(will)
 e(automatically)k(extend)f(the)h(size)f(of)h(the)g(heap)f(area)h(if)f
-(necessary)-8 b(,)0 4490 y(so)31 b(that)g(an)m(y)f(follo)m(wing)f(HDUs)
-i(do)f(not)h(get)h(o)m(v)m(erwritten.)0 4650 y(By)e(default)e(the)i
+(necessary)-8 b(,)0 4989 y(so)31 b(that)g(an)m(y)f(follo)m(wing)f(HDUs)
+i(do)f(not)h(get)h(o)m(v)m(erwritten.)0 5149 y(By)e(default)e(the)i
 (heap)f(data)i(area)f(starts)g(immediately)e(after)i(the)f(last)h(ro)m
-(w)f(of)h(the)g(\014xed-length)e(table.)41 b(This)0 4763
+(w)f(of)h(the)g(\014xed-length)e(table.)41 b(This)0 5262
 y(default)26 b(starting)g(lo)s(cation)h(ma)m(y)g(b)s(e)f(o)m(v)m
 (erridden)g(b)m(y)h(the)g(THEAP)f(k)m(eyw)m(ord,)i(but)f(this)e(is)h
-(not)h(recommended.)0 4876 y(If)35 b(addtional)g(ro)m(ws)g(of)h(data)h
-(are)f(added)f(to)h(the)g(table,)h(CFITSIO)d(will)f(automatically)j
-(shift)e(the)i(the)g(heap)0 4989 y(do)m(wn)e(to)i(mak)m(e)f(ro)s(om)g
+(not)h(recommended.)0 5375 y(If)34 b(additional)e(ro)m(ws)i(of)g(data)h
+(are)g(added)e(to)i(the)f(table,)i(CFITSIO)c(will)g(automatically)i
+(shift)e(the)j(the)f(heap)0 5488 y(do)m(wn)g(to)i(mak)m(e)f(ro)s(om)g
 (for)f(the)h(new)f(ro)m(ws,)i(but)e(it)h(is)e(ob)m(viously)h(b)s(e)g
 (more)h(e\016cien)m(t)g(to)g(initially)c(create)37 b(the)0
-5102 y(table)30 b(with)e(the)i(necessary)g(n)m(um)m(b)s(er)f(of)h
+5601 y(table)30 b(with)e(the)i(necessary)g(n)m(um)m(b)s(er)f(of)h
 (blank)e(ro)m(ws,)i(so)g(that)g(the)g(heap)g(do)s(es)f(not)h(needed)g
-(to)g(b)s(e)f(constan)m(tly)0 5215 y(mo)m(v)m(ed.)0 5375
-y(When)40 b(writing)f(to)i(a)g(v)-5 b(ariable)39 b(length)h(\014eld,)i
+(to)g(b)s(e)f(constan)m(tly)0 5714 y(mo)m(v)m(ed.)p eop
+%%Page: 52 58
+52 57 bop 0 299 a Fi(52)1277 b Fg(CHAPTER)29 b(6.)72
+b(FITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
+Fi(When)40 b(writing)f(to)i(a)g(v)-5 b(ariable)39 b(length)h(\014eld,)i
 (the)f(en)m(tire)g(arra)m(y)g(of)f(v)-5 b(alues)40 b(for)g(a)h(giv)m
-(en)g(ro)m(w)g(of)f(the)h(table)0 5488 y(m)m(ust)36 b(b)s(e)g(written)f
+(en)g(ro)m(w)g(of)f(the)h(table)0 668 y(m)m(ust)36 b(b)s(e)g(written)f
 (with)g(a)h(single)f(call)h(to)h(FTPCLx.)57 b(The)36
 b(total)h(length)f(of)g(the)g(arra)m(y)h(is)e(calculated)h(from)0
-5601 y(\(NELEM+FELEM-1\).)44 b(One)30 b(cannot)i(app)s(end)d(more)i
+781 y(\(NELEM+FELEM-1\).)44 b(One)30 b(cannot)i(app)s(end)d(more)i
 (elemen)m(ts)g(to)h(an)e(existing)g(\014eld)g(at)h(a)h(later)f(time;)g
-(an)m(y)0 5714 y(attempt)k(to)f(do)g(so)g(will)d(simply)g(o)m(v)m
+(an)m(y)0 894 y(attempt)k(to)f(do)g(so)g(will)d(simply)g(o)m(v)m
 (erwrite)k(all)d(the)i(data)h(whic)m(h)d(w)m(as)i(previously)e
-(written.)50 b(Note)35 b(also)e(that)p eop
-%%Page: 44 50
-44 49 bop 0 299 a Fi(44)1277 b Fg(CHAPTER)29 b(5.)72
-b(FITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fi(the)j(new)g(data)g(will)e(b)s(e)h(written)g(to)i(a)f(new)g(area)g
-(of)g(the)h(heap)e(and)h(the)g(heap)g(space)g(used)f(b)m(y)h(the)g
-(previous)0 668 y(write)i(cannot)i(b)s(e)e(reclaimed.)60
-b(F)-8 b(or)38 b(this)e(reason)h(it)g(is)f(advised)g(that)i(eac)m(h)g
-(ro)m(w)f(of)h(a)f(v)-5 b(ariable)36 b(length)g(\014eld)0
-781 y(only)c(b)s(e)h(written)f(once.)50 b(An)33 b(exception)g(to)h
-(this)e(general)h(rule)f(o)s(ccurs)h(when)f(setting)h(elemen)m(ts)h(of)
-f(an)g(arra)m(y)0 894 y(as)38 b(unde\014ned.)63 b(One)37
-b(m)m(ust)i(\014rst)e(write)g(a)i(dumm)m(y)e(v)-5 b(alue)38
-b(in)m(to)g(the)h(arra)m(y)f(with)f(FTPCLx,)j(and)e(then)g(call)0
-1007 y(FTPCLU)33 b(to)i(\015ag)f(the)f(desired)g(elemen)m(ts)h(as)f
-(unde\014ned.)49 b(\(Do)35 b(not)f(use)f(the)h(FTPCNx)f(family)f(of)i
-(routines)0 1120 y(with)27 b(v)-5 b(ariable)28 b(length)g(\014elds\).)
-39 b(Note)30 b(that)f(the)g(ro)m(ws)g(of)g(a)g(table,)g(whether)f
-(\014xed)g(or)h(v)-5 b(ariable)27 b(length,)i(do)g(not)0
-1233 y(ha)m(v)m(e)j(to)f(b)s(e)e(written)h(consecutiv)m(ely)g(and)g(ma)
-m(y)h(b)s(e)f(written)f(in)g(an)m(y)i(order.)0 1393 y(When)40
+(written.)50 b(Note)35 b(also)e(that)0 1007 y(the)h(new)g(data)g(will)e
+(b)s(e)h(written)g(to)i(a)f(new)g(area)g(of)g(the)h(heap)e(and)h(the)g
+(heap)g(space)g(used)f(b)m(y)h(the)g(previous)0 1120
+y(write)i(cannot)i(b)s(e)e(reclaimed.)60 b(F)-8 b(or)38
+b(this)e(reason)h(it)g(is)f(advised)g(that)i(eac)m(h)g(ro)m(w)f(of)h(a)
+f(v)-5 b(ariable)36 b(length)g(\014eld)0 1233 y(only)c(b)s(e)h(written)
+f(once.)50 b(An)33 b(exception)g(to)h(this)e(general)h(rule)f(o)s
+(ccurs)h(when)f(setting)h(elemen)m(ts)h(of)f(an)g(arra)m(y)0
+1346 y(as)38 b(unde\014ned.)63 b(One)37 b(m)m(ust)i(\014rst)e(write)g
+(a)i(dumm)m(y)e(v)-5 b(alue)38 b(in)m(to)g(the)h(arra)m(y)f(with)f
+(FTPCLx,)j(and)e(then)g(call)0 1458 y(FTPCLU)33 b(to)i(\015ag)f(the)f
+(desired)g(elemen)m(ts)h(as)f(unde\014ned.)49 b(\(Do)35
+b(not)f(use)f(the)h(FTPCNx)f(family)f(of)i(routines)0
+1571 y(with)27 b(v)-5 b(ariable)28 b(length)g(\014elds\).)39
+b(Note)30 b(that)f(the)g(ro)m(ws)g(of)g(a)g(table,)g(whether)f(\014xed)
+g(or)h(v)-5 b(ariable)27 b(length,)i(do)g(not)0 1684
+y(ha)m(v)m(e)j(to)f(b)s(e)e(written)h(consecutiv)m(ely)g(and)g(ma)m(y)h
+(b)s(e)f(written)f(in)g(an)m(y)i(order.)0 1844 y(When)40
 b(writing)f(to)i(a)g(v)-5 b(ariable)39 b(length)h(ASCI)s(I)f(c)m
 (haracter)j(\014eld)d(\(e.g.,)45 b(TF)m(ORM)c(=)f('1P)-8
-b(A'\))43 b(only)c(a)i(single)0 1506 y(c)m(haracter)33
+b(A'\))43 b(only)c(a)i(single)0 1957 y(c)m(haracter)33
 b(string)e(written.)43 b(FTPCLS)30 b(writes)h(the)h(whole)e(length)h
 (of)h(the)g(input)d(string)i(\(min)m(us)f(an)m(y)i(trailing)0
-1619 y(blank)k(c)m(haracters\),)42 b(th)m(us)37 b(the)h(NELEM)f(and)g
+2070 y(blank)k(c)m(haracters\),)42 b(th)m(us)37 b(the)h(NELEM)f(and)g
 (FELEM)h(parameters)g(are)g(ignored.)61 b(If)37 b(the)h(input)d(string)
-i(is)0 1732 y(completely)26 b(blank)g(then)g(FITSIO)g(will)e(write)i
+i(is)0 2183 y(completely)26 b(blank)g(then)g(FITSIO)g(will)e(write)i
 (one)h(blank)e(c)m(haracter)k(to)e(the)g(FITS)f(\014le.)39
-b(Similarly)-8 b(,)24 b(FTGCVS)0 1844 y(and)35 b(FTGCFS)g(read)g(the)h
+b(Similarly)-8 b(,)24 b(FTGCVS)0 2296 y(and)35 b(FTGCFS)g(read)g(the)h
 (en)m(tire)f(string)g(\(truncated)g(to)i(the)e(width)f(of)h(the)h(c)m
-(haracter)h(string)d(argumen)m(t)i(in)0 1957 y(the)31
+(haracter)h(string)d(argumen)m(t)i(in)0 2409 y(the)31
 b(subroutine)d(call\))i(and)g(also)g(ignore)g(the)g(NELEM)h(and)f
-(FELEM)g(parameters.)0 2118 y(The)35 b(FTPDES)h(subroutine)d(is)i
+(FELEM)g(parameters.)0 2569 y(The)35 b(FTPDES)h(subroutine)d(is)i
 (useful)f(in)g(situations)h(where)g(m)m(ultiple)f(ro)m(ws)h(of)h(a)g(v)
--5 b(ariable)35 b(length)g(column)0 2230 y(ha)m(v)m(e)d(the)e(iden)m
+-5 b(ariable)35 b(length)g(column)0 2682 y(ha)m(v)m(e)d(the)e(iden)m
 (tical)f(arra)m(y)i(of)g(v)-5 b(alues.)40 b(One)30 b(can)g(simply)e
 (write)i(the)g(arra)m(y)h(once)g(for)g(the)f(\014rst)g(ro)m(w,)g(and)g
-(then)0 2343 y(use)36 b(FTPDES)g(to)h(write)f(the)g(same)h(descriptor)f
+(then)0 2795 y(use)36 b(FTPDES)g(to)h(write)f(the)g(same)h(descriptor)f
 (v)-5 b(alues)35 b(in)m(to)i(the)f(other)h(ro)m(ws)f(\(use)h(the)f
-(FTGDES)h(routine)0 2456 y(to)f(read)f(the)h(\014rst)f(descriptor)f(v)
+(FTGDES)h(routine)0 2908 y(to)f(read)f(the)h(\014rst)f(descriptor)f(v)
 -5 b(alue\);)38 b(all)c(the)i(ro)m(ws)f(will)e(then)i(p)s(oin)m(t)f(to)
-i(the)g(same)f(storage)i(lo)s(cation)e(th)m(us)0 2569
-y(sa)m(ving)30 b(disk)f(space.)0 2729 y(When)35 b(reading)f(from)g(a)i
+i(the)g(same)f(storage)i(lo)s(cation)e(th)m(us)0 3021
+y(sa)m(ving)30 b(disk)f(space.)0 3181 y(When)35 b(reading)f(from)g(a)i
 (v)-5 b(ariable)33 b(length)i(arra)m(y)g(\014eld)f(one)h(can)g(only)g
 (read)f(as)i(man)m(y)f(elemen)m(ts)g(as)g(actually)0
-2842 y(exist)h(in)e(that)j(ro)m(w)e(of)h(the)g(table;)j(reading)c(do)s
+3294 y(exist)h(in)e(that)j(ro)m(w)e(of)h(the)g(table;)j(reading)c(do)s
 (es)h(not)g(automatically)f(con)m(tin)m(ue)h(with)f(the)h(next)g(ro)m
-(w)g(of)g(the)0 2955 y(table)28 b(as)g(o)s(ccurs)g(when)f(reading)g(an)
+(w)g(of)g(the)0 3407 y(table)28 b(as)g(o)s(ccurs)g(when)f(reading)g(an)
 h(ordinary)f(\014xed)g(length)g(table)h(\014eld.)39 b(A)m(ttempts)29
-b(to)g(read)f(more)g(than)g(this)0 3068 y(will)h(cause)k(an)e(error)h
+b(to)g(read)f(more)g(than)g(this)0 3520 y(will)h(cause)k(an)e(error)h
 (status)g(to)g(b)s(e)f(returned.)44 b(One)32 b(can)g(determine)f(the)h
 (n)m(um)m(b)s(er)e(of)i(elemen)m(ts)g(in)f(eac)m(h)i(ro)m(w)0
-3181 y(of)e(a)f(v)-5 b(ariable)29 b(column)h(with)f(the)h(FTGDES)h
-(subroutine.)0 3519 y Fd(5.10)136 b(Supp)t(ort)44 b(for)h(IEEE)g(Sp)t
-(ecial)h(V)-11 b(alues)0 3770 y Fi(The)26 b(ANSI/IEEE-754)h
+3633 y(of)e(a)f(v)-5 b(ariable)29 b(column)h(with)f(the)h(FTGDES)h
+(subroutine.)0 4179 y Fd(6.10)136 b(Supp)t(ort)44 b(for)h(IEEE)g(Sp)t
+(ecial)h(V)-11 b(alues)0 4472 y Fi(The)26 b(ANSI/IEEE-754)h
 (\015oating-p)s(oin)m(t)f(n)m(um)m(b)s(er)f(standard)g(de\014nes)h
 (certain)g(sp)s(ecial)f(v)-5 b(alues)25 b(that)i(are)g(used)e(to)0
-3883 y(represen)m(t)j(suc)m(h)g(quan)m(tities)f(as)h(Not-a-Num)m(b)s
+4585 y(represen)m(t)j(suc)m(h)g(quan)m(tities)f(as)h(Not-a-Num)m(b)s
 (er)h(\(NaN\),)h(denormalized,)d(under\015o)m(w,)g(o)m(v)m(er\015o)m
-(w,)j(and)d(in\014nit)m(y)-8 b(.)0 3996 y(\(See)29 b(the)f(App)s(endix)
+(w,)j(and)d(in\014nit)m(y)-8 b(.)0 4698 y(\(See)29 b(the)f(App)s(endix)
 d(in)i(the)h(NOST)g(FITS)f(standard)g(or)h(the)g(NOST)g(FITS)f(User's)h
-(Guide)f(for)h(a)g(list)f(of)h(these)0 4109 y(v)-5 b(alues\).)40
+(Guide)f(for)h(a)g(list)f(of)h(these)0 4811 y(v)-5 b(alues\).)40
 b(The)30 b(FITSIO)f(subroutines)f(that)j(read)f(\015oating)h(p)s(oin)m
 (t)e(data)i(in)e(FITS)g(\014les)h(recognize)h(these)g(IEEE)0
-4222 y(sp)s(ecial)38 b(v)-5 b(alues)38 b(and)h(b)m(y)g(default)f(in)m
+4924 y(sp)s(ecial)38 b(v)-5 b(alues)38 b(and)h(b)m(y)g(default)f(in)m
 (terpret)h(the)g(o)m(v)m(er\015o)m(w)i(and)d(in\014nit)m(y)f(v)-5
 b(alues)39 b(as)g(b)s(eing)f(equiv)-5 b(alen)m(t)39 b(to)h(a)0
-4335 y(NaN,)35 b(and)e(con)m(v)m(ert)i(the)f(under\015o)m(w)e(and)h
+5036 y(NaN,)35 b(and)e(con)m(v)m(ert)i(the)f(under\015o)m(w)e(and)h
 (denormalized)f(v)-5 b(alues)33 b(in)m(to)h(zeros.)51
-b(In)33 b(some)h(cases)h(programmers)0 4447 y(ma)m(y)d(w)m(an)m(t)g
+b(In)33 b(some)h(cases)h(programmers)0 5149 y(ma)m(y)d(w)m(an)m(t)g
 (access)g(to)g(the)g(ra)m(w)f(IEEE)g(v)-5 b(alues,)31
 b(without)f(an)m(y)i(mo)s(di\014cation)d(b)m(y)i(FITSIO.)g(This)e(can)j
-(b)s(e)e(done)0 4560 y(b)m(y)k(calling)g(the)g(FTGPVx)h(or)g(FTGCVx)g
+(b)s(e)e(done)0 5262 y(b)m(y)k(calling)g(the)g(FTGPVx)h(or)g(FTGCVx)g
 (routines)e(while)g(sp)s(ecifying)f(0.0)k(as)f(the)f(v)-5
-b(alue)34 b(of)h(the)g(NULL)-10 b(V)g(AL)0 4673 y(parameter.)72
+b(alue)34 b(of)h(the)g(NULL)-10 b(V)g(AL)0 5375 y(parameter.)72
 b(This)38 b(will)g(force)j(FITSIO)e(to)j(simply)c(pass)i(the)g(IEEE)g
 (v)-5 b(alues)40 b(through)g(to)h(the)g(application)0
-4786 y(program,)30 b(without)f(an)m(y)h(mo)s(di\014cation.)39
+5488 y(program,)30 b(without)f(an)m(y)h(mo)s(di\014cation.)39
 b(This)29 b(do)s(es)g(not)h(w)m(ork)g(for)g(double)f(precision)f(v)-5
-b(alues)29 b(on)h(V)-10 b(AX/VMS)0 4899 y(mac)m(hines,)37
+b(alues)29 b(on)h(V)-10 b(AX/VMS)0 5601 y(mac)m(hines,)37
 b(ho)m(w)m(ev)m(er,)i(where)d(there)g(is)f(no)h(easy)g(w)m(a)m(y)h(to)g
 (b)m(ypass)f(the)g(default)f(in)m(terpretation)g(of)h(the)h(IEEE)0
-5012 y(sp)s(ecial)29 b(v)-5 b(alues.)0 5350 y Fd(5.11)136
-b(When)44 b(the)h(Final)h(Size)f(of)g(the)g(FITS)f(HDU)h(is)g(Unkno)l
-(wn)0 5601 y Fi(It)27 b(is)g(not)g(required)e(to)j(kno)m(w)f(the)h
-(total)g(size)f(of)g(a)h(FITS)e(data)i(arra)m(y)g(or)f(table)g(b)s
-(efore)g(b)s(eginning)d(to)k(write)f(the)0 5714 y(data)32
+5714 y(sp)s(ecial)29 b(v)-5 b(alues.)p eop
+%%Page: 53 59
+53 58 bop 0 299 a Fg(6.11.)73 b(WHEN)31 b(THE)f(FINAL)g(SIZE)f(OF)i
+(THE)f(FITS)f(HDU)i(IS)f(UNKNO)m(WN)978 b Fi(53)0 555
+y Fd(6.11)136 b(When)44 b(the)h(Final)h(Size)f(of)g(the)g(FITS)f(HDU)h
+(is)g(Unkno)l(wn)0 805 y Fi(It)27 b(is)g(not)g(required)e(to)j(kno)m(w)
+f(the)h(total)g(size)f(of)g(a)h(FITS)e(data)i(arra)m(y)g(or)f(table)g
+(b)s(efore)g(b)s(eginning)d(to)k(write)f(the)0 918 y(data)32
 b(to)f(the)g(FITS)f(\014le.)42 b(In)30 b(the)h(case)h(of)f(the)g
 (primary)e(arra)m(y)i(or)g(an)f(image)i(extension,)e(one)i(should)c
-(initially)p eop
-%%Page: 45 51
-45 50 bop 0 299 a Fg(5.12.)73 b(LOCAL)29 b(FITS)h(CONVENTIONS)f(SUPPOR)
--8 b(TED)29 b(BY)i(FITSIO)1168 b Fi(45)0 555 y(create)31
-b(the)e(arra)m(y)h(with)d(the)j(size)f(of)g(the)g(highest)f(dimension)f
-(\(largest)j(NAXISn)e(k)m(eyw)m(ord\))i(set)g(to)g(a)f(dumm)m(y)0
-668 y(v)-5 b(alue,)25 b(suc)m(h)f(as)g(1.)39 b(Then)23
-b(after)i(all)e(the)i(data)f(ha)m(v)m(e)i(b)s(een)d(written)g(and)h
-(the)g(true)g(dimensions)e(are)i(kno)m(wn,)h(then)0 781
-y(the)31 b(NAXISn)e(v)-5 b(alue)30 b(should)f(b)s(e)h(up)s(dated)f
-(using)g(the)i(\014ts)p 2051 781 28 4 v 62 w(up)s(date)p
-2389 781 V 32 w(k)m(ey)h(routine)d(b)s(efore)h(mo)m(ving)h(to)g
-(another)0 894 y(extension)f(or)g(closing)g(the)g(FITS)g(\014le.)0
-1054 y(When)f(writing)e(to)i(FITS)g(tables,)g(CFITSIO)e(automatically)i
+(initially)0 1031 y(create)j(the)e(arra)m(y)h(with)d(the)j(size)f(of)g
+(the)g(highest)f(dimension)f(\(largest)j(NAXISn)e(k)m(eyw)m(ord\))i
+(set)g(to)g(a)f(dumm)m(y)0 1144 y(v)-5 b(alue,)25 b(suc)m(h)f(as)g(1.)
+39 b(Then)23 b(after)i(all)e(the)i(data)f(ha)m(v)m(e)i(b)s(een)d
+(written)g(and)h(the)g(true)g(dimensions)e(are)i(kno)m(wn,)h(then)0
+1257 y(the)31 b(NAXISn)e(v)-5 b(alue)30 b(should)f(b)s(e)h(up)s(dated)f
+(using)g(the)i(\014ts)p 2051 1257 28 4 v 62 w(up)s(date)p
+2389 1257 V 32 w(k)m(ey)h(routine)d(b)s(efore)h(mo)m(ving)h(to)g
+(another)0 1370 y(extension)f(or)g(closing)g(the)g(FITS)g(\014le.)0
+1530 y(When)f(writing)e(to)i(FITS)g(tables,)g(CFITSIO)e(automatically)i
 (k)m(eeps)h(trac)m(k)g(of)f(the)g(highest)g(ro)m(w)g(n)m(um)m(b)s(er)e
-(that)0 1167 y(is)k(written)g(to,)i(and)e(will)e(increase)j(the)g(size)
+(that)0 1643 y(is)k(written)g(to,)i(and)e(will)e(increase)j(the)g(size)
 g(of)g(the)g(table)f(if)g(necessary)-8 b(.)46 b(CFITSIO)30
-b(will)f(also)j(automatically)0 1280 y(insert)j(space)i(in)e(the)h
+b(will)f(also)j(automatically)0 1756 y(insert)j(space)i(in)e(the)h
 (FITS)f(\014le)h(if)f(necessary)-8 b(,)39 b(to)e(ensure)e(that)i(the)f
 (data)h('heap',)h(if)d(it)h(exists,)h(and/or)g(an)m(y)0
-1393 y(additional)26 b(HDUs)j(that)g(follo)m(w)e(the)i(table)f(do)g
+1869 y(additional)26 b(HDUs)j(that)g(follo)m(w)e(the)i(table)f(do)g
 (not)h(get)g(o)m(v)m(erwritten)g(as)f(new)g(ro)m(ws)g(are)h(written)e
-(to)i(the)g(table.)0 1553 y(As)37 b(a)h(general)f(rule)f(it)h(is)f(b)s
+(to)i(the)g(table.)0 2029 y(As)37 b(a)h(general)f(rule)f(it)h(is)f(b)s
 (est)h(to)h(sp)s(ecify)e(the)i(initial)c(n)m(um)m(b)s(er)i(of)i(ro)m
-(ws)f(=)g(0)g(when)g(the)g(table)g(is)g(created,)0 1666
+(ws)f(=)g(0)g(when)g(the)g(table)g(is)g(created,)0 2142
 y(then)h(let)g(CFITSIO)f(k)m(eep)i(trac)m(k)g(of)g(the)f(n)m(um)m(b)s
 (er)f(of)i(ro)m(ws)f(that)h(are)f(actually)g(written.)64
-b(The)38 b(application)0 1779 y(program)e(should)e(not)j(man)m(ually)e
+b(The)38 b(application)0 2255 y(program)e(should)e(not)j(man)m(ually)e
 (up)s(date)g(the)i(n)m(um)m(b)s(er)e(of)h(ro)m(ws)g(in)f(the)i(table)f
-(\(as)h(giv)m(en)f(b)m(y)g(the)h(NAXIS2)0 1892 y(k)m(eyw)m(ord\))j
+(\(as)h(giv)m(en)f(b)m(y)g(the)h(NAXIS2)0 2368 y(k)m(eyw)m(ord\))j
 (since)e(CFITSIO)f(do)s(es)i(this)f(automatically)-8
 b(.)66 b(If)38 b(a)i(table)e(is)g(initially)e(created)k(with)d(more)i
-(than)0 2005 y(zero)g(ro)m(ws,)i(then)d(this)g(will)e(ususally)g(b)s(e)
-i(considered)f(as)i(the)g(minim)m(um)c(size)k(of)f(the)h(table,)i(ev)m
-(en)e(if)f(few)m(er)0 2118 y(ro)m(ws)30 b(are)g(actually)f(written)g
+(than)0 2481 y(zero)i(ro)m(ws,)j(then)c(this)g(will)d(usually)i(b)s(e)h
+(considered)f(as)i(the)g(minim)m(um)d(size)i(of)h(the)g(table,)i(ev)m
+(en)e(if)f(few)m(er)0 2594 y(ro)m(ws)30 b(are)g(actually)f(written)g
 (to)i(the)f(table.)40 b(Th)m(us,)30 b(if)e(a)j(table)e(is)g(initially)d
-(created)31 b(with)e(NAXIS2)h(=)f(20,)j(and)0 2230 y(CFITSIO)f(only)h
+(created)31 b(with)e(NAXIS2)h(=)f(20,)j(and)0 2706 y(CFITSIO)f(only)h
 (writes)f(10)j(ro)m(ws)e(of)h(data)g(b)s(efore)f(closing)g(the)h
 (table,)g(then)f(NAXIS2)h(will)d(remain)h(equal)h(to)0
-2343 y(20.)50 b(If)33 b(ho)m(w)m(ev)m(er,)i(30)g(ro)m(ws)e(of)g(data)h
+2819 y(20.)50 b(If)33 b(ho)m(w)m(ev)m(er,)i(30)g(ro)m(ws)e(of)g(data)h
 (are)g(written)e(to)i(this)e(table,)i(then)f(NAXIS2)h(will)c(b)s(e)j
-(increased)f(from)h(20)0 2456 y(to)f(30.)44 b(The)31
+(increased)f(from)h(20)0 2932 y(to)f(30.)44 b(The)31
 b(one)g(exception)h(to)g(this)e(automatic)i(up)s(dating)d(of)i(the)h
 (NAXIS2)f(k)m(eyw)m(ord)h(is)e(if)g(the)i(application)0
-2569 y(program)c(directly)e(mo)s(di\014es)g(the)j(v)-5
+3045 y(program)c(directly)e(mo)s(di\014es)g(the)j(v)-5
 b(alue)27 b(of)h(NAXIS2)g(\(up)f(or)h(do)m(wn\))g(itself)f(just)g(b)s
-(efore)h(closing)f(the)h(table.)40 b(In)0 2682 y(this)27
+(efore)h(closing)f(the)h(table.)40 b(In)0 3158 y(this)27
 b(case,)j(CFITSIO)d(do)s(es)h(not)h(up)s(date)e(NAXIS2)i(again,)g
 (since)f(it)g(assumes)g(that)h(the)f(application)f(program)0
-2795 y(m)m(ust)32 b(ha)m(v)m(e)h(had)f(a)g(go)s(o)s(d)g(reason)h(for)f
+3271 y(m)m(ust)32 b(ha)m(v)m(e)h(had)f(a)g(go)s(o)s(d)g(reason)h(for)f
 (c)m(hanging)g(the)g(v)-5 b(alue)32 b(directly)-8 b(.)45
 b(This)30 b(is)h(not)i(recommended,)f(ho)m(w)m(ev)m(er,)0
-2908 y(and)j(is)g(only)g(pro)m(vided)g(for)g(bac)m(kw)m(ard)h
+3384 y(and)j(is)g(only)g(pro)m(vided)g(for)g(bac)m(kw)m(ard)h
 (compatibilit)m(y)e(with)h(soft)m(w)m(are)i(that)g(initially)32
-b(creates)37 b(a)f(table)g(with)0 3021 y(a)e(large)g(n)m(um)m(b)s(er)f
+b(creates)37 b(a)f(table)g(with)0 3497 y(a)e(large)g(n)m(um)m(b)s(er)f
 (of)h(ro)m(ws,)h(than)f(decreases)g(the)h(NAXIS2)f(v)-5
 b(alue)33 b(to)i(the)f(actual)g(smaller)f(v)-5 b(alue)33
-b(just)g(b)s(efore)0 3134 y(closing)c(the)i(table.)0
-3466 y Fd(5.12)136 b(Lo)t(cal)45 b(FITS)e(Con)l(v)l(en)l(tions)k(supp)t
-(orted)d(b)l(y)h(FITSIO)0 3716 y Fi(CFITSIO)25 b(supp)s(orts)g(sev)m
+b(just)g(b)s(efore)0 3610 y(closing)c(the)i(table.)0
+3941 y Fd(6.12)136 b(Lo)t(cal)45 b(FITS)e(Con)l(v)l(en)l(tions)k(supp)t
+(orted)d(b)l(y)h(FITSIO)0 4191 y Fi(CFITSIO)25 b(supp)s(orts)g(sev)m
 (eral)i(lo)s(cal)e(FITS)h(con)m(v)m(en)m(tions)i(whic)m(h)d(are)i(not)g
-(de\014ned)e(in)g(the)i(o\016cial)f(NOST)g(FITS)0 3829
+(de\014ned)e(in)g(the)i(o\016cial)f(NOST)g(FITS)0 4304
 y(standard)k(and)g(whic)m(h)g(are)h(not)g(necessarily)e(recognized)i
 (or)g(supp)s(orted)e(b)m(y)i(other)g(FITS)f(soft)m(w)m(are)i(pac)m(k)-5
-b(ages.)0 3942 y(Programmers)36 b(should)e(b)s(e)h(cautious)h(ab)s(out)
+b(ages.)0 4417 y(Programmers)36 b(should)e(b)s(e)h(cautious)h(ab)s(out)
 f(using)g(these)h(features,)i(esp)s(ecially)c(if)h(the)h(FITS)f
-(\014les)g(that)i(are)0 4054 y(pro)s(duced)31 b(are)i(exp)s(ected)g(to)
+(\014les)g(that)i(are)0 4530 y(pro)s(duced)31 b(are)i(exp)s(ected)g(to)
 g(b)s(e)f(pro)s(cessed)g(b)m(y)h(other)f(soft)m(w)m(are)i(systems)f
-(whic)m(h)e(do)i(not)f(use)h(the)f(CFITSIO)0 4167 y(in)m(terface.)0
-4456 y Fb(5.12.1)113 b(Supp)s(ort)37 b(for)h(Long)g(String)e(Keyw)m
-(ord)i(V)-9 b(alues.)0 4675 y Fi(The)23 b(length)h(of)g(a)g(standard)f
+(whic)m(h)e(do)i(not)f(use)h(the)f(CFITSIO)0 4642 y(in)m(terface.)0
+4930 y Fb(6.12.1)113 b(Supp)s(ort)37 b(for)h(Long)g(String)e(Keyw)m
+(ord)i(V)-9 b(alues.)0 5149 y Fi(The)23 b(length)h(of)g(a)g(standard)f
 (FITS)g(string)g(k)m(eyw)m(ord)h(is)f(limited)f(to)i(68)h(c)m
 (haracters)g(b)s(ecause)f(it)f(m)m(ust)h(\014t)g(en)m(tirely)0
-4788 y(within)33 b(a)j(single)f(FITS)g(header)h(k)m(eyw)m(ord)g
+5262 y(within)33 b(a)j(single)f(FITS)g(header)h(k)m(eyw)m(ord)g
 (record.)57 b(In)35 b(some)h(instances)f(it)h(is)e(necessary)j(to)f
-(enco)s(de)g(strings)0 4901 y(longer)26 b(than)g(this)f(limit,)g(so)h
+(enco)s(de)g(strings)0 5375 y(longer)26 b(than)g(this)f(limit,)g(so)h
 (FITSIO)f(supp)s(orts)f(a)j(lo)s(cal)e(con)m(v)m(en)m(tion)i(in)e(whic)
 m(h)g(the)h(string)f(v)-5 b(alue)26 b(is)f(con)m(tin)m(ued)0
-5014 y(o)m(v)m(er)34 b(m)m(ultiple)d(k)m(eyw)m(ords.)49
+5488 y(o)m(v)m(er)34 b(m)m(ultiple)d(k)m(eyw)m(ords.)49
 b(This)31 b(con)m(tin)m(uation)i(con)m(v)m(en)m(tion)i(uses)d(an)h(amp)
-s(ersand)f(c)m(haracter)i(at)g(the)f(end)g(of)0 5127
+s(ersand)f(c)m(haracter)i(at)g(the)f(end)g(of)0 5601
 y(eac)m(h)c(substring)c(to)j(indicate)f(that)h(it)f(is)g(con)m(tin)m
 (ued)g(on)g(the)h(next)g(k)m(eyw)m(ord,)h(and)d(the)i(con)m(tin)m
-(uation)g(k)m(eyw)m(ords)0 5240 y(all)42 b(ha)m(v)m(e)j(the)f(name)f
+(uation)g(k)m(eyw)m(ords)0 5714 y(all)42 b(ha)m(v)m(e)j(the)f(name)f
 (CONTINUE)g(without)f(an)i(equal)f(sign)f(in)g(column)h(9.)80
-b(The)43 b(string)g(v)-5 b(alue)42 b(ma)m(y)j(b)s(e)0
-5353 y(con)m(tin)m(ued)28 b(in)f(this)h(w)m(a)m(y)h(o)m(v)m(er)h(as)e
-(man)m(y)h(additional)d(CONTINUE)i(k)m(eyw)m(ords)g(as)h(is)e
-(required.)39 b(The)27 b(follo)m(wing)0 5466 y(lines)i(illustrate)f
-(this)h(con)m(tin)m(uation)i(con)m(v)m(en)m(tion)g(whic)m(h)e(is)h
-(used)f(in)g(the)i(v)-5 b(alue)30 b(of)g(the)h(STRKEY)e(k)m(eyw)m(ord:)
-0 5714 y Fe(LONGSTRN=)45 b('OGIP)i(1.0')524 b(/)47 b(The)g(OGIP)g(Long)
-f(String)g(Convention)f(may)i(be)g(used.)p eop
-%%Page: 46 52
-46 51 bop 0 299 a Fi(46)1277 b Fg(CHAPTER)29 b(5.)72
+b(The)43 b(string)g(v)-5 b(alue)42 b(ma)m(y)j(b)s(e)p
+eop
+%%Page: 54 60
+54 59 bop 0 299 a Fi(54)1277 b Fg(CHAPTER)29 b(6.)72
 b(FITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fe(STRKEY)94 b(=)47 b('This)g(is)g(a)g(very)g(long)g(string)f
-(keyword&')93 b(/)47 b(Optional)f(Comment)0 668 y(CONTINUE)93
-b(')48 b(value)e(that)h(is)g(continued)e(over)i(3)g(keywords)f(in)h
-(the)g(&)95 b(')0 781 y(CONTINUE)e('FITS)47 b(header.')e(/)j(This)e(is)
-h(another)f(optional)g(comment.)0 1006 y Fi(It)29 b(is)f(recommended)g
-(that)h(the)g(LONGSTRN)f(k)m(eyw)m(ord,)i(as)f(sho)m(wn)f(here,)h(alw)m
-(a)m(ys)h(b)s(e)e(included)e(in)h(an)m(y)i(HDU)0 1119
-y(that)f(uses)e(this)g(longstring)g(con)m(v)m(en)m(tion.)41
-b(A)27 b(subroutine)e(called)h(FTPLSW)h(has)g(b)s(een)f(pro)m(vided)g
-(in)f(CFITSIO)0 1231 y(to)31 b(write)f(this)f(k)m(eyw)m(ord)i(if)e(it)h
-(do)s(es)g(not)h(already)f(exist.)0 1392 y(This)22 b(long)i(string)g
-(con)m(v)m(en)m(tion)h(is)e(supp)s(orted)g(b)m(y)h(the)g(follo)m(wing)f
-(FITSIO)g(subroutines)f(that)j(deal)f(with)f(string-)0
-1505 y(v)-5 b(alued)29 b(k)m(eyw)m(ords:)286 1729 y Fe(ftgkys)46
-b(-)i(read)f(a)g(string)f(keyword)286 1842 y(ftpkls)g(-)i(write)e
-(\(append\))g(a)h(string)f(keyword)286 1955 y(ftikls)g(-)i(insert)e(a)h
-(string)g(keyword)286 2068 y(ftmkls)f(-)i(modify)e(the)h(value)f(of)h
-(an)h(existing)d(string)h(keyword)286 2181 y(ftukls)g(-)i(update)e(an)h
+Fi(con)m(tin)m(ued)d(in)f(this)h(w)m(a)m(y)h(o)m(v)m(er)h(as)e(man)m(y)
+h(additional)d(CONTINUE)i(k)m(eyw)m(ords)g(as)h(is)e(required.)39
+b(The)27 b(follo)m(wing)0 668 y(lines)i(illustrate)f(this)h(con)m(tin)m
+(uation)i(con)m(v)m(en)m(tion)g(whic)m(h)e(is)h(used)f(in)g(the)i(v)-5
+b(alue)30 b(of)g(the)h(STRKEY)e(k)m(eyw)m(ord:)0 904
+y Fe(LONGSTRN=)45 b('OGIP)i(1.0')524 b(/)47 b(The)g(OGIP)g(Long)f
+(String)g(Convention)f(may)i(be)g(used.)0 1017 y(STRKEY)94
+b(=)47 b('This)g(is)g(a)g(very)g(long)g(string)f(keyword&')93
+b(/)47 b(Optional)f(Comment)0 1130 y(CONTINUE)93 b(')48
+b(value)e(that)h(is)g(continued)e(over)i(3)g(keywords)f(in)h(the)g(&)95
+b(')0 1243 y(CONTINUE)e('FITS)47 b(header.')e(/)j(This)e(is)h(another)f
+(optional)g(comment.)0 1479 y Fi(It)29 b(is)f(recommended)g(that)h(the)
+g(LONGSTRN)f(k)m(eyw)m(ord,)i(as)f(sho)m(wn)f(here,)h(alw)m(a)m(ys)h(b)
+s(e)e(included)e(in)h(an)m(y)i(HDU)0 1592 y(that)f(uses)e(this)g
+(longstring)g(con)m(v)m(en)m(tion.)41 b(A)27 b(subroutine)e(called)h
+(FTPLSW)h(has)g(b)s(een)f(pro)m(vided)g(in)f(CFITSIO)0
+1705 y(to)31 b(write)f(this)f(k)m(eyw)m(ord)i(if)e(it)h(do)s(es)g(not)h
+(already)f(exist.)0 1865 y(This)22 b(long)i(string)g(con)m(v)m(en)m
+(tion)h(is)e(supp)s(orted)g(b)m(y)h(the)g(follo)m(wing)f(FITSIO)g
+(subroutines)f(that)j(deal)f(with)f(string-)0 1978 y(v)-5
+b(alued)29 b(k)m(eyw)m(ords:)286 2215 y Fe(ftgkys)46
+b(-)i(read)f(a)g(string)f(keyword)286 2328 y(ftpkls)g(-)i(write)e
+(\(append\))g(a)h(string)f(keyword)286 2440 y(ftikls)g(-)i(insert)e(a)h
+(string)g(keyword)286 2553 y(ftmkls)f(-)i(modify)e(the)h(value)f(of)h
+(an)h(existing)d(string)h(keyword)286 2666 y(ftukls)g(-)i(update)e(an)h
 (existing)f(keyword,)f(or)i(write)g(a)g(new)g(keyword)286
-2294 y(ftdkey)f(-)i(delete)e(a)h(keyword)0 2518 y Fi(These)41
+2779 y(ftdkey)f(-)i(delete)e(a)h(keyword)0 3015 y Fi(These)41
 b(routines)e(will)f(transparen)m(tly)i(read,)k(write,)f(or)e(delete)g
 (a)g(long)f(string)g(v)-5 b(alue)40 b(in)g(the)h(FITS)f(\014le,)j(so)0
-2631 y(programmers)36 b(in)f(general)h(do)g(not)h(ha)m(v)m(e)g(to)g(b)s
+3128 y(programmers)36 b(in)f(general)h(do)g(not)h(ha)m(v)m(e)g(to)g(b)s
 (e)f(concerned)g(ab)s(out)g(the)g(details)g(of)g(the)h(con)m(v)m(en)m
-(tion)g(that)g(is)0 2744 y(used)32 b(to)i(enco)s(de)f(the)g(long)f
+(tion)g(that)g(is)0 3241 y(used)32 b(to)i(enco)s(de)f(the)g(long)f
 (string)g(in)g(the)h(FITS)f(header.)48 b(When)33 b(reading)f(a)h(long)g
-(string,)g(one)g(m)m(ust)g(ensure)0 2857 y(that)h(the)f(c)m(haracter)i
+(string,)g(one)g(m)m(ust)g(ensure)0 3354 y(that)h(the)f(c)m(haracter)i
 (string)e(parameter)h(used)e(in)g(these)i(subroutine)d(calls)i(has)g(b)
-s(een)f(declared)h(long)g(enough)0 2970 y(to)e(hold)e(the)i(en)m(tire)f
+s(een)f(declared)h(long)g(enough)0 3467 y(to)e(hold)e(the)i(en)m(tire)f
 (string,)g(otherwise)f(the)i(returned)e(string)g(v)-5
-b(alue)30 b(will)e(b)s(e)i(truncated.)0 3130 y(Note)d(that)e(the)h
+b(alue)30 b(will)e(b)s(e)i(truncated.)0 3627 y(Note)d(that)e(the)h
 (more)f(commonly)g(used)f(FITSIO)g(subroutine)g(to)i(write)e(string)g
-(v)-5 b(alued)24 b(k)m(eyw)m(ords)i(\(FTPKYS\))0 3243
+(v)-5 b(alued)24 b(k)m(eyw)m(ords)i(\(FTPKYS\))0 3740
 y(do)s(es)38 b(NOT)g(supp)s(ort)f(this)g(long)h(string)g(con)m(v)m(en)m
 (tion)h(and)f(only)g(supp)s(orts)e(strings)h(up)h(to)h(68)g(c)m
-(haracters)h(in)0 3356 y(length.)h(This)29 b(has)h(b)s(een)g(done)h
+(haracters)h(in)0 3853 y(length.)h(This)29 b(has)h(b)s(een)g(done)h
 (delib)s(erately)d(to)k(prev)m(en)m(t)f(programs)g(from)f(inadv)m
-(erten)m(tly)g(writing)f(k)m(eyw)m(ords)0 3469 y(using)37
+(erten)m(tly)g(writing)f(k)m(eyw)m(ords)0 3966 y(using)37
 b(this)h(non-standard)f(con)m(v)m(en)m(tion)j(without)e(the)g(explicit)
 f(in)m(ten)m(t)i(of)g(the)g(programmer)f(or)h(user.)64
-b(The)0 3582 y(FTPKLS)28 b(subroutine)f(m)m(ust)i(b)s(e)g(called)f
+b(The)0 4079 y(FTPKLS)28 b(subroutine)f(m)m(ust)i(b)s(e)g(called)f
 (instead)h(to)h(write)e(long)h(strings.)39 b(This)27
-b(routine)i(can)g(also)g(b)s(e)g(used)f(to)0 3695 y(write)i(ordinary)e
+b(routine)i(can)g(also)g(b)s(e)g(used)f(to)0 4192 y(write)i(ordinary)e
 (string)i(v)-5 b(alues)29 b(less)h(than)g(68)h(c)m(haracters)h(in)d
-(length.)0 3980 y Fb(5.12.2)113 b(Arra)m(ys)37 b(of)g(Fixed-Length)i
-(Strings)e(in)f(Binary)h(T)-9 b(ables)0 4199 y Fi(The)29
+(length.)0 4479 y Fb(6.12.2)113 b(Arra)m(ys)37 b(of)g(Fixed-Length)i
+(Strings)e(in)f(Binary)h(T)-9 b(ables)0 4698 y Fi(The)29
 b(de\014nition)e(of)j(the)f(FITS)g(binary)e(table)j(extension)f(format)
 g(do)s(es)h(not)f(pro)m(vide)g(a)g(simple)f(w)m(a)m(y)i(to)g(sp)s
-(ecify)0 4312 y(that)f(a)f(c)m(haracter)i(column)d(con)m(tains)h(an)g
+(ecify)0 4811 y(that)f(a)f(c)m(haracter)i(column)d(con)m(tains)h(an)g
 (arra)m(y)h(of)f(\014xed-length)f(strings.)39 b(T)-8
-b(o)29 b(supp)s(ort)d(this)h(feature,)i(FITSIO)0 4425
+b(o)29 b(supp)s(ort)d(this)h(feature,)i(FITSIO)0 4924
 y(uses)i(a)h(lo)s(cal)f(con)m(v)m(en)m(tion)h(for)f(the)h(format)g(of)g
 (the)f(TF)m(ORMn)g(k)m(eyw)m(ord)h(v)-5 b(alue)31 b(of)h(the)g(form)f
-('rAw')g(where)g('r')0 4538 y(is)c(an)g(in)m(teger)h(sp)s(ecifying)d
+('rAw')g(where)g('r')0 5036 y(is)c(an)g(in)m(teger)h(sp)s(ecifying)d
 (the)j(total)g(width)e(in)g(c)m(haracters)j(of)f(the)g(column,)f(and)g
-('w')g(is)g(an)g(in)m(teger)h(sp)s(ecifying)0 4650 y(the)c(\(\014xed\))
+('w')g(is)g(an)g(in)m(teger)h(sp)s(ecifying)0 5149 y(the)c(\(\014xed\))
 g(length)g(of)g(an)g(individual)19 b(unit)k(string)g(within)e(the)j(v)m
 (ector.)41 b(F)-8 b(or)24 b(example,)i(TF)m(ORM1)e(=)g('120A10')0
-4763 y(w)m(ould)k(indicate)g(that)h(the)h(binary)d(table)i(column)f(is)
+5262 y(w)m(ould)k(indicate)g(that)h(the)h(binary)d(table)i(column)f(is)
 g(120)i(c)m(haracters)g(wide)e(and)h(consists)f(of)h(12)h(10-c)m
-(haracter)0 4876 y(length)e(strings.)39 b(This)27 b(con)m(v)m(en)m
+(haracter)0 5375 y(length)e(strings.)39 b(This)27 b(con)m(v)m(en)m
 (tion)j(is)d(recognized)i(b)m(y)g(the)f(FITSIO)g(subroutines)e(that)j
-(read)g(or)f(write)g(strings)0 4989 y(in)37 b(binary)f(tables.)64
+(read)g(or)f(write)g(strings)0 5488 y(in)37 b(binary)f(tables.)64
 b(The)37 b(Binary)g(T)-8 b(able)38 b(de\014nition)e(do)s(cumen)m(t)i
 (sp)s(eci\014es)e(that)j(other)f(optional)f(c)m(haracters)0
-5102 y(ma)m(y)f(follo)m(w)f(the)g(datat)m(yp)s(e)i(co)s(de)e(in)g(the)g
+5601 y(ma)m(y)f(follo)m(w)f(the)g(datat)m(yp)s(e)i(co)s(de)e(in)g(the)g
 (TF)m(ORM)h(k)m(eyw)m(ord,)i(so)d(this)g(lo)s(cal)f(con)m(v)m(en)m
-(tion)j(is)d(in)h(compliance)0 5215 y(with)23 b(the)i(FITS)f(standard,)
+(tion)j(is)d(in)h(compliance)0 5714 y(with)23 b(the)i(FITS)f(standard,)
 i(although)e(other)h(FITS)f(readers)g(are)h(not)g(required)e(to)i
-(recognize)h(this)e(con)m(v)m(en)m(tion.)0 5375 y(The)h(Binary)g(T)-8
-b(able)26 b(de\014nition)d(do)s(cumen)m(t)j(that)h(w)m(as)f(appro)m(v)m
-(ed)g(b)m(y)g(the)g(IA)m(U)g(in)f(1994)j(con)m(tains)e(an)f(app)s
-(endix)0 5488 y(describing)20 b(an)j(alternate)g(con)m(v)m(en)m(tion)h
-(for)f(sp)s(ecifying)d(arra)m(ys)j(of)g(\014xed)f(or)h(v)-5
-b(ariable)22 b(length)g(strings)f(in)h(a)h(binary)0 5601
+(recognize)h(this)e(con)m(v)m(en)m(tion.)p eop
+%%Page: 55 61
+55 60 bop 0 299 a Fg(6.12.)73 b(LOCAL)29 b(FITS)h(CONVENTIONS)f(SUPPOR)
+-8 b(TED)29 b(BY)i(FITSIO)1168 b Fi(55)0 555 y(The)25
+b(Binary)g(T)-8 b(able)26 b(de\014nition)d(do)s(cumen)m(t)j(that)h(w)m
+(as)f(appro)m(v)m(ed)g(b)m(y)g(the)g(IA)m(U)g(in)f(1994)j(con)m(tains)e
+(an)f(app)s(endix)0 668 y(describing)20 b(an)j(alternate)g(con)m(v)m
+(en)m(tion)h(for)f(sp)s(ecifying)d(arra)m(ys)j(of)g(\014xed)f(or)h(v)-5
+b(ariable)22 b(length)g(strings)f(in)h(a)h(binary)0 781
 y(table)34 b(c)m(haracter)h(column)e(\(with)g(the)i(form)e
 ('rA:SSTRw/nnn\)'.)50 b(This)32 b(app)s(endix)f(w)m(as)k(not)f
-(o\016cially)f(v)m(oted)0 5714 y(on)d(b)m(y)h(the)f(IA)m(U)h(and)f
+(o\016cially)f(v)m(oted)0 894 y(on)d(b)m(y)h(the)f(IA)m(U)h(and)f
 (hence)g(is)g(still)e(pro)m(visional.)39 b(FITSIO)29
-b(do)s(es)h(not)h(curren)m(tly)e(supp)s(ort)g(this)g(prop)s(osal.)p
-eop
-%%Page: 47 53
-47 52 bop 0 299 a Fg(5.12.)73 b(LOCAL)29 b(FITS)h(CONVENTIONS)f(SUPPOR)
--8 b(TED)29 b(BY)i(FITSIO)1168 b Fi(47)0 555 y Fb(5.12.3)113
-b(Keyw)m(ord)37 b(Units)g(Strings)0 776 y Fi(One)g(de\014ciency)g(of)h
-(the)g(curren)m(t)g(FITS)f(Standard)f(is)h(that)i(it)e(do)s(es)g(not)h
-(de\014ne)f(a)i(sp)s(eci\014c)d(con)m(v)m(en)m(tion)j(for)0
-889 y(recording)29 b(the)h(ph)m(ysical)f(units)g(of)h(a)g(k)m(eyw)m
-(ord)h(v)-5 b(alue.)40 b(The)30 b(TUNITn)f(k)m(eyw)m(ord)h(can)g(b)s(e)
-g(used)f(to)i(sp)s(ecify)e(the)0 1002 y(ph)m(ysical)34
-b(units)g(of)h(the)h(v)-5 b(alues)35 b(in)f(a)h(table)h(column,)f(but)g
-(there)g(is)g(no)g(analogous)h(con)m(v)m(en)m(tion)g(for)f(k)m(eyw)m
-(ord)0 1115 y(v)-5 b(alues.)41 b(The)30 b(commen)m(t)h(\014eld)f(of)g
-(the)h(k)m(eyw)m(ord)g(is)f(often)h(used)f(for)g(this)f(purp)s(ose,)h
-(but)f(the)i(units)e(are)i(usually)0 1228 y(not)g(sp)s(eci\014ed)d(in)h
-(a)i(w)m(ell)e(de\014ned)h(format)g(that)h(FITS)f(readers)g(can)h
-(easily)e(recognize)i(and)f(extract.)0 1388 y(T)-8 b(o)28
-b(solv)m(e)g(this)e(de\014ciency)-8 b(,)29 b(FITSIO)d(uses)h(a)h(lo)s
-(cal)f(con)m(v)m(en)m(tion)i(in)d(whic)m(h)g(the)i(k)m(eyw)m(ord)g
-(units)e(are)i(enclosed)f(in)0 1501 y(square)20 b(brac)m(k)m(ets)j(as)e
-(the)f(\014rst)g(tok)m(en)i(in)e(the)g(k)m(eyw)m(ord)i(commen)m(t)f
-(\014eld;)i(more)e(sp)s(eci\014cally)-8 b(,)21 b(the)g(op)s(ening)e
-(square)0 1614 y(brac)m(k)m(et)28 b(immediately)d(follo)m(ws)g(the)i
-(slash)e('/')i(commen)m(t)h(\014eld)d(delimiter)f(and)i(a)g(single)f
-(space)i(c)m(haracter.)41 b(The)0 1727 y(follo)m(wing)29
-b(examples)h(illustrate)e(k)m(eyw)m(ords)j(that)g(use)f(this)f(con)m(v)
-m(en)m(tion:)0 1994 y Fe(EXPOSURE=)713 b(1800.0)47 b(/)g([s])g(elapsed)
-f(exposure)f(time)0 2107 y(V_HELIO)h(=)763 b(16.23)47
-b(/)g([km)g(s**\(-1\)])e(heliocentric)g(velocity)0 2220
-y(LAMBDA)94 b(=)763 b(5400.)47 b(/)g([angstrom])e(central)h(wavelength)
-0 2333 y(FLUX)190 b(=)47 b(4.9033487787637465E-30)42
-b(/)47 b([J/cm**2/s])e(average)h(flux)0 2601 y Fi(In)28
-b(general,)g(the)h(units)d(named)i(in)f(the)i(IA)m(U\(1988\))i(St)m
-(yle)d(Guide)f(are)i(recommended,)f(with)f(the)i(main)e(excep-)0
-2714 y(tion)j(that)h(the)f(preferred)g(unit)e(for)j(angle)f(is)f('deg')
-j(for)e(degrees.)0 2874 y(The)24 b(FTPUNT)g(and)g(FTGUNT)h(subroutines)
-e(in)g(FITSIO)g(write)h(and)g(read,)i(resp)s(ectiv)m(ely)-8
-b(,)26 b(the)e(k)m(eyw)m(ord)h(unit)0 2987 y(strings)k(in)g(an)i
-(existing)e(k)m(eyw)m(ord.)0 3287 y Fb(5.12.4)113 b(HIERAR)m(CH)34
-b(Con)m(v)m(en)m(tion)j(for)g(Extended)h(Keyw)m(ord)f(Names)0
-3508 y Fi(CFITSIO)k(supp)s(orts)g(the)i(HIERAR)m(CH)g(k)m(eyw)m(ord)g
-(con)m(v)m(en)m(tion)h(whic)m(h)e(allo)m(ws)g(k)m(eyw)m(ord)h(names)g
-(that)h(are)0 3621 y(longer)33 b(then)f(8)i(c)m(haracters)g(and)f(ma)m
-(y)h(con)m(tain)f(the)g(full)e(range)i(of)h(prin)m(table)d(ASCI)s(I)g
-(text)j(c)m(haracters.)51 b(This)0 3734 y(con)m(v)m(en)m(tion)38
-b(w)m(as)g(dev)m(elop)s(ed)e(at)i(the)f(Europ)s(ean)f(Southern)g
-(Observ)-5 b(atory)37 b(\(ESO\))f(to)i(supp)s(ort)d(hierarc)m(hical)0
-3847 y(FITS)30 b(k)m(eyw)m(ord)g(suc)m(h)h(as:)0 4115
-y Fe(HIERARCH)46 b(ESO)g(INS)h(FOCU)g(POS)g(=)g(-0.00002500)e(/)j
-(Focus)e(position)0 4383 y Fi(Basically)-8 b(,)52 b(this)46
-b(con)m(v)m(en)m(tion)j(uses)e(the)h(FITS)f(k)m(eyw)m(ord)h('HIERAR)m
-(CH')h(to)f(indicate)f(that)h(this)e(con)m(v)m(en-)0
-4495 y(tion)e(is)f(b)s(eing)g(used,)k(then)d(the)g(actual)h(k)m(eyw)m
-(ord)f(name)h(\()p Fe('ESO)i(INS)f(FOCU)h(POS')c Fi(in)g(this)g
-(example\))h(b)s(e-)0 4608 y(gins)39 b(in)f(column)g(10)j(and)e(can)h
-(con)m(tain)f(an)m(y)h(prin)m(table)e(ASCI)s(I)g(text)j(c)m(haracters,)
-i(including)37 b(spaces.)68 b(The)0 4721 y(equals)43
-b(sign)h(marks)f(the)h(end)g(of)g(the)g(k)m(eyw)m(ord)h(name)f(and)f
-(is)h(follo)m(w)m(ed)f(b)m(y)h(the)g(usual)f(v)-5 b(alue)44
-b(and)f(com-)0 4834 y(men)m(t)31 b(\014elds)e(just)h(as)h(in)e
-(standard)h(FITS)g(k)m(eyw)m(ords.)41 b(F)-8 b(urther)30
-b(details)g(of)h(this)e(con)m(v)m(en)m(tion)j(are)f(describ)s(ed)d(at)0
-4947 y(h)m(ttp://arcdev.hq.eso.org/dicb/dicd/dic-1-1.4.h)m(tml)33
-b(\(searc)m(h)f(for)e(HIERAR)m(CH\).)0 5107 y(This)42
+b(do)s(es)h(not)h(curren)m(tly)e(supp)s(ort)g(this)g(prop)s(osal.)0
+1181 y Fb(6.12.3)113 b(Keyw)m(ord)37 b(Units)g(Strings)0
+1400 y Fi(One)g(de\014ciency)g(of)h(the)g(curren)m(t)g(FITS)f(Standard)
+f(is)h(that)i(it)e(do)s(es)g(not)h(de\014ne)f(a)i(sp)s(eci\014c)d(con)m
+(v)m(en)m(tion)j(for)0 1513 y(recording)29 b(the)h(ph)m(ysical)f(units)
+g(of)h(a)g(k)m(eyw)m(ord)h(v)-5 b(alue.)40 b(The)30 b(TUNITn)f(k)m(eyw)
+m(ord)h(can)g(b)s(e)g(used)f(to)i(sp)s(ecify)e(the)0
+1626 y(ph)m(ysical)34 b(units)g(of)h(the)h(v)-5 b(alues)35
+b(in)f(a)h(table)h(column,)f(but)g(there)g(is)g(no)g(analogous)h(con)m
+(v)m(en)m(tion)g(for)f(k)m(eyw)m(ord)0 1739 y(v)-5 b(alues.)41
+b(The)30 b(commen)m(t)h(\014eld)f(of)g(the)h(k)m(eyw)m(ord)g(is)f
+(often)h(used)f(for)g(this)f(purp)s(ose,)h(but)f(the)i(units)e(are)i
+(usually)0 1852 y(not)g(sp)s(eci\014ed)d(in)h(a)i(w)m(ell)e(de\014ned)h
+(format)g(that)h(FITS)f(readers)g(can)h(easily)e(recognize)i(and)f
+(extract.)0 2012 y(T)-8 b(o)28 b(solv)m(e)g(this)e(de\014ciency)-8
+b(,)29 b(FITSIO)d(uses)h(a)h(lo)s(cal)f(con)m(v)m(en)m(tion)i(in)d
+(whic)m(h)g(the)i(k)m(eyw)m(ord)g(units)e(are)i(enclosed)f(in)0
+2125 y(square)20 b(brac)m(k)m(ets)j(as)e(the)f(\014rst)g(tok)m(en)i(in)
+e(the)g(k)m(eyw)m(ord)i(commen)m(t)f(\014eld;)i(more)e(sp)s
+(eci\014cally)-8 b(,)21 b(the)g(op)s(ening)e(square)0
+2238 y(brac)m(k)m(et)28 b(immediately)d(follo)m(ws)g(the)i(slash)e('/')
+i(commen)m(t)h(\014eld)d(delimiter)f(and)i(a)g(single)f(space)i(c)m
+(haracter.)41 b(The)0 2351 y(follo)m(wing)29 b(examples)h(illustrate)e
+(k)m(eyw)m(ords)j(that)g(use)f(this)f(con)m(v)m(en)m(tion:)0
+2590 y Fe(EXPOSURE=)713 b(1800.0)47 b(/)g([s])g(elapsed)f(exposure)f
+(time)0 2703 y(V_HELIO)h(=)763 b(16.23)47 b(/)g([km)g(s**\(-1\)])e
+(heliocentric)g(velocity)0 2816 y(LAMBDA)94 b(=)763 b(5400.)47
+b(/)g([angstrom])e(central)h(wavelength)0 2928 y(FLUX)190
+b(=)47 b(4.9033487787637465E-30)42 b(/)47 b([J/cm**2/s])e(average)h
+(flux)0 3167 y Fi(In)28 b(general,)g(the)h(units)d(named)i(in)f(the)i
+(IA)m(U\(1988\))i(St)m(yle)d(Guide)f(are)i(recommended,)f(with)f(the)i
+(main)e(excep-)0 3280 y(tion)j(that)h(the)f(preferred)g(unit)e(for)j
+(angle)f(is)f('deg')j(for)e(degrees.)0 3440 y(The)24
+b(FTPUNT)g(and)g(FTGUNT)h(subroutines)e(in)g(FITSIO)g(write)h(and)g
+(read,)i(resp)s(ectiv)m(ely)-8 b(,)26 b(the)e(k)m(eyw)m(ord)h(unit)0
+3553 y(strings)k(in)g(an)i(existing)e(k)m(eyw)m(ord.)0
+3841 y Fb(6.12.4)113 b(HIERAR)m(CH)34 b(Con)m(v)m(en)m(tion)j(for)g
+(Extended)h(Keyw)m(ord)f(Names)0 4060 y Fi(CFITSIO)k(supp)s(orts)g(the)
+i(HIERAR)m(CH)g(k)m(eyw)m(ord)g(con)m(v)m(en)m(tion)h(whic)m(h)e(allo)m
+(ws)g(k)m(eyw)m(ord)h(names)g(that)h(are)0 4173 y(longer)33
+b(then)f(8)i(c)m(haracters)g(and)f(ma)m(y)h(con)m(tain)f(the)g(full)e
+(range)i(of)h(prin)m(table)d(ASCI)s(I)g(text)j(c)m(haracters.)51
+b(This)0 4285 y(con)m(v)m(en)m(tion)38 b(w)m(as)g(dev)m(elop)s(ed)e(at)
+i(the)f(Europ)s(ean)f(Southern)g(Observ)-5 b(atory)37
+b(\(ESO\))f(to)i(supp)s(ort)d(hierarc)m(hical)0 4398
+y(FITS)30 b(k)m(eyw)m(ord)g(suc)m(h)h(as:)0 4637 y Fe(HIERARCH)46
+b(ESO)g(INS)h(FOCU)g(POS)g(=)g(-0.00002500)e(/)j(Focus)e(position)0
+4876 y Fi(Basically)-8 b(,)52 b(this)46 b(con)m(v)m(en)m(tion)j(uses)e
+(the)h(FITS)f(k)m(eyw)m(ord)h('HIERAR)m(CH')h(to)f(indicate)f(that)h
+(this)e(con)m(v)m(en-)0 4989 y(tion)e(is)f(b)s(eing)g(used,)k(then)d
+(the)g(actual)h(k)m(eyw)m(ord)f(name)h(\()p Fe('ESO)i(INS)f(FOCU)h
+(POS')c Fi(in)g(this)g(example\))h(b)s(e-)0 5102 y(gins)39
+b(in)f(column)g(10)j(and)e(can)h(con)m(tain)f(an)m(y)h(prin)m(table)e
+(ASCI)s(I)g(text)j(c)m(haracters,)i(including)37 b(spaces.)68
+b(The)0 5215 y(equals)43 b(sign)h(marks)f(the)h(end)g(of)g(the)g(k)m
+(eyw)m(ord)h(name)f(and)f(is)h(follo)m(w)m(ed)f(b)m(y)h(the)g(usual)f
+(v)-5 b(alue)44 b(and)f(com-)0 5328 y(men)m(t)31 b(\014elds)e(just)h
+(as)h(in)e(standard)h(FITS)g(k)m(eyw)m(ords.)41 b(F)-8
+b(urther)30 b(details)g(of)h(this)e(con)m(v)m(en)m(tion)j(are)f
+(describ)s(ed)d(at)0 5441 y(h)m
+(ttp://arcdev.hq.eso.org/dicb/dicd/dic-1-1.4.h)m(tml)33
+b(\(searc)m(h)f(for)e(HIERAR)m(CH\).)0 5601 y(This)42
 b(con)m(v)m(en)m(tion)k(allo)m(ws)e(a)g(m)m(uc)m(h)h(broader)e(range)i
 (of)f(k)m(eyw)m(ord)h(names)f(than)h(is)e(allo)m(w)m(ed)h(b)m(y)g(the)h
-(FITS)0 5220 y(Standard.)40 b(Here)30 b(are)h(more)g(examples)f(of)g
-(suc)m(h)g(k)m(eyw)m(ords:)0 5488 y Fe(HIERARCH)46 b(LongKeyword)e(=)k
-(47.5)e(/)i(Keyword)e(has)h(>)g(8)g(characters,)e(and)i(mixed)f(case)0
-5601 y(HIERARCH)g(XTE$TEMP)f(=)j(98.6)e(/)i(Keyword)d(contains)h(the)h
-('$')g(character)0 5714 y(HIERARCH)f(Earth)g(is)h(a)h(star)e(=)i(F)f(/)
-h(Keyword)d(contains)h(embedded)f(spaces)p eop
-%%Page: 48 54
-48 53 bop 0 299 a Fi(48)1277 b Fg(CHAPTER)29 b(5.)72
+(FITS)0 5714 y(Standard.)40 b(Here)30 b(are)h(more)g(examples)f(of)g
+(suc)m(h)g(k)m(eyw)m(ords:)p eop
+%%Page: 56 62
+56 61 bop 0 299 a Fi(56)1277 b Fg(CHAPTER)29 b(6.)72
 b(FITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fi(CFITSIO)40 b(will)f(transparen)m(tly)i(read)h(and)f(write)f(these)j
-(k)m(eyw)m(ords,)i(so)d(application)e(programs)h(do)g(not)h(in)0
-668 y(general)32 b(need)g(to)h(kno)m(w)f(an)m(ything)g(ab)s(out)g(the)g
-(sp)s(eci\014c)f(implemen)m(tation)g(details)g(of)i(the)f(HIERAR)m(CH)g
-(con-)0 781 y(v)m(en)m(tion.)49 b(In)32 b(particular,)h(application)e
+Fe(HIERARCH)46 b(LongKeyword)e(=)k(47.5)e(/)i(Keyword)e(has)h(>)g(8)g
+(characters,)e(and)i(mixed)f(case)0 668 y(HIERARCH)g(XTE$TEMP)f(=)j
+(98.6)e(/)i(Keyword)d(contains)h(the)h('$')g(character)0
+781 y(HIERARCH)f(Earth)g(is)h(a)h(star)e(=)i(F)f(/)h(Keyword)d
+(contains)h(embedded)f(spaces)0 1029 y Fi(CFITSIO)40
+b(will)f(transparen)m(tly)i(read)h(and)f(write)f(these)j(k)m(eyw)m
+(ords,)i(so)d(application)e(programs)h(do)g(not)h(in)0
+1142 y(general)32 b(need)g(to)h(kno)m(w)f(an)m(ything)g(ab)s(out)g(the)
+g(sp)s(eci\014c)f(implemen)m(tation)g(details)g(of)i(the)f(HIERAR)m(CH)
+g(con-)0 1255 y(v)m(en)m(tion.)49 b(In)32 b(particular,)h(application)e
 (programs)h(do)h(not)h(need)e(to)i(sp)s(ecify)e(the)h(`HIERAR)m(CH')h
-(part)f(of)g(the)0 894 y(k)m(eyw)m(ord)g(name)f(when)g(reading)f(or)h
+(part)f(of)g(the)0 1368 y(k)m(eyw)m(ord)g(name)f(when)g(reading)f(or)h
 (writing)f(k)m(eyw)m(ords)h(\(although)g(it)g(ma)m(y)h(b)s(e)f
-(included)d(if)j(desired\).)45 b(When)0 1007 y(writing)33
+(included)d(if)j(desired\).)45 b(When)0 1481 y(writing)33
 b(a)i(k)m(eyw)m(ord,)h(CFITSIO)d(\014rst)h(c)m(hec)m(ks)i(to)f(see)g
 (if)f(the)h(k)m(eyw)m(ord)g(name)f(is)g(legal)g(as)h(a)g(standard)f
-(FITS)0 1120 y(k)m(eyw)m(ord)k(\(no)g(more)f(than)h(8)g(c)m(haracters)h
+(FITS)0 1594 y(k)m(eyw)m(ord)k(\(no)g(more)f(than)h(8)g(c)m(haracters)h
 (long)e(and)g(con)m(taining)g(only)f(letters,)k(digits,)e(or)g(a)g(min)
-m(us)d(sign)i(or)0 1233 y(underscore\).)68 b(If)39 b(so)h(it)f(writes)g
+m(us)d(sign)i(or)0 1707 y(underscore\).)68 b(If)39 b(so)h(it)f(writes)g
 (it)g(as)g(a)h(standard)f(FITS)g(k)m(eyw)m(ord,)k(otherwise)c(it)g
-(uses)g(the)h(hierarc)m(h)e(con-)0 1346 y(v)m(en)m(tion)33
+(uses)g(the)h(hierarc)m(h)e(con-)0 1820 y(v)m(en)m(tion)33
 b(to)g(write)f(the)g(k)m(eyw)m(ord.)48 b(The)32 b(maxim)m(um)f(k)m(eyw)
 m(ord)i(name)f(length)g(is)g(67)h(c)m(haracters,)i(whic)m(h)c(lea)m(v)m
-(es)0 1458 y(only)c(1)i(space)g(for)f(the)h(v)-5 b(alue)28
+(es)0 1933 y(only)c(1)i(space)g(for)f(the)h(v)-5 b(alue)28
 b(\014eld.)38 b(A)29 b(more)f(practical)g(limit)e(is)i(ab)s(out)g(40)h
 (c)m(haracters,)i(whic)m(h)c(lea)m(v)m(es)i(enough)0
-1571 y(ro)s(om)f(for)h(most)f(k)m(eyw)m(ord)h(v)-5 b(alues.)40
+2046 y(ro)s(om)f(for)h(most)f(k)m(eyw)m(ord)h(v)-5 b(alues.)40
 b(CFITSIO)27 b(returns)g(an)h(error)h(if)e(there)i(is)e(not)i(enough)f
-(ro)s(om)h(for)f(b)s(oth)g(the)0 1684 y(k)m(eyw)m(ord)k(name)f(and)f
+(ro)s(om)h(for)f(b)s(oth)g(the)0 2158 y(k)m(eyw)m(ord)k(name)f(and)f
 (the)i(k)m(eyw)m(ord)f(v)-5 b(alue)31 b(on)g(the)h(80-c)m(haracter)h
 (card,)f(except)g(for)f(string-v)-5 b(alued)30 b(k)m(eyw)m(ords)0
-1797 y(whic)m(h)i(are)h(simply)d(truncated)j(so)g(that)h(the)f(closing)
+2271 y(whic)m(h)i(are)h(simply)d(truncated)j(so)g(that)h(the)f(closing)
 f(quote)i(c)m(haracter)g(falls)d(in)h(column)g(80.)49
-b(In)32 b(the)h(curren)m(t)0 1910 y(implemen)m(tation,)28
+b(In)32 b(the)h(curren)m(t)0 2384 y(implemen)m(tation,)28
 b(CFITSIO)f(preserv)m(es)i(the)g(case)h(of)f(the)g(letters)g(when)f
-(writing)f(the)i(k)m(eyw)m(ord)g(name,)g(but)f(it)0 2023
+(writing)f(the)i(k)m(eyw)m(ord)g(name,)g(but)f(it)0 2497
 y(is)c(case-insensitiv)m(e)g(when)g(reading)g(or)h(searc)m(hing)g(for)g
 (a)g(k)m(eyw)m(ord.)40 b(The)24 b(curren)m(t)h(implemen)m(tation)e
-(allo)m(ws)i(an)m(y)0 2136 y(ASCI)s(I)k(text)j(c)m(haracter)h(\(ASCI)s
+(allo)m(ws)i(an)m(y)0 2610 y(ASCI)s(I)k(text)j(c)m(haracter)h(\(ASCI)s
 (I)c(32)j(to)f(ASCI)s(I)f(126\))i(in)e(the)h(k)m(eyw)m(ord)g(name)g
-(except)h(for)e(the)h('=')g(c)m(haracter.)0 2249 y(A)f(space)h(is)f
+(except)h(for)e(the)h('=')g(c)m(haracter.)0 2723 y(A)f(space)h(is)f
 (also)g(required)f(on)h(either)g(side)f(of)i(the)f(equal)g(sign.)0
-2590 y Fd(5.13)136 b(Optimizing)45 b(Co)t(de)g(for)h(Maxim)l(um)f(Pro)t
-(cessing)g(Sp)t(eed)0 2842 y Fi(CFITSIO)22 b(has)h(b)s(een)f(carefully)
+3055 y Fd(6.13)136 b(Optimizing)45 b(Co)t(de)g(for)h(Maxim)l(um)f(Pro)t
+(cessing)g(Sp)t(eed)0 3305 y Fi(CFITSIO)22 b(has)h(b)s(een)f(carefully)
 g(designed)g(to)i(obtain)f(the)g(highest)g(p)s(ossible)d(sp)s(eed)j
-(when)f(reading)g(and)h(writing)0 2955 y(FITS)33 b(\014les.)50
+(when)f(reading)g(and)h(writing)0 3418 y(FITS)33 b(\014les.)50
 b(In)33 b(order)h(to)g(ac)m(hiev)m(e)h(the)f(b)s(est)g(p)s(erformance,)
 g(ho)m(w)m(ev)m(er,)i(application)d(programmers)g(m)m(ust)h(b)s(e)0
-3068 y(careful)23 b(to)i(call)e(the)h(CFITSIO)f(routines)f
+3531 y(careful)23 b(to)i(call)e(the)h(CFITSIO)f(routines)f
 (appropriately)h(and)g(in)g(an)g(e\016cien)m(t)i(sequence;)i
-(inappropriate)21 b(usage)0 3181 y(of)31 b(CFITSIO)d(routines)i(can)g
+(inappropriate)21 b(usage)0 3644 y(of)31 b(CFITSIO)d(routines)i(can)g
 (greatly)h(slo)m(w)f(do)m(wn)g(the)h(execution)f(sp)s(eed)g(of)g(a)h
-(program.)0 3341 y(The)f(maxim)m(um)g(p)s(ossible)e(I/O)j(sp)s(eed)f
+(program.)0 3804 y(The)f(maxim)m(um)g(p)s(ossible)e(I/O)j(sp)s(eed)f
 (of)h(CFITSIO)e(dep)s(ends)g(of)i(course)g(on)f(the)h(t)m(yp)s(e)g(of)g
-(computer)g(system)0 3454 y(that)g(it)e(is)g(running)e(on.)41
+(computer)g(system)0 3917 y(that)g(it)e(is)g(running)e(on.)41
 b(As)30 b(a)g(rough)g(guide,)f(the)h(curren)m(t)g(generation)g(of)g(w)m
-(orkstations)g(can)h(ac)m(hiev)m(e)g(sp)s(eeds)0 3567
+(orkstations)g(can)h(ac)m(hiev)m(e)g(sp)s(eeds)0 4030
 y(of)k(2)g({)g(10)g(MB/s)h(when)e(reading)g(or)g(writing)f(FITS)h
 (images)h(and)f(similar,)f(or)i(sligh)m(tly)e(slo)m(w)m(er)i(sp)s(eeds)
-e(with)0 3680 y(FITS)c(binary)g(tables.)40 b(Reading)30
+e(with)0 4143 y(FITS)c(binary)g(tables.)40 b(Reading)30
 b(of)g(FITS)g(\014les)f(can)i(o)s(ccur)f(at)h(ev)m(en)f(higher)f(rates)
-i(\(30MB/s)i(or)d(more\))h(if)e(the)0 3793 y(FITS)d(\014le)g(is)f
+i(\(30MB/s)i(or)d(more\))h(if)e(the)0 4256 y(FITS)d(\014le)g(is)f
 (still)g(cac)m(hed)j(in)d(system)i(memory)f(follo)m(wing)g(a)h
 (previous)e(read)h(or)h(write)f(op)s(eration)g(on)h(the)g(same)0
-3906 y(\014le.)43 b(T)-8 b(o)32 b(more)g(accurately)g(predict)e(the)i
+4369 y(\014le.)43 b(T)-8 b(o)32 b(more)g(accurately)g(predict)e(the)i
 (b)s(est)f(p)s(erformance)g(that)h(is)e(p)s(ossible)f(on)j(an)m(y)g
-(particular)d(system,)k(a)0 4019 y(diagnostic)f(program)h(called)f
+(particular)d(system,)k(a)0 4481 y(diagnostic)f(program)h(called)f
 (\\sp)s(eed.c")h(is)f(included)e(with)i(the)h(CFITSIO)e(distribution)e
-(whic)m(h)j(can)h(b)s(e)f(run)0 4131 y(to)f(appro)m(ximately)f(measure)
+(whic)m(h)j(can)h(b)s(e)f(run)0 4594 y(to)f(appro)m(ximately)f(measure)
 g(the)h(maxim)m(um)e(p)s(ossible)f(sp)s(eed)h(of)i(writing)d(and)i
-(reading)g(a)g(test)i(FITS)d(\014le.)0 4292 y(The)k(follo)m(wing)e(2)j
+(reading)g(a)g(test)i(FITS)d(\014le.)0 4754 y(The)k(follo)m(wing)e(2)j
 (sections)f(pro)m(vide)g(some)g(bac)m(kground)g(on)h(ho)m(w)f(CFITSIO)f
-(in)m(ternally)f(manages)j(the)f(data)0 4404 y(I/O)g(and)g(describ)s
+(in)m(ternally)f(manages)j(the)f(data)0 4867 y(I/O)g(and)g(describ)s
 (es)e(some)j(strategies)g(that)g(ma)m(y)g(b)s(e)e(used)h(to)h(optimize)
 e(the)i(pro)s(cessing)e(sp)s(eed)g(of)h(soft)m(w)m(are)0
-4517 y(that)e(uses)f(CFITSIO.)0 4816 y Fb(5.13.1)113
+4980 y(that)e(uses)f(CFITSIO.)0 5269 y Fb(6.13.1)113
 b(Bac)m(kground)38 b(Information:)48 b(Ho)m(w)37 b(CFITSIO)h(Manages)h
-(Data)f(I/O)0 5036 y Fi(Man)m(y)22 b(CFITSIO)e(op)s(erations)h(in)m(v)m
+(Data)f(I/O)0 5488 y Fi(Man)m(y)22 b(CFITSIO)e(op)s(erations)h(in)m(v)m
 (olv)m(e)h(transferring)e(only)h(a)h(small)e(n)m(um)m(b)s(er)h(of)h(b)m
-(ytes)g(to)g(or)g(from)f(the)h(FITS)f(\014le)0 5149 y(\(e.g,)31
+(ytes)g(to)g(or)g(from)f(the)h(FITS)f(\014le)0 5601 y(\(e.g,)31
 b(reading)d(a)h(k)m(eyw)m(ord,)h(or)f(writing)e(a)i(ro)m(w)g(in)e(a)i
 (table\);)h(it)f(w)m(ould)e(b)s(e)h(v)m(ery)i(ine\016cien)m(t)e(to)h
-(ph)m(ysically)e(read)0 5262 y(or)32 b(write)g(suc)m(h)g(small)e(blo)s
+(ph)m(ysically)e(read)0 5714 y(or)32 b(write)g(suc)m(h)g(small)e(blo)s
 (c)m(ks)i(of)g(data)h(directly)e(in)g(the)h(FITS)g(\014le)f(on)h(disk,)
-g(therefore)g(CFITSIO)f(main)m(tains)0 5375 y(a)38 b(set)g(of)g(in)m
-(ternal)f(Input{Output)e(\(IO\))j(bu\013ers)f(in)f(RAM)i(memory)g(that)
-g(eac)m(h)h(con)m(tain)f(one)g(FITS)f(blo)s(c)m(k)0 5488
-y(\(2880)27 b(b)m(ytes\))f(of)f(data.)40 b(Whenev)m(er)25
+g(therefore)g(CFITSIO)f(main)m(tains)p eop
+%%Page: 57 63
+57 62 bop 0 299 a Fg(6.13.)73 b(OPTIMIZING)29 b(CODE)h(F)m(OR)h
+(MAXIMUM)g(PR)m(OCESSING)f(SPEED)971 b Fi(57)0 555 y(a)38
+b(set)g(of)g(in)m(ternal)f(Input{Output)e(\(IO\))j(bu\013ers)f(in)f
+(RAM)i(memory)g(that)g(eac)m(h)h(con)m(tain)f(one)g(FITS)f(blo)s(c)m(k)
+0 668 y(\(2880)27 b(b)m(ytes\))f(of)f(data.)40 b(Whenev)m(er)25
 b(CFITSIO)f(needs)g(to)i(access)g(data)g(in)e(the)h(FITS)f(\014le,)i
-(it)e(\014rst)g(transfers)h(the)0 5601 y(FITS)30 b(blo)s(c)m(k)g(con)m
+(it)e(\014rst)g(transfers)h(the)0 781 y(FITS)30 b(blo)s(c)m(k)g(con)m
 (taining)g(those)h(b)m(ytes)g(in)m(to)f(one)h(of)f(the)h(IO)f
 (bu\013ers)f(in)g(memory)-8 b(.)42 b(The)30 b(next)g(time)g(CFITSIO)0
-5714 y(needs)36 b(to)g(access)i(b)m(ytes)e(in)f(the)h(same)h(blo)s(c)m
+894 y(needs)36 b(to)g(access)i(b)m(ytes)e(in)f(the)h(same)h(blo)s(c)m
 (k)e(it)h(can)g(then)g(go)h(to)f(the)h(fast)f(IO)f(bu\013er)g(rather)h
-(than)g(using)f(a)p eop
-%%Page: 49 55
-49 54 bop 0 299 a Fg(5.13.)73 b(OPTIMIZING)29 b(CODE)h(F)m(OR)h
-(MAXIMUM)g(PR)m(OCESSING)f(SPEED)971 b Fi(49)0 555 y(m)m(uc)m(h)32
-b(slo)m(w)m(er)h(system)f(disk)f(access)i(routine.)45
-b(The)32 b(n)m(um)m(b)s(er)f(of)h(a)m(v)-5 b(ailable)32
-b(IO)g(bu\013ers)f(is)g(determined)g(b)m(y)h(the)0 668
-y(NIOBUF)f(parameter)g(\(in)e(\014tsio2.h\))h(and)g(is)g(curren)m(tly)f
-(set)i(to)g(25.)0 828 y(Whenev)m(er)24 b(CFITSIO)f(reads)g(or)h(writes)
-f(data)h(it)g(\014rst)f(c)m(hec)m(ks)i(to)g(see)f(if)f(that)h(blo)s(c)m
-(k)g(of)g(the)g(FITS)f(\014le)f(is)h(already)0 941 y(loaded)32
-b(in)m(to)g(one)g(of)g(the)g(IO)g(bu\013ers.)44 b(If)32
-b(not,)h(and)e(if)g(there)h(is)f(an)h(empt)m(y)h(IO)e(bu\013er)g(a)m(v)
--5 b(ailable,)32 b(then)g(it)g(will)0 1054 y(load)g(that)i(blo)s(c)m(k)
-e(in)m(to)g(the)h(IO)g(bu\013er)e(\(when)h(reading)g(a)h(FITS)f
+(than)g(using)f(a)0 1007 y(m)m(uc)m(h)d(slo)m(w)m(er)h(system)f(disk)f
+(access)i(routine.)45 b(The)32 b(n)m(um)m(b)s(er)f(of)h(a)m(v)-5
+b(ailable)32 b(IO)g(bu\013ers)f(is)g(determined)g(b)m(y)h(the)0
+1120 y(NIOBUF)f(parameter)g(\(in)e(\014tsio2.h\))h(and)g(is)g(curren)m
+(tly)f(set)i(to)g(40.)0 1280 y(Whenev)m(er)24 b(CFITSIO)f(reads)g(or)h
+(writes)f(data)h(it)g(\014rst)f(c)m(hec)m(ks)i(to)g(see)f(if)f(that)h
+(blo)s(c)m(k)g(of)g(the)g(FITS)f(\014le)f(is)h(already)0
+1393 y(loaded)32 b(in)m(to)g(one)g(of)g(the)g(IO)g(bu\013ers.)44
+b(If)32 b(not,)h(and)e(if)g(there)h(is)f(an)h(empt)m(y)h(IO)e(bu\013er)
+g(a)m(v)-5 b(ailable,)32 b(then)g(it)g(will)0 1506 y(load)g(that)i(blo)
+s(c)m(k)e(in)m(to)g(the)h(IO)g(bu\013er)e(\(when)h(reading)g(a)h(FITS)f
 (\014le\))g(or)h(will)d(initialize)g(a)j(new)f(blo)s(c)m(k)h(\(when)0
-1167 y(writing)i(to)j(a)g(FITS)f(\014le\).)61 b(If)37
+1619 y(writing)i(to)j(a)g(FITS)f(\014le\).)61 b(If)37
 b(all)f(the)i(IO)e(bu\013ers)h(are)g(already)g(full,)g(it)g(m)m(ust)h
-(decide)e(whic)m(h)g(one)i(to)g(reuse)0 1280 y(\(generally)32
+(decide)e(whic)m(h)g(one)i(to)g(reuse)0 1732 y(\(generally)32
 b(the)h(one)g(that)g(has)f(b)s(een)g(accessed)i(least)e(recen)m(tly\),)
 i(and)e(\015ush)f(the)i(con)m(ten)m(ts)h(bac)m(k)g(to)f(disk)e(if)g(it)
-0 1393 y(has)f(b)s(een)g(mo)s(di\014ed)e(b)s(efore)i(loading)f(the)i
-(new)f(blo)s(c)m(k.)0 1553 y(The)g(one)g(ma)5 b(jor)30
+0 1844 y(has)f(b)s(een)g(mo)s(di\014ed)e(b)s(efore)i(loading)f(the)i
+(new)f(blo)s(c)m(k.)0 2005 y(The)g(one)g(ma)5 b(jor)30
 b(exception)h(to)g(the)f(ab)s(o)m(v)m(e)h(pro)s(cess)f(o)s(ccurs)g
 (whenev)m(er)g(a)g(large)h(con)m(tiguous)f(set)h(of)f(b)m(ytes)h(are)0
-1666 y(accessed,)37 b(as)d(migh)m(t)h(o)s(ccur)f(when)f(reading)h(or)g
+2118 y(accessed,)37 b(as)d(migh)m(t)h(o)s(ccur)f(when)f(reading)h(or)g
 (writing)e(a)j(FITS)f(image.)53 b(In)34 b(this)f(case)i(CFITSIO)e(b)m
-(ypasses)0 1779 y(the)i(in)m(ternal)f(IO)h(bu\013ers)f(and)g(simply)f
+(ypasses)0 2230 y(the)i(in)m(ternal)f(IO)h(bu\013ers)f(and)g(simply)f
 (reads)i(or)g(writes)g(the)g(desired)f(b)m(ytes)h(directly)f(in)g(the)h
-(disk)f(\014le)g(with)0 1892 y(a)j(single)e(call)g(to)i(a)g(lo)m(w-lev)
+(disk)f(\014le)g(with)0 2343 y(a)j(single)e(call)g(to)i(a)g(lo)m(w-lev)
 m(el)f(\014le)f(read)h(or)h(write)e(routine.)57 b(The)36
 b(minim)m(um)e(threshold)g(for)i(the)h(n)m(um)m(b)s(er)e(of)0
-2005 y(b)m(ytes)40 b(to)g(read)f(or)g(write)f(this)h(w)m(a)m(y)h(is)e
+2456 y(b)m(ytes)40 b(to)g(read)f(or)g(write)f(this)h(w)m(a)m(y)h(is)e
 (set)i(b)m(y)f(the)g(MINDIRECT)g(parameter)h(and)e(is)h(curren)m(tly)f
-(set)i(to)g(3)0 2118 y(FITS)28 b(blo)s(c)m(ks)f(=)h(8640)i(b)m(ytes.)41
+(set)i(to)g(3)0 2569 y(FITS)28 b(blo)s(c)m(ks)f(=)h(8640)i(b)m(ytes.)41
 b(This)27 b(is)g(the)h(most)h(e\016cien)m(t)g(w)m(a)m(y)g(to)g(read)g
 (or)f(write)g(large)g(c)m(h)m(unks)g(of)g(data)i(and)0
-2230 y(can)37 b(ac)m(hiev)m(e)h(IO)e(transfer)g(rates)h(of)g(5)g({)g
+2682 y(can)37 b(ac)m(hiev)m(e)h(IO)e(transfer)g(rates)h(of)g(5)g({)g
 (10MB/s)i(or)d(greater.)61 b(Note)38 b(that)f(this)f(fast)h(direct)f
-(IO)g(pro)s(cess)g(is)0 2343 y(not)29 b(applicable)d(when)h(accessing)i
+(IO)g(pro)s(cess)g(is)0 2795 y(not)29 b(applicable)d(when)h(accessing)i
 (columns)f(of)g(data)h(in)e(a)i(FITS)f(table)g(b)s(ecause)h(the)f(b)m
-(ytes)h(are)g(generally)f(not)0 2456 y(con)m(tiguous)h(since)f(they)h
+(ytes)h(are)g(generally)f(not)0 2908 y(con)m(tiguous)h(since)f(they)h
 (are)h(in)m(terlea)m(v)m(ed)f(b)m(y)g(the)g(other)g(columns)f(of)h
 (data)g(in)f(the)h(table.)40 b(This)27 b(explains)g(wh)m(y)0
-2569 y(the)k(sp)s(eed)e(for)h(accessing)h(FITS)f(tables)g(is)f
+3021 y(the)k(sp)s(eed)e(for)h(accessing)h(FITS)f(tables)g(is)f
 (generally)h(slo)m(w)m(er)g(than)h(accessing)f(FITS)g(images.)0
-2729 y(Giv)m(en)h(this)g(bac)m(kground)g(information,)f(the)i(general)f
+3181 y(Giv)m(en)h(this)g(bac)m(kground)g(information,)f(the)i(general)f
 (strategy)i(for)e(e\016cien)m(tly)g(accessing)h(FITS)f(\014les)f
-(should)0 2842 y(no)m(w)36 b(b)s(e)g(apparen)m(t:)52
+(should)0 3294 y(no)m(w)36 b(b)s(e)g(apparen)m(t:)52
 b(when)35 b(dealing)g(with)g(FITS)h(images,)i(read)e(or)g(write)f
-(large)i(c)m(h)m(unks)f(of)g(data)h(at)g(a)f(time)0 2955
+(large)i(c)m(h)m(unks)f(of)g(data)h(at)g(a)f(time)0 3407
 y(so)30 b(that)h(the)f(direct)g(IO)f(mec)m(hanism)g(will)f(b)s(e)h(in)m
 (v)m(ok)m(ed;)i(when)e(accessing)i(FITS)e(headers)h(or)g(FITS)f
-(tables,)h(on)0 3068 y(the)35 b(other)g(hand,)g(once)g(a)g(particular)f
+(tables,)h(on)0 3520 y(the)35 b(other)g(hand,)g(once)g(a)g(particular)f
 (FITS)g(blo)s(c)m(k)g(has)g(b)s(een)g(loading)g(in)m(to)h(one)g(of)g
-(the)f(IO)h(bu\013ers,)g(try)f(to)0 3181 y(access)39
+(the)f(IO)h(bu\013ers,)g(try)f(to)0 3633 y(access)39
 b(all)d(the)h(needed)g(information)f(in)g(that)i(blo)s(c)m(k)f(b)s
 (efore)g(it)g(gets)h(\015ushed)d(out)j(of)g(the)f(IO)g(bu\013er.)60
-b(It)38 b(is)0 3294 y(imp)s(ortan)m(t)30 b(to)i(a)m(v)m(oid)f(the)g
+b(It)38 b(is)0 3745 y(imp)s(ortan)m(t)30 b(to)i(a)m(v)m(oid)f(the)g
 (situation)f(where)h(the)g(same)g(FITS)f(blo)s(c)m(k)h(is)f(b)s(eing)f
-(read)i(then)g(\015ushed)e(from)h(a)h(IO)0 3407 y(bu\013er)e(m)m
-(ultiple)f(times.)0 3567 y(The)i(follo)m(wing)f(section)h(giv)m(es)h
+(read)i(then)g(\015ushed)e(from)h(a)h(IO)0 3858 y(bu\013er)e(m)m
+(ultiple)f(times.)0 4019 y(The)i(follo)m(wing)f(section)h(giv)m(es)h
 (more)f(sp)s(eci\014c)g(suggestions)g(for)g(optimizing)f(the)h(use)g
-(of)h(CFITSIO.)0 3727 y(1.)54 b(When)34 b(dealing)f(with)h(a)h(FITS)e
+(of)h(CFITSIO.)0 4179 y(1.)54 b(When)34 b(dealing)f(with)h(a)h(FITS)e
 (primary)g(arra)m(y)i(or)g(IMA)m(GE)g(extension,)h(it)e(is)f(more)i
-(e\016cien)m(t)g(to)g(read)g(or)0 3840 y(write)30 b(large)g(c)m(h)m
+(e\016cien)m(t)g(to)g(read)g(or)0 4292 y(write)30 b(large)g(c)m(h)m
 (unks)g(of)g(the)h(image)f(at)i(a)e(time)g(\(at)i(least)e(3)h(FITS)f
 (blo)s(c)m(ks)f(=)h(8640)i(b)m(ytes\))f(so)g(that)g(the)f(direct)0
-3953 y(IO)j(mec)m(hanism)g(will)d(b)s(e)j(used)g(as)g(describ)s(ed)f
+4405 y(IO)j(mec)m(hanism)g(will)d(b)s(e)j(used)g(as)g(describ)s(ed)f
 (in)g(the)h(previous)f(section.)50 b(Smaller)32 b(c)m(h)m(unks)h(of)g
-(data)h(are)g(read)0 4066 y(or)d(written)f(via)h(the)g(IO)f(bu\013ers,)
+(data)h(are)g(read)0 4517 y(or)d(written)f(via)h(the)g(IO)f(bu\013ers,)
 g(whic)m(h)g(is)g(somewhat)h(less)f(e\016cien)m(t)i(b)s(ecause)f(of)g
-(the)g(extra)h(cop)m(y)f(op)s(eration)0 4179 y(and)26
+(the)g(extra)h(cop)m(y)f(op)s(eration)0 4630 y(and)26
 b(additional)e(b)s(o)s(okk)m(eeping)i(steps)h(that)g(are)g(required.)38
 b(In)26 b(principle)d(it)j(is)g(more)g(e\016cien)m(t)h(to)h(read)e(or)h
-(write)0 4292 y(as)i(big)f(an)h(arra)m(y)h(of)f(image)g(pixels)e(at)j
+(write)0 4743 y(as)i(big)f(an)h(arra)m(y)h(of)f(image)g(pixels)e(at)j
 (one)f(time)f(as)i(p)s(ossible,)d(ho)m(w)m(ev)m(er,)j(if)e(the)i(arra)m
-(y)f(b)s(ecomes)g(so)g(large)g(that)0 4405 y(the)j(op)s(erating)f
+(y)f(b)s(ecomes)g(so)g(large)g(that)0 4856 y(the)j(op)s(erating)f
 (system)g(cannot)h(store)g(it)f(all)g(in)f(RAM,)i(then)f(the)h(p)s
 (erformance)f(ma)m(y)h(b)s(e)f(degraded)g(b)s(ecause)0
-4517 y(of)g(the)f(increased)g(sw)m(apping)f(of)h(virtual)f(memory)h(to)
-h(disk.)0 4678 y(2.)51 b(When)33 b(dealing)g(with)f(FITS)h(tables,)i
+4969 y(of)g(the)f(increased)g(sw)m(apping)f(of)h(virtual)f(memory)h(to)
+h(disk.)0 5129 y(2.)51 b(When)33 b(dealing)g(with)f(FITS)h(tables,)i
 (the)f(most)g(imp)s(ortan)m(t)f(e\016ciency)g(factor)i(in)d(the)i(soft)
-m(w)m(are)h(design)e(is)0 4791 y(to)k(read)f(or)g(write)f(the)h(data)h
+m(w)m(are)h(design)e(is)0 5242 y(to)k(read)f(or)g(write)f(the)h(data)h
 (in)e(the)h(FITS)g(\014le)f(in)g(a)h(single)f(pass)h(through)f(the)h
-(\014le.)57 b(An)36 b(example)g(of)g(p)s(o)s(or)0 4903
+(\014le.)57 b(An)36 b(example)g(of)g(p)s(o)s(or)0 5355
 y(program)g(design)g(w)m(ould)f(b)s(e)h(to)h(read)g(a)f(large,)j
 (3-column)d(table)g(b)m(y)h(sequen)m(tially)e(reading)h(the)g(en)m
-(tire)h(\014rst)0 5016 y(column,)24 b(then)g(going)g(bac)m(k)g(to)h
+(tire)h(\014rst)0 5468 y(column,)24 b(then)g(going)g(bac)m(k)g(to)h
 (read)e(the)h(2nd)g(column,)g(and)f(\014nally)f(the)i(3rd)f(column;)i
-(this)e(ob)m(viously)f(requires)0 5129 y(3)j(passes)f(through)f(the)i
+(this)e(ob)m(viously)f(requires)0 5581 y(3)j(passes)f(through)f(the)i
 (\014le)e(whic)m(h)g(could)h(triple)e(the)j(execution)f(time)g(of)h(an)
 f(I/O)g(limited)e(program.)38 b(F)-8 b(or)25 b(small)0
-5242 y(tables)30 b(this)f(is)h(not)g(imp)s(ortan)m(t,)g(but)g(when)f
+5694 y(tables)30 b(this)f(is)h(not)g(imp)s(ortan)m(t,)g(but)g(when)f
 (reading)g(m)m(ulti-megab)m(yte)i(sized)f(tables)g(these)h
-(ine\016ciencies)e(can)0 5355 y(b)s(ecome)g(signi\014can)m(t.)39
-b(The)28 b(more)h(e\016cien)m(t)g(pro)s(cedure)e(in)h(this)f(case)j(is)
-d(to)j(read)e(or)h(write)f(only)f(as)i(man)m(y)g(ro)m(ws)0
-5468 y(of)g(the)g(table)g(as)g(will)e(\014t)h(in)m(to)h(the)h(a)m(v)-5
-b(ailable)28 b(in)m(ternal)g(I/O)h(bu\013ers,)f(then)h(access)h(all)e
-(the)h(necessary)g(columns)0 5581 y(of)i(data)h(within)c(that)k(range)f
-(of)g(ro)m(ws.)43 b(Then)29 b(after)j(the)f(program)g(is)f(completely)g
-(\014nished)f(with)g(the)j(data)f(in)0 5694 y(those)i(ro)m(ws)e(it)h
-(can)g(mo)m(v)m(e)i(on)e(to)g(the)h(next)f(range)g(of)g(ro)m(ws)g(that)
-h(will)c(\014t)j(in)f(the)h(bu\013ers,)f(con)m(tin)m(uing)g(in)g(this)p
-eop
-%%Page: 50 56
-50 55 bop 0 299 a Fi(50)1277 b Fg(CHAPTER)29 b(5.)72
+(ine\016ciencies)e(can)p eop
+%%Page: 58 64
+58 63 bop 0 299 a Fi(58)1277 b Fg(CHAPTER)29 b(6.)72
 b(FITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)0 555 y
-Fi(w)m(a)m(y)d(un)m(til)d(the)h(en)m(tire)h(\014le)f(has)g(b)s(een)g
-(pro)s(cessed.)39 b(By)27 b(using)e(this)h(pro)s(cedure)f(of)i
-(accessing)g(all)f(the)g(columns)g(of)0 668 y(a)k(table)f(in)f
+Fi(b)s(ecome)e(signi\014can)m(t.)39 b(The)28 b(more)h(e\016cien)m(t)g
+(pro)s(cedure)e(in)h(this)f(case)j(is)d(to)j(read)e(or)h(write)f(only)f
+(as)i(man)m(y)g(ro)m(ws)0 668 y(of)g(the)g(table)g(as)g(will)e(\014t)h
+(in)m(to)h(the)h(a)m(v)-5 b(ailable)28 b(in)m(ternal)g(I/O)h
+(bu\013ers,)f(then)h(access)h(all)e(the)h(necessary)g(columns)0
+781 y(of)i(data)h(within)c(that)k(range)f(of)g(ro)m(ws.)43
+b(Then)29 b(after)j(the)f(program)g(is)f(completely)g(\014nished)f
+(with)g(the)j(data)f(in)0 894 y(those)i(ro)m(ws)e(it)h(can)g(mo)m(v)m
+(e)i(on)e(to)g(the)h(next)f(range)g(of)g(ro)m(ws)g(that)h(will)c(\014t)
+j(in)f(the)h(bu\013ers,)f(con)m(tin)m(uing)g(in)g(this)0
+1007 y(w)m(a)m(y)d(un)m(til)d(the)h(en)m(tire)h(\014le)f(has)g(b)s(een)
+g(pro)s(cessed.)39 b(By)27 b(using)e(this)h(pro)s(cedure)f(of)i
+(accessing)g(all)f(the)g(columns)g(of)0 1120 y(a)k(table)f(in)f
 (parallel)f(rather)i(than)g(sequen)m(tially)-8 b(,)29
 b(eac)m(h)h(blo)s(c)m(k)f(of)h(the)f(FITS)g(\014le)f(will)e(only)j(b)s
-(e)f(read)i(or)f(written)0 781 y(once.)0 941 y(The)g(optimal)f(n)m(um)m
-(b)s(er)g(of)i(ro)m(ws)f(to)i(read)e(or)g(write)g(at)h(one)g(time)f(in)
-f(a)i(giv)m(en)f(table)h(dep)s(ends)d(on)j(the)f(width)f(of)0
-1054 y(the)k(table)g(ro)m(w,)h(on)f(the)g(n)m(um)m(b)s(er)f(of)h(I/O)g
+(e)f(read)i(or)f(written)0 1233 y(once.)0 1393 y(The)g(optimal)f(n)m
+(um)m(b)s(er)g(of)i(ro)m(ws)f(to)i(read)e(or)g(write)g(at)h(one)g(time)
+f(in)f(a)i(giv)m(en)f(table)h(dep)s(ends)d(on)j(the)f(width)f(of)0
+1506 y(the)k(table)g(ro)m(w,)h(on)f(the)g(n)m(um)m(b)s(er)f(of)h(I/O)g
 (bu\013ers)f(that)i(ha)m(v)m(e)g(b)s(een)e(allo)s(cated)h(in)f(FITSIO,)
-g(and)h(also)g(on)g(the)0 1167 y(n)m(um)m(b)s(er)27 b(of)i(other)f
+g(and)h(also)g(on)g(the)0 1619 y(n)m(um)m(b)s(er)27 b(of)i(other)f
 (FITS)g(\014les)f(that)i(are)g(op)s(en)f(at)h(the)g(same)g(time)f
 (\(since)g(one)h(I/O)f(bu\013er)f(is)h(alw)m(a)m(ys)h(reserv)m(ed)0
-1280 y(for)34 b(eac)m(h)h(op)s(en)f(FITS)f(\014le\).)52
+1732 y(for)34 b(eac)m(h)h(op)s(en)f(FITS)f(\014le\).)52
 b(F)-8 b(ortunately)g(,)36 b(a)f(FITSIO)e(routine)g(is)h(a)m(v)-5
 b(ailable)33 b(that)i(will)c(return)j(the)g(optimal)0
-1393 y(n)m(um)m(b)s(er)e(of)i(ro)m(ws)g(for)g(a)g(giv)m(en)f(table:)48
+1844 y(n)m(um)m(b)s(er)e(of)i(ro)m(ws)g(for)g(a)g(giv)m(en)f(table:)48
 b(call)33 b(ftgrsz\(unit,)h(nro)m(ws,)g(status\).)52
 b(It)34 b(is)f(not)h(critical)e(to)j(use)e(exactly)0
-1506 y(the)f(v)-5 b(alue)31 b(of)g(nro)m(ws)g(returned)g(b)m(y)g(this)f
+1957 y(the)f(v)-5 b(alue)31 b(of)g(nro)m(ws)g(returned)g(b)m(y)g(this)f
 (routine,)h(as)h(long)f(as)h(one)g(do)s(es)f(not)h(exceed)g(it.)44
-b(Using)31 b(a)h(v)m(ery)f(small)0 1619 y(v)-5 b(alue)32
-b(ho)m(w)m(ev)m(er)h(can)f(also)g(lead)g(to)h(p)s(o)s(or)e(preformance)
-h(b)s(ecause)g(of)g(the)g(o)m(v)m(erhead)i(from)d(the)h(larger)g(n)m
-(um)m(b)s(er)0 1732 y(of)f(subroutine)d(calls.)0 1892
-y(The)36 b(optimal)f(n)m(um)m(b)s(er)h(of)g(ro)m(ws)h(returned)e(b)m(y)
-h(ftgrsz)h(is)f(v)-5 b(alid)35 b(only)g(as)i(long)f(as)h(the)f
-(application)f(program)0 2005 y(is)e(only)h(reading)g(or)g(writing)e
+b(Using)31 b(a)h(v)m(ery)f(small)0 2070 y(v)-5 b(alue)31
+b(ho)m(w)m(ev)m(er)j(can)e(also)g(lead)f(to)i(p)s(o)s(or)e(p)s
+(erformance)g(b)s(ecause)h(of)g(the)g(o)m(v)m(erhead)h(from)f(the)g
+(larger)f(n)m(um)m(b)s(er)0 2183 y(of)g(subroutine)d(calls.)0
+2343 y(The)36 b(optimal)f(n)m(um)m(b)s(er)h(of)g(ro)m(ws)h(returned)e
+(b)m(y)h(ftgrsz)h(is)f(v)-5 b(alid)35 b(only)g(as)i(long)f(as)h(the)f
+(application)f(program)0 2456 y(is)e(only)h(reading)g(or)g(writing)e
 (data)j(in)f(the)g(sp)s(eci\014ed)f(table.)53 b(An)m(y)34
 b(other)h(calls)e(to)i(access)h(data)f(in)e(the)i(table)0
-2118 y(header)e(or)h(in)e(an)m(y)i(other)g(FITS)f(\014le)g(w)m(ould)f
+2569 y(header)e(or)h(in)e(an)m(y)i(other)g(FITS)f(\014le)g(w)m(ould)f
 (cause)i(additional)e(blo)s(c)m(ks)h(of)h(data)g(to)g(b)s(e)f(loaded)h
-(in)m(to)f(the)h(I/O)0 2230 y(bu\013ers)i(displacing)f(data)j(from)f
+(in)m(to)f(the)h(I/O)0 2682 y(bu\013ers)i(displacing)f(data)j(from)f
 (the)g(original)f(table,)j(and)e(should)e(b)s(e)i(a)m(v)m(oided)g
-(during)e(the)j(critical)e(p)s(erio)s(d)0 2343 y(while)28
+(during)e(the)j(critical)e(p)s(erio)s(d)0 2795 y(while)28
 b(the)j(table)f(is)g(b)s(eing)f(read)h(or)g(written.)0
-2503 y(Occasionally)f(it)g(is)f(necessary)i(to)h(sim)m(ultaneously)c
+2955 y(Occasionally)f(it)g(is)f(necessary)i(to)h(sim)m(ultaneously)c
 (access)k(more)f(than)f(one)h(FITS)f(table,)h(for)g(example)f(when)0
-2616 y(transfering)h(v)-5 b(alues)30 b(from)g(an)h(input)e(table)h(to)i
-(an)f(output)f(table.)42 b(In)30 b(cases)i(lik)m(e)e(this,)g(one)i
-(should)c(call)j(ftgrsz)0 2729 y(to)44 b(get)g(the)g(optimal)e(n)m(um)m
-(b)s(er)g(of)i(ro)m(ws)f(for)g(eac)m(h)h(table)g(separately)-8
-b(,)47 b(than)c(reduce)g(the)h(n)m(um)m(b)s(er)d(of)j(ro)m(ws)0
-2842 y(prop)s(ortionally)-8 b(.)42 b(F)-8 b(or)33 b(example,)f(if)f
+3068 y(transferring)41 b(v)-5 b(alues)42 b(from)g(an)h(input)d(table)j
+(to)g(an)g(output)f(table.)78 b(In)42 b(cases)h(lik)m(e)f(this,)j(one)e
+(should)e(call)0 3181 y(ftgrsz)28 b(to)h(get)g(the)f(optimal)f(n)m(um)m
+(b)s(er)g(of)h(ro)m(ws)g(for)f(eac)m(h)j(table)d(separately)-8
+b(,)30 b(than)d(reduce)h(the)g(n)m(um)m(b)s(er)f(of)h(ro)m(ws)0
+3294 y(prop)s(ortionally)-8 b(.)42 b(F)-8 b(or)33 b(example,)f(if)f
 (the)h(optimal)f(n)m(um)m(b)s(er)f(of)i(ro)m(ws)g(in)e(the)i(input)e
-(table)i(is)f(3600)i(and)e(is)g(1400)0 2955 y(in)h(the)h(output)f
+(table)i(is)f(3600)i(and)e(is)g(1400)0 3407 y(in)h(the)h(output)f
 (table,)i(then)f(these)g(v)-5 b(alues)33 b(should)e(b)s(e)h(cut)h(in)f
 (half)g(to)i(1800)g(and)f(700,)i(resp)s(ectiv)m(ely)-8
-b(,)34 b(if)e(b)s(oth)0 3068 y(tables)e(are)h(going)f(to)h(b)s(e)f
-(accessed)i(at)f(the)f(same)h(time.)0 3228 y(3.)39 b(Use)24
+b(,)34 b(if)e(b)s(oth)0 3520 y(tables)e(are)h(going)f(to)h(b)s(e)f
+(accessed)i(at)f(the)f(same)h(time.)0 3680 y(3.)39 b(Use)24
 b(binary)e(table)h(extensions)g(rather)g(than)h(ASCI)s(I)e(table)h
 (extensions)g(for)g(b)s(etter)h(e\016ciency)g(when)e(dealing)0
-3341 y(with)36 b(tabular)h(data.)62 b(The)37 b(I/O)g(to)h(ASCI)s(I)e
+3793 y(with)36 b(tabular)h(data.)62 b(The)37 b(I/O)g(to)h(ASCI)s(I)e
 (tables)h(is)g(slo)m(w)m(er)g(b)s(ecause)h(of)f(the)h(o)m(v)m(erhead)h
-(in)d(formatting)h(or)0 3454 y(parsing)29 b(the)i(ASCI)s(I)f(data)h
+(in)d(formatting)h(or)0 3906 y(parsing)29 b(the)i(ASCI)s(I)f(data)h
 (\014elds,)f(and)g(b)s(ecause)h(ASCI)s(I)e(tables)h(are)h(ab)s(out)g(t)
-m(wice)g(as)g(large)g(as)g(binary)e(tables)0 3567 y(with)g(the)i(same)f
-(information)f(con)m(ten)m(t.)0 3727 y(4.)64 b(Design)38
+m(wice)g(as)g(large)g(as)g(binary)e(tables)0 4019 y(with)g(the)i(same)f
+(information)f(con)m(ten)m(t.)0 4179 y(4.)64 b(Design)38
 b(soft)m(w)m(are)h(so)g(that)f(it)g(reads)g(the)g(FITS)f(header)h(k)m
 (eyw)m(ords)g(in)f(the)h(same)h(order)e(in)g(whic)m(h)g(they)0
-3840 y(o)s(ccur)c(in)f(the)h(\014le.)48 b(When)32 b(reading)h(k)m(eyw)m
+4292 y(o)s(ccur)c(in)f(the)h(\014le.)48 b(When)32 b(reading)h(k)m(eyw)m
 (ords,)h(FITSIO)e(searc)m(hes)i(forw)m(ard)e(starting)h(from)f(the)i(p)
-s(osition)d(of)0 3953 y(the)e(last)h(k)m(eyw)m(ord)f(that)h(w)m(as)g
+s(osition)d(of)0 4405 y(the)e(last)h(k)m(eyw)m(ord)f(that)h(w)m(as)g
 (read.)40 b(If)29 b(it)f(reac)m(hes)j(the)e(end)g(of)g(the)h(header)f
-(without)f(\014nding)f(the)i(k)m(eyw)m(ord,)h(it)0 4066
+(without)f(\014nding)f(the)i(k)m(eyw)m(ord,)h(it)0 4517
 y(then)j(go)s(es)h(bac)m(k)g(to)h(the)e(start)h(of)g(the)g(header)f
 (and)g(con)m(tin)m(ues)g(the)h(searc)m(h)g(do)m(wn)f(to)h(the)g(p)s
-(osition)d(where)i(it)0 4179 y(started.)41 b(In)30 b(practice,)h(as)f
+(osition)d(where)i(it)0 4630 y(started.)41 b(In)30 b(practice,)h(as)f
 (long)g(as)h(the)f(en)m(tire)h(FITS)e(header)h(can)h(\014t)f(at)h(one)g
 (time)f(in)f(the)h(a)m(v)-5 b(ailable)30 b(in)m(ternal)0
-4292 y(I/O)j(bu\013ers,)h(then)f(the)h(header)f(k)m(eyw)m(ord)h(access)
+4743 y(I/O)j(bu\013ers,)h(then)f(the)h(header)f(k)m(eyw)m(ord)h(access)
 h(will)30 b(b)s(e)j(v)m(ery)h(fast)g(and)f(it)g(mak)m(es)h(little)e
-(di\013erence)h(whic)m(h)0 4405 y(order)d(they)g(are)h(accessed.)0
-4565 y(5.)40 b(Av)m(oid)28 b(the)f(use)h(of)f(scaling)g(\(b)m(y)h
+(di\013erence)h(whic)m(h)0 4856 y(order)d(they)g(are)h(accessed.)0
+5016 y(5.)40 b(Av)m(oid)28 b(the)f(use)h(of)f(scaling)g(\(b)m(y)h
 (using)e(the)i(BSCALE)e(and)h(BZER)m(O)h(or)f(TSCAL)g(and)g(TZER)m(O)f
-(k)m(eyw)m(ords\))0 4678 y(in)34 b(FITS)g(\014les)f(since)i(the)g
+(k)m(eyw)m(ords\))0 5129 y(in)34 b(FITS)g(\014les)f(since)i(the)g
 (scaling)f(op)s(erations)g(add)g(to)i(the)f(pro)s(cessing)e(time)i
-(needed)f(to)i(read)f(or)g(write)f(the)0 4791 y(data.)60
+(needed)f(to)i(read)f(or)g(write)f(the)0 5242 y(data.)60
 b(In)36 b(some)i(cases)f(it)f(ma)m(y)i(b)s(e)e(more)h(e\016cien)m(t)g
 (to)g(temp)s(orarily)e(turn)h(o\013)h(the)g(scaling)f(\(using)f(ftpscl)
-h(or)0 4903 y(fttscl\))31 b(and)e(then)h(read)h(or)f(write)g(the)g(ra)m
+h(or)0 5355 y(fttscl\))31 b(and)e(then)h(read)h(or)f(write)g(the)g(ra)m
 (w)h(unscaled)e(v)-5 b(alues)30 b(in)f(the)h(FITS)g(\014le.)0
-5064 y(6.)40 b(Av)m(oid)26 b(using)g(the)h('implicit)d(datat)m(yp)s(e)j
+5515 y(6.)40 b(Av)m(oid)26 b(using)g(the)h('implicit)d(datat)m(yp)s(e)j
 (con)m(v)m(ersion')g(capabilit)m(y)f(in)f(FITSIO.)h(F)-8
-b(or)28 b(instance,)f(when)f(reading)0 5176 y(a)f(FITS)e(image)i(with)e
+b(or)28 b(instance,)f(when)f(reading)0 5628 y(a)f(FITS)e(image)i(with)e
 (BITPIX)h(=)g(-32)i(\(32-bit)f(\015oating)f(p)s(oin)m(t)f(pixels\),)i
-(read)f(the)h(data)g(in)m(to)f(a)h(single)e(precision)0
-5289 y(\015oating)f(p)s(oin)m(t)e(data)j(arra)m(y)f(in)f(the)h
-(program.)37 b(F)-8 b(orcing)22 b(FITSIO)f(to)h(con)m(v)m(ert)i(the)e
-(data)g(to)h(a)f(di\013eren)m(t)f(datat)m(yp)s(e)0 5402
-y(can)31 b(signi\014can)m(tly)d(slo)m(w)i(the)h(program.)0
-5562 y(7.)57 b(Where)36 b(feasible,)g(design)f(FITS)g(binary)f(tables)h
-(using)f(v)m(ector)k(column)c(elemen)m(ts)i(so)g(that)g(the)g(data)h
-(are)0 5675 y(written)29 b(as)h(a)g(con)m(tiguous)g(set)g(of)g(b)m
-(ytes,)g(rather)g(than)f(as)h(single)e(elemen)m(ts)i(in)f(m)m(ultiple)e
-(ro)m(ws.)41 b(F)-8 b(or)30 b(example,)p eop
-%%Page: 51 57
-51 56 bop 0 299 a Fg(5.13.)73 b(OPTIMIZING)29 b(CODE)h(F)m(OR)h
-(MAXIMUM)g(PR)m(OCESSING)f(SPEED)971 b Fi(51)0 555 y(it)35
-b(is)g(faster)h(to)g(access)h(the)f(data)h(in)d(a)i(table)g(that)g(con)
-m(tains)g(a)g(single)e(ro)m(w)i(and)f(2)h(columns)e(with)h(TF)m(ORM)0
-668 y(k)m(eyw)m(ords)e(equal)g(to)h('10000E')h(and)e('10000J',)j(than)d
-(it)f(is)g(to)i(access)g(the)g(same)f(amoun)m(t)h(of)f(data)h(in)e(a)h
-(table)0 781 y(with)39 b(10000)k(ro)m(ws)d(whic)m(h)g(has)g(columns)f
-(with)g(the)i(TF)m(ORM)g(k)m(eyw)m(ords)g(equal)f(to)h('1E')h(and)e
-('1J'.)h(In)f(the)0 894 y(former)27 b(case)i(the)f(10000)i(\015oating)e
-(p)s(oin)m(t)f(v)-5 b(alues)27 b(in)g(the)h(\014rst)f(column)g(are)h
-(all)f(written)g(in)f(a)i(con)m(tiguous)g(blo)s(c)m(k)0
-1007 y(of)e(the)f(\014le)g(whic)m(h)f(can)i(b)s(e)f(read)g(or)g
-(written)g(quic)m(kly)-8 b(,)26 b(whereas)f(in)f(the)i(second)f(case)i
-(eac)m(h)g(\015oating)e(p)s(oin)m(t)f(v)-5 b(alue)0 1120
-y(in)33 b(the)h(\014rst)f(column)f(is)h(in)m(terlea)m(v)m(ed)i(with)d
-(the)i(in)m(teger)h(v)-5 b(alue)33 b(in)g(the)h(second)g(column)e(of)i
-(the)g(same)h(ro)m(w)f(so)0 1233 y(CFITSIO)29 b(has)h(to)h(explicitly)d
-(mo)m(v)m(e)k(to)f(the)g(p)s(osition)d(of)j(eac)m(h)g(elemen)m(t)g(to)g
-(b)s(e)f(read)g(or)g(written.)0 1393 y(8.)52 b(Av)m(oid)34
+(read)f(the)h(data)g(in)m(to)f(a)h(single)e(precision)p
+eop
+%%Page: 59 65
+59 64 bop 0 299 a Fg(6.13.)73 b(OPTIMIZING)29 b(CODE)h(F)m(OR)h
+(MAXIMUM)g(PR)m(OCESSING)f(SPEED)971 b Fi(59)0 555 y(\015oating)22
+b(p)s(oin)m(t)e(data)j(arra)m(y)f(in)f(the)h(program.)37
+b(F)-8 b(orcing)22 b(FITSIO)f(to)h(con)m(v)m(ert)i(the)e(data)g(to)h(a)
+f(di\013eren)m(t)f(datat)m(yp)s(e)0 668 y(can)31 b(signi\014can)m(tly)d
+(slo)m(w)i(the)h(program.)0 828 y(7.)57 b(Where)36 b(feasible,)g
+(design)f(FITS)g(binary)f(tables)h(using)f(v)m(ector)k(column)c(elemen)
+m(ts)i(so)g(that)g(the)g(data)h(are)0 941 y(written)29
+b(as)h(a)g(con)m(tiguous)g(set)g(of)g(b)m(ytes,)g(rather)g(than)f(as)h
+(single)e(elemen)m(ts)i(in)f(m)m(ultiple)e(ro)m(ws.)41
+b(F)-8 b(or)30 b(example,)0 1054 y(it)35 b(is)g(faster)h(to)g(access)h
+(the)f(data)h(in)d(a)i(table)g(that)g(con)m(tains)g(a)g(single)e(ro)m
+(w)i(and)f(2)h(columns)e(with)h(TF)m(ORM)0 1167 y(k)m(eyw)m(ords)e
+(equal)g(to)h('10000E')h(and)e('10000J',)j(than)d(it)f(is)g(to)i
+(access)g(the)g(same)f(amoun)m(t)h(of)f(data)h(in)e(a)h(table)0
+1280 y(with)39 b(10000)k(ro)m(ws)d(whic)m(h)g(has)g(columns)f(with)g
+(the)i(TF)m(ORM)g(k)m(eyw)m(ords)g(equal)f(to)h('1E')h(and)e('1J'.)h
+(In)f(the)0 1393 y(former)27 b(case)i(the)f(10000)i(\015oating)e(p)s
+(oin)m(t)f(v)-5 b(alues)27 b(in)g(the)h(\014rst)f(column)g(are)h(all)f
+(written)g(in)f(a)i(con)m(tiguous)g(blo)s(c)m(k)0 1506
+y(of)e(the)f(\014le)g(whic)m(h)f(can)i(b)s(e)f(read)g(or)g(written)g
+(quic)m(kly)-8 b(,)26 b(whereas)f(in)f(the)i(second)f(case)i(eac)m(h)g
+(\015oating)e(p)s(oin)m(t)f(v)-5 b(alue)0 1619 y(in)33
+b(the)h(\014rst)f(column)f(is)h(in)m(terlea)m(v)m(ed)i(with)d(the)i(in)
+m(teger)h(v)-5 b(alue)33 b(in)g(the)h(second)g(column)e(of)i(the)g
+(same)h(ro)m(w)f(so)0 1732 y(CFITSIO)29 b(has)h(to)h(explicitly)d(mo)m
+(v)m(e)k(to)f(the)g(p)s(osition)d(of)j(eac)m(h)g(elemen)m(t)g(to)g(b)s
+(e)f(read)g(or)g(written.)0 1892 y(8.)52 b(Av)m(oid)34
 b(the)h(use)e(of)i(v)-5 b(ariable)32 b(length)i(v)m(ector)i(columns)c
 (in)h(binary)g(tables,)i(since)e(an)m(y)i(reading)e(or)h(writing)0
-1506 y(of)f(these)g(data)g(requires)e(that)i(CFITSIO)f(\014rst)f(lo)s
+2005 y(of)f(these)g(data)g(requires)e(that)i(CFITSIO)f(\014rst)f(lo)s
 (ok)i(up)e(or)i(compute)g(the)f(starting)h(address)f(of)g(eac)m(h)i(ro)
-m(w)f(of)0 1619 y(data)e(in)e(the)i(heap.)0 1779 y(9.)40
+m(w)f(of)0 2118 y(data)e(in)e(the)i(heap.)0 2278 y(9.)40
 b(When)26 b(cop)m(ying)g(data)i(from)e(one)g(FITS)g(table)g(to)h
 (another,)h(it)e(is)g(faster)g(to)i(transfer)e(the)g(ra)m(w)h(b)m(ytes)
-g(instead)0 1892 y(of)f(reading)f(then)h(writing)e(eac)m(h)j(column)d
+g(instead)0 2391 y(of)f(reading)f(then)h(writing)e(eac)m(h)j(column)d
 (of)j(the)f(table.)39 b(The)25 b(FITSIO)g(subroutines)f(FTGTBS)h(and)h
-(FTPTBS)0 2005 y(\(for)i(ASCI)s(I)f(tables\),)i(and)e(FTGTBB)i(and)e
+(FTPTBS)0 2503 y(\(for)i(ASCI)s(I)f(tables\),)i(and)e(FTGTBB)i(and)e
 (FTPTBB)i(\(for)f(binary)e(tables\))i(will)e(p)s(erform)g(lo)m(w-lev)m
-(el)i(reads)g(or)0 2118 y(writes)33 b(of)i(an)m(y)f(con)m(tiguous)h
+(el)i(reads)g(or)0 2616 y(writes)33 b(of)i(an)m(y)f(con)m(tiguous)h
 (range)g(of)f(b)m(ytes)h(in)e(a)i(table)f(extension.)52
 b(These)34 b(routines)f(can)i(b)s(e)e(used)h(to)h(read)0
-2230 y(or)29 b(write)f(a)h(whole)f(ro)m(w)g(\(or)i(m)m(ultiple)c(ro)m
+2729 y(or)29 b(write)f(a)h(whole)f(ro)m(w)g(\(or)i(m)m(ultiple)c(ro)m
 (ws\))j(of)g(a)g(table)g(with)e(a)i(single)e(subroutine)g(call.)39
-b(These)29 b(routines)f(are)0 2343 y(fast)38 b(b)s(ecause)f(they)h(b)m
+b(These)29 b(routines)f(are)0 2842 y(fast)38 b(b)s(ecause)f(they)h(b)m
 (ypass)f(all)f(the)i(usual)e(data)i(scaling,)h(error)e(c)m(hec)m(king)h
-(and)f(mac)m(hine)g(dep)s(enden)m(t)f(data)0 2456 y(con)m(v)m(ersion)k
+(and)f(mac)m(hine)g(dep)s(enden)m(t)f(data)0 2955 y(con)m(v)m(ersion)k
 (that)h(is)d(normally)h(done)g(b)m(y)h(FITSIO,)f(and)g(they)h(allo)m(w)
-f(the)h(program)g(to)h(write)e(the)h(data)g(to)0 2569
+f(the)h(program)g(to)h(write)e(the)h(data)g(to)0 3068
 y(the)34 b(output)g(\014le)f(in)g(exactly)i(the)f(same)h(b)m(yte)g
 (order.)51 b(F)-8 b(or)35 b(these)g(same)f(reasons,)i(use)e(of)g(these)
-h(routines)e(can)0 2682 y(b)s(e)g(somewhat)h(risky)e(b)s(ecause)h(no)g
+h(routines)e(can)0 3181 y(b)s(e)g(somewhat)h(risky)e(b)s(ecause)h(no)g
 (v)-5 b(alidation)32 b(or)i(mac)m(hine)f(dep)s(enden)m(t)f(con)m(v)m
-(ersion)i(is)e(p)s(erformed)g(b)m(y)h(these)0 2795 y(routines.)39
+(ersion)i(is)e(p)s(erformed)g(b)m(y)h(these)0 3294 y(routines.)39
 b(In)27 b(general)g(these)i(routines)d(are)i(only)f(recommended)g(for)h
 (optimizing)e(critical)g(pieces)i(of)g(co)s(de)g(and)0
-2908 y(should)d(only)i(b)s(e)g(used)f(b)m(y)i(programmers)e(who)h
+3407 y(should)d(only)i(b)s(e)g(used)f(b)m(y)i(programmers)e(who)h
 (thoroughly)g(understand)e(the)j(in)m(ternal)e(b)m(yte)i(structure)f
-(of)h(the)0 3021 y(FITS)i(tables)g(they)g(are)h(reading)f(or)g
-(writing.)0 3181 y(10.)41 b(Another)30 b(strategy)g(for)g(impro)m(ving)
+(of)h(the)0 3520 y(FITS)i(tables)g(they)g(are)h(reading)f(or)g
+(writing.)0 3680 y(10.)41 b(Another)30 b(strategy)g(for)g(impro)m(ving)
 d(the)j(sp)s(eed)e(of)i(writing)e(a)h(FITS)g(table,)h(similar)d(to)j
-(the)f(previous)f(one,)0 3294 y(is)j(to)h(directly)f(construct)h(the)f
+(the)f(previous)f(one,)0 3793 y(is)j(to)h(directly)f(construct)h(the)f
 (en)m(tire)h(b)m(yte)g(stream)g(for)g(a)g(whole)f(table)g(ro)m(w)h
-(\(or)g(m)m(ultiple)e(ro)m(ws\))i(within)d(the)0 3407
+(\(or)g(m)m(ultiple)e(ro)m(ws\))i(within)d(the)0 3906
 y(application)j(program)i(and)g(then)f(write)h(it)f(to)i(the)f(FITS)f
 (\014le)h(with)e(ftptbb.)51 b(This)32 b(a)m(v)m(oids)j(all)e(the)h(o)m
-(v)m(erhead)0 3520 y(normally)e(presen)m(t)i(in)e(the)i(column-orien)m
+(v)m(erhead)0 4019 y(normally)e(presen)m(t)i(in)e(the)i(column-orien)m
 (ted)f(CFITSIO)f(write)h(routines.)50 b(This)32 b(tec)m(hnique)h
-(should)f(only)h(b)s(e)0 3633 y(used)26 b(for)h(critical)f
+(should)f(only)h(b)s(e)0 4131 y(used)26 b(for)h(critical)f
 (applications,)g(b)s(ecause)g(it)h(mak)m(es)h(the)f(co)s(de)g(more)g
 (di\016cult)e(to)i(understand)e(and)i(main)m(tain,)0
-3745 y(and)d(it)g(mak)m(es)i(the)f(co)s(de)g(more)f(system)h(dep)s
+4244 y(and)d(it)g(mak)m(es)i(the)f(co)s(de)g(more)f(system)h(dep)s
 (enden)m(t)f(\(e.g.,)k(do)c(the)h(b)m(ytes)g(need)g(to)g(b)s(e)f(sw)m
-(app)s(ed)g(b)s(efore)g(writing)0 3858 y(to)31 b(the)g(FITS)e
-(\014le?\).)0 4019 y(11.)53 b(Finally)-8 b(,)34 b(external)g(factors)i
+(app)s(ed)g(b)s(efore)g(writing)0 4357 y(to)31 b(the)g(FITS)e
+(\014le?\).)0 4517 y(11.)53 b(Finally)-8 b(,)34 b(external)g(factors)i
 (suc)m(h)e(as)g(the)h(t)m(yp)s(e)f(of)h(magnetic)f(disk)f(con)m
-(troller)h(\(SCSI)f(or)i(IDE\),)g(the)f(size)0 4131 y(of)h(the)g(disk)f
+(troller)h(\(SCSI)f(or)i(IDE\),)g(the)f(size)0 4630 y(of)h(the)g(disk)f
 (cac)m(he,)k(the)d(a)m(v)m(erage)i(seek)f(sp)s(eed)e(of)h(the)g(disk,)g
 (the)g(amoun)m(t)h(of)f(disk)e(fragmen)m(tation,)k(and)e(the)0
-4244 y(amoun)m(t)29 b(of)g(RAM)f(a)m(v)-5 b(ailable)28
+4743 y(amoun)m(t)29 b(of)g(RAM)f(a)m(v)-5 b(ailable)28
 b(on)h(the)f(system)h(can)g(all)e(ha)m(v)m(e)j(a)f(signi\014can)m(t)e
 (impact)i(on)f(o)m(v)m(erall)h(I/O)f(e\016ciency)-8 b(.)0
-4357 y(F)g(or)38 b(critical)e(applications,)h(a)g(system)h
-(adminstrator)e(should)f(review)h(the)h(prop)s(osed)f(system)i(hardw)m
-(are)e(to)0 4470 y(iden)m(tify)29 b(an)m(y)i(p)s(oten)m(tial)e(I/O)i(b)
+4856 y(F)g(or)36 b(critical)e(applications,)g(a)i(system)f
+(administrator)e(should)g(review)h(the)i(prop)s(osed)d(system)j(hardw)m
+(are)e(to)0 4969 y(iden)m(tify)29 b(an)m(y)i(p)s(oten)m(tial)e(I/O)i(b)
 s(ottlenec)m(ks.)p eop
-%%Page: 52 58
-52 57 bop 0 299 a Fi(52)1277 b Fg(CHAPTER)29 b(5.)72
+%%Page: 60 66
+60 65 bop 0 299 a Fi(60)1277 b Fg(CHAPTER)29 b(6.)72
 b(FITSIO)29 b(CONVENTIONS)g(AND)i(GUIDELINES)p eop
-%%Page: 53 59
-53 58 bop 0 1225 a Ff(Chapter)65 b(6)0 1687 y Fl(The)77
+%%Page: 61 67
+61 66 bop 0 1225 a Ff(Chapter)65 b(7)0 1687 y Fl(The)77
 b(CFITSIO)f(Iterator)i(F)-19 b(unction)0 2180 y Fi(The)41
 b(\014ts)p 325 2180 28 4 v 33 w(iterate)p 615 2180 V
 33 w(data)i(function)d(in)h(CFITSIO)f(pro)m(vides)h(a)h(unique)d(metho)
@@ -5698,9 +6146,9 @@ b(jects)37 b(to)h(dev)m(elop)f(a)h(library)c(of)k(w)m(ork)f(functions)f
 b(The)30 b(\014rst)g(step)h(is)f(to)h(design)f(the)0
 5714 y(w)m(ork)c(function)e(itself)g(whic)m(h)g(m)m(ust)i(ha)m(v)m(e)g
 (a)g(prescrib)s(ed)d(set)j(of)g(input)e(parameters.)39
-b(One)25 b(of)h(these)g(parameters)1905 5942 y(53)p eop
-%%Page: 54 60
-54 59 bop 0 299 a Fi(54)1455 b Fg(CHAPTER)30 b(6.)112
+b(One)25 b(of)h(these)g(parameters)1905 5942 y(61)p eop
+%%Page: 62 68
+62 67 bop 0 299 a Fi(62)1455 b Fg(CHAPTER)30 b(7.)112
 b(THE)30 b(CFITSIO)e(ITERA)-8 b(TOR)30 b(FUNCTION)0 555
 y Fi(is)e(a)h(structure)g(con)m(taining)g(p)s(oin)m(ters)e(to)j(the)f
 (arra)m(ys)h(of)f(data;)h(the)f(w)m(ork)h(function)d(can)j(p)s(erform)d
@@ -5719,8 +6167,8 @@ f(the)i(CFITSIO)e(iterator)0 1167 y(function)29 b(whic)m(h)g(then)h
 (CFITSIO)f(User's)0 1440 y(Guide,)30 b(and)f(in)g(the)i(iter)p
 875 1440 28 4 v 32 w(a.f,)g(iter)p 1198 1440 V 33 w(b.f)f(and)f(iter)p
 1678 1440 V 33 w(c.f)h(example)g(programs.)p eop
-%%Page: 55 61
-55 60 bop 0 1225 a Ff(Chapter)65 b(7)0 1687 y Fl(Basic)77
+%%Page: 63 69
+63 68 bop 0 1225 a Ff(Chapter)65 b(8)0 1687 y Fl(Basic)77
 b(In)-6 b(terface)77 b(Routines)0 2180 y Fi(This)26 b(section)h
 (de\014nes)g(a)h(basic)f(set)h(of)g(subroutines)d(that)j(can)g(b)s(e)f
 (used)g(to)h(p)s(erform)e(the)i(most)g(common)g(t)m(yp)s(es)0
@@ -5740,7 +6188,7 @@ h(and)e(m)m(ust)h(b)s(e)g(initialized)d(=)j(0)h(prior)0
 3017 y(to)f(calling)e(the)i(FITSIO)e(subroutines.)0 3177
 y(Refer)h(to)i(Chapter)d(9)i(for)f(the)h(de\014nition)d(of)i(all)g(the)
 g(parameters)h(used)e(b)m(y)i(these)g(in)m(terface)f(routines.)0
-3525 y Fd(7.1)135 b(FITSIO)44 b(Error)h(Status)h(Routines)0
+3525 y Fd(8.1)135 b(FITSIO)44 b(Error)h(Status)h(Routines)0
 3773 y Fh(1)81 b Fi(Return)24 b(the)i(curren)m(t)f(v)m(ersion)g(n)m(um)
 m(b)s(er)f(of)i(the)f(\014tsio)g(library)-8 b(.)37 b(The)25
 b(v)m(ersion)g(n)m(um)m(b)s(er)f(will)f(b)s(e)h(incremen)m(ted)227
@@ -5760,1603 +6208,1722 @@ b(An)m(y)28 b(FITSIO)f(error)h(will)227 5310 y(generate)h(one)e(or)g
 b(this)g(routine)g(rep)s(eatedly)g(to)i(get)h(eac)m(h)f(message)227
 5422 y(in)h(sequence.)41 b(The)30 b(error)g(stac)m(k)i(is)e(empt)m(y)g
 (when)g(a)g(blank)f(string)h(is)f(returned.)382 5694
-y Fe(FTGMSG\()46 b(>)h(errmsg\))1905 5942 y Fi(55)p eop
-%%Page: 56 62
-56 61 bop 0 299 a Fi(56)1747 b Fg(CHAPTER)30 b(7.)111
+y Fe(FTGMSG\()46 b(>)h(errmsg\))1905 5942 y Fi(63)p eop
+%%Page: 64 70
+64 69 bop 0 299 a Fi(64)1747 b Fg(CHAPTER)30 b(8.)111
 b(BASIC)30 b(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0 555
-y Fh(4)81 b Fi(Prin)m(t)29 b(out)i(the)g(error)f(message)i(corresp)s
-(onding)d(to)i(the)g(input)e(status)i(v)-5 b(alue)30
-b(and)g(all)g(the)h(error)f(messages)227 668 y(on)g(the)h(FITSIO)e
-(stac)m(k)i(to)g(the)g(sp)s(eci\014ed)d(\014le)i(stream)g(\(stream)h
-(can)g(b)s(e)e(either)h(the)g(string)f('STDOUT')227 781
-y(or)i('STDERR'\).)f(If)g(the)h(input)d(status)j(v)-5
+y Fh(4)81 b Fi(The)33 b(FTPMRK)h(routine)f(puts)h(an)g(in)m(visible)d
+(mark)m(er)j(on)g(the)h(CFITSIO)d(error)i(stac)m(k.)54
+b(The)33 b(FTCMRK)227 668 y(routine)40 b(can)h(then)g(b)s(e)f(used)g
+(to)h(delete)g(an)m(y)g(more)g(recen)m(t)h(error)e(messages)i(on)f(the)
+g(stac)m(k,)k(bac)m(k)c(to)227 781 y(the)32 b(p)s(osition)d(of)i(the)g
+(mark)m(er.)43 b(This)30 b(preserv)m(es)h(an)m(y)g(older)g(error)f
+(messages)i(on)f(the)h(stac)m(k.)44 b(FTCMSG)227 894
+y(simply)21 b(clears)h(the)h(en)m(tire)g(error)f(message)i(stac)m(k.)40
+b(These)23 b(routines)e(are)i(called)f(without)g(an)m(y)h(argumen)m
+(ts.)382 1116 y Fe(FTPMRK)382 1229 y(FTCMRK)382 1342
+y(FTCMSG)0 1564 y Fh(5)81 b Fi(Prin)m(t)29 b(out)i(the)g(error)f
+(message)i(corresp)s(onding)d(to)i(the)g(input)e(status)i(v)-5
+b(alue)30 b(and)g(all)g(the)h(error)f(messages)227 1677
+y(on)g(the)h(FITSIO)e(stac)m(k)i(to)g(the)g(sp)s(eci\014ed)d(\014le)i
+(stream)g(\(stream)h(can)g(b)s(e)e(either)h(the)g(string)f('STDOUT')227
+1790 y(or)i('STDERR'\).)f(If)g(the)h(input)d(status)j(v)-5
 b(alue)30 b(=)g(0)h(then)f(this)f(routine)g(do)s(es)h(nothing.)334
-1030 y Fe(FTRPRT)46 b(\(stream,)g(>)h(status\))0 1278
-y Fh(5)81 b Fi(W)-8 b(rite)38 b(an)g(80-c)m(haracter)j(message)e(to)g
+2012 y Fe(FTRPRT)46 b(\(stream,)g(>)h(status\))0 2234
+y Fh(6)81 b Fi(W)-8 b(rite)38 b(an)g(80-c)m(haracter)j(message)e(to)g
 (the)f(FITSIO)f(error)h(stac)m(k.)65 b(Application)36
-b(programs)i(should)e(not)227 1391 y(normally)29 b(write)g(to)j(the)e
+b(programs)i(should)e(not)227 2347 y(normally)29 b(write)g(to)j(the)e
 (stac)m(k,)i(but)e(there)g(ma)m(y)h(b)s(e)f(some)h(situations)e(where)h
-(this)f(is)h(desirable.)382 1640 y Fe(FTPMSG\(errmsg\))0
-1889 y Fh(6)81 b Fi(Clear)27 b(the)h(en)m(tire)g(error)f(message)i
-(stac)m(k.)42 b(This)26 b(routine)h(is)g(useful)f(to)j(clear)f(an)m(y)g
-(error)g(message)h(that)f(ma)m(y)227 2002 y(ha)m(v)m(e)33
-b(b)s(een)e(generated)h(b)m(y)g(a)g(non-fatal)f(FITSIO)g(error)g(\(suc)
-m(h)g(as)h(failing)e(to)i(\014nd)e(an)h(optional)g(header)227
-2115 y(k)m(eyw)m(ord\).)42 b(This)28 b(routine)i(is)f(called)h(without)
-f(an)m(y)i(argumen)m(ts.)382 2363 y Fe(FTCMSG)0 2695
-y Fd(7.2)135 b(File)46 b(I/O)f(Routines)0 2934 y Fh(1)81
-b Fi(Op)s(en)34 b(an)h(existing)g(FITS)f(\014le)h(with)f(readonly)h(or)
-g(readwrite)g(access.)58 b(This)33 b(routine)i(alw)m(a)m(ys)h(op)s(ens)
-f(the)227 3047 y(primary)29 b(arra)m(y)j(\(the)f(\014rst)f(HDU\))i(of)f
-(the)h(\014le,)e(and)g(do)s(es)h(not)g(mo)m(v)m(e)h(to)g(a)f(follo)m
-(wing)f(extension,)h(if)f(one)227 3160 y(w)m(as)d(sp)s(eci\014ed)e(as)h
-(part)h(of)f(the)h(\014lename.)38 b(Use)27 b(the)g(FTNOPN)f(routine)f
-(to)i(automatically)g(mo)m(v)m(e)h(to)f(the)227 3272
-y(extension.)382 3521 y Fe(FTOPEN\(unit,filename,rwm)o(ode)o(,)42
-b(>)47 b(blocksize,status\))0 3770 y Fh(2)81 b Fi(Op)s(en)24
+(this)f(is)h(desirable.)382 2570 y Fe(FTPMSG\(errmsg\))0
+2897 y Fd(8.2)135 b(File)46 b(I/O)f(Routines)0 3131 y
+Fh(1)81 b Fi(Op)s(en)34 b(an)h(existing)g(FITS)f(\014le)h(with)f
+(readonly)h(or)g(readwrite)g(access.)58 b(This)33 b(routine)i(alw)m(a)m
+(ys)h(op)s(ens)f(the)227 3244 y(primary)29 b(arra)m(y)j(\(the)f
+(\014rst)f(HDU\))i(of)f(the)h(\014le,)e(and)g(do)s(es)h(not)g(mo)m(v)m
+(e)h(to)g(a)f(follo)m(wing)f(extension,)h(if)f(one)227
+3357 y(w)m(as)d(sp)s(eci\014ed)e(as)h(part)h(of)f(the)h(\014lename.)38
+b(Use)27 b(the)g(FTNOPN)f(routine)f(to)i(automatically)g(mo)m(v)m(e)h
+(to)f(the)227 3470 y(extension.)43 b(This)30 b(routine)g(will)f(also)i
+(op)s(en)g(IRAF)g(images)h(\(.imh)e(format)i(\014les\))f(and)f(ra)m(w)i
+(binary)d(data)227 3583 y(arra)m(ys)f(with)e(READONL)-8
+b(Y)28 b(access)h(b)m(y)e(\014rst)g(con)m(v)m(erting)h(them)f(on)g(the)
+h(\015y)f(in)m(to)g(virtual)f(FITS)h(images.)227 3696
+y(See)k(the)f(`Extended)h(File)e(Name)i(Syn)m(tax')g(c)m(hapter)g(for)f
+(more)h(details.)382 3918 y Fe(FTOPEN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(blocksize,status\))0 4140 y Fh(2)81 b Fi(Op)s(en)24
 b(an)i(existing)f(FITS)g(\014le)g(with)f(readonly)h(or)h(readwrite)f
 (access)i(and)f(mo)m(v)m(e)h(to)f(a)h(follo)m(wing)d(extension,)227
-3883 y(if)37 b(one)h(w)m(as)g(sp)s(eci\014ed)f(as)h(part)f(of)h(the)h
+4253 y(if)37 b(one)h(w)m(as)g(sp)s(eci\014ed)f(as)h(part)f(of)h(the)h
 (\014lename.)62 b(\(e.g.,)42 b('\014lename.\014ts+2')37
-b(or)h('\014lename.\014ts[2]')h(will)227 3996 y(mo)m(v)m(e)f(to)g(the)e
+b(or)h('\014lename.\014ts[2]')h(will)227 4366 y(mo)m(v)m(e)f(to)g(the)e
 (3rd)g(HDU)i(in)d(the)i(\014le\).)59 b(Note)37 b(that)h(this)d(routine)
-h(di\013ers)f(from)h(FTOPEN)g(in)f(that)i(it)227 4109
+h(di\013ers)f(from)h(FTOPEN)g(in)f(that)i(it)227 4479
 y(do)s(es)30 b(not)h(ha)m(v)m(e)h(the)e(redundan)m(t)f(blo)s(c)m(ksize)
-h(argumen)m(t.)382 4357 y Fe(FTNOPN\(unit,filename,rwm)o(ode)o(,)42
-b(>)47 b(status\))0 4606 y Fh(3)81 b Fi(Op)s(en)30 b(and)h(initialize)e
+h(argumen)m(t.)382 4701 y Fe(FTNOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))0 4924 y Fh(3)81 b Fi(Op)s(en)31 b(an)h(existing)f
+(FITS)h(\014le)f(with)g(readonly)h(or)g(readwrite)g(access)h(and)f
+(then)g(mo)m(v)m(e)i(to)f(the)g(\014rst)e(HDU)227 5036
+y(con)m(taining)25 b(signi\014can)m(t)g(data,)i(if)d(a\))j(an)e(HDU)h
+(name)g(or)f(n)m(um)m(b)s(er)f(to)i(op)s(en)f(w)m(as)h(not)g
+(explicitly)d(sp)s(eci\014ed)227 5149 y(as)31 b(part)g(of)g(the)g
+(\014lename,)g(and)f(b\))h(if)f(the)h(FITS)f(\014le)g(con)m(tains)h(a)h
+(n)m(ull)c(primary)h(arra)m(y)j(\(i.e.,)g(NAXIS)e(=)227
+5262 y(0\).)41 b(In)26 b(this)h(case,)i(it)e(will)e(lo)s(ok)i(for)g
+(the)h(\014rst)e(IMA)m(GE)j(HDU)f(with)e(NAXIS)h(>)h(0,)g(or)g(the)f
+(\014rst)g(table)g(that)227 5375 y(do)s(es)h(not)g(con)m(tain)f(the)h
+(strings)f(`GTI')h(\(Go)s(o)s(d)f(Time)g(In)m(terv)-5
+b(al\))28 b(or)g(`OBST)-8 b(ABLE')28 b(in)e(the)i(EXTNAME)227
+5488 y(k)m(eyw)m(ord)37 b(v)-5 b(alue.)60 b(FTTOPN)36
+b(is)f(similar,)h(except)i(it)e(will)e(mo)m(v)m(e)39
+b(to)e(the)g(\014rst)f(signi\014can)m(t)g(table)g(HDU)227
+5601 y(\(skipping)24 b(o)m(v)m(er)i(an)m(y)g(image)g(HDUs\))h(in)d(the)
+i(\014le)f(if)f(a)i(sp)s(eci\014c)f(HDU)h(name)g(or)g(n)m(um)m(b)s(er)e
+(is)h(not)g(sp)s(eci\014ed.)227 5714 y(FTIOPN)30 b(will)e(mo)m(v)m(e)k
+(to)f(the)f(\014rst)g(non-n)m(ull)e(image)j(HDU,)g(skipping)d(o)m(v)m
+(er)j(an)m(y)g(tables.)p eop
+%%Page: 65 71
+65 70 bop 0 299 a Fg(8.2.)72 b(FILE)30 b(I/O)h(R)m(OUTINES)2693
+b Fi(65)382 555 y Fe(FTDOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))382 668 y(FTTOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))382 781 y(FTIOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))0 1049 y Fh(4)81 b Fi(Op)s(en)30 b(and)h(initialize)e
 (a)j(new)f(empt)m(y)h(FITS)e(\014le.)44 b(A)31 b(template)h(\014le)f
 (ma)m(y)h(also)g(b)s(e)f(sp)s(eci\014ed)f(to)i(de\014ne)f(the)227
-4719 y(structure)f(of)h(the)f(new)g(\014le)g(\(see)h(secion)f(4.2.4\).)
-382 4968 y Fe(FTINIT\(unit,filename,blo)o(cks)o(ize,)41
-b(>)48 b(status\))0 5216 y Fh(4)81 b Fi(Close)30 b(a)g(FITS)g(\014le)f
+1162 y(structure)f(of)h(the)f(new)g(\014le)g(\(see)h(section)f
+(4.2.4\).)382 1430 y Fe(FTINIT\(unit,filename,blo)o(cks)o(ize,)41
+b(>)48 b(status\))0 1699 y Fh(5)81 b Fi(Close)30 b(a)g(FITS)g(\014le)f
 (previously)f(op)s(ened)i(with)f(ftop)s(en)h(or)g(ftinit)382
-5465 y Fe(FTCLOS\(unit,)44 b(>)k(status\))0 5714 y Fh(5)81
+1967 y Fe(FTCLOS\(unit,)44 b(>)k(status\))0 2235 y Fh(6)81
 b Fi(Mo)m(v)m(e)32 b(to)f(a)g(sp)s(eci\014ed)e(\(absolute\))h(HDU)h(in)
 f(the)g(FITS)g(\014le)f(\(nhdu)g(=)h(1)h(for)f(the)g(FITS)g(primary)e
-(arra)m(y\))p eop
-%%Page: 57 63
-57 62 bop 0 299 a Fg(7.3.)72 b(KEYW)m(ORD)31 b(I/O)f(R)m(OUTINES)2406
-b Fi(57)382 555 y Fe(FTMAHD\(unit,nhdu,)43 b(>)k(hdutype,status\))0
-800 y Fh(6)81 b Fi(Create)30 b(a)f(primary)e(arra)m(y)j(\(if)f(none)g
-(already)f(exists\),)i(or)f(insert)f(a)i(new)f(IMA)m(GE)h(extension)f
-(immediately)227 913 y(follo)m(wing)37 b(the)h(CHDU.)h(An)m(y)f(follo)m
-(wing)f(extensions)h(will)d(b)s(e)j(shifted)e(do)m(wn)i(to)h(mak)m(e)g
-(ro)s(om)f(for)g(the)227 1025 y(new)32 b(extension.)46
-b(If)32 b(there)h(are)f(no)h(other)f(follo)m(wing)f(extensions)h(then)g
-(the)g(new)g(image)h(extension)f(will)227 1138 y(simply)c(b)s(e)i(app)s
-(ended)f(to)i(the)f(end)g(of)g(the)h(\014le.)40 b(The)30
-b(new)g(extension)g(will)d(b)s(ecome)k(the)g(CHDU.)382
-1383 y Fe(FTIIMG\(unit,bitpix,naxis)o(,na)o(xes,)41 b(>)48
-b(status\))0 1627 y Fh(7)81 b Fi(Insert)30 b(a)i(new)f(ASCI)s(I)f(T)-8
-b(ABLE)31 b(extension)g(immediately)f(follo)m(wing)f(the)j(CHDU.)g(An)m
-(y)f(follo)m(wing)f(exten-)227 1740 y(sions)25 b(will)e(b)s(e)i
-(shifted)f(do)m(wn)h(to)h(mak)m(e)h(ro)s(om)e(for)h(the)f(new)g
-(extension.)39 b(If)25 b(there)h(are)g(no)g(other)f(follo)m(wing)227
-1853 y(extensions)31 b(then)g(the)h(new)f(table)g(extension)g(will)e
-(simply)g(b)s(e)i(app)s(ended)f(to)i(the)f(end)g(of)h(the)f(\014le.)43
-b(The)227 1966 y(new)30 b(extension)g(will)e(b)s(ecome)j(the)f(CHDU.)
-382 2210 y Fe(FTITAB\(unit,rowlen,nrows)o(,tf)o(ield)o(s,tt)o(ype)o
-(,tbc)o(ol,t)o(for)o(m,tu)o(nit,)o(ext)o(name)o(,)42
-b(>)716 2323 y(status\))0 2568 y Fh(8)81 b Fi(Insert)26
-b(a)h(new)g(binary)e(table)h(extension)h(immediately)e(follo)m(wing)h
-(the)h(CHDU.)g(An)m(y)g(follo)m(wing)e(extensions)227
-2681 y(will)36 b(b)s(e)i(shifted)f(do)m(wn)h(to)h(mak)m(e)g(ro)s(om)g
-(for)f(the)g(new)g(extension.)65 b(If)38 b(there)h(are)f(no)h(other)f
-(follo)m(wing)227 2794 y(extensions)e(then)h(the)f(new)g(bin)m(table)f
-(extension)i(will)d(simply)g(b)s(e)i(app)s(ended)e(to)k(the)e(end)g(of)
-h(the)g(\014le.)227 2906 y(The)30 b(new)g(extension)g(will)e(b)s(ecome)
-j(the)f(CHDU.)382 3151 y Fe(FTIBIN\(unit,nrows,tfield)o(s,t)o(type)o
-(,tfo)o(rm,)o(tuni)o(t,ex)o(tna)o(me,v)o(arid)o(at)41
-b(>)48 b(status\))0 3482 y Fd(7.3)135 b(Keyw)l(ord)46
-b(I/O)f(Routines)0 3720 y Fh(1)81 b Fi(Put)30 b(\(app)s(end\))f(an)h
-(80-c)m(haracter)j(record)e(in)m(to)f(the)h(CHU.)382
-3964 y Fe(FTPREC\(unit,card,)43 b(>)k(status\))0 4209
-y Fh(2)81 b Fi(Put)28 b(\(app)s(end\))g(a)h(new)g(k)m(eyw)m(ord)g(of)g
-(the)g(appropriate)f(datat)m(yp)s(e)i(in)m(to)f(the)g(CHU.)g(The)f(E)h
-(and)f(D)i(v)m(ersions)227 4322 y(of)24 b(this)e(routine)g(ha)m(v)m(e)i
-(the)g(added)e(feature)i(that)g(if)e(the)h('decimals')g(parameter)h(is)
-e(negativ)m(e,)k(then)d(the)g('G')227 4435 y(displa)m(y)28
-b(format)i(rather)f(then)g(the)h('E')f(format)h(will)d(b)s(e)i(used)f
-(when)h(constructing)g(the)g(k)m(eyw)m(ord)h(v)-5 b(alue,)227
-4548 y(taking)26 b(the)h(absolute)f(v)-5 b(alue)25 b(of)i('decimals')e
-(for)h(the)h(precision.)37 b(This)25 b(will)e(suppress)h(trailing)h
-(zeros,)j(and)227 4660 y(will)34 b(use)j(a)g(\014xed)f(format)h(rather)
-g(than)f(an)h(exp)s(onen)m(tial)e(format,)k(dep)s(ending)34
-b(on)j(the)g(magnitude)f(of)227 4773 y(the)31 b(v)-5
-b(alue.)382 5018 y Fe(FTPKY[JLS]\(unit,keyword,)o(key)o(val,)o(comm)o
-(ent)o(,)42 b(>)47 b(status\))382 5131 y(FTPKY[EDFG]\(unit,keyword)o
-(,ke)o(yval)o(,dec)o(ima)o(ls,c)o(omme)o(nt,)41 b(>)48
-b(status\))0 5375 y Fh(3)81 b Fi(Get)37 b(the)f(n)m(th)f(80-c)m
-(haracter)k(header)d(record)g(from)f(the)h(CHU.)h(The)e(\014rst)g(k)m
-(eyw)m(ord)i(in)d(the)i(header)g(is)f(at)227 5488 y(k)m(ey)p
-365 5488 28 4 v 34 w(no)42 b(=)f(1;)49 b(if)41 b(k)m(ey)p
-996 5488 V 34 w(no)h(=)f(0)i(then)e(this)g(subroutine)f(simple)g(mo)m
-(v)m(es)k(the)e(in)m(ternal)f(p)s(oin)m(ter)g(to)i(the)227
-5601 y(b)s(eginning)33 b(of)j(the)g(header)f(so)h(that)g(subsequen)m(t)
-f(k)m(eyw)m(ord)h(op)s(erations)f(will)e(start)j(at)g(the)g(top)g(of)g
-(the)227 5714 y(header;)31 b(it)f(also)g(returns)f(a)i(blank)e(card)h
-(v)-5 b(alue)30 b(in)f(this)g(case.)p eop
-%%Page: 58 64
-58 63 bop 0 299 a Fi(58)1747 b Fg(CHAPTER)30 b(7.)111
-b(BASIC)30 b(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)382
-555 y Fe(FTGREC\(unit,key_no,)42 b(>)48 b(card,status\))0
-804 y Fh(4)81 b Fi(Get)31 b(a)g(k)m(eyw)m(ord)g(v)-5
-b(alue)29 b(\(with)h(the)g(appropriate)g(datat)m(yp)s(e\))h(and)f
-(commen)m(t)i(from)e(the)g(CHU)382 1052 y Fe(FTGKY[EDJLS]\(unit,keywor)
-o(d,)41 b(>)48 b(keyval,comment,status\))0 1301 y Fh(5)81
-b Fi(Delete)31 b(an)f(existing)g(k)m(eyw)m(ord)h(record.)382
-1550 y Fe(FTDKEY\(unit,keyword,)42 b(>)48 b(status\))0
-1881 y Fd(7.4)135 b(Data)46 b(I/O)g(Routines)0 2132 y
-Fi(The)32 b(follo)m(wing)f(routines)g(read)i(or)f(write)g(data)h(v)-5
-b(alues)32 b(in)f(the)i(curren)m(t)f(HDU)i(of)e(the)h(FITS)f(\014le.)46
-b(Automatic)0 2245 y(datat)m(yp)s(e)28 b(con)m(v)m(ersion)g(will)c(b)s
-(e)j(attempted)h(for)g(n)m(umerical)d(datat)m(yp)s(es)k(if)d(the)h(sp)s
-(eci\014ed)f(datat)m(yp)s(e)i(is)e(di\013eren)m(t)0 2357
-y(from)k(the)g(actual)h(datat)m(yp)s(e)h(of)e(the)h(FITS)e(arra)m(y)i
-(or)f(table)h(column.)0 2606 y Fh(1)81 b Fi(W)-8 b(rite)30
-b(elemen)m(ts)h(in)m(to)f(the)h(primary)d(data)k(arra)m(y)e(or)h(image)
-f(extension.)382 2855 y Fe(FTPPR[BIJED]\(unit,group,)o(fpi)o(xel,)o
-(nele)o(men)o(ts,v)o(alue)o(s,)41 b(>)48 b(status\))0
-3103 y Fh(2)81 b Fi(Read)30 b(elemen)m(ts)i(from)e(the)h(primary)d
-(data)k(arra)m(y)f(or)g(image)g(extension.)41 b(Unde\014ned)29
-b(arra)m(y)j(elemen)m(ts)f(will)227 3216 y(b)s(e)g(returned)f(with)g(a)
-i(v)-5 b(alue)30 b(=)h(n)m(ullv)-5 b(al,)30 b(unless)f(n)m(ullv)-5
-b(al)29 b(=)i(0)h(in)e(whic)m(h)g(case)i(no)f(c)m(hec)m(ks)i(for)e
-(unde\014ned)227 3329 y(pixels)f(will)e(b)s(e)i(p)s(erformed.)42
-b(The)30 b(an)m(yf)i(parameter)f(is)f(set)i(to)g(true)f(\(=)g(.true.\))
-43 b(if)30 b(an)m(y)i(of)f(the)g(returned)227 3442 y(elemen)m(ts)g(w)m
-(ere)g(unde\014ned.)382 3691 y Fe(FTGPV[BIJED]\(unit,group,)o(fpi)o
-(xel,)o(nele)o(men)o(ts,n)o(ullv)o(al,)41 b(>)48 b
-(values,anyf,status\))0 3939 y Fh(3)81 b Fi(W)-8 b(rite)35
-b(elemen)m(ts)h(in)m(to)f(an)g(ASCI)s(I)e(or)i(binary)f(table)h
-(column.)53 b(The)35 b(`felem')g(parameter)h(applies)d(only)h(to)227
-4052 y(v)m(ector)e(columns)d(in)g(binary)g(tables)h(and)g(is)f(ignored)
-h(when)f(writing)g(to)i(ASCI)s(I)d(tables.)382 4301 y
-Fe(FTPCL[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o(ow,f)o(ele)o(m,ne)o(leme)o
-(nts)o(,val)o(ues,)41 b(>)47 b(status\))0 4549 y Fh(4)81
-b Fi(Read)22 b(elemen)m(ts)g(from)f(an)g(ASCI)s(I)g(or)g(binary)f
-(table)i(column.)37 b(Unde\014ned)20 b(arra)m(y)i(elemen)m(ts)g(will)d
-(b)s(e)i(returned)227 4662 y(with)31 b(a)i(v)-5 b(alue)32
-b(=)g(n)m(ullv)-5 b(al,)31 b(unless)g(n)m(ullv)-5 b(al)29
-b(=)k(0)f(\(or)h(=)f(')h(')f(for)g(ftgcvs\))i(in)d(whic)m(h)g(case)j
-(no)e(c)m(hec)m(king)h(for)227 4775 y(unde\014ned)23
+(arra)m(y\))382 2503 y Fe(FTMAHD\(unit,nhdu,)43 b(>)k(hdutype,status\))
+0 2772 y Fh(7)81 b Fi(Create)30 b(a)f(primary)e(arra)m(y)j(\(if)f(none)
+g(already)f(exists\),)i(or)f(insert)f(a)i(new)f(IMA)m(GE)h(extension)f
+(immediately)227 2885 y(follo)m(wing)22 b(the)h(CHDU,)g(or)g(insert)f
+(a)h(new)g(Primary)e(Arra)m(y)i(at)h(the)f(b)s(eginning)d(of)j(the)g
+(\014le.)37 b(An)m(y)23 b(follo)m(wing)227 2998 y(extensions)28
+b(in)g(the)h(\014le)e(will)f(b)s(e)i(shifted)g(do)m(wn)g(to)h(mak)m(e)h
+(ro)s(om)e(for)h(the)g(new)f(extension.)39 b(If)29 b(the)g(CHDU)227
+3110 y(is)g(the)h(last)f(HDU)h(in)f(the)g(\014le)g(then)g(the)h(new)f
+(image)h(extension)f(will)e(simply)g(b)s(e)i(app)s(ended)f(to)i(the)g
+(end)227 3223 y(of)k(the)h(\014le.)51 b(One)33 b(can)h(force)h(a)g(new)
+e(primary)f(arra)m(y)j(to)g(b)s(e)e(inserted)g(at)i(the)f(b)s(eginning)
+d(of)j(the)h(FITS)227 3336 y(\014le)29 b(b)m(y)g(setting)g(status)h(=)f
+(-9)h(prior)e(to)i(calling)d(the)j(routine.)39 b(In)29
+b(this)f(case)i(the)g(old)e(primary)g(arra)m(y)i(will)227
+3449 y(b)s(e)c(con)m(v)m(erted)j(to)e(an)g(IMA)m(GE)g(extension.)39
+b(The)27 b(new)f(extension)g(\(or)h(primary)e(arra)m(y\))j(will)c(b)s
+(ecome)j(the)227 3562 y(CHDU.)382 3830 y Fe(FTIIMG\(unit,bitpix,naxis)o
+(,na)o(xes,)41 b(>)48 b(status\))0 4099 y Fh(8)81 b Fi(Insert)30
+b(a)i(new)f(ASCI)s(I)f(T)-8 b(ABLE)31 b(extension)g(immediately)f
+(follo)m(wing)f(the)j(CHDU.)g(An)m(y)f(follo)m(wing)f(exten-)227
+4211 y(sions)25 b(will)e(b)s(e)i(shifted)f(do)m(wn)h(to)h(mak)m(e)h(ro)
+s(om)e(for)h(the)f(new)g(extension.)39 b(If)25 b(there)h(are)g(no)g
+(other)f(follo)m(wing)227 4324 y(extensions)31 b(then)g(the)h(new)f
+(table)g(extension)g(will)e(simply)g(b)s(e)i(app)s(ended)f(to)i(the)f
+(end)g(of)h(the)f(\014le.)43 b(The)227 4437 y(new)30
+b(extension)g(will)e(b)s(ecome)j(the)f(CHDU.)382 4706
+y Fe(FTITAB\(unit,rowlen,nrows)o(,tf)o(ield)o(s,tt)o(ype)o(,tbc)o(ol,t)
+o(for)o(m,tu)o(nit,)o(ext)o(name)o(,)42 b(>)716 4818
+y(status\))0 5087 y Fh(9)81 b Fi(Insert)26 b(a)h(new)g(binary)e(table)h
+(extension)h(immediately)e(follo)m(wing)h(the)h(CHDU.)g(An)m(y)g(follo)
+m(wing)e(extensions)227 5200 y(will)36 b(b)s(e)i(shifted)f(do)m(wn)h
+(to)h(mak)m(e)g(ro)s(om)g(for)f(the)g(new)g(extension.)65
+b(If)38 b(there)h(are)f(no)h(other)f(follo)m(wing)227
+5313 y(extensions)e(then)h(the)f(new)g(bin)m(table)f(extension)i(will)d
+(simply)g(b)s(e)i(app)s(ended)e(to)k(the)e(end)g(of)h(the)g(\014le.)227
+5425 y(The)30 b(new)g(extension)g(will)e(b)s(ecome)j(the)f(CHDU.)382
+5694 y Fe(FTIBIN\(unit,nrows,tfield)o(s,t)o(type)o(,tfo)o(rm,)o(tuni)o
+(t,ex)o(tna)o(me,v)o(arid)o(at)41 b(>)48 b(status\))p
+eop
+%%Page: 66 72
+66 71 bop 0 299 a Fi(66)1747 b Fg(CHAPTER)30 b(8.)111
+b(BASIC)30 b(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)0 555
+y Fd(8.3)135 b(Keyw)l(ord)46 b(I/O)f(Routines)0 808 y
+Fh(1)81 b Fi(Put)30 b(\(app)s(end\))f(an)h(80-c)m(haracter)j(record)e
+(in)m(to)f(the)h(CHU.)382 1084 y Fe(FTPREC\(unit,card,)43
+b(>)k(status\))0 1360 y Fh(2)81 b Fi(Put)28 b(\(app)s(end\))g(a)h(new)g
+(k)m(eyw)m(ord)g(of)g(the)g(appropriate)f(datat)m(yp)s(e)i(in)m(to)f
+(the)g(CHU.)g(The)f(E)h(and)f(D)i(v)m(ersions)227 1473
+y(of)24 b(this)e(routine)g(ha)m(v)m(e)i(the)g(added)e(feature)i(that)g
+(if)e(the)h('decimals')g(parameter)h(is)e(negativ)m(e,)k(then)d(the)g
+('G')227 1586 y(displa)m(y)28 b(format)i(rather)f(then)g(the)h('E')f
+(format)h(will)d(b)s(e)i(used)f(when)h(constructing)g(the)g(k)m(eyw)m
+(ord)h(v)-5 b(alue,)227 1698 y(taking)26 b(the)h(absolute)f(v)-5
+b(alue)25 b(of)i('decimals')e(for)h(the)h(precision.)37
+b(This)25 b(will)e(suppress)h(trailing)h(zeros,)j(and)227
+1811 y(will)34 b(use)j(a)g(\014xed)f(format)h(rather)g(than)f(an)h(exp)
+s(onen)m(tial)e(format,)k(dep)s(ending)34 b(on)j(the)g(magnitude)f(of)
+227 1924 y(the)31 b(v)-5 b(alue.)382 2200 y Fe
+(FTPKY[JLS]\(unit,keyword,)o(key)o(val,)o(comm)o(ent)o(,)42
+b(>)47 b(status\))382 2313 y(FTPKY[EDFG]\(unit,keyword)o(,ke)o(yval)o
+(,dec)o(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))0
+2589 y Fh(3)81 b Fi(Get)37 b(the)f(n)m(th)f(80-c)m(haracter)k(header)d
+(record)g(from)f(the)h(CHU.)h(The)e(\014rst)g(k)m(eyw)m(ord)i(in)d(the)
+i(header)g(is)f(at)227 2702 y(k)m(ey)p 365 2702 28 4
+v 34 w(no)42 b(=)f(1;)49 b(if)41 b(k)m(ey)p 996 2702
+V 34 w(no)h(=)f(0)i(then)e(this)g(subroutine)f(simple)g(mo)m(v)m(es)k
+(the)e(in)m(ternal)f(p)s(oin)m(ter)g(to)i(the)227 2815
+y(b)s(eginning)33 b(of)j(the)g(header)f(so)h(that)g(subsequen)m(t)f(k)m
+(eyw)m(ord)h(op)s(erations)f(will)e(start)j(at)g(the)g(top)g(of)g(the)
+227 2928 y(header;)31 b(it)f(also)g(returns)f(a)i(blank)e(card)h(v)-5
+b(alue)30 b(in)f(this)g(case.)382 3204 y Fe(FTGREC\(unit,key_no,)42
+b(>)48 b(card,status\))0 3480 y Fh(4)81 b Fi(Get)31 b(a)g(k)m(eyw)m
+(ord)g(v)-5 b(alue)29 b(\(with)h(the)g(appropriate)g(datat)m(yp)s(e\))h
+(and)f(commen)m(t)i(from)e(the)g(CHU)382 3756 y Fe
+(FTGKY[EDJLS]\(unit,keywor)o(d,)41 b(>)48 b(keyval,comment,status\))0
+4033 y Fh(5)81 b Fi(Delete)31 b(an)f(existing)g(k)m(eyw)m(ord)h
+(record.)382 4309 y Fe(FTDKEY\(unit,keyword,)42 b(>)48
+b(status\))0 4662 y Fd(8.4)135 b(Data)46 b(I/O)g(Routines)0
+4916 y Fi(The)32 b(follo)m(wing)f(routines)g(read)i(or)f(write)g(data)h
+(v)-5 b(alues)32 b(in)f(the)i(curren)m(t)f(HDU)i(of)e(the)h(FITS)f
+(\014le.)46 b(Automatic)0 5029 y(datat)m(yp)s(e)28 b(con)m(v)m(ersion)g
+(will)c(b)s(e)j(attempted)h(for)g(n)m(umerical)d(datat)m(yp)s(es)k(if)d
+(the)h(sp)s(eci\014ed)f(datat)m(yp)s(e)i(is)e(di\013eren)m(t)0
+5141 y(from)k(the)g(actual)h(datat)m(yp)s(e)h(of)e(the)h(FITS)e(arra)m
+(y)i(or)f(table)h(column.)0 5418 y Fh(1)81 b Fi(W)-8
+b(rite)30 b(elemen)m(ts)h(in)m(to)f(the)h(primary)d(data)k(arra)m(y)e
+(or)h(image)f(extension.)382 5694 y Fe(FTPPR[BIJED]\(unit,group,)o(fpi)
+o(xel,)o(nele)o(men)o(ts,v)o(alue)o(s,)41 b(>)48 b(status\))p
+eop
+%%Page: 67 73
+67 72 bop 0 299 a Fg(8.4.)72 b(D)m(A)-8 b(T)g(A)32 b(I/O)f(R)m(OUTINES)
+2650 b Fi(67)0 555 y Fh(2)81 b Fi(Read)30 b(elemen)m(ts)i(from)e(the)h
+(primary)d(data)k(arra)m(y)f(or)g(image)g(extension.)41
+b(Unde\014ned)29 b(arra)m(y)j(elemen)m(ts)f(will)227
+668 y(b)s(e)g(returned)f(with)g(a)i(v)-5 b(alue)30 b(=)h(n)m(ullv)-5
+b(al,)30 b(unless)f(n)m(ullv)-5 b(al)29 b(=)i(0)h(in)e(whic)m(h)g(case)
+i(no)f(c)m(hec)m(ks)i(for)e(unde\014ned)227 781 y(pixels)f(will)e(b)s
+(e)i(p)s(erformed.)42 b(The)30 b(an)m(yf)i(parameter)f(is)f(set)i(to)g
+(true)f(\(=)g(.true.\))43 b(if)30 b(an)m(y)i(of)f(the)g(returned)227
+894 y(elemen)m(ts)g(w)m(ere)g(unde\014ned.)382 1151 y
+Fe(FTGPV[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o(men)o(ts,n)o(ullv)o
+(al,)41 b(>)48 b(values,anyf,status\))0 1408 y Fh(3)81
+b Fi(W)-8 b(rite)35 b(elemen)m(ts)h(in)m(to)f(an)g(ASCI)s(I)e(or)i
+(binary)f(table)h(column.)53 b(The)35 b(`felem')g(parameter)h(applies)d
+(only)h(to)227 1521 y(v)m(ector)e(columns)d(in)g(binary)g(tables)h(and)
+g(is)f(ignored)h(when)f(writing)g(to)i(ASCI)s(I)d(tables.)382
+1779 y Fe(FTPCL[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o(ow,f)o(ele)o(m,ne)o
+(leme)o(nts)o(,val)o(ues,)41 b(>)47 b(status\))0 2036
+y Fh(4)81 b Fi(Read)22 b(elemen)m(ts)g(from)f(an)g(ASCI)s(I)g(or)g
+(binary)f(table)i(column.)37 b(Unde\014ned)20 b(arra)m(y)i(elemen)m(ts)
+g(will)d(b)s(e)i(returned)227 2149 y(with)31 b(a)i(v)-5
+b(alue)32 b(=)g(n)m(ullv)-5 b(al,)31 b(unless)g(n)m(ullv)-5
+b(al)29 b(=)k(0)f(\(or)h(=)f(')h(')f(for)g(ftgcvs\))i(in)d(whic)m(h)g
+(case)j(no)e(c)m(hec)m(king)h(for)227 2262 y(unde\014ned)23
 b(v)-5 b(alues)24 b(will)e(b)s(e)j(p)s(erformed.)37 b(The)24
 b(ANYF)i(parameter)f(is)f(set)i(to)f(true)g(if)f(an)m(y)h(of)g(the)g
-(returned)227 4888 y(elemen)m(ts)31 b(are)g(unde\014ned.)227
-5036 y(An)m(y)d(column,)g(regardless)f(of)h(it's)g(in)m(trinsic)d
+(returned)227 2375 y(elemen)m(ts)31 b(are)g(unde\014ned.)227
+2524 y(An)m(y)d(column,)g(regardless)f(of)h(it's)g(in)m(trinsic)d
 (datat)m(yp)s(e,)30 b(ma)m(y)e(b)s(e)f(read)h(as)g(a)h(string.)39
-b(It)28 b(should)d(b)s(e)j(noted)227 5149 y(ho)m(w)m(ev)m(er)k(that)f
+b(It)28 b(should)d(b)s(e)j(noted)227 2637 y(ho)m(w)m(ev)m(er)k(that)f
 (reading)e(a)i(n)m(umeric)e(column)g(as)i(a)g(string)e(is)g(10)j(-)e
 (100)i(times)e(slo)m(w)m(er)g(than)g(reading)g(the)227
-5262 y(same)36 b(column)e(as)i(a)g(n)m(um)m(b)s(er)e(due)g(to)j(the)e
+2750 y(same)36 b(column)e(as)i(a)g(n)m(um)m(b)s(er)e(due)g(to)j(the)e
 (large)h(o)m(v)m(erhead)g(in)e(constructing)h(the)h(formatted)g
-(strings.)227 5375 y(The)i(displa)m(y)e(format)i(of)g(the)g(returned)f
+(strings.)227 2863 y(The)i(displa)m(y)e(format)i(of)g(the)g(returned)f
 (strings)f(will)f(b)s(e)j(determined)e(b)m(y)i(the)g(TDISPn)f(k)m(eyw)m
-(ord,)j(if)227 5488 y(it)c(exists,)h(otherwise)f(b)m(y)g(the)g(datat)m
+(ord,)j(if)227 2976 y(it)c(exists,)h(otherwise)f(b)m(y)g(the)g(datat)m
 (yp)s(e)h(of)f(the)h(column.)56 b(The)36 b(length)f(of)i(the)f
-(returned)f(strings)g(can)227 5601 y(b)s(e)29 b(determined)e(with)h
+(returned)f(strings)g(can)227 3089 y(b)s(e)29 b(determined)e(with)h
 (the)h(ftgcdw)g(routine.)39 b(The)28 b(follo)m(wing)g(TDISPn)f(displa)m
-(y)h(formats)h(are)g(curren)m(tly)227 5714 y(supp)s(orted:)p
-eop
-%%Page: 59 65
-59 64 bop 0 299 a Fg(7.4.)72 b(D)m(A)-8 b(T)g(A)32 b(I/O)f(R)m(OUTINES)
-2650 b Fi(59)418 555 y Fe(Iw.m)142 b(Integer)418 668
-y(Ow.m)g(Octal)47 b(integer)418 781 y(Zw.m)142 b(Hexadecimal)45
-b(integer)418 894 y(Fw.d)142 b(Fixed)47 b(floating)e(point)418
-1007 y(Ew.d)142 b(Exponential)45 b(floating)h(point)418
-1120 y(Dw.d)142 b(Exponential)45 b(floating)h(point)418
-1233 y(Gw.d)142 b(General;)46 b(uses)g(Fw.d)h(if)g(significance)e(not)i
-(lost,)f(else)h(Ew.d)227 1483 y Fi(where)24 b(w)h(is)e(the)i(width)e
+(y)h(formats)h(are)g(curren)m(tly)227 3202 y(supp)s(orted:)418
+3449 y Fe(Iw.m)142 b(Integer)418 3562 y(Ow.m)g(Octal)47
+b(integer)418 3675 y(Zw.m)142 b(Hexadecimal)45 b(integer)418
+3788 y(Fw.d)142 b(Fixed)47 b(floating)e(point)418 3900
+y(Ew.d)142 b(Exponential)45 b(floating)h(point)418 4013
+y(Dw.d)142 b(Exponential)45 b(floating)h(point)418 4126
+y(Gw.d)142 b(General;)46 b(uses)g(Fw.d)h(if)g(significance)e(not)i
+(lost,)f(else)h(Ew.d)227 4373 y Fi(where)24 b(w)h(is)e(the)i(width)e
 (in)g(c)m(haracters)j(of)f(the)g(displa)m(y)m(ed)e(v)-5
 b(alues,)26 b(m)e(is)g(the)g(minim)m(um)e(n)m(um)m(b)s(er)i(of)g
-(digits)227 1595 y(displa)m(y)m(ed,)29 b(and)g(d)h(is)e(the)j(n)m(um)m
+(digits)227 4486 y(displa)m(y)m(ed,)29 b(and)g(d)h(is)e(the)j(n)m(um)m
 (b)s(er)d(of)i(digits)e(to)j(the)f(righ)m(t)g(of)g(the)g(decimal.)39
-b(The)29 b(.m)h(\014eld)f(is)g(optional.)382 1855 y Fe
+b(The)29 b(.m)h(\014eld)f(is)g(optional.)382 4743 y Fe
 (FTGCV[SBIJEDCM]\(unit,col)o(num)o(,fro)o(w,fe)o(lem)o(,nel)o(emen)o
-(ts,)o(null)o(val,)41 b(>)1098 1968 y(values,anyf,status\))0
-2228 y Fh(5)81 b Fi(Get)42 b(the)g(table)g(column)e(n)m(um)m(b)s(er)h
+(ts,)o(null)o(val,)41 b(>)1098 4856 y(values,anyf,status\))0
+5114 y Fh(5)81 b Fi(Get)42 b(the)g(table)g(column)e(n)m(um)m(b)s(er)h
 (and)g(full)e(name)j(of)g(the)f(column)g(whose)g(name)h(matc)m(hes)h
-(the)f(input)227 2341 y(template)34 b(string.)47 b(See)33
+(the)f(input)227 5226 y(template)34 b(string.)47 b(See)33
 b(the)h(`Adv)-5 b(anced)33 b(In)m(terface)h(Routines')e(c)m(hapter)i
-(for)f(a)g(full)e(description)g(of)i(this)227 2454 y(routine.)382
-2714 y Fe(FTGCNN\(unit,casesen,colt)o(emp)o(late)o(,)42
+(for)f(a)g(full)e(description)g(of)i(this)227 5339 y(routine.)382
+5597 y Fe(FTGCNN\(unit,casesen,colt)o(emp)o(late)o(,)42
 b(>)47 b(colname,colnum,status\))p eop
-%%Page: 60 66
-60 65 bop 0 299 a Fi(60)1747 b Fg(CHAPTER)30 b(7.)111
+%%Page: 68 74
+68 73 bop 0 299 a Fi(68)1747 b Fg(CHAPTER)30 b(8.)111
 b(BASIC)30 b(INTERF)-10 b(A)m(CE)30 b(R)m(OUTINES)p eop
-%%Page: 61 67
-61 66 bop 0 1225 a Ff(Chapter)65 b(8)0 1687 y Fl(Adv)-13
+%%Page: 69 75
+69 74 bop 0 1225 a Ff(Chapter)65 b(9)0 1687 y Fl(Adv)-13
 b(anced)78 b(In)-6 b(terface)77 b(Subroutines)0 2180
 y Fi(This)30 b(c)m(hapter)i(de\014nes)f(all)f(the)i(a)m(v)-5
 b(ailable)31 b(subroutines)f(in)g(the)i(FITSIO)e(user)h(in)m(terface.)
-45 b(F)-8 b(or)33 b(completeness,)0 2293 y(the)22 b(basic)g
-(subroutines)e(describ)s(ed)g(in)h(the)i(previous)d(c)m(hapter)j(are)g
-(also)f(rep)s(eated)h(here.)38 b(A)22 b(righ)m(t)g(arro)m(w)g(sym)m(b)s
-(ol)0 2406 y(is)28 b(used)g(here)h(to)h(separate)g(the)f(input)e
-(parameters)j(from)e(the)i(output)e(parameters)i(in)e(the)h
-(de\014nition)e(of)i(eac)m(h)0 2518 y(subroutine.)68
-b(This)39 b(sym)m(b)s(ol)g(is)g(not)i(actually)f(part)g(of)h(the)f
-(calling)f(sequence.)71 b(An)40 b(alphab)s(etical)f(list)g(and)0
-2631 y(de\014nition)30 b(of)i(all)g(the)g(parameters)h(is)e(giv)m(en)h
-(at)h(the)g(end)f(of)g(this)f(section.)47 b(The)32 b(SPP)f(in)m
-(terface)i(subroutines)0 2744 y(ha)m(v)m(e)f(the)e(same)h(argumen)m(ts)
-g(but)e(ha)m(v)m(e)j(names)e(that)h(b)s(egin)e(with)g('fs')i(rather)f
-(than)g('ft'.)0 3076 y Fd(8.1)135 b(FITS)44 b(File)i(Op)t(en)e(and)h
-(Close)h(Subroutines:)0 3315 y Fh(1)81 b Fi(Op)s(en)29
-b(an)h(existing)f(FITS)h(\014le)f(with)g(readonly)h(or)g(readwrite)g
-(access)382 3564 y Fe(FTOPEN\(unit,filename,rwm)o(ode)o(,)42
-b(>)47 b(blocksize,status\))0 3813 y Fh(2)81 b Fi(Op)s(en)24
-b(an)i(existing)f(FITS)g(\014le)g(with)f(readonly)h(or)h(readwrite)f
-(access)i(and)f(mo)m(v)m(e)h(to)f(a)h(follo)m(wing)d(extension,)227
-3926 y(if)37 b(one)h(w)m(as)g(sp)s(eci\014ed)f(as)h(part)f(of)h(the)h
+45 b(F)-8 b(or)33 b(completeness,)0 2293 y(the)43 b(basic)f
+(subroutines)e(describ)s(ed)g(in)i(the)g(previous)g(c)m(hapter)h(are)g
+(also)f(rep)s(eated)h(here.)77 b(A)43 b(righ)m(t)f(arro)m(w)0
+2406 y(sym)m(b)s(ol)28 b(is)f(used)h(here)h(to)g(separate)h(the)f
+(input)e(parameters)i(from)f(the)h(output)g(parameters)g(in)e(the)i
+(de\014nition)0 2518 y(of)k(eac)m(h)h(subroutine.)46
+b(This)31 b(sym)m(b)s(ol)h(is)g(not)h(actually)g(part)f(of)h(the)h
+(calling)d(sequence.)49 b(An)32 b(alphab)s(etical)f(list)0
+2631 y(and)f(de\014nition)e(of)i(all)g(the)g(parameters)h(is)e(giv)m
+(en)i(at)g(the)f(end)g(of)h(this)e(section.)0 2961 y
+Fd(9.1)135 b(FITS)44 b(File)i(Op)t(en)e(and)h(Close)h(Subroutines:)0
+3197 y Fh(1)81 b Fi(Op)s(en)39 b(an)h(existing)f(FITS)h(\014le)f(with)g
+(readonly)h(or)g(readwrite)g(access.)72 b(FTDOPN)41 b(also)f(mo)m(v)m
+(es)i(to)f(the)227 3310 y(\014rst)30 b(HDU)h(con)m(taining)f
+(signi\014can)m(t)f(data,)j(if)d(no)h(sp)s(eci\014c)f(HDU)i(is)f(sp)s
+(eci\014ed)f(as)h(part)g(of)h(the)f(\014lename.)227 3423
+y(FTTOPN)39 b(and)h(FTIOPN)f(are)h(similar)d(except)k(that)g(they)f
+(will)d(mo)m(v)m(e)k(to)g(the)f(\014rst)f(table)g(HDU)i(or)227
+3536 y(image)31 b(HDU,)g(resp)s(ectiv)m(ely)-8 b(,)31
+b(if)e(a)i(HDU)g(name)f(or)h(n)m(um)m(b)s(er)e(is)g(not)i(sp)s
+(eci\014ed)d(as)j(part)f(of)h(the)f(\014lename.)382 3770
+y Fe(FTOPEN\(unit,filename,rwm)o(ode)o(,)42 b(>)47 b
+(blocksize,status\))382 3883 y(FTDOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))382 3996 y(FTTOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))382 4108 y(FTIOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))0 4343 y Fh(2)81 b Fi(Op)s(en)24 b(an)i(existing)f
+(FITS)g(\014le)g(with)f(readonly)h(or)h(readwrite)f(access)i(and)f(mo)m
+(v)m(e)h(to)f(a)h(follo)m(wing)d(extension,)227 4455
+y(if)37 b(one)h(w)m(as)g(sp)s(eci\014ed)f(as)h(part)f(of)h(the)h
 (\014lename.)62 b(\(e.g.,)42 b('\014lename.\014ts+2')37
-b(or)h('\014lename.\014ts[2]')h(will)227 4039 y(mo)m(v)m(e)f(to)g(the)e
+b(or)h('\014lename.\014ts[2]')h(will)227 4568 y(mo)m(v)m(e)f(to)g(the)e
 (3rd)g(HDU)i(in)d(the)i(\014le\).)59 b(Note)37 b(that)h(this)d(routine)
-h(di\013ers)f(from)h(FTOPEN)g(in)f(that)i(it)227 4152
+h(di\013ers)f(from)h(FTOPEN)g(in)f(that)i(it)227 4681
 y(do)s(es)30 b(not)h(ha)m(v)m(e)h(the)e(redundan)m(t)f(blo)s(c)m(ksize)
-h(argumen)m(t.)382 4401 y Fe(FTNOPN\(unit,filename,rwm)o(ode)o(,)42
-b(>)47 b(status\))0 4651 y Fh(3)81 b Fi(Reop)s(en)38
+h(argumen)m(t.)382 4915 y Fe(FTNOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))0 5149 y Fh(3)81 b Fi(Reop)s(en)38
 b(a)i(FITS)e(\014le)h(that)g(w)m(as)h(previously)d(op)s(ened)h(with)g
-(FTOPEN,)h(FTNOPN,)g(or)h(FTINIT.)e(The)227 4764 y(newunit)e(n)m(um)m
+(FTOPEN,)h(FTNOPN,)g(or)h(FTINIT.)e(The)227 5262 y(newunit)e(n)m(um)m
 (b)s(er)g(ma)m(y)j(then)e(b)s(e)g(treated)i(as)f(a)g(separate)g
 (\014le,)h(and)e(one)h(ma)m(y)h(sim)m(ultaneously)c(read)227
-4877 y(or)h(write)f(to)h(2)g(\(or)g(more\))g(di\013eren)m(t)f
+5375 y(or)h(write)f(to)h(2)g(\(or)g(more\))g(di\013eren)m(t)f
 (extensions)g(in)f(the)i(same)g(\014le.)55 b(The)35 b(FTOPEN)g(and)g
-(FTNOPN)227 4989 y(routines)e(\(ab)s(o)m(v)m(e\))i(automatically)e
+(FTNOPN)227 5488 y(routines)e(\(ab)s(o)m(v)m(e\))i(automatically)e
 (detects)i(cases)g(where)e(a)g(previously)f(op)s(ened)g(\014le)h(is)g
-(b)s(eing)f(op)s(ened)227 5102 y(again,)c(and)f(then)g(in)m(ternally)e
+(b)s(eing)f(op)s(ened)227 5601 y(again,)c(and)f(then)g(in)m(ternally)e
 (call)h(FTREOPEN,)h(so)h(programs)e(should)g(rarely)g(need)h(to)h
-(explicitly)d(call)227 5215 y(this)30 b(routine.)334
-5465 y Fe(FTREOPEN\(unit,)44 b(>)j(newunit,)f(status\))0
-5714 y Fh(4)81 b Fi(Op)s(en)29 b(and)g(initialize)f(a)j(new)f(empt)m(y)
-g(FITS)g(\014le)1905 5942 y(61)p eop
-%%Page: 62 68
-62 67 bop 0 299 a Fi(62)1319 b Fg(CHAPTER)29 b(8.)112
+(explicitly)d(call)227 5714 y(this)30 b(routine.)1905
+5942 y(69)p eop
+%%Page: 70 76
+70 75 bop 0 299 a Fi(70)1319 b Fg(CHAPTER)29 b(9.)112
 b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)334
-555 y Fe(FTINIT\(unit,filename,bloc)o(ksi)o(ze,)41 b(>)48
-b(status\))0 824 y Fh(5)81 b Fi(Create)24 b(a)g(new)f(FITS)g(\014le,)h
-(using)e(a)i(template)g(\014le)e(to)j(de\014ne)d(its)h(initial)e(size)j
-(and)f(structure.)37 b(The)24 b(template)227 937 y(ma)m(y)39
-b(b)s(e)f(another)h(FITS)e(HDU)i(or)g(an)f(ASCI)s(I)f(template)i
-(\014le.)63 b(If)38 b(the)h(input)d(template)j(\014le)e(name)i(is)227
-1050 y(blank,)27 b(then)g(this)f(routine)g(b)s(eha)m(v)m(es)i(the)f
-(same)h(as)f(FTINIT.)g(The)f(curren)m(tly)h(supp)s(orted)e(format)i(of)
-h(the)227 1163 y(ASCI)s(I)c(template)i(\014le)f(is)f(describ)s(ed)g
-(under)g(the)i(\014ts)p 2037 1163 28 4 v 32 w(parse)p
-2277 1163 V 33 w(template)f(routine)g(\(in)g(the)g(general)h(Utilities)
-227 1276 y(section\),)31 b(but)f(this)f(ma)m(y)i(c)m(hange)h(sligh)m
-(tly)d(later)h(releases)g(of)h(CFITSIO.)334 1545 y Fe(FTTPLT\(unit,)45
-b(filename,)g(tplfilename,)f(>)k(status\))0 1813 y Fh(6)81
-b Fi(Flush)32 b(in)m(ternal)g(bu\013ers)h(of)h(data)g(to)g(the)g
-(output)g(FITS)f(\014le)g(previously)e(op)s(ened)i(with)f(ftop)s(en)i
-(or)f(ftinit.)227 1926 y(The)j(routine)g(usually)e(nev)m(er)j(needs)f
-(to)i(b)s(e)e(called,)h(but)f(doing)g(so)h(will)d(ensure)i(that)h(if)e
-(the)i(program)227 2039 y(subsequen)m(tly)29 b(ab)s(orts,)h(then)h(the)
-f(FITS)g(\014le)f(will)f(ha)m(v)m(e)k(at)f(least)f(b)s(een)g(closed)g
-(prop)s(erly)-8 b(.)382 2308 y Fe(FTFLUS\(unit,)44 b(>)k(status\))0
-2577 y Fh(7)81 b Fi(Close)30 b(a)g(FITS)g(\014le)f(previously)f(op)s
-(ened)i(with)f(ftop)s(en)h(or)g(ftinit)382 2846 y Fe(FTCLOS\(unit,)44
-b(>)k(status\))0 3115 y Fh(8)81 b Fi(Close)33 b(and)g(DELETE)g(a)h
+555 y Fe(FTREOPEN\(unit,)44 b(>)j(newunit,)f(status\))0
+804 y Fh(4)81 b Fi(Op)s(en)29 b(and)g(initialize)f(a)j(new)f(empt)m(y)g
+(FITS)g(\014le)334 1054 y Fe(FTINIT\(unit,filename,bloc)o(ksi)o(ze,)41
+b(>)48 b(status\))0 1303 y Fh(5)81 b Fi(Create)24 b(a)g(new)f(FITS)g
+(\014le,)h(using)e(a)i(template)g(\014le)e(to)j(de\014ne)d(its)h
+(initial)e(size)j(and)f(structure.)37 b(The)24 b(template)227
+1416 y(ma)m(y)39 b(b)s(e)f(another)h(FITS)e(HDU)i(or)g(an)f(ASCI)s(I)f
+(template)i(\014le.)63 b(If)38 b(the)h(input)d(template)j(\014le)e
+(name)i(is)227 1529 y(blank,)27 b(then)g(this)f(routine)g(b)s(eha)m(v)m
+(es)i(the)f(same)h(as)f(FTINIT.)g(The)f(curren)m(tly)h(supp)s(orted)e
+(format)i(of)h(the)227 1641 y(ASCI)s(I)c(template)i(\014le)f(is)f
+(describ)s(ed)g(under)g(the)i(\014ts)p 2037 1641 28 4
+v 32 w(parse)p 2277 1641 V 33 w(template)f(routine)g(\(in)g(the)g
+(general)h(Utilities)227 1754 y(section\),)31 b(but)f(this)f(ma)m(y)i
+(c)m(hange)h(sligh)m(tly)d(later)h(releases)g(of)h(CFITSIO.)334
+2004 y Fe(FTTPLT\(unit,)45 b(filename,)g(tplfilename,)f(>)k(status\))0
+2253 y Fh(6)81 b Fi(Flush)32 b(in)m(ternal)g(bu\013ers)h(of)h(data)g
+(to)g(the)g(output)g(FITS)f(\014le)g(previously)e(op)s(ened)i(with)f
+(ftop)s(en)i(or)f(ftinit.)227 2366 y(The)j(routine)g(usually)e(nev)m
+(er)j(needs)f(to)i(b)s(e)e(called,)h(but)f(doing)g(so)h(will)d(ensure)i
+(that)h(if)e(the)i(program)227 2479 y(subsequen)m(tly)29
+b(ab)s(orts,)h(then)h(the)f(FITS)g(\014le)f(will)f(ha)m(v)m(e)k(at)f
+(least)f(b)s(een)g(closed)g(prop)s(erly)-8 b(.)382 2728
+y Fe(FTFLUS\(unit,)44 b(>)k(status\))0 2977 y Fh(7)81
+b Fi(Close)30 b(a)g(FITS)g(\014le)f(previously)f(op)s(ened)i(with)f
+(ftop)s(en)h(or)g(ftinit)382 3226 y Fe(FTCLOS\(unit,)44
+b(>)k(status\))0 3475 y Fh(8)81 b Fi(Close)33 b(and)g(DELETE)g(a)h
 (FITS)f(\014le)g(previously)e(op)s(ened)i(with)f(ftop)s(en)h(or)h
 (ftinit.)49 b(This)32 b(routine)g(ma)m(y)j(b)s(e)227
-3228 y(useful)28 b(in)h(cases)h(where)g(a)g(FITS)f(\014le)f(is)h
+3588 y(useful)28 b(in)h(cases)h(where)g(a)g(FITS)f(\014le)f(is)h
 (created,)i(but)e(an)h(error)f(o)s(ccurs)h(whic)m(h)e(prev)m(en)m(ts)j
-(the)e(complete)227 3341 y(\014le)h(from)g(b)s(eing)f(written.)382
-3610 y Fe(FTDELT\(unit,)44 b(>)k(status\))0 3878 y Fh(9)81
+(the)e(complete)227 3701 y(\014le)h(from)g(b)s(eing)f(written.)382
+3950 y Fe(FTDELT\(unit,)44 b(>)k(status\))0 4199 y Fh(9)81
 b Fi(Get)31 b(the)g(v)-5 b(alue)30 b(of)g(an)g(un)m(used)g(I/O)g(unit)f
 (n)m(um)m(b)s(er)g(whic)m(h)g(ma)m(y)i(then)f(b)s(e)g(used)g(as)g
-(input)f(to)i(FTOPEN)f(or)227 3991 y(FTINIT.)36 b(This)e(routine)h
+(input)f(to)i(FTOPEN)f(or)227 4312 y(FTINIT.)36 b(This)e(routine)h
 (searc)m(hes)i(for)f(the)g(\014rst)f(un)m(used)g(unit)f(n)m(um)m(b)s
-(er)h(in)f(the)j(range)f(from)f(with)g(99)227 4104 y(do)m(wn)e(to)h
+(er)h(in)f(the)j(range)f(from)f(with)g(99)227 4425 y(do)m(wn)e(to)h
 (50.)50 b(This)31 b(routine)h(just)h(k)m(eeps)h(an)f(in)m(ternal)f
 (list)f(of)j(the)f(allo)s(cated)g(unit)f(n)m(um)m(b)s(ers)g(and)g(do)s
-(es)227 4217 y(not)26 b(ph)m(ysically)d(c)m(hec)m(k)j(that)g(the)g(F)-8
+(es)227 4538 y(not)26 b(ph)m(ysically)d(c)m(hec)m(k)j(that)g(the)g(F)-8
 b(ortran)25 b(unit)f(is)g(a)m(v)-5 b(ailable)25 b(\(to)h(b)s(e)f
-(compatible)f(with)g(the)h(SPP)f(v)m(ersion)227 4330
+(compatible)f(with)g(the)h(SPP)f(v)m(ersion)227 4651
 y(of)35 b(FITSIO\).)g(Th)m(us)f(users)g(m)m(ust)h(not)g(indep)s(enden)m
 (tly)d(allo)s(cate)j(an)m(y)h(unit)d(n)m(um)m(b)s(ers)h(in)g(the)h
-(range)g(50)227 4443 y(-)42 b(99)g(if)e(this)g(routine)g(is)g(also)h
+(range)g(50)227 4764 y(-)42 b(99)g(if)e(this)g(routine)g(is)g(also)h
 (to)h(b)s(e)f(used)f(in)g(the)h(same)h(program.)73 b(This)39
-b(routine)h(is)g(pro)m(vided)g(for)227 4556 y(con)m(v)m(enience)33
+b(routine)h(is)g(pro)m(vided)g(for)227 4877 y(con)m(v)m(enience)33
 b(only)-8 b(,)31 b(and)f(it)h(is)f(not)i(required)d(that)j(the)f(unit)f
 (n)m(um)m(b)s(ers)g(used)g(b)m(y)h(FITSIO)f(b)s(e)h(allo)s(cated)227
-4669 y(b)m(y)g(this)e(routine.)382 4938 y Fe(FTGIOU\()46
-b(>)h(iounit,)f(status\))0 5207 y Fh(10)g Fi(F)-8 b(ree)34
+4990 y(b)m(y)g(this)e(routine.)382 5239 y Fe(FTGIOU\()46
+b(>)h(iounit,)f(status\))0 5488 y Fh(10)g Fi(F)-8 b(ree)34
 b(\(deallo)s(cate\))g(an)f(I/O)g(unit)e(n)m(um)m(b)s(er)h(whic)m(h)f(w)
 m(as)i(previously)e(allo)s(cated)i(with)f(FTGIOU.)h(All)e(pre-)227
-5319 y(viously)26 b(allo)s(cated)i(unit)e(n)m(um)m(b)s(ers)g(ma)m(y)i
+5601 y(viously)26 b(allo)s(cated)i(unit)e(n)m(um)m(b)s(ers)g(ma)m(y)i
 (b)s(e)f(deallo)s(cated)h(at)g(once)h(b)m(y)e(calling)f(FTFIOU)i(with)e
-(iounit)g(=)227 5432 y(-1.)382 5701 y Fe(FTFIOU\(iounit,)44
-b(>)j(status\))p eop
-%%Page: 63 69
-63 68 bop 0 299 a Fg(8.1.)72 b(FITS)30 b(FILE)g(OPEN)g(AND)h(CLOSE)e
-(SUBR)m(OUTINES:)1561 b Fi(63)0 555 y Fh(11)46 b Fi(P)m(arse)32
-b(the)g(input)d(\014lename)i(and)g(return)f(the)i(HDU)g(n)m(um)m(b)s
-(er)e(that)i(w)m(ould)e(b)s(e)h(mo)m(v)m(ed)i(to)f(if)e(the)i(\014le)e
-(w)m(ere)227 668 y(op)s(ened)j(with)f(FTNOPN.)h(The)f(returned)g(HDU)i
-(n)m(um)m(b)s(er)e(b)s(egins)g(with)g(1)h(for)g(the)g(primary)f(arra)m
-(y)-8 b(,)35 b(so)227 781 y(for)d(example,)f(if)g(the)h(input)e
-(\014lename)g(=)i(`m)m(y\014le.\014ts[2]')g(then)f(hdun)m(um)e(=)j(3)g
-(will)d(b)s(e)i(returned.)43 b(FIT-)227 894 y(SIO)35
-b(do)s(es)h(not)g(op)s(en)g(the)g(\014le)f(to)i(c)m(hec)m(k)h(if)d(the)
-h(extension)g(actually)g(exists)f(if)h(an)f(extension)h(n)m(um)m(b)s
-(er)227 1007 y(is)42 b(sp)s(eci\014ed.)74 b(If)42 b(an)g(extension)g
-(*name*)h(is)e(included)f(in)h(the)h(\014le)f(name)i(sp)s
-(eci\014cation)e(\(e.g.)77 b(`m)m(y-)227 1120 y(\014le.\014ts[EVENTS]')
-29 b(then)g(this)g(routine)g(will)e(ha)m(v)m(e)k(to)f(op)s(en)f(the)h
-(FITS)f(\014le)g(and)g(lo)s(ok)g(for)h(the)g(p)s(osition)227
-1233 y(of)38 b(the)h(named)e(extension,)j(then)e(close)g(\014le)f
-(again.)63 b(This)37 b(is)g(not)h(p)s(ossible)d(if)i(the)h(\014le)f(is)
-g(b)s(eing)g(read)227 1346 y(from)f(the)g(stdin)e(stream,)k(and)d(an)h
-(error)f(will)e(b)s(e)j(returned)e(in)h(this)g(case.)58
-b(If)35 b(the)h(\014lename)f(do)s(es)h(not)227 1458 y(sp)s(ecify)28
-b(an)h(explicit)e(extension)i(\(e.g.)42 b('m)m(y\014le.\014ts'\))29
-b(then)g(hdun)m(um)e(=)h(-99)j(will)26 b(b)s(e)j(returned,)f(whic)m(h)g
-(is)227 1571 y(functionally)j(equiv)-5 b(alen)m(t)33
-b(to)i(hdun)m(um)c(=)i(1.)50 b(This)32 b(routine)g(is)h(mainly)f(used)g
-(for)i(bac)m(kw)m(ard)g(compati-)227 1684 y(bilit)m(y)d(in)g(the)h(fto)
-s(ols)g(soft)m(w)m(are)i(pac)m(k)-5 b(age)34 b(and)e(is)f(not)h
-(recommended)g(for)g(general)h(use.)46 b(It)32 b(is)g(generally)227
-1797 y(b)s(etter)j(and)g(more)g(e\016cien)m(t)g(to)h(\014rst)e(op)s(en)
-g(the)h(FITS)f(\014le)g(with)g(FTNOPN,)h(then)g(use)f(FTGHDN)i(to)227
-1910 y(determine)29 b(whic)m(h)g(HDU)h(in)e(the)i(\014le)f(has)h(b)s
-(een)f(op)s(ened,)g(rather)g(than)h(calling)e(FTEXTN)i(follo)m(w)m(ed)f
-(b)m(y)227 2023 y(a)i(call)f(to)h(FTNOPN.)382 2275 y
-Fe(FTEXTN\(filename,)43 b(>)48 b(nhdu,)e(status\))0 2528
-y Fh(12)g Fi(Return)30 b(the)g(name)h(of)f(the)h(op)s(ened)e(FITS)h
-(\014le.)382 2780 y Fe(FTFLNM\(unit,)44 b(>)k(filename,)d(status\))0
-3032 y Fh(13)h Fi(Return)30 b(the)g(I/O)g(mo)s(de)g(of)h(the)g(op)s(en)
+(iounit)g(=)227 5714 y(-1.)p eop
+%%Page: 71 77
+71 76 bop 0 299 a Fg(9.1.)72 b(FITS)30 b(FILE)g(OPEN)g(AND)h(CLOSE)e
+(SUBR)m(OUTINES:)1561 b Fi(71)382 555 y Fe(FTFIOU\(iounit,)44
+b(>)j(status\))0 807 y Fh(11)f Fi(P)m(arse)32 b(the)g(input)d
+(\014lename)i(and)g(return)f(the)i(HDU)g(n)m(um)m(b)s(er)e(that)i(w)m
+(ould)e(b)s(e)h(mo)m(v)m(ed)i(to)f(if)e(the)i(\014le)e(w)m(ere)227
+920 y(op)s(ened)j(with)f(FTNOPN.)h(The)f(returned)g(HDU)i(n)m(um)m(b)s
+(er)e(b)s(egins)g(with)g(1)h(for)g(the)g(primary)f(arra)m(y)-8
+b(,)35 b(so)227 1033 y(for)d(example,)f(if)g(the)h(input)e(\014lename)g
+(=)i(`m)m(y\014le.\014ts[2]')g(then)f(hdun)m(um)e(=)j(3)g(will)d(b)s(e)
+i(returned.)43 b(FIT-)227 1146 y(SIO)35 b(do)s(es)h(not)g(op)s(en)g
+(the)g(\014le)f(to)i(c)m(hec)m(k)h(if)d(the)h(extension)g(actually)g
+(exists)f(if)h(an)f(extension)h(n)m(um)m(b)s(er)227 1259
+y(is)42 b(sp)s(eci\014ed.)74 b(If)42 b(an)g(extension)g(*name*)h(is)e
+(included)f(in)h(the)h(\014le)f(name)i(sp)s(eci\014cation)e(\(e.g.)77
+b(`m)m(y-)227 1372 y(\014le.\014ts[EVENTS]')29 b(then)g(this)g(routine)
+g(will)e(ha)m(v)m(e)k(to)f(op)s(en)f(the)h(FITS)f(\014le)g(and)g(lo)s
+(ok)g(for)h(the)g(p)s(osition)227 1484 y(of)38 b(the)h(named)e
+(extension,)j(then)e(close)g(\014le)f(again.)63 b(This)37
+b(is)g(not)h(p)s(ossible)d(if)i(the)h(\014le)f(is)g(b)s(eing)g(read)227
+1597 y(from)f(the)g(stdin)e(stream,)k(and)d(an)h(error)f(will)e(b)s(e)j
+(returned)e(in)h(this)g(case.)58 b(If)35 b(the)h(\014lename)f(do)s(es)h
+(not)227 1710 y(sp)s(ecify)28 b(an)h(explicit)e(extension)i(\(e.g.)42
+b('m)m(y\014le.\014ts'\))29 b(then)g(hdun)m(um)e(=)h(-99)j(will)26
+b(b)s(e)j(returned,)f(whic)m(h)g(is)227 1823 y(functionally)j(equiv)-5
+b(alen)m(t)33 b(to)i(hdun)m(um)c(=)i(1.)50 b(This)32
+b(routine)g(is)h(mainly)f(used)g(for)i(bac)m(kw)m(ard)g(compati-)227
+1936 y(bilit)m(y)d(in)g(the)h(fto)s(ols)g(soft)m(w)m(are)i(pac)m(k)-5
+b(age)34 b(and)e(is)f(not)h(recommended)g(for)g(general)h(use.)46
+b(It)32 b(is)g(generally)227 2049 y(b)s(etter)j(and)g(more)g(e\016cien)
+m(t)g(to)h(\014rst)e(op)s(en)g(the)h(FITS)f(\014le)g(with)g(FTNOPN,)h
+(then)g(use)f(FTGHDN)i(to)227 2162 y(determine)29 b(whic)m(h)g(HDU)h
+(in)e(the)i(\014le)f(has)h(b)s(een)f(op)s(ened,)g(rather)g(than)h
+(calling)e(FTEXTN)i(follo)m(w)m(ed)f(b)m(y)227 2275 y(a)i(call)f(to)h
+(FTNOPN.)382 2527 y Fe(FTEXTN\(filename,)43 b(>)48 b(nhdu,)e(status\))0
+2778 y Fh(12)g Fi(Return)30 b(the)g(name)h(of)f(the)h(op)s(ened)e(FITS)
+h(\014le.)382 3030 y Fe(FTFLNM\(unit,)44 b(>)k(filename,)d(status\))0
+3282 y Fh(13)h Fi(Return)30 b(the)g(I/O)g(mo)s(de)g(of)h(the)g(op)s(en)
 e(FITS)h(\014le)f(\(READONL)-8 b(Y)32 b(=)e(0,)h(READ)m(WRITE)g(=)f
-(1\).)382 3284 y Fe(FTFLMD\(unit,)44 b(>)k(iomode,)e(status\))0
-3537 y Fh(14)g Fi(Return)30 b(the)g(\014le)g(t)m(yp)s(e)g(of)h(the)f
+(1\).)382 3534 y Fe(FTFLMD\(unit,)44 b(>)k(iomode,)e(status\))0
+3786 y Fh(14)g Fi(Return)30 b(the)g(\014le)g(t)m(yp)s(e)g(of)h(the)f
 (op)s(ened)g(FITS)g(\014le)f(\(e.g.)42 b('\014le://',)31
-b('ftp://',)h(etc.\).)382 3789 y Fe(FTURLT\(unit,)44
-b(>)k(urltype,)d(status\))0 4041 y Fh(15)h Fi(P)m(arse)27
+b('ftp://',)h(etc.\).)382 4037 y Fe(FTURLT\(unit,)44
+b(>)k(urltype,)d(status\))0 4289 y Fh(15)h Fi(P)m(arse)27
 b(the)f(input)e(\014lename)i(or)g(URL)g(in)m(to)g(its)g(comp)s(onen)m
 (t)g(parts:)39 b(the)26 b(\014le)f(t)m(yp)s(e)i(\(\014le://,)g(ftp://,)
-h(h)m(ttp://,)227 4154 y(etc\),)34 b(the)e(base)g(input)d(\014le)i
+h(h)m(ttp://,)227 4402 y(etc\),)34 b(the)e(base)g(input)d(\014le)i
 (name,)h(the)g(name)g(of)g(the)g(output)f(\014le)g(that)h(the)g(input)e
-(\014le)g(is)h(to)h(b)s(e)f(copied)227 4267 y(to)38 b(prior)d(to)i(op)s
+(\014le)g(is)h(to)h(b)s(e)f(copied)227 4515 y(to)38 b(prior)d(to)i(op)s
 (ening,)g(the)g(HDU)g(or)f(extension)h(sp)s(eci\014cation,)g(the)g
-(\014ltering)d(sp)s(eci\014er,)j(the)g(binning)227 4380
+(\014ltering)d(sp)s(eci\014er,)j(the)g(binning)227 4628
 y(sp)s(eci\014er,)d(and)f(the)i(column)e(sp)s(eci\014er.)50
 b(Blank)33 b(strings)g(will)f(b)s(e)h(returned)g(for)h(an)m(y)g(comp)s
-(onen)m(ts)g(that)227 4493 y(are)d(not)g(presen)m(t)f(in)f(the)i(input)
-d(\014le)i(name.)334 4745 y Fe(FTIURL\(filename,)43 b(>)48
+(onen)m(ts)g(that)227 4741 y(are)d(not)g(presen)m(t)f(in)f(the)i(input)
+d(\014le)i(name.)334 4993 y Fe(FTIURL\(filename,)43 b(>)48
 b(filetype,)d(infile,)h(outfile,)g(extspec,)f(filter,)716
-4858 y(binspec,)g(colspec,)h(status\))0 5110 y Fh(16)g
+5106 y(binspec,)g(colspec,)h(status\))0 5357 y Fh(16)g
 Fi(P)m(arse)e(the)g(input)e(\014le)h(name)g(and)g(return)g(the)h(ro)s
 (ot)g(\014le)e(name.)81 b(The)43 b(ro)s(ot)h(name)g(includes)d(the)j
-(\014le)227 5223 y(t)m(yp)s(e)35 b(if)f(sp)s(eci\014ed,)h(\(e.g.)56
+(\014le)227 5470 y(t)m(yp)s(e)35 b(if)f(sp)s(eci\014ed,)h(\(e.g.)56
 b('ftp://')37 b(or)e('h)m(ttp://'\))i(and)d(the)h(full)e(path)i(name,)h
-(to)g(the)f(exten)m(t)i(that)e(it)g(is)227 5336 y(sp)s(eci\014ed)24
-b(in)f(the)j(input)d(\014lename.)38 b(It)25 b(do)s(es)g(not)g(enclude)f
-(the)h(HDU)h(name)f(or)g(n)m(um)m(b)s(er,)g(or)g(an)m(y)h(\014ltering)
-227 5449 y(sp)s(eci\014cations.)334 5701 y Fe(FTRTNM\(filename,)43
-b(>)48 b(rootname,)d(status\))p eop
-%%Page: 64 70
-64 69 bop 0 299 a Fi(64)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fd(8.2)135 b(HDU-Lev)l(el)47 b(Op)t(erations)0
-805 y Fi(When)30 b(a)h(FITS)f(\014le)f(is)h(\014rst)f(op)s(ened)h(or)g
+(to)g(the)f(exten)m(t)i(that)e(it)g(is)227 5583 y(sp)s(eci\014ed)25
+b(in)f(the)j(input)d(\014lename.)38 b(It)26 b(do)s(es)g(not)g(include)e
+(the)i(HDU)h(name)f(or)g(n)m(um)m(b)s(er,)g(or)g(an)m(y)h(\014ltering)
+227 5696 y(sp)s(eci\014cations.)p eop
+%%Page: 72 78
+72 77 bop 0 299 a Fi(72)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)334
+555 y Fe(FTRTNM\(filename,)43 b(>)48 b(rootname,)d(status\))0
+817 y Fh(16)h Fi(T)-8 b(est)36 b(if)f(the)h(input)e(\014le)h(or)g(a)i
+(compressed)e(v)m(ersion)g(of)h(the)g(\014le)f(\(with)g(a)h(.gz,)i(.Z,)
+e(.z,)i(or)e(.zip)f(extension\))227 930 y(exists)j(on)g(disk.)62
+b(The)37 b(returned)g(v)-5 b(alue)37 b(of)h(the)h('exists')f(parameter)
+g(will)d(ha)m(v)m(e)40 b(1)e(of)g(the)g(4)g(follo)m(wing)227
+1042 y(v)-5 b(alues:)370 1295 y Fe(2:)95 b(the)47 b(file)g(does)g(not)f
+(exist,)h(but)f(a)i(compressed)d(version)h(does)g(exist)370
+1408 y(1:)95 b(the)47 b(disk)g(file)g(does)f(exist)370
+1521 y(0:)95 b(neither)46 b(the)h(file)g(nor)g(a)g(compressed)e
+(version)h(of)h(the)g(file)g(exist)323 1633 y(-1:)94
+b(the)47 b(input)g(file)f(name)h(is)g(not)g(a)g(disk)g(file)g(\(could)f
+(be)h(a)g(ftp,)g(http,)561 1746 y(smem,)g(or)g(mem)g(file,)f(or)h(a)h
+(file)e(piped)h(in)g(on)g(the)g(STDIN)f(stream\))286
+2008 y(FTEXIST\(filename,)d(>)48 b(exists,)e(status\);)0
+2343 y Fd(9.2)135 b(HDU-Lev)l(el)47 b(Op)t(erations)0
+2594 y Fi(When)30 b(a)h(FITS)f(\014le)f(is)h(\014rst)f(op)s(ened)h(or)g
 (created,)i(the)f(in)m(ternal)e(bu\013ers)g(in)g(FITSIO)g
-(automatically)i(p)s(oin)m(t)e(to)0 918 y(the)h(\014rst)g(HDU)h(in)e
+(automatically)i(p)s(oin)m(t)e(to)0 2707 y(the)h(\014rst)g(HDU)h(in)e
 (the)h(\014le.)40 b(The)29 b(follo)m(wing)g(routines)g(ma)m(y)i(b)s(e)e
 (used)h(to)h(mo)m(v)m(e)g(to)g(another)f(HDU)h(in)e(the)i(\014le.)0
-1031 y(Note)j(that)f(the)g(HDU)g(n)m(um)m(b)s(ering)e(con)m(v)m(en)m
+2820 y(Note)j(that)f(the)g(HDU)g(n)m(um)m(b)s(ering)e(con)m(v)m(en)m
 (tion)i(used)f(in)f(FITSIO)h(denotes)h(the)f(primary)f(arra)m(y)i(as)g
-(the)g(\014rst)0 1144 y(HDU,)e(the)g(\014rst)f(extension)g(in)f(a)h
+(the)g(\014rst)0 2933 y(HDU,)e(the)g(\014rst)f(extension)g(in)f(a)h
 (FITS)g(\014le)f(is)h(the)g(second)h(HDU,)g(and)f(so)h(on.)0
-1383 y Fh(1)81 b Fi(Mo)m(v)m(e)32 b(to)f(a)g(sp)s(eci\014ed)e
+3194 y Fh(1)81 b Fi(Mo)m(v)m(e)32 b(to)f(a)g(sp)s(eci\014ed)e
 (\(absolute\))h(HDU)h(in)f(the)g(FITS)g(\014le)f(\(nhdu)g(=)h(1)h(for)f
-(the)g(FITS)g(primary)e(arra)m(y\))382 1621 y Fe(FTMAHD\(unit,nhdu,)43
-b(>)k(hdutype,status\))0 1860 y Fh(2)81 b Fi(Mo)m(v)m(e)32
+(the)g(FITS)g(primary)e(arra)m(y\))382 3455 y Fe(FTMAHD\(unit,nhdu,)43
+b(>)k(hdutype,status\))0 3717 y Fh(2)81 b Fi(Mo)m(v)m(e)32
 b(to)f(a)g(new)f(\(existing\))g(HDU)h(forw)m(ard)f(or)g(bac)m(kw)m
-(ards)h(relativ)m(e)f(to)h(the)g(CHDU)382 2099 y Fe
-(FTMRHD\(unit,nmove,)43 b(>)k(hdutype,status\))0 2337
+(ards)h(relativ)m(e)f(to)h(the)g(CHDU)382 3978 y Fe
+(FTMRHD\(unit,nmove,)43 b(>)k(hdutype,status\))0 4240
 y Fh(3)81 b Fi(Mo)m(v)m(e)22 b(to)f(the)f(\(\014rst\))h(HDU)g(whic)m(h)
 e(has)h(the)g(sp)s(eci\014ed)f(extension)h(t)m(yp)s(e)g(and)g(EXTNAME)g
-(\(or)h(HDUNAME\))227 2450 y(and)32 b(EXTVER)g(k)m(eyw)m(ord)h(v)-5
+(\(or)h(HDUNAME\))227 4353 y(and)32 b(EXTVER)g(k)m(eyw)m(ord)h(v)-5
 b(alues.)47 b(The)32 b(hdut)m(yp)s(e)f(parameter)i(ma)m(y)h(ha)m(v)m(e)
-f(a)g(v)-5 b(alue)32 b(of)h(IMA)m(GE)p 3640 2450 28 4
-v 34 w(HDU,)227 2563 y(ASCI)s(I)p 486 2563 V 32 w(TBL,)f(BINAR)-8
-b(Y)p 1122 2563 V 34 w(TBL,)32 b(or)h(ANY)p 1718 2563
-V 33 w(HDU)g(where)f(ANY)p 2458 2563 V 33 w(HDU)i(means)e(that)h(only)f
-(the)g(extname)227 2676 y(and)k(extv)m(er)h(v)-5 b(alues)35
+f(a)g(v)-5 b(alue)32 b(of)h(IMA)m(GE)p 3640 4353 28 4
+v 34 w(HDU,)227 4465 y(ASCI)s(I)p 486 4465 V 32 w(TBL,)f(BINAR)-8
+b(Y)p 1122 4465 V 34 w(TBL,)32 b(or)h(ANY)p 1718 4465
+V 33 w(HDU)g(where)f(ANY)p 2458 4465 V 33 w(HDU)i(means)e(that)h(only)f
+(the)g(extname)227 4578 y(and)k(extv)m(er)h(v)-5 b(alues)35
 b(will)e(b)s(e)i(used)g(to)i(lo)s(cate)g(the)f(correct)h(extension.)57
 b(If)35 b(the)h(input)e(v)-5 b(alue)36 b(of)g(extv)m(er)227
-2789 y(is)c(0)h(then)f(the)g(EXTVER)h(k)m(eyw)m(ord)g(is)e(ignored)h
+4691 y(is)c(0)h(then)f(the)g(EXTVER)h(k)m(eyw)m(ord)g(is)e(ignored)h
 (and)g(the)g(\014rst)g(HDU)h(with)e(a)i(matc)m(hing)g(EXTNAME)227
-2902 y(\(or)j(HDUNAME\))h(k)m(eyw)m(ord)f(will)c(b)s(e)j(found.)55
+4804 y(\(or)j(HDUNAME\))h(k)m(eyw)m(ord)f(will)c(b)s(e)j(found.)55
 b(If)34 b(no)i(matc)m(hing)f(HDU)h(is)f(found)f(in)g(the)h(\014le)g
-(then)g(the)227 3015 y(curren)m(t)27 b(HDU)g(will)d(remain)h(unc)m
-(hanged)i(and)f(a)h(status)g(=)f(BAD)p 2501 3015 V 34
-w(HDU)p 2740 3015 V 33 w(NUM)h(\(301\))i(will)24 b(b)s(e)i(returned.)
-382 3253 y Fe(FTMNHD\(unit,)44 b(hdutype,)i(extname,)f(extver,)h(>)i
-(status\))0 3492 y Fh(4)81 b Fi(Get)31 b(the)g(n)m(um)m(b)s(er)e(of)h
+(then)g(the)227 4917 y(curren)m(t)27 b(HDU)g(will)d(remain)h(unc)m
+(hanged)i(and)f(a)h(status)g(=)f(BAD)p 2501 4917 V 34
+w(HDU)p 2740 4917 V 33 w(NUM)h(\(301\))i(will)24 b(b)s(e)i(returned.)
+382 5178 y Fe(FTMNHD\(unit,)44 b(hdutype,)i(extname,)f(extver,)h(>)i
+(status\))0 5440 y Fh(4)81 b Fi(Get)31 b(the)g(n)m(um)m(b)s(er)e(of)h
 (the)h(curren)m(t)f(HDU)h(in)e(the)i(FITS)e(\014le)h(\(primary)f(arra)m
-(y)h(=)g(1\))382 3730 y Fe(FTGHDN\(unit,)44 b(>)k(nhdu\))0
-3969 y Fh(5)81 b Fi(Return)39 b(the)i(t)m(yp)s(e)g(of)g(the)g(curren)m
-(t)f(HDU)i(in)d(the)i(FITS)f(\014le.)70 b(The)41 b(p)s(ossible)d(v)-5
-b(alues)40 b(for)g(hdut)m(yp)s(e)g(are)227 4082 y(IMA)m(GE)p
-546 4082 V 34 w(HDU)31 b(\(0\),)h(ASCI)s(I)p 1242 4082
-V 31 w(TBL)e(\(1\),)i(or)e(BINAR)-8 b(Y)p 2133 4082 V
-34 w(TBL)30 b(\(2\).)382 4321 y Fe(FTGHDT\(unit,)44 b(>)k(hdutype,)d
-(status\))0 4559 y Fh(6)81 b Fi(Return)29 b(the)i(total)g(n)m(um)m(b)s
-(er)e(of)i(HDUs)f(in)g(the)g(FITS)g(\014le.)40 b(The)29
-b(CHDU)i(remains)e(unc)m(hanged.)382 4798 y Fe(FTTHDU\(unit,)44
-b(>)k(hdunum,)e(status\))0 5036 y Fh(7)81 b Fi(Create)36
-b(\(app)s(end\))e(a)h(new)g(empt)m(y)g(HDU)h(follo)m(wing)e(the)h(last)
-g(extension)g(that)h(has)f(b)s(een)f(previously)f(ac-)227
-5149 y(cessed)41 b(b)m(y)f(the)g(program.)70 b(This)39
-b(will)e(o)m(v)m(erwrite)k(an)m(y)g(extensions)f(in)e(an)j(existing)e
-(FITS)g(\014le)h(if)f(the)227 5262 y(program)31 b(has)g(not)g(already)g
-(mo)m(v)m(ed)h(to)f(that)h(\(or)f(a)h(later\))f(extension)g(using)e
-(the)i(FTMAHD)h(or)f(FTM-)227 5375 y(RHD)24 b(routines.)37
-b(F)-8 b(or)25 b(example,)f(if)f(an)g(existing)f(FITS)h(\014le)f(con)m
-(tains)i(a)g(primary)d(arra)m(y)j(and)f(5)g(extensions)227
-5488 y(and)31 b(a)h(program)f(\(1\))h(op)s(ens)f(the)g(FITS)g(\014le,)g
-(\(2\))h(mo)m(v)m(es)h(to)f(extension)f(4,)h(\(3\))g(mo)m(v)m(es)h(bac)
-m(k)f(to)g(the)f(pri-)227 5601 y(mary)36 b(arra)m(y)-8
-b(,)38 b(and)e(\(4\))h(then)e(calls)g(FTCRHD,)h(then)g(the)g(new)g
-(extension)f(will)e(b)s(e)j(written)e(follo)m(wing)227
-5714 y(the)d(4th)f(extension,)h(o)m(v)m(erwriting)f(the)g(existing)f
-(5th)i(extension.)p eop
-%%Page: 65 71
-65 70 bop 0 299 a Fg(8.2.)72 b(HDU-LEVEL)31 b(OPERA)-8
-b(TIONS)2414 b Fi(65)382 555 y Fe(FTCRHD\(unit,)44 b(>)k(status\))0
-800 y Fh(8)81 b Fi(Insert)41 b(a)h(new)f(IMA)m(GE)i(extension)f
+(y)h(=)g(1\))382 5701 y Fe(FTGHDN\(unit,)44 b(>)k(nhdu\))p
+eop
+%%Page: 73 79
+73 78 bop 0 299 a Fg(9.2.)72 b(HDU-LEVEL)31 b(OPERA)-8
+b(TIONS)2414 b Fi(73)0 555 y Fh(5)81 b Fi(Return)39 b(the)i(t)m(yp)s(e)
+g(of)g(the)g(curren)m(t)f(HDU)i(in)d(the)i(FITS)f(\014le.)70
+b(The)41 b(p)s(ossible)d(v)-5 b(alues)40 b(for)g(hdut)m(yp)s(e)g(are)
+227 668 y(IMA)m(GE)p 546 668 28 4 v 34 w(HDU)31 b(\(0\),)h(ASCI)s(I)p
+1242 668 V 31 w(TBL)e(\(1\),)i(or)e(BINAR)-8 b(Y)p 2133
+668 V 34 w(TBL)30 b(\(2\).)382 929 y Fe(FTGHDT\(unit,)44
+b(>)k(hdutype,)d(status\))0 1189 y Fh(6)81 b Fi(Return)29
+b(the)i(total)g(n)m(um)m(b)s(er)e(of)i(HDUs)f(in)g(the)g(FITS)g
+(\014le.)40 b(The)29 b(CHDU)i(remains)e(unc)m(hanged.)382
+1450 y Fe(FTTHDU\(unit,)44 b(>)k(hdunum,)e(status\))0
+1710 y Fh(7)81 b Fi(Create)36 b(\(app)s(end\))e(a)h(new)g(empt)m(y)g
+(HDU)h(follo)m(wing)e(the)h(last)g(extension)g(that)h(has)f(b)s(een)f
+(previously)f(ac-)227 1823 y(cessed)41 b(b)m(y)f(the)g(program.)70
+b(This)39 b(will)e(o)m(v)m(erwrite)k(an)m(y)g(extensions)f(in)e(an)j
+(existing)e(FITS)g(\014le)h(if)f(the)227 1936 y(program)31
+b(has)g(not)g(already)g(mo)m(v)m(ed)h(to)f(that)h(\(or)f(a)h(later\))f
+(extension)g(using)e(the)i(FTMAHD)h(or)f(FTM-)227 2049
+y(RHD)24 b(routines.)37 b(F)-8 b(or)25 b(example,)f(if)f(an)g(existing)
+f(FITS)h(\014le)f(con)m(tains)i(a)g(primary)d(arra)m(y)j(and)f(5)g
+(extensions)227 2162 y(and)31 b(a)h(program)f(\(1\))h(op)s(ens)f(the)g
+(FITS)g(\014le,)g(\(2\))h(mo)m(v)m(es)h(to)f(extension)f(4,)h(\(3\))g
+(mo)m(v)m(es)h(bac)m(k)f(to)g(the)f(pri-)227 2275 y(mary)36
+b(arra)m(y)-8 b(,)38 b(and)e(\(4\))h(then)e(calls)g(FTCRHD,)h(then)g
+(the)g(new)g(extension)f(will)e(b)s(e)j(written)e(follo)m(wing)227
+2388 y(the)d(4th)f(extension,)h(o)m(v)m(erwriting)f(the)g(existing)f
+(5th)i(extension.)382 2648 y Fe(FTCRHD\(unit,)44 b(>)k(status\))0
+2909 y Fh(8)81 b Fi(Insert)41 b(a)h(new)f(IMA)m(GE)i(extension)f
 (immediately)e(follo)m(wing)g(the)i(CHDU.)g(An)m(y)g(follo)m(wing)e
-(extensions)227 913 y(will)c(b)s(e)i(shifted)f(do)m(wn)h(to)h(mak)m(e)g
-(ro)s(om)g(for)f(the)g(new)g(extension.)65 b(If)38 b(there)h(are)f(no)h
-(other)f(follo)m(wing)227 1026 y(extensions)29 b(then)g(the)h(new)e
+(extensions)227 3022 y(will)c(b)s(e)i(shifted)f(do)m(wn)h(to)h(mak)m(e)
+g(ro)s(om)g(for)f(the)g(new)g(extension.)65 b(If)38 b(there)h(are)f(no)
+h(other)f(follo)m(wing)227 3135 y(extensions)29 b(then)g(the)h(new)e
 (image)i(extension)f(will)e(simply)f(b)s(e)j(app)s(ended)f(to)i(the)f
-(end)g(of)g(the)h(\014le.)39 b(The)227 1139 y(new)30
-b(extension)g(will)e(b)s(ecome)j(the)f(CHDU.)382 1384
+(end)g(of)g(the)h(\014le.)39 b(The)227 3247 y(new)30
+b(extension)g(will)e(b)s(ecome)j(the)f(CHDU.)382 3508
 y Fe(FTIIMG\(unit,bitpix,naxis)o(,na)o(xes,)41 b(>)48
-b(status\))0 1629 y Fh(9)81 b Fi(Insert)30 b(a)i(new)f(ASCI)s(I)f(T)-8
+b(status\))0 3768 y Fh(9)81 b Fi(Insert)30 b(a)i(new)f(ASCI)s(I)f(T)-8
 b(ABLE)31 b(extension)g(immediately)f(follo)m(wing)f(the)j(CHDU.)g(An)m
-(y)f(follo)m(wing)f(exten-)227 1741 y(sions)25 b(will)e(b)s(e)i
+(y)f(follo)m(wing)f(exten-)227 3881 y(sions)25 b(will)e(b)s(e)i
 (shifted)f(do)m(wn)h(to)h(mak)m(e)h(ro)s(om)e(for)h(the)f(new)g
 (extension.)39 b(If)25 b(there)h(are)g(no)g(other)f(follo)m(wing)227
-1854 y(extensions)31 b(then)g(the)h(new)f(table)g(extension)g(will)e
+3994 y(extensions)31 b(then)g(the)h(new)f(table)g(extension)g(will)e
 (simply)g(b)s(e)i(app)s(ended)f(to)i(the)f(end)g(of)h(the)f(\014le.)43
-b(The)227 1967 y(new)30 b(extension)g(will)e(b)s(ecome)j(the)f(CHDU.)
-382 2212 y Fe(FTITAB\(unit,rowlen,nrows)o(,tf)o(ield)o(s,tt)o(ype)o
+b(The)227 4107 y(new)30 b(extension)g(will)e(b)s(ecome)j(the)f(CHDU.)
+382 4368 y Fe(FTITAB\(unit,rowlen,nrows)o(,tf)o(ield)o(s,tt)o(ype)o
 (,tbc)o(ol,t)o(for)o(m,tu)o(nit,)o(ext)o(name)o(,)42
-b(>)716 2325 y(status\))0 2570 y Fh(10)k Fi(Insert)25
+b(>)716 4481 y(status\))0 4741 y Fh(10)k Fi(Insert)25
 b(a)h(new)f(binary)e(table)j(extension)f(immediately)e(follo)m(wing)h
 (the)i(CHDU.)g(An)m(y)g(follo)m(wing)d(extensions)227
-2683 y(will)36 b(b)s(e)i(shifted)f(do)m(wn)h(to)h(mak)m(e)g(ro)s(om)g
+4854 y(will)36 b(b)s(e)i(shifted)f(do)m(wn)h(to)h(mak)m(e)g(ro)s(om)g
 (for)f(the)g(new)g(extension.)65 b(If)38 b(there)h(are)f(no)h(other)f
-(follo)m(wing)227 2796 y(extensions)e(then)h(the)f(new)g(bin)m(table)f
+(follo)m(wing)227 4967 y(extensions)e(then)h(the)f(new)g(bin)m(table)f
 (extension)i(will)d(simply)g(b)s(e)i(app)s(ended)e(to)k(the)e(end)g(of)
-h(the)g(\014le.)227 2909 y(The)30 b(new)g(extension)g(will)e(b)s(ecome)
-j(the)f(CHDU.)382 3154 y Fe(FTIBIN\(unit,nrows,tfield)o(s,t)o(type)o
+h(the)g(\014le.)227 5080 y(The)30 b(new)g(extension)g(will)e(b)s(ecome)
+j(the)f(CHDU.)382 5340 y Fe(FTIBIN\(unit,nrows,tfield)o(s,t)o(type)o
 (,tfo)o(rm,)o(tuni)o(t,ex)o(tna)o(me,v)o(arid)o(at)41
-b(>)48 b(status\))0 3398 y Fh(11)e Fi(Resize)25 b(an)f(image)h(b)m(y)f
+b(>)48 b(status\))0 5601 y Fh(11)e Fi(Resize)25 b(an)f(image)h(b)m(y)f
 (mo)s(di\014ng)e(the)j(size,)h(dimensions,)d(and/or)h(datat)m(yp)s(e)h
-(of)g(the)g(curren)m(t)f(primary)e(arra)m(y)227 3511
+(of)g(the)g(curren)m(t)f(primary)e(arra)m(y)227 5714
 y(or)29 b(image)h(extension.)39 b(If)29 b(the)g(new)g(image,)h(as)f(sp)
 s(eci\014ed)e(b)m(y)i(the)g(input)e(argumen)m(ts,)j(is)e(larger)h(than)
-g(the)227 3624 y(curren)m(t)34 b(existing)f(image)h(in)f(the)h(FITS)f
-(\014le)g(then)g(zero)i(\014ll)d(data)j(will)c(b)s(e)i(inserted)g(at)h
-(the)g(end)g(of)g(the)227 3737 y(curren)m(t)25 b(image)g(and)f(an)m(y)i
-(follo)m(wing)d(extensions)i(will)d(b)s(e)i(mo)m(v)m(ed)i(further)e
-(bac)m(k)h(in)f(the)h(\014le.)38 b(Similarly)-8 b(,)23
-b(if)227 3850 y(the)28 b(new)e(image)i(is)e(smaller)g(than)h(the)g
-(curren)m(t)g(image)g(then)g(an)m(y)h(follo)m(wing)e(extensions)g(will)
-f(b)s(e)h(shifted)227 3963 y(up)32 b(to)m(w)m(ards)i(the)g(b)s
-(eginning)c(of)j(the)h(FITS)e(\014le)g(and)h(the)g(image)g(data)h(will)
-d(b)s(e)h(truncated)h(to)h(the)f(new)227 4076 y(size.)40
-b(This)24 b(routine)h(rewrites)h(the)g(BITPIX,)h(NAXIS,)f(and)g(NAXISn)
-g(k)m(eyw)m(ords)g(with)f(the)i(appropriate)227 4189
-y(v)-5 b(alues)30 b(for)g(new)g(image.)382 4434 y Fe
-(FTRSIM\(unit,bitpix,naxis)o(,na)o(xes,)o(stat)o(us\))0
-4679 y Fh(12)46 b Fi(Delete)33 b(the)g(CHDU)g(in)e(the)h(FITS)f
-(\014le.)46 b(An)m(y)32 b(follo)m(wing)f(HDUs)i(will)d(b)s(e)h(shifted)
-g(forw)m(ard)h(in)f(the)h(\014le,)g(to)227 4792 y(\014ll)k(in)g(the)h
-(gap)h(created)g(b)m(y)g(the)f(deleted)g(HDU.)i(In)d(the)i(case)g(of)g
-(deleting)e(the)i(primary)d(arra)m(y)j(\(the)227 4904
-y(\014rst)30 b(HDU)h(in)e(the)i(\014le\))f(then)g(the)h(curren)m(t)f
-(primary)e(arra)m(y)j(will)d(b)s(e)i(replace)g(b)m(y)h(a)g(n)m(ull)d
-(primary)g(arra)m(y)227 5017 y(con)m(taining)j(the)h(minim)m(um)c(set)k
-(of)g(required)d(k)m(eyw)m(ords)j(and)e(no)i(data.)44
-b(If)31 b(there)g(are)h(more)f(extensions)227 5130 y(in)e(the)h(\014le)
-f(follo)m(wing)g(the)h(one)g(that)h(is)e(deleted,)h(then)g(the)g(the)g
-(CHDU)h(will)c(b)s(e)j(rede\014ned)e(to)j(p)s(oin)m(t)e(to)227
-5243 y(the)e(follo)m(wing)e(extension.)40 b(If)26 b(there)h(are)g(no)g
-(follo)m(wing)e(extensions)h(then)h(the)g(CHDU)g(will)d(b)s(e)i
-(rede\014ned)227 5356 y(to)35 b(p)s(oin)m(t)e(to)i(the)f(previous)e
-(HDU.)j(The)e(output)h(HDUTYPE)g(parameter)h(indicates)d(the)j(t)m(yp)s
-(e)f(of)g(the)227 5469 y(new)c(CHDU)h(after)g(the)f(previous)f(CHDU)i
-(has)f(b)s(een)g(deleted.)382 5714 y Fe(FTDHDU\(unit,)44
-b(>)k(hdutype,status\))p eop
-%%Page: 66 72
-66 71 bop 0 299 a Fi(66)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fh(13)46 b Fi(Cop)m(y)35 b(the)f(en)m(tire)h(CHDU)g(from)f(the)g
-(FITS)g(\014le)g(asso)s(ciated)h(with)e(IUNIT)h(to)i(the)e(CHDU)h(of)g
-(the)g(FITS)227 668 y(\014le)f(asso)s(ciated)h(with)e(OUNIT.)h(The)g
-(output)g(HDU)h(m)m(ust)f(b)s(e)g(empt)m(y)h(and)e(not)i(already)f(con)
-m(tain)h(an)m(y)227 781 y(k)m(eyw)m(ords.)41 b(Space)29
-b(will)d(b)s(e)j(reserv)m(ed)g(for)g(MOREKEYS)f(additional)e(k)m(eyw)m
-(ords)k(in)d(the)j(output)e(header)227 894 y(if)i(there)g(is)g(not)g
-(already)g(enough)g(space.)382 1141 y Fe(FTCOPY\(iunit,ounit,morek)o
-(eys)o(,)42 b(>)47 b(status\))0 1389 y Fh(14)f Fi(Cop)m(y)27
-b(the)h(header)f(\(and)g(not)g(the)g(data\))i(from)d(the)i(CHDU)g(asso)
-s(ciated)f(with)f(in)m(unit)f(to)j(the)f(CHDU)h(asso-)227
-1502 y(ciated)e(with)e(outunit.)38 b(If)25 b(the)g(curren)m(t)h(output)
-f(HDU)h(is)e(not)i(completely)f(empt)m(y)-8 b(,)27 b(then)e(the)h(CHDU)
-g(will)227 1615 y(b)s(e)e(closed)h(and)f(a)i(new)e(HDU)h(will)e(b)s(e)h
-(app)s(ended)f(to)j(the)f(output)f(\014le.)38 b(This)23
-b(routine)h(will)e(automatically)227 1728 y(transform)31
-b(the)g(necessary)h(k)m(eyw)m(ords)f(when)g(cop)m(ying)g(a)g(primary)f
-(arra)m(y)i(to)f(and)g(image)h(extension,)f(or)227 1841
-y(an)c(image)g(extension)f(to)h(a)h(primary)c(arra)m(y)-8
-b(.)41 b(An)26 b(empt)m(y)h(output)f(data)i(unit)d(will)f(b)s(e)i
-(created)i(\(all)e(v)-5 b(alues)227 1953 y(=)30 b(0\).)382
-2201 y Fe(FTCPHD\(inunit,)44 b(outunit,)h(>)j(status\))0
-2448 y Fh(15)e Fi(Cop)m(y)d(just)g(the)g(data)h(from)f(the)g(CHDU)h
-(asso)s(ciated)f(with)f(IUNIT)h(to)h(the)f(CHDU)h(asso)s(ciated)f(with)
-227 2561 y(OUNIT.)26 b(This)e(will)f(o)m(v)m(erwrite)j(an)m(y)g(data)g
-(previously)e(in)g(the)i(OUNIT)f(CHDU.)h(This)e(lo)m(w)i(lev)m(el)f
-(routine)227 2674 y(is)h(used)f(b)m(y)i(FTCOPY,)f(but)g(it)f(ma)m(y)j
-(also)e(b)s(e)g(useful)e(in)i(certain)g(application)f(programs)h(whic)m
-(h)f(w)m(an)m(t)i(to)227 2787 y(cop)m(y)j(the)f(data)h(from)f(one)g
-(FITS)f(\014le)g(to)i(another)f(but)g(also)g(w)m(an)m(t)h(to)g(mo)s
-(dify)d(the)i(header)g(k)m(eyw)m(ords)g(in)227 2900 y(the)j(pro)s
-(cess.)44 b(all)31 b(the)h(required)e(header)h(k)m(eyw)m(ords)h(m)m
-(ust)g(b)s(e)f(written)g(to)h(the)g(OUNIT)f(CHDU)h(b)s(efore)227
-3013 y(calling)d(this)g(routine)382 3260 y Fe(FTCPDT\(iunit,ounit,)42
-b(>)48 b(status\))0 3592 y Fd(8.3)135 b(De\014ne)45 b(or)g(Rede\014ne)h
-(the)f(structure)g(of)g(the)g(CHDU)0 3842 y Fi(It)32
-b(should)e(rarely)h(b)s(e)h(necessary)g(to)h(call)e(the)h(subroutines)e
-(in)g(this)h(section.)46 b(FITSIO)30 b(in)m(ternally)g(calls)h(these)0
-3955 y(routines)i(whenev)m(er)h(necessary)-8 b(,)36 b(so)e(an)m(y)g
-(calls)f(to)i(these)f(routines)f(b)m(y)h(application)e(programs)i(will)
-d(lik)m(ely)i(b)s(e)0 4068 y(redundan)m(t.)0 4316 y Fh(1)81
+g(the)p eop
+%%Page: 74 80
+74 79 bop 0 299 a Fi(74)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)227
+555 y Fi(curren)m(t)k(existing)f(image)h(in)f(the)h(FITS)f(\014le)g
+(then)g(zero)i(\014ll)d(data)j(will)c(b)s(e)i(inserted)g(at)h(the)g
+(end)g(of)g(the)227 668 y(curren)m(t)25 b(image)g(and)f(an)m(y)i(follo)
+m(wing)d(extensions)i(will)d(b)s(e)i(mo)m(v)m(ed)i(further)e(bac)m(k)h
+(in)f(the)h(\014le.)38 b(Similarly)-8 b(,)23 b(if)227
+781 y(the)28 b(new)e(image)i(is)e(smaller)g(than)h(the)g(curren)m(t)g
+(image)g(then)g(an)m(y)h(follo)m(wing)e(extensions)g(will)f(b)s(e)h
+(shifted)227 894 y(up)32 b(to)m(w)m(ards)i(the)g(b)s(eginning)c(of)j
+(the)h(FITS)e(\014le)g(and)h(the)g(image)g(data)h(will)d(b)s(e)h
+(truncated)h(to)h(the)f(new)227 1007 y(size.)40 b(This)24
+b(routine)h(rewrites)h(the)g(BITPIX,)h(NAXIS,)f(and)g(NAXISn)g(k)m(eyw)
+m(ords)g(with)f(the)i(appropriate)227 1120 y(v)-5 b(alues)30
+b(for)g(new)g(image.)382 1369 y Fe(FTRSIM\(unit,bitpix,naxis)o(,na)o
+(xes,)o(stat)o(us\))0 1619 y Fh(12)46 b Fi(Delete)33
+b(the)g(CHDU)g(in)e(the)h(FITS)f(\014le.)46 b(An)m(y)32
+b(follo)m(wing)f(HDUs)i(will)d(b)s(e)h(shifted)g(forw)m(ard)h(in)f(the)
+h(\014le,)g(to)227 1732 y(\014ll)k(in)g(the)h(gap)h(created)g(b)m(y)g
+(the)f(deleted)g(HDU.)i(In)d(the)i(case)g(of)g(deleting)e(the)i
+(primary)d(arra)m(y)j(\(the)227 1845 y(\014rst)30 b(HDU)h(in)e(the)i
+(\014le\))f(then)g(the)h(curren)m(t)f(primary)e(arra)m(y)j(will)d(b)s
+(e)i(replace)g(b)m(y)h(a)g(n)m(ull)d(primary)g(arra)m(y)227
+1958 y(con)m(taining)j(the)h(minim)m(um)c(set)k(of)g(required)d(k)m
+(eyw)m(ords)j(and)e(no)i(data.)44 b(If)31 b(there)g(are)h(more)f
+(extensions)227 2071 y(in)e(the)h(\014le)f(follo)m(wing)g(the)h(one)g
+(that)h(is)e(deleted,)h(then)g(the)g(the)g(CHDU)h(will)c(b)s(e)j
+(rede\014ned)e(to)j(p)s(oin)m(t)e(to)227 2184 y(the)e(follo)m(wing)e
+(extension.)40 b(If)26 b(there)h(are)g(no)g(follo)m(wing)e(extensions)h
+(then)h(the)g(CHDU)g(will)d(b)s(e)i(rede\014ned)227 2297
+y(to)35 b(p)s(oin)m(t)e(to)i(the)f(previous)e(HDU.)j(The)e(output)h
+(HDUTYPE)g(parameter)h(indicates)d(the)j(t)m(yp)s(e)f(of)g(the)227
+2409 y(new)c(CHDU)h(after)g(the)f(previous)f(CHDU)i(has)f(b)s(een)g
+(deleted.)382 2659 y Fe(FTDHDU\(unit,)44 b(>)k(hdutype,status\))0
+2909 y Fh(13)e Fi(Cop)m(y)36 b(all)f(or)h(part)g(of)g(the)g(input)e
+(FITS)h(\014le)g(and)h(app)s(end)e(it)h(to)i(the)f(end)g(of)g(the)g
+(output)g(FITS)f(\014le.)56 b(If)227 3022 y('previous')27
+b(is)g(true)h(\(not)g(0\),)i(then)d(an)m(y)h(HDUs)h(preceding)e(the)h
+(curren)m(t)f(HDU)i(in)d(the)i(input)e(\014le)h(will)f(b)s(e)227
+3135 y(copied)33 b(to)h(the)g(output)f(\014le.)50 b(Similarly)-8
+b(,)31 b('curren)m(t')j(and)e('follo)m(wing')h(determine)g(whether)f
+(the)i(curren)m(t)227 3247 y(HDU,)g(and/or)e(an)m(y)h(follo)m(wing)e
+(HDUs)i(in)e(the)h(input)f(\014le)g(will)f(b)s(e)i(copied)g(to)h(the)f
+(output)g(\014le.)46 b(If)32 b(all)g(3)227 3360 y(parameters)j(are)h
+(true,)g(then)e(the)h(en)m(tire)g(input)e(\014le)h(will)e(b)s(e)i
+(copied.)54 b(On)33 b(return,)j(the)f(curren)m(t)f(HDU)227
+3473 y(in)28 b(the)h(input)e(\014le)h(will)e(b)s(e)i(unc)m(hanged,)h
+(and)f(the)h(last)g(HDU)g(will)d(b)s(e)j(the)g(curren)m(t)f(HDU)i(in)d
+(the)i(output)227 3586 y(\014le.)95 3836 y Fe(int)47
+b(fits_copy_file)d(/)k(ffcpfl)286 3949 y(\(fitsfile)e(*infptr,)f
+(fitsfile)h(*outfptr,)f(int)i(previous,)e(int)i(current,)477
+4062 y(int)g(following,)e(>)j(int)f(*status\))0 4311
+y Fh(14)f Fi(Cop)m(y)35 b(the)f(en)m(tire)h(CHDU)g(from)f(the)g(FITS)g
+(\014le)g(asso)s(ciated)h(with)e(IUNIT)h(to)i(the)e(CHDU)h(of)g(the)g
+(FITS)227 4424 y(\014le)f(asso)s(ciated)h(with)e(OUNIT.)h(The)g(output)
+g(HDU)h(m)m(ust)f(b)s(e)g(empt)m(y)h(and)e(not)i(already)f(con)m(tain)h
+(an)m(y)227 4537 y(k)m(eyw)m(ords.)41 b(Space)29 b(will)d(b)s(e)j
+(reserv)m(ed)g(for)g(MOREKEYS)f(additional)e(k)m(eyw)m(ords)k(in)d(the)
+j(output)e(header)227 4650 y(if)i(there)g(is)g(not)g(already)g(enough)g
+(space.)382 4900 y Fe(FTCOPY\(iunit,ounit,morek)o(eys)o(,)42
+b(>)47 b(status\))0 5149 y Fh(15)f Fi(Cop)m(y)27 b(the)h(header)f
+(\(and)g(not)g(the)g(data\))i(from)d(the)i(CHDU)g(asso)s(ciated)f(with)
+f(in)m(unit)f(to)j(the)f(CHDU)h(asso-)227 5262 y(ciated)e(with)e
+(outunit.)38 b(If)25 b(the)g(curren)m(t)h(output)f(HDU)h(is)e(not)i
+(completely)f(empt)m(y)-8 b(,)27 b(then)e(the)h(CHDU)g(will)227
+5375 y(b)s(e)e(closed)h(and)f(a)i(new)e(HDU)h(will)e(b)s(e)h(app)s
+(ended)f(to)j(the)f(output)f(\014le.)38 b(This)23 b(routine)h(will)e
+(automatically)227 5488 y(transform)31 b(the)g(necessary)h(k)m(eyw)m
+(ords)f(when)g(cop)m(ying)g(a)g(primary)f(arra)m(y)i(to)f(and)g(image)h
+(extension,)f(or)227 5601 y(an)c(image)g(extension)f(to)h(a)h(primary)c
+(arra)m(y)-8 b(.)41 b(An)26 b(empt)m(y)h(output)f(data)i(unit)d(will)f
+(b)s(e)i(created)i(\(all)e(v)-5 b(alues)227 5714 y(=)30
+b(0\).)p eop
+%%Page: 75 81
+75 80 bop 0 299 a Fg(9.3.)72 b(DEFINE)31 b(OR)f(REDEFINE)h(THE)f(STR)m
+(UCTURE)f(OF)h(THE)g(CHDU)1042 b Fi(75)382 555 y Fe(FTCPHD\(inunit,)44
+b(outunit,)h(>)j(status\))0 819 y Fh(16)e Fi(Cop)m(y)d(just)g(the)g
+(data)h(from)f(the)g(CHDU)h(asso)s(ciated)f(with)f(IUNIT)h(to)h(the)f
+(CHDU)h(asso)s(ciated)f(with)227 932 y(OUNIT.)26 b(This)e(will)f(o)m(v)
+m(erwrite)j(an)m(y)g(data)g(previously)e(in)g(the)i(OUNIT)f(CHDU.)h
+(This)e(lo)m(w)i(lev)m(el)f(routine)227 1045 y(is)h(used)f(b)m(y)i
+(FTCOPY,)f(but)g(it)f(ma)m(y)j(also)e(b)s(e)g(useful)e(in)i(certain)g
+(application)f(programs)h(whic)m(h)f(w)m(an)m(t)i(to)227
+1158 y(cop)m(y)j(the)f(data)h(from)f(one)g(FITS)f(\014le)g(to)i
+(another)f(but)g(also)g(w)m(an)m(t)h(to)g(mo)s(dify)d(the)i(header)g(k)
+m(eyw)m(ords)g(in)227 1271 y(the)j(pro)s(cess.)44 b(all)31
+b(the)h(required)e(header)h(k)m(eyw)m(ords)h(m)m(ust)g(b)s(e)f(written)
+g(to)h(the)g(OUNIT)f(CHDU)h(b)s(efore)227 1383 y(calling)d(this)g
+(routine)382 1647 y Fe(FTCPDT\(iunit,ounit,)42 b(>)48
+b(status\))0 1985 y Fd(9.3)135 b(De\014ne)45 b(or)g(Rede\014ne)h(the)f
+(structure)g(of)g(the)g(CHDU)0 2237 y Fi(It)32 b(should)e(rarely)h(b)s
+(e)h(necessary)g(to)h(call)e(the)h(subroutines)e(in)g(this)h(section.)
+46 b(FITSIO)30 b(in)m(ternally)g(calls)h(these)0 2350
+y(routines)i(whenev)m(er)h(necessary)-8 b(,)36 b(so)e(an)m(y)g(calls)f
+(to)i(these)f(routines)f(b)m(y)h(application)e(programs)i(will)d(lik)m
+(ely)i(b)s(e)0 2462 y(redundan)m(t.)0 2726 y Fh(1)81
 b Fi(This)35 b(routine)h(forces)i(FITSIO)e(to)i(scan)f(the)g(curren)m
 (t)g(header)g(k)m(eyw)m(ords)h(that)f(de\014ne)g(the)g(structure)g(of)
-227 4429 y(the)31 b(HDU)f(\(suc)m(h)g(as)h(the)f(NAXISn,)g(PCOUNT)f
+227 2839 y(the)31 b(HDU)f(\(suc)m(h)g(as)h(the)f(NAXISn,)g(PCOUNT)f
 (and)g(GCOUNT)h(k)m(eyw)m(ords\))h(so)f(that)h(it)e(can)i(initialize)
-227 4541 y(the)36 b(in)m(ternal)e(bu\013ers)g(that)i(describ)s(e)e(the)
+227 2952 y(the)36 b(in)m(ternal)e(bu\013ers)g(that)i(describ)s(e)e(the)
 i(HDU)g(structure.)55 b(This)34 b(routine)h(ma)m(y)h(b)s(e)e(used)h
-(instead)g(of)227 4654 y(the)k(more)g(complicated)g(calls)f(to)h(ftp)s
+(instead)g(of)227 3065 y(the)k(more)g(complicated)g(calls)f(to)h(ftp)s
 (def,)h(ftadef)f(or)g(ftb)s(def.)65 b(This)37 b(routine)h(is)g(also)h
-(v)m(ery)g(useful)e(for)227 4767 y(reinitializing)30
+(v)m(ery)g(useful)e(for)227 3178 y(reinitializing)30
 b(the)k(structure)g(of)g(an)f(HDU,)i(if)e(the)h(n)m(um)m(b)s(er)e(of)i
 (ro)m(ws)g(in)f(a)h(table,)h(as)f(sp)s(eci\014ed)e(b)m(y)i(the)227
-4880 y(NAXIS2)d(k)m(eyw)m(ord,)g(has)f(b)s(een)g(mo)s(di\014ed)e(from)i
-(its)g(initial)d(v)-5 b(alue.)382 5128 y Fe(FTRDEF\(unit,)44
-b(>)k(status\))141 b(\(DEPRECATED\))0 5375 y Fh(2)81
+3291 y(NAXIS2)d(k)m(eyw)m(ord,)g(has)f(b)s(een)g(mo)s(di\014ed)e(from)i
+(its)g(initial)d(v)-5 b(alue.)382 3554 y Fe(FTRDEF\(unit,)44
+b(>)k(status\))141 b(\(DEPRECATED\))0 3818 y Fh(2)81
 b Fi(De\014ne)27 b(the)g(structure)g(of)g(the)g(primary)e(arra)m(y)j
 (or)f(IMA)m(GE)h(extension.)39 b(When)27 b(writing)e(GR)m(OUP)m(ed)j
-(FITS)227 5488 y(\014les)42 b(that)i(b)m(y)e(con)m(v)m(en)m(tion)j(set)
+(FITS)227 3931 y(\014les)42 b(that)i(b)m(y)e(con)m(v)m(en)m(tion)j(set)
 e(the)g(NAXIS1)g(k)m(eyw)m(ord)h(equal)e(to)i(0,)i(ftp)s(def)c(m)m(ust)
-h(b)s(e)f(called)g(with)227 5601 y(naxes\(1\))27 b(=)e(1,)i(NOT)e(0,)i
+h(b)s(e)f(called)g(with)227 4044 y(naxes\(1\))27 b(=)e(1,)i(NOT)e(0,)i
 (otherwise)e(FITSIO)f(will)f(rep)s(ort)i(an)g(error)g(status=308)i
-(when)d(trying)h(to)h(write)227 5714 y(data)31 b(to)g(a)g(group.)40
+(when)d(trying)h(to)h(write)227 4157 y(data)31 b(to)g(a)g(group.)40
 b(Note:)i(it)30 b(is)g(usually)e(simpler)g(to)j(call)f(FTRDEF)g(rather)
-h(than)f(this)f(routine.)p eop
-%%Page: 67 73
-67 72 bop 0 299 a Fg(8.4.)72 b(FITS)30 b(HEADER)h(I/O)f(SUBR)m(OUTINES)
-2086 b Fi(67)382 555 y Fe(FTPDEF\(unit,bitpix,naxis)o(,na)o(xes,)o
-(pcou)o(nt,)o(gcou)o(nt,)41 b(>)48 b(status\))93 b(\(DEPRECATED\))0
-816 y Fh(3)81 b Fi(De\014ne)32 b(the)h(structure)f(of)g(an)h(ASCI)s(I)e
-(table)h(\(T)-8 b(ABLE\))33 b(extension.)47 b(Note:)f(it)32
-b(is)f(usually)f(simpler)g(to)k(call)227 929 y(FTRDEF)d(rather)f(than)h
-(this)e(routine.)382 1189 y Fe(FTADEF\(unit,rowlen,tfiel)o(ds,)o(tbco)o
-(l,tf)o(orm)o(,nro)o(ws)42 b(>)47 b(status\))f(\(DEPRECATED\))0
-1450 y Fh(4)81 b Fi(De\014ne)35 b(the)h(structure)f(of)g(a)h(binary)e
-(table)h(\(BINT)-8 b(ABLE\))37 b(extension.)55 b(Note:)e(it)35
-b(is)f(usually)f(simpler)g(to)227 1563 y(call)d(FTRDEF)h(rather)f(than)
-g(this)f(routine.)382 1823 y Fe(FTBDEF\(unit,tfields,tfor)o(m,v)o(arid)
-o(at,n)o(row)o(s)42 b(>)47 b(status\))f(\(DEPRECATED\))0
-2084 y Fh(5)81 b Fi(De\014ne)34 b(the)g(size)g(of)g(the)g(Curren)m(t)f
+h(than)f(this)f(routine.)382 4421 y Fe(FTPDEF\(unit,bitpix,naxis)o(,na)
+o(xes,)o(pcou)o(nt,)o(gcou)o(nt,)41 b(>)48 b(status\))93
+b(\(DEPRECATED\))0 4684 y Fh(3)81 b Fi(De\014ne)32 b(the)h(structure)f
+(of)g(an)h(ASCI)s(I)e(table)h(\(T)-8 b(ABLE\))33 b(extension.)47
+b(Note:)f(it)32 b(is)f(usually)f(simpler)g(to)k(call)227
+4797 y(FTRDEF)d(rather)f(than)h(this)e(routine.)382 5061
+y Fe(FTADEF\(unit,rowlen,tfiel)o(ds,)o(tbco)o(l,tf)o(orm)o(,nro)o(ws)42
+b(>)47 b(status\))f(\(DEPRECATED\))0 5325 y Fh(4)81 b
+Fi(De\014ne)35 b(the)h(structure)f(of)g(a)h(binary)e(table)h(\(BINT)-8
+b(ABLE\))37 b(extension.)55 b(Note:)e(it)35 b(is)f(usually)f(simpler)g
+(to)227 5438 y(call)d(FTRDEF)h(rather)f(than)g(this)f(routine.)382
+5701 y Fe(FTBDEF\(unit,tfields,tfor)o(m,v)o(arid)o(at,n)o(row)o(s)42
+b(>)47 b(status\))f(\(DEPRECATED\))p eop
+%%Page: 76 82
+76 81 bop 0 299 a Fi(76)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
+555 y Fh(5)81 b Fi(De\014ne)34 b(the)g(size)g(of)g(the)g(Curren)m(t)f
 (Data)i(Unit,)g(o)m(v)m(erriding)d(the)i(length)g(of)g(the)g(data)h
-(unit)d(as)i(previously)227 2197 y(de\014ned)e(b)m(y)h(ftp)s(def,)g
+(unit)d(as)i(previously)227 668 y(de\014ned)e(b)m(y)h(ftp)s(def,)g
 (ftadef,)i(or)e(ftb)s(def.)48 b(This)32 b(is)g(useful)f(if)i(one)g(do)s
 (es)g(not)h(kno)m(w)f(the)g(total)h(size)f(of)h(the)227
-2310 y(data)f(unit)e(un)m(til)g(after)h(the)h(data)g(ha)m(v)m(e)g(b)s
+781 y(data)f(unit)e(un)m(til)g(after)h(the)h(data)g(ha)m(v)m(e)g(b)s
 (een)f(written.)45 b(The)32 b(size)g(\(in)f(b)m(ytes\))i(of)g(an)f
-(ASCI)s(I)f(or)h(Binary)227 2423 y(table)26 b(is)f(giv)m(en)g(b)m(y)h
+(ASCI)s(I)f(or)h(Binary)227 894 y(table)26 b(is)f(giv)m(en)g(b)m(y)h
 (NAXIS1)g(*)g(NAXIS2.)40 b(\(Note)27 b(that)f(to)h(determine)e(the)g(v)
--5 b(alue)26 b(of)g(NAXIS1)f(it)h(is)f(often)227 2536
+-5 b(alue)26 b(of)g(NAXIS1)f(it)h(is)f(often)227 1007
 y(more)32 b(con)m(v)m(enien)m(t)g(to)g(read)f(the)g(v)-5
 b(alue)31 b(of)g(the)h(NAXIS1)f(k)m(eyw)m(ord)h(from)e(the)i(output)e
-(\014le,)h(rather)g(than)227 2649 y(computing)e(the)h(ro)m(w)g(length)g
+(\014le,)h(rather)g(than)227 1120 y(computing)e(the)h(ro)m(w)g(length)g
 (directly)e(from)h(all)g(the)h(TF)m(ORM)h(k)m(eyw)m(ord)f(v)-5
-b(alues\).)40 b(Note:)i(it)29 b(is)g(usually)227 2762
+b(alues\).)40 b(Note:)i(it)29 b(is)g(usually)227 1233
 y(simpler)f(to)j(call)f(FTRDEF)h(rather)f(than)g(this)f(routine.)382
-3022 y Fe(FTDDEF\(unit,bytlen,)42 b(>)48 b(status\))e(\(DEPRECATED\))0
-3283 y Fh(6)81 b Fi(De\014ne)22 b(the)g(zero)i(indexed)c(b)m(yte)j
+1454 y Fe(FTDDEF\(unit,bytlen,)42 b(>)48 b(status\))e(\(DEPRECATED\))0
+1676 y Fh(6)81 b Fi(De\014ne)22 b(the)g(zero)i(indexed)c(b)m(yte)j
 (o\013set)g(of)g(the)f('heap')h(measured)e(from)h(the)h(start)g(of)f
-(the)g(binary)f(table)h(data.)227 3396 y(By)30 b(default)f(the)g(heap)h
+(the)g(binary)f(table)h(data.)227 1789 y(By)30 b(default)f(the)g(heap)h
 (is)e(assumed)h(to)h(start)g(immediately)e(follo)m(wing)g(the)i
-(regular)e(table)i(data,)g(i.e.,)g(at)227 3509 y(lo)s(cation)36
+(regular)e(table)i(data,)g(i.e.,)g(at)227 1902 y(lo)s(cation)36
 b(NAXIS1)h(x)g(NAXIS2.)59 b(This)35 b(routine)g(is)h(only)f(relev)-5
 b(an)m(t)37 b(for)f(binary)f(tables)h(whic)m(h)g(con)m(tain)227
-3621 y(v)-5 b(ariable)34 b(length)h(arra)m(y)g(columns)f(\(with)h(TF)m
+2015 y(v)-5 b(ariable)34 b(length)h(arra)m(y)g(columns)f(\(with)h(TF)m
 (ORMn)g(=)f('Pt'\).)57 b(This)33 b(subroutine)g(also)i(automatically)
-227 3734 y(writes)22 b(the)h(v)-5 b(alue)22 b(of)h(theap)g(to)h(a)f(k)m
+227 2128 y(writes)22 b(the)h(v)-5 b(alue)22 b(of)h(theap)g(to)h(a)f(k)m
 (eyw)m(ord)g(in)f(the)h(extension)f(header.)38 b(This)21
-b(subroutine)g(m)m(ust)i(b)s(e)f(called)227 3847 y(after)27
+b(subroutine)g(m)m(ust)i(b)s(e)f(called)227 2241 y(after)27
 b(the)f(required)e(k)m(eyw)m(ords)j(ha)m(v)m(e)g(b)s(een)e(written)g
 (\(with)g(ftph)m(bn\))g(and)h(after)g(the)h(table)f(structure)f(has)227
-3960 y(b)s(een)30 b(de\014ned)f(\(with)g(ftb)s(def)7
+2354 y(b)s(een)30 b(de\014ned)f(\(with)g(ftb)s(def)7
 b(\))30 b(but)g(b)s(efore)g(an)m(y)g(data)h(is)f(written)f(to)i(the)g
-(table.)382 4221 y Fe(FTPTHP\(unit,theap,)43 b(>)k(status\))0
-4555 y Fd(8.4)135 b(FITS)44 b(Header)i(I/O)f(Subroutines)0
-4809 y Fb(8.4.1)112 b(Header)38 b(Space)h(and)f(P)m(osition)d(Routines)
-0 5019 y Fh(1)81 b Fi(Reserv)m(e)37 b(space)g(in)e(the)i(CHU)f(for)h
+(table.)382 2575 y Fe(FTPTHP\(unit,theap,)43 b(>)k(status\))0
+2903 y Fd(9.4)135 b(FITS)44 b(Header)i(I/O)f(Subroutines)0
+3156 y Fb(9.4.1)112 b(Header)38 b(Space)h(and)f(P)m(osition)d(Routines)
+0 3359 y Fh(1)81 b Fi(Reserv)m(e)37 b(space)g(in)e(the)i(CHU)f(for)h
 (MOREKEYS)e(more)i(header)f(k)m(eyw)m(ords.)59 b(This)35
-b(subroutine)f(ma)m(y)k(b)s(e)227 5132 y(called)c(to)i(reserv)m(e)g
+b(subroutine)f(ma)m(y)k(b)s(e)227 3472 y(called)c(to)i(reserv)m(e)g
 (space)f(for)g(k)m(eyw)m(ords)g(whic)m(h)f(are)h(to)h(b)s(e)e(written)g
-(at)h(a)h(later)f(time,)h(after)f(the)g(data)227 5245
+(at)h(a)h(later)f(time,)h(after)f(the)g(data)227 3585
 y(unit)g(or)h(subsequen)m(t)f(extensions)g(ha)m(v)m(e)i(b)s(een)e
 (written)g(to)i(the)f(FITS)f(\014le.)57 b(If)35 b(this)g(subroutine)f
-(is)h(not)227 5357 y(explicitly)25 b(called,)i(then)g(the)g(initial)e
+(is)h(not)227 3698 y(explicitly)25 b(called,)i(then)g(the)g(initial)e
 (size)h(of)i(the)f(FITS)f(header)h(will)e(b)s(e)h(limited)f(to)j(the)f
-(space)h(a)m(v)-5 b(ailable)227 5470 y(at)24 b(the)g(time)f(that)h(the)
+(space)h(a)m(v)-5 b(ailable)227 3811 y(at)24 b(the)g(time)f(that)h(the)
 g(\014rst)f(data)h(is)f(written)f(to)i(the)g(asso)s(ciated)g(data)g
 (unit.)37 b(FITSIO)22 b(has)i(the)f(abilit)m(y)f(to)227
-5583 y(dynamically)g(add)h(more)h(space)h(to)g(the)f(header)g(if)f
+3924 y(dynamically)g(add)h(more)h(space)h(to)g(the)f(header)g(if)f
 (needed,)i(ho)m(w)m(ev)m(er)g(it)f(is)f(more)h(e\016cien)m(t)g(to)h
-(preallo)s(cate)227 5696 y(the)31 b(required)d(space)j(if)f(the)g(size)
-g(is)g(kno)m(wn)g(in)f(adv)-5 b(ance.)p eop
-%%Page: 68 74
-68 73 bop 0 299 a Fi(68)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)382
-555 y Fe(FTHDEF\(unit,morekeys,)42 b(>)47 b(status\))0
-796 y Fh(2)81 b Fi(Return)23 b(the)i(n)m(um)m(b)s(er)e(of)h(existing)g
-(k)m(eyw)m(ords)g(in)g(the)g(CHU)g(\(NOT)h(including)c(the)j(END)h(k)m
-(eyw)m(ord)g(whic)m(h)e(is)227 909 y(not)h(considered)e(a)h(real)g(k)m
-(eyw)m(ord\))h(and)f(the)g(remaining)f(space)h(a)m(v)-5
-b(ailable)23 b(to)h(write)e(additional)g(k)m(eyw)m(ords)227
-1022 y(in)38 b(the)i(CHU.)f(\(returns)f(KEYSADD)i(=)f(-1)h(if)e(the)h
-(header)g(has)g(not)h(y)m(et)g(b)s(een)e(closed\).)68
-b(Note)40 b(that)227 1135 y(FITSIO)23 b(will)f(attempt)j(to)g
-(dynamically)d(add)h(space)i(for)f(more)g(k)m(eyw)m(ords)h(if)e
-(required)f(when)h(app)s(ending)227 1248 y(new)30 b(k)m(eyw)m(ords)h
-(to)g(a)g(header.)382 1489 y Fe(FTGHSP\(iunit,)44 b(>)j
-(keysexist,keysadd,status\))0 1730 y Fh(3)81 b Fi(Return)38
-b(the)i(n)m(um)m(b)s(er)e(of)h(k)m(eyw)m(ords)h(in)e(the)h(header)g
-(and)g(the)g(curren)m(t)h(p)s(osition)d(in)h(the)h(header.)68
-b(This)227 1842 y(returns)37 b(the)g(n)m(um)m(b)s(er)f(of)i(the)g(k)m
-(eyw)m(ord)g(record)f(that)h(will)d(b)s(e)i(read)g(next)h(\(or)g(one)g
-(greater)g(than)g(the)227 1955 y(p)s(osition)27 b(of)h(the)h(last)f(k)m
-(eyw)m(ord)h(that)g(w)m(as)f(read)g(or)h(written\).)39
-b(A)29 b(v)-5 b(alue)27 b(of)i(1)g(is)e(returned)g(if)g(the)i(p)s(oin)m
-(ter)227 2068 y(is)h(p)s(ositioned)e(at)j(the)g(b)s(eginning)c(of)k
-(the)g(header.)382 2309 y Fe(FTGHPS\(iunit,)44 b(>)j
-(keysexist,key_no,status\))0 2597 y Fb(8.4.2)112 b(Read)38
+(preallo)s(cate)227 4037 y(the)31 b(required)d(space)j(if)f(the)g(size)
+g(is)g(kno)m(wn)g(in)f(adv)-5 b(ance.)382 4258 y Fe
+(FTHDEF\(unit,morekeys,)42 b(>)47 b(status\))0 4480 y
+Fh(2)81 b Fi(Return)23 b(the)i(n)m(um)m(b)s(er)e(of)h(existing)g(k)m
+(eyw)m(ords)g(in)g(the)g(CHU)g(\(NOT)h(including)c(the)j(END)h(k)m(eyw)
+m(ord)g(whic)m(h)e(is)227 4593 y(not)h(considered)e(a)h(real)g(k)m(eyw)
+m(ord\))h(and)f(the)g(remaining)f(space)h(a)m(v)-5 b(ailable)23
+b(to)h(write)e(additional)g(k)m(eyw)m(ords)227 4706 y(in)38
+b(the)i(CHU.)f(\(returns)f(KEYSADD)i(=)f(-1)h(if)e(the)h(header)g(has)g
+(not)h(y)m(et)g(b)s(een)e(closed\).)68 b(Note)40 b(that)227
+4819 y(FITSIO)23 b(will)f(attempt)j(to)g(dynamically)d(add)h(space)i
+(for)f(more)g(k)m(eyw)m(ords)h(if)e(required)f(when)h(app)s(ending)227
+4932 y(new)30 b(k)m(eyw)m(ords)h(to)g(a)g(header.)382
+5153 y Fe(FTGHSP\(iunit,)44 b(>)j(keysexist,keysadd,status\))0
+5375 y Fh(3)81 b Fi(Return)38 b(the)i(n)m(um)m(b)s(er)e(of)h(k)m(eyw)m
+(ords)h(in)e(the)h(header)g(and)g(the)g(curren)m(t)h(p)s(osition)d(in)h
+(the)h(header.)68 b(This)227 5488 y(returns)37 b(the)g(n)m(um)m(b)s(er)
+f(of)i(the)g(k)m(eyw)m(ord)g(record)f(that)h(will)d(b)s(e)i(read)g
+(next)h(\(or)g(one)g(greater)g(than)g(the)227 5601 y(p)s(osition)27
+b(of)h(the)h(last)f(k)m(eyw)m(ord)h(that)g(w)m(as)f(read)g(or)h
+(written\).)39 b(A)29 b(v)-5 b(alue)27 b(of)i(1)g(is)e(returned)g(if)g
+(the)i(p)s(oin)m(ter)227 5714 y(is)h(p)s(ositioned)e(at)j(the)g(b)s
+(eginning)c(of)k(the)g(header.)p eop
+%%Page: 77 83
+77 82 bop 0 299 a Fg(9.4.)72 b(FITS)30 b(HEADER)h(I/O)f(SUBR)m(OUTINES)
+2086 b Fi(77)382 555 y Fe(FTGHPS\(iunit,)44 b(>)j
+(keysexist,key_no,status\))0 845 y Fb(9.4.2)112 b(Read)38
 b(or)f(W)-9 b(rite)36 b(Standard)j(Header)e(Routines)0
-2816 y Fi(These)31 b(subroutines)d(pro)m(vide)i(a)h(simple)e(metho)s(d)
+1064 y Fi(These)31 b(subroutines)d(pro)m(vide)i(a)h(simple)e(metho)s(d)
 h(of)h(reading)f(or)h(writing)e(most)i(of)g(the)g(k)m(eyw)m(ord)g(v)-5
-b(alues)30 b(that)0 2929 y(are)e(normally)e(required)g(in)h(a)h(FITS)f
+b(alues)30 b(that)0 1177 y(are)e(normally)e(required)g(in)h(a)h(FITS)f
 (\014les.)39 b(These)27 b(subroutines)f(are)i(pro)m(vided)e(for)i(con)m
-(v)m(enience)g(only)f(and)h(are)0 3042 y(not)36 b(required)d(to)j(b)s
+(v)m(enience)g(only)f(and)h(are)0 1290 y(not)36 b(required)d(to)j(b)s
 (e)f(used.)55 b(If)35 b(preferred,)h(users)e(ma)m(y)i(call)f(the)h(lo)m
 (w)m(er-lev)m(el)f(subroutines)e(describ)s(ed)h(in)g(the)0
-3154 y(previous)29 b(section)i(to)h(individually)26 b(read)k(or)h
+1402 y(previous)29 b(section)i(to)h(individually)26 b(read)k(or)h
 (write)f(the)h(required)e(k)m(eyw)m(ords.)43 b(Note)32
-b(that)g(in)d(most)j(cases,)g(the)0 3267 y(required)25
+b(that)g(in)d(most)j(cases,)g(the)0 1515 y(required)25
 b(k)m(eyw)m(ords)i(suc)m(h)g(as)g(NAXIS,)f(TFIELD,)h(TTYPEn,)g(etc,)i
 (whic)m(h)c(de\014ne)h(the)h(structure)f(of)h(the)g(HDU)0
-3380 y(m)m(ust)j(b)s(e)g(written)f(to)j(the)e(header)g(b)s(efore)g(an)m
+1628 y(m)m(ust)j(b)s(e)g(written)f(to)j(the)e(header)g(b)s(efore)g(an)m
 (y)h(data)g(can)g(b)s(e)e(written)h(to)h(the)g(image)f(or)h(table.)0
-3621 y Fh(1)81 b Fi(Put)37 b(the)i(primary)d(header)i(or)g(IMA)m(GE)h
+1881 y Fh(1)81 b Fi(Put)37 b(the)i(primary)d(header)i(or)g(IMA)m(GE)h
 (extension)e(k)m(eyw)m(ords)i(in)m(to)f(the)g(CHU.)g(There)g(are)g(2)h
-(a)m(v)-5 b(ailable)227 3734 y(routines:)38 b(The)27
+(a)m(v)-5 b(ailable)227 1994 y(routines:)38 b(The)27
 b(simpler)d(FTPHPS)j(routine)f(is)g(equiv)-5 b(alen)m(t)27
 b(to)g(calling)f(ftphpr)f(with)h(the)h(default)g(v)-5
-b(alues)227 3847 y(of)35 b(SIMPLE)f(=)g(true,)i(p)s(coun)m(t)e(=)g(0,)i
+b(alues)227 2107 y(of)35 b(SIMPLE)f(=)g(true,)i(p)s(coun)m(t)e(=)g(0,)i
 (gcoun)m(t)g(=)e(1,)i(and)e(EXTEND)h(=)f(true.)53 b(PCOUNT,)34
-b(GCOUNT)227 3960 y(and)23 b(EXTEND)h(k)m(eyw)m(ords)g(are)h(not)f
+b(GCOUNT)227 2220 y(and)23 b(EXTEND)h(k)m(eyw)m(ords)g(are)h(not)f
 (required)e(in)g(the)i(primary)e(header)h(and)h(are)g(only)f(written)g
-(if)f(p)s(coun)m(t)227 4073 y(is)30 b(not)h(equal)g(to)h(zero,)g(gcoun)
+(if)f(p)s(coun)m(t)227 2333 y(is)30 b(not)h(equal)g(to)h(zero,)g(gcoun)
 m(t)g(is)e(not)h(equal)f(to)i(zero)g(or)f(one,)g(and)g(if)f(extend)h
-(is)f(TR)m(UE,)h(resp)s(ectiv)m(ely)-8 b(.)227 4186 y(When)30
+(is)f(TR)m(UE,)h(resp)s(ectiv)m(ely)-8 b(.)227 2446 y(When)30
 b(writing)f(to)i(an)f(IMA)m(GE)i(extension,)e(the)g(SIMPLE)g(and)g
-(EXTEND)g(parameters)h(are)g(ignored.)382 4427 y Fe
+(EXTEND)g(parameters)h(are)g(ignored.)382 2699 y Fe
 (FTPHPS\(unit,bitpix,naxis)o(,na)o(xes,)41 b(>)48 b(status\))382
-4652 y(FTPHPR\(unit,simple,bitpi)o(x,n)o(axis)o(,nax)o(es,)o(pcou)o
+2925 y(FTPHPR\(unit,simple,bitpi)o(x,n)o(axis)o(,nax)o(es,)o(pcou)o
 (nt,g)o(cou)o(nt,e)o(xten)o(d,)41 b(>)48 b(status\))0
-4893 y Fh(2)81 b Fi(Get)44 b(primary)d(header)i(or)h(IMA)m(GE)g
+3178 y Fh(2)81 b Fi(Get)44 b(primary)d(header)i(or)h(IMA)m(GE)g
 (extension)f(k)m(eyw)m(ords)h(from)f(the)g(CHU.)h(When)f(reading)f
-(from)h(an)227 5006 y(IMA)m(GE)32 b(extension)e(the)g(SIMPLE)g(and)f
-(EXTEND)i(parameters)g(are)f(ignored.)382 5247 y Fe
+(from)h(an)227 3291 y(IMA)m(GE)32 b(extension)e(the)g(SIMPLE)g(and)f
+(EXTEND)i(parameters)g(are)f(ignored.)382 3544 y Fe
 (FTGHPR\(unit,maxdim,)42 b(>)48 b(simple,bitpix,naxis,naxe)o(s,p)o
-(coun)o(t,gc)o(oun)o(t,ex)o(tend)o(,)716 5360 y(status\))0
-5601 y Fh(3)81 b Fi(Put)34 b(the)h(ASCI)s(I)f(table)h(header)g(k)m(eyw)
+(coun)o(t,gc)o(oun)o(t,ex)o(tend)o(,)716 3657 y(status\))0
+3911 y Fh(3)81 b Fi(Put)34 b(the)h(ASCI)s(I)f(table)h(header)g(k)m(eyw)
 m(ords)g(in)m(to)g(the)g(CHU.)h(The)e(optional)g(TUNITn)g(and)h
-(EXTNAME)227 5714 y(k)m(eyw)m(ords)c(are)g(written)e(only)h(if)f(the)i
-(input)d(string)h(v)-5 b(alues)30 b(are)h(not)f(blank.)p
-eop
-%%Page: 69 75
-69 74 bop 0 299 a Fg(8.4.)72 b(FITS)30 b(HEADER)h(I/O)f(SUBR)m(OUTINES)
-2086 b Fi(69)382 555 y Fe(FTPHTB\(unit,rowlen,nrows)o(,tf)o(ield)o
-(s,tt)o(ype)o(,tbc)o(ol,t)o(for)o(m,tu)o(nit,)o(ext)o(name)o(,)42
-b(>)716 668 y(status\))0 926 y Fh(4)81 b Fi(Get)31 b(the)g(ASCI)s(I)d
-(table)j(header)f(k)m(eyw)m(ords)h(from)e(the)i(CHU)382
-1183 y Fe(FTGHTB\(unit,maxdim,)42 b(>)48 b(rowlen,nrows,tfields,tty)o
-(pe,)o(tbco)o(l,tf)o(orm)o(,tun)o(it,)716 1296 y(extname,status\))0
-1554 y Fh(5)81 b Fi(Put)34 b(the)h(binary)e(table)i(header)f(k)m(eyw)m
+(EXTNAME)227 4024 y(k)m(eyw)m(ords)c(are)g(written)e(only)h(if)f(the)i
+(input)d(string)h(v)-5 b(alues)30 b(are)h(not)f(blank.)382
+4277 y Fe(FTPHTB\(unit,rowlen,nrows)o(,tf)o(ield)o(s,tt)o(ype)o(,tbc)o
+(ol,t)o(for)o(m,tu)o(nit,)o(ext)o(name)o(,)42 b(>)716
+4390 y(status\))0 4643 y Fh(4)81 b Fi(Get)31 b(the)g(ASCI)s(I)d(table)j
+(header)f(k)m(eyw)m(ords)h(from)e(the)i(CHU)382 4896
+y Fe(FTGHTB\(unit,maxdim,)42 b(>)48 b(rowlen,nrows,tfields,tty)o(pe,)o
+(tbco)o(l,tf)o(orm)o(,tun)o(it,)716 5009 y(extname,status\))0
+5262 y Fh(5)81 b Fi(Put)34 b(the)h(binary)e(table)i(header)f(k)m(eyw)m
 (ords)i(in)m(to)e(the)h(CHU.)g(The)g(optional)f(TUNITn)g(and)g(EXTNAME)
-227 1667 y(k)m(eyw)m(ords)i(are)g(written)e(only)g(if)h(the)g(input)e
+227 5375 y(k)m(eyw)m(ords)i(are)g(written)e(only)g(if)h(the)g(input)e
 (string)i(v)-5 b(alues)34 b(are)i(not)f(blank.)54 b(The)35
-b(p)s(coun)m(t)g(parameter,)227 1779 y(whic)m(h)e(sp)s(eci\014es)g(the)
+b(p)s(coun)m(t)g(parameter,)227 5488 y(whic)m(h)e(sp)s(eci\014es)g(the)
 i(size)f(of)h(the)f(v)-5 b(ariable)33 b(length)h(arra)m(y)h(heap,)g
-(should)e(initially)d(=)k(0;)j(FITSIO)d(will)227 1892
+(should)e(initially)d(=)k(0;)j(FITSIO)d(will)227 5601
 y(automatically)24 b(up)s(date)f(the)h(PCOUNT)f(k)m(eyw)m(ord)h(v)-5
 b(alue)23 b(if)g(an)m(y)h(v)-5 b(ariable)23 b(length)g(arra)m(y)i(data)
-f(is)f(written)227 2005 y(to)31 b(the)e(heap.)41 b(The)29
+f(is)f(written)227 5714 y(to)31 b(the)e(heap.)41 b(The)29
 b(TF)m(ORM)g(k)m(eyw)m(ord)h(v)-5 b(alue)29 b(for)h(v)-5
 b(ariable)28 b(length)h(v)m(ector)i(columns)d(should)g(ha)m(v)m(e)j
-(the)227 2118 y(form)c('Pt\(len\)')i(or)e('1Pt\(len\)')i(where)e(`t')h
-(is)f(the)h(data)g(t)m(yp)s(e)g(co)s(de)f(letter)h(\(A,I,J,E,D,)h
-(etc.\))42 b(and)27 b(`len')g(is)227 2231 y(an)h(in)m(teger)h(sp)s
-(ecifying)d(the)i(maxim)m(um)f(length)g(of)i(the)f(v)m(ectors)h(in)e
-(that)i(column)e(\(len)g(m)m(ust)h(b)s(e)g(greater)227
-2344 y(than)j(or)h(equal)e(to)j(the)e(longest)h(v)m(ector)g(in)e(the)i
-(column\).)43 b(If)30 b(`len')h(is)g(not)g(sp)s(eci\014ed)f(when)g(the)
-i(table)f(is)227 2457 y(created)c(\(e.g.,)i(the)d(input)e(TF)m(ORMn)i
-(v)-5 b(alue)25 b(is)g(just)g('1Pt'\))j(then)d(FITSIO)g(will)e(scan)j
-(the)g(column)f(when)227 2570 y(the)30 b(table)f(is)f(\014rst)h(closed)
-g(and)g(will)d(app)s(end)i(the)h(maxim)m(um)g(length)f(to)i(the)g(TF)m
-(ORM)f(k)m(eyw)m(ord)h(v)-5 b(alue.)227 2683 y(Note)28
-b(that)e(if)f(the)h(table)g(is)f(subsequen)m(tly)g(mo)s(di\014ed)f(to)j
-(increase)e(the)i(maxim)m(um)e(length)g(of)h(the)g(v)m(ectors)227
-2796 y(then)k(the)h(mo)s(difying)d(program)i(is)f(resp)s(onsible)f(for)
-i(also)g(up)s(dating)e(the)j(TF)m(ORM)g(k)m(eyw)m(ord)g(v)-5
-b(alue.)382 3053 y Fe(FTPHBN\(unit,nrows,tfield)o(s,t)o(type)o(,tfo)o
+(the)p eop
+%%Page: 78 84
+78 83 bop 0 299 a Fi(78)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)227
+555 y Fi(form)d('Pt\(len\)')i(or)e('1Pt\(len\)')i(where)e(`t')h(is)f
+(the)h(data)g(t)m(yp)s(e)g(co)s(de)f(letter)h(\(A,I,J,E,D,)h(etc.\))42
+b(and)27 b(`len')g(is)227 668 y(an)h(in)m(teger)h(sp)s(ecifying)d(the)i
+(maxim)m(um)f(length)g(of)i(the)f(v)m(ectors)h(in)e(that)i(column)e
+(\(len)g(m)m(ust)h(b)s(e)g(greater)227 781 y(than)j(or)h(equal)e(to)j
+(the)e(longest)h(v)m(ector)g(in)e(the)i(column\).)43
+b(If)30 b(`len')h(is)g(not)g(sp)s(eci\014ed)f(when)g(the)i(table)f(is)
+227 894 y(created)c(\(e.g.,)i(the)d(input)e(TF)m(ORMn)i(v)-5
+b(alue)25 b(is)g(just)g('1Pt'\))j(then)d(FITSIO)g(will)e(scan)j(the)g
+(column)f(when)227 1007 y(the)30 b(table)f(is)f(\014rst)h(closed)g(and)
+g(will)d(app)s(end)i(the)h(maxim)m(um)g(length)f(to)i(the)g(TF)m(ORM)f
+(k)m(eyw)m(ord)h(v)-5 b(alue.)227 1120 y(Note)28 b(that)e(if)f(the)h
+(table)g(is)f(subsequen)m(tly)g(mo)s(di\014ed)f(to)j(increase)e(the)i
+(maxim)m(um)e(length)g(of)h(the)g(v)m(ectors)227 1233
+y(then)k(the)h(mo)s(difying)d(program)i(is)f(resp)s(onsible)f(for)i
+(also)g(up)s(dating)e(the)j(TF)m(ORM)g(k)m(eyw)m(ord)g(v)-5
+b(alue.)382 1462 y Fe(FTPHBN\(unit,nrows,tfield)o(s,t)o(type)o(,tfo)o
 (rm,)o(tuni)o(t,ex)o(tna)o(me,v)o(arid)o(at,)41 b(>)48
-b(status\))0 3311 y Fh(6)81 b Fi(Get)31 b(the)g(binary)d(table)i
-(header)h(k)m(eyw)m(ords)f(from)g(the)h(CHU)382 3568
+b(status\))0 1691 y Fh(6)81 b Fi(Get)31 b(the)g(binary)d(table)i
+(header)h(k)m(eyw)m(ords)f(from)g(the)h(CHU)382 1921
 y Fe(FTGHBN\(unit,maxdim,)42 b(>)48 b(nrows,tfields,ttype,tfor)o(m,t)o
-(unit)o(,ext)o(nam)o(e,va)o(rida)o(t,)716 3681 y(status\))0
-3972 y Fb(8.4.3)112 b(W)-9 b(rite)36 b(Keyw)m(ord)h(Subroutines)0
-4180 y Fh(1)81 b Fi(Put)30 b(\(app)s(end\))f(an)h(80-c)m(haracter)j
-(record)e(in)m(to)f(the)h(CHU.)382 4438 y Fe(FTPREC\(unit,card,)43
-b(>)k(status\))0 4695 y Fh(2)81 b Fi(Put)36 b(\(app)s(end\))g(a)i
+(unit)o(,ext)o(nam)o(e,va)o(rida)o(t,)716 2034 y(status\))0
+2320 y Fb(9.4.3)112 b(W)-9 b(rite)36 b(Keyw)m(ord)h(Subroutines)0
+2524 y Fh(1)81 b Fi(Put)30 b(\(app)s(end\))f(an)h(80-c)m(haracter)j
+(record)e(in)m(to)f(the)h(CHU.)382 2753 y Fe(FTPREC\(unit,card,)43
+b(>)k(status\))0 2982 y Fh(2)81 b Fi(Put)36 b(\(app)s(end\))g(a)i
 (COMMENT)f(k)m(eyw)m(ord)g(in)m(to)g(the)h(CHU.)f(Multiple)e(COMMENT)i
-(k)m(eyw)m(ords)g(will)e(b)s(e)227 4808 y(written)30
-b(if)f(the)i(input)d(commen)m(t)j(string)f(is)f(longer)h(than)g(70)i(c)
-m(haracters.)382 5066 y Fe(FTPCOM\(unit,comment,)42 b(>)48
-b(status\))0 5323 y Fh(3)81 b Fi(Put)24 b(\(app)s(end\))g(a)h(HISTOR)-8
+(k)m(eyw)m(ords)g(will)e(b)s(e)227 3095 y(written)30
+b(if)f(the)i(input)d(commen)m(t)j(string)f(is)f(longer)h(than)g(72)i(c)
+m(haracters.)382 3325 y Fe(FTPCOM\(unit,comment,)42 b(>)48
+b(status\))0 3554 y Fh(3)81 b Fi(Put)24 b(\(app)s(end\))g(a)h(HISTOR)-8
 b(Y)25 b(k)m(eyw)m(ord)g(in)m(to)g(the)g(CHU.)g(Multiple)e(HISTOR)-8
 b(Y)24 b(k)m(eyw)m(ords)h(will)e(b)s(e)h(written)227
-5436 y(if)30 b(the)g(input)f(history)g(string)g(is)h(longer)g(than)g
-(70)h(c)m(haracters.)382 5694 y Fe(FTPHIS\(unit,history,)42
-b(>)48 b(status\))p eop
-%%Page: 70 76
-70 75 bop 0 299 a Fi(70)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fh(4)81 b Fi(Put)36 b(\(app)s(end\))f(the)h(D)m(A)-8
-b(TE)38 b(k)m(eyw)m(ord)f(in)m(to)f(the)g(CHU.)h(The)f(k)m(eyw)m(ord)g
-(v)-5 b(alue)36 b(will)e(con)m(tain)j(the)f(curren)m(t)227
-668 y(system)c(date)g(as)g(a)f(c)m(haracter)i(string)e(in)f('dd/mm/yy')
-h(format.)44 b(If)31 b(a)h(D)m(A)-8 b(TE)32 b(k)m(eyw)m(ord)g(already)f
-(exists)227 781 y(in)j(the)h(header,)i(then)d(this)g(subroutine)f(will)
-g(simply)f(up)s(date)j(the)g(k)m(eyw)m(ord)g(v)-5 b(alue)35
-b(in-place)f(with)g(the)227 894 y(curren)m(t)c(date.)382
-1169 y Fe(FTPDAT\(unit,)44 b(>)k(status\))0 1444 y Fh(5)81
-b Fi(Put)22 b(\(app)s(end\))f(a)i(new)f(k)m(eyw)m(ord)h(of)g(the)f
-(appropriate)g(datat)m(yp)s(e)h(in)m(to)g(the)f(CHU.)h(Note)h(that)f
-(FTPKYS)f(will)227 1557 y(only)32 b(write)g(string)f(v)-5
+3667 y(if)30 b(the)g(input)f(history)g(string)g(is)h(longer)g(than)g
+(72)h(c)m(haracters.)382 3897 y Fe(FTPHIS\(unit,history,)42
+b(>)48 b(status\))0 4126 y Fh(4)81 b Fi(Put)36 b(\(app)s(end\))f(the)h
+(D)m(A)-8 b(TE)38 b(k)m(eyw)m(ord)f(in)m(to)f(the)g(CHU.)h(The)f(k)m
+(eyw)m(ord)g(v)-5 b(alue)36 b(will)e(con)m(tain)j(the)f(curren)m(t)227
+4239 y(system)c(date)g(as)g(a)f(c)m(haracter)i(string)e(in)f
+('dd/mm/yy')h(format.)44 b(If)31 b(a)h(D)m(A)-8 b(TE)32
+b(k)m(eyw)m(ord)g(already)f(exists)227 4352 y(in)j(the)h(header,)i
+(then)d(this)g(subroutine)f(will)g(simply)f(up)s(date)j(the)g(k)m(eyw)m
+(ord)g(v)-5 b(alue)35 b(in-place)f(with)g(the)227 4465
+y(curren)m(t)c(date.)382 4694 y Fe(FTPDAT\(unit,)44 b(>)k(status\))0
+4924 y Fh(5)81 b Fi(Put)22 b(\(app)s(end\))f(a)i(new)f(k)m(eyw)m(ord)h
+(of)g(the)f(appropriate)g(datat)m(yp)s(e)h(in)m(to)g(the)f(CHU.)h(Note)
+h(that)f(FTPKYS)f(will)227 5036 y(only)32 b(write)g(string)f(v)-5
 b(alues)32 b(up)f(to)j(68)f(c)m(haracters)h(in)d(length;)i(longer)f
-(strings)g(will)d(b)s(e)j(truncated.)47 b(The)227 1670
+(strings)g(will)d(b)s(e)j(truncated.)47 b(The)227 5149
 y(FTPKLS)27 b(routine)g(can)i(b)s(e)f(used)f(to)i(write)e(longer)h
 (strings,)g(using)e(a)j(non-standard)e(FITS)h(con)m(v)m(en)m(tion.)227
-1783 y(The)23 b(E)h(and)f(D)h(v)m(ersions)f(of)h(this)e(routine)h(ha)m
+5262 y(The)23 b(E)h(and)f(D)h(v)m(ersions)f(of)h(this)e(routine)h(ha)m
 (v)m(e)i(the)f(added)f(feature)h(that)g(if)f(the)h('decimals')f
-(parameter)h(is)227 1896 y(negativ)m(e,)h(then)20 b(the)i('G')g(displa)
+(parameter)h(is)227 5375 y(negativ)m(e,)h(then)20 b(the)i('G')g(displa)
 m(y)d(format)i(rather)g(then)g(the)g('E')h(format)f(will)e(b)s(e)h
-(used)g(when)g(constructing)227 2009 y(the)25 b(k)m(eyw)m(ord)f(v)-5
+(used)g(when)g(constructing)227 5488 y(the)25 b(k)m(eyw)m(ord)f(v)-5
 b(alue,)25 b(taking)f(the)h(absolute)f(v)-5 b(alue)23
 b(of)i('decimals')e(for)h(the)g(precision.)37 b(This)22
-b(will)g(suppress)227 2121 y(trailing)32 b(zeros,)k(and)d(will)f(use)h
+b(will)g(suppress)227 5601 y(trailing)32 b(zeros,)k(and)d(will)f(use)h
 (a)i(\014xed)e(format)h(rather)g(than)f(an)h(exp)s(onen)m(tial)f
-(format,)j(dep)s(ending)31 b(on)227 2234 y(the)g(magnitude)e(of)i(the)f
-(v)-5 b(alue.)382 2509 y Fe(FTPKY[JLS]\(unit,keyword,)o(key)o(val,)o
-(comm)o(ent)o(,)42 b(>)47 b(status\))382 2622 y
+(format,)j(dep)s(ending)31 b(on)227 5714 y(the)g(magnitude)e(of)i(the)f
+(v)-5 b(alue.)p eop
+%%Page: 79 85
+79 84 bop 0 299 a Fg(9.4.)72 b(FITS)30 b(HEADER)h(I/O)f(SUBR)m(OUTINES)
+2086 b Fi(79)382 555 y Fe(FTPKY[JLS]\(unit,keyword,)o(key)o(val,)o
+(comm)o(ent)o(,)42 b(>)47 b(status\))382 668 y
 (FTPKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o(ima)o(ls,c)o(omme)o
-(nt,)41 b(>)48 b(status\))0 2897 y Fh(6)81 b Fi(Put)33
+(nt,)41 b(>)48 b(status\))0 915 y Fh(6)81 b Fi(Put)33
 b(\(app)s(end\))h(a)g(string)f(v)-5 b(alued)33 b(k)m(eyw)m(ord)i(in)m
 (to)f(the)h(CHU)f(whic)m(h)f(ma)m(y)h(b)s(e)g(longer)g(than)f(68)i(c)m
-(haracters)227 3010 y(in)i(length.)63 b(This)36 b(uses)i(the)g(Long)g
+(haracters)227 1028 y(in)i(length.)63 b(This)36 b(uses)i(the)g(Long)g
 (String)f(Keyw)m(ord)h(con)m(v)m(en)m(tion)h(that)f(is)f(describ)s(ed)f
-(in)h(the)h("Usage)227 3123 y(Guidelines)30 b(and)h(Suggestions")i
+(in)h(the)h("Usage)227 1141 y(Guidelines)30 b(and)h(Suggestions")i
 (section)f(of)h(this)e(do)s(cumen)m(t.)46 b(Since)32
-b(this)f(uses)h(a)g(non-standard)g(FITS)227 3236 y(con)m(v)m(en)m(tion)
+b(this)f(uses)h(a)g(non-standard)g(FITS)227 1254 y(con)m(v)m(en)m(tion)
 37 b(to)e(enco)s(de)h(the)f(long)g(k)m(eyw)m(ord)g(string,)h(programs)e
 (whic)m(h)g(use)h(this)f(routine)g(should)f(also)227
-3349 y(call)d(the)g(FTPLSW)g(routine)g(to)h(add)e(some)i(COMMENT)f(k)m
+1367 y(call)d(the)g(FTPLSW)g(routine)g(to)h(add)e(some)i(COMMENT)f(k)m
 (eyw)m(ords)h(to)g(w)m(arn)f(users)f(of)i(the)f(FITS)g(\014le)227
-3462 y(that)36 b(this)e(con)m(v)m(en)m(tion)j(is)d(b)s(eing)g(used.)55
+1480 y(that)36 b(this)e(con)m(v)m(en)m(tion)j(is)d(b)s(eing)g(used.)55
 b(FTPLSW)35 b(also)g(writes)g(a)g(k)m(eyw)m(ord)h(called)f(LONGSTRN)f
-(to)227 3575 y(record)c(the)h(v)m(ersion)e(of)i(the)f(longstring)f(con)
+(to)227 1593 y(record)c(the)h(v)m(ersion)e(of)i(the)f(longstring)f(con)
 m(v)m(en)m(tion)i(that)g(has)f(b)s(een)g(used,)f(in)g(case)i(a)g(new)f
-(con)m(v)m(en)m(tion)227 3688 y(is)e(adopted)h(at)g(some)g(p)s(oin)m(t)
+(con)m(v)m(en)m(tion)227 1705 y(is)e(adopted)h(at)g(some)g(p)s(oin)m(t)
 e(in)h(the)g(future.)40 b(If)28 b(the)g(LONGSTRN)g(k)m(eyw)m(ord)h(is)f
-(already)g(presen)m(t)g(in)g(the)227 3801 y(header,)j(then)f(FTPLSW)g
+(already)g(presen)m(t)g(in)g(the)227 1818 y(header,)j(then)f(FTPLSW)g
 (will)d(simply)h(return)i(and)f(will)f(not)j(write)e(duplicate)g(k)m
-(eyw)m(ords.)382 4076 y Fe(FTPKLS\(unit,keyword,keyv)o(al,)o(comm)o
-(ent,)41 b(>)47 b(status\))382 4189 y(FTPLSW\(unit,)d(>)k(status\))0
-4464 y Fh(7)81 b Fi(Put)30 b(\(app)s(end\))g(a)h(new)f(k)m(eyw)m(ord)h
+(eyw)m(ords.)382 2065 y Fe(FTPKLS\(unit,keyword,keyv)o(al,)o(comm)o
+(ent,)41 b(>)47 b(status\))382 2178 y(FTPLSW\(unit,)d(>)k(status\))0
+2425 y Fh(7)81 b Fi(Put)30 b(\(app)s(end\))g(a)h(new)f(k)m(eyw)m(ord)h
 (with)e(an)i(unde\014ned,)e(or)h(n)m(ull,)f(v)-5 b(alue)30
 b(in)m(to)h(the)g(CHU.)g(The)f(v)-5 b(alue)30 b(string)227
-4577 y(of)h(the)f(k)m(eyw)m(ord)h(is)f(left)g(blank)f(in)g(this)g
-(case.)382 4852 y Fe(FTPKYU\(unit,keyword,comm)o(ent)o(,)42
-b(>)47 b(status\))0 5127 y Fh(8)81 b Fi(Put)41 b(\(app)s(end\))g(a)i(n)
+2538 y(of)h(the)f(k)m(eyw)m(ord)h(is)f(left)g(blank)f(in)g(this)g
+(case.)382 2785 y Fe(FTPKYU\(unit,keyword,comm)o(ent)o(,)42
+b(>)47 b(status\))0 3032 y Fh(8)81 b Fi(Put)41 b(\(app)s(end\))g(a)i(n)
 m(um)m(b)s(ered)d(sequence)j(of)f(k)m(eyw)m(ords)g(in)m(to)g(the)h
-(CHU.)f(One)f(ma)m(y)i(app)s(end)d(the)j(same)227 5240
+(CHU.)f(One)f(ma)m(y)i(app)s(end)d(the)j(same)227 3145
 y(commen)m(t)37 b(to)g(ev)m(ery)g(k)m(eyw)m(ord)g(\(and)f(eliminate)e
 (the)j(need)f(to)h(ha)m(v)m(e)g(an)f(arra)m(y)h(of)f(iden)m(tical)f
-(commen)m(t)227 5352 y(strings,)i(one)f(for)g(eac)m(h)h(k)m(eyw)m
+(commen)m(t)227 3258 y(strings,)i(one)f(for)g(eac)m(h)h(k)m(eyw)m
 (ord\))g(b)m(y)f(including)d(the)j(amp)s(ersand)e(c)m(haracter)k(as)e
-(the)h(last)f(non-blank)227 5465 y(c)m(haracter)h(in)d(the)i
+(the)h(last)f(non-blank)227 3371 y(c)m(haracter)h(in)d(the)i
 (\(\014rst\))f(COMMENTS)f(string)g(parameter.)56 b(This)34
-b(same)h(string)g(will)d(then)j(b)s(e)g(used)227 5578
+b(same)h(string)g(will)d(then)j(b)s(e)g(used)227 3484
 y(for)30 b(the)g(commen)m(t)h(\014eld)e(in)f(all)h(the)h(k)m(eyw)m
 (ords.)41 b(\(Note)32 b(that)e(the)g(SPP)f(v)m(ersion)h(of)g(these)g
-(routines)f(only)227 5691 y(supp)s(orts)g(a)i(single)e(commen)m(t)i
-(string\).)p eop
-%%Page: 71 77
-71 76 bop 0 299 a Fg(8.4.)72 b(FITS)30 b(HEADER)h(I/O)f(SUBR)m(OUTINES)
-2086 b Fi(71)382 555 y Fe(FTPKN[JLS]\(unit,keyroot,)o(sta)o(rtno)o
-(,no_)o(key)o(s,ke)o(yval)o(s,c)o(omme)o(nts,)41 b(>)47
-b(status\))382 668 y(FTPKN[EDFG]\(unit,keyroot)o(,st)o(artn)o(o,no)o
-(_ke)o(ys,k)o(eyva)o(ls,)o(deci)o(mals)o(,co)o(mmen)o(ts,)41
-b(>)907 781 y(status\))0 1065 y Fh(9)81 b Fi(Cop)m(y)21
-b(an)h(indexed)e(k)m(eyw)m(ord)j(from)e(one)h(HDU)h(to)f(another,)i(mo)
-s(difying)c(the)i(index)e(n)m(um)m(b)s(er)g(of)i(the)g(k)m(eyw)m(ord)
-227 1178 y(name)37 b(in)e(the)h(pro)s(cess.)58 b(F)-8
-b(or)37 b(example,)h(this)d(routine)h(could)f(read)h(the)h(TLMIN3)f(k)m
-(eyw)m(ord)h(from)f(the)227 1291 y(input)27 b(HDU)i(\(b)m(y)f(giving)f
-(k)m(eyro)s(ot)j(=)d("TLMIN")i(and)f(inn)m(um)e(=)i(3\))h(and)f(write)f
-(it)h(to)h(the)f(output)g(HDU)227 1404 y(with)35 b(the)h(k)m(eyw)m(ord)
-h(name)f(TLMIN4)g(\(b)m(y)g(setting)h(outn)m(um)e(=)h(4\).)58
+(routines)f(only)227 3597 y(supp)s(orts)g(a)i(single)e(commen)m(t)i
+(string\).)382 3844 y Fe(FTPKN[JLS]\(unit,keyroot,)o(sta)o(rtno)o(,no_)
+o(key)o(s,ke)o(yval)o(s,c)o(omme)o(nts,)41 b(>)47 b(status\))382
+3957 y(FTPKN[EDFG]\(unit,keyroot)o(,st)o(artn)o(o,no)o(_ke)o(ys,k)o
+(eyva)o(ls,)o(deci)o(mals)o(,co)o(mmen)o(ts,)41 b(>)907
+4070 y(status\))0 4317 y Fh(9)81 b Fi(Cop)m(y)21 b(an)h(indexed)e(k)m
+(eyw)m(ord)j(from)e(one)h(HDU)h(to)f(another,)i(mo)s(difying)c(the)i
+(index)e(n)m(um)m(b)s(er)g(of)i(the)g(k)m(eyw)m(ord)227
+4430 y(name)37 b(in)e(the)h(pro)s(cess.)58 b(F)-8 b(or)37
+b(example,)h(this)d(routine)h(could)f(read)h(the)h(TLMIN3)f(k)m(eyw)m
+(ord)h(from)f(the)227 4542 y(input)27 b(HDU)i(\(b)m(y)f(giving)f(k)m
+(eyro)s(ot)j(=)d("TLMIN")i(and)f(inn)m(um)e(=)i(3\))h(and)f(write)f(it)
+h(to)h(the)f(output)g(HDU)227 4655 y(with)35 b(the)h(k)m(eyw)m(ord)h
+(name)f(TLMIN4)g(\(b)m(y)g(setting)h(outn)m(um)e(=)h(4\).)58
 b(If)36 b(the)g(input)e(k)m(eyw)m(ord)j(do)s(es)f(not)227
-1517 y(exist,)31 b(then)f(this)f(routine)g(simply)f(returns)h(without)h
-(indicating)e(an)i(error.)382 1801 y Fe(FTCPKYinunit,)44
+4768 y(exist,)31 b(then)f(this)f(routine)g(simply)f(returns)h(without)h
+(indicating)e(an)i(error.)382 5015 y Fe(FTCPKYinunit,)44
 b(outunit,)i(innum,)g(outnum,)f(keyroot,)h(>)h(status\))0
-2086 y Fh(10)f Fi(Put)33 b(\(app)s(end\))f(a)h('triple)f(precision')g
+5262 y Fh(10)f Fi(Put)33 b(\(app)s(end\))f(a)h('triple)f(precision')g
 (k)m(eyw)m(ord)h(in)m(to)g(the)h(CHU)f(in)f(F28.16)j(format.)49
-b(The)33 b(\015oating)g(p)s(oin)m(t)227 2199 y(k)m(eyw)m(ord)d(v)-5
+b(The)33 b(\015oating)g(p)s(oin)m(t)227 5375 y(k)m(eyw)m(ord)d(v)-5
 b(alue)29 b(is)f(constructed)i(b)m(y)f(concatenating)i(the)e(input)f
 (in)m(teger)i(v)-5 b(alue)28 b(with)g(the)i(input)d(double)227
-2312 y(precision)20 b(fraction)i(v)-5 b(alue)22 b(\(whic)m(h)f(m)m(ust)
+5488 y(precision)20 b(fraction)i(v)-5 b(alue)22 b(\(whic)m(h)f(m)m(ust)
 h(ha)m(v)m(e)h(a)f(v)-5 b(alue)22 b(b)s(et)m(w)m(een)h(0.0)g(and)e
-(1.0\).)40 b(The)21 b(FTGKYT)h(routine)227 2425 y(should)34
+(1.0\).)40 b(The)21 b(FTGKYT)h(routine)227 5601 y(should)34
 b(b)s(e)i(used)f(to)i(read)f(this)e(k)m(eyw)m(ord)j(v)-5
 b(alue,)37 b(b)s(ecause)f(the)g(other)h(k)m(eyw)m(ord)f(reading)f
-(subroutines)227 2537 y(will)28 b(not)j(preserv)m(e)f(the)h(full)d
-(precision)g(of)j(the)f(v)-5 b(alue.)382 2822 y Fe
-(FTPKYT\(unit,keyword,intv)o(al,)o(dblv)o(al,c)o(omm)o(ent,)41
-b(>)48 b(status\))0 3106 y Fh(11)e Fi(W)-8 b(rite)35
-b(k)m(eyw)m(ords)h(to)f(the)h(CHDU)f(that)h(are)f(de\014ned)f(in)f(an)i
-(ASCI)s(I)f(template)h(\014le.)54 b(The)34 b(format)i(of)f(the)227
-3219 y(template)c(\014le)f(is)f(describ)s(ed)f(under)h(the)i(ftgthd)f
-(routine)f(b)s(elo)m(w.)382 3503 y Fe(FTPKTP\(unit,)44
-b(filename,)i(>)h(status\))0 3788 y Fh(12)f Fi(App)s(end)28
+(subroutines)227 5714 y(will)28 b(not)j(preserv)m(e)f(the)h(full)d
+(precision)g(of)j(the)f(v)-5 b(alue.)p eop
+%%Page: 80 86
+80 85 bop 0 299 a Fi(80)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)382
+555 y Fe(FTPKYT\(unit,keyword,intv)o(al,)o(dblv)o(al,c)o(omm)o(ent,)41
+b(>)48 b(status\))0 850 y Fh(11)e Fi(W)-8 b(rite)35 b(k)m(eyw)m(ords)h
+(to)f(the)h(CHDU)f(that)h(are)f(de\014ned)f(in)f(an)i(ASCI)s(I)f
+(template)h(\014le.)54 b(The)34 b(format)i(of)f(the)227
+963 y(template)c(\014le)f(is)f(describ)s(ed)f(under)h(the)i(ftgthd)f
+(routine)f(b)s(elo)m(w.)382 1258 y Fe(FTPKTP\(unit,)44
+b(filename,)i(>)h(status\))0 1552 y Fh(12)f Fi(App)s(end)28
 b(the)i(ph)m(ysical)e(units)h(string)g(to)h(an)g(existing)f(k)m(eyw)m
 (ord.)41 b(This)28 b(routine)h(uses)g(a)h(lo)s(cal)g(con)m(v)m(en)m
-(tion,)227 3901 y(sho)m(wn)i(in)f(the)i(follo)m(wing)e(example,)i(in)e
+(tion,)227 1665 y(sho)m(wn)i(in)f(the)i(follo)m(wing)e(example,)i(in)e
 (whic)m(h)g(the)i(k)m(eyw)m(ord)g(units)e(are)i(enclosed)f(in)f(square)
-h(brac)m(k)m(ets)227 4014 y(in)d(the)i(b)s(eginning)d(of)i(the)h(k)m
-(eyw)m(ord)g(commen)m(t)g(\014eld.)239 4298 y Fe(VELOCITY=)809
-b(12.3)46 b(/)i([km/s])e(orbital)g(speed)382 4524 y
+h(brac)m(k)m(ets)227 1778 y(in)d(the)i(b)s(eginning)d(of)i(the)h(k)m
+(eyw)m(ord)g(commen)m(t)g(\014eld.)239 2073 y Fe(VELOCITY=)809
+b(12.3)46 b(/)i([km/s])e(orbital)g(speed)382 2299 y
 (FTPUNT\(unit,keyword,unit)o(s,)41 b(>)48 b(status\))0
-4843 y Fb(8.4.4)112 b(Insert)38 b(Keyw)m(ord)f(Subroutines)0
-5071 y Fh(1)81 b Fi(Insert)26 b(a)h(new)f(k)m(eyw)m(ord)h(record)g(in)m
+2630 y Fb(9.4.4)112 b(Insert)38 b(Keyw)m(ord)f(Subroutines)0
+2865 y Fh(1)81 b Fi(Insert)26 b(a)h(new)f(k)m(eyw)m(ord)h(record)g(in)m
 (to)f(the)h(CHU)g(at)g(the)g(sp)s(eci\014ed)e(p)s(osition)g(\(i.e.,)j
-(immediately)d(preceding)227 5183 y(the)34 b(\(k)m(eyno\)th)g(k)m(eyw)m
+(immediately)d(preceding)227 2978 y(the)34 b(\(k)m(eyno\)th)g(k)m(eyw)m
 (ord)g(in)e(the)i(header.\))49 b(This)32 b('insert)g(record')i
-(subroutine)d(is)h(somewhat)i(less)f(e\016-)227 5296
+(subroutine)d(is)h(somewhat)i(less)f(e\016-)227 3091
 y(cien)m(t)27 b(then)g(the)g('app)s(end)e(record')i(subroutine)e
 (\(FTPREC\))h(describ)s(ed)f(ab)s(o)m(v)m(e)j(b)s(ecause)f(the)g
-(remaining)227 5409 y(k)m(eyw)m(ords)k(in)e(the)i(header)f(ha)m(v)m(e)h
-(to)g(b)s(e)f(shifted)f(do)m(wn)h(one)h(slot.)382 5694
-y Fe(FTIREC\(unit,key_no,card,)41 b(>)47 b(status\))p
-eop
-%%Page: 72 78
-72 77 bop 0 299 a Fi(72)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fh(2)81 b Fi(Insert)36 b(a)h(new)f(k)m(eyw)m(ord)i(in)m(to)f(the)
-g(CHU.)g(The)f(new)g(k)m(eyw)m(ord)i(is)e(inserted)f(immediately)g
-(follo)m(wing)h(the)227 668 y(last)26 b(k)m(eyw)m(ord)h(that)f(has)g(b)
-s(een)g(read)g(from)f(the)h(header.)40 b(The)25 b(FTIKLS)g(subroutine)f
-(w)m(orks)i(the)g(same)h(as)227 781 y(the)h(FTIKYS)e(subroutine,)g
-(except)j(it)e(also)g(supp)s(orts)f(long)h(string)f(v)-5
+(remaining)227 3204 y(k)m(eyw)m(ords)k(in)e(the)i(header)f(ha)m(v)m(e)h
+(to)g(b)s(e)f(shifted)f(do)m(wn)h(one)h(slot.)382 3499
+y Fe(FTIREC\(unit,key_no,card,)41 b(>)47 b(status\))0
+3793 y Fh(2)81 b Fi(Insert)36 b(a)h(new)f(k)m(eyw)m(ord)i(in)m(to)f
+(the)g(CHU.)g(The)f(new)g(k)m(eyw)m(ord)i(is)e(inserted)f(immediately)g
+(follo)m(wing)h(the)227 3906 y(last)26 b(k)m(eyw)m(ord)h(that)f(has)g
+(b)s(een)g(read)g(from)f(the)h(header.)40 b(The)25 b(FTIKLS)g
+(subroutine)f(w)m(orks)i(the)g(same)h(as)227 4019 y(the)h(FTIKYS)e
+(subroutine,)g(except)j(it)e(also)g(supp)s(orts)f(long)h(string)f(v)-5
 b(alues)27 b(greater)h(than)f(68)h(c)m(haracters)227
-894 y(in)35 b(length.)58 b(These)36 b('insert)f(k)m(eyw)m(ord')i
+4132 y(in)35 b(length.)58 b(These)36 b('insert)f(k)m(eyw)m(ord')i
 (subroutines)d(are)j(somewhat)g(less)e(e\016cien)m(t)i(then)f(the)g
-('app)s(end)227 1007 y(k)m(eyw)m(ord')30 b(subroutines)d(describ)s(ed)g
+('app)s(end)227 4245 y(k)m(eyw)m(ord')30 b(subroutines)d(describ)s(ed)g
 (ab)s(o)m(v)m(e)j(b)s(ecause)f(the)g(remaining)f(k)m(eyw)m(ords)h(in)f
-(the)h(header)g(ha)m(v)m(e)h(to)227 1120 y(b)s(e)g(shifted)f(do)m(wn)h
-(one)h(slot.)382 1362 y Fe(FTIKY[JLS]\(unit,keyword,)o(key)o(val,)o
-(comm)o(ent)o(,)42 b(>)47 b(status\))382 1475 y
-(FTIKLS\(unit,keyword,keyv)o(al,)o(comm)o(ent,)41 b(>)47
-b(status\))382 1588 y(FTIKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o
-(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))0 1831
-y Fh(3)81 b Fi(Insert)32 b(a)i(new)f(k)m(eyw)m(ord)h(with)e(an)h
+(the)h(header)g(ha)m(v)m(e)h(to)227 4358 y(b)s(e)g(shifted)f(do)m(wn)h
+(one)h(slot.)382 4653 y Fe(FTIKEY\(unit,)44 b(card,)j(>)g(status\))382
+4766 y(FTIKY[JLS]\(unit,keyword,)o(key)o(val,)o(comm)o(ent)o(,)42
+b(>)47 b(status\))382 4878 y(FTIKLS\(unit,keyword,keyv)o(al,)o(comm)o
+(ent,)41 b(>)47 b(status\))382 4991 y(FTIKY[EDFG]\(unit,keyword)o(,ke)o
+(yval)o(,dec)o(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))0
+5286 y Fh(3)81 b Fi(Insert)32 b(a)i(new)f(k)m(eyw)m(ord)h(with)e(an)h
 (unde\014ned,)g(or)g(n)m(ull,)f(v)-5 b(alue)33 b(in)m(to)h(the)f(CHU.)h
-(The)f(v)-5 b(alue)33 b(string)f(of)i(the)227 1944 y(k)m(eyw)m(ord)d
-(is)f(left)g(blank)f(in)g(this)g(case.)382 2187 y Fe
-(FTIKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47 b(status\))0
-2475 y Fb(8.4.5)112 b(Read)38 b(Keyw)m(ord)g(Subroutines)0
-2694 y Fi(These)29 b(routines)e(return)h(the)h(v)-5 b(alue)28
-b(of)h(the)g(sp)s(eci\014ed)e(k)m(eyw)m(ord\(s\).)41
+(The)f(v)-5 b(alue)33 b(string)f(of)i(the)227 5399 y(k)m(eyw)m(ord)d
+(is)f(left)g(blank)f(in)g(this)g(case.)382 5694 y Fe
+(FTIKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47 b(status\))p
+eop
+%%Page: 81 87
+81 86 bop 0 299 a Fg(9.4.)72 b(FITS)30 b(HEADER)h(I/O)f(SUBR)m(OUTINES)
+2086 b Fi(81)0 555 y Fb(9.4.5)112 b(Read)38 b(Keyw)m(ord)g(Subroutines)
+0 774 y Fi(These)29 b(routines)e(return)h(the)h(v)-5
+b(alue)28 b(of)h(the)g(sp)s(eci\014ed)e(k)m(eyw)m(ord\(s\).)41
 b(Wild)28 b(card)g(c)m(haracters)i(\(*,)h(?,)e(or)g(#\))f(ma)m(y)0
-2806 y(b)s(e)f(used)h(when)f(sp)s(ecifying)f(the)i(name)g(of)g(the)g(k)
-m(eyw)m(ord)h(to)g(b)s(e)e(read:)39 b(a)29 b(')10 b(?')40
+887 y(b)s(e)f(used)h(when)f(sp)s(ecifying)f(the)i(name)g(of)g(the)g(k)m
+(eyw)m(ord)h(to)g(b)s(e)e(read:)39 b(a)29 b(')10 b(?')40
 b(will)25 b(matc)m(h)k(an)m(y)g(single)d(c)m(haracter)0
-2919 y(at)38 b(that)g(p)s(osition)d(in)h(the)i(k)m(eyw)m(ord)g(name)f
+1000 y(at)38 b(that)g(p)s(osition)d(in)h(the)i(k)m(eyw)m(ord)g(name)f
 (and)g(a)g('*')i(will)34 b(matc)m(h)k(an)m(y)g(length)f(\(including)d
-(zero\))k(string)f(of)0 3032 y(c)m(haracters.)65 b(The)37
+(zero\))k(string)f(of)0 1113 y(c)m(haracters.)65 b(The)37
 b('#')h(c)m(haracter)h(will)c(matc)m(h)k(an)m(y)f(consecutiv)m(e)h
 (string)e(of)h(decimal)f(digits)f(\(0)j(-)f(9\).)64 b(Note)0
-3145 y(that)30 b(when)f(a)g(wild)e(card)j(is)e(used)h(in)f(the)i(input)
+1226 y(that)30 b(when)f(a)g(wild)e(card)j(is)e(used)h(in)f(the)i(input)
 d(k)m(eyw)m(ord)j(name,)g(the)g(routine)e(will)f(only)i(searc)m(h)h
-(for)f(a)h(matc)m(h)0 3258 y(from)h(the)h(curren)m(t)g(header)g(p)s
+(for)f(a)h(matc)m(h)0 1339 y(from)h(the)h(curren)m(t)g(header)g(p)s
 (osition)e(to)i(the)h(end)e(of)h(the)g(header.)45 b(It)32
 b(will)d(not)j(resume)g(the)g(searc)m(h)g(from)g(the)0
-3371 y(top)i(of)h(the)f(header)g(bac)m(k)h(to)g(the)f(original)e
+1452 y(top)i(of)h(the)f(header)g(bac)m(k)h(to)g(the)f(original)e
 (header)i(p)s(osition)e(as)j(is)e(done)h(when)f(no)h(wildcards)d(are)k
-(included)0 3484 y(in)e(the)h(k)m(eyw)m(ord)h(name.)52
+(included)0 1564 y(in)e(the)h(k)m(eyw)m(ord)h(name.)52
 b(If)33 b(the)h(desired)f(k)m(eyw)m(ord)i(string)e(is)g(8-c)m
 (haracters)j(long)e(\(the)g(maxim)m(um)f(length)h(of)0
-3597 y(a)i(k)m(eyw)m(ord)g(name\))g(then)g(a)g('*')g(ma)m(y)h(b)s(e)e
+1677 y(a)i(k)m(eyw)m(ord)g(name\))g(then)g(a)g('*')g(ma)m(y)h(b)s(e)e
 (app)s(ended)f(as)h(the)h(nin)m(th)f(c)m(haracter)i(of)f(the)f(input)f
-(name)i(to)g(force)0 3710 y(the)31 b(k)m(eyw)m(ord)g(searc)m(h)h(to)f
+(name)i(to)g(force)0 1790 y(the)31 b(k)m(eyw)m(ord)g(searc)m(h)h(to)f
 (stop)g(at)g(the)g(end)f(of)h(the)g(header)g(\(e.g.,)i('COMMENT)d(*')i
-(will)c(searc)m(h)j(for)g(the)g(next)0 3823 y(COMMENT)37
+(will)c(searc)m(h)j(for)g(the)g(next)0 1903 y(COMMENT)37
 b(k)m(eyw)m(ord\).)64 b(The)37 b(\013grec)i(routine)e(ma)m(y)h(b)s(e)f
 (used)g(to)i(set)f(the)g(starting)f(p)s(osition)f(when)h(doing)0
-3936 y(wild)28 b(card)i(searc)m(hes.)0 4178 y Fh(1)81
+2016 y(wild)28 b(card)i(searc)m(hes.)0 2264 y Fh(1)81
 b Fi(Get)37 b(the)f(n)m(th)f(80-c)m(haracter)k(header)d(record)g(from)f
 (the)h(CHU.)h(The)e(\014rst)g(k)m(eyw)m(ord)i(in)d(the)i(header)g(is)f
-(at)227 4291 y(k)m(ey)p 365 4291 28 4 v 34 w(no)42 b(=)f(1;)49
-b(if)41 b(k)m(ey)p 996 4291 V 34 w(no)h(=)f(0)i(then)e(this)g
+(at)227 2377 y(k)m(ey)p 365 2377 28 4 v 34 w(no)42 b(=)f(1;)49
+b(if)41 b(k)m(ey)p 996 2377 V 34 w(no)h(=)f(0)i(then)e(this)g
 (subroutine)f(simple)g(mo)m(v)m(es)k(the)e(in)m(ternal)f(p)s(oin)m(ter)
-g(to)i(the)227 4404 y(b)s(eginning)33 b(of)j(the)g(header)f(so)h(that)g
+g(to)i(the)227 2490 y(b)s(eginning)33 b(of)j(the)g(header)f(so)h(that)g
 (subsequen)m(t)f(k)m(eyw)m(ord)h(op)s(erations)f(will)e(start)j(at)g
-(the)g(top)g(of)g(the)227 4517 y(header;)31 b(it)f(also)g(returns)f(a)i
+(the)g(top)g(of)g(the)227 2603 y(header;)31 b(it)f(also)g(returns)f(a)i
 (blank)e(card)h(v)-5 b(alue)30 b(in)f(this)g(case.)382
-4760 y Fe(FTGREC\(unit,key_no,)42 b(>)48 b(card,status\))0
-5003 y Fh(2)81 b Fi(Get)31 b(the)g(name,)f(v)-5 b(alue)30
+2850 y Fe(FTGREC\(unit,key_no,)42 b(>)48 b(card,status\))0
+3098 y Fh(2)81 b Fi(Get)31 b(the)g(name,)f(v)-5 b(alue)30
 b(\(as)h(a)g(string\),)f(and)g(commen)m(t)i(of)e(the)h(n)m(th)f(k)m
-(eyw)m(ord)h(in)e(CHU.)i(This)e(routine)g(also)227 5115
+(eyw)m(ord)h(in)e(CHU.)i(This)e(routine)g(also)227 3211
 y(c)m(hec)m(ks)i(that)f(the)g(returned)e(k)m(eyw)m(ord)i(name)f(\(KEYW)
 m(ORD\))i(con)m(tains)f(only)e(legal)h(ASCI)s(I)f(c)m(haracters.)227
-5228 y(Call)h(FTGREC)h(and)g(FTPSV)m(C)g(to)h(b)m(ypass)f(this)f(error)
-h(c)m(hec)m(k.)382 5471 y Fe(FTGKYN\(unit,key_no,)42
-b(>)48 b(keyword,value,comment,st)o(atu)o(s\))0 5714
+3324 y(Call)h(FTGREC)h(and)g(FTPSV)m(C)g(to)h(b)m(ypass)f(this)f(error)
+h(c)m(hec)m(k.)382 3572 y Fe(FTGKYN\(unit,key_no,)42
+b(>)48 b(keyword,value,comment,st)o(atu)o(s\))0 3819
 y Fh(3)81 b Fi(Get)31 b(the)g(80-c)m(haracter)i(header)d(record)g(for)g
-(the)h(named)f(k)m(eyw)m(ord)p eop
-%%Page: 73 79
-73 78 bop 0 299 a Fg(8.4.)72 b(FITS)30 b(HEADER)h(I/O)f(SUBR)m(OUTINES)
-2086 b Fi(73)382 555 y Fe(FTGCRD\(unit,keyword,)42 b(>)48
-b(card,status\))0 833 y Fh(4)81 b Fi(Get)26 b(the)f(next)h(k)m(eyw)m
-(ord)f(whose)g(name)h(matc)m(hes)g(one)f(of)h(the)f(strings)f(in)g
-('inclist')g(but)g(do)s(es)h(not)g(matc)m(h)i(an)m(y)227
-946 y(of)32 b(the)f(strings)f(in)g('exclist'.)43 b(The)30
+(the)h(named)f(k)m(eyw)m(ord)382 4067 y Fe(FTGCRD\(unit,keyword,)42
+b(>)48 b(card,status\))0 4315 y Fh(4)81 b Fi(Get)26 b(the)f(next)h(k)m
+(eyw)m(ord)f(whose)g(name)h(matc)m(hes)g(one)f(of)h(the)f(strings)f(in)
+g('inclist')g(but)g(do)s(es)h(not)g(matc)m(h)i(an)m(y)227
+4428 y(of)32 b(the)f(strings)f(in)g('exclist'.)43 b(The)30
 b(strings)g(in)g(inclist)f(and)i(exclist)f(ma)m(y)i(con)m(tain)g(wild)c
-(card)j(c)m(haracters)227 1059 y(\(*,)38 b(?,)e(and)e(#\))i(as)f
+(card)j(c)m(haracters)227 4541 y(\(*,)38 b(?,)e(and)e(#\))i(as)f
 (describ)s(ed)e(at)j(the)f(b)s(eginning)d(of)k(this)e(section.)55
-b(This)33 b(routine)h(searc)m(hes)i(from)f(the)227 1172
+b(This)33 b(routine)h(searc)m(hes)i(from)f(the)227 4654
 y(curren)m(t)28 b(header)f(p)s(osition)f(to)i(the)g(end)f(of)h(the)g
 (header,)g(only)-8 b(,)28 b(and)f(do)s(es)g(not)h(con)m(tin)m(ue)g(the)
-g(searc)m(h)g(from)227 1284 y(the)41 b(top)g(of)g(the)g(header)g(bac)m
+g(searc)m(h)g(from)227 4767 y(the)41 b(top)g(of)g(the)g(header)g(bac)m
 (k)h(to)f(the)g(original)e(p)s(osition.)71 b(The)40 b(curren)m(t)h
-(header)f(p)s(osition)f(ma)m(y)j(b)s(e)227 1397 y(reset)33
+(header)f(p)s(osition)f(ma)m(y)j(b)s(e)227 4880 y(reset)33
 b(with)d(the)i(ftgrec)h(routine.)43 b(Note)33 b(that)g(nexc)f(ma)m(y)g
 (b)s(e)f(set)h(=)g(0)g(if)e(there)i(are)g(no)g(k)m(eyw)m(ords)g(to)h(b)
-s(e)227 1510 y(excluded.)40 b(This)28 b(routine)i(returns)f(status)i(=)
+s(e)227 4993 y(excluded.)40 b(This)28 b(routine)i(returns)f(status)i(=)
 f(202)h(if)f(a)g(matc)m(hing)h(k)m(eyw)m(ord)g(is)e(not)i(found.)382
-1788 y Fe(FTGNXK\(unit,inclist,ninc)o(,ex)o(clis)o(t,ne)o(xc,)41
-b(>)48 b(card,status\))0 2066 y Fh(5)81 b Fi(Get)30 b(the)g(literal)f
+5240 y Fe(FTGNXK\(unit,inclist,ninc)o(,ex)o(clis)o(t,ne)o(xc,)41
+b(>)48 b(card,status\))0 5488 y Fh(5)81 b Fi(Get)30 b(the)g(literal)f
 (k)m(eyw)m(ord)h(v)-5 b(alue)29 b(as)h(a)g(c)m(haracter)i(string.)39
 b(Regardless)30 b(of)g(the)g(datat)m(yp)s(e)g(of)g(the)g(k)m(eyw)m
-(ord,)227 2179 y(this)36 b(routine)g(simply)f(returns)h(the)h(string)f
+(ord,)227 5601 y(this)36 b(routine)g(simply)f(returns)h(the)h(string)f
 (of)h(c)m(haracters)i(in)c(the)j(v)-5 b(alue)36 b(\014eld)g(of)h(the)g
-(k)m(eyw)m(ord)h(along)227 2291 y(with)29 b(the)i(commen)m(t)g
-(\014eld.)382 2569 y Fe(FTGKEY\(unit,keyword,)42 b(>)48
-b(value,comment,status\))0 2847 y Fh(6)81 b Fi(Get)31
-b(a)g(k)m(eyw)m(ord)g(v)-5 b(alue)29 b(\(with)h(the)g(appropriate)g
-(datat)m(yp)s(e\))h(and)f(commen)m(t)i(from)e(the)g(CHU)382
-3124 y Fe(FTGKY[EDJLS]\(unit,keywor)o(d,)41 b(>)48 b
-(keyval,comment,status\))0 3402 y Fh(7)81 b Fi(Get)24
-b(a)g(sequence)g(of)g(n)m(um)m(b)s(ered)e(k)m(eyw)m(ord)i(v)-5
-b(alues.)37 b(These)24 b(routines)e(do)h(not)h(supp)s(ort)e(wild)f
-(card)i(c)m(haracters)227 3515 y(in)29 b(the)i(ro)s(ot)g(name.)382
-3793 y Fe(FTGKN[EDJLS]\(unit,keyroo)o(t,s)o(tart)o(no,m)o(ax_)o(keys)o
-(,)42 b(>)47 b(keyvals,nfound,status\))0 4070 y Fh(8)81
+(k)m(eyw)m(ord)h(along)227 5714 y(with)29 b(the)i(commen)m(t)g
+(\014eld.)p eop
+%%Page: 82 88
+82 87 bop 0 299 a Fi(82)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)382
+555 y Fe(FTGKEY\(unit,keyword,)42 b(>)48 b(value,comment,status\))0
+817 y Fh(6)81 b Fi(Get)31 b(a)g(k)m(eyw)m(ord)g(v)-5
+b(alue)29 b(\(with)h(the)g(appropriate)g(datat)m(yp)s(e\))h(and)f
+(commen)m(t)i(from)e(the)g(CHU)382 1079 y Fe(FTGKY[EDJLS]\(unit,keywor)
+o(d,)41 b(>)48 b(keyval,comment,status\))0 1341 y Fh(7)81
+b Fi(Get)24 b(a)g(sequence)g(of)g(n)m(um)m(b)s(ered)e(k)m(eyw)m(ord)i
+(v)-5 b(alues.)37 b(These)24 b(routines)e(do)h(not)h(supp)s(ort)e(wild)
+f(card)i(c)m(haracters)227 1454 y(in)29 b(the)i(ro)s(ot)g(name.)382
+1716 y Fe(FTGKN[EDJLS]\(unit,keyroo)o(t,s)o(tart)o(no,m)o(ax_)o(keys)o
+(,)42 b(>)47 b(keyvals,nfound,status\))0 1977 y Fh(8)81
 b Fi(Get)27 b(the)f(v)-5 b(alue)25 b(of)i(a)f(\015oating)g(p)s(oin)m(t)
 f(k)m(eyw)m(ord,)j(returning)c(the)i(in)m(teger)g(and)g(fractional)f
-(parts)h(of)g(the)g(v)-5 b(alue)227 4183 y(in)31 b(separate)h
+(parts)h(of)g(the)g(v)-5 b(alue)227 2090 y(in)31 b(separate)h
 (subroutine)e(argumen)m(ts.)45 b(This)30 b(subroutine)f(ma)m(y)k(b)s(e)
 e(used)g(to)h(read)g(an)m(y)g(k)m(eyw)m(ord)g(but)f(is)227
-4296 y(esp)s(ecially)e(useful)f(for)j(reading)e(the)i('triple)e
+2203 y(esp)s(ecially)e(useful)f(for)j(reading)e(the)i('triple)e
 (precision')f(k)m(eyw)m(ords)j(written)f(b)m(y)g(FTPKYT.)382
-4574 y Fe(FTGKYT\(unit,keyword,)42 b(>)48 b(intval,dblval,comment,s)o
-(tat)o(us\))0 4851 y Fh(9)81 b Fi(Get)24 b(the)g(ph)m(ysical)f(units)f
+2465 y Fe(FTGKYT\(unit,keyword,)42 b(>)48 b(intval,dblval,comment,s)o
+(tat)o(us\))0 2727 y Fh(9)81 b Fi(Get)24 b(the)g(ph)m(ysical)f(units)f
 (string)g(in)h(an)g(existing)g(k)m(eyw)m(ord.)39 b(This)22
 b(routine)h(uses)g(a)h(lo)s(cal)f(con)m(v)m(en)m(tion,)k(sho)m(wn)227
-4964 y(in)32 b(the)i(follo)m(wing)d(example,)j(in)e(whic)m(h)g(the)h(k)
+2840 y(in)32 b(the)i(follo)m(wing)d(example,)j(in)e(whic)m(h)g(the)h(k)
 m(eyw)m(ord)h(units)e(are)h(enclosed)g(in)f(square)h(brac)m(k)m(ets)i
-(in)d(the)227 5077 y(b)s(eginning)g(of)j(the)g(k)m(eyw)m(ord)g(commen)m
+(in)d(the)227 2953 y(b)s(eginning)g(of)j(the)g(k)m(eyw)m(ord)g(commen)m
 (t)h(\014eld.)52 b(A)35 b(blank)f(string)f(is)h(returned)g(if)f(no)i
-(units)e(are)i(de\014ned)227 5190 y(for)30 b(the)h(k)m(eyw)m(ord.)191
-5468 y Fe(VELOCITY=)809 b(12.3)46 b(/)i([km/s])e(orbital)g(speed)382
-5694 y(FTGUNT\(unit,keyword,)c(>)48 b(units,status\))p
-eop
-%%Page: 74 80
-74 79 bop 0 299 a Fi(74)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fb(8.4.6)112 b(Mo)s(dify)38 b(Keyw)m(ord)f(Subroutines)0
-776 y Fi(Wild)30 b(card)h(c)m(haracters,)j(as)e(describ)s(ed)d(in)h
+(units)e(are)i(de\014ned)227 3066 y(for)30 b(the)h(k)m(eyw)m(ord.)191
+3328 y Fe(VELOCITY=)809 b(12.3)46 b(/)i([km/s])e(orbital)g(speed)382
+3553 y(FTGUNT\(unit,keyword,)c(>)48 b(units,status\))0
+3846 y Fb(9.4.6)112 b(Mo)s(dify)38 b(Keyw)m(ord)f(Subroutines)0
+4066 y Fi(Wild)30 b(card)h(c)m(haracters,)j(as)e(describ)s(ed)d(in)h
 (the)i(Read)g(Keyw)m(ord)f(section,)h(ab)s(o)m(v)m(e,)h(ma)m(y)g(b)s(e)
-d(used)h(when)g(sp)s(eci-)0 889 y(fying)e(the)i(name)f(of)h(the)f(k)m
-(eyw)m(ord)h(to)g(b)s(e)f(mo)s(di\014ed.)0 1158 y Fh(1)81
+d(used)h(when)g(sp)s(eci-)0 4179 y(fying)e(the)i(name)f(of)h(the)f(k)m
+(eyw)m(ord)h(to)g(b)s(e)f(mo)s(di\014ed.)0 4441 y Fh(1)81
 b Fi(Mo)s(dify)29 b(\(o)m(v)m(erwrite\))i(the)g(n)m(th)f(80-c)m
-(haracter)j(header)d(record)h(in)e(the)h(CHU)382 1426
+(haracter)j(header)d(record)h(in)e(the)h(CHU)382 4702
 y Fe(FTMREC\(unit,key_no,card,)41 b(>)47 b(status\))0
-1695 y Fh(2)81 b Fi(Mo)s(dify)36 b(\(o)m(v)m(erwrite\))j(the)f(80-c)m
+4964 y Fh(2)81 b Fi(Mo)s(dify)36 b(\(o)m(v)m(erwrite\))j(the)f(80-c)m
 (haracter)j(header)c(record)h(for)f(the)h(named)f(k)m(eyw)m(ord)h(in)f
-(the)h(CHU.)g(This)227 1808 y(can)31 b(b)s(e)f(used)f(to)i(o)m(v)m
+(the)h(CHU.)g(This)227 5077 y(can)31 b(b)s(e)f(used)f(to)i(o)m(v)m
 (erwrite)g(the)g(name)f(of)h(the)f(k)m(eyw)m(ord)h(as)g(w)m(ell)e(as)i
 (its)f(v)-5 b(alue)29 b(and)h(commen)m(t)i(\014elds.)382
-2077 y Fe(FTMCRD\(unit,keyword,card)o(,)42 b(>)47 b(status\))0
-2345 y Fh(3)81 b Fi(Mo)s(dify)32 b(\(o)m(v)m(erwrite\))k(the)e(name)g
+5339 y Fe(FTMCRD\(unit,keyword,card)o(,)42 b(>)47 b(status\))0
+5601 y Fh(3)81 b Fi(Mo)s(dify)32 b(\(o)m(v)m(erwrite\))k(the)e(name)g
 (of)h(an)f(existing)f(k)m(eyw)m(ord)h(in)f(the)i(CHU)f(preserving)e
-(the)j(curren)m(t)e(v)-5 b(alue)227 2458 y(and)30 b(commen)m(t)h
-(\014elds.)382 2727 y Fe(FTMNAM\(unit,oldkey,keywo)o(rd,)41
-b(>)48 b(status\))0 2995 y Fh(4)81 b Fi(Mo)s(dify)29
-b(\(o)m(v)m(erwrite\))i(the)g(commen)m(t)g(\014eld)e(of)i(an)f
-(existing)f(k)m(eyw)m(ord)i(in)e(the)i(CHU)382 3264 y
-Fe(FTMCOM\(unit,keyword,comm)o(ent)o(,)42 b(>)47 b(status\))0
-3533 y Fh(5)81 b Fi(Mo)s(dify)23 b(the)i(v)-5 b(alue)24
-b(and)g(commen)m(t)i(\014elds)d(of)i(an)f(existing)g(k)m(eyw)m(ord)h
-(in)e(the)i(CHU.)g(The)f(FTMKLS)g(subrou-)227 3646 y(tine)34
-b(w)m(orks)f(the)h(same)h(as)f(the)g(FTMKYS)f(subroutine,)g(except)i
-(it)f(also)f(supp)s(orts)f(long)i(string)f(v)-5 b(alues)227
-3759 y(greater)38 b(than)f(68)h(c)m(haracters)g(in)e(length.)59
-b(Optionally)-8 b(,)37 b(one)g(ma)m(y)h(mo)s(dify)d(only)h(the)h(v)-5
-b(alue)36 b(\014eld)g(and)227 3872 y(lea)m(v)m(e)31 b(the)e(commen)m(t)
-i(\014eld)d(unc)m(hanged)h(b)m(y)g(setting)g(the)h(input)d(COMMENT)i
-(parameter)h(equal)f(to)h(the)227 3984 y(amp)s(ersand)f(c)m(haracter)k
-(\(&\).)42 b(The)30 b(E)g(and)g(D)h(v)m(ersions)f(of)h(this)f(routine)f
-(ha)m(v)m(e)j(the)f(added)f(feature)h(that)227 4097 y(if)25
-b(the)i('decimals')e(parameter)i(is)e(negativ)m(e,)k(then)d(the)g('G')h
-(displa)m(y)d(format)j(rather)f(then)g(the)g('E')h(format)227
-4210 y(will)f(b)s(e)i(used)f(when)h(constructing)g(the)g(k)m(eyw)m(ord)
-h(v)-5 b(alue,)29 b(taking)f(the)h(absolute)f(v)-5 b(alue)28
-b(of)g('decimals')g(for)227 4323 y(the)37 b(precision.)58
+(the)j(curren)m(t)e(v)-5 b(alue)227 5714 y(and)30 b(commen)m(t)h
+(\014elds.)p eop
+%%Page: 83 89
+83 88 bop 0 299 a Fg(9.4.)72 b(FITS)30 b(HEADER)h(I/O)f(SUBR)m(OUTINES)
+2086 b Fi(83)382 555 y Fe(FTMNAM\(unit,oldkey,keywo)o(rd,)41
+b(>)48 b(status\))0 823 y Fh(4)81 b Fi(Mo)s(dify)29 b(\(o)m(v)m
+(erwrite\))i(the)g(commen)m(t)g(\014eld)e(of)i(an)f(existing)f(k)m(eyw)
+m(ord)i(in)e(the)i(CHU)382 1091 y Fe(FTMCOM\(unit,keyword,comm)o(ent)o
+(,)42 b(>)47 b(status\))0 1358 y Fh(5)81 b Fi(Mo)s(dify)23
+b(the)i(v)-5 b(alue)24 b(and)g(commen)m(t)i(\014elds)d(of)i(an)f
+(existing)g(k)m(eyw)m(ord)h(in)e(the)i(CHU.)g(The)f(FTMKLS)g(subrou-)
+227 1471 y(tine)34 b(w)m(orks)f(the)h(same)h(as)f(the)g(FTMKYS)f
+(subroutine,)g(except)i(it)f(also)f(supp)s(orts)f(long)i(string)f(v)-5
+b(alues)227 1584 y(greater)38 b(than)f(68)h(c)m(haracters)g(in)e
+(length.)59 b(Optionally)-8 b(,)37 b(one)g(ma)m(y)h(mo)s(dify)d(only)h
+(the)h(v)-5 b(alue)36 b(\014eld)g(and)227 1697 y(lea)m(v)m(e)31
+b(the)e(commen)m(t)i(\014eld)d(unc)m(hanged)h(b)m(y)g(setting)g(the)h
+(input)d(COMMENT)i(parameter)h(equal)f(to)h(the)227 1810
+y(amp)s(ersand)f(c)m(haracter)k(\(&\).)42 b(The)30 b(E)g(and)g(D)h(v)m
+(ersions)f(of)h(this)f(routine)f(ha)m(v)m(e)j(the)f(added)f(feature)h
+(that)227 1923 y(if)25 b(the)i('decimals')e(parameter)i(is)e(negativ)m
+(e,)k(then)d(the)g('G')h(displa)m(y)d(format)j(rather)f(then)g(the)g
+('E')h(format)227 2036 y(will)f(b)s(e)i(used)f(when)h(constructing)g
+(the)g(k)m(eyw)m(ord)h(v)-5 b(alue,)29 b(taking)f(the)h(absolute)f(v)-5
+b(alue)28 b(of)g('decimals')g(for)227 2149 y(the)37 b(precision.)58
 b(This)34 b(will)g(suppress)h(trailing)f(zeros,)39 b(and)d(will)e(use)j
-(a)g(\014xed)e(format)i(rather)g(than)f(an)227 4436 y(exp)s(onen)m
+(a)g(\014xed)e(format)i(rather)g(than)f(an)227 2262 y(exp)s(onen)m
 (tial)30 b(format,)h(dep)s(ending)c(on)k(the)f(magnitude)g(of)g(the)h
-(v)-5 b(alue.)382 4705 y Fe(FTMKY[JLS]\(unit,keyword,)o(key)o(val,)o
-(comm)o(ent)o(,)42 b(>)47 b(status\))382 4818 y
+(v)-5 b(alue.)382 2530 y Fe(FTMKY[JLS]\(unit,keyword,)o(key)o(val,)o
+(comm)o(ent)o(,)42 b(>)47 b(status\))382 2642 y
 (FTMKLS\(unit,keyword,keyv)o(al,)o(comm)o(ent,)41 b(>)47
-b(status\))382 4931 y(FTMKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o
-(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))0 5199
+b(status\))382 2755 y(FTMKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o
+(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))0 3023
 y Fh(6)81 b Fi(Mo)s(dify)21 b(the)h(v)-5 b(alue)22 b(of)g(an)g
 (existing)g(k)m(eyw)m(ord)g(to)h(b)s(e)f(unde\014ned,)g(or)g(n)m(ull.)
 36 b(The)22 b(v)-5 b(alue)21 b(string)h(of)g(the)g(k)m(eyw)m(ord)227
-5312 y(is)29 b(set)i(to)g(blank.)39 b(Optionally)-8 b(,)28
+3136 y(is)29 b(set)i(to)g(blank.)39 b(Optionally)-8 b(,)28
 b(one)i(ma)m(y)h(lea)m(v)m(e)g(the)g(commen)m(t)g(\014eld)d(unc)m
-(hanged)i(b)m(y)g(setting)g(the)g(input)227 5425 y(COMMENT)g(parameter)
+(hanged)i(b)m(y)g(setting)g(the)g(input)227 3249 y(COMMENT)g(parameter)
 h(equal)f(to)h(the)g(amp)s(ersand)e(c)m(haracter)j(\(&\).)382
-5694 y Fe(FTMKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47
-b(status\))p eop
-%%Page: 75 81
-75 80 bop 0 299 a Fg(8.5.)72 b(D)m(A)-8 b(T)g(A)32 b(SCALING)e(AND)h
-(UNDEFINED)h(PIXEL)e(P)-8 b(ARAMETERS)1083 b Fi(75)0
-555 y Fb(8.4.7)112 b(Up)s(date)39 b(Keyw)m(ord)e(Subroutines)0
-768 y Fh(1)81 b Fi(Up)s(date)36 b(an)g(80-c)m(haracter)j(record)d(in)f
-(the)i(CHU.)f(If)g(the)g(sp)s(eci\014ed)f(k)m(eyw)m(ord)i(already)e
-(exists)h(then)g(that)227 881 y(header)j(record)f(will)e(b)s(e)i
-(replaced)h(with)e(the)i(input)e(CARD)h(string.)65 b(If)38
-b(it)h(do)s(es)f(not)h(exist)f(then)h(the)227 994 y(new)f(record)g
-(will)d(b)s(e)i(added)h(to)g(the)g(header.)64 b(The)37
-b(FTUKLS)g(subroutine)f(w)m(orks)i(the)g(same)h(as)f(the)227
-1107 y(FTUKYS)28 b(subroutine,)f(except)j(it)e(also)h(supp)s(orts)d
+3517 y Fe(FTMKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47
+b(status\))0 3817 y Fb(9.4.7)112 b(Up)s(date)39 b(Keyw)m(ord)e
+(Subroutines)0 4032 y Fh(1)81 b Fi(Up)s(date)36 b(an)g(80-c)m(haracter)
+j(record)d(in)f(the)i(CHU.)f(If)g(the)g(sp)s(eci\014ed)f(k)m(eyw)m(ord)
+i(already)e(exists)h(then)g(that)227 4144 y(header)j(record)f(will)e(b)
+s(e)i(replaced)h(with)e(the)i(input)e(CARD)h(string.)65
+b(If)38 b(it)h(do)s(es)f(not)h(exist)f(then)h(the)227
+4257 y(new)f(record)g(will)d(b)s(e)i(added)h(to)g(the)g(header.)64
+b(The)37 b(FTUKLS)g(subroutine)f(w)m(orks)i(the)g(same)h(as)f(the)227
+4370 y(FTUKYS)28 b(subroutine,)f(except)j(it)e(also)h(supp)s(orts)d
 (long)i(string)g(v)-5 b(alues)28 b(greater)i(than)e(68)h(c)m(haracters)
-h(in)227 1219 y(length.)382 1484 y Fe(FTUCRD\(unit,keyword,card)o(,)42
-b(>)47 b(status\))0 1749 y Fh(2)81 b Fi(Up)s(date)44
+h(in)227 4483 y(length.)382 4751 y Fe(FTUCRD\(unit,keyword,card)o(,)42
+b(>)47 b(status\))0 5019 y Fh(2)81 b Fi(Up)s(date)44
 b(the)i(v)-5 b(alue)44 b(and)h(commen)m(t)h(\014elds)d(of)i(a)h(k)m
 (eyw)m(ord)f(in)f(the)h(CHU.)h(The)e(sp)s(eci\014ed)f(k)m(eyw)m(ord)j
-(is)227 1862 y(mo)s(di\014ed)37 b(if)g(it)h(already)g(exists)g(\(b)m(y)
+(is)227 5132 y(mo)s(di\014ed)37 b(if)g(it)h(already)g(exists)g(\(b)m(y)
 h(calling)e(FTMKYx\))i(otherwise)e(a)i(new)f(k)m(eyw)m(ord)h(is)f
-(created)h(b)m(y)227 1975 y(calling)c(FTPKYx.)58 b(The)36
+(created)h(b)m(y)227 5245 y(calling)c(FTPKYx.)58 b(The)36
 b(E)g(and)f(D)i(v)m(ersions)e(of)i(this)e(routine)g(ha)m(v)m(e)i(the)g
-(added)e(feature)i(that)g(if)e(the)227 2088 y('decimals')30
+(added)e(feature)i(that)g(if)e(the)227 5357 y('decimals')30
 b(parameter)i(is)e(negativ)m(e,)i(then)e(the)h('G')h(displa)m(y)d
 (format)i(rather)g(then)f(the)h('E')g(format)h(will)227
-2200 y(b)s(e)41 b(used)f(when)h(constructing)g(the)g(k)m(eyw)m(ord)h(v)
+5470 y(b)s(e)41 b(used)f(when)h(constructing)g(the)g(k)m(eyw)m(ord)h(v)
 -5 b(alue,)44 b(taking)d(the)g(absolute)g(v)-5 b(alue)41
-b(of)h('decimals')e(for)227 2313 y(the)d(precision.)58
+b(of)h('decimals')e(for)227 5583 y(the)d(precision.)58
 b(This)34 b(will)g(suppress)h(trailing)f(zeros,)39 b(and)d(will)e(use)j
-(a)g(\014xed)e(format)i(rather)g(than)f(an)227 2426 y(exp)s(onen)m
+(a)g(\014xed)e(format)i(rather)g(than)f(an)227 5696 y(exp)s(onen)m
 (tial)30 b(format,)h(dep)s(ending)c(on)k(the)f(magnitude)g(of)g(the)h
-(v)-5 b(alue.)382 2691 y Fe(FTUKY[JLS]\(unit,keyword,)o(key)o(val,)o
-(comm)o(ent)o(,)42 b(>)47 b(status\))382 2804 y
-(FTUKLS\(unit,keyword,keyv)o(al,)o(comm)o(ent,)41 b(>)47
-b(status\))382 2917 y(FTUKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o
-(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))0 3181
-y Fh(3)81 b Fi(Up)s(date)23 b(the)g(v)-5 b(alue)23 b(of)h(an)f
-(existing)g(k)m(eyw)m(ord)h(to)g(b)s(e)f(unde\014ned,)f(or)i(n)m(ull,)f
-(or)g(insert)g(a)g(new)g(unde\014ned-v)-5 b(alue)227
-3294 y(k)m(eyw)m(ord)30 b(if)e(it)h(do)s(esn't)g(already)g(exist.)40
-b(The)29 b(v)-5 b(alue)29 b(string)f(of)h(the)h(k)m(eyw)m(ord)f(is)g
-(left)g(blank)f(in)f(this)i(case.)382 3559 y Fe
-(FTUKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47 b(status\))0
-3855 y Fb(8.4.8)112 b(Delete)37 b(Keyw)m(ord)g(Subroutines)0
-4068 y Fh(1)81 b Fi(Delete)31 b(an)f(existing)f(k)m(eyw)m(ord)i
+(v)-5 b(alue.)p eop
+%%Page: 84 90
+84 89 bop 0 299 a Fi(84)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)382
+555 y Fe(FTUKY[JLS]\(unit,keyword,)o(key)o(val,)o(comm)o(ent)o(,)42
+b(>)47 b(status\))382 668 y(FTUKLS\(unit,keyword,keyv)o(al,)o(comm)o
+(ent,)41 b(>)47 b(status\))382 781 y(FTUKY[EDFG]\(unit,keyword)o(,ke)o
+(yval)o(,dec)o(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))0
+1044 y Fh(3)81 b Fi(Up)s(date)23 b(the)g(v)-5 b(alue)23
+b(of)h(an)f(existing)g(k)m(eyw)m(ord)h(to)g(b)s(e)f(unde\014ned,)f(or)i
+(n)m(ull,)f(or)g(insert)g(a)g(new)g(unde\014ned-v)-5
+b(alue)227 1157 y(k)m(eyw)m(ord)30 b(if)e(it)h(do)s(esn't)g(already)g
+(exist.)40 b(The)29 b(v)-5 b(alue)29 b(string)f(of)h(the)h(k)m(eyw)m
+(ord)f(is)g(left)g(blank)f(in)f(this)i(case.)382 1420
+y Fe(FTUKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47 b(status\))0
+1715 y Fb(9.4.8)112 b(Delete)37 b(Keyw)m(ord)g(Subroutines)0
+1927 y Fh(1)81 b Fi(Delete)31 b(an)f(existing)f(k)m(eyw)m(ord)i
 (record.)40 b(The)30 b(space)h(previously)d(o)s(ccupied)h(b)m(y)h(the)g
-(k)m(eyw)m(ord)h(is)e(reclaimed)227 4181 y(b)m(y)d(mo)m(ving)g(all)f
+(k)m(eyw)m(ord)h(is)e(reclaimed)227 2040 y(b)m(y)d(mo)m(ving)g(all)f
 (the)h(follo)m(wing)f(header)h(records)g(up)f(one)h(ro)m(w)h(in)d(the)j
 (header.)39 b(The)25 b(\014rst)h(routine)f(deletes)227
-4294 y(a)34 b(k)m(eyw)m(ord)f(at)h(a)g(sp)s(eci\014ed)d(p)s(osition)g
+2153 y(a)34 b(k)m(eyw)m(ord)f(at)h(a)g(sp)s(eci\014ed)d(p)s(osition)g
 (in)h(the)h(header)g(\(the)h(\014rst)e(k)m(eyw)m(ord)i(is)e(at)i(p)s
-(osition)d(1\),)k(whereas)227 4407 y(the)d(second)g(routine)f(deletes)h
+(osition)d(1\),)k(whereas)227 2266 y(the)d(second)g(routine)f(deletes)h
 (a)g(sp)s(eci\014cally)d(named)i(k)m(eyw)m(ord.)46 b(Wild)30
-b(card)h(c)m(haracters,)j(as)e(describ)s(ed)227 4520
+b(card)h(c)m(haracters,)j(as)e(describ)s(ed)227 2378
 y(in)e(the)h(Read)g(Keyw)m(ord)f(section,)h(ab)s(o)m(v)m(e,)h(ma)m(y)g
 (b)s(e)e(used)g(when)f(sp)s(ecifying)g(the)i(name)g(of)g(the)f(k)m(eyw)
-m(ord)227 4633 y(to)h(b)s(e)f(deleted)g(\(b)s(e)g(careful!\).)382
-4897 y Fe(FTDREC\(unit,key_no,)42 b(>)48 b(status\))382
-5010 y(FTDKEY\(unit,keyword,)42 b(>)48 b(status\))0 5350
-y Fd(8.5)135 b(Data)46 b(Scaling)g(and)e(Unde\014ned)h(Pixel)h(P)l
-(arameters)0 5601 y Fi(These)24 b(subroutines)e(de\014ne)i(or)h(mo)s
+m(ord)227 2491 y(to)h(b)s(e)f(deleted)g(\(b)s(e)g(careful!\).)382
+2755 y Fe(FTDREC\(unit,key_no,)42 b(>)48 b(status\))382
+2867 y(FTDKEY\(unit,keyword,)42 b(>)48 b(status\))0 3205
+y Fd(9.5)135 b(Data)46 b(Scaling)g(and)e(Unde\014ned)h(Pixel)h(P)l
+(arameters)0 3456 y Fi(These)24 b(subroutines)e(de\014ne)i(or)h(mo)s
 (dify)d(the)j(in)m(ternal)e(parameters)i(used)f(b)m(y)g(FITSIO)g(to)h
-(either)f(scale)h(the)f(data)0 5714 y(or)33 b(to)i(represen)m(t)e
+(either)f(scale)h(the)f(data)0 3569 y(or)33 b(to)i(represen)m(t)e
 (unde\014ned)e(pixels.)48 b(Generally)33 b(FITSIO)f(will)f(scale)i(the)
-h(data)g(according)f(to)h(the)g(v)-5 b(alues)33 b(of)p
-eop
-%%Page: 76 82
-76 81 bop 0 299 a Fi(76)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fi(the)i(BSCALE)g(and)f(BZER)m(O)h(\(or)h(TSCALn)d(and)i(TZER)m
+h(data)g(according)f(to)h(the)g(v)-5 b(alues)33 b(of)0
+3682 y(the)f(BSCALE)g(and)f(BZER)m(O)h(\(or)h(TSCALn)d(and)i(TZER)m
 (On\))f(k)m(eyw)m(ords,)i(ho)m(w)m(ev)m(er)h(these)e(subroutines)e(ma)m
-(y)0 668 y(b)s(e)i(used)h(to)h(o)m(v)m(erride)f(the)g(k)m(eyw)m(ord)h
+(y)0 3795 y(b)s(e)i(used)h(to)h(o)m(v)m(erride)f(the)g(k)m(eyw)m(ord)h
 (v)-5 b(alues.)48 b(This)31 b(ma)m(y)j(b)s(e)f(useful)e(when)h(one)i(w)
-m(an)m(ts)f(to)h(read)f(or)g(write)g(the)0 781 y(ra)m(w)d(unscaled)e(v)
--5 b(alues)28 b(in)h(the)g(FITS)g(\014le.)39 b(Similarly)-8
+m(an)m(ts)f(to)h(read)f(or)g(write)g(the)0 3908 y(ra)m(w)d(unscaled)e
+(v)-5 b(alues)28 b(in)h(the)g(FITS)g(\014le.)39 b(Similarly)-8
 b(,)27 b(FITSIO)h(generally)h(uses)g(the)g(v)-5 b(alue)29
-b(of)h(the)f(BLANK)h(or)0 894 y(TNULLn)35 b(k)m(eyw)m(ord)h(to)g
+b(of)h(the)f(BLANK)h(or)0 4021 y(TNULLn)35 b(k)m(eyw)m(ord)h(to)g
 (signify)d(an)j(unde\014ned)d(pixel,)i(but)g(these)h(routines)f(ma)m(y)
-h(b)s(e)e(used)h(to)h(o)m(v)m(erride)g(this)0 1007 y(v)-5
+h(b)s(e)e(used)h(to)h(o)m(v)m(erride)g(this)0 4134 y(v)-5
 b(alue.)40 b(These)30 b(subroutines)e(do)j(not)f(create)i(or)f(mo)s
 (dify)d(the)j(corresp)s(onding)d(header)i(k)m(eyw)m(ord)h(v)-5
-b(alues.)0 1307 y Fh(1)81 b Fi(Reset)26 b(the)g(scaling)e(factors)i(in)
+b(alues.)0 4397 y Fh(1)81 b Fi(Reset)26 b(the)g(scaling)e(factors)i(in)
 e(the)i(primary)e(arra)m(y)i(or)f(image)h(extension;)h(do)s(es)e(not)g
-(c)m(hange)i(the)f(BSCALE)227 1420 y(and)i(BZER)m(O)g(k)m(eyw)m(ord)h
+(c)m(hange)i(the)f(BSCALE)227 4510 y(and)i(BZER)m(O)g(k)m(eyw)m(ord)h
 (v)-5 b(alues)27 b(and)h(only)f(a\013ects)j(the)e(automatic)i(scaling)d
-(p)s(erformed)g(when)g(the)h(data)227 1533 y(elemen)m(ts)e(are)g
+(p)s(erformed)g(when)g(the)h(data)227 4623 y(elemen)m(ts)e(are)g
 (written/read)f(to/from)h(the)g(FITS)f(\014le.)38 b(When)25
 b(reading)g(from)g(a)h(FITS)f(\014le)f(the)i(returned)227
-1646 y(data)i(v)-5 b(alue)27 b(=)g(\(the)h(v)-5 b(alue)27
+4736 y(data)i(v)-5 b(alue)27 b(=)g(\(the)h(v)-5 b(alue)27
 b(giv)m(en)h(in)e(the)h(FITS)g(arra)m(y\))h(*)g(BSCALE)f(+)g(BZER)m(O.)
-g(The)g(in)m(v)m(erse)h(form)m(ula)227 1759 y(is)33 b(used)g(when)g
+g(The)g(in)m(v)m(erse)h(form)m(ula)227 4849 y(is)33 b(used)g(when)g
 (writing)f(data)j(v)-5 b(alues)33 b(to)h(the)g(FITS)g(\014le.)50
 b(\(NOTE:)34 b(BSCALE)f(and)g(BZER)m(O)h(m)m(ust)g(b)s(e)227
-1871 y(declared)c(as)h(Double)f(Precision)f(v)-5 b(ariables\).)382
-2172 y Fe(FTPSCL\(unit,bscale,bzero)o(,)42 b(>)47 b(status\))0
-2472 y Fh(2)81 b Fi(Reset)39 b(the)f(scaling)g(parameters)g(for)h(a)f
+4962 y(declared)c(as)h(Double)f(Precision)f(v)-5 b(ariables\).)382
+5225 y Fe(FTPSCL\(unit,bscale,bzero)o(,)42 b(>)47 b(status\))0
+5488 y Fh(2)81 b Fi(Reset)39 b(the)f(scaling)g(parameters)g(for)h(a)f
 (table)g(column;)k(do)s(es)c(not)g(c)m(hange)i(the)e(TSCALn)f(or)h
-(TZER)m(On)227 2585 y(k)m(eyw)m(ord)29 b(v)-5 b(alues)28
+(TZER)m(On)227 5601 y(k)m(eyw)m(ord)29 b(v)-5 b(alues)28
 b(and)f(only)h(a\013ects)h(the)g(automatic)g(scaling)e(p)s(erformed)g
-(when)g(the)i(data)g(elemen)m(ts)g(are)227 2697 y(written/read)i
+(when)g(the)i(data)g(elemen)m(ts)g(are)227 5714 y(written/read)i
 (to/from)h(the)g(FITS)f(\014le.)43 b(When)31 b(reading)f(from)h(a)h
-(FITS)f(\014le)f(the)i(returned)e(data)i(v)-5 b(alue)227
-2810 y(=)40 b(\(the)h(v)-5 b(alue)39 b(giv)m(en)h(in)f(the)h(FITS)g
-(arra)m(y\))g(*)h(TSCAL)e(+)g(TZER)m(O.)h(The)f(in)m(v)m(erse)h(form)m
-(ula)g(is)f(used)227 2923 y(when)33 b(writing)f(data)j(v)-5
+(FITS)f(\014le)f(the)i(returned)e(data)i(v)-5 b(alue)p
+eop
+%%Page: 85 91
+85 90 bop 0 299 a Fg(9.6.)72 b(FITS)30 b(PRIMAR)-8 b(Y)31
+b(ARRA)-8 b(Y)31 b(OR)f(IMA)m(GE)h(EXTENSION)e(I/O)i(SUBR)m(OUTINES)589
+b Fi(85)227 555 y(=)40 b(\(the)h(v)-5 b(alue)39 b(giv)m(en)h(in)f(the)h
+(FITS)g(arra)m(y\))g(*)h(TSCAL)e(+)g(TZER)m(O.)h(The)f(in)m(v)m(erse)h
+(form)m(ula)g(is)f(used)227 668 y(when)33 b(writing)f(data)j(v)-5
 b(alues)34 b(to)g(the)h(FITS)e(\014le.)51 b(\(NOTE:)34
 b(TSCAL)f(and)g(TZER)m(O)g(m)m(ust)h(b)s(e)f(declared)227
-3036 y(as)e(Double)f(Precision)f(v)-5 b(ariables\).)382
-3336 y Fe(FTTSCL\(unit,colnum,tscal)o(,tz)o(ero,)41 b(>)48
-b(status\))0 3636 y Fh(3)81 b Fi(De\014ne)36 b(the)g(in)m(teger)h(v)-5
+781 y(as)e(Double)f(Precision)f(v)-5 b(ariables\).)382
+1041 y Fe(FTTSCL\(unit,colnum,tscal)o(,tz)o(ero,)41 b(>)48
+b(status\))0 1300 y Fh(3)81 b Fi(De\014ne)36 b(the)g(in)m(teger)h(v)-5
 b(alue)35 b(to)i(b)s(e)e(used)h(to)h(signify)d(unde\014ned)g(pixels)g
-(in)h(the)h(primary)e(arra)m(y)j(or)f(image)227 3749
+(in)h(the)h(primary)e(arra)m(y)j(or)f(image)227 1413
 y(extension.)53 b(This)33 b(is)g(only)h(used)g(if)f(BITPIX)h(=)h(8,)h
 (16,)g(or)f(32.)54 b(This)33 b(do)s(es)h(not)h(create)h(or)e(c)m(hange)
-i(the)227 3862 y(v)-5 b(alue)30 b(of)h(the)f(BLANK)h(k)m(eyw)m(ord)g
-(in)e(the)h(header.)382 4162 y Fe(FTPNUL\(unit,blank,)43
-b(>)k(status\))0 4462 y Fh(4)81 b Fi(De\014ne)36 b(the)g(string)f(to)h
+i(the)227 1526 y(v)-5 b(alue)30 b(of)h(the)f(BLANK)h(k)m(eyw)m(ord)g
+(in)e(the)h(header.)382 1786 y Fe(FTPNUL\(unit,blank,)43
+b(>)k(status\))0 2046 y Fh(4)81 b Fi(De\014ne)36 b(the)g(string)f(to)h
 (b)s(e)f(used)g(to)i(signify)d(unde\014ned)g(pixels)g(in)g(a)i(column)f
-(in)g(an)g(ASCI)s(I)g(table.)57 b(This)227 4575 y(do)s(es)30
+(in)g(an)g(ASCI)s(I)g(table.)57 b(This)227 2158 y(do)s(es)30
 b(not)h(create)h(or)e(c)m(hange)i(the)e(v)-5 b(alue)30
-b(of)h(the)f(TNULLn)g(k)m(eyw)m(ord.)382 4875 y Fe
-(FTSNUL\(unit,colnum,snull)41 b(>)47 b(status\))0 5175
+b(of)h(the)f(TNULLn)g(k)m(eyw)m(ord.)382 2418 y Fe
+(FTSNUL\(unit,colnum,snull)41 b(>)47 b(status\))0 2678
 y Fh(5)81 b Fi(De\014ne)34 b(the)h(v)-5 b(alue)33 b(to)i(b)s(e)f(used)g
 (to)h(signify)d(unde\014ned)g(pixels)h(in)g(an)h(in)m(teger)h(column)e
-(in)g(a)h(binary)f(table)227 5288 y(\(where)c(TF)m(ORMn)f(=)g('B',)i
+(in)g(a)h(binary)f(table)227 2791 y(\(where)c(TF)m(ORMn)f(=)g('B',)i
 ('I',)f(or)f('J'\).)i(This)c(do)s(es)j(not)f(create)j(or)d(c)m(hange)i
-(the)e(v)-5 b(alue)28 b(of)h(the)g(TNULLn)227 5401 y(k)m(eyw)m(ord.)382
-5701 y Fe(FTTNUL\(unit,colnum,tnull)41 b(>)47 b(status\))p
-eop
-%%Page: 77 83
-77 82 bop 0 299 a Fg(8.6.)72 b(FITS)30 b(PRIMAR)-8 b(Y)31
-b(ARRA)-8 b(Y)31 b(OR)f(IMA)m(GE)h(EXTENSION)e(I/O)i(SUBR)m(OUTINES)589
-b Fi(77)0 555 y Fd(8.6)135 b(FITS)44 b(Primary)h(Arra)l(y)g(or)g(IMA)l
-(GE)g(Extension)h(I/O)f(Subroutines)0 805 y Fi(These)26
-b(subroutines)e(put)i(or)h(get)g(data)h(v)-5 b(alues)25
-b(in)h(the)g(primary)f(data)i(arra)m(y)g(\(i.e.,)h(the)f(\014rst)f(HDU)
-h(in)e(the)i(FITS)0 918 y(\014le\))34 b(or)h(an)f(IMA)m(GE)i
-(extension.)53 b(The)34 b(data)i(arra)m(y)f(is)e(represen)m(ted)i(as)g
-(a)g(single)e(one-dimensional)g(arra)m(y)i(of)0 1031
-y(pixels)f(regardless)i(of)g(the)g(actual)g(dimensionalit)m(y)d(of)k
-(the)f(arra)m(y)-8 b(,)38 b(and)e(the)g(FPIXEL)g(parameter)g(giv)m(es)h
-(the)0 1144 y(p)s(osition)26 b(within)e(this)j(1-D)h(arra)m(y)g(of)g
-(the)g(\014rst)e(pixel)g(to)i(read)g(or)f(write.)39 b(Automatic)28
-b(data)g(t)m(yp)s(e)g(con)m(v)m(ersion)g(is)0 1257 y(p)s(erformed)h
+(the)e(v)-5 b(alue)28 b(of)h(the)g(TNULLn)227 2904 y(k)m(eyw)m(ord.)382
+3163 y Fe(FTTNUL\(unit,colnum,tnull)41 b(>)47 b(status\))0
+3497 y Fd(9.6)135 b(FITS)44 b(Primary)h(Arra)l(y)g(or)g(IMA)l(GE)g
+(Extension)h(I/O)f(Subroutines)0 3747 y Fi(These)26 b(subroutines)e
+(put)i(or)h(get)g(data)h(v)-5 b(alues)25 b(in)h(the)g(primary)f(data)i
+(arra)m(y)g(\(i.e.,)h(the)f(\014rst)f(HDU)h(in)e(the)i(FITS)0
+3860 y(\014le\))34 b(or)h(an)f(IMA)m(GE)i(extension.)53
+b(The)34 b(data)i(arra)m(y)f(is)e(represen)m(ted)i(as)g(a)g(single)e
+(one-dimensional)g(arra)m(y)i(of)0 3973 y(pixels)f(regardless)i(of)g
+(the)g(actual)g(dimensionalit)m(y)d(of)k(the)f(arra)m(y)-8
+b(,)38 b(and)e(the)g(FPIXEL)g(parameter)g(giv)m(es)h(the)0
+4086 y(p)s(osition)26 b(within)e(this)j(1-D)h(arra)m(y)g(of)g(the)g
+(\014rst)e(pixel)g(to)i(read)g(or)f(write.)39 b(Automatic)28
+b(data)g(t)m(yp)s(e)g(con)m(v)m(ersion)g(is)0 4199 y(p)s(erformed)h
 (for)i(n)m(umeric)f(data)h(\(except)i(for)d(complex)h(data)g(t)m(yp)s
 (es\))h(if)e(the)h(data)g(t)m(yp)s(e)g(of)g(the)g(primary)e(arra)m(y)0
-1370 y(\(de\014ned)f(b)m(y)g(the)h(BITPIX)f(k)m(eyw)m(ord\))h
+4312 y(\(de\014ned)f(b)m(y)g(the)h(BITPIX)f(k)m(eyw)m(ord\))h
 (di\013ers)f(from)g(the)g(data)i(t)m(yp)s(e)e(of)h(the)g(arra)m(y)g(in)
-e(the)i(calling)e(subroutine.)0 1483 y(The)41 b(data)i(v)-5
+e(the)i(calling)e(subroutine.)0 4425 y(The)41 b(data)i(v)-5
 b(alues)41 b(are)h(also)g(scaled)f(b)m(y)h(the)g(BSCALE)f(and)g(BZER)m
 (O)h(header)f(v)-5 b(alues)41 b(as)h(they)g(are)g(b)s(eing)0
-1596 y(written)31 b(or)h(read)g(from)g(the)g(FITS)g(arra)m(y)-8
+4538 y(written)31 b(or)h(read)g(from)g(the)g(FITS)g(arra)m(y)-8
 b(.)47 b(The)31 b(ftpscl)h(subroutine)e(MUST)h(b)s(e)h(called)f(to)i
-(de\014ne)e(the)i(scaling)0 1709 y(parameters)h(when)e(writing)g(data)i
+(de\014ne)e(the)i(scaling)0 4650 y(parameters)h(when)e(writing)g(data)i
 (to)g(the)g(FITS)f(arra)m(y)h(or)f(to)h(o)m(v)m(erride)g(the)g(default)
-e(scaling)h(v)-5 b(alue)33 b(giv)m(en)g(in)0 1822 y(the)e(header)f
-(when)f(reading)h(the)g(FITS)g(arra)m(y)-8 b(.)0 1982
+e(scaling)h(v)-5 b(alue)33 b(giv)m(en)g(in)0 4763 y(the)e(header)f
+(when)f(reading)h(the)g(FITS)g(arra)m(y)-8 b(.)0 4924
 y(Tw)m(o)41 b(sets)f(of)h(subroutines)d(are)j(pro)m(vided)e(to)i(read)g
 (the)f(data)i(arra)m(y)f(whic)m(h)e(di\013er)g(in)g(the)i(w)m(a)m(y)g
-(unde\014ned)0 2095 y(pixels)33 b(are)j(handled.)54 b(The)35
+(unde\014ned)0 5036 y(pixels)33 b(are)j(handled.)54 b(The)35
 b(\014rst)f(set)i(of)g(routines)e(\(FTGPVx\))i(simply)d(return)h(an)h
-(arra)m(y)h(of)g(data)g(elemen)m(ts)0 2208 y(in)31 b(whic)m(h)g
+(arra)m(y)h(of)g(data)g(elemen)m(ts)0 5149 y(in)31 b(whic)m(h)g
 (unde\014ned)f(pixels)g(are)j(set)f(equal)g(to)h(a)g(v)-5
 b(alue)31 b(sp)s(eci\014ed)g(b)m(y)h(the)g(user)g(in)f(the)h('n)m(ullv)
--5 b(al')30 b(parameter.)0 2320 y(An)k(additional)f(feature)i(of)f
+-5 b(al')30 b(parameter.)0 5262 y(An)k(additional)f(feature)i(of)f
 (these)h(subroutines)e(is)g(that)j(if)d(the)i(user)f(sets)h(n)m(ullv)-5
-b(al)32 b(=)i(0,)i(then)f(no)f(c)m(hec)m(ks)i(for)0 2433
+b(al)32 b(=)i(0,)i(then)f(no)f(c)m(hec)m(ks)i(for)0 5375
 y(unde\014ned)d(pixels)h(will)f(b)s(e)h(p)s(erformed,)i(th)m(us)f
 (increasing)f(the)i(sp)s(eed)e(of)i(the)g(program.)55
-b(The)35 b(second)h(set)g(of)0 2546 y(routines)30 b(\(FTGPFx\))j
+b(The)35 b(second)h(set)g(of)0 5488 y(routines)30 b(\(FTGPFx\))j
 (returns)d(the)i(data)g(elemen)m(t)g(arra)m(y)g(and,)f(in)g(addition,)f
-(a)i(logical)f(arra)m(y)h(whic)m(h)e(de\014nes)0 2659
+(a)i(logical)f(arra)m(y)h(whic)m(h)e(de\014nes)0 5601
 y(whether)40 b(the)g(corresp)s(onding)e(data)j(pixel)e(is)g
 (unde\014ned.)69 b(The)39 b(latter)i(set)g(of)f(subroutines)e(ma)m(y)j
-(b)s(e)f(more)0 2772 y(con)m(v)m(enien)m(t)32 b(to)h(use)e(in)f(some)h
+(b)s(e)f(more)0 5714 y(con)m(v)m(enien)m(t)32 b(to)h(use)e(in)f(some)h
 (circumstances,)h(ho)m(w)m(ev)m(er,)h(it)e(requires)f(an)h(additional)e
-(arra)m(y)j(of)g(logical)f(v)-5 b(alues)0 2885 y(whic)m(h)35
-b(can)h(b)s(e)g(un)m(wieldy)d(when)j(w)m(orking)f(with)g(large)h(data)h
-(arra)m(ys.)58 b(Also)36 b(for)g(programmer)g(con)m(v)m(enience,)0
-2998 y(sets)j(of)g(subroutines)e(to)i(directly)f(read)g(or)h(write)f(2)
-h(and)g(3)g(dimensional)d(arra)m(ys)j(ha)m(v)m(e)h(b)s(een)e(pro)m
-(vided,)i(as)0 3111 y(w)m(ell)29 b(as)h(a)g(set)g(of)g(subroutines)d
-(to)j(read)g(or)g(write)e(an)m(y)i(con)m(tiguous)g(rectangular)g
-(subset)f(of)h(pixels)e(within)f(the)0 3224 y(n-dimensional)g(arra)m(y)
--8 b(.)0 3475 y Fh(1)81 b Fi(Get)30 b(the)g(data)g(t)m(yp)s(e)f(of)h
-(the)g(image)f(\(=)h(BITPIX)f(v)-5 b(alue\).)40 b(P)m(ossible)28
-b(returned)g(v)-5 b(alues)29 b(are:)41 b(8,)30 b(16,)h(32,)g(-32,)227
-3588 y(or)g(-64.)382 3840 y Fe(FTGIDT\(unit,)44 b(>)k(bitpix,status\))0
-4091 y Fh(2)81 b Fi(Get)31 b(the)g(dimension)c(\(n)m(um)m(b)s(er)j(of)g
-(axes)h(=)f(NAXIS\))h(of)f(the)h(image)382 4343 y Fe(FTGIDM\(unit,)44
-b(>)k(naxis,status\))0 4595 y Fh(3)81 b Fi(Get)31 b(the)g(size)f(of)g
-(all)g(the)g(dimensions)e(of)i(the)h(image)382 4846 y
+(arra)m(y)j(of)g(logical)f(v)-5 b(alues)p eop
+%%Page: 86 92
+86 91 bop 0 299 a Fi(86)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
+555 y Fi(whic)m(h)35 b(can)h(b)s(e)g(un)m(wieldy)d(when)j(w)m(orking)f
+(with)g(large)h(data)h(arra)m(ys.)58 b(Also)36 b(for)g(programmer)g
+(con)m(v)m(enience,)0 668 y(sets)j(of)g(subroutines)e(to)i(directly)f
+(read)g(or)h(write)f(2)h(and)g(3)g(dimensional)d(arra)m(ys)j(ha)m(v)m
+(e)h(b)s(een)e(pro)m(vided,)i(as)0 781 y(w)m(ell)29 b(as)h(a)g(set)g
+(of)g(subroutines)d(to)j(read)g(or)g(write)e(an)m(y)i(con)m(tiguous)g
+(rectangular)g(subset)f(of)h(pixels)e(within)f(the)0
+894 y(n-dimensional)g(arra)m(y)-8 b(.)0 1150 y Fh(1)81
+b Fi(Get)30 b(the)g(data)g(t)m(yp)s(e)f(of)h(the)g(image)f(\(=)h
+(BITPIX)f(v)-5 b(alue\).)40 b(P)m(ossible)28 b(returned)g(v)-5
+b(alues)29 b(are:)41 b(8,)30 b(16,)h(32,)g(-32,)227 1263
+y(or)f(-64)h(corresp)s(onding)d(to)j(unsigned)d(b)m(yte,)j(signed)e
+(2-b)m(yte)i(in)m(teger,)g(signed)e(4-b)m(yte)i(in)m(teger,)g(real,)f
+(and)227 1376 y(double.)227 1525 y(The)c(second)f(subroutine)f(is)h
+(similar)e(to)j(FTGIDT,)h(except)f(that)h(if)e(the)g(image)i(pixel)d(v)
+-5 b(alues)25 b(are)h(scaled,)227 1638 y(with)g(non-default)g(v)-5
+b(alues)26 b(for)h(the)h(BZER)m(O)f(and)f(BSCALE)g(k)m(eyw)m(ords,)j
+(then)e(this)f(routine)g(will)e(return)227 1751 y(the)32
+b('equiv)-5 b(alen)m(t')31 b(data)g(t)m(yp)s(e)h(that)f(is)f(needed)h
+(to)h(store)g(the)f(scaled)g(v)-5 b(alues.)42 b(F)-8
+b(or)32 b(example,)f(if)f(BITPIX)227 1864 y(=)39 b(16)g(and)g(BSCALE)f
+(=)g(0.1)i(then)f(the)g(equiv)-5 b(alen)m(t)38 b(data)h(t)m(yp)s(e)g
+(is)f(\015oating)h(p)s(oin)m(t,)h(and)e(-32)i(will)d(b)s(e)227
+1977 y(returned.)65 b(There)39 b(are)g(2)g(sp)s(ecial)f(cases:)58
+b(if)38 b(the)h(image)g(con)m(tains)g(unsigned)e(2-b)m(yte)j(in)m
+(teger)f(v)-5 b(alues,)227 2090 y(with)39 b(BITPIX)h(=)f(16,)44
+b(BSCALE)39 b(=)h(1,)j(and)c(BZER)m(O)h(=)g(32768,)45
+b(then)39 b(this)g(routine)g(will)f(return)h(a)227 2203
+y(non-standard)26 b(v)-5 b(alue)26 b(of)h(20)h(for)f(the)g(bitpix)e(v)
+-5 b(alue.)39 b(Similarly)23 b(if)i(the)j(image)f(con)m(tains)g
+(unsigned)e(4-b)m(yte)227 2316 y(in)m(tegers,)31 b(then)f(bitpix)e
+(will)g(b)s(e)i(returned)f(with)g(a)i(v)-5 b(alue)30
+b(of)g(40.)382 2571 y Fe(FTGIDT\(unit,)44 b(>)k(bitpix,status\))382
+2684 y(FTGIET\(unit,)c(>)k(bitpix,status\))0 2940 y Fh(2)81
+b Fi(Get)31 b(the)g(dimension)c(\(n)m(um)m(b)s(er)j(of)g(axes)h(=)f
+(NAXIS\))h(of)f(the)h(image)382 3196 y Fe(FTGIDM\(unit,)44
+b(>)k(naxis,status\))0 3452 y Fh(3)81 b Fi(Get)31 b(the)g(size)f(of)g
+(all)g(the)g(dimensions)e(of)i(the)h(image)382 3707 y
 Fe(FTGISZ\(unit,)44 b(maxdim,)i(>)i(naxes,status\))0
-5098 y Fh(4)81 b Fi(Get)35 b(the)f(parameters)g(that)h(de\014ne)e(the)h
+3963 y Fh(4)81 b Fi(Get)35 b(the)f(parameters)g(that)h(de\014ne)e(the)h
 (t)m(yp)s(e)g(and)g(size)f(of)i(the)f(image.)52 b(This)32
-b(routine)h(simply)e(com)m(bines)227 5211 y(calls)f(to)h(the)f(ab)s(o)m
-(v)m(e)i(3)f(routines.)382 5462 y Fe(FTGIPR\(unit,)44
+b(routine)h(simply)e(com)m(bines)227 4076 y(calls)f(to)h(the)f(ab)s(o)m
+(v)m(e)i(3)f(routines.)382 4332 y Fe(FTGIPR\(unit,)44
 b(maxdim,)i(>)i(bitpix,)d(naxis,)h(naxes,)h(int)f(*status\))0
-5714 y Fh(5)81 b Fi(Put)30 b(elemen)m(ts)g(in)m(to)h(the)f(data)h(arra)
-m(y)p eop
-%%Page: 78 84
-78 83 bop 0 299 a Fi(78)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)382
-555 y Fe(FTPPR[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o(men)o(ts,v)o
-(alue)o(s,)41 b(>)48 b(status\))0 810 y Fh(6)81 b Fi(Put)30
-b(elemen)m(ts)h(in)m(to)f(the)h(data)g(arra)m(y)-8 b(,)32
-b(substituting)c(the)i(appropriate)g(FITS)g(n)m(ull)e(v)-5
-b(alue)30 b(for)g(all)g(elemen)m(ts)227 922 y(whic)m(h)d(are)g(equal)h
+4588 y Fh(5)81 b Fi(Put)30 b(elemen)m(ts)g(in)m(to)h(the)f(data)h(arra)
+m(y)382 4843 y Fe(FTPPR[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o(men)o
+(ts,v)o(alue)o(s,)41 b(>)48 b(status\))0 5099 y Fh(6)81
+b Fi(Put)30 b(elemen)m(ts)h(in)m(to)f(the)h(data)g(arra)m(y)-8
+b(,)32 b(substituting)c(the)i(appropriate)g(FITS)g(n)m(ull)e(v)-5
+b(alue)30 b(for)g(all)g(elemen)m(ts)227 5212 y(whic)m(h)d(are)g(equal)h
 (to)g(the)f(v)-5 b(alue)27 b(of)h(NULL)-10 b(V)g(AL.)28
 b(F)-8 b(or)28 b(in)m(teger)g(FITS)f(arra)m(ys,)i(the)e(n)m(ull)f(v)-5
-b(alue)27 b(de\014ned)f(b)m(y)227 1035 y(the)k(previous)e(call)h(to)i
+b(alue)27 b(de\014ned)f(b)m(y)227 5325 y(the)k(previous)e(call)h(to)i
 (FTPNUL)e(will)e(b)s(e)i(substituted;)g(for)g(\015oating)h(p)s(oin)m(t)
-f(FITS)g(arra)m(ys)h(\(BITPIX)f(=)227 1148 y(-32)j(or)e(-64\))i(then)e
+f(FITS)g(arra)m(ys)h(\(BITPIX)f(=)227 5438 y(-32)j(or)e(-64\))i(then)e
 (the)h(sp)s(ecial)e(IEEE)g(NaN)i(\(Not-a-Num)m(b)s(er\))h(v)-5
-b(alue)30 b(will)e(b)s(e)i(substituted.)382 1403 y Fe
+b(alue)30 b(will)e(b)s(e)i(substituted.)382 5694 y Fe
 (FTPPN[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o(men)o(ts,v)o(alue)o
-(s,n)o(ullv)o(al)42 b(>)47 b(status\))0 1657 y Fh(7)81
-b Fi(Set)30 b(data)h(arra)m(y)g(elemen)m(ts)g(as)f(unde\014ned)382
-1911 y Fe(FTPPRU\(unit,group,fpixel)o(,ne)o(leme)o(nts,)41
-b(>)47 b(status\))0 2165 y Fh(8)81 b Fi(Get)36 b(elemen)m(ts)f(from)g
-(the)g(data)h(arra)m(y)-8 b(.)55 b(Unde\014ned)34 b(arra)m(y)h(elemen)m
-(ts)h(will)c(b)s(e)j(returned)f(with)f(a)j(v)-5 b(alue)34
-b(=)227 2278 y(n)m(ullv)-5 b(al,)28 b(unless)h(n)m(ullv)-5
-b(al)28 b(=)i(0)h(in)e(whic)m(h)g(case)i(no)g(c)m(hec)m(ks)g(for)g
-(unde\014ned)d(pixels)g(will)g(b)s(e)i(p)s(erformed.)382
-2533 y Fe(FTGPV[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o(men)o(ts,n)o
-(ullv)o(al,)41 b(>)48 b(values,anyf,status\))0 2787 y
-Fh(9)81 b Fi(Get)32 b(elemen)m(ts)f(and)g(n)m(ull\015ags)e(from)i(data)
-h(arra)m(y)-8 b(.)44 b(An)m(y)32 b(unde\014ned)d(arra)m(y)i(elemen)m
-(ts)h(will)c(ha)m(v)m(e)33 b(the)e(corre-)227 2900 y(sp)s(onding)d
-(\015agv)-5 b(als)30 b(elemen)m(t)h(set)g(equal)f(to)h(.TR)m(UE.)382
-3154 y Fe(FTGPF[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o(men)o(ts,)41
-b(>)48 b(values,flagvals,anyf,sta)o(tus)o(\))0 3408 y
-Fh(10)e Fi(Put)30 b(v)-5 b(alues)30 b(in)m(to)g(group)g(parameters)382
-3663 y Fe(FTPGP[BIJED]\(unit,group,)o(fpa)o(rm,n)o(parm)o(,va)o(lues)o
-(,)42 b(>)47 b(status\))0 3917 y Fh(11)f Fi(Get)31 b(v)-5
-b(alues)30 b(from)g(group)g(parameters)382 4171 y Fe
-(FTGGP[BIJED]\(unit,group,)o(fpa)o(rm,n)o(parm)o(,)42
-b(>)47 b(values,status\))0 4426 y Fi(The)32 b(follo)m(wing)e(4)j
+(s,n)o(ullv)o(al)42 b(>)47 b(status\))p eop
+%%Page: 87 93
+87 92 bop 0 299 a Fg(9.6.)72 b(FITS)30 b(PRIMAR)-8 b(Y)31
+b(ARRA)-8 b(Y)31 b(OR)f(IMA)m(GE)h(EXTENSION)e(I/O)i(SUBR)m(OUTINES)589
+b Fi(87)0 555 y Fh(7)81 b Fi(Set)30 b(data)h(arra)m(y)g(elemen)m(ts)g
+(as)f(unde\014ned)382 808 y Fe(FTPPRU\(unit,group,fpixel)o(,ne)o(leme)o
+(nts,)41 b(>)47 b(status\))0 1060 y Fh(8)81 b Fi(Get)36
+b(elemen)m(ts)f(from)g(the)g(data)h(arra)m(y)-8 b(.)55
+b(Unde\014ned)34 b(arra)m(y)h(elemen)m(ts)h(will)c(b)s(e)j(returned)f
+(with)f(a)j(v)-5 b(alue)34 b(=)227 1173 y(n)m(ullv)-5
+b(al,)28 b(unless)h(n)m(ullv)-5 b(al)28 b(=)i(0)h(in)e(whic)m(h)g(case)
+i(no)g(c)m(hec)m(ks)g(for)g(unde\014ned)d(pixels)g(will)g(b)s(e)i(p)s
+(erformed.)382 1425 y Fe(FTGPV[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)
+o(men)o(ts,n)o(ullv)o(al,)41 b(>)48 b(values,anyf,status\))0
+1678 y Fh(9)81 b Fi(Get)32 b(elemen)m(ts)f(and)g(n)m(ull\015ags)e(from)
+i(data)h(arra)m(y)-8 b(.)44 b(An)m(y)32 b(unde\014ned)d(arra)m(y)i
+(elemen)m(ts)h(will)c(ha)m(v)m(e)33 b(the)e(corre-)227
+1791 y(sp)s(onding)d(\015agv)-5 b(als)30 b(elemen)m(t)h(set)g(equal)f
+(to)h(.TR)m(UE.)382 2043 y Fe(FTGPF[BIJED]\(unit,group,)o(fpi)o(xel,)o
+(nele)o(men)o(ts,)41 b(>)48 b(values,flagvals,anyf,sta)o(tus)o(\))0
+2295 y Fh(10)e Fi(Put)30 b(v)-5 b(alues)30 b(in)m(to)g(group)g
+(parameters)382 2548 y Fe(FTPGP[BIJED]\(unit,group,)o(fpa)o(rm,n)o
+(parm)o(,va)o(lues)o(,)42 b(>)47 b(status\))0 2800 y
+Fh(11)f Fi(Get)31 b(v)-5 b(alues)30 b(from)g(group)g(parameters)382
+3053 y Fe(FTGGP[BIJED]\(unit,group,)o(fpa)o(rm,n)o(parm)o(,)42
+b(>)47 b(values,status\))0 3305 y Fi(The)32 b(follo)m(wing)e(4)j
 (subroutines)d(transfer)h(FITS)h(images)g(with)f(2)h(or)g(3)h
 (dimensions)c(to)k(or)f(from)g(a)h(data)f(arra)m(y)0
-4539 y(whic)m(h)g(has)h(b)s(een)g(declared)f(in)g(the)i(calling)e
+3418 y(whic)m(h)g(has)h(b)s(een)g(declared)f(in)g(the)i(calling)e
 (program.)49 b(The)33 b(dimensionalit)m(y)d(of)k(the)f(FITS)g(image)g
-(is)f(passed)0 4652 y(b)m(y)26 b(the)g(naxis1,)g(naxis2,)h(and)e
+(is)f(passed)0 3531 y(b)m(y)26 b(the)g(naxis1,)g(naxis2,)h(and)e
 (naxis3)h(parameters)g(and)f(the)h(declared)g(dimensions)d(of)j(the)g
-(program)g(arra)m(y)h(are)0 4764 y(passed)k(in)e(the)j(dim1)d(and)i
+(program)g(arra)m(y)h(are)0 3644 y(passed)k(in)e(the)j(dim1)d(and)i
 (dim2)f(parameters.)43 b(Note)32 b(that)g(the)f(program)g(arra)m(y)g
 (do)s(es)g(not)g(ha)m(v)m(e)i(to)e(ha)m(v)m(e)i(the)0
-4877 y(same)28 b(dimensions)d(as)j(the)g(FITS)e(arra)m(y)-8
+3757 y(same)28 b(dimensions)d(as)j(the)g(FITS)e(arra)m(y)-8
 b(,)30 b(but)d(m)m(ust)g(b)s(e)g(at)i(least)e(as)h(big.)39
 b(F)-8 b(or)29 b(example)e(if)f(a)i(FITS)f(image)h(with)0
-4990 y(NAXIS1)j(=)f(NAXIS2)h(=)f(400)i(is)d(read)i(in)m(to)f(a)h
+3870 y(NAXIS1)j(=)f(NAXIS2)h(=)f(400)i(is)d(read)i(in)m(to)f(a)h
 (program)f(arra)m(y)h(whic)m(h)e(is)h(dimensioned)e(as)i(512)i(x)f(512)
-g(pixels,)0 5103 y(then)d(the)g(image)h(will)c(just)j(\014ll)e(the)j
+g(pixels,)0 3983 y(then)d(the)g(image)h(will)c(just)j(\014ll)e(the)j
 (lo)m(w)m(er)f(left)g(corner)g(of)h(the)f(arra)m(y)h(with)e(pixels)f
-(in)h(the)i(range)f(1)h(-)f(400)i(in)d(the)0 5216 y(X)32
+(in)h(the)i(range)f(1)h(-)f(400)i(in)d(the)0 4095 y(X)32
 b(an)g(Y)h(directions.)45 b(This)30 b(has)i(the)h(e\013ect)g(of)g
 (taking)f(a)h(con)m(tiguous)f(set)h(of)f(pixel)f(v)-5
-b(alue)32 b(in)e(the)j(FITS)e(arra)m(y)0 5329 y(and)k(writing)e(them)i
+b(alue)32 b(in)e(the)j(FITS)e(arra)m(y)0 4208 y(and)k(writing)e(them)i
 (to)h(a)g(non-con)m(tiguous)f(arra)m(y)g(in)f(program)h(memory)g
-(\(i.e.,)i(there)f(are)f(no)m(w)h(some)f(blank)0 5442
+(\(i.e.,)i(there)f(are)f(no)m(w)h(some)f(blank)0 4321
 y(pixels)29 b(around)g(the)h(edge)i(of)e(the)h(image)f(in)f(the)i
-(program)f(arra)m(y\).)0 5696 y Fh(11)46 b Fi(Put)30
-b(2-D)i(image)e(in)m(to)h(the)f(data)h(arra)m(y)p eop
-%%Page: 79 85
-79 84 bop 0 299 a Fg(8.6.)72 b(FITS)30 b(PRIMAR)-8 b(Y)31
-b(ARRA)-8 b(Y)31 b(OR)f(IMA)m(GE)h(EXTENSION)e(I/O)i(SUBR)m(OUTINES)589
-b Fi(79)382 555 y Fe(FTP2D[BIJED]\(unit,group,)o(dim)o(1,na)o(xis1)o
-(,na)o(xis2)o(,ima)o(ge,)41 b(>)48 b(status\))0 768 y
-Fh(12)e Fi(Put)30 b(3-D)i(cub)s(e)d(in)m(to)i(the)f(data)h(arra)m(y)382
-981 y Fe(FTP3D[BIJED]\(unit,group,)o(dim)o(1,di)o(m2,n)o(axi)o(s1,n)o
+(program)f(arra)m(y\).)0 4574 y Fh(11)46 b Fi(Put)30
+b(2-D)i(image)e(in)m(to)h(the)f(data)h(arra)m(y)382 4826
+y Fe(FTP2D[BIJED]\(unit,group,)o(dim)o(1,na)o(xis1)o(,na)o(xis2)o(,ima)
+o(ge,)41 b(>)48 b(status\))0 5078 y Fh(12)e Fi(Put)30
+b(3-D)i(cub)s(e)d(in)m(to)i(the)f(data)h(arra)m(y)382
+5331 y Fe(FTP3D[BIJED]\(unit,group,)o(dim)o(1,di)o(m2,n)o(axi)o(s1,n)o
 (axis)o(2,n)o(axis)o(3,cu)o(be,)41 b(>)48 b(status\))0
-1194 y Fh(13)e Fi(Get)29 b(2-D)f(image)g(from)g(the)f(data)i(arra)m(y)
+5583 y Fh(13)e Fi(Get)29 b(2-D)f(image)g(from)g(the)f(data)i(arra)m(y)
 -8 b(.)41 b(Unde\014ned)26 b(pixels)f(in)i(the)h(arra)m(y)g(will)d(b)s
-(e)i(set)h(equal)f(to)i(the)e(v)-5 b(alue)227 1307 y(of)31
+(e)i(set)h(equal)f(to)i(the)e(v)-5 b(alue)227 5696 y(of)31
+b('n)m(ullv)-5 b(al',)28 b(unless)h(n)m(ullv)-5 b(al=0)28
+b(in)h(whic)m(h)g(case)j(no)e(testing)h(for)f(unde\014ned)e(pixels)g
+(will)g(b)s(e)i(p)s(erformed.)p eop
+%%Page: 88 94
+88 93 bop 0 299 a Fi(88)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)382
+555 y Fe(FTG2D[BIJED]\(unit,group,)o(nul)o(lval)o(,dim)o(1,n)o(axis)o
+(1,na)o(xis)o(2,)42 b(>)47 b(image,anyf,status\))0 766
+y Fh(14)f Fi(Get)31 b(3-D)h(cub)s(e)e(from)g(the)g(data)h(arra)m(y)-8
+b(.)42 b(Unde\014ned)29 b(pixels)g(in)g(the)h(arra)m(y)h(will)d(b)s(e)i
+(set)h(equal)f(to)h(the)f(v)-5 b(alue)227 879 y(of)31
 b('n)m(ullv)-5 b(al',)28 b(unless)h(n)m(ullv)-5 b(al=0)28
 b(in)h(whic)m(h)g(case)j(no)e(testing)h(for)f(unde\014ned)e(pixels)g
-(will)g(b)s(e)i(p)s(erformed.)382 1520 y Fe(FTG2D[BIJED]\(unit,group,)o
-(nul)o(lval)o(,dim)o(1,n)o(axis)o(1,na)o(xis)o(2,)42
-b(>)47 b(image,anyf,status\))0 1732 y Fh(14)f Fi(Get)31
-b(3-D)h(cub)s(e)e(from)g(the)g(data)h(arra)m(y)-8 b(.)42
-b(Unde\014ned)29 b(pixels)g(in)g(the)h(arra)m(y)h(will)d(b)s(e)i(set)h
-(equal)f(to)h(the)f(v)-5 b(alue)227 1845 y(of)31 b('n)m(ullv)-5
-b(al',)28 b(unless)h(n)m(ullv)-5 b(al=0)28 b(in)h(whic)m(h)g(case)j(no)
-e(testing)h(for)f(unde\014ned)e(pixels)g(will)g(b)s(e)i(p)s(erformed.)
-382 2058 y Fe(FTG3D[BIJED]\(unit,group,)o(nul)o(lval)o(,dim)o(1,d)o
-(im2,)o(naxi)o(s1,)o(naxi)o(s2,n)o(axi)o(s3,)41 b(>)1002
-2171 y(cube,anyf,status\))0 2384 y Fi(The)i(follo)m(wing)e(subroutines)
-g(transfer)i(a)h(rectangular)f(subset)f(of)i(the)f(pixels)e(in)h(a)i
-(FITS)e(N-dimensional)0 2497 y(image)30 b(to)h(or)f(from)f(an)h(arra)m
-(y)g(whic)m(h)f(has)h(b)s(een)f(declared)g(in)g(the)h(calling)f
-(program.)40 b(The)29 b(fpixels)f(and)h(lpixels)0 2610
-y(parameters)e(are)h(in)m(teger)f(arra)m(ys)h(whic)m(h)e(sp)s(ecify)f
-(the)j(starting)f(and)f(ending)g(pixels)f(in)h(eac)m(h)i(dimension)c
-(of)k(the)0 2723 y(FITS)36 b(image)h(that)g(are)g(to)h(b)s(e)e(read)g
-(or)h(written.)59 b(\(Note)38 b(that)g(these)f(are)g(the)g(starting)f
-(and)g(ending)g(pixels)0 2836 y(in)d(the)i(FITS)f(image,)j(not)e(in)e
-(the)i(declared)f(arra)m(y\).)55 b(The)34 b(arra)m(y)i(parameter)f(is)f
-(treated)h(simply)e(as)i(a)g(large)0 2949 y(one-dimensional)28
-b(arra)m(y)i(of)h(the)f(appropriate)f(datat)m(yp)s(e)i(con)m(taining)f
-(the)g(pixel)e(v)-5 b(alues;)30 b(The)f(pixel)g(v)-5
-b(alues)29 b(in)0 3062 y(the)d(FITS)f(arra)m(y)i(are)f(read/written)f
-(from/to)i(this)e(program)g(arra)m(y)i(in)d(strict)i(sequence)g
-(without)f(an)m(y)i(gaps;)g(it)0 3174 y(is)h(up)f(to)j(the)f(calling)e
-(routine)h(to)h(correctly)g(in)m(terpret)f(the)h(dimensionalit)m(y)d
-(of)j(this)f(arra)m(y)-8 b(.)41 b(The)28 b(t)m(w)m(o)i(families)0
-3287 y(of)d(FITS)g(reading)f(routines)g(\(FTGSVx)h(and)g(FTGSFx)g
-(subroutines\))e(also)j(ha)m(v)m(e)g(an)f('incs')g(parameter)g(whic)m
-(h)0 3400 y(de\014nes)j(the)h(data)h(sampling)c(in)m(terv)-5
-b(al)30 b(in)g(eac)m(h)i(dimension)c(of)j(the)g(FITS)f(arra)m(y)-8
-b(.)43 b(F)-8 b(or)32 b(example,)f(if)f(incs\(1\)=2)0
-3513 y(and)j(incs\(2\)=3)g(when)g(reading)f(a)i(2-dimensional)d(FITS)i
-(image,)h(then)f(only)g(ev)m(ery)h(other)f(pixel)f(in)g(the)i(\014rst)0
-3626 y(dimension)c(and)j(ev)m(ery)h(3rd)e(pixel)g(in)g(the)h(second)g
-(dimension)d(will)h(b)s(e)h(returned)g(in)g(the)h('arra)m(y')h
-(parameter.)0 3739 y([Note:)39 b(the)25 b(FTGSSx)f(family)g(of)g
-(routines)g(whic)m(h)g(w)m(ere)h(presen)m(t)g(in)e(previous)g(v)m
-(ersions)h(of)h(FITSIO)f(ha)m(v)m(e)i(b)s(een)0 3852
-y(sup)s(erseded)i(b)m(y)j(the)f(more)h(general)f(FTGSVx)g(family)f(of)i
-(routines.])0 4065 y Fh(15)46 b Fi(Put)30 b(an)g(arbitrary)f(data)i
-(subsection)f(in)m(to)g(the)h(data)g(arra)m(y)-8 b(.)382
-4278 y Fe(FTPSS[BIJED]\(unit,group,)o(nax)o(is,n)o(axes)o(,fp)o(ixel)o
-(s,lp)o(ixe)o(ls,a)o(rray)o(,)42 b(>)47 b(status\))0
-4491 y Fh(16)f Fi(Get)30 b(an)e(arbitrary)f(data)j(subsection)d(from)h
-(the)h(data)g(arra)m(y)-8 b(.)42 b(Unde\014ned)27 b(pixels)f(in)i(the)g
-(arra)m(y)i(will)25 b(b)s(e)j(set)227 4603 y(equal)j(to)i(the)e(v)-5
-b(alue)32 b(of)f('n)m(ullv)-5 b(al',)30 b(unless)g(n)m(ullv)-5
+(will)g(b)s(e)i(p)s(erformed.)382 1089 y Fe(FTG3D[BIJED]\(unit,group,)o
+(nul)o(lval)o(,dim)o(1,d)o(im2,)o(naxi)o(s1,)o(naxi)o(s2,n)o(axi)o(s3,)
+41 b(>)1002 1202 y(cube,anyf,status\))0 1413 y Fi(The)i(follo)m(wing)e
+(subroutines)g(transfer)i(a)h(rectangular)f(subset)f(of)i(the)f(pixels)
+e(in)h(a)i(FITS)e(N-dimensional)0 1525 y(image)30 b(to)h(or)f(from)f
+(an)h(arra)m(y)g(whic)m(h)f(has)h(b)s(een)f(declared)g(in)g(the)h
+(calling)f(program.)40 b(The)29 b(fpixels)f(and)h(lpixels)0
+1638 y(parameters)e(are)h(in)m(teger)f(arra)m(ys)h(whic)m(h)e(sp)s
+(ecify)f(the)j(starting)f(and)f(ending)g(pixels)f(in)h(eac)m(h)i
+(dimension)c(of)k(the)0 1751 y(FITS)36 b(image)h(that)g(are)g(to)h(b)s
+(e)e(read)g(or)h(written.)59 b(\(Note)38 b(that)g(these)f(are)g(the)g
+(starting)f(and)g(ending)g(pixels)0 1864 y(in)d(the)i(FITS)f(image,)j
+(not)e(in)e(the)i(declared)f(arra)m(y\).)55 b(The)34
+b(arra)m(y)i(parameter)f(is)f(treated)h(simply)e(as)i(a)g(large)0
+1977 y(one-dimensional)28 b(arra)m(y)i(of)h(the)f(appropriate)f(datat)m
+(yp)s(e)i(con)m(taining)f(the)g(pixel)e(v)-5 b(alues;)30
+b(The)f(pixel)g(v)-5 b(alues)29 b(in)0 2090 y(the)d(FITS)f(arra)m(y)i
+(are)f(read/written)f(from/to)i(this)e(program)g(arra)m(y)i(in)d
+(strict)i(sequence)g(without)f(an)m(y)i(gaps;)g(it)0
+2203 y(is)h(up)f(to)j(the)f(calling)e(routine)h(to)h(correctly)g(in)m
+(terpret)f(the)h(dimensionalit)m(y)d(of)j(this)f(arra)m(y)-8
+b(.)41 b(The)28 b(t)m(w)m(o)i(families)0 2316 y(of)d(FITS)g(reading)f
+(routines)g(\(FTGSVx)h(and)g(FTGSFx)g(subroutines\))e(also)j(ha)m(v)m
+(e)g(an)f('incs')g(parameter)g(whic)m(h)0 2429 y(de\014nes)j(the)h
+(data)h(sampling)c(in)m(terv)-5 b(al)30 b(in)g(eac)m(h)i(dimension)c
+(of)j(the)g(FITS)f(arra)m(y)-8 b(.)43 b(F)-8 b(or)32
+b(example,)f(if)f(incs\(1\)=2)0 2542 y(and)j(incs\(2\)=3)g(when)g
+(reading)f(a)i(2-dimensional)d(FITS)i(image,)h(then)f(only)g(ev)m(ery)h
+(other)f(pixel)f(in)g(the)i(\014rst)0 2655 y(dimension)c(and)j(ev)m
+(ery)h(3rd)e(pixel)g(in)g(the)h(second)g(dimension)d(will)h(b)s(e)h
+(returned)g(in)g(the)h('arra)m(y')h(parameter.)0 2767
+y([Note:)39 b(the)25 b(FTGSSx)f(family)g(of)g(routines)g(whic)m(h)g(w)m
+(ere)h(presen)m(t)g(in)e(previous)g(v)m(ersions)h(of)h(FITSIO)f(ha)m(v)
+m(e)i(b)s(een)0 2880 y(sup)s(erseded)i(b)m(y)j(the)f(more)h(general)f
+(FTGSVx)g(family)f(of)i(routines.])0 3091 y Fh(15)46
+b Fi(Put)30 b(an)g(arbitrary)f(data)i(subsection)f(in)m(to)g(the)h
+(data)g(arra)m(y)-8 b(.)382 3301 y Fe(FTPSS[BIJED]\(unit,group,)o(nax)o
+(is,n)o(axes)o(,fp)o(ixel)o(s,lp)o(ixe)o(ls,a)o(rray)o(,)42
+b(>)47 b(status\))0 3512 y Fh(16)f Fi(Get)30 b(an)e(arbitrary)f(data)j
+(subsection)d(from)h(the)h(data)g(arra)m(y)-8 b(.)42
+b(Unde\014ned)27 b(pixels)f(in)i(the)g(arra)m(y)i(will)25
+b(b)s(e)j(set)227 3625 y(equal)j(to)i(the)e(v)-5 b(alue)32
+b(of)f('n)m(ullv)-5 b(al',)30 b(unless)g(n)m(ullv)-5
 b(al=0)30 b(in)g(whic)m(h)g(case)j(no)e(testing)h(for)f(unde\014ned)f
-(pixels)227 4716 y(will)e(b)s(e)i(p)s(erformed.)382 4929
+(pixels)227 3738 y(will)e(b)s(e)i(p)s(erformed.)382 3948
 y Fe(FTGSV[BIJED]\(unit,group,)o(nax)o(is,n)o(axes)o(,fp)o(ixel)o(s,lp)
-o(ixe)o(ls,i)o(ncs,)o(nul)o(lval)o(,)42 b(>)1002 5042
-y(array,anyf,status\))0 5255 y Fh(17)k Fi(Get)34 b(an)f(arbitrary)f
+o(ixe)o(ls,i)o(ncs,)o(nul)o(lval)o(,)42 b(>)1002 4061
+y(array,anyf,status\))0 4272 y Fh(17)k Fi(Get)34 b(an)f(arbitrary)f
 (data)h(subsection)f(from)h(the)g(data)g(arra)m(y)-8
 b(.)50 b(An)m(y)33 b(Unde\014ned)e(pixels)g(in)h(the)h(arra)m(y)h(will)
-227 5368 y(ha)m(v)m(e)e(the)e(corresp)s(onding)f('\015agv)-5
+227 4384 y(ha)m(v)m(e)e(the)e(corresp)s(onding)f('\015agv)-5
 b(als')30 b(elemen)m(t)h(set)g(equal)f(to)h(.TR)m(UE.)382
-5581 y Fe(FTGSF[BIJED]\(unit,group,)o(nax)o(is,n)o(axes)o(,fp)o(ixel)o
-(s,lp)o(ixe)o(ls,i)o(ncs,)41 b(>)1002 5694 y(array,flagvals,anyf,statu)
-o(s\))p eop
-%%Page: 80 86
-80 85 bop 0 299 a Fi(80)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fd(8.7)135 b(FITS)44 b(ASCI)t(I)g(and)h(Binary)g(T)-11
-b(able)45 b(Data)h(I/O)f(Subroutines)0 809 y Fb(8.7.1)112
-b(Column)37 b(Information)f(Subroutines)0 1017 y Fh(1)81
+4595 y Fe(FTGSF[BIJED]\(unit,group,)o(nax)o(is,n)o(axes)o(,fp)o(ixel)o
+(s,lp)o(ixe)o(ls,i)o(ncs,)41 b(>)1002 4708 y(array,flagvals,anyf,statu)
+o(s\))0 5034 y Fd(9.7)135 b(FITS)44 b(ASCI)t(I)g(and)h(Binary)g(T)-11
+b(able)45 b(Data)h(I/O)f(Subroutines)0 5287 y Fb(9.7.1)112
+b(Column)37 b(Information)f(Subroutines)0 5488 y Fh(1)81
 b Fi(Get)30 b(the)g(n)m(um)m(b)s(er)e(of)i(ro)m(ws)g(or)f(columns)f(in)
 h(the)h(curren)m(t)f(FITS)g(table.)40 b(The)29 b(n)m(um)m(b)s(er)f(of)i
-(ro)m(ws)g(is)e(giv)m(en)i(b)m(y)227 1129 y(the)k(NAXIS2)f(k)m(eyw)m
+(ro)m(ws)g(is)e(giv)m(en)i(b)m(y)227 5601 y(the)k(NAXIS2)f(k)m(eyw)m
 (ord)h(and)e(the)i(n)m(um)m(b)s(er)e(of)h(columns)f(is)g(giv)m(en)h(b)m
-(y)g(the)h(TFIELDS)e(k)m(eyw)m(ord)i(in)e(the)227 1242
-y(header)e(of)h(the)g(table.)382 1495 y Fe(FTGNRW\(unit,)44
-b(>)k(nrows,)e(status\))382 1608 y(FTGNCL\(unit,)e(>)k(ncols,)e
-(status\))0 1861 y Fh(2)81 b Fi(Get)25 b(the)f(table)h(column)e(n)m(um)
-m(b)s(er)g(\(and)h(name\))h(of)f(the)h(column)e(whose)h(name)g(matc)m
-(hes)i(an)e(input)f(template)227 1974 y(name.)38 b(The)21
-b(table)h(column)e(names)i(are)g(de\014ned)e(b)m(y)i(the)g(TTYPEn)e(k)m
-(eyw)m(ords)i(in)e(the)i(FITS)f(header.)37 b(If)22 b(a)227
-2087 y(column)h(do)s(es)h(not)g(ha)m(v)m(e)h(a)f(TTYPEn)f(k)m(eyw)m
-(ord,)j(then)d(these)h(routines)f(assume)h(that)g(the)h(name)e
-(consists)227 2200 y(of)i(all)f(blank)g(c)m(haracters.)40
-b(These)25 b(2)g(subroutines)d(p)s(erform)i(the)h(same)g(function)f
-(except)i(that)f(FTGCNO)227 2313 y(only)i(returns)f(the)h(n)m(um)m(b)s
-(er)f(of)h(the)g(matc)m(hing)h(column)e(whereas)h(FTGCNN)g(also)g
-(returns)f(the)i(name)f(of)227 2426 y(the)k(column.)39
+(y)g(the)h(TFIELDS)e(k)m(eyw)m(ord)i(in)e(the)227 5714
+y(header)e(of)h(the)g(table.)p eop
+%%Page: 89 95
+89 94 bop 0 299 a Fg(9.7.)72 b(FITS)30 b(ASCI)s(I)f(AND)i(BINAR)-8
+b(Y)31 b(T)-8 b(ABLE)31 b(D)m(A)-8 b(T)g(A)32 b(I/O)e(SUBR)m(OUTINES)
+979 b Fi(89)382 555 y Fe(FTGNRW\(unit,)44 b(>)k(nrows,)e(status\))382
+668 y(FTGNCL\(unit,)e(>)k(ncols,)e(status\))0 921 y Fh(2)81
+b Fi(Get)25 b(the)f(table)h(column)e(n)m(um)m(b)s(er)g(\(and)h(name\))h
+(of)f(the)h(column)e(whose)h(name)g(matc)m(hes)i(an)e(input)f(template)
+227 1034 y(name.)38 b(The)21 b(table)h(column)e(names)i(are)g
+(de\014ned)e(b)m(y)i(the)g(TTYPEn)e(k)m(eyw)m(ords)i(in)e(the)i(FITS)f
+(header.)37 b(If)22 b(a)227 1147 y(column)h(do)s(es)h(not)g(ha)m(v)m(e)
+h(a)f(TTYPEn)f(k)m(eyw)m(ord,)j(then)d(these)h(routines)f(assume)h
+(that)g(the)h(name)e(consists)227 1260 y(of)i(all)f(blank)g(c)m
+(haracters.)40 b(These)25 b(2)g(subroutines)d(p)s(erform)i(the)h(same)g
+(function)f(except)i(that)f(FTGCNO)227 1373 y(only)i(returns)f(the)h(n)
+m(um)m(b)s(er)f(of)h(the)g(matc)m(hing)h(column)e(whereas)h(FTGCNN)g
+(also)g(returns)f(the)i(name)f(of)227 1486 y(the)k(column.)39
 b(If)30 b(CASESEN)f(=)h(.true.)41 b(then)30 b(the)h(column)e(name)h
 (matc)m(h)i(will)27 b(b)s(e)j(case-sensitiv)m(e.)227
-2575 y(The)41 b(input)d(column)i(name)h(template)g(\(COL)-8
+1635 y(The)41 b(input)d(column)i(name)h(template)g(\(COL)-8
 b(TEMPLA)g(TE\))41 b(is)f(\(1\))h(either)g(the)g(exact)h(name)f(of)g
-(the)227 2688 y(column)35 b(to)j(b)s(e)d(searc)m(hed)i(for,)h(or)e
+(the)227 1748 y(column)35 b(to)j(b)s(e)d(searc)m(hed)i(for,)h(or)e
 (\(2\))i(it)e(ma)m(y)h(con)m(tain)f(wild)e(cards)i(c)m(haracters)i
-(\(*,)h(?,)f(or)e(#\),)i(or)f(\(3\))227 2801 y(it)c(ma)m(y)h(con)m
+(\(*,)h(?,)f(or)e(#\),)i(or)f(\(3\))227 1861 y(it)c(ma)m(y)h(con)m
 (tain)f(the)g(n)m(um)m(b)s(er)f(of)h(the)g(desired)f(column)g(\(where)h
 (the)g(n)m(um)m(b)s(er)f(is)g(expressed)g(as)h(ASCI)s(I)227
-2914 y(digits\).)39 b(The)28 b(\014rst)g(2)h(wild)d(cards)i(b)s(eha)m
+1974 y(digits\).)39 b(The)28 b(\014rst)g(2)h(wild)d(cards)i(b)s(eha)m
 (v)m(e)h(similarly)c(to)k(UNIX)g(\014lename)f(matc)m(hing:)39
-b(the)29 b('*')g(c)m(haracter)227 3026 y(matc)m(hes)e(an)m(y)g
+b(the)29 b('*')g(c)m(haracter)227 2087 y(matc)m(hes)e(an)m(y)g
 (sequence)f(of)h(c)m(haracters)g(\(including)c(zero)k(c)m(haracters\))h
 (and)d(the)i(')10 b(?')39 b(c)m(haracter)28 b(matc)m(hes)227
-3139 y(an)m(y)40 b(single)f(c)m(haracter.)71 b(The)39
+2199 y(an)m(y)40 b(single)f(c)m(haracter.)71 b(The)39
 b(#)h(wildcard)d(will)g(matc)m(h)k(an)m(y)f(consecutiv)m(e)h(string)e
-(of)h(decimal)e(digits)227 3252 y(\(0-9\).)45 b(As)31
+(of)h(decimal)e(digits)227 2312 y(\(0-9\).)45 b(As)31
 b(an)g(example,)g(the)g(template)g(strings)f('AB?DE',)i('AB*E',)h(and)d
-('AB*CDE')j(will)28 b(all)i(matc)m(h)227 3365 y(the)c(string)f
+('AB*CDE')j(will)28 b(all)i(matc)m(h)227 2425 y(the)c(string)f
 ('ABCDE'.)j(If)d(more)h(than)g(one)g(column)f(name)h(in)f(the)h(table)g
-(matc)m(hes)h(the)f(template)h(string,)227 3478 y(then)33
+(matc)m(hes)h(the)f(template)h(string,)227 2538 y(then)33
 b(the)h(\014rst)f(matc)m(h)h(is)e(returned)h(and)f(the)i(status)g(v)-5
 b(alue)33 b(will)d(b)s(e)j(set)h(to)g(237)h(as)f(a)f(w)m(arning)g(that)
-h(a)227 3591 y(unique)f(matc)m(h)j(w)m(as)f(not)g(found.)53
+h(a)227 2651 y(unique)f(matc)m(h)j(w)m(as)f(not)g(found.)53
 b(T)-8 b(o)35 b(\014nd)f(the)h(other)g(cases)g(that)h(matc)m(h)g(the)f
-(template,)h(simply)d(call)227 3704 y(the)27 b(subroutine)e(again)i
+(template,)h(simply)d(call)227 2764 y(the)27 b(subroutine)e(again)i
 (lea)m(ving)g(the)g(input)e(status)i(v)-5 b(alue)27 b(equal)f(to)i(237)
-g(and)f(the)g(next)g(matc)m(hing)g(name)227 3817 y(will)i(then)j(b)s(e)
+g(and)f(the)g(next)g(matc)m(hing)g(name)227 2877 y(will)i(then)j(b)s(e)
 f(returned.)43 b(Rep)s(eat)32 b(this)f(pro)s(cess)g(un)m(til)f(a)i
 (status)g(=)g(219)h(\(column)d(name)i(not)g(found\))f(is)227
-3930 y(returned.)40 b(If)30 b(these)h(subroutines)d(fail)h(to)i(matc)m
+2990 y(returned.)40 b(If)30 b(these)h(subroutines)d(fail)h(to)i(matc)m
 (h)g(the)g(template)g(to)g(an)m(y)g(of)f(the)h(columns)e(in)g(the)i
-(table,)227 4043 y(they)i(lastly)e(c)m(hec)m(k)j(if)e(the)g(template)h
+(table,)227 3103 y(they)i(lastly)e(c)m(hec)m(k)j(if)e(the)g(template)h
 (can)g(b)s(e)e(in)m(terpreted)h(as)h(a)g(simple)d(p)s(ositiv)m(e)h(in)m
-(teger)i(\(e.g.,)i('7',)f(or)227 4156 y('512'\))i(and)d(if)f(so,)j
+(teger)i(\(e.g.,)i('7',)f(or)227 3216 y('512'\))i(and)d(if)f(so,)j
 (they)f(return)e(that)j(column)d(n)m(um)m(b)s(er.)49
 b(If)33 b(no)g(matc)m(hes)i(are)f(found)e(then)h(a)h(status)g(=)227
-4268 y(219)e(error)e(is)f(returned.)227 4418 y(Note)i(that)e(the)h
+3329 y(219)e(error)e(is)f(returned.)227 3478 y(Note)i(that)e(the)h
 (FITS)e(Standard)g(recommends)g(that)i(only)e(letters,)i(digits,)e(and)
-h(the)g(underscore)f(c)m(har-)227 4531 y(acter)44 b(b)s(e)e(used)g(in)g
+h(the)g(underscore)f(c)m(har-)227 3591 y(acter)44 b(b)s(e)e(used)g(in)g
 (column)f(names)i(\(with)f(no)g(em)m(b)s(edded)g(spaces)h(in)f(the)h
-(name\).)78 b(T)-8 b(railing)40 b(blank)227 4643 y(c)m(haracters)32
+(name\).)78 b(T)-8 b(railing)40 b(blank)227 3704 y(c)m(haracters)32
 b(are)f(not)g(signi\014can)m(t.)40 b(It)31 b(is)e(recommended)i(that)g
 (the)g(column)e(names)h(in)g(a)h(giv)m(en)f(table)h(b)s(e)227
-4756 y(unique)e(within)f(the)i(\014rst)g(8)h(c)m(haracters.)382
-5009 y Fe(FTGCNO\(unit,casesen,colt)o(emp)o(late)o(,)42
-b(>)47 b(colnum,status\))382 5122 y(FTGCNN\(unit,casesen,colt)o(emp)o
-(late)o(,)42 b(>)47 b(colname,colnum,status\))0 5375
+3816 y(unique)e(within)f(the)i(\014rst)g(8)h(c)m(haracters.)382
+4070 y Fe(FTGCNO\(unit,casesen,colt)o(emp)o(late)o(,)42
+b(>)47 b(colnum,status\))382 4182 y(FTGCNN\(unit,casesen,colt)o(emp)o
+(late)o(,)42 b(>)47 b(colname,colnum,status\))0 4436
 y Fh(3)81 b Fi(Get)39 b(the)g(datat)m(yp)s(e)h(of)e(a)h(column)f(in)f
 (an)h(ASCI)s(I)g(or)g(binary)f(table.)65 b(This)37 b(routine)h(returns)
-f(an)i(in)m(teger)227 5488 y(co)s(de)34 b(v)-5 b(alue)32
+f(an)i(in)m(teger)227 4549 y(co)s(de)34 b(v)-5 b(alue)32
 b(corresp)s(onding)f(to)j(the)g(datat)m(yp)s(e)g(of)f(the)g(column.)48
-b(\(See)34 b(the)f(FTBNFM)i(and)d(FT)-8 b(ASFM)227 5601
+b(\(See)34 b(the)f(FTBNFM)i(and)d(FT)-8 b(ASFM)227 4661
 y(subroutines)26 b(in)h(the)h(Utilities)f(section)h(of)g(this)f(do)s
 (cumen)m(t)h(for)g(a)h(list)e(of)h(the)h(co)s(de)f(v)-5
-b(alues\).)40 b(The)27 b(v)m(ector)227 5714 y(rep)s(eat)38
+b(alues\).)40 b(The)27 b(v)m(ector)227 4774 y(rep)s(eat)38
 b(coun)m(t)g(\(whic)m(h)f(is)g(alw)m(a)m(y)h(1)g(for)g(ASCI)s(I)e
 (table)h(columns\))g(is)g(also)g(returned.)62 b(If)37
-b(the)h(sp)s(eci\014ed)p eop
-%%Page: 81 87
-81 86 bop 0 299 a Fg(8.7.)72 b(FITS)30 b(ASCI)s(I)f(AND)i(BINAR)-8
-b(Y)31 b(T)-8 b(ABLE)31 b(D)m(A)-8 b(T)g(A)32 b(I/O)e(SUBR)m(OUTINES)
-979 b Fi(81)227 555 y(column)31 b(has)g(an)g(ASCI)s(I)f(c)m(haracter)j
-(datat)m(yp)s(e)g(\(co)s(de)f(=)f(16\))i(then)e(the)h(width)d(of)j(a)g
-(unit)e(string)h(in)f(the)227 668 y(column)i(is)g(also)h(returned.)48
-b(Note)34 b(that)g(this)d(routine)h(supp)s(orts)g(the)h(lo)s(cal)f(con)
-m(v)m(en)m(tion)i(for)f(sp)s(ecifying)227 781 y(arra)m(ys)f(of)f
-(strings)f(within)e(a)k(binary)d(table)i(c)m(haracter)h(column,)f
-(using)e(the)i(syn)m(tax)h(TF)m(ORM)f(=)g('rAw')227 894
-y(where)f('r')g(is)g(the)g(total)h(n)m(um)m(b)s(er)e(of)i(c)m
+b(the)h(sp)s(eci\014ed)227 4887 y(column)31 b(has)g(an)g(ASCI)s(I)f(c)m
+(haracter)j(datat)m(yp)s(e)g(\(co)s(de)f(=)f(16\))i(then)e(the)h(width)
+d(of)j(a)g(unit)e(string)h(in)f(the)227 5000 y(column)i(is)g(also)h
+(returned.)48 b(Note)34 b(that)g(this)d(routine)h(supp)s(orts)g(the)h
+(lo)s(cal)f(con)m(v)m(en)m(tion)i(for)f(sp)s(ecifying)227
+5113 y(arra)m(ys)f(of)f(strings)f(within)e(a)k(binary)d(table)i(c)m
+(haracter)h(column,)f(using)e(the)i(syn)m(tax)h(TF)m(ORM)f(=)g('rAw')
+227 5226 y(where)f('r')g(is)g(the)g(total)h(n)m(um)m(b)s(er)e(of)i(c)m
 (haracters)g(\(=)g(the)f(width)f(of)h(the)g(column\))g(and)g('w')g(is)f
-(the)i(width)227 1007 y(of)39 b(a)f(unit)f(string)g(within)f(the)i
+(the)i(width)227 5339 y(of)39 b(a)f(unit)f(string)g(within)f(the)i
 (column.)63 b(Th)m(us)37 b(if)g(the)h(column)f(has)h(TF)m(ORM)h(=)f
-('60A12')i(then)e(this)227 1120 y(routine)30 b(will)d(return)j(dataco)s
-(de)h(=)f(16,)h(rep)s(eat)g(=)f(60,)i(and)d(width)g(=)h(12.)382
-1393 y Fe(FTGTCL\(unit,colnum,)42 b(>)48 b(datacode,repeat,width,st)o
-(atu)o(s\))0 1665 y Fh(4)81 b Fi(Return)22 b(the)i(displa)m(y)e(width)g
-(of)h(a)h(column.)38 b(This)21 b(is)i(the)h(length)f(of)g(the)h(string)
-f(that)h(will)d(b)s(e)i(returned)f(when)227 1778 y(reading)32
+('60A12')i(then)e(this)227 5452 y(routine)30 b(will)d(return)j(dataco)s
+(de)h(=)f(16,)h(rep)s(eat)g(=)f(60,)i(and)d(width)g(=)h(12.)227
+5601 y(The)h(second)h(routine,)f(FTEQTY)g(is)f(similar)f(except)k(that)
+f(in)e(the)i(case)g(of)g(scaled)f(in)m(teger)h(columns)e(it)227
+5714 y(returns)23 b(the)h('equiv)-5 b(alen)m(t')23 b(data)h(t)m(yp)s(e)
+g(that)h(is)d(needed)i(to)g(store)g(the)g(scaled)f(v)-5
+b(alues,)25 b(and)e(not)h(necessarily)p eop
+%%Page: 90 96
+90 95 bop 0 299 a Fi(90)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)227
+555 y Fi(the)38 b(ph)m(ysical)f(data)h(t)m(yp)s(e)g(of)g(the)g
+(unscaled)f(v)-5 b(alues)37 b(as)h(stored)g(in)f(the)h(FITS)f(table.)63
+b(F)-8 b(or)38 b(example)g(if)227 668 y(a)d('1I')g(column)e(in)g(a)h
+(binary)f(table)h(has)g(TSCALn)f(=)g(1)i(and)f(TZER)m(On)f(=)g(32768,)
+38 b(then)c(this)f(column)227 781 y(e\013ectiv)m(ely)25
+b(con)m(tains)f(unsigned)e(short)h(in)m(teger)i(v)-5
+b(alues,)24 b(and)g(th)m(us)f(the)h(returned)f(v)-5 b(alue)23
+b(of)h(t)m(yp)s(eco)s(de)h(will)227 894 y(b)s(e)32 b(the)h(co)s(de)g
+(for)g(an)f(unsigned)f(short)h(in)m(teger,)i(not)f(a)g(signed)f(short)g
+(in)m(teger.)48 b(Similarly)-8 b(,)30 b(if)i(a)h(column)227
+1007 y(has)d(TTYPEn)g(=)g('1I')h(and)f(TSCALn)e(=)i(0.12,)j(then)d(the)
+g(returned)g(t)m(yp)s(eco)s(de)g(will)e(b)s(e)i(the)h(co)s(de)f(for)h
+(a)227 1120 y('real')g(column.)382 1382 y Fe(FTGTCL\(unit,colnum,)42
+b(>)48 b(datacode,repeat,width,st)o(atu)o(s\))382 1495
+y(FTEQTY\(unit,colnum,)42 b(>)48 b(datacode,repeat,width,st)o(atu)o
+(s\))0 1758 y Fh(4)81 b Fi(Return)22 b(the)i(displa)m(y)e(width)g(of)h
+(a)h(column.)38 b(This)21 b(is)i(the)h(length)f(of)g(the)h(string)f
+(that)h(will)d(b)s(e)i(returned)f(when)227 1871 y(reading)32
 b(the)h(column)f(as)h(a)g(formatted)g(string.)47 b(The)32
 b(displa)m(y)f(width)g(is)h(determined)g(b)m(y)g(the)h(TDISPn)227
-1891 y(k)m(eyw)m(ord,)e(if)f(presen)m(t,)g(otherwise)g(b)m(y)g(the)h
-(data)g(t)m(yp)s(e)g(of)f(the)h(column.)382 2164 y Fe(FTGCDW\(unit,)44
-b(colnum,)i(>)i(dispwidth,)d(status\))0 2437 y Fh(5)81
+1984 y(k)m(eyw)m(ord,)e(if)f(presen)m(t,)g(otherwise)g(b)m(y)g(the)h
+(data)g(t)m(yp)s(e)g(of)f(the)h(column.)382 2246 y Fe(FTGCDW\(unit,)44
+b(colnum,)i(>)i(dispwidth,)d(status\))0 2509 y Fh(5)81
 b Fi(Get)29 b(information)d(ab)s(out)i(an)g(existing)f(ASCI)s(I)g
 (table)h(column.)39 b(\(NOTE:)28 b(TSCAL)f(and)g(TZER)m(O)h(m)m(ust)g
-(b)s(e)227 2550 y(declared)i(as)h(Double)f(Precision)f(v)-5
+(b)s(e)227 2622 y(declared)i(as)h(Double)f(Precision)f(v)-5
 b(ariables\).)39 b(All)29 b(the)i(returned)e(parameters)i(are)f(scalar)
-h(quan)m(tities.)382 2822 y Fe(FTGACL\(unit,colnum,)42
-b(>)716 2935 y(ttype,tbcol,tunit,tform,)o(tsca)o(l,t)o(zero)o(,snu)o
-(ll,)o(tdis)o(p,st)o(atu)o(s\))0 3208 y Fh(6)81 b Fi(Get)29
+h(quan)m(tities.)382 2884 y Fe(FTGACL\(unit,colnum,)42
+b(>)716 2997 y(ttype,tbcol,tunit,tform,)o(tsca)o(l,t)o(zero)o(,snu)o
+(ll,)o(tdis)o(p,st)o(atu)o(s\))0 3259 y Fh(6)81 b Fi(Get)29
 b(information)d(ab)s(out)h(an)h(existing)f(binary)f(table)i(column.)39
 b(\(NOTE:)28 b(TSCAL)e(and)i(TZER)m(O)f(m)m(ust)h(b)s(e)227
-3321 y(declared)i(as)g(Double)f(Precision)g(v)-5 b(ariables\).)39
+3372 y(declared)i(as)g(Double)f(Precision)g(v)-5 b(ariables\).)39
 b(D)m(A)-8 b(T)g(A)g(TYPE)32 b(is)d(a)h(c)m(haracter)i(string)c(whic)m
-(h)h(returns)g(the)227 3434 y(datat)m(yp)s(e)35 b(of)g(the)f(column)f
+(h)h(returns)g(the)227 3485 y(datat)m(yp)s(e)35 b(of)g(the)f(column)f
 (as)h(de\014ned)f(b)m(y)h(the)g(TF)m(ORMn)g(k)m(eyw)m(ord)h(\(e.g.,)i
-('I',)e('J','E',)g('D',)g(etc.\).)54 b(In)227 3547 y(the)27
+('I',)e('J','E',)g('D',)g(etc.\).)54 b(In)227 3598 y(the)27
 b(case)g(of)g(an)f(ASCI)s(I)f(c)m(haracter)j(column,)e(D)m(A)-8
 b(T)g(A)g(TYPE)29 b(will)23 b(ha)m(v)m(e)28 b(a)f(v)-5
-b(alue)26 b(of)g(the)h(form)f('An')g(where)227 3660 y('n')34
+b(alue)26 b(of)g(the)h(form)f('An')g(where)227 3711 y('n')34
 b(is)f(an)h(in)m(teger)h(expressing)e(the)h(width)e(of)i(the)h(\014eld)
 d(in)h(c)m(haracters.)53 b(F)-8 b(or)35 b(example,)g(if)e(TF)m(ORM)h(=)
-227 3773 y('160A8')39 b(then)e(FTGBCL)f(will)e(return)i(D)m(A)-8
+227 3824 y('160A8')39 b(then)e(FTGBCL)f(will)e(return)i(D)m(A)-8
 b(T)g(A)g(TYPE='A8')39 b(and)d(REPEA)-8 b(T=20.)60 b(All)35
-b(the)i(returned)227 3886 y(parameters)31 b(are)g(scalar)f(quan)m
-(tities.)382 4158 y Fe(FTGBCL\(unit,colnum,)42 b(>)716
-4271 y(ttype,tunit,datatype,rep)o(eat,)o(tsc)o(al,t)o(zero)o(,tn)o
-(ull,)o(tdis)o(p,s)o(tatu)o(s\))0 4544 y Fh(7)81 b Fi(Put)31
+b(the)i(returned)227 3937 y(parameters)31 b(are)g(scalar)f(quan)m
+(tities.)382 4199 y Fe(FTGBCL\(unit,colnum,)42 b(>)716
+4312 y(ttype,tunit,datatype,rep)o(eat,)o(tsc)o(al,t)o(zero)o(,tn)o
+(ull,)o(tdis)o(p,s)o(tatu)o(s\))0 4575 y Fh(7)81 b Fi(Put)31
 b(\(app)s(end\))g(a)i(TDIMn)f(k)m(eyw)m(ord)g(whose)g(v)-5
 b(alue)32 b(has)g(the)g(form)g('\(l,m,n...\)')46 b(where)32
-b(l,)g(m,)g(n...)46 b(are)33 b(the)227 4657 y(dimensions)28
+b(l,)g(m,)g(n...)46 b(are)33 b(the)227 4688 y(dimensions)28
 b(of)i(a)h(m)m(ultidimension)c(arra)m(y)j(column)g(in)f(a)h(binary)f
-(table.)382 4930 y Fe(FTPTDM\(unit,colnum,naxis)o(,na)o(xes,)41
-b(>)48 b(status\))0 5203 y Fh(8)81 b Fi(Return)29 b(the)h(n)m(um)m(b)s
+(table.)382 4950 y Fe(FTPTDM\(unit,colnum,naxis)o(,na)o(xes,)41
+b(>)48 b(status\))0 5213 y Fh(8)81 b Fi(Return)29 b(the)h(n)m(um)m(b)s
 (er)e(of)i(and)g(size)f(of)h(the)g(dimensions)e(of)i(a)g(table)g
-(column.)39 b(Normally)29 b(this)g(information)227 5316
+(column.)39 b(Normally)29 b(this)g(information)227 5326
 y(is)h(giv)m(en)h(b)m(y)g(the)g(TDIMn)f(k)m(eyw)m(ord,)i(but)e(if)g
 (this)g(k)m(eyw)m(ord)h(is)f(not)h(presen)m(t)g(then)g(this)e(routine)h
-(returns)227 5428 y(NAXIS)g(=)g(1)h(and)f(NAXES\(1\))h(equal)f(to)h
+(returns)227 5439 y(NAXIS)g(=)g(1)h(and)f(NAXES\(1\))h(equal)f(to)h
 (the)g(rep)s(eat)g(coun)m(t)g(in)e(the)h(TF)m(ORM)h(k)m(eyw)m(ord.)382
 5701 y Fe(FTGTDM\(unit,colnum,maxdi)o(m,)41 b(>)48 b
 (naxis,naxes,status\))p eop
-%%Page: 82 88
-82 87 bop 0 299 a Fi(82)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fh(9)81 b Fi(Deco)s(de)33 b(the)g(input)e(TDIMn)i(k)m(eyw)m(ord)g
-(string)e(\(e.g.)50 b('\(100,200\)'\))37 b(and)32 b(return)g(the)h(n)m
-(um)m(b)s(er)e(of)i(and)f(size)227 668 y(of)c(the)g(dimensions)d(of)j
-(a)g(binary)e(table)h(column.)39 b(If)27 b(the)h(input)e(tdimstr)g(c)m
-(haracter)j(string)e(is)g(n)m(ull,)f(then)227 781 y(this)e(routine)f
-(returns)g(naxis)g(=)i(1)f(and)g(naxes[0])i(equal)d(to)j(the)e(rep)s
-(eat)h(coun)m(t)g(in)e(the)h(TF)m(ORM)h(k)m(eyw)m(ord.)227
-894 y(This)k(routine)g(is)h(called)f(b)m(y)h(FTGTDM.)382
-1147 y Fe(FTDTDM\(unit,tdimstr,coln)o(um,)o(maxd)o(im,)41
+%%Page: 91 97
+91 96 bop 0 299 a Fg(9.7.)72 b(FITS)30 b(ASCI)s(I)f(AND)i(BINAR)-8
+b(Y)31 b(T)-8 b(ABLE)31 b(D)m(A)-8 b(T)g(A)32 b(I/O)e(SUBR)m(OUTINES)
+979 b Fi(91)0 555 y Fh(9)81 b Fi(Deco)s(de)33 b(the)g(input)e(TDIMn)i
+(k)m(eyw)m(ord)g(string)e(\(e.g.)50 b('\(100,200\)'\))37
+b(and)32 b(return)g(the)h(n)m(um)m(b)s(er)e(of)i(and)f(size)227
+668 y(of)c(the)g(dimensions)d(of)j(a)g(binary)e(table)h(column.)39
+b(If)27 b(the)h(input)e(tdimstr)g(c)m(haracter)j(string)e(is)g(n)m
+(ull,)f(then)227 781 y(this)e(routine)f(returns)g(naxis)g(=)i(1)f(and)g
+(naxes[0])i(equal)d(to)j(the)e(rep)s(eat)h(coun)m(t)g(in)e(the)h(TF)m
+(ORM)h(k)m(eyw)m(ord.)227 894 y(This)k(routine)g(is)h(called)f(b)m(y)h
+(FTGTDM.)382 1147 y Fe(FTDTDM\(unit,tdimstr,coln)o(um,)o(maxd)o(im,)41
 b(>)48 b(naxis,naxes,)c(status\))0 1400 y Fh(10)i Fi(Return)32
 b(the)h(optimal)f(n)m(um)m(b)s(er)g(of)h(ro)m(ws)g(to)h(read)f(or)g
 (write)f(at)i(one)f(time)g(for)f(maxim)m(um)g(I/O)h(e\016ciency)-8
 b(.)227 1513 y(Refer)31 b(to)g(the)g(\\Optimizing)d(Co)s(de")i(section)
 h(in)e(Chapter)h(5)g(for)h(more)f(discussion)e(on)i(ho)m(w)h(to)g(use)f
 (this)227 1626 y(routine.)382 1879 y Fe(FFGRSZ\(unit,)44
-b(>)k(nrows,status\))0 2169 y Fb(8.7.2)112 b(Lo)m(w-Lev)m(el)38
+b(>)k(nrows,status\))0 2169 y Fb(9.7.2)112 b(Lo)m(w-Lev)m(el)38
 b(T)-9 b(able)37 b(Access)g(Subroutines)0 2388 y Fi(The)d(follo)m(wing)
 e(subroutines)g(pro)m(vide)i(lo)m(w-lev)m(el)g(access)h(to)g(the)g
 (data)g(in)e(ASCI)s(I)f(or)i(binary)f(tables)h(and)g(are)0
@@ -7409,1282 +7976,1374 @@ b(The)32 b(arra)m(y)g(parameter)g(ma)m(y)h(b)s(e)e(declared)g(as)i(an)m
 (as)g(INTEGER*4)g(ARRA)-8 b(Y\(5\).)382 5714 y Fe
 (FTGTBB\(unit,frow,startch)o(ar,)o(ncha)o(rs,)41 b(>)48
 b(array,status\))p eop
-%%Page: 83 89
-83 88 bop 0 299 a Fg(8.7.)72 b(FITS)30 b(ASCI)s(I)f(AND)i(BINAR)-8
-b(Y)31 b(T)-8 b(ABLE)31 b(D)m(A)-8 b(T)g(A)32 b(I/O)e(SUBR)m(OUTINES)
-979 b Fi(83)0 555 y Fh(4)81 b Fi(W)-8 b(rite)31 b(a)g(consecutiv)m(e)h
-(arra)m(y)g(of)f(b)m(ytes)g(to)h(an)e(ASCI)s(I)g(or)h(binary)e(table)i
-(from)f(a)i(n)m(umeric)d(v)-5 b(ariable)30 b(\(span-)227
-668 y(ning)k(columns)f(and)h(m)m(ultiple)e(ro)m(ws)j(if)e(necessary\))j
-(The)e(arra)m(y)h(parameter)g(ma)m(y)h(b)s(e)e(declared)g(as)h(an)m(y)
-227 781 y(n)m(umerical)e(datat)m(yp)s(e)i(as)g(long)f(as)h(the)f(arra)m
-(y)h(is)e(at)i(least)g('nc)m(hars')g(b)m(ytes)f(long,)i(e.g.,)g(if)e
-(nc)m(hars)g(=)g(17,)227 894 y(then)c(declare)h(the)f(arra)m(y)h(as)g
-(INTEGER*4)g(ARRA)-8 b(Y\(5\).)382 1157 y Fe(FTPTBB\(unit,frow,startch)
-o(ar,)o(ncha)o(rs,a)o(rra)o(y,)42 b(>)47 b(status\))0
-1452 y Fb(8.7.3)112 b(Edit)36 b(Ro)m(ws)h(or)h(Columns)0
-1664 y Fh(1)81 b Fi(Insert)26 b(blank)g(ro)m(ws)i(in)m(to)f(an)g
-(existing)f(ASCI)s(I)g(or)h(binary)f(table)h(\(in)g(the)g(CDU\).)h(All)
-e(the)i(ro)m(ws)f(F)m(OLLO)m(W-)227 1777 y(ING)32 b(ro)m(w)f(FR)m(O)m
-(W)i(are)e(shifted)f(do)m(wn)h(b)m(y)g(NR)m(O)m(WS)h(ro)m(ws.)43
-b(If)31 b(FR)m(O)m(W)i(=)d(0)i(then)f(the)g(blank)f(ro)m(ws)i(are)227
-1890 y(inserted)e(at)i(the)f(b)s(eginning)e(of)i(the)g(table.)43
+%%Page: 92 98
+92 97 bop 0 299 a Fi(92)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
+555 y Fh(4)81 b Fi(W)-8 b(rite)31 b(a)g(consecutiv)m(e)h(arra)m(y)g(of)
+f(b)m(ytes)g(to)h(an)e(ASCI)s(I)g(or)h(binary)e(table)i(from)f(a)i(n)m
+(umeric)d(v)-5 b(ariable)30 b(\(span-)227 668 y(ning)k(columns)f(and)h
+(m)m(ultiple)e(ro)m(ws)j(if)e(necessary\))j(The)e(arra)m(y)h(parameter)
+g(ma)m(y)h(b)s(e)e(declared)g(as)h(an)m(y)227 781 y(n)m(umerical)e
+(datat)m(yp)s(e)i(as)g(long)f(as)h(the)f(arra)m(y)h(is)e(at)i(least)g
+('nc)m(hars')g(b)m(ytes)f(long,)i(e.g.,)g(if)e(nc)m(hars)g(=)g(17,)227
+894 y(then)c(declare)h(the)f(arra)m(y)h(as)g(INTEGER*4)g(ARRA)-8
+b(Y\(5\).)382 1161 y Fe(FTPTBB\(unit,frow,startch)o(ar,)o(ncha)o(rs,a)o
+(rra)o(y,)42 b(>)47 b(status\))0 1461 y Fb(9.7.3)112
+b(Edit)36 b(Ro)m(ws)h(or)h(Columns)0 1676 y Fh(1)81 b
+Fi(Insert)26 b(blank)g(ro)m(ws)i(in)m(to)f(an)g(existing)f(ASCI)s(I)g
+(or)h(binary)f(table)h(\(in)g(the)g(CDU\).)h(All)e(the)i(ro)m(ws)f(F)m
+(OLLO)m(W-)227 1789 y(ING)32 b(ro)m(w)f(FR)m(O)m(W)i(are)e(shifted)f
+(do)m(wn)h(b)m(y)g(NR)m(O)m(WS)h(ro)m(ws.)43 b(If)31
+b(FR)m(O)m(W)i(=)d(0)i(then)f(the)g(blank)f(ro)m(ws)i(are)227
+1902 y(inserted)e(at)i(the)f(b)s(eginning)e(of)i(the)g(table.)43
 b(This)29 b(routine)h(mo)s(di\014es)f(the)j(NAXIS2)f(k)m(eyw)m(ord)h
-(to)f(re\015ect)227 2003 y(the)g(new)f(n)m(um)m(b)s(er)f(of)h(ro)m(ws)h
-(in)e(the)h(table.)382 2266 y Fe(FTIROW\(unit,frow,nrows,)41
-b(>)48 b(status\))0 2530 y Fh(2)81 b Fi(Delete)26 b(ro)m(ws)g(from)f
+(to)f(re\015ect)227 2015 y(the)g(new)f(n)m(um)m(b)s(er)f(of)h(ro)m(ws)h
+(in)e(the)h(table.)382 2282 y Fe(FTIROW\(unit,frow,nrows,)41
+b(>)48 b(status\))0 2550 y Fh(2)81 b Fi(Delete)26 b(ro)m(ws)g(from)f
 (an)g(existing)g(ASCI)s(I)f(or)h(binary)f(table)h(\(in)g(the)h(CDU\).)g
 (The)f(NR)m(O)m(WS)h(n)m(um)m(b)s(er)e(of)i(ro)m(ws)227
-2643 y(are)k(deleted,)g(starting)f(with)g(ro)m(w)g(FR)m(O)m(W,)j(and)d
+2663 y(are)k(deleted,)g(starting)f(with)g(ro)m(w)g(FR)m(O)m(W,)j(and)d
 (an)m(y)h(remaining)d(ro)m(ws)j(in)e(the)i(table)f(are)h(shifted)f(up)f
-(to)227 2756 y(\014ll)35 b(in)h(the)h(space.)61 b(This)35
+(to)227 2775 y(\014ll)35 b(in)h(the)h(space.)61 b(This)35
 b(routine)h(mo)s(di\014es)f(the)j(NAXIS2)f(k)m(eyw)m(ord)g(to)h
-(re\015ect)f(the)h(new)e(n)m(um)m(b)s(er)g(of)227 2868
-y(ro)m(ws)31 b(in)e(the)h(table.)382 3132 y Fe
-(FTDROW\(unit,frow,nrows,)41 b(>)48 b(status\))0 3395
-y Fh(3)81 b Fi(Delete)37 b(a)f(list)e(of)i(ro)m(ws)g(from)g(an)f(ASCI)s
-(I)g(or)h(binary)e(table)h(\(in)g(the)h(CDU\).)h(ro)m(wlist)e(is)g(an)g
-(arra)m(y)i(of)f(ro)m(w)227 3508 y(n)m(um)m(b)s(ers)29
-b(to)h(b)s(e)f(deleted)h(from)f(the)h(table.)40 b(\(The)30
-b(\014rst)f(ro)m(w)g(in)g(the)h(table)f(is)g(1)h(not)g(0\).)41
-b(The)30 b(list)e(of)i(ro)m(w)227 3621 y(n)m(um)m(b)s(ers)f(m)m(ust)h
-(b)s(e)f(sorted)h(in)f(ascending)g(order.)41 b(nro)m(ws)29
-b(is)g(the)h(n)m(um)m(b)s(er)f(of)h(ro)m(w)g(n)m(um)m(b)s(ers)f(in)g
-(the)h(list.)382 3885 y Fe(FTDRWS\(unit,rowlist,nrow)o(s,)41
-b(>)48 b(status\))0 4148 y Fh(4)81 b Fi(Insert)43 b(a)i(blank)e(column)
-h(\(or)g(columns\))g(in)m(to)g(an)g(existing)g(ASCI)s(I)f(or)h(binary)f
-(table)h(\(in)g(the)g(CDU\).)227 4261 y(COLNUM)c(sp)s(eci\014es)f(the)i
-(column)e(n)m(um)m(b)s(er)g(that)i(the)f(\(\014rst\))g(new)g(column)f
-(should)f(o)s(ccup)m(y)j(in)e(the)227 4374 y(table.)57
-b(NCOLS)34 b(sp)s(eci\014es)g(ho)m(w)i(man)m(y)g(columns)e(are)i(to)g
-(b)s(e)f(inserted.)56 b(An)m(y)35 b(existing)g(columns)f(from)227
-4487 y(this)k(p)s(osition)e(and)i(higher)f(are)i(mo)m(v)m(ed)g(o)m(v)m
-(er)h(to)f(allo)m(w)f(ro)s(om)g(for)h(the)f(new)g(column\(s\).)64
-b(The)38 b(index)227 4600 y(n)m(um)m(b)s(er)j(on)h(all)f(the)h(follo)m
-(wing)e(k)m(eyw)m(ords)j(will)c(b)s(e)i(incremen)m(ted)h(if)f
-(necessary)h(to)h(re\015ect)f(the)g(new)227 4713 y(p)s(osition)30
-b(of)h(the)g(column\(s\))g(in)f(the)h(table:)42 b(TBCOLn,)30
-b(TF)m(ORMn,)i(TTYPEn,)e(TUNITn,)h(TNULLn,)227 4826 y(TSCALn,)22
-b(TZER)m(On,)g(TDISPn,)g(TDIMn,)h(TLMINn,)g(TLMAXn,)f(TDMINn,)i
-(TDMAXn,)f(TCTYPn,)227 4938 y(TCRPXn,)30 b(TCR)-10 b(VLn,)29
-b(TCDL)-8 b(Tn,)30 b(TCR)m(OTn,)f(and)g(TCUNIn.)382 5202
-y Fe(FTICOL\(unit,colnum,ttype)o(,tf)o(orm,)41 b(>)48
-b(status\))382 5315 y(FTICLS\(unit,colnum,ncols)o(,tt)o(ype,)o(tfor)o
-(m,)41 b(>)48 b(status\))0 5578 y Fh(5)81 b Fi(Mo)s(dify)36
-b(the)h(v)m(ector)i(length)e(of)g(a)h(binary)d(table)i(column)f
-(\(e.g.,)41 b(c)m(hange)e(a)e(column)f(from)h(TF)m(ORMn)g(=)227
-5691 y('1E')31 b(to)h('20E'\).)g(The)e(v)m(ector)i(length)d(ma)m(y)i(b)
-s(e)f(increased)g(or)g(decreased)h(from)f(the)g(curren)m(t)h(v)-5
-b(alue.)p eop
-%%Page: 84 90
-84 89 bop 0 299 a Fi(84)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)382
-555 y Fe(FTMVEC\(unit,colnum,newve)o(cle)o(n,)42 b(>)47
-b(status\))0 839 y Fh(6)81 b Fi(Delete)28 b(a)g(column)f(from)g(an)g
-(existing)g(ASCI)s(I)f(or)i(binary)d(table)j(\(in)f(the)g(CDU\).)i(The)
-e(index)f(n)m(um)m(b)s(er)g(of)i(all)227 952 y(the)k(k)m(eyw)m(ords)h
-(listed)d(ab)s(o)m(v)m(e)k(\(for)e(FTICOL\))f(will)e(b)s(e)j(decremen)m
-(ted)g(if)f(necessary)i(to)g(re\015ect)f(the)g(new)227
-1064 y(p)s(osition)24 b(of)i(the)g(column\(s\))f(in)f(the)i(table.)39
+(re\015ect)f(the)h(new)e(n)m(um)m(b)s(er)g(of)227 2888
+y(ro)m(ws)31 b(in)e(the)h(table.)382 3156 y Fe
+(FTDROW\(unit,frow,nrows,)41 b(>)48 b(status\))0 3423
+y Fh(3)81 b Fi(Delete)25 b(a)g(list)e(of)i(ro)m(ws)f(from)g(an)h(ASCI)s
+(I)e(or)h(binary)f(table)h(\(in)g(the)g(CDU\).)i(In)e(the)g(\014rst)g
+(routine,)h('ro)m(wrange')227 3536 y(is)i(a)h(c)m(haracter)h(string)e
+(listing)f(the)i(ro)m(ws)f(or)h(ro)m(w)g(ranges)g(to)g(delete)g
+(\(e.g.,)j('2-4,)e(5,)g(8-9'\).)42 b(In)27 b(the)h(second)227
+3649 y(routine,)36 b('ro)m(wlist')e(is)g(an)g(in)m(teger)i(arra)m(y)f
+(of)g(ro)m(w)g(n)m(um)m(b)s(ers)e(to)j(b)s(e)e(deleted)h(from)f(the)h
+(table.)55 b(nro)m(ws)34 b(is)227 3762 y(the)e(n)m(um)m(b)s(er)e(of)h
+(ro)m(w)h(n)m(um)m(b)s(ers)e(in)g(the)h(list.)43 b(The)31
+b(\014rst)f(ro)m(w)i(in)e(the)h(table)h(is)e(1)i(not)f(0.)44
+b(The)31 b(list)f(of)i(ro)m(w)227 3875 y(n)m(um)m(b)s(ers)d(m)m(ust)h
+(b)s(e)g(sorted)h(in)e(ascending)g(order.)382 4142 y
+Fe(FTDRRG\(unit,rowrange,)42 b(>)47 b(status\))382 4255
+y(FTDRWS\(unit,rowlist,nrow)o(s,)41 b(>)48 b(status\))0
+4523 y Fh(4)81 b Fi(Insert)43 b(a)i(blank)e(column)h(\(or)g(columns\))g
+(in)m(to)g(an)g(existing)g(ASCI)s(I)f(or)h(binary)f(table)h(\(in)g(the)
+g(CDU\).)227 4636 y(COLNUM)c(sp)s(eci\014es)f(the)i(column)e(n)m(um)m
+(b)s(er)g(that)i(the)f(\(\014rst\))g(new)g(column)f(should)f(o)s(ccup)m
+(y)j(in)e(the)227 4749 y(table.)57 b(NCOLS)34 b(sp)s(eci\014es)g(ho)m
+(w)i(man)m(y)g(columns)e(are)i(to)g(b)s(e)f(inserted.)56
+b(An)m(y)35 b(existing)g(columns)f(from)227 4862 y(this)k(p)s(osition)e
+(and)i(higher)f(are)i(mo)m(v)m(ed)g(o)m(v)m(er)h(to)f(allo)m(w)f(ro)s
+(om)g(for)h(the)f(new)g(column\(s\).)64 b(The)38 b(index)227
+4975 y(n)m(um)m(b)s(er)j(on)h(all)f(the)h(follo)m(wing)e(k)m(eyw)m
+(ords)j(will)c(b)s(e)i(incremen)m(ted)h(if)f(necessary)h(to)h
+(re\015ect)f(the)g(new)227 5087 y(p)s(osition)30 b(of)h(the)g
+(column\(s\))g(in)f(the)h(table:)42 b(TBCOLn,)30 b(TF)m(ORMn,)i
+(TTYPEn,)e(TUNITn,)h(TNULLn,)227 5200 y(TSCALn,)22 b(TZER)m(On,)g
+(TDISPn,)g(TDIMn,)h(TLMINn,)g(TLMAXn,)f(TDMINn,)i(TDMAXn,)f(TCTYPn,)227
+5313 y(TCRPXn,)30 b(TCR)-10 b(VLn,)29 b(TCDL)-8 b(Tn,)30
+b(TCR)m(OTn,)f(and)g(TCUNIn.)382 5581 y Fe(FTICOL\(unit,colnum,ttype)o
+(,tf)o(orm,)41 b(>)48 b(status\))382 5694 y(FTICLS\(unit,colnum,ncols)o
+(,tt)o(ype,)o(tfor)o(m,)41 b(>)48 b(status\))p eop
+%%Page: 93 99
+93 98 bop 0 299 a Fg(9.7.)72 b(FITS)30 b(ASCI)s(I)f(AND)i(BINAR)-8
+b(Y)31 b(T)-8 b(ABLE)31 b(D)m(A)-8 b(T)g(A)32 b(I/O)e(SUBR)m(OUTINES)
+979 b Fi(93)0 555 y Fh(5)81 b Fi(Mo)s(dify)36 b(the)h(v)m(ector)i
+(length)e(of)g(a)h(binary)d(table)i(column)f(\(e.g.,)41
+b(c)m(hange)e(a)e(column)f(from)h(TF)m(ORMn)g(=)227 668
+y('1E')31 b(to)h('20E'\).)g(The)e(v)m(ector)i(length)d(ma)m(y)i(b)s(e)f
+(increased)g(or)g(decreased)h(from)f(the)g(curren)m(t)h(v)-5
+b(alue.)382 924 y Fe(FTMVEC\(unit,colnum,newve)o(cle)o(n,)42
+b(>)47 b(status\))0 1180 y Fh(6)81 b Fi(Delete)28 b(a)g(column)f(from)g
+(an)g(existing)g(ASCI)s(I)f(or)i(binary)d(table)j(\(in)f(the)g(CDU\).)i
+(The)e(index)f(n)m(um)m(b)s(er)g(of)i(all)227 1293 y(the)k(k)m(eyw)m
+(ords)h(listed)d(ab)s(o)m(v)m(e)k(\(for)e(FTICOL\))f(will)e(b)s(e)j
+(decremen)m(ted)g(if)f(necessary)i(to)g(re\015ect)f(the)g(new)227
+1406 y(p)s(osition)24 b(of)i(the)g(column\(s\))f(in)f(the)i(table.)39
 b(Those)26 b(index)e(k)m(eyw)m(ords)i(that)g(refer)f(to)i(the)f
-(deleted)f(column)227 1177 y(will)30 b(also)i(b)s(e)g(deleted.)46
+(deleted)f(column)227 1519 y(will)30 b(also)i(b)s(e)g(deleted.)46
 b(Note)33 b(that)g(the)g(ph)m(ysical)e(size)h(of)g(the)h(FITS)e(\014le)
-h(will)d(not)k(b)s(e)e(reduced)h(b)m(y)g(this)227 1290
+h(will)d(not)k(b)s(e)e(reduced)h(b)m(y)g(this)227 1632
 y(op)s(eration,)d(and)f(the)h(empt)m(y)g(FITS)f(blo)s(c)m(ks)g(if)g(an)
 m(y)h(at)g(the)g(end)f(of)h(the)g(\014le)f(will)e(b)s(e)i(padded)g
-(with)f(zeros.)382 1574 y Fe(FTDCOL\(unit,colnum,)42
-b(>)48 b(status\))0 1857 y Fh(7)81 b Fi(Cop)m(y)30 b(a)g(column)f(from)
+(with)f(zeros.)382 1888 y Fe(FTDCOL\(unit,colnum,)42
+b(>)48 b(status\))0 2144 y Fh(7)81 b Fi(Cop)m(y)30 b(a)g(column)f(from)
 h(one)g(HDU)h(to)g(another)f(\(or)h(to)g(the)f(same)h(HDU\).)g(If)f
-(createcol)i(=)d(TR)m(UE,)i(then)f(a)227 1970 y(new)20
+(createcol)i(=)d(TR)m(UE,)i(then)f(a)227 2257 y(new)20
 b(column)f(will)f(b)s(e)i(inserted)f(in)g(the)i(output)f(table,)j(at)e
 (p)s(osition)d(`outcolumn',)k(otherwise)e(the)h(existing)227
-2083 y(output)29 b(column)e(will)f(b)s(e)i(o)m(v)m(erwritten)h(\(in)f
+2370 y(output)29 b(column)e(will)f(b)s(e)i(o)m(v)m(erwritten)h(\(in)f
 (whic)m(h)f(case)j(it)e(m)m(ust)g(ha)m(v)m(e)i(a)f(compatible)f(datat)m
-(yp)s(e\).)42 b(Note)227 2196 y(that)31 b(the)g(\014rst)e(column)h(in)f
-(a)h(table)h(is)e(at)i(coln)m(um)f(=)g(1.)382 2479 y
+(yp)s(e\).)42 b(Note)227 2483 y(that)31 b(the)g(\014rst)e(column)h(in)f
+(a)h(table)h(is)e(at)i(coln)m(um)f(=)g(1.)382 2739 y
 Fe(FTCPCL\(inunit,outunit,in)o(col)o(num,)o(outc)o(oln)o(um,c)o(reat)o
-(eco)o(l,)42 b(>)47 b(status\);)0 2798 y Fb(8.7.4)112
+(eco)o(l,)42 b(>)47 b(status\);)0 3029 y Fb(9.7.4)112
 b(Read)38 b(and)h(W)-9 b(rite)35 b(Column)i(Data)g(Routines)0
-3022 y Fi(These)22 b(subroutines)e(put)i(or)g(get)i(data)f(v)-5
+3248 y Fi(These)22 b(subroutines)e(put)i(or)g(get)i(data)f(v)-5
 b(alues)21 b(in)g(the)i(curren)m(t)f(ASCI)s(I)f(or)h(Binary)f(table)i
-(extension.)37 b(Automatic)0 3135 y(data)21 b(t)m(yp)s(e)g(con)m(v)m
+(extension.)37 b(Automatic)0 3361 y(data)21 b(t)m(yp)s(e)g(con)m(v)m
 (ersion)f(is)f(p)s(erformed)g(for)h(n)m(umerical)f(data)i(t)m(yp)s(es)g
 (\(B,I,J,E,D\))h(if)d(the)i(data)g(t)m(yp)s(e)f(of)h(the)f(column)0
-3248 y(\(de\014ned)32 b(b)m(y)i(the)f(TF)m(ORM)h(k)m(eyw)m(ord\))g
+3474 y(\(de\014ned)32 b(b)m(y)i(the)f(TF)m(ORM)h(k)m(eyw)m(ord\))g
 (di\013ers)e(from)g(the)i(data)g(t)m(yp)s(e)f(of)h(the)f(calling)f
-(subroutine.)47 b(The)33 b(data)0 3361 y(v)-5 b(alues)29
+(subroutine.)47 b(The)33 b(data)0 3587 y(v)-5 b(alues)29
 b(are)i(also)f(scaled)f(b)m(y)h(the)g(TSCALn)f(and)g(TZER)m(On)g
 (header)h(v)-5 b(alues)29 b(as)h(they)g(are)h(b)s(eing)d(written)h(to)i
-(or)0 3474 y(read)j(from)f(the)h(FITS)f(arra)m(y)-8 b(.)51
+(or)0 3700 y(read)j(from)f(the)h(FITS)f(arra)m(y)-8 b(.)51
 b(The)33 b(fttscl)h(subroutine)d(MUST)j(b)s(e)f(used)g(to)h(de\014ne)f
-(the)h(scaling)f(parameters)0 3587 y(when)f(writing)f(data)j(to)g(the)f
+(the)h(scaling)f(parameters)0 3813 y(when)f(writing)f(data)j(to)g(the)f
 (table)g(or)g(to)h(o)m(v)m(erride)f(the)h(default)e(scaling)g(v)-5
-b(alues)33 b(giv)m(en)g(in)f(the)h(header)g(when)0 3700
-y(reading)c(from)h(the)h(table.)0 3860 y(In)h(the)i(case)g(of)f(binary)
+b(alues)33 b(giv)m(en)g(in)f(the)h(header)g(when)0 3926
+y(reading)c(from)h(the)h(table.)0 4086 y(In)h(the)i(case)g(of)f(binary)
 f(tables)h(with)f(v)m(ector)i(elemen)m(ts,)h(the)e('felem')g(parameter)
-h(de\014nes)e(the)i(starting)f(pixel)0 3973 y(within)j(the)i(elemen)m
+h(de\014nes)e(the)i(starting)f(pixel)0 4199 y(within)j(the)i(elemen)m
 (t)h(v)m(ector.)65 b(This)37 b(parameter)h(is)f(ignored)h(with)e(ASCI)s
 (I)h(tables.)64 b(Similarly)-8 b(,)37 b(in)g(the)h(case)0
-4086 y(of)45 b(binary)d(tables)i(the)h('nelemen)m(ts')g(parameter)g(sp)
+4312 y(of)45 b(binary)d(tables)i(the)h('nelemen)m(ts')g(parameter)g(sp)
 s(eci\014es)e(the)h(total)h(n)m(um)m(b)s(er)e(of)i(v)m(ector)h(v)-5
-b(alues)44 b(read)g(or)0 4199 y(written)35 b(\(con)m(tin)m(uing)g(on)h
+b(alues)44 b(read)g(or)0 4425 y(written)35 b(\(con)m(tin)m(uing)g(on)h
 (subsequen)m(t)f(ro)m(ws)g(if)g(required\))f(and)i(not)g(the)g(n)m(um)m
-(b)s(er)e(of)i(table)g(elemen)m(ts.)57 b(Tw)m(o)0 4312
+(b)s(er)e(of)i(table)g(elemen)m(ts.)57 b(Tw)m(o)0 4538
 y(sets)36 b(of)f(subroutines)f(are)h(pro)m(vided)f(to)j(get)f(the)g
 (column)e(data)i(whic)m(h)e(di\013er)g(in)h(the)g(w)m(a)m(y)i
-(unde\014ned)c(pixels)0 4425 y(are)f(handled.)41 b(The)31
+(unde\014ned)c(pixels)0 4650 y(are)f(handled.)41 b(The)31
 b(\014rst)g(set)h(of)f(routines)g(\(FTGCV\))h(simply)d(return)h(an)h
 (arra)m(y)h(of)f(data)h(elemen)m(ts)g(in)e(whic)m(h)0
-4538 y(unde\014ned)41 b(pixels)h(are)i(set)g(equal)f(to)i(a)f(v)-5
+4763 y(unde\014ned)41 b(pixels)h(are)i(set)g(equal)f(to)i(a)f(v)-5
 b(alue)43 b(sp)s(eci\014ed)f(b)m(y)h(the)h(user)f(in)f(the)i('n)m(ullv)
--5 b(al')41 b(parameter.)81 b(An)0 4650 y(additional)41
+-5 b(al')41 b(parameter.)81 b(An)0 4876 y(additional)41
 b(feature)j(of)g(these)g(subroutines)d(is)i(that)h(if)e(the)i(user)e
 (sets)i(n)m(ullv)-5 b(al)41 b(=)i(0,)48 b(then)43 b(no)g(c)m(hec)m(ks)i
-(for)0 4763 y(unde\014ned)33 b(pixels)h(will)f(b)s(e)h(p)s(erformed,)i
+(for)0 4989 y(unde\014ned)33 b(pixels)h(will)f(b)s(e)h(p)s(erformed,)i
 (th)m(us)f(increasing)f(the)i(sp)s(eed)e(of)i(the)g(program.)55
-b(The)35 b(second)h(set)g(of)0 4876 y(routines)g(\(FTGCF\))i(returns)d
+b(The)35 b(second)h(set)g(of)0 5102 y(routines)g(\(FTGCF\))i(returns)d
 (the)i(data)h(elemen)m(t)f(arra)m(y)h(and)e(in)g(addition)f(a)i
-(logical)g(arra)m(y)g(of)g(\015ags)g(whic)m(h)0 4989
+(logical)g(arra)m(y)g(of)g(\015ags)g(whic)m(h)0 5215
 y(de\014nes)29 b(whether)h(the)h(corresp)s(onding)d(data)j(pixel)e(is)g
-(unde\014ned.)0 5149 y(An)m(y)41 b(column,)h(regardless)e(of)h(it's)f
+(unde\014ned.)0 5375 y(An)m(y)41 b(column,)h(regardless)e(of)h(it's)f
 (in)m(trinsic)e(datat)m(yp)s(e,)45 b(ma)m(y)c(b)s(e)f(read)h(as)g(a)g
-(string.)70 b(It)41 b(should)e(b)s(e)h(noted)0 5262 y(ho)m(w)m(ev)m(er)
+(string.)70 b(It)41 b(should)e(b)s(e)h(noted)0 5488 y(ho)m(w)m(ev)m(er)
 32 b(that)f(reading)e(a)i(n)m(umeric)e(column)g(as)i(a)f(string)g(is)f
 (10)i(-)g(100)g(times)f(slo)m(w)m(er)h(than)f(reading)f(the)i(same)0
-5375 y(column)f(as)i(a)g(n)m(um)m(b)s(er)e(due)h(to)h(the)g(large)g(o)m
+5601 y(column)f(as)i(a)g(n)m(um)m(b)s(er)e(due)h(to)h(the)g(large)g(o)m
 (v)m(erhead)g(in)f(constructing)g(the)h(formatted)g(strings.)43
-b(The)31 b(displa)m(y)0 5488 y(format)26 b(of)g(the)h(returned)d
+b(The)31 b(displa)m(y)0 5714 y(format)26 b(of)g(the)h(returned)d
 (strings)h(will)e(b)s(e)j(determined)e(b)m(y)i(the)g(TDISPn)f(k)m(eyw)m
-(ord,)j(if)c(it)i(exists,)h(otherwise)e(b)m(y)0 5601
-y(the)j(datat)m(yp)s(e)h(of)g(the)f(column.)39 b(The)28
-b(length)f(of)i(the)f(returned)f(strings)g(can)h(b)s(e)g(determined)f
-(with)f(the)j(ftgcdw)0 5714 y(routine.)40 b(The)30 b(follo)m(wing)e
-(TDISPn)i(displa)m(y)e(formats)j(are)f(curren)m(tly)g(supp)s(orted:)p
-eop
-%%Page: 85 91
-85 90 bop 0 299 a Fg(8.7.)72 b(FITS)30 b(ASCI)s(I)f(AND)i(BINAR)-8
-b(Y)31 b(T)-8 b(ABLE)31 b(D)m(A)-8 b(T)g(A)32 b(I/O)e(SUBR)m(OUTINES)
-979 b Fi(85)191 555 y Fe(Iw.m)142 b(Integer)191 668 y(Ow.m)g(Octal)46
-b(integer)191 781 y(Zw.m)142 b(Hexadecimal)45 b(integer)191
-894 y(Fw.d)142 b(Fixed)46 b(floating)g(point)191 1007
-y(Ew.d)142 b(Exponential)45 b(floating)g(point)191 1120
-y(Dw.d)142 b(Exponential)45 b(floating)g(point)191 1233
-y(Gw.d)142 b(General;)46 b(uses)g(Fw.d)h(if)g(significance)d(not)j
-(lost,)g(else)f(Ew.d)0 1489 y Fi(where)37 b(w)h(is)f(the)h(width)e(in)h
-(c)m(haracters)i(of)f(the)h(displa)m(y)m(ed)d(v)-5 b(alues,)40
-b(m)d(is)g(the)h(minim)m(um)e(n)m(um)m(b)s(er)g(of)i(digits)0
-1602 y(displa)m(y)m(ed,)29 b(and)h(d)g(is)f(the)i(n)m(um)m(b)s(er)e(of)
-h(digits)f(to)i(the)g(righ)m(t)f(of)h(the)f(decimal.)40
-b(The)30 b(.m)g(\014eld)f(is)g(optional.)0 1858 y Fh(1)81
-b Fi(Put)30 b(elemen)m(ts)h(in)m(to)g(an)f(ASCI)s(I)f(or)i(binary)e
-(table)i(column)e(\(in)h(the)h(CDU\).)g(\(The)g(SPP)f(FSPCLS)f(routine)
-227 1971 y(has)38 b(an)f(additional)f(in)m(teger)i(argumen)m(t)g(after)
-h(the)f(V)-10 b(ALUES)37 b(c)m(haracter)i(string)e(whic)m(h)f(sp)s
-(eci\014es)h(the)227 2084 y(size)30 b(of)h(the)g(1st)g(dimension)c(of)k
-(this)e(2-D)j(CHAR)e(arra)m(y\).)382 2340 y Fe
-(FTPCL[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o(ow,f)o(ele)o(m,ne)o(leme)o
-(nts)o(,val)o(ues,)41 b(>)47 b(status\))0 2596 y Fh(2)81
-b Fi(Put)29 b(elemen)m(ts)h(in)m(to)g(an)g(ASCI)s(I)e(or)i(binary)e
-(table)i(column)e(\(in)h(the)h(CDU\))g(substituting)e(the)i
-(appropriate)227 2709 y(FITS)i(n)m(ull)e(v)-5 b(alue)31
+(ord,)j(if)c(it)i(exists,)h(otherwise)e(b)m(y)p eop
+%%Page: 94 100
+94 99 bop 0 299 a Fi(94)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
+555 y Fi(the)e(datat)m(yp)s(e)h(of)g(the)f(column.)39
+b(The)28 b(length)f(of)i(the)f(returned)f(strings)g(can)h(b)s(e)g
+(determined)f(with)f(the)j(ftgcdw)0 668 y(routine.)40
+b(The)30 b(follo)m(wing)e(TDISPn)i(displa)m(y)e(formats)j(are)f(curren)
+m(tly)g(supp)s(orted:)191 923 y Fe(Iw.m)142 b(Integer)191
+1036 y(Ow.m)g(Octal)46 b(integer)191 1149 y(Zw.m)142
+b(Hexadecimal)45 b(integer)191 1262 y(Fw.d)142 b(Fixed)46
+b(floating)g(point)191 1375 y(Ew.d)142 b(Exponential)45
+b(floating)g(point)191 1488 y(Dw.d)142 b(Exponential)45
+b(floating)g(point)191 1600 y(Gw.d)142 b(General;)46
+b(uses)g(Fw.d)h(if)g(significance)d(not)j(lost,)g(else)f(Ew.d)0
+1855 y Fi(where)37 b(w)h(is)f(the)h(width)e(in)h(c)m(haracters)i(of)f
+(the)h(displa)m(y)m(ed)d(v)-5 b(alues,)40 b(m)d(is)g(the)h(minim)m(um)e
+(n)m(um)m(b)s(er)g(of)i(digits)0 1968 y(displa)m(y)m(ed,)29
+b(and)h(d)g(is)f(the)i(n)m(um)m(b)s(er)e(of)h(digits)f(to)i(the)g(righ)
+m(t)f(of)h(the)f(decimal.)40 b(The)30 b(.m)g(\014eld)f(is)g(optional.)0
+2223 y Fh(1)81 b Fi(Put)30 b(elemen)m(ts)h(in)m(to)g(an)f(ASCI)s(I)f
+(or)i(binary)e(table)i(column)e(\(in)h(the)h(CDU\).)g(\(The)g(SPP)f
+(FSPCLS)f(routine)227 2336 y(has)38 b(an)f(additional)f(in)m(teger)i
+(argumen)m(t)g(after)h(the)f(V)-10 b(ALUES)37 b(c)m(haracter)i(string)e
+(whic)m(h)f(sp)s(eci\014es)h(the)227 2449 y(size)30 b(of)h(the)g(1st)g
+(dimension)c(of)k(this)e(2-D)j(CHAR)e(arra)m(y\).)382
+2704 y Fe(FTPCL[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o(ow,f)o(ele)o(m,ne)o
+(leme)o(nts)o(,val)o(ues,)41 b(>)47 b(status\))0 2959
+y Fh(2)81 b Fi(Put)29 b(elemen)m(ts)h(in)m(to)g(an)g(ASCI)s(I)e(or)i
+(binary)e(table)i(column)e(\(in)h(the)h(CDU\))g(substituting)e(the)i
+(appropriate)227 3072 y(FITS)i(n)m(ull)e(v)-5 b(alue)31
 b(for)h(an)m(y)h(elemen)m(ts)f(that)h(are)f(equal)g(to)h(NULL)-10
 b(V)g(AL.)32 b(This)e(family)h(of)h(routines)f(m)m(ust)227
-2822 y(NOT)h(b)s(e)g(used)f(to)i(write)f(to)h(v)-5 b(ariable)31
+3185 y(NOT)h(b)s(e)g(used)f(to)i(write)f(to)h(v)-5 b(ariable)31
 b(length)g(arra)m(y)i(columns.)45 b(F)-8 b(or)33 b(ASCI)s(I)e(T)-8
-b(ABLE)32 b(extensions,)h(the)227 2935 y(n)m(ull)39 b(v)-5
+b(ABLE)32 b(extensions,)h(the)227 3298 y(n)m(ull)39 b(v)-5
 b(alue)41 b(de\014ned)f(b)m(y)h(the)g(previous)f(call)g(to)i(FTSNUL)e
 (will)f(b)s(e)h(substituted;)45 b(F)-8 b(or)42 b(in)m(teger)g(FITS)227
-3048 y(columns,)c(in)e(a)i(binary)e(table)h(the)g(n)m(ull)f(v)-5
+3410 y(columns,)c(in)e(a)i(binary)e(table)h(the)g(n)m(ull)f(v)-5
 b(alue)36 b(de\014ned)h(b)m(y)g(the)g(previous)f(call)h(to)h(FTTNUL)f
-(will)e(b)s(e)227 3161 y(substituted;)27 b(F)-8 b(or)28
+(will)e(b)s(e)227 3523 y(substituted;)27 b(F)-8 b(or)28
 b(\015oating)g(p)s(oin)m(t)e(FITS)g(columns)g(a)i(sp)s(ecial)e(IEEE)h
 (NaN)h(\(Not-a-Num)m(b)s(er\))h(v)-5 b(alue)27 b(will)227
-3274 y(b)s(e)j(substituted.)382 3530 y Fe(FTPCN[BIJED]\(unit,colnum)o
+3636 y(b)s(e)j(substituted.)382 3891 y Fe(FTPCN[BIJED]\(unit,colnum)o
 (,fr)o(ow,f)o(elem)o(,ne)o(leme)o(nts,)o(val)o(ues,)o(null)o(val)41
-b(>)48 b(status\))0 3786 y Fh(3)81 b Fi(Put)37 b(bit)g(v)-5
+b(>)48 b(status\))0 4146 y Fh(3)81 b Fi(Put)37 b(bit)g(v)-5
 b(alues)37 b(in)m(to)h(a)g(binary)e(b)m(yte)i(\('B'\))i(or)d(bit)g
 (\('X'\))i(table)f(column)f(\(in)f(the)i(CDU\).)h(LRA)-8
-b(Y)38 b(is)f(an)227 3899 y(arra)m(y)d(of)g(logical)e(v)-5
+b(Y)38 b(is)f(an)227 4259 y(arra)m(y)d(of)g(logical)e(v)-5
 b(alues)33 b(corresp)s(onding)e(to)j(the)g(sequence)f(of)h(bits)e(to)i
 (b)s(e)f(written.)48 b(If)33 b(LRA)-8 b(Y)34 b(is)e(true)227
-4012 y(then)g(the)g(corresp)s(onding)e(bit)h(is)g(set)h(to)h(1,)g
+4372 y(then)g(the)g(corresp)s(onding)e(bit)h(is)g(set)h(to)h(1,)g
 (otherwise)e(the)h(bit)f(is)g(set)i(to)g(0.)45 b(Note)34
-b(that)e(in)f(the)h(case)h(of)227 4125 y('X')g(columns,)f(FITSIO)f
+b(that)e(in)f(the)h(case)h(of)227 4485 y('X')g(columns,)f(FITSIO)f
 (will)f(write)h(to)i(all)e(8)i(bits)e(of)h(eac)m(h)i(b)m(yte)f(whether)
-e(they)i(are)g(formally)d(v)-5 b(alid)31 b(or)227 4238
+e(they)i(are)g(formally)d(v)-5 b(alid)31 b(or)227 4598
 y(not.)46 b(Th)m(us)31 b(if)g(the)h(column)f(is)f(de\014ned)h(as)h
 ('4X',)i(and)d(one)h(calls)f(FTPCLX)h(with)e(fbit=1)h(and)g(n)m(bit=8,)
-227 4350 y(then)j(all)f(8)h(bits)f(will)e(b)s(e)i(written)g(in)m(to)h
+227 4711 y(then)j(all)f(8)h(bits)f(will)e(b)s(e)i(written)g(in)m(to)h
 (the)g(\014rst)g(b)m(yte)g(\(as)h(opp)s(osed)e(to)i(writing)c(the)k
-(\014rst)e(4)h(bits)f(in)m(to)227 4463 y(the)e(\014rst)f(ro)m(w)g(and)g
+(\014rst)e(4)h(bits)f(in)m(to)227 4824 y(the)e(\014rst)f(ro)m(w)g(and)g
 (then)g(the)h(next)f(4)h(bits)e(in)m(to)i(the)f(next)h(ro)m(w\),)g(ev)m
 (en)g(though)f(the)h(last)f(4)h(bits)e(of)i(eac)m(h)227
-4576 y(b)m(yte)g(are)g(formally)e(not)i(de\014ned.)382
-4832 y Fe(FTPCLX\(unit,colnum,frow,)o(fbi)o(t,nb)o(it,l)o(ray)o(,)42
-b(>)47 b(status\))0 5089 y Fh(4)81 b Fi(Set)30 b(table)g(elemen)m(ts)h
-(in)e(a)i(column)e(as)i(unde\014ned)382 5345 y Fe
+4937 y(b)m(yte)g(are)g(formally)e(not)i(de\014ned.)382
+5191 y Fe(FTPCLX\(unit,colnum,frow,)o(fbi)o(t,nb)o(it,l)o(ray)o(,)42
+b(>)47 b(status\))0 5446 y Fh(4)81 b Fi(Set)30 b(table)g(elemen)m(ts)h
+(in)e(a)i(column)e(as)i(unde\014ned)382 5701 y Fe
 (FTPCLU\(unit,colnum,frow,)o(fel)o(em,n)o(elem)o(ent)o(s,)42
-b(>)47 b(status\))0 5601 y Fh(5)81 b Fi(Get)34 b(elemen)m(ts)f(from)g
-(an)g(ASCI)s(I)f(or)h(binary)f(table)h(column)f(\(in)g(the)h(CDU\).)i
-(These)e(routines)f(return)g(the)227 5714 y(v)-5 b(alues)29
-b(of)h(the)g(table)g(column)f(arra)m(y)h(elemen)m(ts.)41
-b(Unde\014ned)28 b(arra)m(y)j(elemen)m(ts)f(will)d(b)s(e)i(returned)g
-(with)g(a)p eop
-%%Page: 86 92
-86 91 bop 0 299 a Fi(86)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)227
-555 y Fi(v)-5 b(alue)25 b(=)h(n)m(ullv)-5 b(al,)24 b(unless)g(n)m(ullv)
--5 b(al)23 b(=)i(0)h(\(or)g(=)f(')h(')g(for)f(ftgcvs\))i(in)d(whic)m(h)
-g(case)j(no)e(c)m(hec)m(king)i(for)e(unde\014ned)227
-668 y(v)-5 b(alues)27 b(will)e(b)s(e)i(p)s(erformed.)39
-b(The)27 b(ANYF)h(parameter)g(is)f(set)h(to)g(true)g(if)f(an)m(y)g(of)h
-(the)g(returned)f(elemen)m(ts)227 781 y(are)f(unde\014ned.)37
+b(>)47 b(status\))p eop
+%%Page: 95 101
+95 100 bop 0 299 a Fg(9.7.)72 b(FITS)30 b(ASCI)s(I)f(AND)i(BINAR)-8
+b(Y)31 b(T)-8 b(ABLE)31 b(D)m(A)-8 b(T)g(A)32 b(I/O)e(SUBR)m(OUTINES)
+979 b Fi(95)0 555 y Fh(5)81 b Fi(Get)34 b(elemen)m(ts)f(from)g(an)g
+(ASCI)s(I)f(or)h(binary)f(table)h(column)f(\(in)g(the)h(CDU\).)i(These)
+e(routines)f(return)g(the)227 668 y(v)-5 b(alues)29 b(of)h(the)g(table)
+g(column)f(arra)m(y)h(elemen)m(ts.)41 b(Unde\014ned)28
+b(arra)m(y)j(elemen)m(ts)f(will)d(b)s(e)i(returned)g(with)g(a)227
+781 y(v)-5 b(alue)25 b(=)h(n)m(ullv)-5 b(al,)24 b(unless)g(n)m(ullv)-5
+b(al)23 b(=)i(0)h(\(or)g(=)f(')h(')g(for)f(ftgcvs\))i(in)d(whic)m(h)g
+(case)j(no)e(c)m(hec)m(king)i(for)e(unde\014ned)227 894
+y(v)-5 b(alues)27 b(will)e(b)s(e)i(p)s(erformed.)39 b(The)27
+b(ANYF)h(parameter)g(is)f(set)h(to)g(true)g(if)f(an)m(y)g(of)h(the)g
+(returned)f(elemen)m(ts)227 1007 y(are)f(unde\014ned.)37
 b(\(Note:)i(the)26 b(ftgcl)f(routine)f(simple)f(gets)j(an)g(arra)m(y)f
 (of)g(logical)g(data)h(v)-5 b(alues)24 b(without)h(an)m(y)227
-894 y(c)m(hec)m(ks)39 b(for)e(unde\014ned)e(v)-5 b(alues;)40
+1120 y(c)m(hec)m(ks)39 b(for)e(unde\014ned)e(v)-5 b(alues;)40
 b(use)d(the)g(ftgc\015)h(routine)e(to)i(c)m(hec)m(k)g(for)f
-(unde\014ned)e(logical)i(elemen)m(ts\).)227 1007 y(\(The)29
+(unde\014ned)e(logical)i(elemen)m(ts\).)227 1233 y(\(The)29
 b(SPP)f(FSGCVS)g(routine)f(has)i(an)f(additional)f(in)m(teger)i
 (argumen)m(t)g(after)g(the)g(V)-10 b(ALUES)28 b(c)m(haracter)227
-1120 y(string)i(whic)m(h)f(sp)s(eci\014es)g(the)h(size)h(of)f(the)h
+1346 y(string)i(whic)m(h)f(sp)s(eci\014es)g(the)h(size)h(of)f(the)h
 (1st)g(dimension)c(of)k(this)e(2-D)j(CHAR)e(arra)m(y\).)382
-1384 y Fe(FTGCL\(unit,colnum,frow,f)o(ele)o(m,ne)o(leme)o(nts)o(,)42
-b(>)47 b(values,status\))382 1496 y(FTGCV[SBIJEDCM]\(unit,col)o(num)o
+1595 y Fe(FTGCL\(unit,colnum,frow,f)o(ele)o(m,ne)o(leme)o(nts)o(,)42
+b(>)47 b(values,status\))382 1708 y(FTGCV[SBIJEDCM]\(unit,col)o(num)o
 (,fro)o(w,fe)o(lem)o(,nel)o(emen)o(ts,)o(null)o(val,)41
-b(>)1098 1609 y(values,anyf,status\))0 1873 y Fh(6)81
+b(>)1098 1821 y(values,anyf,status\))0 2071 y Fh(6)81
 b Fi(Get)44 b(elemen)m(ts)g(and)e(n)m(ull)g(\015ags)h(from)g(an)h(ASCI)
 s(I)d(or)j(binary)d(table)j(column)e(\(in)g(the)i(CHDU\).)g(These)227
-1986 y(routines)28 b(return)f(the)i(v)-5 b(alues)28 b(of)h(the)g(table)
+2184 y(routines)28 b(return)f(the)i(v)-5 b(alues)28 b(of)h(the)g(table)
 g(column)e(arra)m(y)j(elemen)m(ts.)40 b(An)m(y)29 b(unde\014ned)d(arra)
-m(y)k(elemen)m(ts)227 2099 y(will)k(ha)m(v)m(e)k(the)f(corresp)s
+m(y)k(elemen)m(ts)227 2297 y(will)k(ha)m(v)m(e)k(the)f(corresp)s
 (onding)e(\015agv)-5 b(als)36 b(elemen)m(t)i(set)f(equal)f(to)i(.TR)m
-(UE.)f(The)f(ANYF)i(parameter)f(is)227 2212 y(set)30
+(UE.)f(The)f(ANYF)i(parameter)f(is)227 2409 y(set)30
 b(to)g(true)g(if)e(an)m(y)i(of)f(the)h(returned)e(elemen)m(ts)i(are)g
 (unde\014ned.)38 b(\(The)29 b(SPP)f(FSGCFS)h(routine)g(has)g(an)227
-2325 y(additional)24 b(in)m(teger)j(argumen)m(t)f(after)h(the)f(V)-10
+2522 y(additional)24 b(in)m(teger)j(argumen)m(t)f(after)h(the)f(V)-10
 b(ALUES)26 b(c)m(haracter)i(string)d(whic)m(h)f(sp)s(eci\014es)h(the)i
-(size)e(of)i(the)227 2438 y(1st)k(dimension)d(of)j(this)e(2-D)i(CHAR)g
-(arra)m(y\).)382 2701 y Fe(FTGCF[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o
-(ow,f)o(ele)o(m,ne)o(leme)o(nts)o(,)42 b(>)1193 2814
-y(values,flagvals,anyf,stat)o(us\))0 3078 y Fh(7)81 b
+(size)e(of)i(the)227 2635 y(1st)k(dimension)d(of)j(this)e(2-D)i(CHAR)g
+(arra)m(y\).)382 2885 y Fe(FTGCF[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o
+(ow,f)o(ele)o(m,ne)o(leme)o(nts)o(,)42 b(>)1193 2998
+y(values,flagvals,anyf,stat)o(us\))0 3247 y Fh(7)81 b
 Fi(Get)29 b(an)f(arbitrary)f(data)i(subsection)e(from)h(an)g
 (N-dimensional)e(arra)m(y)j(in)e(a)h(binary)f(table)h(v)m(ector)i
-(column.)227 3191 y(Unde\014ned)k(pixels)f(in)h(the)i(arra)m(y)g(will)c
+(column.)227 3360 y(Unde\014ned)k(pixels)f(in)h(the)i(arra)m(y)g(will)c
 (b)s(e)j(set)h(equal)e(to)i(the)g(v)-5 b(alue)35 b(of)g('n)m(ullv)-5
-b(al',)35 b(unless)e(n)m(ullv)-5 b(al=0)33 b(in)227 3304
+b(al',)35 b(unless)e(n)m(ullv)-5 b(al=0)33 b(in)227 3473
 y(whic)m(h)f(case)j(no)e(testing)h(for)f(unde\014ned)e(pixels)h(will)e
 (b)s(e)j(p)s(erformed.)49 b(The)32 b(\014rst)h(and)g(last)g(ro)m(ws)h
-(in)e(the)227 3417 y(table)27 b(to)g(b)s(e)f(read)g(are)h(sp)s
+(in)e(the)227 3586 y(table)27 b(to)g(b)s(e)f(read)g(are)h(sp)s
 (eci\014ed)d(b)m(y)j(fpixels\(naxis+1\))d(and)i(lpixels\(naxis+1\),)f
-(and)h(hence)g(are)h(treated)227 3530 y(as)f(the)f(next)h(higher)e
+(and)h(hence)g(are)h(treated)227 3699 y(as)f(the)f(next)h(higher)e
 (dimension)f(of)i(the)h(FITS)e(N-dimensional)f(arra)m(y)-8
 b(.)40 b(The)25 b(INCS)f(parameter)i(sp)s(eci\014es)227
-3643 y(the)31 b(sampling)d(in)m(terv)-5 b(al)30 b(in)f(eac)m(h)i
+3812 y(the)31 b(sampling)d(in)m(terv)-5 b(al)30 b(in)f(eac)m(h)i
 (dimension)d(b)s(et)m(w)m(een)j(the)g(data)g(elemen)m(ts)f(that)h(will)
-d(b)s(e)i(returned.)382 3906 y Fe(FTGSV[BIJED]\(unit,colnum)o(,na)o
+d(b)s(e)i(returned.)382 4062 y Fe(FTGSV[BIJED]\(unit,colnum)o(,na)o
 (xis,)o(naxe)o(s,f)o(pixe)o(ls,l)o(pix)o(els,)o(incs)o(,nu)o(llva)o(l,)
-42 b(>)1002 4019 y(array,anyf,status\))0 4283 y Fh(8)81
+42 b(>)1002 4175 y(array,anyf,status\))0 4424 y Fh(8)81
 b Fi(Get)29 b(an)f(arbitrary)f(data)i(subsection)e(from)h(an)g
 (N-dimensional)e(arra)m(y)j(in)e(a)h(binary)f(table)h(v)m(ector)i
-(column.)227 4396 y(An)m(y)39 b(Unde\014ned)e(pixels)g(in)h(the)h(arra)
+(column.)227 4537 y(An)m(y)39 b(Unde\014ned)e(pixels)g(in)h(the)h(arra)
 m(y)g(will)d(ha)m(v)m(e)k(the)f(corresp)s(onding)e('\015agv)-5
-b(als')39 b(elemen)m(t)g(set)g(equal)227 4509 y(to)d(.TR)m(UE.)f(The)f
+b(als')39 b(elemen)m(t)g(set)g(equal)227 4650 y(to)d(.TR)m(UE.)f(The)f
 (\014rst)g(and)g(last)h(ro)m(ws)g(in)e(the)i(table)g(to)g(b)s(e)g(read)
 f(are)h(sp)s(eci\014ed)e(b)m(y)i(fpixels\(naxis+1\))227
-4622 y(and)k(lpixels\(naxis+1\),)g(and)f(hence)i(are)f(treated)i(as)e
+4763 y(and)k(lpixels\(naxis+1\),)g(and)f(hence)i(are)f(treated)i(as)e
 (the)g(next)h(higher)e(dimension)e(of)k(the)f(FITS)g(N-)227
-4735 y(dimensional)d(arra)m(y)-8 b(.)66 b(The)38 b(INCS)g(parameter)h
+4876 y(dimensional)d(arra)m(y)-8 b(.)66 b(The)38 b(INCS)g(parameter)h
 (sp)s(eci\014es)e(the)h(sampling)f(in)m(terv)-5 b(al)38
-b(in)f(eac)m(h)j(dimension)227 4848 y(b)s(et)m(w)m(een)31
+b(in)f(eac)m(h)j(dimension)227 4989 y(b)s(et)m(w)m(een)31
 b(the)g(data)g(elemen)m(ts)g(that)g(will)c(b)s(e)j(returned.)382
-5111 y Fe(FTGSF[BIJED]\(unit,colnum)o(,na)o(xis,)o(naxe)o(s,f)o(pixe)o
-(ls,l)o(pix)o(els,)o(incs)o(,)42 b(>)1002 5224 y
-(array,flagvals,anyf,statu)o(s\))0 5488 y Fh(9)81 b Fi(Get)33
+5238 y Fe(FTGSF[BIJED]\(unit,colnum)o(,na)o(xis,)o(naxe)o(s,f)o(pixe)o
+(ls,l)o(pix)o(els,)o(incs)o(,)42 b(>)1002 5351 y
+(array,flagvals,anyf,statu)o(s\))0 5601 y Fh(9)81 b Fi(Get)33
 b(bit)f(v)-5 b(alues)33 b(from)f(a)h(b)m(yte)h(\('B'\))g(or)f(bit)f
 (\(`X`\))i(table)f(column)f(\(in)g(the)h(CDU\).)g(LRA)-8
-b(Y)34 b(is)e(an)g(arra)m(y)i(of)227 5601 y(logical)k(v)-5
+b(Y)34 b(is)e(an)g(arra)m(y)i(of)227 5714 y(logical)k(v)-5
 b(alues)38 b(corresp)s(onding)f(to)i(the)g(sequence)f(of)h(bits)f(to)h
-(b)s(e)f(read.)65 b(If)38 b(LRA)-8 b(Y)39 b(is)e(true)i(then)f(the)227
-5714 y(corresp)s(onding)33 b(bit)g(w)m(as)h(set)h(to)g(1,)h(otherwise)e
+(b)s(e)f(read.)65 b(If)38 b(LRA)-8 b(Y)39 b(is)e(true)i(then)f(the)p
+eop
+%%Page: 96 102
+96 101 bop 0 299 a Fi(96)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)227
+555 y Fi(corresp)s(onding)j(bit)g(w)m(as)h(set)h(to)g(1,)h(otherwise)e
 (the)g(bit)g(w)m(as)g(set)h(to)g(0.)53 b(Note)35 b(that)g(in)e(the)i
-(case)g(of)f('X')p eop
-%%Page: 87 93
-87 92 bop 0 299 a Fg(8.8.)72 b(R)m(O)m(W)31 b(SELECTION)e(AND)i
-(CALCULA)-8 b(TOR)29 b(R)m(OUTINES)1382 b Fi(87)227 555
-y(columns,)40 b(FITSIO)e(will)e(read)i(all)g(8)h(bits)f(of)h(eac)m(h)h
-(b)m(yte)f(whether)f(they)h(are)g(formally)f(v)-5 b(alid)37
-b(or)h(not.)227 668 y(Th)m(us)c(if)f(the)i(column)e(is)g(de\014ned)g
-(as)i('4X',)h(and)d(one)i(calls)f(FTGCX)g(with)f(fbit=1)h(and)f(n)m
-(bit=8,)i(then)227 781 y(all)28 b(8)i(bits)e(will)e(b)s(e)j(read)g
-(from)g(the)g(\014rst)f(b)m(yte)i(\(as)g(opp)s(osed)e(to)i(reading)e
-(the)i(\014rst)e(4)i(bits)e(from)g(the)i(\014rst)227
-894 y(ro)m(w)g(and)e(then)h(the)h(\014rst)e(4)i(bits)e(from)h(the)g
+(case)g(of)f('X')227 668 y(columns,)40 b(FITSIO)e(will)e(read)i(all)g
+(8)h(bits)f(of)h(eac)m(h)h(b)m(yte)f(whether)f(they)h(are)g(formally)f
+(v)-5 b(alid)37 b(or)h(not.)227 781 y(Th)m(us)c(if)f(the)i(column)e(is)
+g(de\014ned)g(as)i('4X',)h(and)d(one)i(calls)f(FTGCX)g(with)f(fbit=1)h
+(and)f(n)m(bit=8,)i(then)227 894 y(all)28 b(8)i(bits)e(will)e(b)s(e)j
+(read)g(from)g(the)g(\014rst)f(b)m(yte)i(\(as)g(opp)s(osed)e(to)i
+(reading)e(the)i(\014rst)e(4)i(bits)e(from)g(the)i(\014rst)227
+1007 y(ro)m(w)g(and)e(then)h(the)h(\014rst)e(4)i(bits)e(from)h(the)g
 (next)g(ro)m(w\),)i(ev)m(en)f(though)f(the)g(last)g(4)h(bits)e(of)h
-(eac)m(h)i(b)m(yte)f(are)227 1007 y(formally)f(not)i(de\014ned.)382
-1240 y Fe(FTGCX\(unit,colnum,frow,f)o(bit)o(,nbi)o(t,)42
-b(>)47 b(lray,status\))0 1474 y Fh(10)f Fi(Read)31 b(an)m(y)g
+(eac)m(h)i(b)m(yte)f(are)227 1120 y(formally)f(not)i(de\014ned.)382
+1385 y Fe(FTGCX\(unit,colnum,frow,f)o(bit)o(,nbi)o(t,)42
+b(>)47 b(lray,status\))0 1650 y Fh(10)f Fi(Read)31 b(an)m(y)g
 (consecutiv)m(e)g(set)g(of)g(bits)f(from)g(an)g('X')i(or)e('B')i
 (column)d(and)h(in)m(terpret)g(them)h(as)g(an)f(unsigned)227
-1587 y(n-bit)j(in)m(teger.)53 b(NBIT)35 b(m)m(ust)f(b)s(e)f(less)h
+1763 y(n-bit)j(in)m(teger.)53 b(NBIT)35 b(m)m(ust)f(b)s(e)f(less)h
 (than)g(or)g(equal)g(to)h(16)g(when)f(calling)e(FTGCXI,)j(and)f(less)f
-(than)227 1700 y(or)f(equal)f(to)h(32)g(when)e(calling)g(FTGCXJ;)i
+(than)227 1876 y(or)f(equal)f(to)h(32)g(when)e(calling)g(FTGCXJ;)i
 (there)f(is)g(no)g(limit)e(on)j(the)f(v)-5 b(alue)31
-b(of)h(NBIT)f(for)g(FTGCXD,)227 1813 y(but)38 b(the)h(returned)e
+b(of)h(NBIT)f(for)g(FTGCXD,)227 1989 y(but)38 b(the)h(returned)e
 (double)h(precision)e(v)-5 b(alue)38 b(only)g(has)g(48)i(bits)d(of)i
-(precision)e(on)h(most)h(32-bit)g(w)m(ord)227 1926 y(mac)m(hines.)63
+(precision)e(on)h(most)h(32-bit)g(w)m(ord)227 2102 y(mac)m(hines.)63
 b(The)37 b(NBITS)g(bits)g(are)h(in)m(terpreted)f(as)h(an)g(unsigned)d
-(in)m(teger)k(unless)d(NBITS)h(=)g(16)i(\(in)227 2039
+(in)m(teger)k(unless)d(NBITS)h(=)g(16)i(\(in)227 2215
 y(FTGCXI\))e(or)g(32)g(\(in)f(FTGCXJ\))g(in)f(whic)m(h)h(case)h(the)g
 (string)f(of)g(bits)g(are)h(in)m(terpreted)e(as)i(16-bit)g(or)227
-2152 y(32-bit)j(2's)g(complemen)m(t)g(signed)e(in)m(tegers.)68
+2328 y(32-bit)j(2's)g(complemen)m(t)g(signed)e(in)m(tegers.)68
 b(If)39 b(NR)m(O)m(WS)i(is)d(greater)j(than)e(1)h(then)f(the)h(same)g
-(set)g(of)227 2264 y(bits)33 b(will)e(b)s(e)i(read)h(from)f(sequen)m
+(set)g(of)227 2441 y(bits)33 b(will)e(b)s(e)i(read)h(from)f(sequen)m
 (tial)g(ro)m(ws)h(in)e(the)i(table)f(starting)h(with)e(ro)m(w)i(FR)m(O)
-m(W.)h(Note)g(that)g(the)227 2377 y(n)m(um)m(b)s(ering)26
+m(W.)h(Note)g(that)g(the)227 2554 y(n)m(um)m(b)s(ering)26
 b(con)m(v)m(en)m(tion)j(used)e(here)g(for)h(the)g(FBIT)f(parameter)i
 (adopts)e(1)h(for)g(the)g(\014rst)f(elemen)m(t)h(of)g(the)227
-2490 y(v)m(ector)k(of)f(bits;)e(this)h(is)f(the)i(Most)g(Signi\014can)m
-(t)e(Bit)h(of)h(the)f(in)m(teger)h(v)-5 b(alue.)382 2724
+2667 y(v)m(ector)k(of)f(bits;)e(this)h(is)f(the)i(Most)g(Signi\014can)m
+(t)e(Bit)h(of)h(the)f(in)m(teger)h(v)-5 b(alue.)382 2932
 y Fe(FTGCX[IJD]\(unit,colnum,f)o(row)o(,nro)o(ws,f)o(bit)o(,nbi)o(t,)42
-b(>)47 b(array,status\))0 2958 y Fh(11)f Fi(Get)37 b(the)e(descriptor)g
+b(>)47 b(array,status\))0 3197 y Fh(11)f Fi(Get)37 b(the)e(descriptor)g
 (for)g(a)h(v)-5 b(ariable)35 b(length)g(column)f(in)g(a)i(binary)e
 (table.)56 b(The)35 b(descriptor)g(consists)g(of)227
-3070 y(2)d(in)m(teger)f(parameters:)42 b(the)31 b(n)m(um)m(b)s(er)f(of)
+3310 y(2)d(in)m(teger)f(parameters:)42 b(the)31 b(n)m(um)m(b)s(er)f(of)
 h(elemen)m(ts)h(in)d(the)i(arra)m(y)h(and)e(the)h(starting)g(o\013set)h
-(relativ)m(e)f(to)227 3183 y(the)d(start)f(of)g(the)h(heap.)39
+(relativ)m(e)f(to)227 3423 y(the)d(start)f(of)g(the)h(heap.)39
 b(The)27 b(\014rst)f(routine)g(returns)g(a)h(single)f(descriptor)g
-(whereas)h(the)g(second)g(routine)227 3296 y(returns)i(the)i
+(whereas)h(the)g(second)g(routine)227 3536 y(returns)i(the)i
 (descriptors)e(for)h(a)h(range)g(of)f(ro)m(ws)h(in)e(the)h(table.)382
-3530 y Fe(FTGDES\(unit,colnum,rownu)o(m,)41 b(>)48 b
-(nelements,offset,status\))382 3643 y(FFGDESSunit,colnum,first)o(row)o
+3801 y Fe(FTGDES\(unit,colnum,rownu)o(m,)41 b(>)48 b
+(nelements,offset,status\))382 3914 y(FFGDESSunit,colnum,first)o(row)o
 (,nro)o(ws)42 b(>)47 b(nelements,offset,)c(status\))0
-3876 y Fh(12)j Fi(Put)29 b(the)g(descriptor)f(for)h(a)h(v)-5
+4179 y Fh(12)j Fi(Put)29 b(the)g(descriptor)f(for)h(a)h(v)-5
 b(ariable)28 b(length)h(column)f(in)g(a)h(binary)f(table.)40
-b(This)27 b(subroutine)h(can)h(b)s(e)g(used)227 3989
+b(This)27 b(subroutine)h(can)h(b)s(e)g(used)227 4292
 y(in)23 b(conjunction)h(with)f(FTGDES)h(to)h(enable)f(2)h(or)f(more)g
 (arra)m(ys)h(to)g(p)s(oin)m(t)e(to)i(the)g(same)g(storage)g(lo)s
-(cation)227 4102 y(to)31 b(sa)m(v)m(e)h(storage)g(space)f(if)e(the)i
-(arra)m(ys)g(are)g(iden)m(tical.)382 4336 y Fe
+(cation)227 4405 y(to)31 b(sa)m(v)m(e)h(storage)g(space)f(if)e(the)i
+(arra)m(ys)g(are)g(iden)m(tical.)382 4671 y Fe
 (FTPDES\(unit,colnum,rownu)o(m,n)o(elem)o(ents)o(,of)o(fset)o(,)42
-b(>)47 b(status\))0 4666 y Fd(8.8)135 b(Ro)l(w)46 b(Selection)g(and)f
-(Calculator)h(Routines)0 4916 y Fi(These)21 b(routines)e(all)h(parse)h
+b(>)47 b(status\))0 5011 y Fd(9.8)135 b(Ro)l(w)46 b(Selection)g(and)f
+(Calculator)h(Routines)0 5262 y Fi(These)21 b(routines)e(all)h(parse)h
 (and)f(ev)-5 b(aluate)22 b(an)e(input)f(string)h(con)m(taining)h(a)g
-(user)f(de\014ned)g(arithmetic)g(expression.)0 5029 y(The)29
+(user)f(de\014ned)g(arithmetic)g(expression.)0 5375 y(The)29
 b(\014rst)f(3)i(routines)e(select)i(ro)m(ws)f(in)f(a)i(FITS)e(table,)i
 (based)f(on)g(whether)g(the)g(expression)f(ev)-5 b(aluates)30
-b(to)g(true)0 5142 y(\(not)e(equal)e(to)i(zero\))g(or)f(false)g
+b(to)g(true)0 5488 y(\(not)e(equal)e(to)i(zero\))g(or)f(false)g
 (\(zero\).)41 b(The)27 b(other)g(routines)f(ev)-5 b(aluate)28
 b(the)f(expression)f(and)g(calculate)i(a)f(v)-5 b(alue)0
-5254 y(for)35 b(eac)m(h)h(ro)m(w)g(of)f(the)h(table.)55
+5601 y(for)35 b(eac)m(h)h(ro)m(w)g(of)f(the)h(table.)55
 b(The)35 b(allo)m(w)m(ed)g(expression)f(syn)m(tax)h(is)g(describ)s(ed)e
-(in)h(the)h(ro)m(w)h(\014lter)e(section)h(in)0 5367 y(the)c(earlier)e
-(`Extended)h(File)f(Name)j(Syn)m(tax')e(c)m(hapter)h(of)g(this)e(do)s
-(cumen)m(t.)0 5601 y Fh(1)81 b Fi(Ev)-5 b(aluate)37 b(a)g(b)s(o)s
-(olean)f(expression)g(o)m(v)m(er)i(the)g(indicated)d(ro)m(ws,)k
-(returning)c(an)i(arra)m(y)h(of)f(\015ags)g(indicating)227
-5714 y(whic)m(h)29 b(ro)m(ws)i(ev)-5 b(aluated)30 b(to)h(TR)m(UE/F)-10
-b(ALSE)p eop
-%%Page: 88 94
-88 93 bop 0 299 a Fi(88)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)430
-555 y Fe(FTFROW\(unit,expr,firstr)o(ow,)41 b(nrows,)46
-b(>)i(n_good_rows,)c(row_status,)h(status\))0 795 y Fh(2)81
-b Fi(Find)28 b(the)j(\014rst)f(ro)m(w)g(whic)m(h)f(satis\014es)h(the)h
-(input)d(b)s(o)s(olean)h(expression)430 1035 y Fe(FTFFRW\(unit,)44
-b(expr,)i(>)i(rownum,)e(status\))0 1275 y Fh(3)81 b Fi(Ev)-5
+(in)h(the)h(ro)m(w)h(\014lter)e(section)h(in)0 5714 y(the)i(earlier)f
+(`Extended)g(File)g(Name)h(Syn)m(tax')g(c)m(hapter)h(of)f(this)e(do)s
+(cumen)m(t.)60 b(The)36 b(expression)g(ma)m(y)h(also)g(b)s(e)p
+eop
+%%Page: 97 103
+97 102 bop 0 299 a Fg(9.8.)72 b(R)m(O)m(W)31 b(SELECTION)e(AND)i
+(CALCULA)-8 b(TOR)29 b(R)m(OUTINES)1382 b Fi(97)0 555
+y(written)27 b(to)j(a)e(text)i(\014le,)e(and)g(the)h(name)f(of)h(the)f
+(\014le,)g(prep)s(ended)f(with)g(a)i('@')f(c)m(haracter)i(ma)m(y)f(b)s
+(e)f(supplied)d(for)0 668 y(the)34 b('expr')g(parameter)g(\(e.g.)53
+b('@\014lename.txt'\).)e(The)34 b(expression)e(in)h(the)h(\014le)f(can)
+h(b)s(e)f(arbitrarily)e(complex)0 781 y(and)k(extend)h(o)m(v)m(er)h(m)m
+(ultiple)c(lines)h(of)i(the)f(\014le.)56 b(Lines)35 b(that)h(b)s(egin)e
+(with)g(2)i(slash)f(c)m(haracters)i(\('//'\))h(will)33
+b(b)s(e)0 894 y(ignored)c(and)h(ma)m(y)h(b)s(e)f(used)g(to)h(add)e
+(commen)m(ts)j(to)f(the)f(\014le.)0 1171 y Fh(1)81 b
+Fi(Ev)-5 b(aluate)37 b(a)g(b)s(o)s(olean)f(expression)g(o)m(v)m(er)i
+(the)g(indicated)d(ro)m(ws,)k(returning)c(an)i(arra)m(y)h(of)f(\015ags)
+g(indicating)227 1284 y(whic)m(h)29 b(ro)m(ws)i(ev)-5
+b(aluated)30 b(to)h(TR)m(UE/F)-10 b(ALSE)430 1560 y Fe
+(FTFROW\(unit,expr,firstr)o(ow,)41 b(nrows,)46 b(>)i(n_good_rows,)c
+(row_status,)h(status\))0 1837 y Fh(2)81 b Fi(Find)28
+b(the)j(\014rst)f(ro)m(w)g(whic)m(h)f(satis\014es)h(the)h(input)d(b)s
+(o)s(olean)h(expression)430 2114 y Fe(FTFFRW\(unit,)44
+b(expr,)i(>)i(rownum,)e(status\))0 2391 y Fh(3)81 b Fi(Ev)-5
 b(aluate)34 b(an)g(expression)g(on)g(all)f(ro)m(ws)i(of)f(a)h(table.)53
 b(If)34 b(the)g(input)f(and)h(output)g(\014les)f(are)i(not)g(the)f
-(same,)227 1388 y(cop)m(y)39 b(the)f(TR)m(UE)g(ro)m(ws)h(to)f(the)h
+(same,)227 2503 y(cop)m(y)39 b(the)f(TR)m(UE)g(ro)m(ws)h(to)f(the)h
 (output)e(\014le.)63 b(If)38 b(the)g(\014les)f(are)i(the)f(same,)j
-(delete)d(the)g(F)-10 b(ALSE)38 b(ro)m(ws)227 1501 y(\(preserv)m(e)31
-b(the)g(TR)m(UE)f(ro)m(ws\).)430 1741 y Fe(FTSROW\(inunit,)43
-b(outunit,)j(expr,)g(>)i(status\))0 1981 y Fh(4)81 b
+(delete)d(the)g(F)-10 b(ALSE)38 b(ro)m(ws)227 2616 y(\(preserv)m(e)31
+b(the)g(TR)m(UE)f(ro)m(ws\).)430 2893 y Fe(FTSROW\(inunit,)43
+b(outunit,)j(expr,)g(>)i(status\))0 3170 y Fh(4)81 b
 Fi(Calculate)26 b(an)h(expression)e(for)i(the)f(indicated)g(ro)m(ws)g
 (of)h(a)g(table,)h(returning)d(the)i(results,)f(cast)i(as)f(datat)m(yp)
-s(e)227 2094 y(\(TSHOR)-8 b(T,)32 b(TDOUBLE,)h(etc\),)h(in)d(arra)m(y)
+s(e)227 3283 y(\(TSHOR)-8 b(T,)32 b(TDOUBLE,)h(etc\),)h(in)d(arra)m(y)
 -8 b(.)48 b(If)31 b(n)m(ulv)-5 b(al==NULL,)31 b(UNDEFs)i(will)c(b)s(e)j
-(zero)s(ed)g(out.)47 b(F)-8 b(or)227 2207 y(v)m(ector)37
+(zero)s(ed)g(out.)47 b(F)-8 b(or)227 3396 y(v)m(ector)37
 b(results,)e(the)g(n)m(um)m(b)s(er)e(of)i(elemen)m(ts)h(returned)d(ma)m
 (y)j(b)s(e)e(less)g(than)h(nelemen)m(ts)f(if)g(nelemen)m(ts)h(is)227
-2320 y(not)30 b(an)g(ev)m(en)h(m)m(ultiple)c(of)j(the)g(result)f
+3509 y(not)30 b(an)g(ev)m(en)h(m)m(ultiple)c(of)j(the)g(result)f
 (dimension.)38 b(Call)28 b(FTTEXP)i(to)g(obtain)g(the)g(dimensions)d
-(of)j(the)227 2433 y(results.)430 2673 y Fe(FTCROW\(unit,datatype,ex)o
+(of)j(the)227 3621 y(results.)430 3898 y Fe(FTCROW\(unit,datatype,ex)o
 (pr,)o(firs)o(trow)o(,ne)o(leme)o(nts,)o(nul)o(val,)41
-b(>)620 2786 y(array,anynul,status\))0 3026 y Fh(5)81
+b(>)620 4011 y(array,anynul,status\))0 4288 y Fh(5)81
 b Fi(Ev)-5 b(aluate)32 b(an)h(expression)e(and)i(write)e(the)i(result)f
 (either)g(to)i(a)f(column)e(\(if)h(the)h(expression)e(is)h(a)h
-(function)227 3139 y(of)d(other)g(columns)f(in)f(the)i(table\))g(or)g
+(function)227 4401 y(of)d(other)g(columns)f(in)f(the)i(table\))g(or)g
 (to)g(a)h(k)m(eyw)m(ord)f(\(if)f(the)h(expression)e(ev)-5
-b(aluates)31 b(to)f(a)g(constan)m(t)i(and)227 3252 y(is)e(not)g(a)h
+b(aluates)31 b(to)f(a)g(constan)m(t)i(and)227 4514 y(is)e(not)g(a)h
 (function)e(of)i(other)f(columns)g(in)f(the)h(table\).)41
 b(In)30 b(the)h(former)e(case,)j(the)f(parName)f(parameter)227
-3364 y(is)39 b(the)h(name)f(of)h(the)g(column)e(\(whic)m(h)h(ma)m(y)h
+4627 y(is)39 b(the)h(name)f(of)h(the)g(column)e(\(whic)m(h)h(ma)m(y)h
 (or)f(ma)m(y)h(not)g(already)f(exist\))h(in)m(to)f(whic)m(h)g(to)h
-(write)f(the)227 3477 y(results,)e(and)g(parInfo)e(con)m(tains)i(an)g
+(write)f(the)227 4739 y(results,)e(and)g(parInfo)e(con)m(tains)i(an)g
 (optional)e(TF)m(ORM)i(k)m(eyw)m(ord)g(v)-5 b(alue)37
-b(if)e(a)i(new)f(column)g(is)f(b)s(eing)227 3590 y(created.)60
-b(If)36 b(a)h(TF)m(ORM)g(v)-5 b(alue)36 b(is)f(not)i(sp)s(eci\014ed)e
-(then)h(a)h(default)f(format)g(will)e(b)s(e)i(used,)h(dep)s(ending)227
-3703 y(on)30 b(the)g(expression.)40 b(If)29 b(the)h(expression)f(ev)-5
-b(alutes)30 b(to)h(a)f(constan)m(t,)i(then)d(the)i(result)e(will)e(b)s
-(e)i(written)g(to)227 3816 y(the)f(k)m(eyw)m(ord)g(name)f(giv)m(en)g(b)
-m(y)h(the)f(parName)h(parameter,)h(and)d(the)i(parInfo)e(parameter)i
-(ma)m(y)g(b)s(e)f(used)227 3929 y(to)k(supply)d(an)i(optional)g(commen)
-m(t)h(for)f(the)g(k)m(eyw)m(ord.)42 b(If)29 b(the)i(k)m(eyw)m(ord)g(do)
-s(es)f(not)g(already)g(exist,)g(then)227 4042 y(the)35
-b(name)g(of)g(the)g(k)m(eyw)m(ord)h(m)m(ust)e(b)s(e)h(preceeded)g(with)
-e(a)j('#')f(c)m(haracter,)i(otherwise)e(the)g(result)f(will)227
-4155 y(b)s(e)c(written)f(to)j(a)e(column)f(with)h(that)h(name.)430
-4395 y Fe(FTCALC\(inunit,)43 b(expr,)k(outunit,)e(parName,)h(parInfo,)f
-(>)j(status\))0 4635 y Fh(6)81 b Fi(This)37 b(calculator)j(routine)f
-(is)f(similar)f(to)j(the)g(previous)e(routine,)j(except)g(that)f(the)g
-(expression)e(is)h(only)227 4748 y(ev)-5 b(aluated)41
-b(o)m(v)m(er)g(the)f(sp)s(eci\014ed)f(ro)m(w)h(ranges.)70
-b(nranges)39 b(sp)s(eci\014es)g(the)h(n)m(um)m(b)s(er)f(of)h(ro)m(w)h
-(ranges,)i(and)227 4861 y(\014rstro)m(w)30 b(and)g(lastro)m(w)g(giv)m
-(e)h(the)g(starting)f(and)g(ending)f(ro)m(w)h(n)m(um)m(b)s(er)f(of)i
-(eac)m(h)g(range.)430 5101 y Fe(FTCALC_RNG\(inunit,)42
-b(expr,)47 b(outunit,)e(parName,)h(parInfo,)573 5214
-y(nranges,)f(firstrow,)h(lastrow,)f(>)j(status\))0 5454
-y Fh(7)81 b Fi(Ev)-5 b(aluate)30 b(the)h(giv)m(en)f(expression)f(and)h
-(return)f(information)g(on)h(the)h(result.)430 5694 y
-Fe(FTTEXP\(unit,)44 b(expr,)i(>)i(datatype,)d(nelem,)h(naxis,)g(naxes,)
-g(status\))p eop
-%%Page: 89 95
-89 94 bop 0 299 a Fg(8.9.)72 b(CELESTIAL)29 b(COORDINA)-8
-b(TE)30 b(SYSTEM)f(SUBR)m(OUTINES)1307 b Fi(89)0 555
-y Fd(8.9)135 b(Celestial)48 b(Co)t(ordinate)e(System)f(Subroutines)0
-805 y Fi(The)27 b(follo)m(wing)f(subroutines)g(are)i(pro)m(vided)e(to)j
-(help)d(calculate)i(the)g(transformation)f(b)s(et)m(w)m(een)h(pixel)e
-(lo)s(cation)0 918 y(in)34 b(an)h(image)h(and)e(the)i(corresp)s(onding)
-d(celestial)i(co)s(ordinates)g(on)g(the)g(sky)-8 b(.)56
-b(These)35 b(supp)s(ort)e(the)i(follo)m(wing)0 1031 y(standard)c(map)g
-(pro)5 b(jections:)42 b(-SIN,)31 b(-T)-8 b(AN,)32 b(-AR)m(C,)g(-NCP)-8
-b(,)32 b(-GLS,)g(-MER,)g(and)f(-AIT)g(\(these)h(are)g(the)f(legal)0
-1144 y(v)-5 b(alues)24 b(for)g(the)h(co)s(ordt)m(yp)s(e)f(parameter\).)
-40 b(These)24 b(routines)f(are)i(based)f(on)g(similar)e(functions)h(in)
-g(Classic)g(AIPS.)0 1257 y(All)29 b(the)i(angular)e(quan)m(tities)h
-(are)h(giv)m(en)f(in)f(units)g(of)h(degrees.)0 1497 y
-Fh(1)81 b Fi(Get)22 b(the)g(v)-5 b(alues)20 b(of)i(all)e(the)i
+b(if)e(a)i(new)f(column)g(is)f(b)s(eing)227 4852 y(created.)42
+b(If)28 b(a)h(TF)m(ORM)h(v)-5 b(alue)28 b(is)g(not)h(sp)s(eci\014ed)f
+(then)g(a)i(default)e(format)h(will)e(b)s(e)h(used,)h(dep)s(ending)d
+(on)227 4965 y(the)35 b(expression.)53 b(If)34 b(the)h(expression)e(ev)
+-5 b(aluates)36 b(to)f(a)g(constan)m(t,)i(then)e(the)g(result)e(will)f
+(b)s(e)i(written)g(to)227 5078 y(the)28 b(k)m(eyw)m(ord)g(name)f(giv)m
+(en)g(b)m(y)h(the)f(parName)h(parameter,)h(and)d(the)i(parInfo)e
+(parameter)i(ma)m(y)g(b)s(e)f(used)227 5191 y(to)k(supply)d(an)i
+(optional)g(commen)m(t)h(for)f(the)g(k)m(eyw)m(ord.)42
+b(If)29 b(the)i(k)m(eyw)m(ord)g(do)s(es)f(not)g(already)g(exist,)g
+(then)227 5304 y(the)g(name)f(of)h(the)g(k)m(eyw)m(ord)g(m)m(ust)f(b)s
+(e)g(preceded)g(with)f(a)i('#')f(c)m(haracter,)j(otherwise)d(the)g
+(result)g(will)e(b)s(e)227 5417 y(written)j(to)h(a)g(column)e(with)g
+(that)i(name.)430 5694 y Fe(FTCALC\(inunit,)43 b(expr,)k(outunit,)e
+(parName,)h(parInfo,)f(>)j(status\))p eop
+%%Page: 98 104
+98 103 bop 0 299 a Fi(98)1319 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
+555 y Fh(6)81 b Fi(This)37 b(calculator)j(routine)f(is)f(similar)f(to)j
+(the)g(previous)e(routine,)j(except)g(that)f(the)g(expression)e(is)h
+(only)227 668 y(ev)-5 b(aluated)41 b(o)m(v)m(er)g(the)f(sp)s(eci\014ed)
+f(ro)m(w)h(ranges.)70 b(nranges)39 b(sp)s(eci\014es)g(the)h(n)m(um)m(b)
+s(er)f(of)h(ro)m(w)h(ranges,)i(and)227 781 y(\014rstro)m(w)30
+b(and)g(lastro)m(w)g(giv)m(e)h(the)g(starting)f(and)g(ending)f(ro)m(w)h
+(n)m(um)m(b)s(er)f(of)i(eac)m(h)g(range.)430 1031 y Fe
+(FTCALC_RNG\(inunit,)42 b(expr,)47 b(outunit,)e(parName,)h(parInfo,)573
+1144 y(nranges,)f(firstrow,)h(lastrow,)f(>)j(status\))0
+1394 y Fh(7)81 b Fi(Ev)-5 b(aluate)30 b(the)h(giv)m(en)f(expression)f
+(and)h(return)f(information)g(on)h(the)h(result.)430
+1643 y Fe(FTTEXP\(unit,)44 b(expr,)i(>)i(datatype,)d(nelem,)h(naxis,)g
+(naxes,)g(status\))0 1976 y Fd(9.9)135 b(Celestial)48
+b(Co)t(ordinate)e(System)f(Subroutines)0 2226 y Fi(The)36
+b(FITS)g(comm)m(unit)m(y)g(has)g(adopted)h(a)g(set)g(of)g(k)m(eyw)m
+(ord)g(con)m(v)m(en)m(tions)g(that)g(de\014ne)f(the)h(transformations)0
+2339 y(needed)30 b(to)i(con)m(v)m(ert)g(b)s(et)m(w)m(een)f(pixel)e(lo)s
+(cations)h(in)f(an)i(image)g(and)f(the)g(corresp)s(onding)f(celestial)h
+(co)s(ordinates)0 2452 y(on)25 b(the)h(sky)-8 b(,)27
+b(or)e(more)g(generally)-8 b(,)27 b(that)f(de\014ne)e(w)m(orld)g(co)s
+(ordinates)i(that)f(are)h(to)g(b)s(e)f(asso)s(ciated)h(with)e(an)m(y)i
+(pixel)0 2564 y(lo)s(cation)34 b(in)f(an)i(n-dimensional)c(FITS)j(arra)
+m(y)-8 b(.)54 b(CFITSIO)33 b(is)g(distributed)f(with)h(a)i(couple)e(of)
+i(self-con)m(tained)0 2677 y(W)-8 b(orld)27 b(Co)s(ordinate)f(System)g
+(\(W)m(CS\))i(routines,)f(ho)m(w)m(ev)m(er,)i(these)f(routines)e(DO)h
+(NOT)f(supp)s(ort)f(all)h(the)h(latest)0 2790 y(W)m(CS)38
+b(con)m(v)m(en)m(tions,)j(so)e(it)f(is)f(STR)m(ONGL)-8
+b(Y)38 b(RECOMMENDED)h(that)f(soft)m(w)m(are)i(dev)m(elop)s(ers)d(use)h
+(a)h(more)0 2903 y(robust)30 b(external)g(W)m(CS)g(library)-8
+b(.)39 b(Sev)m(eral)30 b(recommended)g(libraries)e(are:)95
+3153 y Fe(WCSLIB)47 b(-)95 b(supported)45 b(by)i(Mark)g(Calabretta)95
+3266 y(WCSTools)f(-)h(supported)f(by)h(Doug)g(Mink)95
+3379 y(AST)g(library)f(-)i(developed)d(by)i(the)g(U.K.)g(Starlink)e
+(project)0 3629 y Fi(More)30 b(information)d(ab)s(out)i(the)g(W)m(CS)g
+(k)m(eyw)m(ord)h(con)m(v)m(en)m(tions)g(and)e(links)f(to)j(all)e(of)h
+(these)g(W)m(CS)g(libraries)e(can)0 3742 y(b)s(e)j(found)f(on)h(the)h
+(FITS)e(Supp)s(ort)g(O\016ce)h(w)m(eb)g(site)h(at)g(h)m
+(ttp://\014ts.gsfc.nasa.go)m(v)j(under)29 b(the)h(W)m(CS)h(link.)0
+3902 y(The)i(functions)g(pro)m(vided)g(in)f(these)j(external)e(W)m(CS)h
+(libraries)e(will)f(need)j(access)h(to)g(the)f(W)m(CS)g(information)0
+4015 y(con)m(tained)g(in)e(the)i(FITS)f(\014le)g(headers.)51
+b(One)33 b(con)m(v)m(enien)m(t)i(w)m(a)m(y)g(to)f(pass)g(this)e
+(information)g(to)j(the)f(extermal)0 4128 y(library)j(is)i(to)i(use)e
+(FITSIO)g(to)h(cop)m(y)h(the)f(header)f(k)m(eyw)m(ords)h(in)m(to)g(one)
+g(long)f(c)m(haracter)j(string,)f(and)e(then)0 4240 y(pass)29
+b(this)g(string)g(to)h(an)g(in)m(terface)g(routine)f(in)g(the)h
+(external)f(library)f(that)i(will)d(extract)32 b(the)e(necessary)g(W)m
+(CS)0 4353 y(information)f(\(e.g.,)j(see)f(the)f(astFitsChan)g(and)g
+(astPutCards)g(routines)f(in)g(the)i(Starlink)d(AST)i(library\).)0
+4514 y(The)24 b(follo)m(wing)g(FITSIO)f(routines)h(DO)h(NOT)f(supp)s
+(ort)f(the)i(more)g(recen)m(t)h(W)m(CS)f(con)m(v)m(en)m(tions)h(that)g
+(ha)m(v)m(e)g(b)s(een)0 4626 y(appro)m(v)m(ed)37 b(as)h(part)f(of)g
+(the)h(FITS)e(standard.)61 b(Consequen)m(tly)-8 b(,)38
+b(the)g(follo)m(wing)d(routines)i(ARE)g(NO)m(W)h(DEP-)0
+4739 y(RECA)-8 b(TED.)29 b(It)f(is)g(STR)m(ONGL)-8 b(Y)28
+b(RECOMMENDED)h(that)g(soft)m(w)m(are)h(dev)m(elop)s(ers)e(not)h(use)f
+(these)h(routines,)0 4852 y(and)h(instead)f(use)h(an)h(external)f(W)m
+(CS)g(library)-8 b(,)29 b(as)i(describ)s(ed)d(ab)s(o)m(v)m(e.)0
+5012 y(These)21 b(routines)f(are)h(included)d(mainly)h(for)i(bac)m(kw)m
+(ard)g(compatibilit)m(y)f(with)f(existing)h(soft)m(w)m(are.)39
+b(They)21 b(supp)s(ort)0 5125 y(the)30 b(follo)m(wing)f(standard)g(map)
+g(pro)5 b(jections:)40 b(-SIN,)30 b(-T)-8 b(AN,)31 b(-AR)m(C,)g(-NCP)-8
+b(,)30 b(-GLS,)g(-MER,)h(and)e(-AIT)h(\(these)0 5238
+y(are)f(the)g(legal)f(v)-5 b(alues)28 b(for)g(the)h(co)s(ordt)m(yp)s(e)
+f(parameter\).)41 b(These)28 b(routines)g(are)h(based)f(on)g(similar)e
+(functions)h(in)0 5351 y(Classic)i(AIPS.)h(All)f(the)i(angular)e(quan)m
+(tities)h(are)h(giv)m(en)f(in)f(units)g(of)h(degrees.)0
+5601 y Fh(1)81 b Fi(Get)22 b(the)g(v)-5 b(alues)20 b(of)i(all)e(the)i
 (standard)f(FITS)f(celestial)h(co)s(ordinate)h(system)f(k)m(eyw)m(ords)
-h(from)f(the)h(header)f(of)h(a)227 1610 y(FITS)j(image)h(\(i.e.,)h(the)
+h(from)f(the)h(header)f(of)h(a)227 5714 y(FITS)j(image)h(\(i.e.,)h(the)
 e(primary)f(arra)m(y)i(or)f(an)h(image)f(extension\).)39
-b(These)26 b(v)-5 b(alues)24 b(ma)m(y)i(then)g(b)s(e)e(passed)227
-1723 y(to)39 b(the)e(subroutines)f(that)i(p)s(erform)e(the)i(co)s
-(ordinate)f(transformations.)62 b(If)37 b(an)m(y)h(or)g(all)e(of)i(the)
-g(W)m(CS)227 1836 y(k)m(eyw)m(ords)32 b(are)f(not)g(presen)m(t,)h(then)
-f(default)f(v)-5 b(alues)30 b(will)f(b)s(e)h(returned.)41
+b(These)26 b(v)-5 b(alues)24 b(ma)m(y)i(then)g(b)s(e)e(passed)p
+eop
+%%Page: 99 105
+99 104 bop 0 299 a Fg(9.10.)73 b(FILE)30 b(CHECKSUM)f(SUBR)m(OUTINES)
+2080 b Fi(99)227 555 y(to)39 b(the)e(subroutines)f(that)i(p)s(erform)e
+(the)i(co)s(ordinate)f(transformations.)62 b(If)37 b(an)m(y)h(or)g(all)
+e(of)i(the)g(W)m(CS)227 668 y(k)m(eyw)m(ords)32 b(are)f(not)g(presen)m
+(t,)h(then)f(default)f(v)-5 b(alues)30 b(will)f(b)s(e)h(returned.)41
 b(If)31 b(the)g(\014rst)g(co)s(ordinate)f(axis)h(is)227
-1948 y(the)e(declination-lik)m(e)e(co)s(ordinate,)i(then)f(this)f
+781 y(the)e(declination-lik)m(e)e(co)s(ordinate,)i(then)f(this)f
 (routine)h(will)e(sw)m(ap)i(them)h(so)g(that)g(the)g(longitudinal-lik)m
-(e)227 2061 y(co)s(ordinate)h(is)g(returned)f(as)i(the)f(\014rst)g
-(axis.)227 2208 y(If)35 b(the)h(\014le)e(uses)h(the)g(new)m(er)h('CDj)p
-1454 2208 28 4 v 32 w(i')f(W)m(CS)g(transformation)g(matrix)g(k)m(eyw)m
-(ords)g(instead)g(of)g(old)g(st)m(yle)227 2321 y('CDEL)-8
+(e)227 894 y(co)s(ordinate)h(is)g(returned)f(as)i(the)f(\014rst)g
+(axis.)227 1045 y(If)35 b(the)h(\014le)e(uses)h(the)g(new)m(er)h('CDj)p
+1454 1045 28 4 v 32 w(i')f(W)m(CS)g(transformation)g(matrix)g(k)m(eyw)m
+(ords)g(instead)g(of)g(old)g(st)m(yle)227 1158 y('CDEL)-8
 b(Tn')37 b(and)f('CR)m(OT)-8 b(A2')38 b(k)m(eyw)m(ords,)h(then)e(this)e
 (routine)h(will)e(calculate)k(and)e(return)g(the)h(v)-5
-b(alues)227 2434 y(of)33 b(the)g(equiv)-5 b(alen)m(t)33
+b(alues)227 1271 y(of)33 b(the)g(equiv)-5 b(alen)m(t)33
 b(old-st)m(yle)f(k)m(eyw)m(ords.)49 b(Note)34 b(that)g(the)f(con)m(v)m
 (ersion)g(from)f(the)i(new-st)m(yle)f(k)m(eyw)m(ords)227
-2547 y(to)f(the)f(old-st)m(yle)f(v)-5 b(alues)30 b(is)g(sometimes)g
+1383 y(to)f(the)f(old-st)m(yle)f(v)-5 b(alues)30 b(is)g(sometimes)g
 (only)g(an)h(appro)m(ximation,)f(so)g(if)g(the)h(appro)m(ximation)f(is)
-f(larger)227 2660 y(than)37 b(an)h(in)m(ternally)d(de\014ned)h
+f(larger)227 1496 y(than)37 b(an)h(in)m(ternally)d(de\014ned)h
 (threshold)g(lev)m(el,)j(then)e(CFITSIO)f(will)f(still)g(return)h(the)i
-(appro)m(ximate)227 2773 y(W)m(CS)f(k)m(eyw)m(ord)g(v)-5
+(appro)m(ximate)227 1609 y(W)m(CS)f(k)m(eyw)m(ord)g(v)-5
 b(alues,)38 b(but)e(will)e(also)j(return)e(with)h(status)h(=)f(506,)k
-(to)e(w)m(arn)e(the)h(calling)e(program)227 2886 y(that)30
+(to)e(w)m(arn)e(the)h(calling)e(program)227 1722 y(that)30
 b(appro)m(ximations)d(ha)m(v)m(e)j(b)s(een)e(made.)40
 b(It)29 b(is)f(then)g(up)g(to)h(the)g(calling)f(program)g(to)h(decide)g
-(whether)227 2999 y(the)34 b(appro)m(ximations)e(are)i(su\016cien)m
+(whether)227 1835 y(the)34 b(appro)m(ximations)e(are)i(su\016cien)m
 (tly)e(accurate)k(for)d(the)h(particular)d(application,)i(or)h(whether)
-f(more)227 3112 y(precise)d(W)m(CS)g(transformations)g(m)m(ust)g(b)s(e)
+f(more)227 1948 y(precise)d(W)m(CS)g(transformations)g(m)m(ust)g(b)s(e)
 g(p)s(erformed)f(using)g(new-st)m(yle)h(W)m(CS)h(k)m(eyw)m(ords)f
-(directly)-8 b(.)382 3351 y Fe(FTGICS\(unit,)44 b(>)k
+(directly)-8 b(.)382 2209 y Fe(FTGICS\(unit,)44 b(>)k
 (xrval,yrval,xrpix,yrpix)o(,xin)o(c,yi)o(nc,)o(rot,)o(coor)o(dty)o
-(pe,s)o(tatu)o(s\))0 3591 y Fh(2)81 b Fi(Get)34 b(the)f(v)-5
+(pe,s)o(tatu)o(s\))0 2470 y Fh(2)81 b Fi(Get)34 b(the)f(v)-5
 b(alues)32 b(of)h(all)f(the)h(standard)f(FITS)h(celestial)f(co)s
 (ordinate)h(system)g(k)m(eyw)m(ords)g(from)g(the)g(header)227
-3704 y(of)j(a)h(FITS)e(table)g(where)h(the)g(X)g(and)f(Y)h(\(or)g(RA)g
+2583 y(of)j(a)h(FITS)e(table)g(where)h(the)g(X)g(and)f(Y)h(\(or)g(RA)g
 (and)g(DEC)f(co)s(ordinates)h(are)g(stored)g(in)f(2)h(separate)227
-3817 y(columns)31 b(of)h(the)g(table.)45 b(These)31 b(v)-5
+2695 y(columns)31 b(of)h(the)g(table.)45 b(These)31 b(v)-5
 b(alues)31 b(ma)m(y)i(then)e(b)s(e)h(passed)f(to)h(the)g(subroutines)e
-(that)i(p)s(erform)f(the)227 3930 y(co)s(ordinate)f(transformations.)
-382 4170 y Fe(FTGTCS\(unit,xcol,ycol,)42 b(>)716 4283
+(that)i(p)s(erform)f(the)227 2808 y(co)s(ordinate)f(transformations.)
+382 3069 y Fe(FTGTCS\(unit,xcol,ycol,)42 b(>)716 3182
 y(xrval,yrval,xrpix,yrpix,)o(xinc)o(,yi)o(nc,r)o(ot,c)o(oor)o(dtyp)o
-(e,st)o(atu)o(s\))0 4523 y Fh(3)81 b Fi(Calculate)40
+(e,st)o(atu)o(s\))0 3443 y Fh(3)81 b Fi(Calculate)40
 b(the)i(celestial)e(co)s(ordinate)h(corresp)s(onding)e(to)j(the)f
 (input)e(X)i(and)g(Y)g(pixel)e(lo)s(cation)i(in)f(the)227
-4635 y(image.)382 4875 y Fe(FTWLDP\(xpix,ypix,xrval,y)o(rva)o(l,xr)o
-(pix,)o(yrp)o(ix,x)o(inc,)o(yin)o(c,ro)o(t,)1241 4988
-y(coordtype,)45 b(>)i(xpos,ypos,status\))0 5228 y Fh(4)81
+3556 y(image.)382 3817 y Fe(FTWLDP\(xpix,ypix,xrval,y)o(rva)o(l,xr)o
+(pix,)o(yrp)o(ix,x)o(inc,)o(yin)o(c,ro)o(t,)1241 3929
+y(coordtype,)45 b(>)i(xpos,ypos,status\))0 4190 y Fh(4)81
 b Fi(Calculate)40 b(the)i(X)f(and)f(Y)h(pixel)f(lo)s(cation)g(corresp)s
 (onding)f(to)j(the)f(input)e(celestial)i(co)s(ordinate)g(in)f(the)227
-5341 y(image.)382 5581 y Fe(FTXYPX\(xpos,ypos,xrval,y)o(rva)o(l,xr)o
-(pix,)o(yrp)o(ix,x)o(inc,)o(yin)o(c,ro)o(t,)1241 5694
-y(coordtype,)45 b(>)i(xpix,ypix,status\))p eop
-%%Page: 90 96
-90 95 bop 0 299 a Fi(90)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fd(8.10)136 b(File)45 b(Chec)l(ksum)g(Subroutines)0
-808 y Fi(The)33 b(follo)m(wing)e(routines)h(either)h(compute)g(or)h(v)
--5 b(alidate)32 b(the)i(c)m(hec)m(ksums)f(for)g(the)h(CHDU.)g(The)e(D)m
-(A)-8 b(T)g(ASUM)0 921 y(k)m(eyw)m(ord)33 b(is)e(used)g(to)i(store)f
-(the)h(n)m(umerical)d(v)-5 b(alue)32 b(of)g(the)g(32-bit,)h(1's)g
-(complemen)m(t)f(c)m(hec)m(ksum)h(for)f(the)g(data)0
-1034 y(unit)25 b(alone.)39 b(If)25 b(there)h(is)g(no)f(data)i(unit)e
-(then)g(the)h(v)-5 b(alue)26 b(is)f(set)h(to)h(zero.)40
-b(The)26 b(n)m(umerical)e(v)-5 b(alue)26 b(is)f(stored)h(as)g(an)0
-1147 y(ASCI)s(I)20 b(string)h(of)i(digits,)f(enclosed)g(in)e(quotes,)25
+4303 y(image.)382 4564 y Fe(FTXYPX\(xpos,ypos,xrval,y)o(rva)o(l,xr)o
+(pix,)o(yrp)o(ix,x)o(inc,)o(yin)o(c,ro)o(t,)1241 4677
+y(coordtype,)45 b(>)i(xpix,ypix,status\))0 5012 y Fd(9.10)136
+b(File)45 b(Chec)l(ksum)g(Subroutines)0 5262 y Fi(The)33
+b(follo)m(wing)e(routines)h(either)h(compute)g(or)h(v)-5
+b(alidate)32 b(the)i(c)m(hec)m(ksums)f(for)g(the)h(CHDU.)g(The)e(D)m(A)
+-8 b(T)g(ASUM)0 5375 y(k)m(eyw)m(ord)33 b(is)e(used)g(to)i(store)f(the)
+h(n)m(umerical)d(v)-5 b(alue)32 b(of)g(the)g(32-bit,)h(1's)g(complemen)
+m(t)f(c)m(hec)m(ksum)h(for)f(the)g(data)0 5488 y(unit)25
+b(alone.)39 b(If)25 b(there)h(is)g(no)f(data)i(unit)e(then)g(the)h(v)-5
+b(alue)26 b(is)f(set)h(to)h(zero.)40 b(The)26 b(n)m(umerical)e(v)-5
+b(alue)26 b(is)f(stored)h(as)g(an)0 5601 y(ASCI)s(I)20
+b(string)h(of)i(digits,)f(enclosed)g(in)e(quotes,)25
 b(b)s(ecause)d(the)g(v)-5 b(alue)22 b(ma)m(y)g(b)s(e)f(to)s(o)i(large)f
-(to)h(represen)m(t)f(as)g(a)h(32-bit)0 1260 y(signed)k(in)m(teger.)40
+(to)h(represen)m(t)f(as)g(a)h(32-bit)0 5714 y(signed)k(in)m(teger.)40
 b(The)27 b(CHECKSUM)g(k)m(eyw)m(ord)i(is)e(used)g(to)h(store)h(the)f
-(ASCI)s(I)e(enco)s(ded)i(COMPLEMENT)f(of)0 1373 y(the)f(c)m(hec)m(ksum)
-h(for)f(the)h(en)m(tire)f(HDU.)h(Storing)e(the)i(complemen)m(t,)g
-(rather)f(than)g(the)h(actual)f(c)m(hec)m(ksum,)i(forces)0
-1486 y(the)k(c)m(hec)m(ksum)h(for)f(the)h(whole)e(HDU)i(to)g(equal)f
-(zero.)47 b(If)31 b(the)i(\014le)e(has)h(b)s(een)f(mo)s(di\014ed)f
-(since)i(the)g(c)m(hec)m(ksums)0 1599 y(w)m(ere)39 b(computed,)i(then)e
-(the)g(HDU)g(c)m(hec)m(ksum)h(will)c(usually)g(not)j(equal)g(zero.)66
-b(These)39 b(c)m(hec)m(ksum)g(k)m(eyw)m(ord)0 1712 y(con)m(v)m(en)m
-(tions)33 b(are)g(based)f(on)g(a)g(pap)s(er)f(b)m(y)h(Rob)g(Seaman)g
-(published)d(in)i(the)h(pro)s(ceedings)f(of)h(the)h(AD)m(ASS)f(IV)0
-1825 y(conference)f(in)e(Baltimore)h(in)g(No)m(v)m(em)m(b)s(er)h(1994)h
-(and)e(a)h(later)f(revision)f(in)g(June)g(1995.)0 2098
-y Fh(1)81 b Fi(Compute)33 b(and)g(write)g(the)h(D)m(A)-8
+(ASCI)s(I)e(enco)s(ded)i(COMPLEMENT)f(of)p eop
+%%Page: 100 106
+100 105 bop 0 299 a Fi(100)1274 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
+555 y Fi(the)c(c)m(hec)m(ksum)h(for)f(the)h(en)m(tire)f(HDU.)h(Storing)
+e(the)i(complemen)m(t,)g(rather)f(than)g(the)h(actual)f(c)m(hec)m
+(ksum,)i(forces)0 668 y(the)k(c)m(hec)m(ksum)h(for)f(the)h(whole)e(HDU)
+i(to)g(equal)f(zero.)47 b(If)31 b(the)i(\014le)e(has)h(b)s(een)f(mo)s
+(di\014ed)f(since)i(the)g(c)m(hec)m(ksums)0 781 y(w)m(ere)39
+b(computed,)i(then)e(the)g(HDU)g(c)m(hec)m(ksum)h(will)c(usually)g(not)
+j(equal)g(zero.)66 b(These)39 b(c)m(hec)m(ksum)g(k)m(eyw)m(ord)0
+894 y(con)m(v)m(en)m(tions)33 b(are)g(based)f(on)g(a)g(pap)s(er)f(b)m
+(y)h(Rob)g(Seaman)g(published)d(in)i(the)h(pro)s(ceedings)f(of)h(the)h
+(AD)m(ASS)f(IV)0 1007 y(conference)f(in)e(Baltimore)h(in)g(No)m(v)m(em)
+m(b)s(er)h(1994)h(and)e(a)h(later)f(revision)f(in)g(June)g(1995.)0
+1237 y Fh(1)81 b Fi(Compute)33 b(and)g(write)g(the)h(D)m(A)-8
 b(T)g(ASUM)35 b(and)e(CHECKSUM)g(k)m(eyw)m(ord)h(v)-5
-b(alues)33 b(for)g(the)h(CHDU)g(in)m(to)g(the)227 2210
+b(alues)33 b(for)g(the)h(CHDU)g(in)m(to)g(the)227 1350
 y(curren)m(t)25 b(header.)38 b(The)24 b(D)m(A)-8 b(T)g(ASUM)27
 b(v)-5 b(alue)24 b(is)f(the)i(32-bit)g(c)m(hec)m(ksum)g(for)f(the)h
-(data)g(unit,)g(expressed)f(as)h(a)227 2323 y(decimal)30
+(data)g(unit,)g(expressed)f(as)h(a)227 1463 y(decimal)30
 b(in)m(teger)g(enclosed)g(in)f(single)g(quotes.)41 b(The)30
 b(CHECKSUM)g(k)m(eyw)m(ord)g(v)-5 b(alue)30 b(is)f(a)i(16-c)m(haracter)
-227 2436 y(string)i(whic)m(h)f(is)h(the)g(ASCI)s(I-enco)s(ded)f(v)-5
+227 1576 y(string)i(whic)m(h)f(is)h(the)g(ASCI)s(I-enco)s(ded)f(v)-5
 b(alue)33 b(for)h(the)f(complemen)m(t)h(of)g(the)f(c)m(hec)m(ksum)i
-(for)e(the)h(whole)227 2549 y(HDU.)h(If)e(these)g(k)m(eyw)m(ords)h
+(for)e(the)h(whole)227 1689 y(HDU.)h(If)e(these)g(k)m(eyw)m(ords)h
 (already)f(exist,)h(their)e(v)-5 b(alues)33 b(will)e(b)s(e)i(up)s
-(dated)f(only)g(if)g(necessary)i(\(i.e.,)h(if)227 2662
+(dated)f(only)g(if)g(necessary)i(\(i.e.,)h(if)227 1802
 y(the)c(\014le)e(has)h(b)s(een)g(mo)s(di\014ed)e(since)i(the)h
 (original)d(k)m(eyw)m(ord)j(v)-5 b(alues)30 b(w)m(ere)h(computed\).)382
-2935 y Fe(FTPCKS\(unit,)44 b(>)k(status\))0 3208 y Fh(2)81
+2033 y Fe(FTPCKS\(unit,)44 b(>)k(status\))0 2263 y Fh(2)81
 b Fi(Up)s(date)28 b(the)h(CHECKSUM)e(k)m(eyw)m(ord)i(v)-5
 b(alue)28 b(in)f(the)i(CHDU,)g(assuming)e(that)i(the)f(D)m(A)-8
-b(T)g(ASUM)30 b(k)m(eyw)m(ord)227 3321 y(exists)35 b(and)g(already)g
+b(T)g(ASUM)30 b(k)m(eyw)m(ord)227 2376 y(exists)35 b(and)g(already)g
 (has)g(the)h(correct)g(v)-5 b(alue.)55 b(This)34 b(routine)g
 (calculates)i(the)g(new)f(c)m(hec)m(ksum)h(for)f(the)227
-3434 y(curren)m(t)40 b(header)g(unit,)i(adds)d(it)h(to)h(the)f(data)h
+2489 y(curren)m(t)40 b(header)g(unit,)i(adds)d(it)h(to)h(the)f(data)h
 (unit)e(c)m(hec)m(ksum,)44 b(enco)s(des)c(the)g(v)-5
-b(alue)40 b(in)m(to)g(an)g(ASCI)s(I)227 3547 y(string,)30
+b(alue)40 b(in)m(to)g(an)g(ASCI)s(I)227 2602 y(string,)30
 b(and)g(writes)f(the)i(string)e(to)i(the)g(CHECKSUM)e(k)m(eyw)m(ord.)
-382 3819 y Fe(FTUCKS\(unit,)44 b(>)k(status\))0 4092
+382 2833 y Fe(FTUCKS\(unit,)44 b(>)k(status\))0 3063
 y Fh(3)81 b Fi(V)-8 b(erify)34 b(the)g(CHDU)h(b)m(y)g(computing)e(the)i
 (c)m(hec)m(ksums)g(and)f(comparing)g(them)g(with)f(the)i(k)m(eyw)m
-(ords.)53 b(The)227 4205 y(data)34 b(unit)e(is)g(v)m(eri\014ed)g
+(ords.)53 b(The)227 3176 y(data)34 b(unit)e(is)g(v)m(eri\014ed)g
 (correctly)h(if)f(the)i(computed)f(c)m(hec)m(ksum)g(equals)g(the)g(v)-5
-b(alue)33 b(of)g(the)g(D)m(A)-8 b(T)g(ASUM)227 4318 y(k)m(eyw)m(ord.)64
+b(alue)33 b(of)g(the)g(D)m(A)-8 b(T)g(ASUM)227 3289 y(k)m(eyw)m(ord.)64
 b(The)37 b(c)m(hec)m(ksum)i(for)f(the)g(en)m(tire)f(HDU)i(\(header)f
 (plus)e(data)j(unit\))d(is)h(correct)i(if)e(it)h(equals)227
-4431 y(zero.)55 b(The)34 b(output)g(D)m(A)-8 b(T)g(A)m(OK)37
+3402 y(zero.)55 b(The)34 b(output)g(D)m(A)-8 b(T)g(A)m(OK)37
 b(and)d(HDUOK)h(parameters)g(in)e(this)h(subroutine)e(are)j(in)m
-(tegers)g(whic)m(h)227 4544 y(will)24 b(ha)m(v)m(e)j(a)f(v)-5
+(tegers)g(whic)m(h)227 3515 y(will)24 b(ha)m(v)m(e)j(a)f(v)-5
 b(alue)26 b(=)g(1)g(if)f(the)i(data)f(or)g(HDU)h(is)e(v)m(eri\014ed)h
 (correctly)-8 b(,)28 b(a)e(v)-5 b(alue)26 b(=)f(0)i(if)e(the)h(D)m(A)-8
-b(T)g(ASUM)28 b(or)227 4657 y(CHECKSUM)h(k)m(eyw)m(ord)g(is)g(not)g
+b(T)g(ASUM)28 b(or)227 3628 y(CHECKSUM)h(k)m(eyw)m(ord)g(is)g(not)g
 (presen)m(t,)h(or)f(v)-5 b(alue)29 b(=)g(-1)h(if)e(the)i(computed)f(c)m
-(hec)m(ksum)h(is)e(not)i(correct.)382 4930 y Fe(FTVCKS\(unit,)44
-b(>)k(dataok,hduok,status\))0 5203 y Fh(4)81 b Fi(Compute)25
+(hec)m(ksum)h(is)e(not)i(correct.)382 3858 y Fe(FTVCKS\(unit,)44
+b(>)k(dataok,hduok,status\))0 4089 y Fh(4)81 b Fi(Compute)25
 b(and)h(return)f(the)i(c)m(hec)m(ksum)g(v)-5 b(alues)25
 b(for)h(the)h(CHDU)f(\(as)h(double)e(precision)g(v)-5
-b(ariables\))25 b(without)227 5315 y(creating)45 b(or)f(mo)s(difying)e
+b(ariables\))25 b(without)227 4202 y(creating)45 b(or)f(mo)s(difying)e
 (the)j(CHECKSUM)e(and)h(D)m(A)-8 b(T)g(ASUM)46 b(k)m(eyw)m(ords.)83
-b(This)43 b(routine)g(is)h(used)227 5428 y(in)m(ternally)29
+b(This)43 b(routine)g(is)h(used)227 4315 y(in)m(ternally)29
 b(b)m(y)h(FTV)m(CKS,)g(but)g(ma)m(y)h(b)s(e)e(useful)g(in)g(other)i
-(situations)e(as)h(w)m(ell.)382 5701 y Fe(FTGCKS\(unit,)44
-b(>)k(datasum,hdusum,status\))p eop
-%%Page: 91 97
-91 96 bop 0 299 a Fg(8.11.)113 b(D)m(A)-8 b(TE)31 b(AND)g(TIME)f
-(UTILITY)g(R)m(OUTINES)1812 b Fi(91)0 555 y Fh(5)81 b
-Fi(Enco)s(de)33 b(a)h(c)m(hec)m(ksum)h(v)-5 b(alue)33
-b(\(stored)h(in)f(a)h(double)f(precision)f(v)-5 b(ariable\))33
-b(in)m(to)g(a)i(16-c)m(haracter)h(string.)50 b(If)227
-668 y(COMPLEMENT)30 b(=)g(.true.)41 b(then)30 b(the)g(32-bit)h(sum)e(v)
--5 b(alue)30 b(will)e(b)s(e)i(complemen)m(ted)g(b)s(efore)g(enco)s
-(ding.)382 920 y Fe(FTESUM\(sum,complement,)42 b(>)47
-b(checksum\))0 1172 y Fh(6)81 b Fi(Deco)s(de)39 b(a)f(16)h(c)m
-(haracter)h(c)m(hec)m(ksum)e(string)f(in)m(to)h(a)h(double)d(precision)
-g(v)-5 b(alue.)64 b(If)37 b(COMPLEMENT)g(=)227 1285 y(.true.)k(then)30
+(situations)e(as)h(w)m(ell.)382 4545 y Fe(FTGCKS\(unit,)44
+b(>)k(datasum,hdusum,status\))0 4776 y Fh(5)81 b Fi(Enco)s(de)33
+b(a)h(c)m(hec)m(ksum)h(v)-5 b(alue)33 b(\(stored)h(in)f(a)h(double)f
+(precision)f(v)-5 b(ariable\))33 b(in)m(to)g(a)i(16-c)m(haracter)h
+(string.)50 b(If)227 4889 y(COMPLEMENT)30 b(=)g(.true.)41
+b(then)30 b(the)g(32-bit)h(sum)e(v)-5 b(alue)30 b(will)e(b)s(e)i
+(complemen)m(ted)g(b)s(efore)g(enco)s(ding.)382 5120
+y Fe(FTESUM\(sum,complement,)42 b(>)47 b(checksum\))0
+5350 y Fh(6)81 b Fi(Deco)s(de)39 b(a)f(16)h(c)m(haracter)h(c)m(hec)m
+(ksum)e(string)f(in)m(to)h(a)h(double)d(precision)g(v)-5
+b(alue.)64 b(If)37 b(COMPLEMENT)g(=)227 5463 y(.true.)k(then)30
 b(the)h(32-bit)f(sum)g(v)-5 b(alue)30 b(will)d(b)s(e)j(complemen)m(ted)
-h(after)f(deco)s(ding.)382 1536 y Fe(FTDSUM\(checksum,compleme)o(nt,)41
-b(>)48 b(sum\))0 1869 y Fd(8.11)180 b(Date)46 b(and)f(Time)g(Utilit)l
-(y)i(Routines)0 2119 y Fi(The)29 b(follo)m(wing)f(routines)h(help)f(to)
-j(construct)f(or)f(parse)h(the)g(FITS)f(date/time)h(strings.)40
-b(Starting)29 b(in)f(the)i(y)m(ear)0 2232 y(2000,)k(the)d(FITS)g(D)m(A)
--8 b(TE)32 b(k)m(eyw)m(ord)g(v)-5 b(alues)30 b(\(and)i(the)f(v)-5
+h(after)f(deco)s(ding.)382 5694 y Fe(FTDSUM\(checksum,compleme)o(nt,)41
+b(>)48 b(sum\))p eop
+%%Page: 101 107
+101 106 bop 0 299 a Fg(9.11.)113 b(D)m(A)-8 b(TE)31 b(AND)g(TIME)f
+(UTILITY)g(R)m(OUTINES)1767 b Fi(101)0 555 y Fd(9.11)180
+b(Date)46 b(and)f(Time)g(Utilit)l(y)i(Routines)0 805
+y Fi(The)29 b(follo)m(wing)f(routines)h(help)f(to)j(construct)f(or)f
+(parse)h(the)g(FITS)f(date/time)h(strings.)40 b(Starting)29
+b(in)f(the)i(y)m(ear)0 918 y(2000,)k(the)d(FITS)g(D)m(A)-8
+b(TE)32 b(k)m(eyw)m(ord)g(v)-5 b(alues)30 b(\(and)i(the)f(v)-5
 b(alues)31 b(of)g(other)h(`D)m(A)-8 b(TE-')33 b(k)m(eyw)m(ords\))f(m)m
-(ust)f(ha)m(v)m(e)i(the)0 2345 y(form)j('YYYY-MM-DD')k(\(date)e(only\))
+(ust)f(ha)m(v)m(e)i(the)0 1031 y(form)j('YYYY-MM-DD')k(\(date)e(only\))
 e(or)h('YYYY-MM-DDThh:mm:ss.ddd...')61 b(\(date)38 b(and)e(time\))g
-(where)0 2458 y(the)30 b(n)m(um)m(b)s(er)f(of)i(decimal)e(places)h(in)f
+(where)0 1144 y(the)30 b(n)m(um)m(b)s(er)f(of)i(decimal)e(places)h(in)f
 (the)h(seconds)g(v)-5 b(alue)30 b(is)f(optional.)40 b(These)30
-b(times)g(are)g(in)f(UTC.)h(The)g(older)0 2571 y('dd/mm/yy')g(date)h
+b(times)g(are)g(in)f(UTC.)h(The)g(older)0 1257 y('dd/mm/yy')g(date)h
 (format)g(ma)m(y)g(not)g(b)s(e)e(used)h(for)g(dates)h(after)g(01)g(Jan)
-m(uary)f(2000.)0 2822 y Fh(1)81 b Fi(Get)31 b(the)g(curren)m(t)f
+m(uary)f(2000.)0 1486 y Fh(1)81 b Fi(Get)31 b(the)g(curren)m(t)f
 (system)g(date.)42 b(The)29 b(returned)h(y)m(ear)h(has)f(4)h(digits)e
-(\(1999,)j(2000,)h(etc.\))382 3074 y Fe(FTGSDT\()46 b(>)h(day,)g
-(month,)f(year,)g(status)g(\))0 3326 y Fh(2)81 b Fi(Get)34
+(\(1999,)j(2000,)h(etc.\))382 1714 y Fe(FTGSDT\()46 b(>)h(day,)g
+(month,)f(year,)g(status)g(\))0 1943 y Fh(2)81 b Fi(Get)34
 b(the)g(curren)m(t)g(system)f(date)i(and)e(time)g(string)g
 (\('YYYY-MM-DDThh:mm:ss'\).)53 b(The)33 b(time)h(will)d(b)s(e)227
-3439 y(in)25 b(UTC/GMT)h(if)f(a)m(v)-5 b(ailable,)26
+2056 y(in)25 b(UTC/GMT)h(if)f(a)m(v)-5 b(ailable,)26
 b(as)h(indicated)d(b)m(y)i(a)g(returned)f(timeref)g(v)-5
 b(alue)26 b(=)f(0.)40 b(If)26 b(the)g(returned)e(v)-5
-b(alue)227 3552 y(of)31 b(timeref)f(=)h(1)g(then)f(this)g(indicates)f
+b(alue)227 2169 y(of)31 b(timeref)f(=)h(1)g(then)f(this)g(indicates)f
 (that)j(it)e(w)m(as)h(not)g(p)s(ossible)d(to)j(con)m(v)m(ert)i(the)d
-(lo)s(cal)g(time)h(to)g(UTC,)227 3665 y(and)f(th)m(us)g(the)h(lo)s(cal)
-e(time)h(w)m(as)h(returned.)382 3916 y Fe(FTGSTM\(>)45
-b(datestr,)h(timeref,)f(status\))0 4168 y Fh(3)81 b Fi(Construct)26
+(lo)s(cal)g(time)h(to)g(UTC,)227 2281 y(and)f(th)m(us)g(the)h(lo)s(cal)
+e(time)h(w)m(as)h(returned.)382 2510 y Fe(FTGSTM\(>)45
+b(datestr,)h(timeref,)f(status\))0 2739 y Fh(3)81 b Fi(Construct)26
 b(a)i(date)g(string)e(from)h(the)g(input)e(date)j(v)-5
 b(alues.)39 b(If)27 b(the)g(y)m(ear)h(is)f(b)s(et)m(w)m(een)g(1900)i
-(and)e(1998,)j(inclu-)227 4281 y(siv)m(e,)37 b(then)d(the)i(returned)d
+(and)e(1998,)j(inclu-)227 2852 y(siv)m(e,)37 b(then)d(the)i(returned)d
 (date)j(string)e(will)e(ha)m(v)m(e)37 b(the)e(old)f(FITS)g(format)i
-(\('dd/mm/yy'\),)h(otherwise)227 4394 y(the)32 b(date)g(string)e(will)e
+(\('dd/mm/yy'\),)h(otherwise)227 2964 y(the)32 b(date)g(string)e(will)e
 (ha)m(v)m(e)33 b(the)e(new)g(FITS)g(format)g(\('YYYY-MM-DD'\).)36
-b(Use)c(FTTM2S)f(instead)f(to)227 4507 y(alw)m(a)m(ys)h(return)e(a)i
+b(Use)c(FTTM2S)f(instead)f(to)227 3077 y(alw)m(a)m(ys)h(return)e(a)i
 (date)g(string)f(using)e(the)j(new)f(FITS)g(format.)382
-4759 y Fe(FTDT2S\()46 b(year,)g(month,)g(day,)h(>)g(datestr,)f
-(status\))0 5010 y Fh(4)81 b Fi(Construct)34 b(a)i(new-format)f(date)h
+3306 y Fe(FTDT2S\()46 b(year,)g(month,)g(day,)h(>)g(datestr,)f
+(status\))0 3535 y Fh(4)81 b Fi(Construct)34 b(a)i(new-format)f(date)h
 (+)f(time)g(string)f(\('YYYY-MM-DDThh:mm:ss.ddd...'\).)57
-b(If)34 b(the)i(y)m(ear,)227 5123 y(mon)m(th,)d(and)e(da)m(y)h(v)-5
+b(If)34 b(the)i(y)m(ear,)227 3647 y(mon)m(th,)d(and)e(da)m(y)h(v)-5
 b(alues)31 b(all)g(=)g(0)h(then)g(only)f(the)h(time)f(is)g(enco)s(ded)g
-(with)g(format)h('hh:mm:ss.ddd...'.)227 5236 y(The)j(decimals)f
+(with)g(format)h('hh:mm:ss.ddd...'.)227 3760 y(The)j(decimals)f
 (parameter)i(sp)s(eci\014es)d(ho)m(w)j(man)m(y)f(decimal)f(places)h(of)
-g(fractional)g(seconds)g(to)h(include)227 5349 y(in)29
+g(fractional)g(seconds)g(to)h(include)227 3873 y(in)29
 b(the)i(string.)40 b(If)29 b(`decimals')h(is)g(negativ)m(e,)h(then)g
 (only)e(the)i(date)g(will)c(b)s(e)j(return)f(\('YYYY-MM-DD'\).)382
-5601 y Fe(FTTM2S\()46 b(year,)g(month,)g(day,)h(hour,)f(minute,)g
-(second,)g(decimals,)764 5714 y(>)h(datestr,)f(status\))p
-eop
-%%Page: 92 98
-92 97 bop 0 299 a Fi(92)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fh(5)81 b Fi(Return)44 b(the)g(date)i(as)f(read)f(from)h(the)g
+4102 y Fe(FTTM2S\()46 b(year,)g(month,)g(day,)h(hour,)f(minute,)g
+(second,)g(decimals,)764 4215 y(>)h(datestr,)f(status\))0
+4443 y Fh(5)81 b Fi(Return)44 b(the)g(date)i(as)f(read)f(from)h(the)g
 (input)d(string,)48 b(where)c(the)h(string)f(ma)m(y)h(b)s(e)f(in)g
-(either)g(the)h(old)227 668 y(\('dd/mm/yy'\))31 b(or)g(new)e
+(either)g(the)h(old)227 4556 y(\('dd/mm/yy'\))31 b(or)g(new)e
 (\('YYYY-MM-DDThh:mm:ss')k(or)d('YYYY-MM-DD'\))k(FITS)c(format.)382
-932 y Fe(FTS2DT\(datestr,)43 b(>)48 b(year,)e(month,)g(day,)h(status\))
-0 1195 y Fh(6)81 b Fi(Return)30 b(the)h(date)h(and)f(time)g(as)g(read)g
-(from)g(the)h(input)d(string,)h(where)h(the)h(string)e(ma)m(y)i(b)s(e)e
-(in)g(either)h(the)227 1308 y(old)d(or)g(new)g(FITS)g(format.)40
-b(The)28 b(returned)f(hours,)h(min)m(utes,)g(and)g(seconds)g(v)-5
-b(alues)28 b(will)d(b)s(e)j(set)h(to)g(zero)227 1421
-y(if)j(the)i(input)d(string)h(do)s(es)h(not)h(include)d(the)i(time)g
-(\('dd/mm/yy')g(or)h('YYYY-MM-DD'\))j(.)c(Similarly)-8
-b(,)227 1534 y(the)36 b(returned)e(y)m(ear,)j(mon)m(th,)g(and)d(date)i
+4785 y Fe(FTS2DT\(datestr,)43 b(>)48 b(year,)e(month,)g(day,)h
+(status\))0 5013 y Fh(6)81 b Fi(Return)30 b(the)h(date)h(and)f(time)g
+(as)g(read)g(from)g(the)h(input)d(string,)h(where)h(the)h(string)e(ma)m
+(y)i(b)s(e)e(in)g(either)h(the)227 5126 y(old)d(or)g(new)g(FITS)g
+(format.)40 b(The)28 b(returned)f(hours,)h(min)m(utes,)g(and)g(seconds)
+g(v)-5 b(alues)28 b(will)d(b)s(e)j(set)h(to)g(zero)227
+5239 y(if)j(the)i(input)d(string)h(do)s(es)h(not)h(include)d(the)i
+(time)g(\('dd/mm/yy')g(or)h('YYYY-MM-DD'\))j(.)c(Similarly)-8
+b(,)227 5352 y(the)36 b(returned)e(y)m(ear,)j(mon)m(th,)g(and)d(date)i
 (v)-5 b(alues)35 b(will)d(b)s(e)j(set)h(to)g(zero)g(if)e(the)h(date)h
-(is)e(not)i(included)c(in)227 1647 y(the)f(input)d(string)i
-(\('hh:mm:ss.ddd...'\).)382 1911 y Fe(FTS2TM\(datestr,)43
-b(>)48 b(year,)e(month,)g(day,)h(hour,)f(minute,)g(second,)g(status\))0
-2249 y Fd(8.12)136 b(General)45 b(Utilit)l(y)i(Subroutines)0
-2500 y Fi(The)30 b(follo)m(wing)f(utilit)m(y)f(subroutines)h(ma)m(y)i
-(b)s(e)e(useful)g(for)h(certain)g(applications:)0 2764
-y Fh(1)81 b Fi(Return)29 b(the)i(starting)f(b)m(yte)h(address)e(of)i
-(the)f(CHDU)h(and)f(the)h(next)f(HDU.)382 3027 y Fe(FTGHAD\(iunit,)44
-b(>)j(curaddr,nextaddr\))0 3291 y Fh(2)81 b Fi(Con)m(v)m(ert)31
+(is)e(not)i(included)c(in)227 5465 y(the)f(input)d(string)i
+(\('hh:mm:ss.ddd...'\).)382 5694 y Fe(FTS2TM\(datestr,)43
+b(>)48 b(year,)e(month,)g(day,)h(hour,)f(minute,)g(second,)g(status\))p
+eop
+%%Page: 102 108
+102 107 bop 0 299 a Fi(102)1274 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
+555 y Fd(9.12)136 b(General)45 b(Utilit)l(y)i(Subroutines)0
+805 y Fi(The)30 b(follo)m(wing)f(utilit)m(y)f(subroutines)h(ma)m(y)i(b)
+s(e)e(useful)g(for)h(certain)g(applications:)0 1060 y
+Fh(1)81 b Fi(Return)29 b(the)i(starting)f(b)m(yte)h(address)e(of)i(the)
+f(CHDU)h(and)f(the)h(next)f(HDU.)382 1315 y Fe(FTGHAD\(iunit,)44
+b(>)j(curaddr,nextaddr\))0 1569 y Fh(2)81 b Fi(Con)m(v)m(ert)31
 b(a)g(c)m(haracter)h(string)d(to)i(upp)s(ercase)e(\(op)s(erates)j(in)d
-(place\).)382 3555 y Fe(FTUPCH\(string\))0 3818 y Fh(3)81
+(place\).)382 1824 y Fe(FTUPCH\(string\))0 2078 y Fh(3)81
 b Fi(Compare)43 b(the)i(input)d(template)i(string)f(against)h(the)h
 (reference)f(string)f(to)i(see)g(if)e(they)h(matc)m(h.)82
-b(The)227 3931 y(template)35 b(string)f(ma)m(y)h(con)m(tain)f(wildcard)
+b(The)227 2191 y(template)35 b(string)f(ma)m(y)h(con)m(tain)f(wildcard)
 e(c)m(haracters:)51 b('*')35 b(will)d(matc)m(h)j(an)m(y)g(sequence)g
-(of)f(c)m(haracters)227 4044 y(\(including)f(zero)j(c)m(haracters\))h
+(of)f(c)m(haracters)227 2304 y(\(including)f(zero)j(c)m(haracters\))h
 (and)e('reference)h(string.)55 b(If)35 b(CASESN)f(=)h(.true.)56
-b(then)35 b(the)g(matc)m(h)i(will)227 4157 y(b)s(e)29
+b(then)35 b(the)g(matc)m(h)i(will)227 2417 y(b)s(e)29
 b(case)h(sensitiv)m(e.)40 b(The)29 b(returned)f(MA)-8
 b(TCH)30 b(parameter)g(will)d(b)s(e)h(.true.)41 b(if)28
-b(the)i(2)g(strings)e(matc)m(h,)j(and)227 4270 y(EXA)m(CT)i(will)e(b)s
+b(the)i(2)g(strings)e(matc)m(h,)j(and)227 2530 y(EXA)m(CT)i(will)e(b)s
 (e)h(.true.)49 b(if)32 b(the)i(matc)m(h)g(is)e(exact)i(\(i.e.,)h(if)d
 (no)h(wildcard)e(c)m(haracters)j(w)m(ere)g(used)e(in)g(the)227
-4383 y(matc)m(h\).)42 b(Both)31 b(strings)e(m)m(ust)i(b)s(e)e(68)j(c)m
-(haracters)f(or)g(less)f(in)f(length.)382 4647 y Fe
+2643 y(matc)m(h\).)42 b(Both)31 b(strings)e(m)m(ust)i(b)s(e)e(68)j(c)m
+(haracters)f(or)g(less)f(in)f(length.)382 2898 y Fe
 (FTCMPS\(str_template,stri)o(ng,)o(case)o(sen,)41 b(>)47
-b(match,exact\))0 4910 y Fh(4)81 b Fi(T)-8 b(est)31 b(that)g(the)f(k)m
+b(match,exact\))0 3152 y Fh(4)81 b Fi(T)-8 b(est)31 b(that)g(the)f(k)m
 (eyw)m(ord)h(name)f(con)m(tains)h(only)e(legal)i(c)m(haracters:)42
-b(A-Z,0-9,)32 b(h)m(yphen,)d(and)h(underscore.)382 5174
-y Fe(FTTKEY\(keyword,)43 b(>)48 b(status\))0 5438 y Fh(5)81
+b(A-Z,0-9,)32 b(h)m(yphen,)d(and)h(underscore.)382 3407
+y Fe(FTTKEY\(keyword,)43 b(>)48 b(status\))0 3662 y Fh(5)81
 b Fi(T)-8 b(est)31 b(that)g(the)f(k)m(eyw)m(ord)h(record)f(con)m(tains)
 h(only)e(legal)h(prin)m(table)f(ASCI)s(I)g(c)m(haracters)382
-5701 y Fe(FTTREC\(card,)44 b(>)k(status\))p eop
-%%Page: 93 99
-93 98 bop 0 299 a Fg(8.12.)73 b(GENERAL)30 b(UTILITY)g(SUBR)m(OUTINES)
-1979 b Fi(93)0 555 y Fh(6)81 b Fi(T)-8 b(est)25 b(whether)f(the)h
-(curren)m(t)f(header)h(con)m(tains)f(an)m(y)h(NULL)g(\(ASCI)s(I)e(0\))j
-(c)m(haracters.)40 b(These)24 b(c)m(haracters)j(are)227
-668 y(illegal)33 b(in)g(the)i(header,)g(but)f(they)g(will)e(go)j
-(undetected)g(b)m(y)f(most)h(of)g(the)f(CFITSIO)f(k)m(eyw)m(ord)i
-(header)227 781 y(routines,)28 b(b)s(ecause)g(the)h(n)m(ull)d(is)h(in)m
-(terpreted)g(as)i(the)f(normal)f(end-of-string)h(terminator.)40
-b(This)26 b(routine)227 894 y(returns)i(the)g(p)s(osition)f(of)i(the)g
+3916 y Fe(FTTREC\(card,)44 b(>)k(status\))0 4171 y Fh(6)81
+b Fi(T)-8 b(est)25 b(whether)f(the)h(curren)m(t)f(header)h(con)m(tains)
+f(an)m(y)h(NULL)g(\(ASCI)s(I)e(0\))j(c)m(haracters.)40
+b(These)24 b(c)m(haracters)j(are)227 4284 y(illegal)33
+b(in)g(the)i(header,)g(but)f(they)g(will)e(go)j(undetected)g(b)m(y)f
+(most)h(of)g(the)f(CFITSIO)f(k)m(eyw)m(ord)i(header)227
+4397 y(routines,)28 b(b)s(ecause)g(the)h(n)m(ull)d(is)h(in)m(terpreted)
+g(as)i(the)f(normal)f(end-of-string)h(terminator.)40
+b(This)26 b(routine)227 4509 y(returns)i(the)g(p)s(osition)f(of)i(the)g
 (\014rst)f(n)m(ull)e(c)m(haracter)k(in)e(the)g(header,)h(or)g(zero)g
 (if)f(there)h(are)g(no)f(n)m(ulls.)38 b(F)-8 b(or)227
-1007 y(example)36 b(a)g(returned)f(v)-5 b(alue)36 b(of)g(110)h(w)m
+4622 y(example)36 b(a)g(returned)f(v)-5 b(alue)36 b(of)g(110)h(w)m
 (ould)e(indicate)g(that)i(the)f(\014rst)f(NULL)h(is)f(lo)s(cated)h(in)f
-(the)h(30th)227 1120 y(c)m(haracter)28 b(of)f(the)g(second)f(k)m(eyw)m
+(the)h(30th)227 4735 y(c)m(haracter)28 b(of)f(the)g(second)f(k)m(eyw)m
 (ord)h(in)e(the)i(header)f(\(recall)g(that)h(eac)m(h)h(header)e(record)
-h(is)e(80)i(c)m(haracters)227 1233 y(long\).)55 b(Note)36
+h(is)e(80)i(c)m(haracters)227 4848 y(long\).)55 b(Note)36
 b(that)g(this)e(is)g(one)h(of)g(the)g(few)g(FITSIO)f(routines)g(in)f
 (whic)m(h)h(the)h(returned)f(v)-5 b(alue)35 b(is)f(not)227
-1346 y(necessarily)c(equal)f(to)j(the)e(status)h(v)-5
-b(alue\).)382 1616 y Fe(FTNCHK\(unit,)44 b(>)k(status\))0
-1885 y Fh(7)81 b Fi(P)m(arse)27 b(a)f(header)h(k)m(eyw)m(ord)g(record)f
+4961 y(necessarily)c(equal)f(to)j(the)e(status)h(v)-5
+b(alue\).)382 5216 y Fe(FTNCHK\(unit,)44 b(>)k(status\))0
+5470 y Fh(7)81 b Fi(P)m(arse)27 b(a)f(header)h(k)m(eyw)m(ord)g(record)f
 (and)g(return)f(the)i(name)f(of)h(the)f(k)m(eyw)m(ord)h(and)f(the)h
-(length)e(of)i(the)g(name.)227 1998 y(The)34 b(k)m(eyw)m(ord)h(name)f
+(length)e(of)i(the)g(name.)227 5583 y(The)34 b(k)m(eyw)m(ord)h(name)f
 (normally)f(o)s(ccupies)g(the)i(\014rst)e(8)i(c)m(haracters)g(of)g(the)
-f(record,)i(except)f(under)e(the)227 2111 y(HIERAR)m(CH)e(con)m(v)m(en)
+f(record,)i(except)f(under)e(the)227 5696 y(HIERAR)m(CH)e(con)m(v)m(en)
 m(tion)g(where)f(the)h(name)f(can)h(b)s(e)f(up)f(to)i(70)g(c)m
-(haracters)h(in)d(length.)382 2381 y Fe(FTGKNM\(card,)44
-b(>)k(keyname,)d(keylength,)g(status\))0 2651 y Fh(8)81
+(haracters)h(in)d(length.)p eop
+%%Page: 103 109
+103 108 bop 0 299 a Fg(9.12.)73 b(GENERAL)30 b(UTILITY)g(SUBR)m
+(OUTINES)1934 b Fi(103)382 555 y Fe(FTGKNM\(card,)44
+b(>)k(keyname,)d(keylength,)g(status\))0 811 y Fh(8)81
 b Fi(P)m(arse)34 b(a)h(header)f(k)m(eyw)m(ord)h(record.)52
 b(This)32 b(subroutine)g(parses)i(the)g(input)f(header)h(record)g(to)h
-(return)e(the)227 2764 y(v)-5 b(alue)26 b(\(as)h(a)g(c)m(haracter)g
+(return)e(the)227 924 y(v)-5 b(alue)26 b(\(as)h(a)g(c)m(haracter)g
 (string\))f(and)g(commen)m(t)h(strings.)38 b(If)26 b(the)g(k)m(eyw)m
 (ord)h(has)f(no)g(v)-5 b(alue)26 b(\(columns)f(9-10)227
-2877 y(not)i(equal)e(to)i('=)f('\),)i(then)e(the)g(v)-5
+1037 y(not)i(equal)e(to)i('=)f('\),)i(then)e(the)g(v)-5
 b(alue)26 b(string)f(is)g(returned)g(blank)g(and)g(the)h(commen)m(t)i
-(string)d(is)g(set)h(equal)227 2990 y(to)31 b(column)f(9)g(-)h(80)g(of)
-g(the)f(input)f(string.)382 3260 y Fe(FTPSVC\(card,)44
-b(>)k(value,comment,status\))0 3530 y Fh(9)81 b Fi(Construct)35
+(string)d(is)g(set)h(equal)227 1150 y(to)31 b(column)f(9)g(-)h(80)g(of)
+g(the)f(input)f(string.)382 1406 y Fe(FTPSVC\(card,)44
+b(>)k(value,comment,status\))0 1662 y Fh(9)81 b Fi(Construct)35
 b(a)i(sequence)f(k)m(eyw)m(ord)h(name)f(\(R)m(OOT)g(+)g(nnn\).)57
 b(This)34 b(subroutine)g(app)s(ends)g(the)j(sequence)227
-3643 y(n)m(um)m(b)s(er)29 b(to)i(the)g(ro)s(ot)g(string)e(to)i(create)h
+1775 y(n)m(um)m(b)s(er)29 b(to)i(the)g(ro)s(ot)g(string)e(to)i(create)h
 (a)f(k)m(eyw)m(ord)g(name)f(\(e.g.,)i('NAXIS')f(+)f(2)h(=)f('NAXIS2'\))
-382 3913 y Fe(FTKEYN\(keyroot,seq_no,)42 b(>)47 b(keyword,status\))0
-4182 y Fh(10)f Fi(Construct)30 b(a)g(sequence)g(k)m(eyw)m(ord)h(name)f
+382 2032 y Fe(FTKEYN\(keyroot,seq_no,)42 b(>)47 b(keyword,status\))0
+2288 y Fh(10)f Fi(Construct)30 b(a)g(sequence)g(k)m(eyw)m(ord)h(name)f
 (\(n)f(+)h(R)m(OOT\).)g(This)e(subroutine)g(concatenates)k(the)f
-(sequence)227 4295 y(n)m(um)m(b)s(er)20 b(to)j(the)e(fron)m(t)h(of)g
+(sequence)227 2401 y(n)m(um)m(b)s(er)20 b(to)j(the)e(fron)m(t)h(of)g
 (the)f(ro)s(ot)h(string)f(to)h(create)h(a)f(k)m(eyw)m(ord)g(name)g
-(\(e.g.,)j(1)d(+)f('CTYP')g(=)g('1CTYP'\))382 4565 y
+(\(e.g.,)j(1)d(+)f('CTYP')g(=)g('1CTYP'\))382 2657 y
 Fe(FTNKEY\(seq_no,keyroot,)42 b(>)47 b(keyword,status\))0
-4835 y Fh(11)f Fi(Determine)34 b(the)g(datat)m(yp)s(e)g(of)g(a)g(k)m
+2913 y Fh(11)f Fi(Determine)34 b(the)g(datat)m(yp)s(e)g(of)g(a)g(k)m
 (eyw)m(ord)h(v)-5 b(alue)33 b(string.)49 b(This)32 b(subroutine)g
-(parses)h(the)h(k)m(eyw)m(ord)g(v)-5 b(alue)227 4948
+(parses)h(the)h(k)m(eyw)m(ord)g(v)-5 b(alue)227 3026
 y(string)30 b(\(usually)e(columns)h(11-30)k(of)d(the)h(header)f
 (record\))g(to)i(determine)d(its)h(datat)m(yp)s(e.)382
-5218 y Fe(FTDTYP\(value,)44 b(>)j(dtype,status\))0 5488
+3282 y Fe(FTDTYP\(value,)44 b(>)j(dtype,status\))0 3538
 y Fh(11)f Fi(Return)c(the)i(class)f(of)g(input)e(header)i(record.)79
 b(The)43 b(record)g(is)f(classi\014ed)f(in)m(to)i(one)h(of)f(the)g
-(follo)m(wing)227 5601 y(catagories)35 b(\(the)e(class)g(v)-5
-b(alues)32 b(are)h(de\014ned)e(in)h(\014tsio.h\).)47
-b(Note)35 b(that)e(this)f(is)g(one)h(of)g(the)g(few)f(FITSIO)227
-5714 y(routines)e(that)g(do)s(es)h(not)f(return)f(a)i(status)g(v)-5
-b(alue.)p eop
-%%Page: 94 100
-94 99 bop 0 299 a Fi(94)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)334
-555 y Fe(Class)94 b(Value)619 b(Keywords)95 668 y(TYP_STRUC_KEY)92
-b(10)j(SIMPLE,)46 b(BITPIX,)g(NAXIS,)g(NAXISn,)g(EXTEND,)g(BLOCKED,)
-1002 781 y(GROUPS,)g(PCOUNT,)g(GCOUNT,)g(END)1002 894
-y(XTENSION,)g(TFIELDS,)f(TTYPEn,)h(TBCOLn,)g(TFORMn,)g(THEAP,)1002
-1007 y(and)h(the)g(first)f(4)i(COMMENT)e(keywords)f(in)i(the)g(primary)
-f(array)1002 1120 y(that)h(define)f(the)h(FITS)g(format.)95
-1233 y(TYP_CMPRS_KEY)92 b(20)j(The)47 b(experimental)e(keywords)g(used)
-i(in)g(the)g(compressed)1002 1346 y(image)g(format)f(ZIMAGE,)g
-(ZCMPTYPE,)f(ZNAMEn,)h(ZVALn,)1002 1458 y(ZTILEn,)g(ZBITPIX,)g
-(ZNAXISn,)f(ZSCALE,)h(ZZERO,)g(ZBLANK)95 1571 y(TYP_SCAL_KEY)140
-b(30)95 b(BSCALE,)46 b(BZERO,)g(TSCALn,)g(TZEROn)95 1684
-y(TYP_NULL_KEY)140 b(40)95 b(BLANK,)46 b(TNULLn)95 1797
-y(TYP_DIM_KEY)188 b(50)95 b(TDIMn)95 1910 y(TYP_RANG_KEY)140
+(follo)m(wing)227 3651 y(categories)35 b(\(the)f(class)e(v)-5
+b(alues)33 b(are)g(de\014ned)f(in)g(\014tsio.h\).)48
+b(Note)35 b(that)e(this)f(is)g(one)i(of)f(the)g(few)g(FITSIO)227
+3764 y(routines)d(that)g(do)s(es)h(not)f(return)f(a)i(status)g(v)-5
+b(alue.)334 4020 y Fe(Class)94 b(Value)619 b(Keywords)95
+4133 y(TYP_STRUC_KEY)92 b(10)j(SIMPLE,)46 b(BITPIX,)g(NAXIS,)g(NAXISn,)
+g(EXTEND,)g(BLOCKED,)1002 4246 y(GROUPS,)g(PCOUNT,)g(GCOUNT,)g(END)1002
+4359 y(XTENSION,)g(TFIELDS,)f(TTYPEn,)h(TBCOLn,)g(TFORMn,)g(THEAP,)1002
+4472 y(and)h(the)g(first)f(4)i(COMMENT)e(keywords)f(in)i(the)g(primary)
+f(array)1002 4585 y(that)h(define)f(the)h(FITS)g(format.)95
+4698 y(TYP_CMPRS_KEY)92 b(20)j(The)47 b(experimental)e(keywords)g(used)
+i(in)g(the)g(compressed)1002 4811 y(image)g(format)f(ZIMAGE,)g
+(ZCMPTYPE,)f(ZNAMEn,)h(ZVALn,)1002 4924 y(ZTILEn,)g(ZBITPIX,)g
+(ZNAXISn,)f(ZSCALE,)h(ZZERO,)g(ZBLANK)95 5036 y(TYP_SCAL_KEY)140
+b(30)95 b(BSCALE,)46 b(BZERO,)g(TSCALn,)g(TZEROn)95 5149
+y(TYP_NULL_KEY)140 b(40)95 b(BLANK,)46 b(TNULLn)95 5262
+y(TYP_DIM_KEY)188 b(50)95 b(TDIMn)95 5375 y(TYP_RANG_KEY)140
 b(60)95 b(TLMINn,)46 b(TLMAXn,)g(TDMINn,)g(TDMAXn,)g(DATAMIN,)f
-(DATAMAX)95 2023 y(TYP_UNIT_KEY)140 b(70)95 b(BUNIT,)46
-b(TUNITn)95 2136 y(TYP_DISP_KEY)140 b(80)95 b(TDISPn)95
-2249 y(TYP_HDUID_KEY)d(90)j(EXTNAME,)46 b(EXTVER,)g(EXTLEVEL,)f
-(HDUNAME,)g(HDUVER,)h(HDULEVEL)95 2362 y(TYP_CKSUM_KEY)f(100)94
-b(CHECKSUM,)46 b(DATASUM)95 2475 y(TYP_WCS_KEY)141 b(110)94
-b(CTYPEn,)46 b(CUNITn,)g(CRVALn,)g(CRPIXn,)g(CROTAn,)f(CDELTn)1002
-2588 y(CDj_is,)h(PVj_ms,)g(LONPOLEs,)f(LATPOLEs)1002
-2700 y(TCTYPn,)h(TCTYns,)g(TCUNIn,)g(TCUNns,)g(TCRVLn,)f(TCRVns,)h
-(TCRPXn,)1002 2813 y(TCRPks,)g(TCDn_k,)g(TCn_ks,)g(TPVn_m,)g(TPn_ms,)f
-(TCDLTn,)h(TCROTn)1002 2926 y(jCTYPn,)g(jCTYns,)g(jCUNIn,)g(jCUNns,)g
-(jCRVLn,)f(jCRVns,)h(iCRPXn,)1002 3039 y(iCRPns,)g(jiCDn,)94
+(DATAMAX)95 5488 y(TYP_UNIT_KEY)140 b(70)95 b(BUNIT,)46
+b(TUNITn)95 5601 y(TYP_DISP_KEY)140 b(80)95 b(TDISPn)95
+5714 y(TYP_HDUID_KEY)d(90)j(EXTNAME,)46 b(EXTVER,)g(EXTLEVEL,)f
+(HDUNAME,)g(HDUVER,)h(HDULEVEL)p eop
+%%Page: 104 110
+104 109 bop 0 299 a Fi(104)1274 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)95
+555 y Fe(TYP_CKSUM_KEY)45 b(100)94 b(CHECKSUM,)46 b(DATASUM)95
+668 y(TYP_WCS_KEY)141 b(110)94 b(CTYPEn,)46 b(CUNITn,)g(CRVALn,)g
+(CRPIXn,)g(CROTAn,)f(CDELTn)1002 781 y(CDj_is,)h(PVj_ms,)g(LONPOLEs,)f
+(LATPOLEs)1002 894 y(TCTYPn,)h(TCTYns,)g(TCUNIn,)g(TCUNns,)g(TCRVLn,)f
+(TCRVns,)h(TCRPXn,)1002 1007 y(TCRPks,)g(TCDn_k,)g(TCn_ks,)g(TPVn_m,)g
+(TPn_ms,)f(TCDLTn,)h(TCROTn)1002 1120 y(jCTYPn,)g(jCTYns,)g(jCUNIn,)g
+(jCUNns,)g(jCRVLn,)f(jCRVns,)h(iCRPXn,)1002 1233 y(iCRPns,)g(jiCDn,)94
 b(jiCDns,)46 b(jPVn_m,)g(jPn_ms,)f(jCDLTn,)h(jCROTn)1002
-3152 y(\(i,j,m,n)g(are)h(integers,)e(s)i(is)h(any)f(letter\))95
-3265 y(TYP_REFSYS_KEY)d(120)j(EQUINOXs,)f(EPOCH,)g(MJD-OBSs,)f
-(RADECSYS,)g(RADESYSs)95 3378 y(TYP_COMM_KEY)140 b(130)47
-b(COMMENT,)f(HISTORY,)f(\(blank)h(keyword\))95 3491 y(TYP_CONT_KEY)140
-b(140)47 b(CONTINUE)95 3604 y(TYP_USER_KEY)140 b(150)47
-b(all)g(other)g(keywords)430 3830 y(class)f(=)h(FTGKCL)f(\(char)h
-(*card\))0 4094 y Fh(12)f Fi(P)m(arse)f(the)g('TF)m(ORM')h(binary)d
+1346 y(\(i,j,m,n)g(are)h(integers,)e(s)i(is)h(any)f(letter\))95
+1458 y(TYP_REFSYS_KEY)d(120)j(EQUINOXs,)f(EPOCH,)g(MJD-OBSs,)f
+(RADECSYS,)g(RADESYSs)95 1571 y(TYP_COMM_KEY)140 b(130)47
+b(COMMENT,)f(HISTORY,)f(\(blank)h(keyword\))95 1684 y(TYP_CONT_KEY)140
+b(140)47 b(CONTINUE)95 1797 y(TYP_USER_KEY)140 b(150)47
+b(all)g(other)g(keywords)430 2023 y(class)f(=)h(FTGKCL)f(\(char)h
+(*card\))0 2275 y Fh(12)f Fi(P)m(arse)f(the)g('TF)m(ORM')h(binary)d
 (table)i(column)e(format)i(string.)83 b(This)43 b(subroutine)g(parses)h
-(the)h(input)227 4207 y(TF)m(ORM)27 b(c)m(haracter)g(string)e(and)h
+(the)h(input)227 2388 y(TF)m(ORM)27 b(c)m(haracter)g(string)e(and)h
 (returns)f(the)h(in)m(teger)g(datat)m(yp)s(e)h(co)s(de,)h(the)e(rep)s
-(eat)g(coun)m(t)h(of)f(the)g(\014eld,)227 4320 y(and,)f(in)d(the)i
+(eat)g(coun)m(t)h(of)f(the)g(\014eld,)227 2501 y(and,)f(in)d(the)i
 (case)g(of)g(c)m(haracter)h(string)d(\014elds,)i(the)f(length)g(of)h
 (the)g(unit)e(string.)37 b(The)23 b(follo)m(wing)f(datat)m(yp)s(e)227
-4433 y(co)s(des)h(are)h(returned)e(\(the)h(negativ)m(e)h(of)g(the)f(v)
+2613 y(co)s(des)h(are)h(returned)e(\(the)h(negativ)m(e)h(of)g(the)f(v)
 -5 b(alue)22 b(is)g(returned)g(if)g(the)h(column)f(con)m(tains)h(v)-5
-b(ariable-length)227 4546 y(arra)m(ys\):)764 4811 y Fe(Datatype)761
-b(DATACODE)46 b(value)764 4924 y(bit,)g(X)907 b(1)764
-5036 y(byte,)46 b(B)811 b(11)764 5149 y(logical,)45 b(L)668
-b(14)764 5262 y(ASCII)46 b(character,)f(A)286 b(16)764
-5375 y(short)46 b(integer,)g(I)381 b(21)764 5488 y(integer,)45
-b(J)668 b(41)764 5601 y(real,)46 b(E)811 b(42)764 5714
-y(double)46 b(precision,)f(D)238 b(82)p eop
-%%Page: 95 101
-95 100 bop 0 299 a Fg(8.12.)73 b(GENERAL)30 b(UTILITY)g(SUBR)m(OUTINES)
-1979 b Fi(95)764 555 y Fe(complex)809 b(83)764 668 y(double)46
-b(complex)475 b(163)382 894 y(FTBNFM\(tform,)44 b(>)j
-(datacode,repeat,width,stat)o(us\))0 1141 y Fh(13)f Fi(P)m(arse)38
-b(the)f('TF)m(ORM')h(k)m(eyw)m(ord)g(v)-5 b(alue)36 b(that)i(de\014nes)
-e(the)h(column)f(format)i(in)d(an)i(ASCI)s(I)f(table.)61
-b(This)227 1254 y(routine)30 b(parses)h(the)g(input)f(TF)m(ORM)h(c)m
-(haracter)i(string)d(and)g(returns)g(the)i(datat)m(yp)s(e)g(co)s(de,)f
-(the)h(width)227 1367 y(of)40 b(the)h(column,)g(and)f(\(if)f(it)g(is)h
-(a)g(\015oating)g(p)s(oin)m(t)f(column\))g(the)h(n)m(um)m(b)s(er)f(of)h
-(decimal)f(places)h(to)h(the)227 1480 y(righ)m(t)27 b(of)h(the)f
-(decimal)f(p)s(oin)m(t.)39 b(The)27 b(returned)f(datat)m(yp)s(e)i(co)s
-(des)f(are)h(the)g(same)f(as)h(for)f(the)g(binary)f(table,)227
-1593 y(listed)39 b(ab)s(o)m(v)m(e,)44 b(with)39 b(the)h(follo)m(wing)f
-(additional)f(rules:)59 b(in)m(teger)41 b(columns)e(that)h(are)h(b)s
-(et)m(w)m(een)g(1)g(and)227 1706 y(4)36 b(c)m(haracters)i(wide)c(are)j
-(de\014ned)d(to)j(b)s(e)e(short)h(in)m(tegers)g(\(co)s(de)g(=)g(21\).)
-58 b(Wider)35 b(in)m(teger)h(columns)f(are)227 1819 y(de\014ned)k(to)i
-(b)s(e)e(regular)g(in)m(tegers)i(\(co)s(de)f(=)g(41\).)71
+b(ariable-length)227 2726 y(arra)m(ys\):)764 2978 y Fe(Datatype)761
+b(DATACODE)46 b(value)764 3091 y(bit,)g(X)907 b(1)764
+3204 y(byte,)46 b(B)811 b(11)764 3317 y(logical,)45 b(L)668
+b(14)764 3430 y(ASCII)46 b(character,)f(A)286 b(16)764
+3543 y(short)46 b(integer,)g(I)381 b(21)764 3656 y(integer,)45
+b(J)668 b(41)764 3768 y(real,)46 b(E)811 b(42)764 3881
+y(double)46 b(precision,)f(D)238 b(82)764 3994 y(complex)809
+b(83)764 4107 y(double)46 b(complex)475 b(163)382 4333
+y(FTBNFM\(tform,)44 b(>)j(datacode,repeat,width,stat)o(us\))0
+4585 y Fh(13)f Fi(P)m(arse)38 b(the)f('TF)m(ORM')h(k)m(eyw)m(ord)g(v)-5
+b(alue)36 b(that)i(de\014nes)e(the)h(column)f(format)i(in)d(an)i(ASCI)s
+(I)f(table.)61 b(This)227 4698 y(routine)30 b(parses)h(the)g(input)f
+(TF)m(ORM)h(c)m(haracter)i(string)d(and)g(returns)g(the)i(datat)m(yp)s
+(e)g(co)s(de,)f(the)h(width)227 4811 y(of)40 b(the)h(column,)g(and)f
+(\(if)f(it)g(is)h(a)g(\015oating)g(p)s(oin)m(t)f(column\))g(the)h(n)m
+(um)m(b)s(er)f(of)h(decimal)f(places)h(to)h(the)227 4924
+y(righ)m(t)27 b(of)h(the)f(decimal)f(p)s(oin)m(t.)39
+b(The)27 b(returned)f(datat)m(yp)s(e)i(co)s(des)f(are)h(the)g(same)f
+(as)h(for)f(the)g(binary)f(table,)227 5036 y(listed)39
+b(ab)s(o)m(v)m(e,)44 b(with)39 b(the)h(follo)m(wing)f(additional)f
+(rules:)59 b(in)m(teger)41 b(columns)e(that)h(are)h(b)s(et)m(w)m(een)g
+(1)g(and)227 5149 y(4)36 b(c)m(haracters)i(wide)c(are)j(de\014ned)d(to)
+j(b)s(e)e(short)h(in)m(tegers)g(\(co)s(de)g(=)g(21\).)58
+b(Wider)35 b(in)m(teger)h(columns)f(are)227 5262 y(de\014ned)k(to)i(b)s
+(e)e(regular)g(in)m(tegers)i(\(co)s(de)f(=)g(41\).)71
 b(Similarly)-8 b(,)39 b(Fixed)g(decimal)g(p)s(oin)m(t)g(columns)g
-(\(with)227 1932 y(TF)m(ORM)30 b(=)g('Fw.d'\))g(are)g(de\014ned)f(to)h
+(\(with)227 5375 y(TF)m(ORM)30 b(=)g('Fw.d'\))g(are)g(de\014ned)f(to)h
 (b)s(e)g(single)e(precision)g(reals)h(\(co)s(de)i(=)e(42\))i(if)e(w)g
-(is)g(b)s(et)m(w)m(een)h(1)h(and)227 2045 y(7)i(c)m(haracters)h(wide,)e
+(is)g(b)s(et)m(w)m(een)h(1)h(and)227 5488 y(7)i(c)m(haracters)h(wide,)e
 (inclusiv)m(e.)44 b(Wider)31 b('F')i(columns)e(will)f(return)h(a)i
-(double)e(precision)f(data)j(co)s(de)g(\(=)227 2158 y(82\).)54
+(double)e(precision)f(data)j(co)s(de)g(\(=)227 5601 y(82\).)54
 b('Ew.d')34 b(format)g(columns)f(will)f(ha)m(v)m(e)j(dataco)s(de)g(=)f
 (42,)j(and)c('Dw.d')i(format)f(columns)f(will)f(ha)m(v)m(e)227
-2270 y(dataco)s(de)g(=)e(82.)382 2518 y Fe(FTASFM\(tform,)44
-b(>)j(datacode,width,decimals,st)o(atus)o(\))0 2765 y
+5714 y(dataco)s(de)g(=)e(82.)p eop
+%%Page: 105 111
+105 110 bop 0 299 a Fg(9.12.)73 b(GENERAL)30 b(UTILITY)g(SUBR)m
+(OUTINES)1934 b Fi(105)382 555 y Fe(FTASFM\(tform,)44
+b(>)j(datacode,width,decimals,st)o(atus)o(\))0 825 y
 Fh(14)f Fi(Calculate)30 b(the)h(starting)f(column)g(p)s(ositions)e(and)
 i(total)h(ASCI)s(I)e(table)i(width)d(based)j(on)f(the)h(input)d(arra)m
-(y)227 2878 y(of)f(ASCI)s(I)e(table)h(TF)m(ORM)h(v)-5
+(y)227 938 y(of)f(ASCI)s(I)e(table)h(TF)m(ORM)h(v)-5
 b(alues.)39 b(The)26 b(SP)-8 b(A)m(CE)27 b(input)d(parameter)j
-(de\014nes)f(ho)m(w)h(man)m(y)f(blank)g(spaces)227 2991
+(de\014nes)f(ho)m(w)h(man)m(y)f(blank)g(spaces)227 1051
 y(to)40 b(lea)m(v)m(e)h(b)s(et)m(w)m(een)f(eac)m(h)g(column)f(\(it)g
 (is)f(recommended)h(to)h(ha)m(v)m(e)h(one)e(space)h(b)s(et)m(w)m(een)g
-(columns)e(for)227 3104 y(b)s(etter)31 b(h)m(uman)e(readabilit)m(y\).)
-382 3352 y Fe(FTGABC\(tfields,tform,spa)o(ce,)41 b(>)48
-b(rowlen,tbcol,status\))0 3599 y Fh(15)e Fi(P)m(arse)36
+(columns)e(for)227 1164 y(b)s(etter)31 b(h)m(uman)e(readabilit)m(y\).)
+382 1434 y Fe(FTGABC\(tfields,tform,spa)o(ce,)41 b(>)48
+b(rowlen,tbcol,status\))0 1704 y Fh(15)e Fi(P)m(arse)36
 b(a)f(template)g(string)f(and)h(return)f(a)h(formatted)h(80-c)m
 (haracter)h(string)d(suitable)g(for)h(app)s(ending)d(to)227
-3712 y(\(or)40 b(deleting)f(from\))g(a)h(FITS)f(header)h(\014le.)67
+1817 y(\(or)40 b(deleting)f(from\))g(a)h(FITS)f(header)h(\014le.)67
 b(This)38 b(subroutine)f(is)i(useful)f(for)h(parsing)f(lines)g(from)h
-(an)227 3825 y(ASCI)s(I)34 b(template)i(\014le)f(and)f(reformatting)i
+(an)227 1930 y(ASCI)s(I)34 b(template)i(\014le)f(and)f(reformatting)i
 (them)f(in)m(to)h(legal)f(FITS)f(header)i(records.)55
-b(The)35 b(formatted)227 3938 y(string)30 b(ma)m(y)h(then)f(b)s(e)g
+b(The)35 b(formatted)227 2043 y(string)30 b(ma)m(y)h(then)f(b)s(e)g
 (passed)g(to)i(the)e(FTPREC,)h(FTMCRD,)g(or)f(FTDKEY)h(subroutines)d
-(to)k(app)s(end)227 4051 y(or)f(mo)s(dify)d(a)j(FITS)f(header)g
-(record.)382 4298 y Fe(FTGTHD\(template,)43 b(>)48 b
-(card,hdtype,status\))0 4545 y Fi(The)23 b(input)g(TEMPLA)-8
+(to)k(app)s(end)227 2156 y(or)f(mo)s(dify)d(a)j(FITS)f(header)g
+(record.)382 2426 y Fe(FTGTHD\(template,)43 b(>)48 b
+(card,hdtype,status\))0 2696 y Fi(The)23 b(input)g(TEMPLA)-8
 b(TE)23 b(c)m(haracter)j(string)d(generally)g(should)f(con)m(tain)i(3)h
 (tok)m(ens:)38 b(\(1\))25 b(the)f(KEYNAME,)h(\(2\))0
-4658 y(the)h(V)-10 b(ALUE,)26 b(and)f(\(3\))i(the)f(COMMENT)g(string.)
+2809 y(the)h(V)-10 b(ALUE,)26 b(and)f(\(3\))i(the)f(COMMENT)g(string.)
 38 b(The)25 b(TEMPLA)-8 b(TE)26 b(string)f(m)m(ust)g(adhere)h(to)g(the)
-g(follo)m(wing)0 4771 y(format:)0 5019 y Fh(-)80 b Fi(The)24
+g(follo)m(wing)0 2922 y(format:)0 3192 y Fh(-)80 b Fi(The)24
 b(KEYNAME)g(tok)m(en)h(m)m(ust)e(b)s(egin)g(in)f(columns)h(1-8)i(and)e
 (b)s(e)h(a)g(maxim)m(um)f(of)h(8)g(c)m(haracters)h(long.)38
-b(If)24 b(the)227 5132 y(\014rst)32 b(8)h(c)m(haracters)h(of)e(the)h
+b(If)24 b(the)227 3305 y(\014rst)32 b(8)h(c)m(haracters)h(of)e(the)h
 (template)g(line)d(are)j(blank)e(then)h(the)h(remainder)e(of)h(the)h
-(line)e(is)g(considered)227 5245 y(to)42 b(b)s(e)e(a)h(FITS)f(commen)m
+(line)e(is)g(considered)227 3418 y(to)42 b(b)s(e)e(a)h(FITS)f(commen)m
 (t)h(\(with)f(a)h(blank)e(k)m(eyw)m(ord)i(name\).)72
 b(A)41 b(legal)g(FITS)f(k)m(eyw)m(ord)h(name)f(ma)m(y)227
-5357 y(only)34 b(con)m(tain)i(the)f(c)m(haracters)h(A-Z,)f(0-9,)j(and)c
+3531 y(only)34 b(con)m(tain)i(the)f(c)m(haracters)h(A-Z,)f(0-9,)j(and)c
 ('-')i(\(min)m(us)e(sign\))g(and)g(underscore.)54 b(This)33
-b(subroutine)227 5470 y(will)39 b(automatically)i(con)m(v)m(ert)i(an)m
+b(subroutine)227 3644 y(will)39 b(automatically)i(con)m(v)m(ert)i(an)m
 (y)f(lo)m(w)m(ercase)h(c)m(haracters)f(to)h(upp)s(ercase)d(in)g(the)i
-(output)f(string.)72 b(If)227 5583 y(KEYNAME)33 b(=)f('COMMENT')h(or)g
+(output)f(string.)72 b(If)227 3757 y(KEYNAME)33 b(=)f('COMMENT')h(or)g
 ('HISTOR)-8 b(Y')32 b(then)h(the)f(remainder)f(of)i(the)g(line)e(is)h
-(considered)f(to)227 5696 y(b)s(e)f(a)h(FITS)e(COMMENT)h(or)h(HISTOR)-8
-b(Y)30 b(record,)g(resp)s(ectiv)m(ely)-8 b(.)p eop
-%%Page: 96 102
-96 101 bop 0 299 a Fi(96)1319 b Fg(CHAPTER)29 b(8.)112
-b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
-555 y Fh(-)80 b Fi(The)26 b(V)-10 b(ALUE)26 b(tok)m(en)h(m)m(ust)e(b)s
-(e)h(separated)g(from)f(the)i(KEYNAME)f(tok)m(en)h(b)m(y)f(one)g(or)g
-(more)g(spaces)g(and/or)227 668 y(an)i('=')g(c)m(haracter.)41
+(considered)f(to)227 3870 y(b)s(e)f(a)h(FITS)e(COMMENT)h(or)h(HISTOR)-8
+b(Y)30 b(record,)g(resp)s(ectiv)m(ely)-8 b(.)0 4140 y
+Fh(-)80 b Fi(The)26 b(V)-10 b(ALUE)26 b(tok)m(en)h(m)m(ust)e(b)s(e)h
+(separated)g(from)f(the)i(KEYNAME)f(tok)m(en)h(b)m(y)f(one)g(or)g(more)
+g(spaces)g(and/or)227 4253 y(an)i('=')g(c)m(haracter.)41
 b(The)27 b(datat)m(yp)s(e)i(of)f(the)g(V)-10 b(ALUE)27
 b(tok)m(en)i(\(n)m(umeric,)f(logical,)g(or)g(c)m(haracter)h(string\))e
-(is)227 781 y(automatically)32 b(determined)e(and)i(the)g(output)f
+(is)227 4366 y(automatically)32 b(determined)e(and)i(the)g(output)f
 (CARD)h(string)f(is)g(formatted)h(accordingly)-8 b(.)45
-b(The)31 b(v)-5 b(alue)227 894 y(tok)m(en)34 b(ma)m(y)f(b)s(e)f(forced)
-g(to)i(b)s(e)e(in)m(terpreted)f(as)i(a)g(string)f(\(e.g.)48
+b(The)31 b(v)-5 b(alue)227 4478 y(tok)m(en)34 b(ma)m(y)f(b)s(e)f
+(forced)g(to)i(b)s(e)e(in)m(terpreted)f(as)i(a)g(string)f(\(e.g.)48
 b(if)32 b(it)g(is)f(a)i(string)f(of)g(n)m(umeric)g(digits\))f(b)m(y)227
-1007 y(enclosing)f(it)g(in)f(single)g(quotes.)0 1264
+4591 y(enclosing)f(it)g(in)f(single)g(quotes.)0 4862
 y Fh(-)80 b Fi(The)37 b(COMMENT)f(tok)m(en)i(is)e(optional,)i(but)f(if)
 f(presen)m(t)h(m)m(ust)f(b)s(e)h(separated)g(from)g(the)g(V)-10
-b(ALUE)37 b(tok)m(en)227 1377 y(b)m(y)j(at)h(least)g(one)f(blank)f
+b(ALUE)37 b(tok)m(en)227 4974 y(b)m(y)j(at)h(least)g(one)f(blank)f
 (space.)70 b(A)40 b(leading)f('/')i(c)m(haracter)h(ma)m(y)f(b)s(e)e
-(used)h(to)g(mark)g(the)h(b)s(eginning)227 1490 y(of)33
+(used)h(to)g(mark)g(the)h(b)s(eginning)227 5087 y(of)33
 b(the)f(commen)m(t)h(\014eld,)f(otherwise)f(the)i(commen)m(t)g(\014eld)
 e(b)s(egins)f(with)h(the)h(\014rst)g(non-blank)e(c)m(haracter)227
-1603 y(follo)m(wing)f(the)i(v)-5 b(alue)30 b(tok)m(en.)0
-1861 y Fh(-)80 b Fi(One)32 b(exception)h(to)g(the)g(ab)s(o)m(v)m(e)h
+5200 y(follo)m(wing)f(the)i(v)-5 b(alue)30 b(tok)m(en.)0
+5470 y Fh(-)80 b Fi(One)32 b(exception)h(to)g(the)g(ab)s(o)m(v)m(e)h
 (rules)d(is)g(that)i(if)f(the)g(\014rst)g(non-blank)f(c)m(haracter)j
-(in)d(the)i(template)g(string)227 1974 y(is)h(a)h(min)m(us)e(sign)h
+(in)d(the)i(template)g(string)227 5583 y(is)h(a)h(min)m(us)e(sign)h
 (\('-'\))i(follo)m(w)m(ed)e(b)m(y)h(a)g(single)e(tok)m(en,)k(or)e(a)g
 (single)e(tok)m(en)j(follo)m(w)m(ed)e(b)m(y)h(an)f(equal)h(sign,)227
-2087 y(then)29 b(it)f(is)g(in)m(terpreted)f(as)i(the)g(name)g(of)g(a)g
+5696 y(then)29 b(it)f(is)g(in)m(terpreted)f(as)i(the)g(name)g(of)g(a)g
 (k)m(eyw)m(ord)g(whic)m(h)e(is)h(to)h(b)s(e)f(deleted)h(from)f(the)h
-(FITS)f(header.)0 2344 y Fh(-)80 b Fi(The)40 b(second)g(exception)g(is)
-f(that)i(if)e(the)h(template)g(string)f(starts)h(with)f(a)i(min)m(us)d
-(sign)h(and)g(is)g(follo)m(w)m(ed)227 2457 y(b)m(y)33
-b(2)g(tok)m(ens)g(then)g(the)f(second)h(tok)m(en)h(is)d(in)m(terpreted)
-h(as)h(the)g(new)f(name)g(for)h(the)g(k)m(eyw)m(ord)g(sp)s(eci\014ed)
-227 2570 y(b)m(y)h(\014rst)e(tok)m(en.)52 b(In)33 b(this)f(case)j(the)e
-(old)g(k)m(eyw)m(ord)h(name)g(\(\014rst)f(tok)m(en\))i(is)d(returned)h
-(in)f(c)m(haracters)j(1-8)227 2683 y(of)e(the)g(returned)e(CARD)i
-(string,)f(and)g(the)h(new)f(k)m(eyw)m(ord)h(name)g(\(the)g(second)f
-(tok)m(en\))i(is)e(returned)f(in)227 2796 y(c)m(haracters)c(41-48)h(of)
-e(the)f(returned)g(CARD)g(string.)39 b(These)25 b(old)g(and)g(new)g
-(names)g(ma)m(y)h(then)f(b)s(e)g(passed)227 2909 y(to)31
-b(the)g(FTMNAM)g(subroutine)e(whic)m(h)g(will)e(c)m(hange)32
-b(the)e(k)m(eyw)m(ord)h(name.)0 3166 y(The)f(HDTYPE)g(output)g
-(parameter)h(indicates)e(ho)m(w)i(the)f(returned)g(CARD)g(string)f
-(should)g(b)s(e)h(in)m(terpreted:)382 3424 y Fe(hdtype)857
-b(interpretation)382 3537 y(------)523 b(-------------------------)o
-(----)o(---)o(----)o(----)o(---)o(----)o(--)525 3650
+(FITS)f(header.)p eop
+%%Page: 106 112
+106 111 bop 0 299 a Fi(106)1274 b Fg(CHAPTER)29 b(9.)112
+b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)0
+555 y Fh(-)80 b Fi(The)40 b(second)g(exception)g(is)f(that)i(if)e(the)h
+(template)g(string)f(starts)h(with)f(a)i(min)m(us)d(sign)h(and)g(is)g
+(follo)m(w)m(ed)227 668 y(b)m(y)33 b(2)g(tok)m(ens)g(then)g(the)f
+(second)h(tok)m(en)h(is)d(in)m(terpreted)h(as)h(the)g(new)f(name)g(for)
+h(the)g(k)m(eyw)m(ord)g(sp)s(eci\014ed)227 781 y(b)m(y)h(\014rst)e(tok)
+m(en.)52 b(In)33 b(this)f(case)j(the)e(old)g(k)m(eyw)m(ord)h(name)g
+(\(\014rst)f(tok)m(en\))i(is)d(returned)h(in)f(c)m(haracters)j(1-8)227
+894 y(of)e(the)g(returned)e(CARD)i(string,)f(and)g(the)h(new)f(k)m(eyw)
+m(ord)h(name)g(\(the)g(second)f(tok)m(en\))i(is)e(returned)f(in)227
+1007 y(c)m(haracters)c(41-48)h(of)e(the)f(returned)g(CARD)g(string.)39
+b(These)25 b(old)g(and)g(new)g(names)g(ma)m(y)h(then)f(b)s(e)g(passed)
+227 1120 y(to)31 b(the)g(FTMNAM)g(subroutine)e(whic)m(h)g(will)e(c)m
+(hange)32 b(the)e(k)m(eyw)m(ord)h(name.)0 1361 y(The)f(HDTYPE)g(output)
+g(parameter)h(indicates)e(ho)m(w)i(the)f(returned)g(CARD)g(string)f
+(should)g(b)s(e)h(in)m(terpreted:)382 1602 y Fe(hdtype)857
+b(interpretation)382 1715 y(------)523 b(-------------------------)o
+(----)o(---)o(----)o(----)o(---)o(----)o(--)525 1828
 y(-2)572 b(Modify)46 b(the)h(name)g(of)g(the)g(keyword)f(given)g(in)h
-(CARD\(1:8\))1193 3763 y(to)g(the)g(new)g(name)g(given)f(in)h
-(CARD\(41:48\))525 3988 y(-1)572 b(CARD\(1:8\))45 b(contains)h(the)h
-(name)g(of)g(a)g(keyword)f(to)h(be)g(deleted)1193 4101
-y(from)g(the)g(FITS)f(header.)573 4327 y(0)572 b(append)46
+(CARD\(1:8\))1193 1941 y(to)g(the)g(new)g(name)g(given)f(in)h
+(CARD\(41:48\))525 2167 y(-1)572 b(CARD\(1:8\))45 b(contains)h(the)h
+(name)g(of)g(a)g(keyword)f(to)h(be)g(deleted)1193 2280
+y(from)g(the)g(FITS)f(header.)573 2506 y(0)572 b(append)46
 b(the)h(CARD)g(string)f(to)h(the)g(FITS)g(header)f(if)h(the)1193
-4440 y(keyword)f(does)h(not)g(already)e(exist,)h(otherwise)g(update)
-1193 4553 y(the)h(value/comment)d(if)j(the)g(keyword)f(is)h(already)f
-(present)1193 4666 y(in)h(the)g(header.)573 4892 y(1)572
+2619 y(keyword)f(does)h(not)g(already)e(exist,)h(otherwise)g(update)
+1193 2732 y(the)h(value/comment)d(if)j(the)g(keyword)f(is)h(already)f
+(present)1193 2844 y(in)h(the)g(header.)573 3070 y(1)572
 b(simply)46 b(append)g(this)h(keyword)f(to)h(the)g(FITS)g(header)f
-(\(CARD)1193 5005 y(is)h(either)f(a)i(HISTORY)e(or)h(COMMENT)f
-(keyword\).)573 5230 y(2)572 b(This)47 b(is)g(a)g(FITS)g(END)g(record;)
-f(it)h(should)f(not)h(be)g(written)1193 5343 y(to)g(the)g(FITS)g
-(header)f(because)g(FITSIO)g(automatically)1193 5456
+(\(CARD)1193 3183 y(is)h(either)f(a)i(HISTORY)e(or)h(COMMENT)f
+(keyword\).)573 3409 y(2)572 b(This)47 b(is)g(a)g(FITS)g(END)g(record;)
+f(it)h(should)f(not)h(be)g(written)1193 3522 y(to)g(the)g(FITS)g
+(header)f(because)g(FITSIO)g(automatically)1193 3635
 y(appends)g(the)h(END)g(record)f(when)h(the)f(header)h(is)g(closed.)0
-5714 y Fi(EXAMPLES:)30 b(The)g(follo)m(wing)f(lines)f(illustrate)h(v)-5
-b(alid)29 b(input)f(template)j(strings:)p eop
-%%Page: 97 103
-97 102 bop 0 299 a Fg(8.12.)73 b(GENERAL)30 b(UTILITY)g(SUBR)m(OUTINES)
-1979 b Fi(97)286 555 y Fe(INTVAL)46 b(7)i(This)f(is)g(an)g(integer)f
-(keyword)286 668 y(RVAL)524 b(34.6)142 b(/)239 b(This)46
-b(is)i(a)f(floating)f(point)g(keyword)286 781 y(EVAL=-12.45E-03)92
-b(This)46 b(is)i(a)f(floating)f(point)g(keyword)g(in)h(exponential)e
-(notation)286 894 y(lval)i(F)g(This)g(is)g(a)h(boolean)e(keyword)859
-1007 y(This)h(is)g(a)g(comment)f(keyword)g(with)h(a)g(blank)f(keyword)g
-(name)286 1120 y(SVAL1)h(=)g('Hello)f(world')142 b(/)95
-b(this)47 b(is)g(a)g(string)f(keyword)286 1233 y(SVAL2)94
-b('123.5')g(this)47 b(is)g(also)f(a)i(string)e(keyword)286
-1346 y(sval3)94 b(123+)h(/)g(this)47 b(is)g(also)f(a)i(string)e
-(keyword)g(with)g(the)h(value)g('123+)189 b(')286 1458
+3876 y Fi(EXAMPLES:)30 b(The)g(follo)m(wing)f(lines)f(illustrate)h(v)-5
+b(alid)29 b(input)f(template)j(strings:)286 4118 y Fe(INTVAL)46
+b(7)i(This)f(is)g(an)g(integer)f(keyword)286 4231 y(RVAL)524
+b(34.6)142 b(/)239 b(This)46 b(is)i(a)f(floating)f(point)g(keyword)286
+4343 y(EVAL=-12.45E-03)92 b(This)46 b(is)i(a)f(floating)f(point)g
+(keyword)g(in)h(exponential)e(notation)286 4456 y(lval)i(F)g(This)g(is)
+g(a)h(boolean)e(keyword)859 4569 y(This)h(is)g(a)g(comment)f(keyword)g
+(with)h(a)g(blank)f(keyword)g(name)286 4682 y(SVAL1)h(=)g('Hello)f
+(world')142 b(/)95 b(this)47 b(is)g(a)g(string)f(keyword)286
+4795 y(SVAL2)94 b('123.5')g(this)47 b(is)g(also)f(a)i(string)e(keyword)
+286 4908 y(sval3)94 b(123+)h(/)g(this)47 b(is)g(also)f(a)i(string)e
+(keyword)g(with)g(the)h(value)g('123+)189 b(')286 5021
 y(#)48 b(the)f(following)e(template)h(line)g(deletes)g(the)h(DATE)g
-(keyword)286 1571 y(-)h(DATE)286 1684 y(#)g(the)f(following)e(template)
+(keyword)286 5134 y(-)h(DATE)286 5247 y(#)g(the)f(following)e(template)
 h(line)g(modifies)g(the)h(NAME)f(keyword)g(to)h(OBJECT)286
-1797 y(-)h(NAME)e(OBJECT)p eop
-%%Page: 98 104
-98 103 bop 0 299 a Fi(98)1319 b Fg(CHAPTER)29 b(8.)112
+5360 y(-)h(NAME)e(OBJECT)0 5601 y Fh(16)g Fi(P)m(arse)35
+b(the)g(input)e(string)h(con)m(taining)g(a)h(list)f(of)h(ro)m(ws)f(or)h
+(ro)m(w)g(ranges,)h(and)e(return)g(in)m(teger)h(arra)m(ys)g(con-)227
+5714 y(taining)25 b(the)h(\014rst)f(and)g(last)h(ro)m(w)g(in)e(eac)m(h)
+j(range.)40 b(F)-8 b(or)26 b(example,)h(if)d(ro)m(wlist)h(=)g("3-5,)k
+(6,)e(8-9")h(then)d(it)h(will)p eop
+%%Page: 107 113
+107 112 bop 0 299 a Fg(9.12.)73 b(GENERAL)30 b(UTILITY)g(SUBR)m
+(OUTINES)1934 b Fi(107)227 555 y(return)34 b(n)m(umranges)h(=)g(3,)h
+(rangemin)e(=)h(3,)i(6,)g(8)e(and)g(rangemax)g(=)g(5,)i(6,)g(9.)55
+b(A)m(t)36 b(most,)h('maxranges')227 668 y(n)m(um)m(b)s(er)31
+b(of)h(ranges)f(will)e(b)s(e)j(returned.)43 b('maxro)m(ws')32
+b(is)f(the)h(maxim)m(um)f(n)m(um)m(b)s(er)f(of)i(ro)m(ws)g(in)e(the)i
+(table;)227 781 y(an)m(y)e(ro)m(ws)f(or)g(ranges)g(larger)g(than)g
+(this)f(will)e(b)s(e)j(ignored.)39 b(The)29 b(ro)m(ws)g(m)m(ust)g(b)s
+(e)f(sp)s(eci\014ed)g(in)f(increasing)227 894 y(order,)33
+b(and)f(the)g(ranges)h(m)m(ust)f(not)g(o)m(v)m(erlap.)47
+b(A)33 b(min)m(us)d(sign)i(ma)m(y)h(b)s(e)e(use)h(to)h(sp)s(ecify)e
+(all)g(the)i(ro)m(ws)f(to)227 1007 y(the)h(upp)s(er)d(or)j(lo)m(w)m(er)
+g(b)s(ound,)e(so)i("50-")h(means)e(all)g(the)h(ro)m(ws)f(from)g(50)h
+(to)h(the)e(end)g(of)h(the)f(table,)i(and)227 1120 y("-")e(means)e(all)
+f(the)i(ro)m(ws)f(in)f(the)i(table,)f(from)g(1)h(-)g(maxro)m(ws.)191
+1380 y Fe(FTRWRG\(rowlist,)44 b(maxrows,)h(maxranges,)g(>)525
+1492 y(numranges,)g(rangemin,)g(rangemax,)h(status\))p
+eop
+%%Page: 108 114
+108 113 bop 0 299 a Fi(108)1274 b Fg(CHAPTER)29 b(9.)112
 b(AD)m(V)-10 b(ANCED)32 b(INTERF)-10 b(A)m(CE)30 b(SUBR)m(OUTINES)p
 eop
-%%Page: 99 105
-99 104 bop 0 1225 a Ff(Chapter)65 b(9)0 1687 y Fl(Summary)76
+%%Page: 109 115
+109 114 bop 0 1225 a Ff(Chapter)65 b(10)0 1687 y Fl(Summary)76
 b(of)i(all)f(FITSIO)0 1937 y(User-In)-6 b(terface)77
-b(Subroutines)0 2429 y Fi(Error)29 b(Status)i(Routines)e(page)i(55)382
-2657 y Fe(FTVERS\()46 b(>)h(version\))382 2770 y(FTGERR\(status,)d(>)j
-(errtext\))382 2883 y(FTGMSG\()f(>)h(errmsg\))382 2996
-y(FTRPRT)f(\(stream,)f(>)j(status\))382 3109 y(FTPMSG\(errmsg\))382
-3222 y(FTCMSG)0 3450 y Fi(FITS)30 b(File)f(Op)s(en)g(and)h(Close)g
-(Subroutines:)38 b(page)31 b(61)382 3679 y Fe
-(FTOPEN\(unit,filename,rwm)o(ode)o(,)42 b(>)47 b(blocksize,status\))382
-3792 y(FTNOPN\(unit,filename,rwm)o(ode)o(,)42 b(>)47
-b(status\))382 3905 y(FTREOPEN\(unit,)d(>)j(newunit,)f(status\))382
-4018 y(FTINIT\(unit,filename,blo)o(cks)o(ize,)41 b(>)48
-b(status\))382 4130 y(FTTPLT\(unit,)c(filename,)i(tplfilename,)e(>)j
-(status\))382 4243 y(FTFLUS\(unit,)d(>)k(status\))382
-4356 y(FTCLOS\(unit,)c(>)k(status\))382 4469 y(FTDELT\(unit,)c(>)k
-(status\))382 4582 y(FTGIOU\()e(>)h(iounit,)f(status\))382
-4695 y(FTFIOU\(iounit,)e(>)j(status\))382 4808 y(FTEXTN\(filename,)c(>)
-48 b(nhdu,)e(status\))382 4921 y(FTFLNM\(unit,)e(>)k(filename,)d
-(status\))382 5034 y(FTFLMD\(unit,)f(>)k(iomode,)e(status\))382
-5147 y(FFURLT\(unit,)e(>)k(urltype,)d(status\))382 5260
-y(FTIURL\(filename,)e(>)48 b(filetype,)d(infile,)h(outfile,)f(extspec,)
-h(filter,)716 5372 y(binspec,)f(colspec,)h(status\))382
-5485 y(FTRTNM\(filename,)d(>)48 b(rootname,)d(status\))0
-5714 y Fi(HDU-Lev)m(el)32 b(Op)s(erations:)39 b(page)31
-b(64)1905 5942 y(99)p eop
-%%Page: 100 106
-100 105 bop 0 299 a Fi(100)327 b Fg(CHAPTER)30 b(9.)111
+b(Subroutines)0 2429 y Fi(Error)29 b(Status)i(Routines)e(page)i(63)382
+2696 y Fe(FTVERS\()46 b(>)h(version\))382 2809 y(FTGERR\(status,)d(>)j
+(errtext\))382 2922 y(FTGMSG\()f(>)h(errmsg\))382 3035
+y(FTRPRT)f(\(stream,)f(>)j(status\))382 3147 y(FTPMSG\(errmsg\))382
+3260 y(FTPMRK)382 3373 y(FTCMSG)382 3486 y(FTCMRK)0 3753
+y Fi(FITS)30 b(File)f(Op)s(en)g(and)h(Close)g(Subroutines:)38
+b(page)31 b(69)382 4020 y Fe(FTOPEN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(blocksize,status\))382 4133 y(FTNOPN\(unit,filename,rwm)o(ode)
+o(,)42 b(>)47 b(status\))382 4246 y(FTDOPN\(unit,filename,rwm)o(ode)o
+(,)42 b(>)47 b(status\))382 4359 y(FTTOPN\(unit,filename,rwm)o(ode)o(,)
+42 b(>)47 b(status\))382 4472 y(FTIOPN\(unit,filename,rwm)o(ode)o(,)42
+b(>)47 b(status\))382 4585 y(FTREOPEN\(unit,)d(>)j(newunit,)f(status\))
+382 4698 y(FTINIT\(unit,filename,blo)o(cks)o(ize,)41
+b(>)48 b(status\))382 4811 y(FTTPLT\(unit,)c(filename,)i(tplfilename,)e
+(>)j(status\))382 4924 y(FTFLUS\(unit,)d(>)k(status\))382
+5036 y(FTCLOS\(unit,)c(>)k(status\))382 5149 y(FTDELT\(unit,)c(>)k
+(status\))382 5262 y(FTGIOU\()e(>)h(iounit,)f(status\))382
+5375 y(FTFIOU\(iounit,)e(>)j(status\))382 5488 y(FTEXTN\(filename,)c(>)
+48 b(nhdu,)e(status\))382 5601 y(FTFLNM\(unit,)e(>)k(filename,)d
+(status\))382 5714 y(FTFLMD\(unit,)f(>)k(iomode,)e(status\))1882
+5942 y Fi(109)p eop
+%%Page: 110 116
+110 115 bop 0 299 a Fi(110)281 b Fg(CHAPTER)30 b(10.)112
 b(SUMMAR)-8 b(Y)32 b(OF)e(ALL)g(FITSIO)f(USER-INTERF)-10
-b(A)m(CE)30 b(SUBR)m(OUTINES)382 555 y Fe(FTMAHD\(unit,nhdu,)43
-b(>)k(hdutype,status\))382 668 y(FTMRHD\(unit,nmove,)c(>)k
-(hdutype,status\))382 781 y(FTGHDN\(unit,)d(>)k(nhdu\))382
-894 y(FTMNHD\(unit,)c(hdutype,)i(extname,)f(extver,)h(>)i(status\))382
-1007 y(FTGHDT\(unit,)c(>)k(hdutype,)d(status\))382 1120
-y(FTTHDU\(unit,)f(>)k(hdunum,)e(status\))382 1233 y(FTCRHD\(unit,)e(>)k
-(status\))382 1346 y(FTIIMG\(unit,bitpix,naxis)o(,na)o(xes,)41
-b(>)48 b(status\))382 1458 y(FTITAB\(unit,rowlen,nrows)o(,tf)o(ield)o
+b(A)m(CE)30 b(SUBR)m(OUTINES)382 555 y Fe(FFURLT\(unit,)44
+b(>)k(urltype,)d(status\))382 668 y(FTIURL\(filename,)e(>)48
+b(filetype,)d(infile,)h(outfile,)f(extspec,)h(filter,)716
+781 y(binspec,)f(colspec,)h(status\))382 894 y(FTRTNM\(filename,)d(>)48
+b(rootname,)d(status\))382 1007 y(FTEXIST\(filename,)e(>)k(exist,)f
+(status\))0 1271 y Fi(HDU-Lev)m(el)32 b(Op)s(erations:)39
+b(page)31 b(72)382 1534 y Fe(FTMAHD\(unit,nhdu,)43 b(>)k
+(hdutype,status\))382 1647 y(FTMRHD\(unit,nmove,)c(>)k
+(hdutype,status\))382 1760 y(FTGHDN\(unit,)d(>)k(nhdu\))382
+1873 y(FTMNHD\(unit,)c(hdutype,)i(extname,)f(extver,)h(>)i(status\))382
+1986 y(FTGHDT\(unit,)c(>)k(hdutype,)d(status\))382 2099
+y(FTTHDU\(unit,)f(>)k(hdunum,)e(status\))382 2212 y(FTCRHD\(unit,)e(>)k
+(status\))382 2325 y(FTIIMG\(unit,bitpix,naxis)o(,na)o(xes,)41
+b(>)48 b(status\))382 2438 y(FTITAB\(unit,rowlen,nrows)o(,tf)o(ield)o
 (s,tt)o(ype)o(,tbc)o(ol,t)o(for)o(m,tu)o(nit,)o(ext)o(name)o(,)42
-b(>)716 1571 y(status\))382 1684 y(FTIBIN\(unit,nrows,tfield)o(s,t)o
+b(>)716 2551 y(status\))382 2663 y(FTIBIN\(unit,nrows,tfield)o(s,t)o
 (type)o(,tfo)o(rm,)o(tuni)o(t,ex)o(tna)o(me,v)o(arid)o(at)f(>)48
-b(status\))382 1797 y(FTRSIM\(unit,bitpix,naxis)o(,na)o(xes,)o(stat)o
-(us\))382 1910 y(FTDHDU\(unit,)c(>)k(hdutype,status\))382
-2023 y(FTCOPY\(iunit,ounit,morek)o(eys)o(,)42 b(>)47
-b(status\))382 2136 y(FTCPHD\(inunit,)d(outunit,)h(>)j(status\))382
-2249 y(FTCPDT\(iunit,ounit,)42 b(>)48 b(status\))0 2506
-y Fi(Subroutines)28 b(to)j(sp)s(ecify)e(or)h(mo)s(dify)f(the)h
-(structure)g(of)h(the)f(CHDU:)h(page)h(66)382 2764 y
+b(status\))382 2776 y(FTRSIM\(unit,bitpix,naxis)o(,na)o(xes,)o(stat)o
+(us\))382 2889 y(FTDHDU\(unit,)c(>)k(hdutype,status\))382
+3002 y(FTCPFL\(iunit,ounit,previ)o(ous)o(,)42 b(current,)j(following,)g
+(>)j(status\))382 3115 y(FTCOPY\(iunit,ounit,morek)o(eys)o(,)42
+b(>)47 b(status\))382 3228 y(FTCPHD\(inunit,)d(outunit,)h(>)j(status\))
+382 3341 y(FTCPDT\(iunit,ounit,)42 b(>)48 b(status\))0
+3605 y Fi(Subroutines)28 b(to)j(sp)s(ecify)e(or)h(mo)s(dify)f(the)h
+(structure)g(of)h(the)f(CHDU:)h(page)h(75)382 3868 y
 Fe(FTRDEF\(unit,)44 b(>)k(status\))93 b(\(DEPRECATED\))382
-2877 y(FTPDEF\(unit,bitpix,naxis)o(,na)o(xes,)o(pcou)o(nt,)o(gcou)o
-(nt,)41 b(>)48 b(status\))93 b(\(DEPRECATED\))382 2990
+3981 y(FTPDEF\(unit,bitpix,naxis)o(,na)o(xes,)o(pcou)o(nt,)o(gcou)o
+(nt,)41 b(>)48 b(status\))93 b(\(DEPRECATED\))382 4094
 y(FTADEF\(unit,rowlen,tfiel)o(ds,)o(tbco)o(l,tf)o(orm)o(,nro)o(ws)42
-b(>)47 b(status\))94 b(\(DEPRECATED\))382 3103 y
+b(>)47 b(status\))94 b(\(DEPRECATED\))382 4207 y
 (FTBDEF\(unit,tfields,tfor)o(m,v)o(arid)o(at,n)o(row)o(s)42
-b(>)47 b(status\))94 b(\(DEPRECATED\))382 3216 y(FTDDEF\(unit,bytlen,)
-42 b(>)48 b(status\))93 b(\(DEPRECATED\))382 3329 y
-(FTPTHP\(unit,theap,)43 b(>)k(status\))0 3586 y Fi(Header)31
+b(>)47 b(status\))94 b(\(DEPRECATED\))382 4320 y(FTDDEF\(unit,bytlen,)
+42 b(>)48 b(status\))93 b(\(DEPRECATED\))382 4433 y
+(FTPTHP\(unit,theap,)43 b(>)k(status\))0 4697 y Fi(Header)31
 b(Space)f(and)g(P)m(osition)g(Subroutines:)38 b(page)31
-b(67)382 3844 y Fe(FTHDEF\(unit,morekeys,)42 b(>)47 b(status\))382
-3957 y(FTGHSP\(iunit,)d(>)j(keysexist,keysadd,status\))382
-4070 y(FTGHPS\(iunit,)d(>)j(keysexist,key_no,status\))0
-4327 y Fi(Read)31 b(or)f(W)-8 b(rite)31 b(Standard)e(Header)i
-(Subroutines:)38 b(page)31 b(68)382 4585 y Fe
-(FTPHPS\(unit,bitpix,naxis)o(,na)o(xes,)41 b(>)48 b(status\))382
-4698 y(FTPHPR\(unit,simple,bitpi)o(x,n)o(axis)o(,nax)o(es,)o(pcou)o
-(nt,g)o(cou)o(nt,e)o(xten)o(d,)41 b(>)48 b(status\))382
-4811 y(FTGHPR\(unit,maxdim,)42 b(>)48 b(simple,bitpix,naxis,naxe)o(s,p)
-o(coun)o(t,gc)o(oun)o(t,ex)o(tend)o(,)716 4924 y(status\))382
-5036 y(FTPHTB\(unit,rowlen,nrows)o(,tf)o(ield)o(s,tt)o(ype)o(,tbc)o
-(ol,t)o(for)o(m,tu)o(nit,)o(ext)o(name)o(,)42 b(>)716
-5149 y(status\))382 5262 y(FTGHTB\(unit,maxdim,)g(>)48
+b(76)382 4961 y Fe(FTHDEF\(unit,morekeys,)42 b(>)47 b(status\))382
+5073 y(FTGHSP\(iunit,)d(>)j(keysexist,keysadd,status\))382
+5186 y(FTGHPS\(iunit,)d(>)j(keysexist,key_no,status\))0
+5450 y Fi(Read)31 b(or)f(W)-8 b(rite)31 b(Standard)e(Header)i
+(Subroutines:)38 b(page)31 b(77)382 5714 y Fe
+(FTPHPS\(unit,bitpix,naxis)o(,na)o(xes,)41 b(>)48 b(status\))p
+eop
+%%Page: 111 117
+111 116 bop 3764 299 a Fi(111)382 555 y Fe(FTPHPR\(unit,simple,bitpi)o
+(x,n)o(axis)o(,nax)o(es,)o(pcou)o(nt,g)o(cou)o(nt,e)o(xten)o(d,)41
+b(>)48 b(status\))382 668 y(FTGHPR\(unit,maxdim,)42 b(>)48
+b(simple,bitpix,naxis,naxe)o(s,p)o(coun)o(t,gc)o(oun)o(t,ex)o(tend)o(,)
+716 781 y(status\))382 894 y(FTPHTB\(unit,rowlen,nrows)o(,tf)o(ield)o
+(s,tt)o(ype)o(,tbc)o(ol,t)o(for)o(m,tu)o(nit,)o(ext)o(name)o(,)42
+b(>)716 1007 y(status\))382 1120 y(FTGHTB\(unit,maxdim,)g(>)48
 b(rowlen,nrows,tfields,tty)o(pe,)o(tbco)o(l,tf)o(orm)o(,tun)o(it,)716
-5375 y(extname,status\))382 5488 y(FTPHBN\(unit,nrows,tfield)o(s,t)o
+1233 y(extname,status\))382 1346 y(FTPHBN\(unit,nrows,tfield)o(s,t)o
 (type)o(,tfo)o(rm,)o(tuni)o(t,ex)o(tna)o(me,v)o(arid)o(at)41
-b(>)48 b(status\))382 5601 y(FTGHBN\(unit,maxdim,)42
+b(>)48 b(status\))382 1458 y(FTGHBN\(unit,maxdim,)42
 b(>)48 b(nrows,tfields,ttype,tfor)o(m,t)o(unit)o(,ext)o(nam)o(e,va)o
-(rida)o(t,)716 5714 y(status\))p eop
-%%Page: 101 107
-101 106 bop 3764 299 a Fi(101)0 555 y(W)-8 b(rite)31
-b(Keyw)m(ord)f(Subroutines:)38 b(page)31 b(69)382 808
-y Fe(FTPREC\(unit,card,)43 b(>)k(status\))382 921 y
-(FTPCOM\(unit,comment,)42 b(>)48 b(status\))382 1034
-y(FTPHIS\(unit,history,)42 b(>)48 b(status\))382 1147
-y(FTPDAT\(unit,)c(>)k(status\))382 1260 y(FTPKY[JLS]\(unit,keyword,)o
+(rida)o(t,)716 1571 y(status\))0 1829 y Fi(W)-8 b(rite)31
+b(Keyw)m(ord)f(Subroutines:)38 b(page)31 b(78)382 2087
+y Fe(FTPREC\(unit,card,)43 b(>)k(status\))382 2199 y
+(FTPCOM\(unit,comment,)42 b(>)48 b(status\))382 2312
+y(FTPHIS\(unit,history,)42 b(>)48 b(status\))382 2425
+y(FTPDAT\(unit,)c(>)k(status\))382 2538 y(FTPKY[JLS]\(unit,keyword,)o
 (key)o(val,)o(comm)o(ent)o(,)42 b(>)47 b(status\))382
-1373 y(FTPKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o(ima)o(ls,c)o
-(omme)o(nt,)41 b(>)48 b(status\))382 1486 y(FTPKLS\(unit,keyword,keyv)o
-(al,)o(comm)o(ent,)41 b(>)47 b(status\))382 1599 y(FTPLSW\(unit,)d(>)k
-(status\))382 1712 y(FTPKYU\(unit,keyword,comm)o(ent)o(,)42
-b(>)47 b(status\))382 1824 y(FTPKN[JLS]\(unit,keyroot,)o(sta)o(rtno)o
+2651 y(FTPKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o(ima)o(ls,c)o
+(omme)o(nt,)41 b(>)48 b(status\))382 2764 y(FTPKLS\(unit,keyword,keyv)o
+(al,)o(comm)o(ent,)41 b(>)47 b(status\))382 2877 y(FTPLSW\(unit,)d(>)k
+(status\))382 2990 y(FTPKYU\(unit,keyword,comm)o(ent)o(,)42
+b(>)47 b(status\))382 3103 y(FTPKN[JLS]\(unit,keyroot,)o(sta)o(rtno)o
 (,no_)o(key)o(s,ke)o(yval)o(s,c)o(omme)o(nts,)41 b(>)47
-b(status\))382 1937 y(FTPKN[EDFG]\(unit,keyroot)o(,st)o(artn)o(o,no)o
+b(status\))382 3216 y(FTPKN[EDFG]\(unit,keyroot)o(,st)o(artn)o(o,no)o
 (_ke)o(ys,k)o(eyva)o(ls,)o(deci)o(mals)o(,co)o(mmen)o(ts,)41
-b(>)907 2050 y(status\))382 2163 y(FTCPKYinunit,)j(outunit,)i(innum,)g
-(outnum,)f(keyroot,)h(>)h(status\))382 2276 y
+b(>)907 3329 y(status\))382 3441 y(FTCPKYinunit,)j(outunit,)i(innum,)g
+(outnum,)f(keyroot,)h(>)h(status\))382 3554 y
 (FTPKYT\(unit,keyword,intv)o(al,)o(dblv)o(al,c)o(omm)o(ent,)41
-b(>)48 b(status\))382 2389 y(FTPKTP\(unit,)c(filename,)i(>)h(status\))
-382 2502 y(FTPUNT\(unit,keyword,unit)o(s,)41 b(>)48 b(status\))0
-2755 y Fi(Insert)30 b(Keyw)m(ord)g(Subroutines:)38 b(page)31
-b(71)382 3008 y Fe(FTIREC\(unit,key_no,card,)41 b(>)47
-b(status\))382 3121 y(FTIKY[JLS]\(unit,keyword,)o(key)o(val,)o(comm)o
-(ent)o(,)42 b(>)47 b(status\))382 3234 y(FTIKLS\(unit,keyword,keyv)o
-(al,)o(comm)o(ent,)41 b(>)47 b(status\))382 3347 y
+b(>)48 b(status\))382 3667 y(FTPKTP\(unit,)c(filename,)i(>)h(status\))
+382 3780 y(FTPUNT\(unit,keyword,unit)o(s,)41 b(>)48 b(status\))0
+4038 y Fi(Insert)30 b(Keyw)m(ord)g(Subroutines:)38 b(page)31
+b(80)382 4295 y Fe(FTIREC\(unit,key_no,card,)41 b(>)47
+b(status\))382 4408 y(FTIKY[JLS]\(unit,keyword,)o(key)o(val,)o(comm)o
+(ent)o(,)42 b(>)47 b(status\))382 4521 y(FTIKLS\(unit,keyword,keyv)o
+(al,)o(comm)o(ent,)41 b(>)47 b(status\))382 4634 y
 (FTIKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o(ima)o(ls,c)o(omme)o
-(nt,)41 b(>)48 b(status\))382 3460 y(FTIKYU\(unit,keyword,comm)o(ent)o
-(,)42 b(>)47 b(status\))0 3713 y Fi(Read)31 b(Keyw)m(ord)f
-(Subroutines:)38 b(page)31 b(72)382 3966 y Fe(FTGREC\(unit,key_no,)42
-b(>)48 b(card,status\))382 4079 y(FTGKYN\(unit,key_no,)42
-b(>)48 b(keyword,value,comment,st)o(atu)o(s\))382 4192
+(nt,)41 b(>)48 b(status\))382 4747 y(FTIKYU\(unit,keyword,comm)o(ent)o
+(,)42 b(>)47 b(status\))0 5005 y Fi(Read)31 b(Keyw)m(ord)f
+(Subroutines:)38 b(page)31 b(81)382 5262 y Fe(FTGREC\(unit,key_no,)42
+b(>)48 b(card,status\))382 5375 y(FTGKYN\(unit,key_no,)42
+b(>)48 b(keyword,value,comment,st)o(atu)o(s\))382 5488
 y(FTGCRD\(unit,keyword,)42 b(>)48 b(card,status\))382
-4304 y(FTGNXK\(unit,inclist,ninc)o(,ex)o(clis)o(t,ne)o(xc,)41
-b(>)48 b(card,status\))382 4417 y(FTGKEY\(unit,keyword,)42
-b(>)48 b(value,comment,status\))382 4530 y(FTGKY[EDJLS]\(unit,keywor)o
-(d,)41 b(>)48 b(keyval,comment,status\))382 4643 y
+5601 y(FTGNXK\(unit,inclist,ninc)o(,ex)o(clis)o(t,ne)o(xc,)41
+b(>)48 b(card,status\))382 5714 y(FTGKEY\(unit,keyword,)42
+b(>)48 b(value,comment,status\))p eop
+%%Page: 112 118
+112 117 bop 0 299 a Fi(112)281 b Fg(CHAPTER)30 b(10.)112
+b(SUMMAR)-8 b(Y)32 b(OF)e(ALL)g(FITSIO)f(USER-INTERF)-10
+b(A)m(CE)30 b(SUBR)m(OUTINES)382 555 y Fe(FTGKY[EDJLS]\(unit,keywor)o
+(d,)41 b(>)48 b(keyval,comment,status\))382 668 y
 (FTGKN[EDJLS]\(unit,keyroo)o(t,s)o(tart)o(no,m)o(ax_)o(keys)o(,)42
-b(>)47 b(keyvals,nfound,status\))382 4756 y(FTGKYT\(unit,keyword,)42
-b(>)48 b(intval,dblval,comment,s)o(tat)o(us\))382 4869
+b(>)47 b(keyvals,nfound,status\))382 781 y(FTGKYT\(unit,keyword,)42
+b(>)48 b(intval,dblval,comment,s)o(tat)o(us\))382 894
 y(FTGUNT\(unit,keyword,)42 b(>)48 b(units,status\))0
-5122 y Fi(Mo)s(dify)29 b(Keyw)m(ord)h(Subroutines:)38
-b(page)31 b(74)382 5375 y Fe(FTMREC\(unit,key_no,card,)41
-b(>)47 b(status\))382 5488 y(FTMCRD\(unit,keyword,card)o(,)42
-b(>)47 b(status\))382 5601 y(FTMNAM\(unit,oldkey,keywo)o(rd,)41
-b(>)48 b(status\))382 5714 y(FTMCOM\(unit,keyword,comm)o(ent)o(,)42
-b(>)47 b(status\))p eop
-%%Page: 102 108
-102 107 bop 0 299 a Fi(102)327 b Fg(CHAPTER)30 b(9.)111
-b(SUMMAR)-8 b(Y)32 b(OF)e(ALL)g(FITSIO)f(USER-INTERF)-10
-b(A)m(CE)30 b(SUBR)m(OUTINES)382 555 y Fe(FTMKY[JLS]\(unit,keyword,)o
-(key)o(val,)o(comm)o(ent)o(,)42 b(>)47 b(status\))382
-668 y(FTMKLS\(unit,keyword,keyv)o(al,)o(comm)o(ent,)41
-b(>)47 b(status\))382 781 y(FTMKY[EDFG]\(unit,keyword)o(,ke)o(yval)o
-(,dec)o(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))382
-894 y(FTMKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47 b(status\))0
-1158 y Fi(Up)s(date)30 b(Keyw)m(ord)g(Subroutines:)38
-b(page)32 b(75)382 1421 y Fe(FTUCRD\(unit,keyword,card)o(,)42
-b(>)47 b(status\))382 1534 y(FTUKY[JLS]\(unit,keyword,)o(key)o(val,)o
-(comm)o(ent)o(,)42 b(>)47 b(status\))382 1647 y
+1150 y Fi(Mo)s(dify)29 b(Keyw)m(ord)h(Subroutines:)38
+b(page)31 b(82)382 1406 y Fe(FTMREC\(unit,key_no,card,)41
+b(>)47 b(status\))382 1519 y(FTMCRD\(unit,keyword,card)o(,)42
+b(>)47 b(status\))382 1632 y(FTMNAM\(unit,oldkey,keywo)o(rd,)41
+b(>)48 b(status\))382 1745 y(FTMCOM\(unit,keyword,comm)o(ent)o(,)42
+b(>)47 b(status\))382 1858 y(FTMKY[JLS]\(unit,keyword,)o(key)o(val,)o
+(comm)o(ent)o(,)42 b(>)47 b(status\))382 1971 y
+(FTMKLS\(unit,keyword,keyv)o(al,)o(comm)o(ent,)41 b(>)47
+b(status\))382 2084 y(FTMKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o
+(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))382 2197
+y(FTMKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47 b(status\))0
+2453 y Fi(Up)s(date)30 b(Keyw)m(ord)g(Subroutines:)38
+b(page)32 b(83)382 2709 y Fe(FTUCRD\(unit,keyword,card)o(,)42
+b(>)47 b(status\))382 2822 y(FTUKY[JLS]\(unit,keyword,)o(key)o(val,)o
+(comm)o(ent)o(,)42 b(>)47 b(status\))382 2935 y
 (FTUKLS\(unit,keyword,keyv)o(al,)o(comm)o(ent,)41 b(>)47
-b(status\))382 1760 y(FTUKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o
-(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))382 1873
+b(status\))382 3048 y(FTUKY[EDFG]\(unit,keyword)o(,ke)o(yval)o(,dec)o
+(ima)o(ls,c)o(omme)o(nt,)41 b(>)48 b(status\))382 3161
 y(FTUKYU\(unit,keyword,comm)o(ent)o(,)42 b(>)47 b(status\))0
-2137 y Fi(Delete)32 b(Keyw)m(ord)e(Subroutines:)38 b(page)31
-b(75)382 2401 y Fe(FTDREC\(unit,key_no,)42 b(>)48 b(status\))382
-2514 y(FTDKEY\(unit,keyword,)42 b(>)48 b(status\))0 2777
+3417 y Fi(Delete)32 b(Keyw)m(ord)e(Subroutines:)38 b(page)31
+b(84)382 3673 y Fe(FTDREC\(unit,key_no,)42 b(>)48 b(status\))382
+3786 y(FTDKEY\(unit,keyword,)42 b(>)48 b(status\))0 4042
 y Fi(De\014ne)31 b(Data)h(Scaling)d(P)m(arameters)i(and)f(Unde\014ned)f
-(Pixel)g(Flags:)41 b(page)31 b(75)382 3041 y Fe
+(Pixel)g(Flags:)41 b(page)31 b(84)382 4298 y Fe
 (FTPSCL\(unit,bscale,bzero)o(,)42 b(>)47 b(status\))382
-3154 y(FTTSCL\(unit,colnum,tscal)o(,tz)o(ero,)41 b(>)48
-b(status\))382 3267 y(FTPNUL\(unit,blank,)43 b(>)k(status\))382
-3380 y(FTSNUL\(unit,colnum,snull)41 b(>)47 b(status\))382
-3493 y(FTTNUL\(unit,colnum,tnull)41 b(>)47 b(status\))0
-3756 y Fi(FITS)30 b(Primary)e(Arra)m(y)j(or)f(IMA)m(GE)i(Extension)d
-(I/O)i(Subroutines:)38 b(page)31 b(77)382 4020 y Fe(FTGIDT\(unit,)44
-b(>)k(bitpix,status\))382 4133 y(FTGIDM\(unit,)c(>)k(naxis,status\))382
-4246 y(FTGISZ\(unit,)c(maxdim,)i(>)i(naxes,status\))382
-4359 y(FTGIPR\(unit,)c(maxdim,)i(>)i(bitpix,naxis,naxes,stat)o(us\))382
-4472 y(FTPPR[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o(men)o(ts,v)o
-(alue)o(s,)41 b(>)48 b(status\))382 4585 y(FTPPN[BIJED]\(unit,group,)o
-(fpi)o(xel,)o(nele)o(men)o(ts,v)o(alue)o(s,n)o(ullv)o(al)42
-b(>)47 b(status\))382 4698 y(FTPPRU\(unit,group,fpixel)o(,ne)o(leme)o
-(nts,)41 b(>)47 b(status\))382 4811 y(FTGPV[BIJED]\(unit,group,)o(fpi)o
-(xel,)o(nele)o(men)o(ts,n)o(ullv)o(al,)41 b(>)48 b
-(values,anyf,status\))382 4924 y(FTGPF[BIJED]\(unit,group,)o(fpi)o
-(xel,)o(nele)o(men)o(ts,)41 b(>)48 b(values,flagvals,anyf,sta)o(tus)o
-(\))382 5036 y(FTPGP[BIJED]\(unit,group,)o(fpa)o(rm,n)o(parm)o(,va)o
-(lues)o(,)42 b(>)47 b(status\))382 5149 y(FTGGP[BIJED]\(unit,group,)o
-(fpa)o(rm,n)o(parm)o(,)42 b(>)47 b(values,status\))382
-5262 y(FTP2D[BIJED]\(unit,group,)o(dim)o(1,na)o(xis1)o(,na)o(xis2)o
-(,ima)o(ge,)41 b(>)48 b(status\))382 5375 y(FTP3D[BIJED]\(unit,group,)o
-(dim)o(1,di)o(m2,n)o(axi)o(s1,n)o(axis)o(2,n)o(axis)o(3,cu)o(be,)41
-b(>)48 b(status\))382 5488 y(FTG2D[BIJED]\(unit,group,)o(nul)o(lval)o
+4411 y(FTTSCL\(unit,colnum,tscal)o(,tz)o(ero,)41 b(>)48
+b(status\))382 4524 y(FTPNUL\(unit,blank,)43 b(>)k(status\))382
+4637 y(FTSNUL\(unit,colnum,snull)41 b(>)47 b(status\))382
+4750 y(FTTNUL\(unit,colnum,tnull)41 b(>)47 b(status\))0
+5006 y Fi(FITS)30 b(Primary)e(Arra)m(y)j(or)f(IMA)m(GE)i(Extension)d
+(I/O)i(Subroutines:)38 b(page)31 b(85)382 5262 y Fe(FTGIDT\(unit,)44
+b(>)k(bitpix,status\))382 5375 y(FTGIET\(unit,)c(>)k(bitpix,status\))
+382 5488 y(FTGIDM\(unit,)c(>)k(naxis,status\))382 5601
+y(FTGISZ\(unit,)c(maxdim,)i(>)i(naxes,status\))382 5714
+y(FTGIPR\(unit,)c(maxdim,)i(>)i(bitpix,naxis,naxes,stat)o(us\))p
+eop
+%%Page: 113 119
+113 118 bop 3764 299 a Fi(113)382 555 y Fe(FTPPR[BIJED]\(unit,group,)o
+(fpi)o(xel,)o(nele)o(men)o(ts,v)o(alue)o(s,)41 b(>)48
+b(status\))382 668 y(FTPPN[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o
+(men)o(ts,v)o(alue)o(s,n)o(ullv)o(al)42 b(>)47 b(status\))382
+781 y(FTPPRU\(unit,group,fpixel)o(,ne)o(leme)o(nts,)41
+b(>)47 b(status\))382 894 y(FTGPV[BIJED]\(unit,group,)o(fpi)o(xel,)o
+(nele)o(men)o(ts,n)o(ullv)o(al,)41 b(>)48 b(values,anyf,status\))382
+1007 y(FTGPF[BIJED]\(unit,group,)o(fpi)o(xel,)o(nele)o(men)o(ts,)41
+b(>)48 b(values,flagvals,anyf,sta)o(tus)o(\))382 1120
+y(FTPGP[BIJED]\(unit,group,)o(fpa)o(rm,n)o(parm)o(,va)o(lues)o(,)42
+b(>)47 b(status\))382 1233 y(FTGGP[BIJED]\(unit,group,)o(fpa)o(rm,n)o
+(parm)o(,)42 b(>)47 b(values,status\))382 1346 y
+(FTP2D[BIJED]\(unit,group,)o(dim)o(1,na)o(xis1)o(,na)o(xis2)o(,ima)o
+(ge,)41 b(>)48 b(status\))382 1458 y(FTP3D[BIJED]\(unit,group,)o(dim)o
+(1,di)o(m2,n)o(axi)o(s1,n)o(axis)o(2,n)o(axis)o(3,cu)o(be,)41
+b(>)48 b(status\))382 1571 y(FTG2D[BIJED]\(unit,group,)o(nul)o(lval)o
 (,dim)o(1,n)o(axis)o(1,na)o(xis)o(2,)42 b(>)47 b(image,anyf,status\))
-382 5601 y(FTG3D[BIJED]\(unit,group,)o(nul)o(lval)o(,dim)o(1,d)o(im2,)o
-(naxi)o(s1,)o(naxi)o(s2,n)o(axi)o(s3,)41 b(>)1002 5714
-y(cube,anyf,status\))p eop
-%%Page: 103 109
-103 108 bop 3764 299 a Fi(103)382 555 y Fe(FTPSS[BIJED]\(unit,group,)o
-(nax)o(is,n)o(axes)o(,fp)o(ixel)o(s,lp)o(ixe)o(ls,a)o(rray)o(,)42
-b(>)47 b(status\))382 668 y(FTGSV[BIJED]\(unit,group,)o(nax)o(is,n)o
-(axes)o(,fp)o(ixel)o(s,lp)o(ixe)o(ls,i)o(ncs,)o(nul)o(lval)o(,)42
-b(>)1002 781 y(array,anyf,status\))382 894 y(FTGSF[BIJED]\(unit,group,)
-o(nax)o(is,n)o(axes)o(,fp)o(ixel)o(s,lp)o(ixe)o(ls,i)o(ncs,)f(>)1002
-1007 y(array,flagvals,anyf,statu)o(s\))0 1271 y Fi(T)-8
-b(able)30 b(Column)e(Information)i(Subroutines:)38 b(page)31
-b(80)382 1534 y Fe(FTGNRW\(unit,)44 b(>)k(nrows,)e(status\))382
-1647 y(FTGNCL\(unit,)e(>)k(ncols,)e(status\))382 1760
-y(FTGCNO\(unit,casesen,colt)o(emp)o(late)o(,)c(>)47 b(colnum,status\))
-382 1873 y(FTGCNN\(unit,casesen,colt)o(emp)o(late)o(,)42
-b(>)47 b(colnam,colnum,status\))382 1986 y(FTGTCL\(unit,colnum,)42
-b(>)48 b(datacode,repeat,width,st)o(atu)o(s\))382 2099
-y(FTGCDW\(unit,colnum,)42 b(>)48 b(dispwidth,status\))382
-2212 y(FTGACL\(unit,colnum,)42 b(>)716 2325 y(ttype,tbcol,tunit,tform,)
-o(tsca)o(l,t)o(zero)o(,snu)o(ll,)o(tdis)o(p,st)o(atu)o(s\))382
-2438 y(FTGBCL\(unit,colnum,)g(>)716 2551 y(ttype,tunit,datatype,rep)o
-(eat,)o(tsc)o(al,t)o(zero)o(,tn)o(ull,)o(tdis)o(p,s)o(tatu)o(s\))382
-2663 y(FTPTDM\(unit,colnum,naxis)o(,na)o(xes,)f(>)48
-b(status\))382 2776 y(FTGTDM\(unit,colnum,maxdi)o(m,)41
-b(>)48 b(naxis,naxes,status\))382 2889 y(FTDTDM\(unit,tdimstr,coln)o
-(um,)o(maxd)o(im,)41 b(>)48 b(naxis,naxes,)c(status\))382
-3002 y(FFGRSZ\(unit,)g(>)k(nrows,status\))0 3266 y Fi(Lo)m(w-Lev)m(el)
-31 b(T)-8 b(able)30 b(Access)i(Subroutines:)38 b(page)31
-b(82)382 3530 y Fe(FTGTBS\(unit,frow,startch)o(ar,)o(ncha)o(rs,)41
-b(>)48 b(string,status\))382 3643 y(FTPTBS\(unit,frow,startch)o(ar,)o
-(ncha)o(rs,s)o(tri)o(ng,)41 b(>)48 b(status\))382 3756
+382 1684 y(FTG3D[BIJED]\(unit,group,)o(nul)o(lval)o(,dim)o(1,d)o(im2,)o
+(naxi)o(s1,)o(naxi)o(s2,n)o(axi)o(s3,)41 b(>)1002 1797
+y(cube,anyf,status\))382 1910 y(FTPSS[BIJED]\(unit,group,)o(nax)o(is,n)
+o(axes)o(,fp)o(ixel)o(s,lp)o(ixe)o(ls,a)o(rray)o(,)h(>)47
+b(status\))382 2023 y(FTGSV[BIJED]\(unit,group,)o(nax)o(is,n)o(axes)o
+(,fp)o(ixel)o(s,lp)o(ixe)o(ls,i)o(ncs,)o(nul)o(lval)o(,)42
+b(>)1002 2136 y(array,anyf,status\))382 2249 y
+(FTGSF[BIJED]\(unit,group,)o(nax)o(is,n)o(axes)o(,fp)o(ixel)o(s,lp)o
+(ixe)o(ls,i)o(ncs,)f(>)1002 2362 y(array,flagvals,anyf,statu)o(s\))0
+2648 y Fi(T)-8 b(able)30 b(Column)e(Information)i(Subroutines:)38
+b(page)31 b(88)382 2935 y Fe(FTGNRW\(unit,)44 b(>)k(nrows,)e(status\))
+382 3048 y(FTGNCL\(unit,)e(>)k(ncols,)e(status\))382
+3161 y(FTGCNO\(unit,casesen,colt)o(emp)o(late)o(,)c(>)47
+b(colnum,status\))382 3274 y(FTGCNN\(unit,casesen,colt)o(emp)o(late)o
+(,)42 b(>)47 b(colnam,colnum,status\))382 3386 y(FTGTCL\(unit,colnum,)
+42 b(>)48 b(datacode,repeat,width,st)o(atu)o(s\))382
+3499 y(FTEQTY\(unit,colnum,)42 b(>)48 b(datacode,repeat,width,st)o(atu)
+o(s\))382 3612 y(FTGCDW\(unit,colnum,)42 b(>)48 b(dispwidth,status\))
+382 3725 y(FTGACL\(unit,colnum,)42 b(>)716 3838 y
+(ttype,tbcol,tunit,tform,)o(tsca)o(l,t)o(zero)o(,snu)o(ll,)o(tdis)o
+(p,st)o(atu)o(s\))382 3951 y(FTGBCL\(unit,colnum,)g(>)716
+4064 y(ttype,tunit,datatype,rep)o(eat,)o(tsc)o(al,t)o(zero)o(,tn)o
+(ull,)o(tdis)o(p,s)o(tatu)o(s\))382 4177 y(FTPTDM\(unit,colnum,naxis)o
+(,na)o(xes,)f(>)48 b(status\))382 4290 y(FTGTDM\(unit,colnum,maxdi)o
+(m,)41 b(>)48 b(naxis,naxes,status\))382 4403 y
+(FTDTDM\(unit,tdimstr,coln)o(um,)o(maxd)o(im,)41 b(>)48
+b(naxis,naxes,)c(status\))382 4516 y(FFGRSZ\(unit,)g(>)k
+(nrows,status\))0 4802 y Fi(Lo)m(w-Lev)m(el)31 b(T)-8
+b(able)30 b(Access)i(Subroutines:)38 b(page)31 b(91)382
+5089 y Fe(FTGTBS\(unit,frow,startch)o(ar,)o(ncha)o(rs,)41
+b(>)48 b(string,status\))382 5202 y(FTPTBS\(unit,frow,startch)o(ar,)o
+(ncha)o(rs,s)o(tri)o(ng,)41 b(>)48 b(status\))382 5314
 y(FTGTBB\(unit,frow,startch)o(ar,)o(ncha)o(rs,)41 b(>)48
-b(array,status\))382 3868 y(FTPTBB\(unit,frow,startch)o(ar,)o(ncha)o
-(rs,a)o(rra)o(y,)42 b(>)47 b(status\))0 4132 y Fi(Edit)29
-b(Ro)m(ws)i(or)f(Columns)f(page)i(83)382 4396 y Fe
-(FTIROW\(unit,frow,nrows,)41 b(>)48 b(status\))382 4509
-y(FTDROW\(unit,frow,nrows,)41 b(>)48 b(status\))382 4622
-y(FTDRWS\(unit,rowlist,nrow)o(s,)41 b(>)48 b(status\))382
-4735 y(FTICOL\(unit,colnum,ttype)o(,tf)o(orm,)41 b(>)48
-b(status\))382 4848 y(FTICLS\(unit,colnum,ncols)o(,tt)o(ype,)o(tfor)o
-(m,)41 b(>)48 b(status\))382 4961 y(FTMVEC\(unit,colnum,newve)o(cle)o
-(n,)42 b(>)47 b(status\))382 5073 y(FTDCOL\(unit,colnum,)42
-b(>)48 b(status\))382 5186 y(FTCPCL\(inunit,outunit,in)o(col)o(num,)o
-(outc)o(oln)o(um,c)o(reat)o(eco)o(l,)42 b(>)47 b(status\);)0
-5450 y Fi(Read)31 b(and)e(W)-8 b(rite)31 b(Column)e(Data)j(Routines)d
-(page)i(84)382 5714 y Fe(FTPCL[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o(ow,f)
-o(ele)o(m,ne)o(leme)o(nts)o(,val)o(ues,)41 b(>)47 b(status\))p
-eop
-%%Page: 104 110
-104 109 bop 0 299 a Fi(104)327 b Fg(CHAPTER)30 b(9.)111
+b(array,status\))382 5427 y(FTPTBB\(unit,frow,startch)o(ar,)o(ncha)o
+(rs,a)o(rra)o(y,)42 b(>)47 b(status\))0 5714 y Fi(Edit)29
+b(Ro)m(ws)i(or)f(Columns)f(page)i(92)p eop
+%%Page: 114 120
+114 119 bop 0 299 a Fi(114)281 b Fg(CHAPTER)30 b(10.)112
 b(SUMMAR)-8 b(Y)32 b(OF)e(ALL)g(FITSIO)f(USER-INTERF)-10
-b(A)m(CE)30 b(SUBR)m(OUTINES)382 555 y Fe(FTPCN[BIJED]\(unit,colnum)o
-(,fr)o(ow,f)o(elem)o(,ne)o(leme)o(nts,)o(val)o(ues,)o(null)o(val)41
-b(>)48 b(status\))382 668 y(FTPCLX\(unit,colnum,frow,)o(fbi)o(t,nb)o
-(it,l)o(ray)o(,)42 b(>)47 b(status\))382 781 y
-(FTPCLU\(unit,colnum,frow,)o(fel)o(em,n)o(elem)o(ent)o(s,)42
-b(>)47 b(status\))382 894 y(FTGCL\(unit,colnum,frow,f)o(ele)o(m,ne)o
-(leme)o(nts)o(,)42 b(>)47 b(values,status\))382 1007
-y(FTGCV[SBIJEDCM]\(unit,col)o(num)o(,fro)o(w,fe)o(lem)o(,nel)o(emen)o
-(ts,)o(null)o(val,)41 b(>)1098 1120 y(values,anyf,status\))382
-1233 y(FTGCF[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o(ow,f)o(ele)o(m,ne)o
-(leme)o(nts)o(,)h(>)1193 1346 y(values,flagvals,anyf,stat)o(us\))382
-1458 y(FTGSV[BIJED]\(unit,colnum)o(,na)o(xis,)o(naxe)o(s,f)o(pixe)o
+b(A)m(CE)30 b(SUBR)m(OUTINES)382 555 y Fe(FTIROW\(unit,frow,nrows,)41
+b(>)48 b(status\))382 668 y(FTDROW\(unit,frow,nrows,)41
+b(>)48 b(status\))382 781 y(FTDRRG\(unit,rowrange,)42
+b(>)47 b(status\))382 894 y(FTDRWS\(unit,rowlist,nrow)o(s,)41
+b(>)48 b(status\))382 1007 y(FTICOL\(unit,colnum,ttype)o(,tf)o(orm,)41
+b(>)48 b(status\))382 1120 y(FTICLS\(unit,colnum,ncols)o(,tt)o(ype,)o
+(tfor)o(m,)41 b(>)48 b(status\))382 1233 y(FTMVEC\(unit,colnum,newve)o
+(cle)o(n,)42 b(>)47 b(status\))382 1346 y(FTDCOL\(unit,colnum,)42
+b(>)48 b(status\))382 1458 y(FTCPCL\(inunit,outunit,in)o(col)o(num,)o
+(outc)o(oln)o(um,c)o(reat)o(eco)o(l,)42 b(>)47 b(status\);)0
+1716 y Fi(Read)31 b(and)e(W)-8 b(rite)31 b(Column)e(Data)j(Routines)d
+(page)i(93)382 1974 y Fe(FTPCL[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o(ow,f)
+o(ele)o(m,ne)o(leme)o(nts)o(,val)o(ues,)41 b(>)47 b(status\))382
+2087 y(FTPCN[BIJED]\(unit,colnum)o(,fr)o(ow,f)o(elem)o(,ne)o(leme)o
+(nts,)o(val)o(ues,)o(null)o(val)41 b(>)48 b(status\))382
+2199 y(FTPCLX\(unit,colnum,frow,)o(fbi)o(t,nb)o(it,l)o(ray)o(,)42
+b(>)47 b(status\))382 2312 y(FTPCLU\(unit,colnum,frow,)o(fel)o(em,n)o
+(elem)o(ent)o(s,)42 b(>)47 b(status\))382 2425 y
+(FTGCL\(unit,colnum,frow,f)o(ele)o(m,ne)o(leme)o(nts)o(,)42
+b(>)47 b(values,status\))382 2538 y(FTGCV[SBIJEDCM]\(unit,col)o(num)o
+(,fro)o(w,fe)o(lem)o(,nel)o(emen)o(ts,)o(null)o(val,)41
+b(>)1098 2651 y(values,anyf,status\))382 2764 y
+(FTGCF[SLBIJEDCM]\(unit,co)o(lnu)o(m,fr)o(ow,f)o(ele)o(m,ne)o(leme)o
+(nts)o(,)h(>)1193 2877 y(values,flagvals,anyf,stat)o(us\))382
+2990 y(FTGSV[BIJED]\(unit,colnum)o(,na)o(xis,)o(naxe)o(s,f)o(pixe)o
 (ls,l)o(pix)o(els,)o(incs)o(,nu)o(llva)o(l,)g(>)1002
-1571 y(array,anyf,status\))382 1684 y(FTGSF[BIJED]\(unit,colnum)o(,na)o
+3103 y(array,anyf,status\))382 3216 y(FTGSF[BIJED]\(unit,colnum)o(,na)o
 (xis,)o(naxe)o(s,f)o(pixe)o(ls,l)o(pix)o(els,)o(incs)o(,)g(>)1002
-1797 y(array,flagvals,anyf,statu)o(s\))382 1910 y
+3329 y(array,flagvals,anyf,statu)o(s\))382 3441 y
 (FTGCX\(unit,colnum,frow,f)o(bit)o(,nbi)o(t,)g(>)47 b(lray,status\))382
-2023 y(FTGCX[IJD]\(unit,colnum,f)o(row)o(,nro)o(ws,f)o(bit)o(,nbi)o(t,)
-42 b(>)47 b(array,status\))382 2136 y(FTGDES\(unit,colnum,rownu)o(m,)41
-b(>)48 b(nelements,offset,status\))382 2249 y
+3554 y(FTGCX[IJD]\(unit,colnum,f)o(row)o(,nro)o(ws,f)o(bit)o(,nbi)o(t,)
+42 b(>)47 b(array,status\))382 3667 y(FTGDES\(unit,colnum,rownu)o(m,)41
+b(>)48 b(nelements,offset,status\))382 3780 y
 (FTPDES\(unit,colnum,rownu)o(m,n)o(elem)o(ents)o(,of)o(fset)o(,)42
-b(>)47 b(status\))0 2506 y Fi(Ro)m(w)31 b(Selection)f(and)f(Calculator)
-h(Routines:)40 b(page)31 b(87)382 2764 y Fe(FTFROW\(unit,expr,firstro)o
+b(>)47 b(status\))0 4038 y Fi(Ro)m(w)31 b(Selection)f(and)f(Calculator)
+h(Routines:)40 b(page)31 b(96)382 4295 y Fe(FTFROW\(unit,expr,firstro)o
 (w,)41 b(nrows,)47 b(>)g(n_good_rows,)d(row_status,)h(status\))382
-2877 y(FTFFRW\(unit,)f(expr,)j(>)g(rownum,)f(status\))382
-2990 y(FTSROW\(inunit,)e(outunit,)h(expr,)i(>)g(status)f(\))382
-3103 y(FTCROW\(unit,datatype,exp)o(r,f)o(irst)o(row,)o(nel)o(emen)o
-(ts,n)o(ulv)o(al,)41 b(>)620 3216 y(array,anynul,status\))382
-3329 y(FTCALC\(inunit,)j(expr,)i(outunit,)g(parName,)f(parInfo,)h(>)h
-(status\))382 3441 y(FTCALC_RNG\(inunit,)c(expr,)j(outunit,)g(parName,)
-f(parInfo,)573 3554 y(nranges,)g(firstrow,)h(lastrow,)f(>)j(status\))
-382 3667 y(FTTEXP\(unit,)c(expr,)j(>)g(datatype,)e(nelem,)h(naxis,)h
-(naxes,)f(status\))0 3925 y Fi(Celestial)29 b(Co)s(ordinate)h(System)g
-(Subroutines:)38 b(page)31 b(89)382 4183 y Fe(FTGICS\(unit,)44
+4408 y(FTFFRW\(unit,)f(expr,)j(>)g(rownum,)f(status\))382
+4521 y(FTSROW\(inunit,)e(outunit,)h(expr,)i(>)g(status)f(\))382
+4634 y(FTCROW\(unit,datatype,exp)o(r,f)o(irst)o(row,)o(nel)o(emen)o
+(ts,n)o(ulv)o(al,)41 b(>)620 4747 y(array,anynul,status\))382
+4860 y(FTCALC\(inunit,)j(expr,)i(outunit,)g(parName,)f(parInfo,)h(>)h
+(status\))382 4973 y(FTCALC_RNG\(inunit,)c(expr,)j(outunit,)g(parName,)
+f(parInfo,)573 5086 y(nranges,)g(firstrow,)h(lastrow,)f(>)j(status\))
+382 5199 y(FTTEXP\(unit,)c(expr,)j(>)g(datatype,)e(nelem,)h(naxis,)h
+(naxes,)f(status\))0 5456 y Fi(Celestial)29 b(Co)s(ordinate)h(System)g
+(Subroutines:)38 b(page)31 b(98)382 5714 y Fe(FTGICS\(unit,)44
 b(>)k(xrval,yrval,xrpix,yrpix)o(,xin)o(c,yi)o(nc,)o(rot,)o(coor)o(dty)o
-(pe,s)o(tatu)o(s\))382 4295 y(FTGTCS\(unit,xcol,ycol,)42
-b(>)716 4408 y(xrval,yrval,xrpix,yrpix,)o(xinc)o(,yi)o(nc,r)o(ot,c)o
-(oor)o(dtyp)o(e,st)o(atu)o(s\))382 4521 y(FTWLDP\(xpix,ypix,xrval,y)o
+(pe,s)o(tatu)o(s\))p eop
+%%Page: 115 121
+115 120 bop 3764 299 a Fi(115)382 555 y Fe(FTGTCS\(unit,xcol,ycol,)42
+b(>)716 668 y(xrval,yrval,xrpix,yrpix,)o(xinc)o(,yi)o(nc,r)o(ot,c)o
+(oor)o(dtyp)o(e,st)o(atu)o(s\))382 781 y(FTWLDP\(xpix,ypix,xrval,y)o
 (rva)o(l,xr)o(pix,)o(yrp)o(ix,x)o(inc,)o(yin)o(c,ro)o(t,)1241
-4634 y(coordtype,)j(>)i(xpos,ypos,status\))382 4747 y
+894 y(coordtype,)j(>)i(xpos,ypos,status\))382 1007 y
 (FTXYPX\(xpos,ypos,xrval,y)o(rva)o(l,xr)o(pix,)o(yrp)o(ix,x)o(inc,)o
-(yin)o(c,ro)o(t,)1241 4860 y(coordtype,)e(>)i(xpix,ypix,status\))0
-5118 y Fi(File)30 b(Chec)m(ksum)f(Subroutines:)39 b(page)31
-b(90)382 5375 y Fe(FTPCKS\(unit,)44 b(>)k(status\))382
-5488 y(FTUCKS\(unit,)c(>)k(status\))382 5601 y(FTVCKS\(unit,)c(>)k
-(dataok,hduok,status\))382 5714 y(FTGCKS\(unit,)c(>)k
-(datasum,hdusum,status\))p eop
-%%Page: 105 111
-105 110 bop 3764 299 a Fi(105)382 555 y Fe(FTESUM\(sum,complement,)42
-b(>)47 b(checksum\))382 668 y(FTDSUM\(checksum,compleme)o(nt,)41
-b(>)48 b(sum\))0 1041 y Fi(Time)29 b(and)h(Date)i(Utilit)m(y)e
-(Subroutines:)38 b(page)31 b(91)382 1301 y Fe(FTGSDT\()46
-b(>)h(day,)g(month,)f(year,)g(status)g(\))382 1413 y(FTGSTM\(>)f
-(datestr,)h(timeref,)f(status\))382 1526 y(FTDT2S\()h(year,)g(month,)g
-(day,)h(>)g(datestr,)f(status\))382 1639 y(FTTM2S\()g(year,)g(month,)g
-(day,)h(hour,)f(minute,)g(second,)g(decimals,)764 1752
-y(>)h(datestr,)f(status\))382 1865 y(FTS2DT\(datestr,)d(>)48
-b(year,)e(month,)g(day,)h(status\))382 1978 y(FTS2TM\(datestr,)c(>)48
+(yin)o(c,ro)o(t,)1241 1120 y(coordtype,)e(>)i(xpix,ypix,status\))0
+1340 y Fi(File)30 b(Chec)m(ksum)f(Subroutines:)39 b(page)31
+b(99)382 1560 y Fe(FTPCKS\(unit,)44 b(>)k(status\))382
+1673 y(FTUCKS\(unit,)c(>)k(status\))382 1785 y(FTVCKS\(unit,)c(>)k
+(dataok,hduok,status\))382 1898 y(FTGCKS\(unit,)c(>)k
+(datasum,hdusum,status\))382 2011 y(FTESUM\(sum,complement,)42
+b(>)47 b(checksum\))382 2124 y(FTDSUM\(checksum,compleme)o(nt,)41
+b(>)48 b(sum\))0 2457 y Fi(Time)29 b(and)h(Date)i(Utilit)m(y)e
+(Subroutines:)38 b(page)31 b(101)382 2677 y Fe(FTGSDT\()46
+b(>)h(day,)g(month,)f(year,)g(status)g(\))382 2790 y(FTGSTM\(>)f
+(datestr,)h(timeref,)f(status\))382 2903 y(FTDT2S\()h(year,)g(month,)g
+(day,)h(>)g(datestr,)f(status\))382 3016 y(FTTM2S\()g(year,)g(month,)g
+(day,)h(hour,)f(minute,)g(second,)g(decimals,)764 3129
+y(>)h(datestr,)f(status\))382 3242 y(FTS2DT\(datestr,)d(>)48
+b(year,)e(month,)g(day,)h(status\))382 3354 y(FTS2TM\(datestr,)c(>)48
 b(year,)e(month,)g(day,)h(hour,)f(minute,)g(second,)g(status\))0
-2238 y Fi(General)30 b(Utilit)m(y)g(Subroutines:)38 b(page)31
-b(92)382 2498 y Fe(FTGHAD\(unit,)44 b(>)k(curaddr,nextaddr\))382
-2611 y(FTUPCH\(string\))382 2723 y(FTCMPS\(str_template,stri)o(ng,)o
-(case)o(sen,)41 b(>)47 b(match,exact\))382 2836 y(FTTKEY\(keyword,)c(>)
-48 b(status\))382 2949 y(FTTREC\(card,)c(>)k(status\))382
-3062 y(FTNCHK\(unit,)c(>)k(status\))382 3175 y(FTGKNM\(unit,)c(>)k
-(keyword,)d(keylength,)g(status\))382 3288 y(FTPSVC\(card,)f(>)k
-(value,comment,status\))382 3401 y(FTKEYN\(keyroot,seq_no,)42
-b(>)47 b(keyword,status\))382 3514 y(FTNKEY\(seq_no,keyroot,)42
-b(>)47 b(keyword,status\))382 3627 y(FTDTYP\(value,)d(>)j
-(dtype,status\))382 3740 y(class)f(=)i(FTGKCL\(card\))382
-3853 y(FTASFM\(tform,)c(>)j(datacode,width,decimals,st)o(atus)o(\))382
-3965 y(FTBNFM\(tform,)d(>)j(datacode,repeat,width,stat)o(us\))382
-4078 y(FTGABC\(tfields,tform,spa)o(ce,)41 b(>)48 b
-(rowlen,tbcol,status\))382 4191 y(FTGTHD\(template,)43
-b(>)48 b(card,hdtype,status\))p eop
-%%Page: 106 112
-106 111 bop 0 299 a Fi(106)327 b Fg(CHAPTER)30 b(9.)111
+3574 y Fi(General)30 b(Utilit)m(y)g(Subroutines:)38 b(page)31
+b(102)382 3794 y Fe(FTGHAD\(unit,)44 b(>)k(curaddr,nextaddr\))382
+3907 y(FTUPCH\(string\))382 4020 y(FTCMPS\(str_template,stri)o(ng,)o
+(case)o(sen,)41 b(>)47 b(match,exact\))382 4133 y(FTTKEY\(keyword,)c(>)
+48 b(status\))382 4246 y(FTTREC\(card,)c(>)k(status\))382
+4359 y(FTNCHK\(unit,)c(>)k(status\))382 4472 y(FTGKNM\(unit,)c(>)k
+(keyword,)d(keylength,)g(status\))382 4585 y(FTPSVC\(card,)f(>)k
+(value,comment,status\))382 4698 y(FTKEYN\(keyroot,seq_no,)42
+b(>)47 b(keyword,status\))382 4811 y(FTNKEY\(seq_no,keyroot,)42
+b(>)47 b(keyword,status\))382 4924 y(FTDTYP\(value,)d(>)j
+(dtype,status\))382 5036 y(class)f(=)i(FTGKCL\(card\))382
+5149 y(FTASFM\(tform,)c(>)j(datacode,width,decimals,st)o(atus)o(\))382
+5262 y(FTBNFM\(tform,)d(>)j(datacode,repeat,width,stat)o(us\))382
+5375 y(FTGABC\(tfields,tform,spa)o(ce,)41 b(>)48 b
+(rowlen,tbcol,status\))382 5488 y(FTGTHD\(template,)43
+b(>)48 b(card,hdtype,status\))382 5601 y(FTRWRG\(rowlist,)43
+b(maxrows,)j(maxranges,)f(>)i(numranges,)e(rangemin,)716
+5714 y(rangemax,)g(status\))p eop
+%%Page: 116 122
+116 121 bop 0 299 a Fi(116)281 b Fg(CHAPTER)30 b(10.)112
 b(SUMMAR)-8 b(Y)32 b(OF)e(ALL)g(FITSIO)f(USER-INTERF)-10
 b(A)m(CE)30 b(SUBR)m(OUTINES)p eop
-%%Page: 107 113
-107 112 bop 0 1225 a Ff(Chapter)65 b(10)0 1687 y Fl(P)-6
+%%Page: 117 123
+117 122 bop 0 1225 a Ff(Chapter)65 b(11)0 1687 y Fl(P)-6
 b(arameter)77 b(De\014nitions)0 2180 y Fe(anyf)47 b(-)g(\(logical\))e
 (set)i(to)g(TRUE)g(if)g(any)g(of)g(the)g(returned)f(data)g(values)h
 (are)f(undefined)0 2293 y(array)g(-)i(\(any)e(datatype)g(except)g
@@ -8729,10 +9388,10 @@ h(complement)e(checksum)h(for)h(the)f(data)h(unit)0 5454
 y(datatype)f(-)h(\(character\))e(datatype)g(\(format\))h(of)h(the)g
 (binary)f(table)g(column)0 5567 y(datestr)94 b(-)47 b(\(string\))f
 (FITS)g(date/time)f(string:)h('YYYY-MM-DDThh:mm:ss.ddd')o(,)525
-5680 y('YYYY-MM-dd',)e(or)j('dd/mm/yy')1882 5942 y Fi(107)p
+5680 y('YYYY-MM-dd',)e(or)j('dd/mm/yy')1882 5942 y Fi(117)p
 eop
-%%Page: 108 114
-108 113 bop 0 299 a Fi(108)1779 b Fg(CHAPTER)30 b(10.)112
+%%Page: 118 124
+118 123 bop 0 299 a Fi(118)1779 b Fg(CHAPTER)30 b(11.)112
 b(P)-8 b(ARAMETER)30 b(DEFINITIONS)0 555 y Fe(day)47
 b(-)g(\(integer\))f(current)f(day)i(of)h(the)e(month)0
 668 y(dblval)g(-)i(\(double)d(precision\))g(fractional)g(part)i(of)g
@@ -8754,199 +9413,201 @@ y(casesen)f(-)h(\(logical\))f(true)g(if)h(column)f(name)h(matching)f
 (is)h(case)f(sensitive)0 2136 y(exact)g(-)i(\(logical\))d(do)i(the)g
 (strings)f(match)g(exactly,)g(or)h(were)g(wildcards)e(used?)0
 2249 y(exclist)94 b(\(character)45 b(array\))h(list)g(of)h(names)g(to)g
-(be)g(excluded)f(from)g(search)0 2362 y(extend)g(-)i(\(logical\))d
-(true)h(if)i(there)e(may)h(be)g(extensions)e(following)g(the)i(primary)
-f(data)0 2475 y(extname)g(-)h(\(character\))e(value)h(of)i(the)e
-(EXTNAME)g(keyword)g(\(if)h(not)g(blank\))0 2588 y(fbit)g(-)g
-(\(integer\))e(first)i(bit)g(in)g(the)g(field)f(to)h(be)g(read)g(or)g
-(written)0 2700 y(felem)f(-)i(\(integer\))d(first)h(pixel)h(of)g(the)g
-(element)f(vector)g(\(ignored)f(for)i(ASCII)g(tables\))0
-2813 y(filename)f(-)h(\(character\))e(name)h(of)i(the)e(FITS)h(file)0
-2926 y(flagvals)f(-)h(\(logical)f(array\))g(True)g(if)h(corresponding)e
-(data)h(element)g(is)h(undefined)0 3039 y(fparm)f(-)i(\(integer\))d
+(be)g(excluded)f(from)g(search)0 2362 y(exists)142 b(-)47
+b(flag)g(indicating)e(whether)g(the)i(file)g(or)g(compressed)e(file)i
+(exists)f(on)h(disk)0 2475 y(extend)f(-)i(\(logical\))d(true)h(if)i
+(there)e(may)h(be)g(extensions)e(following)g(the)i(primary)f(data)0
+2588 y(extname)g(-)h(\(character\))e(value)h(of)i(the)e(EXTNAME)g
+(keyword)g(\(if)h(not)g(blank\))0 2700 y(fbit)g(-)g(\(integer\))e
+(first)i(bit)g(in)g(the)g(field)f(to)h(be)g(read)g(or)g(written)0
+2813 y(felem)f(-)i(\(integer\))d(first)h(pixel)h(of)g(the)g(element)f
+(vector)g(\(ignored)f(for)i(ASCII)g(tables\))0 2926 y(filename)f(-)h
+(\(character\))e(name)h(of)i(the)e(FITS)h(file)0 3039
+y(flagvals)f(-)h(\(logical)f(array\))g(True)g(if)h(corresponding)e
+(data)h(element)g(is)h(undefined)0 3152 y(fparm)f(-)i(\(integer\))d
 (sequence)h(number)g(of)h(the)g(first)f(group)h(parameter)e(to)i(read)g
-(or)g(write)0 3152 y(fpixel)f(-)i(\(integer\))d(the)i(first)f(pixel)g
-(position)0 3265 y(fpixels)g(-)h(\(integer)f(array\))g(the)h(first)f
-(included)g(pixel)g(in)h(each)g(dimension)0 3378 y(frow)g(-)g
+(or)g(write)0 3265 y(fpixel)f(-)i(\(integer\))d(the)i(first)f(pixel)g
+(position)0 3378 y(fpixels)g(-)h(\(integer)f(array\))g(the)h(first)f
+(included)g(pixel)g(in)h(each)g(dimension)0 3491 y(frow)g(-)g
 (\(integer\))e(beginning)h(row)h(number)f(\(first)g(row)h(of)g(table)f
-(=)i(1\))0 3491 y(gcount)e(-)i(\(integer\))d(value)h(of)h(the)g(GCOUNT)
-f(keyword)g(\(usually)g(=)h(1\))0 3604 y(group)f(-)i(\(integer\))d
+(=)i(1\))0 3604 y(gcount)e(-)i(\(integer\))d(value)h(of)h(the)g(GCOUNT)
+f(keyword)g(\(usually)g(=)h(1\))0 3717 y(group)f(-)i(\(integer\))d
 (sequence)h(number)g(of)h(the)g(data)f(group)h(\(=0)g(for)g
-(non-grouped)d(data\))0 3717 y(hdtype)i(-)i(\(integer\))d(header)h
+(non-grouped)d(data\))0 3830 y(hdtype)i(-)i(\(integer\))d(header)h
 (record)g(type:)g(-1=delete;)93 b(0=append)46 b(or)h(replace;)907
-3830 y(1=append;)e(2=this)h(is)h(the)g(END)g(keyword)0
-3942 y(hduok)f(-)i(\(integer\))d(was)i(the)g(HDU)g(verification)d
-(successful)h(\(=1\))i(or)430 4055 y(not)f(\(=)i(-1\).)94
+3942 y(1=append;)e(2=this)h(is)h(the)g(END)g(keyword)0
+4055 y(hduok)f(-)i(\(integer\))d(was)i(the)g(HDU)g(verification)d
+(successful)h(\(=1\))i(or)430 4168 y(not)f(\(=)i(-1\).)94
 b(Equals)46 b(zero)h(if)g(the)g(CHECKSUM)e(keyword)h(is)h(not)g
-(present.)0 4168 y(hdusum)f(-)i(\(double)d(precsion\))h(32)h(bit)g(1's)
-g(complement)e(checksum)g(for)i(the)g(entire)f(CHDU)0
-4281 y(hdutype)g(-)h(\(integer\))f(type)g(of)h(HDU:)g(0)g(=)h(primary)e
-(array)g(or)h(IMAGE,)f(1)i(=)f(ASCII)g(table,)907 4394
-y(2)g(=)h(binary)e(table,)g(-1)h(=)h(unknown)0 4507 y(history)e(-)h
+(present.)0 4281 y(hdusum)f(-)i(\(double)d(precision\))g(32)j(bit)e
+(1's)h(complement)e(checksum)h(for)h(the)g(entire)f(CHDU)0
+4394 y(hdutype)g(-)h(\(integer\))f(type)g(of)h(HDU:)g(0)g(=)h(primary)e
+(array)g(or)h(IMAGE,)f(1)i(=)f(ASCII)g(table,)907 4507
+y(2)g(=)h(binary)e(table,)g(-1)h(=)h(unknown)0 4620 y(history)e(-)h
 (\(character\))e(the)i(HISTORY)f(keyword)g(comment)f(string)0
-4620 y(hour)i(-)g(\(integer\))e(hour)i(from)g(0)g(-)h(23)0
-4733 y(image)e(-)i(2D)f(image)f(of)i(the)e(appropriate)f(datatype)0
-4846 y(inclist)94 b(\(character)45 b(array\))h(list)g(of)h(names)g(to)g
-(be)g(included)f(in)h(search)0 4959 y(incs)g(-)g(\(integer)f(array\))g
+4733 y(hour)i(-)g(\(integer\))e(hour)i(from)g(0)g(-)h(23)0
+4846 y(image)e(-)i(2D)f(image)f(of)i(the)e(appropriate)f(datatype)0
+4959 y(inclist)94 b(\(character)45 b(array\))h(list)g(of)h(names)g(to)g
+(be)g(included)f(in)h(search)0 5072 y(incs)g(-)g(\(integer)f(array\))g
 (sampling)f(interval)h(for)h(pixels)f(in)h(each)g(FITS)f(dimension)0
-5072 y(intval)g(-)i(\(integer\))d(integer)h(part)g(of)h(the)g(keyword)f
-(value)0 5185 y(iounit)g(-)i(\(integer\))d(value)h(of)h(an)h(unused)e
-(I/O)h(unit)f(number)0 5297 y(iunit)g(-)i(\(integer\))d(logical)h(unit)
+5185 y(intval)g(-)i(\(integer\))d(integer)h(part)g(of)h(the)g(keyword)f
+(value)0 5297 y(iounit)g(-)i(\(integer\))d(value)h(of)h(an)h(unused)e
+(I/O)h(unit)f(number)0 5410 y(iunit)g(-)i(\(integer\))d(logical)h(unit)
 h(number)f(associated)f(with)h(the)h(input)g(FITS)f(file,)h(1-199)0
-5410 y(key_no)f(-)i(\(integer\))d(sequence)g(number)h(\(starting)g
-(with)g(1\))i(of)f(the)g(keyword)e(record)0 5523 y(keylength)g(-)j
-(\(integer\))d(length)h(of)h(the)g(keyword)f(name)0 5636
-y(keyroot)g(-)h(\(character\))e(root)i(string)f(for)h(the)g(keyword)e
-(name)p eop
-%%Page: 109 115
-109 114 bop 3764 299 a Fi(109)0 555 y Fe(keysadd)46 b(-\(integer\))f
-(number)h(of)h(new)g(keyword)f(records)g(which)g(can)h(fit)g(in)g(the)g
-(CHU)0 668 y(keysexist)e(-)j(\(integer\))d(number)h(of)h(existing)f
-(keyword)g(records)f(in)j(the)f(CHU)0 781 y(keyval)f(-)i(value)e(of)h
-(the)g(keyword)f(in)h(the)g(appropriate)e(datatype)0
-894 y(keyvals)h(-)h(\(array\))f(value)g(of)i(the)f(keywords)e(in)i(the)
-g(appropriate)e(datatype)0 1007 y(keyword)h(-)h(\(character*8\))d(name)
-j(of)g(a)h(keyword)0 1120 y(lray)f(-)g(\(logical)f(array\))g(array)g
-(of)h(logical)f(values)g(corresponding)e(to)k(the)e(bit)h(array)0
-1233 y(lpixels)f(-)h(\(integer)f(array\))g(the)h(last)f(included)g
-(pixel)g(in)i(each)e(dimension)0 1346 y(match)g(-)i(\(logical\))d(do)i
-(the)g(2)h(strings)d(match?)0 1458 y(maxdim)h(-)i(\(integer\))d
-(dimensioned)g(size)h(of)h(the)g(NAXES,)f(TTYPE,)g(TFORM)h(or)g(TUNIT)f
-(arrays)0 1571 y(max_keys)g(-)h(\(integer\))e(maximum)h(number)g(of)h
-(keywords)f(to)h(search)f(for)0 1684 y(minute)g(-)i(\(integer\))d
-(minute)h(of)h(an)g(hour)g(\(0)g(-)h(59\))0 1797 y(month)e(-)i
-(\(integer\))d(current)h(month)g(of)h(the)g(year)g(\(1)g(-)h(12\))0
-1910 y(morekeys)e(-)h(\(integer\))e(will)i(leave)f(space)h(in)g(the)g
-(header)f(for)h(this)f(many)h(more)g(keywords)0 2023
-y(naxes)f(-)i(\(integer)d(array\))h(size)h(of)g(each)g(dimension)e(in)i
-(the)g(FITS)g(array)0 2136 y(naxis)f(-)i(\(integer\))d(number)h(of)h
-(dimensions)e(in)j(the)e(FITS)h(array)0 2249 y(naxis1)f(-)i
-(\(integer\))d(length)h(of)h(the)g(X/first)f(axis)g(of)i(the)f(FITS)f
-(array)0 2362 y(naxis2)g(-)i(\(integer\))d(length)h(of)h(the)g
-(Y/second)f(axis)g(of)h(the)g(FITS)g(array)0 2475 y(naxis3)f(-)i
-(\(integer\))d(length)h(of)h(the)g(Z/third)f(axis)g(of)i(the)f(FITS)f
-(array)0 2588 y(nbit)h(-)g(\(integer\))e(number)h(of)i(bits)e(in)h(the)
-g(field)g(to)g(read)g(or)g(write)0 2700 y(nchars)f(-)i(\(integer\))d
-(number)h(of)h(characters)e(to)i(read)g(and)g(return)0
-2813 y(ncols)f(-)i(\(integer\))d(number)h(of)h(columns)0
-2926 y(nelements)e(-)j(\(integer\))d(number)h(of)h(data)g(elements)e
-(to)j(read)e(or)h(write)0 3039 y(nexc)142 b(\(integer\))93
-b(number)46 b(of)h(names)g(in)g(the)g(exclusion)e(list)i(\(may)f(=)i
-(0\))0 3152 y(nhdu)f(-)g(\(integer\))e(absolute)h(number)g(of)h(the)g
-(HDU)g(\(1st)g(HDU)g(=)g(1\))0 3265 y(ninc)142 b(\(integer\))93
-b(number)46 b(of)h(names)g(in)g(the)g(inclusion)e(list)0
-3378 y(nmove)h(-)i(\(integer\))d(number)h(of)h(HDUs)g(to)g(move)g(\(+)g
-(or)g(-\),)g(relative)f(to)h(current)f(position)0 3491
-y(nfound)g(-)i(\(integer\))d(number)h(of)h(keywords)f(found)g
-(\(highest)g(keyword)f(number\))0 3604 y(no_keys)h(-)h(\(integer\))f
-(number)g(of)h(keywords)e(to)j(write)e(in)h(the)g(sequence)0
-3717 y(nparm)f(-)i(\(integer\))d(number)h(of)h(group)g(parameters)e(to)
-i(read)g(or)g(write)0 3830 y(nrows)f(-)i(\(integer\))d(number)h(of)h
-(rows)g(in)g(the)g(table)0 3942 y(nullval)f(-)h(value)g(to)g(represent)
-e(undefined)g(pixels,)h(of)h(the)g(appropriate)e(datatype)0
-4055 y(nextaddr)h(-)h(\(integer\))e(starting)h(address)g(\(in)h
-(bytes\))f(of)h(the)g(HDU)g(following)e(the)i(CHDU)0
-4168 y(offset)f(-)i(\(integer\))d(byte)h(offset)h(in)g(the)g(heap)f(to)
-h(the)g(first)g(element)f(of)h(the)g(array)0 4281 y(oldkey)f(-)i
+5523 y(key_no)f(-)i(\(integer\))d(sequence)g(number)h(\(starting)g
+(with)g(1\))i(of)f(the)g(keyword)e(record)0 5636 y(keylength)g(-)j
+(\(integer\))d(length)h(of)h(the)g(keyword)f(name)p eop
+%%Page: 119 125
+119 124 bop 3764 299 a Fi(119)0 555 y Fe(keyroot)46 b(-)h
+(\(character\))e(root)i(string)f(for)h(the)g(keyword)e(name)0
+668 y(keysadd)h(-\(integer\))f(number)h(of)h(new)g(keyword)f(records)g
+(which)g(can)h(fit)g(in)g(the)g(CHU)0 781 y(keysexist)e(-)j
+(\(integer\))d(number)h(of)h(existing)f(keyword)g(records)f(in)j(the)f
+(CHU)0 894 y(keyval)f(-)i(value)e(of)h(the)g(keyword)f(in)h(the)g
+(appropriate)e(datatype)0 1007 y(keyvals)h(-)h(\(array\))f(value)g(of)i
+(the)f(keywords)e(in)i(the)g(appropriate)e(datatype)0
+1120 y(keyword)h(-)h(\(character*8\))d(name)j(of)g(a)h(keyword)0
+1233 y(lray)f(-)g(\(logical)f(array\))g(array)g(of)h(logical)f(values)g
+(corresponding)e(to)k(the)e(bit)h(array)0 1346 y(lpixels)f(-)h
+(\(integer)f(array\))g(the)h(last)f(included)g(pixel)g(in)i(each)e
+(dimension)0 1458 y(match)g(-)i(\(logical\))d(do)i(the)g(2)h(strings)d
+(match?)0 1571 y(maxdim)h(-)i(\(integer\))d(dimensioned)g(size)h(of)h
+(the)g(NAXES,)f(TTYPE,)g(TFORM)h(or)g(TUNIT)f(arrays)0
+1684 y(max_keys)g(-)h(\(integer\))e(maximum)h(number)g(of)h(keywords)f
+(to)h(search)f(for)0 1797 y(minute)g(-)i(\(integer\))d(minute)h(of)h
+(an)g(hour)g(\(0)g(-)h(59\))0 1910 y(month)e(-)i(\(integer\))d(current)
+h(month)g(of)h(the)g(year)g(\(1)g(-)h(12\))0 2023 y(morekeys)e(-)h
+(\(integer\))e(will)i(leave)f(space)h(in)g(the)g(header)f(for)h(this)f
+(many)h(more)g(keywords)0 2136 y(naxes)f(-)i(\(integer)d(array\))h
+(size)h(of)g(each)g(dimension)e(in)i(the)g(FITS)g(array)0
+2249 y(naxis)f(-)i(\(integer\))d(number)h(of)h(dimensions)e(in)j(the)e
+(FITS)h(array)0 2362 y(naxis1)f(-)i(\(integer\))d(length)h(of)h(the)g
+(X/first)f(axis)g(of)i(the)f(FITS)f(array)0 2475 y(naxis2)g(-)i
+(\(integer\))d(length)h(of)h(the)g(Y/second)f(axis)g(of)h(the)g(FITS)g
+(array)0 2588 y(naxis3)f(-)i(\(integer\))d(length)h(of)h(the)g(Z/third)
+f(axis)g(of)i(the)f(FITS)f(array)0 2700 y(nbit)h(-)g(\(integer\))e
+(number)h(of)i(bits)e(in)h(the)g(field)g(to)g(read)g(or)g(write)0
+2813 y(nchars)f(-)i(\(integer\))d(number)h(of)h(characters)e(to)i(read)
+g(and)g(return)0 2926 y(ncols)f(-)i(\(integer\))d(number)h(of)h
+(columns)0 3039 y(nelements)e(-)j(\(integer\))d(number)h(of)h(data)g
+(elements)e(to)j(read)e(or)h(write)0 3152 y(nexc)142
+b(\(integer\))93 b(number)46 b(of)h(names)g(in)g(the)g(exclusion)e
+(list)i(\(may)f(=)i(0\))0 3265 y(nhdu)f(-)g(\(integer\))e(absolute)h
+(number)g(of)h(the)g(HDU)g(\(1st)g(HDU)g(=)g(1\))0 3378
+y(ninc)142 b(\(integer\))93 b(number)46 b(of)h(names)g(in)g(the)g
+(inclusion)e(list)0 3491 y(nmove)h(-)i(\(integer\))d(number)h(of)h
+(HDUs)g(to)g(move)g(\(+)g(or)g(-\),)g(relative)f(to)h(current)f
+(position)0 3604 y(nfound)g(-)i(\(integer\))d(number)h(of)h(keywords)f
+(found)g(\(highest)g(keyword)f(number\))0 3717 y(no_keys)h(-)h
+(\(integer\))f(number)g(of)h(keywords)e(to)j(write)e(in)h(the)g
+(sequence)0 3830 y(nparm)f(-)i(\(integer\))d(number)h(of)h(group)g
+(parameters)e(to)i(read)g(or)g(write)0 3942 y(nrows)f(-)i(\(integer\))d
+(number)h(of)h(rows)g(in)g(the)g(table)0 4055 y(nullval)f(-)h(value)g
+(to)g(represent)e(undefined)g(pixels,)h(of)h(the)g(appropriate)e
+(datatype)0 4168 y(nextaddr)h(-)h(\(integer\))e(starting)h(address)g
+(\(in)h(bytes\))f(of)h(the)g(HDU)g(following)e(the)i(CHDU)0
+4281 y(offset)f(-)i(\(integer\))d(byte)h(offset)h(in)g(the)g(heap)f(to)
+h(the)g(first)g(element)f(of)h(the)g(array)0 4394 y(oldkey)f(-)i
 (\(character\))c(old)j(name)g(of)g(keyword)f(to)h(be)g(modified)0
-4394 y(ounit)f(-)i(\(integer\))d(logical)h(unit)h(number)f(associated)f
-(with)h(the)h(output)f(FITS)h(file)g(1-199)0 4507 y(pcount)f(-)i
+4507 y(ounit)f(-)i(\(integer\))d(logical)h(unit)h(number)f(associated)f
+(with)h(the)h(output)f(FITS)h(file)g(1-199)0 4620 y(pcount)f(-)i
 (\(integer\))d(value)h(of)h(the)g(PCOUNT)f(keyword)g(\(usually)g(=)h
-(0\))0 4620 y(repeat)f(-)i(\(integer\))d(length)h(of)h(element)f
+(0\))0 4733 y(repeat)f(-)i(\(integer\))d(length)h(of)h(element)f
 (vector)g(\(e.g.)g(12J\);)h(ignored)f(for)g(ASCII)h(table)0
-4733 y(rot)g(-)g(\(double)f(precision\))f(celestial)g(coordinate)g
-(rotation)h(angle)g(\(degrees\))0 4846 y(rowlen)g(-)i(\(integer\))d
+4846 y(rot)g(-)g(\(double)f(precision\))f(celestial)g(coordinate)g
+(rotation)h(angle)g(\(degrees\))0 4959 y(rowlen)g(-)i(\(integer\))d
 (length)h(of)h(a)h(table)e(row,)h(in)g(characters)e(or)i(bytes)0
-4959 y(rowlist)f(-)h(\(integer)f(array\))g(list)h(of)g(row)g(numbers)e
-(to)j(be)f(deleted)f(in)h(increasing)e(order)0 5072 y(rownum)h(-)i
+5072 y(rowlist)f(-)h(\(integer)f(array\))g(list)h(of)g(row)g(numbers)e
+(to)j(be)f(deleted)f(in)h(increasing)e(order)0 5185 y(rownum)h(-)i
 (\(integer\))d(number)h(of)h(the)g(row)g(\(first)f(row)h(=)g(1\))0
-5185 y(rwmode)f(-)i(\(integer\))d(file)h(access)h(mode:)f(0)h(=)h
-(readonly,)d(1)j(=)f(readwrite)0 5297 y(second)142 b(\(double\)-)45
-b(second)h(within)g(minute)g(\(0)h(-)h(60.9999999999\))c
-(\(leapsecond!\))0 5410 y(seq_no)i(-)i(\(integer\))d(the)i(sequence)e
-(number)h(to)i(append)e(to)h(the)g(keyword)f(root)g(name)0
-5523 y(simple)g(-)i(\(logical\))d(does)h(the)h(FITS)g(file)g(conform)e
-(to)j(all)f(the)f(FITS)h(standards)0 5636 y(snull)f(-)i(\(character\))d
-(value)h(used)h(to)g(represent)e(undefined)g(values)h(in)i(ASCII)e
-(table)p eop
-%%Page: 110 116
-110 115 bop 0 299 a Fi(110)1779 b Fg(CHAPTER)30 b(10.)112
-b(P)-8 b(ARAMETER)30 b(DEFINITIONS)0 555 y Fe(space)46
-b(-)i(\(integer\))d(number)h(of)h(blank)g(spaces)f(to)h(leave)f
-(between)g(ASCII)h(table)f(columns)0 668 y(startchar)f(-)j(\(integer\))
-d(first)h(character)g(in)h(the)g(row)g(to)g(be)g(read)0
-781 y(startno)f(-)h(\(integer\))f(value)g(of)h(the)g(first)f(keyword)g
-(sequence)g(number)g(\(usually)f(1\))0 894 y(status)h(-)i(\(integer\))d
-(returned)g(error)i(status)f(code)g(\(0)i(=)f(OK\))0
-1007 y(str_template)d(\(character\))h(template)h(string)g(to)h(be)g
-(matched)f(to)h(reference)e(string)0 1120 y(stream)h(-)i(\(character\))
+5297 y(rowrange-)e(\(string\))h(list)g(of)i(rows)e(or)h(row)g(ranges)f
+(to)i(be)f(deleted)0 5410 y(rwmode)f(-)i(\(integer\))d(file)h(access)h
+(mode:)f(0)h(=)h(readonly,)d(1)j(=)f(readwrite)0 5523
+y(second)142 b(\(double\)-)45 b(second)h(within)g(minute)g(\(0)h(-)h
+(60.9999999999\))c(\(leap)i(second!\))0 5636 y(seq_no)g(-)i
+(\(integer\))d(the)i(sequence)e(number)h(to)i(append)e(to)h(the)g
+(keyword)f(root)g(name)p eop
+%%Page: 120 126
+120 125 bop 0 299 a Fi(120)1779 b Fg(CHAPTER)30 b(11.)112
+b(P)-8 b(ARAMETER)30 b(DEFINITIONS)0 555 y Fe(simple)46
+b(-)i(\(logical\))d(does)h(the)h(FITS)g(file)g(conform)e(to)j(all)f
+(the)f(FITS)h(standards)0 668 y(snull)f(-)i(\(character\))d(value)h
+(used)h(to)g(represent)e(undefined)g(values)h(in)i(ASCII)e(table)0
+781 y(space)g(-)i(\(integer\))d(number)h(of)h(blank)g(spaces)f(to)h
+(leave)f(between)g(ASCII)h(table)f(columns)0 894 y(startchar)f(-)j
+(\(integer\))d(first)h(character)g(in)h(the)g(row)g(to)g(be)g(read)0
+1007 y(startno)f(-)h(\(integer\))f(value)g(of)h(the)g(first)f(keyword)g
+(sequence)g(number)g(\(usually)f(1\))0 1120 y(status)h(-)i(\(integer\))
+d(returned)g(error)i(status)f(code)g(\(0)i(=)f(OK\))0
+1233 y(str_template)d(\(character\))h(template)h(string)g(to)h(be)g
+(matched)f(to)h(reference)e(string)0 1346 y(stream)h(-)i(\(character\))
 c(output)i(stream)g(for)h(the)g(report:)f(either)g('STDOUT')g(or)h
-('STDERR')0 1233 y(string)f(-)i(\(character\))c(character)i(string)0
-1346 y(sum)h(-)g(\(double)f(precision\))f(32)i(bit)g(unsigned)f
-(checksum)f(value)0 1458 y(tbcol)h(-)i(\(integer)d(array\))h(column)h
+('STDERR')0 1458 y(string)f(-)i(\(character\))c(character)i(string)0
+1571 y(sum)h(-)g(\(double)f(precision\))f(32)i(bit)g(unsigned)f
+(checksum)f(value)0 1684 y(tbcol)h(-)i(\(integer)d(array\))h(column)h
 (number)f(of)h(the)g(first)f(character)f(in)j(the)e(field\(s\))0
-1571 y(tdisp)g(-)i(\(character\))d(Fortran)g(type)i(display)f(format)g
-(for)h(the)g(table)f(column)0 1684 y(template-\(character\))c(template)
-k(string)g(for)h(a)g(FITS)g(header)f(record)0 1797 y(tfields)g(-)h
+1797 y(tdisp)g(-)i(\(character\))d(Fortran)g(type)i(display)f(format)g
+(for)h(the)g(table)f(column)0 1910 y(template-\(character\))c(template)
+k(string)g(for)h(a)g(FITS)g(header)f(record)0 2023 y(tfields)g(-)h
 (\(integer\))f(number)g(of)h(fields)f(\(columns\))f(in)i(the)g(table)0
-1910 y(tform)f(-)i(\(character)d(array\))h(format)g(of)h(the)g
-(column\(s\);)e(allowed)h(values)g(are:)430 2023 y(For)g(ASCII)h
+2136 y(tform)f(-)i(\(character)d(array\))h(format)g(of)h(the)g
+(column\(s\);)e(allowed)h(values)g(are:)430 2249 y(For)g(ASCII)h
 (tables:)93 b(Iw,)47 b(Aw,)g(Fww.dd,)f(Eww.dd,)g(or)h(Dww.dd)430
-2136 y(For)f(binary)h(tables:)e(rL,)i(rX,)g(rB,)g(rI,)g(rJ,)g(rA,)g
-(rAw,)f(rE,)h(rD,)g(rC,)g(rM)430 2249 y(where)f('w'=width)f(of)i(the)g
+2362 y(For)f(binary)h(tables:)e(rL,)i(rX,)g(rB,)g(rI,)g(rJ,)g(rA,)g
+(rAw,)f(rE,)h(rD,)g(rC,)g(rM)430 2475 y(where)f('w'=width)f(of)i(the)g
 (field,)f('d'=no.)g(of)h(decimals,)f('r'=repeat)f(count)430
-2362 y(Note)h(that)h(the)g('rAw')f(form)h(is)g(non-standard)d
-(extension)i(to)h(the)430 2475 y(TFORM)f(keyword)g(syntax)g(that)g(is)i
-(not)f(specifically)d(defined)i(in)h(the)430 2588 y(Binary)f(Tables)g
-(definition)f(document.)0 2700 y(theap)h(-)i(\(integer\))d(zero)i
+2588 y(Note)h(that)h(the)g('rAw')f(form)h(is)g(non-standard)d
+(extension)i(to)h(the)430 2700 y(TFORM)f(keyword)g(syntax)g(that)g(is)i
+(not)f(specifically)d(defined)i(in)h(the)430 2813 y(Binary)f(Tables)g
+(definition)f(document.)0 2926 y(theap)h(-)i(\(integer\))d(zero)i
 (indexed)f(byte)g(offset)g(of)h(starting)f(address)g(of)h(the)g(heap)
-430 2813 y(relative)e(to)i(the)g(beginning)e(of)j(the)f(binary)f(table)
-g(data)0 2926 y(tnull)g(-)i(\(integer\))d(value)h(used)h(to)g
+430 3039 y(relative)e(to)i(the)g(beginning)e(of)j(the)f(binary)f(table)
+g(data)0 3152 y(tnull)g(-)i(\(integer\))d(value)h(used)h(to)g
 (represent)f(undefined)f(values)h(in)h(binary)f(table)0
-3039 y(ttype)g(-)i(\(character)d(array\))h(label)g(for)h(table)g
-(column\(s\))0 3152 y(tscal)f(-)i(\(double)e(precision\))f(scaling)g
-(factor)i(for)f(table)h(column)0 3265 y(tunit)f(-)i(\(character)d
+3265 y(ttype)g(-)i(\(character)d(array\))h(label)g(for)h(table)g
+(column\(s\))0 3378 y(tscal)f(-)i(\(double)e(precision\))f(scaling)g
+(factor)i(for)f(table)h(column)0 3491 y(tunit)f(-)i(\(character)d
 (array\))h(physical)f(unit)i(for)g(table)f(column\(s\))0
-3378 y(tzero)g(-)i(\(double)e(precision\))f(scaling)g(zero)i(point)f
-(for)h(table)g(column)0 3491 y(unit)94 b(-)48 b(\(integer\))d(logical)h
+3604 y(tzero)g(-)i(\(double)e(precision\))f(scaling)g(zero)i(point)f
+(for)h(table)g(column)0 3717 y(unit)94 b(-)48 b(\(integer\))d(logical)h
 (unit)h(number)f(associated)f(with)h(the)h(FITS)g(file)f(\(1-199\))0
-3604 y(units)g(-)i(\(character\))d(the)h(keyword)g(units)h(string)f
-(\(e.g.,)g('km/s'\))0 3717 y(value)g(-)i(\(character\))d(the)h(keyword)
-g(value)h(string)0 3830 y(values)f(-)i(array)e(of)h(data)g(values)f(of)
-h(the)g(appropriate)e(datatype)0 3942 y(varidat)h(-)h(\(integer\))f
+3830 y(units)g(-)i(\(character\))d(the)h(keyword)g(units)h(string)f
+(\(e.g.,)g('km/s'\))0 3942 y(value)g(-)i(\(character\))d(the)h(keyword)
+g(value)h(string)0 4055 y(values)f(-)i(array)e(of)h(data)g(values)f(of)
+h(the)g(appropriate)e(datatype)0 4168 y(varidat)h(-)h(\(integer\))f
 (size)g(in)h(bytes)g(of)g(the)g('variable)e(length)h(data)h(area')525
-4055 y(following)e(the)i(binary)f(table)h(data)f(\(usually)g(=)h(0\))0
-4168 y(version)f(-)h(\(real\))f(current)g(revision)g(number)g(of)h(the)
-g(library)0 4281 y(width)f(-)i(\(integer\))d(width)h(of)i(the)f
-(character)e(string)h(field)0 4394 y(xcol)h(-)g(\(integer\))e(number)h
+4281 y(following)e(the)i(binary)f(table)h(data)f(\(usually)g(=)h(0\))0
+4394 y(version)f(-)h(\(real\))f(current)g(revision)g(number)g(of)h(the)
+g(library)0 4507 y(width)f(-)i(\(integer\))d(width)h(of)i(the)f
+(character)e(string)h(field)0 4620 y(xcol)h(-)g(\(integer\))e(number)h
 (of)i(the)f(column)f(containing)f(the)i(X)g(coordinate)e(values)0
-4507 y(xinc)i(-)g(\(double)f(precision\))f(X)i(axis)g(coordinate)e
-(increment)g(at)i(reference)f(pixel)g(\(deg\))0 4620
+4733 y(xinc)i(-)g(\(double)f(precision\))f(X)i(axis)g(coordinate)e
+(increment)g(at)i(reference)f(pixel)g(\(deg\))0 4846
 y(xpix)h(-)g(\(double)f(precision\))f(X)i(axis)g(pixel)f(location)0
-4733 y(xpos)h(-)g(\(double)f(precision\))f(X)i(axis)g(celestial)e
-(coordinate)g(\(usually)h(RA\))h(\(deg\))0 4846 y(xrpix)f(-)i(\(double)
+4959 y(xpos)h(-)g(\(double)f(precision\))f(X)i(axis)g(celestial)e
+(coordinate)g(\(usually)h(RA\))h(\(deg\))0 5072 y(xrpix)f(-)i(\(double)
 e(precision\))f(X)i(axis)g(reference)e(pixel)h(array)h(location)0
-4959 y(xrval)f(-)i(\(double)e(precision\))f(X)i(axis)g(coordinate)e
-(value)h(at)h(the)g(reference)e(pixel)i(\(deg\))0 5072
+5185 y(xrval)f(-)i(\(double)e(precision\))f(X)i(axis)g(coordinate)e
+(value)h(at)h(the)g(reference)e(pixel)i(\(deg\))0 5297
 y(ycol)g(-)g(\(integer\))e(number)h(of)i(the)f(column)f(containing)f
-(the)i(X)g(coordinate)e(values)0 5185 y(year)i(-)g(\(integer\))e(last)i
-(2)g(digits)g(of)g(the)g(year)f(\(00)h(-)h(99\))0 5297
+(the)i(X)g(coordinate)e(values)0 5410 y(year)i(-)g(\(integer\))e(last)i
+(2)g(digits)g(of)g(the)g(year)f(\(00)h(-)h(99\))0 5523
 y(yinc)f(-)g(\(double)f(precision\))f(Y)i(axis)g(coordinate)e
-(increment)g(at)i(reference)f(pixel)g(\(deg\))0 5410
-y(ypix)h(-)g(\(double)f(precision\))f(y)i(axis)g(pixel)f(location)0
-5523 y(ypos)h(-)g(\(double)f(precision\))f(y)i(axis)g(celestial)e
-(coordinate)g(\(usually)h(DEC\))g(\(deg\))0 5636 y(yrpix)g(-)i
-(\(double)e(precision\))f(Y)i(axis)g(reference)e(pixel)h(array)h
-(location)p eop
-%%Page: 111 117
-111 116 bop 3764 299 a Fi(111)0 555 y Fe(yrval)46 b(-)i(\(double)e
+(increment)g(at)i(reference)f(pixel)g(\(deg\))0 5636
+y(ypix)h(-)g(\(double)f(precision\))f(y)i(axis)g(pixel)f(location)p
+eop
+%%Page: 121 127
+121 126 bop 3764 299 a Fi(121)0 555 y Fe(ypos)47 b(-)g(\(double)f
+(precision\))f(y)i(axis)g(celestial)e(coordinate)g(\(usually)h(DEC\))g
+(\(deg\))0 668 y(yrpix)g(-)i(\(double)e(precision\))f(Y)i(axis)g
+(reference)e(pixel)h(array)h(location)0 781 y(yrval)f(-)i(\(double)e
 (precision\))f(Y)i(axis)g(coordinate)e(value)h(at)h(the)g(reference)e
 (pixel)i(\(deg\))p eop
-%%Page: 112 118
-112 117 bop 0 299 a Fi(112)1779 b Fg(CHAPTER)30 b(10.)112
+%%Page: 122 128
+122 127 bop 0 299 a Fi(122)1779 b Fg(CHAPTER)30 b(11.)112
 b(P)-8 b(ARAMETER)30 b(DEFINITIONS)p eop
-%%Page: 113 119
-113 118 bop 0 1225 a Ff(Chapter)65 b(11)0 1687 y Fl(FITSIO)76
+%%Page: 123 129
+123 128 bop 0 1225 a Ff(Chapter)65 b(12)0 1687 y Fl(FITSIO)76
 b(Error)h(Status)h(Co)6 b(des)0 2180 y Fe(Status)46 b(codes)g(in)i(the)
 f(range)f(-99)h(to)g(-999)94 b(and)47 b(1)h(to)f(999)g(are)g(reserved)e
 (for)i(future)0 2293 y(FITSIO)f(use.)95 2518 y(0)96 b(OK,)47
@@ -8972,164 +9633,166 @@ b(to)h(register)f(too)h(many)f(IO)h(drivers)0 4551 y(123)95
 b(driver)46 b(initialization)e(failed)0 4664 y(124)95
 b(matching)45 b(driver)h(is)h(not)g(registered)0 4777
 y(125)95 b(failed)46 b(to)h(parse)f(input)h(file)f(URL)0
-5002 y(151)95 b(bad)47 b(argument)e(in)i(shared)f(memory)g(driver)0
-5115 y(152)95 b(null)46 b(pointer)g(passed)g(as)h(an)h(argument)0
-5228 y(153)95 b(no)47 b(more)f(free)h(shared)f(memory)g(handles)0
-5341 y(154)95 b(shared)46 b(memory)g(driver)g(is)h(not)g(initialized)0
-5454 y(155)95 b(IPC)47 b(error)f(returned)f(by)j(a)f(system)f(call)0
-5567 y(156)95 b(no)47 b(memory)f(in)h(shared)f(memory)g(driver)0
-5680 y(157)95 b(resource)45 b(deadlock)h(would)g(occur)1882
-5942 y Fi(113)p eop
-%%Page: 114 120
-114 119 bop 0 299 a Fi(114)1613 b Fg(CHAPTER)30 b(11.)112
+4890 y(126)95 b(parse)46 b(error)g(in)i(range)e(list)0
+5115 y(151)95 b(bad)47 b(argument)e(in)i(shared)f(memory)g(driver)0
+5228 y(152)95 b(null)46 b(pointer)g(passed)g(as)h(an)h(argument)0
+5341 y(153)95 b(no)47 b(more)f(free)h(shared)f(memory)g(handles)0
+5454 y(154)95 b(shared)46 b(memory)g(driver)g(is)h(not)g(initialized)0
+5567 y(155)95 b(IPC)47 b(error)f(returned)f(by)j(a)f(system)f(call)0
+5680 y(156)95 b(no)47 b(memory)f(in)h(shared)f(memory)g(driver)1882
+5942 y Fi(123)p eop
+%%Page: 124 130
+124 129 bop 0 299 a Fi(124)1613 b Fg(CHAPTER)30 b(12.)112
 b(FITSIO)30 b(ERR)m(OR)g(ST)-8 b(A)g(TUS)30 b(CODES)0
-555 y Fe(158)95 b(attempt)45 b(to)j(open/create)c(lock)j(file)g(failed)
-0 668 y(159)95 b(shared)46 b(memory)g(block)g(cannot)g(be)h(resized)f
-(at)h(the)g(moment)0 1007 y(201)95 b(header)46 b(not)h(empty;)f(can't)g
-(write)g(required)g(keywords)0 1120 y(202)95 b(specified)45
+555 y Fe(157)95 b(resource)45 b(deadlock)h(would)g(occur)0
+668 y(158)95 b(attempt)45 b(to)j(open/create)c(lock)j(file)g(failed)0
+781 y(159)95 b(shared)46 b(memory)g(block)g(cannot)g(be)h(resized)f(at)
+h(the)g(moment)0 1120 y(201)95 b(header)46 b(not)h(empty;)f(can't)g
+(write)g(required)g(keywords)0 1233 y(202)95 b(specified)45
 b(keyword)h(name)g(was)h(not)g(found)g(in)g(the)g(header)0
-1233 y(203)95 b(specified)45 b(header)h(record)g(number)g(is)h(out)g
-(of)g(bounds)0 1346 y(204)95 b(keyword)45 b(value)i(field)f(is)h(blank)
-0 1458 y(205)95 b(keyword)45 b(value)i(string)f(is)h(missing)f(the)h
-(closing)f(quote)g(character)0 1571 y(207)95 b(illegal)45
+1346 y(203)95 b(specified)45 b(header)h(record)g(number)g(is)h(out)g
+(of)g(bounds)0 1458 y(204)95 b(keyword)45 b(value)i(field)f(is)h(blank)
+0 1571 y(205)95 b(keyword)45 b(value)i(string)f(is)h(missing)f(the)h
+(closing)f(quote)g(character)0 1684 y(207)95 b(illegal)45
 b(character)h(in)h(keyword)f(name)g(or)i(header)e(record)0
-1684 y(208)95 b(keyword)45 b(does)i(not)g(have)g(expected)e(name.)i
-(Keyword)e(out)i(of)g(sequence?)0 1797 y(209)95 b(keyword)45
-b(does)i(not)g(have)g(expected)e(integer)h(value)0 1910
+1797 y(208)95 b(keyword)45 b(does)i(not)g(have)g(expected)e(name.)i
+(Keyword)e(out)i(of)g(sequence?)0 1910 y(209)95 b(keyword)45
+b(does)i(not)g(have)g(expected)e(integer)h(value)0 2023
 y(210)95 b(could)46 b(not)h(find)g(the)f(required)g(END)h(header)f
-(keyword)0 2023 y(211)95 b(illegal)45 b(BITPIX)i(keyword)e(value)0
-2136 y(212)95 b(illegal)45 b(NAXIS)i(keyword)f(value)0
-2249 y(213)95 b(illegal)45 b(NAXISn)i(keyword)e(value:)h(must)h(be)g(0)
-h(or)f(positive)e(integer)0 2362 y(214)95 b(illegal)45
-b(PCOUNT)i(keyword)e(value)0 2475 y(215)95 b(illegal)45
-b(GCOUNT)i(keyword)e(value)0 2588 y(216)95 b(illegal)45
-b(TFIELDS)h(keyword)g(value)0 2700 y(217)95 b(negative)45
+(keyword)0 2136 y(211)95 b(illegal)45 b(BITPIX)i(keyword)e(value)0
+2249 y(212)95 b(illegal)45 b(NAXIS)i(keyword)f(value)0
+2362 y(213)95 b(illegal)45 b(NAXISn)i(keyword)e(value:)h(must)h(be)g(0)
+h(or)f(positive)e(integer)0 2475 y(214)95 b(illegal)45
+b(PCOUNT)i(keyword)e(value)0 2588 y(215)95 b(illegal)45
+b(GCOUNT)i(keyword)e(value)0 2700 y(216)95 b(illegal)45
+b(TFIELDS)h(keyword)g(value)0 2813 y(217)95 b(negative)45
 b(ASCII)i(or)g(binary)f(table)g(width)h(value)f(\(NAXIS1\))0
-2813 y(218)95 b(negative)45 b(number)h(of)h(rows)g(in)g(ASCII)g(or)g
-(binary)f(table)g(\(NAXIS2\))0 2926 y(219)95 b(column)46
-b(name)g(\(TTYPE)g(keyword\))g(not)h(found)0 3039 y(220)95
-b(illegal)45 b(SIMPLE)i(keyword)e(value)0 3152 y(221)95
+2926 y(218)95 b(negative)45 b(number)h(of)h(rows)g(in)g(ASCII)g(or)g
+(binary)f(table)g(\(NAXIS2\))0 3039 y(219)95 b(column)46
+b(name)g(\(TTYPE)g(keyword\))g(not)h(found)0 3152 y(220)95
+b(illegal)45 b(SIMPLE)i(keyword)e(value)0 3265 y(221)95
 b(could)46 b(not)h(find)g(the)f(required)g(SIMPLE)g(header)g(keyword)0
-3265 y(222)95 b(could)46 b(not)h(find)g(the)f(required)g(BITPIX)g
-(header)g(keyword)0 3378 y(223)95 b(could)46 b(not)h(find)g(the)f
-(required)g(NAXIS)g(header)g(keyword)0 3491 y(224)95
+3378 y(222)95 b(could)46 b(not)h(find)g(the)f(required)g(BITPIX)g
+(header)g(keyword)0 3491 y(223)95 b(could)46 b(not)h(find)g(the)f
+(required)g(NAXIS)g(header)g(keyword)0 3604 y(224)95
 b(could)46 b(not)h(find)g(all)f(the)h(required)f(NAXISn)g(keywords)g
-(in)h(the)g(header)0 3604 y(225)95 b(could)46 b(not)h(find)g(the)f
-(required)g(XTENSION)g(header)g(keyword)0 3717 y(226)95
+(in)h(the)g(header)0 3717 y(225)95 b(could)46 b(not)h(find)g(the)f
+(required)g(XTENSION)g(header)g(keyword)0 3830 y(226)95
 b(the)47 b(CHDU)f(is)h(not)g(an)g(ASCII)g(table)f(extension)0
-3830 y(227)95 b(the)47 b(CHDU)f(is)h(not)g(a)h(binary)e(table)g
-(extension)0 3942 y(228)95 b(could)46 b(not)h(find)g(the)f(required)g
-(PCOUNT)g(header)g(keyword)0 4055 y(229)95 b(could)46
+3942 y(227)95 b(the)47 b(CHDU)f(is)h(not)g(a)h(binary)e(table)g
+(extension)0 4055 y(228)95 b(could)46 b(not)h(find)g(the)f(required)g
+(PCOUNT)g(header)g(keyword)0 4168 y(229)95 b(could)46
 b(not)h(find)g(the)f(required)g(GCOUNT)g(header)g(keyword)0
-4168 y(230)95 b(could)46 b(not)h(find)g(the)f(required)g(TFIELDS)g
-(header)g(keyword)0 4281 y(231)95 b(could)46 b(not)h(find)g(all)f(the)h
-(required)f(TBCOLn)g(keywords)g(in)h(the)g(header)0 4394
+4281 y(230)95 b(could)46 b(not)h(find)g(the)f(required)g(TFIELDS)g
+(header)g(keyword)0 4394 y(231)95 b(could)46 b(not)h(find)g(all)f(the)h
+(required)f(TBCOLn)g(keywords)g(in)h(the)g(header)0 4507
 y(232)95 b(could)46 b(not)h(find)g(all)f(the)h(required)f(TFORMn)g
-(keywords)g(in)h(the)g(header)0 4507 y(233)95 b(the)47
-b(CHDU)f(is)h(not)g(an)g(IMAGE)g(extension)0 4620 y(234)95
+(keywords)g(in)h(the)g(header)0 4620 y(233)95 b(the)47
+b(CHDU)f(is)h(not)g(an)g(IMAGE)g(extension)0 4733 y(234)95
 b(illegal)45 b(TBCOL)i(keyword)f(value;)g(out)h(of)g(range)0
-4733 y(235)95 b(this)46 b(operation)g(only)g(allowed)g(for)h(ASCII)f
-(or)h(BINARY)g(table)f(extension)0 4846 y(236)95 b(column)46
+4846 y(235)95 b(this)46 b(operation)g(only)g(allowed)g(for)h(ASCII)f
+(or)h(BINARY)g(table)f(extension)0 4959 y(236)95 b(column)46
 b(is)h(too)g(wide)f(to)i(fit)f(within)f(the)h(specified)e(width)h(of)h
-(the)g(ASCII)g(table)0 4959 y(237)95 b(the)47 b(specified)e(column)h
+(the)g(ASCII)g(table)0 5072 y(237)95 b(the)47 b(specified)e(column)h
 (name)h(template)e(matched)h(more)h(than)f(one)h(column)f(name)0
-5072 y(241)95 b(binary)46 b(table)g(row)h(width)f(is)i(not)e(equal)h
-(to)g(the)g(sum)g(of)g(the)g(field)f(widths)0 5185 y(251)95
+5185 y(241)95 b(binary)46 b(table)g(row)h(width)f(is)i(not)e(equal)h
+(to)g(the)g(sum)g(of)g(the)g(field)f(widths)0 5297 y(251)95
 b(unrecognizable)44 b(type)i(of)h(FITS)g(extension)0
-5297 y(252)95 b(unrecognizable)44 b(FITS)i(record)0 5410
+5410 y(252)95 b(unrecognizable)44 b(FITS)i(record)0 5523
 y(253)95 b(END)47 b(keyword)e(contains)h(non-blank)f(characters)g(in)i
-(columns)f(9-80)0 5523 y(254)95 b(Header)46 b(fill)g(area)h(contains)f
-(non-blank)f(characters)0 5636 y(255)95 b(Data)46 b(fill)h(area)g
-(contains)e(non-blank)g(on)j(non-zero)d(values)p eop
-%%Page: 115 121
-115 120 bop 3764 299 a Fi(115)0 555 y Fe(261)95 b(unable)46
-b(to)h(parse)f(the)h(TFORM)g(keyword)e(value)i(string)0
-668 y(262)95 b(unrecognizable)44 b(TFORM)i(datatype)f(code)0
-781 y(263)95 b(illegal)45 b(TDIMn)i(keyword)f(value)0
-1007 y(301)95 b(illegal)45 b(HDU)i(number;)f(less)h(than)f(1)i(or)f
-(greater)f(than)h(internal)e(buffer)h(size)0 1120 y(302)95
+(columns)f(9-80)0 5636 y(254)95 b(Header)46 b(fill)g(area)h(contains)f
+(non-blank)f(characters)p eop
+%%Page: 125 131
+125 130 bop 3764 299 a Fi(125)0 555 y Fe(255)95 b(Data)46
+b(fill)h(area)g(contains)e(non-blank)g(on)j(non-zero)d(values)0
+668 y(261)95 b(unable)46 b(to)h(parse)f(the)h(TFORM)g(keyword)e(value)i
+(string)0 781 y(262)95 b(unrecognizable)44 b(TFORM)i(datatype)f(code)0
+894 y(263)95 b(illegal)45 b(TDIMn)i(keyword)f(value)0
+1120 y(301)95 b(illegal)45 b(HDU)i(number;)f(less)h(than)f(1)i(or)f
+(greater)f(than)h(internal)e(buffer)h(size)0 1233 y(302)95
 b(column)46 b(number)g(out)h(of)g(range)f(\(1)h(-)h(999\))0
-1233 y(304)95 b(attempt)45 b(to)j(move)e(to)h(negative)f(file)h(record)
-f(number)0 1346 y(306)95 b(attempted)45 b(to)i(read)g(or)g(write)f(a)i
+1346 y(304)95 b(attempt)45 b(to)j(move)e(to)h(negative)f(file)h(record)
+f(number)0 1458 y(306)95 b(attempted)45 b(to)i(read)g(or)g(write)f(a)i
 (negative)d(number)h(of)i(bytes)e(in)h(the)g(FITS)g(file)0
-1458 y(307)95 b(illegal)45 b(starting)h(row)h(number)f(for)h(table)f
-(read)h(or)g(write)f(operation)0 1571 y(308)95 b(illegal)45
+1571 y(307)95 b(illegal)45 b(starting)h(row)h(number)f(for)h(table)f
+(read)h(or)g(write)f(operation)0 1684 y(308)95 b(illegal)45
 b(starting)h(element)g(number)g(for)h(table)f(read)h(or)g(write)f
-(operation)0 1684 y(309)95 b(attempted)45 b(to)i(read)g(or)g(write)f
+(operation)0 1797 y(309)95 b(attempted)45 b(to)i(read)g(or)g(write)f
 (character)g(string)g(in)h(non-character)d(table)i(column)0
-1797 y(310)95 b(attempted)45 b(to)i(read)g(or)g(write)f(logical)g
-(value)g(in)i(non-logical)c(table)j(column)0 1910 y(311)95
+1910 y(310)95 b(attempted)45 b(to)i(read)g(or)g(write)f(logical)g
+(value)g(in)i(non-logical)c(table)j(column)0 2023 y(311)95
 b(illegal)45 b(ASCII)i(table)f(TFORM)h(format)f(code)g(for)h(attempted)
-e(operation)0 2023 y(312)95 b(illegal)45 b(binary)i(table)f(TFORM)g
-(format)g(code)h(for)g(attempted)e(operation)0 2136 y(314)95
+e(operation)0 2136 y(312)95 b(illegal)45 b(binary)i(table)f(TFORM)g
+(format)g(code)h(for)g(attempted)e(operation)0 2249 y(314)95
 b(value)46 b(for)h(undefined)e(pixels)h(has)h(not)g(been)g(defined)0
-2249 y(317)95 b(attempted)45 b(to)i(read)g(or)g(write)f(descriptor)f
-(in)i(a)h(non-descriptor)c(field)0 2362 y(320)95 b(number)46
-b(of)h(array)f(dimensions)f(out)i(of)g(range)0 2475 y(321)95
+2362 y(317)95 b(attempted)45 b(to)i(read)g(or)g(write)f(descriptor)f
+(in)i(a)h(non-descriptor)c(field)0 2475 y(320)95 b(number)46
+b(of)h(array)f(dimensions)f(out)i(of)g(range)0 2588 y(321)95
 b(first)46 b(pixel)g(number)g(is)i(greater)d(than)i(the)g(last)g(pixel)
-f(number)0 2588 y(322)95 b(attempt)45 b(to)j(set)f(BSCALE)f(or)h
-(TSCALn)f(scaling)g(parameter)f(=)i(0)0 2700 y(323)95
-b(illegal)45 b(axis)i(length)f(less)h(than)f(1)0 2926
+f(number)0 2700 y(322)95 b(attempt)45 b(to)j(set)f(BSCALE)f(or)h
+(TSCALn)f(scaling)g(parameter)f(=)i(0)0 2813 y(323)95
+b(illegal)45 b(axis)i(length)f(less)h(than)f(1)0 3039
 y(340)h(NOT_GROUP_TABLE)d(340)142 b(Grouping)45 b(function)h(error)0
-3039 y(341)95 b(HDU_ALREADY_MEMBER)0 3152 y(342)47 b(MEMBER_NOT_FOUND)0
-3265 y(343)g(GROUP_NOT_FOUND)0 3378 y(344)g(BAD_GROUP_ID)0
-3491 y(345)g(TOO_MANY_HDUS_TRACKED)0 3604 y(346)g(HDU_ALREADY_TRACKED)0
-3717 y(347)g(BAD_OPTION)0 3830 y(348)g(IDENTICAL_POINTERS)0
-4055 y(360)g(NGP_NO_MEMORY)665 b(malloc)46 b(failed)0
-4168 y(361)h(NGP_READ_ERR)713 b(read)46 b(error)h(from)f(file)0
-4281 y(362)h(NGP_NUL_PTR)761 b(null)46 b(pointer)g(passed)g(as)h(an)g
-(argument.)1575 4394 y(Passing)f(null)g(pointer)g(as)h(a)h(name)f(of)
-1575 4507 y(template)f(file)g(raises)g(this)h(error)0
-4620 y(363)g(NGP_EMPTY_CURLINE)473 b(line)46 b(read)h(seems)f(to)h(be)h
-(empty)e(\(used)1575 4733 y(internally\))0 4846 y(364)h
+3152 y(341)95 b(HDU_ALREADY_MEMBER)0 3265 y(342)47 b(MEMBER_NOT_FOUND)0
+3378 y(343)g(GROUP_NOT_FOUND)0 3491 y(344)g(BAD_GROUP_ID)0
+3604 y(345)g(TOO_MANY_HDUS_TRACKED)0 3717 y(346)g(HDU_ALREADY_TRACKED)0
+3830 y(347)g(BAD_OPTION)0 3942 y(348)g(IDENTICAL_POINTERS)0
+4055 y(349)g(BAD_GROUP_ATTACH)0 4168 y(350)g(BAD_GROUP_DETACH)0
+4394 y(360)g(NGP_NO_MEMORY)665 b(malloc)46 b(failed)0
+4507 y(361)h(NGP_READ_ERR)713 b(read)46 b(error)h(from)f(file)0
+4620 y(362)h(NGP_NUL_PTR)761 b(null)46 b(pointer)g(passed)g(as)h(an)g
+(argument.)1575 4733 y(Passing)f(null)g(pointer)g(as)h(a)h(name)f(of)
+1575 4846 y(template)f(file)g(raises)g(this)h(error)0
+4959 y(363)g(NGP_EMPTY_CURLINE)473 b(line)46 b(read)h(seems)f(to)h(be)h
+(empty)e(\(used)1575 5072 y(internally\))0 5185 y(364)h
 (NGP_UNREAD_QUEUE_FULL)281 b(cannot)46 b(unread)g(more)g(then)h(1)g
-(line)g(\(or)g(single)1575 4959 y(line)g(twice\))0 5072
+(line)g(\(or)g(single)1575 5297 y(line)g(twice\))0 5410
 y(365)g(NGP_INC_NESTING)569 b(too)46 b(deep)h(include)f(file)h(nesting)
-e(\(infinite)1575 5185 y(loop,)h(template)g(includes)f(itself)i(?\))0
-5297 y(366)g(NGP_ERR_FOPEN)665 b(fopen\(\))45 b(failed,)h(cannot)g
-(open)h(template)e(file)0 5410 y(367)i(NGP_EOF)953 b(end)46
-b(of)i(file)e(encountered)f(and)i(not)g(expected)0 5523
-y(368)g(NGP_BAD_ARG)761 b(bad)46 b(arguments)g(passed.)g(Usually)f
-(means)1575 5636 y(internal)h(parser)g(error.)g(Should)g(not)h(happen)p
-eop
-%%Page: 116 122
-116 121 bop 0 299 a Fi(116)1613 b Fg(CHAPTER)30 b(11.)112
+e(\(infinite)1575 5523 y(loop,)h(template)g(includes)f(itself)i(?\))0
+5636 y(366)g(NGP_ERR_FOPEN)665 b(fopen\(\))45 b(failed,)h(cannot)g
+(open)h(template)e(file)p eop
+%%Page: 126 132
+126 131 bop 0 299 a Fi(126)1613 b Fg(CHAPTER)30 b(12.)112
 b(FITSIO)30 b(ERR)m(OR)g(ST)-8 b(A)g(TUS)30 b(CODES)0
-555 y Fe(369)47 b(NGP_TOKEN_NOT_EXPECT)329 b(token)46
-b(not)h(expected)e(here)0 781 y(401)95 b(error)46 b(attempting)f(to)i
-(convert)f(an)h(integer)f(to)h(a)h(formatted)d(character)g(string)0
-894 y(402)95 b(error)46 b(attempting)f(to)i(convert)f(a)h(real)g(value)
-f(to)i(a)f(formatted)e(character)h(string)0 1007 y(403)95
-b(cannot)46 b(convert)g(a)h(quoted)f(string)g(keyword)g(to)h(an)g
-(integer)0 1120 y(404)95 b(attempted)45 b(to)i(read)g(a)g(non-logical)e
-(keyword)h(value)g(as)h(a)h(logical)e(value)0 1233 y(405)95
-b(cannot)46 b(convert)g(a)h(quoted)f(string)g(keyword)g(to)h(a)h(real)e
-(value)0 1346 y(406)95 b(cannot)46 b(convert)g(a)h(quoted)f(string)g
-(keyword)g(to)h(a)h(double)e(precision)f(value)0 1458
-y(407)95 b(error)46 b(attempting)f(to)i(read)g(character)e(string)h(as)
-h(an)h(integer)0 1571 y(408)95 b(error)46 b(attempting)f(to)i(read)g
-(character)e(string)h(as)h(a)h(real)e(value)0 1684 y(409)95
-b(error)46 b(attempting)f(to)i(read)g(character)e(string)h(as)h(a)h
-(double)e(precision)f(value)0 1797 y(410)95 b(bad)47
-b(keyword)e(datatype)h(code)0 1910 y(411)95 b(illegal)45
-b(number)i(of)g(decimal)f(places)g(while)g(formatting)f(floating)h
-(point)g(value)0 2023 y(412)95 b(numerical)45 b(overflow)g(during)i
-(implicit)e(datatype)h(conversion)0 2136 y(413)95 b(error)46
-b(compressing)f(image)0 2249 y(414)95 b(error)46 b(uncompressing)e
-(image)0 2362 y(420)95 b(error)46 b(in)h(date)g(or)g(time)g(conversion)
-0 2588 y(431)95 b(syntax)46 b(error)g(in)h(parser)f(expression)0
-2700 y(432)95 b(expression)45 b(did)i(not)f(evaluate)g(to)h(desired)f
-(type)0 2813 y(433)95 b(vector)46 b(result)g(too)h(large)f(to)h(return)
-f(in)i(array)0 2926 y(434)95 b(data)46 b(parser)g(failed)g(not)h(sent)g
-(an)g(out)g(column)0 3039 y(435)95 b(bad)47 b(data)f(encounter)f(while)
-i(parsing)f(column)0 3152 y(436)95 b(parse)46 b(error:)g(output)g(file)
-h(not)g(of)g(proper)f(type)0 3378 y(501)95 b(celestial)45
-b(angle)h(too)h(large)g(for)f(projection)0 3491 y(502)95
+555 y Fe(367)47 b(NGP_EOF)953 b(end)46 b(of)i(file)e(encountered)f(and)
+i(not)g(expected)0 668 y(368)g(NGP_BAD_ARG)761 b(bad)46
+b(arguments)g(passed.)g(Usually)f(means)1575 781 y(internal)h(parser)g
+(error.)g(Should)g(not)h(happen)0 894 y(369)g(NGP_TOKEN_NOT_EXPECT)329
+b(token)46 b(not)h(expected)e(here)0 1120 y(401)95 b(error)46
+b(attempting)f(to)i(convert)f(an)h(integer)f(to)h(a)h(formatted)d
+(character)g(string)0 1233 y(402)95 b(error)46 b(attempting)f(to)i
+(convert)f(a)h(real)g(value)f(to)i(a)f(formatted)e(character)h(string)0
+1346 y(403)95 b(cannot)46 b(convert)g(a)h(quoted)f(string)g(keyword)g
+(to)h(an)g(integer)0 1458 y(404)95 b(attempted)45 b(to)i(read)g(a)g
+(non-logical)e(keyword)h(value)g(as)h(a)h(logical)e(value)0
+1571 y(405)95 b(cannot)46 b(convert)g(a)h(quoted)f(string)g(keyword)g
+(to)h(a)h(real)e(value)0 1684 y(406)95 b(cannot)46 b(convert)g(a)h
+(quoted)f(string)g(keyword)g(to)h(a)h(double)e(precision)f(value)0
+1797 y(407)95 b(error)46 b(attempting)f(to)i(read)g(character)e(string)
+h(as)h(an)h(integer)0 1910 y(408)95 b(error)46 b(attempting)f(to)i
+(read)g(character)e(string)h(as)h(a)h(real)e(value)0
+2023 y(409)95 b(error)46 b(attempting)f(to)i(read)g(character)e(string)
+h(as)h(a)h(double)e(precision)f(value)0 2136 y(410)95
+b(bad)47 b(keyword)e(datatype)h(code)0 2249 y(411)95
+b(illegal)45 b(number)i(of)g(decimal)f(places)g(while)g(formatting)f
+(floating)h(point)g(value)0 2362 y(412)95 b(numerical)45
+b(overflow)g(during)i(implicit)e(datatype)h(conversion)0
+2475 y(413)95 b(error)46 b(compressing)f(image)0 2588
+y(414)95 b(error)46 b(uncompressing)e(image)0 2700 y(420)95
+b(error)46 b(in)h(date)g(or)g(time)g(conversion)0 2926
+y(431)95 b(syntax)46 b(error)g(in)h(parser)f(expression)0
+3039 y(432)95 b(expression)45 b(did)i(not)f(evaluate)g(to)h(desired)f
+(type)0 3152 y(433)95 b(vector)46 b(result)g(too)h(large)f(to)h(return)
+f(in)i(array)0 3265 y(434)95 b(data)46 b(parser)g(failed)g(not)h(sent)g
+(an)g(out)g(column)0 3378 y(435)95 b(bad)47 b(data)f(encounter)f(while)
+i(parsing)f(column)0 3491 y(436)95 b(parse)46 b(error:)g(output)g(file)
+h(not)g(of)g(proper)f(type)0 3717 y(501)95 b(celestial)45
+b(angle)h(too)h(large)g(for)f(projection)0 3830 y(502)95
 b(bad)47 b(celestial)e(coordinate)g(or)i(pixel)f(value)0
-3604 y(503)95 b(error)46 b(in)h(celestial)e(coordinate)g(calculation)0
-3717 y(504)95 b(unsupported)44 b(type)j(of)g(celestial)e(projection)0
-3830 y(505)95 b(required)45 b(celestial)g(coordinate)g(keywords)h(not)h
-(found)0 3942 y(506)95 b(approximate)44 b(wcs)j(keyword)f(values)g
+3942 y(503)95 b(error)46 b(in)h(celestial)e(coordinate)g(calculation)0
+4055 y(504)95 b(unsupported)44 b(type)j(of)g(celestial)e(projection)0
+4168 y(505)95 b(required)45 b(celestial)g(coordinate)g(keywords)h(not)h
+(found)0 4281 y(506)95 b(approximate)44 b(wcs)j(keyword)f(values)g
 (were)h(returned)p eop
 %%Trailer
 end
diff --git a/fitsio.tex b/fitsio.tex
index 6fd0595..93bf134 100644
--- a/fitsio.tex
+++ b/fitsio.tex
@@ -1,9 +1,9 @@
 \documentclass[11pt]{book}
-%\input{html.sty}
-%\htmladdtonavigation
-%   {\begin{rawhtml}
-% <A HREF="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html">FITSIO Home</A>
-%    \end{rawhtml}}
+\input{html.sty}
+\htmladdtonavigation
+   {\begin{rawhtml}
+ <A HREF="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html">FITSIO Home</A>
+    \end{rawhtml}}
 %\oddsidemargin=0.25in
 \oddsidemargin=0.00in
 \evensidemargin=0.00in
@@ -32,7 +32,7 @@
 \medskip
 \medskip
 \begin{center}
-{\Large Version 2.1\\}
+{\Large Version 2.5\\}
 \end{center}
 \bigskip
 \vskip 2.5cm
@@ -47,7 +47,7 @@ USA}
 \vfill
 \bigskip
 \begin{center}
-{\Large October 2000\\}
+{\Large July 2004\\}
 \end{center}
 \vfill
 \end{titlepage}
@@ -64,11 +64,13 @@ is provided as part of the CFITSIO library (which is written in ANSI
 C).  This is a companion document to the CFITSIO User's Guide which
 should be consulted for further information about the underlying
 CFITSIO library.  In the remainder of this document, the terms FITSIO
-and CFITSIO are interchangable and refer to the same library.
+and CFITSIO are interchangeable and refer to the same library.
 
 FITSIO/CFITSIO is a machine-independent library of routines for reading
 and writing data files in the FITS (Flexible Image Transport System)
-data format. This library was written to provide a powerful yet simple
+data format.  It can also read IRAF format image files and raw binary
+data arrays by converting them on the fly into a virtual FITS format
+file.  This library was written to provide a powerful yet simple
 interface for accessing FITS files which will run on most commonly used
 computers and workstations. FITSIO supports all the features described
 in the official NOST definition of the FITS format and can read and
@@ -110,23 +112,12 @@ package should be sent to the primary author:
 \end{verbatim}
 This User's Guide assumes that readers already have a general
 understanding of the definition and structure of FITS format files.
-Further information about FITS formats is available in the `FITS User's
-Guide' and the `NOST FITS Standard', which are available from the NASA
-Science Office of Standards and Technology at the address given below.
-Both of these documents are available electronically from their Web
-site and via anonymous ftp at nssdc.gsfc.nasa.gov in the /pub/fits
-directory. Any questions about FITS formats should be directed to the
-NOST, at:
-
-\begin{verbatim}
-        NASA, Science Office of Standards and Technology
-        Code 633.2,
-        Goddard Space Flight Center
-        Greenbelt MD 20771, USA
-        WWW: http://fits.gsfc.nasa.gov/
-        E-mail: fits@fits.gsfc.nasa.gov
-        (301) 286-2899
-\end{verbatim}
+Further information about FITS formats is available from the FITS Support
+Office at {\tt http://fits.gsfc.nasa.gov}.  In particular, the
+'NOST FITS Standard' gives the authoritative definition of the FITS data
+format, and the  `FITS User's Guide' provides additional historical background
+and practical advice on using FITS files.
+
 CFITSIO users may also be interested in the FTOOLS package of programs
 that can be used to manipulate and analyze FITS format files.
 Information about FTOOLS can be obtained on the Web or via anonymous
@@ -149,7 +140,7 @@ source files (*.c) and header files (*.h). On VAX/VMS systems 2
 assembly-code files (vmsieeed.mar and vmsieeer.mar) are also needed.
 
 The Fortran interface subroutines to the C CFITSIO routines are located
-in the f77\_wrap1.c and f77\_wrap2.c files.  These are relatively simple
+in the f77\_wrap1.c, through f77\_wrap4.c files.  These are relatively simple
 'wrappers' that translate the arguments in the Fortran subroutine into
 the appropriate format for the corresponding C routine.  This
 translation is performed transparently to the user by a set of C macros
@@ -158,45 +149,74 @@ support every combination of C and Fortran compilers so the Fortran
 interface is not supported on all platforms.  This is especially true
 for PC and Mac users (see further notes below).
 
-The CFITSIO library is built on Unix systems by typing:
+A standard combination of C and Fortran compilers will be assumed by
+default, but one may also specify a particular Fortran compiler by
+doing:
 
 \begin{verbatim}
-   > ./configure
-   > make
+ >  setenv CFLAGS -DcompilerName=1
 \end{verbatim}
-at the operating system prompt.  Type ./configure and not simply
-`configure' to ensure that the configure script in the current
-directory and not some other system-wide configure script.  The
-configure command customizes the Makefile for the particular system,
-then the `make' command compiles the source files and builds the
-library. By default this also builds the set of Fortran-callable
-wrapper routines whose calling sequences are described later in this
-document.
+(where 'compilerName' is the name of the compiler) before running
+the configure command.  The currently recognized compiler
+names are:
 
-On HP/UX systems, the environment variable CFLAGS should be set
-to -Ae before running configure to enable "extended ANSI" features.
+\begin{verbatim}
+ g77Fortran
+ IBMR2Fortran
+ CLIPPERFortran
+ pgiFortran
+ NAGf90Fortran
+ f2cFortran
+ hpuxFortran
+ apolloFortran
+ sunFortran
+ CRAYFortran
+ mipsFortran
+ DECFortran
+ vmsFortran
+ CONVEXFortran
+ PowerStationFortran
+ AbsoftUNIXFortran
+ AbsoftProFortran
+ SXFortran
+\end{verbatim}
+Alternatively, one may edit the CFLAGS line in the Makefile to add the
+'-DcompilerName' flag after running the './configure' command.
 
-It may not be possible to staticly link programs that use CFITSIO on
-some platforms (namely, on Solaris 2.6) due to the network drivers
-(which provide FTP and HTTP access to FITS files).  It is possible to
-make both a dynamic and a static version of the CFITSIO library, but
-network file access will not be possible using the static version.  To
-build the dynamic libcfitsio.so library (on solaris), type 'make
-clean', then edit the Makefile to add -fPIC or -KPIC (gcc or cc) to the
-CFLAGS line, then rebuild the library with 'make'.  Once you're done,
-build the shared library with
+The CFITSIO library is built on Unix systems by typing:
+
+\begin{verbatim}
+ >  ./configure [--prefix=/target/installation/path]
+ >  make          (or  'make shared')
+ >  make install  (this step is optional)
+\end{verbatim}
+at the operating system prompt.  The configure command customizes the
+Makefile for the particular system, then the `make' command compiles the
+source files and builds the library.  Type `./configure' and not simply
+`configure' to ensure that the configure script in the current directory
+is run and not some other system-wide configure script.  The optional
+'prefix' argument to configure gives the path to the directory where
+the CFITSIO library and include files should be installed via the later
+'make install' command. For example,
 
 \begin{verbatim}
- ld -G -z text -o libcfitsio.so *.o
+   > ./configure --prefix=/usr1/local
 \end{verbatim}
-Then to get the staticly linkable libcfitsio.a library file do another
-make clean, undefine HAVE\_NET\_SERVICES on the CFLAGS line and rebuild.
-It's unimportant whether or not you use -fPIC for static builds.
+will cause the 'make install' command to copy the CFITSIO libcfitsio file
+to /usr1/local/lib and the necessary include file to /usr1/local/include
+(assuming of course that the process has permission to write to these
+directories).
+
+By default this also builds the set of Fortran-callable
+wrapper routines whose calling sequences are described later in this
+document.
 
-When using the shared library the executable code is not copied into
-your program at link time and instead the program locates the necessary
-library code at run time, normally through LD\_LIBRARY\_PATH or some
-other method.  The advantages are:
+The 'make shared' option builds a shared or dynamic version of the
+CFITSIO library.  When using the shared library the executable code is
+not copied into your program at link time and instead the program
+locates the necessary library code at run time, normally through
+LD\_LIBRARY\_PATH or some other method. The advantages of using a shared
+library are:
 
 \begin{verbatim}
    1.  Less disk space if you build more than 1 program
@@ -214,11 +234,20 @@ The disadvantages are:
 \begin{verbatim}
    1. More hassle at runtime.  You have to either build the programs
       specially or have LD_LIBRARY_PATH set right.
-   2. There may be a slight start up penality, depending on where you are
+   2. There may be a slight start up penalty, depending on where you are
       reading the shared library and the program from and if your CPU is
       either really slow or really heavily loaded.
 \end{verbatim}
 
+On HP/UX systems, the environment variable CFLAGS should be set
+to -Ae before running configure to enable "extended ANSI" features.
+
+It may not be possible to staticly link programs that use CFITSIO on
+some platforms (namely, on Solaris 2.6) due to the network drivers
+(which provide FTP and HTTP access to FITS files).  It is possible to
+make both a dynamic and a static version of the CFITSIO library, but
+network file access will not be possible using the static version.
+
 On VAX/VMS and ALPHA/VMS systems the make\_gfloat.com command file may
 be executed to build the cfitsio.olb object library using the default
 G-floating point option for double variables.  The make\_dfloat.com and
@@ -268,14 +297,13 @@ CFITSIO has currently been tested on the following platforms:
    Linux                      gcc
    MkLinux                    DR3
    Windows 95/98/NT           Borland C++ V4.5
-   Windows 95/98/NT           Microsoft/Compaq Visual C++ v5.0, v6.0
+   Windows 95/98/NT/ME/XP     Microsoft/Compaq Visual C++ v5.0, v6.0
    Windows 95/98/NT           Cygwin gcc
    OS/2                       gcc + EMX
    MacOS 7.1 or greater       Metrowerks 10.+
 \end{verbatim}
 CFITSIO will probably run on most other Unix platforms.  Cray
-supercomputers and IBM mainframe computers are currently not
-supported.
+supercomputers are currently not supported.
 
 
 \section{Testing the Library}
@@ -304,23 +332,26 @@ release.  The diagnostic messages (which were piped to the file
 testprog.lis in the Unix example) should be identical to the listing
 contained in the file testprog.out.  The 'diff' and 'cmp' commands
 shown above should not report any differences in the files.  (There
-may be some minor formating differences, such as the presence or
+may be some minor formatting differences, such as the presence or
 absence of leading zeros, or 3 digit exponents in numbers,
 which can be ignored).
 
 The Fortran wrappers in CFITSIO may be tested with the testf77
-program on Unix systems with:
+program.  On Unix systems the fortran compilation and link command
+may be called 'f77' or 'g77', depending on the system.
 
 \begin{verbatim}
-    % f77 -o testf77 testf77.f -L. -lcfitsio -lnsl -lsocket
-  or
-    % f77 -f -o testf77 testf77.f -L. -lcfitsio    (under SUN O/S)
-  or
-    % f77 -o testf77 testf77.f -Wl,-L. -lcfitsio -lm -lnsl -lsocket (HP/UX)
+   % f77 -o testf77 testf77.f -L. -lcfitsio -lnsl -lsocket
+ or
+   % f77 -f -o testf77 testf77.f -L. -lcfitsio    (under SUN O/S)
+ or
+   % f77 -o testf77 testf77.f -Wl,-L. -lcfitsio -lm -lnsl -lsocket (HP/UX)
+ or
+   % g77 -o testf77 -s testf77.f -lcfitsio -lcc_dynamic -lncurses (Mac OS-X)
 
-    % testf77 > testf77.lis
-    % diff testf77.lis testf77.out
-    % cmp testf77.fit testf77.std
+   % testf77 > testf77.lis
+   % diff testf77.lis testf77.out
+   % cmp testf77.fit testf77.std
 \end{verbatim}
 On machines running SUN O/S, Fortran programs must be compiled with the
 '-f' option to force double precision variables to be aligned on 8-byte
@@ -348,7 +379,7 @@ A few other utility  programs are included with CFITSIO:
     cookbook - a sample program that peforms common read and
                  write operations on a FITS file.
 
-    iter_a, iter_b, iter_c - tests of the CFITSIO iterator routine
+    iter_a, iter_b, iter_c - examples of the CFITSIO iterator routine
 \end{verbatim}
 
 The first 4 of these utility programs can be compiled and linked by typing
@@ -470,6 +501,8 @@ claimed in the United States under Title 17, U.S. Code.
 Permission to freely use, copy, modify, and distribute this software
 and its documentation without fee is hereby granted, provided that this
 copyright notice and disclaimer of warranty appears in all copies.
+(However, see the restriction on the use of the gzip compression code,
+below).
 
 DISCLAIMER:
 
@@ -489,9 +522,23 @@ FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
 SERVICES PROVIDED HEREUNDER."
 
 The file compress.c contains (slightly modified) source code that
-originally came from gzip-1.2.4 which is freely distributed under the
-GNU General Public Licence.  A copy of the GNU licence is included
-at the beginning of that file.
+originally came from gzip-1.2.4, copyright (C) 1992-1993 by Jean-loup
+Gailly.  This gzip code is distributed under the GNU General Public
+License and thus requires that any software that uses the CFITSIO
+library (which in turn uses the gzip code) must conform to the
+provisions in the GNU General Public License.  A copy of the GNU
+license is included at the beginning of compress.c file.
+
+An alternate version of the compress.c file (called
+compress\_alternate.c) is provided for users who want to use the CFITSIO
+library but are unwilling or unable to publicly release their software
+under the terms of the GNU General Public License.   This alternate
+version contains non-functional stubs for the file compression and
+uncompression routines used by CFITSIO.  Replace the file `compress.c'
+with `compress\_alternate.c' before compiling the CFITSIO library.  This
+will produce a version of CFITSIO which does not support reading or
+writing compressed FITS files but is otherwise identical to the
+standard version.
 
 
 \section{Acknowledgements}
@@ -524,8 +571,10 @@ can be rapidly evaluated for each row.  Peter Wilson (RSTX, NASA/GSFC)
 then wrote the parsing routines used by CFITSIO based on Lammers'
 design, combined with other techniques such as the CFITSIO iterator
 routine to further enhance the data processing throughput.  This effort
-also benefitted from a much earlier lexical parsing routine that was
-developed by Kent Blackburn (NASA/GSFC).
+also benefited from a much earlier lexical parsing routine that was
+developed by Kent Blackburn (NASA/GSFC). More recently, Craig Markwardt
+(NASA/GSFC) implemented additional functions (median, average, stddev)
+and other enhancements to the lexical parser.
 
 The CFITSIO iterator function is loosely based on similar ideas
 developed for the XMM Data Access Layer.
@@ -606,7 +655,7 @@ exact multiple of 2880 8-bit bytes long.  Any unused space is padded
 with fill characters (ASCII blanks or zeros).
 
 Each Header Unit consists of any number of 80-character keyword records
-or `card images' which have thegeneral form:
+or `card images' which have the general form:
 
 \begin{verbatim}
   KEYNAME = value / comment string
@@ -646,10 +695,10 @@ previous Data Unit (or Header Unit if there is no Data Unit).
 The main required keywords in FITS primary arrays or image extensions are:
 \begin{itemize}
 \item
-BITPIX -- defines the datatype of the array: 8, 16, 32, -32, -64
-for unsigned 8--bit byte, 16--bit integer, 32--bit integer, 32--bit
-IEEE floating point, and 64--bit IEEE double precision floating point,
-respectively.
+BITPIX -- defines the datatype of the array: 8, 16, 32, -32, -64 for
+unsigned 8--bit byte, 16--bit signed integer, 32--bit signed integer,
+32--bit IEEE floating point, and 64--bit IEEE double precision floating
+point, respectively.
 \item
 NAXIS --  the number of dimensions in the array, usually 0, 1, 2, 3, or 4.
 \item
@@ -673,8 +722,9 @@ TFORMn -- the datatype of the column
 TUNITn -- the physical units of the column (optional)
 \end{itemize}
 
-Users should refer to the NOST documentation for more details about the
-required keywords and their allowed values.
+Users should refer to the FITS Support Office at {\tt http://fits.gsfc.nasa.gov}
+for futher information about the FITS format and related software
+packages.
 
 
 \chapter{  Extended File Name Syntax }
@@ -693,7 +743,8 @@ end with the '.imh' extension, as well as reading and writing FITS
 files,   This feature is implemented in CFITSIO by first converting the
 IRAF image into a temporary FITS format file in memory, then opening
 the FITS file.  Any of the usual CFITSIO routines then may be used to
-read the image header or data.
+read the image header or data.  Similarly, raw binary data arrays can
+be read by converting them on the fly into virtual FITS images.
 
 \item
 FITS files on the internet can be read (and sometimes written) using the FTP,
@@ -710,6 +761,10 @@ writing the same FITS files on magnetic disk.
 \item
 Compressed FITS files in gzip or Unix COMPRESS format can be directly read.
 
+\item
+Output FITS files can be written directly in compressed gzip format,
+thus saving disk space.
+
 \item
 FITS table columns can be created, modified, or deleted 'on-the-fly' as
 the table is opened by CFITSIO.  This creates a virtual FITS file containing
@@ -756,6 +811,17 @@ directory.
 fly into a temporary FITS format image in memory which can then be read with
 any other CFITSIO routine.
 
+\item
+{\tt rawfile.dat[i512,512]}: opens a raw binary data array (a 512 x 512
+short integer array in this case) and converts it on the fly into a
+temporary FITS format image in memory which can then be read with any
+other CFITSIO routine.
+
+\item
+{\tt myfile.fits.gz}: if this is the name of a new output file, the '.gz'
+suffix will cause it to be compressed in gzip format when it is written to
+disk.
+
 \item
 {\tt 'myfile.fits.gz[events, 2]'}:  opens and uncompresses the gzipped file
 myfile.fits then moves to the extension which has the keywords EXTNAME
@@ -844,11 +910,9 @@ completely transparent to the application program, which simply sees
 the final 2-D image in the primary array of the opened file.
 \end{itemize}
 
-
-\section{Detailed Filename Syntax}
-
-This section describes the full extended syntax for the FITSIO FITS file names.
-The filename can contain several different components depending on the context:
+The full extended CFITSIO FITS file name can contain several different
+components depending on the context.  These components are described in
+the following sections:
 
 \begin{verbatim}
 When creating a new file:
@@ -868,7 +932,7 @@ processed first by CFITSIO, followed by the rowFilter specifier, and
 finally by the binSpec specifier.
 
 
-\subsection{Filetype}
+\section{Filetype}
 
 The type of file determines the medium on which the file is located
 (e.g., disk or network) and, hence, which internal device driver is used by
@@ -881,6 +945,8 @@ CFITSIO to read and/or write the file.  Currently supported types are
                    for accessing password-protected ftp sites.
         http://  - a readonly file accessed with the HTTP protocol.  It
                    does not  support username:password like the ftp driver.
+                   Proxy HTTP servers are supported using the http_proxy
+                   environment variable.
         root://  - uses the CERN root protocol for writing as well as
                    reading files over the network.
         shmem:// - opens or creates a file which persists in the computer's
@@ -894,14 +960,23 @@ If the filetype is not specified, then type file:// is assumed.
 The double slashes '//' are optional and may be omitted in most cases.
 
 
-\subsubsection*{Notes about the root filetype}
+\subsection{Notes about HTTP proxy servers}
 
-
-The original rootd server can be obtained from:
+A proxy HTTP server may be used by defining the address (URL) and port
+number of the proxy server with the http\_proxy environment variable.
+For example
 
 \begin{verbatim}
-       ftp://root.cern.ch/root/rootd.tar.gz
+    setenv http_proxy http://heasarc.gsfc.nasa.gov:3128
 \end{verbatim}
+will cause CFITSIO to use port 3128 on the heasarc proxy server whenever
+reading a FITS file with HTTP.
+
+
+\subsection{Notes about the root filetype}
+
+The original rootd server can be obtained from:
+\verb-ftp://root.cern.ch/root/rootd.tar.gz-
 but, for it to work correctly with CFITSIO one has to use a modified
 version which supports a command to return the length of the file.
 This modified version is available in rootd subdirectory
@@ -928,12 +1003,8 @@ and to /etc/inetd.conf, add the following line:
 \end{verbatim}
 Force inetd to reread its conf file with "kill -HUP <pid inetd>".
 You can also start rootd by hand running directly under your private
-account (no root system priviliges needed). For example to start
-rootd listening on port 5151 just type:
-
-\begin{verbatim}
-  rootd -p 5151
-\end{verbatim}
+account (no root system privileges needed). For example to start
+rootd listening on port 5151 just type:   \verb+rootd -p 5151+
 Notice: no \& is needed. Rootd will go into background by itself.
 
 \begin{verbatim}
@@ -987,8 +1058,7 @@ accessed.  Anonymous mode only works when the server is started via
 inetd.
 
 
-
-\subsubsection*{Notes about the shmem filetype:}
+\subsection{Notes about the shmem filetype:}
 
 Shared memory files are currently supported on most Unix platforms,
 where the shared memory segments are managed by the operating system
@@ -1015,7 +1085,7 @@ the usual CFITSIO routine:
 \end{verbatim}
 The file mode can be READWRITE or READONLY just as with disk files.
 More than one process can operate on READONLY mode files at the same
-time.  CFITSIO supports proper filelocking (both in READONLY and
+time.  CFITSIO supports proper file locking (both in READONLY and
 READWRITE modes), so calls to fits\_open\_file may be locked out until
 another other process closes the file.
 
@@ -1036,7 +1106,7 @@ driver. To get a list of all the shared memory objects, run the system
 utility program `ipcs  [-a]'.
 
 
-\subsection{Base Filename}
+\section{Base Filename}
 
 The base filename is the name of the file optionally including the
 director/subdirectory path, and in the case of `ftp', `http', and `root'
@@ -1059,7 +1129,14 @@ so if it is used  on the command line rather than entered at a task
 prompt, it must be  preceded by a backslash to force the UNIX
 shell to pass it verbatim to the application program.
 
-The input file may be compressed with the gzip or Unix compress
+If the output disk file name ends with the suffix '.gz', then CFITSIO
+will compress the file using the gzip compression algorithm before
+writing it to disk.  This can reduce the amount of disk space used by
+the file.  Note that this feature requires that the uncompressed file
+be constructed in memory before it is compressed and written to disk,
+so it can fail if there is insufficient available memory.
+
+An input FITS file may be compressed with the gzip or Unix compress
 algorithms, in which case CFITSIO will uncompress the file on the fly
 into a temporary file (in memory or on disk).  Compressed files may
 only be opened with read-only permission.  When specifying the name of
@@ -1076,19 +1153,66 @@ FITS file, so in this case, the output filename specifier (see the next
 section) can be used to further control how CFITSIO reads ftp and http
 files.
 
-One special case is where the filename = `-' (a dash or minus sign),
-which signifies that the input file is to be read from the stdin
-stream, or written to the stdout stream if a new output file is being
-created.  In the case of reading from stdin, CFITSIO first copies the
-whole stream into a temporary FITS file (in memory or on disk), and
-subsequent reading of the FITS file occurs in this copy.  When writing
-to stdout, CFITSIO first constructs the whole file in memory (since
-random access is required), then flushes it out to the stdout stream
-when the file is closed.  This feature allows FITS files to be piped
-between tasks in memory rather than having to create temporary
-intermediate FITS files on disk.  For example if task1 creates an
-output FITS file, and task2 reads an input FITS file, the FITS file may
-be piped between the 2 tasks by specifying
+If the input file is an IRAF image file (*.imh file) then CFITSIO will
+automatically convert it on the fly into a virtual FITS image before it
+is opened by the application program.  IRAF images can only be opened
+with READONLY file access.
+
+Similarly, if the input file is a raw binary data array, then CFITSIO
+will convert it on the fly into a virtual FITS image with the basic set
+of required header keywords before it is opened by the application
+program (with READONLY access).  In this case the data type and
+dimensions of the image must be specified in square brackets following
+the filename (e.g. rawfile.dat[ib512,512]). The first character (case
+insensitive) defines the datatype of the array:
+
+\begin{verbatim}
+     b         8-bit unsigned byte
+     i        16-bit signed integer
+     u        16-bit unsigned integer
+     j        32-bit signed integer
+     r or f   32-bit floating point
+     d        64-bit floating point
+\end{verbatim}
+An optional second character specifies the byte order of the array
+values: b or B indicates big endian (as in FITS files and the native
+format of SUN UNIX workstations and Mac PCs) and l or L indicates
+little endian (native format of DEC OSF workstations and IBM PCs).  If
+this character is omitted then the array is assumed to have the native
+byte order of the local machine.  These datatype characters are then
+followed by a series of one or more integer values separated by commas
+which define the size of each dimension of the raw array.  Arrays with
+up to 5 dimensions are currently supported.  Finally, a byte offset to
+the position of the first pixel in the data file may be specified by
+separating it with a ':' from the last dimension value.  If omitted, it
+is assumed that the offset = 0.  This parameter may be used to skip
+over any header information in the file that precedes the binary data.
+Further examples:
+
+\begin{verbatim}
+  raw.dat[b10000]           1-dimensional 10000 pixel byte array
+  raw.dat[rb400,400,12]     3-dimensional floating point big-endian array
+  img.fits[ib512,512:2880]  reads the 512 x 512 short integer array in
+                            a FITS file, skipping over the 2880 byte header
+\end{verbatim}
+
+One special case of input file is where the filename = `-' (a dash or
+minus sign) or 'stdin' or 'stdout', which signifies that the input file
+is to be read from the stdin stream, or written to the stdout stream if
+a new output file is being created.  In the case of reading from stdin,
+CFITSIO first copies the whole stream into a temporary FITS file (in
+memory or on disk), and subsequent reading of the FITS file occurs in
+this copy.  When writing to stdout, CFITSIO first constructs the whole
+file in memory (since random access is required), then flushes it out
+to the stdout stream when the file is closed.   In addition, if the
+output filename = '-.gz' or 'stdout.gz' then it will be gzip compressed
+before being written to stdout.
+
+This ability to read and write on the stdin and stdout steams allows
+FITS files to be piped between tasks in memory rather than having to
+create temporary intermediate FITS files on disk.  For example if task1
+creates an output FITS file, and task2 reads an input FITS file, the
+FITS file may be piped between the 2 tasks by specifying
 
 \begin{verbatim}
    task1 - | task2 -
@@ -1097,8 +1221,7 @@ where the vertical bar is the Unix piping symbol.  This assumes that the 2
 tasks read the name of the FITS file off of the command line.
 
 
-
-\subsection{Output File Name when Opening an Existing File}
+\section{Output File Name when Opening an Existing File}
 
 An optional output filename may be specified in parentheses immediately
 following the base file name to be opened.  This is mainly useful in
@@ -1116,10 +1239,7 @@ immediately following the base file name.  The output filename can
 include the '!' clobber flag.
 
 Thus, if the input filename to CFITSIO is:
-
-\begin{verbatim}
-    file1.fits.gz(file2.fits)
-\end{verbatim}
+\verb+file1.fits.gz(file2.fits)+
 then CFITSIO will uncompress `file1.fits.gz' into the local disk file
 `file2.fits' before opening it.  CFITSIO does not automatically delete
 the output file, so it will still exist after the application program
@@ -1189,7 +1309,7 @@ using the output file specifier with FTP or HTTP file types, to make
 sure they get the behavior that they expect.
 
 
-\subsection{Template File Name when Creating a New File}
+\section{Template File Name when Creating a New File}
 
 When a new FITS file is created with a call to fits\_create\_file, the
 name of a template file may be supplied in parentheses immediately
@@ -1203,378 +1323,163 @@ general) describes one FITS keyword record.  The format of the ASCII
 template file is described below.
 
 
+\section{HDU Location Specification}
 
-\subsubsection*{Detailed Template Line Format}
+The optional HDU location specifier defines which HDU (Header-Data
+Unit, also known as an `extension') within the FITS file to initially
+open.  It must immediately follow the base file name (or the output
+file name if present).  If it is not specified then the first HDU (the
+primary array) is opened.  The HDU location specifier is required if
+the colFilter, rowFilter, or binSpec specifiers are present, because
+the primary array is not a valid HDU for these operations. The HDU may
+be specified either by absolute position number, starting with 0 for
+the primary array, or by reference to the HDU name, and optionally, the
+version number and the HDU type of the desired extension.  The location
+of an image within a single cell of a binary table may also be
+specified, as described below.
 
-The format of each ASCII template line closely follows the format of a
-FITS keyword record:
+The absolute position of the extension is specified either by enclosed
+the number in square brackets (e.g., `[1]' = the first extension
+following the primary array) or by preceded the number with a plus sign
+(`+1').  To specify the HDU by name, give the name of the desired HDU
+(the value of the EXTNAME or HDUNAME keyword) and optionally the
+extension version number (value of the EXTVER keyword) and the
+extension type (value of the XTENSION keyword: IMAGE, ASCII or TABLE,
+or BINTABLE), separated by commas and all enclosed in square brackets.
+If the value of EXTVER and XTENSION are not specified, then the first
+extension with the correct value of EXTNAME is opened. The extension
+name and type are not case sensitive, and the extension type may be
+abbreviated to a single letter (e.g., I = IMAGE extension or primary
+array, A or T = ASCII table extension, and B = binary table BINTABLE
+extension).   If the HDU location specifier is equal to `[PRIMARY]' or
+`[P]', then the primary array (the first HDU) will be opened.
+
+FITS images are most commonly stored in the primary array or an image
+extension, but images can also be stored as a vector in a single cell
+of a binary table (i.e. each row of the vector column contains a
+different image).  Such an image can be opened with CFITSIO by
+specifying the desired column  name and the row number after the binary
+table HDU specifier as shown in the following examples. The column name
+is separated from the HDU specifier by a semicolon and the row number
+is enclosed in parentheses.  In this case CFITSIO copies the image from
+the table cell into a temporary primary array before it is opened.  The
+application program then just sees the image in the primary array,
+without any extensions.  The particular row to be opened may be
+specified either by giving an absolute integer row number (starting
+with 1 for the first row), or by specifying a boolean expression that
+evaluates to TRUE for the desired row.  The first row that satisfies
+the expression will be used.  The row selection expression has the same
+syntax as described in the Row Filter Specifier section, below.
+
+ Examples:
 
 \begin{verbatim}
-  KEYWORD = KEYVALUE / COMMENT
+   myfile.fits[3] - open the 3rd HDU following the primary array
+   myfile.fits+3  - same as above, but using the FTOOLS-style notation
+   myfile.fits[EVENTS] - open the extension that has EXTNAME = 'EVENTS'
+   myfile.fits[EVENTS, 2]  - same as above, but also requires EXTVER = 2
+   myfile.fits[events,2,b] - same, but also requires XTENSION = 'BINTABLE'
+   myfile.fits[3; images(17)] - opens the image in row 17 of the 'images'
+                                column in the 3rd extension of the file.
+   myfile.fits[3; images(exposure > 100)] - as above, but opens the image
+                   in the first row that has an 'exposure' column value
+                   greater than 100.
 \end{verbatim}
-except that free format may be used (e.g., the equals sign may appear
-at any position in the line) and TAB characters are allowed and are
-treated the same as space characters.  The KEYVALUE and COMMENT fields
-are optional.  The equals sign character is also optional, but it is
-recommended that it be included for clarity.  Any template line that
-begins with the pound '\#' character is ignored by the template parser
-and may be use to insert comments into the template file itself.
 
-The KEYWORD name field is limited to 8 characters in length and only
-the letters A-Z, digits 0-9, and the hyphen and underscore characters
-may be used, without any embedded spaces. Lowercase letters in the
-template keyword name will be converted to uppercase.  Leading spaces
-in the template line preceding the keyword name are generally ignored,
-except if the first 8 characters of a template line are all blank, then
-the entire line is treated as a FITS comment keyword (with a blank
-keyword name) and is copied verbatim into the FITS header.
 
-The KEYVALUE field may have any allowed  FITS  data type: character
-string, logical, integer, real, complex integer, or complex real.  The
-character string values need not be enclosed in single quote characters
-unless they are necessary to distinguish the string from a different
-data type (e.g.  2.0 is a real but '2.0' is a string).  The keyword has
-an undefined (null) value if the template record only contains blanks
-following the "=" or between the "=" and the "/" comment field
-delimiter.
+\section{Image Section}
 
-String keyword values longer than 68 characters (the maximum length
-that will fit in a single FITS keyword record) are permitted using the
-CFITSIO long string convention. They can either be specified as a
-single long line in the template, or by using multiple lines where the
-continuing lines contain the 'CONTINUE' keyword, as in this example:
+A virtual file containing a rectangular subsection of an image can be
+extracted and opened by specifying the range of pixels (start:end)
+along each axis to be extracted from the original image.  One can also
+specify an optional pixel increment (start:end:step) for each axis of
+the input image.  A pixel step = 1 will be assumed if it is not
+specified.  If the start pixel is larger then the end pixel, then the
+image will be flipped (producing a mirror image) along that dimension.
+An asterisk, '*', may be used to specify the entire range of an axis,
+and '-*' will flip the entire axis. The input image can be in the
+primary array, in an image extension, or contained in a vector cell of
+a binary table. In the later 2 cases the extension name or number must
+be specified before the image section specifier.
+
+ Examples:
 
 \begin{verbatim}
-  LONGKEY = 'This is a long string value that is contin&'
-  CONTINUE  'ued over 2 records' / comment field goes here
-\end{verbatim}
-The format of template lines with CONTINUE keyword is very strict:  3
-spaces must follow CONTINUE and the rest of the line is copied verbatim
-to the FITS file.
+  myfile.fits[1:512:2, 2:512:2] -  open a 256x256 pixel image
+              consisting of the odd numbered columns (1st axis) and
+              the even numbered rows (2nd axis) of the image in the
+              primary array of the file.
 
-The start of the optional COMMENT field must be preceded by "/", which
-is used to separate it from the keyword value field. Exceptions are if
-the KEYWORD name field contains COMMENT, HISTORY, CONTINUE, or if the
-first 8 characters of the template line are blanks.
+  myfile.fits[*, 512:256] - open an image consisting of all the columns
+              in the input image, but only rows 256 through 512.
+              The image will be flipped along the 2nd axis since
+              the starting pixel is greater than the ending pixel.
 
-More than one Header-Data Unit (HDU) may be defined in the template
-file.  The start of an HDU definition is denoted with a SIMPLE or
-XTENSION template line:
+  myfile.fits[*:2, 512:256:2] - same as above but keeping only
+              every other row and column in the input image.
 
-1) SIMPLE begins a Primary HDU definition. SIMPLE may only appear as
-the  first keyword in the template file. If the template file begins
-with XTENSION instead of SIMPLE, then a default empty Primary HDU is
-created, and the template is then assumed to define the keywords
-starting with the first extension following the Primary HDU.
+  myfile.fits[-*, *] - copy the entire image, flipping it along
+              the first axis.
 
-2) XTENSION marks the beginning of a new extension HDU definition.  The
-previous HDU will be closed at this point and processing of the next
-extension begins.
+  myfile.fits[3][1:256,1:256] - opens a subsection of the image that
+              is in the 3rd extension of the file.
 
+  myfile.fits[4; images(12)][1:10,1:10] - open an image consisting
+	      of the first 10 pixels in both dimensions. The original
+	      image resides in the 12th row of the 'images' vector
+	      column in the table in the 4th extension of the file.
+\end{verbatim}
 
-\subsubsection*{Auto-indexing of Keywords}
+When CFITSIO opens an image section it first creates a temporary file
+containing the image section plus a copy of any other HDUs in the
+file.  This temporary file is then opened by the application program,
+so it is not possible to write to or modify the input file when
+specifying an image section.  Note that CFITSIO automatically updates
+the world coordinate system keywords in the header of the image
+section, if they exist, so that the coordinate associated with each
+pixel in the image section will be computed correctly.
 
-If a template keyword name ends with a "\#" character, it is said to be
-'auto-indexed'.   Each "\#" character will be replaced by the current
-integer index value, which gets reset = 1 at the start of each new HDU
-in the file (or 7 in the special case of a GROUP definition).  The
-FIRST indexed keyword in each template HDU definition is used as the
-'incrementor';  each subsequent occurence of this SAME keyword will
-cause the index value to be incremented.  This behavior can be rather
-subtle, as illustrated in the following examples in which the TTYPE
-keyword is the incrementor in both cases:
 
-\begin{verbatim}
-  TTYPE# = TIME
-  TFORM# = 1D
-  TTYPE# = RATE
-  TFORM# = 1E
-\end{verbatim}
-will create TTYPE1, TFORM1, TTYPE2, and TFORM2 keywords.  But if the
-template looks like,
+\section{Column and Keyword Filtering Specification}
 
-\begin{verbatim}
-  TTYPE# = TIME
-  TTYPE# = RATE
-  TFORM# = 1D
-  TFORM# = 1E
-\end{verbatim}
-this results in a FITS files with  TTYPE1, TTYPE2, TFORM2, and TFORM2,
-which is probably not what was intended!
+The optional column/keyword filtering specifier is used to modify the
+column structure and/or the header keywords in the HDU that was
+selected with the previous HDU location specifier. This filtering
+specifier must be enclosed in square brackets and can be distinguished
+from a general row filter specifier (described below) by the fact that
+it begins with the string 'col ' and is not immediately followed by an
+equals sign.  The original file is not changed by this filtering
+operation, and instead the modifications are made on a copy of the
+input FITS file (usually in memory), which also contains a copy of all
+the other HDUs in the file.  This temporary file is passed to the
+application program and will persist only until the file is closed or
+until the program exits, unless the outfile specifier (see above) is
+also supplied.
 
+The column/keyword filter can be used to perform the following
+operations.  More than one operation may be specified by separating
+them with semi-colons.
 
-\subsubsection*{Template Parser Directives}
+\begin{itemize}
 
-In addition to the template lines which define individual keywords, the
-template parser recognizes 3 special directives which are each preceded
-by the backslash character:  \verb+ \include, \group+, and \verb+ \end+.
+\item
+Copy only a specified list of columns columns to the filtered input file.
+The list of column name should be separated by semi-colons.  Wild card
+characters may be used in the column names to match multiple columns.
+If the expression contains both a list of columns to be included and
+columns to be deleted, then all the columns in the original table
+except the explicitly deleted columns will appear in the filtered
+table (i.e., there is no need to explicitly list the columns to
+be included if any columns are being deleted).
 
-The 'include' directive must be followed by a filename. It forces the
-parser to temporarily stop reading the current template file and begin
-reading the include file. Once the parser reaches the end of the
-include file it continues parsing the current template file.  Include
-files can be nested, and HDU definitions can span multiple template
-files.
-
-The start of a GROUP definition is denoted with the 'group' directive,
-and the end of a GROUP definition is denoted with the 'end' directive.
-Each GROUP contains 0 or more member blocks (HDUs or GROUPs). Member
-blocks of type GROUP can contain their own member blocks. The GROUP
-definition itself occupies one FITS file HDU of special type (GROUP
-HDU), so if a template specifies 1 group with 1 member HDU like:
-
-\begin{verbatim}
-\group
-grpdescr = 'demo'
-xtension bintable
-# this bintable has 0 cols, 0 rows
-\end
-\end{verbatim}
-then the parser creates a FITS file with 3 HDUs :
-
-\begin{verbatim}
-1) dummy PHDU
-2) GROUP HDU (has 1 member, which is bintable in HDU number 3)
-3) bintable (member of GROUP in HDU number 2)
-\end{verbatim}
-Technically speaking, the GROUP HDU is a BINTABLE with 6 columns. Applications
-can define additional columns in a GROUP HDU using TFORMn and TTYPEn
-(where n is 7, 8, ....) keywords or their auto-indexing equivalents.
-
-For a more complicated example of a template file using the group directives,
-look at the sample.tpl file that is included in the CFITSIO distribution.
-
-
-\subsubsection*{Formal Template Syntax}
-
-The template syntax can formally be defined as follows:
-
-\begin{verbatim}
-    TEMPLATE = BLOCK [ BLOCK ... ]
-
-       BLOCK = { HDU | GROUP }
-
-       GROUP = \GROUP [ BLOCK ... ] \END
-
-         HDU = XTENSION [ LINE ... ] { XTENSION | \GROUP | \END | EOF }
-
-        LINE = [ KEYWORD [ = ] ] [ VALUE ] [ / COMMENT ]
-
-    X ...     - X can be present 1 or more times
-    { X | Y } - X or Y
-    [ X ]     - X is optional
-\end{verbatim}
-
-At the topmost level, the template defines 1 or more template blocks. Blocks
-can be either HDU (Header Data Unit) or a GROUP. For each block the parser
-creates 1 (or more for GROUPs) FITS file HDUs.
-
-
-
-\subsubsection*{Errors}
-
-In general the fits\_execute\_template() function tries to be as atomic
-as possible, so either everything is done or nothing is done. If an
-error occurs during parsing of the template, fits\_execute\_template()
-will (try to) delete the top level BLOCK (with all its children if any)
-in which the error occured, then it will stop reading the template file
-and it will return with an error.
-
-
-\subsubsection*{Examples}
-
-1. This template file will create a 200 x 300 pixel image, with 4-byte
-integer pixel values, in the primary HDU:
-
-\begin{verbatim}
-  SIMPLE = T
-  BITPIX = 32
-  NAXIS = 2     / number of dimensions
-  NAXIS1 = 100  / length of first axis
-  NAXIS2 = 200  / length of second axis
-  OBJECT = NGC 253 / name of observed object
-\end{verbatim}
-The allowed values of BITPIX are 8, 16, 32, -32, or -64,
-representing, respectively, 8-bit integer, 16-bit integer, 32-bit
-integer, 32-bit floating point, or 64 bit floating point pixels.
-
-2.  To create a FITS  table, the template first needs to include
-XTENSION = TABLE or BINTABLE to define whether it is an ASCII or binary
-table, and NAXIS2 to define the number of rows in the table.  Two
-template lines are then needed to define the name (TTYPEn) and FITS data
-format (TFORMn) of the columns, as in this example:
-
-\begin{verbatim}
-  xtension = bintable
-  naxis2 = 40
-  ttype# = Name
-  tform# = 10a
-  ttype# = Npoints
-  tform# = j
-  ttype# = Rate
-  tunit# = counts/s
-  tform# = e
-\end{verbatim}
-The above example defines a null primary array followed by a 40-row
-binary table extension with 3 columns called 'Name', 'Npoints', and
-'Rate', with data formats of '10A' (ASCII character string), '1J'
-(integer) and '1E' (floating point), respectively.  Note that the other
-required FITS keywords (BITPIX, NAXIS, NAXIS1, PCOUNT, GCOUNT, TFIELDS,
-and END) do not need to be explicitly defined in the template because
-their values can be inferred from the other keywords in the template.
-This example also illustrates that the templates are generally
-case-insensitive (the keyword names and TFORMn values are converted to
-upper-case in the FITS file) and that string keyword values generally
-do not need to be enclosed in quotes.
-
-
-
-\subsection{HDU Location Specification}
-
-The optional HDU location specifier defines which HDU (Header-Data
-Unit, also known as an `extension') within the FITS file to initially
-open.  It must immediately follow the base file name (or the output
-file name if present).  If it is not specified then the first HDU (the
-primary array) is opened.  The HDU location specifier is required if
-the colFilter, rowFilter, or binSpec specifiers are present, because
-the primary array is not a valid HDU for these operations. The HDU may
-be specified either by absolute position number, starting with 0 for
-the primary array, or by reference to the HDU name, and optionally, the
-version number and the HDU type of the desired extension.  The location
-of an image within a single cell of a binary table may also be
-specified, as described below.
-
-The absolute position of the extension is specified either by enclosed
-the number in square brackets (e.g., `[1]' = the first extension
-following the primary array) or by preceded the number with a plus sign
-(`+1').  To specify the HDU by name, give the name of the desired HDU
-(the value of the EXTNAME or HDUNAME keyword) and optionally the
-extension version number (value of the EXTVER keyword) and the
-extension type (value of the XTENSION keyword: IMAGE, ASCII or TABLE,
-or BINTABLE), separated by commas and all enclosed in square brackets.
-If the value of EXTVER and XTENSION are not specified, then the first
-extension with the correct value of EXTNAME is opened. The extension
-name and type are not case sensitive, and the extension type may be
-abbreviated to a single letter (e.g., I = IMAGE extension or primary
-array, A or T = ASCII table extension, and B = binary table BINTABLE
-extension).   If the HDU location specifier is equal to `[PRIMARY]' or
-`[P]', then the primary array (the first HDU) will be opened.
-
-FITS images are most commonly stored in the primary array or an image
-extension, but images can also be stored as a vector in a single cell
-of a binary table (i.e. each row of the vector column contains a
-different image).  Such an image can be opened with CFITSIO by
-specifying the desired column  name and the row number after the binary
-table HDU specifier as shown in the following examples. The column name
-is separated from the HDU specifier by a semicolon and the row number
-is enclosed in parentheses.  In this case CFITSIO copies the image from
-the table cell into a temporary primary array before it is opened.  The
-application program then just sees the image in the primary array,
-without any extensions.  The particular row to be opened may be
-specified either by giving an absolute integer row number (starting
-with 1 for the first row), or by specifying a boolean expression that
-evaluates to TRUE for the desired row.  The first row that satisfies
-the expression will be used.  The row selection expression has the same
-syntax as described in the Row Filter Specifier section, below.
-
- Examples:
-
-\begin{verbatim}
-   myfile.fits[3] - open the 3rd HDU following the primary array
-   myfile.fits+3  - same as above, but using the FTOOLS-style notation
-   myfile.fits[EVENTS] - open the extension that has EXTNAME = 'EVENTS'
-   myfile.fits[EVENTS, 2]  - same as above, but also requires EXTVER = 2
-   myfile.fits[events,2,b] - same, but also requires XTENSION = 'BINTABLE'
-   myfile.fits[3; images(17)] - opens the image in row 17 of the 'images'
-                                column in the 3rd extension of the file.
-   myfile.fits[3; images(exposure > 100)] - as above, but opens the image
-                   in the first row that has an 'exposure' column value
-                   greater than 100.
-\end{verbatim}
-
-
-\subsection{age Section}
-
-A virtual file containing a rectangular subsection of an image can be
-extracted and opened by specifying the range of pixels (start:end)
-along each axis to be extracted from the original image.  One can also
-specify an optional pixel increment (start:end:step) for each axis of
-the input image.  A pixel step = 1 will be assumed if it is not
-specified.  If the start pixel is larger then the end pixel, then the
-image will be flipped (producing a mirror image) along that dimension.
-An asterisk, '*', may be used to specify the entire range of an axis,
-and '-*' will flip the entire axis. The input image can be in the
-primary array, in an image extension, or contained in a vector cell of
-a binary table. In the later 2 cases the extension name or number must
-be specified before the image section specifier.
-
- Examples:
-
-\begin{verbatim}
-  myfile.fits[1:512:2, 2:512:2] -  open a 256x256 pixel image
-              consisting of the odd numbered columns (1st axis) and
-              the even numbered rows (2nd axis) of the image in the
-              primary array of the file.
-
-  myfile.fits[*, 512:256] - open an image consisting of all the columns
-              in the input image, but only rows 256 through 512.
-              The image will be flipped along the 2nd axis since
-              the starting pixel is greater than the ending pixel.
-
-  myfile.fits[*:2, 512:256:2] - same as above but keeping only
-              every other row and column in the input image.
-
-  myfile.fits[-*, *] - copy the entire image, flipping it along
-              the first axis.
-
-  myfile.fits[3][1:256,1:256] - opens a subsection of the image that
-              is in the 3rd extension of the file.
-
-  myfile.fits[4; images(12)][1:10,1:10] - open an image consisting
-	      of the first 10 pixels in both dimensions. The original
-	      image resides in the 12th row of the 'images' vector
-	      column in the table in the 4th extension of the file.
-\end{verbatim}
-
-When CFITSIO opens an image section it first creates a temporary file
-containing the image section plus a copy of any other HDUs in the
-file.  This temporary file is then opened by the application program,
-so it is not possible to write to or modify the input file when
-specifying an image section.  Note that CFITSIO automatically updates
-the world coordinate system keywords in the header of the image
-section, if they exist, so that the coordinate associated with each
-pixel in the image section will be computed correctly.
-
-
-\subsection{Column and Keyword Filtering Specification}
-
-The optional column/keyword filtering specifier is used to modify the
-column structure and/or the header keywords in the HDU that was
-selected with the previous HDU location specifier. This filtering
-specifier must be enclosed in square brackets and can be distinguished
-from a general row filter specifier (described below) by the fact that
-it begins with the string 'col ' and is not immediately followed by an
-equals sign.  The original file is not changed by this filtering
-operation, and instead the modifications are made on a copy of the
-input FITS file (usually in memory), which also contains a copy of all
-the other HDUs in the file.  This temporary file is passed to the
-application program and will persist only until the file is closed or
-until the program exits, unless the outfile specifier (see above) is
-also supplied.
-
-The column/keyword filter can be used to perform the following
-operations.  More than one operation may be specified by separating
-them with semi-colons.
-
-\begin{itemize}
-\item
-Delete a column or keyword by listing the name preceeded by an
-exclamation mark (!), e.g., '!TIME' will delete the TIME column if it
-exists, otherwise the TIME keyword.  An error is returned if neither a
-column nor keyword with this name exists.  Note  that the exclamation
-point,  '!', is a special UNIX character, so if it is used  on the
-command line rather than entered at a task prompt, it must be  preceded
-by a backslash to force the UNIX shell to ignore it.
+\item
+Delete a column or keyword by listing the name preceded by a minus
+sign or an exclamation mark (!), e.g., '-TIME' will delete the TIME
+column if it exists, otherwise the TIME keyword.  An error is returned
+if neither a column nor keyword with this name exists.  Note  that the
+exclamation point,  '!', is a special UNIX character, so if it is used
+on the command line rather than entered at a task prompt, it must be
+preceded by a backslash to force the UNIX shell to ignore it.
 
 \item
 Rename an existing column or keyword with the syntax 'NewName ==
@@ -1595,7 +1500,7 @@ the form of the expression (may be a character string, logical, bit, long
 integer, or double column). An appropriate vector count (in the case
 of binary tables) will also be added if not explicitly specified.
 
-When creating a new keyword, the keyword name must be preceeded by a
+When creating a new keyword, the keyword name must be preceded by a
 pound sign '\#', and the expression must evaluate to a scalar
 (i.e., cannot have a column name in the expression).  The comment
 string for the keyword may be specified in parentheses immediately
@@ -1608,22 +1513,35 @@ giving the name followed by an equals sign and an arithmetic
 expression.
 \end{itemize}
 
-The expression that is used when appending or recomuting columns or
+The expression that is used when appending or recomputing columns or
 keywords can be arbitrarily complex and may be a function of other
 header keyword values and other columns (in the same row).  The full
 syntax and available functions for the expression are described below
 in the row filter specification section.
 
+If the expression contains both a list of columns to be included and
+columns to be deleted, then all the columns in the original table
+except the explicitly deleted columns will appear in the filtered
+table.
+
 For  complex  or commonly used operations,  one  can also  place the
-operations into a text  file and  import it  into the  column filter
-using  the syntax '[col @filename.txt]'.   The operations can extend
-over multiple lines of the  file, but multiple operations must still
-be separated by semicolons.
+operations into an external text  file and import it  into the  column
+filter using  the syntax '[col @filename.txt]'.   The operations can
+extend over multiple lines of the  file, but multiple operations must
+still be separated by semicolons.   Any lines in the external text file
+that begin with 2 slash characters ('//') will be ignored and may be
+used to add comments into the file.
 
 Examples:
 
 \begin{verbatim}
-   [col !TIME; Good == STATUS]   - deletes the TIME column and
+   [col Time;rate]               - only the Time and rate columns will
+                                   appear in the filtered input file.
+
+   [col Time;*raw]               - include the Time column and any other
+                                   columns whose name ends with 'raw'.
+
+   [col -TIME; Good == STATUS]   - deletes the TIME column and
                                    renames the status column to 'Good'
 
    [col PI=PHA * 1.1 + 0.2]      - creates new PI column from PHA values
@@ -1633,30 +1551,47 @@ Examples:
 \end{verbatim}
 
 
-\subsection{Row Filtering Specification}
+\section{Row Filtering Specification}
 
-    The  optional row filter is a  boolean expression enclosed in square
-    brackets for filtering or selecting rows from  the input FITS table.
-    A new FITS file is then created  which contains only those
-    rows for  which  the boolean   expression evaluates  to true.   (The
-    primary array and any  other extensions in the  input file  are also
-    copied to the new file).  The original FITS file is closed and
-    the new  file  is opened  and  passed to  the  application
-    program.  The new file will persist only until the file is closed
-    or until the program exits, unless the output file specifier (see
-    above) is also supplied.
+    When entering the name of a FITS table that is to be opened by a
+    program, an optional row filter may be specified to select a subset
+    of the rows in the table.  A temporary new FITS file is created on
+    the fly which contains only those rows for which the row filter
+    expression evaluates to true.  (The primary array and any other
+    extensions in the input file are also copied to the temporary
+    file).  The original FITS file is closed and the new virtual file
+    is opened by the application program.  The row filter expression is
+    enclosed in square brackets following the file name and extension
+    name (e.g., 'file.fits[events][GRADE==50]'  selects only those rows
+    where the GRADE column value equals 50).   When dealing with tables
+    where each row has an associated time and/or 2D spatial position,
+    the row filter expression can also be used to select rows based on
+    the times in a Good Time Intervals (GTI) extension, or on spatial
+    position as given in a SAO-style region file.
 
-    The expression can  be an arbitrarily  complex  series of operations
-    performed on constants, keyword values,  and column data taken  from
-    the specified FITS TABLE extension.
+
+\subsection{General Syntax}
+
+    The row filtering  expression can be an arbitrarily  complex series
+    of operations performed  on constants,  keyword values,  and column
+    data taken from the specified FITS TABLE extension.  The expression
+    must evaluate to a boolean  value for each row  of the table, where
+    a value of FALSE means that the row will be excluded.
+
+    For complex or commonly  used filters, one can place the expression
+    into a text file and import it into the row filter using the syntax
+    '[@filename.txt]'.  The expression can be  arbitrarily complex and
+    extend over multiple lines of the file.  Any lines in the external
+    text file that begin with 2 slash characters ('//') will be ignored
+    and may be used to add comments into the file.
 
     Keyword and   column data  are referenced by   name.  Any  string of
     characters not surrounded by    quotes (ie, a constant  string)   or
     followed by   an open parentheses (ie,   a  function name)   will be
-    initially interpretted   as a column  name and  its contents for the
+    initially interpreted   as a column  name and  its contents for the
     current row inserted into the expression.  If no such column exists,
     a keyword of that  name will be searched for  and its value used, if
-    found.  To force the  name to be  interpretted as a keyword (in case
+    found.  To force the  name to be  interpreted as a keyword (in case
     there is both a column and keyword with the  same name), precede the
     keyword name with a single pound sign, '\#', as in '\#NAXIS2'.  Due to
     the generalities of FITS column and  keyword names, if the column or
@@ -1666,7 +1601,7 @@ Examples:
 
     To access a table entry in a row other  than the current one, follow
     the  column's name  with  a row  offset  within  curly  braces.  For
-    example, 'PHA{-3}' will evaluate to the value  of column PHA, 3 rows
+    example, 'PHA\{-3\}' will evaluate to the value  of column PHA, 3 rows
     above  the  row currently  being processed.   One  cannot specify an
     absolute row number, only a relative offset.  Rows that fall outside
     the table will be treated as undefined, or NULLs.
@@ -1690,7 +1625,9 @@ by a backslash to force the UNIX shell to ignore it.
     The expression may  also include arithmetic operators and functions.
     Trigonometric  functions use  radians,  not degrees.  The  following
     arithmetic  operators and  functions  can be  used in the expression
-    (function names are case insensitive):
+    (function names are case insensitive). A null value will be returned
+    in case of illegal operations such as divide by zero, sqrt(negative)
+    log(negative), log10(negative), arccos(.gt. 1), arcsin(.gt. 1).
 
 
 \begin{verbatim}
@@ -1701,6 +1638,9 @@ by a backslash to force the UNIX shell to ignore it.
     "sine"               sin(x)     "tangent"              tan(x)
     "arc cosine"         arccos(x)  "arc sine"             arcsin(x)
     "arc tangent"        arctan(x)  "arc tangent"          arctan2(x,y)
+    "hyperbolic cos"     cosh(x)    "hyperbolic sin"       sinh(x)
+    "hyperbolic tan"     tanh(x)    "round to nearest int" round(x)
+    "round down to int"  floor(x)   "round up to int"      ceil(x)
     "exponential"        exp(x)     "square root"          sqrt(x)
     "natural log"        log(x)     "common log"           log10(x)
     "modulus"            i % j      "random # [0.0,1.0)"   random()
@@ -1712,34 +1652,29 @@ by a backslash to force the UNIX shell to ignore it.
     argument which  should be  a  vector value (see  below).  The result
     will be the minimum/maximum element contained within the vector.
 
-    There are three functions that are primarily for use with SAO region
-    files and the  FSAOI  task, but they  can  be  used  directly.  They
-    return  a  boolean true   or  false  depending   on  whether a   two
-    dimensional point is in the region or not:
-
+    The  following  type  casting  operators  are  available,  where the
+    inclosing parentheses are required and taken  from  the  C  language
+    usage. Also, the integer to real casts values to double precision:
+
 \begin{verbatim}
-    "point in a circular region"
-          circle(xcntr,ycntr,radius,Xcolumn,Ycolumn)
+                "real to integer"    (int) x     (INT) x
+                "integer to real"    (float) i   (FLOAT) i
+\end{verbatim}
 
-    "point in an elliptical region"
-         ellipse(xcntr,ycntr,xhlf_wdth,yhlf_wdth,rotation,Xcolumn,Ycolumn)
+    In addition, several constants are built in  for  use  in  numerical
+    expressions:
 
-    "point in a rectangular region"
-             box(xcntr,ycntr,xfll_wdth,yfll_wdth,rotation,Xcolumn,Ycolumn)
 
-    where
-       (xcntr,ycntr) are the (x,y) position of the center of the region
-       (xhlf_wdth,yhlf_wdth) are the (x,y) half widths of the region
-       (xfll_wdth,yfll_wdth) are the (x,y) full widths of the region
-       (radius) is half the diameter of the circle
-       (rotation) is the angle(degrees) that the region is rotated with
-             respect to (xcntr,ycntr)
-       (Xcoord,Ycoord) are the (x,y) coordinates to test, usually column
-             names
-       NOTE: each parameter can itself be an expression, not merely a
-             column name or constant.
+\begin{verbatim}
+        #pi              3.1415...      #e             2.7182...
+        #deg             #pi/180        #row           current row number
+        #null         undefined value   #snull         undefined string
 \end{verbatim}
 
+    A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
+    "null" constants  are useful for conditionally  setting table values
+    to a NULL, or undefined, value (eg., "col1==-99 ? \#NULL : col1").
+
     There is also a function for testing if  two  values  are  close  to
     each  other,  i.e.,  if  they are "near" each other to within a user
     specified tolerance. The  arguments,  value\_1  and  value\_2  can  be
@@ -1752,22 +1687,22 @@ by a backslash to force the UNIX shell to ignore it.
 \end{verbatim}
     When  a  NULL, or undefined, value is encountered in the FITS table,
     the expression will evaluate to NULL unless the undefined  value  is
-    not   actually   required  for  evaluation,  eg.  "TRUE  .or.  NULL"
+    not   actually   required  for  evaluation,  e.g. "TRUE  .or.  NULL"
     evaluates to TRUE. The  following  two  functions  allow  some  NULL
-    detection  and  handling:  ISNULL(x)  and  DEFNULL(x,y).  The former
+    detection  and  handling:
+
+\begin{verbatim}
+         "a null value?"              ISNULL(x)
+         "define a value for null"    DEFNULL(x,y)
+\end{verbatim}
+    The former
     returns a boolean value of TRUE if the  argument  x  is  NULL.   The
     later  "defines"  a  value  to  be  substituted  for NULL values; it
     returns the value of x if x is not NULL, otherwise  it  returns  the
     value of y.
 
-    The  following  type  casting  operators  are  available,  where the
-    inclosing parentheses are required and taken  from  the  C  language
-    usage. Also, the integer to real casts values to double precision:
 
-\begin{verbatim}
-                "real to integer"    (int) x     (INT) x
-                "integer to real"    (float) i   (FLOAT) i
-\end{verbatim}
+\subsection{Bit Masks}
 
     Bit  masks can be used to select out rows from bit columns (TFORMn =
     \#X) in FITS files. To represent the mask,  binary,  octal,  and  hex
@@ -1786,7 +1721,7 @@ by a backslash to force the UNIX shell to ignore it.
     insensitive.
 
     To construct the boolean expression using the mask  as  the  boolean
-    equal  operator  discribed above on a bit table column. For example,
+    equal  operator  described above on a bit table column. For example,
     if you had a 7 bit column named flags in a  FITS  table  and  wanted
     all  rows  having  the bit pattern 0010011, the selection expression
     would be:
@@ -1829,21 +1764,8 @@ by a backslash to force the UNIX shell to ignore it.
     Bit  fields can be appended as well using the '+' operator.  Strings
     can be concatenated this way, too.
 
-    In addition, several constants are built in  for  use  in  numerical
-    expressions:
 
-
-\begin{verbatim}
-        #pi              3.1415...      #e             2.7182...
-        #deg             #pi/180        #row           current row number
-        #null         undefined value   #snull         undefined string
-\end{verbatim}
-
-    A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
-    "null" constants  are useful for conditionally  setting table values
-    to a NULL, or undefined, value (eg., "col1==-99 ? \#NULL : col1").
-
-  Vector Columns
+\subsection{Vector Columns}
 
     Vector columns can also be used  in  building  the  expression.   No
     special  syntax  is required if one wants to operate on all elements
@@ -1859,16 +1781,30 @@ by a backslash to force the UNIX shell to ignore it.
     Arithmetic and logical operations are all performed on an element by
     element basis.  Comparing two vector columns,  eg  "COL1  ==  COL2",
     thus  results  in  another vector of boolean values indicating which
-    elements of the two vectors are equal.  Two functions are  available
-    which   operate   on  vectors:  SUM(x)  and  NELEM(x).   The  former
-    literally sums all the elements in x, returning a scalar value.   If
-    x  is  a  boolean  vector,  SUM returns the number of TRUE elements.
-    The latter, NELEM, returns the  number  of  elements  in  vector  x.
-    (NELEM  also  operates  on  bit  and string columns, returning their
-    column widths.)  As an example, to test whether all elements of  two
-    vectors  satisfy  a  given  logical  comparison,  one  can  use  the
-    expression
+    elements of the two vectors are equal.
+
+    Eight functions are available that operate on a vector and return a
+    scalar result:
 
+\begin{verbatim}
+    "minimum"      MIN(V)          "maximum"               MAX(V)
+    "average"      AVERAGE(V)      "median"                MEDIAN(V)
+    "sumation"     SUM(V)          "standard deviation"    STDDEV(V)
+    "# of values"  NELEM(V)        "# of non-null values"  NVALID(V)
+\end{verbatim}
+    where V represents the name of a vector column or a manually
+    constructed vector using curly brackets as described below.  The
+    first 6 of these functions ignore any null values in the vector when
+    computing the result.
+
+    The SUM function literally sums all  the elements in x,  returning a
+    scalar value.   If x  is  a  boolean  vector, SUM returns the number
+    of TRUE elements. The NELEM function  returns the number of elements
+    in vector x whereas NVALID return the number of non-null elements in
+    the  vector.   (NELEM  also  operates  on  bit  and string  columns,
+    returning their column widths.)  As an example, to  test whether all
+    elements of two vectors satisfy a  given logical comparison, one can
+    use the expression
 
 \begin{verbatim}
               SUM( COL1 > COL2 ) == NELEM( COL1 )
@@ -1906,27 +1842,36 @@ by a backslash to force the UNIX shell to ignore it.
     Variable-length vector columns are not supported.
 
     Vectors can  be manually constructed  within the expression  using a
-    comma-separated list of  elements surrounded by curly braces ('{}').
-    For example, '{1,3,6,1}' is a 4-element vector containing the values
+    comma-separated list of  elements surrounded by curly braces ('\{\}').
+    For example, '\{1,3,6,1\}' is a 4-element vector containing the values
     1, 3, 6, and 1.  The  vector can contain  only boolean, integer, and
     real values (or expressions).  The elements will  be promoted to the
     highest  datatype   present.  Any   elements   which  are themselves
     vectors, will be expanded out with  each of its elements becoming an
     element in the constructed vector.
 
-    A common filtering method  applied to  FITS  files is a time  filter
-    using a Good Time Interval (GTI)  extension.  A high-level function,
-    gtifilter(a,b,c,d),  is  available   which  performs this    special
-    evaluation, returning a boolean result for each time element tested.
-    Its syntax is
 
+\subsection{Good Time Interval Filtering}
+
+    A common filtering method involves selecting rows which have a time
+    value which lies within what is called a Good Time Interval or GTI.
+    The time intervals are defined in a separate FITS table extension
+    which contains 2 columns giving the start and stop time of each
+    good interval.  The filtering operation accepts only those rows of
+    the input table which have an associated time which falls within
+    one of the time intervals defined in the GTI extension. A high
+    level function, gtifilter(a,b,c,d), is available which evaluates
+    each row of the input table  and returns TRUE  or FALSE depending
+    whether the row is inside or outside the  good time interval.  The
+    syntax is
 
 \begin{verbatim}
-       gtifilter( [ "filename" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
+      gtifilter( [ "gtifile" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
 \end{verbatim}
-
-    where  each  "[]" demarks   optional parameters.   The  filename, if
-    specified,  can be  blank  ("") which will    mean to use  the first
+    where  each "[]" demarks optional parameters.  Note that  the quotes
+    around the gtifile and START/STOP column are required.  Either single
+    or double quotes may be used. The gtifile,
+    if specified,  can be blank  ("") which will  mean to use  the first
     extension  with   the name "*GTI*"  in   the current  file,  a plain
     extension  specifier (eg, "+2",  "[2]", or "[STDGTI]") which will be
     used  to  select  an extension  in  the current  file, or  a regular
@@ -1936,17 +1881,14 @@ by a backslash to force the UNIX shell to ignore it.
     the time  column  name.  A  vector  time expression  will  produce a
     vector boolean  result.  STARTCOL and  STOPCOL are the  names of the
     START/STOP   columns in the    GTI extension.  If   one  of them  is
-    specified, they both  must be. Note that  the quotes surrounding the
-    filename and START/STOP column names are required.
+    specified, they both  must be.
 
     In  its  simplest form, no parameters need to be provided -- default
     values will be used.  The expression "gtifilter()" is equivalent to
 
-
 \begin{verbatim}
        gtifilter( "", TIME, "*START*", "*STOP*" )
 \end{verbatim}
-
     This will search the current file for a GTI  extension,  filter  the
     TIME  column in the current table, using START/STOP times taken from
     columns in the GTI  extension  with  names  containing  the  strings
@@ -1957,27 +1899,80 @@ by a backslash to force the UNIX shell to ignore it.
     searches   for   TIMEZERO/I/F   keywords  in  the  current  and  GTI
     extensions, applying a relative time offset, if necessary.
 
-    Another common  filtering method is  a  spatial filter using  a SAO-
-    style region file.  The syntax for this high-level filter is
 
+\subsection{Spatial Region Filtering}
+
+    Another common  filtering method selects rows based on whether the
+    spatial position associated with each row is located within a given
+    2-dimensional region.  The syntax for this high-level filter is
 
 \begin{verbatim}
        regfilter( "regfilename" [ , Xexpr, Yexpr [ , "wcs cols" ] ] )
 \end{verbatim}
-
-    The region file name is required, but the rest is optional.  Without
-    any explicit expression for the X and Y coordinates (in pixels), the
-    filter will search for  and operate on columns "X"  and "Y".  If the
-    region file is   in "degrees" format  instead  of "pixels" ("hhmmss"
-    format is not supported, yet), the  filter will need WCS information
-    to convert the region coordinates to pixels.  If supplied, the final
-    parameter string contains the names of the 2 columns (space or comma
-    separated) which contain   the   desired WCS information.    If  not
-    supplied, the filter  will scan the X  and Y expressions for  column
-    names.  If only one is found in each  expression, those columns will
-    be used.  Otherwise, an error will be returned.
-
-    The region shapes supported are (names are case insensitive):
+    where each "[]" demarks optional parameters. The region file name
+    is required and must be  enclosed in quotes.  The remaining
+    parameters are optional.  The region file is an ASCII text file
+    which contains a list of one or more geometric shapes (circle,
+    ellipse, box, etc.) which defines a region on the celestial sphere
+    or an area within a particular 2D image.  The region file is
+    typically generated using an image display program such as fv/POW
+    (distribute by the HEASARC), or ds9 (distributed by the Smithsonian
+    Astrophysical Observatory).  Users should refer to the documentation
+    provided with these programs for more details on the syntax used in
+    the region files.
+
+    In its simpliest form, (e.g., regfilter("region.reg") ) the
+    coordinates in the default 'X' and 'Y' columns will be used to
+    determine if each row is inside or outside the area specified in
+    the region file.  Alternate position column names, or expressions,
+    may be entered if needed, as in
+
+\begin{verbatim}
+        regfilter("region.reg", XPOS, YPOS)
+\end{verbatim}
+    Region filtering can be applied most unambiguously if the positions
+    in the region file and in the table to be filtered are both give in
+    terms of absolute celestial coordinate units.  In this case the
+    locations and sizes of the geometric shapes in the region file are
+    specified in angular units on the sky (e.g., positions given in
+    R.A. and Dec.  and sizes in arcseconds or arcminutes).  Similarly,
+    each row of the filtered table will have a celestial coordinate
+    associated with it.  This association is usually implemented using
+    a set of so-called 'World Coordinate System' (or WCS) FITS keywords
+    that define the coordinate transformation that must be applied to
+    the values in the 'X' and 'Y' columns to calculate the coordinate.
+
+    Alternatively, one can perform spatial filtering using unitless
+    'pixel' coordinates for the regions and row positions.  In this
+    case the user must be careful to ensure that the positions in the 2
+    files are self-consistent.  A typical problem is that the region
+    file may be generated using a binned image, but the unbinned
+    coordinates are given in the event table.  The ROSAT events files,
+    for example, have X and Y pixel coordinates that range from 1 -
+    15360.  These coordinates are typically binned by a factor of 32 to
+    produce a 480x480 pixel image.  If one then uses a region file
+    generated from this image (in image pixel units) to filter the
+    ROSAT events file, then the X and Y column values must be converted
+    to corresponding pixel units as in:
+
+\begin{verbatim}
+        regfilter("rosat.reg", X/32.+.5, Y/32.+.5)
+\end{verbatim}
+    Note that this binning conversion is not necessary if the region
+    file is specified using celestial coordinate units instead of pixel
+    units because CFITSIO is then able to directly compare the
+    celestial coordinate of each row in the table with the celestial
+    coordinates in the region file without having to know anything
+    about how the image may have been binned.
+
+    The last "wcs cols" parameter should rarely be needed. If supplied,
+    this  string contains the names of the 2 columns (space or comma
+    separated) which have the associated WCS keywords. If not supplied,
+    the filter  will scan the X  and Y expressions for column names.
+    If only one is found in each  expression, those columns will be
+    used, otherwise an error will be returned.
+
+    These region shapes are supported (names are case insensitive):
 
 \begin{verbatim}
        Point         ( X1, Y1 )               <- One pixel square region
@@ -1992,26 +1987,62 @@ by a backslash to force the UNIX shell to ignore it.
        Elliptannulus ( Xc, Yc, Rinx, Riny, Routx, Routy, Ain, Aout )
        Sector        ( Xc, Yc, Amin, Amax )
 \end{verbatim}
-
     where (Xc,Yc) is  the coordinate of  the shape's center; (X\#,Y\#) are
     the coordinates  of the shape's edges;  Rxxx are the shapes' various
     Radii or semimajor/minor  axes; and Axxx  are the angles of rotation
     (or bounding angles for Sector) in degrees.  For rotated shapes, the
     rotation angle  can  be left  off, indicating  no rotation.   Common
-    alternate  names for the regions  can also be  used: rotbox == box;
-    rotrectangle == rectangle;  (rot)rhombus == (rot)diamond;  and pie
-    == sector.  When a  shape's name is  preceded by a minus sign, '-',
+    alternate  names for the regions  can also be  used: rotbox = box;
+    rotrectangle = rectangle;  (rot)rhombus = (rot)diamond;  and pie
+    = sector.  When a  shape's name is  preceded by a minus sign, '-',
     the defined region  is instead the area  *outside* its boundary (ie,
-    the region is inverted).  All the shapes within a single region file
-    are AND'd together to create the region.
+    the region is inverted).  All the shapes within a single region
+    file are OR'd together to create the region, and the order is
+    significant. The overall way of looking at region files is that if
+    the first region is an excluded region then a dummy included region
+    of the whole detector is inserted in the front. Then each region
+    specification as it is processed overrides any selections inside of
+    that region specified by previous regions. Another way of thinking
+    about this is that if a previous excluded region is completely
+    inside of a subsequent included region the excluded region is
+    ignored.
+
+    The positional coordinates may be given either in pixel units,
+    decimal degrees or hh:mm:ss.s, dd:mm:ss.s units.  The shape sizes
+    may be given in pixels, degrees, arcminutes, or arcseconds.  Look
+    at examples of region file produced by fv/POW or ds9 for further
+    details of the region file format.
+
+    There are three functions that are primarily for use with SAO region
+    files and the  FSAOI  task, but they  can  be  used  directly.  They
+    return  a  boolean true   or  false  depending   on  whether a   two
+    dimensional point is in the region or not:
+
+\begin{verbatim}
+    "point in a circular region"
+          circle(xcntr,ycntr,radius,Xcolumn,Ycolumn)
+
+    "point in an elliptical region"
+         ellipse(xcntr,ycntr,xhlf_wdth,yhlf_wdth,rotation,Xcolumn,Ycolumn)
+
+    "point in a rectangular region"
+             box(xcntr,ycntr,xfll_wdth,yfll_wdth,rotation,Xcolumn,Ycolumn)
 
-    For  complex  or commonly  used filters,  one   can also  place  the
-    expression into a text file and import it  into the row filter using
-    the syntax  '[@filename.txt]'.  The   expression can be  arbitrarily
-    complex and extend over multiple lines of the file.
+    where
+       (xcntr,ycntr) are the (x,y) position of the center of the region
+       (xhlf_wdth,yhlf_wdth) are the (x,y) half widths of the region
+       (xfll_wdth,yfll_wdth) are the (x,y) full widths of the region
+       (radius) is half the diameter of the circle
+       (rotation) is the angle(degrees) that the region is rotated with
+             respect to (xcntr,ycntr)
+       (Xcoord,Ycoord) are the (x,y) coordinates to test, usually column
+             names
+       NOTE: each parameter can itself be an expression, not merely a
+             column name or constant.
+\end{verbatim}
 
 
-EXAMPLES:
+\subsection{Example Row Filters}
 
 \begin{verbatim}
     [ binary && mag <= 5.0]        - Extract all binary stars brighter
@@ -2044,143 +2075,400 @@ EXAMPLES:
     [@rowFilter.txt]               - Extract rows using the expression
                                      contained within the text file
                                      rowFilter.txt
+
+    [gtifilter()]                  - Search the current file for a GTI
+				     extension,  filter  the TIME
+				     column in the current table, using
+				     START/STOP times taken from
+				     columns in the GTI  extension
+
+    [regfilter("pow.reg")]         - Extract rows which have a coordinate
+                                     (as given in the X and Y columns)
+                                     within the spatial region specified
+                                     in the pow.reg region file.
+
+    [regfilter("pow.reg", Xs, Ys)] - Same as above, except that the
+                                     Xs and Ys columns will be used to
+                                     determine the coordinate of each
+                                     row in the table.
+\end{verbatim}
+
+
+\section{ Binning or Histogramming Specification}
+
+The optional binning specifier is enclosed in square brackets and can
+be distinguished from a general row filter specification by the fact
+that it begins with the keyword 'bin'  not immediately followed by an
+equals sign.  When binning is specified, a temporary N-dimensional FITS
+primary array is created by computing the histogram of the values in
+the specified columns of a FITS table extension.  After the histogram
+is computed the input FITS file containing the table is then closed and
+the temporary FITS primary array is opened and passed to the
+application program.  Thus, the application program never sees the
+original FITS table and only sees the image in the new temporary file
+(which has no additional extensions).  Obviously, the application
+program must be expecting to open a FITS image and not a FITS table in
+this case.
+
+The data type of the FITS histogram image may be specified by appending
+'b' (for 8-bit byte), 'i' (for 16-bit integers), 'j' (for 32-bit
+integer), 'r' (for 32-bit floating points), or 'd' (for 64-bit double
+precision floating point)  to the 'bin' keyword (e.g. '[binr X]'
+creates a real floating point image).  If the datatype is not
+explicitly specified then a 32-bit integer image will be created by
+default, unless the weighting option is also specified in which case
+the image will have a 32-bit floating point data type by default.
+
+The histogram image may have from 1 to 4 dimensions (axes), depending
+on the number of columns that are specified.  The general form of the
+binning specification is:
+
+\begin{verbatim}
+ [bin{bijrd}  Xcol=min:max:binsize, Ycol= ..., Zcol=..., Tcol=...; weight]
+\end{verbatim}
+in which up to 4 columns, each corresponding to an axis of the image,
+are listed. The column names are case insensitive, and the column
+number may be given instead of the name, preceded by a pound sign
+(e.g., [bin \#4=1:512]).  If the column name is not specified, then
+CFITSIO will first try to use the 'preferred column' as specified by
+the CPREF keyword if it exists (e.g., 'CPREF = 'DETX,DETY'), otherwise
+column names 'X', 'Y', 'Z', and 'T' will be assumed for each of the 4
+axes, respectively.  In cases where the column name could be confused
+with an arithmetic expression, enclose the column name in parentheses to
+force the name to be interpreted literally.
+
+Each column name may be followed by an equals sign and then the lower
+and upper range of the histogram, and the size of the histogram bins,
+separated by colons.  Spaces are allowed before and after the equals
+sign but not within the 'min:max:binsize' string.  The min, max and
+binsize values may be integer or floating point numbers, or they may be
+the names of keywords in the header of the table.  If the latter, then
+the value of that keyword is substituted into the expression.
+
+Default values for the min, max and binsize quantities will be
+used if not explicitly given in the binning expression as shown
+in these examples:
+
+\begin{verbatim}
+    [bin x = :512:2]  - use default minimum value
+    [bin x = 1::2]    - use default maximum value
+    [bin x = 1:512]   - use default bin size
+    [bin x = 1:]      - use default maximum value and bin size
+    [bin x = :512]    - use default minimum value and bin size
+    [bin x = 2]       - use default minimum and maximum values
+    [bin x]           - use default minimum, maximum and bin size
+    [bin 4]           - default 2-D image, bin size = 4 in both axes
+    [bin]             - default 2-D image
+\end{verbatim}
+CFITSIO  will use the value of the TLMINn, TLMAXn, and TDBINn keywords,
+if they exist, for the default min, max, and binsize, respectively.  If
+they do not exist then CFITSIO will use the actual minimum and maximum
+values in the column for the histogram min and max values.  The default
+binsize will be set to 1, or (max - min) / 10., whichever is smaller,
+so that the histogram will have at least 10 bins along each axis.
+
+A shortcut notation is allowed if all the columns/axes have the same
+binning specification.  In this case all the column names may be listed
+within parentheses, followed by the (single) binning specification, as
+in:
+
+\begin{verbatim}
+    [bin (X,Y)=1:512:2]
+    [bin (X,Y) = 5]
+\end{verbatim}
+
+The optional weighting factor is the last item in the binning specifier
+and, if present, is separated from the list of columns by a
+semi-colon.  As the histogram is accumulated, this weight is used to
+incremented the value of the appropriated bin in the histogram.  If the
+weighting factor is not specified, then the default weight = 1 is
+assumed.  The weighting factor may be a constant integer or floating
+point number, or the name of a keyword containing the weighting value.
+Or the weighting factor may be the name of a table column in which case
+the value in that column, on a row by row basis, will be used.
+
+In some cases, the column or keyword may give the reciprocal of the
+actual weight value that is needed.  In this case, precede the weight
+keyword or column name by a slash '/' to tell CFITSIO to use the
+reciprocal of the value when constructing the histogram.
+
+For  complex or commonly  used  histograms, one  can also  place its
+description  into  a  text  file and  import   it  into  the binning
+specification  using the  syntax '[bin  @filename.txt]'.  The file's
+contents  can extend over   multiple lines, although  it must still
+conform to the  no-spaces rule  for the min:max:binsize syntax and each
+axis specification must still be comma-separated.  Any lines in the
+external text file that begin with 2 slash characters ('//') will be
+ignored and may be used to add comments into the file.
+
+ Examples:
+
+
+\begin{verbatim}
+    [bini detx, dety]                - 2-D, 16-bit integer histogram
+                                       of DETX and DETY columns, using
+                                       default values for the histogram
+                                       range and binsize
+
+    [bin (detx, dety)=16; /exposure] - 2-D, 32-bit real histogram of DETX
+                                       and DETY columns with a bin size = 16
+                                       in both axes. The histogram values
+                                       are divided by the EXPOSURE keyword
+                                       value.
+
+    [bin time=TSTART:TSTOP:0.1]      - 1-D lightcurve, range determined by
+                                       the TSTART and TSTOP keywords,
+                                       with 0.1 unit size bins.
+
+    [bin pha, time=8000.:8100.:0.1]  - 2-D image using default binning
+                                       of the PHA column for the X axis,
+                                       and 1000 bins in the range
+                                       8000. to 8100. for the Y axis.
+
+    [bin @binFilter.txt]             - Use the contents of the text file
+                                       binFilter.txt for the binning
+                                       specifications.
+
+\end{verbatim}
+
+
+\chapter{Template Files }
+
+When a new FITS file is created with a call to fits\_create\_file, the
+name of a template file may be supplied in parentheses immediately
+following the name of the new file to be created.  This template is
+used to define the structure of one or more HDUs in the new file.  The
+template file may be another FITS file, in which case the newly created
+file will have exactly the same keywords in each HDU as in the template
+FITS file, but all the data units will be filled with zeros.  The
+template file may also be an ASCII text file, where each line (in
+general) describes one FITS keyword record.  The format of the ASCII
+template file is described in the following sections.
+
+
+\section{Detailed Template Line Format}
+
+The format of each ASCII template line closely follows the format of a
+FITS keyword record:
+
+\begin{verbatim}
+  KEYWORD = KEYVALUE / COMMENT
+\end{verbatim}
+except that free format may be used (e.g., the equals sign may appear
+at any position in the line) and TAB characters are allowed and are
+treated the same as space characters.  The KEYVALUE and COMMENT fields
+are optional.  The equals sign character is also optional, but it is
+recommended that it be included for clarity.  Any template line that
+begins with the pound '\#' character is ignored by the template parser
+and may be use to insert comments into the template file itself.
+
+The KEYWORD name field is limited to 8 characters in length and only
+the letters A-Z, digits 0-9, and the hyphen and underscore characters
+may be used, without any embedded spaces. Lowercase letters in the
+template keyword name will be converted to uppercase.  Leading spaces
+in the template line preceding the keyword name are generally ignored,
+except if the first 8 characters of a template line are all blank, then
+the entire line is treated as a FITS comment keyword (with a blank
+keyword name) and is copied verbatim into the FITS header.
+
+The KEYVALUE field may have any allowed  FITS  data type: character
+string, logical, integer, real, complex integer, or complex real.  The
+character string values need not be enclosed in single quote characters
+unless they are necessary to distinguish the string from a different
+data type (e.g.  2.0 is a real but '2.0' is a string).  The keyword has
+an undefined (null) value if the template record only contains blanks
+following the "=" or between the "=" and the "/" comment field
+delimiter.
+
+String keyword values longer than 68 characters (the maximum length
+that will fit in a single FITS keyword record) are permitted using the
+CFITSIO long string convention. They can either be specified as a
+single long line in the template, or by using multiple lines where the
+continuing lines contain the 'CONTINUE' keyword, as in this example:
+
+\begin{verbatim}
+  LONGKEY = 'This is a long string value that is contin&'
+  CONTINUE  'ued over 2 records' / comment field goes here
+\end{verbatim}
+The format of template lines with CONTINUE keyword is very strict:  3
+spaces must follow CONTINUE and the rest of the line is copied verbatim
+to the FITS file.
+
+The start of the optional COMMENT field must be preceded by "/", which
+is used to separate it from the keyword value field. Exceptions are if
+the KEYWORD name field contains COMMENT, HISTORY, CONTINUE, or if the
+first 8 characters of the template line are blanks.
+
+More than one Header-Data Unit (HDU) may be defined in the template
+file.  The start of an HDU definition is denoted with a SIMPLE or
+XTENSION template line:
+
+1) SIMPLE begins a Primary HDU definition. SIMPLE may only appear as
+the  first keyword in the template file. If the template file begins
+with XTENSION instead of SIMPLE, then a default empty Primary HDU is
+created, and the template is then assumed to define the keywords
+starting with the first extension following the Primary HDU.
+
+2) XTENSION marks the beginning of a new extension HDU definition.  The
+previous HDU will be closed at this point and processing of the next
+extension begins.
+
+
+\section{Auto-indexing of Keywords}
+
+If a template keyword name ends with a "\#" character, it is said to be
+'auto-indexed'.   Each "\#" character will be replaced by the current
+integer index value, which gets reset = 1 at the start of each new HDU
+in the file (or 7 in the special case of a GROUP definition).  The
+FIRST indexed keyword in each template HDU definition is used as the
+'incrementor';  each subsequent occurrence of this SAME keyword will
+cause the index value to be incremented.  This behavior can be rather
+subtle, as illustrated in the following examples in which the TTYPE
+keyword is the incrementor in both cases:
+
+\begin{verbatim}
+  TTYPE# = TIME
+  TFORM# = 1D
+  TTYPE# = RATE
+  TFORM# = 1E
+\end{verbatim}
+will create TTYPE1, TFORM1, TTYPE2, and TFORM2 keywords.  But if the
+template looks like,
+
+\begin{verbatim}
+  TTYPE# = TIME
+  TTYPE# = RATE
+  TFORM# = 1D
+  TFORM# = 1E
 \end{verbatim}
+this results in a FITS files with  TTYPE1, TTYPE2, TFORM2, and TFORM2,
+which is probably not what was intended!
 
 
-\subsection{Binning or Histogramming Specification}
+\section{Template Parser Directives}
 
-The optional binning specifier is enclosed in square brackets and can
-be distinguished from a general row filter specification by the fact
-that it begins with the keyword 'bin'  not immediately followed by an
-equals sign.  When binning is specfied, a temporary N-dimensional FITS
-primary array is created by computing the histogram of the values in
-the specified columns of a FITS table extension.  After the histogram
-is computed the input FITS file containing the table is then closed and
-the temporary FITS primary array is opened and passed to the
-application program.  Thus, the application program never sees the
-original FITS table and only sees the image in the new temporary file
-(which has no additional extensions).  Obviously, the application
-program must be expecting to open a FITS image and not a FITS table in
-this case.
+In addition to the template lines which define individual keywords, the
+template parser recognizes 3 special directives which are each preceded
+by the backslash character:  \verb+ \include, \group+, and \verb+ \end+.
 
-The data type of the FITS histogram image may be specified by appending
-'b' (for 8-bit byte), 'i' (for 16-bit integers), 'j' (for 32-bit
-integer), 'r' (for 32-bit floating points), or 'd' (for 64-bit double
-precision floating point)  to the 'bin' keyword (e.g. '[binr X]'
-creates a real floating point image).  If the datatype is not
-explicitly specified then a 32-bit integer image will be created by
-default, unless the weighting option is also specified in which case
-the image will have a 32-bit floating point data type by default.
+The 'include' directive must be followed by a filename. It forces the
+parser to temporarily stop reading the current template file and begin
+reading the include file. Once the parser reaches the end of the
+include file it continues parsing the current template file.  Include
+files can be nested, and HDU definitions can span multiple template
+files.
 
-The histogram image may have from 1 to 4 dimensions (axes), depending
-on the number of columns that are specified.  The general form of the
-binning specification is:
+The start of a GROUP definition is denoted with the 'group' directive,
+and the end of a GROUP definition is denoted with the 'end' directive.
+Each GROUP contains 0 or more member blocks (HDUs or GROUPs). Member
+blocks of type GROUP can contain their own member blocks. The GROUP
+definition itself occupies one FITS file HDU of special type (GROUP
+HDU), so if a template specifies 1 group with 1 member HDU like:
 
 \begin{verbatim}
- [bin{bijrd}  Xcol=min:max:binsize, Ycol= ..., Zcol=..., Tcol=...; weight]
+\group
+grpdescr = 'demo'
+xtension bintable
+# this bintable has 0 cols, 0 rows
+\end
 \end{verbatim}
-in which up to 4 columns, each corresponding to an axis of the image,
-are listed. The column names are case insensitive, and the column
-number may be given instead of the name, preceded by a pound sign
-(e.g., [bin \#4=1:512]).  If the column name is not specified, then
-CFITSIO will first try to use the 'preferred column' as specified by
-the CPREF keyword if it exists (e.g., 'CPREF = 'DETX,DETY'), otherwise
-column names 'X', 'Y', 'Z', and 'T' will be assumed for each of the 4
-axes, respectively.
-
-Each column name may be followed by an equals sign and then the lower
-and upper range of the histogram, and the size of the histogram bins,
-separated by colons.  Spaces are allowed before and after the equals
-sign but not within the 'min:max:binsize' string.  The min, max and
-binsize values may be integer or floating point numbers, or they may be
-the names of keywords in the header of the table.  If the latter, then
-the value of that keyword is substituted into the expression.
-
-Default values for the min, max and binsize quantities will be
-used if not explicitly given in the binning expression as shown
-in these examples:
+then the parser creates a FITS file with 3 HDUs :
 
 \begin{verbatim}
-    [bin x = :512:2]  - use default minimum value
-    [bin x = 1::2]    - use default maximum value
-    [bin x = 1:512]   - use default bin size
-    [bin x = 1:]      - use default maximum value and bin size
-    [bin x = :512]    - use default minimum value and bin size
-    [bin x = 2]       - use default minimum and maximum values
-    [bin x]           - use default minimum, maximum and bin size
-    [bin 4]           - default 2-D image, bin size = 4 in both axes
-    [bin]             - default 2-D image
+1) dummy PHDU
+2) GROUP HDU (has 1 member, which is bintable in HDU number 3)
+3) bintable (member of GROUP in HDU number 2)
 \end{verbatim}
-CFITSIO  will use the value of the TLMINn, TLMAXn, and TDBINn keywords,
-if they exist, for the default min, max, and binsize, respectively.  If
-they do not exist then CFITSIO will use the actual minimum and maximum
-values in the column for the histogram min and max values.  The default
-binsize will be set to 1, or (max - min) / 10., whichever is smaller,
-so that the histogram will have at least 10 bins along each axis.
+Technically speaking, the GROUP HDU is a BINTABLE with 6 columns. Applications
+can define additional columns in a GROUP HDU using TFORMn and TTYPEn
+(where n is 7, 8, ....) keywords or their auto-indexing equivalents.
 
-A shortcut notation is allowed if all the columns/axes have the same
-binning specification.  In this case all the column names may be listed
-within parentheses, followed by the (single) binning specification, as
-in:
+For a more complicated example of a template file using the group directives,
+look at the sample.tpl file that is included in the CFITSIO distribution.
+
+
+\section{Formal Template Syntax}
+
+The template syntax can formally be defined as follows:
 
 \begin{verbatim}
-    [bin (X,Y)=1:512:2]
-    [bin (X,Y) = 5]
+    TEMPLATE = BLOCK [ BLOCK ... ]
+
+       BLOCK = { HDU | GROUP }
+
+       GROUP = \GROUP [ BLOCK ... ] \END
+
+         HDU = XTENSION [ LINE ... ] { XTENSION | \GROUP | \END | EOF }
+
+        LINE = [ KEYWORD [ = ] ] [ VALUE ] [ / COMMENT ]
+
+    X ...     - X can be present 1 or more times
+    { X | Y } - X or Y
+    [ X ]     - X is optional
 \end{verbatim}
 
-The optional weighting factor is the last item in the binning specifier
-and, if present, is separated from the list of columns by a
-semi-colon.  As the histogram is accumulated, this weight is used to
-incremented the value of the appropriated bin in the histogram.  If the
-weighting factor is not specified, then the default weight = 1 is
-assumed.  The weighting factor may be a constant integer or floating
-point number, or the name of a keyword containing the weighting value.
-Or the weighting factor may be the name of a table column in which case
-the value in that column, on a row by row basis, will be used.
+At the topmost level, the template defines 1 or more template blocks. Blocks
+can be either HDU (Header Data Unit) or a GROUP. For each block the parser
+creates 1 (or more for GROUPs) FITS file HDUs.
 
-In some cases, the column or keyword may give the reciprocal of the
-actual weight value that is needed.  In this case, precede the weight
-keyword or column name by a slash '/' to tell CFITSIO to use the
-reciprocal of the value when constructing the histogram.
 
-For  complex or commonly  used  histograms, one  can also  place its
-description  into  a  text  file and  import   it  into  the binning
-specification  using the  syntax '[bin  @filename.txt]'.  The
-file's contents  can extend over   multiple lines, although  it must
-still conform to the  no-spaces rule  for the min:max:binsize syntax
-and each axis specification must still be comma-separated.
 
- Examples:
+\section{Errors}
 
+In general the fits\_execute\_template() function tries to be as atomic
+as possible, so either everything is done or nothing is done. If an
+error occurs during parsing of the template, fits\_execute\_template()
+will (try to) delete the top level BLOCK (with all its children if any)
+in which the error occurred, then it will stop reading the template file
+and it will return with an error.
 
-\begin{verbatim}
-    [bini detx, dety]                - 2-D, 16-bit integer histogram
-                                       of DETX and DETY columns, using
-                                       default values for the histogram
-                                       range and binsize
 
-    [bin (detx, dety)=16; /exposure] - 2-D, 32-bit real histogram of DETX
-                                       and DETY columns with a bin size = 16
-                                       in both axes. The histogram values
-                                       are divided by the EXPOSURE keyword
-                                       value.
+\section{Examples}
 
-    [bin time=TSTART:TSTOP:0.1]      - 1-D lightcurve, range determined by
-                                       the TSTART and TSTOP keywords,
-                                       with 0.1 unit size bins.
+1. This template file will create a 200 x 300 pixel image, with 4-byte
+integer pixel values, in the primary HDU:
 
-    [bin pha, time=8000.:8100.:0.1]  - 2-D image using default binning
-                                       of the PHA column for the X axis,
-                                       and 1000 bins in the range
-                                       8000. to 8100. for the Y axis.
+\begin{verbatim}
+  SIMPLE = T
+  BITPIX = 32
+  NAXIS = 2     / number of dimensions
+  NAXIS1 = 100  / length of first axis
+  NAXIS2 = 200  / length of second axis
+  OBJECT = NGC 253 / name of observed object
+\end{verbatim}
+The allowed values of BITPIX are 8, 16, 32, -32, or -64,
+representing, respectively, 8-bit integer, 16-bit integer, 32-bit
+integer, 32-bit floating point, or 64 bit floating point pixels.
 
-    [bin @binFilter.txt]             - Use the contents of the text file
-                                       binFilter.txt for the binning
-                                       specifications.
+2.  To create a FITS  table, the template first needs to include
+XTENSION = TABLE or BINTABLE to define whether it is an ASCII or binary
+table, and NAXIS2 to define the number of rows in the table.  Two
+template lines are then needed to define the name (TTYPEn) and FITS data
+format (TFORMn) of the columns, as in this example:
 
+\begin{verbatim}
+  xtension = bintable
+  naxis2 = 40
+  ttype# = Name
+  tform# = 10a
+  ttype# = Npoints
+  tform# = j
+  ttype# = Rate
+  tunit# = counts/s
+  tform# = e
 \end{verbatim}
+The above example defines a null primary array followed by a 40-row
+binary table extension with 3 columns called 'Name', 'Npoints', and
+'Rate', with data formats of '10A' (ASCII character string), '1J'
+(integer) and '1E' (floating point), respectively.  Note that the other
+required FITS keywords (BITPIX, NAXIS, NAXIS1, PCOUNT, GCOUNT, TFIELDS,
+and END) do not need to be explicitly defined in the template because
+their values can be inferred from the other keywords in the template.
+This example also illustrates that the templates are generally
+case-insensitive (the keyword names and TFORMn values are converted to
+upper-case in the FITS file) and that string keyword values generally
+do not need to be enclosed in quotes.
 
-
 \chapter{FITSIO Conventions and Guidelines }
 
 
@@ -2190,21 +2478,25 @@ CFITSIO places few restrictions on the size of FITS files that it
 reads or writes.  There are a few limits, however, which may affect
 some extreme cases:
 
-1.  The maximum number of files that may be simultaneously opened is
-limited to the number of internal IO buffers allocated in CFITSIO
-(currently 25, as defined by NIOBUF in the file fitsio2.h), or by the
-limit of the underlying C compiler or machine operating system, which
-ever is smaller.  The C symbolic constant FOPEN\_MAX usually defines
-the total number of files that may open at once (this includes any
-other text or binary files which may be open, not just FITS files).
-
-2.  The maximum number of extensions (HDUs) that can be read or written
-in a single FITS file is currently set to 1000 as defined by MAXHDU in
-the fitsio.h file.  This value may be increased if necessary, but the
-access times to the later extensions in such files may become excessively
-long.
-
-3.  By default, CFITSIO can handle FITS files up to 2.1 GB in size
+1.  The maximum number of FITS files that may be simultaneously opened
+by CFITSIO is set by NMAXFILES as defined in fitsio2.h.  It is currently
+set = 300 by default.  CFITSIO will allocate about 80 * NMAXFILES bytes
+of memory for internal use.  Note that the underlying C compiler or
+operating system, may have a smaller limit on the number of opened files.
+The C symbolic constant FOPEN\_MAX is intended to define the maximum
+number of files that may open at once (including any other text or
+binary files that may be open, not just FITS files).  On some systems it
+has been found that gcc supports a maximum of 255 opened files.
+
+Note that opening and operating on many FITS files simultaneously in
+parallel may be less efficient than operating on smaller groups of files
+in series.  CFITSIO only has NIOBUF number of internal buffers (set = 40
+by default) that are used for temporary storage of the most recent data
+records that have been read or written in the FITS files.  If the number
+of opened files is greater than NIOBUF, then CFITSIO may waste more time
+flushing and re-reading or re-writing the same records in the FITS files.
+
+2.  By default, CFITSIO can handle FITS files up to 2.1 GB in size
 (2**31 bytes).  This file size limit is often imposed by 32-bit
 operating systems.  More recently, as 64-bit operating systems become
 more common, an industry-wide standard (at least on Unix systems) has
@@ -2337,16 +2629,22 @@ is the real part, and the second is the imaginary part.
 
 \section{Implicit Data Type Conversion}
 
-Many of the data I/O subroutines have the ability to perform implicit
-data type conversion. This means that the data type of the subroutine
-parameter does not need to be the same as the data type of the value in
-the FITS file. More specifically, the implicit data type conversion will
-be performed for numerical data types when reading a FITS header keyword
-value and when reading or writing values to or from the primary array or
-a table column. FITSIO returns status = 412 if the converted data value
-exceeds the range of the output data type. Data type conversion is not
-allowed when reading or writing string (s), logical (l), complex (c), or
-double complex (m) data types.
+The FITSIO routines that read and write numerical data can perform
+implicit data type conversion.  This means that the data type of the
+variable or array in the program does not need to be the same as the
+data type of the value in the FITS file.  Data type conversion is
+supported for numerical and string data types (if the string contains a
+valid number enclosed in quotes) when reading a FITS header keyword
+value and for numeric values when reading or writing values in the
+primary array or a table column.  CFITSIO returns status =
+NUM\_OVERFLOW  if the converted data value exceeds the range of the
+output data type.  Implicit data type conversion is not supported
+within binary tables for string, logical, complex, or double complex
+data types.
+
+In addition, any table column may be read as if it contained string values.
+In the case of numeric columns the returned string will be formatted
+using the TDISPn display format if it exists.
 
 
 \section{Data Scaling}
@@ -2455,7 +2753,7 @@ get overwritten.
 By default the heap data area starts immediately after the last row of
 the fixed-length table.  This default starting location may be
 overridden by the THEAP keyword, but this is not recommended.
-If addtional rows of data are added to the table, CFITSIO will
+If additional rows of data are added to the table, CFITSIO will
 automatically shift the the heap down to make room for the new
 rows, but it is obviously be more efficient to initially
 create the table with the necessary number of blank rows, so that
@@ -2545,7 +2843,7 @@ when the table is created, then let CFITSIO keep track of the number of
 rows that are actually written.  The application program should not
 manually update the number of rows in the table (as given by the NAXIS2
 keyword) since CFITSIO does this automatically.  If a table is
-initially created with more than zero rows, then this will ususally be
+initially created with more than zero rows, then this will usually be
 considered as the minimum size of the table, even if fewer rows are
 actually written to the table.  Thus, if a table is initially created
 with NAXIS2 = 20, and CFITSIO only writes 10 rows of data before
@@ -2783,7 +3081,7 @@ buffers in memory.  The next time CFITSIO needs to access bytes in the
 same block it can then go to the fast IO buffer rather than using a
 much slower system disk access routine.  The number of available IO
 buffers is determined by the NIOBUF parameter (in fitsio2.h) and is
-currently set to 25.
+currently set to 40.
 
 Whenever CFITSIO reads or writes data it first checks to see if that
 block of the FITS file is already loaded into one of the IO buffers.
@@ -2863,7 +3161,7 @@ routine is available that will return the optimal number of rows for a
 given table:  call ftgrsz(unit, nrows, status).  It is not critical to
 use exactly the value of nrows returned by this routine, as long as one
 does not exceed it.  Using a very small value however can also lead to
-poor preformance because of the overhead from the larger number of
+poor performance because of the overhead from the larger number of
 subroutine calls.
 
 The optimal number of rows returned by ftgrsz is valid only as long as
@@ -2875,7 +3173,7 @@ and should be avoided during the critical period while the table is
 being read or written.
 
 Occasionally it is necessary to simultaneously access more than one
-FITS table, for example when transfering values from an input table to
+FITS table, for example when transferring values from an input table to
 an output table.  In cases like this, one should call ftgrsz to get the
 optimal number of rows for each table separately, than reduce the
 number of rows proportionally.  For example, if the optimal number of
@@ -2965,7 +3263,7 @@ controller (SCSI or IDE), the size of the disk cache, the average seek
 speed of the disk, the amount of disk fragmentation, and the amount of
 RAM available on the system can all have a significant impact on
 overall I/O efficiency.  For critical applications, a system
-adminstrator should review the proposed system hardware to identify any
+administrator should review the proposed system hardware to identify any
 potential I/O bottlenecks.
 
 
@@ -3093,7 +3391,23 @@ used by these interface routines.
 \end{verbatim}
 
 \begin{description}
-\item[4 ] Print out the error message corresponding to the input status
+\item[4 ]The FTPMRK routine puts an invisible marker on the
+   CFITSIO error stack.  The FTCMRK routine can then be
+   used to delete any more recent error messages on the stack, back to
+   the position of the marker.  This preserves any older error messages
+   on the stack.  FTCMSG simply clears the entire error message stack.
+  These routines are called without any arguments.
+\end{description}
+
+\begin{verbatim}
+        FTPMRK
+        FTCMRK
+        FTCMSG
+\end{verbatim}
+
+
+\begin{description}
+\item[5 ] Print out the error message corresponding to the input status
     value and all the error messages on the FITSIO stack  to the specified
     file stream  (stream can be either the string 'STDOUT' or 'STDERR').
    If the input status value = 0 then this routine does nothing.
@@ -3104,7 +3418,7 @@ used by these interface routines.
 \end{verbatim}
 
 \begin{description}
-\item[5 ] Write an 80-character message to the FITSIO error stack.  Application
+\item[6 ] Write an 80-character message to the FITSIO error stack.  Application
     programs should not normally write to the stack, but there may be
    some situations where this is desirable.
 \end{description}
@@ -3112,17 +3426,6 @@ used by these interface routines.
 \begin{verbatim}
         FTPMSG(errmsg)
 \end{verbatim}
-
-\begin{description}
-\item[6 ]  Clear the entire error message stack.  This routine is useful
-     to clear any error message that may have been generated by
-     a non-fatal FITSIO error (such as failing to find an optional
-    header keyword).  This routine is called without any arguments.
-\end{description}
-
-\begin{verbatim}
-        FTCMSG
-\end{verbatim}
 
 
 \section{File I/O Routines}
@@ -3133,7 +3436,11 @@ used by these interface routines.
    This routine always opens the primary array (the first HDU) of
    the file, and does not move to a following extension, if one was
    specified as part of the filename.   Use the FTNOPN routine to
-  automatically move to the extension.
+   automatically move to the extension.  This routine will also
+   open IRAF images (.imh format files) and raw binary data arrays
+   with READONLY access by first converting them on the fly into
+   virtual FITS images.  See the `Extended File Name Syntax' chapter
+  for more details.
 \end{description}
 
 \begin{verbatim}
@@ -3154,8 +3461,28 @@ used by these interface routines.
 \end{verbatim}
 
 \begin{description}
-\item[3 ]Open and initialize a new empty FITS file.   A template file may also be
-   specified to define the structure of the new file (see secion 4.2.4).
+\item[3 ]Open an existing FITS file with readonly or readwrite access
+   and then move to the first HDU containing significant data, if a) an HDU
+   name or number to open was not explicitly specified as part of the
+   filename, and b) if the FITS file contains a null primary array (i.e.,
+   NAXIS = 0).  In this case, it will look for the first IMAGE HDU with
+   NAXIS > 0, or the first table that does not contain the strings `GTI'
+   (Good Time Interval) or `OBSTABLE' in the EXTNAME keyword value.  FTTOPN
+   is similar, except it will move to the first significant table HDU
+   (skipping over any image HDUs) in the file if a specific HDU name
+   or number is not specified.  FTIOPN will move to the first non-null
+  image HDU, skipping over any tables.
+\end{description}
+
+\begin{verbatim}
+        FTDOPN(unit,filename,rwmode, > status)
+        FTTOPN(unit,filename,rwmode, > status)
+        FTIOPN(unit,filename,rwmode, > status)
+\end{verbatim}
+
+\begin{description}
+\item[4 ]Open and initialize a new empty FITS file.   A template file may also be
+   specified to define the structure of the new file (see section 4.2.4).
 \end{description}
 
 \begin{verbatim}
@@ -3163,7 +3490,7 @@ used by these interface routines.
 \end{verbatim}
 
 \begin{description}
-\item[4 ]Close a FITS file previously opened with ftopen or ftinit
+\item[5 ]Close a FITS file previously opened with ftopen or ftinit
 \end{description}
 
 \begin{verbatim}
@@ -3171,7 +3498,7 @@ used by these interface routines.
 \end{verbatim}
 
 \begin{description}
-\item[5 ] Move to a specified (absolute) HDU in the FITS file (nhdu = 1 for the
+\item[6 ] Move to a specified (absolute) HDU in the FITS file (nhdu = 1 for the
    FITS primary array)
 \end{description}
 
@@ -3180,12 +3507,17 @@ used by these interface routines.
 \end{verbatim}
 
 \begin{description}
-\item[6 ] Create a primary array (if none already exists), or insert a
-    new IMAGE extension immediately following the CHDU.
-    Any following extensions will be shifted down to make room for
-    the new extension.  If there are no other following extensions
-    then the new image extension will simply be appended to the
-   end of the file.  The new extension will become the CHDU.
+\item[7 ] Create a primary array (if none already exists), or insert a
+    new IMAGE extension immediately following the CHDU, or
+    insert a new Primary Array at the beginning of the file.  Any
+    following extensions in the file will be shifted down to make room
+    for the new extension.  If the CHDU is the last HDU in the file
+    then the new image extension will simply be appended to the end of
+    the file.   One can force a new primary array to be inserted at the
+    beginning of the FITS file by setting status = -9 prior
+    to calling the routine.  In this case the old primary array will be
+    converted to an IMAGE extension. The new extension (or primary
+   array) will become the CHDU.
 \end{description}
 
 \begin{verbatim}
@@ -3193,7 +3525,7 @@ used by these interface routines.
 \end{verbatim}
 
 \begin{description}
-\item[7 ] Insert a new ASCII TABLE extension immediately following the CHDU.
+\item[8 ] Insert a new ASCII TABLE extension immediately following the CHDU.
     Any following extensions will be shifted down to make room for
     the new extension.  If there are no other following extensions
     then the new table extension will simply be appended to the
@@ -3206,7 +3538,7 @@ used by these interface routines.
 \end{verbatim}
 
 \begin{description}
-\item[8 ] Insert a new binary table extension immediately following the CHDU.
+\item[9 ] Insert a new binary table extension immediately following the CHDU.
     Any following extensions will be shifted down to make room for
     the new extension.  If there are no other following extensions
     then the new bintable extension will simply be appended to the
@@ -3369,22 +3701,28 @@ previous chapter are also repeated here. A right arrow symbol is used
 here to separate the input parameters from the output parameters in the
 definition of each subroutine. This symbol is not actually part of the
 calling sequence. An alphabetical list and definition of all the
-parameters is given at the end of this section. The SPP interface
-subroutines have the same arguments but have names that begin with 'fs'
-rather than 'ft'.
+parameters is given at the end of this section.
 
 
 \section{FITS File Open and Close Subroutines: \label{FTOPEN}}
 
 
 \begin{description}
-\item[1 ]Open an existing FITS file with readonly or readwrite access
+\item[1 ]Open an existing FITS file with readonly or readwrite access. FTDOPN
+also moves to the first HDU containing significant data, if no specific
+HDU is specified as part of the filename.  FTTOPN and FTIOPN are similar
+except that they will move to the first table HDU or image HDU, respectively,
+if a HDU name or number is not specified as part of the filename.
 \end{description}
 
 \begin{verbatim}
         FTOPEN(unit,filename,rwmode, > blocksize,status)
+        FTDOPN(unit,filename,rwmode, > status)
+        FTTOPN(unit,filename,rwmode, > status)
+        FTIOPN(unit,filename,rwmode, > status)
 \end{verbatim}
 
+
 \begin{description}
 \item[2 ]Open an existing FITS file with readonly or readwrite access
    and move to a following extension, if one was specified as
@@ -3562,7 +3900,7 @@ in the input file name.
 \item[16] Parse the input file name and return the root file name.  The root
 name includes the file type if specified, (e.g.  'ftp://' or 'http://')
 and the full path name, to the extent that it is specified in the input
-filename.  It does not enclude the HDU name or number, or any filtering
+filename.  It does not include the HDU name or number, or any filtering
 specifications.
 \end{description}
 
@@ -3571,6 +3909,25 @@ specifications.
 \end{verbatim}
 
 
+\begin{description}
+\item[16] Test if the input file or a compressed version of the file (with
+a .gz, .Z, .z, or .zip extension) exists on disk.  The returned value of
+the 'exists' parameter will have 1 of the 4 following values:
+
+\begin{verbatim}
+   2:  the file does not exist, but a compressed version does exist
+   1:  the disk file does exist
+   0:  neither the file nor a compressed version of the file exist
+  -1:  the input file name is not a disk file (could be a ftp, http,
+       smem, or mem file, or a file piped in on the STDIN stream)
+\end{verbatim}
+
+\end{description}
+
+\begin{verbatim}
+      FTEXIST(filename, > exists, status);
+\end{verbatim}
+
 \section{HDU-Level Operations \label{FTMAHD}}
 
 When a FITS file is first opened or created, the internal buffers in
@@ -3732,7 +4089,25 @@ and so on.
 \end{verbatim}
 
 \begin{description}
-\item[13] Copy the entire CHDU from the FITS file associated with IUNIT to the CHDU
+\item[13]  Copy all or part of the input FITS file and append it
+    to the end of the output FITS file.  If 'previous' is
+    true (not 0), then any HDUs preceding the current HDU in the input file
+    will be copied to the output file.  Similarly, 'current' and 'following'
+    determine whether the current HDU, and/or any following HDUs in the
+    input file will be copied to the output file. If all 3 parameters are
+    true, then the entire input file will be copied.  On return, the current
+    HDU in the input file will be unchanged, and the last HDU will be the
+   current HDU in the output file.
+\end{description}
+
+\begin{verbatim}
+  int fits_copy_file / ffcpfl
+      (fitsfile *infptr, fitsfile *outfptr, int previous, int current,
+          int following, > int *status)
+\end{verbatim}
+
+\begin{description}
+\item[14] Copy the entire CHDU from the FITS file associated with IUNIT to the CHDU
     of the FITS file associated with OUNIT. The output HDU must be empty and
     not already contain any keywords.  Space will be reserved for MOREKEYS
     additional  keywords in the output header if there is not already enough
@@ -3744,7 +4119,7 @@ and so on.
 \end{verbatim}
 
 \begin{description}
-\item[14] Copy the header (and not the data) from the CHDU associated with inunit
+\item[15] Copy the header (and not the data) from the CHDU associated with inunit
     to the CHDU associated with outunit.  If the current output HDU
     is not completely empty, then the CHDU will be closed and a new
     HDU will be appended to the output file.  This routine will automatically
@@ -3758,7 +4133,7 @@ and so on.
 \end{verbatim}
 
 \begin{description}
-\item[15] Copy just the data from the CHDU associated with IUNIT
+\item[16] Copy just the data from the CHDU associated with IUNIT
     to the CHDU associated with OUNIT. This will overwrite
     any data previously in the OUNIT CHDU.  This low level routine is used
     by FTCOPY, but it may also be useful in certain application programs
@@ -4015,7 +4390,7 @@ values are not blank.
 
 \begin{description}
 \item[2 ] Put (append) a COMMENT keyword into the CHU.  Multiple COMMENT keywords
-   will be written if the input comment string is longer than 70 characters.
+   will be written if the input comment string is longer than 72 characters.
 \end{description}
 
 \begin{verbatim}
@@ -4024,7 +4399,7 @@ values are not blank.
 
 \begin{description}
 \item[3 ]Put (append) a HISTORY keyword into the CHU.  Multiple HISTORY keywords
-   will be written if the input history string is longer than 70 characters.
+   will be written if the input history string is longer than 72 characters.
 \end{description}
 
 \begin{verbatim}
@@ -4184,6 +4559,7 @@ values are not blank.
 \end{description}
 
 \begin{verbatim}
+        FTIKEY(unit, card, > status)
         FTIKY[JLS](unit,keyword,keyval,comment, > status)
         FTIKLS(unit,keyword,keyval,comment, > status)
         FTIKY[EDFG](unit,keyword,keyval,decimals,comment, > status)
@@ -4574,11 +4950,26 @@ contiguous rectangular subset of pixels within the n-dimensional array.
 
 \begin{description}
 \item[1 ] Get the data type of the image (= BITPIX value).  Possible returned
-   values are: 8, 16, 32, -32, or -64.
+    values are: 8, 16, 32, -32, or -64 corresponding to unsigned byte,
+    signed 2-byte integer, signed 4-byte integer, real, and double.
+
+    The second subroutine is similar to FTGIDT, except that if the image
+    pixel values are scaled, with non-default values for the BZERO and
+    BSCALE keywords, then this routine will return the 'equivalent'
+    data type that is needed to store the scaled values.  For example,
+    if BITPIX = 16 and BSCALE = 0.1 then the equivalent data type is
+    floating point, and -32 will be returned.  There are 2 special cases:
+    if the image contains unsigned 2-byte integer values, with BITPIX =
+    16, BSCALE = 1, and BZERO = 32768, then this routine will return
+    a non-standard value of 20 for the bitpix value.  Similarly if the
+    image contains unsigned 4-byte integers, then bitpix will
+   be returned with a value of 40.
 \end{description}
 
+
 \begin{verbatim}
         FTGIDT(unit, > bitpix,status)
+        FTGIET(unit, > bitpix,status)
 \end{verbatim}
 
 \begin{description}
@@ -4854,11 +5245,24 @@ within the first 8 characters.
     TFORM = 'rAw' where 'r' is the total number of characters (= the width
     of the column) and 'w' is the width of a unit string within the column.
     Thus if the column has TFORM = '60A12' then this routine will return
-   datacode = 16, repeat = 60, and width = 12.
+    datacode = 16, repeat = 60, and width = 12.
+
+   The second routine, FTEQTY is similar except that in
+   the case of scaled integer columns it returns the 'equivalent' data
+   type that is needed to store the scaled values, and not necessarily
+   the physical data type of the unscaled values as stored in the FITS
+   table.  For example if a '1I' column in a binary table has TSCALn =
+   1 and TZEROn = 32768, then this column effectively contains unsigned
+   short integer values, and thus the returned value of typecode will
+   be the code for an unsigned short integer, not a signed short integer.
+   Similarly, if a column has TTYPEn = '1I'
+   and TSCALn = 0.12, then the returned typecode
+  will be the code for a 'real' column.
 \end{description}
 
 \begin{verbatim}
         FTGTCL(unit,colnum, > datacode,repeat,width,status)
+        FTEQTY(unit,colnum, > datacode,repeat,width,status)
 \end{verbatim}
 
 \begin{description}
@@ -5040,13 +5444,16 @@ do not use ASCII character codes in the internal data representations
 
 \begin{description}
 \item[3 ] Delete a list of rows from an ASCII or binary table (in the CDU).
-    rowlist is an array of row numbers to be deleted from the table.
-    (The first row in the table is 1 not 0).  The list of
-    row numbers must be sorted in ascending order.  nrows is the
-   number of row numbers in the list.
+    In the first routine, 'rowrange' is a character string listing the
+    rows or row ranges to delete (e.g., '2-4, 5, 8-9'). In the second
+    routine, 'rowlist' is an integer array of row numbers to be deleted
+    from the table.  nrows is the number of row numbers in the list.
+    The first row in the table is 1 not 0.  The list of row numbers
+   must be sorted in ascending order.
 \end{description}
 
 \begin{verbatim}
+        FTDRRG(unit,rowrange, > status)
         FTDRWS(unit,rowlist,nrows, > status)
 \end{verbatim}
 
@@ -5350,7 +5757,13 @@ FITS table, based on whether the expression evaluates to true (not
 equal to zero) or false (zero).  The other routines evaluate the
 expression and calculate a value for each row of the table.  The
 allowed expression syntax is described in the row filter section in the
-earlier `Extended File Name Syntax' chapter of this document.
+earlier `Extended File Name Syntax' chapter of this document.  The
+expression may also be written to a text file, and the name of the
+file, prepended with a '@' character may be supplied for the 'expr'
+parameter (e.g.  '@filename.txt'). The  expression  in  the  file can
+be arbitrarily complex and extend over multiple lines of the file.
+Lines  that begin with 2 slash characters ('//') will  be ignored and
+may be used to add comments to the file.
 
 
 \begin{description}
@@ -5403,11 +5816,11 @@ parName parameter is the name of the column (which may or may not already
 exist) into which to write the results, and parInfo contains an
 optional TFORM keyword value if a new column is being created.  If a
 TFORM value is not specified then a default format will be used,
-depending on the expression.  If the expression evalutes to a constant,
+depending on the expression.  If the expression evaluates to a constant,
 then the result will be written to the keyword name given by the
 parName parameter, and the parInfo parameter may be used to supply an
 optional comment for the keyword.  If the keyword does not already
-exist, then the name of the keyword must be preceeded with a '\#' character,
+exist, then the name of the keyword must be preceded with a '\#' character,
 otherwise the result will be written to a column with that name.
 \end{description}
 
@@ -5440,13 +5853,46 @@ and lastrow give the starting and ending row number of each range.
 
 \section{Celestial Coordinate System Subroutines \label{FTGICS}}
 
-The following subroutines are provided to help calculate the
-transformation between pixel location in an image and the corresponding
-celestial coordinates on the sky.  These support the following standard
-map projections:  -SIN, -TAN, -ARC, -NCP, -GLS, -MER, and -AIT (these
-are the legal values for the coordtype parameter).  These routines are
-based on similar functions in Classic AIPS.  All the angular quantities
-are given in units of degrees.
+The FITS community has adopted a set of keyword conventions that define
+the transformations needed to convert between pixel locations in an
+image and the corresponding celestial coordinates on the sky, or more
+generally, that define world coordinates that are to be associated with
+any pixel location in an n-dimensional FITS array. CFITSIO is distributed
+with a couple of self-contained World Coordinate System (WCS) routines,
+however, these routines DO NOT support all the latest WCS conventions,
+so it is STRONGLY RECOMMENDED that software developers use a more robust
+external WCS library.  Several recommended libraries are:
+
+\begin{verbatim}
+  WCSLIB -  supported by Mark Calabretta
+  WCSTools - supported by Doug Mink
+  AST library - developed by the U.K. Starlink project
+\end{verbatim}
+
+More information about the WCS keyword conventions and links to all of
+these WCS libraries can be found on the FITS Support Office web site at
+http://fits.gsfc.nasa.gov under the WCS link.
+
+The functions provided in these external WCS libraries will need access to
+the  WCS information contained in the FITS file headers.  One convenient
+way to pass this information to the extermal library is to use  FITSIO
+to copy the header keywords into one long character string, and then
+pass this string to an interface routine in the external library that
+will extract the necessary WCS information (e.g., see the astFitsChan
+and astPutCards routines in the Starlink AST library).
+
+The following FITSIO routines DO NOT support the more recent WCS conventions
+that have been approved as part of the FITS standard.  Consequently,
+the following routines ARE NOW DEPRECATED.  It is STRONGLY RECOMMENDED
+that software developers not use these routines, and instead use an
+external WCS library, as described above.
+
+These routines are included mainly for backward compatibility with
+existing software.  They support the following standard map
+projections: -SIN, -TAN, -ARC, -NCP, -GLS, -MER, and -AIT (these are the
+legal values for the coordtype parameter).  These routines are based
+on similar functions in Classic AIPS.  All the angular quantities are
+given in units of degrees.
 
 
 \begin{description}
@@ -5821,7 +6267,7 @@ The following utility subroutines may be useful for certain applications:
 
 \begin{description}
 \item[11] Return the class of input header record.  The record is classified
-    into one of the following catagories (the class values are
+    into one of the following categories (the class values are
     defined in fitsio.h).  Note that this is one of the few FITSIO
    routines that does not return a status value.
 \end{description}
@@ -6027,6 +6473,26 @@ The following utility subroutines may be useful for certain applications:
       # the following template line modifies the NAME keyword to OBJECT
       - NAME OBJECT
 \end{verbatim}
+
+\begin{description}
+\item[16]  Parse the input string containing a list of rows or row ranges, and
+     return integer arrays containing the first and last row in each
+     range.  For example, if rowlist = "3-5, 6, 8-9" then it will
+     return numranges = 3, rangemin = 3, 6, 8 and rangemax = 5, 6, 9.
+     At most, 'maxranges' number of ranges will be returned.  'maxrows'
+     is the maximum number of rows in the table; any rows or ranges
+     larger than this will be ignored.  The rows must be specified in
+     increasing order, and the ranges must not overlap. A minus sign
+     may be use to specify all the rows to the upper or lower bound, so
+     "50-" means all the rows from 50 to the end of the table, and "-"
+    means all the rows in the table, from 1 - maxrows.
+\end{description}
+
+\begin{verbatim}
+    FTRWRG(rowlist, maxrows, maxranges, >
+           numranges, rangemin, rangemax, status)
+\end{verbatim}
+
 
 \chapter{  Summary of all FITSIO User-Interface Subroutines }
 
@@ -6038,13 +6504,18 @@ The following utility subroutines may be useful for certain applications:
         FTGMSG( > errmsg)
         FTRPRT (stream, > status)
         FTPMSG(errmsg)
+        FTPMRK
         FTCMSG
+        FTCMRK
 \end{verbatim}
  FITS File Open and Close Subroutines: page~\pageref{FTOPEN}
 
 \begin{verbatim}
         FTOPEN(unit,filename,rwmode, > blocksize,status)
         FTNOPN(unit,filename,rwmode, > status)
+        FTDOPN(unit,filename,rwmode, > status)
+        FTTOPN(unit,filename,rwmode, > status)
+        FTIOPN(unit,filename,rwmode, > status)
         FTREOPEN(unit, > newunit, status)
         FTINIT(unit,filename,blocksize, > status)
         FTTPLT(unit, filename, tplfilename, > status)
@@ -6060,6 +6531,7 @@ The following utility subroutines may be useful for certain applications:
         FTIURL(filename, > filetype, infile, outfile, extspec, filter,
                binspec, colspec, status)
         FTRTNM(filename, > rootname, status)
+        FTEXIST(filename, > exist, status)
 \end{verbatim}
  HDU-Level Operations: page~\pageref{FTMAHD}
 
@@ -6077,6 +6549,7 @@ The following utility subroutines may be useful for certain applications:
         FTIBIN(unit,nrows,tfields,ttype,tform,tunit,extname,varidat > status)
         FTRSIM(unit,bitpix,naxis,naxes,status)
         FTDHDU(unit, > hdutype,status)
+        FTCPFL(iunit,ounit,previous, current, following, > status)
         FTCOPY(iunit,ounit,morekeys, > status)
         FTCPHD(inunit, outunit, > status)
         FTCPDT(iunit,ounit, > status)
@@ -6195,6 +6668,7 @@ The following utility subroutines may be useful for certain applications:
 
 \begin{verbatim}
         FTGIDT(unit, > bitpix,status)
+        FTGIET(unit, > bitpix,status)
         FTGIDM(unit, > naxis,status)
         FTGISZ(unit, maxdim, > naxes,status)
         FTGIPR(unit, maxdim, > bitpix,naxis,naxes,status)
@@ -6224,6 +6698,7 @@ The following utility subroutines may be useful for certain applications:
         FTGCNO(unit,casesen,coltemplate, > colnum,status)
         FTGCNN(unit,casesen,coltemplate, > colnam,colnum,status)
         FTGTCL(unit,colnum, > datacode,repeat,width,status)
+        FTEQTY(unit,colnum, > datacode,repeat,width,status)
         FTGCDW(unit,colnum, > dispwidth,status)
         FTGACL(unit,colnum, >
                ttype,tbcol,tunit,tform,tscal,tzero,snull,tdisp,status)
@@ -6247,6 +6722,7 @@ The following utility subroutines may be useful for certain applications:
 \begin{verbatim}
         FTIROW(unit,frow,nrows, > status)
         FTDROW(unit,frow,nrows, > status)
+        FTDRRG(unit,rowrange, > status)
         FTDRWS(unit,rowlist,nrows, > status)
         FTICOL(unit,colnum,ttype,tform, > status)
         FTICLS(unit,colnum,ncols,ttype,tform, > status)
@@ -6340,6 +6816,8 @@ The following utility subroutines may be useful for certain applications:
         FTBNFM(tform, > datacode,repeat,width,status)
         FTGABC(tfields,tform,space, > rowlen,tbcol,status)
         FTGTHD(template, > card,hdtype,status)
+        FTRWRG(rowlist, maxrows, maxranges, > numranges, rangemin,
+               rangemax, status)
 \end{verbatim}
 
 \chapter{ Parameter Definitions }
@@ -6393,6 +6871,7 @@ errtext - (character*30) descriptive error message corresponding to error number
 casesen - (logical) true if column name matching is case sensitive
 exact - (logical) do the strings match exactly, or were wildcards used?
 exclist  (character array) list of names to be excluded from search
+exists   - flag indicating whether the file or compressed file exists on disk
 extend - (logical) true if there may be extensions following the primary data
 extname - (character) value of the EXTNAME keyword (if not blank)
 fbit - (integer) first bit in the field to be read or written
@@ -6409,7 +6888,7 @@ hdtype - (integer) header record type: -1=delete;  0=append or replace;
                    1=append; 2=this is the END keyword
 hduok - (integer) was the HDU verification successful (=1) or
          not (= -1).  Equals zero if the CHECKSUM keyword is not present.
-hdusum - (double precsion) 32 bit 1's complement checksum for the entire CHDU
+hdusum - (double precision) 32 bit 1's complement checksum for the entire CHDU
 hdutype - (integer) type of HDU: 0 = primary array or IMAGE, 1 = ASCII table,
                    2 = binary table, -1 = unknown
 history - (character) the HISTORY keyword comment string
@@ -6464,8 +6943,9 @@ rot - (double precision) celestial coordinate rotation angle (degrees)
 rowlen - (integer) length of a table row, in characters or bytes
 rowlist - (integer array) list of row numbers to be deleted in increasing order
 rownum - (integer) number of the row (first row = 1)
+rowrange- (string) list of rows or row ranges to be deleted
 rwmode - (integer) file access mode: 0 = readonly, 1 = readwrite
-second   (double)- second within minute (0 - 60.9999999999) (leapsecond!)
+second   (double)- second within minute (0 - 60.9999999999) (leap second!)
 seq_no - (integer) the sequence number to append to the keyword root name
 simple - (logical) does the FITS file conform to all the FITS standards
 snull - (character) value used to represent undefined values in ASCII table
@@ -6545,6 +7025,7 @@ FITSIO use.
 123  driver initialization failed
 124  matching driver is not registered
 125  failed to parse input file URL
+126  parse error in range list
 
 151  bad argument in shared memory driver
 152  null pointer passed as an argument
@@ -6629,6 +7110,8 @@ FITSIO use.
 346 HDU_ALREADY_TRACKED
 347 BAD_OPTION
 348 IDENTICAL_POINTERS
+349 BAD_GROUP_ATTACH
+350 BAD_GROUP_DETACH
 
 360 NGP_NO_MEMORY              malloc failed
 361 NGP_READ_ERR               read error from file
diff --git a/fitsio.toc b/fitsio.toc
index 67deb31..991400f 100644
--- a/fitsio.toc
+++ b/fitsio.toc
@@ -1,75 +1,90 @@
 \contentsline {chapter}{\numberline {1}Introduction }{1}
 \contentsline {chapter}{\numberline {2} Creating FITSIO/CFITSIO }{3}
 \contentsline {section}{\numberline {2.1}Building the Library}{3}
-\contentsline {section}{\numberline {2.2}Testing the Library}{5}
+\contentsline {section}{\numberline {2.2}Testing the Library}{6}
 \contentsline {section}{\numberline {2.3}Linking Programs with FITSIO}{7}
-\contentsline {section}{\numberline {2.4}Getting Started with FITSIO}{7}
-\contentsline {section}{\numberline {2.5}Example Program}{7}
+\contentsline {section}{\numberline {2.4}Getting Started with FITSIO}{8}
+\contentsline {section}{\numberline {2.5}Example Program}{8}
 \contentsline {section}{\numberline {2.6}Legal Stuff}{9}
-\contentsline {section}{\numberline {2.7}Acknowledgements}{9}
-\contentsline {chapter}{\numberline {3} A FITS Primer }{11}
-\contentsline {chapter}{\numberline {4} Extended File Name Syntax }{13}
-\contentsline {section}{\numberline {4.1}Overview}{13}
-\contentsline {section}{\numberline {4.2}Detailed Filename Syntax}{15}
-\contentsline {subsection}{\numberline {4.2.1}Filetype}{16}
-\contentsline {subsection}{\numberline {4.2.2}Base Filename}{19}
-\contentsline {subsection}{\numberline {4.2.3}Output File Name when Opening an Existing File}{20}
-\contentsline {subsection}{\numberline {4.2.4}Template File Name when Creating a New File}{21}
-\contentsline {subsection}{\numberline {4.2.5}HDU Location Specification}{25}
-\contentsline {subsection}{\numberline {4.2.6}age Section}{26}
-\contentsline {subsection}{\numberline {4.2.7}Column and Keyword Filtering Specification}{27}
-\contentsline {subsection}{\numberline {4.2.8}Row Filtering Specification}{28}
-\contentsline {subsection}{\numberline {4.2.9}Binning or Histogramming Specification}{35}
-\contentsline {chapter}{\numberline {5}FITSIO Conventions and Guidelines }{39}
-\contentsline {section}{\numberline {5.1}CFITSIO Size Limitations}{39}
-\contentsline {section}{\numberline {5.2}Multiple Access to the Same FITS File}{40}
-\contentsline {section}{\numberline {5.3}Current Header Data Unit (CHDU)}{40}
-\contentsline {section}{\numberline {5.4}Subroutine Names}{40}
-\contentsline {section}{\numberline {5.5}Subroutine Families and Datatypes}{41}
-\contentsline {section}{\numberline {5.6}Implicit Data Type Conversion}{41}
-\contentsline {section}{\numberline {5.7}Data Scaling}{42}
-\contentsline {section}{\numberline {5.8}Error Status Values and the Error Message Stack}{42}
-\contentsline {section}{\numberline {5.9}Variable-Length Array Facility in Binary Tables}{43}
-\contentsline {section}{\numberline {5.10}Support for IEEE Special Values}{44}
-\contentsline {section}{\numberline {5.11}When the Final Size of the FITS HDU is Unknown}{44}
-\contentsline {section}{\numberline {5.12}Local FITS Conventions supported by FITSIO}{45}
-\contentsline {subsection}{\numberline {5.12.1}Support for Long String Keyword Values.}{45}
-\contentsline {subsection}{\numberline {5.12.2}Arrays of Fixed-Length Strings in Binary Tables}{46}
-\contentsline {subsection}{\numberline {5.12.3}Keyword Units Strings}{47}
-\contentsline {subsection}{\numberline {5.12.4}HIERARCH Convention for Extended Keyword Names}{47}
-\contentsline {section}{\numberline {5.13}Optimizing Code for Maximum Processing Speed}{48}
-\contentsline {subsection}{\numberline {5.13.1}Background Information: How CFITSIO Manages Data I/O}{48}
-\contentsline {chapter}{\numberline {6} The CFITSIO Iterator Function }{53}
-\contentsline {chapter}{\numberline {7} Basic Interface Routines }{55}
-\contentsline {section}{\numberline {7.1}FITSIO Error Status Routines }{55}
-\contentsline {section}{\numberline {7.2}File I/O Routines}{56}
-\contentsline {section}{\numberline {7.3}Keyword I/O Routines}{57}
-\contentsline {section}{\numberline {7.4}Data I/O Routines}{58}
-\contentsline {chapter}{\numberline {8} Advanced Interface Subroutines }{61}
-\contentsline {section}{\numberline {8.1}FITS File Open and Close Subroutines: }{61}
-\contentsline {section}{\numberline {8.2}HDU-Level Operations }{64}
-\contentsline {section}{\numberline {8.3}Define or Redefine the structure of the CHDU }{66}
-\contentsline {section}{\numberline {8.4}FITS Header I/O Subroutines}{67}
-\contentsline {subsection}{\numberline {8.4.1}Header Space and Position Routines }{67}
-\contentsline {subsection}{\numberline {8.4.2}Read or Write Standard Header Routines }{68}
-\contentsline {subsection}{\numberline {8.4.3}Write Keyword Subroutines }{69}
-\contentsline {subsection}{\numberline {8.4.4}Insert Keyword Subroutines }{71}
-\contentsline {subsection}{\numberline {8.4.5}Read Keyword Subroutines }{72}
-\contentsline {subsection}{\numberline {8.4.6}Modify Keyword Subroutines }{74}
-\contentsline {subsection}{\numberline {8.4.7}Update Keyword Subroutines }{75}
-\contentsline {subsection}{\numberline {8.4.8}Delete Keyword Subroutines }{75}
-\contentsline {section}{\numberline {8.5}Data Scaling and Undefined Pixel Parameters }{75}
-\contentsline {section}{\numberline {8.6}FITS Primary Array or IMAGE Extension I/O Subroutines }{77}
-\contentsline {section}{\numberline {8.7}FITS ASCII and Binary Table Data I/O Subroutines}{80}
-\contentsline {subsection}{\numberline {8.7.1}Column Information Subroutines }{80}
-\contentsline {subsection}{\numberline {8.7.2}Low-Level Table Access Subroutines }{82}
-\contentsline {subsection}{\numberline {8.7.3}Edit Rows or Columns }{83}
-\contentsline {subsection}{\numberline {8.7.4}Read and Write Column Data Routines }{84}
-\contentsline {section}{\numberline {8.8}Row Selection and Calculator Routines }{87}
-\contentsline {section}{\numberline {8.9}Celestial Coordinate System Subroutines }{89}
-\contentsline {section}{\numberline {8.10}File Checksum Subroutines }{90}
-\contentsline {section}{\numberline {8.11} Date and Time Utility Routines }{91}
-\contentsline {section}{\numberline {8.12}General Utility Subroutines }{92}
-\contentsline {chapter}{\numberline {9} Summary of all FITSIO User-Interface Subroutines }{99}
-\contentsline {chapter}{\numberline {10} Parameter Definitions }{107}
-\contentsline {chapter}{\numberline {11} FITSIO Error Status Codes }{113}
+\contentsline {section}{\numberline {2.7}Acknowledgements}{10}
+\contentsline {chapter}{\numberline {3} A FITS Primer }{13}
+\contentsline {chapter}{\numberline {4} Extended File Name Syntax }{15}
+\contentsline {section}{\numberline {4.1}Overview}{15}
+\contentsline {section}{\numberline {4.2}Filetype}{18}
+\contentsline {subsection}{\numberline {4.2.1}Notes about HTTP proxy servers}{18}
+\contentsline {subsection}{\numberline {4.2.2}Notes about the root filetype}{18}
+\contentsline {subsection}{\numberline {4.2.3}Notes about the shmem filetype:}{20}
+\contentsline {section}{\numberline {4.3}Base Filename}{21}
+\contentsline {section}{\numberline {4.4}Output File Name when Opening an Existing File}{23}
+\contentsline {section}{\numberline {4.5}Template File Name when Creating a New File}{24}
+\contentsline {section}{\numberline {4.6}HDU Location Specification}{24}
+\contentsline {section}{\numberline {4.7}Image Section}{25}
+\contentsline {section}{\numberline {4.8}Column and Keyword Filtering Specification}{26}
+\contentsline {section}{\numberline {4.9}Row Filtering Specification}{28}
+\contentsline {subsection}{\numberline {4.9.1}General Syntax}{28}
+\contentsline {subsection}{\numberline {4.9.2}Bit Masks}{30}
+\contentsline {subsection}{\numberline {4.9.3}Vector Columns}{31}
+\contentsline {subsection}{\numberline {4.9.4}Good Time Interval Filtering}{32}
+\contentsline {subsection}{\numberline {4.9.5}Spatial Region Filtering}{33}
+\contentsline {subsection}{\numberline {4.9.6}Example Row Filters}{36}
+\contentsline {section}{\numberline {4.10} Binning or Histogramming Specification}{37}
+\contentsline {chapter}{\numberline {5}Template Files }{41}
+\contentsline {section}{\numberline {5.1}Detailed Template Line Format}{41}
+\contentsline {section}{\numberline {5.2}Auto-indexing of Keywords}{42}
+\contentsline {section}{\numberline {5.3}Template Parser Directives}{43}
+\contentsline {section}{\numberline {5.4}Formal Template Syntax}{43}
+\contentsline {section}{\numberline {5.5}Errors}{44}
+\contentsline {section}{\numberline {5.6}Examples}{44}
+\contentsline {chapter}{\numberline {6}FITSIO Conventions and Guidelines }{47}
+\contentsline {section}{\numberline {6.1}CFITSIO Size Limitations}{47}
+\contentsline {section}{\numberline {6.2}Multiple Access to the Same FITS File}{48}
+\contentsline {section}{\numberline {6.3}Current Header Data Unit (CHDU)}{48}
+\contentsline {section}{\numberline {6.4}Subroutine Names}{48}
+\contentsline {section}{\numberline {6.5}Subroutine Families and Datatypes}{49}
+\contentsline {section}{\numberline {6.6}Implicit Data Type Conversion}{49}
+\contentsline {section}{\numberline {6.7}Data Scaling}{50}
+\contentsline {section}{\numberline {6.8}Error Status Values and the Error Message Stack}{50}
+\contentsline {section}{\numberline {6.9}Variable-Length Array Facility in Binary Tables}{51}
+\contentsline {section}{\numberline {6.10}Support for IEEE Special Values}{52}
+\contentsline {section}{\numberline {6.11}When the Final Size of the FITS HDU is Unknown}{53}
+\contentsline {section}{\numberline {6.12}Local FITS Conventions supported by FITSIO}{53}
+\contentsline {subsection}{\numberline {6.12.1}Support for Long String Keyword Values.}{53}
+\contentsline {subsection}{\numberline {6.12.2}Arrays of Fixed-Length Strings in Binary Tables}{54}
+\contentsline {subsection}{\numberline {6.12.3}Keyword Units Strings}{55}
+\contentsline {subsection}{\numberline {6.12.4}HIERARCH Convention for Extended Keyword Names}{55}
+\contentsline {section}{\numberline {6.13}Optimizing Code for Maximum Processing Speed}{56}
+\contentsline {subsection}{\numberline {6.13.1}Background Information: How CFITSIO Manages Data I/O}{56}
+\contentsline {chapter}{\numberline {7} The CFITSIO Iterator Function }{61}
+\contentsline {chapter}{\numberline {8} Basic Interface Routines }{63}
+\contentsline {section}{\numberline {8.1}FITSIO Error Status Routines }{63}
+\contentsline {section}{\numberline {8.2}File I/O Routines}{64}
+\contentsline {section}{\numberline {8.3}Keyword I/O Routines}{66}
+\contentsline {section}{\numberline {8.4}Data I/O Routines}{66}
+\contentsline {chapter}{\numberline {9} Advanced Interface Subroutines }{69}
+\contentsline {section}{\numberline {9.1}FITS File Open and Close Subroutines: }{69}
+\contentsline {section}{\numberline {9.2}HDU-Level Operations }{72}
+\contentsline {section}{\numberline {9.3}Define or Redefine the structure of the CHDU }{75}
+\contentsline {section}{\numberline {9.4}FITS Header I/O Subroutines}{76}
+\contentsline {subsection}{\numberline {9.4.1}Header Space and Position Routines }{76}
+\contentsline {subsection}{\numberline {9.4.2}Read or Write Standard Header Routines }{77}
+\contentsline {subsection}{\numberline {9.4.3}Write Keyword Subroutines }{78}
+\contentsline {subsection}{\numberline {9.4.4}Insert Keyword Subroutines }{80}
+\contentsline {subsection}{\numberline {9.4.5}Read Keyword Subroutines }{81}
+\contentsline {subsection}{\numberline {9.4.6}Modify Keyword Subroutines }{82}
+\contentsline {subsection}{\numberline {9.4.7}Update Keyword Subroutines }{83}
+\contentsline {subsection}{\numberline {9.4.8}Delete Keyword Subroutines }{84}
+\contentsline {section}{\numberline {9.5}Data Scaling and Undefined Pixel Parameters }{84}
+\contentsline {section}{\numberline {9.6}FITS Primary Array or IMAGE Extension I/O Subroutines }{85}
+\contentsline {section}{\numberline {9.7}FITS ASCII and Binary Table Data I/O Subroutines}{88}
+\contentsline {subsection}{\numberline {9.7.1}Column Information Subroutines }{88}
+\contentsline {subsection}{\numberline {9.7.2}Low-Level Table Access Subroutines }{91}
+\contentsline {subsection}{\numberline {9.7.3}Edit Rows or Columns }{92}
+\contentsline {subsection}{\numberline {9.7.4}Read and Write Column Data Routines }{93}
+\contentsline {section}{\numberline {9.8}Row Selection and Calculator Routines }{96}
+\contentsline {section}{\numberline {9.9}Celestial Coordinate System Subroutines }{98}
+\contentsline {section}{\numberline {9.10}File Checksum Subroutines }{99}
+\contentsline {section}{\numberline {9.11} Date and Time Utility Routines }{101}
+\contentsline {section}{\numberline {9.12}General Utility Subroutines }{102}
+\contentsline {chapter}{\numberline {10} Summary of all FITSIO User-Interface Subroutines }{109}
+\contentsline {chapter}{\numberline {11} Parameter Definitions }{117}
+\contentsline {chapter}{\numberline {12} FITSIO Error Status Codes }{123}
diff --git a/fitsio2.h b/fitsio2.h
index 943dba0..2920ef0 100644
--- a/fitsio2.h
+++ b/fitsio2.h
@@ -3,12 +3,36 @@
  
 #include "fitsio.h"
 
+/* Setting SUPPORT_64_BIT_INTEGERS to 1 will enable CFITSIO to read */
+/* and write images with BITPIX = 64 and binary table columns with  */
+/* TFORMn = 'K'.  Otherwise, setting SUPPORT_64_BIT_INTEGERS to 0   */
+/* will cause CFITSIO to not recognize these  non-standard 64-bit   */
+/* FITS datatypes.                                                  */
+
+#define SUPPORT_64BIT_INTEGERS 1
+
+/*
+  If REPLACE_LINKS is defined, then whenever CFITSIO fails to open
+  a file with write access because it is a soft link to a file that
+  only has read access, then CFITSIO will attempt to replace
+  the link with a local copy of the file, with write access.  This
+  feature was originally added to support the ftools in the Hera
+  environment, where many of the user's data file are soft links.
+*/
+#if defined(BUILD_HERA)
+#define REPLACE_LINKS 1
+#endif
+
 #define USE_LARGE_VALUE -99  /* flag used when writing images */
 
 #define DBUFFSIZE 28800 /* size of data buffer in bytes */
 
-#define NIOBUF  25       /* number of IO buffers to create */
-#define IOBUFLEN 2880    /* size in bytes of each IO buffer */
+#define NIOBUF  40  /* number of IO buffers to create */
+         /* !! Significantly increasing NIOBUF may degrade performance !! */
+#define NMAXFILES  300   /* maximum number of FITS files that can be opened */
+        /* CFITSIO will allocate (NMAXFILES * 80) bytes of memory */
+
+#define IOBUFLEN 2880    /* size in bytes of each IO buffer (DONT CHANGE!) */
 #define MINDIRECT 8640   /* minimum size for direct reads and writes */
                          /* MINDIRECT must have a value >= 8640 */
 
@@ -19,6 +43,7 @@
 #define ALPHAVMS           4
 #define IBMPC              5
 #define CRAY               6
+#define PC64BIT            7
 
 #define GFLOAT             1
 #define IEEEFLOAT          2
@@ -64,7 +89,7 @@
 
 #endif
 
-#elif defined(__alpha) && defined(__unix__)
+#elif defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )
  
 #define MACHINE ALPHA_OSF
 #define BYTESWAPPED TRUE
@@ -75,6 +100,13 @@
 #define MACHINE ULTRIX
 #define BYTESWAPPED TRUE
  
+#elif defined(__sparcv9)
+
+/*  SUN Solaris7 in 64-bit mode */
+#define BYTESWAPPED FALSE
+#define MACHINE NATIVE
+#define LONGSIZE 64   
+
 #elif defined(__i386) || defined(__i386__) || defined(__i486__) || defined(__i586__) 
 
 /*  IBM PC */
@@ -87,23 +119,17 @@
 #define MACHINE IBMPC       
 #define BYTESWAPPED TRUE
 
-#elif defined(_NI_mswin_)
+#elif defined(_NI_mswin_) || defined(__EMX__)
 
-/*  LabWindows/CVI with Windows 3.x, 95, or NT  */
+/*  LabWindows/CVI with Windows, or PC runnin OS/2  */
 #define MACHINE IBMPC       
 #define BYTESWAPPED TRUE
 
-#elif  defined(__EMX__)
+#elif defined(__ia64__)  || defined(__x86_64__)
 
-/*  IBM PC running OS/2 */
-#define MACHINE IBMPC
+/*  Intel itanium 64-bit PC, or AMD opteron 64-bit PC */
 #define BYTESWAPPED TRUE
-
-#elif defined(__sparcv9)
-
-/*  SUN Solaris7 in 64-bit mode */
-#define BYTESWAPPED FALSE
-#define MACHINE NATIVE
+#define MACHINE PC64BIT
 #define LONGSIZE 64   
 
 #else
@@ -174,16 +200,28 @@
  
 #endif
 
+#define DSCHAR_MAX  127.49 /* max double value that fits in an signed char */
+#define DSCHAR_MIN -128.49 /* min double value that fits in an signed char */
 #define DUCHAR_MAX  255.49 /* max double value that fits in an unsigned char */
 #define DUCHAR_MIN -0.49   /* min double value that fits in an unsigned char */
 #define DUSHRT_MAX  65535.49 /* max double value that fits in a unsigned short*/
 #define DUSHRT_MIN -0.49   /* min double value that fits in an unsigned short */
 #define DSHRT_MAX  32767.49 /* max double value that fits in a short */
 #define DSHRT_MIN -32768.49 /* min double value that fits in a short */
-#define DULONG_MAX 4294967295.49 /* max double that fits in a unsigned long */
+
+#if LONGSIZE == 32
+#  define DLONG_MAX  2147483647.49 /* max double value that fits in a long */
+#  define DLONG_MIN -2147483648.49 /* min double value that fits in a long */
+#  define DULONG_MAX 4294967295.49 /* max double that fits in a unsigned long */
+#else
+#  define DLONG_MAX   9.2233720368547752E18 /* max double value  long */
+#  define DLONG_MIN  -9.2233720368547752E18 /* min double value  long */
+#  define DULONG_MAX 1.84467440737095504E19 /* max double value  ulong */
+#endif
+
 #define DULONG_MIN -0.49   /* min double value that fits in an unsigned long */
-#define DLONG_MAX  2147483647.49 /* max double value that fits in a long */
-#define DLONG_MIN -2147483648.49 /* min double value that fits in a long */
+#define DLONGLONG_MAX  9.2233720368547752E18 /* max double value  longlong */
+#define DLONGLONG_MIN -9.2233720368547752E18 /* min double value  longlong */
 #define DUINT_MAX 4294967295.49 /* max dbl that fits in a unsigned 4-byte int */
 #define DUINT_MIN -0.49   /* min dbl that fits in an unsigned 4-byte int */
 #define DINT_MAX  2147483647.49 /* max double value that fits in a 4-byte int */
@@ -196,9 +234,35 @@
 #define INT32_MAX  2147483647 /* max 32-bit integer */
 #endif
 #ifndef INT32_MIN
-#define INT32_MIN -2147483647 /* min 32-bit integer */
+#define INT32_MIN (-INT32_MAX -1) /* min 32-bit integer */
 #endif
 
+#ifndef LONGLONG_MAX
+
+#ifdef LLONG_MAX
+#define LONGLONG_MAX LLONG_MAX
+#define LONGLONG_MIN LLONG_MIN
+
+#elif defined(LONG_LONG_MAX)
+#define LONGLONG_MAX LONG_LONG_MAX
+#define LONGLONG_MIN LONG_LONG_MIN
+
+#elif defined(INT64_MAX)
+#define LONGLONG_MAX INT64_MAX
+#define LONGLONG_MIN INT64_MIN
+
+#elif (LONGSIZE == 64) || defined(HAVE_LONGLONG)
+#define LONGLONG_MAX  9223372036854775807L /* max 64-bit integer */
+#define LONGLONG_MIN (-LONGLONG_MAX -1L)   /* min 64-bit integer */
+
+#else
+/*  define a default value, even if it is never used */
+#define LONGLONG_MAX  LONG_MAX 
+#define LONGLONG_MIN LONG_MIN 
+#endif
+#endif  /* end of ndef LONGLONG_MAX section */
+
+
 #define COMPRESS_NULL_VALUE -2147483647
 
 int ffmkky(char *keyname, char *keyval, char *comm, char *card, int *status);
@@ -237,7 +301,6 @@ int ffgttb(fitsfile *fptr, long *rowlen, long *nrows, long *pcount,
           long *tfield, int *status);
  
 int ffmkey(fitsfile *fptr, char *card, int *status);
-int ffikey(fitsfile *fptr, char *card, int *status);
  
 int ffmbyt(fitsfile *fptr, OFF_T bytpos, int ignore_err, int *status);
 int ffgbyt(fitsfile *fptr, long nbytes, void *buffer, int *status);
@@ -248,15 +311,18 @@ int ffpbytoff(fitsfile *fptr, long gsize, long ngroups, long offset,
            void *buffer, int *status);
 int ffldrc(fitsfile *fptr, long record, int err_mode, int *status);
 int ffwhbf(fitsfile *fptr, int *nbuff);
-int ffcurbuf(int nbuff, FITSfile **Fptr);
-int ffflsh(fitsfile *fptr, int clearbuf, int *status);
 int ffbfeof(fitsfile *fptr, int *status);
 int ffbfwt(int nbuff, int *status);
 int fits_get_num_files(void);
 int ffpxsz(int datatype);
 
+int ffourl(char *url, char *urltype, char *outfile, char *tmplfile,
+            char *compspec, int *status);
+int ffparsecompspec(fitsfile *fptr, char *compspec, int *status);
 int ffoptplt(fitsfile *fptr, const char *tempname, int *status);
 int fits_is_this_a_copy(char *urltype);
+int fits_store_Fptr(FITSfile *Fptr, int *status);
+int fits_clear_Fptr(FITSfile *Fptr, int *status);
 int fits_already_open(fitsfile **fptr, char *url, 
     char *urltype, char *infile, char *extspec, char *rowfilter,
     char *binspec, char *colspec, int  mode,int  *isopen, int  *status);
@@ -270,8 +336,6 @@ int ffcalchist(long totalrows, long offset, long firstrow, long nrows,
 int fits_copy_image_cell(fitsfile **fptr, char *outfile, char *colname,
            long rownum, int *status);
 int fits_copy_image_keywords(fitsfile *infptr, fitsfile *outfptr, int *status);
-int fits_get_section_range(char **ptr,long *secmin,long *secmax,long *incre,
-              int *status);
 int ffrhdu(fitsfile *fptr, int *hdutype, int *status);
 int ffpinit(fitsfile *fptr, int *status);
 int ffainit(fitsfile *fptr, int *status);
@@ -303,7 +367,10 @@ int ffwrite(FITSfile *fptr, long nbytes, void *buffer,
             int *status);
 int fftrun(fitsfile *fptr, OFF_T filesize, int *status);
 
-int ffgcll(fitsfile *fptr, int colnum, long firstrow, long firstelem, long
+int ffpcluc(fitsfile *fptr, int colnum, long firstrow, long firstelem, long
+           nelem, int *status);
+	   
+int ffgcll(fitsfile *fptr, int colnum, long firstrow, OFF_T firstelem, long
            nelem, int nultyp, char nulval, char *array, char *nularray,
            int *anynul, int *status);
 int ffgcls(fitsfile *fptr, int colnum, long firstrow, long firstelem,
@@ -315,6 +382,9 @@ int ffgcls2(fitsfile *fptr, int colnum, long firstrow, long firstelem,
 int ffgclb(fitsfile *fptr, int colnum, long firstrow, OFF_T firstelem,
            long nelem, long  elemincre, int nultyp, unsigned char nulval,
            unsigned char *array, char *nularray, int *anynul, int  *status);
+int ffgclsb(fitsfile *fptr, int colnum, long firstrow, OFF_T firstelem,
+           long nelem, long  elemincre, int nultyp, signed char nulval,
+           signed char *array, char *nularray, int *anynul, int  *status);
 int ffgclui(fitsfile *fptr, int colnum, long firstrow, OFF_T firstelem,
            long nelem, long  elemincre, int nultyp, unsigned short nulval,
            unsigned short *array, char *nularray, int *anynul, int  *status);
@@ -324,6 +394,9 @@ int ffgcli(fitsfile *fptr, int colnum, long firstrow, OFF_T firstelem,
 int ffgcluj(fitsfile *fptr, int colnum, long firstrow, OFF_T firstelem,
            long nelem, long elemincre, int nultyp, unsigned long nulval,
            unsigned long *array, char *nularray, int *anynul, int  *status);
+int ffgcljj(fitsfile *fptr, int colnum, long firstrow, OFF_T firstelem,
+           long nelem, long elemincre, int nultyp, LONGLONG nulval, 
+           LONGLONG *array, char *nularray, int *anynul, int  *status);
 int ffgclj(fitsfile *fptr, int colnum, long firstrow, OFF_T firstelem,
            long nelem, long elemincre, int nultyp, long nulval, long *array,
            char *nularray, int *anynul, int  *status);
@@ -345,6 +418,7 @@ int ffpi1b(fitsfile *fptr, long nelem, long incre, unsigned char *buffer,
 int ffpi2b(fitsfile *fptr, long nelem, long incre, short *buffer, int *status);
 int ffpi4b(fitsfile *fptr, long nelem, long incre, INT32BIT *buffer,
            int *status);
+int ffpi8b(fitsfile *fptr, long nelem, long incre, long *buffer, int *status);
 int ffpr4b(fitsfile *fptr, long nelem, long incre, float *buffer, int *status);
 int ffpr8b(fitsfile *fptr, long nelem, long incre, double *buffer, int *status);
  
@@ -354,6 +428,8 @@ int ffgi2b(fitsfile *fptr, OFF_T pos, long nelem, long incre, short *buffer,
           int *status);
 int ffgi4b(fitsfile *fptr, OFF_T pos, long nelem, long incre, INT32BIT *buffer,
           int *status);
+int ffgi8b(fitsfile *fptr, OFF_T pos, long nelem, long incre, long *buffer,
+          int *status);
 int ffgr4b(fitsfile *fptr, OFF_T pos, long nelem, long incre, float *buffer,
           int *status);
 int ffgr8b(fitsfile *fptr, OFF_T pos, long nelem, long incre, double *buffer,
@@ -374,6 +450,9 @@ int fffi2i1(short *input, long ntodo, double scale, double zero,
 int fffi4i1(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, unsigned char nullval, char *nullarray,
             int *anynull, unsigned char *output, int *status);
+int fffi8i1(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, unsigned char nullval, char *nullarray,
+            int *anynull, unsigned char *output, int *status);
 int fffr4i1(float *input, long ntodo, double scale, double zero,
             int nullcheck, unsigned char nullval, char *nullarray,
             int *anynull, unsigned char *output, int *status);
@@ -385,6 +464,29 @@ int fffstri1(char *input, long ntodo, double scale, double zero,
             unsigned char nullval, char *nullarray, int *anynull,
             unsigned char *output, int *status);
  
+int fffi1s1(unsigned char *input, long ntodo, double scale, double zero,
+            int nullcheck, unsigned char tnull, signed char nullval, char
+             *nullarray, int *anynull, signed char *output, int *status);
+int fffi2s1(short *input, long ntodo, double scale, double zero,
+            int nullcheck, short tnull, signed char nullval, char *nullarray,
+            int *anynull, signed char *output, int *status);
+int fffi4s1(INT32BIT *input, long ntodo, double scale, double zero,
+            int nullcheck, INT32BIT tnull, signed char nullval, char *nullarray,
+            int *anynull, signed char *output, int *status);
+int fffi8s1(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, signed char nullval, char *nullarray,
+            int *anynull, signed char *output, int *status);
+int fffr4s1(float *input, long ntodo, double scale, double zero,
+            int nullcheck, signed char nullval, char *nullarray,
+            int *anynull, signed char *output, int *status);
+int fffr8s1(double *input, long ntodo, double scale, double zero,
+            int nullcheck, signed char nullval, char *nullarray,
+            int *anynull, signed char *output, int *status);
+int fffstrs1(char *input, long ntodo, double scale, double zero,
+            long twidth, double power, int nullcheck, char *snull,
+            signed char nullval, char *nullarray, int *anynull,
+            signed char *output, int *status);
+
 int fffi1u2(unsigned char *input, long ntodo, double scale, double zero,
             int nullcheck, unsigned char tnull, unsigned short nullval, 
             char *nullarray,
@@ -395,6 +497,9 @@ int fffi2u2(short *input, long ntodo, double scale, double zero,
 int fffi4u2(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, unsigned short nullval, char *nullarray,
             int *anynull, unsigned short *output, int *status);
+int fffi8u2(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, unsigned short nullval, char *nullarray,
+            int *anynull, unsigned short *output, int *status);
 int fffr4u2(float *input, long ntodo, double scale, double zero,
             int nullcheck, unsigned short nullval, char *nullarray,
             int *anynull, unsigned short *output, int *status);
@@ -415,6 +520,9 @@ int fffi2i2(short *input, long ntodo, double scale, double zero,
 int fffi4i2(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, short nullval, char *nullarray,
             int *anynull, short *output, int *status);
+int fffi8i2(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, short nullval, char *nullarray,
+            int *anynull, short *output, int *status);
 int fffr4i2(float *input, long ntodo, double scale, double zero,
             int nullcheck, short nullval, char *nullarray,
             int *anynull, short *output, int *status);
@@ -436,6 +544,9 @@ int fffi2u4(short *input, long ntodo, double scale, double zero,
 int fffi4u4(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, unsigned long nullval, char *nullarray,
             int *anynull, unsigned long *output, int *status);
+int fffi8u4(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, unsigned long nullval, char *nullarray,
+            int *anynull, unsigned long *output, int *status);
 int fffr4u4(float *input, long ntodo, double scale, double zero,
             int nullcheck, unsigned long nullval, char *nullarray,
             int *anynull, unsigned long *output, int *status);
@@ -456,6 +567,9 @@ int fffi2i4(short *input, long ntodo, double scale, double zero,
 int fffi4i4(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, long nullval, char *nullarray,
             int *anynull, long *output, int *status);
+int fffi8i4(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, long nullval, char *nullarray,
+            int *anynull, long *output, int *status);
 int fffr4i4(float *input, long ntodo, double scale, double zero,
             int nullcheck, long nullval, char *nullarray,
             int *anynull, long *output, int *status);
@@ -476,6 +590,9 @@ int fffi2int(short *input, long ntodo, double scale, double zero,
 int fffi4int(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, int nullval, char *nullarray,
             int *anynull, int *output, int *status);
+int fffi8int(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, int nullval, char *nullarray,
+            int *anynull, int *output, int *status);
 int fffr4int(float *input, long ntodo, double scale, double zero,
             int nullcheck, int nullval, char *nullarray,
             int *anynull, int *output, int *status);
@@ -496,6 +613,9 @@ int fffi2uint(short *input, long ntodo, double scale, double zero,
 int fffi4uint(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, unsigned int nullval, char *nullarray,
             int *anynull, unsigned int *output, int *status);
+int fffi8uint(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, unsigned int nullval, char *nullarray,
+            int *anynull, unsigned int *output, int *status);
 int fffr4uint(float *input, long ntodo, double scale, double zero,
             int nullcheck, unsigned int nullval, char *nullarray,
             int *anynull, unsigned int *output, int *status);
@@ -507,6 +627,29 @@ int fffstruint(char *input, long ntodo, double scale, double zero,
             unsigned int nullval, char *nullarray, int *anynull,
             unsigned int *output, int *status);
  
+int fffi1i8(unsigned char *input, long ntodo, double scale, double zero,
+            int nullcheck, unsigned char tnull, LONGLONG nullval, 
+            char *nullarray, int *anynull, LONGLONG *output, int *status);
+int fffi2i8(short *input, long ntodo, double scale, double zero,
+            int nullcheck, short tnull, LONGLONG nullval, char *nullarray,
+            int *anynull, LONGLONG *output, int *status);
+int fffi4i8(INT32BIT *input, long ntodo, double scale, double zero,
+            int nullcheck, INT32BIT tnull, LONGLONG nullval, char *nullarray,
+            int *anynull, LONGLONG *output, int *status);
+int fffi8i8(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, LONGLONG tnull, LONGLONG nullval, char *nullarray,
+            int *anynull, LONGLONG *output, int *status);
+int fffr4i8(float *input, long ntodo, double scale, double zero,
+            int nullcheck, LONGLONG nullval, char *nullarray,
+            int *anynull, LONGLONG *output, int *status);
+int fffr8i8(double *input, long ntodo, double scale, double zero,
+            int nullcheck, LONGLONG nullval, char *nullarray,
+            int *anynull, LONGLONG *output, int *status);
+int fffstri8(char *input, long ntodo, double scale, double zero,
+            long twidth, double power, int nullcheck, char *snull,
+            LONGLONG nullval, char *nullarray, int *anynull, LONGLONG *output,
+            int *status);
+
 int fffi1r4(unsigned char *input, long ntodo, double scale, double zero,
             int nullcheck, unsigned char tnull, float nullval, char *nullarray,
             int *anynull, float *output, int *status);
@@ -516,6 +659,9 @@ int fffi2r4(short *input, long ntodo, double scale, double zero,
 int fffi4r4(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, float nullval, char *nullarray,
             int *anynull, float *output, int *status);
+int fffi8r4(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, float nullval, char *nullarray,
+            int *anynull, float *output, int *status);
 int fffr4r4(float *input, long ntodo, double scale, double zero,
             int nullcheck, float nullval, char *nullarray,
             int *anynull, float *output, int *status);
@@ -536,6 +682,9 @@ int fffi2r8(short *input, long ntodo, double scale, double zero,
 int fffi4r8(INT32BIT *input, long ntodo, double scale, double zero,
             int nullcheck, INT32BIT tnull, double nullval, char *nullarray,
             int *anynull, double *output, int *status);
+int fffi8r8(LONGLONG *input, long ntodo, double scale, double zero,
+            int nullcheck, long tnull, double nullval, char *nullarray,
+            int *anynull, double *output, int *status);
 int fffr4r8(float *input, long ntodo, double scale, double zero,
             int nullcheck, double nullval, char *nullarray,
             int *anynull, double *output, int *status);
@@ -549,6 +698,8 @@ int fffstrr8(char *input, long ntodo, double scale, double zero,
  
 int ffi1fi1(unsigned char *array, long ntodo, double scale, double zero,
             unsigned char *buffer, int *status);
+int ffs1fi1(signed char *array, long ntodo, double scale, double zero,
+            unsigned char *buffer, int *status);
 int ffu2fi1(unsigned short *array, long ntodo, double scale, double zero,
             unsigned char *buffer, int *status);
 int ffi2fi1(short *array, long ntodo, double scale, double zero,
@@ -557,6 +708,8 @@ int ffu4fi1(unsigned long *array, long ntodo, double scale, double zero,
             unsigned char *buffer, int *status);
 int ffi4fi1(long *array, long ntodo, double scale, double zero,
             unsigned char *buffer, int *status);
+int ffi8fi1(LONGLONG *array, long ntodo, double scale, double zero,
+            unsigned char *buffer, int *status);
 int ffuintfi1(unsigned int *array, long ntodo, double scale, double zero,
             unsigned char *buffer, int *status);
 int ffintfi1(int *array, long ntodo, double scale, double zero,
@@ -568,6 +721,8 @@ int ffr8fi1(double *array, long ntodo, double scale, double zero,
  
 int ffi1fi2(unsigned char *array, long ntodo, double scale, double zero,
             short *buffer, int *status);
+int ffs1fi2(signed char *array, long ntodo, double scale, double zero,
+            short *buffer, int *status);
 int ffu2fi2(unsigned short *array, long ntodo, double scale, double zero,
             short *buffer, int *status);
 int ffi2fi2(short *array, long ntodo, double scale, double zero,
@@ -576,6 +731,8 @@ int ffu4fi2(unsigned long *array, long ntodo, double scale, double zero,
             short *buffer, int *status);
 int ffi4fi2(long *array, long ntodo, double scale, double zero,
             short *buffer, int *status);
+int ffi8fi2(LONGLONG *array, long ntodo, double scale, double zero,
+            short *buffer, int *status);
 int ffuintfi2(unsigned int *array, long ntodo, double scale, double zero,
             short *buffer, int *status);
 int ffintfi2(int *array, long ntodo, double scale, double zero,
@@ -587,6 +744,8 @@ int ffr8fi2(double *array, long ntodo, double scale, double zero,
  
 int ffi1fi4(unsigned char *array, long ntodo, double scale, double zero,
             INT32BIT *buffer, int *status);
+int ffs1fi4(signed char *array, long ntodo, double scale, double zero,
+            INT32BIT *buffer, int *status);
 int ffu2fi4(unsigned short *array, long ntodo, double scale, double zero,
             INT32BIT *buffer, int *status);
 int ffi2fi4(short *array, long ntodo, double scale, double zero,
@@ -595,6 +754,8 @@ int ffu4fi4(unsigned long *array, long ntodo, double scale, double zero,
             INT32BIT *buffer, int *status);
 int ffi4fi4(long *array, long ntodo, double scale, double zero,
             INT32BIT *buffer, int *status);
+int ffi8fi4(LONGLONG *array, long ntodo, double scale, double zero,
+            INT32BIT *buffer, int *status);
 int ffuintfi4(unsigned int *array, long ntodo, double scale, double zero,
             INT32BIT *buffer, int *status);
 int ffintfi4(int *array, long ntodo, double scale, double zero,
@@ -603,9 +764,34 @@ int ffr4fi4(float *array, long ntodo, double scale, double zero,
             INT32BIT *buffer, int *status);
 int ffr8fi4(double *array, long ntodo, double scale, double zero,
             INT32BIT *buffer, int *status);
- 
+
+int fflongfi8(long *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffi8fi8(LONGLONG *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffi2fi8(short *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffi1fi8(unsigned char *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffs1fi8(signed char *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffr4fi8(float *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffr8fi8(double *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffintfi8(int *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffu2fi8(unsigned short *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffu4fi8(unsigned long *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+int ffuintfi8(unsigned int *array, long ntodo, double scale, double zero,
+            LONGLONG *buffer, int *status);
+
 int ffi1fr4(unsigned char *array, long ntodo, double scale, double zero,
             float *buffer, int *status);
+int ffs1fr4(signed char *array, long ntodo, double scale, double zero,
+            float *buffer, int *status);
 int ffu2fr4(unsigned short *array, long ntodo, double scale, double zero,
             float *buffer, int *status);
 int ffi2fr4(short *array, long ntodo, double scale, double zero,
@@ -614,6 +800,8 @@ int ffu4fr4(unsigned long *array, long ntodo, double scale, double zero,
             float *buffer, int *status);
 int ffi4fr4(long *array, long ntodo, double scale, double zero,
             float *buffer, int *status);
+int ffi8fr4(LONGLONG *array, long ntodo, double scale, double zero,
+            float *buffer, int *status);
 int ffuintfr4(unsigned int *array, long ntodo, double scale, double zero,
             float *buffer, int *status);
 int ffintfr4(int *array, long ntodo, double scale, double zero,
@@ -625,6 +813,8 @@ int ffr8fr4(double *array, long ntodo, double scale, double zero,
  
 int ffi1fr8(unsigned char *array, long ntodo, double scale, double zero,
             double *buffer, int *status);
+int ffs1fr8(signed char *array, long ntodo, double scale, double zero,
+            double *buffer, int *status);
 int ffu2fr8(unsigned short *array, long ntodo, double scale, double zero,
             double *buffer, int *status);
 int ffi2fr8(short *array, long ntodo, double scale, double zero,
@@ -633,6 +823,8 @@ int ffu4fr8(unsigned long *array, long ntodo, double scale, double zero,
             double *buffer, int *status);
 int ffi4fr8(long *array, long ntodo, double scale, double zero,
             double *buffer, int *status);
+int ffi8fr8(LONGLONG *array, long ntodo, double scale, double zero,
+            double *buffer, int *status);
 int ffuintfr8(unsigned int *array, long ntodo, double scale, double zero,
             double *buffer, int *status);
 int ffintfr8(int *array, long ntodo, double scale, double zero,
@@ -644,6 +836,8 @@ int ffr8fr8(double *array, long ntodo, double scale, double zero,
 
 int ffi1fstr(unsigned char *input, long ntodo, double scale, double zero,
             char *cform, long twidth, char *output, int *status);
+int ffs1fstr(signed char *input, long ntodo, double scale, double zero,
+            char *cform, long twidth, char *output, int *status);
 int ffu2fstr(unsigned short *input, long ntodo, double scale, double zero,
             char *cform, long twidth, char *output, int *status);
 int ffi2fstr(short *input, long ntodo, double scale, double zero,
@@ -652,6 +846,8 @@ int ffu4fstr(unsigned long *input, long ntodo, double scale, double zero,
             char *cform, long twidth, char *output, int *status);
 int ffi4fstr(long *input, long ntodo, double scale, double zero,
             char *cform, long twidth, char *output, int *status);
+int ffi8fstr(LONGLONG *input, long ntodo, double scale, double zero,
+            char *cform, long twidth, char *output, int *status);
 int ffintfstr(int *input, long ntodo, double scale, double zero,
             char *cform, long twidth, char *output, int *status);
 int ffuintfstr(unsigned int *input, long ntodo, double scale, double zero,
@@ -687,6 +883,19 @@ int  ffffrw_work( long totalrows, long offset, long firstrow,
 
 
 /*  image compression routines */
+int fits_write_compressed_img(fitsfile *fptr, 
+            int  datatype, long  *fpixel, long *lpixel,   
+            int nullcheck, void *array,  void *nulval,
+            int  *status);
+int fits_write_compressed_pixels(fitsfile *fptr, 
+            int  datatype, OFF_T  fpixel, long npixels,   
+            int nullcheck,  void *array, void *nulval,
+            int  *status);
+int fits_write_compressed_img_plane(fitsfile *fptr, int  datatype, 
+      int  bytesperpixel,  long   nplane, long *firstcoord, long *lastcoord, 
+      long *naxes,  int  nullcheck, 
+      void *array,  void *nullval, long *nread, int  *status);
+
 int imcomp_init_table(fitsfile *outfptr, int compress_type,
         int bitpix, int naxis,long *naxes,long *tilesize, 
         int rice_blocksize,int rice_nbits,int *status);
@@ -699,19 +908,42 @@ int imcomp_compress_tile (fitsfile *outfptr, long row,
     int datatype,  void *tiledata, long tilelen, int *status);
 
 /*  image decompression routines */
+
+int fits_read_compressed_img(fitsfile *fptr, 
+            int  datatype, long  *fpixel,long  *lpixel,long *inc,   
+            int nullcheck, void *nulval,  void *array, char *nullarray,
+            int  *anynul, int  *status);
+int fits_read_compressed_pixels(fitsfile *fptr, 
+            int  datatype, OFF_T  fpixel, long npixels,   
+            int nullcheck, void *nulval,  void *array, char *nullarray,
+            int  *anynul, int  *status);
 int fits_read_compressed_img_plane(fitsfile *fptr, int  datatype, 
       int  bytesperpixel,  long   nplane, long *firstcoord, long *lastcoord, 
       long *inc,  long *naxes,  int  nullcheck,  void *nullval, 
       void *array, char *nullarray, int  *anynul, long *nread, int  *status);
+
 int imcomp_get_compressed_image_par(fitsfile *infptr, int *status);
 int imcomp_decompress_tile (fitsfile *infptr,
           int nrow, int tilesize, int datatype, int nullcheck,
           void *nulval, void *buffer, char *bnullarray, int *anynul,
           int *status);
-int imcomp_copy_overlap (char *tile, int datatype, int ndim,
+int imcomp_copy_overlap (char *tile, int pixlen, int ndim,
          long *tfpixel, long *tlpixel, char *bnullarray, char *image,
-         long *fpixel, long *lpixel, int nullcheck, char *nullarray,
+         long *fpixel, long *lpixel, long *inc, int nullcheck, char *nullarray,
          int *status);
+int imcomp_merge_overlap (char *tile, int pixlen, int ndim,
+         long *tfpixel, long *tlpixel, char *bnullarray, char *image,
+         long *fpixel, long *lpixel, int nullcheck, int *status);
+
+int fits_quantize_float (float fdata[], int nx, float in_null_value,
+           int noise_bits, int idata[], double *bscale, double *bzero,
+           int *iminval, int *imaxval);
+int fits_quantize_double (double fdata[], int nx, double in_null_value,
+           int noise_bits, int idata[], double *bscale, double *bzero,
+           int *iminval, int *imaxval);
+int fits_rcomp(int a[], int nx, unsigned char *c, int clen,int nblock);
+int fits_rdecomp (unsigned char *c, int clen, unsigned int array[], int nx,
+             int nblock);
 
 int pl_p2li (int *pxsrc, int xs, short *lldst, int npix);
 int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix);
@@ -769,6 +1001,7 @@ int mem_getoptions(int *options);
 int mem_getversion(int *version);
 int mem_shutdown(void);
 int mem_create(char *filename, int *handle);
+int mem_create_comp(char *filename, int *handle);
 int mem_openmem(void **buffptr, size_t *buffsize, size_t deltasize,
                 void *(*memrealloc)(void *p, size_t newsize), int *handle);
 int mem_createmem(size_t memsize, int *handle);
@@ -777,12 +1010,15 @@ int stdin_open(char *filename, int rwmode, int *handle);
 int stdin2mem(int hd);
 int stdin2file(int hd);
 int stdout_close(int handle);
+int mem_compress_openrw(char *filename, int rwmode, int *hdl);
 int mem_compress_open(char *filename, int rwmode, int *hdl);
 int mem_iraf_open(char *filename, int rwmode, int *hdl);
+int mem_rawfile_open(char *filename, int rwmode, int *hdl);
 int mem_size(int handle, OFF_T *filesize);
 int mem_truncate(int handle, OFF_T filesize);
 int mem_close_free(int handle);
 int mem_close_keep(int handle);
+int mem_close_comp(int handle);
 int mem_seek(int handle, OFF_T offset);
 int mem_read(int hdl, void *buffer, long nbytes);
 int mem_write(int hdl, void *buffer, long nbytes);
@@ -850,6 +1086,13 @@ int compress2mem_from_mem(
              size_t *filesize,  
              int *status);
 
+int compress2file_from_mem(                                                
+             char *inmemptr,     
+             size_t inmemsize, 
+             FILE *outdiskfile, 
+             size_t *filesize,   /* O - size of file, in bytes              */
+             int *status);
+
 /* ==================== SHARED MEMORY DRIVER SECTION ======================= */
 
 #ifdef HAVE_SHMEM_SERVICES
@@ -861,7 +1104,7 @@ int compress2mem_from_mem(
 #endif
 
 
-#if defined(vms) || defined(__vms) || defined(WIN32) || defined(__WIN32__) || defined(macintosh)
+#if defined(vms) || defined(__vms) || defined(WIN32) || defined(__WIN32__) || (defined(macintosh) && !defined(TARGET_API_MAC_CARBON))
 
 /* ================================================================== */
 /* A hack for nonunix machines, which lack strcasecmp and strncasecmp */
diff --git a/fitsiohtml.tar.gz b/fitsiohtml.tar.gz
deleted file mode 100644
index d451150632d147180a8268a95a8d4c520f57f886..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 112610
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
b=D%6{pRND-y889k|LoG64H_5@a54Y@XW)lE

diff --git a/getcol.c b/getcol.c
index 2d123f5..31506d9 100644
--- a/getcol.c
+++ b/getcol.c
@@ -6,6 +6,7 @@
 /*  Astrophysic Science Archive Research Center (HEASARC) at the NASA      */
 /*  Goddard Space Flight Center.                                           */
 
+#include <stdlib.h>
 #include "fitsio2.h"
 /*--------------------------------------------------------------------------*/
 int ffgpxv( fitsfile *fptr,   /* I - FITS file pointer                       */
@@ -28,7 +29,6 @@ int ffgpxv( fitsfile *fptr,   /* I - FITS file pointer                       */
 {
     int naxis, ii;
     long naxes[9];
-    char cdummy;
     OFF_T dimsize = 1, firstelem;
 
     if (*status > 0 || nelem == 0)   /* inherit input status value if > 0 */
@@ -57,83 +57,103 @@ int ffgpxv( fitsfile *fptr,   /* I - FITS file pointer                       */
     if (datatype == TBYTE)
     {
       if (nulval == 0)
-        ffgclb(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (unsigned char *) array, &cdummy, anynul, status);
+        ffgpvb(fptr, 1, firstelem, nelem, 0,
+               (unsigned char *) array, anynul, status);
       else
-        ffgclb(fptr, 2, 1, firstelem, nelem, 1, 1, *(unsigned char *) nulval,
-               (unsigned char *) array, &cdummy, anynul, status);
+        ffgpvb(fptr, 1, firstelem, nelem, *(unsigned char *) nulval,
+               (unsigned char *) array, anynul, status);
+    }
+    else if (datatype == TSBYTE)
+    {
+      if (nulval == 0)
+        ffgpvsb(fptr, 1, firstelem, nelem, 0,
+               (signed char *) array, anynul, status);
+      else
+        ffgpvsb(fptr, 1, firstelem, nelem, *(signed char *) nulval,
+               (signed char *) array, anynul, status);
     }
     else if (datatype == TUSHORT)
     {
       if (nulval == 0)
-        ffgclui(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (unsigned short *) array, &cdummy, anynul, status);
+        ffgpvui(fptr, 1, firstelem, nelem, 0,
+               (unsigned short *) array, anynul, status);
       else
-        ffgclui(fptr, 2, 1, firstelem, nelem, 1, 1, *(unsigned short *) nulval,
-               (unsigned short *) array, &cdummy, anynul, status);
+        ffgpvui(fptr, 1, firstelem, nelem, *(unsigned short *) nulval,
+               (unsigned short *) array, anynul, status);
     }
     else if (datatype == TSHORT)
     {
       if (nulval == 0)
-        ffgcli(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (short *) array, &cdummy, anynul, status);
+        ffgpvi(fptr, 1, firstelem, nelem, 0,
+               (short *) array, anynul, status);
       else
-        ffgcli(fptr, 2, 1, firstelem, nelem, 1, 1, *(short *) nulval,
-               (short *) array, &cdummy, anynul, status);
+        ffgpvi(fptr, 1, firstelem, nelem, *(short *) nulval,
+               (short *) array, anynul, status);
     }
     else if (datatype == TUINT)
     {
       if (nulval == 0)
-        ffgcluk(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (unsigned int *) array, &cdummy, anynul, status);
+        ffgpvuk(fptr, 1, firstelem, nelem, 0,
+               (unsigned int *) array, anynul, status);
       else
-        ffgcluk(fptr, 2, 1, firstelem, nelem, 1, 1, *(unsigned int *) nulval,
-               (unsigned int *) array, &cdummy, anynul, status);
+        ffgpvuk(fptr, 1, firstelem, nelem, *(unsigned int *) nulval,
+               (unsigned int *) array, anynul, status);
     }
     else if (datatype == TINT)
     {
       if (nulval == 0)
-        ffgclk(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (int *) array, &cdummy, anynul, status);
+        ffgpvk(fptr, 1, firstelem, nelem, 0,
+               (int *) array, anynul, status);
       else
-        ffgclk(fptr, 2, 1, firstelem, nelem, 1, 1, *(int *) nulval,
-               (int *) array, &cdummy, anynul, status);
+        ffgpvk(fptr, 1, firstelem, nelem, *(int *) nulval,
+               (int *) array, anynul, status);
     }
     else if (datatype == TULONG)
     {
       if (nulval == 0)
-        ffgcluj(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (unsigned long *) array, &cdummy, anynul, status);
+        ffgpvuj(fptr, 1, firstelem, nelem, 0,
+               (unsigned long *) array, anynul, status);
       else
-        ffgcluj(fptr, 2, 1, firstelem, nelem, 1, 1, *(short *) nulval,
-               (unsigned long *) array, &cdummy, anynul, status);
+        ffgpvuj(fptr, 1, firstelem, nelem, *(unsigned long *) nulval,
+               (unsigned long *) array, anynul, status);
     }
     else if (datatype == TLONG)
     {
       if (nulval == 0)
-        ffgclj(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (long *) array, &cdummy, anynul, status);
+        ffgpvj(fptr, 1, firstelem, nelem, 0,
+               (long *) array, anynul, status);
       else
-        ffgclj(fptr, 2, 1, firstelem, nelem, 1, 1, *(long *) nulval,
-               (long *) array, &cdummy, anynul, status);
+        ffgpvj(fptr, 1, firstelem, nelem, *(long *) nulval,
+               (long *) array, anynul, status);
+    }
+    else if (datatype == TLONGLONG)
+    {
+      if (nulval == 0)
+        ffgpvjj(fptr, 1, firstelem, nelem, 0,
+               (LONGLONG *) array, anynul, status);
+      else
+        ffgpvjj(fptr, 1, firstelem, nelem, *(LONGLONG *) nulval,
+               (LONGLONG *) array, anynul, status);
     }
     else if (datatype == TFLOAT)
     {
       if (nulval == 0)
-        ffgcle(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (float *) array, &cdummy, anynul, status);
+        ffgpve(fptr, 1, firstelem, nelem, 0,
+               (float *) array, anynul, status);
       else
-        ffgcle(fptr, 2, 1, firstelem, nelem, 1, 1, *(float *) nulval,
-               (float *) array, &cdummy, anynul, status);
+        ffgpve(fptr, 1, firstelem, nelem, *(float *) nulval,
+               (float *) array, anynul, status);
     }
     else if (datatype == TDOUBLE)
     {
       if (nulval == 0)
-        ffgcld(fptr, 2, 1, firstelem, nelem, 1, 1, 0,
-               (double *) array, &cdummy, anynul, status);
+        ffgpvd(fptr, 1, firstelem, nelem, 0,
+               (double *) array, anynul, status);
       else
-        ffgcld(fptr, 2, 1, firstelem, nelem, 1, 1, *(double *) nulval,
-               (double *) array, &cdummy, anynul, status);
+      {
+        ffgpvd(fptr, 1, firstelem, nelem, *(double *) nulval,
+               (double *) array, anynul, status);
+      }
     }
     else
       *status = BAD_DATATYPE;
@@ -187,47 +207,57 @@ int ffgpxf( fitsfile *fptr,   /* I - FITS file pointer                       */
 
     if (datatype == TBYTE)
     {
-        ffgclb(fptr, 2, 1, firstelem, nelem, 1, 2, 0,
+        ffgpfb(fptr, 1, firstelem, nelem, 
                (unsigned char *) array, nullarray, anynul, status);
     }
+    else if (datatype == TSBYTE)
+    {
+        ffgpfsb(fptr, 1, firstelem, nelem, 
+               (signed char *) array, nullarray, anynul, status);
+    }
     else if (datatype == TUSHORT)
     {
-        ffgclui(fptr, 2, 1, firstelem, nelem, 1, 2, 0,
+        ffgpfui(fptr, 1, firstelem, nelem, 
                (unsigned short *) array, nullarray, anynul, status);
     }
     else if (datatype == TSHORT)
     {
-        ffgcli(fptr, 2, 1, firstelem, nelem, 1, 2, 0,
+        ffgpfi(fptr, 1, firstelem, nelem, 
                (short *) array, nullarray, anynul, status);
     }
     else if (datatype == TUINT)
     {
-        ffgcluk(fptr, 2, 1, firstelem, nelem, 1, 2, 0,
+        ffgpfuk(fptr, 1, firstelem, nelem, 
                (unsigned int *) array, nullarray, anynul, status);
     }
     else if (datatype == TINT)
     {
-        ffgclk(fptr, 2, 1, firstelem, nelem, 1, 2, 0,
+        ffgpfk(fptr, 1, firstelem, nelem, 
                (int *) array, nullarray, anynul, status);
     }
     else if (datatype == TULONG)
     {
-        ffgcluj(fptr, 2, 1, firstelem, nelem, 1, 2, 0,
+        ffgpfuj(fptr, 1, firstelem, nelem, 
                (unsigned long *) array, nullarray, anynul, status);
     }
     else if (datatype == TLONG)
     {
-        ffgclj(fptr, 2, 1, firstelem, nelem, 1, 2, 0,
+        ffgpfj(fptr, 1, firstelem, nelem,
                (long *) array, nullarray, anynul, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+        ffgpfjj(fptr, 1, firstelem, nelem,
+               (LONGLONG *) array, nullarray, anynul, status);
+    }
     else if (datatype == TFLOAT)
     {
-        ffgcle(fptr, 2, 1, firstelem, nelem, 1, 2, 0.,
+        ffgpfe(fptr, 1, firstelem, nelem, 
                (float *) array, nullarray, anynul, status);
     }
     else if (datatype == TDOUBLE)
     {
-        ffgcld(fptr, 2, 1, firstelem, nelem, 1, 2, 0.,
+        ffgpfd(fptr, 1, firstelem, nelem,
                (double *) array, nullarray, anynul, status);
     }
     else
@@ -265,13 +295,6 @@ int ffgsv(  fitsfile *fptr,   /* I - FITS file pointer                       */
     ffgidm(fptr, &naxis, status);
     ffgisz(fptr, 9, naxes, status);
 
-    /*
-      the primary array is represented as a binary table:
-      each group of the primary array is a row in the table,
-      where the first column contains the group parameters
-      and the second column contains the image itself.
-    */
-
     if (datatype == TBYTE)
     {
       if (nulval == 0)
@@ -281,13 +304,22 @@ int ffgsv(  fitsfile *fptr,   /* I - FITS file pointer                       */
         ffgsvb(fptr, 1, naxis, naxes, blc, trc, inc, *(unsigned char *) nulval,
                (unsigned char *) array, anynul, status);
     }
+    else if (datatype == TSBYTE)
+    {
+      if (nulval == 0)
+        ffgsvsb(fptr, 1, naxis, naxes, blc, trc, inc, 0,
+               (signed char *) array, anynul, status);
+      else
+        ffgsvsb(fptr, 1, naxis, naxes, blc, trc, inc, *(signed char *) nulval,
+               (signed char *) array, anynul, status);
+    }
     else if (datatype == TUSHORT)
     {
       if (nulval == 0)
         ffgsvui(fptr, 1, naxis, naxes, blc, trc, inc, 0,
                (unsigned short *) array, anynul, status);
       else
-        ffgsvui(fptr, 1, naxis, naxes, blc, trc, inc, *(unsigned short *) nulval,
+        ffgsvui(fptr, 1, naxis, naxes,blc, trc, inc, *(unsigned short *) nulval,
                (unsigned short *) array, anynul, status);
     }
     else if (datatype == TSHORT)
@@ -335,6 +367,15 @@ int ffgsv(  fitsfile *fptr,   /* I - FITS file pointer                       */
         ffgsvj(fptr, 1, naxis, naxes, blc, trc, inc, *(long *) nulval,
                (long *) array, anynul, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+      if (nulval == 0)
+        ffgsvjj(fptr, 1, naxis, naxes, blc, trc, inc, 0,
+               (LONGLONG *) array, anynul, status);
+      else
+        ffgsvjj(fptr, 1, naxis, naxes, blc, trc, inc, *(LONGLONG *) nulval,
+               (LONGLONG *) array, anynul, status);
+    }
     else if (datatype == TFLOAT)
     {
       if (nulval == 0)
@@ -397,6 +438,15 @@ int ffgpv(  fitsfile *fptr,   /* I - FITS file pointer                       */
         ffgpvb(fptr, 1, firstelem, nelem, *(unsigned char *) nulval,
                (unsigned char *) array, anynul, status);
     }
+    else if (datatype == TSBYTE)
+    {
+      if (nulval == 0)
+        ffgpvsb(fptr, 1, firstelem, nelem, 0,
+               (signed char *) array, anynul, status);
+      else
+        ffgpvsb(fptr, 1, firstelem, nelem, *(signed char *) nulval,
+               (signed char *) array, anynul, status);
+    }
     else if (datatype == TUSHORT)
     {
       if (nulval == 0)
@@ -451,6 +501,15 @@ int ffgpv(  fitsfile *fptr,   /* I - FITS file pointer                       */
         ffgpvj(fptr, 1, firstelem, nelem, *(long *) nulval,
                (long *) array, anynul, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+      if (nulval == 0)
+        ffgpvjj(fptr, 1, firstelem, nelem, 0,
+               (LONGLONG *) array, anynul, status);
+      else
+        ffgpvjj(fptr, 1, firstelem, nelem, *(LONGLONG *) nulval,
+               (LONGLONG *) array, anynul, status);
+    }
     else if (datatype == TFLOAT)
     {
       if (nulval == 0)
@@ -510,6 +569,11 @@ int ffgpf(  fitsfile *fptr,   /* I - FITS file pointer                       */
         ffgpfb(fptr, 1, firstelem, nelem, 
                (unsigned char *) array, nullarray, anynul, status);
     }
+    else if (datatype == TSBYTE)
+    {
+        ffgpfsb(fptr, 1, firstelem, nelem, 
+               (signed char *) array, nullarray, anynul, status);
+    }
     else if (datatype == TUSHORT)
     {
         ffgpfui(fptr, 1, firstelem, nelem, 
@@ -540,6 +604,11 @@ int ffgpf(  fitsfile *fptr,   /* I - FITS file pointer                       */
         ffgpfj(fptr, 1, firstelem, nelem,
                (long *) array, nullarray, anynul, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+        ffgpfjj(fptr, 1, firstelem, nelem,
+               (LONGLONG *) array, nullarray, anynul, status);
+    }
     else if (datatype == TFLOAT)
     {
         ffgpfe(fptr, 1, firstelem, nelem, 
@@ -594,6 +663,15 @@ int ffgcv(  fitsfile *fptr,   /* I - FITS file pointer                       */
        ffgclb(fptr, colnum, firstrow, firstelem, nelem, 1, 1, *(unsigned char *)
               nulval, (unsigned char *) array, cdummy, anynul, status);
     }
+    else if (datatype == TSBYTE)
+    {
+      if (nulval == 0)
+        ffgclsb(fptr, colnum, firstrow, firstelem, nelem, 1, 1, 0,
+              (signed char *) array, cdummy, anynul, status);
+      else
+       ffgclsb(fptr, colnum, firstrow, firstelem, nelem, 1, 1, *(signed char *)
+              nulval, (signed char *) array, cdummy, anynul, status);
+    }
     else if (datatype == TUSHORT)
     {
       if (nulval == 0)
@@ -651,6 +729,15 @@ int ffgcv(  fitsfile *fptr,   /* I - FITS file pointer                       */
         ffgclj(fptr, colnum, firstrow, firstelem, nelem, 1, 1, *(long *)
               nulval, (long *) array, cdummy, anynul, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+      if (nulval == 0)
+        ffgcljj(fptr, colnum, firstrow, firstelem, nelem, 1, 1, 0,
+              (LONGLONG *) array, cdummy, anynul, status);
+      else
+        ffgcljj(fptr, colnum, firstrow, firstelem, nelem, 1, 1, *(LONGLONG *)
+              nulval, (LONGLONG *) array, cdummy, anynul, status);
+    }
     else if (datatype == TFLOAT)
     {
       if (nulval == 0)
@@ -750,6 +837,11 @@ int ffgcf(  fitsfile *fptr,   /* I - FITS file pointer                       */
        ffgclb(fptr, colnum, firstrow, firstelem, nelem, 1, 2, *(unsigned char *)
               nulval, (unsigned char *) array, nullarray, anynul, status);
     }
+    else if (datatype == TSBYTE)
+    {
+       ffgclsb(fptr, colnum, firstrow, firstelem, nelem, 1, 2, *(signed char *)
+              nulval, (signed char *) array, nullarray, anynul, status);
+    }
     else if (datatype == TUSHORT)
     {
         ffgclui(fptr, colnum, firstrow, firstelem, nelem, 1, 2,
@@ -783,6 +875,11 @@ int ffgcf(  fitsfile *fptr,   /* I - FITS file pointer                       */
         ffgclj(fptr, colnum, firstrow, firstelem, nelem, 1, 2, *(long *)
               nulval, (long *) array, nullarray, anynul, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+        ffgcljj(fptr, colnum, firstrow, firstelem, nelem, 1, 2, *(LONGLONG *)
+              nulval, (LONGLONG *) array, nullarray, anynul, status);
+    }
     else if (datatype == TFLOAT)
     {
       ffgcle(fptr, colnum, firstrow, firstelem, nelem, 1, 2, *(float *)
@@ -795,13 +892,13 @@ int ffgcf(  fitsfile *fptr,   /* I - FITS file pointer                       */
     }
     else if (datatype == TCOMPLEX)
     {
-        ffgcle(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2,
-           1, 2, *(float *) nulval, (float *) array, nullarray, anynul, status);
+        ffgcfc(fptr, colnum, firstrow, firstelem, nelem,
+           (float *) array, nullarray, anynul, status);
     }
     else if (datatype == TDBLCOMPLEX)
     {
-        ffgcld(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2, 
-         1, 2, *(double *) nulval, (double *) array, nullarray, anynul, status);
+        ffgcfm(fptr, colnum, firstrow, firstelem, nelem, 
+           (double *) array, nullarray, anynul, status);
     }
 
     else if (datatype == TLOGICAL)
diff --git a/getcolb.c b/getcolb.c
index ddbae23..9390064 100644
--- a/getcolb.c
+++ b/getcolb.c
@@ -1,5 +1,5 @@
 /*  This file, getcolb.c, contains routines that read data elements from   */
-/*  a FITS image or table, with char (byte) data type.                     */
+/*  a FITS image or table, with unsigned char (unsigned byte) data type.   */
 
 /*  The FITSIO software was written by William Pence at the High Energy    */
 /*  Astrophysic Science Archive Research Center (HEASARC) at the NASA      */
@@ -659,6 +659,11 @@ int ffgclb( fitsfile *fptr,   /* I - FITS file pointer                       */
     double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */
     void *buffer;
 
+    union u_tag {
+       char charval;
+       unsigned char ucharval;
+    } u;
+
     if (*status > 0 || nelem == 0)  /* inherit input status value if > 0 */
         return(*status);
 
@@ -680,6 +685,16 @@ int ffgclb( fitsfile *fptr,   /* I - FITS file pointer                       */
          tform, &twidth, &tcode, &maxelem, &startpos, &elemnum, &incre,
          &repeat, &rowlen, &hdutype, &tnull, snull, status);
 
+    /* special case */
+    if (tcode == TLOGICAL && elemincre == 1)
+    {
+        u.ucharval = nulval;
+        ffgcll(fptr, colnum, firstrow, firstelem, nelem, nultyp,
+               u.charval, (char *) array, nularray, anynul, status);
+
+        return(*status);
+    }
+
     if (strchr(tform,'A') != NULL) 
     {
         if (*status == BAD_ELEM_NUM)
@@ -805,6 +820,12 @@ int ffgclb( fitsfile *fptr,   /* I - FITS file pointer                       */
                        (INT32BIT) tnull, nulval, &nularray[next], anynul, 
                        &array[next], status);
                 break;
+            case (TLONGLONG):
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8i1( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TFLOAT):
                 ffgr4b(fptr, readptr, ntodo, incre, (float  *) buffer, status);
                 fffr4i1((float  *) buffer, ntodo, scale, zero, nulcheck, 
@@ -1285,6 +1306,299 @@ int fffi4i1(INT32BIT *input,          /* I - array of values to be converted
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8i1(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+            unsigned char nullval,/* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            unsigned char *output,/* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    long ii,jj, kk;
+    double dvalue;
+    unsigned long *uinput;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue < DUCHAR_MIN )
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UCHAR_MAX;
+                }
+                else
+                    output[ii] = (unsigned char) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                if (dvalue < DUCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UCHAR_MAX;
+                }
+                else
+                    output[ii] = (unsigned char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  if (dvalue < DUCHAR_MIN)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                  }
+                  else if (dvalue > DUCHAR_MAX)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UCHAR_MAX;
+                  }
+                  else
+                    output[ii] = (unsigned char) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = dvalue * scale + zero;
+
+                    if (dvalue < DUCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (dvalue > DUCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = UCHAR_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned char) dvalue;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < 0)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (input[ii] > UCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UCHAR_MAX;
+                }
+                else
+                    output[ii] = (unsigned char) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DUCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UCHAR_MAX;
+                }
+                else
+                    output[ii] = (unsigned char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < 0)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (input[ii] > UCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = UCHAR_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned char) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DUCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (dvalue > DUCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = UCHAR_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned char) dvalue;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4i1(float *input,         /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
diff --git a/getcold.c b/getcold.c
index 7363d24..dfe77f8 100644
--- a/getcold.c
+++ b/getcold.c
@@ -668,13 +668,28 @@ int ffgcfm(fitsfile *fptr,   /* I - FITS file pointer                       */
   TSCAL and ZERO should not be used with complex values. 
 */
 {
-    double dummy = 0;
+    long ii, jj;
+    float dummy = 0;
+    char *carray;
 
     /* a complex double value is interpreted as a pair of double values,   */
     /* thus need to multiply the first element and number of elements by 2 */
 
+    /* allocate temporary array */
+    carray = (char *) calloc(nelem * 2, 1); 
+
     ffgcld(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2,
-     1, 2, dummy, array, nularray, anynul, status);
+     1, 2, dummy, array, carray, anynul, status);
+
+    for (ii = 0, jj = 0; jj < nelem; ii += 2, jj++)
+    {
+       if (carray[ii] || carray[ii + 1])
+          nularray[jj] = 1;
+       else
+          nularray[jj] = 0;
+    }
+
+    free(carray);    
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -847,6 +862,12 @@ int ffgcld( fitsfile *fptr,   /* I - FITS file pointer                       */
                        (INT32BIT) tnull, nulval, &nularray[next], anynul, 
                        &array[next], status);
                 break;
+            case (TLONGLONG):
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8r8( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TFLOAT):
                 ffgr4b(fptr, readptr, ntodo, incre, (float  *) buffer, status);
                 fffr4r8((float  *) buffer, ntodo, scale, zero, nulcheck, 
@@ -1188,6 +1209,196 @@ int fffi4r8(INT32BIT *input,      /* I - array of values to be converted     */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8r8(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+            double nullval,       /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            double *output,       /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    unsigned long *uinput;
+    long ii,jj, kk;
+    double dvalue;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  output[ii] = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  output[ii] = (double) uinput[jj] * 4294967296. + uinput[kk];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  output[ii] = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  output[ii] = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  output[ii] = dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    output[ii] = dvalue * scale + zero;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (double) input[ii]; /* copy input to output */
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                output[ii] = input[ii] * scale + zero;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                    output[ii] = (double) input[ii];
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    output[ii] = input[ii] * scale + zero;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4r8(float *input,         /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
diff --git a/getcole.c b/getcole.c
index a9306aa..1e6d40d 100644
--- a/getcole.c
+++ b/getcole.c
@@ -669,13 +669,28 @@ int ffgcfc(fitsfile *fptr,   /* I - FITS file pointer                       */
   TSCAL and ZERO should not be used with complex values. 
 */
 {
+    long ii, jj;
     float dummy = 0;
+    char *carray;
 
     /* a complex value is interpreted as a pair of float values, thus */
     /* need to multiply the first element and number of elements by 2 */
+    
+    /* allocate temporary array */
+    carray = (char *) calloc(nelem * 2, 1); 
 
     ffgcle(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2,
-           1, 2, dummy, array, nularray, anynul, status);
+           1, 2, dummy, array, carray, anynul, status);
+
+    for (ii = 0, jj = 0; jj < nelem; ii += 2, jj++)
+    {
+       if (carray[ii] || carray[ii + 1])
+          nularray[jj] = 1;
+       else
+          nularray[jj] = 0;
+    }
+
+    free(carray);    
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -848,6 +863,13 @@ int ffgcle( fitsfile *fptr,   /* I - FITS file pointer                       */
                        (INT32BIT) tnull, nulval, &nularray[next], anynul, 
                        &array[next], status);
                 break;
+
+            case (TLONGLONG):
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8r4( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TDOUBLE):
                 ffgr8b(fptr, readptr, ntodo, incre, (double *) buffer, status);
                 fffr8r4((double *) buffer, ntodo, scale, zero, nulcheck, 
@@ -1189,6 +1211,200 @@ int fffi4r4(INT32BIT *input,      /* I - array of values to be converted     */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8r4(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+            float nullval,        /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            float *output,        /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    unsigned long *uinput;
+    long ii,jj, kk;
+    double dvalue;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                output[ii] = (float) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                output[ii] = (float) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  output[ii] = (float) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    output[ii] = dvalue * scale + zero;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (float) input[ii];  /* copy input to output */
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                output[ii] = input[ii] * scale + zero;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                    output[ii] = (float) input[ii];
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    output[ii] = input[ii] * scale + zero;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4r4(float *input,         /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
diff --git a/getcoli.c b/getcoli.c
index d6e4f86..2ec1dd1 100644
--- a/getcoli.c
+++ b/getcoli.c
@@ -231,7 +231,7 @@ int ffgsvi(fitsfile *fptr, /* I - FITS file pointer                         */
     int hdutype, anyf;
     char ldummy, msg[FLEN_ERRMSG];
     int nullcheck = 1;
-    unsigned char nullvalue;
+    short nullvalue;
 
     if (naxis < 1 || naxis > 9)
     {
@@ -248,6 +248,7 @@ int ffgsvi(fitsfile *fptr, /* I - FITS file pointer                         */
 
         fits_read_compressed_img(fptr, TSHORT, blc, trc, inc,
             nullcheck, &nullvalue, array, NULL, anynul, status);
+
         return(*status);
     }
 
@@ -765,6 +766,13 @@ int ffgcli( fitsfile *fptr,   /* I - FITS file pointer                       */
                            (short) tnull, nulval, &nularray[next], anynul, 
                            &array[next], status);
                 break;
+            case (TLONGLONG):
+
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8i2( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TBYTE):
                 ffgi1b(fptr, readptr, ntodo, incre, (unsigned char *) buffer,
                       status);
@@ -1231,6 +1239,299 @@ int fffi4i2(INT32BIT *input,      /* I - array of values to be converted     */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8i2(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+            short nullval,        /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            short *output,        /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    long ii,jj,kk;
+    double dvalue;
+    unsigned long *uinput;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue < DSHRT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MIN;
+                }
+                else if (dvalue > DSHRT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MAX;
+                }
+                else
+                    output[ii] = (short) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                if (dvalue < DSHRT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MIN;
+                }
+                else if (dvalue > DSHRT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MAX;
+                }
+                else
+                    output[ii] = (short) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  if (dvalue < DSHRT_MIN)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MIN;
+                  }
+                  else if (dvalue > DSHRT_MAX)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MAX;
+                  }
+                  else
+                    output[ii] = (short) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0, jj = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = dvalue * scale + zero;
+
+                    if (dvalue < DSHRT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = SHRT_MIN;
+                    }
+                    else if (dvalue > DSHRT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = SHRT_MAX;
+                    }
+                    else
+                        output[ii] = (short) dvalue;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < SHRT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MIN;
+                }
+                else if (input[ii] > SHRT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MAX;
+                }
+                else
+                    output[ii] = (short) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DSHRT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MIN;
+                }
+                else if (dvalue > DSHRT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = SHRT_MAX;
+                }
+                else
+                    output[ii] = (short) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < SHRT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = SHRT_MIN;
+                    }
+                    else if (input[ii] > SHRT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = SHRT_MAX;
+                    }
+                    else
+                        output[ii] = (short) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DSHRT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = SHRT_MIN;
+                    }
+                    else if (dvalue > DSHRT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = SHRT_MAX;
+                    }
+                    else
+                        output[ii] = (short) dvalue;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4i2(float *input,         /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
diff --git a/getcolj.c b/getcolj.c
index 5ec85ea..f7df81c 100644
--- a/getcolj.c
+++ b/getcolj.c
@@ -767,6 +767,12 @@ int ffgclj( fitsfile *fptr,   /* I - FITS file pointer                       */
                            nulcheck, (INT32BIT) tnull, nulval, &nularray[next], 
                             anynul, &array[next], status);
                 break;
+            case (TLONGLONG):
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8i4((LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TBYTE):
                 ffgi1b(fptr, readptr, ntodo, incre, (unsigned char *) buffer,
                        status);
@@ -1212,6 +1218,299 @@ int fffi4i4(INT32BIT *input,      /* I - array of values to be converted     */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8i4(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+            long nullval,         /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            long *output,         /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    long ii,jj,kk;
+    double dvalue;
+    unsigned long *uinput;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue < DLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MIN;
+                }
+                else if (dvalue > DLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MAX;
+                }
+                else
+                    output[ii] = (long) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                if (dvalue < DLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MIN;
+                }
+                else if (dvalue > DLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MAX;
+                }
+                else
+                    output[ii] = (long) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  if (dvalue < DLONG_MIN)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MIN;
+                  }
+                  else if (dvalue > DLONG_MAX)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MAX;
+                  }
+                  else
+                    output[ii] = (long) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = dvalue * scale + zero;
+
+                    if (dvalue < DLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONG_MIN;
+                    }
+                    else if (dvalue > DLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONG_MAX;
+                    }
+                    else
+                        output[ii] = (long) dvalue;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < LONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MIN;
+                }
+                else if (input[ii] > LONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MAX;
+                }
+                else
+                    output[ii] = (long) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MIN;
+                }
+                else if (dvalue > DLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONG_MAX;
+                }
+                else
+                    output[ii] = (long) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < LONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONG_MIN;
+                    }
+                    else if (input[ii] > LONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONG_MAX;
+                    }
+                    else
+                        output[ii] = (long) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONG_MIN;
+                    }
+                    else if (dvalue > DLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONG_MAX;
+                    }
+                    else
+                        output[ii] = (long) dvalue;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4i4(float *input,         /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
@@ -1721,3 +2020,1837 @@ int fffstri4(char *input,         /* I - array of values to be converted     */
     }
     return(*status);
 }
+
+/* ======================================================================== */
+/*      the following routines support the 'long long' data type            */
+/* ======================================================================== */
+
+/*--------------------------------------------------------------------------*/
+int ffgpvjj(fitsfile *fptr,   /* I - FITS file pointer                       */
+            long  group,      /* I - group to read (1 = 1st group)           */
+            long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+            long  nelem,      /* I - number of values to read                */
+            LONGLONG  nulval, /* I - value for undefined pixels              */
+            LONGLONG  *array, /* O - array of values that are returned       */
+            int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+            int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being read).
+  Undefined elements will be set equal to NULVAL, unless NULVAL=0
+  in which case no checking for undefined values will be performed.
+  ANYNUL is returned with a value of .true. if any pixels are undefined.
+*/
+{
+    long row;
+    char cdummy;
+    int nullcheck = 1;
+    LONGLONG nullvalue;
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+         nullvalue = nulval;  /* set local variable */
+
+        fits_read_compressed_pixels(fptr, TLONGLONG, firstelem, nelem,
+            nullcheck, &nullvalue, array, NULL, anynul, status);
+        return(*status);
+    }
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    row=maxvalue(1,group);
+
+    ffgcljj(fptr, 2, row, firstelem, nelem, 1, 1, nulval,
+               array, &cdummy, anynul, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgpfjj(fitsfile *fptr,   /* I - FITS file pointer                       */
+            long  group,      /* I - group to read (1 = 1st group)           */
+            long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+            long  nelem,      /* I - number of values to read                */
+            LONGLONG  *array, /* O - array of values that are returned       */
+            char *nularray,   /* O - array of null pixel flags               */
+            int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+            int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being read).
+  Any undefined pixels in the returned array will be set = 0 and the 
+  corresponding nularray value will be set = 1.
+  ANYNUL is returned with a value of .true. if any pixels are undefined.
+*/
+{
+    long row;
+    int nullcheck = 2;
+    LONGLONG dummy = 0;
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        fits_read_compressed_pixels(fptr, TLONGLONG, firstelem, nelem,
+            nullcheck, NULL, array, nularray, anynul, status);
+        return(*status);
+    }
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    row=maxvalue(1,group);
+
+    ffgcljj(fptr, 2, row, firstelem, nelem, 1, 2, dummy,
+               array, nularray, anynul, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffg2djj(fitsfile *fptr, /* I - FITS file pointer                       */
+           long  group,     /* I - group to read (1 = 1st group)           */
+           LONGLONG nulval ,/* set undefined pixels equal to this          */
+           long  ncols,     /* I - number of pixels in each row of array   */
+           long  naxis1,    /* I - FITS image NAXIS1 value                 */
+           long  naxis2,    /* I - FITS image NAXIS2 value                 */
+           LONGLONG  *array,/* O - array to be filled and returned         */
+           int  *anynul,    /* O - set to 1 if any values are null; else 0 */
+           int  *status)    /* IO - error status                           */
+/*
+  Read an entire 2-D array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being read).  Any null
+  values in the array will be set equal to the value of nulval, unless
+  nulval = 0 in which case no null checking will be performed.
+*/
+{
+    /* call the 3D reading routine, with the 3rd dimension = 1 */
+
+    ffg3djj(fptr, group, nulval, ncols, naxis2, naxis1, naxis2, 1, array, 
+           anynul, status);
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffg3djj(fitsfile *fptr, /* I - FITS file pointer                       */
+           long  group,     /* I - group to read (1 = 1st group)           */
+           LONGLONG nulval, /* set undefined pixels equal to this          */
+           long  ncols,     /* I - number of pixels in each row of array   */
+           long  nrows,     /* I - number of rows in each plane of array   */
+           long  naxis1,    /* I - FITS image NAXIS1 value                 */
+           long  naxis2,    /* I - FITS image NAXIS2 value                 */
+           long  naxis3,    /* I - FITS image NAXIS3 value                 */
+           LONGLONG  *array,/* O - array to be filled and returned         */
+           int  *anynul,    /* O - set to 1 if any values are null; else 0 */
+           int  *status)    /* IO - error status                           */
+/*
+  Read an entire 3-D array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being read).  Any null
+  values in the array will be set equal to the value of nulval, unless
+  nulval = 0 in which case no null checking will be performed.
+*/
+{
+    long tablerow, nfits, narray, ii, jj;
+    char cdummy;
+    int nullcheck = 1;
+    long inc[] = {1,1,1};
+    long fpixel[] = {1,1,1};
+    long lpixel[3];
+    LONGLONG nullvalue;
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+        nullvalue = nulval;  /* set local variable */
+
+        fits_read_compressed_img(fptr, TLONGLONG, fpixel, lpixel, inc,
+            nullcheck, &nullvalue, array, NULL, anynul, status);
+        return(*status);
+    }
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+    tablerow=maxvalue(1,group);
+
+    if (ncols == naxis1 && nrows == naxis2)  /* arrays have same size? */
+    {
+       /* all the image pixels are contiguous, so read all at once */
+       ffgcljj(fptr, 2, tablerow, 1, naxis1 * naxis2 * naxis3, 1, 1, nulval,
+               array, &cdummy, anynul, status);
+       return(*status);
+    }
+
+    if (ncols < naxis1 || nrows < naxis2)
+       return(*status = BAD_DIMEN);
+
+    nfits = 1;   /* next pixel in FITS image to read */
+    narray = 0;  /* next pixel in output array to be filled */
+
+    /* loop over naxis3 planes in the data cube */
+    for (jj = 0; jj < naxis3; jj++)
+    {
+      /* loop over the naxis2 rows in the FITS image, */
+      /* reading naxis1 pixels to each row            */
+
+      for (ii = 0; ii < naxis2; ii++)
+      {
+       if (ffgcljj(fptr, 2, tablerow, nfits, naxis1, 1, 1, nulval,
+          &array[narray], &cdummy, anynul, status) > 0)
+          return(*status);
+
+       nfits += naxis1;
+       narray += ncols;
+      }
+      narray += (nrows - naxis2) * ncols;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgsvjj(fitsfile *fptr, /* I - FITS file pointer                         */
+           int  colnum,    /* I - number of the column to read (1 = 1st)    */
+           int naxis,      /* I - number of dimensions in the FITS array    */
+           long  *naxes,   /* I - size of each dimension                    */
+           long  *blc,     /* I - 'bottom left corner' of the subsection    */
+           long  *trc,     /* I - 'top right corner' of the subsection      */
+           long  *inc,     /* I - increment to be applied in each dimension */
+           LONGLONG nulval,/* I - value to set undefined pixels             */
+           LONGLONG *array,/* O - array to be filled and returned           */
+           int  *anynul,   /* O - set to 1 if any values are null; else 0   */
+           int  *status)   /* IO - error status                             */
+/*
+  Read a subsection of data values from an image or a table column.
+  This routine is set up to handle a maximum of nine dimensions.
+*/
+{
+    long ii,i0, i1,i2,i3,i4,i5,i6,i7,i8,row,rstr,rstp,rinc;
+    long str[9],stp[9],incr[9],dir[9];
+    long nelem, nultyp, ninc, numcol;
+    OFF_T felem, dsize[10];
+    int hdutype, anyf;
+    char ldummy, msg[FLEN_ERRMSG];
+    int nullcheck = 1;
+    LONGLONG nullvalue;
+
+    if (naxis < 1 || naxis > 9)
+    {
+        sprintf(msg, "NAXIS = %d in call to ffgsvj is out of range", naxis);
+        ffpmsg(msg);
+        return(*status = BAD_DIMEN);
+    }
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        nullvalue = nulval;  /* set local variable */
+
+        fits_read_compressed_img(fptr, TLONGLONG, blc, trc, inc,
+            nullcheck, &nullvalue, array, NULL, anynul, status);
+        return(*status);
+    }
+
+/*
+    if this is a primary array, then the input COLNUM parameter should
+    be interpreted as the row number, and we will alway read the image
+    data from column 2 (any group parameters are in column 1).
+*/
+    if (ffghdt(fptr, &hdutype, status) > 0)
+        return(*status);
+
+    if (hdutype == IMAGE_HDU)
+    {
+        /* this is a primary array, or image extension */
+        if (colnum == 0)
+        {
+            rstr = 1;
+            rstp = 1;
+        }
+        else
+        {
+            rstr = colnum;
+            rstp = colnum;
+        }
+        rinc = 1;
+        numcol = 2;
+    }
+    else
+    {
+        /* this is a table, so the row info is in the (naxis+1) elements */
+        rstr = blc[naxis];
+        rstp = trc[naxis];
+        rinc = inc[naxis];
+        numcol = colnum;
+    }
+
+    nultyp = 1;
+    if (anynul)
+        *anynul = FALSE;
+
+    i0 = 0;
+    for (ii = 0; ii < 9; ii++)
+    {
+        str[ii] = 1;
+        stp[ii] = 1;
+        incr[ii] = 1;
+        dsize[ii] = 1;
+        dir[ii] = 1;
+    }
+
+    for (ii = 0; ii < naxis; ii++)
+    {
+      if (trc[ii] < blc[ii])
+      {
+        if (hdutype == IMAGE_HDU)
+        {
+           dir[ii] = -1;
+        }
+        else
+        {
+          sprintf(msg, "ffgsvj: illegal range specified for axis %ld", ii + 1);
+          ffpmsg(msg);
+          return(*status = BAD_PIX_NUM);
+        }
+      }
+
+      str[ii] = blc[ii];
+      stp[ii] = trc[ii];
+      incr[ii] = inc[ii];
+      dsize[ii + 1] = dsize[ii] * naxes[ii];
+      dsize[ii] = dsize[ii] * dir[ii];
+    }
+    dsize[naxis] = dsize[naxis] * dir[naxis];
+
+    if (naxis == 1 && naxes[0] == 1)
+    {
+      /* This is not a vector column, so read all the rows at once */
+      nelem = (rstp - rstr) / rinc + 1;
+      ninc = rinc;
+      rstp = rstr;
+    }
+    else
+    {
+      /* have to read each row individually, in all dimensions */
+      nelem = (stp[0]*dir[0] - str[0]*dir[0]) / inc[0] + 1;
+      ninc = incr[0] * dir[0];
+    }
+
+    for (row = rstr; row <= rstp; row += rinc)
+    {
+     for (i8 = str[8]*dir[8]; i8 <= stp[8]*dir[8]; i8 += incr[8])
+     {
+      for (i7 = str[7]*dir[7]; i7 <= stp[7]*dir[7]; i7 += incr[7])
+      {
+       for (i6 = str[6]*dir[6]; i6 <= stp[6]*dir[6]; i6 += incr[6])
+       {
+        for (i5 = str[5]*dir[5]; i5 <= stp[5]*dir[5]; i5 += incr[5])
+        {
+         for (i4 = str[4]*dir[4]; i4 <= stp[4]*dir[4]; i4 += incr[4])
+         {
+          for (i3 = str[3]*dir[3]; i3 <= stp[3]*dir[3]; i3 += incr[3])
+          {
+           for (i2 = str[2]*dir[2]; i2 <= stp[2]*dir[2]; i2 += incr[2])
+           {
+            for (i1 = str[1]*dir[1]; i1 <= stp[1]*dir[1]; i1 += incr[1])
+            {
+
+              felem=str[0] + (i1 - dir[1]) * dsize[1] + (i2 - dir[2]) * dsize[2] + 
+                             (i3 - dir[3]) * dsize[3] + (i4 - dir[4]) * dsize[4] +
+                             (i5 - dir[5]) * dsize[5] + (i6 - dir[6]) * dsize[6] +
+                             (i7 - dir[7]) * dsize[7] + (i8 - dir[8]) * dsize[8];
+
+              if ( ffgcljj(fptr, numcol, row, felem, nelem, ninc, nultyp,
+                   nulval, &array[i0], &ldummy, &anyf, status) > 0)
+                   return(*status);
+
+              if (anyf && anynul)
+                  *anynul = TRUE;
+
+              i0 += nelem;
+            }
+           }
+          }
+         }
+        }
+       }
+      }
+     }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgsfjj(fitsfile *fptr, /* I - FITS file pointer                         */
+           int  colnum,    /* I - number of the column to read (1 = 1st)    */
+           int naxis,      /* I - number of dimensions in the FITS array    */
+           long  *naxes,   /* I - size of each dimension                    */
+           long  *blc,     /* I - 'bottom left corner' of the subsection    */
+           long  *trc,     /* I - 'top right corner' of the subsection      */
+           long  *inc,     /* I - increment to be applied in each dimension */
+           LONGLONG *array,/* O - array to be filled and returned           */
+           char *flagval,  /* O - set to 1 if corresponding value is null   */
+           int  *anynul,   /* O - set to 1 if any values are null; else 0   */
+           int  *status)   /* IO - error status                             */
+/*
+  Read a subsection of data values from an image or a table column.
+  This routine is set up to handle a maximum of nine dimensions.
+*/
+{
+    long ii,i0, i1,i2,i3,i4,i5,i6,i7,i8,row,rstr,rstp,rinc;
+    long str[9],stp[9],incr[9],dsize[10];
+    long felem, nelem, nultyp, ninc, numcol;
+    LONGLONG nulval = 0;
+    int hdutype, anyf;
+    char msg[FLEN_ERRMSG];
+    int nullcheck = 2;
+
+    if (naxis < 1 || naxis > 9)
+    {
+        sprintf(msg, "NAXIS = %d in call to ffgsvj is out of range", naxis);
+        ffpmsg(msg);
+        return(*status = BAD_DIMEN);
+    }
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        fits_read_compressed_img(fptr, TLONGLONG, blc, trc, inc,
+            nullcheck, NULL, array, flagval, anynul, status);
+        return(*status);
+    }
+
+/*
+    if this is a primary array, then the input COLNUM parameter should
+    be interpreted as the row number, and we will alway read the image
+    data from column 2 (any group parameters are in column 1).
+*/
+    if (ffghdt(fptr, &hdutype, status) > 0)
+        return(*status);
+
+    if (hdutype == IMAGE_HDU)
+    {
+        /* this is a primary array, or image extension */
+        if (colnum == 0)
+        {
+            rstr = 1;
+            rstp = 1;
+        }
+        else
+        {
+            rstr = colnum;
+            rstp = colnum;
+        }
+        rinc = 1;
+        numcol = 2;
+    }
+    else
+    {
+        /* this is a table, so the row info is in the (naxis+1) elements */
+        rstr = blc[naxis];
+        rstp = trc[naxis];
+        rinc = inc[naxis];
+        numcol = colnum;
+    }
+
+    nultyp = 2;
+    if (anynul)
+        *anynul = FALSE;
+
+    i0 = 0;
+    for (ii = 0; ii < 9; ii++)
+    {
+        str[ii] = 1;
+        stp[ii] = 1;
+        incr[ii] = 1;
+        dsize[ii] = 1;
+    }
+
+    for (ii = 0; ii < naxis; ii++)
+    {
+      if (trc[ii] < blc[ii])
+      {
+        sprintf(msg, "ffgsvj: illegal range specified for axis %ld", ii + 1);
+        ffpmsg(msg);
+        return(*status = BAD_PIX_NUM);
+      }
+
+      str[ii] = blc[ii];
+      stp[ii] = trc[ii];
+      incr[ii] = inc[ii];
+      dsize[ii + 1] = dsize[ii] * naxes[ii];
+    }
+
+    if (naxis == 1 && naxes[0] == 1)
+    {
+      /* This is not a vector column, so read all the rows at once */
+      nelem = (rstp - rstr) / rinc + 1;
+      ninc = rinc;
+      rstp = rstr;
+    }
+    else
+    {
+      /* have to read each row individually, in all dimensions */
+      nelem = (stp[0] - str[0]) / inc[0] + 1;
+      ninc = incr[0];
+    }
+
+    for (row = rstr; row <= rstp; row += rinc)
+    {
+     for (i8 = str[8]; i8 <= stp[8]; i8 += incr[8])
+     {
+      for (i7 = str[7]; i7 <= stp[7]; i7 += incr[7])
+      {
+       for (i6 = str[6]; i6 <= stp[6]; i6 += incr[6])
+       {
+        for (i5 = str[5]; i5 <= stp[5]; i5 += incr[5])
+        {
+         for (i4 = str[4]; i4 <= stp[4]; i4 += incr[4])
+         {
+          for (i3 = str[3]; i3 <= stp[3]; i3 += incr[3])
+          {
+           for (i2 = str[2]; i2 <= stp[2]; i2 += incr[2])
+           {
+            for (i1 = str[1]; i1 <= stp[1]; i1 += incr[1])
+            {
+              felem=str[0] + (i1 - 1) * dsize[1] + (i2 - 1) * dsize[2] + 
+                             (i3 - 1) * dsize[3] + (i4 - 1) * dsize[4] +
+                             (i5 - 1) * dsize[5] + (i6 - 1) * dsize[6] +
+                             (i7 - 1) * dsize[7] + (i8 - 1) * dsize[8];
+
+              if ( ffgcljj(fptr, numcol, row, felem, nelem, ninc, nultyp,
+                   nulval, &array[i0], &flagval[i0], &anyf, status) > 0)
+                   return(*status);
+
+              if (anyf && anynul)
+                  *anynul = TRUE;
+
+              i0 += nelem;
+            }
+           }
+          }
+         }
+        }
+       }
+      }
+     }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffggpjj(fitsfile *fptr,   /* I - FITS file pointer                       */
+            long  group,      /* I - group to read (1 = 1st group)           */
+            long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+            long  nelem,      /* I - number of values to read                */
+            LONGLONG  *array, /* O - array of values that are returned       */
+            int  *status)     /* IO - error status                           */
+/*
+  Read an array of group parameters from the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being read).
+*/
+{
+    long row;
+    int idummy;
+    char cdummy;
+    LONGLONG dummy = 0;
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    row=maxvalue(1,group);
+
+    ffgcljj(fptr, 1, row, firstelem, nelem, 1, 1, dummy,
+               array, &cdummy, &idummy, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgcvjj(fitsfile *fptr,  /* I - FITS file pointer                       */
+           int  colnum,      /* I - number of column to read (1 = 1st col)  */
+           long  firstrow,   /* I - first row to read (1 = 1st row)         */
+           long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+           long  nelem,      /* I - number of values to read                */
+           LONGLONG  nulval, /* I - value for null pixels                   */
+           LONGLONG *array,  /* O - array of values that are read           */
+           int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+           int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from a column in the current FITS HDU. Automatic
+  datatype conversion will be performed if the datatype of the column does not
+  match the datatype of the array parameter. The output values will be scaled 
+  by the FITS TSCALn and TZEROn values if these values have been defined.
+  Any undefined pixels will be set equal to the value of 'nulval' unless
+  nulval = 0 in which case no checks for undefined pixels will be made.
+*/
+{
+    char cdummy;
+
+    ffgcljj(fptr, colnum, firstrow, firstelem, nelem, 1, 1, nulval,
+           array, &cdummy, anynul, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgcfjj(fitsfile *fptr,  /* I - FITS file pointer                       */
+           int  colnum,      /* I - number of column to read (1 = 1st col)  */
+           long  firstrow,   /* I - first row to read (1 = 1st row)         */
+           long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+           long  nelem,      /* I - number of values to read                */
+           LONGLONG  *array, /* O - array of values that are read           */
+           char *nularray,   /* O - array of flags: 1 if null pixel; else 0 */
+           int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+           int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from a column in the current FITS HDU. Automatic
+  datatype conversion will be performed if the datatype of the column does not
+  match the datatype of the array parameter. The output values will be scaled 
+  by the FITS TSCALn and TZEROn values if these values have been defined.
+  Nularray will be set = 1 if the corresponding array pixel is undefined, 
+  otherwise nularray will = 0.
+*/
+{
+    LONGLONG dummy = 0;
+
+    ffgcljj(fptr, colnum, firstrow, firstelem, nelem, 1, 2, dummy,
+           array, nularray, anynul, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgcljj( fitsfile *fptr,   /* I - FITS file pointer                       */
+            int  colnum,      /* I - number of column to read (1 = 1st col)  */
+            long  firstrow,   /* I - first row to read (1 = 1st row)         */
+            OFF_T firstelem,  /* I - first vector element to read (1 = 1st)  */
+            long  nelem,      /* I - number of values to read                */
+            long  elemincre,  /* I - pixel increment; e.g., 2 = every other  */
+            int   nultyp,     /* I - null value handling code:               */
+                              /*     1: set undefined pixels = nulval        */
+                              /*     2: set nularray=1 for undefined pixels  */
+            LONGLONG  nulval, /* I - value for null pixels if nultyp = 1     */
+            LONGLONG  *array, /* O - array of values that are read           */
+            char *nularray,   /* O - array of flags = 1 if nultyp = 2        */
+            int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+            int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from a column in the current FITS HDU.
+  The column number may refer to a real column in an ASCII or binary table, 
+  or it may refer be a virtual column in a 1 or more grouped FITS primary
+  array or image extension.  FITSIO treats a primary array as a binary table
+  with 2 vector columns: the first column contains the group parameters (often
+  with length = 0) and the second column contains the array of image pixels.
+  Each row of the table represents a group in the case of multigroup FITS
+  images.
+
+  The output array of values will be converted from the datatype of the column 
+  and will be scaled by the FITS TSCALn and TZEROn values if necessary.
+*/
+{
+    double scale, zero, power = 1.;
+    int tcode, maxelem, hdutype, xcode, decimals;
+    long twidth, incre, rownum, remain, next, ntodo;
+    long ii, rowincre, tnull, xwidth;
+    int convert, nulcheck, readcheck = 0;
+    OFF_T repeat, startpos, elemnum, readptr, rowlen;
+    char tform[20];
+    char message[81];
+    char snull[20];   /*  the FITS null value if reading from ASCII table  */
+
+    double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */
+    void *buffer;
+
+    if (*status > 0 || nelem == 0)  /* inherit input status value if > 0 */
+        return(*status);
+
+    buffer = cbuff;
+
+    if (anynul)
+        *anynul = 0;
+
+    if (nultyp == 2)
+        memset(nularray, 0, nelem);   /* initialize nullarray */
+
+    /*---------------------------------------------------*/
+    /*  Check input and get parameters about the column: */
+    /*---------------------------------------------------*/
+    if (elemincre < 0)
+        readcheck = -1;  /* don't do range checking in this case */
+
+    if (ffgcpr(fptr, colnum, firstrow, firstelem, nelem, readcheck, &scale, &zero,
+         tform, &twidth, &tcode, &maxelem, &startpos, &elemnum, &incre,
+         &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0 )
+         return(*status);
+
+    incre *= elemincre;   /* multiply incre to just get every nth pixel */
+
+    if (tcode == TSTRING)    /* setup for ASCII tables */
+    {
+      /* get the number of implied decimal places if no explicit decmal point */
+      ffasfm(tform, &xcode, &xwidth, &decimals, status); 
+      for(ii = 0; ii < decimals; ii++)
+        power *= 10.;
+    }
+    /*------------------------------------------------------------------*/
+    /*  Decide whether to check for null values in the input FITS file: */
+    /*------------------------------------------------------------------*/
+    nulcheck = nultyp; /* by default check for null values in the FITS file */
+
+    if (nultyp == 1 && nulval == 0)
+       nulcheck = 0;    /* calling routine does not want to check for nulls */
+
+    else if (tcode%10 == 1 &&        /* if reading an integer column, and  */ 
+            tnull == NULL_UNDEFINED) /* if a null value is not defined,    */
+            nulcheck = 0;            /* then do not check for null values. */
+
+    else if (tcode == TSHORT && (tnull > SHRT_MAX || tnull < SHRT_MIN) )
+            nulcheck = 0;            /* Impossible null value */
+
+    else if (tcode == TBYTE && (tnull > 255 || tnull < 0) )
+            nulcheck = 0;            /* Impossible null value */
+
+    else if (tcode == TSTRING && snull[0] == ASCII_NULL_UNDEFINED)
+         nulcheck = 0;
+
+    /*----------------------------------------------------------------------*/
+    /*  If FITS column and output data array have same datatype, then we do */
+    /*  not need to use a temporary buffer to store intermediate datatype.  */
+    /*----------------------------------------------------------------------*/
+    convert = 1;
+    if (tcode == TLONGLONG)  /* Special Case:                        */
+    {                             /* no type convertion required, so read */
+        maxelem = nelem;          /* data directly into output buffer.    */
+
+        if (nulcheck == 0 && scale == 1. && zero == 0.)
+            convert = 0;  /* no need to scale data or find nulls */
+    }
+
+    /*---------------------------------------------------------------------*/
+    /*  Now read the pixels from the FITS column. If the column does not   */
+    /*  have the same datatype as the output array, then we have to read   */
+    /*  the raw values into a temporary buffer (of limited size).  In      */
+    /*  the case of a vector colum read only 1 vector of values at a time  */
+    /*  then skip to the next row if more values need to be read.          */
+    /*  After reading the raw values, then call the fffXXYY routine to (1) */
+    /*  test for undefined values, (2) convert the datatype if necessary,  */
+    /*  and (3) scale the values by the FITS TSCALn and TZEROn linear      */
+    /*  scaling parameters.                                                */
+    /*---------------------------------------------------------------------*/
+    remain = nelem;           /* remaining number of values to read */
+    next = 0;                 /* next element in array to be read   */
+    rownum = 0;               /* row number, relative to firstrow   */
+
+    while (remain)
+    {
+        /* limit the number of pixels to read at one time to the number that
+           will fit in the buffer or to the number of pixels that remain in
+           the current vector, which ever is smaller.
+        */
+        ntodo = minvalue(remain, maxelem);
+        if (elemincre >= 0)
+        {
+          ntodo = minvalue(ntodo, ((repeat - elemnum - 1)/elemincre +1));
+        }
+        else
+        {
+          ntodo = minvalue(ntodo, (elemnum/(-elemincre) +1));
+        }
+
+        readptr = startpos + ((OFF_T)rownum * rowlen) + (elemnum * (incre / elemincre));
+
+        switch (tcode) 
+        {
+            case (TLONGLONG):
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) &array[next],
+                       status);
+                if (convert)
+                    fffi8i8((LONGLONG *) &array[next], ntodo, scale, zero, 
+                           nulcheck, (LONGLONG) tnull, nulval, &nularray[next], 
+                           anynul, &array[next], status);
+                break;
+            case (TLONG):
+                ffgi4b(fptr, readptr, ntodo, incre, (INT32BIT *) buffer,
+                       status);
+                fffi4i8((INT32BIT *) buffer, ntodo, scale, zero, 
+                        nulcheck, (INT32BIT) tnull, nulval, &nularray[next], 
+                        anynul, &array[next], status);
+                break;
+            case (TBYTE):
+                ffgi1b(fptr, readptr, ntodo, incre, (unsigned char *) buffer,
+                       status);
+                fffi1i8((unsigned char *) buffer, ntodo, scale, zero, nulcheck, 
+                     (unsigned char) tnull, nulval, &nularray[next], anynul, 
+                     &array[next], status);
+                break;
+            case (TSHORT):
+                ffgi2b(fptr, readptr, ntodo, incre, (short  *) buffer, status);
+                fffi2i8((short  *) buffer, ntodo, scale, zero, nulcheck, 
+                      (short) tnull, nulval, &nularray[next], anynul, 
+                      &array[next], status);
+                break;
+            case (TFLOAT):
+                ffgr4b(fptr, readptr, ntodo, incre, (float  *) buffer, status);
+                fffr4i8((float  *) buffer, ntodo, scale, zero, nulcheck, 
+                       nulval, &nularray[next], anynul, 
+                       &array[next], status);
+                break;
+            case (TDOUBLE):
+                ffgr8b(fptr, readptr, ntodo, incre, (double *) buffer, status);
+                fffr8i8((double *) buffer, ntodo, scale, zero, nulcheck, 
+                          nulval, &nularray[next], anynul, 
+                          &array[next], status);
+                break;
+            case (TSTRING):
+                ffmbyt(fptr, readptr, REPORT_EOF, status);
+       
+                if (incre == twidth)    /* contiguous bytes */
+                     ffgbyt(fptr, ntodo * twidth, buffer, status);
+                else
+                     ffgbytoff(fptr, twidth, ntodo, incre - twidth, buffer,
+                               status);
+
+                fffstri8((char *) buffer, ntodo, scale, zero, twidth, power,
+                     nulcheck, snull, nulval, &nularray[next], anynul,
+                     &array[next], status);
+                break;
+
+            default:  /*  error trap for invalid column format */
+                sprintf(message, 
+                   "Cannot read numbers from column %d which has format %s",
+                    colnum, tform);
+                ffpmsg(message);
+                if (hdutype == ASCII_TBL)
+                    return(*status = BAD_ATABLE_FORMAT);
+                else
+                    return(*status = BAD_BTABLE_FORMAT);
+
+        } /* End of switch block */
+
+        /*-------------------------*/
+        /*  Check for fatal error  */
+        /*-------------------------*/
+        if (*status > 0)  /* test for error during previous read operation */
+        {
+          if (hdutype > 0)
+            sprintf(message,
+            "Error reading elements %ld thru %ld from column %d (ffgclj).",
+              next+1, next+ntodo, colnum);
+          else
+            sprintf(message,
+            "Error reading elements %ld thru %ld from image (ffgclj).",
+              next+1, next+ntodo);
+
+          ffpmsg(message);
+          return(*status);
+        }
+
+        /*--------------------------------------------*/
+        /*  increment the counters for the next loop  */
+        /*--------------------------------------------*/
+        remain -= ntodo;
+        if (remain)
+        {
+            next += ntodo;
+            elemnum = elemnum + (ntodo * elemincre);
+
+            if (elemnum >= repeat)  /* completed a row; start on later row */
+            {
+                rowincre = elemnum / repeat;
+                rownum += rowincre;
+                elemnum = elemnum - (rowincre * repeat);
+            }
+            else if (elemnum < 0)  /* completed a row; start on a previous row */
+            {
+                rowincre = (-elemnum - 1) / repeat + 1;
+                rownum -= rowincre;
+                elemnum = (rowincre * repeat) + elemnum;
+            }
+        }
+    }  /*  End of main while Loop  */
+
+
+    /*--------------------------------*/
+    /*  check for numerical overflow  */
+    /*--------------------------------*/
+    if (*status == OVERFLOW_ERR)
+    {
+        ffpmsg(
+        "Numerical overflow during type conversion while reading FITS data.");
+        *status = NUM_OVERFLOW;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffi1i8(unsigned char *input, /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            unsigned char tnull,  /* I - value of FITS TNULLn keyword if any */
+            LONGLONG nullval,     /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            LONGLONG *output,     /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (LONGLONG) input[ii];  /* copy input to output */
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DLONGLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MIN;
+                }
+                else if (dvalue > DLONGLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MAX;
+                }
+                else
+                    output[ii] = (LONGLONG) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                    output[ii] = (LONGLONG) input[ii];
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (dvalue > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffi2i8(short *input,         /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            short tnull,          /* I - value of FITS TNULLn keyword if any */
+            LONGLONG nullval,     /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            LONGLONG *output,     /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (LONGLONG) input[ii];   /* copy input to output */
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DLONGLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MIN;
+                }
+                else if (dvalue > DLONGLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MAX;
+                }
+                else
+                    output[ii] = (LONGLONG) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                    output[ii] = (LONGLONG) input[ii];
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (dvalue > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffi4i8(INT32BIT *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            INT32BIT tnull,       /* I - value of FITS TNULLn keyword if any */
+            LONGLONG nullval,     /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            LONGLONG *output,     /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (LONGLONG) input[ii];   /* copy input to output */
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DLONGLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MIN;
+                }
+                else if (dvalue > DLONGLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MAX;
+                }
+                else
+                    output[ii] = (LONGLONG) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                    output[ii] = (LONGLONG) input[ii];
+
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (dvalue > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffi8i8(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            LONGLONG tnull,       /* I - value of FITS TNULLn keyword if any */
+            LONGLONG nullval,     /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            LONGLONG *output,     /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+                output[ii] =  input[ii];   /* copy input to output */
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DLONGLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MIN;
+                }
+                else if (dvalue > DLONGLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MAX;
+                }
+                else
+                    output[ii] = (LONGLONG) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                    output[ii] = input[ii];
+
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (dvalue > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffr4i8(float *input,         /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            LONGLONG nullval,     /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            LONGLONG *output,     /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to NaN.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+    short *sptr, iret;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < DLONGLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MIN;
+                }
+                else if (input[ii] > DLONGLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MAX;
+                }
+                else
+                    output[ii] = (LONGLONG) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DLONGLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MIN;
+                }
+                else if (dvalue > DLONGLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MAX;
+                }
+                else
+                    output[ii] = (LONGLONG) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        sptr = (short *) input;
+
+#if BYTESWAPPED && MACHINE != VAXVMS && MACHINE != ALPHAVMS
+        sptr++;       /* point to MSBs */
+#endif
+
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, sptr += 2)
+            {
+              if (0 != (iret = fnan(*sptr) ) )  /* test for NaN or underflow */
+              {
+                  if (iret == 1)  /* is it a NaN? */
+                  {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                  }
+                  else            /* it's an underflow */
+                     output[ii] = 0;
+              }
+              else
+                {
+                    if (input[ii] < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (input[ii] > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, sptr += 2)
+            {
+              if (0 != (iret = fnan(*sptr) ) )  /* test for NaN or underflow */
+              {
+                  if (iret == 1)  /* is it a NaN? */
+                  {  
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                  }
+                  else            /* it's an underflow */
+                  {
+                    if (zero < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (zero > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) zero;
+                  }
+              }
+              else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (dvalue > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffr8i8(double *input,        /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            LONGLONG nullval,     /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            LONGLONG *output,     /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to NaN.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+    short *sptr, iret;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < DLONGLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MIN;
+                }
+                else if (input[ii] > DLONGLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MAX;
+                }
+                else
+                    output[ii] = (LONGLONG) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DLONGLONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MIN;
+                }
+                else if (dvalue > DLONGLONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = LONGLONG_MAX;
+                }
+                else
+                    output[ii] = (LONGLONG) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        sptr = (short *) input;
+
+#if BYTESWAPPED && MACHINE != VAXVMS && MACHINE != ALPHAVMS
+        sptr += 3;       /* point to MSBs */
+#endif
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, sptr += 4)
+            {
+              if (0 != (iret = dnan(*sptr)) )  /* test for NaN or underflow */
+              {
+                  if (iret == 1)  /* is it a NaN? */
+                  {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                  }
+                  else            /* it's an underflow */
+                     output[ii] = 0;
+              }
+              else
+                {
+                    if (input[ii] < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (input[ii] > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, sptr += 4)
+            {
+              if (0 != (iret = dnan(*sptr)) )  /* test for NaN or underflow */
+              {
+                  if (iret == 1)  /* is it a NaN? */
+                  {  
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                  }
+                  else            /* it's an underflow */
+                  {
+                    if (zero < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (zero > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) zero;
+                  }
+              }
+              else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DLONGLONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MIN;
+                    }
+                    else if (dvalue > DLONGLONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = LONGLONG_MAX;
+                    }
+                    else
+                        output[ii] = (LONGLONG) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffstri8(char *input,         /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            long twidth,          /* I - width of each substring of chars    */
+            double implipower,    /* I - power of 10 of implied decimal      */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            char  *snull,         /* I - value of FITS null string, if any   */
+            LONGLONG nullval,     /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            LONGLONG *output,     /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file. Check
+  for null values and do scaling if required. The nullcheck code value
+  determines how any null values in the input array are treated. A null
+  value is an input pixel that is equal to snull.  If nullcheck= 0, then
+  no special checking for nulls is performed.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    int nullen;
+    long ii;
+    double dvalue;
+    char *cstring, message[81];
+    char *cptr, *tpos;
+    char tempstore, chrzero = '0';
+    double val, power;
+    int exponent, sign, esign, decpt;
+
+    nullen = strlen(snull);
+    cptr = input;  /* pointer to start of input string */
+    for (ii = 0; ii < ntodo; ii++)
+    {
+      cstring = cptr;
+      /* temporarily insert a null terminator at end of the string */
+      tpos = cptr + twidth;
+      tempstore = *tpos;
+      *tpos = 0;
+
+      /* check if null value is defined, and if the    */
+      /* column string is identical to the null string */
+      if (snull[0] != ASCII_NULL_UNDEFINED && 
+         !strncmp(snull, cptr, nullen) )
+      {
+        if (nullcheck)  
+        {
+          *anynull = 1;    
+          if (nullcheck == 1)
+            output[ii] = nullval;
+          else
+            nullarray[ii] = 1;
+        }
+        cptr += twidth;
+      }
+      else
+      {
+        /* value is not the null value, so decode it */
+        /* remove any embedded blank characters from the string */
+
+        decpt = 0;
+        sign = 1;
+        val  = 0.;
+        power = 1.;
+        exponent = 0;
+        esign = 1;
+
+        while (*cptr == ' ')               /* skip leading blanks */
+           cptr++;
+
+        if (*cptr == '-' || *cptr == '+')  /* check for leading sign */
+        {
+          if (*cptr == '-')
+             sign = -1;
+
+          cptr++;
+
+          while (*cptr == ' ')         /* skip blanks between sign and value */
+            cptr++;
+        }
+
+        while (*cptr >= '0' && *cptr <= '9')
+        {
+          val = val * 10. + *cptr - chrzero;  /* accumulate the value */
+          cptr++;
+
+          while (*cptr == ' ')         /* skip embedded blanks in the value */
+            cptr++;
+        }
+
+        if (*cptr == '.')              /* check for decimal point */
+        {
+          decpt = 1;       /* set flag to show there was a decimal point */
+          cptr++;
+          while (*cptr == ' ')         /* skip any blanks */
+            cptr++;
+
+          while (*cptr >= '0' && *cptr <= '9')
+          {
+            val = val * 10. + *cptr - chrzero;  /* accumulate the value */
+            power = power * 10.;
+            cptr++;
+
+            while (*cptr == ' ')         /* skip embedded blanks in the value */
+              cptr++;
+          }
+        }
+
+        if (*cptr == 'E' || *cptr == 'D')  /* check for exponent */
+        {
+          cptr++;
+          while (*cptr == ' ')         /* skip blanks */
+              cptr++;
+  
+          if (*cptr == '-' || *cptr == '+')  /* check for exponent sign */
+          {
+            if (*cptr == '-')
+               esign = -1;
+
+            cptr++;
+
+            while (*cptr == ' ')        /* skip blanks between sign and exp */
+              cptr++;
+          }
+
+          while (*cptr >= '0' && *cptr <= '9')
+          {
+            exponent = exponent * 10 + *cptr - chrzero;  /* accumulate exp */
+            cptr++;
+
+            while (*cptr == ' ')         /* skip embedded blanks */
+              cptr++;
+          }
+        }
+
+        if (*cptr  != 0)  /* should end up at the null terminator */
+        {
+          sprintf(message, "Cannot read number from ASCII table");
+          ffpmsg(message);
+          sprintf(message, "Column field = %s.", cstring);
+          ffpmsg(message);
+          /* restore the char that was overwritten by the null */
+          *tpos = tempstore;
+          return(*status = BAD_C2D);
+        }
+
+        if (!decpt)  /* if no explicit decimal, use implied */
+           power = implipower;
+
+        dvalue = (sign * val / power) * pow(10., (double) (esign * exponent));
+
+        dvalue = dvalue * scale + zero;   /* apply the scaling */
+
+        if (dvalue < DLONGLONG_MIN)
+        {
+            *status = OVERFLOW_ERR;
+            output[ii] = LONGLONG_MIN;
+        }
+        else if (dvalue > DLONGLONG_MAX)
+        {
+            *status = OVERFLOW_ERR;
+            output[ii] = LONGLONG_MAX;
+        }
+        else
+            output[ii] = (LONGLONG) dvalue;
+      }
+      /* restore the char that was overwritten by the null */
+      *tpos = tempstore;
+    }
+    return(*status);
+}
diff --git a/getcolk.c b/getcolk.c
index 4afd80a..f9a72d6 100644
--- a/getcolk.c
+++ b/getcolk.c
@@ -784,6 +784,13 @@ int ffgclk( fitsfile *fptr,   /* I - FITS file pointer                       */
                              nulcheck, (INT32BIT) tnull, nulval,
                              &nularray[next], anynul, &array[next], status);
                 break;
+            case (TLONGLONG):
+
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8int( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TBYTE):
                 ffgi1b(fptr, readptr, ntodo, incre, (unsigned char *) buffer,
                        status);
@@ -1226,6 +1233,299 @@ int fffi4int(INT32BIT *input,     /* I - array of values to be converted     */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8int(LONGLONG *input,     /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+            int  nullval,         /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            int  *output,         /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    long ii,jj,kk;
+    double dvalue;
+    unsigned long *uinput;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue < DINT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MIN;
+                }
+                else if (dvalue > DINT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MAX;
+                }
+                else
+                    output[ii] = (int) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                if (dvalue < DINT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MIN;
+                }
+                else if (dvalue > DINT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MAX;
+                }
+                else
+                    output[ii] = (int) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  if (dvalue < DINT_MIN)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MIN;
+                  }
+                  else if (dvalue > DINT_MAX)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MAX;
+                  }
+                  else
+                    output[ii] = (int) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = dvalue * scale + zero;
+
+                    if (dvalue < DINT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = INT_MIN;
+                    }
+                    else if (dvalue > DINT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = INT_MAX;
+                    }
+                    else
+                        output[ii] = (int) dvalue;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < INT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MIN;
+                }
+                else if (input[ii] > INT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MAX;
+                }
+                else
+                    output[ii] = (int) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DINT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MIN;
+                }
+                else if (dvalue > DINT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = INT_MAX;
+                }
+                else
+                    output[ii] = (int) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < INT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = INT_MIN;
+                    }
+                    else if (input[ii] > INT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = INT_MAX;
+                    }
+                    else
+                        output[ii] = (int) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DINT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = INT_MIN;
+                    }
+                    else if (dvalue > DINT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = INT_MAX;
+                    }
+                    else
+                        output[ii] = (int) dvalue;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4int(float *input,        /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
diff --git a/getcoll.c b/getcoll.c
index 447b312..a8a8516 100644
--- a/getcoll.c
+++ b/getcoll.c
@@ -79,7 +79,7 @@ int ffgcfl( fitsfile *fptr,   /* I - FITS file pointer                       */
 int ffgcll( fitsfile *fptr,   /* I - FITS file pointer                       */
             int  colnum,      /* I - number of column to read (1 = 1st col)  */
             long  firstrow,   /* I - first row to read (1 = 1st row)         */
-            long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+            OFF_T  firstelem, /* I - first vector element to read (1 = 1st)  */
             long  nelem,      /* I - number of values to read                */
             int   nultyp,     /* I - null value handling code:               */
                               /*     1: set undefined pixels = nulval        */
@@ -101,7 +101,7 @@ int ffgcll( fitsfile *fptr,   /* I - FITS file pointer                       */
     char tform[20];
     char message[FLEN_ERRMSG];
     char snull[20];   /*  the FITS null value  */
-    unsigned char buffer[DBUFFSIZE];
+    unsigned char buffer[DBUFFSIZE], *buffptr;
 
     if (*status > 0 || nelem == 0)  /* inherit input status value if > 0 */
         return(*status);
@@ -153,13 +153,15 @@ int ffgcll( fitsfile *fptr,   /* I - FITS file pointer                       */
 
       ffgi1b(fptr, readptr, ntodo, incre, buffer, status);
 
-      for (ii = 0; ii < ntodo; ii++, next++) /* convert from T or F to 1 or 0 */
+      /* convert from T or F to 1 or 0 */
+      buffptr = buffer;
+      for (ii = 0; ii < ntodo; ii++, next++, buffptr++)
       {
-        if (buffer[ii] == 'T')
+        if (*buffptr == 'T')
           array[next] = 1;
-        else if (buffer[ii] =='F') 
+        else if (*buffptr =='F') 
           array[next] = 0;
-        else
+        else if (*buffptr == 0)
         {
           array[next] = nulval;  /* set null values to input nulval */
           if (anynul)
@@ -167,9 +169,13 @@ int ffgcll( fitsfile *fptr,   /* I - FITS file pointer                       */
 
           if (nulcheck == 2)
           {
-            nularray[next] = 1;    /* set flags */
+            nularray[next] = 1;  /* set null flags */
           }
         }
+        else  /* some other illegal character; return the char value */
+        {
+          array[next] = (char) *buffptr;
+        }
       }
 
       if (*status > 0)  /* test for error during previous read operation */
@@ -211,9 +217,9 @@ int ffgcx(  fitsfile *fptr,  /* I - FITS file pointer                       */
             int  *status)    /* IO - error status                           */
 /*
   read an array of logical values from a specified bit or byte
-  column of the binary table.   If larray is TRUE, then the corresponding
-  bit is set to 1, otherwise it is set to 0.
-  The binary table column being read to must have datatype 'B' or 'X'. 
+  column of the binary table.    larray is set = TRUE, if the corresponding
+  bit = 1, otherwise it is set to FALSE.
+  The binary table column being read from must have datatype 'B' or 'X'. 
 */
 {
     OFF_T bstart;
@@ -281,7 +287,9 @@ int ffgcx(  fitsfile *fptr,  /* I - FITS file pointer                       */
         /* length arrays.  REPEAT is the number of BITS in the array. */
 
         ffgdes(fptr, colnum, frow, &repeat, &offset, status);
-        repeat = (repeat + 7) / 8;
+
+        if (tcode == -TBIT)
+            repeat = (repeat + 7) / 8;
 
         if ((fbit + nbit + 6) / 8 > repeat)
             return(*status = BAD_ELEM_NUM);
diff --git a/getcols.c b/getcols.c
index e545e92..b3c2520 100644
--- a/getcols.c
+++ b/getcols.c
@@ -74,11 +74,12 @@ int ffgcls( fitsfile *fptr,   /* I - FITS file pointer                       */
   Returns a formated string value, regardless of the datatype of the column
 */
 {
-    int tcode, hdutype, tstatus, scaled, intcol, dwidth;
+    int tcode, hdutype, tstatus, scaled, intcol, dwidth, nulwidth, ll;
     long ii, jj;
     tcolumn *colptr;
     char message[FLEN_ERRMSG], *carray, keyname[FLEN_KEYWORD];
     char cform[20], dispfmt[20], tmpstr[80];
+    unsigned char byteval;
     float *earray;
     double *darray, tscale = 1.0;
 
@@ -156,12 +157,15 @@ int ffgcls( fitsfile *fptr,   /* I - FITS file pointer                       */
          /* use the TDISPn keyword if it exists */
          ffkeyn("TDISP", colnum, keyname, status);
          tstatus = 0;
+         cform[0] = '\0';
+
          if (ffgkys(fptr, keyname, dispfmt, NULL, &tstatus) == 0)
          {
              /* convert the Fortran style format to a C style format */
              ffcdsp(dispfmt, cform);
          }
-         else
+
+         if (!cform[0])
              strcpy(cform, "%14.6E");
 
          /* write the formated string for each value:  "(real,imag)" */
@@ -216,16 +220,19 @@ int ffgcls( fitsfile *fptr,   /* I - FITS file pointer                       */
 
          ffgcdw(fptr, colnum, &dwidth, status);
          dwidth = (dwidth - 3) / 2;
- 
+
          /* use the TDISPn keyword if it exists */
          ffkeyn("TDISP", colnum, keyname, status);
          tstatus = 0;
+         cform[0] = '\0';
+ 
          if (ffgkys(fptr, keyname, dispfmt, NULL, &tstatus) == 0)
          {
              /* convert the Fortran style format to a C style format */
              ffcdsp(dispfmt, cform);
          }
-         else
+
+         if (!cform[0])
             strcpy(cform, "%23.15E");
 
          /* write the formated string for each value:  "(real,imag)" */
@@ -299,14 +306,16 @@ int ffgcls( fitsfile *fptr,   /* I - FITS file pointer                       */
 
       /* use the TDISPn keyword if it exists */
       ffkeyn("TDISP", colnum, keyname, status);
-
       tstatus = 0;
+      cform[0] = '\0';
+
       if (ffgkys(fptr, keyname, dispfmt, NULL, &tstatus) == 0)
       {
            /* convert the Fortran style TDISPn to a C style format */
            ffcdsp(dispfmt, cform);
       }
-      else
+
+      if (!cform[0])
       {
             /* no TDISPn keyword; use TFORMn instead */
 
@@ -316,12 +325,12 @@ int ffgcls( fitsfile *fptr,   /* I - FITS file pointer                       */
             if (scaled && tcode <= TSHORT)
             {
                   /* scaled short integer column == float */
-                  strcpy(cform, "%14.6G");
+                  strcpy(cform, "%#14.6G");
             }
             else if (scaled && tcode == TLONG)
             {
                   /* scaled long integer column == double */
-                  strcpy(cform, "%23.15G");
+                  strcpy(cform, "%#23.15G");
             }
             else
             {
@@ -334,29 +343,50 @@ int ffgcls( fitsfile *fptr,   /* I - FITS file pointer                       */
                else
                {
                  /* this is a binary table, need to convert the format */
-                  if (tcode <= TBYTE)          /* 'X' and 'B' */
+                  if (tcode == TBIT) {            /* 'X' */
                      strcpy(cform, "%4d");
-                  else if (tcode == TSHORT)    /* 'I' */
+                  } else if (tcode == TBYTE) {    /* 'B' */
+                     strcpy(cform, "%4d");
+                  } else if (tcode == TSHORT) {   /* 'I' */
                      strcpy(cform, "%6d");
-                  else if (tcode == TLONG)     /* 'J' */
-                     strcpy(cform, "%11d");
-                  else if (tcode == TFLOAT)    /* 'E' */
-                     strcpy(cform, "%14.6E");
-                  else if (tcode == TDOUBLE)   /* 'D' */
-                     strcpy(cform, "%23.15E");
+                  } else if (tcode == TLONG) {    /* 'J' */
+                     strcpy(cform, "%11.0f");
+                     intcol = 0;  /* needed to support unsigned int */
+                  } else if (tcode == TFLOAT) {   /* 'E' */
+                     strcpy(cform, "%#14.6G");
+                  } else if (tcode == TDOUBLE) {  /* 'D' */
+                     strcpy(cform, "%#23.15G");
+                  }
                }
             }
       } 
 
       /* write the formated string for each value */
+      nulwidth = strlen(nulval);
       for (ii = 0; ii < nelem; ii++)
       {
+           if (tcode == TBIT)
+           {
+               byteval = (char) darray[ii];
+
+               for (ll=0; ll < 8; ll++)
+               {
+                   if ( ((unsigned char) (byteval << ll)) >> 7 )
+                       *(array[ii] + ll) = '1';
+                   else
+                       *(array[ii] + ll) = '0';
+               }
+               *(array[ii] + 8) = '\0';
+           }
            /* test for null value */
-           if ( (nultyp == 1 && darray[ii] == DOUBLENULLVALUE) ||
+           else if ( (nultyp == 1 && darray[ii] == DOUBLENULLVALUE) ||
                 (nultyp == 2 && nularray[ii]) )
            {
               *array[ii] = '\0';
-              strncat(array[ii], "NULL", dwidth);
+              if (dwidth < nulwidth)
+                  strncat(array[ii], nulval, dwidth);
+              else
+                  sprintf(array[ii],"%*s",dwidth,nulval);
            }
            else
            {
@@ -410,21 +440,37 @@ int ffgcdw( fitsfile *fptr,   /* I - FITS file pointer                       */
     /* use the TDISPn keyword if it exists */
     ffkeyn("TDISP", colnum, keyname, status);
 
+    *width = 0;
     tstatus = 0;
     if (ffgkys(fptr, keyname, dispfmt, NULL, &tstatus) == 0)
     {
           /* parse TDISPn get the display width */
           cptr = dispfmt;
-          while(!isdigit((int) *cptr) && *cptr != '\0') /* find first digit */
+          while(*cptr == ' ') /* skip leading blanks */
               cptr++;
 
-          *width = atoi(cptr);
-          if (tcode >= TCOMPLEX)
+          if (*cptr == 'A' || *cptr == 'a' ||
+              *cptr == 'I' || *cptr == 'i' ||
+              *cptr == 'O' || *cptr == 'o' ||
+              *cptr == 'Z' || *cptr == 'z' ||
+              *cptr == 'F' || *cptr == 'f' ||
+              *cptr == 'E' || *cptr == 'e' ||
+              *cptr == 'D' || *cptr == 'd' ||
+              *cptr == 'G' || *cptr == 'g')
+          {
+
+            while(!isdigit((int) *cptr) && *cptr != '\0') /* find 1st digit */
+              cptr++;
+
+            *width = atoi(cptr);
+            if (tcode >= TCOMPLEX)
               *width = (2 * (*width)) + 3;
+          }
     }
-    else
+
+    if (*width == 0)
     {
-        /* no TDISPn keyword; use TFORMn instead */
+        /* no valid TDISPn keyword; use TFORMn instead */
 
         ffkeyn("TFORM", colnum, keyname, status);
         ffgkys(fptr, keyname, dispfmt, NULL, status);
@@ -442,12 +488,12 @@ int ffgcdw( fitsfile *fptr,   /* I - FITS file pointer                       */
 
         if (scaled && tcode <= TSHORT)
         {
-            /* scaled short integer col == float; default format is 14.6E */
+            /* scaled short integer col == float; default format is 14.6G */
             *width = 14;
         }
         else if (scaled && tcode == TLONG)
         {
-            /* scaled long integer col == double; default format is 23.15E */
+            /* scaled long integer col == double; default format is 23.15G */
             *width = 23;
         }
         else
@@ -465,7 +511,9 @@ int ffgcdw( fitsfile *fptr,   /* I - FITS file pointer                       */
            else
            {
                  /* this is a binary table */
-                  if (tcode <= TBYTE)          /* 'X' and 'B' */
+                  if (tcode == TBIT)           /* 'X' */
+                     *width = 8;
+                  else if (tcode == TBYTE)          /* 'B' */
                      *width = 4;
                   else if (tcode == TSHORT)    /* 'I' */
                      *width = 6;
@@ -488,6 +536,9 @@ int ffgcdw( fitsfile *fptr,   /* I - FITS file pointer                       */
                          cptr++;
 
                      *width = atoi(cptr);
+
+                     if (*width < 1)
+                         *width = 1;  /* default is at least 1 column */
                   }
             }
         }
diff --git a/getcolsb.c b/getcolsb.c
new file mode 100644
index 0000000..b04c679
--- /dev/null
+++ b/getcolsb.c
@@ -0,0 +1,2133 @@
+/*  This file, getcolsb.c, contains routines that read data elements from   */
+/*  a FITS image or table, with signed char (signed byte) data type.        */
+
+/*  The FITSIO software was written by William Pence at the High Energy    */
+/*  Astrophysic Science Archive Research Center (HEASARC) at the NASA      */
+/*  Goddard Space Flight Center.                                           */
+
+#include <math.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <string.h>
+#include "fitsio2.h"
+
+/*--------------------------------------------------------------------------*/
+int ffgpvsb(fitsfile *fptr,   /* I - FITS file pointer                       */
+            long  group,      /* I - group to read (1 = 1st group)           */
+            long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+            long  nelem,      /* I - number of values to read                */
+            signed char nulval, /* I - value for undefined pixels            */
+            signed char *array, /* O - array of values that are returned     */
+            int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+            int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being read).
+  Undefined elements will be set equal to NULVAL, unless NULVAL=0
+  in which case no checking for undefined values will be performed.
+  ANYNUL is returned with a value of .true. if any pixels are undefined.
+*/
+{
+    long row;
+    char cdummy;
+    int nullcheck = 1;
+    signed char nullvalue;
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+         nullvalue = nulval;  /* set local variable */
+
+        fits_read_compressed_pixels(fptr, TSBYTE, firstelem, nelem,
+            nullcheck, &nullvalue, array, NULL, anynul, status);
+        return(*status);
+    }
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    row=maxvalue(1,group);
+
+    ffgclsb(fptr, 2, row, firstelem, nelem, 1, 1, nulval,
+               array, &cdummy, anynul, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgpfsb(fitsfile *fptr,   /* I - FITS file pointer                       */
+            long  group,      /* I - group to read (1 = 1st group)           */
+            long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+            long  nelem,      /* I - number of values to read                */
+            signed char *array, /* O - array of values that are returned     */
+            char *nularray,   /* O - array of null pixel flags               */
+            int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+            int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being read).
+  Any undefined pixels in the returned array will be set = 0 and the 
+  corresponding nularray value will be set = 1.
+  ANYNUL is returned with a value of .true. if any pixels are undefined.
+*/
+{
+    long row;
+    int nullcheck = 2;
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        fits_read_compressed_pixels(fptr, TSBYTE, firstelem, nelem,
+            nullcheck, NULL, array, nularray, anynul, status);
+        return(*status);
+    }
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    row=maxvalue(1,group);
+
+    ffgclsb(fptr, 2, row, firstelem, nelem, 1, 2, 0,
+               array, nularray, anynul, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffg2dsb(fitsfile *fptr, /* I - FITS file pointer                       */
+           long  group,     /* I - group to read (1 = 1st group)           */
+           signed char nulval,   /* set undefined pixels equal to this     */
+           long  ncols,     /* I - number of pixels in each row of array   */
+           long  naxis1,    /* I - FITS image NAXIS1 value                 */
+           long  naxis2,    /* I - FITS image NAXIS2 value                 */
+           signed char *array,   /* O - array to be filled and returned    */
+           int  *anynul,    /* O - set to 1 if any values are null; else 0 */
+           int  *status)    /* IO - error status                           */
+/*
+  Read an entire 2-D array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being read).  Any null
+  values in the array will be set equal to the value of nulval, unless
+  nulval = 0 in which case no null checking will be performed.
+*/
+{
+    /* call the 3D reading routine, with the 3rd dimension = 1 */
+
+    ffg3dsb(fptr, group, nulval, ncols, naxis2, naxis1, naxis2, 1, array, 
+           anynul, status);
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffg3dsb(fitsfile *fptr, /* I - FITS file pointer                       */
+           long  group,     /* I - group to read (1 = 1st group)           */
+           signed char nulval,   /* set undefined pixels equal to this     */
+           long  ncols,     /* I - number of pixels in each row of array   */
+           long  nrows,     /* I - number of rows in each plane of array   */
+           long  naxis1,    /* I - FITS image NAXIS1 value                 */
+           long  naxis2,    /* I - FITS image NAXIS2 value                 */
+           long  naxis3,    /* I - FITS image NAXIS3 value                 */
+           signed char *array,   /* O - array to be filled and returned    */
+           int  *anynul,    /* O - set to 1 if any values are null; else 0 */
+           int  *status)    /* IO - error status                           */
+/*
+  Read an entire 3-D array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being read).  Any null
+  values in the array will be set equal to the value of nulval, unless
+  nulval = 0 in which case no null checking will be performed.
+*/
+{
+    long tablerow, nfits, narray, ii, jj;
+    char cdummy;
+    int  nullcheck = 1;
+    long inc[] = {1,1,1};
+    long fpixel[] = {1,1,1};
+    long lpixel[3];
+    signed char nullvalue;
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+        nullvalue = nulval;  /* set local variable */
+
+        fits_read_compressed_img(fptr, TSBYTE, fpixel, lpixel, inc,
+            nullcheck, &nullvalue, array, NULL, anynul, status);
+        return(*status);
+    }
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+    tablerow=maxvalue(1,group);
+
+    if (ncols == naxis1 && nrows == naxis2)  /* arrays have same size? */
+    {
+       /* all the image pixels are contiguous, so read all at once */
+       ffgclsb(fptr, 2, tablerow, 1, naxis1 * naxis2 * naxis3, 1, 1, nulval,
+               array, &cdummy, anynul, status);
+       return(*status);
+    }
+
+    if (ncols < naxis1 || nrows < naxis2)
+       return(*status = BAD_DIMEN);
+
+    nfits = 1;   /* next pixel in FITS image to read */
+    narray = 0;  /* next pixel in output array to be filled */
+
+    /* loop over naxis3 planes in the data cube */
+    for (jj = 0; jj < naxis3; jj++)
+    {
+      /* loop over the naxis2 rows in the FITS image, */
+      /* reading naxis1 pixels to each row            */
+
+      for (ii = 0; ii < naxis2; ii++)
+      {
+       if (ffgclsb(fptr, 2, tablerow, nfits, naxis1, 1, 1, nulval,
+          &array[narray], &cdummy, anynul, status) > 0)
+          return(*status);
+
+       nfits += naxis1;
+       narray += ncols;
+      }
+      narray += (nrows - naxis2) * ncols;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgsvsb(fitsfile *fptr, /* I - FITS file pointer                        */
+           int  colnum,    /* I - number of the column to read (1 = 1st)    */
+           int naxis,      /* I - number of dimensions in the FITS array    */
+           long  *naxes,   /* I - size of each dimension                    */
+           long  *blc,     /* I - 'bottom left corner' of the subsection    */
+           long  *trc,     /* I - 'top right corner' of the subsection      */
+           long  *inc,     /* I - increment to be applied in each dimension */
+           signed char nulval, /* I - value to set undefined pixels         */
+           signed char *array, /* O - array to be filled and returned       */
+           int  *anynul,   /* O - set to 1 if any values are null; else 0   */
+           int  *status)   /* IO - error status                             */
+/*
+  Read a subsection of data values from an image or a table column.
+  This routine is set up to handle a maximum of nine dimensions.
+*/
+{
+    long ii, i0, i1, i2, i3, i4, i5, i6, i7, i8, row, rstr, rstp, rinc;
+    long str[9], stp[9], incr[9], dir[9];
+    long nelem, nultyp, ninc, numcol;
+    OFF_T felem, dsize[10];
+    int hdutype, anyf;
+    char ldummy, msg[FLEN_ERRMSG];
+    int  nullcheck = 1;
+    signed char nullvalue;
+
+    if (naxis < 1 || naxis > 9)
+    {
+        sprintf(msg, "NAXIS = %d in call to ffgsvsb is out of range", naxis);
+        ffpmsg(msg);
+        return(*status = BAD_DIMEN);
+    }
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        nullvalue = nulval;  /* set local variable */
+
+        fits_read_compressed_img(fptr, TSBYTE, blc, trc, inc,
+            nullcheck, &nullvalue, array, NULL, anynul, status);
+        return(*status);
+    }
+
+/*
+    if this is a primary array, then the input COLNUM parameter should
+    be interpreted as the row number, and we will alway read the image
+    data from column 2 (any group parameters are in column 1).
+*/
+    if (ffghdt(fptr, &hdutype, status) > 0)
+        return(*status);
+
+    if (hdutype == IMAGE_HDU)
+    {
+        /* this is a primary array, or image extension */
+        if (colnum == 0)
+        {
+            rstr = 1;
+            rstp = 1;
+        }
+        else
+        {
+            rstr = colnum;
+            rstp = colnum;
+        }
+        rinc = 1;
+        numcol = 2;
+    }
+    else
+    {
+        /* this is a table, so the row info is in the (naxis+1) elements */
+        rstr = blc[naxis];
+        rstp = trc[naxis];
+        rinc = inc[naxis];
+        numcol = colnum;
+    }
+
+    nultyp = 1;
+    if (anynul)
+        *anynul = FALSE;
+
+    i0 = 0;
+    for (ii = 0; ii < 9; ii++)
+    {
+        str[ii] = 1;
+        stp[ii] = 1;
+        incr[ii] = 1;
+        dsize[ii] = 1;
+        dir[ii] = 1;
+    }
+
+    for (ii = 0; ii < naxis; ii++)
+    {
+      if (trc[ii] < blc[ii])
+      {
+        if (hdutype == IMAGE_HDU)
+        {
+           dir[ii] = -1;
+        }
+        else
+        {
+          sprintf(msg, "ffgsvsb: illegal range specified for axis %ld", ii + 1);
+          ffpmsg(msg);
+          return(*status = BAD_PIX_NUM);
+        }
+      }
+
+      str[ii] = blc[ii];
+      stp[ii] = trc[ii];
+      incr[ii] = inc[ii];
+      dsize[ii + 1] = dsize[ii] * naxes[ii];
+      dsize[ii] = dsize[ii] * dir[ii];
+    }
+    dsize[naxis] = dsize[naxis] * dir[naxis];
+
+    if (naxis == 1 && naxes[0] == 1)
+    {
+      /* This is not a vector column, so read all the rows at once */
+      nelem = (rstp - rstr) / rinc + 1;
+      ninc = rinc;
+      rstp = rstr;
+    }
+    else
+    {
+      /* have to read each row individually, in all dimensions */
+      nelem = (stp[0]*dir[0] - str[0]*dir[0]) / inc[0] + 1;
+      ninc = incr[0] * dir[0];
+    }
+
+    for (row = rstr; row <= rstp; row += rinc)
+    {
+     for (i8 = str[8]*dir[8]; i8 <= stp[8]*dir[8]; i8 += incr[8])
+     {
+      for (i7 = str[7]*dir[7]; i7 <= stp[7]*dir[7]; i7 += incr[7])
+      {
+       for (i6 = str[6]*dir[6]; i6 <= stp[6]*dir[6]; i6 += incr[6])
+       {
+        for (i5 = str[5]*dir[5]; i5 <= stp[5]*dir[5]; i5 += incr[5])
+        {
+         for (i4 = str[4]*dir[4]; i4 <= stp[4]*dir[4]; i4 += incr[4])
+         {
+          for (i3 = str[3]*dir[3]; i3 <= stp[3]*dir[3]; i3 += incr[3])
+          {
+           for (i2 = str[2]*dir[2]; i2 <= stp[2]*dir[2]; i2 += incr[2])
+           {
+            for (i1 = str[1]*dir[1]; i1 <= stp[1]*dir[1]; i1 += incr[1])
+            {
+
+              felem=str[0] + (i1 - dir[1]) * dsize[1] + (i2 - dir[2]) * dsize[2] + 
+                             (i3 - dir[3]) * dsize[3] + (i4 - dir[4]) * dsize[4] +
+                             (i5 - dir[5]) * dsize[5] + (i6 - dir[6]) * dsize[6] +
+                             (i7 - dir[7]) * dsize[7] + (i8 - dir[8]) * dsize[8];
+
+              if ( ffgclsb(fptr, numcol, row, felem, nelem, ninc, nultyp,
+                   nulval, &array[i0], &ldummy, &anyf, status) > 0)
+                   return(*status);
+
+              if (anyf && anynul)
+                  *anynul = TRUE;
+
+              i0 += nelem;
+            }
+           }
+          }
+         }
+        }
+       }
+      }
+     }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgsfsb(fitsfile *fptr, /* I - FITS file pointer                        */
+           int  colnum,    /* I - number of the column to read (1 = 1st)    */
+           int naxis,      /* I - number of dimensions in the FITS array    */
+           long  *naxes,   /* I - size of each dimension                    */
+           long  *blc,     /* I - 'bottom left corner' of the subsection    */
+           long  *trc,     /* I - 'top right corner' of the subsection      */
+           long  *inc,     /* I - increment to be applied in each dimension */
+           signed char *array,   /* O - array to be filled and returned     */
+           char *flagval,  /* O - set to 1 if corresponding value is null   */
+           int  *anynul,   /* O - set to 1 if any values are null; else 0   */
+           int  *status)   /* IO - error status                             */
+/*
+  Read a subsection of data values from an image or a table column.
+  This routine is set up to handle a maximum of nine dimensions.
+*/
+{
+    long ii,i0, i1,i2,i3,i4,i5,i6,i7,i8,row,rstr,rstp,rinc;
+    long str[9],stp[9],incr[9],dsize[10];
+    long felem, nelem, nultyp, ninc, numcol;
+    int hdutype, anyf;
+    signed char nulval = 0;
+    char msg[FLEN_ERRMSG];
+    int  nullcheck = 2;
+
+    if (naxis < 1 || naxis > 9)
+    {
+        sprintf(msg, "NAXIS = %d in call to ffgsvsb is out of range", naxis);
+        ffpmsg(msg);
+        return(*status = BAD_DIMEN);
+    }
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        fits_read_compressed_img(fptr, TSBYTE, blc, trc, inc,
+            nullcheck, NULL, array, flagval, anynul, status);
+        return(*status);
+    }
+
+/*
+    if this is a primary array, then the input COLNUM parameter should
+    be interpreted as the row number, and we will alway read the image
+    data from column 2 (any group parameters are in column 1).
+*/
+    if (ffghdt(fptr, &hdutype, status) > 0)
+        return(*status);
+
+    if (hdutype == IMAGE_HDU)
+    {
+        /* this is a primary array, or image extension */
+        if (colnum == 0)
+        {
+            rstr = 1;
+            rstp = 1;
+        }
+        else
+        {
+            rstr = colnum;
+            rstp = colnum;
+        }
+        rinc = 1;
+        numcol = 2;
+    }
+    else
+    {
+        /* this is a table, so the row info is in the (naxis+1) elements */
+        rstr = blc[naxis];
+        rstp = trc[naxis];
+        rinc = inc[naxis];
+        numcol = colnum;
+    }
+
+    nultyp = 2;
+    if (anynul)
+        *anynul = FALSE;
+
+    i0 = 0;
+    for (ii = 0; ii < 9; ii++)
+    {
+        str[ii] = 1;
+        stp[ii] = 1;
+        incr[ii] = 1;
+        dsize[ii] = 1;
+    }
+
+    for (ii = 0; ii < naxis; ii++)
+    {
+      if (trc[ii] < blc[ii])
+      {
+        sprintf(msg, "ffgsvsb: illegal range specified for axis %ld", ii + 1);
+        ffpmsg(msg);
+        return(*status = BAD_PIX_NUM);
+      }
+
+      str[ii] = blc[ii];
+      stp[ii] = trc[ii];
+      incr[ii] = inc[ii];
+      dsize[ii + 1] = dsize[ii] * naxes[ii];
+    }
+
+    if (naxis == 1 && naxes[0] == 1)
+    {
+      /* This is not a vector column, so read all the rows at once */
+      nelem = (rstp - rstr) / rinc + 1;
+      ninc = rinc;
+      rstp = rstr;
+    }
+    else
+    {
+      /* have to read each row individually, in all dimensions */
+      nelem = (stp[0] - str[0]) / inc[0] + 1;
+      ninc = incr[0];
+    }
+
+    for (row = rstr; row <= rstp; row += rinc)
+    {
+     for (i8 = str[8]; i8 <= stp[8]; i8 += incr[8])
+     {
+      for (i7 = str[7]; i7 <= stp[7]; i7 += incr[7])
+      {
+       for (i6 = str[6]; i6 <= stp[6]; i6 += incr[6])
+       {
+        for (i5 = str[5]; i5 <= stp[5]; i5 += incr[5])
+        {
+         for (i4 = str[4]; i4 <= stp[4]; i4 += incr[4])
+         {
+          for (i3 = str[3]; i3 <= stp[3]; i3 += incr[3])
+          {
+           for (i2 = str[2]; i2 <= stp[2]; i2 += incr[2])
+           {
+            for (i1 = str[1]; i1 <= stp[1]; i1 += incr[1])
+            {
+              felem=str[0] + (i1 - 1) * dsize[1] + (i2 - 1) * dsize[2] + 
+                             (i3 - 1) * dsize[3] + (i4 - 1) * dsize[4] +
+                             (i5 - 1) * dsize[5] + (i6 - 1) * dsize[6] +
+                             (i7 - 1) * dsize[7] + (i8 - 1) * dsize[8];
+
+              if ( ffgclsb(fptr, numcol, row, felem, nelem, ninc, nultyp,
+                   nulval, &array[i0], &flagval[i0], &anyf, status) > 0)
+                   return(*status);
+
+              if (anyf && anynul)
+                  *anynul = TRUE;
+
+              i0 += nelem;
+            }
+           }
+          }
+         }
+        }
+       }
+      }
+     }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffggpsb( fitsfile *fptr,   /* I - FITS file pointer                       */
+            long  group,      /* I - group to read (1 = 1st group)           */
+            long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+            long  nelem,      /* I - number of values to read                */
+            signed char *array,   /* O - array of values that are returned   */
+            int  *status)     /* IO - error status                           */
+/*
+  Read an array of group parameters from the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being read).
+*/
+{
+    long row;
+    int idummy;
+    char cdummy;
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    row=maxvalue(1,group);
+
+    ffgclsb(fptr, 1, row, firstelem, nelem, 1, 1, 0,
+               array, &cdummy, &idummy, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgcvsb(fitsfile *fptr,  /* I - FITS file pointer                       */
+           int  colnum,      /* I - number of column to read (1 = 1st col)  */
+           long  firstrow,   /* I - first row to read (1 = 1st row)         */
+           long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+           long  nelem,      /* I - number of values to read                */
+           signed char nulval,   /* I - value for null pixels               */
+           signed char *array,   /* O - array of values that are read       */
+           int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+           int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from a column in the current FITS HDU. Automatic
+  datatype conversion will be performed if the datatype of the column does not
+  match the datatype of the array parameter. The output values will be scaled 
+  by the FITS TSCALn and TZEROn values if these values have been defined.
+  Any undefined pixels will be set equal to the value of 'nulval' unless
+  nulval = 0 in which case no checks for undefined pixels will be made.
+*/
+{
+    char cdummy;
+
+    ffgclsb(fptr, colnum, firstrow, firstelem, nelem, 1, 1, nulval,
+           array, &cdummy, anynul, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgcfsb(fitsfile *fptr,  /* I - FITS file pointer                       */
+           int  colnum,      /* I - number of column to read (1 = 1st col)  */
+           long  firstrow,   /* I - first row to read (1 = 1st row)         */
+           long  firstelem,  /* I - first vector element to read (1 = 1st)  */
+           long  nelem,      /* I - number of values to read                */
+           signed char *array,   /* O - array of values that are read       */
+           char *nularray,   /* O - array of flags: 1 if null pixel; else 0 */
+           int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+           int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from a column in the current FITS HDU. Automatic
+  datatype conversion will be performed if the datatype of the column does not
+  match the datatype of the array parameter. The output values will be scaled 
+  by the FITS TSCALn and TZEROn values if these values have been defined.
+  Nularray will be set = 1 if the corresponding array pixel is undefined, 
+  otherwise nularray will = 0.
+*/
+{
+    signed char dummy = 0;
+
+    ffgclsb(fptr, colnum, firstrow, firstelem, nelem, 1, 2, dummy,
+           array, nularray, anynul, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffgclsb(fitsfile *fptr,   /* I - FITS file pointer                       */
+            int  colnum,      /* I - number of column to read (1 = 1st col)  */
+            long  firstrow,   /* I - first row to read (1 = 1st row)         */
+            OFF_T firstelem,  /* I - first vector element to read (1 = 1st)  */
+            long  nelem,      /* I - number of values to read                */
+            long  elemincre,  /* I - pixel increment; e.g., 2 = every other  */
+            int   nultyp,     /* I - null value handling code:               */
+                              /*     1: set undefined pixels = nulval        */
+                              /*     2: set nularray=1 for undefined pixels  */
+            signed char nulval,   /* I - value for null pixels if nultyp = 1 */
+            signed char *array,   /* O - array of values that are read       */
+            char *nularray,   /* O - array of flags = 1 if nultyp = 2        */
+            int  *anynul,     /* O - set to 1 if any values are null; else 0 */
+            int  *status)     /* IO - error status                           */
+/*
+  Read an array of values from a column in the current FITS HDU.
+  The column number may refer to a real column in an ASCII or binary table, 
+  or it may refer be a virtual column in a 1 or more grouped FITS primary
+  array or image extension.  FITSIO treats a primary array as a binary table
+  with 2 vector columns: the first column contains the group parameters (often
+  with length = 0) and the second column contains the array of image pixels.
+  Each row of the table represents a group in the case of multigroup FITS
+  images.
+
+  The output array of values will be converted from the datatype of the column 
+  and will be scaled by the FITS TSCALn and TZEROn values if necessary.
+*/
+{
+    double scale, zero, power = 1.;
+    int tcode, maxelem, hdutype, xcode, decimals;
+    long twidth, incre, rownum, remain, next, ntodo;
+    long ii, rowincre, tnull, xwidth;
+    int nulcheck, readcheck = 0;
+    OFF_T repeat, startpos, elemnum, readptr, rowlen;
+    char tform[20];
+    char message[81];
+    char snull[20];   /*  the FITS null value if reading from ASCII table  */
+
+    double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */
+    void *buffer;
+
+    union u_tag {
+       char charval;
+       signed char scharval;
+    } u;
+
+    if (*status > 0 || nelem == 0)  /* inherit input status value if > 0 */
+        return(*status);
+
+    buffer = cbuff;
+
+    if (anynul)
+        *anynul = 0;
+
+    if (nultyp == 2)      
+       memset(nularray, 0, nelem);   /* initialize nullarray */
+
+    /*---------------------------------------------------*/
+    /*  Check input and get parameters about the column: */
+    /*---------------------------------------------------*/
+    if (elemincre < 0)
+        readcheck = -1;  /* don't do range checking in this case */
+
+    ffgcpr( fptr, colnum, firstrow, firstelem, nelem, readcheck, &scale, &zero,
+         tform, &twidth, &tcode, &maxelem, &startpos, &elemnum, &incre,
+         &repeat, &rowlen, &hdutype, &tnull, snull, status);
+
+    /* special case: read column of T/F logicals */
+    if (tcode == TLOGICAL && elemincre == 1)
+    {
+        u.scharval = nulval;
+        ffgcll(fptr, colnum, firstrow, firstelem, nelem, nultyp,
+               u.charval, (char *) array, nularray, anynul, status);
+
+        return(*status);
+    }
+
+    if (strchr(tform,'A') != NULL) 
+    {
+        if (*status == BAD_ELEM_NUM)
+        {
+            /* ignore this error message */
+            *status = 0;
+            ffcmsg();   /* clear error stack */
+        }
+
+        /*  interpret a 'A' ASCII column as a 'B' byte column ('8A' == '8B') */
+        /*  This is an undocumented 'feature' in CFITSIO */
+
+        /*  we have to reset some of the values returned by ffgcpr */
+        
+        tcode = TBYTE;
+        incre = 1;         /* each element is 1 byte wide */
+        repeat = twidth;   /* total no. of chars in the col */
+        twidth = 1;        /* width of each element */
+        scale = 1.0;       /* no scaling */
+        zero  = 0.0;
+        tnull = NULL_UNDEFINED;  /* don't test for nulls */
+        maxelem = DBUFFSIZE;
+    }
+
+    if (*status > 0)
+        return(*status);
+        
+    incre *= elemincre;   /* multiply incre to just get every nth pixel */
+
+    if (tcode == TSTRING && hdutype == ASCII_TBL) /* setup for ASCII tables */
+    {
+      /* get the number of implied decimal places if no explicit decmal point */
+      ffasfm(tform, &xcode, &xwidth, &decimals, status); 
+      for(ii = 0; ii < decimals; ii++)
+        power *= 10.;
+    }
+    /*------------------------------------------------------------------*/
+    /*  Decide whether to check for null values in the input FITS file: */
+    /*------------------------------------------------------------------*/
+    nulcheck = nultyp; /* by default, check for null values in the FITS file */
+
+    if (nultyp == 1 && nulval == 0)
+       nulcheck = 0;    /* calling routine does not want to check for nulls */
+
+    else if (tcode%10 == 1 &&        /* if reading an integer column, and  */ 
+            tnull == NULL_UNDEFINED) /* if a null value is not defined,    */
+            nulcheck = 0;            /* then do not check for null values. */
+
+    else if (tcode == TSHORT && (tnull > SHRT_MAX || tnull < SHRT_MIN) )
+            nulcheck = 0;            /* Impossible null value */
+
+    else if (tcode == TBYTE && (tnull > 255 || tnull < 0) )
+            nulcheck = 0;            /* Impossible null value */
+
+    else if (tcode == TSTRING && snull[0] == ASCII_NULL_UNDEFINED)
+         nulcheck = 0;
+
+    /*---------------------------------------------------------------------*/
+    /*  Now read the pixels from the FITS column. If the column does not   */
+    /*  have the same datatype as the output array, then we have to read   */
+    /*  the raw values into a temporary buffer (of limited size).  In      */
+    /*  the case of a vector colum read only 1 vector of values at a time  */
+    /*  then skip to the next row if more values need to be read.          */
+    /*  After reading the raw values, then call the fffXXYY routine to (1) */
+    /*  test for undefined values, (2) convert the datatype if necessary,  */
+    /*  and (3) scale the values by the FITS TSCALn and TZEROn linear      */
+    /*  scaling parameters.                                                */
+    /*---------------------------------------------------------------------*/
+    remain = nelem;           /* remaining number of values to read */
+    next = 0;                 /* next element in array to be read   */
+    rownum = 0;               /* row number, relative to firstrow   */
+
+    while (remain)
+    {
+        /* limit the number of pixels to read at one time to the number that
+           will fit in the buffer or to the number of pixels that remain in
+           the current vector, which ever is smaller.
+        */
+        ntodo = minvalue(remain, maxelem);
+        if (elemincre >= 0)
+        {
+          ntodo = minvalue(ntodo, ((repeat - elemnum - 1)/elemincre +1));
+        }
+        else
+        {
+          ntodo = minvalue(ntodo, (elemnum/(-elemincre) +1));
+        }
+
+        readptr = startpos + ((OFF_T)rownum * rowlen) + (elemnum * (incre / elemincre));
+
+        switch (tcode) 
+        {
+            case (TBYTE):
+                ffgi1b(fptr, readptr, ntodo, incre, (unsigned char *) &array[next], status);
+                fffi1s1((unsigned char *)&array[next], ntodo, scale, zero,
+                        nulcheck, (unsigned char) tnull, nulval, &nularray[next], 
+                        anynul, &array[next], status);
+                break;
+            case (TSHORT):
+                ffgi2b(fptr, readptr, ntodo, incre, (short *) buffer, status);
+                fffi2s1((short  *) buffer, ntodo, scale, zero, nulcheck, 
+                       (short) tnull, nulval, &nularray[next], anynul, 
+                       &array[next], status);
+                break;
+            case (TLONG):
+                ffgi4b(fptr, readptr, ntodo, incre, (INT32BIT *) buffer,
+                       status);
+                fffi4s1((INT32BIT *) buffer, ntodo, scale, zero, nulcheck, 
+                       (INT32BIT) tnull, nulval, &nularray[next], anynul, 
+                       &array[next], status);
+                break;
+            case (TLONGLONG):
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8s1( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
+            case (TFLOAT):
+                ffgr4b(fptr, readptr, ntodo, incre, (float  *) buffer, status);
+                fffr4s1((float  *) buffer, ntodo, scale, zero, nulcheck, 
+                       nulval, &nularray[next], anynul, 
+                       &array[next], status);
+                break;
+            case (TDOUBLE):
+                ffgr8b(fptr, readptr, ntodo, incre, (double *) buffer, status);
+                fffr8s1((double *) buffer, ntodo, scale, zero, nulcheck, 
+                          nulval, &nularray[next], anynul, 
+                          &array[next], status);
+                break;
+            case (TSTRING):
+                ffmbyt(fptr, readptr, REPORT_EOF, status);
+       
+                if (incre == twidth)    /* contiguous bytes */
+                     ffgbyt(fptr, ntodo * twidth, buffer, status);
+                else
+                     ffgbytoff(fptr, twidth, ntodo, incre - twidth, buffer,
+                               status);
+
+                /* interpret the string as an ASCII formated number */
+                fffstrs1((char *) buffer, ntodo, scale, zero, twidth, power,
+                      nulcheck, snull, nulval, &nularray[next], anynul,
+                      &array[next], status);
+                break;
+
+            default:  /*  error trap for invalid column format */
+                sprintf(message, 
+                   "Cannot read bytes from column %d which has format %s",
+                    colnum, tform);
+                ffpmsg(message);
+                if (hdutype == ASCII_TBL)
+                    return(*status = BAD_ATABLE_FORMAT);
+                else
+                    return(*status = BAD_BTABLE_FORMAT);
+
+        } /* End of switch block */
+
+        /*-------------------------*/
+        /*  Check for fatal error  */
+        /*-------------------------*/
+        if (*status > 0)  /* test for error during previous read operation */
+        {
+          if (hdutype > 0)
+            sprintf(message,
+            "Error reading elements %ld thru %ld from column %d (ffgclsb).",
+              next+1, next+ntodo, colnum);
+          else
+            sprintf(message,
+            "Error reading elements %ld thru %ld from image (ffgclsb).",
+              next+1, next+ntodo);
+
+         ffpmsg(message);
+         return(*status);
+        }
+
+        /*--------------------------------------------*/
+        /*  increment the counters for the next loop  */
+        /*--------------------------------------------*/
+        remain -= ntodo;
+        if (remain)
+        {
+            next += ntodo;
+            elemnum = elemnum + (ntodo * elemincre);
+
+            if (elemnum >= repeat)  /* completed a row; start on later row */
+            {
+                rowincre = elemnum / repeat;
+                rownum += rowincre;
+                elemnum = elemnum - (rowincre * repeat);
+            }
+            else if (elemnum < 0)  /* completed a row; start on a previous row */
+            {
+                rowincre = (-elemnum - 1) / repeat + 1;
+                rownum -= rowincre;
+                elemnum = (rowincre * repeat) + elemnum;
+            }
+        }
+    }  /*  End of main while Loop  */
+
+
+    /*--------------------------------*/
+    /*  check for numerical overflow  */
+    /*--------------------------------*/
+    if (*status == OVERFLOW_ERR)
+    {
+        ffpmsg(
+        "Numerical overflow during type conversion while reading FITS data.");
+        *status = NUM_OVERFLOW;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffi1s1(unsigned char *input, /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            unsigned char tnull,  /* I - value of FITS TNULLn keyword if any */
+            signed char nullval,  /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            signed char *output,  /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == -128.)
+        {
+            /* Instead of subtracting 128, it is more efficient */
+            /* to just flip the sign bit with the XOR operator */
+
+            for (ii = 0; ii < ntodo; ii++)
+                 output[ii] =  ( *(signed char *) &input[ii] ) ^ 0x80;
+        }
+        else if (scale == 1. && zero == 0.)      /* no scaling */
+        { 
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] > 127)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) input[ii]; /* copy input */
+            }
+        }
+        else             /* must scale the data */
+        {                
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (dvalue > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == -128.)
+        {
+            /* Instead of subtracting 128, it is more efficient */
+            /* to just flip the sign bit with the XOR operator */
+
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                    output[ii] =  ( *(signed char *) &input[ii] ) ^ 0x80;
+            }
+        }
+        else if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                    output[ii] = (signed char) input[ii];
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (dvalue > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffi2s1(short *input,         /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            short tnull,          /* I - value of FITS TNULLn keyword if any */
+            signed char nullval,  /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            signed char *output,  /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < -128)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (input[ii] > 127)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (dvalue > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+
+                else
+                {
+                    if (input[ii] < -128)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (input[ii] > 127)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (dvalue > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffi4s1(INT32BIT *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            INT32BIT tnull,       /* I - value of FITS TNULLn keyword if any */
+            signed char nullval,  /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            signed char *output,  /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < -128)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (input[ii] > 127)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (dvalue > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < -128)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (input[ii] > 127)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (dvalue > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffi8s1(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+            signed char nullval,  /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            signed char *output,  /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    long ii,jj, kk;
+    double dvalue;
+    unsigned long *uinput;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue < DSCHAR_MIN )
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (dvalue > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                if (dvalue < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (dvalue > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  if (dvalue < DSCHAR_MIN)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                  }
+                  else if (dvalue > DSCHAR_MAX)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                  }
+                  else
+                    output[ii] = (signed char) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = dvalue * scale + zero;
+
+                    if (dvalue < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (dvalue > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) dvalue;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < -128)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (input[ii] > 127)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (dvalue > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < -128)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (input[ii] > 127)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (dvalue > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) dvalue;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffr4s1(float *input,         /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            signed char nullval,  /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            signed char *output,  /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to NaN.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+    short *sptr, iret;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (input[ii] > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (dvalue > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        sptr = (short *) input;
+
+#if BYTESWAPPED && MACHINE != VAXVMS && MACHINE != ALPHAVMS
+        sptr++;       /* point to MSBs */
+#endif
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, sptr += 2)
+            {
+              /* use redundant boolean logic in following statement */
+              /* to suppress irritating Borland compiler warning message */
+              if (0 != (iret = fnan(*sptr) ) )  /* test for NaN or underflow */
+              {
+                  if (iret == 1)  /* is it a NaN? */
+                  {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                  }
+                  else            /* it's an underflow */
+                     output[ii] = 0;
+              }
+              else
+                {
+                    if (input[ii] < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (input[ii] > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, sptr += 2)
+            {
+              if (0 != (iret = fnan(*sptr) ) )  /* test for NaN or underflow */
+              {
+                  if (iret == 1)  /* is it a NaN? */
+                  {  
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                  }
+                  else            /* it's an underflow */
+                  {
+                    if (zero < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (zero > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) zero;
+                  }
+              }
+              else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (dvalue > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffr8s1(double *input,        /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            signed char nullval,  /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            signed char *output,  /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to NaN.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    long ii;
+    double dvalue;
+    short *sptr, iret;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (input[ii] > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DSCHAR_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = -128;
+                }
+                else if (dvalue > DSCHAR_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 127;
+                }
+                else
+                    output[ii] = (signed char) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        sptr = (short *) input;
+
+#if BYTESWAPPED && MACHINE != VAXVMS && MACHINE != ALPHAVMS
+        sptr += 3;       /* point to MSBs */
+#endif
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, sptr += 4)
+            {
+              if (0 != (iret = dnan(*sptr)) )  /* test for NaN or underflow */
+              {
+                  if (iret == 1)  /* is it a NaN? */
+                  {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                  }
+                  else            /* it's an underflow */
+                     output[ii] = 0;
+              }
+              else
+                {
+                    if (input[ii] < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (input[ii] > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, sptr += 4)
+            {
+              if (0 != (iret = dnan(*sptr)) )  /* test for NaN or underflow */
+              {
+                  if (iret == 1)  /* is it a NaN? */
+                  {  
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                  }
+                  else            /* it's an underflow */
+                  {
+                    if (zero < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (zero > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) zero;
+                  }
+              }
+              else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DSCHAR_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = -128;
+                    }
+                    else if (dvalue > DSCHAR_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 127;
+                    }
+                    else
+                        output[ii] = (signed char) dvalue;
+                }
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fffstrs1(char *input,         /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            long twidth,          /* I - width of each substring of chars    */
+            double implipower,    /* I - power of 10 of implied decimal      */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            char  *snull,         /* I - value of FITS null string, if any   */
+            signed char nullval,  /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+            signed char *output,  /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file. Check
+  for null values and do scaling if required. The nullcheck code value
+  determines how any null values in the input array are treated. A null
+  value is an input pixel that is equal to snull.  If nullcheck= 0, then
+  no special checking for nulls is performed.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+    int  nullen;
+    long ii;
+    double dvalue;
+    char *cstring, message[81];
+    char *cptr, *tpos;
+    char tempstore, chrzero = '0';
+    double val, power;
+    int exponent, sign, esign, decpt;
+
+    nullen = strlen(snull);
+    cptr = input;  /* pointer to start of input string */
+    for (ii = 0; ii < ntodo; ii++)
+    {
+      cstring = cptr;
+      /* temporarily insert a null terminator at end of the string */
+      tpos = cptr + twidth;
+      tempstore = *tpos;
+      *tpos = 0;
+
+      /* check if null value is defined, and if the    */
+      /* column string is identical to the null string */
+      if (snull[0] != ASCII_NULL_UNDEFINED && 
+         !strncmp(snull, cptr, nullen) )
+      {
+        if (nullcheck)  
+        {
+          *anynull = 1;    
+          if (nullcheck == 1)
+            output[ii] = nullval;
+          else
+            nullarray[ii] = 1;
+        }
+        cptr += twidth;
+      }
+      else
+      {
+        /* value is not the null value, so decode it */
+        /* remove any embedded blank characters from the string */
+
+        decpt = 0;
+        sign = 1;
+        val  = 0.;
+        power = 1.;
+        exponent = 0;
+        esign = 1;
+
+        while (*cptr == ' ')               /* skip leading blanks */
+           cptr++;
+
+        if (*cptr == '-' || *cptr == '+')  /* check for leading sign */
+        {
+          if (*cptr == '-')
+             sign = -1;
+
+          cptr++;
+
+          while (*cptr == ' ')         /* skip blanks between sign and value */
+            cptr++;
+        }
+
+        while (*cptr >= '0' && *cptr <= '9')
+        {
+          val = val * 10. + *cptr - chrzero;  /* accumulate the value */
+          cptr++;
+
+          while (*cptr == ' ')         /* skip embedded blanks in the value */
+            cptr++;
+        }
+
+        if (*cptr == '.')              /* check for decimal point */
+        {
+          decpt = 1;
+          cptr++;
+          while (*cptr == ' ')         /* skip any blanks */
+            cptr++;
+
+          while (*cptr >= '0' && *cptr <= '9')
+          {
+            val = val * 10. + *cptr - chrzero;  /* accumulate the value */
+            power = power * 10.;
+            cptr++;
+
+            while (*cptr == ' ')         /* skip embedded blanks in the value */
+              cptr++;
+          }
+        }
+
+        if (*cptr == 'E' || *cptr == 'D')  /* check for exponent */
+        {
+          cptr++;
+          while (*cptr == ' ')         /* skip blanks */
+              cptr++;
+  
+          if (*cptr == '-' || *cptr == '+')  /* check for exponent sign */
+          {
+            if (*cptr == '-')
+               esign = -1;
+
+            cptr++;
+
+            while (*cptr == ' ')        /* skip blanks between sign and exp */
+              cptr++;
+          }
+
+          while (*cptr >= '0' && *cptr <= '9')
+          {
+            exponent = exponent * 10 + *cptr - chrzero;  /* accumulate exp */
+            cptr++;
+
+            while (*cptr == ' ')         /* skip embedded blanks */
+              cptr++;
+          }
+        }
+
+        if (*cptr  != 0)  /* should end up at the null terminator */
+        {
+          sprintf(message, "Cannot read number from ASCII table");
+          ffpmsg(message);
+          sprintf(message, "Column field = %s.", cstring);
+          ffpmsg(message);
+          /* restore the char that was overwritten by the null */
+          *tpos = tempstore;
+          return(*status = BAD_C2D);
+        }
+
+        if (!decpt)  /* if no explicit decimal, use implied */
+           power = implipower;
+
+        dvalue = (sign * val / power) * pow(10., (double) (esign * exponent));
+
+        dvalue = dvalue * scale + zero;   /* apply the scaling */
+
+        if (dvalue < DSCHAR_MIN)
+        {
+            *status = OVERFLOW_ERR;
+            output[ii] = -128;
+        }
+        else if (dvalue > DSCHAR_MAX)
+        {
+            *status = OVERFLOW_ERR;
+            output[ii] = 127;
+        }
+        else
+            output[ii] = (signed char) dvalue;
+      }
+      /* restore the char that was overwritten by the null */
+      *tpos = tempstore;
+    }
+    return(*status);
+}
diff --git a/getcolui.c b/getcolui.c
index 24d4af4..7852aa4 100644
--- a/getcolui.c
+++ b/getcolui.c
@@ -741,6 +741,13 @@ int ffgclui( fitsfile *fptr,   /* I - FITS file pointer                       */
                        zero, nulcheck, (short) tnull, nulval, &nularray[next],
                        anynul, &array[next], status);
                 break;
+            case (TLONGLONG):
+
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8u2( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TBYTE):
                 ffgi1b(fptr, readptr, ntodo, incre, (unsigned char *) buffer,
                       status);
@@ -1239,6 +1246,299 @@ int fffi4u2(INT32BIT *input,      /* I - array of values to be converted     */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8u2(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+   unsigned short nullval,        /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+   unsigned short *output,        /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    long ii,jj,kk;
+    double dvalue;
+    unsigned long *uinput;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue < DUSHRT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUSHRT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = USHRT_MAX;
+                }
+                else
+                    output[ii] = (unsigned short) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                if (dvalue < DUSHRT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUSHRT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = USHRT_MAX;
+                }
+                else
+                    output[ii] = (unsigned short) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  if (dvalue < DUSHRT_MIN)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                  }
+                  else if (dvalue > DUSHRT_MAX)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = USHRT_MAX;
+                  }
+                  else
+                    output[ii] = (unsigned short) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = dvalue * scale + zero;
+
+                    if (dvalue < DUSHRT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (dvalue > DUSHRT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = USHRT_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned short) dvalue;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < 0)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (input[ii] > USHRT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = USHRT_MAX;
+                }
+                else
+                    output[ii] = (unsigned short) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DUSHRT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUSHRT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = USHRT_MAX;
+                }
+                else
+                    output[ii] = (unsigned short) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < 0)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (input[ii] > USHRT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = USHRT_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned short) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DUSHRT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (dvalue > DUSHRT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = USHRT_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned short) dvalue;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4u2(float *input,         /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
diff --git a/getcoluj.c b/getcoluj.c
index 95a9116..5cdf486 100644
--- a/getcoluj.c
+++ b/getcoluj.c
@@ -742,6 +742,13 @@ int ffgcluj(fitsfile *fptr,   /* I - FITS file pointer                       */
                          nulcheck, (INT32BIT) tnull, nulval, &nularray[next],
                          anynul, &array[next], status);
                 break;
+            case (TLONGLONG):
+
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8u4( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TBYTE):
                 ffgi1b(fptr, readptr, ntodo, incre, (unsigned char *) buffer,
                        status);
@@ -1233,6 +1240,299 @@ int fffi4u4(INT32BIT *input,      /* I - array of values to be converted     */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8u4(LONGLONG *input,      /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,           /* I - value of FITS TNULLn keyword if any */
+   unsigned long nullval,         /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+   unsigned long *output,         /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    long ii,jj,kk;
+    double dvalue;
+    unsigned long *uinput;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk =+ 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue < DULONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DULONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = ULONG_MAX;
+                }
+                else
+                    output[ii] = (unsigned long) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                if (dvalue < DULONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DULONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = ULONG_MAX;
+                }
+                else
+                    output[ii] = (unsigned long) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  if (dvalue < DULONG_MIN)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                  }
+                  else if (dvalue > DULONG_MAX)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = ULONG_MAX;
+                  }
+                  else
+                    output[ii] = (unsigned long) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = dvalue * scale + zero;
+
+                    if (dvalue < DULONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (dvalue > DULONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = ULONG_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned long) dvalue;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < 0)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (input[ii] > ULONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = ULONG_MAX;
+                }
+                else
+                    output[ii] = (unsigned long) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DULONG_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DULONG_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = ULONG_MAX;
+                }
+                else
+                    output[ii] = (unsigned long) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < 0)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (input[ii] > ULONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = ULONG_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned long) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DULONG_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (dvalue > DULONG_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = ULONG_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned long) dvalue;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4u4(float *input,         /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
diff --git a/getcoluk.c b/getcoluk.c
index 1e16225..fdbe539 100644
--- a/getcoluk.c
+++ b/getcoluk.c
@@ -759,6 +759,13 @@ int ffgcluk( fitsfile *fptr,  /* I - FITS file pointer                       */
                            nulcheck, (INT32BIT) tnull, nulval, &nularray[next],
                            anynul, &array[next], status);
                 break;
+            case (TLONGLONG):
+
+                ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status);
+                fffi8uint( (LONGLONG *) buffer, ntodo, scale, zero, 
+                           nulcheck, (long) tnull, nulval, &nularray[next], 
+                            anynul, &array[next], status);
+                break;
             case (TBYTE):
                 ffgi1b(fptr, readptr, ntodo, incre, (unsigned char *) buffer,
                        status);
@@ -1248,6 +1255,299 @@ int fffi4uint(INT32BIT *input,    /* I - array of values to be converted     */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fffi8uint(LONGLONG *input,    /* I - array of values to be converted     */
+            long ntodo,           /* I - number of elements in the array     */
+            double scale,         /* I - FITS TSCALn or BSCALE value         */
+            double zero,          /* I - FITS TZEROn or BZERO  value         */
+            int nullcheck,        /* I - null checking code; 0 = don't check */
+                                  /*     1:set null pixels = nullval         */
+                                  /*     2: if null pixel, set nullarray = 1 */
+            long tnull,          /* I - value of FITS TNULLn keyword if any */
+   unsigned int  nullval,         /* I - set null pixels, if nullcheck = 1   */
+            char *nullarray,      /* I - bad pixel array, if nullcheck = 2   */
+            int  *anynull,        /* O - set to 1 if any pixels are null     */
+   unsigned int  *output,         /* O - array of converted pixels           */
+            int *status)          /* IO - error status                       */
+/*
+  Copy input to output following reading of the input from a FITS file.
+  Check for null values and do datatype conversion and scaling if required.
+  The nullcheck code value determines how any null values in the input array
+  are treated.  A null value is an input pixel that is equal to tnull.  If 
+  nullcheck = 0, then no checking for nulls is performed and any null values
+  will be transformed just like any other pixel.  If nullcheck = 1, then the
+  output pixel will be set = nullval if the corresponding input pixel is null.
+  If nullcheck = 2, then if the pixel is null then the corresponding value of
+  nullarray will be set to 1; the value of nullarray for non-null pixels 
+  will = 0.  The anynull parameter will be set = 1 if any of the returned
+  pixels are null, otherwise anynull will be returned with a value = 0;
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+    /* This block of code is only used in cases where there is */
+    /* no native 8-byte integer support.  We have to interpret */
+    /* the corresponding  pair of 4-byte integers which are */
+    /* are equivalent to the 8-byte integer. */
+
+    long ii,jj,kk;
+    double dvalue;
+    unsigned long *uinput;
+
+    uinput = (unsigned long *) input;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                  dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue < DUINT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUINT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UINT_MAX;
+                }
+                else
+                    output[ii] = (unsigned int) dvalue;
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                  dvalue = ((uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.) * scale + zero;
+                else  /* positive number */
+                  dvalue = (uinput[jj] * 4294967296. + uinput[kk]) 
+                           * scale + zero;
+
+                if (dvalue < DUINT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUINT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UINT_MAX;
+                }
+                else
+                    output[ii] = (unsigned int) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == (double) tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                  if (dvalue < DUINT_MIN)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                  }
+                  else if (dvalue > DUINT_MAX)
+                  {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UINT_MAX;
+                  }
+                  else
+                    output[ii] = (unsigned int) dvalue;
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+            {
+                if (uinput[jj] & 0x80000000)  /* negative number */
+                    dvalue = (uinput[jj] ^ 0xffffffff) * -4294967296. -
+                           (uinput[kk] ^ 0xffffffff) - 1.;
+                else  /* positive number */
+                    dvalue = uinput[jj] * 4294967296. + uinput[kk];
+
+                if (dvalue == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = dvalue * scale + zero;
+
+                    if (dvalue < DUINT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (dvalue > DUINT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = UINT_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned int) dvalue;
+                }
+            }
+        }
+    }
+
+#else
+
+    /* this block works on machines which support an 8-byte integer type */
+
+    long ii;
+    double dvalue;
+
+    if (nullcheck == 0)     /* no null checking required */
+    {
+        if (scale == 1. && zero == 0.)      /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] < 0)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (input[ii] > UINT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UINT_MAX;
+                }
+                else
+                    output[ii] = (unsigned int) input[ii];
+            }
+        }
+        else             /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                dvalue = input[ii] * scale + zero;
+
+                if (dvalue < DUINT_MIN)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = 0;
+                }
+                else if (dvalue > DUINT_MAX)
+                {
+                    *status = OVERFLOW_ERR;
+                    output[ii] = UINT_MAX;
+                }
+                else
+                    output[ii] = (unsigned int) dvalue;
+            }
+        }
+    }
+    else        /* must check for null values */
+    {
+        if (scale == 1. && zero == 0.)  /* no scaling */
+        {       
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    if (input[ii] < 0)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (input[ii] > UINT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = UINT_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned int) input[ii];
+                }
+            }
+        }
+        else                  /* must scale the data */
+        {
+            for (ii = 0; ii < ntodo; ii++)
+            {
+                if (input[ii] == tnull)
+                {
+                    *anynull = 1;
+                    if (nullcheck == 1)
+                        output[ii] = nullval;
+                    else
+                        nullarray[ii] = 1;
+                }
+                else
+                {
+                    dvalue = input[ii] * scale + zero;
+
+                    if (dvalue < DUINT_MIN)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = 0;
+                    }
+                    else if (dvalue > DUINT_MAX)
+                    {
+                        *status = OVERFLOW_ERR;
+                        output[ii] = UINT_MAX;
+                    }
+                    else
+                        output[ii] = (unsigned int) dvalue;
+                }
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int fffr4uint(float *input,        /* I - array of values to be converted     */
             long ntodo,           /* I - number of elements in the array     */
             double scale,         /* I - FITS TSCALn or BSCALE value         */
diff --git a/getkey.c b/getkey.c
index 30ff15e..698eb55 100644
--- a/getkey.c
+++ b/getkey.c
@@ -24,6 +24,9 @@ int ffghsp(fitsfile *fptr,  /* I - FITS file pointer                     */
   without having to insert more FITS blocks.
 */
 {
+    if (*status > 0)
+        return(*status);
+
     if (fptr->HDUposition != (fptr->Fptr)->curhdu)
         ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
 
@@ -54,6 +57,9 @@ int ffghps(fitsfile *fptr, /* I - FITS file pointer                     */
   keyword that will be read.
 */
 {
+    if (*status > 0)
+        return(*status);
+
     if (fptr->HDUposition != (fptr->Fptr)->curhdu)
         ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
 
@@ -294,6 +300,16 @@ int ffgky( fitsfile *fptr,     /* I - FITS file pointer        */
                 *(unsigned char *) value = longval;
         }
     }
+    else if (datatype == TSBYTE)
+    {
+        if (ffgkyj(fptr, keyname, &longval, comm, status) <= 0)
+        {
+            if (longval > 127 || longval < -128)
+                *status = NUM_OVERFLOW;
+            else
+                *(signed char *) value = longval;
+        }
+    }
     else if (datatype == TUSHORT)
     {
         if (ffgkyj(fptr, keyname, &longval, comm, status) <= 0)
@@ -1950,7 +1966,7 @@ int ffgphd(fitsfile *fptr,  /* I - FITS file pointer                        */
     {
         /* this is a compressed image, so read ZBITPIX, ZNAXIS keywords */
         unknown = 0;  /* reset flag */
-        ffxmsg(-2, message); /* clear previous spurious error message */
+        ffxmsg(3, message); /* clear previous spurious error message */
 
         if (bitpix)
         {
@@ -2011,7 +2027,7 @@ int ffgphd(fitsfile *fptr,  /* I - FITS file pointer                        */
             return(*status = BAD_BITPIX);
         }
         else if (longbitpix != BYTE_IMG && longbitpix != SHORT_IMG &&
-             longbitpix != LONG_IMG &&
+             longbitpix != LONG_IMG && longbitpix != LONGLONG_IMG &&
              longbitpix != FLOAT_IMG && longbitpix != DOUBLE_IMG)
         {
             sprintf(message,
@@ -2116,6 +2132,7 @@ int ffgphd(fitsfile *fptr,  /* I - FITS file pointer                        */
 
         if (!strcmp(name, "BSCALE") && bscale)
         {
+            *nspace = 0;  /* reset count of blank keywords */
             ffpsvc(card, value, comm, status); /* parse value and comment */
 
             if (ffc2dd(value, bscale, status) > 0) /* convert to double */
@@ -2132,6 +2149,7 @@ int ffgphd(fitsfile *fptr,  /* I - FITS file pointer                        */
 
         else if (!strcmp(name, "BZERO") && bzero)
         {
+            *nspace = 0;  /* reset count of blank keywords */
             ffpsvc(card, value, comm, status); /* parse value and comment */
 
             if (ffc2dd(value, bzero, status) > 0) /* convert to double */
@@ -2148,6 +2166,7 @@ int ffgphd(fitsfile *fptr,  /* I - FITS file pointer                        */
 
         else if (!strcmp(name, "BLANK") && blank)
         {
+            *nspace = 0;  /* reset count of blank keywords */
             ffpsvc(card, value, comm, status); /* parse value and comment */
 
             if (ffc2ii(value, blank, status) > 0) /* convert to long */
@@ -2164,6 +2183,7 @@ int ffgphd(fitsfile *fptr,  /* I - FITS file pointer                        */
 
         else if (!strcmp(name, "PCOUNT") && pcount)
         {
+            *nspace = 0;  /* reset count of blank keywords */
             ffpsvc(card, value, comm, status); /* parse value and comment */
 
             if (ffc2ii(value, pcount, status) > 0) /* convert to long */
@@ -2176,6 +2196,7 @@ int ffgphd(fitsfile *fptr,  /* I - FITS file pointer                        */
 
         else if (!strcmp(name, "GCOUNT") && gcount)
         {
+            *nspace = 0;  /* reset count of blank keywords */
             ffpsvc(card, value, comm, status); /* parse value and comment */
 
             if (ffc2ii(value, gcount, status) > 0) /* convert to long */
@@ -2188,6 +2209,7 @@ int ffgphd(fitsfile *fptr,  /* I - FITS file pointer                        */
 
         else if (!strcmp(name, "EXTEND") && extend)
         {
+            *nspace = 0;  /* reset count of blank keywords */
             ffpsvc(card, value, comm, status); /* parse value and comment */
 
             if (ffc2ll(value, extend, status) > 0) /* convert to logical */
@@ -2431,3 +2453,92 @@ int ffh2st(fitsfile *fptr,   /* I - FITS file pointer           */
 
     return(*status);
 }
+/*--------------------------------------------------------------------------*/
+int ffhdr2str( fitsfile *fptr,  /* I - FITS file pointer                    */
+            int exclude_comm,   /* I - if TRUE, exclude commentary keywords */
+            char **exclist,     /* I - list of excluded keyword names       */
+            int nexc,           /* I - number of names in exclist           */
+            char **header,      /* O - returned header string               */
+            int *nkeys,         /* O - returned number of 80-char keywords  */
+            int  *status)       /* IO - error status                        */
+/*
+  read header keywords into a long string of chars.  This routine allocates
+  memory for the string, so the calling routine must eventually free the
+  memory when it is not needed any more.  If exclude_comm is TRUE, then all 
+  the COMMENT, HISTORY, and <blank> keywords will be excluded from the output
+  string of keywords.  Any other list of keywords to be excluded may be
+  specified with the exclist parameter.
+*/
+{
+    int casesn, match, exact, totkeys;
+    long ii, jj;
+    char keybuf[162], keyname[FLEN_KEYWORD], *headptr;
+
+    *nkeys = 0;
+
+    if (*status > 0)
+        return(*status);
+
+    /* get number of keywords in the header (doesn't include END) */
+    if (ffghsp(fptr, &totkeys, NULL, status) > 0)
+        return(*status);
+
+    /* allocate memory for all the keywords (multiple of 2880 bytes) */
+    *header = (char *) calloc ( (totkeys + 1) * 80 + 1, 1);
+    if (!(*header))
+    {
+         *status = MEMORY_ALLOCATION;
+         ffpmsg("failed to allocate memory to hold all the header keywords");
+         return(*status);
+    }
+
+    headptr = *header;
+    casesn = FALSE;
+
+    /* read every keyword */
+    for (ii = 1; ii <= totkeys; ii++) 
+    {
+        ffgrec(fptr, ii, keybuf, status);
+        /* pad record with blanks so that it is at least 80 chars long */
+        strcat(keybuf,
+    "                                                                                ");
+
+        keyname[0] = '\0';
+        strncat(keyname, keybuf, 8); /* copy the keyword name */
+        
+        if (exclude_comm)
+        {
+            if (!FSTRCMP("COMMENT ", keyname) ||
+                !FSTRCMP("HISTORY ", keyname) ||
+                !FSTRCMP("        ", keyname) )
+              continue;  /* skip this commentary keyword */
+        }
+
+        /* does keyword match any names in the exclusion list? */
+        for (jj = 0; jj < nexc; jj++ )
+        {
+            ffcmps(exclist[jj], keyname, casesn, &match, &exact);
+                 if (match)
+                     break;
+        }
+
+        if (jj == nexc)
+        {
+            /* not in exclusion list, add this keyword to the string */
+            strcpy(headptr, keybuf);
+            headptr += 80;
+            (*nkeys)++;
+        }
+    }
+
+    /* add the END keyword */
+    strcpy(headptr,
+    "END                                                                             ");
+    headptr += 80;
+    (*nkeys)++;
+
+    *headptr = '\0';   /* terminate the header string */
+    realloc(*header, (*nkeys *80) + 1);  /* minimize the allocated memory */
+
+    return(*status);
+}
diff --git a/group.c b/group.c
index f6ace5f..9b5a481 100644
--- a/group.c
+++ b/group.c
@@ -16,11 +16,10 @@
     
 #include "fitsio2.h"
 #include "group.h"
+#include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 
-#define INVALID_GROUP_UPDATE 10000
-
 #define HEX_ESCAPE '%'
 
 /*---------------------------------------------------------------------------
@@ -996,6 +995,7 @@ int ffgtop(fitsfile *mfptr,  /* FITS file pointer to the member HDU          */
 
   char keyword[FLEN_KEYWORD];
   char keyvalue[FLEN_FILENAME];
+  char *tkeyvalue;
   char location[FLEN_FILENAME];
   char location1[FLEN_FILENAME];
   char location2[FLEN_FILENAME];
@@ -1090,9 +1090,15 @@ int ffgtop(fitsfile *mfptr,  /* FITS file pointer to the member HDU          */
 	  /* read the GRPLCn keyword value */
 
 	  sprintf(keyword,"GRPLC%d",grpid);
-	  *status = fits_read_key_str(mfptr,keyword,keyvalue,comment,
+	  /* SPR 1738 */
+	  *status = fits_read_key_longstr(mfptr,keyword,&tkeyvalue,comment,
 				      status);
+	  if (0 == *status) {
+	    strcpy(keyvalue,tkeyvalue);
+	    free(tkeyvalue);
+	  }
 	  
+
 	  /* if the GRPLCn keyword was not found then there is a problem */
 
 	  if(*status == KEY_NO_EXIST)
@@ -1313,6 +1319,7 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
   char memberFileName[FLEN_FILENAME];
   char memberLocation[FLEN_FILENAME];
   char grplc[FLEN_FILENAME];
+  char *tgrplc;
   char memberHDUtype[FLEN_VALUE];
   char memberExtname[FLEN_VALUE];
   char memberURI[] = "URL";
@@ -1334,6 +1341,7 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 
   fitsfile *tmpfptr = NULL;
 
+  int parentStatus = 0;
 
   if(*status != 0) return(*status);
 
@@ -1348,7 +1356,7 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
       if(iomode != READWRITE)
 	{
 	  ffpmsg("cannot modify grouping table (ffgtam)");
-	  *status = INVALID_GROUP_UPDATE;
+	  *status = BAD_GROUP_ATTACH;
 	  continue;
 	}
 
@@ -1413,19 +1421,21 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 	for this is rather complicated
       */
 
-      if(tmpfptr->Fptr == gfptr->Fptr)
-	{
+      /* SPR 3463, don't do this 
+	 if(tmpfptr->Fptr == gfptr->Fptr)
+	 {  */
 	  /*
 	    member HDU and grouping table reside in the same file, no need
-	    to use the location information
-	  */
-
-	  useLocation     = 0;
-	  memberIOstate   = 1;
-	  *memberFileName = 0;
+	    to use the location information */
+	  
+      /* printf ("same file\n");
+	   
+	   useLocation     = 0;
+	   memberIOstate   = 1;
+	   *memberFileName = 0;
 	}
       else
-	{
+      { */ 
 	  /*
 	     the member HDU and grouping table FITS file location information 
 	     must be used.
@@ -1483,7 +1493,7 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 	  if(groupIOstate == 0)
 	    {
 	      ffpmsg("cannot modify grouping table (ffgtam)");
-	      *status = INVALID_GROUP_UPDATE;
+	      *status = BAD_GROUP_ATTACH;
 	      continue;
 	    }
 
@@ -1495,6 +1505,7 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 	  if(strcasecmp(groupAccess1,"file://")  &&
 	                                   strcasecmp(memberAccess1,"file://"))
 	    {
+              *cwd = 0;
 	      /* 
 		 nothing to do in this case; both the member and group files
 		 must be of an access type that already gives valid URLs;
@@ -1578,7 +1589,9 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 		  strcpy(groupFileName,groupLocation);		  
 		}
 	    }
-	}
+	  /* beo done */
+	  /* }  */
+      
 
       /* retrieve the grouping table's EXTVER value */
 
@@ -1588,13 +1601,15 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 	 if useLocation is true then make the group EXTVER value negative
 	 for the subsequent GRPIDn/GRPLCn matching
       */
-
-      if(useLocation) groupExtver = -1*groupExtver;
+      /* SPR 3463 change test */
+      if(tmpfptr->Fptr != gfptr->Fptr) groupExtver = -1*groupExtver;
 
       /* retrieve the number of group members */
 
       *status = fits_get_num_members(gfptr,&nmembers,status);
 	      
+    do {
+
       /*
 	 make sure the member HDU is not already an entry in the
 	 grouping table before adding it
@@ -1606,7 +1621,7 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
       if(*status == MEMBER_NOT_FOUND) *status = 0;
       else if(*status == 0)
 	{  
-	  *status = HDU_ALREADY_MEMBER;
+	  parentStatus = HDU_ALREADY_MEMBER;
     ffpmsg("Specified HDU is already a member of the Grouping table (ffgtam)");
 	  continue;
 	}
@@ -1650,14 +1665,15 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 			   status);
 
       if(positionCol != 0)
-	fits_write_col_lng(gfptr,positionCol,nmembers,1,1,
-			   (long *)&memberPosition,status);
+	fits_write_col_int(gfptr,positionCol,nmembers,1,1,
+			   &memberPosition,status);
 
       *tmpPtr = memberFileName; 
 
       if(locationCol != 0)
 	{
-	  if(useLocation != 0)
+	  /* Change the test for SPR 3463 */
+	  if(tmpfptr->Fptr != gfptr->Fptr)
 	    fits_write_col_str(gfptr,locationCol,nmembers,1,1,tmpPtr,status);
 	  else
 	    /* WILL THIS WORK FOR VAR LENTH CHAR COLS??????*/
@@ -1668,13 +1684,18 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 
       if(uriCol      != 0)
 	{
-	  if(useLocation != 0)
+
+	  /* Change the test for SPR 3463 */
+
+	  if(tmpfptr->Fptr != gfptr->Fptr)
 	    fits_write_col_str(gfptr,uriCol,nmembers,1,1,tmpPtr,status);
 	  else
 	    /* WILL THIS WORK FOR VAR LENTH CHAR COLS??????*/
 	    fits_write_col_byt(gfptr,uriCol,nmembers,1,1,charNull,status);
 	}
+    } while(0);
 
+      if(0 != *status) continue;
       /*
 	 add GRPIDn/GRPLCn keywords to the member HDU header to link
 	 it to the grouing table if the they do not already exist and
@@ -1707,36 +1728,68 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 	    {
 	      if(grpid < 0)
 		{
+
 		  /* have to make sure the GRPLCn keyword matches too */
 
 		  sprintf(keyword,"GRPLC%d",(int)ngroups);
-		  *status = fits_read_key_str(tmpfptr,keyword,grplc,card,
-					      status);
+		  /* SPR 1738 */
+		  *status = fits_read_key_longstr(mfptr,keyword,&tgrplc,card,
+						  status);
+		  if (0 == *status) {
+		    strcpy(grplc,tgrplc);
+		    free(tgrplc);
+		  }
+		  
 		  /*
-		    if neither the grplc value or the groupFileName are
-		     absolute URLs then make sure the file path 
-		     comparision is done with absolute paths
-		  */
-
-		  if(! fits_is_url_absolute(grplc)        &&
-		     ! fits_is_url_absolute(groupFileName)   )
-		    {
+		     always compare files using absolute paths
+                     the presence of a non-empty cwd indicates
+                     that the file names may require conversion
+                     to absolute paths
+                  */
+
+                  if(0 < strlen(cwd)) {
+                    /* temp buffer for use in assembling abs. path(s) */
+                    char tmp[FLEN_FILENAME];
+
+                    /* make grplc absolute if necessary */
+                    if(!fits_is_url_absolute(grplc)) {
 		      fits_path2url(grplc,groupLocation,status);
 
 		      if(groupLocation[0] != '/')
 			{
-			  fits_get_cwd(cwd,status);
-			  strcat(cwd,"/");
-			  strcat(cwd,groupLocation);
-			  fits_clean_url(cwd,grplc,status);
+			  strcpy(tmp, cwd);
+			  strcat(tmp,"/");
+			  strcat(tmp,groupLocation);
+			  fits_clean_url(tmp,grplc,status);
 			}
-		    }
+                    }
+
+                    /* make groupFileName absolute if necessary */
+                    if(!fits_is_url_absolute(groupFileName)) {
+		      fits_path2url(groupFileName,groupLocation,status);
 
+		      if(groupLocation[0] != '/')
+			{
+			  strcpy(tmp, cwd);
+			  strcat(tmp,"/");
+			  strcat(tmp,groupLocation);
+                          /*
+                             note: use groupLocation (which is not used
+                             below this block), to store the absolute
+                             file name instead of using groupFileName.
+                             The latter may be needed unaltered if the
+                             GRPLC is written below
+                          */
+
+			  fits_clean_url(tmp,groupLocation,status);
+			}
+                    }
+                  }
 		  /*
 		    see if the grplc value and the group file name match
 		  */
 
-		  if(strcmp(grplc,groupFileName) == 0) found = 1;
+		  if(strcmp(grplc,groupLocation) == 0) found = 1;
 		}
 	      else
 		{
@@ -1805,8 +1858,8 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 	 if the member HDU and grouping table reside in the same FITS file
 	 then there is no need to add a GRPLCn keyword
       */
-
-      if(useLocation == 0)
+      /* SPR 3463 change test */
+      if(tmpfptr->Fptr == gfptr->Fptr)
 	{
 	  /* add the GRPIDn keyword only */
 
@@ -1823,8 +1876,11 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
 			      "EXTVER of Group containing this HDU",status);
 
 	  sprintf(keyword,"GRPLC%d",(int)ngroups);
-	  fits_insert_key_str(tmpfptr,keyword,groupFileName,
+	  /* SPR 1738 */
+	  fits_insert_key_longstr(tmpfptr,keyword,groupFileName,
 			      "URL of file containing Group",status);
+	  fits_write_key_longwarn(tmpfptr,status);
+
 	}
 
     }while(0);
@@ -1836,6 +1892,8 @@ int ffgtam(fitsfile *gfptr,   /* FITS file pointer to grouping table HDU     */
       *status = fits_close_file(tmpfptr,status);
     }
 
+  *status = 0 == *status ? parentStatus : *status;
+
   return(*status);
 }
 
@@ -1904,6 +1962,8 @@ int ffgmng(fitsfile *mfptr,   /* FITS file pointer to member HDU            */
   char keyword[FLEN_KEYWORD];
   char newKeyword[FLEN_KEYWORD];
   char card[FLEN_CARD];
+  char comment[FLEN_COMMENT];
+  char *tkeyvalue;
 
   if(*status != 0) return(*status);
 
@@ -1974,7 +2034,16 @@ int ffgmng(fitsfile *mfptr,   /* FITS file pointer to member HDU            */
 
 	      sprintf(keyword,"GRPLC%d",index);
 	      sprintf(newKeyword,"GRPLC%d",newIndex);
-	      fits_modify_name(mfptr,keyword,newKeyword,status);
+	      /* SPR 1738 */
+	      *status = fits_read_key_longstr(mfptr,keyword,&tkeyvalue,comment,
+					      status);
+	      if (0 == *status) {
+		fits_delete_key(mfptr,keyword,status);
+		fits_insert_key_longstr(mfptr,newKeyword,tkeyvalue,comment,status);
+		fits_write_key_longwarn(mfptr,status);
+		free(tkeyvalue);
+	      }
+	      
 
 	      if(*status == KEY_NO_EXIST) *status = 0;
 	    }
@@ -2576,6 +2645,8 @@ int ffgmcp(fitsfile *gfptr,  /* FITS file pointer to group                   */
   char  extname[FLEN_VALUE];
   char  card[FLEN_CARD];
   char  comment[FLEN_COMMENT];
+  char  keyname[FLEN_CARD];
+  char  value[FLEN_CARD];
 
   fitsfile *tmpfptr = NULL;
 
@@ -2632,7 +2703,11 @@ int ffgmcp(fitsfile *gfptr,  /* FITS file pointer to group                   */
 	    {
 	      *status = fits_find_nextkey(mfptr,incList,2,NULL,0,card,status);
 	      *status = fits_get_hdrpos(mfptr,&numkeys,&keypos,status);  
-	      *status = fits_delete_record(mfptr,keypos-1,status);
+	      /* SPR 1738 */
+	      *status = fits_read_keyn(mfptr,keypos-1,keyname,value,
+				       comment,status);
+	      *status = fits_read_record(mfptr,keypos-1,card,status);
+	      *status = fits_delete_key(mfptr,keyname,status);
 	    }
 
 	  if(*status == KEY_NO_EXIST) *status = 0;
@@ -2846,7 +2921,9 @@ int ffgmrm(fitsfile *gfptr,  /* FITS file pointer to group table             */
   char grpLocation3[FLEN_FILENAME];
   char cwd[FLEN_FILENAME];
   char keyword[FLEN_KEYWORD];
-  char grplc[FLEN_VALUE];
+  /* SPR 1738 This can now be longer */
+  char grplc[FLEN_FILENAME];
+  char *tgrplc;
   char keyvalue[FLEN_VALUE];
   char card[FLEN_CARD];
   char *editLocation;
@@ -2867,7 +2944,7 @@ int ffgmrm(fitsfile *gfptr,  /* FITS file pointer to group table             */
       if(iomode != READWRITE)
 	{
 	  ffpmsg("cannot modify grouping table (ffgtam)");
-	  *status = INVALID_GROUP_UPDATE;
+	  *status = BAD_GROUP_DETACH;
 	  continue;
 	}
 
@@ -3057,9 +3134,14 @@ int ffgmrm(fitsfile *gfptr,  /* FITS file pointer to group table             */
 		      
 		      sprintf(keyword,"GRPLC%d",index);
 		      
-		      *status = fits_read_key_str(mfptr,keyword,grplc,card,
-						  status);
-		      
+		      /* SPR 1738 */
+		      *status = fits_read_key_longstr(mfptr,keyword,&tgrplc,
+						      card, status);
+		      if (0 == *status) {
+			strcpy(grplc,tgrplc);
+			free(tgrplc);
+		      }
+		      		      
 		      if(*status == KEY_NO_EXIST)
 			{
 			  /* 
@@ -3389,7 +3471,8 @@ int ffgtdc(int   grouptype,     /* code specifying the type of
   char  URITform[]  = "3A";
 
   char  location[]  = "MEMBER_LOCATION";
-  char  locTform[]  = "160A";
+  /* SPR 01720, move from 160A to 256A */
+  char  locTform[]  = "256A";
 
 
   if(*status != 0) return(*status);
@@ -3905,8 +3988,8 @@ int ffgmf(fitsfile *gfptr, /* pointer to grouping table HDU to search       */
       if(positionCol != 0 && 
 	            (grptype == GT_ID_POS || grptype == GT_ID_POS_URI))
 	{
-	  fits_read_col_lng(gfptr,positionCol,i,1,1,0,
-			    (long*)&mposition,&dummy,status);
+	  fits_read_col_int(gfptr,positionCol,i,1,1,0,
+			    &mposition,&dummy,status);
 	  if(position != mposition) continue;
 	}
       
@@ -4235,6 +4318,8 @@ int ffgtcpr(fitsfile   *infptr,  /* input FITS file pointer                 */
   char keyword[FLEN_KEYWORD];
   char keyvalue[FLEN_VALUE];
   char card[FLEN_CARD];
+  char comment[FLEN_CARD];
+  char *tkeyvalue;
 
   char *includeList[] = {"*"};
   char *excludeList[] = {"EXTNAME","EXTVER","GRPNAME","GRPID#","GRPLC#",
@@ -4420,12 +4505,27 @@ int ffgtcpr(fitsfile   *infptr,  /* input FITS file pointer                 */
 	  *status = fits_get_hdrpos(infptr,&numkeys,&startSearch,status);
 
 	  --startSearch;
-
-	  *status = fits_insert_record(outfptr,keypos,card,status);
-
+	  /* SPR 1738 */
+	  if (strncmp(card,"GRPLC",5)) {
+	    /* Not going to be a long string so we're ok */
+	    *status = fits_insert_record(outfptr,keypos,card,status);
+	  } else {
+	    /* We could have a long string */
+	    *status = fits_read_record(infptr,startSearch,card,status);
+	    card[9] = '\0';
+	    *status = fits_read_key_longstr(infptr,card,&tkeyvalue,comment,
+					    status);
+	    if (0 == *status) {
+	      fits_insert_key_longstr(outfptr,card,tkeyvalue,comment,status);
+	      fits_write_key_longwarn(outfptr,status);
+	      free(tkeyvalue);
+	    }
+	  }
+	  
 	  ++keypos;
 	}
-
+      
+	  
       if(*status == KEY_NO_EXIST) 
 	*status = 0;
       else if(*status != 0) continue;
@@ -5443,7 +5543,7 @@ int  fits_get_url(fitsfile *fptr,       /* I ptr to FITS file to evaluate    */
 	    {
 	      /* file is a temp mem file only */
 	      ffpmsg("cannot make URL from temp MEM:// file (fits_get_url)");
-	      *status = INVALID_GROUP_UPDATE;
+	      *status = URL_PARSE_ERROR;
 	    }
 	  else
 	    {
@@ -5598,21 +5698,21 @@ int  fits_get_url(fitsfile *fptr,       /* I ptr to FITS file to evaluate    */
 
       else if(strcasecmp(tmpStr3,"stdin://")        == 0)        
 	{
-	  *status = INVALID_GROUP_UPDATE;
+	  *status = URL_PARSE_ERROR;
 	  ffpmsg("cannot make vaild URL from stdin:// (fits_get_url)");
 	  *tmpStr1 = *tmpStr2 = 0;
 	}
 
       else if(strcasecmp(tmpStr3,"stdout://")       == 0)       
 	{
-	  *status = INVALID_GROUP_UPDATE;
+	  *status = URL_PARSE_ERROR;
 	  ffpmsg("cannot make vaild URL from stdout:// (fits_get_url)");
 	  *tmpStr1 = *tmpStr2 = 0;
 	}
 
       else if(strcasecmp(tmpStr3,"irafmem://")      == 0)      
 	{
-	  *status = INVALID_GROUP_UPDATE;
+	  *status = URL_PARSE_ERROR;
 	  ffpmsg("cannot make vaild URL from irafmem:// (fits_get_url)");
 	  *tmpStr1 = *tmpStr2 = 0;
 	}
@@ -5668,7 +5768,7 @@ int  fits_get_url(fitsfile *fptr,       /* I ptr to FITS file to evaluate    */
 	}
 
       if(realAccess  != NULL)  strcpy(realAccess,tmpStr3);
-      if(startAccess != NULL)  strcpy(startAccess,tmpStr3);
+      if(startAccess != NULL)  strcpy(startAccess,tmpStr4);
       if(iostate     != NULL) *iostate = tmpIOstate;
 
     }while(0);
@@ -5679,6 +5779,36 @@ int  fits_get_url(fitsfile *fptr,       /* I ptr to FITS file to evaluate    */
 /*--------------------------------------------------------------------------
                            URL parse support functions
   --------------------------------------------------------------------------*/
+
+/* simple push/pop/shift/unshift string stack for use by fits_clean_url */
+typedef char* grp_stack_data; /* type of data held by grp_stack */
+
+typedef struct grp_stack_item_struct {
+  grp_stack_data data; /* value of this stack item */
+  struct grp_stack_item_struct* next; /* next stack item */
+  struct grp_stack_item_struct* prev; /* previous stack item */
+} grp_stack_item;
+
+typedef struct grp_stack_struct {
+  size_t stack_size; /* number of items on stack */
+  grp_stack_item* top; /* top item */
+} grp_stack;
+
+static char* grp_stack_default = NULL; /* initial value for new instances
+                                          of grp_stack_data */
+
+/* the following functions implement the group string stack grp_stack */
+static void delete_grp_stack(grp_stack** mystack);
+static grp_stack_item* grp_stack_append(
+  grp_stack_item* last, grp_stack_data data
+);
+static grp_stack_data grp_stack_remove(grp_stack_item* last);
+static grp_stack* new_grp_stack(void);
+static grp_stack_data pop_grp_stack(grp_stack* mystack);
+static void push_grp_stack(grp_stack* mystack, grp_stack_data data);
+static grp_stack_data shift_grp_stack(grp_stack* mystack);
+/* static void unshift_grp_stack(grp_stack* mystack, grp_stack_data data); */
+
 int fits_clean_url(char *inURL,  /* I input URL string                      */
 		   char *outURL, /* O output URL string                     */
 		   int  *status)
@@ -5690,104 +5820,164 @@ int fits_clean_url(char *inURL,  /* I input URL string                      */
   dependent path strings are not allowed.
  */
 {
-  int i,j;
-  int appendCount = 0;
-  int absPath     = 0;
+  grp_stack* mystack; /* stack to hold pieces of URL */
+  char* tmp;
+
+  if(*status) return *status;
+
+  mystack = new_grp_stack();
+  *outURL = 0;
+
+  do {
+    /* handle URL scheme and domain if they exist */
+    tmp = strstr(inURL, "://");
+    if(tmp) {
+      /* there is a URL scheme, so look for the end of the domain too */
+      tmp = strchr(tmp + 3, '/');
+      if(tmp) {
+        /* tmp is now the end of the domain, so
+         * copy URL scheme and domain as is, and terminate by hand */
+        size_t string_size = (size_t) (tmp - inURL);
+        strncpy(outURL, inURL, string_size);
+        outURL[string_size] = 0;
+
+        /* now advance the input pointer to just after the domain and go on */
+        inURL = tmp;
+      } else {
+        /* '/' was not found, which means there are no path-like
+         * portions, so copy whole inURL to outURL and we're done */
+        strcpy(outURL, inURL);
+        continue; /* while(0) */
+      }
+    }
+
+    /* explicitly copy a leading / (absolute path) */
+    if('/' == *inURL) strcat(outURL, "/");
+
+    /* now clean the remainder of the inURL. push URL segments onto
+     * stack, dealing with .. and . as we go */
+    tmp = strtok(inURL, "/"); /* finds first / */
+    while(tmp) {
+      if(!strcmp(tmp, "..")) {
+        /* discard previous URL segment, if there was one. if not,
+         * add the .. to the stack if this is *not* an absolute path
+         * (for absolute paths, leading .. has no effect, so skip it) */
+        if(0 < mystack->stack_size) pop_grp_stack(mystack);
+        else if('/' != *inURL) push_grp_stack(mystack, tmp);
+      } else {
+        /* always just skip ., but otherwise add segment to stack */
+        if(strcmp(tmp, ".")) push_grp_stack(mystack, tmp);
+      }
+      tmp = strtok(NULL, "/"); /* get the next segment */
+    }
 
-  char *tmpStr1;
+    /* stack now has pieces of cleaned URL, so just catenate them
+     * onto output string until stack is empty */
+    while(0 < mystack->stack_size) {
+      tmp = shift_grp_stack(mystack);
+      strcat(outURL, tmp);
+      strcat(outURL, "/");
+    }
+    outURL[strlen(outURL) - 1] = 0; /* blank out trailing / */
+  } while(0);
+  delete_grp_stack(&mystack);
+  return *status;
+}
 
-  if(*status != 0) return(*status);
+/* free all stack contents using pop_grp_stack before freeing the
+ * grp_stack itself */
+static void delete_grp_stack(grp_stack** mystack) {
+  if(!mystack || !*mystack) return;
+  while((*mystack)->stack_size) pop_grp_stack(*mystack);
+  free(*mystack);
+  *mystack = NULL;
+}
 
-  do
-    {
-      /*
-	if inURL starts with an access method specification copy it 
-	directly to the outURL string; else just initialize the outURL string
-	to zero length
-      */
-      
-      if(strstr(inURL,"://") != NULL)
-	{
-	  for(i = 0; inURL[i] != ':'; ++i) outURL[i] = inURL[i];
+/* append an item to the stack, handling the special case of the first
+ * item appended */
+static grp_stack_item* grp_stack_append(
+  grp_stack_item* last, grp_stack_data data
+) {
+  /* first create a new stack item, and copy data to it */
+  grp_stack_item* new_item = (grp_stack_item*) malloc(sizeof(grp_stack_item));
+  new_item->data = data;
+  if(last) {
+    /* attach this item between the "last" item and its "next" item */
+    new_item->next = last->next;
+    new_item->prev = last;
+    last->next->prev = new_item;
+    last->next = new_item;
+  } else {
+    /* stack is empty, so "next" and "previous" both point back to it */
+    new_item->next = new_item;
+    new_item->prev = new_item;
+  }
+  return new_item;
+}
 
-	  outURL[i] = 0;
-	  strcat(outURL,"://");
-	  i = strlen(outURL);
-	}
-      else
-	{
-	  i = 0;
-	  outURL[0] = 0;
-	}
-      
-      if(inURL[i] == '/')
-	absPath = 1;
-      else
-	absPath = 0;
-	  
-      /* 
-	 loop on the inURL string processing each slash (/) delimited
-	 token until all tokens are processed 
-       */
-      
-      for(tmpStr1  = strtok(inURL+i,"/"), j = i, appendCount = 0;
-	  tmpStr1 != NULL;
-	  tmpStr1  = strtok(NULL,"/"), j = strlen(outURL) - 1)
-	{
-	  /*
-	    if the token is ".." then we must strip off the last token
-	    from the outURL string; note that if appendCount is zero
-	    then this implies that the ourURL string will have
-	    leading ".." ==> there is nothing to strip off
-	   */
-	  
-	  if(strcmp(tmpStr1,"..") == 0 && appendCount > 0)
-	    {
-	      /* remove the last token from the outURL string */
-	      
-	      for(;outURL[j] != '/' && j >= 0; --j);
-	      
-	      outURL[j] = 0;		  
-	    }
-	  
-	  /*
-	    if the token is "." then its a dummy token and we just
-	    ignore it
-	   */
-	  
-	  else if(strcmp(tmpStr1,".") == 0)
-	    {
-	      /* in this case do nothing */
-	    }
-	  
-	  /*
-	    else append the token to the outURL string
-	   */
-	  
-	  else
-	    {
+/* remove an item from the stack, handling the special case of the last
+ * item removed */
+static grp_stack_data grp_stack_remove(grp_stack_item* last) {
+  grp_stack_data retval = last->data;
+  last->prev->next = last->next;
+  last->next->prev = last->prev;
+  free(last);
+  return retval;
+}
 
-	      /*
-		make sure there is a slash separating the two tokens 
-		 and that OUTURL begins with a slash if the ABSPATH flag
-		 is set
-	      */
+/* create new stack dynamically, and give it valid initial values */
+static grp_stack* new_grp_stack(void) {
+  grp_stack* retval = (grp_stack*) malloc(sizeof(grp_stack));
+  if(retval) {
+    retval->stack_size = 0;
+    retval->top = NULL;
+  }
+  return retval;
+}
 
-	      if(outURL[j] != '/' && (j != 0 || absPath))
-		                                 strcat(outURL,"/");     
-	      
-	      strcat(outURL,tmpStr1);	       	  
-	      
-	      /* only increment appendCount if we do not add ".." */
-	      
-	      if(strcmp(tmpStr1,"..") != 0) ++appendCount;
-	    }
-	}  
-    }while(0);
+/* return the value at the top of the stack and remove it, updating
+ * stack_size. top->prev becomes the new "top" */
+static grp_stack_data pop_grp_stack(grp_stack* mystack) {
+  grp_stack_data retval = grp_stack_default;
+  if(mystack && mystack->top) {
+    grp_stack_item* newtop = mystack->top->prev;
+    retval = grp_stack_remove(mystack->top);
+    mystack->top = newtop;
+    if(0 == --mystack->stack_size) mystack->top = NULL;
+  }
+  return retval;
+}
 
-  return(*status);
+/* add to the stack after the top element. the added element becomes
+ * the new "top" */
+static void push_grp_stack(grp_stack* mystack, grp_stack_data data) {
+  if(!mystack) return;
+  mystack->top = grp_stack_append(mystack->top, data);
+  ++mystack->stack_size;
+  return;
 }
 
+/* return the value at the bottom of the stack and remove it, updating
+ * stack_size. "top" pointer is unaffected */
+static grp_stack_data shift_grp_stack(grp_stack* mystack) {
+  grp_stack_data retval = grp_stack_default;
+  if(mystack && mystack->top) {
+    retval = grp_stack_remove(mystack->top->next); /* top->next == bottom */
+    if(0 == --mystack->stack_size) mystack->top = NULL;
+  }
+  return retval;
+}
+
+/* add to the stack after the top element. "top" is unaffected, except
+ * in the special case of an initially empty stack */
+/* static void unshift_grp_stack(grp_stack* mystack, grp_stack_data data) {
+   if(!mystack) return;
+   if(mystack->top) grp_stack_append(mystack->top, data);
+   else mystack->top = grp_stack_append(NULL, data);
+   ++mystack->stack_size;
+   return;
+   } */
+
 /*--------------------------------------------------------------------------*/
 int fits_url2relurl(char     *refURL, /* I reference URL string             */
 		    char     *absURL, /* I absoulute URL string to process  */
diff --git a/grparser.c b/grparser.c
index 408d3de..d21c098 100644
--- a/grparser.c
+++ b/grparser.c
@@ -53,6 +53,17 @@
 		existing HDUs to built a list of already used EXTNAME/EXTVERs
 22-Jan-99: Bruce O'Neel, bugfix : TLONG should always reference long type
 		variable on OSF/Alpha and on 64-bit archs in general
+20-Jun-2002 Wm Pence, added support for the HIERARCH keyword convention in
+                which keyword names can effectively be longer than 8 characters.
+                Example:
+                HIERARCH  LongKeywordName = 'value' / comment
+30-Jan-2003 Wm Pence, bugfix: ngp_read_xtension was testing for "ASCIITABLE" 
+                instead of "TABLE" as the XTENSION value of an ASCII table,
+                and it did not allow for optional trailing spaces in the
+                "IMAGE" or "TABLE" string. 
+16-Dec-2003 James Peachey: ngp_keyword_all_write was modified to apply
+                comments from the template file to the output file in
+                the case of reserved keywords (e.g. tform#, ttype# etcetera).
 */
 
 
@@ -215,6 +226,27 @@ int	ngp_strcasecmp(char *p1, char *p2)
     }
  }
 
+int	ngp_strcasencmp(char *p1, char *p2, int n)
+ { char c1, c2;
+   int ii;
+
+   for (ii=0;ii<n;ii++)
+    {
+      c1 = *p1;
+      if ((c1 >= 'a') && (c1 <= 'z')) c1 += ('A' - 'a');
+
+      c2 = *p2;
+      if ((c2 >= 'a') && (c2 <= 'z')) c2 += ('A' - 'a');
+
+      if (c1 < c2) return(-1);
+      if (c1 > c2) return(1);
+      if (0 == c1) return(0);
+      p1++;
+      p2++;
+    }
+    return(0);
+ }
+
 	/* read one line from file */
 
 int	ngp_line_from_file(FILE *fp, char **p)
@@ -394,6 +426,21 @@ int	ngp_extract_tokens(NGP_RAW_LINE *cl)
           break;
         }
 
+      /*
+        from Richard Mathar, 2002-05-03, add 10 lines:
+        if upper/lowercase HIERARCH followed also by an equal sign...
+      */
+      if( strncasecmp("HIERARCH",p,strlen("HIERARCH")) == 0 )
+      {
+           char * const eqsi=strchr(p,'=') ;
+           if( eqsi )
+           {
+              cl_flags |= NGP_FOUND_EQUAL_SIGN ;
+              p=eqsi ;
+              break ;
+           }
+      }
+
       if ((' ' == *p) || ('\t' == *p)) break;
       if ('=' == *p)
         { cl_flags |= NGP_FOUND_EQUAL_SIGN;
@@ -623,8 +670,10 @@ int	ngp_read_line(int ignore_blank_lines)
       if (NULL == ngp_curline.name)  continue;	/* skip lines consisting only of whitespaces */
 
       for (k = 0; k < strlen(ngp_curline.name); k++)
-        if ((ngp_curline.name[k] >= 'a') && (ngp_curline.name[k] <= 'z')) 
-          ngp_curline.name[k] += 'A' - 'a';	/* force keyword to be upper case */
+       { if ((ngp_curline.name[k] >= 'a') && (ngp_curline.name[k] <= 'z')) 
+           ngp_curline.name[k] += 'A' - 'a';	/* force keyword to be upper case */
+         if (k == 7) break;  /* only first 8 chars are required to be upper case */
+       }
 
       for (k=0;; k++)				/* find index of keyword in keyword table */
        { if (NGP_TOKEN_UNKNOWN == ngp_tkdef[k].code) break;
@@ -696,8 +745,9 @@ int	ngp_read_line(int ignore_blank_lines)
       strncpy(ngp_linkey.name, ngp_curline.name, NGP_MAX_NAME); /* and keyword's name */
       ngp_linkey.name[NGP_MAX_NAME - 1] = 0;
 
-      if (strlen(ngp_linkey.name) > 8)
-        { return(NGP_BAD_ARG);		/* cfitsio does not allow names > 8 chars */
+      if (strlen(ngp_linkey.name) > FLEN_KEYWORD)  /* WDP: 20-Jun-2002:  mod to support HIERARCH */
+        { 
+           return(NGP_BAD_ARG);		/* cfitsio does not allow names > 8 chars */
         }
       
       return(NGP_OK);			/* we have valid non empty line, so return success */
@@ -760,7 +810,8 @@ int     ngp_keyword_all_write(NGP_HDU *ngph, fitsfile *ffp, int mode)
    r = NGP_OK;
    
    for (i=0; i<ngph->tokcnt; i++)
-    { if ((NGP_REALLY_ALL & mode) || (NGP_OK == ngp_keyword_is_write(&(ngph->tok[i]))))
+    { r = ngp_keyword_is_write(&(ngph->tok[i]));
+      if ((NGP_REALLY_ALL & mode) || (NGP_OK == r))
         { switch (ngph->tok[i].type)
            { case NGP_TTYPE_BOOL:
 			ib = ngph->tok[i].value.b;
@@ -795,8 +846,17 @@ int     ngp_keyword_all_write(NGP_HDU *ngph, fitsfile *ffp, int mode)
 			fits_write_record(ffp, buf, &r);
                         break;
            }
-          if (r) return(r);
         }
+      else if (NGP_BAD_ARG == r) /* enhancement 10 dec 2003, James Peachey: template comments replace defaults */
+        { r = NGP_OK;						/* update comments of special keywords like TFORM */
+          if (ngph->tok[i].comment && *ngph->tok[i].comment)	/* do not update with a blank comment */
+            { fits_modify_comment(ffp, ngph->tok[i].name, ngph->tok[i].comment, &r);
+            }
+        }
+      else /* other problem, typically a blank token */
+        { r = NGP_OK;						/* skip this token, but continue */
+        }
+      if (r) return(r);
     }
      
    fits_set_hdustruc(ffp, &r);				/* resync cfitsio */
@@ -986,9 +1046,9 @@ int	ngp_read_xtension(fitsfile *ff, int parent_hn, int simple_mode)
        for (i=0; i<ngph.tokcnt; i++)
         { if (!strcmp("XTENSION", ngph.tok[i].name))
             { if (NGP_TTYPE_STRING == ngph.tok[i].type)
-                { if (!ngp_strcasecmp("BINTABLE", ngph.tok[i].value.s)) ngph_node_type = NGP_NODE_BTABLE;
-                  if (!ngp_strcasecmp("ASCIITABLE", ngph.tok[i].value.s)) ngph_node_type = NGP_NODE_ATABLE;
-                  if (!ngp_strcasecmp("IMAGE", ngph.tok[i].value.s)) ngph_node_type = NGP_NODE_IMAGE;
+                { if (!ngp_strcasencmp("BINTABLE", ngph.tok[i].value.s,8)) ngph_node_type = NGP_NODE_BTABLE;
+                  if (!ngp_strcasencmp("TABLE", ngph.tok[i].value.s,5)) ngph_node_type = NGP_NODE_ATABLE;
+                  if (!ngp_strcasencmp("IMAGE", ngph.tok[i].value.s,5)) ngph_node_type = NGP_NODE_IMAGE;
                 }
             }
           else if (!strcmp("SIMPLE", ngph.tok[i].name))
diff --git a/grparser.h b/grparser.h
index 32a172b..56bdea0 100644
--- a/grparser.h
+++ b/grparser.h
@@ -14,6 +14,8 @@
 20-Oct-98: added declarations NGP_XTENSION_SIMPLE and NGP_XTENSION_FIRST
 24-Oct-98: prototype of ngp_read_line() function updated.
 22-Jan-99: prototype for ngp_set_extver() function added.
+20-Jun-2002 Wm Pence, added support for the HIERARCH keyword convention
+            (changed NGP_MAX_NAME from (20) to FLEN_KEYWORD)
 */
 
 #ifndef	GRPARSER_H_INCLUDED
@@ -30,7 +32,8 @@ extern "C" {
 #define	NGP_ALLOCCHUNK		(1000)
 #define	NGP_MAX_INCLUDE		(10)			/* include file nesting limit */
 #define	NGP_MAX_COMMENT		(80)			/* max size for comment */
-#define	NGP_MAX_NAME		(20)			/* max size for KEYWORD (FITS limits it to 8 chars) */
+#define	NGP_MAX_NAME		FLEN_KEYWORD		/* max size for KEYWORD (FITS limits it to 8 chars) */
+                                                        /* except HIERARCH can have longer effective keyword names */
 #define	NGP_MAX_STRING		(80)			/* max size for various strings */
 #define	NGP_MAX_ARRAY_DIM	(999)			/* max. number of dimensions in array */
 #define NGP_MAX_FNAME           (1000)                  /* max size of combined path+fname */
@@ -155,6 +158,7 @@ int	ngp_get_extver(char *extname, int *version);
 int	ngp_set_extver(char *extname, int version);
 int	ngp_delete_extver_tab(void);
 int	ngp_strcasecmp(char *p1, char *p2);
+int	ngp_strcasencmp(char *p1, char *p2, int n);
 int	ngp_line_from_file(FILE *fp, char **p);
 int	ngp_free_line(void);
 int	ngp_free_prevline(void);
diff --git a/histo.c b/histo.c
index eaf19c8..525f50f 100644
--- a/histo.c
+++ b/histo.c
@@ -485,10 +485,10 @@ int ffhist(fitsfile **fptr,  /* IO - pointer to table with X and Y cols;    */
     int ii, datatype, repeat, imin, imax, ibin, bitpix, tstatus, use_datamax = 0;
     long haxes[4];
     fitsfile *histptr;
-    char errmsg[FLEN_ERRMSG], keyname[FLEN_KEYWORD];
+    char errmsg[FLEN_ERRMSG], keyname[FLEN_KEYWORD], card[FLEN_CARD];
     tcolumn *colptr;
     iteratorCol imagepars[1];
-    int n_cols = 1;
+    int n_cols = 1, nkeys;
     long  offset = 0;
     long n_per_loop = -1;  /* force whole array to be passed at one time */
     histType histData;    /* Structure holding histogram info for iterator */
@@ -667,7 +667,10 @@ int ffhist(fitsfile **fptr,  /* IO - pointer to table with X and Y cols;    */
         return(*status = BAD_DATATYPE);
       }
 
-      datatype = colptr->tdatatype;
+      /* get the datatype of the column */
+      fits_get_coltype(*fptr, histData.hcolnum[ii], &datatype,
+         NULL, NULL, status);
+
       if (datatype < 0 || datatype == TSTRING)
       {
         strcpy(errmsg, "Inappropriate datatype; can't bin this column: ");
@@ -864,6 +867,15 @@ int ffhist(fitsfile **fptr,  /* IO - pointer to table with X and Y cols;    */
         return(*status);
     }
 
+    /* copy all non-structural keywords from the table to the image */
+    fits_get_hdrspace(*fptr, &nkeys, NULL, status);
+    for (ii = 1; ii <= nkeys; ii++)
+    {
+       fits_read_record(*fptr, ii, card, status);
+       if (fits_get_keyclass(card) >= 120)
+           fits_write_record(histptr, card, status);
+    }           
+
     /* Set global variables with histogram parameter values.    */
     /* Use separate scalar variables rather than arrays because */
     /* it is more efficient when computing the histogram.       */
diff --git a/imcompress.c b/imcompress.c
index d66cfb1..fbc3842 100644
--- a/imcompress.c
+++ b/imcompress.c
@@ -5,7 +5,131 @@
 # include "fitsio2.h"
 
 /*--------------------------------------------------------------------------*/
-int fits_comp_img(fitsfile *infptr, /* pointer to image to be compressed */
+int fits_set_compression_type(fitsfile *fptr,  /* I - FITS file pointer     */
+       int ctype,    /* image compression type code;                        */
+                     /* allowed values: RICE_1, GZIP_1, PLIO_1, HCOMPRESS_1 */
+       int *status)  /* IO - error status                                   */
+{
+/*
+   This routine specifies the image compression algorithm that should be
+   used when writing a FITS image.  The image is divided into tiles, and
+   each tile is compressed and stored in a row of at variable length binary
+   table column.
+*/
+    (fptr->Fptr)->request_compress_type = ctype;
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_set_tile_dim(fitsfile *fptr,  /* I - FITS file pointer             */
+           int ndim,   /* number of dimensions in the compressed image      */
+           long *dims, /* size of image compression tile in each dimension  */
+                      /* default tile size = (NAXIS1, 1, 1, ...)            */
+           int *status)         /* IO - error status                        */
+{
+/*
+   This routine specifies the size (dimension) of the image
+   compression  tiles that should be used when writing a FITS
+   image.  The image is divided into tiles, and each tile is compressed
+   and stored in a row of at variable length binary table column.
+*/
+    int ii;
+
+    if (ndim < 0 || ndim > MAX_COMPRESS_DIM)
+    {
+        *status = BAD_DIMEN;
+        return(*status);
+    }
+
+    for (ii = 0; ii < ndim; ii++)
+    {
+        (fptr->Fptr)->request_tilesize[ii] = dims[ii];
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_set_noise_bits(fitsfile *fptr,  /* I - FITS file pointer   */
+           int noisebits,       /* noise_bits parameter value       */
+                                /* (default = 4)                    */
+           int *status)         /* IO - error status                */
+{
+/*
+   This routine specifies the value of the noice_bits parameter that
+   should be used when compressing floating point images.  The image is
+   divided into tiles, and each tile is compressed and stored in a row
+   of at variable length binary table column.
+*/
+    if (noisebits < 1 || noisebits > 16)
+    {
+        *status = DATA_COMPRESSION_ERR;
+        return(*status);
+    }
+
+    (fptr->Fptr)->request_rice_nbits = noisebits;
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_get_compression_type(fitsfile *fptr,  /* I - FITS file pointer     */
+       int *ctype,   /* image compression type code;                        */
+                     /* allowed values: RICE_1, GZIP_1, PLIO_1, HCOMPRESS_1 */
+       int *status)  /* IO - error status                                   */
+{
+/*
+   This routine returns the image compression algorithm that should be
+   used when writing a FITS image.  The image is divided into tiles, and
+   each tile is compressed and stored in a row of at variable length binary
+   table column.
+*/
+    *ctype = (fptr->Fptr)->request_compress_type;
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_get_tile_dim(fitsfile *fptr,  /* I - FITS file pointer             */
+           int ndim,   /* number of dimensions in the compressed image      */
+           long *dims, /* size of image compression tile in each dimension  */
+                       /* default tile size = (NAXIS1, 1, 1, ...)           */
+           int *status)         /* IO - error status                        */
+{
+/*
+   This routine returns the size (dimension) of the image
+   compression  tiles that should be used when writing a FITS
+   image.  The image is divided into tiles, and each tile is compressed
+   and stored in a row of at variable length binary table column.
+*/
+    int ii;
+
+    if (ndim < 0 || ndim > MAX_COMPRESS_DIM)
+    {
+        *status = BAD_DIMEN;
+        return(*status);
+    }
+
+    for (ii = 0; ii < ndim; ii++)
+    {
+        dims[ii] = (fptr->Fptr)->request_tilesize[ii];
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_get_noise_bits(fitsfile *fptr,  /* I - FITS file pointer   */
+           int *noisebits,       /* noise_bits parameter value       */
+                                /* (default = 4)                    */
+           int *status)         /* IO - error status                */
+
+{
+/*
+   This routine returns the value of the noice_bits parameter that
+   should be used when compressing floating point images.  The image is
+   divided into tiles, and each tile is compressed and stored in a row
+   of at variable length binary table column.
+*/
+
+    *noisebits = (fptr->Fptr)->request_rice_nbits;
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_compress_img(fitsfile *infptr, /* pointer to image to be compressed */
                  fitsfile *outfptr, /* empty HDU for output compressed image */
                  int compress_type, /* compression type code               */
                                     /*  RICE_1, HCOMPRESS_1, etc.          */
@@ -56,6 +180,13 @@ int fits_comp_img(fitsfile *infptr, /* pointer to image to be compressed */
             tilesize[ii] = minvalue(intilesize[ii], naxes[ii]);
         }
     }
+
+    if (blocksize <= 0)
+        blocksize = 32;  /* default value */
+
+    if (nbits <= 0)
+        nbits = 4;       /* default value */
+
     /* initialize output table */
     if (imcomp_init_table(outfptr, compress_type, bitpix, naxis, naxes,
         tilesize, blocksize, nbits, status) > 0)
@@ -89,7 +220,7 @@ int imcomp_init_table(fitsfile *outfptr,
         int bitpix,
         int naxis,
         long *naxes,
-        long *tilesize, 
+        long *tiledim, 
         int rice_blocksize,
         int rice_nbits,
         int *status) 
@@ -100,7 +231,7 @@ int imcomp_init_table(fitsfile *outfptr,
 {
     char keyname[FLEN_KEYWORD], zcmptype[12];
     int ii, ncols;
-    long nrows;
+    long nrows, tilesize[9] = {0,1,1,1,1,1,1,1,1};
     char *ttype[] = {"COMPRESSED_DATA", "UNCOMPRESSED_DATA", "ZSCALE", "ZZERO"};
     char *tform[4];
     char tf0[4], tf1[4], tf2[4], tf3[4];
@@ -109,7 +240,26 @@ int imcomp_init_table(fitsfile *outfptr,
     if (*status > 0)
         return(*status);
 
-    /* set up array of TFORM strings */
+    for (ii = 0; ii < naxis; ii++)
+        tilesize[ii] = tiledim[ii];  /* copy input to local variable */
+
+    /* if legal tile dimensions are not defined, use NAXIS1 as the */
+    /* first dimension and 1 for all the higher dimensions */
+
+    if (tilesize[0] <= 0)
+        tilesize[0] = naxes[0];
+
+    for (ii = 1; ii < naxis; ii++)
+    {
+        if (tilesize[ii] <= 0)
+            tilesize[ii] = 1;
+    }
+
+    /*  (only used to quantize floating point images)  */
+    if (rice_nbits < 1)  /* use default value if input is not legal */
+        rice_nbits = 4;
+
+    /* ---- set up array of TFORM strings -------------------------------*/
     strcpy(tf0, "1PB");
     strcpy(tf2, "1D");
     strcpy(tf3, "1D");
@@ -151,7 +301,7 @@ int imcomp_init_table(fitsfile *outfptr,
     }
     else
     {
-        ffpmsg("unknown compression type (fits_comp_img)");
+        ffpmsg("unknown compression type (imcomp_init_table)");
         return(*status = DATA_COMPRESSION_ERR);
     }
 
@@ -208,6 +358,7 @@ int imcomp_init_table(fitsfile *outfptr,
         {
             ffpkys (outfptr, "ZNAME2", "NOISEBIT",
                 "floating point quantization level", status);
+
             ffpkyj (outfptr, "ZVAL2", (long) rice_nbits,
                 "floating point quantization level", status);
         }
@@ -218,6 +369,7 @@ int imcomp_init_table(fitsfile *outfptr,
         {
             ffpkys (outfptr, "ZNAME1", "NOISEBIT",
                 "floating point quantization level", status);
+
             ffpkyj (outfptr, "ZVAL1", (long) rice_nbits,
                 "floating point quantization level", status);
         }
@@ -456,22 +608,26 @@ int imcomp_compress_tile (fitsfile *outfptr,
    are written to the output table.
 */
 {
-    int *idata;		/* quantized integer data */
+    int *idata = 0;		/* quantized integer data */
     short *cbuf;	/* compressed data */
     int clen;		/* size of cbuf */
     int flag = 1;		/* true if data were quantized */
     int iminval = 0, imaxval = 0;  /* min and max quantized integers */
-    double bscale[1], bzero[1];	/* scaling parameters */
+    double bscale[1] = {1.}, bzero[1] = {0.};	/* scaling parameters */
     int  nelem = 0;		/* number of bytes */
     size_t gzip_nelem = 0;
+    long ii;
 
     if (*status > 0)
         return(*status);
 
-    idata = tiledata;
-
-    /* if floating point data, allocate a buffer for the quantized values */
-    if (datatype >= TFLOAT)
+    if (datatype == TINT || datatype == TUINT) 
+    {
+   /* POTENTIAL BUG??  When reading unsigned int values they will be  */
+   /* interpret them as signed integers? */
+        idata = tiledata;
+    }
+    else
     {
         idata = (int*) calloc (tilelen, sizeof (int));
         if (idata == NULL)
@@ -480,19 +636,72 @@ int imcomp_compress_tile (fitsfile *outfptr,
 	    return (*status = MEMORY_ALLOCATION);
         }
 
-        if (datatype == TFLOAT)
+        if (datatype == TSHORT)
         {
+          for (ii = 0; ii < tilelen; ii++)
+            idata[ii] = ((short *)tiledata)[ii];
+        }
+        else if (datatype == TUSHORT)
+        {
+          for (ii = 0; ii < tilelen; ii++)
+            idata[ii] = ((unsigned short *)tiledata)[ii];
+        }
+        else if (datatype == TLONG)
+        {
+          for (ii = 0; ii < tilelen; ii++)
+            idata[ii] = ((long *)tiledata)[ii];
+        }
+        else if (datatype == TBYTE)
+        {
+          for (ii = 0; ii < tilelen; ii++)
+            idata[ii] = ((unsigned char *)tiledata)[ii];
+        }
+        else if (datatype == TSBYTE)
+        {
+          for (ii = 0; ii < tilelen; ii++)
+            idata[ii] = ((signed char *)tiledata)[ii];
+        }
+        else if (datatype == TFLOAT)
+        {
+          /* if the tile-compressed table contains zscale and zzero columns */
+          /* then scale and quantize the input floating point data.    */
+          /* Otherwise, just truncate the floats to integers.          */
+          if ((outfptr->Fptr)->cn_zscale > 0)
+          {
             /* quantize the float values into integers */
             flag = fits_quantize_float ((float *) tiledata, tilelen,
                FLOATNULLVALUE, (outfptr->Fptr)->rice_nbits, idata,
                bscale, bzero, &iminval, &imaxval);
+          }
+          else
+          {
+            for (ii = 0; ii < tilelen; ii++)
+              idata[ii] = ((float *)tiledata)[ii];
+          }
         }
         else if (datatype == TDOUBLE)
         {
+          /* if the tile-compressed table contains zscale and zzero columns */
+          /* then scale and quantize the input floating point data.    */
+          /* Otherwise, just truncate the floats to integers.          */
+          if ((outfptr->Fptr)->cn_zscale > 0)
+          {
             /* quantize the double values into integers */
             flag = fits_quantize_double ((double *) tiledata, tilelen,
                DOUBLENULLVALUE, (outfptr->Fptr)->rice_nbits, idata,
                bscale, bzero, &iminval, &imaxval);
+          }
+          else
+          {
+            for (ii = 0; ii < tilelen; ii++)
+              idata[ii] = ((double *)tiledata)[ii];
+          }
+        }
+        else
+        {
+          ffpmsg("unsupported datatype for compressing image");
+          free(idata);
+          return(*status = BAD_DATATYPE);
         }
     }
 
@@ -504,7 +713,7 @@ int imcomp_compress_tile (fitsfile *outfptr,
         if (cbuf == NULL)
         {
             ffpmsg("Out of memory. (imcomp_compress_tile)");
-            if (datatype >= TFLOAT)
+            if (datatype != TINT && datatype != TUINT) 
                 free(idata);
 	    return (*status = MEMORY_ALLOCATION);
         }
@@ -525,6 +734,8 @@ int imcomp_compress_tile (fitsfile *outfptr,
                 {
                    /* plio algorithn only supports positive 24 bit ints */
                    ffpmsg("data out of range for PLIO compression (0 - 2**24)");
+                   if (datatype != TINT && datatype != TUINT) 
+                      free(idata);
                    return(*status = DATA_DECOMPRESSION_ERR);
                 }
 
@@ -537,68 +748,540 @@ int imcomp_compress_tile (fitsfile *outfptr,
         else if ( (outfptr->Fptr)->compress_type == GZIP_1)
         {
 
-#if BYTESWAPPED
-               ffswap4(idata, tilelen); /* reverse order of bytes */
-#endif
-                compress2mem_from_mem((char *) idata, tilelen * sizeof(int),
-                 (char **) &cbuf, (size_t *) &clen, realloc, 
-                 &gzip_nelem, status);
+#if BYTESWAPPED
+               ffswap4(idata, tilelen); /* reverse order of bytes */
+#endif
+                compress2mem_from_mem((char *) idata, tilelen * sizeof(int),
+                 (char **) &cbuf, (size_t *) &clen, realloc, 
+                 &gzip_nelem, status);
+
+	        /* Write the compressed byte stream. */
+                ffpclb(outfptr, (outfptr->Fptr)->cn_compressed, row, 1,
+                     gzip_nelem, (unsigned char *) cbuf, status);
+        }
+        else if ( (outfptr->Fptr)->compress_type == HCOMPRESS_1)
+        {
+           /* add support for this compression algorithm here */
+        }
+
+	if (nelem < 0)  /* error condition */
+        {
+            if (datatype != TINT && datatype != TUINT) 
+                free(idata);
+	    free (cbuf);
+            ffpmsg
+                ("error compressing row of the image (imcomp_compress_tile)");
+            return (*status = DATA_COMPRESSION_ERR);
+        }
+
+        if ((outfptr->Fptr)->cn_zscale > 0)
+        {
+              /* write the linear scaling parameters */
+	      ffpcld (outfptr, (outfptr->Fptr)->cn_zscale, row, 1, 1,
+                      bscale, status);
+	      ffpcld (outfptr, (outfptr->Fptr)->cn_zzero,  row, 1, 1,
+                      bzero,  status);
+         }
+
+         free(cbuf);  /* finished with this buffer */
+    } 
+    else     /* floating point data couldn't be quantized */
+    {
+	 /* Write the original floating point data. */
+         if (datatype == TFLOAT)
+         {
+              ffpcle (outfptr, (outfptr->Fptr)->cn_uncompressed, row, 1,
+                      tilelen, (float *)tiledata, status);
+         }
+         else if (datatype == TDOUBLE)
+         {
+              ffpcld (outfptr, (outfptr->Fptr)->cn_uncompressed, row, 1,
+                      tilelen, (double *)tiledata, status);
+         }
+    }
+
+    if (datatype != TINT && datatype != TUINT)
+       free(idata);
+
+    return (*status);
+}
+/*---------------------------------------------------------------------------*/
+int fits_write_compressed_img(fitsfile *fptr,   /* I - FITS file pointer     */
+            int  datatype,   /* I - datatype of the array to be written      */
+            long  *infpixel, /* I - 'bottom left corner' of the subsection   */
+            long  *inlpixel, /* I - 'top right corner' of the subsection     */
+            int  nullcheck,  /* I - 0 for no null checking                   */
+                             /*     1: pixels that are = nullval will be     */
+                             /*     written with the FITS null pixel value   */
+                             /*     (floating point arrays only)             */
+            void *array,     /* I - array of values to be written            */
+            void *nullval,   /* I - undefined pixel value (floating pt only) */
+            int  *status)    /* IO - error status                            */
+/*
+   Write a section of a compressed image.
+*/
+{
+    int naxis[MAX_COMPRESS_DIM], tiledim[MAX_COMPRESS_DIM];
+    long tilesize[MAX_COMPRESS_DIM], thistilesize[MAX_COMPRESS_DIM];
+    long ftile[MAX_COMPRESS_DIM], ltile[MAX_COMPRESS_DIM];
+    long tfpixel[MAX_COMPRESS_DIM], tlpixel[MAX_COMPRESS_DIM];
+    long rowdim[MAX_COMPRESS_DIM], offset[MAX_COMPRESS_DIM],ntemp;
+    long fpixel[MAX_COMPRESS_DIM], lpixel[MAX_COMPRESS_DIM];
+    int ii, i5, i4, i3, i2, i1, i0, ndim, irow, pixlen, tilenul;
+    void *buffer;
+    char *bnullarray = 0;
+
+    if (*status > 0) 
+        return(*status);
+
+    if (!fits_is_compressed_image(fptr, status) )
+    {
+        ffpmsg("CHDU is not a compressed image (fits_write_compressed_img)");
+        return(*status = DATA_COMPRESSION_ERR);
+    }
+
+    /* reset position to the correct HDU if necessary */
+    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+
+    /* rescan header if data structure is undefined */
+    else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
+        if ( ffrdef(fptr, status) > 0)               
+            return(*status);
+
+    /* get temporary space for uncompressing one image tile */
+    if (datatype == TSHORT)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (short));
+       pixlen = sizeof(short);
+    }
+    else if (datatype == TINT)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (int));
+       pixlen = sizeof(int);
+    }
+    else if (datatype == TLONG)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (long));
+       pixlen = sizeof(long);
+    }
+    else if (datatype == TFLOAT)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (float));
+       pixlen = sizeof(float);
+    }
+    else if (datatype == TDOUBLE)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (double));
+       pixlen = sizeof(double);
+    }
+    else if (datatype == TUSHORT)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (unsigned short));
+       pixlen = sizeof(short);
+    }
+    else if (datatype == TUINT)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (unsigned int));
+       pixlen = sizeof(int);
+    }
+    else if (datatype == TULONG)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (unsigned long));
+       pixlen = sizeof(long);
+    }
+    else if (datatype == TBYTE || datatype == TSBYTE)
+    {
+       buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (char));
+       pixlen = 1;
+    }
+    else
+    {
+        ffpmsg("unsupported datatype for compressing image");
+        return(*status = BAD_DATATYPE);
+    }
+
+    if (buffer == NULL)
+    {
+	    ffpmsg("Out of memory (fits_write_compress_img)");
+	    return (*status = MEMORY_ALLOCATION);
+    }
+
+    /* initialize all the arrays */
+    for (ii = 0; ii < MAX_COMPRESS_DIM; ii++)
+    {
+        naxis[ii] = 1;
+        tiledim[ii] = 1;
+        tilesize[ii] = 1;
+        ftile[ii] = 1;
+        ltile[ii] = 1;
+        rowdim[ii] = 1;
+    }
+
+    ndim = (fptr->Fptr)->zndim;
+    ntemp = 1;
+    for (ii = 0; ii < ndim; ii++)
+    {
+        fpixel[ii] = infpixel[ii];
+        lpixel[ii] = inlpixel[ii];
+
+        /* calc number of tiles in each dimension, and tile containing */
+        /* the first and last pixel we want to read in each dimension  */
+        naxis[ii] = (fptr->Fptr)->znaxis[ii];
+        if (fpixel[ii] < 1)
+        {
+            free(buffer);
+            return(*status = BAD_PIX_NUM);
+        }
+
+        tilesize[ii] = (fptr->Fptr)->tilesize[ii];
+        tiledim[ii] = (naxis[ii] - 1) / tilesize[ii] + 1;
+        ftile[ii]   = (fpixel[ii] - 1)   / tilesize[ii] + 1;
+        ltile[ii]   = minvalue((lpixel[ii] - 1) / tilesize[ii] + 1, 
+                                tiledim[ii]);
+        rowdim[ii]  = ntemp;  /* total tiles in each dimension */
+        ntemp *= tiledim[ii];
+    }
+
+    /* support up to 6 dimensions for now */
+    /* tfpixel and tlpixel are the first and last image pixels */
+    /* along each dimension of the compression tile */
+    for (i5 = ftile[5]; i5 <= ltile[5]; i5++)
+    {
+     tfpixel[5] = (i5 - 1) * tilesize[5] + 1;
+     tlpixel[5] = minvalue(tfpixel[5] + tilesize[5] - 1, 
+                            naxis[5]);
+     thistilesize[5] = tlpixel[5] - tfpixel[5] + 1;
+     offset[5] = (i5 - 1) * rowdim[5];
+     for (i4 = ftile[4]; i4 <= ltile[4]; i4++)
+     {
+      tfpixel[4] = (i4 - 1) * tilesize[4] + 1;
+      tlpixel[4] = minvalue(tfpixel[4] + tilesize[4] - 1, 
+                            naxis[4]);
+      thistilesize[4] = thistilesize[5] * (tlpixel[4] - tfpixel[4] + 1);
+      offset[4] = (i4 - 1) * rowdim[4] + offset[5];
+      for (i3 = ftile[3]; i3 <= ltile[3]; i3++)
+      {
+        tfpixel[3] = (i3 - 1) * tilesize[3] + 1;
+        tlpixel[3] = minvalue(tfpixel[3] + tilesize[3] - 1, 
+                              naxis[3]);
+        thistilesize[3] = thistilesize[4] * (tlpixel[3] - tfpixel[3] + 1);
+        offset[3] = (i3 - 1) * rowdim[3] + offset[4];
+        for (i2 = ftile[2]; i2 <= ltile[2]; i2++)
+        {
+          tfpixel[2] = (i2 - 1) * tilesize[2] + 1;
+          tlpixel[2] = minvalue(tfpixel[2] + tilesize[2] - 1, 
+                                naxis[2]);
+          thistilesize[2] = thistilesize[3] * (tlpixel[2] - tfpixel[2] + 1);
+          offset[2] = (i2 - 1) * rowdim[2] + offset[3];
+          for (i1 = ftile[1]; i1 <= ltile[1]; i1++)
+          {
+            tfpixel[1] = (i1 - 1) * tilesize[1] + 1;
+            tlpixel[1] = minvalue(tfpixel[1] + tilesize[1] - 1, 
+                                  naxis[1]);
+            thistilesize[1] = thistilesize[2] * (tlpixel[1] - tfpixel[1] + 1);
+            offset[1] = (i1 - 1) * rowdim[1] + offset[2];
+            for (i0 = ftile[0]; i0 <= ltile[0]; i0++)
+            {
+              tfpixel[0] = (i0 - 1) * tilesize[0] + 1;
+              tlpixel[0] = minvalue(tfpixel[0] + tilesize[0] - 1, 
+                                    naxis[0]);
+              thistilesize[0] = thistilesize[1] * (tlpixel[0] - tfpixel[0] + 1);
+              /* calculate row of table containing this tile */
+              irow = i0 + offset[1];
+
+              /* read and uncompress this row (tile) of the table */
+              /* also do type conversion and undefined pixel substitution */
+              /* at this point */
+
+              imcomp_decompress_tile(fptr, irow, thistilesize[0],
+                    datatype, nullcheck, nullval, buffer, bnullarray, &tilenul,
+                     status);
+
+              if (*status == NO_COMPRESSED_TILE)
+              {
+                   /* tile doesn't exist, so initialize to zero */
+                   memset(buffer, 0, pixlen * thistilesize[0]);
+                   *status = 0;
+              }
+
+              /* copy the intersecting pixels to this tile from the input */
+              imcomp_merge_overlap(buffer, pixlen, ndim, tfpixel, tlpixel, 
+                     bnullarray, array, fpixel, lpixel, nullcheck, status);
+
+              /* compress the tile again, and write it back to the FITS file */
+              imcomp_compress_tile (fptr, irow, datatype, buffer, 
+                                    thistilesize[0], status);
+            }
+          }
+        }
+      }
+     }
+    }
+    free(buffer);
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_write_compressed_pixels(fitsfile *fptr, /* I - FITS file pointer   */
+            int  datatype,  /* I - datatype of the array to be written      */
+            OFF_T   fpixel,  /* I - 'first pixel to write          */
+            long   npixel,  /* I - number of pixels to write      */
+            int  nullcheck,  /* I - 0 for no null checking                   */
+                             /*     1: pixels that are = nullval will be     */
+                             /*     written with the FITS null pixel value   */
+                             /*     (floating point arrays only)             */
+            void *array,      /* I - array of values to write                */
+            void *nullval,    /* I - value used to represent undefined pixels*/
+            int  *status)     /* IO - error status                           */
+/*
+   Write a consecutive set of pixels to a compressed image.  This routine
+   interpretes the n-dimensional image as a long one-dimensional array. 
+   This is actually a rather inconvenient way to write compressed images in
+   general, and could be rather inefficient if the requested pixels to be
+   written are located in many different image compression tiles.    
+
+   The general strategy used here is to write the requested pixels in blocks
+   that correspond to rectangular image sections.  
+*/
+{
+    int naxis, ii, bytesperpixel;
+    long naxes[MAX_COMPRESS_DIM], nread;
+    OFF_T tfirst, tlast, last0, last1, dimsize[MAX_COMPRESS_DIM];
+    long nplane, firstcoord[MAX_COMPRESS_DIM], lastcoord[MAX_COMPRESS_DIM];
+    char *arrayptr;
+
+    if (*status > 0)
+        return(*status);
+
+    arrayptr = (char *) array;
+
+    /* get size of array pixels, in bytes */
+    bytesperpixel = ffpxsz(datatype);
+
+    for (ii = 0; ii < MAX_COMPRESS_DIM; ii++)
+    {
+        naxes[ii] = 1;
+        firstcoord[ii] = 0;
+        lastcoord[ii] = 0;
+    }
+
+    /*  determine the dimensions of the image to be read */
+    ffgidm(fptr, &naxis, status);
+    ffgisz(fptr, MAX_COMPRESS_DIM, naxes, status);
+
+    /* calc the cumulative number of pixels in each successive dimension */
+    dimsize[0] = 1;
+    for (ii = 1; ii < MAX_COMPRESS_DIM; ii++)
+         dimsize[ii] = dimsize[ii - 1] * naxes[ii - 1];
+
+    /*  determine the coordinate of the first and last pixel in the image */
+    /*  Use zero based indexes here */
+    tfirst = fpixel - 1;
+    tlast = tfirst + npixel - 1;
+    for (ii = naxis - 1; ii >= 0; ii--)
+    {
+        firstcoord[ii] = tfirst / dimsize[ii];
+        lastcoord[ii] = tlast / dimsize[ii];
+        tfirst = tfirst - firstcoord[ii] * dimsize[ii];
+        tlast = tlast - lastcoord[ii] * dimsize[ii];
+    }
+
+    /* to simplify things, treat 1-D, 2-D, and 3-D images as separate cases */
+
+    if (naxis == 1)
+    {
+        /* Simple: just write the requested range of pixels */
+
+        firstcoord[0] = firstcoord[0] + 1;
+        lastcoord[0] = lastcoord[0] + 1;
+        fits_write_compressed_img(fptr, datatype, firstcoord, lastcoord,
+            nullcheck, array, nullval, status);
+        return(*status);
+    }
+    else if (naxis == 2)
+    {
+        nplane = 0;  /* write 1st (and only) plane of the image */
+
+        fits_write_compressed_img_plane(fptr, datatype, bytesperpixel,
+          nplane, firstcoord, lastcoord, naxes, nullcheck,
+          array, nullval, &nread, status);
+    }
+    else if (naxis == 3)
+    {
+        /* test for special case: writing an integral number of planes */
+        if (firstcoord[0] == 0 && firstcoord[1] == 0 &&
+            lastcoord[0] == naxes[0] - 1 && lastcoord[1] == naxes[1] - 1)
+        {
+            for (ii = 0; ii < MAX_COMPRESS_DIM; ii++)
+            {
+                /* convert from zero base to 1 base */
+                (firstcoord[ii])++;
+                (lastcoord[ii])++;
+            }
+
+            /* we can write the contiguous block of pixels in one go */
+            fits_write_compressed_img(fptr, datatype, firstcoord, lastcoord,
+                nullcheck, array, nullval, status);
+            return(*status);
+        }
+
+        /* save last coordinate in temporary variables */
+        last0 = lastcoord[0];
+        last1 = lastcoord[1];
+
+        if (firstcoord[2] < lastcoord[2])
+        {
+            /* we will write up to the last pixel in all but the last plane */
+            lastcoord[0] = naxes[0] - 1;
+            lastcoord[1] = naxes[1] - 1;
+        }
+
+        /* write one plane of the cube at a time, for simplicity */
+        for (nplane = firstcoord[2]; nplane <= lastcoord[2]; nplane++)
+        {
+            if (nplane == lastcoord[2])
+            {
+                lastcoord[0] = last0;
+                lastcoord[1] = last1;
+            }
+
+            fits_write_compressed_img_plane(fptr, datatype, bytesperpixel,
+              nplane, firstcoord, lastcoord, naxes, nullcheck,
+              arrayptr, nullval, &nread, status);
+
+            /* for all subsequent planes, we start with the first pixel */
+            firstcoord[0] = 0;
+            firstcoord[1] = 0;
+
+            /* increment pointers to next elements to be written */
+            arrayptr = arrayptr + nread * bytesperpixel;
+        }
+    }
+    else
+    {
+        ffpmsg("only 1D, 2D, or 3D images are currently supported");
+        return(*status = DATA_COMPRESSION_ERR);
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_write_compressed_img_plane(fitsfile *fptr, /* I - FITS file    */
+            int  datatype,  /* I - datatype of the array to be written    */
+            int  bytesperpixel, /* I - number of bytes per pixel in array */
+            long   nplane,  /* I - which plane of the cube to write      */
+            long *firstcoord, /* I coordinate of first pixel to write */
+            long *lastcoord,  /* I coordinate of last pixel to write */
+            long *naxes,     /* I size of each image dimension */
+            int  nullcheck,  /* I - 0 for no null checking                   */
+                             /*     1: pixels that are = nullval will be     */
+                             /*     written with the FITS null pixel value   */
+                             /*     (floating point arrays only)             */
+            void *array,      /* I - array of values that are written        */
+            void *nullval,    /* I - value for undefined pixels              */
+            long *nread,      /* O - total number of pixels written          */
+            int  *status)     /* IO - error status                           */
+
+   /*
+           in general we have to write the first partial row of the image,
+           followed by the middle complete rows, followed by the last
+           partial row of the image.  If the first or last rows are complete,
+           then write them at the same time as all the middle rows.
+    */
+{
+    /* bottom left coord. and top right coord. */
+    long blc[MAX_COMPRESS_DIM], trc[MAX_COMPRESS_DIM]; 
+    char *arrayptr;
+
+    *nread = 0;
+
+    arrayptr = (char *) array;
+
+    blc[2] = nplane + 1;
+    trc[2] = nplane + 1;
+
+    if (firstcoord[0] != 0)
+    { 
+            /* have to read a partial first row */
+            blc[0] = firstcoord[0] + 1;
+            blc[1] = firstcoord[1] + 1;
+            trc[1] = blc[1];  
+            if (lastcoord[1] == firstcoord[1])
+               trc[0] = lastcoord[0] + 1; /* 1st and last pixels in same row */
+            else
+               trc[0] = naxes[0];  /* read entire rest of the row */
+
+            fits_write_compressed_img(fptr, datatype, blc, trc,
+                nullcheck, arrayptr, nullval, status);
+
+            *nread = *nread + trc[0] - blc[0] + 1;
+
+            if (lastcoord[1] == firstcoord[1])
+            {
+               return(*status);  /* finished */
+            }
+
+            /* set starting coord to beginning of next line */
+            firstcoord[0] = 0;
+            firstcoord[1] += 1;
+            arrayptr = arrayptr + (trc[0] - blc[0] + 1) * bytesperpixel;
+    }
+
+    /* write contiguous complete rows of the image, if any */
+    blc[0] = 1;
+    blc[1] = firstcoord[1] + 1;
+    trc[0] = naxes[0];
+
+    if (lastcoord[0] + 1 == naxes[0])
+    {
+            /* can write the last complete row, too */
+            trc[1] = lastcoord[1] + 1;
+    }
+    else
+    {
+            /* last row is incomplete; have to read it separately */
+            trc[1] = lastcoord[1];
+    }
+
+    if (trc[1] >= blc[1])  /* must have at least one whole line to read */
+    {
+        fits_write_compressed_img(fptr, datatype, blc, trc,
+                nullcheck, arrayptr, nullval, status);
+
+        *nread = *nread + (trc[1] - blc[1] + 1) * naxes[0];
+
+        if (lastcoord[1] + 1 == trc[1])
+               return(*status);  /* finished */
 
-	        /* Write the compressed byte stream. */
-                ffpclb(outfptr, (outfptr->Fptr)->cn_compressed, row, 1,
-                     gzip_nelem, (unsigned char *) cbuf, status);
-        }
-        else if ( (outfptr->Fptr)->compress_type == HCOMPRESS_1)
-        {
-        }
+        /* increment pointers for the last partial row */
+        arrayptr = arrayptr + (trc[1] - blc[1] + 1) * naxes[0] * bytesperpixel;
 
-	if (nelem < 0)  /* error condition */
-        {
-            if (datatype > TFLOAT)
-               free(idata);
-	    free (cbuf);
-            ffpmsg
-                ("error compressing row of the image (imcomp_compress_tile)");
-            return (*status = DATA_COMPRESSION_ERR);
-        }
+     }
 
-        if (datatype >= TFLOAT)
-        {
-              /* write the linear scaling parameters */
-	      ffpcld (outfptr, (outfptr->Fptr)->cn_zscale, row, 1, 1,
-                      bscale, status);
-	      ffpcld (outfptr, (outfptr->Fptr)->cn_zzero,  row, 1, 1,
-                      bzero,  status);
-         }
+    if (trc[1] == lastcoord[1] + 1)
+        return(*status);           /* all done */
 
-         free(cbuf);  /* finished with this buffer */
-    } 
-    else     /* floating point data couldn't be quantized */
-    {
-	 /* Write the original floating point data. */
-         if (datatype == TFLOAT)
-         {
-              ffpcle (outfptr, (outfptr->Fptr)->cn_uncompressed, row, 1,
-                      tilelen, (float *)tiledata, status);
-         }
-         else if (datatype == TDOUBLE)
-         {
-              ffpcld (outfptr, (outfptr->Fptr)->cn_uncompressed, row, 1,
-                      tilelen, (double *)tiledata, status);
-         }
-    }
+    /* set starting and ending coord to last line */
 
-    if (datatype >= TFLOAT)
-       free(idata);
+    trc[0] = lastcoord[0] + 1;
+    trc[1] = lastcoord[1] + 1;
+    blc[1] = trc[1];
 
-    return (*status);
+    fits_write_compressed_img(fptr, datatype, blc, trc,
+                nullcheck, arrayptr, nullval, status);
+
+    *nread = *nread + trc[0] - blc[0] + 1;
+
+    return(*status);
 }
+
 /* ######################################################################## */
 /* ###                 Image Decompression Routines                     ### */
 /* ######################################################################## */
 
 /*--------------------------------------------------------------------------*/
-int fits_decomp_img (fitsfile *infptr, /* image (bintable) to be uncompressed */
+int fits_decompress_img (fitsfile *infptr, /* image (bintable) to uncompress */
               fitsfile *outfptr,   /* empty HDU for output uncompressed image */
               int *status)         /* IO - error status               */
 
@@ -621,7 +1304,7 @@ int fits_decomp_img (fitsfile *infptr, /* image (bintable) to be uncompressed */
 
     if (!fits_is_compressed_image(infptr, status) )
     {
-        ffpmsg("CHDU is not a compressed image (fits_decomp_img)");
+        ffpmsg("CHDU is not a compressed image (fits_decompress_img)");
         return(*status = DATA_DECOMPRESSION_ERR);
     }
 
@@ -644,6 +1327,7 @@ int fits_decomp_img (fitsfile *infptr, /* image (bintable) to be uncompressed */
     /* decompressed values won't be scaled when written to the output image */
     ffrdef(outfptr, status);
     ffpscl(outfptr, 1.0, 0.0, status);
+    ffpscl(infptr, 1.0, 0.0, status);
 
     /* initialize; no null checking is needed for integer images */
     nullcheck = 0;
@@ -708,7 +1392,6 @@ int fits_decomp_img (fitsfile *infptr, /* image (bintable) to be uncompressed */
     /* uncompress the entire image into memory */
     /* This routine should be enhanced sometime to only need enough */
     /* memory to uncompress one tile at a time.  */
-
     fits_read_compressed_img(infptr, datatype, fpixel, lpixel, inc,  
             nullcheck, nulladdr, data, NULL, &anynul, status);
 
@@ -725,9 +1408,9 @@ int fits_decomp_img (fitsfile *infptr, /* image (bintable) to be uncompressed */
 /*---------------------------------------------------------------------------*/
 int fits_read_compressed_img(fitsfile *fptr,   /* I - FITS file pointer      */
             int  datatype,  /* I - datatype of the array to be returned      */
-            long  *fpixel,  /* I - 'bottom left corner' of the subsection    */
-            long  *lpixel,  /* I - 'top right corner' of the subsection      */
-            long  *inc,     /* I - increment to be applied in each dimension */
+            long  *infpixel, /* I - 'bottom left corner' of the subsection    */
+            long  *inlpixel, /* I - 'top right corner' of the subsection      */
+            long  *ininc,    /* I - increment to be applied in each dimension */
             int  nullcheck,  /* I - 0 for no null checking                   */
                               /*     1: set undefined pixels = nullval       */
                               /*     2: set nullarray=1 for undefined pixels */
@@ -747,6 +1430,8 @@ int fits_read_compressed_img(fitsfile *fptr,   /* I - FITS file pointer      */
     long ftile[MAX_COMPRESS_DIM], ltile[MAX_COMPRESS_DIM];
     long tfpixel[MAX_COMPRESS_DIM], tlpixel[MAX_COMPRESS_DIM];
     long rowdim[MAX_COMPRESS_DIM], offset[MAX_COMPRESS_DIM],ntemp;
+    long fpixel[MAX_COMPRESS_DIM], lpixel[MAX_COMPRESS_DIM];
+    long inc[MAX_COMPRESS_DIM];
     int ii, i5, i4, i3, i2, i1, i0, ndim, irow, pixlen, tilenul;
     void *buffer;
     char *bnullarray = 0;
@@ -754,11 +1439,9 @@ int fits_read_compressed_img(fitsfile *fptr,   /* I - FITS file pointer      */
     if (*status > 0) 
         return(*status);
 
-    buffer = inc; /* dummy statement to stop warning about unused variable */
-
     if (!fits_is_compressed_image(fptr, status) )
     {
-        ffpmsg("CHDU is not a compressed image (fits_decomp_img)");
+        ffpmsg("CHDU is not a compressed image (fits_read_compressed_img)");
         return(*status = DATA_DECOMPRESSION_ERR);
     }
 
@@ -803,7 +1486,7 @@ int fits_read_compressed_img(fitsfile *fptr,   /* I - FITS file pointer      */
        buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (unsigned long));
        pixlen = sizeof(long);
     }
-    else if (datatype == TBYTE)
+    else if (datatype == TBYTE || datatype == TSBYTE)
     {
        buffer =  calloc ((fptr->Fptr)->maxtilelen, sizeof (char));
        pixlen = 1;
@@ -847,6 +1530,20 @@ int fits_read_compressed_img(fitsfile *fptr,   /* I - FITS file pointer      */
     ntemp = 1;
     for (ii = 0; ii < ndim; ii++)
     {
+        /* support for mirror-reversed image sections */
+        if (infpixel[ii] <= inlpixel[ii])
+        {
+           fpixel[ii] = infpixel[ii];
+           lpixel[ii] = inlpixel[ii];
+           inc[ii]    = ininc[ii];
+        }
+        else
+        {
+           fpixel[ii] = inlpixel[ii];
+           lpixel[ii] = infpixel[ii];
+           inc[ii]    = -ininc[ii];
+        }
+
         /* calc number of tiles in each dimension, and tile containing */
         /* the first and last pixel we want to read in each dimension  */
         naxis[ii] = (fptr->Fptr)->znaxis[ii];
@@ -921,7 +1618,6 @@ int fits_read_compressed_img(fitsfile *fptr,   /* I - FITS file pointer      */
               /* read and uncompress this row (tile) of the table */
               /* also do type conversion and undefined pixel substitution */
               /* at this point */
-
               imcomp_decompress_tile(fptr, irow, thistilesize[0],
                     datatype, nullcheck, nullval, buffer, bnullarray, &tilenul,
                      status);
@@ -931,8 +1627,8 @@ int fits_read_compressed_img(fitsfile *fptr,   /* I - FITS file pointer      */
 
               /* copy the intersecting pixels from this tile to the output */
               imcomp_copy_overlap(buffer, pixlen, ndim, tfpixel, tlpixel, 
-                     bnullarray, array, fpixel, lpixel, nullcheck, nullarray,
-                     status);
+                     bnullarray, array, fpixel, lpixel, inc, nullcheck, 
+                     nullarray, status);
             }
           }
         }
@@ -949,8 +1645,8 @@ int fits_read_compressed_img(fitsfile *fptr,   /* I - FITS file pointer      */
 }
 /*--------------------------------------------------------------------------*/
 int fits_read_compressed_pixels(fitsfile *fptr, /* I - FITS file pointer    */
-            int  datatype,  /* I - datatype of the array to be returned      */
-            long   fpixel,  /* I - 'first pixel to read          */
+            int  datatype,  /* I - datatype of the array to be returned     */
+            OFF_T   fpixel, /* I - 'first pixel to read          */
             long   npixel,  /* I - number of pixels to read      */
             int  nullcheck,  /* I - 0 for no null checking                   */
                               /*     1: set undefined pixels = nullval       */
@@ -972,8 +1668,9 @@ int fits_read_compressed_pixels(fitsfile *fptr, /* I - FITS file pointer    */
 */
 {
     int naxis, ii, bytesperpixel, planenul;
-    long naxes[MAX_COMPRESS_DIM], dimsize[MAX_COMPRESS_DIM], nread;
-    long inc[MAX_COMPRESS_DIM], tfirst, tlast, last0, last1;
+    long naxes[MAX_COMPRESS_DIM], nread;
+    long inc[MAX_COMPRESS_DIM];
+    OFF_T tfirst, tlast, last0, last1, dimsize[MAX_COMPRESS_DIM];
     long nplane, firstcoord[MAX_COMPRESS_DIM], lastcoord[MAX_COMPRESS_DIM];
     char *arrayptr, *nullarrayptr;
 
@@ -1037,6 +1734,24 @@ int fits_read_compressed_pixels(fitsfile *fptr, /* I - FITS file pointer    */
     }
     else if (naxis == 3)
     {
+        /* test for special case: reading an integral number of planes */
+        if (firstcoord[0] == 0 && firstcoord[1] == 0 &&
+            lastcoord[0] == naxes[0] - 1 && lastcoord[1] == naxes[1] - 1)
+        {
+            for (ii = 0; ii < MAX_COMPRESS_DIM; ii++)
+            {
+                /* convert from zero base to 1 base */
+                (firstcoord[ii])++;
+                (lastcoord[ii])++;
+            }
+
+            /* we can read the contiguous block of pixels in one go */
+            fits_read_compressed_img(fptr, datatype, firstcoord, lastcoord, inc,
+                nullcheck, nullval, array, nullarray, anynul, status);
+
+            return(*status);
+        }
+
         if (anynul)
             *anynul = 0;  /* initialize */
 
@@ -1141,6 +1856,8 @@ int fits_read_compressed_img_plane(fitsfile *fptr, /* I - FITS file   */
             fits_read_compressed_img(fptr, datatype, blc, trc, inc,
                 nullcheck, nullval, arrayptr, nullarrayptr, &tnull, status);
 
+            *nread = *nread + trc[0] - blc[0] + 1;
+
             if (tnull && anynul)
                *anynul = 1;  /* there are null pixels */
 
@@ -1156,7 +1873,6 @@ int fits_read_compressed_img_plane(fitsfile *fptr, /* I - FITS file   */
             if (nullarrayptr && (nullcheck == 2) )
                 nullarrayptr = nullarrayptr + (trc[0] - blc[0] + 1);
 
-            *nread = *nread + trc[0] - blc[0] + 1;
     }
 
     /* read contiguous complete rows of the image, if any */
@@ -1180,6 +1896,8 @@ int fits_read_compressed_img_plane(fitsfile *fptr, /* I - FITS file   */
         fits_read_compressed_img(fptr, datatype, blc, trc, inc,
                 nullcheck, nullval, arrayptr, nullarrayptr, &tnull, status);
 
+        *nread = *nread + (trc[1] - blc[1] + 1) * naxes[0];
+
         if (tnull && anynul)
            *anynul = 1;
 
@@ -1190,8 +1908,6 @@ int fits_read_compressed_img_plane(fitsfile *fptr, /* I - FITS file   */
         arrayptr = arrayptr + (trc[1] - blc[1] + 1) * naxes[0] * bytesperpixel;
         if (nullarrayptr && (nullcheck == 2) )
                 nullarrayptr = nullarrayptr + (trc[1] - blc[1] + 1) * naxes[0];
-
-        *nread = *nread + (trc[1] - blc[1] + 1) * naxes[0];
      }
 
     if (trc[1] == lastcoord[1] + 1)
@@ -1361,23 +2077,20 @@ int imcomp_get_compressed_image_par(fitsfile *infptr, int *status)
     if (ffgcno(infptr, CASEINSEN, "COMPRESSED_DATA",
          &(infptr->Fptr)->cn_compressed, status) > 0)
     {
-        ffpmsg("couldn't find COMPRESSED_DATA column (fits_decomp_img)");
+        ffpmsg("couldn't find COMPRESSED_DATA column (fits_get_compressed_img_par)");
         return(*status = DATA_DECOMPRESSION_ERR);
     }
 
+    ffpmrk(); /* put mark on message stack; erase any messages after this */
+
     tstatus = 0;
-    if (ffgcno(infptr,CASEINSEN, "UNCOMPRESSED_DATA",
-          &(infptr->Fptr)->cn_uncompressed, &tstatus) > 0)
-    {
-         ffxmsg(-1, value);  /* clear spurious error message from stack */
-    }
+    ffgcno(infptr,CASEINSEN, "UNCOMPRESSED_DATA",
+          &(infptr->Fptr)->cn_uncompressed, &tstatus);
 
     tstatus = 0;
     if (ffgcno(infptr, CASEINSEN, "ZSCALE", &(infptr->Fptr)->cn_zscale,
               &tstatus) > 0)
     {
-         ffxmsg(-1, value);  /* clear spurious error message from stack */
-
         /* CMPSCALE column doesn't exist; see if there is a keyword */
         tstatus = 0;
         if (ffgky(infptr, TDOUBLE, "ZSCALE", &(infptr->Fptr)->zscale, NULL, 
@@ -1389,8 +2102,6 @@ int imcomp_get_compressed_image_par(fitsfile *infptr, int *status)
     if (ffgcno(infptr, CASEINSEN, "ZZERO", &(infptr->Fptr)->cn_zzero,
                &tstatus) > 0)
     {
-         ffxmsg(-1, value);  /* clear spurious error message from stack */
-
         /* CMPZERO column doesn't exist; see if there is a keyword */
         tstatus = 0;
         if (ffgky(infptr, TDOUBLE, "ZZERO", &(infptr->Fptr)->zzero, NULL, 
@@ -1402,8 +2113,6 @@ int imcomp_get_compressed_image_par(fitsfile *infptr, int *status)
     if (ffgcno(infptr, CASEINSEN, "ZBLANK", &(infptr->Fptr)->cn_zblank,
                &tstatus) > 0)
     {
-         ffxmsg(-1, value);  /* clear spurious error message from stack */
-
         /* CMPZERO column doesn't exist; see if there is a keyword */
         tstatus = 0;
         if (ffgky(infptr, TINT, "ZBLANK", &(infptr->Fptr)->zblank, NULL,
@@ -1411,6 +2120,22 @@ int imcomp_get_compressed_image_par(fitsfile *infptr, int *status)
             (infptr->Fptr)->cn_zblank = -1;  /* flag for a constant ZBLANK */
     }
 
+    /* read the conventional BSCALE and BZERO scaling keywords, if present */
+    tstatus = 0;
+    if (ffgky (infptr, TDOUBLE, "BSCALE", &(infptr->Fptr)->cn_bscale, 
+        NULL, &tstatus) > 0)
+    {
+        (infptr->Fptr)->cn_bscale = 1.0;
+    }
+
+    tstatus = 0;
+    if (ffgky (infptr, TDOUBLE, "BZERO", &(infptr->Fptr)->cn_bzero, 
+        NULL, &tstatus) > 0)
+    {
+        (infptr->Fptr)->cn_bzero = 0.0;
+    }
+
+    ffcmrk();  /* clear any spurious error messages, back to the mark */
     return (*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -1488,7 +2213,7 @@ int imcomp_decompress_tile (fitsfile *infptr,
     short snull = 0;
     int blocksize;
     double bscale, bzero, dummy = 0;    /* scaling parameters */
-    long nelem, offset;      /* number of bytes */
+    long nelem = 0, offset = 0;      /* number of bytes */
 
     if (*status > 0)
        return(*status);
@@ -1497,13 +2222,16 @@ int imcomp_decompress_tile (fitsfile *infptr,
     ffgdes (infptr, (infptr->Fptr)->cn_compressed, nrow, &nelem, &offset, 
             status);
 
+    /* EOF error here indicates that this tile has not yet been written */
+    if (*status == END_OF_FILE)
+       return(*status = NO_COMPRESSED_TILE);
+
     /* **************************************************************** */
     if (nelem == 0)  /* tile was not compressed; read uncompressed data */
     {
         if ((infptr->Fptr)->cn_uncompressed < 1 )
         {
-	    ffpmsg("No compressed data and no uncompressed data column");
-	    return (*status = DATA_DECOMPRESSION_ERR);
+	    return (*status = NO_COMPRESSED_TILE);
         }
 
         /* no compressed data, so simply read the uncompressed data */
@@ -1511,6 +2239,9 @@ int imcomp_decompress_tile (fitsfile *infptr,
         ffgdes (infptr, (infptr->Fptr)->cn_uncompressed, nrow, &nelem,
                &offset, status);
 
+        if (nelem == 0 && offset == 0)
+	    return (*status = NO_COMPRESSED_TILE);
+
         if (nullcheck <= 1)  
             fits_read_col(infptr, datatype, (infptr->Fptr)->cn_uncompressed,
                nrow, 1, nelem, nulval, buffer, anynul, status);
@@ -1542,7 +2273,7 @@ int imcomp_decompress_tile (fitsfile *infptr,
     else if ((infptr->Fptr)->cn_zscale == -1)
     {
         bscale = (infptr->Fptr)->zscale;
-        bzero = (infptr->Fptr)->zzero;
+        bzero  = (infptr->Fptr)->zzero;
     }
     else
     {
@@ -1560,6 +2291,15 @@ int imcomp_decompress_tile (fitsfile *infptr,
         }
     }
 
+    if (bscale == 1.0 && bzero == 0.0 ) 
+    {
+      /* if no other scaling has been specified, try using the values
+         given by the BSCALE and BZERO keywords, if any */
+
+        bscale = (infptr->Fptr)->cn_bscale;
+        bzero  = (infptr->Fptr)->cn_bzero;
+    }
+
     /* ************************************************************* */
 
     /* get the value used to represent nulls in the int array */
@@ -1612,8 +2352,8 @@ int imcomp_decompress_tile (fitsfile *infptr,
              1, nelem, &charnull, cbuf, NULL, status) > 0)
         {
             ffpmsg("error reading compressed byte stream from binary table");
-            free(idata);
 	    free (cbuf);
+            free(idata);
             return (*status);
         }
 
@@ -1622,8 +2362,8 @@ int imcomp_decompress_tile (fitsfile *infptr,
         if ((*status = fits_rdecomp (cbuf, nelem, (unsigned int *)idata,
                 tilelen, blocksize)))
         {
-            free(idata);
             free (cbuf);
+            free(idata);
             return (*status);
         }
 
@@ -1653,7 +2393,6 @@ int imcomp_decompress_tile (fitsfile *infptr,
         }
 
         pl_l2pi (sbuf, 1, idata, tilelen);  /* uncompress the data */
-
         free(sbuf);
     }
 
@@ -1757,6 +2496,12 @@ int imcomp_decompress_tile (fitsfile *infptr,
          *(unsigned char *) nulval, bnullarray, anynul,
           (unsigned char *) buffer, status);
     }
+    else if (datatype == TSBYTE)
+    {
+        fffi4s1(idata, tilelen, bscale, bzero, nullcheck, tnull,
+         *(signed char *) nulval, bnullarray, anynul,
+          (signed char *) buffer, status);
+    }
     else if (datatype == TUSHORT)
     {
         fffi4u2(idata, tilelen, bscale, bzero, nullcheck, tnull,
@@ -1793,6 +2538,7 @@ int imcomp_copy_overlap (
     char *image,        /* O - multi dimensional output image */
     long *fpixel,       /* I - first pixel number in each dim. of the image */
     long *lpixel,       /* I - last pixel number in each dim. of the image */
+    long *ininc,        /* I - increment to be applied in each image dimen. */
     int nullcheck,      /* I - 0, 1: do nothing; 2: set nullarray for nulls */
     char *nullarray, 
     int *status)
@@ -1802,15 +2548,23 @@ int imcomp_copy_overlap (
   Both the tile and the image must have the same number of dimensions. 
 */
 {
-    long imgdim[MAX_COMPRESS_DIM]; /* length of each axis of the output image */
-    long tiledim[MAX_COMPRESS_DIM]; /* length of each axis of the input tile */
-    long imgfpix[MAX_COMPRESS_DIM]; /* 1st image pix overlapping tile: 0 base */
-    long imglpix[MAX_COMPRESS_DIM]; /* last img pix overlapping tile: 0 base */
-    long tilefpix[MAX_COMPRESS_DIM]; /* 1st tile pix overlapping img: 0 base */
+    long imgdim[MAX_COMPRESS_DIM]; /* product of preceding dimensions in the */
+                                   /* output image, allowing for inc factor */
+    long tiledim[MAX_COMPRESS_DIM]; /* product of preceding dimensions in the */
+                                 /* tile, array;  inc factor is not relevant */
+    long imgfpix[MAX_COMPRESS_DIM]; /* 1st img pix overlapping tile: 0 base, */
+                                    /*  allowing for inc factor */
+    long imglpix[MAX_COMPRESS_DIM]; /* last img pix overlapping tile 0 base, */
+                                    /*  allowing for inc factor */
+    long tilefpix[MAX_COMPRESS_DIM]; /* 1st tile pix overlapping img 0 base, */
+                                    /*  allowing for inc factor */
+    long inc[MAX_COMPRESS_DIM]; /* local copy of input ininc */
     long i1, i2, i3, i4;   /* offset along each axis of the image */
-    long im2, im3, im4;
+    long it1, it2, it3, it4;
+    long im1, im2, im3, im4;  /* offset to image pixel, allowing for inc */
+    long ipos, tf, tl;
     long t2, t3, t4;   /* offset along each axis of the tile */
-    long tilepix, imgpix;
+    long tilepix, imgpix, tilepixbyte, imgpixbyte;
     int ii, overlap_bytes, overlap_flags;
 
     if (*status > 0)
@@ -1818,6 +2572,8 @@ int imcomp_copy_overlap (
 
     for (ii = 0; ii < MAX_COMPRESS_DIM; ii++)
     {
+        /* set default values for higher dimensions */
+        inc[ii] = 1;
         imgdim[ii] = 1;
         tiledim[ii] = 1;
         imgfpix[ii] = 0;
@@ -1825,16 +2581,20 @@ int imcomp_copy_overlap (
         tilefpix[ii] = 0;
     }
 
-    /* calc amount of overlap in each dimension; if there is zero */
+    /* ------------------------------------------------------------ */
+    /* calc amount of overlap in each dimension; if there is zero   */
     /* overlap in any dimension then just return  */
+    /* ------------------------------------------------------------ */
     
     for (ii = 0; ii < ndim; ii++)
     {
         if (tlpixel[ii] < fpixel[ii] || tfpixel[ii] > lpixel[ii])
             return(*status);  /* there are no overlapping pixels */
 
+        inc[ii] = ininc[ii];
+
         /* calc dimensions of the output image section */
-        imgdim[ii] = lpixel[ii] - fpixel[ii] + 1;
+        imgdim[ii] = (lpixel[ii] - fpixel[ii]) / labs(inc[ii]) + 1;
         if (imgdim[ii] < 1)
             return(*status = NEG_AXIS);
 
@@ -1846,54 +2606,389 @@ int imcomp_copy_overlap (
         if (ii > 0)
            tiledim[ii] *= tiledim[ii - 1];  /* product of dimensions */
 
-        /* first and last pixels in image that overlap with the tile (0 base) */
-        imgfpix[ii] = maxvalue(tfpixel[ii] - fpixel[ii] , 0);
-        imglpix[ii] = minvalue(tlpixel[ii] - fpixel[ii] , imgdim[ii] - 1);
+        /* first and last pixels in image that overlap with the tile, 0 base */
+        tf = tfpixel[ii] - 1;
+        tl = tlpixel[ii] - 1;
+
+        /* skip this plane if it falls in the cracks of the subsampled image */
+        while ((tf-(fpixel[ii] - 1)) % labs(inc[ii]))
+        {
+           tf++;
+           if (tf > tl)
+             return(*status);  /* no overlapping pixels */
+        }
+
+        while ((tl-(fpixel[ii] - 1)) % labs(inc[ii]))
+        {
+           tl--;
+           if (tf > tl)
+             return(*status);  /* no overlapping pixels */
+        }
+        imgfpix[ii] = maxvalue((tf - fpixel[ii] +1) / labs(inc[ii]) , 0);
+        imglpix[ii] = minvalue((tl - fpixel[ii] +1) / labs(inc[ii]) ,
+                               imgdim[ii] - 1);
 
         /* first pixel in the tile that overlaps with the image (0 base) */
         tilefpix[ii] = maxvalue(fpixel[ii] - tfpixel[ii], 0);
 
+        while ((tfpixel[ii] + tilefpix[ii] - fpixel[ii]) % labs(inc[ii]))
+        {
+           (tilefpix[ii])++;
+           if (tilefpix[ii] >= tiledim[ii])
+              return(*status);  /* no overlapping pixels */
+        }
+/*
+printf("ii tfpixel, tlpixel %d %d %d \n",ii, tfpixel[ii], tlpixel[ii]);
+printf("ii, tf, tl, imgfpix,imglpix, tilefpix %d %d %d %d %d %d\n",ii,
+ tf,tl,imgfpix[ii], imglpix[ii],tilefpix[ii]);
+*/
         if (ii > 0)
            imgdim[ii] *= imgdim[ii - 1];  /* product of dimensions */
     }
+
+    /* ---------------------------------------------------------------- */
     /* calc number of pixels in each row (first dimension) that overlap */
-    /* multiply by pixlen to get number of bytes to copy in each loop */
+    /* multiply by pixlen to get number of bytes to copy in each loop   */
+    /* ---------------------------------------------------------------- */
+
+    if (inc[0] != 1)
+       overlap_flags = 1;  /* can only copy 1 pixel at a time */
+    else
+       overlap_flags = imglpix[0] - imgfpix[0] + 1;  /* can copy whole row */
 
-    overlap_flags = imglpix[0] - imgfpix[0] + 1;
     overlap_bytes = overlap_flags * pixlen;
 
     /* support up to 5 dimensions for now */
-    for (i4 = 0; i4 <= imglpix[4] - imgfpix[4]; i4++)
+    for (i4 = 0, it4=0; i4 <= imglpix[4] - imgfpix[4]; i4++, it4++)
     {
-      im4 = (i4 + imgfpix[4]) * imgdim[3];
-      t4 = (tilefpix[4] + i4) * tiledim[3];
-      for (i3 = 0; i3 <= imglpix[3] - imgfpix[3]; i3++)
+     /* increment plane if it falls in the cracks of the subsampled image */
+     while (ndim > 4 &&  (tfpixel[4] + tilefpix[4] - fpixel[4] + it4)
+                          % labs(inc[4]) != 0)
+        it4++;
+
+       /* offset to start of hypercube */
+       if (inc[4] > 0)
+          im4 = (i4 + imgfpix[4]) * imgdim[3];
+       else
+          im4 = imgdim[4] - (i4 + 1 + imgfpix[4]) * imgdim[3];
+
+      t4 = (tilefpix[4] + it4) * tiledim[3];
+      for (i3 = 0, it3=0; i3 <= imglpix[3] - imgfpix[3]; i3++, it3++)
       {
-       im3 = (i3 + imgfpix[3]) * imgdim[2] + im4;
-       t3 = (tilefpix[3] + i3) * tiledim[2] + t4;
-        for (i2 = 0; i2 <= imglpix[2] - imgfpix[2]; i2++)
-        {
-          im2 = (i2 + imgfpix[2]) * imgdim[1] + im3;
-          t2 = (tilefpix[2] + i2) * tiledim[1] + t3;
-          for (i1 = 0; i1 <= imglpix[1] - imgfpix[1]; i1++)
+       /* increment plane if it falls in the cracks of the subsampled image */
+       while (ndim > 3 &&  (tfpixel[3] + tilefpix[3] - fpixel[3] + it3)
+                            % labs(inc[3]) != 0)
+          it3++;
+
+       /* offset to start of cube */
+       if (inc[3] > 0)
+          im3 = (i3 + imgfpix[3]) * imgdim[2] + im4;
+       else
+          im3 = imgdim[3] - (i3 + 1 + imgfpix[3]) * imgdim[2] + im4;
+
+       t3 = (tilefpix[3] + it3) * tiledim[2] + t4;
+
+       /* loop through planes of the image */
+       for (i2 = 0, it2=0; i2 <= imglpix[2] - imgfpix[2]; i2++, it2++)
+       {
+          /* incre plane if it falls in the cracks of the subsampled image */
+          while (ndim > 2 &&  (tfpixel[2] + tilefpix[2] - fpixel[2] + it2)
+                               % labs(inc[2]) != 0)
+             it2++;
+
+          /* offset to start of plane */
+          if (inc[2] > 0)
+             im2 = (i2 + imgfpix[2]) * imgdim[1] + im3;
+          else
+             im2 = imgdim[2] - (i2 + 1 + imgfpix[2]) * imgdim[1] + im3;
+
+          t2 = (tilefpix[2] + it2) * tiledim[1] + t3;
+
+          /* loop through rows of the image */
+          for (i1 = 0, it1=0; i1 <= imglpix[1] - imgfpix[1]; i1++, it1++)
           {
+             /* incre row if it falls in the cracks of the subsampled image */
+             while (ndim > 1 &&  (tfpixel[1] + tilefpix[1] - fpixel[1] + it1)
+                                  % labs(inc[1]) != 0)
+                it1++;
+
              /* calc position of first pixel in tile to be copied */
-             tilepix = tilefpix[0] + (tilefpix[1] + i1) * tiledim[0] + t2;
+             tilepix = tilefpix[0] + (tilefpix[1] + it1) * tiledim[0] + t2;
 
-             /* calc position in image to copy to */
-             imgpix = imgfpix[0] + (i1 + imgfpix[1]) * imgdim[0] + im2;
- 
-             /* copy overlapping null flags from tile to image */
-             if (nullcheck == 2)
-                 memcpy(nullarray + imgpix, bnullarray + tilepix,
-                        overlap_flags);
+             /* offset to start of row */
+             if (inc[1] > 0)
+                im1 = (i1 + imgfpix[1]) * imgdim[0] + im2;
+             else
+                im1 = imgdim[1] - (i1 + 1 + imgfpix[1]) * imgdim[0] + im2;
+/*
+printf("inc = %d %d %d %d\n",inc[0],inc[1],inc[2],inc[3]);
+printf("im1,im2,im3,im4 = %d %d %d %d\n",im1,im2,im3,im4);
+*/
+             /* offset to byte within the row */
+             if (inc[0] > 0)
+                imgpix = imgfpix[0] + im1;
+             else
+                imgpix = imgdim[0] - 1 - imgfpix[0] + im1;
+/*
+printf("tilefpix0,1, imgfpix1, it1, inc1, t2= %d %d %d %d %d %d\n",
+       tilefpix[0],tilefpix[1],imgfpix[1],it1,inc[1], t2);
+printf("i1, it1, tilepix, imgpix %d %d %d %d \n", i1, it1, tilepix, imgpix);
+*/
+             /* loop over pixels along one row of the image */
+             for (ipos = imgfpix[0]; ipos <= imglpix[0]; ipos += overlap_flags)
+             {
+               if (nullcheck == 2)
+               {
+                   /* copy overlapping null flags from tile to image */
+                   memcpy(nullarray + imgpix, bnullarray + tilepix,
+                          overlap_flags);
+               }
+
+               /* convert from image pixel to byte offset */
+               tilepixbyte = tilepix * pixlen;
+               imgpixbyte  = imgpix  * pixlen;
+/*
+printf("  tilepix, tilepixbyte, imgpix, imgpixbyte= %d %d %d %d\n",
+          tilepix, tilepixbyte, imgpix, imgpixbyte);
+*/
+               /* copy overlapping row of pixels from tile to image */
+               memcpy(image + imgpixbyte, tile + tilepixbyte, overlap_bytes);
+
+               tilepix += (overlap_flags * labs(inc[0]));
+               if (inc[0] > 0)
+                 imgpix += overlap_flags;
+               else
+                 imgpix -= overlap_flags;
+            }
+          }
+        }
+      }
+    }
+    return(*status);
+}
+
+/*--------------------------------------------------------------------------*/
+int imcomp_merge_overlap (
+    char *tile,         /* O - multi dimensional array of tile pixels */
+    int pixlen,         /* I - number of bytes in each tile or image pixel */
+    int ndim,           /* I - number of dimension in the tile and image */
+    long *tfpixel,      /* I - first pixel number in each dim. of the tile */
+    long *tlpixel,      /* I - last pixel number in each dim. of the tile */
+    char *bnullarray,   /* I - array of null flags; used if nullcheck = 2 */
+    char *image,        /* I - multi dimensional output image */
+    long *fpixel,       /* I - first pixel number in each dim. of the image */
+    long *lpixel,       /* I - last pixel number in each dim. of the image */
+    int nullcheck,      /* I - 0, 1: do nothing; 2: set nullarray for nulls */
+    int *status)
+
+/* 
+  Similar to imcomp_copy_overlap, except it copies the overlapping pixels from
+  the 'image' to the 'tile'.
+*/
+{
+    long imgdim[MAX_COMPRESS_DIM]; /* product of preceding dimensions in the */
+                                   /* output image, allowing for inc factor */
+    long tiledim[MAX_COMPRESS_DIM]; /* product of preceding dimensions in the */
+                                 /* tile, array;  inc factor is not relevant */
+    long imgfpix[MAX_COMPRESS_DIM]; /* 1st img pix overlapping tile: 0 base, */
+                                    /*  allowing for inc factor */
+    long imglpix[MAX_COMPRESS_DIM]; /* last img pix overlapping tile 0 base, */
+                                    /*  allowing for inc factor */
+    long tilefpix[MAX_COMPRESS_DIM]; /* 1st tile pix overlapping img 0 base, */
+                                    /*  allowing for inc factor */
+    long inc[MAX_COMPRESS_DIM]; /* local copy of input ininc */
+    long i1, i2, i3, i4;   /* offset along each axis of the image */
+    long it1, it2, it3, it4;
+    long im1, im2, im3, im4;  /* offset to image pixel, allowing for inc */
+    long ipos, tf, tl;
+    long t2, t3, t4;   /* offset along each axis of the tile */
+    long tilepix, imgpix, tilepixbyte, imgpixbyte;
+    int ii, overlap_bytes, overlap_flags;
+
+    if (*status > 0)
+        return(*status);
+
+    for (ii = 0; ii < MAX_COMPRESS_DIM; ii++)
+    {
+        /* set default values for higher dimensions */
+        inc[ii] = 1;
+        imgdim[ii] = 1;
+        tiledim[ii] = 1;
+        imgfpix[ii] = 0;
+        imglpix[ii] = 0;
+        tilefpix[ii] = 0;
+    }
+
+    /* ------------------------------------------------------------ */
+    /* calc amount of overlap in each dimension; if there is zero   */
+    /* overlap in any dimension then just return  */
+    /* ------------------------------------------------------------ */
+    
+    for (ii = 0; ii < ndim; ii++)
+    {
+        if (tlpixel[ii] < fpixel[ii] || tfpixel[ii] > lpixel[ii])
+            return(*status);  /* there are no overlapping pixels */
+
+        /* calc dimensions of the output image section */
+        imgdim[ii] = (lpixel[ii] - fpixel[ii]) / labs(inc[ii]) + 1;
+        if (imgdim[ii] < 1)
+            return(*status = NEG_AXIS);
+
+        /* calc dimensions of the tile */
+        tiledim[ii] = tlpixel[ii] - tfpixel[ii] + 1;
+        if (tiledim[ii] < 1)
+            return(*status = NEG_AXIS);
+
+        if (ii > 0)
+           tiledim[ii] *= tiledim[ii - 1];  /* product of dimensions */
+
+        /* first and last pixels in image that overlap with the tile, 0 base */
+        tf = tfpixel[ii] - 1;
+        tl = tlpixel[ii] - 1;
+
+        /* skip this plane if it falls in the cracks of the subsampled image */
+        while ((tf-(fpixel[ii] - 1)) % labs(inc[ii]))
+        {
+           tf++;
+           if (tf > tl)
+             return(*status);  /* no overlapping pixels */
+        }
+
+        while ((tl-(fpixel[ii] - 1)) % labs(inc[ii]))
+        {
+           tl--;
+           if (tf > tl)
+             return(*status);  /* no overlapping pixels */
+        }
+        imgfpix[ii] = maxvalue((tf - fpixel[ii] +1) / labs(inc[ii]) , 0);
+        imglpix[ii] = minvalue((tl - fpixel[ii] +1) / labs(inc[ii]) ,
+                               imgdim[ii] - 1);
+
+        /* first pixel in the tile that overlaps with the image (0 base) */
+        tilefpix[ii] = maxvalue(fpixel[ii] - tfpixel[ii], 0);
+
+        while ((tfpixel[ii] + tilefpix[ii] - fpixel[ii]) % labs(inc[ii]))
+        {
+           (tilefpix[ii])++;
+           if (tilefpix[ii] >= tiledim[ii])
+              return(*status);  /* no overlapping pixels */
+        }
+/*
+printf("ii tfpixel, tlpixel %d %d %d \n",ii, tfpixel[ii], tlpixel[ii]);
+printf("ii, tf, tl, imgfpix,imglpix, tilefpix %d %d %d %d %d %d\n",ii,
+ tf,tl,imgfpix[ii], imglpix[ii],tilefpix[ii]);
+*/
+        if (ii > 0)
+           imgdim[ii] *= imgdim[ii - 1];  /* product of dimensions */
+    }
+
+    /* ---------------------------------------------------------------- */
+    /* calc number of pixels in each row (first dimension) that overlap */
+    /* multiply by pixlen to get number of bytes to copy in each loop   */
+    /* ---------------------------------------------------------------- */
+
+    if (inc[0] != 1)
+       overlap_flags = 1;  /* can only copy 1 pixel at a time */
+    else
+       overlap_flags = imglpix[0] - imgfpix[0] + 1;  /* can copy whole row */
+
+    overlap_bytes = overlap_flags * pixlen;
+
+    /* support up to 5 dimensions for now */
+    for (i4 = 0, it4=0; i4 <= imglpix[4] - imgfpix[4]; i4++, it4++)
+    {
+     /* increment plane if it falls in the cracks of the subsampled image */
+     while (ndim > 4 &&  (tfpixel[4] + tilefpix[4] - fpixel[4] + it4)
+                          % labs(inc[4]) != 0)
+        it4++;
+
+       /* offset to start of hypercube */
+       if (inc[4] > 0)
+          im4 = (i4 + imgfpix[4]) * imgdim[3];
+       else
+          im4 = imgdim[4] - (i4 + 1 + imgfpix[4]) * imgdim[3];
+
+      t4 = (tilefpix[4] + it4) * tiledim[3];
+      for (i3 = 0, it3=0; i3 <= imglpix[3] - imgfpix[3]; i3++, it3++)
+      {
+       /* increment plane if it falls in the cracks of the subsampled image */
+       while (ndim > 3 &&  (tfpixel[3] + tilefpix[3] - fpixel[3] + it3)
+                            % labs(inc[3]) != 0)
+          it3++;
 
-             /* convert from image pixel to byte offset */
-             tilepix *= pixlen;
-             imgpix  *= pixlen;
+       /* offset to start of cube */
+       if (inc[3] > 0)
+          im3 = (i3 + imgfpix[3]) * imgdim[2] + im4;
+       else
+          im3 = imgdim[3] - (i3 + 1 + imgfpix[3]) * imgdim[2] + im4;
 
-             /* copy overlapping row of pixels from tile to image */
-             memcpy(image + imgpix, tile + tilepix, overlap_bytes);
+       t3 = (tilefpix[3] + it3) * tiledim[2] + t4;
+
+       /* loop through planes of the image */
+       for (i2 = 0, it2=0; i2 <= imglpix[2] - imgfpix[2]; i2++, it2++)
+       {
+          /* incre plane if it falls in the cracks of the subsampled image */
+          while (ndim > 2 &&  (tfpixel[2] + tilefpix[2] - fpixel[2] + it2)
+                               % labs(inc[2]) != 0)
+             it2++;
+
+          /* offset to start of plane */
+          if (inc[2] > 0)
+             im2 = (i2 + imgfpix[2]) * imgdim[1] + im3;
+          else
+             im2 = imgdim[2] - (i2 + 1 + imgfpix[2]) * imgdim[1] + im3;
+
+          t2 = (tilefpix[2] + it2) * tiledim[1] + t3;
+
+          /* loop through rows of the image */
+          for (i1 = 0, it1=0; i1 <= imglpix[1] - imgfpix[1]; i1++, it1++)
+          {
+             /* incre row if it falls in the cracks of the subsampled image */
+             while (ndim > 1 &&  (tfpixel[1] + tilefpix[1] - fpixel[1] + it1)
+                                  % labs(inc[1]) != 0)
+                it1++;
+
+             /* calc position of first pixel in tile to be copied */
+             tilepix = tilefpix[0] + (tilefpix[1] + it1) * tiledim[0] + t2;
+
+             /* offset to start of row */
+             if (inc[1] > 0)
+                im1 = (i1 + imgfpix[1]) * imgdim[0] + im2;
+             else
+                im1 = imgdim[1] - (i1 + 1 + imgfpix[1]) * imgdim[0] + im2;
+/*
+printf("inc = %d %d %d %d\n",inc[0],inc[1],inc[2],inc[3]);
+printf("im1,im2,im3,im4 = %d %d %d %d\n",im1,im2,im3,im4);
+*/
+             /* offset to byte within the row */
+             if (inc[0] > 0)
+                imgpix = imgfpix[0] + im1;
+             else
+                imgpix = imgdim[0] - 1 - imgfpix[0] + im1;
+/*
+printf("tilefpix0,1, imgfpix1, it1, inc1, t2= %d %d %d %d %d %d\n",
+       tilefpix[0],tilefpix[1],imgfpix[1],it1,inc[1], t2);
+printf("i1, it1, tilepix, imgpix %d %d %d %d \n", i1, it1, tilepix, imgpix);
+*/
+             /* loop over pixels along one row of the image */
+             for (ipos = imgfpix[0]; ipos <= imglpix[0]; ipos += overlap_flags)
+             {
+               /* convert from image pixel to byte offset */
+               tilepixbyte = tilepix * pixlen;
+               imgpixbyte  = imgpix  * pixlen;
+/*
+printf("  tilepix, tilepixbyte, imgpix, imgpixbyte= %d %d %d %d\n",
+          tilepix, tilepixbyte, imgpix, imgpixbyte);
+*/
+               /* copy overlapping row of pixels from image to tile */
+               memcpy(tile + tilepixbyte, image + imgpixbyte,  overlap_bytes);
+
+               tilepix += (overlap_flags * labs(inc[0]));
+               if (inc[0] > 0)
+                 imgpix += overlap_flags;
+               else
+                 imgpix -= overlap_flags;
+            }
           }
         }
       }
diff --git a/imcompress.h b/imcompress.h
deleted file mode 100644
index c5ba7d2..0000000
--- a/imcompress.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#define MAX_COMPRESS_DIM     6
-#define COMPRESS_NULL_VALUE -2147483647
-
-typedef struct {
-        char zcmptype[12];      /* compression type string */
-        int compress_type;      /* type of compression algorithm */
-	int bitpix;		/* FITS data type of image (BITPIX) */
-	int ndim;		/* dimension of image */
-	long naxis[MAX_COMPRESS_DIM];  /* length of each axis */
-	int cn_compressed;	/* column number for COMPRESSED_DATA column */
-	int cn_uncompressed;	/* column number for UNCOMPRESSED_DATA column */
-	int cn_zscale;		/* column number for CSCALE column */
-	int cn_zzero;		/* column number for CZERO column */
-        int cn_zblank;          /* column number for the CBLANK column */
-        double zscale;          /* scaling value, if keyword and not column */
-        double zzero;           /* zero pt, if keyword and not column */
-        int zblank;             /* value for null pixels, if not a column */
-	long nrows;		/* number of rows in table */
-	int ncols;		/* number of columns in table */
-        int rice_blocksize;     /* first compression parameter */
-        int rice_nbits;         /* second compression parameter */
-        long tilesize[MAX_COMPRESS_DIM]; /* size of compression tiles */
-        long maxtilelen;        /* max number of pixels in each image tile */
-	long maxelem;		/* maximum length of variable length arrays */
-} CompressImageInfo;
-
-/*  image compression routines */
-static int imcomp_get_image_params(fitsfile *infptr, CompressImageInfo *otb,
-                 int *status);
-static int imcomp_init_table(fitsfile *outfptr,
-                CompressImageInfo *otb, int *status);
-static int imcomp_calc_max_elem (int nx, int blocksize);
-static int imcomp_copy_imheader(fitsfile *infptr, fitsfile *outfptr,
-                int *status);
-static int imcomp_img_to_tbl_special (char *card);
-static int imcomp_compress_image (fitsfile *infptr, fitsfile *outfptr,
-                 CompressImageInfo *otb, int *status);
-
-/*  image decompression routines */
-int fits_read_compressed_img_plane(fitsfile *fptr, int  datatype, 
-      int  bytesperpixel,  long   nplane, long *firstcoord, long *lastcoord, 
-      long *inc,  long *naxes,  int  nullcheck,  void *nullval, 
-      void *array, char *nullarray, int  *anynul, int  *status);
-static int imcomp_get_table_params(fitsfile *infptr, CompressImageInfo *itb,
-            int *status);
-static int imcomp_copy_tblheader(fitsfile *infptr, fitsfile *outfptr,   
-           int *status);
-static int imcomp_tbl_to_img_special (char *keyname);
-static int imcomp_decompress_tile (fitsfile *infptr, CompressImageInfo *itb,
-          int nrow, int tilesize, int datatype, int nullcheck,
-          void *nulval, void *buffer, char *bnullarray, int *anynul,
-          int *status);
-static int imcomp_copy_overlap (char *tile, int datatype, int ndim,
-         long *tfpixel, long *tlpixel, char *bnullarray, char *image,
-         long *fpixel, long *lpixel, int nullcheck, char *nullarray,
-         int *status);
diff --git a/imcopy.c b/imcopy.c
new file mode 100644
index 0000000..3311bd0
--- /dev/null
+++ b/imcopy.c
@@ -0,0 +1,188 @@
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "fitsio.h"
+
+int main(int argc, char *argv[])
+{
+    fitsfile *infptr, *outfptr;   /* FITS file pointers defined in fitsio.h */
+    int status = 0, ii = 1, iteration = 0, single = 0, hdupos;
+    int hdutype, bitpix, bytepix, naxis = 0, nkeys, datatype = 0, anynul;
+    long naxes[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1};
+    long first, totpix = 0, npix;
+    double *array, bscale = 1.0, bzero = 0.0, nulval = 0.;
+    char card[81];
+
+    if (argc != 3)
+    {
+ printf("\n");
+ printf("Usage:  imcopy inputImage outputImage[compress]\n");
+ printf("\n");
+ printf("Copy an input image to an output image, optionally compressing\n");
+ printf("or uncompressing the image in the process.  If the [compress]\n");
+ printf("qualifier is appended to the output file name then the input image\n");
+ printf("will be compressed using the tile-compressed format.  In this format,\n");
+ printf("the image is divided into rectangular tiles and each tile of pixels\n");
+ printf("is compressed and stored in a variable-length row of a binary table.\n");
+ printf("If the [compress] qualifier is omitted, and the input image is\n");
+ printf("in tile-compressed format, then the output image will be uncompressed.\n");
+ printf("\n");
+ printf("If an extension name or number is appended to the input file name, \n");
+ printf("enclosed in square brackets, then only that single extension will be\n");
+ printf("copied to the output file.  Otherwise, every extension in the input file\n");
+ printf("will be processed in turn and copied to the output file.\n");
+ printf("\n");
+ printf("Examples:\n");
+ printf("\n");
+ printf("1)  imcopy image.fit 'cimage.fit[compress]'\n");
+ printf("\n");
+ printf("    This compresses the input image using the default parameters, i.e.,\n");
+ printf("    using the Rice compression algorithm and using row by row tiles.\n");
+ printf("\n");
+ printf("2)  imcopy cimage.fit image2.fit\n");
+ printf("\n");
+ printf("    This uncompress the image created in the first example.\n");
+ printf("    image2.fit should be identical to image.fit if the image\n");
+ printf("    has an integer datatype.  There will be small differences\n");
+ printf("    in the pixel values if it is a floating point image.\n");
+ printf("\n");
+ printf("3)  imcopy image.fit 'cimage.fit[compress GZIP 100,100;4]'\n");
+ printf("\n");
+ printf("    This compresses the input image using the following parameters:\n");
+ printf("         GZIP compression algorithm;\n");
+ printf("         100 X 100 pixel compression tiles;\n");
+ printf("         noise_bits = 4 (only used with floating point images)\n");
+ printf("\n");
+ printf("The full syntax of the compression qualifier is:\n");
+ printf("    [compress ALGORITHM TDIM1,TDIM2,...; NOISE_BITS]\n");
+ printf("where the allowed ALGORITHM values are Rice, GZIP, PLIO, \n");
+ printf("and TDIMn is the size of the compression tile in each dimension,\n");
+ printf("and NOISE_BITS = 1, 2, 3, or 4 and controls the amount of noise\n");
+ printf("suppression when compressing floating point images. \n");
+ printf("\n");
+ printf("Note that it may be necessary to enclose the file names\n");
+ printf("in single quote characters on the Unix command line.\n");
+      return(0);
+    }
+
+    /* Open the input file and create output file */
+    fits_open_file(&infptr, argv[1], READONLY, &status);
+    fits_create_file(&outfptr, argv[2], &status);
+
+    if (status != 0) {    
+        fits_report_error(stderr, status);
+        return(status);
+    }
+
+    fits_get_hdu_num(infptr, &hdupos);  /* Get the current HDU position */
+
+    /* Copy only a single HDU if a specific extension was given */ 
+    if (hdupos != 1 || strchr(argv[1], '[')) single = 1;
+
+    for (; !status; hdupos++)  /* Main loop through each extension */
+    {
+
+      fits_get_hdu_type(infptr, &hdutype, &status);
+
+      if (hdutype == IMAGE_HDU) {
+
+          /* get image dimensions and total number of pixels in image */
+          for (ii = 0; ii < 9; ii++)
+              naxes[ii] = 1;
+
+          fits_get_img_param(infptr, 9, &bitpix, &naxis, naxes, &status);
+
+          totpix = naxes[0] * naxes[1] * naxes[2] * naxes[3] * naxes[4]
+             * naxes[5] * naxes[6] * naxes[7] * naxes[8];
+      }
+
+      if (hdutype != IMAGE_HDU || naxis == 0 || totpix == 0) { 
+
+          /* just copy tables and null images */
+          fits_copy_hdu(infptr, outfptr, 0, &status);
+
+      } else {
+
+          /* Explicitly create new image, to support compression */
+          fits_create_img(outfptr, bitpix, naxis, naxes, &status);
+
+          /* copy all the user keywords (not the structural keywords) */
+          fits_get_hdrspace(infptr, &nkeys, NULL, &status); 
+
+          for (ii = 1; ii <= nkeys; ii++) {
+              fits_read_record(infptr, ii, card, &status);
+              if (fits_get_keyclass(card) > TYP_CMPRS_KEY)
+                  fits_write_record(outfptr, card, &status);
+          }
+
+          switch(bitpix) {
+              case BYTE_IMG:
+                  datatype = TBYTE;
+                  break;
+              case SHORT_IMG:
+                  datatype = TSHORT;
+                  break;
+              case LONG_IMG:
+                  datatype = TLONG;
+                  break;
+              case FLOAT_IMG:
+                  datatype = TFLOAT;
+                  break;
+              case DOUBLE_IMG:
+                  datatype = TDOUBLE;
+                  break;
+          }
+
+          bytepix = abs(bitpix) / 8;
+
+          npix = totpix;
+          iteration = 0;
+
+          /* try to allocate memory for the entire image */
+          /* use double type to force memory alignment */
+          array = (double *) calloc(npix, bytepix);
+
+          /* if allocation failed, divide size by 2 and try again */
+          while (!array && iteration < 10)  {
+              iteration++;
+              npix = npix / 2;
+              array = (double *) calloc(npix, bytepix);
+          }
+
+          if (!array)  {
+              printf("Memory allocation error\n");
+              return(0);
+          }
+
+          /* turn off any scaling so that we copy the raw pixel values */
+          fits_set_bscale(infptr,  bscale, bzero, &status);
+          fits_set_bscale(outfptr, bscale, bzero, &status);
+
+          first = 1;
+          while (totpix > 0 && !status)
+          {
+             /* read all or part of image then write it back to the output file */
+             fits_read_img(infptr, datatype, first, npix, 
+                     &nulval, array, &anynul, &status);
+
+             fits_write_img(outfptr, datatype, first, npix, array, &status);
+             totpix = totpix - npix;
+             first  = first  + npix;
+          }
+          free(array);
+      }
+
+      if (single) break;  /* quit if only copying a single HDU */
+      fits_movrel_hdu(infptr, 1, NULL, &status);  /* try to move to next HDU */
+    }
+
+    if (status == END_OF_FILE)  status = 0; /* Reset after normal error */
+
+    fits_close_file(outfptr,  &status);
+    fits_close_file(infptr, &status);
+
+    /* if error occurred, print out error message */
+    if (status)
+       fits_report_error(stderr, status);
+    return(status);
+}
diff --git a/iraffits.c b/iraffits.c
index b5afc01..db6940d 100644
--- a/iraffits.c
+++ b/iraffits.c
@@ -8,7 +8,7 @@
  * August 6, 1998
  * By Doug Mink, based on Mike VanHilst's readiraf.c
 
- * Module:      imh2io.c (IRAF 2.11 image file reading and writing)
+ * Module:      imhfile.c (IRAF .imh image file reading and writing)
  * Purpose:     Read and write IRAF image files (and translate headers)
  * Subroutine:  irafrhead (filename, lfhead, fitsheader, lihead)
  *              Read IRAF image header
@@ -36,7 +36,7 @@
  *		Reverse bytes of Real*8 vector in place
 
 
- * Copyright:   1998 Smithsonian Astrophysical Observatory
+ * Copyright:   2000 Smithsonian Astrophysical Observatory
  *              You may do anything you like with this file except remove
  *              this copyright.  The Smithsonian Astrophysical Observatory
  *              makes no representations about the suitability of this
@@ -70,7 +70,11 @@
 #define IM_LEN           24             /* Length (as stored) */
 #define IM_PHYSLEN       52             /* Physical length (as stored) */
 #define IM_PIXOFF        88             /* Offset of the pixels */
+#define IM_CTIME        108             /* Time of image creation */
 #define IM_MTIME        112             /* Time of last modification */
+#define IM_LIMTIME      116             /* Time of min,max computation */
+#define IM_MAX          120             /* Maximum pixel value */
+#define IM_MIN          124             /* Maximum pixel value */
 #define IM_PIXFILE      412             /* Name of pixel storage file */
 #define IM_HDRFILE      572             /* Name of header storage file */
 #define IM_TITLE        732             /* Image name string */
@@ -83,7 +87,11 @@
 #define IM2_LEN          22             /* Length (as stored) */
 #define IM2_PHYSLEN      50             /* Physical length (as stored) */
 #define IM2_PIXOFF       86             /* Offset of the pixels */
+#define IM2_CTIME       106             /* Time of image creation */
 #define IM2_MTIME       110             /* Time of last modification */
+#define IM2_LIMTIME     114             /* Time of min,max computation */
+#define IM2_MAX         118             /* Maximum pixel value */
+#define IM2_MIN         122             /* Maximum pixel value */
 #define IM2_PIXFILE     126             /* Name of pixel storage file */
 #define IM2_HDRFILE     382             /* Name of header storage file */
 #define IM2_TITLE       638             /* Image name string */
@@ -114,7 +122,7 @@ static int irafrdimage (char **buffptr, size_t *buffsize,
     size_t *filesize, int *status);
 static int iraftofits (char *hdrname, char *irafheader, int nbiraf,
     char **buffptr, size_t *nbfits, size_t *fitssize, int *status);
-static void same_path(char *pixname, char *hdrname);
+static char *same_path(char *pixname, char *hdrname);
 
 static int swaphead=0;	/* =1 to swap data bytes of IRAF header values */
 static int swapdata=0;  /* =1 to swap bytes in IRAF data pixels */
@@ -212,8 +220,8 @@ static char *irafrdhead (
     *lihead = 0;
 
     /* open the image header file */
-    fd = fopen (filename, "r");
-    if (!fd) {
+    fd = fopen (filename, "rb");
+    if (fd == NULL) {
         ffpmsg("unable to open IRAF header file:");
         ffpmsg(filename);
 	return (NULL);
@@ -243,8 +251,8 @@ static char *irafrdhead (
     }
 
     /* allocate initial sized buffer */
-    nihead = nbhead + 2;
-    irafheader = calloc (nihead, 1);
+    nihead = nbhead + 5000;
+    irafheader = (char *) calloc (1, nihead);
     if (irafheader == NULL) {
 	sprintf(errmsg, "IRAFRHEAD Cannot allocate %d-byte header",
 		      nihead);
@@ -270,8 +278,219 @@ static char *irafrdhead (
 
     return (irafheader);
 }
+/*--------------------------------------------------------------------------*/
+static int irafrdimage (
+    char **buffptr,	/* FITS image header (filled) */
+    size_t *buffsize,      /* allocated size of the buffer */
+    size_t *filesize,      /* actual size of the FITS file */
+    int *status)
+{
+    FILE *fd;
+    char *bang;
+    int nax, naxis1 = 1, naxis2 = 1, naxis3 = 1, naxis4 = 1, npaxis1, npaxis2;
+    int bitpix, bytepix, i;
+    char *fitsheader, *image;
+    int nbr, nbimage, nbaxis, nbl, nbx, nbdiff;
+    char *pixheader;
+    char *linebuff;
+    int imhver, lpixhead;
+    char pixname[SZ_IM2PIXFILE+1];
+    char errmsg[81];
+    size_t newfilesize;
+ 
+    fitsheader = *buffptr;           /* pointer to start of header */
+    image = fitsheader + *filesize;  /* pointer to start of the data */
+
+    /* Convert pixel file name to character string */
+    hgets (fitsheader, "PIXFILE", SZ_IM2PIXFILE, pixname);
+    hgeti4 (fitsheader, "PIXOFF", &lpixhead);
+
+    /* Open pixel file, ignoring machine name if present */
+    if ((bang = strchr (pixname, '!')) != NULL )
+	fd = fopen (bang + 1, "rb");
+    else
+	fd = fopen (pixname, "rb");
+
+    /* Print error message and exit if pixel file is not found */
+    if (!fd) {
+        ffpmsg("IRAFRIMAGE: Cannot open IRAF pixel file:");
+        ffpmsg(pixname);
+	return (*status = FILE_NOT_OPENED);
+	}
+
+    /* Read pixel header */
+    pixheader = (char *) calloc (lpixhead, 1);
+    if (pixheader == NULL) {
+            ffpmsg("IRAFRIMAGE: Cannot alloc memory for pixel header");
+            ffpmsg(pixname);
+            fclose (fd);
+	    return (*status = FILE_NOT_OPENED);
+	}
+    nbr = fread (pixheader, 1, lpixhead, fd);
+
+    /* Check size of pixel header */
+    if (nbr < lpixhead) {
+	sprintf(errmsg, "IRAF pixel file: %d / %d bytes read.",
+		      nbr,LEN_PIXHDR);
+        ffpmsg(errmsg);
+	free (pixheader);
+	fclose (fd);
+	return (*status = FILE_NOT_OPENED);
+	}
+
+    /* check pixel header magic word */
+    imhver = pix_version (pixheader);
+    if (imhver < 1) {
+        ffpmsg("File not valid IRAF pixel file:");
+        ffpmsg(pixname);
+	free (pixheader);
+	fclose (fd);
+	return (*status = FILE_NOT_OPENED);
+	}
+    free (pixheader);
+
+    /* Find number of bytes to read */
+    hgeti4 (fitsheader,"NAXIS",&nax);
+    hgeti4 (fitsheader,"NAXIS1",&naxis1);
+    hgeti4 (fitsheader,"NPAXIS1",&npaxis1);
+    if (nax > 1) {
+        hgeti4 (fitsheader,"NAXIS2",&naxis2);
+        hgeti4 (fitsheader,"NPAXIS2",&npaxis2);
+	}
+    if (nax > 2)
+        hgeti4 (fitsheader,"NAXIS3",&naxis3);
+    if (nax > 3)
+        hgeti4 (fitsheader,"NAXIS4",&naxis4);
+
+    hgeti4 (fitsheader,"BITPIX",&bitpix);
+    if (bitpix < 0)
+	bytepix = -bitpix / 8;
+    else
+	bytepix = bitpix / 8;
+
+    nbimage = naxis1 * naxis2 * naxis3 * naxis4 * bytepix;
+    
+    newfilesize = *filesize + nbimage;  /* header + data */
+    newfilesize = (((newfilesize - 1) / 2880 ) + 1 ) * 2880;
+
+    if (newfilesize > *buffsize)   /* need to allocate more memory? */
+    {
+      fitsheader =  (char *) realloc (*buffptr, newfilesize);
+      if (fitsheader == NULL) {
+	sprintf(errmsg, "IRAFRIMAGE Cannot allocate %d-byte image buffer",
+		(int) (*filesize));
+        ffpmsg(errmsg);
+        ffpmsg(pixname);
+	fclose (fd);
+	return (*status = FILE_NOT_OPENED);
+	}
+    }
+
+    *buffptr = fitsheader;
+    *buffsize = newfilesize;
+
+    image = fitsheader + *filesize;
+    *filesize = newfilesize;
+
+    /* Read IRAF image all at once if physical and image dimensions are the same */
+    if (npaxis1 == naxis1)
+	nbr = fread (image, 1, nbimage, fd);
+
+    /* Read IRAF image one line at a time if physical and image dimensions differ */
+    else {
+	nbdiff = (npaxis1 - naxis1) * bytepix;
+	nbaxis = naxis1 * bytepix;
+	linebuff = image;
+	nbr = 0;
+	if (naxis2 == 1 && naxis3 > 1)
+	    naxis2 = naxis3;
+	for (i = 0; i < naxis2; i++) {
+	    nbl = fread (linebuff, 1, nbaxis, fd);
+	    nbr = nbr + nbl;
+	    nbx = fseek (fd, nbdiff, SEEK_CUR);
+	    linebuff = linebuff + nbaxis;
+	    }
+	}
+    fclose (fd);
+
+    /* Check size of image */
+    if (nbr < nbimage) {
+	sprintf(errmsg, "IRAF pixel file: %d / %d bytes read.",
+		      nbr,nbimage);
+        ffpmsg(errmsg);
+        ffpmsg(pixname);
+	return (*status = FILE_NOT_OPENED);
+	}
+
+    /* Byte-reverse image, if necessary */
+    if (swapdata)
+	irafswap (bitpix, image, nbimage);
+
+    return (*status);
+}
+/*--------------------------------------------------------------------------*/
+/* Return IRAF image format version number from magic word in IRAF header*/
+
+static int head_version (
+    char *irafheader)	/* IRAF image header from file */
+
+{
+
+    /* Check header file magic word */
+    if (irafncmp (irafheader, "imhdr", 5) != 0 ) {
+	if (strncmp (irafheader, "imhv2", 5) != 0)
+	    return (0);
+	else
+	    return (2);
+	}
+    else
+	return (1);
+}
+
+/*--------------------------------------------------------------------------*/
+/* Return IRAF image format version number from magic word in IRAF pixel file */
+
+static int pix_version (
+    char *irafheader)   /* IRAF image header from file */
+{
+
+    /* Check pixel file header magic word */
+    if (irafncmp (irafheader, "impix", 5) != 0) {
+	if (strncmp (irafheader, "impv2", 5) != 0)
+	    return (0);
+	else
+	    return (2);
+	}
+    else
+	return (1);
+}
 
 /*--------------------------------------------------------------------------*/
+/* Verify that file is valid IRAF imhdr or impix by checking first 5 chars
+ * Returns:	0 on success, 1 on failure */
+
+static int irafncmp (
+
+char	*irafheader,	/* IRAF image header from file */
+char	*teststring,	/* C character string to compare */
+int	nc)		/* Number of characters to compate */
+
+{
+    char *line;
+
+    if ((line = iraf2str (irafheader, nc)) == NULL)
+	return (1);
+    if (strncmp (line, teststring, nc) == 0) {
+	free (line);
+	return (0);
+	}
+    else {
+	free (line);
+	return (1);
+	}
+}
+/*--------------------------------------------------------------------------*/
+
 /* Convert IRAF image header to FITS image header, returning FITS header */
 
 static int iraftofits (
@@ -286,15 +505,15 @@ static int iraftofits (
 {
     char *objname;	/* object name from FITS file */
     int lstr, i, j, k, ib, nax, nbits;
-    char *pixname, *bang, *chead;
+    char *pixname, *newpixname, *bang, *chead;
     char *fitsheader;
     int nblock, nlines;
     char *fhead, *fhead1, *fp, endline[81];
     char irafchar;
     char fitsline[81];
     int pixtype;
-    int imhver, n, imu, pixoff, impixoff;
-    int imndim, imphyslen, impixtype;
+    int imhver, n, imu, pixoff, impixoff, immax, immin, imtime;
+    int imndim, imlen, imphyslen, impixtype;
     char errmsg[81];
 
     /* Set up last line of FITS header */
@@ -311,27 +530,35 @@ static int iraftofits (
 	return(*status = FILE_NOT_OPENED);
 	}
     if (imhver == 2) {
-	nlines = 16 + ((nbiraf - LEN_IM2HDR) / 81);
+	nlines = 24 + ((nbiraf - LEN_IM2HDR) / 81);
 	imndim = IM2_NDIM;
+	imlen = IM2_LEN;
 	imphyslen = IM2_PHYSLEN;
 	impixtype = IM2_PIXTYPE;
 	impixoff = IM2_PIXOFF;
+	imtime = IM2_MTIME;
+	immax = IM2_MAX;
+	immin = IM2_MIN;
 	}
     else {
-	nlines = 16 + ((nbiraf - LEN_IMHDR) / 162);
+	nlines = 24 + ((nbiraf - LEN_IMHDR) / 162);
 	imndim = IM_NDIM;
+	imlen = IM_LEN;
 	imphyslen = IM_PHYSLEN;
 	impixtype = IM_PIXTYPE;
 	impixoff = IM_PIXOFF;
+	imtime = IM_MTIME;
+	immax = IM_MAX;
+	immin = IM_MIN;
 	}
 
     /*  Initialize FITS header */
     nblock = (nlines * 80) / 2880;
-    *nbfits = (nblock + 3) * 2880;
+    *nbfits = (nblock + 5) * 2880 + 4;
     fitsheader = (char *) calloc (*nbfits, 1);
     if (fitsheader == NULL) {
 	sprintf(errmsg, "IRAF2FITS Cannot allocate %d-byte FITS header",
-		*nbfits);
+		(int) (*nbfits));
         ffpmsg(hdrname);
 	return (*status = FILE_NOT_OPENED);
 	}
@@ -358,34 +585,34 @@ static int iraftofits (
     /*  Set pixel size in FITS header */
     pixtype = irafgeti4 (irafheader, impixtype);
     switch (pixtype) {
-    case TY_CHAR:
-	nbits = 8;
-	break;
-    case TY_UBYTE:
-	nbits = 8;
-	break;
-    case TY_SHORT:
-	nbits = 16;
-	break;
-    case TY_USHORT:
-	nbits = -16;
-	break;
-    case TY_INT:
-    case TY_LONG:
-	nbits = 32;
-	break;
-    case TY_REAL:
-	nbits = -32;
-	break;
-    case TY_DOUBLE:
-	nbits = -64;
-	break;
-    default:
-	sprintf(errmsg,"Unsupported IRAF data type: %d", pixtype);
-        ffpmsg(errmsg);
-        ffpmsg(hdrname);
-	return (*status = FILE_NOT_OPENED);
-    }
+	case TY_CHAR:
+	    nbits = 8;
+	    break;
+	case TY_UBYTE:
+	    nbits = 8;
+	    break;
+	case TY_SHORT:
+	    nbits = 16;
+	    break;
+	case TY_USHORT:
+	    nbits = -16;
+	    break;
+	case TY_INT:
+	case TY_LONG:
+	    nbits = 32;
+	    break;
+	case TY_REAL:
+	    nbits = -32;
+	    break;
+	case TY_DOUBLE:
+	    nbits = -64;
+	    break;
+	default:
+	    sprintf(errmsg,"Unsupported IRAF data type: %d", pixtype);
+            ffpmsg(errmsg);
+            ffpmsg(hdrname);
+	    return (*status = FILE_NOT_OPENED);
+	}
     hputi4 (fitsheader,"BITPIX",nbits);
     hputcom (fitsheader,"BITPIX", "IRAF .imh pixel type");
     fhead = fhead + 80;
@@ -396,27 +623,27 @@ static int iraftofits (
     hputcom (fitsheader,"NAXIS", "IRAF .imh naxis");
     fhead = fhead + 80;
 
-    n = irafgeti4 (irafheader, imphyslen);
+    n = irafgeti4 (irafheader, imlen);
     hputi4 (fitsheader, "NAXIS1", n);
-    hputcom (fitsheader,"NAXIS1", "IRAF .imh naxis[1]");
+    hputcom (fitsheader,"NAXIS1", "IRAF .imh image naxis[1]");
     fhead = fhead + 80;
 
     if (nax > 1) {
-	n = irafgeti4 (irafheader, imphyslen+4);
+	n = irafgeti4 (irafheader, imlen+4);
 	hputi4 (fitsheader, "NAXIS2", n);
-	hputcom (fitsheader,"NAXIS2", "IRAF .imh naxis[2]");
+	hputcom (fitsheader,"NAXIS2", "IRAF .imh image naxis[2]");
         fhead = fhead + 80;
 	}
     if (nax > 2) {
-	n = irafgeti4 (irafheader, imphyslen+8);
+	n = irafgeti4 (irafheader, imlen+8);
 	hputi4 (fitsheader, "NAXIS3", n);
-	hputcom (fitsheader,"NAXIS3", "IRAF .imh naxis[3]");
+	hputcom (fitsheader,"NAXIS3", "IRAF .imh image naxis[3]");
 	fhead = fhead + 80;
 	}
     if (nax > 3) {
-	n = irafgeti4 (irafheader, imphyslen+12);
+	n = irafgeti4 (irafheader, imlen+12);
 	hputi4 (fitsheader, "NAXIS4", n);
-	hputcom (fitsheader,"NAXIS4", "IRAF .imh naxis[4]");
+	hputcom (fitsheader,"NAXIS4", "IRAF .imh image naxis[4]");
 	fhead = fhead + 80;
 	}
 
@@ -435,6 +662,30 @@ static int iraftofits (
     free (objname);
     fhead = fhead + 80;
 
+    /* Save physical axis lengths so image file can be read */
+    n = irafgeti4 (irafheader, imphyslen);
+    hputi4 (fitsheader, "NPAXIS1", n);
+    hputcom (fitsheader,"NPAXIS1", "IRAF .imh physical naxis[1]");
+    fhead = fhead + 80;
+    if (nax > 1) {
+	n = irafgeti4 (irafheader, imphyslen+4);
+	hputi4 (fitsheader, "NPAXIS2", n);
+	hputcom (fitsheader,"NPAXIS2", "IRAF .imh physical naxis[2]");
+	fhead = fhead + 80;
+	}
+    if (nax > 2) {
+	n = irafgeti4 (irafheader, imphyslen+8);
+	hputi4 (fitsheader, "NPAXIS3", n);
+	hputcom (fitsheader,"NPAXIS3", "IRAF .imh physical naxis[3]");
+	fhead = fhead + 80;
+	}
+    if (nax > 3) {
+	n = irafgeti4 (irafheader, imphyslen+12);
+	hputi4 (fitsheader, "NPAXIS4", n);
+	hputcom (fitsheader,"NPAXIS4", "IRAF .imh physical naxis[4]");
+	fhead = fhead + 80;
+	}
+
     /* Save image header filename in header */
     hputs (fitsheader,"IMHFILE",hdrname);
     hputcom (fitsheader,"IMHFILE", "IRAF header file name");
@@ -443,11 +694,19 @@ static int iraftofits (
     /* Save image pixel file pathname in header */
     if (imhver == 2)
 	pixname = irafgetc (irafheader, IM2_PIXFILE, SZ_IM2PIXFILE);
-    else {
+    else
 	pixname = irafgetc2 (irafheader, IM_PIXFILE, SZ_IMPIXFILE);
+    if (strncmp(pixname, "HDR", 3) == 0 ) {
+	newpixname = same_path (pixname, hdrname);
+	free (pixname);
+	pixname = newpixname;
+	}
+    if (strchr (pixname, '/') == NULL && strchr (pixname, '$') == NULL) {
+	newpixname = same_path (pixname, hdrname);
+	free (pixname);
+	pixname = newpixname;
 	}
-    if (strncmp(pixname, "HDR", 3) == 0 )
-	same_path (pixname, hdrname);
+	
     if ((bang = strchr (pixname, '!')) != NULL )
 	hputs (fitsheader,"PIXFILE",bang+1);
     else
@@ -470,10 +729,10 @@ static int iraftofits (
 
     /* Save flag as to whether to swap IRAF data for this file and machine */
     if (swapdata)
-	hputl (fitsheader, "SWAPIRAF", 1);
+	hputl (fitsheader, "PIXSWAP", 1);
     else
-	hputl (fitsheader, "SWAPIRAF", 0);
-    hputcom (fitsheader,"SWAPIRAF", "IRAF and FITS byte orders differ if T");
+	hputl (fitsheader, "PIXSWAP", 0);
+    hputcom (fitsheader,"PIXSWAP", "IRAF pixels, FITS byte orders differ if T");
     fhead = fhead + 80;
 
     /* Add user portion of IRAF header to FITS header */
@@ -490,16 +749,22 @@ static int iraftofits (
 		break;
 	    else if (irafchar == 10) {
 		(void)strncpy (fhead, fitsline, 80);
-		j = 0;
-		fhead = fhead + 80;
+		/* fprintf (stderr,"%80s\n",fitsline); */
+		if (strncmp (fitsline, "OBJECT ", 7) != 0) {
+		    fhead = fhead + 80;
+		    }
 		for (k = 0; k < 80; k++)
 		    fitsline[k] = ' ';
+		j = 0;
 		}
 	    else {
 		if (j > 80) {
-		    (void)strncpy (fhead, fitsline, 80);
-		    j = 9;
-		    fhead = fhead + 80;
+		    if (strncmp (fitsline, "OBJECT ", 7) != 0) {
+			(void)strncpy (fhead, fitsline, 80);
+			/* fprintf (stderr,"%80s\n",fitsline); */
+			j = 9;
+			fhead = fhead + 80;
+			}
 		    for (k = 0; k < 80; k++)
 			fitsline[k] = ' ';
 		    }
@@ -516,7 +781,6 @@ static int iraftofits (
 	    ib = 0;
 	else
 	    ib = 1;
-
 	for (k = 0; k < 80; k++)
 	    fitsline[k] = ' ';
 	j = 0;
@@ -525,17 +789,23 @@ static int iraftofits (
 	    if (irafchar == 0)
 		break;
 	    else if (irafchar == 10) {
-		(void)strncpy (fhead, fitsline, 80);
+		if (strncmp (fitsline, "OBJECT ", 7) != 0) {
+		    (void)strncpy (fhead, fitsline, 80);
+		    fhead = fhead + 80;
+		    }
+		/* fprintf (stderr,"%80s\n",fitsline); */
 		j = 0;
-		fhead = fhead + 80;
 		for (k = 0; k < 80; k++)
 		    fitsline[k] = ' ';
 		}
 	    else {
 		if (j > 80) {
-		    (void)strncpy (fhead, fitsline, 80);
-		    j = 9;
-		    fhead = fhead + 80;
+		    if (strncmp (fitsline, "OBJECT ", 7) != 0) {
+			(void)strncpy (fhead, fitsline, 80);
+			j = 9;
+			fhead = fhead + 80;
+			}
+		    /* fprintf (stderr,"%80s\n",fitsline); */
 		    for (k = 0; k < 80; k++)
 			fitsline[k] = ' ';
 		    }
@@ -551,7 +821,8 @@ static int iraftofits (
 
     /* Find end of last 2880-byte block of header */
     fhead = ksearch (fitsheader, "END") + 80;
-    fhead1 = fitsheader + *nbfits;
+    nblock = *nbfits / 2880;
+    fhead1 = fitsheader + (nblock * 2880);
     *fitssize = fhead - fitsheader;  /* no. of bytes to end of END keyword */
 
     /* Pad rest of header with spaces */
@@ -562,246 +833,69 @@ static int iraftofits (
 
     return (*status);
 }
-/*--------------------------------------------------------------------------*/
-static int irafrdimage (
-    char **buffptr,	/* FITS image header (filled) */
-    size_t *buffsize,      /* allocated size of the buffer */
-    size_t *filesize,      /* actual size of the FITS file */
-    int *status)
-{
-    FILE *fd;
-    char *bang;
-    int nax, naxis1 = 1, naxis2 = 1, naxis3 = 1, naxis4 = 1;
-    int bitpix, bytepix;
-    char *fitsheader, *image;
-    int nbr, nbimage;
-    char *pixheader;
-    int imhver, lpixhead;
-    char pixname[SZ_IM2PIXFILE+1];
-    char errmsg[81];
-    size_t newfilesize;
- 
-    fitsheader = *buffptr;           /* pointer to start of header */
-    image = fitsheader + *filesize;  /* pointer to start of the data */
-
-    /* Convert pixel file name to character string */
-    hgets (fitsheader, "PIXFILE", SZ_IM2PIXFILE, pixname);
-    hgeti4 (fitsheader, "PIXOFF", &lpixhead);
-
-    if ((bang = strchr (pixname, '!')) != NULL ) {
-	fd = fopen (bang + 1, "r");
-	if (!fd) {
-            ffpmsg("IRAFRIMAGE: Cannot open IRAF pixel file");
-            ffpmsg(pixname);
-	    return (*status = FILE_NOT_OPENED);
-	    }
-	}
-    else {
-	fd = fopen (pixname, "r");
-	if (!fd) {
-            ffpmsg("IRAFRIMAGE: Cannot open IRAF pixel file:");
-            ffpmsg(pixname);
-	    return (*status = FILE_NOT_OPENED);
-	    }
-	}
-
-    /* Read pixel header */
-    pixheader = (char *) calloc (lpixhead, 1);
-    if (pixheader == NULL) {
-            ffpmsg("IRAFRIMAGE: Cannot alloc memory for pixel header");
-            ffpmsg(pixname);
-            fclose (fd);
-	    return (*status = FILE_NOT_OPENED);
-	}
-
-    nbr = fread (pixheader, 1, lpixhead, fd);
-
-    /* Check size of pixel header */
-    if (nbr < lpixhead) {
-	sprintf(errmsg, "IRAF pixel file: %d / %d bytes read.",
-		      nbr,LEN_PIXHDR);
-        ffpmsg(errmsg);
-	free (pixheader);
-	fclose (fd);
-	return (*status = FILE_NOT_OPENED);
-	}
-
-    /* check pixel header magic word */
-    imhver = pix_version (pixheader);
-    if (imhver < 1) {
-        ffpmsg("File not valid IRAF pixel file:");
-        ffpmsg(pixname);
-	free (pixheader);
-	fclose (fd);
-	return (*status = FILE_NOT_OPENED);
-	}
-
-    free (pixheader);
-
-    /* Find number of bytes to read */
-    hgeti4 (fitsheader,"NAXIS",&nax);
-    hgeti4 (fitsheader,"NAXIS1",&naxis1);
-    if (nax > 1)
-        hgeti4 (fitsheader,"NAXIS2",&naxis2);
-    if (nax > 2)
-        hgeti4 (fitsheader,"NAXIS3",&naxis3);
-    if (nax > 3)
-        hgeti4 (fitsheader,"NAXIS4",&naxis4);
-
-    hgeti4 (fitsheader,"BITPIX",&bitpix);
-    if (bitpix < 0)
-	bytepix = -bitpix / 8;
-    else
-	bytepix = bitpix / 8;
-    nbimage = naxis1 * naxis2 * naxis3 * naxis4 * bytepix;
-    
-    newfilesize = *filesize + nbimage;  /* header + data */
-    newfilesize = (((newfilesize - 1) / 2880 ) + 1 ) * 2880;
-
-    if (newfilesize > *buffsize)   /* need to allocate more memory? */
-    {
-      fitsheader =  (char *) realloc (*buffptr, newfilesize);
-      if (fitsheader == NULL) {
-	sprintf(errmsg, "IRAFRIMAGE Cannot allocate %d-byte image buffer",
-		*filesize);
-        ffpmsg(errmsg);
-        ffpmsg(pixname);
-	fclose (fd);
-	return (*status = FILE_NOT_OPENED);
-	}
-    }
-
-    *buffptr = fitsheader;
-    *buffsize = newfilesize;
-
-    image = fitsheader + *filesize;
-    *filesize = newfilesize;
-
-    /* read in IRAF image */
-    nbr = fread (image, 1, nbimage, fd);
-    fclose (fd);
-
-    /* Check size of image */
-    if (nbr < nbimage) {
-	sprintf(errmsg, "IRAF pixel file: %d / %d bytes read.",
-		      nbr,nbimage);
-        ffpmsg(errmsg);
-        ffpmsg(pixname);
-	return (*status = FILE_NOT_OPENED);
-	}
-
-    /* Byte-reverse image, if necessary */
-    if (swapdata)
-	irafswap (bitpix, image, nbimage);
-
-    return (*status);
-}
-
-/*--------------------------------------------------------------------------*/
-/* Return IRAF image format version number from magic word in IRAF header   */
-
-static int head_version (
-    char *irafheader)	/* IRAF image header from file */
-
-{
-
-    /* Check header file magic word */
-    if (irafncmp (irafheader, "imhdr", 5) != 0 ) {
-	if (strncmp (irafheader, "imhv2", 5) != 0)
-	    return (0);
-	else
-	    return (2);
-	}
-    else
-	return (1);
-}
-
-/*--------------------------------------------------------------------------*/
-/* Return IRAF image format version number from magic word in IRAF pixel file */
-
-static int pix_version (
-    char *irafheader)   /* IRAF image header from file */
-{
-
-    /* Check pixel file header magic word */
-    if (irafncmp (irafheader, "impix", 5) != 0) {
-	if (strncmp (irafheader, "impv2", 5) != 0)
-	    return (0);
-	else
-	    return (2);
-	}
-    else
-	return (1);
-}
-
-/*--------------------------------------------------------------------------*/
-/* Verify that file is valid IRAF imhdr or impix by checking first 5 chars
- * Returns:	0 on success, 1 on failure */
-
-static int irafncmp (
-
-char	*irafheader,	/* IRAF image header from file */
-char	*teststring,	/* C character string to compare */
-int	nc)		/* Number of characters to compate */
-
-{
-    char *line;
-
-    line = iraf2str (irafheader, nc);
-    if (strncmp (line, teststring, nc) == 0) {
-	free (line);
-	return (0);
-	}
-    else
-    {
-        free (line);
-	return (1);
-    }
-}
 
 /*--------------------------------------------------------------------------*/
 /* Put filename and header path together */
 
-static void same_path (
+static char *same_path (
 
 char	*pixname,	/* IRAF pixel file pathname */
 char	*hdrname)	/* IRAF image header file pathname */
 
 {
     int len;
-    char temp[SZ_IMPIXFILE];
+    char *newpixname;
+
+    newpixname = (char *) calloc (SZ_IM2PIXFILE, sizeof (char));
 
     /* Pixel file is in same directory as header */
     if (strncmp(pixname, "HDR$", 4) == 0 ) {
-	(void)strncpy (temp, &pixname[4], SZ_IMPIXFILE);
-	(void)strncpy (pixname, hdrname, SZ_IMPIXFILE);
+	(void)strncpy (newpixname, hdrname, SZ_IM2PIXFILE);
 
 	/* find the end of the pathname */
-	len = strlen(pixname);
+	len = strlen (newpixname);
 #ifndef VMS
-	while( (len > 0) && (pixname[len-1] != '/') )
+	while( (len > 0) && (newpixname[len-1] != '/') )
 #else
-	while( (len > 0) && (pixname[len-1] != ']') && (pixname[len-1] != ':') )
+	while( (len > 0) && (newpixname[len-1] != ']') && (newpixname[len-1] != ':') )
 #endif
-      len--;
+	    len--;
 
 	/* add name */
-	pixname[len] = '\0';
-	(void)strncat(pixname, temp, SZ_IMPIXFILE);
+	newpixname[len] = '\0';
+	(void)strncat (newpixname, &pixname[4], SZ_IM2PIXFILE);
+	}
+
+    /* Bare pixel file with no path is assumed to be same as HDR$filename */
+    else if (strchr (pixname, '/') == NULL && strchr (pixname, '$') == NULL) {
+	(void)strncpy (newpixname, hdrname, SZ_IM2PIXFILE);
+
+	/* find the end of the pathname */
+	len = strlen (newpixname);
+#ifndef VMS
+	while( (len > 0) && (newpixname[len-1] != '/') )
+#else
+	while( (len > 0) && (newpixname[len-1] != ']') && (newpixname[len-1] != ':') )
+#endif
+	    len--;
+
+	/* add name */
+	newpixname[len] = '\0';
+	(void)strncat (newpixname, pixname, SZ_IM2PIXFILE);
 	}
 
     /* Pixel file has same name as header file, but with .pix extension */
-    else if (strncmp (pixname, "HDR", 3) == 0 ) {
+    else if (strncmp (pixname, "HDR", 3) == 0) {
 
 	/* load entire header name string into name buffer */
-	(void)strncpy (pixname, hdrname, SZ_IMPIXFILE);
-	len = strlen (pixname);
-	pixname[len-3] = 'p';
-	pixname[len-2] = 'i';
-	pixname[len-1] = 'x';
+	(void)strncpy (newpixname, hdrname, SZ_IM2PIXFILE);
+	len = strlen (newpixname);
+	newpixname[len-3] = 'p';
+	newpixname[len-2] = 'i';
+	newpixname[len-1] = 'x';
 	}
 
-    return;
+    return (newpixname);
 }
 
 /*--------------------------------------------------------------------------*/
diff --git a/iter_a.fit b/iter_a.fit
index 543646e..0f951cf 100644
--- a/iter_a.fit
+++ b/iter_a.fit
@@ -1,4 +1,4 @@
-SIMPLE  =                    T / file does conform to FITS standard             BITPIX  =                   16 / number of bits per data pixel                  NAXIS   =                    0 / number of data axes                            EXTEND  =                    T / FITS dataset may contain extensions            COMMENT   FITS (Flexible Image Transport System) format defined in Astronomy andCOMMENT   Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365.COMMENT   Contact the NASA Science Office of Standards and Technology for the   COMMENT   FITS Definition document #100 and other FITS information.             HISTORY    TASK:FMERGE on file ratefile.fits                                    HISTORY   fmerge3.1c at 29/12/97 16:1:37.                                       HISTORY    TASK:FMERGE on file m1.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:2:30.                                       HISTORY    TASK:FMERGE on file m3.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:3:38.                                       HISTORY    TASK:FMERGE on file m5.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:4:15.                                       HISTORY    TASK:FMERGE on file m7.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:5:1.0                                       HISTORY    TASK:FMERGE on file m9.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:6:48.                                       END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / 8-bit bytes                                    NAXIS   =                    2 / 2-dimensional binary table                     NAXIS1  =                   12 / width of table in bytes                        NAXIS2  =                10000 / number of rows in table                        PCOUNT  =                    0 / size of special data area                      GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                    3 / number of fields in each row                   TTYPE1  = 'Counts  '           / label for field   1                            TFORM1  = 'J       '           / data format of field: 4-byte INTEGER           TTYPE2  = 'Time    '           / label for field   2                            TFORM2  = 'E       '           / data format of field: 4-byte REAL              TTYPE3  = 'Rate    '           / label for field   3                            TFORM3  = 'E       '           / data format of field: 4-byte REAL              EXTNAME = 'rate    '           / name of this binary table extension            DEADTIME=                  1.0                                                  HISTORY   This FITS file was created by the FCREATE task.                       HISTORY   fcreate3.1 at 29/12/97                                                HISTORY   File modified by user 'pence' with fv  on 97-12-29T15:45:06           HISTORY   File modified by user 'pence' with fv  on 97-12-29T15:54:30           LIVETIME=         3.055450E+04 / total integration time                         HISTORY    TASK:FMERGE copied   26924 rows from file ratefile.fits              HISTORY    TASK:FMERGE appended   26924 rows from file r2.fits                  HISTORY    TASK:FMERGE copied   53848 rows from file m1.fits                    HISTORY    TASK:FMERGE appended   53848 rows from file m2.fits                  HISTORY    TASK:FMERGE copied  107696 rows from file m3.fits                    HISTORY    TASK:FMERGE appended  107696 rows from file m4.fits                  HISTORY    TASK:FMERGE copied  215392 rows from file m5.fits                    HISTORY    TASK:FMERGE appended  215392 rows from file m6.fits                  HISTORY    TASK:FMERGE copied  430784 rows from file m7.fits                    HISTORY    TASK:FMERGE appended  430784 rows from file m8.fits                  HISTORY    TASK:FMERGE copied  861568 rows from file m9.fits                    HISTORY    TASK:FMERGE appended  861568 rows from file m10.fits                 HISTORY   File modified by user 'pence' with fv  on 97-12-30T10:44:37           HISTORY   File modified by user 'pence' with fv  on 97-12-30T10:51:44           HISTORY   ftabcopy V4.0a copied columns from ratefile.fits                      HISTORY   ftabcopy V4.0a at 5/1/98 23:10:24                                     END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ���
+SIMPLE  =                    T / file does conform to FITS standard             BITPIX  =                   16 / number of bits per data pixel                  NAXIS   =                    0 / number of data axes                            EXTEND  =                    T / FITS dataset may contain extensions            COMMENT   FITS (Flexible Image Transport System) format defined in Astronomy andCOMMENT   Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365.COMMENT   Contact the NASA Science Office of Standards and Technology for the   COMMENT   FITS Definition document #100 and other FITS information.             HISTORY    TASK:FMERGE on file ratefile.fits                                    HISTORY   fmerge3.1c at 29/12/97 16:1:37.                                       HISTORY    TASK:FMERGE on file m1.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:2:30.                                       HISTORY    TASK:FMERGE on file m3.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:3:38.                                       HISTORY    TASK:FMERGE on file m5.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:4:15.                                       HISTORY    TASK:FMERGE on file m7.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:5:1.0                                       HISTORY    TASK:FMERGE on file m9.fits                                          HISTORY   fmerge3.1c at 29/12/97 16:6:48.                                       END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / 8-bit bytes                                    NAXIS   =                    2 / 2-dimensional binary table                     NAXIS1  =                   12 / width of table in bytes                        NAXIS2  =                10000 / number of rows in table                        PCOUNT  =                    0 / size of special data area                      GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                    3 / number of fields in each row                   TTYPE1  = 'Counts  '           / label for field   1                            TFORM1  = 'J       '           / data format of field: 4-byte INTEGER           TTYPE2  = 'Time    '           / label for field   2                            TFORM2  = 'E       '           / data format of field: 4-byte REAL              TTYPE3  = 'Rate    '           / label for field   3                            TFORM3  = 'E       '           / data format of field: 4-byte REAL              EXTNAME = 'rate    '           / name of this binary table extension            DEADTIME=                  1.0                                                  HISTORY   This FITS file was created by the FCREATE task.                       HISTORY   fcreate3.1 at 29/12/97                                                HISTORY   File modified by user 'pence' with fv  on 97-12-29T15:45:06           HISTORY   File modified by user 'pence' with fv  on 97-12-29T15:54:30           LIVETIME=              30554.5 / total integration time                         HISTORY    TASK:FMERGE copied   26924 rows from file ratefile.fits              HISTORY    TASK:FMERGE appended   26924 rows from file r2.fits                  HISTORY    TASK:FMERGE copied   53848 rows from file m1.fits                    HISTORY    TASK:FMERGE appended   53848 rows from file m2.fits                  HISTORY    TASK:FMERGE copied  107696 rows from file m3.fits                    HISTORY    TASK:FMERGE appended  107696 rows from file m4.fits                  HISTORY    TASK:FMERGE copied  215392 rows from file m5.fits                    HISTORY    TASK:FMERGE appended  215392 rows from file m6.fits                  HISTORY    TASK:FMERGE copied  430784 rows from file m7.fits                    HISTORY    TASK:FMERGE appended  430784 rows from file m8.fits                  HISTORY    TASK:FMERGE copied  861568 rows from file m9.fits                    HISTORY    TASK:FMERGE appended  861568 rows from file m10.fits                 HISTORY   File modified by user 'pence' with fv  on 97-12-30T10:44:37           HISTORY   File modified by user 'pence' with fv  on 97-12-30T10:51:44           HISTORY   ftabcopy V4.0a copied columns from ratefile.fits                      HISTORY   ftabcopy V4.0a at 5/1/98 23:10:24                                     END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ���
 ?���A �����@���@������?���@������?���@������dA ��A �����?���@������?���@������@@��AUU���-@���@������
 ?���A �����@���@������?���@������?���@������dA ��A �����?���@������?���@������@@��AUU���-@���@������
 ?���A �����@���@������?���@������?���@������dA ��A �����?���@������?���@������@@��AUU���-@���@������
diff --git a/iter_b.fit b/iter_b.fit
index 9b4a086c8bdd695adfb7051d1098f93912485aed..74dcd9d62a2072e3d9820d9d5a412157bdec1429 100644
GIT binary patch
delta 255
zcmZqpEz$5>VnesscAwL%^7@<OL+#==$A@m^CyoFs?)1Z_m<S~Z+lWw1gc2gmTgAV5
IgP0Es06zY0s{jB1

delta 255
zcmZqpEz$5>VnesscAwL%^7@<OL+#==$A@m^CyoFs?)1Z_m<S~Z+lWw1gc2gmTgAV5
IgP0Es06zY0s{jB1

diff --git a/listhead.c b/listhead.c
index 40c365a..a9a6238 100644
--- a/listhead.c
+++ b/listhead.c
@@ -1,83 +1,62 @@
 #include <string.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include "fitsio.h"
 
-void printerror( int status);
-
 int main(int argc, char *argv[])
 {
-    fitsfile *fptr;       /* pointer to the FITS file, defined in fitsio.h */
-
-    int status, nkeys, keypos, hdutype, ii, jj;
-    char filename[FLEN_FILENAME];    /* input FITS file */
-    char card[FLEN_CARD];   /* standard string lengths defined in fitsioc.h */
-
-    status = 0;
-
-    if (argc == 1)
-        strcpy(filename, "-");  /* no command line name, so assume stdin */
-    else
-        strcpy(filename, argv[1] );   /* name of file to list */
+    fitsfile *fptr;         /* FITS file pointer, defined in fitsio.h */
+    char card[FLEN_CARD];   /* Standard string lengths defined in fitsio.h */
+    int status = 0, single = 0, hdupos, nkeys, ii;
+
+    if (argc != 2) {
+      printf("Usage:  listhead filename[ext] \n");
+      printf("\n");
+      printf("List the FITS header keywords in a single extension, or, if \n");
+      printf("ext is not given, list the keywords in all the extensions. \n");
+      printf("\n");
+      printf("Examples: \n");
+      printf("   listhead file.fits      - list every header in the file \n");
+      printf("   listhead file.fits[0]   - list primary array header \n");
+      printf("   listhead file.fits[2]   - list header of 2nd extension \n");
+      printf("   listhead file.fits+2    - same as above \n");
+      printf("   listhead file.fits[GTI] - list header of GTI extension\n");
+      printf("\n");
+      printf("Note that it may be necessary to enclose the input file\n");
+      printf("name in single quote characters on the Unix command line.\n");
+      return(0);
+    }
 
+    if (!fits_open_file(&fptr, argv[1], READONLY, &status))
+    {
+      fits_get_hdu_num(fptr, &hdupos);  /* Get the current HDU position */
 
-    if ( fits_open_file(&fptr, filename, READONLY, &status) ) 
-         printerror( status );
+      /* List only a single header if a specific extension was given */ 
+      if (hdupos != 1 || strchr(argv[1], '[')) single = 1;
 
-    /* get the current HDU number */
-    fits_get_hdu_num(fptr, &ii);
+      for (; !status; hdupos++)  /* Main loop through each extension */
+      {
+        fits_get_hdrspace(fptr, &nkeys, NULL, &status); /* get # of keywords */
 
-    /* attempt to move to next HDU, until we get an EOF error */
-    for (; !(fits_movabs_hdu(fptr, ii, &hdutype, &status) ); ii++) 
-    {
-        /* get no. of keywords */
-        if (fits_get_hdrpos(fptr, &nkeys, &keypos, &status) )
-            printerror( status );
+        printf("Header listing for HDU #%d:\n", hdupos);
 
-        printf("Header listing for HDU #%d:\n", ii);
-        for (jj = 1; jj <= nkeys; jj++)  {
-            if ( fits_read_record(fptr, jj, card, &status) )
-                 printerror( status );
+        for (ii = 1; ii <= nkeys; ii++) { /* Read and print each keywords */
 
-            printf("%s\n", card); /* print the keyword card */
+           if (fits_read_record(fptr, ii, card, &status))break;
+           printf("%s\n", card);
         }
         printf("END\n\n");  /* terminate listing with END */
-    }
 
-    if (status == END_OF_FILE)   /* status values are defined in fitsio.h */
-        status = 0;              /* got the expected EOF error; reset = 0  */
-    else
-       printerror( status );     /* got an unexpected error                */
+        if (single) break;  /* quit if only listing a single header */
 
-    if ( fits_close_file(fptr, &status) )
-         printerror( status );
+        fits_movrel_hdu(fptr, 1, NULL, &status);  /* try to move to next HDU */
+      }
 
-    return(0);
-}
-/*--------------------------------------------------------------------------*/
-void printerror( int status)
-{
-    /*****************************************************/
-    /* Print out cfitsio error messages and exit program */
-    /*****************************************************/
-
-    char status_str[FLEN_STATUS], errmsg[FLEN_ERRMSG];
-  
-    if (status)
-      fprintf(stderr, "\n*** Error occurred during program execution ***\n");
-
-    fits_get_errstatus(status, status_str);   /* get the error description */
-    fprintf(stderr, "\nstatus = %d: %s\n", status, status_str);
+      if (status == END_OF_FILE)  status = 0; /* Reset after normal error */
 
-    /* get first message; null if stack is empty */
-    if ( fits_read_errmsg(errmsg) ) 
-    {
-         fprintf(stderr, "\nError message stack:\n");
-         fprintf(stderr, " %s\n", errmsg);
-
-         while ( fits_read_errmsg(errmsg) )  /* get remaining messages */
-             fprintf(stderr, " %s\n", errmsg);
+      fits_close_file(fptr, &status);
     }
 
-    exit( status );       /* terminate the program, returning error status */
+    if (status) fits_report_error(stderr, status); /* print any error message */
+    return(status);
 }
+
diff --git a/longnam.h b/longnam.h
index 25f1b9a..7bef6d2 100644
--- a/longnam.h
+++ b/longnam.h
@@ -3,18 +3,24 @@
 
 #define fits_parse_input_url ffiurl
 #define fits_parse_rootname ffrtnm
+#define fits_file_exists    ffexist
 #define fits_parse_output_url ffourl
 #define fits_parse_extspec  ffexts
 #define fits_parse_extnum   ffextn
 #define fits_parse_binspec  ffbins
 #define fits_parse_binrange ffbinr
+#define fits_parse_range    ffrwrg
 #define fits_open_memfile   ffomem
 #define fits_open_file      ffopen
+#define fits_open_data      ffdopn
+#define fits_open_table     fftopn
+#define fits_open_image     ffiopn
 #define fits_reopen_file    ffreopen
 #define fits_create_file    ffinit
 #define fits_create_memfile ffimem
 #define fits_create_template fftplt
 #define fits_flush_file     ffflus
+#define fits_flush_buffer   ffflsh
 #define fits_close_file     ffclos
 #define fits_delete_file    ffdelt
 #define fits_file_name      ffflnm
@@ -25,8 +31,10 @@
 #define fits_uppercase      ffupch
 #define fits_get_errstatus  ffgerr
 #define fits_write_errmsg   ffpmsg
+#define fits_write_errmark  ffpmrk
 #define fits_read_errmsg    ffgmsg
 #define fits_clear_errmsg   ffcmsg
+#define fits_clear_errmark  ffcmrk
 #define fits_report_error   ffrprt
 #define fits_compare_str    ffcmps
 #define fits_test_keyword   fftkey
@@ -118,7 +126,7 @@
 #define fits_read_imghdr       ffghpr
 #define fits_read_atblhdr      ffghtb
 #define fits_read_btblhdr      ffghbn
-#define fits_header2str        ffh2st
+#define fits_hdr2str           ffhdr2str
 
 #define fits_update_card       ffucrd
 #define fits_update_key        ffuky
@@ -155,6 +163,7 @@
 #define fits_modify_key_dblcmp ffmkym
 
 #define fits_insert_record     ffirec
+#define fits_insert_card       ffikey
 #define fits_insert_key_null   ffikyu
 #define fits_insert_key_str    ffikys
 #define fits_insert_key_longstr    ffikls
@@ -178,6 +187,7 @@
 
 #define fits_get_img_param  ffgipr
 #define fits_get_img_type   ffgidt
+#define fits_get_img_equivtype   ffgiet
 #define fits_get_img_dim    ffgidm
 #define fits_get_img_size   ffgisz
 
@@ -194,6 +204,7 @@
 #define fits_resize_img     ffrsim
 #define fits_delete_hdu     ffdhdu
 #define fits_copy_hdu       ffcopy
+#define fits_copy_file      ffcpfl
 #define fits_copy_header    ffcphd
 #define fits_copy_data      ffcpdt
 
@@ -217,6 +228,7 @@
 #define fits_get_colnum     ffgcno
 #define fits_get_colname    ffgcnn
 #define fits_get_coltype    ffgtcl
+#define fits_get_eqcoltype  ffeqty
 #define fits_get_num_rows   ffgnrw
 #define fits_get_num_cols   ffgncl
 #define fits_get_acolparms  ffgacl
@@ -225,10 +237,12 @@
 #define fits_iterate_data   ffiter
 
 #define fits_read_grppar_byt  ffggpb
+#define fits_read_grppar_sbyt  ffggpsb
 #define fits_read_grppar_usht  ffggpui
 #define fits_read_grppar_ulng  ffggpuj
 #define fits_read_grppar_sht  ffggpi
 #define fits_read_grppar_lng  ffggpj
+#define fits_read_grppar_lnglng  ffggpjj
 #define fits_read_grppar_int  ffggpk
 #define fits_read_grppar_uint  ffggpuk
 #define fits_read_grppar_flt  ffggpe
@@ -239,40 +253,48 @@
 #define fits_read_img         ffgpv
 #define fits_read_imgnull     ffgpf
 #define fits_read_img_byt     ffgpvb
+#define fits_read_img_sbyt     ffgpvsb
 #define fits_read_img_usht     ffgpvui
 #define fits_read_img_ulng     ffgpvuj
 #define fits_read_img_sht     ffgpvi
 #define fits_read_img_lng     ffgpvj
+#define fits_read_img_lnglng     ffgpvjj
 #define fits_read_img_uint     ffgpvuk
 #define fits_read_img_int     ffgpvk
 #define fits_read_img_flt     ffgpve
 #define fits_read_img_dbl     ffgpvd
 
 #define fits_read_imgnull_byt ffgpfb
+#define fits_read_imgnull_sbyt ffgpfsb
 #define fits_read_imgnull_usht ffgpfui
 #define fits_read_imgnull_ulng ffgpfuj
 #define fits_read_imgnull_sht ffgpfi
 #define fits_read_imgnull_lng ffgpfj
+#define fits_read_imgnull_lnglng ffgpfjj
 #define fits_read_imgnull_uint ffgpfuk
 #define fits_read_imgnull_int ffgpfk
 #define fits_read_imgnull_flt ffgpfe
 #define fits_read_imgnull_dbl ffgpfd
 
 #define fits_read_2d_byt      ffg2db
+#define fits_read_2d_sbyt     ffg2dsb
 #define fits_read_2d_usht      ffg2dui
 #define fits_read_2d_ulng      ffg2duj
 #define fits_read_2d_sht      ffg2di
 #define fits_read_2d_lng      ffg2dj
+#define fits_read_2d_lnglng      ffg2djj
 #define fits_read_2d_uint      ffg2duk
 #define fits_read_2d_int      ffg2dk
 #define fits_read_2d_flt      ffg2de
 #define fits_read_2d_dbl      ffg2dd
 
 #define fits_read_3d_byt      ffg3db
+#define fits_read_3d_sbyt      ffg3dsb
 #define fits_read_3d_usht      ffg3dui
 #define fits_read_3d_ulng      ffg3duj
 #define fits_read_3d_sht      ffg3di
 #define fits_read_3d_lng      ffg3dj
+#define fits_read_3d_lnglng      ffg3djj
 #define fits_read_3d_uint      ffg3duk
 #define fits_read_3d_int      ffg3dk
 #define fits_read_3d_flt      ffg3de
@@ -280,34 +302,43 @@
 
 #define fits_read_subset      ffgsv
 #define fits_read_subset_byt  ffgsvb
+#define fits_read_subset_sbyt  ffgsvsb
 #define fits_read_subset_usht  ffgsvui
 #define fits_read_subset_ulng  ffgsvuj
 #define fits_read_subset_sht  ffgsvi
 #define fits_read_subset_lng  ffgsvj
+#define fits_read_subset_lnglng  ffgsvjj
 #define fits_read_subset_uint  ffgsvuk
 #define fits_read_subset_int  ffgsvk
 #define fits_read_subset_flt  ffgsve
 #define fits_read_subset_dbl  ffgsvd
 
 #define fits_read_subsetnull_byt ffgsfb
+#define fits_read_subsetnull_sbyt ffgsfsb
 #define fits_read_subsetnull_usht ffgsfui
 #define fits_read_subsetnull_ulng ffgsfuj
 #define fits_read_subsetnull_sht ffgsfi
 #define fits_read_subsetnull_lng ffgsfj
+#define fits_read_subsetnull_lnglng ffgsfjj
 #define fits_read_subsetnull_uint ffgsfuk
 #define fits_read_subsetnull_int ffgsfk
 #define fits_read_subsetnull_flt ffgsfe
 #define fits_read_subsetnull_dbl ffgsfd
 
+#define fits_compress_img fits_comp_img
+#define fits_decompress_img fits_decomp_img
+
 #define fits_read_col        ffgcv
 #define fits_read_colnull    ffgcf
 #define fits_read_col_str    ffgcvs
 #define fits_read_col_log    ffgcvl
 #define fits_read_col_byt    ffgcvb
+#define fits_read_col_sbyt    ffgcvsb
 #define fits_read_col_usht    ffgcvui
 #define fits_read_col_ulng    ffgcvuj
 #define fits_read_col_sht    ffgcvi
 #define fits_read_col_lng    ffgcvj
+#define fits_read_col_lnglng    ffgcvjj
 #define fits_read_col_uint    ffgcvuk
 #define fits_read_col_int    ffgcvk
 #define fits_read_col_flt    ffgcve
@@ -321,10 +352,12 @@
 #define fits_read_colnull_str    ffgcfs
 #define fits_read_colnull_log    ffgcfl
 #define fits_read_colnull_byt    ffgcfb
+#define fits_read_colnull_sbyt    ffgcfsb
 #define fits_read_colnull_usht    ffgcfui
 #define fits_read_colnull_ulng    ffgcfuj
 #define fits_read_colnull_sht    ffgcfi
 #define fits_read_colnull_lng    ffgcfj
+#define fits_read_colnull_lnglng    ffgcfjj
 #define fits_read_colnull_uint    ffgcfuk
 #define fits_read_colnull_int    ffgcfk
 #define fits_read_colnull_flt    ffgcfe
@@ -337,22 +370,27 @@
 #define fits_read_tblbytes    ffgtbb
 
 #define fits_write_grppar_byt ffpgpb
+#define fits_write_grppar_sbyt ffpgpsb
 #define fits_write_grppar_usht ffpgpui
 #define fits_write_grppar_ulng ffpgpuj
 #define fits_write_grppar_sht ffpgpi
 #define fits_write_grppar_lng ffpgpj
+#define fits_write_grppar_lnglng ffpgpjj
 #define fits_write_grppar_uint ffpgpuk
 #define fits_write_grppar_int ffpgpk
 #define fits_write_grppar_flt ffpgpe
 #define fits_write_grppar_dbl ffpgpd
 
 #define fits_write_pix        ffppx
+#define fits_write_pixnull    ffppxn
 #define fits_write_img        ffppr
 #define fits_write_img_byt    ffpprb
+#define fits_write_img_sbyt    ffpprsb
 #define fits_write_img_usht    ffpprui
 #define fits_write_img_ulng    ffppruj
 #define fits_write_img_sht    ffppri
 #define fits_write_img_lng    ffpprj
+#define fits_write_img_lnglng    ffpprjj
 #define fits_write_img_uint    ffppruk
 #define fits_write_img_int    ffpprk
 #define fits_write_img_flt    ffppre
@@ -360,10 +398,12 @@
 
 #define fits_write_imgnull     ffppn
 #define fits_write_imgnull_byt ffppnb
+#define fits_write_imgnull_sbyt ffppnsb
 #define fits_write_imgnull_usht ffppnui
 #define fits_write_imgnull_ulng ffppnuj
 #define fits_write_imgnull_sht ffppni
 #define fits_write_imgnull_lng ffppnj
+#define fits_write_imgnull_lnglng ffppnjj
 #define fits_write_imgnull_uint ffppnuk
 #define fits_write_imgnull_int ffppnk
 #define fits_write_imgnull_flt ffppne
@@ -373,30 +413,37 @@
 #define fits_write_null_img ffpprn
 
 #define fits_write_2d_byt   ffp2db
+#define fits_write_2d_sbyt   ffp2dsb
 #define fits_write_2d_usht   ffp2dui
 #define fits_write_2d_ulng   ffp2duj
 #define fits_write_2d_sht   ffp2di
 #define fits_write_2d_lng   ffp2dj
+#define fits_write_2d_lnglng   ffp2djj
 #define fits_write_2d_uint   ffp2duk
 #define fits_write_2d_int   ffp2dk
 #define fits_write_2d_flt   ffp2de
 #define fits_write_2d_dbl   ffp2dd
 
 #define fits_write_3d_byt   ffp3db
+#define fits_write_3d_sbyt   ffp3dsb
 #define fits_write_3d_usht   ffp3dui
 #define fits_write_3d_ulng   ffp3duj
 #define fits_write_3d_sht   ffp3di
 #define fits_write_3d_lng   ffp3dj
+#define fits_write_3d_lnglng   ffp3djj
 #define fits_write_3d_uint   ffp3duk
 #define fits_write_3d_int   ffp3dk
 #define fits_write_3d_flt   ffp3de
 #define fits_write_3d_dbl   ffp3dd
 
+#define fits_write_subset  ffpss
 #define fits_write_subset_byt  ffpssb
+#define fits_write_subset_sbyt  ffpsssb
 #define fits_write_subset_usht  ffpssui
 #define fits_write_subset_ulng  ffpssuj
 #define fits_write_subset_sht  ffpssi
 #define fits_write_subset_lng  ffpssj
+#define fits_write_subset_lnglng  ffpssjj
 #define fits_write_subset_uint  ffpssuk
 #define fits_write_subset_int  ffpssk
 #define fits_write_subset_flt  ffpsse
@@ -406,10 +453,12 @@
 #define fits_write_col_str     ffpcls
 #define fits_write_col_log     ffpcll
 #define fits_write_col_byt     ffpclb
+#define fits_write_col_sbyt     ffpclsb
 #define fits_write_col_usht     ffpclui
 #define fits_write_col_ulng     ffpcluj
 #define fits_write_col_sht     ffpcli
 #define fits_write_col_lng     ffpclj
+#define fits_write_col_lnglng     ffpcljj
 #define fits_write_col_uint     ffpcluk
 #define fits_write_col_int     ffpclk
 #define fits_write_col_flt     ffpcle
@@ -423,20 +472,25 @@
 #define fits_write_colnull_str ffpcns
 #define fits_write_colnull_log ffpcnl
 #define fits_write_colnull_byt ffpcnb
+#define fits_write_colnull_sbyt ffpcnsb
 #define fits_write_colnull_usht ffpcnui
 #define fits_write_colnull_ulng ffpcnuj
 #define fits_write_colnull_sht ffpcni
 #define fits_write_colnull_lng ffpcnj
+#define fits_write_colnull_lnglng ffpcnjj
 #define fits_write_colnull_uint ffpcnuk
 #define fits_write_colnull_int ffpcnk
 #define fits_write_colnull_flt ffpcne
 #define fits_write_colnull_dbl ffpcnd
 
 #define fits_write_descript  ffpdes
+#define fits_compress_heap   ffcmph
+#define fits_test_heap   fftheap
 
 #define fits_write_tblbytes  ffptbb
 #define fits_insert_rows  ffirow
 #define fits_delete_rows  ffdrow
+#define fits_delete_rowrange ffdrrg
 #define fits_delete_rowlist ffdrws
 #define fits_insert_col   fficol
 #define fits_insert_cols  fficls
diff --git a/make_dfloat.com b/make_dfloat.com
index eb12ce9..913fa8b 100644
--- a/make_dfloat.com
+++ b/make_dfloat.com
@@ -16,8 +16,11 @@ $ cc/float=d_float eval_y.c
 $ cc/float=d_float fitscore.c
 $ cc/float=d_float f77_wrap1.c
 $ cc/float=d_float f77_wrap2.c
+$ cc/float=d_float f77_wrap3.c
+$ cc/float=d_float f77_wrap4.c
 $ cc/float=d_float getcol.c
 $ cc/float=d_float getcolb.c
+$ cc/float=d_float getcolsb.c
 $ cc/float=d_float getcoli.c
 $ cc/float=d_float getcolj.c
 $ cc/float=d_float getcolui.c
@@ -36,6 +39,7 @@ $ cc/float=d_float iraffits.c
 $ cc/float=d_float modkey.c
 $ cc/float=d_float putcol.c
 $ cc/float=d_float putcolb.c
+$ cc/float=d_float putcolsb.c
 $ cc/float=d_float putcoli.c
 $ cc/float=d_float putcolj.c
 $ cc/float=d_float putcolk.c
@@ -58,11 +62,12 @@ $ cc/float=d_float quantize.c
 $ cc/float=d_float ricecomp.c
 $ cc/float=d_float pliocomp.c
 $ lib/create cfitsio buffers,cfileio,checksum,compress,drvrfile,drvrmem
-$ lib/insert cfitsio editcol,edithdu,eval_f,eval_l,eval_y,f77_wrap1,f77_wrap2
+$ lib/insert cfitsio editcol,edithdu,eval_f,eval_l,eval_y
+$ lib/insert cfitsio f77_wrap1,f77_wrap2,f77_wrap3,f77_wrap4
 $ lib/insert cfitsio fitscore,getcol,getcolb,getcoli,getcolj,getcolk,getcole
-$ lib/insert cfitsio getcold,getcoll,getcols,getcolui,getcoluj,getcoluk
+$ lib/insert cfitsio getcold,getcoll,getcols,getcolui,getcoluj,getcoluk,getcolsb
 $ lib/insert cfitsio getkey,group,grparser,histo,iraffits,modkey,putcol,putcolb
-$ lib/insert cfitsio putcoli,putcolj,putcolk,putcole,putcold,putcolui
+$ lib/insert cfitsio putcoli,putcolj,putcolk,putcole,putcold,putcolui,putcolsb
 $ lib/insert cfitsio putcoluj,putcoluk,putcols,putcoll,putcolu,putkey,region
 $ lib/insert cfitsio scalnull,swapproc,wcsutil,wcssub
 $ lib/insert cfitsio imcompress,quantize,ricecomp,pliocomp
diff --git a/make_gfloat.com b/make_gfloat.com
index b0d07ba..0eda18c 100644
--- a/make_gfloat.com
+++ b/make_gfloat.com
@@ -17,8 +17,11 @@ $ cc eval_y.c
 $ cc fitscore.c
 $ cc f77_wrap1.c
 $ cc f77_wrap2.c
+$ cc f77_wrap3.c
+$ cc f77_wrap4.c
 $ cc getcol.c
 $ cc getcolb.c
+$ cc getcolsb.c
 $ cc getcoli.c
 $ cc getcolj.c
 $ cc getcolui.c
@@ -37,6 +40,7 @@ $ cc iraffits.c
 $ cc modkey.c
 $ cc putcol.c
 $ cc putcolb.c
+$ cc putcolsb.c
 $ cc putcoli.c
 $ cc putcolj.c
 $ cc putcolk.c
@@ -59,11 +63,12 @@ $ cc quantize.c
 $ cc ricecomp.c
 $ cc pliocomp.c
 $ lib/create cfitsio buffers,cfileio,checksum,compress,drvrfile,drvrmem
-$ lib/insert cfitsio editcol,edithdu,eval_f,eval_l,eval_y,f77_wrap1,f77_wrap2
+$ lib/insert cfitsio editcol,edithdu,eval_f,eval_l,eval_y
+$ lib/insert cfitsio f77_wrap1,f77_wrap2,f77_wrap3,f77_wrap4
 $ lib/insert cfitsio fitscore,getcol,getcolb,getcoli,getcolj,getcolk,getcole
-$ lib/insert cfitsio getcold,getcoll,getcols,getcolui,getcoluj,getcoluk
+$ lib/insert cfitsio getcold,getcoll,getcols,getcolui,getcoluj,getcoluk,getcolsb
 $ lib/insert cfitsio getkey,group,grparser,histo,iraffits,modkey,putcol,putcolb
-$ lib/insert cfitsio putcoli,putcolj,putcolk,putcole,putcold,putcolui
+$ lib/insert cfitsio putcoli,putcolj,putcolk,putcole,putcold,putcolui,putcolsb
 $ lib/insert cfitsio putcoluj,putcoluk,putcols,putcoll,putcolu,putkey,region
 $ lib/insert cfitsio scalnull,swapproc,wcsutil,wcssub
 $ lib/insert cfitsio imcompress,quantize,ricecomp,pliocomp
diff --git a/make_ieee.com b/make_ieee.com
index f4c5f1d..b2b0b0c 100644
--- a/make_ieee.com
+++ b/make_ieee.com
@@ -16,8 +16,11 @@ $ cc/float=ieee_float eval_y.c
 $ cc/float=ieee_float fitscore.c
 $ cc/float=ieee_float f77_wrap1.c
 $ cc/float=ieee_float f77_wrap2.c
+$ cc/float=ieee_float f77_wrap3.c
+$ cc/float=ieee_float f77_wrap4.c
 $ cc/float=ieee_float getcol.c
 $ cc/float=ieee_float getcolb.c
+$ cc/float=ieee_float getcolsb.c
 $ cc/float=ieee_float getcoli.c
 $ cc/float=ieee_float getcolj.c
 $ cc/float=ieee_float getcolui.c
@@ -36,6 +39,7 @@ $ cc/float=ieee_float iraffits.c
 $ cc/float=ieee_float modkey.c
 $ cc/float=ieee_float putcol.c
 $ cc/float=ieee_float putcolb.c
+$ cc/float=ieee_float putcolsb.c
 $ cc/float=ieee_float putcoli.c
 $ cc/float=ieee_float putcolj.c
 $ cc/float=ieee_float putcolk.c
@@ -58,11 +62,12 @@ $ cc/float=ieee_float quantize.c
 $ cc/float=ieee_float ricecomp.c
 $ cc/float=ieee_float pliocomp.c
 $ lib/create cfitsio buffers,cfileio,checksum,compress,drvrfile,drvrmem
-$ lib/insert cfitsio editcol,edithdu,eval_f,eval_l,eval_y,f77_wrap1,f77_wrap2
+$ lib/insert cfitsio editcol,edithdu,eval_f,eval_l,eval_y
+$ lib/insert cfitsio f77_wrap1,f77_wrap2,f77_wrap3,f77_wrap4
 $ lib/insert cfitsio fitscore,getcol,getcolb,getcoli,getcolj,getcolk,getcole
-$ lib/insert cfitsio getcold,getcoll,getcols,getcolui,getcoluj,getcoluk
+$ lib/insert cfitsio getcold,getcoll,getcols,getcolui,getcoluj,getcoluk,getcolsb
 $ lib/insert cfitsio getkey,group,grparser,histo,iraffits,modkey,putcol,putcolb
-$ lib/insert cfitsio putcoli,putcolj,putcolk,putcole,putcold,putcolui
+$ lib/insert cfitsio putcoli,putcolj,putcolk,putcole,putcold,putcolui,putcolsb
 $ lib/insert cfitsio putcoluj,putcoluk,putcols,putcoll,putcolu,putkey,region
 $ lib/insert cfitsio scalnull,swapproc,wcsutil,wcssub
 $ lib/insert cfitsio imcompress,quantize,ricecomp,pliocomp
diff --git a/makefile.bc b/makefile.bc
index 1b91309..d8fa69e 100644
--- a/makefile.bc
+++ b/makefile.bc
@@ -71,6 +71,7 @@ Dep_cfitsioddll = \
    putcole.obj\
    putcold.obj\
    putcolb.obj\
+   putcolsb.obj\
    putcol.obj\
    modkey.obj\
    swapproc.obj\
@@ -88,10 +89,13 @@ Dep_cfitsioddll = \
    getcole.obj\
    getcold.obj\
    getcolb.obj\
+   getcolsb.obj\
    grparser.obj\
    fitscore.obj\
    f77_wrap1.obj\
    f77_wrap2.obj\
+   f77_wrap3.obj\
+   f77_wrap4.obj\
    eval_y.obj\
    eval_l.obj\
    eval_f.obj\
@@ -132,6 +136,7 @@ putcoli.obj+
 putcole.obj+
 putcold.obj+
 putcolb.obj+
+putcolsb.obj+
 putcol.obj+
 modkey.obj+
 swapproc.obj+
@@ -149,10 +154,13 @@ getcoli.obj+
 getcole.obj+
 getcold.obj+
 getcolb.obj+
+getcolsb.obj+
 grparser.obj+
 fitscore.obj+
 f77_wrap1.obj+
 f77_wrap2.obj+
+f77_wrap3.obj+
+f77_wrap4.obj+
 eval_y.obj+
 eval_l.obj+
 eval_f.obj+
@@ -259,6 +267,11 @@ putcolb.obj :  putcolb.c
  $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ putcolb.c
 |
 
+putcolsb.obj :  putcolsb.c
+  $(BCC32) -P- -c @&&|
+ $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ putcolsb.c
+|
+
 putcol.obj :  putcol.c
   $(BCC32) -P- -c @&&|
  $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ putcol.c
@@ -343,6 +356,10 @@ getcolb.obj :  getcolb.c
   $(BCC32) -P- -c @&&|
  $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ getcolb.c
 |
+getcolsb.obj :  getcolsb.c
+  $(BCC32) -P- -c @&&|
+ $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ getcolsb.c
+|
 
 grparser.obj :  grparser.c
   $(BCC32) -P- -c @&&|
@@ -364,6 +381,16 @@ f77_wrap2.obj :  f77_wrap2.c
  $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ f77_wrap2.c
 |
 
+f77_wrap3.obj :  f77_wrap3.c
+  $(BCC32) -P- -c @&&|
+ $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ f77_wrap3.c
+|
+
+f77_wrap4.obj :  f77_wrap4.c
+  $(BCC32) -P- -c @&&|
+ $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ f77_wrap4.c
+|
+
 eval_y.obj :  eval_y.c
   $(BCC32) -P- -c @&&|
  $(CompOptsAt_cfitsiodlib) $(CompInheritOptsAt_cfitsiodlib) -o$@ eval_y.c
diff --git a/makefile.vcc b/makefile.vcc
index c562333..42df7ff 100644
--- a/makefile.vcc
+++ b/makefile.vcc
@@ -55,8 +55,11 @@ CLEAN :
 	-@erase "$(INTDIR)\fitscore.obj"
 	-@erase "$(INTDIR)\f77_wrap1.obj"
 	-@erase "$(INTDIR)\f77_wrap2.obj"
+	-@erase "$(INTDIR)\f77_wrap3.obj"
+	-@erase "$(INTDIR)\f77_wrap4.obj"
 	-@erase "$(INTDIR)\getcol.obj"
 	-@erase "$(INTDIR)\getcolb.obj"
+	-@erase "$(INTDIR)\getcolsb.obj"
 	-@erase "$(INTDIR)\getcold.obj"
 	-@erase "$(INTDIR)\getcole.obj"
 	-@erase "$(INTDIR)\getcoli.obj"
@@ -72,10 +75,10 @@ CLEAN :
 	-@erase "$(INTDIR)\grparser.obj"
 	-@erase "$(INTDIR)\histo.obj"
 	-@erase "$(INTDIR)\iraffits.obj"
-	-@erase "$(INTDIR)\listhead.obj"
 	-@erase "$(INTDIR)\modkey.obj"
 	-@erase "$(INTDIR)\putcol.obj"
 	-@erase "$(INTDIR)\putcolb.obj"
+	-@erase "$(INTDIR)\putcolsb.obj"
 	-@erase "$(INTDIR)\putcold.obj"
 	-@erase "$(INTDIR)\putcole.obj"
 	-@erase "$(INTDIR)\putcoli.obj"
@@ -96,6 +99,7 @@ CLEAN :
 	-@erase "$(INTDIR)\quantize.obj"
 	-@erase "$(INTDIR)\pliocomp.obj"
 	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\wcssub.obj"
 	-@erase "$(INTDIR)\wcsutil.obj"
 	-@erase "$(OUTDIR)\cfitsio.dll"
 	-@erase "$(OUTDIR)\cfitsio.exp"
@@ -107,7 +111,7 @@ CLEAN :
 "$(INTDIR)" :
     if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
 
-CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CFITSIO_EXPORTS" /Fp"$(INTDIR)\cfitsio.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CFITSIO_EXPORTS" /Fp"$(INTDIR)\cfitsio.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
 MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
 BSC32=bscmake.exe
 BSC32_FLAGS=/nologo /o"$(OUTDIR)\cfitsio.bsc" 
@@ -131,8 +135,11 @@ LINK32_OBJS= \
 	"$(INTDIR)\fitscore.obj" \
 	"$(INTDIR)\f77_wrap1.obj" \
 	"$(INTDIR)\f77_wrap2.obj" \
+	"$(INTDIR)\f77_wrap3.obj" \
+	"$(INTDIR)\f77_wrap4.obj" \
 	"$(INTDIR)\getcol.obj" \
 	"$(INTDIR)\getcolb.obj" \
+	"$(INTDIR)\getcolsb.obj" \
 	"$(INTDIR)\getcold.obj" \
 	"$(INTDIR)\getcole.obj" \
 	"$(INTDIR)\getcoli.obj" \
@@ -148,10 +155,10 @@ LINK32_OBJS= \
 	"$(INTDIR)\grparser.obj" \
 	"$(INTDIR)\histo.obj" \
 	"$(INTDIR)\iraffits.obj" \
-	"$(INTDIR)\listhead.obj" \
 	"$(INTDIR)\modkey.obj" \
 	"$(INTDIR)\putcol.obj" \
 	"$(INTDIR)\putcolb.obj" \
+	"$(INTDIR)\putcolsb.obj" \
 	"$(INTDIR)\putcold.obj" \
 	"$(INTDIR)\putcole.obj" \
 	"$(INTDIR)\putcoli.obj" \
@@ -171,6 +178,7 @@ LINK32_OBJS= \
 	"$(INTDIR)\ricecomp.obj" \
 	"$(INTDIR)\quantize.obj" \
 	"$(INTDIR)\pliocomp.obj" \
+	"$(INTDIR)\wcssub.obj"  \
 	"$(INTDIR)\wcsutil.obj" 
 
 "$(OUTDIR)\cfitsio.dll" : $(LINK32_OBJS) WINDUMP
@@ -205,8 +213,11 @@ CLEAN :
 	-@erase "$(INTDIR)\fitscore.obj"
 	-@erase "$(INTDIR)\f77_wrap1.obj"
 	-@erase "$(INTDIR)\f77_wrap2.obj"
+	-@erase "$(INTDIR)\f77_wrap3.obj"
+	-@erase "$(INTDIR)\f77_wrap4.obj"
 	-@erase "$(INTDIR)\getcol.obj"
 	-@erase "$(INTDIR)\getcolb.obj"
+	-@erase "$(INTDIR)\getcolsb.obj"
 	-@erase "$(INTDIR)\getcold.obj"
 	-@erase "$(INTDIR)\getcole.obj"
 	-@erase "$(INTDIR)\getcoli.obj"
@@ -222,10 +233,10 @@ CLEAN :
 	-@erase "$(INTDIR)\grparser.obj"
 	-@erase "$(INTDIR)\histo.obj"
 	-@erase "$(INTDIR)\iraffits.obj"
-	-@erase "$(INTDIR)\listhead.obj"
 	-@erase "$(INTDIR)\modkey.obj"
 	-@erase "$(INTDIR)\putcol.obj"
 	-@erase "$(INTDIR)\putcolb.obj"
+	-@erase "$(INTDIR)\putcolsb.obj"
 	-@erase "$(INTDIR)\putcold.obj"
 	-@erase "$(INTDIR)\putcole.obj"
 	-@erase "$(INTDIR)\putcoli.obj"
@@ -243,6 +254,7 @@ CLEAN :
 	-@erase "$(INTDIR)\swapproc.obj"
 	-@erase "$(INTDIR)\vc60.idb"
 	-@erase "$(INTDIR)\vc60.pdb"
+	-@erase "$(INTDIR)\wcssub.obj"
 	-@erase "$(INTDIR)\wcsutil.obj"
 	-@erase "$(INTDIR)\imcompress.obj"
 	-@erase "$(INTDIR)\ricecomp.obj"
@@ -260,7 +272,7 @@ CLEAN :
 "$(INTDIR)" :
     if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
 
-CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /D "__WIN32__" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CFITSIO_EXPORTS" /Fp"$(INTDIR)\cfitsio.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+CPP_PROJ=/nologo /MD /W3 /Gm /GX /ZI /Od /D "__WIN32__" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CFITSIO_EXPORTS" /Fp"$(INTDIR)\cfitsio.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
 MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 
 BSC32=bscmake.exe
 BSC32_FLAGS=/nologo /o"$(OUTDIR)\cfitsio.bsc" 
@@ -284,8 +296,11 @@ LINK32_OBJS= \
 	"$(INTDIR)\fitscore.obj" \
 	"$(INTDIR)\f77_wrap1.obj" \
 	"$(INTDIR)\f77_wrap2.obj" \
+	"$(INTDIR)\f77_wrap3.obj" \
+	"$(INTDIR)\f77_wrap4.obj" \
 	"$(INTDIR)\getcol.obj" \
 	"$(INTDIR)\getcolb.obj" \
+	"$(INTDIR)\getcolsb.obj" \
 	"$(INTDIR)\getcold.obj" \
 	"$(INTDIR)\getcole.obj" \
 	"$(INTDIR)\getcoli.obj" \
@@ -301,10 +316,10 @@ LINK32_OBJS= \
 	"$(INTDIR)\grparser.obj" \
 	"$(INTDIR)\histo.obj" \
 	"$(INTDIR)\iraffits.obj" \
-	"$(INTDIR)\listhead.obj" \
 	"$(INTDIR)\modkey.obj" \
 	"$(INTDIR)\putcol.obj" \
 	"$(INTDIR)\putcolb.obj" \
+	"$(INTDIR)\putcolsb.obj" \
 	"$(INTDIR)\putcold.obj" \
 	"$(INTDIR)\putcole.obj" \
 	"$(INTDIR)\putcoli.obj" \
@@ -320,6 +335,7 @@ LINK32_OBJS= \
 	"$(INTDIR)\region.obj" \
 	"$(INTDIR)\scalnull.obj" \
 	"$(INTDIR)\swapproc.obj" \
+	"$(INTDIR)\wcssub.obj" \
 	"$(INTDIR)\wcsutil.obj" \
 	"$(INTDIR)\imcompress.obj" \
 	"$(INTDIR)\ricecomp.obj" \
@@ -446,6 +462,16 @@ SOURCE=.\f77_wrap2.c
 "$(INTDIR)\f77_wrap2.obj" : $(SOURCE) "$(INTDIR)"
 
 
+SOURCE=.\f77_wrap3.c
+
+"$(INTDIR)\f77_wrap3.obj" : $(SOURCE) "$(INTDIR)"
+
+
+SOURCE=.\f77_wrap4.c
+
+"$(INTDIR)\f77_wrap4.obj" : $(SOURCE) "$(INTDIR)"
+
+
 SOURCE=.\getcol.c
 
 "$(INTDIR)\getcol.obj" : $(SOURCE) "$(INTDIR)"
@@ -456,6 +482,11 @@ SOURCE=.\getcolb.c
 "$(INTDIR)\getcolb.obj" : $(SOURCE) "$(INTDIR)"
 
 
+SOURCE=.\getcolsb.c
+
+"$(INTDIR)\getcolsb.obj" : $(SOURCE) "$(INTDIR)"
+
+
 SOURCE=.\getcold.c
 
 "$(INTDIR)\getcold.obj" : $(SOURCE) "$(INTDIR)"
@@ -531,11 +562,6 @@ SOURCE=.\iraffits.c
 "$(INTDIR)\iraffits.obj" : $(SOURCE) "$(INTDIR)"
 
 
-SOURCE=.\listhead.c
-
-"$(INTDIR)\listhead.obj" : $(SOURCE) "$(INTDIR)"
-
-
 SOURCE=.\modkey.c
 
 "$(INTDIR)\modkey.obj" : $(SOURCE) "$(INTDIR)"
@@ -551,6 +577,11 @@ SOURCE=.\putcolb.c
 "$(INTDIR)\putcolb.obj" : $(SOURCE) "$(INTDIR)"
 
 
+SOURCE=.\putcolsb.c
+
+"$(INTDIR)\putcolsb.obj" : $(SOURCE) "$(INTDIR)"
+
+
 SOURCE=.\putcold.c
 
 "$(INTDIR)\putcold.obj" : $(SOURCE) "$(INTDIR)"
@@ -626,6 +657,10 @@ SOURCE=.\swapproc.c
 "$(INTDIR)\swapproc.obj" : $(SOURCE) "$(INTDIR)"
 
 
+SOURCE=.\wcssub.c
+
+"$(INTDIR)\wcssub.obj" : $(SOURCE) "$(INTDIR)"
+
 SOURCE=.\wcsutil.c
 
 "$(INTDIR)\wcsutil.obj" : $(SOURCE) "$(INTDIR)"
diff --git a/makepc.bat b/makepc.bat
index fd46185..e18b393 100644
--- a/makepc.bat
+++ b/makepc.bat
@@ -15,6 +15,7 @@ bcc32 -c eval_f.c
 bcc32 -c fitscore.c
 bcc32 -c getcol.c
 bcc32 -c getcolb.c
+bcc32 -c getcolsb.c
 bcc32 -c getcoli.c
 bcc32 -c getcolj.c
 bcc32 -c getcolui.c
@@ -33,6 +34,7 @@ bcc32 -c iraffits.c
 bcc32 -c modkey.c
 bcc32 -c putcol.c
 bcc32 -c putcolb.c
+bcc32 -c putcolsb.c
 bcc32 -c putcoli.c
 bcc32 -c putcolj.c
 bcc32 -c putcolui.c
@@ -57,12 +59,12 @@ bcc32 -c pliocomp.c
 del cfitsio.lib
 tlib cfitsio +buffers +cfileio +checksum +compress +drvrfile +drvrmem 
 tlib cfitsio +editcol +edithdu +eval_l +eval_y +eval_f +fitscore
-tlib cfitsio +getcol  +getcolb +getcoli +getcolj +getcolk +getcoluk 
+tlib cfitsio +getcol +getcolb +getcolsb +getcoli +getcolj +getcolk +getcoluk 
 tlib cfitsio +getcolui +getcoluj +getcole +getcold +getcoll +getcols
 tlib cfitsio +getkey +group +grparser +histo +iraffits +modkey +putkey 
 tlib cfitsio +putcol  +putcolb +putcoli +putcolj +putcolk +putcole +putcold
 tlib cfitsio +putcoll +putcols +putcolu +putcolui +putcoluj +putcoluk
-tlib cfitsio +region +scalnull +swapproc +wcsutil +wcssub
+tlib cfitsio +region +scalnull +swapproc +wcsutil +wcssub +putcolsb
 tlib cfitsio +imcompress +quantize +ricecomp +pliocomp
 bcc32 -f testprog.c cfitsio.lib
 bcc32 -f cookbook.c cfitsio.lib
diff --git a/modkey.c b/modkey.c
index 671c08f..b257eb2 100644
--- a/modkey.c
+++ b/modkey.c
@@ -34,6 +34,10 @@ int ffuky( fitsfile *fptr,     /* I - FITS file pointer        */
     {
         ffukyj(fptr, keyname, (long) *(unsigned char *) value, comm, status);
     }
+    else if (datatype == TSBYTE)
+    {
+        ffukyj(fptr, keyname, (long) *(signed char *) value, comm, status);
+    }
     else if (datatype == TUSHORT)
     {
         ffukyj(fptr, keyname, (long) *(unsigned short *) value, comm, status);
@@ -1556,6 +1560,7 @@ int ffdrec(fitsfile *fptr,   /* I - FITS file pointer  */
     int ii, nshift;
     OFF_T bytepos;
     char *inbuff, *outbuff, *tmpbuff, buff1[81], buff2[81];
+    char message[FLEN_ERRMSG];
 
     if (*status > 0)           /* inherit input status value if > 0 */
         return(*status);
@@ -1572,6 +1577,14 @@ int ffdrec(fitsfile *fptr,   /* I - FITS file pointer  */
 
     nshift=( (fptr->Fptr)->headend - (fptr->Fptr)->nextkey ) / 80; /* no. keywords to shift */
 
+    if (nshift <= 0)
+    {
+        sprintf(message, "Cannot delete keyword number %d.  It does not exist.",
+                keypos);
+        ffpmsg(message);
+        return(*status = KEY_OUT_BOUNDS);
+    }
+
     bytepos = (fptr->Fptr)->headend - 80;  /* last keyword in header */  
 
     /* construct a blank keyword */
@@ -1579,7 +1592,6 @@ int ffdrec(fitsfile *fptr,   /* I - FITS file pointer  */
     strcat(buff2, "                                        ");
     inbuff  = buff1;
     outbuff = buff2;
-
     for (ii = 0; ii < nshift; ii++) /* shift each keyword up one position */
     {
 
diff --git a/pctype.h b/pctype.h
deleted file mode 100644
index 2ef4a67..0000000
--- a/pctype.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * These ones are necessary to override the behaviour of
- * PINT_cfB, which puts the & on before getting to the
- * TYPE specific PCINT_cfPP...
- * The only way to do this is to introduce PCDOUBLE_cfINT,
- * which means we use PCINT for alot of the generic macros.
- */
-
-#define PCINT_cfAA                PINT_cfAA
-#define PCINT_cfN                 PINT_cfN
-#define PCINT_cfV                 PINT_cfV
-#define PCINT_cfZ(T,I,A)          (__cfztringv[I]= (int ) *A),
-#define PCINT_cfSEP               INT_cfSEP
-#define PCINT_cfCC                PINT_cfCC
-#define PCINT_cfB(T,A)            _(T,_cfPP) A
-#define PCINT_cfU                 PINT_cfU
-
-/* These are the real TYPE specific ones, and will need to be
- * duplicated for FLOAT,...
- */
-#define PCINT_cfINT                  PCDOUBLE_cfINT
-#define PCINT_cfAAP(A, B)            A 
-#define PCINT_cfSTR(N,T,A,B,C,D,E)   _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
-#define PCINT_cfTYPE int
-#define PCINT_cfVP(A,B)               int  B = (int) *A;   /* For ZSTRINGV_ARGS */
-#define PCINT_cfPP
-#define PCINT_cfCCC(A,B)              A
-
-#define PCFLOAT_cfINT                 PCDOUBLE_cfINT
-#define PCFLOAT_cfAAP(A, B)           A 
-#define PCFLOAT_cfSTR(N,T,A,B,C,D,E)  _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
-#define PCFLOAT_cfTYPE                float
-#define PCFLOAT_cfVP                  PCINT_cfVP   /* For ZSTRINGV_ARGS */
-#define PCFLOAT_cfPP
-#define PCFLOAT_cfCCC(A,B)            A
-
-#define PCDOUBLE_cfINT(N,A,B,X,Y,Z)   _(CFARGS,N)(A,PCINT,B,X,Y,Z,0)
-#define PCDOUBLE_cfAAP(A, B)          A 
-#define PCDOUBLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
-#define PCDOUBLE_cfTYPE               double
-#define PCDOUBLE_cfVP                 PCINT_cfVP   /* For ZSTRINGV_ARGS */
-#define PCDOUBLE_cfPP
-#define PCDOUBLE_cfCCC(A,B)           A
-
-#define PCLOGICAL_cfINT               PCDOUBLE_cfINT
-#define PCLOGICAL_cfA(M,I,A,B)        *A=C2FLOGICAL(*A);
-#define PCLOGICAL_cfAAP(A,B)          B = A
-#define PCLOGICAL_cfC(A,B,C)          *A=C2FLOGICAL(*A); 
-#define PCLOGICAL_cfH(S,U,B)
-#define PCLOGICAL_cfJ(B)
-#define PCLOGICAL_cfW(A,B)            PLOGICAL_cfW(A,B)
-#define PCLOGICAL_cfS(M,I,A)
-#define PCLOGICAL_cfSTR(N,T,A,B,C,D,E)  _(CFARGS,N)(T,PCLOGICAL,A,B,C,D,E) 
-#define PCLOGICAL_cfTYPE              int
-#define PCLOGICAL_cfVP                PLOGICAL_cfVP   /* For ZSTRINGV_ARGS */
-#define PCLOGICAL_cfPP
-#define PCLOGICAL_cfKK                PLOGICAL_cfKK
-#define PCLOGICAL_cfCCC(A,B)          B = A
-
-/* 
- * I can't find where the following three defines are used... 
- * So they may well be wrong. 
- */
-
-#define PCLOGICAL_cfQ(B)
-#define PCLOGICAL_cfR(A,B,D)          *A=C2FLOGICAL(*A);
-#define PCLOGICAL_cfT(M,I,A,B,D)      ((*A=F2CLOGICAL(*A)),A)
-
-/* This is to get PZTRINGS to work for dynamically allocated
- * Contiguous arrays...  The problem was that the array is massaged
- * coming in with the call:         c2fstrv( A[0], A[0],... )
- * and coming out with:             f2cstrv( (char *) A, (char *) A,... )
- *
- * If you dynamically allocate an array with the trick:
- *
- *     char ** A;
- *     A = (char **) malloc ( nelements * sizeof(char *) );
- *     A[0] = (char *) malloc (nelements * elemSize * sizeof (char) );
- *     for ( i = 1; i < nelements; i++) A[i] = A[0] + i * elemSize;
- * 
- * Then the coming in call will kill you if you pass in A, and the 
- * coming out call will kill you if you pass in A[0]...
- * So, I change the coming in call to (char *)A, and you must then
- * pass in A[0].
- * 
- */
-
-
-#undef PZTRINGV_cfA
-#define PZTRINGV_cfA(M,I,A,B) APAZTRINGV_cfA(M,I,A,B,             \
-                    (_3(M,_ELEMS_,I))*(( _3(M,_ELEMLEN_,I))+1),      \
-                              (_3(M,_ELEMS_,I)),(_3(M,_ELEMLEN_,I))+1) 
-#ifdef vmsFortran
-#define  AAZTRINGV_cfA(M,I,A,B, sA,filA,silA)                                   \
- initfstr(B,malloc((sA)-(filA)),(filA),(silA)-1),                              \          c2fstrv((char *) A,B.dsc$a_pointer,(silA),(sA));
-#define APAZTRINGV_cfA(M,I,A,B, sA,filA,silA)                                   \
- initfstr(B,(char *) A,(filA),(silA)-1),c2fstrv((char *) A,(char *)A,(silA),(sA));
-#else
-#define  AAZTRINGV_cfA(M,I,A,B, sA,filA,silA)                 \
- (B.s=malloc((sA)-(filA)),B.fs=c2fstrv((char *)A,B.s,(B.flen=(silA)-1)+1,(sA)));
-#define APAZTRINGV_cfA(M,I,A,B, sA,filA,silA)                         \
- B.fs=c2fstrv((char *) A,(char *) A,(B.flen=(silA)-1)+1,B.sizeofA=(sA));
-#endif
-
-
-/*
- * This allows for character arrays longer than an unsigned short...
- */
-
-#ifndef vmsFortran
-#undef   STRING_cfV
-#undef   PSTRINGV_cfV
-#define  STRING_cfV(T,A,B,F) struct {unsigned int clen, flen;} B;
-#define  PSTRINGV_cfV(T,A,B,F) struct {char *fs; unsigned int sizeofA, flen;} B;
-#endif
-
-/* 
- * This is to introduce a PZTRING ( NO V ) type 
- */
-
-
-#ifdef vmsFortran
-#define  PZTRING_cfV(T,A,B,F) static fstring B={0,DSC$K_DTYPE_T,DSC$K_CLASS_S,NULL};
-#define  APATRING_cfA(M,I,A,B,silA) \
-        (B.dsc$w_length=strlen(A),B.dsc$a_pointer=A,       \
-        B.dsc$w_length >= silA?0:(memset((A)+B.dsc$w_length,' ',silA-B.dsc$w_length-1), \
-                             A[B.dsc$w_length=silA-1]='\0'));
-#define  PZTRING_cfC(A,B,C) \
-        (B.dsc$w_length=strlen(A),B.dsc$a_pointer=A,       \
-        B.dsc$w_length >= C?0:(memset((A)+B.dsc$w_length,' ',C-B.dsc$w_length-1), \
-                             A[B.dsc$w_length=C-1]='\0'));
-#else
-#define  PZTRING_cfV(T,A,B,F)  int     B;
-#define APATRING_cfA(M,I,A,B,silA)   \
-        (B=strlen(A),B >= silA?0:(memset((A)+B,' ',silA-B-1)),A[B = silA - 1]='\0');
-#define  PZTRING_cfC(A,B,C) \
-           (B=strlen(A),B > C?0:(memset((A)+B,' ',(C - 1)-B-1)),A[B = C - 1]='\0');
-#endif
-
-#define  PZTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PZTRING,A,B,C,D,E)
-#define  PZTRING_cfINT       PVOID_cfINT
-#define  PZTRING_cfA(M,I,A,B) APATRING_cfA(M,I,A,B,(_3(M,_ELEMLEN_,I))+1) 
-#define  PZTRING_cfAA        PSTRING_cfCC
-#define  PZTRING_cfB         PSTRING_cfB
-
-#define  PZTRING_cfCC        PSTRING_cfCC
-#define  PZTRING_cfJ         PSTRING_cfJ
-#define  PZTRING_cfH         STRING_cfH
-#define  PZTRING_cfN(T,A)   STRING_cfN(T,A)   /* CRAY insists on arg.'s here. */
-#define  PZTRING_cfS(M,I,A)  ,( _3(M,_ELEMLEN_,I) + 1 )
-#define  PZTRING_cfU(T,A)    char  *A
-#define  PZTRING_cfW(A,B)    kill_trailing(A,' ');
-#define  PZTRING_cfZ(T,I,A)
-#define  PZTRING_cfSEP       INT_cfSEP
-#define  PZTRING_cfKK        STRING_cfKK
diff --git a/pliocomp.c b/pliocomp.c
index 9247bd4..7550ed6 100644
--- a/pliocomp.c
+++ b/pliocomp.c
@@ -30,7 +30,6 @@ int pl_p2li (int *pxsrc, int xs, short *lldst, int npix)
 /* int npix;                        number of pixels to convert */
 {
     /* System generated locals */
-
     int ret_val, i__1, i__2, i__3;
 
     /* Local variables */
@@ -44,12 +43,16 @@ int pl_p2li (int *pxsrc, int xs, short *lldst, int npix)
     if (! (npix <= 0)) {
         goto L110;
     }
-
     ret_val = 0;
     goto L100;
 L110:
+    lldst[3] = -100;
+    lldst[2] = 7;
+    lldst[1] = 0;
+    lldst[6] = 0;
+    lldst[7] = 0;
     xe = xs + npix - 1;
-    op = 4;
+    op = 8;
     zero = 0;
 /* Computing MAX */
     i__1 = zero, i__2 = pxsrc[xs];
@@ -62,7 +65,6 @@ L110:
         if (! (ip < xe)) {
             goto L130;
         }
-
 /* Computing MAX */
         i__2 = zero, i__3 = pxsrc[ip + 1];
         nv = max(i__2,i__3);
@@ -77,7 +79,6 @@ L140:
         pv = nv;
         x1 = ip + 1;
         goto L120;
-
 L150:
         goto L131;
 L130:
@@ -119,7 +120,6 @@ L201:
             goto L210;
         }
         v = lldst[op - 1];
-
         lldst[op - 1] = (short) (v | 16384);
         goto L91;
 L210:
@@ -136,7 +136,6 @@ L230:
         lldst[op] = (short) min(4095,nz);
         ++op;
 /* L231: */
-
         nz += -4095;
         goto L230;
 L232:
@@ -165,7 +164,8 @@ L120:
         ;
     }
 /* L121: */
-    lldst[3] = (short) (op - 1);
+    lldst[4] = (short) ((op - 1) % 32768);
+    lldst[5] = (short) ((op - 1) / 32768);
     ret_val = op - 1;
     goto L100;
 L100:
@@ -191,7 +191,7 @@ int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix)
 
     /* Local variables */
     static int data, sw0001, otop, i__, lllen, i1, i2, x1, x2, ip, xe, np,
-             op, pv, opcode;
+             op, pv, opcode, llfirt;
     static int skipwd;
 
     /* Parameter adjustments */
@@ -199,124 +199,133 @@ int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix)
     --ll_src;
 
     /* Function Body */
+    if (! (ll_src[3] > 0)) {
+        goto L110;
+    }
     lllen = ll_src[3];
+    llfirt = 4;
+    goto L111;
+L110:
+    lllen = (ll_src[5] << 15) + ll_src[4];
+    llfirt = ll_src[2] + 1;
+L111:
     if (! (npix <= 0 || lllen <= 0)) {
-        goto L110;
+        goto L120;
     }
     ret_val = 0;
     goto L100;
-L110:
+L120:
     xe = xs + npix - 1;
     skipwd = 0;
     op = 1;
     x1 = 1;
     pv = 1;
     i__1 = lllen;
-    for (ip = 4; ip <= i__1; ++ip) {
+    for (ip = llfirt; ip <= i__1; ++ip) {
         if (! skipwd) {
-            goto L130;
+            goto L140;
         }
         skipwd = 0;
-        goto L120;
-L130:
+        goto L130;
+L140:
         opcode = ll_src[ip] / 4096;
         data = ll_src[ip] & 4095;
         sw0001 = opcode;
-
-        goto L140;
-L150:
+        goto L150;
+L160:
         x2 = x1 + data - 1;
         i1 = max(x1,xs);
         i2 = min(x2,xe);
         np = i2 - i1 + 1;
         if (! (np > 0)) {
-            goto L160;
+            goto L170;
         }
         otop = op + np - 1;
         if (! (opcode == 4)) {
-            goto L170;
+            goto L180;
         }
         i__2 = otop;
         for (i__ = op; i__ <= i__2; ++i__) {
             px_dst[i__] = pv;
-/* L180: */
+/* L190: */
         }
-/* L181: */
-        goto L171;
-L170:
+/* L191: */
+        goto L181;
+L180:
         i__2 = otop;
         for (i__ = op; i__ <= i__2; ++i__) {
             px_dst[i__] = 0;
-/* L190: */
+/* L200: */
         }
-/* L191: */
+/* L201: */
         if (! (opcode == 5 && i2 == x2)) {
-            goto L200;
+            goto L210;
         }
         px_dst[otop] = pv;
-L200:
-L171:
+L210:
+L181:
         op = otop + 1;
-L160:
+L170:
         x1 = x2 + 1;
-        goto L141;
-L210:
+        goto L151;
+L220:
         pv = (ll_src[ip + 1] << 12) + data;
         skipwd = 1;
-        goto L141;
-L220:
-        pv += data;
-        goto L141;
+        goto L151;
 L230:
-        pv -= data;
-        goto L141;
+        pv += data;
+        goto L151;
 L240:
+        pv -= data;
+        goto L151;
+L250:
         pv += data;
         goto L91;
-L250:
+L260:
         pv -= data;
 L91:
         if (! (x1 >= xs && x1 <= xe)) {
-            goto L260;
+            goto L270;
         }
         px_dst[op] = pv;
         ++op;
-L260:
+L270:
         ++x1;
-        goto L141;
-L140:
+        goto L151;
+L150:
         ++sw0001;
         if (sw0001 < 1 || sw0001 > 8) {
-            goto L141;
+            goto L151;
         }
         switch ((int)sw0001) {
-            case 1:  goto L150;
-            case 2:  goto L210;
-            case 3:  goto L220;
-            case 4:  goto L230;
-            case 5:  goto L150;
-            case 6:  goto L150;
-            case 7:  goto L240;
-            case 8:  goto L250;
+            case 1:  goto L160;
+            case 2:  goto L220;
+            case 3:  goto L230;
+            case 4:  goto L240;
+            case 5:  goto L160;
+            case 6:  goto L160;
+            case 7:  goto L250;
+            case 8:  goto L260;
         }
-L141:
+L151:
         if (! (x1 > xe)) {
-            goto L270;
+            goto L280;
         }
-        goto L121;
-L270:
-L120:
+        goto L131;
+L280:
+L130:
         ;
     }
-L121:
+L131:
     i__1 = npix;
     for (i__ = op; i__ <= i__1; ++i__) {
         px_dst[i__] = 0;
-/* L280: */
+/* L290: */
     }
-/* L281: */
+/* L291: */
     ret_val = npix;
     goto L100;
 L100:
     return ret_val;
 } /* pll2pi_ */
+
diff --git a/putcol.c b/putcol.c
index 999bc8e..348d093 100644
--- a/putcol.c
+++ b/putcol.c
@@ -29,7 +29,7 @@ int ffppx(  fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     int naxis, ii;
-    long naxes[9], firstelem, row = 1;
+    long naxes[9], firstelem, group = 1;
     OFF_T dimsize = 1;
 
     if (*status > 0)           /* inherit input status value if > 0 */
@@ -53,49 +53,50 @@ int ffppx(  fitsfile *fptr,  /* I - FITS file pointer                       */
 
     firstelem = USE_LARGE_VALUE; /* special flag value */
 
-    /*
-      the primary array is represented as a binary table:
-      each group of the primary array is a row in the table,
-      where the first column contains the group parameters
-      and the second column contains the image itself.
-    */
-
     if (datatype == TBYTE)
     {
-      ffpclb(fptr, 2, row, firstelem, nelem, (unsigned char *) array, status);
+      ffpprb(fptr, group, firstelem, nelem, (unsigned char *) array, status);
+    }
+    else if (datatype == TSBYTE)
+    {
+      ffpprsb(fptr, group, firstelem, nelem, (signed char *) array, status);
     }
     else if (datatype == TUSHORT)
     {
-      ffpclui(fptr, 2, row, firstelem, nelem, (unsigned short *) array,
+      ffpprui(fptr, group, firstelem, nelem, (unsigned short *) array,
               status);
     }
     else if (datatype == TSHORT)
     {
-      ffpcli(fptr, 2, row, firstelem, nelem, (short *) array, status);
+      ffppri(fptr, group, firstelem, nelem, (short *) array, status);
     }
     else if (datatype == TUINT)
     {
-      ffpcluk(fptr, 2, row, firstelem, nelem, (unsigned int *) array, status);
+      ffppruk(fptr, group, firstelem, nelem, (unsigned int *) array, status);
     }
     else if (datatype == TINT)
     {
-      ffpclk(fptr, 2, row, firstelem, nelem, (int *) array, status);
+      ffpprk(fptr, group, firstelem, nelem, (int *) array, status);
     }
     else if (datatype == TULONG)
     {
-      ffpcluj(fptr, 2, row, firstelem, nelem, (unsigned long *) array, status);
+      ffppruj(fptr, group, firstelem, nelem, (unsigned long *) array, status);
     }
     else if (datatype == TLONG)
     {
-      ffpclj(fptr, 2, row, firstelem, nelem, (long *) array, status);
+      ffpprj(fptr, group, firstelem, nelem, (long *) array, status);
+    }
+    else if (datatype == TLONGLONG)
+    {
+      ffpprjj(fptr, group, firstelem, nelem, (LONGLONG *) array, status);
     }
     else if (datatype == TFLOAT)
     {
-      ffpcle(fptr, 2, row, firstelem, nelem, (float *) array, status);
+      ffppre(fptr, group, firstelem, nelem, (float *) array, status);
     }
     else if (datatype == TDOUBLE)
     {
-      ffpcld(fptr, 2, row, firstelem, nelem, (double *) array, status);
+      ffpprd(fptr, group, firstelem, nelem, (double *) array, status);
     }
     else
       *status = BAD_DATATYPE;
@@ -118,7 +119,7 @@ int ffppxn(  fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     int naxis, ii;
-    long naxes[9], firstelem, row = 1;
+    long naxes[9], firstelem, group = 1;
     OFF_T dimsize = 1;
 
     if (*status > 0)           /* inherit input status value if > 0 */
@@ -148,56 +149,59 @@ int ffppxn(  fitsfile *fptr,  /* I - FITS file pointer                       */
 
     firstelem = USE_LARGE_VALUE; /* special flag value */
 
-    /*
-      the primary array is represented as a binary table:
-      each group of the primary array is a row in the table,
-      where the first column contains the group parameters
-      and the second column contains the image itself.
-    */
-
     if (datatype == TBYTE)
     {
-      ffpcnb(fptr, 2, row, firstelem, nelem, (unsigned char *) array, 
+      ffppnb(fptr, group, firstelem, nelem, (unsigned char *) array, 
              *(unsigned char *) nulval, status);
     }
+    else if (datatype == TSBYTE)
+    {
+      ffppnsb(fptr, group, firstelem, nelem, (signed char *) array, 
+             *(signed char *) nulval, status);
+    }
     else if (datatype == TUSHORT)
     {
-      ffpcnui(fptr, 2, row, firstelem, nelem, (unsigned short *) array,
+      ffppnui(fptr, group, firstelem, nelem, (unsigned short *) array,
               *(unsigned short *) nulval,status);
     }
     else if (datatype == TSHORT)
     {
-      ffpcni(fptr, 2, row, firstelem, nelem, (short *) array,
+      ffppni(fptr, group, firstelem, nelem, (short *) array,
              *(short *) nulval, status);
     }
     else if (datatype == TUINT)
     {
-      ffpcnuk(fptr, 2, row, firstelem, nelem, (unsigned int *) array,
+      ffppnuk(fptr, group, firstelem, nelem, (unsigned int *) array,
              *(unsigned int *) nulval, status);
     }
     else if (datatype == TINT)
     {
-      ffpcnk(fptr, 2, row, firstelem, nelem, (int *) array,
+      ffppnk(fptr, group, firstelem, nelem, (int *) array,
              *(int *) nulval, status);
     }
     else if (datatype == TULONG)
     {
-      ffpcnuj(fptr, 2, row, firstelem, nelem, (unsigned long *) array,
+      ffppnuj(fptr, group, firstelem, nelem, (unsigned long *) array,
               *(unsigned long *) nulval,status);
     }
     else if (datatype == TLONG)
     {
-      ffpcnj(fptr, 2, row, firstelem, nelem, (long *) array,
+      ffppnj(fptr, group, firstelem, nelem, (long *) array,
              *(long *) nulval, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+      ffppnjj(fptr, group, firstelem, nelem, (LONGLONG *) array,
+             *(LONGLONG *) nulval, status);
+    }
     else if (datatype == TFLOAT)
     {
-      ffpcne(fptr, 2, row, firstelem, nelem, (float *) array,
+      ffppne(fptr, group, firstelem, nelem, (float *) array,
              *(float *) nulval, status);
     }
     else if (datatype == TDOUBLE)
     {
-      ffpcnd(fptr, 2, row, firstelem, nelem, (double *) array,
+      ffppnd(fptr, group, firstelem, nelem, (double *) array,
              *(double *) nulval, status);
     }
     else
@@ -219,54 +223,55 @@ int ffppr(  fitsfile *fptr,  /* I - FITS file pointer                       */
   the FITS array is not the same as the array being written).
 */
 {
-    long row = 1;
+    long group = 1;
 
     if (*status > 0)           /* inherit input status value if > 0 */
         return(*status);
 
-    /*
-      the primary array is represented as a binary table:
-      each group of the primary array is a row in the table,
-      where the first column contains the group parameters
-      and the second column contains the image itself.
-    */
-
     if (datatype == TBYTE)
     {
-      ffpclb(fptr, 2, row, firstelem, nelem, (unsigned char *) array, status);
+      ffpprb(fptr, group, firstelem, nelem, (unsigned char *) array, status);
+    }
+    else if (datatype == TSBYTE)
+    {
+      ffpprsb(fptr, group, firstelem, nelem, (signed char *) array, status);
     }
     else if (datatype == TUSHORT)
     {
-      ffpclui(fptr, 2, row, firstelem, nelem, (unsigned short *) array,
+      ffpprui(fptr, group, firstelem, nelem, (unsigned short *) array,
               status);
     }
     else if (datatype == TSHORT)
     {
-      ffpcli(fptr, 2, row, firstelem, nelem, (short *) array, status);
+      ffppri(fptr, group, firstelem, nelem, (short *) array, status);
     }
     else if (datatype == TUINT)
     {
-      ffpcluk(fptr, 2, row, firstelem, nelem, (unsigned int *) array, status);
+      ffppruk(fptr, group, firstelem, nelem, (unsigned int *) array, status);
     }
     else if (datatype == TINT)
     {
-      ffpclk(fptr, 2, row, firstelem, nelem, (int *) array, status);
+      ffpprk(fptr, group, firstelem, nelem, (int *) array, status);
     }
     else if (datatype == TULONG)
     {
-      ffpcluj(fptr, 2, row, firstelem, nelem, (unsigned long *) array, status);
+      ffppruj(fptr, group, firstelem, nelem, (unsigned long *) array, status);
     }
     else if (datatype == TLONG)
     {
-      ffpclj(fptr, 2, row, firstelem, nelem, (long *) array, status);
+      ffpprj(fptr, group, firstelem, nelem, (long *) array, status);
+    }
+    else if (datatype == TLONGLONG)
+    {
+      ffpprjj(fptr, group, firstelem, nelem, (LONGLONG *) array, status);
     }
     else if (datatype == TFLOAT)
     {
-      ffpcle(fptr, 2, row, firstelem, nelem, (float *) array, status);
+      ffppre(fptr, group, firstelem, nelem, (float *) array, status);
     }
     else if (datatype == TDOUBLE)
     {
-      ffpcld(fptr, 2, row, firstelem, nelem, (double *) array, status);
+      ffpprd(fptr, group, firstelem, nelem, (double *) array, status);
     }
     else
       *status = BAD_DATATYPE;
@@ -288,7 +293,7 @@ int ffppn(  fitsfile *fptr,  /* I - FITS file pointer                       */
   the FITS array is not the same as the array being written).
 */
 {
-    long row = 1;
+    long group = 1;
 
     if (*status > 0)           /* inherit input status value if > 0 */
         return(*status);
@@ -299,56 +304,59 @@ int ffppn(  fitsfile *fptr,  /* I - FITS file pointer                       */
         return(*status);
     }
 
-    /*
-      the primary array is represented as a binary table:
-      each group of the primary array is a row in the table,
-      where the first column contains the group parameters
-      and the second column contains the image itself.
-    */
-
     if (datatype == TBYTE)
     {
-      ffpcnb(fptr, 2, row, firstelem, nelem, (unsigned char *) array, 
+      ffppnb(fptr, group, firstelem, nelem, (unsigned char *) array, 
              *(unsigned char *) nulval, status);
     }
+    else if (datatype == TSBYTE)
+    {
+      ffppnsb(fptr, group, firstelem, nelem, (signed char *) array, 
+             *(signed char *) nulval, status);
+    }
     else if (datatype == TUSHORT)
     {
-      ffpcnui(fptr, 2, row, firstelem, nelem, (unsigned short *) array,
+      ffppnui(fptr, group, firstelem, nelem, (unsigned short *) array,
               *(unsigned short *) nulval,status);
     }
     else if (datatype == TSHORT)
     {
-      ffpcni(fptr, 2, row, firstelem, nelem, (short *) array,
+      ffppni(fptr, group, firstelem, nelem, (short *) array,
              *(short *) nulval, status);
     }
     else if (datatype == TUINT)
     {
-      ffpcnuk(fptr, 2, row, firstelem, nelem, (unsigned int *) array,
+      ffppnuk(fptr, group, firstelem, nelem, (unsigned int *) array,
              *(unsigned int *) nulval, status);
     }
     else if (datatype == TINT)
     {
-      ffpcnk(fptr, 2, row, firstelem, nelem, (int *) array,
+      ffppnk(fptr, group, firstelem, nelem, (int *) array,
              *(int *) nulval, status);
     }
     else if (datatype == TULONG)
     {
-      ffpcnuj(fptr, 2, row, firstelem, nelem, (unsigned long *) array,
+      ffppnuj(fptr, group, firstelem, nelem, (unsigned long *) array,
               *(unsigned long *) nulval,status);
     }
     else if (datatype == TLONG)
     {
-      ffpcnj(fptr, 2, row, firstelem, nelem, (long *) array,
+      ffppnj(fptr, group, firstelem, nelem, (long *) array,
              *(long *) nulval, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+      ffppnjj(fptr, group, firstelem, nelem, (LONGLONG *) array,
+             *(LONGLONG *) nulval, status);
+    }
     else if (datatype == TFLOAT)
     {
-      ffpcne(fptr, 2, row, firstelem, nelem, (float *) array,
+      ffppne(fptr, group, firstelem, nelem, (float *) array,
              *(float *) nulval, status);
     }
     else if (datatype == TDOUBLE)
     {
-      ffpcnd(fptr, 2, row, firstelem, nelem, (double *) array,
+      ffppnd(fptr, group, firstelem, nelem, (double *) array,
              *(double *) nulval, status);
     }
     else
@@ -357,6 +365,89 @@ int ffppn(  fitsfile *fptr,  /* I - FITS file pointer                       */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffpss(  fitsfile *fptr,   /* I - FITS file pointer                       */
+            int  datatype,    /* I - datatype of the value                   */
+            long *blc,        /* I - 'bottom left corner' of the subsection  */
+            long *trc ,       /* I - 'top right corner' of the subsection    */
+            void *array,      /* I - array of values that are written        */
+            int  *status)     /* IO - error status                           */
+/*
+  Write a section of values to the primary array. The datatype of the
+  input array is defined by the 2nd argument.  Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being written).
+*/
+{
+    int naxis;
+    long naxes[9];
+
+    if (*status > 0)   /* inherit input status value if > 0 */
+        return(*status);
+
+    /* get the size of the image */
+    ffgidm(fptr, &naxis, status);
+    ffgisz(fptr, 9, naxes, status);
+
+    if (datatype == TBYTE)
+    {
+        ffpssb(fptr, 1, naxis, naxes, blc, trc,
+               (unsigned char *) array, status);
+    }
+    else if (datatype == TSBYTE)
+    {
+        ffpsssb(fptr, 1, naxis, naxes, blc, trc,
+               (signed char *) array, status);
+    }
+    else if (datatype == TUSHORT)
+    {
+        ffpssui(fptr, 1, naxis, naxes, blc, trc,
+               (unsigned short *) array, status);
+    }
+    else if (datatype == TSHORT)
+    {
+        ffpssi(fptr, 1, naxis, naxes, blc, trc,
+               (short *) array, status);
+    }
+    else if (datatype == TUINT)
+    {
+        ffpssuk(fptr, 1, naxis, naxes, blc, trc,
+               (unsigned int *) array, status);
+    }
+    else if (datatype == TINT)
+    {
+        ffpssk(fptr, 1, naxis, naxes, blc, trc,
+               (int *) array, status);
+    }
+    else if (datatype == TULONG)
+    {
+        ffpssuj(fptr, 1, naxis, naxes, blc, trc,
+               (unsigned long *) array, status);
+    }
+    else if (datatype == TLONG)
+    {
+        ffpssj(fptr, 1, naxis, naxes, blc, trc,
+               (long *) array, status);
+    }
+    else if (datatype == TLONGLONG)
+    {
+        ffpssjj(fptr, 1, naxis, naxes, blc, trc,
+               (LONGLONG *) array, status);
+    }    else if (datatype == TFLOAT)
+    {
+        ffpsse(fptr, 1, naxis, naxes, blc, trc,
+               (float *) array, status);
+    }
+    else if (datatype == TDOUBLE)
+    {
+        ffpssd(fptr, 1, naxis, naxes, blc, trc,
+               (double *) array, status);
+    }
+    else
+      *status = BAD_DATATYPE;
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffpcl(  fitsfile *fptr,  /* I - FITS file pointer                       */
             int  datatype,   /* I - datatype of the value                   */
             int  colnum,     /* I - number of column to write (1 = 1st col) */
@@ -385,6 +476,11 @@ int ffpcl(  fitsfile *fptr,  /* I - FITS file pointer                       */
       ffpclb(fptr, colnum, firstrow, firstelem, nelem, (unsigned char *) array,
              status);
     }
+    else if (datatype == TSBYTE)
+    {
+      ffpclsb(fptr, colnum, firstrow, firstelem, nelem, (signed char *) array,
+             status);
+    }
     else if (datatype == TUSHORT)
     {
       ffpclui(fptr, colnum, firstrow, firstelem, nelem, 
@@ -415,6 +511,11 @@ int ffpcl(  fitsfile *fptr,  /* I - FITS file pointer                       */
       ffpclj(fptr, colnum, firstrow, firstelem, nelem, (long *) array,
              status);
     }
+    else if (datatype == TLONGLONG)
+    {
+      ffpcljj(fptr, colnum, firstrow, firstelem, nelem, (LONGLONG *) array,
+             status);
+    }
     else if (datatype == TFLOAT)
     {
       ffpcle(fptr, colnum, firstrow, firstelem, nelem, (float *) array,
@@ -482,6 +583,11 @@ int ffpcn(  fitsfile *fptr,  /* I - FITS file pointer                       */
       ffpcnb(fptr, colnum, firstrow, firstelem, nelem, (unsigned char *) array,
             *(unsigned char *) nulval, status);
     }
+    else if (datatype == TSBYTE)
+    {
+      ffpcnsb(fptr, colnum, firstrow, firstelem, nelem, (signed char *) array,
+            *(signed char *) nulval, status);
+    }
     else if (datatype == TUSHORT)
     {
      ffpcnui(fptr, colnum, firstrow, firstelem, nelem, (unsigned short *) array,
@@ -512,6 +618,11 @@ int ffpcn(  fitsfile *fptr,  /* I - FITS file pointer                       */
       ffpcnj(fptr, colnum, firstrow, firstelem, nelem, (long *) array,
              *(long *) nulval, status);
     }
+    else if (datatype == TLONGLONG)
+    {
+      ffpcnjj(fptr, colnum, firstrow, firstelem, nelem, (LONGLONG *) array,
+             *(LONGLONG *) nulval, status);
+    }
     else if (datatype == TFLOAT)
     {
       ffpcne(fptr, colnum, firstrow, firstelem, nelem, (float *) array,
@@ -522,6 +633,16 @@ int ffpcn(  fitsfile *fptr,  /* I - FITS file pointer                       */
       ffpcnd(fptr, colnum, firstrow, firstelem, nelem, (double *) array,
              *(double *) nulval, status);
     }
+    else if (datatype == TCOMPLEX)
+    {
+      ffpcne(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2,
+             (float *) array, *(float *) nulval, status);
+    }
+    else if (datatype == TDBLCOMPLEX)
+    {
+      ffpcnd(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2,
+             (double *) array, *(double *) nulval, status);
+    }
     else if (datatype == TLOGICAL)
     {
       ffpcnl(fptr, colnum, firstrow, firstelem, nelem, (char *) array,
@@ -738,6 +859,7 @@ int ffiter(int n_cols,
         union {   /*  default null value for the column */
             char   *stringnull;
             unsigned char   charnull;
+            signed char scharnull;
             int    intnull;
             short  shortnull;
             long   longnull;
@@ -751,10 +873,10 @@ int ffiter(int n_cols,
 
     void *dataptr, *defaultnull;
     colNulls *col;
-    int ii, jj, tstatus;
+    int ii, jj, tstatus, naxis, bitpix;
     int typecode, hdutype, jtype, type, anynul, nfiles, nbytes;
     long totaln, nleft, frow, felement, n_optimum, i_optimum, ntodo;
-    long rept, width, tnull;
+    long rept, rowrept, width, tnull, naxes[9] = {1,1,1,1,1,1,1,1,1}, groups;
     double zeros = 0.;
     char message[FLEN_ERRMSG], keyname[FLEN_KEYWORD], nullstr[FLEN_VALUE];
     char **stringptr, *nullptr, *cptr;
@@ -782,15 +904,31 @@ int ffiter(int n_cols,
     {
         /* check that output datatype code value is legal */
         type = cols[jj].datatype;  
-        if (type != 0 &&
-            type != TBYTE  && type != TLOGICAL && type != TSTRING &&
+
+        /* Allow variable length arrays for InputCol and InputOutputCol columns,
+	   but not for OutputCol columns.  Variable length arrays have a
+	   negative type code value. */
+
+        if ((cols[jj].iotype != OutputCol) && (type<0)) {
+            type*=-1;
+        }
+
+        if (type != 0      && type != TBYTE  &&
+            type != TSBYTE && type != TLOGICAL && type != TSTRING &&
             type != TSHORT && type != TINT     && type != TLONG && 
             type != TFLOAT && type != TDOUBLE  && type != TCOMPLEX &&
             type != TULONG && type != TUSHORT  && type != TDBLCOMPLEX)
         {
+	    if (type < 0) {
+	      sprintf(message,
+              "Variable length array not allowed for output column number %d (ffiter)",
+                    jj + 1);
+	    } else {
             sprintf(message,
                    "Illegal datatype for column number %d: %d  (ffiter)",
                     jj + 1, cols[jj].datatype);
+	    }
+	    
             ffpmsg(message);
             return(*status = BAD_DATATYPE);
         }
@@ -813,8 +951,8 @@ int ffiter(int n_cols,
                 return(*status = NOT_IMAGE);
             }
 
-            /* images are stored in column 2; ignore the input value */
-            cols[jj].colnum = 2;
+            /* since this is an image, set a dummy column number = 0 */
+            cols[jj].colnum = 0;
             strcpy(cols[jj].colname, "IMAGE");  /* dummy name for images */
 
             tstatus = 0;
@@ -887,7 +1025,25 @@ int ffiter(int n_cols,
 
     if (hdutype == IMAGE_HDU)   /* get total number of pixels in the image */
     {
-      ffgtcl(cols[0].fptr, cols[0].colnum, NULL, &totaln, &width, status);
+      fits_get_img_dim(cols[0].fptr, &naxis, status);
+      fits_get_img_size(cols[0].fptr, 9, naxes, status);
+
+      tstatus = 0;
+      ffgkyj(cols[0].fptr, "GROUPS", &groups, NULL, &tstatus);
+      if (!tstatus && groups && (naxis > 1) && (naxes[0] == 0) )
+      {
+         /* this is a random groups file, with NAXIS1 = 0 */
+         /* Use GCOUNT, the number of groups, as the first multiplier  */
+         /* to calculate the total number of pixels in all the groups. */
+         ffgkyj(cols[0].fptr, "GCOUNT", &totaln, NULL, status);
+
+      }  else {
+         totaln = naxes[0];
+      }
+
+      for (ii = 1; ii < naxis; ii++)
+          totaln *= naxes[ii];
+
       frow = 1;
       felement = 1 + offset;
     }
@@ -932,6 +1088,7 @@ int ffiter(int n_cols,
         }
 
         n_optimum = n_optimum / nfiles;
+        n_optimum = maxvalue(n_optimum, 1);
     }
     else if (n_per_loop < 0)  /* must pass all the values at one time */
     {
@@ -949,14 +1106,59 @@ int ffiter(int n_cols,
 
     for (jj = 0; jj < n_cols; jj++)
     {
-        /* get column datatype and vector length */
-        if (ffgtcl(cols[jj].fptr, cols[jj].colnum, &typecode, &rept,
+        /* get image or column datatype and vector length */
+        if (hdutype == IMAGE_HDU)   /* get total number of pixels in the image */
+        {
+           fits_get_img_type(cols[jj].fptr, &bitpix, status);
+           switch(bitpix) {
+             case BYTE_IMG:
+                 typecode = TBYTE;
+                 break;
+             case SHORT_IMG:
+                 typecode = TSHORT;
+                 break;
+             case LONG_IMG:
+                 typecode = TLONG;
+                 break;
+             case FLOAT_IMG:
+                 typecode = TFLOAT;
+                 break;
+             case DOUBLE_IMG:
+                 typecode = TDOUBLE;
+                 break;
+            }
+        }
+        else
+        {
+            if (ffgtcl(cols[jj].fptr, cols[jj].colnum, &typecode, &rept,
                   &width, status) > 0)
-            goto cleanup;
+                goto cleanup;
+		
+	    if (typecode < 0) {  /* if any variable length arrays, then the */ 
+	        n_optimum = 1;   /* must process the table 1 row at a time */
+		
+              /* Allow variable length arrays for InputCol and InputOutputCol columns,
+	       but not for OutputCol columns.  Variable length arrays have a
+	       negative type code value. */
+
+              if (cols[jj].iotype == OutputCol) {
+ 	        sprintf(message,
+                "Variable length array not allowed for output column number %d (ffiter)",
+                    jj + 1);
+                ffpmsg(message);
+                return(*status = BAD_DATATYPE);
+              }
+	   }
+        }
 
         /* special case where sizeof(long) = 8: use TINT instead of TLONG */
-        if (typecode == TLONG && sizeof(long) == 8 && sizeof(int) == 4)
-            typecode = TINT;
+        if (abs(typecode) == TLONG && sizeof(long) == 8 && sizeof(int) == 4) {
+		if(typecode<0) {
+			typecode = -TINT;
+		} else {
+			typecode = TINT;
+		}
+        }
 
         /* Special case: interprete 'X' column as 'B' */
         if (abs(typecode) == TBIT)
@@ -968,10 +1170,10 @@ int ffiter(int n_cols,
         if (cols[jj].datatype == 0)    /* output datatype not specified? */
         {
             /* special case if sizeof(long) = 8: use TINT instead of TLONG */
-            if (typecode == TLONG && sizeof(long) == 8 && sizeof(int) == 4)
+            if (abs(typecode) == TLONG && sizeof(long) == 8 && sizeof(int) == 4)
                 cols[jj].datatype = TINT;
             else
-                cols[jj].datatype = typecode;
+                cols[jj].datatype = abs(typecode);
         }
 
         /* calc total number of elements to do on each iteration */
@@ -981,7 +1183,7 @@ int ffiter(int n_cols,
             cols[jj].repeat = 1;
 
             /* get the BLANK keyword value, if it exists */
-            if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+            if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
             {
                 tstatus = 0;
                 ffgkyj(cols[jj].fptr, "BLANK", &tnull, 0, &tstatus);
@@ -993,11 +1195,23 @@ int ffiter(int n_cols,
         }
         else
         {
+	    if (typecode < 0) 
+	    {
+              /* get max size of the variable length vector; dont't trust the value
+	         given by the TFORM keyword  */
+	      rept = 1;
+	      for (ii = 0; ii < totaln; ii++) {
+		ffgdes(cols[jj].fptr, cols[jj].colnum, frow + ii, &rowrept, NULL, status);
+		
+		rept = maxvalue(rept, rowrept);
+	      }
+            }
+	    
             ntodo = n_optimum * rept;   /* vector columns */
             cols[jj].repeat = rept;
 
             /* get the TNULL keyword value, if it exists */
-            if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+            if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
             {
                 tstatus = 0;
                 if (hdutype == ASCII_TBL) /* TNULLn value is a string */
@@ -1057,7 +1271,7 @@ int ffiter(int n_cols,
           cols[jj].array = calloc(ntodo + 1, sizeof(char));
           col[jj].nullsize  = sizeof(char);  /* number of bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               tnull = minvalue(tnull, 255);
               tnull = maxvalue(tnull, 0);
@@ -1069,11 +1283,27 @@ int ffiter(int n_cols,
           }
           break;
 
+         case TSBYTE:
+          cols[jj].array = calloc(ntodo + 1, sizeof(char));
+          col[jj].nullsize  = sizeof(char);  /* number of bytes per value */
+
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
+          {
+              tnull = minvalue(tnull, 127);
+              tnull = maxvalue(tnull, -128);
+              col[jj].null.scharnull = (signed char) tnull;
+          }
+          else
+          {
+              col[jj].null.scharnull = (signed char) -128; /* use -128  null */
+          }
+          break;
+
          case TSHORT:
           cols[jj].array = calloc(ntodo + 1, sizeof(short));
           col[jj].nullsize  = sizeof(short);  /* number of bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               tnull = minvalue(tnull, SHRT_MAX);
               tnull = maxvalue(tnull, SHRT_MIN);
@@ -1089,7 +1319,7 @@ int ffiter(int n_cols,
           cols[jj].array = calloc(ntodo + 1, sizeof(unsigned short));
           col[jj].nullsize  = sizeof(unsigned short);  /* bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               tnull = minvalue(tnull, USHRT_MAX);
               tnull = maxvalue(tnull, 0);  /* don't allow negative value */
@@ -1102,10 +1332,10 @@ int ffiter(int n_cols,
           break;
 
          case TINT:
-          cols[jj].array = calloc(ntodo + 1, sizeof(int));
+          cols[jj].array = calloc(sizeof(int), ntodo + 1);
           col[jj].nullsize  = sizeof(int);  /* number of bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               tnull = minvalue(tnull, INT_MAX);
               tnull = maxvalue(tnull, INT_MIN);
@@ -1121,7 +1351,7 @@ int ffiter(int n_cols,
           cols[jj].array = calloc(ntodo + 1, sizeof(unsigned int));
           col[jj].nullsize  = sizeof(unsigned int);  /* bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               tnull = minvalue(tnull, INT32_MAX);
               tnull = maxvalue(tnull, 0);
@@ -1137,7 +1367,7 @@ int ffiter(int n_cols,
           cols[jj].array = calloc(ntodo + 1, sizeof(long));
           col[jj].nullsize  = sizeof(long);  /* number of bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               col[jj].null.longnull = tnull;
           }
@@ -1151,7 +1381,7 @@ int ffiter(int n_cols,
           cols[jj].array = calloc(ntodo + 1, sizeof(unsigned long));
           col[jj].nullsize  = sizeof(unsigned long);  /* bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               if (tnull < 0)  /* can't use a negative null value */
                   col[jj].null.ulongnull = LONG_MAX;
@@ -1168,7 +1398,7 @@ int ffiter(int n_cols,
           cols[jj].array = calloc(ntodo + 1, sizeof(float));
           col[jj].nullsize  = sizeof(float);  /* number of bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               col[jj].null.floatnull = (float) tnull;
           }
@@ -1188,7 +1418,7 @@ int ffiter(int n_cols,
           cols[jj].array = calloc(ntodo + 1, sizeof(double));
           col[jj].nullsize  = sizeof(double);  /* number of bytes per value */
 
-          if (typecode == TBYTE || typecode == TSHORT || typecode == TLONG)
+          if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecode) == TLONG)
           {
               col[jj].null.doublenull = (double) tnull;
           }
@@ -1270,7 +1500,7 @@ int ffiter(int n_cols,
             goto cleanup;
         }
     }
- 
+
     /*--------------------------------------------------*/
     /* main loop while there are values left to process */
     /*--------------------------------------------------*/
@@ -1297,11 +1527,33 @@ int ffiter(int n_cols,
             dataptr = (char *) cols[jj].array + col[jj].nullsize;
             defaultnull = &col[jj].null.charnull; /* ptr to the null value */
           }
-          if (ffgcv(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum,
-                    frow, felement, cols[jj].repeat * ntodo, defaultnull,
+
+          if (hdutype == IMAGE_HDU)   
+          {
+              if (ffgpv(cols[jj].fptr, cols[jj].datatype,
+                    felement, cols[jj].repeat * ntodo, defaultnull,
                     dataptr,  &anynul, status) > 0)
+              {
+                 break;
+              }
+          }
+          else
           {
-            break;
+	      if (ffgtcl(cols[jj].fptr, cols[jj].colnum, &typecode, &rept,&width, status) > 0)
+	          goto cleanup;
+		  
+	      if (typecode<0)
+	      {
+	        /* get size of the variable length vector */
+		ffgdes(cols[jj].fptr, cols[jj].colnum, frow,&cols[jj].repeat, NULL,status);
+	      }
+		
+              if (ffgcv(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum,
+                    frow, felement, cols[jj].repeat * ntodo, defaultnull,
+                    dataptr,  &anynul, status) > 0)
+              {
+                 break;
+              }
           }
 
           /* copy the appropriate null value into first array element */
@@ -1371,18 +1623,54 @@ int ffiter(int n_cols,
           if (memcmp(nullptr, &zeros, nbytes) ) 
           {
             /* null value flag not zero; must check for and write nulls */
-            if (ffpcn(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum, frow,
+            if (hdutype == IMAGE_HDU)   
+            {
+                if (ffppn(cols[jj].fptr, cols[jj].datatype, 
+                      felement, cols[jj].repeat * ntodo, dataptr,
+                      nullptr, &tstatus) > 0)
+                break;
+            }
+            else
+            {
+	    	if (ffgtcl(cols[jj].fptr, cols[jj].colnum, &typecode, &rept,&width, status) > 0)
+		    goto cleanup;
+		    
+		if (typecode<0)  /* variable length array colum */
+		{
+		   ffgdes(cols[jj].fptr, cols[jj].colnum, frow,&cols[jj].repeat, NULL,status);
+		}
+
+                if (ffpcn(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum, frow,
                       felement, cols[jj].repeat * ntodo, dataptr,
                       nullptr, &tstatus) > 0)
-              break;
+                break;
+            }
           }
           else
           { 
             /* no null values; just write the array */
-            if (ffpcl(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum, frow,
+            if (hdutype == IMAGE_HDU)   
+            {
+                if (ffppr(cols[jj].fptr, cols[jj].datatype,
+                      felement, cols[jj].repeat * ntodo, dataptr,
+                      &tstatus) > 0)
+                break;
+            }
+            else
+            {
+	    	if (ffgtcl(cols[jj].fptr, cols[jj].colnum, &typecode, &rept,&width, status) > 0)
+		    goto cleanup;
+		    
+		if (typecode<0)  /* variable length array column */
+		{
+		   ffgdes(cols[jj].fptr, cols[jj].colnum, frow,&cols[jj].repeat, NULL,status);
+		}
+
+                 if (ffpcl(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum, frow,
                       felement, cols[jj].repeat * ntodo, dataptr,
                       &tstatus) > 0)
-              break;
+                break;
+            }
           }
         }
       }
diff --git a/putcolb.c b/putcolb.c
index 55348ac..8f926b2 100644
--- a/putcolb.c
+++ b/putcolb.c
@@ -27,6 +27,7 @@ int ffpprb( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    unsigned char nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffpprb( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TBYTE, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppnb( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    unsigned char nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppnb( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TBYTE, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -125,21 +136,25 @@ int ffp3db(fitsfile *fptr,   /* I - FITS file pointer                     */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
       where the first column contains the group parameters
       and the second column contains the image itself.
     */
-
+           
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TBYTE, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -207,9 +222,10 @@ int ffpssb(fitsfile *fptr,   /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TBYTE, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -436,6 +452,13 @@ int ffpclb( fitsfile *fptr,  /* I - FITS file pointer                       */
 
               break;
 
+            case (TLONGLONG):
+
+                ffi1fi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
             case (TSHORT):
  
                 ffi1fi2(&array[next], ntodo, scale, zero,
@@ -647,7 +670,7 @@ int ffpcnb( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpclb(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
@@ -795,6 +818,124 @@ int ffi1fi4(unsigned char *input,  /* I - array of values to be converted  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffi1fi8(unsigned char *input, /* I - array of values to be converted  */
+            long ntodo,           /* I - number of elements in the array  */
+            double scale,         /* I - FITS TSCALn or BSCALE value      */
+            double zero,          /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,     /* O - output array of converted values */
+            int *status)          /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+                output[jj] = 0;
+                output[kk] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffi1fr4(unsigned char *input,  /* I - array of values to be converted  */
             long ntodo,            /* I - number of elements in the array  */
             double scale,          /* I - FITS TSCALn or BSCALE value      */
diff --git a/putcold.c b/putcold.c
index 9553fa7..6073029 100644
--- a/putcold.c
+++ b/putcold.c
@@ -27,6 +27,7 @@ int ffpprd( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    double nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffpprd( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TDOUBLE, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppnd( fitsfile *fptr,   /* I - FITS file pointer                       */
 */
 {
     long row;
+    double nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppnd( fitsfile *fptr,   /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TDOUBLE, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -125,7 +136,7 @@ int ffp3dd(fitsfile *fptr,   /* I - FITS file pointer                     */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
@@ -136,10 +147,14 @@ int ffp3dd(fitsfile *fptr,   /* I - FITS file pointer                     */
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
 
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TDOUBLE, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -207,9 +222,10 @@ int ffpssd(fitsfile *fptr,   /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TDOUBLE, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -438,6 +454,13 @@ int ffpcld( fitsfile *fptr,  /* I - FITS file pointer                       */
 
               break;
 
+            case (TLONGLONG):
+
+                ffr8fi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
             case (TBYTE):
  
                 ffr8fi1(&array[next], ntodo, scale, zero, 
@@ -589,6 +612,7 @@ int ffpcnd( fitsfile *fptr,  /* I - FITS file pointer                       */
     tcolumn *colptr;
     long  ngood = 0, nbad = 0, ii, fstrow;
     OFF_T large_elem, repeat, first, fstelm;
+    int tcode;
 
     if (*status > 0)
         return(*status);
@@ -608,6 +632,12 @@ int ffpcnd( fitsfile *fptr,  /* I - FITS file pointer                       */
     colptr += (colnum - 1);     /* offset to correct column structure */
 
     repeat = colptr->trepeat;  /* repeat count for this column */
+    fits_get_coltype(fptr, colnum, &tcode, NULL, NULL, status);
+
+    if (tcode >= TCOMPLEX)
+    { /* treat complex columns as pairs of numbers */
+        repeat *= 2;
+    }
 
     if (firstelem == USE_LARGE_VALUE)
         large_elem = large_first_elem_val;
@@ -631,7 +661,9 @@ int ffpcnd( fitsfile *fptr,  /* I - FITS file pointer                       */
             fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
             large_first_elem_val = fstelm;
 
-            if (ffpclu(fptr, colnum, fstrow, firstelem, nbad, status) > 0)
+            /* call ffpcluc, not ffpclu, in case we are writing to a
+	       complex ('C') binary table column */
+            if (ffpcluc(fptr, colnum, fstrow, firstelem, nbad, status) > 0)
                 return(*status);
 
             nbad=0;
@@ -670,14 +702,13 @@ int ffpcnd( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpcld(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
       fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
       large_first_elem_val = fstelm;
-
-      ffpclu(fptr, colnum, fstrow, firstelem, nbad, status);
+      ffpcluc(fptr, colnum, fstrow, firstelem, nbad, status);
     }
 
     return(*status);
@@ -802,7 +833,7 @@ int ffr8fi4(double *input,     /* I - array of values to be converted  */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
             double zero,       /* I - FITS TZEROn or BZERO  value      */
-            INT32BIT *output,      /* O - output array of converted values */
+            INT32BIT *output,  /* O - output array of converted values */
             int *status)       /* IO - error status                    */
 /*
   Copy input to output prior to writing output to a FITS file.
@@ -858,6 +889,163 @@ int ffr8fi4(double *input,     /* I - array of values to be converted  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffr8fi8(double *input,     /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,      /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required.
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            if (input[ii] < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (input[ii] > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (input[ii] < 0)
+                {
+                   temp = (input[ii] + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (input[ii] - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = input[ii] / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = input[ii] - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            if (input[ii] < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (input[ii] > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+                output[ii] = (LONGLONG) input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffr8fr4(double *input,     /* I - array of values to be converted  */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
diff --git a/putcole.c b/putcole.c
index 1e6e55b..5bcdac2 100644
--- a/putcole.c
+++ b/putcole.c
@@ -27,6 +27,7 @@ int ffppre( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    float nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffppre( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TFLOAT, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppne( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    float nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppne( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TFLOAT, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -125,21 +136,25 @@ int ffp3de(fitsfile *fptr,   /* I - FITS file pointer                     */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
       where the first column contains the group parameters
       and the second column contains the image itself.
     */
-
+           
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TFLOAT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -207,9 +222,10 @@ int ffpsse(fitsfile *fptr,   /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TFLOAT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -439,6 +455,13 @@ int ffpcle( fitsfile *fptr,  /* I - FITS file pointer                       */
 
               break;
 
+            case (TLONGLONG):
+
+                ffr4fi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
             case (TBYTE):
  
                 ffr4fi1(&array[next], ntodo, scale, zero, 
@@ -590,6 +613,7 @@ int ffpcne( fitsfile *fptr,  /* I - FITS file pointer                       */
     tcolumn *colptr;
     long  ngood = 0, nbad = 0, ii, fstrow;
     OFF_T large_elem, repeat, first, fstelm;
+    int tcode;
 
     if (*status > 0)
         return(*status);
@@ -609,7 +633,13 @@ int ffpcne( fitsfile *fptr,  /* I - FITS file pointer                       */
     colptr += (colnum - 1);     /* offset to correct column structure */
 
     repeat = colptr->trepeat;  /* repeat count for this column */
+    fits_get_coltype(fptr, colnum, &tcode, NULL, NULL, status);
 
+    if (tcode >= TCOMPLEX)
+    { /* treat complex columns as pairs of numbers */
+        repeat *= 2;
+    }
+    
     if (firstelem == USE_LARGE_VALUE)
         large_elem = large_first_elem_val;
     else
@@ -632,7 +662,9 @@ int ffpcne( fitsfile *fptr,  /* I - FITS file pointer                       */
             fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
             large_first_elem_val = fstelm;
 
-            if (ffpclu(fptr, colnum, fstrow, firstelem, nbad, status) > 0)
+            /* call ffpcluc, not ffpclu, in case we are writing to a
+	       complex ('C') binary table column */
+            if (ffpcluc(fptr, colnum, fstrow, firstelem, nbad, status) > 0)
                 return(*status);
 
             nbad=0;
@@ -671,14 +703,13 @@ int ffpcne( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpcle(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
       fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
       large_first_elem_val = fstelm;
-
-      ffpclu(fptr, colnum, fstrow, firstelem, nbad, status);
+      ffpcluc(fptr, colnum, fstrow, firstelem, nbad, status);
     }
 
     return(*status);
@@ -859,6 +890,163 @@ int ffr4fi4(float *input,      /* I - array of values to be converted  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffr4fi8(float *input,      /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,  /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required.
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            if (input[ii] < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (input[ii] > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+               if (input[ii] < 0)
+                {
+                   temp = (input[ii] + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (input[ii] - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = input[ii] / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = input[ii] - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+               if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            if (input[ii] < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (input[ii] > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+                output[ii] = (long) input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DINT_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffr4fr4(float *input,      /* I - array of values to be converted  */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
diff --git a/putcoli.c b/putcoli.c
index 349c817..a413f95 100644
--- a/putcoli.c
+++ b/putcoli.c
@@ -27,6 +27,7 @@ int ffppri( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    short nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffppri( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TSHORT, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppni( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    short nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppni( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TSHORT, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -125,21 +136,25 @@ int ffp3di(fitsfile *fptr,   /* I - FITS file pointer                     */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
       where the first column contains the group parameters
       and the second column contains the image itself.
     */
-
+           
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TSHORT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -207,9 +222,10 @@ int ffpssi(fitsfile *fptr,   /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        fits_write_compressed_img(fptr, TSHORT, fpixel, lpixel,
+            0,  array, NULL, status);
 
-        return(*status = DATA_COMPRESSION_ERR);
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -438,8 +454,15 @@ int ffpcli( fitsfile *fptr,  /* I - FITS file pointer                       */
 
               break;
 
-            case (TBYTE):
- 
+            case (TLONGLONG):
+
+                ffi2fi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
+             case (TBYTE):
+
                 ffi2fi1(&array[next], ntodo, scale, zero,
                         (unsigned char *) buffer, status);
                 ffpi1b(fptr, ntodo, incre, (unsigned char *) buffer, status);
@@ -638,7 +661,7 @@ int ffpcni( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpcli(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
@@ -799,6 +822,128 @@ int ffi2fi4(short *input,      /* I - array of values to be converted  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffi2fi8(short *input,      /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,  /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+                if (input[ii] < 0)
+                   output[jj] = -1;
+                else
+                   output[jj] = 0;
+         
+                output[kk] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffi2fr4(short *input,      /* I - array of values to be converted  */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
diff --git a/putcolj.c b/putcolj.c
index 0e78c91..8cfee07 100644
--- a/putcolj.c
+++ b/putcolj.c
@@ -27,6 +27,7 @@ int ffpprj( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    long nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffpprj( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TLONG, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppnj( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    long nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppnj( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TLONG, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -126,21 +137,25 @@ int ffp3dj(fitsfile *fptr,   /* I - FITS file pointer                     */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
       where the first column contains the group parameters
       and the second column contains the image itself.
     */
-
+           
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TLONG, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -208,9 +223,10 @@ int ffpssj(fitsfile *fptr,   /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TLONG, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -439,6 +455,13 @@ int ffpclj( fitsfile *fptr,  /* I - FITS file pointer                       */
 
               break;
 
+            case (TLONGLONG):
+
+                fflongfi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
             case (TBYTE):
  
                 ffi4fi1(&array[next], ntodo, scale, zero,
@@ -638,7 +661,7 @@ int ffpcnj( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpclj(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
@@ -813,6 +836,128 @@ int ffi4fi4(long *input,       /* I - array of values to be converted  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int fflongfi8(long *input,       /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,      /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+                if (input[ii] < 0)
+                   output[jj] = -1;
+                else
+                   output[jj] = 0;
+         
+                output[kk] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffi4fr4(long *input,       /* I - array of values to be converted  */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
@@ -906,3 +1051,968 @@ int ffi4fstr(long *input,      /* I - array of values to be converted  */
     }
     return(*status);
 }
+
+/* ======================================================================== */
+/*      the following routines support the 'long long' data type            */
+/* ======================================================================== */
+
+/*--------------------------------------------------------------------------*/
+int ffpprjj(fitsfile *fptr,  /* I - FITS file pointer                       */
+            long  group,     /* I - group to write(1 = 1st group)           */
+            long  firstelem, /* I - first vector element to write(1 = 1st)  */
+            long  nelem,     /* I - number of values to write               */
+            LONGLONG  *array, /* I - array of values that are written       */
+            int  *status)    /* IO - error status                           */
+/*
+  Write an array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being written).
+*/
+{
+    long row;
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        ffpmsg("writing to compressed image is not supported");
+
+        return(*status = DATA_COMPRESSION_ERR);
+    }
+
+    row=maxvalue(1,group);
+
+    ffpcljj(fptr, 2, row, firstelem, nelem, array, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffppnjj(fitsfile *fptr,  /* I - FITS file pointer                       */
+            long  group,     /* I - group to write(1 = 1st group)           */
+            long  firstelem, /* I - first vector element to write(1 = 1st)  */
+            long  nelem,     /* I - number of values to write               */
+            LONGLONG  *array, /* I - array of values that are written       */
+            long  nulval,    /* I - undefined pixel value                   */
+            int  *status)    /* IO - error status                           */
+/*
+  Write an array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being written).  Any array values
+  that are equal to the value of nulval will be replaced with the null
+  pixel value that is appropriate for this column.
+*/
+{
+    long row;
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        ffpmsg("writing to compressed image is not supported");
+
+        return(*status = DATA_COMPRESSION_ERR);
+    }
+
+    row=maxvalue(1,group);
+
+    ffpcnjj(fptr, 2, row, firstelem, nelem, array, nulval, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffp2djj(fitsfile *fptr,  /* I - FITS file pointer                     */
+           long  group,      /* I - group to write(1 = 1st group)         */
+           long  ncols,      /* I - number of pixels in each row of array */
+           long  naxis1,     /* I - FITS image NAXIS1 value               */
+           long  naxis2,     /* I - FITS image NAXIS2 value               */
+           LONGLONG  *array, /* I - array to be written                   */
+           int  *status)     /* IO - error status                         */
+/*
+  Write an entire 2-D array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being written).
+*/
+{
+
+    /* call the 3D writing routine, with the 3rd dimension = 1 */
+
+    ffp3djj(fptr, group, ncols, naxis2, naxis1, naxis2, 1, array, status);
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffp3djj(fitsfile *fptr,  /* I - FITS file pointer                     */
+           long  group,      /* I - group to write(1 = 1st group)         */
+           long  ncols,      /* I - number of pixels in each row of array */
+           long  nrows,      /* I - number of rows in each plane of array */
+           long  naxis1,     /* I - FITS image NAXIS1 value               */
+           long  naxis2,     /* I - FITS image NAXIS2 value               */
+           long  naxis3,     /* I - FITS image NAXIS3 value               */
+           LONGLONG  *array, /* I - array to be written                   */
+           int  *status)     /* IO - error status                         */
+/*
+  Write an entire 3-D cube of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being written).
+*/
+{
+    long tablerow, nfits, narray, ii, jj;
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        ffpmsg("writing to compressed image is not supported");
+
+        return(*status = DATA_COMPRESSION_ERR);
+    }
+
+    tablerow=maxvalue(1,group);
+
+    if (ncols == naxis1 && nrows == naxis2)  /* arrays have same size? */
+    {
+      /* all the image pixels are contiguous, so write all at once */
+      ffpcljj(fptr, 2, tablerow, 1L, naxis1 * naxis2 * naxis3, array, status);
+      return(*status);
+    }
+
+    if (ncols < naxis1 || nrows < naxis2)
+       return(*status = BAD_DIMEN);
+
+    nfits = 1;   /* next pixel in FITS image to write to */
+    narray = 0;  /* next pixel in input array to be written */
+
+    /* loop over naxis3 planes in the data cube */
+    for (jj = 0; jj < naxis3; jj++)
+    {
+      /* loop over the naxis2 rows in the FITS image, */
+      /* writing naxis1 pixels to each row            */
+
+      for (ii = 0; ii < naxis2; ii++)
+      {
+       if (ffpcljj(fptr, 2, tablerow, nfits, naxis1,&array[narray],status) > 0)
+         return(*status);
+
+       nfits += naxis1;
+       narray += ncols;
+      }
+      narray += (nrows - naxis2) * ncols;
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpssjj(fitsfile *fptr,  /* I - FITS file pointer                       */
+           long  group,      /* I - group to write(1 = 1st group)           */
+           long  naxis,      /* I - number of data axes in array            */
+           long  *naxes,     /* I - size of each FITS axis                  */
+           long  *fpixel,    /* I - 1st pixel in each axis to write (1=1st) */
+           long  *lpixel,    /* I - last pixel in each axis to write        */
+           LONGLONG *array,  /* I - array to be written                     */
+           int  *status)     /* IO - error status                           */
+/*
+  Write a subsection of pixels to the primary array or image.
+  A subsection is defined to be any contiguous rectangular
+  array of pixels within the n-dimensional FITS data file.
+  Data conversion and scaling will be performed if necessary 
+  (e.g, if the datatype of the FITS array is not the same as
+  the array being written).
+*/
+{
+    long tablerow;
+    long fpix[7], irange[7], dimen[7], astart, pstart;
+    long off2, off3, off4, off5, off6, off7;
+    long st10, st20, st30, st40, st50, st60, st70;
+    long st1, st2, st3, st4, st5, st6, st7;
+    long ii, i1, i2, i3, i4, i5, i6, i7;
+
+    if (*status > 0)
+        return(*status);
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        ffpmsg("writing to compressed image is not supported");
+
+        return(*status = DATA_COMPRESSION_ERR);
+    }
+
+    if (naxis < 1 || naxis > 7)
+      return(*status = BAD_DIMEN);
+
+    tablerow=maxvalue(1,group);
+
+     /* calculate the size and number of loops to perform in each dimension */
+    for (ii = 0; ii < 7; ii++)
+    {
+      fpix[ii]=1;
+      irange[ii]=1;
+      dimen[ii]=1;
+    }
+
+    for (ii = 0; ii < naxis; ii++)
+    {    
+      fpix[ii]=fpixel[ii];
+      irange[ii]=lpixel[ii]-fpixel[ii]+1;
+      dimen[ii]=naxes[ii];
+    }
+
+    i1=irange[0];
+
+    /* compute the pixel offset between each dimension */
+    off2 =     dimen[0];
+    off3 = off2 * dimen[1];
+    off4 = off3 * dimen[2];
+    off5 = off4 * dimen[3];
+    off6 = off5 * dimen[4];
+    off7 = off6 * dimen[5];
+
+    st10 = fpix[0];
+    st20 = (fpix[1] - 1) * off2;
+    st30 = (fpix[2] - 1) * off3;
+    st40 = (fpix[3] - 1) * off4;
+    st50 = (fpix[4] - 1) * off5;
+    st60 = (fpix[5] - 1) * off6;
+    st70 = (fpix[6] - 1) * off7;
+
+    /* store the initial offset in each dimension */
+    st1 = st10;
+    st2 = st20;
+    st3 = st30;
+    st4 = st40;
+    st5 = st50;
+    st6 = st60;
+    st7 = st70;
+
+    astart = 0;
+
+    for (i7 = 0; i7 < irange[6]; i7++)
+    {
+     for (i6 = 0; i6 < irange[5]; i6++)
+     {
+      for (i5 = 0; i5 < irange[4]; i5++)
+      {
+       for (i4 = 0; i4 < irange[3]; i4++)
+       {
+        for (i3 = 0; i3 < irange[2]; i3++)
+        {
+         pstart = st1 + st2 + st3 + st4 + st5 + st6 + st7;
+         for (i2 = 0; i2 < irange[1]; i2++)
+         {
+           if (ffpcljj(fptr, 2, tablerow, pstart, i1, &array[astart],
+              status) > 0)
+              return(*status);
+
+           astart += i1;
+           pstart += off2;
+         }
+         st2 = st20;
+         st3 = st3+off3;    
+        }
+        st3 = st30;
+        st4 = st4+off4;
+       }
+       st4 = st40;
+       st5 = st5+off5;
+      }
+      st5 = st50;
+      st6 = st6+off6;
+     }
+     st6 = st60;
+     st7 = st7+off7;
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpgpjj(fitsfile *fptr,   /* I - FITS file pointer                      */
+            long  group,      /* I - group to write(1 = 1st group)          */
+            long  firstelem,  /* I - first vector element to write(1 = 1st) */
+            long  nelem,      /* I - number of values to write              */
+            LONGLONG  *array, /* I - array of values that are written       */
+            int  *status)     /* IO - error status                          */
+/*
+  Write an array of group parameters to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being written).
+*/
+{
+    long row;
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    row=maxvalue(1,group);
+
+    ffpcljj(fptr, 1L, row, firstelem, nelem, array, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpcljj(fitsfile *fptr,  /* I - FITS file pointer                       */
+            int  colnum,     /* I - number of column to write (1 = 1st col) */
+            long  firstrow,  /* I - first row to write (1 = 1st row)        */
+            long  firstelem, /* I - first vector element to write (1 = 1st) */
+            long  nelem,     /* I - number of values to write               */
+            LONGLONG  *array, /* I - array of values to write               */
+            int  *status)    /* IO - error status                           */
+/*
+  Write an array of values to a column in the current FITS HDU.
+  The column number may refer to a real column in an ASCII or binary table, 
+  or it may refer to a virtual column in a 1 or more grouped FITS primary
+  array.  FITSIO treats a primary array as a binary table
+  with 2 vector columns: the first column contains the group parameters (often
+  with length = 0) and the second column contains the array of image pixels.
+  Each row of the table represents a group in the case of multigroup FITS
+  images.
+
+  The input array of values will be converted to the datatype of the column 
+  and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary.
+*/
+{
+    int tcode, maxelem, hdutype, writeraw;
+    long twidth, incre, rownum, remain, next, ntodo;
+    long tnull;
+    OFF_T repeat, startpos, elemnum, large_elem, wrtptr, rowlen;
+    double scale, zero;
+    char tform[20], cform[20];
+    char message[FLEN_ERRMSG];
+
+    char snull[20];   /*  the FITS null value  */
+
+    double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */
+    void *buffer;
+
+    if (*status > 0)           /* inherit input status value if > 0 */
+        return(*status);
+
+    buffer = cbuff;
+
+    if (firstelem == USE_LARGE_VALUE)
+        large_elem = large_first_elem_val;
+    else
+        large_elem = firstelem;
+
+    /*---------------------------------------------------*/
+    /*  Check input and get parameters about the column: */
+    /*---------------------------------------------------*/
+    if (ffgcpr( fptr, colnum, firstrow, large_elem, nelem, 1, &scale, &zero,
+        tform, &twidth, &tcode, &maxelem, &startpos,  &elemnum, &incre,
+        &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0)
+        return(*status);
+
+    if (tcode == TSTRING)   
+         ffcfmt(tform, cform);     /* derive C format for writing strings */
+
+    /*
+       if there is no scaling and the native machine format is not byteswapped
+       then we can simply write the raw data bytes into the FITS file if the
+       datatype of the FITS column is the same as the input values.  Otherwise
+       we must convert the raw values into the scaled and/or machine dependent
+       format in a temporary buffer that has been allocated for this purpose.
+    */
+    if (scale == 1. && zero == 0. && 
+       MACHINE == NATIVE && tcode == TLONGLONG)
+    {
+        writeraw = 1;
+        maxelem = nelem;  /* we can write the entire array at one time */
+    }
+    else
+        writeraw = 0;
+
+    /*---------------------------------------------------------------------*/
+    /*  Now write the pixels to the FITS column.                           */
+    /*  First call the ffXXfYY routine to  (1) convert the datatype        */
+    /*  if necessary, and (2) scale the values by the FITS TSCALn and      */
+    /*  TZEROn linear scaling parameters into a temporary buffer.          */
+    /*---------------------------------------------------------------------*/
+    remain = nelem;           /* remaining number of values to write  */
+    next = 0;                 /* next element in array to be written  */
+    rownum = 0;               /* row number, relative to firstrow     */
+
+    while (remain)
+    {
+        /* limit the number of pixels to process a one time to the number that
+           will fit in the buffer space or to the number of pixels that remain
+           in the current vector, which ever is smaller.
+        */
+        ntodo = minvalue(remain, maxelem);      
+        ntodo = minvalue(ntodo, (repeat - elemnum));
+
+        wrtptr = startpos + ((OFF_T)rownum * rowlen) + (elemnum * incre);
+
+        ffmbyt(fptr, wrtptr, IGNORE_EOF, status); /* move to write position */
+
+        switch (tcode) 
+        {
+            case (TLONGLONG):
+              if (writeraw)
+              {
+                /* write raw input bytes without conversion */
+                ffpi8b(fptr, ntodo, incre, (long *) &array[next], status);
+              }
+              else
+              {
+                /* convert the raw data before writing to FITS file */
+                ffi8fi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+              }
+
+              break;
+
+            case (TLONG):
+
+                ffi8fi4(&array[next], ntodo, scale, zero,
+                        (INT32BIT *) buffer, status);
+                ffpi4b(fptr, ntodo, incre, (INT32BIT *) buffer, status);
+                break;
+
+            case (TBYTE):
+ 
+                ffi8fi1(&array[next], ntodo, scale, zero,
+                        (unsigned char *) buffer, status);
+                ffpi1b(fptr, ntodo, incre, (unsigned char *) buffer, status);
+                break;
+
+            case (TSHORT):
+
+                ffi8fi2(&array[next], ntodo, scale, zero,
+                        (short *) buffer, status);
+                ffpi2b(fptr, ntodo, incre, (short *) buffer, status);
+                break;
+
+            case (TFLOAT):
+
+                ffi8fr4(&array[next], ntodo, scale, zero,
+                        (float *) buffer, status);
+                ffpr4b(fptr, ntodo, incre, (float *) buffer, status);
+                break;
+
+            case (TDOUBLE):
+                ffi8fr8(&array[next], ntodo, scale, zero,
+                       (double *) buffer, status);
+                ffpr8b(fptr, ntodo, incre, (double *) buffer, status);
+                break;
+
+            case (TSTRING):  /* numerical column in an ASCII table */
+
+                if (cform[1] != 's')  /*  "%s" format is a string */
+                {
+                  ffi8fstr(&array[next], ntodo, scale, zero, cform,
+                          twidth, (char *) buffer, status);
+
+                  if (incre == twidth)    /* contiguous bytes */
+                     ffpbyt(fptr, ntodo * twidth, buffer, status);
+                  else
+                     ffpbytoff(fptr, twidth, ntodo, incre - twidth, buffer,
+                            status);
+
+                  break;
+                }
+                /* can't write to string column, so fall thru to default: */
+
+            default:  /*  error trap  */
+                sprintf(message, 
+                     "Cannot write numbers to column %d which has format %s",
+                      colnum,tform);
+                ffpmsg(message);
+                if (hdutype == ASCII_TBL)
+                    return(*status = BAD_ATABLE_FORMAT);
+                else
+                    return(*status = BAD_BTABLE_FORMAT);
+
+        } /* End of switch block */
+
+        /*-------------------------*/
+        /*  Check for fatal error  */
+        /*-------------------------*/
+        if (*status > 0)  /* test for error during previous write operation */
+        {
+          sprintf(message,
+          "Error writing elements %ld thru %ld of input data array (ffpclj).",
+              next+1, next+ntodo);
+          ffpmsg(message);
+          return(*status);
+        }
+
+        /*--------------------------------------------*/
+        /*  increment the counters for the next loop  */
+        /*--------------------------------------------*/
+        remain -= ntodo;
+        if (remain)
+        {
+            next += ntodo;
+            elemnum += ntodo;
+            if (elemnum == repeat)  /* completed a row; start on next row */
+            {
+                elemnum = 0;
+                rownum++;
+            }
+        }
+    }  /*  End of main while Loop  */
+
+
+    /*--------------------------------*/
+    /*  check for numerical overflow  */
+    /*--------------------------------*/
+    if (*status == OVERFLOW_ERR)
+    {
+        ffpmsg(
+        "Numerical overflow during type conversion while writing FITS data.");
+        *status = NUM_OVERFLOW;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpcnjj(fitsfile *fptr,  /* I - FITS file pointer                       */
+            int  colnum,     /* I - number of column to write (1 = 1st col) */
+            long  firstrow,  /* I - first row to write (1 = 1st row)        */
+            long  firstelem, /* I - first vector element to write (1 = 1st) */
+            long  nelem,     /* I - number of values to write               */
+            LONGLONG *array, /* I - array of values to write                */
+            LONGLONG nulvalue, /* I - value used to flag undefined pixels   */
+            int  *status)    /* IO - error status                           */
+/*
+  Write an array of elements to the specified column of a table.  Any input
+  pixels equal to the value of nulvalue will be replaced by the appropriate
+  null value in the output FITS file. 
+
+  The input array of values will be converted to the datatype of the column 
+  and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary
+*/
+{
+    tcolumn *colptr;
+    long  ngood = 0, nbad = 0, ii, fstrow;
+    OFF_T large_elem, repeat, first, fstelm;
+
+    if (*status > 0)
+        return(*status);
+
+    /* reset position to the correct HDU if necessary */
+    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+    {
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+    }
+    else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
+    {
+        if ( ffrdef(fptr, status) > 0)               /* rescan header */
+            return(*status);
+    }
+
+    colptr  = (fptr->Fptr)->tableptr;   /* point to first column */
+    colptr += (colnum - 1);     /* offset to correct column structure */
+
+    repeat = colptr->trepeat;  /* repeat count for this column */
+
+    if (firstelem == USE_LARGE_VALUE)
+        large_elem = large_first_elem_val;
+    else
+        large_elem = firstelem;
+
+    /* hereafter, pass first element parameter via global variable */
+    firstelem = USE_LARGE_VALUE;
+
+    /* absolute element number in the column */
+    first = (firstrow - 1) * repeat + large_elem;
+
+    for (ii = 0; ii < nelem; ii++)
+    {
+      if (array[ii] != nulvalue)  /* is this a good pixel? */
+      {
+         if (nbad)  /* write previous string of bad pixels */
+         {
+            fstelm = ii - nbad + first;  /* absolute element number */
+            fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
+            fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
+            large_first_elem_val = fstelm;
+
+            if (ffpclu(fptr, colnum, fstrow, firstelem, nbad, status) > 0)
+                return(*status);
+
+            nbad=0;
+         }
+
+         ngood = ngood +1;  /* the consecutive number of good pixels */
+      }
+      else
+      {
+         if (ngood)  /* write previous string of good pixels */
+         {
+            fstelm = ii - ngood + first;  /* absolute element number */
+            fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
+            fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
+            large_first_elem_val = fstelm;
+
+            if (ffpcljj(fptr, colnum, fstrow,firstelem, ngood, &array[ii-ngood],
+                status) > 0)
+                return(*status);
+
+            ngood=0;
+         }
+
+         nbad = nbad +1;  /* the consecutive number of bad pixels */
+      }
+    }
+
+    /* finished loop;  now just write the last set of pixels */
+
+    if (ngood)  /* write last string of good pixels */
+    {
+      fstelm = ii - ngood + first;  /* absolute element number */
+      fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
+      fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
+      large_first_elem_val = fstelm;
+
+      ffpcljj(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
+    }
+    else if (nbad) /* write last string of bad pixels */
+    {
+      fstelm = ii - nbad + first;  /* absolute element number */
+      fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
+      fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
+      large_first_elem_val = fstelm;
+
+      ffpclu(fptr, colnum, fstrow, firstelem, nbad, status);
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffi8fi1(LONGLONG *input,       /* I - array of values to be converted  */
+            long ntodo,            /* I - number of elements in the array  */
+            double scale,          /* I - FITS TSCALn or BSCALE value      */
+            double zero,           /* I - FITS TZEROn or BZERO  value      */
+            unsigned char *output, /* O - output array of converted values */
+            int *status)           /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required.
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            if (input[ii] < 0)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = 0;
+            }
+            else if (input[ii] > UCHAR_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = UCHAR_MAX;
+            }
+            else
+                output[ii] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DUCHAR_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = 0;
+            }
+            else if (dvalue > DUCHAR_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = UCHAR_MAX;
+            }
+            else
+                output[ii] = (unsigned char) (dvalue + .5);
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffi8fi2(LONGLONG *input,   /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            short *output,     /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required.
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            if (input[ii] < SHRT_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = SHRT_MIN;
+            }
+            else if (input[ii] > SHRT_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = SHRT_MAX;
+            }
+            else
+                output[ii] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DSHRT_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = SHRT_MIN;
+            }
+            else if (dvalue > DSHRT_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = SHRT_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (short) (dvalue + .5);
+                else
+                    output[ii] = (short) (dvalue - .5);
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffi8fi4(LONGLONG *input,   /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            INT32BIT *output,  /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            if (input[ii] < INT32_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = INT32_MIN;
+            }
+            else if (input[ii] > INT32_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = INT32_MAX;
+            }
+            else
+                output[ii] = (INT32BIT) input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DINT_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = INT32_MIN;
+            }
+            else if (dvalue > DINT_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = INT32_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (INT32BIT) (dvalue + .5);
+                else
+                    output[ii] = (INT32BIT) (dvalue - .5);
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffi8fi8(LONGLONG *input,   /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,  /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffi8fr4(LONGLONG *input,   /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            float *output,     /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required.
+*/
+{
+    long ii;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (float) input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+            output[ii] = (input[ii] - zero) / scale;
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffi8fr8(LONGLONG *input,       /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            double *output,    /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required.
+*/
+{
+    long ii;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (double) input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+            output[ii] = (input[ii] - zero) / scale;
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffi8fstr(LONGLONG *input,  /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            char *cform,       /* I - format for output string values  */
+            long twidth,       /* I - width of each field, in chars    */
+            char *output,      /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do scaling if required.
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+        {
+           sprintf(output, cform, (double) input[ii]);
+           output += twidth;
+
+           if (*output)  /* if this char != \0, then overflow occurred */
+              *status = OVERFLOW_ERR;
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+          dvalue = (input[ii] - zero) / scale;
+          sprintf(output, cform, dvalue);
+          output += twidth;
+
+          if (*output)  /* if this char != \0, then overflow occurred */
+            *status = OVERFLOW_ERR;
+        }
+    }
+    return(*status);
+}
diff --git a/putcolk.c b/putcolk.c
index 74bd875..16bf4c9 100644
--- a/putcolk.c
+++ b/putcolk.c
@@ -27,6 +27,7 @@ int ffpprk( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    int nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffpprk( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TINT, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppnk( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    int nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppnk( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TINT, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -125,21 +136,25 @@ int ffp3dk(fitsfile *fptr,   /* I - FITS file pointer                     */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
       where the first column contains the group parameters
       and the second column contains the image itself.
     */
-
+           
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TINT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -206,10 +221,10 @@ int ffpssk(fitsfile *fptr,   /* I - FITS file pointer                       */
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TINT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -453,6 +468,13 @@ int ffpclk( fitsfile *fptr,  /* I - FITS file pointer                       */
 
                 break;
 
+            case (TLONGLONG):
+
+                ffintfi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
             case (TBYTE):
  
                 ffintfi1(&array[next], ntodo, scale, zero,
@@ -654,7 +676,7 @@ int ffpcnk( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpclk(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
@@ -828,6 +850,128 @@ int ffintfi4(int *input,       /* I - array of values to be converted  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffintfi8(int *input,  /* I - array of values to be converted  */
+            long ntodo,             /* I - number of elements in the array  */
+            double scale,           /* I - FITS TSCALn or BSCALE value      */
+            double zero,            /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,       /* O - output array of converted values */
+            int *status)            /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+                if (input[ii] < 0)
+                   output[jj] = -1;
+                else
+                   output[jj] = 0;
+         
+                output[kk] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffintfr4(int *input,       /* I - array of values to be converted  */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
diff --git a/putcoll.c b/putcoll.c
index 20ac649..0c5de8a 100644
--- a/putcoll.c
+++ b/putcoll.c
@@ -176,7 +176,7 @@ int ffpcnl( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpcll(fptr, colnum, fstrow, fstelm, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
@@ -291,7 +291,8 @@ int ffpclx( fitsfile *fptr,  /* I - FITS file pointer                       */
         /* Note: ffgcpr previous wrote the descripter, but with the */
         /* wrong repeat value  (gave bytes instead of bits).        */
 
-        ffpdes(fptr, colnum, frow, (long) repeat, offset, status);
+        if (tcode == -TBIT)
+            ffpdes(fptr, colnum, frow, (long) repeat, offset, status);
 
         /* Calc the i/o pointer location to start of sequence of pixels.   */
         /* ffgcpr has already calculated a value for bstart that           */
diff --git a/putcols.c b/putcols.c
index 30f5b44..7e27a29 100644
--- a/putcols.c
+++ b/putcols.c
@@ -271,7 +271,7 @@ int ffpcns( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpcls(fptr, colnum, fstrow, fstelm, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
diff --git a/putcolsb.c b/putcolsb.c
new file mode 100644
index 0000000..2a0e95a
--- /dev/null
+++ b/putcolsb.c
@@ -0,0 +1,1030 @@
+/*  This file, putcolsb.c, contains routines that write data elements to   */
+/*  a FITS image or table with signed char (signed byte) datatype.         */
+
+/*  The FITSIO software was written by William Pence at the High Energy    */
+/*  Astrophysic Science Archive Research Center (HEASARC) at the NASA      */
+/*  Goddard Space Flight Center.                                           */
+
+#include <limits.h>
+#include <string.h>
+#include <stdlib.h>
+#include "fitsio2.h"
+
+/* declare variable for passing large firstelem values between routines */
+extern OFF_T large_first_elem_val;
+
+/*--------------------------------------------------------------------------*/
+int ffpprsb( fitsfile *fptr,  /* I - FITS file pointer                      */
+            long  group,     /* I - group to write(1 = 1st group)           */
+            long  firstelem, /* I - first vector element to write(1 = 1st)  */
+            long  nelem,     /* I - number of values to write               */
+            signed char *array, /* I - array of values that are written     */
+            int  *status)    /* IO - error status                           */
+/*
+  Write an array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being written).
+*/
+{
+    long row;
+    signed char nullvalue;
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
+
+        fits_write_compressed_pixels(fptr, TSBYTE, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
+    }
+
+    row=maxvalue(1,group);
+
+    ffpclsb(fptr, 2, row, firstelem, nelem, array, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffppnsb( fitsfile *fptr,  /* I - FITS file pointer                      */
+            long  group,     /* I - group to write(1 = 1st group)           */
+            long  firstelem, /* I - first vector element to write(1 = 1st)  */
+            long  nelem,     /* I - number of values to write               */
+            signed char *array, /* I - array of values that are written     */
+            signed char nulval, /* I - undefined pixel value                */
+            int  *status)    /* IO - error status                           */
+/*
+  Write an array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being written).  Any array values
+  that are equal to the value of nulval will be replaced with the null
+  pixel value that is appropriate for this column.
+*/
+{
+    long row;
+    signed char nullvalue;
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
+
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TSBYTE, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
+    }
+
+    row=maxvalue(1,group);
+
+    ffpcnsb(fptr, 2, row, firstelem, nelem, array, nulval, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffp2dsb(fitsfile *fptr,   /* I - FITS file pointer                    */
+           long  group,      /* I - group to write(1 = 1st group)         */
+           long  ncols,      /* I - number of pixels in each row of array */
+           long  naxis1,     /* I - FITS image NAXIS1 value               */
+           long  naxis2,     /* I - FITS image NAXIS2 value               */
+           signed char *array, /* I - array to be written                 */
+           int  *status)     /* IO - error status                         */
+/*
+  Write an entire 2-D array of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being written).
+*/
+{
+    /* call the 3D writing routine, with the 3rd dimension = 1 */
+
+    ffp3dsb(fptr, group, ncols, naxis2, naxis1, naxis2, 1, array, status);
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffp3dsb(fitsfile *fptr,   /* I - FITS file pointer                    */
+           long  group,      /* I - group to write(1 = 1st group)         */
+           long  ncols,      /* I - number of pixels in each row of array */
+           long  nrows,      /* I - number of rows in each plane of array */
+           long  naxis1,     /* I - FITS image NAXIS1 value               */
+           long  naxis2,     /* I - FITS image NAXIS2 value               */
+           long  naxis3,     /* I - FITS image NAXIS3 value               */
+           signed char *array, /* I - array to be written                 */
+           int  *status)     /* IO - error status                         */
+/*
+  Write an entire 3-D cube of values to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of the
+  FITS array is not the same as the array being written).
+*/
+{
+    long tablerow, nfits, narray, ii, jj;
+    long fpixel[3]= {1,1,1}, lpixel[3];
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+           
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TSBYTE, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
+    }
+
+    tablerow=maxvalue(1,group);
+
+    if (ncols == naxis1 && nrows == naxis2)  /* arrays have same size? */
+    {
+      /* all the image pixels are contiguous, so write all at once */
+      ffpclsb(fptr, 2, tablerow, 1L, naxis1 * naxis2 * naxis3, array, status);
+      return(*status);
+    }
+
+    if (ncols < naxis1 || nrows < naxis2)
+       return(*status = BAD_DIMEN);
+
+    nfits = 1;   /* next pixel in FITS image to write to */
+    narray = 0;  /* next pixel in input array to be written */
+
+    /* loop over naxis3 planes in the data cube */
+    for (jj = 0; jj < naxis3; jj++)
+    {
+      /* loop over the naxis2 rows in the FITS image, */
+      /* writing naxis1 pixels to each row            */
+
+      for (ii = 0; ii < naxis2; ii++)
+      {
+       if (ffpclsb(fptr, 2, tablerow, nfits, naxis1,&array[narray],status) > 0)
+         return(*status);
+
+       nfits += naxis1;
+       narray += ncols;
+      }
+      narray += (nrows - naxis2) * ncols;
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpsssb(fitsfile *fptr,   /* I - FITS file pointer                      */
+           long  group,      /* I - group to write(1 = 1st group)           */
+           long  naxis,      /* I - number of data axes in array            */
+           long  *naxes,     /* I - size of each FITS axis                  */
+           long  *fpixel,    /* I - 1st pixel in each axis to write (1=1st) */
+           long  *lpixel,    /* I - last pixel in each axis to write        */
+           signed char *array, /* I - array to be written                   */
+           int  *status)     /* IO - error status                           */
+/*
+  Write a subsection of pixels to the primary array or image.
+  A subsection is defined to be any contiguous rectangular
+  array of pixels within the n-dimensional FITS data file.
+  Data conversion and scaling will be performed if necessary 
+  (e.g, if the datatype of the FITS array is not the same as
+  the array being written).
+*/
+{
+    long tablerow;
+    long fpix[7], irange[7], dimen[7], astart, pstart;
+    long off2, off3, off4, off5, off6, off7;
+    long st10, st20, st30, st40, st50, st60, st70;
+    long st1, st2, st3, st4, st5, st6, st7;
+    long ii, i1, i2, i3, i4, i5, i6, i7;
+
+    if (*status > 0)
+        return(*status);
+
+    if (fits_is_compressed_image(fptr, status))
+    {
+        /* this is a compressed image in a binary table */
+
+        fits_write_compressed_img(fptr, TSBYTE, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
+    }
+
+    if (naxis < 1 || naxis > 7)
+      return(*status = BAD_DIMEN);
+
+    tablerow=maxvalue(1,group);
+
+     /* calculate the size and number of loops to perform in each dimension */
+    for (ii = 0; ii < 7; ii++)
+    {
+      fpix[ii]=1;
+      irange[ii]=1;
+      dimen[ii]=1;
+    }
+
+    for (ii = 0; ii < naxis; ii++)
+    {    
+      fpix[ii]=fpixel[ii];
+      irange[ii]=lpixel[ii]-fpixel[ii]+1;
+      dimen[ii]=naxes[ii];
+    }
+
+    i1=irange[0];
+
+    /* compute the pixel offset between each dimension */
+    off2 =     dimen[0];
+    off3 = off2 * dimen[1];
+    off4 = off3 * dimen[2];
+    off5 = off4 * dimen[3];
+    off6 = off5 * dimen[4];
+    off7 = off6 * dimen[5];
+
+    st10 = fpix[0];
+    st20 = (fpix[1] - 1) * off2;
+    st30 = (fpix[2] - 1) * off3;
+    st40 = (fpix[3] - 1) * off4;
+    st50 = (fpix[4] - 1) * off5;
+    st60 = (fpix[5] - 1) * off6;
+    st70 = (fpix[6] - 1) * off7;
+
+    /* store the initial offset in each dimension */
+    st1 = st10;
+    st2 = st20;
+    st3 = st30;
+    st4 = st40;
+    st5 = st50;
+    st6 = st60;
+    st7 = st70;
+
+    astart = 0;
+
+    for (i7 = 0; i7 < irange[6]; i7++)
+    {
+     for (i6 = 0; i6 < irange[5]; i6++)
+     {
+      for (i5 = 0; i5 < irange[4]; i5++)
+      {
+       for (i4 = 0; i4 < irange[3]; i4++)
+       {
+        for (i3 = 0; i3 < irange[2]; i3++)
+        {
+         pstart = st1 + st2 + st3 + st4 + st5 + st6 + st7;
+         for (i2 = 0; i2 < irange[1]; i2++)
+         {
+           if (ffpclsb(fptr, 2, tablerow, pstart, i1, &array[astart],
+              status) > 0)
+              return(*status);
+
+           astart += i1;
+           pstart += off2;
+         }
+         st2 = st20;
+         st3 = st3+off3;    
+        }
+        st3 = st30;
+        st4 = st4+off4;
+       }
+       st4 = st40;
+       st5 = st5+off5;
+      }
+      st5 = st50;
+      st6 = st6+off6;
+     }
+     st6 = st60;
+     st7 = st7+off7;
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpgpsb( fitsfile *fptr,   /* I - FITS file pointer                     */
+            long  group,      /* I - group to write(1 = 1st group)          */
+            long  firstelem,  /* I - first vector element to write(1 = 1st) */
+            long  nelem,      /* I - number of values to write              */
+            signed char *array, /* I - array of values that are written     */
+            int  *status)     /* IO - error status                          */
+/*
+  Write an array of group parameters to the primary array. Data conversion
+  and scaling will be performed if necessary (e.g, if the datatype of
+  the FITS array is not the same as the array being written).
+*/
+{
+    long row;
+
+    /*
+      the primary array is represented as a binary table:
+      each group of the primary array is a row in the table,
+      where the first column contains the group parameters
+      and the second column contains the image itself.
+    */
+
+    row=maxvalue(1,group);
+
+    ffpclsb(fptr, 1L, row, firstelem, nelem, array, status);
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpclsb( fitsfile *fptr,  /* I - FITS file pointer                      */
+            int  colnum,     /* I - number of column to write (1 = 1st col) */
+            long  firstrow,  /* I - first row to write (1 = 1st row)        */
+            long  firstelem, /* I - first vector element to write (1 = 1st) */
+            long  nelem,     /* I - number of values to write               */
+            signed char *array, /* I - array of values to write             */
+            int  *status)    /* IO - error status                           */
+/*
+  Write an array of values to a column in the current FITS HDU.
+  The column number may refer to a real column in an ASCII or binary table, 
+  or it may refer to a virtual column in a 1 or more grouped FITS primary
+  array.  FITSIO treats a primary array as a binary table with
+  2 vector columns: the first column contains the group parameters (often
+  with length = 0) and the second column contains the array of image pixels.
+  Each row of the table represents a group in the case of multigroup FITS
+  images.
+
+  The input array of values will be converted to the datatype of the column 
+  and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary.
+*/
+{
+    int tcode, maxelem, hdutype;
+    long twidth, incre, rownum, remain, next, ntodo;
+    long tnull;
+    OFF_T repeat, startpos, elemnum, large_elem, wrtptr, rowlen;
+    double scale, zero;
+    char tform[20], cform[20];
+    char message[FLEN_ERRMSG];
+
+    char snull[20];   /*  the FITS null value  */
+
+    double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */
+    void *buffer;
+
+    if (*status > 0)           /* inherit input status value if > 0 */
+        return(*status);
+
+    buffer = cbuff;
+
+    if (firstelem == USE_LARGE_VALUE)
+        large_elem = large_first_elem_val;
+    else
+        large_elem = firstelem;
+
+    /*---------------------------------------------------*/
+    /*  Check input and get parameters about the column: */
+    /*---------------------------------------------------*/
+    if (ffgcpr( fptr, colnum, firstrow, large_elem, nelem, 1, &scale, &zero,
+        tform, &twidth, &tcode, &maxelem, &startpos,  &elemnum, &incre,
+        &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0)
+        return(*status);
+
+    if (tcode == TSTRING)   
+         ffcfmt(tform, cform);     /* derive C format for writing strings */
+
+    /*---------------------------------------------------------------------*/
+    /*  Now write the pixels to the FITS column.                           */
+    /*  First call the ffXXfYY routine to  (1) convert the datatype        */
+    /*  if necessary, and (2) scale the values by the FITS TSCALn and      */
+    /*  TZEROn linear scaling parameters into a temporary buffer.          */
+    /*---------------------------------------------------------------------*/
+    remain = nelem;           /* remaining number of values to write  */
+    next = 0;                 /* next element in array to be written  */
+    rownum = 0;               /* row number, relative to firstrow     */
+
+    while (remain)
+    {
+        /* limit the number of pixels to process a one time to the number that
+           will fit in the buffer space or to the number of pixels that remain
+           in the current vector, which ever is smaller.
+        */
+        ntodo = minvalue(remain, maxelem);      
+        ntodo = minvalue(ntodo, (repeat - elemnum));
+
+        wrtptr = startpos + ((OFF_T)rownum * rowlen) + (elemnum * incre);
+        ffmbyt(fptr, wrtptr, IGNORE_EOF, status); /* move to write position */
+
+        switch (tcode) 
+        {
+            case (TBYTE):
+
+                /* convert the raw data before writing to FITS file */
+                ffs1fi1(&array[next], ntodo, scale, zero,
+                        (unsigned char *) buffer, status);
+                ffpi1b(fptr, ntodo, incre, (unsigned char *) buffer, status);
+
+              break;
+
+            case (TLONGLONG):
+
+                ffs1fi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
+            case (TSHORT):
+ 
+                ffs1fi2(&array[next], ntodo, scale, zero,
+                        (short *) buffer, status);
+                ffpi2b(fptr, ntodo, incre, (short *) buffer, status);
+                break;
+
+            case (TLONG):
+
+                ffs1fi4(&array[next], ntodo, scale, zero,
+                        (INT32BIT *) buffer, status);
+                ffpi4b(fptr, ntodo, incre, (INT32BIT *) buffer, status);
+                break;
+
+            case (TFLOAT):
+
+                ffs1fr4(&array[next], ntodo, scale, zero,
+                        (float *)  buffer, status);
+                ffpr4b(fptr, ntodo, incre, (float *) buffer, status);
+                break;
+
+            case (TDOUBLE):
+                ffs1fr8(&array[next], ntodo, scale, zero,
+                        (double *) buffer, status);
+                ffpr8b(fptr, ntodo, incre, (double *) buffer, status);
+                break;
+
+            case (TSTRING):  /* numerical column in an ASCII table */
+
+                if (strchr(tform,'A'))
+                {
+                    /* write raw input bytes without conversion        */
+                    /* This case is a hack to let users write a stream */
+                    /* of bytes directly to the 'A' format column      */
+
+                    if (incre == twidth)
+                        ffpbyt(fptr, ntodo, &array[next], status);
+                    else
+                        ffpbytoff(fptr, twidth, ntodo/twidth, incre - twidth, 
+                                &array[next], status);
+                    break;
+                }
+                else if (cform[1] != 's')  /*  "%s" format is a string */
+                {
+                  ffs1fstr(&array[next], ntodo, scale, zero, cform,
+                          twidth, (char *) buffer, status);
+
+                  if (incre == twidth)    /* contiguous bytes */
+                     ffpbyt(fptr, ntodo * twidth, buffer, status);
+                  else
+                     ffpbytoff(fptr, twidth, ntodo, incre - twidth, buffer,
+                            status);
+                  break;
+                }
+                /* can't write to string column, so fall thru to default: */
+
+            default:  /*  error trap  */
+                sprintf(message, 
+                       "Cannot write numbers to column %d which has format %s",
+                        colnum,tform);
+                ffpmsg(message);
+                if (hdutype == ASCII_TBL)
+                    return(*status = BAD_ATABLE_FORMAT);
+                else
+                    return(*status = BAD_BTABLE_FORMAT);
+
+        } /* End of switch block */
+
+        /*-------------------------*/
+        /*  Check for fatal error  */
+        /*-------------------------*/
+        if (*status > 0)  /* test for error during previous write operation */
+        {
+          sprintf(message,
+          "Error writing elements %ld thru %ld of input data array (ffpclsb).",
+              next+1, next+ntodo);
+          ffpmsg(message);
+          return(*status);
+        }
+
+        /*--------------------------------------------*/
+        /*  increment the counters for the next loop  */
+        /*--------------------------------------------*/
+        remain -= ntodo;
+        if (remain)
+        {
+            next += ntodo;
+            elemnum += ntodo;
+            if (elemnum == repeat)  /* completed a row; start on next row */
+            {
+                elemnum = 0;
+                rownum++;
+            }
+        }
+    }  /*  End of main while Loop  */
+
+
+    /*--------------------------------*/
+    /*  check for numerical overflow  */
+    /*--------------------------------*/
+    if (*status == OVERFLOW_ERR)
+    {
+      ffpmsg(
+      "Numerical overflow during type conversion while writing FITS data.");
+      *status = NUM_OVERFLOW;
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpcnsb( fitsfile *fptr,  /* I - FITS file pointer                      */
+            int  colnum,     /* I - number of column to write (1 = 1st col) */
+            long  firstrow,  /* I - first row to write (1 = 1st row)        */
+            long  firstelem, /* I - first vector element to write (1 = 1st) */
+            long  nelem,     /* I - number of values to write               */
+            signed char *array,   /* I - array of values to write           */
+            signed char nulvalue, /* I - flag for undefined pixels          */
+            int  *status)    /* IO - error status                           */
+/*
+  Write an array of elements to the specified column of a table.  Any input
+  pixels equal to the value of nulvalue will be replaced by the appropriate
+  null value in the output FITS file. 
+
+  The input array of values will be converted to the datatype of the column 
+  and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary
+*/
+{
+    tcolumn *colptr;
+    long  ngood = 0, nbad = 0, ii, fstrow;
+    OFF_T large_elem, repeat, first, fstelm;
+
+    if (*status > 0)
+        return(*status);
+
+    /* reset position to the correct HDU if necessary */
+    if (fptr->HDUposition != (fptr->Fptr)->curhdu)
+    {
+        ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
+    }
+    else if ((fptr->Fptr)->datastart == DATA_UNDEFINED)
+    {
+        if ( ffrdef(fptr, status) > 0)               /* rescan header */
+            return(*status);
+    }
+
+    colptr  = (fptr->Fptr)->tableptr;   /* point to first column */
+    colptr += (colnum - 1);     /* offset to correct column structure */
+
+    repeat = colptr->trepeat;  /* repeat count for this column */
+
+    if (firstelem == USE_LARGE_VALUE)
+        large_elem = large_first_elem_val;
+    else
+        large_elem = firstelem;
+
+    /* hereafter, pass first element parameter via global variable */
+    firstelem = USE_LARGE_VALUE;
+
+    /* absolute element number in the column */
+    first = (firstrow - 1) * repeat + large_elem;
+
+    for (ii = 0; ii < nelem; ii++)
+    {
+      if (array[ii] != nulvalue)  /* is this a good pixel? */
+      {
+         if (nbad)  /* write previous string of bad pixels */
+         {
+            fstelm = ii - nbad + first;  /* absolute element number */
+            fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
+            fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
+            large_first_elem_val = fstelm;
+
+            if (ffpclu(fptr, colnum, fstrow, firstelem, nbad, status) > 0)
+                return(*status);
+
+            nbad=0;
+         }
+
+         ngood = ngood + 1;  /* the consecutive number of good pixels */
+      }
+      else
+      {
+         if (ngood)  /* write previous string of good pixels */
+         {
+            fstelm = ii - ngood + first;  /* absolute element number */
+            fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
+            fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
+            large_first_elem_val = fstelm;
+
+            if (ffpclsb(fptr, colnum, fstrow, firstelem,ngood, &array[ii-ngood],
+                status) > 0)
+                return(*status);
+
+            ngood=0;
+         }
+
+         nbad = nbad + 1;  /* the consecutive number of bad pixels */
+      }
+    }
+
+    /* finished loop;  now just write the last set of pixels */
+
+    if (ngood)  /* write last string of good pixels */
+    {
+      fstelm = ii - ngood + first;  /* absolute element number */
+      fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
+      fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
+      large_first_elem_val = fstelm;
+
+      ffpclsb(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
+    }
+    else if (nbad) /* write last string of bad pixels */
+    {
+      fstelm = ii - nbad + first;  /* absolute element number */
+      fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
+      fstelm = fstelm - (fstrow - 1) * repeat;  /* relative number */
+      large_first_elem_val = fstelm;
+
+      ffpclu(fptr, colnum, fstrow, firstelem, nbad, status);
+    }
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffs1fi1(signed char *input,    /* I - array of values to be converted  */
+            long ntodo,            /* I - number of elements in the array  */
+            double scale,          /* I - FITS TSCALn or BSCALE value      */
+            double zero,           /* I - FITS TZEROn or BZERO  value      */
+            unsigned char *output, /* O - output array of converted values */
+            int *status)           /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == -128.)
+    {
+        /* Instead of adding 128, it is more efficient */
+        /* to just flip the sign bit with the XOR operator */
+
+        for (ii = 0; ii < ntodo; ii++)
+             output[ii] =  ( *(unsigned char *) &input[ii] ) ^ 0x80;
+    }
+    else if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            if (input[ii] < 0)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = 0;
+            }
+            else
+                output[ii] = (unsigned char) input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = ( ((double) input[ii]) - zero) / scale;
+
+            if (dvalue < DUCHAR_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = 0;
+            }
+            else if (dvalue > DUCHAR_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = UCHAR_MAX;
+            }
+            else
+                output[ii] = (unsigned char) (dvalue + .5);
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffs1fi2(signed char *input,    /* I - array of values to be converted  */
+            long ntodo,            /* I - number of elements in the array  */
+            double scale,          /* I - FITS TSCALn or BSCALE value      */
+            double zero,           /* I - FITS TZEROn or BZERO  value      */
+            short *output,         /* O - output array of converted values */
+            int *status)           /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+            output[ii] = input[ii];   /* just copy input to output */
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (((double) input[ii]) - zero) / scale;
+
+            if (dvalue < DSHRT_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = SHRT_MIN;
+            }
+            else if (dvalue > DSHRT_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = SHRT_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (short) (dvalue + .5);
+                else
+                    output[ii] = (short) (dvalue - .5);
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffs1fi4(signed char *input,    /* I - array of values to be converted  */
+            long ntodo,            /* I - number of elements in the array  */
+            double scale,          /* I - FITS TSCALn or BSCALE value      */
+            double zero,           /* I - FITS TZEROn or BZERO  value      */
+            INT32BIT *output,      /* O - output array of converted values */
+            int *status)           /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+            output[ii] = (INT32BIT) input[ii];   /* copy input to output */
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (((double) input[ii]) - zero) / scale;
+
+            if (dvalue < DINT_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = INT32_MIN;
+            }
+            else if (dvalue > DINT_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = INT32_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (INT32BIT) (dvalue + .5);
+                else
+                    output[ii] = (INT32BIT) (dvalue - .5);
+            }
+        }
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffs1fi8(signed char *input,   /* I - array of values to be converted  */
+            long ntodo,           /* I - number of elements in the array  */
+            double scale,         /* I - FITS TSCALn or BSCALE value      */
+            double zero,          /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,     /* O - output array of converted values */
+            int *status)          /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+                if (input[ii] < 0)
+                   output[jj] = -1;
+                else
+                   output[jj] = 0;
+         
+                output[kk] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffs1fr4(signed char *input,    /* I - array of values to be converted  */
+            long ntodo,            /* I - number of elements in the array  */
+            double scale,          /* I - FITS TSCALn or BSCALE value      */
+            double zero,           /* I - FITS TZEROn or BZERO  value      */
+            float *output,         /* O - output array of converted values */
+            int *status)           /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required.
+*/
+{
+    long ii;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (float) input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+            output[ii] = ( ( (double) input[ii] ) - zero) / scale;
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffs1fr8(signed char *input,    /* I - array of values to be converted  */
+            long ntodo,            /* I - number of elements in the array  */
+            double scale,          /* I - FITS TSCALn or BSCALE value      */
+            double zero,           /* I - FITS TZEROn or BZERO  value      */
+            double *output,        /* O - output array of converted values */
+            int *status)           /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required.
+*/
+{
+    long ii;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = (double) input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+            output[ii] = ( ( (double) input[ii] ) - zero) / scale;
+    }
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffs1fstr(signed char *input, /* I - array of values to be converted  */
+            long ntodo,        /* I - number of elements in the array  */
+            double scale,      /* I - FITS TSCALn or BSCALE value      */
+            double zero,       /* I - FITS TZEROn or BZERO  value      */
+            char *cform,       /* I - format for output string values  */
+            long twidth,       /* I - width of each field, in chars    */
+            char *output,      /* O - output array of converted values */
+            int *status)       /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do scaling if required.
+*/
+{
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+        {
+           sprintf(output, cform, (double) input[ii]);
+           output += twidth;
+
+           if (*output)  /* if this char != \0, then overflow occurred */
+              *status = OVERFLOW_ERR;
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+          dvalue = ((double) input[ii] - zero) / scale;
+          sprintf(output, cform, dvalue);
+          output += twidth;
+
+          if (*output)  /* if this char != \0, then overflow occurred */
+            *status = OVERFLOW_ERR;
+        }
+    }
+    return(*status);
+}
diff --git a/putcolu.c b/putcolu.c
index db18dce..4681444 100644
--- a/putcolu.c
+++ b/putcolu.c
@@ -80,7 +80,7 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
             int  colnum,     /* I - number of column to write (1 = 1st col) */
             long  firstrow,  /* I - first row to write (1 = 1st row)        */
             long  firstelem, /* I - first vector element to write (1 = 1st) */
-            long  nelem,     /* I - number of values to write               */
+            long  nelempar,     /* I - number of values to write               */
             int  *status)    /* IO - error status                           */
 /*
   Set elements of a table column to the appropriate null value for the column
@@ -91,24 +91,30 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
   with length = 0) and the second column contains the array of image pixels.
   Each row of the table represents a group in the case of multigroup FITS
   images.
+  
+  This routine support COMPLEX and DOUBLE COMPLEX binary table columns, and
+  sets both the real and imaginary components of the element to a NaN.
 */
 {
-    int tcode, maxelem, hdutype, lennull, nwrite = 0, writemode = 2;
+    int tcode, maxelem, hdutype, writemode = 2, leng;
     short i2null;
-    INT32BIT i4null;
+    INT32BIT i4null, i8null[2];
     long twidth, incre, rownum, remain, next, ntodo;
-    long tnull, ii;
+    long tnull, ii, nelem;
     OFF_T repeat, startpos, elemnum, large_elem, wrtptr, rowlen;
     double scale, zero;
     unsigned char i1null, lognul = 0;
-    char tform[20], cstring[50];
+    char tform[20], *cstring = 0;
     char message[FLEN_ERRMSG];
     char snull[20];   /*  the FITS null value  */
     long   jbuff[2] = { -1, -1};  /* all bits set is equivalent to a NaN */
+    size_t buffsize;
 
     if (*status > 0)           /* inherit input status value if > 0 */
         return(*status);
 
+    nelem = nelempar;
+    
     if (firstelem == USE_LARGE_VALUE)
         large_elem = large_first_elem_val;
     else
@@ -130,6 +136,12 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
     if (tcode < 0)
          writemode = 0;  /* this is a variable length column */
 
+    if (abs(tcode) >= TCOMPLEX)
+    { /* treat complex columns as pairs of numbers */
+      large_elem = (large_elem - 1) * 2 + 1;
+      nelem *= 2;
+    }
+    
     if (ffgcpr( fptr, colnum, firstrow, large_elem, nelem, writemode, &scale,
        &zero, tform, &twidth, &tcode, &maxelem, &startpos,  &elemnum, &incre,
         &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0)
@@ -144,24 +156,279 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
         return(*status = NO_NULL);
       }
 
-      strcpy(cstring, snull);          /* copy null string to temp buffer */
-      lennull = strlen(cstring);
+      /* allocate buffer to hold the null string.  Must write the entire */
+      /* width of the column (twidth bytes) to avoid possible problems */
+      /* with uninitialized FITS blocks, in case the field spans blocks */
+
+      buffsize = maxvalue(20, twidth);
+      cstring = (char *) malloc(buffsize);
+      if (!cstring)
+         return(*status = MEMORY_ALLOCATION);
 
+      memset(cstring, ' ', buffsize);  /* initialize  with blanks */
+
+      leng = strlen(snull);
       if (hdutype == BINARY_TBL)
-      {  /* write up to and including null terminator into BINTABLE column */
-         nwrite = minvalue(twidth, lennull + 1);
+         leng++;        /* copy the terminator too in binary tables */
+
+      strncpy(cstring, snull, leng);  /* copy null string to temp buffer */
+
+    }
+    else if ( tcode == TBYTE  ||
+              tcode == TSHORT ||
+              tcode == TLONG  ||
+              tcode == TLONGLONG) 
+    {
+      if (tnull == NULL_UNDEFINED)
+      {
+        ffpmsg(
+        "Null value for integer table column is not defined (FTPCLU).");
+        return(*status = NO_NULL);
+      }
+
+      if (tcode == TBYTE)
+         i1null = tnull;
+      else if (tcode == TSHORT)
+      {
+         i2null = tnull;
+#if BYTESWAPPED
+         ffswap2(&i2null, 1); /* reverse order of bytes */
+#endif
+      }
+      else if (tcode == TLONG)
+      {
+         i4null = tnull;
+#if BYTESWAPPED
+         ffswap4(&i4null, 1); /* reverse order of bytes */
+#endif
       }
       else
-      {  /* write up to 20 chars to ASCII table column; pad with blanks */
-         nwrite = minvalue(twidth, 20);
+      {
+         if (tnull < 0)
+            i8null[0] = -1;
+         else
+            i8null[0] = 0;
+
+         i8null[1] = tnull;
+#if BYTESWAPPED
+         ffswap8( (double *) i8null, 1); /* reverse order of bytes */
+#endif
+      }
+    }
+
+    /*---------------------------------------------------------------------*/
+    /*  Now write the pixels to the FITS column.                           */
+    /*---------------------------------------------------------------------*/
+    remain = nelem;           /* remaining number of values to write  */
+    next = 0;                 /* next element in array to be written  */
+    rownum = 0;               /* row number, relative to firstrow     */
+    ntodo = remain;           /* number of elements to write at one time */
+
+    while (ntodo)
+    {
+        /* limit the number of pixels to process at one time to the number that
+           will fit in the buffer space or to the number of pixels that remain
+           in the current vector, which ever is smaller.
+        */
+        ntodo = minvalue(ntodo, (repeat - elemnum));
+        wrtptr = startpos + ((OFF_T)rownum * rowlen) + (elemnum * incre);
+
+        ffmbyt(fptr, wrtptr, IGNORE_EOF, status); /* move to write position */
+
+        switch (tcode) 
+        {
+            case (TBYTE):
+ 
+                for (ii = 0; ii < ntodo; ii++)
+                  ffpbyt(fptr, 1,  &i1null, status);
+                break;
+
+            case (TSHORT):
+
+                for (ii = 0; ii < ntodo; ii++)
+                  ffpbyt(fptr, 2, &i2null, status);
+                break;
+
+            case (TLONG):
+
+                for (ii = 0; ii < ntodo; ii++)
+                  ffpbyt(fptr, 4, &i4null, status);
+                break;
+
+            case (TLONGLONG):
+
+                for (ii = 0; ii < ntodo; ii++)
+                  ffpbyt(fptr, 8, i8null, status);
+                break;
+
+            case (TFLOAT):
+
+                for (ii = 0; ii < ntodo; ii++)
+                  ffpbyt(fptr, 4, jbuff, status);
+                break;
+
+            case (TDOUBLE):
+
+                for (ii = 0; ii < ntodo; ii++)
+                  ffpbyt(fptr, 8, jbuff, status);
+                break;
+
+            case (TLOGICAL):
+ 
+                for (ii = 0; ii < ntodo; ii++)
+                  ffpbyt(fptr, 1, &lognul, status);
+                break;
+
+            case (TSTRING):  /* an ASCII table column */
+                /* repeat always = 1, so ntodo is also guaranteed to = 1 */
+                ffpbyt(fptr, twidth, cstring, status);
+                break;
+
+            default:  /*  error trap  */
+                sprintf(message, 
+                   "Cannot write null value to column %d which has format %s",
+                     colnum,tform);
+                ffpmsg(message);
+                return(*status);
+
+        } /* End of switch block */
+
+        /*-------------------------*/
+        /*  Check for fatal error  */
+        /*-------------------------*/
+        if (*status > 0)  /* test for error during previous write operation */
+        {
+           sprintf(message,
+             "Error writing %ld thru %ld of null values (ffpclu).",
+              next+1, next+ntodo);
+           ffpmsg(message);
+
+           if (cstring)
+              free(cstring);
+
+           return(*status);
+        }
+
+        /*--------------------------------------------*/
+        /*  increment the counters for the next loop  */
+        /*--------------------------------------------*/
+        remain -= ntodo;
+        if (remain)
+        {
+            next += ntodo;
+            elemnum += ntodo;
+            if (elemnum == repeat)  /* completed a row; start on next row */
+            {
+                elemnum = 0;
+                rownum++;
+            }
+        }
+        ntodo = remain;  /* this is the maximum number to do in next loop */
+
+    }  /*  End of main while Loop  */
+
+    if (cstring)
+       free(cstring);
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int ffpcluc( fitsfile *fptr,  /* I - FITS file pointer                       */
+            int  colnum,     /* I - number of column to write (1 = 1st col) */
+            long  firstrow,  /* I - first row to write (1 = 1st row)        */
+            long  firstelem, /* I - first vector element to write (1 = 1st) */
+            long  nelem,     /* I - number of values to write               */
+            int  *status)    /* IO - error status                           */
+/*
+  Set elements of a table column to the appropriate null value for the column
+  The column number may refer to a real column in an ASCII or binary table, 
+  or it may refer to a virtual column in a 1 or more grouped FITS primary
+  array.  FITSIO treats a primary array as a binary table
+  with 2 vector columns: the first column contains the group parameters (often
+  with length = 0) and the second column contains the array of image pixels.
+  Each row of the table represents a group in the case of multigroup FITS
+  images.
+  
+  This routine does not do anything special in the case of COMPLEX table columns
+  (unlike the similar ffpclu routine).  This routine is mainly for use by
+  ffpcne which already compensates for the effective doubling of the number of 
+  elements in a complex column.
+*/
+{
+    int tcode, maxelem, hdutype, writemode = 2, leng;
+    short i2null;
+    INT32BIT i4null, i8null[2];
+    long twidth, incre, rownum, remain, next, ntodo;
+    long tnull, ii;
+    OFF_T repeat, startpos, elemnum, large_elem, wrtptr, rowlen;
+    double scale, zero;
+    unsigned char i1null, lognul = 0;
+    char tform[20], *cstring = 0;
+    char message[FLEN_ERRMSG];
+    char snull[20];   /*  the FITS null value  */
+    long   jbuff[2] = { -1, -1};  /* all bits set is equivalent to a NaN */
+    size_t buffsize;
 
-         for (ii = lennull; ii < nwrite; ii++)
-            cstring[ii] = ' ';  
+    if (*status > 0)           /* inherit input status value if > 0 */
+        return(*status);
+
+    if (firstelem == USE_LARGE_VALUE)
+        large_elem = large_first_elem_val;
+    else
+        large_elem = firstelem;
+
+    /*---------------------------------------------------*/
+    /*  Check input and get parameters about the column: */
+    /*---------------------------------------------------*/
+
+    /* note that writemode = 2 by default (not 1), so that the returned */
+    /* repeat and incre values will be the actual values for this column. */
+
+    /* If writing nulls to a variable length column then dummy data values  */
+    /* must have already been written to the heap. */
+    /* We just have to overwrite the previous values with null values. */
+    /* Set writemode = 0 in this case, to test that values have been written */
+
+    fits_get_coltype(fptr, colnum, &tcode, NULL, NULL, status);
+    if (tcode < 0)
+         writemode = 0;  /* this is a variable length column */
+    
+    if (ffgcpr( fptr, colnum, firstrow, large_elem, nelem, writemode, &scale,
+       &zero, tform, &twidth, &tcode, &maxelem, &startpos,  &elemnum, &incre,
+        &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0)
+        return(*status);
+
+    if (tcode == TSTRING)
+    {
+      if (snull[0] == ASCII_NULL_UNDEFINED)
+      {
+        ffpmsg(
+        "Null value string for ASCII table column is not defined (FTPCLU).");
+        return(*status = NO_NULL);
       }
+
+      /* allocate buffer to hold the null string.  Must write the entire */
+      /* width of the column (twidth bytes) to avoid possible problems */
+      /* with uninitialized FITS blocks, in case the field spans blocks */
+
+      buffsize = maxvalue(20, twidth);
+      cstring = (char *) malloc(buffsize);
+      if (!cstring)
+         return(*status = MEMORY_ALLOCATION);
+
+      memset(cstring, ' ', buffsize);  /* initialize  with blanks */
+
+      leng = strlen(snull);
+      if (hdutype == BINARY_TBL)
+         leng++;        /* copy the terminator too in binary tables */
+
+      strncpy(cstring, snull, leng);  /* copy null string to temp buffer */
+
     }
-    else if ( tcode == TBYTE ||
+    else if ( tcode == TBYTE  ||
               tcode == TSHORT ||
-              tcode == TLONG ) 
+              tcode == TLONG  ||
+              tcode == TLONGLONG) 
     {
       if (tnull == NULL_UNDEFINED)
       {
@@ -179,11 +446,23 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
          ffswap2(&i2null, 1); /* reverse order of bytes */
 #endif
       }
-      else
+      else if (tcode == TLONG)
       {
          i4null = tnull;
 #if BYTESWAPPED
          ffswap4(&i4null, 1); /* reverse order of bytes */
+#endif
+      }
+      else
+      {
+         if (tnull < 0)
+            i8null[0] = -1;
+         else
+            i8null[0] = 0;
+
+         i8null[1] = tnull;
+#if BYTESWAPPED
+         ffswap8( (double *) i8null, 1); /* reverse order of bytes */
 #endif
       }
     }
@@ -227,6 +506,12 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
                   ffpbyt(fptr, 4, &i4null, status);
                 break;
 
+            case (TLONGLONG):
+
+                for (ii = 0; ii < ntodo; ii++)
+                  ffpbyt(fptr, 8, i8null, status);
+                break;
+
             case (TFLOAT):
 
                 for (ii = 0; ii < ntodo; ii++)
@@ -247,7 +532,7 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
 
             case (TSTRING):  /* an ASCII table column */
                 /* repeat always = 1, so ntodo is also guaranteed to = 1 */
-                ffpbyt(fptr, nwrite, cstring, status);
+                ffpbyt(fptr, twidth, cstring, status);
                 break;
 
             default:  /*  error trap  */
@@ -268,6 +553,10 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
              "Error writing %ld thru %ld of null values (ffpclu).",
               next+1, next+ntodo);
            ffpmsg(message);
+
+           if (cstring)
+              free(cstring);
+
            return(*status);
         }
 
@@ -289,6 +578,10 @@ int ffpclu( fitsfile *fptr,  /* I - FITS file pointer                       */
 
     }  /*  End of main while Loop  */
 
+    if (cstring)
+       free(cstring);
+
     return(*status);
 }
 
+
diff --git a/putcolui.c b/putcolui.c
index 5d9a544..3406edf 100644
--- a/putcolui.c
+++ b/putcolui.c
@@ -27,6 +27,7 @@ int ffpprui(fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    unsigned short nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffpprui(fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TUSHORT, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppnui(fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    unsigned short nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppnui(fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TUSHORT, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -125,21 +136,25 @@ int ffp3dui(fitsfile *fptr,   /* I - FITS file pointer                     */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
       where the first column contains the group parameters
       and the second column contains the image itself.
     */
-
+           
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TUSHORT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -207,9 +222,10 @@ int ffpssui(fitsfile *fptr,   /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TUSHORT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -413,6 +429,13 @@ int ffpclui( fitsfile *fptr,  /* I - FITS file pointer                       */
               ffpi2b(fptr, ntodo, incre, (short *) buffer, status);
               break;
 
+            case (TLONGLONG):
+
+                ffu2fi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
             case (TBYTE):
  
                 ffu2fi1(&array[next], ntodo, scale, zero,
@@ -613,7 +636,7 @@ int ffpcnui(fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpclui(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
@@ -786,6 +809,124 @@ int ffu2fi4(unsigned short *input, /* I - array of values to be converted */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffu2fi8(unsigned short *input,  /* I - array of values to be converted  */
+            long ntodo,             /* I - number of elements in the array  */
+            double scale,           /* I - FITS TSCALn or BSCALE value      */
+            double zero,            /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,       /* O - output array of converted values */
+            int *status)            /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+                output[jj] = 0;
+                output[kk] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffu2fr4(unsigned short *input, /* I - array of values to be converted */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
diff --git a/putcoluj.c b/putcoluj.c
index a549ae9..af4c7fd 100644
--- a/putcoluj.c
+++ b/putcoluj.c
@@ -27,6 +27,7 @@ int ffppruj( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    unsigned long nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffppruj( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TULONG, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppnuj( fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    unsigned long nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppnuj( fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TULONG, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -125,21 +136,25 @@ int ffp3duj(fitsfile *fptr,   /* I - FITS file pointer                    */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
       where the first column contains the group parameters
       and the second column contains the image itself.
     */
-
+           
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TULONG, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -207,9 +222,10 @@ int ffpssuj(fitsfile *fptr,   /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TULONG, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -413,6 +429,13 @@ int ffpcluj( fitsfile *fptr,  /* I - FITS file pointer                       */
                 ffpi4b(fptr, ntodo, incre, (INT32BIT *) buffer, status);
                 break;
 
+            case (TLONGLONG):
+
+                ffu4fi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
             case (TBYTE):
  
                 ffu4fi1(&array[next], ntodo, scale, zero,
@@ -612,7 +635,7 @@ int ffpcnuj( fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpcluj(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
@@ -793,6 +816,124 @@ int ffu4fi4(unsigned long *input, /* I - array of values to be converted */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffu4fi8(unsigned long *input,  /* I - array of values to be converted  */
+            long ntodo,             /* I - number of elements in the array  */
+            double scale,           /* I - FITS TSCALn or BSCALE value      */
+            double zero,            /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,       /* O - output array of converted values */
+            int *status)            /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+                output[jj] = 0;
+                uoutput[kk] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffu4fr4(unsigned long *input, /* I - array of values to be converted */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
diff --git a/putcoluk.c b/putcoluk.c
index c78a66b..4d1c523 100644
--- a/putcoluk.c
+++ b/putcoluk.c
@@ -27,6 +27,7 @@ int ffppruk(fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    unsigned int nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -39,9 +40,13 @@ int ffppruk(fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_pixels(fptr, TUINT, large_first_elem_val, nelem,
+            0, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -66,6 +71,7 @@ int ffppnuk(fitsfile *fptr,  /* I - FITS file pointer                       */
 */
 {
     long row;
+    unsigned int nullvalue;
 
     /*
       the primary array is represented as a binary table:
@@ -78,9 +84,14 @@ int ffppnuk(fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
+        /* use the OFF_T variable to pass the first element value */
+        if (firstelem != USE_LARGE_VALUE)
+            large_first_elem_val = firstelem;
 
-        return(*status = DATA_COMPRESSION_ERR);
+        nullvalue = nulval;  /* set local variable */
+        fits_write_compressed_pixels(fptr, TUINT, large_first_elem_val, nelem,
+            1, array, &nullvalue, status);
+        return(*status);
     }
 
     row=maxvalue(1,group);
@@ -125,21 +136,25 @@ int ffp3duk(fitsfile *fptr,  /* I - FITS file pointer                     */
 */
 {
     long tablerow, nfits, narray, ii, jj;
-
+    long fpixel[3]= {1,1,1}, lpixel[3];
     /*
       the primary array is represented as a binary table:
       each group of the primary array is a row in the table,
       where the first column contains the group parameters
       and the second column contains the image itself.
     */
-
+           
     if (fits_is_compressed_image(fptr, status))
     {
         /* this is a compressed image in a binary table */
-
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        lpixel[0] = ncols;
+        lpixel[1] = nrows;
+        lpixel[2] = naxis3;
+       
+        fits_write_compressed_img(fptr, TUINT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     tablerow=maxvalue(1,group);
@@ -207,9 +222,10 @@ int ffpssuk(fitsfile *fptr,  /* I - FITS file pointer                       */
     {
         /* this is a compressed image in a binary table */
 
-        ffpmsg("writing to compressed image is not supported");
-
-        return(*status = DATA_COMPRESSION_ERR);
+        fits_write_compressed_img(fptr, TUINT, fpixel, lpixel,
+            0,  array, NULL, status);
+    
+        return(*status);
     }
 
     if (naxis < 1 || naxis > 7)
@@ -428,6 +444,13 @@ int ffpcluk(fitsfile *fptr,  /* I - FITS file pointer                       */
                 ffpi4b(fptr, ntodo, incre, (INT32BIT *) buffer, status);
                 break;
 
+            case (TLONGLONG):
+
+                ffuintfi8(&array[next], ntodo, scale, zero,
+                        (LONGLONG *) buffer, status);
+                ffpi8b(fptr, ntodo, incre, (long *) buffer, status);
+                break;
+
             case (TBYTE):
  
                 ffuintfi1(&array[next], ntodo, scale, zero,
@@ -629,7 +652,7 @@ int ffpcnuk(fitsfile *fptr,  /* I - FITS file pointer                       */
 
       ffpcluk(fptr, colnum, fstrow, firstelem, ngood, &array[ii-ngood], status);
     }
-    else  /* write last string of bad pixels */
+    else if (nbad) /* write last string of bad pixels */
     {
       fstelm = ii - nbad + first;  /* absolute element number */
       fstrow = (fstelm - 1) / repeat + 1;  /* starting row number */
@@ -810,6 +833,124 @@ int ffuintfi4(unsigned int *input,  /* I - array of values to be converted  */
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
+int ffuintfi8(unsigned int *input,  /* I - array of values to be converted  */
+            long ntodo,             /* I - number of elements in the array  */
+            double scale,           /* I - FITS TSCALn or BSCALE value      */
+            double zero,            /* I - FITS TZEROn or BZERO  value      */
+            LONGLONG *output,       /* O - output array of converted values */
+            int *status)            /* IO - error status                    */
+/*
+  Copy input to output prior to writing output to a FITS file.
+  Do datatype conversion and scaling if required
+*/
+{
+#if (LONGSIZE == 32) && (! defined HAVE_LONGLONG)
+
+/* don't have a native 8-byte integer, so have to construct the */
+/* 2 equivalent 4-byte integers have the same bit pattern */
+
+    unsigned long *uoutput;
+    long ii, jj, kk, temp;
+    double dvalue;
+
+    uoutput = (unsigned long *) output;
+
+#if BYTESWAPPED  /* jj points to the most significant part of the 8-byte int */
+    jj = 1;
+    kk = 0;
+#else
+    jj = 0;
+    kk = 1;
+#endif
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+                output[jj] = 0;
+                uoutput[kk] = input[ii];
+        }
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++, jj += 2, kk += 2)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MIN;
+                output[kk] = 0;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[jj] = LONG_MAX;
+                output[kk] = -1;
+            }
+            else
+            {
+                if (dvalue < 0)
+                {
+                   temp = (dvalue + 1.) / 4294967296. - 1.;
+                   output[jj] = temp;
+                   uoutput[kk] = 4294967296.  + 
+                      (dvalue - (double) (temp + 1) * 4294967296.);
+                }
+                else
+                {
+                   temp = dvalue / 4294967296.;
+                   output[jj] = temp;
+                   uoutput[kk] = dvalue - (double) temp * 4294967296.;
+                }
+            }
+        }
+    }
+
+#else
+
+/* this is the much simpler case where the native 8-byte integer exists */
+
+    long ii;
+    double dvalue;
+
+    if (scale == 1. && zero == 0.)
+    {       
+        for (ii = 0; ii < ntodo; ii++)
+                output[ii] = input[ii];
+    }
+    else
+    {
+        for (ii = 0; ii < ntodo; ii++)
+        {
+            dvalue = (input[ii] - zero) / scale;
+
+            if (dvalue < DLONGLONG_MIN)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MIN;
+            }
+            else if (dvalue > DLONGLONG_MAX)
+            {
+                *status = OVERFLOW_ERR;
+                output[ii] = LONGLONG_MAX;
+            }
+            else
+            {
+                if (dvalue >= 0)
+                    output[ii] = (LONGLONG) (dvalue + .5);
+                else
+                    output[ii] = (LONGLONG) (dvalue - .5);
+            }
+        }
+    }
+
+#endif
+
+    return(*status);
+}
+/*--------------------------------------------------------------------------*/
 int ffuintfr4(unsigned int *input,  /* I - array of values to be converted  */
             long ntodo,        /* I - number of elements in the array  */
             double scale,      /* I - FITS TSCALn or BSCALE value      */
diff --git a/putkey.c b/putkey.c
index 40bc246..f240df0 100644
--- a/putkey.c
+++ b/putkey.c
@@ -12,6 +12,7 @@
 /* stddef.h is apparently needed to define size_t */
 #include <stddef.h>
 #include "fitsio2.h"
+
 /*--------------------------------------------------------------------------*/
 int ffcrim(fitsfile *fptr,      /* I - FITS file pointer           */
            int bitpix,          /* I - bits per pixel              */
@@ -48,7 +49,7 @@ int ffcrtb(fitsfile *fptr,  /* I - FITS file pointer                        */
            char **ttype,    /* I - name of each column                      */
            char **tform,    /* I - value of TFORMn keyword for each column  */
            char **tunit,    /* I - value of TUNITn keyword for each column  */
-           char *extnm,   /* I - value of EXTNAME keyword, if any         */
+           char *extnm,     /* I - value of EXTNAME keyword, if any         */
            int *status)     /* IO - error status                            */
 /*
   Create a table extension in a FITS file. 
@@ -91,9 +92,9 @@ int ffcrtb(fitsfile *fptr,  /* I - FITS file pointer                        */
     return(*status);
 }
 /*-------------------------------------------------------------------------*/
-int ffpktp(fitsfile *fptr,      /* I - FITS file pointer       */
+int ffpktp(fitsfile *fptr,       /* I - FITS file pointer       */
            const char *filename, /* I - name of template file   */
-           int *status)         /* IO - error status           */
+           int *status)          /* IO - error status           */
 /*
   read keywords from template file and append to the FITS file
 */
@@ -180,6 +181,10 @@ int ffpky( fitsfile *fptr,     /* I - FITS file pointer        */
     {
         ffpkyj(fptr, keyname, (long) *(unsigned char *) value, comm, status);
     }
+    else if (datatype == TSBYTE)
+    {
+        ffpkyj(fptr, keyname, (long) *(signed char *) value, comm, status);
+    }
     else if (datatype == TUSHORT)
     {
         ffpkyj(fptr, keyname, (long) *(unsigned short *) value, comm, status);
@@ -253,7 +258,7 @@ int ffprec(fitsfile *fptr,     /* I - FITS file pointer        */
     if (fptr->HDUposition != (fptr->Fptr)->curhdu)
         ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
 
-    if ( ((fptr->Fptr)->datastart - (fptr->Fptr)->headend) == 80) /* only room for END card */
+    if ( ((fptr->Fptr)->datastart - (fptr->Fptr)->headend) == 80) /* no room */
     {
         nblocks = 1;
         if (ffiblk(fptr, nblocks, 0, status) > 0) /* insert 2880-byte block */
@@ -274,12 +279,12 @@ int ffprec(fitsfile *fptr,     /* I - FITS file pointer        */
 
     fftrec(tcard, status);          /* test rest of keyword for legal chars */
 
-    ffmbyt(fptr, (fptr->Fptr)->headend, IGNORE_EOF, status); /* move to end header */
+    ffmbyt(fptr, (fptr->Fptr)->headend, IGNORE_EOF, status); /* move to end */
 
     ffpbyt(fptr, 80, tcard, status);   /* write the 80 byte card */
 
     if (*status <= 0)
-       (fptr->Fptr)->headend += 80;           /* update end-of-header position */
+       (fptr->Fptr)->headend += 80;    /* update end-of-header position */
 
     return(*status);
 }
@@ -344,21 +349,20 @@ int ffpkls( fitsfile *fptr,     /* I - FITS file pointer        */
   69 characters in length.
 */
 {
-    char valstring[FLEN_VALUE];
+    char valstring[FLEN_CARD];
     char card[FLEN_CARD];
-    char tstring[FLEN_VALUE], *cptr;
+    char tstring[FLEN_CARD], *cptr;
     int next, remain, vlen, nquote, nchar, namelen, contin, tstatus = -1;
 
     if (*status > 0)           /* inherit input status value if > 0 */
         return(*status);
 
-    remain = strlen(value);    /* number of characters to write out */
-    next = 0;                  /* pointer to next character to write */
-    
+    remain = maxvalue(strlen(value), 1); /* no. of chars to write (at least 1) */    
     /* count the number of single quote characters are in the string */
+    tstring[0] = '\0';
+    strncat(tstring, value, 68); /* copy 1st part of string to temp buff */
     nquote = 0;
-    cptr = strchr(value, '\'');   /* search for quote character */
-
+    cptr = strchr(tstring, '\'');   /* search for quote character */
     while (cptr)  /* search for quote character */
     {
         nquote++;            /*  increment no. of quote characters  */
@@ -391,10 +395,12 @@ int ffpkls( fitsfile *fptr,     /* I - FITS file pointer        */
     }
 
     contin = 0;
+    next = 0;                  /* pointer to next character to write */
+
     while (remain > 0)
     {
-        strncpy(tstring, &value[next], nchar); /* copy string to temp buff */
-        tstring[nchar] = '\0';
+        tstring[0] = '\0';
+        strncat(tstring, &value[next], nchar); /* copy string to temp buff */
         ffs2c(tstring, valstring, status);  /* put quotes around the string */
 
         if (remain > nchar)   /* if string is continued, put & as last char */
@@ -426,7 +432,22 @@ int ffpkls( fitsfile *fptr,     /* I - FITS file pointer        */
         contin = 1;
         remain -= nchar;
         next  += nchar;
-        nchar = 68 - nquote;
+
+        if (remain > 0) 
+        {
+           /* count the number of single quote characters in next section */
+           tstring[0] = '\0';
+           strncat(tstring, &value[next], 68); /* copy next part of string */
+           nquote = 0;
+           cptr = strchr(tstring, '\'');   /* search for quote character */
+           while (cptr)  /* search for quote character */
+           {
+               nquote++;            /*  increment no. of quote characters  */
+               cptr++;              /*  increment pointer to next character */
+               cptr = strchr(cptr, '\'');  /* search for another quote char */
+           }
+           nchar = 68 - nquote;  /* max number of chars to write this time */
+        }
     }
     return(*status);
 }
@@ -846,9 +867,9 @@ int ffpdat( fitsfile *fptr,      /* I - FITS file pointer  */
     ffgstm(date, &timeref, status);
 
     if (timeref)           /* GMT not available on this machine */
-        tmzone[0] = '\0';
+        strcpy(tmzone, " Local");    
     else
-        strcpy(tmzone, " UTC");    
+        strcpy(tmzone, " UT");    
 
     strcpy(card, "DATE    = '");
     strcat(card, date);
@@ -1892,6 +1913,18 @@ int ffphpr( fitsfile *fptr, /* I - FITS file pointer                        */
     if ((fptr->Fptr)->headend != (fptr->Fptr)->headstart[(fptr->Fptr)->curhdu] )
         return(*status = HEADER_NOT_EMPTY);
 
+    if (naxis != 0)   /* never try to compress a null image */
+    {
+      if ( (fptr->Fptr)->request_compress_type )
+      {
+        /* write header for a compressed image */
+        imcomp_init_table(fptr, (fptr->Fptr)->request_compress_type, 
+        bitpix, naxis, naxes, (fptr->Fptr)->request_tilesize, 32,
+        (fptr->Fptr)->request_rice_nbits, status);
+        return(*status);
+      }
+    }  
+
     if ((fptr->Fptr)->curhdu == 0)
     {                /* write primary array header */
         if (simple)
@@ -1916,7 +1949,7 @@ int ffphpr( fitsfile *fptr, /* I - FITS file pointer                        */
         longbitpix = LONG_IMG;
 
     if (longbitpix != BYTE_IMG && longbitpix != SHORT_IMG && 
-        longbitpix != LONG_IMG &&
+        longbitpix != LONG_IMG && longbitpix != LONGLONG_IMG &&
         longbitpix != FLOAT_IMG && longbitpix != DOUBLE_IMG)
     {
         sprintf(message,
@@ -1991,20 +2024,12 @@ int ffphpr( fitsfile *fptr, /* I - FITS file pointer                        */
         }
 
       /* write standard block of self-documentating comments */
-      ffpcom(fptr,
-      "  FITS (Flexible Image Transport System) format defined in Astronomy and",
+      ffprec(fptr,
+      "COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy",
       status);
-
-      ffpcom(fptr,
-      "  Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365.",
-      status);
-
-      ffpcom(fptr,
-      "  Contact the NASA Science Office of Standards and Technology for the",
+      ffprec(fptr,
+      "COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H",
       status);
-
-      ffpcom(fptr,
-      "  FITS Definition document #100 and other FITS information.", status);
     }
 
     else  /* an IMAGE extension */
@@ -2281,6 +2306,8 @@ int ffphbn(fitsfile *fptr,  /* I - FITS file pointer                        */
            strcat(comm, ": 2-byte INTEGER");
         else if (datatype == TLONG)
            strcat(comm, ": 4-byte INTEGER");
+        else if (datatype == TLONGLONG)
+           strcat(comm, ": 8-byte INTEGER");
         else if (datatype == TULONG)
            strcat(comm, ": 4-byte INTEGER");
         else if (datatype == TFLOAT)
@@ -2294,7 +2321,27 @@ int ffphbn(fitsfile *fptr,  /* I - FITS file pointer                        */
         else if (datatype < 0)
            strcat(comm, ": variable length array");
 
-        if (abs(datatype) == TUSHORT) 
+        if (abs(datatype) == TSBYTE) /* signed bytes */
+        {
+           /* Replace the 'S' with an 'B' in the TFORMn code */
+           cptr = tfmt;
+           while (*cptr != 'S') 
+              cptr++;
+
+           *cptr = 'B';
+           ffpkys(fptr, name, tfmt, comm, status);
+
+           /* write the TZEROn and TSCALn keywords */
+           ffkeyn("TZERO", ii + 1, name, status);
+           strcpy(comm, "offset for signed bytes");
+
+           ffpkyg(fptr, name, -128., 0, comm, status);
+
+           ffkeyn("TSCAL", ii + 1, name, status);
+           strcpy(comm, "data are not scaled");
+           ffpkyg(fptr, name, 1., 0, comm, status);
+        }
+        else if (abs(datatype) == TUSHORT) 
         {
            /* Replace the 'U' with an 'I' in the TFORMn code */
            cptr = tfmt;
diff --git a/quick.ps b/quick.ps
new file mode 100644
index 0000000..7503d84
--- /dev/null
+++ b/quick.ps
@@ -0,0 +1,3850 @@
+%!PS-Adobe-2.0
+%%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software
+%%Title: quick.dvi
+%%Pages: 41
+%%PageOrder: Ascend
+%%BoundingBox: 0 0 596 842
+%%EndComments
+%DVIPSWebPage: (www.radicaleye.com)
+%DVIPSCommandLine: dvips -N0 quick
+%DVIPSParameters: dpi=600, compressed
+%DVIPSSource:  TeX output 2003.06.23:1300
+%%BeginProcSet: texc.pro
+%!
+/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
+N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72
+mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0
+0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{
+landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize
+mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[
+matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round
+exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{
+statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]
+N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin
+/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array
+/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2
+array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N
+df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A
+definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get
+}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}
+B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr
+1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3
+1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx
+0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx
+sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{
+rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp
+gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B
+/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{
+/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{
+A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy
+get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse}
+ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp
+fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17
+{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add
+chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{
+1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop}
+forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn
+/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put
+}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{
+bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A
+mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{
+SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{
+userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X
+1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4
+index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N
+/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{
+/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT)
+(LaserWriter 16/600)]{A length product length le{A length product exch 0
+exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse
+end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask
+grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot}
+imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round
+exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto
+fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p
+delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M}
+B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{
+p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
+rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
+
+%%EndProcSet
+TeXDict begin 39158280 55380996 1000 600 600 (quick.dvi)
+@start
+%DVIPSBitmapFont: Fa cmsy10 10.95 4
+/Fa 4 107 df<EB0FFCEB3FFF90B512C0000314F04880488048804880A2481580A3B712
+C0AA6C1580A36C1500A26C5C6C5C6C5C6C5CC614C0013F90C7FCEB0FFC22227BA72D>15
+D<153FEC03FFEC0FE0EC3F80EC7E00495A5C495AA2495AB3AA130F5C131F495A91C7FC13
+FEEA03F8EA7FE048C8FCEA7FE0EA03F8EA00FE133F806D7E130F801307B3AA6D7EA26D7E
+80EB007EEC3F80EC0FE0EC03FFEC003F205B7AC32D>102 D<12FCEAFFC0EA07F0EA01FC
+EA007E6D7E131F6D7EA26D7EB3AA801303806D7E1300147FEC1FC0EC07FEEC00FFEC07FE
+EC1FC0EC7F0014FC1301495A5C13075CB3AA495AA2495A133F017EC7FC485AEA07F0EAFF
+C000FCC8FC205B7AC32D>I<126012F0B3B3B3B3B11260045B76C319>106
+D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fb cmbx12 12 41
+/Fb 41 122 df<B612F8A91D097F9A25>45 D<EA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA
+7FFCEA3FF8EA1FF0EA07C00F0F788E1F>I<EE01C0EE03E01607A2160F17C0161F1780A2
+163F17005E167EA216FE5E15015EA215035EA215075E150F5EA2151F5E153F93C7FCA25D
+157E15FE5DA214015D14035DA214075D140F5DA2141F5D143F92C8FCA25C147EA214FE5C
+13015CA213035C13075CA2130F5C131F5CA2133F91C9FC5B137EA213FE5B12015BA21203
+5BA212075B120F5BA2121F5B123F90CAFCA25A127E12FE5AA25A12782B647ACA38>I<EC
+03C01407141F147FEB03FF133FB6FCA413C3EA0003B3B3ADB712FCA5264177C038>49
+D<ECFFE0010F13FE013F6D7E90B612E0000315F82607FC0313FE3A0FE0007FFFD81F806D
+138048C7000F13C0488001C015E001F07F00FF6E13F07F17F881A46C5A6C5A6C5AC9FC17
+F05DA217E05D17C04B13804B1300A2ED1FFC4B5A5E4B5A4B5A4A90C7FC4A5A4A5AEC0FF0
+4A5AEC3F804AC7127814FE495A494814F8D907E014F0495A495A49C8FC017C1401491403
+48B7FC4816E05A5A5A5A5AB8FC17C0A42D417BC038>I<ECFFF0010713FF011F14C0017F
+14F049C66C7ED803F8EB3FFED807E06D7E81D80FF86D138013FE001F16C07FA66C5A6C48
+15806C485BC814005D5E4B5A4B5A4B5A4A5B020F1380902607FFFEC7FC15F815FF16C090
+C713F0ED3FFCED0FFEEEFF80816F13C017E0A26F13F0A217F8A3EA0FC0EA3FF0487EA248
+7EA217F0A25D17E06C5A494913C05BD83F80491380D81FF0491300D80FFEEBFFFE6CB612
+F800015D6C6C14C0011F49C7FC010113E02D427BC038>I<163FA25E5E5D5DA25D5D5D5D
+A25D92B5FCEC01F7EC03E7140715C7EC0F87EC1F07143E147E147C14F8EB01F0EB03E013
+0714C0EB0F80EB1F00133E5BA25B485A485A485A120F5B48C7FC123E5A12FCB91280A5C8
+000F90C7FCAC027FB61280A531417DC038>I<0007150301E0143F01FFEB07FF91B6FC5E
+5E5E5E5E16804BC7FC5D15E092C8FC01C0C9FCAAEC3FF001C1B5FC01C714C001DF14F090
+39FFE03FFC9138000FFE01FC6D7E01F06D13804915C0497F6C4815E0C8FC6F13F0A317F8
+A4EA0F80EA3FE0487E12FF7FA317F05B5D6C4815E05B007EC74813C0123E003F4A1380D8
+1FC0491300D80FF0495AD807FEEBFFFC6CB612F0C65D013F1480010F01FCC7FC010113C0
+2D427BC038>I<4AB47E021F13F0027F13FC49B6FC01079038807F8090390FFC001FD93F
+F014C04948137F4948EBFFE048495A5A1400485A120FA248486D13C0EE7F80EE1E00003F
+92C7FCA25B127FA2EC07FC91381FFF8000FF017F13E091B512F89039F9F01FFC9039FBC0
+07FE9039FF8003FF17804A6C13C05B6F13E0A24915F0A317F85BA4127FA5123FA217F07F
+121FA2000F4A13E0A26C6C15C06D4913806C018014006C6D485A6C9038E01FFC6DB55A01
+1F5C010714C0010191C7FC9038003FF02D427BC038>I<121E121F13FC90B712FEA45A17
+FC17F817F017E017C0A2481680007EC8EA3F00007C157E5E00785D15014B5A00F84A5A48
+4A5A5E151FC848C7FC157E5DA24A5A14035D14074A5AA2141F5D143FA2147F5D14FFA25B
+A35B92C8FCA35BA55BAA6D5A6D5A6D5A2F447AC238>I<DCFFF01470031F01FF14F04AB6
+EAE0010207EDF803023FEDFE0791B539E001FF0F4949C7EA3F9F010701F0EC0FFF4901C0
+804990C87E4948814948814948167F4849163F4849161F5A4A160F485B19074890CAFC19
+035A5BA2007F1801A34994C7FC12FFAE127F7F1AF0A2123FA27F6C18011AE06C7F19036C
+6D17C06E16077E6C6DEE0F806C6DEE1F006D6C5E6D6C167E6D6C6C5D6D6D4A5A6D01F0EC
+07F0010101FEEC1FE06D903AFFF001FF80023F90B6C7FC020715FC020115F0DA001F1480
+030001F8C8FC44467AC451>67 D<B9FC18F018FE727E19E026003FFEC7001F13F805017F
+9438003FFF060F7F727F727F727F84737E737EA2737EA2737EA21B80A2851BC0A51BE0AD
+1BC0A51B8061A21B006162193F624F5A19FF624E5B06075B4E5B063F90C7FC4DB45A050F
+13F8BA5A19C04EC8FC18F095C9FC4B447CC356>I<BA12F8A485D8001F90C71201EF003F
+180F180318011800A2197E193EA3191EA21778A285A405F890C7FCA316011603161F92B5
+FCA5ED001F160316011600A2F101E01778A2F103C0A494C7FC1907A21A80A2190FA2191F
+A2193FF17F0061601807181F4DB5FCBBFC61A443447DC34A>I<BA1280A419C026003FFE
+C7121F1701EF007F183F181F180F180719E01803A31801A3EE01E0F000F0A419001603A3
+1607160F167F91B6FCA59138FE007F160F16071603A31601A693C9FCAFB712F0A53C447C
+C346>I<B7D88003B612FEA526003FFEC9EBF800B3A791B9FCA54AC9FCB3AAB7D88003B6
+12FEA54F447CC358>72 D<B712E0A5D8001F90C7FCB3B3B3A4B712E0A523447DC32A>I<
+B76C0103B512F8A526003FFEC93807E0004F5A4F5A077EC7FC614E5A4E5A4E5AF01F804E
+C8FC187E604D5AEF07F0EF0FC04D5A4DC9FC177E4C5AEE03F04C5A4C5A4C7EEE7FF04C7E
+5D4B7F4B7F4B7FED3F3FDB7E1F7F03FC806E486C7F4B7E4B6C7F0380804B6C7F4A7F717E
+84717F83717F85717F83717F85717F187F727E86727F84727F86727F84B76C90B612FCA5
+4E447CC358>75 D<B64BB512FE8181A281D8003F6D91C7EA780081013D7F81133C6E7E6E
+7F6E7F6E7F6E7F82806E7F6E7F6F7E6F7F83816F7F6F7F6F7F6F7F6F7F8382707F707F70
+7F707F8482707F707F717E7113807113C019E0837113F07113F87113FC7113FE19FF8472
+13F884848484A28484197F193F191FA2190F1907B61603190119001A78A24F447CC358>
+78 D<923807FFC092B512FE0207ECFFC0021F15F091267FFE0013FC902601FFF0EB1FFF
+01070180010313C04990C76C7FD91FFC6E6C7E49486F7E49486F7E01FF8348496F7E4849
+6F1380A248496F13C0A24890C96C13E0A24819F04982003F19F8A3007F19FC49177FA400
+FF19FEAD007F19FC6D17FFA3003F19F8A26D5E6C19F0A26E5D6C19E0A26C6D4B13C06C19
+806E5D6C6D4B13006C6D4B5A6D6C4B5A6D6C4B5A6D6C4A5B6D01C001075B6D01F0011F5B
+010101FE90B5C7FC6D90B65A023F15F8020715C002004AC8FC030713C047467AC454>I<
+B812F8EFFFC018F818FE727ED8001F90C7003F13E005037F05007F727E727E727EA28684
+A286A762A24E90C7FCA24E5A61187F943801FFF005075B053F138092B7C8FC18F818E018
+F892C77FEF3FFF050F7F717F717FA2717FA2717FA785A61B0F85A2187F73131F72141EB7
+00E06DEB803E72EBE0FC72EBFFF8060114F0726C13E0CC0007138050457DC354>82
+D<003FBA12E0A59026FE000FEB8003D87FE09338003FF049171F90C71607A2007E180300
+7C1801A300781800A400F819F8481978A5C81700B3B3A20107B8FCA545437CC24E>84
+D<B76C010FB512F8A526003FFEC93803E000B3B3A9011F17076280190F6D606F151F6D95
+C7FC6D6D5D197E6D6D5D6D6D1403DA7FFC4A5A6EB4EC3FF0020F9039F003FFE06E90B612
+80020193C8FC6E6C14FC030F14E09226007FFEC9FC4D457CC356>I<903801FFE0011F13
+FE017F6D7E48B612E03A03FE007FF84848EB1FFC6D6D7E486C6D7EA26F7FA36F7F6C5A6C
+5AEA00F090C7FCA40203B5FC91B6FC1307013F13F19038FFFC01000313E0000F1380381F
+FE00485A5B127F5B12FF5BA35DA26D5B6C6C5B4B13F0D83FFE013EEBFFC03A1FFF80FC7F
+0007EBFFF86CECE01FC66CEB8007D90FFCC9FC322F7DAD36>97 D<EB7FC0B5FCA512037E
+B1ED0FF892B57E02C314E002CF14F89139DFC03FFC9139FF000FFE02FCEB03FF4A6D1380
+4A15C04A6D13E05CEF7FF0A218F8173FA318FCAC18F8A2177F18F0A3EFFFE06E15C06E5B
+6E491380027C491300496C495A903AFC1FC07FFC496CB512F0D9F00314C049C691C7FCC8
+EA1FF036467DC43E>I<EE03FEED07FFA5ED001F160FB1EC3FE0903803FFFC010FEBFF8F
+013F14CF9039FFF807FF48EBC00148903880007F4890C7123F4848141F49140F121F485A
+A3127F5BA212FFAC127FA37F123FA26C6C141FA26C6C143F0007157F6C6C91B5FC6CD9C0
+0314FC6C9038F01FEF6DB5128F011FEBFE0F010713F89026007FC0EBF80036467CC43E>
+100 D<EC3FF80103B57E010F14E0013F8090397FF83FF89039FFC007FC48496C7E48496C
+7E48486D1380485A001FED7FC05B003FED3FE0A2127F5B17F0161F12FFA290B7FCA401F0
+C9FCA5127FA27FA2123F17F06C7E16016C6C15E06C6C14036C6DEB07C06C6DEB0F806C01
+F0EB3F0090397FFE01FE011FB55A010714F0010114C09026001FFEC7FC2C2F7DAD33>I<
+DAFFE0137E010F9039FE03FF80013FEBFF8F90B812C048D9C07F133F489038001FF84848
+EB0FFC4848903907FE1F80001F9238FF0F00496D90C7FCA2003F82A8001F93C7FCA26D5B
+000F5D6C6C495A6C6C495A6C9038C07FF04890B55A1680D8078F49C8FC018013E0000F90
+CAFCA47F7F7F90B612C016FC6CEDFF8017E06C826C16FC7E000382000F82D81FF0C77ED8
+3FC014074848020113808248C9FC177FA46D15FF007F17006D5C6C6C4A5A6C6C4A5AD80F
+FEEC3FF83B07FFC001FFF0000190B612C06C6C92C7FC010F14F8D9007F90C8FC32427DAC
+38>103 D<137C48B4FC4813804813C0A24813E0A56C13C0A26C13806C1300EA007C90C7
+FCAAEB7FC0EA7FFFA512037EB3AFB6FCA518467CC520>105 D<EB7FC0B5FCA512037EB3
+B3B3A3B61280A519457CC420>108 D<90277F8007FEEC0FFCB590263FFFC090387FFF80
+92B5D8F001B512E002816E4880913D87F01FFC0FE03FF8913D8FC00FFE1F801FFC0003D9
+9F009026FF3E007F6C019E6D013C130F02BC5D02F86D496D7EA24A5D4A5DA34A5DB3A7B6
+0081B60003B512FEA5572D7CAC5E>I<90397F8007FEB590383FFF8092B512E0028114F8
+913987F03FFC91388F801F000390399F000FFE6C139E14BC02F86D7E5CA25CA35CB3A7B6
+0083B512FEA5372D7CAC3E>I<EC1FFC49B512C0010714F0011F14FC90397FF80FFF9026
+FFC0017F48496C7F4848C7EA3FE000078248486E7E49140F001F82A2003F82491407007F
+82A400FF1780AA007F1700A46C6C4A5AA2001F5E6D141F000F5E6C6C4A5AA26C6C6CEBFF
+E06C6D485B27007FF80F90C7FC6DB55A010F14F8010114C09026001FFCC8FC312F7DAD38
+>I<90397FC00FF8B590B57E02C314E002CF14F89139DFC03FFC9139FF001FFE000301FC
+EB07FF6C496D13804A15C04A6D13E05C7013F0A2EF7FF8A4EF3FFCACEF7FF8A318F017FF
+A24C13E06E15C06E5B6E4913806E4913006E495A9139DFC07FFC02CFB512F002C314C002
+C091C7FCED1FF092C9FCADB67EA536407DAC3E>I<90387F807FB53881FFE0028313F002
+8F13F8ED8FFC91389F1FFE000313BE6C13BC14F8A214F0ED0FFC9138E007F8ED01E092C7
+FCA35CB3A5B612E0A5272D7DAC2E>114 D<90391FFC038090B51287000314FF120F381F
+F003383FC00049133F48C7121F127E00FE140FA215077EA27F01E090C7FC13FE387FFFF0
+14FF6C14C015F06C14FC6C800003806C15806C7E010F14C0EB003F020313E0140000F014
+3FA26C141F150FA27EA26C15C06C141FA26DEB3F8001E0EB7F009038F803FE90B55A00FC
+5CD8F03F13E026E007FEC7FC232F7CAD2C>I<EB01E0A51303A41307A2130FA2131FA213
+3F137F13FF1203000F90B51280B7FCA4C601E0C7FCB3A3ED01E0A9150302F013C0137F15
+0790393FF80F8090391FFC1F006DB5FC6D13FC01015B9038003FE023407EBE2C>I<D97F
+C049B4FCB50103B5FCA50003EC000F6C81B3A85EA25EA25E7E6E491380017FD901F713FE
+9138F807E76DB512C7010F1407010313FE9026007FF0EBFC00372E7CAC3E>I<B6903803
+FFFCA5000101E09038003E006C163C80017F5D8017F8013F5D6E1301011F5D6E1303010F
+5D6E13076D5DED800F6D92C7FC15C05E6DEBE01E163E6D143CEDF07C027F1378EDF8F802
+3F5B15FD021F5B15FF6E5BA36E5BA26E90C8FCA26E5AA26E5AA21578362C7EAB3B>I<B5
+D8FE1FB539801FFFF0A500019027C0003FE0C7EA7C007114786E17F86C6F6C5C6E160101
+7F6E6C5CA26E011F1403013F6F5C6E013F1407011F6F5CA26E0179140F010F048090C7FC
+6E01F95C6D02F0EBC01E15806D902681E07F5B18E003C3157C6D9139C03FF07815E76DDA
+801F5B18F803FF14F96E9039000FFDE018FF6E486D5BA36E486D5BA26E486D90C8FCA24B
+7F02075DA26E48147C4B143C4C2C7EAB51>I<B500FE90383FFFF0A5C601F0903803E000
+6D6C495A013F4A5A6D6C49C7FC6E5B6D6C137E6DEB807C6D6D5A6DEBC1F0EDE3E06DEBF7
+C06EB45A806E90C8FC5D6E7E6E7F6E7FA24A7F4A7F8291381F3FFCEC3E1F027C7F4A6C7E
+49486C7F01036D7F49487E02C08049486C7F49C76C7E013E6E7E017E141FB500E090B512
+FCA5362C7EAB3B>I<B6903803FFFCA5000101E09038003E006C163C80017F5D8017F801
+3F5D6E1301011F5D6E1303010F5D6E13076D5DED800F6D92C7FC15C05E6DEBE01E163E6D
+143CEDF07C027F1378EDF8F8023F5B15FD021F5B15FF6E5BA36E5BA26E90C8FCA26E5AA2
+6E5AA21578A215F85D14015D001F1303D83F805B387FC007D8FFE05B140F92C9FC5C143E
+495A387FC1F8EB07F06CB45A6C5B000790CAFCEA01FC36407EAB3B>I
+E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fc cmtt10 10.95 94
+/Fc 94 127 df<121C127FEAFF80B3EA7F00B2123EC7FCA8121C127FA2EAFF80A3EA7F00
+A2121C09396DB830>33 D<00101304007C131F00FEEB3F80A26C137FA248133FB2007E14
+00007C7F003C131E00101304191C75B830>I<903907C007C0A2496C487EA8011F131FA2
+02C05BA3007FB7FCA2B81280A36C16006C5D3A007F807F80A2020090C7FCA9495BA2003F
+90B512FE4881B81280A36C1600A22701FC01FCC7FCA300031303A201F85BA76C486C5AA2
+29387DB730>I<1438147C14FCA4EB03FF011F13E090B512FC4880000780481580261FFE
+FD13C09039F0FC3FE0D83FC0131FD87F80EB0FF001001307007E15F800FE14035A1507A3
+6CEC03F0A2007F91C7FC138013C0EA3FF0EA1FFE13FF6C13FF6C14E0000114F86C6C7F01
+1F7F01037F0100148002FD13C09138FC7FE0151FED0FF015070018EC03F8127E1501B4FC
+A35AA26CEC03F07E01801307ED0FE0D83FC0131F01F0EB7FC0D81FFEB512806CB612006C
+5C6C5CC614F0013F13C0D907FEC7FCEB00FCA5147C143825477BBE30>I<D803C0EB01E0
+D80FF01303486C497E487E150F487ED87E7E495AEAFE7F5E486C133FA25E157FA24BC7FC
+6C5A5D387E7E01EA7FFED83FFC5B1403EA1FF86C48485AEA03C0C75B140FA25D141FA24A
+5AA25D147FA292C8FC5CA2495AA25C1303A25C1307A290390FF001E0ED07F84A487E011F
+497EA24A487E133F163F90267F807F1380ED7E1F14005BA25B1201A24848EB7F3F033F13
+004914FF12076F5A5B6F5A6C486D5A0001EC01E029477DBE30>I<EB07E0EB1FF8497E13
+7F497E803801FC7F497E810003131F13F0A6143F92C8FC91387F0FFF9026F87E1F138000
+0113FEEBF9FC13FB4A6C1300D9FFF013C06C13E0151F02C05BEB7F809038FF003F4892C7
+FC485C48EB807E5A15FE391FDFC0FC383F8FE014E1397F07F1F8EB03F300FEEBFBF0EB01
+FF5D7FEDC006027F130F91393F801F8015C06C137F6CEBFFE049EBF83F018701FC130026
+3FFFFBB5FC6C01F15B14E06C9038C03FFC00039038001FF8D801FCEB07E0293A7DB830>
+I<EA07C0EA0FF0EA1FF8A213FCA213FE120F1207EA007EA513FE13FCA2120113F81203EA
+07F0120FEA1FE0127FEAFFC013801300127C12380F1D70B730>I<141E147F14FF5BEB03
+FEEB07FCEB0FF0EB1FE0EB3FC0EB7F80EBFF00485A5B12035B485A120F5BA2485AA2123F
+5BA2127F90C7FCA412FEAD127FA47F123FA27F121FA26C7EA27F12076C7E7F12017F6C7E
+EB7F80EB3FC0EB1FE0EB0FF0EB07FCEB03FEEB01FF7F147F141E184771BE30>I<127812
+FE7E7F6C7E6C7EEA0FF06C7E6C7E6C7E6C7EEB7F80133F14C0131FEB0FE014F01307A2EB
+03F8A214FC1301A214FE1300A4147FAD14FEA4130114FCA2130314F8A2EB07F0A2130F14
+E0EB1FC0133F1480137FEBFF00485A485A485A485AEA3FE0485A485A90C7FC5A12781847
+78BE30>I<14E0497E497EA60038EC0380007EEC0FC0D8FF83EB3FE001C3137F9038F3F9
+FF267FFBFB13C06CB61280000FECFE00000314F86C5C6C6C13C0011F90C7FC017F13C048
+B512F04880000F14FE003FECFF80267FFBFB13C026FFF3F913E09038C3F87F0183133FD8
+7E03EB0FC00038EC0380000091C7FCA66D5A6D5A23277AAE30>I<143EA2147FAF007FB7
+FCA2B81280A36C1600A2C76CC8FCAF143EA229297DAF30>I<EA03E0EA0FF0EA1FF813FC
+EA3FFEA213FFA27EA27E1203EA007FA2137E13FEEA01FC1203EA07F8EA3FF0127FEAFFE0
+EA7F801300123C1019708B30>I<007FB612F0A2B712F8A36C15F0A225077B9E30>I<120F
+EA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F000C0C6E8B30>I<16F01501ED03F8A2
+1507A2ED0FF0A2ED1FE0A2ED3FC0A2ED7F80A2EDFF00A24A5AA25D1403A24A5AA24A5AA2
+4A5AA24A5AA24A5AA24AC7FCA2495AA25C1303A2495AA2495AA2495AA2495AA2495AA249
+C8FCA2485AA25B1203A2485AA2485AA2485AA2485AA2485AA248C9FCA25AA2127CA22547
+7BBE30>I<14FE903807FFC0497F013F13F8497F90B57E48EB83FF4848C6138049137F48
+48EB3FC04848EB1FE049130F001F15F0491307A24848EB03F8A290C712014815FCA400FE
+EC00FEAD6C14016C15FCA36D1303003F15F8A26D1307001F15F0A26D130F6C6CEB1FE0A2
+6C6CEB3FC06C6CEB7F806D13FF2601FF8313006CEBFFFE6D5B6D5B010F13E06D5BD900FE
+C7FC273A7CB830>I<EB03C0497EA2130FA2131FA2133F137F13FF1203123FB5FCA213EF
+138FEA7E0F1200B3B0003FB512F84814FCB612FEA26C14FC6C14F81F3977B830>I<EB07
+FC90383FFFC090B512F00003804814FE4880261FF80F1380263FE00113C09038C0007F48
+48EB3FE090C7121FED0FF04814075A6C15F81503A3127E1218C8FCA2150716F0150F16E0
+151F16C0153FED7F8015FF4A13005DEC07FC4A5A4A5A4A5A4A5A4A5A4990C7FC495A495A
+EB0FF0EB3FE0495A495A4890C8FC4848EB01F04848EB03F8485AEA1FE048B6FCB7FCA37E
+6C15F025397BB830>I<EB03FF013F13E090B512F84814FE4880481580260FFE0113C090
+38F0007F4848EB1FE0150F16F01507A26C5A6C5AC8FC150F16E0A2151FED3FC0157FEDFF
+8002071300903807FFFE495B5D8115FF6D1480D9000113C09138003FE0ED1FF0ED07F815
+0316FC150116FE1500A21218127EB4FCA2150116FC4814036C15F86C6C13076DEB1FF0D8
+3FF0133F3A1FFE01FFE06CB612C06C15806CECFE00C65C013F13F001031380273A7CB830
+>I<EC03FC4A7E140F141FA2143F147F157E14FEA2EB01FCEB03F8A2EB07F0A2EB0FE0EB
+1FC0A2EB3F80A2EB7F0013FEA2485A485AA2485AA2485A485AA2485AA248C7FC12FEB8FC
+1780A46C1600C8007EC7FCAA91387FFFFE91B6FCA46E5B29397DB830>I<000FB6128048
+15C05AA316800180C8FCAEEB83FF019F13C090B512F015FC8181D9FE0313809039F0007F
+C049133F0180EB1FE06CC7120F000E15F0C81207A216F81503A31218127EA2B4FC150716
+F048140F6C15E06C141F6DEB3FC06D137F3A3FE001FF80261FFC0F13006CB55A6C5C6C5C
+6C14E06C6C1380D90FFCC7FC25397BB730>I<EC0FF8EC7FFF49B51280010714E0131F49
+14F090387FF80F9039FFC007F84813803803FE005B485A4848EB03F0ED01E0484890C7FC
+5B123F5BA2127FEB000C903803FFE0010F13F8D8FF3F13FE48B6FCB7128016C09039FE00
+7FE001F8EB1FF001E0130F49EB07F849EB03FCA290C7120116FE1500A37EA46C7E15016D
+14FC121F6D1303000FEC07F86D130F6C6CEB1FF06DEB3FE03A03FF81FFC06C90B512806C
+15006D5B011F13F8010713E001011380273A7CB830>I<127CB712FC16FEA416FC48C7EA
+0FF816F0ED1FE0007CEC3FC0C8EA7F80EDFF00A24A5A4A5A5D14075D140F5D4A5AA24A5A
+A24AC7FCA25C5C13015CA213035CA213075CA4495AA6131F5CA96D5A6DC8FC273A7CB830
+>I<49B4FC011F13F0017F13FC90B57E0003ECFF804815C048010113E03A1FF8003FF049
+131FD83FC0EB07F8A24848EB03FC90C71201A56D1303003F15F86D13076C6CEB0FF06C6C
+EB1FE0D807FCEB7FC03A03FF83FF806C90B512006C6C13FC011F13F0497F90B512FE4880
+2607FE0013C0D80FF8EB3FE0D81FE0EB0FF04848EB07F8491303007F15FC90C712014815
+FE481400A66C14016C15FC6D1303003F15F86D1307D81FF0EB1FF06D133F3A0FFF01FFE0
+6C90B512C06C1580C6ECFE006D5B011F13F0010190C7FC273A7CB830>I<49B4FC010F13
+E0013F13F890B57E4880488048010113803A0FFC007FC0D81FF0EB3FE04848131F49EB0F
+F048481307A290C7EA03F85A4815FC1501A416FEA37E7E6D1303A26C6C13076C6C130F6D
+133FD80FFC13FF6CB6FC7E6C14FE6C14F9013FEBE1FC010F138190380060011400ED03F8
+A2150716F0150F000F15E0486C131F486CEB3FC0157FEDFF804A1300EC07FE391FF01FFC
+90B55A6C5C6C5C6C1480C649C7FCEB3FF0273A7CB830>I<120FEA3FC0EA7FE0A2EAFFF0
+A4EA7FE0A2EA3FC0EA0F00C7FCAF120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F
+000C276EA630>I<EA03C0EA0FF0EA1FF8A2EA3FFCA4EA1FF8A2EA0FF0EA03C0C7FCAFEA
+03C0EA0FF0121F13F8123F13FCA3121FA2120F12031200120113F8120313F01207EA1FE0
+123FEA7FC0EAFF80EA7F00127E12380E3470A630>I<16F01503ED07F8151F157FEDFFF0
+14034A13C0021F138091383FFE00ECFFF8495B010713C0495BD93FFEC7FC495A3801FFF0
+485B000F13804890C8FCEA7FFC5BEAFFE05B7FEA7FF87FEA1FFF6C7F000313E06C7F3800
+7FFC6D7E90380FFF806D7F010113F06D7FEC3FFE91381FFF80020713C06E13F01400ED7F
+F8151F1507ED03F01500252F7BB230>I<007FB7FCA2B81280A36C16006C5DCBFCA7003F
+B612FE4881B81280A36C1600A229157DA530>I<1278127EB4FC13C07FEA7FF813FEEA1F
+FF6C13C000037F6C13F86C6C7EEB1FFF6D7F010313E06D7F9038007FFC6E7E91380FFF80
+6E13C0020113F080ED3FF8151F153FEDFFF05C020713C04A138091383FFE004A5A903801
+FFF0495B010F13804990C7FCEB7FFC48485A4813E0000F5B4890C8FCEA7FFE13F8EAFFE0
+5B90C9FC127E1278252F7BB230>I<EB1FFE90B512E0000314F8000F14FE488048158026
+7FF80313C09038C0007F48C7121F16E0150FA3127E151F0018EC7FC0C812FF020313804A
+13004A5AEC1FF84A5AEC7FC04A5A92C7FC495AA2495A5CA213075CA86D5A90C9FCA8EB01
+C0EB07F0A2497EA36D5AA2EB01C023397AB830>I<EC1FE0ECFFF8010313FE010F7F4914
+804914C090397FF03FE09038FF800F4890380007F0D803FC13033A07F801FBF89038F007
+FF380FE01F4A13FCEA1FC0495A003FEBFF0F903800FE07903901FC03FE007FEBF801EA7E
+03ECF000A2EAFE0700FC49137EAA00FE6D13FED87E0314FCA2ECF801D87F0114F8003FEB
+FC03903900FE07F0903880FF0F001F90387FFFE06D6C13C0EA0FE06E13803A07F007FE00
+9038F801F86C6CC7127C6CB414FE6CEB800390387FF01F6DB512FC6D14F86D14E0010314
+C00100EBFE00EC1FF0273A7CB830>I<147F4A7EA2497FA4497F14F7A401077F14E3A301
+0F7FA314C1A2011F7FA490383F80FEA590387F007FA4498049133F90B6FCA34881A39038
+FC001F00038149130FA4000781491307A2D87FFFEB7FFFB56CB51280A46C496C13002939
+7DB830>I<007FB512F0B612FE6F7E82826C813A03F8001FF815076F7E1501A26F7EA615
+015EA24B5A1507ED1FF0ED7FE090B65A5E4BC7FC6F7E16E0829039F8000FF8ED03FC6F7E
+1500167FA3EE3F80A6167F1700A25E4B5A1503ED1FFC007FB6FCB75A5E16C05E6C02FCC7
+FC29387EB730>I<91387F803C903903FFF03E49EBFC7E011F13FE49EBFFFE5B9038FFE0
+7F48EB801F3903FE000F484813075B48481303A2484813015B123F491300A2127F90C8FC
+167C16005A5AAC7E7EA2167C6D14FE123FA27F121F6D13016C6C14FCA26C6CEB03F86D13
+076C6CEB0FF03901FF801F6C9038E07FE06DB512C06D14806D1400010713FC6D13F09038
+007FC0273A7CB830>I<003FB512E04814FCB67E6F7E6C816C813A03F8007FF0ED1FF815
+0F6F7E6F7E15016F7EA2EE7F80A2163F17C0161FA4EE0FE0AC161F17C0A3163F1780A216
+7F17005E4B5A15034B5A150F4B5AED7FF0003FB65A485DB75A93C7FC6C14FC6C14E02B38
+7FB730>I<007FB7FCB81280A47ED803F8C7123FA8EE1F0093C7FCA4157C15FEA490B5FC
+A6EBF800A4157C92C8FCA5EE07C0EE0FE0A9007FB7FCB8FCA46C16C02B387EB730>I<00
+3FB712804816C0B8FCA27E7ED801FCC7121FA8EE0F8093C7FCA5153E157FA490B6FCA690
+38FC007FA4153E92C8FCAE383FFFF8487FB5FCA27E6C5B2A387EB730>I<02FF13F00103
+EBC0F8010F13F1013F13FD4913FF90B6FC4813C1EC007F4848133F4848131F49130F485A
+491307121F5B123F491303A2127F90C7FC6F5A92C8FC5A5AA892B5FC4A14805CA26C7F6C
+6D1400ED03F8A27F003F1407A27F121F6D130F120F7F6C6C131FA2D803FE133F6C6C137F
+ECC1FF6C90B5FC7F6D13FB010F13F30103EBC1F0010090C8FC293A7DB830>I<3B3FFF80
+0FFFE0486D4813F0B56C4813F8A26C496C13F06C496C13E0D803F8C7EAFE00B290B6FCA6
+01F8C7FCB3A23B3FFF800FFFE0486D4813F0B56C4813F8A26C496C13F06C496C13E02D38
+7FB730>I<007FB6FCB71280A46C1500260007F0C7FCB3B3A8007FB6FCB71280A46C1500
+213879B730>I<49B512F04914F85BA27F6D14F090C7EAFE00B3B3123C127EB4FCA24A5A
+1403EB8007397FF01FF86CB55A5D6C5C00075C000149C7FC38003FF025397AB730>I<D8
+3FFF90380FFF80486D4813C0B56C5AA26C497E6C496C1380D803F0903803F8004B5A4B5A
+151F4B5A5E4BC7FC15FE14014A5A5D4A5A4A5A141F5D4A5A4AC8FC5C13F18101F37F13F7
+90B57E14EFECC7F01483EC03F8140101FE7F496C7E5B157F497F82151F82150F826F7EA2
+6F7E1501821500D83FFF903803FFC0486D4813E0B56C5AA26C497E6C496C13C02B387FB7
+30>I<383FFFF8487FB57EA26C5B6C5BD801FCC9FCB3B0EE0F80EE1FC0A9003FB7FC5AB8
+FCA27E6C16802A387EB730>I<D83FF8ECFFE0486C4913F0486C4913F8A2007F16F06C6C
+4913E00007160001EF14BFEC800FA39039E7C01F3FA4ECE03F01E3133EA2ECF07EA201E1
+137CA2ECF8FCA201E013F8A214FDEC7DF0A3147FEC3FE0A3EC1FC0A2EC070091C7FCADD8
+3FFC903801FFE0486C4913F0B54913F8A26C486D13F06C486D13E02D387FB730>I<D83F
+FC90381FFF80486C4913C0B54913E0A26C6D6C13C06C6E13800003913801F800EBF7C0A3
+EBF3E0A314F013F1A214F8A213F014FCA2147C147EA2143E143FA2141FA21581A2140F15
+C1A2140715E1A2140315F1A21401A215F91400A3157DA3153FEA3FFF481380B5EAC01FA2
+6CEB800F6C496C5A2B387EB730>I<90383FFFE048B512FC000714FF4815804815C04815
+E0EBF80001E0133FD87F80EB0FF0A290C71207A44815F8481403B3A96C1407A26C15F0A3
+6D130FA26D131F6C6CEB3FE001F813FF90B6FC6C15C06C15806C1500000114FCD8003F13
+E0253A7BB830>I<007FB512F0B612FE6F7E16E0826C813903F8003FED0FFCED03FE1501
+6F7EA2821780163FA6167F17005EA24B5A1503ED0FFCED3FF890B6FC5E5E16804BC7FC15
+F001F8C9FCB0387FFFC0B57EA46C5B29387EB730>I<90383FFFE048B512FC000714FF48
+15804815C04815E0EBF80001E0133F4848EB1FF049130F90C71207A44815F8481403B3A8
+147E14FE6CEBFF076C15F0EC7F87A2EC3FC7018013CF9038C01FFFD83FE014E0EBF80F90
+B6FC6C15C06C15806C1500000114FCD8003F7FEB00016E7EA21680157F16C0153F16E015
+1F16F0150FED07E025467BB830>I<003FB57E4814F0B612FC15FF6C816C812603F8017F
+9138003FF0151F6F7E15071503821501A515035E1507150F4B5A153F4AB45A90B65A5E93
+C7FC5D8182D9F8007FED3FE0151F150F821507A817F8EEF1FCA53A3FFF8003FB4801C0EB
+FFF8B56C7E17F06C496C13E06C49EB7FC0C9EA1F002E397FB730>I<90390FF803C0D97F
+FF13E048B512C74814F74814FF5A381FF80F383FE001497E4848137F90C7123F5A48141F
+A2150FA37EED07C06C91C7FC7F7FEA3FF0EA1FFEEBFFF06C13FF6C14E0000114F86C8001
+1F13FF01031480D9003F13C014019138007FE0151FED0FF0A2ED07F8A2007C140312FEA5
+6C140716F07F6DEB0FE06D131F01F8EB3FC001FF13FF91B51280160000FD5CD8FC7F13F8
+D8F81F5BD878011380253A7BB830>I<003FB712C04816E0B8FCA43AFE003F800FA8007C
+ED07C0C791C7FCB3B1011FB5FC4980A46D91C7FC2B387EB730>I<3B7FFFC007FFFCB56C
+4813FEA46C496C13FCD803F8C7EA3F80B3B16D147F00011600A36C6C14FE6D13016D5CEC
+800390393FE00FF890391FF83FF06DB55A6D5C6D5C6D91C7FC9038007FFCEC1FF02F3980
+B730>I<D87FFE90380FFFC0B54913E06E5AA24A7E6C486D13C0D807F0903801FC00A26D
+130300035DA46C6C495AA46C6C495AA46D131F6D5CA3EC803F013F5CA46D6C48C7FCA490
+380FE0FEA401075B14F1A301035BA314FB01015BA314FFA26D5BA46E5A6E5A2B397EB730
+>I<D83FFC903801FFE0486C4913F000FF16F8A2007F16F06C486D13E0D81FC09038001F
+C0000F1680A76D143F00071600A7000390380F803E9039F01FC07EEC3FE0A3EC7FF0A214
+7D0001157CA29039F8FDF8FCA314F8A300005D01F913FCA2ECF07CA201FD137DA2017D5C
+ECE03DA3017F133FA2ECC01FA2013F5CA2EC800F6D486C5A2D397FB730>I<3A3FFF01FF
+F84801837F02C77FA202835B6C01015B3A01FC007F806D91C7FC00005C6D5BEB7F01EC81
+FCEB3F8314C3011F5B14E7010F5B14FF6D5BA26D5BA26D5BA26D90C8FCA4497FA2497FA2
+815B81EB0FE781EB1FC381EB3F8181EB7F0081497F49800001143F49800003141F498000
+07140FD87FFEEB7FFFB590B5128080A25C6C486D130029387DB730>I<D87FFF90381FFF
+C0B56C4813E0A46C496C13C0D803F8903803F8006D1307A26C6C495AA26C6C5C151F6D5C
+EC803F013F5CECC07F011F91C7FCA290380FE0FEA214F101075BA2903803FBF8A201015B
+14FF6D5BA26E5AA36E5AB1903803FFF8497F497FA26D5B6D5B2B387EB730>I<001FB612
+FC4815FE5AA490C7EA03FCED07F816F0150FED1FE016C0153FED7F80003E1500C85A4A5A
+5D14034A5A5D140F4A5A5D143F4A5A92C7FC5C495A5C1303495A5C130F495A5C133F495A
+91C8FC5B4848147C4914FE1203485A5B120F485A5B123F485A90B6FCB7FCA46C15FC2738
+7CB730>I<007FB5FCB61280A4150048C8FCB3B3B3A5B6FC1580A46C140019476DBE30>I<
+127CA212FEA27EA26C7EA26C7EA26C7EA26C7EA26C7EA26C7EA212017FA26C7EA26D7EA2
+6D7EA26D7EA26D7EA26D7EA26D7EA2130180A26D7EA26E7EA26E7EA26E7EA26E7EA26E7E
+A26E7EA2140181A26E7EA2ED7F80A2ED3FC0A2ED1FE0A2ED0FF0A2ED07F8A21503A2ED01
+F0150025477BBE30>I<007FB5FCB61280A47EC7123FB3B3B3A5007FB5FCB6FCA46C1400
+19477DBE30>I<1307EB1FC0EB7FF0497E000313FE000FEBFF80003F14E0D87FFD13F039
+FFF07FF8EBC01FEB800F38FE0003007CEB01F00010EB00401D0E77B730>I<007FB612F0
+A2B712F8A36C15F0A225077B7D30>I<1338137CEA01FE12031207EA0FFC13F0EA1FE013
+C0EA3F8013005A127EA212FE5AA5EAFFC013E013F0127FA2123FA2EA1FE0EA07C00F1D70
+BE30>I<EB7FF80003B5FC4814C04880488048809038E01FFC9038C003FE14016E7E6C48
+7F6CC77FC8123FA491B5FC130F137F48B6FC12075A48EB803F383FF800EA7FE0138048C7
+FC5AA4157F7E6C6C13FFEBC003263FF01FEBFF8090B712C07E6C14EF000314876CD9FE01
+138026003FE0C8FC2A2A7BA830>I<EA3FFC487E12FFA2127F123F1200AAEC03FE91381F
+FF80027F13E091B57E90B612FC82ECFE079138F001FF4A6C13804A137F4AEB3FC091C712
+1F17E049140FA217F01607A8160FA217E07F161F6EEB3FC0A26EEB7F806E13FFDAF00313
+009138FC0FFE91B55A5E495CD97E7F13C0D93C1F90C7FC90380003FC2C3980B730>I<EC
+FFE0010713FC011F7F017F7F90B612804815C048EB807F3907FC003F485A485A49EB1F80
+4848EB0F004990C7FC127F90C9FCA25A5AA87E7EA27F003FEC07C06DEB0FE06C7E6D131F
+6C6C14C0D807FE133F9039FFC0FF806C90B5FCC615006D5B011F13F801075B0101138023
+2A7AA830>I<913801FFE04A7F5CA28080EC0007AAEB03FE90381FFF874913E790B6FC5A
+5A481303380FFC00D81FF0133F49131F485A150F4848130790C7FCA25AA25AA87E6C140F
+A27F003F141F6D133F6C7E6D137F390FF801FF2607FE07EBFFC06CB712E06C16F06C14F7
+6D01C713E0011F010313C0D907FCC8FC2C397DB730>I<49B4FC010713E0011F13F8017F
+7F90B57E488048018113803A07FC007FC04848133FD81FE0EB1FE0150F484814F0491307
+127F90C7FCED03F85A5AB7FCA516F048C9FC7E7EA27F003FEC01F06DEB03F86C7E6C7E6D
+1307D807FEEB1FF03A03FFC07FE06C90B5FC6C15C0013F14806DEBFE00010713F8010013
+C0252A7CA830>I<EDFF80020713E0021F13F05C4A13F891B5FC491387903803FE079138
+FC03F0903907F800C04A1300A8003FB612C04815E0B7FCA36C15C0260007F0C7FCB3A900
+3FB512FE4880B71280A26C15006C5C25397DB830>I<D903FC13FF90261FFF8713C04913
+DF90B712E05A5A2607FE07138F903AF801FE07C048486C6CC7FCA2497F001F8149133FA5
+6D137F000F92C7FC6D5BA26C6C485AEBFE0790B55A5D485C15C001DF5BD9C3FCC8FC01C0
+C9FCA37F7F6CB512F015FF6C15C04815F0488148813A3FE0001FFE0180130148C8127F00
+7E8100FE168048151FA56C153F007FED7F006D5C6C6C495A01F013076CB4EB7FFC6C90B5
+5A6C5D000115C06C6C91C7FC011F13FC010113C02B3E7DA730>I<EA3FFC487E12FFA212
+7F123F1200AAEC01FE91380FFF80023F13E091B57E90B67EA29138FE07FCECF8039138E0
+01FE14C0EC8000A291C7FCA25BB3A23B3FFFF81FFFF8486D4813FCB500FE14FEA26C01FC
+14FC6C496C13F82F3880B730>I<14E0EB03F8A2497EA36D5AA2EB00E091C8FCA9381FFF
+F8487F5AA27E7EEA0001B3A9003FB612C04815E0B7FCA27E6C15C023397AB830>I<EC01
+C0EC07F0A2EC0FF8A3EC07F0A2EC01C091C7FCA990B512F04814F8A47EEB0003B3B3A5EC
+07F0A2123C007EEB0FE0B4131FEC3FC0147F90B512806C14005C6C5B000F13F0000313C0
+1D4E7CB830>I<EA7FF8487EA4127F1200AB0203B512804A14C017E0A217C06E14809139
+001FE0004B5A4B5A4BC7FC4A5A4A5AEC0FF84A5A4A5A4A5A4A5A01FD7F90B57E8114F7EC
+E3F8ECC1FCEC81FEEC00FF497F496D7E6F7E826F7E15076F7E6F7E3B7FFFF81FFFE0B56C
+4813F017F8A217F06C496C13E02D387FB730>I<387FFFF8B57EA47EEA0001B3B3A8007F
+B612F0B712F8A46C15F025387BB730>I<02FC137E3B7FC3FF01FF80D8FFEF01877F90B5
+00CF7F15DF92B57E6C010F13872607FE07EB03F801FC13FE9039F803FC01A201F013F8A3
+01E013F0B3A23C7FFE0FFF07FF80B548018F13C0A46C486C01071380322881A730>I<EC
+01FE3A3FFC0FFF80267FFE3F13E000FF90B57E90B67E7E6C9038FE07FCC6EBF8039138E0
+01FE14C0EC8000A291C7FCA25BB3A23B3FFFF81FFFF8486D4813FCB500FE14FEA26C01FC
+14FC6C496C13F82F2880A730>I<49B4FC010F13E0013F13F8497F90B57E0003ECFF8014
+013A07FC007FC04848EB3FE0D81FE0EB0FF0A24848EB07F8491303007F15FC90C71201A3
+00FEEC00FEA86C14016C15FCA26D1303003F15F86D13076D130F6C6CEB1FF06C6CEB3FE0
+6D137F3A07FF01FFC06C90B512806C15006C6C13FC6D5B010F13E0010190C7FC272A7CA8
+30>I<EC03FE3A3FFC1FFF80267FFE7F13E000FF90B57E90B612FC6C816CEBFE07C69038
+F001FF4A6C13804A137F4AEB3FC091C7121F17E049140FA217F01607A8160FA217E07F16
+1F6EEB3FC0A26EEB7F806E13FFDAF00313009138FC0FFE91B55A5E495C6E13C0021F90C7
+FCEC03FC91C9FCAD383FFFF8487FB57EA26C5B6C5B2C3C80A730>I<49B413F8010FEBC1
+FC013F13F14913FD48B6FC5A481381390FFC007F49131F4848130F491307485A49130312
+7F90C7FC15015A5AA77E7E15037FA26C6C1307150F6C6C131F6C6C133F01FC137F3907FF
+01FF6C90B5FC6C14FD6C14F9013F13F1010F13C1903803FE0190C7FCAD92B512F84A14FC
+A46E14F82E3C7DA730>I<ED07F83A3FFF803FFF486DB51280B512C302CF14C06C13DF6C
+9038FFFC3FD8001F13E09238801F809238000F004A90C7FC5C5C5CA25CA45CAF003FB512
+FC4880B7FCA26C5C6C5C2A287EA730>I<90381FFC1E48B5129F000714FF5A5A5A387FF0
+07EB800100FEC7FC4880A46C143E007F91C7FC13E06CB4FC6C13FC6CEBFF806C14E00001
+14F86C6C7F01037F9038000FFF02001380007C147F00FEEC1FC0A2150F7EA27F151F6DEB
+3F806D137F9039FC03FF0090B6FC5D5D00FC14F0D8F83F13C026780FFEC7FC222A79A830
+>I<EB0780497E131FA9003FB612E04815F0B7FCA36C15E026001FC0C7FCB216F8ED01FC
+A5ECE003010FEB07F814F09138FC1FF06DB512E06D14C016806D14009038007FFCEC1FF0
+26337EB130>I<D83FFCEB3FFC486C497E00FF14FFA2007F147F003F143F00001400B3A4
+1501A2150315076D130F903A7FC07FFFF891B612FC6D15FE7F6D4913FC6D9038F87FF801
+0001C0C7FC2F2880A630>I<3B3FFFC07FFF80486DB512C0B515E0A26C16C06C496C1380
+3B01F80003F000A26D130700005DA26D130F017E5CA2017F131F6D5CA2EC803F011F91C7
+FCA26E5A010F137EA2ECE0FE01075BA214F101035BA3903801FBF0A314FF6D5BA36E5A6E
+5A2B277EA630>I<3B3FFFC01FFFE0486D4813F0B515F8A26C16F06C496C13E0D807E0C7
+EA3F00A26D5C0003157EA56D14FE00015DEC0F80EC1FC0EC3FE0A33A00FC7FF1F8A2147D
+A2ECFDF9017C5C14F8A3017E13FBA290393FF07FE0A3ECE03FA2011F5C90390F800F802D
+277FA630>I<3A3FFF81FFFC4801C37FB580A26C5D6C01815BC648C66CC7FC137FEC80FE
+90383F81FC90381FC3F8EB0FE3ECE7F06DB45A6D5B7F6D5B92C8FC147E147F5C497F8190
+3803F7E0EB07E790380FE3F0ECC1F890381F81FC90383F80FE90387F007E017E137F01FE
+6D7E48486D7E267FFF80B5FCB500C1148014E3A214C16C0180140029277DA630>I<3B3F
+FFC07FFF80486DB512C0B515E0A26C16C06C496C13803B01FC0003F000A2000014076D5C
+137E150F017F5C7F151FD91F805BA214C0010F49C7FCA214E00107137EA2EB03F0157C15
+FCEB01F85DA2EB00F9ECFDF0147D147FA26E5AA36E5AA35DA2143F92C8FCA25C147EA200
+0F13FE486C5AEA3FC1EBC3F81387EB8FF0EBFFE06C5B5C6C90C9FC6C5AEA01F02B3C7EA6
+30>I<001FB612FC4815FE5AA316FC90C7EA0FF8ED1FF0ED3FE0ED7FC0EDFF80003E4913
+00C7485A4A5A4A5A4A5A4A5A4A5A4A5A4990C7FC495A495A495A495A495A495A4948133E
+4890C7127F485A485A485A485A485A48B7FCB8FCA46C15FE28277DA630>I<ED3FF09138
+03FFF8140F5C147F16F09138FFF00092C7FC495A5CB3A21303495A133F383FFFF0B55A5C
+91C8FC14C080003F7F38003FF813076D7E1301B3A2806D7E15F091387FFFF016F8141F80
+14039138003FF025477BBE30>I<127CA212FEB3B3B3AD127CA207476CBE30>I<EA7FE0EA
+FFFE6D7E8014F07EC66C7E13076D7E1301B3A2806D7E15E091387FFFE06E13F880140714
+1F5C4A13E09138FFE00092C7FC495A5CB3A21303495A137F387FFFF0B5FC14C05C49C8FC
+EA7FE025477BBE30>I<017C133848B4137C48EB80FE4813C14813C348EBEFFC397FEFFF
+F0D8FF8713E0010713C0486C1380D87C0113003838007C1F0C78B730>I
+E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fd cmti9 9 16
+/Fd 16 119 df<121C127F12FFA412FE12380808778718>46 D<ED3FC0913803FFF89138
+0FC03E91383E000702F0EB03C04948EB01E0D90780EB00F049C81270011E15385B4901FC
+131C9038F003FF3B01E00F83C01E903AC03E01E00E0003EB7C004848481370D901F0137E
+484848133F380E07C0121C4948133EEA3C1F003890C7127EEA783FD8703E147CA2EEFC1E
+EAF07ED8E07CECF81CA20301133CEEF038A303031378923807E07017F0013C010F13E001
+3E131F011E90383BE1C06DEBF3C33BF00783E3E7803B7003FF81FF00903900FE007C6C90
+C9FCA27E001EED07806C151F6C6CECFE00D801C0EB07F0D800F8EBFF8090263FFFFCC7FC
+010790C8FC2F3674B43B>64 D<0107B612C04915F017FC903A003F8001FEEE007FEF1F80
+92C7EA0FC0EF07E05CEF03F0147E170102FE15F8A25CA21301A25CA2130317035CA21307
+18F04A1407A2130F18E04A140F18C0011F151F18805CEF3F00133F177E91C85AA2494A5A
+4C5A017E4A5A4C5A01FE4A5A047EC7FC49495A0001EC0FF8007FB612E0B7C8FC15F83533
+7BB23A>68 D<0107B612C04915F883903A003F8001FEEE003FEF1F8092C713C0170F5C18
+E0147EA214FEEF1FC05CA201011680173F4A1500177E010315FE5F4AEB03F8EE07E00107
+EC3FC091B6C7FC16F802E0C9FC130FA25CA2131FA25CA2133FA291CAFCA25BA2137EA213
+FEA25B1201387FFFF0B5FCA233337CB234>80 D<B53CC03FFFF003FFF8601480280FF000
+01FCC7EA7F806C484AEC3E00193CA219386115036115074E5A030F140361031D4AC7FCA2
+DB38FC130EA203705C15F06C6C01E05C140103C05CDA038014F060DA0700130160020E4A
+5AA24A4AC8FCA24A140E147802705C5C5FD9F1C014781770D9F3805CA201F7C7EA7FC0A2
+01FE5DA26C4892C9FCA249147E5B167C5B1678491470453570B24D>87
+D<EB03F0EB0FF890383E1C6090387C0FF0EBF807EA01F0EA03E00007EB03E0EA0FC0A238
+1F800715C0EA3F00A2140F481480127EA2141F00FE14005A1506EC3F07EC3E0F150E147E
+007C141EECFE1CEB01FCD83C03133C393E07BE38391F0E1E783907FC0FF03901F003C020
+2278A027>97 D<14FCEB07FF90381F078090383E03C0EBFC013801F8033803F0073807E0
+0F13C0120F391F80070091C7FC48C8FCA35A127EA312FE5AA4007C14C0EC01E0A2EC03C0
+6CEB0F80EC1F006C137C380F81F03803FFC0C648C7FC1B2278A023>99
+D<EB03F8EB0FFEEB3E0F9038F807803801F003EA03E0EA07C0120FEA1F801407D83F0013
+005C007E133EEB03F8387FFFE04848C7FC00FCC8FCA45AA4EC0180EC03C0A2007CEB0780
+EC1F00003C133E6C13F8380F03E03807FF80D801FCC7FC1A2277A023>101
+D<143FECFF80903803E1E6903807C0FF90380F807FEB1F00133E017E133F49133EA24848
+137EA24848137CA215FC12074913F8A21401A2D80FC013F0A21403120715E01407140F14
+1F3903E03FC00001137FEBF0FF38007FCF90381F0F801300141FA21500A25C143E123800
+7E137E5C00FE5B48485A387803E0387C0F80D81FFFC7FCEA07F820317CA023>103
+D<EB0180EB07E0A2130FEB07C0EB038090C7FCABEA01F0EA03FCEA0F1E120E121C123C12
+38EA783E1270A2137EEAF07CEA60FCC65AA212015BA212035BA2000713C0EBC1E0000F13
+C01381A21383EB038013071400130E131EEA07F8EA01F013337AB118>105
+D<133FEA07FF5A13FEEA007EA3137CA213FCA213F8A21201A213F0A21203A213E0A21207
+A213C0A2120FA21380A2121FA21300A25AA2123EA2127EA2127C1318EAFC1C133CEAF838
+A21378137012F013F0EAF8E01279EA3FC0EA0F00103579B314>108
+D<2703C003F8137F3C0FF00FFE01FFC03C1E783C1F07C1E03C1C7CF00F8F01F03B3C3DE0
+079E0026383FC001FC7FD97F805B007001005B5E137ED8F0FC90380FC00100E05FD860F8
+148012000001021F130360491400A200034A13076049013E130FF081800007027EEC83C0
+051F138049017C1403A2000F02FC1407053E130049495CEF1E0E001F01015D183C010049
+EB0FF0000E6D48EB03E03A227AA03F>I<3903C007F0390FF01FFC391E787C1E391C7CF0
+1F393C3DE00F26383FC01380EB7F8000781300EA707EA2D8F0FC131F00E01500EA60F812
+0000015C153E5BA20003147E157C4913FCEDF8180007153C0201133801C013F0A2000F15
+78EDE070018014F016E0001FECE1C015E390C7EAFF00000E143E26227AA02B>I<14FCEB
+07FF90381F07C090383E03E09038FC01F0EA01F83903F000F8485A5B120F484813FCA248
+C7FCA214014814F8127EA2140300FE14F05AA2EC07E0A2007CEB0FC01580141FEC3F006C
+137E5C381F01F0380F83E03803FF80D800FCC7FC1E2278A027>I<EB03F0EB1FFCEB3C1E
+EB780FEBF007EA01E0140F0003131F13C0A2EBE00414007FEBFF8014E06C13F06C13F8EB
+7FFC1307EB00FE147E143E123800FC133CA3147C00F013784813F0EAF001387803E0383C
+0F80381FFE00EA03F818227AA01F>115 D<01F01338D803FC13FCEA0F1E120E121C123C
+0038147CEA783E0070143CA2137ED8F07C1338EA60FCC65A1578000114705BA215F00003
+14E05BA2EC01C0A2EBC003158014071500EBE00EA26C6C5A3800F878EB7FE0EB1F801E22
+7AA023>118 D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fe cmr9 9 23
+/Fe 23 117 df<123C127EB4FCA21380A2127F123D1201A412031300A25A1206120E120C
+121C5A5A126009177A8715>44 D<15E0A34A7EA24A7EA34A7EA3EC0DFE140CA2EC187FA3
+4A6C7EA202707FEC601FA202E07FECC00FA2D901807F1507A249486C7EA301066D7EA201
+0E80010FB5FCA249800118C77EA24981163FA2496E7EA3496E7EA20001821607487ED81F
+F04A7ED8FFFE49B512E0A333367DB53A>65 D<DA03FE130C91393FFF801C91B512E0903A
+03FE01F83C903A0FF0003C7CD91FC0EB0EFCD97F80130701FEC712034848140100031500
+5B4848157C485A173C485A171C123F5B007F160CA390C9FC481600AB7E6D150CA3123F7F
+001F161C17186C7E17386C6C15306C6C15706D15E012016C6CEC01C0D97F80EB0380D91F
+C0EB0F00D90FF0131ED903FE13FC0100B512F0023F13C0DA03FEC7FC2E377CB437>67
+D<B812C0A3D803FCC7127F0001150FEE03E01601A21600A21760A403061330A41700150E
+A2151E157E90B512FEA39038FC007E151E150EA21506170CA3171892C7FCA41738A21770
+A217F01601160316070003157FB812E0A32E337DB234>69 D<B81280A3D803FCC7FC0001
+151FEE07C01603A21601A21600A41760150CA31700A2151CA2153C15FC90B5FCA3EBFC00
+153C151CA2150CA592C8FCAB487EB512FEA32B337DB232>I<DA03FE130C91393FFF801C
+91B512E0903A03FE01F83C903A0FF0003C7CD91FC0EB0EFCD97F80130701FEC712034848
+1401000315005B4848157C485A173C485A171C123F5B007F160CA390C9FC4893C7FCAA03
+03B512E07E7F92390003FE00705A123F7F121FA26C7E7F12076C7E7F6C6C14036C7E6D6C
+1307D91FC0EB0E7CD90FF0EB1C3CD903FEEBF81C0100B5EAF00C023F01C0C7FCDA03FEC8
+FC33377CB43C>I<B5D8FE03B512F8A3000190C73807FC006C486E5AB390B7FCA349C712
+03B3A3486C4A7EB5D8FE03B512F8A335337EB23A>I<D8FFFE91381FFFF87F80C6030013
+006E143CD9DFE01418EBCFF0A2EBC7F8EBC3FCA2EBC1FEEBC0FF6E7EA26E7E6E7EA26E7E
+6E7E6E7EA26E7E6E7EA2ED7F80ED3FC0ED1FE0A2ED0FF0ED07F8A2ED03FCED01FEED00FF
+A2EE7F98EE3FD8A2EE1FF8160F1607A216031601A2486C1400D807F81578B500C01438A2
+171835337EB23A>78 D<B612FCEDFF8016F03A01FE0007FC0000EC01FEED007F707E707E
+83160F83A65FA24C5AA24C5A047EC7FC4B5AED0FF090B612C093C8FC9039FE001FC0ED07
+F06F7E6F7E150082167E167FA583A5180C17C0A2043F131C486C1618B500FEEB1FE0040F
+1338933807F070C93801FFE09338003F8036357EB239>82 D<90381FE00390387FFC0748
+B5FC3907F01FCF390F8003FF48C7FC003E80814880A200788000F880A46C80A27E92C7FC
+127F13C0EA3FF013FF6C13F06C13FF6C14C06C14F0C680013F7F01037F9038003FFF1403
+02001380157F153FED1FC0150F12C0A21507A37EA26CEC0F80A26C15006C5C6C143E6C14
+7E01C05B39F1FC03F800E0B512E0011F138026C003FEC7FC22377CB42B>I<EB7F803803
+FFF0380F80FC381C003E003F133F6D6C7E6E7EA26E7EEA1F00C7FCA4EB01FF131FEBFF87
+3803FC07EA0FF0EA1FC0EA3F80127F13004815C05AA3140FA26C131F6C133B3A3F8071F1
+80391FC1E1FF2607FFC013003900FE003C22237DA126>97 D<EB07F8EB3FFF9038FC07C0
+3901F000E03903E003F03807C007120FEA1F80123F90380003E04890C7FCA2127E12FEAA
+127FA26C14187F001F14386D1330000F14706C6C13E03903F001C03900FC0F8090383FFE
+00EB07F01D237EA122>99 D<153FEC0FFFA3EC007F81AEEB07F0EB3FFCEBFC0F3901F003
+BF3907E001FF48487E48487F8148C7FCA25A127E12FEAA127E127FA27E6C6C5BA26C6C5B
+6C6C4813803A03F007BFFC3900F81E3FEB3FFCD90FE0130026357DB32B>I<EB0FE0EB7F
+FCEBF83F3903F00F80D807E013C0390FC007E0381F800315F0EA3F0014014814F8127EA2
+12FEA2B6FCA248C8FCA5127E127FA26C1418A26C6C1338000F14306D13706C6C13E03901
+F003C03900FC0F00EB3FFEEB07F01D237EA122>I<151F90391FC07F809039FFF8E3C039
+01F07FC73907E03F033A0FC01F83809039800F8000001F80EB00074880A66C5CEB800F00
+0F5CEBC01F6C6C48C7FCEBF07C380EFFF8380C1FC0001CC9FCA3121EA2121F380FFFFEEC
+FFC06C14F06C14FC4880381F0001003EEB007F4880ED1F8048140FA56C141F007C15006C
+143E6C5C390FC001F83903F007E0C6B51280D91FFCC7FC22337EA126>103
+D<EA03F012FFA312071203AEEC1FC0EC7FF09038F1E0FC9038F3807C9038F7007E13FE49
+7FA25BA25BB3486CEB7F80B538C7FFFCA326347EB32B>I<EA0780EA0FC0EA1FE0A4EA0F
+C0EA0780C7FCAAEA07E012FFA3120F1207B3A6EA0FF0B5FCA310337EB215>I<EA07E012
+FFA3120F1207B3B3A7EA0FF0B5FCA310347EB315>108 D<3903F01FC000FFEB7FF09038
+F1E0FC9038F3807C3907F7007EEA03FE497FA25BA25BB3486CEB7F80B538C7FFFCA32621
+7EA02B>110 D<EB07F0EB3FFE9038FC1F803901F007C03903C001E000078048486C7E48
+C7127CA248147E003E143E007E143FA300FE1580A8007E1500A36C147EA26C147C6D13FC
+6C6C485A00075C3903F007E03900FC1F80D93FFEC7FCEB07F021237EA126>I<3903F03F
+8000FFEBFFE09038F3C0F89038F7007ED807FE7F6C48EB1F804914C049130F16E0ED07F0
+A3ED03F8A9150716F0A216E0150F16C06D131F6DEB3F80160001FF13FC9038F381F89038
+F1FFE0D9F07FC7FC91C8FCAA487EB512C0A325307EA02B>I<3803E07C38FFE1FF9038E3
+8F809038E71FC0EA07EEEA03ECA29038FC0F8049C7FCA35BB2487EB512E0A31A217FA01E
+>114 D<1330A51370A313F0A21201A212031207381FFFFEB5FCA23803F000AF1403A814
+073801F806A23800FC0EEB7E1CEB1FF8EB07E0182F7FAD1E>116
+D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Ff cmsy6 6 1
+/Ff 1 4 df<136013701360A20040132000E0137038F861F0387E67E0381FFF803807FE
+00EA00F0EA07FE381FFF80387E67E038F861F038E060700040132000001300A213701360
+14157B9620>3 D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fg cmr10 10.95 89
+/Fg 89 124 df<4AB4EB0FE0021F9038E03FFC913A7F00F8FC1ED901FC90383FF03FD907
+F090397FE07F80494801FF13FF4948485BD93F805C137F0200ED7F00EF003E01FE6D91C7
+FC82ADB97EA3C648C76CC8FCB3AE486C4A7E007FD9FC3FEBFF80A339407FBF35>11
+D<EC03FE91383FFF809138FE03E0903903F800F0D90FE013384948137C90393F8001FE90
+387F00035B5BA2485A6F5AED007093C7FCAA16FEB7FCA33901FC000315011500B3AC486C
+497EB5D8F87F13FCA32E407EBF33>I<EC03FF023F13EE9138FE01FEEB03F090380FE003
+EB1FC0EB3F80EB7F005B5B150148481300AEB7FCA3D801FCC7FCB3AE486C497EB5D8F87F
+13FCA32E407EBF33>I<DA03FE49B4FC91273FFF801F13C0913BFE03E07F01F0903C03F0
+00F1FC0078D90FE0D97FF0131C49484948133E4948484913FF494848495A5B491500A248
+485C03016E5A0300153896C7FCAA197FBBFCA3D801FCC738FE00018485B3AC486C496CEC
+FF80B5D8F87FD9FC3F13FEA347407EBF4C>I<121EEA7F80EAFFC0A9EA7F80ACEA3F00AC
+121EAB120CC7FCA8121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A4179C019>33
+D<001E130F397F803FC000FF137F01C013E0A201E013F0A3007F133F391E600F30000013
+00A401E01370491360A3000114E04913C00003130101001380481303000EEB070048130E
+0018130C0038131C003013181C1C7DBE2D>I<4B6C130C4B6C131EA20307143EA24C133C
+A2030F147CA293C71278A24B14F8A2031E5CA2033E1301A2033C5CA3037C1303A203785C
+A203F81307A24B5CA20201140F007FBAFCBB1280A26C1900C72707C0003EC8FC4B133CA3
+020F147CA292C71278A24A14F8A2021E5CA3023E1301007FBAFCBB1280A26C1900C727F8
+0007C0C8FC4A5CA20101140FA24A91C9FCA301035CA24A131EA20107143EA24A133CA201
+0F147CA291C71278A34914F8A2011E5CA2013E1301A2013C5CA201186D5A41517BBE4C>
+I<14E0A4EB07FC90383FFF8090B512E03901F8E3F03903E0E0FCD807C0133CD80F807FD8
+1F007F003E80003C1580007C140316C00078141F00F8143F157FA47EED3F806CEC0E0092
+C7FC127F138013C0EA3FF013FEEA1FFF6C13FC6C13FF6C14C06C806C6C13F8011F7F1303
+01007FECE7FF14E102E01380157F153FED1FC0A2003E140F127FD8FF801307A5130000FC
+158000F0140F1270007815005D6C141E153E6C5C6C5C3907C0E1F03903F8EFE0C6B51280
+D93FFEC7FCEB0FF8EB00E0A422497BC32D>I<EC0F80EC7FE0ECF870903803E038010713
+3CECC01CEB0F80011F131E150EA2EB3F00A55D1480A25D157815705D6D6C5A14C1ECC380
+02C7CAFC02EE91387FFFFCEB0FEC14FC4A020713C06D48913801FE006E5DEF00F06D7E01
+074B5A496C5D011D1503D939FF4A5A017093C7FC496D5B0001017F140E496C6C131E0003
+6E131C2607801F143C000F6E5B001F6D6C1370263F000714F0486E485ADA03FE5B913801
+FF03486D495A0487C8FCED7FCFED3FFE6F4814386D5C150F007F6E6C14786D6D6C147000
+3F4A6C14F06D496C6C13E0001F91393E3FC0016C6C903AFC1FF003C03D07FC07F007FC1F
+800001B5D8C001B512006C6C90C7EA7FFCD90FF8EC0FF03E437CC047>38
+D<121EEA7F8012FF13C0A213E0A3127FEA1E601200A413E013C0A312011380120313005A
+120E5A1218123812300B1C79BE19>I<1430147014E0EB01C0EB03801307EB0F00131E13
+3E133C5B13F85B12015B1203A2485AA2120F5BA2121F90C7FCA25AA3123E127EA6127C12
+FCB2127C127EA6123E123FA37EA27F120FA27F1207A26C7EA212017F12007F13787F133E
+131E7FEB07801303EB01C0EB00E014701430145A77C323>I<12C07E12707E7E121E7E6C
+7E7F12036C7E7F12007F1378137CA27FA2133F7FA21480130FA214C0A3130714E0A61303
+14F0B214E01307A614C0130FA31480A2131F1400A25B133EA25BA2137813F85B12015B48
+5A12075B48C7FC121E121C5A5A5A5A145A7BC323>I<EB03C0A2805CA600F0140F00FC14
+3F00FE147F00FF14FF393FC3C3FC390FE187F03903F18FC03900FDBF00EB3FFCEB0FF0EB
+03C0EB0FF0EB3FFCEBFDBF3903F18FC0390FE187F0393FC3C3FC39FF03C0FF00FE147F00
+FC143F00F0140F00001400A6805CA220277AC32D>I<1506150FB3A9007FB912E0BA12F0
+A26C18E0C8000FC9FCB3A915063C3C7BB447>I<121EEA7F8012FF13C0A213E0A3127FEA
+1E601200A413E013C0A312011380120313005A120E5A1218123812300B1C798919>I<B5
+12FEA617067F961E>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A0A798919>I<ED0180
+ED03C01507A21680150FA216005DA2151E153EA2153C157CA2157815F8A25D1401A25D14
+03A25D1407A25D140FA24AC7FCA2141E143EA2143C147CA2147814F8A25C1301A25C1303
+A25C1307A25C130FA291C8FC5BA2131E133EA25BA2137813F8A25B1201A25B1203A25B12
+07A25B120FA290C9FC5AA2121E123EA2123C127CA2127812F8A25A1260225B7BC32D>I<
+EB01FE90380FFFC090383F03F090387C00F849137C48487F48487F4848EB0F80A2000F15
+C04848EB07E0A3003F15F0A290C712034815F8A64815FCB3A26C15F8A56C6CEB07F0A300
+1F15E0A36C6CEB0FC0A26C6CEB1F80000315006C6C133E6C6C5B017C5B90383F03F09038
+0FFFC0D901FEC7FC263F7DBC2D>I<EB01C013031307131F137FEA07FFB5FC139FEAF81F
+1200B3B3ACEB7FF0B612F8A31D3D78BC2D>I<EB07FC90383FFF8090B512E03903F01FF8
+3907C007FC390F0001FE001E6D7E001C1580003CEC7FC05AED3FE01270B4FC6DEB1FF07F
+A56C5A6CC7FC120CC813E0153FA216C0157F168015FF16004A5A5D4A5A4A5A5D4A5A4A5A
+4AC7FC147E147C5C495A495A495A495A49C71270133E133C5B4914E0485A485A485A48C7
+120148B6FCA25A4815C0B7FCA3243D7CBC2D>I<EB07FC90383FFF809038F80FE03901E0
+03F839078001FCD80F007F000E6D7E001E1580D81F80137F486C14C07FA27F5BA2121F6C
+5AC8138015FF1600A24A5AA24A5A5DEC07E04A5A023FC7FCEB1FFCECFF809038000FE0EC
+07F86E7E6E7E6E7E1680ED7FC0A216E0153FA216F0A2120C123F487E487EA316E0A24913
+7F6CC713C01278EDFF807E6C4913006C495A3907C007FC3903F80FF0C6B55A013F1380D9
+07F8C7FC243F7CBC2D>I<150E151E153EA2157EA215FE1401A21403EC077E1406140E14
+1CA214381470A214E0EB01C0A2EB0380EB0700A2130E5BA25B5BA25B5B1201485A90C7FC
+5A120E120C121C5AA25A5AB8FCA3C8EAFE00AC4A7E49B6FCA3283E7EBD2D>I<00061403
+D80780131F01F813FE90B5FC5D5D5D15C092C7FC14FCEB3FE090C9FCACEB01FE90380FFF
+8090383E03E090387001F8496C7E49137E497F90C713800006141FC813C0A216E0150FA3
+16F0A3120C127F7F12FFA416E090C7121F12FC007015C012780038EC3F80123C6CEC7F00
+001F14FE6C6C485A6C6C485A3903F80FE0C6B55A013F90C7FCEB07F8243F7CBC2D>I<EC
+1FE0ECFFF8903803F03E90380FC00F90391F000780133E017EEB1FC049133F4848137F12
+035B12074848EB3F80ED1F00001F91C7FC5BA2123FA3485AA214FE903887FF8039FF8F07
+E090389C01F09038B800FC01B0137E13F0497F16804914C0A2ED1FE0A34914F0A5127FA6
+123F6D14E0A2121FED3FC0A26C6C1480A20007EC7F006C6C137E6C6C5B6C6C485A90387E
+07F06DB45A010F1380D903FCC7FC243F7CBC2D>I<1238123C123F90B612FCA316F85A16
+F016E00078C712010070EC03C0ED078016005D48141E151C153C5DC8127015F04A5A5D14
+034A5A92C7FC5C141EA25CA2147C147814F8A213015C1303A31307A3130F5CA2131FA613
+3FAA6D5A0107C8FC26407BBD2D>I<EB03FC90381FFF8090387C07E09038F001F83901E0
+007C48487F48487F48C7FCED0F80121E16C0003E1407A4123FA26DEB0F807F6C6C131F6D
+140001FC133E6C6C5B9038FF80786C6D5A6CEBF3E06CEBFF806C91C7FC133F6D13C06D7F
+013F13F801787F48486C7E3903E01FFF48486C1380260F800313C048487E489038007FE0
+003E143F007E141F007CEC0FF01507481403A31501A46C15E0007C1403A2007E15C06C14
+076CEC0F806DEB1F006C6C133ED807F05B3901FC03F86CB512E0011F1380D903FCC7FC24
+3F7CBC2D>I<EB03FCEB1FFF90387E07C09038FC03F048486C7E48486C7E4848137C000F
+147E4848137F81003F15805B007F15C0A2151F12FF16E0A516F0A5127F153FA36C7EA200
+1F147F120F6C6C13FF6D13DF000313013900F8039F90387E0F1FD91FFE13E0EB07F090C7
+FCA2ED3FC0A41680157FD80F801400487E486C13FEA24A5A5D49485AEB8007391E000FE0
+001F495A260FC07FC7FC3803FFFE6C13F838003FC0243F7CBC2D>I<121EEA7F80A2EAFF
+C0A4EA7F80A2EA1E00C7FCB3121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A2779A619>I<
+121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121E127FEAFF80A213C0A4127F121E12
+00A412011380A3120313005A1206120E120C121C5A1230A20A3979A619>I<007FB912E0
+BA12F0A26C18E0CDFCAE007FB912E0BA12F0A26C18E03C167BA147>61
+D<EB1FF890B5FC3903E01FC0390F0007F0001EEB03F848EB01FC4814FE140000FE14FF7E
+7FA46CC7FC123EC7EA01FEA2EC03FCEC07F815F0EC0FC0EC1F80EC3F00143E5C147814F8
+5C13015CA2495AA25CAB91C7FC90C8FCA8EB0780EB1FE0A2497EA46D5AA2EB078020407B
+BF2B>63 D<ED7FE0913807FFFE91391F801F809139780001E0D901E0EB0078D90780141E
+49C87E011E6F7E0138ED01C0496F7E4916700001177848488249D93F80131C28070001FF
+F07F48902607E07C130F000E90260FC01E7F001E90263F00071480001C49903803800300
+3C01FED901C013C0003849ECFE010101EC00FF267803F8027F13E000701700495AA200F0
+18F000E01870495AA96D7E12F01270A26D7E007818E0263801FC5C01005C003C7F001C01
+7F49EB01C0001E6DEB077F000E903B0FC01E3F8380000F903B07E07C1F87006C903A01FF
+F007FE3C0380003F8001F86D90CAFC6C7E120013707F011EEE03F06D160F6D6CED3FC0D9
+01E0913801FE00D90078EC1FF0913A1F8003FF800207B500F8C7FC9126007FFEC8FC3C41
+7BBF47>I<15074B7EA34B7EA34B7EA34B7EA34B7E15E7A2913801C7FC15C3A291380381
+FEA34AC67EA3020E6D7EA34A6D7EA34A6D7EA34A6D7EA34A6D7EA349486D7E91B6FCA249
+819138800001A249C87EA24982010E157FA2011E82011C153FA2013C820138151FA20178
+82170F13FC00034C7ED80FFF4B7EB500F0010FB512F8A33D417DC044>I<B712FCEEFF80
+17F00001903980000FF86C6CC7EA03FE707E701380EF7FC0EF3FE0A2EF1FF0A218F8A317
+0F171FA318F0A2EF3FE0177F18C0EFFF804C1300EE03FCEE0FF8EE7FE091B6C7FC17E091
+C7EA07FCEE01FE933800FF80EF7FC0EF3FE0EF1FF018F8170F18FC1707A218FEA718FC17
+0FA2EF1FF818F0173FEF7FE0EFFFC00403138048486C90380FFE00B85A17E094C7FC373E
+7DBD40>I<DB3FF01306912603FFFE130E020F9038FF801E913A3FF007E03E9139FF8000
+F8D903FEC7EA7C7ED907F8EC1EFE4948140FD93FE0140749481403495A91C81201484815
+0012034848167E5B000F173EA24848161EA2123F5B180E127FA349160012FFAC127F7F18
+0EA2123FA27F001F171E181C6C7EA20007173C6D16386C6C1678000117706C6C16F06EEC
+01E06D6C15C06D6C1403D90FF0EC07806D6CEC1F00D903FE143E902600FF8013F891393F
+F007F0020FB512C0020391C7FC9138003FF037427BBF42>I<B712FCEEFF8017E0000190
+39C0001FF86C6C48EB03FEEE00FF717E717EEF0FE084717E717E170184717EA21980187F
+19C0A3F03FE0A519F0AB19E0A5F07FC0A21980A218FF19004D5AA24D5A6017074D5A4D5A
+EF7FC04DC7FCEE03FE48486CEB1FF8B85A178004FCC8FC3C3E7DBD45>I<B912E0A30001
+9038C000016C6C48EB001FEF0FF01703A217011700A31870A418381638A41800A21678A2
+16F81501150791B5FCA3EC8007150115001678A21638A2180EA3181C93C7FCA4183C1838
+A21878A318F8EF01F0A21707170F173F48486CEB03FFB912E0A3373E7DBD3E>I<B91280
+A300019038C000036C6C48EB007FEF1FC0170F1707A21703A31701A4EF00E0A21638A318
+00A31678A216F81501150791B5FCA3EC8007150115001678A21638A693C8FCAF3801FFE0
+B612F0A3333E7DBD3B>I<DB3FE0130C912603FFFE131C021F9038FF803C913A7FF00FC0
+7C9139FF0001F0D903FC90380078FC4948143DD91FE0141F4948140F4948140701FF1503
+4890C8FC491501485A000716005B000F177C5B001F173CA2485AA2181C127FA25B95C7FC
+12FFAB041FB512F0127FA26D9139000FFE00EF03FC123FA27F121FA26C7EA212077F1203
+6C7E7F6C7F6D6C14076D7E6D6C140FD907F8141ED903FEEC3C7C902600FF80EBF83C913A
+7FF007F01C021FB5EAC00C020391C8FC9138003FF03C427BBF47>I<B6D8C01FB512F8A3
+000101E0C7383FFC0026007F80EC0FF0B3A691B7FCA30280C7120FB3A92601FFE0EC3FFC
+B6D8C01FB512F8A33D3E7DBD44>I<B612F0A3C6EBF000EB3FC0B3B3B2EBFFF0B612F0A3
+1C3E7EBD21>I<011FB512FCA3D9000713006E5A1401B3B3A6123FEA7F80EAFFC0A44A5A
+1380D87F005B007C130700385C003C495A6C495A6C495A2603E07EC7FC3800FFF8EB3FC0
+26407CBD2F>I<B600C090387FFFFCA3000101E0C7000F138026007F80913807FE0018F8
+18E0604D5A4DC7FC173E5F5F4C5A4C5A4C5A4C5A4CC8FC163E5E5E4B5A4B5AED07804B7E
+151F4B7E4B7E15FF913881EFF8913883C7FCEC878791388F03FE91389E01FF14BCDAF800
+7F4A6D7E5C4A6D7E4A6D7EA2707E707EA2707E707EA2707F717E84173F717E717EA2717E
+848419802601FFE04A13C0B600C090B6FCA3403E7DBD47>I<B612F8A3000101E0C9FC38
+007F80B3B0EF0380A517071800A45FA35FA25F5F5F4C5A160748486C133FB8FCA3313E7D
+BD39>I<B500C093B512C0A300016D4BEBE000D8007F1880D977F0ED03BFA3D973F8ED07
+3FA3D971FC150EA2D970FE151CA3027F1538A36E6C1470A36E6C14E0A26E6CEB01C0A36E
+6CEB0380A36E6CEB0700A26E6C130EA36E6C5BA3037F5BA26F6C5AA36F6C5AA392380FE1
+C0A3923807F380A26FB4C7FCA36F5AA213F8486C6D5AD807FFEFFFE0B500F80178017FEB
+FFC0A34A3E7CBD53>I<B56C91B512F88080D8007F030713006EEC01FC6E6E5A1870EB77
+FCEB73FEA2EB71FF01707FA26E7E6E7EA26E7E6E7EA26E7E6E7EA26E7E6E7FA26F7E6F7E
+A26F7E6F7EA26F7E6F7EA26F7E6F1380A2EE7FC0EE3FE0A2EE1FF0EE0FF8A2EE07FCEE03
+FEA2EE01FF7013F0A2177F173FA2171F170FA2170701F81503487ED807FF1501B500F814
+00A218703D3E7DBD44>I<ED7FE0913807FFFE91391FC03F8091397E0007E04948EB03F8
+D907F0EB00FE4948147F49486E7E49486E7E49C86C7E01FE6F7E00018349150300038348
+486F7EA248486F7EA2001F188049167F003F18C0A3007F18E049163FA300FF18F0AC007F
+18E06D167FA4003F18C0A26C6CEEFF80A36C6C4B1300A26C6C4B5A00035F6D150700015F
+6C6C4B5A6D5E6D6C4A5A6D6C4A5A6D6C4AC7FC6D6C14FED901FCEB03F8D9007FEB0FE091
+391FC03F80912607FFFEC8FC9138007FE03C427BBF47>I<B712F8EEFF8017E000019039
+C0003FF86C6C48EB07FCEE01FE707EEF7F80EF3FC018E0A2EF1FF0A218F8A818F0A2EF3F
+E0A218C0EF7F80EFFF004C5AEE07FCEE3FF091B612C04CC7FC0280C9FCB3A73801FFE0B6
+12C0A3353E7DBD3E>I<B712C016FCEEFF800001D9C00013E06C6C48EB1FF0EE07FCEE01
+FE707E84717EA2717EA284A760177F606017FF95C7FCEE01FCEE07F8EE1FE0EEFF8091B5
+00FCC8FC16F091388001FCED003FEE1FC0707E707E83160383160183A383A484A4F0C004
+190EA28218E0057F131E2601FFE0161CB600C0EB3FF094381FF83805071370CA3801FFE0
+9438003F803F407DBD43>82 D<D907FC131890391FFF8038017FEBE0783901FC03F83A03
+F0007CF8D807C0133F4848130F001F140748C7FC003E1403007E1401A2007C140012FC16
+78A46C1538A27EA26C6C14007F7FEA3FF8EBFF806C13F86CEBFF806C14F06C14FC6C14FF
+6C15C0013F14E0010714F0EB007F020713F89138007FFC150FED07FE15031501ED00FFA2
+00E0157FA3163FA27EA3163E7E167E6C157C6C15FC6C15F86D13016DEB03F06DEB07E0D8
+F9FCEB0FC03AF07F803F8090391FFFFE00D8E00713F839C0007FC028427BBF33>I<003F
+B91280A3903AF0007FE001018090393FC0003F48C7ED1FC0007E1707127C00781703A300
+701701A548EF00E0A5C81600B3B14B7E4B7E0107B612FEA33B3D7DBC42>I<B600C090B5
+12F8A3000101E0C70007130026007F80EC01FC715A1870B3B3A4013F16F06E5DA2170101
+1F5E80010F15036E4A5A010793C7FC6D6C5C6D6C141E6D6C5C027F14F86E6C485A91390F
+F00FE00203B51280020049C8FCED1FF03D407DBD44>I<B691380FFFFEA3000301E00201
+13E06C01809138007F806CEF3F00017F163E181C6E153C013F1638A26E1578011F1670A2
+6D6C5DA26E140101075EA26E140301035EA26D6C4AC7FCA2806D150EA26F131E027F141C
+A26F133C023F1438A26E6C5BA26F13F0020F5CA2EDF80102075CA26E6C485AA2EDFE0702
+0191C8FCA26F5A6E130EA2ED7F9CA216DCED3FF8A36F5AA36F5AA26F5AA36F5A3F407EBD
+44>I<B500FE017FB5D88007B5FCA3000301C0010101E0C713F86C90C849EC3FE07148EC
+0F807E7215006E143F017F190E84A26D6C60A24D7E6D6C60A2EFE7F86D6C60A2933801C3
+FC6E18F001076104037F6E0281140101036104077F17006D6C4D5AA2040EEB7F806D6C4D
+C7FCA24CEB3FC0DA7F80160EA24CEB1FE003C0161E023F171C047814F0DBE070010F133C
+021F173804F014F84C1307DA0FF05EA2DBF1C0EB03FCDA07F95EA2DBFB80EB01FEDA03FF
+6F5AA293C8FCA26E5FA24B157F020094C8FCA24B81037C153EA20378151E0338151C5840
+7EBD5D>I<007FB5D8C003B512E0A3C649C7EBFC00D93FF8EC3FE06D48EC1F806D6C92C7
+FC171E6D6C141C6D6C143C5F6D6C14706D6D13F04C5ADA7FC05B023F13036F485ADA1FF0
+90C8FC020F5BEDF81E913807FC1C163C6E6C5A913801FF7016F06E5B6F5AA26F7E6F7EA2
+8282153FED3BFEED71FF15F103E07F913801C07F0203804B6C7EEC07004A6D7E020E6D7E
+5C023C6D7E02386D7E14784A6D7E4A6D7F130149486E7E4A6E7E130749C86C7E496F7E49
+7ED9FFC04A7E00076DEC7FFFB500FC0103B512FEA33F3E7EBD44>I<B66C0103B51280A3
+000101F0C8EBF8006C6C48ED3FC0725A013F041EC7FC6D7E606D6C15386D6C1578606D6C
+5D6E14016D5E6D6D1303606E6C49C8FC6E6C5B170E6E6C131E171C6E6C5B6E6C13781770
+6E6C13F06F5B6E13016EEB83C05FED7FC7DB3FE7C9FC16EFED1FFE5E150F6F5AB3A4ED1F
+FC020FB512FCA3413E7FBD44>I<003FB712F8A391C7EA1FF013F801E0EC3FE00180EC7F
+C090C8FC003EEDFF80A2003C4A1300007C4A5A12784B5A4B5AA200704A5AA24B5A4B5AA2
+C8485A4A90C7FCA24A5A4A5AA24A5AA24A5A4A5AA24A5A4A5AA24990C8FCA2495A494814
+1CA2495A495AA2495A495A173C495AA24890C8FC485A1778485A484815F8A24848140116
+034848140F4848143FED01FFB8FCA32E3E7BBD38>I<EAFFFCA4EAF000B3B3B3B3ABEAFF
+FCA40E5B77C319>I<486C13C00003130101001380481303000EEB070048130E0018130C
+0038131C003013180070133800601330A300E01370481360A400CFEB678039FFC07FE001
+E013F0A3007F133FA2003F131F01C013E0390F0007801C1C73BE2D>I<EAFFFCA4EA003C
+B3B3B3B3ABEAFFFCA40E5B7FC319>I<EA0180120313005A120E5A121812381230127012
+60A312E05AA412CFEAFFC013E0A3127FA2123F13C0EA0F000B1C7ABE19>96
+D<EB0FF8EBFFFE3903F01F8039078007E0000F6D7E9038E001F8D81FF07F6E7EA3157F6C
+5AEA0380C8FCA4EC1FFF0103B5FC90381FF87FEB7F803801FC00EA07F8EA0FE0485A485A
+A248C7FCEE038012FEA315FFA3007F5BEC03BF3B3F80071F8700261FC00E13CF3A07F03C
+0FFE3A01FFF807FC3A003FC001F0292A7DA82D>I<EA01FC12FFA3120712031201B1EC03
+FC91381FFF8091387C07E09039FDE001F09039FFC000FC4A137E91C77E49158049141F17
+C0EE0FE0A217F0A2160717F8AA17F0A2160FA217E0161F17C06D1580EE3F006D5C6E13FE
+9039F3C001F89039F1E003F09039E0780FC09026C03FFFC7FCC7EA07F82D407EBE33>I<
+49B4FC010F13E090383F00F8017C131E4848131F4848137F0007ECFF80485A5B121FA248
+48EB7F00151C007F91C7FCA290C9FC5AAB6C7EA3003FEC01C07F001F140316806C6C1307
+6C6C14000003140E6C6C131E6C6C137890383F01F090380FFFC0D901FEC7FC222A7DA828
+>I<ED01FC15FFA3150715031501B114FF010713E190381F80F990387E003D49131FD803
+F81307485A49130348481301121F123F5B127FA290C7FCA25AAA7E7FA2123FA26C7E000F
+14037F000714076C6C497E6C6C497ED8007C017913F890383F01F190380FFFC1903A01FE
+01FC002D407DBE33>I<EB01FE90380FFFC090383F03F09038FC01F848486C7E4848137E
+48487F000F158049131F001F15C04848130FA2127F16E090C7FCA25AA290B6FCA290C9FC
+A67EA27F123F16E06C7E1501000F15C06C6C13036DEB07806C6C1400C66C131E017E5B90
+381F80F8903807FFE0010090C7FC232A7EA828>I<EC1FC0EC7FF8903801F83C903807E0
+7E90380FC0FFEB1FC1EB3F811401137FEC00FE01FE137C1500AEB6FCA3C648C7FCB3AE48
+7E007F13FFA320407EBF1C>I<167C903903F801FF903A1FFF078F8090397E0FDE1F9038
+F803F83803F001A23B07E000FC0600000F6EC7FC49137E001F147FA8000F147E6D13FE00
+075C6C6C485AA23901F803E03903FE0FC026071FFFC8FCEB03F80006CAFC120EA3120FA2
+7F7F6CB512E015FE6C6E7E6C15E06C810003813A0FC0001FFC48C7EA01FE003E14004815
+7E825A82A46C5D007C153E007E157E6C5D6C6C495A6C6C495AD803F0EB0FC0D800FE017F
+C7FC90383FFFFC010313C0293D7EA82D>I<EA01FC12FFA3120712031201B1EC01FE9138
+07FFC091381E07E091387803F09138E001F8D9FDC07F148001FF6D7E91C7FCA25BA25BB3
+A6486C497EB5D8F87F13FCA32E3F7DBE33>I<EA01E0EA07F8A2487EA46C5AA2EA01E0C8
+FCACEA01FC127FA3120712031201B3AC487EB512F0A3143E7DBD1A>I<1478EB01FEA2EB
+03FFA4EB01FEA2EB00781400AC147FEB7FFFA313017F147FB3B3A5123E127F38FF807E14
+FEA214FCEB81F8EA7F01387C03F0381E07C0380FFF803801FC00185185BD1C>I<EA01FC
+12FFA3120712031201B292B51280A392383FFC0016E0168093C7FC153C5D5D4A5AEC07C0
+4A5A4AC8FC143E147F4A7E13FD9038FFDFC0EC9FE0140F496C7E01FC7F496C7E1401816E
+7E81826F7E151F826F7EA282486C14FEB539F07FFFE0A32B3F7EBE30>I<EA01FC12FFA3
+120712031201B3B3B1487EB512F8A3153F7DBE1A>I<2701F801FE14FF00FF902707FFC0
+0313E0913B1E07E00F03F0913B7803F03C01F80007903BE001F87000FC2603F9C06D487F
+000101805C01FBD900FF147F91C75B13FF4992C7FCA2495CB3A6486C496CECFF80B5D8F8
+7FD9FC3F13FEA347287DA74C>I<3901F801FE00FF903807FFC091381E07E091387803F0
+00079038E001F82603F9C07F0001138001FB6D7E91C7FC13FF5BA25BB3A6486C497EB5D8
+F87F13FCA32E287DA733>I<14FF010713E090381F81F890387E007E01F8131F4848EB0F
+804848EB07C04848EB03E0000F15F04848EB01F8A2003F15FCA248C812FEA44815FFA96C
+15FEA36C6CEB01FCA3001F15F86C6CEB03F0A26C6CEB07E06C6CEB0FC06C6CEB1F80D800
+7EEB7E0090383F81FC90380FFFF0010090C7FC282A7EA82D>I<3901FC03FC00FF90381F
+FF8091387C0FE09039FDE003F03A07FFC001FC6C496C7E6C90C7127F49EC3F805BEE1FC0
+17E0A2EE0FF0A3EE07F8AAEE0FF0A4EE1FE0A2EE3FC06D1580EE7F007F6E13FE9138C001
+F89039FDE007F09039FC780FC0DA3FFFC7FCEC07F891C9FCAD487EB512F8A32D3A7EA733
+>I<02FF131C0107EBC03C90381F80F090397F00387C01FC131CD803F8130E4848EB0FFC
+150748481303121F485A1501485AA448C7FCAA6C7EA36C7EA2001F14036C7E15076C6C13
+0F6C7E6C6C133DD8007E137990383F81F190380FFFC1903801FE0190C7FCAD4B7E92B512
+F8A32D3A7DA730>I<3901F807E000FFEB1FF8EC787CECE1FE3807F9C100031381EA01FB
+1401EC00FC01FF1330491300A35BB3A5487EB512FEA31F287EA724>I<90383FC0603901
+FFF8E03807C03F381F000F003E1307003C1303127C0078130112F81400A27E7E7E6D1300
+EA7FF8EBFFC06C13F86C13FE6C7F6C1480000114C0D8003F13E0010313F0EB001FEC0FF8
+00E01303A214017E1400A27E15F07E14016C14E06CEB03C0903880078039F3E01F0038E0
+FFFC38C01FE01D2A7DA824>I<131CA6133CA4137CA213FCA2120112031207001FB512C0
+B6FCA2D801FCC7FCB3A215E0A912009038FE01C0A2EB7F03013F138090381F8700EB07FE
+EB01F81B397EB723>I<D801FC14FE00FF147FA3000714030003140100011400B3A51501
+A31503120015076DEB06FF017E010E13806D4913FC90381FC078903807FFE00100903880
+FE002E297DA733>I<B539E00FFFE0A32707FE000313006C48EB00FC5E00015D7F00005D
+A26D13016D5CA26D6C485AA2ECC007011F91C7FCA290380FE00EA2ECF01E0107131CA26D
+6C5AA2ECFC7801011370A2ECFEF001005BA2EC7FC0A36E5AA26EC8FCA3140E2B287EA630
+>I<B53BC3FFFE03FFF8A3290FFE003FE00013C06C486D48EB3F806C4817006D010F141E
+00016F131C15076D163C00004A6C1338A2017F5E4B7E151DD93F805DED3DFC1538D91FC0
+4A5AED78FE9238707E03D90FE0017F5BEDE03F02F0140701070387C7FC9138F1C01F02F9
+148F010315CE9138FB800F02FF14DE6D15FCED00076D5DA24A1303027E5CA2027C130102
+3C5C023813003D287EA642>I<B539F01FFFE0A30003D9C00F1300C690388007F8D97F00
+13E002805BD93FC05B011F49C7FC90380FE00EECF01E6D6C5A01035B6D6C5A6E5AEB00FF
+6E5A6E5A81141F814A7E81147BECF1FC903801E1FEECC0FF01037F49486C7ED90F007F01
+1E6D7E013E130F496D7E01FC80486C80000F4A7EB539803FFFF8A32D277FA630>I<B539
+E00FFFE0A32707FE000313006C48EB01FC6F5A00015D7F00005DA2017F495AA2EC800301
+3F5CA26D6C48C7FCA26E5A010F130EA26D6C5AA2ECF83C01031338A26D6C5AA2ECFEF001
+005BA2EC7FC0A36E5AA36EC8FCA2140EA2141E141C143C1438A2147800181370127EB45B
+A2495AA248485AD87E07C9FCEA780EEA3C3CEA1FF8EA07E02B3A7EA630>I<001FB61280
+A2EBE0000180140049485A001E495A121C4A5A003C495A141F00385C4A5A147F5D4AC7FC
+C6485AA2495A495A130F5C495A90393FC00380A2EB7F80EBFF005A5B4848130712074914
+00485A48485BA248485B4848137F00FF495A90B6FCA221277EA628>I<B812F0A22C0280
+982D>I E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fh cmbx10 10.95 43
+/Fh 43 122 df<EA0FC0EA1FE0EA3FF0EA7FF8EAFFFCA6EA7FF8EA3FF0EA1FE0EA0FC00E
+0E798D1D>46 D<140F143F5C495A130F48B5FCB6FCA313F7EAFE071200B3B3A8007FB612
+F0A5243C78BB34>49 D<903803FF80013F13F890B512FE00036E7E4881260FF80F7F261F
+C0037F4848C67F486C6D7E6D6D7E487E6D6D7EA26F1380A46C5A6C5A6C5A0007C7FCC8FC
+4B1300A25E153F5E4B5AA24B5A5E4A5B4A5B4A48C7FC5D4A5AEC1FE04A5A4A5A9139FF00
+0F80EB01FC495A4948EB1F00495AEB1F8049C7FC017E5C5B48B7FC485D5A5A5A5A5AB7FC
+5EA4293C7BBB34>I<903801FFE0010F13FE013F6D7E90B612E04801817F3A03FC007FF8
+D807F06D7E82D80FFC131F6D80121F7FA56C5A5E6C48133FD801F05CC8FC4B5A5E4B5A4A
+5B020F5B902607FFFEC7FC15F815FEEDFFC0D9000113F06E6C7E6F7E6F7E6F7E1780A26F
+13C0A217E0EA0FC0487E487E487E487EA317C0A25D491580127F49491300D83FC0495A6C
+6C495A3A0FFE01FFF86CB65A6C5DC61580013F49C7FC010313E02B3D7CBB34>I<ED01F8
+15031507A2150F151F153FA2157F15FF5C5CA25C5CEC1FBFEC3F3F143E147C14FCEB01F8
+14F0EB03E01307EB0FC0EB1F801400133E137E5B485A5B485A1207485A5B48C7FC5A127E
+5AB812F8A5C8387FF800AA49B612F8A52D3C7DBB34>I<00071538D80FE0EB01F801FE13
+3F90B6FC5E5E5E5E93C7FC5D15F85D15C04AC8FC0180C9FCA9ECFFC0018713FC019F13FF
+90B67E020113E09039F8007FF0496D7E01C06D7E5B6CC77FC8120F82A31780A21207EA1F
+C0487E487E12FF7FA21700A25B4B5A6C5A01805C6CC7123F6D495AD81FE0495A260FFC07
+5B6CB65A6C92C7FCC614FC013F13F0010790C8FC293D7BBB34>I<EC07FF023F13C049B5
+12F001078049EB03FC90383FF80090397FE001FE9038FFC0034849487E48495AA2485A12
+0FA2485A6F5A003F6E5A6F5A92C8FC485AA21402EC3FFE00FF496C7E01F9B512E001FB80
+9138E03FF89039FF800FFC4A6C7E825B6F13804915C0A317E05BA4127FA5123FA26D15C0
+121FA2000F4A13806D150012076C6C495A6C6D485A6C9038E07FF86DB55A6D5C6D148001
+0749C7FC010013F02B3D7CBB34>I<ECFFF0010713FE011F6D7E017F14E09039FFC07FF0
+3A01FE001FF848486D7E48486D7E1503485A8281121FA27F7F7F6D5B02C05B14F06C6D48
+5A9138FE0FF89138FF9FF06CECFFE06C5D5E6C92C7FC6C816D14E0011F80498090B67E48
+812607FE3F7F48486C1480381FF807D9F00114C048486C7E007F8049010F13E015034848
+7F81167FA2163FA36D15C0127FEE7F807F6C6CECFF006C6C5B01FEEB07FE3A0FFFC03FFC
+6C90B55A000115E06C6C5C011F49C7FC010113F02B3D7CBB34>56
+D<B812F8EFFF8018F018FC8426003FFCC7EA3FFF050F13807113C07113E08319F0A27113
+F8A719F05FA24D13E019C04D13804D1300EF3FFE933801FFF891B712E0188018F818FE02
+FCC7380FFF80050313C07113E07113F019F8F07FFCA2F03FFEA219FFA38460A419FE187F
+A2F0FFFC4D13F85F4D13F0053F13E0BA12C0190018FC18F095C7FC403E7DBD4A>66
+D<922607FFC0130E92B500FC131E020702FF133E023FEDC07E91B7EAE1FE01039138803F
+FB499039F80003FF4901C01300013F90C8127F4948151FD9FFF8150F48491507485B4A15
+03481701485B18004890CAFC197E5A5B193E127FA349170012FFAC127F7F193EA2123FA2
+7F6C187E197C6C7F19FC6C6D16F86C6D150119F06C6D15036C6DED07E0D97FFEED0FC06D
+6CED3F80010F01C0ECFF006D01F8EB03FE6D9039FF801FFC010091B55A023F15E0020715
+80020002FCC7FC030713C03F407ABE4C>I<BAFCA4198026003FFEC7123F170717018318
+3FA2181FF00FC0A31807EE07C0A3F003E0A3160F95C7FC161F163F16FF91B6FCA54AC6FC
+163F161F040F147CA2160719F8A593C71201A219F01803A21807A2180FF01FE0183F18FF
+1703173FBAFCA219C0A33E3D7DBC45>69 D<B912FEA48426003FFEC77E170F1703170084
+A284F01F80A3180FA2EE07C0A2F007C0A4040F90C7FCA2161F163F16FF91B6FCA54AC6FC
+163F161F160FA21607A693C9FCACB712E0A53A3D7DBC42>I<922607FFC0130E92B500FC
+131E020702FF133E023FEDC07E91B7EAE1FE01039138803FFB499039F80003FF4901C013
+00013F90C8127F4948151FD9FFF8150F48491507485B4A1503481701485B18004890CAFC
+197E5A5B193E127FA34994C7FC12FFAB0407B612FC127F7FA3003F92C7383FFE00A27F7E
+A26C7FA26C7F6C7FA26C7F6C7FD97FFE157F6D6C7E010F01E014FF6D01F813036D9038FF
+801F010091B512F3023F15C00207ED803E02009138FE000E030701E090C7FC46407ABE52
+>I<B71280A526003FFEC7FCB3B3B0B71280A5213E7DBD28>73 D<B76C90B6FCA526003F
+FEC8D801FCC7FCF007F84E5A4E5AF03F804EC8FC18FEEF03FC4D5A4D5AEF1FC04D5A4DC9
+FCEE01FE4C5A4C5AEE0FE04C5A4C5A16FF4B7F4B7F5D4B7F4B7F037F7F92B5FC6E486C7E
+9238F83FFF03F0804B7E4B6C7F4B6C7F0300804A7F707F707F84717E83717F85717F8371
+7F85717F83727E85727F84B7D88007B612C0A54A3E7DBD52>75 D<B6037FB512E0A28181
+81D8003F6D9139001F800081A281816E7E6E7F6E7F80826E7F6E7F6E7F6E7F157F826F7F
+6F7F6F7F6F7F81836F7F6F7F707E701380A27013C07013E07013F07013F87013FCA27013
+FEEF7FFF71139F7113DF8319FF8383838384A28484848484A284B600C080197F193F191F
+A24B3E7DBD52>78 D<ED3FFF0203B512F0021F14FE027F6E7E902701FFF80713E00107D9
+C00013F84990C7EA3FFCD93FFCEC0FFF49486E7F49486E7F48496E7F4A80488448496F7E
+A24890C96C7E4884A249161F003F84A34848701380A400FF19C0AD007F19806D5EA3003F
+1900A26D5E6C60A26C6D4B5AA26C6D4B5A6C6D4A5BA26C6D4A5B6C6D4A5B6D6C4A5B6DB4
+023F90C7FC6D01C0EBFFFE0107D9F80713F8010190B612E06D5E021F4AC8FC020314F0DA
+003F90C9FC42407ABE4F>I<B812F017FF18C018F018FC26003FFCC77FEF1FFF71138071
+13C07113E0A27113F0A319F8A819F0A34D13E019C05F4D1380053F1300EFFFFE91B712F8
+60188005FCC7FC4ACAFCB3A4B77EA53D3E7DBD47>I<B87E17FCEFFF8018F08428003FFC
+000113FE9338003FFF050F7F717F717FA2858385A761A25F61614D5B4D90C8FCEF3FFE4C
+B45A91B712F018C04DC9FC717E9126FC000F7F040113F0707F717EA2717EA2717EA685A6
+F207C019C0A271140F07E01380B76DEBF01F719038FC3F007190B5FC716C5B061F13F8CB
+000113E04A3F7DBD4E>82 D<903A03FFC001C0011FEBF803017FEBFE0748B6128F4815DF
+48010013FFD80FF8130F48481303497F4848EB007F127F49143F161F12FF160FA27F1607
+A27F7F01FC91C7FCEBFF806C13F8ECFFC06C14FCEDFF806C15E016F86C816C816C816C16
+806C6C15C07F010715E0EB007F020714F0EC003F1503030013F8167F163F127800F8151F
+A2160FA27EA217F07E161F6C16E06D143F01E015C001F8EC7F8001FEEB01FF9026FFE007
+13004890B55A486C14F8D8F81F5CD8F00314C027E0003FFEC7FC2D407ABE3A>I<003FB9
+12FCA5903BFE003FFE003FD87FF0EE0FFE01C0160349160190C71500197E127EA2007C18
+3EA400FC183F48181FA5C81600B3AF010FB712F8A5403D7CBC49>I<B76C90B61280A526
+003FFEC9003EC7FCB3B3A4197E011F177C80A26D17FC616D6D14014E5A6D6D4A5A6D6D14
+0F6D01F8EC3FC0DA7FFEECFF8091273FFFC00F90C8FC020F90B512FC02035D020015E003
+1F1480030101F8C9FC493F7DBD50>I<903807FFC0013F13F848B6FC48812607FE037F26
+0FF8007F6DEB3FF0486C806F7EA36F7EA26C5A6C5AEA01E0C8FC153F91B5FC130F137F39
+01FFFE0F4813E0000F1380381FFE00485A5B485A12FF5BA4151F7F007F143F6D90387BFF
+806C6C01FB13FE391FFF07F36CEBFFE100031480C6EC003FD91FF890C7FC2F2B7DA933>
+97 D<13FFB5FCA512077EAFEDFFE0020713FC021FEBFF80027F80DAFF8113F09139FC00
+3FF802F06D7E4A6D7E4A13074A80701380A218C082A318E0AA18C0A25E1880A218005E6E
+5C6E495A6E495A02FCEB7FF0903AFCFF01FFE0496CB55AD9F01F91C7FCD9E00713FCC700
+0113C033407DBE3A>I<EC7FF00107B5FC011F14C0017F14E09039FFF01FF0489038800F
+F848EB001F4848EB3FFC120F485AA2485AA2007FEC1FF849EB0FF0ED03C000FF91C7FCAB
+127F7FA3003F153E7F001F157E6C6C147C6C6C14FC91388001F86C9038C003F0C69038F8
+1FE06DB512C0011F14800107EBFE009038007FF0272B7DA92E>I<EE07F8ED07FFA5ED00
+3F161FAFEC7FF0903807FFFE011FEBFF9F017F14DF9039FFF01FFF48EBC00348EB000148
+48EB007F485A001F153F5B123FA2127F5BA212FFAA127FA37F123FA26C6C147F120F6D14
+FF6C6C01037F6C6D48EBFFE06CEBF03F6C6CB512BF6D143F010713FC010001E0EBE00033
+407DBE3A>I<ECFFF0010713FE011F6D7E017F809039FFE07FE0489038801FF048496C7E
+48486D7E48486D7E121F491301003F81A2485A6F1380A212FFA290B7FCA401F0C9FCA512
+7FA27F123FEE0F806C7E161F6C6C15006C6C5C6C6D137E6C9038E001FC6C9038F80FF801
+3FB55A6D14C0010391C7FC9038007FF8292B7DA930>I<EC07FE91387FFF8049B512C001
+0714E090390FFE3FF0EB1FF090393FE07FF8EB7FC013FF1480A2489038003FF0ED1FE0ED
+0FC092C7FCAAB612E0A500010180C7FCB3AC007FEBFF80A525407DBF20>I<903A03FF80
+07F0013F9038F83FF8499038FCFFFC48B712FE48018313F93A07FC007FC34848EB3FE100
+1FEDF1FC4990381FF0F81700003F81A7001F5DA26D133F000F5D6C6C495A3A03FF83FF80
+91B5C7FC4814FC01BF5BD80F03138090CAFCA2487EA27F13F06CB6FC16F016FC6C15FF17
+806C16C06C16E01207001F16F0393FE000034848EB003F49EC1FF800FF150F90C81207A5
+6C6CEC0FF06D141F003F16E001F0147FD81FFC903801FFC02707FF800F13006C90B55AC6
+15F8013F14E0010101FCC7FC2F3D7DA834>I<EA01F8487E487E487E481380A66C13006C
+5A6C5A6C5AC8FCA913FFB5FCA512077EB3ABB512F8A515407CBF1D>105
+D<13FFB5FCA512077EB3B3AFB512FCA5163F7CBE1D>108 D<01FFD91FF8ECFFC0B590B5
+010713F80203DAC01F13FE4A6E487FDA0FE09026F07F077F91261F003FEBF8010007013E
+DAF9F0806C0178ECFBC04A6DB4486C7FA24A92C7FC4A5CA34A5CB3A4B5D8FE07B5D8F03F
+EBFF80A551297CA858>I<01FFEB1FF8B5EBFFFE02036D7E4A80DA0FE07F91381F007F00
+07013C806C5B4A6D7E5CA25CA35CB3A4B5D8FE0FB512E0A533297CA83A>I<EC7FF09038
+03FFFE011FEBFFC0017F14F09039FFE03FF8489038800FFC3A03FE0003FE48486D7E000F
+168048486D13C0A2003F16E049147F007F16F0A400FF16F8AA007F16F0A46C6CECFFE0A2
+001F16C06C6C491380A26C6C4913003A03FF800FFE6C9038E03FFC6C6CB512F0011F14C0
+010791C7FC9038007FF02D2B7DA934>I<01FFEBFFE0B5000713FC021FEBFF80027F80DA
+FF8113F09139FC007FF8000701F06D7E6C496D7E4A130F4A6D7E1880A27013C0A38218E0
+AA4C13C0A318805E18005E6E5C6E495A6E495A02FCEBFFF0DAFF035B92B55A029F91C7FC
+028713FC028113C00280C9FCACB512FEA5333B7DA83A>I<3901FE01FE00FF903807FF80
+4A13E04A13F0EC3F1F91387C3FF8000713F8000313F0EBFFE0A29138C01FF0ED0FE09138
+8007C092C7FCA391C8FCB3A2B6FCA525297DA82B>114 D<90383FFC1E48B512BE000714
+FE5A381FF00F383F800148C7FC007E147EA200FE143EA27E7F6D90C7FC13F8EBFFE06C13
+FF15C06C14F06C806C806C806C80C61580131F1300020713C014000078147F00F8143F15
+1F7EA27E16806C143F6D140001E013FF9038F803FE90B55A15F0D8F87F13C026E00FFEC7
+FC222B7DA929>I<EB07C0A5130FA4131FA3133F137FA213FF5A1207001FEBFFFEB6FCA4
+0001EBC000B3151FA96CEBE03EA2017F137EECF8FC90383FFFF86D13F0010713E0010013
+80203B7EB929>I<D9FF80EB0FF8B5EB0FFFA50007EC007F6C153FB3A5167FA316FF6C5C
+4B7F6C903AC007DFFFE09138F01F9F6DB5121F6D13FE010F13F8010101E0EBE000332A7C
+A83A>I<B500FC90383FFFC0A5000101C0903803E0006E1307A26C5E6E130F017F5D6E13
+1F013F92C7FC6E5B011F143E6E137E010F147C6E13FCA26D5C15816D5C15C36D5C15E76D
+5C15FF6E5BA36E90C8FCA26E5AA26E5AA26E5AA26E5AA232287EA737>I<B53CFC3FFFFC
+03FFFEA50003D980009039C0000F806E161F6C037F15006E496C5B6C183E836E48157E01
+7F177C6E486D13FC013F02EF5C83DAFC071401011F02C75CDAFE0FEBFE03010F02835C17
+FFDAFF1F14076D02015C03BF148F6DD9BE005C18CF03FE14DF6D49017F90C7FC18FF6D49
+6D5AA36E486D5AA26E486D5AA36E486D5AA26E486D5A47287EA74C>I<B5D8FC03B51280
+A5C69026E0007FC7FC6E13FE6D6C5B6D6C485A6D6C485A010F13076D6C485AED9FC06DEB
+FF806D91C8FC6D5B6E5AA2143F6E7E140F814A7F4A7F4A7F02FE7F903801FC7F49486C7E
+02F07F49486C7E49486C7E011F7F49486C7FD97F008001FE6D7FB5D8C007EBFFC0A53228
+7EA737>I<B500FC90383FFFC0A5000101C0903803E0006E1307A26C5E6E130F017F5D6E
+131F013F92C7FC6E5B011F143E6E137E010F147C6E13FCA26D5C15816D5C15C36D5C15E7
+6D5C15FF6E5BA36E90C8FCA26E5AA26E5AA26E5AA26E5AA35D14075D000E130FD83F805B
+387FC01FD8FFE090C9FC5C143E147E5CEBC1F8387FC3F0387E0FE06CB45A6C5B6C48CAFC
+EA03F8323B7EA737>I E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fi cmbx12 14.4 33
+/Fi 33 121 df<157815FC14031407141F14FF130F0007B5FCB6FCA2147F13F0EAF800C7
+FCB3B3B3A6007FB712FEA52F4E76CD43>49 D<EC3FFE0103B512E0010F14FC013F14FF90
+B712C048D9C07F7F2703FE000F13F8D807F801037FD80FE06D7F48486D7F48488001F016
+80486C6E13C07F486C6E13E07FA27013F0A56C5AA26C5AEA0FF0EA03C0C914E05EA218C0
+5E1880A24C13005F4C5A4B5B5F4B5B5F4B5B4B90C7FC4B5A5E4B5AED7FE04B5A4A5B4A48
+C8FC4A5A5D4A48EB01F04A5AEC3F804AC7FC02FEEC03E0495A495A495A495AD91F801407
+49C8FC013E150F017FB7FC90B812C05A5A5A5A5A5A5AB9FC1880A4344E79CD43>I<9138
+0FFFC091B512FC0107ECFF80011F15E090263FF8077F9026FF800113FC4848C76C7ED803
+F86E7E491680D807FC8048B416C080486D15E0A4805CA36C17C06C5B6C90C75AD801FC16
+80C9FC4C13005FA24C5A4B5B4B5B4B13C04B5BDBFFFEC7FC91B512F816E016FCEEFF80DA
+000713E0030113F89238007FFE707E7013807013C018E07013F0A218F8A27013FCA218FE
+A2EA03E0EA0FF8487E487E487EB57EA318FCA25E18F891C7FC6C17F0495C6C4816E001F0
+4A13C06C484A1380D80FF84A13006CB44A5A6CD9F0075BC690B612F06D5D011F15800103
+02FCC7FCD9001F1380374F7ACD43>I<177C17FEA2160116031607160FA2161F163F167F
+A216FF5D5DA25D5DED1FBFED3F3F153E157C15FCEC01F815F0EC03E01407EC0FC01580EC
+1F005C147E147C5C1301495A495A5C495A131F49C7FC133E5B13FC485A5B485A1207485A
+485A90C8FC123E127E5ABA12C0A5C96C48C7FCAF020FB712C0A53A4F7CCE43>I<D80380
+150ED807E0157E01FEEC03FED9FFF0137F91B65A5F5F5F5F5F94C7FC5E5E16F016C093C8
+FC15F801E190C9FC01E0CAFCABEC0FFF027F13F001E3B512FE01E76E7E9026FFF8077FDA
+C0017F49C713F8496E7E49143F4981496E7E6C481680C9FC18C08218E0A418F0A3EA0FE0
+487E487E487E487EA418E0A35B6C484A13C05B491680003EC85A003F17006C6C4A5A6D5D
+6C6C4A5AD807F8495BD803FE01075B2701FFC03F5B6C90B65A013F4AC7FC6D14F8010314
+C09026007FF8C8FC344F79CD43>I<ED0FFF92B512E0020780021F14FC91397FFE03FE90
+3A01FFF0007F4901C0EB3F804990C7121F4948EC7FC0494814FF49484913E049485B01FF
+5C485BA2485B5AA2486F13C04A6D1380486F1300177E94C7FC5AA291CAFC5AA215089138
+01FFF8020713FFB54814C04A14F04AC66C7E023C6D7E4A6D7E4A6D7E7013804A15C0A24A
+15E07013F05C18F8A491C714FCA37EA67EA46C17F880A27E18F06C5D18E06C6D15C07E6E
+4913806C6D15006D6C495A6D6CEB7FFC6DB448485A6D90B55A010315C0010092C7FC023F
+13FC020713C0364F7ACD43>I<932601FFFCEC01C0047FD9FFC013030307B600F8130703
+3F03FE131F92B8EA803F0203DAE003EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01
+800203B5FC494848C9FC4901F8824949824949824949824949824990CA7E494883A24849
+83485B1B7F485B481A3FA24849181FA3485B1B0FA25AA298C7FC5CA2B5FCAE7EA280A2F3
+07C07EA36C7FA21B0F6C6D1980A26C1A1F6C7F1C006C6D606C6D187EA26D6C606D6D4C5A
+6D6D16036D6D4C5A6D6D4C5A6D01FC4C5A6D6DEE7F806D6C6C6C4BC7FC6E01E0EC07FE02
+0F01FEEC1FF80203903AFFE001FFF0020091B612C0033F93C8FC030715FCDB007F14E004
+0101FCC9FC525479D261>67 D<BC1280A5D8000701F8C7000114C0F0001F19071901851A
+7F1A3F1A1FA2F20FE0A21A07A31A03A318F81BF01A01A497C7FC1701A317031707170F17
+7F92B6FCA59238F8007F170F170717031701A317001B3EA31B7CA395C8FCA21BFCA21BF8
+A21A01A31A031BF01A071A0FA21A1F1A3FF27FE0F101FF1907191F0603B5FCBCFCA21BC0
+A34F517CD058>69 D<BB12FEA5D8000701F8C700077FF0007F191F190785858586861B80
+A21A1FA31A0FA41BC006F81307A497C7FCA31701A317031707170F177F92B6FCA59238F8
+007F170F170717031701A31700A795C9FCB3B812F8A54A517CD055>I<B812C0A5D80007
+01F8C7FCB3B3B3B2B812C0A52A527CD132>73 D<B600FC93B7FC8181A282D800076E9239
+003FFC0070EE07E08282A28202EF7F02E77F02E380A202E18002E0806F7F6F7F6F7FA26F
+7F6F7F6F806F80A26F80707F707F707F707FA2707F7080708070808583717F717F717F71
+7FA27114807114C07114E07213F07213F8A27213FC7213FE7213FF721487A27214C77214
+E77313F77313FF85A285858585A28586868686A286868686A2D93FFC187FB7173F1B1F1B
+0F1B07755A60527CD169>78 D<93380FFFC00303B6FC031F15E092B712FC0203D9FC0013
+FF020F01C0010F13C0023F90C7000313F0DA7FFC02007F494848ED7FFE4901E0ED1FFF49
+496F7F49496F7F4990C96C7F49854948707F4948707FA24849717E48864A83481B804A83
+481BC0A2481BE04A83A2481BF0A348497113F8A5B51AFCAF6C1BF86E5FA46C1BF0A26E5F
+6C1BE0A36C6D4D13C0A26C6D4D1380A26C1B006C6D4D5A6E5E6C626D6C4C5B6D6D4B5B6D
+6D4B5B6D6D4B5B6D6D4B5B6D6D4B90C7FC6D6D4B5A6D01FF02035B023F01E0011F13F002
+0F01FC90B512C0020390B7C8FC020016FC031F15E0030392C9FCDB001F13E0565479D265
+>I<BAFC19F819FF1AE086D8000701F0C7001F13FC060113FF726C13807313C0070F13E0
+1BF0857313F81BFCA27313FEA41BFFA81BFEA31BFC61A21BF84F13F04F13E0614F13C04F
+13004E485A061F5B92B812F01AC04FC7FC19E003F8CBFCB3AEB812C0A550527CD15C>I<
+B912F0F0FF8019F819FF1AC0D8000701F0C714F0060F7F060113FE727F737F737F85737F
+87A2737FA387A863A2616363A24F5B4F5B4F90C8FC4F5A06035B060F13F095B512C092B8
+C9FC19F819E019F89226F0000313FE9439007FFF80727F727F727F727F727F8684A28684
+A787A71D1C75133EA38575137E73157C7513FC731401B86C6D9038F803F807039038FE07
+F07390B512E0736C14C0080F1400CEEA7FFC5F537CD164>82 D<91260FFF80130791B500
+F85B010702FF5B011FEDC03F49EDF07F9026FFFC006D5A4801E0EB0FFD4801800101B5FC
+4848C87E48488149150F001F824981123F4981007F82A28412FF84A27FA26D82A27F7F6D
+93C7FC14C06C13F014FF15F86CECFF8016FC6CEDFFC017F06C16FC6C16FF6C17C06C836C
+836D826D82010F821303010082021F16801400030F15C0ED007F040714E01600173F050F
+13F08383A200788200F882A3187FA27EA219E07EA26CEFFFC0A27F6D4B13806D17006D5D
+01FC4B5A01FF4B5A02C04A5A02F8EC7FF0903B1FFFC003FFE0486C90B65AD8FC0393C7FC
+48C66C14FC48010F14F048D9007F90C8FC3C5479D24B>I<003FBC1280A59126C0003F90
+38C0007F49C71607D87FF8060113C001E08449197F49193F90C8171FA2007E1A0FA3007C
+1A07A500FC1BE0481A03A6C994C7FCB3B3AC91B912F0A553517BD05E>I<B800C00103B6
+12FCA5D8000701F8CAEBF000F31F80B3B3B11B3FA26D97C7FC81637F1B7E6D6D17FE505A
+6E7E505A6E6D15076E4D5A6E6D4B5A6E6D4B5A6E01F84B5A6E6DDA03FFC8FC6E6CB46CEB
+0FFE6F9039F001FFF8030F90B65A030316C0DB007F92C9FC040F14F8DC007F13805E537C
+D167>I<EC7FFF0107B512F0013F14FE90B77E48D9E00F7F2703FE000113F0486C6D7F6E
+EB3FFC48826E131F83707FA36C496D7FA26C90C7FC6C5AC9FCA6037FB5FC020FB6FC91B7
+FC01071487013FEBF0074913803901FFFC004813F0485B485B485B4890C7FC5A5BA2485A
+A45EA26D5C007F151D163D6C6C02797F6C6D01F113F86C9026C003E1EBFFE06C9026F81F
+C014F06C90B5487EC6ED001F011F01FC010713E0010101E090C8FC3C387CB641>97
+D<913801FFF8021FEBFF8091B612F0010315FC010F9038C00FFE903A1FFE0001FFD97FFC
+491380D9FFF05B4817C048495B5C5A485BA2486F138091C7FC486F1300705A4892C8FC5B
+A312FFAD127F7FA27EA2EF03E06C7F17076C6D15C07E6E140F6CEE1F806C6DEC3F006C6D
+147ED97FFE5C6D6CEB03F8010F9038E01FF0010390B55A01001580023F49C7FC020113E0
+33387CB63C>99 D<4DB47E0407B5FCA5EE001F1707B3A4913801FFE0021F13FC91B6FC01
+0315C7010F9038E03FE74990380007F7D97FFC0101B5FC49487F4849143F484980485B83
+485B5A91C8FC5AA3485AA412FFAC127FA36C7EA37EA26C7F5F6C6D5C7E6C6D5C6C6D49B5
+FC6D6C4914E0D93FFED90FEFEBFF80903A0FFFC07FCF6D90B5128F0101ECFE0FD9003F13
+F8020301C049C7FC41547CD24B>I<913803FFC0023F13FC49B6FC010715C04901817F90
+3A3FFC007FF849486D7E49486D7E4849130F48496D7E48178048497F18C0488191C7FC48
+17E0A248815B18F0A212FFA490B8FCA318E049CAFCA6127FA27F7EA218E06CEE01F06E14
+037E6C6DEC07E0A26C6DEC0FC06C6D141F6C6DEC3F806D6CECFF00D91FFEEB03FE903A0F
+FFC03FF8010390B55A010015C0021F49C7FC020113F034387CB63D>I<DA3FFF14FF0103
+B5D8F00713C0010FDAFC1F13E0013FECFF7F90267FFC0F9038FF9FF09026FFE001EBF83F
+48496C13E0484990387FF01F4890C7D83FF813E0489338FC0FC0F0078048486E6CC7FCA2
+003F82A9001F5EA26C6C4A5AA26C5E6C6D495A6C6D495A6C6D485BDAFC0F5B4890B6C8FC
+D803EF14FC01C314F02607C03F90C9FC91CBFCA2120FA37FA213F813FE90B7FC6C16F817
+FF18C06C836C836C836D828448B9FC12074848C700031480D81FF8EC003F484815074848
+6F13C083485A83A56D5D007F18806D5D003F18006C6C4B5AD80FFEED1FFC6C6C6CEC7FF8
+6C01E049485A6C01FE011F5B6C6CB71280010F03FCC7FC010115E0D9000F01FCC8FC3C4F
+7CB543>103 D<137F497E000313E0487FA2487FA76C5BA26C5BC613806DC7FC90C8FCAD
+EB3FF0B5FCA512017EB3B3A6B612E0A51B547BD325>105 D<EB3FF0B5FCA512017EB3B3
+B3B1B612F0A51C537BD225>108 D<D93FF0D91FFCEDFFE0B591B500C0010713FE030302
+F0011F6D7E030F6E017F8092271FE07FFCD9FF037F922A3F001FFE01F8007F0003027C91
+26FF03E080C602F06DD90780137FDAF1E0038FC77FDAF3C0159EDAF7806D01BC143F07FC
+8102FFC75C4A5EA24A5EA44A5EB3ACB6D8F807B6D8C03FB512FEA567367BB570>I<D93F
+F0EB1FFCB591B512C0030314F0030F8092391FE07FFC92393F001FFE0003027C80C602F0
+7FDAF1E081ECF3C0DAF7807F8502FFC7FC5CA25CA45CB3ACB6D8F807B612C0A542367BB5
+4B>I<913801FFE0021F13FE91B612C0010315F0010F9038807FFC903A1FFC000FFED97F
+F86D6C7E49486D7F48496D7F48496D7F4A147F48834890C86C7EA24883A248486F7EA300
+7F1880A400FF18C0AC007F1880A3003F18006D5DA26C5FA26C5F6E147F6C5F6C6D4A5A6C
+6D495B6C6D495B6D6C495BD93FFE011F90C7FC903A0FFF807FFC6D90B55A010015C0023F
+91C8FC020113E03A387CB643>I<903A3FF001FFE0B5010F13FE033FEBFFC092B612F002
+F301017F913AF7F8007FFE0003D9FFE0EB1FFFC602806D7F92C76C7F4A824A6E7F4A6E7F
+A2717FA285187F85A4721380AC1A0060A36118FFA2615F616E4A5BA26E4A5B6E4A5B6F49
+5B6F4990C7FC03F0EBFFFC9126FBFE075B02F8B612E06F1480031F01FCC8FC030313C092
+CBFCB1B612F8A5414D7BB54B>I<90397FE003FEB590380FFF80033F13E04B13F09238FE
+1FF89139E1F83FFC0003D9E3E013FEC6ECC07FECE78014EF150014EE02FEEB3FFC5CEE1F
+F8EE0FF04A90C7FCA55CB3AAB612FCA52F367CB537>114 D<903903FFF00F013FEBFE1F
+90B7FC120348EB003FD80FF81307D81FE0130148487F4980127F90C87EA24881A27FA27F
+01F091C7FC13FCEBFFC06C13FF15F86C14FF16C06C15F06C816C816C81C681013F158001
+0F15C01300020714E0EC003F030713F015010078EC007F00F8153F161F7E160FA27E17E0
+7E6D141F17C07F6DEC3F8001F8EC7F0001FEEB01FE9039FFC00FFC6DB55AD8FC1F14E0D8
+F807148048C601F8C7FC2C387CB635>I<143EA6147EA414FEA21301A313031307A2130F
+131F133F13FF5A000F90B6FCB8FCA426003FFEC8FCB3A9EE07C0AB011FEC0F8080A26DEC
+1F0015806DEBC03E6DEBF0FC6DEBFFF86D6C5B021F5B020313802A4D7ECB34>I<D93FF8
+913801FFC0B50207B5FCA50003ED001FC61607B3AE5FA35FA2017F5D173B177B6D6C14F3
+DC01E313F06D6CD907C3EBFFC0903A0FFFC03F836D90B51203010114FE6D6C13F8020701
+E091C7FC42377BB54B>I<007FB500F090387FFFFEA5C66C48C7000F90C7FC6D6CEC07F8
+6D6D5C6D6D495A6D4B5A6F495A6D6D91C8FC6D6D137E6D6D5B91387FFE014C5A6E6C485A
+6EEB8FE06EEBCFC06EEBFF806E91C9FCA26E5B6E5B6F7E6F7EA26F7F834B7F4B7F92B5FC
+DA01FD7F03F87F4A486C7E4A486C7E020F7FDA1FC0804A486C7F4A486C7F02FE6D7F4A6D
+7F495A49486D7F01076F7E49486E7E49486E7FEBFFF0B500FE49B612C0A542357EB447>
+120 D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fj cmsy8 8 1
+/Fj 1 4 df<130C131EA50060EB01800078130739FC0C0FC0007FEB3F80393F8C7F0038
+07CCF83801FFE038007F80011EC7FCEB7F803801FFE03807CCF8383F8C7F397F0C3F8000
+FCEB0FC039781E078000601301000090C7FCA5130C1A1D7C9E23>3
+D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fk cmr12 12 16
+/Fk 16 122 df<14FF010713E090381F81F890383E007C01FC133F4848EB1F8049130F48
+48EB07C04848EB03E0A2000F15F0491301001F15F8A2003F15FCA390C8FC4815FEA54815
+FFB3A46C15FEA56D1301003F15FCA3001F15F8A26C6CEB03F0A36C6CEB07E0000315C06D
+130F6C6CEB1F806C6CEB3F00013E137C90381F81F8903807FFE0010090C7FC28447CC131
+>48 D<EB03FE90381FFFC0017F13F03901F80FFC3903C001FE48486C7E000EC7EA7F8048
+EC3FC0ED1FE04815F00030140F007015F800601407126CB415FC7F7F1503A46C4813076C
+C7FCC8FC16F8A2150F16F0151F16E0A2ED3FC0ED7F8016005D5D4A5A4A5A4A5A5D4A5A4A
+5A4AC7FC147C5C5C495A495A495A49C7120C131E5B013814185B5B485A4848143848C812
+30000E1570001FB612F0A25A5AB712E0A326427BC131>50 D<49B4FC010F13E0013F13FC
+9038FE01FE3A01F0007F80D803C0EB3FC048C7EA1FE0120EED0FF0EA0FE0486C14F8A215
+077F5BA26C48130FEA03C0C813F0A3ED1FE0A2ED3FC01680ED7F0015FE4A5AEC03F0EC1F
+C0D90FFFC7FC15F090380001FCEC007FED3F80ED1FC0ED0FE016F0ED07F816FC150316FE
+A2150116FFA3121EEA7F80487EA416FE491303A2007EC713FC00701407003015F8003814
+0F6C15F06CEC1FE06C6CEB3FC0D803E0EB7F803A01FE01FE0039007FFFF8010F13E00101
+90C7FC28447CC131>I<010FB512FEA3D9000313806E130080B3B3AB123F487E487EA44A
+5A13801300006C495A00705C6C13076C5C6C495A6CEB1F802603E07FC7FC3800FFFCEB1F
+E027467BC332>74 D<B712FCEEFFC017F800019039C0000FFC6C6C48EB01FF9338007F80
+EF1FE0170FEF07F018F8EF03FCA218FE1701A218FFA718FEA2170318FCA2EF07F818F0EF
+0FE0EF1FC0EF7F80933801FE00EE0FFC91B612F017800280C9FCB3AA3801FFE0B612C0A3
+38447CC342>80 D<B60107B500F890380FFFFEA3000301E0D9001F90C813F06C0180DA0F
+FCED3FC091C86C48ED1F006C871C0E6D6C6E7E1C0CA26D6C6F5DA36EDA06FF1538011F1A
+30A26E020E6D1470010FDB0C7F1560A26E021C7F0107DB183F5DA2856D6CDA301F4A5AA3
+6D6C4A6C6C49C7FCA36D6C4A6C6C1306A3DB80016E130E027FDA8003140CA2DBC0038002
+3FDA00015CA203E081021F01066D5CA36E6C486E6C5AA36E6C486E6C5AA36F48EC1FE102
+0360A2DBFE7015F302010160020F90C8FCA2DBFFE015FB6E49EC07FEA36F486E5AA36FC8
+6C5AA3031E6F5AA4030C16605F467EC364>87 D<EB07FC90383FFF809038F80FE03903C0
+03F048C66C7E000E6D7ED80FC0137E486C137F6D6D7EA36F7EA26C5AEA0380C8FCA4EC0F
+FF49B5FC90380FFE1FEB3FC0EBFF00EA03FC485A485A485A485A127F5B176048C7FCA315
+3FA36D137F007F14EF6D9038C7E0C0003F13013A1FE00783F13B07F81E03FF802701FFFC
+0113003A001FE0007C2B2E7CAC31>97 D<EC7F80903803FFF090380FC07C90383F000F01
+FCEB03804848EB01C00003140F4848EB1FE049133F120F485AA2485AED1FC0007FEC0700
+92C7FCA290C9FC5AAB7E7FA2123F16307F001F15706C6C146016E06C6C14C06C6C130100
+01EC03806C6CEB0700013F131E90381FC078903807FFF001001380242E7DAC2B>99
+D<EB01FE903807FFC090381F03F090387E00FC49137E48487F485A4848EB1F80000F15C0
+49130F121F484814E01507A2007F15F090C7FCA25AA390B6FCA290C9FCA67EA27FA2123F
+16306C7E1670000F15606D14E06C6C14C0000314016C6CEB03806C6CEB0700013E131E90
+381F80F8903803FFE0010090C7FC242E7DAC2B>101 D<EA01E0EA07F8A2487EA46C5AA2
+EA01E0C8FCADEA01FC12FFA3120712031201B3B0487EB512F8A315437DC21C>105
+D<EA01FC12FFA3120712031201B3B3B3A5487EB512F8A315457DC41C>108
+D<D801FC01FFEC1FE000FF010701E0EBFFFC913B0F03F801E07F913C3C01FC07803F8000
+07903C7000FE0E001FC0000349D97E1C130F2601FDC0D97F38804A143001FFDA3FF06D7E
+91C75BA2495DA3495DB3A8486C4A6C497EB5D8F81FB50003B512E0A34B2C7DAB52>I<39
+01FC01FE00FF903807FFC091381E07F091383801F8000701707F0003EBE0002601FDC07F
+5C01FF147F91C7FCA25BA35BB3A8486CECFF80B5D8F83F13FEA32F2C7DAB36>I<3903F8
+03F000FFEB1FFCEC3C3EEC707F0007EBE0FF3803F9C000015B13FBEC007E153C01FF1300
+5BA45BB3A748B4FCB512FEA3202C7DAB26>114 D<D801FC147F00FFEC3FFFA300071401
+000380000181B3A85EA35DA212006D5B017E9038077F80017F010E13C06D011C13FE9038
+0FC078903803FFF09026007F8013002F2D7DAB36>117 D<B539F001FFFCA3000790C7EA
+7FE06C48EC1F8000011600160E0000150C6D141C6D1418A26E1338013F1430A26D6C5BA2
+6E13E0010F5CA26D6C485AA2ECF803010391C7FCA2903801FC06A2ECFE0E0100130CA2EC
+7F18A215B8EC3FB0A2EC1FE0A36E5AA26E5AA36EC8FCA21406A35CA25CA2123C007E5BB4
+FC5CA25CEAFE01387C0380D87007C9FCEA3C1EEA0FFCEA03F02E3F7EAA33>121
+D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fl cmr17 17.28 17
+/Fl 17 118 df<DD7FF81560040FB56C14E0047F14E00303B600FC1301030F9038E003FE
+DB3FFEC7383F8003DBFFF0EC07C04A01C0913803F007020790C9EAF80FDA0FFC167C4A48
+EE1E1FDA7FE0160F4A48EE07BF4949EE03FF4990CAFC4948834948834A187F495A013F19
+3F4948181F5C01FF190F485BA24890CC1207A248481903A2485A1B01121FA25B123F1B00
+5BA2127F1C00A4485AB06C7EA5123F1CE07FA2121F7FA2000F1A011CC06C7EA26C7E1B03
+6C6D19801B076C7F017F1A006E606D6C181E131F6D6C606E18386D6C18786D6C606D6D4C
+5A6D6D4C5A6E6C1607DA1FF84C5A6E6C4CC7FC6EB4167C020101C04A5A6E01F0EC07F0DB
+3FFEEC1FC092280FFFE001FFC8FC030390B512FCDB007F14F0040F14809326007FF8C9FC
+53667AE360>67 D<BB12FCA4C601FCC8120FD93FF89238007FFE011F171F190719031900
+A21A7E1A3EA21A1EA21A1F86A486A6F20380A318E0A297C7FCA61701A417031707170F17
+1F17FF91B7FCA402F8C7FC171F170F170717031701A41700A895C9FCB3A580133F90B57E
+B712E0A4496279E156>70 D<DDFFF015C0040F01FF1401047F14E00303B600F81303030F
+9038E003FEDB3FFCC7007F1307DBFFE0EC0FC002030180913803E00F4A48C83801F01F4A
+48ED0078DA3FF0EE3C3F4A48161E4A48EE0F7F4949EE07FF4990CA7E495A494883494883
+5C013F197F4948183F495A1B1F485B1B0F4890CCFCA248481907A2485A1B03121F5BA212
+3F1B015BA2127F98C8FCA35B12FFB06C7EA24EB712E0A3123F95C7000FEBF0006D06015B
+64001F857FA2120F7F1207A26C7EA26C7FA26C7FA26D7E6D7E131F806D7E6D6C5F6D7E6D
+6D5E6D7F6E6CEE07BFDA3FF8EE0F3FDA0FFCEE1F1F6EB4163E6E01C0EDFC0F020001F091
+3801F807DB3FFEEC0FE092260FFFF09038FF8003030390B538FE0001DB007F02F8130004
+0F02C091C7FC040001F8CAFC5B667AE368>I<B712C0A4C66CEB8000D91FFEC7FC6D5AB3
+B3B3B3AE497E90387FFF80B712C0A422627AE12F>73 D<933801FFE0043F13FF4BB612E0
+03079038003FF8DB1FF0EB03FEDB7FC0903800FF804A48C8EA3FE0DA03FCED0FF0DA0FF0
+ED03FC4A486F7E4A486F7E4A48707E4ACA6C7E4948717E4948717E4948717E4948717E49
+48717E013F854A83017F864948727EA24890CC6C7EA24848737EA24848737EA2000F8749
+1907001F87A34848737EA4007F1C80A24985A400FF1CC0AF6C6C4F1380A5003F1C006D61
+A3001F63A26D190F000F63A26C6C4F5AA36C6C4F5AA26C6D4E5A6C636E18FF017F626D6C
+4D90C7FC6E5F011F616D6C4D5A6D6C4D5A0103616E171F6D6C4D5A6D6D4C5ADA3FC04CC8
+FCDA1FF0ED03FE6E6C4B5A6E6C4B5ADA01FFED3FE09126007FC0ECFF80DB1FF0D903FEC9
+FCDB07FFEB3FF8030190B512E0DB003F91CAFC040113E05A667AE367>79
+D<933801FFE0043F13FF4BB612E003079038003FF8DB1FF0EB03FEDB7FC0903800FF804A
+48C8EA3FE0DA03FCED0FF0DA0FF8ED07FCDA1FE0ED01FE4A486F7E4A48707E4ACA6C7E49
+48717E4948717E4948717E010F854948717E4948717EA24948717F01FF864A187F4890CC
+6C7EA2488749191F00078749190F000F87A2001F87491907A2003F87A24985A2007F1C80
+A44985A200FF1CC0AF007F1C806D61A4003F1C00A36D61001F63A36C6C4F5AA20007636D
+191FA26C6C4F5AA26C636C6DDA3F804A5AEFFFE06D6C010301F84A5A6D6C902607C07C49
+90C7FC93380F001E6D6C011E6D495A6D6C6F495A0107021CD903805B6D6C013C6D6C485A
+6E0138151F6D6C0300495A6D01806F485ADA3FC04CC8FCDA1FE0ED71FE91260FF83CEC77
+FC912607FC1CEC7FF8912601FF1EEC3FE09126007FDEECFF80DB1FFFD903FEC9FC030790
+38C03FF8030190B56C1560DB003F143C0401EBE01C93C8121EA21DE0191FA3736C13011D
+C0741303A274130774130F736CEB1F8074133F9738FF01FF7390B51200A264856485745B
+745B745B08071380E001FEC7FC5B807AE367>81 D<DA07FF1403023F01F05B49B512FC01
+0702FF5B90260FFC0013C0D93FE090380FF01FD97F80EB03F801FEC86C5A4848157E4848
+ED1F7F48486F5A4848815B001F824981003F8290CAFC4883A2007E83A212FE84A384A27E
+A36D82A26C7EA26D93C7FC6C7E7F7F6C7E6D7E6C13E06C13FCECFFC06C14F86CECFF806C
+15F86DECFF80011F15E06D15F8010315FE01006F7E021F81020181DA003F80030380DB00
+3F7F04037FEE007FEF1FFF71138017037113C083A2F07FE0183FA2181F00E018F0180FA4
+1807A27EA47E19E0180F7E19C07E6C171F19806D163F6D17006D5E6D16FE486C5E6D4B5A
+D8FC7F1503D91F80EC0FF026F80FE04A5AD907FCEC7F8029F001FFE003FFC7FC6D6CB512
+FC48011F14F0020314C0489026001FFEC8FC3C667AE349>83 D<003FBC12F8A49126C000
+039038C0000301FCC76C49EB007F01F0190F01C019074848F103FC90C81701007E1A0000
+7C1B7CA300781B3CA400701B1CA600F01B1E481B0EA7C91800B3B3B3A54C7FA2041F13F8
+4AB87EA457627CE160>I<EC3FF0903803FFFE010F6D7E90393FC03FE090397E0007F801
+F86D7ED801E06D7E48486D7E48486E7E48C86C7E7F01F06E7E487E6D6E7EA3707EA36C5A
+EA03E0C9FCA6167FED7FFF020FB5FC91387FF807903801FF80903807FC00EB1FF0EB7FC0
+495AD803FEC7FC485A120F5B485A485AA2484817E0A312FF5BA2160FA3161F6D141B007F
+153B16736D913971FC01C06C6C14E1001FEC01C1D80FFC903A0780FE03806C6C903A0F00
+FF07002701FF807E6DB4FC27007FFFF86D5A011F01E0EB1FF8010190C7EA07E03B417ABF
+42>97 D<4AB47E020F13F8023F13FE9139FF007F80D903FCEB07E0D907F0EB01F0D91FE0
+EB007849488049488049C87E48485D4915FF00034B138048485CA2485AA2485AA2003F6F
+130049EC007C94C7FC127FA35B12FFAD127F7FA4123F7FA2001FEE01C07F000F16036D16
+8012076C6C15076D160000015E6C6C151E6D6C5C6D6C5C6D6C5CD90FF8495AD903FCEB07
+C0903A00FF803F8091263FFFFEC7FC020F13F80201138032417CBF3A>99
+D<181EEF3FFEEE07FFA4EE000F1703A21701B3AAEDFF80020F13F8023F13FE9139FF803F
+81903A03FC0007C14948EB01E1D91FE0EB00F94948147D4948143D49C8121F4848150F49
+1507120348481503491501120F121F5BA2123F5B127FA45B12FFAD127F7FA3123FA27F12
+1FA26C6C1503A26C6C150712036D150F6C6C151F0000163D137F6D6CECF9FF6D6CEB01F1
+D90FF0D903C113C06D6CD90F81EBFF80D901FFEB7F019039007FFFFC021F13E002010100
+91C7FC41657CE349>I<EC03FE91381FFFE091B512F8903901FE03FE903A07F0007F8049
+486D7ED93FC06D7E49C76C7E496E7E49140348488148481401000782491400000F828348
+5A1880123F49153FA2007F17C0A35BA212FF90B8FCA30180CAFCA9127F7FA3123FA27F12
+1FEF01C06C7E17036C6C1680A26C6C15070001EE0F006D150E6C6C151E6D6C5C6D6C5C6D
+6C5CD907F0EB03E0D903FC495A902700FF803FC7FC91383FFFFC020F13F0020113803241
+7CBF3A>I<133C13FF487F487FA66C5B6C90C7FC133C90C8FCB3A2EB03C0EA07FF127FA4
+1201EA007FA2133FB3B3AC497E497EB612E0A41B5F7DDE23>105
+D<EB03C0EA07FFB5FCA41201EA007FA2133FB3AB0403B512F8A40400148094387FFC0018
+E06095C7FC177E5F17F04C5A4C5A4C5A4CC8FC163E5E5E4B5A4B5A4B5A4B5A151F4B7E4B
+7E15FF02C17F9138C3CFF8ECC7879138CF07FC9138FE03FEECFC0102F87F4A6C7F4A137F
+4A80707E161F83707E160783707E160183707F177F84717E171F84717E84A284496CEDFF
+80496C4A13E0B600F090B6FCA440647CE346>107 D<9039078003F8D807FFEB0FFFB501
+3F13C092387C0FE0913881F01F9238E03FF00001EB838039007F8700148FEB3F8E029CEB
+1FE0EE0FC00298EB030002B890C7FCA214B014F0A25CA55CB3B0497EEBFFF8B612FCA42C
+3F7CBE33>114 D<1438A71478A414F8A31301A31303A21307130F131FA2137F13FF1203
+000F90B6FCB8FCA3260007F8C8FCB3AE17E0AE6D6CEB01C0A316036D6C148016076D6C14
+006E6C5A91383FC01E91381FF07C6EB45A020313E09138007F802B597FD733>116
+D<D903C0150FD807FFED1FFFB50203B5FCA40001ED0007D8007F1501A2013F81B3B25FA3
+5FA35F011F15066E140E5F130F6E4A7F01075D6D6C494813E0D901FE4948EBFFC0903A00
+FFC01F8091393FFFFE00020F13F8020001C0EC800042407DBE49>I
+E
+%EndDVIPSBitmapFont
+end
+%%EndProlog
+%%BeginSetup
+%%Feature: *Resolution 600dpi
+TeXDict begin
+%%PaperSize: A4
+
+%%EndSetup
+%%Page: 1 1
+1 0 bop 1125 937 a Fl(CFITSIO)44 b(Quic)l(k)h(Start)d(Guide)1625
+1190 y Fk(William)28 b(P)m(ence)2277 1154 y Fj(\003)1666
+1394 y Fk(Jan)m(uary)33 b(2003)120 1916 y Fi(Con)l(ten)l(ts)120
+2120 y Fh(1)84 b(In)m(tro)s(duction)2897 b(2)120 2324
+y(2)84 b(Installing)35 b(and)g(Using)h(CFITSIO)2080 b(3)120
+2528 y(3)84 b(Example)34 b(Programs)2600 b(4)120 2731
+y(4)84 b(CFITSIO)33 b(Routines)2603 b(6)256 2844 y Fg(4.1)94
+b(Error)30 b(Rep)s(orting)24 b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)174 b(6)256 2957 y(4.2)94
+b(File)30 b(Op)s(en/Close)f(Routines)57 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)174 b(6)256 3070 y(4.3)94 b(HDU-lev)m(el)32
+b(Routines)85 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)174 b(7)256 3183 y(4.4)94 b(Image)32 b(I/O)e(Routines)79
+b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)174
+b(9)256 3296 y(4.5)94 b(T)-8 b(able)30 b(I/O)h(Routines)d(.)46
+b(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129
+b(12)256 3409 y(4.6)94 b(Header)31 b(Keyw)m(ord)f(I/O)h(Routines)78
+b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
+h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129 b(19)256 3522
+y(4.7)94 b(Utilit)m(y)30 b(Routines)c(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)
+f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129 b(22)120 3726
+y Fh(5)84 b(CFITSIO)33 b(File)i(Names)f(and)g(Filters)1907
+b(23)256 3839 y Fg(5.1)94 b(Creating)30 b(New)h(Files)43
+b(.)j(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129
+b(23)256 3951 y(5.2)94 b(Op)s(ening)29 b(Existing)f(Files)39
+b(.)46 b(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129
+b(24)256 4064 y(5.3)94 b(Image)32 b(Filtering)53 b(.)45
+b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f
+(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129
+b(26)465 4177 y(5.3.1)106 b(Extracting)31 b(a)g(subsection)e(of)i(an)f
+(image)76 b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)129 b(26)465 4290 y(5.3.2)106 b(Create)32
+b(an)e(Image)h(b)m(y)f(Binning)e(T)-8 b(able)30 b(Columns)i(.)45
+b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129
+b(26)256 4403 y(5.4)94 b(T)-8 b(able)30 b(Filtering)74
+b(.)45 b(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)129 b(28)465 4516 y(5.4.1)106 b(Column)29 b(and)h(Keyw)m(ord)g
+(Filtering)47 b(.)e(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129 b(28)465 4629 y(5.4.2)106
+b(Ro)m(w)31 b(Filtering)39 b(.)45 b(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)
+g(.)f(.)h(.)g(.)129 b(29)465 4742 y(5.4.3)106 b(Go)s(o)s(d)30
+b(Time)g(In)m(terv)-5 b(al)30 b(Filtering)59 b(.)46 b(.)f(.)h(.)g(.)g
+(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)
+129 b(32)465 4855 y(5.4.4)106 b(Spatial)29 b(Region)i(Filtering)56
+b(.)46 b(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)
+h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129 b(32)465 4968
+y(5.4.5)106 b(Example)30 b(Ro)m(w)h(Filters)f(.)45 b(.)h(.)g(.)f(.)h(.)
+g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g
+(.)g(.)f(.)h(.)g(.)129 b(34)256 5081 y(5.5)94 b(Com)m(bined)29
+b(Filtering)g(Examples)44 b(.)i(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h
+(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)f(.)h(.)g(.)g(.)f(.)h(.)g(.)129
+b(36)120 5284 y Fh(6)84 b(CFITSIO)33 b(Error)i(Status)f(Co)s(des)2069
+b(38)p 120 5346 1465 4 v 222 5400 a Ff(\003)258 5431
+y Fe(HEASAR)n(C,)25 b(NASA)f(Go)r(ddard)i(Space)f(Fligh)n(t)h(Cen)n
+(ter,)g Fd(Wil)t(liam.D.Penc)l(e@nasa.gov)1928 5809 y
+Fg(1)p eop
+%%Page: 2 2
+2 1 bop 120 573 a Fi(1)135 b(In)l(tro)t(duction)120 776
+y Fg(This)33 b(do)s(cumen)m(t)h(is)f(in)m(tended)g(to)i(help)e(y)m(ou)i
+(quic)m(kly)e(start)i(writing)d(C)i(programs)g(to)h(read)f(and)g(write)
+120 889 y(FITS)45 b(\014les)f(using)g(the)h(CFITSIO)f(library)-8
+b(.)84 b(It)45 b(co)m(v)m(ers)i(the)f(most)f(imp)s(ortan)m(t)g(CFITSIO)
+e(routines)120 1002 y(that)i(are)f(needed)g(to)h(p)s(erform)d(most)i(t)
+m(yp)s(es)h(of)f(op)s(erations)f(on)h(FITS)f(\014les.)81
+b(F)-8 b(or)45 b(more)f(complete)120 1115 y(information)39
+b(ab)s(out)g(these)i(and)f(all)f(the)h(other)h(a)m(v)-5
+b(ailable)39 b(routines)g(in)g(the)i(library)d(please)i(refer)g(to)120
+1227 y(the)c(\\CFITSIO)e(User's)i(Reference)g(Guide",)h(whic)m(h)d(is)g
+(a)m(v)-5 b(ailable)35 b(from)g(the)h(CFITSIO)e(W)-8
+b(eb)36 b(site)g(at)120 1340 y Fc(http://heasarc.gsfc.nasa)o(.gov)o
+(/fit)o(sio)o Fg(.)261 1453 y(F)-8 b(or)41 b(more)f(general)f
+(information)f(ab)s(out)i(the)g(FITS)f(data)h(format,)j(refer)d(to)g
+(the)g(follo)m(wing)e(w)m(eb)120 1566 y(page:)j(h)m
+(ttp://heasarc.gsfc.nasa.go)m(v/do)s(cs/heasa)q(rc/\014ts.h)m(t)q(ml)
+261 1679 y(FITS)27 b(stands)h(for)g(Flexible)e(Image)j(T)-8
+b(ransp)s(ort)27 b(System)h(and)f(is)g(the)i(standard)e(\014le)g
+(format)h(used)g(to)120 1792 y(store)j(most)g(astronomical)f(data)i
+(\014les.)40 b(There)30 b(are)h(2)g(basic)f(t)m(yp)s(es)g(of)h(FITS)f
+(\014les:)40 b(images)30 b(and)g(tables.)120 1905 y(FITS)j(images)h
+(often)g(con)m(tain)g(a)g(2-dimensional)d(arra)m(y)k(of)e(pixels)f
+(represen)m(ting)h(an)h(image)g(of)f(a)h(piece)120 2018
+y(of)f(the)f(sky)-8 b(,)34 b(but)e(FITS)g(images)g(can)h(also)g(con)m
+(tain)g(1-D)g(arra)m(ys)g(\(i.e,)h(a)f(sp)s(ectrum)e(or)i(ligh)m(t)e
+(curv)m(e\),)j(or)120 2131 y(3-D)40 b(arra)m(ys)f(\(a)g(data)g(cub)s
+(e\),)i(or)d(ev)m(en)i(higher)d(dimensional)f(arra)m(ys)i(of)h(data.)66
+b(An)38 b(image)h(ma)m(y)g(also)120 2244 y(ha)m(v)m(e)30
+b(zero)g(dimensions,)c(in)i(whic)m(h)f(case)j(it)e(is)g(referred)g(to)i
+(as)f(a)g(n)m(ull)e(or)i(empt)m(y)g(arra)m(y)-8 b(.)41
+b(The)28 b(supp)s(orted)120 2357 y(datat)m(yp)s(es)f(for)f(the)h(image)
+g(arra)m(ys)f(are)h(8,)h(16,)g(and)e(32-bit)h(in)m(tegers,)h(and)d(32)j
+(and)d(64-bit)i(\015oating)f(p)s(oin)m(t)120 2469 y(real)k(n)m(um)m(b)s
+(ers.)39 b(Both)31 b(signed)f(and)f(unsigned)g(in)m(tegers)h(are)h
+(supp)s(orted.)261 2582 y(FITS)j(tables)g(con)m(tain)g(ro)m(ws)g(and)g
+(columns)f(of)h(data,)i(similar)c(to)j(a)g(spreadsheet.)52
+b(All)33 b(the)h(v)-5 b(alues)120 2695 y(in)30 b(a)h(particular)e
+(column)h(m)m(ust)g(ha)m(v)m(e)j(the)e(same)g(datat)m(yp)s(e.)43
+b(A)31 b(cell)f(of)h(a)g(column)f(is)g(not)h(restricted)g(to)120
+2808 y(a)h(single)d(n)m(um)m(b)s(er,)i(and)f(instead)h(can)g(con)m
+(tain)h(an)f(arra)m(y)g(or)h(v)m(ector)g(of)g(n)m(um)m(b)s(ers.)41
+b(There)31 b(are)h(actually)120 2921 y(2)43 b(subt)m(yp)s(es)f(of)h
+(FITS)f(tables:)65 b(ASCI)s(I)41 b(and)i(binary)-8 b(.)76
+b(As)43 b(the)g(names)g(imply)-8 b(,)44 b(ASCI)s(I)d(tables)i(store)120
+3034 y(the)37 b(data)h(v)-5 b(alues)36 b(in)g(an)g(ASCI)s(I)g(represen)
+m(tation)h(whereas)f(binary)g(tables)g(store)i(the)f(data)g(v)-5
+b(alues)37 b(in)120 3147 y(a)c(more)f(e\016cien)m(t)h(mac)m
+(hine-readable)e(binary)g(format.)46 b(Binary)32 b(tables)g(are)g
+(generally)g(more)g(compact)120 3260 y(and)25 b(supp)s(ort)e(more)j
+(features)f(\(e.g.,)j(a)e(wider)e(range)h(of)h(datat)m(yp)s(es,)h(and)e
+(v)m(ector)i(columns\))d(than)h(ASCI)s(I)120 3373 y(tables.)261
+3486 y(A)31 b(single)e(FITS)h(\014le)g(man)m(y)h(con)m(tain)g(m)m
+(ultiple)d(images)j(or)g(tables.)41 b(Eac)m(h)31 b(table)g(or)f(image)h
+(is)f(called)120 3599 y(a)k(Header-Data)j(Unit,)d(or)g(HDU.)h(The)f
+(\014rst)f(HDU)i(in)d(a)j(FITS)e(\014le)g(m)m(ust)h(b)s(e)f(an)h(image)
+h(\(but)e(it)h(ma)m(y)120 3711 y(ha)m(v)m(e)c(zero)f(axes\))h(and)e(is)
+g(called)g(the)h(Primary)e(Arra)m(y)-8 b(.)41 b(An)m(y)28
+b(additional)f(HDUs)i(in)f(the)g(\014le)g(\(whic)m(h)g(are)120
+3824 y(also)i(referred)g(to)h(as)g(`extensions'\))f(ma)m(y)h(con)m
+(tain)g(either)f(an)g(image)h(or)f(a)h(table.)261 3937
+y(Ev)m(ery)38 b(HDU)g(con)m(tains)g(a)g(header)g(con)m(taining)f(k)m
+(eyw)m(ord)h(records.)62 b(Eac)m(h)38 b(k)m(eyw)m(ord)g(record)g(is)f
+(80)120 4050 y(ASCI)s(I)29 b(c)m(haracters)j(long)e(and)f(has)i(the)f
+(follo)m(wing)f(format:)120 4263 y Fc(KEYWORD)46 b(=)h(value)g(/)g
+(comment)f(string)261 4475 y Fg(The)23 b(k)m(eyw)m(ord)i(name)f(can)g
+(b)s(e)f(up)g(to)h(8)g(c)m(haracters)i(long)d(\(all)g(upp)s(ercase\).)
+38 b(The)23 b(v)-5 b(alue)24 b(can)g(b)s(e)f(either)120
+4588 y(an)k(in)m(teger)g(or)f(\015oating)h(p)s(oin)m(t)e(n)m(um)m(b)s
+(er,)i(a)g(logical)f(v)-5 b(alue)26 b(\(T)h(or)f(F\),)i(or)e(a)h(c)m
+(haracter)i(string)c(enclosed)i(in)120 4701 y(single)d(quotes.)40
+b(Eac)m(h)26 b(header)f(b)s(egins)f(with)g(a)i(series)f(of)h(required)e
+(k)m(eyw)m(ords)h(to)i(describ)s(e)d(the)h(datat)m(yp)s(e)120
+4814 y(and)35 b(format)h(of)f(the)h(follo)m(wing)e(data)i(unit,)f(if)f
+(an)m(y)-8 b(.)57 b(An)m(y)35 b(n)m(um)m(b)s(er)g(of)g(other)h
+(optional)e(k)m(eyw)m(ords)i(can)120 4927 y(b)s(e)d(included)e(in)h
+(the)h(header)h(to)g(pro)m(vide)e(other)i(descriptiv)m(e)f(information)
+e(ab)s(out)j(the)f(data.)51 b(F)-8 b(or)34 b(the)120
+5040 y(most)g(part,)g(the)g(CFITSIO)d(routines)i(automatically)g(write)
+f(the)i(required)e(FITS)g(k)m(eyw)m(ords)i(for)f(eac)m(h)120
+5153 y(HDU,)e(so)g(y)m(ou,)g(the)g(programmer,)f(usually)e(do)i(not)h
+(need)f(to)h(w)m(orry)f(ab)s(out)g(them.)1928 5809 y(2)p
+eop
+%%Page: 3 3
+3 2 bop 120 573 a Fi(2)135 b(Installing)46 b(and)f(Using)g(CFITSIO)120
+776 y Fg(First,)32 b(y)m(ou)g(should)d(do)m(wnload)i(the)h(CFITSIO)e
+(soft)m(w)m(are)j(and)e(the)h(set)g(of)g(example)g(FITS)f(utilit)m(y)f
+(pro-)120 889 y(grams)h(from)f(the)g(w)m(eb)h(site)f(at)i(h)m
+(ttp://heasarc.gsfc.nasa.go)m(v/\014tsio.)46 b(The)30
+b(example)g(programs)g(illus-)120 1002 y(trate)g(ho)m(w)e(to)h(p)s
+(erform)f(man)m(y)g(common)h(t)m(yp)s(es)f(of)h(op)s(erations)f(on)g
+(FITS)g(\014les)g(using)f(CFITSIO.)g(They)120 1115 y(are)h(also)g
+(useful)d(when)i(writing)f(a)i(new)f(program)g(b)s(ecause)h(it)f(is)g
+(often)h(easier)f(to)i(tak)m(e)g(a)f(cop)m(y)g(of)g(one)g(of)120
+1227 y(these)k(utilit)m(y)e(programs)h(as)g(a)h(template)g(and)f(then)g
+(mo)s(dify)e(it)i(for)g(y)m(our)h(o)m(wn)f(purp)s(oses,)f(rather)i
+(than)120 1340 y(writing)c(the)j(new)f(program)g(completely)g(from)g
+(scratc)m(h.)261 1453 y(T)-8 b(o)28 b(build)c(the)k(CFITSIO)d(library)g
+(on)i(Unix)f(platforms,)i(`un)m(tar')f(the)h(source)f(co)s(de)h
+(distribution)23 b(\014le)120 1566 y(and)30 b(then)g(execute)i(the)e
+(follo)m(wing)f(commands)h(in)f(the)i(directory)e(con)m(taining)h(the)h
+(source)g(co)s(de:)120 1779 y Fc(>)95 b(./configure)45
+b([--prefix=/target/instal)o(lati)o(on/)o(path)o(])120
+1892 y(>)95 b(make)524 b(\(or)47 b('make)f(shared'\))120
+2005 y(>)95 b(make)47 b(install)141 b(\(this)46 b(step)h(is)g
+(optional\))261 2217 y Fg(The)40 b(optional)g('pre\014x')g(argumen)m(t)
+h(to)g(con\014gure)f(giv)m(es)h(the)g(path)f(to)h(the)g(directory)f
+(where)g(the)120 2330 y(CFITSIO)30 b(library)g(and)h(include)f(\014les)
+h(should)f(b)s(e)h(installed)f(via)i(the)g(later)g('mak)m(e)h(install')
+d(command.)120 2443 y(F)-8 b(or)31 b(example,)120 2655
+y Fc(>)95 b(./configure)45 b(--prefix=/usr1/local)261
+2868 y Fg(will)18 b(cause)j(the)g('mak)m(e)h(install')d(command)h(to)h
+(cop)m(y)h(the)e(CFITSIO)f(lib)s(c\014tsio)f(\014le)i(to)h(/usr1/lo)s
+(cal/lib)120 2981 y(and)35 b(the)h(necessary)g(include)e(\014les)h(to)h
+(/usr1/lo)s(cal/include)e(\(assuming)h(of)g(course)h(that)h(the)f(pro)s
+(cess)120 3094 y(has)30 b(p)s(ermission)d(to)32 b(write)d(to)i(these)g
+(directories\).)261 3207 y(Pre-compiled)d(v)m(ersions)h(of)h(the)g
+(CFITSIO)e(DLL)i(library)d(are)j(a)m(v)-5 b(ailable)29
+b(for)g(PCs.)40 b(On)29 b(Macin)m(tosh)120 3320 y(mac)m(hines,)45
+b(refer)d(to)g(the)h(README.MacOS)g(\014le)e(for)h(instructions)e(on)i
+(building)c(CFITSIO)j(using)120 3432 y(Co)s(deW)-8 b(arrior.)261
+3545 y(An)m(y)40 b(programs)g(that)h(use)f(CFITSIO)f(m)m(ust)h(of)g
+(course)h(b)s(e)e(link)m(ed)g(with)g(the)h(CFITSIO)f(library)120
+3658 y(when)e(creating)h(the)g(executable)h(\014le.)63
+b(The)37 b(exact)j(pro)s(cedure)c(for)i(linking)d(a)k(program)e(dep)s
+(ends)f(on)120 3771 y(y)m(our)31 b(soft)m(w)m(are)i(en)m(vironmen)m(t,)
+e(but)g(on)g(Unix)f(platforms,)h(the)g(command)g(line)f(to)i(compile)e
+(and)h(link)e(a)120 3884 y(program)h(will)e(lo)s(ok)i(something)g(lik)m
+(e)f(this:)120 4097 y Fc(gcc)47 b(-o)g(myprog)f(myprog.c)g(-L.)h
+(-lcfitsio)e(-lm)i(-lnsl)f(-lsocket)261 4309 y Fg(Y)-8
+b(ou)37 b(ma)m(y)g(not)f(need)g(to)h(include)e(all)g(of)h(the)h('m',)h
+('nsl',)f(and)f('so)s(c)m(k)m(et')i(system)f(libraries)c(on)j(y)m(our)
+120 4422 y(particular)j(mac)m(hine.)72 b(T)-8 b(o)42
+b(\014nd)d(out)i(what)g(libraries)d(are)j(required)e(on)i(y)m(our)g
+(\(Unix\))f(system,)k(t)m(yp)s(e)120 4535 y Fc('make)i(testprog')28
+b Fg(and)i(see)h(what)f(libraries)e(are)i(then)h(included)c(on)j(the)h
+(resulting)e(link)f(line.)1928 5809 y(3)p eop
+%%Page: 4 4
+4 3 bop 120 573 a Fi(3)135 b(Example)46 b(Programs)120
+776 y Fg(Before)32 b(describing)d(the)j(individual)27
+b(CFITSIO)i(routines)i(in)f(detail,)h(it)f(is)h(instructiv)m(e)f(to)i
+(\014rst)f(lo)s(ok)g(at)120 889 y(an)c(actual)g(program.)40
+b(The)26 b(names)h(of)g(the)g(CFITSIO)f(routines)g(are)h(fairly)e
+(descriptiv)m(e)h(\(they)i(all)e(b)s(egin)120 1002 y(with)j
+Fc(fits)p 525 1002 29 4 v 33 w Fg(,)i(so)g(it)e(should)g(b)s(e)h
+(reasonably)f(clear)i(what)f(this)f(program)h(do)s(es:)120
+1202 y Fc(------------------------)o(----)o(----)o(---)o(----)o(----)o
+(---)o(----)o(----)o(---)o(----)o(---)311 1315 y(#include)45
+b(<string.h>)311 1428 y(#include)g(<stdio.h>)120 1541
+y(1:)95 b(#include)45 b("fitsio.h")311 1767 y(int)i(main\(int)e(argc,)i
+(char)f(*argv[]\))311 1879 y({)120 1992 y(2:)286 b(fitsfile)45
+b(*fptr;)502 2105 y(char)h(card[FLEN_CARD];)120 2218
+y(3:)286 b(int)47 b(status)f(=)h(0,)95 b(nkeys,)46 b(ii;)95
+b(/*)47 b(MUST)g(initialize)e(status)h(*/)120 2444 y(4:)286
+b(fits_open_file\(&fptr,)42 b(argv[1],)j(READONLY,)h(&status\);)502
+2557 y(fits_get_hdrspace\(fptr,)41 b(&nkeys,)46 b(NULL,)g(&status\);)
+502 2783 y(for)h(\(ii)g(=)g(1;)g(ii)g(<=)h(nkeys;)e(ii++\))94
+b({)597 2896 y(fits_read_record\(fptr,)42 b(ii,)47 b(card,)f
+(&status\);)g(/*)h(read)f(keyword)g(*/)597 3009 y(printf\("\045s\\n",)e
+(card\);)502 3121 y(})502 3234 y(printf\("END\\n\\n"\);)90
+b(/*)48 b(terminate)d(listing)h(with)g(END)h(*/)502 3347
+y(fits_close_file\(fptr,)42 b(&status\);)502 3573 y(if)47
+b(\(status\))475 b(/*)47 b(print)g(any)g(error)f(messages)f(*/)120
+3686 y(5:)477 b(fits_report_error\(stder)o(r,)42 b(status\);)502
+3799 y(return\(status\);)311 3912 y(})120 4025 y
+(------------------------)o(----)o(----)o(---)o(----)o(----)o(---)o
+(----)o(----)o(---)o(----)o(---)261 4225 y Fg(This)28
+b(program)h(op)s(ens)f(the)h(sp)s(eci\014ed)f(FITS)g(\014le)h(and)f
+(prin)m(ts)g(out)h(all)f(the)i(header)f(k)m(eyw)m(ords)g(in)f(the)120
+4338 y(curren)m(t)i(HDU.)i(Some)e(other)h(p)s(oin)m(ts)e(to)i(notice)g
+(ab)s(out)f(the)g(program)g(are:)231 4516 y(1.)46 b(The)30
+b Fc(fitsio.h)e Fg(header)i(\014le)f(m)m(ust)i(b)s(e)e(included)f(to)j
+(de\014ne)e(the)i(v)-5 b(arious)29 b(routines)g(and)h(sym)m(b)s(ols)347
+4629 y(used)g(in)f(CFITSIO.)231 4812 y(2.)46 b(The)37
+b Fc(fitsfile)e Fg(parameter)i(is)f(the)h(\014rst)g(argumen)m(t)g(in)f
+(almost)h(ev)m(ery)h(CFITSIO)d(routine.)60 b(It)347 4925
+y(is)40 b(a)i(p)s(oin)m(ter)e(to)i(a)g(structure)e(\(de\014ned)g(in)g
+Fc(fitsio.h)p Fg(\))g(that)h(stores)h(information)d(ab)s(out)i(the)347
+5038 y(particular)g(FITS)g(\014le)g(that)i(the)g(routine)e(will)e(op)s
+(erate)k(on.)76 b(Memory)43 b(for)f(this)f(structure)g(is)347
+5151 y(automatically)33 b(allo)s(cated)f(when)g(the)h(\014le)f(is)f
+(\014rst)h(op)s(ened)g(or)h(created,)h(and)e(is)g(freed)g(when)g(the)
+347 5264 y(\014le)e(is)f(closed.)231 5447 y(3.)46 b(Almost)40
+b(ev)m(ery)g(CFITSIO)e(routine)g(has)i(a)g Fc(status)d
+Fg(parameter)j(as)g(the)g(last)f(argumen)m(t.)69 b(The)347
+5560 y(status)28 b(v)-5 b(alue)27 b(is)g(also)h(usually)d(returned)i
+(as)h(the)g(v)-5 b(alue)27 b(of)h(the)f(function)g(itself.)38
+b(Normally)27 b(status)1928 5809 y(4)p eop
+%%Page: 5 5
+5 4 bop 347 573 a Fg(=)22 b(0,)i(and)d(a)h(p)s(ositiv)m(e)f(status)h(v)
+-5 b(alue)21 b(indicates)g(an)h(error)f(of)h(some)g(sort.)38
+b(The)22 b(status)g(v)-5 b(ariable)20 b(m)m(ust)347 686
+y(alw)m(a)m(ys)32 b(b)s(e)e(initialized)e(to)k(zero)g(b)s(efore)f(use,)
+g(b)s(ecause)g(if)f(status)h(is)f(greater)j(than)d(zero)i(on)f(input)
+347 799 y(then)e(the)g(CFITSIO)f(routines)g(will)e(simply)g(return)i
+(without)g(doing)g(an)m(ything.)40 b(This)27 b(`inherited)347
+912 y(status')46 b(feature,)j(where)44 b(eac)m(h)i(CFITSIO)e(routine)g
+(inherits)e(the)j(status)g(from)g(the)g(previous)347
+1024 y(routine,)e(mak)m(es)e(it)f(unnecessary)g(to)i(c)m(hec)m(k)g(the)
+f(status)g(v)-5 b(alue)40 b(after)h(ev)m(ery)h(single)d(CFITSIO)347
+1137 y(routine)f(call.)64 b(Generally)38 b(y)m(ou)h(should)e(c)m(hec)m
+(k)j(the)e(status)h(after)g(an)g(esp)s(ecially)e(imp)s(ortan)m(t)g(or)
+347 1250 y(complicated)31 b(routine)f(has)h(b)s(een)g(called,)g(or)g
+(after)h(a)f(blo)s(c)m(k)g(of)g(closely)g(related)g(CFITSIO)f(calls.)
+347 1363 y(This)25 b(example)h(program)h(has)f(tak)m(en)i(this)e
+(feature)h(to)g(the)g(extreme)g(and)f(only)g(c)m(hec)m(ks)i(the)f
+(status)347 1476 y(v)-5 b(alue)30 b(at)h(the)g(v)m(ery)g(end)e(of)i
+(the)f(program.)231 1664 y(4.)46 b(In)37 b(this)e(example)i(program)g
+(the)g(\014le)f(name)h(to)h(b)s(e)e(op)s(ened)h(is)f(giv)m(en)h(as)g
+(an)g(argumen)m(t)g(on)g(the)347 1777 y(command)e(line)f(\()p
+Fc(arg[1])p Fg(\).)53 b(If)35 b(the)g(\014le)g(con)m(tains)g(more)g
+(than)g(1)g(HDU)h(or)f(extension,)i(y)m(ou)e(can)347
+1890 y(sp)s(ecify)19 b(whic)m(h)g(particular)g(HDU)i(to)g(b)s(e)f(op)s
+(ened)f(b)m(y)h(enclosing)g(the)g(name)g(or)h(n)m(um)m(b)s(er)e(of)h
+(the)h(HDU)347 2002 y(in)j(square)i(brac)m(k)m(ets)h(follo)m(wing)d
+(the)h(ro)s(ot)h(name)g(of)f(the)h(\014le.)38 b(F)-8
+b(or)26 b(example,)h Fc(file.fts[0])22 b Fg(op)s(ens)347
+2115 y(the)31 b(primary)d(arra)m(y)-8 b(,)32 b(while)d
+Fc(file.fts[2])e Fg(will)h(mo)m(v)m(e)k(to)f(and)f(op)s(en)f(the)i(2nd)
+f(extension)g(in)f(the)347 2228 y(\014le,)36 b(and)e
+Fc(file.fit[EVENTS])d Fg(will)h(op)s(en)j(the)g(extension)f(that)i(has)
+f(a)g Fc(EXTNAME)46 b(=)i('EVENTS')347 2341 y Fg(k)m(eyw)m(ord)31
+b(in)e(the)h(header.)41 b(Note)31 b(that)g(on)f(the)h(Unix)e(command)h
+(line)f(y)m(ou)h(m)m(ust)g(enclose)h(the)f(\014le)347
+2454 y(name)h(in)e(single)g(or)i(double)e(quote)j(c)m(haracters)g(if)d
+(the)i(name)g(con)m(tains)f(sp)s(ecial)g(c)m(haracters)i(suc)m(h)347
+2567 y(as)f(`[')g(or)f(`]'.)347 2717 y(All)42 b(of)h(the)h(CFITSIO)d
+(routines)h(whic)m(h)g(read)h(or)g(write)g(header)g(k)m(eyw)m(ords,)k
+(image)c(data,)k(or)347 2830 y(table)31 b(data)g(op)s(erate)g(only)f
+(within)e(the)j(curren)m(tly)f(op)s(ened)g(HDU)h(in)e(the)i(\014le.)41
+b(T)-8 b(o)31 b(read)g(or)f(write)347 2943 y(information)36
+b(in)g(a)i(di\013eren)m(t)f(HDU)h(y)m(ou)g(m)m(ust)f(\014rst)g
+(explicitly)e(mo)m(v)m(e)j(to)h(that)f(HDU)g(\(see)g(the)347
+3056 y Fc(fits)p 545 3056 29 4 v 34 w(movabs)p 867 3056
+V 32 w(hdu)30 b Fg(and)g Fc(fits)p 1442 3056 V 33 w(movrel)p
+1763 3056 V 33 w(hdu)f Fg(routines)g(in)g(section)i(4.3\).)231
+3244 y(5.)46 b(The)25 b Fc(fits)p 727 3244 V 33 w(report)p
+1048 3244 V 33 w(error)e Fg(routine)h(pro)m(vides)g(a)h(con)m(v)m
+(enien)m(t)h(w)m(a)m(y)g(to)g(prin)m(t)e(out)h(diagnostic)f(mes-)347
+3357 y(sages)32 b(ab)s(out)e(an)m(y)g(error)g(that)h(ma)m(y)g(ha)m(v)m
+(e)h(o)s(ccurred.)261 3544 y(A)f(set)g(of)f(example)g(FITS)g(utilit)m
+(y)f(programs)h(are)g(a)m(v)-5 b(ailable)30 b(from)g(the)g(CFITSIO)f(w)
+m(eb)i(site)f(at)120 3657 y(h)m(ttp://heasarc.gsfc.nasa.go)m(v/do)s
+(cs/soft)n(w)m(are/)q(\014tsio/cexa)q(mples.h)m(tml.)87
+b(These)45 b(are)g(real)f(w)m(orking)120 3770 y(programs)e(whic)m(h)e
+(illustrate)g(ho)m(w)i(to)h(read,)i(write,)f(and)d(mo)s(dify)f(FITS)i
+(\014les)e(using)h(the)h(CFITSIO)120 3883 y(library)-8
+b(.)36 b(Most)24 b(of)g(these)f(programs)g(are)h(v)m(ery)f(short,)i
+(con)m(taining)e(only)f(a)i(few)f(10s)h(of)f(lines)e(of)j(executable)
+120 3996 y(co)s(de)32 b(or)g(less,)g(y)m(et)h(they)f(p)s(erform)e
+(quite)h(useful)f(op)s(erations)h(on)h(FITS)f(\014les.)44
+b(Running)30 b(eac)m(h)j(program)120 4109 y(without)40
+b(an)m(y)h(command)f(line)f(argumen)m(ts)i(will)d(pro)s(duce)h(a)i
+(short)f(description)f(of)i(ho)m(w)g(to)g(use)f(the)120
+4222 y(program.)g(The)30 b(curren)m(tly)g(a)m(v)-5 b(ailable)29
+b(programs)h(are:)347 4409 y(\014tscop)m(y)h(-)g(cop)m(y)g(a)g(\014le)
+347 4522 y(listhead)e(-)i(list)e(header)h(k)m(eyw)m(ords)347
+4635 y(liststruc)f(-)i(sho)m(w)f(the)g(structure)g(of)h(a)g(FITS)e
+(\014le.)347 4748 y(mo)s(dhead)h(-)g(write)g(or)g(mo)s(dify)f(a)i
+(header)f(k)m(eyw)m(ord)347 4861 y(imarith)f(-)h(add,)g(subtract,)h(m)m
+(ultiply)-8 b(,)28 b(or)j(divide)d(2)j(images)347 4974
+y(imlist)d(-)j(list)e(pixel)g(v)-5 b(alues)29 b(in)g(an)i(image)347
+5087 y(imstat)g(-)f(compute)h(mean,)g(min,)e(and)g(max)i(pixel)e(v)-5
+b(alues)29 b(in)g(an)i(image)347 5200 y(tablist)f(-)g(displa)m(y)f(the)
+h(con)m(ten)m(ts)i(of)f(a)g(FITS)e(table)347 5313 y(tab)s(calc)i(-)g
+(general)f(table)g(calculator)1928 5809 y(5)p eop
+%%Page: 6 6
+6 5 bop 120 573 a Fi(4)135 b(CFITSIO)44 b(Routines)120
+776 y Fg(This)36 b(c)m(hapter)i(describ)s(es)e(the)h(main)g(CFITSIO)f
+(routines)g(that)i(can)g(b)s(e)f(used)g(to)h(p)s(erform)e(the)i(most)
+120 889 y(common)31 b(t)m(yp)s(es)f(of)h(op)s(erations)e(on)i(FITS)e
+(\014les.)120 1136 y Fb(4.1)112 b(Error)37 b(Rep)s(orting)120
+1310 y Fc(void)47 b(fits_report_error\(FILE)41 b(*stream,)46
+b(int)h(status\))120 1423 y(void)g(fits_get_errstatus\(int)41
+b(status,)46 b(char)h(*err_text\))120 1536 y(float)f
+(fits_get_version\(float)c(*version\))261 1748 y Fg(The)24
+b(\014rst)g(routine)f(prin)m(ts)g(out)i(information)e(ab)s(out)h(an)m
+(y)h(error)f(that)h(has)g(o)s(ccurred.)38 b(Whenev)m(er)25
+b(an)m(y)120 1861 y(CFITSIO)f(routine)h(encoun)m(ters)i(an)f(error)f
+(it)h(usually)d(writes)i(a)i(message)g(describing)c(the)j(nature)g(of)g
+(the)120 1974 y(error)g(to)i(an)e(in)m(ternal)f(error)i(message)g(stac)
+m(k)h(and)e(then)h(returns)e(with)g(a)i(p)s(ositiv)m(e)f(in)m(teger)h
+(status)g(v)-5 b(alue.)120 2087 y(P)m(assing)27 b(the)h(error)f(status)
+h(v)-5 b(alue)27 b(to)h(this)f(routine)f(will)f(cause)j(a)g(generic)g
+(description)d(of)j(the)g(error)f(and)120 2200 y(all)e(the)i(messages)h
+(from)e(the)h(in)m(ternal)e(CFITSIO)g(error)h(stac)m(k)i(to)g(b)s(e)e
+(prin)m(ted)f(to)i(the)g(sp)s(eci\014ed)e(stream.)120
+2313 y(The)30 b Fc(stream)f Fg(parameter)h(is)g(usually)e(set)j(equal)f
+(to)h Fc("stdout")d Fg(or)i Fc("stderr")p Fg(.)261 2426
+y(The)25 b(second)g(routine)f(simply)e(returns)i(a)h(30-c)m(haracter)j
+(descriptiv)m(e)c(error)g(message)i(corresp)s(onding)120
+2538 y(to)31 b(the)g(input)d(status)j(v)-5 b(alue.)261
+2651 y(The)30 b(last)g(routine)g(returns)f(the)h(curren)m(t)g(CFITSIO)f
+(library)f(v)m(ersion)i(n)m(um)m(b)s(er.)120 2899 y Fb(4.2)112
+b(File)37 b(Op)s(en/Close)g(Routines)120 3072 y Fc(int)47
+b(fits_open_file\()d(fitsfile)h(**fptr,)h(char)h(*filename,)e(int)h
+(mode,)h(int)g(*status\))120 3185 y(int)g(fits_open_data\()d(fitsfile)h
+(**fptr,)h(char)h(*filename,)e(int)h(mode,)h(int)g(*status\))120
+3298 y(int)g(fits_open_table\(fitsfile)41 b(**fptr,)46
+b(char)h(*filename,)e(int)h(mode,)h(int)g(*status\))120
+3411 y(int)g(fits_open_image\(fitsfile)41 b(**fptr,)46
+b(char)h(*filename,)e(int)h(mode,)h(int)g(*status\))120
+3637 y(int)g(fits_create_file\(fitsfil)o(e)42 b(**fptr,)k(char)g
+(*filename,)f(int)i(*status\))120 3750 y(int)g
+(fits_close_file\(fitsfile)41 b(*fptr,)46 b(int)h(*status\))261
+3962 y Fg(These)38 b(routines)e(op)s(en)i(or)f(close)i(a)f(\014le.)62
+b(The)37 b(\014rst)g Fc(fitsfile)f Fg(parameter)i(in)f(these)h(and)f
+(nearly)120 4075 y(ev)m(ery)28 b(other)g(CFITSIO)f(routine)f(is)h(a)h
+(p)s(oin)m(ter)f(to)h(a)g(structure)g(that)g(CFITSIO)e(uses)h(to)i
+(store)f(relev)-5 b(an)m(t)120 4188 y(parameters)31 b(ab)s(out)f(eac)m
+(h)i(op)s(ened)e(\014le.)41 b(Y)-8 b(ou)31 b(should)e(nev)m(er)i
+(directly)e(read)i(or)f(write)g(an)m(y)h(information)120
+4301 y(in)23 b(this)h(structure.)38 b(Memory)26 b(for)e(this)g
+(structure)g(is)g(allo)s(cated)g(automatically)h(when)f(the)h(\014le)e
+(is)h(op)s(ened)120 4414 y(or)30 b(created,)i(and)e(is)f(freed)h(when)g
+(the)g(\014le)g(is)f(closed.)261 4527 y(The)f Fc(mode)e
+Fg(parameter)j(in)d(the)i Fc(fits)p 1552 4527 29 4 v
+34 w(open)p 1778 4527 V 33 w(xxxx)f Fg(set)h(of)g(routines)f(can)h(b)s
+(e)f(set)i(to)f(either)g Fc(READONLY)120 4640 y Fg(or)i
+Fc(READWRITE)d Fg(to)j(select)g(the)g(t)m(yp)s(e)f(of)h(\014le)f
+(access)i(that)f(will)d(b)s(e)i(allo)m(w)m(ed.)40 b(These)29
+b(sym)m(b)s(olic)f(constan)m(ts)120 4753 y(are)j(de\014ned)e(in)g
+Fc(fitsio.h)p Fg(.)261 4866 y(The)k Fc(fits)p 649 4866
+V 33 w(open)p 874 4866 V 34 w(file)f Fg(routine)h(op)s(ens)f(the)i
+(\014le)f(and)f(p)s(ositions)g(the)i(in)m(ternal)e(\014le)g(p)s(oin)m
+(ter)h(to)h(the)120 4979 y(b)s(eginning)21 b(of)j(the)g(\014le,)g(or)g
+(to)h(the)f(sp)s(eci\014ed)e(extension)h(if)g(an)h(extension)f(name)h
+(or)g(n)m(um)m(b)s(er)e(is)h(app)s(ended)120 5092 y(to)k(the)f(\014le)g
+(name)g(\(see)h(the)g(later)f(section)h(on)f(\\CFITSIO)f(File)g(Names)i
+(and)f(Filters")g(for)g(a)g(description)120 5204 y(of)32
+b(the)f(syn)m(tax\).)45 b Fc(fits)p 945 5204 V 33 w(open)p
+1170 5204 V 33 w(data)31 b Fg(b)s(eha)m(v)m(es)g(similarly)d(except)33
+b(that)f(it)f(will)d(mo)m(v)m(e)33 b(to)f(the)g(\014rst)f(HDU)120
+5317 y(con)m(taining)k(signi\014can)m(t)f(data)i(if)e(a)i(HDU)g(name)g
+(or)f(n)m(um)m(b)s(er)f(to)i(op)s(en)f(is)f(not)i(explicitly)c(sp)s
+(eci\014ed)i(as)120 5430 y(part)23 b(of)h(the)g(\014lename.)38
+b(It)23 b(will)e(mo)m(v)m(e)k(to)g(the)e(\014rst)g(IMA)m(GE)i(HDU)f
+(with)e(NAXIS)i(greater)h(than)e(0,)j(or)d(the)1928 5809
+y(6)p eop
+%%Page: 7 7
+7 6 bop 120 573 a Fg(\014rst)29 b(table)g(that)i(do)s(es)e(not)h(con)m
+(tain)g(the)g(strings)e(`GTI')i(\(a)g(Go)s(o)s(d)g(Time)e(In)m(terv)-5
+b(al)30 b(extension\))f(or)h(`OB-)120 686 y(ST)-8 b(ABLE')37
+b(in)f(the)h(EXTNAME)h(k)m(eyw)m(ord)f(v)-5 b(alue.)61
+b(The)36 b Fc(fits)p 2380 686 29 4 v 34 w(open)p 2606
+686 V 33 w(table)g Fg(and)g Fc(fits)p 3290 686 V 34 w(open)p
+3516 686 V 33 w(image)120 799 y Fg(routines)e(are)i(similar)c(except)37
+b(that)f(they)f(will)e(mo)m(v)m(e)j(to)g(the)g(\014rst)e(signi\014can)m
+(t)h(table)g(HDU)h(or)f(image)120 912 y(HDU,)c(resp)s(ectiv)m(ely)f(if)
+f(a)i(HDU)g(name)g(of)f(n)m(um)m(b)s(er)f(is)h(not)g(sp)s(eci\014ed)f
+(as)i(part)f(of)g(the)h(input)d(\014le)i(name.)261 1024
+y(When)e(op)s(ening)f(an)h(existing)f(\014le,)h(the)h
+Fc(filename)d Fg(can)i(include)e(optional)i(argumen)m(ts,)h(enclosed)f
+(in)120 1137 y(square)h(brac)m(k)m(ets)i(that)f(sp)s(ecify)e
+(\014ltering)g(op)s(erations)g(that)i(should)e(b)s(e)h(applied)e(to)j
+(the)g(input)d(\014le.)40 b(F)-8 b(or)120 1250 y(example,)263
+1428 y Fc(myfile.fit[EVENTS][counts)41 b(>)48 b(0])120
+1605 y Fg(op)s(ens)27 b(the)i(table)f(in)f(the)i(EVENTS)e(extension)h
+(and)g(creates)i(a)e(virtual)f(table)h(b)m(y)g(selecting)g(only)g
+(those)120 1718 y(ro)m(ws)g(where)f(the)i(COUNTS)d(column)h(v)-5
+b(alue)28 b(is)f(greater)i(than)f(0.)40 b(See)28 b(section)g(5)h(for)f
+(more)g(examples)f(of)120 1831 y(these)k(p)s(o)m(w)m(erful)e
+(\014ltering)f(capabilities.)261 1944 y(In)38 b Fc(fits)p
+581 1944 V 33 w(create)p 902 1944 V 33 w(file)p Fg(,)h(the)g
+Fc(filename)d Fg(is)i(simply)e(the)i(ro)s(ot)h(name)f(of)h(the)g
+(\014le)e(to)i(b)s(e)f(created.)120 2057 y(Y)-8 b(ou)36
+b(can)g(o)m(v)m(erwrite)g(an)g(existing)e(\014le)h(b)m(y)g(pre\014xing)
+f(the)i(name)g(with)e(a)i(`!')57 b(c)m(haracter)37 b(\(on)f(the)f(Unix)
+120 2170 y(command)30 b(line)e(this)h(m)m(ust)g(b)s(e)g(pre\014xed)g
+(with)g(a)h(bac)m(kslash,)g(as)g(in)e Fc(`\\!file.fit')p
+Fg(\).)38 b(If)29 b(the)h(\014le)f(name)120 2282 y(ends)f(with)f
+Fc(.gz)h Fg(the)h(\014le)f(will)e(b)s(e)i(compressed)g(using)f(the)i
+(gzip)f(algorithm.)39 b(If)29 b(the)f(\014lename)g(is)g
+Fc(stdout)120 2395 y Fg(or)h Fc("-")e Fg(\(a)j(single)d(dash)h(c)m
+(haracter\))j(then)d(the)h(output)f(\014le)g(will)e(b)s(e)i(pip)s(ed)e
+(to)k(the)f(stdout)f(stream.)41 b(Y)-8 b(ou)120 2508
+y(can)27 b(c)m(hain)f(sev)m(eral)g(tasks)h(together)h(b)m(y)f(writing)d
+(the)j(output)f(from)g(the)g(\014rst)g(task)h(to)g Fc(stdout)e
+Fg(and)h(then)120 2621 y(reading)j(the)i(input)d(\014le)i(in)f(the)i
+(2nd)e(task)i(from)f Fc(stdin)f Fg(or)h Fc("-")p Fg(.)120
+2867 y Fb(4.3)112 b(HDU-lev)m(el)36 b(Routines)261 3040
+y Fg(The)30 b(routines)f(listed)g(in)g(this)h(section)g(op)s(erate)h
+(on)f(Header-Data)j(Units)d(\(HDUs\))h(in)e(a)i(\014le.)120
+3153 y Fc(________________________)o(____)o(____)o(___)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(__)120 3266 y(int)47
+b(fits_get_num_hdus\(fitsfi)o(le)42 b(*fptr,)k(int)h(*hdunum,)e(int)i
+(*status\))120 3379 y(int)g(fits_get_hdu_num\(fitsfil)o(e)42
+b(*fptr,)94 b(int)47 b(*hdunum\))261 3579 y Fg(The)39
+b(\014rst)f(routines)g(returns)g(the)h(total)h(n)m(um)m(b)s(er)e(of)h
+(HDUs)h(in)d(the)j(FITS)e(\014le,)j(and)d(the)h(second)120
+3692 y(routine)32 b(returns)f(the)i(p)s(osition)e(of)i(the)g(curren)m
+(tly)e(op)s(ened)h(HDU)i(in)d(the)i(FITS)f(\014le)g(\(starting)g(with)g
+(1,)120 3805 y(not)f(0\).)120 4005 y Fc(________________________)o
+(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o
+(____)o(___)o(____)o(__)120 4118 y(int)47 b(fits_movabs_hdu\(fitsfile)
+41 b(*fptr,)46 b(int)h(hdunum,)f(int)h(*hdutype,)e(int)i(*status\))120
+4231 y(int)g(fits_movrel_hdu\(fitsfile)41 b(*fptr,)46
+b(int)h(nmove,)94 b(int)47 b(*hdutype,)e(int)i(*status\))120
+4344 y(int)g(fits_movnam_hdu\(fitsfile)41 b(*fptr,)46
+b(int)h(hdutype,)f(char)g(*extname,)1075 4457 y(int)g(extver,)g(int)h
+(*status\))261 4657 y Fg(These)31 b(routines)f(enable)h(y)m(ou)g(to)h
+(mo)m(v)m(e)g(to)g(a)g(di\013eren)m(t)e(HDU)i(in)e(the)h(\014le.)42
+b(Most)32 b(of)g(the)f(CFITSIO)120 4770 y(functions)g(whic)m(h)h(read)h
+(or)g(write)f(k)m(eyw)m(ords)h(or)g(data)h(op)s(erate)f(only)g(on)f
+(the)h(curren)m(tly)f(op)s(ened)h(HDU)120 4883 y(in)h(the)h(\014le.)53
+b(The)34 b(\014rst)g(routine)g(mo)m(v)m(es)i(to)g(the)f(sp)s(eci\014ed)
+e(absolute)i(HDU)g(n)m(um)m(b)s(er)f(in)f(the)i(FITS)f(\014le)120
+4996 y(\(the)e(\014rst)f(HDU)i(=)e(1\),)i(whereas)f(the)g(second)f
+(routine)g(mo)m(v)m(es)i(a)f(relativ)m(e)g(n)m(um)m(b)s(er)f(of)h(HDUs)
+g(forw)m(ard)120 5109 y(or)f(bac)m(kw)m(ard)h(from)e(the)i(curren)m
+(tly)e(op)s(en)g(HDU.)i(The)f Fc(hdutype)e Fg(parameter)i(returns)f
+(the)i(t)m(yp)s(e)f(of)g(the)120 5222 y(newly)d(op)s(ened)h(HDU,)i(and)
+e(will)e(b)s(e)i(equal)g(to)h(one)g(of)g(these)g(sym)m(b)s(olic)e
+(constan)m(t)j(v)-5 b(alues:)40 b Fc(IMAGE)p 3564 5222
+V 33 w(HDU,)120 5334 y(ASCII)p 366 5334 V 33 w(TBL,)47
+b(or)g(BINARY)p 1069 5334 V 33 w(TBL)p Fg(.)37 b Fc(hdutype)g
+Fg(ma)m(y)h(b)s(e)g(set)h(to)g(NULL)f(if)f(it)h(is)g(not)g(needed.)64
+b(The)38 b(third)120 5447 y(routine)30 b(mo)m(v)m(es)j(to)f(the)f
+(\(\014rst\))h(HDU)g(that)f(matc)m(hes)i(the)e(input)f(extension)h(t)m
+(yp)s(e,)g(name,)h(and)f(v)m(ersion)120 5560 y(n)m(um)m(b)s(er,)23
+b(as)f(giv)m(en)h(b)m(y)f(the)g Fc(XTENSION,)46 b(EXTNAME)20
+b Fg(\(or)j Fc(HDUNAME)p Fg(\))d(and)i Fc(EXTVER)f Fg(k)m(eyw)m(ords.)
+38 b(If)22 b(the)g(input)1928 5809 y(7)p eop
+%%Page: 8 8
+8 7 bop 120 573 a Fg(v)-5 b(alue)33 b(of)g Fc(extver)e
+Fg(=)i(0,)i(then)e(the)g(v)m(ersion)g(n)m(um)m(b)s(er)e(will)g(b)s(e)h
+(ignored)h(when)f(lo)s(oking)g(for)h(a)g(matc)m(hing)120
+686 y(HDU.)120 898 y Fc(________________________)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)120
+1011 y(int)47 b(fits_get_hdu_type\(fitsfi)o(le)42 b(*fptr,)93
+b(int)47 b(*hdutype,)f(int)g(*status\))261 1224 y Fg(Get)21
+b(the)g(t)m(yp)s(e)f(of)h(the)f(curren)m(t)g(HDU)h(in)e(the)i(FITS)e
+(\014le:)35 b Fc(IMAGE)p 2435 1224 29 4 v 33 w(HDU,)47
+b(ASCII)p 2947 1224 V 33 w(TBL,)f(or)h(BINARY)p 3649
+1224 V 33 w(TBL)p Fg(.)120 1436 y Fc(________________________)o(____)o
+(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)o
+(___)120 1549 y(int)g(fits_copy_hdu\(fitsfile)42 b(*infptr,)j(fitsfile)
+h(*outfptr,)f(int)i(morekeys,)979 1662 y(int)g(*status\))120
+1775 y(int)g(fits_copy_file\(fitsfile)41 b(*infptr,)46
+b(fitsfile)f(*outfptr,)h(int)h(previous,)979 1888 y(int)g(current,)f
+(int)g(following,)f(>)j(int)f(*status\))261 2100 y Fg(The)34
+b(\014rst)g(routine)f(copies)i(the)f(curren)m(t)g(HDU)i(from)e(the)g
+(FITS)g(\014le)g(asso)s(ciated)g(with)g(infptr)e(and)120
+2213 y(app)s(ends)i(it)i(to)h(the)f(end)f(of)h(the)g(FITS)g(\014le)f
+(asso)s(ciated)h(with)f(outfptr.)57 b(Space)36 b(ma)m(y)h(b)s(e)e
+(reserv)m(ed)i(for)120 2326 y Fc(morekeys)32 b Fg(additional)h(k)m(eyw)
+m(ords)i(in)f(the)g(output)h(header.)53 b(The)35 b(second)f(routine)g
+(copies)h(an)m(y)g(HDUs)120 2439 y(previous)41 b(to)j(the)e(curren)m(t)
+h(HDU,)h(and/or)e(the)h(curren)m(t)f(HDU,)i(and/or)f(an)m(y)g(HDUs)g
+(follo)m(wing)e(the)120 2552 y(curren)m(t)22 b(HDU,)h(dep)s(ending)c
+(on)j(the)g(v)-5 b(alue)22 b(\(T)-8 b(rue)22 b(or)g(F)-8
+b(alse\))23 b(of)f Fc(previous,)45 b(current)p Fg(,)22
+b(and)g Fc(following)p Fg(,)120 2665 y(resp)s(ectiv)m(ely)-8
+b(.)40 b(F)-8 b(or)32 b(example,)215 2853 y Fc(fits_copy_file\(infptr,)
+42 b(outfptr,)k(0,)h(1,)g(1,)g(&status\);)120 3040 y
+Fg(will)32 b(cop)m(y)k(the)f(curren)m(t)g(HDU)g(and)g(an)m(y)g(HDUs)g
+(that)h(follo)m(w)e(it)g(from)h(the)g(input)e(to)i(the)h(output)e
+(\014le,)120 3153 y(but)c(it)g(will)d(not)k(cop)m(y)g(an)m(y)g(HDUs)g
+(preceding)e(the)i(curren)m(t)f(HDU.)1928 5809 y(8)p
+eop
+%%Page: 9 9
+9 8 bop 120 573 a Fb(4.4)112 b(Image)37 b(I/O)h(Routines)120
+744 y Fg(This)29 b(section)h(lists)f(the)i(more)f(imp)s(ortan)m(t)g
+(CFITSIO)e(routines)i(whic)m(h)f(op)s(erate)i(on)f(FITS)g(images.)120
+956 y Fc(________________________)o(____)o(____)o(___)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(__)120 1069 y(int)47
+b(fits_get_img_type\(fitsfi)o(le)42 b(*fptr,)k(int)h(*bitpix,)e(int)i
+(*status\))120 1181 y(int)g(fits_get_img_dim\()c(fitsfile)j(*fptr,)g
+(int)h(*naxis,)93 b(int)47 b(*status\))120 1294 y(int)g
+(fits_get_img_size\(fitsfi)o(le)42 b(*fptr,)k(int)h(maxdim,)93
+b(long)47 b(*naxes,)1170 1407 y(int)g(*status\))120 1520
+y(int)g(fits_get_img_param\(fitsf)o(ile)41 b(*fptr,)46
+b(int)h(maxdim,)94 b(int)47 b(*bitpix,)1218 1633 y(int)g(*naxis,)e
+(long)i(*naxes,)f(int)h(*status\))261 1844 y Fg(Get)38
+b(information)e(ab)s(out)h(the)g(curren)m(tly)f(op)s(ened)h(image)g
+(HDU.)h(The)f(\014rst)f(routine)g(returns)g(the)120 1957
+y(datat)m(yp)s(e)41 b(of)e(the)h(image)g(as)g(\(de\014ned)f(b)m(y)g
+(the)h Fc(BITPIX)e Fg(k)m(eyw)m(ord\),)43 b(whic)m(h)38
+b(can)i(ha)m(v)m(e)h(the)f(follo)m(wing)120 2070 y(sym)m(b)s(olic)29
+b(constan)m(t)i(v)-5 b(alues:)311 2256 y Fc(BYTE_IMG)141
+b(=)i(8)g(\()47 b(8-bit)g(byte)f(pixels,)g(0)h(-)h(255\))311
+2369 y(SHORT_IMG)93 b(=)i(16)143 b(\(16)47 b(bit)g(integer)e(pixels\))
+311 2482 y(LONG_IMG)141 b(=)95 b(32)143 b(\(32-bit)46
+b(integer)f(pixels\))311 2595 y(FLOAT_IMG)93 b(=)47 b(-32)143
+b(\(32-bit)46 b(floating)f(point)h(pixels\))311 2708
+y(DOUBLE_IMG)f(=)i(-64)143 b(\(64-bit)46 b(floating)f(point)h(pixels\))
+261 2895 y Fg(The)34 b(second)g(and)f(third)f(routines)h(return)g(the)h
+(n)m(um)m(b)s(er)e(of)i(dimensions)d(in)i(the)h(image)g(\(from)g(the)
+120 3007 y Fc(NAXIS)25 b Fg(k)m(eyw)m(ord\),)j(and)e(the)h(sizes)f(of)g
+(eac)m(h)i(dimension)c(\(from)i(the)g Fc(NAXIS1,)46 b(NAXIS2)p
+Fg(,)26 b(etc.)40 b(k)m(eyw)m(ords\).)120 3120 y(The)g(last)h(routine)f
+(simply)f(com)m(bines)h(the)i(function)d(of)i(the)h(\014rst)e(3)h
+(routines.)72 b(The)40 b(input)f Fc(maxdim)120 3233 y
+Fg(parameter)28 b(in)f(this)f(routine)h(giv)m(es)h(the)g(maxim)m(um)f
+(n)m(um)m(b)s(er)f(dimensions)f(that)k(ma)m(y)f(b)s(e)f(returned)g
+(\(i.e.,)120 3346 y(the)k(dimension)c(of)k(the)f Fc(naxes)f
+Fg(arra)m(y\))120 3557 y Fc(________________________)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(____)o(___)o(_)120
+3670 y(int)47 b(fits_create_img\(fitsfile)41 b(*fptr,)46
+b(int)h(bitpix,)f(int)h(naxis,)1075 3783 y(long)f(*naxes,)g(int)h
+(*status\))261 3994 y Fg(Create)28 b(an)f(image)h(HDU)g(b)m(y)f
+(writing)e(the)i(required)f(k)m(eyw)m(ords)h(whic)m(h)f(de\014ne)h(the)
+g(structure)g(of)g(the)120 4107 y(image.)50 b(The)33
+b(2nd)f(through)h(4th)h(parameters)f(sp)s(eci\014ed)f(the)h(datat)m(yp)
+s(e,)j(the)d(n)m(um)m(b)s(er)f(of)i(dimensions,)120 4220
+y(and)26 b(the)h(sizes)f(of)g(the)h(dimensions.)37 b(The)26
+b(allo)m(w)m(ed)g(v)-5 b(alues)26 b(of)h(the)f Fc(bitpix)f
+Fg(parameter)i(are)g(listed)e(ab)s(o)m(v)m(e)120 4333
+y(in)32 b(the)h(description)e(of)i(the)g Fc(fits)p 1319
+4333 29 4 v 33 w(get)p 1496 4333 V 33 w(img)p 1673 4333
+V 34 w(type)f Fg(routine.)47 b(If)32 b(the)h(FITS)f(\014le)g(p)s(oin)m
+(ted)g(to)i(b)m(y)f Fc(fptr)e Fg(is)120 4446 y(empt)m(y)c(\(previously)
+d(created)j(with)e Fc(fits)p 1575 4446 V 33 w(create)p
+1896 4446 V 33 w(file)p Fg(\))g(then)h(this)f(routine)g(creates)j(a)f
+(primary)d(arra)m(y)120 4559 y(in)36 b(the)h(\014le,)h(otherwise)f(a)g
+(new)g(IMA)m(GE)h(extension)f(is)f(app)s(ended)f(to)j(end)f(of)g(the)g
+(\014le)g(follo)m(wing)e(the)120 4672 y(other)c(HDUs)g(in)e(the)h
+(\014le.)120 4883 y Fc(________________________)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)o(___)o(____)o(_)120
+4996 y(int)47 b(fits_write_pix\(fitsfile)41 b(*fptr,)46
+b(int)h(datatype,)f(long)g(*fpixel,)836 5109 y(long)h(nelements,)e
+(void)h(*array,)g(int)h(*status\);)120 5334 y(int)g
+(fits_write_pixnull\(fitsf)o(ile)41 b(*fptr,)46 b(int)h(datatype,)f
+(long)g(*fpixel,)836 5447 y(long)h(nelements,)e(void)h(*array,)g(void)h
+(*nulval,)e(int)i(*status\);)1928 5809 y Fg(9)p eop
+%%Page: 10 10
+10 9 bop 120 573 a Fc(int)47 b(fits_read_pix\(fitsfile)42
+b(*fptr,)k(int)94 b(datatype,)46 b(long)g(*fpixel,)979
+686 y(long)h(nelements,)e(void)h(*nulval,)g(void)h(*array,)979
+799 y(int)g(*anynul,)f(int)g(*status\))261 1007 y Fg(Read)32
+b(or)f(write)f(all)g(or)h(part)h(of)f(the)g(FITS)g(image.)43
+b(There)31 b(are)h(2)f(di\013eren)m(t)g('write')g(pixel)e(routines:)120
+1120 y(The)23 b(\014rst)g(simply)e(writes)i(the)h(input)e(arra)m(y)i
+(of)g(pixels)e(to)i(the)g(FITS)f(\014le.)38 b(The)23
+b(second)h(is)f(similar,)f(except)120 1233 y(that)30
+b(it)e(substitutes)g(the)h(appropriate)f(n)m(ull)f(pixel)g(v)-5
+b(alue)29 b(in)f(the)h(FITS)f(\014le)g(for)h(an)m(y)g(pixels)e(whic)m
+(h)h(ha)m(v)m(e)120 1346 y(a)j(v)-5 b(alue)29 b(equal)h(to)h
+Fc(*nulval)d Fg(\(note)j(that)g(this)e(parameter)h(giv)m(es)h(the)f
+(address)f(of)i(the)f(n)m(ull)e(pixel)h(v)-5 b(alue,)120
+1459 y(not)35 b(the)g(v)-5 b(alue)34 b(itself)7 b(\).)52
+b(Similarly)-8 b(,)33 b(when)g(reading)h(an)h(image,)h(CFITSIO)d(will)f
+(substitute)h(the)i(v)-5 b(alue)120 1572 y(giv)m(en)29
+b(b)m(y)f Fc(nulval)f Fg(for)i(an)m(y)g(unde\014ned)d(pixels)h(in)h
+(the)h(image,)g(unless)e Fc(nulval)46 b(=)i(NULL)p Fg(,)27
+b(in)h(whic)m(h)f(case)120 1685 y(no)j(c)m(hec)m(ks)i(will)c(b)s(e)i
+(made)g(for)g(unde\014ned)e(pixels)h(when)g(reading)h(the)g(FITS)g
+(image.)261 1798 y(The)35 b Fc(fpixel)f Fg(parameter)i(in)e(these)i
+(routines)e(is)h(an)g(arra)m(y)h(whic)m(h)e(giv)m(es)i(the)g(co)s
+(ordinate)f(in)f(eac)m(h)120 1910 y(dimension)22 b(of)k(the)f(\014rst)f
+(pixel)g(to)h(b)s(e)g(read)g(or)g(written,)g(and)g Fc(nelements)d
+Fg(is)i(the)h(total)h(n)m(um)m(b)s(er)e(of)h(pixels)120
+2023 y(to)i(read)g(or)f(write.)39 b Fc(array)25 b Fg(is)h(the)g
+(address)g(of)h(an)f(arra)m(y)h(whic)m(h)e(either)h(con)m(tains)h(the)g
+(pixel)e(v)-5 b(alues)26 b(to)h(b)s(e)120 2136 y(written,)k(or)g(will)e
+(hold)g(the)j(v)-5 b(alues)30 b(of)i(the)f(pixels)f(that)i(are)f(read.)
+43 b(When)31 b(reading,)g Fc(array)f Fg(m)m(ust)h(ha)m(v)m(e)120
+2249 y(b)s(een)k(allo)s(cated)h(large)g(enough)f(to)i(hold)d(all)h(the)
+h(returned)f(pixel)f(v)-5 b(alues.)56 b(These)36 b(routines)e(starts)j
+(at)120 2362 y(the)e Fc(fpixel)d Fg(lo)s(cation)i(and)g(then)g(read)h
+(or)f(write)g(the)g Fc(nelements)e Fg(pixels,)i(con)m(tin)m(uing)g(on)g
+(successiv)m(e)120 2475 y(ro)m(ws)f(of)g(the)g(image)g(if)f(necessary)
+-8 b(.)49 b(F)-8 b(or)34 b(example,)g(to)f(write)f(an)h(en)m(tire)g(2D)
+h(image,)g(set)f Fc(fpixel[0])46 b(=)120 2588 y(fpixel[1])f(=)j(1)p
+Fg(,)35 b(and)f Fc(nelements)46 b(=)h(NAXIS1)f(*)i(NAXIS2)p
+Fg(.)j(Or)34 b(to)i(read)e(just)g(the)h(10th)h(ro)m(w)e(of)h(the)120
+2701 y(image,)49 b(set)c Fc(fpixel[0])g(=)j(1,)f(fpixel[1])e(=)j(10)p
+Fg(,)g(and)c Fc(nelements)h(=)i(NAXIS1)p Fg(.)82 b(The)45
+b Fc(datatype)120 2814 y Fg(parameter)28 b(sp)s(eci\014es)d(the)j
+(datat)m(yp)s(e)g(of)f(the)g(C)g Fc(array)e Fg(in)h(the)h(program,)h
+(whic)m(h)e(need)h(not)g(b)s(e)g(the)g(same)120 2927
+y(as)32 b(the)f(datat)m(yp)s(e)i(of)e(the)h(FITS)f(image)g(itself.)43
+b(If)31 b(the)h(datat)m(yp)s(es)g(di\013er)e(then)h(CFITSIO)f(will)f
+(con)m(v)m(ert)120 3040 y(the)i(data)h(as)f(it)g(is)f(read)h(or)g
+(written.)41 b(The)31 b(follo)m(wing)e(sym)m(b)s(olic)h(constan)m(ts)i
+(are)f(allo)m(w)m(ed)g(for)g(the)g(v)-5 b(alue)120 3152
+y(of)31 b Fc(datatype)p Fg(:)215 3337 y Fc(TBYTE)238
+b(unsigned)45 b(char)215 3450 y(TSBYTE)190 b(signed)46
+b(char)215 3563 y(TSHORT)190 b(signed)46 b(short)215
+3675 y(TUSHORT)142 b(unsigned)45 b(short)215 3788 y(TINT)286
+b(signed)46 b(int)215 3901 y(TUINT)238 b(unsigned)45
+b(int)215 4014 y(TLONG)238 b(signed)46 b(long)215 4127
+y(TULONG)190 b(unsigned)45 b(long)215 4240 y(TFLOAT)190
+b(float)215 4353 y(TDOUBLE)142 b(double)120 4561 y
+(________________________)o(____)o(____)o(___)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)120 4674 y(int)47 b
+(fits_write_subset\(fitsfi)o(le)42 b(*fptr,)k(int)h(datatype,)e(long)h
+(*fpixel,)740 4787 y(long)h(*lpixel,)f(DTYPE)g(*array,)g(>)h(int)g
+(*status\))120 5013 y(int)g(fits_read_subset\(fitsfil)o(e)42
+b(*fptr,)k(int)95 b(datatype,)45 b(long)h(*fpixel,)740
+5126 y(long)h(*lpixel,)f(long)g(*inc,)h(void)f(*nulval,)94
+b(void)46 b(*array,)740 5239 y(int)h(*anynul,)f(int)h(*status\))261
+5447 y Fg(Read)i(or)g(write)e(a)i(rectangular)g(section)g(of)g(the)f
+(FITS)g(image.)96 b(These)49 b(are)g(v)m(ery)g(similar)d(to)120
+5560 y Fc(fits)p 318 5560 29 4 v 33 w(write)p 591 5560
+V 33 w(pix)37 b Fg(and)f Fc(fits)p 1180 5560 V 34 w(read)p
+1406 5560 V 33 w(pix)g Fg(except)j(that)f(y)m(ou)f(sp)s(ecify)f(the)i
+(last)f(pixel)f(co)s(ordinate)h(\(the)1905 5809 y(10)p
+eop
+%%Page: 11 11
+11 10 bop 120 573 a Fg(upp)s(er)22 b(righ)m(t)h(corner)h(of)g(the)h
+(section\))f(instead)f(of)h(the)h(n)m(um)m(b)s(er)d(of)i(pixels)f(to)h
+(b)s(e)g(read.)38 b(The)23 b(read)h(routine)120 686 y(also)38
+b(has)f(an)h Fc(inc)f Fg(parameter)h(whic)m(h)e(can)j(b)s(e)e(used)g
+(to)h(read)g(only)f(ev)m(ery)h Fc(inc-th)e Fg(pixel)g(along)i(eac)m(h)
+120 799 y(dimension)26 b(of)j(the)g(image.)40 b(Normally)28
+b Fc(inc[0])46 b(=)h(inc[1])f(=)i(1)28 b Fg(to)i(read)e(ev)m(ery)i
+(pixel)d(in)g(a)i(2D)h(image.)120 912 y(T)-8 b(o)31 b(read)f(ev)m(ery)h
+(other)g(pixel)e(in)g(the)h(en)m(tire)h(2D)g(image,)g(set)311
+1099 y Fc(fpixel[0])45 b(=)j(fpixel[1])d(=)i(1)311 1212
+y(lpixel[0])e(=)j({NAXIS1})311 1325 y(lpixel[1])d(=)j({NAXIS2})311
+1438 y(inc[0])e(=)h(inc[1])g(=)g(2)261 1626 y Fg(Or,)30
+b(to)h(read)f(the)h(8th)g(ro)m(w)f(of)h(a)f(2D)i(image,)e(set)311
+1813 y Fc(fpixel[0])45 b(=)j(1)311 1926 y(fpixel[1])d(=)j(8)311
+2039 y(lpixel[0])d(=)j({NAXIS1})311 2152 y(lpixel[1])d(=)j(8)311
+2265 y(inc[0])e(=)h(inc[1])g(=)g(1)1905 5809 y Fg(11)p
+eop
+%%Page: 12 12
+12 11 bop 120 573 a Fb(4.5)112 b(T)-9 b(able)37 b(I/O)h(Routines)120
+744 y Fg(This)29 b(section)h(lists)f(the)i(most)f(imp)s(ortan)m(t)g
+(CFITSIO)f(routines)g(whic)m(h)g(op)s(erate)i(on)f(FITS)g(tables.)120
+957 y Fc(________________________)o(____)o(____)o(___)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o(__)120
+1070 y(int)47 b(fits_create_tbl\(fitsfile)41 b(*fptr,)46
+b(int)h(tbltype,)f(long)g(nrows,)g(int)h(tfields,)311
+1183 y(char)g(*ttype[],char)d(*tform[],)h(char)i(*tunit[],)e(char)i
+(*extname,)e(int)i(*status\))261 1395 y Fg(Create)e(a)f(new)f(table)h
+(extension)f(b)m(y)h(writing)e(the)i(required)e(k)m(eyw)m(ords)i(that)g
+(de\014ne)f(the)h(table)120 1508 y(structure.)38 b(The)22
+b(required)e(n)m(ull)h(primary)f(arra)m(y)j(will)d(b)s(e)i(created)i
+(\014rst)d(if)h(the)h(\014le)e(is)h(initially)d(completely)120
+1621 y(empt)m(y)-8 b(.)41 b Fc(tbltype)26 b Fg(de\014nes)i(the)g(t)m
+(yp)s(e)h(of)g(table)f(and)g(can)g(ha)m(v)m(e)i(v)-5
+b(alues)28 b(of)g Fc(ASCII)p 2931 1621 29 4 v 33 w(TBL)47
+b(or)g(BINARY)p 3586 1621 V 33 w(TBL)p Fg(.)120 1734
+y(Binary)33 b(tables)h(are)h(generally)e(preferred)g(b)s(ecause)h(they)
+h(are)f(more)h(e\016cien)m(t)f(and)g(supp)s(ort)f(a)h(greater)120
+1847 y(range)d(of)f(column)f(datat)m(yp)s(es)j(than)e(ASCI)s(I)f
+(tables.)261 1960 y(The)c Fc(nrows)f Fg(parameter)i(giv)m(es)g(the)f
+(initial)e(n)m(um)m(b)s(er)h(of)i(empt)m(y)g(ro)m(ws)f(to)h(b)s(e)f
+(allo)s(cated)g(for)h(the)f(table;)120 2073 y(this)g(should)g(normally)
+f(b)s(e)i(set)h(to)g(0.)40 b(The)26 b Fc(tfields)f Fg(parameter)i(giv)m
+(es)f(the)h(n)m(um)m(b)s(er)e(of)i(columns)e(in)g(the)120
+2186 y(table)e(\(maxim)m(um)f(=)g(999\).)40 b(The)22
+b Fc(ttype,)46 b(tform)p Fg(,)24 b(and)e Fc(tunit)f Fg(parameters)i
+(giv)m(e)h(the)f(name,)h(datat)m(yp)s(e,)120 2299 y(and)34
+b(ph)m(ysical)f(units)h(of)g(eac)m(h)i(column,)f(and)f
+Fc(extname)f Fg(giv)m(es)i(the)g(name)g(for)f(the)h(table)g(\(the)g(v)
+-5 b(alue)34 b(of)120 2412 y(the)j Fc(EXTNAME)e Fg(k)m(eyw)m(ord\).)61
+b(The)36 b(FITS)g(Standard)g(recommends)g(that)i(only)e(letters,)j
+(digits,)e(and)f(the)120 2524 y(underscore)27 b(c)m(haracter)h(b)s(e)f
+(used)g(in)f(column)g(names)h(with)f(no)h(em)m(b)s(edded)g(spaces.)40
+b(It)27 b(is)g(recommended)120 2637 y(that)k(all)e(the)i(column)e
+(names)h(in)f(a)i(giv)m(en)f(table)h(b)s(e)e(unique)g(within)f(the)i
+(\014rst)g(8)h(c)m(haracters.)261 2750 y(The)g(follo)m(wing)f(table)i
+(sho)m(ws)f(the)h(TF)m(ORM)g(column)e(format)i(v)-5 b(alues)31
+b(that)h(are)g(allo)m(w)m(ed)g(in)e(ASCI)s(I)120 2863
+y(tables)g(and)g(in)f(binary)g(tables:)502 3051 y Fc(ASCII)46
+b(Table)h(Column)f(Format)g(Codes)502 3164 y(------------------------)o
+(---)o(----)502 3277 y(\(w)h(=)g(column)g(width,)f(d)h(=)h(no.)e(of)i
+(decimal)d(places)i(to)g(display\))693 3390 y(Aw)142
+b(-)48 b(character)d(string)693 3502 y(Iw)142 b(-)48
+b(integer)693 3615 y(Fw.d)e(-)i(fixed)e(floating)g(point)693
+3728 y(Ew.d)g(-)i(exponential)d(floating)g(point)693
+3841 y(Dw.d)h(-)i(exponential)d(floating)g(point)502
+4067 y(Binary)h(Table)g(Column)g(Format)g(Codes)502 4180
+y(------------------------)o(---)o(----)o(-)502 4293
+y(\(r)h(=)g(vector)g(length,)e(default)h(=)i(1\))693
+4406 y(rA)95 b(-)47 b(character)e(string)693 4519 y(rAw)i(-)g(array)f
+(of)i(strings,)d(each)i(of)g(length)f(w)693 4632 y(rL)95
+b(-)47 b(logical)693 4744 y(rX)95 b(-)47 b(bit)693 4857
+y(rB)95 b(-)47 b(unsigned)f(byte)693 4970 y(rS)95 b(-)47
+b(signed)f(byte)h(**)693 5083 y(rI)95 b(-)47 b(signed)f(16-bit)g
+(integer)693 5196 y(rU)95 b(-)47 b(unsigned)f(16-bit)g(integer)g(**)693
+5309 y(rJ)95 b(-)47 b(signed)f(32-bit)g(integer)693 5422
+y(rV)95 b(-)47 b(unsigned)f(32-bit)g(integer)g(**)693
+5535 y(rK)95 b(-)47 b(64-bit)f(integer)g(***)1905 5809
+y Fg(12)p eop
+%%Page: 13 13
+13 12 bop 693 573 a Fc(rE)95 b(-)47 b(32-bit)f(floating)g(point)693
+686 y(rD)95 b(-)47 b(64-bit)f(floating)g(point)693 799
+y(rC)95 b(-)47 b(32-bit)f(complex)g(pair)693 912 y(rM)95
+b(-)47 b(64-bit)f(complex)g(pair)359 1137 y(**)h(The)g(S,)g(U)g(and)g
+(V)h(format)e(codes)g(are)h(not)g(actual)f(legal)g(TFORMn)h(values.)502
+1250 y(CFITSIO)f(substitutes)e(the)j(somewhat)f(more)g(complicated)f
+(set)i(of)502 1363 y(keywords)e(that)i(are)g(used)g(to)g(represent)e
+(unsigned)h(integers)f(or)502 1476 y(signed)h(bytes.)311
+1702 y(***)h(The)g(64-bit)f(integer)g(format)g(is)h(experimental)d(and)
+j(is)g(not)502 1815 y(officially)e(recognized)g(in)i(the)g(FITS)g
+(Standard.)261 2002 y Fg(The)27 b Fc(tunit)e Fg(and)h
+Fc(extname)f Fg(parameters)j(are)f(optional)f(and)h(ma)m(y)g(b)s(e)g
+(set)g(to)h(NULL)f(if)f(they)h(are)g(not)120 2115 y(needed.)261
+2228 y(Note)41 b(that)f(it)e(ma)m(y)i(b)s(e)f(easier)g(to)h(create)h(a)
+f(new)e(table)h(b)m(y)h(cop)m(ying)f(the)g(header)g(from)g(another)120
+2341 y(existing)29 b(table)i(with)e Fc(fits)p 1089 2341
+29 4 v 33 w(copy)p 1314 2341 V 33 w(header)g Fg(rather)h(than)g
+(calling)f(this)g(routine.)120 2554 y Fc(________________________)o
+(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o(__)
+120 2667 y(int)47 b(fits_get_num_rows\(fitsfi)o(le)42
+b(*fptr,)k(long)g(*nrows,)g(int)h(*status\))120 2780
+y(int)g(fits_get_num_cols\(fitsfi)o(le)42 b(*fptr,)k(int)94
+b(*ncols,)46 b(int)h(*status\))261 2992 y Fg(Get)37 b(the)g(n)m(um)m(b)
+s(er)d(of)j(ro)m(ws)f(or)g(columns)f(in)f(the)j(curren)m(t)e(FITS)h
+(table.)58 b(The)35 b(n)m(um)m(b)s(er)g(of)h(ro)m(ws)g(is)120
+3105 y(giv)m(en)d(b)m(y)g(the)g Fc(NAXIS2)e Fg(k)m(eyw)m(ord)j(and)e
+(the)h(n)m(um)m(b)s(er)f(of)h(columns)f(is)g(giv)m(en)h(b)m(y)g(the)g
+Fc(TFIELDS)e Fg(k)m(eyw)m(ord)120 3218 y(in)e(the)i(header)f(of)g(the)h
+(table.)120 3430 y Fc(________________________)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)o(___)o(____)o(__)120
+3543 y(int)47 b(fits_get_colnum\(fitsfile)41 b(*fptr,)46
+b(int)h(casesen,)f(char)g(*template,)1075 3656 y(int)g(*colnum,)g(int)h
+(*status\))120 3769 y(int)g(fits_get_colname\(fitsfil)o(e)42
+b(*fptr,)k(int)h(casesen,)e(char)i(*template,)1075 3882
+y(char)f(*colname,)f(int)i(*colnum,)f(int)h(*status\))261
+4095 y Fg(Get)33 b(the)e(column)f(n)m(um)m(b)s(er)g(\(starting)i(with)e
+(1,)i(not)g(0\))g(of)f(the)h(column)e(whose)h(name)h(matc)m(hes)g(the)
+120 4208 y(sp)s(eci\014ed)37 b(template)i(name.)66 b(The)38
+b(only)g(di\013erence)g(in)f(these)i(2)g(routines)f(is)f(that)j(the)e
+(2nd)g(one)h(also)120 4320 y(returns)29 b(the)i(name)f(of)h(the)f
+(column)f(that)i(matc)m(hed)h(the)e(template)h(string.)261
+4433 y(Normally)-8 b(,)27 b Fc(casesen)d Fg(should)g(b)s(e)i(set)h(to)g
+Fc(CASEINSEN)p Fg(,)d(but)i(it)f(ma)m(y)i(b)s(e)f(set)h(to)g
+Fc(CASESEN)d Fg(to)j(force)g(the)120 4546 y(name)j(matc)m(hing)h(to)g
+(b)s(e)f(case-sensitiv)m(e.)261 4659 y(The)22 b(input)e
+Fc(template)g Fg(string)h(giv)m(es)i(the)f(name)h(of)f(the)h(desired)d
+(column)h(and)h(ma)m(y)h(include)d(wildcard)120 4772
+y(c)m(haracters:)41 b(a)30 b(`*')g(matc)m(hes)g(an)m(y)f(sequence)g(of)
+h(c)m(haracters)g(\(including)c(zero)k(c)m(haracters\),)h(`?')40
+b(matc)m(hes)120 4885 y(an)m(y)45 b(single)e(c)m(haracter,)50
+b(and)44 b(`#')h(matc)m(hes)g(an)m(y)g(consecutiv)m(e)h(string)d(of)i
+(decimal)f(digits)f(\(0-9\).)85 b(If)120 4998 y(more)27
+b(than)g(one)g(column)f(name)h(in)f(the)h(table)g(matc)m(hes)h(the)f
+(template)g(string,)g(then)g(the)g(\014rst)f(matc)m(h)i(is)120
+5111 y(returned)22 b(and)h(the)h(status)f(v)-5 b(alue)23
+b(will)e(b)s(e)i(set)h(to)g Fc(COL)p 1962 5111 V 33 w(NOT)p
+2139 5111 V 34 w(UNIQUE)e Fg(as)h(a)h(w)m(arning)e(that)i(a)g(unique)d
+(matc)m(h)120 5224 y(w)m(as)34 b(not)g(found.)50 b(T)-8
+b(o)35 b(\014nd)d(the)i(next)g(column)f(that)i(matc)m(hes)g(the)f
+(template,)h(call)f(this)e(routine)h(again)120 5337 y(lea)m(ving)d(the)
+h(input)d(status)j(v)-5 b(alue)30 b(equal)g(to)h Fc(COL)p
+1832 5337 V 33 w(NOT)p 2009 5337 V 34 w(UNIQUE)p Fg(.)e(Rep)s(eat)i
+(this)e(pro)s(cess)h(un)m(til)f Fc(status)46 b(=)120
+5450 y(COL)p 270 5450 V 34 w(NOT)p 448 5450 V 33 w(FOUND)29
+b Fg(is)g(returned.)1905 5809 y(13)p eop
+%%Page: 14 14
+14 13 bop 120 573 a Fc(________________________)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)o(___)o(____)o(__)120
+686 y(int)47 b(fits_get_coltype\(fitsfil)o(e)42 b(*fptr,)k(int)h
+(colnum,)f(int)h(*typecode,)1122 799 y(long)g(*repeat,)e(long)i
+(*width,)f(int)h(*status\))261 1011 y Fg(Return)41 b(the)h(datat)m(yp)s
+(e,)k(v)m(ector)d(rep)s(eat)f(coun)m(t,)j(and)c(the)h(width)e(in)g(b)m
+(ytes)i(of)g(a)g(single)f(column)120 1124 y(elemen)m(t)i(for)e(column)g
+(n)m(um)m(b)s(er)g Fc(colnum)p Fg(.)74 b(Allo)m(w)m(ed)42
+b(v)-5 b(alues)41 b(for)h(the)g(returned)f(datat)m(yp)s(e)i(in)e(ASCI)s
+(I)120 1237 y(tables)30 b(are:)42 b Fc(TSTRING,)j(TSHORT,)h(TLONG,)g
+(TFLOAT,)g(and)h(TDOUBLE)p Fg(.)29 b(Binary)h(tables)g(supp)s(ort)f
+(these)120 1350 y(additional)19 b(t)m(yp)s(es:)36 b Fc(TLOGICAL,)45
+b(TBIT,)h(TBYTE,)g(TINT32BIT,)f(TCOMPLEX)h(and)h(TDBLCOMPLEX)p
+Fg(.)18 b(The)120 1463 y(negativ)m(e)34 b(of)f(the)h(datat)m(yp)s(e)g
+(co)s(de)f(v)-5 b(alue)32 b(is)h(returned)e(if)h(it)h(is)f(a)h(v)-5
+b(ariable)32 b(length)h(arra)m(y)g(column.)48 b(The)120
+1576 y(rep)s(eat)31 b(coun)m(t)g(is)e(alw)m(a)m(ys)i(1)g(in)e(ASCI)s(I)
+g(tables.)261 1689 y(The)39 b('rep)s(eat')g(parameter)h(returns)e(the)h
+(v)m(ector)h(rep)s(eat)g(coun)m(t)f(on)g(the)g(binary)f(table)g(TF)m
+(ORMn)120 1802 y(k)m(eyw)m(ord)44 b(v)-5 b(alue.)78 b(\(ASCI)s(I)42
+b(table)h(columns)f(alw)m(a)m(ys)i(ha)m(v)m(e)g(rep)s(eat)g(=)e(1\).)80
+b(The)43 b('width')f(parameter)120 1914 y(returns)d(the)i(width)e(in)h
+(b)m(ytes)h(of)g(a)g(single)e(column)h(elemen)m(t)h(\(e.g.,)k(a)c
+('10D')i(binary)c(table)i(column)120 2027 y(will)c(ha)m(v)m(e)42
+b(width)c(=)i(8,)j(an)d(ASCI)s(I)e(table)i('F12.2')j(column)c(will)e
+(ha)m(v)m(e)42 b(width)c(=)i(12,)j(and)d(a)g(binary)120
+2140 y(table'60A')26 b(c)m(haracter)h(string)c(column)h(will)e(ha)m(v)m
+(e)k(width)d(=)h(60\);)k(Note)f(that)e(this)f(routine)f(supp)s(orts)g
+(the)120 2253 y(lo)s(cal)31 b(con)m(v)m(en)m(tion)j(for)e(sp)s
+(ecifying)e(arra)m(ys)i(of)h(\014xed)e(length)h(strings)f(within)f(a)i
+(binary)f(table)h(c)m(haracter)120 2366 y(column)37 b(using)f(the)j
+(syn)m(tax)f(TF)m(ORM)h(=)e('rAw')h(where)g('r')g(is)f(the)h(total)h(n)
+m(um)m(b)s(er)e(of)h(c)m(haracters)h(\(=)120 2479 y(the)d(width)d(of)j
+(the)f(column\))g(and)f('w')i(is)e(the)i(width)d(of)j(a)f(unit)f
+(string)g(within)f(the)j(column.)54 b(Th)m(us)34 b(if)120
+2592 y(the)i(column)f(has)h(TF)m(ORM)g(=)g('60A12')j(then)c(this)g
+(means)h(that)h(eac)m(h)g(ro)m(w)f(of)h(the)f(table)g(con)m(tains)g(5)
+120 2705 y(12-c)m(haracter)h(substrings)31 b(within)h(the)i(60-c)m
+(haracter)j(\014eld,)d(and)f(th)m(us)h(in)e(this)h(case)i(this)e
+(routine)g(will)120 2818 y(return)25 b(t)m(yp)s(eco)s(de)i(=)f
+(TSTRING,)f(rep)s(eat)i(=)e(60,)k(and)c(width)g(=)h(12.)40
+b(The)25 b(n)m(um)m(b)s(er)g(of)i(substings)d(in)h(an)m(y)120
+2931 y(binary)31 b(table)h(c)m(haracter)i(string)e(\014eld)f(can)i(b)s
+(e)f(calculated)h(b)m(y)f(\(rep)s(eat/width\).)47 b(A)33
+b(n)m(ull)d(p)s(oin)m(ter)i(ma)m(y)120 3044 y(b)s(e)e(giv)m(en)g(for)g
+(an)m(y)h(of)g(the)f(output)g(parameters)h(that)g(are)f(not)h(needed.)
+120 3256 y Fc(________________________)o(____)o(____)o(___)o(____)o
+(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)120
+3369 y(int)47 b(fits_insert_rows\(fitsfil)o(e)42 b(*fptr,)k(long)h
+(firstrow,)e(long)h(nrows,)h(int)f(*status\))120 3482
+y(int)h(fits_delete_rows\(fitsfil)o(e)42 b(*fptr,)k(long)h(firstrow,)e
+(long)h(nrows,)h(int)f(*status\))120 3595 y(int)h
+(fits_delete_rowrange\(fit)o(sfil)o(e)42 b(*fptr,)k(char)g(*rangelist,)
+f(int)i(*status\))120 3708 y(int)g(fits_delete_rowlist\(fits)o(file)41
+b(*fptr,)46 b(long)h(*rowlist,)e(long)i(nrows,)f(int)h(*stat\))261
+3920 y Fg(Insert)33 b(or)g(delete)g(ro)m(ws)g(in)e(a)j(table.)48
+b(The)33 b(blank)e(ro)m(ws)i(are)h(inserted)d(immediately)h(follo)m
+(wing)f(ro)m(w)120 4033 y Fc(frow)p Fg(.)54 b(Set)35
+b Fc(frow)f Fg(=)g(0)i(to)f(insert)f(ro)m(ws)h(at)h(the)f(b)s(eginning)
+e(of)i(the)g(table.)55 b(The)34 b(\014rst)h('delete')g(routine)120
+4146 y(deletes)k Fc(nrows)e Fg(ro)m(ws)i(b)s(eginning)d(with)i(ro)m(w)h
+Fc(firstrow)p Fg(.)64 b(The)38 b(2nd)g(delete)h(routine)f(tak)m(es)j
+(an)d(input)120 4259 y(string)26 b(listing)f(the)i(ro)m(ws)f(or)h(ro)m
+(w)g(ranges)g(to)h(b)s(e)e(deleted)h(\(e.g.,)i('2,4-7,)h(9-12'\).)42
+b(The)26 b(last)h(delete)g(routine)120 4372 y(tak)m(es)35
+b(an)f(input)d(long)i(in)m(teger)h(arra)m(y)h(that)f(sp)s(eci\014es)e
+(eac)m(h)j(individual)29 b(ro)m(w)34 b(to)g(b)s(e)f(deleted.)50
+b(The)33 b(ro)m(w)120 4485 y(lists)h(m)m(ust)h(b)s(e)f(sorted)i(in)e
+(ascending)g(order.)55 b(All)34 b(these)i(routines)e(up)s(date)g(the)i
+(v)-5 b(alue)34 b(of)i(the)f Fc(NAXIS2)120 4598 y Fg(k)m(eyw)m(ord)c
+(to)g(re\015ect)g(the)f(new)g(n)m(um)m(b)s(er)f(of)i(ro)m(ws)f(in)f
+(the)i(table.)120 4810 y Fc(________________________)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o
+(____)o(_)120 4923 y(int)47 b(fits_insert_col\(fitsfile)41
+b(*fptr,)46 b(int)h(colnum,)f(char)h(*ttype,)e(char)i(*tform,)1075
+5036 y(int)f(*status\))120 5149 y(int)h(fits_insert_cols\(fitsfil)o(e)
+42 b(*fptr,)k(int)h(colnum,)f(int)h(ncols,)f(char)g(**ttype,)1122
+5262 y(char)h(**tform,)e(int)i(*status\))120 5488 y(int)g
+(fits_delete_col\(fitsfile)41 b(*fptr,)46 b(int)h(colnum,)f(int)h
+(*status\))1905 5809 y Fg(14)p eop
+%%Page: 15 15
+15 14 bop 261 573 a Fg(Insert)25 b(or)g(delete)g(columns)f(in)f(a)j
+(table.)38 b Fc(colnum)24 b Fg(giv)m(es)h(the)g(p)s(osition)e(of)i(the)
+h(column)d(to)j(b)s(e)f(inserted)120 686 y(or)34 b(deleted)f(\(where)h
+(the)g(\014rst)f(column)g(of)h(the)g(table)g(is)e(at)j(p)s(osition)d
+(1\).)52 b Fc(ttype)32 b Fg(and)h Fc(tform)g Fg(giv)m(e)h(the)120
+799 y(column)j(name)i(and)f(column)f(format,)k(where)d(the)h(allo)m(w)m
+(ed)g(format)f(co)s(des)h(are)g(listed)e(ab)s(o)m(v)m(e)j(in)d(the)120
+912 y(description)43 b(of)i(the)h Fc(fits)p 1088 912
+29 4 v 33 w(create)p 1409 912 V 33 w(table)d Fg(routine.)84
+b(The)45 b(2nd)f('insert')h(routine)f(inserts)g(m)m(ultiple)120
+1024 y(columns,)32 b(where)h Fc(ncols)e Fg(is)h(the)h(n)m(um)m(b)s(er)e
+(of)i(columns)f(to)h(insert,)g(and)f Fc(ttype)f Fg(and)h
+Fc(tform)g Fg(are)h(arra)m(ys)120 1137 y(of)e(string)e(p)s(oin)m(ters)g
+(in)g(this)g(case.)120 1312 y Fc(________________________)o(____)o
+(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)o
+(___)120 1425 y(int)47 b(fits_copy_col\(fitsfile)42 b(*infptr,)j
+(fitsfile)h(*outfptr,)f(int)i(incolnum,)502 1537 y(int)g(outcolnum,)e
+(int)i(create_col,)d(int)j(*status\);)261 1712 y Fg(Cop)m(y)31
+b(a)g(column)f(from)g(one)i(table)e(HDU)i(to)g(another.)42
+b(If)31 b Fc(create)p 2609 1712 V 32 w(col)f Fg(=)h(TR)m(UE)g(\(i.e.,)h
+(not)f(equal)120 1825 y(to)42 b(zero\),)k(then)41 b(a)h(new)f(column)f
+(will)f(b)s(e)i(inserted)f(in)h(the)g(output)g(table)h(at)g(p)s
+(osition)e Fc(outcolumn)p Fg(,)120 1937 y(otherwise)30
+b(the)g(v)-5 b(alues)30 b(in)f(the)i(existing)e(output)h(column)f(will)
+f(b)s(e)i(o)m(v)m(erwritten.)120 2112 y Fc(________________________)o
+(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o
+(____)o(___)o(____)o(__)120 2225 y(int)47 b(fits_write_col\(fitsfile)41
+b(*fptr,)46 b(int)h(datatype,)f(int)h(colnum,)e(long)i(firstrow,)979
+2337 y(long)g(firstelem,)e(long)h(nelements,)f(void)i(*array,)f(int)h
+(*status\))120 2450 y(int)g(fits_write_colnull\(fitsf)o(ile)41
+b(*fptr,)46 b(int)h(datatype,)f(int)g(colnum,)979 2563
+y(long)h(firstrow,)e(long)i(firstelem,)e(long)h(nelements,)979
+2676 y(void)h(*array,)f(void)g(*nulval,)g(int)h(*status\))120
+2789 y(int)g(fits_write_col_null\(fits)o(file)41 b(*fptr,)46
+b(int)h(colnum,)f(long)g(firstrow,)979 2902 y(long)h(firstelem,)e(long)
+h(nelements,)f(int)i(*status\))120 3128 y(int)g
+(fits_read_col\(fitsfile)42 b(*fptr,)k(int)h(datatype,)e(int)i(colnum,)
+f(long)g(firstrow,)454 3241 y(long)h(firstelem,)e(long)h(nelements,)f
+(void)i(*nulval,)f(void)g(*array,)454 3354 y(int)h(*anynul,)f(int)g
+(*status\))261 3641 y Fg(W)-8 b(rite)44 b(or)f(read)g(elemen)m(ts)h(in)
+e(column)g(n)m(um)m(b)s(er)g Fc(colnum)p Fg(,)j(starting)e(with)f(ro)m
+(w)h Fc(firstsrow)e Fg(and)120 3754 y(elemen)m(t)33 b
+Fc(firstelem)d Fg(\(if)i(it)g(is)g(a)h(v)m(ector)h(column\).)46
+b Fc(firstelem)30 b Fg(is)i(ignored)g(if)f(it)h(is)g(a)h(scalar)f
+(column.)120 3867 y(The)d Fc(nelements)f Fg(n)m(um)m(b)s(er)g(of)i
+(elemen)m(ts)h(are)f(read)g(or)f(written)g(con)m(tin)m(uing)g(on)h
+(successiv)m(e)g(ro)m(ws)g(of)g(the)120 3980 y(table)36
+b(if)f(necessary)-8 b(.)59 b Fc(array)35 b Fg(is)g(the)i(address)e(of)h
+(an)g(arra)m(y)h(whic)m(h)e(either)h(con)m(tains)g(the)h(v)-5
+b(alues)35 b(to)i(b)s(e)120 4092 y(written,)27 b(or)f(will)e(hold)i
+(the)g(returned)g(v)-5 b(alues)26 b(that)h(are)g(read.)39
+b(When)27 b(reading,)g Fc(array)e Fg(m)m(ust)h(ha)m(v)m(e)i(b)s(een)120
+4205 y(allo)s(cated)i(large)h(enough)f(to)h(hold)e(all)g(the)i
+(returned)e(v)-5 b(alues.)261 4318 y(There)40 b(are)h(3)h(di\013eren)m
+(t)e('write')g(column)g(routines:)60 b(The)40 b(\014rst)g(simply)e
+(writes)i(the)h(input)e(arra)m(y)120 4431 y(in)m(to)32
+b(the)g(column.)43 b(The)31 b(second)h(is)f(similar,)e(except)k(that)f
+(it)f(substitutes)g(the)h(appropriate)e(n)m(ull)g(pixel)120
+4544 y(v)-5 b(alue)35 b(in)e(the)j(column)d(for)i(an)m(y)h(input)d
+(arra)m(y)i(v)-5 b(alues)35 b(whic)m(h)f(are)h(equal)g(to)h
+Fc(*nulval)d Fg(\(note)j(that)f(this)120 4657 y(parameter)k(giv)m(es)f
+(the)h(address)e(of)i(the)f(n)m(ull)e(pixel)h(v)-5 b(alue,)40
+b(not)e(the)h(v)-5 b(alue)37 b(itself)7 b(\).)64 b(The)38
+b(third)e(write)120 4770 y(routine)27 b(sets)h(the)g(sp)s(eci\014ed)e
+(table)i(elemen)m(ts)g(to)h(a)f(n)m(ull)e(v)-5 b(alue.)39
+b(New)28 b(ro)m(ws)g(will)d(b)s(e)j(automatical)g(added)120
+4883 y(to)j(the)g(table)f(if)f(the)i(write)e(op)s(eration)h(extends)h
+(b)s(ey)m(ond)e(the)i(curren)m(t)f(size)g(of)h(the)f(table.)261
+4996 y(When)42 b(reading)f(a)i(column,)h(CFITSIO)c(will)g(substitute)h
+(the)h(v)-5 b(alue)42 b(giv)m(en)g(b)m(y)g Fc(nulval)e
+Fg(for)i(an)m(y)120 5109 y(unde\014ned)25 b(elemen)m(ts)i(in)f(the)h
+(FITS)f(column,)h(unless)e Fc(nulval)g Fg(or)i Fc(*nulval)46
+b(=)h(NULL)p Fg(,)26 b(in)g(whic)m(h)f(case)j(no)120
+5222 y(c)m(hec)m(ks)k(will)c(b)s(e)h(made)i(for)f(unde\014ned)e(v)-5
+b(alues)30 b(when)f(reading)h(the)g(column.)261 5334
+y Fc(datatype)i Fg(sp)s(eci\014es)h(the)h(datat)m(yp)s(e)h(of)g(the)f
+(C)g Fc(array)e Fg(in)h(the)h(program,)i(whic)m(h)c(need)i(not)h(b)s(e)
+e(the)120 5447 y(same)42 b(as)f(the)g(in)m(trinsic)e(datat)m(yp)s(e)j
+(of)f(the)h(column)e(in)g(the)h(FITS)g(table.)73 b(The)40
+b(follo)m(wing)g(sym)m(b)s(olic)120 5560 y(constan)m(ts)32
+b(are)e(allo)m(w)m(ed)h(for)f(the)g(v)-5 b(alue)30 b(of)h
+Fc(datatype)p Fg(:)1905 5809 y(15)p eop
+%%Page: 16 16
+16 15 bop 215 573 a Fc(TSTRING)142 b(array)46 b(of)h(character)f
+(string)g(pointers)215 686 y(TBYTE)238 b(unsigned)45
+b(char)215 799 y(TSHORT)190 b(signed)46 b(short)215 912
+y(TUSHORT)142 b(unsigned)45 b(short)215 1024 y(TINT)286
+b(signed)46 b(int)215 1137 y(TUINT)238 b(unsigned)45
+b(int)215 1250 y(TLONG)238 b(signed)46 b(long)215 1363
+y(TULONG)190 b(unsigned)45 b(long)215 1476 y(TFLOAT)190
+b(float)215 1589 y(TDOUBLE)142 b(double)261 1791 y Fg(Note)35
+b(that)e Fc(TSTRING)f Fg(corresp)s(onds)g(to)h(the)h(C)f
+Fc(char**)e Fg(datat)m(yp)s(e,)k(i.e.,)g(a)e(p)s(oin)m(ter)f(to)i(an)f
+(arra)m(y)h(of)120 1904 y(p)s(oin)m(ters)29 b(to)i(an)g(arra)m(y)f(of)h
+(c)m(haracters.)261 2017 y(An)m(y)38 b(column,)i(regardless)d(of)i
+(it's)f(in)m(trinsic)d(datat)m(yp)s(e,)42 b(ma)m(y)d(b)s(e)e(read)h(as)
+h(a)f Fc(TSTRING)f Fg(c)m(haracter)120 2130 y(string.)h(The)24
+b(displa)m(y)g(format)h(of)g(the)h(returned)e(strings)f(will)g(b)s(e)h
+(determined)g(b)m(y)h(the)g Fc(TDISPn)f Fg(k)m(eyw)m(ord,)120
+2243 y(if)i(it)h(exists,)h(otherwise)f(a)g(default)g(format)h(will)c(b)
+s(e)j(used)f(dep)s(ending)f(on)j(the)f(datat)m(yp)s(e)h(of)g(the)f
+(column.)120 2356 y(The)22 b Fc(tablist)e Fg(example)i(utilit)m(y)f
+(program)h(\(a)m(v)-5 b(ailable)22 b(from)g(the)h(CFITSIO)e(w)m(eb)h
+(site\))h(uses)f(this)f(feature)120 2469 y(to)31 b(displa)m(y)e(all)g
+(the)i(v)-5 b(alues)29 b(in)g(a)i(FITS)f(table.)120 2671
+y Fc(________________________)o(____)o(____)o(___)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)o(___)o(_)120 2784 y(int)47
+b(fits_select_rows\(fitsfil)o(e)42 b(*infptr,)j(fitsfile)h(*outfptr,)f
+(char)i(*expr,)1122 2897 y(int)g(*status\))120 3010 y(int)g
+(fits_calculator\(fitsfile)41 b(*infptr,)46 b(char)g(*expr,)g(fitsfile)
+g(*outfptr,)1075 3123 y(char)g(*colname,)f(char)i(*tform,)f(int)h
+(*status\))261 3325 y Fg(These)26 b(are)h(2)g(of)g(the)f(most)h(p)s(o)m
+(w)m(erful)e(routines)h(in)f(the)i(CFITSIO)d(library)-8
+b(.)38 b(\(See)27 b(the)g(full)d(CFITSIO)120 3438 y(Reference)37
+b(Guide)e(for)h(a)h(description)d(of)i(sev)m(eral)h(related)f
+(routines\).)57 b(These)36 b(routines)f(can)i(p)s(erform)120
+3551 y(complicated)45 b(transformations)g(on)g(tables)g(based)g(on)g
+(an)g(input)f(arithmetic)g(expression)g(whic)m(h)g(is)120
+3664 y(ev)-5 b(aluated)37 b(for)f(eac)m(h)h(ro)m(w)g(of)g(the)f(table.)
+59 b(The)36 b(\014rst)g(routine)f(will)f(select)j(or)g(cop)m(y)g(ro)m
+(ws)f(of)h(the)f(table)120 3777 y(for)i(whic)m(h)f(the)h(expression)f
+(ev)-5 b(aluates)39 b(to)g(TR)m(UE)g(\(i.e.,)h(not)f(equal)f(to)h
+(zero\).)65 b(The)38 b(second)g(routine)120 3890 y(writes)c(the)h(v)-5
+b(alue)34 b(of)h(the)g(expression)f(to)i(a)f(column)f(in)f(the)i
+(output)g(table.)54 b(Rather)35 b(than)g(supplying)120
+4003 y(the)j(expression)e(directly)g(to)i(these)g(routines,)h(the)e
+(expression)g(ma)m(y)h(also)f(b)s(e)g(written)g(to)h(a)g(text)g(\014le)
+120 4116 y(\(con)m(tin)m(ued)e(o)m(v)m(er)g(m)m(ultiple)e(lines)f(if)i
+(necessary\))h(and)f(the)h(name)f(of)h(the)g(\014le,)g(prep)s(ended)d
+(with)h(a)i('@')120 4229 y(c)m(haracter,)c(ma)m(y)f(b)s(e)f(supplied)d
+(as)k(the)f(v)-5 b(alue)30 b(of)h(the)f('expr')g(parameter)h(\(e.g.)42
+b('@\014lename.txt'\).)261 4342 y(The)26 b(arithmetic)f(expression)g
+(ma)m(y)i(b)s(e)f(a)g(function)f(of)h(an)m(y)h(column)e(or)h(k)m(eyw)m
+(ord)h(in)e(the)h(input)e(table)120 4455 y(as)31 b(sho)m(wn)e(in)g
+(these)i(examples:)120 4657 y Fc(Row)47 b(Selection)e(Expressions:)263
+4770 y(counts)h(>)i(0)1240 b(uses)47 b(COUNTS)f(column)g(value)263
+4883 y(sqrt\()h(X**2)f(+)i(Y**2\))e(<)h(10.)572 b(uses)47
+b(X)g(and)g(Y)h(column)e(values)263 4996 y(\(X)h(>)h(10\))f(||)g(\(X)g
+(<)h(-10\))e(&&)h(\(Y)h(==)f(0\))142 b(used)47 b('or')g(and)g('and')f
+(operators)263 5109 y(gtifilter\(\))1190 b(filter)46
+b(on)i(Good)e(Time)h(Intervals)263 5222 y(regfilter\("myregion.reg"\))
+518 b(filter)46 b(using)h(a)g(region)f(file)263 5334
+y(@select.txt)1190 b(reads)47 b(expression)e(from)h(a)i(text)e(file)120
+5447 y(Calculator)f(Expressions:)263 5560 y(#row)i(\045)g(10)1145
+b(modulus)46 b(of)h(the)g(row)g(number)1905 5809 y Fg(16)p
+eop
+%%Page: 17 17
+17 16 bop 263 573 a Fc(counts/#exposure)807 b(Fn)47 b(of)h(COUNTS)e
+(column)g(and)h(EXPOSURE)e(keyword)263 686 y(dec)i(<)h(85)f(?)g
+(cos\(dec)f(*)h(#deg\))g(:)g(0)143 b(Conditional)45 b(expression:)g
+(evaluates)g(to)1934 799 y(cos\(dec\))g(if)i(dec)g(<)h(85,)f(else)f(0)
+263 912 y(\(count{-1}+count+count{+1)o(}\)/3)o(.)137
+b(running)46 b(mean)h(of)g(the)g(count)f(values)g(in)h(the)1934
+1024 y(previous,)e(current,)g(and)i(next)g(rows)263 1137
+y(max\(0,)f(min\(X,)g(1000\)\))619 b(returns)46 b(a)h(value)g(between)f
+(0)h(-)h(1000)263 1250 y(@calc.txt)1143 b(reads)47 b(expression)e(from)
+h(a)i(text)e(file)261 1463 y Fg(Most)40 b(standard)d(mathematical)i(op)
+s(erators)g(and)f(functions)f(are)i(supp)s(orted.)64
+b(If)38 b(the)h(expression)120 1576 y(includes)32 b(the)j(name)f(of)h
+(a)f(column,)h(than)f(the)h(v)-5 b(alue)34 b(in)f(the)h(curren)m(t)h
+(ro)m(w)f(of)h(the)f(table)h(will)c(b)s(e)j(used)120
+1689 y(when)f(ev)-5 b(aluating)33 b(the)h(expression)f(on)h(eac)m(h)h
+(ro)m(w.)51 b(An)34 b(o\013set)h(to)g(an)e(adjacen)m(t)j(ro)m(w)e(can)g
+(b)s(e)f(sp)s(eci\014ed)120 1802 y(b)m(y)d(including)d(the)j(o\013set)h
+(v)-5 b(alue)29 b(in)g(curly)g(brac)m(k)m(ets)i(after)g(the)f(column)f
+(name)h(as)g(sho)m(wn)g(in)f(one)h(of)g(the)120 1914
+y(examples.)39 b(Keyw)m(ord)27 b(v)-5 b(alues)27 b(can)g(b)s(e)g
+(included)d(in)i(the)i(expression)e(b)m(y)h(preceding)f(the)i(k)m(eyw)m
+(ord)f(name)120 2027 y(with)g(a)i(`#')f(sign.)39 b(See)28
+b(Section)h(5)f(of)h(this)e(do)s(cumen)m(t)h(for)g(more)g(discussion)e
+(of)i(the)h(expression)e(syn)m(tax.)261 2140 y Fc(gtifilter)i
+Fg(is)h(a)i(sp)s(ecial)e(function)g(whic)m(h)g(tests)i(whether)f(the)h
+Fc(TIME)e Fg(column)g(v)-5 b(alue)31 b(in)f(the)h(input)120
+2253 y(table)38 b(falls)f(within)f(one)j(or)f(more)h(Go)s(o)s(d)f(Time)
+f(In)m(terv)-5 b(als.)65 b(By)39 b(default,)g(this)f(function)f(lo)s
+(oks)h(for)g(a)120 2366 y('GTI')27 b(extension)f(in)f(the)i(same)g
+(\014le)e(as)i(the)g(input)d(table.)40 b(The)26 b('GTI')g(table)h(con)m
+(tains)g Fc(START)e Fg(and)h Fc(STOP)120 2479 y Fg(columns)f(whic)m(h)h
+(de\014ne)g(the)g(range)h(of)g(eac)m(h)h(go)s(o)s(d)f(time)f(in)m(terv)
+-5 b(al.)39 b(See)27 b(section)f(5.4.3)j(for)d(more)h(details.)261
+2592 y Fc(regfilter)35 b Fg(is)h(another)h(sp)s(ecial)f(function)g
+(whic)m(h)g(selects)h(ro)m(ws)h(based)e(on)h(whether)g(the)g(spatial)
+120 2705 y(p)s(osition)21 b(asso)s(ciated)j(with)e(eac)m(h)j(ro)m(w)e
+(is)f(lo)s(cated)i(within)d(in)h(a)h(sp)s(eci\014ed)f(region)h(of)g
+(the)h(sky)-8 b(.)38 b(By)24 b(default,)120 2818 y(the)35
+b Fc(X)g Fg(and)f Fc(Y)h Fg(columns)f(in)g(the)h(input)e(table)i(are)g
+(assumed)g(to)h(giv)m(e)f(the)g(p)s(osition)e(of)j(eac)m(h)g(ro)m(w.)55
+b(The)120 2931 y(spatial)35 b(region)g(is)f(de\014ned)h(in)f(an)h(ASCI)
+s(I)f(text)j(\014le)d(whose)i(name)f(is)g(giv)m(en)g(as)h(the)g
+(argumen)m(t)g(to)g(the)120 3044 y Fc(regfilter)28 b
+Fg(function.)39 b(See)31 b(section)f(5.4.4)j(for)d(more)g(details.)261
+3156 y(The)e Fc(infptr)e Fg(and)i Fc(outfptr)e Fg(parameters)j(in)e
+(these)h(routines)f(ma)m(y)i(p)s(oin)m(t)e(to)i(the)g(same)f(table)g
+(or)h(to)120 3269 y(di\013eren)m(t)h(tables.)42 b(In)31
+b Fc(fits)p 1092 3269 29 4 v 33 w(select)p 1413 3269
+V 33 w(rows)p Fg(,)f(if)f(the)j(input)c(and)j(output)f(tables)h(are)g
+(the)g(same)h(then)e(the)120 3382 y(ro)m(ws)e(that)h(do)f(not)g
+(satisfy)g(the)g(selection)g(expression)f(will)e(b)s(e)i(deleted)h
+(from)g(the)g(table.)40 b(Otherwise,)27 b(if)120 3495
+y(the)k(output)g(table)g(is)f(di\013eren)m(t)h(from)g(the)g(input)e
+(table)i(then)g(the)g(selected)h(ro)m(ws)f(will)e(b)s(e)h(copied)h
+(from)120 3608 y(the)g(input)d(table)i(to)h(the)g(output)f(table.)261
+3721 y(The)i(output)g(column)f(in)g Fc(fits)p 1376 3721
+V 33 w(calculator)f Fg(ma)m(y)i(or)h(ma)m(y)g(not)f(already)g(exist.)46
+b(If)32 b(it)g(exists)g(then)120 3834 y(the)44 b(calculated)f(v)-5
+b(alues)43 b(will)e(b)s(e)i(written)g(to)h(that)h(column,)h(o)m(v)m
+(erwriting)d(the)g(existing)g(v)-5 b(alues.)80 b(If)120
+3947 y(the)36 b(column)f(do)s(esn't)h(exist)f(then)h(the)g(new)g
+(column)e(will)g(b)s(e)h(app)s(ended)f(to)j(the)f(output)g(table.)57
+b(The)120 4060 y Fc(tform)37 b Fg(parameter)i(can)f(b)s(e)g(used)g(to)h
+(sp)s(ecify)e(the)h(datat)m(yp)s(e)i(of)e(the)h(new)f(column)f(\(e.g.,)
+42 b(the)d Fc(TFORM)120 4173 y Fg(k)m(eyw)m(ord)26 b(v)-5
+b(alue)25 b(as)h(in)f Fc('1E',)46 b(or)h('1J')p Fg(\).)25
+b(If)h Fc(tform)e Fg(=)h(NULL)h(then)f(a)h(default)f(datat)m(yp)s(e)i
+(will)c(b)s(e)i(used,)120 4286 y(dep)s(ending)j(on)i(the)h(expression.)
+120 4498 y Fc(________________________)o(____)o(____)o(___)o(____)o
+(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o(_)120
+4611 y(int)47 b(fits_read_tblbytes\(fitsf)o(ile)41 b(*fptr,)46
+b(long)h(firstrow,)e(long)i(firstchar,)1122 4724 y(long)g(nchars,)f
+(unsigned)f(char)i(*array,)f(int)h(*status\))120 4837
+y(int)g(fits_write_tblbytes)42 b(\(fitsfile)k(*fptr,)g(long)g
+(firstrow,)g(long)g(firstchar,)1122 4950 y(long)h(nchars,)f(unsigned)f
+(char)i(*array,)f(int)h(*status\))261 5162 y Fg(These)35
+b(2)g(routines)e(pro)m(vide)h(lo)m(w-lev)m(el)h(access)h(to)f(tables)g
+(and)f(are)h(mainly)e(useful)g(as)i(an)g(e\016cien)m(t)120
+5275 y(w)m(a)m(y)i(to)g(cop)m(y)g(ro)m(ws)f(of)g(a)h(table)f(from)g
+(one)g(\014le)f(to)i(another.)58 b(These)36 b(routines)f(simply)f(read)
+i(or)g(write)120 5388 y(the)30 b(sp)s(eci\014ed)f(n)m(um)m(b)s(er)g(of)
+h(consecutiv)m(e)i(c)m(haracters)f(\(b)m(ytes\))h(in)d(a)i(table,)f
+(without)f(regard)h(for)h(column)120 5501 y(b)s(oundaries.)83
+b(F)-8 b(or)47 b(example,)i(to)d(read)f(or)h(write)e(the)i(\014rst)f
+(ro)m(w)g(of)h(a)g(table,)j(set)d Fc(firstrow)g(=)h(1,)1905
+5809 y Fg(17)p eop
+%%Page: 18 18
+18 17 bop 120 573 a Fc(firstchar)45 b(=)j(1)p Fg(,)38
+b(and)e Fc(nchars)46 b(=)i(NAXIS1)35 b Fg(where)h(the)h(length)f(of)h
+(a)h(ro)m(w)f(is)e(giv)m(en)i(b)m(y)g(the)g(v)-5 b(alue)36
+b(of)120 686 y(the)31 b Fc(NAXIS1)f Fg(header)h(k)m(eyw)m(ord.)43
+b(When)31 b(reading)g(a)g(table,)h Fc(array)e Fg(m)m(ust)h(ha)m(v)m(e)h
+(b)s(een)f(declared)f(at)i(least)120 799 y Fc(nchars)d
+Fg(b)m(ytes)i(long)f(to)h(hold)e(the)h(returned)f(string)h(of)g(b)m
+(ytes.)1905 5809 y(18)p eop
+%%Page: 19 19
+19 18 bop 120 573 a Fb(4.6)112 b(Header)38 b(Keyw)m(ord)f(I/O)h
+(Routines)120 744 y Fg(The)30 b(follo)m(wing)f(routines)g(read)h(and)g
+(write)g(header)g(k)m(eyw)m(ords)g(in)g(the)g(curren)m(t)g(HDU.)120
+957 y Fc(________________________)o(____)o(____)o(___)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(____)o(___)120 1070
+y(int)47 b(fits_get_hdrspace\(fitsfi)o(le)42 b(*fptr,)k(int)h
+(*keysexist,)d(int)j(*morekeys,)1170 1183 y(int)g(*status\))120
+1395 y Fg(Return)36 b(the)g(n)m(um)m(b)s(er)f(of)i(existing)e(k)m(eyw)m
+(ords)i(\(not)g(coun)m(ting)f(the)h(mandatory)f(END)h(k)m(eyw)m(ord\))g
+(and)120 1508 y(the)29 b(amoun)m(t)h(of)f(empt)m(y)h(space)g(curren)m
+(tly)e(a)m(v)-5 b(ailable)28 b(for)h(more)h(k)m(eyw)m(ords.)40
+b(The)29 b Fc(morekeys)e Fg(parameter)120 1621 y(ma)m(y)k(b)s(e)f(set)h
+(to)g(NULL)f(if)f(it's)h(v)-5 b(alue)30 b(is)g(not)g(needed.)120
+1834 y Fc(________________________)o(____)o(____)o(___)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o(___)120
+1947 y(int)47 b(fits_read_record\(fitsfil)o(e)42 b(*fptr,)k(int)h
+(keynum,)f(char)g(*record,)g(int)h(*status\))120 2060
+y(int)g(fits_read_card\(fitsfile)41 b(*fptr,)46 b(char)h(*keyname,)e
+(char)i(*record,)f(int)g(*status\))120 2172 y(int)h
+(fits_read_key\(fitsfile)42 b(*fptr,)k(int)h(datatype,)e(char)i
+(*keyname,)979 2285 y(void)g(*value,)f(char)g(*comment,)f(int)i
+(*status\))120 2511 y(int)g(fits_find_nextkey\(fitsfi)o(le)42
+b(*fptr,)k(char)g(**inclist,)f(int)i(ninc,)1170 2624
+y(char)g(**exclist,)e(int)i(nexc,)f(char)h(*card,)f(int)h(*status\))120
+2850 y(int)g(fits_read_key_unit\(fitsf)o(ile)41 b(*fptr,)46
+b(char)h(*keyname,)e(char)i(*unit,)1218 2963 y(int)g(*status\))261
+3175 y Fg(These)d(routines)g(all)f(read)h(a)h(header)f(record)g(in)f
+(the)i(curren)m(t)f(HDU.)i(The)e(\014rst)f(routine)h(reads)120
+3288 y(k)m(eyw)m(ord)c(n)m(um)m(b)s(er)f Fc(keynum)f
+Fg(\(where)i(the)g(\014rst)f(k)m(eyw)m(ord)i(is)e(at)i(p)s(osition)d
+(1\).)70 b(This)38 b(routine)h(is)g(most)120 3401 y(commonly)28
+b(used)g(when)f(sequen)m(tially)g(reading)g(ev)m(ery)j(record)e(in)f
+(the)i(header)f(from)g(b)s(eginning)e(to)j(end.)120 3514
+y(The)22 b(2nd)f(and)h(3rd)f(routines)g(read)h(the)g(named)g(k)m(eyw)m
+(ord)h(and)e(return)g(either)h(the)g(whole)f(80-b)m(yte)j(record,)120
+3627 y(or)30 b(the)h(k)m(eyw)m(ord)g(v)-5 b(alue)30 b(and)f(commen)m(t)
+j(string.)261 3740 y(Wild)25 b(card)g(c)m(haracters)j(\(*,)g(?,)f(and)e
+(#\))h(ma)m(y)h(b)s(e)e(used)g(when)g(sp)s(ecifying)f(the)i(name)h(of)f
+(the)g(k)m(eyw)m(ord)120 3853 y(to)31 b(b)s(e)f(read,)g(in)f(whic)m(h)h
+(case)h(the)g(\014rst)e(matc)m(hing)i(k)m(eyw)m(ord)f(is)g(returned.)
+261 3966 y(The)41 b Fc(datatype)e Fg(parameter)j(sp)s(eci\014es)e(the)h
+(C)g(datat)m(yp)s(e)h(of)g(the)f(returned)f(k)m(eyw)m(ord)i(v)-5
+b(alue)41 b(and)120 4079 y(can)48 b(ha)m(v)m(e)h(one)f(of)g(the)f
+(follo)m(wing)f(sym)m(b)s(olic)g(constan)m(t)j(v)-5 b(alues:)75
+b Fc(TSTRING,)46 b(TLOGICAL)f Fg(\(==)i(in)m(t\),)120
+4192 y Fc(TBYTE)p Fg(,)d Fc(TSHORT)p Fg(,)f Fc(TUSHORT)p
+Fg(,)g Fc(TINT)p Fg(,)h Fc(TUINT)p Fg(,)f Fc(TLONG)p
+Fg(,)h Fc(TULONG)p Fg(,)f Fc(TFLOAT)p Fg(,)g Fc(TDOUBLE)p
+Fg(,)g Fc(TCOMPLEX)p Fg(,)g(and)120 4304 y Fc(TDBLCOMPLEX)p
+Fg(.)e(Data)k(t)m(yp)s(e)f(con)m(v)m(ersion)g(will)d(b)s(e)i(p)s
+(erformed)f(for)i(n)m(umeric)e(v)-5 b(alues)43 b(if)g(the)h(in)m
+(trinsic)120 4417 y(FITS)32 b(k)m(eyw)m(ord)h(v)-5 b(alue)32
+b(do)s(es)g(not)g(ha)m(v)m(e)i(the)f(same)g(datat)m(yp)s(e.)48
+b(The)32 b Fc(comment)e Fg(parameter)j(ma)m(y)g(b)s(e)f(set)120
+4530 y(equal)e(to)h(NULL)f(if)g(the)g(commen)m(t)i(string)d(is)g(not)i
+(needed.)261 4643 y(The)21 b(4th)h(routine)f(pro)m(vides)g(an)h(easy)g
+(w)m(a)m(y)h(to)f(\014nd)e(all)h(the)h(k)m(eyw)m(ords)g(in)f(the)g
+(header)h(that)g(matc)m(h)h(one)120 4756 y(of)29 b(the)h(name)f
+(templates)g(in)f Fc(inclist)f Fg(and)h(do)h(not)h(matc)m(h)g(an)m(y)f
+(of)g(the)h(name)f(templates)g(in)f Fc(exclist)p Fg(.)120
+4869 y Fc(ninc)37 b Fg(and)h Fc(nexc)f Fg(are)i(the)g(n)m(um)m(b)s(er)e
+(of)h(template)h(strings)e(in)g Fc(inclist)g Fg(and)h
+Fc(exclist)p Fg(,)g(resp)s(ectiv)m(ely)-8 b(.)120 4982
+y(Wild)33 b(cards)h(\(*,)i(?,)f(and)f(#\))g(ma)m(y)h(b)s(e)f(used)f(in)
+g(the)h(templates)h(to)g(matc)m(h)g(m)m(ultiple)d(k)m(eyw)m(ords.)53
+b(Eac)m(h)120 5095 y(time)35 b(this)f(routine)g(is)g(called)g(it)g
+(returns)g(the)h(next)h(matc)m(hing)f(80-b)m(yte)h(k)m(eyw)m(ord)g
+(record.)54 b(It)36 b(returns)120 5208 y(status)31 b(=)f
+Fc(KEY)p 640 5208 29 4 v 33 w(NO)p 769 5208 V 34 w(EXIST)f
+Fg(if)g(there)i(are)g(no)f(more)g(matc)m(hes.)261 5321
+y(The)f(5th)g(routine)f(returns)g(the)i(k)m(eyw)m(ord)g(v)-5
+b(alue)28 b(units)g(string,)g(if)h(an)m(y)-8 b(.)41 b(The)28
+b(units)g(are)i(recorded)f(at)120 5434 y(the)i(b)s(eginning)c(of)k(the)
+f(k)m(eyw)m(ord)h(commen)m(t)h(\014eld)d(enclosed)h(in)f(square)h(brac)
+m(k)m(ets.)1905 5809 y(19)p eop
+%%Page: 20 20
+20 19 bop 120 573 a Fc(________________________)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)o(___)o(____)o(__)120
+686 y(int)47 b(fits_write_key\(fitsfile)41 b(*fptr,)46
+b(int)h(datatype,)f(char)g(*keyname,)502 799 y(void)g(*value,)g(char)h
+(*comment,)e(int)i(*status\))120 912 y(int)g(fits_update_key\(fitsfile)
+41 b(*fptr,)46 b(int)h(datatype,)e(char)i(*keyname,)502
+1024 y(void)f(*value,)g(char)h(*comment,)e(int)i(*status\))120
+1137 y(int)g(fits_write_record\(fitsfi)o(le)42 b(*fptr,)k(char)g
+(*card,)g(int)h(*status\))120 1363 y(int)g(fits_modify_comment\(fits)o
+(file)41 b(*fptr,)46 b(char)h(*keyname,)e(char)i(*comment,)502
+1476 y(int)g(*status\))120 1589 y(int)g(fits_write_key_unit\(fits)o
+(file)41 b(*fptr,)46 b(char)h(*keyname,)e(char)i(*unit,)502
+1702 y(int)g(*status\))261 1975 y Fg(W)-8 b(rite)31 b(or)g(mo)s(dify)f
+(a)h(k)m(eyw)m(ord)g(in)f(the)h(header)g(of)g(the)g(curren)m(t)g(HDU.)h
+(The)e(\014rst)g(routine)g(app)s(ends)120 2087 y(the)g(new)g(k)m(eyw)m
+(ord)g(to)h(the)f(end)g(of)g(the)g(header,)h(whereas)e(the)i(second)f
+(routine)f(will)e(up)s(date)j(the)g(v)-5 b(alue)120 2200
+y(and)40 b(commen)m(t)h(\014elds)e(of)i(the)g(k)m(eyw)m(ord)g(if)e(it)h
+(already)h(exists,)h(otherwise)e(it)h(b)s(eha)m(v)m(es)g(lik)m(e)e(the)
+i(\014rst)120 2313 y(routine)32 b(and)g(app)s(ends)f(the)h(new)h(k)m
+(eyw)m(ord.)48 b(Note)34 b(that)f Fc(value)e Fg(giv)m(es)i(the)g
+(address)f(to)h(the)g(v)-5 b(alue)32 b(and)120 2426 y(not)f(the)g(v)-5
+b(alue)31 b(itself.)41 b(The)31 b Fc(datatype)d Fg(parameter)k(sp)s
+(eci\014es)d(the)j(C)e(datat)m(yp)s(e)i(of)f(the)g(k)m(eyw)m(ord)h(v)-5
+b(alue)120 2539 y(and)38 b(ma)m(y)g(ha)m(v)m(e)i(an)m(y)f(of)f(the)g(v)
+-5 b(alues)38 b(listed)f(in)g(the)h(description)e(of)j(the)f(k)m(eyw)m
+(ord)h(reading)e(routines,)120 2652 y(ab)s(o)m(v)m(e.)71
+b(A)40 b(NULL)g(ma)m(y)h(b)s(e)e(en)m(tered)i(for)f(the)g(commen)m(t)h
+(parameter,)i(in)c(whic)m(h)g(case)i(the)f(k)m(eyw)m(ord)120
+2765 y(commen)m(t)31 b(\014eld)e(will)f(b)s(e)i(unmo)s(di\014ed)d(or)j
+(left)h(blank.)261 2878 y(The)25 b(third)f(routine)h(is)g(more)h
+(primitiv)m(e)e(and)h(simply)e(writes)i(the)h(80-c)m(haracter)j
+Fc(card)c Fg(record)h(to)g(the)120 2991 y(header.)40
+b(It)30 b(is)f(the)h(programmer's)f(resp)s(onsibilit)m(y)d(in)i(this)h
+(case)h(to)h(ensure)e(that)h(the)g(record)g(conforms)120
+3104 y(to)h(all)e(the)i(FITS)f(format)g(requiremen)m(ts)g(for)g(a)h
+(header)f(record.)261 3217 y(The)42 b(fourth)f(routine)g(mo)s(di\014es)
+f(the)i(commen)m(t)h(string)e(in)g(an)g(existing)g(k)m(eyw)m(ord,)46
+b(and)41 b(the)h(last)120 3329 y(routine)33 b(writes)g(or)h(up)s(dates)
+f(the)h(k)m(eyw)m(ord)h(units)d(string)h(for)h(an)g(existing)f(k)m(eyw)
+m(ord.)52 b(\(The)34 b(units)e(are)120 3442 y(recorded)e(at)h(the)g(b)s
+(eginning)d(of)i(the)h(k)m(eyw)m(ord)f(commen)m(t)i(\014eld)d(enclosed)
+h(in)f(square)h(brac)m(k)m(ets\).)120 3621 y Fc
+(________________________)o(____)o(____)o(___)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)o(__)120 3734 y(int)47
+b(fits_write_comment\(fitsf)o(ile)41 b(*fptr,)46 b(char)h(*comment,)93
+b(int)47 b(*status\))120 3847 y(int)g(fits_write_history\(fitsf)o(ile)
+41 b(*fptr,)46 b(char)h(*history,)93 b(int)47 b(*status\))120
+3960 y(int)g(fits_write_date\(fitsfile)41 b(*fptr,)94
+b(int)47 b(*status\))261 4139 y Fg(W)-8 b(rite)21 b(a)g
+Fc(COMMENT,)46 b(HISTORY)p Fg(,)18 b(or)j Fc(DATE)e Fg(k)m(eyw)m(ord)i
+(to)h(the)f(curren)m(t)f(header.)37 b(The)20 b Fc(COMMENT)f
+Fg(k)m(eyw)m(ord)120 4252 y(is)37 b(t)m(ypically)g(used)g(to)h(write)g
+(a)g(commen)m(t)h(ab)s(out)e(the)i(\014le)e(or)g(the)i(data.)64
+b(The)37 b Fc(HISTORY)f Fg(k)m(eyw)m(ord)i(is)120 4365
+y(t)m(ypically)22 b(used)f(to)j(pro)m(vide)e(information)f(ab)s(out)h
+(the)h(history)e(of)i(the)g(pro)s(cessing)e(pro)s(cedures)h(that)h(ha)m
+(v)m(e)120 4478 y(b)s(een)36 b(applied)f(to)i(the)g(data.)61
+b(The)36 b Fc(comment)f Fg(or)i Fc(history)e Fg(string)h(will)e(b)s(e)i
+(con)m(tin)m(ued)h(o)m(v)m(er)h(m)m(ultiple)120 4591
+y(k)m(eyw)m(ords)31 b(if)e(it)h(is)f(more)i(than)f(70)h(c)m(haracters)h
+(long.)261 4704 y(The)k Fc(DATE)f Fg(k)m(eyw)m(ord)i(is)e(used)h(to)h
+(record)f(the)h(date)g(and)f(time)g(that)h(the)f(FITS)g(\014le)f(w)m
+(as)i(created.)120 4817 y(Note)f(that)f(this)e(\014le)h(creation)h
+(date)g(is)f(usually)e(di\013eren)m(t)i(from)g(the)h(date)g(of)g(the)f
+(observ)-5 b(ation)35 b(whic)m(h)120 4930 y(obtained)e(the)h(data)h(in)
+d(the)j(FITS)e(\014le.)50 b(The)33 b Fc(DATE)g Fg(k)m(eyw)m(ord)h(v)-5
+b(alue)34 b(is)f(a)h(c)m(haracter)i(string)c(in)h('yyyy-)120
+5042 y(mm-ddThh:mm:ss')27 b(format.)40 b(If)29 b(a)g
+Fc(DATE)f Fg(k)m(eyw)m(ord)i(already)e(exists)h(in)f(the)h(header,)h
+(then)e(this)g(routine)120 5155 y(will)g(up)s(date)h(the)i(v)-5
+b(alue)30 b(with)f(the)h(curren)m(t)g(system)h(date.)120
+5334 y Fc(________________________)o(____)o(____)o(___)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(____)o(__)120 5447
+y(int)47 b(fits_delete_record\(fitsf)o(ile)41 b(*fptr,)46
+b(int)h(keynum,)94 b(int)47 b(*status\))120 5560 y(int)g
+(fits_delete_key\(fitsfile)41 b(*fptr,)46 b(char)h(*keyname,)93
+b(int)47 b(*status\))1905 5809 y Fg(20)p eop
+%%Page: 21 21
+21 20 bop 261 573 a Fg(Delete)32 b(a)f(k)m(eyw)m(ord)h(record.)42
+b(The)30 b(\014rst)g(routine)g(deletes)h(a)g(k)m(eyw)m(ord)h(at)f(a)h
+(sp)s(eci\014ed)d(p)s(osition)g(\(the)120 686 y(\014rst)e(k)m(eyw)m
+(ord)h(is)e(at)i(p)s(osition)e(1,)j(not)e(0\),)i(whereas)f(the)f
+(second)h(routine)e(deletes)i(the)g(named)f(k)m(eyw)m(ord.)120
+898 y Fc(________________________)o(____)o(____)o(___)o(____)o(____)o
+(___)o(____)o(____)o(___)o(____)o(____)o(___)o(___)120
+1011 y(int)47 b(fits_copy_header\(fitsfil)o(e)42 b(*infptr,)j(fitsfile)
+h(*outfptr,)93 b(int)47 b(*status\))261 1224 y Fg(Cop)m(y)26
+b(all)f(the)h(header)g(k)m(eyw)m(ords)h(from)e(the)i(curren)m(t)e(HDU)i
+(asso)s(ciated)g(with)d(infptr)g(to)j(the)g(curren)m(t)120
+1337 y(HDU)h(asso)s(ciated)f(with)e(outfptr.)39 b(If)27
+b(the)g(curren)m(t)f(output)h(HDU)g(is)f(not)h(empt)m(y)-8
+b(,)29 b(then)d(a)h(new)f(HDU)i(will)120 1450 y(b)s(e)34
+b(app)s(ended)f(to)j(the)f(output)f(\014le.)53 b(The)35
+b(output)f(HDU)i(will)c(then)i(ha)m(v)m(e)i(the)f(iden)m(tical)f
+(structure)g(as)120 1562 y(the)d(input)d(HDU,)j(but)f(will)e(con)m
+(tain)i(no)h(data.)1905 5809 y(21)p eop
+%%Page: 22 22
+22 21 bop 120 573 a Fb(4.7)112 b(Utilit)m(y)34 b(Routines)120
+744 y Fg(This)29 b(section)h(lists)f(the)i(most)f(imp)s(ortan)m(t)g
+(CFITSIO)f(general)h(utilit)m(y)f(routines.)120 957 y
+Fc(________________________)o(____)o(____)o(___)o(____)o(____)o(___)o
+(____)o(____)o(___)o(____)o(____)o(__)120 1070 y(int)47
+b(fits_write_chksum\()c(fitsfile)i(*fptr,)h(int)h(*status\))120
+1183 y(int)g(fits_verify_chksum\(fitsf)o(ile)41 b(*fptr,)46
+b(int)h(*dataok,)f(int)h(*hduok,)f(int)g(*status\))261
+1395 y Fg(These)35 b(routines)f(compute)h(or)g(v)-5 b(alidate)34
+b(the)i(c)m(hec)m(ksums)f(for)g(the)g(currenrt)f(HDU.)i(The)e
+Fc(DATASUM)120 1508 y Fg(k)m(eyw)m(ord)d(is)e(used)g(to)i(store)g(the)f
+(n)m(umerical)f(v)-5 b(alue)29 b(of)i(the)f(32-bit,)h(1's)f(complemen)m
+(t)g(c)m(hec)m(ksum)h(for)f(the)120 1621 y(data)25 b(unit)e(alone.)39
+b(The)24 b Fc(CHECKSUM)f Fg(k)m(eyw)m(ord)i(is)f(used)f(to)j(store)f
+(the)g(ASCI)s(I)e(enco)s(ded)h(COMPLEMENT)120 1734 y(of)32
+b(the)f(c)m(hec)m(ksum)h(for)f(the)h(en)m(tire)f(HDU.)i(Storing)d(the)i
+(complemen)m(t,)g(rather)f(than)g(the)h(actual)f(c)m(hec)m(k-)120
+1847 y(sum,)26 b(forces)g(the)g(c)m(hec)m(ksum)g(for)f(the)h(whole)f
+(HDU)h(to)g(equal)f(zero.)40 b(If)25 b(the)h(\014le)f(has)g(b)s(een)g
+(mo)s(di\014ed)e(since)120 1960 y(the)31 b(c)m(hec)m(ksums)f(w)m(ere)h
+(computed,)g(then)f(the)g(HDU)i(c)m(hec)m(ksum)f(will)c(usually)h(not)j
+(equal)f(zero.)261 2073 y(The)g(returned)g Fc(dataok)f
+Fg(and)h Fc(hduok)g Fg(parameters)h(will)d(ha)m(v)m(e)k(a)f(v)-5
+b(alue)30 b(=)h(1)g(if)f(the)h(data)g(or)g(HDU)g(is)120
+2186 y(v)m(eri\014ed)c(correctly)-8 b(,)30 b(a)e(v)-5
+b(alue)28 b(=)g(0)g(if)f(the)i Fc(DATASUM)d Fg(or)i Fc(CHECKSUM)e
+Fg(k)m(eyw)m(ord)j(is)e(not)h(presen)m(t,)h(or)f(v)-5
+b(alue)28 b(=)120 2299 y(-1)j(if)e(the)i(computed)f(c)m(hec)m(ksum)h
+(is)f(not)g(correct.)120 2511 y Fc(________________________)o(____)o
+(____)o(___)o(____)o(____)o(___)o(____)o(____)o(___)o(____)o(____)o(__)
+120 2624 y(int)47 b(fits_parse_value\(char)42 b(*card,)k(char)h
+(*value,)e(char)i(*comment,)e(int)i(*status\))120 2737
+y(int)g(fits_get_keytype\(char)42 b(*value,)k(char)g(*dtype,)g(int)h
+(*status\))120 2850 y(int)g(fits_get_keyclass\(char)42
+b(*card\))120 2963 y(int)47 b(fits_parse_template\(char)41
+b(*template,)k(char)i(*card,)f(int)h(*keytype,)e(int)i(*status\))261
+3288 y(fits)p 459 3288 29 4 v 33 w(parse)p 732 3288 V
+33 w(value)29 b Fg(parses)h(the)h(input)d(80-c)m(hararacter)33
+b(header)d(k)m(eyw)m(ord)h(record,)g(returning)d(the)120
+3401 y(v)-5 b(alue)20 b(\(as)i(a)f(literal)e(c)m(haracter)k(string\))d
+(and)g(commen)m(t)i(strings.)37 b(If)20 b(the)h(k)m(eyw)m(ord)h(has)e
+(no)h(v)-5 b(alue)20 b(\(columns)120 3514 y(9-10)38 b(not)e(equal)g(to)
+h('=)f('\),)j(then)d(a)g(n)m(ull)f(v)-5 b(alue)35 b(string)h(is)f
+(returned)g(and)h(the)g(commen)m(t)h(string)f(is)f(set)120
+3627 y(equal)30 b(to)h(column)e(9)i(-)g(80)g(of)f(the)h(input)d
+(string.)261 3740 y Fc(fits)p 459 3740 V 33 w(get)p 636
+3740 V 34 w(keytype)41 b Fg(parses)i(the)g(k)m(eyw)m(ord)h(v)-5
+b(alue)42 b(string)g(to)i(determine)e(its)h(datat)m(yp)s(e.)80
+b Fc(dtype)120 3853 y Fg(returns)34 b(with)f(a)i(v)-5
+b(alue)35 b(of)g('C',)g('L',)g('I',)h('F')f(or)g('X',)h(for)f(c)m
+(haracter)h(string,)f(logical,)h(in)m(teger,)g(\015oating)120
+3966 y(p)s(oin)m(t,)30 b(or)g(complex,)g(resp)s(ectiv)m(ely)-8
+b(.)261 4079 y Fc(fits)p 459 4079 V 33 w(get)p 636 4079
+V 34 w(keyclass)31 b Fg(returns)i(a)h(classi\014cation)e(co)s(de)i
+(that)g(indicates)f(the)h(classi\014cation)e(t)m(yp)s(e)i(of)120
+4192 y(the)41 b(input)d(k)m(eyw)m(ord)j(record)f(\(e.g.,)45
+b(a)40 b(required)f(structural)g(k)m(eyw)m(ord,)44 b(a)d(TDIM)f(k)m
+(eyw)m(ord,)k(a)c(W)m(CS)120 4304 y(k)m(eyw)m(ord,)49
+b(a)d(commen)m(t)g(k)m(eyw)m(ord,)j(etc.)85 b(See)45
+b(the)h(CFITSIO)d(Reference)j(Guide)d(for)i(a)g(list)f(of)h(the)120
+4417 y(di\013eren)m(t)30 b(classi\014cation)f(co)s(des.)261
+4530 y Fc(fits)p 459 4530 V 33 w(parse)p 732 4530 V 33
+w(template)37 b Fg(tak)m(es)j(an)e(input)f(free)h(format)h(k)m(eyw)m
+(ord)g(template)g(string)f(and)g(returns)120 4643 y(a)i(formatted)g
+(80*c)m(har)h(record)e(that)h(satis\014es)f(all)g(the)g(FITS)g
+(requiremen)m(ts)g(for)g(a)h(header)f(k)m(eyw)m(ord)120
+4756 y(record.)65 b(The)38 b(template)h(should)d(generally)i(con)m
+(tain)h(3)g(tok)m(ens:)58 b(the)38 b(k)m(eyw)m(ord)h(name,)i(the)e(k)m
+(eyw)m(ord)120 4869 y(v)-5 b(alue,)28 b(and)f(the)g(k)m(eyw)m(ord)h
+(commen)m(t)h(string.)39 b(The)27 b(returned)f Fc(keytype)g
+Fg(parameter)i(indicates)e(whether)120 4982 y(the)33
+b(k)m(eyw)m(ord)g(is)f(a)h(COMMENT)g(k)m(eyw)m(ord)g(or)g(not.)48
+b(See)33 b(the)g(CFITSIO)e(Reference)j(Guide)e(for)g(more)120
+5095 y(details.)1905 5809 y(22)p eop
+%%Page: 23 23
+23 22 bop 120 573 a Fi(5)135 b(CFITSIO)44 b(File)h(Names)h(and)f
+(Filters)120 779 y Fb(5.1)112 b(Creating)37 b(New)g(Files)120
+951 y Fg(When)43 b(creating)g(a)g(new)g(output)f(\014le)g(on)h
+(magnetic)h(disk)d(with)h Fc(fits)p 2677 951 29 4 v 33
+w(create)p 2998 951 V 33 w(file)g Fg(the)h(follo)m(wing)120
+1064 y(features)31 b(are)f(supp)s(orted.)256 1251 y Fa(\017)46
+b Fg(Ov)m(erwriting,)29 b(or)h('Clobb)s(ering')e(an)j(Existing)d(File)
+347 1402 y(If)f(the)h(\014lename)f(is)g(preceded)g(b)m(y)g(an)h
+(exclamation)g(p)s(oin)m(t)e(\(!\))41 b(then)27 b(if)g(that)h(\014le)e
+(already)i(exists)f(it)347 1514 y(will)f(b)s(e)h(deleted)h(prior)e(to)j
+(creating)f(the)g(new)g(FITS)f(\014le.)39 b(Otherwise)26
+b(if)h(there)h(is)f(an)h(existing)f(\014le)347 1627 y(with)35
+b(the)g(same)h(name,)i(CFITSIO)c(will)f(not)j(o)m(v)m(erwrite)g(the)g
+(existing)e(\014le)h(and)g(will)e(return)h(an)347 1740
+y(error)28 b(status)h(co)s(de.)40 b(Note)30 b(that)f(the)f(exclamation)
+h(p)s(oin)m(t)e(is)g(a)i(sp)s(ecial)e(UNIX)h(c)m(haracter,)j(so)e(if)e
+(it)347 1853 y(is)f(used)g(on)g(the)h(command)g(line)e(rather)h(than)g
+(en)m(tered)i(at)f(a)g(task)g(prompt,)g(it)f(m)m(ust)h(b)s(e)f
+(preceded)347 1966 y(b)m(y)j(a)h(bac)m(kslash)f(to)h(force)g(the)f
+(UNIX)h(shell)d(to)k(pass)d(it)h(v)m(erbatim)g(to)h(the)g(application)d
+(program.)256 2154 y Fa(\017)46 b Fg(Compressed)30 b(Output)f(Files)347
+2304 y(If)g(the)g(output)f(disk)g(\014le)g(name)h(ends)f(with)f(the)i
+(su\016x)f('.gz',)j(then)e(CFITSIO)e(will)f(compress)j(the)347
+2417 y(\014le)38 b(using)g(the)h(gzip)g(compression)f(algorithm)g(b)s
+(efore)g(writing)f(it)i(to)h(disk.)65 b(This)37 b(can)j(reduce)347
+2530 y(the)h(amoun)m(t)g(of)g(disk)e(space)i(used)f(b)m(y)g(the)h
+(\014le.)70 b(Note)42 b(that)f(this)f(feature)h(requires)e(that)i(the)
+347 2643 y(uncompressed)e(\014le)h(b)s(e)g(constructed)h(in)e(memory)h
+(b)s(efore)g(it)g(is)g(compressed)g(and)g(written)g(to)347
+2756 y(disk,)29 b(so)i(it)f(can)h(fail)e(if)g(there)i(is)e
+(insu\016cien)m(t)g(a)m(v)-5 b(ailable)29 b(memory)-8
+b(.)347 2906 y(One)32 b(can)h(also)g(sp)s(ecify)e(that)i(an)m(y)g
+(images)g(written)f(to)h(the)g(output)f(\014le)g(should)f(b)s(e)h
+(compressed)347 3019 y(using)22 b(the)h(newly)f(dev)m(elop)s(ed)h
+(`tile-compression')f(algorithm)g(b)m(y)h(app)s(ending)e(`[compress]')j
+(to)g(the)347 3132 y(name)36 b(of)h(the)f(disk)f(\014le)g(\(as)i(in)e
+Fc(myfile.fits[compress])p Fg(\).)52 b(Refer)36 b(to)h(the)g(CFITSIO)d
+(User's)347 3245 y(Reference)d(Guide)f(for)g(more)g(information)f(ab)s
+(out)h(this)f(new)h(image)h(compression)e(format.)256
+3432 y Fa(\017)46 b Fg(Using)30 b(a)h(T)-8 b(emplate)30
+b(to)h(Create)g(a)g(New)g(FITS)e(File)347 3583 y(The)k(structure)g(of)g
+(an)m(y)h(new)f(FITS)f(\014le)h(that)h(is)e(to)i(b)s(e)f(created)h(ma)m
+(y)g(b)s(e)f(de\014ned)f(in)g(an)h(ASCI)s(I)347 3695
+y(template)c(\014le.)39 b(If)29 b(the)f(name)h(of)g(the)f(template)h
+(\014le)f(is)g(app)s(ended)e(to)k(the)e(name)h(of)g(the)f(FITS)g
+(\014le)347 3808 y(itself,)36 b(enclosed)f(in)f(paren)m(thesis)g
+(\(e.g.,)k Fc('newfile.fits\(template.tx)o(t\)')p Fg(\))29
+b(then)35 b(CFITSIO)347 3921 y(will)28 b(create)33 b(a)e(FITS)f(\014le)
+g(with)f(that)j(structure)e(b)s(efore)h(op)s(ening)e(it)h(for)h(the)g
+(application)e(to)i(use.)347 4034 y(The)h(template)h(\014le)f
+(basically)e(de\014nes)i(the)h(dimensions)c(and)j(data)h(t)m(yp)s(e)g
+(of)g(the)f(primary)f(arra)m(y)347 4147 y(and)23 b(an)m(y)h(IMA)m(GE)g
+(extensions,)h(and)e(the)g(names)g(and)g(data)h(t)m(yp)s(es)g(of)f(the)
+h(columns)e(in)g(an)m(y)i(ASCI)s(I)347 4260 y(or)35 b(binary)f(table)h
+(extensions.)54 b(The)35 b(template)g(\014le)f(can)i(also)f(b)s(e)f
+(used)h(to)g(de\014ne)g(an)m(y)g(optional)347 4373 y(k)m(eyw)m(ords)g
+(that)g(should)d(b)s(e)i(written)f(in)h(an)m(y)g(of)h(the)f(HDU)h
+(headers.)53 b(The)34 b(image)g(pixel)f(v)-5 b(alues)347
+4486 y(and)38 b(table)h(en)m(try)f(v)-5 b(alues)38 b(are)h(all)e
+(initialized)f(to)j(zero.)66 b(The)38 b(application)f(program)h(can)h
+(then)347 4599 y(write)27 b(actual)g(data)h(in)m(to)g(the)f(HDUs.)40
+b(See)28 b(the)f(CFITSIO)f(Reference)i(Guide)e(for)h(for)g(a)h
+(complete)347 4712 y(description)h(of)h(the)h(template)g(\014le)e(syn)m
+(tax.)256 4899 y Fa(\017)46 b Fg(Creating)30 b(a)h(T)-8
+b(emp)s(orary)30 b(Scratc)m(h)h(File)e(in)g(Memory)347
+5050 y(It)38 b(is)f(sometimes)h(useful)e(to)j(create)g(a)f(temp)s
+(orary)g(output)f(\014le)g(when)g(testing)h(an)g(application)347
+5162 y(program.)45 b(If)31 b(the)h(name)g(of)g(the)g(\014le)f(to)i(b)s
+(e)e(created)i(is)e(sp)s(eci\014ed)f(as)i Fc(mem:)42
+b Fg(then)32 b(CFITSIO)e(will)347 5275 y(create)39 b(the)e(\014le)g(in)
+f(memory)h(where)f(it)h(will)e(p)s(ersist)g(only)h(un)m(til)g(the)h
+(program)g(closes)h(the)f(\014le.)347 5388 y(Use)e(of)g(this)f
+Fc(mem:)48 b Fg(output)34 b(\014le)g(usually)e(enables)i(the)h(program)
+f(to)i(run)d(faster,)j(and)e(of)h(course)347 5501 y(the)c(output)f
+(\014le)f(do)s(es)h(not)h(use)f(up)f(an)m(y)i(disk)e(space.)1905
+5809 y(23)p eop
+%%Page: 24 24
+24 23 bop 120 573 a Fb(5.2)112 b(Op)s(ening)38 b(Existing)d(Files)120
+744 y Fg(When)j(op)s(ening)e(a)j(\014le)e(with)g Fc(fits)p
+1392 744 29 4 v 33 w(open)p 1617 744 V 33 w(file)p Fg(,)i(CFITSIO)e
+(can)h(read)g(a)g(v)-5 b(ariet)m(y)39 b(of)f(di\013eren)m(t)f(input)120
+857 y(\014le)30 b(formats)h(and)g(is)f(not)h(restricted)g(to)h(only)e
+(reading)g(FITS)h(format)g(\014les)f(from)h(magnetic)g(disk.)42
+b(The)120 970 y(follo)m(wing)29 b(t)m(yp)s(es)h(of)h(input)d(\014les)i
+(are)g(all)g(supp)s(orted:)256 1183 y Fa(\017)46 b Fg(FITS)30
+b(\014les)f(compressed)h(with)f Fc(zip,)47 b(gzip)29
+b Fg(or)i Fc(compress)347 1333 y Fg(If)36 b(CFITSIO)f(cannot)i(\014nd)e
+(the)i(sp)s(eci\014ed)e(\014le)g(to)i(op)s(en)f(it)g(will)e
+(automatically)i(lo)s(ok)g(for)g(a)h(\014le)347 1446
+y(with)j(the)g(same)h(ro)s(otname)h(but)d(with)h(a)h
+Fc(.gz,)46 b(.zip)p Fg(,)d(or)d Fc(.Z)g Fg(extension.)71
+b(If)41 b(it)f(\014nds)f(suc)m(h)h(a)347 1559 y(compressed)d(\014le,)g
+(it)g(will)d(allo)s(cate)j(a)g(blo)s(c)m(k)f(of)h(memory)g(and)f
+(uncompress)f(the)i(\014le)f(in)m(to)h(that)347 1672
+y(memory)25 b(space.)39 b(The)25 b(application)e(program)h(will)f(then)
+h(transparen)m(tly)g(op)s(en)g(this)g(virtual)f(FITS)347
+1785 y(\014le)35 b(in)f(memory)-8 b(.)56 b(Compressed)35
+b(\014les)f(can)i(only)f(b)s(e)f(op)s(ened)h(with)f('readonly',)j(not)f
+('readwrite')347 1898 y(\014le)30 b(access.)256 2085
+y Fa(\017)46 b Fg(FITS)30 b(\014les)f(on)h(the)h(in)m(ternet,)f(using)f
+Fc(ftp)h Fg(or)g Fc(http)f Fg(URLs)347 2236 y(Simply)20
+b(pro)m(vide)i(the)i(full)c(URL)j(as)g(the)g(name)g(of)h(the)f(\014le)f
+(that)h(y)m(ou)h(w)m(an)m(t)f(to)h(op)s(en.)38 b(F)-8
+b(or)23 b(example,)347 2348 y Fc(ftp://legacy.gsfc.nasa.go)o(v/so)o
+(ftwa)o(re/)o(fits)o(io/c)o(/te)o(stpr)o(og.s)o(td)347
+2461 y Fg(will)34 b(op)s(en)h(the)h(CFITSIO)e(test)j(FITS)e(\014le)g
+(that)i(is)d(lo)s(cated)j(on)e(the)h Fc(legacy)f Fg(mac)m(hine.)57
+b(These)347 2574 y(\014les)30 b(can)g(only)g(b)s(e)f(op)s(ened)h(with)f
+('readonly')h(\014le)g(access.)256 2762 y Fa(\017)46
+b Fg(FITS)30 b(\014les)f(on)h Fc(stdin)f Fg(or)i Fc(stdout)d
+Fg(\014le)i(streams)347 2912 y(If)k(the)g(name)h(of)f(the)h(\014le)e
+(to)i(b)s(e)f(op)s(ened)f(is)g Fc('stdin')g Fg(or)h Fc('-')f
+Fg(\(a)i(single)e(dash)g(c)m(haracter\))k(then)347 3025
+y(CFITSIO)f(will)f(read)j(the)f(\014le)g(from)g(the)h(standard)f(input)
+e(stream.)63 b(Similarly)-8 b(,)36 b(if)h(the)h(output)347
+3138 y(\014le)k(name)h(is)f Fc('stdout')f Fg(or)i Fc('-')p
+Fg(,)j(then)c(the)i(\014le)e(will)e(b)s(e)j(written)f(to)h(the)h
+(standard)e(output)347 3251 y(stream.)54 b(In)34 b(addition,)g(if)f
+(the)i(output)f(\014lename)g(is)g Fc('stdout.gz')d Fg(or)k
+Fc('-.gz')e Fg(then)h(it)g(will)e(b)s(e)347 3364 y(gzip)h(compressed)g
+(b)s(efore)g(b)s(eing)e(written)h(to)i(stdout.)49 b(This)32
+b(mec)m(hanism)g(can)i(b)s(e)e(used)g(to)i(pip)s(e)347
+3477 y(FITS)c(\014les)f(from)h(one)h(task)g(to)g(another)f(without)g
+(ha)m(ving)g(to)h(write)e(an)i(in)m(termediary)e(FITS)g(\014le)347
+3590 y(on)i(magnetic)f(disk.)256 3777 y Fa(\017)46 b
+Fg(FITS)30 b(\014les)f(that)i(exist)f(only)g(in)f(memory)-8
+b(,)31 b(or)f(shared)g(memory)-8 b(.)347 3928 y(In)38
+b(some)i(applications,)f(suc)m(h)g(as)g(real)f(time)h(data)g
+(acquisition,)h(y)m(ou)f(ma)m(y)h(w)m(an)m(t)f(to)h(ha)m(v)m(e)g(one)
+347 4040 y(pro)s(cess)31 b(write)f(a)i(FITS)e(\014le)g(in)m(to)h(a)h
+(certain)f(section)g(of)g(computer)g(memory)-8 b(,)32
+b(and)f(then)f(b)s(e)h(able)347 4153 y(to)26 b(op)s(en)f(that)g(\014le)
+f(in)g(memory)h(with)f(another)h(pro)s(cess.)39 b(There)25
+b(is)f(a)h(sp)s(ecialized)e(CFITSIO)h(op)s(en)347 4266
+y(routine)e(called)h Fc(fits)p 1102 4266 V 33 w(open)p
+1327 4266 V 33 w(memfile)f Fg(that)h(can)h(b)s(e)e(used)h(for)g(this)f
+(purp)s(ose.)37 b(See)23 b(the)g(\\CFITSIO)347 4379 y(User's)31
+b(Reference)g(Guide")f(for)g(more)g(details.)256 4567
+y Fa(\017)46 b Fg(IRAF)31 b(format)g(images)f(\(with)f
+Fc(.imh)h Fg(\014le)f(extensions\))347 4717 y(CFITSIO)38
+b(supp)s(orts)g(reading)h(IRAF)h(format)g(images)g(b)m(y)g(con)m(v)m
+(erting)g(them)g(on)f(the)h(\015y)f(in)m(to)347 4830
+y(FITS)27 b(images)h(in)e(memory)-8 b(.)40 b(The)28 b(application)d
+(program)j(then)f(reads)h(this)e(virtual)g(FITS)h(format)347
+4943 y(image)35 b(in)f(memory)-8 b(.)55 b(There)34 b(is)g(curren)m(tly)
+g(no)h(supp)s(ort)e(for)i(writing)e(IRAF)i(format)g(images,)h(or)347
+5056 y(for)30 b(reading)g(or)g(writing)f(IRAF)h(tables.)256
+5243 y Fa(\017)46 b Fg(Image)31 b(arra)m(ys)g(in)e(ra)m(w)i(binary)d
+(format)347 5394 y(If)23 b(the)h(input)d(\014le)i(is)f(a)i(ra)m(w)f
+(binary)f(data)i(arra)m(y)-8 b(,)26 b(then)d(CFITSIO)f(will)e(con)m(v)m
+(ert)25 b(it)e(on)g(the)h(\015y)f(in)m(to)g(a)347 5507
+y(virtual)f(FITS)g(image)i(with)e(the)i(basic)e(set)i(of)g(required)d
+(header)i(k)m(eyw)m(ords)h(b)s(efore)f(it)g(is)f(op)s(ened)g(b)m(y)1905
+5809 y(24)p eop
+%%Page: 25 25
+25 24 bop 347 573 a Fg(the)31 b(application)d(program.)40
+b(In)30 b(this)f(case)i(the)f(data)h(t)m(yp)s(e)g(and)e(dimensions)e
+(of)k(the)f(image)g(m)m(ust)347 686 y(b)s(e)d(sp)s(eci\014ed)e(in)h
+(square)h(brac)m(k)m(ets)h(follo)m(wing)e(the)h(\014lename)g(\(e.g.)41
+b Fc(rawfile.dat[ib512,512])p Fg(\).)347 799 y(The)30
+b(\014rst)g(c)m(haracter)i(inside)c(the)i(brac)m(k)m(ets)i(de\014nes)e
+(the)g(datat)m(yp)s(e)i(of)e(the)h(arra)m(y:)586 1049
+y Fc(b)429 b(8-bit)47 b(unsigned)e(byte)586 1161 y(i)381
+b(16-bit)47 b(signed)f(integer)586 1274 y(u)381 b(16-bit)47
+b(unsigned)e(integer)586 1387 y(j)381 b(32-bit)47 b(signed)f(integer)
+586 1500 y(r)h(or)h(f)142 b(32-bit)47 b(floating)e(point)586
+1613 y(d)381 b(64-bit)47 b(floating)e(point)347 1863
+y Fg(An)32 b(optional)e(second)i(c)m(haracter)h(sp)s(eci\014es)d(the)i
+(b)m(yte)h(order)e(of)g(the)h(arra)m(y)g(v)-5 b(alues:)43
+b(b)31 b(or)h(B)g(indi-)347 1976 y(cates)27 b(big)d(endian)f(\(as)j(in)
+e(FITS)g(\014les)g(and)g(the)i(nativ)m(e)f(format)g(of)h(SUN)e(UNIX)i
+(w)m(orkstations)f(and)347 2089 y(Mac)35 b(PCs\))d(and)h(l)f(or)h(L)g
+(indicates)f(little)g(endian)g(\(nativ)m(e)i(format)f(of)g(DEC)h(OSF)e
+(w)m(orkstations)347 2202 y(and)41 b(IBM)g(PCs\).)73
+b(If)41 b(this)f(c)m(haracter)i(is)f(omitted)g(then)f(the)i(arra)m(y)f
+(is)g(assumed)f(to)i(ha)m(v)m(e)g(the)347 2315 y(nativ)m(e)29
+b(b)m(yte)g(order)e(of)h(the)h(lo)s(cal)e(mac)m(hine.)40
+b(These)28 b(datat)m(yp)s(e)h(c)m(haracters)g(are)g(then)f(follo)m(w)m
+(ed)f(b)m(y)347 2428 y(a)f(series)f(of)g(one)h(or)f(more)h(in)m(teger)f
+(v)-5 b(alues)25 b(separated)h(b)m(y)f(commas)h(whic)m(h)e(de\014ne)h
+(the)g(size)h(of)f(eac)m(h)347 2540 y(dimension)j(of)j(the)f(ra)m(w)h
+(arra)m(y)-8 b(.)41 b(Arra)m(ys)31 b(with)e(up)g(to)i(5)g(dimensions)d
+(are)i(curren)m(tly)g(supp)s(orted.)347 2691 y(Finally)-8
+b(,)32 b(a)h(b)m(yte)g(o\013set)g(to)g(the)g(p)s(osition)d(of)i(the)h
+(\014rst)f(pixel)e(in)h(the)i(data)g(\014le)e(ma)m(y)i(b)s(e)f(sp)s
+(eci\014ed)347 2804 y(b)m(y)c(separating)g(it)g(with)e(a)j(':')40
+b(from)27 b(the)i(last)e(dimension)f(v)-5 b(alue.)39
+b(If)28 b(omitted,)h(it)e(is)g(assumed)h(that)347 2917
+y(the)h(o\013set)g(=)f(0.)41 b(This)26 b(parameter)j(ma)m(y)g(b)s(e)f
+(used)f(to)i(skip)e(o)m(v)m(er)j(an)m(y)e(header)g(information)f(in)g
+(the)347 3029 y(\014le)j(that)h(precedes)f(the)h(binary)d(data.)42
+b(F)-8 b(urther)30 b(examples:)443 3279 y Fc(raw.dat[b10000])473
+b(1-dimensional)44 b(10000)i(pixel)h(byte)f(array)443
+3392 y(raw.dat[rb400,400,12])185 b(3-dimensional)44 b(floating)i(point)
+g(big-endian)f(array)443 3505 y(img.fits[ib512,512:2880)o(])d(reads)k
+(the)h(512)g(x)h(512)e(short)h(integer)f(array)g(in)h(a)1636
+3618 y(FITS)g(file,)f(skipping)f(over)i(the)g(2880)g(byte)f(header)1905
+5809 y Fg(25)p eop
+%%Page: 26 26
+26 25 bop 120 573 a Fb(5.3)112 b(Image)37 b(Filtering)120
+744 y Fh(5.3.1)105 b(Extracting)35 b(a)g(subsection)h(of)f(an)g(image)
+120 916 y Fg(When)21 b(sp)s(ecifying)e(the)j(name)f(of)g(an)g(image)h
+(to)g(b)s(e)f(op)s(ened,)h(y)m(ou)g(can)f(select)h(a)g(rectangular)f
+(subsection)f(of)120 1029 y(the)29 b(image)f(to)h(b)s(e)f(extracted)i
+(and)e(op)s(ened)f(b)m(y)i(the)f(application)f(program.)40
+b(The)28 b(application)f(program)120 1142 y(then)k(op)s(ens)f(a)i
+(virtual)e(image)h(that)h(only)e(con)m(tains)i(the)f(pixels)f(within)e
+(the)k(sp)s(eci\014ed)d(subsection.)43 b(T)-8 b(o)120
+1255 y(do)33 b(this,)g(sp)s(ecify)f(the)i(the)f(range)h(of)f(pixels)e
+(\(start:end\))k(along)e(eac)m(h)h(axis)f(to)h(b)s(e)f(extracted)h
+(from)f(the)120 1368 y(original)28 b(image)j(enclosed)f(in)f(square)h
+(brac)m(k)m(ets.)42 b(Y)-8 b(ou)31 b(can)f(also)h(sp)s(ecify)e(an)h
+(optional)f(pixel)g(incremen)m(t)120 1481 y(\(start:end:step\))37
+b(for)f(eac)m(h)g(axis)g(of)f(the)h(input)e(image.)57
+b(A)36 b(pixel)e(step)i(=)f(1)h(will)d(b)s(e)i(assumed)g(if)g(it)g(is)
+120 1594 y(not)29 b(sp)s(eci\014ed.)38 b(If)28 b(the)h(starting)f
+(pixel)f(is)g(larger)i(then)f(the)h(end)e(pixel,)h(then)g(the)h(image)g
+(will)c(b)s(e)j(\015ipp)s(ed)120 1706 y(\(pro)s(ducing)33
+b(a)i(mirror)d(image\))j(along)g(that)g(dimension.)51
+b(An)34 b(asterisk,)i('*',)h(ma)m(y)e(b)s(e)f(used)f(to)j(sp)s(ecify)
+120 1819 y(the)25 b(en)m(tire)g(range)g(of)g(an)g(axis,)h(and)e('-*')i
+(will)d(\015ip)g(the)i(en)m(tire)g(axis.)38 b(In)24 b(the)h(follo)m
+(wing)f(examples,)i(assume)120 1932 y(that)31 b Fc(myfile.fits)c
+Fg(con)m(tains)k(a)g(512)g(x)g(512)g(pixel)e(2D)i(image.)215
+2130 y Fc(myfile.fits[201:210,)43 b(251:260])i(-)j(opens)e(a)i(10)f(x)g
+(10)g(pixel)g(subimage.)215 2356 y(myfile.fits[*,)d(512:257])i(-)h
+(opens)g(a)g(512)g(x)h(256)e(image)h(consisting)e(of)406
+2469 y(all)i(the)g(columns)f(in)h(the)g(input)f(image,)h(but)f(only)h
+(rows)g(257)406 2582 y(through)f(512.)95 b(The)46 b(image)h(will)f(be)i
+(flipped)d(along)i(the)g(Y)g(axis)406 2695 y(since)g(the)g(starting)e
+(row)i(is)g(greater)f(than)h(the)g(ending)406 2808 y(row.)215
+3033 y(myfile.fits[*:2,)d(512:257:2])h(-)i(creates)f(a)i(256)e(x)i(128)
+f(pixel)f(image.)406 3146 y(Similar)g(to)h(the)g(previous)f(example,)f
+(but)i(only)g(every)f(other)h(row)406 3259 y(and)g(column)f(is)i(read)e
+(from)h(the)g(input)f(image.)215 3485 y(myfile.fits[-*,)e(*])j(-)h
+(creates)e(an)h(image)f(containing)f(all)i(the)g(rows)g(and)406
+3598 y(columns)f(in)h(the)g(input)g(image,)f(but)h(flips)f(it)h(along)g
+(the)f(X)406 3711 y(axis.)261 3909 y Fg(If)33 b(the)g(arra)m(y)h(to)g
+(b)s(e)f(op)s(ened)f(is)h(in)f(an)h(Image)h(extension,)g(and)f(not)g
+(in)f(the)i(primary)d(arra)m(y)j(of)f(the)120 4022 y(\014le,)c(then)g
+(y)m(ou)g(need)g(to)h(sp)s(ecify)d(the)j(extension)f(name)g(or)g(n)m
+(um)m(b)s(er)f(in)f(square)i(brac)m(k)m(ets)i(b)s(efore)e(giving)120
+4135 y(the)h(subsection)e(range,)i(as)g(in)e Fc(myfile.fits[1][-*,)42
+b(*])29 b Fg(to)h(read)f(the)h(image)g(in)e(the)h(\014rst)g(extension)
+120 4248 y(in)g(the)i(\014le.)120 4485 y Fh(5.3.2)105
+b(Create)34 b(an)h(Image)f(b)m(y)h(Binning)h(T)-9 b(able)34
+b(Columns)120 4657 y Fg(Y)-8 b(ou)40 b(can)f(also)g(create)i(and)d(op)s
+(en)h(a)g(virtual)f(image)h(b)m(y)g(binning)d(the)k(v)-5
+b(alues)38 b(in)g(a)h(pair)f(of)i(columns)120 4770 y(of)f(a)h(FITS)f
+(table)g(\(in)f(other)i(w)m(ords,)h(create)g(a)e(2-D)i(histogram)e(of)g
+(the)g(v)-5 b(alues)39 b(in)f(the)h(2)h(columns\).)120
+4883 y(This)33 b(tec)m(hnique)h(is)g(often)h(used)f(in)g(X-ra)m(y)i
+(astronom)m(y)f(where)f(eac)m(h)i(detected)g(X-ra)m(y)g(photon)f
+(during)120 4996 y(an)29 b(observ)-5 b(ation)28 b(is)g(recorded)h(in)e
+(a)i(FITS)f(table.)40 b(There)29 b(are)g(t)m(ypically)e(2)j(columns)d
+(in)g(the)i(table)g(called)120 5109 y Fc(X)35 b Fg(and)h
+Fc(Y)f Fg(whic)m(h)g(record)g(the)i(pixel)d(lo)s(cation)h(of)h(that)h
+(ev)m(en)m(t)g(in)d(a)j(virtual)d(2D)i(image.)58 b(T)-8
+b(o)36 b(create)h(an)120 5222 y(image)27 b(from)f(this)g(table,)i(one)f
+(just)f(scans)h(the)g(X)g(and)f(Y)h(columns)f(and)g(coun)m(ts)h(up)f
+(ho)m(w)h(man)m(y)g(photons)120 5334 y(w)m(ere)k(recorded)g(in)f(eac)m
+(h)i(pixel)d(of)i(the)g(image.)43 b(When)30 b(table)h(binning)d(is)i
+(sp)s(eci\014ed,)g(CFITSIO)f(creates)120 5447 y(a)38
+b(temp)s(orary)e(FITS)h(primary)e(arra)m(y)j(in)e(memory)h(b)m(y)g
+(computing)g(the)g(histogram)g(of)h(the)f(v)-5 b(alues)37
+b(in)120 5560 y(the)29 b(sp)s(eci\014ed)e(columns.)39
+b(After)29 b(the)g(histogram)f(is)g(computed)h(the)g(original)e(FITS)h
+(\014le)g(con)m(taining)g(the)1905 5809 y(26)p eop
+%%Page: 27 27
+27 26 bop 120 573 a Fg(table)24 b(is)e(closed)i(and)f(the)g(temp)s
+(orary)h(FITS)e(primary)g(arra)m(y)i(is)f(op)s(ened)g(and)g(passed)g
+(to)h(the)g(application)120 686 y(program.)39 b(Th)m(us,)27
+b(the)g(application)e(program)i(nev)m(er)g(sees)h(the)f(original)e
+(FITS)h(table)h(and)f(only)g(sees)h(the)120 799 y(image)k(in)e(the)h
+(new)g(temp)s(orary)g(\014le)g(\(whic)m(h)f(has)h(no)g(extensions\).)
+261 912 y(The)f(table)g(binning)d(sp)s(eci\014er)i(is)h(enclosed)g(in)f
+(square)h(brac)m(k)m(ets)h(follo)m(wing)e(the)i(ro)s(ot)f(\014lename)g
+(and)120 1024 y(table)h(extension)g(name)h(or)f(n)m(um)m(b)s(er)f(and)h
+(b)s(egins)f(with)g(the)h(k)m(eyw)m(ord)h('bin',)f(as)g(in:)120
+1137 y Fc('myfile.fits[events][bin)41 b(\(X,Y\)]')p Fg(.)20
+b(In)h(this)g(case,)k(the)d(X)g(and)f(Y)h(columns)f(in)g(the)h('ev)m
+(en)m(ts')h(table)120 1250 y(extension)29 b(are)h(binned)e(up)g(to)j
+(create)g(the)f(image.)41 b(The)29 b(size)g(of)h(the)g(image)g(is)f
+(usually)e(determined)h(b)m(y)120 1363 y(the)22 b Fc(TLMINn)d
+Fg(and)i Fc(TLMAXn)f Fg(header)h(k)m(eyw)m(ords)h(whic)m(h)e(giv)m(e)i
+(the)f(minim)m(um)e(and)i(maxim)m(um)f(allo)m(w)m(ed)h(pixel)120
+1476 y(v)-5 b(alues)37 b(in)f(the)i(columns.)61 b(F)-8
+b(or)38 b(instance)f(if)g Fc(TLMINn)46 b(=)h(1)37 b Fg(and)g
+Fc(TLMAXn)46 b(=)i(4096)36 b Fg(for)i(b)s(oth)e(columns,)120
+1589 y(this)e(w)m(ould)g(generate)i(a)f(4096)i(x)e(4096)h(pixel)e
+(image)h(b)m(y)g(default.)53 b(This)33 b(is)h(rather)h(large,)i(so)e(y)
+m(ou)g(can)120 1702 y(also)d(sp)s(ecify)f(a)i(pixel)d(binning)f(factor)
+34 b(to)f(reduce)f(the)g(image)h(size.)46 b(F)-8 b(or)33
+b(example)f(sp)s(ecifying)e(,)j Fc('[bin)120 1815 y(\(X,Y\))46
+b(=)i(16]')29 b Fg(will)e(use)i(a)i(binning)26 b(factor)31
+b(of)f(16,)h(whic)m(h)e(will)e(pro)s(duce)i(a)h(256)h(x)f(256)h(pixel)e
+(image)h(in)120 1928 y(the)h(previous)d(example.)261
+2041 y(If)35 b(the)g(TLMIN)g(and)g(TLMAX)g(k)m(eyw)m(ords)g(don't)g
+(exist,)i(or)e(y)m(ou)g(w)m(an)m(t)h(to)g(o)m(v)m(erride)g(their)e(v)-5
+b(alues,)120 2154 y(y)m(ou)36 b(can)h(sp)s(ecify)d(the)i(image)h(range)
+f(and)f(binning)e(factor)k(directly)-8 b(,)37 b(as)f(in)f
+Fc('[bin)46 b(X)i(=)f(1:4096:16,)120 2267 y(Y=1:4096:16]')p
+Fg(.)36 b(Y)-8 b(ou)28 b(can)g(also)f(sp)s(ecify)f(the)i(datat)m(yp)s
+(e)g(of)g(the)g(created)g(image)g(b)m(y)f(app)s(ending)e(a)j(b,)g(i,)
+120 2379 y(j,)f(r,)g(or)f(d)f(\(for)h(8-bit)g(b)m(yte,)i(16-bit)f(in)m
+(tegers,)g(32-bit)f(in)m(teger,)i(32-bit)e(\015oating)g(p)s(oin)m(ts,)g
+(or)g(64-bit)h(double)120 2492 y(precision)34 b(\015oating)h(p)s(oin)m
+(t,)h(resp)s(ectiv)m(ely\))f(to)h(the)g('bin')e(k)m(eyw)m(ord)h(\(e.g.)
+58 b Fc('[binr)46 b(\(X,Y\)]')33 b Fg(creates)k(a)120
+2605 y(\015oating)i(p)s(oin)m(t)e(image\).)66 b(If)38
+b(the)h(datat)m(yp)s(e)h(is)d(not)i(sp)s(eci\014ed)e(then)h(a)h(32-bit)
+g(in)m(teger)g(image)g(will)d(b)s(e)120 2718 y(created)31
+b(b)m(y)g(default.)261 2831 y(If)39 b(the)h(column)e(name)h(is)g(not)g
+(sp)s(eci\014ed,)h(then)f(CFITSIO)f(will)f(\014rst)h(try)i(to)g(use)f
+(the)g('preferred)120 2944 y(column')34 b(as)h(sp)s(eci\014ed)e(b)m(y)i
+(the)g(CPREF)g(k)m(eyw)m(ord)g(if)f(it)h(exists)f(\(e.g.,)k('CPREF)d(=)
+g('DETX,DETY'\),)120 3057 y(otherwise)30 b(column)f(names)h('X',)i('Y')
+e(will)e(b)s(e)i(assumed)g(for)g(the)g(2)h(axes.)261
+3170 y(Note)37 b(that)f(this)e(binning)e(sp)s(eci\014er)i(is)g(not)h
+(restricted)g(to)h(only)f(2D)h(images)f(and)g(can)g(b)s(e)g(used)g(to)
+120 3283 y(create)f(1D,)f(3D,)g(or)g(4D)g(images)f(as)g(w)m(ell.)46
+b(It)32 b(is)f(also)h(p)s(ossible)e(to)j(sp)s(ecify)e(a)h(w)m(eigh)m
+(ting)g(factor)i(that)e(is)120 3396 y(applied)27 b(during)h(the)h
+(binning.)38 b(Please)29 b(refer)h(to)g(the)g(\\CFITSIO)e(User's)i
+(Reference)g(Guide")f(for)g(more)120 3509 y(details)g(on)i(these)f(adv)
+-5 b(anced)31 b(features.)1905 5809 y(27)p eop
+%%Page: 28 28
+28 27 bop 120 573 a Fb(5.4)112 b(T)-9 b(able)37 b(Filtering)120
+744 y Fh(5.4.1)105 b(Column)34 b(and)h(Keyw)m(ord)g(Filtering)120
+916 y Fg(The)29 b(column)f(or)h(k)m(eyw)m(ord)h(\014ltering)e(sp)s
+(eci\014er)g(is)g(used)h(to)h(mo)s(dify)d(the)j(column)e(structure)h
+(and/or)g(the)120 1029 y(header)h(k)m(eyw)m(ords)h(in)e(the)i(HDU)g
+(that)g(w)m(as)g(selected)g(with)e(the)i(previous)e(HDU)i(lo)s(cation)f
+(sp)s(eci\014er.)39 b(It)120 1142 y(can)31 b(b)s(e)e(used)h(to)h(p)s
+(erform)e(the)i(follo)m(wing)d(t)m(yp)s(es)j(of)f(op)s(erations.)256
+1354 y Fa(\017)46 b Fg(App)s(end)35 b(a)h(new)g(column)f(to)i(a)f
+(table)g(b)m(y)h(giving)e(the)h(column)f(name,)j(optionally)d(follo)m
+(w)m(ed)g(b)m(y)347 1467 y(the)e(datat)m(yp)s(e)h(in)d(paren)m(theses,)
+j(follo)m(w)m(ed)e(b)m(y)h(an)g(equals)f(sign)g(and)g(the)h(arithmetic)
+f(expression)347 1580 y(to)e(b)s(e)e(used)g(to)i(compute)f(the)g(v)-5
+b(alue.)40 b(The)28 b(datat)m(yp)s(e)i(is)e(sp)s(eci\014ed)f(using)h
+(the)h(same)g(syn)m(tax)h(that)347 1693 y(is)j(allo)m(w)m(ed)g(for)g
+(the)g(v)-5 b(alue)33 b(of)h(the)f(FITS)g(TF)m(ORMn)g(k)m(eyw)m(ord)h
+(\(e.g.,)i('I',)e('J',)g('E',)f('D',)i(etc.)51 b(for)347
+1806 y(binary)31 b(tables,)h(and)g('I8',)h(F12.3',)i('E20.12',)g(etc.)
+47 b(for)32 b(ASCI)s(I)f(tables\).)46 b(If)32 b(the)g(datat)m(yp)s(e)h
+(is)e(not)347 1919 y(sp)s(eci\014ed)e(then)h(a)h(default)e(datat)m(yp)s
+(e)j(will)27 b(b)s(e)j(c)m(hosen)h(dep)s(ending)d(on)i(the)h
+(expression.)256 2107 y Fa(\017)46 b Fg(Create)33 b(a)g(new)f(header)g
+(k)m(eyw)m(ord)h(b)m(y)f(giving)f(the)i(k)m(eyw)m(ord)g(name,)g
+(preceded)f(b)m(y)g(a)h(p)s(ound)d(sign)347 2220 y('#',)24
+b(follo)m(w)m(ed)c(b)m(y)h(an)g(equals)f(sign)g(and)g(an)h(arithmetic)f
+(expression)g(for)h(the)g(v)-5 b(alue)20 b(of)h(the)h(k)m(eyw)m(ord.)
+347 2332 y(The)k(expression)f(ma)m(y)i(b)s(e)f(a)h(function)e(of)i
+(other)f(header)g(k)m(eyw)m(ord)h(v)-5 b(alues.)39 b(The)26
+b(commen)m(t)h(string)347 2445 y(for)40 b(the)h(k)m(eyw)m(ord)g(ma)m(y)
+g(b)s(e)f(sp)s(eci\014ed)f(in)g(paren)m(theses)i(immediately)d(follo)m
+(wing)h(the)i(k)m(eyw)m(ord)347 2558 y(name.)256 2746
+y Fa(\017)46 b Fg(Ov)m(erwrite)29 b(the)g(v)-5 b(alues)29
+b(in)e(an)i(existing)g(column)e(or)j(k)m(eyw)m(ord)f(b)m(y)g(giving)f
+(the)i(name)f(follo)m(w)m(ed)f(b)m(y)347 2859 y(an)j(equals)e(sign)h
+(and)f(an)i(arithmetic)e(expression.)256 3046 y Fa(\017)46
+b Fg(Select)35 b(a)f(set)g(of)h(columns)d(to)j(b)s(e)e(included)f(in)g
+(the)j(\014ltered)e(\014le)g(b)m(y)h(listing)d(the)k(column)d(names)347
+3159 y(separated)d(with)e(semi-colons.)39 b(Wild)27 b(card)h(c)m
+(haracters)i(ma)m(y)e(b)s(e)g(used)f(in)g(the)i(column)e(names)h(to)347
+3272 y(matc)m(h)33 b(m)m(ultiple)d(columns.)45 b(An)m(y)32
+b(other)h(columns)d(in)h(the)i(input)d(table)i(will)d(not)k(app)s(ear)e
+(in)g(the)347 3385 y(\014ltered)f(\014le.)256 3573 y
+Fa(\017)46 b Fg(Delete)31 b(a)f(column)f(or)g(k)m(eyw)m(ord)h(b)m(y)g
+(listing)d(the)j(name)g(preceded)f(b)m(y)h(a)g(min)m(us)e(sign)g(or)i
+(an)g(excla-)347 3686 y(mation)g(mark)g(\(!\))256 3873
+y Fa(\017)46 b Fg(Rename)31 b(an)f(existing)g(column)f(or)h(k)m(eyw)m
+(ord)h(with)e(the)i(syn)m(tax)g('NewName)g(==)f(OldName'.)261
+4086 y(The)20 b(column)f(\014ltering)g(sp)s(eci\014er)f(is)i(enclosed)g
+(in)f(square)h(brac)m(k)m(ets)h(and)f(b)s(egins)f(with)g(the)h(string)g
+('col'.)120 4199 y(Multiple)29 b(op)s(erations)h(can)h(b)s(e)f(p)s
+(erformed)f(b)m(y)i(separating)f(them)h(with)e(semi-colons.)41
+b(F)-8 b(or)32 b(complex)e(or)120 4312 y(commonly)g(used)h(op)s
+(erations,)f(y)m(ou)i(can)f(write)f(the)h(column)f(\014lter)g(to)i(a)f
+(text)h(\014le,)e(and)h(then)f(use)h(it)f(b)m(y)120 4425
+y(giving)f(the)i(name)f(of)h(the)f(text)i(\014le,)d(preceded)h(b)m(y)h
+(a)f('@')h(c)m(haracter.)261 4538 y(Some)g(examples:)215
+4750 y Fc([col)47 b(PI=PHA)f(*)i(1.1)f(+)g(0.2])285 b(-)48
+b(creates)e(new)g(PI)i(column)e(from)g(PHA)h(values)215
+4976 y([col)g(rate)g(=)g(counts/exposure])91 b(-)48 b(creates)e(or)h
+(overwrites)e(the)i(rate)f(column)g(by)1743 5089 y(dividing)f(the)i
+(counts)f(column)g(by)i(the)1743 5202 y(EXPOSURE)d(keyword)h(value.)215
+5428 y([col)h(TIME;)f(X;)i(Y])667 b(-)48 b(only)e(the)h(listed)f
+(columns)g(will)h(appear)1743 5540 y(in)g(the)g(filtered)e(file)1905
+5809 y Fg(28)p eop
+%%Page: 29 29
+29 28 bop 215 686 a Fc([col)47 b(Time;*raw])713 b(-)48
+b(include)e(the)g(Time)h(column)f(and)h(any)g(other)1743
+799 y(columns)f(whose)g(name)h(ends)f(with)h('raw'.)215
+1024 y([col)g(-TIME;)f(Good)h(==)g(STATUS])141 b(-)48
+b(deletes)e(the)g(TIME)h(column)f(and)1743 1137 y(renames)g(the)g
+(STATUS)h(column)f(to)h(GOOD)215 1363 y([col)g(@colfilt.txt])569
+b(-)48 b(uses)e(the)h(filtering)f(expression)f(in)1743
+1476 y(the)i(colfilt.txt)d(text)j(file)261 1689 y Fg(The)30
+b(original)f(\014le)h(is)g(not)h(c)m(hanged)g(b)m(y)g(this)f
+(\014ltering)f(op)s(eration,)h(and)g(instead)g(the)h(mo)s
+(di\014cations)120 1802 y(are)36 b(made)f(on)h(a)f(temp)s(orary)h(cop)m
+(y)g(of)f(the)h(input)d(FITS)i(\014le)g(\(usually)e(in)h(memory\),)k
+(whic)m(h)c(includes)120 1914 y(a)42 b(cop)m(y)g(of)g(all)e(the)i
+(other)g(HDUs)g(in)e(the)i(input)e(\014le.)73 b(The)41
+b(original)f(input)g(\014le)g(is)h(closed)g(and)g(the)120
+2027 y(application)29 b(program)h(op)s(ens)f(the)i(\014ltered)e(cop)m
+(y)i(of)g(the)g(\014le.)120 2268 y Fh(5.4.2)105 b(Ro)m(w)36
+b(Filtering)120 2439 y Fg(The)22 b(ro)m(w)h(\014lter)f(is)g(used)g(to)h
+(select)g(a)h(subset)e(of)h(the)g(ro)m(ws)f(from)h(a)g(table)f(based)h
+(on)f(a)i(b)s(o)s(olean)d(expression.)120 2552 y(A)37
+b(temp)s(orary)g(new)f(FITS)g(\014le)h(is)f(created)i(on)f(the)g(\015y)
+f(\(usually)f(in)h(memory\))h(whic)m(h)f(con)m(tains)h(only)120
+2665 y(those)30 b(ro)m(ws)g(for)g(whic)m(h)f(the)h(ro)m(w)g(\014lter)f
+(expression)f(ev)-5 b(aluates)31 b(to)f(true)g(\(i.e.,)h(not)f(equal)f
+(to)i(zero\).)42 b(The)120 2778 y(primary)24 b(arra)m(y)j(and)e(an)m(y)
+h(other)h(extensions)e(in)g(the)h(input)e(\014le)h(are)i(also)f(copied)
+f(to)i(the)f(temp)s(orary)g(\014le.)120 2891 y(The)h(original)f(FITS)h
+(\014le)g(is)g(closed)g(and)h(the)g(new)f(temp)s(orary)g(\014le)g(is)g
+(then)g(op)s(ened)g(b)m(y)h(the)g(application)120 3004
+y(program.)261 3117 y(The)f(ro)m(w)g(\014lter)f(expression)g(is)g
+(enclosed)g(in)g(square)h(brac)m(k)m(ets)h(follo)m(wing)e(the)h(\014le)
+f(name)h(and)f(exten-)120 3230 y(sion)31 b(name.)48 b(F)-8
+b(or)33 b(example,)g Fc('file.fits[events][GRAD)o(E==5)o(0]')26
+b Fg(selects)33 b(only)f(those)h(ro)m(ws)f(in)f(the)120
+3342 y(EVENTS)f(table)g(where)g(the)g(GRADE)h(column)f(v)-5
+b(alue)29 b(is)h(equal)g(to)h(50\).)261 3455 y(The)d(ro)m(w)h
+(\014ltering)d(expression)i(can)g(b)s(e)g(an)h(arbitrarily)c(complex)k
+(series)e(of)i(op)s(erations)f(p)s(erformed)120 3568
+y(on)e(constan)m(ts,)i(k)m(eyw)m(ord)e(v)-5 b(alues,)26
+b(and)f(column)g(data)h(tak)m(en)h(from)e(the)h(sp)s(eci\014ed)e(FITS)h
+(T)-8 b(ABLE)26 b(exten-)120 3681 y(sion.)39 b(The)27
+b(expression)f(also)i(can)f(b)s(e)g(written)g(in)m(to)h(a)f(text)i
+(\014le)e(and)g(then)g(used)g(b)m(y)g(giving)f(the)i(\014lename)120
+3794 y(preceded)i(b)m(y)g(a)h('@')g(c)m(haracter,)h(as)e(in)f
+Fc('[@rowfilt.txt]')p Fg(.)261 3907 y(Keyw)m(ord)40 b(and)f(column)g
+(data)h(are)h(referenced)f(b)m(y)f(name.)70 b(An)m(y)40
+b(string)f(of)h(c)m(haracters)h(not)f(sur-)120 4020 y(rounded)30
+b(b)m(y)i(quotes)g(\(ie,)g(a)h(constan)m(t)g(string\))e(or)g(follo)m(w)
+m(ed)h(b)m(y)f(an)h(op)s(en)f(paren)m(theses)h(\(ie,)h(a)f(function)120
+4133 y(name\))e(will)c(b)s(e)j(initially)c(in)m(terpreted)k(as)g(a)h
+(column)e(name)h(and)g(its)g(con)m(ten)m(ts)i(for)e(the)g(curren)m(t)g
+(ro)m(w)g(in-)120 4246 y(serted)e(in)m(to)g(the)h(expression.)38
+b(If)27 b(no)g(suc)m(h)g(column)f(exists,)i(a)f(k)m(eyw)m(ord)h(of)g
+(that)f(name)h(will)c(b)s(e)j(searc)m(hed)120 4359 y(for)34
+b(and)f(its)g(v)-5 b(alue)34 b(used,)g(if)f(found.)50
+b(T)-8 b(o)35 b(force)f(the)g(name)g(to)h(b)s(e)e(in)m(terpreted)g(as)i
+(a)f(k)m(eyw)m(ord)g(\(in)f(case)120 4472 y(there)28
+b(is)f(b)s(oth)g(a)h(column)f(and)g(k)m(eyw)m(ord)h(with)f(the)h(same)g
+(name\),)h(precede)f(the)g(k)m(eyw)m(ord)h(name)e(with)g(a)120
+4584 y(single)j(p)s(ound)f(sign,)i('#',)h(as)g(in)e Fc(#NAXIS2)p
+Fg(.)41 b(Due)32 b(to)g(the)f(generalities)g(of)g(FITS)g(column)f(and)h
+(k)m(eyw)m(ord)120 4697 y(names,)c(if)d(the)i(column)f(or)g(k)m(eyw)m
+(ord)h(name)g(con)m(tains)g(a)g(space)g(or)g(a)g(c)m(haracter)h(whic)m
+(h)e(migh)m(t)g(app)s(ear)g(as)120 4810 y(an)32 b(arithmetic)f(term)h
+(then)g(inclose)f(the)h(name)g(in)e('$')j(c)m(haracters)h(as)e(in)f
+Fc($MAX)46 b(PHA$)31 b Fg(or)h Fc(#$MAX-PHA$)p Fg(.)120
+4923 y(The)e(names)g(are)h(case)g(insensitiv)m(e.)261
+5036 y(T)-8 b(o)37 b(access)g(a)g(table)f(en)m(try)h(in)e(a)h(ro)m(w)h
+(other)f(than)g(the)h(curren)m(t)f(one,)i(follo)m(w)e(the)g(column's)f
+(name)120 5149 y(with)j(a)h(ro)m(w)g(o\013set)g(within)e(curly)g
+(braces.)66 b(F)-8 b(or)40 b(example,)h Fc('PHA)p Fa(f)p
+Fc(-3)p Fa(g)p Fc(')d Fg(will)e(ev)-5 b(aluate)39 b(to)h(the)f(v)-5
+b(alue)120 5262 y(of)40 b(column)e(PHA,)i(3)g(ro)m(ws)f(ab)s(o)m(v)m(e)
+i(the)f(ro)m(w)g(curren)m(tly)e(b)s(eing)g(pro)s(cessed.)68
+b(One)39 b(cannot)h(sp)s(ecify)e(an)120 5375 y(absolute)32
+b(ro)m(w)g(n)m(um)m(b)s(er,)f(only)g(a)i(relativ)m(e)f(o\013set.)47
+b(Ro)m(ws)32 b(that)h(fall)d(outside)h(the)i(table)f(will)d(b)s(e)i
+(treated)120 5488 y(as)g(unde\014ned,)d(or)i(NULLs.)1905
+5809 y(29)p eop
+%%Page: 30 30
+30 29 bop 261 573 a Fg(Bo)s(olean)31 b(op)s(erators)g(can)g(b)s(e)g
+(used)f(in)f(the)i(expression)f(in)f(either)i(their)f(F)-8
+b(ortran)31 b(or)g(C)f(forms.)42 b(The)120 686 y(follo)m(wing)29
+b(b)s(o)s(olean)g(op)s(erators)i(are)g(a)m(v)-5 b(ailable:)311
+886 y Fc("equal")428 b(.eq.)46 b(.EQ.)h(==)95 b("not)46
+b(equal")476 b(.ne.)94 b(.NE.)h(!=)311 999 y("less)46
+b(than")238 b(.lt.)46 b(.LT.)h(<)143 b("less)46 b(than/equal")188
+b(.le.)94 b(.LE.)h(<=)47 b(=<)311 1112 y("greater)e(than")95
+b(.gt.)46 b(.GT.)h(>)143 b("greater)45 b(than/equal")g(.ge.)94
+b(.GE.)h(>=)47 b(=>)311 1225 y("or")572 b(.or.)46 b(.OR.)h(||)95
+b("and")762 b(.and.)46 b(.AND.)h(&&)311 1337 y("negation")236
+b(.not.)46 b(.NOT.)h(!)95 b("approx.)45 b(equal\(1e-7\)")92
+b(~)261 1537 y Fg(Note)34 b(that)g(the)f(exclamation)g(p)s(oin)m(t,)g
+(')10 b(!',)34 b(is)e(a)i(sp)s(ecial)d(UNIX)i(c)m(haracter,)j(so)d(if)f
+(it)g(is)g(used)g(on)h(the)120 1650 y(command)f(line)f(rather)h(than)g
+(en)m(tered)h(at)g(a)g(task)g(prompt,)f(it)g(m)m(ust)g(b)s(e)g
+(preceded)g(b)m(y)g(a)h(bac)m(kslash)f(to)120 1763 y(force)f(the)g
+(UNIX)f(shell)f(to)i(ignore)f(it.)261 1876 y(The)d(expression)e(ma)m(y)
+j(also)f(include)e(arithmetic)h(op)s(erators)h(and)f(functions.)38
+b(T)-8 b(rigonometric)27 b(func-)120 1989 y(tions)g(use)h(radians,)g
+(not)g(degrees.)40 b(The)28 b(follo)m(wing)f(arithmetic)g(op)s(erators)
+h(and)g(functions)e(can)j(b)s(e)e(used)120 2102 y(in)i(the)i
+(expression)e(\(function)g(names)h(are)h(case)h(insensitiv)m(e\):)311
+2302 y Fc("addition")522 b(+)477 b("subtraction")d(-)311
+2415 y("multiplication")234 b(*)477 b("division")618
+b(/)311 2528 y("negation")522 b(-)477 b("exponentiation")330
+b(**)143 b(^)311 2641 y("absolute)45 b(value")237 b(abs\(x\))g
+("cosine")714 b(cos\(x\))311 2754 y("sine")g(sin\(x\))237
+b("tangent")666 b(tan\(x\))311 2867 y("arc)47 b(cosine")427
+b(arccos\(x\))93 b("arc)47 b(sine")619 b(arcsin\(x\))311
+2979 y("arc)47 b(tangent")379 b(arctan\(x\))93 b("arc)47
+b(tangent")475 b(arctan2\(x,y\))311 3092 y("exponential")378
+b(exp\(x\))237 b("square)46 b(root")476 b(sqrt\(x\))311
+3205 y("natural)45 b(log")381 b(log\(x\))237 b("common)46
+b(log")524 b(log10\(x\))311 3318 y("modulus")570 b(i)48
+b(\045)f(j)286 b("random)46 b(#)h([0.0,1.0\)")141 b(random\(\))311
+3431 y("minimum")570 b(min\(x,y\))141 b("maximum")666
+b(max\(x,y\))311 3544 y("if-then-else")330 b(b?x:y)261
+3744 y Fg(The)37 b(follo)m(wing)f(t)m(yp)s(e)i(casting)f(op)s(erators)h
+(are)g(a)m(v)-5 b(ailable,)38 b(where)f(the)h(inclosing)d(paren)m
+(theses)j(are)120 3857 y(required)22 b(and)i(tak)m(en)h(from)f(the)h(C)
+f(language)g(usage.)40 b(Also,)25 b(the)f(in)m(teger)h(to)g(real)f
+(casts)h(v)-5 b(alues)24 b(to)h(double)120 3970 y(precision:)884
+4170 y Fc("real)46 b(to)h(integer")189 b(\(int\))46 b(x)239
+b(\(INT\))46 b(x)884 4283 y("integer)f(to)i(real")190
+b(\(float\))46 b(i)143 b(\(FLOAT\))45 b(i)261 4483 y
+Fg(Sev)m(eral)31 b(constan)m(ts)g(are)g(built)d(in)h(for)h(use)g(in)f
+(n)m(umerical)g(expressions:)502 4683 y Fc(#pi)667 b(3.1415...)284
+b(#e)620 b(2.7182...)502 4796 y(#deg)f(#pi/180)380 b(#row)524
+b(current)46 b(row)h(number)502 4909 y(#null)428 b(undefined)45
+b(value)142 b(#snull)428 b(undefined)45 b(string)261
+5109 y Fg(A)d(string)f(constan)m(t)i(m)m(ust)f(b)s(e)f(enclosed)h(in)f
+(quotes)h(as)g(in)f('Crab'.)75 b(The)41 b("n)m(ull")g(constan)m(ts)i
+(are)120 5222 y(useful)36 b(for)h(conditionally)e(setting)j(table)f(v)
+-5 b(alues)37 b(to)h(a)g(NULL,)g(or)f(unde\014ned,)h(v)-5
+b(alue)37 b(\(F)-8 b(or)38 b(example,)120 5334 y Fc("col1==-99)45
+b(?)95 b(#NULL)47 b(:)g(col1")p Fg(\).)261 5447 y(There)33
+b(is)g(also)g(a)h(function)f(for)g(testing)h(if)e(t)m(w)m(o)j(v)-5
+b(alues)33 b(are)h(close)g(to)g(eac)m(h)h(other,)g(i.e.,)g(if)d(they)i
+(are)120 5560 y("near")29 b(eac)m(h)g(other)f(to)g(within)e(a)i(user)f
+(sp)s(eci\014ed)f(tolerance.)41 b(The)27 b(argumen)m(ts,)i
+Fc(value)p 3184 5560 29 4 v 33 w(1)e Fg(and)h Fc(value)p
+3707 5560 V 33 w(2)1905 5809 y Fg(30)p eop
+%%Page: 31 31
+31 30 bop 120 573 a Fg(can)39 b(b)s(e)g(in)m(teger)g(or)g(real)f(and)h
+(represen)m(t)g(the)g(t)m(w)m(o)h(v)-5 b(alues)38 b(who's)h(pro)m
+(ximit)m(y)f(is)g(b)s(eing)g(tested)h(to)h(b)s(e)120
+686 y(within)28 b(the)i(sp)s(eci\014ed)f(tolerance,)i(also)g(an)f(in)m
+(teger)h(or)f(real:)1075 880 y Fc(near\(value_1,)44 b(value_2,)h
+(tolerance\))261 1074 y Fg(When)30 b(a)h(NULL,)f(or)h(unde\014ned,)d(v)
+-5 b(alue)30 b(is)f(encoun)m(tered)i(in)e(the)h(FITS)g(table,)g(the)h
+(expression)e(will)120 1186 y(ev)-5 b(aluate)42 b(to)g(NULL)g(unless)d
+(the)j(unde\014ned)d(v)-5 b(alue)41 b(is)g(not)g(actually)g(required)f
+(for)h(ev)-5 b(aluation,)44 b(e.g.)120 1299 y("TR)m(UE)e(.or.)76
+b(NULL")42 b(ev)-5 b(aluates)43 b(to)g(TR)m(UE.)f(The)f(follo)m(wing)g
+(t)m(w)m(o)i(functions)e(allo)m(w)g(some)h(NULL)120 1412
+y(detection)31 b(and)f(handling:)1027 1606 y Fc(ISNULL\(x\))1027
+1719 y(DEFNULL\(x,y\))261 1913 y Fg(The)43 b(former)g(returns)f(a)i(b)s
+(o)s(olean)e(v)-5 b(alue)43 b(of)g(TR)m(UE)h(if)e(the)i(argumen)m(t)f
+(x)h(is)e(NULL.)i(The)e(later)120 2026 y("de\014nes")e(a)g(v)-5
+b(alue)39 b(to)h(b)s(e)g(substituted)e(for)h(NULL)h(v)-5
+b(alues;)44 b(it)39 b(returns)f(the)i(v)-5 b(alue)40
+b(of)f(x)h(if)f(x)g(is)g(not)120 2139 y(NULL,)31 b(otherwise)e(it)h
+(returns)f(the)i(v)-5 b(alue)30 b(of)g(y)-8 b(.)261 2252
+y(Bit)31 b(masks)g(can)g(b)s(e)f(used)g(to)h(select)h(out)f(ro)m(ws)g
+(from)f(bit)g(columns)f(\()p Fc(TFORMn)47 b(=)g(#X)p
+Fg(\))31 b(in)e(FITS)h(\014les.)120 2365 y(T)-8 b(o)31
+b(represen)m(t)f(the)h(mask,)f(binary)-8 b(,)30 b(o)s(ctal,)h(and)e
+(hex)i(formats)f(are)h(allo)m(w)m(ed:)931 2558 y Fc(binary:)142
+b(b0110xx1010000101xxxx00)o(01)931 2671 y(octal:)190
+b(o720x1)46 b(->)h(\(b111010000xxx001\))931 2784 y(hex:)286
+b(h0FxD)94 b(->)47 b(\(b00001111xxxx1101\))261 2978 y
+Fg(In)28 b(all)g(the)i(represen)m(tations,)f(an)g(x)g(or)g(X)g(is)f
+(allo)m(w)m(ed)h(in)f(the)h(mask)g(as)h(a)f(wild)e(card.)40
+b(Note)30 b(that)g(the)120 3091 y(x)i(represen)m(ts)f(a)h(di\013eren)m
+(t)f(n)m(um)m(b)s(er)g(of)h(wild)d(card)j(bits)e(in)g(eac)m(h)j
+(represen)m(tation.)45 b(All)30 b(represen)m(tations)120
+3204 y(are)h(case)g(insensitiv)m(e.)261 3317 y(T)-8 b(o)38
+b(construct)f(the)h(b)s(o)s(olean)e(expression)g(using)g(the)h(mask)h
+(as)f(the)h(b)s(o)s(olean)e(equal)h(op)s(erator)g(de-)120
+3430 y(scrib)s(ed)29 b(ab)s(o)m(v)m(e)i(on)g(a)g(bit)f(table)g(column.)
+40 b(F)-8 b(or)32 b(example,)e(if)g(y)m(ou)h(had)f(a)h(7)g(bit)e
+(column)h(named)g(\015ags)h(in)120 3543 y(a)36 b(FITS)e(table)i(and)f
+(w)m(an)m(ted)h(all)e(ro)m(ws)h(ha)m(ving)g(the)h(bit)e(pattern)i
+(0010011,)k(the)35 b(selection)h(expression)120 3656
+y(w)m(ould)29 b(b)s(e:)1456 3850 y Fc(flags)47 b(==)g(b0010011)311
+3962 y(or)1456 4075 y(flags)g(.eq.)f(b10011)261 4269
+y Fg(It)32 b(is)e(also)i(p)s(ossible)d(to)j(test)g(if)f(a)h(range)f(of)
+h(bits)e(is)h(less)g(than,)g(less)g(than)h(equal,)f(greater)i(than)e
+(and)120 4382 y(greater)h(than)e(equal)g(to)h(a)f(particular)f(b)s(o)s
+(olean)h(v)-5 b(alue:)1456 4576 y Fc(flags)47 b(<=)g(bxxx010xx)1456
+4689 y(flags)g(.gt.)f(bxxx100xx)1456 4802 y(flags)h(.le.)f(b1xxxxxxx)
+261 4996 y Fg(Notice)31 b(the)g(use)f(of)h(the)f(x)h(bit)e(v)-5
+b(alue)30 b(to)h(limit)d(the)j(range)f(of)h(bits)e(b)s(eing)g
+(compared.)261 5109 y(It)k(is)f(not)h(necessary)g(to)g(sp)s(ecify)f
+(the)g(leading)g(\(most)h(signi\014can)m(t\))f(zero)i(\(0\))g(bits)d
+(in)h(the)h(mask,)g(as)120 5222 y(sho)m(wn)d(in)f(the)h(second)h
+(expression)e(ab)s(o)m(v)m(e.)261 5334 y(Bit)h(wise)f(AND,)h(OR)g(and)f
+(NOT)g(op)s(erations)g(are)h(also)g(p)s(ossible)d(on)i(t)m(w)m(o)i(or)f
+(more)g(bit)f(\014elds)f(using)120 5447 y(the)38 b('&'\(AND\),)h(')p
+Fa(j)p Fg('\(OR\),)g(and)e(the)h(')10 b(!'\(NOT\))38
+b(op)s(erators.)63 b(All)36 b(of)i(these)g(op)s(erators)g(result)e(in)g
+(a)i(bit)120 5560 y(\014eld)29 b(whic)m(h)g(can)i(then)f(b)s(e)g(used)f
+(with)g(the)i(equal)f(op)s(erator.)41 b(F)-8 b(or)31
+b(example:)1905 5809 y(31)p eop
+%%Page: 32 32
+32 31 bop 1361 573 a Fc(\(!flags\))45 b(==)j(b1101100)1361
+686 y(\(flags)e(&)h(b1000001\))f(==)h(bx000001)261 887
+y Fg(Bit)35 b(\014elds)e(can)h(b)s(e)g(app)s(ended)f(as)i(w)m(ell)e
+(using)g(the)i('+')g(op)s(erator.)53 b(Strings)33 b(can)i(b)s(e)f
+(concatenated)120 1000 y(this)29 b(w)m(a)m(y)-8 b(,)32
+b(to)s(o.)120 1238 y Fh(5.4.3)105 b(Go)s(o)s(d)36 b(Time)e(In)m(terv)-6
+b(al)34 b(Filtering)120 1410 y Fg(A)27 b(common)g(\014ltering)e(metho)s
+(d)i(in)m(v)m(olv)m(es)g(selecting)g(ro)m(ws)f(whic)m(h)g(ha)m(v)m(e)i
+(a)g(time)e(v)-5 b(alue)27 b(whic)m(h)e(lies)h(within)120
+1523 y(what)38 b(is)e(called)h(a)h(Go)s(o)s(d)g(Time)e(In)m(terv)-5
+b(al)38 b(or)f(GTI.)h(The)f(time)h(in)m(terv)-5 b(als)36
+b(are)i(de\014ned)f(in)f(a)i(separate)120 1636 y(FITS)31
+b(table)h(extension)f(whic)m(h)g(con)m(tains)h(2)g(columns)e(giving)h
+(the)h(start)g(and)f(stop)h(time)g(of)g(eac)m(h)g(go)s(o)s(d)120
+1749 y(in)m(terv)-5 b(al.)59 b(The)37 b(\014ltering)e(op)s(eration)h
+(accepts)i(only)e(those)h(ro)m(ws)g(of)g(the)g(input)e(table)i(whic)m
+(h)e(ha)m(v)m(e)j(an)120 1861 y(asso)s(ciated)31 b(time)g(whic)m(h)f
+(falls)f(within)f(one)k(of)f(the)g(time)f(in)m(terv)-5
+b(als)30 b(de\014ned)g(in)g(the)h(GTI)f(extension.)42
+b(A)120 1974 y(high)28 b(lev)m(el)i(function,)f
+(gti\014lter\(a,b,c,d\),)i(is)d(a)m(v)-5 b(ailable)30
+b(whic)m(h)e(ev)-5 b(aluates)31 b(eac)m(h)g(ro)m(w)f(of)g(the)g(input)d
+(table)120 2087 y(and)j(returns)g(TR)m(UE)g(or)h(F)-10
+b(ALSE)30 b(dep)s(ending)f(whether)h(the)g(ro)m(w)h(is)f(inside)e(or)j
+(outside)f(the)h(go)s(o)s(d)g(time)120 2200 y(in)m(terv)-5
+b(al.)40 b(The)30 b(syn)m(tax)h(is)406 2401 y Fc(gtifilter\()45
+b([)j("gtifile")d([,)i(expr)g([,)g("STARTCOL",)e("STOPCOL")g(])j(])f(])
+g(\))120 2603 y Fg(where)35 b(eac)m(h)i("[]")g(demarks)e(optional)f
+(parameters.)57 b(Note)37 b(that)f(the)g(quotes)g(around)e(the)i
+(gti\014le)f(and)120 2716 y(ST)-8 b(AR)g(T/STOP)31 b(column)h(are)h
+(required.)45 b(Either)32 b(single)f(or)h(double)g(quote)h(c)m
+(haracters)h(ma)m(y)f(b)s(e)f(used.)120 2828 y(The)c(gti\014le,)g(if)f
+(sp)s(eci\014ed,)h(can)g(b)s(e)g(blank)f(\(""\))j(whic)m(h)d(will)f
+(mean)j(to)g(use)f(the)g(\014rst)g(extension)g(with)f(the)120
+2941 y(name)c("*GTI*")i(in)d(the)h(curren)m(t)g(\014le,)h(a)f(plain)e
+(extension)i(sp)s(eci\014er)f(\(eg,)k("+2",)f("[2]",)i(or)c
+("[STDGTI]"\))120 3054 y(whic)m(h)f(will)f(b)s(e)i(used)g(to)i(select)f
+(an)g(extension)f(in)f(the)i(curren)m(t)g(\014le,)g(or)g(a)g(regular)e
+(\014lename)h(with)g(or)g(with-)120 3167 y(out)j(an)g(extension)g(sp)s
+(eci\014er)e(whic)m(h)h(in)f(the)j(latter)f(case)h(will)c(mean)j(to)h
+(use)f(the)g(\014rst)f(extension)h(with)e(an)120 3280
+y(extension)29 b(name)h("*GTI*".)42 b(Expr)28 b(can)i(b)s(e)f(an)m(y)g
+(arithmetic)g(expression,)g(including)d(simply)h(the)j(time)120
+3393 y(column)j(name.)52 b(A)34 b(v)m(ector)i(time)e(expression)f(will)
+e(pro)s(duce)i(a)i(v)m(ector)g(b)s(o)s(olean)f(result.)50
+b(ST)-8 b(AR)g(TCOL)120 3506 y(and)33 b(STOPCOL)f(are)j(the)f(names)g
+(of)g(the)g(ST)-8 b(AR)g(T/STOP)33 b(columns)g(in)f(the)j(GTI)e
+(extension.)52 b(If)33 b(one)120 3619 y(of)e(them)f(is)f(sp)s
+(eci\014ed,)g(they)i(b)s(oth)e(m)m(ust)i(b)s(e.)261 3732
+y(In)37 b(its)h(simplest)e(form,)k(no)e(parameters)g(need)g(to)h(b)s(e)
+e(pro)m(vided)g({)h(default)g(v)-5 b(alues)37 b(will)e(b)s(e)j(used.)
+120 3845 y(The)30 b(expression)f Fc("gtifilter\(\)")e
+Fg(is)i(equiv)-5 b(alen)m(t)30 b(to)454 4046 y Fc(gtifilter\()45
+b("",)i(TIME,)f("*START*",)f("*STOP*")h(\))120 4247 y
+Fg(This)30 b(will)g(searc)m(h)j(the)f(curren)m(t)g(\014le)g(for)g(a)g
+(GTI)g(extension,)h(\014lter)e(the)h(TIME)g(column)f(in)g(the)i(curren)
+m(t)120 4360 y(table,)47 b(using)c(ST)-8 b(AR)g(T/STOP)43
+b(times)g(tak)m(en)i(from)e(columns)g(in)g(the)h(GTI)f(extension)h
+(with)e(names)120 4473 y(con)m(taining)30 b(the)h(strings)e("ST)-8
+b(AR)g(T")31 b(and)f("STOP".)41 b(The)30 b(wildcards)e(\('*'\))k(allo)m
+(w)e(sligh)m(t)f(v)-5 b(ariations)30 b(in)120 4586 y(naming)h(con)m(v)m
+(en)m(tions)h(suc)m(h)g(as)g("TST)-8 b(AR)g(T")32 b(or)g("ST)-8
+b(AR)g(TTIME".)45 b(The)31 b(same)i(default)e(v)-5 b(alues)31
+b(apply)120 4699 y(for)g(unsp)s(eci\014ed)e(parameters)j(when)e(the)i
+(\014rst)e(one)i(or)f(t)m(w)m(o)i(parameters)f(are)g(sp)s(eci\014ed.)42
+b(The)31 b(function)120 4812 y(automatically)41 b(searc)m(hes)g(for)g
+(TIMEZER)m(O/I/F)g(k)m(eyw)m(ords)g(in)e(the)i(curren)m(t)g(and)f(GTI)h
+(extensions,)120 4924 y(applying)28 b(a)j(relativ)m(e)f(time)h
+(o\013set,)g(if)f(necessary)-8 b(.)120 5163 y Fh(5.4.4)105
+b(Spatial)35 b(Region)h(Filtering)120 5334 y Fg(Another)f(common)h
+(\014ltering)e(metho)s(d)h(selects)g(ro)m(ws)h(based)f(on)g(whether)g
+(the)h(spatial)e(p)s(osition)f(asso-)120 5447 y(ciated)40
+b(with)f(eac)m(h)j(ro)m(w)e(is)f(lo)s(cated)h(within)e(a)i(giv)m(en)h
+(2-dimensional)d(region.)69 b(The)40 b(syn)m(tax)h(for)e(this)120
+5560 y(high-lev)m(el)29 b(\014lter)h(is)1905 5809 y(32)p
+eop
+%%Page: 33 33
+33 32 bop 454 573 a Fc(regfilter\()45 b("regfilename")f([)k(,)f(Xexpr,)
+f(Yexpr)h([)g(,)h("wcs)e(cols")h(])g(])g(\))120 757 y
+Fg(where)28 b(eac)m(h)i("[)g(]")f(demarks)g(optional)f(parameters.)40
+b(The)29 b(region)f(\014le)g(name)h(is)f(required)f(and)h(m)m(ust)h(b)s
+(e)120 870 y(enclosed)g(in)f(quotes.)41 b(The)29 b(remaining)e
+(parameters)j(are)f(optional.)40 b(The)29 b(region)g(\014le)f(is)g(an)i
+(ASCI)s(I)d(text)120 983 y(\014le)36 b(whic)m(h)f(con)m(tains)i(a)g
+(list)f(of)g(one)h(or)g(more)g(geometric)h(shap)s(es)d(\(circle,)k
+(ellipse,)d(b)s(o)m(x,)i(etc.\))62 b(whic)m(h)120 1096
+y(de\014nes)30 b(a)i(region)f(on)g(the)h(celestial)f(sphere)g(or)g(an)g
+(area)h(within)d(a)j(particular)e(2D)i(image.)44 b(The)31
+b(region)120 1209 y(\014le)37 b(is)g(t)m(ypically)g(generated)i(using)e
+(an)h(image)g(displa)m(y)f(program)h(suc)m(h)f(as)i(fv/PO)m(W)f
+(\(distribute)e(b)m(y)120 1322 y(the)c(HEASAR)m(C\),)g(or)g(ds9)g
+(\(distributed)d(b)m(y)i(the)h(Smithsonian)e(Astroph)m(ysical)g(Observ)
+-5 b(atory\).)46 b(Users)120 1435 y(should)40 b(refer)i(to)h(the)f(do)s
+(cumen)m(tation)g(pro)m(vided)f(with)g(these)h(programs)g(for)g(more)g
+(details)f(on)h(the)120 1548 y(syn)m(tax)31 b(used)e(in)h(the)g(region)
+g(\014les.)261 1661 y(In)35 b(its)g(simpliest)e(form,)k(\(e.g.,)i
+Fc(regfilter\("region.reg"\))30 b Fg(\))36 b(the)f(co)s(ordinates)h(in)
+e(the)i(default)120 1774 y('X')24 b(and)e('Y')i(columns)d(will)g(b)s(e)
+h(used)g(to)i(determine)e(if)g(eac)m(h)i(ro)m(w)f(is)f(inside)f(or)i
+(outside)f(the)h(area)h(sp)s(eci\014ed)120 1886 y(in)g(the)i(region)f
+(\014le.)38 b(Alternate)26 b(p)s(osition)d(column)h(names,)j(or)e
+(expressions,)g(ma)m(y)h(b)s(e)f(en)m(tered)h(if)e(needed,)120
+1999 y(as)31 b(in)502 2184 y Fc(regfilter\("region.reg",)41
+b(XPOS,)47 b(YPOS\))120 2368 y Fg(Region)38 b(\014ltering)f(can)h(b)s
+(e)g(applied)e(most)i(unam)m(biguously)e(if)h(the)h(p)s(ositions)f(in)f
+(the)j(region)f(\014le)f(and)120 2481 y(in)e(the)i(table)g(to)h(b)s(e)e
+(\014ltered)g(are)h(b)s(oth)f(giv)m(e)h(in)f(terms)g(of)h(absolute)g
+(celestial)f(co)s(ordinate)h(units.)58 b(In)120 2594
+y(this)37 b(case)i(the)g(lo)s(cations)f(and)f(sizes)h(of)h(the)f
+(geometric)h(shap)s(es)f(in)f(the)h(region)g(\014le)f(are)i(sp)s
+(eci\014ed)e(in)120 2707 y(angular)d(units)f(on)h(the)h(sky)f(\(e.g.,)j
+(p)s(ositions)c(giv)m(en)i(in)e(R.A.)i(and)f(Dec.)54
+b(and)34 b(sizes)g(in)f(arcseconds)i(or)120 2820 y(arcmin)m(utes\).)j
+(Similarly)-8 b(,)20 b(eac)m(h)j(ro)m(w)g(of)f(the)g(\014ltered)f
+(table)h(will)d(ha)m(v)m(e)k(a)g(celestial)e(co)s(ordinate)h(asso)s
+(ciated)120 2933 y(with)32 b(it.)50 b(This)32 b(asso)s(ciation)h(is)g
+(usually)e(implemen)m(ted)h(using)h(a)g(set)i(of)e(so-called)h('W)-8
+b(orld)33 b(Co)s(ordinate)120 3046 y(System')j(\(or)h(W)m(CS\))f(FITS)f
+(k)m(eyw)m(ords)i(that)f(de\014ne)g(the)g(co)s(ordinate)g
+(transformation)f(that)i(m)m(ust)f(b)s(e)120 3159 y(applied)28
+b(to)j(the)g(v)-5 b(alues)30 b(in)f(the)h('X')h(and)f('Y')h(columns)e
+(to)i(calculate)g(the)f(co)s(ordinate.)261 3272 y(Alternativ)m(ely)-8
+b(,)37 b(one)f(can)f(p)s(erform)f(spatial)h(\014ltering)e(using)h
+(unitless)g('pixel')g(co)s(ordinates)h(for)g(the)120
+3385 y(regions)30 b(and)g(ro)m(w)h(p)s(ositions.)40 b(In)30
+b(this)f(case)j(the)f(user)f(m)m(ust)h(b)s(e)f(careful)g(to)h(ensure)f
+(that)h(the)g(p)s(ositions)120 3498 y(in)h(the)h(2)h(\014les)e(are)i
+(self-consisten)m(t.)49 b(A)34 b(t)m(ypical)e(problem)g(is)g(that)i
+(the)g(region)f(\014le)f(ma)m(y)i(b)s(e)e(generated)120
+3610 y(using)22 b(a)i(binned)e(image,)j(but)e(the)h(un)m(binned)d(co)s
+(ordinates)i(are)i(giv)m(en)e(in)g(the)h(ev)m(en)m(t)h(table.)38
+b(The)24 b(R)m(OSA)-8 b(T)120 3723 y(ev)m(en)m(ts)34
+b(\014les,)f(for)g(example,)h(ha)m(v)m(e)g(X)f(and)g(Y)g(pixel)e(co)s
+(ordinates)i(that)h(range)f(from)g(1)g(-)h(15360.)51
+b(These)120 3836 y(co)s(ordinates)32 b(are)h(t)m(ypically)f(binned)e(b)
+m(y)j(a)g(factor)g(of)g(32)h(to)f(pro)s(duce)f(a)h(480x480)i(pixel)c
+(image.)48 b(If)32 b(one)120 3949 y(then)f(uses)g(a)g(region)g(\014le)f
+(generated)j(from)d(this)g(image)i(\(in)e(image)h(pixel)f(units\))g(to)
+i(\014lter)e(the)i(R)m(OSA)-8 b(T)120 4062 y(ev)m(en)m(ts)33
+b(\014le,)e(then)g(the)g(X)g(and)g(Y)h(column)e(v)-5
+b(alues)30 b(m)m(ust)i(b)s(e)e(con)m(v)m(erted)j(to)f(corresp)s(onding)
+d(pixel)h(units)120 4175 y(as)h(in:)502 4360 y Fc
+(regfilter\("rosat.reg",)42 b(X/32.+.5,)j(Y/32.+.5\))120
+4544 y Fg(Note)30 b(that)f(this)e(binning)f(con)m(v)m(ersion)i(is)g
+(not)h(necessary)g(if)e(the)i(region)f(\014le)f(is)h(sp)s(eci\014ed)f
+(using)g(celestial)120 4657 y(co)s(ordinate)g(units)f(instead)g(of)h
+(pixel)f(units)f(b)s(ecause)i(CFITSIO)f(is)g(then)h(able)g(to)h
+(directly)d(compare)j(the)120 4770 y(celestial)34 b(co)s(ordinate)g(of)
+g(eac)m(h)h(ro)m(w)f(in)f(the)h(table)g(with)f(the)h(celestial)g(co)s
+(ordinates)g(in)e(the)j(region)e(\014le)120 4883 y(without)c(ha)m(ving)
+h(to)h(kno)m(w)g(an)m(ything)f(ab)s(out)g(ho)m(w)g(the)h(image)f(ma)m
+(y)h(ha)m(v)m(e)h(b)s(een)d(binned.)261 4996 y(The)k(last)g("w)m(cs)g
+(cols")h(parameter)f(should)e(rarely)h(b)s(e)h(needed.)48
+b(If)33 b(supplied,)d(this)i(string)g(con)m(tains)120
+5109 y(the)39 b(names)g(of)h(the)f(2)g(columns)f(\(space)i(or)f(comma)h
+(separated\))g(whic)m(h)e(ha)m(v)m(e)i(the)g(asso)s(ciated)f(W)m(CS)120
+5222 y(k)m(eyw)m(ords.)k(If)30 b(not)h(supplied,)d(the)j(\014lter)f
+(will)e(scan)j(the)g(X)g(and)g(Y)g(expressions)e(for)i(column)f(names.)
+42 b(If)120 5334 y(only)32 b(one)g(is)g(found)f(in)g(eac)m(h)j
+(expression,)e(those)h(columns)e(will)f(b)s(e)i(used,)h(otherwise)f(an)
+g(error)g(will)e(b)s(e)120 5447 y(returned.)261 5560
+y(These)g(region)g(shap)s(es)g(are)g(supp)s(orted)f(\(names)i(are)f
+(case)i(insensitiv)m(e\):)1905 5809 y(33)p eop
+%%Page: 34 34
+34 33 bop 454 573 a Fc(Point)428 b(\()48 b(X1,)f(Y1)g(\))715
+b(<-)48 b(One)f(pixel)f(square)g(region)454 686 y(Line)476
+b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2)i(\))333 b(<-)48 b(One)f(pixel)f(wide)h
+(region)454 799 y(Polygon)332 b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2,)h(...)g
+(\))95 b(<-)48 b(Rest)e(are)h(interiors)e(with)454 912
+y(Rectangle)236 b(\()48 b(X1,)f(Y1,)g(X2,)f(Y2,)h(A)h(\))334
+b(|)47 b(boundaries)e(considered)454 1024 y(Box)524 b(\()48
+b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)i(\))143 b(V)47 b(within)f(the)h
+(region)454 1137 y(Diamond)332 b(\()48 b(Xc,)f(Yc,)g(Wdth,)f(Hght,)g(A)
+i(\))454 1250 y(Circle)380 b(\()48 b(Xc,)f(Yc,)g(R)g(\))454
+1363 y(Annulus)332 b(\()48 b(Xc,)f(Yc,)g(Rin,)f(Rout)h(\))454
+1476 y(Ellipse)332 b(\()48 b(Xc,)f(Yc,)g(Rx,)f(Ry,)h(A)h(\))454
+1589 y(Elliptannulus)c(\()k(Xc,)f(Yc,)g(Rinx,)f(Riny,)g(Routx,)g
+(Routy,)g(Ain,)h(Aout)g(\))454 1702 y(Sector)380 b(\()48
+b(Xc,)f(Yc,)g(Amin,)f(Amax)h(\))120 1914 y Fg(where)33
+b(\(Xc,Yc\))j(is)d(the)i(co)s(ordinate)e(of)i(the)f(shap)s(e's)f(cen)m
+(ter;)k(\(X#,Y#\))e(are)f(the)g(co)s(ordinates)g(of)g(the)120
+2027 y(shap)s(e's)22 b(edges;)k(Rxxx)d(are)g(the)h(shap)s(es')e(v)-5
+b(arious)22 b(Radii)f(or)i(semima)5 b(jor/minor)21 b(axes;)27
+b(and)22 b(Axxx)h(are)g(the)120 2140 y(angles)i(of)g(rotation)g(\(or)g
+(b)s(ounding)d(angles)j(for)g(Sector\))h(in)d(degrees.)40
+b(F)-8 b(or)26 b(rotated)g(shap)s(es,)f(the)g(rotation)120
+2253 y(angle)36 b(can)h(b)s(e)e(left)h(o\013,)i(indicating)c(no)i
+(rotation.)59 b(Common)35 b(alternate)i(names)f(for)g(the)g(regions)g
+(can)120 2366 y(also)27 b(b)s(e)f(used:)39 b(rotb)s(o)m(x)27
+b(=)f(b)s(o)m(x;)j(rotrectangle)f(=)f(rectangle;)i(\(rot\)rhom)m(bus)d
+(=)h(\(rot\)diamond;)h(and)e(pie)120 2479 y(=)h(sector.)41
+b(When)28 b(a)g(shap)s(e's)f(name)g(is)g(preceded)g(b)m(y)h(a)g(min)m
+(us)e(sign,)i('-',)h(the)f(de\014ned)e(region)h(is)g(instead)120
+2592 y(the)36 b(area)g(*outside*)g(its)f(b)s(oundary)e(\(ie,)k(the)f
+(region)f(is)g(in)m(v)m(erted\).)56 b(All)34 b(the)i(shap)s(es)f
+(within)e(a)j(single)120 2705 y(region)e(\014le)g(are)h(OR'd)g
+(together)h(to)f(create)i(the)e(region,)g(and)g(the)g(order)f(is)g
+(signi\014can)m(t.)53 b(The)34 b(o)m(v)m(erall)120 2818
+y(w)m(a)m(y)g(of)g(lo)s(oking)e(at)i(region)f(\014les)f(is)g(that)i(if)
+e(the)i(\014rst)e(region)h(is)g(an)g(excluded)f(region)h(then)g(a)g
+(dumm)m(y)120 2931 y(included)27 b(region)j(of)g(the)g(whole)f
+(detector)j(is)d(inserted)f(in)h(the)h(fron)m(t.)41 b(Then)29
+b(eac)m(h)i(region)f(sp)s(eci\014cation)120 3044 y(as)h(it)g(is)f(pro)s
+(cessed)h(o)m(v)m(errides)g(an)m(y)g(selections)g(inside)e(of)i(that)h
+(region)f(sp)s(eci\014ed)e(b)m(y)i(previous)f(regions.)120
+3156 y(Another)f(w)m(a)m(y)i(of)e(thinking)e(ab)s(out)i(this)f(is)h
+(that)g(if)g(a)g(previous)f(excluded)g(region)h(is)g(completely)g
+(inside)120 3269 y(of)i(a)f(subsequen)m(t)g(included)e(region)i(the)g
+(excluded)f(region)h(is)g(ignored.)261 3382 y(The)20
+b(p)s(ositional)e(co)s(ordinates)i(ma)m(y)h(b)s(e)e(giv)m(en)i(either)e
+(in)g(pixel)g(units,)i(decimal)e(degrees)i(or)f(hh:mm:ss.s,)120
+3495 y(dd:mm:ss.s)25 b(units.)37 b(The)26 b(shap)s(e)f(sizes)g(ma)m(y)i
+(b)s(e)e(giv)m(en)h(in)e(pixels,)i(degrees,)h(arcmin)m(utes,)g(or)f
+(arcseconds.)120 3608 y(Lo)s(ok)k(at)i(examples)d(of)i(region)f(\014le)
+f(pro)s(duced)g(b)m(y)h(fv/PO)m(W)h(or)f(ds9)g(for)g(further)f(details)
+h(of)g(the)h(region)120 3721 y(\014le)e(format.)120 3961
+y Fh(5.4.5)105 b(Example)34 b(Ro)m(w)h(Filters)311 4133
+y Fc([double)46 b(&&)h(mag)g(<=)g(5.0])381 b(-)95 b(Extract)46
+b(all)h(double)f(stars)g(brighter)1886 4246 y(than)94
+b(fifth)47 b(magnitude)311 4472 y([#row)f(>=)h(125)g(&&)h(#row)e(<=)h
+(175])142 b(-)48 b(Extract)e(row)h(numbers)e(125)i(through)f(175)311
+4697 y([abs\(sin\(theta)e(*)j(#deg\)\))f(<)i(0.5])e(-)i(Extract)e(all)h
+(rows)f(having)g(the)1886 4810 y(absolute)f(value)i(of)g(the)g(sine)g
+(of)g(theta)1886 4923 y(less)94 b(than)47 b(a)g(half)g(where)f(the)h
+(angles)1886 5036 y(are)g(tabulated)e(in)i(degrees)311
+5262 y([@rowFilter.txt])711 b(-)48 b(Extract)e(rows)g(using)h(the)g
+(expression)1886 5375 y(contained)e(within)h(the)h(text)g(file)1886
+5488 y(rowFilter.txt)1905 5809 y Fg(34)p eop
+%%Page: 35 35
+35 34 bop 311 686 a Fc([gtifilter\(\)])855 b(-)48 b(Search)e(the)h
+(current)f(file)g(for)h(a)h(GTI)359 799 y(extension,)92
+b(filter)i(the)47 b(TIME)359 912 y(column)f(in)h(the)g(current)f
+(table,)g(using)359 1024 y(START/STOP)f(times)h(taken)g(from)359
+1137 y(columns)f(in)j(the)f(GTI)94 b(extension)311 1363
+y([regfilter\("pow.reg"\)])423 b(-)48 b(Extract)e(rows)g(which)h(have)f
+(a)i(coordinate)1886 1476 y(\(as)f(given)f(in)h(the)g(X)h(and)f(Y)g
+(columns\))1886 1589 y(within)f(the)h(spatial)f(region)g(specified)1886
+1702 y(in)h(the)g(pow.reg)f(region)g(file.)1905 5809
+y Fg(35)p eop
+%%Page: 36 36
+36 35 bop 120 573 a Fb(5.5)112 b(Com)m(bined)37 b(Filtering)e(Examples)
+120 744 y Fg(The)29 b(previous)g(sections)g(describ)s(ed)f(all)h(the)h
+(individual)25 b(t)m(yp)s(es)30 b(of)g(\014lters)e(that)j(ma)m(y)f(b)s
+(e)f(applied)f(to)i(the)120 857 y(input)i(\014le.)49
+b(In)33 b(this)f(section)i(w)m(e)g(sho)m(w)g(examples)f(whic)m(h)f(com)
+m(bine)i(sev)m(eral)f(di\013eren)m(t)h(\014lters)e(at)i(once.)120
+970 y(These)h(examples)f(all)g(use)h(the)g Fc(fitscopy)e
+Fg(program)i(that)g(is)f(distributed)e(with)i(the)h(CFITSIO)f(co)s(de.)
+120 1083 y(It)c(simply)e(copies)j(the)f(input)f(\014le)g(to)i(the)g
+(output)f(\014le.)120 1268 y Fc(fitscopy)46 b(rosat.fit)f(out.fit)261
+1453 y Fg(This)25 b(trivial)g(example)h(simply)f(mak)m(es)i(an)g(iden)m
+(tical)f(cop)m(y)h(of)g(the)g(input)e(rosat.\014t)i(\014le)f(without)g
+(an)m(y)120 1566 y(\014ltering.)120 1751 y Fc(fitscopy)46
+b('rosat.fit[events][col)41 b(Time;X;Y][#row)j(<)k(1000]')e(out.fit)261
+1936 y Fg(The)34 b(output)g(\014le)g(con)m(tains)h(only)e(the)i(Time,)g
+(X,)g(and)e(Y)i(columns,)g(and)e(only)h(the)h(\014rst)f(999)h(ro)m(ws)
+120 2049 y(from)g(the)g('EVENTS')f(table)h(extension)g(of)g(the)g
+(input)e(\014le.)54 b(All)33 b(the)j(other)f(HDUs)g(in)f(the)h(input)e
+(\014le)120 2162 y(are)e(copied)f(to)h(the)f(output)g(\014le)g(without)
+f(an)m(y)i(mo)s(di\014cation.)120 2346 y Fc(fitscopy)46
+b('rosat.fit[events][PI)c(<)47 b(50][bin)f(\(Xdet,Ydet\))f(=)i(16]')g
+(image.fit)261 2531 y Fg(This)29 b(creates)i(an)f(output)g(image)h(b)m
+(y)f(binning)d(the)j(Xdet)h(and)f(Ydet)g(columns)f(of)h(the)h(ev)m(en)m
+(ts)g(table)120 2644 y(with)25 b(a)i(pixel)e(binning)e(factor)k(of)g
+(16.)40 b(Only)25 b(the)i(ro)m(ws)f(whic)m(h)f(ha)m(v)m(e)j(a)e(PI)h
+(energy)f(less)g(than)g(50)h(are)g(used)120 2757 y(to)33
+b(construct)f(this)e(image.)45 b(The)32 b(output)f(image)h(\014le)f
+(con)m(tains)h(a)g(primary)e(arra)m(y)i(image)g(without)f(an)m(y)120
+2870 y(extensions.)120 3055 y Fc(fitscopy)46 b('rosat.fit[events][gtif)
+o(ilt)o(er\(\))41 b(&&)47 b(regfilter\("pow.reg"\)]')42
+b(out.fit)261 3240 y Fg(The)29 b(\014ltering)f(expression)g(in)g(this)h
+(example)g(uses)g(the)h Fc(gtifilter)d Fg(function)h(to)i(test)g
+(whether)f(the)120 3353 y(TIME)e(column)f(v)-5 b(alue)26
+b(in)g(eac)m(h)j(ro)m(w)e(is)f(within)f(one)i(of)g(the)h(Go)s(o)s(d)f
+(Time)f(In)m(terv)-5 b(als)26 b(de\014ned)g(in)g(the)i(GTI)120
+3466 y(extension)h(in)f(the)i(same)g(input)d(\014le,)i(and)g(also)h
+(uses)f(the)g Fc(regfilter)e Fg(function)i(to)h(test)g(if)f(the)g(p)s
+(osition)120 3579 y(asso)s(ciated)i(with)d(eac)m(h)j(ro)m(w)g(\(deriv)m
+(ed)e(b)m(y)h(default)f(from)h(the)g(v)-5 b(alues)29
+b(in)g(the)h(X)h(and)e(Y)h(columns)f(of)h(the)120 3692
+y(ev)m(en)m(ts)38 b(table\))e(is)g(lo)s(cated)h(within)c(the)k(area)g
+(de\014ned)e(in)h(the)g Fc(pow.reg)f Fg(text)i(region)f(\014le)f
+(\(whic)m(h)h(w)m(as)120 3804 y(previously)g(created)k(with)e(the)g
+Fc(fv/POW)f Fg(image)i(displa)m(y)e(program\).)66 b(Only)37
+b(the)i(ro)m(ws)f(whic)m(h)g(satisfy)120 3917 y(b)s(oth)30
+b(tests)h(are)g(copied)e(to)i(the)g(output)f(table.)120
+4102 y Fc(fitscopy)46 b('r.fit[evt][PI<50]')c(stdout)k(|)i(fitscopy)d
+(stdin[evt][col)f(X,Y])j(out.fit)261 4287 y Fg(In)25
+b(this)f(somewhat)i(con)m(v)m(oluted)f(example,)i(\014tscop)m(y)e(is)g
+(used)f(to)i(\014rst)f(select)h(the)f(ro)m(ws)g(from)g(the)h(evt)120
+4400 y(extension)j(whic)m(h)g(ha)m(v)m(e)i(PI)e(less)g(than)h(50)g(and)
+f(write)g(the)h(resulting)e(table)i(out)g(to)g(the)g(stdout)g(stream.)
+120 4513 y(This)36 b(is)g(pip)s(ed)f(to)j(a)g(2nd)f(instance)g(of)h
+(\014tscop)m(y)g(\(with)e(the)i(Unix)e(`)p Fa(j)p Fg(')i(pip)s(e)e
+(command\))h(whic)m(h)g(reads)120 4626 y(that)31 b(\014ltered)f(FITS)f
+(\014le)h(from)g(the)h(stdin)e(stream)i(and)f(copies)g(only)g(the)h(X)f
+(and)g(Y)h(columns)e(from)h(the)120 4739 y(evt)h(table)f(to)h(the)g
+(output)f(\014le.)120 4924 y Fc(fitscopy)46 b('r.fit[evt][col)d
+(RAD=sqrt\(\(X-#XCEN\)**2+\(Y-)o(#YCE)o(N\)*)o(*2\)])o([rad)o(<10)o
+(0]')e(out.fit)261 5109 y Fg(This)23 b(example)i(\014rst)f(creates)i(a)
+f(new)f(column)g(called)g(RAD)h(whic)m(h)e(giv)m(es)i(the)g(distance)g
+(b)s(et)m(w)m(een)g(the)120 5222 y(X,Y)k(co)s(ordinate)f(of)g(eac)m(h)i
+(ev)m(en)m(t)g(and)d(the)i(co)s(ordinate)f(de\014ned)f(b)m(y)h(the)h(X)
+m(CEN)f(and)g(YCEN)g(k)m(eyw)m(ords)120 5334 y(in)j(the)i(header.)47
+b(Then,)32 b(only)g(those)h(ro)m(ws)g(whic)m(h)e(ha)m(v)m(e)j(a)f
+(distance)f(less)g(than)g(100)i(are)f(copied)f(to)h(the)120
+5447 y(output)e(table.)45 b(In)31 b(other)h(w)m(ords,)f(only)g(the)h
+(ev)m(en)m(ts)h(whic)m(h)e(are)h(lo)s(cated)g(within)d(100)k(pixel)d
+(units)g(from)120 5560 y(the)h(\(X)m(CEN,)g(YCEN\))f(co)s(ordinate)h
+(are)f(copied)g(to)h(the)g(output)f(table.)1905 5809
+y(36)p eop
+%%Page: 37 37
+37 36 bop 120 573 a Fc(fitscopy)46 b('ftp://heasarc.gsfc.nas)o(a.g)o
+(ov/r)o(osat)o(.fi)o(t[ev)o(ents)o(][b)o(in)c(\(X,Y\)=16]')j(img.fit)
+261 785 y Fg(This)22 b(example)h(bins)e(the)i(X)h(and)f(Y)g(columns)f
+(of)h(the)h(h)m(yp)s(othetical)e(R)m(OSA)-8 b(T)24 b(\014le)e(at)i(the)
+f(HEASAR)m(C)120 898 y(ftp)30 b(site)g(to)h(create)h(the)f(output)f
+(image.)120 1111 y Fc(fitscopy)46 b('raw.fit[i512,512][101:)o(110)o
+(,51:)o(60]')41 b(image.fit)261 1323 y Fg(This)28 b(example)h(con)m(v)m
+(erts)i(the)e(512)i(x)e(512)i(pixel)d(ra)m(w)h(binary)f(16-bit)h(in)m
+(teger)h(image)g(to)g(a)g(FITS)e(\014le)120 1436 y(and)i(copies)g(a)h
+(10)g(x)f(10)h(pixel)e(subimage)h(from)g(it)f(to)j(the)e(output)g(FITS)
+g(image.)1905 5809 y(37)p eop
+%%Page: 38 38
+38 37 bop 120 573 a Fi(6)135 b(CFITSIO)44 b(Error)h(Status)g(Co)t(des)
+120 776 y Fg(The)34 b(follo)m(wing)e(table)i(lists)f(all)g(the)h(error)
+g(status)g(co)s(des)h(used)e(b)m(y)h(CFITSIO.)f(Programmers)h(are)g
+(en-)120 889 y(couraged)f(to)g(use)g(the)f(sym)m(b)s(olic)f(mnemonics)h
+(\(de\014ned)f(in)g(the)i(\014le)f(\014tsio.h\))g(rather)g(than)g(the)h
+(actual)120 1002 y(in)m(teger)e(status)f(v)-5 b(alues)30
+b(to)h(impro)m(v)m(e)f(the)h(readabilit)m(y)e(of)h(their)g(co)s(de.)168
+1214 y Fc(Symbolic)45 b(Const)190 b(Value)237 b(Meaning)168
+1327 y(--------------)187 b(-----)94 b(------------------------)o(----)
+o(---)o(----)o(----)o(--)1122 1440 y(0)191 b(OK,)47 b(no)g(error)168
+1553 y(SAME_FILE)427 b(101)190 b(input)46 b(and)h(output)f(files)h(are)
+g(the)f(same)168 1666 y(TOO_MANY_FILES)187 b(103)j(tried)46
+b(to)h(open)g(too)g(many)g(FITS)f(files)h(at)g(once)168
+1779 y(FILE_NOT_OPENED)139 b(104)190 b(could)46 b(not)h(open)g(the)g
+(named)f(file)168 1892 y(FILE_NOT_CREATED)91 b(105)190
+b(could)46 b(not)h(create)f(the)h(named)g(file)168 2005
+y(WRITE_ERROR)331 b(106)190 b(error)46 b(writing)g(to)h(FITS)g(file)168
+2117 y(END_OF_FILE)331 b(107)190 b(tried)46 b(to)h(move)g(past)g(end)g
+(of)g(file)168 2230 y(READ_ERROR)379 b(108)190 b(error)46
+b(reading)g(from)h(FITS)f(file)168 2343 y(FILE_NOT_CLOSED)139
+b(110)190 b(could)46 b(not)h(close)g(the)f(file)168 2456
+y(ARRAY_TOO_BIG)235 b(111)190 b(array)46 b(dimensions)f(exceed)h
+(internal)g(limit)168 2569 y(READONLY_FILE)235 b(112)190
+b(Cannot)46 b(write)g(to)i(readonly)d(file)168 2682 y
+(MEMORY_ALLOCATION)e(113)190 b(Could)46 b(not)h(allocate)f(memory)168
+2795 y(BAD_FILEPTR)331 b(114)190 b(invalid)46 b(fitsfile)f(pointer)168
+2908 y(NULL_INPUT_PTR)187 b(115)j(NULL)47 b(input)f(pointer)g(to)h
+(routine)168 3021 y(SEEK_ERROR)379 b(116)190 b(error)46
+b(seeking)g(position)g(in)h(file)168 3247 y(BAD_URL_PREFIX)235
+b(121)142 b(invalid)46 b(URL)h(prefix)f(on)h(file)g(name)168
+3359 y(TOO_MANY_DRIVERS)139 b(122)j(tried)46 b(to)h(register)f(too)h
+(many)g(IO)g(drivers)168 3472 y(DRIVER_INIT_FAILED)c(123)142
+b(driver)46 b(initialization)e(failed)168 3585 y(NO_MATCHING_DRIVER)f
+(124)142 b(matching)45 b(driver)i(is)g(not)g(registered)168
+3698 y(URL_PARSE_ERROR)187 b(125)142 b(failed)46 b(to)h(parse)g(input)f
+(file)h(URL)168 3924 y(SHARED_BADARG)235 b(151)190 b(bad)47
+b(argument)e(in)j(shared)e(memory)g(driver)168 4037 y(SHARED_NULPTR)235
+b(152)190 b(null)47 b(pointer)e(passed)h(as)i(an)f(argument)168
+4150 y(SHARED_TABFULL)187 b(153)j(no)47 b(more)g(free)f(shared)g
+(memory)h(handles)168 4263 y(SHARED_NOTINIT)187 b(154)j(shared)46
+b(memory)g(driver)g(is)h(not)g(initialized)168 4376 y(SHARED_IPCERR)235
+b(155)190 b(IPC)47 b(error)f(returned)g(by)h(a)g(system)f(call)168
+4489 y(SHARED_NOMEM)283 b(156)190 b(no)47 b(memory)f(in)h(shared)f
+(memory)h(driver)168 4601 y(SHARED_AGAIN)283 b(157)190
+b(resource)45 b(deadlock)h(would)g(occur)168 4714 y(SHARED_NOFILE)235
+b(158)190 b(attempt)46 b(to)h(open/create)e(lock)h(file)h(failed)168
+4827 y(SHARED_NORESIZE)139 b(159)190 b(shared)46 b(memory)g(block)g
+(cannot)h(be)g(resized)f(at)h(the)g(moment)168 5053 y(HEADER_NOT_EMPTY)
+91 b(201)190 b(header)46 b(already)g(contains)f(keywords)168
+5166 y(KEY_NO_EXIST)283 b(202)190 b(keyword)46 b(not)h(found)f(in)h
+(header)168 5279 y(KEY_OUT_BOUNDS)187 b(203)j(keyword)46
+b(record)g(number)g(is)h(out)g(of)g(bounds)168 5392 y(VALUE_UNDEFINED)
+139 b(204)190 b(keyword)46 b(value)g(field)g(is)i(blank)168
+5505 y(NO_QUOTE)475 b(205)190 b(string)46 b(is)h(missing)f(the)h
+(closing)f(quote)1905 5809 y Fg(38)p eop
+%%Page: 39 39
+39 38 bop 168 573 a Fc(BAD_KEYCHAR)331 b(207)190 b(illegal)46
+b(character)f(in)i(keyword)f(name)h(or)g(card)168 686
+y(BAD_ORDER)427 b(208)190 b(required)45 b(keywords)h(out)h(of)g(order)
+168 799 y(NOT_POS_INT)331 b(209)190 b(keyword)46 b(value)g(is)h(not)g
+(a)h(positive)d(integer)168 912 y(NO_END)571 b(210)190
+b(couldn't)45 b(find)i(END)g(keyword)168 1024 y(BAD_BITPIX)379
+b(211)190 b(illegal)46 b(BITPIX)g(keyword)g(value)168
+1137 y(BAD_NAXIS)427 b(212)190 b(illegal)46 b(NAXIS)g(keyword)g(value)
+168 1250 y(BAD_NAXES)427 b(213)190 b(illegal)46 b(NAXISn)g(keyword)g
+(value)168 1363 y(BAD_PCOUNT)379 b(214)190 b(illegal)46
+b(PCOUNT)g(keyword)g(value)168 1476 y(BAD_GCOUNT)379
+b(215)190 b(illegal)46 b(GCOUNT)g(keyword)g(value)168
+1589 y(BAD_TFIELDS)331 b(216)190 b(illegal)46 b(TFIELDS)g(keyword)f
+(value)168 1702 y(NEG_WIDTH)427 b(217)190 b(negative)45
+b(table)i(row)g(size)168 1815 y(NEG_ROWS)475 b(218)190
+b(negative)45 b(number)i(of)g(rows)f(in)i(table)168 1928
+y(COL_NOT_FOUND)235 b(219)190 b(column)46 b(with)h(this)f(name)h(not)g
+(found)f(in)h(table)168 2041 y(BAD_SIMPLE)379 b(220)190
+b(illegal)46 b(value)g(of)h(SIMPLE)f(keyword)168 2154
+y(NO_SIMPLE)427 b(221)190 b(Primary)46 b(array)g(doesn't)g(start)g
+(with)h(SIMPLE)168 2267 y(NO_BITPIX)427 b(222)190 b(Second)46
+b(keyword)g(not)h(BITPIX)168 2379 y(NO_NAXIS)475 b(223)190
+b(Third)46 b(keyword)g(not)h(NAXIS)168 2492 y(NO_NAXES)475
+b(224)190 b(Couldn't)45 b(find)i(all)g(the)g(NAXISn)f(keywords)168
+2605 y(NO_XTENSION)331 b(225)190 b(HDU)47 b(doesn't)f(start)g(with)h
+(XTENSION)e(keyword)168 2718 y(NOT_ATABLE)379 b(226)190
+b(the)47 b(CHDU)f(is)i(not)f(an)g(ASCII)f(table)g(extension)168
+2831 y(NOT_BTABLE)379 b(227)190 b(the)47 b(CHDU)f(is)i(not)f(a)g
+(binary)f(table)g(extension)168 2944 y(NO_PCOUNT)427
+b(228)190 b(couldn't)45 b(find)i(PCOUNT)f(keyword)168
+3057 y(NO_GCOUNT)427 b(229)190 b(couldn't)45 b(find)i(GCOUNT)f(keyword)
+168 3170 y(NO_TFIELDS)379 b(230)190 b(couldn't)45 b(find)i(TFIELDS)f
+(keyword)168 3283 y(NO_TBCOL)475 b(231)190 b(couldn't)45
+b(find)i(TBCOLn)f(keyword)168 3396 y(NO_TFORM)475 b(232)190
+b(couldn't)45 b(find)i(TFORMn)f(keyword)168 3509 y(NOT_IMAGE)427
+b(233)190 b(the)47 b(CHDU)f(is)i(not)f(an)g(IMAGE)f(extension)168
+3621 y(BAD_TBCOL)427 b(234)190 b(TBCOLn)46 b(keyword)g(value)g(<)i(0)f
+(or)g(>)h(rowlength)168 3734 y(NOT_TABLE)427 b(235)190
+b(the)47 b(CHDU)f(is)i(not)f(a)g(table)168 3847 y(COL_TOO_WIDE)283
+b(236)190 b(column)46 b(is)h(too)g(wide)g(to)g(fit)g(in)g(table)168
+3960 y(COL_NOT_UNIQUE)187 b(237)j(more)47 b(than)f(1)i(column)e(name)g
+(matches)g(template)168 4073 y(BAD_ROW_WIDTH)235 b(241)190
+b(sum)47 b(of)g(column)f(widths)g(not)h(=)h(NAXIS1)168
+4186 y(UNKNOWN_EXT)331 b(251)190 b(unrecognizable)44
+b(FITS)i(extension)g(type)168 4299 y(UNKNOWN_REC)331
+b(252)190 b(unknown)46 b(record;)g(1st)g(keyword)g(not)h(SIMPLE)f(or)h
+(XTENSION)168 4412 y(END_JUNK)475 b(253)190 b(END)47
+b(keyword)f(is)h(not)g(blank)168 4525 y(BAD_HEADER_FILL)139
+b(254)190 b(Header)46 b(fill)h(area)f(contains)g(non-blank)f(chars)168
+4638 y(BAD_DATA_FILL)235 b(255)190 b(Illegal)46 b(data)g(fill)h(bytes)f
+(\(not)h(zero)g(or)g(blank\))168 4751 y(BAD_TFORM)427
+b(261)190 b(illegal)46 b(TFORM)g(format)g(code)168 4863
+y(BAD_TFORM_DTYPE)139 b(262)190 b(unrecognizable)44 b(TFORM)i(datatype)
+g(code)168 4976 y(BAD_TDIM)475 b(263)190 b(illegal)46
+b(TDIMn)g(keyword)g(value)168 5089 y(BAD_HEAP_PTR)283
+b(264)190 b(invalid)46 b(BINTABLE)f(heap)i(pointer)f(is)h(out)g(of)g
+(range)168 5315 y(BAD_HDU_NUM)331 b(301)190 b(HDU)47
+b(number)f(<)h(1)h(or)f(>)g(MAXHDU)168 5428 y(BAD_COL_NUM)331
+b(302)190 b(column)46 b(number)g(<)i(1)f(or)g(>)h(tfields)168
+5541 y(NEG_FILE_POS)283 b(304)190 b(tried)46 b(to)h(move)g(to)g
+(negative)f(byte)g(location)g(in)h(file)1905 5809 y Fg(39)p
+eop
+%%Page: 40 40
+40 39 bop 168 573 a Fc(NEG_BYTES)427 b(306)190 b(tried)46
+b(to)h(read)g(or)g(write)g(negative)e(number)h(of)h(bytes)168
+686 y(BAD_ROW_NUM)331 b(307)190 b(illegal)46 b(starting)f(row)i(number)
+f(in)h(table)168 799 y(BAD_ELEM_NUM)283 b(308)190 b(illegal)46
+b(starting)f(element)h(number)g(in)h(vector)168 912 y(NOT_ASCII_COL)235
+b(309)190 b(this)47 b(is)g(not)g(an)g(ASCII)f(string)g(column)168
+1024 y(NOT_LOGICAL_COL)139 b(310)190 b(this)47 b(is)g(not)g(a)g
+(logical)f(datatype)f(column)168 1137 y(BAD_ATABLE_FORMAT)e(311)190
+b(ASCII)46 b(table)h(column)f(has)h(wrong)f(format)168
+1250 y(BAD_BTABLE_FORMAT)d(312)190 b(Binary)46 b(table)g(column)g(has)h
+(wrong)g(format)168 1363 y(NO_NULL)523 b(314)190 b(null)47
+b(value)f(has)h(not)g(been)f(defined)168 1476 y(NOT_VARI_LEN)283
+b(317)190 b(this)47 b(is)g(not)g(a)g(variable)f(length)g(column)168
+1589 y(BAD_DIMEN)427 b(320)190 b(illegal)46 b(number)g(of)h(dimensions)
+e(in)i(array)168 1702 y(BAD_PIX_NUM)331 b(321)190 b(first)46
+b(pixel)h(number)f(greater)g(than)g(last)h(pixel)168
+1815 y(ZERO_SCALE)379 b(322)190 b(illegal)46 b(BSCALE)g(or)h(TSCALn)f
+(keyword)g(=)h(0)168 1928 y(NEG_AXIS)475 b(323)190 b(illegal)46
+b(axis)g(length)g(<)i(1)168 2154 y(NOT_GROUP_TABLE)330
+b(340)142 b(Grouping)46 b(function)f(error)168 2267 y
+(HDU_ALREADY_MEMBER)186 b(341)168 2379 y(MEMBER_NOT_FOUND)282
+b(342)168 2492 y(GROUP_NOT_FOUND)330 b(343)168 2605 y(BAD_GROUP_ID)474
+b(344)168 2718 y(TOO_MANY_HDUS_TRACKED)42 b(345)168 2831
+y(HDU_ALREADY_TRACKED)138 b(346)168 2944 y(BAD_OPTION)570
+b(347)168 3057 y(IDENTICAL_POINTERS)186 b(348)168 3170
+y(BAD_GROUP_ATTACH)282 b(349)168 3283 y(BAD_GROUP_DETACH)g(350)168
+3509 y(NGP_NO_MEMORY)426 b(360)238 b(malloc)46 b(failed)168
+3621 y(NGP_READ_ERR)474 b(361)238 b(read)46 b(error)h(from)f(file)168
+3734 y(NGP_NUL_PTR)522 b(362)238 b(null)46 b(pointer)g(passed)g(as)h
+(an)g(argument.)1695 3847 y(Passing)f(null)g(pointer)g(as)h(a)h(name)f
+(of)1695 3960 y(template)f(file)g(raises)g(this)h(error)168
+4073 y(NGP_EMPTY_CURLINE)234 b(363)k(line)46 b(read)h(seems)f(to)h(be)h
+(empty)e(\(used)1695 4186 y(internally\))168 4299 y
+(NGP_UNREAD_QUEUE_FULL)c(364)238 b(cannot)46 b(unread)g(more)g(then)h
+(1)g(line)g(\(or)g(single)1695 4412 y(line)g(twice\))168
+4525 y(NGP_INC_NESTING)330 b(365)238 b(too)46 b(deep)h(include)f(file)h
+(nesting)e(\(infinite)1695 4638 y(loop,)h(template)g(includes)f(itself)
+i(?\))168 4751 y(NGP_ERR_FOPEN)426 b(366)238 b(fopen\(\))45
+b(failed,)h(cannot)g(open)h(template)e(file)168 4863
+y(NGP_EOF)714 b(367)238 b(end)46 b(of)i(file)e(encountered)f(and)i(not)
+g(expected)168 4976 y(NGP_BAD_ARG)522 b(368)238 b(bad)46
+b(arguments)g(passed.)g(Usually)f(means)1695 5089 y(internal)h(parser)g
+(error.)g(Should)g(not)h(happen)168 5202 y(NGP_TOKEN_NOT_EXPECT)90
+b(369)238 b(token)46 b(not)h(expected)e(here)168 5428
+y(BAD_I2C)523 b(401)190 b(bad)47 b(int)g(to)g(formatted)e(string)h
+(conversion)168 5541 y(BAD_F2C)523 b(402)190 b(bad)47
+b(float)f(to)h(formatted)f(string)g(conversion)1905 5809
+y Fg(40)p eop
+%%Page: 41 41
+41 40 bop 168 573 a Fc(BAD_INTKEY)379 b(403)190 b(can't)46
+b(interpret)g(keyword)f(value)i(as)g(integer)168 686
+y(BAD_LOGICALKEY)187 b(404)j(can't)46 b(interpret)g(keyword)f(value)i
+(as)g(logical)168 799 y(BAD_FLOATKEY)283 b(405)190 b(can't)46
+b(interpret)g(keyword)f(value)i(as)g(float)168 912 y(BAD_DOUBLEKEY)235
+b(406)190 b(can't)46 b(interpret)g(keyword)f(value)i(as)g(double)168
+1024 y(BAD_C2I)523 b(407)190 b(bad)47 b(formatted)e(string)h(to)h(int)g
+(conversion)168 1137 y(BAD_C2F)523 b(408)190 b(bad)47
+b(formatted)e(string)h(to)h(float)g(conversion)168 1250
+y(BAD_C2D)523 b(409)190 b(bad)47 b(formatted)e(string)h(to)h(double)f
+(conversion)168 1363 y(BAD_DATATYPE)283 b(410)190 b(illegal)46
+b(datatype)f(code)i(value)168 1476 y(BAD_DECIM)427 b(411)190
+b(bad)47 b(number)f(of)h(decimal)f(places)g(specified)168
+1589 y(NUM_OVERFLOW)283 b(412)190 b(overflow)45 b(during)i(datatype)e
+(conversion)168 1702 y(DATA_COMPRESSION_ERR)137 b(413)95
+b(error)46 b(compressing)f(image)168 1815 y(DATA_DECOMPRESSION_ERR)c
+(414)95 b(error)46 b(uncompressing)f(image)168 2041 y(BAD_DATE)475
+b(420)190 b(error)46 b(in)h(date)g(or)g(time)g(conversion)168
+2267 y(PARSE_SYNTAX_ERR)91 b(431)190 b(syntax)46 b(error)g(in)i(parser)
+e(expression)168 2379 y(PARSE_BAD_TYPE)187 b(432)j(expression)45
+b(did)i(not)g(evaluate)e(to)i(desired)f(type)168 2492
+y(PARSE_LRG_VECTOR)91 b(433)190 b(vector)46 b(result)g(too)h(large)f
+(to)i(return)e(in)h(array)168 2605 y(PARSE_NO_OUTPUT)139
+b(434)190 b(data)47 b(parser)f(failed)g(not)h(sent)f(an)h(out)g(column)
+168 2718 y(PARSE_BAD_COL)235 b(435)190 b(bad)47 b(data)f(encounter)g
+(while)g(parsing)g(column)168 2831 y(PARSE_BAD_OUTPUT)91
+b(436)190 b(Output)46 b(file)h(not)g(of)g(proper)f(type)168
+3057 y(ANGLE_TOO_BIG)235 b(501)190 b(celestial)45 b(angle)i(too)f
+(large)h(for)g(projection)168 3170 y(BAD_WCS_VAL)331
+b(502)190 b(bad)47 b(celestial)e(coordinate)g(or)i(pixel)g(value)168
+3283 y(WCS_ERROR)427 b(503)190 b(error)46 b(in)h(celestial)f
+(coordinate)f(calculation)168 3396 y(BAD_WCS_PROJ)283
+b(504)190 b(unsupported)45 b(type)h(of)h(celestial)f(projection)168
+3509 y(NO_WCS_KEY)379 b(505)190 b(celestial)45 b(coordinate)g(keywords)
+h(not)h(found)168 3621 y(APPROX_WCS_KEY)187 b(506)j(approximate)45
+b(wcs)i(keyword)e(values)h(were)h(returned)1905 5809
+y Fg(41)p eop
+%%Trailer
+end
+userdict /end-hook known{end-hook}if
+%%EOF
diff --git a/quick.tex b/quick.tex
new file mode 100644
index 0000000..28bd97c
--- /dev/null
+++ b/quick.tex
@@ -0,0 +1,2156 @@
+\documentclass[11pt]{article}
+\input{html.sty}
+\htmladdtonavigation
+   {\begin{rawhtml}
+ <A HREF="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html">FITSIO Home</A>
+    \end{rawhtml}}
+
+\oddsidemargin=0.20in
+\evensidemargin=0.20in
+\textwidth=15.5truecm
+\textheight=21.5truecm
+
+\title{CFITSIO Quick Start Guide}
+\author{William Pence \thanks{HEASARC, NASA Goddard Space Flight Center,
+{\it William.D.Pence@nasa.gov}}}
+
+\date{January 2003}
+
+\begin{document}
+
+\maketitle
+\tableofcontents
+
+% ===================================================================
+\section{Introduction}
+
+This document is intended to help you quickly start writing C programs
+to read and write FITS files using the CFITSIO library.  It covers the
+most important CFITSIO routines that are needed to perform most types
+of operations on FITS files. For more complete information about these
+and all the other available routines in the library please refer to
+the  ``CFITSIO User's Reference Guide'', which is available from the
+CFITSIO Web site at {\tt http://heasarc.gsfc.nasa.gov/fitsio}.
+
+For more general information about the FITS data format, refer to the
+following web page:
+http://heasarc.gsfc.nasa.gov/docs/heasarc/fits.html
+
+FITS stands for Flexible Image Transport System and is the standard
+file format used to store most astronomical data files.  There are 2
+basic types of FITS files: images and tables.  FITS images often
+contain a 2-dimensional array of pixels representing an image of a
+piece of the sky, but  FITS images can also contain 1-D arrays (i.e,
+a spectrum or light curve), or  3-D arrays (a data cube), or
+even higher dimensional arrays of data.   An image may also have zero
+dimensions, in which case it is referred to as a null or empty array.
+The supported datatypes for the image arrays are 8, 16, and 32-bit
+integers, and 32 and 64-bit floating point real numbers.  Both signed
+and unsigned integers are supported.
+
+FITS tables contain rows and columns of data, similar to a
+spreadsheet.  All the values in a particular column must have the same
+datatype.  A cell of a column is not restricted to a single number, and
+instead can contain an array or vector of numbers.  There are actually
+2 subtypes of FITS tables: ASCII and binary. As the names imply,  ASCII
+tables store the data values in an ASCII representation whereas binary
+tables store the data values in a more efficient machine-readable
+binary format.  Binary tables are generally more compact and support
+more features (e.g., a wider range of datatypes, and vector columns)
+than ASCII tables.
+
+A single FITS file many contain multiple images or tables.  Each table
+or image is called a Header-Data Unit, or HDU.  The first HDU in a FITS
+file must be an image (but it may have zero axes) and is called the
+Primary Array.  Any additional HDUs in the file (which are also
+referred to as `extensions') may contain either an image or a table.
+
+Every HDU contains a header containing keyword records.  Each keyword
+record is 80 ASCII characters long and has the following format:
+
+\begin{verbatim}
+KEYWORD = value / comment string
+\end{verbatim}
+
+The keyword name can be up to 8 characters long (all uppercase).  The
+value can be either an integer or floating point number, a logical
+value (T or F), or a character string enclosed in single quotes.  Each
+header begins with a series of required keywords to describe the
+datatype and format of the following data unit, if any.  Any number of
+other optional keywords can be included in  the header to provide other
+descriptive information about the data.  For the most part, the CFITSIO
+routines automatically write the required FITS keywords for each HDU,
+so you, the programmer, usually do not need to worry about them.
+
+% ===================================================================
+\section{Installing and Using CFITSIO}
+
+First, you should download the CFITSIO software and the set of example
+FITS utility programs from the web site at
+http://heasarc.gsfc.nasa.gov/fitsio.  The example programs illustrate
+how to perform many common types of operations on FITS files using
+CFITSIO.  They are also useful when writing a new program because it is
+often easier to take a copy of one of these utility programs as a
+template and then modify it for your own purposes, rather than writing
+the new program completely from scratch.
+
+To build the CFITSIO library on Unix platforms, `untar' the source code
+distribution file and then execute the following commands in the
+directory containing the source code:
+
+\begin{verbatim}
+>  ./configure [--prefix=/target/installation/path]
+>  make           (or 'make shared')
+>  make install   (this step is optional)
+\end{verbatim}
+
+The optional
+'prefix' argument to configure gives the path to the directory where
+the CFITSIO library and include files should be installed via the later
+'make install' command. For example,
+
+\begin{verbatim}
+>  ./configure --prefix=/usr1/local
+\end{verbatim}
+
+will cause the 'make install' command to copy the CFITSIO libcfitsio file 
+to /usr1/local/lib and the necessary include files to /usr1/local/include
+(assuming of course that the  process has permission to write to these 
+directories).
+
+Pre-compiled versions of the CFITSIO DLL library are available for
+PCs.  On Macintosh machines, refer to the README.MacOS file for
+instructions on building CFITSIO using CodeWarrior.
+
+Any programs that use CFITSIO must of course be linked with the CFITSIO
+library when creating the executable file.  The exact procedure for
+linking a program depends on your software environment, but on Unix
+platforms, the command line to compile and link a program will look
+something like this:
+
+\begin{verbatim}
+gcc -o myprog myprog.c -L. -lcfitsio -lm -lnsl -lsocket
+\end{verbatim}
+
+You may not need to include all of the 'm', 'nsl', and 'socket' system
+libraries on your particular machine.  To find out what libraries are
+required on your (Unix) system, type {\tt'make testprog'} and see what
+libraries are then included on the resulting link line.
+
+\newpage
+% ===================================================================
+\section{Example Programs}
+
+Before describing the individual CFITSIO routines in detail, it is
+instructive to first look at an actual program.  The names of the
+CFITSIO routines are fairly descriptive (they all begin with {\tt
+fits\_}, so it should be reasonably clear what this program does:
+
+\begin{verbatim}
+----------------------------------------------------------------
+    #include <string.h>
+    #include <stdio.h>
+1:  #include "fitsio.h"
+
+    int main(int argc, char *argv[])
+    {
+2:      fitsfile *fptr;         
+        char card[FLEN_CARD]; 
+3:      int status = 0,  nkeys, ii;  /* MUST initialize status */
+
+4:      fits_open_file(&fptr, argv[1], READONLY, &status);
+        fits_get_hdrspace(fptr, &nkeys, NULL, &status);
+
+        for (ii = 1; ii <= nkeys; ii++)  { 
+          fits_read_record(fptr, ii, card, &status); /* read keyword */
+          printf("%s\n", card);
+        }
+        printf("END\n\n");  /* terminate listing with END */
+        fits_close_file(fptr, &status);
+
+        if (status)          /* print any error messages */
+5:          fits_report_error(stderr, status);
+        return(status);
+    }
+----------------------------------------------------------------
+\end{verbatim}
+
+This program opens the specified FITS file and prints
+out all the header keywords in the current HDU.
+Some other points to notice about the program are:
+\begin{enumerate}
+
+\item
+The {\tt fitsio.h} header file must be included to define the 
+various routines and symbols used in CFITSIO.
+
+\item
+
+The {\tt fitsfile}  parameter is the first argument in almost every
+CFITSIO routine.  It is a pointer to a structure (defined in {\tt
+fitsio.h}) that stores information about the particular FITS file that
+the routine will operate on.  Memory for this structure is
+automatically allocated when the file is first opened or created, and
+is freed when the file is closed.
+
+\item
+Almost every CFITSIO routine has a {\tt status} parameter as the last
+argument. The status value is also usually returned as the value of the
+function itself.  Normally status = 0, and a positive status value
+indicates an error of some sort.  The status variable must always be
+initialized to zero before use, because if status is greater than zero
+on input then the CFITSIO routines will simply return without doing
+anything.  This `inherited status' feature, where each CFITSIO routine
+inherits the status from the previous routine, makes it unnecessary to
+check the status value after every single CFITSIO routine call.
+Generally you should check the status after an especially important or
+complicated routine has been called, or after a block of
+closely related CFITSIO calls.  This example program has taken this
+feature to the extreme and only checks the status value at the 
+very end of the program.
+
+\item
+
+In this example program the file name to be opened is given as an
+argument on the command line ({\tt arg[1]}).  If the file contains more
+than 1 HDU or extension, you can specify which particular HDU to be
+opened by enclosing the name or number of the HDU in square brackets
+following the root name of the file.  For example, {\tt file.fts[0]}
+opens the  primary array, while {\tt file.fts[2]} will move to and open
+the 2nd extension in the file, and {\tt file.fit[EVENTS]} will open the
+extension that has a {\tt EXTNAME = 'EVENTS'} keyword in the header.
+Note that on the Unix command line you must enclose the file name in
+single or double quote characters if the name contains special
+characters such as `[' or `]'.
+
+All of the CFITSIO routines which read or write header keywords,
+image data, or table data operate only within the currently opened
+HDU in the file. To read or write information in a different HDU you must
+first explicitly move to that HDU (see the {\tt fits\_movabs\_hdu} and
+{\tt fits\_movrel\_hdu} routines in section 4.3).
+
+\item
+
+The {\tt fits\_report\_error} routine provides a convenient way to print out
+diagnostic messages about any error that may have occurred. 
+
+\end{enumerate}
+
+A set of example FITS utility programs are  available from the CFITSIO
+web site at \newline
+http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples.html.
+These are real working programs which illustrate how to read, write,
+and modify FITS files using the CFITSIO library.  Most of these
+programs are very short, containing only a few 10s of lines of
+executable code or less, yet they perform quite useful operations on
+FITS files. Running each program without any command line arguments
+will produce a short description of how to use the program.
+The currently available programs are:
+\begin{quote}
+fitscopy - copy a file
+\newline
+listhead - list header keywords
+\newline
+liststruc - show the structure of a FITS file.
+\newline
+modhead  - write or modify a header keyword
+\newline
+imarith  - add, subtract, multiply, or divide 2 images
+\newline
+imlist  - list pixel values in an image
+\newline
+imstat  - compute mean, min, and max pixel values in an image
+\newline
+tablist - display the contents of a FITS table
+\newline
+tabcalc  - general table calculator
+\end{quote}
+
+\newpage
+
+% ===================================================================
+\section{CFITSIO Routines}
+
+This chapter describes the main CFITSIO routines that can be used to
+perform the most common types of operations on FITS files.
+
+% ===================================================================
+{\bf \subsection{Error Reporting}}
+
+\begin{verbatim}
+void fits_report_error(FILE *stream, int status)
+void fits_get_errstatus(int status, char *err_text)
+float fits_get_version(float *version)
+\end{verbatim}
+
+The first routine prints out information about any error that
+has occurred.  Whenever any CFITSIO routine encounters an error it
+usually writes a message describing the nature of the error to an
+internal error message stack and then returns with a positive integer
+status value. Passing the error status value to this routine will
+cause  a generic description of the error and all the messages
+from the internal CFITSIO error stack to be printed to the specified
+stream.  The {\tt stream} parameter is usually set equal to
+{\tt "stdout"} or {\tt "stderr"}.
+
+The second routine simply returns a 30-character descriptive
+error message corresponding to the input status value.
+
+The last routine returns the current CFITSIO library version number.
+
+% ===================================================================
+{\bf \subsection{File Open/Close Routines}}
+
+\begin{verbatim}
+int fits_open_file( fitsfile **fptr, char *filename, int mode, int *status)
+int fits_open_data( fitsfile **fptr, char *filename, int mode, int *status)
+int fits_open_table(fitsfile **fptr, char *filename, int mode, int *status)
+int fits_open_image(fitsfile **fptr, char *filename, int mode, int *status)
+
+int fits_create_file(fitsfile **fptr, char *filename, int *status)
+int fits_close_file(fitsfile *fptr, int *status)
+\end{verbatim}
+
+These routines open or close a file.  The first {\tt fitsfile}
+parameter  in these and nearly every other CFITSIO routine is a pointer
+to a structure that CFITSIO uses to store relevant parameters about
+each opened file.  You should never directly read or write any
+information in this structure.  Memory for this structure is allocated
+automatically when the file is opened or created, and is freed when the
+file is closed.
+
+The {\tt mode} parameter in the {\tt fits\_open\_xxxx} set of routines
+can be set to either {\tt READONLY} or {\tt READWRITE} to select the
+type of file access that will be allowed. These symbolic constants are
+defined in {\tt fitsio.h}.
+
+The {\tt fits\_open\_file} routine opens the file and positions the internal
+file pointer to the beginning of the file, or to the specified
+extension if an extension name or number is appended to the file name
+(see the later section on ``CFITSIO File Names and Filters'' for a
+description of the syntax). {\tt fits\_open\_data} behaves similarly except
+that it will move to the first HDU containing significant data if a HDU
+name or number to open is not explicitly specified as part of the
+filename.  It will move to the first IMAGE HDU with NAXIS greater than
+0, or the first table that does not contain the strings `GTI' (a Good
+Time Interval extension) or `OBSTABLE' in the EXTNAME keyword value.
+The {\tt fits\_open\_table} and {\tt fits\_open\_image}  routines are similar
+except that they will move to the first significant table HDU or image
+HDU, respectively if a HDU name of number is not specified as part of
+the input file name.
+
+When opening an existing file, the {\tt filename} can include optional
+arguments, enclosed in square brackets that specify filtering
+operations that should be applied to the input file.  For example,
+\begin{verbatim}
+   myfile.fit[EVENTS][counts > 0]
+\end{verbatim}
+opens the table in the EVENTS extension and creates a virtual table by
+selecting only those rows where the COUNTS column value is greater than
+0.  See section 5 for more examples of these powerful filtering
+capabilities.
+
+In {\tt fits\_create\_file},  the {\tt filename} is simply the root name of
+the file to be created.  You can overwrite an existing file by
+prefixing the name with a `!' character (on the Unix command line this
+must be prefixed with a backslash, as in \verb+`\!file.fit'+).  
+If the file name ends with {\tt .gz} the file will be compressed
+using the gzip algorithm.  If the
+filename is {\tt stdout} or {\tt "-"} (a single dash character)
+then the output file will be piped to the stdout stream.  You can
+chain several tasks together by writing the output from the first task
+to {\tt stdout} and then reading the input file in the 2nd task from
+{\tt stdin} or {\tt "-"}.
+
+
+% ===================================================================
+{\bf \subsection{HDU-level Routines}}
+
+The routines listed in this section operate on Header-Data Units (HDUs) in a file.
+
+\begin{verbatim}
+_______________________________________________________________
+int fits_get_num_hdus(fitsfile *fptr, int *hdunum, int *status)
+int fits_get_hdu_num(fitsfile *fptr,  int *hdunum)
+\end{verbatim}
+
+The first routines returns the total number of HDUs in the FITS file,
+and the second routine returns the position of the currently opened HDU in
+the FITS file (starting with 1, not 0).
+
+\begin{verbatim}
+__________________________________________________________________________
+int fits_movabs_hdu(fitsfile *fptr, int hdunum, int *hdutype, int *status)
+int fits_movrel_hdu(fitsfile *fptr, int nmove,  int *hdutype, int *status)
+int fits_movnam_hdu(fitsfile *fptr, int hdutype, char *extname,
+                    int extver, int *status)
+\end{verbatim}
+
+These routines enable you to move to a different HDU in the file.
+Most of the CFITSIO functions which read or write keywords or data
+operate only on the currently opened HDU in the file.  The first
+routine moves to the specified absolute HDU number in the FITS
+file (the first HDU = 1), whereas the second routine moves a relative
+number of HDUs forward or backward from the currently open HDU.  The
+{\tt hdutype} parameter returns the type of the newly opened HDU, and will
+be equal to one of these symbolic constant values: {\tt IMAGE\_HDU,
+ASCII\_TBL, or BINARY\_TBL}.  {\tt hdutype} may be set to NULL
+if it is not needed.  The third routine moves to the (first) HDU
+that matches the input extension type, name, and version number,
+as given by the {\tt XTENSION, EXTNAME} (or {\tt HDUNAME}) and {\tt EXTVER} keywords.
+If the input value of {\tt extver} = 0, then the version number will
+be ignored when looking for a matching HDU.
+
+\begin{verbatim}
+_________________________________________________________________
+int fits_get_hdu_type(fitsfile *fptr,  int *hdutype, int *status)
+\end{verbatim}
+
+Get the type of the current HDU in the FITS file:  {\tt IMAGE\_HDU,
+ASCII\_TBL, or BINARY\_TBL}.
+
+\begin{verbatim}
+____________________________________________________________________
+int fits_copy_hdu(fitsfile *infptr, fitsfile *outfptr, int morekeys,
+                  int *status)
+int fits_copy_file(fitsfile *infptr, fitsfile *outfptr, int previous,
+                  int current, int following, > int *status)
+\end{verbatim}
+
+The first routine copies the current HDU from the FITS file associated
+with infptr and appends it to the end of the FITS file associated with
+outfptr.  Space may be reserved for {\tt morekeys} additional keywords
+in the output header.   The second routine copies any HDUs previous
+to the current HDU, and/or the current HDU, and/or any HDUs following the
+current HDU, depending on the value (True or False) of {\tt previous,
+current}, and {\tt following}, respectively.  For example,
+\begin{verbatim}
+  fits_copy_file(infptr, outfptr, 0, 1, 1, &status);
+\end{verbatim}
+will copy the current HDU and any HDUs that follow it from the input
+to the output file, but it will not copy any HDUs preceding the 
+current HDU.
+
+
+\newpage
+% ===================================================================
+\subsection{Image I/O Routines}
+
+This section lists the more important CFITSIO routines which operate on
+FITS images.
+
+\begin{verbatim}
+_______________________________________________________________
+int fits_get_img_type(fitsfile *fptr, int *bitpix, int *status)
+int fits_get_img_dim( fitsfile *fptr, int *naxis,  int *status)
+int fits_get_img_size(fitsfile *fptr, int maxdim,  long *naxes,
+                      int *status)
+int fits_get_img_param(fitsfile *fptr, int maxdim,  int *bitpix,
+                       int *naxis, long *naxes, int *status)
+\end{verbatim}
+
+Get information about the currently opened image HDU. The first routine
+returns the datatype of the image as (defined by the {\tt BITPIX}
+keyword), which can have the following symbolic constant values: 
+\begin{verbatim}
+    BYTE_IMG   =   8   ( 8-bit byte pixels, 0 - 255)
+    SHORT_IMG  =  16   (16 bit integer pixels)
+    LONG_IMG   =  32   (32-bit integer pixels)
+    FLOAT_IMG  = -32   (32-bit floating point pixels)
+    DOUBLE_IMG = -64   (64-bit floating point pixels)
+\end{verbatim}
+
+The second and third routines return the number of dimensions in the
+image (from the {\tt NAXIS} keyword), and the sizes of each dimension
+(from the {\tt NAXIS1, NAXIS2}, etc. keywords).  The last routine
+simply combines the function of the first 3 routines.  The input {\tt
+maxdim} parameter in this routine gives the maximum number dimensions
+that may be returned (i.e., the dimension of the {\tt naxes}
+array)
+
+\begin{verbatim}
+__________________________________________________________
+int fits_create_img(fitsfile *fptr, int bitpix, int naxis, 
+                    long *naxes, int *status)
+\end{verbatim}
+
+Create an image HDU by writing the required keywords which define the
+structure of the image.  The 2nd through 4th parameters  specified the
+datatype, the number of dimensions, and the sizes of the dimensions.
+The allowed values of the {\tt bitpix} parameter are listed above in
+the description of the {\tt fits\_get\_img\_type} routine.  If the FITS
+file pointed to by {\tt fptr} is empty (previously created with
+{\tt fits\_create\_file}) then this routine creates a primary array in
+the file, otherwise a new IMAGE extension is appended to end of the
+file following the other HDUs in the file.
+
+\begin{verbatim}
+______________________________________________________________
+int fits_write_pix(fitsfile *fptr, int datatype, long *fpixel,
+               long nelements, void *array, int *status);
+
+int fits_write_pixnull(fitsfile *fptr, int datatype, long *fpixel,
+               long nelements, void *array, void *nulval, int *status);
+
+int fits_read_pix(fitsfile *fptr, int  datatype, long *fpixel, 
+                  long nelements, void *nulval, void *array, 
+                  int *anynul, int *status)
+\end{verbatim}
+
+Read or write all or part of the FITS image.  There are 2 different
+'write' pixel routines:  The first simply writes the input array of pixels
+to the FITS file.  The second is similar, except that it substitutes
+the appropriate null pixel value in the FITS file for any pixels 
+which have a value equal to {\tt *nulval} (note that this parameter
+gives the address of the null pixel value, not the value itself).
+Similarly,  when reading an image, CFITSIO will substitute the value
+given by {\tt nulval}  for  any undefined pixels in the image, unless
+{\tt nulval = NULL}, in which case no checks will be made for undefined
+pixels when reading the FITS image.
+
+The {\tt fpixel} parameter in these routines is an array which gives
+the coordinate in each dimension of the first pixel to be read or
+written, and {\tt nelements} is the total number of pixels to read or
+write.  {\tt array} is the address of an array which either contains
+the pixel values to be written, or will hold the values of the pixels
+that are read.  When reading, {\tt array} must have been allocated
+large enough to hold all the returned pixel values.  These routines
+starts at the {\tt fpixel} location and then read or write the {\tt
+nelements} pixels, continuing on successive rows of the image if
+necessary.  For example, to write an entire 2D image, set {\tt
+fpixel[0] = fpixel[1] = 1}, and {\tt nelements = NAXIS1 * NAXIS2}.  Or
+to read just the 10th row of the image, set {\tt fpixel[0] = 1,
+fpixel[1] = 10}, and {\tt nelements = NAXIS1}.  The {\tt datatype}
+parameter specifies the datatype of the C {\tt array} in the program,
+which need not be the same as the datatype of the FITS image itself.
+If the datatypes differ then CFITSIO will convert the data as it is
+read or written.  The following symbolic constants are allowed for the
+value of {\tt datatype}:
+\begin{verbatim}
+  TBYTE     unsigned char
+  TSBYTE    signed char
+  TSHORT    signed short
+  TUSHORT   unsigned short
+  TINT      signed int
+  TUINT     unsigned int
+  TLONG     signed long
+  TULONG    unsigned long
+  TFLOAT    float
+  TDOUBLE   double
+\end{verbatim}
+
+
+\begin{verbatim}
+_________________________________________________________________
+int fits_write_subset(fitsfile *fptr, int datatype, long *fpixel,
+             long *lpixel, DTYPE *array, > int *status)
+
+int fits_read_subset(fitsfile *fptr, int  datatype, long *fpixel,
+             long *lpixel, long *inc, void *nulval,  void *array,
+             int *anynul, int *status)
+\end{verbatim}
+
+Read or write a rectangular section of the FITS image.  These are very
+similar to {\tt fits\_write\_pix} and {\tt fits\_read\_pix} except that
+you specify the last pixel coordinate (the upper right corner of the
+section) instead of the number of pixels to be read.  The read routine
+also has an {\tt inc} parameter which can be used to read only every
+{\tt inc-th} pixel along each dimension of the image.  Normally  {\tt
+inc[0] = inc[1] = 1} to read every pixel in a 2D image.  To read every
+other pixel in the entire 2D image, set
+\begin{verbatim}
+    fpixel[0] = fpixel[1] = 1
+    lpixel[0] = {NAXIS1}
+    lpixel[1] = {NAXIS2}  
+    inc[0] = inc[1] = 2  
+\end{verbatim}
+
+Or, to read the 8th row of a 2D image, set 
+\begin{verbatim}
+    fpixel[0] = 1
+    fpixel[1] = 8
+    lpixel[0] = {NAXIS1}
+    lpixel[1] = 8
+    inc[0] = inc[1] = 1
+\end{verbatim}
+
+\newpage
+% ===================================================================
+\subsection{Table I/O Routines}
+
+This section lists the most important CFITSIO routines which operate on
+FITS tables.
+
+\begin{verbatim}
+__________________________________________________________________________
+int fits_create_tbl(fitsfile *fptr, int tbltype, long nrows, int tfields,
+    char *ttype[],char *tform[], char *tunit[], char *extname, int *status)
+\end{verbatim}
+
+Create a new  table extension by writing the required keywords that
+define the table structure. The required null primary array
+will be created first if the file is initially completely empty.  {\tt
+tbltype} defines the type of table and can have values of {\tt
+ASCII\_TBL or BINARY\_TBL}.  Binary tables are generally preferred
+because they are more efficient and support a greater range of column
+datatypes than ASCII tables.
+
+The {\tt nrows} parameter gives the initial number of empty rows to be
+allocated for the table; this should normally be set to 0.  The {\tt tfields}
+parameter gives the number of columns in the table (maximum = 999).
+The {\tt
+ttype, tform}, and {\tt tunit} parameters give the name, datatype, and
+physical units of each column, and {\tt extname} gives the name for the
+table (the value of the {\tt EXTNAME} keyword).  
+The FITS Standard recommends that only
+letters, digits, and the underscore character be used in column names
+with no embedded spaces.  It is recommended that all the column names
+in a given table be unique within the first 8 characters.
+
+The following table
+shows the TFORM column format values that are allowed in ASCII tables
+and in binary tables:
+\begin{verbatim}
+        ASCII Table Column Format Codes
+        -------------------------------
+        (w = column width, d = no. of decimal places to display)
+            Aw   - character string
+            Iw   - integer
+            Fw.d - fixed floating point
+            Ew.d - exponential floating point
+            Dw.d - exponential floating point
+
+        Binary Table Column Format Codes
+        --------------------------------
+        (r = vector length, default = 1)
+            rA  - character string
+            rAw - array of strings, each of length w
+            rL  - logical
+            rX  - bit
+            rB  - unsigned byte
+            rS  - signed byte **
+            rI  - signed 16-bit integer
+            rU  - unsigned 16-bit integer **
+            rJ  - signed 32-bit integer
+            rV  - unsigned 32-bit integer **
+            rK  - 64-bit integer ***
+            rE  - 32-bit floating point
+            rD  - 64-bit floating point
+            rC  - 32-bit complex pair
+            rM  - 64-bit complex pair
+
+     ** The S, U and V format codes are not actual legal TFORMn values.
+        CFITSIO substitutes the somewhat more complicated set of
+        keywords that are used to represent unsigned integers or
+        signed bytes.
+
+    *** The 64-bit integer format is experimental and is not 
+        officially recognized in the FITS Standard.
+\end{verbatim}
+  
+The {\tt tunit} and {\tt extname} parameters are optional and
+may be set to NULL
+if they are not needed.  
+
+Note that it may be easier to create a new table by copying the
+header from another existing table with {\tt fits\_copy\_header} rather
+than calling this routine.
+
+\begin{verbatim}
+_______________________________________________________________
+int fits_get_num_rows(fitsfile *fptr, long *nrows, int *status)
+int fits_get_num_cols(fitsfile *fptr, int  *ncols, int *status)
+\end{verbatim}
+
+Get the number of rows or columns in the current FITS table.  The
+number of rows is given by the {\tt NAXIS2} keyword and the number of columns
+is given by the {\tt TFIELDS} keyword in the header of the table.
+
+\begin{verbatim}
+_______________________________________________________________
+int fits_get_colnum(fitsfile *fptr, int casesen, char *template,
+                    int *colnum, int *status)
+int fits_get_colname(fitsfile *fptr, int casesen, char *template,
+                    char *colname, int *colnum, int *status)
+\end{verbatim}
+
+Get the  column number (starting with 1, not 0) of the column whose
+name matches the specified template name.  The only difference in
+these 2 routines is that the 2nd one also returns the name of the
+column that matched the template string.
+
+Normally, {\tt casesen} should
+be set to {\tt CASEINSEN}, but it may be set to {\tt CASESEN} to force
+the name matching to be case-sensitive.
+
+The input {\tt template} string gives the name of the desired column and
+may include wildcard characters:  a `*' matches any sequence of
+characters (including zero characters), `?' matches any single
+character, and `\#' matches any consecutive string of decimal digits
+(0-9).  If more than one column name in the table matches the template
+string, then the first match is returned and the status value will be
+set to {\tt COL\_NOT\_UNIQUE}  as a warning that a unique match was not
+found.  To find the next column that matches the template, call this
+routine again leaving the input status value equal to {\tt
+COL\_NOT\_UNIQUE}.  Repeat this process until {\tt status =
+COL\_NOT\_FOUND}  is returned.
+
+\begin{verbatim}
+_______________________________________________________________
+int fits_get_coltype(fitsfile *fptr, int colnum, int *typecode,
+                     long *repeat, long *width, int *status)
+
+int fits_get_eqcoltype(fitsfile *fptr, int colnum, int *typecode,
+                     long *repeat, long *width, int *status)
+\end{verbatim}
+
+Return the datatype, vector repeat count, and the width in bytes of a
+single column element for column number {\tt colnum}.  Allowed values
+for the returned datatype in ASCII tables are:  {\tt TSTRING, TSHORT,
+TLONG, TFLOAT, and TDOUBLE}.  Binary tables support these additional
+types: {\tt TLOGICAL, TBIT, TBYTE, TINT32BIT, TCOMPLEX and TDBLCOMPLEX}.  The
+negative of the datatype code value is returned if it is a variable
+length array column.
+
+These 2 routines are similar, except that in the case of scaled
+integer columns the 2nd routine, fit\_get\_eqcoltype, returns the
+'equivalent' datatype that is needed to store the scaled values, which
+is not necessarily the same as the physical datatype of the unscaled values
+as stored in the FITS table.  For example if a '1I' column in a binary
+table has TSCALn = 1 and TZEROn = 32768, then this column effectively
+contains unsigned short integer values, and thus the returned value of
+typecode will be TUSHORT, not TSHORT.  Or, if TSCALn or TZEROn are not
+integers, then the equivalent datatype will be returned as TFLOAT or
+TDOUBLE, depending on the size of the integer.
+
+The repeat count is always 1 in ASCII tables.
+The 'repeat' parameter returns the vector repeat count on the binary
+table TFORMn keyword value. (ASCII table columns always have repeat
+= 1).  The 'width' parameter returns the width in bytes of a single
+column element (e.g., a '10D' binary table column will have width =
+8, an ASCII table 'F12.2' column will have width = 12, and a binary
+table'60A' character string  column will have width = 60);  Note that
+this routine supports the local convention for specifying arrays of
+fixed length strings within a binary table character column using
+the syntax TFORM = 'rAw' where 'r' is the total number of
+characters (= the width of the column) and 'w' is the width of a
+unit string within the column.  Thus if the column has TFORM =
+'60A12' then this means that each row of the table contains
+5 12-character substrings within the 60-character field, and thus 
+in this case this routine will return typecode = TSTRING, repeat =
+60, and width = 12.  The number of substings in any binary table
+character string field can be calculated by (repeat/width). 
+A null pointer may be given for any of the output parameters that
+ are not needed.
+
+\begin{verbatim}
+____________________________________________________________________________
+int fits_insert_rows(fitsfile *fptr, long firstrow, long nrows, int *status)
+int fits_delete_rows(fitsfile *fptr, long firstrow, long nrows, int *status)
+int fits_delete_rowrange(fitsfile *fptr, char *rangelist, int *status)
+int fits_delete_rowlist(fitsfile *fptr, long *rowlist, long nrows, int *stat)
+\end{verbatim}
+
+Insert or delete rows in a table.  The blank rows are inserted
+immediately following row {\tt frow}. Set {\tt frow} = 0 to insert rows
+at the beginning of the table.  The first 'delete' routine deletes {\tt
+nrows} rows beginning with row {\tt firstrow}.   The 2nd delete routine
+takes an input string listing the rows or row ranges to be deleted
+(e.g., '2,4-7, 9-12').  The last delete routine takes an input long
+integer array that specifies each individual row to be deleted.  The
+row lists must be sorted in ascending order.  All these routines update
+the value of the {\tt NAXIS2} keyword to reflect the new number of rows
+in the table.
+
+\begin{verbatim}
+_________________________________________________________________________
+int fits_insert_col(fitsfile *fptr, int colnum, char *ttype, char *tform,
+                    int *status)
+int fits_insert_cols(fitsfile *fptr, int colnum, int ncols, char **ttype,
+                     char **tform, int *status)
+
+int fits_delete_col(fitsfile *fptr, int colnum, int *status)
+\end{verbatim}
+
+Insert or delete columns in a table.  {\tt colnum} gives the position
+of the column to be inserted or deleted (where the first column of the
+table is at position 1).  {\tt ttype} and {\tt tform} give the column
+name and column format, where the allowed format codes are listed above
+in the description of the {\tt fits\_create\_table} routine.  The 2nd
+'insert' routine inserts multiple columns, where {\tt ncols} is the
+number of columns to insert, and  {\tt ttype} and {\tt tform} are
+arrays of string pointers in this case.
+
+\begin{verbatim}
+____________________________________________________________________
+int fits_copy_col(fitsfile *infptr, fitsfile *outfptr, int incolnum,
+        int outcolnum, int create_col, int *status);
+\end{verbatim}
+
+Copy a column from one table HDU to another.  If {\tt create\_col} = TRUE (i.e., not equal to zero),
+then a new column will be inserted in the output table at position
+{\tt outcolumn}, otherwise the values in the existing output column will be
+overwritten. 
+
+\begin{verbatim}
+__________________________________________________________________________
+int fits_write_col(fitsfile *fptr, int datatype, int colnum, long firstrow,
+                  long firstelem, long nelements, void *array, int *status)
+int fits_write_colnull(fitsfile *fptr, int datatype, int colnum, 
+                  long firstrow, long firstelem, long nelements, 
+                  void *array, void *nulval, int *status)
+int fits_write_col_null(fitsfile *fptr, int colnum, long firstrow,
+                  long firstelem, long nelements, int *status)
+
+int fits_read_col(fitsfile *fptr, int datatype, int colnum, long firstrow,
+       long firstelem, long nelements, void *nulval, void *array, 
+       int *anynul, int *status)
+
+\end{verbatim}
+
+Write or read elements in column number {\tt colnum}, starting with row
+{\tt firstsrow} and element {\tt firstelem} (if it is a vector
+column).  {\tt firstelem} is ignored if it is a scalar column. The {\tt
+nelements} number of elements are read or written continuing on
+successive rows of the table if necessary. {\tt array} is the address
+of an array which either contains the  values to be written, or will
+hold the returned values that are read.  When reading, {\tt array} must
+have been allocated large enough to hold all the returned values.
+
+There are 3 different 'write' column routines:  The first simply writes
+the input array into the column.  The second is similar, except that it
+substitutes the appropriate null pixel value in the column for any
+input array values which are equal to {\tt *nulval} (note that this
+parameter gives the address of the null pixel value, not the value
+itself).  The third write routine sets the specified table elements
+to a null value.  New rows will be automatical added to the table
+if the write operation extends beyond the current size of the table.
+
+When reading a column, CFITSIO will substitute the value given by {\tt
+nulval}  for  any undefined elements in the FITS column, unless {\tt
+nulval} or {\tt *nulval = NULL}, in which case no checks will be made
+for undefined values when reading the column.
+
+{\tt datatype} specifies the datatype of the C {\tt array} in the program,
+which need not be the same as the intrinsic datatype of the column in
+the FITS table.   The following symbolic constants are allowed for the
+value of {\tt datatype}:
+
+\begin{verbatim}
+  TSTRING   array of character string pointers
+  TBYTE     unsigned char
+  TSHORT    signed short
+  TUSHORT   unsigned short
+  TINT      signed int
+  TUINT     unsigned int
+  TLONG     signed long
+  TULONG    unsigned long
+  TFLOAT    float
+  TDOUBLE   double
+\end{verbatim}
+
+Note that {\tt TSTRING} corresponds to the C {\tt
+char**} datatype, i.e., a pointer to an array of pointers to an array
+of characters.
+
+Any column, regardless of it's intrinsic datatype, may be read as a
+{\tt TSTRING} character string. The display format of the returned
+strings will be determined by the {\tt TDISPn} keyword, if it exists,
+otherwise a default format will be used depending on the datatype of
+the column.  The {\tt tablist} example utility program (available from
+the CFITSIO web site) uses this feature to display all the values in a
+FITS table.
+
+\begin{verbatim}
+_____________________________________________________________________
+int fits_select_rows(fitsfile *infptr, fitsfile *outfptr, char *expr,
+                     int *status)
+int fits_calculator(fitsfile *infptr, char *expr, fitsfile *outfptr,
+                    char *colname, char *tform, int *status) 
+\end{verbatim}
+
+These are 2 of the most powerful routines in the CFITSIO library.  (See
+the full CFITSIO Reference Guide for a description of several related
+routines).  These routines can perform complicated transformations on
+tables based on an input arithmetic expression which is evaluated for
+each row of the table.  The first routine will select or copy rows of
+the table for which the expression evaluates to TRUE (i.e., not equal
+to zero).  The second routine writes the value of the expression to a
+column in the output table.  Rather than supplying the expression
+directly to these routines, the expression may also be written to a
+text file (continued over multiple lines if necessary) and the name of
+the file, prepended with a '@' character, may be supplied as the value
+of the 'expr' parameter (e.g.  '@filename.txt').
+
+The arithmetic expression may be a function of any column or keyword in
+the input table as shown in these examples:
+
+\begin{verbatim}
+Row Selection Expressions:
+   counts > 0                          uses COUNTS column value
+   sqrt( X**2 + Y**2) < 10.            uses X and Y column values
+   (X > 10) || (X < -10) && (Y == 0)   used 'or' and 'and' operators  
+   gtifilter()                         filter on Good Time Intervals
+   regfilter("myregion.reg")           filter using a region file
+   @select.txt                         reads expression from a text file
+Calculator Expressions:
+   #row % 10                        modulus of the row number
+   counts/#exposure                 Fn of COUNTS column and EXPOSURE keyword
+   dec < 85 ? cos(dec * #deg) : 0   Conditional expression: evaluates to
+                                      cos(dec) if dec < 85, else 0
+   (count{-1}+count+count{+1})/3.   running mean of the count values in the
+                                      previous, current, and next rows
+   max(0, min(X, 1000))             returns a value between 0 - 1000
+   @calc.txt                        reads expression from a text file
+\end{verbatim}
+
+Most standard mathematical operators and functions are supported.  If
+the expression includes the name of a column, than the value in the
+current row of the table will be used when evaluating the expression on
+each row.   An offset to an adjacent row can be specified by including
+the offset value in curly brackets after the column name as shown in
+one of the examples.  Keyword values can be included in the expression
+by preceding the keyword name with a `\#' sign.   See Section 5 of this
+document for more discussion of the expression syntax.
+
+{\tt gtifilter} is a special function which tests whether the {\tt
+TIME} column value in the input table falls within one or more Good
+Time Intervals.  By default, this function looks for a 'GTI' extension
+in the same file as the input table.  The 'GTI' table contains {\tt START} 
+and {\tt STOP} columns which define the range of
+each good time interval. See section 5.4.3 for more details.
+
+{\tt regfilter} is another special function which selects rows based on
+whether the spatial position associated with each row is located within
+in a specified region of the sky.  By default, the {\tt X} and {\tt Y}
+columns in the input table are assumed to give the position of each row.
+The spatial region is defined in an ASCII text file whose name is given
+as the argument to the {\tt regfilter} function. See section 5.4.4 for
+more details.
+
+The {\tt infptr} and {\tt outfptr} parameters in these routines may
+point to the same table or to different tables.  In {\tt
+fits\_select\_rows}, if the input and output tables are the same then
+the rows that do not satisfy the selection expression will be deleted
+from the table.  Otherwise, if the output table is different from the
+input table then the selected rows will be copied from the input table
+to the output table.
+
+The output column in {\tt fits\_calculator} may or may not already
+exist.  If it exists then the calculated values will be written to that
+column, overwriting the existing values.  If the column doesn't exist
+then the new column will be appended to the output table. The {\tt tform}
+parameter can be used to specify the datatype of the new column (e.g.,
+the {\tt TFORM} keyword value as in {\tt '1E', or '1J'}). If {\tt
+tform} = NULL then a default datatype will be used, depending on the
+expression.
+
+\begin{verbatim}
+_____________________________________________________________________
+int fits_read_tblbytes(fitsfile *fptr, long firstrow, long firstchar,
+                     long nchars, unsigned char *array, int *status)
+int fits_write_tblbytes (fitsfile *fptr, long firstrow, long firstchar,
+                     long nchars, unsigned char *array, int *status)
+\end{verbatim}
+
+These 2 routines provide low-level access to tables and are mainly
+useful as an efficient way to copy rows of a table from one file to
+another.  These routines simply read or write the specified number of
+consecutive characters (bytes) in a table, without regard for column
+boundaries.  For example, to read or write the first row of a table,
+set {\tt firstrow = 1, firstchar = 1}, and {\tt nchars = NAXIS1} where
+the length of a row is given by the value of the {\tt NAXIS1} header
+keyword.  When reading a table, {\tt array} must have been declared at
+least {\tt nchars} bytes long to hold the returned string of bytes.
+
+\newpage
+% ===================================================================
+\subsection{Header Keyword I/O Routines}
+\nopagebreak
+The following routines read and write header keywords in the current HDU.
+\nopagebreak
+
+\begin{verbatim}
+____________________________________________________________________
+int fits_get_hdrspace(fitsfile *fptr, int *keysexist, int *morekeys,
+                      int *status)
+\end{verbatim}
+\nopagebreak
+Return the number of existing keywords (not counting the mandatory END
+keyword) and the amount of empty space currently available for more
+keywords. The {\tt morekeys} parameter may be set to NULL if it's value is
+not needed.
+
+\begin{verbatim}
+___________________________________________________________________________
+int fits_read_record(fitsfile *fptr, int keynum, char *record, int *status)
+int fits_read_card(fitsfile *fptr, char *keyname, char *record, int *status)
+int fits_read_key(fitsfile *fptr, int datatype, char *keyname,
+                  void *value, char *comment, int *status)
+
+int fits_find_nextkey(fitsfile *fptr, char **inclist, int ninc,
+                      char **exclist, int nexc, char *card, int *status)
+
+int fits_read_key_unit(fitsfile *fptr, char *keyname, char *unit, 
+                       int *status)
+\end{verbatim}
+
+These routines all read a header record in the current HDU. The first
+routine reads keyword number {\tt keynum} (where the first keyword is
+at position 1).  This routine is most commonly used when sequentially
+reading every record in the header from beginning to end.  The 2nd and
+3rd routines read the named keyword and return either the whole
+80-byte record, or the keyword value and comment string.
+
+Wild card characters (*, ?, and \#) may be used when specifying the name
+of the keyword to be read, in which case the first matching keyword is
+returned.
+
+The {\tt datatype} parameter specifies the C datatype of the returned
+keyword value and can have one of the following symbolic constant
+values:  {\tt TSTRING, TLOGICAL} (== int), {\tt TBYTE}, {\tt TSHORT},
+{\tt TUSHORT}, {\tt TINT}, {\tt TUINT}, {\tt TLONG}, {\tt TULONG}, {\tt
+TFLOAT}, {\tt TDOUBLE}, {\tt TCOMPLEX}, and {\tt TDBLCOMPLEX}.  Data
+type conversion will be performed for numeric values if the intrinsic
+FITS keyword value does not have the same datatype.  The {\tt comment}
+parameter may be set equal to NULL if the comment string is not
+needed.
+
+The 4th routine provides an easy way to find all the keywords in the
+header that match one of the name templates in {\tt inclist} and do not
+match any of the name templates in {\tt exclist}.  {\tt ninc} and {\tt
+nexc} are the number of template strings in {\tt inclist} and {\tt
+exclist}, respectively.  Wild cards (*, ?, and \#) may be used in the
+templates to match multiple keywords.  Each time this routine is called
+it returns the next matching 80-byte keyword record.  It returns status
+= {\tt KEY\_NO\_EXIST} if there are no more matches.
+
+The 5th routine returns the keyword value units string, if any.
+The units are recorded at the beginning of the keyword comment field
+enclosed in square brackets.
+\begin{verbatim}
+_______________________________________________________________
+int fits_write_key(fitsfile *fptr, int datatype, char *keyname, 
+        void *value, char *comment, int *status)
+int fits_update_key(fitsfile *fptr, int datatype, char *keyname,
+        void *value, char *comment, int *status)
+int fits_write_record(fitsfile *fptr, char *card, int *status)
+
+int fits_modify_comment(fitsfile *fptr, char *keyname, char *comment,
+        int *status)
+int fits_write_key_unit(fitsfile *fptr, char *keyname, char *unit,
+        int *status)
+
+\end{verbatim}
+
+Write or modify a keyword  in the header of the current HDU.  The
+first routine appends the new keyword to the end of the header, whereas
+the second routine will update the value and comment fields of the
+keyword if it already exists, otherwise it behaves like the first
+routine and appends the new keyword.  Note that {\tt value} gives the
+address to the value and not the value itself.  The {\tt datatype}
+parameter specifies the C datatype of the keyword value and may have
+any of the values listed in the description of the keyword reading
+routines, above.  A NULL may be entered for the comment parameter, in
+which case the  keyword comment field will be unmodified or left
+blank.
+
+The third routine is more primitive and simply writes the 80-character
+{\tt card} record to the header.  It is the programmer's responsibility
+in this case to ensure that the record conforms to all the FITS format
+requirements for a header record.
+
+The fourth routine modifies the comment string in an existing keyword,
+and the last routine writes or updates the keyword units string for an
+existing keyword.  (The units are recorded at the beginning of the
+keyword comment field enclosed in square brackets).
+
+\begin{verbatim}
+___________________________________________________________________
+int fits_write_comment(fitsfile *fptr, char *comment,  int *status)
+int fits_write_history(fitsfile *fptr, char *history,  int *status)
+int fits_write_date(fitsfile *fptr,  int *status)
+\end{verbatim}
+
+Write a {\tt COMMENT, HISTORY}, or {\tt DATE} keyword to the current
+header.  The {\tt COMMENT} keyword is typically used to write a comment
+about the file or the data.  The {\tt HISTORY} keyword is typically
+used to provide information about the history of the processing
+procedures that have been applied to the data.  The {\tt comment} or
+{\tt history} string will be continued over multiple keywords if it is
+more than 70 characters long.
+
+The {\tt DATE} keyword is used to record the date and time that the
+FITS file was created.  Note that this file creation date is usually
+different from the date of the observation which obtained the data in
+the FITS file.  The {\tt DATE} keyword value is a character string in
+'yyyy-mm-ddThh:mm:ss' format. If a {\tt DATE} keyword already exists in
+the header, then this routine will update the value with the current
+system date.
+
+\begin{verbatim}
+___________________________________________________________________
+int fits_delete_record(fitsfile *fptr, int keynum,  int *status)
+int fits_delete_key(fitsfile *fptr, char *keyname,  int *status)
+\end{verbatim}
+
+Delete a keyword record. The first routine deletes a keyword at a
+specified position (the first keyword is at position 1, not 0),
+whereas the second routine deletes the named keyword.
+
+\begin{verbatim}
+_______________________________________________________________________
+int fits_copy_header(fitsfile *infptr, fitsfile *outfptr,  int *status)
+\end{verbatim}
+
+Copy all the header keywords from the current HDU associated with
+infptr to the current HDU associated with outfptr.  If the current
+output HDU is not empty, then a new HDU will be appended to the output
+file. The output HDU will then have the identical structure as the
+input HDU, but will contain no data.
+
+\newpage
+% ===================================================================
+\subsection{Utility Routines}
+
+This section lists the most important CFITSIO general utility routines.
+
+\begin{verbatim}
+___________________________________________________________________
+int fits_write_chksum( fitsfile *fptr, int *status)
+int fits_verify_chksum(fitsfile *fptr, int *dataok, int *hduok, int *status)
+\end{verbatim}
+
+These routines  compute or validate the checksums for the currenrt
+HDU.  The {\tt DATASUM} keyword is used to store the numerical value of
+the 32-bit, 1's complement checksum for the data unit alone.  The {\tt
+CHECKSUM} keyword is used to store the ASCII encoded COMPLEMENT of the
+checksum for the entire HDU.  Storing the complement, rather than the
+actual checksum, forces the checksum for the whole HDU to equal zero.
+If the file has been modified since the checksums were computed, then
+the HDU checksum will usually not equal zero.
+
+The returned {\tt dataok} and {\tt hduok} parameters will have a value
+= 1 if the data or HDU is verified correctly, a value = 0 if the
+{\tt DATASUM} or {\tt CHECKSUM} keyword is not present, or value = -1 if the
+computed checksum is not correct.
+
+
+\begin{verbatim}
+___________________________________________________________________
+int fits_parse_value(char *card, char *value, char *comment, int *status)
+int fits_get_keytype(char *value, char *dtype, int *status)
+int fits_get_keyclass(char *card)
+int fits_parse_template(char *template, char *card, int *keytype, int *status)
+
+\end{verbatim}
+
+{\tt fits\_parse\_value} parses the input 80-chararacter header keyword record, returning
+the value (as a literal character string) and comment strings.  If the
+keyword has no value (columns 9-10 not equal to '= '), then a null
+value string is returned and the comment string is set equal to column
+9 - 80 of the input string.
+
+{\tt fits\_get\_keytype} parses the keyword value string to determine its
+datatype.  {\tt dtype} returns with a value of 'C', 'L', 'I', 'F' or
+'X', for character string, logical, integer, floating point, or
+complex, respectively.
+
+{\tt fits\_get\_keyclass} returns a classification code that indicates
+the classification type of the input keyword record (e.g., a required
+structural keyword, a TDIM keyword, a WCS keyword, a comment keyword,
+etc.  See the CFITSIO Reference Guide for a list of the different
+classification codes.
+
+{\tt fits\_parse\_template} takes an input free format keyword template
+string and returns a formatted 80*char record that satisfies all the
+FITS requirements for a header keyword record.  The template should
+generally contain 3 tokens: the keyword name, the keyword value, and
+the keyword comment string.  The returned {\tt keytype} parameter
+indicates whether the keyword is a COMMENT keyword or not.   See the
+CFITSIO Reference Guide for more details.
+
+\newpage
+% ===================================================================
+\section{CFITSIO File Names and Filters}
+
+\subsection{Creating New Files}
+
+When creating a new output file on magnetic disk  with {\tt
+fits\_create\_file} the following features are supported.
+\begin{itemize}
+\item Overwriting, or 'Clobbering' an Existing File
+
+If the filename is preceded by an exclamation
+point (!) then if that file already exists it will be deleted prior to
+creating the new FITS file.  Otherwise if there is an existing file
+with the same name, CFITSIO will not overwrite the existing file and
+will return an error status code.  Note  that the exclamation point is
+a special UNIX character, so if it is used on the command line rather
+than entered at a task prompt, it must be preceded by a backslash to
+force the UNIX shell to pass it verbatim to the application program.
+
+\item Compressed Output Files
+
+If the output disk file name ends with the suffix '.gz', then CFITSIO
+will compress the file using the gzip compression algorithm before
+writing it to disk.  This can reduce the amount of disk space used by
+the file.  Note that this feature requires that the uncompressed file
+be constructed in memory before it is compressed and written to disk,
+so it can fail if there is insufficient available memory.
+
+One can also specify that any images written to the output file should
+be compressed using the newly developed `tile-compression' algorithm by
+appending `[compress]' to the name of the disk file (as in
+{\tt myfile.fits[compress]}).   Refer to the CFITSIO User's Reference Guide
+for more information about this new image compression format.
+
+\item Using a Template to Create a New FITS File
+
+The structure of any new FITS file that is to be created may be defined
+in an ASCII template file.  If the name of the template file is
+appended to the name of the FITS file itself, enclosed in parenthesis
+(e.g., {\tt 'newfile.fits(template.txt)'}) then CFITSIO will create a
+FITS file with that structure before opening it for the application to
+use.  The template file basically defines the dimensions and data type
+of the primary array and any IMAGE extensions, and the names and data
+types of the columns in any ASCII or binary table extensions.  The
+template file can also be used to define any optional keywords that
+should be written in any of the HDU headers.  The image pixel values
+and table entry values are all initialized to zero.  The application
+program can then write actual data into the HDUs.  See the CFITSIO
+Reference Guide for for a complete description of the template file
+syntax.
+
+\item Creating a Temporary Scratch File in Memory
+
+It is sometimes useful to create a temporary output file when testing
+an application program.  If the name of the file to be created is
+specified as {\tt mem:} then CFITSIO will create the file in
+memory where it will persist only until the program closes the file.
+Use of this {\tt mem:} output file usually enables the program to run
+faster, and of course the output file does not use up any disk space.
+
+
+\end{itemize}
+
+\subsection{Opening Existing Files}
+
+When opening a file with {\tt fits\_open\_file}, CFITSIO can read a
+variety of different input file formats and is not restricted to only
+reading FITS format files from magnetic disk. The following types of
+input files are all supported:
+
+\begin{itemize}
+\item FITS files compressed with {\tt zip, gzip} or {\tt compress}
+
+If CFITSIO cannot find the specified file to open it will automatically
+look for a file with the same rootname but with a {\tt .gz, .zip}, or
+{\tt .Z} extension.  If it finds such a compressed file, it will
+allocate a block of memory and uncompress the file into that memory
+space.  The application program will then transparently open this
+virtual FITS file in memory.  Compressed
+files can only be opened with 'readonly', not 'readwrite' file access.
+
+\item  FITS files on the internet, using {\tt ftp} or {\tt http} URLs
+
+Simply provide the full URL as the name of the file that you want to
+open.  For example,\linebreak {\tt
+ftp://legacy.gsfc.nasa.gov/software/fitsio/c/testprog.std}\linebreak
+will open the CFITSIO test FITS file that is located on the {\tt
+legacy} machine.  These files can only be opened with 'readonly' file
+access.
+
+\item  FITS files on {\tt stdin} or {\tt stdout} file streams
+
+If the name of the file to be opened is {\tt 'stdin'} or {\tt '-'} (a
+single dash character) then CFITSIO will read the file from the
+standard input stream.  Similarly, if the output file name is {\tt
+'stdout'} or {\tt '-'}, then the file will be written to the standard
+output stream.  In addition, if the output filename is {\tt
+'stdout.gz'} or {\tt '-.gz'} then it will be gzip compressed before
+being written to stdout.  This mechanism can be used to pipe FITS files
+from one task to another without having to write an intermediary FITS
+file on magnetic disk.
+
+\item FITS files that exist only in memory, or shared memory.
+
+In some applications, such as real time data acquisition, you may want
+to have one process write a FITS file into a certain section of
+computer memory, and then be able to open that file in memory with
+another process.  There is a specialized CFITSIO open routine called
+{\tt fits\_open\_memfile} that can be used for this purpose.  See the
+``CFITSIO User's Reference Guide'' for more details.
+
+\item  IRAF format images (with {\tt .imh} file extensions)
+
+CFITSIO supports reading IRAF format images by converting them on the
+fly into FITS images in memory.  The application program then reads
+this virtual FITS format image in memory.  There is currently no
+support for writing IRAF format images, or for reading or writing IRAF
+tables.
+
+\item Image arrays in raw binary format
+
+If the input file is a raw binary data array, then CFITSIO will convert
+it on the fly into a virtual FITS image with the basic set of required
+header keywords before it is opened by the application program.  In
+this case the data type and dimensions of the image must be specified
+in square brackets following the filename (e.g. {\tt
+rawfile.dat[ib512,512]}). The first character inside the brackets
+defines the datatype of the array:
+
+\begin{verbatim}
+     b         8-bit unsigned byte
+     i        16-bit signed integer
+     u        16-bit unsigned integer
+     j        32-bit signed integer
+     r or f   32-bit floating point
+     d        64-bit floating point
+\end{verbatim}
+An optional second character specifies the byte order of the array
+values: b or B indicates big endian (as in FITS files and the native
+format of SUN UNIX workstations and Mac PCs) and l or L indicates
+little endian (native format of DEC OSF workstations and IBM PCs).  If
+this character is omitted then the array is assumed to have the native
+byte order of the local machine.  These datatype characters are then
+followed by a series of one or more integer values separated by commas
+which define the size of each dimension of the raw array.  Arrays with
+up to 5 dimensions are currently supported.  
+
+Finally, a byte offset to the position of the first pixel in the data
+file may be specified by separating it with a ':' from the last
+dimension value.  If omitted, it is assumed that the offset = 0.  This
+parameter may be used to skip over any header information in the file
+that precedes the binary data.  Further examples:
+ 
+\begin{verbatim}
+  raw.dat[b10000]          1-dimensional 10000 pixel byte array
+  raw.dat[rb400,400,12]    3-dimensional floating point big-endian array
+  img.fits[ib512,512:2880] reads the 512 x 512 short integer array in a
+                           FITS file, skipping over the 2880 byte header
+\end{verbatim}
+
+\end{itemize}
+\newpage
+
+\subsection{Image Filtering}
+
+\subsubsection{Extracting a subsection of an image}
+
+When specifying the name of an image to be opened, you can select a
+rectangular subsection of the image to be extracted and opened by the
+application program.  The application program then opens a virtual
+image that only contains the pixels within the specified subsection.
+To do this, specify the the range of pixels (start:end) along each axis
+to be extracted from the original image enclosed in square brackets.
+You can also specify an optional pixel increment (start:end:step) for
+each axis of the input image.  A pixel step = 1 will be assumed if it
+is not specified.  If the starting pixel is larger then the end pixel,
+then the image will be flipped (producing a mirror image) along that
+dimension.  An asterisk, '*', may be used to specify the entire range
+of an axis, and '-*' will flip the entire axis.  In the following
+examples, assume that {\tt myfile.fits} contains a 512 x 512 pixel 2D
+image.
+
+\begin{verbatim}
+  myfile.fits[201:210, 251:260] - opens a 10 x 10 pixel subimage.
+
+  myfile.fits[*, 512:257] - opens a 512 x 256 image consisting of
+	      all the columns in the input image, but only rows 257
+	      through 512.  The image will be flipped along the Y axis
+	      since the starting row is greater than the ending
+	      row.
+
+  myfile.fits[*:2, 512:257:2] - creates a 256 x 128 pixel image.
+	      Similar to the previous example, but only every other row
+	      and column is read from the input image.
+
+  myfile.fits[-*, *] - creates an image containing all the rows and
+	      columns in the input image, but flips it along the X
+	      axis.
+\end{verbatim}
+
+If the array to be opened is in an Image extension, and not in the
+primary array of the file, then you need to specify the extension
+name or number in square brackets before giving the subsection range,
+as in {\tt  myfile.fits[1][-*, *]} to read the image in the
+first extension in the file.
+
+\subsubsection{Create an Image by Binning Table Columns}
+
+You can also create and open a virtual image by binning the values in a
+pair of columns of a FITS table (in other words, create a 2-D histogram
+of the values in the 2 columns).  This technique is often used in X-ray
+astronomy where each detected X-ray photon during an observation is
+recorded in a FITS table.  There are typically 2 columns in the table
+called  {\tt X} and {\tt Y} which record the pixel location of that
+event in a virtual 2D image.  To create an image from this table, one
+just scans the X and Y columns and counts up how many photons were
+recorded in each pixel of the image.  When table binning is specified,
+CFITSIO creates a temporary FITS primary array in memory by computing
+the histogram of the values in the specified columns.  After the
+histogram is computed the original FITS file containing the table is
+closed and the temporary FITS primary array is opened and passed to the
+application program.  Thus, the application program never sees the
+original FITS table and only sees the image in the new temporary file
+(which has no extensions).
+
+The table binning specifier is enclosed in square brackets following
+the root filename and table extension name or number and begins with
+the keyword 'bin', as in: \newline  
+{\tt 'myfile.fits[events][bin (X,Y)]'}. In
+this case, the X and Y columns in the 'events' table extension are
+binned up to create the image.  The size of the image is usually
+determined by the {\tt TLMINn} and {\tt TLMAXn} header keywords which
+give the minimum and maximum allowed pixel values in the columns.  For
+instance if {\tt TLMINn = 1} and {\tt TLMAXn = 4096} for both columns, this would
+generate a 4096 x 4096 pixel image by default.  This is rather large,
+so you can also specify a pixel binning factor to reduce the image
+size.  For example specifying ,  {\tt '[bin (X,Y) = 16]'} will use a
+binning factor of 16, which will produce a 256 x 256 pixel image in the
+previous example.
+
+If the TLMIN and TLMAX keywords don't exist, or you want to override
+their values,  you can specify the image range and binning factor
+directly, as in {\tt '[bin X = 1:4096:16, Y=1:4096:16]'}.  You can also
+specify the datatype of the created image by appending a b, i, j, r, or
+d (for 8-bit byte, 16-bit integers, 32-bit integer, 32-bit floating
+points, or 64-bit double precision floating point, respectively)  to
+the 'bin' keyword (e.g. {\tt '[binr (X,Y)]'} creates a floating point
+image).  If the datatype is not specified then a 32-bit integer image
+will be created by default.
+
+If the column name is not specified, then CFITSIO will first try to use
+the 'preferred column' as specified by the CPREF keyword if it exists
+(e.g., 'CPREF = 'DETX,DETY'), otherwise column names 'X', 'Y' will be
+assumed for the 2 axes.
+
+Note that this binning specifier is not restricted to only 2D images
+and can be used to create 1D, 3D, or 4D images as well.  It is also
+possible to specify a weighting factor that is applied during the
+binning.  Please refer to the ``CFITSIO User's Reference Guide'' for
+more details on these advanced features.
+\newpage
+
+\subsection{Table Filtering}
+
+\subsubsection{Column and Keyword Filtering}
+
+The column or keyword filtering specifier is used to modify the
+column structure and/or the header keywords in the HDU that was
+selected with the previous HDU location specifier.   It can
+be used to perform the following types of operations. 
+
+\begin{itemize}
+\item
+Append a new column to a table by giving the column name, optionally
+followed by the datatype in parentheses, followed by an equals sign and
+the arithmetic  expression to be used to compute the value.  The
+datatype is specified using the same syntax that is allowed for the
+value of the FITS TFORMn keyword (e.g., 'I', 'J', 'E', 'D', etc. for
+binary tables, and 'I8', F12.3', 'E20.12', etc.  for ASCII tables).  If
+the datatype is not specified then a default datatype will be chosen
+depending on the expression.
+
+\item
+Create a new header keyword by giving the keyword name, preceded by a
+pound sign '\#', followed by an equals sign and an arithmetic
+expression for the value of the keyword.  The expression may be a
+function of other header keyword values.  The comment string for the
+keyword may be specified in parentheses immediately following the
+keyword name.
+
+\item
+Overwrite the values in an existing column or keyword by giving the
+name followed by an equals sign and an arithmetic expression.
+
+\item
+Select a set of columns to be included in the filtered file by listing
+the column names separated with semi-colons.   Wild card characters may
+be used in the column names to match multiple columns.  Any other
+columns in the input table will not appear in the filtered file.
+
+\item
+Delete a column or keyword by listing the name preceded by a minus sign
+or an exclamation mark (!)
+
+\item
+Rename an existing column or keyword with the syntax 'NewName ==
+OldName'.
+
+\end{itemize}
+
+The column filtering specifier is enclosed in square brackets and
+begins with the string 'col'.   Multiple operations can be performed
+by separating them with semi-colons.  For  complex  or commonly used
+operations,  you can write the column filter to a text file, and then
+use it by giving the name of the text file, preceded by a '@'
+character.
+
+Some examples:
+
+\begin{verbatim}
+  [col PI=PHA * 1.1 + 0.2]      - creates new PI column from PHA values
+
+  [col rate = counts/exposure]  - creates or overwrites the rate column by
+                                  dividing the counts column by the
+                                  EXPOSURE keyword value.
+
+  [col TIME; X; Y]              - only the listed columns will appear
+                                  in the filtered file
+
+  [col Time;*raw]               - include the Time column and any other
+                                  columns whose name ends with 'raw'.
+
+  [col -TIME; Good == STATUS]   - deletes the TIME column and
+                                  renames the STATUS column to GOOD
+
+  [col @colfilt.txt]            - uses the filtering expression in
+                                  the colfilt.txt text file
+\end{verbatim}
+
+The original file is not changed by this filtering operation, and
+instead the modifications are made on a temporary copy of the input
+FITS file (usually in memory), which includes a copy of all the other
+HDUs in the input file.   The original input file is closed and the
+application program opens the filtered copy of the file.
+
+\subsubsection{Row Filtering}
+
+The row filter is used to select a subset of the rows from a table
+based on a boolean expression.  A temporary new FITS file is created on
+the fly (usually in memory) which contains only those rows for which
+the row filter expression evaluates to true (i.e., not equal to zero).
+The primary array and any other extensions in the input file are also
+copied to the temporary file.  The original FITS file is closed and the
+new temporary file is then opened by the application program.
+
+The row filter expression is enclosed in square brackets following the
+file name and extension name.  For example, {\tt
+'file.fits[events][GRADE==50]'}  selects only those rows in the EVENTS
+table where the GRADE column value is equal to 50).
+
+The row filtering  expression can be an arbitrarily  complex series of
+operations performed  on constants,  keyword values,  and column data
+taken from the specified FITS TABLE extension.  The expression 
+also can be written into a text file and then used by giving the
+filename preceded by a '@' character, as in
+{\tt '[@rowfilt.txt]'}.
+
+Keyword and column data  are referenced by   name.  Any  string of
+characters not surrounded by    quotes (ie, a constant  string)   or
+followed by   an open parentheses (ie,   a  function name)   will be
+initially interpreted   as a column  name and  its contents for the
+current row inserted into the expression.  If no such column exists,
+a keyword of that  name will be searched for  and its value used, if
+found.  To force the  name to be  interpreted as a keyword (in case
+there is both a column and keyword with the  same name), precede the
+keyword name with a single pound sign, '\#', as in {\tt \#NAXIS2}.  Due to
+the generalities of FITS column and  keyword names, if the column or
+keyword name  contains a space or a  character which might appear as
+an arithmetic  term then inclose  the  name in '\$'  characters as in
+{\tt \$MAX PHA\$} or {\tt \#\$MAX-PHA\$}.  The names are case insensitive.
+
+To access a table entry in a row other  than the current one, follow
+the  column's name  with  a row  offset  within  curly  braces.  For
+example, {\tt'PHA\{-3\}'} will evaluate to the value  of column PHA, 3 rows
+above  the  row currently  being processed.   One  cannot specify an
+absolute row number, only a relative offset.  Rows that fall outside
+the table will be treated as undefined, or NULLs.
+
+Boolean   operators can be  used in  the expression  in either their
+Fortran or C forms.  The following boolean operators are available:
+
+\begin{verbatim}
+    "equal"         .eq. .EQ. ==  "not equal"          .ne.  .NE.  !=
+    "less than"     .lt. .LT. <   "less than/equal"    .le.  .LE.  <= =<
+    "greater than"  .gt. .GT. >   "greater than/equal" .ge.  .GE.  >= =>
+    "or"            .or. .OR. ||  "and"                .and. .AND. &&
+    "negation"     .not. .NOT. !  "approx. equal(1e-7)"  ~
+\end{verbatim}
+
+Note  that the exclamation point,  '!', is a special UNIX character, so
+if it is used  on the command line rather than entered at a task
+prompt, it must be  preceded by a backslash to force the UNIX shell to
+ignore it.
+
+The expression may  also include arithmetic operators and functions.
+Trigonometric  functions use  radians,  not degrees.  The  following
+arithmetic  operators and  functions  can be  used in the expression
+(function names are case insensitive):
+
+ 
+\begin{verbatim}
+    "addition"           +          "subtraction"          -
+    "multiplication"     *          "division"             /
+    "negation"           -          "exponentiation"       **   ^
+    "absolute value"     abs(x)     "cosine"               cos(x)
+    "sine"               sin(x)     "tangent"              tan(x)
+    "arc cosine"         arccos(x)  "arc sine"             arcsin(x)
+    "arc tangent"        arctan(x)  "arc tangent"          arctan2(x,y)
+    "exponential"        exp(x)     "square root"          sqrt(x)
+    "natural log"        log(x)     "common log"           log10(x)
+    "modulus"            i % j      "random # [0.0,1.0)"   random()
+    "minimum"            min(x,y)   "maximum"              max(x,y)
+    "if-then-else"       b?x:y
+\end{verbatim}
+
+
+The  following  type  casting  operators  are  available,  where the
+inclosing parentheses are required and taken  from  the  C  language
+usage. Also, the integer to real casts values to double precision:
+
+\begin{verbatim}
+                "real to integer"    (int) x     (INT) x
+                "integer to real"    (float) i   (FLOAT) i
+\end{verbatim}
+
+
+Several constants are built in  for  use  in  numerical
+expressions:
+
+ 
+\begin{verbatim}
+        #pi              3.1415...      #e             2.7182...
+        #deg             #pi/180        #row           current row number
+        #null         undefined value   #snull         undefined string
+\end{verbatim}
+
+A  string constant must  be enclosed  in quotes  as in  'Crab'.  The
+"null" constants  are useful for conditionally  setting table values to
+a NULL, or undefined, value (For example,  {\tt "col1==-99 ? \#NULL :
+col1"}).
+
+There is also a function for testing if  two  values  are  close  to
+each  other,  i.e.,  if  they are "near" each other to within a user
+specified tolerance. The  arguments,  {\tt value\_1}  and  {\tt value\_2}  can  be
+integer  or  real  and  represent  the two values who's proximity is
+being tested to be within the specified tolerance, also  an  integer
+or real:
+
+\begin{verbatim}
+                    near(value_1, value_2, tolerance)
+\end{verbatim}
+
+When  a  NULL, or undefined, value is encountered in the FITS table,
+the expression will evaluate to NULL unless the undefined  value  is
+not   actually   required  for  evaluation,  e.g. "TRUE  .or.  NULL"
+evaluates to TRUE. The  following  two  functions  allow  some  NULL
+detection  and  handling:  
+
+\begin{verbatim}
+                   ISNULL(x)
+                   DEFNULL(x,y)
+\end{verbatim}
+
+The former returns a boolean value of TRUE if the  argument  x  is
+NULL.   The later  "defines"  a  value  to  be  substituted  for NULL
+values; it returns the value of x if x is not NULL, otherwise  it
+returns  the value of y.
+
+Bit  masks can be used to select out rows from bit columns ({\tt TFORMn =
+\#X}) in FITS files. To represent the mask,  binary,  octal,  and  hex
+formats are allowed:
+ 
+\begin{verbatim}
+                 binary:   b0110xx1010000101xxxx0001
+                 octal:    o720x1 -> (b111010000xxx001)
+                 hex:      h0FxD  -> (b00001111xxxx1101)
+\end{verbatim}
+
+In  all  the  representations, an x or X is allowed in the mask as a
+wild card. Note that the x represents a  different  number  of  wild
+card  bits  in  each  representation.  All  representations are case
+insensitive.
+
+To construct the boolean expression using the mask  as  the  boolean
+equal  operator  described above on a bit table column. For example,
+if you had a 7 bit column named flags in a  FITS  table  and  wanted
+all  rows  having  the bit pattern 0010011, the selection expression
+would be:
+
+ 
+\begin{verbatim}
+                            flags == b0010011
+    or
+                            flags .eq. b10011
+\end{verbatim}
+
+It is also possible to test if a range of bits is  less  than,  less
+than  equal,  greater  than  and  greater than equal to a particular
+boolean value:
+
+ 
+\begin{verbatim}
+                            flags <= bxxx010xx
+                            flags .gt. bxxx100xx
+                            flags .le. b1xxxxxxx
+\end{verbatim}
+
+Notice the use of the x bit value to limit the range of  bits  being
+compared.
+
+It  is  not necessary to specify the leading (most significant) zero
+(0) bits in the mask, as shown in the second expression above.
+
+Bit wise AND, OR and NOT operations are  also  possible  on  two  or
+more  bit  fields  using  the  '\&'(AND),  '$|$'(OR),  and the '!'(NOT)
+operators. All of these operators result in a bit  field  which  can
+then be used with the equal operator. For example:
+
+ 
+\begin{verbatim}
+                          (!flags) == b1101100
+                          (flags & b1000001) == bx000001
+\end{verbatim}
+
+Bit  fields can be appended as well using the '+' operator.  Strings
+can be concatenated this way, too.
+
+\subsubsection{Good Time Interval Filtering}
+
+    A common filtering method involves selecting rows which have a time
+    value which lies within what is called a Good Time Interval or GTI.
+    The time intervals are defined in a separate FITS table extension
+    which contains 2 columns giving the start and stop time of each
+    good interval.  The filtering operation accepts only those rows of
+    the input table which have an associated time which falls within
+    one of the time intervals defined in the GTI extension. A high
+    level function, gtifilter(a,b,c,d), is available which evaluates
+    each row of the input table  and returns TRUE  or FALSE depending
+    whether the row is inside or outside the  good time interval.  The
+    syntax is
+ 
+\begin{verbatim}
+      gtifilter( [ "gtifile" [, expr [, "STARTCOL", "STOPCOL" ] ] ] )
+\end{verbatim}
+    where  each "[]" demarks optional parameters.  Note that  the quotes
+    around the gtifile and START/STOP column are required.  Either single
+    or double quote characters may be used.  The gtifile,
+    if specified,  can be blank  ("") which will  mean to use  the first
+    extension  with   the name "*GTI*"  in   the current  file,  a plain
+    extension  specifier (eg, "+2",  "[2]", or "[STDGTI]") which will be
+    used  to  select  an extension  in  the current  file, or  a regular
+    filename with or without an extension  specifier which in the latter
+    case  will mean to  use the first  extension  with an extension name
+    "*GTI*".  Expr can be   any arithmetic expression, including  simply
+    the time  column  name.  A  vector  time expression  will  produce a
+    vector boolean  result.  STARTCOL and  STOPCOL are the  names of the
+    START/STOP   columns in the    GTI extension.  If   one  of them  is
+    specified, they both  must be.
+
+    In  its  simplest form, no parameters need to be provided -- default
+    values will be used.  The expression {\tt "gtifilter()"} is equivalent to
+ 
+\begin{verbatim}
+       gtifilter( "", TIME, "*START*", "*STOP*" )
+\end{verbatim}
+    This will search the current file for a GTI  extension,  filter  the
+    TIME  column in the current table, using START/STOP times taken from
+    columns in the GTI  extension  with  names  containing  the  strings
+    "START"  and "STOP".  The wildcards ('*') allow slight variations in
+    naming conventions  such  as  "TSTART"  or  "STARTTIME".   The  same
+    default  values  apply for unspecified parameters when the first one
+    or  two  parameters  are  specified.   The  function   automatically
+    searches   for   TIMEZERO/I/F   keywords  in  the  current  and  GTI
+    extensions, applying a relative time offset, if necessary.
+
+\subsubsection{Spatial Region Filtering}
+
+    Another common  filtering method selects rows based on whether the
+    spatial position associated with each row is located within a given
+    2-dimensional region.  The syntax for this high-level filter is
+ 
+\begin{verbatim}
+       regfilter( "regfilename" [ , Xexpr, Yexpr [ , "wcs cols" ] ] )
+\end{verbatim}
+    where each "[ ]" demarks optional parameters. The region file name
+    is required and must be  enclosed in quotes.  The remaining
+    parameters are optional.  The region file is an ASCII text file
+    which contains a list of one or more geometric shapes (circle,
+    ellipse, box, etc.) which defines a region on the celestial sphere
+    or an area within a particular 2D image.  The region file is
+    typically generated using an image display program such as fv/POW
+    (distribute by the HEASARC), or ds9 (distributed by the Smithsonian
+    Astrophysical Observatory).  Users should refer to the documentation
+    provided with these programs for more details on the syntax used in
+    the region files.
+
+    In its simpliest form, (e.g., {\tt regfilter("region.reg")} ) the
+    coordinates in the default 'X' and 'Y' columns will be used to
+    determine if each row is inside or outside the area specified in
+    the region file.  Alternate position column names, or expressions,
+    may be entered if needed, as in
+ 
+\begin{verbatim}
+        regfilter("region.reg", XPOS, YPOS)
+\end{verbatim}
+    Region filtering can be applied most unambiguously if the positions
+    in the region file and in the table to be filtered are both give in
+    terms of absolute celestial coordinate units.  In this case the
+    locations and sizes of the geometric shapes in the region file are
+    specified in angular units on the sky (e.g., positions given in
+    R.A. and Dec.  and sizes in arcseconds or arcminutes).  Similarly,
+    each row of the filtered table will have a celestial coordinate
+    associated with it.  This association is usually implemented using
+    a set of so-called 'World Coordinate System' (or WCS) FITS keywords
+    that define the coordinate transformation that must be applied to
+    the values in the 'X' and 'Y' columns to calculate the coordinate.
+
+    Alternatively, one can perform spatial filtering using unitless
+    'pixel' coordinates for the regions and row positions.  In this
+    case the user must be careful to ensure that the positions in the 2
+    files are self-consistent.  A typical problem is that the region
+    file may be generated using a binned image, but the unbinned
+    coordinates are given in the event table.  The ROSAT events files,
+    for example, have X and Y pixel coordinates that range from 1 -
+    15360.  These coordinates are typically binned by a factor of 32 to
+    produce a 480x480 pixel image.  If one then uses a region file
+    generated from this image (in image pixel units) to filter the
+    ROSAT events file, then the X and Y column values must be converted
+    to corresponding pixel units as in:
+ 
+\begin{verbatim}
+        regfilter("rosat.reg", X/32.+.5, Y/32.+.5)
+\end{verbatim}
+    Note that this binning conversion is not necessary if the region
+    file is specified using celestial coordinate units instead of pixel
+    units because CFITSIO is then able to directly compare the
+    celestial coordinate of each row in the table with the celestial
+    coordinates in the region file without having to know anything
+    about how the image may have been binned.
+
+    The last "wcs cols" parameter should rarely be needed. If supplied,
+    this  string contains the names of the 2 columns (space or comma
+    separated) which have the associated WCS keywords. If not supplied,
+    the filter  will scan the X  and Y expressions for column names.
+    If only one is found in each  expression, those columns will be
+    used, otherwise an error will be returned.
+
+    These region shapes are supported (names are case insensitive):
+ 
+\begin{verbatim}
+       Point         ( X1, Y1 )               <- One pixel square region
+       Line          ( X1, Y1, X2, Y2 )       <- One pixel wide region
+       Polygon       ( X1, Y1, X2, Y2, ... )  <- Rest are interiors with
+       Rectangle     ( X1, Y1, X2, Y2, A )       | boundaries considered
+       Box           ( Xc, Yc, Wdth, Hght, A )   V within the region
+       Diamond       ( Xc, Yc, Wdth, Hght, A )
+       Circle        ( Xc, Yc, R )
+       Annulus       ( Xc, Yc, Rin, Rout )
+       Ellipse       ( Xc, Yc, Rx, Ry, A )
+       Elliptannulus ( Xc, Yc, Rinx, Riny, Routx, Routy, Ain, Aout )
+       Sector        ( Xc, Yc, Amin, Amax )
+\end{verbatim}
+    where (Xc,Yc) is  the coordinate of  the shape's center; (X\#,Y\#) are
+    the coordinates  of the shape's edges;  Rxxx are the shapes' various
+    Radii or semimajor/minor  axes; and Axxx  are the angles of rotation
+    (or bounding angles for Sector) in degrees.  For rotated shapes, the
+    rotation angle  can  be left  off, indicating  no rotation.   Common
+    alternate  names for the regions  can also be  used: rotbox = box;
+    rotrectangle = rectangle;  (rot)rhombus = (rot)diamond;  and pie
+    = sector.  When a  shape's name is  preceded by a minus sign, '-',
+    the defined region  is instead the area  *outside* its boundary (ie,
+    the region is inverted).  All the shapes within a single region
+    file are OR'd together to create the region, and the order is
+    significant. The overall way of looking at region files is that if
+    the first region is an excluded region then a dummy included region
+    of the whole detector is inserted in the front. Then each region
+    specification as it is processed overrides any selections inside of
+    that region specified by previous regions. Another way of thinking
+    about this is that if a previous excluded region is completely
+    inside of a subsequent included region the excluded region is
+    ignored.
+
+    The positional coordinates may be given either in pixel units,
+    decimal degrees or hh:mm:ss.s, dd:mm:ss.s units.  The shape sizes
+    may be given in pixels, degrees, arcminutes, or arcseconds.  Look
+    at examples of region file produced by fv/POW or ds9 for further
+    details of the region file format.
+
+\subsubsection{Example Row Filters}
+ 
+\begin{verbatim}
+    [double && mag <= 5.0]        -  Extract all double stars brighter
+                                     than  fifth magnitude 
+
+    [#row >= 125 && #row <= 175]   - Extract row numbers 125 through 175
+
+    [abs(sin(theta * #deg)) < 0.5] - Extract all rows having the
+                                     absolute value of the sine of theta
+                                     less  than a half where the angles
+                                     are tabulated in degrees
+
+    [@rowFilter.txt]               - Extract rows using the expression
+                                     contained within the text file
+                                     rowFilter.txt
+
+    [gtifilter()]                  - Search the current file for a GTI
+				     extension,  filter  the TIME
+				     column in the current table, using
+				     START/STOP times taken from
+				     columns in the GTI  extension
+
+    [regfilter("pow.reg")]         - Extract rows which have a coordinate
+                                     (as given in the X and Y columns)
+                                     within the spatial region specified
+                                     in the pow.reg region file.
+\end{verbatim}
+
+\newpage
+\subsection{Combined Filtering Examples}
+
+The previous sections described all the individual types of filters
+that may be applied to the input file.  In this section we show
+examples which combine several different filters at once.  These
+examples all use the {\tt fitscopy} program that is distributed with
+the CFITSIO code.  It simply copies the input file to the output file.
+
+\begin{verbatim}
+fitscopy rosat.fit out.fit
+\end{verbatim}
+
+This trivial example simply makes an identical copy of the input
+rosat.fit file without any filtering.
+
+\begin{verbatim}
+fitscopy 'rosat.fit[events][col Time;X;Y][#row < 1000]' out.fit
+\end{verbatim}
+
+The output file contains only the Time, X, and Y columns, and only
+the first 999 rows from the 'EVENTS' table extension of the input file.
+All the other HDUs in the input file are copied to the output file
+without any modification.
+
+\begin{verbatim}
+fitscopy 'rosat.fit[events][PI < 50][bin (Xdet,Ydet) = 16]' image.fit
+\end{verbatim}
+
+This creates an output image by binning the Xdet and Ydet columns of
+the events table with a pixel binning factor of 16.  Only the rows
+which have a PI energy less than 50 are used to construct this image.
+The output image file contains a primary array image without any
+extensions.
+
+\begin{verbatim}
+fitscopy 'rosat.fit[events][gtifilter() && regfilter("pow.reg")]' out.fit
+\end{verbatim}
+
+The filtering expression in this example uses the {\tt gtifilter}
+function to test whether the TIME column value in each row is within
+one of the Good Time Intervals defined in the GTI extension in the same
+input file, and also uses the {\tt regfilter} function to test if the
+position associated with each row (derived by default from the values
+in the X and Y columns of the events table) is located within the area
+defined in the {\tt pow.reg} text region file (which was previously
+created with the {\tt fv/POW} image display program).  Only the rows
+which satisfy both tests are copied to the output table.
+
+\begin{verbatim}
+fitscopy 'r.fit[evt][PI<50]' stdout | fitscopy stdin[evt][col X,Y] out.fit
+\end{verbatim}
+
+In this somewhat convoluted example, fitscopy is used to first select
+the rows from the evt extension which have PI less than 50 and write the
+resulting table out to the stdout stream.  This is piped to a 2nd
+instance of fitscopy (with the Unix `$|$' pipe command) which reads that
+filtered FITS file from the stdin stream and copies only the X and Y
+columns from the evt table to the output file.
+
+\begin{verbatim}
+fitscopy 'r.fit[evt][col RAD=sqrt((X-#XCEN)**2+(Y-#YCEN)**2)][rad<100]' out.fit
+\end{verbatim}
+
+This example first creates a new column called RAD which gives the
+distance between the X,Y coordinate of each event and the coordinate
+defined by the XCEN and YCEN keywords in the header.  Then, only those
+rows which have a distance less than 100 are copied to the output
+table.  In other words, only the events which are located within 100
+pixel units from the (XCEN, YCEN) coordinate are copied to the output
+table.
+
+\begin{verbatim}
+fitscopy 'ftp://heasarc.gsfc.nasa.gov/rosat.fit[events][bin (X,Y)=16]' img.fit
+\end{verbatim}
+
+This example bins the X and Y columns of the hypothetical ROSAT file 
+at the HEASARC ftp site to create the output image.
+
+\begin{verbatim}
+fitscopy 'raw.fit[i512,512][101:110,51:60]' image.fit
+\end{verbatim}
+
+This example converts the 512 x 512 pixel raw binary 16-bit integer
+image to a FITS file and copies a 10 x 10 pixel subimage from it to the
+output FITS image.
+
+\newpage
+\section{CFITSIO Error Status Codes}
+
+The following table lists all the error status codes used by CFITSIO.
+Programmers are encouraged to use the symbolic mnemonics (defined in
+the file fitsio.h) rather than the actual integer status values to
+improve the readability of their code.
+
+\begin{verbatim}
+ Symbolic Const    Value     Meaning
+ --------------    -----  -----------------------------------------
+                     0    OK, no error
+ SAME_FILE         101    input and output files are the same
+ TOO_MANY_FILES    103    tried to open too many FITS files at once
+ FILE_NOT_OPENED   104    could not open the named file
+ FILE_NOT_CREATED  105    could not create the named file
+ WRITE_ERROR       106    error writing to FITS file
+ END_OF_FILE       107    tried to move past end of file
+ READ_ERROR        108    error reading from FITS file
+ FILE_NOT_CLOSED   110    could not close the file
+ ARRAY_TOO_BIG     111    array dimensions exceed internal limit
+ READONLY_FILE     112    Cannot write to readonly file
+ MEMORY_ALLOCATION 113    Could not allocate memory
+ BAD_FILEPTR       114    invalid fitsfile pointer
+ NULL_INPUT_PTR    115    NULL input pointer to routine 
+ SEEK_ERROR        116    error seeking position in file 
+
+ BAD_URL_PREFIX     121   invalid URL prefix on file name 
+ TOO_MANY_DRIVERS   122   tried to register too many IO drivers 
+ DRIVER_INIT_FAILED 123   driver initialization failed 
+ NO_MATCHING_DRIVER 124   matching driver is not registered 
+ URL_PARSE_ERROR    125   failed to parse input file URL
+
+ SHARED_BADARG     151    bad argument in shared memory driver
+ SHARED_NULPTR     152    null pointer passed as an argument
+ SHARED_TABFULL    153    no more free shared memory handles
+ SHARED_NOTINIT    154    shared memory driver is not initialized
+ SHARED_IPCERR     155    IPC error returned by a system call
+ SHARED_NOMEM      156    no memory in shared memory driver
+ SHARED_AGAIN      157    resource deadlock would occur
+ SHARED_NOFILE     158    attempt to open/create lock file failed
+ SHARED_NORESIZE   159    shared memory block cannot be resized at the moment
+
+ HEADER_NOT_EMPTY  201    header already contains keywords
+ KEY_NO_EXIST      202    keyword not found in header
+ KEY_OUT_BOUNDS    203    keyword record number is out of bounds
+ VALUE_UNDEFINED   204    keyword value field is blank 
+ NO_QUOTE          205    string is missing the closing quote
+ BAD_KEYCHAR       207    illegal character in keyword name or card
+ BAD_ORDER         208    required keywords out of order
+ NOT_POS_INT       209    keyword value is not a positive integer
+ NO_END            210    couldn't find END keyword
+ BAD_BITPIX        211    illegal BITPIX keyword value
+ BAD_NAXIS         212    illegal NAXIS keyword value
+ BAD_NAXES         213    illegal NAXISn keyword value
+ BAD_PCOUNT        214    illegal PCOUNT keyword value
+ BAD_GCOUNT        215    illegal GCOUNT keyword value
+ BAD_TFIELDS       216    illegal TFIELDS keyword value
+ NEG_WIDTH         217    negative table row size
+ NEG_ROWS          218    negative number of rows in table
+ COL_NOT_FOUND     219    column with this name not found in table
+ BAD_SIMPLE        220    illegal value of SIMPLE keyword
+ NO_SIMPLE         221    Primary array doesn't start with SIMPLE
+ NO_BITPIX         222    Second keyword not BITPIX
+ NO_NAXIS          223    Third keyword not NAXIS
+ NO_NAXES          224    Couldn't find all the NAXISn keywords
+ NO_XTENSION       225    HDU doesn't start with XTENSION keyword
+ NOT_ATABLE        226    the CHDU is not an ASCII table extension
+ NOT_BTABLE        227    the CHDU is not a binary table extension
+ NO_PCOUNT         228    couldn't find PCOUNT keyword
+ NO_GCOUNT         229    couldn't find GCOUNT keyword
+ NO_TFIELDS        230    couldn't find TFIELDS keyword
+ NO_TBCOL          231    couldn't find TBCOLn keyword
+ NO_TFORM          232    couldn't find TFORMn keyword
+ NOT_IMAGE         233    the CHDU is not an IMAGE extension
+ BAD_TBCOL         234    TBCOLn keyword value < 0 or > rowlength
+ NOT_TABLE         235    the CHDU is not a table
+ COL_TOO_WIDE      236    column is too wide to fit in table
+ COL_NOT_UNIQUE    237    more than 1 column name matches template
+ BAD_ROW_WIDTH     241    sum of column widths not = NAXIS1
+ UNKNOWN_EXT       251    unrecognizable FITS extension type
+ UNKNOWN_REC       252    unknown record; 1st keyword not SIMPLE or XTENSION
+ END_JUNK          253    END keyword is not blank
+ BAD_HEADER_FILL   254    Header fill area contains non-blank chars
+ BAD_DATA_FILL     255    Illegal data fill bytes (not zero or blank)
+ BAD_TFORM         261    illegal TFORM format code
+ BAD_TFORM_DTYPE   262    unrecognizable TFORM datatype code
+ BAD_TDIM          263    illegal TDIMn keyword value
+ BAD_HEAP_PTR      264    invalid BINTABLE heap pointer is out of range
+
+ BAD_HDU_NUM       301    HDU number < 1 or > MAXHDU
+ BAD_COL_NUM       302    column number < 1 or > tfields
+ NEG_FILE_POS      304    tried to move to negative byte location in file
+ NEG_BYTES         306    tried to read or write negative number of bytes
+ BAD_ROW_NUM       307    illegal starting row number in table
+ BAD_ELEM_NUM      308    illegal starting element number in vector
+ NOT_ASCII_COL     309    this is not an ASCII string column
+ NOT_LOGICAL_COL   310    this is not a logical datatype column
+ BAD_ATABLE_FORMAT 311    ASCII table column has wrong format
+ BAD_BTABLE_FORMAT 312    Binary table column has wrong format
+ NO_NULL           314    null value has not been defined
+ NOT_VARI_LEN      317    this is not a variable length column
+ BAD_DIMEN         320    illegal number of dimensions in array
+ BAD_PIX_NUM       321    first pixel number greater than last pixel
+ ZERO_SCALE        322    illegal BSCALE or TSCALn keyword = 0
+ NEG_AXIS          323    illegal axis length < 1
+
+ NOT_GROUP_TABLE       340   Grouping function error
+ HDU_ALREADY_MEMBER    341
+ MEMBER_NOT_FOUND      342
+ GROUP_NOT_FOUND       343
+ BAD_GROUP_ID          344
+ TOO_MANY_HDUS_TRACKED 345
+ HDU_ALREADY_TRACKED   346
+ BAD_OPTION            347
+ IDENTICAL_POINTERS    348
+ BAD_GROUP_ATTACH      349
+ BAD_GROUP_DETACH      350
+
+ NGP_NO_MEMORY         360     malloc failed
+ NGP_READ_ERR          361     read error from file
+ NGP_NUL_PTR           362     null pointer passed as an argument.
+                                 Passing null pointer as a name of
+                                 template file raises this error
+ NGP_EMPTY_CURLINE     363     line read seems to be empty (used
+                                 internally)
+ NGP_UNREAD_QUEUE_FULL 364     cannot unread more then 1 line (or single
+                                 line twice)
+ NGP_INC_NESTING       365     too deep include file nesting (infinite
+                                 loop, template includes itself ?)
+ NGP_ERR_FOPEN         366     fopen() failed, cannot open template file
+ NGP_EOF               367     end of file encountered and not expected
+ NGP_BAD_ARG           368     bad arguments passed. Usually means
+                                 internal parser error. Should not happen
+ NGP_TOKEN_NOT_EXPECT  369     token not expected here
+
+ BAD_I2C           401    bad int to formatted string conversion
+ BAD_F2C           402    bad float to formatted string conversion
+ BAD_INTKEY        403    can't interpret keyword value as integer
+ BAD_LOGICALKEY    404    can't interpret keyword value as logical
+ BAD_FLOATKEY      405    can't interpret keyword value as float
+ BAD_DOUBLEKEY     406    can't interpret keyword value as double
+ BAD_C2I           407    bad formatted string to int conversion
+ BAD_C2F           408    bad formatted string to float conversion
+ BAD_C2D           409    bad formatted string to double conversion
+ BAD_DATATYPE      410    illegal datatype code value
+ BAD_DECIM         411    bad number of decimal places specified
+ NUM_OVERFLOW      412    overflow during datatype conversion
+ DATA_COMPRESSION_ERR   413  error compressing image 
+ DATA_DECOMPRESSION_ERR 414  error uncompressing image 
+
+ BAD_DATE          420    error in date or time conversion 
+
+ PARSE_SYNTAX_ERR  431    syntax error in parser expression 
+ PARSE_BAD_TYPE    432    expression did not evaluate to desired type 
+ PARSE_LRG_VECTOR  433    vector result too large to return in array 
+ PARSE_NO_OUTPUT   434    data parser failed not sent an out column 
+ PARSE_BAD_COL     435    bad data encounter while parsing column 
+ PARSE_BAD_OUTPUT  436    Output file not of proper type          
+
+ ANGLE_TOO_BIG     501    celestial angle too large for projection 
+ BAD_WCS_VAL       502    bad celestial coordinate or pixel value 
+ WCS_ERROR         503    error in celestial coordinate calculation  
+ BAD_WCS_PROJ      504    unsupported type of celestial projection 
+ NO_WCS_KEY        505    celestial coordinate keywords not found
+ APPROX_WCS_KEY    506    approximate wcs keyword values were returned
+\end{verbatim}
+
+\end{document}
diff --git a/quick.toc b/quick.toc
new file mode 100644
index 0000000..9d7c7da
--- /dev/null
+++ b/quick.toc
@@ -0,0 +1,25 @@
+\contentsline {section}{\numberline {1}Introduction}{2}
+\contentsline {section}{\numberline {2}Installing and Using CFITSIO}{3}
+\contentsline {section}{\numberline {3}Example Programs}{4}
+\contentsline {section}{\numberline {4}CFITSIO Routines}{6}
+\contentsline {subsection}{\numberline {4.1}Error Reporting}{6}
+\contentsline {subsection}{\numberline {4.2}File Open/Close Routines}{6}
+\contentsline {subsection}{\numberline {4.3}HDU-level Routines}{7}
+\contentsline {subsection}{\numberline {4.4}Image I/O Routines}{9}
+\contentsline {subsection}{\numberline {4.5}Table I/O Routines}{12}
+\contentsline {subsection}{\numberline {4.6}Header Keyword I/O Routines}{19}
+\contentsline {subsection}{\numberline {4.7}Utility Routines}{22}
+\contentsline {section}{\numberline {5}CFITSIO File Names and Filters}{23}
+\contentsline {subsection}{\numberline {5.1}Creating New Files}{23}
+\contentsline {subsection}{\numberline {5.2}Opening Existing Files}{24}
+\contentsline {subsection}{\numberline {5.3}Image Filtering}{26}
+\contentsline {subsubsection}{\numberline {5.3.1}Extracting a subsection of an image}{26}
+\contentsline {subsubsection}{\numberline {5.3.2}Create an Image by Binning Table Columns}{26}
+\contentsline {subsection}{\numberline {5.4}Table Filtering}{28}
+\contentsline {subsubsection}{\numberline {5.4.1}Column and Keyword Filtering}{28}
+\contentsline {subsubsection}{\numberline {5.4.2}Row Filtering}{29}
+\contentsline {subsubsection}{\numberline {5.4.3}Good Time Interval Filtering}{32}
+\contentsline {subsubsection}{\numberline {5.4.4}Spatial Region Filtering}{32}
+\contentsline {subsubsection}{\numberline {5.4.5}Example Row Filters}{34}
+\contentsline {subsection}{\numberline {5.5}Combined Filtering Examples}{36}
+\contentsline {section}{\numberline {6}CFITSIO Error Status Codes}{38}
diff --git a/region.c b/region.c
index 0fb4d89..c04d9f5 100644
--- a/region.c
+++ b/region.c
@@ -20,10 +20,10 @@ int ffrrgn( const char *filename,
 {
    char     *currLine;
    char     *namePtr, *paramPtr, *currLoc;
-   char     *pX, *pY;
-   long     allocLen, lineLen;
-   double   *coords, X, Y, R, x, y;
-   int      nParams, nCoords;
+   char     *pX, *pY, *endp;
+   long     allocLen, lineLen, hh, mm, dd;
+   double   *coords = 0, X, Y, R, x, y, ss, xsave= 0., ysave= 0.;
+   int      nParams, nCoords, negdec;
    int      i, done;
    FILE     *rgnFile;
    coordFmt cFmt;
@@ -44,7 +44,7 @@ int ffrrgn( const char *filename,
    else
       aRgn->wcs.exists = 0;
 
-   cFmt = pixel_fmt;
+   cFmt = pixel_fmt; /* set default format */
 
    /*  Allocate Line Buffer  */
 
@@ -109,6 +109,8 @@ int ffrrgn( const char *filename,
                cFmt = degree_fmt;
             } else if( !strncasecmp( currLoc, "hhmmss", 6 ) ) {
                cFmt = hhmmss_fmt;
+            } else if( !strncasecmp( currLoc, "hms", 3 ) ) {
+               cFmt = hhmmss_fmt;
             } else {
                ffpmsg("Unknown format code encountered in region file.");
                *status = PARSE_SYNTAX_ERR;
@@ -116,6 +118,9 @@ int ffrrgn( const char *filename,
             }
          }
 
+      } else if( !strncasecmp( currLoc, "glob", 4 ) ) {
+		  /* skip lines that begin with the word 'global' */
+
       } else {
 
          while( *currLoc != '\0' ) {
@@ -151,6 +156,14 @@ int ffrrgn( const char *filename,
                   if( !paramPtr )  /* Allow for a blank line */
                      done = 1;
                   break;
+               case ':':  
+                  currLoc++;
+                  cFmt = hhmmss_fmt;
+                  break;
+               case 'd':
+                  currLoc++;
+                  cFmt = degree_fmt;
+                  break;
                case ',':
                   nParams++;  /* Fall through to default */
                default:
@@ -172,6 +185,54 @@ int ffrrgn( const char *filename,
 
             if( ! *namePtr && ! paramPtr ) continue;
 
+
+            /*  Check for format code at beginning of the line */
+
+            if( !strncasecmp( namePtr, "image;", 6 ) ) {
+				namePtr += 6;
+				cFmt = pixel_fmt;
+            } else if( !strncasecmp( namePtr, "fk4;", 4 ) ) {
+				namePtr += 4;
+				cFmt = degree_fmt;
+            } else if( !strncasecmp( namePtr, "fk5;", 4 ) ) {
+				namePtr += 4;
+				cFmt = degree_fmt;
+            } else if( !strncasecmp( namePtr, "icrs;", 5 ) ) {
+				namePtr += 5;
+				cFmt = degree_fmt;
+
+            /* the following 4 cases support region files created by POW which
+               may have lines containing  only a format code, not followed
+               by a ';' (and with no region specifier on the line).  We use
+               the 'continue' statement to jump to the end of the loop and
+               then continue reading the next line of the region file. */
+
+            } else if( !strncasecmp( namePtr, "fk5", 3 ) ) {
+				cFmt = degree_fmt;
+                                continue;  /* supports POW region file format */
+            } else if( !strncasecmp( namePtr, "fk4", 3 ) ) {
+				cFmt = degree_fmt;
+                                continue;  /* supports POW region file format */
+            } else if( !strncasecmp( namePtr, "icrs", 4 ) ) {
+				cFmt = degree_fmt;
+                                continue;  /* supports POW region file format */
+            } else if( !strncasecmp( namePtr, "image", 5 ) ) {
+				cFmt = pixel_fmt;
+                                continue;  /* supports POW region file format */
+
+
+            } else if( !strncasecmp( namePtr, "galactic;", 9 ) ) {
+               ffpmsg( "Galactic region coordinates not supported" );
+               ffpmsg( namePtr );
+			   *status = PARSE_SYNTAX_ERR;
+               goto error;
+			} else if( !strncasecmp( namePtr, "ecliptic;", 9 ) ) {
+               ffpmsg( "ecliptic region coordinates not supported" );
+               ffpmsg( namePtr );
+			   *status = PARSE_SYNTAX_ERR;
+               goto error;
+            }
+
             /**************************************************/
             /*  We've apparently found a region... Set it up  */
             /**************************************************/
@@ -196,7 +257,9 @@ int ffrrgn( const char *filename,
             newShape->sign  = 1;
             newShape->shape = point_rgn;
 
-            /*  Check for the shape's sign  */
+            while( *namePtr==' ' ) namePtr++;
+            
+			/*  Check for the shape's sign  */
 
             if( *namePtr=='+' ) {
                namePtr++;
@@ -288,6 +351,7 @@ int ffrrgn( const char *filename,
             } else {
                ffpmsg( "Unrecognized region found in region file:" );
                ffpmsg( namePtr );
+               *status = PARSE_SYNTAX_ERR;
                goto error;
             }
             if( *status ) {
@@ -322,15 +386,54 @@ int ffrrgn( const char *filename,
                while( *paramPtr!=',' && *paramPtr != '\0' ) paramPtr++;
                *(paramPtr++) = '\0';
 
-               if( cFmt==hhmmss_fmt ) {
+               if( strchr(pX, ':' ) ) {
                   /*  Read in special format & convert to decimal degrees  */
-                  ffpmsg("hhmmss format not supported.");
-                  *status = PARSE_SYNTAX_ERR;
-                  goto error;
+                  cFmt = hhmmss_fmt;
+                  mm = 0;
+                  ss = 0.;
+                  hh = strtol(pX, &endp, 10);
+                  if (endp && *endp==':') {
+                      pX = endp + 1;
+                      mm = strtol(pX, &endp, 10);
+                      if (endp && *endp==':') {
+                          pX = endp + 1;
+                          ss = atof( pX );
+                      }
+                  }
+                  X = 15. * (hh + mm/60. + ss/3600.); /* convert to degrees */
+
+                  mm = 0;
+                  ss = 0.;
+                  negdec = 0;
+
+                  while( *pY==' ' ) pY++;
+                  if (*pY=='-') {
+                      negdec = 1;
+                      pY++;
+                  }
+                  dd = strtol(pY, &endp, 10);
+                  if (endp && *endp==':') {
+                      pY = endp + 1;
+                      mm = strtol(pY, &endp, 10);
+                      if (endp && *endp==':') {
+                          pY = endp + 1;
+                          ss = atof( pY );
+                      }
+                  }
+                  if (negdec)
+                     Y = -dd - mm/60. - ss/3600.; /* convert to degrees */
+                  else
+                     Y = dd + mm/60. + ss/3600.;
+
                } else {
                   X = atof( pX );
                   Y = atof( pY );
                }
+               if (i==0) {   /* save 1st coord. in case needed later */
+                   xsave = X;
+                   ysave = Y;
+               }
+
                if( cFmt!=pixel_fmt ) {
                   /*  Convert to pixels  */
                   if( wcs==NULL || ! wcs->exists ) {
@@ -353,13 +456,80 @@ int ffrrgn( const char *filename,
                coords[i+1] = Y;
             }
 
-            /*  Read in remaining parameters... all in pixels or degrees  */
+            /*  Read in remaining parameters...  */
 
             for( ; i<nParams; i++ ) {
                pX = paramPtr;
                while( *paramPtr!=',' && *paramPtr != '\0' ) paramPtr++;
                *(paramPtr++) = '\0';
-               coords[i] = atof( pX );
+               coords[i] = strtod( pX, &endp );
+
+               if (endp && *endp=='"') {
+                   /* parameter given in arcsec so convert to pixels. */
+                   /* Increment first Y coordinate by this amount then calc */
+                   /* the distance in pixels from the original coordinate. */
+                   /* NOTE: This assumes the pixels are square!! */
+                   if (ysave < 0.)
+                       Y = ysave + coords[i]/3600.;  /* don't exceed -90 */
+                   else
+                       Y = ysave - coords[i]/3600.;  /* don't exceed +90 */
+
+                   X = xsave;
+                   if( ffxypx(  X,  Y, wcs->xrefval, wcs->yrefval,
+                                      wcs->xrefpix, wcs->yrefpix,
+                                      wcs->xinc,    wcs->yinc,
+                                      wcs->rot,     wcs->type,
+                              &x, &y, status ) ) {
+                     ffpmsg("Error converting region to pixel coordinates.");
+                     goto error;
+                   }
+
+                   coords[i] = sqrt( pow(x-coords[0],2) + pow(y-coords[1],2) );
+
+               } else if (endp && *endp=='\'') {
+                   /* parameter given in arcmin so convert to pixels. */
+                   /* Increment first Y coordinate by this amount, then calc */
+                   /* the distance in pixels from the original coordinate. */
+                   /* NOTE: This assumes the pixels are square!! */
+                   if (ysave < 0.)
+                       Y = ysave + coords[i]/60.;  /* don't exceed -90 */
+                   else
+                       Y = ysave - coords[i]/60.;  /* don't exceed +90 */
+
+                   X = xsave;
+                   if( ffxypx(  X,  Y, wcs->xrefval, wcs->yrefval,
+                                      wcs->xrefpix, wcs->yrefpix,
+                                      wcs->xinc,    wcs->yinc,
+                                      wcs->rot,     wcs->type,
+                              &x, &y, status ) ) {
+                     ffpmsg("Error converting region to pixel coordinates.");
+                     goto error;
+                   }
+
+                   coords[i] = sqrt( pow(x-coords[0],2) + pow(y-coords[1],2) );
+
+               } else if (endp && *endp=='d') {
+                   /* parameter given in degrees so convert to pixels. */
+                   /* Increment first Y coordinate by this amount, then calc */
+                   /* the distance in pixels from the original coordinate. */
+                   /* NOTE: This assumes the pixels are square!! */
+                   if (ysave < 0.)
+                       Y = ysave + coords[i];  /* don't exceed -90 */
+                   else
+                       Y = ysave - coords[i];  /* don't exceed +90 */
+
+                   X = xsave;
+                   if( ffxypx(  X,  Y, wcs->xrefval, wcs->yrefval,
+                                      wcs->xrefpix, wcs->yrefpix,
+                                      wcs->xinc,    wcs->yinc,
+                                      wcs->rot,     wcs->type,
+                              &x, &y, status ) ) {
+                     ffpmsg("Error converting region to pixel coordinates.");
+                     goto error;
+                   }
+
+                   coords[i] = sqrt( pow(x-coords[0],2) + pow(y-coords[1],2) );
+               }
             }
 
             /* Perform some useful calculations now to speed up filter later */
@@ -440,9 +610,11 @@ int ffrrgn( const char *filename,
             }
 
          }  /* End of while( *currLoc ) */
-
+/*
+  if (coords)printf("%.8f %.8f %.8f %.8f %.8f\n",
+   coords[0],coords[1],coords[2],coords[3],coords[4]); 
+*/
       }  /* End of if...else parse line */
-
    }   /* End of while( fgets(rgnFile) ) */
 
 
@@ -470,17 +642,26 @@ int fftrgn( double    X,
    double x, y, dx, dy, xprime, yprime, r;
    RgnShape *Shapes;
    int i;
-   int result = 1;
-
-   /*  We are ANDing the tests for each region (with -regions being NOTed) */
-   /*  so we can stop as soon as the first region test fails               */
+   int result = 0;
 
    Shapes = Rgn->Shapes;
-   for( i=0; i<Rgn->nShapes && result; i++, Shapes++ ) {
 
-      switch( Shapes->shape ) {
+   /* if an excluded region is given first, then implicitly   */
+   /* assume a previous shape that includes the entire image. */
+   if (!Shapes->sign)
+      result = 1;
 
-         /* result is guaranteed to be 1 at start, so only test for failure */
+   for( i=0; i<Rgn->nShapes; i++, Shapes++ ) {
+
+    /* only need to test if  */
+    /*   the point is not already included and this is an include region, */
+    /* or the point is included and this is an excluded region */
+
+    if ( (!result && Shapes->sign) || (result && !Shapes->sign) ) { 
+
+      result = 1;
+
+      switch( Shapes->shape ) {
 
       case box_rgn:
          /*  Shift origin to center of region  */
@@ -643,8 +824,9 @@ int fftrgn( double    X,
 
       if( !Shapes->sign ) result = !result;
 
+     } 
    }
-   
+
    return( result );
 }
 
diff --git a/ricecomp.c b/ricecomp.c
index 0c28694..bd184ea 100644
--- a/ricecomp.c
+++ b/ricecomp.c
@@ -103,6 +103,7 @@ unsigned int *diff;
     /* write out first int value to the first 4 bytes of the buffer */
     if (output_nbits(buffer, a[0], 32) == EOF) {
         ffpmsg("rice_encode: end of buffer");
+        free(diff);
         return(-1);
     }
 
@@ -148,11 +149,13 @@ unsigned int *diff;
 	     */
 	    if (output_nbits(buffer, fsmax+1, fsbits) == EOF) {
                 ffpmsg("rice_encode: end of buffer");
+                free(diff);
 		return(-1);
 	    }
 	    for (j=0; j<thisblock; j++) {
 		if (output_nbits(buffer, diff[j], bbits) == EOF) {
                     ffpmsg("rice_encode: end of buffer");
+                    free(diff);
 		    return(-1);
 		}
 	    }
@@ -164,12 +167,14 @@ unsigned int *diff;
 	     */
 	    if (output_nbits(buffer, 0, fsbits) == EOF) {
                 ffpmsg("rice_encode: end of buffer");
+                free(diff);
 		return(-1);
 	    }
 	} else {
 	    /* normal case: not either very high or very low entropy */
 	    if (output_nbits(buffer, fs+1, fsbits) == EOF) {
                 ffpmsg("rice_encode: end of buffer");
+                free(diff);
 		return(-1);
 	    }
 	    fsmask = (1<<fs) - 1;
@@ -192,11 +197,13 @@ unsigned int *diff;
 		    lbitbuffer <<= lbits_to_go;
 		    if (putcbuf(lbitbuffer & 0xff,buffer) == EOF) {
                         ffpmsg("rice_encode: end of buffer");
+                        free(diff);
 			return(-1);
 		    }
 		    for (top -= lbits_to_go; top>=8; top -= 8) {
 			if (putcbuf(0, buffer) == EOF) {
                             ffpmsg("rice_encode: end of buffer");
+                            free(diff);
 			    return(-1);
 			}
 		    }
@@ -216,6 +223,7 @@ unsigned int *diff;
 		    while (lbits_to_go <= 0) {
 			if (putcbuf((lbitbuffer>>(-lbits_to_go)) & 0xff,buffer)==EOF) {
                             ffpmsg("rice_encode: end of buffer");
+                            free(diff);
 			    return(-1);
 			}
 			lbits_to_go += 8;
@@ -378,6 +386,8 @@ static int *nonzero_count = (int *)NULL;
 	 * nonzero_count is lookup table giving number of bits
 	 * in 8-bit values not including leading zeros
 	 */
+
+        /*  NOTE!!!  This memory never gets freed  */
 	nonzero_count = (int *) malloc(256*sizeof(int));
 	if (nonzero_count == (int *) NULL) {
             ffpmsg("rdecomp: insufficient memory");
diff --git a/scalnull.c b/scalnull.c
index 1c92f6d..e602acf 100644
--- a/scalnull.c
+++ b/scalnull.c
@@ -62,6 +62,14 @@ int ffpscl(fitsfile *fptr,      /* I - FITS file pointer               */
     if (hdutype != IMAGE_HDU)
         return(*status = NOT_IMAGE);         /* not proper HDU type */
 
+    if (fits_is_compressed_image(fptr, status)) /* compressed images */
+    {
+        (fptr->Fptr)->cn_bscale = scale;
+        (fptr->Fptr)->cn_bzero  = zero;
+
+        return(*status);
+    }
+
     /* set pointer to the first 'column' (contains group parameters if any) */
     colptr = (fptr->Fptr)->tableptr; 
 
@@ -99,6 +107,9 @@ int ffpnul(fitsfile *fptr,      /* I - FITS file pointer                */
     if (hdutype != IMAGE_HDU)
         return(*status = NOT_IMAGE);         /* not proper HDU type */
 
+    if (fits_is_compressed_image(fptr, status)) /* ignore compressed images */
+        return(*status);
+
     /* set pointer to the first 'column' (contains group parameters if any) */
     colptr = (fptr->Fptr)->tableptr; 
 
diff --git a/smem.c b/smem.c
index e1ba52c..fe67523 100644
--- a/smem.c
+++ b/smem.c
@@ -1,11 +1,18 @@
 #include <stdio.h>
 #include <memory.h>
 #include <string.h>
+#ifdef __APPLE__
+#include <stdlib.h>
+#else
 #include <malloc.h>
-#include "drvrsmem.h"
+#endif
+#include "fitsio.h"     /* needed to define OFF_T */
+#include "drvrsmem.h"   /* uses OFF_T */
 
 int	main(int argc, char **argv)
-{ int r, cmdok, listmode, longlistmode, recovermode, deletemode, id;
+{ int cmdok, listmode, longlistmode, recovermode, deletemode, id;
+int status;
+char *address;
 
 listmode = longlistmode = recovermode = deletemode = 0;
 id = -1;
@@ -58,10 +65,13 @@ if (shared_init(0))
     return(10);
   }
 
-
 if (listmode) shared_list(id);
 else if (recovermode) shared_recover(id);
 else if (deletemode) shared_uncond_delete(id);
 
+for (id = 0; id <16; id++) {
+  status = shared_getaddr(id, &address);
+  if (!status)printf("id, status, address %d %d %ld %.30s\n", id, status, address, address);
+}
 return(0);
 }
diff --git a/speed.c b/speed.c
index 2a948b4..e9481cb 100644
--- a/speed.c
+++ b/speed.c
@@ -49,8 +49,9 @@ int readbtable(fitsfile *fptr, int *status);
 void printerror( int status);
 int marktime(int *status);
 int gettime(double *elapse, float *elapscpu, int *status);
+int main(void);
 
-main()
+int main()
 {
 /*************************************************************************
     This program tests the speed of writing/reading FITS files with cfitsio
@@ -188,7 +189,7 @@ int writebintable (fitsfile *fptr, int *status)
     /* Create a binary table extension containing 3 columns  */
     /*********************************************************/
 {
-    int hdutype, tfields = 2;
+    int tfields = 2;
     long nremain, ntodo, firstrow = 1, firstelem = 1, nrows;
     float rate, size, elapcpu, cpufrac;
     double elapse;
@@ -211,7 +212,7 @@ int writebintable (fitsfile *fptr, int *status)
     nrows = minvalue(nrows, SHTSIZE);
     nremain = BROWS;
 
-    printf("Write %7drow x %dcol bintable %4d rows/loop:", BROWS, tfields,
+    printf("Write %7drow x %dcol bintable %4ld rows/loop:", BROWS, tfields,
        nrows);
     marktime(status);
 
@@ -242,7 +243,7 @@ int writeasctable (fitsfile *fptr, int *status)
     /* Create an ASCII table extension containing 2 columns  */
     /*********************************************************/
 {
-    int hdutype, tfields = 2;
+    int tfields = 2;
     long nremain, ntodo, firstrow = 1, firstelem = 1;
     long nrows;
     float rate, size, elapcpu, cpufrac;
@@ -265,7 +266,7 @@ int writeasctable (fitsfile *fptr, int *status)
     nrows = minvalue(nrows, SHTSIZE);
     nremain = AROWS;
 
-    printf("Write %7drow x %dcol asctable %4d rows/loop:", AROWS, tfields,
+    printf("Write %7drow x %dcol asctable %4ld rows/loop:", AROWS, tfields,
            nrows);
     marktime(status);
 
@@ -472,9 +473,6 @@ int marktime( int *status)
 /*--------------------------------------------------------------------------*/
 int gettime(double *elapse, float *elapscpu, int *status)
 {
-    clock_t ecpu;
-    time_t  finish;
-
     ecpu = clock();
     finish = time(0);
 
diff --git a/testf77.f b/testf77.f
index 7750468..ac3bc21 100644
--- a/testf77.f
+++ b/testf77.f
@@ -567,12 +567,12 @@ C        ############################
       write(*,'(1x,A,2I4,L4)')'  pcount, gcount, extend = ',
      &           pcount, gcount, extend
 
-      call ftgrec(iunit, 11, card, status)
+      call ftgrec(iunit, 9, card, status)
       write(*,'(1x,A)') card
       if (card(1:15) .ne. 'KEY_PREC= ''This')
      &    write(*,'(1x,A)') 'ERROR in ftgrec '
 
-      call ftgkyn(iunit, 11, keyword, value, comment, status)
+      call ftgkyn(iunit, 9, keyword, value, comment, status)
       write(*,'(1x,5A)') keyword,' ', value(1:35),' ', comment(1:20)
 
       if (keyword(1:8) .ne. 'KEY_PREC' )
@@ -729,7 +729,7 @@ C        ############################
       write(*,'(1x,A)')' '
       write(*,'(1x,A)')
      & 'Before deleting the HISTORY and DATE keywords...'
-      do ii = 31, 34      
+      do ii = 29, 32     
           call ftgrec(iunit, ii, card, status)
           write(*,'(1x,A)') card(1:8)
       end do
@@ -743,12 +743,12 @@ C        #  delete keywords         #
 C        ############################
       
 
-      call ftdrec(iunit, 32, status)
+      call ftdrec(iunit, 30, status)
       call ftdkey(iunit, 'DATE', status)
 
       write(*,'(1x,A)')' '
       write(*,'(1x,A)') 'After deleting the keywords... '
-      do ii = 31, 32            
+      do ii = 29, 30            
           call ftgrec(iunit, ii, card, status)
           write(*,'(1x,A)') card
       end do      
@@ -761,7 +761,7 @@ C        ############################
 C        #  insert keywords         #
 C        ############################
       
-      call ftirec(iunit,28,
+      call ftirec(iunit,26,
      & 'KY_IREC = ''This keyword inserted by fxirec''',
      &   status)
       call ftikys(iunit, 'KY_IKYS', 'insert_value_string',
@@ -779,7 +779,7 @@ C        ############################
 
       write(*,'(1x,A)')' '
       write(*,'(1x,A)') 'After inserting the keywords... '
-      do ii = 27, 36
+      do ii = 25, 34
           call ftgrec(iunit, ii, card, status)
           write(*,'(1x,A)') card
       end do
@@ -792,7 +792,7 @@ C        ############################
 C        #  modify keywords         #
 C        ############################
       
-      call ftmrec(iunit, 27,
+      call ftmrec(iunit, 25,
      & 'COMMENT   This keyword was modified by fxmrec', status)
       call ftmcrd(iunit, 'KY_IREC', 
      & 'KY_MREC = ''This keyword was modified by fxmcrd''', status)
@@ -813,7 +813,7 @@ C        ############################
 
       write(*,'(1x,A)')' '
       write(*,'(1x,A)') 'After modifying the keywords... '
-      do ii = 27, 36
+      do ii = 25, 34
           call ftgrec(iunit, ii, card, status)
           write(*,'(1x,A)') card
       end do
@@ -844,7 +844,7 @@ C        ############################
 
       write(*,'(1x,A)')' '
       write(*,'(1x,A)') 'After updating the keywords... '
-      do ii = 27, 36
+      do ii = 25, 34
           call ftgrec(iunit, ii, card, status)
           write(*,'(1x,A)') card
       end do
diff --git a/testf77.out b/testf77.out
index 2bf34d7..443973f 100644
--- a/testf77.out
+++ b/testf77.out
@@ -1,4 +1,4 @@
- FITSIO TESTPROG, v  2.100
+ FITSIO TESTPROG, v  2.500
   
  Try opening then closing a nonexistent file: 
    ftopen iunit, status (expect an error) =  15 104
@@ -65,7 +65,7 @@
  keyword unit=feet/second/second
  KEY_PKLS long string value = This is a very long string value that is continued
   over more than one keyword.                                          
- header contains   63 keywords; located at keyword   25
+ header contains   61 keywords; located at keyword   23
  ftgkns: first string  second string               
  ftgknl:    T   F   T
  ftgknj:   11  12  13
@@ -79,7 +79,7 @@
  KY_PKNS1
   
  After deleting the keywords... 
- COMMENT   This keyword was written by fxpcom.                                 
+ COMMENT This keyword was written by fxpcom.                                   
  KY_PKNS1= 'first string'       / fxpkns comment                               
   
  After inserting the keywords... 
diff --git a/testf77.std b/testf77.std
index 7d2d953dd708f1606bc927db6499751b7d4a3290..ec1281fcdddcb388bb51776639304a0822c8a1f1 100644
GIT binary patch
delta 286
zcmX@m%5tEUWrGA$dS<agN@`kWUTTU$W}bq&V{u7QeqMfVrL(`Uud82(f`UR~UWx)(
zxFDmlI5W9eT}PoTKc_S|Rl(TYOh=(0F+Ekm*woTmAt^H{IX@-UO2Np$z|c|6QBP0L
z*xXD{&)C$`W3xQ-Nsh_d%<_{tdDJ)S@dR;A-XOYQbAy<EEuR7k*t~bL5g()RWQXMr
zn++Bj3o$ZIPTAtm$T)cmm}J=sVuygqC1COkm~`3Z&&V`+3YdHXCQY`3L|VY)6)>r?
e10+%cCXej!XJno%vJ*t6fXOW&ax=@WJstpm*;~i}

delta 439
zcmX@m%5tEUWrGA$eM)LtW?pKFLS~+VV{u7QeqMfVr9xs}inG73ud82(f&xUiAfvK4
zGr3qHxU`@kCp9-UuS6j@wJ0;SSfR|sM8Ck;%vcA?GB?ywC^I+KFEBQ>gt5#_^$_Mc
z=jW9qCYLCbWTYzi)jI||Dg-BIrsgH5D)^_RWhSR8<fkbFmn7z;Bo?I<gPfuelA4^6
zm!FfLUa63lUj){upnx#Y%`+re!3E@x%#zIfJcX3}<WjH;l?@FHzy{=(WTX};fYoK@
zrR5jpCV~{|DJUp#D!{<zdZv>clRMajC(mKxo1D(AzIg(70N3UQG5y-fH^lfR2TW(#
zd~mWJ-{k)b+%}so(i382nw+x5pOJa;mM#8_ER$Kb`ZKal4%zC@$ToS&R)0qJ$zQhm
zGjdFJ+2+s4IeE%9e@3p!Pqz6pa!)qd?$5|Gxn;XQBk$xZ+x;2&Cadi5XXKw;vcsQI
kVDgb2{)~c?MRxi#3QbPg>CY%UdCN|JMv=`dyY_eh05qGEJOBUy

diff --git a/testprog.c b/testprog.c
index d16ecb5..beb6301 100644
--- a/testprog.c
+++ b/testprog.c
@@ -18,7 +18,7 @@ int main()
     int status, simple, bitpix, naxis, extend, hdutype, hdunum, tfields;
     long ii, jj, extvers;
     int nkeys, nfound, colnum, typecode, signval,nmsg;
-    char cval;
+    char cval, cvalstr[2];
     long repeat, offset, width, jnulval;
     int anynull;
     float vers;
@@ -409,7 +409,7 @@ int main()
     printf("The 1st, and every 4th pixel should be undefined:\n");
 
     anynull = 0;
-    ffgpvb(fptr, 1,  1, 10, 99, binarray, &anynull, &status);
+    ffgpvb(fptr, 1,  1, 10, 99, binarray, &anynull, &status); 
 
     ffgpvb(fptr, 1, 11, 10, 99, &binarray[10], &anynull, &status);
 
@@ -602,12 +602,12 @@ int main()
     printf("  pcount = %ld, gcount = %ld, extend = %d\n",
                pcount, gcount, extend);
 
-    ffgrec(fptr, 11, card, &status);
+    ffgrec(fptr, 9, card, &status);
     printf("%s\n", card);
     if (strncmp(card, "KEY_PREC= 'This", 15) )
        printf("ERROR in ffgrec\n");
 
-    ffgkyn(fptr, 11, keyword, value, comment, &status);
+    ffgkyn(fptr, 9, keyword, value, comment, &status);
     printf("%s : %s : %s :\n",keyword, value, comment);
     if (strncmp(keyword, "KEY_PREC", 8) )
        printf("ERROR in ffgkyn: %s\n", keyword);
@@ -1145,10 +1145,10 @@ int main()
     {
       ffgtcl(fptr, ii + 1, &typecode, &repeat, &width, &status);
       printf("%4s %3d %2ld %2ld", tform[ii], typecode, repeat, width);
-      ffgbcl(fptr, ii + 1, ttype[0], tunit[0], &cval, &repeat, &scale,
+      ffgbcl(fptr, ii + 1, ttype[0], tunit[0], cvalstr, &repeat, &scale,
            &zero, &jnulval, tdisp, &status);
       printf(" %s, %s, %c, %ld, %f, %f, %ld, %s.\n",
-         ttype[0], tunit[0], cval, repeat, scale, zero, jnulval, tdisp);
+         ttype[0], tunit[0], cvalstr[0], repeat, scale, zero, jnulval, tdisp);
     }
 
     printf("\n");
diff --git a/testprog.out b/testprog.out
index 061caaf..52c5156 100644
--- a/testprog.out
+++ b/testprog.out
@@ -1,4 +1,4 @@
-CFITSIO TESTPROG, v2.100
+CFITSIO TESTPROG, v2.500
 
 Try opening then closing a nonexistent file:
   ffopen fptr, status  = 0 104 (expect an error)
@@ -73,7 +73,7 @@ KEY_PKY J 11 [feet/second/second] fxpkyj comment 0
 KEY_PKY units = feet/second/second
 KEY_PKLS long string value = 
 This is a very long string value that is continued over more than one keyword.
-header contains 67 keywords; located at keyword 29 
+header contains 65 keywords; located at keyword 27 
 ffgkns:  first string, second string, 
 ffgknl:  1, 0, 1
 ffgknj:  11, 12, 13
diff --git a/testprog.std b/testprog.std
index e33f855..2f2a10c 100644
--- a/testprog.std
+++ b/testprog.std
@@ -1,21 +1,20 @@
-SIMPLE  =                    T / file does conform to FITS standard             BITPIX  =                   32 / number of bits per data pixel                  NAXIS   =                    2 / number of data axes                            NAXIS1  =                   10 / length of data axis 1                          NAXIS2  =                    2 / length of data axis 2                          EXTEND  =                    T / FITS dataset may contain extensions            COMMENT   FITS (Flexible Image Transport System) format defined in Astronomy andCOMMENT   Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365.COMMENT   Contact the NASA Science Office of Standards and Technology for the   COMMENT   FITS Definition document #100 and other FITS information.             KEY_PREC= 'This keyword was written by fxprec' / comment goes here              CARD1   = '12345678901234567890123456789012345678901234567890123456789012345678'CARD2   = '1234567890123456789012345678901234567890123456789012345678901234''67'CARD3   = '1234567890123456789012345678901234567890123456789012345678901234'''''CARD4   = '1234567890123456789012345678901234567890123456789012345678901234567' KEY_PKYS= 'value_string'       / fxpkys comment                                 KEY_PKYL=                    T / fxpkyl comment                                 KEY_PKYJ=                   11 / [feet/second/second] fxpkyj comment            KEY_PKYF=             12.12121 / fxpkyf comment                                 KEY_PKYE=         1.313131E+01 / fxpkye comment                                 KEY_PKYG=    14.14141414141414 / fxpkyg comment                                 KEY_PKYD= 1.51515151515152E+01 / fxpkyd comment                                 KEY_PKYC= (1.313131E+01, 1.414141E+01) / fxpkyc comment                         KEY_PKYM= (1.51515151515152E+01, 1.61616161616162E+01) / fxpkym comment         KEY_PKFC= (13.131313, 14.141414) / fxpkfc comment                               KEY_PKFM= (15.15151515151515, 16.16161616161616) / fxpkfm comment               KEY_PKLS= 'This is a very long string value that is continued over more than o&'CONTINUE  'ne keyword.'        / fxpkls comment                                 LONGSTRN= 'OGIP 1.0'           / The HEASARC Long String Convention may be used.COMMENT   This FITS file may contain long string keyword values that are        COMMENT   continued over multiple keywords.  The HEASARC convention uses the &  COMMENT   character at the end of each substring which is then continued        COMMENT   on the next keyword which has the name CONTINUE.                      KEY_PKYT= 12345678.1234567890123456 / fxpkyt comment                            COMMENT   This keyword was modified by fxmrec                                   KY_UCRD = 'This keyword was updated by fxucrd'                                  NEWIKYS = 'updated_string'     / ikys comment                                   KY_IKYJ =                   51 / This is a modified comment                     KY_IKYL =                    T / ikyl comment                                   KY_IKYE =          -1.3346E+01 / ikye comment                                   KY_IKYD = -1.33456789012346E+01 / modified comment                              KY_IKYF =             -13.3456 / ikyf comment                                   KY_IKYG =    -13.3456789012346 / ikyg comment                                   KY_PKNS1= 'first string'       / fxpkns comment                                 KY_PKNS2= 'second string'      / fxpkns comment                                 KY_PKNS3= '        '           / fxpkns comment                                 KY_PKNL1=                    T / fxpknl comment                                 KY_PKNL2=                    F / fxpknl comment                                 KY_PKNL3=                    T / fxpknl comment                                 KY_PKNJ1=                   11 / fxpknj comment                                 KY_PKNJ2=                   12 / fxpknj comment                                 KY_PKNJ3=                   13 / fxpknj comment                                 KY_PKNF1=             12.12121 / fxpknf comment                                 KY_PKNF2=             13.13131 / fxpknf comment                                 KY_PKNF3=             14.14141 / fxpknf comment                                 KY_PKNE1=         1.313131E+01 / fxpkne comment                                 KY_PKNE2=         1.414141E+01 / fxpkne comment                                 KY_PKNE3=         1.515152E+01 / fxpkne comment                                 KY_PKNG1=     14.1414141414141 / fxpkng comment                                 KY_PKNG2=     15.1515151515152 / fxpkng comment                                 KY_PKNG3=     16.1616161616162 / fxpkng comment                                 KY_PKND1= 1.51515151515152E+01 / fxpknd comment                                 KY_PKND2= 1.61616161616162E+01 / fxpknd comment                                 KY_PKND3= 1.71717171717172E+01 / fxpknd comment                                 TSTRING = '1       '           / tstring comment                                TLOGICAL=                    T / tlogical comment                               TBYTE   =                   11 / tbyte comment                                  TSHORT  =                   21 / tshort comment                                 TINT    =                   31 / tint comment                                   TLONG   =                   41 / tlong comment                                  TFLOAT  =                  42. / tfloat comment                                 TDOUBLE =                  82. / tdouble comment                                BLANK   =                  -99 / value to use for undefined pixels              KY_PKNE4=         1.313131E+01 / fxpkne comment                                 TMPCARDA=                 1001 / this is the 1st template card                  TMPCARD2= 'ABCD    '           / this is the 2nd template card                  TMPCARD3=              1001.23 / this is the 3rd template card                  COMMENT this is the 5th template card                                           HISTORY this is the 6th template card                                           TMPCARD7=                      / comment for null keyword                       END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ������������������������������	���
+SIMPLE  =                    T / file does conform to FITS standard             BITPIX  =                   32 / number of bits per data pixel                  NAXIS   =                    2 / number of data axes                            NAXIS1  =                   10 / length of data axis 1                          NAXIS2  =                    2 / 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 KEY_PREC= 'This keyword was written by fxprec' / comment goes here              CARD1   = '12345678901234567890123456789012345678901234567890123456789012345678'CARD2   = '1234567890123456789012345678901234567890123456789012345678901234''67'CARD3   = '1234567890123456789012345678901234567890123456789012345678901234'''''CARD4   = '1234567890123456789012345678901234567890123456789012345678901234567' KEY_PKYS= 'value_string'       / fxpkys comment                                 KEY_PKYL=                    T / fxpkyl comment                                 KEY_PKYJ=                   11 / [feet/second/second] fxpkyj comment            KEY_PKYF=             12.12121 / fxpkyf comment                                 KEY_PKYE=         1.313131E+01 / fxpkye comment                                 KEY_PKYG=    14.14141414141414 / fxpkyg comment                                 KEY_PKYD= 1.51515151515152E+01 / fxpkyd comment                                 KEY_PKYC= (1.313131E+01, 1.414141E+01) / fxpkyc comment                         KEY_PKYM= (1.51515151515152E+01, 1.61616161616162E+01) / fxpkym comment         KEY_PKFC= (13.131313, 14.141414) / fxpkfc comment                               KEY_PKFM= (15.15151515151515, 16.16161616161616) / fxpkfm comment               KEY_PKLS= 'This is a very long string value that is continued over more than o&'CONTINUE  'ne keyword.'        / fxpkls comment                                 LONGSTRN= 'OGIP 1.0'           / The HEASARC Long String Convention may be used.COMMENT   This FITS file may contain long string keyword values that are        COMMENT   continued over multiple keywords.  The HEASARC convention uses the &  COMMENT   character at the end of each substring which is then continued        COMMENT   on the next keyword which has the name CONTINUE.                      KEY_PKYT= 12345678.1234567890123456 / fxpkyt comment                            COMMENT   This keyword was modified by fxmrec                                   KY_UCRD = 'This keyword was updated by fxucrd'                                  NEWIKYS = 'updated_string'     / ikys comment                                   KY_IKYJ =                   51 / This is a modified comment                     KY_IKYL =                    T / ikyl comment                                   KY_IKYE =          -1.3346E+01 / ikye comment                                   KY_IKYD = -1.33456789012346E+01 / modified comment                              KY_IKYF =             -13.3456 / ikyf comment                                   KY_IKYG =    -13.3456789012346 / ikyg comment                                   KY_PKNS1= 'first string'       / fxpkns comment                                 KY_PKNS2= 'second string'      / fxpkns comment                                 KY_PKNS3= '        '           / fxpkns comment                                 KY_PKNL1=                    T / fxpknl comment                                 KY_PKNL2=                    F / fxpknl comment                                 KY_PKNL3=                    T / fxpknl comment                                 KY_PKNJ1=                   11 / fxpknj comment                                 KY_PKNJ2=                   12 / fxpknj comment                                 KY_PKNJ3=                   13 / fxpknj comment                                 KY_PKNF1=             12.12121 / fxpknf comment                                 KY_PKNF2=             13.13131 / fxpknf comment                                 KY_PKNF3=             14.14141 / fxpknf comment                                 KY_PKNE1=         1.313131E+01 / fxpkne comment                                 KY_PKNE2=         1.414141E+01 / fxpkne comment                                 KY_PKNE3=         1.515152E+01 / fxpkne comment                                 KY_PKNG1=     14.1414141414141 / fxpkng comment                                 KY_PKNG2=     15.1515151515152 / fxpkng comment                                 KY_PKNG3=     16.1616161616162 / fxpkng comment                                 KY_PKND1= 1.51515151515152E+01 / fxpknd comment                                 KY_PKND2= 1.61616161616162E+01 / fxpknd comment                                 KY_PKND3= 1.71717171717172E+01 / fxpknd comment                                 TSTRING = '1       '           / tstring comment                                TLOGICAL=                    T / tlogical comment                               TBYTE   =                   11 / tbyte comment                                  TSHORT  =                   21 / tshort comment                                 TINT    =                   31 / tint comment                                   TLONG   =                   41 / tlong comment                                  TFLOAT  =                  42. / tfloat comment                                 TDOUBLE =                  82. / tdouble comment                                BLANK   =                  -99 / value to use for undefined pixels              KY_PKNE4=         1.313131E+01 / fxpkne comment                                 TMPCARDA=                 1001 / this is the 1st template card                  TMPCARD2= 'ABCD    '           / this is the 2nd template card                  TMPCARD3=              1001.23 / this is the 3rd template card                  COMMENT this is the 5th template card                                           HISTORY this is the 6th template card                                           TMPCARD7=                      / comment for null keyword                       END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ������������������������������	���
 ����������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / 8-bit bytes                                    NAXIS   =                    2 / 2-dimensional binary table                     NAXIS1  =                   61 / width of table in bytes                        NAXIS2  =                   20 / number of rows in table                        PCOUNT  =                    0 / size of special data area                      GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                   10 / number of fields in each row                   TTYPE1  = 'Avalue  '           / label for field   1                            TFORM1  = '15A     '           / data format of field: ASCII Character          TTYPE2  = 'Lvalue  '           / label for field   2                            TFORM2  = '1L      '           / data format of field: 1-byte LOGICAL           TUNIT2  = 'm**2    '           / physical unit of field                         TTYPE3  = 'Xvalue  '           / label for field   3                            TFORM3  = '16X     '           / data format of field: BIT                      TUNIT3  = 'cm      '           / physical unit of field                         TTYPE4  = 'Bvalue  '           / label for field   4                            TFORM4  = '1B      '           / data format of field: BYTE                     TUNIT4  = 'erg/s   '           / physical unit of field                         TTYPE5  = 'Ivalue  '           / label for field   5                            TFORM5  = '1I      '           / data format of field: 2-byte INTEGER           TUNIT5  = 'km/s    '           / physical unit of field                         TTYPE6  = 'Jvalue  '           / label for field   6                            TFORM6  = '1J      '           / data format of field: 4-byte INTEGER           TTYPE7  = 'Evalue  '           / label for field   7                            TFORM7  = '1E      '           / data format of field: 4-byte REAL              TTYPE8  = 'Dvalue  '           / label for field   8                            TFORM8  = '1D      '           / data format of field: 8-byte DOUBLE            TTYPE9  = 'Cvalue  '           / label for field   9                            TFORM9  = '1C      '           / data format of field: COMPLEX                  TTYPE10 = 'Mvalue  '           / label for field  10                            TFORM10 = '1M      '           / data format of field: DOUBLE COMPLEX           EXTNAME = 'Test-BINTABLE'      / name of this binary table extension            EXTVER  =                    3 / extension version number                       TNULL4  =                   77 / value for undefined pixels                     TNULL5  =                   77 / value for undefined pixels                     TNULL6  =                   77 / value for undefined pixels                     TSCAL4  =                 1000 / scaling factor                                 TSCAL5  =                    1 / scaling factor                                 TSCAL6  =                  100 / scaling factor                                 TZERO4  =                    0 / scaling offset                                 TZERO5  =                32768 / scaling offset                                 TZERO6  =                  100 / scaling offset                                 NEW_KEY = 'written by fxprec' / to change checksum                              END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ������������������������������������������������������������������������������������	������������������������������������������������������
-����c������������������������������������������������������!����G������������������������������������������������������B����������������������������������������������������������M�M���M������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������XTENSION= 'IMAGE   '           / IMAGE extension                                BITPIX  =                  -32 / number of bits per data pixel                  NAXIS   =                    2 / number of data axes                            NAXIS1  =                   15 / length of data axis 1                          NAXIS2  =                   25 / length of data axis 2                          PCOUNT  =                    0 / required keyword; must = 0                     GCOUNT  =                    1 / required keyword; must = 1                     END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ����?���@���@@��@���@���@���@���A���A��A ��A0��A@��AP��A`��A ��A0��A@��AP��A`��Ap��A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���B���B��B��A���A���B���B��B��B��B��B��B��B��B ��B$��B(��B,��B0��B ��B$��B(��B,���������������@�������������������������BX��BH��BL��BP��BT��� ���0���@���P���`���p������������������B���Bp��Bt��Bx��B|������������������������������������������B���B���B���B���B������������������������������������B���B���B���B���B���� ���$���(���,���0���4���8���<���@���D��B���B���B���B���B����H���L���P���T���X���\���`���d���h���l��B���B���B���B���B����p���t���x���|��€��‚��„��†��ˆ��Š��B���B���B���B���B���Œ��Ž����’��”��–��˜��š��œ��ž��B���B���B���B���B��� ��¢��¤��¦��¨��ª��¬��®��°��²��C��C��C��C��C��´��¶��¸��º��¼��¾������������������C��C��C
��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C ��C!��C"��C#��C$��C ��C!��C"��C#��C$��C%��C&��C'��C(��C)��C*��C+��C,��C-��C.��C*��C+��C,��C-��C.��C/��C0��C1��C2��C3��C4��C5��C6��C7��C8��C4��C5��C6��C7��C8��C9��C:��C;��C<��C=��C>��C?��C@��CA��CB��C>��C?��C@��CA��CB��CC��CD��CE��CF��CG��CH��CI��CJ��CK��CL��CH��CI��CJ��CK��CL��CM��CN��CO��CP��CQ��CR��CS��CT��CU��CV��CR��CS��CT��CU��CV��CW��CX��CY��CZ��C[��C\��C]��C^��C_��C`��C\��C]��C^��C_��C`��Ca��Cb��Cc��Cd��Ce��Cf��Cg��Ch��Ci��Cj��Cf��Cg��Ch��Ci��Cj��Ck��Cl��Cm��Cn��Co��Cp��Cq��Cr��Cs��Ct��Cp��Cq��Cr��Cs��Ct��Cu��Cv��Cw��Cx��Cy��Cz��C{��C|��C}��C~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������XTENSION= 'TABLE   '           / ASCII table extension                          BITPIX  =                    8 / 8-bit ASCII characters                         NAXIS   =                    2 / 2-dimensional ASCII table                      NAXIS1  =                   76 / width of table in characters                   NAXIS2  =                   12 / number of rows in table                        PCOUNT  =                    0 / no group parameters (required keyword)         GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                    5 / number of fields in each row                   TTYPE1  = 'Name    '           / label for field   1                            TBCOL1  =                    1 / beginning column of field   1                  TFORM1  = 'A15     '           / Fortran-77 format of field                     TTYPE2  = 'Ivalue  '           / label for field   2                            TBCOL2  =                   17 / beginning column of field   2                  TFORM2  = 'I10     '           / Fortran-77 format of field                     TUNIT2  = 'm**2    '           / physical unit of field                         TTYPE3  = 'Evalue  '           / label for field   4                            TBCOL3  =                   28 / beginning column of field   4                  TFORM3  = 'E12.5   '           / Fortran-77 format of field                     TUNIT3  = 'erg/s   '           / physical unit of field                         TTYPE4  = 'Dvalue  '           / label for field   5                            TBCOL4  =                   41 / beginning column of field   5                  TFORM4  = 'D21.14  '           / Fortran-77 format of field                     TUNIT4  = 'km/s    '           / physical unit of field                         EXTNAME = 'Test-ASCII'         / name of this ASCII table extension             EXTVER  =                    2 / extension version number                       TNULL1  = 'null1   '           / value for undefined pixels                     TNULL2  = 'null2   '           / value for undefined pixels                     TNULL3  = 'null4   '           / value for undefined pixels                     TNULL4  = 'null5   '           / value for undefined pixels                     TTYPE5  = 'INSERT_COL'         / label for field                                TFORM5  = 'F14.6   '           / format of field                                TBCOL5  =                   63 / beginning column of field                      END                                                                                                                                                                                                                                                                                                                             first string             1  1.00000E+00  1.00000000000000E+00               second string            2  2.00000E+00  2.00000000000000E+00                                                                                                                                                                                                                                                                            3  3.00000E+00  3.00000000000000E+00               null1                    4  4.00000E+00  4.00000000000000E+00                                        5  5.00000E+00  5.00000000000000E+00                                        6  6.00000E+00  6.00000000000000E+00                                        9  9.00000E+00  9.00000000000000E+00                                       10  1.00000E+01  1.00000000000000E+01                               null2      null4        null5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / 8-bit bytes                                    NAXIS   =                    2 / 2-dimensional binary table                     NAXIS1  =                   61 / width of table in bytes                        NAXIS2  =                   22 / number of rows in table                        PCOUNT  =                    0 / size of special data area                      GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                   10 / number of fields in each row                   TTYPE1  = 'Avalue  '           / label for field   1                            TFORM1  = '15A     '           / data format of field: ASCII Character          TTYPE2  = 'Lvalue  '           / label for field   2                            TFORM2  = '1L      '           / data format of field: 1-byte LOGICAL           TUNIT2  = 'm**2    '           / physical unit of field                         TTYPE3  = 'Xvalue  '           / label for field   3                            TFORM3  = '16X     '           / data format of field: BIT                      TUNIT3  = 'cm      '           / physical unit of field                         TTYPE4  = 'Bvalue  '           / label for field   4                            TFORM4  = '1B      '           / data format of field: BYTE                     TUNIT4  = 'erg/s   '           / physical unit of field                         TTYPE5  = 'Ivalue  '           / label for field   5                            TFORM5  = '1I      '           / data format of field: 2-byte INTEGER           TUNIT5  = 'km/s    '           / physical unit of field                         TTYPE6  = 'Evalue  '           / label for field   7                            TFORM6  = '1E      '           / data format of field: 4-byte REAL              TTYPE7  = 'Dvalue  '           / label for field   8                            TFORM7  = '1D      '           / data format of field: 8-byte DOUBLE            TTYPE9  = 'Cvalue  '           / label for field   9                            TFORM9  = '1C      '           / data format of field: COMPLEX                  TTYPE10 = 'Mvalue  '           / label for field  10                            TFORM10 = '1M      '           / data format of field: DOUBLE COMPLEX           EXTNAME = 'Test-BINTABLE'      / name of this binary table extension            EXTVER  =                    1 / extension version number                       TNULL4  =                   99 / value for undefined pixels                     TNULL5  =                   99 / value for undefined pixels                     TDIM3   = '(1,2,8) '           / size of the multidimensional array             KEY_PREC= 'This keyword was written by f_prec' / comment here                   TTYPE8  = 'INSERT_COL'         / label for field                                TFORM8  = '1E      '           / format of field                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             first string   FLp�?���?�����������?�������?���������������second string  T�|�@���@�����������@@������@����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������               F���@@��@����������@�������@����������������������������F��������������������@�������@������� ���������������������T���@���@����������A��� ��@"�������$���������������������T��������������������A0���@��@&�������(���������������������F��	�	A��@"����������A�������@1�������2���������������������T������ ���$����������A�������@3�������4������������������������c�c�������������������������������������������������������T���A@��@(�������������������������������������������������F��c�c�������������������������������������������������������F������`���,�������������������������������������������������F����c�������������������������������������������������������F����������0�������������������������������������������������T����c�������������������������������������������������������T����������2�������������������������������������������������T����c�������������������������������������������������������T����������4�������������������������������������������������F����c������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / 8-bit bytes                                    NAXIS   =                    2 / 2-dimensional binary table                     NAXIS1  =                   80 / width of table in bytes                        NAXIS2  =                   20 / number of rows in table                        PCOUNT  =                 4446 / size of special data area                      GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                   10 / number of fields in each row                   TTYPE1  = 'Avalue  '           / label for field   1                            TFORM1  = '1PA(20) '           / data format of field: variable length array    TTYPE2  = 'Lvalue  '           / label for field   2                            TFORM2  = '1PL(20) '           / data format of field: variable length array    TUNIT2  = 'm**2    '           / physical unit of field                         TTYPE3  = 'Xvalue  '           / label for field   3                            TFORM3  = '1PB(20) '           / data format of field: variable length array    TUNIT3  = 'cm      '           / physical unit of field                         TTYPE4  = 'Bvalue  '           / label for field   4                            TFORM4  = '1PB(20) '           / data format of field: variable length array    TUNIT4  = 'erg/s   '           / physical unit of field                         TTYPE5  = 'Ivalue  '           / label for field   5                            TFORM5  = '1PI(20) '           / data format of field: variable length array    TUNIT5  = 'km/s    '           / physical unit of field                         TTYPE6  = 'Jvalue  '           / label for field   6                            TFORM6  = '1PJ(20) '           / data format of field: variable length array    TTYPE7  = 'Evalue  '           / label for field   7                            TFORM7  = '1PE(20) '           / data format of field: variable length array    TTYPE8  = 'Dvalue  '           / label for field   8                            TFORM8  = '1PD(20) '           / data format of field: variable length array    TTYPE9  = 'Cvalue  '           / label for field   9                            TFORM9  = '1PC(0)  '           / data format of field: variable length array    TTYPE10 = 'Mvalue  '           / label for field  10                            TFORM10 = '1PM(0)  '           / data format of field: variable length array    EXTNAME = 'Test-BINTABLE'      / name of this binary table extension            EXTVER  =                    4 / extension version number                       TNULL4  =                   88 / value for undefined pixels                     TNULL5  =                   88 / value for undefined pixels                     TNULL6  =                   88 / value for undefined pixels                     END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             �������������������������������������������
-����������������������������������������������������������!������)������1����������������������A������D������G������H������K������Q������]������i�����������������������������������������������������������������������������������������������������������������������������������������������������������������@�����F�����L�����M�����S�����_�����w������������������������������������������������������������������������������������������S�����[�����c�����d�����l�����|�������������������������������	������	�����	�����	�����	�����	��+���	��O���	��s�������������������
+����c������������������������������������������������������!����G������������������������������������������������������B����������������������������������������������������������M�M���M������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������XTENSION= 'IMAGE   '           / IMAGE extension                                BITPIX  =                  -32 / number of bits per data pixel                  NAXIS   =                    2 / number of data axes                            NAXIS1  =                   15 / length of data axis 1                          NAXIS2  =                   25 / length of data axis 2                          PCOUNT  =                    0 / required keyword; must = 0                     GCOUNT  =                    1 / required keyword; must = 1                     END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ����?���@���@@��@���@���@���@���A���A��A ��A0��A@��AP��A`��A ��A0��A@��AP��A`��Ap��A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���A���B���B��B��A���A���B���B��B��B��B��B��B��B��B ��B$��B(��B,��B0��B ��B$��B(��B,���������������@�������������������������BX��BH��BL��BP��BT��� ���0���@���P���`���p������������������B���Bp��Bt��Bx��B|������������������������������������������B���B���B���B���B������������������������������������B���B���B���B���B���� ���$���(���,���0���4���8���<���@���D��B���B���B���B���B����H���L���P���T���X���\���`���d���h���l��B���B���B���B���B����p���t���x���|��€��‚��„��†��ˆ��Š��B���B���B���B���B���Œ��Ž����’��”��–��˜��š��œ��ž��B���B���B���B���B��� ��¢��¤��¦��¨��ª��¬��®��°��²��C��C��C��C��C��´��¶��¸��º��¼��¾������������������C��C��C
��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C ��C!��C"��C#��C$��C ��C!��C"��C#��C$��C%��C&��C'��C(��C)��C*��C+��C,��C-��C.��C*��C+��C,��C-��C.��C/��C0��C1��C2��C3��C4��C5��C6��C7��C8��C4��C5��C6��C7��C8��C9��C:��C;��C<��C=��C>��C?��C@��CA��CB��C>��C?��C@��CA��CB��CC��CD��CE��CF��CG��CH��CI��CJ��CK��CL��CH��CI��CJ��CK��CL��CM��CN��CO��CP��CQ��CR��CS��CT��CU��CV��CR��CS��CT��CU��CV��CW��CX��CY��CZ��C[��C\��C]��C^��C_��C`��C\��C]��C^��C_��C`��Ca��Cb��Cc��Cd��Ce��Cf��Cg��Ch��Ci��Cj��Cf��Cg��Ch��Ci��Cj��Ck��Cl��Cm��Cn��Co��Cp��Cq��Cr��Cs��Ct��Cp��Cq��Cr��Cs��Ct��Cu��Cv��Cw��Cx��Cy��Cz��C{��C|��C}��C~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������XTENSION= 'TABLE   '           / ASCII table extension                          BITPIX  =                    8 / 8-bit ASCII characters                         NAXIS   =                    2 / 2-dimensional ASCII table                      NAXIS1  =                   76 / width of table in characters                   NAXIS2  =                   12 / number of rows in table                        PCOUNT  =                    0 / no group parameters (required keyword)         GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                    5 / number of fields in each row                   TTYPE1  = 'Name    '           / label for field   1                            TBCOL1  =                    1 / beginning column of field   1                  TFORM1  = 'A15     '           / Fortran-77 format of field                     TTYPE2  = 'Ivalue  '           / label for field   2                            TBCOL2  =                   17 / beginning column of field   2                  TFORM2  = 'I10     '           / Fortran-77 format of field                     TUNIT2  = 'm**2    '           / physical unit of field                         TTYPE3  = 'Evalue  '           / label for field   4                            TBCOL3  =                   28 / beginning column of field   4                  TFORM3  = 'E12.5   '           / Fortran-77 format of field                     TUNIT3  = 'erg/s   '           / physical unit of field                         TTYPE4  = 'Dvalue  '           / label for field   5                            TBCOL4  =                   41 / beginning column of field   5                  TFORM4  = 'D21.14  '           / Fortran-77 format of field                     TUNIT4  = 'km/s    '           / physical unit of field                         EXTNAME = 'Test-ASCII'         / name of this ASCII table extension             EXTVER  =                    2 / extension version number                       TNULL1  = 'null1   '           / value for undefined pixels                     TNULL2  = 'null2   '           / value for undefined pixels                     TNULL3  = 'null4   '           / value for undefined pixels                     TNULL4  = 'null5   '           / value for undefined pixels                     TTYPE5  = 'INSERT_COL'         / label for field                                TFORM5  = 'F14.6   '           / format of field                                TBCOL5  =                   63 / beginning column of field                      END                                                                                                                                                                                                                                                                                                                             first string             1  1.00000E+00  1.00000000000000E+00               second string            2  2.00000E+00  2.00000000000000E+00                                                                                                                                                                                                                                                                            3  3.00000E+00  3.00000000000000E+00               null1                    4  4.00000E+00  4.00000000000000E+00                                        5  5.00000E+00  5.00000000000000E+00                                        6  6.00000E+00  6.00000000000000E+00                                        9  9.00000E+00  9.00000000000000E+00                                       10  1.00000E+01  1.00000000000000E+01                               null2      null4        null5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / 8-bit bytes                                    NAXIS   =                    2 / 2-dimensional binary table                     NAXIS1  =                   61 / width of table in bytes                        NAXIS2  =                   22 / number of rows in table                        PCOUNT  =                    0 / size of special data area                      GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                   10 / number of fields in each row                   TTYPE1  = 'Avalue  '           / label for field   1                            TFORM1  = '15A     '           / data format of field: ASCII Character          TTYPE2  = 'Lvalue  '           / label for field   2                            TFORM2  = '1L      '           / data format of field: 1-byte LOGICAL           TUNIT2  = 'm**2    '           / physical unit of field                         TTYPE3  = 'Xvalue  '           / label for field   3                            TFORM3  = '16X     '           / data format of field: BIT                      TUNIT3  = 'cm      '           / physical unit of field                         TTYPE4  = 'Bvalue  '           / label for field   4                            TFORM4  = '1B      '           / data format of field: BYTE                     TUNIT4  = 'erg/s   '           / physical unit of field                         TTYPE5  = 'Ivalue  '           / label for field   5                            TFORM5  = '1I      '           / data format of field: 2-byte INTEGER           TUNIT5  = 'km/s    '           / physical unit of field                         TTYPE6  = 'Evalue  '           / label for field   7                            TFORM6  = '1E      '           / data format of field: 4-byte REAL              TTYPE7  = 'Dvalue  '           / label for field   8                            TFORM7  = '1D      '           / data format of field: 8-byte DOUBLE            TTYPE9  = 'Cvalue  '           / label for field   9                            TFORM9  = '1C      '           / data format of field: COMPLEX                  TTYPE10 = 'Mvalue  '           / label for field  10                            TFORM10 = '1M      '           / data format of field: DOUBLE COMPLEX           EXTNAME = 'Test-BINTABLE'      / name of this binary table extension            EXTVER  =                    1 / extension version number                       TNULL4  =                   99 / value for undefined pixels                     TNULL5  =                   99 / value for undefined pixels                     TDIM3   = '(1,2,8) '           / size of the multidimensional array             KEY_PREC= 'This keyword was written by f_prec' / comment here                   TTYPE8  = 'INSERT_COL'         / label for field                                TFORM8  = '1E      '           / format of field                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             first string   FLp�?���?�����������?�������?���������������second string  T�|�@���@�����������@@������@����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������               F���@@��@����������@�������@��������������              F��������������������@�������@������� ���������������������T���@���@����������A��� ��@"�������$���������������������T��������������������A0���@��@&�������(���������������������F��	�	A��@"����������A�������@1�������2���������������������T������ ���$����������A�������@3�������4������������������������c�c�������������������������������������������������������T���A@��@(�������������������������������������������������F��c�c�������������������������������������������������������F������`���,�������������������������������������������������F����c�������������������������������������������������������F����������0�������������������������������������������������T����c�������������������������������������������������������T����������2�������������������������������������������������T����c�������������������������������������������������������T����������4�������������������������������������������������F����c������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / 8-bit bytes                                    NAXIS   =                    2 / 2-dimensional binary table                     NAXIS1  =                   80 / width of table in bytes                        NAXIS2  =                   20 / number of rows in table                        PCOUNT  =                 4446 / size of special data area                      GCOUNT  =                    1 / one data group (required keyword)              TFIELDS =                   10 / number of fields in each row                   TTYPE1  = 'Avalue  '           / label for field   1                            TFORM1  = '1PA(20) '           / data format of field: variable length array    TTYPE2  = 'Lvalue  '           / label for field   2                            TFORM2  = '1PL(20) '           / data format of field: variable length array    TUNIT2  = 'm**2    '           / physical unit of field                         TTYPE3  = 'Xvalue  '           / label for field   3                            TFORM3  = '1PB(3)  '           / data format of field: variable length array    TUNIT3  = 'cm      '           / physical unit of field                         TTYPE4  = 'Bvalue  '           / label for field   4                            TFORM4  = '1PB(20) '           / data format of field: variable length array    TUNIT4  = 'erg/s   '           / physical unit of field                         TTYPE5  = 'Ivalue  '           / label for field   5                            TFORM5  = '1PI(20) '           / data format of field: variable length array    TUNIT5  = 'km/s    '           / physical unit of field                         TTYPE6  = 'Jvalue  '           / label for field   6                            TFORM6  = '1PJ(20) '           / data format of field: variable length array    TTYPE7  = 'Evalue  '           / label for field   7                            TFORM7  = '1PE(20) '           / data format of field: variable length array    TTYPE8  = 'Dvalue  '           / label for field   8                            TFORM8  = '1PD(20) '           / data format of field: variable length array    TTYPE9  = 'Cvalue  '           / label for field   9                            TFORM9  = '1PC(0)  '           / data format of field: variable length array    TTYPE10 = 'Mvalue  '           / label for field  10                            TFORM10 = '1PM(0)  '           / data format of field: variable length array    EXTNAME = 'Test-BINTABLE'      / name of this binary table extension            EXTVER  =                    4 / extension version number                       TNULL4  =                   88 / value for undefined pixels                     TNULL5  =                   88 / value for undefined pixels                     TNULL6  =                   88 / value for undefined pixels                     END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             �������������������������������������������
+����������������������������������������������������������!������)������1����������������������A������D������G������H������K������Q������]������i�����������������������������������������������������������������������������������������������������������������������������������������������������������������@�����F�����L�����M�����S�����_�����w������������������������������������������������������������������������������������������S�����[�����c�����d�����l�����|�������������������������������	������	����������	�����	�����	��+���	��O���	��s�������������������
 ������
-������
-������
+������������
 ������
 ������
 ������
 �����
-��?��������������������������������������������������������������� ���������������������x������������������������������������������������������������
��v���
������
������
������
������
������
������
��!���������������������������������������������������������	�����A���������������������������������������������������������	:�����	v���������������������	������	������
+��?��������������������������������������������������������������� ���������������������x������������������������������������������������������������
��v���
������������
������
������
������
������
��!���������������������������������������������������������	�����A���������������������������������������������������������	:�����	v���������������������	������	������
 �����
 �����
  �����
 @�����
 ������
-����������������������@�����Q�����b�����e�����v����������������� ���������������������������������������������������
�����
M�����
����������������������%�����8�����K�����N�����a�������������������������������������������������������������������������n���������������������� F�����?���?�������ab�T@X�X����X�������@�����������@�������abcF�F@X��X�������X���?�������@@��?���������������@������abcdFT�F@X���X����������X���?���@�������@���?�������@���������������@������abcdeFTF�THX����X�������������X���?���@���@@������@���?�������@�������@��������������@������abcdefFTFF�TLX�����X����������������X���?���@���@@��@�������@���?�������@�������@������@��������������@������abcdefgFTFFT�FLX������X�������������������X���?���@���@@��@���@�������@���?�������@�������@������@������@��������������@������abcdefghFTFFTT�FLX�������X����������������������X���?���@���@@��@���@���@�������A���?�������@�������@������@������@������@��������������@ ������abcdefghiFTFFTTF�FL�X	��������X�	������������������������X���	?���@���@@��@���@���@���@�������A��?�������@�������@������@������@������@������@��������������@"������abcdefghijFTFFTTFF�TL@X
+����������������������@�����Q�����b�����e�����v����������������� ���������������������������������������������������
�����
M�����
����������������������%�����8�����K�����N�����a�������������������������������������������������������������������������n���������������������� F�����?���?�������ab�T@X�X����X�������@�����������@�������abcF�F@X��X�������X���?�������@@��?���������������@������abcdFT�F@X���X����������X���?���@�������@���?�������@���������������@������abcdeFTF�THX����X�������������X���?���@���@@������@���?�������@�������@��������������@������abcdefFTFF�TLX�����X����������������X���?���@���@@��@�������@���?�������@�������@������@��������������@������abcdefgFTFFT�FLX������X�������������������X���?���@���@@��@���@�������@���?�������@�������@������@������@��������������@������abcdefghFTFFTT�FLX�������X����������������������X���?���@���@@��@���@���@�������A���?�������@�������@������@������@������@��������������@ ������abcdefghiFTFFTTF�FL�X	��������X�	������������������������X���	?���@���@@��@���@���@���@�������A��?�������@�������@������@������@������@������@��������������@"������abcdefghijFTFFTTFF�TL@X
 ���������X�
 ���������������������������X���
 ?���@���@@��@���@���@���@���A�������A ��?�������@�������@������@������@������@������@������@ ��������������@$������abcdefghijkFTFFTTFFF�TL`	X���������	�X����������������������������	���X���?���@���@@��@���@���@���@���A���A������A0��?�������@�������@������@������@������@������@������@ ������@"��������������@&������abcdefghijklFTFFTTFFFT�TLp	
diff --git a/uncompress_fits.c b/uncompress_fits.c
deleted file mode 100644
index 4762b99..0000000
--- a/uncompress_fits.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "fitsio.h"
-
-void printerror( int status);
-int main(int argc, char *argv[])
-{
-    fitsfile *infptr, *outfptr;  /* pointer to the FITS files */
-    int status = 0;
-    char infile[FLEN_FILENAME];     
-    char outfile[FLEN_FILENAME];
-
-    if (argc != 3)
-    {
-        printf("Usage:  uncompress_fits infile+ext outfile \n");
-        printf("  where,\n");
-        printf("   infile  = name of FITS image file to be uncompressed\n");
-        printf("   +ext    = number of the FITS extension \n");
-        printf("   outfile = name of output uncompressed FITS image file \n");
-        exit(0);
-    }
-
-    strcpy(infile, argv[1] );   /* name of file to uncompress */
-    strcpy(outfile, argv[2] );   /* name of output file */
-
-
-    if ( fits_open_file(&infptr, infile, READONLY, &status) ) 
-         printerror( status );
-
-    /* decompress the entire image and write to new output image */
-    if ( fits_create_file(&outfptr, outfile, &status) ) 
-         printerror( status );
-
-    if ( fits_decomp_img(infptr, outfptr, &status) ) 
-         printerror( status );
-
-    fits_close_file(infptr, &status);
-
-    if ( fits_close_file(outfptr, &status) )
-         printerror( status );
-
-    exit(0);
-}
-/*--------------------------------------------------------------------------*/
-void printerror( int status)
-{
-    /*****************************************************/
-    /* Print out cfitsio error messages and exit program */
-    /*****************************************************/
-
-    char status_str[FLEN_STATUS], errmsg[FLEN_ERRMSG];
-  
-    if (status)
-      fprintf(stderr, "\n*** Error occurred during program execution ***\n");
-
-    fits_get_errstatus(status, status_str);   /* get the error description */
-    fprintf(stderr, "\nstatus = %d: %s\n", status, status_str);
-
-    /* get first message; null if stack is empty */
-    if ( fits_read_errmsg(errmsg) ) 
-    {
-         fprintf(stderr, "\nError message stack:\n");
-         fprintf(stderr, " %s\n", errmsg);
-
-         while ( fits_read_errmsg(errmsg) )  /* get remaining messages */
-             fprintf(stderr, " %s\n", errmsg);
-    }
-
-    exit( status );       /* terminate the program, returning error status */
-}
diff --git a/wcsutil.c b/wcsutil.c
index f3a2e76..c5b87fa 100644
--- a/wcsutil.c
+++ b/wcsutil.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include <math.h>
 #include <string.h>
 #include "fitsio2.h"
@@ -23,12 +24,14 @@ int ffgics(fitsfile *fptr,    /* I - FITS file pointer           */
        keywords are not present.
 */
 {
-    int tstat;
+    int tstat = 0, cd_exists = 0, pc_exists = 0;
     char ctype[FLEN_VALUE];
-    double cd11, cd21, cd22, cd12;
+    double cd11 = 0.0, cd21 = 0.0, cd22 = 0.0, cd12 = 0.0;
+    double pc11 = 1.0, pc21 = 0.0, pc22 = 1.0, pc12 = 0.0;
     double pi =  3.1415926535897932;
     double phia, phib, temp;
     double toler = .0002;  /* tolerance for angles to agree (radians) */
+                           /*   (= approximately 0.01 degrees) */
 
     if (*status > 0)
        return(*status);
@@ -53,14 +56,29 @@ int ffgics(fitsfile *fptr,    /* I - FITS file pointer           */
     tstat = 0;
     if (ffgkyd(fptr, "CDELT1", xinc, NULL, &tstat))
     {
-        /* no CDELTn keyword, so look for the CD matrix */
+        /* CASE 1: no CDELTn keyword, so look for the CD matrix */
         tstat = 0;
-        ffgkyd(fptr, "CD1_1", &cd11, NULL, &tstat);
-        ffgkyd(fptr, "CD2_1", &cd21, NULL, &tstat);
-        ffgkyd(fptr, "CD1_2", &cd12, NULL, &tstat);
-        ffgkyd(fptr, "CD2_2", &cd22, NULL, &tstat);
-
-        if (!tstat)  /* convert CDi_j back to CDELTn */
+        if (ffgkyd(fptr, "CD1_1", &cd11, NULL, &tstat))
+            tstat = 0;  /* reset keyword not found error */
+        else
+            cd_exists = 1;  /* found at least 1 CD_ keyword */
+
+        if (ffgkyd(fptr, "CD2_1", &cd21, NULL, &tstat))
+            tstat = 0;  /* reset keyword not found error */
+        else
+            cd_exists = 1;  /* found at least 1 CD_ keyword */
+
+        if (ffgkyd(fptr, "CD1_2", &cd12, NULL, &tstat))
+            tstat = 0;  /* reset keyword not found error */
+        else
+            cd_exists = 1;  /* found at least 1 CD_ keyword */
+
+        if (ffgkyd(fptr, "CD2_2", &cd22, NULL, &tstat))
+            tstat = 0;  /* reset keyword not found error */
+        else
+            cd_exists = 1;  /* found at least 1 CD_ keyword */
+
+        if (cd_exists)  /* convert CDi_j back to CDELTn */
         {
             /* there are 2 ways to compute the angle: */
             phia = atan2( cd21, cd11);
@@ -107,6 +125,7 @@ int ffgics(fitsfile *fptr,    /* I - FITS file pointer           */
         {
             *xinc = 1.;
 
+            /* there was no CDELT1 keyword, but check for CDELT2 just in case */
             tstat = 0;
             if (ffgkyd(fptr, "CDELT2", yinc, NULL, &tstat))
                 *yinc = 1.;
@@ -116,14 +135,69 @@ int ffgics(fitsfile *fptr,    /* I - FITS file pointer           */
                 *rot=0.;
         }
     }
-    else
+    else  /* Case 2: CDELTn + optional PC matrix */
     {
         if (ffgkyd(fptr, "CDELT2", yinc, NULL, &tstat))
             *yinc = 1.;
 
         tstat = 0;
         if (ffgkyd(fptr, "CROTA2", rot, NULL, &tstat))
+        {
             *rot=0.;
+
+            /* no CROTA2 keyword, so look for the PC matrix */
+            tstat = 0;
+            if (ffgkyd(fptr, "PC1_1", &pc11, NULL, &tstat))
+                tstat = 0;  /* reset keyword not found error */
+            else
+                pc_exists = 1;  /* found at least 1 PC_ keyword */
+
+            if (ffgkyd(fptr, "PC2_1", &pc21, NULL, &tstat))
+                tstat = 0;  /* reset keyword not found error */
+            else
+                pc_exists = 1;  /* found at least 1 PC_ keyword */
+
+            if (ffgkyd(fptr, "PC1_2", &pc12, NULL, &tstat))
+                tstat = 0;  /* reset keyword not found error */
+            else
+                pc_exists = 1;  /* found at least 1 PC_ keyword */
+
+            if (ffgkyd(fptr, "PC2_2", &pc22, NULL, &tstat))
+                tstat = 0;  /* reset keyword not found error */
+            else
+                pc_exists = 1;  /* found at least 1 PC_ keyword */
+
+            if (pc_exists)  /* convert PCi_j back to CDELTn */
+            {
+                /* there are 2 ways to compute the angle: */
+                phia = atan2( pc21, pc11);
+                phib = atan2(-pc12, pc22);
+
+                /* ensure that phia <= phib */
+                temp = minvalue(phia, phib);
+                phib = maxvalue(phia, phib);
+                phia = temp;
+
+                /* there is a possible 180 degree ambiguity in the angles */
+                /* so add 180 degress to the smaller value if the values  */
+                /* differ by more than 90 degrees = pi/2 radians.         */
+                /* (Later, we may decide to take the other solution by    */
+                /* subtracting 180 degrees from the larger value).        */
+
+                if ((phib - phia) > (pi / 2.))
+                   phia += pi;
+
+                if (fabs(phia - phib) > toler) 
+                {
+                  /* angles don't agree, so looks like there is some skewness */
+                  /* between the axes.  Return with an error to be safe. */
+                  *status = APPROX_WCS_KEY;
+                }
+      
+                phia = (phia + phib) /2.;  /* use the average of the 2 values */
+                *rot = phia * 180. / pi;
+            }
+        }
     }
 
     /* get the type of projection, if any */
diff --git a/winDumpExts.mak b/winDumpExts.mak
new file mode 100644
index 0000000..84e79ae
--- /dev/null
+++ b/winDumpExts.mak
@@ -0,0 +1,191 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on winDumpExts.dsp
+!IF "$(CFG)" == ""
+CFG=winDumpExts - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to winDumpExts - Win32 Debug.
+!ENDIF 
+
+!IF "$(CFG)" != "winDumpExts - Win32 Release" && "$(CFG)" != "winDumpExts - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "winDumpExts.mak" CFG="winDumpExts - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "winDumpExts - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "winDumpExts - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+!ERROR An invalid configuration is specified.
+!ENDIF 
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+!IF  "$(CFG)" == "winDumpExts - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "$(OUTDIR)\winDumpExts.exe"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\winDumpExts.obj"
+	-@erase "$(OUTDIR)\winDumpExts.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+"$(INTDIR)" :
+    if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\winDumpExts.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\winDumpExts.bsc" 
+BSC32_SBRS= \
+	
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\winDumpExts.pdb" /machine:I386 /out:"$(OUTDIR)\winDumpExts.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\winDumpExts.obj"
+
+"$(OUTDIR)\winDumpExts.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF  "$(CFG)" == "winDumpExts - Win32 Debug"
+
+OUTDIR=.
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.
+# End Custom Macros
+
+ALL : "$(OUTDIR)\winDumpExts.exe"
+
+
+CLEAN :
+	-@erase "$(INTDIR)\vc60.idb"
+	-@erase "$(INTDIR)\vc60.pdb"
+	-@erase "$(INTDIR)\winDumpExts.obj"
+	-@erase "$(OUTDIR)\winDumpExts.exe"
+	-@erase "$(OUTDIR)\winDumpExts.ilk"
+	-@erase "$(OUTDIR)\winDumpExts.pdb"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+"$(INTDIR)" :
+    if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\winDumpExts.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\winDumpExts.bsc" 
+BSC32_SBRS= \
+	
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\winDumpExts.pdb" /debug /machine:I386 /out:"$(OUTDIR)\winDumpExts.exe" /pdbtype:sept 
+LINK32_OBJS= \
+	"$(INTDIR)\winDumpExts.obj"
+
+"$(OUTDIR)\winDumpExts.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF 
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("winDumpExts.dep")
+!INCLUDE "winDumpExts.dep"
+!ELSE 
+!MESSAGE Warning: cannot find "winDumpExts.dep"
+!ENDIF 
+!ENDIF 
+
+
+!IF "$(CFG)" == "winDumpExts - Win32 Release" || "$(CFG)" == "winDumpExts - Win32 Debug"
+SOURCE=.\winDumpExts.c
+
+"$(INTDIR)\winDumpExts.obj" : $(SOURCE) "$(INTDIR)"
+
+
+
+!ENDIF 
+
diff --git a/windumpexts.c b/windumpexts.c
new file mode 100644
index 0000000..c09a613
--- /dev/null
+++ b/windumpexts.c
@@ -0,0 +1,502 @@
+/* 
+ * winDumpExts.c --
+ * Author:   Gordon Chaffee, Scott Stanton
+ *
+ * History:  The real functionality of this file was written by
+ *           Matt Pietrek in 1993 in his pedump utility.  I've
+ *           modified it to dump the externals in a bunch of object
+ *           files to create a .def file.
+ *
+ * 10/12/95  Modified by Scott Stanton to support Relocatable Object Module
+ *	     Format files for Borland C++ 4.5.
+ *
+ * Notes:    Visual C++ puts an underscore before each exported symbol.
+ *           This file removes them.  I don't know if this is a problem
+ *           this other compilers.  If _MSC_VER is defined,
+ *           the underscore is removed.  If not, it isn't.  To get a
+ *           full dump of an object file, use the -f option.  This can
+ *           help determine the something that may be different with a
+ *           compiler other than Visual C++.
+ *----------------------------------------------------------------------
+ *
+ */
+
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+#include <process.h>
+
+#ifdef _ALPHA_
+#define e_magic_number IMAGE_FILE_MACHINE_ALPHA
+#else
+#define e_magic_number IMAGE_FILE_MACHINE_I386
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ * GetArgcArgv --
+ * 
+ *	Break up a line into argc argv
+ *----------------------------------------------------------------------
+ */
+int
+GetArgcArgv(char *s, char **argv)
+{
+    int quote = 0;
+    int argc = 0;
+    char *bp;
+
+    bp = s;
+    while (1) {
+	while (isspace(*bp)) {
+	    bp++;
+	}
+	if (*bp == '\n' || *bp == '\0') {
+	    *bp = '\0';
+	    return argc;
+	}
+	if (*bp == '\"') {
+	    quote = 1;
+	    bp++;
+	}
+	argv[argc++] = bp;
+
+	while (*bp != '\0') {
+	    if (quote) {
+		if (*bp == '\"') {
+		    quote = 0;
+		    *bp = '\0';
+		    bp++;
+		    break;
+		}
+		bp++;
+		continue;
+	    }
+	    if (isspace(*bp)) {
+		*bp = '\0';
+		bp++;
+		break;
+	    }
+	    bp++;
+	}
+    }
+}
+
+/*
+ *  The names of the first group of possible symbol table storage classes
+ */
+char * SzStorageClass1[] = {
+    "NULL","AUTOMATIC","EXTERNAL","STATIC","REGISTER","EXTERNAL_DEF","LABEL",
+    "UNDEFINED_LABEL","MEMBER_OF_STRUCT","ARGUMENT","STRUCT_TAG",
+    "MEMBER_OF_UNION","UNION_TAG","TYPE_DEFINITION","UNDEFINED_STATIC",
+    "ENUM_TAG","MEMBER_OF_ENUM","REGISTER_PARAM","BIT_FIELD"
+};
+
+/*
+ * The names of the second group of possible symbol table storage classes
+ */
+char * SzStorageClass2[] = {
+    "BLOCK","FUNCTION","END_OF_STRUCT","FILE","SECTION","WEAK_EXTERNAL"
+};
+
+/*
+ *----------------------------------------------------------------------
+ * GetSZStorageClass --
+ *
+ *	Given a symbol storage class value, return a descriptive
+ *	ASCII string
+ *----------------------------------------------------------------------
+ */
+PSTR
+GetSZStorageClass(BYTE storageClass)
+{
+	if ( storageClass <= IMAGE_SYM_CLASS_BIT_FIELD )
+		return SzStorageClass1[storageClass];
+	else if ( (storageClass >= IMAGE_SYM_CLASS_BLOCK)
+		      && (storageClass <= IMAGE_SYM_CLASS_WEAK_EXTERNAL) )
+		return SzStorageClass2[storageClass-IMAGE_SYM_CLASS_BLOCK];
+	else
+		return "???";
+}
+
+/*
+ *----------------------------------------------------------------------
+ * GetSectionName --
+ *
+ *	Used by DumpSymbolTable, it gives meaningful names to
+ *	the non-normal section number.
+ *
+ * Results:
+ *	A name is returned in buffer
+ *----------------------------------------------------------------------
+ */
+void
+GetSectionName(WORD section, PSTR buffer, unsigned cbBuffer)
+{
+    char tempbuffer[10];
+	
+    switch ( (SHORT)section )
+    {
+      case IMAGE_SYM_UNDEFINED: strcpy(tempbuffer, "UNDEF"); break;
+      case IMAGE_SYM_ABSOLUTE:  strcpy(tempbuffer, "ABS  "); break;
+      case IMAGE_SYM_DEBUG:	  strcpy(tempbuffer, "DEBUG"); break;
+      default: wsprintf(tempbuffer, "%-5X", section);
+    }
+	
+    strncpy(buffer, tempbuffer, cbBuffer-1);
+}
+
+/*
+ *----------------------------------------------------------------------
+ * DumpSymbolTable --
+ *
+ *	Dumps a COFF symbol table from an EXE or OBJ.  We only use
+ *	it to dump tables from OBJs.
+ *----------------------------------------------------------------------
+ */
+void
+DumpSymbolTable(PIMAGE_SYMBOL pSymbolTable, FILE *fout, unsigned cSymbols)
+{
+    unsigned i;
+    PSTR stringTable;
+    char sectionName[10];
+	
+    fprintf(fout, "Symbol Table - %X entries  (* = auxillary symbol)\n",
+	    cSymbols);
+
+    fprintf(fout, 
+     "Indx Name                 Value    Section    cAux  Type    Storage\n"
+     "---- -------------------- -------- ---------- ----- ------- --------\n");
+
+    /*
+     * The string table apparently starts right after the symbol table
+     */
+    stringTable = (PSTR)&pSymbolTable[cSymbols]; 
+		
+    for ( i=0; i < cSymbols; i++ ) {
+	fprintf(fout, "%04X ", i);
+	if ( pSymbolTable->N.Name.Short != 0 )
+	    fprintf(fout, "%-20.8s", pSymbolTable->N.ShortName);
+	else
+	    fprintf(fout, "%-20s", stringTable + pSymbolTable->N.Name.Long);
+
+	fprintf(fout, " %08X", pSymbolTable->Value);
+
+	GetSectionName(pSymbolTable->SectionNumber, sectionName,
+		       sizeof(sectionName));
+	fprintf(fout, " sect:%s aux:%X type:%02X st:%s\n",
+	       sectionName,
+	       pSymbolTable->NumberOfAuxSymbols,
+	       pSymbolTable->Type,
+	       GetSZStorageClass(pSymbolTable->StorageClass) );
+#if 0
+	if ( pSymbolTable->NumberOfAuxSymbols )
+	    DumpAuxSymbols(pSymbolTable);
+#endif
+
+	/*
+	 * Take into account any aux symbols
+	 */
+	i += pSymbolTable->NumberOfAuxSymbols;
+	pSymbolTable += pSymbolTable->NumberOfAuxSymbols;
+	pSymbolTable++;
+    }
+}
+
+/*
+ *----------------------------------------------------------------------
+ * DumpExternals --
+ *
+ *	Dumps a COFF symbol table from an EXE or OBJ.  We only use
+ *	it to dump tables from OBJs.
+ *----------------------------------------------------------------------
+ */
+void
+DumpExternals(PIMAGE_SYMBOL pSymbolTable, FILE *fout, unsigned cSymbols)
+{
+    unsigned i;
+    PSTR stringTable;
+    char *s, *f;
+    char symbol[1024];
+	
+    /*
+     * The string table apparently starts right after the symbol table
+     */
+    stringTable = (PSTR)&pSymbolTable[cSymbols]; 
+		
+    for ( i=0; i < cSymbols; i++ ) {
+	if (pSymbolTable->SectionNumber > 0 && pSymbolTable->Type == 0x20) {
+	    if (pSymbolTable->StorageClass == IMAGE_SYM_CLASS_EXTERNAL) {
+		if (pSymbolTable->N.Name.Short != 0) {
+		    strncpy(symbol, pSymbolTable->N.ShortName, 8);
+		    symbol[8] = 0;
+		} else {
+		    s = stringTable + pSymbolTable->N.Name.Long;
+		    strcpy(symbol, s);
+		}
+		s = symbol;
+		f = strchr(s, '@');
+		if (f) {
+		    *f = 0;
+		}
+#if defined(_MSC_VER) && defined(_X86_)
+		if (symbol[0] == '_') {
+		    s = &symbol[1];
+		}
+#endif
+		if ((stricmp(s, "DllEntryPoint") != 0) 
+			&& (stricmp(s, "DllMain") != 0)) {
+		    fprintf(fout, "\t%s\n", s);
+		}
+	    }
+	}
+
+	/*
+	 * Take into account any aux symbols
+	 */
+	i += pSymbolTable->NumberOfAuxSymbols;
+	pSymbolTable += pSymbolTable->NumberOfAuxSymbols;
+	pSymbolTable++;
+    }
+}
+
+/*
+ *----------------------------------------------------------------------
+ * DumpObjFile --
+ *
+ *	Dump an object file--either a full listing or just the exported
+ *	symbols.
+ *----------------------------------------------------------------------
+ */
+void
+DumpObjFile(PIMAGE_FILE_HEADER pImageFileHeader, FILE *fout, int full)
+{
+    PIMAGE_SYMBOL PCOFFSymbolTable;
+    DWORD COFFSymbolCount;
+    
+    PCOFFSymbolTable = (PIMAGE_SYMBOL)
+	((DWORD)pImageFileHeader + pImageFileHeader->PointerToSymbolTable);
+    COFFSymbolCount = pImageFileHeader->NumberOfSymbols;
+
+    if (full) {
+	DumpSymbolTable(PCOFFSymbolTable, fout, COFFSymbolCount);
+    } else {
+	DumpExternals(PCOFFSymbolTable, fout, COFFSymbolCount);
+    }
+}
+
+/*
+ *----------------------------------------------------------------------
+ * SkipToNextRecord --
+ *
+ *	Skip over the current ROMF record and return the type of the
+ *	next record.
+ *----------------------------------------------------------------------
+ */
+
+BYTE
+SkipToNextRecord(BYTE **ppBuffer)
+{
+    int length;
+    (*ppBuffer)++;		/* Skip over the type.*/
+    length = *((WORD*)(*ppBuffer))++; /* Retrieve the length. */
+    *ppBuffer += length;	/* Skip over the rest. */
+    return **ppBuffer;		/* Return the type. */
+}
+
+/*
+ *----------------------------------------------------------------------
+ * DumpROMFObjFile --
+ *
+ *	Dump a Relocatable Object Module Format file, displaying only
+ *	the exported symbols.
+ *----------------------------------------------------------------------
+ */
+void
+DumpROMFObjFile(LPVOID pBuffer, FILE *fout)
+{
+    BYTE type, length;
+    char symbol[1024], *s;
+
+    while (1) {
+	type = SkipToNextRecord(&(BYTE*)pBuffer);
+	if (type == 0x90) {	/* PUBDEF */
+	    if (((BYTE*)pBuffer)[4] != 0) {
+		length = ((BYTE*)pBuffer)[5];
+		strncpy(symbol, ((char*)pBuffer) + 6, length);
+		symbol[length] = '\0';
+		s = symbol;
+		if ((stricmp(s, "DllEntryPoint") != 0) 
+			&& (stricmp(s, "DllMain") != 0)) {
+		    if (s[0] == '_') {
+			s++;
+			fprintf(fout, "\t_%s\n\t%s=_%s\n", s, s, s);
+		    } else {
+			fprintf(fout, "\t%s\n", s);
+		    }
+		}
+	    }
+	} else if (type == 0x8B || type == 0x8A) { /* MODEND */
+	    break;
+	}
+    }
+}
+
+/*
+ *----------------------------------------------------------------------
+ * DumpFile --
+ *
+ *	Open up a file, memory map it, and call the appropriate
+ *	dumping routine
+ *----------------------------------------------------------------------
+ */
+void
+DumpFile(LPSTR filename, FILE *fout, int full)
+{
+    HANDLE hFile;
+    HANDLE hFileMapping;
+    LPVOID lpFileBase;
+    PIMAGE_DOS_HEADER dosHeader;
+	
+    hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
+		       OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+					
+    if (hFile == INVALID_HANDLE_VALUE) {
+	fprintf(stderr, "Couldn't open file with CreateFile()\n");
+	return;
+    }
+
+    hFileMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
+    if (hFileMapping == 0) {
+	CloseHandle(hFile);
+	fprintf(stderr, "Couldn't open file mapping with CreateFileMapping()\n");
+	return;
+    }
+
+    lpFileBase = MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0);
+    if (lpFileBase == 0) {
+	CloseHandle(hFileMapping);
+	CloseHandle(hFile);
+	fprintf(stderr, "Couldn't map view of file with MapViewOfFile()\n");
+	return;
+    }
+
+    dosHeader = (PIMAGE_DOS_HEADER)lpFileBase;
+    if (dosHeader->e_magic == IMAGE_DOS_SIGNATURE) {
+#if 0
+	DumpExeFile( dosHeader );
+#else
+	fprintf(stderr, "File is an executable.  I don't dump those.\n");
+	return;
+#endif
+    }
+    /* Does it look like a i386 COFF OBJ file??? */
+    else if ((dosHeader->e_magic == e_magic_number)
+	    && (dosHeader->e_sp == 0)) {
+	/*
+	 * The two tests above aren't what they look like.  They're
+	 * really checking for IMAGE_FILE_HEADER.Machine == i386 (0x14C)
+	 * and IMAGE_FILE_HEADER.SizeOfOptionalHeader == 0;
+	 */
+	DumpObjFile((PIMAGE_FILE_HEADER) lpFileBase, fout, full);
+    } else if (*((BYTE *)lpFileBase) == 0x80) {
+	/*
+	 * This file looks like it might be a ROMF file.
+	 */
+	DumpROMFObjFile(lpFileBase, fout);
+    } else {
+	printf("unrecognized file format\n");
+    }
+    UnmapViewOfFile(lpFileBase);
+    CloseHandle(hFileMapping);
+    CloseHandle(hFile);
+}
+
+void
+main(int argc, char **argv)
+{
+    char *fargv[1000];
+    char cmdline[10000];
+    int i, arg;
+    FILE *fout;
+    int pos;
+    int full = 0;
+    char *outfile = NULL;
+
+    if (argc < 3) {
+      Usage:
+	fprintf(stderr, "Usage: %s ?-o outfile? ?-f(ull)? <dllname> <object filenames> ..\n", argv[0]);
+	exit(1);
+    }
+
+    arg = 1;
+    while (argv[arg][0] == '-') {
+	if (strcmp(argv[arg], "--") == 0) {
+	    arg++;
+	    break;
+	} else if (strcmp(argv[arg], "-f") == 0) {
+	    full = 1;
+	} else if (strcmp(argv[arg], "-o") == 0) {
+	    arg++;
+	    if (arg == argc) {
+		goto Usage;
+	    }
+	    outfile = argv[arg];
+	}
+	arg++;
+    }
+    if (arg == argc) {
+	goto Usage;
+    }
+
+    if (outfile) {
+	fout = fopen(outfile, "w+");
+	if (fout == NULL) {
+	    fprintf(stderr, "Unable to open \'%s\' for writing:\n",
+		    argv[arg]);
+	    perror("");
+	    exit(1);
+	}
+    } else {
+	fout = stdout;
+    }
+    
+    if (! full) {
+	char *dllname = argv[arg];
+	arg++;
+	if (arg == argc) {
+	    goto Usage;
+	}
+	fprintf(fout, "LIBRARY    %s\n", dllname);
+	fprintf(fout, "EXETYPE WINDOWS\n");
+	fprintf(fout, "CODE PRELOAD MOVEABLE DISCARDABLE\n");
+	fprintf(fout, "DATA PRELOAD MOVEABLE MULTIPLE\n\n");
+	fprintf(fout, "EXPORTS\n");
+    }
+
+    for (; arg < argc; arg++) {
+	if (argv[arg][0] == '@') {
+	    FILE *fargs = fopen(&argv[arg][1], "r");
+	    if (fargs == NULL) {
+		fprintf(stderr, "Unable to open \'%s\' for reading:\n",
+			argv[arg]);
+		perror("");
+		exit(1);
+	    }
+	    pos = 0;
+	    for (i = 0; i < arg; i++) {
+		strcpy(&cmdline[pos], argv[i]);
+		pos += strlen(&cmdline[pos]) + 1;
+		fargv[i] = argv[i];
+	    }
+	    fgets(&cmdline[pos], sizeof(cmdline), fargs);
+	    fprintf(stderr, "%s\n", &cmdline[pos]);
+	    fclose(fargs);
+	    i += GetArgcArgv(&cmdline[pos], &fargv[i]);
+	    argc = i;
+	    argv = fargv;
+	}
+	DumpFile(argv[arg], fout, full);
+    }
+    exit(0);
+}
-- 
GitLab