Index: /trunk/psModules/src/camera/pmFPAMaskWeight.h
===================================================================
--- /trunk/psModules/src/camera/pmFPAMaskWeight.h	(revision 7282)
+++ /trunk/psModules/src/camera/pmFPAMaskWeight.h	(revision 7283)
@@ -4,11 +4,19 @@
 #include "pmFPA.h"
 
+// these defines are necessary to yield 8-bit results (use instead of ~)
+#define NOT_U8(A)(UCHAR_MAX-(A))
+#define NOT_U16(A)(USHORT_MAX-(A))
+
 /** Mask values */
 typedef enum {
-    PM_MASK_TRAP    = 0x0001,   ///< The pixel is a charge trap.
-    PM_MASK_BADCOL  = 0x0002,   ///< The pixel is a bad column.
-    PM_MASK_SAT     = 0x0004,   ///< The pixel is saturated.
-    PM_MASK_BAD     = 0x0008,   ///< The pixel is low
-    PM_MASK_FLAT    = 0x0010    ///< The pixel is non-positive in the flat-field.
+    PM_MASK_CLEAR   = 0x00,   ///< The pixel is not masked
+    PM_MASK_TRAP    = 0x01,   ///< The pixel is a charge trap.
+    PM_MASK_BADCOL  = 0x02,   ///< The pixel is a bad column.
+    PM_MASK_SAT     = 0x04,   ///< The pixel is saturated.
+    PM_MASK_BAD     = 0x08,   ///< The pixel is low
+    PM_MASK_FLAT    = 0x10,   ///< The pixel is non-positive in the flat-field.
+    PM_MASK_MARK    = 0x20,   ///< The pixel is marked as temporarily ignored
+    PM_MASK_EXT1    = 0x40,   ///< This mask value is not used
+    PM_MASK_EXT2    = 0x80,   ///< This mask value is not used
 } pmMaskValue;
 
Index: /trunk/psModules/src/camera/pmFPAfile.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAfile.c	(revision 7282)
+++ /trunk/psModules/src/camera/pmFPAfile.c	(revision 7283)
@@ -5,5 +5,5 @@
 #include "pmHDU.h"
 #include "pmFPA.h"
-#include "pmMaskBadPixels.h"
+#include "pmFPAMaskWeight.h"
 #include "pmFPAConstruct.h"
 #include "pmFPAview.h"
Index: /trunk/psModules/src/detrend/Makefile.am
===================================================================
--- /trunk/psModules/src/detrend/Makefile.am	(revision 7282)
+++ /trunk/psModules/src/detrend/Makefile.am	(revision 7283)
@@ -7,8 +7,8 @@
 	pmFlatNormalize.c \
 	pmFringeStats.c \
+	pmMaskBadPixels.c \
 	pmNonLinear.c \
 	pmSubtractBias.c
 #	pmSubtractSky.c
-#	pmMaskBadPixels.c
 
 psmoduleincludedir = $(includedir)
@@ -18,9 +18,9 @@
 	pmFlatNormalize.h \
 	pmFringeStats.h \
+	pmMaskBadPixelsErrors.h \
+	pmMaskBadPixels.h \
 	pmNonLinear.h \
 	pmSubtractBias.h
 #	pmSubtractSky.c
-#	pmMaskBadPixelsErrors.h
-#	pmMaskBadPixels.h
 
 EXTRA_DIST = \
Index: /trunk/psModules/src/detrend/pmFlatField.c
===================================================================
--- /trunk/psModules/src/detrend/pmFlatField.c	(revision 7282)
+++ /trunk/psModules/src/detrend/pmFlatField.c	(revision 7283)
@@ -18,6 +18,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-06-02 00:55:23 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 02:16:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -34,5 +34,5 @@
 #include "pslib.h"
 #include "pmFlatField.h"
-#include "pmMaskBadPixels.h"
+#include "pmFPAMaskWeight.h"
 #include "pmFlatFieldErrors.h"
 
Index: /trunk/psModules/src/detrend/pmMaskBadPixels.c
===================================================================
--- /trunk/psModules/src/detrend/pmMaskBadPixels.c	(revision 7282)
+++ /trunk/psModules/src/detrend/pmMaskBadPixels.c	(revision 7283)
@@ -1,7 +1,2 @@
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// XXX WARNING: I have completely replaced this file with an OLD VERSION (that works) instead of the
-// one that was being worked on.
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 /** @file  pmMaskBadPixels.c
  *
@@ -24,6 +19,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-19 20:37:35 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 02:16:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -34,8 +29,9 @@
 #endif
 
-#include<stdio.h>
-#include<math.h>
-#include<strings.h>
+#include <stdio.h>
+#include <math.h>
+#include <strings.h>
 
+#include "pmFPAMaskWeight.h"
 #include "pmMaskBadPixels.h"
 #include "pmMaskBadPixelsErrors.h"
@@ -148,8 +144,8 @@
             /* Pixels which satisfy growVal and within the grow radius shall be masked */                    \
             if(mask->data.PS_TYPE_MASK_DATA[j][i] & growVal) {                                               \
-                rowMin = PS_MAX(j-grow, 0);                                                                     \
-                rowMax = PS_MIN(j+grow+1, inImage->numRows);                                                    \
-                colMin = PS_MAX(i-grow, 0);                                                                     \
-                colMax = PS_MIN(i+grow+1, inImage->numCols);                                                    \
+                rowMin = PS_MAX(j-grow, 0);                                                                  \
+                rowMax = PS_MIN(j+grow+1, inImage->numRows);                                                 \
+                colMin = PS_MAX(i-grow, 0);                                                                  \
+                colMax = PS_MIN(i+grow+1, inImage->numCols);                                                 \
                 for(jj=rowMin; jj<rowMax; jj++) {                                                            \
                     for(ii=colMin; ii<colMax; ii++) {                                                        \
Index: /trunk/psModules/src/detrend/pmMaskBadPixels.h
===================================================================
--- /trunk/psModules/src/detrend/pmMaskBadPixels.h	(revision 7282)
+++ /trunk/psModules/src/detrend/pmMaskBadPixels.h	(revision 7283)
@@ -1,7 +1,2 @@
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// XXX WARNING: I have completely replaced this file with an OLD VERSION (that works) instead of the
-// one that was being worked on.
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 /** @file  pmMaskBadPixels.h
  *
@@ -24,36 +19,14 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-04 03:57:32 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 02:16:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
+#ifndef PM_MASK_BAD_PIXELS_H
+#define PM_MASK_BAD_PIXELS_H
 
 #include "pslib.h"
 #include "pmFPA.h"
-
-// these defines are necessary to yield 8-bit results (use instead of ~)
-# define NOT_U8(A)(UCHAR_MAX-(A))
-# define NOT_U16(A)(USHORT_MAX-(A))
-
-/** Mask values */
-typedef enum {
-    PM_MASK_CLEAR   = 0x00,   ///< The pixel is not masked
-    PM_MASK_TRAP    = 0x01,   ///< The pixel is a charge trap.
-    PM_MASK_BADCOL  = 0x02,   ///< The pixel is a bad column.
-    PM_MASK_SAT     = 0x04,   ///< The pixel is saturated.
-    PM_MASK_BAD     = 0x08,   ///< The pixel is low
-    PM_MASK_FLAT    = 0x10,   ///< The pixel is non-positive in the flat-field.
-    PM_MASK_MARK    = 0x20,   ///< The pixel is marked as temporarily ignored
-    PM_MASK_EXT1    = 0x40,   ///< This mask value is not used
-    PM_MASK_EXT2    = 0x80,   ///< This mask value is not used
-} pmMaskValue;
-
-bool pmReadoutSetMask(pmReadout *readout // Readout for which to set mask
-                     );
-bool pmReadoutSetWeight(pmReadout *readout // Readout for which to set weight
-                       );
-bool pmCellSetMaskWeight(pmCell *cell // Cell for which to set weights
-                        );
 
 /** Execute bad pixels module.
@@ -74,2 +47,4 @@
 );
 
+
+#endif
Index: /trunk/psModules/src/imcombine/pmReadoutCombine.c
===================================================================
--- /trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 7282)
+++ /trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 7283)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-06-02 00:55:23 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 02:16:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,5 +17,5 @@
 
 #include "pmFPA.h"
-#include "pmMaskBadPixels.h"
+#include "pmFPAMaskWeight.h"
 
 #include "pmReadoutCombine.h"
Index: /trunk/psModules/src/objects/pmPSFtry.c
===================================================================
--- /trunk/psModules/src/objects/pmPSFtry.c	(revision 7282)
+++ /trunk/psModules/src/objects/pmPSFtry.c	(revision 7283)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-23 01:07:51 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 02:16:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -15,5 +15,5 @@
 #include "pmHDU.h"
 #include "pmFPA.h"
-#include "pmMaskBadPixels.h"
+#include "pmFPAMaskWeight.h"
 #include "pmPeaks.h"
 #include "pmMoments.h"
Index: /trunk/psModules/src/objects/pmSource.c
===================================================================
--- /trunk/psModules/src/objects/pmSource.c	(revision 7282)
+++ /trunk/psModules/src/objects/pmSource.c	(revision 7283)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-21 21:29:01 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 02:16:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -19,5 +19,5 @@
 #include "pmHDU.h"
 #include "pmFPA.h"
-#include "pmMaskBadPixels.h"
+#include "pmFPAMaskWeight.h"
 #include "pmPeaks.h"
 #include "pmMoments.h"
@@ -133,6 +133,6 @@
 
 /******************************************************************************
-    pmSourcePSFClump(source, metadata): Find the likely PSF clump in the 
-    sigma-x, sigma-y plane. return 0,0 clump in case of error. 
+    pmSourcePSFClump(source, metadata): Find the likely PSF clump in the
+    sigma-x, sigma-y plane. return 0,0 clump in case of error.
 *****************************************************************************/
 
@@ -310,9 +310,9 @@
     pmSourceRoughClass(source, metadata): make a guess at the source
     classification.
-     
+ 
     XXX: push the clump info into the metadata?
-     
+ 
     XXX: How can this function ever return FALSE?
-     
+ 
     EAM: I moved S/N calculation to pmSourceMoments, using weight image
 *****************************************************************************/
Index: /trunk/psModules/src/objects/pmSourcePhotometry.c
===================================================================
--- /trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 7282)
+++ /trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 7283)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA; GLG, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-23 01:07:51 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 02:16:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -16,5 +16,5 @@
 #include "pmHDU.h"
 #include "pmFPA.h"
-#include "pmMaskBadPixels.h"
+#include "pmFPAMaskWeight.h"
 #include "pmPeaks.h"
 #include "pmMoments.h"
@@ -52,6 +52,6 @@
         - the source is a STAR (PSF)
         - the option is selected (how??)
-       
-    - extMag : all sources with non-NULL modelEXT 
+ 
+    - extMag : all sources with non-NULL modelEXT
 **/
 
Index: /trunk/psModules/src/objects/pmSourceSky.c
===================================================================
--- /trunk/psModules/src/objects/pmSourceSky.c	(revision 7282)
+++ /trunk/psModules/src/objects/pmSourceSky.c	(revision 7283)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-19 20:37:35 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 02:16:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -19,5 +19,5 @@
 #include "pmHDU.h"
 #include "pmFPA.h"
-#include "pmMaskBadPixels.h"
+#include "pmFPAMaskWeight.h"
 #include "pmPeaks.h"
 #include "pmMoments.h"
