Index: /trunk/psLib/src/astronomy/Makefile
===================================================================
--- /trunk/psLib/src/astronomy/Makefile	(revision 1381)
+++ /trunk/psLib/src/astronomy/Makefile	(revision 1382)
@@ -9,6 +9,6 @@
 SRC_OBJS = psTime.o \
            psMetadata.o \
-	   psCCD.o \
            psCoord.o
+#           psAstrometry.o             George, this is crap code!
 
 OBJS = $(addprefix makedir/,$(SRC_OBJS))
Index: /trunk/psLib/src/astronomy/psAstrometry.c
===================================================================
--- /trunk/psLib/src/astronomy/psAstrometry.c	(revision 1381)
+++ /trunk/psLib/src/astronomy/psAstrometry.c	(revision 1382)
@@ -1,14 +1,55 @@
-// This file contains
-
-#include "psType.h"
-#include "psImage.h"
-#include "psArray.h"
-#include "psList.h"
+/** @file  psAstrometry.c
+*
+*  @brief This file defines the basic types for astronomical coordinate 
+*  transformation
+*
+*  @ingroup AstroImage
+*
+*  @author George Gusciora, MHPCC
+*
+*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 22:11:09 $
+*
+*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+*/
+
+#include<math.h>
+
 #include "psFunctions.h"
-
-psGrommit *psGrommitAlloc(const psExposure *exp)
-{
-    double *slaGrommit = (double *) psAlloc(14 * sizeof(double));
-    psGrommit *grommit = (psGrommit *) psAlloc(sizeof(psGrommit));
+#include "psAstrometry.h"
+#include "psMemory.h"
+
+void grommitFree( psGrommit *grommit );
+int checkValidChipCoords( double x, double y, psChip *tmpChip );
+int checkValidImageCoords( double x, double y, psImage *tmpImage );
+
+psExposure* psExposureAlloc( double ra, double dec, double hourAngle,
+                             double zenith, double azimuth, double localTime, float date,
+                             float rotAngle, float temperature, float pressure, float humidity,
+                             float exposureTime )
+{
+    psExposure * exp = psAlloc( sizeof( psExposure ) );
+    
+    *( double* ) & exp->ra = ra;
+    *( double* ) & exp->dec = dec;
+    *( double* ) & exp->hourAngle = hourAngle;
+    *( double* ) & exp->zenith = zenith;
+    *( double* ) & exp->azimuth = azimuth;
+    *( double* ) & exp->localTime = localTime;
+    *( float* ) & exp->date = date;
+    *( float* ) & exp->rotAngle = rotAngle;
+    *( float* ) & exp->temperature = temperature;
+    *( float* ) & exp->pressure = pressure;
+    *( float* ) & exp->humidity = humidity;
+    *( float* ) & exp->exposureTime = exposureTime;
+    
+    return exp;
+    
+}
+
+psGrommit* psGrommitAlloc( const psExposure *exp )
+{
+    double * slaGrommit = ( double * ) psAlloc( 14 * sizeof( double ) );
+    psGrommit *grommit = ( psGrommit * ) psAlloc( sizeof( psGrommit ) );
     /*
         extern void sla_aoppa(double date,
@@ -30,74 +71,78 @@
                   tlr);
     */
-    grommit->latitude = exp->dec;              // XXX Is this correct?
-    grommit->sinLat = sin(grommit->latitude);
-    grommit->cosLat = cos(grommit->latitude);
-    grommit->abberationMag = 0.0;
-    grommit->height = 0.0;
-    grommit->temperature = exp->temperature;
-    grommit->pressure = exp->pressure;
-    grommit->humidity = exp->humidity;
-    grommit->wavelength = 0.0;
-    grommit->lapseRate = 0.0;
-    grommit->refractA = 0.0;
-    grommit->refractB = 0.0;
-    grommit->longitudeOffset = ra;             // XXX Is this correct?
-    grommit->siderealTime = 0.0;
-
-    psFree(slaGrommit);
-    return(grommit);
-}
-
-void p_psGrommitFree(psGrommit *grommit)
-{
-    psFree(grommit);
-}
-
-psCell *psCellinFPA(psCell *out,
-                    const psPlane *coord,
-                    const psFPA *FPA)
-{
-    psChip *tmpChip = NULL;
+    *( double* ) & grommit->latitude = exp->dec;              // XXX Is this correct?
+    *( double* ) & grommit->sinLat = sin( grommit->latitude );
+    *( double* ) & grommit->cosLat = cos( grommit->latitude );
+    *( double* ) & grommit->abberationMag = 0.0;
+    *( double* ) & grommit->height = 0.0;
+    *( double* ) & grommit->temperature = exp->temperature;
+    *( double* ) & grommit->pressure = exp->pressure;
+    *( double* ) & grommit->humidity = exp->humidity;
+    *( double* ) & grommit->wavelength = 0.0;
+    *( double* ) & grommit->lapseRate = 0.0;
+    *( double* ) & grommit->refractA = 0.0;
+    *( double* ) & grommit->refractB = 0.0;
+    *( double* ) & grommit->longitudeOffset = exp->ra;             // XXX Is this correct?
+    *( double* ) & grommit->siderealTime = 0.0;
+    
+    psFree( slaGrommit );
+    return ( grommit );
+}
+
+void p_psGrommitFree( psGrommit *grommit )
+{
+    psFree( grommit );
+}
+
+psCell *psCellinFPA( psCell *out,
+                     const psPlane *coord,
+                     const psFPA *FPA )
+{
+    psChip * tmpChip = NULL;
     psCell *tmpCell = NULL;
-
-    tmpChip = psChipinFPA(tmpChip, coord, FPA);
-    tmpCell = psCellinChip(tmpCell, coord, tmpChip);
-    return(tmpCell);
-}
-
-
-p_psCheckValidChipCoords(double x, double y, psChil *tmpChip)
-{
-    return(0);
-}
-
-psChip *psChipinFPA(psChip *out,
-                    const psPlane *coord,
-                    const psFPA *FPA)
-{
-    psFPA *tmpChip = NULL;
-
-    for (tmpChip = FPA->chips; tmpChip != NULL; tmpChip++) {
-        tmpCoord = psPlaneTransformApply(out, tmpChip->fromFPA, coord);
-        if (p_psCheckValidChipCoords(tmpCoord->x, tmpCoord->y,
-                                     tmpChip)) {
-            psFree(tmpCoord);
-            return(tmpChip);
-        }
-        psFree(tmpCoord);
-    }
-    psFree(tmpCoord);
-    return(NULL);
-}
-
-p_psCheckValidImageCoords(double x, double y, psImage *tmpImage)
-{
-    if ((x < 0.0) ||
-            (x > (double) tmpImage->numCols) ||
-            (y < 0.0) ||
-            (y > (double) tmpImage->numRows)) {
-        return(0);
-    }
-    return(1);
+    
+    tmpChip = psChipinFPA( tmpChip, coord, FPA );
+    tmpCell = psCellinChip( tmpCell, coord, tmpChip );
+    return ( tmpCell );
+}
+
+
+int checkValidChipCoords( double x, double y, psChip *tmpChip )
+{
+    return ( 0 );
+}
+
+psChip *psChipinFPA( psChip *out,
+                     const psPlane *coord,
+                     const psFPA *FPA )
+{
+    psArray * chips = FPA->chips;
+    int nChips = chips->n;
+    psPlane* tmpCoord = NULL;
+    
+    for ( int i = 0; i < nChips; i++ ) {
+            psChip* tmpChip = chips->data[ i ];
+            tmpCoord = psPlaneTransformApply( tmpCoord, tmpChip->fromFPA, coord );
+            if ( checkValidChipCoords( tmpCoord->x, tmpCoord->y,
+                                       tmpChip ) ) {
+                    psFree( tmpCoord );
+                    // XXX: George, you didn't use the out parameter!
+                    return ( tmpChip );
+                }
+            psFree( tmpCoord );
+        }
+    psFree( tmpCoord );
+    return ( NULL );
+}
+
+int checkValidImageCoords( double x, double y, psImage *tmpImage )
+{
+    if ( ( x < 0.0 ) ||
+            ( x > ( double ) tmpImage->numCols ) ||
+            ( y < 0.0 ) ||
+            ( y > ( double ) tmpImage->numRows ) ) {
+            return ( 0 );
+        }
+    return ( 1 );
 }
 
@@ -115,50 +160,65 @@
 XXX: must deallocate memory.
  *****************************************************************************/
-psCell *psCellinChip(psCell *out,
-                     const psPlane *coord,
-                     const psChip *chip)
-{
-    psCell *tmpCell = NULL;
-    psReadout *tmpReadout = NULL;
-    psPlane *tmpCoord = NULL;
-
-    for (tmpCell = chip->cells; tmpCell != NULL; tmpCell++) {
-        if (tmpCell->readouts != NULL) {
-            tmpReadout = tmpCell->readouts;
-            tmpCoord = psPlaneTransformApply(out, tmpCell->fromChip, coord);
-            if (p_psCheckValidImageCoords(tmpCoord->x, tmpCoord->y,
-                                          tmpReadout->image)) {
-                return(tmpCell);
-            }
-        }
-    }
-    return(NULL);
-}
-
-psPlane *psCoordCelltoChip(psPlane *out,
+psCell *psCellinChip( psCell *out,
+                      const psPlane *coord,
+                      const psChip *chip )
+{
+    psPlane * tmpCoord = NULL;
+    psArray* cells;
+    
+    if ( chip == NULL ) {
+            return NULL;
+        }
+        
+    cells = chip->cells;
+    
+    if ( cells == NULL ) {
+            return NULL;
+        }
+        
+    for ( int i = 0; i < cells->n; i++ ) {
+            psCell* tmpCell = ( psCell* ) cells->data[ i ];
+            psArray* readouts = tmpCell->readouts;
+            if ( readouts != NULL ) {
+                    for ( int j = 0; j < readouts->n; j++ ) {
+                            psReadout* tmpReadout = readouts->data[ j ];
+                            tmpCoord = psPlaneTransformApply( tmpCoord, tmpCell->fromChip, coord );
+                            if ( checkValidImageCoords( tmpCoord->x, tmpCoord->y,
+                                                        tmpReadout->image ) ) {
+                                    return ( tmpCell );
+                                }
+                        }
+                }
+        }
+    return ( NULL );
+}
+
+psPlane *psCoordCelltoChip( psPlane *out,
+                            const psPlane *in,
+                            const psCell *cell )
+{
+    return ( psPlaneTransformApply( out, cell->toChip, in ) );
+}
+
+psPlane *psCoordChipToFPA( psPlane *out,
                            const psPlane *in,
-                           const psCell *cell)
-{
-    return(psPlaneTransformApply(out, cell->toChip, in));
-}
-
-psPlane *psCoordChipToFPA(psPlane *out,
+                           const psChip *chip )
+{
+    return ( psPlaneTransformApply( out, chip->toFPA, in ) );
+}
+
+psPlane *psCoordFPAtoTP( psPlane *out,
+                         const psPlane *in,
+                         const psFPA *fpa )
+{
+    // XXX: This code doesn't work; fpa->toTangentPlane is of the wrong type.
+    // return(psPlaneTransformApply(out, fpa->toTangentPlane, in));
+    return ( NULL );
+}
+
+// XXX: must wrap SLA_QAPQK here.
+psSphere *psCoordTPtoSky( psSphere *out,
                           const psPlane *in,
-                          const psChip *chip)
-{
-    return(psPlaneTransformApply(out, chip->toFPA, in));
-}
-
-psPlane *psCoordFPAtoTP(psPlane *out,
-                        const psPlane *in,
-                        const psFPA *fpa)
-{
-    return(psPlaneTransformApply(out, fpa->toTangentPlane, in));
-}
-
-// XXX: must wrap SLA_QAPQK here.
-psSphere *psCoordTPtoSky(psSphere *out,
-                         const psPlane *in,
-                         const psGrommit *grommit)
+                          const psGrommit *grommit )
 {
     /*
@@ -169,14 +229,14 @@
         sla_OAPQK(TYPE, OB1, OB2, *grommit, &RAP, &DAP);
     */
-
-    return(out);
-}
-
-
-psPlane *psCoordCellToFPA(psPlane *out,
-                          const psPlane *in,
-                          const psCell *cell)
-{
-    return(psPlaneTransformApply(out, cell->toFPA, in));
+    
+    return ( out );
+}
+
+
+psPlane *psCoordCellToFPA( psPlane *out,
+                           const psPlane *in,
+                           const psCell *cell )
+{
+    return ( psPlaneTransformApply( out, cell->toFPA, in ) );
 }
 
@@ -185,107 +245,110 @@
 // transformation, as well as a few psPlane structs.  Can this be implemented
 // better?
-psSphere *psCoordCelltoSky(psSphere *out,
+psSphere *psCoordCelltoSky( psSphere *out,
+                            const psPlane *in,
+                            const psCell *cell )
+{
+    psPlane * tmp1 = NULL;
+    psPlane *tmp2 = NULL;
+    psFPA *parFPA = ( cell->parent ) ->parent;
+    psGrommit *tmpGrommit = NULL;
+    
+    tmp1 = psPlaneTransformApply( tmp1, cell->toFPA, in );
+    tmp2 = psPlaneTransformApply( tmp2, parFPA->toTangentPlane, tmp1 );
+    tmpGrommit = psGrommitAlloc( parFPA->exposure );
+    tmp3 = psCoordTPtoSky( out, tmp2, psGrommit );
+    
+    psFree( tmp1 );
+    psFree( tmp2 );
+    psFree( tmpGrommit );
+    
+    return ( psCoordTPtoSky( out, tmp2, psGrommit ) );
+    
+}
+
+psSphere *psCoordCelltoSkyQuick( psSphere *out,
+                                 const psPlane *in,
+                                 const psCell *cell )
+{
+    psPlane * tmp1 = NULL;
+    
+    tmp1 = psPlaneTransformApply( tmp1, cell->toSky, in );
+    
+    //XXX: Do something to convert the linear coords in tmp1 to spherical
+    // coords in out.
+    
+    psFree( tmp1 );
+    
+    return ( out );
+}
+
+// XXX: must wrap SLA_AOPQK here.
+psPlane *psCoordSkytoTP( psPlane *out,
+                         const psSphere *in,
+                         const psGrommit *grommit )
+{
+    extern void sla_AOPQK ( RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB );
+    double AOB;
+    double ZOB;
+    double HOB;
+    double DOB;
+    double ROB;
+    
+    if ( out == NULL ) {
+            out = ( psPlane * ) psAlloc( sizeof( psPlane ) );
+        }
+        
+    sla_AOPQK( psSphere->r, psSphere->d, *grommit, &AOB, &ZOB, &HOB, &DOB, &ROB );
+    out->x = XXX;
+    out->y = XXX;
+    return ( out );
+}
+
+psPlane *psCoordTPtoFPA( psPlane *out,
+                         const psPlane *in,
+                         const psFPA *fpa )
+{
+    return ( psPlaneTransformApply( out, fpa->fromTangentPlane, in ) );
+}
+
+psPlane *psCoordFPAtoChip( psPlane *out,
                            const psPlane *in,
-                           const psCell *cell)
-{
-    psPlane *tmp1 = NULL;
-    psPlane *tmp2 = NULL;
-    psFPA *parFPA = (cell->parent)->parent;
-    psGrommit *tmpGrommit = NULL;
-
-    tmp1 = psPlaneTransformApply(tmp1, cell->toFPA, in)
-           tmp2 = psPlaneTransformApply(tmp2, parFPA->toTangentPlane, tmp1)
-                  tmpGrommit = psGrommitAlloc(parFPA->exposure)
-                               tmp3 = psCoordTPtoSky(out, tmp2, psGrommit);
-
-    psFree(tmp1);
-    psFree(tmp2);
-    psFree(tmpGrommit);
-
-    return(psCoordTPtoSky(out, tmp2, psGrommit);
-       }
-
-       psSphere *psCoordCelltoSkyQuick(psSphere *out,
-                                       const psPlane *in,
-                                       const psCell *cell)
-       {
-           psPlane *tmp1 = NULL;
-
-           tmp1 = psPlaneTransformApply(tmp1, cell->toSky, in);
-
-           //XXX: Do something to convert the linear coords in tmp1 to spherical
-           // coords in out.
-
-           free(tmp1)
-
-           return(out);
-       }
-
-       // XXX: must wrap SLA_AOPQK here.
-       psPlane *psCoordSkytoTP(psPlane *out,
-                               const psSphere *in,
-                               const psGrommit *grommit)
-       {
-           extern void sla_AOPQK (RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB);
-           double AOB;
-           double ZOB;
-           double HOB;
-           double DOB;
-           double ROB;
-
-           if (out == NULL) {
-               out = (psPlane *) psAlloc(sizeof(psPlane));
-           }
-
-           sla_AOPQK(psSphere->r, psSphere->d, *grommit, &AOB, &ZOB, &HOB, &DOB, &ROB);
-           out->x = XXX;
-           out->y = XXX;
-           return(out);
-       }
-
-       psPlane *psCoordTPtoFPA(psPlane *out,
-                               const psPlane *in,
-                               const psFPA *fpa)
-       {
-           return(psPlaneTransformApply(out, fpa->fromTangentPlane, in));
-       }
-
-       psPlane *psCoordFPAtoChip(psPlane *out,
-                                 const psPlane *in,
-                                 const psChip *chip)
-       {
-           return(psPlaneTransformApply(out, chip->fromFPA, in));
-       }
-
-
-       psPlane *psCoordChiptoCell(psPlane *out,
-                                  const psPlane *in,
-                                  const psCell *cell)
-       {
-           return(psPlaneTransformApply(out, cell->fromChip, in));
-       }
-
-       psPlane *psCoordSkytoCell(psPlane *out,
-                                 const psSphere *in,
-                                 const psCell *cell)
-       {
-           out = psCoordSkytoTP(out, in, tmpGrommit);
-           out = psCoordTPtoFPA(out, out, whichFPA);
-           out = psCoordFPAtoChip(out, out, whichChip);
-           out = psCoordChiptoCell(out, out, whichCell);
-
-           return(out);
-       }
-
-       psPlane *psCoordSkytoCellQuick(psPlane *out,
-                                      const psSphere *in,
-                                      const psCell *cell)
-       {
-           if (out == NULL) {
-               out = (psPlane *) psAlloc(sizeof(psPlane));
-           }
-
-           return(out);
-       }
-
-
+                           const psChip *chip )
+{
+    return ( psPlaneTransformApply( out, chip->fromFPA, in ) );
+}
+
+
+psPlane *psCoordChiptoCell( psPlane *out,
+                            const psPlane *in,
+                            const psCell *cell )
+{
+    return ( psPlaneTransformApply( out, cell->fromChip, in ) );
+}
+
+psPlane *psCoordSkytoCell( psPlane *out,
+                           const psSphere *in,
+                           const psCell *cell )
+{
+    out = psCoordSkytoTP( out, in, tmpGrommit );
+    out = psCoordTPtoFPA( out, out, whichFPA );
+    out = psCoordFPAtoChip( out, out, whichChip );
+    out = psCoordChiptoCell( out, out, whichCell );
+    
+    return ( out );
+}
+
+psPlane *psCoordSkytoCellQuick( psPlane *out,
+                                const psSphere *in,
+                                const psCell *cell )
+{
+    if ( out == NULL ) {
+            out = ( psPlane * ) psAlloc( sizeof( psPlane ) );
+        }
+        
+    return ( out );
+}
+
+
+
+
Index: /trunk/psLib/src/astronomy/psAstrometry.h
===================================================================
--- /trunk/psLib/src/astronomy/psAstrometry.h	(revision 1381)
+++ /trunk/psLib/src/astronomy/psAstrometry.h	(revision 1382)
@@ -1,21 +1,19 @@
-/** @file  psCoord2.h
- *
- *  @brief Contains basic coordinate transformation definitions and operations
- *
- *  This file defines the basic types for astronomical coordinate 
- *  transformation
- *
- *  @ingroup AstroImage
- *
- *  @author George Gusciora, MHPCC
- *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-29 04:22:26 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- */
-
-# ifndef PS_COORD2_H
-# define PS_COORD2_H
+/** @file  psAstrometry.h
+*
+*  @brief This file defines the basic types for astronomical coordinate 
+*  transformation
+*
+*  @ingroup AstroImage
+*
+*  @author George Gusciora, MHPCC
+*
+*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 22:11:09 $
+*
+*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+*/
+
+# ifndef PS_ASTROMETRY_H
+# define PS_ASTROMETRY_H
 
 #include "psType.h"
@@ -24,101 +22,255 @@
 #include "psList.h"
 #include "psFunctions.h"
+#include "psMetadata.h"
+#include "psCoord.h"
+#include "psPhotometry.h"
+
+struct psCell;
+struct psChip;
+struct psFPA;
+struct psExposure;
+
+/// @addtogroup AstroImage
+/// @{
 
 typedef struct
-{
-    const double latitude;             ///<
-    const double sinLat, cosLat;       ///<
-    const double abberationMag;        ///<
-    const double height;               ///<
-    const double temperature;          ///<
-    const double pressure;             ///<
-    const double humidity;             ///<
-    const double wavelength;           ///<
-    const double lapseRate;            ///<
-    const double refractA, refractB;   ///<
-    const double longitudeOffset;      ///<
-    const double siderealTime;         ///<
-}
+    {
+        const double latitude;             ///<
+        const double sinLat, cosLat;       ///<
+        const double abberationMag;        ///<
+        const double height;               ///<
+        const double temperature;          ///<
+        const double pressure;             ///<
+        const double humidity;             ///<
+        const double wavelength;           ///<
+        const double lapseRate;            ///<
+        const double refractA, refractB;   ///<
+        const double longitudeOffset;      ///<
+        const double siderealTime;         ///<
+    }
 psGrommit;
 
 typedef struct
-{
-    int nX, nY;               ///<
-    double x0, y0;            ///<
-    double xScale, yScale;    ///<
-    double **x, **y;          ///<
-}
+    {
+        int nX, nY;               ///<
+        double x0, y0;            ///<
+        double xScale, yScale;    ///<
+        double **x, **y;          ///<
+    }
 psFixedPattern;
 
-psGrommit *psGrommitAlloc(const psExposure *exp);
-
-void p_psGrommitFree(psGrommit *grommit);
-
-psCell *psCellinFPA(psCell *out,
-                    const psPlane *coord,
-                    const psFPA *FPA);
-
-psChip *psChipinFPA(psChip *out,
-                    const psPlane *coord,
-                    const psFPA *FPA);
-
-psCell *psCellinChip(psCell *out,
+/** Readout data structure.
+ *
+ *  A readout is the result of a single read of a cell (or a portion thereof). 
+ *  It contains a pointer to the pixel data, and additional pointers to the 
+ *  objects found in the readout, and the readout metadata.  It also contains
+ *  the offset from the lower-left corner of the chip, in the case that the
+ *  CCD was windowed.
+ *
+ */
+typedef struct
+    {
+        const unsigned int colBins;        ///< Amount of binning in x-dimension
+        const unsigned int rowBins;        ///< Amount of binning in y-dimension
+        const int col0;                    ///< Offset from the left of chip.
+        const int row0;                    ///< Offset from the bottom of chip.
+        
+        psImage* image;                    ///< imaging area of Readout
+        psList* objects;                  ///< objects derived from Readout
+        psMetadata* metadata;              ///< readout-level metadata
+    }
+psReadout;
+
+/** Cell data structure
+ * 
+ *  A cell consists of one or more readouts.  It also contains a pointer to the
+ *  cell's metadata, and its parent chip.  On the astrometry side, it also 
+ *  contains coordinate transforms from the cell to chip, from the cell to 
+ *  focal-plane, as well as a "quick and dirty" tranform from the cell to
+ *  sky coordinates.
+ *
+ */
+typedef struct psCell
+    {
+        psArray* readouts;                 ///< readouts from the cell
+        psMetadata* metadata;              ///< cell-level metadata
+        
+        psPlaneTransform* toChip;          ///< transformations from cell to chip coordinates
+        psPlaneTransform* fromChip;        ///< transformations from chip to cell coordinates
+        psPlaneTransform* toFPA;           ///< transformations from cell to FPA coordinates
+        psPlaneTransform* toSky;           ///< transformations from cell to sky coordinates
+        
+        struct psChip* parent;             ///< chip in which contains this cell
+    }
+psCell;
+
+/** Chip data structure
+ *
+ *  A chip consists of one or more cells (according to the number of amplifiers
+ *  on the CCD). It contains a pointer to the chip's metadata, and a pointer    
+ *  to the parent focal plane.  For astrometry, ot contains a coordinate
+ *  transform from the chip to the focal plane, and vis-versa.
+ *
+ */
+typedef struct psChip
+    {
+        psArray* cells;                    ///< cells in the chip
+        psMetadata* metadata;              ///< chip-level metadata
+        
+        psPlaneTransform* toFPA;           ///< transformation from chip to FPA coordinates
+        psPlaneTransform* fromFPA;         ///< transformation from FPA to chip coordinates
+        
+        struct psFPA* parent;              ///< FPA which contains this chip
+    }
+psChip;
+
+/** A Focal-Plane
+ *
+ *  A focal plane consists of one or more chips (according to the number of
+ *  contiguous silicon).  It contains pointers to the focal-plane's metadata
+ *  and the exposure information.  For astrometry, it contains a transformation
+ *  from the focal plane to the tangent plane and the fixed pattern residuals.
+ *  Since colors are involved in the transformation, it is necessary to specify
+ *  the color the transformation is defined.  We also include some values to
+ *  characterize the quality of the transformation: the root square deviation
+ *  for the x and y transformation fits, and the chi-squared for the 
+ *  transformation fit.
+ *
+ */
+typedef struct psFPA
+    {
+        psArray* chips;                    ///< chips in the focal plane array
+        psMetadata* metadata;              ///< focal-plane's metadata
+        
+        psPlaneDistort* fromTangentPlane;  ///< transformation from tangent plane to focal plane
+        psPlaneDistort* toTangentPlane;    ///< transformation from focal plane to tangent plane
+        psFixedPattern* pattern;           ///< fixed pattern residual offsets
+        
+        const struct psExposure* exposure; ///< information about this exposure
+        
+        psPhotSystem* colorPlus;           ///< Color reference
+        psPhotSystem* colorMinus;          ///< Color reference
+        
+        float rmsX;                        ///< RMS for x transformation fits
+        float rmsY;                        ///< RMS for y transformation fits
+        float chi2;                        ///< chi^2 of astrometric solution
+    }
+psFPA;
+
+/** Exposure Information
+ *
+ *  Several quantities from the telescope in order to make a first guess at 
+ *  the astrometric solution.  From these quantities, further quantities can 
+ *  be derivedand stored for later use.
+ *
+ */
+typedef struct psExposure
+    {
+        const double ra;                  ///< Telescope boresight, right ascention
+        const double dec;                 ///< Telescope boresight, declination
+        const double hourAngle;           ///< Hour angle
+        const double zenith;              ///< Zenith distance
+        const double azimuth;             ///< Azimuth
+        const double localTime;           ///< Local Sidereal Time
+        const float date;                 ///< Modified Jullian Date of observation
+        const float rotAngle;             ///< Rotator position angle
+        const float temperature;          ///< Air temperature, for estimating refraction
+        const float pressure;             ///< Air pressure, for calculating refraction
+        const float humidity;             ///< Relative humidity, for refraction
+        const float exposureTime;         ///< Exposure time
+        
+        /* Derived quantities */
+        const float positionAngle;        ///< Position angle
+        const float parallacticAngle;     ///< Parallactic angle
+        const float airmass;              ///< Airmass, calculated from zenith distance
+        const float parallacticFactor;    ///< Parallactic factor
+        const char *cameraName;           ///< name of camera which provided exposure
+        const char *telescopeName;        ///< name of telescope which provided exposure
+    }
+psExposure;
+
+psExposure* psExposureAlloc(
+    double ra,                          ///< Telescope boresight, right ascention
+    double dec,                         ///< Telescope boresight, declination
+    double hourAngle,                   ///< Hour angle
+    double zenith,                      ///< Zenith distance
+    double azimuth,                     ///< Azimuth
+    double localTime,                   ///< Local Sidereal Time
+    float date,                         ///< MJD
+    float rotAngle,                     ///< Rotator position angle
+    float temperature,                  ///< Temperature
+    float pressure,                     ///< Pressure
+    float humidity,                     ///< Relative humidity
+    float exposureTime                 ///< Exposure time
+);
+
+psGrommit* psGrommitAlloc( const psExposure* exp );
+
+psCell *psCellinFPA( psCell *out,
                      const psPlane *coord,
-                     const psChip *chip);
-
-
-
-
-psPlane *psCoordCelltoChip(psPlane *out,
+                     const psFPA *FPA );
+                     
+psChip *psChipinFPA( psChip *out,
+                     const psPlane *coord,
+                     const psFPA *FPA );
+                     
+psCell *psCellinChip( psCell *out,
+                      const psPlane *coord,
+                      const psChip *chip );
+                      
+                      
+                      
+                      
+psPlane *psCoordCelltoChip( psPlane *out,
+                            const psPlane *in,
+                            const psCell *cell );
+                            
+psPlane *psCoordChipToFPA( psPlane *out,
                            const psPlane *in,
-                           const psCell *cell);
-
-psPlane *psCoordChipToFPA(psPlane *out,
+                           const psChip *chip );
+                           
+psPlane *psCoordFPAtoTP( psPlane *out,
+                         const psPlane *in,
+                         const psFPA *fpa );
+                         
+psSphere *psCoordTPtoSky( psSphere *out,
                           const psPlane *in,
-                          const psChip *chip);
-
-psPlane *psCoordFPAtoTP(psPlane *out,
-                        const psPlane *in,
-                        const psFPA *fpa);
-
-psSphere *psCoordTPtoSky(psSphere *out,
+                          const psGrommit *grommit );
+                          
+psPlane *psCoordCellToFPA( psPlane *out,
+                           const psPlane *in,
+                           const psCell *cell );
+                           
+psSphere *psCoordCelltoSky( psSphere *out,
+                            const psPlane *in,
+                            const psCell *cell );
+                            
+psSphere *psCoordCelltoSkyQuick( psSphere *out,
+                                 const psPlane *in,
+                                 const psCell *cell );
+                                 
+psPlane *psCoordSkytoTP( psPlane *out,
+                         const psSphere *in,
+                         const psGrommit *grommit );
+                         
+psPlane *psCoordTPtoFPA( psPlane *out,
                          const psPlane *in,
-                         const psGrommit *grommit);
-
-psPlane *psCoordCellToFPA(psPlane *out,
-                          const psPlane *in,
-                          const psCell *cell);
-
-psSphere *psCoordCelltoSky(psSphere *out,
+                         const psFPA *fpa );
+                         
+psPlane *psCoordFPAtoChip( psPlane *out,
                            const psPlane *in,
-                           const psCell *cell);
-
-psSphere *psCoordCelltoSkyQuick(psSphere *out,
-                                const psPlane *in,
-                                const psCell *cell);
-
-psPlane *psCoordSkytoTP(psPlane *out,
-                        const psSphere *in,
-                        const psGrommit *grommit);
-
-psPlane *psCoordTPtoFPA(psPlane *out,
-                        const psPlane *in,
-                        const psFPA *fpa);
-
-psPlane *psCoordFPAtoChip(psPlane *out,
-                          const psPlane *in,
-                          const psChip *chip);
-
-psPlane *psCoordChiptoCell(psPlane *out,
-                           const psPlane *in,
-                           const psCell *cell);
-
-psPlane *psCoordSkytoCell(psPlane *out,
-                          const psSphere *in,
-                          const psCell *cell);
-
-psPlane *psCoordSkytoCellQuick(psPlane *out,
-                               const psSphere *in,
-                               const psCell *cell);
-
+                           const psChip *chip );
+                           
+psPlane *psCoordChiptoCell( psPlane *out,
+                            const psPlane *in,
+                            const psCell *cell );
+                            
+psPlane *psCoordSkytoCell( psPlane *out,
+                           const psSphere *in,
+                           const psCell *cell );
+                           
+psPlane *psCoordSkytoCellQuick( psPlane *out,
+                                const psSphere *in,
+                                const psCell *cell );
+                                
 #endif
Index: unk/psLib/src/astronomy/psCCD.c
===================================================================
--- /trunk/psLib/src/astronomy/psCCD.c	(revision 1381)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/** @file  psCCD.c
- *
- *  @brief Contains basic CCD image definitions and operations
- *
- *  This file defines the basic types for astronomical imagery, including
- *  the concepts of: Readout, Cell, Chip, Focal Plane, and Exposure Information.
- *
- *  @ingroup AstroImage
- *
- *  @author Robert DeSonia, MHPCC
- *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-16 02:15:51 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- */
-
-#include "psCCD.h"
-#include "psMemory.h"
-
-psExposure* psExposureAlloc(double ra,double dec, double hourAngle,
-                            double zenith, double azimuth, double localTime, float date,
-                            float rotAngle, float temperature, float pressure,float humidity,
-                            float exposureTime)
-{
-    psExposure* exp = psAlloc(sizeof(psExposure));
-
-    *(double*)&exp->ra = ra;
-    *(double*)&exp->dec = dec;
-    *(double*)&exp->hourAngle = hourAngle;
-    *(double*)&exp->zenith = zenith;
-    *(double*)&exp->azimuth = azimuth;
-    *(double*)&exp->localTime = localTime;
-    *(float*)&exp->date = date;
-    *(float*)&exp->rotAngle = rotAngle;
-    *(float*)&exp->temperature = temperature;
-    *(float*)&exp->pressure = pressure;
-    *(float*)&exp->humidity = humidity;
-    *(float*)&exp->exposureTime = exposureTime;
-
-    return exp;
-
-}
Index: unk/psLib/src/astronomy/psCCD.h
===================================================================
--- /trunk/psLib/src/astronomy/psCCD.h	(revision 1381)
+++ 	(revision )
@@ -1,187 +1,0 @@
-
-/** @file  psCCD.h
- *
- *  @brief Contains basic CCD image definitions and operations
- *
- *  This file defines the basic types for astronomical imagery, including
- *  the concepts of: Readout, Cell, Chip, Focal Plane, and Exposure Information.
- *
- *  @ingroup AstroImage
- *
- *  @author Robert DeSonia, MHPCC
- *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-29 02:08:02 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- */
-
-# ifndef PS_CCD_H
-# define PS_CCD_H
-
-#include "psType.h"
-#include "psImage.h"
-#include "psArray.h"
-#include "psList.h"
-
-typedef void psMetadata;        // not yet defined/implemented.
-typedef void psPlaneTransform;  // not yet defined/implemented.
-typedef void psPlaneDistort;    // not yet defined/implemented.
-typedef void psFixedPattern;    // not yet defined/implemented.
-typedef void psPhotSystem;      // not yet defined/implemented.
-
-struct psCell;
-struct psChip;
-struct psFPA;
-struct psExposure;
-
-/// @addtogroup AstroImage
-/// @{
-
-/** Readout data structure.
- *
- *  A readout is the result of a single read of a cell (or a portion thereof). 
- *  It contains a pointer to the pixel data, and additional pointers to the 
- *  objects found in the readout, and the readout metadata.  It also contains
- *  the offset from the lower-left corner of the chip, in the case that the
- *  CCD was windowed.
- *
- */
-typedef struct
-{
-    const unsigned int colBins;        ///< Amount of binning in x-dimension
-    const unsigned int rowBins;        ///< Amount of binning in y-dimension
-    const int col0;                    ///< Offset from the left of chip.
-    const int row0;                    ///< Offset from the bottom of chip.
-
-    psImage* image;                    ///< imaging area of Readout
-    psList*  objects;                  ///< objects derived from Readout
-    psMetadata* metadata;              ///< readout-level metadata
-}
-psReadout;
-
-/** Cell data structure
- * 
- *  A cell consists of one or more readouts.  It also contains a pointer to the
- *  cell's metadata, and its parent chip.  On the astrometry side, it also 
- *  contains coordinate transforms from the cell to chip, from the cell to 
- *  focal-plane, as well as a "quick and dirty" tranform from the cell to
- *  sky coordinates.
- *
- */
-typedef struct psCell
-{
-    psArray* readouts;                 ///< readouts from the cell
-    psMetadata* metadata;              ///< cell-level metadata
-
-    psPlaneTransform* toChip;          ///< transformations from cell to chip coordinates
-    psPlaneTransform* fromChip;        ///< transformations from chip to cell coordinates
-    psPlaneTransform* toFPA;           ///< transformations from cell to FPA coordinates
-    psPlaneTransform* toSky;           ///< transformations from cell to sky coordinates
-
-    struct psChip* parent;             ///< chip in which contains this cell
-}
-psCell;
-
-/** Chip data structure
- *
- *  A chip consists of one or more cells (according to the number of amplifiers
- *  on the CCD). It contains a pointer to the chip's metadata, and a pointer    
- *  to the parent focal plane.  For astrometry, ot contains a coordinate
- *  transform from the chip to the focal plane, and vis-versa.
- *
- */
-typedef struct psChip
-{
-    psArray* cells;                    ///< cells in the chip
-    psMetadata* metadata;              ///< chip-level metadata
-
-    psPlaneTransform* toFPA;           ///< transformation from chip to FPA coordinates
-    psPlaneTransform* fromFPA;         ///< transformation from FPA to chip coordinates
-
-    struct psFPA* parent;              ///< FPA which contains this chip
-}
-psChip;
-
-/** A Focal-Plane
- *
- *  A focal plane consists of one or more chips (according to the number of
- *  contiguous silicon).  It contains pointers to the focal-plane's metadata
- *  and the exposure information.  For astrometry, it contains a transformation
- *  from the focal plane to the tangent plane and the fixed pattern residuals.
- *  Since colors are involved in the transformation, it is necessary to specify
- *  the color the transformation is defined.  We also include some values to
- *  characterize the quality of the transformation: the root square deviation
- *  for the x and y transformation fits, and the chi-squared for the 
- *  transformation fit.
- *
- */
-typedef struct psFPA
-{
-    psArray* chips;                    ///< chips in the focal plane array
-    psMetadata* metadata;              ///< focal-plane's metadata
-
-    psPlaneDistort* fromTangentPlane;  ///< transformation from tangent plane to focal plane
-    psPlaneDistort* toTangentPlane;    ///< transformation from focal plane to tangent plane
-    psFixedPattern* pattern;           ///< fixed pattern residual offsets
-
-    const struct psExposure* exposure; ///< information about this exposure
-
-    psPhotSystem* colorPlus;           ///< Color reference
-    psPhotSystem* colorMinus;          ///< Color reference
-
-    float rmsX;                        ///< RMS for x transformation fits
-    float rmsY;                        ///< RMS for y transformation fits
-    float chi2;                        ///< chi^2 of astrometric solution
-}
-psFPA;
-
-/** Exposure Information
- *
- *  Several quantities from the telescope in order to make a first guess at 
- *  the astrometric solution.  From these quantities, further quantities can 
- *  be derivedand stored for later use.
- *
- */
-
-typedef struct psExposure
-{
-    const double ra;                  ///< Telescope boresight, right ascention
-    const double dec;                 ///< Telescope boresight, declination
-    const double hourAngle;           ///< Hour angle
-    const double zenith;              ///< Zenith distance
-    const double azimuth;             ///< Azimuth
-    const double localTime;           ///< Local Sidereal Time
-    const float date;                 ///< Modified Jullian Date of observation
-    const float rotAngle;             ///< Rotator position angle
-    const float temperature;          ///< Air temperature, for estimating refraction
-    const float pressure;             ///< Air pressure, for calculating refraction
-    const float humidity;             ///< Relative humidity, for refraction
-    const float exposureTime;         ///< Exposure time
-
-    /* Derived quantities */
-    const float positionAngle;        ///< Position angle
-    const float parallacticAngle;     ///< Parallactic angle
-    const float airmass;              ///< Airmass, calculated from zenith distance
-    const float parallacticFactor;    ///< Parallactic factor
-    const char *cameraName;           ///< name of camera which provided exposure
-    const char *telescopeName;        ///< name of telescope which provided exposure
-}
-psExposure;
-
-psExposure* psExposureAlloc(
-    double ra,                         ///< Telescope boresight, right ascention
-    double dec,                        ///< Telescope boresight, declination
-    double hourAngle,                  ///< Hour angle
-    double zenith,                     ///< Zenith distance
-    double azimuth,                    ///< Azimuth
-    double localTime,                  ///< Local Sidereal Time
-    float date,                        ///< MJD
-    float rotAngle,                    ///< Rotator position angle
-    float temperature,                 ///< Temperature
-    float pressure,                    ///< Pressure
-    float humidity,                    ///< Relative humidity
-    float exposureTime                 ///< Exposure time
-);
-
-#endif
Index: unk/psLib/src/astronomy/psCoord2.c
===================================================================
--- /trunk/psLib/src/astronomy/psCoord2.c	(revision 1381)
+++ 	(revision )
@@ -1,258 +1,0 @@
-/** @file  psCoord2.c
-*
-*  @brief Contains basic coordinate transformation definitions and operations
-*
-*  This file defines the basic types for astronomical coordinate 
-*  transformation
-*
-*  @ingroup CoordinateTransform
-*
-*  @author George Gusciora, MHPCC
-*
-*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 00:55:17 $
-*
-*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include "psType.h"
-#include "psImage.h"
-#include "psArray.h"
-#include "psList.h"
-#include "psFunctions.h"
-
-psGrommit *psGrommitAlloc( const psExposure *exp )
-{
-    psGrommit * grommit = ( psGrommit * ) psAlloc( sizeof( psGrommit ) );
-    
-    grommit->latitude = exp->dec;              // XXX Is this correct?
-    grommit->sinLat = sin( grommit->latitude );
-    grommit->cosLat = cos( grommit->latitude );
-    grommit->abberationMag = 0.0;
-    grommit->height = 0.0;
-    grommit->temperature = exp->temperature;
-    grommit->pressure = exp->pressure;
-    grommit->humidity = exp->humidity;
-    grommit->wavelength = 0.0;
-    grommit->lapseRate = 0.0;
-    grommit->refractA = 0.0;
-    grommit->refractB = 0.0;
-    grommit->longitudeOffset = ra;             // XXX Is this correct?
-    grommit->siderealTime = 0.0;
-    
-    return ( grommit );
-}
-
-void p_psGrommitFree( psGrommit *grommit )
-{
-    psFree( grommit );
-}
-
-psCell *psCellinFPA( psCell *out,
-                     const psPlane *coord,
-                     const psFPA *FPA )
-{
-    psChip * tmpChip = NULL;
-    psCell *tmpCell = NULL;
-    
-    tmpChip = psChipinFPA( tmpChip, coord, FPA );
-    tmpCell = psCellinChip( tmpCell, coord, tmpChip );
-    return ( tmpCell );
-}
-
-
-psChip *psChipinFPA( psChip *out,
-                     const psPlane *coord,
-                     const psFPA *FPA )
-{
-    psFPA * tmpChip = NULL;
-    
-    for ( tmpChip = FPA->chips; tmpChip != NULL; tmpChip++ ) {
-            tmpCoord = psPlaneTransformApply( out, tmpChip->fromFPA, coord );
-            
-            
-            //XXX     if (this is the correct chip)
-            return ( tmpChip );
-        }
-}
-
-#define PS_CHECK_VALID_IMAGE_COORDS(X, Y, IMAGE) \
-
-p_psCheckValidImageCoords(double x, double y, tmpImage)
-{
-    if ( ( x < 0.0 ) ||
-            ( x > ( double ) tmpImage->numCols ) ||
-            ( y < 0.0 ) ||
-            ( y > ( double ) tmpImage->numRows ) ) {
-            return ( 0 );
-        }
-    return ( 1 );
-}
-
-
-/*****************************************************************************
-XXX: We assume that readouts have valid coordinates from the range
-(0,numRows or numCols) in each dimension, and that they are square with the
-x/y axis.
- 
-XXX: We assume that if a cell has more than one readout, all readouts have
-the same coordinates.
- 
-XXX: if we find no cell with has this coordinate, we return NULL.
- 
-XXX: must deallocate memory.
- *****************************************************************************/
-psCell *psCellinChip( psCell *out,
-                      const psPlane *coord,
-                      const psChip *chip )
-{
-    psCell * tmpCell = NULL;
-    psReadout *tmpReadout = NULL;
-    psPlane *tmpCoord = NULL;
-    
-    for ( tmpCell = chip->cells; tmpCell != NULL; tmpCell++ ) {
-            if ( tmpCell->readouts != NULL ) {
-                    tmpReadout = tmpCell->readouts;
-                    tmpCoord = psPlaneTransformApply( out, tmpCell->fromChip, coord );
-                    if ( p_psCheckValidImageCoords( tmpCoord->x, tmpCoord->y,
-                                                    tmpReadout->image ) ) {
-                            return ( tmpCell );
-                        }
-                }
-        }
-    return ( NULL );
-}
-
-psPlane *psCoordCelltoChip( psPlane *out,
-                            const psPlane *in,
-                            const psCell *cell )
-{
-    return ( psPlaneTransformApply( out, cell->toChip, in ) );
-}
-
-psPlane *psCoordChipToFPA( psPlane *out,
-                           const psPlane *in,
-                           const psChip *chip )
-{
-    return ( psPlaneTransformApply( out, chip->toFPA, in ) );
-}
-
-psPlane *psCoordFPAtoTP( psPlane *out,
-                         const psPlane *in,
-                         const psFPA *fpa )
-{
-    return ( psPlaneTransformApply( out, fpa->toTangentPlane, in ) );
-}
-
-psSphere *psCoordTPtoSky( psSphere *out,
-                          const psPlane *in,
-                          const psGrommit *grommit )
-{}
-
-
-psPlane *psCoordCellToFPA( psPlane *out,
-                           const psPlane *in,
-                           const psCell *cell )
-{
-    return ( psPlaneTransformApply( out, cell->toFPA, in ) );
-}
-
-
-// XXX: This implementation requires a new psGrommit be created for each
-// transformation, as well as a few psPlane structs.  Can this be implemented
-// better?
-psSphere *psCoordCelltoSky( psSphere *out,
-                            const psPlane *in,
-                            const psCell *cell )
-{
-    psPlane * tmp1 = NULL;
-    psPlane *tmp2 = NULL;
-    psFPA *parFPA = ( cell->parent ) ->parent;
-    psGrommit *tmpGrommit = NULL;
-    
-    tmp1 = psPlaneTransformApply( tmp1, cell->toFPA, in )
-           tmp2 = psPlaneTransformApply( tmp2, parFPA->toTangentPlane, tmp1 )
-                  tmpGrommit = psGrommitAlloc( parFPA->exposure )
-                               tmp3 = psCoordTPtoSky( out, tmp2, psGrommit );
-                               
-    psFree( tmp1 );
-    psFree( tmp2 );
-    psFree( tmpGrommit );
-    
-    return ( psCoordTPtoSky( out, tmp2, psGrommit );
-         }
-         
-         psSphere *psCoordCelltoSkyQuick( psSphere *out,
-                                          const psPlane *in,
-                                          const psCell *cell )
-         {
-             psPlane * tmp1 = NULL;
-             
-             tmp1 = psPlaneTransformApply( tmp1, cell->toSky, in );
-             
-             //XXX: Do something to convert the linear coords in tmp1 to spherical
-             // coords in out.
-             
-             free( tmp1 )
-             
-             return ( out );
-         }
-         
-         psPlane *psCoordSkytoTP( psPlane *out,
-                                  const psSphere *in,
-                                  const psGrommit *grommit )
-         {
-             if ( out == NULL ) {
-                     out = ( psPlane * ) psAlloc( sizeof( psPlane ) );
-                 }
-                 
-             return ( out );
-         }
-         
-         psPlane *psCoordTPtoFPA( psPlane *out,
-                                  const psPlane *in,
-                                  const psFPA *fpa )
-         {
-             return ( psPlaneTransformApply( out, fpa->fromTangentPlane, in ) );
-         }
-         
-         psPlane *psCoordFPAtoChip( psPlane *out,
-                                    const psPlane *in,
-                                    const psChip *chip )
-         {
-             return ( psPlaneTransformApply( out, chip->fromFPA, in ) );
-         }
-         
-         
-         psPlane *psCoordChiptoCell( psPlane *out,
-                                     const psPlane *in,
-                                     const psCell *cell )
-         {
-             return ( psPlaneTransformApply( out, cell->fromChip, in ) );
-         }
-         
-         psPlane *psCoordSkytoCell( psPlane *out,
-                                    const psSphere *in,
-                                    const psCell *cell )
-         {
-             out = psCoordSkytoTP( out, in, tmpGrommit );
-             out = psCoordTPtoFPA( out, out, whichFPA );
-             out = psCoordFPAtoChip( out, out, whichChip );
-             out = psCoordChiptoCell( out, out, whichCell );
-             
-             return ( out );
-         }
-         
-         psPlane *psCoordSkytoCellQuick( psPlane *out,
-                                         const psSphere *in,
-                                         const psCell *cell )
-         {
-             if ( out == NULL ) {
-                     out = ( psPlane * ) psAlloc( sizeof( psPlane ) );
-                 }
-                 
-             return ( out );
-         }
-         
-         
-         
Index: unk/psLib/src/astronomy/psCoord2.h
===================================================================
--- /trunk/psLib/src/astronomy/psCoord2.h	(revision 1381)
+++ 	(revision )
@@ -1,130 +1,0 @@
-/** @file  psCoord2.h
-*
-*  @brief Contains basic coordinate transformation definitions and operations
-*
-*  This file defines the basic types for astronomical coordinate 
-*  transformation
-*
-*  @ingroup CoordinateTransform
-*
-*  @author George Gusciora, MHPCC
-*
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 00:55:17 $
-*
-*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
-*/
-
-# ifndef PS_COORD2_H
-# define PS_COORD2_H
-
-#include "psType.h"
-#include "psImage.h"
-#include "psArray.h"
-#include "psList.h"
-#include "psFunctions.h"
-
-/// @addtogroup CoordinateTransform
-/// @{
-
-typedef struct
-    {
-        const double latitude;             ///<
-        const double sinLat, cosLat;       ///<
-        const double abberationMag;        ///<
-        const double height;               ///<
-        const double temperature;          ///<
-        const double pressure;             ///<
-        const double humidity;             ///<
-        const double wavelength;           ///<
-        const double lapseRate;            ///<
-        const double refractA, refractB;   ///<
-        const double longitudeOffset;      ///<
-        const double siderealTime;         ///<
-    }
-psGrommit;
-
-typedef struct
-    {
-        int nX, nY;               ///<
-        double x0, y0;            ///<
-        double xScale, yScale;    ///<
-        double **x, **y;          ///<
-    }
-psFixedPattern;
-
-psGrommit *psGrommitAlloc( const psExposure *exp );
-
-void p_psGrommitFree( psGrommit *grommit );
-
-psCell *psCellinFPA( psCell *out,
-                     const psPlane *coord,
-                     const psFPA *FPA );
-                     
-psChip *psChipinFPA( psChip *out,
-                     const psPlane *coord,
-                     const psFPA *FPA );
-                     
-psCell *psCellinChip( psCell *out,
-                      const psPlane *coord,
-                      const psChip *chip );
-                      
-                      
-                      
-                      
-psPlane *psCoordCelltoChip( psPlane *out,
-                            const psPlane *in,
-                            const psCell *cell );
-                            
-psPlane *psCoordChipToFPA( psPlane *out,
-                           const psPlane *in,
-                           const psChip *chip );
-                           
-psPlane *psCoordFPAtoTP( psPlane *out,
-                         const psPlane *in,
-                         const psFPA *fpa );
-                         
-psSphere *psCoordTPtoSky( psSphere *out,
-                          const psPlane *in,
-                          const psGrommit *grommit );
-                          
-psPlane *psCoordCellToFPA( psPlane *out,
-                           const psPlane *in,
-                           const psCell *cell );
-                           
-psSphere *psCoordCelltoSky( psSphere *out,
-                            const psPlane *in,
-                            const psCell *cell );
-                            
-psSphere *psCoordCelltoSkyQuick( psSphere *out,
-                                 const psPlane *in,
-                                 const psCell *cell );
-                                 
-psPlane *psCoordSkytoTP( psPlane *out,
-                         const psSphere *in,
-                         const psGrommit *grommit );
-                         
-psPlane *psCoordTPtoFPA( psPlane *out,
-                         const psPlane *in,
-                         const psFPA *fpa );
-                         
-psPlane *psCoordFPAtoChip( psPlane *out,
-                           const psPlane *in,
-                           const psChip *chip );
-                           
-psPlane *psCoordChiptoCell( psPlane *out,
-                            const psPlane *in,
-                            const psCell *cell );
-                            
-psPlane *psCoordSkytoCell( psPlane *out,
-                           const psSphere *in,
-                           const psCell *cell );
-                           
-psPlane *psCoordSkytoCellQuick( psPlane *out,
-                                const psSphere *in,
-                                const psCell *cell );
-                                
-                                
-/// @}
-
-#endif
Index: /trunk/psLib/src/astronomy/psMetadata.h
===================================================================
--- /trunk/psLib/src/astronomy/psMetadata.h	(revision 1381)
+++ /trunk/psLib/src/astronomy/psMetadata.h	(revision 1382)
@@ -10,6 +10,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 20:59:41 $
+*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 22:11:09 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,4 +18,10 @@
 #define PS_METADATA_H
 
+#include <stdarg.h>
+#include <stdio.h>
+#include <fitsio.h>
+
+#include "psHash.h"
+#include "psList.h"
 
 /// @addtogroup Metadata
@@ -33,15 +39,15 @@
  */
 typedef enum {
-    PS_META_ITEM_SET = 0,                  ///< Null. Metadata is in psMetadataItem.items
-    PS_META_BOOL,                          ///< Boolean data.
-    PS_META_S32,                           ///< Signed 32-bit integer data.
-    PS_META_F32,                           ///< Single-precision float data.
-    PS_META_F64,                           ///< Double-precision float data.
-    PS_META_STR,                           ///< String data (Stored in as void *).
-    PS_META_IMG,                           ///< Image data (Stored in as void *).
-    PS_META_JPEG,                          ///< JPEG data (Stored in as void .
-    PS_META_PNG,                           ///< PNG data (Stored in as void *).
-    PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
-    PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
+    PS_META_ITEM_SET = 0,                   ///< Null. Metadata is in psMetadataItem.items
+    PS_META_BOOL,                           ///< Boolean data.
+    PS_META_S32,                            ///< Signed 32-bit integer data.
+    PS_META_F32,                            ///< Single-precision float data.
+    PS_META_F64,                            ///< Double-precision float data.
+    PS_META_STR,                            ///< String data (Stored in as void *).
+    PS_META_IMG,                            ///< Image data (Stored in as void *).
+    PS_META_JPEG,                           ///< JPEG data (Stored in as void .
+    PS_META_PNG,                            ///< PNG data (Stored in as void *).
+    PS_META_ASTROM,                         ///< Astrometric coefficients (Stored in as void *).
+    PS_META_UNKNOWN,                        ///< Other data (Stored in as void *).
     PS_META_NTYPE                         ///< Number of types. Must be last.
 } psMetadataType;
@@ -78,6 +84,6 @@
 typedef struct psMetadata
     {
-        psList *restrict list;
-        psHash *restrict table;
+        psList* restrict list;
+        psHash* restrict table;
     }
 psMetadata;
@@ -102,7 +108,7 @@
  */
 psMetadataItem *psMetadataItemAlloc(
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     ...                                 ///< Arguments for name formatting and metadata item data.
 );
@@ -122,7 +128,7 @@
  */
 psMetadataItem *psMetadataItemAllocV(
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     va_list list                        ///< Arguments for name formatting and metadata item data.
 );
@@ -145,6 +151,6 @@
  */
 bool psMetadataAddItem(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be added.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be added.
     psMetadataItem *restrict item       ///< Metadata item to be added.
 );
@@ -157,9 +163,9 @@
  */
 bool psMetadataAdd(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be added.
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be added.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     ...                                 ///< Arguments for name formatting and metadata item data.
 );
@@ -175,6 +181,6 @@
  */
 bool psMetadataRemove(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be removed.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be removed.
     const char *restrict key            ///< Name of metadata key.
 );
@@ -188,5 +194,5 @@
  */
 psMetadataItem *psMetadataLookup(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     const char *restrict key            ///< Name of metadata key.
 );
@@ -199,5 +205,5 @@
  */
 psMetadataItem *psMetadataGet(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     int where                           ///< Location to be retrieved.
 );
@@ -210,5 +216,5 @@
  */
 bool psMetadataSetIterator(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
     int where                           ///< Location of iterator.
 );
@@ -221,6 +227,6 @@
  */
 psMetadataItem *psMetadataGetNext(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
-    const char *restrict match,            ///< Beginning of key name.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
+    const char *restrict match,             ///< Beginning of key name.
     int which                           ///< Iterator to be used.
 );
@@ -233,6 +239,6 @@
  */
 psMetadataItem *psMetadataGetPrevious(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
-    const char *restrict match,            ///< Beginning of key name.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
+    const char *restrict match,             ///< Beginning of key name.
     int which                           ///< Iterator to be used.
 );
@@ -249,6 +255,6 @@
  */
 void psMetadataItemPrint(
-    FILE *fd,                                      ///< Pointer to file to write metadata item.
-    const char *format,                            ///< Format to print metadata item.
+    FILE *fd,                                       ///< Pointer to file to write metadata item.
+    const char *format,                             ///< Format to print metadata item.
     const psMetadataItem *restrict metadataItem ///< Metadata item to print.
 );
@@ -261,7 +267,7 @@
  */
 psMetadata *psMetadataReadHeader(
-    psMetadata *output,                    ///< Resulting metadata from read.
-    const char *extname,                   ///< File name extension string.
-    int extnum,                            ///< File name extension number.
+    psMetadata *output,                     ///< Resulting metadata from read.
+    const char *extname,                    ///< File name extension string.
+    int extnum,                             ///< File name extension number.
     const char *filename                ///< Name of file to read.
 );
@@ -274,8 +280,8 @@
  */
 psMetadata *psMetadataFReadHeader(
-    psMetadata *output,                    ///< Resulting metadata from read.
-    const char *extname,                   ///< File name extension string.
-    int extnum,                            ///< File name extension number.
-    fitsfile *fd                        ///< Pointer to file to read.
+    psMetadata *output,                     ///< Resulting metadata from read.
+    const char *extname,                    ///< File name extension string.
+    int extnum,                             ///< File name extension number.
+    fitsfile *fd                           ///< Pointer to file to read.
 );
 /// @}
Index: /trunk/psLib/src/collections/psMetadata.h
===================================================================
--- /trunk/psLib/src/collections/psMetadata.h	(revision 1381)
+++ /trunk/psLib/src/collections/psMetadata.h	(revision 1382)
@@ -10,6 +10,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 20:59:41 $
+*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 22:11:09 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,4 +18,10 @@
 #define PS_METADATA_H
 
+#include <stdarg.h>
+#include <stdio.h>
+#include <fitsio.h>
+
+#include "psHash.h"
+#include "psList.h"
 
 /// @addtogroup Metadata
@@ -33,15 +39,15 @@
  */
 typedef enum {
-    PS_META_ITEM_SET = 0,                  ///< Null. Metadata is in psMetadataItem.items
-    PS_META_BOOL,                          ///< Boolean data.
-    PS_META_S32,                           ///< Signed 32-bit integer data.
-    PS_META_F32,                           ///< Single-precision float data.
-    PS_META_F64,                           ///< Double-precision float data.
-    PS_META_STR,                           ///< String data (Stored in as void *).
-    PS_META_IMG,                           ///< Image data (Stored in as void *).
-    PS_META_JPEG,                          ///< JPEG data (Stored in as void .
-    PS_META_PNG,                           ///< PNG data (Stored in as void *).
-    PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
-    PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
+    PS_META_ITEM_SET = 0,                   ///< Null. Metadata is in psMetadataItem.items
+    PS_META_BOOL,                           ///< Boolean data.
+    PS_META_S32,                            ///< Signed 32-bit integer data.
+    PS_META_F32,                            ///< Single-precision float data.
+    PS_META_F64,                            ///< Double-precision float data.
+    PS_META_STR,                            ///< String data (Stored in as void *).
+    PS_META_IMG,                            ///< Image data (Stored in as void *).
+    PS_META_JPEG,                           ///< JPEG data (Stored in as void .
+    PS_META_PNG,                            ///< PNG data (Stored in as void *).
+    PS_META_ASTROM,                         ///< Astrometric coefficients (Stored in as void *).
+    PS_META_UNKNOWN,                        ///< Other data (Stored in as void *).
     PS_META_NTYPE                         ///< Number of types. Must be last.
 } psMetadataType;
@@ -78,6 +84,6 @@
 typedef struct psMetadata
     {
-        psList *restrict list;
-        psHash *restrict table;
+        psList* restrict list;
+        psHash* restrict table;
     }
 psMetadata;
@@ -102,7 +108,7 @@
  */
 psMetadataItem *psMetadataItemAlloc(
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     ...                                 ///< Arguments for name formatting and metadata item data.
 );
@@ -122,7 +128,7 @@
  */
 psMetadataItem *psMetadataItemAllocV(
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     va_list list                        ///< Arguments for name formatting and metadata item data.
 );
@@ -145,6 +151,6 @@
  */
 bool psMetadataAddItem(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be added.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be added.
     psMetadataItem *restrict item       ///< Metadata item to be added.
 );
@@ -157,9 +163,9 @@
  */
 bool psMetadataAdd(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be added.
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be added.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     ...                                 ///< Arguments for name formatting and metadata item data.
 );
@@ -175,6 +181,6 @@
  */
 bool psMetadataRemove(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be removed.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be removed.
     const char *restrict key            ///< Name of metadata key.
 );
@@ -188,5 +194,5 @@
  */
 psMetadataItem *psMetadataLookup(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     const char *restrict key            ///< Name of metadata key.
 );
@@ -199,5 +205,5 @@
  */
 psMetadataItem *psMetadataGet(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     int where                           ///< Location to be retrieved.
 );
@@ -210,5 +216,5 @@
  */
 bool psMetadataSetIterator(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
     int where                           ///< Location of iterator.
 );
@@ -221,6 +227,6 @@
  */
 psMetadataItem *psMetadataGetNext(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
-    const char *restrict match,            ///< Beginning of key name.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
+    const char *restrict match,             ///< Beginning of key name.
     int which                           ///< Iterator to be used.
 );
@@ -233,6 +239,6 @@
  */
 psMetadataItem *psMetadataGetPrevious(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
-    const char *restrict match,            ///< Beginning of key name.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
+    const char *restrict match,             ///< Beginning of key name.
     int which                           ///< Iterator to be used.
 );
@@ -249,6 +255,6 @@
  */
 void psMetadataItemPrint(
-    FILE *fd,                                      ///< Pointer to file to write metadata item.
-    const char *format,                            ///< Format to print metadata item.
+    FILE *fd,                                       ///< Pointer to file to write metadata item.
+    const char *format,                             ///< Format to print metadata item.
     const psMetadataItem *restrict metadataItem ///< Metadata item to print.
 );
@@ -261,7 +267,7 @@
  */
 psMetadata *psMetadataReadHeader(
-    psMetadata *output,                    ///< Resulting metadata from read.
-    const char *extname,                   ///< File name extension string.
-    int extnum,                            ///< File name extension number.
+    psMetadata *output,                     ///< Resulting metadata from read.
+    const char *extname,                    ///< File name extension string.
+    int extnum,                             ///< File name extension number.
     const char *filename                ///< Name of file to read.
 );
@@ -274,8 +280,8 @@
  */
 psMetadata *psMetadataFReadHeader(
-    psMetadata *output,                    ///< Resulting metadata from read.
-    const char *extname,                   ///< File name extension string.
-    int extnum,                            ///< File name extension number.
-    fitsfile *fd                        ///< Pointer to file to read.
+    psMetadata *output,                     ///< Resulting metadata from read.
+    const char *extname,                    ///< File name extension string.
+    int extnum,                             ///< File name extension number.
+    fitsfile *fd                           ///< Pointer to file to read.
 );
 /// @}
Index: /trunk/psLib/src/dataManip/psFunctions.h
===================================================================
--- /trunk/psLib/src/dataManip/psFunctions.h	(revision 1381)
+++ /trunk/psLib/src/dataManip/psFunctions.h	(revision 1382)
@@ -1,23 +1,26 @@
 /** @file psFunctions.h
- *  \brief Standard Mathematical Functions.
- *  \ingroup Stats
- *
- *  This file will hold the prototypes for procedures which allocate, free,
- *  and evaluate various polynomials.  Those polynomial structures are also
- *  defined here.
- *
- *  @ingroup Stats
- *
- *  @author Someone at IfA
- *  @author George Gusciora, MHPCC
- *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-29 23:34:24 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- */
+*  \brief Standard Mathematical Functions.
+*  \ingroup Stats
+*
+*  This file will hold the prototypes for procedures which allocate, free,
+*  and evaluate various polynomials.  Those polynomial structures are also
+*  defined here.
+*
+*  @ingroup Stats
+*
+*  @author Someone at IfA
+*  @author George Gusciora, MHPCC
+*
+*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 22:11:09 $
+*
+*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+*/
 
 #if !defined(PS_FUNCTIONS_H)
 #define PS_FUNCTIONS_H
+
+#include <stdbool.h>
+
 #include "psVector.h"
 
@@ -31,59 +34,59 @@
 
 float
-psGaussian(float x,        ///< Value at which to evaluate
-           float mean,     ///< Mean for the Gaussian
-           float stddev,   ///< Standard deviation for the Gaussian
-           bool  normal      ///< Indicates whether result should be normalized
+psGaussian( float x,         ///< Value at which to evaluate
+            float mean,      ///< Mean for the Gaussian
+            float stddev,    ///< Standard deviation for the Gaussian
+            bool normal      ///< Indicates whether result should be normalized
           );
-
-
+          
+          
 /** Produce a vector of random numbers from a Gaussian distribution with
     the specified mean and sigma */
-psVector *psGaussianDev(float mean,    ///< The mean of the Gaussian
-                        float sigma,   ///< The sigma of the Gaussian
-                        int Npts);     ///< The size of the vector
-
-
-
-
-
+psVector *psGaussianDev( float mean,     ///< The mean of the Gaussian
+                         float sigma,    ///< The sigma of the Gaussian
+                         int Npts );     ///< The size of the vector
+                         
+                         
+                         
+                         
+                         
 /** One-dimensional polynomial */
 typedef struct
-{
-    int n;           ///< Number of terms
-    float *coeff;    ///< Coefficients
-    float *coeffErr; ///< Error in coefficients
-    char *mask;      ///< Coefficient mask
-}
+    {
+        int n;           ///< Number of terms
+        float *coeff;    ///< Coefficients
+        float *coeffErr; ///< Error in coefficients
+        char *mask;      ///< Coefficient mask
+    }
 psPolynomial1D;
 
 /** Two-dimensional polynomial */
 typedef struct
-{
-    int nX, nY;    ///< Number of terms in x and y
-    float **coeff;   ///< Coefficients
-    float **coeffErr;   ///< Error in coefficients
-    char **mask;   ///< Coefficients mask
-}
+    {
+        int nX, nY;    ///< Number of terms in x and y
+        float **coeff;   ///< Coefficients
+        float **coeffErr;   ///< Error in coefficients
+        char **mask;   ///< Coefficients mask
+    }
 psPolynomial2D;
 
 /** Three-dimensional polynomial */
 typedef struct
-{
-    int nX, nY, nZ;   ///< Number of terms in x, y and z
-    float ***coeff;    ///< Coefficients
-    float ***coeffErr;    ///< Error in coefficients
-    char ***mask;    ///< Coefficients mask
-}
+    {
+        int nX, nY, nZ;   ///< Number of terms in x, y and z
+        float ***coeff;    ///< Coefficients
+        float ***coeffErr;    ///< Error in coefficients
+        char ***mask;    ///< Coefficients mask
+    }
 psPolynomial3D;
 
 /** Four-dimensional polynomial */
 typedef struct
-{
-    int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
-    float ****coeff;    ///< Coefficients
-    float ****coeffErr;   ///< Error in coefficients
-    char ****mask;    ///< Coefficients mask
-}
+    {
+        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
+        float ****coeff;    ///< Coefficients
+        float ****coeffErr;   ///< Error in coefficients
+        char ****mask;    ///< Coefficients mask
+    }
 psPolynomial4D;
 
@@ -92,46 +95,46 @@
 
 /** Constructor */
-psPolynomial1D *psPolynomial1DAlloc(int n ///< Number of terms
-                                   );
-/** Constructor */
-psPolynomial2D *psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
-                                   );
-/** Constructor */
-psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
-                                   );
-/** Constructor */
-psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
-                                   );
-
+psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms
+                                   );
+/** Constructor */
+psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
+                                   );
+/** Constructor */
+psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
+                                   );
+/** Constructor */
+psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
+                                   );
+                                   
 /** Evaluate 1D polynomial */
 float
-psPolynomial1DEval(float x,  ///< Value at which to evaluate
-                   const psPolynomial1D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial1DEval( float x,   ///< Value at which to evaluate
+                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 2D polynomial */
 float
-psPolynomial2DEval(float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   const psPolynomial2D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial2DEval( float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 3D polynomial */
 float
-psPolynomial3DEval(float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   float z,  ///< Value z at which to evaluate
-                   const psPolynomial3D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial3DEval( float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    float z,   ///< Value z at which to evaluate
+                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 4D polynomial */
 float
-psPolynomial4DEval(float w,  ///< Value w at which to evaluate
-                   float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   float z,  ///< Value z at which to evaluate
-                   const psPolynomial4D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial4DEval( float w,   ///< Value w at which to evaluate
+                    float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    float z,   ///< Value z at which to evaluate
+                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /*****************************************************************************/
 
@@ -140,85 +143,85 @@
 /** Double-precision one-dimensional polynomial */
 typedef struct
-{
-    int n;    ///< Number of terms
-    double *coeff;   ///< Coefficients
-    double *coeffErr;   ///< Error in coefficients
-    char *mask;    ///< Coefficient mask
-}
+    {
+        int n;    ///< Number of terms
+        double *coeff;   ///< Coefficients
+        double *coeffErr;   ///< Error in coefficients
+        char *mask;    ///< Coefficient mask
+    }
 psDPolynomial1D;
 
 /** Double-precision two-dimensional polynomial */
 typedef struct
-{
-    int nX, nY;    ///< Number of terms in x and y
-    double **coeff;   ///< Coefficients
-    double **coeffErr;    ///< Error in coefficients
-    char **mask;   ///< Coefficients mask
-}
+    {
+        int nX, nY;    ///< Number of terms in x and y
+        double **coeff;   ///< Coefficients
+        double **coeffErr;    ///< Error in coefficients
+        char **mask;   ///< Coefficients mask
+    }
 psDPolynomial2D;
 
 /** Double-precision three-dimensional polynomial */
 typedef struct
-{
-    int nX, nY, nZ;   ///< Number of terms in x, y and z
-    double ***coeff;   ///< Coefficients
-    double ***coeffErr;   ///< Error in coefficients
-    char ***mask;    ///< Coefficient mask
-}
+    {
+        int nX, nY, nZ;   ///< Number of terms in x, y and z
+        double ***coeff;   ///< Coefficients
+        double ***coeffErr;   ///< Error in coefficients
+        char ***mask;    ///< Coefficient mask
+    }
 psDPolynomial3D;
 
 /** Double-precision four-dimensional polynomial */
 typedef struct
-{
-    int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
-    double ****coeff;    ///< Coefficients
-    double ****coeffErr;   ///< Error in coefficients
-    char ****mask;    ///< Coefficients mask
-}
+    {
+        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
+        double ****coeff;    ///< Coefficients
+        double ****coeffErr;   ///< Error in coefficients
+        char ****mask;    ///< Coefficients mask
+    }
 psDPolynomial4D;
 
 /** Constructor */
-psDPolynomial1D *psDPolynomial1DAlloc(int n ///< Number of terms
-                                     );
-/** Constructor */
-psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
-                                     );
-/** Constructor */
-psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
-                                     );
-/** Constructor */
-psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
-                                     );
-
+psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms
+                                     );
+/** Constructor */
+psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
+                                     );
+/** Constructor */
+psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
+                                     );
+/** Constructor */
+psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
+                                     );
+                                     
 /** Evaluate 1D polynomial (double precision) */
 double
-psDPolynomial1DEval(double x,  ///< Value at which to evaluate
-                    const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial1DEval( double x,   ///< Value at which to evaluate
+                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 2D polynomial (double precision) */
 double
-psDPolynomial2DEval(double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial2DEval( double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 3D polynomial (double precision) */
 double
-psDPolynomial3DEval(double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    double z,  ///< Value z at which to evaluate
-                    const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial3DEval( double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     double z,   ///< Value z at which to evaluate
+                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 4D polynomial (double precision) */
 double
-psDPolynomial4DEval(double w,  ///< Value w at which to evaluate
-                    double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    double z,  ///< Value z at which to evaluate
-                    const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial4DEval( double w,   ///< Value w at which to evaluate
+                     double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     double z,   ///< Value z at which to evaluate
+                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /* \} */ // End of MathGroup Functions
 
Index: /trunk/psLib/src/math/psPolynomial.h
===================================================================
--- /trunk/psLib/src/math/psPolynomial.h	(revision 1381)
+++ /trunk/psLib/src/math/psPolynomial.h	(revision 1382)
@@ -1,23 +1,26 @@
 /** @file psFunctions.h
- *  \brief Standard Mathematical Functions.
- *  \ingroup Stats
- *
- *  This file will hold the prototypes for procedures which allocate, free,
- *  and evaluate various polynomials.  Those polynomial structures are also
- *  defined here.
- *
- *  @ingroup Stats
- *
- *  @author Someone at IfA
- *  @author George Gusciora, MHPCC
- *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-29 23:34:24 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- */
+*  \brief Standard Mathematical Functions.
+*  \ingroup Stats
+*
+*  This file will hold the prototypes for procedures which allocate, free,
+*  and evaluate various polynomials.  Those polynomial structures are also
+*  defined here.
+*
+*  @ingroup Stats
+*
+*  @author Someone at IfA
+*  @author George Gusciora, MHPCC
+*
+*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 22:11:09 $
+*
+*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+*/
 
 #if !defined(PS_FUNCTIONS_H)
 #define PS_FUNCTIONS_H
+
+#include <stdbool.h>
+
 #include "psVector.h"
 
@@ -31,59 +34,59 @@
 
 float
-psGaussian(float x,        ///< Value at which to evaluate
-           float mean,     ///< Mean for the Gaussian
-           float stddev,   ///< Standard deviation for the Gaussian
-           bool  normal      ///< Indicates whether result should be normalized
+psGaussian( float x,         ///< Value at which to evaluate
+            float mean,      ///< Mean for the Gaussian
+            float stddev,    ///< Standard deviation for the Gaussian
+            bool normal      ///< Indicates whether result should be normalized
           );
-
-
+          
+          
 /** Produce a vector of random numbers from a Gaussian distribution with
     the specified mean and sigma */
-psVector *psGaussianDev(float mean,    ///< The mean of the Gaussian
-                        float sigma,   ///< The sigma of the Gaussian
-                        int Npts);     ///< The size of the vector
-
-
-
-
-
+psVector *psGaussianDev( float mean,     ///< The mean of the Gaussian
+                         float sigma,    ///< The sigma of the Gaussian
+                         int Npts );     ///< The size of the vector
+                         
+                         
+                         
+                         
+                         
 /** One-dimensional polynomial */
 typedef struct
-{
-    int n;           ///< Number of terms
-    float *coeff;    ///< Coefficients
-    float *coeffErr; ///< Error in coefficients
-    char *mask;      ///< Coefficient mask
-}
+    {
+        int n;           ///< Number of terms
+        float *coeff;    ///< Coefficients
+        float *coeffErr; ///< Error in coefficients
+        char *mask;      ///< Coefficient mask
+    }
 psPolynomial1D;
 
 /** Two-dimensional polynomial */
 typedef struct
-{
-    int nX, nY;    ///< Number of terms in x and y
-    float **coeff;   ///< Coefficients
-    float **coeffErr;   ///< Error in coefficients
-    char **mask;   ///< Coefficients mask
-}
+    {
+        int nX, nY;    ///< Number of terms in x and y
+        float **coeff;   ///< Coefficients
+        float **coeffErr;   ///< Error in coefficients
+        char **mask;   ///< Coefficients mask
+    }
 psPolynomial2D;
 
 /** Three-dimensional polynomial */
 typedef struct
-{
-    int nX, nY, nZ;   ///< Number of terms in x, y and z
-    float ***coeff;    ///< Coefficients
-    float ***coeffErr;    ///< Error in coefficients
-    char ***mask;    ///< Coefficients mask
-}
+    {
+        int nX, nY, nZ;   ///< Number of terms in x, y and z
+        float ***coeff;    ///< Coefficients
+        float ***coeffErr;    ///< Error in coefficients
+        char ***mask;    ///< Coefficients mask
+    }
 psPolynomial3D;
 
 /** Four-dimensional polynomial */
 typedef struct
-{
-    int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
-    float ****coeff;    ///< Coefficients
-    float ****coeffErr;   ///< Error in coefficients
-    char ****mask;    ///< Coefficients mask
-}
+    {
+        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
+        float ****coeff;    ///< Coefficients
+        float ****coeffErr;   ///< Error in coefficients
+        char ****mask;    ///< Coefficients mask
+    }
 psPolynomial4D;
 
@@ -92,46 +95,46 @@
 
 /** Constructor */
-psPolynomial1D *psPolynomial1DAlloc(int n ///< Number of terms
-                                   );
-/** Constructor */
-psPolynomial2D *psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
-                                   );
-/** Constructor */
-psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
-                                   );
-/** Constructor */
-psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
-                                   );
-
+psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms
+                                   );
+/** Constructor */
+psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
+                                   );
+/** Constructor */
+psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
+                                   );
+/** Constructor */
+psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
+                                   );
+                                   
 /** Evaluate 1D polynomial */
 float
-psPolynomial1DEval(float x,  ///< Value at which to evaluate
-                   const psPolynomial1D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial1DEval( float x,   ///< Value at which to evaluate
+                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 2D polynomial */
 float
-psPolynomial2DEval(float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   const psPolynomial2D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial2DEval( float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 3D polynomial */
 float
-psPolynomial3DEval(float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   float z,  ///< Value z at which to evaluate
-                   const psPolynomial3D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial3DEval( float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    float z,   ///< Value z at which to evaluate
+                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 4D polynomial */
 float
-psPolynomial4DEval(float w,  ///< Value w at which to evaluate
-                   float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   float z,  ///< Value z at which to evaluate
-                   const psPolynomial4D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial4DEval( float w,   ///< Value w at which to evaluate
+                    float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    float z,   ///< Value z at which to evaluate
+                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /*****************************************************************************/
 
@@ -140,85 +143,85 @@
 /** Double-precision one-dimensional polynomial */
 typedef struct
-{
-    int n;    ///< Number of terms
-    double *coeff;   ///< Coefficients
-    double *coeffErr;   ///< Error in coefficients
-    char *mask;    ///< Coefficient mask
-}
+    {
+        int n;    ///< Number of terms
+        double *coeff;   ///< Coefficients
+        double *coeffErr;   ///< Error in coefficients
+        char *mask;    ///< Coefficient mask
+    }
 psDPolynomial1D;
 
 /** Double-precision two-dimensional polynomial */
 typedef struct
-{
-    int nX, nY;    ///< Number of terms in x and y
-    double **coeff;   ///< Coefficients
-    double **coeffErr;    ///< Error in coefficients
-    char **mask;   ///< Coefficients mask
-}
+    {
+        int nX, nY;    ///< Number of terms in x and y
+        double **coeff;   ///< Coefficients
+        double **coeffErr;    ///< Error in coefficients
+        char **mask;   ///< Coefficients mask
+    }
 psDPolynomial2D;
 
 /** Double-precision three-dimensional polynomial */
 typedef struct
-{
-    int nX, nY, nZ;   ///< Number of terms in x, y and z
-    double ***coeff;   ///< Coefficients
-    double ***coeffErr;   ///< Error in coefficients
-    char ***mask;    ///< Coefficient mask
-}
+    {
+        int nX, nY, nZ;   ///< Number of terms in x, y and z
+        double ***coeff;   ///< Coefficients
+        double ***coeffErr;   ///< Error in coefficients
+        char ***mask;    ///< Coefficient mask
+    }
 psDPolynomial3D;
 
 /** Double-precision four-dimensional polynomial */
 typedef struct
-{
-    int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
-    double ****coeff;    ///< Coefficients
-    double ****coeffErr;   ///< Error in coefficients
-    char ****mask;    ///< Coefficients mask
-}
+    {
+        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
+        double ****coeff;    ///< Coefficients
+        double ****coeffErr;   ///< Error in coefficients
+        char ****mask;    ///< Coefficients mask
+    }
 psDPolynomial4D;
 
 /** Constructor */
-psDPolynomial1D *psDPolynomial1DAlloc(int n ///< Number of terms
-                                     );
-/** Constructor */
-psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
-                                     );
-/** Constructor */
-psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
-                                     );
-/** Constructor */
-psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
-                                     );
-
+psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms
+                                     );
+/** Constructor */
+psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
+                                     );
+/** Constructor */
+psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
+                                     );
+/** Constructor */
+psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
+                                     );
+                                     
 /** Evaluate 1D polynomial (double precision) */
 double
-psDPolynomial1DEval(double x,  ///< Value at which to evaluate
-                    const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial1DEval( double x,   ///< Value at which to evaluate
+                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 2D polynomial (double precision) */
 double
-psDPolynomial2DEval(double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial2DEval( double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 3D polynomial (double precision) */
 double
-psDPolynomial3DEval(double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    double z,  ///< Value z at which to evaluate
-                    const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial3DEval( double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     double z,   ///< Value z at which to evaluate
+                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 4D polynomial (double precision) */
 double
-psDPolynomial4DEval(double w,  ///< Value w at which to evaluate
-                    double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    double z,  ///< Value z at which to evaluate
-                    const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial4DEval( double w,   ///< Value w at which to evaluate
+                     double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     double z,   ///< Value z at which to evaluate
+                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /* \} */ // End of MathGroup Functions
 
Index: /trunk/psLib/src/math/psSpline.h
===================================================================
--- /trunk/psLib/src/math/psSpline.h	(revision 1381)
+++ /trunk/psLib/src/math/psSpline.h	(revision 1382)
@@ -1,23 +1,26 @@
 /** @file psFunctions.h
- *  \brief Standard Mathematical Functions.
- *  \ingroup Stats
- *
- *  This file will hold the prototypes for procedures which allocate, free,
- *  and evaluate various polynomials.  Those polynomial structures are also
- *  defined here.
- *
- *  @ingroup Stats
- *
- *  @author Someone at IfA
- *  @author George Gusciora, MHPCC
- *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-29 23:34:24 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- */
+*  \brief Standard Mathematical Functions.
+*  \ingroup Stats
+*
+*  This file will hold the prototypes for procedures which allocate, free,
+*  and evaluate various polynomials.  Those polynomial structures are also
+*  defined here.
+*
+*  @ingroup Stats
+*
+*  @author Someone at IfA
+*  @author George Gusciora, MHPCC
+*
+*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 22:11:09 $
+*
+*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+*/
 
 #if !defined(PS_FUNCTIONS_H)
 #define PS_FUNCTIONS_H
+
+#include <stdbool.h>
+
 #include "psVector.h"
 
@@ -31,59 +34,59 @@
 
 float
-psGaussian(float x,        ///< Value at which to evaluate
-           float mean,     ///< Mean for the Gaussian
-           float stddev,   ///< Standard deviation for the Gaussian
-           bool  normal      ///< Indicates whether result should be normalized
+psGaussian( float x,         ///< Value at which to evaluate
+            float mean,      ///< Mean for the Gaussian
+            float stddev,    ///< Standard deviation for the Gaussian
+            bool normal      ///< Indicates whether result should be normalized
           );
-
-
+          
+          
 /** Produce a vector of random numbers from a Gaussian distribution with
     the specified mean and sigma */
-psVector *psGaussianDev(float mean,    ///< The mean of the Gaussian
-                        float sigma,   ///< The sigma of the Gaussian
-                        int Npts);     ///< The size of the vector
-
-
-
-
-
+psVector *psGaussianDev( float mean,     ///< The mean of the Gaussian
+                         float sigma,    ///< The sigma of the Gaussian
+                         int Npts );     ///< The size of the vector
+                         
+                         
+                         
+                         
+                         
 /** One-dimensional polynomial */
 typedef struct
-{
-    int n;           ///< Number of terms
-    float *coeff;    ///< Coefficients
-    float *coeffErr; ///< Error in coefficients
-    char *mask;      ///< Coefficient mask
-}
+    {
+        int n;           ///< Number of terms
+        float *coeff;    ///< Coefficients
+        float *coeffErr; ///< Error in coefficients
+        char *mask;      ///< Coefficient mask
+    }
 psPolynomial1D;
 
 /** Two-dimensional polynomial */
 typedef struct
-{
-    int nX, nY;    ///< Number of terms in x and y
-    float **coeff;   ///< Coefficients
-    float **coeffErr;   ///< Error in coefficients
-    char **mask;   ///< Coefficients mask
-}
+    {
+        int nX, nY;    ///< Number of terms in x and y
+        float **coeff;   ///< Coefficients
+        float **coeffErr;   ///< Error in coefficients
+        char **mask;   ///< Coefficients mask
+    }
 psPolynomial2D;
 
 /** Three-dimensional polynomial */
 typedef struct
-{
-    int nX, nY, nZ;   ///< Number of terms in x, y and z
-    float ***coeff;    ///< Coefficients
-    float ***coeffErr;    ///< Error in coefficients
-    char ***mask;    ///< Coefficients mask
-}
+    {
+        int nX, nY, nZ;   ///< Number of terms in x, y and z
+        float ***coeff;    ///< Coefficients
+        float ***coeffErr;    ///< Error in coefficients
+        char ***mask;    ///< Coefficients mask
+    }
 psPolynomial3D;
 
 /** Four-dimensional polynomial */
 typedef struct
-{
-    int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
-    float ****coeff;    ///< Coefficients
-    float ****coeffErr;   ///< Error in coefficients
-    char ****mask;    ///< Coefficients mask
-}
+    {
+        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
+        float ****coeff;    ///< Coefficients
+        float ****coeffErr;   ///< Error in coefficients
+        char ****mask;    ///< Coefficients mask
+    }
 psPolynomial4D;
 
@@ -92,46 +95,46 @@
 
 /** Constructor */
-psPolynomial1D *psPolynomial1DAlloc(int n ///< Number of terms
-                                   );
-/** Constructor */
-psPolynomial2D *psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
-                                   );
-/** Constructor */
-psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
-                                   );
-/** Constructor */
-psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
-                                   );
-
+psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms
+                                   );
+/** Constructor */
+psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
+                                   );
+/** Constructor */
+psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
+                                   );
+/** Constructor */
+psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
+                                   );
+                                   
 /** Evaluate 1D polynomial */
 float
-psPolynomial1DEval(float x,  ///< Value at which to evaluate
-                   const psPolynomial1D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial1DEval( float x,   ///< Value at which to evaluate
+                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 2D polynomial */
 float
-psPolynomial2DEval(float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   const psPolynomial2D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial2DEval( float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 3D polynomial */
 float
-psPolynomial3DEval(float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   float z,  ///< Value z at which to evaluate
-                   const psPolynomial3D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial3DEval( float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    float z,   ///< Value z at which to evaluate
+                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /** Evaluate 4D polynomial */
 float
-psPolynomial4DEval(float w,  ///< Value w at which to evaluate
-                   float x,  ///< Value x at which to evaluate
-                   float y,  ///< Value y at which to evaluate
-                   float z,  ///< Value z at which to evaluate
-                   const psPolynomial4D *myPoly ///< Coefficients for the polynomial
-                  );
-
+psPolynomial4DEval( float w,   ///< Value w at which to evaluate
+                    float x,   ///< Value x at which to evaluate
+                    float y,   ///< Value y at which to evaluate
+                    float z,   ///< Value z at which to evaluate
+                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
+                  );
+                  
 /*****************************************************************************/
 
@@ -140,85 +143,85 @@
 /** Double-precision one-dimensional polynomial */
 typedef struct
-{
-    int n;    ///< Number of terms
-    double *coeff;   ///< Coefficients
-    double *coeffErr;   ///< Error in coefficients
-    char *mask;    ///< Coefficient mask
-}
+    {
+        int n;    ///< Number of terms
+        double *coeff;   ///< Coefficients
+        double *coeffErr;   ///< Error in coefficients
+        char *mask;    ///< Coefficient mask
+    }
 psDPolynomial1D;
 
 /** Double-precision two-dimensional polynomial */
 typedef struct
-{
-    int nX, nY;    ///< Number of terms in x and y
-    double **coeff;   ///< Coefficients
-    double **coeffErr;    ///< Error in coefficients
-    char **mask;   ///< Coefficients mask
-}
+    {
+        int nX, nY;    ///< Number of terms in x and y
+        double **coeff;   ///< Coefficients
+        double **coeffErr;    ///< Error in coefficients
+        char **mask;   ///< Coefficients mask
+    }
 psDPolynomial2D;
 
 /** Double-precision three-dimensional polynomial */
 typedef struct
-{
-    int nX, nY, nZ;   ///< Number of terms in x, y and z
-    double ***coeff;   ///< Coefficients
-    double ***coeffErr;   ///< Error in coefficients
-    char ***mask;    ///< Coefficient mask
-}
+    {
+        int nX, nY, nZ;   ///< Number of terms in x, y and z
+        double ***coeff;   ///< Coefficients
+        double ***coeffErr;   ///< Error in coefficients
+        char ***mask;    ///< Coefficient mask
+    }
 psDPolynomial3D;
 
 /** Double-precision four-dimensional polynomial */
 typedef struct
-{
-    int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
-    double ****coeff;    ///< Coefficients
-    double ****coeffErr;   ///< Error in coefficients
-    char ****mask;    ///< Coefficients mask
-}
+    {
+        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
+        double ****coeff;    ///< Coefficients
+        double ****coeffErr;   ///< Error in coefficients
+        char ****mask;    ///< Coefficients mask
+    }
 psDPolynomial4D;
 
 /** Constructor */
-psDPolynomial1D *psDPolynomial1DAlloc(int n ///< Number of terms
-                                     );
-/** Constructor */
-psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
-                                     );
-/** Constructor */
-psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
-                                     );
-/** Constructor */
-psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
-                                     );
-
+psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms
+                                     );
+/** Constructor */
+psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
+                                     );
+/** Constructor */
+psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
+                                     );
+/** Constructor */
+psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
+                                     );
+                                     
 /** Evaluate 1D polynomial (double precision) */
 double
-psDPolynomial1DEval(double x,  ///< Value at which to evaluate
-                    const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial1DEval( double x,   ///< Value at which to evaluate
+                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 2D polynomial (double precision) */
 double
-psDPolynomial2DEval(double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial2DEval( double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 3D polynomial (double precision) */
 double
-psDPolynomial3DEval(double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    double z,  ///< Value z at which to evaluate
-                    const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial3DEval( double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     double z,   ///< Value z at which to evaluate
+                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /** Evaluate 4D polynomial (double precision) */
 double
-psDPolynomial4DEval(double w,  ///< Value w at which to evaluate
-                    double x,  ///< Value x at which to evaluate
-                    double y,  ///< Value y at which to evaluate
-                    double z,  ///< Value z at which to evaluate
-                    const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
-                   );
-
+psDPolynomial4DEval( double w,   ///< Value w at which to evaluate
+                     double x,   ///< Value x at which to evaluate
+                     double y,   ///< Value y at which to evaluate
+                     double z,   ///< Value z at which to evaluate
+                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
+                   );
+                   
 /* \} */ // End of MathGroup Functions
 
Index: /trunk/psLib/src/types/psMetadata.h
===================================================================
--- /trunk/psLib/src/types/psMetadata.h	(revision 1381)
+++ /trunk/psLib/src/types/psMetadata.h	(revision 1382)
@@ -10,6 +10,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 20:59:41 $
+*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 22:11:09 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,4 +18,10 @@
 #define PS_METADATA_H
 
+#include <stdarg.h>
+#include <stdio.h>
+#include <fitsio.h>
+
+#include "psHash.h"
+#include "psList.h"
 
 /// @addtogroup Metadata
@@ -33,15 +39,15 @@
  */
 typedef enum {
-    PS_META_ITEM_SET = 0,                  ///< Null. Metadata is in psMetadataItem.items
-    PS_META_BOOL,                          ///< Boolean data.
-    PS_META_S32,                           ///< Signed 32-bit integer data.
-    PS_META_F32,                           ///< Single-precision float data.
-    PS_META_F64,                           ///< Double-precision float data.
-    PS_META_STR,                           ///< String data (Stored in as void *).
-    PS_META_IMG,                           ///< Image data (Stored in as void *).
-    PS_META_JPEG,                          ///< JPEG data (Stored in as void .
-    PS_META_PNG,                           ///< PNG data (Stored in as void *).
-    PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
-    PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
+    PS_META_ITEM_SET = 0,                   ///< Null. Metadata is in psMetadataItem.items
+    PS_META_BOOL,                           ///< Boolean data.
+    PS_META_S32,                            ///< Signed 32-bit integer data.
+    PS_META_F32,                            ///< Single-precision float data.
+    PS_META_F64,                            ///< Double-precision float data.
+    PS_META_STR,                            ///< String data (Stored in as void *).
+    PS_META_IMG,                            ///< Image data (Stored in as void *).
+    PS_META_JPEG,                           ///< JPEG data (Stored in as void .
+    PS_META_PNG,                            ///< PNG data (Stored in as void *).
+    PS_META_ASTROM,                         ///< Astrometric coefficients (Stored in as void *).
+    PS_META_UNKNOWN,                        ///< Other data (Stored in as void *).
     PS_META_NTYPE                         ///< Number of types. Must be last.
 } psMetadataType;
@@ -78,6 +84,6 @@
 typedef struct psMetadata
     {
-        psList *restrict list;
-        psHash *restrict table;
+        psList* restrict list;
+        psHash* restrict table;
     }
 psMetadata;
@@ -102,7 +108,7 @@
  */
 psMetadataItem *psMetadataItemAlloc(
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     ...                                 ///< Arguments for name formatting and metadata item data.
 );
@@ -122,7 +128,7 @@
  */
 psMetadataItem *psMetadataItemAllocV(
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     va_list list                        ///< Arguments for name formatting and metadata item data.
 );
@@ -145,6 +151,6 @@
  */
 bool psMetadataAddItem(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be added.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be added.
     psMetadataItem *restrict item       ///< Metadata item to be added.
 );
@@ -157,9 +163,9 @@
  */
 bool psMetadataAdd(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be added.
-    const char *name,                      ///< Name of metadata item.
-    psMetadataType type,                   ///< Type of metadata item.
-    const char *comment,                   ///< Comment for metadata item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be added.
+    const char *name,                       ///< Name of metadata item.
+    psMetadataType type,                    ///< Type of metadata item.
+    const char *comment,                    ///< Comment for metadata item.
     ...                                 ///< Arguments for name formatting and metadata item data.
 );
@@ -175,6 +181,6 @@
  */
 bool psMetadataRemove(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
-    int where,                             ///< Location to be removed.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
+    int where,                              ///< Location to be removed.
     const char *restrict key            ///< Name of metadata key.
 );
@@ -188,5 +194,5 @@
  */
 psMetadataItem *psMetadataLookup(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     const char *restrict key            ///< Name of metadata key.
 );
@@ -199,5 +205,5 @@
  */
 psMetadataItem *psMetadataGet(
-    psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
+    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     int where                           ///< Location to be retrieved.
 );
@@ -210,5 +216,5 @@
  */
 bool psMetadataSetIterator(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
     int where                           ///< Location of iterator.
 );
@@ -221,6 +227,6 @@
  */
 psMetadataItem *psMetadataGetNext(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
-    const char *restrict match,            ///< Beginning of key name.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
+    const char *restrict match,             ///< Beginning of key name.
     int which                           ///< Iterator to be used.
 );
@@ -233,6 +239,6 @@
  */
 psMetadataItem *psMetadataGetPrevious(
-    psMetadata *restrict md,               ///< Metadata collection to iterate.
-    const char *restrict match,            ///< Beginning of key name.
+    psMetadata *restrict md,                ///< Metadata collection to iterate.
+    const char *restrict match,             ///< Beginning of key name.
     int which                           ///< Iterator to be used.
 );
@@ -249,6 +255,6 @@
  */
 void psMetadataItemPrint(
-    FILE *fd,                                      ///< Pointer to file to write metadata item.
-    const char *format,                            ///< Format to print metadata item.
+    FILE *fd,                                       ///< Pointer to file to write metadata item.
+    const char *format,                             ///< Format to print metadata item.
     const psMetadataItem *restrict metadataItem ///< Metadata item to print.
 );
@@ -261,7 +267,7 @@
  */
 psMetadata *psMetadataReadHeader(
-    psMetadata *output,                    ///< Resulting metadata from read.
-    const char *extname,                   ///< File name extension string.
-    int extnum,                            ///< File name extension number.
+    psMetadata *output,                     ///< Resulting metadata from read.
+    const char *extname,                    ///< File name extension string.
+    int extnum,                             ///< File name extension number.
     const char *filename                ///< Name of file to read.
 );
@@ -274,8 +280,8 @@
  */
 psMetadata *psMetadataFReadHeader(
-    psMetadata *output,                    ///< Resulting metadata from read.
-    const char *extname,                   ///< File name extension string.
-    int extnum,                            ///< File name extension number.
-    fitsfile *fd                        ///< Pointer to file to read.
+    psMetadata *output,                     ///< Resulting metadata from read.
+    const char *extname,                    ///< File name extension string.
+    int extnum,                             ///< File name extension number.
+    fitsfile *fd                           ///< Pointer to file to read.
 );
 /// @}
