Index: /trunk/psModules/src/objects/pmGrowthCurve.c
===================================================================
--- /trunk/psModules/src/objects/pmGrowthCurve.c	(revision 9896)
+++ /trunk/psModules/src/objects/pmGrowthCurve.c	(revision 9897)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-11-07 09:04:08 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-11-07 22:55:40 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,5 +18,4 @@
 #include <pslib.h>
 #include "pmFPA.h"
-#include "pmFPAMaskWeight.h"
 #include "pmPeaks.h"
 #include "pmMoments.h"
@@ -26,5 +25,4 @@
 #include "pmPSF.h"
 #include "psVectorBracket.h"
-#include "pmSourcePhotometry.h"
 
 static void pmGrowthCurveFree (pmGrowthCurve *growth)
@@ -64,81 +62,2 @@
     return apCor;
 }
-
-// we generate the growth curve for the center of the image with the specified psf model
-bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore)
-{
-
-    // bool status;
-    float xc, yc, dx, dy;
-    float fitMag, apMag;
-    float radius;
-
-    // create template model
-    pmModel *modelRef = pmModelAlloc(psf->type);
-
-    // use the center of the center pixel of the image
-    xc = 0.5*readout->image->numCols + readout->image->col0 + 0.5;
-    yc = 0.5*readout->image->numRows + readout->image->row0 + 0.5;
-    dx = psf->growth->maxRadius + 1;
-    dy = psf->growth->maxRadius + 1;
-
-    // assign the x and y coords to the image center
-    // create an object with center intensity of 1000
-    modelRef->params->data.F32[PM_PAR_SKY] = 0;
-    modelRef->params->data.F32[PM_PAR_I0] = 1000;
-    modelRef->params->data.F32[PM_PAR_XPOS] = xc;
-    modelRef->params->data.F32[PM_PAR_YPOS] = yc;
-
-    // create modelPSF from this model
-    pmModel *model = pmModelFromPSF (modelRef, psf);
-
-    // measure the fitMag for this model
-    pmSourcePhotometryModel (&fitMag, model);
-    psf->growth->fitMag = fitMag;
-
-    // generate working image for this source
-    psRegion region = {xc - dx, xc + dx, yc - dy, yc + dy};
-    psImage *view = psImageSubset (readout->image, region);
-    psImage *image = psImageCopy (NULL, view, PS_TYPE_F32);
-    psImage *mask = psImageCopy (NULL, view, PS_TYPE_U8);
-
-    psImageInit (image, 0.0);
-    psImageInit (mask, 0);
-
-    // place the reference object in the image center
-    // no need to mask the source here
-    pmModelAdd (image, NULL, model, false, false);
-
-    // loop over a range of source fluxes
-    // no need to interpolate since we have forced the object center
-    // to 0.5, 0.5 above
-    for (int i = 0; i < psf->growth->radius->n; i++) {
-
-        radius = psf->growth->radius->data.F32[i];
-
-        // mask the given aperture and measure the apMag
-        psImageKeepCircle (mask, xc, yc, radius, "OR", PM_MASK_MARK);
-        pmSourcePhotometryAper (&apMag, model, image, mask);
-        psImageKeepCircle (mask, xc, yc, radius, "AND", PS_NOT_U8(PM_MASK_MARK));
-
-        // the 'ignore' mode is for testing
-        if (ignore) {
-            psf->growth->apMag->data.F32[i] = fitMag;
-        } else {
-            psf->growth->apMag->data.F32[i] = apMag;
-        }
-    }
-
-    psf->growth->apRef = psVectorInterpolate (psf->growth->radius, psf->growth->apMag, psf->growth->refRadius);
-    psf->growth->apLoss = psf->growth->fitMag - psf->growth->apRef;
-
-    psLogMsg ("psphot.growth", 4, "GrowthCurve : apLoss : %f\n", psf->growth->apLoss);
-
-    psFree (view);
-    psFree (image);
-    psFree (mask);
-    psFree (model);
-    psFree (modelRef);
-
-    return true;
-}
Index: /trunk/psModules/src/objects/pmGrowthCurve.h
===================================================================
--- /trunk/psModules/src/objects/pmGrowthCurve.h	(revision 9896)
+++ /trunk/psModules/src/objects/pmGrowthCurve.h	(revision 9897)
@@ -17,5 +17,4 @@
 pmGrowthCurve *pmGrowthCurveAlloc (psF32 minRadius, psF32 maxRadius, psF32 refRadius);
 psF32 pmGrowthCurveCorrect (pmGrowthCurve *growth, psF32 radius);
-bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore);
 
 # endif /* PM_GROWTH_CURVE_H */
Index: /trunk/psModules/src/objects/pmPSF.c
===================================================================
--- /trunk/psModules/src/objects/pmPSF.c	(revision 9896)
+++ /trunk/psModules/src/objects/pmPSF.c	(revision 9897)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-11-07 09:08:59 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-11-07 22:55:40 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,4 +32,7 @@
 #include "pmPSF.h"
 #include "pmModelGroup.h"
+#include "pmSourcePhotometry.h"
+#include "pmFPAMaskWeight.h"
+#include "psVectorBracket.h"
 
 /*****************************************************************************/
@@ -364,2 +367,80 @@
 }
 
+// we generate the growth curve for the center of the image with the specified psf model
+bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore)
+{
+
+    // bool status;
+    float xc, yc, dx, dy;
+    float fitMag, apMag;
+    float radius;
+
+    // create template model
+    pmModel *modelRef = pmModelAlloc(psf->type);
+
+    // use the center of the center pixel of the image
+    xc = 0.5*readout->image->numCols + readout->image->col0 + 0.5;
+    yc = 0.5*readout->image->numRows + readout->image->row0 + 0.5;
+    dx = psf->growth->maxRadius + 1;
+    dy = psf->growth->maxRadius + 1;
+
+    // assign the x and y coords to the image center
+    // create an object with center intensity of 1000
+    modelRef->params->data.F32[PM_PAR_SKY] = 0;
+    modelRef->params->data.F32[PM_PAR_I0] = 1000;
+    modelRef->params->data.F32[PM_PAR_XPOS] = xc;
+    modelRef->params->data.F32[PM_PAR_YPOS] = yc;
+
+    // create modelPSF from this model
+    pmModel *model = pmModelFromPSF (modelRef, psf);
+
+    // measure the fitMag for this model
+    pmSourcePhotometryModel (&fitMag, model);
+    psf->growth->fitMag = fitMag;
+
+    // generate working image for this source
+    psRegion region = {xc - dx, xc + dx, yc - dy, yc + dy};
+    psImage *view = psImageSubset (readout->image, region);
+    psImage *image = psImageCopy (NULL, view, PS_TYPE_F32);
+    psImage *mask = psImageCopy (NULL, view, PS_TYPE_U8);
+
+    psImageInit (image, 0.0);
+    psImageInit (mask, 0);
+
+    // place the reference object in the image center
+    // no need to mask the source here
+    pmModelAdd (image, NULL, model, false, false);
+
+    // loop over a range of source fluxes
+    // no need to interpolate since we have forced the object center
+    // to 0.5, 0.5 above
+    for (int i = 0; i < psf->growth->radius->n; i++) {
+
+        radius = psf->growth->radius->data.F32[i];
+
+        // mask the given aperture and measure the apMag
+        psImageKeepCircle (mask, xc, yc, radius, "OR", PM_MASK_MARK);
+        pmSourcePhotometryAper (&apMag, model, image, mask);
+        psImageKeepCircle (mask, xc, yc, radius, "AND", PS_NOT_U8(PM_MASK_MARK));
+
+        // the 'ignore' mode is for testing
+        if (ignore) {
+            psf->growth->apMag->data.F32[i] = fitMag;
+        } else {
+            psf->growth->apMag->data.F32[i] = apMag;
+        }
+    }
+
+    psf->growth->apRef = psVectorInterpolate (psf->growth->radius, psf->growth->apMag, psf->growth->refRadius);
+    psf->growth->apLoss = psf->growth->fitMag - psf->growth->apRef;
+
+    psLogMsg ("psphot.growth", 4, "GrowthCurve : apLoss : %f\n", psf->growth->apLoss);
+
+    psFree (view);
+    psFree (image);
+    psFree (mask);
+    psFree (model);
+    psFree (modelRef);
+
+    return true;
+}
Index: /trunk/psModules/src/objects/pmPSF.h
===================================================================
--- /trunk/psModules/src/objects/pmPSF.h	(revision 9896)
+++ /trunk/psModules/src/objects/pmPSF.h	(revision 9897)
@@ -93,3 +93,5 @@
 double pmPSF_SXYtoModel (psF32 *fittedPar);
 
+bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore);
+
 # endif
