Index: trunk/psModules/src/detrend/pmFringeStats.c
===================================================================
--- trunk/psModules/src/detrend/pmFringeStats.c	(revision 7126)
+++ trunk/psModules/src/detrend/pmFringeStats.c	(revision 7278)
@@ -3,6 +3,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-17 00:55:35 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 00:55:23 $
  *
  *  Copyright 2004 IfA
@@ -61,4 +61,7 @@
 bool pmFringeRegionsCreatePoints(pmFringeRegions *fringe, const psImage *image)
 {
+    PS_ASSERT_PTR_NON_NULL(fringe, false);
+    PS_ASSERT_PTR_NON_NULL(image, false);
+    PS_ASSERT_IMAGE_NON_EMPTY(image, false);
 
     double frnd;
@@ -106,4 +109,6 @@
 pmFringeStats *pmFringeStatsAlloc(pmFringeRegions *regions)
 {
+    PS_ASSERT_PTR_NON_NULL(regions, false);
+
     pmFringeStats *stats = psAlloc(sizeof(pmFringeStats));
     (void)psMemSetDeallocator(stats, (psFreeFunc)fringeStatsFree);
@@ -120,4 +125,9 @@
 pmFringeStats *pmFringeStatsMeasure(pmFringeRegions *fringe, pmReadout *readout, psMaskType maskVal)
 {
+    PS_ASSERT_PTR_NON_NULL(fringe, NULL);
+    PS_ASSERT_PTR_NON_NULL(readout, NULL);
+    PS_ASSERT_PTR_NON_NULL(readout->image, NULL);
+    PS_ASSERT_IMAGE_NON_EMPTY(readout->image, NULL);
+
     if (!fringe->x || !fringe->y) {
         // create the fringe vectors for this image
@@ -364,4 +374,9 @@
                                     unsigned int nIter, float keepFrac)
 {
+    PS_ASSERT_PTR_NON_NULL(science, NULL);
+    PS_ASSERT_PTR_NON_NULL(fringes, NULL);
+    PS_ASSERT_INT_POSITIVE(fringes->n, NULL);
+    PS_ASSERT_INT_POSITIVE(nIter, NULL);
+
     pmFringeRegions *regions = science->regions; // The fringe regions
     int numRegions = regions->nRequested; // Number of regions
@@ -439,4 +454,13 @@
                          unsigned int nIter, float keepFrac)
 {
+    PS_ASSERT_PTR_NON_NULL(readout, NULL);
+    PS_ASSERT_PTR_NON_NULL(readout->image, NULL);
+    PS_ASSERT_IMAGE_NON_EMPTY(readout->image, NULL);
+    PS_ASSERT_PTR_NON_NULL(fringes, NULL);
+    PS_ASSERT_PTR_NON_NULL(fringeImages, NULL);
+    PS_ASSERT_PTR_NON_NULL(fringeStats, NULL);
+    PS_ASSERT_INT_EQUAL(fringeImages->n, fringeStats->n, NULL);
+    PS_ASSERT_INT_POSITIVE(nIter, NULL);
+
     // measure the fringe stats for the science frame and solve for the scales
     pmFringeStats *scienceStats = pmFringeStatsMeasure(fringes, readout, maskVal);
