Index: trunk/psLib/src/astronomy/psAstrometry.h
===================================================================
--- trunk/psLib/src/astronomy/psAstrometry.h	(revision 1382)
+++ trunk/psLib/src/astronomy/psAstrometry.h	(revision 1384)
@@ -8,6 +8,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 22:11:09 $
+*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 23:12:34 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -34,27 +34,50 @@
 /// @{
 
+/** Wallace's Grommit
+ *
+ *  SLALib requires several elements to perform the transformations between
+ *  the tangent plane and the sky.  Pre-computing these quantities for each
+ *  exposure means that subsequent transformations are faster.  For historical
+ *  reasons, this structure is known colloquially as "Wallace's Grommit".
+ *  
+ */
 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;             ///< geodetic latitude (radians)
+        const double sinLat;               ///< sine of geodetic latitude
+        const double cosLat;               ///< cosine of geodetic latitude
+        const double abberationMag;        ///< magnitude of diurnal aberration vector
+        const double height;               ///< height (HM)
+        const double temperature;          ///< ambient temperature (TDK)
+        const double pressure;             ///< pressure (PMB)
+        const double humidity;             ///< relative humidity (RH)
+        const double wavelength;           ///< wavelength (WL)
+        const double lapseRate;            ///< lapse rate (TLR)
+        const double refractA;             ///< refraction constant A (radians)
+        const double refractB;             ///< refraction constant B (radians)
+        const double longitudeOffset;      ///< longitude + ... (radians)
+        const double siderealTime;         ///< local apparent sidereal time (radians)
     }
 psGrommit;
 
+/** Fixed Pattern Corrections
+ *
+ *  The fixed pattern is a correction to the general astrometric solution 
+ *  formed by summing the residuals from many observations. The intent is to 
+ *  correct for higher-order distortions in the camera system on a coarse 
+ *  grid (larger than individual pixels, but smaller than a single cell). 
+ *  Hence, in addition to the offsets, we need to specify the size and scale 
+ *  of the grid in x and y as well as the origin of the grid.
+ */
 typedef struct
     {
-        int nX, nY;               ///<
-        double x0, y0;            ///<
-        double xScale, yScale;    ///<
-        double **x, **y;          ///<
+        int nX;                            ///< Number of elements in x direction
+        int nY;                            ///< Number of elements in y direction
+        double x0;                         ///< X Position of 0,0 corner on focal plane
+        double y0;                         ///< Y Position of 0,0 corner on focal plane
+        double xScale;                     ///< Scale of the grid in x direction
+        double yScale;                     ///< Scale of the grid in x direction
+        double **x;                        ///< The grid of offsets in x
+        double **y;                        ///< The grid of offsets in y
     }
 psFixedPattern;
@@ -77,5 +100,5 @@
         
         psImage* image;                    ///< imaging area of Readout
-        psList* objects;                  ///< objects derived from Readout
+        psList* objects;                   ///< objects derived from Readout
         psMetadata* metadata;              ///< readout-level metadata
     }
@@ -191,86 +214,124 @@
 
 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
+    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 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 );
-                                
+/** Allocates a Wallace's Grommit structure.
+ *
+ *  The psGrommit is calculated from telescope information for the particular
+ *  exposure.
+ *
+ *  @return psGrommit*     New grommit structure.
+ */
+psGrommit* psGrommitAlloc(
+    const psExposure* exp              ///< the cooresponding exposure structure.
+);
+
+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
