Index: trunk/psLib/src/astronomy/psAstrometry.c
===================================================================
--- trunk/psLib/src/astronomy/psAstrometry.c	(revision 2048)
+++ trunk/psLib/src/astronomy/psAstrometry.c	(revision 2052)
@@ -8,6 +8,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-12 01:34:09 $
+ *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-12 19:10:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -352,6 +352,12 @@
     newFPA->toTangentPlane = NULL;
     newFPA->pattern = NULL;
-    newFPA->exposure = psMemIncrRefCounter((psExposure*)exp);
-    newFPA->grommit = psGrommitAlloc(exp);
+
+    if (exp != NULL) {
+        newFPA->exposure = psMemIncrRefCounter((psExposure*)exp);
+        newFPA->grommit = psGrommitAlloc(exp);
+    } else {
+        newFPA->exposure = NULL;
+        newFPA->grommit = NULL;
+    }
 
     newFPA->colorPlus = NULL;
@@ -455,6 +461,4 @@
 psGrommit* psGrommitAlloc(const psExposure* exp)
 {
-    double* AOPRMS = psAlloc(sizeof(double)*14);
-
     if (exp == NULL) {
         psAbort(__func__, "the 'exp' parameter is NULL\n");
@@ -478,24 +482,8 @@
     double tlr = exp->observatory->tlr;
 
+    psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit));
+
     slaAoppa(date, dut, elongm, phim, hm, xp, yp,
-             tdk, pmb, rh, wl, tlr, AOPRMS);
-
-    psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit));
-    *(double *)&grommit->latitude = AOPRMS[0];
-    *(double *)&grommit->sinLat = AOPRMS[1];
-    *(double *)&grommit->cosLat = AOPRMS[2];
-    *(double *)&grommit->height = AOPRMS[3];
-    *(double *)&grommit->abberationMag = AOPRMS[4];
-    *(double *)&grommit->temperature = AOPRMS[5];
-    *(double *)&grommit->pressure = AOPRMS[6];
-    *(double *)&grommit->humidity = AOPRMS[7];
-    *(double *)&grommit->wavelength = AOPRMS[8];
-    *(double *)&grommit->lapseRate = AOPRMS[9];
-    *(double *)&grommit->refractA = AOPRMS[10];
-    *(double *)&grommit->refractB = AOPRMS[11];
-    *(double *)&grommit->longitudeOffset = AOPRMS[12];
-    *(double *)&grommit->siderealTime = AOPRMS[13];
-
-    psFree(AOPRMS);
+             tdk, pmb, rh, wl, tlr, (double*)grommit);
 
     return (grommit);
@@ -680,5 +668,5 @@
     }
 
-    slaAopqk(tpCoord->x, tpCoord->y, (double *) grommit,
+    slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit,
              &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d);
 
@@ -782,4 +770,6 @@
                         const psGrommit* grommit)
 {
+    char* type = "RA";
+
     if (in == NULL) {
         psAbort(__func__, "input parameter in is NULL.");
@@ -792,5 +782,5 @@
     }
 
-    slaOapqk("RA", in->r, in->d, (double *) grommit, &tpCoord->x, &tpCoord->y);
+    slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y);
 
     return(tpCoord);
