Index: /trunk/psLib/src/astronomy/psAstrometry.c
===================================================================
--- /trunk/psLib/src/astronomy/psAstrometry.c	(revision 2097)
+++ /trunk/psLib/src/astronomy/psAstrometry.c	(revision 2098)
@@ -8,6 +8,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-14 00:06:17 $
+ *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-14 00:12:40 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -59,7 +59,5 @@
 {
     int i = 0;
-    if (transform == NULL) {
-        psAbort(__func__, "input parameter transform is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(transform);
 
     for (i=2;i<(transform->x->nX);i++) {
@@ -116,7 +114,5 @@
     double F = transform->y->coeff[0][1];
 
-    if (transform == NULL) {
-        psAbort(__func__, "input parameter transform is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(transform);
     psPlaneTransform *out = psAlloc(sizeof(psPlaneTransform));
 
@@ -291,4 +287,5 @@
                             const psObservatory* observatory)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(observatory);
     psExposure* exp = psAlloc(sizeof(psExposure));
 
@@ -472,7 +469,5 @@
 psGrommit* psGrommitAlloc(const psExposure* exp)
 {
-    if (exp == NULL) {
-        psAbort(__func__, "the 'exp' parameter is NULL\n");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(exp);
 
     double date = psTimeToMJD(exp->time);
@@ -610,10 +605,6 @@
                            const psCell* cell)
 {
-    if (inCoord == NULL) {
-        psAbort(__func__, "input parameter inCoord is NULL.");
-    }
-    if (cell == NULL) {
-        psAbort(__func__, "input parameter cell is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(inCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
 
     return (psPlaneTransformApply(outCoord, cell->toChip, inCoord));
@@ -624,10 +615,6 @@
                           const psChip* chip)
 {
-    if (inCoord == NULL) {
-        psAbort(__func__, "input parameter inCoord is NULL.");
-    }
-    if (chip == NULL) {
-        psAbort(__func__, "input parameter chip is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(inCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(chip);
 
     return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord));
@@ -640,10 +627,6 @@
                         const psFPA* fpa)
 {
-    if (inCoord == NULL) {
-        psAbort(__func__, "input parameter inCoord is NULL.");
-    }
-    if (fpa == NULL) {
-        psAbort(__func__, "input parameter fpa is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(inCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(fpa);
 
     return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord,
@@ -661,11 +644,6 @@
     double ZOB = 0.0;
     double HOB = 0.0;
-
-    if (tpCoord == NULL) {
-        psAbort(__func__, "input parameter tpCoord is NULL.");
-    }
-    if (grommit == NULL) {
-        psAbort(__func__, "input parameter grommit is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(tpCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(grommit);
     if (outSphere == NULL) {
         outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
@@ -682,10 +660,6 @@
                           const psCell* cell)
 {
-    if (cellCoord == NULL) {
-        psAbort(__func__, "input parameter cellCoord is NULL.");
-    }
-    if (cell == NULL) {
-        psAbort(__func__, "input parameter cell is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(cellCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
 
     return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord));
@@ -698,10 +672,6 @@
                            const psCell* cell)
 {
-    if (cellCoord == NULL) {
-        psAbort(__func__, "input parameter cellCoord is NULL.");
-    }
-    if (cell == NULL) {
-        psAbort(__func__, "input parameter cell is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(cellCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
 
     psPlane* fpaCoord = NULL;
@@ -734,10 +704,6 @@
                                 const psCell* cell)
 {
-    if (cellCoord == NULL) {
-        psAbort(__func__, "input parameter cellCoord is NULL.");
-    }
-    if (cell == NULL) {
-        psAbort(__func__, "input parameter cell is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(cellCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
 
     psPlane *tpCoord = NULL;
@@ -776,10 +742,7 @@
     char* type = "RA";
 
-    if (in == NULL) {
-        psAbort(__func__, "input parameter in is NULL.");
-    }
-    if (grommit == NULL) {
-        psAbort(__func__, "input parameter grommit is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(in);
+    PS_CHECK_NULL_PTR_RETURN_NULL(grommit);
+
     if (tpCoord == NULL) {
         tpCoord = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -798,10 +761,6 @@
                         const psFPA* fpa)
 {
-    if (tpCoord == NULL) {
-        psAbort(__func__, "input parameter tpCoord is NULL.");
-    }
-    if (fpa == NULL) {
-        psAbort(__func__, "input parameter fpa is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(tpCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(fpa);
 
     return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane,
@@ -813,16 +772,8 @@
                           const psChip* chip)
 {
-    if (fpaCoord == NULL) {
-        psAbort(__func__, "input parameter fpaCoord is NULL.");
-    }
-    if (chip == NULL) {
-        psAbort(__func__, "input parameter chip is NULL.");
-    }
-
-    psFPA *FPA = chip->parent;
-    if (FPA == NULL) {
-        psAbort(__func__, "chip->parent is NULL");
-    }
-
+    PS_CHECK_NULL_PTR_RETURN_NULL(fpaCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(chip);
+    PS_CHECK_NULL_PTR_RETURN_NULL(chip->parent);
+    //    psFPA *FPA = chip->parent;
     chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord);
 
@@ -834,15 +785,7 @@
                            const psCell* cell)
 {
-    if (chipCoord == NULL) {
-        psAbort(__func__, "input parameter chipCoord is NULL.");
-    }
-    if (cell == NULL) {
-        psAbort(__func__, "input parameter cell is NULL.");
-    }
-
-    psChip *chip = cell->parent;
-    if (chip == NULL) {
-        psAbort(__func__, "cell->parent is NULL");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(chipCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
+    PS_CHECK_NULL_PTR_RETURN_NULL(cell->parent);
 
     cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord);
@@ -857,10 +800,6 @@
                           const psCell* cell)
 {
-    if (skyCoord == NULL) {
-        psAbort(__func__, "input parameter skyCoord is NULL.");
-    }
-    if (cell == NULL) {
-        psAbort(__func__, "input parameter cell is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(skyCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
 
     psChip *parChip = cell->parent;
@@ -892,10 +831,6 @@
                                const psCell* cell)
 {
-    if (skyCoord == NULL) {
-        psAbort(__func__, "input parameter skyCoord is NULL.");
-    }
-    if (cell == NULL) {
-        psAbort(__func__, "input parameter cell is NULL.");
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(skyCoord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(cell);
 
     psPlane *tpCoord = NULL;
