[SCM] Create, display and manipulate the world coordinate system branch, upstream, updated. 66d0e652b34ad6ffc0bb964d58b53c8fb0b8e818

Ole Streicher debian at liska.ath.cx
Thu Aug 16 13:04:54 UTC 2012


The following commit has been merged in the upstream branch:
commit 66d0e652b34ad6ffc0bb964d58b53c8fb0b8e818
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Thu Aug 16 15:03:19 2012 +0200

    New upstream version 3.8.6

diff --git a/Install b/Install
index ea34b68..c7ea0f2 100644
--- a/Install
+++ b/Install
@@ -12,20 +12,20 @@ Brief descriptions of file contents are in the Programs file.
 A history of this software is in the NEWS file.
 
 The complete source code is in
-ftp://cfa-ftp.harvard.edu/pub/gsc/WCSTools/wcstools-3.8.4.tar.gz and
+ftp://cfa-ftp.harvard.edu/pub/gsc/WCSTools/wcstools-3.8.6.tar.gz and
 ftp://cfa-ftp.harvard.edu/pub/gsc/WCSTools/wcstls37.zip and
-http://tdc-www.harvard.edu/software/wcstools/wcstools-3.8.4.tar.gz
+http://tdc-www.harvard.edu/software/wcstools/wcstools-3.8.6.tar.gz
 
 Documentation, with examples and installation directions, is on the
 World Wide Web at http://tdc-www.harvard.edu/software/wcstools/
 
 To install the code, create a directory for it, download it, and run
 
-        gzcat wcstools-3.8.4.tar.gz | tar xvf -
+        gzcat wcstools-3.8.6.tar.gz | tar xvf -
 or
         unzip wcstls37.zip
 
-The directory wcstools-3.8.4 will contain the source code for the programs,
+The directory wcstools-3.8.6 will contain the source code for the programs,
 and a subdirectory, libwcs, will contain the source code for the subroutines.
 
 Catalog access subroutines, gscread.c, actread, uacread.c, ubcread.c,
@@ -73,5 +73,5 @@ systems, and even that has been minimized. The package even compiles and runs
 under Windows using the free Cygwin environment. If you have any problems,
 feel free to write the author. 
 
--Doug Mink, SAO, 2011-09-21
+-Jessica Mink, SAO, 2012-08-10
 http://tdc-www.harvard.edu/mink/
diff --git a/NEWS b/NEWS
index 0c3baaf..cc3e096 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,13 @@
+Version 3.8.6 (August 10, 2012)
+sumpix: Add options i to print index and e to compute medians
+gethead: Call fk425e() instead of fk425()
+imcat: Drop declaration of unused fk425e()
+imutil.c: Add medpix() and meanpix() to generalize across pixel size
+imutil.c: Add medpixi1() and meanpixi1() to handle 8-bit images
+imio.c:  Fix 8-bit variables to be unsigned char
+ctgread.c: Allow up to 9 magnitudes (/9) instead of 4
+catutil.c, polfit.c: Fix xterm computation in polcomp() from + to *
+
 Version 3.8.5 (April 12, 2012)
 getdate: Fix string overflow in ts0 assignment (2012-03-27)
 gethead: If length of header/file content string is zero, exit with error
diff --git a/Readme b/Readme
index e2c0cde..c92d7a7 100644
--- a/Readme
+++ b/Readme
@@ -1,4 +1,4 @@
-WCSTools 3.8.5
+WCSTools 3.8.6
 
 WCSTools is a set of software utilities, written in C, which create,
 display and manipulate the world coordinate system of a FITS or IRAF
@@ -14,7 +14,7 @@ in the main directory or, on Solaris machines
 
 make -f Makefile.solaris
 
-This is version 3.8.5 of the WCSTools package developed by Jessica Mink
+This is version 3.8.6 of the WCSTools package developed by Jessica Mink
 (jmink at cfa.harvard.edu) at the Smithsonian Astrophysical Observatory,
 with significant code or algorithms from
 
@@ -37,16 +37,17 @@ helped debug the astrometry programs.
 Sergio Pascual of the Universidad Complutense de Madrid helped me get
 all of the variables initialized.
 
-Details of updates are in the NEWS file, but here is what is new:
+The update history is in the NEWS file, but here is what is new:
 
-Version 3.8.5 (April 12, 2012)
-getdate: Fix string overflow in ts0 assignment (2012-03-27)
-gethead: If length of header/file content string is zero, exit with error
-sumpix: Improve argument parsing so order doesn't matter (2012-02-01)
-matchstar.c: Fix bug in WCSMatch() which miscomputed means
-fitsfile.c: Always check first 8 characters of FITS files for "SIMPLE"
-imhfile.c: Fix potential overflow in newpixfile assignment (2012-03-27)
-imio.c: Change 8-bit pixel values from char to unsigned char
+Version 3.8.6 (August 10, 2012)
+sumpix: Add options i to print index and e to compute medians
+gethead: Call fk425e() instead of fk425()
+imcat: Drop declaration of unused fk425e()
+imutil.c: Add medpix() and meanpix() to generalize across pixel size
+imutil.c: Add medpixi1() and meanpixi1() to handle 8-bit images
+imio.c:  Fix 8-bit variables to be unsigned char
+ctgread.c: Allow up to 9 magnitudes (/9) instead of 4
+catutil.c, polfit.c: Fix xterm computation in polcomp() from + to *
 
 Documentation, with examples and installation directions, is on the
 World Wide Web at
@@ -167,4 +168,5 @@ wcshead	Print basic world coordinate system information on one line per image
 xy2sky	Print sky coordinates for given image pixel coordinates on the command
 	line or in a list file.
 
--Jessica Mink, SAO, 2012-04-12
+-Jessica Mink, SAO, 2012-08-10
+ http://tdc-www.harvard.edu/mink/
diff --git a/addpix.c b/addpix.c
index 02797f1..4be8442 100644
--- a/addpix.c
+++ b/addpix.c
@@ -34,7 +34,7 @@
 static void usage();
 static int newimage = 0;
 static int verbose = 0;		/* verbose flag */
-static char *RevMsg = "ADDPIX WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "ADDPIX WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static void AddPix();
 static int version = 0;		/* If 1, print only program name and version */
 
diff --git a/bincat.c b/bincat.c
index c9bb881..1dd9cba 100644
--- a/bincat.c
+++ b/bincat.c
@@ -48,7 +48,7 @@ extern void setrefpix();
 extern void setcdelt();
 extern struct WorldCoor *GetFITSWCS();
 
-static char *RevMsg = "BINCAT WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "BINCAT WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int verbose = 0;		/* verbose flag */
 static int debug = 0;		/* debugging flag */
 static int bitpix = 0;	/* number of bits per pixel (FITS code, 0=no image) */
diff --git a/catrot.c b/catrot.c
index c9be46c..36189bc 100644
--- a/catrot.c
+++ b/catrot.c
@@ -46,7 +46,7 @@ static int bitpix = 0;	/* number of bits per pixel (FITS code) */
 static int fitsout = 0;	/* Output FITS file from IRAF input if 1 */
 static int nsplit = 0;	/* Output multiple FITS files from n-extension file */
 static int overwrite = 0;	/* allow overwriting of input image file */
-static char *RevMsg = "IMROT WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMROT WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int version = 0;		/* If 1, print only program name and version */
 static int xshift = 0;
 static int yshift = 0;
diff --git a/char2sp.c b/char2sp.c
index bc032f0..f856009 100644
--- a/char2sp.c
+++ b/char2sp.c
@@ -39,7 +39,7 @@ static int verbose = 0;		/* verbose/debugging flag */
 static int version = 0;		/* If 1, print only program name and version */
 static char spchar = '_';
 
-static char *RevMsg = "CHAR2SP WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "CHAR2SP WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/conpix.c b/conpix.c
index f6ad27d..aae2d48 100644
--- a/conpix.c
+++ b/conpix.c
@@ -52,7 +52,7 @@ static int version = 0;		/* If 1, print only program name and version */
 static int setgnoise = 0;	/* If 1, pixels have been set to random noise */
 static int addgnoise = 0;	/* If 1, pixels have random noise added */
 
-static char *RevMsg = "CONPIX WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "CONPIX WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/cphead.c b/cphead.c
index 9615324..3b7b247 100644
--- a/cphead.c
+++ b/cphead.c
@@ -41,7 +41,7 @@ static void CopyValues();
 extern char *GetFITShead();
 
 static int verbose = 0;		/* verbose/debugging flag */
-static char *RevMsg = "CPHEAD WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "CPHEAD WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int copyall = 0;		/* Copy entire header, overwriting old one */
 static int nfile = 0;
 static int ndec0 = -9;
diff --git a/delhead.c b/delhead.c
index 63a42f0..4673f69 100644
--- a/delhead.c
+++ b/delhead.c
@@ -53,7 +53,7 @@ static int nproc = 0;
 static int overwrite = 0;	/* If 1, overwrite input image */
 static int first_file = 1;
 
-static char *RevMsg = "DELHEAD WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "DELHEAD WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/delwcs.c b/delwcs.c
index 88abbce..e7ea031 100644
--- a/delwcs.c
+++ b/delwcs.c
@@ -38,7 +38,7 @@ extern int DelWCSFITS ();
 static int verbose = 0;		/* Verbose/debugging flag */
 static int newimage = 0;	/* New image flag */
 static int readimage = 1;	/* Read and write image as well as header */
-static char *RevMsg = "DELWCS WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "DELWCS WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int version = 0;		/* If 1, print only program name and version */
 
 int
diff --git a/edhead.c b/edhead.c
index 26a8460..13d2891 100644
--- a/edhead.c
+++ b/edhead.c
@@ -39,7 +39,7 @@ static void EditHead();
 static int newimage = 0;
 static int verbose = 0;		/* verbose flag */
 static char *editcom0;		/* Editor command from command line */
-static char *RevMsg = "EDHEAD WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "EDHEAD WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int version = 0;		/* If 1, print only program name and version */
 
 
diff --git a/fixpix.c b/fixpix.c
index 7d2a3bb..f1daf8d 100644
--- a/fixpix.c
+++ b/fixpix.c
@@ -47,7 +47,7 @@ static int nfix = 0;		/* Number of regions to fix
 static int version = 0;		/* If 1, print only program name and version */
 static int xl[MAXFIX],yl[MAXFIX]; /* Lower left corners of regions (1 based) */
 static int xr[MAXFIX],yr[MAXFIX]; /* Upper right corners of regions (1 based) */
-static char *RevMsg = "FIXPIX WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "FIXPIX WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/getcol.c b/getcol.c
index 6e2cbdd..475823b 100644
--- a/getcol.c
+++ b/getcol.c
@@ -37,7 +37,7 @@
 #define MAXFILES	2000
 #define MAXLINES	100000
 
-static char *RevMsg = "GETCOL WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "GETCOL WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 static void usage();
 static int ListFile();
diff --git a/getdate.c b/getdate.c
index d08be98..d73e21f 100644
--- a/getdate.c
+++ b/getdate.c
@@ -66,7 +66,7 @@
 #define MST	3
 #define LST	4
 
-static char *RevMsg = "GETDATE WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "GETDATE WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 static void usage();
 static void ConvertDate();
diff --git a/getfits.c b/getfits.c
index bf150ac..30395d6 100644
--- a/getfits.c
+++ b/getfits.c
@@ -44,7 +44,7 @@ static void nextname();	/* Find next available name (namea, nameb, ...) */
 static int ExtractFITS();
 
 static int verbose = 0;		/* verbose/debugging flag */
-static char *RevMsg = "GETFITS WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "GETFITS WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int version = 0;		/* If 1, print only program name and version */
 static char outname[128];	/* Name for output image */
 static char outdir[256];	/* Output directory pathname */
diff --git a/getftab.c b/getftab.c
index 5b439d6..badb09a 100644
--- a/getftab.c
+++ b/getftab.c
@@ -40,7 +40,7 @@ static void usage();
 static void PrintValues();
 static int maxncond = 100;
 
-static char *RevMsg = "GETFTAB WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "GETFTAB WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int nfile = 0;
diff --git a/gethead.c b/gethead.c
index bc01572..6c08289 100644
--- a/gethead.c
+++ b/gethead.c
@@ -1,9 +1,9 @@
 /* File gethead.c
- * December 14, 2011
+ * August 10, 2012
  * By Jessica Mink Harvard-Smithsonian Center for Astrophysics)
  * Send bug reports to jmink at cfa.harvard.edu
 
-   Copyright (C) 1996-2011
+   Copyright (C) 1996-2012
    Smithsonian Astrophysical Observatory, Cambridge, MA USA
 
    This program is free software; you can redistribute it and/or
@@ -47,7 +47,7 @@ extern char *GetFITShead();
 static char nextnsp();
 static int PrintValues();
 
-static char *RevMsg = "GETHEAD WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "GETHEAD WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int nfile = 0;
@@ -1111,7 +1111,7 @@ char	*kwd[];		/* Names of keywords for which to print values */
 			if (!isnum (string))
 			    hgets (header, "RDEC", 80, string);
 			dec = str2dec (string);
-			fk425 (&ra, &dec);
+			fk425e (&ra, &dec, epoch);
 			ra2str (string, 80, ra, ncdec);
 			}
 		    else if (iepoch != 2000) {
@@ -1158,7 +1158,7 @@ char	*kwd[];		/* Names of keywords for which to print values */
 			if (!isnum (string))
 			    hgets (header, "RRA", 80, string);
 			ra = str2ra (string);
-			fk425 (&ra, &dec);
+			fk425e (&ra, &dec, epoch);
 			dec2str (string, 80, dec, ncdec);
 			}
 		    else if (iepoch != 2000) {
@@ -1444,4 +1444,6 @@ char *string;
  * Aug 12 2011	Fix range of extensions from -x
  * Aug 12 2011	Add prefixed range of extensions from -x
  * Dec 14 2011	If length of header/file content string is zero, exit with error
+ *
+ * Aug 10 2012	Call fk425e() instead of fk425()
  */
diff --git a/getpix.c b/getpix.c
index dd0b0d7..0f91d53 100644
--- a/getpix.c
+++ b/getpix.c
@@ -36,7 +36,7 @@ static void usage();
 static void PrintPix();
 static void procpix();
 
-static char *RevMsg = "GETPIX WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "GETPIX WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int version = 0;		/* If 1, print only program name and version */
diff --git a/gettab.c b/gettab.c
index 0b77196..d41f0b5 100644
--- a/gettab.c
+++ b/gettab.c
@@ -40,7 +40,7 @@ static void usage();
 static void PrintValues();
 static int maxncond = 100;
 
-static char *RevMsg = "GETTAB WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "GETTAB WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int nfile = 0;
diff --git a/gsc2cat.c b/gsc2cat.c
index 8217643..9f9f654 100644
--- a/gsc2cat.c
+++ b/gsc2cat.c
@@ -37,7 +37,7 @@ static int nlog = 10000;
 static void usage();
 void SaveGSC2();
 
-static char *RevMsg = "GSC2CAT WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "GSC2CAT WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 main (ac, av)
 int ac;
diff --git a/i2f.c b/i2f.c
index aa87267..c611669 100644
--- a/i2f.c
+++ b/i2f.c
@@ -34,7 +34,7 @@ static void usage();
 static void IRAFtoFITS ();
 
 static int verbose = 0;		/* verbose/debugging flag */
-static char *RevMsg = "I2F WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "I2F WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int version = 0;		/* If 1, print only program name and version */
 static int delirafkey = 0;	/* If 1, delete IRAF .imh keywords */
 static int deliraffile = 0;	/* If 1, delete IRAF .imh files */
diff --git a/imcat.c b/imcat.c
index 7e532fe..d521eca 100644
--- a/imcat.c
+++ b/imcat.c
@@ -1,9 +1,9 @@
 /* File imcat.c
- * June 3, 2010
+ * August 10, 2012
  * By Jessica Mink, Harvard-Smithsonian Center for Astrophysics
  * Send bug reports to jmink at cfa.harvard.edu
 
-   Copyright (C) 1996-2010
+   Copyright (C) 1996-2012
    Smithsonian Astrophysical Observatory, Cambridge, MA USA
 
    This program is free software; you can redistribute it and/or
@@ -54,7 +54,6 @@ static void PrintUsage();
 static void FreeBuffers();
 static int AllocBuffers();
 static void ListCat();
-extern void fk524e();
 extern struct WorldCoor *GetFITSWCS();
 extern char *GetFITShead();
 extern void setsys();
@@ -65,7 +64,7 @@ extern void setdateobs();
 extern void setparm();
 extern void setnpix();
 
-static char *RevMsg = "WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int wfile = 0;		/* True to print output file */
@@ -2433,4 +2432,6 @@ double	*decmin, *decmax;	/* Declination limits in degrees (returned) */
  *
  * Apr 30 2010	Set GSC2 magnitudes > 90 to 99.99
  * Jun  3 2010	Do not print position or proper motion errors for UCAC3
+ *
+ * Aug 10 2012	Drop declaration of fk425e(); it's not used.
  */
diff --git a/imextract.c b/imextract.c
index 2dcdbba..3b4bdb4 100644
--- a/imextract.c
+++ b/imextract.c
@@ -37,7 +37,7 @@
 static void usage();
 static int ExtractImage();
 
-static char *RevMsg = "IMEXTRACT WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMEXTRACT WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose flag */
 static int krename = 0;
diff --git a/imfill.c b/imfill.c
index 3c81133..30ccc1d 100644
--- a/imfill.c
+++ b/imfill.c
@@ -63,7 +63,7 @@ static char *badheader;		/* FITS bad pixel header */
 static double minpixval = -9999.0;	/* Minimum good pixel value */
 static double maxpixval = -9999.0;	/* Maximum good pixel value */
 
-static char *RevMsg = "IMFILL WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMFILL WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/imhead.c b/imhead.c
index e653304..232ba3e 100644
--- a/imhead.c
+++ b/imhead.c
@@ -39,7 +39,7 @@ static int nfiles = 0;		/* Nuber of files for headers */
 static int verbose = 0;		/* verbose/debugging flag */
 static int fitsout = 0;		/* If 1, write exact FITS header */
 static int zbitpix = 0;		/* If 1, set BITPIX to 0 for dataless header */
-static char *RevMsg = "IMHEAD WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "IMHEAD WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 static int version = 0;		/* If 1, print only program name and version */
 
 int
diff --git a/immatch.c b/immatch.c
index d1a3057..dacdcfa 100644
--- a/immatch.c
+++ b/immatch.c
@@ -41,7 +41,7 @@ static void MatchCat();
 #define MAXFILES 1000
 static int maxnfile = MAXFILES;
 
-static char *RevMsg = "WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int rot = 0;
diff --git a/imresize.c b/imresize.c
index 15f8412..84402ca 100644
--- a/imresize.c
+++ b/imresize.c
@@ -62,7 +62,7 @@ static int bitpix = 0;		/* Bits per output pixel */
 static int mean = 0;		/* 1 if mean for regrouped pixels */
 static int northup = 0;		/* 1 to rotate to north up, east left */
 
-static char *RevMsg = "IMRESIZE WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMRESIZE WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/imrot.c b/imrot.c
index 6d3ecdc..cf4a5b6 100644
--- a/imrot.c
+++ b/imrot.c
@@ -38,7 +38,7 @@ static int inverted = 0;	/* If 1, invert intensity (-1 * (z-zmax)) */
 static int deletewcs = 0;	/* If 1, delete FITS WCS keywords in image */
 static int rotatewcs = 1;	/* If 1, rotate FITS WCS keywords in image */
 static int extnum = 0;		/* Use extension number instead of EXTNAME for output */
-static char *RevMsg = "IMROT WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMROT WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/imsize.c b/imsize.c
index a0315d9..046a3c8 100644
--- a/imsize.c
+++ b/imsize.c
@@ -44,7 +44,7 @@ static char coorsys[8];
 static double size = 0.0;
 static double frac = 0.0;
 
-static char *RevMsg = "IMSIZE WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMSIZE WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int dss = 0;		/* Flag to drop extra stuff for DSS */
diff --git a/imsmooth.c b/imsmooth.c
index 55dc157..62b927e 100644
--- a/imsmooth.c
+++ b/imsmooth.c
@@ -55,7 +55,7 @@ static double ghwidth = 1.0;	/* Gaussian half-width */
 static int filter = 0;		/* Filter code */
 static int nlog = 100;		/* Number of lines between log messages */
 
-static char *RevMsg = "IMSMOOTH WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMSMOOTH WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/imstack.c b/imstack.c
index f4f50a2..2b8c2e2 100644
--- a/imstack.c
+++ b/imstack.c
@@ -37,7 +37,7 @@ static int StackImage();
 static int verbose = 0;		/* verbose flag */
 static int wfits = 1;		/* if 1, write FITS header before data */
 static char *newname = NULL;
-static char *RevMsg = "IMSTACK WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMSTACK WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int nfiles = 0;
 static int nbstack = 0;
 static int extend = 0;		/* If 1, output multi-extension FITS file */
diff --git a/imstar.c b/imstar.c
index 65c95a6..14312b8 100644
--- a/imstar.c
+++ b/imstar.c
@@ -41,7 +41,7 @@
 #define MAXFILES 1000
 static int maxnfile = MAXFILES;
 
-static char *RevMsg = "IMSTAR WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "IMSTAR WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose flag */
 static int debug = 0;		/* debugging flag */
diff --git a/imwcs.c b/imwcs.c
index d3e588c..e06b37b 100644
--- a/imwcs.c
+++ b/imwcs.c
@@ -40,7 +40,7 @@ static int maxnfile = MAXFILES;
 static void PrintUsage();
 static void FitWCS();
 
-static char *RevMsg = "WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int writeheader = 0;	/* write header fields; else read-only */
diff --git a/isfits.c b/isfits.c
index aa24788..a318b35 100644
--- a/isfits.c
+++ b/isfits.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include "libwcs/fitsfile.h"
 
-static char *RevMsg = "ISFITS WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "ISFITS WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/isimlist.c b/isimlist.c
index 4c7ad41..4fdf7e2 100644
--- a/isimlist.c
+++ b/isimlist.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include "libwcs/fitshead.h"
 
-static char *RevMsg = "ISIMLIST WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "ISIMLIST WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/isnum.c b/isnum.c
index a770593..36f0e43 100644
--- a/isnum.c
+++ b/isnum.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include "libwcs/fitshead.h"
 
-static char *RevMsg = "ISNUM WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "ISNUM WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/isrange.c b/isrange.c
index 48e0a5b..d6d2878 100644
--- a/isrange.c
+++ b/isrange.c
@@ -27,7 +27,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-static char *RevMsg = "ISRANGE WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "ISRANGE WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 static int isrange();
 
diff --git a/keyhead.c b/keyhead.c
index fcf5855..eedeee5 100644
--- a/keyhead.c
+++ b/keyhead.c
@@ -50,7 +50,7 @@ static int logfile = 0;
 static int nproc = 0;
 static int first_file = 1;
 
-static char *RevMsg = "KEYHEAD WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "KEYHEAD WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/libwcs/NEWS b/libwcs/NEWS
index a2fe5a4..0bb0750 100644
--- a/libwcs/NEWS
+++ b/libwcs/NEWS
@@ -1,4 +1,8 @@
-WCSTools WCS subroutine release history
+WCSTools WCS subroutine library release history
+
+Version 3.8.6 (August 10, 2012)
+All: Update author name
+imio.c:  Fix 8-bit variables to be unsigned char
 
 Version 3.8.5 (April 12, 2012)
 imio.c: Change 8-bit pixel values from char to unsigned char
@@ -75,21 +79,21 @@ fitswcs.c: Print error message set by fitsrhead()
 November 9, 2007 - Release 3.7.1 
 wcsinit.c:  Fix bug which tested &mchar instead of mchar in if statement
 
-August 24, 2007 - Release 3.7.0 (Doug Mink, SAO)
+August 24, 2007 - Release 3.7.0
 hget.c: If a closing quote isn't found in a string value, make one up
 hput.c: Fix bug in comment insertion and deal correctly with missing quotes
 
-June 11, 2007 - Release 3.6.9 (Doug Mink, SAO)
+June 11, 2007 - Release 3.6.9
 imio.c: Add minvec() and speed up maxvec()
 
-April 3, 2007 - Release 3.6.8 (Doug Mink, SAO)
+April 3, 2007 - Release 3.6.8
 hget.c: Initial header length to zero in hlength() if lhead argument <= 0
 wcs.c:  In wcstype(), set to WCS_PIX if CTYPEi starts with "DET"
 wcs.c: In wcspset(), use correct cdelts when converting PC matrix to CD matrix
 wcsinit.c: Fix bug so RA, DEC, SECPIX can be used to set a WCS
 tnxpos.c: Fix bug so it doesn't crash
 
-January 16, 2007 - Release 3.6.7 (Doug Mink, SAO)
+January 16, 2007 - Release 3.6.7
 wcs.h: Fix and add ANSI C prototypes
 imio.h: Drop as it has been included in fitsfile.h for several releases now
 fitsfile.h, fitshead.h: Add ANSI C prototypes
@@ -102,7 +106,7 @@ imio.c: Include fitsfile.h instead of imio.h
 wcslib.h: Drop semicolon at end of c++ ifdef
 wcslib.h: Drop second declaration of SZP subroutines
 
-November 2, 2006 - Release 3.6.6 (Doug Mink, SAO)
+November 2, 2006 - Release 3.6.6
 fitsfile.c: Use calloc() when reallocating header as it is read
 wcsinit.c: Limit naxes to 2 everywhere; RA and DEC should always be 1st
 wcsinit.c: If either CUNITi is "pixel" set projection to WCS_XY
@@ -110,13 +114,13 @@ wcscon.c: In wcscsys, set system to WCS_XY if PIXEL projection
 wcscon.c: In wcscsys, set system to WCS_LINEAR if LINEAR coordinate system
 dateutil.c, fitshead.h: Add sidereal time to UT and vice versa
 
-June 30, 2006 - Release 3.6.5 (Doug Mink, SAO)
+June 30, 2006 - Release 3.6.5
 wcsinit.c: Deal with up to 9x9 PC matrix
 wcs.c:     Limit WCSLIB dimensions to two (this will change in 4.0)
 hput.c:    Fix comment placement and replacement
 hget.c:    Add strfix(), a utility to clean up strings
 
-May 3, 2006 - Release 3.6.4 (Doug Mink, SAO)
+May 3, 2006 - Release 3.6.4
 fileutil.c: Add istiff(), isjpeg(), isgif() to check TIFF, JPEG, GIF files
 fitsfile.c: Add fitsrtail() to read appended FITS headers
 fitsfile.c: Add file name to header-reading error messages
@@ -130,57 +134,57 @@ wcscon.c,dateutil.c,fitsfile.c: Drop declarations of unused variables
 wcs.c:      Fix calls to avoid type conflicts in Linux
 
 
-January 5, 2006 - Release 3.6.3 (Doug Mink, SAO)
+January 5, 2006 - Release 3.6.3
 wcs.h: Add WCS_ICRS to list of coordinate systems
 wcsinit.c: Initialize sys to WCS_ICRS if appropriate
 wcscon.c: Avoid precesssing ICRS coordinates
 wcscon.c: Fix precession which broke in 3.6.1
 
-July 21, 2005 - Release 3.6.2 (Doug Mink, SAO)
+July 21, 2005 - Release 3.6.2
 wcs.c: Fix wcsrange() to return correct range around RA=0
 Clean up accumulated unused and misdeclared variables using lint
 
-April 13, 2005 - Release 3.6.1 (Doug Mink, SAO)
+April 13, 2005 - Release 3.6.1
 Remove all sla_lib subroutines and calls thereto from wcscon.c, replacing
 them with local code.
 
-March 17, 2005 - Release 3.6.0 (Doug Mink, SAO)
+March 17, 2005 - Release 3.6.0
 In wcs.c, fix bug in wcsrotset() so angles > 360 are set to angle - 360, not 360
 Use unbuffered read() in isfits() in fitsfile.c
 
 ------------------------
 
-November 01, 2004 - Release 3.5.8 (Doug Mink, SAO)
+November 01, 2004 - Release 3.5.8
 In wcs.c, keep wcs->rot between 0 and 360 degrees (360.0 -> 0.0)
 
-September 21, 2004 - Release 3.5.7 (Doug Mink,SAO)
+September 21, 2004 - Release 3.5.7
 In pix2wcs(), if spherical coordinate output, keep 0 < long/RA < 360
 Fix bug in wcsfull() when wrapping around RA=0:00
 In hput.c, add fixnegzero() to avoid putting -0.000 in header
 
-September 3, 2004 - Release 3.5.6 (Doug Mink, SAO)
+September 3, 2004 - Release 3.5.6
 Modify FITS file reading software to get image size from file size if
 SIMPLE is F, so FITS headers with WCS can be used on arbitrary files.
 In hget.c, fix bug so comment is not pushed onto the next line if character
 value string lengthens (off by one bug).
 
-July 13, 2004 - Release 3.5.5 (Doug Mink, SAO)
+July 13, 2004 - Release 3.5.5
 Add headshrink to hput.c to optionally keep blank lines after
 keywords are deleted.
 Read D, d, E, and e as exponent delimiters in floating point values in hget.c
 
 
-May 6, 2004 - Release 3.5.4 (Doug Mink, SAO)
+May 6, 2004 - Release 3.5.4
 Add fitswexhead() to fitsfile.c to overwrite FITS extension headers
 
-April 16, 2004 - Release 3.5.3 (Doug Mink, SAO)
+April 16, 2004 - Release 3.5.3
 Use strncsrch() in hget.c to get differently-cased keywords.
 
-February 3, 2004 - Release 3.5.2 (Doug Mink, SAO)
+February 3, 2004 - Release 3.5.2
 In worldpix() in worldpos.c, allow ra/long. to exceed 180 if reference
 pixel is more than 180 degrees from image (1,1).
 
-December 12, 2003 - Release 3.5.1 (Doug Mink, SAO)
+December 12, 2003 - Release 3.5.1
 Change p[0,1,2] initializations to p[1,2,3] in wcsinit.c to match proj.c
 (This affects constants for AZP,SIN,COP,COE,COD,COO,SZP,CEA,CYP,AIR,BON)
 Add wcs->naxes back into wcs structure for backward compatibility; it
@@ -188,7 +192,7 @@ should always be equal to wcs->naxis.
 Fix bug in numdec() to return 0 if no digits after decimal point
 Fix call to setwcserr() with format in it
 
-November 17, 2003 - Release 3.5.0 (Doug Mink, SAO)
+November 17, 2003 - Release 3.5.0
 Rename mgets() to mgetstr() in iget.c, wcsinit.c and fitshead.h
 Add numdec() to hget.c to return number of decimal places in numeric string
 Change wcs->naxes to wcs->naxis to prepare for WCSLIB 3.*
@@ -200,43 +204,43 @@ Include stdlib.h instead of malloc.h in lin.c and drop malloc.h from matchstar.c
 
 ------------------------
 
-August 22, 2003 - Release 3.4.2 (Doug Mink, SAO)
+August 22, 2003 - Release 3.4.2
 Add fitsrfull() subroutine to read FITS files with more than 2 dimensions
 Modify fitswimage() to write FITS files with more than 2 dimensions
 
-July 11, 2003 - Release 3.4.1 (Doug Mink, SAO)
+July 11, 2003 - Release 3.4.1
 Use strncmp to check for both stdin and stdout in fitsfile.c
 
-May 30, 2003 - Release 3.4.0 (Doug Mink, SAO)
+May 30, 2003 - Release 3.4.0
 Add partial support for ZPX projection
 Fix bug reading COE and other projections when PROJPn coefficients
 were accidently reinitialized
 
 ------------------------
 
-May 8, 2003 - Release 3.3.4 (Doug Mink, SAO)
+May 8, 2003 - Release 3.3.4
 Add two missing semicolons in C++ declarations in wcs.h
 Read prj.p[0] from PROJP0 for ZPN projections, instead of ignoring it
 
-April 3, 2003 - Release 3.3.2 (Doug Mink, SAO)
+April 3, 2003 - Release 3.3.2
 Add distortion conversion for SIRTF images
 
-March 27, 2003 - Release 3.3.1 (Doug Mink, SAO)
+March 27, 2003 - Release 3.3.1
 Add conversions to and from Heliocentric Julian Dates to dateutil.c
 Open FITS and IMH files "rb" instead of "r" for Linux compatibility
 Add isimlistd() to fileutil.c to check for list of images in a specified directory
 Fix default center pixel computation in GetFITSWCS(); it was off by half a pixel
 
-January 30, 2003 - Release 3.3.0 (Doug Mink, SAO)
+January 30, 2003 - Release 3.3.0
 Fix bug in dateutil.c ts2gst() sidereal time conversion.
 
 ------------------------
 
-January 3, 2003 - Release 3.2.1 (Doug Mink, SAO)
+January 3, 2003 - Release 3.2.1
 Fix bug in wcsinit() which failed to read PVi_0, and now initialize
 PVi_j in only once place.
 
-December 6, 2002 - Release 3.2.0 (Doug Mink, SAO)
+December 6, 2002 - Release 3.2.0
 Add ET/TDT/TT and sidereal time conversion to dateutil.c
 Fix subroutine calls for radvel and latpole and correctly compute pixel
 at center of image for default CRPIX in wcsinit.c
@@ -244,24 +248,24 @@ Add fitsrsect() to fitsfile.c to read a section of an image
 
 ------------------------
 
-August 30, 2002 - Release 3.1.3 (Doug Mink, SAO)
+August 30, 2002 - Release 3.1.3
 Fix bug in imio.c getvec() dealing with scaled images
 Add case-insensitive string search subroutines strcsrch() and strncsrch()
 Accept stdin as file in isfile()
 Add Ephemeris time conversions to dateutil()
 
-July 8, 2002 - Release 3.1.2 (Doug Mink, SAO)
+July 8, 2002 - Release 3.1.2
 Fix bug in date utilities which always rounded to integer seconds of UT
 Fix bugs in date utilities to handle BC (negative) dates to JD 0.
 
-June 26, 2002 - Release 3.1.1 (Doug Mink, SAO)
+June 26, 2002 - Release 3.1.1
 Fix bugs which caused TNX projection to fail
 Fix two bugs in wcsinit() which caused setting RADECSYS when
  an EQUINOX keyword is present.
 Write FITS error messages to string accessible by fitserr()
 Put SAO-written software under Gnu Lesser Public License
 
-April 12, 2002 - Release 3.1.0 (Doug Mink, SAO)
+April 12, 2002 - Release 3.1.0
 Implement WCSLIB 2.9
 Support PV entry of constants and PCi_j rotation matrices in wcsinit.c
 Support inversion (WCS->pix) of multiple dependent WCSs
@@ -271,17 +275,17 @@ coefficient parsing.
 
 ------------------------
 
-February 13, 2002 - Release 3.0.7 (Doug Mink, SAO)
+February 13, 2002 - Release 3.0.7
 Fix bug in ecliptic coordinate conversion in wcscon.c
 Allow "stdin" to include extension and/or WCS selection in fitsfile.c
 Add a global switch to turn off scaling in imio.c
 Add ifdef to lin.c so it will compile under Mac OS/X
 
-December 4, 2001 - Release 3.0.6 (Doug Mink, SAO)
+December 4, 2001 - Release 3.0.6
 In movepix(), add char to char move
 Always include stdlib.h in lin.c
 
-September 25, 2001 - Release 3.0.5 (Doug Mink, SAO)
+September 25, 2001 - Release 3.0.5
 Implement WCSLIB version 2.7
 Fix Makefile to include header files appropriately
 Accept FITS dates as yyyy/mm/dd
@@ -289,31 +293,31 @@ Fix bug in str2dec() which misinterpreting strings with leading spaces
 Fix bug in isnum() which caused bad answer if trailing spaces
 Add fileutil.c, which includes various file info utilities
 
-September 7, 2001 - Release 3.0.3 (Doug Mink, SAO)
+September 7, 2001 - Release 3.0.3
 Disallow files with = in their name in isfits() and isiraf()
 Set coordinate system from CTYPE if not equatorial
 
-July 12, 2001 - Release 3.0 (Doug Mink, SAO)
+July 12, 2001 - Release 3.0
 Read PROJPn projection constants in wcsinit()
 
 ------------------------
 
-March 30, 2001 - Release 2.9.4 (Doug Mink, SAO)
+March 30, 2001 - Release 2.9.4
 Fix possible header length problem in hget.c
 
-March 22, 2001 - Release 2.9.3 (Doug Mink, SAO)
+March 22, 2001 - Release 2.9.3
 Fix minor bugs in wcs.h, wcs.c, and wcsinit.c, wcslib.c, fitsfile.c, and
 cel.c found by gcc on Linux and possible memory leak in wcs.c
 
-March 9, 2001 - Release 2.9.2 (Doug Mink, SAO)
+March 9, 2001 - Release 2.9.2
 In fitsfile.c, change multiple WCS separator in FITS file names from : to %
 and fix bug which failed to read multi-extension files if END was not preceded
 by a blank line in the extension's header.
 
-February 28, 2001 - Release 2.9.1 (Doug Mink, SAO)
+February 28, 2001 - Release 2.9.1
 Fix major bug in wcsinit() which always set CRPIX2 the same as CRPIX1
 
-February 23, 2001 - Release 2.9.0 (Doug Mink, SAO)
+February 23, 2001 - Release 2.9.0
 FITS reading subroutines are fixed to ignore WCS name or character specified
 as :name or :character at end of filename.
 wcsinit() has new APIs which specify either a WCSNAME, wcsinitn(), or
@@ -326,7 +330,7 @@ The WCSLIB subroutines were brought up to release 2.6 with very minor changes
 
 ------------------------
 
-December 29, 2000 - Release 2.8.6 (Doug Mink, SAO)
+December 29, 2000 - Release 2.8.6
 Fix handling of embedded + or - in isnum() in hget.c
 Default to 2000 for EQUINOX and EPOCH and FK5 for RADECSYS, if keywords not present.
 In wcscon.c, fk425() and fk524() algorithms were updated to include parallax and rv,
@@ -335,37 +339,37 @@ proper motion units in fk524p() and fk425p() were fixed.
 In wcsinit.c, a bug initializing CD matrix was fixed.
 In cel.c, include string.h for strcmp().
 
-September 29, 2000 - Release 2.8.5 (Doug Mink, SAO)
+September 29, 2000 - Release 2.8.5
 wcsinit will now use a CD matrix if ANY CD keywords are present in header
 In getvec() in imio.c, move scaling outside of loop and make it conditional.
 Read .pix files in same directory as .imh file, if not otherwise found.
 
-August 1, 2000 - Release 2.8.3 (Doug Mink, SAO)
+August 1, 2000 - Release 2.8.3
 Improve handling of 1-D WCS data.  Fix numerous warning-generating bugs.
 Fix bug in ep2jd()/jd2ep() so both start year at 1/1 0:00
 
-June 13, 2000 - Release 2.8.2 (Doug Mink, SAO)
+June 13, 2000 - Release 2.8.2
 If imh pixel file has no directory, *always* use same as header file
 
-June 9, 2000 - Release 2.8.1 (Doug Mink, SAO)
+June 9, 2000 - Release 2.8.1
 Read keyword values in hget.c even if no equal sign is present.
 
-June 2, 2000 - Release 2.8.0 (Doug Mink, SAO)
+June 2, 2000 - Release 2.8.0
 Only a few minor changes due to running lint on everything
 
 ------------------------
 
-May 10, 2000 - Release 2.7.4 (Doug Mink, SAO)
+May 10, 2000 - Release 2.7.4
 In wcstype(), default to WCS_LIN, not error (after Bill Joye)
 
-May 1, 2000 - Release 2.7.3 (Doug Mink, SAO)
+May 1, 2000 - Release 2.7.3
 Bug in hadd() fixed so new line is not overwritten.
 Pixel files whcih are in subdirectories of files where IRAF .imh header
 files reside are now dealt with correctly.
 All dates in the old FITS format (dd/mm/yy) where the year ranges from
  0 to 999 have 1900 added to them:  01/05/100 becomes 2000-05-01.
 
-March 27, 2000 - Release 2.7.2 (Doug Mink, SAO)
+March 27, 2000 - Release 2.7.2
 In hputs(), do not add quotes if writing COMMENT or HISTORY
 In fits2iraf(), in imhfile.c, minimize length of path in pixel file name
 Fix code to deal with .imh file paths longer than 67 characters.
@@ -380,7 +384,7 @@ Fix precession code to deal correctly with equinoxes other than J2000 and
   B1950.
 Move all date operations to dateutil.c, including current time used in imhfile.c
 
-February 23, 2000 - Release 2.7.0 (Doug Mink, SAO)
+February 23, 2000 - Release 2.7.0
 Upgrade WCSLIB subroutines to WCSLIB 2.5 from 2.4
 Add MJD and Besselian and Julian epoch conversion to dateutil.c
 Use WCSLIB CAR, COE, NCP projections if oldsys is 1, else use worldpos()
@@ -390,23 +394,23 @@ Fix minor bug in fitsfile.c fitscimage error returns.
 
 ------------------------
 
-January 11, 2000 - Release 2.6.12 (Doug Mink, SAO)
+January 11, 2000 - Release 2.6.12
 Fix bug in dateutil() to get fractional year to date conversion right
 
-December 20, 1999 - Release 2.6.11 (Doug Mink, SAO)
+December 20, 1999 - Release 2.6.11
 Fix bug in hgetdate() to get ISO minutes and seconds right
 Upgrade dateutil() to do many date conversions
 
-December 10, 1999 - Release 2.6.10 (Doug Mink, SAO)
+December 10, 1999 - Release 2.6.10
 Fix bug which caused strings starting with d and e followed by numbers
 to be declared numeric even though they're not really numbers
 Fix bug in dateutil.c ts2jd() which does not affect SAOimage
 Fix bugs dealing with NOAO TNX projection
 
-November 17, 1999 - Release 2.6.9 (Doug Mink, SAO)
+November 17, 1999 - Release 2.6.9
 Fix bug which caused loss of NCP projection
 
-November 5, 1999 - Release 2.6.8 (Doug Mink, SAO)
+November 5, 1999 - Release 2.6.8
 Change release number to match WCSTools
 Clean up code in all subroutines using lint
 Add DATE-MOD to FITS header in iraf2fits()
@@ -415,22 +419,22 @@ Return error code from hput*() subroutines if header buffer length exceeded.
 
 ------------------------
 
-May 5, 1999 - Release 1.26 (Doug Mink, SAO
+May 5, 1999 - Release 1.26
 hget.c, iget.c Use POSIX-compliant limits.h instead of values.h
 
-April 7, 1999 - Release 1.26 (Doug Mink, SAO)
+April 7, 1999 - Release 1.26
 wcs.c	    Fix bug in dealing with EPOCHless non-equatorial coordinates
 wcsinit.c   Add optional filename to printed error messages
 
-April 5, 1999 - Release 1.26 (Doug Mink, SAO)
+April 5, 1999 - Release 1.26
 hget.c      Check all string lengths before copying; ignore ^M at 80th character
 
-February 22, 1999 - Release 1.26 (Doug Mink, SAO)
+February 22, 1999 - Release 1.26
 wcs.c       Fix bug dealing with SPA and NPA coordinates
             Use faaces 0-5, not 1-6 for quad cube projections
 wcsinit.c   Fix computed rotation angle for DSS projection
 
-February 9, 1999 - Release 1.26 (Doug Mink, SAO)
+February 9, 1999 - Release 1.26
 fitsfile.c: Allow BITPIX=0 dataless images
 wcsinit.c:  Fix bug initializing DSS image rotation
 wcs.c:      Free lin.imgpix and lin.piximg in wcsfree()
@@ -438,13 +442,13 @@ hput.c:     Fix bug to avoid writing HISTORY or COMMENT lines past 80 chars
 
 ------------------------
 
-December 8, 1998 - Release 1.25 (Doug Mink, SAO)
+December 8, 1998 - Release 1.25
 fitsfile.c: Fix bug in fitsrhead() reading FITS table files caused by fix below
 
-November 30, 1998 - Release 1.25 (Doug Mink, SAO)
+November 30, 1998 - Release 1.25
 fitsfile.c: Fix bug dealing with very large headers in fitsrhead()
 
-November 12, 1998 - Release 1.25 (Doug Mink, SAO)
+November 12, 1998 - Release 1.25
 dsspos.c:   Fix possible divide by zero problems
 fitsfile.c: Add isfits() which checks filename or first line of header
 imhfile.c:  Add isiraf() which checks filename for .imh
diff --git a/libwcs/actread.c b/libwcs/actread.c
index c3f60b8..12202fc 100644
--- a/libwcs/actread.c
+++ b/libwcs/actread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/actread.c
  *** January 10, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Copyright (C) 1999-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
 
@@ -19,8 +19,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/addup b/libwcs/addup
similarity index 100%
copy from addup
copy to libwcs/addup
diff --git a/addup.sed b/libwcs/addup.sed
similarity index 100%
copy from addup.sed
copy to libwcs/addup.sed
diff --git a/libwcs/binread.c b/libwcs/binread.c
index e934c5a..a5b1e91 100644
--- a/libwcs/binread.c
+++ b/libwcs/binread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/binread.c
  *** September 16, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1998-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
@@ -462,7 +462,7 @@ int	nlog;
 	}
 
     free ((void *)star);
-    free ((void *)tdist);
+    /* free ((void *)tdist); */
     return (nstar);
 }
 
diff --git a/libwcs/caphot.c b/libwcs/caphot.c
index fc9b6df..aeb8e09 100644
--- a/libwcs/caphot.c
+++ b/libwcs/caphot.c
@@ -1,6 +1,6 @@
 /*** File caphot.c
  *** January 30, 2002
- *** By Doug Mink from Fortran code by Sam Conner (MIT, 1984)
+ *** By Jessica Mink from Fortran code by Sam Conner (MIT, 1984)
  *** Copyright (C) 2002
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
 
@@ -19,8 +19,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/catutil.c b/libwcs/catutil.c
index bb8730c..4bdc91d 100644
--- a/libwcs/catutil.c
+++ b/libwcs/catutil.c
@@ -1,8 +1,8 @@
 /*** File libwcs/catutil.c
- *** September 14, 2010
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** July 23, 2012
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
- *** Copyright (C) 1998-2010
+ *** Copyright (C) 1998-2012
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
 
     This library is free software; you can redistribute it and/or
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
@@ -2253,6 +2253,8 @@ int	ndef;		/* Maximum allowable range value */
     range->irange = -1;
     range->nvalues = 0;
     range->nranges = 0;
+    range->valmax = -1000000000000.0;
+    range->valmin = 1000000000000.0;
 
     for (irange = 0; irange < MAXRANGE; irange++) {
 
@@ -2347,6 +2349,18 @@ int	ndef;		/* Maximum allowable range value */
 	range->ranges[irange*3 + 2] = step;
 	range->nvalues = range->nvalues + ((last-first+(0.1*step)) / step + 1);
 	range->nranges++;
+	if (step > 0.0) {
+	    if (first < range->valmin)
+		range->valmin = first;
+	    if (last > range->valmax)
+		range->valmax = last;
+	    }
+	else {
+	    if (first > range->valmax)
+		range->valmax = first;
+	    if (last < range->valmin)
+		range->valmin = last;
+	    }
 	}
 
     return (range);
@@ -3291,7 +3305,7 @@ double	*a;	/* Vector containing coeffiecients */
     xterm = 1.0;
     for (iterm = 0; iterm < norder; iterm++) {
 	y = y + a[iterm] * xterm;
-	xterm = xterm + x;
+	xterm = xterm * x;
 	}
     return (y);
 }
@@ -3463,4 +3477,8 @@ char *from, *last, *to;
  * Apr 06 2010	Add fillblank argument to agets()
  * Apr 06 2010	In agets() search until keyword[: or =] or end of string
  * Sep 14 2010	Add BSC radius of 7200 to CatRad() and number field of 4
+ *
+ * May 16 2012	Save maximum value in range data structure
+ * Jul 26 2012	Fix xterm computation in polcomp() from + to *
+ *		(found by Raymond Carlberg of U.Toronto)
  */
diff --git a/libwcs/ctgread.c b/libwcs/ctgread.c
index fcb13cc..b42057f 100644
--- a/libwcs/ctgread.c
+++ b/libwcs/ctgread.c
@@ -1,8 +1,8 @@
 /*** File libwcs/ctgread.c
- *** September 30, 2009
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** May 22, 2012
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
- *** Copyright (C) 1998-2009
+ *** Copyright (C) 1998-2012
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
 
     This library is free software; you can redistribute it and/or
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
@@ -1396,6 +1396,16 @@ int	refcat;		/* Catalog code from wcscat.h (TXTCAT,BINCAT,TABCAT) */
 	sc->nmag = 3;
     else if (strsrch (header, "/4"))
 	sc->nmag = 4;
+    else if (strsrch (header, "/5"))
+	sc->nmag = 5;
+    else if (strsrch (header, "/6"))
+	sc->nmag = 6;
+    else if (strsrch (header, "/7"))
+	sc->nmag = 7;
+    else if (strsrch (header, "/8"))
+	sc->nmag = 8;
+    else if (strsrch (header, "/9"))
+	sc->nmag = 9;
 
     /* No number in first column, RA or object name first */
     if (strsrch (header, "/n") || strsrch (header, "/N"))
@@ -2117,4 +2127,6 @@ char	*in;	/* Character string */
  *
  * Aug 27 2009	Add /k option for fractional hours of RA and degrees of Dec
  * Sep 30 2009	Add UCAC3
+ *
+ * May 22 2012	Accept up to 9 magnitudes per entry instead of 4
  */
diff --git a/libwcs/daoread.c b/libwcs/daoread.c
index 703b0ef..67a8550 100644
--- a/libwcs/daoread.c
+++ b/libwcs/daoread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/daoread.c
  *** January 11, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/dateutil.c b/libwcs/dateutil.c
index afee4f0..eb2c678 100644
--- a/libwcs/dateutil.c
+++ b/libwcs/dateutil.c
@@ -1,6 +1,6 @@
 /*** File libwcs/dateutil.c
  *** September 24, 2009
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1999-2009
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
@@ -3868,7 +3868,7 @@ double	dj;	/* Julian Date */
 
 /*  COMPNUT - Compute nutation using the IAU 2000b model */
 /*  Translated from Pat Wallace's Fortran subroutine iau_nut00b (June 26 2007)
-    into C by Doug Mink on September 5, 2008 */
+    into C by Jessica Mink on September 5, 2008 */
 
 #define NLS	77 /* number of terms in the luni-solar nutation model */
 
diff --git a/libwcs/dateutil0.c b/libwcs/dateutil0.c
index 5fa60d4..c828e98 100644
--- a/libwcs/dateutil0.c
+++ b/libwcs/dateutil0.c
@@ -1,6 +1,6 @@
 /*** File libwcs/dateutil.c
  *** September 9, 2008
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1999-2008
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
@@ -3769,7 +3769,7 @@ double	dj;	/* Julian Date */
 
 /*  COMPNUT - Compute nutation using the IAU 2000b model */
 /*  Translated from Pat Wallace's Fortran subroutine iau_nut00b (June 26 2007)
-    into C by Doug Mink on September 5, 2008 */
+    into C by Jessica Mink on September 5, 2008 */
 
 #define NLS	77 /* number of terms in the luni-solar nutation model */
 
diff --git a/libwcs/distort.c b/libwcs/distort.c
index f52c2fc..d903dfe 100644
--- a/libwcs/distort.c
+++ b/libwcs/distort.c
@@ -1,6 +1,6 @@
 /*** File libwcs/distort.c
  *** January 4, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu, 
+ *** By Jessica Mink, jmink at cfa.harvard.edu, 
  *** Based on code written by Jing Li, IPAC
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2004-2007
@@ -21,8 +21,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/dsspos.c b/libwcs/dsspos.c
index a6d8942..3bbd5a0 100644
--- a/libwcs/dsspos.c
+++ b/libwcs/dsspos.c
@@ -1,6 +1,6 @@
 /*** File saoimage/wcslib/dsspos.c
  *** October 21, 1999
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1995-2002
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/fileutil.c b/libwcs/fileutil.c
index ca0bf9a..a4189a1 100644
--- a/libwcs/fileutil.c
+++ b/libwcs/fileutil.c
@@ -1,6 +1,6 @@
 /*** File libwcs/fileutil.c
  *** January 11, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1999-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/findstar.c b/libwcs/findstar.c
index 09a7142..b5486a6 100644
--- a/libwcs/findstar.c
+++ b/libwcs/findstar.c
@@ -1,6 +1,6 @@
 /*** File libwcs/findstar.c
  *** October 19, 2007
- *** By Doug Mink, after Elwood Downey
+ *** By Jessica Mink, after Elwood Downey
  *** Copyright (C) 1996-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
 
@@ -19,8 +19,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/fitsfile.c b/libwcs/fitsfile.c
index 944c390..0ff9479 100644
--- a/libwcs/fitsfile.c
+++ b/libwcs/fitsfile.c
@@ -1,6 +1,6 @@
 /*** File libwcs/fitsfile.c
  *** September 15, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
@@ -2297,7 +2297,7 @@ char *from, *last, *to;
  * Sep 18 2009	In fitswexhead() write to error string instead of stderr
  * Sep 22 2009	In fitsrthead(), fix lengths for ASCII numeric table entries
  * Sep 25 2009	Add subroutine moveb() and fix calls to it
- * Sep 25 2009	Fix several small errors found by Douglas Burke
+ * Sep 25 2009	Fix several small errors found by Jessicalas Burke
  *
  * Mar 29 2010	In fitswhead(), always pad blocks to 2880 bytes with spaces
  * Mar 31 2010	In fitsrhead(), fix bug reading long primary headers
diff --git a/libwcs/fitsfile.h b/libwcs/fitsfile.h
index 73c107a..c000d18 100644
--- a/libwcs/fitsfile.h
+++ b/libwcs/fitsfile.h
@@ -1,6 +1,6 @@
 /*** File fitsfile.h  FITS and IRAF file access subroutines
  *** September 25, 2009
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2009
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/fitsfile1.h b/libwcs/fitsfile1.h
index c23605e..85eeb73 100644
--- a/libwcs/fitsfile1.h
+++ b/libwcs/fitsfile1.h
@@ -1,6 +1,6 @@
 /*** File fitsfile.h  FITS and IRAF file access subroutines
  *** January 5, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/fitshead.h b/libwcs/fitshead.h
index 843b0da..1212709 100644
--- a/libwcs/fitshead.h
+++ b/libwcs/fitshead.h
@@ -1,6 +1,6 @@
 /*** File fitshead.h  FITS header access subroutines
  *** January 9, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/fitswcs.c b/libwcs/fitswcs.c
index b1f3a2e..b837926 100644
--- a/libwcs/fitswcs.c
+++ b/libwcs/fitswcs.c
@@ -1,6 +1,6 @@
 /*** File libwcs/fitswcs.c
  *** March 14, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/fortcat.c b/libwcs/fortcat.c
index 436d72f..bc21c93 100644
--- a/libwcs/fortcat.c
+++ b/libwcs/fortcat.c
@@ -1,6 +1,6 @@
 /*** File libwcs/fortcat.c
  *** April 3, 2003
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2001-2003
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/fortwcs.c b/libwcs/fortwcs.c
index cac73d9..967fca9 100644
--- a/libwcs/fortwcs.c
+++ b/libwcs/fortwcs.c
@@ -1,6 +1,6 @@
 /*** File wcstools/libwcs/fortwcs.c
  *** April 7, 2003
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2003
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/gsc2read.c b/libwcs/gsc2read.c
index 708b916..e4b6a2d 100644
--- a/libwcs/gsc2read.c
+++ b/libwcs/gsc2read.c
@@ -1,6 +1,6 @@
 /*** File libwcs/gsc2read.c
  *** August 17, 2009
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2001-2009
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/gscread.c b/libwcs/gscread.c
index aad2605..b74ef8f 100644
--- a/libwcs/gscread.c
+++ b/libwcs/gscread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/gscread.c
  *** September 22, 2009
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2009
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/hget.c b/libwcs/hget.c
index 8549d1e..653e8eb 100644
--- a/libwcs/hget.c
+++ b/libwcs/hget.c
@@ -1,6 +1,6 @@
 /*** File libwcs/hget.c
  *** May 19, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1994-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/hput.c b/libwcs/hput.c
index 0926a4a..7ec81ab 100644
--- a/libwcs/hput.c
+++ b/libwcs/hput.c
@@ -1,6 +1,6 @@
 /*** File libwcs/hput.c
  *** September 9, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1995-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/hput1.c b/libwcs/hput1.c
index 93a3db3..ea4c6a6 100644
--- a/libwcs/hput1.c
+++ b/libwcs/hput1.c
@@ -1,6 +1,6 @@
 /*** File libwcs/hput.c
  *** August 20, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1995-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/iget.c b/libwcs/iget.c
index 5de21e6..58e54f7 100644
--- a/libwcs/iget.c
+++ b/libwcs/iget.c
@@ -1,6 +1,6 @@
 /*** File libwcs/iget.c
  *** January 4, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1998-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/imgetwcs.c b/libwcs/imgetwcs.c
index 1f99737..9a2da70 100644
--- a/libwcs/imgetwcs.c
+++ b/libwcs/imgetwcs.c
@@ -1,6 +1,6 @@
 /*** File libwcs/imgetwcs.c
  *** September 1, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu (remotely based on UIowa code)
+ *** By Jessica Mink, jmink at cfa.harvard.edu (remotely based on UIowa code)
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-	   Internet email: dmink at cfa.harvard.edu
-	   Postal address: Doug Mink
+	   Internet email: jmink at cfa.harvard.edu
+	   Postal address: Jessica Mink
 	                   Smithsonian Astrophysical Observatory
 	                   60 Garden St.
 	                   Cambridge, MA 02138 USA
diff --git a/libwcs/imio.c b/libwcs/imio.c
index b66334e..3fdb5a8 100644
--- a/libwcs/imio.c
+++ b/libwcs/imio.c
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/imio.h b/libwcs/imio.h
index 39d8920..a12d8e8 100644
--- a/libwcs/imio.h
+++ b/libwcs/imio.h
@@ -1,6 +1,6 @@
 /*** imio.h  memory access subroutines
  *** September 27, 1999
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2002
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/imrotate.c b/libwcs/imrotate.c
index d2c8842..0788da9 100644
--- a/libwcs/imrotate.c
+++ b/libwcs/imrotate.c
@@ -1,6 +1,6 @@
 /*** File libwcs/imrotate.c
  *** June 26, 2008
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2008
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/imrotate1.c b/libwcs/imrotate1.c
index 4a000f5..b8559fa 100644
--- a/libwcs/imrotate1.c
+++ b/libwcs/imrotate1.c
@@ -1,6 +1,6 @@
 /*** File libwcs/imrotate.c
  *** June 30, 2008
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2008
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/imsetwcs.c b/libwcs/imsetwcs.c
index 2823a22..1a19cff 100644
--- a/libwcs/imsetwcs.c
+++ b/libwcs/imsetwcs.c
@@ -1,6 +1,6 @@
 /*** File libwcs/imsetwcs.c
  *** May 19, 2010
- *** By Doug Mink, dmink at cfa.harvard.edu (based on UIowa code)
+ *** By Jessica Mink, jmink at cfa.harvard.edu (based on UIowa code)
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2010
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/imutil.c b/libwcs/imutil.c
index 4e1291d..5f3aa80 100644
--- a/libwcs/imutil.c
+++ b/libwcs/imutil.c
@@ -1,8 +1,8 @@
 /*** File libwcs/imutil.c
- *** January 11, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** May 16, 2012
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
- *** Copyright (C) 2006-2007
+ *** Copyright (C) 2006-2012
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
  */
 
@@ -21,6 +21,8 @@
  *	Median filter an image
  * char *medfill (buff, header, ndx, ndy, nlog)
  *	Set blank pixels to the median of a box around each one
+ * medpix (x, ival, ix, iy, nx, ny, ndx, ndy, bitpix)
+ * medpixi1 (x, ival, ix, iy, nx, ny, ndx, ndy)
  * medpixi2 (x, ival, ix, iy, nx, ny, ndx, ndy)
  * medpixi4 (x, ival, ix, iy, nx, ny, ndx, ndy)
  * medpixr4 (x, ival, ix, iy, nx, ny, ndx, ndy)
@@ -31,6 +33,8 @@
  *	Mean filter an image
  * char *meanfill (buff, header, ndx, ndy, nlog)
  *	Set blank pixels to the mean of a box around each one
+ * meanpix (x, ival, ix, iy, nx, ny, ndx, ndy, bitpix)
+ * meanpixi1 (x, ival, ix, iy, nx, ny, ndx, ndy)
  * meanpixi2 (x, ival, ix, iy, nx, ny, ndx, ndy)
  * meanpixi4 (x, ival, ix, iy, nx, ny, ndx, ndy)
  * meanpixr4 (x, ival, ix, iy, nx, ny, ndx, ndy)
@@ -76,6 +80,8 @@ char *meanfill();
 char *gaussfill();
 void gausswt();
 
+unsigned char medpixi1();
+unsigned char meanpixi1();
 short medpixi2();
 short meanpixi2();
 short gausspixi2();
@@ -91,6 +97,7 @@ double gausspixr8();
 
 static int bpvalset = 0;
 static double bpval = -9999.0;
+static unsigned char bpvali1;
 static short bpvali2;
 static int bpvali4;
 static float bpvalr4;
@@ -572,6 +579,7 @@ char	*buff;
 
 /* Median filter an image */
 
+static unsigned char *vi1;	/* Working vector to sort for median */
 static short *vi2;	/* Working vector to sort for median */
 static int *vi4;	/* Working vector to sort for median */
 static float *vr4;	/* Working vector to sort for median */
@@ -813,6 +821,138 @@ int	naxes;
 
 /* Compute median of rectangular group of pixels */
 
+double
+medpix (buff, ix, iy, nx, ny, ndx, ndy, bitpix)
+
+char	*buff;	/* Image buffer */
+int	ix,iy;	/* Pixel around which to compute median */
+int	nx,ny;	/* Number of columns and rows in image */
+int	ndx;	/* Number of columns over which to compute the median */
+int	ndy;	/* Number of rows over which to compute the median */
+int	bitpix;	/* Number of bits in pixels; negative are floating point */
+
+{
+    if (bitpix == 16) {
+	unsigned char cval, *cbuff;
+	cval = (char) 0;
+	cbuff = (unsigned char *) buff;
+	return ((double) medpixi1 (cbuff, cval, ix, iy, nx, ny, ndx, ndy));
+	}
+    else if (bitpix == 16) {
+	short jval, *jbuff;
+	jval = 0;
+	jbuff = (short *) buff;
+	return ((double) medpixi2 (jbuff, jval, ix, iy, nx, ny, ndx, ndy));
+	}
+    else if (bitpix == 32) {
+	int ival, *ibuff;
+	ival = 0;
+	ibuff = (int *) buff;
+	return ((double) medpixi4 (ibuff, ival, ix, iy, nx, ny, ndx, ndy));
+	}
+    else if (bitpix == -32) {
+	float rval, *rbuff;
+	rval = 0.0;
+	rbuff = (float *) buff;
+	return ((double) medpixr4 (rbuff, rval, ix, iy, nx, ny, ndx, ndy));
+	}
+    else if (bitpix == -64) {
+	double dval, *dbuff;
+	dval = 0.0;
+	dbuff = (double *) buff;
+	return (medpixr8 (dbuff, dval, ix, iy, nx, ny, ndx, ndy));
+	}
+    else
+	return (0.0);
+}    
+
+
+unsigned char
+medpixi1 (x, ival, ix, iy, nx, ny, ndx, ndy)
+
+unsigned char	*x;	/* Image buffer */
+unsigned char	ival;	/* Value at this pixel */
+int	ix,iy;	/* Pixel around which to compute median */
+int	nx,ny;	/* Number of columns and rows in image */
+int	ndx;	/* Number of columns over which to compute the median */
+int	ndy;	/* Number of rows over which to compute the median */
+
+{
+    unsigned char xx, *vecj, *img;
+    int n, i, j;
+    int  nx2, ny2, npix;
+    int jx, jx1, jx2, jy, jy1, jy2;
+
+    /* Allocate working buffer if it hasn't already been allocated */
+    npix = ndx * ndy;
+    if (vi1 == NULL) {
+	vi1 = (unsigned char *) calloc (npix, sizeof (unsigned char));
+	if (vi1 == NULL) {
+	    fprintf (stderr, "MEDPIXI1: Could not allocate %d-pixel buffer\n",npix);
+	    return (0);
+	    }
+	}
+
+    n = ndx * ndy;
+    if (n <= 0)
+	return (0.0);
+    else if (n == 1)
+	return (*(x + (iy * ny) + ix));
+
+    /* Compute limits for this pixel */
+    nx2 = ndx / 2;
+    jx1 = ix - nx2;
+    if (jx1 < 0)
+	jx1 = 0;
+    jx2 = ix + nx2 + 1;
+    if (jx2 > nx)
+	jx2 = nx;
+    ny2 = ndy / 2;
+    jy1 = iy - ny2;
+    if (jy1 < 0)
+	jy1 = 0;
+    jy2 = iy + ny2 + 1;
+    if (jy2 > ny)
+	jy2 = ny;
+
+    /* Initialize actual number of pixels used for this pixel */
+    n = 0;
+
+    /* Set up working vector for this pixel */
+    vecj = vi1;
+    for (jy = jy1; jy < jy2; jy++) {
+	img = x + (jy * nx) + jx1;
+	for (jx = jx1; jx < jx2; jx++) {
+	    if (*img != bpvali1) {
+		*vecj++ = *img;
+		n++;
+		}
+	    img++;
+	    }
+	}
+
+    /* If no good pixels, return old value */
+    if (n < 1)
+	return (ival);
+
+    /* Sort numbers in working vector */
+    else {
+	for (j = 2; j <= n; j++) {
+	    xx = vi1[j];
+	    i = j - 1;
+	    while (i > 0 && vi1[i] > xx) {
+		vi1[i+1] = vi1[i];
+		i--;
+		}
+	    vi1[i+1] = xx;
+	    }
+
+	/* Middle number is the median */
+	return (vi1[n/2]);
+	}
+}
+
+
 short
 medpixi2 (x, ival, ix, iy, nx, ny, ndx, ndy)
 
@@ -1393,6 +1533,117 @@ int	naxes;
 
 /* Compute mean of rectangular group of pixels */
 
+double
+meanpix (buff, ix, iy, nx, ny, ndx, ndy, bitpix)
+
+char	*buff;	/* Image buffer */
+int	ix,iy;	/* Pixel around which to compute median */
+int	nx,ny;	/* Number of columns and rows in image */
+int	ndx;	/* Number of columns over which to compute the median */
+int	ndy;	/* Number of rows over which to compute the median */
+int	bitpix;	/* Number of bits in pixels; negative are floating point */
+
+{
+    if (bitpix == 8) {
+	unsigned char cval, *cbuff;
+	cval = 0;
+	cbuff = (unsigned char *) buff;
+	return ((double) meanpixi1 (cbuff, cval, ix, iy, nx, ny, ndx, ndy));
+	}
+    else if (bitpix == 16) {
+	short jval, *jbuff;
+	jval = 0;
+	jbuff = (short *) buff;
+	return ((double) meanpixi2 (jbuff, jval, ix, iy, nx, ny, ndx, ndy));
+	}
+    else if (bitpix == 32) {
+	int ival, *ibuff;
+	ival = 0;
+	ibuff = (int *) buff;
+	return ((double) meanpixi4 (ibuff, ival, ix, iy, nx, ny, ndx, ndy));
+	}
+    else if (bitpix == -32) {
+	float rval, *rbuff;
+	rval = 0.0;
+	rbuff = (float *) buff;
+	return ((double) meanpixr4 (rbuff, rval, ix, iy, nx, ny, ndx, ndy));
+	}
+    else if (bitpix == -64) {
+	double dval, *dbuff;
+	dval = 0.0;
+	dbuff = (double *) buff;
+	return (meanpixr8 (dbuff, dval, ix, iy, nx, ny, ndx, ndy));
+	}
+    else
+	return (0.0);
+}    
+
+unsigned char
+meanpixi1 (x, ival, ix, iy, nx, ny, ndx, ndy)
+
+unsigned char	*x;	/* Image buffer */
+unsigned char	ival;	/* Image pixel value */
+int	ix,iy;	/* Pixel around which to compute median */
+int	nx,ny;	/* Number of columns and rows in image */
+int	ndx;	/* Number of columns over which to compute the median */
+int	ndy;	/* Number of rows over which to compute the median */
+
+{
+    double sum, newval;
+    unsigned char *img;
+    int n, nx2, ny2;
+    int jx, jx1, jx2, jy, jy1, jy2;
+
+    n = ndx * ndy;
+    if (n <= 0)
+	return (0.0);
+    else if (n == 1)
+	return (*(x + (iy * ny) + ix));
+
+    /* Compute limits for this pixel */
+    nx2 = ndx / 2;
+    jx1 = ix - nx2;
+    if (jx1 < 0)
+	jx1 = 0;
+    jx2 = ix + nx2 + 1;
+    if (jx2 > nx)
+	jx2 = nx;
+    ny2 = ndy / 2;
+    jy1 = iy - ny2;
+    if (jy1 < 0)
+	jy1 = 0;
+    jy2 = iy + ny2 + 1;
+    if (jy2 > ny)
+	jy2 = ny;
+
+    /* Initialize actual number of pixels used for this pixel */
+    n = 0;
+
+    /* Compute total counts around this pixel */
+    sum = 0.0;
+    for (jy = jy1; jy < jy2; jy++) {
+	img = x + (jy * nx) + jx1;
+	for (jx = jx1; jx < jx2; jx++) {
+	    if (*img != bpvali1) {
+		sum = sum + (double) *img;
+		n++;
+		}
+	    img++;
+	    }
+	}
+
+    if (n < 1)
+	return (ival);
+    else {
+	newval = sum / (double) n;
+	if (newval > 255.0)
+	    newval = 255.0;
+	if (newval < 0.0)
+	    newval = 0.0;
+	return ((unsigned char) newval);
+	}
+}
+
 short
 meanpixi2 (x, ival, ix, iy, nx, ny, ndx, ndy)
 
@@ -2404,8 +2655,8 @@ static double imapfr();
 /* PhotPix -- Compute counts within a strictly defined circular aperture
  *	      returns sum of pixel flux
  *	      Jul  4 1984 Original Fortran program by Sam Conner at MIT
- *	      Mar  2 1987 Ported to Unix by Doug Mink at SAO
- *	      Jan 30 2002 translated from Fortran to C by Doug Mink at SAO
+ *	      Mar  2 1987 Ported to Unix by Jessica Mink at SAO
+ *	      Jan 30 2002 translated from Fortran to C by Jessica Mink at SAO
  */
 
 double
@@ -2788,4 +3039,7 @@ double	rad;
  *
  * Jan  8 2007	Drop unused variables from SetBadVal()
  * Jan 11 2007	Add circular aperture photometry in PhotPix()
+ *
+ * May 15 2012	Add medpix() and meanpix() to generalize across pixel size
+ * May 16 2012	Add medpixi1() and meanpixi1() to handle 8-bit images
  */
diff --git a/libwcs/lwcs.h b/libwcs/lwcs.h
index f892c16..b8d4b37 100644
--- a/libwcs/lwcs.h
+++ b/libwcs/lwcs.h
@@ -1,6 +1,6 @@
 /*** File lwcs.h
  *** April 25, 2006
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1999-2006
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/matchstar.c b/libwcs/matchstar.c
index 375c150..6ce8602 100644
--- a/libwcs/matchstar.c
+++ b/libwcs/matchstar.c
@@ -1,6 +1,6 @@
 /*** File libwcs/matchstar.c
  *** December 13, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/matchstar1.c b/libwcs/matchstar1.c
index 8a92c40..d234efe 100644
--- a/libwcs/matchstar1.c
+++ b/libwcs/matchstar1.c
@@ -1,6 +1,6 @@
 /*** File libwcs/matchstar.c
  *** June 19, 2006
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2006
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/nameup b/libwcs/nameup
similarity index 100%
copy from nameup
copy to libwcs/nameup
diff --git a/libwcs/nameup.sed b/libwcs/nameup.sed
new file mode 100644
index 0000000..3f92c91
--- /dev/null
+++ b/libwcs/nameup.sed
@@ -0,0 +1 @@
+1,$s/y Doug/y Jessica/g
diff --git a/libwcs/nut2006.c b/libwcs/nut2006.c
index 00913fc..3f69d31 100644
--- a/libwcs/nut2006.c
+++ b/libwcs/nut2006.c
@@ -1,6 +1,6 @@
 /*  Nutation, IAU 2000b model */
 /*  Translated from Pat Wallace's Fortran subroutine iau_nut00b (June 26 2007)
-    into C by Doug Mink on September 5, 2008 */
+    into C by Jessica Mink on September 5, 2008 */
 
 #define NLS	77 /* number of terms in the luni-solar nutation model */
 
diff --git a/libwcs/platefit.c b/libwcs/platefit.c
index 445bdcc..cb3cb06 100644
--- a/libwcs/platefit.c
+++ b/libwcs/platefit.c
@@ -1,6 +1,6 @@
 /*** File libwcs/platefit.c
  *** September 26, 2006
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1998-2006
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/platepos.c b/libwcs/platepos.c
index abd3123..8479350 100644
--- a/libwcs/platepos.c
+++ b/libwcs/platepos.c
@@ -1,6 +1,6 @@
 /*** File saoimage/wcslib/platepos.c
  *** February 29, 2000
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1998-2002
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/polfit.c b/libwcs/polfit.c
index ac1e594..75a8306 100644
--- a/libwcs/polfit.c
+++ b/libwcs/polfit.c
@@ -1,6 +1,6 @@
 /*** File polfit.c
- *** April 3, 2003
- *** By Doug Mink, after Bevington, page 141
+ *** July 26, 2012
+ *** By Jessica Mink, after Bevington, page 141
 
  *--- Polynomial least squares fitting program, almost identical to the
  *    one in Bevington, "Data Reduction and Error Analysis for the
@@ -175,7 +175,7 @@ double	*a;	/* Vector containing coeffiecients */
     xterm = 1.0;
     for (iterm = 0; iterm < norder; iterm++) {
 	y = y + a[iterm] * xterm;
-	xterm = xterm + x;
+	xterm = xterm * x;
 	}
     return (y);
 }
@@ -189,4 +189,7 @@ double	*a;	/* Vector containing coeffiecients */
  * Jul 25 2001	Add polcomp to return computed values
  *
  * Apr  3 2003	Drop unused variable freedom in polfit()
+ *
+ * Jul 26 2012	Fix xterm computation in polcomp() from + to *
+ *		(found by Raymond Carlberg of U.Toronto)
  */
diff --git a/libwcs/sdssread.c b/libwcs/sdssread.c
index edf3622..1df0e29 100644
--- a/libwcs/sdssread.c
+++ b/libwcs/sdssread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/sdssread.c
  *** October 22, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2004-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/shrink.c b/libwcs/shrink.c
index 994818a..0307bcc 100644
--- a/libwcs/shrink.c
+++ b/libwcs/shrink.c
@@ -1,6 +1,6 @@
 /* File libwcs/shrink.c
  * January 24, 2006
- * By Doug Mink, Harvard-Smithsonian Center for Astrophysics
+ * By Jessica Mink, Harvard-Smithsonian Center for Astrophysics
  */
 
 /* Return image buffer reduced by a given factor */
diff --git a/libwcs/skybotread.c b/libwcs/skybotread.c
index be16227..20d3b08 100644
--- a/libwcs/skybotread.c
+++ b/libwcs/skybotread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/skybotread.c
  *** May 5, 2009
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2004-2009
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/sortstar.c b/libwcs/sortstar.c
index 86cb7fb..ef91165 100644
--- a/libwcs/sortstar.c
+++ b/libwcs/sortstar.c
@@ -1,6 +1,6 @@
 /*** File libwcs/sortstar.c
  *** January 11, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2009
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/tabread.c b/libwcs/tabread.c
index 823f3ff..e499663 100644
--- a/libwcs/tabread.c
+++ b/libwcs/tabread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/tabread.c
  *** September 22, 2010
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2010
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-	   Internet email: dmink at cfa.harvard.edu
-	   Postal address: Doug Mink
+	   Internet email: jmink at cfa.harvard.edu
+	   Postal address: Jessica Mink
 	                   Smithsonian Astrophysical Observatory
 	                   60 Garden St.
 	                   Cambridge, MA 02138 USA
@@ -2900,7 +2900,7 @@ char    *filename;      /* Name of file to check */
  * Jul 23 2007	Add ...dist... as possible "magnitude"
  *
  * Aug 17 2009	Fix columns for declination column name
- * Sep 25 2009	Fix memory leaks found by Douglas Burke
+ * Sep 25 2009	Fix memory leaks found by Jessicalas Burke
  * Sep 30 2009	Fix bugs freeing object names for first pass and farthest star
  *
  * Sep 22 2010	Fix bug when checking file which is not tab table
diff --git a/libwcs/temp b/libwcs/temp
deleted file mode 100644
index c6ba854..0000000
--- a/libwcs/temp
+++ /dev/null
@@ -1 +0,0 @@
- * Sep 15 2011	In fitsrsect() declare impos and nblin off_t
diff --git a/libwcs/tmcread.c b/libwcs/tmcread.c
index 8fce7d5..b541674 100644
--- a/libwcs/tmcread.c
+++ b/libwcs/tmcread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/tmcread.c
  *** September 23, 2010
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2001-2010
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/tnxpos.c b/libwcs/tnxpos.c
index be71a0a..e13d78e 100644
--- a/libwcs/tnxpos.c
+++ b/libwcs/tnxpos.c
@@ -1,6 +1,6 @@
 /*** File wcslib/tnxpos.c
  *** September 17, 2008
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** After IRAF mwcs/wftnx.x and mwcs/wfgsurfit.x
  *** Copyright (C) 1998-2008
@@ -21,8 +21,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
@@ -510,7 +510,7 @@ struct WorldCoor *wcs;		/* pointer to the WCS descriptor */
 
 /* copyright(c) 1986 association of universities for research in astronomy inc.
  * wfgsurfit.x -- surface fitting package used by wcs function drivers.
- * Translated to C from SPP by Doug Mink, SAO, May 26, 1998
+ * Translated to C from SPP by Jessica Mink, SAO, May 26, 1998
  *
  * the following routines are used by the experimental function drivers tnx
  * and zpx to decode polynomial fits stored in the image header in the form
diff --git a/libwcs/ty2read.c b/libwcs/ty2read.c
index e35b83d..132b9a4 100644
--- a/libwcs/ty2read.c
+++ b/libwcs/ty2read.c
@@ -1,6 +1,6 @@
 /*** File libwcs/ty2read.c
  *** July 9, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2000-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/uacread.c b/libwcs/uacread.c
index b1565f1..b892286 100644
--- a/libwcs/uacread.c
+++ b/libwcs/uacread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/uacread.c
  *** January 11, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/ubcread.c b/libwcs/ubcread.c
index 5fca19e..30e27fe 100644
--- a/libwcs/ubcread.c
+++ b/libwcs/ubcread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/ubcread.c
  *** December 05, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2003-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/ucacread.c b/libwcs/ucacread.c
index a739fae..9e1d3fb 100644
--- a/libwcs/ucacread.c
+++ b/libwcs/ucacread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/ucacread.c
  *** May 20, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 2003-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/ujcread.c b/libwcs/ujcread.c
index 6ef0568..3590b29 100644
--- a/libwcs/ujcread.c
+++ b/libwcs/ujcread.c
@@ -1,6 +1,6 @@
 /*** File libwcs/ujcread.c
  *** July 5, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1996-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/wcs.c b/libwcs/wcs.c
index 5503943..1c2339a 100644
--- a/libwcs/wcs.c
+++ b/libwcs/wcs.c
@@ -1,6 +1,6 @@
 /*** File libwcs/wcs.c
  *** September 1, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1994-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/wcs.h b/libwcs/wcs.h
index 0eb8a35..1943c8d 100644
--- a/libwcs/wcs.h
+++ b/libwcs/wcs.h
@@ -1,6 +1,6 @@
 /*** File libwcs/wcs.h
  *** September 9, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1994-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/wcscat.h b/libwcs/wcscat.h
index 9e1e743..46638bf 100644
--- a/libwcs/wcscat.h
+++ b/libwcs/wcscat.h
@@ -1,7 +1,7 @@
 /*** File libwcs/wcscat.h
- *** April 06, 2010
- *** By Doug Mink, dmink at cfa.harvard.edu
- *** Copyright (C) 1998-2010
+ *** May 16, 2012
+ *** By Jessica Mink, jmink at cfa.harvard.edu
+ *** Copyright (C) 1998-2012
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
 
     This library is free software; you can redistribute it and/or
@@ -19,8 +19,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
@@ -225,6 +225,8 @@ struct Range {
     double last;	/* Current maximum value */
     double step;	/* Current step in value */
     double value;	/* Current value */
+    double valmin;	/* Minimum value in all ranges */
+    double valmax;	/* Maximum value in all ranges */
     double ranges[MAXRANGE*3];	/* nranges sets of first, last, step */
     int nvalues;	/* Total number of values in all ranges */
     int nranges;	/* Number of ranges */
@@ -1693,4 +1695,6 @@ double polcomp();	/* Evaluate polynomial from polfit coefficients */
  * Nov  3 2009	Parameterize as MAXNMAG the maximum number of magnitudes
  *
  * Apr 06 2010	Add fillblank argument to agets()
+ *
+ * May 16 2012	Add valmin and valmax to Range data structure
  */
diff --git a/libwcs/wcscat1.h b/libwcs/wcscat1.h
index bf092b9..256b46b 100644
--- a/libwcs/wcscat1.h
+++ b/libwcs/wcscat1.h
@@ -1,6 +1,6 @@
 /*** File libwcs/wcscat.h
  *** January 10, 2007
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Copyright (C) 1998-2007
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
 
@@ -19,8 +19,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/wcscon.c b/libwcs/wcscon.c
index 50210cc..6e99bd3 100644
--- a/libwcs/wcscon.c
+++ b/libwcs/wcscon.c
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/wcscon1.c b/libwcs/wcscon1.c
index 27c7eaf..985b92e 100644
--- a/libwcs/wcscon1.c
+++ b/libwcs/wcscon1.c
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/wcsinit.c b/libwcs/wcsinit.c
index bfbf224..12d3ced 100644
--- a/libwcs/wcsinit.c
+++ b/libwcs/wcsinit.c
@@ -1,6 +1,6 @@
 /*** File libwcs/wcsinit.c
  *** September 1, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** Copyright (C) 1998-2011
  *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
@@ -20,8 +20,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/webread.c b/libwcs/webread.c
index b513dd8..a787194 100644
--- a/libwcs/webread.c
+++ b/libwcs/webread.c
@@ -1,6 +1,6 @@
 /*** File webread.c
  *** September 16, 2011
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** (http code from John Roll)
  *** Copyright (C) 2000-2011
@@ -21,8 +21,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/webread0.c b/libwcs/webread0.c
index 48733fc..2f09200 100644
--- a/libwcs/webread0.c
+++ b/libwcs/webread0.c
@@ -1,6 +1,6 @@
 /*** File webread.c
  *** January 5, 2008
- *** By Doug Mink, dmink at cfa.harvard.edu
+ *** By Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** (http code from John Roll)
  *** Copyright (C) 2000-2008
@@ -21,8 +21,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/libwcs/worldpos.c b/libwcs/worldpos.c
index 629bbd8..8693789 100644
--- a/libwcs/worldpos.c
+++ b/libwcs/worldpos.c
@@ -2,7 +2,7 @@
  *  September 1, 2011
  *  Copyright (C) 1994-2011
  *  Associated Universities, Inc. Washington DC, USA.
- *  With code added by Doug Mink, Smithsonian Astrophysical Observatory
+ *  With code added by Jessica Mink, Smithsonian Astrophysical Observatory
  *                 and Allan Brighton and Andreas Wicenec, ESO
  *                 and Frank Valdes, NOAO
 
diff --git a/libwcs/zpxpos.c b/libwcs/zpxpos.c
index 62a84de..0994293 100644
--- a/libwcs/zpxpos.c
+++ b/libwcs/zpxpos.c
@@ -1,7 +1,7 @@
 /*** File wcslib/zpxpos.c
  *** March 8, 2011
  *** By Frank Valdes, valdes at noao.edu
- *** Modified from tnxpos.c by Doug Mink, dmink at cfa.harvard.edu
+ *** Modified from tnxpos.c by Jessica Mink, jmink at cfa.harvard.edu
  *** Harvard-Smithsonian Center for Astrophysics
  *** After IRAF mwcs/wfzpx.x
  *** Copyright (C) 1998-2011
@@ -22,8 +22,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     Correspondence concerning WCSTools should be addressed as follows:
-           Internet email: dmink at cfa.harvard.edu
-           Postal address: Doug Mink
+           Internet email: jmink at cfa.harvard.edu
+           Postal address: Jessica Mink
                            Smithsonian Astrophysical Observatory
                            60 Garden St.
                            Cambridge, MA 02138 USA
diff --git a/man b/man
new file mode 120000
index 0000000..233c4e1
--- /dev/null
+++ b/man
@@ -0,0 +1 @@
+Man
\ No newline at end of file
diff --git a/matchcat.c b/matchcat.c
index 28ce996..f7a0998 100644
--- a/matchcat.c
+++ b/matchcat.c
@@ -36,7 +36,7 @@ static double matchrad = 5.0;	/* Initial match radius is 5 arcseconds */
 int version = 0;		/* If 1, print only program name and version */
 static void usage();
 
-static char *RevMsg = "MATCHCAT WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "MATCHCAT WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 main (ac, av)
 int ac;
diff --git a/nedname.c b/nedname.c
index 46573e3..561bfb5 100644
--- a/nedname.c
+++ b/nedname.c
@@ -9,7 +9,7 @@
 #include "libned/ned_client.h"
 #include "libwcs/wcs.h"
 
-static char *RevMsg = "WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 extern int ned_errno;
 static void PrintUsage();
diff --git a/nedpos.c b/nedpos.c
index 199536a..82e40f1 100644
--- a/nedpos.c
+++ b/nedpos.c
@@ -10,7 +10,7 @@
 #include "libwcs/wcs.h"
 #include "libwcs/fitsfile.h"
 
-static char *RevMsg = "NEDPOS 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "NEDPOS 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 extern int ned_errno;
 static void PrintUsage();
diff --git a/newfits.c b/newfits.c
index cb19af0..4c3fe4d 100644
--- a/newfits.c
+++ b/newfits.c
@@ -47,7 +47,7 @@ extern void setcdelt();
 extern void setproj();
 extern struct WorldCoor *GetFITSWCS();
 
-static char *RevMsg = "NEWFITS WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "NEWFITS WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int verbose = 0;	/* verbose/debugging flag */
 static int bitpix = 0;	/* number of bits per pixel (FITS code, 0=no image) */
 static int version = 0;	/* If 1, print only program name and version */
diff --git a/remap.c b/remap.c
index c302211..7bd4429 100644
--- a/remap.c
+++ b/remap.c
@@ -50,7 +50,7 @@ static char *outname0 = "remap.fits";
 static char *outname;
 static char *wcsproj;           /* WCS projection name */
 
-static char *RevMsg = "REMAP WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "REMAP WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 static int nfiles = 0;
 static int fitsout = 1;
 static double secpix = 0;
diff --git a/revup.sed b/revup.sed
index 9f81e55..7b376a5 100644
--- a/revup.sed
+++ b/revup.sed
@@ -1 +1 @@
-1,$s/3\.8\.5, 27 March 2012/3\.8\.5, 12 April 2012/
+1,$s/3\.8\.6, 23 May 2012/3\.8\.7, 10 August 2012/
diff --git a/scat.c b/scat.c
index e8c6229..9b9f227 100644
--- a/scat.c
+++ b/scat.c
@@ -33,7 +33,7 @@
 #include "libwcs/fitsfile.h"
 #include "libwcs/wcscat.h"
 
-static char *RevMsg = "WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 static void PrintUsage();
 	static int scatparm();
diff --git a/sethead.c b/sethead.c
index 950aa52..a7a762e 100644
--- a/sethead.c
+++ b/sethead.c
@@ -66,7 +66,7 @@ static int addwcs = 0;
 static int errflag = 0;		/* Error return from program */
 static char *rootdir=NULL;	/* Root directory for input files */
 
-static char *RevMsg = "SETHEAD WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "SETHEAD WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/setpix.c b/setpix.c
index 735154b..1cd0555 100644
--- a/setpix.c
+++ b/setpix.c
@@ -48,7 +48,7 @@ static int version = 0;		/* If 1, print only program name and version */
 static int logrange = 1;	/* Log pixel change in image header */
 static char *pform = NULL;	/* Format in which to print pixels */
 
-static char *RevMsg = "SETPIX WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "SETPIX WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/simpos.c b/simpos.c
index a364cf5..64a47a8 100644
--- a/simpos.c
+++ b/simpos.c
@@ -12,7 +12,7 @@
 
 extern int   ned_errno;
 static void PrintUsage();
-static char *RevMsg = "SIMPOS 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "SIMPOS 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 int
 main (ac, av)
diff --git a/simposx.c b/simposx.c
index cfd4cfa..904d85d 100644
--- a/simposx.c
+++ b/simposx.c
@@ -12,7 +12,7 @@
 
 extern int   ned_errno;
 static void PrintUsage();
-static char *RevMsg = "SIMPOS 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "SIMPOS 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 int
 main (ac, av)
diff --git a/sky2xy.c b/sky2xy.c
index db4de0a..dfc9c92 100644
--- a/sky2xy.c
+++ b/sky2xy.c
@@ -39,7 +39,7 @@ extern struct WorldCoor *GetWCSFITS ();	/* Read WCS from FITS or IRAF file */
 extern char *GetFITShead();
 static int version = 0;		/* If 1, print only program name and version */
 
-static char *RevMsg = "SKY2XY WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "SKY2XY WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/skycoor.c b/skycoor.c
index ef74dd4..405c0cc 100644
--- a/skycoor.c
+++ b/skycoor.c
@@ -51,7 +51,7 @@ static double decpm = 0.0;	/* Declination proper motion in mas/year */
 static int epset = 0;
 static int inhours = 0;
 
-static char *RevMsg = "SKYCOOR WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "SKYCOOR WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/sp2char.c b/sp2char.c
index 9ecbcf8..1186be9 100644
--- a/sp2char.c
+++ b/sp2char.c
@@ -40,7 +40,7 @@ static int verbose = 0;		/* verbose/debugging flag */
 static int version = 0;		/* If 1, print only program name and version */
 static char spchar = '_';
 
-static char *RevMsg = "SP2CHAR WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "SP2CHAR WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/subpix.c b/subpix.c
index e5d2146..abb555d 100644
--- a/subpix.c
+++ b/subpix.c
@@ -38,7 +38,7 @@ static int newimage = 0;
 static int verbose = 0;		/* verbose flag */
 static int version = 0;		/* If 1, print only program name and version */
 
-static char *RevMsg = "SUBPIX WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "SUBPIX WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/sumpix.c b/sumpix.c
index 2d00c64..0ff7b7c 100644
--- a/sumpix.c
+++ b/sumpix.c
@@ -1,5 +1,5 @@
 /* File sumpix.c
- * February 1, 2012
+ * May 16, 2012
  * By Jessica Mink Harvard-Smithsonian Center for Astrophysics)
  * Send bug reports to jmink at cfa.harvard.edu
 
@@ -36,16 +36,20 @@ static void usage();
 static void SumPix();
 extern double PhotPix();
 
-static char *RevMsg = "SUMPIX WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "SUMPIX WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 static int verbose = 0;		/* verbose/debugging flag */
 static int version = 0;	/* If 1, print only program name and version */
 static int complim = 0;	/* If 1, compute limiting values over range */
 static int compsum = 0;	/* If 1, compute sum over range */
 static int compmean = 0;/* If 1, compute mean over range */
+static int compmed = 0;/* If 1, compute median over range */
 static int compvar = 0;	/* If 1, compute variance over range */
 static int compstd = 0;	/* If 1, compute standard deviation over range */
 static int compphot = 0; /* If 1, compute photometry in circular aperture */
+static int printindex = 0; /* If 1, print row and/or column */
+static int printhead = 0; /* If 1, print column headers for output values */
+static int printtab = 0; /* If 1, tab-separate values */
 static char *xstr;	/* X coordinate of center of aperture */
 static char *ystr;	/* Y coordinate of center of aperture */
 static double rad;	/* Radius of aperture in pixels */
@@ -99,6 +103,18 @@ char **av;
 		    compstd++;
 		    break;
 
+		case 'e':	/* Compute median */
+		    compmed++;
+		    break;
+
+		case 'h':	/* Print column headers for output values */
+		    printhead++;
+		    break;
+
+		case 'i':	/* Print index */
+		    printindex++;
+		    break;
+
 		case 'l':	/* Compute limits */
 		    complim++;
 		    break;
@@ -117,15 +133,24 @@ char **av;
 		case 'p':	/* Print filename at start of line */
 		    printfile++;
 		    break;
+
 		case 'r':	/* Compute variance */
 		    compvar++;
 		    break;
+
 		case 's':	/* Compute sum */
 		    compsum++;
 		    break;
+
+		case 't':	/* Tab-separate values */
+		    printtab++;
+		    printhead++;
+		    break;
+
 		case 'v':	/* more verbosity */
 		    verbose++;
 		    break;
+
 		default:
 		    usage();
 		    break;
@@ -138,8 +163,9 @@ char **av;
 		crange = *av;
 	    else {
 		rrange = *av;
-		if (fn != NULL)
+		if (fn != NULL) {
 		    SumPix (fn, crange, rrange);
+		    }
 		}
 	    }
 
@@ -177,15 +203,19 @@ usage ()
 	exit (-1);
     fprintf (stderr,"Sum row, column, or region of a FITS or IRAF image\n");
     fprintf(stderr,"Usage: sumpix [-dmrsv][-n num] x_range  y_range file.fit ...\n");
-    fprintf(stderr,"  -c x y r: compute total counts in circle r from (x,y)\n");
-    fprintf(stderr,"  -d: compute and print standard deviation\n");
-    fprintf(stderr,"  -l: compute and print min and max values\n");
-    fprintf(stderr,"  -m: compute and print mean\n");
-    fprintf(stderr,"  -n: number of decimal places in output\n");
+    fprintf(stderr,"  -c x y r: Compute total counts in circle r from (x,y)\n");
+    fprintf(stderr,"  -d: Compute and print standard deviation\n");
+    fprintf(stderr,"  -e: Compute and print median\n");
+    fprintf(stderr,"  -h: Print column headers for output values\n");
+    fprintf(stderr,"  -i: Print row or column number if other is 0\n");
+    fprintf(stderr,"  -l: Compute and print min and max values\n");
+    fprintf(stderr,"  -m: Compute and print mean\n");
+    fprintf(stderr,"  -n: Number of decimal places in output\n");
     fprintf(stderr,"  -p: Print file name at start of line\n");
-    fprintf(stderr,"  -r: compute and print variance (sum of squares)\n");
-    fprintf(stderr,"  -s: compute and print sum (default)\n");
-    fprintf(stderr,"  -v: verbose\n");
+    fprintf(stderr,"  -r: Compute and print variance (sum of squares)\n");
+    fprintf(stderr,"  -s: Compute and print sum (default)\n");
+    fprintf(stderr,"  -t: Separate output values with tabs and add column headers\n");
+    fprintf(stderr,"  -v: Verbose\n");
     fprintf(stderr,"  a range of 0 implies the full dimension\n");
     fprintf(stderr,"  an absence of ranges uses the entire image\n");
     exit (1);
@@ -209,6 +239,7 @@ char *rrange;	/* Row range string */
     double bscale;	/* Scale factor for pixel scaling */
     double counts;
     double wt;
+    double medpix();
     int iraffile;
     double dpix, sum;
     double ra, dec, xp, yp;
@@ -217,6 +248,7 @@ char *rrange;	/* Row range string */
     int offscl;
     int np;
     double dnp, mean, variance, std, sumsq, dmin, dmax;
+    double xmax, ymax, median, medpix();
     char pixname[256];
     char numform[8];
     char numforme[8];
@@ -278,11 +310,11 @@ char *rrange;	/* Row range string */
 	}
 
     if (ndec > -1) {
-	sprintf (numform, "%%.%df ", ndec);
+	sprintf (numform, "%%.%df", ndec);
 	sprintf (numforme, "%%.%df", ndec);
 	}
     else {
-	sprintf (numform, "%%.2f ");
+	sprintf (numform, "%%.2f");
 	sprintf (numforme, "%%.2f");
 	}
 
@@ -327,21 +359,23 @@ char *rrange;	/* Row range string */
     else if (!strcmp (crange, "0") && !strcmp (rrange, "0")) {
 	nx = xdim;
 	ny = ydim;
-	sum = 0.0;
-	sumsq = 0.0;
-	np = 0;
-	dmin = 1000000000000000.0;
-	dmax = -10000000000000000.0;
-	for (x = 0; x < nx; x++) {
-	    for (y = 0; y < ny; y++) {
-        	dpix = getpix (image,bitpix,xdim,ydim,bzero,bscale,x,y);
-		sum = sum + dpix;
-		sumsq = sumsq + (dpix * dpix);
-		if (dpix < dmin)
-		    dmin = dpix;
-		if (dpix > dmax)
-		    dmax = dpix;
-		np++;
+	if (compsum || complim) {
+	    sum = 0.0;
+	    sumsq = 0.0;
+	    np = 0;
+	    dmin = 1000000000000000.0;
+	    dmax = -10000000000000000.0;
+	    for (x = 0; x < nx; x++) {
+		for (y = 0; y < ny; y++) {
+     		    dpix = getpix (image,bitpix,xdim,ydim,bzero,bscale,x,y);
+		    sum = sum + dpix;
+		    sumsq = sumsq + (dpix * dpix);
+		    if (dpix < dmin)
+			dmin = dpix;
+		    if (dpix > dmax)
+			dmax = dpix;
+		    np++;
+		    }
 		}
 	    }
 	dnp = (double) np;
@@ -371,6 +405,77 @@ char *rrange;	/* Row range string */
 	xrange = RangeInit (crange, xdim);
 	nx = rgetn (xrange);
 	ny = ydim;
+	xmax = xrange->valmax;
+	if (printhead) {
+	    if (printindex) {
+		printf ("i");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compmed) {
+		printf ("median");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compsum) {
+		printf ("sum");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compmean) {
+		printf ("mean");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compvar) {
+		printf ("var");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compstd) {
+		printf ("stdev");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (complim) {
+		printf ("min");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		printf ("max");
+		}
+	    printf ("\n");
+	    if (printtab) {
+		if (printindex) 
+		    printf ("-----	");
+		if (compmed)
+		    printf ("------	");
+		if (compsum)
+		    printf ("---	");
+		if (compmean)
+		    printf ("----	");
+		if (compvar)
+		    printf ("---	");
+	    	if (compstd)
+		    printf ("-----	");
+		if (complim)
+		    printf ("---	---");
+		printf ("\n");
+		}
+	    }
 	for (ix = 0; ix < nx; ix++) {
 	    x = rgeti4 (xrange) - 1;
 	    sum = 0.0;
@@ -389,22 +494,67 @@ char *rrange;	/* Row range string */
 		np++;
 		}
 	    dnp = (double) np;
-	    if (compsum)
+	    if (printindex) {
+		if (xmax < 10.0)
+		    printf ("%d", ix);
+		else if (xmax < 100.0)
+		    printf ("%2d", ix);
+		else if (xmax < 1000.0)
+		    printf ("%3d", ix);
+		else if (xmax < 10000.0)
+		    printf ("%4d", ix);
+		else
+		    printf ("%5d", ix);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compmed) {
+		median = (double) medpix (image, 0.0, x, 1, nx, ny, nx, 1, bitpix);
+		printf (numform, median);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compsum) {
 		printf (numform, sum);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
 	    mean = sum / dnp;
-	    if (compmean)
+	    if (compmean) {
 		printf (numform, mean);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
 	    variance = sumsq;
-	    if (compvar)
+	    if (compvar) {
 		printf (numform, variance);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
 	    if (compstd) {
 		std = sqrt ((sumsq / dnp) - (mean * mean));
 		printf (numforme, std);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
 		}
 	    if (complim) {
-		printf (" ");
 		printf (numform, dmin);
-		printf ("- ");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
 		printf (numform, dmax);
 		}
 	    printf ("\n");
@@ -417,8 +567,103 @@ char *rrange;	/* Row range string */
 	yrange = RangeInit (rrange, xdim);
 	ny = rgetn (yrange);
 	nx = xdim;
-	for (iy = 0; iy < ny; iy++) {
+	ymax = yrange->valmax;
+	if (printhead) {
+	    if (printindex) {
+		printf ("i");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compmed) {
+		printf ("median");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compsum) {
+		printf ("sum");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compmean) {
+		printf ("mean");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compvar) {
+		printf ("var");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compstd) {
+		printf ("stdev");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (complim) {
+		printf ("min");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		printf ("max");
+		}
+	    printf ("\n");
+	    if (printtab) {
+		if (printindex)
+		    printf ("-----	");
+		if (compmed)
+		    printf ("------	");
+		if (compsum)
+		    printf ("---	");
+		if (compmean)
+		    printf ("----	");
+		if (compvar)
+		    printf ("---	");
+		if (compstd)
+		    printf ("-----	");
+		if (complim)
+		    printf ("---	---");
+		printf ("\n");
+		}
+	    }
+	    for (iy = 0; iy < ny; iy++) {
 	    y = rgeti4 (yrange) - 1;
+	    if (printindex) {
+		if (ymax < 10.0)
+		    printf ("%d", iy);
+		else if (ymax < 100.0)
+		    printf ("%2d", iy);
+		else if (ymax < 1000.0)
+		    printf ("%3d", iy);
+		else if (ymax < 10000.0)
+		    printf ("%4d", iy);
+		else
+		    printf ("%5d", iy);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
+	    if (compmed) {
+		median = (double) medpix (image, 0.0, 1, y, nx, ny, nx, 1, bitpix);
+		printf (numform, median);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
 	    sum = 0.0;
 	    sumsq = 0.0;
 	    dmin = 1000000000000000.0;
@@ -435,22 +680,44 @@ char *rrange;	/* Row range string */
 		np++;
 		}
 	    dnp = (double) np;
-	    if (compsum)
+	    if (compsum) {
 		printf (numform, sum);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
 	    mean = sum / dnp;
-	    if (compmean)
+	    if (compmean) {
 		printf (numform, mean);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
 	    variance = sumsq;
-	    if (compvar)
+	    if (compvar) {
 		printf (numform, variance);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
+		}
 	    if (compstd) {
 		std = sqrt ((sumsq / dnp) - (mean * mean));
 		printf (numforme, std);
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
 		}
 	    if (complim) {
 		printf (" ");
 		printf (numform, dmin);
-		printf ("- ");
+		if (printtab)
+		    printf ("\t");
+		else
+		    printf (" ");
 		printf (numform, dmax);
 		}
 	    printf ("\n");
@@ -517,14 +784,14 @@ char *rrange;	/* Row range string */
 /* Jul  2 1999	New program
  * Jul  6 1999	Fix bug with x computation in patch adding section
  * Oct 22 1999	Drop unused variables after lint
- * Oct 29 1999	Add option to compute and print mean, rms, std, and/or sum
+ * Oct 29 1999	Add option to compute and printf mean, rms, std, and/or sum
  * Dec 10 1999	Add option -n to set number of decimal places in output
  * Dec 14 1999	Change rms to variance
  *
  * Mar 23 2000	Use hgetm() to get the IRAF pixel file name, not hgets()
  *
  * Dec  6 2002	Add option to sum over entire image if both ranges are 0
- * Dec  6 2002	Add -l option to print range of values
+ * Dec  6 2002	Add -l option to printf range of values
  *
  * Jun 21 2006	Clean up code
  *
@@ -533,4 +800,7 @@ char *rrange;	/* Row range string */
  * Jan 11 2007	Add PhotPix to compute circular aperture photometry
  *
  * Feb  1 2012	Improve argument parsing so order doesn't matter
+ * May 16 2012	Add options i to print index and e to compute medians
+ * May 16 2012	Add option t to separate values by tabs
+ * May 16 2012	Add option h to print headings
  */
diff --git a/testrot.c b/testrot.c
index 017156d..e60ed3b 100644
--- a/testrot.c
+++ b/testrot.c
@@ -24,7 +24,7 @@ static int hms = 0;		/* 1 for output in hh:mm:ss dd:mm:ss */
 static int nf = 0;
 static int version = 0;		/* If 1, print only program name and version */
 
-static char *RevMsg = "TESTROT WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "TESTROT WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 main (ac, av)
 int ac;
diff --git a/wcshead.c b/wcshead.c
index ef4709a..40e88a1 100644
--- a/wcshead.c
+++ b/wcshead.c
@@ -47,7 +47,7 @@ static int restwave = 0;	/* If 1, print first dimension limits */
 static int printhead = 1;	/* 1 until header has been printed */
 static char *rootdir=NULL;	/* Root directory for input files */
 
-static char *RevMsg = "WCSHEAD WCSTools 3.8.5, 12 April 2012, Jessica Mink SAO";
+static char *RevMsg = "WCSHEAD WCSTools 3.8.7, 10 August 2012, Jessica Mink SAO";
 
 int
 main (ac, av)
diff --git a/xy2sky.c b/xy2sky.c
index 5d9e44c..dc81b17 100644
--- a/xy2sky.c
+++ b/xy2sky.c
@@ -49,7 +49,7 @@ static int printhead = 0;
 static char printonly = 'n';
 static int version = 0;		/* If 1, print only program name and version */
 
-static char *RevMsg = "XY2SKY WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "XY2SKY WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)
diff --git a/xy2sky1.c b/xy2sky1.c
index c3c46f5..5cfc0ea 100644
--- a/xy2sky1.c
+++ b/xy2sky1.c
@@ -51,7 +51,7 @@ static int sizeset = 0;
 static int scaleset = 0;
 static int version = 0;		/* If 1, print only program name and version */
 
-static char *RevMsg = "XY2SKY WCSTools 3.8.5, 12 April 2012, Jessica Mink (jmink at cfa.harvard.edu)";
+static char *RevMsg = "XY2SKY WCSTools 3.8.7, 10 August 2012, Jessica Mink (jmink at cfa.harvard.edu)";
 
 int
 main (ac, av)

-- 
Create, display and manipulate the world coordinate system



More information about the debian-science-commits mailing list