Index: /trunk/psLib/Makefile.am
===================================================================
--- /trunk/psLib/Makefile.am	(revision 4540)
+++ /trunk/psLib/Makefile.am	(revision 4541)
@@ -1,5 +1,5 @@
 SUBDIRS = $(SUBDIR)
 
-bin_SCRIPTS = pslib-config
+bin_SCRIPTS = pslib-config psParseErrorCodes
 
 pkgconfigdir = $(libdir)/pkgconfig
Index: /trunk/psLib/configure.ac
===================================================================
--- /trunk/psLib/configure.ac	(revision 4540)
+++ /trunk/psLib/configure.ac	(revision 4541)
@@ -13,4 +13,6 @@
 
 SUBDIR="etc src test" dnl don't include 'swig', as it is optional
+
+SRCDIRS="sys astro db fft fits imageops math mathtypes types xml"
 
 AC_DISABLE_STATIC
@@ -70,4 +72,13 @@
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([floor gethostname gettimeofday memmove memset mkdir pow regcomp sqrt strchr strcspn strerror strrchr strstr strtol strtoul strtoull])
+
+dnl Add the src directories to the include path
+SRCPATH="`pwd`/src"
+SRCINC=`echo "${SRCDIRS=}" | sed "s|\(\\w\+\)|-I\${SRCPATH=}/\1|g"`
+SRCSUBLIBS=`echo "${SRCDIRS=}" | sed "s|\(\\w\+\)|\1/libpslib\1.la|g"`
+AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS=})
+CFLAGS="${CFLAGS=} -I${SRCPATH=} ${SRCINC=}"
+AC_SUBST(SRCINC,${SRCINC=})
+
 
 dnl ----------------- MYSQL options --------------------
@@ -238,16 +249,23 @@
 
 AC_SUBST(SUBDIR,[$SUBDIR])
+AC_SUBST(SRCDIRS,[$SRCDIRS])
 AC_SUBST(PSLIB_LIBS,[$PSLIB_LIBS])
 AC_SUBST(PSLIB_CFLAGS,[$PSLIB_CFLAGS])
+
+AC_SUBST(LANG,[en])
 
 AC_CONFIG_FILES([
   Makefile
   src/Makefile
-  src/astronomy/Makefile
-  src/collections/Makefile
-  src/dataManip/Makefile
-  src/dataIO/Makefile
-  src/image/Makefile
-  src/sysUtils/Makefile
+  src/astro/Makefile
+  src/db/Makefile
+  src/fft/Makefile
+  src/fits/Makefile
+  src/imageops/Makefile
+  src/math/Makefile
+  src/mathtypes/Makefile
+  src/sys/Makefile
+  src/types/Makefile
+  src/xml/Makefile
   test/FullUnitTest
   test/Makefile
Index: /trunk/psLib/psParseErrorCodes
===================================================================
--- /trunk/psLib/psParseErrorCodes	(revision 4541)
+++ /trunk/psLib/psParseErrorCodes	(revision 4541)
@@ -0,0 +1,81 @@
+#!/usr/bin/perl
+
+# Provides functions for handling long command line options
+use Getopt::Long;
+
+my @ErrorCodes        = ();
+my @ErrorDescriptions = ();
+
+my $data = "psErrorCodes.dat";
+
+# Assign variables based on the presence of command line options to the script
+GetOptions(
+    "data=s"  => \$data,
+    "verbose" => \$verbose,
+    "help"    => \$help
+);
+
+if ($help) {
+    print "Usage: parseErrorCodes ", "[--data=dataFile] ", "[--help] ",
+        "[--verbose] filename\n\n";
+    exit(0);
+}
+
+print "Using data file '$data'\n" if $verbose;
+unless ( open( DATAFILE, "<", $data ) ) {
+    die "Can not open data file $data.";
+}
+
+print "Datafile:\n" if $verbose;
+while (<DATAFILE>) {
+    chop;
+    if (/^\s*\#/) {
+        print "C $_\n" if $verbose;
+    }
+    else {
+        if (/^\s*(\w+)\s+([\%\w].*)/) {
+            my $ErrorCode        = $1;
+            my $ErrorDescription = $2;
+            print "  $ErrorCode: '$ErrorDescription'\n" if $verbose;
+            push( @ErrorCodes,        $ErrorCode );
+            push( @ErrorDescriptions, $ErrorDescription );
+        } else {
+            print "I $_\n" if $verbose;
+        }
+    }
+}
+close(DATAFILE);
+
+my $found = $#ErrorCodes + 1;
+print "\nFound $found error codes.\n" if $verbose;
+
+foreach (@ARGV) {
+    my $output = $_;
+    my $filename = $output.".in";
+
+    die "Failed to open input file '$filename'"
+      if !open( INFILE, "<", $filename );
+    die "Failed to open output file '$output'"
+      if !open( OUTFILE, ">", $output );
+
+    print "\nOutput File:\n" if $verbose;
+    while (<INFILE>) {
+        if (/\${ErrorCode}/ || /\${ErrorDescription}/ || /\${n}/) {
+            $line = $_;
+            for ( $n = 0 ; $n < $found ; $n++ ) {
+                $_ = $line;
+                s/\${ErrorCode}/$ErrorCodes[$n]/g;
+                s/\${ErrorDescription}/$ErrorDescriptions[$n]/g;
+                s/\${n}/$n/g;
+                print OUTFILE;
+                print if $verbose;
+            }
+        } else {
+            print OUTFILE;
+            print if $verbose;
+        }
+    }
+
+    close(INFILE);
+    close(OUTFILE);
+}
Index: /trunk/psLib/src/astro/psEarthOrientation.c
===================================================================
--- /trunk/psLib/src/astro/psEarthOrientation.c	(revision 4541)
+++ /trunk/psLib/src/astro/psEarthOrientation.c	(revision 4541)
@@ -0,0 +1,79 @@
+/** @file  psEarthOrientation.c
+*
+*  @brief Function implementations for earth orientation calculations
+*  transformation
+*
+*  @ingroup EarthOrientation
+*
+*  @author Robert Daniel DeSonia, MHPCC
+*
+*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-07-12 19:27:27 $
+*
+*  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
+*/
+
+psSphere *psAberration(psSphere *apparent, const psSphere *actual, const psSphere *direction, double speed)
+{
+    return NULL;
+}
+
+psSphere *psGravityDeflection(psSphere *apparent, psSphere *actual, psSphere *sun)
+{
+    return NULL;
+}
+
+
+double psEOC_ParallaxFactor(const psSphere *coords, const psTime *time)
+{
+    return NAN;
+}
+
+psEarthPole *psEOC_PrecessionModel(const psTime *time)
+{
+    return NULL;
+}
+
+
+psEarthPole *psEOC_PrecessionCorr(const psTime *time, psTimeBulletin bulletin)
+{
+    return NULL;
+}
+
+
+psSphereRot *psSphereRot_CEOtoGCRS(const psEarthPole *pole)
+{
+    return NULL;
+}
+
+
+psSphereRot *psSphereRot_TEOtoCEO(const psTime *time)
+{
+    return NULL;
+}
+
+
+psEarthPole *psEOC_GetPolarMotion(const psTime *time, psTimeBulletin bulletin)
+{
+    return NULL;
+}
+
+
+psEarthPole *psEOC_PolarTideCorr(const psTime *time)
+{
+    return NULL;
+}
+
+
+psEarthPole *psEOC_NutationCorr(psTime *time)
+{
+    return NULL;
+}
+
+
+psSphereRot *psSphereRot_ITRStoTEO(const psEarthPole *motion)
+{
+    return NULL;
+}
+
+
Index: /trunk/psLib/src/astro/psEarthOrientation.h
===================================================================
--- /trunk/psLib/src/astro/psEarthOrientation.h	(revision 4541)
+++ /trunk/psLib/src/astro/psEarthOrientation.h	(revision 4541)
@@ -0,0 +1,88 @@
+/** @file  psEarthOrientation.h
+*
+*  @brief Function prototypes for earth orientation calculations
+*  transformation
+*
+*  @ingroup EarthOrientation
+*
+*  @author Robert Daniel DeSonia, MHPCC
+*
+*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-07-12 19:27:27 $
+*
+*  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
+*/
+
+#ifndef PS_EARTH_ORIENTATION
+#define PS_EARTH_ORIENTATION
+
+#include "psCoord.h"
+#include "psTime.h"
+
+typedef struct
+{
+    double x;
+    double y;
+    double s;
+}
+psEarthPole;
+
+typedef enum {
+    PS_PRECESS_ROUGH,
+    PS_PRECESS_COMPLETE,
+    PS_PRECESS_IAU2000A,
+} psPrecessMethod;
+
+psSphere *psAberration(
+    psSphere *apparent,
+    const psSphere *actual,
+    const psSphere *direction,
+    double speed
+);
+
+psSphere *psGravityDeflection(
+    psSphere *apparent,
+    psSphere *actual,
+    psSphere *sun
+);
+
+double psEOC_ParallaxFactor(
+    const psSphere *coords,
+    const psTime *time
+);
+
+psEarthPole *psEOC_PrecessionModel(
+    const psTime *time
+);
+
+psEarthPole *psEOC_PrecessionCorr(
+    const psTime *time,
+    psTimeBulletin bulletin
+);
+
+psSphereRot *psSphereRot_CEOtoGCRS(
+    const psEarthPole *pole
+);
+
+psSphereRot *psSphereRot_TEOtoCEO(
+    const psTime *time
+);
+
+psEarthPole *psEOC_GetPolarMotion(
+    const psTime *time,
+    psTimeBulletin bulletin
+);
+
+psEarthPole *psEOC_PolarTideCorr(
+    const psTime *time
+);
+
+psEarthPole *psEOC_NutationCorr(
+    psTime *time
+);
+
+psSphereRot *psSphereRot_ITRStoTEO(
+    const psEarthPole *motion
+);
+
+#endif // #ifndef PS_EARTH_ORIENTATION
Index: /trunk/psLib/src/astro/psSphere.c
===================================================================
--- /trunk/psLib/src/astro/psSphere.c	(revision 4541)
+++ /trunk/psLib/src/astro/psSphere.c	(revision 4541)
@@ -0,0 +1,230 @@
+/** @file  psCoord.c
+*
+*  @brief Contains basic coordinate transformation definitions and operations
+*
+*  This file defines the basic types for astronomical coordinate
+*  transformation
+*
+*  @ingroup CoordinateTransform
+*
+*  @author GLG, MHPCC
+*
+*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-07-12 19:27:27 $
+*
+*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
+*/
+/******************************************************************************/
+/*  INCLUDE FILES                                                             */
+/******************************************************************************/
+#include "psType.h"
+#include "psCoord.h"
+#include "psMemory.h"
+#include "psTime.h"
+#include "psConstants.h"
+#include "psError.h"
+#include "psLogMsg.h"
+#include "psAstronomyErrors.h"
+#include "psAstrometry.h"
+#include "psMatrix.h"
+#include <math.h>
+#include <float.h>
+
+static void sphereFree(psSphere *s)
+{
+    // There are non dynamic allocated items
+}
+
+psSphere* psSphereAlloc(void)
+{
+    psSphere *s = psAlloc(sizeof(psSphere));
+
+    psMemSetDeallocator(s, (psFreeFcn) sphereFree);
+    return(s);
+}
+
+psSphereRot* psSphereRotAlloc(double alphaP,
+                              double deltaP,
+                              double phiP)
+{
+    psSphereRot* rot = psAlloc(sizeof(psSphereRot));
+
+    double cosDelta = cos(deltaP);
+    double halfPhi = phiP / 2.0;
+    double sinHalfPhi = sin(halfPhi);
+
+    // equations are directly from ADD
+    double vx = cosDelta*cos(alphaP);
+    double vy = cosDelta*sin(alphaP);
+    double vz = sin(deltaP);
+
+    rot->q0 = vx*sinHalfPhi;
+    rot->q1 = vy*sinHalfPhi;
+    rot->q2 = vz*sinHalfPhi;
+    rot->q3 = cos(halfPhi);
+
+    return rot;
+}
+
+psSphereRot* psSphereRotQuat(double q0,
+                             double q1,
+                             double q2,
+                             double q3)
+{
+    psSphereRot* rot = psAlloc(sizeof(psSphereRot));
+
+    double len = sqrt(q0*q0 + q1*q1 + q2*q2 + q3*q3);
+    rot->q0 = q0 / len;
+    rot->q1 = q1 / len;
+    rot->q2 = q2 / len;
+    rot->q3 = q3 / len;
+
+    return rot;
+}
+
+/******************************************************************************
+XXX: We convert Right Ascension angles to the range 0:PI.  Is that acceptable?
+XXX: Should we do something for Declination as well?
+ *****************************************************************************/
+psSphere* psSphereRotApply(psSphere* out,
+                           const psSphereRot* transform,
+                           const psSphere* coord)
+{
+    PS_ASSERT_PTR_NON_NULL(transform, NULL);
+    PS_ASSERT_PTR_NON_NULL(coord, NULL);
+
+    if (out == NULL) {
+        out = psSphereAlloc();
+    }
+
+
+    // apply the transform by creating a new psSphereRot from the input coord
+    // and combining it with the input transform (see ADD)
+    psSphereRot* coordRot = psSphereRotAlloc(coord->r, coord->d, 0);
+    coordRot->q3 = 0.0;
+    coordRot = psSphereRotCombine(coordRot, transform, coordRot);
+    // N.B., we can recycle coordRot right away due to the implementation of
+    // psSphereRotCombine puts the values of coordRot in a local variable first
+
+    out->r = atan2(coordRot->q1,coordRot->q0);
+    out->d = atan2(coordRot->q2,sqrt(coordRot->q1*coordRot->q1+coordRot->q0*coordRot->q0));
+
+    return out;
+}
+
+psSphereRot* psSphereRotCombine(psSphereRot* out,
+                                const psSphereRot* rot1,
+                                const psSphereRot* rot2)
+{
+    PS_ASSERT_PTR_NON_NULL(rot1, NULL);
+    PS_ASSERT_PTR_NON_NULL(rot2, NULL);
+
+    if (out == NULL) {
+        out = (psSphereRot* ) psAlloc(sizeof(psSphereRot));
+    }
+
+    double a0 = rot1->q0;
+    double a1 = rot1->q1;
+    double a2 = rot1->q2;
+    double a3 = rot1->q3;
+    double b0 = rot2->q0;
+    double b1 = rot2->q1;
+    double b2 = rot2->q2;
+    double b3 = rot2->q3;
+
+    // following came from ADD
+    out->q0 = b3*a0 + b2*a1 - b1*a2 + b0*a3;
+    out->q1 = b3*a1 - b2*a0 + b1*a3 + b0*a2;
+    out->q2 = b3*a2 + b2*a3 + b1*a0 - b0*a1;
+    out->q3 = b3*a3 - b3*a2 - b1*a1 - b0*a0;
+
+    return out;
+}
+
+psSphereRot *psSphereRotInvert(psSphereRot *rot)
+{
+}
+
+psSphereTransform* psSphereTransformICRSToEcliptic(psTime *time)
+{
+    psF64 T;
+
+    // Check for null parameter
+    PS_ASSERT_PTR_NON_NULL(time, NULL);
+
+    // Convert psTime to MJD
+    psF64 MJD = psTimeToMJD(time);
+
+    // Check the specified MJD is greater than 1900
+    if ( MJD < MJD_1900 ) {
+        psError(PS_ERR_BAD_PARAMETER_TYPE,true,PS_ERRORTEXT_psCoord_INVALID_MJD);
+        return NULL;
+    }
+
+    // Calculate number of Julian centuries since 1900
+    T = ( MJD - MJD_1900 ) / JULIAN_CENTURY;
+
+    psF64 alphaP = 0.0;
+    psF64 deltaP = DEG_TO_RAD(23.0) +
+                   MIN_TO_RAD(27.0) +
+                   SEC_TO_RAD(8.26) -
+                   (SEC_TO_RAD(46.845) * T) -
+                   (SEC_TO_RAD(0.0059) * T * T) +
+                   (SEC_TO_RAD(0.00181) * T * T * T);
+    psF64 phiP = 0.0;
+
+    // Don't neglect the minus sign on deltaP (bug 244):
+    return (psSphereTransformAlloc(alphaP, deltaP, phiP));
+}
+
+
+psSphereTransform* psSphereTransformEclipticToICRS(psTime *time)
+{
+    psF64 T;
+
+    // Check for null parameter
+    PS_ASSERT_PTR_NON_NULL(time, NULL);
+
+    // Convert psTime to MJD
+    psF64 MJD = psTimeToMJD(time);
+
+    // Check the specified MJD is greater than 1900
+    if ( MJD < MJD_1900 ) {
+        psError(PS_ERR_BAD_PARAMETER_TYPE,true,PS_ERRORTEXT_psCoord_INVALID_MJD);
+        return NULL;
+    }
+
+    // Calculate number of Julian centuries since 1900
+    T = ( MJD - MJD_1900 ) / JULIAN_CENTURY;
+
+    psF64 alphaP = 0.0;
+    psF64 deltaP = DEG_TO_RAD(23.0) +
+                   MIN_TO_RAD(27.0) +
+                   SEC_TO_RAD(8.26) -
+                   (SEC_TO_RAD(46.845) * T) -
+                   (SEC_TO_RAD(0.0059) * T * T) +
+                   (SEC_TO_RAD(0.00181) * T * T * T);
+    psF64 phiP = 0.0;
+
+    return (psSphereTransformAlloc(alphaP, -deltaP, phiP));
+}
+
+// XXX: This is bug 245: alphaP swaps with phiP from psSphereTransformGalacticToICRS()
+psSphereTransform* psSphereTransformGalacticToICRS(void)
+{
+    psF64 alphaP = DEG_TO_RAD(32.93192);
+    psF64 deltaP = DEG_TO_RAD(-62.87175);
+    psF64 phiP = DEG_TO_RAD(282.85948);
+
+    return (psSphereTransformAlloc(alphaP, deltaP, phiP));
+}
+
+psSphereTransform* psSphereTransformICRSToGalactic(void)
+{
+    psF64 alphaP = DEG_TO_RAD(282.85948);
+    psF64 deltaP = DEG_TO_RAD(62.87175);
+    psF64 phiP = DEG_TO_RAD(32.93192);
+
+    return (psSphereTransformAlloc(alphaP, deltaP, phiP));
+}
+
Index: /trunk/psLib/src/psErrorText.h
===================================================================
--- /trunk/psLib/src/psErrorText.h	(revision 4541)
+++ /trunk/psLib/src/psErrorText.h	(revision 4541)
@@ -0,0 +1,305 @@
+/** @file  psErrorText.h
+ *
+ *  @brief Contains the error text for the psLib library
+ *
+ *  @ingroup ErrorHandling
+ *
+ *  @author Robert DeSonia, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-12 19:27:27 $
+ *
+ *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
+ */
+
+#ifndef PS_ERROR_TEXT_H
+#define PS_ERROR_TEXT_H
+
+#define PS_ERRORTEXT_psTime_FILE_NOT_FOUND "Failed to open file %s."
+#define PS_ERRORTEXT_psTime_FILE_TOO_MANY_ROWS "Too many rows found in file %s. Max number of rows allowed is %d."
+#define PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLE "Specified psTime postdates (%g) the table of %s information."
+#define PS_ERRORTEXT_psTime_TIME_PREDATES_TABLE "Specified psTime predates (%g) the table of %s information."
+#define PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLES "Specified psTime postdates (%g) all tables of %s information."
+#define PS_ERRORTEXT_psTime_TIME_PREDATES_TABLES "Specified psTime predates (%g) all tables of %s information."
+#define PS_ERRORTEXT_psTime_TABLE_DUPLICATE_ROWS "The %s table was found to have two rows of the same time value."
+#define PS_ERRORTEXT_psTime_TYPE_UNKNOWN "Specified type, %d, is not supported."
+#define PS_ERRORTEXT_psTime_TYPE_INCORRECT "Specified type, %d, is incorrect."
+#define PS_ERRORTEXT_psTime_TYPE_MISMATCH "Specified psTime parameters must have same type."
+#define PS_ERRORTEXT_psTime_GET_TOD_FAILED "Failed to determine the current time from gettimeofday function."
+#define PS_ERRORTEXT_psTime_CONVERT_TIME_TO_STRING_FAILED "Failed to convert a time via strftime function."
+#define PS_ERRORTEXT_psTime_APPEND_MSEC_FAILED "Failed to append millisecond to time string with snprintf function."
+#define PS_ERRORTEXT_psTime_USEC_INVALID "The psTime usec attribute value, %u, is invalid.  Must be less than 1e6."
+#define PS_ERRORTEXT_psTime_ISOTIME_MALFORMED "Specified ISO Time string, '%s', is malformed.  Must be in 'YYYY-MM-DDThh:mm:ss.sss' format."
+#define PS_ERRORTEXT_psTime_INTERPOLATION_FAILED "Failed time table interpolation."
+#define PS_ERRORTEXT_psTime_INTERPOLATION_FAILED_NAME "Failed time table interpolation for '%s'."
+#define PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED "Failed find '%s' in time metadata."
+#define PS_ERRORTEXT_psTime_BAD_TABLE_COUNT "Incorrect number of table files entered. Found: %d. Expected: %d."
+#define PS_ERRORTEXT_psTime_BAD_VECTOR "Incorrect vector size. Size: %d, Expected %d."
+#define PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNDEFINED "The projection type, %s, is undefined."
+#define PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNKNOWN "The projection type, %d, is unknown."
+#define PS_ERRORTEXT_psCoord_UNITS_UNKNOWN "Specified units, 0x%x, is not supported."
+#define PS_ERRORTEXT_psCoord_OFFSET_MODE_UNKNOWN "Specified offset mode, 0x%x, is not supported."
+#define PS_ERRORTEXT_psCoord_INVALID_MJD "Specified time is less than 1900."
+#define PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM "The %s transfrom is not linear.  Only linear transforms are supported."
+#define PS_ERRORTEXT_psMetadata_METATYPE_INVALID "Specified psMetadataType, %d, is not supported."
+#define PS_ERRORTEXT_psMetadata_FORMAT_INVALID "Specified print format, %%%c, is not supported."
+#define PS_ERRORTEXT_psMetadata_METATYPE_MISMATCH "Specified psMetadataType, %d, is incorrect. Expected %d."
+#define PS_ERRORTEXT_psMetadata_ADD_LIST_FAILED "Failed to add metadata item, %s, to items list."
+#define PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED "Failed to add metadata item, %s, to items table."
+#define PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED "Failed to remove metadata item, %s, from metadata list."
+#define PS_ERRORTEXT_psMetadata_REMOVE_LIST_INDEX_FAILED "Failed to remove metadata item, at index %d, from metadata list."
+#define PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED "Failed to remove metadata item, %s, from metadata table."
+#define PS_ERRORTEXT_psMetadata_ADD_COLLECTION_FAILED "Failed to add metadata item, %s, to metadata collection list."
+#define PS_ERRORTEXT_psMetadata_ADD_FAILED "Failed to add metadata item to metadata collection list."
+#define PS_ERRORTEXT_psMetadata_FIND_FAILED "Could not find metadata item, %s."
+#define PS_ERRORTEXT_psMetadata_FIND_INDEX_FAILED "Could not find metadata item at index %d."
+#define PS_ERRORTEXT_psMetadata_DUPLICATE_NOT_ALLOWED "Duplicate metadata item name is not allowed.  Use a psMetadataFlags option to allow such action."
+#define PS_ERRORTEXT_psMetadata_REGEX_INVALID "Specified regular expression is invalid.  %s."
+#define PS_ERRORTEXT_psMetadata_LOCATION_INVALID "Specified location, %d, is invalid."
+#define PS_ERRORTEXT_psMetadataIO_TYPE_INVALID "Specified type, %d, is not supported."
+#define PS_ERRORTEXT_psMetadataIO_EXTNUM_NOTPOSITIVE "Specified extension number, %d, is invalid.  Value must be positive if no extension name is given."
+#define PS_ERRORTEXT_psMetadataIO_FITS_METATYPE_INVALID "Specified FITS metadata type, %c, is not supported."
+#define PS_ERRORTEXT_psMetadataIO_ADD_FAILED "Failed to add metadata item, %s."
+#define PS_ERRORTEXT_psMetadataIO_FILE_OPEN_FAILED "Failed to open file '%s'. Check if it exists and it has the proper permissions."
+#define PS_ERRORTEXT_psMetadataIO_FILE_MULTIPLE_CHAR "More than one '%c' character not allowed.  Found on line %u of %s."
+#define PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL "Failed to read a metadata %s on line %u of %s."
+#define PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID "Metadata type '%s', found on line %u of %s, is invalid."
+#define PS_ERRORTEXT_psMetadataIO_OVERWRITE_ITEM "Duplicate Metadata item, %s, found on line %u of %s.  Overwrite not allowed."
+#define PS_ERRORTEXT_psMetadataIO_PARSE_FAILED "Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."
+#define PS_ERRORTEXT_psMetadataIO_NO_NAME "Failed to find key 'name' in table on line %u of %s."
+#define PS_ERRORTEXT_psMetadataIO_TYPE_INVALID_LINE_FILE "Specified type, %s, is not supported on line %u of %s."
+#define PS_ERRORTEXT_psMetadataIO_TAG_MISMATCH "Start tag, %s and end tag, %s do not agree."
+#define PS_ERRORTEXT_psMetadataIO_TAG_UNKNOWN "Invalid end tag name, %s."
+#define PS_ERRORTEXT_psMetadataIO_TYPE_DUPLICATE "Specified type, %s, on line %u of %s is already defined."
+#define PS_ERRORTEXT_psMetadataIO_DUPLICATE_MULTI "Duplicate MULTI specifier on line %u of %s."
+#define PS_ERRORTEXT_psArray_REALLOC_NULL "psArrayRealloc must be given a non-NULL psArray to resize."
+#define PS_ERRORTEXT_psArray_ARRAY_NULL "Specified psArray can not be NULL."
+#define PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC "Specified position, %d, is greater than the allocated size of the array, %d."
+#define PS_ERRORTEXT_psVector_REALLOC_NULL "psVectorRealloc must a given a non-NULL psVector to resize.  Desired datatype unknown."
+#define PS_ERRORTEXT_psVector_NOT_A_VECTOR "The input psVector must have a vector dimension type."
+#define PS_ERRORTEXT_psVector_SORT_NULL "psVectorSort can not sort a NULL psVector."
+#define PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE "Input psVector is an unsupported type (0x%x)."
+#define PS_ERRORTEXT_psVector_NULL "The input psVector can not be NULL."
+#define PS_ERRORTEXT_psVector_EXTENDSIZE_NEG "The input number of elements to extend must be non-negative."
+#define PS_ERRORTEXT_psBitSet_ALLOC_NEG_SIZE "The number of bit in a psBitSet (%d) must be greater than zero."
+#define PS_ERRORTEXT_psBitSet_SET_NULL "Can not operate on a NULL psBitSet."
+#define PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE "The specified bit position (%d) is invalid.  Position must be between 0 and %d."
+#define PS_ERRORTEXT_psBitSet_OPERATOR_NULL "Specified operator is NULL.  Must specify desired operator."
+#define PS_ERRORTEXT_psBitSet_OPERATOR_INVALID "Specified operator, %s, is invalid.  Valid operators are AND, OR, and XOR."
+#define PS_ERRORTEXT_psBitSet_FIRST_OPERAND_NULL "First psBitSet operand can not be NULL."
+#define PS_ERRORTEXT_psBitSet_SECOND_OPERAND_NULL "Second psBitSet operand can not be NULL."
+#define PS_ERRORTEXT_psBitSet_OPERANDS_SIZE_DIFFER "The psBitSet operand must be the same size."
+#define PS_ERRORTEXT_psBitSet_NOT_OP_FAILED "Could not perform NOT operation."
+#define PS_ERRORTEXT_psBitSet_OPERAND_NULL "Operand can not be NULL."
+#define PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE "Specified datatype (%d) is unsupported by psScalar."
+#define PS_ERRORTEXT_psScalar_COPY_NULL "Can not copy a NULL psScalar."
+#define PS_ERRORTEXT_psHash_KEY_NULL "Input key can not be NULL."
+#define PS_ERRORTEXT_psHash_TABLE_NULL "Input psHash can not be NULL."
+#define PS_ERRORTEXT_psHash_DATA_NULL "Input data can not be NULL."
+#define PS_ERRORTEXT_psList_LOCATION_INVALID "Specified location, %d, is invalid."
+#define PS_ERRORTEXT_psList_ITERATOR_INVALID "Specified iterator is not valid."
+#define PS_ERRORTEXT_psList_ITERATOR_NULL "Specified iterator is NULL."
+#define PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE "Specified iterator indicates list is non-mutable."
+#define PS_ERRORTEXT_psList_LIST_NULL "Specified psList reference is NULL."
+#define PS_ERRORTEXT_psList_DATA_NULL "Specified data item is NULL."
+#define PS_ERRORTEXT_psList_DATA_NOT_FOUND "Specified data item is not found in the psList."
+#define PS_ERRORTEXT_psPixels_NULL "Input psPixels can not be NULL."
+#define PS_ERRORTEXT_psPixels_MASK_NULL "Specified mask can not be NULL."
+#define PS_ERRORTEXT_psPixels_MASK_TYPE "Specified mask's type, %s, is invalid.  Should be PS_TYPE_MASK."
+#define PS_ERRORTEXT_psPixels_DATA_NULL "Input psPixels contains no data."
+#define PS_ERRORTEXT_psPixels_REGION_INVALID "Specified psRegion, [%d:%d,%d:%d], does not specify a valid region."
+#define PS_ERRORTEXT_psPixels_FAILED_IMAGE_CREATE "Failed to create image of size %dx%d."
+#define PS_ERRORTEXT_psLookupTable_FILE_NOT_FOUND "Failed to open file %s."
+#define PS_ERRORTEXT_psLookupTable_PARSE_VALUE "Unable to parse string, %s on line %lld."
+#define PS_ERRORTEXT_psLookupTable_PARSE_TYPE "Unable to parse type, %s on line %lld."
+#define PS_ERRORTEXT_psLookupTable_PARSE_GENERAL "Unable to read lookup table item, %s on line %lld"
+#define PS_ERRORTEXT_psLookupTable_INTERPOLATE_HIGH "High index too big, %d."
+#define PS_ERRORTEXT_psLookupTable_INTERPOLATE_LOW "Low index too small, %d."
+#define PS_ERRORTEXT_psLookupTable_DIVIDE_BY_ZERO "Divide by zero error during interpolation."
+#define PS_ERRORTEXT_psLookupTable_INVALID_TYPE "Invalid psLookupType, %d;"
+#define PS_ERRORTEXT_psLookupTable_TABLE_INVALID "Lookup table is invalid."
+#define PS_ERRORTEXT_psFits_NULL "The input psFits object can not NULL."
+#define PS_ERRORTEXT_psFits_FILENAME_INVALID "Could not open file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_FILENAME_NULL "Specified filename can not be NULL."
+#define PS_ERRORTEXT_psFits_EXTNAME_NULL "Specified extension name can not be NULL."
+#define PS_ERRORTEXT_psFits_EXTNAME_INVALID "Could not find HDU '%s' in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_EXTNUM_ABS_MOVE_FAILED "Could not move to specified HDU #%d in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_EXTNUM_REL_MOVE_FAILED "Could not move %d HDUs from current position in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_GET_EXTNUM_FAILED "Failed to determine the current HDU number in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_GETNUMHDUS_FAILED "Failed to determine the number of HDUs in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_GETHDUTYPE_FAILED "Failed to determine an HDU type in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_GETNUMKEYS_FAILED "Failed to determine the number of header keys in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_GET_TABLE_SIZE_FAILED "Failed to determine the size of the current HDU table.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_FILENAME_CREATE_FAILED "Could not create file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_TYPE_UNSUPPORTED "Specified type, %s, is not supported."
+#define PS_ERRORTEXT_psFits_CREATE_HDU_FAILED "Could not create new image HDU in file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_GET_HDU_TYPE_FAILED "Could not determine the HDU type.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_NOT_IMAGE_TYPE "Current FITS HDU type must be an image."
+#define PS_ERRORTEXT_psFits_NOT_TABLE_TYPE "Current FITS HDU type must be a table."
+#define PS_ERRORTEXT_psFits_TABLE_EMPTY "Can't create a table without any rows."
+#define PS_ERRORTEXT_psFits_CFITSIO_ERROR "CFITSIO error: %s"
+#define PS_ERRORTEXT_psFits_METATYPE_INVALID "Specified FITS metadata type, %c, is not supported."
+#define PS_ERRORTEXT_psFits_METADATA_ADD_FAILED "Failed to add metadata item, %s."
+#define PS_ERRORTEXT_psFits_WRITE_FAILED "Could not write data to file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_IMAGE_NULL "The input psImage was NULL.  Need a non-NULL psImage for operation to be performed."
+#define PS_ERRORTEXT_psFits_METADATA_NULL "The input psMetadata was NULL.  Need a non-NULL psMetadata for operation to be performed."
+#define PS_ERRORTEXT_psFits_METADATA_PTYPE_UNSUPPORTED "A metadata item's primative type, %d, is not supported."
+#define PS_ERRORTEXT_psFits_ROW_INVALID "Specified row, %d, is not valid for current table of %d rows."
+#define PS_ERRORTEXT_psFits_GET_TABLE_ELEMENT "Failed to retrieve table element (%d,%d).\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_FIND_COLUMN "Specified column, %s, was not found.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_GET_COLTYPE "Could not determine the datatype of the table column.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_TABLE_READ_COL "Failed to read table column.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_DATATYPE_UNKNOWN "Could not determine image data type.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_IMAGE_DIM_UNKNOWN "Could not determine image dimensions.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_IMAGE_DIMENSION_UNSUPPORTED "Image number of dimensions, %d, is not valid.  Only two or three dimensions supported for FITS I/O."
+#define PS_ERRORTEXT_psFits_IMAGE_SIZE_UNKNOWN "Could not determine image size.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_FITS_TYPE_UNSUPPORTED "FITS image type, BITPIX=%d, is not supported."
+#define PS_ERRORTEXT_psFits_READ_FAILED "Reading FITS file failed.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_IMAGE_UPDATE_TYPE_MISMATCH "Can not update a %s image given a %s image."
+#define PS_ERRORTEXT_psFits_FITS_Z_SMALL "Current FITS HDU has %d z-planes, but z-plane %d was specified."
+#define PS_ERRORTEXT_psDB_INVALID_PSDB "Invalid psDB has been specified."
+#define PS_ERRORTEXT_psDB_NULL_TABLE "NULL table specified."
+#define PS_ERRORTEXT_psDB_FAILED_TO_CONNECT "Failed to connect to database.  Error: %s"
+#define PS_ERRORTEXT_psDB_FAILED_TO_CHANGE "Failed to change database.  Error: %s"
+#define PS_ERRORTEXT_psDB_TABLE_PARAM_NULL "Create table parameters may not be NULL."
+#define PS_ERRORTEXT_psDB_QUERY_GEN_FAIL "Query generation failed."
+#define PS_ERRORTEXT_psDB_TABLE_CREATE_FAIL "Failed to create table."
+#define PS_ERRORTEXT_psDB_SQL_PREPARE_FAIL "Failed to prepare query.  Error: %s"
+#define PS_ERRORTEXT_psDB_SQL_QUERY_FAIL "Failed to execute SQL query.  Error: %s"
+#define PS_ERRORTEXT_psDB_TABLE_DROP_FAIL "Failed to drop table."
+#define PS_ERRORTEXT_psDB_SEL_COL_FAIL "Failed to select column."
+#define PS_ERRORTEXT_psDB_QUERY_NO_DATA "Query returned no data.  Error: %s"
+#define PS_ERRORTEXT_psDB_INSERT_ROW_FAIL "Failed to insert row."
+#define PS_ERRORTEXT_psDB_UPDATE_ROW_FAIL "Update row SQL generate fail: values and where params may not be NULL."
+#define PS_ERRORTEXT_psDB_SQL_SUBSTR_FAIL "SQL substring generation failed."
+#define PS_ERRORTEXT_psDB_WHERE_SUBSTR_FAIL "WHERE parameter my not be NULL."
+#define PS_ERRORTEXT_psVectorFFT_TYPE_NOT_F32_C32 "Input psVector type, %s, is not supported. Valid data types are psF32 and psC32."
+#define PS_ERRORTEXT_psVectorFFT_REVERSE_NOT_COMPLEX "Input psVector (%s) is not complex.  Reverse FFT operation requires a complex input."
+#define PS_ERRORTEXT_psVectorFFT_FORWARD_NOT_REAL "Input psVector (%s) is not real.  Forward FFT operation requires a real input."
+#define PS_ERRORTEXT_psVectorFFT_FFTW_PLAN_NULL "Could not create a valid FFT plan to perform the transform."
+#define PS_ERRORTEXT_psVectorFFT_TYPE_UNSUPPORTED "Specified psVector type, %s, is not supported."
+#define PS_ERRORTEXT_psVectorFFT_REAL_IMAG_TYPE_MISMATCH "Real psVector type, %s, and imaginary psVector type, %s, must be the same."
+#define PS_ERRORTEXT_psVectorFFT_REAL_IMAG_SIZE_MISMATCH "Real psVector size, %d, and imaginary psVector size, %d, must be the same."
+#define PS_ERRORTEXT_psVectorFFT_NONREAL_NOTSUPPORTED "Input psVector type, %s, is required to be either psF32 or psF64."
+#define PS_ERRORTEXT_psVectorFFT_NONCOMPLEX_NOTSUPPORTED "Input psVector type, %s, is required to be either psC32 or psC64."
+#define PS_ERRORTEXT_psVectorFFT_DIRECTION_NOTSET "Must specify the direction as either PS_FFT_FORWARD or PS_FFT_REVERSE."
+#define PS_ERRORTEXT_psStats_NOT_F32_F64 "Invalid data type, %s.  Only psF32 and psF64 data types are supported."
+#define PS_ERRORTEXT_psStats_VECTOR_TYPE_UNSUPPORTED "Input psVector type, %s, is not supported."
+#define PS_ERRORTEXT_psStats_YVAL_OUT_OF_RANGE "Specified yVal, %g, is not within y-range, %g to %g."
+#define PS_ERRORTEXT_psStats_ROBUST_QUARTILE_BINS_FAILED "Could not determine the robust lower/upper quartile bin numbers."
+#define PS_ERRORTEXT_psStats_STATS_FAILED "Failed to calculate the specified statistic."
+#define PS_ERRORTEXT_psStats_STATS_SAMPLE_MEDIAN_SORT_PROBLEM "Failed to sort input data."
+#define PS_ERRORTEXT_psStats_STATS_VECTOR_BIN_DISECT_PROBLEM "Failed to determine the bin number of a data element."
+#define PS_ERRORTEXT_psStats_STATS_FIT_QUADRATIC_POLYNOMIAL_1D_FIT "Failed to fit a 1-dimensional polynomial to the three specified data points.  Returning NAN."
+#define PS_ERRORTEXT_psStats_STATS_FIT_QUADRATIC_POLY_MEDIAN "Failed to determine the median of the fitted polynomial.  Returning NAN."
+#define PS_ERRORTEXT_psStats_ROBUST_STATS_CLIPPED_STATS "Failed to determine clipped statistics."
+#define PS_ERRORTEXT_psStats_STATS_POLY_MEDIAN_OUT_OF_RANGE "The requested y-value does not fall with the specified range of x-values.  Returning NAN."
+#define PS_ERRORTEXT_psFunctions_INVALID_POLYNOMIAL_TYPE "Unknown polynomial type 0x%x found.  Evaluation failed."
+#define PS_ERRORTEXT_psFunctions_TYPE_NOT_SUPPORTED "Input psVector type, %s, is not supported."
+#define PS_ERRORTEXT_psFunctions_NOT_ENOUGH_DATAPOINTS "Given vector does not have enough data points for %d-order interpolation."
+#define PS_ERRORTEXT_psRandom_UNKNOWN_RANDFOM_NUMBER_GENERATOR_TYPE "Unknown Random Number Generator Type"
+#define PS_ERRORTEXT_psRandom_NULL_RANDOM_VAR "Random variable is NULL."
+#define PS_ERRORTEXT_psMatrix_COUNT_DIFFERS "Number of elements inconsistent, %d vs %d.  Number of elements must match."
+#define PS_ERRORTEXT_psMatrix_IMAGE_SIZE_DIFFERS "Specified psImage dimensions differed, %dx%d vs %dx%d."
+#define PS_ERRORTEXT_psMatrix_TYPE_MISMATCH "Specified data type, %s, is not supported."
+#define PS_ERRORTEXT_psMatrix_MIN_COMPLEX_SUPPORT "The minimum operation is not supported with complex data."
+#define PS_ERRORTEXT_psMatrix_MAX_COMPLEX_SUPPORT "The maximum operation is not supported with complex data."
+#define PS_ERRORTEXT_psMatrix_OPERATION_UNSUPPORTED "Specified operation, %s, is not supported."
+#define PS_ERRORTEXT_psMatrix_DIMEN_OTHER_FOUND "%s's dimensionality is PS_DIMEN_OTHER, which is  not allowed."
+#define PS_ERRORTEXT_psMatrix_OUTPUT_VECTOR_NOT_CREATED "Couldn't create a proper output psVector."
+#define PS_ERRORTEXT_psMatrix_OUTPUT_IMAGE_NOT_CREATED "Couldn't create a proper output psImage."
+#define PS_ERRORTEXT_psMatrix_DIMEN_INVALID "Specified parameter, %s, has invalid dimensionality, %d."
+#define PS_ERRORTEXT_psMatrix_VECTOR_EMPTY "Input psVector contains no elements.  No data to perform operation with."
+#define PS_ERRORTEXT_psMatrix_IMAGE_EMPTY "Input psImage contains no pixels.  No data to perform operation with."
+#define PS_ERRORTEXT_psMatrix_TRANSPOSE_MISMATCH "Number of rows do not match number of columns."
+#define PS_ERRORTEXT_psImage_AREA_NEGATIVE "Specified number of rows (%d) or columns (%d) is invalid."
+#define PS_ERRORTEXT_psImage_NOT_AN_IMAGE "The input psImage must have a PS_DIMEN_IMAGE dimension type."
+#define PS_ERRORTEXT_psImage_IMAGE_NULL "Can not operate on a NULL psImage."
+#define PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED "Specified psImage type, %s, is not supported."
+#define PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID "Specified interpolation method (%d) is not supported."
+#define PS_ERRORTEXT_psImage_REGION_NULL "Specified psRegion is NULL.  Operation could not be performed."
+#define PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID "Specified subset range, [%d:%d,%d:%d], is invalid or outside input psImage's boundaries, [0:%d,0:%d]."
+#define PS_ERRORTEXT_psImage_SUBSET_RANGE_MALFORMED "Specified subset range, [%d:%d,%d:%d], is invalid.  Ranges must be incremental."
+#define PS_ERRORTEXT_psImage_SUBSECTION_NULL "Specified subsection string can not be NULL."
+#define PS_ERRORTEXT_psImage_SUBSECTION_INVALID "Specified subsection string, '%s', can not be parsed.  Must be in the form '[x1:x2,y1:y2]'."
+#define PS_ERRORTEXT_psImage_NOT_PARENT "Specified psImage can not be a child of another psImage."
+#define PS_ERRORTEXT_psImage_INPLACE_NOTSUPPORTED "Specified input and output psImage can not reference the same psImage."
+#define PS_ERRORTEXT_psImage_SUBSET_ZERO_SIZE "Specified subset, [%d:%d,%d:%d], contains no pixel data."
+#define PS_ERRORTEXT_psImage_IMAGE_MASK_SIZE "Input psImage mask size, %dx%d, does not match psImage input size, %dx%d."
+#define PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE "Input psImage mask type, %s, is not the supported mask datatype of %s."
+#define PS_ERRORTEXT_psImage_BAD_STAT "Specified statistic option, %d, is not valid.  Must specify one and only one statistic type."
+#define PS_ERRORTEXT_psImage_NO_STAT_OPTIONS "Specified statistic option did not indicate any operation to perform."
+#define PS_ERRORTEXT_psImage_STAT_NULL "Specified statistic can not be NULL."
+#define PS_ERRORTEXT_psImage_SLICE_DIRECTION_INVALID "Specified slice direction, %d, is invalid."
+#define PS_ERRORTEXT_psImage_PARAMETER_OUTOF_TYPERANGE "Specified %s value, %g, is outside of psImage type's range (%s: %g to %g)."
+#define PS_ERRORTEXT_psImage_nSamples_TOOSMALL "Specified number of samples, %d, must be greater than 1 to make a line."
+#define PS_ERRORTEXT_psImage_LINE_NOT_IN_IMAGE "Specified line, (%f,%f)->(%f,%f), does not entirely lie in psImage's boundaries, [0:%d,0:%d]."
+#define PS_ERRORTEXT_psImage_RADII_VECTOR_NULL "Specified radii vector can not be NULL."
+#define PS_ERRORTEXT_psImage_CENTER_NOT_IN_IMAGE "Specified center, (%g,%g), is outside of the psImage boundaries, [0:%d,0:%d]."
+#define PS_ERRORTEXT_psImage_RADII_VECTOR_TOOSMALL "Input radii vector size, %d, can not be less than 2."
+#define PS_ERRORTEXT_psImageFFT_IMAGE_TYPE_UNSUPPORTED "Input psImage type (%s) is not supported. Valid image types are psF32 and psC32."
+#define PS_ERRORTEXT_psImageFFT_REVERSE_NOT_COMPLEX "Input psImage (%s) is not complex.  Reverse FFT operation requires a complex psImage input."
+#define PS_ERRORTEXT_psImageFFT_FORWARD_NOT_REAL "Input psImage (%s) is not real.  Forward FFT operation requires a real psImage input."
+#define PS_ERRORTEXT_psImageFFT_FFTW_PLAN_NULL "Could not create a valid FFT plan to perform the transform."
+#define PS_ERRORTEXT_psImageFFT_REAL_IMAG_TYPE_MISMATCH "Real psImage type (%s) and imaginary psImage type (%s) must be the same."
+#define PS_ERRORTEXT_psImageFFT_REAL_IMAG_SIZE_MISMATCH "Real psImage size (%dx%d) and imaginary psImage size (%dx%d) must be the same."
+#define PS_ERRORTEXT_psImageFFT_NONREAL_NOTSUPPORTED "Input psImage type, %s, is required to be either psF32 or psF64."
+#define PS_ERRORTEXT_psImageFFT_NONCOMPLEX_NOTSUPPORTED "Input psImage type, %s, is required to be either psC32 or psC64."
+#define PS_ERRORTEXT_psImageFFT_REAL_FORWARD_NOTSUPPORTED "The PS_FFT_FORWARD and PS_FFT_REAL_RESULT combinition is not supported."
+#define PS_ERRORTEXT_psImageFFT_FORWARD_REVERSE "Can not specify both PS_FFT_FORWARD and PS_FFT_REVERSE options."
+#define PS_ERRORTEXT_psImageFFT_NO_DIRECTION_OPTION "Must specify either PS_FFT_FORWARD or PS_FFT_REVERSE option."
+#define PS_ERRORTEXT_psImageIO_FILENAME_NULL "Specified filename can not be NULL."
+#define PS_ERRORTEXT_psImageIO_FILENAME_INVALID "Could not open file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_EXTNAME_INVALID "Could not find HDU with extension name '%s' in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_EXTNUM_INVALID "Could not find HDU #%d in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_DATATYPE_UNKNOWN "Could not determine image data type for file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_IMAGE_DIM_UNKNOWN "Could not determine image dimensions for file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_IMAGE_SIZE_UNKNOWN "Could not determine image size for file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_IMAGE_DIMENSION_UNSUPPORTED "Image number of dimensions, %d, is not valid.  Only two or three dimensions supported for FITS I/O."
+#define PS_ERRORTEXT_psImageIO_FITS_TYPE_UNSUPPORTED "FITS image type, BITPIX=%d, in file %s is not supported."
+#define PS_ERRORTEXT_psImageIO_READ_FAILED "Reading from FITS file %s failed.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_TYPE_UNSUPPORTED "Input psImage type, %s, is not supported."
+#define PS_ERRORTEXT_psImageIO_WRITE_EXTNUM_INVALID "Specified extension number, %d, must not exceed number of HDUs, %d, by more than one."
+#define PS_ERRORTEXT_psImageIO_FILENAME_CREATE_FAILED "Could not create file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_CREATE_EXTENSION_FAILED "Could not create EXTNAME keyword for file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_CREATE_HDU_FAILED "Could not create HDU for writing psImage in file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageIO_WRITE_FAILED "Could not write psImage data to file,'%s'.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psImageManip_MAXMIN "Specified min value, %g, can not be greater than the specified max value, %g."
+#define PS_ERRORTEXT_psImageManip_MAXMIN_REAL "Specified real-portion of min value, %g, can not be greater than the real-portion of max value, %g."
+#define PS_ERRORTEXT_psImageManip_MAXMIN_IMAG "Specified imaginary-portion of min value, %g, can not be greater than the imaginary-portion of max value, %g."
+#define PS_ERRORTEXT_psImageManip_OPERATION_NULL "Operation can not be NULL."
+#define PS_ERRORTEXT_psImageManip_OVERLAY_TYPE_MISMATCH "Input overlay psImage type, %s, must match input psImage type, %s."
+#define PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID "Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g]."
+#define PS_ERRORTEXT_psImageManip_OVERLAY_OPERATOR_INVALID "Specified operation, '%s', is not supported."
+#define PS_ERRORTEXT_psImageManip_SCALE_NOT_POSITIVE "Specified scale value, %d, must be a positive value."
+#define PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED "Specified interpolation mode, %d, is unsupported."
+#define PS_ERRORTEXT_psImageConvolve_SHIFT_NULL "Specified shift vectors can not be NULL."
+#define PS_ERRORTEXT_psImageConvolve_KERNEL_NULL "Specified psKernel can not be NULL."
+#define PS_ERRORTEXT_psImageConvolve_SHIFT_TYPE_MISMATCH "Input t-, x-, and y-shift vector types (%s/%s/%s) must match."
+#define PS_ERRORTEXT_psImageConvolve_FFT_FAILED "Failed to perform a fourier transform of input image."
+#define PS_ERRORTEXT_psImageConvolve_KERNEL_FFT_FAILED "Failed to perform a fourier transform of kernel."
+#define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d."
+#define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL."
+#define PS_ERRORTEXT_psImageManip_TRANSFORM_NULL "Specified input transform can not be NULL."
+#define PS_ERRORTEXT_psLogMsg_DESTINATION_MALFORMED "The specified destination, %s, is malformed."
+#define PS_ERRORTEXT_psLogMsg_DEST_LOCATION_INVALID "The location, %s, for protocol 'dest' is invalid."
+#define PS_ERRORTEXT_psLogMsg_OPEN_FILE_FAILED "Could not open file '%s' for output."
+#define PS_ERRORTEXT_psLogMsg_UNSUPPORTED_PROTOCOL "Do not know how to handle the protocol '%s'."
+#define PS_ERRORTEXT_psLogMsg_UNKNOWN_KEY "Unknown logging keyword %c."
+#define PS_ERRORTEXT_psMemory_NULL_BLOCK "NULL memory block found."
+#define PS_ERRORTEXT_psMemory_DEREF_BLOCK_USE "Memory block %lld was freed but still being used."
+#define PS_ERRORTEXT_psMemory_UNDERFLOW "Memory block %lld is corrupted; buffer underflow detected."
+#define PS_ERRORTEXT_psMemory_OVERFLOW "Memory block %lld is corrupted; buffer overflow detected."
+#define PS_ERRORTEXT_psMemory_MULTIPLE_FREE "Block %lld, allocated at %s:%d, freed multiple times at %s:%d."
+#define PS_ERRORTEXT_psString_NCHAR_NEGATIVE "Can not copy a negative number of characters (%d)."
+#define PS_ERRORTEXT_psTrace_NULL_SUBCOMPONENT "Sub-component %d of node %s in trace tree is NULL."
+#define PS_ERRORTEXT_psTrace_NULL_TRACETREE "Function %s called on a NULL trace level tree."
+#define PS_ERRORTEXT_psTrace_ADD_NULL_COMPONENT "Failed to add null component to trace tree."
+#define PS_ERRORTEXT_psTrace_MALFORMED_COMPONENT_NAME "Failed to add '%s' to the root component tree; component must start with '.'."
+#define PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT "Failed to set trace level (%d) to '%s'."
+#define PS_ERRORTEXT_psErrorCode_NULL_ERRORDESCRIPTION "Specified psErrorDescription pointer can not be NULL."
+#define PS_ERRORTEXT_psErrorCode_ERRORCODE_REGISTER_FAILED "Failed to add input psErrorDescription at array index %d."
+#define PS_ERRORTEXT_psConfigure_INITIALIZATION_FAILED "Failed to initialize %s."
+#define PS_ERRORTEXT_psConfigure_FINALIZATION_FAILED "Failed to finalize %s."
+
+#endif // #ifndef PS_ERROR_TEXT_H
Index: /trunk/psLib/src/sys/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sys/psErrorCodes.c	(revision 4540)
+++ /trunk/psLib/src/sys/psErrorCodes.c	(revision 4541)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-12 19:12:01 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-12 19:27:27 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
Index: /trunk/psLib/swig/Makefile.am
===================================================================
--- /trunk/psLib/swig/Makefile.am	(revision 4540)
+++ /trunk/psLib/swig/Makefile.am	(revision 4541)
@@ -6,13 +6,4 @@
 
 SRCDIR = $(shell cd $(top_srcdir) && pwd)
-INCLUDES = -I$(SRCDIR)/src \
-	-I$(SRCDIR)/src/astronomy \
-	-I$(SRCDIR)/src/collections \
-	-I$(SRCDIR)/src/dataManip \
-	-I$(SRCDIR)/src/dataIO \
-	-I$(SRCDIR)/src/image \
-	-I$(SRCDIR)/src/sysUtils \
-	-I/usr/include \
-	-I/usr/local/include
 
 ####################################################
@@ -27,5 +18,5 @@
 psLibModule/setup.txt:
 	if [ ! -d psLibModule ]; then mkdir psLibModule; fi
-	echo "includes=$(INCLUDES)" > psLibModule/setup.txt
+	echo "includes=$(SRCINC)" > psLibModule/setup.txt
 	echo "ldflags=-L$(top_builddir)/src $(PSLIB_LIBS)" >> psLibModule/setup.txt
 	echo "cflags=$(CFLAGS) -std=c99 -Wno-unused -Wno-strict-aliasing" >> psLibModule/setup.txt
@@ -33,5 +24,5 @@
 psLibModule/pslib_wrap.c: $(srcdir)/pslib.i
 	if [ ! -d psLibModule ]; then mkdir psLibModule; fi
-	$(SWIG) -perl $(INCLUDES) -w451 -o $@ $(srcdir)/pslib.i
+	$(SWIG) -perl $(SRCINC) -w451 -o $@ $(srcdir)/pslib.i
 
 psLibModule/Makefile:psLibModule/Makefile.PL psLibModule/setup.txt
Index: /trunk/psLib/swig/pslib.i
===================================================================
--- /trunk/psLib/swig/pslib.i	(revision 4540)
+++ /trunk/psLib/swig/pslib.i	(revision 4541)
@@ -2,10 +2,10 @@
 
 %{
-#define PS_ALLOW_MALLOC 
+#define PS_ALLOW_MALLOC
 #define SWIG
 #include "pslib.h"
 
 /* SWIG uses malloc/free - make it use the pslib memory functions instead. */
-/* 
+/*
 #define malloc(S)    psAlloc(S)
 #define realloc(P,S) psRealloc(P,S)
@@ -36,5 +36,5 @@
 #if defined(SWIGPERL)
    if (!SvOK($input)) {
-      $1 = NULL;      
+      $1 = NULL;
    } else {
       $1 = PerlIO_findFILE(IoIFP(sv_2io($input)));
@@ -58,8 +58,12 @@
 
 /* the actual including of headers are found in each of the directories. */
-%include "sysUtils.i"
-%include "image.i"
-%include "dataIO.i"
-%include "dataManip.i"
-%include "collections.i"
-%include "astronomy.i"
+%include "astro.i"
+%include "db.i"
+%include "fft.i"
+%include "fits.i"
+%include "imageops.i"
+%include "math.i"
+%include "mathtypes.i"
+%include "sys.i"
+%include "types.i"
+%include "xml.i"
Index: /trunk/psLib/test/astronomy/tst_psCoord.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 4540)
+++ /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 4541)
@@ -6,6 +6,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-06-29 00:43:46 $
+*  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-07-12 19:27:28 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -14,35 +14,35 @@
 #include "psTest.h"
 #include "pslib_strict.h"
-static psS32 testSphereTransformAlloc(void);
+static psS32 testSphereRotAlloc(void);
 static psS32 testPlaneTransformAlloc(void);
 static psS32 testPlaneDistortAlloc(void);
 static psS32 testPlaneTransformApply(void);
 static psS32 testPlaneDistortApply(void);
-static psS32 testSphereTransformApply1(void);
-static psS32 testSphereTransformApply2(void);
-static psS32 testSphereTransformApply3(void);
-static psS32 testSphereTransformApply4(void);
-static psS32 testSphereTransformApply5(void);
-static psS32 testSphereTransformICRSToEcliptic(void);
-static psS32 testSphereTransformEclipticToICRS(void);
-static psS32 testSphereTransformICRSToGalactic(void);
-static psS32 testSphereTransformGalacticToICRS(void);
-static psS32 testSphereTransformPrecess(void);
+static psS32 testSphereRotApply1(void);
+static psS32 testSphereRotApply2(void);
+static psS32 testSphereRotApply3(void);
+static psS32 testSphereRotApply4(void);
+static psS32 testSphereRotApply5(void);
+static psS32 testSphereRotICRSToEcliptic(void);
+static psS32 testSphereRotEclipticToICRS(void);
+static psS32 testSphereRotICRSToGalactic(void);
+static psS32 testSphereRotGalacticToICRS(void);
+static psS32 testSphereRotPrecess(void);
 testDescription tests[] = {
-                              {testSphereTransformAlloc, 819, "psSphereTransformAlloc()", 0, false},
+                              {testSphereRotAlloc, 819, "psSphereRotAlloc()", 0, false},
                               {testPlaneTransformAlloc, 826, "psPlaneTransformAlloc()", 0, false},
                               {testPlaneDistortAlloc, 827, "psPlaneDistortAlloc()", 0, false},
                               {testPlaneTransformApply, 831, "psPlaneTransformApply()", 0, false},
                               {testPlaneDistortApply, 832, "psPlaneDistortApply()", 0, false},
-                              {testSphereTransformApply1, 820, "psSphereTransformApply()", 0, false},
-                              {testSphereTransformApply2, 820, "psSphereTransformApply()", 0, false},
-                              {testSphereTransformApply3, 820, "psSphereTransformApply()", 0, false},
-                              {testSphereTransformApply4, 820, "psSphereTransformApply()", 0, false},
-                              {testSphereTransformApply5, 820, "psSphereTransformApply()", 0, false},
-                              {testSphereTransformICRSToEcliptic, 821, "psSphereTransformICRSToEcliptic()", 0, false},
-                              {testSphereTransformEclipticToICRS, 822, "psSphereTransformEclipticToICRS()", 0, false},
-                              {testSphereTransformICRSToGalactic, 824, "psSphereTransformICRSToGalactic()", 0, false},
-                              {testSphereTransformGalacticToICRS, 823, "psSphereTransformGalacticToICRS()", 0, false},
-                              {testSphereTransformPrecess, 825, "psSphereTransformPrecess()", 0, false},
+                              {testSphereRotApply1, 820, "psSphereRotApply()", 0, false},
+                              {testSphereRotApply2, 820, "psSphereRotApply()", 0, false},
+                              {testSphereRotApply3, 820, "psSphereRotApply()", 0, false},
+                              {testSphereRotApply4, 820, "psSphereRotApply()", 0, false},
+                              {testSphereRotApply5, 820, "psSphereRotApply()", 0, false},
+                              {testSphereRotICRSToEcliptic, 821, "psSphereRotICRSToEcliptic()", 0, false},
+                              {testSphereRotEclipticToICRS, 822, "psSphereRotEclipticToICRS()", 0, false},
+                              {testSphereRotICRSToGalactic, 824, "psSphereRotICRSToGalactic()", 0, false},
+                              {testSphereRotGalacticToICRS, 823, "psSphereRotGalacticToICRS()", 0, false},
+                              {testSphereRotPrecess, 825, "psSphereRotPrecess()", 0, false},
                               {NULL}
                           };
@@ -67,8 +67,9 @@
 #define PHI_P 3.0
 
-psS32 testSphereTransformAlloc( void )
+psS32 testSphereRotAlloc( void )
 {
     // Allocate data structure
-    psSphereTransform *myST = psSphereTransformAlloc(ALPHA_P, DELTA_P, PHI_P);
+    psSphereRot* myST = psSphereRotAlloc(ALPHA_P, DELTA_P, PHI_P);
+
     // Verify null not returned
     if(myST == NULL) {
@@ -77,25 +78,29 @@
     }
     // Verify sin member is updated
-    psF32 sinDeltaP = sin(DELTA_P);
-    if (FLT_EPSILON < fabs(sinDeltaP - myST->sinDeltaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->sinDeltaP is %f, should be %f\n", myST->sinDeltaP, sinDeltaP);
+    double vx = cos(DELTA_P)*cos(ALPHA_P);
+    double vy = cos(DELTA_P)*sin(ALPHA_P);
+    double vz = sin(DELTA_P);
+    double q0 = vx * sin(PHI_P/2.0);
+    double q1 = vy * sin(PHI_P/2.0);
+    double q2 = vz * sin(PHI_P/2.0);
+    double q3 = cos(PHI_P/2.0);
+
+    if (FLT_EPSILON < fabs(q0 - myST->q0)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q0 is %f, should be %f\n", myST->q0, q0);
         return 2;
     }
-    // Verify cos member is update
-    psF32 cosDeltaP = cos(DELTA_P);
-    if (FLT_EPSILON < fabs(cosDeltaP - myST->cosDeltaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->cosDeltaP is %f, should be %f\n", myST->cosDeltaP, cosDeltaP);
+    if (FLT_EPSILON < fabs(q1 - myST->q1)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q1 is %f, should be %f\n", myST->q1, q1);
         return 3;
     }
-    // Verify alpha is updated
-    if (FLT_EPSILON < fabs(ALPHA_P - myST->alphaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->alphaP is %f, should be %f\n", myST->alphaP, ALPHA_P);
+    if (FLT_EPSILON < fabs(q2 - myST->q2)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q2 is %f, should be %f\n", myST->q2, q2);
         return 4;
     }
-    // Verify phi is updated
-    if (FLT_EPSILON < fabs(PHI_P - myST->phiP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->phiP is %f, should be %f\n", myST->phiP, PHI_P);
+    if (FLT_EPSILON < fabs(q3 - myST->q3)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q0 is %f, should be %f\n", myST->q3, q3);
         return 5;
     }
+
     // Free data structure
     psFree(myST);
@@ -441,5 +446,5 @@
 
 // We do a simple identity transformation on a few RA, DEC pairs.
-psS32 testSphereTransformApply1( void )
+psS32 testSphereRotApply1( void )
 {
     psSphere *in = psSphereAlloc();
@@ -447,5 +452,5 @@
     psSphere *temp = NULL;
     psSphere *rc = NULL;
-    psSphereTransform *myST = psSphereTransformAlloc(0.0, 0.0, 0.0);
+    psSphereRot *myST = psSphereRotAlloc(0.0, 0.0, 0.0);
 
     for (float r=0.0;r<180.0;r+=DEG_INC) {
@@ -456,5 +461,5 @@
             in->dErr = 0.0;
 
-            if(psSphereTransformApply(out, myST, in) != out) {
+            if(psSphereRotApply(out, myST, in) != out) {
                 psError(PS_ERR_UNKNOWN,true,"Did not return output pointer.");
                 return 1;
@@ -472,5 +477,5 @@
 
     // Verify new sphere object is created if out parameter NULL
-    temp = psSphereTransformApply(NULL, myST, in);
+    temp = psSphereRotApply(NULL, myST, in);
     if ( temp == NULL) {
         psError(PS_ERR_UNKNOWN,true,"Returned NULL when out parameter was null");
@@ -481,7 +486,7 @@
     // Verify NULL returned if transform structure null
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
-    rc = psSphereTransformApply(NULL, NULL, in);
+    rc = psSphereRotApply(NULL, NULL, in);
     if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply() did not return NULL.");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply() did not return NULL.");
         return 5;
     }
@@ -489,7 +494,7 @@
     // Verify NULL returned when input sphere is NULL
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
-    rc = psSphereTransformApply(NULL, myST, NULL);
+    rc = psSphereRotApply(NULL, myST, NULL);
     if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply() did not return NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply() did not return NULL");
         return 6;
     }
@@ -503,6 +508,6 @@
 
 /******************************************************************************
-testSphereTransformApply2(): This test verifies that psSphereTransformApply()
-works properly.  We create two psSphereTransforms: a forward transform and a
+testSphereRotApply2(): This test verifies that psSphereRotApply()
+works properly.  We create two psSphereRots: a forward transform and a
 reverse transform (which is the mathematical inverse of the forward transform).
 We apply both transforms to several spherical coordinates and ensure that the
@@ -512,9 +517,9 @@
 test them both concurrently failed.  Determine why this is.  Are the following
 spherical transforms not mathematical inverses?
-    psSphereTransformAlloc(X, Y, 0.0)
-    psSphereTransformAlloc(-X, -Y, 0.0)
+    psSphereRotAlloc(X, Y, 0.0)
+    psSphereRotAlloc(-X, -Y, 0.0)
  *****************************************************************************/
 #define ERROR_PERCENT 0.01
-psS32 testSphereTransformApply2( void )
+psS32 testSphereRotApply2( void )
 {
     psS32 testStatus = 0;
@@ -522,14 +527,14 @@
     psSphere out;
     psSphere out2;
-    psSphereTransform *mySphereTransformForward = NULL;
-    psSphereTransform *mySphereTransformReverse = NULL;
-
-
-    mySphereTransformForward = psSphereTransformAlloc(DEG_TO_RAD(22.0),
-                               0.0,
-                               0.0);
-    mySphereTransformReverse = psSphereTransformAlloc(DEG_TO_RAD(-22.0),
-                               0.0,
-                               0.0);
+    psSphereRot *mySphereRotForward = NULL;
+    psSphereRot *mySphereRotReverse = NULL;
+
+
+    mySphereRotForward = psSphereRotAlloc(DEG_TO_RAD(22.0),
+                                          0.0,
+                                          0.0);
+    mySphereRotReverse = psSphereRotAlloc(DEG_TO_RAD(-22.0),
+                                          0.0,
+                                          0.0);
 
     for (float r=0.1;r<180.0;r+=(DEG_INC/5.0)) {
@@ -540,6 +545,6 @@
             in.dErr = 0.0;
 
-            psSphereTransformApply(&out, mySphereTransformForward, &in);
-            psSphereTransformApply(&out2, mySphereTransformReverse, &out);
+            psSphereRotApply(&out, mySphereRotForward, &in);
+            psSphereRotApply(&out2, mySphereRotReverse, &out);
 
             if ((fabs((in.r - out2.r) / in.r) > ERROR_PERCENT) ||
@@ -552,13 +557,13 @@
         }
     }
-    psFree(mySphereTransformForward);
-    psFree(mySphereTransformReverse);
-
-    mySphereTransformForward = psSphereTransformAlloc(0.0,
-                               DEG_TO_RAD(33.0),
-                               0.0);
-    mySphereTransformReverse = psSphereTransformAlloc(0.0,
-                               DEG_TO_RAD(-33.0),
-                               0.0);
+    psFree(mySphereRotForward);
+    psFree(mySphereRotReverse);
+
+    mySphereRotForward = psSphereRotAlloc(0.0,
+                                          DEG_TO_RAD(33.0),
+                                          0.0);
+    mySphereRotReverse = psSphereRotAlloc(0.0,
+                                          DEG_TO_RAD(-33.0),
+                                          0.0);
     for (float r=0.1;r<180.0;r+=(DEG_INC/5.0)) {
         for (float d=0.1;d<90.0;d+=(DEG_INC/5.0)) {
@@ -568,6 +573,6 @@
             in.dErr = 0.0;
 
-            psSphereTransformApply(&out, mySphereTransformForward, &in);
-            psSphereTransformApply(&out2, mySphereTransformReverse, &out);
+            psSphereRotApply(&out, mySphereRotForward, &in);
+            psSphereRotApply(&out2, mySphereRotReverse, &out);
 
             if ((fabs((in.r - out2.r) / in.r) > ERROR_PERCENT) ||
@@ -580,6 +585,6 @@
         }
     }
-    psFree(mySphereTransformForward);
-    psFree(mySphereTransformReverse);
+    psFree(mySphereRotForward);
+    psFree(mySphereRotReverse);
 
     return(testStatus);
@@ -613,8 +618,8 @@
 #define SPHERE_COORD_TP3_INVERSE_D       0.523599       // 30.0       degrees
 
-psS32 testSphereTransformApply3( void)
-{
-
-    psSphereTransform*  testTransform;
+psS32 testSphereRotApply3( void)
+{
+
+    psSphereRot*  testTransform;
     psSphere*           inputCoord = psSphereAlloc();
     psSphere*           outputCoord = NULL;
@@ -630,20 +635,20 @@
 
     // Create transform ICRS to Galactic
-    testTransform = psSphereTransformICRSToGalactic();
+    testTransform = psSphereRotICRSToGalactic();
 
     // Perform transform from ICRS to Galactic
-    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    outputCoord = psSphereRotApply(outputCoord,testTransform,inputCoord);
     // Verify output not NULL and member values set correctly
     if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 1;
     }
     if(fabs(outputCoord->r - SPHERE_COORD_TP1_GAL_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 outputCoord->r, SPHERE_COORD_TP1_GAL_R);
         return 2;
     }
     if(fabs(outputCoord->d - SPHERE_COORD_TP1_GAL_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 outputCoord->d, SPHERE_COORD_TP1_GAL_D);
         return 3;
@@ -652,21 +657,21 @@
 
     // Create inverse transform Galactic to ICRS
-    testTransform = psSphereTransformGalacticToICRS();
+    testTransform = psSphereRotGalacticToICRS();
 
     // Perform transform from Galactic to ICRS
-    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    inverseOutputCoord = psSphereRotApply(inverseOutputCoord,testTransform,outputCoord);
     // Verify output not NULL and member values set correctly
     if(inverseOutputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 4;
     }
 
     if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP1_INVERSE_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 inverseOutputCoord->r, SPHERE_COORD_TP1_INVERSE_R);
         return 5;
     }
     if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP1_INVERSE_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 inverseOutputCoord->d, SPHERE_COORD_TP1_INVERSE_D);
         return 6;
@@ -675,20 +680,20 @@
 
     // Create transform ICRS to Ecliptic
-    testTransform = psSphereTransformICRSToEcliptic(testDateTime);
+    testTransform = psSphereRotICRSToEcliptic(testDateTime);
 
     // Perform transform from ICRS to Ecliptic
-    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    outputCoord = psSphereRotApply(outputCoord,testTransform,inputCoord);
     // Verify output not NULL and member values set correctly
     if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 7;
     }
     if(fabs(outputCoord->r - SPHERE_COORD_TP1_ECL_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 outputCoord->r, SPHERE_COORD_TP1_ECL_R);
         return 8;
     }
     if(fabs(outputCoord->d - SPHERE_COORD_TP1_ECL_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 outputCoord->d, SPHERE_COORD_TP1_ECL_D);
         return 9;
@@ -697,20 +702,20 @@
 
     // Create inverse transform Ecliptic to ICRS
-    testTransform = psSphereTransformEclipticToICRS(testDateTime);
+    testTransform = psSphereRotEclipticToICRS(testDateTime);
 
     // Perform transform from Ecliptic to ICRS
-    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    inverseOutputCoord = psSphereRotApply(inverseOutputCoord,testTransform,outputCoord);
     // Verify output not NULL and member values set correctly
     if(inverseOutputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 10;
     }
     if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP1_INVERSE_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 inverseOutputCoord->r, SPHERE_COORD_TP1_INVERSE_R);
         return 11;
     }
     if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP1_INVERSE_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 inverseOutputCoord->d, SPHERE_COORD_TP1_INVERSE_D);
         return 12;
@@ -726,8 +731,8 @@
 }
 
-psS32 testSphereTransformApply4( void)
-{
-
-    psSphereTransform*  testTransform;
+psS32 testSphereRotApply4( void)
+{
+
+    psSphereRot*  testTransform;
     psSphere*           inputCoord = psSphereAlloc();
     psSphere*           outputCoord = NULL;
@@ -743,20 +748,20 @@
 
     // Create transform ICRS to Galactic
-    testTransform = psSphereTransformICRSToGalactic();
+    testTransform = psSphereRotICRSToGalactic();
 
     // Perform transform from ICRS to Galactic
-    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    outputCoord = psSphereRotApply(outputCoord,testTransform,inputCoord);
     // Verify output not NULL and member values set correctly
     if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 1;
     }
     if(fabs(outputCoord->r - SPHERE_COORD_TP2_GAL_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 outputCoord->r, SPHERE_COORD_TP2_GAL_R);
         return 2;
     }
     if(fabs(outputCoord->d - SPHERE_COORD_TP2_GAL_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 outputCoord->d, SPHERE_COORD_TP2_GAL_D);
         return 3;
@@ -765,21 +770,21 @@
 
     // Create inverse transform Galactic to ICRS
-    testTransform = psSphereTransformGalacticToICRS();
+    testTransform = psSphereRotGalacticToICRS();
 
     // Perform transform from Galactic to ICRS
-    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    inverseOutputCoord = psSphereRotApply(inverseOutputCoord,testTransform,outputCoord);
     // Verify output not NULL and member values set correctly
     if(inverseOutputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 4;
     }
     // atan2 function introduces some error with y close to zero, increased error tolerance
     if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP2_INVERSE_R) > ERROR_TOL+0.1) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 inverseOutputCoord->r, SPHERE_COORD_TP2_INVERSE_R);
         return 5;
     }
     if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP2_INVERSE_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 inverseOutputCoord->d, SPHERE_COORD_TP2_INVERSE_D);
         return 6;
@@ -788,20 +793,20 @@
 
     // Create transform ICRS to Ecliptic
-    testTransform = psSphereTransformICRSToEcliptic(testDateTime);
+    testTransform = psSphereRotICRSToEcliptic(testDateTime);
 
     // Perform transform from ICRS to Ecliptic
-    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    outputCoord = psSphereRotApply(outputCoord,testTransform,inputCoord);
     // Verify output not NULL and member values set correctly
     if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 7;
     }
     if(fabs(outputCoord->r - SPHERE_COORD_TP2_ECL_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 outputCoord->r, SPHERE_COORD_TP2_ECL_R);
         return 8;
     }
     if(fabs(outputCoord->d - SPHERE_COORD_TP2_ECL_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 outputCoord->d, SPHERE_COORD_TP2_ECL_D);
         return 9;
@@ -810,20 +815,20 @@
 
     // Create inverse transform Ecliptic to ICRS
-    testTransform = psSphereTransformEclipticToICRS(testDateTime);
+    testTransform = psSphereRotEclipticToICRS(testDateTime);
 
     // Perform transform from Ecliptic to ICRS
-    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    inverseOutputCoord = psSphereRotApply(inverseOutputCoord,testTransform,outputCoord);
     // Verify output not NULL and member values set correctly
     if(inverseOutputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 10;
     }
     if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP2_INVERSE_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 inverseOutputCoord->r, SPHERE_COORD_TP2_INVERSE_R);
         return 11;
     }
     if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP2_INVERSE_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 inverseOutputCoord->d, SPHERE_COORD_TP2_INVERSE_D);
         return 12;
@@ -839,7 +844,7 @@
 }
 
-psS32 testSphereTransformApply5( void)
-{
-    psSphereTransform*  testTransform;
+psS32 testSphereRotApply5( void)
+{
+    psSphereRot*  testTransform;
     psSphere*           inputCoord = psSphereAlloc();
     psSphere*           outputCoord = NULL;
@@ -855,20 +860,20 @@
 
     // Create transform ICRS to Galactic
-    testTransform = psSphereTransformICRSToGalactic();
+    testTransform = psSphereRotICRSToGalactic();
 
     // Perform transform from ICRS to Galactic
-    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    outputCoord = psSphereRotApply(outputCoord,testTransform,inputCoord);
     // Verify output not NULL and member values set correctly
     if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 1;
     }
     if(fabs(outputCoord->r - SPHERE_COORD_TP3_GAL_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 outputCoord->r, SPHERE_COORD_TP3_GAL_R);
         return 2;
     }
     if(fabs(outputCoord->d - SPHERE_COORD_TP3_GAL_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 outputCoord->d, SPHERE_COORD_TP3_GAL_D);
         return 3;
@@ -877,20 +882,20 @@
 
     // Create inverse transform Galactic to ICRS
-    testTransform = psSphereTransformGalacticToICRS();
+    testTransform = psSphereRotGalacticToICRS();
 
     // Perform transform from Galactic to ICRS
-    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    inverseOutputCoord = psSphereRotApply(inverseOutputCoord,testTransform,outputCoord);
     // Verify output not NULL and member values set correctly
     if(inverseOutputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 4;
     }
     if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP3_INVERSE_R) > ERROR_TOL+0.1) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 inverseOutputCoord->r, SPHERE_COORD_TP3_INVERSE_R);
         return 5;
     }
     if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP3_INVERSE_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 inverseOutputCoord->d, SPHERE_COORD_TP3_INVERSE_D);
         return 6;
@@ -899,20 +904,20 @@
 
     // Create transform ICRS to Ecliptic
-    testTransform = psSphereTransformICRSToEcliptic(testDateTime);
+    testTransform = psSphereRotICRSToEcliptic(testDateTime);
 
     // Perform transform from ICRS to Ecliptic
-    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    outputCoord = psSphereRotApply(outputCoord,testTransform,inputCoord);
     // Verify output not NULL and member values set correctly
     if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 7;
     }
     if(fabs(outputCoord->r - SPHERE_COORD_TP3_ECL_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 outputCoord->r, SPHERE_COORD_TP3_ECL_R);
         return 8;
     }
     if(fabs(outputCoord->d - SPHERE_COORD_TP3_ECL_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 outputCoord->d, SPHERE_COORD_TP3_ECL_D);
         return 9;
@@ -921,20 +926,20 @@
 
     // Create inverse transform Ecliptic to ICRS
-    testTransform = psSphereTransformEclipticToICRS(testDateTime);
+    testTransform = psSphereRotEclipticToICRS(testDateTime);
 
     // Perform transform from Ecliptic to ICRS
-    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    inverseOutputCoord = psSphereRotApply(inverseOutputCoord,testTransform,outputCoord);
     // Verify output not NULL and member values set correctly
     if(inverseOutputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply returned NULL");
         return 10;
     }
     if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP3_INVERSE_R) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord r %lg not as expected %lg",
                 inverseOutputCoord->r, SPHERE_COORD_TP3_INVERSE_R);
         return 11;
     }
     if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP3_INVERSE_D) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply return coord d %ld not as expected %lg",
                 inverseOutputCoord->d, SPHERE_COORD_TP3_INVERSE_D);
         return 12;
@@ -963,5 +968,5 @@
 #define SPHERE_PRECESS_TP3_EXPECT_D     0.543024          //   31.113     degrees
 
-psS32 testSphereTransformPrecess( void )
+psS32 testSphereRotPrecess( void )
 {
     psSphere*     inputCoord  = psSphereAlloc();
@@ -1080,22 +1085,106 @@
 }
 
-// Thes values calculated from ADD-09 equations
-#define EXPECT_COS_DELTAP_2000    0.917482
-#define EXPECT_SIN_DELTAP_2000    0.397777
-#define EXPECT_COS_DELTAP_2100    0.917572
-#define EXPECT_SIN_DELTAP_2100    0.397567
-
-psS32 testSphereTransformICRSToEcliptic( void )
+psS32 testSphereRotICRSToEcliptic( void )
+{
+    psF64  expectedQ0 = 0.0;
+    psF64  expectedQ1 = 0.0;
+    psF64  expectedQ2 = 0.0;
+    psF64  expectedQ3 = 0.0;
+
+    // Set test date time to 1/1/2000 00:00:00
+    psTime* testDateTime = psTimeFromMJD(MJD_2000);
+
+    // Invoke function to set psSphereRota objec
+    psSphereRot *myST = psSphereRotICRSToEcliptic(testDateTime);
+
+    // Verify expected values for the specified time
+    if (ERROR_TOL < fabs(expectedQ0 - myST->q0)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q0 is %f, should be %f",
+                myST->q0, expectedQ0);
+        return 1;
+    }
+    if (ERROR_TOL < fabs(expectedQ1 - myST->q1)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q1 is %f, should be %f",
+                myST->q1, expectedQ1);
+        return 2;
+    }
+    if (ERROR_TOL < fabs(expectedQ2 - myST->q2)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q2 is %f, should be %f",
+                myST->q2, expectedQ2);
+        return 3;
+    }
+    if (ERROR_TOL < fabs(expectedQ3 - myST->q3)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q3 is %f, should be %f",
+                myST->q3, expectedQ3);
+        return 4;
+    }
+    psFree(myST);
+    psFree(testDateTime);
+
+    // Set test date time to 1/1/2100 00:00:00
+    testDateTime = psTimeFromMJD(MJD_2100);
+
+    // Invoke function to set psSphereRota objec
+    myST = psSphereRotICRSToEcliptic(testDateTime);
+
+    // Verify expected values for the specified time
+    // Verify expected values for the specified time
+    if (ERROR_TOL < fabs(expectedQ0 - myST->q0)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q0 is %f, should be %f",
+                myST->q0, expectedQ0);
+        return 5;
+    }
+    if (ERROR_TOL < fabs(expectedQ1 - myST->q1)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q1 is %f, should be %f",
+                myST->q1, expectedQ1);
+        return 6;
+    }
+    if (ERROR_TOL < fabs(expectedQ2 - myST->q2)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q2 is %f, should be %f",
+                myST->q2, expectedQ2);
+        return 7;
+    }
+    if (ERROR_TOL < fabs(expectedQ3 - myST->q3)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->q3 is %f, should be %f",
+                myST->q3, expectedQ3);
+        return 8;
+    }
+    psFree(myST);
+    psFree(testDateTime);
+
+    // Verify if argument psTime is NULL, function returns NULL and error message generated
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
+    myST = psSphereRotICRSToEcliptic(NULL);
+    if (myST != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotICRSToEcliptic() did not return NULL.");
+        return 9;
+    }
+
+    // Verify if argument psTime is less than 1900, function return NULL and error msg generated
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
+    testDateTime = psTimeFromMJD(MJD_1900 - 1.0);
+    myST = psSphereRotICRSToEcliptic(testDateTime);
+    if (myST != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotICRSToEcliptic() did not return NULL.");
+        return 10;
+    }
+    psFree(testDateTime);
+
+    return 0;
+}
+
+
+psS32 testSphereRotEclipticToICRS( void )
 {
     psF64  expectedPhiP = 0.0;
     psF64  expectedAlphaP = 0.0;
-    psF64  expectedCosDeltaP = EXPECT_COS_DELTAP_2000;
-    psF64  expectedSinDeltaP = EXPECT_SIN_DELTAP_2000;
+    psF64  expectedCosDeltaP = 0.0;
+    psF64  expectedSinDeltaP = 0.0;
 
     // Set test date time to 1/1/2000 00:00:00
     psTime* testDateTime = psTimeFromMJD(MJD_2000);
 
-    // Invoke function to set psSphereTransforma objec
-    psSphereTransform *myST = psSphereTransformICRSToEcliptic(testDateTime);
+    // Invoke function to set psSphereRota object
+    psSphereRot *myST = psSphereRotEclipticToICRS(testDateTime);
 
     // Verify expected values for the specified time
@@ -1124,11 +1213,11 @@
 
     expectedCosDeltaP = EXPECT_COS_DELTAP_2100;
-    expectedSinDeltaP = EXPECT_SIN_DELTAP_2100;
+    expectedSinDeltaP = -EXPECT_SIN_DELTAP_2100;
 
     // Set test date time to 1/1/2100 00:00:00
     testDateTime = psTimeFromMJD(MJD_2100);
 
-    // Invoke function to set psSphereTransforma objec
-    myST = psSphereTransformICRSToEcliptic(testDateTime);
+    // Invoke function to set psSphereRota objec
+    myST = psSphereRotEclipticToICRS(testDateTime);
 
     // Verify expected values for the specified time
@@ -1158,7 +1247,7 @@
     // Verify if argument psTime is NULL, function returns NULL and error message generated
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
-    myST = psSphereTransformICRSToEcliptic(NULL);
+    myST = psSphereRotEclipticToICRS(NULL);
     if (myST != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformICRSToEcliptic() did not return NULL.");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotEclipticICRS() did not return NULL.");
         return 9;
     }
@@ -1167,99 +1256,7 @@
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
     testDateTime = psTimeFromMJD(MJD_1900 - 1.0);
-    myST = psSphereTransformICRSToEcliptic(testDateTime);
+    myST = psSphereRotEclipticToICRS(testDateTime);
     if (myST != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformICRSToEcliptic() did not return NULL.");
-        return 10;
-    }
-    psFree(testDateTime);
-
-    return 0;
-}
-
-
-psS32 testSphereTransformEclipticToICRS( void )
-{
-    psF64  expectedPhiP = 0.0;
-    psF64  expectedAlphaP = 0.0;
-    psF64  expectedCosDeltaP = EXPECT_COS_DELTAP_2000;
-    psF64  expectedSinDeltaP = -EXPECT_SIN_DELTAP_2000;
-
-    // Set test date time to 1/1/2000 00:00:00
-    psTime* testDateTime = psTimeFromMJD(MJD_2000);
-
-    // Invoke function to set psSphereTransforma object
-    psSphereTransform *myST = psSphereTransformEclipticToICRS(testDateTime);
-
-    // Verify expected values for the specified time
-    if (ERROR_TOL < fabs(expectedSinDeltaP - myST->sinDeltaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->sinDeltaP is %f, should be %f",
-                myST->sinDeltaP, expectedSinDeltaP);
-        return 1;
-    }
-    if (ERROR_TOL < fabs(expectedCosDeltaP - myST->cosDeltaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->cosDeltaP is %f, should be %f",
-                myST->cosDeltaP, expectedCosDeltaP);
-        return 2;
-    }
-    if (ERROR_TOL < fabs(expectedAlphaP - myST->alphaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->alphaP is %f, should be %f",
-                myST->alphaP, expectedAlphaP);
-        return 3;
-    }
-    if (ERROR_TOL < fabs(expectedPhiP - myST->phiP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->phiP is %f, should be %f",
-                myST->phiP, expectedPhiP);
-        return 4;
-    }
-    psFree(myST);
-    psFree(testDateTime);
-
-    expectedCosDeltaP = EXPECT_COS_DELTAP_2100;
-    expectedSinDeltaP = -EXPECT_SIN_DELTAP_2100;
-
-    // Set test date time to 1/1/2100 00:00:00
-    testDateTime = psTimeFromMJD(MJD_2100);
-
-    // Invoke function to set psSphereTransforma objec
-    myST = psSphereTransformEclipticToICRS(testDateTime);
-
-    // Verify expected values for the specified time
-    if (ERROR_TOL < fabs(expectedSinDeltaP - myST->sinDeltaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->sinDeltaP is %f, should be %f",
-                myST->sinDeltaP, expectedSinDeltaP);
-        return 5;
-    }
-    if (ERROR_TOL < fabs(expectedCosDeltaP - myST->cosDeltaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->cosDeltaP is %f, should be %f",
-                myST->cosDeltaP, expectedCosDeltaP);
-        return 6;
-    }
-    if (ERROR_TOL < fabs(expectedAlphaP - myST->alphaP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->alphaP is %f, should be %f",
-                myST->alphaP, expectedAlphaP);
-        return 7;
-    }
-    if (ERROR_TOL < fabs(expectedPhiP - myST->phiP)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->phiP is %f, should be %f",
-                myST->phiP, expectedPhiP);
-        return 8;
-    }
-    psFree(myST);
-    psFree(testDateTime);
-
-    // Verify if argument psTime is NULL, function returns NULL and error message generated
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
-    myST = psSphereTransformEclipticToICRS(NULL);
-    if (myST != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformEclipticICRS() did not return NULL.");
-        return 9;
-    }
-
-    // Verify if argument psTime is less than 1900, function return NULL and error msg generated
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
-    testDateTime = psTimeFromMJD(MJD_1900 - 1.0);
-    myST = psSphereTransformEclipticToICRS(testDateTime);
-    if (myST != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformEclipticToICRS() did not return NULL.");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotEclipticToICRS() did not return NULL.");
         return 10;
     }
@@ -1274,12 +1271,12 @@
 #define ITG_EXPECT_PHIP        0.57477
 
-psS32 testSphereTransformICRSToGalactic( void )
+psS32 testSphereRotICRSToGalactic( void )
 {
     // Invoke function
-    psSphereTransform *myST = psSphereTransformICRSToGalactic();
+    psSphereRot *myST = psSphereRotICRSToGalactic();
 
     // Verify did not return NULL
     if(myST == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformICRSToGalactic returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotICRSToGalactic returned NULL");
         return 1;
     }
@@ -1316,12 +1313,12 @@
 #define GTI_EXPECT_ALPHAP      0.57477
 
-psS32 testSphereTransformGalacticToICRS( void )
+psS32 testSphereRotGalacticToICRS( void )
 {
     // Invoke function
-    psSphereTransform *myST = psSphereTransformGalacticToICRS();
+    psSphereRot *myST = psSphereRotGalacticToICRS();
 
     // Verify did not return NULL
     if(myST == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereTransformGalacticToICRS returned NULL");
+        psError(PS_ERR_UNKNOWN,true,"psSphereRotGalacticToICRS returned NULL");
         return 1;
     }
Index: /trunk/psLib/test/image/tst_psImageGeomManip.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageGeomManip.c	(revision 4540)
+++ /trunk/psLib/test/image/tst_psImageGeomManip.c	(revision 4541)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-17 23:44:22 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-12 19:27:28 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1085,10 +1085,16 @@
 
     psImage* in = psImageAlloc(cols,rows,PS_TYPE_F32);
+    psImage* mask = psImageAlloc(cols,rows,PS_TYPE_MASK);
     for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[row];
+        psMaskType* maskRow = mask->data.PS_TYPE_MASK_DATA[row];
         for (psS32 col=0;col<cols;col++) {
             inRow[col] = (psF32)row+(psF32)col/1000.0f;
-        }
-    }
+            maskRow[col] = 0;
+        }
+    }
+
+
+    // ********** check psImageTransform with minimum specified inputs.
 
     psImage* out = psImageTransform(NULL,
@@ -1138,4 +1144,58 @@
     }
 
+    // zero out buffer
+    memset(out->rawDataBuffer, 0, sizeof(psF32)*out->numRows*out->numCols);
+
+    psPixels* blanks = psPixelsAlloc(10);
+    psPixels* mask = psPixelsAlloc(10);
+
+    // perform the same transform, but this time, supply a psImage to recycle and a mask
+    out = psImageTransform(out,
+                           blanks,
+                           in,
+                           mask,
+                           1,
+                           trans,
+                           psRegionSet(0,0,0,0),
+                           NULL,
+                           PS_INTERPOLATE_FLAT,
+                           -1);
+
+    if (out == NULL) {
+        psError(PS_ERR_UNKNOWN, false,
+                "out == NULL");
+        return 1;
+    }
+    if (out->type.type != PS_TYPE_F32) {
+        psError(PS_ERR_UNKNOWN, false,
+                "out->type.type != PS_TYPE_F32, out->type.type == %d",
+                out->type.type);
+        return 2;
+    }
+    if (out->numRows != rows*2 || out->numCols != cols*2) {
+        psError(PS_ERR_UNKNOWN, false,
+                "out size is %dx%d, not %dx%d",
+                out->numCols, out->numRows, cols*2, rows);
+        return 3;
+    }
+
+    for (psS32 row=0;row<out->numRows;row++) {
+        psF32* outRow = out->data.F32[row];
+        for (psS32 col=0;col<cols;col++) {
+            float inValue = p_psImagePixelInterpolateFLAT_F32(in,
+                            col*trans->x->coeff[1][0]+trans->x->coeff[0][0],
+                            row*trans->y->coeff[0][1]+trans->y->coeff[0][0],
+                            NULL, 0,
+                            -1);
+            if (fabsf(outRow[col] - inValue) > FLT_EPSILON*10) {
+                psError(PS_ERR_UNKNOWN, false,
+                        "out at %d,%d was %g, expected %g",
+                        col,row,outRow[col], inValue);
+                return 4;
+            }
+        }
+    }
+
+
     psFree(out);
     psFree(in);
