Index: /trunk/psLib/src/astronomy/psCoord2.c
===================================================================
--- /trunk/psLib/src/astronomy/psCoord2.c	(revision 1312)
+++ /trunk/psLib/src/astronomy/psCoord2.c	(revision 1312)
@@ -0,0 +1,191 @@
+
+#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++) {
+        //XXX     if (this is the correct chip)
+        return(tmpChip);
+    }
+}
+
+psCell *psCellinChip(psCell *out,
+                     const psPlane *coord,
+                     const psChip *chip)
+{
+    psCell *tmpCell = NULL;
+
+    for (tmpCell = chip->cells; tmpCell != NULL; tmpCell++) {
+        //XXX        if (this is the correct cell)
+        return(tmpCcell);
+    }
+}
+
+psPlane *psCoordCelltoChip(psPlane *out,
+                           const psPlane *in,
+                           const psCell *cell)
+{
+    return(psPlaneTransformApply(psPlane *out, cell->toChip, in));
+}
+
+psPlane *psCoordChipToFPA(psPlane *out,
+                          const psPlane *in,
+                          const psChip *chip)
+{
+    return(psPlaneTransformApply(psPlane *out, chip->toFPA, in));
+}
+
+psPlane *psCoordFPAtoTP(psPlane *out,
+                        const psPlane *in,
+                        const psFPA *fpa)
+{
+    return(psPlaneTransformApply(psPlane *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(psPlane *out, cell->toFPA, in));
+}
+
+psSphere *psCoordCelltoSky(psSphere *out,
+                           const psPlane *in,
+                           const psCell *cell)
+{
+    if (out == NULL) {
+        out = (psSphere *) psAlloc(sizeof(psSphere));
+    }
+
+    return(out);
+}
+
+psSphere *psCoordCelltoSkyQuick(psSphere *out,
+                                const psPlane *in,
+                                const psCell *cell)
+{
+    if (out == NULL) {
+        out = (psSphere *) psAlloc(sizeof(psSphere));
+    }
+
+    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(psPlane *out, fpa->fromTangentPlane, in));
+}
+
+psPlane *psCoordFPAtoChip(psPlane *out,
+                          const psPlane *in,
+                          const psChip *chip)
+{
+
+    if (out == NULL) {
+        out = (psPlane *) psAlloc(sizeof(psPlane));
+    }
+
+    return(out);
+}
+
+psPlane *psCoordChiptoCell(psPlane *out,
+                           const psPlane *in,
+                           const psCell *cell)
+{
+    if (out == NULL) {
+        out = (psPlane *) psAlloc(sizeof(psPlane));
+    }
+
+    return(out);
+}
+
+psPlane *psCoordSkytoCell(psPlane *out,
+                          const psSphere *in,
+                          const psCell *cell)
+{
+    if (out == NULL) {
+        out = (psPlane *) psAlloc(sizeof(psPlane));
+    }
+
+    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/psCoord2.h
===================================================================
--- /trunk/psLib/src/astronomy/psCoord2.h	(revision 1312)
+++ /trunk/psLib/src/astronomy/psCoord2.h	(revision 1312)
@@ -0,0 +1,124 @@
+/** @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-28 22:31:19 $
+ *
+ *  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"
+
+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/psPhotometry.h
===================================================================
--- /trunk/psLib/src/astronomy/psPhotometry.h	(revision 1312)
+++ /trunk/psLib/src/astronomy/psPhotometry.h	(revision 1312)
@@ -0,0 +1,47 @@
+/** @file  psPhotometry.h
+ *
+ *  @brief Contains basic photometric structures.
+ *
+ *  This file defines the basic photometric structures.
+ *
+ *  @ingroup AstroImage
+ *
+ *  @author George Gusciora, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-28 22:31:01 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+# ifndef PS_PHOTOMETRIC_H
+# define PS_PHOTOMETRIC_H
+
+#include "psType.h"
+#include "psImage.h"
+#include "psArray.h"
+#include "psList.h"
+#include "psFunctions.h"
+
+typedef struct
+{
+    const int ID;
+    const char *name;
+    const char *camera;
+    const char *filter;
+    const char *detector;
+}
+psPhotSystem;
+
+typedef struct
+{
+    psPhotSystem src;
+    psPhotSystem dst;
+    psPhotSystem pP, pM;
+    psPhotSystem sP, sM;
+    float pA, sA;
+    psPolynomial3D transform;
+}
+psPhotTransform;
+
+#endif
