Index: trunk/psModules/src/objects/pmPSF.c
===================================================================
--- trunk/psModules/src/objects/pmPSF.c	(revision 15089)
+++ trunk/psModules/src/objects/pmPSF.c	(revision 15562)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-29 00:15:32 $
+ *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-11-10 01:09:20 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -76,4 +76,10 @@
 }
 
+bool psMemCheckPSFOptions(psPtr ptr)
+{
+    PS_ASSERT_PTR(ptr, false);
+    return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmPSFOptionsFree);
+}
+
 /*****************************************************************************
 pmPSFFree(psf): function to free a pmPSF structure
@@ -81,7 +87,7 @@
 static void pmPSFFree (pmPSF *psf)
 {
-
-    if (psf == NULL)
+    if (psf == NULL) {
         return;
+    }
 
     psFree (psf->ChiTrend);
@@ -98,5 +104,6 @@
  pmPSFAlloc (type): allocate a pmPSF.
 
- NOTE: PSF model parameters which are not modeled on an image are set to NULL in psf->params.
+ NOTE: PSF model parameters which are not modeled on an image are set to NULL
+ in psf->params.
 
  These are normally:
@@ -109,4 +116,5 @@
 pmPSF *pmPSFAlloc (pmPSFOptions *options)
 {
+    PS_ASSERT_PTR_NON_NULL(options, NULL);
     int Nparams;
 
@@ -205,4 +213,10 @@
 }
 
+bool psMemCheckPSF(psPtr ptr)
+{
+    PS_ASSERT_PTR(ptr, false);
+    return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmPSFFree);
+}
+
 // the PSF models the \sigma_{xy} variation of the elliptical contour as a function of position in the image with a
 // polynomial.  an individual object has a contour of the form (x^2/2sx^2) + (y^2/2sy^2) + sxy*x*y
@@ -217,4 +231,5 @@
 double pmPSF_SXYfromModel (psF32 *modelPar)
 {
+    PS_ASSERT_PTR_NON_NULL(modelPar, NAN);
 
     double SXX = modelPar[PM_PAR_SXX];
@@ -229,4 +244,5 @@
 double pmPSF_SXYtoModel (psF32 *fittedPar)
 {
+    PS_ASSERT_PTR_NON_NULL(fittedPar, NAN);
 
     double SXX = fittedPar[PM_PAR_SXX];
@@ -247,4 +263,6 @@
 bool pmPSF_FitToModel (psF32 *fittedPar, float minMinorAxis)
 {
+    PS_ASSERT_PTR_NON_NULL(fittedPar, false);
+
     psEllipsePol pol;
 
@@ -272,4 +290,7 @@
 psEllipsePol pmPSF_ModelToFit (psF32 *modelPar)
 {
+//   XXX: must assert non-NULL input parameter
+//    PS_ASSERT_PTR_NON_NULL(modelPar, NAN);
+
     psEllipseShape shape;
 
@@ -289,4 +310,6 @@
     psEllipseShape shape;
     psEllipseAxes axes;
+//   XXX: must assert non-NULL input parameter
+//    PS_ASSERT_PTR_NON_NULL(modelPar, axes);
 
     shape.sx  = modelPar[PM_PAR_SXX] / M_SQRT2;
@@ -310,4 +333,6 @@
 bool pmPSF_AxesToModel (psF32 *modelPar, psEllipseAxes axes)
 {
+    PS_ASSERT_PTR_NON_NULL(modelPar, false);
+
     if ((axes.major <= 0) || (axes.minor <= 0)) {
         modelPar[PM_PAR_SXX] = 0.0;
@@ -374,4 +399,6 @@
 bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, psMaskType maskVal, psMaskType mark)
 {
+    PS_ASSERT_PTR_NON_NULL(readout, false);
+    PS_ASSERT_PTR_NON_NULL(readout->image, false);
 
     // bool status;
