Index: /trunk/psLib/src/astronomy/psAstrometry.c
===================================================================
--- /trunk/psLib/src/astronomy/psAstrometry.c	(revision 2210)
+++ /trunk/psLib/src/astronomy/psAstrometry.c	(revision 2211)
@@ -8,6 +8,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 01:15:47 $
+ *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 19:58:54 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -229,8 +229,8 @@
     psS32 j;
 
-    PS_CHECK_NULL_IMAGE_RETURN_NULL(x);
-    PS_CHECK_NULL_IMAGE_RETURN_NULL(y);
-    PS_CHECK_IMAGE_TYPE_RETURN_NULL(x, PS_TYPE_F64);
-    PS_CHECK_IMAGE_TYPE_RETURN_NULL(y, PS_TYPE_F64);
+    PS_CHECK_NULL_IMAGE(x, NULL);
+    PS_CHECK_NULL_IMAGE(y, NULL);
+    PS_CHECK_IMAGE_TYPE(x, PS_TYPE_F64, NULL);
+    PS_CHECK_IMAGE_TYPE(y, PS_TYPE_F64, NULL);
 
     tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
Index: /trunk/psLib/src/dataManip/psConstants.h
===================================================================
--- /trunk/psLib/src/dataManip/psConstants.h	(revision 2210)
+++ /trunk/psLib/src/dataManip/psConstants.h	(revision 2211)
@@ -6,10 +6,13 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 01:23:24 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 19:58:54 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
 
+/*****************************************************************************
+These constants are used by various functions in the psLib.
+ *****************************************************************************/
 #define DETERMINE_BRACKET_STEP_SIZE 0.10
 #define MAX_LMM_ITERATIONS 100
@@ -17,5 +20,13 @@
 #define LEFT_SPLINE_DERIV 0.0
 #define RIGHT_SPLINE_DERIV 0.0
-
+/*****************************************************************************
+These are common mathimatical constants used by various functions in the psLib.
+ *****************************************************************************/
+
+
+
+/*****************************************************************************
+ 
+ *****************************************************************************/
 #define CONVERT_VECTOR_F64_TO_F32(OLD, NEW_PTR32, NEW_STATIC32) \
 if (OLD->type.type == PS_TYPE_F32) { \
@@ -44,10 +55,4 @@
 } \
 
-#define VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(VEC) \
-if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \
-    psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \
-    return(NULL); \
-} \
-
 #define GEN_PERSIST_YERR_VEC_F32(VEC, N) \
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
@@ -89,7 +94,21 @@
 
 
-
-
-
+/*****************************************************************************
+ 
+*****************************************************************************/
+#define PS_CHECK_NULL_PTR(NAME, RVAL) \
+if (NAME == NULL) { \
+    psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
+    return(RVAL); \
+}
+
+/*****************************************************************************
+ 
+ *****************************************************************************/
+#define VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \
+if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \
+    psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \
+    return(RVAL); \
+} \
 
 /** Preprocessor macro to generate error on an incorrect type */
@@ -107,11 +126,4 @@
 } \
 
-/** Preprocessor macro to generate error on a NULL poniter */
-#define PS_CHECK_NULL_PTR(NAME, RVAL) \
-if (NAME == NULL) { \
-    psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
-    return(RVAL); \
-}
-
 /** Preprocessor macro to generate error for zero length vector */
 #define PS_CHECK_EMPTY_VECTOR(NAME, RVAL) \
@@ -128,46 +140,4 @@
 }
 
-
-
-
-
-/** Preprocessor macro to generate error on a NULL image */
-#define PS_CHECK_NULL_IMAGE_RETURN_NULL(NAME) \
-if (NAME == NULL || NAME->data.V == NULL) {                                                         \
-    psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME);                          \
-    return(NULL); \
-}
-
-/** Preprocessor macro to generate error for zero length rows or columns */
-#define PS_CHECK_EMPTY_IMAGE_RETURN_NULL(NAME) \
-if (NAME->numCols < 1 || NAME->numRows < 1) {                                                       \
-    psError(__func__,"Unallowable operation: %s has zero rows or columns (%dx%d).", #NAME,              \
-            NAME->numCols, NAME->numRows);                                                          \
-    return(NULL); \
-}
-
-#define PS_CHECK_IMAGE_TYPE_RETURN_NULL(NAME, TYPE) \
-if (NAME->type.type != TYPE) { \
-    psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \
-    return(NULL); \
-}
-
-/** Preprocessor macro to generate error on a NULL image */
-#define PS_CHECK_NULL_IMAGE_READOUT_NULL(NAME) \
-if (NAME == NULL || NAME->image == NULL) {                                                         \
-    psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME);                          \
-    return(NULL); \
-}
-
-#define PS_CHECK_NULL_1DPOLY_RETURN_NULL(NAME)                                                          \
-if (NAME == NULL || NAME->coeff == NULL) {                                                         \
-    psError(__func__,"Unallowable operation: %s or its coeffs is NULL.", #NAME);                          \
-    return(NULL); \
-} \
-
-
-
-
-
 #define PS_PRINT_VECTOR(NAME) \
 for (int my_i=0;my_i<NAME->n;my_i++) { \
@@ -189,4 +159,59 @@
 
 
+
+/*****************************************************************************
+ 
+*****************************************************************************/
+#define PS_CHECK_NULL_POLY(NAME, NULL) \
+if (NAME == NULL || NAME->coeff == NULL) { \
+    psError(__func__,"Unallowable operation: polynomial %s or its coeffs is NULL.", #NAME); \
+    return(NULL); \
+} \
+
+
+
+
+
+/*****************************************************************************
+ 
+*****************************************************************************/
+/** Preprocessor macro to generate error on a NULL image */
+#define PS_CHECK_NULL_IMAGE(NAME, RVAL) \
+if (NAME == NULL || NAME->data.V == NULL) { \
+    psError(__func__,"Unallowable operation: psImage %s or its data is NULL.", #NAME); \
+    return(RVAL); \
+}
+
+/** Preprocessor macro to generate error for zero length rows or columns */
+#define PS_CHECK_EMPTY_IMAGE(NAME, RVAL) \
+if (NAME->numCols < 1 || NAME->numRows < 1) { \
+    psError(__func__,"Unallowable operation: psImage %s has zero rows or columns (%dx%d).", #NAME, \
+            NAME->numCols, NAME->numRows); \
+    return(RVAL); \
+}
+
+#define PS_CHECK_IMAGE_TYPE(NAME, TYPE, RVAL) \
+if (NAME->type.type != TYPE) { \
+    psError(__func__,"Unallowable operation: psImage %s has incorrect type.", #NAME); \
+    return(RVAL); \
+}
+
+/*****************************************************************************
+ 
+ *****************************************************************************/
+/** Preprocessor macro to generate error on a NULL image */
+#define PS_CHECK_NULL_IMAGE_READOUT(NAME, RVAL) \
+if (NAME == NULL || NAME->image == NULL) {                                                         \
+    psError(__func__,"Unallowable operation: psReadout %s or its data is NULL.", #NAME); \
+    return(RVAL); \
+}
+
+
+
+
+
+/*****************************************************************************
+ 
+ *****************************************************************************/
 #define PS_MAX(A, B) \
 (((A) > (B)) ? (A) : (B)) \
Index: /trunk/psLib/src/dataManip/psMinimize.c
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.c	(revision 2210)
+++ /trunk/psLib/src/dataManip/psMinimize.c	(revision 2211)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 01:21:01 $
+ *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 19:58:54 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -254,5 +254,5 @@
     PS_CHECK_NULL_PTR(mySpline, NULL);
     PS_CHECK_NULL_PTR(y, NULL);
-    VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(y);
+    VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
     CONVERT_VECTOR_F64_TO_F32(y, y32, y32Static);
 
@@ -262,5 +262,5 @@
         yErr32 = yErr32Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(yErr);
+        VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
         CONVERT_VECTOR_F64_TO_F32(yErr, yErr32, yErr32Static);
     }
@@ -271,5 +271,5 @@
         x32 = x32Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(x);
+        VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         CONVERT_VECTOR_F64_TO_F32(x, x32, x32Static);
     }
@@ -855,5 +855,5 @@
     psS32 i;
     psPolynomial1D *tmpPoly;
-    PS_CHECK_NULL_1DPOLY_RETURN_NULL(myPoly);
+    PS_CHECK_NULL_POLY(myPoly, NULL);
     PS_CHECK_NULL_VECTOR(y, NULL);
     PS_CHECK_EMPTY_VECTOR(y, NULL);
@@ -865,5 +865,5 @@
     static psVector *yErr64Static = NULL;
 
-    VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(y);
+    VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
     CONVERT_VECTOR_F32_TO_F64(y, y64, y64Static);
 
@@ -873,5 +873,5 @@
         yErr64 = yErr64Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(yErr);
+        VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
         CONVERT_VECTOR_F32_TO_F64(yErr, yErr64, yErr64Static);
     }
@@ -885,5 +885,5 @@
         x64 = x64Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(x);
+        VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         CONVERT_VECTOR_F32_TO_F64(x, x64, x64Static);
     }
Index: /trunk/psLib/src/math/psConstants.h
===================================================================
--- /trunk/psLib/src/math/psConstants.h	(revision 2210)
+++ /trunk/psLib/src/math/psConstants.h	(revision 2211)
@@ -6,10 +6,13 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 01:23:24 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 19:58:54 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
 
+/*****************************************************************************
+These constants are used by various functions in the psLib.
+ *****************************************************************************/
 #define DETERMINE_BRACKET_STEP_SIZE 0.10
 #define MAX_LMM_ITERATIONS 100
@@ -17,5 +20,13 @@
 #define LEFT_SPLINE_DERIV 0.0
 #define RIGHT_SPLINE_DERIV 0.0
-
+/*****************************************************************************
+These are common mathimatical constants used by various functions in the psLib.
+ *****************************************************************************/
+
+
+
+/*****************************************************************************
+ 
+ *****************************************************************************/
 #define CONVERT_VECTOR_F64_TO_F32(OLD, NEW_PTR32, NEW_STATIC32) \
 if (OLD->type.type == PS_TYPE_F32) { \
@@ -44,10 +55,4 @@
 } \
 
-#define VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(VEC) \
-if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \
-    psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \
-    return(NULL); \
-} \
-
 #define GEN_PERSIST_YERR_VEC_F32(VEC, N) \
 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
@@ -89,7 +94,21 @@
 
 
-
-
-
+/*****************************************************************************
+ 
+*****************************************************************************/
+#define PS_CHECK_NULL_PTR(NAME, RVAL) \
+if (NAME == NULL) { \
+    psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
+    return(RVAL); \
+}
+
+/*****************************************************************************
+ 
+ *****************************************************************************/
+#define VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \
+if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \
+    psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \
+    return(RVAL); \
+} \
 
 /** Preprocessor macro to generate error on an incorrect type */
@@ -107,11 +126,4 @@
 } \
 
-/** Preprocessor macro to generate error on a NULL poniter */
-#define PS_CHECK_NULL_PTR(NAME, RVAL) \
-if (NAME == NULL) { \
-    psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
-    return(RVAL); \
-}
-
 /** Preprocessor macro to generate error for zero length vector */
 #define PS_CHECK_EMPTY_VECTOR(NAME, RVAL) \
@@ -128,46 +140,4 @@
 }
 
-
-
-
-
-/** Preprocessor macro to generate error on a NULL image */
-#define PS_CHECK_NULL_IMAGE_RETURN_NULL(NAME) \
-if (NAME == NULL || NAME->data.V == NULL) {                                                         \
-    psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME);                          \
-    return(NULL); \
-}
-
-/** Preprocessor macro to generate error for zero length rows or columns */
-#define PS_CHECK_EMPTY_IMAGE_RETURN_NULL(NAME) \
-if (NAME->numCols < 1 || NAME->numRows < 1) {                                                       \
-    psError(__func__,"Unallowable operation: %s has zero rows or columns (%dx%d).", #NAME,              \
-            NAME->numCols, NAME->numRows);                                                          \
-    return(NULL); \
-}
-
-#define PS_CHECK_IMAGE_TYPE_RETURN_NULL(NAME, TYPE) \
-if (NAME->type.type != TYPE) { \
-    psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \
-    return(NULL); \
-}
-
-/** Preprocessor macro to generate error on a NULL image */
-#define PS_CHECK_NULL_IMAGE_READOUT_NULL(NAME) \
-if (NAME == NULL || NAME->image == NULL) {                                                         \
-    psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME);                          \
-    return(NULL); \
-}
-
-#define PS_CHECK_NULL_1DPOLY_RETURN_NULL(NAME)                                                          \
-if (NAME == NULL || NAME->coeff == NULL) {                                                         \
-    psError(__func__,"Unallowable operation: %s or its coeffs is NULL.", #NAME);                          \
-    return(NULL); \
-} \
-
-
-
-
-
 #define PS_PRINT_VECTOR(NAME) \
 for (int my_i=0;my_i<NAME->n;my_i++) { \
@@ -189,4 +159,59 @@
 
 
+
+/*****************************************************************************
+ 
+*****************************************************************************/
+#define PS_CHECK_NULL_POLY(NAME, NULL) \
+if (NAME == NULL || NAME->coeff == NULL) { \
+    psError(__func__,"Unallowable operation: polynomial %s or its coeffs is NULL.", #NAME); \
+    return(NULL); \
+} \
+
+
+
+
+
+/*****************************************************************************
+ 
+*****************************************************************************/
+/** Preprocessor macro to generate error on a NULL image */
+#define PS_CHECK_NULL_IMAGE(NAME, RVAL) \
+if (NAME == NULL || NAME->data.V == NULL) { \
+    psError(__func__,"Unallowable operation: psImage %s or its data is NULL.", #NAME); \
+    return(RVAL); \
+}
+
+/** Preprocessor macro to generate error for zero length rows or columns */
+#define PS_CHECK_EMPTY_IMAGE(NAME, RVAL) \
+if (NAME->numCols < 1 || NAME->numRows < 1) { \
+    psError(__func__,"Unallowable operation: psImage %s has zero rows or columns (%dx%d).", #NAME, \
+            NAME->numCols, NAME->numRows); \
+    return(RVAL); \
+}
+
+#define PS_CHECK_IMAGE_TYPE(NAME, TYPE, RVAL) \
+if (NAME->type.type != TYPE) { \
+    psError(__func__,"Unallowable operation: psImage %s has incorrect type.", #NAME); \
+    return(RVAL); \
+}
+
+/*****************************************************************************
+ 
+ *****************************************************************************/
+/** Preprocessor macro to generate error on a NULL image */
+#define PS_CHECK_NULL_IMAGE_READOUT(NAME, RVAL) \
+if (NAME == NULL || NAME->image == NULL) {                                                         \
+    psError(__func__,"Unallowable operation: psReadout %s or its data is NULL.", #NAME); \
+    return(RVAL); \
+}
+
+
+
+
+
+/*****************************************************************************
+ 
+ *****************************************************************************/
 #define PS_MAX(A, B) \
 (((A) > (B)) ? (A) : (B)) \
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 2210)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 2211)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 01:21:01 $
+ *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 19:58:54 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -254,5 +254,5 @@
     PS_CHECK_NULL_PTR(mySpline, NULL);
     PS_CHECK_NULL_PTR(y, NULL);
-    VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(y);
+    VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
     CONVERT_VECTOR_F64_TO_F32(y, y32, y32Static);
 
@@ -262,5 +262,5 @@
         yErr32 = yErr32Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(yErr);
+        VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
         CONVERT_VECTOR_F64_TO_F32(yErr, yErr32, yErr32Static);
     }
@@ -271,5 +271,5 @@
         x32 = x32Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(x);
+        VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         CONVERT_VECTOR_F64_TO_F32(x, x32, x32Static);
     }
@@ -855,5 +855,5 @@
     psS32 i;
     psPolynomial1D *tmpPoly;
-    PS_CHECK_NULL_1DPOLY_RETURN_NULL(myPoly);
+    PS_CHECK_NULL_POLY(myPoly, NULL);
     PS_CHECK_NULL_VECTOR(y, NULL);
     PS_CHECK_EMPTY_VECTOR(y, NULL);
@@ -865,5 +865,5 @@
     static psVector *yErr64Static = NULL;
 
-    VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(y);
+    VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
     CONVERT_VECTOR_F32_TO_F64(y, y64, y64Static);
 
@@ -873,5 +873,5 @@
         yErr64 = yErr64Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(yErr);
+        VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
         CONVERT_VECTOR_F32_TO_F64(yErr, yErr64, yErr64Static);
     }
@@ -885,5 +885,5 @@
         x64 = x64Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64_RETURN_NULL(x);
+        VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         CONVERT_VECTOR_F32_TO_F64(x, x64, x64Static);
     }
