Index: trunk/psModules/src/detrend/pmFringeStats.h
===================================================================
--- trunk/psModules/src/detrend/pmFringeStats.h	(revision 6921)
+++ trunk/psModules/src/detrend/pmFringeStats.h	(revision 6957)
@@ -5,6 +5,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-20 04:28:00 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-22 03:21:00 $
  *
  *  Copyright 2004 IfA, University of Hawaii
@@ -13,4 +13,8 @@
 # ifndef PM_FRINGE_STATS
 # define PM_FRINGE_STATS
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// pmFringeRegions
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 /** Structure to hold the fringe measurement regions.
@@ -30,4 +34,5 @@
 pmFringeRegions;
 
+/// Allocate fringe regions
 pmFringeRegions *pmFringeRegionsAlloc (
     int nPts,     // number of points to create
@@ -37,4 +42,14 @@
     int nY    // smoothing scale in y
 );
+
+// Generate the fringe points
+bool pmFringeRegionsCreatePoints(pmFringeRegions *fringe, // Fringe regions
+                                 const psImage *image // Image for the regions (defines the size)
+                                );
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// pmFringeStats
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 /** Structure to hold the fringe measurements for a particular image
@@ -48,18 +63,7 @@
 pmFringeStats;
 
-pmFringeStats *pmFringeStatsAlloc(pmFringeRegions *regions);
-
-// Generate the fringe points
-bool pmFringeRegionsCreatePoints(pmFringeRegions *fringe, psImage *image);
-
-/** the pmFringeScale structure defines the relationship between two fringe measurements
- */
-typedef struct
-{
-    int nFringeFrames;
-    psVector *coeff;
-    psVector *coeffErr;
-}
-pmFringeScale;
+/// Allocate fringe statistics
+pmFringeStats *pmFringeStatsAlloc(pmFringeRegions *regions // The fringe regions which will be measured
+                                 );
 
 /** Measure the fringe stats for an image
@@ -78,4 +82,43 @@
 );
 
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// pmFringeScale
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/** the pmFringeScale structure defines the relationship between two fringe measurements
+ */
+typedef struct
+{
+    int nFringeFrames;
+    psVector *coeff;
+    psVector *coeffErr;
+}
+pmFringeScale;
+
+/** Determine the scales for the fringe correction
+ *
+ * Given an input fringe measurement, and an array of template fringe measurements, measure the contribution
+ * of each of the templates to the input.  Rejection is performed on the fringe regions, to weed out stars
+ * etc.
+ *
+ * @return pmFringeScale*
+ */
+pmFringeScale *pmFringeScaleMeasure(pmFringeStats *science, // Fringe measurements from science image
+                                    psArray *fringes, // Array of fringe measurements from templates
+                                    float rej, // Rejection threshold (in standard deviations)
+                                    unsigned int nIter, // Maximum number of iterations
+                                    float keepFrac // Minimum fraction of regions to keep
+                                   );
+
+/// Allocate fringe scales
+pmFringeScale *pmFringeScaleAlloc(int nFringeFrames // Number of fringe frames
+                                 );
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Fringe correction
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
 /** Fringe correct the science image
  *
@@ -89,6 +132,10 @@
                          psArray *fringeImages, // fringe images to use in correction
                          psArray *fringeStats, // fringe stats to use in correction
-                         psMaskType maskVal // Value to mask
+                         psMaskType maskVal, // Value to mask
+                         float rej,     // Rejection threshold, for pmFringeScaleMeasure
+                         unsigned int nIter, // Maximum number of iterations, for pmFringeScaleMeasure
+                         float keepFrac // Minimum fraction of regions to keep, for pmFringeScaleMeasure
                         );
 
+
 # endif
