Index: /trunk/psLib/src/dataManip/psFFT.c
===================================================================
--- /trunk/psLib/src/dataManip/psFFT.c	(revision 808)
+++ /trunk/psLib/src/dataManip/psFFT.c	(revision 809)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-05-28 21:04:34 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-05-28 21:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -160,5 +160,5 @@
 
     /* if not a complex number, this is logically just a copy */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. "
@@ -219,5 +219,5 @@
 
     /* if not a complex number, this is logically just zeroed image of same size */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Imaginary portion of a non-Complex type called for. "
@@ -285,5 +285,5 @@
     }
 
-    if (IS_PSELEMTYPE_COMPLEX(type)) {
+    if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
         return NULL;
@@ -352,5 +352,5 @@
 
     /* if not a complex number, this is logically just a image copy */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Complex Conjugate of a non-Complex type called for. "
@@ -414,5 +414,5 @@
 
     /* if not a complex number, this is not implemented */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
         return NULL;
Index: /trunk/psLib/src/dataManip/psVectorFFT.c
===================================================================
--- /trunk/psLib/src/dataManip/psVectorFFT.c	(revision 808)
+++ /trunk/psLib/src/dataManip/psVectorFFT.c	(revision 809)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-05-28 21:04:34 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-05-28 21:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -160,5 +160,5 @@
 
     /* if not a complex number, this is logically just a copy */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. "
@@ -219,5 +219,5 @@
 
     /* if not a complex number, this is logically just zeroed image of same size */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Imaginary portion of a non-Complex type called for. "
@@ -285,5 +285,5 @@
     }
 
-    if (IS_PSELEMTYPE_COMPLEX(type)) {
+    if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
         return NULL;
@@ -352,5 +352,5 @@
 
     /* if not a complex number, this is logically just a image copy */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Complex Conjugate of a non-Complex type called for. "
@@ -414,5 +414,5 @@
 
     /* if not a complex number, this is not implemented */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
         return NULL;
Index: /trunk/psLib/src/fft/psVectorFFT.c
===================================================================
--- /trunk/psLib/src/fft/psVectorFFT.c	(revision 808)
+++ /trunk/psLib/src/fft/psVectorFFT.c	(revision 809)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-05-28 21:04:34 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-05-28 21:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -160,5 +160,5 @@
 
     /* if not a complex number, this is logically just a copy */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. "
@@ -219,5 +219,5 @@
 
     /* if not a complex number, this is logically just zeroed image of same size */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Imaginary portion of a non-Complex type called for. "
@@ -285,5 +285,5 @@
     }
 
-    if (IS_PSELEMTYPE_COMPLEX(type)) {
+    if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
         return NULL;
@@ -352,5 +352,5 @@
 
     /* if not a complex number, this is logically just a image copy */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         // Warn user, as this is probably not expected
         psLogMsg(__func__,PS_LOG_WARN,"Complex Conjugate of a non-Complex type called for. "
@@ -414,5 +414,5 @@
 
     /* if not a complex number, this is not implemented */
-    if (! IS_PSELEMTYPE_COMPLEX(type)) {
+    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
         return NULL;
Index: /trunk/psLib/src/sys/psType.h
===================================================================
--- /trunk/psLib/src/sys/psType.h	(revision 808)
+++ /trunk/psLib/src/sys/psType.h	(revision 809)
@@ -20,6 +20,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-05-28 03:15:04 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-05-28 21:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -56,40 +56,61 @@
 typedef complex double  psC64;          ///< complex with 64-bit floating point Real and Imagary numbers
 
+
 typedef enum {
-    PS_TYPE_INT8             = 0x0101,   ///< Character.
-    PS_TYPE_INT16            = 0x0102,   ///< Short integer.
-    PS_TYPE_INT32            = 0x0104,   ///< Integer.
-    PS_TYPE_INT64            = 0x0108,   ///< Long integer.
-    PS_TYPE_UINT8            = 0x0301,   ///< Unsigned character.
-    PS_TYPE_UINT16           = 0x0302,   ///< Unsigned short integer.
-    PS_TYPE_UINT32           = 0x0304,   ///< Unsigned integer.
-    PS_TYPE_UINT64           = 0x0308,   ///< Unsigned long integer.
-    PS_TYPE_FLOAT            = 0x0404,   ///< Single-precision Floating point.
-    PS_TYPE_DOUBLE           = 0x0408,   ///< Double-precision floating point.
-    PS_TYPE_COMPLEX_FLOAT    = 0x0808,   ///< Complex numbers consisting of single-precision floating point.
-    PS_TYPE_COMPLEX_DOUBLE   = 0x0810,   ///< Complex numbers consisting of double-precision floating point.
-    PS_TYPE_OTHER            = 0x0000,   ///< Something else that's not supported for arithmetic.
+    PS_TYPE_INT8             = 0x0101,  ///< Character.
+    PS_TYPE_INT16            = 0x0102,  ///< Short integer.
+    PS_TYPE_INT32            = 0x0104,  ///< Integer.
+    PS_TYPE_INT64            = 0x0108,  ///< Long integer.
+    PS_TYPE_UINT8            = 0x0301,  ///< Unsigned character.
+    PS_TYPE_UINT16           = 0x0302,  ///< Unsigned short integer.
+    PS_TYPE_UINT32           = 0x0304,  ///< Unsigned integer.
+    PS_TYPE_UINT64           = 0x0308,  ///< Unsigned long integer.
+    PS_TYPE_FLOAT            = 0x0404,  ///< Single-precision Floating point.
+    PS_TYPE_DOUBLE           = 0x0408,  ///< Double-precision floating point.
+    PS_TYPE_COMPLEX_FLOAT    = 0x0808,  ///< Complex numbers consisting of single-precision floating point.
+    PS_TYPE_COMPLEX_DOUBLE   = 0x0810,  ///< Complex numbers consisting of double-precision floating point.
+    PS_TYPE_OTHER            = 0x0000,  ///< Something else that's not supported for arithmetic.
 
     // Abbreviated versions of the above types
-    PS_TYPE_S8               = 0x0101,   ///< Character.
-    PS_TYPE_S16              = 0x0102,   ///< Short integer.
-    PS_TYPE_S32              = 0x0104,   ///< Integer.
-    PS_TYPE_S64              = 0x0108,   ///< Long integer.
-    PS_TYPE_U8               = 0x0301,   ///< Unsigned character.
-    PS_TYPE_U16              = 0x0302,   ///< Unsigned short integer.
-    PS_TYPE_U32              = 0x0304,   ///< Unsigned integer.
-    PS_TYPE_U64              = 0x0308,   ///< Unsigned long integer.
-    PS_TYPE_F32              = 0x0404,   ///< Single-precision Floating point.
-    PS_TYPE_F64              = 0x0408,   ///< Double-precision floating point.
-    PS_TYPE_C32              = 0x0808,   ///< Complex numbers consisting of single-precision floating point.
-    PS_TYPE_C64              = 0x0810,   ///< Complex numbers consisting of double-precision floating point.
-    PS_TYPE_PTR              = 0x0000    ///< Something else that's not supported for arithmetic.
+    PS_TYPE_S8               = 0x0101,  ///< Character.
+    PS_TYPE_S16              = 0x0102,  ///< Short integer.
+    PS_TYPE_S32              = 0x0104,  ///< Integer.
+    PS_TYPE_S64              = 0x0108,  ///< Long integer.
+    PS_TYPE_U8               = 0x0301,  ///< Unsigned character.
+    PS_TYPE_U16              = 0x0302,  ///< Unsigned short integer.
+    PS_TYPE_U32              = 0x0304,  ///< Unsigned integer.
+    PS_TYPE_U64              = 0x0308,  ///< Unsigned long integer.
+    PS_TYPE_F32              = 0x0404,  ///< Single-precision Floating point.
+    PS_TYPE_F64              = 0x0408,  ///< Double-precision floating point.
+    PS_TYPE_C32              = 0x0808,  ///< Complex numbers consisting of single-precision floating point.
+    PS_TYPE_C64              = 0x0810,  ///< Complex numbers consisting of double-precision floating point.
+    PS_TYPE_PTR              = 0x0000   ///< Something else that's not supported for arithmetic.
 
 } psElemType;
 
-#define IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
-#define IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
-#define IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
-#define IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
+#define PS_TYPE_MASK PS_TYPE_U8         ///< the psElemType to use for mask image
+typedef psU8 psMaskType;                ///< the C datatype for a mask image
+
+/// Macro to get the bad pixel reason code (stored as part of mask value)
+#define PS_BADPIXEL_BITMASK 0x0f
+#define PS_GET_BADPIXEL(maskValue) (maskValue & PS_BADPIXEL_BITMASK)
+
+#define PS_IS_BADPIXEL(maskValue) (PS_GET_BADPIXEL(maskValue) != 0)
+
+/// Macro to apply a bad pixel reason code to mask image
+#define PS_SET_BADPIXEL(maskValue, reasonCode) \
+{ \
+    maskValue = (psMaskType)((reasonCode & PS_BADPIXEL_BITMASK) | (maskValue & ~PS_BADPIXEL_BITMASK)); \
+}
+
+/// Macro to determine if the psElemType is an integer.
+#define PS_IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
+/// Macro to determine if the psElemType is unsigned.
+#define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
+/// Macro to determine if the psElemType is a real (non-complex) floating-point type.
+#define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
+/// Macro to determine if the psElemType is complex number type.
+#define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
+/// Macro to determine the storage size, in bytes, of the psElemType.
 #define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) :(x & 0xFF) )
 
Index: /trunk/psLib/src/sysUtils/psType.h
===================================================================
--- /trunk/psLib/src/sysUtils/psType.h	(revision 808)
+++ /trunk/psLib/src/sysUtils/psType.h	(revision 809)
@@ -20,6 +20,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-05-28 03:15:04 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-05-28 21:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -56,40 +56,61 @@
 typedef complex double  psC64;          ///< complex with 64-bit floating point Real and Imagary numbers
 
+
 typedef enum {
-    PS_TYPE_INT8             = 0x0101,   ///< Character.
-    PS_TYPE_INT16            = 0x0102,   ///< Short integer.
-    PS_TYPE_INT32            = 0x0104,   ///< Integer.
-    PS_TYPE_INT64            = 0x0108,   ///< Long integer.
-    PS_TYPE_UINT8            = 0x0301,   ///< Unsigned character.
-    PS_TYPE_UINT16           = 0x0302,   ///< Unsigned short integer.
-    PS_TYPE_UINT32           = 0x0304,   ///< Unsigned integer.
-    PS_TYPE_UINT64           = 0x0308,   ///< Unsigned long integer.
-    PS_TYPE_FLOAT            = 0x0404,   ///< Single-precision Floating point.
-    PS_TYPE_DOUBLE           = 0x0408,   ///< Double-precision floating point.
-    PS_TYPE_COMPLEX_FLOAT    = 0x0808,   ///< Complex numbers consisting of single-precision floating point.
-    PS_TYPE_COMPLEX_DOUBLE   = 0x0810,   ///< Complex numbers consisting of double-precision floating point.
-    PS_TYPE_OTHER            = 0x0000,   ///< Something else that's not supported for arithmetic.
+    PS_TYPE_INT8             = 0x0101,  ///< Character.
+    PS_TYPE_INT16            = 0x0102,  ///< Short integer.
+    PS_TYPE_INT32            = 0x0104,  ///< Integer.
+    PS_TYPE_INT64            = 0x0108,  ///< Long integer.
+    PS_TYPE_UINT8            = 0x0301,  ///< Unsigned character.
+    PS_TYPE_UINT16           = 0x0302,  ///< Unsigned short integer.
+    PS_TYPE_UINT32           = 0x0304,  ///< Unsigned integer.
+    PS_TYPE_UINT64           = 0x0308,  ///< Unsigned long integer.
+    PS_TYPE_FLOAT            = 0x0404,  ///< Single-precision Floating point.
+    PS_TYPE_DOUBLE           = 0x0408,  ///< Double-precision floating point.
+    PS_TYPE_COMPLEX_FLOAT    = 0x0808,  ///< Complex numbers consisting of single-precision floating point.
+    PS_TYPE_COMPLEX_DOUBLE   = 0x0810,  ///< Complex numbers consisting of double-precision floating point.
+    PS_TYPE_OTHER            = 0x0000,  ///< Something else that's not supported for arithmetic.
 
     // Abbreviated versions of the above types
-    PS_TYPE_S8               = 0x0101,   ///< Character.
-    PS_TYPE_S16              = 0x0102,   ///< Short integer.
-    PS_TYPE_S32              = 0x0104,   ///< Integer.
-    PS_TYPE_S64              = 0x0108,   ///< Long integer.
-    PS_TYPE_U8               = 0x0301,   ///< Unsigned character.
-    PS_TYPE_U16              = 0x0302,   ///< Unsigned short integer.
-    PS_TYPE_U32              = 0x0304,   ///< Unsigned integer.
-    PS_TYPE_U64              = 0x0308,   ///< Unsigned long integer.
-    PS_TYPE_F32              = 0x0404,   ///< Single-precision Floating point.
-    PS_TYPE_F64              = 0x0408,   ///< Double-precision floating point.
-    PS_TYPE_C32              = 0x0808,   ///< Complex numbers consisting of single-precision floating point.
-    PS_TYPE_C64              = 0x0810,   ///< Complex numbers consisting of double-precision floating point.
-    PS_TYPE_PTR              = 0x0000    ///< Something else that's not supported for arithmetic.
+    PS_TYPE_S8               = 0x0101,  ///< Character.
+    PS_TYPE_S16              = 0x0102,  ///< Short integer.
+    PS_TYPE_S32              = 0x0104,  ///< Integer.
+    PS_TYPE_S64              = 0x0108,  ///< Long integer.
+    PS_TYPE_U8               = 0x0301,  ///< Unsigned character.
+    PS_TYPE_U16              = 0x0302,  ///< Unsigned short integer.
+    PS_TYPE_U32              = 0x0304,  ///< Unsigned integer.
+    PS_TYPE_U64              = 0x0308,  ///< Unsigned long integer.
+    PS_TYPE_F32              = 0x0404,  ///< Single-precision Floating point.
+    PS_TYPE_F64              = 0x0408,  ///< Double-precision floating point.
+    PS_TYPE_C32              = 0x0808,  ///< Complex numbers consisting of single-precision floating point.
+    PS_TYPE_C64              = 0x0810,  ///< Complex numbers consisting of double-precision floating point.
+    PS_TYPE_PTR              = 0x0000   ///< Something else that's not supported for arithmetic.
 
 } psElemType;
 
-#define IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
-#define IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
-#define IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
-#define IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
+#define PS_TYPE_MASK PS_TYPE_U8         ///< the psElemType to use for mask image
+typedef psU8 psMaskType;                ///< the C datatype for a mask image
+
+/// Macro to get the bad pixel reason code (stored as part of mask value)
+#define PS_BADPIXEL_BITMASK 0x0f
+#define PS_GET_BADPIXEL(maskValue) (maskValue & PS_BADPIXEL_BITMASK)
+
+#define PS_IS_BADPIXEL(maskValue) (PS_GET_BADPIXEL(maskValue) != 0)
+
+/// Macro to apply a bad pixel reason code to mask image
+#define PS_SET_BADPIXEL(maskValue, reasonCode) \
+{ \
+    maskValue = (psMaskType)((reasonCode & PS_BADPIXEL_BITMASK) | (maskValue & ~PS_BADPIXEL_BITMASK)); \
+}
+
+/// Macro to determine if the psElemType is an integer.
+#define PS_IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
+/// Macro to determine if the psElemType is unsigned.
+#define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
+/// Macro to determine if the psElemType is a real (non-complex) floating-point type.
+#define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
+/// Macro to determine if the psElemType is complex number type.
+#define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
+/// Macro to determine the storage size, in bytes, of the psElemType.
 #define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) :(x & 0xFF) )
 
