Index: trunk/psphot/src/psphotChoosePSF.c
===================================================================
--- trunk/psphot/src/psphotChoosePSF.c	(revision 13900)
+++ trunk/psphot/src/psphotChoosePSF.c	(revision 14655)
@@ -127,6 +127,6 @@
     // print/dump psf parameters
     if (psTraceGetLevel("psphot") >= 5) {
-        for (int i = PM_PAR_SXX; i < try->psf->params_NEW->n; i++) {
-            psPolynomial2D *poly = try->psf->params_NEW->data[i];
+        for (int i = PM_PAR_SXX; i < try->psf->params->n; i++) {
+            psPolynomial2D *poly = try->psf->params->data[i];
             for (int nx = 0; nx <= poly->nX; nx++) {
                 for (int ny = 0; ny <= poly->nY; ny++) {
@@ -295,5 +295,5 @@
     }
 
-    char *modelName = pmModelGetType (psf->type);
+    char *modelName = pmModelClassGetName (psf->type);
     psLogMsg ("psphot.pspsf", PS_LOG_INFO, "select psf model: %f sec\n", psTimerMark ("psphot"));
     psLogMsg ("psphot.pspsf", PS_LOG_INFO, "psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid);
@@ -315,26 +315,13 @@
     PS_ASSERT_PTR_NON_NULL(image, false);
 
-    pmModel *modelEXT = pmModelAlloc (psf->type);
-    PS_ASSERT_PTR_NON_NULL(modelEXT, false);
-
-    // make a model with unit central intensity at the image center
-    modelEXT->params->data.F32[PM_PAR_SKY] = 0;
-    modelEXT->params->data.F32[PM_PAR_I0] = 1;
-    modelEXT->params->data.F32[PM_PAR_XPOS] = 0.5*image->numCols;
-    modelEXT->params->data.F32[PM_PAR_YPOS] = 0.5*image->numRows;
-
-    // construct a PSF model at this coordinate
-    pmModel *modelPSF = pmModelFromPSF (modelEXT, psf);
+    // construct a normalized PSF model at this coordinate (Io = 1.0)
+    pmModel *modelPSF = pmModelFromPSFforXY (psf, 0.5*image->numCols, 0.5*image->numRows, 1.0);
     if (modelPSF == NULL) {
         psError(PSPHOT_ERR_PSF, false, "Failed to estimate PSF model at image centre");
-        psFree(modelEXT);
         return false;
     }
 
-    // get the correct model-radius function
-    pmModelRadius modelRadiusFunc = pmModelRadius_GetFunction (psf->type);
-
     // get the model full-width at half-max
-    psF64 FWHM_X = 2*modelRadiusFunc (modelPSF->params, 0.5);
+    psF64 FWHM_X = 2*modelPSF->modelRadius (modelPSF->params, 0.5);
 
     // XXX make sure this is consistent with the re-definition of PM_PAR_SXX
@@ -351,6 +338,4 @@
     psMetadataAddS32 (recipe, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", psf->nPSFstars);
     psMetadataAddBool(recipe, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "Valid PSF Model?", true);
-
-    psFree (modelEXT);
     psFree (modelPSF);
 
